diff --git a/.eslintignore b/.eslintignore
index 6f1caaa873f19f..26de032f7e9715 100644
--- a/.eslintignore
+++ b/.eslintignore
@@ -1,5 +1,5 @@
lib/punycode.js
-test/addons/doc-*/
+test/addons/??_*/
test/fixtures
test/**/node_modules
test/disabled
diff --git a/.eslintrc b/.eslintrc
index 33a7919d88c9ef..f70fe2e1594b8a 100644
--- a/.eslintrc
+++ b/.eslintrc
@@ -27,8 +27,6 @@ rules:
no-duplicate-case: 2
## disallow assignment of exceptional params
no-ex-assign: 2
- ## disallow use of reserved words as keys like enum, class
- no-reserved-keys: 2
## disallow unreachable code
no-unreachable: 2
## require valid typeof compared string like typeof foo === 'strnig'
@@ -44,7 +42,7 @@ rules:
## use single quote, we can use double quote when escape chars
quotes: [2, "single", "avoid-escape"]
## 2 space indentation
- indent: [2, 2]
+ indent: [2, 2, {SwitchCase: 1}]
## add space after comma
comma-spacing: 2
## put semi-colon
@@ -67,8 +65,10 @@ rules:
eol-last: 2
## no trailing spaces
no-trailing-spaces: 2
- # require space after keywords, eg 'for (..)'
+ ## require space after keywords, eg 'for (..)'
space-after-keywords: 2
+ ## no leading/trailing spaces in parens
+ space-in-parens: [2, "never"]
# ECMAScript 6
# list: http://eslint.org/docs/rules/#ecmascript-6
@@ -112,5 +112,3 @@ globals:
DTRACE_NET_SERVER_CONNECTION : false
LTTNG_NET_SERVER_CONNECTION : false
COUNTER_NET_SERVER_CONNECTION : false
- escape : false
- unescape : false
diff --git a/.gitignore b/.gitignore
index 5cf2cd0a71cbdf..8f75e34da6fd5a 100644
--- a/.gitignore
+++ b/.gitignore
@@ -24,7 +24,7 @@ icu_config.gypi
# various stuff that VC++ produces/uses
Debug/
-!node_modules/debug/
+!**/node_modules/debug/
Release/
!doc/blog/**
*.sln
@@ -50,7 +50,7 @@ ipch/
/npm.wxs
/tools/msvs/npm.wixobj
/tools/osx-pkg.pmdoc/index.xml
-/test/addons/doc-*/
+/test/addons/??_*/
email.md
deps/v8-*
deps/icu
diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md
index 015c2b9d692f9c..8dee836460a3b3 100644
--- a/CODE_OF_CONDUCT.md
+++ b/CODE_OF_CONDUCT.md
@@ -1,11 +1,14 @@
## Code of Conduct
This Code of Conduct is adapted from [Rust's wonderful
-CoC](http://www.rust-lang.org/conduct.html).
+CoC](http://www.rust-lang.org/conduct.html) as well as the
+[Contributor Covenant v1.3.0](http://contributor-covenant.org/version/1/3/0/).
* We are committed to providing a friendly, safe and welcoming
- environment for all, regardless of gender, sexual orientation,
- disability, ethnicity, religion, or similar personal characteristic.
+ environment for all, regardless of level of experience, gender
+ identity and expression, sexual orientation, disability,
+ personal appearance, body size, race, ethnicity, age, religion,
+ nationality, or other similar characteristic.
* Please avoid using overtly sexual nicknames or other nicknames that
might detract from a friendly, safe and welcoming environment for
all.
diff --git a/LICENSE b/LICENSE
index ea51cc496d78fd..b39df1e0a8d9cb 100644
--- a/LICENSE
+++ b/LICENSE
@@ -51,142 +51,25 @@ maintained libraries.
The externally maintained libraries used by Node.js are:
-- V8, located at deps/v8. V8's license follows:
+- c-ares, located at deps/cares, is licensed as follows:
"""
- This license applies to all parts of V8 that are not externally
- maintained libraries. The externally maintained libraries used by V8
- are:
-
- - PCRE test suite, located in
- test/mjsunit/third_party/regexp-pcre.js. This is based on the
- test suite from PCRE-7.3, which is copyrighted by the University
- of Cambridge and Google, Inc. The copyright notice and license
- are embedded in regexp-pcre.js.
-
- - Layout tests, located in test/mjsunit/third_party. These are
- based on layout tests from webkit.org which are copyrighted by
- Apple Computer, Inc. and released under a 3-clause BSD license.
-
- - Strongtalk assembler, the basis of the files assembler-arm-inl.h,
- assembler-arm.cc, assembler-arm.h, assembler-ia32-inl.h,
- assembler-ia32.cc, assembler-ia32.h, assembler-x64-inl.h,
- assembler-x64.cc, assembler-x64.h, assembler-mips-inl.h,
- assembler-mips.cc, assembler-mips.h, assembler.cc and assembler.h.
- This code is copyrighted by Sun Microsystems Inc. and released
- under a 3-clause BSD license.
-
- - Valgrind client API header, located at third_party/valgrind/valgrind.h
- This is release under the BSD license.
-
- These libraries have their own licenses; we recommend you read them,
- as their terms may differ from the terms below.
-
- Copyright 2006-2012, the V8 project 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.
+ Copyright 1998 by the Massachusetts Institute of Technology.
+ Copyright (C) 2007-2013 by Daniel Stenberg
+
+ Permission to use, copy, modify, and distribute this
+ software and its documentation for any purpose and without
+ fee is hereby granted, provided that the above copyright
+ notice appear in all copies and that both that copyright
+ notice and this permission notice appear in supporting
+ documentation, and that the name of M.I.T. not be used in
+ advertising or publicity pertaining to distribution of the
+ software without specific, written prior permission.
+ M.I.T. makes no representations about the suitability of
+ this software for any purpose. It is provided "as is"
+ without express or implied warranty.
"""
-- C-Ares, an asynchronous DNS client, located at deps/cares. C-Ares license
- follows:
- """
- /* Copyright 1998 by the Massachusetts Institute of Technology.
- *
- * Permission to use, copy, modify, and distribute this
- * software and its documentation for any purpose and without
- * fee is hereby granted, provided that the above copyright
- * notice appear in all copies and that both that copyright
- * notice and this permission notice appear in supporting
- * documentation, and that the name of M.I.T. not be used in
- * advertising or publicity pertaining to distribution of the
- * software without specific, written prior permission.
- * M.I.T. makes no representations about the suitability of
- * this software for any purpose. It is provided "as is"
- * without express or implied warranty.
- """
-
-- OpenSSL located at deps/openssl. OpenSSL is cryptographic software written
- by Eric Young (eay@cryptsoft.com) to provide SSL/TLS encryption. OpenSSL's
- license follows:
- """
- /* ====================================================================
- * Copyright (c) 1998-2011 The OpenSSL Project. All rights reserved.
- *
- * 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.
- *
- * 3. All advertising materials mentioning features or use of this
- * software must display the following acknowledgment:
- * "This product includes software developed by the OpenSSL Project
- * for use in the OpenSSL Toolkit. (http://www.openssl.org/)"
- *
- * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
- * endorse or promote products derived from this software without
- * prior written permission. For written permission, please contact
- * openssl-core@openssl.org.
- *
- * 5. Products derived from this software may not be called "OpenSSL"
- * nor may "OpenSSL" appear in their names without prior written
- * permission of the OpenSSL Project.
- *
- * 6. Redistributions of any form whatsoever must retain the following
- * acknowledgment:
- * "This product includes software developed by the OpenSSL Project
- * for use in the OpenSSL Toolkit (http://www.openssl.org/)"
- *
- * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
- * EXPRESSED 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 OpenSSL PROJECT OR
- * ITS 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.
- * ====================================================================
- *
- * This product includes cryptographic software written by Eric Young
- * (eay@cryptsoft.com). This product includes software written by Tim
- * Hudson (tjh@cryptsoft.com).
- *
- */
- """
-
-- HTTP Parser, located at deps/http_parser. HTTP Parser's license follows:
+- HTTP Parser, located at deps/http_parser, is licensed as follows:
"""
http_parser.c is based on src/http/ngx_http_parse.c from NGINX copyright
Igor Sysoev.
@@ -213,16 +96,377 @@ The externally maintained libraries used by Node.js are:
IN THE SOFTWARE.
"""
-- ESLint is located at tools/eslint. ESLint's license follows:
+- ICU, located at deps/icu, is licensed as follows:
"""
- ESLint
- Copyright (c) 2013 Nicholas C. Zakas. All rights reserved.
+ ICU License - ICU 1.8.1 and later
+
+ COPYRIGHT AND PERMISSION NOTICE
+
+ Copyright (c) 1995-2015 International Business Machines Corporation and others
+
+ 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
+ of this software and associated documentation files (the "Software"),
+ to deal in the Software without restriction, including without limitation
+ the rights to use, copy, modify, merge, publish, distribute, and/or sell
+ copies of the Software, and to permit persons
+ to whom the Software is furnished to do so, provided that the above
+ copyright notice(s) and this permission notice appear in all copies
+ of the Software and that both the above copyright notice(s) and this
+ permission notice appear in supporting documentation.
+
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+ INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
+ PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS. IN NO EVENT SHALL
+ THE COPYRIGHT HOLDER OR HOLDERS INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM,
+ OR ANY SPECIAL 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.
+
+ Except as contained in this notice, the name of a copyright holder shall not be
+ used in advertising or otherwise to promote the sale, use or other dealings in
+ this Software without prior written authorization of the copyright holder.
+
+ All trademarks and registered trademarks mentioned herein are the property of their respective owners.
+
+ Third-Party Software Licenses
+ This section contains third-party software notices and/or additional terms for licensed
+ third-party software components included within ICU libraries.
+
+ 1. Unicode Data Files and Software
+
+ COPYRIGHT AND PERMISSION NOTICE
+
+ Copyright © 1991-2015 Unicode, Inc. All rights reserved.
+ Distributed under the Terms of Use in
+ http://www.unicode.org/copyright.html.
+
+ Permission is hereby granted, free of charge, to any person obtaining
+ a copy of the Unicode data files and any associated documentation
+ (the "Data Files") or Unicode software and any associated documentation
+ (the "Software") to deal in the Data Files or Software
+ without restriction, including without limitation the rights to use,
+ copy, modify, merge, publish, distribute, and/or sell copies of
+ the Data Files or Software, and to permit persons to whom the Data Files
+ or Software are furnished to do so, provided that
+ (a) this copyright and permission notice appear with all copies
+ of the Data Files or Software,
+ (b) this copyright and permission notice appear in associated
+ documentation, and
+ (c) there is clear notice in each modified Data File or in the Software
+ as well as in the documentation associated with the Data File(s) or
+ Software that the data or software has been modified.
+
+ THE DATA FILES AND SOFTWARE ARE PROVIDED "AS IS", WITHOUT WARRANTY OF
+ ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
+ WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ NONINFRINGEMENT OF THIRD PARTY RIGHTS.
+ IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS INCLUDED IN THIS
+ NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL 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 THE DATA FILES OR SOFTWARE.
+
+ Except as contained in this notice, the name of a copyright holder
+ shall not be used in advertising or otherwise to promote the sale,
+ use or other dealings in these Data Files or Software without prior
+ written authorization of the copyright holder.
+
+ 2. Chinese/Japanese Word Break Dictionary Data (cjdict.txt)
+
+ # The Google Chrome software developed by Google is licensed under the BSD license. Other software included in this distribution is provided under other licenses, as set forth below.
+ #
+ # The BSD License
+ # http://opensource.org/licenses/bsd-license.php
+ # Copyright (C) 2006-2008, Google Inc.
+ #
+ # 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.
+ #
+ #
+ # The word list in cjdict.txt are generated by combining three word lists listed
+ # below with further processing for compound word breaking. The frequency is generated
+ # with an iterative training against Google web corpora.
+ #
+ # * Libtabe (Chinese)
+ # - https://sourceforge.net/project/?group_id=1519
+ # - Its license terms and conditions are shown below.
+ #
+ # * IPADIC (Japanese)
+ # - http://chasen.aist-nara.ac.jp/chasen/distribution.html
+ # - Its license terms and conditions are shown below.
+ #
+ # ---------COPYING.libtabe ---- BEGIN--------------------
+ #
+ # /*
+ # * Copyrighy (c) 1999 TaBE Project.
+ # * Copyright (c) 1999 Pai-Hsiang Hsiao.
+ # * 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 TaBE Project 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
+ # * REGENTS 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.
+ # */
+ #
+ # /*
+ # * Copyright (c) 1999 Computer Systems and Communication Lab,
+ # * Institute of Information Science, Academia Sinica.
+ # * 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 Computer Systems and Communication Lab
+ # * 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
+ # * REGENTS 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.
+ # */
+ #
+ # Copyright 1996 Chih-Hao Tsai @ Beckman Institute, University of Illinois
+ # c-tsai4@uiuc.edu http://casper.beckman.uiuc.edu/~c-tsai4
+ #
+ # ---------------COPYING.libtabe-----END------------------------------------
+ #
+ #
+ # ---------------COPYING.ipadic-----BEGIN------------------------------------
+ #
+ # Copyright 2000, 2001, 2002, 2003 Nara Institute of Science
+ # and Technology. All Rights Reserved.
+ #
+ # Use, reproduction, and distribution of this software is permitted.
+ # Any copy of this software, whether in its original form or modified,
+ # must include both the above copyright notice and the following
+ # paragraphs.
+ #
+ # Nara Institute of Science and Technology (NAIST),
+ # the copyright holders, disclaims all warranties with regard to this
+ # software, including all implied warranties of merchantability and
+ # fitness, in no event shall NAIST be liable for
+ # any special, 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 tortuous action, arising out
+ # of or in connection with the use or performance of this software.
+ #
+ # A large portion of the dictionary entries
+ # originate from ICOT Free Software. The following conditions for ICOT
+ # Free Software applies to the current dictionary as well.
+ #
+ # Each User may also freely distribute the Program, whether in its
+ # original form or modified, to any third party or parties, PROVIDED
+ # that the provisions of Section 3 ("NO WARRANTY") will ALWAYS appear
+ # on, or be attached to, the Program, which is distributed substantially
+ # in the same form as set out herein and that such intended
+ # distribution, if actually made, will neither violate or otherwise
+ # contravene any of the laws and regulations of the countries having
+ # jurisdiction over the User or the intended distribution itself.
+ #
+ # NO WARRANTY
+ #
+ # The program was produced on an experimental basis in the course of the
+ # research and development conducted during the project and is provided
+ # to users as so produced on an experimental basis. Accordingly, the
+ # program is provided without any warranty whatsoever, whether express,
+ # implied, statutory or otherwise. The term "warranty" used herein
+ # includes, but is not limited to, any warranty of the quality,
+ # performance, merchantability and fitness for a particular purpose of
+ # the program and the nonexistence of any infringement or violation of
+ # any right of any third party.
+ #
+ # Each user of the program will agree and understand, and be deemed to
+ # have agreed and understood, that there is no warranty whatsoever for
+ # the program and, accordingly, the entire risk arising from or
+ # otherwise connected with the program is assumed by the user.
+ #
+ # Therefore, neither ICOT, the copyright holder, or any other
+ # organization that participated in or was otherwise related to the
+ # development of the program and their respective officials, directors,
+ # officers and other employees shall be held liable for any and all
+ # damages, including, without limitation, general, special, incidental
+ # and consequential damages, arising out of or otherwise in connection
+ # with the use or inability to use the program or any product, material
+ # or result produced or otherwise obtained by using the program,
+ # regardless of whether they have been advised of, or otherwise had
+ # knowledge of, the possibility of such damages at any time during the
+ # project or thereafter. Each user will be deemed to have agreed to the
+ # foregoing by his or her commencement of use of the program. The term
+ # "use" as used herein includes, but is not limited to, the use,
+ # modification, copying and distribution of the program and the
+ # production of secondary products from the program.
+ #
+ # In the case where the program, whether in its original form or
+ # modified, was distributed or delivered to or received by a user from
+ # any person, organization or entity other than ICOT, unless it makes or
+ # grants independently of ICOT any specific warranty to the user in
+ # writing, such person, organization or entity, will also be exempted
+ # from and not be held liable to the user for any such damages as noted
+ # above as far as the program is concerned.
+ #
+ # ---------------COPYING.ipadic-----END------------------------------------
+
+ 3. Lao Word Break Dictionary Data (laodict.txt)
+
+ # Copyright (c) 2013 International Business Machines Corporation
+ # and others. All Rights Reserved.
+ #
+ # Project: http://code.google.com/p/lao-dictionary/
+ # Dictionary: http://lao-dictionary.googlecode.com/git/Lao-Dictionary.txt
+ # License: http://lao-dictionary.googlecode.com/git/Lao-Dictionary-LICENSE.txt
+ # (copied below)
+ #
+ # This file is derived from the above dictionary, with slight modifications.
+ # --------------------------------------------------------------------------------
+ # Copyright (C) 2013 Brian Eugene Wilson, Robert Martin Campbell.
+ # 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.
+ #
+ # 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.
+ # --------------------------------------------------------------------------------
+
+ 4. Burmese Word Break Dictionary Data (burmesedict.txt)
+
+ # Copyright (c) 2014 International Business Machines Corporation
+ # and others. All Rights Reserved.
+ #
+ # This list is part of a project hosted at:
+ # github.com/kanyawtech/myanmar-karen-word-lists
+ #
+ # --------------------------------------------------------------------------------
+ # Copyright (c) 2013, LeRoy Benjamin Sharon
+ # 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 Myanmar Karen Word Lists, 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.
+ # --------------------------------------------------------------------------------
+
+ 5. Time Zone Database
+ ICU uses the public domain data and code derived from
+ Time Zone Database for its time zone support. The ownership of the TZ database is explained
+ in BCP 175: Procedure for Maintaining the Time Zone
+ Database section 7.
+
+ 7. Database Ownership
+
+ The TZ database itself is not an IETF Contribution or an IETF
+ document. Rather it is a pre-existing and regularly updated work
+ that is in the public domain, and is intended to remain in the public
+ domain. Therefore, BCPs 78 [RFC5378] and 79 [RFC3979] do not apply
+ to the TZ Database or contributions that individuals make to it.
+ Should any claims be made and substantiated against the TZ Database,
+ the organization that is providing the IANA Considerations defined in
+ this RFC, under the memorandum of understanding with the IETF,
+ currently ICANN, may act in accordance with all competent court
+ orders. No ownership claims will be made by ICANN or the IETF Trust
+ on the database or the code. Any person making a contribution to the
+ database or code waives all rights to future claims in that
+ contribution or in the TZ Database.
+ """
+
+- libuv, located at deps/uv, is licensed as follows:
+ """
+ libuv is part of the Node project: http://nodejs.org/
+ libuv may be distributed alone under Node's license:
+
+ ====
+
+ Copyright Joyent, Inc. and other Node contributors. 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
@@ -232,67 +476,159 @@ The externally maintained libraries used by Node.js are:
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
- THE SOFTWARE.
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+ IN THE SOFTWARE.
+
+ ====
+
+ This license applies to all parts of libuv that are not externally
+ maintained libraries.
+
+ The externally maintained libraries used by libuv are:
+
+ - tree.h (from FreeBSD), copyright Niels Provos. Two clause BSD license.
+
+ - inet_pton and inet_ntop implementations, contained in src/inet.c, are
+ copyright the Internet Systems Consortium, Inc., and licensed under the ISC
+ license.
+
+ - stdint-msvc2008.h (from msinttypes), copyright Alexander Chemeris. Three
+ clause BSD license.
+
+ - pthread-fixes.h, pthread-fixes.c, copyright Google Inc. and Sony Mobile
+ Communications AB. Three clause BSD license.
+
+ - android-ifaddrs.h, android-ifaddrs.c, copyright Berkeley Software Design
+ Inc, Kenneth MacKay and Emergya (Cloud4all, FP7/2007-2013, grant agreement
+ n° 289016). Three clause BSD license.
"""
-- tools/cpplint.py is a C++ linter. Its license follows:
+- OpenSSL, located at deps/openssl, is licensed as follows:
"""
- # Copyright (c) 2009 Google Inc. 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.
+ Copyright (c) 1998-2011 The OpenSSL Project. All rights reserved.
+
+ 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.
+
+ 3. All advertising materials mentioning features or use of this
+ software must display the following acknowledgment:
+ "This product includes software developed by the OpenSSL Project
+ for use in the OpenSSL Toolkit. (http://www.openssl.org/)"
+
+ 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
+ endorse or promote products derived from this software without
+ prior written permission. For written permission, please contact
+ openssl-core@openssl.org.
+
+ 5. Products derived from this software may not be called "OpenSSL"
+ nor may "OpenSSL" appear in their names without prior written
+ permission of the OpenSSL Project.
+
+ 6. Redistributions of any form whatsoever must retain the following
+ acknowledgment:
+ "This product includes software developed by the OpenSSL Project
+ for use in the OpenSSL Toolkit (http://www.openssl.org/)"
+
+ THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
+ EXPRESSED 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 OpenSSL PROJECT OR
+ ITS 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.
+ ====================================================================
+
+ This product includes cryptographic software written by Eric Young
+ (eay@cryptsoft.com). This product includes software written by Tim
+ Hudson (tjh@cryptsoft.com).
"""
-- lib/punycode.js is copyright 2011 Mathias Bynens You need node v0.8 or higher to run this program. To install an old and unsupported version of npm that works on node 0.3
and prior, clone the git repo and dig through the old tags and branches. npm is configured to use npm, Inc.'s public package registry at
+https://registry.npmjs.org by default. You can configure npm to use any compatible registry you
+like, and even run your own registry. Check out the doc on
+registries. Use of someone else's registry may be governed by terms of use. The
+terms of use for the default public registry are available at
+https://www.npmjs.com. npm is bundled with node.IMPORTANT
Super Easy Install
Windows Computers
@@ -84,76 +92,12 @@ More Severe Uninstalling
must remove them yourself manually if you want them gone. Note that
this means that future npm installs will not remember the settings that
you have chosen.
Although npm can be used programmatically, its API is meant for use by the CLI
-only, and no guarantees are made regarding its fitness for any other purpose.
-If you want to use npm to reliably perform some task, the safest thing to do is
-to invoke the desired npm
command with appropriate arguments.
The semantic version of npm refers to the CLI itself, rather than the -underlying API. The internal API is not guaranteed to remain stable even when -npm's version indicates no breaking changes have been made according to -semver.
-If you still would like to use npm programmatically, it's possible. The API -isn't very well documented, but it is rather simple.
-Eventually, npm will be just a thin CLI wrapper around the modules that it -depends on, but for now, there are some things that only the CLI can do. You -should try using one of npm's dependencies first, and only use the API if what -you're trying to do is only supported by npm itself.
-var npm = require("npm")
-npm.load(myConfigObject, function (er) {
- if (er) return handlError(er)
- npm.commands.install(["some", "args"], function (er, data) {
- if (er) return commandFailed(er)
- // command succeeded, and data might have some info
- })
- npm.registry.log.on("log", function (message) { .... })
-})
-
-The load
function takes an object hash of the command-line configs.
-The various npm.commands.<cmd>
functions take an array of
-positional argument strings. The last argument to any
-npm.commands.<cmd>
function is a callback. Some commands take other
-optional arguments. Read the source.
You cannot set configs individually for any single npm function at this
-time. Since npm
is a singleton, any call to npm.config.set
will
-change the value for all npm commands in that process.
See ./bin/npm-cli.js
for an example of pulling config values off of the
-command line arguments using nopt. You may also want to check out npm
-help config
to learn about all the options you can set there.
Check out the docs, especially the faq.
You can use the npm help
command to read any of them.
If you're a developer, and you want to use npm to publish your program, you should read this
-"npm" and "The npm Registry" are owned by npm, Inc. -All rights reserved. See the included LICENSE file for more details.
-"Node.js" and "node" are trademarks owned by Joyent, Inc.
-Modules published on the npm registry are not officially endorsed by -npm, Inc. or the Node.js project.
-Data published to the npm registry is not part of npm itself, and is -the sole property of the publisher. While every effort is made to -ensure accountability, there is absolutely no guarantee, warranty, or -assertion expressed or implied as to the quality, fitness for a -specific purpose, or lack of malice in any given npm package.
-If you have a complaint about a package in the public npm registry, -and cannot resolve it with the package -owner, please email -support@npmjs.com and explain the situation.
-Any data published to The npm Registry (including user account -information) may be removed or modified at the sole discretion of the -npm server administrators.
-npm is the property of npm, Inc.
-If you publish something, it's yours, and you are solely accountable -for it.
-If other people publish something, it's theirs.
-Users can publish Bad Stuff. It will be removed promptly if reported. -But there is no vetting process for published modules, and you use -them at your own risk. Please inspect the source.
-If you publish Bad Stuff, we may delete it from the registry, or even -ban your account in extreme cases. So don't do that.
When you find issues, please report them:
2.14.12
+2.14.18
This is the API documentation for npm. To find documentation of the command line @@ -109,5 +109,5 @@
npm login
is an alias to adduser
and behaves exactly the same way.
Default: http://registry.npmjs.org/
+Default: https://registry.npmjs.org/
The base URL of the npm package registry. If scope
is also specified,
this registry will only be used for packages with that scope. See npm-scope(7)
.
When installing dependencies, a preferred tagged version may be specified:
npm install --tag <tag>
This also applies to npm dedupe
.
Publishing a package sets the "latest" tag to the published version unless the +
Publishing a package sets the latest
tag to the published version unless the
--tag
option is used. For example, npm publish --tag=beta
.
By default, npm install <pkg>
(without any @<version>
or @<tag>
+specifier) installs the latest
tag.
Tags can be used to provide an alias instead of version numbers. For
-example, npm
currently uses the tag "next" to identify the upcoming
-version, and the tag "latest" to identify the current version.
A project might choose to have multiple streams of development, e.g., -"stable", "canary".
+Tags can be used to provide an alias instead of version numbers.
+For example, a project might choose to have multiple streams of development
+and use a different tag for each stream,
+e.g., stable
, beta
, dev
, canary
.
By default, the latest
tag is used by npm to identify the current version of
+a package, and npm install <pkg>
(without any @<version>
or @<tag>
+specifier) installs the latest
tag. Typically, projects only use the latest
+tag for stable release versions, and use other tags for unstable versions such
+as prereleases.
The next
tag is used by some projects to identify the upcoming version.
By default, other than latest
, no tag has any special significance to npm
+itself.
This command used to be known as npm tag
, which only created new tags, and so
had a different syntax.
Install package(s) and run tests
+npm install-test (with no args, in package dir)
+npm install-test [<@scope>/]<name>
+npm install-test [<@scope>/]<name>@<tag>
+npm install-test [<@scope>/]<name>@<version>
+npm install-test [<@scope>/]<name>@<version range>
+npm install-test <tarball file>
+npm install-test <tarball url>
+npm install-test <folder>
+
+alias: npm it
+common options: [--save|--save-dev|--save-optional] [--save-exact] [--dry-run]
+
This command runs an npm install
followed immediately by an npm test
. It
+takes exactly the same arguments as npm install
.
A package
is:
package.json(5)
file<name>@<version>
that is published on the registry (see npm-registry(7)
) with (c)<name>@<tag>
that points to (d)<name>@<tag>
(see npm-dist-tag(1)
) that points to (d)<name>
that has a "latest" tag satisfying (e)<git remote url>
that resolves to (b) In global mode (ie, with -g
or --global
appended to the command),
it installs the current package context (ie, the current working
directory) as a global package.
By default, npm install
will install all modules listed as dependencies.
- With the --production
flag (or when the NODE_ENV
environment variable
+
By default, npm install
will install all modules listed as dependencies
+ in package.json(5)
.
With the --production
flag (or when the NODE_ENV
environment variable
is set to production
), npm will not install modules listed in
devDependencies
.
npm install [@<scope>/]<name> [--save|--save-dev|--save-optional]
:
Do a <name>@<tag>
install, where <tag>
is the "tag" config. (See
- npm-config(7)
.)
npm-config(7)
. The config's default value is latest
.)
In most cases, this will install the latest version of the module published on npm.
Example:
@@ -262,8 +263,9 @@Default: http://registry.npmjs.org/
+Default: https://registry.npmjs.org/
The base URL of the npm package registry. If scope
is also specified,
it takes precedence.
npm ls promzard
in npm's source tree will show:
-npm@2.14.12 /path/to/npm
+npm@2.14.18 /path/to/npm
└─┬ init-package-json@0.0.4
└── promzard@0.1.5
It will print out extraneous, missing, and invalid packages.
@@ -97,5 +97,5 @@ SEE ALSO
-
+
diff --git a/deps/npm/html/doc/cli/npm-outdated.html b/deps/npm/html/doc/cli/npm-outdated.html
index c36135b39eef3d..600986cd569441 100644
--- a/deps/npm/html/doc/cli/npm-outdated.html
+++ b/deps/npm/html/doc/cli/npm-outdated.html
@@ -15,9 +15,56 @@ SYNOPSIS
This command will check the registry to see if any (or, specific) installed packages are currently outdated.
-The resulting field 'wanted' shows the latest version according to the -version specified in the package.json, the field 'latest' the very latest -version of the package.
+In the output:
+wanted
is the maximum version of the package that satisfies the semver
+range specified in package.json
. If there's no available semver range (i.e.
+you're running npm outdated --global
, or the package isn't included in
+package.json
), then wanted
shows the currently-installed version.latest
is the version of the package tagged as latest in the registry.
+Running npm publish
with no special configuration will publish the package
+with a dist-tag of latest
. This may or may not be the maximum version of
+the package, or the most-recently published version of the package, depending
+on how the package's developer manages the latest dist-tag(1).location
is where in the dependency tree the package is located. Note that
+npm outdated
defaults to a depth of 0, so unless you override that, you'll
+always be seeing only top-level dependencies that are outdated.package type
(when using --long
/ -l
) tells you whether this package is
+a dependency
or a devDependency
. Packages not included in package.json
+are always marked dependencies
.$ npm outdated
+Package Current Wanted Latest Location
+glob 5.0.15 5.0.15 6.0.1 test-outdated-output
+nothingness 0.0.3 git git test-outdated-output
+npm 3.5.1 3.5.2 3.5.1 test-outdated-output
+local-dev 0.0.3 linked linked test-outdated-output
+once 1.3.2 1.3.3 1.3.3 test-outdated-output
+
With these dependencies
:
{
+ "glob": "^5.0.15",
+ "nothingness": "github:othiym23/nothingness#master",
+ "npm": "^3.5.1",
+ "once": "^1.3.1"
+}
+
+A few things to note:
+glob
requires ^5
, which prevents npm from installing glob@6
, which is
+outside the semver range.npm outdated
and
+npm update
have to fetch Git repos to check. This is why currently doing a
+reinstall of a Git dependency always forces a new clone and install.npm@3.5.2
is marked as "wanted", but "latest" is npm@3.5.1
because npm
+uses dist-tags to manage its latest
and next
release channels. npm update
+will install the newest version, but npm install npm
(with no semver range)
+will install whatever's tagged as latest
.once
is just plain out of date. Reinstalling node_modules
from scratch or
+running npm update
will bring it up to spec.Max depth for checking dependency tree.
NODE_ENV
being set to production
.
npm publish <tarball> [--tag <tag>] [--access <public|restricted>]
npm publish <folder> [--tag <tag>] [--access <public|restricted>]
Publishes a package to the registry so that it can be installed by name. See
-npm-developers(7)
for details on what's included in the published package, as
-well as details on how the package is built.
Publishes a package to the registry so that it can be installed by name. All
+files in the package directory are included if no local .gitignore
or
+.npmignore
file is present. See npm-developers(7)
for full details on
+what's included in the published package, as well as details on how the package
+is built.
By default npm will publish to the public registry. This can be overridden by
specifying a different default registry or using a npm-scope(7)
in the name
(see package.json(5)
).
[--tag <tag>]
Registers the published package with the given tag, such that npm install
<name>@<tag>
will install this version. By default, npm publish
updates
-and npm install
installs the latest
tag.
npm install
installs the latest
tag. See npm-dist-tag(1)
for
+details about tags.
[--access <public|restricted>]
Tells the registry whether this package should be published as public or
@@ -66,5 +69,5 @@
Teams must always be fully qualified with the organization/scope they belond to
when operating on them, separated by a colon (:
). That is, if you have a
developers
team on a foo
organization, you must always refer to that team as
-developers:foo
in these commands.
foo:developers
in these commands.
create / destroy: Create a new team, or destroy an existing one.
@@ -67,4 +67,4 @@Remove a package
+Remove a package
npm uninstall [@<scope>/]<package> [--save|--save-dev|--save-optional]
npm rm (with any of the previous argument usage)
@@ -57,5 +57,5 @@ SYNOPSIS
-
+
diff --git a/deps/npm/html/doc/cli/npm-unpublish.html b/deps/npm/html/doc/cli/npm-unpublish.html
index 12ca4b98a72c6b..19d030eff0b21b 100644
--- a/deps/npm/html/doc/cli/npm-unpublish.html
+++ b/deps/npm/html/doc/cli/npm-unpublish.html
@@ -47,5 +47,5 @@ SEE ALSO
-
+
diff --git a/deps/npm/html/doc/cli/npm-update.html b/deps/npm/html/doc/cli/npm-update.html
index f70b9b8281f690..93ba10c0954e36 100644
--- a/deps/npm/html/doc/cli/npm-update.html
+++ b/deps/npm/html/doc/cli/npm-update.html
@@ -24,7 +24,7 @@ SYNOPSIS
or local) will be updated.
As of npm@2.6.1
, the npm update
will only inspect top-level packages.
Prior versions of npm
would also recursively inspect all dependencies.
-To get the old behavior, use npm --depth 9999 update
, but be warned that
+To get the old behavior, use npm --depth Infinity update
, but be warned that
simultaneous asynchronous update of all packages, including npm
itself
and packages that npm
depends on, often causes problems up to and including
the uninstallation of npm
itself.
@@ -37,29 +37,30 @@ SYNOPSIS
For the examples below, assume that the current package is app
and it depends
on dependencies, dep1
(dep2
, .. etc.). The published versions of dep1
are:
{
- dist-tags: { latest: "1.2.2" },
- versions: { "1.2.2",
- "1.2.1",
- "1.2.0",
- "1.1.2",
- "1.1.1",
- "1.0.0",
- "0.4.1",
- "0.4.0",
- "0.2.0"
+ "dist-tags": { "latest": "1.2.2" },
+ "versions": {
+ "1.2.2",
+ "1.2.1",
+ "1.2.0",
+ "1.1.2",
+ "1.1.1",
+ "1.0.0",
+ "0.4.1",
+ "0.4.0",
+ "0.2.0"
}
}
Caret Dependencies
If app
's package.json
contains:
-dependencies: {
- dep1: "^1.1.1"
+"dependencies": {
+ "dep1": "^1.1.1"
}
Then npm update
will install dep1@1.2.2
, because 1.2.2
is latest
and
1.2.2
satisfies ^1.1.1
.
Tilde Dependencies
However, if app
's package.json
contains:
-dependencies: {
- dep1: "~1.1.1"
+"dependencies": {
+ "dep1": "~1.1.1"
}
In this case, running npm update
will install dep1@1.1.2
. Even though the latest
tag points to 1.2.2
, this version does not satisfy ~1.1.1
, which is equivalent
@@ -67,14 +68,14 @@
Tilde Dependencies
which is 1.1.2
.
Caret Dependencies below 1.0.0
Suppose app
has a caret dependency on a version below 1.0.0
, for example:
-dependencies: {
- dep1: "^0.2.0"
+"dependencies": {
+ "dep1": "^0.2.0"
}
npm update
will install dep1@0.2.0
, because there are no other
versions which satisfy ^0.2.0
.
If the dependence were on ^0.4.0
:
-dependencies: {
- dep1: "^0.4.0"
+"dependencies": {
+ "dep1": "^0.4.0"
}
Then npm update
will install dep1@0.4.1
, because that is the highest-sorting
version that satisfies ^0.4.0
(>= 0.4.0 <0.5.0
)
@@ -82,18 +83,18 @@ Recording Updates with --save
When you want to update a package and save the new version as
the minimum required dependency in package.json
, you can use
npm update --save
. For example if package.json
contains
-dependencies: {
- dep1: "^1.1.1"
+"dependencies": {
+ "dep1": "^1.1.1"
}
Then npm update --save
will install dep1@1.2.2
(i.e., latest
),
and package.json
will be modified:
-dependencies: {
- dep1: "^1.2.2"
+"dependencies": {
+ "dep1": "^1.2.2"
}
Note that npm
will only write an updated version to package.json
if it installs a new package.
Updating Globally-Installed Packages
-npm update -g
will apply the update
action to each globally- installed
+
npm update -g
will apply the update
action to each globally installed
package that is outdated
-- that is, has a version that is different from
latest
.
NOTE: If a package has been upgraded to a version newer than latest
, it will
@@ -119,5 +120,5 @@
SEE ALSO
-
+
diff --git a/deps/npm/html/doc/cli/npm-version.html b/deps/npm/html/doc/cli/npm-version.html
index d0ccbf73c1ec85..d397903e695bdc 100644
--- a/deps/npm/html/doc/cli/npm-version.html
+++ b/deps/npm/html/doc/cli/npm-version.html
@@ -95,5 +95,5 @@ SEE ALSO
-
+
diff --git a/deps/npm/html/doc/cli/npm-view.html b/deps/npm/html/doc/cli/npm-view.html
index cbb64e7dfd8753..79c385807f2b5c 100644
--- a/deps/npm/html/doc/cli/npm-view.html
+++ b/deps/npm/html/doc/cli/npm-view.html
@@ -52,6 +52,9 @@ SYNOPSIS
matching version of the package. This will show which version of jsdom
was required by each matching version of yui3:
npm view yui3@'>0.5.4' dependencies.jsdom
+
To show the connect
package version history, you can do
+this:
+npm view connect versions
OUTPUT
If only a single string field for a single version is output, then it
will not be colorized or quoted, so as to enable piping the output to
@@ -82,5 +85,5 @@
SEE ALSO
-
+
diff --git a/deps/npm/html/doc/cli/npm-whoami.html b/deps/npm/html/doc/cli/npm-whoami.html
index b6514d871dbb70..7c1095eb69b7e2 100644
--- a/deps/npm/html/doc/cli/npm-whoami.html
+++ b/deps/npm/html/doc/cli/npm-whoami.html
@@ -33,5 +33,5 @@ SEE ALSO
-
+
diff --git a/deps/npm/html/doc/cli/npm.html b/deps/npm/html/doc/cli/npm.html
index 9844e540eeb773..649645bf92ae0a 100644
--- a/deps/npm/html/doc/cli/npm.html
+++ b/deps/npm/html/doc/cli/npm.html
@@ -13,7 +13,7 @@ npm
javascript package manager
SYNOPSIS
npm <command> [args]
VERSION
-2.14.12
+2.14.18
DESCRIPTION
npm is the package manager for the Node JavaScript platform. It puts
modules in place so that node can find them, and manages dependency
@@ -109,16 +109,16 @@
CONTRIBUTIONS
If you would like to contribute, but don't know what to work on, check
the issues list or ask on the mailing list.
-- http://github.com/npm/npm/issues
-- npm-@googlegroups.com
+- https://github.com/npm/npm/issues
+- npm-@googlegroups.com
BUGS
When you find issues, please report them:
- web:
-http://github.com/npm/npm/issues
+https://github.com/npm/npm/issues
- email:
-npm-@googlegroups.com
+npm-@googlegroups.com
Be sure to include all of the output from the npm command that didn't work
as expected. The npm-debug.log
file is also helpful to provide.
@@ -128,7 +128,7 @@ AUTHOR
Isaac Z. Schlueter ::
isaacs ::
@izs ::
-i@izs.me
+i@izs.me
SEE ALSO
- npm-help(1)
@@ -154,5 +154,5 @@ SEE ALSO
-
+
diff --git a/deps/npm/html/doc/files/npm-folders.html b/deps/npm/html/doc/files/npm-folders.html
index 8cb1493bbb45a4..d1292d6e675a02 100644
--- a/deps/npm/html/doc/files/npm-folders.html
+++ b/deps/npm/html/doc/files/npm-folders.html
@@ -25,11 +25,10 @@ tl;dr
prefix Configuration
The prefix
config defaults to the location where node is installed.
-On most systems, this is /usr/local
, and most of the time is the same
-as node's process.installPrefix
.
-On windows, this is the exact location of the node.exe binary. On Unix
-systems, it's one level up, since node is typically installed at
-{prefix}/bin/node
rather than {prefix}/node.exe
.
+On most systems, this is /usr/local
. On windows, this is the exact
+location of the node.exe binary. On Unix systems, it's one level up,
+since node is typically installed at {prefix}/bin/node
rather than
+{prefix}/node.exe
.
When the global
flag is set, npm installs things into this prefix.
When it is not set, it uses the root of the current package, or the
current working directory if not in a package already.
@@ -184,5 +183,5 @@ SEE ALSO
-
+
diff --git a/deps/npm/html/doc/files/npm-global.html b/deps/npm/html/doc/files/npm-global.html
index 8cb1493bbb45a4..d1292d6e675a02 100644
--- a/deps/npm/html/doc/files/npm-global.html
+++ b/deps/npm/html/doc/files/npm-global.html
@@ -25,11 +25,10 @@ tl;dr
prefix Configuration
The prefix
config defaults to the location where node is installed.
-On most systems, this is /usr/local
, and most of the time is the same
-as node's process.installPrefix
.
-On windows, this is the exact location of the node.exe binary. On Unix
-systems, it's one level up, since node is typically installed at
-{prefix}/bin/node
rather than {prefix}/node.exe
.
+On most systems, this is /usr/local
. On windows, this is the exact
+location of the node.exe binary. On Unix systems, it's one level up,
+since node is typically installed at {prefix}/bin/node
rather than
+{prefix}/node.exe
.
When the global
flag is set, npm installs things into this prefix.
When it is not set, it uses the root of the current package, or the
current working directory if not in a package already.
@@ -184,5 +183,5 @@ SEE ALSO
-
+
diff --git a/deps/npm/html/doc/files/npm-json.html b/deps/npm/html/doc/files/npm-json.html
index 1f50c9fcf4858a..6b01278676449d 100644
--- a/deps/npm/html/doc/files/npm-json.html
+++ b/deps/npm/html/doc/files/npm-json.html
@@ -24,7 +24,7 @@ name
The name is what your thing is called.
Some rules:
-- The name must be shorter than 214 characters. This includes the scope for
+
- The name must be less than or equal to 214 characters. This includes the scope for
scoped packages.
- The name can't start with a dot or an underscore.
- New packages must not have uppercase letters in the name.
@@ -85,12 +85,12 @@ license
{ "license" : "BSD-3-Clause" }
You can check the full list of SPDX license IDs.
Ideally you should pick one that is
-OSI approved.
-If your package is licensed under multiple common licenses, use an SPDX license
+OSI approved.
+If your package is licensed under multiple common licenses, use an SPDX license
expression syntax version 2.0 string, like this:
{ "license" : "(ISC OR GPL-3.0)" }
If you are using a license that hasn't been assigned an SPDX identifier, or if
-you are using a custom license, use the following valid SPDX expression:
+you are using a custom license, use a string value like this one:
{ "license" : "SEE LICENSE IN <filename>" }
Then include a file named <filename>
at the top level of the package.
Some old packages used license objects or a "licenses" property containing an
@@ -143,9 +143,10 @@
files
Certain files are always included, regardless of settings:
package.json
-README
(and its variants)
-CHANGELOG
(and its variants)
+README
+CHANGES
/ CHANGELOG
/ HISTORY
(any casing and file extension)
LICENSE
/ LICENCE
+- The file in the "main" field
Conversely, some files are always ignored:
@@ -155,10 +156,11 @@ files
.hg
.lock-wscript
.wafpickle-N
-*.swp
+.*.swp
.DS_Store
._*
npm-debug.log
+.npmrc
main
The main field is a module ID that is the primary entry point to your program.
@@ -309,7 +311,7 @@
dependencies
git...
See 'Git URLs as Dependencies' below
user/repo
See 'GitHub URLs' below
tag
A specific version tagged and published as tag
See npm-tag(1)
-path/path/path
See Local Paths below
+path/path/path
See Local Paths below
For example, these are all valid:
{ "dependencies" :
@@ -551,7 +553,7 @@ SEE ALSO
- npm-faq(7)
- npm-install(1)
- npm-publish(1)
-- npm-rm(1)
+- npm-uninstall(1)
The name is what your thing is called.
Some rules:
{ "license" : "BSD-3-Clause" }
You can check the full list of SPDX license IDs. Ideally you should pick one that is -OSI approved.
-If your package is licensed under multiple common licenses, use an SPDX license +OSI approved.
+If your package is licensed under multiple common licenses, use an SPDX license expression syntax version 2.0 string, like this:
{ "license" : "(ISC OR GPL-3.0)" }
If you are using a license that hasn't been assigned an SPDX identifier, or if -you are using a custom license, use the following valid SPDX expression:
+you are using a custom license, use a string value like this one:{ "license" : "SEE LICENSE IN <filename>" }
Then include a file named <filename>
at the top level of the package.
Some old packages used license objects or a "licenses" property containing an @@ -143,9 +143,10 @@
Certain files are always included, regardless of settings:
package.json
README
(and its variants)CHANGELOG
(and its variants)README
CHANGES
/ CHANGELOG
/ HISTORY
(any casing and file extension)LICENSE
/ LICENCE
Conversely, some files are always ignored:
.hg
.lock-wscript
.wafpickle-N
*.swp
.*.swp
.DS_Store
._*
npm-debug.log
.npmrc
The main field is a module ID that is the primary entry point to your program. @@ -309,7 +311,7 @@
git...
See 'Git URLs as Dependencies' belowuser/repo
See 'GitHub URLs' belowtag
A specific version tagged and published as tag
See npm-tag(1)
path/path/path
See Local Paths belowpath/path/path
See Local Paths belowFor example, these are all valid:
{ "dependencies" :
@@ -551,7 +553,7 @@ SEE ALSO
npm-faq(7)
npm-install(1)
npm-publish(1)
-npm-rm(1)
+npm-uninstall(1)
@@ -565,5 +567,5 @@ SEE ALSO
-
+
diff --git a/deps/npm/html/doc/index.html b/deps/npm/html/doc/index.html
index 2a194912db3efd..339c6e8fb715b9 100644
--- a/deps/npm/html/doc/index.html
+++ b/deps/npm/html/doc/index.html
@@ -216,8 +216,6 @@ npm-developers(7)<
Developer Guide
npm-disputes(7)
Handling Module Name Disputes
-npm-faq(7)
-Frequently Asked Questions
npm-index(7)
Index of all npm documentation
npm-orgs(7)
@@ -244,5 +242,5 @@ semver(7)
-
+
diff --git a/deps/npm/html/doc/misc/npm-coding-style.html b/deps/npm/html/doc/misc/npm-coding-style.html
index cabbf6fd470f9b..3808874c828317 100644
--- a/deps/npm/html/doc/misc/npm-coding-style.html
+++ b/deps/npm/html/doc/misc/npm-coding-style.html
@@ -147,5 +147,5 @@ SEE ALSO
-
+
diff --git a/deps/npm/html/doc/misc/npm-config.html b/deps/npm/html/doc/misc/npm-config.html
index 480f2d4086078f..00be245a8cb0e4 100644
--- a/deps/npm/html/doc/misc/npm-config.html
+++ b/deps/npm/html/doc/misc/npm-config.html
@@ -196,7 +196,7 @@ cert
A client certificate to pass when accessing the registry.
color
-- Default: true on Posix, false on Windows
+- Default: true
- Type: Boolean or
"always"
If false, never shows colors. If "always"
then always shows colors.
@@ -799,5 +799,5 @@
SEE ALSO
-
+
diff --git a/deps/npm/html/doc/misc/npm-developers.html b/deps/npm/html/doc/misc/npm-developers.html
index add93733e0b95d..cb01ee9a59ccb2 100644
--- a/deps/npm/html/doc/misc/npm-developers.html
+++ b/deps/npm/html/doc/misc/npm-developers.html
@@ -96,7 +96,7 @@ Keeping files out of your pa
create an empty .npmignore
file to override it. Like git
, npm
looks
for .npmignore
and .gitignore
files in all subdirectories of your
package, not only the root directory.
-
.npmignore
files follow the same pattern rules
+
.npmignore
files follow the same pattern rules
as .gitignore
files:
- Blank lines or lines starting with
#
are ignored.
@@ -161,7 +161,7 @@ Create a User Account
and then follow the prompts.
This is documented better in npm-adduser(1).
This part's easy. IN the root of your folder, do this:
+This part's easy. In the root of your folder, do this:
npm publish
You can give publish a url to a tarball, or a filename of a tarball, or a path to a folder.
@@ -195,5 +195,5 @@Handling Module
npm owner ls <pkgname>
Don't squat on package names. Publish code or move out of the way.
@@ -51,12 +51,12 @@npm owner add
joe foo
to add Joe as an owner of the foo
package.Frequently Asked Questions
-https://docs.npmjs.com/, or run:
-npm config set viewer browser
-
to open these documents in your default web browser rather than man
.
That's not really a question.
-I don't know yet.
-Read the error output, and if you can't figure out what it means, -do what it says and post a bug with all the information it asks for.
-See npm-folders(5)
tl;dr:
-npm root
command to see where modules go, and the npm bin
-command to see where executables go-g
flag, then its executables go in npm bin -g
-and its modules go in npm root -g
.Install it globally by tacking -g
or --global
to the command. (This
-is especially important for command line utilities that need to add
-their bins to the global system PATH
.)
require()
itInstall it locally.
-The global install location is a place for command-line utilities
-to put their bins in the system PATH
. It's not for use with require()
.
If you require()
a module in your code, then that means it's a
-dependency, and a part of your program. You need to install it locally
-in your program.
Not every change is an improvement, but every improvement is a change. -This would be like asking git to do network IO for every commit. It's -not going to happen, because it's a terrible idea that causes more -problems than it solves.
-It is much harder to avoid dependency conflicts without nesting
-dependencies. This is fundamental to the way that npm works, and has
-proven to be an extremely successful approach. See npm-folders(5)
for
-more details.
If you want a package to be installed in one place, and have all your
-programs reference the same copy of it, then use the npm link
command.
-That's what it's for. Install it globally, then link it into each
-program that uses it.
Write your own package manager. You could probably even wrap up npm
-in a shell script if you really wanted to.
npm will not help you do something that is known to be a bad idea.
-node_modules
folder into git?Usually, no. Allow npm to resolve dependencies for your packages.
-For packages you deploy, such as websites and apps, -you should use npm shrinkwrap to lock down your full dependency tree:
-https://docs.npmjs.com/cli/shrinkwrap
-If you are paranoid about depending on the npm ecosystem, -you should run a private npm mirror or a private cache.
-If you want 100% confidence in being able to reproduce the specific bytes -included in a deployment, you should use an additional mechanism that can -verify contents rather than versions. For example, -Amazon machine images, DigitalOcean snapshots, Heroku slugs, or simple tarballs.
-npm should never be capitalized unless it is being displayed in a -location that is customarily all-caps (such as the title of man pages.)
-Contrary to the belief of many, "npm" is not in fact an abbreviation for -"Node Package Manager". It is a recursive bacronymic abbreviation for -"npm is not an acronym". (If it was "ninaa", then it would be an -acronym, and thus incorrectly named.)
-"NPM", however, is an acronym (more precisely, a capitonym) for the -National Association of Pastoral Musicians. You can learn more -about them at http://npm.org/.
-In software, "NPM" is a Non-Parametric Mapping utility written by -Chris Rorden. You can analyze pictures of brains with it. Learn more -about the (capitalized) NPM program at http://www.cabiatl.com/mricro/npm/.
-The first seed that eventually grew into this flower was a bash utility
-named "pm", which was a shortened descendent of "pkgmakeinst", a
-bash function that was used to install various different things on different
-platforms, most often using Yahoo's yinst
. If npm
was ever an
-acronym for anything, it was node pm
or maybe new pm
.
So, in all seriousness, the "npm" project is named after its command-line
-utility, which was organically selected to be easily typed by a right-handed
-programmer using a US QWERTY keyboard layout, ending with the
-right-ring-finger in a postition to type the -
key for flags and
-other command-line arguments. That command-line utility is always
-lower-case, though it starts most sentences it is a part of.
npm ls
npm search
Arguments are greps. npm search jsdom
shows jsdom packages.
npm install npm -g
-
You can also update all outdated local packages by doing npm update
without
-any arguments, or global packages by doing npm update -g
.
Occasionally, the version of npm will progress such that the current
-version cannot be properly installed with the version that you have
-installed already. (Consider, if there is ever a bug in the update
-command.)
In those cases, you can do this:
-curl https://www.npmjs.com/install.sh | sh
-
package
?A package is:
-<name>@<version>
that is published on the registry with (c)<name>@<tag>
that points to (d)<name>
that has a "latest" tag satisfying (e)git
url that, when cloned, results in (a).Even if you never publish your package, you can still get a lot of -benefits of using npm if you just want to write a node program (a), and -perhaps if you also want to be able to easily install it elsewhere -after packing it up into a tarball (b).
-Git urls can be of the form:
-git://github.com/user/project.git#commit-ish
-git+ssh://user@hostname:project.git#commit-ish
-git+http://user@hostname/project/blah.git#commit-ish
-git+https://user@hostname/project/blah.git#commit-ish
-
The commit-ish
can be any tag, sha, or branch which can be supplied as
-an argument to git checkout
. The default is master
.
module
?A module is anything that can be loaded with require()
in a Node.js
-program. The following things are all examples of things that can be
-loaded as modules:
package.json
file containing a main
field.index.js
file in it.Most npm packages are modules, because they are libraries that you
-load with require
. However, there's no requirement that an npm
-package be a module! Some only contain an executable command-line
-interface, and don't provide a main
field for use in Node programs.
Almost all npm packages (at least, those that are Node programs)
-contain many modules within them (because every file they load with
-require()
is a module).
In the context of a Node program, the module
is also the thing that
-was loaded from a file. For example, in the following program:
var req = require('request')
-
we might say that "The variable req
refers to the request
module".
node_modules
" folder, but "package.json
" file? Why not node_packages
or module.json
?The package.json
file defines the package. (See "What is a
-package?" above.)
The node_modules
folder is the place Node.js looks for modules.
-(See "What is a module?" above.)
For example, if you create a file at node_modules/foo.js
and then
-had a program that did var f = require('foo.js')
then it would load
-the module. However, foo.js
is not a "package" in this case,
-because it does not have a package.json.
Alternatively, if you create a package which does not have an
-index.js
or a "main"
field in the package.json
file, then it is
-not a module. Even if it's installed in node_modules
, it can't be
-an argument to require()
.
"node_modules"
is the name of my deity's arch-rival, and a Forbidden Word in my religion. Can I configure npm to use a different folder?No. This will never happen. This question comes up sometimes, -because it seems silly from the outside that npm couldn't just be -configured to put stuff somewhere else, and then npm could load them -from there. It's an arbitrary spelling choice, right? What's the big -deal?
-At the time of this writing, the string 'node_modules'
appears 151
-times in 53 separate files in npm and node core (excluding tests and
-documentation).
Some of these references are in node's built-in module loader. Since -npm is not involved at all at run-time, node itself would have to -be configured to know where you've decided to stick stuff. Complexity -hurdle #1. Since the Node module system is locked, this cannot be -changed, and is enough to kill this request. But I'll continue, in -deference to your deity's delicate feelings regarding spelling.
-Many of the others are in dependencies that npm uses, which are not
-necessarily tightly coupled to npm (in the sense that they do not read
-npm's configuration files, etc.) Each of these would have to be
-configured to take the name of the node_modules
folder as a
-parameter. Complexity hurdle #2.
Furthermore, npm has the ability to "bundle" dependencies by adding
-the dep names to the "bundledDependencies"
list in package.json,
-which causes the folder to be included in the package tarball. What
-if the author of a module bundles its dependencies, and they use a
-different spelling for node_modules
? npm would have to rename the
-folder at publish time, and then be smart enough to unpack it using
-your locally configured name. Complexity hurdle #3.
Furthermore, what happens when you change this name? Fine, it's
-easy enough the first time, just rename the node_modules
folders to
-./blergyblerp/
or whatever name you choose. But what about when you
-change it again? npm doesn't currently track any state about past
-configuration settings, so this would be rather difficult to do
-properly. It would have to track every previous value for this
-config, and always accept any of them, or else yesterday's install may
-be broken tomorrow. Complexity hurdle #4.
Never going to happen. The folder is named node_modules
. It is
-written indelibly in the Node Way, handed down from the ancient times
-of Node 0.3.
You don't. Try one of these node version managers:
-Unix:
-Windows:
-See npm-developers(7)
and package.json(5)
.
You'll most likely want to npm link
your development folder. That's
-awesomely handy.
To set up your own private registry, check out npm-registry(7)
.
Yes. It should be a url to a gzipped tarball containing a single folder -that has a package.json in its root, or a git url. -(See "what is a package?" above.)
-See npm-link(1)
See npm-registry(7)
.
Go to https://npmjs.com/forgot.
-Either the registry is down, or node's DNS isn't able to reach out.
-To check if the registry is down, open up -https://registry.npmjs.org/ in a web browser. This will also tell -you if you are just unable to access the internet for some reason.
-If the registry IS down, let us know by emailing support@npmjs.com -or posting an issue at https://github.com/npm/npm/issues. If it's -down for the world (and not just on your local network) then we're -probably already being pinged about it.
-You can also often get a faster response by visiting the #npm channel -on Freenode IRC.
-npm has only one global namespace. If you want to namespace your own packages,
-you may: simply use the -
character to separate the names or use scoped
-packages. npm is a mostly anarchic system. There is not sufficient need to
-impose namespace rules on everyone.
As of 2.0, npm supports scoped packages, which allow you to publish a group of -related modules without worrying about name collisions.
-Every npm user owns the scope associated with their username. For example, the
-user named npm
owns the scope @npm
. Scoped packages are published inside a
-scope by naming them as if they were files under the scope directory, e.g., by
-setting name
in package.json
to @npm/npm
.
Scoped packages are supported by the public npm registry. The npm client is -backwards-compatible with un-scoped registries, so it can be used to work with -scoped and un-scoped registries at the same time.
-Unscoped packages can only depend on other unscoped packages. Scoped packages -can depend on packages from their own scope, a different scope, or the public -registry (unscoped).
-For the current documentation of scoped packages, see -https://docs.npmjs.com/misc/scope
-References:
-For the reasoning behind the "one global namespace", please see this -discussion: https://github.com/npm/npm/issues/798 (TL;DR: It doesn't -actually make things better, and can make them worse.)
-For the pre-implementation discussion of the scoped package feature, see -this discussion: https://github.com/npm/npm/issues/5239
-npm was originally written by Isaac Z. Schlueter, and many others have -contributed to it, some of them quite substantially.
-The npm open source project, The npm Registry, and the community -website are maintained and operated by the -good folks at npm, Inc.
-Post an issue on the github project:
- -npm is not capable of hatred. It loves everyone, especially you.
-Developer Guide
Handling Module Name Disputes
-Frequently Asked Questions
Index of all npm documentation
Additionally, npm's package registry implementation supports several write APIs as well, to allow for publishing packages and managing user account information.
-The official public npm registry is at http://registry.npmjs.org/. It +
The official public npm registry is at https://registry.npmjs.org/. It is powered by a CouchDB database, of which there is a public mirror at -http://skimdb.npmjs.com/registry. The code for the couchapp is -available at http://github.com/npm/npm-registry-couchapp.
+https://skimdb.npmjs.com/registry. The code for the couchapp is +available at https://github.com/npm/npm-registry-couchapp.The registry URL used is determined by the scope of the package (see
npm-scope(7)
). If no scope is specified, the default registry is used, which is
supplied by the registry
config parameter. See npm-config(1)
,
@@ -70,5 +70,5 @@
then the scripts/install.js
will be called for the install,
-post-install, stages of the lifecycle, and the scripts/uninstall.js
-would be called when the package is uninstalled. Since
-scripts/install.js
is running for three different phases, it would
+
then scripts/install.js
will be called for the install
+and post-install stages of the lifecycle, and scripts/uninstall.js
+will be called when the package is uninstalled. Since
+scripts/install.js
is running for two different phases, it would
be wise in this case to look at the npm_lifecycle_event
environment
variable.
If you want to run a make command, you can do so. This works just @@ -207,5 +207,5 @@
The method .inc
takes an additional identifier
string argument that
will append the value of the string as a prerelease identifier:
> semver.inc('1.2.3', 'pre', 'beta')
+> semver.inc('1.2.3', 'prerelease', 'beta')
'1.2.4-beta.0'
command-line example:
@@ -199,6 +199,26 @@ Caret Ranges ^1.2.3
^1.x
:= >=1.0.0 <2.0.0
^0.x
:= >=0.0.0 <1.0.0
+Range Grammar
+Putting all this together, here is a Backus-Naur grammar for ranges,
+for the benefit of parser authors:
+range-set ::= range ( logical-or range ) *
+logical-or ::= ( ' ' ) * '||' ( ' ' ) *
+range ::= hyphen | simple ( ' ' simple ) * | ''
+hyphen ::= partial ' - ' partial
+simple ::= primitive | partial | tilde | caret
+primitive ::= ( '<' | '>' | '>=' | '<=' | '=' | ) partial
+partial ::= xr ( '.' xr ( '.' xr qualifier ? )? )?
+xr ::= 'x' | 'X' | '*' | nr
+nr ::= '0' | ['1'-'9']['0'-'9']+
+tilde ::= '~' partial
+caret ::= '^' partial
+qualifier ::= ( '-' pre )? ( '+' build )?
+pre ::= parts
+build ::= parts
+parts ::= part ( '.' part ) *
+part ::= nr | [-0-9A-Za-z]+
+
Functions
All methods and classes take a final loose
boolean argument that, if
true, will be more forgiving about not-quite-valid semver strings.
@@ -282,5 +302,5 @@
Ranges
-
+
diff --git a/deps/npm/html/index.html b/deps/npm/html/index.html
index 06ca14ba4ac9b7..0d3c128b794d0e 100644
--- a/deps/npm/html/index.html
+++ b/deps/npm/html/index.html
@@ -86,7 +86,7 @@ Other Cool Stuff
README
Help Documentation
FAQ
- Search for Packages
+ Search for Packages
Mailing List
Bugs
diff --git a/deps/npm/lib/adduser.js b/deps/npm/lib/adduser.js
index 367f3ba0d92754..42c029efb1b84b 100644
--- a/deps/npm/lib/adduser.js
+++ b/deps/npm/lib/adduser.js
@@ -169,7 +169,9 @@ function save (c, u, cb) {
})
}
- log.info("adduser", "Authorized user %s", u.u)
- npm.config.save("user", cb)
+ log.info('adduser', 'Authorized user %s', u.u)
+ var scopeMessage = scope ? ' to scope ' + scope : ''
+ console.log('Logged in as %s%s on %s.', u.u, scopeMessage, uri)
+ npm.config.save('user', cb)
})
}
diff --git a/deps/npm/lib/cache.js b/deps/npm/lib/cache.js
index 2e11be32f862fa..851636c3c17ae9 100644
--- a/deps/npm/lib/cache.js
+++ b/deps/npm/lib/cache.js
@@ -337,6 +337,7 @@ function afterAdd (cb) { return function (er, data) {
// Save the resolved, shasum, etc. into the data so that the next
// time we load from this cached data, we have all the same info.
+ // Ignore if it fails.
var pj = path.join(cachedPackageRoot(data), "package", "package.json")
var done = inflight(pj, cb)
@@ -347,7 +348,7 @@ function afterAdd (cb) { return function (er, data) {
if (er) return done(er)
writeFileAtomic(pj, JSON.stringify(data), {chown : cs}, function (er) {
if (!er) log.verbose("afterAdd", pj, "written")
- return done(er, data)
+ return done(null, data)
})
})
}}
diff --git a/deps/npm/lib/cache/add-local-tarball.js b/deps/npm/lib/cache/add-local-tarball.js
index e84b66dd8dd51f..f078039e357867 100644
--- a/deps/npm/lib/cache/add-local-tarball.js
+++ b/deps/npm/lib/cache/add-local-tarball.js
@@ -13,7 +13,7 @@ var mkdir = require("mkdirp")
, chownr = require("chownr")
, inflight = require("inflight")
, once = require("once")
- , writeStream = require("fs-write-stream-atomic")
+ , writeStreamAtomic = require("fs-write-stream-atomic")
, randomBytes = require("crypto").pseudoRandomBytes // only need uniqueness
module.exports = addLocalTarball
@@ -166,7 +166,7 @@ function addTmpTarball_ (tgz, data, shasum, cb) {
if (er) return cb(er)
var read = fs.createReadStream(tgz)
- var write = writeStream(target, { mode: npm.modes.file })
+ var write = writeStreamAtomic(target, { mode: npm.modes.file })
var fin = cs.uid && cs.gid ? chown : done
read.on("error", cb).pipe(write).on("error", cb).on("close", fin)
})
diff --git a/deps/npm/lib/cache/add-remote-tarball.js b/deps/npm/lib/cache/add-remote-tarball.js
index 66d22009663307..d04e9da5090dd9 100644
--- a/deps/npm/lib/cache/add-remote-tarball.js
+++ b/deps/npm/lib/cache/add-remote-tarball.js
@@ -4,7 +4,8 @@ var mkdir = require("mkdirp")
, path = require("path")
, sha = require("sha")
, retry = require("retry")
- , createWriteStream = require("fs-write-stream-atomic")
+ , writeStreamAtomic = require("fs-write-stream-atomic")
+ , PassThrough = require('readable-stream').PassThrough
, npm = require("../npm.js")
, inflight = require("inflight")
, addLocalTarball = require("./add-local-tarball.js")
@@ -78,8 +79,8 @@ function fetchAndShaCheck (u, tmp, shasum, auth, cb) {
return cb(er, response)
}
- var tarball = createWriteStream(tmp, { mode : npm.modes.file })
- tarball.on("error", function (er) {
+ var tarball = writeStreamAtomic(tmp, { mode: npm.modes.file })
+ tarball.on('error', function (er) {
cb(er)
tarball.destroy()
})
@@ -105,6 +106,15 @@ function fetchAndShaCheck (u, tmp, shasum, auth, cb) {
})
})
- response.pipe(tarball)
+ // 0.8 http streams have a bug, where if they're paused with data in
+ // their buffers when the socket closes, they call `end` before emptying
+ // those buffers, which results in the entire pipeline ending and thus
+ // the point that applied backpressure never being able to trigger a
+ // `resume`.
+ // We work around this by piping into a pass through stream that has
+ // unlimited buffering. The pass through stream is from readable-stream
+ // and is thus a current streams3 implementation that is free of these
+ // bugs even on 0.8.
+ response.pipe(PassThrough({highWaterMark: Infinity})).pipe(tarball)
})
}
diff --git a/deps/npm/lib/completion.js b/deps/npm/lib/completion.js
index 1d26ffcf8ac92d..c85a42de640194 100644
--- a/deps/npm/lib/completion.js
+++ b/deps/npm/lib/completion.js
@@ -47,10 +47,10 @@ completion.completion = function (opts, cb) {
}
function completion (args, cb) {
- if (process.platform === "win32") {
- var e = new Error("npm completion not supported on windows")
- e.code = "ENOTSUP"
- e.errno = require("constants").ENOTSUP
+ if (process.platform === 'win32' && !(/^MINGW(32|64)$/.test(process.env.MSYSTEM))) {
+ var e = new Error('npm completion supported only in MINGW / Git bash on Windows')
+ e.code = 'ENOTSUP'
+ e.errno = require('constants').ENOTSUP
return cb(e)
}
diff --git a/deps/npm/lib/ls.js b/deps/npm/lib/ls.js
index c7877b925e6be7..caba4900547dc9 100644
--- a/deps/npm/lib/ls.js
+++ b/deps/npm/lib/ls.js
@@ -111,10 +111,15 @@ function alphasort (a, b) {
: a < b ? -1 : 0
}
-function getLite (data, noname) {
+function isCruft (data) {
+ return data.extraneous && data.error && data.error.code === 'ENOTDIR'
+}
+
+function getLite (data, noname, depth) {
var lite = {}
, maxDepth = npm.config.get("depth")
+ if (typeof depth === 'undefined') depth = 0
if (!noname && data.name) lite.name = data.name
if (data.version) lite.version = data.version
if (data.extraneous) {
@@ -163,7 +168,20 @@ function getLite (data, noname) {
+ ", required by "
+ data.name + "@" + data.version
lite.problems.push(p)
- return [d, { required: dep, missing: true }]
+ return [d, { required: dep.requiredBy, missing: true }]
+ } else if (dep.peerMissing) {
+ lite.problems = lite.problems || []
+ dep.peerMissing.forEach(function (missing) {
+ var pdm = 'peer dep missing: ' +
+ missing.requires +
+ ', required by ' +
+ missing.requiredBy
+ lite.problems.push(pdm)
+ })
+ return [d, { required: dep, peerMissing: true }]
+ } else if (npm.config.get('json')) {
+ if (depth === maxDepth) delete dep.dependencies
+ return [d, getLite(dep, true, depth + 1)]
}
return [d, getLite(dep, true)]
}).reduce(function (deps, d) {
diff --git a/deps/npm/lib/npm.js b/deps/npm/lib/npm.js
index c049d95ba6e24b..cbd6893470ba2d 100644
--- a/deps/npm/lib/npm.js
+++ b/deps/npm/lib/npm.js
@@ -283,8 +283,14 @@ npm.load = function (cli, cb_) {
npm.config.loaded = true
loaded = true
loadCb(loadErr = er)
- if (onload = onload && npm.config.get("onload-script")) {
- require(onload)
+ onload = onload && npm.config.get('onload-script')
+ if (onload) {
+ try {
+ require(onload)
+ } catch (err) {
+ log.warn('onload-script', 'failed to require onload script', onload)
+ log.warn('onload-script', err)
+ }
onload = false
}
}
diff --git a/deps/npm/lib/outdated.js b/deps/npm/lib/outdated.js
index ab49d109690ee6..331809c9975072 100644
--- a/deps/npm/lib/outdated.js
+++ b/deps/npm/lib/outdated.js
@@ -252,6 +252,7 @@ function outdated_ (args, dir, parentHas, depth, cb) {
has = Object.create(parentHas)
pvs.forEach(function (pv) {
has[pv[0]] = {
+ link: data.dependencies[pv[0]].link,
version: pv[1],
from: pv[2]
}
@@ -311,6 +312,9 @@ function shouldUpdate (args, dir, dep, has, req, depth, cb, type) {
if (parsed.type === "git" || (parsed.hosted && parsed.hosted.type === "github")) {
return doIt("git", "git")
}
+ if (curr && curr.link) {
+ return doIt("linked", "linked")
+ }
// search for the latest package
mapToRegistry(dep, npm.config, function (er, uri, auth) {
diff --git a/deps/npm/lib/pack.js b/deps/npm/lib/pack.js
index a5ce90094f6a3a..ab81cc20f61c72 100644
--- a/deps/npm/lib/pack.js
+++ b/deps/npm/lib/pack.js
@@ -11,7 +11,7 @@ var npm = require("./npm.js")
, chain = require("slide").chain
, path = require("path")
, cwd = process.cwd()
- , writeStream = require('fs-write-stream-atomic')
+ , writeStreamAtomic = require('fs-write-stream-atomic')
, cachedPackageRoot = require("./cache/cached-package-root.js")
pack.usage = "npm pack "
@@ -52,7 +52,7 @@ function pack_ (pkg, cb) {
var cached = path.join(cachedPackageRoot(data), "package.tgz")
, from = fs.createReadStream(cached)
- , to = writeStream(fname)
+ , to = writeStreamAtomic(fname)
, errState = null
from.on("error", cb_)
diff --git a/deps/npm/lib/utils/correct-mkdir.js b/deps/npm/lib/utils/correct-mkdir.js
index 650c56fb17deb7..c0a31bdc58a10a 100644
--- a/deps/npm/lib/utils/correct-mkdir.js
+++ b/deps/npm/lib/utils/correct-mkdir.js
@@ -10,6 +10,13 @@ var stats = {}
var effectiveOwner
module.exports = function correctMkdir (path, cb) {
cb = dezalgo(cb)
+ cb = inflight('correctMkdir:' + path, cb)
+ if (!cb) {
+ return log.verbose('correctMkdir', path, 'correctMkdir already in flight; waiting')
+ } else {
+ log.verbose('correctMkdir', path, 'correctMkdir not in flight; initializing')
+ }
+
if (stats[path]) return cb(null, stats[path])
fs.stat(path, function (er, st) {
diff --git a/deps/npm/lib/utils/error-handler.js b/deps/npm/lib/utils/error-handler.js
index dac6a17f251c90..e5daf2066ee9c7 100644
--- a/deps/npm/lib/utils/error-handler.js
+++ b/deps/npm/lib/utils/error-handler.js
@@ -11,7 +11,7 @@ var cbCalled = false
, exitCode = 0
, rollbacks = npm.rollbacks
, chain = require("slide").chain
- , writeStream = require("fs-write-stream-atomic")
+ , writeStreamAtomic = require("fs-write-stream-atomic")
, nameValidator = require("validate-npm-package-name")
@@ -187,8 +187,10 @@ function errorHandler (er) {
,"not with npm itself."
,"Tell the author that this fails on your system:"
," "+er.script
- ,"You can get their info via:"
- ," npm owner ls "+er.pkgname
+ ,'You can get information on how to open an issue for this project with:'
+ ,' npm bugs ' + er.pkgname
+ ,'Or if that isn\'t available, you can get their info via:',
+ ,' npm owner ls ' + er.pkgname
,"There is likely additional logging output above."
].join("\n"))
break
@@ -391,7 +393,7 @@ function writeLogFile (cb) {
writingLogFile = true
wroteLogFile = true
- var fstr = writeStream("npm-debug.log")
+ var fstr = writeStreamAtomic("npm-debug.log")
, os = require("os")
, out = ""
diff --git a/deps/npm/lib/version.js b/deps/npm/lib/version.js
index dbd48a0145a3d7..7b6eec0ce9f296 100644
--- a/deps/npm/lib/version.js
+++ b/deps/npm/lib/version.js
@@ -180,13 +180,14 @@ function checkGit (localData, cb) {
}
function _commit (version, hasShrinkwrap, cb) {
+ var packagePath = path.join(npm.localPrefix, 'package.json')
var options = { env: process.env }
var message = npm.config.get('message').replace(/%s/g, version)
var sign = npm.config.get('sign-git-tag')
var flag = sign ? '-sm' : '-am'
chain(
[
- git.chainableExec([ 'add', 'package.json' ], options),
+ git.chainableExec([ 'add', packagePath ], options),
hasShrinkwrap && git.chainableExec([ 'add', 'npm-shrinkwrap.json' ], options),
git.chainableExec([ 'commit', '-m', message ], options),
git.chainableExec([ 'tag', npm.config.get('tag-version-prefix') + version, flag, message ], options)
diff --git a/deps/npm/man/man1/npm-README.1 b/deps/npm/man/man1/npm-README.1
index 8254886adcdb3c..e0ec2d345d7b54 100644
--- a/deps/npm/man/man1/npm-README.1
+++ b/deps/npm/man/man1/npm-README.1
@@ -1,4 +1,4 @@
-.TH "NPM" "1" "November 2015" "" ""
+.TH "NPM" "1" "February 2016" "" ""
.SH "NAME"
\fBnpm\fR \- a JavaScript package manager
.P
@@ -14,6 +14,17 @@ Much more info available via \fBnpm help\fP once it's installed\.
.P
To install an old \fBand unsupported\fR version of npm that works on node 0\.3
and prior, clone the git repo and dig through the old tags and branches\.
+.P
+\fBnpm is configured to use npm, Inc\.'s public package registry at
+https://registry\.npmjs\.org by default\.\fR
+.P
+You can configure npm to use any compatible registry you
+like, and even run your own registry\. Check out the doc on
+registries \fIhttps://docs\.npmjs\.com/misc/registry\fR\|\.
+.P
+Use of someone else's registry may be governed by terms of use\. The
+terms of use for the default public registry are available at
+https://www\.npmjs\.com\|\.
.SH Super Easy Install
.P
npm is bundled with node \fIhttp://nodejs\.org/download/\fR\|\.
@@ -131,53 +142,6 @@ Uninstalling npm does not remove configuration files by default\. You
must remove them yourself manually if you want them gone\. Note that
this means that future npm installs will not remember the settings that
you have chosen\.
-.SH Using npm Programmatically
-.P
-Although npm can be used programmatically, its API is meant for use by the CLI
-\fIonly\fR, and no guarantees are made regarding its fitness for any other purpose\.
-If you want to use npm to reliably perform some task, the safest thing to do is
-to invoke the desired \fBnpm\fP command with appropriate arguments\.
-.P
-The semantic version of npm refers to the CLI itself, rather than the
-underlying API\. \fIThe internal API is not guaranteed to remain stable even when
-npm's version indicates no breaking changes have been made according to
-semver\.\fR
-.P
-If you \fIstill\fR would like to use npm programmatically, it's \fIpossible\fR\|\. The API
-isn't very well documented, but it \fIis\fR rather simple\.
-.P
-Eventually, npm will be just a thin CLI wrapper around the modules that it
-depends on, but for now, there are some things that only the CLI can do\. You
-should try using one of npm's dependencies first, and only use the API if what
-you're trying to do is only supported by npm itself\.
-.P
-.RS 2
-.nf
-var npm = require("npm")
-npm\.load(myConfigObject, function (er) {
- if (er) return handlError(er)
- npm\.commands\.install(["some", "args"], function (er, data) {
- if (er) return commandFailed(er)
- // command succeeded, and data might have some info
- })
- npm\.registry\.log\.on("log", function (message) { \.\.\.\. })
-})
-.fi
-.RE
-.P
-The \fBload\fP function takes an object hash of the command\-line configs\.
-The various \fBnpm\.commands\.\fP functions take an \fBarray\fR of
-positional argument \fBstrings\fR\|\. The last argument to any
-\fBnpm\.commands\.\fP function is a callback\. Some commands take other
-optional arguments\. Read the source\.
-.P
-You cannot set configs individually for any single npm function at this
-time\. Since \fBnpm\fP is a singleton, any call to \fBnpm\.config\.set\fP will
-change the value for \fIall\fR npm commands in that process\.
-.P
-See \fB\|\./bin/npm\-cli\.js\fP for an example of pulling config values off of the
-command line arguments using nopt\. You may also want to check out \fBnpm
-help config\fP to learn about all the options you can set there\.
.SH More Docs
.P
Check out the docs \fIhttps://docs\.npmjs\.com/\fR,
@@ -187,45 +151,6 @@ You can use the \fBnpm help\fP command to read any of them\.
.P
If you're a developer, and you want to use npm to publish your program,
you should read this \fIhttps://docs\.npmjs\.com/misc/developers\fR
-.SH Legal Stuff
-.P
-"npm" and "The npm Registry" are owned by npm, Inc\.
-All rights reserved\. See the included LICENSE file for more details\.
-.P
-"Node\.js" and "node" are trademarks owned by Joyent, Inc\.
-.P
-Modules published on the npm registry are not officially endorsed by
-npm, Inc\. or the Node\.js project\.
-.P
-Data published to the npm registry is not part of npm itself, and is
-the sole property of the publisher\. While every effort is made to
-ensure accountability, there is absolutely no guarantee, warranty, or
-assertion expressed or implied as to the quality, fitness for a
-specific purpose, or lack of malice in any given npm package\.
-.P
-If you have a complaint about a package in the public npm registry,
-and cannot resolve it with the package
-owner \fIhttps://docs\.npmjs\.com/misc/disputes\fR, please email
-support@npmjs\.com and explain the situation\.
-.P
-Any data published to The npm Registry (including user account
-information) may be removed or modified at the sole discretion of the
-npm server administrators\.
-.SS In plainer english
-.P
-npm is the property of npm, Inc\.
-.P
-If you publish something, it's yours, and you are solely accountable
-for it\.
-.P
-If other people publish something, it's theirs\.
-.P
-Users can publish Bad Stuff\. It will be removed promptly if reported\.
-But there is no vetting process for published modules, and you use
-them at your own risk\. Please inspect the source\.
-.P
-If you publish Bad Stuff, we may delete it from the registry, or even
-ban your account in extreme cases\. So don't do that\.
.SH BUGS
.P
When you find issues, please report them:
diff --git a/deps/npm/man/man1/npm-access.1 b/deps/npm/man/man1/npm-access.1
index f1b8bc0e316dd0..6af4ec3e1bc210 100644
--- a/deps/npm/man/man1/npm-access.1
+++ b/deps/npm/man/man1/npm-access.1
@@ -1,4 +1,4 @@
-.TH "NPM\-ACCESS" "1" "November 2015" "" ""
+.TH "NPM\-ACCESS" "1" "February 2016" "" ""
.SH "NAME"
\fBnpm-access\fR \- Set access level on published packages
.SH SYNOPSIS
diff --git a/deps/npm/man/man1/npm-adduser.1 b/deps/npm/man/man1/npm-adduser.1
index f96eae96bce363..5d8afd8f6e0565 100644
--- a/deps/npm/man/man1/npm-adduser.1
+++ b/deps/npm/man/man1/npm-adduser.1
@@ -1,4 +1,4 @@
-.TH "NPM\-ADDUSER" "1" "November 2015" "" ""
+.TH "NPM\-ADDUSER" "1" "February 2016" "" ""
.SH "NAME"
\fBnpm-adduser\fR \- Add a registry user account
.SH SYNOPSIS
@@ -29,7 +29,7 @@ your existing record\.
.SH CONFIGURATION
.SS registry
.P
-Default: http://registry\.npmjs\.org/
+Default: https://registry\.npmjs\.org/
.P
The base URL of the npm package registry\. If \fBscope\fP is also specified,
this registry will only be used for packages with that scope\. See npm help 7 \fBnpm\-scope\fP\|\.
diff --git a/deps/npm/man/man1/npm-bin.1 b/deps/npm/man/man1/npm-bin.1
index fd8eee83bca705..bca8620ebd81a6 100644
--- a/deps/npm/man/man1/npm-bin.1
+++ b/deps/npm/man/man1/npm-bin.1
@@ -1,4 +1,4 @@
-.TH "NPM\-BIN" "1" "November 2015" "" ""
+.TH "NPM\-BIN" "1" "February 2016" "" ""
.SH "NAME"
\fBnpm-bin\fR \- Display npm bin folder
.SH SYNOPSIS
diff --git a/deps/npm/man/man1/npm-bugs.1 b/deps/npm/man/man1/npm-bugs.1
index 7da5f012b27283..88c21dbfef0692 100644
--- a/deps/npm/man/man1/npm-bugs.1
+++ b/deps/npm/man/man1/npm-bugs.1
@@ -1,4 +1,4 @@
-.TH "NPM\-BUGS" "1" "November 2015" "" ""
+.TH "NPM\-BUGS" "1" "February 2016" "" ""
.SH "NAME"
\fBnpm-bugs\fR \- Bugs for a package in a web browser maybe
.SH SYNOPSIS
diff --git a/deps/npm/man/man1/npm-build.1 b/deps/npm/man/man1/npm-build.1
index ae4a834a106446..8d238b3280739d 100644
--- a/deps/npm/man/man1/npm-build.1
+++ b/deps/npm/man/man1/npm-build.1
@@ -1,4 +1,4 @@
-.TH "NPM\-BUILD" "1" "November 2015" "" ""
+.TH "NPM\-BUILD" "1" "February 2016" "" ""
.SH "NAME"
\fBnpm-build\fR \- Build a package
.SH SYNOPSIS
diff --git a/deps/npm/man/man1/npm-bundle.1 b/deps/npm/man/man1/npm-bundle.1
index fa54e083415a82..2771791b07ccb0 100644
--- a/deps/npm/man/man1/npm-bundle.1
+++ b/deps/npm/man/man1/npm-bundle.1
@@ -1,4 +1,4 @@
-.TH "NPM\-BUNDLE" "1" "November 2015" "" ""
+.TH "NPM\-BUNDLE" "1" "February 2016" "" ""
.SH "NAME"
\fBnpm-bundle\fR \- REMOVED
.SH DESCRIPTION
diff --git a/deps/npm/man/man1/npm-cache.1 b/deps/npm/man/man1/npm-cache.1
index c4bca767c4496a..339a9aa2260d03 100644
--- a/deps/npm/man/man1/npm-cache.1
+++ b/deps/npm/man/man1/npm-cache.1
@@ -1,4 +1,4 @@
-.TH "NPM\-CACHE" "1" "November 2015" "" ""
+.TH "NPM\-CACHE" "1" "February 2016" "" ""
.SH "NAME"
\fBnpm-cache\fR \- Manipulates packages cache
.SH SYNOPSIS
diff --git a/deps/npm/man/man1/npm-completion.1 b/deps/npm/man/man1/npm-completion.1
index 2e17d6287e922c..82733ea91c604b 100644
--- a/deps/npm/man/man1/npm-completion.1
+++ b/deps/npm/man/man1/npm-completion.1
@@ -1,4 +1,4 @@
-.TH "NPM\-COMPLETION" "1" "November 2015" "" ""
+.TH "NPM\-COMPLETION" "1" "February 2016" "" ""
.SH "NAME"
\fBnpm-completion\fR \- Tab Completion for npm
.SH SYNOPSIS
diff --git a/deps/npm/man/man1/npm-config.1 b/deps/npm/man/man1/npm-config.1
index 764092fd13c493..5c4d28351c60b8 100644
--- a/deps/npm/man/man1/npm-config.1
+++ b/deps/npm/man/man1/npm-config.1
@@ -1,4 +1,4 @@
-.TH "NPM\-CONFIG" "1" "November 2015" "" ""
+.TH "NPM\-CONFIG" "1" "February 2016" "" ""
.SH "NAME"
\fBnpm-config\fR \- Manage the npm configuration files
.SH SYNOPSIS
diff --git a/deps/npm/man/man1/npm-dedupe.1 b/deps/npm/man/man1/npm-dedupe.1
index cb50dddb4a7ca5..64e2588fd37279 100644
--- a/deps/npm/man/man1/npm-dedupe.1
+++ b/deps/npm/man/man1/npm-dedupe.1
@@ -1,4 +1,4 @@
-.TH "NPM\-DEDUPE" "1" "November 2015" "" ""
+.TH "NPM\-DEDUPE" "1" "February 2016" "" ""
.SH "NAME"
\fBnpm-dedupe\fR \- Reduce duplication
.SH SYNOPSIS
diff --git a/deps/npm/man/man1/npm-deprecate.1 b/deps/npm/man/man1/npm-deprecate.1
index 6b51cbf6f42ceb..b4d407dfbeda3c 100644
--- a/deps/npm/man/man1/npm-deprecate.1
+++ b/deps/npm/man/man1/npm-deprecate.1
@@ -1,4 +1,4 @@
-.TH "NPM\-DEPRECATE" "1" "November 2015" "" ""
+.TH "NPM\-DEPRECATE" "1" "February 2016" "" ""
.SH "NAME"
\fBnpm-deprecate\fR \- Deprecate a version of a package
.SH SYNOPSIS
diff --git a/deps/npm/man/man1/npm-dist-tag.1 b/deps/npm/man/man1/npm-dist-tag.1
index 8b30e986a4f78b..9962d8d27aba74 100644
--- a/deps/npm/man/man1/npm-dist-tag.1
+++ b/deps/npm/man/man1/npm-dist-tag.1
@@ -1,4 +1,4 @@
-.TH "NPM\-DIST\-TAG" "1" "November 2015" "" ""
+.TH "NPM\-DIST\-TAG" "1" "February 2016" "" ""
.SH "NAME"
\fBnpm-dist-tag\fR \- Modify package distribution tags
.SH SYNOPSIS
@@ -47,16 +47,29 @@ npm install \-\-tag
.P
This also applies to \fBnpm dedupe\fP\|\.
.P
-Publishing a package sets the "latest" tag to the published version unless the
+Publishing a package sets the \fBlatest\fP tag to the published version unless the
\fB\-\-tag\fP option is used\. For example, \fBnpm publish \-\-tag=beta\fP\|\.
+.P
+By default, \fBnpm install \fP (without any \fB@\fP or \fB@\fP
+specifier) installs the \fBlatest\fP tag\.
.SH PURPOSE
.P
-Tags can be used to provide an alias instead of version numbers\. For
-example, \fBnpm\fP currently uses the tag "next" to identify the upcoming
-version, and the tag "latest" to identify the current version\.
+Tags can be used to provide an alias instead of version numbers\.
+.P
+For example, a project might choose to have multiple streams of development
+and use a different tag for each stream,
+e\.g\., \fBstable\fP, \fBbeta\fP, \fBdev\fP, \fBcanary\fP\|\.
+.P
+By default, the \fBlatest\fP tag is used by npm to identify the current version of
+a package, and \fBnpm install \fP (without any \fB@\fP or \fB@\fP
+specifier) installs the \fBlatest\fP tag\. Typically, projects only use the \fBlatest\fP
+tag for stable release versions, and use other tags for unstable versions such
+as prereleases\.
.P
-A project might choose to have multiple streams of development, e\.g\.,
-"stable", "canary"\.
+The \fBnext\fP tag is used by some projects to identify the upcoming version\.
+.P
+By default, other than \fBlatest\fP, no tag has any special significance to npm
+itself\.
.SH CAVEATS
.P
This command used to be known as \fBnpm tag\fP, which only created new tags, and so
@@ -88,8 +101,6 @@ npm help config
.IP \(bu 2
npm help 7 config
.IP \(bu 2
-npm apihelp tag
-.IP \(bu 2
npm help 5 npmrc
.RE
diff --git a/deps/npm/man/man1/npm-docs.1 b/deps/npm/man/man1/npm-docs.1
index 04e91d641e00e3..d2814182faa1a2 100644
--- a/deps/npm/man/man1/npm-docs.1
+++ b/deps/npm/man/man1/npm-docs.1
@@ -1,4 +1,4 @@
-.TH "NPM\-DOCS" "1" "November 2015" "" ""
+.TH "NPM\-DOCS" "1" "February 2016" "" ""
.SH "NAME"
\fBnpm-docs\fR \- Docs for a package in a web browser maybe
.SH SYNOPSIS
diff --git a/deps/npm/man/man1/npm-edit.1 b/deps/npm/man/man1/npm-edit.1
index e58e81d26cec6d..7d8d57047682b9 100644
--- a/deps/npm/man/man1/npm-edit.1
+++ b/deps/npm/man/man1/npm-edit.1
@@ -1,4 +1,4 @@
-.TH "NPM\-EDIT" "1" "November 2015" "" ""
+.TH "NPM\-EDIT" "1" "February 2016" "" ""
.SH "NAME"
\fBnpm-edit\fR \- Edit an installed package
.SH SYNOPSIS
diff --git a/deps/npm/man/man1/npm-explore.1 b/deps/npm/man/man1/npm-explore.1
index a757dfd60c2fce..8306e8529d3415 100644
--- a/deps/npm/man/man1/npm-explore.1
+++ b/deps/npm/man/man1/npm-explore.1
@@ -1,4 +1,4 @@
-.TH "NPM\-EXPLORE" "1" "November 2015" "" ""
+.TH "NPM\-EXPLORE" "1" "February 2016" "" ""
.SH "NAME"
\fBnpm-explore\fR \- Browse an installed package
.SH SYNOPSIS
diff --git a/deps/npm/man/man1/npm-help-search.1 b/deps/npm/man/man1/npm-help-search.1
index 612bfd2915faf5..621af7ca817202 100644
--- a/deps/npm/man/man1/npm-help-search.1
+++ b/deps/npm/man/man1/npm-help-search.1
@@ -1,4 +1,4 @@
-.TH "NPM\-HELP\-SEARCH" "1" "November 2015" "" ""
+.TH "NPM\-HELP\-SEARCH" "1" "February 2016" "" ""
.SH "NAME"
\fBnpm-help-search\fR \- Search npm help documentation
.SH SYNOPSIS
diff --git a/deps/npm/man/man1/npm-help.1 b/deps/npm/man/man1/npm-help.1
index 3691fca49d0dee..6499322c9a30ef 100644
--- a/deps/npm/man/man1/npm-help.1
+++ b/deps/npm/man/man1/npm-help.1
@@ -1,4 +1,4 @@
-.TH "NPM\-HELP" "1" "November 2015" "" ""
+.TH "NPM\-HELP" "1" "February 2016" "" ""
.SH "NAME"
\fBnpm-help\fR \- Get help on npm
.SH SYNOPSIS
diff --git a/deps/npm/man/man1/npm-init.1 b/deps/npm/man/man1/npm-init.1
index 8c6bf0397482eb..5399b750601945 100644
--- a/deps/npm/man/man1/npm-init.1
+++ b/deps/npm/man/man1/npm-init.1
@@ -1,4 +1,4 @@
-.TH "NPM\-INIT" "1" "November 2015" "" ""
+.TH "NPM\-INIT" "1" "February 2016" "" ""
.SH "NAME"
\fBnpm-init\fR \- Interactively create a package\.json file
.SH SYNOPSIS
diff --git a/deps/npm/man/man1/npm-install-test.1 b/deps/npm/man/man1/npm-install-test.1
new file mode 100644
index 00000000000000..8b99c9af98ac92
--- /dev/null
+++ b/deps/npm/man/man1/npm-install-test.1
@@ -0,0 +1,32 @@
+.TH "NPM" "" "February 2016" "" ""
+.SH "NAME"
+\fBnpm\fR
+.SH SYNOPSIS
+.P
+.RS 2
+.nf
+npm install\-test (with no args, in package dir)
+npm install\-test [<@scope>/]
+npm install\-test [<@scope>/]@
+npm install\-test [<@scope>/]@
+npm install\-test [<@scope>/]@
+npm install\-test
+npm install\-test
+npm install\-test
+
+alias: npm it
+common options: [\-\-save|\-\-save\-dev|\-\-save\-optional] [\-\-save\-exact] [\-\-dry\-run]
+.fi
+.RE
+.SH DESCRIPTION
+.P
+This command runs an \fBnpm install\fP followed immediately by an \fBnpm test\fP\|\. It
+takes exactly the same arguments as \fBnpm install\fP\|\.
+.SH SEE ALSO
+.RS 0
+.IP \(bu 2
+npm help install
+.IP \(bu 2
+npm help test
+
+.RE
diff --git a/deps/npm/man/man1/npm-install.1 b/deps/npm/man/man1/npm-install.1
index 9b4290c0fde314..3efda4857dd54f 100644
--- a/deps/npm/man/man1/npm-install.1
+++ b/deps/npm/man/man1/npm-install.1
@@ -1,4 +1,4 @@
-.TH "NPM\-INSTALL" "1" "November 2015" "" ""
+.TH "NPM\-INSTALL" "1" "February 2016" "" ""
.SH "NAME"
\fBnpm-install\fR \- Install a package
.SH SYNOPSIS
@@ -25,7 +25,7 @@ by that\. See npm help shrinkwrap\.
A \fBpackage\fP is:
.RS 0
.IP \(bu 2
-a) a folder containing a program described by a package\.json file
+a) a folder containing a program described by a npm help 5 \fBpackage\.json\fP file
.IP \(bu 2
b) a gzipped tarball containing (a)
.IP \(bu 2
@@ -33,7 +33,7 @@ c) a url that resolves to (b)
.IP \(bu 2
d) a \fB@\fP that is published on the registry (see npm help 7 \fBnpm\-registry\fP) with (c)
.IP \(bu 2
-e) a \fB@\fP that points to (d)
+e) a \fB@\fP (see npm help \fBnpm\-dist\-tag\fP) that points to (d)
.IP \(bu 2
f) a \fB\fP that has a "latest" tag satisfying (e)
.IP \(bu 2
@@ -52,7 +52,8 @@ after packing it up into a tarball (b)\.
In global mode (ie, with \fB\-g\fP or \fB\-\-global\fP appended to the command),
it installs the current package context (ie, the current working
directory) as a global package\.
- By default, \fBnpm install\fP will install all modules listed as dependencies\.
+ By default, \fBnpm install\fP will install all modules listed as dependencies
+ in npm help 5 \fBpackage\.json\fP\|\.
With the \fB\-\-production\fP flag (or when the \fBNODE_ENV\fP environment variable
is set to \fBproduction\fP), npm will not install modules listed in
\fBdevDependencies\fP\|\.
@@ -85,7 +86,7 @@ after packing it up into a tarball (b)\.
.IP \(bu 2
\fBnpm install [@/] [\-\-save|\-\-save\-dev|\-\-save\-optional]\fP:
Do a \fB@\fP install, where \fB\fP is the "tag" config\. (See
- npm help 7 \fBnpm\-config\fP\|\.)
+ npm help 7 \fBnpm\-config\fP\|\. The config's default value is \fBlatest\fP\|\.)
In most cases, this will install the latest version
of the module published on npm\.
Example:
@@ -402,9 +403,11 @@ npm help 7 registry
.IP \(bu 2
npm help tag
.IP \(bu 2
-npm help rm
+npm help uninstall
.IP \(bu 2
npm help shrinkwrap
+.IP \(bu 2
+npm help 5 package\.json
.RE
diff --git a/deps/npm/man/man1/npm-link.1 b/deps/npm/man/man1/npm-link.1
index 19492b21c08210..48db786dccc969 100644
--- a/deps/npm/man/man1/npm-link.1
+++ b/deps/npm/man/man1/npm-link.1
@@ -1,4 +1,4 @@
-.TH "NPM\-LINK" "1" "November 2015" "" ""
+.TH "NPM\-LINK" "1" "February 2016" "" ""
.SH "NAME"
\fBnpm-link\fR \- Symlink a package folder
.SH SYNOPSIS
diff --git a/deps/npm/man/man1/npm-logout.1 b/deps/npm/man/man1/npm-logout.1
index bf144bddc993b3..4136e248e46b18 100644
--- a/deps/npm/man/man1/npm-logout.1
+++ b/deps/npm/man/man1/npm-logout.1
@@ -1,4 +1,4 @@
-.TH "NPM\-LOGOUT" "1" "November 2015" "" ""
+.TH "NPM\-LOGOUT" "1" "February 2016" "" ""
.SH "NAME"
\fBnpm-logout\fR \- Log out of the registry
.SH SYNOPSIS
@@ -23,7 +23,7 @@ connected to that scope, if set\.
.SH CONFIGURATION
.SS registry
.P
-Default: http://registry\.npmjs\.org/
+Default: https://registry\.npmjs\.org/
.P
The base URL of the npm package registry\. If \fBscope\fP is also specified,
it takes precedence\.
diff --git a/deps/npm/man/man1/npm-ls.1 b/deps/npm/man/man1/npm-ls.1
index bfddf1305609ab..57489f07d0ee90 100644
--- a/deps/npm/man/man1/npm-ls.1
+++ b/deps/npm/man/man1/npm-ls.1
@@ -1,4 +1,4 @@
-.TH "NPM\-LS" "1" "November 2015" "" ""
+.TH "NPM\-LS" "1" "February 2016" "" ""
.SH "NAME"
\fBnpm-ls\fR \- List installed packages
.SH SYNOPSIS
@@ -23,7 +23,7 @@ For example, running \fBnpm ls promzard\fP in npm's source tree will show:
.P
.RS 2
.nf
-npm@2.14.12 /path/to/npm
+npm@2.14.18 /path/to/npm
└─┬ init\-package\-json@0\.0\.4
└── promzard@0\.1\.5
.fi
diff --git a/deps/npm/man/man1/npm-outdated.1 b/deps/npm/man/man1/npm-outdated.1
index 0f2ae4681ba185..3f300714f2fcbc 100644
--- a/deps/npm/man/man1/npm-outdated.1
+++ b/deps/npm/man/man1/npm-outdated.1
@@ -1,4 +1,4 @@
-.TH "NPM\-OUTDATED" "1" "November 2015" "" ""
+.TH "NPM\-OUTDATED" "1" "February 2016" "" ""
.SH "NAME"
\fBnpm-outdated\fR \- Check for outdated packages
.SH SYNOPSIS
@@ -13,9 +13,77 @@ npm outdated [ [ \.\.\.]]
This command will check the registry to see if any (or, specific) installed
packages are currently outdated\.
.P
-The resulting field 'wanted' shows the latest version according to the
-version specified in the package\.json, the field 'latest' the very latest
-version of the package\.
+In the output:
+.RS 0
+.IP \(bu 2
+\fBwanted\fP is the maximum version of the package that satisfies the semver
+range specified in \fBpackage\.json\fP\|\. If there's no available semver range (i\.e\.
+you're running \fBnpm outdated \-\-global\fP, or the package isn't included in
+\fBpackage\.json\fP), then \fBwanted\fP shows the currently\-installed version\.
+.IP \(bu 2
+\fBlatest\fP is the version of the package tagged as latest in the registry\.
+Running \fBnpm publish\fP with no special configuration will publish the package
+with a dist\-tag of \fBlatest\fP\|\. This may or may not be the maximum version of
+the package, or the most\-recently published version of the package, depending
+on how the package's developer manages the latest npm help dist\-tag\.
+.IP \(bu 2
+\fBlocation\fP is where in the dependency tree the package is located\. Note that
+\fBnpm outdated\fP defaults to a depth of 0, so unless you override that, you'll
+always be seeing only top\-level dependencies that are outdated\.
+.IP \(bu 2
+\fBpackage type\fP (when using \fB\-\-long\fP / \fB\-l\fP) tells you whether this package is
+a \fBdependency\fP or a \fBdevDependency\fP\|\. Packages not included in \fBpackage\.json\fP
+are always marked \fBdependencies\fP\|\.
+
+.RE
+.SS An example
+.P
+.RS 2
+.nf
+$ npm outdated
+Package Current Wanted Latest Location
+glob 5\.0\.15 5\.0\.15 6\.0\.1 test\-outdated\-output
+nothingness 0\.0\.3 git git test\-outdated\-output
+npm 3\.5\.1 3\.5\.2 3\.5\.1 test\-outdated\-output
+local\-dev 0\.0\.3 linked linked test\-outdated\-output
+once 1\.3\.2 1\.3\.3 1\.3\.3 test\-outdated\-output
+.fi
+.RE
+.P
+With these \fBdependencies\fP:
+.P
+.RS 2
+.nf
+{
+ "glob": "^5\.0\.15",
+ "nothingness": "github:othiym23/nothingness#master",
+ "npm": "^3\.5\.1",
+ "once": "^1\.3\.1"
+}
+.fi
+.RE
+.P
+A few things to note:
+.RS 0
+.IP \(bu 2
+\fBglob\fP requires \fB^5\fP, which prevents npm from installing \fBglob@6\fP, which is
+outside the semver range\.
+.IP \(bu 2
+Git dependencies will always be reinstalled, because of how they're specified\.
+The installed committish might satisfy the dependency specifier (if it's
+something immutable, like a commit SHA), or it might not, so \fBnpm outdated\fP and
+\fBnpm update\fP have to fetch Git repos to check\. This is why currently doing a
+reinstall of a Git dependency always forces a new clone and install\.
+.IP \(bu 2
+\fBnpm@3\.5\.2\fP is marked as "wanted", but "latest" is \fBnpm@3\.5\.1\fP because npm
+uses dist\-tags to manage its \fBlatest\fP and \fBnext\fP release channels\. \fBnpm update\fP
+will install the \fInewest\fR version, but \fBnpm install npm\fP (with no semver range)
+will install whatever's tagged as \fBlatest\fP\|\.
+.IP \(bu 2
+\fBonce\fP is just plain out of date\. Reinstalling \fBnode_modules\fP from scratch or
+running \fBnpm update\fP will bring it up to spec\.
+
+.RE
.SH CONFIGURATION
.SS json
.RS 0
@@ -61,6 +129,8 @@ project\.
.SS depth
.RS 0
.IP \(bu 2
+Default: 0
+.IP \(bu 2
Type: Int
.RE
@@ -71,6 +141,8 @@ Max depth for checking dependency tree\.
.IP \(bu 2
npm help update
.IP \(bu 2
+npm help dist\-tag
+.IP \(bu 2
npm help 7 registry
.IP \(bu 2
npm help 5 folders
diff --git a/deps/npm/man/man1/npm-owner.1 b/deps/npm/man/man1/npm-owner.1
index 1936ce029c231f..3c3e4e6861f9c6 100644
--- a/deps/npm/man/man1/npm-owner.1
+++ b/deps/npm/man/man1/npm-owner.1
@@ -1,4 +1,4 @@
-.TH "NPM\-OWNER" "1" "November 2015" "" ""
+.TH "NPM\-OWNER" "1" "February 2016" "" ""
.SH "NAME"
\fBnpm-owner\fR \- Manage package owners
.SH SYNOPSIS
diff --git a/deps/npm/man/man1/npm-pack.1 b/deps/npm/man/man1/npm-pack.1
index a836493157d56a..64dc3ea7165f57 100644
--- a/deps/npm/man/man1/npm-pack.1
+++ b/deps/npm/man/man1/npm-pack.1
@@ -1,4 +1,4 @@
-.TH "NPM\-PACK" "1" "November 2015" "" ""
+.TH "NPM\-PACK" "1" "February 2016" "" ""
.SH "NAME"
\fBnpm-pack\fR \- Create a tarball from a package
.SH SYNOPSIS
diff --git a/deps/npm/man/man1/npm-ping.1 b/deps/npm/man/man1/npm-ping.1
index 4d2b9a78bf0fcb..b270a02cc8429d 100644
--- a/deps/npm/man/man1/npm-ping.1
+++ b/deps/npm/man/man1/npm-ping.1
@@ -1,4 +1,4 @@
-.TH "NPM\-PING" "1" "November 2015" "" ""
+.TH "NPM\-PING" "1" "February 2016" "" ""
.SH "NAME"
\fBnpm-ping\fR \- Ping npm registry
.SH SYNOPSIS
diff --git a/deps/npm/man/man1/npm-prefix.1 b/deps/npm/man/man1/npm-prefix.1
index c6ea5f6fdfa75e..63da3d5204f00e 100644
--- a/deps/npm/man/man1/npm-prefix.1
+++ b/deps/npm/man/man1/npm-prefix.1
@@ -1,4 +1,4 @@
-.TH "NPM\-PREFIX" "1" "November 2015" "" ""
+.TH "NPM\-PREFIX" "1" "February 2016" "" ""
.SH "NAME"
\fBnpm-prefix\fR \- Display prefix
.SH SYNOPSIS
diff --git a/deps/npm/man/man1/npm-prune.1 b/deps/npm/man/man1/npm-prune.1
index 3598ed1777c86d..115744e34232f1 100644
--- a/deps/npm/man/man1/npm-prune.1
+++ b/deps/npm/man/man1/npm-prune.1
@@ -1,4 +1,4 @@
-.TH "NPM\-PRUNE" "1" "November 2015" "" ""
+.TH "NPM\-PRUNE" "1" "February 2016" "" ""
.SH "NAME"
\fBnpm-prune\fR \- Remove extraneous packages
.SH SYNOPSIS
@@ -25,7 +25,7 @@ negate \fBNODE_ENV\fP being set to \fBproduction\fP\|\.
.SH SEE ALSO
.RS 0
.IP \(bu 2
-npm help rm
+npm help uninstall
.IP \(bu 2
npm help 5 folders
.IP \(bu 2
diff --git a/deps/npm/man/man1/npm-publish.1 b/deps/npm/man/man1/npm-publish.1
index 308d661511e3f2..87b2d14d210599 100644
--- a/deps/npm/man/man1/npm-publish.1
+++ b/deps/npm/man/man1/npm-publish.1
@@ -1,4 +1,4 @@
-.TH "NPM\-PUBLISH" "1" "November 2015" "" ""
+.TH "NPM\-PUBLISH" "1" "February 2016" "" ""
.SH "NAME"
\fBnpm-publish\fR \- Publish a package
.SH SYNOPSIS
@@ -11,9 +11,11 @@ npm publish [\-\-tag ] [\-\-access ]
.RE
.SH DESCRIPTION
.P
-Publishes a package to the registry so that it can be installed by name\. See
-npm help 7 \fBnpm\-developers\fP for details on what's included in the published package, as
-well as details on how the package is built\.
+Publishes a package to the registry so that it can be installed by name\. All
+files in the package directory are included if no local \fB\|\.gitignore\fP or
+\fB\|\.npmignore\fP file is present\. See npm help 7 \fBnpm\-developers\fP for full details on
+what's included in the published package, as well as details on how the package
+is built\.
.P
By default npm will publish to the public registry\. This can be overridden by
specifying a different default registry or using a npm help 7 \fBnpm\-scope\fP in the name
@@ -30,7 +32,8 @@ with a package\.json file inside\.
\fB[\-\-tag ]\fP
Registers the published package with the given tag, such that \fBnpm install
@\fP will install this version\. By default, \fBnpm publish\fP updates
-and \fBnpm install\fP installs the \fBlatest\fP tag\.
+and \fBnpm install\fP installs the \fBlatest\fP tag\. See npm help \fBnpm\-dist\-tag\fP for
+details about tags\.
.IP \(bu 2
\fB[\-\-access ]\fP
Tells the registry whether this package should be published as public or
diff --git a/deps/npm/man/man1/npm-rebuild.1 b/deps/npm/man/man1/npm-rebuild.1
index fd3a153ebded7a..1594bcc116c965 100644
--- a/deps/npm/man/man1/npm-rebuild.1
+++ b/deps/npm/man/man1/npm-rebuild.1
@@ -1,4 +1,4 @@
-.TH "NPM\-REBUILD" "1" "November 2015" "" ""
+.TH "NPM\-REBUILD" "1" "February 2016" "" ""
.SH "NAME"
\fBnpm-rebuild\fR \- Rebuild a package
.SH SYNOPSIS
diff --git a/deps/npm/man/man1/npm-repo.1 b/deps/npm/man/man1/npm-repo.1
index d27b013fdeb321..66b15ec43278c8 100644
--- a/deps/npm/man/man1/npm-repo.1
+++ b/deps/npm/man/man1/npm-repo.1
@@ -1,4 +1,4 @@
-.TH "NPM\-REPO" "1" "November 2015" "" ""
+.TH "NPM\-REPO" "1" "February 2016" "" ""
.SH "NAME"
\fBnpm-repo\fR \- Open package repository page in the browser
.SH SYNOPSIS
diff --git a/deps/npm/man/man1/npm-restart.1 b/deps/npm/man/man1/npm-restart.1
index 0bc7541ccf80c6..073f41c31eceae 100644
--- a/deps/npm/man/man1/npm-restart.1
+++ b/deps/npm/man/man1/npm-restart.1
@@ -1,4 +1,4 @@
-.TH "NPM\-RESTART" "1" "November 2015" "" ""
+.TH "NPM\-RESTART" "1" "February 2016" "" ""
.SH "NAME"
\fBnpm-restart\fR \- Restart a package
.SH SYNOPSIS
diff --git a/deps/npm/man/man1/npm-rm.1 b/deps/npm/man/man1/npm-rm.1
index edbd1fc6a70a7f..1b0a1dd03c7ab3 100644
--- a/deps/npm/man/man1/npm-rm.1
+++ b/deps/npm/man/man1/npm-rm.1
@@ -1,4 +1,4 @@
-.TH "NPM\-RM" "1" "November 2015" "" ""
+.TH "NPM\-RM" "1" "February 2016" "" ""
.SH "NAME"
\fBnpm-rm\fR \- Remove a package
.SH SYNOPSIS
diff --git a/deps/npm/man/man1/npm-root.1 b/deps/npm/man/man1/npm-root.1
index 3418764c7cd6fc..a686b799ada557 100644
--- a/deps/npm/man/man1/npm-root.1
+++ b/deps/npm/man/man1/npm-root.1
@@ -1,4 +1,4 @@
-.TH "NPM\-ROOT" "1" "November 2015" "" ""
+.TH "NPM\-ROOT" "1" "February 2016" "" ""
.SH "NAME"
\fBnpm-root\fR \- Display npm root
.SH SYNOPSIS
diff --git a/deps/npm/man/man1/npm-run-script.1 b/deps/npm/man/man1/npm-run-script.1
index b0645021422831..d081ed87b94978 100644
--- a/deps/npm/man/man1/npm-run-script.1
+++ b/deps/npm/man/man1/npm-run-script.1
@@ -1,4 +1,4 @@
-.TH "NPM\-RUN\-SCRIPT" "1" "November 2015" "" ""
+.TH "NPM\-RUN\-SCRIPT" "1" "February 2016" "" ""
.SH "NAME"
\fBnpm-run-script\fR \- Run arbitrary package scripts
.SH SYNOPSIS
diff --git a/deps/npm/man/man1/npm-search.1 b/deps/npm/man/man1/npm-search.1
index f8699010f95cb6..5bd00828129dd2 100644
--- a/deps/npm/man/man1/npm-search.1
+++ b/deps/npm/man/man1/npm-search.1
@@ -1,4 +1,4 @@
-.TH "NPM\-SEARCH" "1" "November 2015" "" ""
+.TH "NPM\-SEARCH" "1" "February 2016" "" ""
.SH "NAME"
\fBnpm-search\fR \- Search for packages
.SH SYNOPSIS
diff --git a/deps/npm/man/man1/npm-shrinkwrap.1 b/deps/npm/man/man1/npm-shrinkwrap.1
index 811285af48869d..82ca5c29855769 100644
--- a/deps/npm/man/man1/npm-shrinkwrap.1
+++ b/deps/npm/man/man1/npm-shrinkwrap.1
@@ -1,4 +1,4 @@
-.TH "NPM\-SHRINKWRAP" "1" "November 2015" "" ""
+.TH "NPM\-SHRINKWRAP" "1" "February 2016" "" ""
.SH "NAME"
\fBnpm-shrinkwrap\fR \- Lock down dependency versions
.SH SYNOPSIS
diff --git a/deps/npm/man/man1/npm-star.1 b/deps/npm/man/man1/npm-star.1
index 93d84af643bbde..379d1f32d71b4b 100644
--- a/deps/npm/man/man1/npm-star.1
+++ b/deps/npm/man/man1/npm-star.1
@@ -1,4 +1,4 @@
-.TH "NPM\-STAR" "1" "November 2015" "" ""
+.TH "NPM\-STAR" "1" "February 2016" "" ""
.SH "NAME"
\fBnpm-star\fR \- Mark your favorite packages
.SH SYNOPSIS
diff --git a/deps/npm/man/man1/npm-stars.1 b/deps/npm/man/man1/npm-stars.1
index 2c4057ee2a2f03..6342217f86b4d4 100644
--- a/deps/npm/man/man1/npm-stars.1
+++ b/deps/npm/man/man1/npm-stars.1
@@ -1,4 +1,4 @@
-.TH "NPM\-STARS" "1" "November 2015" "" ""
+.TH "NPM\-STARS" "1" "February 2016" "" ""
.SH "NAME"
\fBnpm-stars\fR \- View packages marked as favorites
.SH SYNOPSIS
diff --git a/deps/npm/man/man1/npm-start.1 b/deps/npm/man/man1/npm-start.1
index 2d52ecb34d3e0c..a1a6ae0e486218 100644
--- a/deps/npm/man/man1/npm-start.1
+++ b/deps/npm/man/man1/npm-start.1
@@ -1,4 +1,4 @@
-.TH "NPM\-START" "1" "November 2015" "" ""
+.TH "NPM\-START" "1" "February 2016" "" ""
.SH "NAME"
\fBnpm-start\fR \- Start a package
.SH SYNOPSIS
diff --git a/deps/npm/man/man1/npm-stop.1 b/deps/npm/man/man1/npm-stop.1
index 044bbc066ac905..7fbb6e458a8cc8 100644
--- a/deps/npm/man/man1/npm-stop.1
+++ b/deps/npm/man/man1/npm-stop.1
@@ -1,4 +1,4 @@
-.TH "NPM\-STOP" "1" "November 2015" "" ""
+.TH "NPM\-STOP" "1" "February 2016" "" ""
.SH "NAME"
\fBnpm-stop\fR \- Stop a package
.SH SYNOPSIS
diff --git a/deps/npm/man/man1/npm-tag.1 b/deps/npm/man/man1/npm-tag.1
index 426751697b3fe4..094cac657f286b 100644
--- a/deps/npm/man/man1/npm-tag.1
+++ b/deps/npm/man/man1/npm-tag.1
@@ -1,4 +1,4 @@
-.TH "NPM\-TAG" "1" "November 2015" "" ""
+.TH "NPM\-TAG" "1" "February 2016" "" ""
.SH "NAME"
\fBnpm-tag\fR \- Tag a published version
.SH SYNOPSIS
diff --git a/deps/npm/man/man1/npm-team.1 b/deps/npm/man/man1/npm-team.1
index 2e88b97a7c1fe1..1bb66a56ddeace 100644
--- a/deps/npm/man/man1/npm-team.1
+++ b/deps/npm/man/man1/npm-team.1
@@ -1,4 +1,4 @@
-.TH "NPM\-TEAM" "1" "November 2015" "" ""
+.TH "NPM\-TEAM" "1" "February 2016" "" ""
.SH "NAME"
\fBnpm-team\fR \- Manage organization teams and team memberships
.SH SYNOPSIS
@@ -24,7 +24,7 @@ handle permissions for packages\.
Teams must always be fully qualified with the organization/scope they belond to
when operating on them, separated by a colon (\fB:\fP)\. That is, if you have a
\fBdevelopers\fP team on a \fBfoo\fP organization, you must always refer to that team as
-\fBdevelopers:foo\fP in these commands\.
+\fBfoo:developers\fP in these commands\.
.RS 0
.IP \(bu 2
create / destroy:
diff --git a/deps/npm/man/man1/npm-test.1 b/deps/npm/man/man1/npm-test.1
index c36e7f42adeeb9..1b73587db06010 100644
--- a/deps/npm/man/man1/npm-test.1
+++ b/deps/npm/man/man1/npm-test.1
@@ -1,4 +1,4 @@
-.TH "NPM\-TEST" "1" "November 2015" "" ""
+.TH "NPM\-TEST" "1" "February 2016" "" ""
.SH "NAME"
\fBnpm-test\fR \- Test a package
.SH SYNOPSIS
diff --git a/deps/npm/man/man1/npm-uninstall.1 b/deps/npm/man/man1/npm-uninstall.1
index bbdf3360e51299..2acb6f1b91e622 100644
--- a/deps/npm/man/man1/npm-uninstall.1
+++ b/deps/npm/man/man1/npm-uninstall.1
@@ -1,6 +1,6 @@
-.TH "NPM\-RM" "1" "November 2015" "" ""
+.TH "NPM\-UNINSTALL" "1" "February 2016" "" ""
.SH "NAME"
-\fBnpm-rm\fR \- Remove a package
+\fBnpm-uninstall\fR \- Remove a package
.SH SYNOPSIS
.P
.RS 2
diff --git a/deps/npm/man/man1/npm-unpublish.1 b/deps/npm/man/man1/npm-unpublish.1
index 830b240fb31f95..a7fdc9f84c0b60 100644
--- a/deps/npm/man/man1/npm-unpublish.1
+++ b/deps/npm/man/man1/npm-unpublish.1
@@ -1,4 +1,4 @@
-.TH "NPM\-UNPUBLISH" "1" "November 2015" "" ""
+.TH "NPM\-UNPUBLISH" "1" "February 2016" "" ""
.SH "NAME"
\fBnpm-unpublish\fR \- Remove a package from the registry
.SH SYNOPSIS
diff --git a/deps/npm/man/man1/npm-update.1 b/deps/npm/man/man1/npm-update.1
index 3ded8282ceeacc..bf5f8aeff4327a 100644
--- a/deps/npm/man/man1/npm-update.1
+++ b/deps/npm/man/man1/npm-update.1
@@ -1,4 +1,4 @@
-.TH "NPM\-UPDATE" "1" "November 2015" "" ""
+.TH "NPM\-UPDATE" "1" "February 2016" "" ""
.SH "NAME"
\fBnpm-update\fR \- Update a package
.SH SYNOPSIS
@@ -25,7 +25,7 @@ or local) will be updated\.
.P
As of \fBnpm@2\.6\.1\fP, the \fBnpm update\fP will only inspect top\-level packages\.
Prior versions of \fBnpm\fP would also recursively inspect all dependencies\.
-To get the old behavior, use \fBnpm \-\-depth 9999 update\fP, but be warned that
+To get the old behavior, use \fBnpm \-\-depth Infinity update\fP, but be warned that
simultaneous asynchronous update of all packages, including \fBnpm\fP itself
and packages that \fBnpm\fP depends on, often causes problems up to and including
the uninstallation of \fBnpm\fP itself\.
@@ -49,16 +49,17 @@ on dependencies, \fBdep1\fP (\fBdep2\fP, \.\. etc\.)\. The published versions o
.RS 2
.nf
{
- dist\-tags: { latest: "1\.2\.2" },
- versions: { "1\.2\.2",
- "1\.2\.1",
- "1\.2\.0",
- "1\.1\.2",
- "1\.1\.1",
- "1\.0\.0",
- "0\.4\.1",
- "0\.4\.0",
- "0\.2\.0"
+ "dist\-tags": { "latest": "1\.2\.2" },
+ "versions": {
+ "1\.2\.2",
+ "1\.2\.1",
+ "1\.2\.0",
+ "1\.1\.2",
+ "1\.1\.1",
+ "1\.0\.0",
+ "0\.4\.1",
+ "0\.4\.0",
+ "0\.2\.0"
}
}
.fi
@@ -69,8 +70,8 @@ If \fBapp\fP\|'s \fBpackage\.json\fP contains:
.P
.RS 2
.nf
-dependencies: {
- dep1: "^1\.1\.1"
+"dependencies": {
+ "dep1": "^1\.1\.1"
}
.fi
.RE
@@ -83,8 +84,8 @@ However, if \fBapp\fP\|'s \fBpackage\.json\fP contains:
.P
.RS 2
.nf
-dependencies: {
- dep1: "~1\.1\.1"
+"dependencies": {
+ "dep1": "~1\.1\.1"
}
.fi
.RE
@@ -99,8 +100,8 @@ Suppose \fBapp\fP has a caret dependency on a version below \fB1\.0\.0\fP, for e
.P
.RS 2
.nf
-dependencies: {
- dep1: "^0\.2\.0"
+"dependencies": {
+ "dep1": "^0\.2\.0"
}
.fi
.RE
@@ -112,8 +113,8 @@ If the dependence were on \fB^0\.4\.0\fP:
.P
.RS 2
.nf
-dependencies: {
- dep1: "^0\.4\.0"
+"dependencies": {
+ "dep1": "^0\.4\.0"
}
.fi
.RE
@@ -128,8 +129,8 @@ the minimum required dependency in \fBpackage\.json\fP, you can use
.P
.RS 2
.nf
-dependencies: {
- dep1: "^1\.1\.1"
+"dependencies": {
+ "dep1": "^1\.1\.1"
}
.fi
.RE
@@ -139,8 +140,8 @@ and \fBpackage\.json\fP will be modified:
.P
.RS 2
.nf
-dependencies: {
- dep1: "^1\.2\.2"
+"dependencies": {
+ "dep1": "^1\.2\.2"
}
.fi
.RE
@@ -149,7 +150,7 @@ Note that \fBnpm\fP will only write an updated version to \fBpackage\.json\fP
if it installs a new package\.
.SS Updating Globally\-Installed Packages
.P
-\fBnpm update \-g\fP will apply the \fBupdate\fP action to each globally\- installed
+\fBnpm update \-g\fP will apply the \fBupdate\fP action to each globally installed
package that is \fBoutdated\fP \-\- that is, has a version that is different from
\fBlatest\fP\|\.
.P
diff --git a/deps/npm/man/man1/npm-version.1 b/deps/npm/man/man1/npm-version.1
index f133aea501d3e5..cf5f39952b3cfb 100644
--- a/deps/npm/man/man1/npm-version.1
+++ b/deps/npm/man/man1/npm-version.1
@@ -1,4 +1,4 @@
-.TH "NPM\-VERSION" "1" "November 2015" "" ""
+.TH "NPM\-VERSION" "1" "February 2016" "" ""
.SH "NAME"
\fBnpm-version\fR \- Bump a package version
.SH SYNOPSIS
diff --git a/deps/npm/man/man1/npm-view.1 b/deps/npm/man/man1/npm-view.1
index 395adb05b4e748..2ac7381e06189b 100644
--- a/deps/npm/man/man1/npm-view.1
+++ b/deps/npm/man/man1/npm-view.1
@@ -1,4 +1,4 @@
-.TH "NPM\-VIEW" "1" "November 2015" "" ""
+.TH "NPM\-VIEW" "1" "February 2016" "" ""
.SH "NAME"
\fBnpm-view\fR \- View registry info
.SH SYNOPSIS
@@ -104,6 +104,15 @@ was required by each matching version of yui3:
npm view yui3@'>0\.5\.4' dependencies\.jsdom
.fi
.RE
+.P
+To show the \fBconnect\fP package version history, you can do
+this:
+.P
+.RS 2
+.nf
+npm view connect versions
+.fi
+.RE
.SH OUTPUT
.P
If only a single string field for a single version is output, then it
diff --git a/deps/npm/man/man1/npm-whoami.1 b/deps/npm/man/man1/npm-whoami.1
index 459894ef68cda5..3dbd20be7d436f 100644
--- a/deps/npm/man/man1/npm-whoami.1
+++ b/deps/npm/man/man1/npm-whoami.1
@@ -1,4 +1,4 @@
-.TH "NPM\-WHOAMI" "1" "November 2015" "" ""
+.TH "NPM\-WHOAMI" "1" "February 2016" "" ""
.SH "NAME"
\fBnpm-whoami\fR \- Display npm username
.SH SYNOPSIS
diff --git a/deps/npm/man/man1/npm.1 b/deps/npm/man/man1/npm.1
index f3c3df9295b345..e7276de84e5d47 100644
--- a/deps/npm/man/man1/npm.1
+++ b/deps/npm/man/man1/npm.1
@@ -1,4 +1,4 @@
-.TH "NPM" "1" "November 2015" "" ""
+.TH "NPM" "1" "February 2016" "" ""
.SH "NAME"
\fBnpm\fR \- javascript package manager
.SH SYNOPSIS
@@ -10,7 +10,7 @@ npm [args]
.RE
.SH VERSION
.P
-2.14.12
+2.14.18
.SH DESCRIPTION
.P
npm is the package manager for the Node JavaScript platform\. It puts
@@ -156,7 +156,7 @@ If you would like to contribute, but don't know what to work on, check
the issues list or ask on the mailing list\.
.RS 0
.IP \(bu 2
-http://github\.com/npm/npm/issues
+https://github\.com/npm/npm/issues
.IP \(bu 2
npm\-@googlegroups\.com
@@ -167,7 +167,7 @@ When you find issues, please report them:
.RS 0
.IP \(bu 2
web:
-http://github\.com/npm/npm/issues
+https://github\.com/npm/npm/issues
.IP \(bu 2
email:
npm\-@googlegroups\.com
diff --git a/deps/npm/man/man3/npm-bin.3 b/deps/npm/man/man3/npm-bin.3
index 4ecc88c7716db3..3a353ec148f406 100644
--- a/deps/npm/man/man3/npm-bin.3
+++ b/deps/npm/man/man3/npm-bin.3
@@ -1,4 +1,4 @@
-.TH "NPM\-BIN" "3" "November 2015" "" ""
+.TH "NPM\-BIN" "3" "February 2016" "" ""
.SH "NAME"
\fBnpm-bin\fR \- Display npm bin folder
.SH SYNOPSIS
diff --git a/deps/npm/man/man3/npm-bugs.3 b/deps/npm/man/man3/npm-bugs.3
index e335380c630648..b5af809d540536 100644
--- a/deps/npm/man/man3/npm-bugs.3
+++ b/deps/npm/man/man3/npm-bugs.3
@@ -1,4 +1,4 @@
-.TH "NPM\-BUGS" "3" "November 2015" "" ""
+.TH "NPM\-BUGS" "3" "February 2016" "" ""
.SH "NAME"
\fBnpm-bugs\fR \- Bugs for a package in a web browser maybe
.SH SYNOPSIS
diff --git a/deps/npm/man/man3/npm-cache.3 b/deps/npm/man/man3/npm-cache.3
index 204513679c2fc9..75d11bb53f7c21 100644
--- a/deps/npm/man/man3/npm-cache.3
+++ b/deps/npm/man/man3/npm-cache.3
@@ -1,4 +1,4 @@
-.TH "NPM\-CACHE" "3" "November 2015" "" ""
+.TH "NPM\-CACHE" "3" "February 2016" "" ""
.SH "NAME"
\fBnpm-cache\fR \- manage the npm cache programmatically
.SH SYNOPSIS
diff --git a/deps/npm/man/man3/npm-commands.3 b/deps/npm/man/man3/npm-commands.3
index 09c221551e5351..da81ec7a10f62f 100644
--- a/deps/npm/man/man3/npm-commands.3
+++ b/deps/npm/man/man3/npm-commands.3
@@ -1,4 +1,4 @@
-.TH "NPM\-COMMANDS" "3" "November 2015" "" ""
+.TH "NPM\-COMMANDS" "3" "February 2016" "" ""
.SH "NAME"
\fBnpm-commands\fR \- npm commands
.SH SYNOPSIS
diff --git a/deps/npm/man/man3/npm-config.3 b/deps/npm/man/man3/npm-config.3
index 284afac71665e8..92c4a831bd1365 100644
--- a/deps/npm/man/man3/npm-config.3
+++ b/deps/npm/man/man3/npm-config.3
@@ -1,4 +1,4 @@
-.TH "NPM\-CONFIG" "3" "November 2015" "" ""
+.TH "NPM\-CONFIG" "3" "February 2016" "" ""
.SH "NAME"
\fBnpm-config\fR \- Manage the npm configuration files
.SH SYNOPSIS
diff --git a/deps/npm/man/man3/npm-deprecate.3 b/deps/npm/man/man3/npm-deprecate.3
index 7d570b41b92a41..faaea6d522b750 100644
--- a/deps/npm/man/man3/npm-deprecate.3
+++ b/deps/npm/man/man3/npm-deprecate.3
@@ -1,4 +1,4 @@
-.TH "NPM\-DEPRECATE" "3" "November 2015" "" ""
+.TH "NPM\-DEPRECATE" "3" "February 2016" "" ""
.SH "NAME"
\fBnpm-deprecate\fR \- Deprecate a version of a package
.SH SYNOPSIS
diff --git a/deps/npm/man/man3/npm-docs.3 b/deps/npm/man/man3/npm-docs.3
index 78c540d6cb9cbb..d2e0d93306bcf6 100644
--- a/deps/npm/man/man3/npm-docs.3
+++ b/deps/npm/man/man3/npm-docs.3
@@ -1,4 +1,4 @@
-.TH "NPM\-DOCS" "3" "November 2015" "" ""
+.TH "NPM\-DOCS" "3" "February 2016" "" ""
.SH "NAME"
\fBnpm-docs\fR \- Docs for a package in a web browser maybe
.SH SYNOPSIS
diff --git a/deps/npm/man/man3/npm-edit.3 b/deps/npm/man/man3/npm-edit.3
index 0a09f8344dad7e..430f990f9d320f 100644
--- a/deps/npm/man/man3/npm-edit.3
+++ b/deps/npm/man/man3/npm-edit.3
@@ -1,4 +1,4 @@
-.TH "NPM\-EDIT" "3" "November 2015" "" ""
+.TH "NPM\-EDIT" "3" "February 2016" "" ""
.SH "NAME"
\fBnpm-edit\fR \- Edit an installed package
.SH SYNOPSIS
diff --git a/deps/npm/man/man3/npm-explore.3 b/deps/npm/man/man3/npm-explore.3
index e3c6c65fef0146..9bca4e2098c9fd 100644
--- a/deps/npm/man/man3/npm-explore.3
+++ b/deps/npm/man/man3/npm-explore.3
@@ -1,4 +1,4 @@
-.TH "NPM\-EXPLORE" "3" "November 2015" "" ""
+.TH "NPM\-EXPLORE" "3" "February 2016" "" ""
.SH "NAME"
\fBnpm-explore\fR \- Browse an installed package
.SH SYNOPSIS
diff --git a/deps/npm/man/man3/npm-help-search.3 b/deps/npm/man/man3/npm-help-search.3
index 6fe5427c4ad3d8..caa75029118768 100644
--- a/deps/npm/man/man3/npm-help-search.3
+++ b/deps/npm/man/man3/npm-help-search.3
@@ -1,4 +1,4 @@
-.TH "NPM\-HELP\-SEARCH" "3" "November 2015" "" ""
+.TH "NPM\-HELP\-SEARCH" "3" "February 2016" "" ""
.SH "NAME"
\fBnpm-help-search\fR \- Search the help pages
.SH SYNOPSIS
diff --git a/deps/npm/man/man3/npm-init.3 b/deps/npm/man/man3/npm-init.3
index 9ab9ebe9284601..5038435b31c72f 100644
--- a/deps/npm/man/man3/npm-init.3
+++ b/deps/npm/man/man3/npm-init.3
@@ -1,4 +1,4 @@
-.TH "NPM" "" "November 2015" "" ""
+.TH "NPM" "" "February 2016" "" ""
.SH "NAME"
\fBnpm\fR
.SH SYNOPSIS
diff --git a/deps/npm/man/man3/npm-install.3 b/deps/npm/man/man3/npm-install.3
index ef11bd432fabbd..3dfd94ad876bb6 100644
--- a/deps/npm/man/man3/npm-install.3
+++ b/deps/npm/man/man3/npm-install.3
@@ -1,4 +1,4 @@
-.TH "NPM\-INSTALL" "3" "November 2015" "" ""
+.TH "NPM\-INSTALL" "3" "February 2016" "" ""
.SH "NAME"
\fBnpm-install\fR \- install a package programmatically
.SH SYNOPSIS
diff --git a/deps/npm/man/man3/npm-link.3 b/deps/npm/man/man3/npm-link.3
index 220fec23f04fe6..5fc8430f64fbd3 100644
--- a/deps/npm/man/man3/npm-link.3
+++ b/deps/npm/man/man3/npm-link.3
@@ -1,4 +1,4 @@
-.TH "NPM\-LINK" "3" "November 2015" "" ""
+.TH "NPM\-LINK" "3" "February 2016" "" ""
.SH "NAME"
\fBnpm-link\fR \- Symlink a package folder
.SH SYNOPSIS
diff --git a/deps/npm/man/man3/npm-load.3 b/deps/npm/man/man3/npm-load.3
index d578958d381d36..87ae27950bd08f 100644
--- a/deps/npm/man/man3/npm-load.3
+++ b/deps/npm/man/man3/npm-load.3
@@ -1,4 +1,4 @@
-.TH "NPM\-LOAD" "3" "November 2015" "" ""
+.TH "NPM\-LOAD" "3" "February 2016" "" ""
.SH "NAME"
\fBnpm-load\fR \- Load config settings
.SH SYNOPSIS
diff --git a/deps/npm/man/man3/npm-ls.3 b/deps/npm/man/man3/npm-ls.3
index 7954a93d79cb0f..e85b6c548cc0a5 100644
--- a/deps/npm/man/man3/npm-ls.3
+++ b/deps/npm/man/man3/npm-ls.3
@@ -1,4 +1,4 @@
-.TH "NPM\-LS" "3" "November 2015" "" ""
+.TH "NPM\-LS" "3" "February 2016" "" ""
.SH "NAME"
\fBnpm-ls\fR \- List installed packages
.SH SYNOPSIS
diff --git a/deps/npm/man/man3/npm-outdated.3 b/deps/npm/man/man3/npm-outdated.3
index d9e7a6e165a5c5..e9bf5382a10f11 100644
--- a/deps/npm/man/man3/npm-outdated.3
+++ b/deps/npm/man/man3/npm-outdated.3
@@ -1,4 +1,4 @@
-.TH "NPM\-OUTDATED" "3" "November 2015" "" ""
+.TH "NPM\-OUTDATED" "3" "February 2016" "" ""
.SH "NAME"
\fBnpm-outdated\fR \- Check for outdated packages
.SH SYNOPSIS
diff --git a/deps/npm/man/man3/npm-owner.3 b/deps/npm/man/man3/npm-owner.3
index 91a50d13bf48eb..1e3d708cc9b99f 100644
--- a/deps/npm/man/man3/npm-owner.3
+++ b/deps/npm/man/man3/npm-owner.3
@@ -1,4 +1,4 @@
-.TH "NPM\-OWNER" "3" "November 2015" "" ""
+.TH "NPM\-OWNER" "3" "February 2016" "" ""
.SH "NAME"
\fBnpm-owner\fR \- Manage package owners
.SH SYNOPSIS
diff --git a/deps/npm/man/man3/npm-pack.3 b/deps/npm/man/man3/npm-pack.3
index f1945fb12630bd..8e668bed6406f9 100644
--- a/deps/npm/man/man3/npm-pack.3
+++ b/deps/npm/man/man3/npm-pack.3
@@ -1,4 +1,4 @@
-.TH "NPM\-PACK" "3" "November 2015" "" ""
+.TH "NPM\-PACK" "3" "February 2016" "" ""
.SH "NAME"
\fBnpm-pack\fR \- Create a tarball from a package
.SH SYNOPSIS
diff --git a/deps/npm/man/man3/npm-ping.3 b/deps/npm/man/man3/npm-ping.3
index c2b2fc65b1628e..31e178ad7776fe 100644
--- a/deps/npm/man/man3/npm-ping.3
+++ b/deps/npm/man/man3/npm-ping.3
@@ -1,4 +1,4 @@
-.TH "NPM\-PING" "3" "November 2015" "" ""
+.TH "NPM\-PING" "3" "February 2016" "" ""
.SH "NAME"
\fBnpm-ping\fR \- Ping npm registry
.SH SYNOPSIS
diff --git a/deps/npm/man/man3/npm-prefix.3 b/deps/npm/man/man3/npm-prefix.3
index 239e1666fb6570..0df80bea914149 100644
--- a/deps/npm/man/man3/npm-prefix.3
+++ b/deps/npm/man/man3/npm-prefix.3
@@ -1,4 +1,4 @@
-.TH "NPM\-PREFIX" "3" "November 2015" "" ""
+.TH "NPM\-PREFIX" "3" "February 2016" "" ""
.SH "NAME"
\fBnpm-prefix\fR \- Display prefix
.SH SYNOPSIS
diff --git a/deps/npm/man/man3/npm-prune.3 b/deps/npm/man/man3/npm-prune.3
index 378ce5e4065071..d0482944e6747a 100644
--- a/deps/npm/man/man3/npm-prune.3
+++ b/deps/npm/man/man3/npm-prune.3
@@ -1,4 +1,4 @@
-.TH "NPM\-PRUNE" "3" "November 2015" "" ""
+.TH "NPM\-PRUNE" "3" "February 2016" "" ""
.SH "NAME"
\fBnpm-prune\fR \- Remove extraneous packages
.SH SYNOPSIS
diff --git a/deps/npm/man/man3/npm-publish.3 b/deps/npm/man/man3/npm-publish.3
index eb28d2a66bcffe..e4eec9899337ca 100644
--- a/deps/npm/man/man3/npm-publish.3
+++ b/deps/npm/man/man3/npm-publish.3
@@ -1,4 +1,4 @@
-.TH "NPM\-PUBLISH" "3" "November 2015" "" ""
+.TH "NPM\-PUBLISH" "3" "February 2016" "" ""
.SH "NAME"
\fBnpm-publish\fR \- Publish a package
.SH SYNOPSIS
diff --git a/deps/npm/man/man3/npm-rebuild.3 b/deps/npm/man/man3/npm-rebuild.3
index 36d806187a1d68..eb132e6ee1b9a4 100644
--- a/deps/npm/man/man3/npm-rebuild.3
+++ b/deps/npm/man/man3/npm-rebuild.3
@@ -1,4 +1,4 @@
-.TH "NPM\-REBUILD" "3" "November 2015" "" ""
+.TH "NPM\-REBUILD" "3" "February 2016" "" ""
.SH "NAME"
\fBnpm-rebuild\fR \- Rebuild a package
.SH SYNOPSIS
diff --git a/deps/npm/man/man3/npm-repo.3 b/deps/npm/man/man3/npm-repo.3
index 16e4df2c0e7c88..6c0044fd97e15a 100644
--- a/deps/npm/man/man3/npm-repo.3
+++ b/deps/npm/man/man3/npm-repo.3
@@ -1,4 +1,4 @@
-.TH "NPM\-REPO" "3" "November 2015" "" ""
+.TH "NPM\-REPO" "3" "February 2016" "" ""
.SH "NAME"
\fBnpm-repo\fR \- Open package repository page in the browser
.SH SYNOPSIS
diff --git a/deps/npm/man/man3/npm-restart.3 b/deps/npm/man/man3/npm-restart.3
index 2eaa211b631e91..2c809d822a50a9 100644
--- a/deps/npm/man/man3/npm-restart.3
+++ b/deps/npm/man/man3/npm-restart.3
@@ -1,4 +1,4 @@
-.TH "NPM\-RESTART" "3" "November 2015" "" ""
+.TH "NPM\-RESTART" "3" "February 2016" "" ""
.SH "NAME"
\fBnpm-restart\fR \- Restart a package
.SH SYNOPSIS
diff --git a/deps/npm/man/man3/npm-root.3 b/deps/npm/man/man3/npm-root.3
index e0d01e3ab252bf..9d93e79d5f8c0b 100644
--- a/deps/npm/man/man3/npm-root.3
+++ b/deps/npm/man/man3/npm-root.3
@@ -1,4 +1,4 @@
-.TH "NPM\-ROOT" "3" "November 2015" "" ""
+.TH "NPM\-ROOT" "3" "February 2016" "" ""
.SH "NAME"
\fBnpm-root\fR \- Display npm root
.SH SYNOPSIS
diff --git a/deps/npm/man/man3/npm-run-script.3 b/deps/npm/man/man3/npm-run-script.3
index e9a53432744f01..2eb36b78faafb0 100644
--- a/deps/npm/man/man3/npm-run-script.3
+++ b/deps/npm/man/man3/npm-run-script.3
@@ -1,4 +1,4 @@
-.TH "NPM\-RUN\-SCRIPT" "3" "November 2015" "" ""
+.TH "NPM\-RUN\-SCRIPT" "3" "February 2016" "" ""
.SH "NAME"
\fBnpm-run-script\fR \- Run arbitrary package scripts
.SH SYNOPSIS
diff --git a/deps/npm/man/man3/npm-search.3 b/deps/npm/man/man3/npm-search.3
index dd7a022dd2eebb..d9a166cf09d93f 100644
--- a/deps/npm/man/man3/npm-search.3
+++ b/deps/npm/man/man3/npm-search.3
@@ -1,4 +1,4 @@
-.TH "NPM\-SEARCH" "3" "November 2015" "" ""
+.TH "NPM\-SEARCH" "3" "February 2016" "" ""
.SH "NAME"
\fBnpm-search\fR \- Search for packages
.SH SYNOPSIS
diff --git a/deps/npm/man/man3/npm-shrinkwrap.3 b/deps/npm/man/man3/npm-shrinkwrap.3
index a5656e2b2f6744..8b1a06f85d90f0 100644
--- a/deps/npm/man/man3/npm-shrinkwrap.3
+++ b/deps/npm/man/man3/npm-shrinkwrap.3
@@ -1,4 +1,4 @@
-.TH "NPM\-SHRINKWRAP" "3" "November 2015" "" ""
+.TH "NPM\-SHRINKWRAP" "3" "February 2016" "" ""
.SH "NAME"
\fBnpm-shrinkwrap\fR \- programmatically generate package shrinkwrap file
.SH SYNOPSIS
diff --git a/deps/npm/man/man3/npm-start.3 b/deps/npm/man/man3/npm-start.3
index daa7502e72a4c0..3b1cb92c5e7227 100644
--- a/deps/npm/man/man3/npm-start.3
+++ b/deps/npm/man/man3/npm-start.3
@@ -1,4 +1,4 @@
-.TH "NPM\-START" "3" "November 2015" "" ""
+.TH "NPM\-START" "3" "February 2016" "" ""
.SH "NAME"
\fBnpm-start\fR \- Start a package
.SH SYNOPSIS
diff --git a/deps/npm/man/man3/npm-stop.3 b/deps/npm/man/man3/npm-stop.3
index d1aca3dec545bf..6dc0096e84ba37 100644
--- a/deps/npm/man/man3/npm-stop.3
+++ b/deps/npm/man/man3/npm-stop.3
@@ -1,4 +1,4 @@
-.TH "NPM\-STOP" "3" "November 2015" "" ""
+.TH "NPM\-STOP" "3" "February 2016" "" ""
.SH "NAME"
\fBnpm-stop\fR \- Stop a package
.SH SYNOPSIS
diff --git a/deps/npm/man/man3/npm-tag.3 b/deps/npm/man/man3/npm-tag.3
index dc7aaefda14afd..efc6e6a1f52bc2 100644
--- a/deps/npm/man/man3/npm-tag.3
+++ b/deps/npm/man/man3/npm-tag.3
@@ -1,4 +1,4 @@
-.TH "NPM\-TAG" "3" "November 2015" "" ""
+.TH "NPM\-TAG" "3" "February 2016" "" ""
.SH "NAME"
\fBnpm-tag\fR \- Tag a published version
.SH SYNOPSIS
diff --git a/deps/npm/man/man3/npm-test.3 b/deps/npm/man/man3/npm-test.3
index b2184617e2d5ba..58adbc37468081 100644
--- a/deps/npm/man/man3/npm-test.3
+++ b/deps/npm/man/man3/npm-test.3
@@ -1,4 +1,4 @@
-.TH "NPM\-TEST" "3" "November 2015" "" ""
+.TH "NPM\-TEST" "3" "February 2016" "" ""
.SH "NAME"
\fBnpm-test\fR \- Test a package
.SH SYNOPSIS
diff --git a/deps/npm/man/man3/npm-uninstall.3 b/deps/npm/man/man3/npm-uninstall.3
index c02c62d6543ef2..60b6bf9e035800 100644
--- a/deps/npm/man/man3/npm-uninstall.3
+++ b/deps/npm/man/man3/npm-uninstall.3
@@ -1,4 +1,4 @@
-.TH "NPM\-UNINSTALL" "3" "November 2015" "" ""
+.TH "NPM\-UNINSTALL" "3" "February 2016" "" ""
.SH "NAME"
\fBnpm-uninstall\fR \- uninstall a package programmatically
.SH SYNOPSIS
diff --git a/deps/npm/man/man3/npm-unpublish.3 b/deps/npm/man/man3/npm-unpublish.3
index d700a2cd8d6474..80076e8e5744f1 100644
--- a/deps/npm/man/man3/npm-unpublish.3
+++ b/deps/npm/man/man3/npm-unpublish.3
@@ -1,4 +1,4 @@
-.TH "NPM\-UNPUBLISH" "3" "November 2015" "" ""
+.TH "NPM\-UNPUBLISH" "3" "February 2016" "" ""
.SH "NAME"
\fBnpm-unpublish\fR \- Remove a package from the registry
.SH SYNOPSIS
diff --git a/deps/npm/man/man3/npm-update.3 b/deps/npm/man/man3/npm-update.3
index 0045e8facb0275..c61befd932ac51 100644
--- a/deps/npm/man/man3/npm-update.3
+++ b/deps/npm/man/man3/npm-update.3
@@ -1,4 +1,4 @@
-.TH "NPM\-UPDATE" "3" "November 2015" "" ""
+.TH "NPM\-UPDATE" "3" "February 2016" "" ""
.SH "NAME"
\fBnpm-update\fR \- Update a package
.SH SYNOPSIS
@@ -8,7 +8,7 @@
npm\.commands\.update(packages, callback)
.fi
.RE
-.TH "DESCRIPTION" "" "November 2015" "" ""
+.TH "DESCRIPTION" "" "February 2016" "" ""
.SH "NAME"
\fBDESCRIPTION\fR
.P
diff --git a/deps/npm/man/man3/npm-version.3 b/deps/npm/man/man3/npm-version.3
index 1851cb50cbc066..eb7134a7b87f70 100644
--- a/deps/npm/man/man3/npm-version.3
+++ b/deps/npm/man/man3/npm-version.3
@@ -1,4 +1,4 @@
-.TH "NPM\-VERSION" "3" "November 2015" "" ""
+.TH "NPM\-VERSION" "3" "February 2016" "" ""
.SH "NAME"
\fBnpm-version\fR \- Bump a package version
.SH SYNOPSIS
diff --git a/deps/npm/man/man3/npm-view.3 b/deps/npm/man/man3/npm-view.3
index 11f4d925376046..1505d8806effc7 100644
--- a/deps/npm/man/man3/npm-view.3
+++ b/deps/npm/man/man3/npm-view.3
@@ -1,4 +1,4 @@
-.TH "NPM\-VIEW" "3" "November 2015" "" ""
+.TH "NPM\-VIEW" "3" "February 2016" "" ""
.SH "NAME"
\fBnpm-view\fR \- View registry info
.SH SYNOPSIS
diff --git a/deps/npm/man/man3/npm-whoami.3 b/deps/npm/man/man3/npm-whoami.3
index 0f2e348e0b7d25..9dc50c567c9aa8 100644
--- a/deps/npm/man/man3/npm-whoami.3
+++ b/deps/npm/man/man3/npm-whoami.3
@@ -1,4 +1,4 @@
-.TH "NPM\-WHOAMI" "3" "November 2015" "" ""
+.TH "NPM\-WHOAMI" "3" "February 2016" "" ""
.SH "NAME"
\fBnpm-whoami\fR \- Display npm username
.SH SYNOPSIS
diff --git a/deps/npm/man/man3/npm.3 b/deps/npm/man/man3/npm.3
index 6d1edd1c335cc0..7a826a9251f6a1 100644
--- a/deps/npm/man/man3/npm.3
+++ b/deps/npm/man/man3/npm.3
@@ -1,4 +1,4 @@
-.TH "NPM" "3" "November 2015" "" ""
+.TH "NPM" "3" "February 2016" "" ""
.SH "NAME"
\fBnpm\fR \- javascript package manager
.SH SYNOPSIS
@@ -20,7 +20,7 @@ npm\.load([configObject, ]function (er, npm) {
.RE
.SH VERSION
.P
-2.14.12
+2.14.18
.SH DESCRIPTION
.P
This is the API documentation for npm\.
diff --git a/deps/npm/man/man5/npm-folders.5 b/deps/npm/man/man5/npm-folders.5
index 3568e77646c329..dc217dd4c603cc 100644
--- a/deps/npm/man/man5/npm-folders.5
+++ b/deps/npm/man/man5/npm-folders.5
@@ -1,4 +1,4 @@
-.TH "NPM\-FOLDERS" "5" "November 2015" "" ""
+.TH "NPM\-FOLDERS" "5" "February 2016" "" ""
.SH "NAME"
\fBnpm-folders\fR \- Folder Structures Used by npm
.SH DESCRIPTION
@@ -25,12 +25,10 @@ If you need both, then install it in both places, or use \fBnpm link\fP\|\.
.SS prefix Configuration
.P
The \fBprefix\fP config defaults to the location where node is installed\.
-On most systems, this is \fB/usr/local\fP, and most of the time is the same
-as node's \fBprocess\.installPrefix\fP\|\.
-.P
-On windows, this is the exact location of the node\.exe binary\. On Unix
-systems, it's one level up, since node is typically installed at
-\fB{prefix}/bin/node\fP rather than \fB{prefix}/node\.exe\fP\|\.
+On most systems, this is \fB/usr/local\fP\|\. On windows, this is the exact
+location of the node\.exe binary\. On Unix systems, it's one level up,
+since node is typically installed at \fB{prefix}/bin/node\fP rather than
+\fB{prefix}/node\.exe\fP\|\.
.P
When the \fBglobal\fP flag is set, npm installs things into this prefix\.
When it is not set, it uses the root of the current package, or the
diff --git a/deps/npm/man/man5/npm-global.5 b/deps/npm/man/man5/npm-global.5
index 3568e77646c329..dc217dd4c603cc 100644
--- a/deps/npm/man/man5/npm-global.5
+++ b/deps/npm/man/man5/npm-global.5
@@ -1,4 +1,4 @@
-.TH "NPM\-FOLDERS" "5" "November 2015" "" ""
+.TH "NPM\-FOLDERS" "5" "February 2016" "" ""
.SH "NAME"
\fBnpm-folders\fR \- Folder Structures Used by npm
.SH DESCRIPTION
@@ -25,12 +25,10 @@ If you need both, then install it in both places, or use \fBnpm link\fP\|\.
.SS prefix Configuration
.P
The \fBprefix\fP config defaults to the location where node is installed\.
-On most systems, this is \fB/usr/local\fP, and most of the time is the same
-as node's \fBprocess\.installPrefix\fP\|\.
-.P
-On windows, this is the exact location of the node\.exe binary\. On Unix
-systems, it's one level up, since node is typically installed at
-\fB{prefix}/bin/node\fP rather than \fB{prefix}/node\.exe\fP\|\.
+On most systems, this is \fB/usr/local\fP\|\. On windows, this is the exact
+location of the node\.exe binary\. On Unix systems, it's one level up,
+since node is typically installed at \fB{prefix}/bin/node\fP rather than
+\fB{prefix}/node\.exe\fP\|\.
.P
When the \fBglobal\fP flag is set, npm installs things into this prefix\.
When it is not set, it uses the root of the current package, or the
diff --git a/deps/npm/man/man5/npm-json.5 b/deps/npm/man/man5/npm-json.5
index d8f5583d7a99f3..fe6d154cccf60d 100644
--- a/deps/npm/man/man5/npm-json.5
+++ b/deps/npm/man/man5/npm-json.5
@@ -1,4 +1,4 @@
-.TH "PACKAGE\.JSON" "5" "November 2015" "" ""
+.TH "PACKAGE\.JSON" "5" "February 2016" "" ""
.SH "NAME"
\fBpackage.json\fR \- Specifics of npm's package\.json handling
.SH DESCRIPTION
@@ -21,7 +21,7 @@ The name is what your thing is called\.
Some rules:
.RS 0
.IP \(bu 2
-The name must be shorter than 214 characters\. This includes the scope for
+The name must be less than or equal to 214 characters\. This includes the scope for
scoped packages\.
.IP \(bu 2
The name can't start with a dot or an underscore\.
@@ -118,10 +118,10 @@ current SPDX license identifier for the license you're using, like this:
.P
You can check the full list of SPDX license IDs \fIhttps://spdx\.org/licenses/\fR\|\.
Ideally you should pick one that is
-OSI \fIhttp://opensource\.org/licenses/alphabetical\fR approved\.
+OSI \fIhttps://opensource\.org/licenses/alphabetical\fR approved\.
.P
If your package is licensed under multiple common licenses, use an SPDX license
-expression syntax version 2\.0 string \fIhttp://npmjs\.com/package/spdx\fR, like this:
+expression syntax version 2\.0 string \fIhttps://npmjs\.com/package/spdx\fR, like this:
.P
.RS 2
.nf
@@ -130,7 +130,7 @@ expression syntax version 2\.0 string \fIhttp://npmjs\.com/package/spdx\fR, like
.RE
.P
If you are using a license that hasn't been assigned an SPDX identifier, or if
-you are using a custom license, use the following valid SPDX expression:
+you are using a custom license, use a string value like this one:
.P
.RS 2
.nf
@@ -227,11 +227,13 @@ Certain files are always included, regardless of settings:
.IP \(bu 2
\fBpackage\.json\fP
.IP \(bu 2
-\fBREADME\fP (and its variants)
+\fBREADME\fP
.IP \(bu 2
-\fBCHANGELOG\fP (and its variants)
+\fBCHANGES\fP / \fBCHANGELOG\fP / \fBHISTORY\fP (any casing and file extension)
.IP \(bu 2
\fBLICENSE\fP / \fBLICENCE\fP
+.IP \(bu 2
+The file in the "main" field
.RE
.P
@@ -250,13 +252,15 @@ Conversely, some files are always ignored:
.IP \(bu 2
\fB\|\.wafpickle\-N\fP
.IP \(bu 2
-\fB*\.swp\fP
+\fB\|\.*\.swp\fP
.IP \(bu 2
\fB\|\.DS_Store\fP
.IP \(bu 2
\fB\|\._*\fP
.IP \(bu 2
\fBnpm\-debug\.log\fP
+.IP \(bu 2
+\fB\|\.npmrc\fP
.RE
.SH main
@@ -506,7 +510,7 @@ See npm help 7 semver for more details about specifying version ranges\.
.IP \(bu 2
\fBtag\fP A specific version tagged and published as \fBtag\fP See npm help \fBnpm\-tag\fP
.IP \(bu 2
-\fBpath/path/path\fP See Local Paths below
+\fBpath/path/path\fP See Local Paths \fI#local\-paths\fR below
.RE
.P
@@ -884,7 +888,7 @@ npm help install
.IP \(bu 2
npm help publish
.IP \(bu 2
-npm help rm
+npm help uninstall
.RE
diff --git a/deps/npm/man/man5/npmrc.5 b/deps/npm/man/man5/npmrc.5
index ed6ee372d33622..4dbd70e38e8cc3 100644
--- a/deps/npm/man/man5/npmrc.5
+++ b/deps/npm/man/man5/npmrc.5
@@ -1,4 +1,4 @@
-.TH "NPMRC" "5" "November 2015" "" ""
+.TH "NPMRC" "5" "February 2016" "" ""
.SH "NAME"
\fBnpmrc\fR \- The npm config files
.SH DESCRIPTION
diff --git a/deps/npm/man/man5/package.json.5 b/deps/npm/man/man5/package.json.5
index d8f5583d7a99f3..fe6d154cccf60d 100644
--- a/deps/npm/man/man5/package.json.5
+++ b/deps/npm/man/man5/package.json.5
@@ -1,4 +1,4 @@
-.TH "PACKAGE\.JSON" "5" "November 2015" "" ""
+.TH "PACKAGE\.JSON" "5" "February 2016" "" ""
.SH "NAME"
\fBpackage.json\fR \- Specifics of npm's package\.json handling
.SH DESCRIPTION
@@ -21,7 +21,7 @@ The name is what your thing is called\.
Some rules:
.RS 0
.IP \(bu 2
-The name must be shorter than 214 characters\. This includes the scope for
+The name must be less than or equal to 214 characters\. This includes the scope for
scoped packages\.
.IP \(bu 2
The name can't start with a dot or an underscore\.
@@ -118,10 +118,10 @@ current SPDX license identifier for the license you're using, like this:
.P
You can check the full list of SPDX license IDs \fIhttps://spdx\.org/licenses/\fR\|\.
Ideally you should pick one that is
-OSI \fIhttp://opensource\.org/licenses/alphabetical\fR approved\.
+OSI \fIhttps://opensource\.org/licenses/alphabetical\fR approved\.
.P
If your package is licensed under multiple common licenses, use an SPDX license
-expression syntax version 2\.0 string \fIhttp://npmjs\.com/package/spdx\fR, like this:
+expression syntax version 2\.0 string \fIhttps://npmjs\.com/package/spdx\fR, like this:
.P
.RS 2
.nf
@@ -130,7 +130,7 @@ expression syntax version 2\.0 string \fIhttp://npmjs\.com/package/spdx\fR, like
.RE
.P
If you are using a license that hasn't been assigned an SPDX identifier, or if
-you are using a custom license, use the following valid SPDX expression:
+you are using a custom license, use a string value like this one:
.P
.RS 2
.nf
@@ -227,11 +227,13 @@ Certain files are always included, regardless of settings:
.IP \(bu 2
\fBpackage\.json\fP
.IP \(bu 2
-\fBREADME\fP (and its variants)
+\fBREADME\fP
.IP \(bu 2
-\fBCHANGELOG\fP (and its variants)
+\fBCHANGES\fP / \fBCHANGELOG\fP / \fBHISTORY\fP (any casing and file extension)
.IP \(bu 2
\fBLICENSE\fP / \fBLICENCE\fP
+.IP \(bu 2
+The file in the "main" field
.RE
.P
@@ -250,13 +252,15 @@ Conversely, some files are always ignored:
.IP \(bu 2
\fB\|\.wafpickle\-N\fP
.IP \(bu 2
-\fB*\.swp\fP
+\fB\|\.*\.swp\fP
.IP \(bu 2
\fB\|\.DS_Store\fP
.IP \(bu 2
\fB\|\._*\fP
.IP \(bu 2
\fBnpm\-debug\.log\fP
+.IP \(bu 2
+\fB\|\.npmrc\fP
.RE
.SH main
@@ -506,7 +510,7 @@ See npm help 7 semver for more details about specifying version ranges\.
.IP \(bu 2
\fBtag\fP A specific version tagged and published as \fBtag\fP See npm help \fBnpm\-tag\fP
.IP \(bu 2
-\fBpath/path/path\fP See Local Paths below
+\fBpath/path/path\fP See Local Paths \fI#local\-paths\fR below
.RE
.P
@@ -884,7 +888,7 @@ npm help install
.IP \(bu 2
npm help publish
.IP \(bu 2
-npm help rm
+npm help uninstall
.RE
diff --git a/deps/npm/man/man7/npm-coding-style.7 b/deps/npm/man/man7/npm-coding-style.7
index a60a42ce556572..328128a5198014 100644
--- a/deps/npm/man/man7/npm-coding-style.7
+++ b/deps/npm/man/man7/npm-coding-style.7
@@ -1,4 +1,4 @@
-.TH "NPM\-CODING\-STYLE" "7" "November 2015" "" ""
+.TH "NPM\-CODING\-STYLE" "7" "February 2016" "" ""
.SH "NAME"
\fBnpm-coding-style\fR \- npm's "funny" coding style
.SH DESCRIPTION
diff --git a/deps/npm/man/man7/npm-config.7 b/deps/npm/man/man7/npm-config.7
index 7d6bede5d65631..5d68dda345fdd7 100644
--- a/deps/npm/man/man7/npm-config.7
+++ b/deps/npm/man/man7/npm-config.7
@@ -1,4 +1,4 @@
-.TH "NPM\-CONFIG" "7" "November 2015" "" ""
+.TH "NPM\-CONFIG" "7" "February 2016" "" ""
.SH "NAME"
\fBnpm-config\fR \- More than you probably want to know about npm configuration
.SH DESCRIPTION
@@ -323,7 +323,7 @@ A client certificate to pass when accessing the registry\.
.SS color
.RS 0
.IP \(bu 2
-Default: true on Posix, false on Windows
+Default: true
.IP \(bu 2
Type: Boolean or \fB"always"\fP
diff --git a/deps/npm/man/man7/npm-developers.7 b/deps/npm/man/man7/npm-developers.7
index 703fac404cad66..d85b86684adf0c 100644
--- a/deps/npm/man/man7/npm-developers.7
+++ b/deps/npm/man/man7/npm-developers.7
@@ -1,4 +1,4 @@
-.TH "NPM\-DEVELOPERS" "7" "November 2015" "" ""
+.TH "NPM\-DEVELOPERS" "7" "February 2016" "" ""
.SH "NAME"
\fBnpm-developers\fR \- Developer Guide
.SH DESCRIPTION
@@ -114,7 +114,7 @@ create an empty \fB\|\.npmignore\fP file to override it\. Like \fBgit\fP, \fBnpm
for \fB\|\.npmignore\fP and \fB\|\.gitignore\fP files in all subdirectories of your
package, not only the root directory\.
.P
-\fB\|\.npmignore\fP files follow the same pattern rules \fIhttp://git\-scm\.com/book/en/v2/Git\-Basics\-Recording\-Changes\-to\-the\-Repository#Ignoring\-Files\fR
+\fB\|\.npmignore\fP files follow the same pattern rules \fIhttps://git\-scm\.com/book/en/v2/Git\-Basics\-Recording\-Changes\-to\-the\-Repository#Ignoring\-Files\fR
as \fB\|\.gitignore\fP files:
.RS 0
.IP \(bu 2
@@ -239,7 +239,7 @@ and then follow the prompts\.
This is documented better in npm help adduser\.
.SH Publish your package
.P
-This part's easy\. IN the root of your folder, do this:
+This part's easy\. In the root of your folder, do this:
.P
.RS 2
.nf
diff --git a/deps/npm/man/man7/npm-disputes.7 b/deps/npm/man/man7/npm-disputes.7
index ae17206bcc6d12..15dd5ddbd85dca 100644
--- a/deps/npm/man/man7/npm-disputes.7
+++ b/deps/npm/man/man7/npm-disputes.7
@@ -1,4 +1,4 @@
-.TH "NPM\-DISPUTES" "7" "November 2015" "" ""
+.TH "NPM\-DISPUTES" "7" "February 2016" "" ""
.SH "NAME"
\fBnpm-disputes\fR \- Handling Module Name Disputes
.SH SYNOPSIS
diff --git a/deps/npm/man/man7/npm-faq.7 b/deps/npm/man/man7/npm-faq.7
deleted file mode 100644
index ad571b0c879d50..00000000000000
--- a/deps/npm/man/man7/npm-faq.7
+++ /dev/null
@@ -1,429 +0,0 @@
-.TH "NPM\-FAQ" "7" "November 2015" "" ""
-.SH "NAME"
-\fBnpm-faq\fR \- Frequently Asked Questions
-.SH Where can I find these docs in HTML?
-.P
-https://docs\.npmjs\.com/, or run:
-.P
-.RS 2
-.nf
-npm config set viewer browser
-.fi
-.RE
-.P
-to open these documents in your default web browser rather than \fBman\fP\|\.
-.SH It didn't work\.
-.P
-That's not really a question\.
-.SH Why didn't it work?
-.P
-I don't know yet\.
-.P
-Read the error output, and if you can't figure out what it means,
-do what it says and post a bug with all the information it asks for\.
-.SH Where does npm put stuff?
-.P
-See npm help 5 \fBnpm\-folders\fP
-.P
-tl;dr:
-.RS 0
-.IP \(bu 2
-Use the \fBnpm root\fP command to see where modules go, and the \fBnpm bin\fP
-command to see where executables go
-.IP \(bu 2
-Global installs are different from local installs\. If you install
-something with the \fB\-g\fP flag, then its executables go in \fBnpm bin \-g\fP
-and its modules go in \fBnpm root \-g\fP\|\.
-
-.RE
-.SH How do I install something on my computer in a central location?
-.P
-Install it globally by tacking \fB\-g\fP or \fB\-\-global\fP to the command\. (This
-is especially important for command line utilities that need to add
-their bins to the global system \fBPATH\fP\|\.)
-.SH I installed something globally, but I can't \fBrequire()\fP it
-.P
-Install it locally\.
-.P
-The global install location is a place for command\-line utilities
-to put their bins in the system \fBPATH\fP\|\. It's not for use with \fBrequire()\fP\|\.
-.P
-If you \fBrequire()\fP a module in your code, then that means it's a
-dependency, and a part of your program\. You need to install it locally
-in your program\.
-.SH Why can't npm just put everything in one place, like other package managers?
-.P
-Not every change is an improvement, but every improvement is a change\.
-This would be like asking git to do network IO for every commit\. It's
-not going to happen, because it's a terrible idea that causes more
-problems than it solves\.
-.P
-It is much harder to avoid dependency conflicts without nesting
-dependencies\. This is fundamental to the way that npm works, and has
-proven to be an extremely successful approach\. See npm help 5 \fBnpm\-folders\fP for
-more details\.
-.P
-If you want a package to be installed in one place, and have all your
-programs reference the same copy of it, then use the \fBnpm link\fP command\.
-That's what it's for\. Install it globally, then link it into each
-program that uses it\.
-.SH Whatever, I really want the old style 'everything global' style\.
-.P
-Write your own package manager\. You could probably even wrap up \fBnpm\fP
-in a shell script if you really wanted to\.
-.P
-npm will not help you do something that is known to be a bad idea\.
-.SH Should I check my \fBnode_modules\fP folder into git?
-.P
-Usually, no\. Allow npm to resolve dependencies for your packages\.
-.P
-For packages you \fBdeploy\fR, such as websites and apps,
-you should use npm shrinkwrap to lock down your full dependency tree:
-.P
-https://docs\.npmjs\.com/cli/shrinkwrap
-.P
-If you are paranoid about depending on the npm ecosystem,
-you should run a private npm mirror or a private cache\.
-.P
-If you want 100% confidence in being able to reproduce the specific bytes
-included in a deployment, you should use an additional mechanism that can
-verify contents rather than versions\. For example,
-Amazon machine images, DigitalOcean snapshots, Heroku slugs, or simple tarballs\.
-.SH Is it 'npm' or 'NPM' or 'Npm'?
-.P
-npm should never be capitalized unless it is being displayed in a
-location that is customarily all\-caps (such as the title of man pages\.)
-.SH If 'npm' is an acronym, why is it never capitalized?
-.P
-Contrary to the belief of many, "npm" is not in fact an abbreviation for
-"Node Package Manager"\. It is a recursive bacronymic abbreviation for
-"npm is not an acronym"\. (If it was "ninaa", then it would be an
-acronym, and thus incorrectly named\.)
-.P
-"NPM", however, \fIis\fR an acronym (more precisely, a capitonym) for the
-National Association of Pastoral Musicians\. You can learn more
-about them at http://npm\.org/\|\.
-.P
-In software, "NPM" is a Non\-Parametric Mapping utility written by
-Chris Rorden\. You can analyze pictures of brains with it\. Learn more
-about the (capitalized) NPM program at http://www\.cabiatl\.com/mricro/npm/\|\.
-.P
-The first seed that eventually grew into this flower was a bash utility
-named "pm", which was a shortened descendent of "pkgmakeinst", a
-bash function that was used to install various different things on different
-platforms, most often using Yahoo's \fByinst\fP\|\. If \fBnpm\fP was ever an
-acronym for anything, it was \fBnode pm\fP or maybe \fBnew pm\fP\|\.
-.P
-So, in all seriousness, the "npm" project is named after its command\-line
-utility, which was organically selected to be easily typed by a right\-handed
-programmer using a US QWERTY keyboard layout, ending with the
-right\-ring\-finger in a postition to type the \fB\-\fP key for flags and
-other command\-line arguments\. That command\-line utility is always
-lower\-case, though it starts most sentences it is a part of\.
-.SH How do I list installed packages?
-.P
-\fBnpm ls\fP
-.SH How do I search for packages?
-.P
-\fBnpm search\fP
-.P
-Arguments are greps\. \fBnpm search jsdom\fP shows jsdom packages\.
-.SH How do I update npm?
-.P
-.RS 2
-.nf
-npm install npm \-g
-.fi
-.RE
-.P
-You can also update all outdated local packages by doing \fBnpm update\fP without
-any arguments, or global packages by doing \fBnpm update \-g\fP\|\.
-.P
-Occasionally, the version of npm will progress such that the current
-version cannot be properly installed with the version that you have
-installed already\. (Consider, if there is ever a bug in the \fBupdate\fP
-command\.)
-.P
-In those cases, you can do this:
-.P
-.RS 2
-.nf
-curl https://www\.npmjs\.com/install\.sh | sh
-.fi
-.RE
-.SH What is a \fBpackage\fP?
-.P
-A package is:
-.RS 0
-.IP \(bu 2
-a) a folder containing a program described by a package\.json file
-.IP \(bu 2
-b) a gzipped tarball containing (a)
-.IP \(bu 2
-c) a url that resolves to (b)
-.IP \(bu 2
-d) a \fB@\fP that is published on the registry with (c)
-.IP \(bu 2
-e) a \fB@\fP that points to (d)
-.IP \(bu 2
-f) a \fB\fP that has a "latest" tag satisfying (e)
-.IP \(bu 2
-g) a \fBgit\fP url that, when cloned, results in (a)\.
-
-.RE
-.P
-Even if you never publish your package, you can still get a lot of
-benefits of using npm if you just want to write a node program (a), and
-perhaps if you also want to be able to easily install it elsewhere
-after packing it up into a tarball (b)\.
-.P
-Git urls can be of the form:
-.P
-.RS 2
-.nf
-git://github\.com/user/project\.git#commit\-ish
-git+ssh://user@hostname:project\.git#commit\-ish
-git+http://user@hostname/project/blah\.git#commit\-ish
-git+https://user@hostname/project/blah\.git#commit\-ish
-.fi
-.RE
-.P
-The \fBcommit\-ish\fP can be any tag, sha, or branch which can be supplied as
-an argument to \fBgit checkout\fP\|\. The default is \fBmaster\fP\|\.
-.SH What is a \fBmodule\fP?
-.P
-A module is anything that can be loaded with \fBrequire()\fP in a Node\.js
-program\. The following things are all examples of things that can be
-loaded as modules:
-.RS 0
-.IP \(bu 2
-A folder with a \fBpackage\.json\fP file containing a \fBmain\fP field\.
-.IP \(bu 2
-A folder with an \fBindex\.js\fP file in it\.
-.IP \(bu 2
-A JavaScript file\.
-
-.RE
-.P
-Most npm packages are modules, because they are libraries that you
-load with \fBrequire\fP\|\. However, there's no requirement that an npm
-package be a module! Some only contain an executable command\-line
-interface, and don't provide a \fBmain\fP field for use in Node programs\.
-.P
-Almost all npm packages (at least, those that are Node programs)
-\fIcontain\fR many modules within them (because every file they load with
-\fBrequire()\fP is a module)\.
-.P
-In the context of a Node program, the \fBmodule\fP is also the thing that
-was loaded \fIfrom\fR a file\. For example, in the following program:
-.P
-.RS 2
-.nf
-var req = require('request')
-.fi
-.RE
-.P
-we might say that "The variable \fBreq\fP refers to the \fBrequest\fP module"\.
-.SH So, why is it the "\fBnode_modules\fP" folder, but "\fBpackage\.json\fP" file? Why not \fBnode_packages\fP or \fBmodule\.json\fP?
-.P
-The \fBpackage\.json\fP file defines the package\. (See "What is a
-package?" above\.)
-.P
-The \fBnode_modules\fP folder is the place Node\.js looks for modules\.
-(See "What is a module?" above\.)
-.P
-For example, if you create a file at \fBnode_modules/foo\.js\fP and then
-had a program that did \fBvar f = require('foo\.js')\fP then it would load
-the module\. However, \fBfoo\.js\fP is not a "package" in this case,
-because it does not have a package\.json\.
-.P
-Alternatively, if you create a package which does not have an
-\fBindex\.js\fP or a \fB"main"\fP field in the \fBpackage\.json\fP file, then it is
-not a module\. Even if it's installed in \fBnode_modules\fP, it can't be
-an argument to \fBrequire()\fP\|\.
-.SH \fB"node_modules"\fP is the name of my deity's arch\-rival, and a Forbidden Word in my religion\. Can I configure npm to use a different folder?
-.P
-No\. This will never happen\. This question comes up sometimes,
-because it seems silly from the outside that npm couldn't just be
-configured to put stuff somewhere else, and then npm could load them
-from there\. It's an arbitrary spelling choice, right? What's the big
-deal?
-.P
-At the time of this writing, the string \fB\|'node_modules'\fP appears 151
-times in 53 separate files in npm and node core (excluding tests and
-documentation)\.
-.P
-Some of these references are in node's built\-in module loader\. Since
-npm is not involved \fBat all\fR at run\-time, node itself would have to
-be configured to know where you've decided to stick stuff\. Complexity
-hurdle #1\. Since the Node module system is locked, this cannot be
-changed, and is enough to kill this request\. But I'll continue, in
-deference to your deity's delicate feelings regarding spelling\.
-.P
-Many of the others are in dependencies that npm uses, which are not
-necessarily tightly coupled to npm (in the sense that they do not read
-npm's configuration files, etc\.) Each of these would have to be
-configured to take the name of the \fBnode_modules\fP folder as a
-parameter\. Complexity hurdle #2\.
-.P
-Furthermore, npm has the ability to "bundle" dependencies by adding
-the dep names to the \fB"bundledDependencies"\fP list in package\.json,
-which causes the folder to be included in the package tarball\. What
-if the author of a module bundles its dependencies, and they use a
-different spelling for \fBnode_modules\fP? npm would have to rename the
-folder at publish time, and then be smart enough to unpack it using
-your locally configured name\. Complexity hurdle #3\.
-.P
-Furthermore, what happens when you \fIchange\fR this name? Fine, it's
-easy enough the first time, just rename the \fBnode_modules\fP folders to
-\fB\|\./blergyblerp/\fP or whatever name you choose\. But what about when you
-change it again? npm doesn't currently track any state about past
-configuration settings, so this would be rather difficult to do
-properly\. It would have to track every previous value for this
-config, and always accept any of them, or else yesterday's install may
-be broken tomorrow\. Complexity hurdle #4\.
-.P
-Never going to happen\. The folder is named \fBnode_modules\fP\|\. It is
-written indelibly in the Node Way, handed down from the ancient times
-of Node 0\.3\.
-.SH How do I install node with npm?
-.P
-You don't\. Try one of these node version managers:
-.P
-Unix:
-.RS 0
-.IP \(bu 2
-http://github\.com/isaacs/nave
-.IP \(bu 2
-http://github\.com/visionmedia/n
-.IP \(bu 2
-http://github\.com/creationix/nvm
-
-.RE
-.P
-Windows:
-.RS 0
-.IP \(bu 2
-http://github\.com/marcelklehr/nodist
-.IP \(bu 2
-https://github\.com/coreybutler/nvm\-windows
-.IP \(bu 2
-https://github\.com/hakobera/nvmw
-.IP \(bu 2
-https://github\.com/nanjingboy/nvmw
-
-.RE
-.SH How can I use npm for development?
-.P
-See npm help 7 \fBnpm\-developers\fP and npm help 5 \fBpackage\.json\fP\|\.
-.P
-You'll most likely want to \fBnpm link\fP your development folder\. That's
-awesomely handy\.
-.P
-To set up your own private registry, check out npm help 7 \fBnpm\-registry\fP\|\.
-.SH Can I list a url as a dependency?
-.P
-Yes\. It should be a url to a gzipped tarball containing a single folder
-that has a package\.json in its root, or a git url\.
-(See "what is a package?" above\.)
-.SH How do I symlink to a dev folder so I don't have to keep re\-installing?
-.P
-See npm help \fBnpm\-link\fP
-.SH The package registry website\. What is that exactly?
-.P
-See npm help 7 \fBnpm\-registry\fP\|\.
-.SH I forgot my password, and can't publish\. How do I reset it?
-.P
-Go to https://npmjs\.com/forgot\|\.
-.SH I get ECONNREFUSED a lot\. What's up?
-.P
-Either the registry is down, or node's DNS isn't able to reach out\.
-.P
-To check if the registry is down, open up
-https://registry\.npmjs\.org/ in a web browser\. This will also tell
-you if you are just unable to access the internet for some reason\.
-.P
-If the registry IS down, let us know by emailing support@npmjs\.com
-or posting an issue at https://github\.com/npm/npm/issues\|\. If it's
-down for the world (and not just on your local network) then we're
-probably already being pinged about it\.
-.P
-You can also often get a faster response by visiting the #npm channel
-on Freenode IRC\.
-.SH Why no namespaces?
-.P
-npm has only one global namespace\. If you want to namespace your own packages,
-you may: simply use the \fB\-\fP character to separate the names or use scoped
-packages\. npm is a mostly anarchic system\. There is not sufficient need to
-impose namespace rules on everyone\.
-.P
-As of 2\.0, npm supports scoped packages, which allow you to publish a group of
-related modules without worrying about name collisions\.
-.P
-Every npm user owns the scope associated with their username\. For example, the
-user named \fBnpm\fP owns the scope \fB@npm\fP\|\. Scoped packages are published inside a
-scope by naming them as if they were files under the scope directory, e\.g\., by
-setting \fBname\fP in \fBpackage\.json\fP to \fB@npm/npm\fP\|\.
-.P
-Scoped packages are supported by the public npm registry\. The npm client is
-backwards\-compatible with un\-scoped registries, so it can be used to work with
-scoped and un\-scoped registries at the same time\.
-.P
-Unscoped packages can only depend on other unscoped packages\. Scoped packages
-can depend on packages from their own scope, a different scope, or the public
-registry (unscoped)\.
-.P
-For the current documentation of scoped packages, see
-https://docs\.npmjs\.com/misc/scope
-.P
-References:
-.RS 0
-.IP 1. 3
-For the reasoning behind the "one global namespace", please see this
-discussion: https://github\.com/npm/npm/issues/798 (TL;DR: It doesn't
-actually make things better, and can make them worse\.)
-.IP 2. 3
-For the pre\-implementation discussion of the scoped package feature, see
-this discussion: https://github\.com/npm/npm/issues/5239
-
-.RE
-.SH Who does npm?
-.P
-npm was originally written by Isaac Z\. Schlueter, and many others have
-contributed to it, some of them quite substantially\.
-.P
-The npm open source project, The npm Registry, and the community
-website \fIhttps://www\.npmjs\.com\fR are maintained and operated by the
-good folks at npm, Inc\. \fIhttp://www\.npmjs\.com\fR
-.SH I have a question or request not addressed here\. Where should I put it?
-.P
-Post an issue on the github project:
-.RS 0
-.IP \(bu 2
-https://github\.com/npm/npm/issues
-
-.RE
-.SH Why does npm hate me?
-.P
-npm is not capable of hatred\. It loves everyone, especially you\.
-.SH SEE ALSO
-.RS 0
-.IP \(bu 2
-npm help npm
-.IP \(bu 2
-npm help 7 developers
-.IP \(bu 2
-npm help 5 package\.json
-.IP \(bu 2
-npm help config
-.IP \(bu 2
-npm help 7 config
-.IP \(bu 2
-npm help 5 npmrc
-.IP \(bu 2
-npm help 7 config
-.IP \(bu 2
-npm help 5 folders
-
-.RE
-
diff --git a/deps/npm/man/man7/npm-index.7 b/deps/npm/man/man7/npm-index.7
index 21e5539578ea4e..66f6d2cf01f297 100644
--- a/deps/npm/man/man7/npm-index.7
+++ b/deps/npm/man/man7/npm-index.7
@@ -1,4 +1,4 @@
-.TH "NPM\-INDEX" "7" "November 2015" "" ""
+.TH "NPM\-INDEX" "7" "February 2016" "" ""
.SH "NAME"
\fBnpm-index\fR \- Index of all npm documentation
.SS npm help README
@@ -310,9 +310,6 @@ Developer Guide
.SS npm help 7 disputes
.P
Handling Module Name Disputes
-.SS npm help 7 faq
-.P
-Frequently Asked Questions
.SS npm help 7 index
.P
Index of all npm documentation
diff --git a/deps/npm/man/man7/npm-orgs.7 b/deps/npm/man/man7/npm-orgs.7
index 503a6f35b00753..929c2c7d603f6a 100644
--- a/deps/npm/man/man7/npm-orgs.7
+++ b/deps/npm/man/man7/npm-orgs.7
@@ -1,4 +1,4 @@
-.TH "NPM\-ORGS" "7" "November 2015" "" ""
+.TH "NPM\-ORGS" "7" "February 2016" "" ""
.SH "NAME"
\fBnpm-orgs\fR \- Working with Teams & Orgs
.SH DESCRIPTION
diff --git a/deps/npm/man/man7/npm-registry.7 b/deps/npm/man/man7/npm-registry.7
index 3013d956234c77..1d4e1041031213 100644
--- a/deps/npm/man/man7/npm-registry.7
+++ b/deps/npm/man/man7/npm-registry.7
@@ -1,4 +1,4 @@
-.TH "NPM\-REGISTRY" "7" "November 2015" "" ""
+.TH "NPM\-REGISTRY" "7" "February 2016" "" ""
.SH "NAME"
\fBnpm-registry\fR \- The JavaScript Package Registry
.SH DESCRIPTION
@@ -11,10 +11,10 @@ Additionally, npm's package registry implementation supports several
write APIs as well, to allow for publishing packages and managing user
account information\.
.P
-The official public npm registry is at http://registry\.npmjs\.org/\|\. It
+The official public npm registry is at https://registry\.npmjs\.org/\|\. It
is powered by a CouchDB database, of which there is a public mirror at
-http://skimdb\.npmjs\.com/registry\|\. The code for the couchapp is
-available at http://github\.com/npm/npm\-registry\-couchapp\|\.
+https://skimdb\.npmjs\.com/registry\|\. The code for the couchapp is
+available at https://github\.com/npm/npm\-registry\-couchapp\|\.
.P
The registry URL used is determined by the scope of the package (see
npm help 7 \fBnpm\-scope\fP)\. If no scope is specified, the default registry is used, which is
diff --git a/deps/npm/man/man7/npm-scope.7 b/deps/npm/man/man7/npm-scope.7
index deadca7ba3a212..f8c39625927a56 100644
--- a/deps/npm/man/man7/npm-scope.7
+++ b/deps/npm/man/man7/npm-scope.7
@@ -1,4 +1,4 @@
-.TH "NPM\-SCOPE" "7" "November 2015" "" ""
+.TH "NPM\-SCOPE" "7" "February 2016" "" ""
.SH "NAME"
\fBnpm-scope\fR \- Scoped packages
.SH DESCRIPTION
diff --git a/deps/npm/man/man7/npm-scripts.7 b/deps/npm/man/man7/npm-scripts.7
index c4a1c3b5d80ec3..1d1b50f673b9eb 100644
--- a/deps/npm/man/man7/npm-scripts.7
+++ b/deps/npm/man/man7/npm-scripts.7
@@ -1,4 +1,4 @@
-.TH "NPM\-SCRIPTS" "7" "November 2015" "" ""
+.TH "NPM\-SCRIPTS" "7" "February 2016" "" ""
.SH "NAME"
\fBnpm-scripts\fR \- How npm handles the "scripts" field
.SH DESCRIPTION
@@ -195,10 +195,10 @@ For example, if your package\.json contains this:
.fi
.RE
.P
-then the \fBscripts/install\.js\fP will be called for the install,
-post\-install, stages of the lifecycle, and the \fBscripts/uninstall\.js\fP
-would be called when the package is uninstalled\. Since
-\fBscripts/install\.js\fP is running for three different phases, it would
+then \fBscripts/install\.js\fP will be called for the install
+and post\-install stages of the lifecycle, and \fBscripts/uninstall\.js\fP
+will be called when the package is uninstalled\. Since
+\fBscripts/install\.js\fP is running for two different phases, it would
be wise in this case to look at the \fBnpm_lifecycle_event\fP environment
variable\.
.P
diff --git a/deps/npm/man/man7/removing-npm.7 b/deps/npm/man/man7/removing-npm.7
index e26cab123819cd..0df2bf141ac8b8 100644
--- a/deps/npm/man/man7/removing-npm.7
+++ b/deps/npm/man/man7/removing-npm.7
@@ -1,4 +1,4 @@
-.TH "NPM\-REMOVAL" "1" "November 2015" "" ""
+.TH "NPM\-REMOVAL" "1" "February 2016" "" ""
.SH "NAME"
\fBnpm-removal\fR \- Cleaning the Slate
.SH SYNOPSIS
@@ -70,7 +70,7 @@ find /usr/local/{lib/node,bin} \-exec grep \-l npm \\{\\} \\; ;
.IP \(bu 2
README
.IP \(bu 2
-npm help rm
+npm help uninstall
.IP \(bu 2
npm help prune
diff --git a/deps/npm/man/man7/semver.7 b/deps/npm/man/man7/semver.7
index be2e6f0779c60e..1f877f0b7b7fb9 100644
--- a/deps/npm/man/man7/semver.7
+++ b/deps/npm/man/man7/semver.7
@@ -1,4 +1,4 @@
-.TH "SEMVER" "7" "November 2015" "" ""
+.TH "SEMVER" "7" "February 2016" "" ""
.SH "NAME"
\fBsemver\fR \- The semantic versioner for npm
.SH Usage
@@ -119,7 +119,7 @@ will append the value of the string as a prerelease identifier:
.P
.RS 2
.nf
-> semver\.inc('1\.2\.3', 'pre', 'beta')
+> semver\.inc('1\.2\.3', 'prerelease', 'beta')
\|'1\.2\.4\-beta\.0'
.fi
.RE
@@ -283,6 +283,31 @@ zero\.
.IP \(bu 2
\fB^0\.x\fP := \fB>=0\.0\.0 <1\.0\.0\fP
+.RE
+.SS Range Grammar
+.P
+Putting all this together, here is a Backus\-Naur grammar for ranges,
+for the benefit of parser authors:
+.P
+.RS 2
+.nf
+range\-set ::= range ( logical\-or range ) *
+logical\-or ::= ( ' ' ) * '||' ( ' ' ) *
+range ::= hyphen | simple ( ' ' simple ) * | ''
+hyphen ::= partial ' \- ' partial
+simple ::= primitive | partial | tilde | caret
+primitive ::= ( '<' | '>' | '>=' | '<=' | '=' | ) partial
+partial ::= xr ( '\.' xr ( '\.' xr qualifier ? )? )?
+xr ::= 'x' | 'X' | '*' | nr
+nr ::= '0' | ['1'\-'9']['0'\-'9']+
+tilde ::= '~' partial
+caret ::= '^' partial
+qualifier ::= ( '\-' pre )? ( '+' build )?
+pre ::= parts
+build ::= parts
+parts ::= part ( '\.' part ) *
+part ::= nr | [\-0\-9A\-Za\-z]+
+.fi
.RE
.SH Functions
.P
diff --git a/deps/npm/node_modules/ansi/History.md b/deps/npm/node_modules/ansi/History.md
index f4a9fe30434aea..aea8aaf0991e70 100644
--- a/deps/npm/node_modules/ansi/History.md
+++ b/deps/npm/node_modules/ansi/History.md
@@ -1,4 +1,11 @@
+0.3.1 / 2016-01-14
+==================
+
+ * add MIT LICENSE file (#23, @kasicka)
+ * preserve chaining after redundant style-method calls (#19, @drewblaisdell)
+ * package: add "license" field (#16, @BenjaminTsai)
+
0.3.0 / 2014-05-09
==================
diff --git a/deps/npm/node_modules/ansi/LICENSE b/deps/npm/node_modules/ansi/LICENSE
new file mode 100644
index 00000000000000..2ea4dc5efb8729
--- /dev/null
+++ b/deps/npm/node_modules/ansi/LICENSE
@@ -0,0 +1,24 @@
+(The MIT License)
+
+Copyright (c) 2012 Nathan Rajlich
+
+Permission is hereby granted, free of charge, to any person
+obtaining a copy of this software and associated documentation
+files (the "Software"), to deal in the Software without
+restriction, including without limitation the rights to use,
+copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the
+Software is furnished to do so, subject to the following
+conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+WHETHER IN AN ACTION 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/deps/npm/node_modules/ansi/lib/ansi.js b/deps/npm/node_modules/ansi/lib/ansi.js
index 52fc8ec8bea14b..b1714e328995c1 100644
--- a/deps/npm/node_modules/ansi/lib/ansi.js
+++ b/deps/npm/node_modules/ansi/lib/ansi.js
@@ -238,14 +238,14 @@ Object.keys(styles).forEach(function (style) {
, r = reset[style]
Cursor.prototype[style] = function () {
- if (this[name]) return
+ if (this[name]) return this
this.enabled && this.write(prefix + c + suffix)
this[name] = true
return this
}
Cursor.prototype['reset' + name] = function () {
- if (!this[name]) return
+ if (!this[name]) return this
this.enabled && this.write(prefix + r + suffix)
this[name] = false
return this
diff --git a/deps/npm/node_modules/ansi/package.json b/deps/npm/node_modules/ansi/package.json
index 706ae63067694d..f65863bd6585fd 100644
--- a/deps/npm/node_modules/ansi/package.json
+++ b/deps/npm/node_modules/ansi/package.json
@@ -1,6 +1,7 @@
{
"name": "ansi",
"description": "Advanced ANSI formatting tool for Node.js",
+ "license": "MIT",
"keywords": [
"ansi",
"formatting",
@@ -11,7 +12,7 @@
"256",
"stream"
],
- "version": "0.3.0",
+ "version": "0.3.1",
"author": {
"name": "Nathan Rajlich",
"email": "nathan@tootallnate.net",
@@ -22,14 +23,17 @@
"url": "git://github.com/TooTallNate/ansi.js.git"
},
"main": "./lib/ansi.js",
+ "gitHead": "4d0d4af94e0bdaa648bd7262acd3bde4b98d5246",
"bugs": {
"url": "https://github.com/TooTallNate/ansi.js/issues"
},
- "homepage": "https://github.com/TooTallNate/ansi.js",
- "_id": "ansi@0.3.0",
- "_shasum": "74b2f1f187c8553c7f95015bcb76009fb43d38e0",
+ "homepage": "https://github.com/TooTallNate/ansi.js#readme",
+ "_id": "ansi@0.3.1",
+ "scripts": {},
+ "_shasum": "0c42d4fb17160d5a9af1e484bace1c66922c1b21",
"_from": "ansi@latest",
- "_npmVersion": "1.4.9",
+ "_npmVersion": "3.3.12",
+ "_nodeVersion": "5.3.0",
"_npmUser": {
"name": "tootallnate",
"email": "nathan@tootallnate.net"
@@ -45,10 +49,10 @@
}
],
"dist": {
- "shasum": "74b2f1f187c8553c7f95015bcb76009fb43d38e0",
- "tarball": "http://registry.npmjs.org/ansi/-/ansi-0.3.0.tgz"
+ "shasum": "0c42d4fb17160d5a9af1e484bace1c66922c1b21",
+ "tarball": "http://registry.npmjs.org/ansi/-/ansi-0.3.1.tgz"
},
"directories": {},
- "_resolved": "https://registry.npmjs.org/ansi/-/ansi-0.3.0.tgz",
+ "_resolved": "https://registry.npmjs.org/ansi/-/ansi-0.3.1.tgz",
"readme": "ERROR: No README data found!"
}
diff --git a/deps/npm/node_modules/columnify/columnify.js b/deps/npm/node_modules/columnify/columnify.js
index 42b2089a3485c0..334d5509ae222e 100644
--- a/deps/npm/node_modules/columnify/columnify.js
+++ b/deps/npm/node_modules/columnify/columnify.js
@@ -145,6 +145,8 @@ module.exports = function (items) {
column.width = items.map(function (item) {
return item[columnName];
}).reduce(function (min, cur) {
+ // if already at maxWidth don't bother testing
+ if (min >= column.maxWidth) return min;
return Math.max(min, Math.min(column.maxWidth, Math.max(column.minWidth, wcwidth(cur))));
}, 0);
});
@@ -181,9 +183,11 @@ module.exports = function (items) {
var column = columns[columnName];
column.width = items.map(function (item) {
return item[columnName].reduce(function (min, cur) {
+ if (min >= column.maxWidth) return min;
return Math.max(min, Math.min(column.maxWidth, Math.max(column.minWidth, wcwidth(cur))));
}, 0);
}).reduce(function (min, cur) {
+ if (min >= column.maxWidth) return min;
return Math.max(min, Math.min(column.maxWidth, Math.max(column.minWidth, cur)));
}, 0);
});
@@ -217,7 +221,7 @@ function createRows(items, columns, columnNames, paddingChr) {
});
// combine matching lines of each rows
- var _loop = function (i) {
+ var _loop = function _loop(i) {
row[i] = row[i] || [];
columnNames.forEach(function (columnName) {
var column = columns[columnName];
@@ -240,12 +244,15 @@ function createRows(items, columns, columnNames, paddingChr) {
*/
function mixin() {
- if (Object.assign) return Object.assign.apply(Object, arguments);
+ var _Object;
+
+ if (Object.assign) return (_Object = Object).assign.apply(_Object, arguments);
return ObjectAssign.apply(undefined, arguments);
}
function ObjectAssign(target, firstSource) {
"use strict";
+
if (target === undefined || target === null) throw new TypeError("Cannot convert first argument to object");
var to = Object(target);
diff --git a/deps/npm/node_modules/columnify/index.js b/deps/npm/node_modules/columnify/index.js
index 227b41efc609c1..221269b3e76b72 100644
--- a/deps/npm/node_modules/columnify/index.js
+++ b/deps/npm/node_modules/columnify/index.js
@@ -135,6 +135,8 @@ module.exports = function(items, options = {}) {
column.width = items
.map(item => item[columnName])
.reduce((min, cur) => {
+ // if already at maxWidth don't bother testing
+ if (min >= column.maxWidth) return min
return Math.max(min, Math.min(column.maxWidth, Math.max(column.minWidth, wcwidth(cur))))
}, 0)
})
@@ -171,9 +173,11 @@ module.exports = function(items, options = {}) {
let column = columns[columnName]
column.width = items.map(item => {
return item[columnName].reduce((min, cur) => {
+ if (min >= column.maxWidth) return min
return Math.max(min, Math.min(column.maxWidth, Math.max(column.minWidth, wcwidth(cur))))
}, 0)
}).reduce((min, cur) => {
+ if (min >= column.maxWidth) return min
return Math.max(min, Math.min(column.maxWidth, Math.max(column.minWidth, cur)))
}, 0)
})
diff --git a/deps/npm/node_modules/columnify/node_modules/wcwidth/node_modules/defaults/node_modules/clone/.travis.yml b/deps/npm/node_modules/columnify/node_modules/wcwidth/node_modules/defaults/node_modules/clone/.travis.yml
index 58f23716aefb94..20fd86b6a5bee3 100644
--- a/deps/npm/node_modules/columnify/node_modules/wcwidth/node_modules/defaults/node_modules/clone/.travis.yml
+++ b/deps/npm/node_modules/columnify/node_modules/wcwidth/node_modules/defaults/node_modules/clone/.travis.yml
@@ -1,5 +1,3 @@
language: node_js
node_js:
- - 0.6
- - 0.8
- 0.10
diff --git a/deps/npm/node_modules/columnify/node_modules/wcwidth/node_modules/defaults/node_modules/clone/LICENSE b/deps/npm/node_modules/columnify/node_modules/wcwidth/node_modules/defaults/node_modules/clone/LICENSE
index fc808cce89d4a4..cc3c87bc3bfd85 100644
--- a/deps/npm/node_modules/columnify/node_modules/wcwidth/node_modules/defaults/node_modules/clone/LICENSE
+++ b/deps/npm/node_modules/columnify/node_modules/wcwidth/node_modules/defaults/node_modules/clone/LICENSE
@@ -1,4 +1,4 @@
-Copyright © 2011-2014 Paul Vorbach
+Copyright © 2011-2015 Paul Vorbach
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the “Software”), to deal in
diff --git a/deps/npm/node_modules/columnify/node_modules/wcwidth/node_modules/defaults/node_modules/clone/README.md b/deps/npm/node_modules/columnify/node_modules/wcwidth/node_modules/defaults/node_modules/clone/README.md
index d7231cfca7daa7..0b6cecae29b52d 100644
--- a/deps/npm/node_modules/columnify/node_modules/wcwidth/node_modules/defaults/node_modules/clone/README.md
+++ b/deps/npm/node_modules/columnify/node_modules/wcwidth/node_modules/defaults/node_modules/clone/README.md
@@ -2,16 +2,16 @@
[![build status](https://secure.travis-ci.org/pvorb/node-clone.png)](http://travis-ci.org/pvorb/node-clone)
-offers foolproof _deep cloning_ of variables in JavaScript.
+[![info badge](https://nodei.co/npm/clone.png?downloads=true&downloadRank=true&stars=true)](http://npm-stat.com/charts.html?package=clone)
+
+offers foolproof _deep cloning_ of objects, arrays, numbers, strings etc. in JavaScript.
## Installation
npm install clone
-or
-
- ender build clone
+(It also works with browserify, ender or standalone.)
## Example
@@ -105,7 +105,7 @@ github](https://github.com/pvorb/node-clone/issues) or send me an email to
## License
-Copyright © 2011-2014 [Paul Vorbach](http://paul.vorba.ch/) and
+Copyright © 2011-2015 [Paul Vorbach](http://paul.vorba.ch/) and
[contributors](https://github.com/pvorb/node-clone/graphs/contributors).
Permission is hereby granted, free of charge, to any person obtaining a copy of
diff --git a/deps/npm/node_modules/columnify/node_modules/wcwidth/node_modules/defaults/node_modules/clone/clone.js b/deps/npm/node_modules/columnify/node_modules/wcwidth/node_modules/defaults/node_modules/clone/clone.js
index f8fa3159a7c4ee..6263759203bd5d 100644
--- a/deps/npm/node_modules/columnify/node_modules/wcwidth/node_modules/defaults/node_modules/clone/clone.js
+++ b/deps/npm/node_modules/columnify/node_modules/wcwidth/node_modules/defaults/node_modules/clone/clone.js
@@ -1,34 +1,6 @@
+var clone = (function() {
'use strict';
-function objectToString(o) {
- return Object.prototype.toString.call(o);
-}
-
-// shim for Node's 'util' package
-// DO NOT REMOVE THIS! It is required for compatibility with EnderJS (http://enderjs.com/).
-var util = {
- isArray: function (ar) {
- return Array.isArray(ar) || (typeof ar === 'object' && objectToString(ar) === '[object Array]');
- },
- isDate: function (d) {
- return typeof d === 'object' && objectToString(d) === '[object Date]';
- },
- isRegExp: function (re) {
- return typeof re === 'object' && objectToString(re) === '[object RegExp]';
- },
- getRegExpFlags: function (re) {
- var flags = '';
- re.global && (flags += 'g');
- re.ignoreCase && (flags += 'i');
- re.multiline && (flags += 'm');
- return flags;
- }
-};
-
-
-if (typeof module === 'object')
- module.exports = clone;
-
/**
* Clones (copies) an Object using deep copying.
*
@@ -47,8 +19,14 @@ if (typeof module === 'object')
* @param `prototype` - sets the prototype to be used when cloning an object.
* (optional - defaults to parent prototype).
*/
-
function clone(parent, circular, depth, prototype) {
+ var filter;
+ if (typeof circular === 'object') {
+ depth = circular.depth;
+ prototype = circular.prototype;
+ filter = circular.filter;
+ circular = circular.circular
+ }
// maintain two arrays for circular references, where corresponding parents
// and children have the same index
var allParents = [];
@@ -77,12 +55,12 @@ function clone(parent, circular, depth, prototype) {
return parent;
}
- if (util.isArray(parent)) {
+ if (clone.__isArray(parent)) {
child = [];
- } else if (util.isRegExp(parent)) {
- child = new RegExp(parent.source, util.getRegExpFlags(parent));
+ } else if (clone.__isRegExp(parent)) {
+ child = new RegExp(parent.source, __getRegExpFlags(parent));
if (parent.lastIndex) child.lastIndex = parent.lastIndex;
- } else if (util.isDate(parent)) {
+ } else if (clone.__isDate(parent)) {
child = new Date(parent.getTime());
} else if (useBuffer && Buffer.isBuffer(parent)) {
child = new Buffer(parent.length);
@@ -114,7 +92,7 @@ function clone(parent, circular, depth, prototype) {
if (proto) {
attrs = Object.getOwnPropertyDescriptor(proto, i);
}
-
+
if (attrs && attrs.set == null) {
continue;
}
@@ -134,7 +112,7 @@ function clone(parent, circular, depth, prototype) {
* USE WITH CAUTION! This may not behave as you wish if you do not know how this
* works.
*/
-clone.clonePrototype = function(parent) {
+clone.clonePrototype = function clonePrototype(parent) {
if (parent === null)
return null;
@@ -142,3 +120,41 @@ clone.clonePrototype = function(parent) {
c.prototype = parent;
return new c();
};
+
+// private utility functions
+
+function __objToStr(o) {
+ return Object.prototype.toString.call(o);
+};
+clone.__objToStr = __objToStr;
+
+function __isDate(o) {
+ return typeof o === 'object' && __objToStr(o) === '[object Date]';
+};
+clone.__isDate = __isDate;
+
+function __isArray(o) {
+ return typeof o === 'object' && __objToStr(o) === '[object Array]';
+};
+clone.__isArray = __isArray;
+
+function __isRegExp(o) {
+ return typeof o === 'object' && __objToStr(o) === '[object RegExp]';
+};
+clone.__isRegExp = __isRegExp;
+
+function __getRegExpFlags(re) {
+ var flags = '';
+ if (re.global) flags += 'g';
+ if (re.ignoreCase) flags += 'i';
+ if (re.multiline) flags += 'm';
+ return flags;
+};
+clone.__getRegExpFlags = __getRegExpFlags;
+
+return clone;
+})();
+
+if (typeof module === 'object' && module.exports) {
+ module.exports = clone;
+}
diff --git a/deps/npm/node_modules/columnify/node_modules/wcwidth/node_modules/defaults/node_modules/clone/package.json b/deps/npm/node_modules/columnify/node_modules/wcwidth/node_modules/defaults/node_modules/clone/package.json
index bc8e878a54c34b..84d16fb51829a7 100644
--- a/deps/npm/node_modules/columnify/node_modules/wcwidth/node_modules/defaults/node_modules/clone/package.json
+++ b/deps/npm/node_modules/columnify/node_modules/wcwidth/node_modules/defaults/node_modules/clone/package.json
@@ -8,7 +8,7 @@
"function",
"date"
],
- "version": "0.1.19",
+ "version": "1.0.2",
"repository": {
"type": "git",
"url": "git://github.com/pvorb/node-clone.git"
@@ -86,26 +86,33 @@
"name": "Róbert Oroszi",
"email": "robert+gh@oroszi.net",
"url": "https://github.com/oroce"
+ },
+ {
+ "name": "Aurélio A. Heckert",
+ "url": "http://softwarelivre.org/aurium"
+ },
+ {
+ "name": "Guy Ellis",
+ "url": "http://www.guyellisrocks.com/"
}
],
"license": "MIT",
"engines": {
- "node": "*"
+ "node": ">=0.8"
},
"dependencies": {},
"devDependencies": {
- "underscore": "*",
- "nodeunit": "*"
+ "nodeunit": "~0.9.0"
},
"optionalDependencies": {},
"scripts": {
"test": "nodeunit test.js"
},
- "gitHead": "bb11a43363a0f69e8ac014cb5376ce215ea1f8fd",
+ "gitHead": "0e8216efc672496b612fd7ab62159117d16ec4a0",
"homepage": "https://github.com/pvorb/node-clone",
- "_id": "clone@0.1.19",
- "_shasum": "613fb68639b26a494ac53253e15b1a6bd88ada85",
- "_from": "clone@>=0.1.5 <0.2.0",
+ "_id": "clone@1.0.2",
+ "_shasum": "260b7a99ebb1edfe247538175f783243cb19d149",
+ "_from": "clone@>=1.0.2 <2.0.0",
"_npmVersion": "1.4.14",
"_npmUser": {
"name": "pvorb",
@@ -118,9 +125,10 @@
}
],
"dist": {
- "shasum": "613fb68639b26a494ac53253e15b1a6bd88ada85",
- "tarball": "http://registry.npmjs.org/clone/-/clone-0.1.19.tgz"
+ "shasum": "260b7a99ebb1edfe247538175f783243cb19d149",
+ "tarball": "http://registry.npmjs.org/clone/-/clone-1.0.2.tgz"
},
"directories": {},
- "_resolved": "https://registry.npmjs.org/clone/-/clone-0.1.19.tgz"
+ "_resolved": "https://registry.npmjs.org/clone/-/clone-1.0.2.tgz",
+ "readme": "ERROR: No README data found!"
}
diff --git a/deps/npm/node_modules/columnify/node_modules/wcwidth/node_modules/defaults/node_modules/clone/test-apart-ctx.html b/deps/npm/node_modules/columnify/node_modules/wcwidth/node_modules/defaults/node_modules/clone/test-apart-ctx.html
new file mode 100644
index 00000000000000..4d532bb7175192
--- /dev/null
+++ b/deps/npm/node_modules/columnify/node_modules/wcwidth/node_modules/defaults/node_modules/clone/test-apart-ctx.html
@@ -0,0 +1,22 @@
+
+
+
+ Clone Test-Suite (Browser)
+
+
+
+
+
diff --git a/deps/npm/node_modules/columnify/node_modules/wcwidth/node_modules/defaults/node_modules/clone/test.html b/deps/npm/node_modules/columnify/node_modules/wcwidth/node_modules/defaults/node_modules/clone/test.html
new file mode 100644
index 00000000000000..a955702516dfb3
--- /dev/null
+++ b/deps/npm/node_modules/columnify/node_modules/wcwidth/node_modules/defaults/node_modules/clone/test.html
@@ -0,0 +1,148 @@
+
+
+
+
+ Clone Test-Suite (Browser)
+
+
+
+
+
+ Clone Test-Suite (Browser)
+ Tests started: ;
+ Tests finished: .
+
+
+
+
diff --git a/deps/npm/node_modules/columnify/node_modules/wcwidth/node_modules/defaults/node_modules/clone/test.js b/deps/npm/node_modules/columnify/node_modules/wcwidth/node_modules/defaults/node_modules/clone/test.js
index cb3d16631ab87f..e8b65b3fed93c5 100644
--- a/deps/npm/node_modules/columnify/node_modules/wcwidth/node_modules/defaults/node_modules/clone/test.js
+++ b/deps/npm/node_modules/columnify/node_modules/wcwidth/node_modules/defaults/node_modules/clone/test.js
@@ -1,16 +1,50 @@
-if(module.parent === null) {
- console.log('Run this test file with nodeunit:');
- console.log('$ nodeunit test.js');
-}
+var clone = require('./');
+function inspect(obj) {
+ seen = [];
+ return JSON.stringify(obj, function (key, val) {
+ if (val != null && typeof val == "object") {
+ if (seen.indexOf(val) >= 0) {
+ return '[cyclic]';
+ }
-var clone = require('./');
-var util = require('util');
-var _ = require('underscore');
+ seen.push(val);
+ }
+ return val;
+ });
+}
+
+// Creates a new VM in node, or an iframe in a browser in order to run the
+// script
+function apartContext(context, script, callback) {
+ var vm = require('vm');
+ if (vm) {
+ var ctx = vm.createContext({ ctx: context });
+ callback(vm.runInContext(script, ctx));
+ } else if (document && document.createElement) {
+ var iframe = document.createElement('iframe');
+ iframe.style.display = 'none';
+ document.body.appendChild(iframe);
+
+ var myCtxId = 'tmpCtx' + Math.random();
+
+ window[myCtxId] = context;
+ iframe.src = 'test-apart-ctx.html?' + myCtxId + '&' + encodeURIComponent(script);
+ iframe.onload = function() {
+ try {
+ callback(iframe.contentWindow.results);
+ } catch (e) {
+ throw e;
+ }
+ };
+ } else {
+ console.log('WARNING: cannot create an apart context.');
+ }
+}
-exports["clone string"] = function(test) {
+exports["clone string"] = function (test) {
test.expect(2); // how many tests?
var a = "foo";
@@ -21,9 +55,7 @@ exports["clone string"] = function(test) {
test.done();
};
-
-
-exports["clone number"] = function(test) {
+exports["clone number"] = function (test) {
test.expect(5); // how many tests?
var a = 0;
@@ -40,37 +72,30 @@ exports["clone number"] = function(test) {
test.done();
};
-
-
-exports["clone date"] = function(test) {
+exports["clone date"] = function (test) {
test.expect(3); // how many tests?
var a = new Date;
var c = clone(a);
- test.ok(a instanceof Date);
- test.ok(c instanceof Date);
- test.equal(c.getTime(), a.getTime());
+ test.ok(!!a.getUTCDate && !!a.toUTCString);
+ test.ok(!!c.getUTCDate && !!c.toUTCString);
+ test.equal(a.getTime(), c.getTime());
test.done();
};
-
-
-exports["clone object"] = function(test) {
- test.expect(2); // how many tests?
+exports["clone object"] = function (test) {
+ test.expect(1); // how many tests?
var a = { foo: { bar: "baz" } };
var b = clone(a);
- test.ok(_(a).isEqual(b), "underscore equal");
test.deepEqual(b, a);
test.done();
};
-
-
-exports["clone array"] = function(test) {
+exports["clone array"] = function (test) {
test.expect(2); // how many tests?
var a = [
@@ -79,13 +104,17 @@ exports["clone array"] = function(test) {
];
var b = clone(a);
- test.ok(_(a).isEqual(b), "underscore equal");
+ test.ok(b instanceof Array);
test.deepEqual(b, a);
test.done();
};
-exports["clone buffer"] = function(test) {
+exports["clone buffer"] = function (test) {
+ if (typeof Buffer == 'undefined') {
+ return test.done();
+ }
+
test.expect(1);
var a = new Buffer("this is a test buffer");
@@ -96,14 +125,11 @@ exports["clone buffer"] = function(test) {
test.done();
};
-
-
-exports["clone regexp"] = function(test) {
+exports["clone regexp"] = function (test) {
test.expect(5);
var a = /abc123/gi;
var b = clone(a);
-
test.deepEqual(b, a);
var c = /a/g;
@@ -119,63 +145,54 @@ exports["clone regexp"] = function(test) {
test.done();
};
-
-exports["clone object containing array"] = function(test) {
- test.expect(2); // how many tests?
+exports["clone object containing array"] = function (test) {
+ test.expect(1); // how many tests?
var a = {
arr1: [ { a: '1234', b: '2345' } ],
arr2: [ { c: '345', d: '456' } ]
};
+
var b = clone(a);
- test.ok(_(a).isEqual(b), "underscore equal");
test.deepEqual(b, a);
test.done();
};
-
-
-exports["clone object with circular reference"] = function(test) {
+exports["clone object with circular reference"] = function (test) {
test.expect(8); // how many tests?
- var _ = test.ok;
- var c = [1, "foo", {'hello': 'bar'}, function() {}, false, [2]];
+ var c = [1, "foo", {'hello': 'bar'}, function () {}, false, [2]];
var b = [c, 2, 3, 4];
+
var a = {'b': b, 'c': c};
a.loop = a;
a.loop2 = a;
c.loop = c;
c.aloop = a;
+
var aCopy = clone(a);
- _(a != aCopy);
- _(a.c != aCopy.c);
- _(aCopy.c == aCopy.b[0]);
- _(aCopy.c.loop.loop.aloop == aCopy);
- _(aCopy.c[0] == a.c[0]);
-
- //console.log(util.inspect(aCopy, true, null) );
- //console.log("------------------------------------------------------------");
- //console.log(util.inspect(a, true, null) );
- _(eq(a, aCopy));
+ test.ok(a != aCopy);
+ test.ok(a.c != aCopy.c);
+ test.ok(aCopy.c == aCopy.b[0]);
+ test.ok(aCopy.c.loop.loop.aloop == aCopy);
+ test.ok(aCopy.c[0] == a.c[0]);
+
+ test.ok(eq(a, aCopy));
aCopy.c[0] = 2;
- _(!eq(a, aCopy));
+ test.ok(!eq(a, aCopy));
aCopy.c = "2";
- _(!eq(a, aCopy));
- //console.log("------------------------------------------------------------");
- //console.log(util.inspect(aCopy, true, null) );
+ test.ok(!eq(a, aCopy));
function eq(x, y) {
- return util.inspect(x, true, null) === util.inspect(y, true, null);
+ return inspect(x) === inspect(y);
}
test.done();
};
-
-
-exports['clonePrototype'] = function(test) {
+exports['clone prototype'] = function (test) {
test.expect(3); // how many tests?
var a = {
@@ -190,34 +207,38 @@ exports['clonePrototype'] = function(test) {
test.strictEqual(b.y, a.y);
test.done();
-}
+};
-exports['cloneWithinNewVMContext'] = function(test) {
- test.expect(3);
- var vm = require('vm');
- var ctx = vm.createContext({ clone: clone });
- var script = "clone( {array: [1, 2, 3], date: new Date(), regex: /^foo$/ig} );";
- var results = vm.runInContext(script, ctx);
- test.ok(results.array instanceof Array);
- test.ok(results.date instanceof Date);
- test.ok(results.regex instanceof RegExp);
- test.done();
-}
+exports['clone within an apart context'] = function (test) {
+ var results = apartContext({ clone: clone },
+ "results = ctx.clone({ a: [1, 2, 3], d: new Date(), r: /^foo$/ig })",
+ function (results) {
+ test.ok(results.a.constructor.toString() === Array.toString());
+ test.ok(results.d.constructor.toString() === Date.toString());
+ test.ok(results.r.constructor.toString() === RegExp.toString());
+ test.done();
+ });
+};
-exports['cloneObjectWithNoConstructor'] = function(test) {
+exports['clone object with no constructor'] = function (test) {
test.expect(3);
+
var n = null;
+
var a = { foo: 'bar' };
a.__proto__ = n;
test.ok(typeof a === 'object');
test.ok(typeof a !== null);
+
var b = clone(a);
test.ok(a.foo, b.foo);
+
test.done();
-}
+};
exports['clone object with depth argument'] = function (test) {
test.expect(6);
+
var a = {
foo: {
bar : {
@@ -225,6 +246,7 @@ exports['clone object with depth argument'] = function (test) {
}
}
};
+
var b = clone(a, false, 1);
test.deepEqual(b, a);
test.notEqual(b, a);
@@ -234,28 +256,35 @@ exports['clone object with depth argument'] = function (test) {
test.deepEqual(b, a);
test.notEqual(b.foo, a.foo);
test.strictEqual(b.foo.bar, a.foo.bar);
+
test.done();
-}
+};
exports['maintain prototype chain in clones'] = function (test) {
test.expect(1);
- function Constructor() {}
- var a = new Constructor();
+
+ function T() {}
+
+ var a = new T();
var b = clone(a);
test.strictEqual(Object.getPrototypeOf(a), Object.getPrototypeOf(b));
+
test.done();
-}
+};
exports['parent prototype is overriden with prototype provided'] = function (test) {
test.expect(1);
- function Constructor() {}
- var a = new Constructor();
+
+ function T() {}
+
+ var a = new T();
var b = clone(a, true, Infinity, null);
test.strictEqual(b.__defineSetter__, undefined);
+
test.done();
-}
+};
-exports['clone object with null children'] = function(test) {
+exports['clone object with null children'] = function (test) {
test.expect(1);
var a = {
foo: {
@@ -265,12 +294,14 @@ exports['clone object with null children'] = function(test) {
}
}
};
+
var b = clone(a);
+
test.deepEqual(b, a);
test.done();
-}
+};
-exports['clone instance with getter'] = function(test) {
+exports['clone instance with getter'] = function (test) {
test.expect(1);
function Ctor() {};
Object.defineProperty(Ctor.prototype, 'prop', {
@@ -286,4 +317,56 @@ exports['clone instance with getter'] = function(test) {
test.strictEqual(b.prop, 'value');
test.done();
-};
\ No newline at end of file
+};
+
+exports['get RegExp flags'] = function (test) {
+ test.strictEqual(clone.__getRegExpFlags(/a/), '' );
+ test.strictEqual(clone.__getRegExpFlags(/a/i), 'i' );
+ test.strictEqual(clone.__getRegExpFlags(/a/g), 'g' );
+ test.strictEqual(clone.__getRegExpFlags(/a/gi), 'gi');
+ test.strictEqual(clone.__getRegExpFlags(/a/m), 'm' );
+
+ test.done();
+};
+
+exports["recognize Array object"] = function (test) {
+ var results = apartContext(null, "results = [1, 2, 3]", function(alien) {
+ var local = [4, 5, 6];
+ test.ok(clone.__isArray(alien)); // recognize in other context.
+ test.ok(clone.__isArray(local)); // recognize in local context.
+ test.ok(!clone.__isDate(alien));
+ test.ok(!clone.__isDate(local));
+ test.ok(!clone.__isRegExp(alien));
+ test.ok(!clone.__isRegExp(local));
+ test.done();
+ });
+};
+
+exports["recognize Date object"] = function (test) {
+ var results = apartContext(null, "results = new Date()", function(alien) {
+ var local = new Date();
+
+ test.ok(clone.__isDate(alien)); // recognize in other context.
+ test.ok(clone.__isDate(local)); // recognize in local context.
+ test.ok(!clone.__isArray(alien));
+ test.ok(!clone.__isArray(local));
+ test.ok(!clone.__isRegExp(alien));
+ test.ok(!clone.__isRegExp(local));
+
+ test.done();
+ });
+};
+
+exports["recognize RegExp object"] = function (test) {
+ var results = apartContext(null, "results = /foo/", function(alien) {
+ var local = /bar/;
+
+ test.ok(clone.__isRegExp(alien)); // recognize in other context.
+ test.ok(clone.__isRegExp(local)); // recognize in local context.
+ test.ok(!clone.__isArray(alien));
+ test.ok(!clone.__isArray(local));
+ test.ok(!clone.__isDate(alien));
+ test.ok(!clone.__isDate(local));
+ test.done();
+ });
+};
diff --git a/deps/npm/node_modules/columnify/node_modules/wcwidth/node_modules/defaults/package.json b/deps/npm/node_modules/columnify/node_modules/wcwidth/node_modules/defaults/package.json
index fdd074d0f4afbb..8ad5116c70bd7a 100644
--- a/deps/npm/node_modules/columnify/node_modules/wcwidth/node_modules/defaults/package.json
+++ b/deps/npm/node_modules/columnify/node_modules/wcwidth/node_modules/defaults/package.json
@@ -1,6 +1,6 @@
{
"name": "defaults",
- "version": "1.0.2",
+ "version": "1.0.3",
"description": "merge single level defaults over a config object",
"main": "index.js",
"scripts": {
@@ -20,34 +20,36 @@
},
"license": "MIT",
"dependencies": {
- "clone": "~0.1.5"
+ "clone": "^1.0.2"
},
"devDependencies": {
- "tap": "~0.4.0"
+ "tap": "^2.0.0"
},
- "gitHead": "22c57d1f87a2f03c1f9d21bd39c67db8553a0064",
+ "gitHead": "8831ec32a5f999bfae1a8c9bf32880971ed7c6f2",
"bugs": {
"url": "https://github.com/tmpvar/defaults/issues"
},
- "homepage": "https://github.com/tmpvar/defaults",
- "_id": "defaults@1.0.2",
- "_shasum": "6902e25aa047649a501e19ef9e98f3e8365c109a",
+ "homepage": "https://github.com/tmpvar/defaults#readme",
+ "_id": "defaults@1.0.3",
+ "_shasum": "c656051e9817d9ff08ed881477f3fe4019f3ef7d",
"_from": "defaults@>=1.0.0 <2.0.0",
- "_npmVersion": "1.4.23",
+ "_npmVersion": "2.14.4",
+ "_nodeVersion": "4.1.1",
"_npmUser": {
"name": "tmpvar",
"email": "tmpvar@gmail.com"
},
+ "dist": {
+ "shasum": "c656051e9817d9ff08ed881477f3fe4019f3ef7d",
+ "tarball": "http://registry.npmjs.org/defaults/-/defaults-1.0.3.tgz"
+ },
"maintainers": [
{
"name": "tmpvar",
"email": "tmpvar@gmail.com"
}
],
- "dist": {
- "shasum": "6902e25aa047649a501e19ef9e98f3e8365c109a",
- "tarball": "http://registry.npmjs.org/defaults/-/defaults-1.0.2.tgz"
- },
"directories": {},
- "_resolved": "https://registry.npmjs.org/defaults/-/defaults-1.0.2.tgz"
+ "_resolved": "https://registry.npmjs.org/defaults/-/defaults-1.0.3.tgz",
+ "readme": "ERROR: No README data found!"
}
diff --git a/deps/npm/node_modules/columnify/package.json b/deps/npm/node_modules/columnify/package.json
index 1dc803973c6900..b4c3738c870af5 100644
--- a/deps/npm/node_modules/columnify/package.json
+++ b/deps/npm/node_modules/columnify/package.json
@@ -1,6 +1,6 @@
{
"name": "columnify",
- "version": "1.5.2",
+ "version": "1.5.4",
"description": "Render data in text columns. Supports in-column text-wrap.",
"main": "columnify.js",
"scripts": {
@@ -9,15 +9,22 @@
"bench": "npm test && node bench",
"prepublish": "make prepublish"
},
+ "babel": {
+ "presets": [
+ "es2015"
+ ]
+ },
"author": {
"name": "Tim Oxley"
},
"license": "MIT",
"devDependencies": {
- "babel": "^5.8.21",
- "chalk": "^1.1.0",
- "tap-spec": "^4.0.2",
- "tape": "^4.0.3"
+ "babel": "^6.3.26",
+ "babel-cli": "^6.3.17",
+ "babel-preset-es2015": "^6.3.13",
+ "chalk": "^1.1.1",
+ "tap-spec": "^4.1.1",
+ "tape": "^4.4.0"
},
"repository": {
"type": "git",
@@ -43,12 +50,12 @@
"directories": {
"test": "test"
},
- "gitHead": "e7417b78091844ff2f3ba62551a4817c7ae217bd",
- "_id": "columnify@1.5.2",
- "_shasum": "6937930d47c22a9bfa20732a7fd619d47eaba65a",
- "_from": "columnify@1.5.2",
- "_npmVersion": "2.9.0",
- "_nodeVersion": "2.0.1",
+ "gitHead": "b5373b3d6344bf59e1ab63c912c188c34bce5889",
+ "_id": "columnify@1.5.4",
+ "_shasum": "4737ddf1c7b69a8a7c340570782e947eec8e78bb",
+ "_from": "columnify@latest",
+ "_npmVersion": "2.14.7",
+ "_nodeVersion": "4.2.3",
"_npmUser": {
"name": "timoxley",
"email": "secoif@gmail.com"
@@ -60,8 +67,8 @@
}
],
"dist": {
- "shasum": "6937930d47c22a9bfa20732a7fd619d47eaba65a",
- "tarball": "http://registry.npmjs.org/columnify/-/columnify-1.5.2.tgz"
+ "shasum": "4737ddf1c7b69a8a7c340570782e947eec8e78bb",
+ "tarball": "http://registry.npmjs.org/columnify/-/columnify-1.5.4.tgz"
},
- "_resolved": "https://registry.npmjs.org/columnify/-/columnify-1.5.2.tgz"
+ "_resolved": "https://registry.npmjs.org/columnify/-/columnify-1.5.4.tgz"
}
diff --git a/deps/npm/node_modules/columnify/utils.js b/deps/npm/node_modules/columnify/utils.js
index 30682af3b1fe9c..df3e6cc44e8561 100644
--- a/deps/npm/node_modules/columnify/utils.js
+++ b/deps/npm/node_modules/columnify/utils.js
@@ -108,33 +108,46 @@ function splitIntoLines(str, max) {
* @return String
*/
-function splitLongWords(str, max, truncationChar, result) {
+function splitLongWords(str, max, truncationChar) {
str = str.trim()
- result = result || []
- if (!str) return result.join(' ') || ''
+ var result = []
var words = str.split(' ')
- var word = words.shift() || str
- if (wcwidth(word) > max) {
- // slice is based on length no wcwidth
- var i = 0
- var wwidth = 0
- var limit = max - wcwidth(truncationChar)
- while (i < word.length) {
- var w = wcwidth(word.charAt(i))
- if(w + wwidth > limit)
- break
- wwidth += w
- ++i
+ var remainder = ''
+
+ var truncationWidth = wcwidth(truncationChar)
+
+ while (remainder || words.length) {
+ if (remainder) {
+ var word = remainder
+ remainder = ''
+ } else {
+ var word = words.shift()
}
- var remainder = word.slice(i) // get remainder
- words.unshift(remainder) // save remainder for next loop
+ if (wcwidth(word) > max) {
+ // slice is based on length no wcwidth
+ var i = 0
+ var wwidth = 0
+ var limit = max - truncationWidth
+ while (i < word.length) {
+ var w = wcwidth(word.charAt(i))
+ if (w + wwidth > limit) {
+ break
+ }
+ wwidth += w
+ ++i
+ }
+
+ remainder = word.slice(i) // get remainder
+ // save remainder for next loop
- word = word.slice(0, i) // grab truncated word
- word += truncationChar // add trailing … or whatever
+ word = word.slice(0, i) // grab truncated word
+ word += truncationChar // add trailing … or whatever
+ }
+ result.push(word)
}
- result.push(word)
- return splitLongWords(words.join(' '), max, truncationChar, result)
+
+ return result.join(' ')
}
diff --git a/deps/npm/node_modules/config-chain/node_modules/proto-list/package.json b/deps/npm/node_modules/config-chain/node_modules/proto-list/package.json
index 458621ad892adf..699311ed04c04f 100644
--- a/deps/npm/node_modules/config-chain/node_modules/proto-list/package.json
+++ b/deps/npm/node_modules/config-chain/node_modules/proto-list/package.json
@@ -44,5 +44,6 @@
}
],
"directories": {},
- "_resolved": "https://registry.npmjs.org/proto-list/-/proto-list-1.2.4.tgz"
+ "_resolved": "https://registry.npmjs.org/proto-list/-/proto-list-1.2.4.tgz",
+ "readme": "ERROR: No README data found!"
}
diff --git a/deps/npm/node_modules/config-chain/package.json b/deps/npm/node_modules/config-chain/package.json
index b25913cab0143b..ecbf8f621f1fbe 100644
--- a/deps/npm/node_modules/config-chain/package.json
+++ b/deps/npm/node_modules/config-chain/package.json
@@ -1,6 +1,6 @@
{
"name": "config-chain",
- "version": "1.1.9",
+ "version": "1.1.10",
"licenses": [
{
"type": "MIT",
@@ -11,11 +11,11 @@
"homepage": "http://github.com/dominictarr/config-chain",
"repository": {
"type": "git",
- "url": "https://github.com/dominictarr/config-chain.git"
+ "url": "git+https://github.com/dominictarr/config-chain.git"
},
"dependencies": {
"proto-list": "~1.2.1",
- "ini": "1"
+ "ini": "^1.3.4"
},
"devDependencies": {
"tap": "0.3.0"
@@ -28,19 +28,23 @@
"scripts": {
"test": "tap test/"
},
- "gitHead": "832609897082a0a887c59dadb105f4db6de1ab4c",
+ "gitHead": "0b6db3e14b9cdbe31460292bc4caf3983f977816",
"bugs": {
"url": "https://github.com/dominictarr/config-chain/issues"
},
- "_id": "config-chain@1.1.9",
- "_shasum": "39ac7d4dca84faad926124c54cff25a53aa8bf6e",
- "_from": "config-chain@>=1.1.9 <1.2.0",
- "_npmVersion": "2.11.0",
- "_nodeVersion": "0.12.4",
+ "_id": "config-chain@1.1.10",
+ "_shasum": "7fc383de0fcc84d711cb465bd176579cad612346",
+ "_from": "config-chain@latest",
+ "_npmVersion": "3.3.12",
+ "_nodeVersion": "5.3.0",
"_npmUser": {
"name": "dominictarr",
"email": "dominic.tarr@gmail.com"
},
+ "dist": {
+ "shasum": "7fc383de0fcc84d711cb465bd176579cad612346",
+ "tarball": "http://registry.npmjs.org/config-chain/-/config-chain-1.1.10.tgz"
+ },
"maintainers": [
{
"name": "dominictarr",
@@ -51,10 +55,7 @@
"email": "i@izs.me"
}
],
- "dist": {
- "shasum": "39ac7d4dca84faad926124c54cff25a53aa8bf6e",
- "tarball": "http://registry.npmjs.org/config-chain/-/config-chain-1.1.9.tgz"
- },
"directories": {},
- "_resolved": "https://registry.npmjs.org/config-chain/-/config-chain-1.1.9.tgz"
+ "_resolved": "https://registry.npmjs.org/config-chain/-/config-chain-1.1.10.tgz",
+ "readme": "ERROR: No README data found!"
}
diff --git a/deps/npm/node_modules/config-chain/test/save.js b/deps/npm/node_modules/config-chain/test/save.js
index 783461317cced9..bc97bbd3f6f1df 100644
--- a/deps/npm/node_modules/config-chain/test/save.js
+++ b/deps/npm/node_modules/config-chain/test/save.js
@@ -38,7 +38,7 @@ test('test saving and loading ini files', function (t) {
.save('jsonfile')
.on('save', function () {
t.equal(fs.readFileSync(f1, 'utf8'),
- "bloo = jaus\nfoo = zoo\n")
+ "bloo=jaus\nfoo=zoo\n")
t.equal(fs.readFileSync(f2, 'utf8'),
"{\"oof\":\"ooz\",\"oolb\":\"suaj\"}")
diff --git a/deps/npm/node_modules/fs-write-stream-atomic/.npmignore b/deps/npm/node_modules/fs-write-stream-atomic/.npmignore
new file mode 100644
index 00000000000000..2f24c57c382e41
--- /dev/null
+++ b/deps/npm/node_modules/fs-write-stream-atomic/.npmignore
@@ -0,0 +1,3 @@
+node_modules/
+coverage/
+.nyc_output/
diff --git a/deps/npm/node_modules/fs-write-stream-atomic/.travis.yml b/deps/npm/node_modules/fs-write-stream-atomic/.travis.yml
new file mode 100644
index 00000000000000..68946625271c27
--- /dev/null
+++ b/deps/npm/node_modules/fs-write-stream-atomic/.travis.yml
@@ -0,0 +1,11 @@
+language: node_js
+sudo: false
+before_install:
+ - "npm -g install npm"
+node_js:
+ - "0.8"
+ - "0.10"
+ - "0.12"
+ - "iojs"
+ - "4"
+ - "5"
diff --git a/deps/npm/node_modules/fs-write-stream-atomic/index.js b/deps/npm/node_modules/fs-write-stream-atomic/index.js
index d86b8c673f23ad..59b50db6d72927 100644
--- a/deps/npm/node_modules/fs-write-stream-atomic/index.js
+++ b/deps/npm/node_modules/fs-write-stream-atomic/index.js
@@ -1,96 +1,124 @@
var fs = require('graceful-fs')
+var Writable = require('readable-stream').Writable
var util = require('util')
-var crypto = require('crypto')
+var MurmurHash3 = require('imurmurhash')
+var iferr = require('iferr')
-function md5hex () {
- var hash = crypto.createHash('md5')
- for (var ii=0; ii
+ User.load_user id, iferr cb, (user) ->
+ user.load_friends iferr cb, (friends) ->
+ cb null, friends.length
+```
+
+(TODO: document tiferr, throwerr and printerr)
+
+## License
+MIT
diff --git a/deps/npm/node_modules/fs-write-stream-atomic/node_modules/iferr/index.coffee b/deps/npm/node_modules/fs-write-stream-atomic/node_modules/iferr/index.coffee
new file mode 100644
index 00000000000000..da6d00719f10c4
--- /dev/null
+++ b/deps/npm/node_modules/fs-write-stream-atomic/node_modules/iferr/index.coffee
@@ -0,0 +1,24 @@
+# Delegates to `succ` on sucecss or to `fail` on error
+# ex: Thing.load 123, iferr cb, (thing) -> ...
+iferr = (fail, succ) -> (err, a...) ->
+ if err? then fail err
+ else succ? a...
+
+# Like iferr, but also catches errors thrown from `succ` and passes to `fail`
+tiferr = (fail, succ) -> iferr fail, (a...) ->
+ try succ a...
+ catch err then fail err
+
+# Delegate to the success function on success, or throw the error otherwise
+# ex: Thing.load 123, throwerr (thing) -> ...
+throwerr = iferr.bind null, (err) -> throw err
+
+# Prints errors when one is passed, or does nothing otherwise
+# ex: thing.save printerr
+printerr = iferr (err) -> console.error err.stack or err
+
+module.exports = exports = iferr
+exports.iferr = iferr
+exports.tiferr = tiferr
+exports.throwerr = throwerr
+exports.printerr = printerr
diff --git a/deps/npm/node_modules/fs-write-stream-atomic/node_modules/iferr/index.js b/deps/npm/node_modules/fs-write-stream-atomic/node_modules/iferr/index.js
new file mode 100644
index 00000000000000..78fce3d2b0965a
--- /dev/null
+++ b/deps/npm/node_modules/fs-write-stream-atomic/node_modules/iferr/index.js
@@ -0,0 +1,49 @@
+// Generated by CoffeeScript 1.7.1
+(function() {
+ var exports, iferr, printerr, throwerr, tiferr,
+ __slice = [].slice;
+
+ iferr = function(fail, succ) {
+ return function() {
+ var a, err;
+ err = arguments[0], a = 2 <= arguments.length ? __slice.call(arguments, 1) : [];
+ if (err != null) {
+ return fail(err);
+ } else {
+ return typeof succ === "function" ? succ.apply(null, a) : void 0;
+ }
+ };
+ };
+
+ tiferr = function(fail, succ) {
+ return iferr(fail, function() {
+ var a, err;
+ a = 1 <= arguments.length ? __slice.call(arguments, 0) : [];
+ try {
+ return succ.apply(null, a);
+ } catch (_error) {
+ err = _error;
+ return fail(err);
+ }
+ });
+ };
+
+ throwerr = iferr.bind(null, function(err) {
+ throw err;
+ });
+
+ printerr = iferr(function(err) {
+ return console.error(err.stack || err);
+ });
+
+ module.exports = exports = iferr;
+
+ exports.iferr = iferr;
+
+ exports.tiferr = tiferr;
+
+ exports.throwerr = throwerr;
+
+ exports.printerr = printerr;
+
+}).call(this);
diff --git a/deps/npm/node_modules/fs-write-stream-atomic/node_modules/iferr/package.json b/deps/npm/node_modules/fs-write-stream-atomic/node_modules/iferr/package.json
new file mode 100644
index 00000000000000..9017857c56ddbc
--- /dev/null
+++ b/deps/npm/node_modules/fs-write-stream-atomic/node_modules/iferr/package.json
@@ -0,0 +1,50 @@
+{
+ "name": "iferr",
+ "version": "0.1.5",
+ "description": "Higher-order functions for easier error handling",
+ "main": "index.js",
+ "scripts": {
+ "test": "mocha",
+ "prepublish": "coffee -c index.coffee"
+ },
+ "repository": {
+ "type": "git",
+ "url": "https://github.com/shesek/iferr"
+ },
+ "keywords": [
+ "error",
+ "errors"
+ ],
+ "author": {
+ "name": "Nadav Ivgi"
+ },
+ "license": "MIT",
+ "bugs": {
+ "url": "https://github.com/shesek/iferr/issues"
+ },
+ "homepage": "https://github.com/shesek/iferr",
+ "devDependencies": {
+ "coffee-script": "^1.7.1",
+ "mocha": "^1.18.2"
+ },
+ "_id": "iferr@0.1.5",
+ "dist": {
+ "shasum": "c60eed69e6d8fdb6b3104a1fcbca1c192dc5b501",
+ "tarball": "http://registry.npmjs.org/iferr/-/iferr-0.1.5.tgz"
+ },
+ "_from": "iferr@>=0.1.5 <0.2.0",
+ "_npmVersion": "1.4.4",
+ "_npmUser": {
+ "name": "nadav",
+ "email": "npm@shesek.info"
+ },
+ "maintainers": [
+ {
+ "name": "nadav",
+ "email": "npm@shesek.info"
+ }
+ ],
+ "directories": {},
+ "_shasum": "c60eed69e6d8fdb6b3104a1fcbca1c192dc5b501",
+ "_resolved": "https://registry.npmjs.org/iferr/-/iferr-0.1.5.tgz"
+}
diff --git a/deps/npm/node_modules/fs-write-stream-atomic/node_modules/iferr/test/index.coffee b/deps/npm/node_modules/fs-write-stream-atomic/node_modules/iferr/test/index.coffee
new file mode 100644
index 00000000000000..be0bc56fdf1b96
--- /dev/null
+++ b/deps/npm/node_modules/fs-write-stream-atomic/node_modules/iferr/test/index.coffee
@@ -0,0 +1,42 @@
+{ iferr, tiferr, throwerr } = require '../index.coffee'
+{ equal: eq, throws } = require 'assert'
+
+invoke_fail = (cb) -> cb new Error 'callback error'
+invoke_succ = (cb) -> cb null
+throw_error = -> throw new Error 'thrown'
+
+describe 'iferr', ->
+ it 'calls the error callback on errors', (done) ->
+ invoke_fail iferr(
+ (err) ->
+ eq err.message, 'callback error'
+ do done
+ ->
+ done new Error 'shouldn\'t call the success callback'
+ )
+
+ it 'calls the success callback on success', (done) ->
+ invoke_succ iferr(
+ -> done new Error 'shouldn\'t call the error callback'
+ done
+ )
+
+describe 'tiferr', ->
+ it 'catches errors in the success callback', (done) ->
+ invoke_succ tiferr(
+ (err) ->
+ eq err.message, 'thrown'
+ do done
+ throw_error
+ )
+
+describe 'throwerr', ->
+ it 'throws errors passed to the callback', (done)->
+ try invoke_fail throwerr ->
+ done 'shouldn\'t call the success callback'
+ catch err
+ eq err.message, 'callback error'
+ do done
+
+ it 'delegates to the success callback otherwise', (done) ->
+ invoke_succ throwerr done
diff --git a/deps/npm/node_modules/fs-write-stream-atomic/node_modules/iferr/test/mocha.opts b/deps/npm/node_modules/fs-write-stream-atomic/node_modules/iferr/test/mocha.opts
new file mode 100644
index 00000000000000..019defcf152a84
--- /dev/null
+++ b/deps/npm/node_modules/fs-write-stream-atomic/node_modules/iferr/test/mocha.opts
@@ -0,0 +1,2 @@
+--compilers coffee:coffee-script/register
+--reporter spec
diff --git a/deps/npm/node_modules/fs-write-stream-atomic/package.json b/deps/npm/node_modules/fs-write-stream-atomic/package.json
index a94785682a9f91..0fae54c40a2449 100644
--- a/deps/npm/node_modules/fs-write-stream-atomic/package.json
+++ b/deps/npm/node_modules/fs-write-stream-atomic/package.json
@@ -1,19 +1,24 @@
{
"name": "fs-write-stream-atomic",
- "version": "1.0.4",
+ "version": "1.0.8",
"description": "Like `fs.createWriteStream(...)`, but atomic.",
"main": "index.js",
"directories": {
"test": "test"
},
"dependencies": {
- "graceful-fs": "^4.1.2"
+ "graceful-fs": "^4.1.2",
+ "iferr": "^0.1.5",
+ "imurmurhash": "^0.1.4",
+ "readable-stream": "1 || 2"
},
"devDependencies": {
- "tap": "^1.2.0"
+ "rimraf": "^2.4.4",
+ "standard": "^5.4.1",
+ "tap": "^2.3.1"
},
"scripts": {
- "test": "tap test/*.js"
+ "test": "standard && tap --coverage test/*.js"
},
"repository": {
"type": "git",
@@ -29,10 +34,37 @@
"url": "https://github.com/npm/fs-write-stream-atomic/issues"
},
"homepage": "https://github.com/npm/fs-write-stream-atomic",
- "readme": "# fs-write-stream-atomic\n\nLike `fs.createWriteStream(...)`, but atomic.\n\nWrites to a tmp file and does an atomic `fs.rename` to move it into\nplace when it's done.\n\nFirst rule of debugging: **It's always a race condition.**\n\n## USAGE\n\n```javascript\nvar fsWriteStreamAtomic = require('fs-write-stream-atomic')\n// options are optional.\nvar write = fsWriteStreamAtomic('output.txt', options)\nvar read = fs.createReadStream('input.txt')\nread.pipe(write)\n\n// When the write stream emits a 'finish' or 'close' event,\n// you can be sure that it is moved into place, and contains\n// all the bytes that were written to it, even if something else\n// was writing to `output.txt` at the same time.\n```\n\n### `fsWriteStreamAtomic(filename, [options])`\n\n* `filename` {String} The file we want to write to\n* `options` {Object}\n * `chown` {Object} User and group to set ownership after write\n * `uid` {Number}\n * `gid` {Number}\n * `encoding` {String} default = 'utf8'\n * `mode` {Number} default = `0666`\n * `flags` {String} default = `'w'`\n\n",
- "readmeFilename": "README.md",
- "gitHead": "6ca2651b913149543c5390c6c4f7d370bdca42b5",
- "_id": "fs-write-stream-atomic@1.0.4",
- "_shasum": "c1ea55889f036ceebdead7d1055edbad998fe5e9",
- "_from": "fs-write-stream-atomic@1.0.4"
+ "gitHead": "b55824ee4de7f1ca23784929d68b1b8f5edbf4a4",
+ "_id": "fs-write-stream-atomic@1.0.8",
+ "_shasum": "e49aaddf288f87d46ff9e882f216a13abc40778b",
+ "_from": "fs-write-stream-atomic@>=1.0.5 <1.1.0",
+ "_npmVersion": "3.5.2",
+ "_nodeVersion": "4.2.2",
+ "_npmUser": {
+ "name": "iarna",
+ "email": "me@re-becca.org"
+ },
+ "dist": {
+ "shasum": "e49aaddf288f87d46ff9e882f216a13abc40778b",
+ "tarball": "http://registry.npmjs.org/fs-write-stream-atomic/-/fs-write-stream-atomic-1.0.8.tgz"
+ },
+ "maintainers": [
+ {
+ "name": "iarna",
+ "email": "me@re-becca.org"
+ },
+ {
+ "name": "isaacs",
+ "email": "i@izs.me"
+ },
+ {
+ "name": "othiym23",
+ "email": "ogd@aoaioxxysz.net"
+ },
+ {
+ "name": "zkat",
+ "email": "kat@sykosomatic.org"
+ }
+ ],
+ "_resolved": "https://registry.npmjs.org/fs-write-stream-atomic/-/fs-write-stream-atomic-1.0.8.tgz"
}
diff --git a/deps/npm/node_modules/fs-write-stream-atomic/test/basic.js b/deps/npm/node_modules/fs-write-stream-atomic/test/basic.js
index 159c596ab0181f..d0205e15f4389c 100644
--- a/deps/npm/node_modules/fs-write-stream-atomic/test/basic.js
+++ b/deps/npm/node_modules/fs-write-stream-atomic/test/basic.js
@@ -1,7 +1,14 @@
+var fs = require('graceful-fs')
var test = require('tap').test
-var writeStream = require('../index.js')
-var fs = require('fs')
var path = require('path')
+var writeStream = require('../index.js')
+
+var rename = fs.rename
+fs.rename = function (from, to, cb) {
+ setTimeout(function () {
+ rename(from, to, cb)
+ }, 100)
+}
test('basic', function (t) {
// open 10 write streams to the same file.
@@ -10,40 +17,41 @@ test('basic', function (t) {
var target = path.resolve(__dirname, 'test.txt')
var n = 10
+ // We run all of our assertions twice:
+ // once for finish, once for close
+ // There are 6 assertions, two fixed, plus 4 lines in the file.
+ t.plan(n * 2 * 6)
+
var streams = []
for (var i = 0; i < n; i++) {
var s = writeStream(target)
- s.on('finish', verifier('finish'))
- s.on('close', verifier('close'))
+ s.on('finish', verifier('finish', i))
+ s.on('close', verifier('close', i))
streams.push(s)
}
- var verifierCalled = 0
- function verifier (ev) { return function () {
- if (ev === 'close')
- t.equal(this.__emittedFinish, true)
- else {
- this.__emittedFinish = true
- t.equal(ev, 'finish')
- }
-
- // make sure that one of the atomic streams won.
- var res = fs.readFileSync(target, 'utf8')
- var lines = res.trim().split(/\n/)
- lines.forEach(function (line) {
- var first = lines[0].match(/\d+$/)[0]
- var cur = line.match(/\d+$/)[0]
- t.equal(cur, first)
- })
+ function verifier (ev, num) {
+ return function () {
+ if (ev === 'close') {
+ t.equal(this.__emittedFinish, true, num + '. closed only after finish')
+ } else {
+ this.__emittedFinish = true
+ t.equal(ev, 'finish', num + '. finished')
+ }
- var resExpr = /^first write \d+\nsecond write \d+\nthird write \d+\nfinal write \d+\n$/
- t.similar(res, resExpr)
+ // make sure that one of the atomic streams won.
+ var res = fs.readFileSync(target, 'utf8')
+ var lines = res.trim().split(/\n/)
+ lines.forEach(function (line, lineno) {
+ var first = lines[0].match(/\d+$/)[0]
+ var cur = line.match(/\d+$/)[0]
+ t.equal(cur, first, num + '. line ' + lineno + ' matches')
+ })
- // should be called once for each close, and each finish
- if (++verifierCalled === n * 2) {
- t.end()
+ var resExpr = /^first write \d+\nsecond write \d+\nthird write \d+\nfinal write \d+\n$/
+ t.similar(res, resExpr, num + '. content matches')
}
- }}
+ }
// now write something to each stream.
streams.forEach(function (stream, i) {
diff --git a/deps/npm/node_modules/fs-write-stream-atomic/test/chown.js b/deps/npm/node_modules/fs-write-stream-atomic/test/chown.js
new file mode 100644
index 00000000000000..1733cf27ec2089
--- /dev/null
+++ b/deps/npm/node_modules/fs-write-stream-atomic/test/chown.js
@@ -0,0 +1,44 @@
+'use strict'
+var fs = require('graceful-fs')
+var path = require('path')
+var test = require('tap').test
+var rimraf = require('rimraf')
+var writeStream = require('../index.js')
+
+var target = path.resolve(__dirname, 'test-chown')
+
+test('chown works', function (t) {
+ t.plan(1)
+ var stream = writeStream(target, {chown: {uid: process.getuid(), gid: process.getgid()}})
+ var hadError = false
+ stream.on('error', function (er) {
+ hadError = true
+ console.log('#', er)
+ })
+ stream.on('close', function () {
+ t.is(hadError, false, 'no errors before close')
+ })
+ stream.end()
+})
+
+test('chown fails', function (t) {
+ t.plan(1)
+ fs.chown = function (file, uid, gid, cb) {
+ cb(new Error('TEST BREAK'))
+ }
+ var stream = writeStream(target, {chown: {uid: process.getuid(), gid: process.getgid()}})
+ var hadError = false
+ stream.on('error', function (er) {
+ hadError = true
+ console.log('#', er)
+ })
+ stream.on('close', function () {
+ t.is(hadError, true, 'error before close')
+ })
+ stream.end()
+})
+
+test('cleanup', function (t) {
+ rimraf.sync(target)
+ t.end()
+})
diff --git a/deps/npm/node_modules/fs-write-stream-atomic/test/rename-fail.js b/deps/npm/node_modules/fs-write-stream-atomic/test/rename-fail.js
new file mode 100644
index 00000000000000..7e27f0bfb0f616
--- /dev/null
+++ b/deps/npm/node_modules/fs-write-stream-atomic/test/rename-fail.js
@@ -0,0 +1,30 @@
+'use strict'
+var fs = require('graceful-fs')
+var path = require('path')
+var test = require('tap').test
+var rimraf = require('rimraf')
+var writeStream = require('../index.js')
+
+var target = path.resolve(__dirname, 'test-rename')
+
+test('rename fails', function (t) {
+ t.plan(1)
+ fs.rename = function (src, dest, cb) {
+ cb(new Error('TEST BREAK'))
+ }
+ var stream = writeStream(target)
+ var hadError = false
+ stream.on('error', function (er) {
+ hadError = true
+ console.log('#', er)
+ })
+ stream.on('close', function () {
+ t.is(hadError, true, 'error before close')
+ })
+ stream.end()
+})
+
+test('cleanup', function (t) {
+ rimraf.sync(target)
+ t.end()
+})
diff --git a/deps/npm/node_modules/fs-write-stream-atomic/test/slow-close.js b/deps/npm/node_modules/fs-write-stream-atomic/test/slow-close.js
new file mode 100644
index 00000000000000..9840a6ef0308bf
--- /dev/null
+++ b/deps/npm/node_modules/fs-write-stream-atomic/test/slow-close.js
@@ -0,0 +1,40 @@
+'use strict'
+var fs = require('graceful-fs')
+var path = require('path')
+var test = require('tap').test
+var rimraf = require('rimraf')
+var writeStream = require('../index.js')
+
+var target = path.resolve(__dirname, 'test-chown')
+
+test('slow close', function (t) {
+ t.plan(2)
+ // The goal here is to simulate the "file close" step happening so slowly
+ // that the whole close/rename process could finish before the file is
+ // actually closed (and thus buffers truely flushed to the OS). In
+ // previous versions of this module, this would result in the module
+ // emitting finish & close before the file was fully written and in
+ // turn, could break other layers that tried to read the new file.
+ var realEmit = fs.WriteStream.prototype.emit
+ var reallyClosed = false
+ fs.WriteStream.prototype.emit = function (event) {
+ if (event !== 'close') return realEmit.apply(this, arguments)
+ setTimeout(function () {
+ reallyClosed = true
+ realEmit.call(this, 'close')
+ }.bind(this), 200)
+ }
+ var stream = writeStream(target)
+ stream.on('finish', function () {
+ t.is(reallyClosed, true, "didn't finish before target was closed")
+ })
+ stream.on('close', function () {
+ t.is(reallyClosed, true, "didn't close before target was closed")
+ })
+ stream.end()
+})
+
+test('cleanup', function (t) {
+ rimraf.sync(target)
+ t.end()
+})
diff --git a/deps/npm/node_modules/fs-write-stream-atomic/test/toolong.js b/deps/npm/node_modules/fs-write-stream-atomic/test/toolong.js
index a1e5b714a697ad..f146cc55b1dabc 100644
--- a/deps/npm/node_modules/fs-write-stream-atomic/test/toolong.js
+++ b/deps/npm/node_modules/fs-write-stream-atomic/test/toolong.js
@@ -2,7 +2,7 @@ var path = require('path')
var test = require('tap').test
var writeStream = require('../index.js')
-function repeat(times, string) {
+function repeat (times, string) {
var output = ''
for (var ii = 0; ii < times; ++ii) {
output += string
@@ -10,19 +10,20 @@ function repeat(times, string) {
return output
}
-var target = path.resolve(__dirname, repeat(1000,'test'))
+var target = path.resolve(__dirname, repeat(1000, 'test'))
test('name too long', function (t) {
+ t.plan(2)
var stream = writeStream(target)
var hadError = false
stream.on('error', function (er) {
if (!hadError) {
- t.is(er.code, 'ENAMETOOLONG', target.length + " character name results in ENAMETOOLONG")
+ t.is(er.code, 'ENAMETOOLONG', target.length + ' character name results in ENAMETOOLONG')
hadError = true
}
})
stream.on('close', function () {
- t.end()
+ t.ok(hadError, 'got error before close')
})
stream.end()
})
diff --git a/deps/npm/node_modules/graceful-fs/README.md b/deps/npm/node_modules/graceful-fs/README.md
index 13a2e86050a3eb..d920aaac9e17af 100644
--- a/deps/npm/node_modules/graceful-fs/README.md
+++ b/deps/npm/node_modules/graceful-fs/README.md
@@ -34,3 +34,20 @@ var fs = require('graceful-fs')
// now go and do stuff with it...
fs.readFileSync('some-file-or-whatever')
```
+
+## Global Patching
+
+If you want to patch the global fs module (or any other fs-like
+module) you can do this:
+
+```javascript
+// Make sure to read the caveat below.
+var realFs = require('fs')
+var gracefulFs = require('graceful-fs')
+gracefulFs.gracefulify(realFs)
+```
+
+This should only ever be done at the top-level application layer, in
+order to delay on EMFILE errors from any fs-using dependencies. You
+should **not** do this in a library, because it can cause unexpected
+delays in other parts of the program.
diff --git a/deps/npm/node_modules/graceful-fs/graceful-fs.js b/deps/npm/node_modules/graceful-fs/graceful-fs.js
index fe3b17cb60adee..9bf803e686c703 100644
--- a/deps/npm/node_modules/graceful-fs/graceful-fs.js
+++ b/deps/npm/node_modules/graceful-fs/graceful-fs.js
@@ -33,6 +33,7 @@ if (process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH) {
// retry() whenever a close happens *anywhere* in the program.
// This is essential when multiple graceful-fs instances are
// in play at the same time.
+module.exports.close =
fs.close = (function (fs$close) { return function (fd, cb) {
return fs$close.call(fs, fd, function (err) {
if (!err)
@@ -43,6 +44,7 @@ fs.close = (function (fs$close) { return function (fd, cb) {
})
}})(fs.close)
+module.exports.closeSync =
fs.closeSync = (function (fs$closeSync) { return function (fd) {
// Note that graceful-fs also retries when fs.closeSync() fails.
// Looks like a bug to me, although it's probably a harmless one.
diff --git a/deps/npm/node_modules/graceful-fs/package.json b/deps/npm/node_modules/graceful-fs/package.json
index 2a561b4c026d7b..d519c205d901d5 100644
--- a/deps/npm/node_modules/graceful-fs/package.json
+++ b/deps/npm/node_modules/graceful-fs/package.json
@@ -1,7 +1,7 @@
{
"name": "graceful-fs",
"description": "A drop-in replacement for fs, making various improvements.",
- "version": "4.1.2",
+ "version": "4.1.3",
"repository": {
"type": "git",
"url": "git+https://github.com/isaacs/node-graceful-fs.git"
@@ -36,7 +36,7 @@
"devDependencies": {
"mkdirp": "^0.5.0",
"rimraf": "^2.2.8",
- "tap": "^1.2.0"
+ "tap": "^5.4.2"
},
"files": [
"fs.js",
@@ -44,23 +44,23 @@
"legacy-streams.js",
"polyfills.js"
],
- "gitHead": "c286080071b6be9aa9ba108b0bb9b44ff122926d",
+ "gitHead": "694c56f3aed4aee62d6df169be123d3984f61b85",
"bugs": {
"url": "https://github.com/isaacs/node-graceful-fs/issues"
},
"homepage": "https://github.com/isaacs/node-graceful-fs#readme",
- "_id": "graceful-fs@4.1.2",
- "_shasum": "fe2239b7574972e67e41f808823f9bfa4a991e37",
- "_from": "graceful-fs@>=4.1.2 <4.2.0",
- "_npmVersion": "3.0.0",
- "_nodeVersion": "2.2.1",
+ "_id": "graceful-fs@4.1.3",
+ "_shasum": "92033ce11113c41e2628d61fdfa40bc10dc0155c",
+ "_from": "graceful-fs@latest",
+ "_npmVersion": "3.7.0",
+ "_nodeVersion": "4.0.0",
"_npmUser": {
"name": "isaacs",
- "email": "isaacs@npmjs.com"
+ "email": "i@izs.me"
},
"dist": {
- "shasum": "fe2239b7574972e67e41f808823f9bfa4a991e37",
- "tarball": "http://registry.npmjs.org/graceful-fs/-/graceful-fs-4.1.2.tgz"
+ "shasum": "92033ce11113c41e2628d61fdfa40bc10dc0155c",
+ "tarball": "http://registry.npmjs.org/graceful-fs/-/graceful-fs-4.1.3.tgz"
},
"maintainers": [
{
@@ -68,6 +68,9 @@
"email": "i@izs.me"
}
],
- "_resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.1.2.tgz",
- "readme": "ERROR: No README data found!"
+ "_npmOperationalInternal": {
+ "host": "packages-6-west.internal.npmjs.com",
+ "tmp": "tmp/graceful-fs-4.1.3.tgz_1454449326495_0.943017533281818"
+ },
+ "_resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.1.3.tgz"
}
diff --git a/deps/npm/node_modules/imurmurhash/README.md b/deps/npm/node_modules/imurmurhash/README.md
new file mode 100644
index 00000000000000..f35b20a0ef5bfe
--- /dev/null
+++ b/deps/npm/node_modules/imurmurhash/README.md
@@ -0,0 +1,122 @@
+iMurmurHash.js
+==============
+
+An incremental implementation of the MurmurHash3 (32-bit) hashing algorithm for JavaScript based on [Gary Court's implementation](https://github.com/garycourt/murmurhash-js) with [kazuyukitanimura's modifications](https://github.com/kazuyukitanimura/murmurhash-js).
+
+This version works significantly faster than the non-incremental version if you need to hash many small strings into a single hash, since string concatenation (to build the single string to pass the non-incremental version) is fairly costly. In one case tested, using the incremental version was about 50% faster than concatenating 5-10 strings and then hashing.
+
+Installation
+------------
+
+To use iMurmurHash in the browser, [download the latest version](https://raw.github.com/jensyt/imurmurhash-js/master/imurmurhash.min.js) and include it as a script on your site.
+
+```html
+
+
+```
+
+---
+
+To use iMurmurHash in Node.js, install the module using NPM:
+
+```bash
+npm install imurmurhash
+```
+
+Then simply include it in your scripts:
+
+```javascript
+MurmurHash3 = require('imurmurhash');
+```
+
+Quick Example
+-------------
+
+```javascript
+// Create the initial hash
+var hashState = MurmurHash3('string');
+
+// Incrementally add text
+hashState.hash('more strings');
+hashState.hash('even more strings');
+
+// All calls can be chained if desired
+hashState.hash('and').hash('some').hash('more');
+
+// Get a result
+hashState.result();
+// returns 0xe4ccfe6b
+```
+
+Functions
+---------
+
+### MurmurHash3 ([string], [seed])
+Get a hash state object, optionally initialized with the given _string_ and _seed_. _Seed_ must be a positive integer if provided. Calling this function without the `new` keyword will return a cached state object that has been reset. This is safe to use as long as the object is only used from a single thread and no other hashes are created while operating on this one. If this constraint cannot be met, you can use `new` to create a new state object. For example:
+
+```javascript
+// Use the cached object, calling the function again will return the same
+// object (but reset, so the current state would be lost)
+hashState = MurmurHash3();
+...
+
+// Create a new object that can be safely used however you wish. Calling the
+// function again will simply return a new state object, and no state loss
+// will occur, at the cost of creating more objects.
+hashState = new MurmurHash3();
+```
+
+Both methods can be mixed however you like if you have different use cases.
+
+---
+
+### MurmurHash3.prototype.hash (string)
+Incrementally add _string_ to the hash. This can be called as many times as you want for the hash state object, including after a call to `result()`. Returns `this` so calls can be chained.
+
+---
+
+### MurmurHash3.prototype.result ()
+Get the result of the hash as a 32-bit positive integer. This performs the tail and finalizer portions of the algorithm, but does not store the result in the state object. This means that it is perfectly safe to get results and then continue adding strings via `hash`.
+
+```javascript
+// Do the whole string at once
+MurmurHash3('this is a test string').result();
+// 0x70529328
+
+// Do part of the string, get a result, then the other part
+var m = MurmurHash3('this is a');
+m.result();
+// 0xbfc4f834
+m.hash(' test string').result();
+// 0x70529328 (same as above)
+```
+
+---
+
+### MurmurHash3.prototype.reset ([seed])
+Reset the state object for reuse, optionally using the given _seed_ (defaults to 0 like the constructor). Returns `this` so calls can be chained.
+
+---
+
+License (MIT)
+-------------
+Copyright (c) 2013 Gary Court, Jens Taylor
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of
+this software and associated documentation files (the "Software"), to deal in
+the Software without restriction, including without limitation the rights to
+use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
+the Software, and to permit persons to whom the Software is furnished to do so,
+subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
+FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
+COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
+IN AN ACTION 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/deps/npm/node_modules/imurmurhash/imurmurhash.js b/deps/npm/node_modules/imurmurhash/imurmurhash.js
new file mode 100644
index 00000000000000..05347a2536fce2
--- /dev/null
+++ b/deps/npm/node_modules/imurmurhash/imurmurhash.js
@@ -0,0 +1,138 @@
+/**
+ * @preserve
+ * JS Implementation of incremental MurmurHash3 (r150) (as of May 10, 2013)
+ *
+ * @author Jens Taylor
+ * @see http://github.com/homebrewing/brauhaus-diff
+ * @author Gary Court
+ * @see http://github.com/garycourt/murmurhash-js
+ * @author Austin Appleby
+ * @see http://sites.google.com/site/murmurhash/
+ */
+(function(){
+ var cache;
+
+ // Call this function without `new` to use the cached object (good for
+ // single-threaded environments), or with `new` to create a new object.
+ //
+ // @param {string} key A UTF-16 or ASCII string
+ // @param {number} seed An optional positive integer
+ // @return {object} A MurmurHash3 object for incremental hashing
+ function MurmurHash3(key, seed) {
+ var m = this instanceof MurmurHash3 ? this : cache;
+ m.reset(seed)
+ if (typeof key === 'string' && key.length > 0) {
+ m.hash(key);
+ }
+
+ if (m !== this) {
+ return m;
+ }
+ };
+
+ // Incrementally add a string to this hash
+ //
+ // @param {string} key A UTF-16 or ASCII string
+ // @return {object} this
+ MurmurHash3.prototype.hash = function(key) {
+ var h1, k1, i, top, len;
+
+ len = key.length;
+ this.len += len;
+
+ k1 = this.k1;
+ i = 0;
+ switch (this.rem) {
+ case 0: k1 ^= len > i ? (key.charCodeAt(i++) & 0xffff) : 0;
+ case 1: k1 ^= len > i ? (key.charCodeAt(i++) & 0xffff) << 8 : 0;
+ case 2: k1 ^= len > i ? (key.charCodeAt(i++) & 0xffff) << 16 : 0;
+ case 3:
+ k1 ^= len > i ? (key.charCodeAt(i) & 0xff) << 24 : 0;
+ k1 ^= len > i ? (key.charCodeAt(i++) & 0xff00) >> 8 : 0;
+ }
+
+ this.rem = (len + this.rem) & 3; // & 3 is same as % 4
+ len -= this.rem;
+ if (len > 0) {
+ h1 = this.h1;
+ while (1) {
+ k1 = (k1 * 0x2d51 + (k1 & 0xffff) * 0xcc9e0000) & 0xffffffff;
+ k1 = (k1 << 15) | (k1 >>> 17);
+ k1 = (k1 * 0x3593 + (k1 & 0xffff) * 0x1b870000) & 0xffffffff;
+
+ h1 ^= k1;
+ h1 = (h1 << 13) | (h1 >>> 19);
+ h1 = (h1 * 5 + 0xe6546b64) & 0xffffffff;
+
+ if (i >= len) {
+ break;
+ }
+
+ k1 = ((key.charCodeAt(i++) & 0xffff)) ^
+ ((key.charCodeAt(i++) & 0xffff) << 8) ^
+ ((key.charCodeAt(i++) & 0xffff) << 16);
+ top = key.charCodeAt(i++);
+ k1 ^= ((top & 0xff) << 24) ^
+ ((top & 0xff00) >> 8);
+ }
+
+ k1 = 0;
+ switch (this.rem) {
+ case 3: k1 ^= (key.charCodeAt(i + 2) & 0xffff) << 16;
+ case 2: k1 ^= (key.charCodeAt(i + 1) & 0xffff) << 8;
+ case 1: k1 ^= (key.charCodeAt(i) & 0xffff);
+ }
+
+ this.h1 = h1;
+ }
+
+ this.k1 = k1;
+ return this;
+ };
+
+ // Get the result of this hash
+ //
+ // @return {number} The 32-bit hash
+ MurmurHash3.prototype.result = function() {
+ var k1, h1;
+
+ k1 = this.k1;
+ h1 = this.h1;
+
+ if (k1 > 0) {
+ k1 = (k1 * 0x2d51 + (k1 & 0xffff) * 0xcc9e0000) & 0xffffffff;
+ k1 = (k1 << 15) | (k1 >>> 17);
+ k1 = (k1 * 0x3593 + (k1 & 0xffff) * 0x1b870000) & 0xffffffff;
+ h1 ^= k1;
+ }
+
+ h1 ^= this.len;
+
+ h1 ^= h1 >>> 16;
+ h1 = (h1 * 0xca6b + (h1 & 0xffff) * 0x85eb0000) & 0xffffffff;
+ h1 ^= h1 >>> 13;
+ h1 = (h1 * 0xae35 + (h1 & 0xffff) * 0xc2b20000) & 0xffffffff;
+ h1 ^= h1 >>> 16;
+
+ return h1 >>> 0;
+ };
+
+ // Reset the hash object for reuse
+ //
+ // @param {number} seed An optional positive integer
+ MurmurHash3.prototype.reset = function(seed) {
+ this.h1 = typeof seed === 'number' ? seed : 0;
+ this.rem = this.k1 = this.len = 0;
+ return this;
+ };
+
+ // A cached object to use. This can be safely used if you're in a single-
+ // threaded environment, otherwise you need to create new hashes to use.
+ cache = new MurmurHash3();
+
+ if (typeof(module) != 'undefined') {
+ module.exports = MurmurHash3;
+ } else {
+ this.MurmurHash3 = MurmurHash3;
+ }
+}());
diff --git a/deps/npm/node_modules/imurmurhash/imurmurhash.min.js b/deps/npm/node_modules/imurmurhash/imurmurhash.min.js
new file mode 100644
index 00000000000000..dc0ee88d6b69c9
--- /dev/null
+++ b/deps/npm/node_modules/imurmurhash/imurmurhash.min.js
@@ -0,0 +1,12 @@
+/**
+ * @preserve
+ * JS Implementation of incremental MurmurHash3 (r150) (as of May 10, 2013)
+ *
+ * @author Jens Taylor
+ * @see http://github.com/homebrewing/brauhaus-diff
+ * @author Gary Court
+ * @see http://github.com/garycourt/murmurhash-js
+ * @author Austin Appleby
+ * @see http://sites.google.com/site/murmurhash/
+ */
+!function(){function t(h,r){var s=this instanceof t?this:e;return s.reset(r),"string"==typeof h&&h.length>0&&s.hash(h),s!==this?s:void 0}var e;t.prototype.hash=function(t){var e,h,r,s,i;switch(i=t.length,this.len+=i,h=this.k1,r=0,this.rem){case 0:h^=i>r?65535&t.charCodeAt(r++):0;case 1:h^=i>r?(65535&t.charCodeAt(r++))<<8:0;case 2:h^=i>r?(65535&t.charCodeAt(r++))<<16:0;case 3:h^=i>r?(255&t.charCodeAt(r))<<24:0,h^=i>r?(65280&t.charCodeAt(r++))>>8:0}if(this.rem=3&i+this.rem,i-=this.rem,i>0){for(e=this.h1;;){if(h=4294967295&11601*h+3432906752*(65535&h),h=h<<15|h>>>17,h=4294967295&13715*h+461832192*(65535&h),e^=h,e=e<<13|e>>>19,e=4294967295&5*e+3864292196,r>=i)break;h=65535&t.charCodeAt(r++)^(65535&t.charCodeAt(r++))<<8^(65535&t.charCodeAt(r++))<<16,s=t.charCodeAt(r++),h^=(255&s)<<24^(65280&s)>>8}switch(h=0,this.rem){case 3:h^=(65535&t.charCodeAt(r+2))<<16;case 2:h^=(65535&t.charCodeAt(r+1))<<8;case 1:h^=65535&t.charCodeAt(r)}this.h1=e}return this.k1=h,this},t.prototype.result=function(){var t,e;return t=this.k1,e=this.h1,t>0&&(t=4294967295&11601*t+3432906752*(65535&t),t=t<<15|t>>>17,t=4294967295&13715*t+461832192*(65535&t),e^=t),e^=this.len,e^=e>>>16,e=4294967295&51819*e+2246770688*(65535&e),e^=e>>>13,e=4294967295&44597*e+3266445312*(65535&e),e^=e>>>16,e>>>0},t.prototype.reset=function(t){return this.h1="number"==typeof t?t:0,this.rem=this.k1=this.len=0,this},e=new t,"undefined"!=typeof module?module.exports=t:this.MurmurHash3=t}();
\ No newline at end of file
diff --git a/deps/npm/node_modules/imurmurhash/package.json b/deps/npm/node_modules/imurmurhash/package.json
new file mode 100644
index 00000000000000..d1e69bca8cc1b8
--- /dev/null
+++ b/deps/npm/node_modules/imurmurhash/package.json
@@ -0,0 +1,60 @@
+{
+ "name": "imurmurhash",
+ "version": "0.1.4",
+ "description": "An incremental implementation of MurmurHash3",
+ "homepage": "https://github.com/jensyt/imurmurhash-js",
+ "main": "imurmurhash.js",
+ "files": [
+ "imurmurhash.js",
+ "imurmurhash.min.js",
+ "package.json",
+ "README.md"
+ ],
+ "repository": {
+ "type": "git",
+ "url": "git+https://github.com/jensyt/imurmurhash-js.git"
+ },
+ "bugs": {
+ "url": "https://github.com/jensyt/imurmurhash-js/issues"
+ },
+ "keywords": [
+ "murmur",
+ "murmurhash",
+ "murmurhash3",
+ "hash",
+ "incremental"
+ ],
+ "author": {
+ "name": "Jens Taylor",
+ "email": "jensyt@gmail.com",
+ "url": "https://github.com/homebrewing"
+ },
+ "license": "MIT",
+ "dependencies": {},
+ "devDependencies": {},
+ "engines": {
+ "node": ">=0.8.19"
+ },
+ "readme": "iMurmurHash.js\n==============\n\nAn incremental implementation of the MurmurHash3 (32-bit) hashing algorithm for JavaScript based on [Gary Court's implementation](https://github.com/garycourt/murmurhash-js) with [kazuyukitanimura's modifications](https://github.com/kazuyukitanimura/murmurhash-js).\n\nThis version works significantly faster than the non-incremental version if you need to hash many small strings into a single hash, since string concatenation (to build the single string to pass the non-incremental version) is fairly costly. In one case tested, using the incremental version was about 50% faster than concatenating 5-10 strings and then hashing.\n\nInstallation\n------------\n\nTo use iMurmurHash in the browser, [download the latest version](https://raw.github.com/jensyt/imurmurhash-js/master/imurmurhash.min.js) and include it as a script on your site.\n\n```html\n\n\n```\n\n---\n\nTo use iMurmurHash in Node.js, install the module using NPM:\n\n```bash\nnpm install imurmurhash\n```\n\nThen simply include it in your scripts:\n\n```javascript\nMurmurHash3 = require('imurmurhash');\n```\n\nQuick Example\n-------------\n\n```javascript\n// Create the initial hash\nvar hashState = MurmurHash3('string');\n\n// Incrementally add text\nhashState.hash('more strings');\nhashState.hash('even more strings');\n\n// All calls can be chained if desired\nhashState.hash('and').hash('some').hash('more');\n\n// Get a result\nhashState.result();\n// returns 0xe4ccfe6b\n```\n\nFunctions\n---------\n\n### MurmurHash3 ([string], [seed])\nGet a hash state object, optionally initialized with the given _string_ and _seed_. _Seed_ must be a positive integer if provided. Calling this function without the `new` keyword will return a cached state object that has been reset. This is safe to use as long as the object is only used from a single thread and no other hashes are created while operating on this one. If this constraint cannot be met, you can use `new` to create a new state object. For example:\n\n```javascript\n// Use the cached object, calling the function again will return the same\n// object (but reset, so the current state would be lost)\nhashState = MurmurHash3();\n...\n\n// Create a new object that can be safely used however you wish. Calling the\n// function again will simply return a new state object, and no state loss\n// will occur, at the cost of creating more objects.\nhashState = new MurmurHash3();\n```\n\nBoth methods can be mixed however you like if you have different use cases.\n\n---\n\n### MurmurHash3.prototype.hash (string)\nIncrementally add _string_ to the hash. This can be called as many times as you want for the hash state object, including after a call to `result()`. Returns `this` so calls can be chained.\n\n---\n\n### MurmurHash3.prototype.result ()\nGet the result of the hash as a 32-bit positive integer. This performs the tail and finalizer portions of the algorithm, but does not store the result in the state object. This means that it is perfectly safe to get results and then continue adding strings via `hash`.\n\n```javascript\n// Do the whole string at once\nMurmurHash3('this is a test string').result();\n// 0x70529328\n\n// Do part of the string, get a result, then the other part\nvar m = MurmurHash3('this is a');\nm.result();\n// 0xbfc4f834\nm.hash(' test string').result();\n// 0x70529328 (same as above)\n```\n\n---\n\n### MurmurHash3.prototype.reset ([seed])\nReset the state object for reuse, optionally using the given _seed_ (defaults to 0 like the constructor). Returns `this` so calls can be chained.\n\n---\n\nLicense (MIT)\n-------------\nCopyright (c) 2013 Gary Court, Jens Taylor\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 of\nthe Software, 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",
+ "readmeFilename": "README.md",
+ "_id": "imurmurhash@0.1.4",
+ "dist": {
+ "shasum": "9218b9b2b928a238b13dc4fb6b6d576f231453ea",
+ "tarball": "http://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz"
+ },
+ "_from": "imurmurhash@0.1.4",
+ "_npmVersion": "1.3.2",
+ "_npmUser": {
+ "name": "jensyt",
+ "email": "jensyt@gmail.com"
+ },
+ "maintainers": [
+ {
+ "name": "jensyt",
+ "email": "jensyt@gmail.com"
+ }
+ ],
+ "directories": {},
+ "_shasum": "9218b9b2b928a238b13dc4fb6b6d576f231453ea",
+ "_resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz"
+}
diff --git a/deps/npm/node_modules/init-package-json/README.md b/deps/npm/node_modules/init-package-json/README.md
index 2cc79c4bf78100..bd64c1230986fc 100644
--- a/deps/npm/node_modules/init-package-json/README.md
+++ b/deps/npm/node_modules/init-package-json/README.md
@@ -41,5 +41,5 @@ Or from the command line:
$ npm-init
```
-See [PromZard](https://github.com/isaacs/promzard) for details about
+See [PromZard](https://github.com/npm/promzard) for details about
what can go in the config file.
diff --git a/deps/npm/node_modules/init-package-json/node_modules/glob/LICENSE b/deps/npm/node_modules/init-package-json/node_modules/glob/LICENSE
new file mode 100644
index 00000000000000..19129e315fe593
--- /dev/null
+++ b/deps/npm/node_modules/init-package-json/node_modules/glob/LICENSE
@@ -0,0 +1,15 @@
+The ISC License
+
+Copyright (c) Isaac Z. Schlueter and Contributors
+
+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/deps/npm/node_modules/init-package-json/node_modules/glob/README.md b/deps/npm/node_modules/init-package-json/node_modules/glob/README.md
new file mode 100644
index 00000000000000..6960483bac63c6
--- /dev/null
+++ b/deps/npm/node_modules/init-package-json/node_modules/glob/README.md
@@ -0,0 +1,359 @@
+# Glob
+
+Match files using the patterns the shell uses, like stars and stuff.
+
+[![Build Status](https://travis-ci.org/isaacs/node-glob.svg?branch=master)](https://travis-ci.org/isaacs/node-glob/) [![Build Status](https://ci.appveyor.com/api/projects/status/kd7f3yftf7unxlsx?svg=true)](https://ci.appveyor.com/project/isaacs/node-glob) [![Coverage Status](https://coveralls.io/repos/isaacs/node-glob/badge.svg?branch=master&service=github)](https://coveralls.io/github/isaacs/node-glob?branch=master)
+
+This is a glob implementation in JavaScript. It uses the `minimatch`
+library to do its matching.
+
+![](oh-my-glob.gif)
+
+## 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.
+})
+```
+
+## Glob Primer
+
+"Globs" are the patterns you type when you do stuff like `ls *.js` on
+the command line, or put `build/*` in a `.gitignore` file.
+
+Before parsing the path part patterns, braced sections are expanded
+into a set. Braced sections start with `{` and end with `}`, with any
+number of comma-delimited sections within. Braced sections may contain
+slash characters, so `a{/b/c,bcd}` would expand into `a/b/c` and `abcd`.
+
+The following characters have special magic meaning when used in a
+path portion:
+
+* `*` Matches 0 or more characters in a single path portion
+* `?` Matches 1 character
+* `[...]` Matches a range of characters, similar to a RegExp range.
+ If the first character of the range is `!` or `^` then it matches
+ any character not in the range.
+* `!(pattern|pattern|pattern)` Matches anything that does not match
+ any of the patterns provided.
+* `?(pattern|pattern|pattern)` Matches zero or one occurrence of the
+ patterns provided.
+* `+(pattern|pattern|pattern)` Matches one or more occurrences of the
+ patterns provided.
+* `*(a|b|c)` Matches zero or more occurrences of the patterns provided
+* `@(pattern|pat*|pat?erN)` Matches exactly one of the patterns
+ provided
+* `**` If a "globstar" is alone in a path portion, then it matches
+ zero or more directories and subdirectories searching for matches.
+ It does not crawl symlinked directories.
+
+### Dots
+
+If a file or directory path portion has a `.` as the first character,
+then it will not match any glob pattern unless that pattern's
+corresponding path part also has a `.` as its first character.
+
+For example, the pattern `a/.*/c` would match the file at `a/.b/c`.
+However the pattern `a/*/c` would not, because `*` does not start with
+a dot character.
+
+You can make glob treat dots as normal characters by setting
+`dot:true` in the options.
+
+### Basename Matching
+
+If you set `matchBase:true` in the options, and the pattern has no
+slashes in it, then it will seek for any file anywhere in the tree
+with a matching basename. For example, `*.js` would match
+`test/simple/basic.js`.
+
+### Empty Sets
+
+If no matching files are found, then an empty array is returned. This
+differs from the shell, where the pattern itself is returned. For
+example:
+
+ $ echo a*s*d*f
+ a*s*d*f
+
+To get the bash-style behavior, set the `nonull:true` in the options.
+
+### See Also:
+
+* `man sh`
+* `man bash` (Search for "Pattern Matching")
+* `man 3 fnmatch`
+* `man 5 gitignore`
+* [minimatch documentation](https://github.com/isaacs/minimatch)
+
+## glob.hasMagic(pattern, [options])
+
+Returns `true` if there are any special characters in the pattern, and
+`false` otherwise.
+
+Note that the options affect the results. If `noext:true` is set in
+the options object, then `+(a|b)` will not be considered a magic
+pattern. If the pattern has a brace expansion, like `a/{b/c,x/y}`
+then that is considered magical, unless `nobrace:true` is set in the
+options.
+
+## 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 instantiating 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.
+* `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.
+* `cache` Convenience object. Each field has the following possible
+ values:
+ * `false` - Path does not exist
+ * `true` - Path exists
+ * `'FILE'` - Path exists, and is not a directory
+ * `'DIR'` - Path exists, and is a directory
+ * `[file, entries, ...]` - Path exists, is a directory, and the
+ array value is the results of `fs.readdir`
+* `statCache` Cache of `fs.stat` results, to prevent statting the same
+ path multiple times.
+* `symlinks` A record of which paths are symbolic links, which is
+ relevant in resolving `**` patterns.
+* `realpathCache` An optional object which is passed to `fs.realpath`
+ to minimize unnecessary syscalls. It is stored on the instantiated
+ Glob object, and may be re-used.
+
+### 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 specific
+ thing that matched. It is not deduplicated or resolved to a realpath.
+* `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
+
+* `pause` Temporarily stop the search
+* `resume` Resume the search
+* `abort` Stop the search forever
+
+### 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.
+
+If you are running many `glob` operations, you can pass a Glob object
+as the `options` argument to a subsequent operation to shortcut some
+`stat` and `readdir` calls. At the very least, you may pass in shared
+`symlinks`, `statCache`, `realpathCache`, and `cache` options, so that
+parallel glob operations will be sped up by sharing information about
+the filesystem.
+
+* `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.
+* `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.)
+* `symlinks` A cache of known symbolic links. You may pass in a
+ previously generated `symlinks` object to save `lstat` calls when
+ resolving `**` matches.
+* `sync` DEPRECATED: use `glob.sync(pattern, opts)` instead.
+* `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).
+* `debug` Set to enable debug logging in minimatch and glob.
+* `nobrace` Do not expand `{a,b}` and `{1..3}` brace sets.
+* `noglobstar` Do not match `**` against multiple filenames. (Ie,
+ treat it as a normal `*` instead.)
+* `noext` Do not match `+(a|b)` "extglob" patterns.
+* `nocase` Perform a case-insensitive match. Note: on
+ case-insensitive filesystems, non-magic patterns will match by
+ default, since `stat` and `readdir` will not raise errors.
+* `matchBase` Perform a basename-only match if the pattern does not
+ contain any slash characters. That is, `*.js` would be treated as
+ equivalent to `**/*.js`, matching all js files in all directories.
+* `nodir` Do not match directories, only files. (Note: to match
+ *only* directories, simply put a `/` at the end of the pattern.)
+* `ignore` Add a pattern or an array of glob patterns to exclude matches.
+ Note: `ignore` patterns are *always* in `dot:true` mode, regardless
+ of any other settings.
+* `follow` Follow symlinked directories when expanding `**` patterns.
+ Note that this can result in a lot of duplicate references in the
+ presence of cyclic links.
+* `realpath` Set to true to call `fs.realpath` on all of the results.
+ In the case of a symlink that cannot be resolved, the full absolute
+ path to the matched entry is returned (though it will usually be a
+ broken symlink)
+
+## 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.
+
+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.3, 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 symlinked directories are not crawled as part of a `**`,
+though their contents may match against subsequent portions of the
+pattern. This prevents infinite loops and duplicates and the like.
+
+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.
+
+### Comments and Negation
+
+Previously, this module let you mark a pattern as a "comment" if it
+started with a `#` character, or a "negated" pattern if it started
+with a `!` character.
+
+These options were deprecated in version 5, and removed in version 6.
+
+To specify things that should not match, use the `ignore` option.
+
+## 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.
+
+## Contributing
+
+Any change to behavior (including bugfixes) must come with a test.
+
+Patches that fail tests or reduce performance will be rejected.
+
+```
+# to run tests
+npm test
+
+# to re-generate test fixtures
+npm run test-regen
+
+# to benchmark against bash/zsh
+npm run bench
+
+# to profile javascript
+npm run prof
+```
diff --git a/deps/npm/node_modules/init-package-json/node_modules/glob/common.js b/deps/npm/node_modules/init-package-json/node_modules/glob/common.js
new file mode 100644
index 00000000000000..c9127eb334f18b
--- /dev/null
+++ b/deps/npm/node_modules/init-package-json/node_modules/glob/common.js
@@ -0,0 +1,226 @@
+exports.alphasort = alphasort
+exports.alphasorti = alphasorti
+exports.setopts = setopts
+exports.ownProp = ownProp
+exports.makeAbs = makeAbs
+exports.finish = finish
+exports.mark = mark
+exports.isIgnored = isIgnored
+exports.childrenIgnored = childrenIgnored
+
+function ownProp (obj, field) {
+ return Object.prototype.hasOwnProperty.call(obj, field)
+}
+
+var path = require("path")
+var minimatch = require("minimatch")
+var isAbsolute = require("path-is-absolute")
+var Minimatch = minimatch.Minimatch
+
+function alphasorti (a, b) {
+ return a.toLowerCase().localeCompare(b.toLowerCase())
+}
+
+function alphasort (a, b) {
+ return a.localeCompare(b)
+}
+
+function setupIgnores (self, options) {
+ self.ignore = options.ignore || []
+
+ if (!Array.isArray(self.ignore))
+ self.ignore = [self.ignore]
+
+ if (self.ignore.length) {
+ self.ignore = self.ignore.map(ignoreMap)
+ }
+}
+
+// ignore patterns are always in dot:true mode.
+function ignoreMap (pattern) {
+ var gmatcher = null
+ if (pattern.slice(-3) === '/**') {
+ var gpattern = pattern.replace(/(\/\*\*)+$/, '')
+ gmatcher = new Minimatch(gpattern, { dot: true })
+ }
+
+ return {
+ matcher: new Minimatch(pattern, { dot: true }),
+ gmatcher: gmatcher
+ }
+}
+
+function setopts (self, pattern, options) {
+ if (!options)
+ options = {}
+
+ // 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
+ }
+
+ self.silent = !!options.silent
+ self.pattern = pattern
+ self.strict = options.strict !== false
+ self.realpath = !!options.realpath
+ self.realpathCache = options.realpathCache || Object.create(null)
+ self.follow = !!options.follow
+ self.dot = !!options.dot
+ self.mark = !!options.mark
+ self.nodir = !!options.nodir
+ if (self.nodir)
+ self.mark = true
+ self.sync = !!options.sync
+ self.nounique = !!options.nounique
+ self.nonull = !!options.nonull
+ self.nosort = !!options.nosort
+ self.nocase = !!options.nocase
+ self.stat = !!options.stat
+ self.noprocess = !!options.noprocess
+
+ self.maxLength = options.maxLength || Infinity
+ self.cache = options.cache || Object.create(null)
+ self.statCache = options.statCache || Object.create(null)
+ self.symlinks = options.symlinks || Object.create(null)
+
+ setupIgnores(self, options)
+
+ self.changedCwd = false
+ var cwd = process.cwd()
+ if (!ownProp(options, "cwd"))
+ self.cwd = cwd
+ else {
+ self.cwd = options.cwd
+ self.changedCwd = path.resolve(options.cwd) !== cwd
+ }
+
+ self.root = options.root || path.resolve(self.cwd, "/")
+ self.root = path.resolve(self.root)
+ if (process.platform === "win32")
+ self.root = self.root.replace(/\\/g, "/")
+
+ self.nomount = !!options.nomount
+
+ // disable comments and negation in Minimatch.
+ // Note that they are not supported in Glob itself anyway.
+ options.nonegate = true
+ options.nocomment = true
+
+ self.minimatch = new Minimatch(pattern, options)
+ self.options = self.minimatch.options
+}
+
+function finish (self) {
+ var nou = self.nounique
+ var all = nou ? [] : Object.create(null)
+
+ for (var i = 0, l = self.matches.length; i < l; i ++) {
+ var matches = self.matches[i]
+ if (!matches || Object.keys(matches).length === 0) {
+ if (self.nonull) {
+ // do like the shell, and spit out the literal glob
+ var literal = self.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 (!self.nosort)
+ all = all.sort(self.nocase ? alphasorti : alphasort)
+
+ // at *some* point we statted all of these
+ if (self.mark) {
+ for (var i = 0; i < all.length; i++) {
+ all[i] = self._mark(all[i])
+ }
+ if (self.nodir) {
+ all = all.filter(function (e) {
+ return !(/\/$/.test(e))
+ })
+ }
+ }
+
+ if (self.ignore.length)
+ all = all.filter(function(m) {
+ return !isIgnored(self, m)
+ })
+
+ self.found = all
+}
+
+function mark (self, p) {
+ var abs = makeAbs(self, p)
+ var c = self.cache[abs]
+ var m = p
+ if (c) {
+ var isDir = c === 'DIR' || Array.isArray(c)
+ var slash = p.slice(-1) === '/'
+
+ if (isDir && !slash)
+ m += '/'
+ else if (!isDir && slash)
+ m = m.slice(0, -1)
+
+ if (m !== p) {
+ var mabs = makeAbs(self, m)
+ self.statCache[mabs] = self.statCache[abs]
+ self.cache[mabs] = self.cache[abs]
+ }
+ }
+
+ return m
+}
+
+// lotta situps...
+function makeAbs (self, f) {
+ var abs = f
+ if (f.charAt(0) === '/') {
+ abs = path.join(self.root, f)
+ } else if (isAbsolute(f) || f === '') {
+ abs = f
+ } else if (self.changedCwd) {
+ abs = path.resolve(self.cwd, f)
+ } else {
+ abs = path.resolve(f)
+ }
+ return abs
+}
+
+
+// Return true, if pattern ends with globstar '**', for the accompanying parent directory.
+// Ex:- If node_modules/** is the pattern, add 'node_modules' to ignore list along with it's contents
+function isIgnored (self, path) {
+ if (!self.ignore.length)
+ return false
+
+ return self.ignore.some(function(item) {
+ return item.matcher.match(path) || !!(item.gmatcher && item.gmatcher.match(path))
+ })
+}
+
+function childrenIgnored (self, path) {
+ if (!self.ignore.length)
+ return false
+
+ return self.ignore.some(function(item) {
+ return !!(item.gmatcher && item.gmatcher.match(path))
+ })
+}
diff --git a/deps/npm/node_modules/init-package-json/node_modules/glob/glob.js b/deps/npm/node_modules/init-package-json/node_modules/glob/glob.js
new file mode 100644
index 00000000000000..a62da27ebd507a
--- /dev/null
+++ b/deps/npm/node_modules/init-package-json/node_modules/glob/glob.js
@@ -0,0 +1,765 @@
+// Approach:
+//
+// 1. Get the minimatch set
+// 2. For each pattern in the set, PROCESS(pattern, false)
+// 3. Store matches per-set, then uniq them
+//
+// PROCESS(pattern, inGlobStar)
+// 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.
+//
+// If inGlobStar and PREFIX is symlink and points to dir
+// set ENTRIES = []
+// else readdir(PREFIX) as ENTRIES
+// If fail, END
+//
+// with ENTRIES
+// 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 .. $], false)
+// // handle other cases.
+// for ENTRY in ENTRIES (not dotfiles)
+// // attach globstar + tail onto the entry
+// // Mark that this entry is a globstar match
+// PROCESS(pattern[0..n] + ENTRY + pattern[n .. $], true)
+//
+// 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')
+var minimatch = require('minimatch')
+var Minimatch = minimatch.Minimatch
+var inherits = require('inherits')
+var EE = require('events').EventEmitter
+var path = require('path')
+var assert = require('assert')
+var isAbsolute = require('path-is-absolute')
+var globSync = require('./sync.js')
+var common = require('./common.js')
+var alphasort = common.alphasort
+var alphasorti = common.alphasorti
+var setopts = common.setopts
+var ownProp = common.ownProp
+var inflight = require('inflight')
+var util = require('util')
+var childrenIgnored = common.childrenIgnored
+var isIgnored = common.isIgnored
+
+var once = require('once')
+
+function glob (pattern, options, cb) {
+ if (typeof options === 'function') cb = options, options = {}
+ if (!options) options = {}
+
+ if (options.sync) {
+ if (cb)
+ throw new TypeError('callback provided to sync glob')
+ return globSync(pattern, options)
+ }
+
+ return new Glob(pattern, options, cb)
+}
+
+glob.sync = globSync
+var GlobSync = glob.GlobSync = globSync.GlobSync
+
+// old api surface
+glob.glob = glob
+
+function extend (origin, add) {
+ if (add === null || typeof add !== 'object') {
+ return origin
+ }
+
+ var keys = Object.keys(add)
+ var i = keys.length
+ while (i--) {
+ origin[keys[i]] = add[keys[i]]
+ }
+ return origin
+}
+
+glob.hasMagic = function (pattern, options_) {
+ var options = extend({}, options_)
+ options.noprocess = true
+
+ var g = new Glob(pattern, options)
+ var set = g.minimatch.set
+ if (set.length > 1)
+ return true
+
+ for (var j = 0; j < set[0].length; j++) {
+ if (typeof set[0][j] !== 'string')
+ return true
+ }
+
+ return false
+}
+
+glob.Glob = Glob
+inherits(Glob, EE)
+function Glob (pattern, options, cb) {
+ if (typeof options === 'function') {
+ cb = options
+ options = null
+ }
+
+ if (options && options.sync) {
+ if (cb)
+ throw new TypeError('callback provided to sync glob')
+ return new GlobSync(pattern, options)
+ }
+
+ if (!(this instanceof Glob))
+ return new Glob(pattern, options, cb)
+
+ setopts(this, pattern, options)
+ this._didRealPath = false
+
+ // 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)
+
+ if (typeof cb === 'function') {
+ cb = once(cb)
+ this.on('error', cb)
+ this.on('end', function (matches) {
+ cb(null, matches)
+ })
+ }
+
+ var self = this
+ var n = this.minimatch.set.length
+ this._processing = 0
+ this.matches = new Array(n)
+
+ this._emitQueue = []
+ this._processQueue = []
+ this.paused = false
+
+ if (this.noprocess)
+ return this
+
+ if (n === 0)
+ return done()
+
+ for (var i = 0; i < n; i ++) {
+ this._process(this.minimatch.set[i], i, false, done)
+ }
+
+ function done () {
+ --self._processing
+ if (self._processing <= 0)
+ self._finish()
+ }
+}
+
+Glob.prototype._finish = function () {
+ assert(this instanceof Glob)
+ if (this.aborted)
+ return
+
+ if (this.realpath && !this._didRealpath)
+ return this._realpath()
+
+ common.finish(this)
+ this.emit('end', this.found)
+}
+
+Glob.prototype._realpath = function () {
+ if (this._didRealpath)
+ return
+
+ this._didRealpath = true
+
+ var n = this.matches.length
+ if (n === 0)
+ return this._finish()
+
+ var self = this
+ for (var i = 0; i < this.matches.length; i++)
+ this._realpathSet(i, next)
+
+ function next () {
+ if (--n === 0)
+ self._finish()
+ }
+}
+
+Glob.prototype._realpathSet = function (index, cb) {
+ var matchset = this.matches[index]
+ if (!matchset)
+ return cb()
+
+ var found = Object.keys(matchset)
+ var self = this
+ var n = found.length
+
+ if (n === 0)
+ return cb()
+
+ var set = this.matches[index] = Object.create(null)
+ found.forEach(function (p, i) {
+ // If there's a problem with the stat, then it means that
+ // one or more of the links in the realpath couldn't be
+ // resolved. just return the abs value in that case.
+ p = self._makeAbs(p)
+ fs.realpath(p, self.realpathCache, function (er, real) {
+ if (!er)
+ set[real] = true
+ else if (er.syscall === 'stat')
+ set[p] = true
+ else
+ self.emit('error', er) // srsly wtf right here
+
+ if (--n === 0) {
+ self.matches[index] = set
+ cb()
+ }
+ })
+ })
+}
+
+Glob.prototype._mark = function (p) {
+ return common.mark(this, p)
+}
+
+Glob.prototype._makeAbs = function (f) {
+ return common.makeAbs(this, f)
+}
+
+Glob.prototype.abort = function () {
+ this.aborted = true
+ this.emit('abort')
+}
+
+Glob.prototype.pause = function () {
+ if (!this.paused) {
+ this.paused = true
+ this.emit('pause')
+ }
+}
+
+Glob.prototype.resume = function () {
+ if (this.paused) {
+ this.emit('resume')
+ this.paused = false
+ if (this._emitQueue.length) {
+ var eq = this._emitQueue.slice(0)
+ this._emitQueue.length = 0
+ for (var i = 0; i < eq.length; i ++) {
+ var e = eq[i]
+ this._emitMatch(e[0], e[1])
+ }
+ }
+ if (this._processQueue.length) {
+ var pq = this._processQueue.slice(0)
+ this._processQueue.length = 0
+ for (var i = 0; i < pq.length; i ++) {
+ var p = pq[i]
+ this._processing--
+ this._process(p[0], p[1], p[2], p[3])
+ }
+ }
+ }
+}
+
+Glob.prototype._process = function (pattern, index, inGlobStar, cb) {
+ assert(this instanceof Glob)
+ assert(typeof cb === 'function')
+
+ if (this.aborted)
+ return
+
+ this._processing++
+ if (this.paused) {
+ this._processQueue.push([pattern, index, inGlobStar, cb])
+ return
+ }
+
+ //console.error('PROCESS %d', this._processing, pattern)
+
+ // 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:
+ this._processSimple(pattern.join('/'), index, 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).join('/')
+ break
+ }
+
+ var remain = pattern.slice(n)
+
+ // get the list of entries.
+ var read
+ if (prefix === null)
+ read = '.'
+ else if (isAbsolute(prefix) || isAbsolute(pattern.join('/'))) {
+ if (!prefix || !isAbsolute(prefix))
+ prefix = '/' + prefix
+ read = prefix
+ } else
+ read = prefix
+
+ var abs = this._makeAbs(read)
+
+ //if ignored, skip _processing
+ if (childrenIgnored(this, read))
+ return cb()
+
+ var isGlobStar = remain[0] === minimatch.GLOBSTAR
+ if (isGlobStar)
+ this._processGlobStar(prefix, read, abs, remain, index, inGlobStar, cb)
+ else
+ this._processReaddir(prefix, read, abs, remain, index, inGlobStar, cb)
+}
+
+Glob.prototype._processReaddir = function (prefix, read, abs, remain, index, inGlobStar, cb) {
+ var self = this
+ this._readdir(abs, inGlobStar, function (er, entries) {
+ return self._processReaddir2(prefix, read, abs, remain, index, inGlobStar, entries, cb)
+ })
+}
+
+Glob.prototype._processReaddir2 = function (prefix, read, abs, remain, index, inGlobStar, entries, cb) {
+
+ // if the abs isn't a dir, then nothing can match!
+ if (!entries)
+ return cb()
+
+ // 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 = remain[0]
+ var negate = !!this.minimatch.negate
+ var rawGlob = pn._glob
+ var dotOk = this.dot || rawGlob.charAt(0) === '.'
+
+ var matchedEntries = []
+ for (var i = 0; i < entries.length; i++) {
+ var e = entries[i]
+ if (e.charAt(0) !== '.' || dotOk) {
+ var m
+ if (negate && !prefix) {
+ m = !e.match(pn)
+ } else {
+ m = e.match(pn)
+ }
+ if (m)
+ matchedEntries.push(e)
+ }
+ }
+
+ //console.error('prd2', prefix, entries, remain[0]._glob, matchedEntries)
+
+ var len = matchedEntries.length
+ // If there are no matched entries, then nothing matches.
+ if (len === 0)
+ return cb()
+
+ // if this is the last remaining pattern bit, then no need for
+ // an additional stat *unless* the user has specified mark or
+ // stat explicitly. We know they exist, since readdir returned
+ // them.
+
+ if (remain.length === 1 && !this.mark && !this.stat) {
+ if (!this.matches[index])
+ this.matches[index] = Object.create(null)
+
+ for (var i = 0; i < len; i ++) {
+ var e = matchedEntries[i]
+ if (prefix) {
+ if (prefix !== '/')
+ e = prefix + '/' + e
+ else
+ e = prefix + e
+ }
+
+ if (e.charAt(0) === '/' && !this.nomount) {
+ e = path.join(this.root, e)
+ }
+ this._emitMatch(index, e)
+ }
+ // This was the last one, and no stats were needed
+ return cb()
+ }
+
+ // now test all matched entries as stand-ins for that part
+ // of the pattern.
+ remain.shift()
+ for (var i = 0; i < len; i ++) {
+ var e = matchedEntries[i]
+ var newPattern
+ if (prefix) {
+ if (prefix !== '/')
+ e = prefix + '/' + e
+ else
+ e = prefix + e
+ }
+ this._process([e].concat(remain), index, inGlobStar, cb)
+ }
+ cb()
+}
+
+Glob.prototype._emitMatch = function (index, e) {
+ if (this.aborted)
+ return
+
+ if (this.matches[index][e])
+ return
+
+ if (isIgnored(this, e))
+ return
+
+ if (this.paused) {
+ this._emitQueue.push([index, e])
+ return
+ }
+
+ var abs = this._makeAbs(e)
+
+ if (this.nodir) {
+ var c = this.cache[abs]
+ if (c === 'DIR' || Array.isArray(c))
+ return
+ }
+
+ if (this.mark)
+ e = this._mark(e)
+
+ this.matches[index][e] = true
+
+ var st = this.statCache[abs]
+ if (st)
+ this.emit('stat', e, st)
+
+ this.emit('match', e)
+}
+
+Glob.prototype._readdirInGlobStar = function (abs, cb) {
+ if (this.aborted)
+ return
+
+ // follow all symlinked directories forever
+ // just proceed as if this is a non-globstar situation
+ if (this.follow)
+ return this._readdir(abs, false, cb)
+
+ var lstatkey = 'lstat\0' + abs
+ var self = this
+ var lstatcb = inflight(lstatkey, lstatcb_)
+
+ if (lstatcb)
+ fs.lstat(abs, lstatcb)
+
+ function lstatcb_ (er, lstat) {
+ if (er)
+ return cb()
+
+ var isSym = lstat.isSymbolicLink()
+ self.symlinks[abs] = isSym
+
+ // If it's not a symlink or a dir, then it's definitely a regular file.
+ // don't bother doing a readdir in that case.
+ if (!isSym && !lstat.isDirectory()) {
+ self.cache[abs] = 'FILE'
+ cb()
+ } else
+ self._readdir(abs, false, cb)
+ }
+}
+
+Glob.prototype._readdir = function (abs, inGlobStar, cb) {
+ if (this.aborted)
+ return
+
+ cb = inflight('readdir\0'+abs+'\0'+inGlobStar, cb)
+ if (!cb)
+ return
+
+ //console.error('RD %j %j', +inGlobStar, abs)
+ if (inGlobStar && !ownProp(this.symlinks, abs))
+ return this._readdirInGlobStar(abs, cb)
+
+ if (ownProp(this.cache, abs)) {
+ var c = this.cache[abs]
+ if (!c || c === 'FILE')
+ return cb()
+
+ if (Array.isArray(c))
+ return cb(null, c)
+ }
+
+ var self = this
+ fs.readdir(abs, readdirCb(this, abs, cb))
+}
+
+function readdirCb (self, abs, cb) {
+ return function (er, entries) {
+ if (er)
+ self._readdirError(abs, er, cb)
+ else
+ self._readdirEntries(abs, entries, cb)
+ }
+}
+
+Glob.prototype._readdirEntries = function (abs, entries, cb) {
+ if (this.aborted)
+ return
+
+ // if we haven't asked to stat everything, then just
+ // assume that everything in there exists, so we can avoid
+ // having to stat it a second time.
+ if (!this.mark && !this.stat) {
+ for (var i = 0; i < entries.length; i ++) {
+ var e = entries[i]
+ if (abs === '/')
+ e = abs + e
+ else
+ e = abs + '/' + e
+ this.cache[e] = true
+ }
+ }
+
+ this.cache[abs] = entries
+ return cb(null, entries)
+}
+
+Glob.prototype._readdirError = function (f, er, cb) {
+ if (this.aborted)
+ return
+
+ // handle errors, and cache the information
+ switch (er.code) {
+ case 'ENOTSUP': // https://github.com/isaacs/node-glob/issues/205
+ case 'ENOTDIR': // totally normal. means it *does* exist.
+ this.cache[this._makeAbs(f)] = 'FILE'
+ break
+
+ case 'ENOENT': // not terribly unusual
+ case 'ELOOP':
+ case 'ENAMETOOLONG':
+ case 'UNKNOWN':
+ this.cache[this._makeAbs(f)] = false
+ break
+
+ default: // some unusual error. Treat as failure.
+ this.cache[this._makeAbs(f)] = false
+ if (this.strict) {
+ this.emit('error', er)
+ // If the error is handled, then we abort
+ // if not, we threw out of here
+ this.abort()
+ }
+ if (!this.silent)
+ console.error('glob error', er)
+ break
+ }
+
+ return cb()
+}
+
+Glob.prototype._processGlobStar = function (prefix, read, abs, remain, index, inGlobStar, cb) {
+ var self = this
+ this._readdir(abs, inGlobStar, function (er, entries) {
+ self._processGlobStar2(prefix, read, abs, remain, index, inGlobStar, entries, cb)
+ })
+}
+
+
+Glob.prototype._processGlobStar2 = function (prefix, read, abs, remain, index, inGlobStar, entries, cb) {
+ //console.error('pgs2', prefix, remain[0], entries)
+
+ // no entries means not a dir, so it can never have matches
+ // foo.txt/** doesn't match foo.txt
+ if (!entries)
+ return cb()
+
+ // test without the globstar, and with every child both below
+ // and replacing the globstar.
+ var remainWithoutGlobStar = remain.slice(1)
+ var gspref = prefix ? [ prefix ] : []
+ var noGlobStar = gspref.concat(remainWithoutGlobStar)
+
+ // the noGlobStar pattern exits the inGlobStar state
+ this._process(noGlobStar, index, false, cb)
+
+ var isSym = this.symlinks[abs]
+ var len = entries.length
+
+ // If it's a symlink, and we're in a globstar, then stop
+ if (isSym && inGlobStar)
+ return cb()
+
+ for (var i = 0; i < len; i++) {
+ var e = entries[i]
+ if (e.charAt(0) === '.' && !this.dot)
+ continue
+
+ // these two cases enter the inGlobStar state
+ var instead = gspref.concat(entries[i], remainWithoutGlobStar)
+ this._process(instead, index, true, cb)
+
+ var below = gspref.concat(entries[i], remain)
+ this._process(below, index, true, cb)
+ }
+
+ cb()
+}
+
+Glob.prototype._processSimple = function (prefix, index, cb) {
+ // XXX review this. Shouldn't it be doing the mounting etc
+ // before doing stat? kinda weird?
+ var self = this
+ this._stat(prefix, function (er, exists) {
+ self._processSimple2(prefix, index, er, exists, cb)
+ })
+}
+Glob.prototype._processSimple2 = function (prefix, index, er, exists, cb) {
+
+ //console.error('ps2', prefix, exists)
+
+ if (!this.matches[index])
+ this.matches[index] = Object.create(null)
+
+ // If it doesn't exist, then just mark the lack of results
+ if (!exists)
+ return cb()
+
+ if (prefix && isAbsolute(prefix) && !this.nomount) {
+ var trail = /[\/\\]$/.test(prefix)
+ if (prefix.charAt(0) === '/') {
+ prefix = path.join(this.root, prefix)
+ } else {
+ prefix = path.resolve(this.root, prefix)
+ if (trail)
+ prefix += '/'
+ }
+ }
+
+ if (process.platform === 'win32')
+ prefix = prefix.replace(/\\/g, '/')
+
+ // Mark this as a match
+ this._emitMatch(index, prefix)
+ cb()
+}
+
+// Returns either 'DIR', 'FILE', or false
+Glob.prototype._stat = function (f, cb) {
+ var abs = this._makeAbs(f)
+ var needDir = f.slice(-1) === '/'
+
+ if (f.length > this.maxLength)
+ return cb()
+
+ if (!this.stat && ownProp(this.cache, abs)) {
+ var c = this.cache[abs]
+
+ if (Array.isArray(c))
+ c = 'DIR'
+
+ // It exists, but maybe not how we need it
+ if (!needDir || c === 'DIR')
+ return cb(null, c)
+
+ if (needDir && c === 'FILE')
+ return cb()
+
+ // otherwise we have to stat, because maybe c=true
+ // if we know it exists, but not what it is.
+ }
+
+ var exists
+ var stat = this.statCache[abs]
+ if (stat !== undefined) {
+ if (stat === false)
+ return cb(null, stat)
+ else {
+ var type = stat.isDirectory() ? 'DIR' : 'FILE'
+ if (needDir && type === 'FILE')
+ return cb()
+ else
+ return cb(null, type, stat)
+ }
+ }
+
+ var self = this
+ var statcb = inflight('stat\0' + abs, lstatcb_)
+ if (statcb)
+ fs.lstat(abs, statcb)
+
+ function lstatcb_ (er, lstat) {
+ if (lstat && lstat.isSymbolicLink()) {
+ // If it's a symlink, then treat it as the target, unless
+ // the target does not exist, then treat it as a file.
+ return fs.stat(abs, function (er, stat) {
+ if (er)
+ self._stat2(f, abs, null, lstat, cb)
+ else
+ self._stat2(f, abs, er, stat, cb)
+ })
+ } else {
+ self._stat2(f, abs, er, lstat, cb)
+ }
+ }
+}
+
+Glob.prototype._stat2 = function (f, abs, er, stat, cb) {
+ if (er) {
+ this.statCache[abs] = false
+ return cb()
+ }
+
+ var needDir = f.slice(-1) === '/'
+ this.statCache[abs] = stat
+
+ if (abs.slice(-1) === '/' && !stat.isDirectory())
+ return cb(null, false, stat)
+
+ var c = stat.isDirectory() ? 'DIR' : 'FILE'
+ this.cache[abs] = this.cache[abs] || c
+
+ if (needDir && c !== 'DIR')
+ return cb()
+
+ return cb(null, c, stat)
+}
diff --git a/deps/npm/node_modules/init-package-json/node_modules/glob/node_modules/path-is-absolute/index.js b/deps/npm/node_modules/init-package-json/node_modules/glob/node_modules/path-is-absolute/index.js
new file mode 100644
index 00000000000000..19f103f908ac72
--- /dev/null
+++ b/deps/npm/node_modules/init-package-json/node_modules/glob/node_modules/path-is-absolute/index.js
@@ -0,0 +1,20 @@
+'use strict';
+
+function posix(path) {
+ return path.charAt(0) === '/';
+};
+
+function win32(path) {
+ // https://github.com/joyent/node/blob/b3fcc245fb25539909ef1d5eaa01dbf92e168633/lib/path.js#L56
+ var splitDeviceRe = /^([a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/]+[^\\\/]+)?([\\\/])?([\s\S]*?)$/;
+ var result = splitDeviceRe.exec(path);
+ var device = result[1] || '';
+ var isUnc = !!device && device.charAt(1) !== ':';
+
+ // UNC paths are always absolute
+ return !!result[2] || isUnc;
+};
+
+module.exports = process.platform === 'win32' ? win32 : posix;
+module.exports.posix = posix;
+module.exports.win32 = win32;
diff --git a/tools/eslint/node_modules/chalk/node_modules/ansi-styles/license b/deps/npm/node_modules/init-package-json/node_modules/glob/node_modules/path-is-absolute/license
similarity index 100%
rename from tools/eslint/node_modules/chalk/node_modules/ansi-styles/license
rename to deps/npm/node_modules/init-package-json/node_modules/glob/node_modules/path-is-absolute/license
diff --git a/deps/npm/node_modules/init-package-json/node_modules/glob/node_modules/path-is-absolute/package.json b/deps/npm/node_modules/init-package-json/node_modules/glob/node_modules/path-is-absolute/package.json
new file mode 100644
index 00000000000000..39372636f3fb4f
--- /dev/null
+++ b/deps/npm/node_modules/init-package-json/node_modules/glob/node_modules/path-is-absolute/package.json
@@ -0,0 +1,70 @@
+{
+ "name": "path-is-absolute",
+ "version": "1.0.0",
+ "description": "Node.js 0.12 path.isAbsolute() ponyfill",
+ "license": "MIT",
+ "repository": {
+ "type": "git",
+ "url": "git+https://github.com/sindresorhus/path-is-absolute.git"
+ },
+ "author": {
+ "name": "Sindre Sorhus",
+ "email": "sindresorhus@gmail.com",
+ "url": "sindresorhus.com"
+ },
+ "engines": {
+ "node": ">=0.10.0"
+ },
+ "scripts": {
+ "test": "node test.js"
+ },
+ "files": [
+ "index.js"
+ ],
+ "keywords": [
+ "path",
+ "paths",
+ "file",
+ "dir",
+ "absolute",
+ "isabsolute",
+ "is-absolute",
+ "built-in",
+ "util",
+ "utils",
+ "core",
+ "ponyfill",
+ "polyfill",
+ "shim",
+ "is",
+ "detect",
+ "check"
+ ],
+ "gitHead": "7a76a0c9f2263192beedbe0a820e4d0baee5b7a1",
+ "bugs": {
+ "url": "https://github.com/sindresorhus/path-is-absolute/issues"
+ },
+ "homepage": "https://github.com/sindresorhus/path-is-absolute",
+ "_id": "path-is-absolute@1.0.0",
+ "_shasum": "263dada66ab3f2fb10bf7f9d24dd8f3e570ef912",
+ "_from": "path-is-absolute@>=1.0.0 <2.0.0",
+ "_npmVersion": "2.5.1",
+ "_nodeVersion": "0.12.0",
+ "_npmUser": {
+ "name": "sindresorhus",
+ "email": "sindresorhus@gmail.com"
+ },
+ "maintainers": [
+ {
+ "name": "sindresorhus",
+ "email": "sindresorhus@gmail.com"
+ }
+ ],
+ "dist": {
+ "shasum": "263dada66ab3f2fb10bf7f9d24dd8f3e570ef912",
+ "tarball": "http://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.0.tgz"
+ },
+ "directories": {},
+ "_resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.0.tgz",
+ "readme": "ERROR: No README data found!"
+}
diff --git a/deps/npm/node_modules/init-package-json/node_modules/glob/node_modules/path-is-absolute/readme.md b/deps/npm/node_modules/init-package-json/node_modules/glob/node_modules/path-is-absolute/readme.md
new file mode 100644
index 00000000000000..cdf94f4309a27e
--- /dev/null
+++ b/deps/npm/node_modules/init-package-json/node_modules/glob/node_modules/path-is-absolute/readme.md
@@ -0,0 +1,51 @@
+# path-is-absolute [![Build Status](https://travis-ci.org/sindresorhus/path-is-absolute.svg?branch=master)](https://travis-ci.org/sindresorhus/path-is-absolute)
+
+> Node.js 0.12 [`path.isAbsolute()`](http://nodejs.org/api/path.html#path_path_isabsolute_path) ponyfill
+
+> Ponyfill: A polyfill that doesn't overwrite the native method
+
+
+## Install
+
+```
+$ npm install --save path-is-absolute
+```
+
+
+## Usage
+
+```js
+var pathIsAbsolute = require('path-is-absolute');
+
+// Linux
+pathIsAbsolute('/home/foo');
+//=> true
+
+// Windows
+pathIsAbsolute('C:/Users/');
+//=> true
+
+// Any OS
+pathIsAbsolute.posix('/home/foo');
+//=> true
+```
+
+
+## API
+
+See the [`path.isAbsolute()` docs](http://nodejs.org/api/path.html#path_path_isabsolute_path).
+
+### pathIsAbsolute(path)
+
+### pathIsAbsolute.posix(path)
+
+The Posix specific version.
+
+### pathIsAbsolute.win32(path)
+
+The Windows specific version.
+
+
+## License
+
+MIT © [Sindre Sorhus](http://sindresorhus.com)
diff --git a/deps/npm/node_modules/init-package-json/node_modules/glob/package.json b/deps/npm/node_modules/init-package-json/node_modules/glob/package.json
new file mode 100644
index 00000000000000..19e926cbf1035a
--- /dev/null
+++ b/deps/npm/node_modules/init-package-json/node_modules/glob/package.json
@@ -0,0 +1,73 @@
+{
+ "author": {
+ "name": "Isaac Z. Schlueter",
+ "email": "i@izs.me",
+ "url": "http://blog.izs.me/"
+ },
+ "name": "glob",
+ "description": "a little globber",
+ "version": "6.0.4",
+ "repository": {
+ "type": "git",
+ "url": "git://github.com/isaacs/node-glob.git"
+ },
+ "main": "glob.js",
+ "files": [
+ "glob.js",
+ "sync.js",
+ "common.js"
+ ],
+ "engines": {
+ "node": "*"
+ },
+ "dependencies": {
+ "inflight": "^1.0.4",
+ "inherits": "2",
+ "minimatch": "2 || 3",
+ "once": "^1.3.0",
+ "path-is-absolute": "^1.0.0"
+ },
+ "devDependencies": {
+ "mkdirp": "0",
+ "rimraf": "^2.2.8",
+ "tap": "^5.0.0",
+ "tick": "0.0.6"
+ },
+ "scripts": {
+ "prepublish": "npm run benchclean",
+ "profclean": "rm -f v8.log profile.txt",
+ "test": "tap test/*.js --cov",
+ "test-regen": "npm run profclean && TEST_REGEN=1 node test/00-setup.js",
+ "bench": "bash benchmark.sh",
+ "prof": "bash prof.sh && cat profile.txt",
+ "benchclean": "node benchclean.js"
+ },
+ "license": "ISC",
+ "gitHead": "3bd419c538737e56fda7e21c21ff52ca0c198df6",
+ "bugs": {
+ "url": "https://github.com/isaacs/node-glob/issues"
+ },
+ "homepage": "https://github.com/isaacs/node-glob#readme",
+ "_id": "glob@6.0.4",
+ "_shasum": "0f08860f6a155127b2fadd4f9ce24b1aab6e4d22",
+ "_from": "glob@>=6.0.0 <7.0.0",
+ "_npmVersion": "2.14.15",
+ "_nodeVersion": "4.0.0",
+ "_npmUser": {
+ "name": "isaacs",
+ "email": "i@izs.me"
+ },
+ "dist": {
+ "shasum": "0f08860f6a155127b2fadd4f9ce24b1aab6e4d22",
+ "tarball": "http://registry.npmjs.org/glob/-/glob-6.0.4.tgz"
+ },
+ "maintainers": [
+ {
+ "name": "isaacs",
+ "email": "i@izs.me"
+ }
+ ],
+ "directories": {},
+ "_resolved": "https://registry.npmjs.org/glob/-/glob-6.0.4.tgz",
+ "readme": "ERROR: No README data found!"
+}
diff --git a/deps/npm/node_modules/init-package-json/node_modules/glob/sync.js b/deps/npm/node_modules/init-package-json/node_modules/glob/sync.js
new file mode 100644
index 00000000000000..09883d2ce0c9de
--- /dev/null
+++ b/deps/npm/node_modules/init-package-json/node_modules/glob/sync.js
@@ -0,0 +1,460 @@
+module.exports = globSync
+globSync.GlobSync = GlobSync
+
+var fs = require('fs')
+var minimatch = require('minimatch')
+var Minimatch = minimatch.Minimatch
+var Glob = require('./glob.js').Glob
+var util = require('util')
+var path = require('path')
+var assert = require('assert')
+var isAbsolute = require('path-is-absolute')
+var common = require('./common.js')
+var alphasort = common.alphasort
+var alphasorti = common.alphasorti
+var setopts = common.setopts
+var ownProp = common.ownProp
+var childrenIgnored = common.childrenIgnored
+
+function globSync (pattern, options) {
+ if (typeof options === 'function' || arguments.length === 3)
+ throw new TypeError('callback provided to sync glob\n'+
+ 'See: https://github.com/isaacs/node-glob/issues/167')
+
+ return new GlobSync(pattern, options).found
+}
+
+function GlobSync (pattern, options) {
+ if (!pattern)
+ throw new Error('must provide pattern')
+
+ if (typeof options === 'function' || arguments.length === 3)
+ throw new TypeError('callback provided to sync glob\n'+
+ 'See: https://github.com/isaacs/node-glob/issues/167')
+
+ if (!(this instanceof GlobSync))
+ return new GlobSync(pattern, options)
+
+ setopts(this, pattern, options)
+
+ if (this.noprocess)
+ return this
+
+ var n = this.minimatch.set.length
+ this.matches = new Array(n)
+ for (var i = 0; i < n; i ++) {
+ this._process(this.minimatch.set[i], i, false)
+ }
+ this._finish()
+}
+
+GlobSync.prototype._finish = function () {
+ assert(this instanceof GlobSync)
+ if (this.realpath) {
+ var self = this
+ this.matches.forEach(function (matchset, index) {
+ var set = self.matches[index] = Object.create(null)
+ for (var p in matchset) {
+ try {
+ p = self._makeAbs(p)
+ var real = fs.realpathSync(p, self.realpathCache)
+ set[real] = true
+ } catch (er) {
+ if (er.syscall === 'stat')
+ set[self._makeAbs(p)] = true
+ else
+ throw er
+ }
+ }
+ })
+ }
+ common.finish(this)
+}
+
+
+GlobSync.prototype._process = function (pattern, index, inGlobStar) {
+ assert(this instanceof GlobSync)
+
+ // 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:
+ this._processSimple(pattern.join('/'), index)
+ 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).join('/')
+ break
+ }
+
+ var remain = pattern.slice(n)
+
+ // get the list of entries.
+ var read
+ if (prefix === null)
+ read = '.'
+ else if (isAbsolute(prefix) || isAbsolute(pattern.join('/'))) {
+ if (!prefix || !isAbsolute(prefix))
+ prefix = '/' + prefix
+ read = prefix
+ } else
+ read = prefix
+
+ var abs = this._makeAbs(read)
+
+ //if ignored, skip processing
+ if (childrenIgnored(this, read))
+ return
+
+ var isGlobStar = remain[0] === minimatch.GLOBSTAR
+ if (isGlobStar)
+ this._processGlobStar(prefix, read, abs, remain, index, inGlobStar)
+ else
+ this._processReaddir(prefix, read, abs, remain, index, inGlobStar)
+}
+
+
+GlobSync.prototype._processReaddir = function (prefix, read, abs, remain, index, inGlobStar) {
+ var entries = this._readdir(abs, inGlobStar)
+
+ // if the abs isn't a dir, then nothing can match!
+ if (!entries)
+ return
+
+ // 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 = remain[0]
+ var negate = !!this.minimatch.negate
+ var rawGlob = pn._glob
+ var dotOk = this.dot || rawGlob.charAt(0) === '.'
+
+ var matchedEntries = []
+ for (var i = 0; i < entries.length; i++) {
+ var e = entries[i]
+ if (e.charAt(0) !== '.' || dotOk) {
+ var m
+ if (negate && !prefix) {
+ m = !e.match(pn)
+ } else {
+ m = e.match(pn)
+ }
+ if (m)
+ matchedEntries.push(e)
+ }
+ }
+
+ var len = matchedEntries.length
+ // If there are no matched entries, then nothing matches.
+ if (len === 0)
+ return
+
+ // if this is the last remaining pattern bit, then no need for
+ // an additional stat *unless* the user has specified mark or
+ // stat explicitly. We know they exist, since readdir returned
+ // them.
+
+ if (remain.length === 1 && !this.mark && !this.stat) {
+ if (!this.matches[index])
+ this.matches[index] = Object.create(null)
+
+ for (var i = 0; i < len; i ++) {
+ var e = matchedEntries[i]
+ if (prefix) {
+ if (prefix.slice(-1) !== '/')
+ e = prefix + '/' + e
+ else
+ e = prefix + e
+ }
+
+ if (e.charAt(0) === '/' && !this.nomount) {
+ e = path.join(this.root, e)
+ }
+ this.matches[index][e] = true
+ }
+ // This was the last one, and no stats were needed
+ return
+ }
+
+ // now test all matched entries as stand-ins for that part
+ // of the pattern.
+ remain.shift()
+ for (var i = 0; i < len; i ++) {
+ var e = matchedEntries[i]
+ var newPattern
+ if (prefix)
+ newPattern = [prefix, e]
+ else
+ newPattern = [e]
+ this._process(newPattern.concat(remain), index, inGlobStar)
+ }
+}
+
+
+GlobSync.prototype._emitMatch = function (index, e) {
+ var abs = this._makeAbs(e)
+ if (this.mark)
+ e = this._mark(e)
+
+ if (this.matches[index][e])
+ return
+
+ if (this.nodir) {
+ var c = this.cache[this._makeAbs(e)]
+ if (c === 'DIR' || Array.isArray(c))
+ return
+ }
+
+ this.matches[index][e] = true
+ if (this.stat)
+ this._stat(e)
+}
+
+
+GlobSync.prototype._readdirInGlobStar = function (abs) {
+ // follow all symlinked directories forever
+ // just proceed as if this is a non-globstar situation
+ if (this.follow)
+ return this._readdir(abs, false)
+
+ var entries
+ var lstat
+ var stat
+ try {
+ lstat = fs.lstatSync(abs)
+ } catch (er) {
+ // lstat failed, doesn't exist
+ return null
+ }
+
+ var isSym = lstat.isSymbolicLink()
+ this.symlinks[abs] = isSym
+
+ // If it's not a symlink or a dir, then it's definitely a regular file.
+ // don't bother doing a readdir in that case.
+ if (!isSym && !lstat.isDirectory())
+ this.cache[abs] = 'FILE'
+ else
+ entries = this._readdir(abs, false)
+
+ return entries
+}
+
+GlobSync.prototype._readdir = function (abs, inGlobStar) {
+ var entries
+
+ if (inGlobStar && !ownProp(this.symlinks, abs))
+ return this._readdirInGlobStar(abs)
+
+ if (ownProp(this.cache, abs)) {
+ var c = this.cache[abs]
+ if (!c || c === 'FILE')
+ return null
+
+ if (Array.isArray(c))
+ return c
+ }
+
+ try {
+ return this._readdirEntries(abs, fs.readdirSync(abs))
+ } catch (er) {
+ this._readdirError(abs, er)
+ return null
+ }
+}
+
+GlobSync.prototype._readdirEntries = function (abs, entries) {
+ // if we haven't asked to stat everything, then just
+ // assume that everything in there exists, so we can avoid
+ // having to stat it a second time.
+ if (!this.mark && !this.stat) {
+ for (var i = 0; i < entries.length; i ++) {
+ var e = entries[i]
+ if (abs === '/')
+ e = abs + e
+ else
+ e = abs + '/' + e
+ this.cache[e] = true
+ }
+ }
+
+ this.cache[abs] = entries
+
+ // mark and cache dir-ness
+ return entries
+}
+
+GlobSync.prototype._readdirError = function (f, er) {
+ // handle errors, and cache the information
+ switch (er.code) {
+ case 'ENOTSUP': // https://github.com/isaacs/node-glob/issues/205
+ case 'ENOTDIR': // totally normal. means it *does* exist.
+ this.cache[this._makeAbs(f)] = 'FILE'
+ break
+
+ case 'ENOENT': // not terribly unusual
+ case 'ELOOP':
+ case 'ENAMETOOLONG':
+ case 'UNKNOWN':
+ this.cache[this._makeAbs(f)] = false
+ break
+
+ default: // some unusual error. Treat as failure.
+ this.cache[this._makeAbs(f)] = false
+ if (this.strict)
+ throw er
+ if (!this.silent)
+ console.error('glob error', er)
+ break
+ }
+}
+
+GlobSync.prototype._processGlobStar = function (prefix, read, abs, remain, index, inGlobStar) {
+
+ var entries = this._readdir(abs, inGlobStar)
+
+ // no entries means not a dir, so it can never have matches
+ // foo.txt/** doesn't match foo.txt
+ if (!entries)
+ return
+
+ // test without the globstar, and with every child both below
+ // and replacing the globstar.
+ var remainWithoutGlobStar = remain.slice(1)
+ var gspref = prefix ? [ prefix ] : []
+ var noGlobStar = gspref.concat(remainWithoutGlobStar)
+
+ // the noGlobStar pattern exits the inGlobStar state
+ this._process(noGlobStar, index, false)
+
+ var len = entries.length
+ var isSym = this.symlinks[abs]
+
+ // If it's a symlink, and we're in a globstar, then stop
+ if (isSym && inGlobStar)
+ return
+
+ for (var i = 0; i < len; i++) {
+ var e = entries[i]
+ if (e.charAt(0) === '.' && !this.dot)
+ continue
+
+ // these two cases enter the inGlobStar state
+ var instead = gspref.concat(entries[i], remainWithoutGlobStar)
+ this._process(instead, index, true)
+
+ var below = gspref.concat(entries[i], remain)
+ this._process(below, index, true)
+ }
+}
+
+GlobSync.prototype._processSimple = function (prefix, index) {
+ // XXX review this. Shouldn't it be doing the mounting etc
+ // before doing stat? kinda weird?
+ var exists = this._stat(prefix)
+
+ if (!this.matches[index])
+ this.matches[index] = Object.create(null)
+
+ // If it doesn't exist, then just mark the lack of results
+ if (!exists)
+ return
+
+ if (prefix && isAbsolute(prefix) && !this.nomount) {
+ var trail = /[\/\\]$/.test(prefix)
+ if (prefix.charAt(0) === '/') {
+ prefix = path.join(this.root, prefix)
+ } else {
+ prefix = path.resolve(this.root, prefix)
+ if (trail)
+ prefix += '/'
+ }
+ }
+
+ if (process.platform === 'win32')
+ prefix = prefix.replace(/\\/g, '/')
+
+ // Mark this as a match
+ this.matches[index][prefix] = true
+}
+
+// Returns either 'DIR', 'FILE', or false
+GlobSync.prototype._stat = function (f) {
+ var abs = this._makeAbs(f)
+ var needDir = f.slice(-1) === '/'
+
+ if (f.length > this.maxLength)
+ return false
+
+ if (!this.stat && ownProp(this.cache, abs)) {
+ var c = this.cache[abs]
+
+ if (Array.isArray(c))
+ c = 'DIR'
+
+ // It exists, but maybe not how we need it
+ if (!needDir || c === 'DIR')
+ return c
+
+ if (needDir && c === 'FILE')
+ return false
+
+ // otherwise we have to stat, because maybe c=true
+ // if we know it exists, but not what it is.
+ }
+
+ var exists
+ var stat = this.statCache[abs]
+ if (!stat) {
+ var lstat
+ try {
+ lstat = fs.lstatSync(abs)
+ } catch (er) {
+ return false
+ }
+
+ if (lstat.isSymbolicLink()) {
+ try {
+ stat = fs.statSync(abs)
+ } catch (er) {
+ stat = lstat
+ }
+ } else {
+ stat = lstat
+ }
+ }
+
+ this.statCache[abs] = stat
+
+ var c = stat.isDirectory() ? 'DIR' : 'FILE'
+ this.cache[abs] = this.cache[abs] || c
+
+ if (needDir && c !== 'DIR')
+ return false
+
+ return c
+}
+
+GlobSync.prototype._mark = function (p) {
+ return common.mark(this, p)
+}
+
+GlobSync.prototype._makeAbs = function (f) {
+ return common.makeAbs(this, f)
+}
diff --git a/deps/npm/node_modules/init-package-json/node_modules/promzard/package.json b/deps/npm/node_modules/init-package-json/node_modules/promzard/package.json
index 1407e97be584d7..42900314b94c93 100644
--- a/deps/npm/node_modules/init-package-json/node_modules/promzard/package.json
+++ b/deps/npm/node_modules/init-package-json/node_modules/promzard/package.json
@@ -8,7 +8,7 @@
"description": "prompting wizardly",
"version": "0.3.0",
"repository": {
- "url": "git://github.com/isaacs/promzard.git"
+ "url": "git://github.com/isaacs/promzard"
},
"dependencies": {
"read": "1"
@@ -46,6 +46,5 @@
"tarball": "http://registry.npmjs.org/promzard/-/promzard-0.3.0.tgz"
},
"directories": {},
- "_resolved": "https://registry.npmjs.org/promzard/-/promzard-0.3.0.tgz",
- "readme": "ERROR: No README data found!"
+ "_resolved": "https://registry.npmjs.org/promzard/-/promzard-0.3.0.tgz"
}
diff --git a/deps/npm/node_modules/init-package-json/package.json b/deps/npm/node_modules/init-package-json/package.json
index 0cc543ece404f1..4be24267cfe9fc 100644
--- a/deps/npm/node_modules/init-package-json/package.json
+++ b/deps/npm/node_modules/init-package-json/package.json
@@ -1,13 +1,13 @@
{
"name": "init-package-json",
- "version": "1.9.1",
+ "version": "1.9.3",
"main": "init-package-json.js",
"scripts": {
"test": "tap test/*.js"
},
"repository": {
"type": "git",
- "url": "git://github.com/isaacs/init-package-json.git"
+ "url": "git+https://github.com/npm/init-package-json.git"
},
"author": {
"name": "Isaac Z. Schlueter",
@@ -17,7 +17,7 @@
"license": "ISC",
"description": "A node module to get your node module started",
"dependencies": {
- "glob": "^5.0.3",
+ "glob": "^6.0.0",
"npm-package-arg": "^4.0.0",
"promzard": "^0.3.0",
"read": "~1.0.1",
@@ -41,23 +41,23 @@
"prompt",
"start"
],
- "gitHead": "37c38b4e23189eb5645901fa6851f343fddd4b73",
+ "gitHead": "12eb24ff2f75f84a4a27436bc6f6cb765cbd9ee2",
"bugs": {
- "url": "https://github.com/isaacs/init-package-json/issues"
+ "url": "https://github.com/npm/init-package-json/issues"
},
- "homepage": "https://github.com/isaacs/init-package-json#readme",
- "_id": "init-package-json@1.9.1",
- "_shasum": "a28e05b5baeb3363cd473df68d30d3a80523a31c",
- "_from": "init-package-json@1.9.1",
- "_npmVersion": "2.14.1",
- "_nodeVersion": "2.2.2",
+ "homepage": "https://github.com/npm/init-package-json#readme",
+ "_id": "init-package-json@1.9.3",
+ "_shasum": "ca2ff94709b6d9aaad66533c11a0aff645f15c7d",
+ "_from": "init-package-json@1.9.3",
+ "_npmVersion": "3.5.4",
+ "_nodeVersion": "4.2.2",
"_npmUser": {
- "name": "zkat",
- "email": "kat@sykosomatic.org"
+ "name": "iarna",
+ "email": "me@re-becca.org"
},
"dist": {
- "shasum": "a28e05b5baeb3363cd473df68d30d3a80523a31c",
- "tarball": "http://registry.npmjs.org/init-package-json/-/init-package-json-1.9.1.tgz"
+ "shasum": "ca2ff94709b6d9aaad66533c11a0aff645f15c7d",
+ "tarball": "http://registry.npmjs.org/init-package-json/-/init-package-json-1.9.3.tgz"
},
"maintainers": [
{
@@ -78,5 +78,5 @@
}
],
"directories": {},
- "_resolved": "https://registry.npmjs.org/init-package-json/-/init-package-json-1.9.1.tgz"
+ "_resolved": "https://registry.npmjs.org/init-package-json/-/init-package-json-1.9.3.tgz"
}
diff --git a/deps/npm/node_modules/lru-cache/README.md b/deps/npm/node_modules/lru-cache/README.md
index 3fd6d0bcae478e..f804699809b9b9 100644
--- a/deps/npm/node_modules/lru-cache/README.md
+++ b/deps/npm/node_modules/lru-cache/README.md
@@ -7,7 +7,7 @@ A cache object that deletes the least-recently-used items.
```javascript
var LRU = require("lru-cache")
, options = { max: 500
- , length: function (n) { return n * 2 }
+ , length: function (n, key) { return n * 2 + key.length }
, dispose: function (key, n) { n.close() }
, maxAge: 1000 * 60 * 60 }
, cache = LRU(options)
@@ -16,6 +16,12 @@ var LRU = require("lru-cache")
cache.set("key", "value")
cache.get("key") // "value"
+// non-string keys ARE fully supported
+var someObject = {}
+cache.set(someObject, 'a value')
+cache.set('[object Object]', 'a different value')
+assert.equal(cache.get(someObject), 'a value')
+
cache.reset() // empty the cache
```
@@ -35,9 +41,10 @@ away.
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 `max`
- like-sized things.
+ to do something like `function(n, key){return n.length}`. The default is
+ `function(){return 1}`, which is fine if you want to store `max`
+ like-sized things. They item is passed as the first argument, and
+ the key is passed as the second argumnet.
* `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
@@ -89,6 +96,12 @@ away.
in the cache, in order of recent-ness. (Ie, more recently used
items are iterated over first.)
+* `rforEach(function(value,key,cache), [thisp])`
+
+ The same as `cache.forEach(...)` but items are iterated over in
+ reverse order. (ie, less recently used items are iterated over
+ first.)
+
* `keys()`
Return an array of the keys in the cache.
diff --git a/deps/npm/node_modules/lru-cache/lib/lru-cache.js b/deps/npm/node_modules/lru-cache/lib/lru-cache.js
index 32c2d2d90be150..dccc6d59d27e15 100644
--- a/deps/npm/node_modules/lru-cache/lib/lru-cache.js
+++ b/deps/npm/node_modules/lru-cache/lib/lru-cache.js
@@ -1,15 +1,8 @@
-;(function () { // closure for web browsers
+module.exports = LRUCache
-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)
-}
+// This will be a proper iterable 'Map' in engines that support it,
+// or a fakey-fake PseudoMap in older versions.
+var Map = require('pseudomap')
function naiveLength () { return 1 }
@@ -54,17 +47,17 @@ Object.defineProperty(LRUCache.prototype, "lengthCalculator",
{ set : function (lC) {
if (typeof lC !== "function") {
this._lengthCalculator = naiveLength
- this._length = this._itemCount
- for (var key in this._cache) {
- this._cache[key].length = 1
- }
+ this._length = this._lruList.size
+ this._cache.forEach(function (value, key) {
+ value.length = 1
+ })
} else {
this._lengthCalculator = lC
this._length = 0
- for (var key in this._cache) {
- this._cache[key].length = this._lengthCalculator(this._cache[key].value)
- this._length += this._cache[key].length
- }
+ this._cache.forEach(function (value, key) {
+ value.length = this._lengthCalculator(value.value, key)
+ this._length += value.length
+ }, this)
}
if (this._length > this._max) trim(this)
@@ -78,83 +71,97 @@ Object.defineProperty(LRUCache.prototype, "length",
, enumerable : true
})
-
Object.defineProperty(LRUCache.prototype, "itemCount",
- { get : function () { return this._itemCount }
+ { get : function () { return this._lruList.size }
, enumerable : true
})
-LRUCache.prototype.forEach = function (fn, thisp) {
+function reverseKeys (map) {
+ // keys live in lruList map in insertion order.
+ // we want them in reverse insertion order.
+ // flip the list of keys.
+ var itemCount = map.size
+ var keys = new Array(itemCount)
+ var i = itemCount
+ map.forEach(function (value, key) {
+ keys[--i] = key
+ })
+
+ return keys
+}
+
+LRUCache.prototype.rforEach = function (fn, thisp) {
thisp = thisp || this
- var i = 0
- var itemCount = this._itemCount
-
- for (var k = this._mru - 1; k >= 0 && i < itemCount; k--) if (this._lruList[k]) {
- i++
- var hit = this._lruList[k]
- if (isStale(this, hit)) {
- del(this, hit)
- if (!this._allowStale) hit = undefined
- }
- if (hit) {
- fn.call(thisp, hit.value, hit.key, this)
+ this._lruList.forEach(function (hit) {
+ forEachStep(this, fn, hit, thisp)
+ }, this)
+}
+
+function forEachStep (self, fn, hit, thisp) {
+ if (isStale(self, hit)) {
+ del(self, hit)
+ if (!self._allowStale) {
+ hit = undefined
}
}
+ if (hit) {
+ fn.call(thisp, hit.value, hit.key, self)
+ }
}
-LRUCache.prototype.keys = function () {
- var keys = new Array(this._itemCount)
- var i = 0
- for (var k = this._mru - 1; k >= 0 && i < this._itemCount; k--) if (this._lruList[k]) {
- var hit = this._lruList[k]
- keys[i++] = hit.key
+
+LRUCache.prototype.forEach = function (fn, thisp) {
+ thisp = thisp || this
+
+ var keys = reverseKeys(this._lruList)
+ for (var k = 0; k < keys.length; k++) {
+ var hit = this._lruList.get(keys[k])
+ forEachStep(this, fn, hit, thisp)
}
- return keys
+}
+
+LRUCache.prototype.keys = function () {
+ return reverseKeys(this._lruList).map(function (k) {
+ return this._lruList.get(k).key
+ }, this)
}
LRUCache.prototype.values = function () {
- var values = new Array(this._itemCount)
- var i = 0
- for (var k = this._mru - 1; k >= 0 && i < this._itemCount; k--) if (this._lruList[k]) {
- var hit = this._lruList[k]
- values[i++] = hit.value
- }
- return values
+ return reverseKeys(this._lruList).map(function (k) {
+ return this._lruList.get(k).value
+ }, this)
}
LRUCache.prototype.reset = function () {
if (this._dispose && this._cache) {
- for (var k in this._cache) {
- this._dispose(k, this._cache[k].value)
- }
+ this._cache.forEach(function (entry, key) {
+ this._dispose(key, entry.value)
+ }, this)
}
- this._cache = Object.create(null) // hash of items by key
- this._lruList = Object.create(null) // list of items in order of use recency
+ this._cache = new Map() // hash of items by key
+ this._lruList = new Map() // list of items in order of use recency
this._mru = 0 // most recently used
this._lru = 0 // least recently used
this._length = 0 // number of items in the list
- this._itemCount = 0
}
LRUCache.prototype.dump = function () {
var arr = []
var i = 0
-
- for (var k = this._mru - 1; k >= 0 && i < this._itemCount; k--) if (this._lruList[k]) {
- var hit = this._lruList[k]
+ var size = this._lruList.size
+ return reverseKeys(this._lruList).map(function (k) {
+ var hit = this._lruList.get(k)
if (!isStale(this, hit)) {
- //Do not store staled hits
- ++i
- arr.push({
+ return {
k: hit.key,
v: hit.value,
e: hit.now + (hit.maxAge || 0)
- });
+ }
}
- }
- //arr has the most read first
- return arr
+ }, this).filter(function (h) {
+ return h
+ })
}
LRUCache.prototype.dumpLru = function () {
@@ -163,23 +170,27 @@ LRUCache.prototype.dumpLru = function () {
LRUCache.prototype.set = function (key, value, maxAge) {
maxAge = maxAge || this._maxAge
+
var now = maxAge ? Date.now() : 0
- var len = this._lengthCalculator(value)
+ var len = this._lengthCalculator(value, key)
- if (hOP(this._cache, key)) {
+ if (this._cache.has(key)) {
if (len > this._max) {
- del(this, this._cache[key])
+ del(this, this._cache.get(key))
return false
}
+
+ var item = this._cache.get(key)
+
// dispose of the old one before overwriting
if (this._dispose)
- this._dispose(key, this._cache[key].value)
+ this._dispose(key, item.value)
- this._cache[key].now = now
- this._cache[key].maxAge = maxAge
- this._cache[key].value = value
- this._length += (len - this._cache[key].length)
- this._cache[key].length = len
+ item.now = now
+ item.maxAge = maxAge
+ item.value = value
+ this._length += (len - item.length)
+ item.length = len
this.get(key)
if (this._length > this._max)
@@ -188,7 +199,8 @@ LRUCache.prototype.set = function (key, value, maxAge) {
return true
}
- var hit = new Entry(key, value, this._mru++, len, now, maxAge)
+ var hit = new Entry(key, value, this._mru, len, now, maxAge)
+ incMru(this)
// oversized objects fall out of cache automatically.
if (hit.length > this._max) {
@@ -197,8 +209,8 @@ LRUCache.prototype.set = function (key, value, maxAge) {
}
this._length += hit.length
- this._lruList[hit.lu] = this._cache[key] = hit
- this._itemCount ++
+ this._cache.set(key, hit)
+ this._lruList.set(hit.lu, hit)
if (this._length > this._max)
trim(this)
@@ -207,8 +219,8 @@ LRUCache.prototype.set = function (key, value, maxAge) {
}
LRUCache.prototype.has = function (key) {
- if (!hOP(this._cache, key)) return false
- var hit = this._cache[key]
+ if (!this._cache.has(key)) return false
+ var hit = this._cache.get(key)
if (isStale(this, hit)) {
return false
}
@@ -224,13 +236,13 @@ LRUCache.prototype.peek = function (key) {
}
LRUCache.prototype.pop = function () {
- var hit = this._lruList[this._lru]
+ var hit = this._lruList.get(this._lru)
del(this, hit)
return hit || null
}
LRUCache.prototype.del = function (key) {
- del(this, this._cache[key])
+ del(this, this._cache.get(key))
}
LRUCache.prototype.load = function (arr) {
@@ -238,23 +250,25 @@ LRUCache.prototype.load = function (arr) {
this.reset();
var now = Date.now()
- //A previous serialized cache has the most recent items first
- for (var l = arr.length - 1; l >= 0; l-- ) {
+ // A previous serialized cache has the most recent items first
+ for (var l = arr.length - 1; l >= 0; l--) {
var hit = arr[l]
var expiresAt = hit.e || 0
if (expiresAt === 0) {
- //the item was created without expiration in a non aged cache
+ // the item was created without expiration in a non aged cache
this.set(hit.k, hit.v)
} else {
var maxAge = expiresAt - now
- //dont add already expired items
- if (maxAge > 0) this.set(hit.k, hit.v, maxAge)
+ // dont add already expired items
+ if (maxAge > 0) {
+ this.set(hit.k, hit.v, maxAge)
+ }
}
}
}
function get (self, key, doUse) {
- var hit = self._cache[key]
+ var hit = self._cache.get(key)
if (hit) {
if (isStale(self, hit)) {
del(self, hit)
@@ -281,26 +295,35 @@ function isStale(self, hit) {
function use (self, hit) {
shiftLU(self, hit)
- hit.lu = self._mru ++
- self._lruList[hit.lu] = hit
+ hit.lu = self._mru
+ incMru(self)
+ self._lruList.set(hit.lu, hit)
}
function trim (self) {
- while (self._lru < self._mru && self._length > self._max)
- del(self, self._lruList[self._lru])
+ if (self._length > self._max) {
+ var keys = reverseKeys(self._lruList)
+ for (var k = keys.length - 1; self._length > self._max; k--) {
+ // We know that we're about to delete this one, and also
+ // what the next least recently used key will be, so just
+ // go ahead and set it now.
+ self._lru = keys[k - 1]
+ del(self, self._lruList.get(keys[k]))
+ }
+ }
}
function shiftLU (self, hit) {
- delete self._lruList[ hit.lu ]
- while (self._lru < self._mru && !self._lruList[self._lru]) self._lru ++
+ self._lruList.delete(hit.lu)
+ if (hit.lu === self._lru)
+ self._lru = reverseKeys(self._lruList).pop()
}
function del (self, hit) {
if (hit) {
if (self._dispose) self._dispose(hit.key, hit.value)
self._length -= hit.length
- self._itemCount --
- delete self._cache[ hit.key ]
+ self._cache.delete(hit.key)
shiftLU(self, hit)
}
}
@@ -315,4 +338,19 @@ function Entry (key, value, lu, length, now, maxAge) {
if (maxAge) this.maxAge = maxAge
}
-})()
+
+// Incrementers and decrementers that loop at MAX_SAFE_INTEGER
+// only relevant for the lu, lru, and mru counters, since they
+// get touched a lot and can get very large. Also, since they
+// only go upwards, and the sets will tend to be much smaller than
+// the max, we can very well assume that a very small number comes
+// after a very large number, rather than before it.
+var maxSafeInt = Number.MAX_SAFE_INTEGER || 9007199254740991
+function intInc (number) {
+ return (number === maxSafeInt) ? 0 : number + 1
+}
+function incMru (self) {
+ do {
+ self._mru = intInc(self._mru)
+ } while (self._lruList.has(self._mru))
+}
diff --git a/deps/npm/node_modules/lru-cache/node_modules/pseudomap/LICENSE b/deps/npm/node_modules/lru-cache/node_modules/pseudomap/LICENSE
new file mode 100644
index 00000000000000..19129e315fe593
--- /dev/null
+++ b/deps/npm/node_modules/lru-cache/node_modules/pseudomap/LICENSE
@@ -0,0 +1,15 @@
+The ISC License
+
+Copyright (c) Isaac Z. Schlueter and Contributors
+
+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/deps/npm/node_modules/lru-cache/node_modules/pseudomap/README.md b/deps/npm/node_modules/lru-cache/node_modules/pseudomap/README.md
new file mode 100644
index 00000000000000..778bf01dfaaf9f
--- /dev/null
+++ b/deps/npm/node_modules/lru-cache/node_modules/pseudomap/README.md
@@ -0,0 +1,60 @@
+# pseudomap
+
+A thing that is a lot like ES6 `Map`, but without iterators, for use
+in environments where `for..of` syntax and `Map` are not available.
+
+If you need iterators, or just in general a more faithful polyfill to
+ES6 Maps, check out [es6-map](http://npm.im/es6-map).
+
+If you are in an environment where `Map` is supported, then that will
+be returned instead, unless `process.env.TEST_PSEUDOMAP` is set.
+
+You can use any value as keys, and any value as data. Setting again
+with the identical key will overwrite the previous value.
+
+Internally, data is stored on an `Object.create(null)` style object.
+The key is coerced to a string to generate the key on the internal
+data-bag object. The original key used is stored along with the data.
+
+In the event of a stringified-key collision, a new key is generated by
+appending an increasing number to the stringified-key until finding
+either the intended key or an empty spot.
+
+Note that because object traversal order of plain objects is not
+guaranteed to be identical to insertion order, the insertion order
+guarantee of `Map.prototype.forEach` is not guaranteed in this
+implementation. However, in all versions of Node.js and V8 where this
+module works, `forEach` does traverse data in insertion order.
+
+## API
+
+Most of the [Map
+API](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map),
+with the following exceptions:
+
+1. A `Map` object is not an iterator.
+2. `values`, `keys`, and `entries` methods are not implemented,
+ because they return iterators.
+3. The argument to the constructor can be an Array of `[key, value]`
+ pairs, or a `Map` or `PseudoMap` object. But, since iterators
+ aren't used, passing any plain-old iterator won't initialize the
+ map properly.
+
+## USAGE
+
+Use just like a regular ES6 Map.
+
+```javascript
+var PseudoMap = require('pseudomap')
+
+// optionally provide a pseudomap, or an array of [key,value] pairs
+// as the argument to initialize the map with
+var myMap = new PseudoMap()
+
+myMap.set(1, 'number 1')
+myMap.set('1', 'string 1')
+var akey = {}
+var bkey = {}
+myMap.set(akey, { some: 'data' })
+myMap.set(bkey, { some: 'other data' })
+```
diff --git a/deps/npm/node_modules/lru-cache/node_modules/pseudomap/map.js b/deps/npm/node_modules/lru-cache/node_modules/pseudomap/map.js
new file mode 100644
index 00000000000000..c0ad39c029718f
--- /dev/null
+++ b/deps/npm/node_modules/lru-cache/node_modules/pseudomap/map.js
@@ -0,0 +1,122 @@
+if (process.env.npm_package_name === 'pseudomap' &&
+ process.env.npm_lifecycle_script === 'test')
+ process.env.TEST_PSEUDOMAP = 'true'
+
+if (typeof Map === 'function' && !process.env.TEST_PSEUDOMAP) {
+ module.exports = Map
+ return
+}
+
+var hasOwnProperty = Object.prototype.hasOwnProperty
+
+module.exports = PseudoMap
+
+function PseudoMap (set) {
+ if (!(this instanceof PseudoMap)) // whyyyyyyy
+ throw new TypeError("Constructor PseudoMap requires 'new'")
+
+ this.clear()
+
+ if (set) {
+ if ((set instanceof PseudoMap) ||
+ (typeof Map === 'function' && set instanceof Map))
+ set.forEach(function (value, key) {
+ this.set(key, value)
+ }, this)
+ else if (Array.isArray(set))
+ set.forEach(function (kv) {
+ this.set(kv[0], kv[1])
+ }, this)
+ else
+ throw new TypeError('invalid argument')
+ }
+}
+
+PseudoMap.prototype.forEach = function (fn, thisp) {
+ thisp = thisp || this
+ Object.keys(this._data).forEach(function (k) {
+ if (k !== 'size')
+ fn.call(thisp, this._data[k].value, this._data[k].key)
+ }, this)
+}
+
+PseudoMap.prototype.has = function (k) {
+ return !!find(this._data, k)
+}
+
+PseudoMap.prototype.get = function (k) {
+ var res = find(this._data, k)
+ return res && res.value
+}
+
+PseudoMap.prototype.set = function (k, v) {
+ set(this._data, k, v)
+}
+
+PseudoMap.prototype.delete = function (k) {
+ var res = find(this._data, k)
+ if (res) {
+ delete this._data[res._index]
+ this._data.size--
+ }
+}
+
+PseudoMap.prototype.clear = function () {
+ var data = Object.create(null)
+ data.size = 0
+
+ Object.defineProperty(this, '_data', {
+ value: data,
+ enumerable: false,
+ configurable: true,
+ writable: false
+ })
+}
+
+Object.defineProperty(PseudoMap.prototype, 'size', {
+ get: function () {
+ return this._data.size
+ },
+ set: function (n) {},
+ enumerable: true,
+ configurable: true
+})
+
+PseudoMap.prototype.values =
+PseudoMap.prototype.keys =
+PseudoMap.prototype.entries = function () {
+ throw new Error('iterators are not implemented in this version')
+}
+
+// Either identical, or both NaN
+function same (a, b) {
+ return a === b || a !== a && b !== b
+}
+
+function Entry (k, v, i) {
+ this.key = k
+ this.value = v
+ this._index = i
+}
+
+function find (data, k) {
+ for (var i = 0, s = '_' + k, key = s;
+ hasOwnProperty.call(data, key);
+ key = s + i++) {
+ if (same(data[key].key, k))
+ return data[key]
+ }
+}
+
+function set (data, k, v) {
+ for (var i = 0, s = '_' + k, key = s;
+ hasOwnProperty.call(data, key);
+ key = s + i++) {
+ if (same(data[key].key, k)) {
+ data[key].value = v
+ return
+ }
+ }
+ data.size++
+ data[key] = new Entry(k, v, key)
+}
diff --git a/deps/npm/node_modules/lru-cache/node_modules/pseudomap/package.json b/deps/npm/node_modules/lru-cache/node_modules/pseudomap/package.json
new file mode 100644
index 00000000000000..a0161aca345563
--- /dev/null
+++ b/deps/npm/node_modules/lru-cache/node_modules/pseudomap/package.json
@@ -0,0 +1,35 @@
+{
+ "name": "pseudomap",
+ "version": "1.0.1",
+ "description": "A thing that is a lot like ES6 `Map`, but without iterators, for use in environments where `for..of` syntax and `Map` are not available.",
+ "main": "map.js",
+ "directories": {
+ "test": "test"
+ },
+ "devDependencies": {
+ "tap": "^2.3.1"
+ },
+ "scripts": {
+ "test": "tap test/*.js"
+ },
+ "repository": {
+ "type": "git",
+ "url": "git+https://github.com/isaacs/pseudomap.git"
+ },
+ "author": {
+ "name": "Isaac Z. Schlueter",
+ "email": "i@izs.me",
+ "url": "http://blog.izs.me/"
+ },
+ "license": "ISC",
+ "bugs": {
+ "url": "https://github.com/isaacs/pseudomap/issues"
+ },
+ "homepage": "https://github.com/isaacs/pseudomap#readme",
+ "readme": "# pseudomap\n\nA thing that is a lot like ES6 `Map`, but without iterators, for use\nin environments where `for..of` syntax and `Map` are not available.\n\nIf you need iterators, or just in general a more faithful polyfill to\nES6 Maps, check out [es6-map](http://npm.im/es6-map).\n\nIf you are in an environment where `Map` is supported, then that will\nbe returned instead, unless `process.env.TEST_PSEUDOMAP` is set.\n\nYou can use any value as keys, and any value as data. Setting again\nwith the identical key will overwrite the previous value.\n\nInternally, data is stored on an `Object.create(null)` style object.\nThe key is coerced to a string to generate the key on the internal\ndata-bag object. The original key used is stored along with the data.\n\nIn the event of a stringified-key collision, a new key is generated by\nappending an increasing number to the stringified-key until finding\neither the intended key or an empty spot.\n\nNote that because object traversal order of plain objects is not\nguaranteed to be identical to insertion order, the insertion order\nguarantee of `Map.prototype.forEach` is not guaranteed in this\nimplementation. However, in all versions of Node.js and V8 where this\nmodule works, `forEach` does traverse data in insertion order.\n\n## API\n\nMost of the [Map\nAPI](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map),\nwith the following exceptions:\n\n1. A `Map` object is not an iterator.\n2. `values`, `keys`, and `entries` methods are not implemented,\n because they return iterators.\n3. The argument to the constructor can be an Array of `[key, value]`\n pairs, or a `Map` or `PseudoMap` object. But, since iterators\n aren't used, passing any plain-old iterator won't initialize the\n map properly.\n\n## USAGE\n\nUse just like a regular ES6 Map.\n\n```javascript\nvar PseudoMap = require('pseudomap')\n\n// optionally provide a pseudomap, or an array of [key,value] pairs\n// as the argument to initialize the map with\nvar myMap = new PseudoMap()\n\nmyMap.set(1, 'number 1')\nmyMap.set('1', 'string 1')\nvar akey = {}\nvar bkey = {}\nmyMap.set(akey, { some: 'data' })\nmyMap.set(bkey, { some: 'other data' })\n```\n",
+ "readmeFilename": "README.md",
+ "_id": "pseudomap@1.0.1",
+ "_shasum": "29b4e7f37bbbf3e3c9b9152981c40f33d56b2b28",
+ "_resolved": "https://registry.npmjs.org/pseudomap/-/pseudomap-1.0.1.tgz",
+ "_from": "pseudomap@>=1.0.1 <2.0.0"
+}
diff --git a/deps/npm/node_modules/lru-cache/node_modules/pseudomap/test/basic.js b/deps/npm/node_modules/lru-cache/node_modules/pseudomap/test/basic.js
new file mode 100644
index 00000000000000..4378e4541e9a14
--- /dev/null
+++ b/deps/npm/node_modules/lru-cache/node_modules/pseudomap/test/basic.js
@@ -0,0 +1,86 @@
+var t = require('tap')
+
+process.env.TEST_PSEUDOMAP = 'true'
+
+var PM = require('../')
+runTests(PM)
+
+// if possible, verify that Map also behaves the same way
+if (typeof Map === 'function')
+ runTests(Map)
+
+
+function runTests (Map) {
+ t.throws(Map)
+
+ var m = new Map()
+
+ t.equal(m.size, 0)
+
+ m.set(1, '1 string')
+ t.equal(m.get(1), '1 string')
+ t.equal(m.size, 1)
+ m.size = 1000
+ t.equal(m.size, 1)
+ m.size = 0
+ t.equal(m.size, 1)
+
+ m = new Map([[1, 'number 1'], ['1', 'string 1']])
+ t.equal(m.get(1), 'number 1')
+ t.equal(m.get('1'), 'string 1')
+ t.equal(m.size, 2)
+
+ m = new Map(m)
+ t.equal(m.get(1), 'number 1')
+ t.equal(m.get('1'), 'string 1')
+ t.equal(m.size, 2)
+
+ var akey = {}
+ var bkey = {}
+ m.set(akey, { some: 'data' })
+ m.set(bkey, { some: 'other data' })
+ t.same(m.get(akey), { some: 'data' })
+ t.same(m.get(bkey), { some: 'other data' })
+ t.equal(m.size, 4)
+
+ var x = /x/
+ var y = /x/
+ m.set(x, 'x regex')
+ m.set(y, 'y regex')
+ t.equal(m.get(x), 'x regex')
+ m.set(x, 'x again')
+ t.equal(m.get(x), 'x again')
+ t.equal(m.size, 6)
+
+ m.set(NaN, 'not a number')
+ t.equal(m.get(NaN), 'not a number')
+ m.set(NaN, 'it is a ' + typeof NaN)
+ t.equal(m.get(NaN), 'it is a number')
+ m.set('NaN', 'stringie nan')
+ t.equal(m.get(NaN), 'it is a number')
+ t.equal(m.get('NaN'), 'stringie nan')
+ t.equal(m.size, 8)
+
+ m.delete(NaN)
+ t.equal(m.get(NaN), undefined)
+ t.equal(m.size, 7)
+
+ var expect = [
+ { value: 'number 1', key: 1 },
+ { value: 'string 1', key: '1' },
+ { value: { some: 'data' }, key: {} },
+ { value: { some: 'other data' }, key: {} },
+ { value: 'x again', key: /x/ },
+ { value: 'y regex', key: /x/ },
+ { value: 'stringie nan', key: 'NaN' }
+ ]
+ var actual = []
+
+ m.forEach(function (value, key) {
+ actual.push({ value: value, key: key })
+ })
+ t.same(actual, expect)
+
+ m.clear()
+ t.equal(m.size, 0)
+}
diff --git a/deps/npm/node_modules/lru-cache/package.json b/deps/npm/node_modules/lru-cache/package.json
index 5a9d76a1d5f455..04e14d44bbdbbc 100644
--- a/deps/npm/node_modules/lru-cache/package.json
+++ b/deps/npm/node_modules/lru-cache/package.json
@@ -1,7 +1,7 @@
{
"name": "lru-cache",
"description": "A cache object that deletes the least-recently-used items.",
- "version": "2.7.0",
+ "version": "3.2.0",
"author": {
"name": "Isaac Z. Schlueter",
"email": "i@izs.me"
@@ -24,35 +24,17 @@
"weak": ""
},
"license": "ISC",
- "gitHead": "fc6ee93093f4e463e5946736d4c48adc013724d1",
+ "dependencies": {
+ "pseudomap": "^1.0.1"
+ },
+ "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, key) { return n * 2 + key.length }\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\n// non-string keys ARE fully supported\nvar someObject = {}\ncache.set(someObject, 'a value')\ncache.set('[object Object]', 'a different value')\nassert.equal(cache.get(someObject), 'a 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, key){return n.length}`. The default is\n `function(){return 1}`, which is fine if you want to store `max`\n like-sized things. They item is passed as the first argument, and\n the key is passed as the second argumnet.\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, maxAge)`\n* `get(key) => value`\n\n Both of these will update the \"recently used\"-ness of the key.\n They do what you think. `max` is optional and overrides the\n cache `max` option if provided.\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* `rforEach(function(value,key,cache), [thisp])`\n\n The same as `cache.forEach(...)` but items are iterated over in\n reverse order. (ie, less recently used items are iterated over\n 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\n* `length()`\n\n Return total length of objects in cache taking into account\n `length` options function.\n\n* `itemCount`\n\n Return total quantity of objects currently in cache. Note, that\n `stale` (see options) items are returned as part of this item\n count.\n\n* `dump()`\n\n Return an array of the cache entries ready for serialization and usage\n with 'destinationCache.load(arr)`.\n\n* `load(cacheEntriesArray)`\n\n Loads another cache entries array, obtained with `sourceCache.dump()`,\n into the cache. The destination cache is reset before loading new entries\n",
+ "readmeFilename": "README.md",
"bugs": {
"url": "https://github.com/isaacs/node-lru-cache/issues"
},
"homepage": "https://github.com/isaacs/node-lru-cache#readme",
- "_id": "lru-cache@2.7.0",
- "_shasum": "aaa376a4cd970f9cebf5ec1909566ec034f07ee6",
- "_from": "lru-cache@2.7.0",
- "_npmVersion": "3.3.2",
- "_nodeVersion": "4.0.0",
- "_npmUser": {
- "name": "isaacs",
- "email": "isaacs@npmjs.com"
- },
- "dist": {
- "shasum": "aaa376a4cd970f9cebf5ec1909566ec034f07ee6",
- "tarball": "http://registry.npmjs.org/lru-cache/-/lru-cache-2.7.0.tgz"
- },
- "maintainers": [
- {
- "name": "isaacs",
- "email": "isaacs@npmjs.com"
- },
- {
- "name": "othiym23",
- "email": "ogd@aoaioxxysz.net"
- }
- ],
- "directories": {},
- "_resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-2.7.0.tgz",
- "readme": "ERROR: No README data found!"
+ "_id": "lru-cache@3.2.0",
+ "_shasum": "71789b3b7f5399bec8565dda38aa30d2a097efee",
+ "_resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-3.2.0.tgz",
+ "_from": "lru-cache@>=3.2.0 <3.3.0"
}
diff --git a/deps/npm/node_modules/lru-cache/test/basic.js b/deps/npm/node_modules/lru-cache/test/basic.js
index b47225f109891f..02000a79593c31 100644
--- a/deps/npm/node_modules/lru-cache/test/basic.js
+++ b/deps/npm/node_modules/lru-cache/test/basic.js
@@ -96,12 +96,15 @@ test("reset", function (t) {
test("basic with weighed length", function (t) {
var cache = new LRU({
max: 100,
- length: function (item) { return item.size }
+ length: function (item, key) {
+ t.isa(key, 'string')
+ 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.lengthCalculator(cache.get("key"), 'key'), 50)
t.equal(cache.length, 50)
t.equal(cache.max, 100)
t.end()
@@ -229,7 +232,7 @@ test("drop the old items", function(t) {
}, 155)
})
-test("individual item can have it's own maxAge", function(t) {
+test("individual item can have its own maxAge", function(t) {
var cache = new LRU({
max: 5,
maxAge: 50
@@ -242,7 +245,7 @@ test("individual item can have it's own maxAge", function(t) {
}, 25)
})
-test("individual item can have it's own maxAge > cache's", function(t) {
+test("individual item can have its own maxAge > cache's", function(t) {
var cache = new LRU({
max: 5,
maxAge: 20
@@ -394,3 +397,31 @@ test("pop the least used item", function (t) {
t.end()
})
+
+test("get and set only accepts strings and numbers as keys", function(t) {
+ var cache = new LRU()
+
+ cache.set("key", "value")
+ cache.set(123, 456)
+
+ t.equal(cache.get("key"), "value")
+ t.equal(cache.get(123), 456)
+
+ t.end()
+})
+
+test("peek with wierd keys", function(t) {
+ var cache = new LRU()
+
+ cache.set("key", "value")
+ cache.set(123, 456)
+
+ t.equal(cache.peek("key"), "value")
+ t.equal(cache.peek(123), 456)
+
+ t.equal(cache.peek({
+ toString: function() { return "key" }
+ }), undefined)
+
+ t.end()
+})
diff --git a/deps/npm/node_modules/lru-cache/test/foreach.js b/deps/npm/node_modules/lru-cache/test/foreach.js
index 4190417cbc61d8..d037d41c33af16 100644
--- a/deps/npm/node_modules/lru-cache/test/foreach.js
+++ b/deps/npm/node_modules/lru-cache/test/foreach.js
@@ -4,13 +4,13 @@ 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))
+ l.set(i, i.toString(2))
}
var i = 9
l.forEach(function (val, key, cache) {
t.equal(cache, l)
- t.equal(key, i.toString())
+ t.equal(key, i)
t.equal(val, i.toString(2))
i -= 1
})
@@ -25,10 +25,20 @@ test('forEach', function (t) {
l.forEach(function (val, key, cache) {
var j = order[i ++]
t.equal(cache, l)
- t.equal(key, j.toString())
+ t.equal(key, j)
t.equal(val, j.toString(2))
})
- t.equal(i, order.length);
+ t.equal(i, order.length)
+
+ i = 0
+ order.reverse()
+ l.rforEach(function (val, key, cache) {
+ var j = order[i ++]
+ t.equal(cache, l)
+ t.equal(key, j)
+ t.equal(val, j.toString(2))
+ })
+ t.equal(i, order.length)
t.end()
})
@@ -36,17 +46,17 @@ test('forEach', function (t) {
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))
+ l.set(i, i.toString(2))
}
- t.similar(l.keys(), ['9', '8', '7', '6', '5'])
+ 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.keys(), [8, 6, 9, 7, 5])
t.similar(l.values(), ['1000', '110', '1001', '111', '101'])
t.end()
diff --git a/deps/npm/node_modules/lru-cache/test/overflow.js b/deps/npm/node_modules/lru-cache/test/overflow.js
new file mode 100644
index 00000000000000..238af699b0a0c0
--- /dev/null
+++ b/deps/npm/node_modules/lru-cache/test/overflow.js
@@ -0,0 +1,45 @@
+var LRU = require('../')
+var t = require('tap')
+
+var c = new LRU(5)
+
+// now the hacksy bitses
+c._mru = Number.MAX_SAFE_INTEGER - 10
+
+function test (c) {
+ t.test('mru=' + c._mru + ', lru=' + c._lru, function (t) {
+ t.equal(c.length, 5)
+ t.equal(c._cache.get(0), undefined)
+ t.equal(c._cache.get(1).value, 1)
+ t.equal(c._cache.get(2).value, 2)
+ t.equal(c._cache.get(3).value, 3)
+ t.equal(c._cache.get(4).value, 4)
+ t.equal(c._cache.get(5).value, 5)
+ t.ok(c._mru < Number.MAX_SAFE_INTEGER, 'did not overflow')
+ t.end()
+ })
+}
+
+for (var i = 0; i < 6; i++) {
+ c.set(i, i)
+}
+
+test(c)
+
+for (var i = 0; i < 6; i++) {
+ c.set(i, i)
+}
+
+test(c)
+
+for (var i = 0; i < 6; i++) {
+ c.set(i, i)
+}
+
+test(c)
+
+for (var i = 0; i < 6; i++) {
+ c.set(i, i)
+}
+
+test(c)
diff --git a/deps/npm/node_modules/lru-cache/test/serialize.js b/deps/npm/node_modules/lru-cache/test/serialize.js
index 5fe5dc3d371f1e..b87eb5d0b0383d 100644
--- a/deps/npm/node_modules/lru-cache/test/serialize.js
+++ b/deps/npm/node_modules/lru-cache/test/serialize.js
@@ -13,6 +13,14 @@ test('dump', function (t) {
{ k: "a", v: "A", e: 0 }
])
+ cache.set(123, 456)
+ t.deepEqual(cache.dump(), [
+ { k: 123, v: 456, e: 0 },
+ { k: "b", v: "B", e: 0 },
+ { k: "a", v: "A", e: 0 },
+ ])
+ cache.del(123)
+
cache.set("a", "A");
t.deepEqual(cache.dump(), [
{ k: "a", v: "A", e: 0 },
@@ -88,6 +96,7 @@ test("load basic cache", function(t) {
cache.set("a", "A")
cache.set("b", "B")
+ cache.set(123, 456)
copy.load(cache.dump())
t.deepEquals(cache.dump(), copy.dump())
diff --git a/deps/npm/node_modules/node-gyp/CHANGELOG.md b/deps/npm/node_modules/node-gyp/CHANGELOG.md
index 4c8cc367814497..a0193adf0c74bd 100644
--- a/deps/npm/node_modules/node-gyp/CHANGELOG.md
+++ b/deps/npm/node_modules/node-gyp/CHANGELOG.md
@@ -1,3 +1,13 @@
+v3.1.0 2015-11-14
+
+* [[`9049241f91`](https://github.com/nodejs/node-gyp/commit/9049241f91)] - **gyp**: don't use links at all, just copy the files instead (Nathan Zadoks)
+* [[`8ef90348d1`](https://github.com/nodejs/node-gyp/commit/8ef90348d1)] - **gyp**: apply https://codereview.chromium.org/11361103/ (Nathan Rajlich)
+* [[`a2ed0df84e`](https://github.com/nodejs/node-gyp/commit/a2ed0df84e)] - **gyp**: always install into $PRODUCT_DIR (Nathan Rajlich)
+* [[`cc8b2fa83e`](https://github.com/nodejs/node-gyp/commit/cc8b2fa83e)] - Update gyp to b3cef02. (Imran Iqbal) [#781](https://github.com/nodejs/node-gyp/pull/781)
+* [[`f5d86eb84e`](https://github.com/nodejs/node-gyp/commit/f5d86eb84e)] - Update to tar@2.0.0. (Edgar Muentes) [#797](https://github.com/nodejs/node-gyp/pull/797)
+* [[`2ac7de02c4`](https://github.com/nodejs/node-gyp/commit/2ac7de02c4)] - Fix infinite loop with zero-length options. (Ben Noordhuis) [#745](https://github.com/nodejs/node-gyp/pull/745)
+* [[`101bed639b`](https://github.com/nodejs/node-gyp/commit/101bed639b)] - This platform value came from debian package, and now the value (Jérémy Lal) [#738](https://github.com/nodejs/node-gyp/pull/738)
+
v3.0.3 2015-09-14
* [[`ad827cda30`](https://github.com/nodejs/node-gyp/commit/ad827cda30)] - tarballUrl global and && when checking for iojs (Lars-Magnus Skog) [#729](https://github.com/nodejs/node-gyp/pull/729)
diff --git a/deps/npm/node_modules/node-gyp/README.md b/deps/npm/node_modules/node-gyp/README.md
index 779dc6adc2713b..dec739f16fde99 100644
--- a/deps/npm/node_modules/node-gyp/README.md
+++ b/deps/npm/node_modules/node-gyp/README.md
@@ -38,11 +38,11 @@ You will also need to install:
* A proper C/C++ compiler toolchain, like [GCC](https://gcc.gnu.org)
* On Mac OS X:
* `python` (`v2.7` recommended, `v3.x.x` is __*not*__ supported) (already installed on Mac OS X)
- * [Xcode](https://developer.apple.com/xcode/downloads/)
+ * [Xcode](https://developer.apple.com/xcode/download/)
* You also need to install the `Command Line Tools` via Xcode. You can find this under the menu `Xcode -> Preferences -> Downloads`
* This step will install `gcc` and the related toolchain containing `make`
* On Windows:
- * [Python][windows-python] ([`v2.7.3`][windows-python-v2.7.3] recommended, `v3.x.x` is __*not*__ supported)
+ * Python ([`v2.7.10`][python-v2.7.10] recommended, `v3.x.x` is __*not*__ supported)
* Make sure that you have a PYTHON environment variable, and it is set to drive:\path\to\python.exe not to a folder
* Windows XP/Vista/7:
* Microsoft Visual Studio C++ 2013 ([Express][msvc2013] version works well)
@@ -50,6 +50,14 @@ You will also need to install:
* If you get errors that the 64-bit compilers are not installed you may also need the [compiler update for the Windows SDK 7.1]
* Windows 7/8:
* Microsoft Visual Studio C++ 2013 for Windows Desktop ([Express][msvc2013] version works well)
+ * Windows 10:
+ * Install the latest version of npm (3.3.6 at the time of writing)
+ * Install Python 2.7 from https://www.python.org/download/releases/2.7/ and make sure its on the System Path
+ * Install Visual Studio Community 2015 Edition. (Custom Install, Select Visual C++ during the installation)
+ * Set the environment variable GYP_MSVS_VERSION=2015
+ * Run the command prompt as Administrator
+ * $ npm install (--msvs_version=2015) <-- Shouldn't be needed if you have set GYP_MSVS_VERSION env
+ * If the above steps have not worked or you are unsure please visit http://www.serverpals.com/blog/building-using-node-gyp-with-visual-studio-express-2015-on-windows-10-pro-x64 for a full walkthrough
* All Windows Versions
* For 64-bit builds of node and native modules you will _**also**_ need the [Windows 7 64-bit SDK][win7sdk]
* You may need to run one of the following commands if your build complains about WindowsSDKDir not being set, and you are sure you have already installed the SDK:
@@ -136,9 +144,9 @@ A barebones `gyp` file appropriate for building a node addon looks like:
Some additional resources for addons and writing `gyp` files:
* ["Going Native" a nodeschool.io tutorial](http://nodeschool.io/#goingnative)
- * ["Hello World" node addon example](https://github.com/joyent/node/tree/master/test/addons/hello-world)
- * [gyp user documentation](https://chromium.googlesource.com/external/gyp/+/master/docs/UserDocumentation.md)
- * [gyp input format reference](https://chromium.googlesource.com/external/gyp/+/master/docs/InputFormatReference.md)
+ * ["Hello World" node addon example](https://github.com/nodejs/node/tree/master/test/addons/hello-world)
+ * [gyp user documentation](https://gyp.gsrc.io/docs/UserDocumentation.md)
+ * [gyp input format reference](https://gyp.gsrc.io/docs/InputFormatReference.md)
* [*"binding.gyp" files out in the wild* wiki page](https://github.com/nodejs/node-gyp/wiki/%22binding.gyp%22-files-out-in-the-wild)
@@ -185,8 +193,7 @@ TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-[windows-python]: http://www.python.org/getit/windows
-[windows-python-v2.7.3]: http://www.python.org/download/releases/2.7.3#download
-[msvc2013]: http://www.microsoft.com/en-gb/download/details.aspx?id=44914
-[win7sdk]: http://www.microsoft.com/en-us/download/details.aspx?id=8279
-[compiler update for the Windows SDK 7.1]: http://www.microsoft.com/en-us/download/details.aspx?id=4422
+[python-v2.7.10]: https://www.python.org/downloads/release/python-2710/
+[msvc2013]: https://www.microsoft.com/en-gb/download/details.aspx?id=44914
+[win7sdk]: https://www.microsoft.com/en-us/download/details.aspx?id=8279
+[compiler update for the Windows SDK 7.1]: https://www.microsoft.com/en-us/download/details.aspx?id=4422
diff --git a/deps/npm/node_modules/node-gyp/addon.gypi b/deps/npm/node_modules/node-gyp/addon.gypi
index 510b00c713f55c..3372bfa521f623 100644
--- a/deps/npm/node_modules/node-gyp/addon.gypi
+++ b/deps/npm/node_modules/node-gyp/addon.gypi
@@ -65,6 +65,11 @@
'DYLIB_INSTALL_NAME_BASE': '@rpath'
},
}],
+ [ 'OS=="aix"', {
+ 'ldflags': [
+ '-Wl,-bimport:<(node_exp_file)'
+ ],
+ }],
[ 'OS=="win"', {
'libraries': [
'-lkernel32.lib',
diff --git a/deps/npm/node_modules/node-gyp/gyp/AUTHORS b/deps/npm/node_modules/node-gyp/gyp/AUTHORS
index 9389ca0a23e48f..fecf84a1c4d72a 100644
--- a/deps/npm/node_modules/node-gyp/gyp/AUTHORS
+++ b/deps/npm/node_modules/node-gyp/gyp/AUTHORS
@@ -9,3 +9,4 @@ Steven Knight
Ryan Norton
David J. Sankel
Eric N. Vander Weele
+Tom Freudenberg
diff --git a/deps/npm/node_modules/node-gyp/gyp/PRESUBMIT.py b/deps/npm/node_modules/node-gyp/gyp/PRESUBMIT.py
index abec27b3e33120..dde025383c3276 100644
--- a/deps/npm/node_modules/node-gyp/gyp/PRESUBMIT.py
+++ b/deps/npm/node_modules/node-gyp/gyp/PRESUBMIT.py
@@ -125,15 +125,13 @@ def CheckChangeOnCommit(input_api, output_api):
TRYBOTS = [
- 'gyp-win32',
- 'gyp-win64',
- 'gyp-linux',
- 'gyp-mac',
- 'gyp-android'
+ 'linux_try',
+ 'mac_try',
+ 'win_try',
]
def GetPreferredTryMasters(_, change):
return {
- 'tryserver.nacl': { t: set(['defaulttests']) for t in TRYBOTS },
+ 'client.gyp': { t: set(['defaulttests']) for t in TRYBOTS },
}
diff --git a/deps/npm/node_modules/node-gyp/gyp/buildbot/buildbot_run.py b/deps/npm/node_modules/node-gyp/gyp/buildbot/buildbot_run.py
index f46ab1822fe321..9a2b71f1b355cf 100755
--- a/deps/npm/node_modules/node-gyp/gyp/buildbot/buildbot_run.py
+++ b/deps/npm/node_modules/node-gyp/gyp/buildbot/buildbot_run.py
@@ -3,27 +3,17 @@
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
-
"""Argument-less script to select what to run on the buildbots."""
-
-import filecmp
import os
import shutil
import subprocess
import sys
-if sys.platform in ['win32', 'cygwin']:
- EXE_SUFFIX = '.exe'
-else:
- EXE_SUFFIX = ''
-
-
BUILDBOT_DIR = os.path.dirname(os.path.abspath(__file__))
TRUNK_DIR = os.path.dirname(BUILDBOT_DIR)
ROOT_DIR = os.path.dirname(TRUNK_DIR)
-ANDROID_DIR = os.path.join(ROOT_DIR, 'android')
CMAKE_DIR = os.path.join(ROOT_DIR, 'cmake')
CMAKE_BIN_DIR = os.path.join(CMAKE_DIR, 'bin')
OUT_DIR = os.path.join(TRUNK_DIR, 'out')
@@ -71,95 +61,6 @@ def PrepareCmake():
CallSubProcess( ['make', 'cmake'], cwd=CMAKE_DIR)
-_ANDROID_SETUP = 'source build/envsetup.sh && lunch full-eng'
-
-
-def PrepareAndroidTree():
- """Prepare an Android tree to run 'android' format tests."""
- if os.environ['BUILDBOT_CLOBBER'] == '1':
- print '@@@BUILD_STEP Clobber Android checkout@@@'
- shutil.rmtree(ANDROID_DIR)
-
- # (Re)create the directory so that the following steps will succeed.
- if not os.path.isdir(ANDROID_DIR):
- os.mkdir(ANDROID_DIR)
-
- # We use a manifest from the gyp project listing pinned revisions of AOSP to
- # use, to ensure that we test against a stable target. This needs to be
- # updated to pick up new build system changes sometimes, so we must test if
- # it has changed.
- manifest_filename = 'aosp_manifest.xml'
- gyp_manifest = os.path.join(BUILDBOT_DIR, manifest_filename)
- android_manifest = os.path.join(ANDROID_DIR, '.repo', 'manifests',
- manifest_filename)
- manifest_is_current = (os.path.isfile(android_manifest) and
- filecmp.cmp(gyp_manifest, android_manifest))
- if not manifest_is_current:
- # It's safe to repeat these steps, so just do them again to make sure we are
- # in a good state.
- print '@@@BUILD_STEP Initialize Android checkout@@@'
- CallSubProcess(
- ['repo', 'init',
- '-u', 'https://android.googlesource.com/platform/manifest',
- '-b', 'master',
- '-g', 'all,-notdefault,-device,-darwin,-mips,-x86'],
- cwd=ANDROID_DIR)
- shutil.copy(gyp_manifest, android_manifest)
-
- print '@@@BUILD_STEP Sync Android@@@'
- CallSubProcess(['repo', 'sync', '-j4', '-m', manifest_filename],
- cwd=ANDROID_DIR)
-
- # If we already built the system image successfully and didn't sync to a new
- # version of the source, skip running the build again as it's expensive even
- # when there's nothing to do.
- system_img = os.path.join(ANDROID_DIR, 'out', 'target', 'product', 'generic',
- 'system.img')
- if manifest_is_current and os.path.isfile(system_img):
- return
-
- print '@@@BUILD_STEP Build Android@@@'
- CallSubProcess(
- ['/bin/bash',
- '-c', '%s && make -j4' % _ANDROID_SETUP],
- cwd=ANDROID_DIR)
-
-
-def StartAndroidEmulator():
- """Start an android emulator from the built android tree."""
- print '@@@BUILD_STEP Start Android emulator@@@'
-
- CallSubProcess(['/bin/bash', '-c',
- '%s && adb kill-server ' % _ANDROID_SETUP],
- cwd=ANDROID_DIR)
-
- # If taskset is available, use it to force adbd to run only on one core, as,
- # sadly, it improves its reliability (see crbug.com/268450).
- adbd_wrapper = ''
- with open(os.devnull, 'w') as devnull_fd:
- if subprocess.call(['which', 'taskset'], stdout=devnull_fd) == 0:
- adbd_wrapper = 'taskset -c 0'
- CallSubProcess(['/bin/bash', '-c',
- '%s && %s adb start-server ' % (_ANDROID_SETUP, adbd_wrapper)],
- cwd=ANDROID_DIR)
-
- subprocess.Popen(
- ['/bin/bash', '-c',
- '%s && emulator -no-window' % _ANDROID_SETUP],
- cwd=ANDROID_DIR)
- CallSubProcess(
- ['/bin/bash', '-c',
- '%s && adb wait-for-device' % _ANDROID_SETUP],
- cwd=ANDROID_DIR)
-
-
-def StopAndroidEmulator():
- """Stop all android emulators."""
- print '@@@BUILD_STEP Stop Android emulator@@@'
- # If this fails, it's because there is no emulator running.
- subprocess.call(['pkill', 'emulator.*'])
-
-
def GypTestFormat(title, format=None, msvs_version=None, tests=[]):
"""Run the gyp tests for a given format, emitting annotator tags.
@@ -185,15 +86,7 @@ def GypTestFormat(title, format=None, msvs_version=None, tests=[]):
'--format', format,
'--path', CMAKE_BIN_DIR,
'--chdir', 'gyp'] + tests)
- if format == 'android':
- # gyptest needs the environment setup from envsetup/lunch in order to build
- # using the 'android' backend, so this is done in a single shell.
- retcode = subprocess.call(
- ['/bin/bash',
- '-c', '%s && cd %s && %s' % (_ANDROID_SETUP, ROOT_DIR, command)],
- cwd=ANDROID_DIR, env=env)
- else:
- retcode = subprocess.call(command, cwd=ROOT_DIR, env=env, shell=True)
+ retcode = subprocess.call(command, cwd=ROOT_DIR, env=env, shell=True)
if retcode:
# Emit failure tag, and keep going.
print '@@@STEP_FAILURE@@@'
@@ -209,15 +102,7 @@ def GypBuild():
print 'Done.'
retcode = 0
- # The Android gyp bot runs on linux so this must be tested first.
- if os.environ['BUILDBOT_BUILDERNAME'] == 'gyp-android':
- PrepareAndroidTree()
- StartAndroidEmulator()
- try:
- retcode += GypTestFormat('android')
- finally:
- StopAndroidEmulator()
- elif sys.platform.startswith('linux'):
+ if sys.platform.startswith('linux'):
retcode += GypTestFormat('ninja')
retcode += GypTestFormat('make')
PrepareCmake()
diff --git a/deps/npm/node_modules/node-gyp/gyp/buildbot/commit_queue/cq_config.json b/deps/npm/node_modules/node-gyp/gyp/buildbot/commit_queue/cq_config.json
index bbf20e394f3bb6..656c21e54fb12f 100644
--- a/deps/npm/node_modules/node-gyp/gyp/buildbot/commit_queue/cq_config.json
+++ b/deps/npm/node_modules/node-gyp/gyp/buildbot/commit_queue/cq_config.json
@@ -3,7 +3,6 @@
"launched": {
"tryserver.nacl": {
"gyp-presubmit": ["defaulttests"],
- "gyp-android": ["defaulttests"],
"gyp-linux": ["defaulttests"],
"gyp-mac": ["defaulttests"],
"gyp-win32": ["defaulttests"],
diff --git a/deps/npm/node_modules/node-gyp/gyp/gyp_main.py b/deps/npm/node_modules/node-gyp/gyp/gyp_main.py
index 4ec872f0f95aa3..25a6eba94aae7d 100755
--- a/deps/npm/node_modules/node-gyp/gyp/gyp_main.py
+++ b/deps/npm/node_modules/node-gyp/gyp/gyp_main.py
@@ -4,15 +4,13 @@
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
+import os
import sys
-# TODO(mark): sys.path manipulation is some temporary testing stuff.
-try:
- import gyp
-except ImportError, e:
- import os.path
- sys.path.append(os.path.join(os.path.dirname(sys.argv[0]), 'pylib'))
- import gyp
+# Make sure we're using the version of pylib in this repo, not one installed
+# elsewhere on the system.
+sys.path.insert(0, os.path.join(os.path.dirname(sys.argv[0]), 'pylib'))
+import gyp
if __name__ == '__main__':
sys.exit(gyp.script_main())
diff --git a/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/MSVSSettings.py b/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/MSVSSettings.py
index dde0e07092b167..4985756bdde76a 100644
--- a/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/MSVSSettings.py
+++ b/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/MSVSSettings.py
@@ -708,10 +708,7 @@ def _ValidateSettings(validators, settings, stderr):
_MSBuildOnly(_compile, 'BuildingInIDE', _boolean)
_MSBuildOnly(_compile, 'CompileAsManaged',
_Enumeration([], new=['false',
- 'true', # /clr
- 'Pure', # /clr:pure
- 'Safe', # /clr:safe
- 'OldSyntax'])) # /clr:oldSyntax
+ 'true'])) # /clr
_MSBuildOnly(_compile, 'CreateHotpatchableImage', _boolean) # /hotpatch
_MSBuildOnly(_compile, 'MultiProcessorCompilation', _boolean) # /MP
_MSBuildOnly(_compile, 'PreprocessOutputPath', _string) # /Fi
diff --git a/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/MSVSSettings_test.py b/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/MSVSSettings_test.py
index d24dcac4d5e13e..bf6ea6b802ff91 100755
--- a/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/MSVSSettings_test.py
+++ b/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/MSVSSettings_test.py
@@ -296,7 +296,7 @@ def testValidateMSBuildSettings_settings(self):
'BuildingInIDE': 'true',
'CallingConvention': 'Cdecl',
'CompileAs': 'CompileAsC',
- 'CompileAsManaged': 'Pure',
+ 'CompileAsManaged': 'true',
'CreateHotpatchableImage': 'true',
'DebugInformationFormat': 'ProgramDatabase',
'DisableLanguageExtensions': 'true',
diff --git a/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/MSVSVersion.py b/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/MSVSVersion.py
index 92e583fd6e27c7..d9bfa684fa30c2 100644
--- a/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/MSVSVersion.py
+++ b/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/MSVSVersion.py
@@ -84,10 +84,11 @@ def SetupScript(self, target_arch):
# vcvars32, which it can only find if VS??COMNTOOLS is set, which it
# isn't always.
if target_arch == 'x86':
- if self.short_name == '2013' and (
+ if self.short_name >= '2013' and self.short_name[-1] != 'e' and (
os.environ.get('PROCESSOR_ARCHITECTURE') == 'AMD64' or
os.environ.get('PROCESSOR_ARCHITEW6432') == 'AMD64'):
- # VS2013 non-Express has a x64-x86 cross that we want to prefer.
+ # VS2013 and later, non-Express have a x64-x86 cross that we want
+ # to prefer.
return [os.path.normpath(
os.path.join(self.path, 'VC/vcvarsall.bat')), 'amd64_x86']
# Otherwise, the standard x86 compiler.
diff --git a/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/__init__.py b/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/__init__.py
index ac6d918b849922..668f38b60d0093 100755
--- a/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/__init__.py
+++ b/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/__init__.py
@@ -49,7 +49,7 @@ def FindBuildFiles():
def Load(build_files, format, default_variables={},
includes=[], depth='.', params=None, check=False,
- circular_check=True):
+ circular_check=True, duplicate_basename_check=True):
"""
Loads one or more specified build files.
default_variables and includes will be copied before use.
@@ -126,6 +126,7 @@ def Load(build_files, format, default_variables={},
# Process the input specific to this generator.
result = gyp.input.Load(build_files, default_variables, includes[:],
depth, generator_input_info, check, circular_check,
+ duplicate_basename_check,
params['parallel'], params['root_targets'])
return [generator] + result
@@ -324,6 +325,16 @@ def gyp_main(args):
parser.add_option('--no-circular-check', dest='circular_check',
action='store_false', default=True, regenerate=False,
help="don't check for circular relationships between files")
+ # --no-duplicate-basename-check disables the check for duplicate basenames
+ # in a static_library/shared_library project. Visual C++ 2008 generator
+ # doesn't support this configuration. Libtool on Mac also generates warnings
+ # when duplicate basenames are passed into Make generator on Mac.
+ # TODO(yukawa): Remove this option when these legacy generators are
+ # deprecated.
+ parser.add_option('--no-duplicate-basename-check',
+ dest='duplicate_basename_check', action='store_false',
+ default=True, regenerate=False,
+ help="don't check for duplicate basenames")
parser.add_option('--no-parallel', action='store_true', default=False,
help='Disable multiprocessing')
parser.add_option('-S', '--suffix', dest='suffix', default='',
@@ -499,7 +510,8 @@ def gyp_main(args):
# Start with the default variables from the command line.
[generator, flat_list, targets, data] = Load(
build_files, format, cmdline_default_variables, includes, options.depth,
- params, options.check, options.circular_check)
+ params, options.check, options.circular_check,
+ options.duplicate_basename_check)
# TODO(mark): Pass |data| for now because the generator needs a list of
# build files that came in. In the future, maybe it should just accept
diff --git a/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/common.py b/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/common.py
index b6875e43efcbc4..256e3f3a6b2400 100644
--- a/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/common.py
+++ b/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/common.py
@@ -131,13 +131,20 @@ def QualifiedTarget(build_file, target, toolset):
@memoize
-def RelativePath(path, relative_to):
+def RelativePath(path, relative_to, follow_path_symlink=True):
# Assuming both |path| and |relative_to| are relative to the current
# directory, returns a relative path that identifies path relative to
# relative_to.
+ # If |follow_symlink_path| is true (default) and |path| is a symlink, then
+ # this method returns a path to the real file represented by |path|. If it is
+ # false, this method returns a path to the symlink. If |path| is not a
+ # symlink, this option has no effect.
# Convert to normalized (and therefore absolute paths).
- path = os.path.realpath(path)
+ if follow_path_symlink:
+ path = os.path.realpath(path)
+ else:
+ path = os.path.abspath(path)
relative_to = os.path.realpath(relative_to)
# On Windows, we can't create a relative path to a different drive, so just
@@ -418,6 +425,8 @@ def GetFlavor(params):
return 'freebsd'
if sys.platform.startswith('openbsd'):
return 'openbsd'
+ if sys.platform.startswith('netbsd'):
+ return 'netbsd'
if sys.platform.startswith('aix'):
return 'aix'
diff --git a/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/analyzer.py b/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/analyzer.py
index 15b80ef973793c..921c1a6b714328 100644
--- a/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/analyzer.py
+++ b/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/analyzer.py
@@ -7,23 +7,59 @@
the generator flag config_path) the path of a json file that dictates the files
and targets to search for. The following keys are supported:
files: list of paths (relative) of the files to search for.
-targets: list of targets to search for. The target names are unqualified.
+test_targets: unqualified target names to search for. Any target in this list
+that depends upon a file in |files| is output regardless of the type of target
+or chain of dependencies.
+additional_compile_targets: Unqualified targets to search for in addition to
+test_targets. Targets in the combined list that depend upon a file in |files|
+are not necessarily output. For example, if the target is of type none then the
+target is not output (but one of the descendants of the target will be).
The following is output:
error: only supplied if there is an error.
-targets: the set of targets passed in via targets that either directly or
- indirectly depend upon the set of paths supplied in files.
-build_targets: minimal set of targets that directly depend on the changed
- files and need to be built. The expectation is this set of targets is passed
- into a build step.
+compile_targets: minimal set of targets that directly or indirectly (for
+ targets of type none) depend on the files in |files| and is one of the
+ supplied targets or a target that one of the supplied targets depends on.
+ The expectation is this set of targets is passed into a build step. This list
+ always contains the output of test_targets as well.
+test_targets: set of targets from the supplied |test_targets| that either
+ directly or indirectly depend upon a file in |files|. This list if useful
+ if additional processing needs to be done for certain targets after the
+ build, such as running tests.
status: outputs one of three values: none of the supplied files were found,
one of the include files changed so that it should be assumed everything
- changed (in this case targets and build_targets are not output) or at
+ changed (in this case test_targets and compile_targets are not output) or at
least one file was found.
-invalid_targets: list of supplied targets thare were not found.
+invalid_targets: list of supplied targets that were not found.
+
+Example:
+Consider a graph like the following:
+ A D
+ / \
+B C
+A depends upon both B and C, A is of type none and B and C are executables.
+D is an executable, has no dependencies and nothing depends on it.
+If |additional_compile_targets| = ["A"], |test_targets| = ["B", "C"] and
+files = ["b.cc", "d.cc"] (B depends upon b.cc and D depends upon d.cc), then
+the following is output:
+|compile_targets| = ["B"] B must built as it depends upon the changed file b.cc
+and the supplied target A depends upon it. A is not output as a build_target
+as it is of type none with no rules and actions.
+|test_targets| = ["B"] B directly depends upon the change file b.cc.
+
+Even though the file d.cc, which D depends upon, has changed D is not output
+as it was not supplied by way of |additional_compile_targets| or |test_targets|.
If the generator flag analyzer_output_path is specified, output is written
there. Otherwise output is written to stdout.
+
+In Gyp the "all" target is shorthand for the root targets in the files passed
+to gyp. For example, if file "a.gyp" contains targets "a1" and
+"a2", and file "b.gyp" contains targets "b1" and "b2" and "a2" has a dependency
+on "b2" and gyp is supplied "a.gyp" then "all" consists of "a1" and "a2".
+Notice that "b1" and "b2" are not in the "all" target as "b.gyp" was not
+directly supplied to gyp. OTOH if both "a.gyp" and "b.gyp" are supplied to gyp
+then the "all" target includes "b1" and "b2".
"""
import gyp.common
@@ -183,7 +219,10 @@ class Target(object):
added_to_compile_targets: used when determining if the target was added to the
set of targets that needs to be built.
in_roots: true if this target is a descendant of one of the root nodes.
- is_executable: true if the type of target is executable."""
+ is_executable: true if the type of target is executable.
+ is_static_library: true if the type of target is static_library.
+ is_or_has_linked_ancestor: true if the target does a link (eg executable), or
+ if there is a target in back_deps that does a link."""
def __init__(self, name):
self.deps = set()
self.match_status = MATCH_STATUS_TBD
@@ -196,6 +235,8 @@ def __init__(self, name):
self.added_to_compile_targets = False
self.in_roots = False
self.is_executable = False
+ self.is_static_library = False
+ self.is_or_has_linked_ancestor = False
class Config(object):
@@ -205,6 +246,8 @@ class Config(object):
def __init__(self):
self.files = []
self.targets = set()
+ self.additional_compile_target_names = set()
+ self.test_target_names = set()
def Init(self, params):
"""Initializes Config. This is a separate method as it raises an exception
@@ -224,7 +267,9 @@ def Init(self, params):
if not isinstance(config, dict):
raise Exception('config_path must be a JSON file containing a dictionary')
self.files = config.get('files', [])
- self.targets = set(config.get('targets', []))
+ self.additional_compile_target_names = set(
+ config.get('additional_compile_targets', []))
+ self.test_target_names = set(config.get('test_targets', []))
def _WasBuildFileModified(build_file, data, files, toplevel_dir):
@@ -266,8 +311,8 @@ def _GetOrCreateTargetByName(targets, target_name):
def _DoesTargetTypeRequireBuild(target_dict):
"""Returns true if the target type is such that it needs to be built."""
# If a 'none' target has rules or actions we assume it requires a build.
- return target_dict['type'] != 'none' or \
- target_dict.get('actions') or target_dict.get('rules')
+ return bool(target_dict['type'] != 'none' or
+ target_dict.get('actions') or target_dict.get('rules'))
def _GenerateTargets(data, target_list, target_dicts, toplevel_dir, files,
@@ -275,12 +320,13 @@ def _GenerateTargets(data, target_list, target_dicts, toplevel_dir, files,
"""Returns a tuple of the following:
. A dictionary mapping from fully qualified name to Target.
. A list of the targets that have a source file in |files|.
- . Set of root Targets reachable from the the files |build_files|.
+ . Targets that constitute the 'all' target. See description at top of file
+ for details on the 'all' target.
This sets the |match_status| of the targets that contain any of the source
files in |files| to MATCH_STATUS_MATCHES.
|toplevel_dir| is the root of the source tree."""
# Maps from target name to Target.
- targets = {}
+ name_to_target = {}
# Targets that matched.
matching_targets = []
@@ -300,7 +346,8 @@ def _GenerateTargets(data, target_list, target_dicts, toplevel_dir, files,
while len(targets_to_visit) > 0:
target_name = targets_to_visit.pop()
- created_target, target = _GetOrCreateTargetByName(targets, target_name)
+ created_target, target = _GetOrCreateTargetByName(name_to_target,
+ target_name)
if created_target:
roots.add(target)
elif target.visited:
@@ -309,7 +356,11 @@ def _GenerateTargets(data, target_list, target_dicts, toplevel_dir, files,
target.visited = True
target.requires_build = _DoesTargetTypeRequireBuild(
target_dicts[target_name])
- target.is_executable = target_dicts[target_name]['type'] == 'executable'
+ target_type = target_dicts[target_name]['type']
+ target.is_executable = target_type == 'executable'
+ target.is_static_library = target_type == 'static_library'
+ target.is_or_has_linked_ancestor = (target_type == 'executable' or
+ target_type == 'shared_library')
build_file = gyp.common.ParseQualifiedTarget(target_name)[0]
if not build_file in build_file_in_files:
@@ -329,7 +380,7 @@ def _GenerateTargets(data, target_list, target_dicts, toplevel_dir, files,
sources = _ExtractSources(target_name, target_dicts[target_name],
toplevel_dir)
for source in sources:
- if source in files:
+ if _ToGypPath(os.path.normpath(source)) in files:
print 'target', target_name, 'matches', source
target.match_status = MATCH_STATUS_MATCHES
matching_targets.append(target)
@@ -339,22 +390,25 @@ def _GenerateTargets(data, target_list, target_dicts, toplevel_dir, files,
for dep in target_dicts[target_name].get('dependencies', []):
targets_to_visit.append(dep)
- created_dep_target, dep_target = _GetOrCreateTargetByName(targets, dep)
+ created_dep_target, dep_target = _GetOrCreateTargetByName(name_to_target,
+ dep)
if not created_dep_target:
roots.discard(dep_target)
target.deps.add(dep_target)
dep_target.back_deps.add(target)
- return targets, matching_targets, roots & build_file_targets
+ return name_to_target, matching_targets, roots & build_file_targets
def _GetUnqualifiedToTargetMapping(all_targets, to_find):
- """Returns a mapping (dictionary) from unqualified name to Target for all the
- Targets in |to_find|."""
+ """Returns a tuple of the following:
+ . mapping (dictionary) from unqualified name to Target for all the
+ Targets in |to_find|.
+ . any target names not found. If this is empty all targets were found."""
result = {}
if not to_find:
- return result
+ return {}, []
to_find = set(to_find)
for target_name in all_targets.keys():
extracted = gyp.common.ParseQualifiedTarget(target_name)
@@ -362,13 +416,14 @@ def _GetUnqualifiedToTargetMapping(all_targets, to_find):
to_find.remove(extracted[1])
result[extracted[1]] = all_targets[target_name]
if not to_find:
- return result
- return result
+ return result, []
+ return result, [x for x in to_find]
-def _DoesTargetDependOn(target):
- """Returns true if |target| or any of its dependencies matches the supplied
- set of paths. This updates |matches| of the Targets as it recurses.
+def _DoesTargetDependOnMatchingTargets(target):
+ """Returns true if |target| or any of its dependencies is one of the
+ targets containing the files supplied as input to analyzer. This updates
+ |matches| of the Targets as it recurses.
target: the Target to look for."""
if target.match_status == MATCH_STATUS_DOESNT_MATCH:
return False
@@ -376,25 +431,28 @@ def _DoesTargetDependOn(target):
target.match_status == MATCH_STATUS_MATCHES_BY_DEPENDENCY:
return True
for dep in target.deps:
- if _DoesTargetDependOn(dep):
+ if _DoesTargetDependOnMatchingTargets(dep):
target.match_status = MATCH_STATUS_MATCHES_BY_DEPENDENCY
+ print '\t', target.name, 'matches by dep', dep.name
return True
target.match_status = MATCH_STATUS_DOESNT_MATCH
return False
-def _GetTargetsDependingOn(possible_targets):
+def _GetTargetsDependingOnMatchingTargets(possible_targets):
"""Returns the list of Targets in |possible_targets| that depend (either
- directly on indirectly) on the matched targets.
+ directly on indirectly) on at least one of the targets containing the files
+ supplied as input to analyzer.
possible_targets: targets to search from."""
found = []
+ print 'Targets that matched by dependency:'
for target in possible_targets:
- if _DoesTargetDependOn(target):
+ if _DoesTargetDependOnMatchingTargets(target):
found.append(target)
return found
-def _AddBuildTargets(target, roots, add_if_no_ancestor, result):
+def _AddCompileTargets(target, roots, add_if_no_ancestor, result):
"""Recurses through all targets that depend on |target|, adding all targets
that need to be built (and are in |roots|) to |result|.
roots: set of root targets.
@@ -405,31 +463,45 @@ def _AddBuildTargets(target, roots, add_if_no_ancestor, result):
return
target.visited = True
- target.in_roots = not target.back_deps and target in roots
+ target.in_roots = target in roots
for back_dep_target in target.back_deps:
- _AddBuildTargets(back_dep_target, roots, False, result)
+ _AddCompileTargets(back_dep_target, roots, False, result)
target.added_to_compile_targets |= back_dep_target.added_to_compile_targets
target.in_roots |= back_dep_target.in_roots
+ target.is_or_has_linked_ancestor |= (
+ back_dep_target.is_or_has_linked_ancestor)
# Always add 'executable' targets. Even though they may be built by other
# targets that depend upon them it makes detection of what is going to be
# built easier.
+ # And always add static_libraries that have no dependencies on them from
+ # linkables. This is necessary as the other dependencies on them may be
+ # static libraries themselves, which are not compile time dependencies.
if target.in_roots and \
(target.is_executable or
(not target.added_to_compile_targets and
- (add_if_no_ancestor or target.requires_build))):
+ (add_if_no_ancestor or target.requires_build)) or
+ (target.is_static_library and add_if_no_ancestor and
+ not target.is_or_has_linked_ancestor)):
+ print '\t\tadding to compile targets', target.name, 'executable', \
+ target.is_executable, 'added_to_compile_targets', \
+ target.added_to_compile_targets, 'add_if_no_ancestor', \
+ add_if_no_ancestor, 'requires_build', target.requires_build, \
+ 'is_static_library', target.is_static_library, \
+ 'is_or_has_linked_ancestor', target.is_or_has_linked_ancestor
result.add(target)
target.added_to_compile_targets = True
-def _GetBuildTargets(matching_targets, roots):
+def _GetCompileTargets(matching_targets, supplied_targets):
"""Returns the set of Targets that require a build.
matching_targets: targets that changed and need to be built.
- roots: set of root targets in the build files to search from."""
+ supplied_targets: set of targets supplied to analyzer to search from."""
result = set()
for target in matching_targets:
- _AddBuildTargets(target, roots, True, result)
+ print 'finding compile targets for match', target.name
+ _AddCompileTargets(target, supplied_targets, True, result)
return result
@@ -454,6 +526,16 @@ def _WriteOutput(params, **values):
print 'Targets that require a build:'
for target in values['build_targets']:
print '\t', target
+ if 'compile_targets' in values:
+ values['compile_targets'].sort()
+ print 'Targets that need to be built:'
+ for target in values['compile_targets']:
+ print '\t', target
+ if 'test_targets' in values:
+ values['test_targets'].sort()
+ print 'Test targets:'
+ for target in values['test_targets']:
+ print '\t', target
output_path = params.get('generator_flags', {}).get(
'analyzer_output_path', None)
@@ -473,7 +555,7 @@ def _WasGypIncludeFileModified(params, files):
files."""
if params['options'].includes:
for include in params['options'].includes:
- if _ToGypPath(include) in files:
+ if _ToGypPath(os.path.normpath(include)) in files:
print 'Include file modified, assuming all changed', include
return True
return False
@@ -513,11 +595,104 @@ def CalculateVariables(default_variables, params):
default_variables.setdefault('OS', operating_system)
+class TargetCalculator(object):
+ """Calculates the matching test_targets and matching compile_targets."""
+ def __init__(self, files, additional_compile_target_names, test_target_names,
+ data, target_list, target_dicts, toplevel_dir, build_files):
+ self._additional_compile_target_names = set(additional_compile_target_names)
+ self._test_target_names = set(test_target_names)
+ self._name_to_target, self._changed_targets, self._root_targets = (
+ _GenerateTargets(data, target_list, target_dicts, toplevel_dir,
+ frozenset(files), build_files))
+ self._unqualified_mapping, self.invalid_targets = (
+ _GetUnqualifiedToTargetMapping(self._name_to_target,
+ self._supplied_target_names_no_all()))
+
+ def _supplied_target_names(self):
+ return self._additional_compile_target_names | self._test_target_names
+
+ def _supplied_target_names_no_all(self):
+ """Returns the supplied test targets without 'all'."""
+ result = self._supplied_target_names();
+ result.discard('all')
+ return result
+
+ def is_build_impacted(self):
+ """Returns true if the supplied files impact the build at all."""
+ return self._changed_targets
+
+ def find_matching_test_target_names(self):
+ """Returns the set of output test targets."""
+ assert self.is_build_impacted()
+ # Find the test targets first. 'all' is special cased to mean all the
+ # root targets. To deal with all the supplied |test_targets| are expanded
+ # to include the root targets during lookup. If any of the root targets
+ # match, we remove it and replace it with 'all'.
+ test_target_names_no_all = set(self._test_target_names)
+ test_target_names_no_all.discard('all')
+ test_targets_no_all = _LookupTargets(test_target_names_no_all,
+ self._unqualified_mapping)
+ test_target_names_contains_all = 'all' in self._test_target_names
+ if test_target_names_contains_all:
+ test_targets = [x for x in (set(test_targets_no_all) |
+ set(self._root_targets))]
+ else:
+ test_targets = [x for x in test_targets_no_all]
+ print 'supplied test_targets'
+ for target_name in self._test_target_names:
+ print '\t', target_name
+ print 'found test_targets'
+ for target in test_targets:
+ print '\t', target.name
+ print 'searching for matching test targets'
+ matching_test_targets = _GetTargetsDependingOnMatchingTargets(test_targets)
+ matching_test_targets_contains_all = (test_target_names_contains_all and
+ set(matching_test_targets) &
+ set(self._root_targets))
+ if matching_test_targets_contains_all:
+ # Remove any of the targets for all that were not explicitly supplied,
+ # 'all' is subsequentely added to the matching names below.
+ matching_test_targets = [x for x in (set(matching_test_targets) &
+ set(test_targets_no_all))]
+ print 'matched test_targets'
+ for target in matching_test_targets:
+ print '\t', target.name
+ matching_target_names = [gyp.common.ParseQualifiedTarget(target.name)[1]
+ for target in matching_test_targets]
+ if matching_test_targets_contains_all:
+ matching_target_names.append('all')
+ print '\tall'
+ return matching_target_names
+
+ def find_matching_compile_target_names(self):
+ """Returns the set of output compile targets."""
+ assert self.is_build_impacted();
+ # Compile targets are found by searching up from changed targets.
+ # Reset the visited status for _GetBuildTargets.
+ for target in self._name_to_target.itervalues():
+ target.visited = False
+
+ supplied_targets = _LookupTargets(self._supplied_target_names_no_all(),
+ self._unqualified_mapping)
+ if 'all' in self._supplied_target_names():
+ supplied_targets = [x for x in (set(supplied_targets) |
+ set(self._root_targets))]
+ print 'Supplied test_targets & compile_targets'
+ for target in supplied_targets:
+ print '\t', target.name
+ print 'Finding compile targets'
+ compile_targets = _GetCompileTargets(self._changed_targets,
+ supplied_targets)
+ return [gyp.common.ParseQualifiedTarget(target.name)[1]
+ for target in compile_targets]
+
+
def GenerateOutput(target_list, target_dicts, data, params):
"""Called by gyp as the final stage. Outputs results."""
config = Config()
try:
config.Init(params)
+
if not config.files:
raise Exception('Must specify files to analyze via config_path generator '
'flag')
@@ -528,41 +703,38 @@ def GenerateOutput(target_list, target_dicts, data, params):
if _WasGypIncludeFileModified(params, config.files):
result_dict = { 'status': all_changed_string,
- 'targets': list(config.targets) }
+ 'test_targets': list(config.test_target_names),
+ 'compile_targets': list(
+ config.additional_compile_target_names |
+ config.test_target_names) }
_WriteOutput(params, **result_dict)
return
- all_targets, matching_targets, roots = _GenerateTargets(
- data, target_list, target_dicts, toplevel_dir, frozenset(config.files),
- params['build_files'])
-
- unqualified_mapping = _GetUnqualifiedToTargetMapping(all_targets,
- config.targets)
- invalid_targets = None
- if len(unqualified_mapping) != len(config.targets):
- invalid_targets = _NamesNotIn(config.targets, unqualified_mapping)
-
- if matching_targets:
- search_targets = _LookupTargets(config.targets, unqualified_mapping)
- matched_search_targets = _GetTargetsDependingOn(search_targets)
- # Reset the visited status for _GetBuildTargets.
- for target in all_targets.itervalues():
- target.visited = False
- build_targets = _GetBuildTargets(matching_targets, roots)
- matched_search_targets = [gyp.common.ParseQualifiedTarget(target.name)[1]
- for target in matched_search_targets]
- build_targets = [gyp.common.ParseQualifiedTarget(target.name)[1]
- for target in build_targets]
- else:
- matched_search_targets = []
- build_targets = []
-
- result_dict = { 'targets': matched_search_targets,
- 'status': found_dependency_string if matching_targets else
- no_dependency_string,
- 'build_targets': build_targets}
- if invalid_targets:
- result_dict['invalid_targets'] = invalid_targets
+ calculator = TargetCalculator(config.files,
+ config.additional_compile_target_names,
+ config.test_target_names, data,
+ target_list, target_dicts, toplevel_dir,
+ params['build_files'])
+ if not calculator.is_build_impacted():
+ result_dict = { 'status': no_dependency_string,
+ 'test_targets': [],
+ 'compile_targets': [] }
+ if calculator.invalid_targets:
+ result_dict['invalid_targets'] = calculator.invalid_targets
+ _WriteOutput(params, **result_dict)
+ return
+
+ test_target_names = calculator.find_matching_test_target_names()
+ compile_target_names = calculator.find_matching_compile_target_names()
+ found_at_least_one_target = compile_target_names or test_target_names
+ result_dict = { 'test_targets': test_target_names,
+ 'status': found_dependency_string if
+ found_at_least_one_target else no_dependency_string,
+ 'compile_targets': list(
+ set(compile_target_names) |
+ set(test_target_names)) }
+ if calculator.invalid_targets:
+ result_dict['invalid_targets'] = calculator.invalid_targets
_WriteOutput(params, **result_dict)
except Exception as e:
diff --git a/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/cmake.py b/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/cmake.py
index 8f5feddee1cb35..17f5e6396c6303 100644
--- a/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/cmake.py
+++ b/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/cmake.py
@@ -55,7 +55,7 @@
'CONFIGURATION_NAME': '${configuration}',
}
-FULL_PATH_VARS = ('${CMAKE_SOURCE_DIR}', '${builddir}', '${obj}')
+FULL_PATH_VARS = ('${CMAKE_CURRENT_LIST_DIR}', '${builddir}', '${obj}')
generator_supports_multiple_toolsets = True
generator_wants_static_library_dependencies_adjusted = True
@@ -103,7 +103,7 @@ def NormjoinPathForceCMakeSource(base_path, rel_path):
if any([rel_path.startswith(var) for var in FULL_PATH_VARS]):
return rel_path
# TODO: do we need to check base_path for absolute variables as well?
- return os.path.join('${CMAKE_SOURCE_DIR}',
+ return os.path.join('${CMAKE_CURRENT_LIST_DIR}',
os.path.normpath(os.path.join(base_path, rel_path)))
@@ -150,20 +150,17 @@ def SetFileProperty(output, source_name, property_name, values, sep):
output.write('")\n')
-def SetFilesProperty(output, source_names, property_name, values, sep):
+def SetFilesProperty(output, variable, property_name, values, sep):
"""Given a set of source files, sets the given property on them."""
- output.write('set_source_files_properties(\n')
- for source_name in source_names:
- output.write(' ')
- output.write(source_name)
- output.write('\n')
- output.write(' PROPERTIES\n ')
+ output.write('set_source_files_properties(')
+ WriteVariable(output, variable)
+ output.write(' PROPERTIES ')
output.write(property_name)
output.write(' "')
for value in values:
output.write(CMakeStringEscape(value))
output.write(sep)
- output.write('"\n)\n')
+ output.write('")\n')
def SetTargetProperty(output, target_name, property_name, values, sep=''):
@@ -236,11 +233,11 @@ def StringToCMakeTargetName(a):
"""Converts the given string 'a' to a valid CMake target name.
All invalid characters are replaced by '_'.
- Invalid for cmake: ' ', '/', '(', ')'
+ Invalid for cmake: ' ', '/', '(', ')', '"'
Invalid for make: ':'
Invalid for unknown reasons but cause failures: '.'
"""
- return a.translate(string.maketrans(' /():.', '______'))
+ return a.translate(string.maketrans(' /():."', '_______'))
def WriteActions(target_name, actions, extra_sources, extra_deps,
@@ -296,7 +293,7 @@ def WriteActions(target_name, actions, extra_sources, extra_deps,
WriteVariable(output, inputs_name)
output.write('\n')
- output.write(' WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/')
+ output.write(' WORKING_DIRECTORY ${CMAKE_CURRENT_LIST_DIR}/')
output.write(path_to_gyp)
output.write('\n')
@@ -401,9 +398,9 @@ def WriteRules(target_name, rules, extra_sources, extra_deps,
output.write(NormjoinPath(path_to_gyp, rule_source))
output.write('\n')
- # CMAKE_SOURCE_DIR is where the CMakeLists.txt lives.
+ # CMAKE_CURRENT_LIST_DIR is where the CMakeLists.txt lives.
# The cwd is the current build directory.
- output.write(' WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/')
+ output.write(' WORKING_DIRECTORY ${CMAKE_CURRENT_LIST_DIR}/')
output.write(path_to_gyp)
output.write('\n')
@@ -488,7 +485,7 @@ def __init__(self, ext, command):
copy = file_copy if os.path.basename(src) else dir_copy
- copy.cmake_inputs.append(NormjoinPath(path_to_gyp, src))
+ copy.cmake_inputs.append(NormjoinPathForceCMakeSource(path_to_gyp, src))
copy.cmake_outputs.append(NormjoinPathForceCMakeSource(path_to_gyp, dst))
copy.gyp_inputs.append(src)
copy.gyp_outputs.append(dst)
@@ -525,7 +522,7 @@ def __init__(self, ext, command):
WriteVariable(output, copy.inputs_name, ' ')
output.write('\n')
- output.write('WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/')
+ output.write('WORKING_DIRECTORY ${CMAKE_CURRENT_LIST_DIR}/')
output.write(path_to_gyp)
output.write('\n')
@@ -640,6 +637,12 @@ def WriteTarget(namer, qualified_target, target_dicts, build_dir, config_to_use,
target_type = spec.get('type', '')
target_toolset = spec.get('toolset')
+ cmake_target_type = cmake_target_type_from_gyp_target_type.get(target_type)
+ if cmake_target_type is None:
+ print ('Target %s has unknown target type %s, skipping.' %
+ ( target_name, target_type ) )
+ return
+
SetVariable(output, 'TARGET', target_name)
SetVariable(output, 'TOOLSET', target_toolset)
@@ -667,27 +670,89 @@ def WriteTarget(namer, qualified_target, target_dicts, build_dir, config_to_use,
srcs = spec.get('sources', [])
# Gyp separates the sheep from the goats based on file extensions.
- def partition(l, p):
- return reduce(lambda x, e: x[not p(e)].append(e) or x, l, ([], []))
- compilable_srcs, other_srcs = partition(srcs, Compilable)
+ # A full separation is done here because of flag handing (see below).
+ s_sources = []
+ c_sources = []
+ cxx_sources = []
+ linkable_sources = []
+ other_sources = []
+ for src in srcs:
+ _, ext = os.path.splitext(src)
+ src_type = COMPILABLE_EXTENSIONS.get(ext, None)
+ src_norm_path = NormjoinPath(path_from_cmakelists_to_gyp, src);
- # CMake gets upset when executable targets provide no sources.
- if target_type == 'executable' and not compilable_srcs and not extra_sources:
- print ('Executable %s has no complilable sources, treating as "none".' %
- target_name )
- target_type = 'none'
+ if src_type == 's':
+ s_sources.append(src_norm_path)
+ elif src_type == 'cc':
+ c_sources.append(src_norm_path)
+ elif src_type == 'cxx':
+ cxx_sources.append(src_norm_path)
+ elif Linkable(ext):
+ linkable_sources.append(src_norm_path)
+ else:
+ other_sources.append(src_norm_path)
- cmake_target_type = cmake_target_type_from_gyp_target_type.get(target_type)
- if cmake_target_type is None:
- print ('Target %s has unknown target type %s, skipping.' %
- ( target_name, target_type ) )
- return
+ for extra_source in extra_sources:
+ src, real_source = extra_source
+ _, ext = os.path.splitext(real_source)
+ src_type = COMPILABLE_EXTENSIONS.get(ext, None)
+
+ if src_type == 's':
+ s_sources.append(src)
+ elif src_type == 'cc':
+ c_sources.append(src)
+ elif src_type == 'cxx':
+ cxx_sources.append(src)
+ elif Linkable(ext):
+ linkable_sources.append(src)
+ else:
+ other_sources.append(src)
+
+ s_sources_name = None
+ if s_sources:
+ s_sources_name = cmake_target_name + '__asm_srcs'
+ SetVariableList(output, s_sources_name, s_sources)
+
+ c_sources_name = None
+ if c_sources:
+ c_sources_name = cmake_target_name + '__c_srcs'
+ SetVariableList(output, c_sources_name, c_sources)
+
+ cxx_sources_name = None
+ if cxx_sources:
+ cxx_sources_name = cmake_target_name + '__cxx_srcs'
+ SetVariableList(output, cxx_sources_name, cxx_sources)
+
+ linkable_sources_name = None
+ if linkable_sources:
+ linkable_sources_name = cmake_target_name + '__linkable_srcs'
+ SetVariableList(output, linkable_sources_name, linkable_sources)
+
+ other_sources_name = None
+ if other_sources:
+ other_sources_name = cmake_target_name + '__other_srcs'
+ SetVariableList(output, other_sources_name, other_sources)
+
+ # CMake gets upset when executable targets provide no sources.
+ # http://www.cmake.org/pipermail/cmake/2010-July/038461.html
+ dummy_sources_name = None
+ has_sources = (s_sources_name or
+ c_sources_name or
+ cxx_sources_name or
+ linkable_sources_name or
+ other_sources_name)
+ if target_type == 'executable' and not has_sources:
+ dummy_sources_name = cmake_target_name + '__dummy_srcs'
+ SetVariable(output, dummy_sources_name,
+ "${obj}.${TOOLSET}/${TARGET}/genc/dummy.c")
+ output.write('if(NOT EXISTS "')
+ WriteVariable(output, dummy_sources_name)
+ output.write('")\n')
+ output.write(' file(WRITE "')
+ WriteVariable(output, dummy_sources_name)
+ output.write('" "")\n')
+ output.write("endif()\n")
- other_srcs_name = None
- if other_srcs:
- other_srcs_name = cmake_target_name + '__other_srcs'
- SetVariableList(output, other_srcs_name,
- [NormjoinPath(path_from_cmakelists_to_gyp, src) for src in other_srcs])
# CMake is opposed to setting linker directories and considers the practice
# of setting linker directories dangerous. Instead, it favors the use of
@@ -713,31 +778,48 @@ def partition(l, p):
output.write(' ')
output.write(cmake_target_type.modifier)
- if other_srcs_name:
- WriteVariable(output, other_srcs_name, ' ')
-
- output.write('\n')
-
- for src in compilable_srcs:
- output.write(' ')
- output.write(NormjoinPath(path_from_cmakelists_to_gyp, src))
- output.write('\n')
- for extra_source in extra_sources:
- output.write(' ')
- src, _ = extra_source
- output.write(NormjoinPath(path_from_cmakelists_to_gyp, src))
- output.write('\n')
+ if s_sources_name:
+ WriteVariable(output, s_sources_name, ' ')
+ if c_sources_name:
+ WriteVariable(output, c_sources_name, ' ')
+ if cxx_sources_name:
+ WriteVariable(output, cxx_sources_name, ' ')
+ if linkable_sources_name:
+ WriteVariable(output, linkable_sources_name, ' ')
+ if other_sources_name:
+ WriteVariable(output, other_sources_name, ' ')
+ if dummy_sources_name:
+ WriteVariable(output, dummy_sources_name, ' ')
output.write(')\n')
+ # Let CMake know if the 'all' target should depend on this target.
+ exclude_from_all = ('TRUE' if qualified_target not in all_qualified_targets
+ else 'FALSE')
+ SetTargetProperty(output, cmake_target_name,
+ 'EXCLUDE_FROM_ALL', exclude_from_all)
+ for extra_target_name in extra_deps:
+ SetTargetProperty(output, extra_target_name,
+ 'EXCLUDE_FROM_ALL', exclude_from_all)
+
# Output name and location.
if target_type != 'none':
+ # Link as 'C' if there are no other files
+ if not c_sources and not cxx_sources:
+ SetTargetProperty(output, cmake_target_name, 'LINKER_LANGUAGE', ['C'])
+
# Mark uncompiled sources as uncompiled.
- if other_srcs_name:
+ if other_sources_name:
output.write('set_source_files_properties(')
- WriteVariable(output, other_srcs_name, '')
+ WriteVariable(output, other_sources_name, '')
output.write(' PROPERTIES HEADER_FILE_ONLY "TRUE")\n')
+ # Mark object sources as linkable.
+ if linkable_sources_name:
+ output.write('set_source_files_properties(')
+ WriteVariable(output, other_sources_name, '')
+ output.write(' PROPERTIES EXTERNAL_OBJECT "TRUE")\n')
+
# Output directory
target_output_directory = spec.get('product_dir')
if target_output_directory is None:
@@ -804,122 +886,84 @@ def partition(l, p):
cmake_target_output_basename)
SetFileProperty(output, cmake_target_output, 'GENERATED', ['TRUE'], '')
- # Let CMake know if the 'all' target should depend on this target.
- exclude_from_all = ('TRUE' if qualified_target not in all_qualified_targets
- else 'FALSE')
- SetTargetProperty(output, cmake_target_name,
- 'EXCLUDE_FROM_ALL', exclude_from_all)
- for extra_target_name in extra_deps:
- SetTargetProperty(output, extra_target_name,
- 'EXCLUDE_FROM_ALL', exclude_from_all)
-
- # Includes
- includes = config.get('include_dirs')
- if includes:
- # This (target include directories) is what requires CMake 2.8.8
- includes_name = cmake_target_name + '__include_dirs'
- SetVariableList(output, includes_name,
- [NormjoinPathForceCMakeSource(path_from_cmakelists_to_gyp, include)
- for include in includes])
- output.write('set_property(TARGET ')
- output.write(cmake_target_name)
- output.write(' APPEND PROPERTY INCLUDE_DIRECTORIES ')
- WriteVariable(output, includes_name, '')
- output.write(')\n')
-
- # Defines
- defines = config.get('defines')
- if defines is not None:
- SetTargetProperty(output,
- cmake_target_name,
- 'COMPILE_DEFINITIONS',
- defines,
- ';')
-
- # Compile Flags - http://www.cmake.org/Bug/view.php?id=6493
- # CMake currently does not have target C and CXX flags.
- # So, instead of doing...
-
- # cflags_c = config.get('cflags_c')
- # if cflags_c is not None:
- # SetTargetProperty(output, cmake_target_name,
- # 'C_COMPILE_FLAGS', cflags_c, ' ')
-
- # cflags_cc = config.get('cflags_cc')
- # if cflags_cc is not None:
- # SetTargetProperty(output, cmake_target_name,
- # 'CXX_COMPILE_FLAGS', cflags_cc, ' ')
-
- # Instead we must...
- s_sources = []
- c_sources = []
- cxx_sources = []
- for src in srcs:
- _, ext = os.path.splitext(src)
- src_type = COMPILABLE_EXTENSIONS.get(ext, None)
-
- if src_type == 's':
- s_sources.append(NormjoinPath(path_from_cmakelists_to_gyp, src))
-
- if src_type == 'cc':
- c_sources.append(NormjoinPath(path_from_cmakelists_to_gyp, src))
-
- if src_type == 'cxx':
- cxx_sources.append(NormjoinPath(path_from_cmakelists_to_gyp, src))
-
- for extra_source in extra_sources:
- src, real_source = extra_source
- _, ext = os.path.splitext(real_source)
- src_type = COMPILABLE_EXTENSIONS.get(ext, None)
-
- if src_type == 's':
- s_sources.append(NormjoinPath(path_from_cmakelists_to_gyp, src))
-
- if src_type == 'cc':
- c_sources.append(NormjoinPath(path_from_cmakelists_to_gyp, src))
-
- if src_type == 'cxx':
- cxx_sources.append(NormjoinPath(path_from_cmakelists_to_gyp, src))
-
- cflags = config.get('cflags', [])
- cflags_c = config.get('cflags_c', [])
- cflags_cxx = config.get('cflags_cc', [])
- if c_sources and not (s_sources or cxx_sources):
- flags = []
- flags.extend(cflags)
- flags.extend(cflags_c)
- SetTargetProperty(output, cmake_target_name, 'COMPILE_FLAGS', flags, ' ')
-
- elif cxx_sources and not (s_sources or c_sources):
- flags = []
- flags.extend(cflags)
- flags.extend(cflags_cxx)
- SetTargetProperty(output, cmake_target_name, 'COMPILE_FLAGS', flags, ' ')
-
- else:
- if s_sources and cflags:
- SetFilesProperty(output, s_sources, 'COMPILE_FLAGS', cflags, ' ')
+ # Includes
+ includes = config.get('include_dirs')
+ if includes:
+ # This (target include directories) is what requires CMake 2.8.8
+ includes_name = cmake_target_name + '__include_dirs'
+ SetVariableList(output, includes_name,
+ [NormjoinPathForceCMakeSource(path_from_cmakelists_to_gyp, include)
+ for include in includes])
+ output.write('set_property(TARGET ')
+ output.write(cmake_target_name)
+ output.write(' APPEND PROPERTY INCLUDE_DIRECTORIES ')
+ WriteVariable(output, includes_name, '')
+ output.write(')\n')
- if c_sources and (cflags or cflags_c):
+ # Defines
+ defines = config.get('defines')
+ if defines is not None:
+ SetTargetProperty(output,
+ cmake_target_name,
+ 'COMPILE_DEFINITIONS',
+ defines,
+ ';')
+
+ # Compile Flags - http://www.cmake.org/Bug/view.php?id=6493
+ # CMake currently does not have target C and CXX flags.
+ # So, instead of doing...
+
+ # cflags_c = config.get('cflags_c')
+ # if cflags_c is not None:
+ # SetTargetProperty(output, cmake_target_name,
+ # 'C_COMPILE_FLAGS', cflags_c, ' ')
+
+ # cflags_cc = config.get('cflags_cc')
+ # if cflags_cc is not None:
+ # SetTargetProperty(output, cmake_target_name,
+ # 'CXX_COMPILE_FLAGS', cflags_cc, ' ')
+
+ # Instead we must...
+ cflags = config.get('cflags', [])
+ cflags_c = config.get('cflags_c', [])
+ cflags_cxx = config.get('cflags_cc', [])
+ if (not cflags_c or not c_sources) and (not cflags_cxx or not cxx_sources):
+ SetTargetProperty(output, cmake_target_name, 'COMPILE_FLAGS', cflags, ' ')
+
+ elif c_sources and not (s_sources or cxx_sources):
flags = []
flags.extend(cflags)
flags.extend(cflags_c)
- SetFilesProperty(output, c_sources, 'COMPILE_FLAGS', flags, ' ')
+ SetTargetProperty(output, cmake_target_name, 'COMPILE_FLAGS', flags, ' ')
- if cxx_sources and (cflags or cflags_cxx):
+ elif cxx_sources and not (s_sources or c_sources):
flags = []
flags.extend(cflags)
flags.extend(cflags_cxx)
- SetFilesProperty(output, cxx_sources, 'COMPILE_FLAGS', flags, ' ')
+ SetTargetProperty(output, cmake_target_name, 'COMPILE_FLAGS', flags, ' ')
- # Have assembly link as c if there are no other files
- if not c_sources and not cxx_sources and s_sources:
- SetTargetProperty(output, cmake_target_name, 'LINKER_LANGUAGE', ['C'])
-
- # Linker flags
- ldflags = config.get('ldflags')
- if ldflags is not None:
- SetTargetProperty(output, cmake_target_name, 'LINK_FLAGS', ldflags, ' ')
+ else:
+ # TODO: This is broken, one cannot generally set properties on files,
+ # as other targets may require different properties on the same files.
+ if s_sources and cflags:
+ SetFilesProperty(output, s_sources_name, 'COMPILE_FLAGS', cflags, ' ')
+
+ if c_sources and (cflags or cflags_c):
+ flags = []
+ flags.extend(cflags)
+ flags.extend(cflags_c)
+ SetFilesProperty(output, c_sources_name, 'COMPILE_FLAGS', flags, ' ')
+
+ if cxx_sources and (cflags or cflags_cxx):
+ flags = []
+ flags.extend(cflags)
+ flags.extend(cflags_cxx)
+ SetFilesProperty(output, cxx_sources_name, 'COMPILE_FLAGS', flags, ' ')
+
+ # Linker flags
+ ldflags = config.get('ldflags')
+ if ldflags is not None:
+ SetTargetProperty(output, cmake_target_name, 'LINK_FLAGS', ldflags, ' ')
# Note on Dependencies and Libraries:
# CMake wants to handle link order, resolving the link line up front.
@@ -1040,20 +1084,49 @@ def GenerateOutputForConfig(target_list, target_dicts, data,
output.write('cmake_minimum_required(VERSION 2.8.8 FATAL_ERROR)\n')
output.write('cmake_policy(VERSION 2.8.8)\n')
- _, project_target, _ = gyp.common.ParseQualifiedTarget(target_list[-1])
+ gyp_file, project_target, _ = gyp.common.ParseQualifiedTarget(target_list[-1])
output.write('project(')
output.write(project_target)
output.write(')\n')
SetVariable(output, 'configuration', config_to_use)
+ ar = None
+ cc = None
+ cxx = None
+
+ make_global_settings = data[gyp_file].get('make_global_settings', [])
+ build_to_top = gyp.common.InvertRelativePath(build_dir,
+ options.toplevel_dir)
+ for key, value in make_global_settings:
+ if key == 'AR':
+ ar = os.path.join(build_to_top, value)
+ if key == 'CC':
+ cc = os.path.join(build_to_top, value)
+ if key == 'CXX':
+ cxx = os.path.join(build_to_top, value)
+
+ ar = gyp.common.GetEnvironFallback(['AR_target', 'AR'], ar)
+ cc = gyp.common.GetEnvironFallback(['CC_target', 'CC'], cc)
+ cxx = gyp.common.GetEnvironFallback(['CXX_target', 'CXX'], cxx)
+
+ if ar:
+ SetVariable(output, 'CMAKE_AR', ar)
+ if cc:
+ SetVariable(output, 'CMAKE_C_COMPILER', cc)
+ if cxx:
+ SetVariable(output, 'CMAKE_CXX_COMPILER', cxx)
+
# The following appears to be as-yet undocumented.
# http://public.kitware.com/Bug/view.php?id=8392
output.write('enable_language(ASM)\n')
# ASM-ATT does not support .S files.
# output.write('enable_language(ASM-ATT)\n')
- SetVariable(output, 'builddir', '${CMAKE_BINARY_DIR}')
+ if cc:
+ SetVariable(output, 'CMAKE_ASM_COMPILER', cc)
+
+ SetVariable(output, 'builddir', '${CMAKE_CURRENT_BINARY_DIR}')
SetVariable(output, 'obj', '${builddir}/obj')
output.write('\n')
@@ -1066,6 +1139,11 @@ def GenerateOutputForConfig(target_list, target_dicts, data,
output.write('set(CMAKE_CXX_OUTPUT_EXTENSION_REPLACE 1)\n')
output.write('\n')
+ # Force ninja to use rsp files. Otherwise link and ar lines can get too long,
+ # resulting in 'Argument list too long' errors.
+ output.write('set(CMAKE_NINJA_FORCE_RESPONSE_FILE 1)\n')
+ output.write('\n')
+
namer = CMakeNamer(target_list)
# The list of targets upon which the 'all' target should depend.
diff --git a/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/dump_dependency_json.py b/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/dump_dependency_json.py
index 927ba6ebad771c..160eafe2efeca0 100644
--- a/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/dump_dependency_json.py
+++ b/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/dump_dependency_json.py
@@ -14,6 +14,9 @@
generator_wants_static_library_dependencies_adjusted = False
+generator_filelist_paths = {
+}
+
generator_default_variables = {
}
for dirname in ['INTERMEDIATE_DIR', 'SHARED_INTERMEDIATE_DIR', 'PRODUCT_DIR',
@@ -56,6 +59,17 @@ def CalculateGeneratorInputInfo(params):
global generator_wants_static_library_dependencies_adjusted
generator_wants_static_library_dependencies_adjusted = True
+ toplevel = params['options'].toplevel_dir
+ generator_dir = os.path.relpath(params['options'].generator_output or '.')
+ # output_dir: relative path from generator_dir to the build directory.
+ output_dir = generator_flags.get('output_dir', 'out')
+ qualified_out_dir = os.path.normpath(os.path.join(
+ toplevel, generator_dir, output_dir, 'gypfiles'))
+ global generator_filelist_paths
+ generator_filelist_paths = {
+ 'toplevel': toplevel,
+ 'qualified_out_dir': qualified_out_dir,
+ }
def GenerateOutput(target_list, target_dicts, data, params):
# Map of target -> list of targets it depends on.
@@ -74,7 +88,11 @@ def GenerateOutput(target_list, target_dicts, data, params):
edges[target].append(dep)
targets_to_visit.append(dep)
- filename = 'dump.json'
+ try:
+ filepath = params['generator_flags']['output_dir']
+ except KeyError:
+ filepath = '.'
+ filename = os.path.join(filepath, 'dump.json')
f = open(filename, 'w')
json.dump(edges, f)
f.close()
diff --git a/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/make.py b/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/make.py
index 06c7fdc2e84ce8..aefdac787c2408 100644
--- a/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/make.py
+++ b/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/make.py
@@ -211,10 +211,10 @@ def CalculateGeneratorInputInfo(params):
LINK_COMMANDS_AIX = """\
quiet_cmd_alink = AR($(TOOLSET)) $@
-cmd_alink = rm -f $@ && $(AR.$(TOOLSET)) crs $@ $(filter %.o,$^)
+cmd_alink = rm -f $@ && $(AR.$(TOOLSET)) -X32_64 crs $@ $(filter %.o,$^)
quiet_cmd_alink_thin = AR($(TOOLSET)) $@
-cmd_alink_thin = rm -f $@ && $(AR.$(TOOLSET)) crs $@ $(filter %.o,$^)
+cmd_alink_thin = rm -f $@ && $(AR.$(TOOLSET)) -X32_64 crs $@ $(filter %.o,$^)
quiet_cmd_link = LINK($(TOOLSET)) $@
cmd_link = $(LINK.$(TOOLSET)) $(GYP_LDFLAGS) $(LDFLAGS.$(TOOLSET)) -o $@ $(LD_INPUTS) $(LIBS)
@@ -273,9 +273,9 @@ def CalculateGeneratorInputInfo(params):
%(make_global_settings)s
CC.target ?= %(CC.target)s
-CFLAGS.target ?= $(CFLAGS)
+CFLAGS.target ?= $(CPPFLAGS) $(CFLAGS)
CXX.target ?= %(CXX.target)s
-CXXFLAGS.target ?= $(CXXFLAGS)
+CXXFLAGS.target ?= $(CPPFLAGS) $(CXXFLAGS)
LINK.target ?= %(LINK.target)s
LDFLAGS.target ?= $(LDFLAGS)
AR.target ?= $(AR)
@@ -286,9 +286,9 @@ def CalculateGeneratorInputInfo(params):
# TODO(evan): move all cross-compilation logic to gyp-time so we don't need
# to replicate this environment fallback in make as well.
CC.host ?= %(CC.host)s
-CFLAGS.host ?=
+CFLAGS.host ?= $(CPPFLAGS_host) $(CFLAGS_host)
CXX.host ?= %(CXX.host)s
-CXXFLAGS.host ?=
+CXXFLAGS.host ?= $(CPPFLAGS_host) $(CXXFLAGS_host)
LINK.host ?= %(LINK.host)s
LDFLAGS.host ?=
AR.host ?= %(AR.host)s
@@ -365,7 +365,7 @@ def CalculateGeneratorInputInfo(params):
quiet_cmd_copy = COPY $@
# send stderr to /dev/null to ignore messages when linking directories.
-cmd_copy = rm -rf "$@" && cp -af "$<" "$@"
+cmd_copy = rm -rf "$@" && cp %(copy_archive_args)s "$<" "$@"
%(link_commands)s
"""
@@ -1019,7 +1019,8 @@ def WriteRules(self, rules, extra_sources, extra_outputs,
# accidentally writing duplicate dummy rules for those outputs.
self.WriteLn('%s: obj := $(abs_obj)' % outputs[0])
self.WriteLn('%s: builddir := $(abs_builddir)' % outputs[0])
- self.WriteMakeRule(outputs, inputs + ['FORCE_DO_CMD'], actions)
+ self.WriteMakeRule(outputs, inputs, actions,
+ command="%s_%d" % (name, count))
# Spaces in rule filenames are not supported, but rule variables have
# spaces in them (e.g. RULE_INPUT_PATH expands to '$(abspath $<)').
# The spaces within the variables are valid, so remove the variables
@@ -1578,7 +1579,7 @@ def WriteTarget(self, spec, configs, deps, link_deps, bundle_deps,
for link_dep in link_deps:
assert ' ' not in link_dep, (
"Spaces in alink input filenames not supported (%s)" % link_dep)
- if (self.flavor not in ('mac', 'openbsd', 'win') and not
+ if (self.flavor not in ('mac', 'openbsd', 'netbsd', 'win') and not
self.is_standalone_static_library):
self.WriteDoCmd([self.output_binary], link_deps, 'alink_thin',
part_of_all, postbuilds=postbuilds)
@@ -1688,6 +1689,7 @@ def WriteDoCmd(self, outputs, inputs, command, part_of_all, comment=None,
self.WriteMakeRule(outputs, inputs,
actions = ['$(call do_cmd,%s%s)' % (command, suffix)],
comment = comment,
+ command = command,
force = True)
# Add our outputs to the list of targets we read depfiles from.
# all_deps is only used for deps file reading, and for deps files we replace
@@ -1698,7 +1700,7 @@ def WriteDoCmd(self, outputs, inputs, command, part_of_all, comment=None,
def WriteMakeRule(self, outputs, inputs, actions=None, comment=None,
- order_only=False, force=False, phony=False):
+ order_only=False, force=False, phony=False, command=None):
"""Write a Makefile rule, with some extra tricks.
outputs: a list of outputs for the rule (note: this is not directly
@@ -1711,6 +1713,7 @@ def WriteMakeRule(self, outputs, inputs, actions=None, comment=None,
force: if true, include FORCE_DO_CMD as an order-only dep
phony: if true, the rule does not actually generate the named output, the
output is just a name to run the rule
+ command: (optional) command name to generate unambiguous labels
"""
outputs = map(QuoteSpaces, outputs)
inputs = map(QuoteSpaces, inputs)
@@ -1719,44 +1722,38 @@ def WriteMakeRule(self, outputs, inputs, actions=None, comment=None,
self.WriteLn('# ' + comment)
if phony:
self.WriteLn('.PHONY: ' + ' '.join(outputs))
- # TODO(evanm): just make order_only a list of deps instead of these hacks.
- if order_only:
- order_insert = '| '
- pick_output = ' '.join(outputs)
- else:
- order_insert = ''
- pick_output = outputs[0]
- if force:
- force_append = ' FORCE_DO_CMD'
- else:
- force_append = ''
if actions:
self.WriteLn("%s: TOOLSET := $(TOOLSET)" % outputs[0])
- self.WriteLn('%s: %s%s%s' % (pick_output, order_insert, ' '.join(inputs),
- force_append))
+ force_append = ' FORCE_DO_CMD' if force else ''
+
+ if order_only:
+ # Order only rule: Just write a simple rule.
+ # TODO(evanm): just make order_only a list of deps instead of this hack.
+ self.WriteLn('%s: | %s%s' %
+ (' '.join(outputs), ' '.join(inputs), force_append))
+ elif len(outputs) == 1:
+ # Regular rule, one output: Just write a simple rule.
+ self.WriteLn('%s: %s%s' % (outputs[0], ' '.join(inputs), force_append))
+ else:
+ # Regular rule, more than one output: Multiple outputs are tricky in
+ # make. We will write three rules:
+ # - All outputs depend on an intermediate file.
+ # - Make .INTERMEDIATE depend on the intermediate.
+ # - The intermediate file depends on the inputs and executes the
+ # actual command.
+ # - The intermediate recipe will 'touch' the intermediate file.
+ # - The multi-output rule will have an do-nothing recipe.
+ intermediate = "%s.intermediate" % (command if command else self.target)
+ self.WriteLn('%s: %s' % (' '.join(outputs), intermediate))
+ self.WriteLn('\t%s' % '@:');
+ self.WriteLn('%s: %s' % ('.INTERMEDIATE', intermediate))
+ self.WriteLn('%s: %s%s' %
+ (intermediate, ' '.join(inputs), force_append))
+ actions.insert(0, '$(call do_cmd,touch)')
+
if actions:
for action in actions:
self.WriteLn('\t%s' % action)
- if not order_only and len(outputs) > 1:
- # If we have more than one output, a rule like
- # foo bar: baz
- # that for *each* output we must run the action, potentially
- # in parallel. That is not what we're trying to write -- what
- # we want is that we run the action once and it generates all
- # the files.
- # http://www.gnu.org/software/hello/manual/automake/Multiple-Outputs.html
- # discusses this problem and has this solution:
- # 1) Write the naive rule that would produce parallel runs of
- # the action.
- # 2) Make the outputs seralized on each other, so we won't start
- # a parallel run until the first run finishes, at which point
- # we'll have generated all the outputs and we're done.
- self.WriteLn('%s: %s' % (' '.join(outputs[1:]), outputs[0]))
- # Add a dummy command to the "extra outputs" rule, otherwise make seems to
- # think these outputs haven't (couldn't have?) changed, and thus doesn't
- # flag them as changed (i.e. include in '$?') when evaluating dependent
- # rules, which in turn causes do_cmd() to skip running dependent commands.
- self.WriteLn('%s: ;' % (' '.join(outputs[1:])))
self.WriteLn()
@@ -2015,6 +2012,7 @@ def CalculateMakefilePath(build_file, base_name):
srcdir_prefix = '$(srcdir)/'
flock_command= 'flock'
+ copy_archive_arguments = '-af'
header_params = {
'default_target': default_target,
'builddir': builddir_name,
@@ -2024,6 +2022,7 @@ def CalculateMakefilePath(build_file, base_name):
'link_commands': LINK_COMMANDS_LINUX,
'extra_commands': '',
'srcdir': srcdir,
+ 'copy_archive_args': copy_archive_arguments,
}
if flavor == 'mac':
flock_command = './gyp-mac-tool flock'
@@ -2047,8 +2046,15 @@ def CalculateMakefilePath(build_file, base_name):
header_params.update({
'flock': 'lockf',
})
+ elif flavor == 'openbsd':
+ copy_archive_arguments = '-pPRf'
+ header_params.update({
+ 'copy_archive_args': copy_archive_arguments,
+ })
elif flavor == 'aix':
+ copy_archive_arguments = '-pPRf'
header_params.update({
+ 'copy_archive_args': copy_archive_arguments,
'link_commands': LINK_COMMANDS_AIX,
'flock': './gyp-flock-tool flock',
'flock_index': 2,
diff --git a/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/msvs.py b/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/msvs.py
index 8e6bd7ba0a0592..2ecf964c687c13 100644
--- a/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/msvs.py
+++ b/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/msvs.py
@@ -86,6 +86,9 @@ def _import_OrderedDict():
'msvs_enable_winrt',
'msvs_requires_importlibrary',
'msvs_enable_winphone',
+ 'msvs_application_type_revision',
+ 'msvs_target_platform_version',
+ 'msvs_target_platform_minversion',
]
@@ -2344,6 +2347,9 @@ def _GenerateMSBuildRuleTargetsFile(targets_path, msbuild_rules):
rule_name,
{'Condition': "'@(%s)' != '' and '%%(%s.ExcludedFromBuild)' != "
"'true'" % (rule_name, rule_name),
+ 'EchoOff': 'true',
+ 'StandardOutputImportance': 'High',
+ 'StandardErrorImportance': 'High',
'CommandLineTemplate': '%%(%s.CommandLineTemplate)' % rule_name,
'AdditionalOptions': '%%(%s.AdditionalOptions)' % rule_name,
'Inputs': rule_inputs
@@ -2634,8 +2640,23 @@ def _GetMSBuildGlobalProperties(spec, guid, gyp_file_name):
if spec.get('msvs_enable_winrt'):
properties[0].append(['DefaultLanguage', 'en-US'])
properties[0].append(['AppContainerApplication', 'true'])
- properties[0].append(['ApplicationTypeRevision', '8.1'])
-
+ if spec.get('msvs_application_type_revision'):
+ app_type_revision = spec.get('msvs_application_type_revision')
+ properties[0].append(['ApplicationTypeRevision', app_type_revision])
+ else:
+ properties[0].append(['ApplicationTypeRevision', '8.1'])
+
+ if spec.get('msvs_target_platform_version'):
+ target_platform_version = spec.get('msvs_target_platform_version')
+ properties[0].append(['WindowsTargetPlatformVersion',
+ target_platform_version])
+ if spec.get('msvs_target_platform_minversion'):
+ target_platform_minversion = spec.get('msvs_target_platform_minversion')
+ properties[0].append(['WindowsTargetPlatformMinVersion',
+ target_platform_minversion])
+ else:
+ properties[0].append(['WindowsTargetPlatformMinVersion',
+ target_platform_version])
if spec.get('msvs_enable_winphone'):
properties[0].append(['ApplicationType', 'Windows Phone'])
else:
diff --git a/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/ninja.py b/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/ninja.py
index 624c99ae896b26..841067ed348112 100644
--- a/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/ninja.py
+++ b/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/ninja.py
@@ -139,8 +139,11 @@ def __init__(self, type):
self.bundle = None
# On Windows, incremental linking requires linking against all the .objs
# that compose a .lib (rather than the .lib itself). That list is stored
- # here.
+ # here. In this case, we also need to save the compile_deps for the target,
+ # so that the the target that directly depends on the .objs can also depend
+ # on those.
self.component_objs = None
+ self.compile_deps = None
# Windows only. The import .lib is the output of a build step, but
# because dependents only link against the lib (not both the lib and the
# dll) we keep track of the import library here.
@@ -474,16 +477,17 @@ def WriteSpec(self, spec, config_name, generator_flags):
elif self.flavor == 'mac' and len(self.archs) > 1:
link_deps = collections.defaultdict(list)
-
+ compile_deps = self.target.actions_stamp or actions_depends
if self.flavor == 'win' and self.target.type == 'static_library':
self.target.component_objs = link_deps
+ self.target.compile_deps = compile_deps
# Write out a link step, if needed.
output = None
is_empty_bundle = not link_deps and not mac_bundle_depends
if link_deps or self.target.actions_stamp or actions_depends:
output = self.WriteTarget(spec, config_name, config, link_deps,
- self.target.actions_stamp or actions_depends)
+ compile_deps)
if self.is_mac_bundle:
mac_bundle_depends.append(output)
@@ -921,6 +925,11 @@ def WriteSourcesForArch(self, ninja_file, config_name, config, sources,
os.environ.get('CFLAGS', '').split() + cflags_c)
cflags_cc = (os.environ.get('CPPFLAGS', '').split() +
os.environ.get('CXXFLAGS', '').split() + cflags_cc)
+ elif self.toolset == 'host':
+ cflags_c = (os.environ.get('CPPFLAGS_host', '').split() +
+ os.environ.get('CFLAGS_host', '').split() + cflags_c)
+ cflags_cc = (os.environ.get('CPPFLAGS_host', '').split() +
+ os.environ.get('CXXFLAGS_host', '').split() + cflags_cc)
defines = config.get('defines', []) + extra_defines
self.WriteVariableList(ninja_file, 'defines',
@@ -1088,6 +1097,7 @@ def WriteLinkForArch(self, ninja_file, spec, config_name, config,
implicit_deps = set()
solibs = set()
+ order_deps = set()
if 'dependencies' in spec:
# Two kinds of dependencies:
@@ -1106,6 +1116,8 @@ def WriteLinkForArch(self, ninja_file, spec, config_name, config,
target.component_objs and
self.msvs_settings.IsUseLibraryDependencyInputs(config_name)):
new_deps = target.component_objs
+ if target.compile_deps:
+ order_deps.add(target.compile_deps)
elif self.flavor == 'win' and target.import_lib:
new_deps = [target.import_lib]
elif target.UsesToc(self.flavor):
@@ -1169,7 +1181,7 @@ def WriteLinkForArch(self, ninja_file, spec, config_name, config,
ldflags.append(r'-Wl,-rpath=\$$ORIGIN/%s' % rpath)
ldflags.append('-Wl,-rpath-link=%s' % rpath)
self.WriteVariableList(ninja_file, 'ldflags',
- gyp.common.uniquer(map(self.ExpandSpecial, ldflags)))
+ map(self.ExpandSpecial, ldflags))
library_dirs = config.get('library_dirs', [])
if self.flavor == 'win':
@@ -1244,6 +1256,7 @@ def WriteLinkForArch(self, ninja_file, spec, config_name, config,
ninja_file.build(output, command + command_suffix, link_deps,
implicit=list(implicit_deps),
+ order_only=list(order_deps),
variables=extra_bindings)
return linked_binary
@@ -1258,7 +1271,7 @@ def WriteTarget(self, spec, config_name, config, link_deps, compile_deps):
self.target.type = 'none'
elif spec['type'] == 'static_library':
self.target.binary = self.ComputeOutput(spec)
- if (self.flavor not in ('mac', 'openbsd', 'win') and not
+ if (self.flavor not in ('mac', 'openbsd', 'netbsd', 'win') and not
self.is_standalone_static_library):
self.ninja.build(self.target.binary, 'alink_thin', link_deps,
order_only=compile_deps)
@@ -1672,7 +1685,7 @@ def CommandWithWrapper(cmd, wrappers, prog):
def GetDefaultConcurrentLinks():
"""Returns a best-guess for a number of concurrent links."""
- pool_size = int(os.getenv('GYP_LINK_CONCURRENCY', 0))
+ pool_size = int(os.environ.get('GYP_LINK_CONCURRENCY', 0))
if pool_size:
return pool_size
@@ -1696,8 +1709,10 @@ class MEMORYSTATUSEX(ctypes.Structure):
stat.dwLength = ctypes.sizeof(stat)
ctypes.windll.kernel32.GlobalMemoryStatusEx(ctypes.byref(stat))
- mem_limit = max(1, stat.ullTotalPhys / (4 * (2 ** 30))) # total / 4GB
- hard_cap = max(1, int(os.getenv('GYP_LINK_CONCURRENCY_MAX', 2**32)))
+ # VS 2015 uses 20% more working set than VS 2013 and can consume all RAM
+ # on a 64 GB machine.
+ mem_limit = max(1, stat.ullTotalPhys / (5 * (2 ** 30))) # total / 5GB
+ hard_cap = max(1, int(os.environ.get('GYP_LINK_CONCURRENCY_MAX', 2**32)))
return min(mem_limit, hard_cap)
elif sys.platform.startswith('linux'):
if os.path.exists("/proc/meminfo"):
@@ -2275,7 +2290,11 @@ def GenerateOutputForConfig(target_list, target_dicts, data, params,
if flavor == 'mac':
gyp.xcode_emulation.MergeGlobalXcodeSettingsToSpec(data[build_file], spec)
- build_file = gyp.common.RelativePath(build_file, options.toplevel_dir)
+ # If build_file is a symlink, we must not follow it because there's a chance
+ # it could point to a path above toplevel_dir, and we cannot correctly deal
+ # with that case at the moment.
+ build_file = gyp.common.RelativePath(build_file, options.toplevel_dir,
+ False)
qualified_target_for_hash = gyp.common.QualifiedTarget(build_file, name,
toolset)
diff --git a/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/xcode.py b/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/xcode.py
index 482b53ac8ad9ec..0e3fb9301ecb9e 100644
--- a/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/xcode.py
+++ b/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/xcode.py
@@ -87,6 +87,8 @@
'mac_framework_private_headers',
]
+generator_filelist_paths = None
+
# Xcode's standard set of library directories, which don't need to be duplicated
# in LIBRARY_SEARCH_PATHS. This list is not exhaustive, but that's okay.
xcode_standard_library_dirs = frozenset([
@@ -578,6 +580,26 @@ def PerformBuild(data, configurations, params):
subprocess.check_call(arguments)
+def CalculateGeneratorInputInfo(params):
+ toplevel = params['options'].toplevel_dir
+ if params.get('flavor') == 'ninja':
+ generator_dir = os.path.relpath(params['options'].generator_output or '.')
+ output_dir = params.get('generator_flags', {}).get('output_dir', 'out')
+ output_dir = os.path.normpath(os.path.join(generator_dir, output_dir))
+ qualified_out_dir = os.path.normpath(os.path.join(
+ toplevel, output_dir, 'gypfiles-xcode-ninja'))
+ else:
+ output_dir = os.path.normpath(os.path.join(toplevel, 'xcodebuild'))
+ qualified_out_dir = os.path.normpath(os.path.join(
+ toplevel, output_dir, 'gypfiles'))
+
+ global generator_filelist_paths
+ generator_filelist_paths = {
+ 'toplevel': toplevel,
+ 'qualified_out_dir': qualified_out_dir,
+ }
+
+
def GenerateOutput(target_list, target_dicts, data, params):
# Optionally configure each spec to use ninja as the external builder.
ninja_wrapper = params.get('flavor') == 'ninja'
@@ -590,6 +612,15 @@ def GenerateOutput(target_list, target_dicts, data, params):
parallel_builds = generator_flags.get('xcode_parallel_builds', True)
serialize_all_tests = \
generator_flags.get('xcode_serialize_all_test_runs', True)
+ upgrade_check_project_version = \
+ generator_flags.get('xcode_upgrade_check_project_version', None)
+
+ # Format upgrade_check_project_version with leading zeros as needed.
+ if upgrade_check_project_version:
+ upgrade_check_project_version = str(upgrade_check_project_version)
+ while len(upgrade_check_project_version) < 4:
+ upgrade_check_project_version = '0' + upgrade_check_project_version
+
skip_excluded_files = \
not generator_flags.get('xcode_list_excluded_files', True)
xcode_projects = {}
@@ -604,9 +635,17 @@ def GenerateOutput(target_list, target_dicts, data, params):
xcode_projects[build_file] = xcp
pbxp = xcp.project
+ # Set project-level attributes from multiple options
+ project_attributes = {};
if parallel_builds:
- pbxp.SetProperty('attributes',
- {'BuildIndependentTargetsInParallel': 'YES'})
+ project_attributes['BuildIndependentTargetsInParallel'] = 'YES'
+ if upgrade_check_project_version:
+ project_attributes['LastUpgradeCheck'] = upgrade_check_project_version
+ project_attributes['LastTestingUpgradeCheck'] = \
+ upgrade_check_project_version
+ project_attributes['LastSwiftUpdateCheck'] = \
+ upgrade_check_project_version
+ pbxp.SetProperty('attributes', project_attributes)
# Add gyp/gypi files to project
if not generator_flags.get('standalone'):
@@ -648,6 +687,7 @@ def GenerateOutput(target_list, target_dicts, data, params):
'loadable_module': 'com.googlecode.gyp.xcode.bundle',
'shared_library': 'com.apple.product-type.library.dynamic',
'static_library': 'com.apple.product-type.library.static',
+ 'mac_kernel_extension': 'com.apple.product-type.kernel-extension',
'executable+bundle': 'com.apple.product-type.application',
'loadable_module+bundle': 'com.apple.product-type.bundle',
'loadable_module+xctest': 'com.apple.product-type.bundle.unit-test',
@@ -655,7 +695,9 @@ def GenerateOutput(target_list, target_dicts, data, params):
'executable+extension+bundle': 'com.apple.product-type.app-extension',
'executable+watch+extension+bundle':
'com.apple.product-type.watchkit-extension',
- 'executable+watch+bundle': 'com.apple.product-type.application.watchapp',
+ 'executable+watch+bundle':
+ 'com.apple.product-type.application.watchapp',
+ 'mac_kernel_extension+bundle': 'com.apple.product-type.kernel-extension',
}
target_properties = {
diff --git a/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/input.py b/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/input.py
index 34fbc54711923c..20178672b23bd8 100644
--- a/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/input.py
+++ b/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/input.py
@@ -28,7 +28,12 @@
# A list of types that are treated as linkable.
-linkable_types = ['executable', 'shared_library', 'loadable_module']
+linkable_types = [
+ 'executable',
+ 'shared_library',
+ 'loadable_module',
+ 'mac_kernel_extension',
+]
# A list of sections that contain links to other targets.
dependency_sections = ['dependencies', 'export_dependent_settings']
@@ -57,7 +62,7 @@ def IsPathSection(section):
# If section ends in one of the '=+?!' characters, it's applied to a section
# without the trailing characters. '/' is notably absent from this list,
# because there's no way for a regular expression to be treated as a path.
- while section[-1:] in '=+?!':
+ while section and section[-1:] in '=+?!':
section = section[:-1]
if section in path_sections:
@@ -893,11 +898,15 @@ def ExpandVariables(input, phase, variables, build_file):
else:
# Fix up command with platform specific workarounds.
contents = FixupPlatformCommand(contents)
- p = subprocess.Popen(contents, shell=use_shell,
- stdout=subprocess.PIPE,
- stderr=subprocess.PIPE,
- stdin=subprocess.PIPE,
- cwd=build_file_dir)
+ try:
+ p = subprocess.Popen(contents, shell=use_shell,
+ stdout=subprocess.PIPE,
+ stderr=subprocess.PIPE,
+ stdin=subprocess.PIPE,
+ cwd=build_file_dir)
+ except Exception, e:
+ raise GypError("%s while executing command '%s' in %s" %
+ (e, contents, build_file))
p_stdout, p_stderr = p.communicate('')
@@ -905,8 +914,8 @@ def ExpandVariables(input, phase, variables, build_file):
sys.stderr.write(p_stderr)
# Simulate check_call behavior, since check_call only exists
# in python 2.5 and later.
- raise GypError("Call to '%s' returned exit status %d." %
- (contents, p.returncode))
+ raise GypError("Call to '%s' returned exit status %d while in %s." %
+ (contents, p.returncode, build_file))
replacement = p_stdout.rstrip()
cached_command_results[cache_key] = replacement
@@ -1662,8 +1671,8 @@ def DeepDependencies(self, dependencies=None):
if dependency.ref is None:
continue
if dependency.ref not in dependencies:
- dependencies.add(dependency.ref)
dependency.DeepDependencies(dependencies)
+ dependencies.add(dependency.ref)
return dependencies
@@ -1720,11 +1729,12 @@ def _LinkDependenciesInternal(self, targets, include_shared_libraries,
dependencies.add(self.ref)
return dependencies
- # Executables and loadable modules are already fully and finally linked.
- # Nothing else can be a link dependency of them, there can only be
- # dependencies in the sense that a dependent target might run an
- # executable or load the loadable_module.
- if not initial and target_type in ('executable', 'loadable_module'):
+ # Executables, mac kernel extensions and loadable modules are already fully
+ # and finally linked. Nothing else can be a link dependency of them, there
+ # can only be dependencies in the sense that a dependent target might run
+ # an executable or load the loadable_module.
+ if not initial and target_type in ('executable', 'loadable_module',
+ 'mac_kernel_extension'):
return dependencies
# Shared libraries are already fully linked. They should only be included
@@ -2475,7 +2485,7 @@ def ValidateTargetType(target, target_dict):
"""
VALID_TARGET_TYPES = ('executable', 'loadable_module',
'static_library', 'shared_library',
- 'none')
+ 'mac_kernel_extension', 'none')
target_type = target_dict.get('type', None)
if target_type not in VALID_TARGET_TYPES:
raise GypError("Target %s has an invalid target type '%s'. "
@@ -2488,6 +2498,35 @@ def ValidateTargetType(target, target_dict):
target_type))
+def ValidateSourcesInTarget(target, target_dict, build_file,
+ duplicate_basename_check):
+ if not duplicate_basename_check:
+ return
+ if target_dict.get('type', None) != 'static_library':
+ return
+ sources = target_dict.get('sources', [])
+ basenames = {}
+ for source in sources:
+ name, ext = os.path.splitext(source)
+ is_compiled_file = ext in [
+ '.c', '.cc', '.cpp', '.cxx', '.m', '.mm', '.s', '.S']
+ if not is_compiled_file:
+ continue
+ basename = os.path.basename(name) # Don't include extension.
+ basenames.setdefault(basename, []).append(source)
+
+ error = ''
+ for basename, files in basenames.iteritems():
+ if len(files) > 1:
+ error += ' %s: %s\n' % (basename, ' '.join(files))
+
+ if error:
+ print('static library %s has several files with the same basename:\n' %
+ target + error + 'libtool on Mac cannot handle that. Use '
+ '--no-duplicate-basename-check to disable this validation.')
+ raise GypError('Duplicate basenames in sources section, see list above')
+
+
def ValidateRulesInTarget(target, target_dict, extra_sources_for_rules):
"""Ensures that the rules sections in target_dict are valid and consistent,
and determines which sources they apply to.
@@ -2708,7 +2747,7 @@ def SetGeneratorGlobals(generator_input_info):
def Load(build_files, variables, includes, depth, generator_input_info, check,
- circular_check, parallel, root_targets):
+ circular_check, duplicate_basename_check, parallel, root_targets):
SetGeneratorGlobals(generator_input_info)
# A generator can have other lists (in addition to sources) be processed
# for rules.
@@ -2840,6 +2879,8 @@ def Load(build_files, variables, includes, depth, generator_input_info, check,
target_dict = targets[target]
build_file = gyp.common.BuildFile(target)
ValidateTargetType(target, target_dict)
+ ValidateSourcesInTarget(target, target_dict, build_file,
+ duplicate_basename_check)
ValidateRulesInTarget(target, target_dict, extra_sources_for_rules)
ValidateRunAsInTarget(target, target_dict, build_file)
ValidateActionsInTarget(target, target_dict, build_file)
diff --git a/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/mac_tool.py b/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/mac_tool.py
index 366439a062d36b..eeeaceb0c7aa23 100755
--- a/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/mac_tool.py
+++ b/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/mac_tool.py
@@ -603,8 +603,7 @@ def _ExpandVariables(self, data, substitutions):
if isinstance(data, list):
return [self._ExpandVariables(v, substitutions) for v in data]
if isinstance(data, dict):
- return dict((k, self._ExpandVariables(data[k],
- substitutions)) for k in data)
+ return {k: self._ExpandVariables(data[k], substitutions) for k in data}
return data
if __name__ == '__main__':
diff --git a/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/msvs_emulation.py b/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/msvs_emulation.py
index ce5c46ea5b3d95..ca67b122f0b9b1 100644
--- a/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/msvs_emulation.py
+++ b/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/msvs_emulation.py
@@ -442,6 +442,7 @@ def GetCflags(self, config):
cl('FloatingPointModel',
map={'0': 'precise', '1': 'strict', '2': 'fast'}, prefix='/fp:',
default='0')
+ cl('CompileAsManaged', map={'false': '', 'true': '/clr'})
cl('WholeProgramOptimization', map={'true': '/GL'})
cl('WarningLevel', prefix='/W')
cl('WarnAsError', map={'true': '/WX'})
@@ -593,6 +594,15 @@ def GetLdflags(self, config, gyp_to_build_path, expand_special,
'2': 'WINDOWS%s' % minimum_required_version},
prefix='/SUBSYSTEM:')
+ stack_reserve_size = self._Setting(
+ ('VCLinkerTool', 'StackReserveSize'), config, default='')
+ if stack_reserve_size:
+ stack_commit_size = self._Setting(
+ ('VCLinkerTool', 'StackCommitSize'), config, default='')
+ if stack_commit_size:
+ stack_commit_size = ',' + stack_commit_size
+ ldflags.append('/STACK:%s%s' % (stack_reserve_size, stack_commit_size))
+
ld('TerminalServerAware', map={'1': ':NO', '2': ''}, prefix='/TSAWARE')
ld('LinkIncremental', map={'1': ':NO', '2': ''}, prefix='/INCREMENTAL')
ld('BaseAddress', prefix='/BASE:')
diff --git a/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/win_tool.py b/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/win_tool.py
index 417e465f7853f4..bb6f1ea436f258 100755
--- a/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/win_tool.py
+++ b/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/win_tool.py
@@ -123,7 +123,9 @@ def ExecLinkWrapper(self, arch, use_separate_mspdbsrv, *args):
stderr=subprocess.STDOUT)
out, _ = link.communicate()
for line in out.splitlines():
- if not line.startswith(' Creating library '):
+ if (not line.startswith(' Creating library ') and
+ not line.startswith('Generating code') and
+ not line.startswith('Finished generating code')):
print line
return link.returncode
diff --git a/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/xcode_emulation.py b/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/xcode_emulation.py
index f1a839a2f59e89..b06bdc4e8b73a4 100644
--- a/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/xcode_emulation.py
+++ b/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/xcode_emulation.py
@@ -525,6 +525,13 @@ def GetCflags(self, configname, arch=None):
if self._Test('GCC_WARN_ABOUT_MISSING_NEWLINE', 'YES', default='NO'):
cflags.append('-Wnewline-eof')
+ # In Xcode, this is only activated when GCC_COMPILER_VERSION is clang or
+ # llvm-gcc. It also requires a fairly recent libtool, and
+ # if the system clang isn't used, DYLD_LIBRARY_PATH needs to contain the
+ # path to the libLTO.dylib that matches the used clang.
+ if self._Test('LLVM_LTO', 'YES', default='NO'):
+ cflags.append('-flto')
+
self._AppendPlatformVersionMinFlags(cflags)
# TODO:
@@ -831,8 +838,9 @@ def GetLdflags(self, configname, product_dir, gyp_to_build_path, arch=None):
# These flags reflect the compilation options used by xcode to compile
# extensions.
ldflags.append('-lpkstart')
- ldflags.append(sdk_root +
- '/System/Library/PrivateFrameworks/PlugInKit.framework/PlugInKit')
+ if XcodeVersion() < '0900':
+ ldflags.append(sdk_root +
+ '/System/Library/PrivateFrameworks/PlugInKit.framework/PlugInKit')
ldflags.append('-fapplication-extension')
ldflags.append('-Xlinker -rpath '
'-Xlinker @executable_path/../../Frameworks')
@@ -1024,7 +1032,23 @@ def _AdjustLibrary(self, library, config_name=None):
sdk_root = self._SdkPath(config_name)
if not sdk_root:
sdk_root = ''
- return l.replace('$(SDKROOT)', sdk_root)
+ # Xcode 7 started shipping with ".tbd" (text based stubs) files instead of
+ # ".dylib" without providing a real support for them. What it does, for
+ # "/usr/lib" libraries, is do "-L/usr/lib -lname" which is dependent on the
+ # library order and cause collision when building Chrome.
+ #
+ # Instead substitude ".tbd" to ".dylib" in the generated project when the
+ # following conditions are both true:
+ # - library is referenced in the gyp file as "$(SDKROOT)/**/*.dylib",
+ # - the ".dylib" file does not exists but a ".tbd" file do.
+ library = l.replace('$(SDKROOT)', sdk_root)
+ if l.startswith('$(SDKROOT)'):
+ basename, ext = os.path.splitext(library)
+ if ext == '.dylib' and not os.path.exists(library):
+ tbd_library = basename + '.tbd'
+ if os.path.exists(tbd_library):
+ library = tbd_library
+ return library
def AdjustLibraries(self, libraries, config_name=None):
"""Transforms entries like 'Cocoa.framework' in libraries into entries like
@@ -1428,6 +1452,7 @@ def _GetXcodeEnv(xcode_settings, built_products_dir, srcroot, configuration,
# These are filled in on a as-needed basis.
env = {
+ 'BUILT_FRAMEWORKS_DIR' : built_products_dir,
'BUILT_PRODUCTS_DIR' : built_products_dir,
'CONFIGURATION' : configuration,
'PRODUCT_NAME' : xcode_settings.GetProductName(),
diff --git a/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/xcodeproj_file.py b/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/xcodeproj_file.py
index 034a0d2d4fcc23..d08b7f777002f0 100644
--- a/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/xcodeproj_file.py
+++ b/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/xcodeproj_file.py
@@ -1492,6 +1492,7 @@ def __init__(self, properties=None, id=None, parent=None):
'icns': 'image.icns',
'java': 'sourcecode.java',
'js': 'sourcecode.javascript',
+ 'kext': 'wrapper.kext',
'm': 'sourcecode.c.objc',
'mm': 'sourcecode.cpp.objcpp',
'nib': 'wrapper.nib',
@@ -1951,6 +1952,7 @@ class PBXCopyFilesBuildPhase(XCBuildPhase):
# path_tree_to_subfolder maps names of Xcode variables to the associated
# dstSubfolderSpec property value used in a PBXCopyFilesBuildPhase object.
path_tree_to_subfolder = {
+ 'BUILT_FRAMEWORKS_DIR': 10, # Frameworks Directory
'BUILT_PRODUCTS_DIR': 16, # Products Directory
# Other types that can be chosen via the Xcode UI.
# TODO(mark): Map Xcode variable names to these.
@@ -1958,7 +1960,6 @@ class PBXCopyFilesBuildPhase(XCBuildPhase):
# : 6, # Executables: 6
# : 7, # Resources
# : 15, # Java Resources
- # : 10, # Frameworks
# : 11, # Shared Frameworks
# : 12, # Shared Support
# : 13, # PlugIns
@@ -2262,6 +2263,8 @@ class PBXNativeTarget(XCTarget):
'', '.xctest'],
'com.googlecode.gyp.xcode.bundle': ['compiled.mach-o.dylib',
'', '.so'],
+ 'com.apple.product-type.kernel-extension': ['wrapper.kext',
+ '', '.kext'],
}
def __init__(self, properties=None, id=None, parent=None,
diff --git a/deps/npm/node_modules/node-gyp/lib/build.js b/deps/npm/node_modules/node-gyp/lib/build.js
index 198017b262add5..3a3edccf872b92 100644
--- a/deps/npm/node_modules/node-gyp/lib/build.js
+++ b/deps/npm/node_modules/node-gyp/lib/build.js
@@ -19,9 +19,15 @@ var fs = require('graceful-fs')
exports.usage = 'Invokes `' + (win ? 'msbuild' : 'make') + '` and builds the module'
function build (gyp, argv, callback) {
+ var platformMake = 'make'
+ if (process.platform === 'aix') {
+ platformMake = 'gmake'
+ } else if (process.platform.indexOf('bsd') !== -1) {
+ platformMake = 'gmake'
+ }
+
var release = processRelease(argv, gyp, process.version, process.release)
- , makeCommand = gyp.opts.make || process.env.MAKE
- || (process.platform.indexOf('bsd') != -1 && process.platform.indexOf('kfreebsd') == -1 ? 'gmake' : 'make')
+ , makeCommand = gyp.opts.make || process.env.MAKE || platformMake
, command = win ? 'msbuild' : makeCommand
, buildDir = path.resolve('build')
, configPath = path.resolve(buildDir, 'config.gypi')
diff --git a/deps/npm/node_modules/node-gyp/lib/configure.js b/deps/npm/node_modules/node-gyp/lib/configure.js
index 009935202af98a..4e0652961ea902 100644
--- a/deps/npm/node_modules/node-gyp/lib/configure.js
+++ b/deps/npm/node_modules/node-gyp/lib/configure.js
@@ -1,4 +1,5 @@
module.exports = exports = configure
+module.exports.test = { findPython: findPython }
/**
* Module dependencies.
@@ -19,6 +20,7 @@ var fs = require('graceful-fs')
, spawn = cp.spawn
, execFile = cp.execFile
, win = process.platform == 'win32'
+ , findNodeDirectory = require('./find-node-directory')
exports.usage = 'Generates ' + (win ? 'MSVC project files' : 'a Makefile') + ' for the current module'
@@ -31,97 +33,14 @@ function configure (gyp, argv, callback) {
, nodeDir
, release = processRelease(argv, gyp, process.version, process.release)
- checkPython()
-
- // Check if Python is in the $PATH
- function checkPython () {
- log.verbose('check python', 'checking for Python executable "%s" in the PATH', python)
- which(python, function (err, execPath) {
- if (err) {
- log.verbose('`which` failed', python, err)
- if (python === 'python2') {
- python = 'python'
- return checkPython()
- }
- if (win) {
- guessPython()
- } else {
- failNoPython()
- }
- } else {
- log.verbose('`which` succeeded', python, execPath)
- checkPythonVersion()
- }
- })
- }
-
- // Called on Windows when "python" isn't available in the current $PATH.
- // We're gonna check if "%SystemDrive%\python27\python.exe" exists.
- function guessPython () {
- log.verbose('could not find "' + python + '". guessing location')
- var rootDir = process.env.SystemDrive || 'C:\\'
- if (rootDir[rootDir.length - 1] !== '\\') {
- rootDir += '\\'
+ findPython(python, function (err, found) {
+ if (err) {
+ callback(err)
+ } else {
+ python = found
+ getNodeDir()
}
- var pythonPath = path.resolve(rootDir, 'Python27', 'python.exe')
- log.verbose('ensuring that file exists:', pythonPath)
- fs.stat(pythonPath, function (err, stat) {
- if (err) {
- if (err.code == 'ENOENT') {
- failNoPython()
- } else {
- callback(err)
- }
- return
- }
- python = pythonPath
- checkPythonVersion()
- })
- }
-
- function checkPythonVersion () {
- var env = extend({}, process.env)
- env.TERM = 'dumb'
-
- execFile(python, ['-c', 'import platform; print(platform.python_version());'], { env: env }, function (err, stdout) {
- if (err) {
- return callback(err)
- }
- log.verbose('check python version', '`%s -c "import platform; print(platform.python_version());"` returned: %j', python, stdout)
- var version = stdout.trim()
- if (~version.indexOf('+')) {
- log.silly('stripping "+" sign(s) from version')
- version = version.replace(/\+/g, '')
- }
- if (~version.indexOf('rc')) {
- log.silly('stripping "rc" identifier from version')
- version = version.replace(/rc(.*)$/ig, '')
- }
- var range = semver.Range('>=2.5.0 <3.0.0')
- var valid = false
- try {
- valid = range.test(version)
- } catch (e) {
- log.silly('range.test() error', e)
- }
- if (valid) {
- getNodeDir()
- } else {
- failPythonVersion(version)
- }
- })
- }
-
- function failNoPython () {
- callback(new Error('Can\'t find Python executable "' + python +
- '", you can set the PYTHON env variable.'))
- }
-
- function failPythonVersion (badVersion) {
- callback(new Error('Python executable "' + python +
- '" is v' + badVersion + ', which is not supported by gyp.\n' +
- 'You can pass the --python switch to point to Python >= v2.5.0 & < 3.0.0.'))
- }
+ })
function getNodeDir () {
@@ -299,6 +218,34 @@ function configure (gyp, argv, callback) {
argv.push('-I', config)
})
+ // for AIX we need to set up the path to the exp file
+ // which contains the symbols needed for linking.
+ // The file will either be in one of the following
+ // depending on whether it is an installed or
+ // development environment:
+ // - the include/node directory
+ // - the out/Release directory
+ // - the out/Debug directory
+ // - the root directory
+ var node_exp_file = ''
+ if (process.platform === 'aix') {
+ var node_root_dir = findNodeDirectory()
+ var candidates = ['include/node/node.exp',
+ 'out/Release/node.exp',
+ 'out/Debug/node.exp',
+ 'node.exp']
+ for (var next = 0; next < candidates.length; next++) {
+ node_exp_file = path.resolve(node_root_dir, candidates[next])
+ try {
+ fs.accessSync(node_exp_file, fs.R_OK)
+ // exp file found, stop looking
+ break
+ } catch (exception) {
+ // this candidate was not found or not readable, do nothing
+ }
+ }
+ }
+
// this logic ported from the old `gyp_addon` python file
var gyp_script = path.resolve(__dirname, '..', 'gyp', 'gyp_main.py')
var addon_gypi = path.resolve(__dirname, '..', 'addon.gypi')
@@ -319,6 +266,9 @@ function configure (gyp, argv, callback) {
argv.push('-Dlibrary=shared_library')
argv.push('-Dvisibility=default')
argv.push('-Dnode_root_dir=' + nodeDir)
+ if (process.platform === 'aix') {
+ argv.push('-Dnode_exp_file=' + node_exp_file)
+ }
argv.push('-Dnode_gyp_dir=' + nodeGypDir)
argv.push('-Dnode_lib_file=' + release.name + '.lib')
argv.push('-Dmodule_root_dir=' + process.cwd())
@@ -360,3 +310,101 @@ function configure (gyp, argv, callback) {
}
}
+
+function findPython (python, callback) {
+ checkPython()
+
+ // Check if Python is in the $PATH
+ function checkPython () {
+ log.verbose('check python', 'checking for Python executable "%s" in the PATH', python)
+ which(python, function (err, execPath) {
+ if (err) {
+ log.verbose('`which` failed', python, err)
+ if (python === 'python2') {
+ python = 'python'
+ return checkPython()
+ }
+ if (win) {
+ guessPython()
+ } else {
+ failNoPython()
+ }
+ } else {
+ log.verbose('`which` succeeded', python, execPath)
+ // Found the `python` exceutable, and from now on we use it explicitly.
+ // This solves #667 and #750 (`execFile` won't run batch files
+ // (*.cmd, and *.bat))
+ python = execPath
+ checkPythonVersion()
+ }
+ })
+ }
+
+ // Called on Windows when "python" isn't available in the current $PATH.
+ // We're gonna check if "%SystemDrive%\python27\python.exe" exists.
+ function guessPython () {
+ log.verbose('could not find "' + python + '". guessing location')
+ var rootDir = process.env.SystemDrive || 'C:\\'
+ if (rootDir[rootDir.length - 1] !== '\\') {
+ rootDir += '\\'
+ }
+ var pythonPath = path.resolve(rootDir, 'Python27', 'python.exe')
+ log.verbose('ensuring that file exists:', pythonPath)
+ fs.stat(pythonPath, function (err, stat) {
+ if (err) {
+ if (err.code == 'ENOENT') {
+ failNoPython()
+ } else {
+ callback(err)
+ }
+ return
+ }
+ python = pythonPath
+ checkPythonVersion()
+ })
+ }
+
+ function checkPythonVersion () {
+ var env = extend({}, process.env)
+ env.TERM = 'dumb'
+
+ execFile(python, ['-c', 'import platform; print(platform.python_version());'], { env: env }, function (err, stdout) {
+ if (err) {
+ return callback(err)
+ }
+ log.verbose('check python version', '`%s -c "import platform; print(platform.python_version());"` returned: %j', python, stdout)
+ var version = stdout.trim()
+ if (~version.indexOf('+')) {
+ log.silly('stripping "+" sign(s) from version')
+ version = version.replace(/\+/g, '')
+ }
+ if (~version.indexOf('rc')) {
+ log.silly('stripping "rc" identifier from version')
+ version = version.replace(/rc(.*)$/ig, '')
+ }
+ var range = semver.Range('>=2.5.0 <3.0.0')
+ var valid = false
+ try {
+ valid = range.test(version)
+ } catch (e) {
+ log.silly('range.test() error', e)
+ }
+ if (valid) {
+ callback(null, python)
+ } else {
+ failPythonVersion(version)
+ }
+ })
+ }
+
+ function failNoPython () {
+ callback(new Error('Can\'t find Python executable "' + python +
+ '", you can set the PYTHON env variable.'))
+ }
+
+ function failPythonVersion (badVersion) {
+ callback(new Error('Python executable "' + python +
+ '" is v' + badVersion + ', which is not supported by gyp.\n' +
+ 'You can pass the --python switch to point to Python >= v2.5.0 & < 3.0.0.'))
+ }
+}
diff --git a/deps/npm/node_modules/node-gyp/lib/find-node-directory.js b/deps/npm/node_modules/node-gyp/lib/find-node-directory.js
new file mode 100644
index 00000000000000..3aee8a109ae280
--- /dev/null
+++ b/deps/npm/node_modules/node-gyp/lib/find-node-directory.js
@@ -0,0 +1,61 @@
+var path = require('path')
+ , log = require('npmlog')
+
+function findNodeDirectory(scriptLocation, processObj) {
+ // set dirname and process if not passed in
+ // this facilitates regression tests
+ if (scriptLocation === undefined) {
+ scriptLocation = __dirname
+ }
+ if (processObj === undefined) {
+ processObj = process
+ }
+
+ // Have a look to see what is above us, to try and work out where we are
+ npm_parent_directory = path.join(scriptLocation, '../../../..')
+ log.verbose('node-gyp root', 'npm_parent_directory is '
+ + path.basename(npm_parent_directory))
+ node_root_dir = ""
+
+ log.verbose('node-gyp root', 'Finding node root directory')
+ if (path.basename(npm_parent_directory) === 'deps') {
+ // We are in a build directory where this script lives in
+ // deps/npm/node_modules/node-gyp/lib
+ node_root_dir = path.join(npm_parent_directory, '..')
+ log.verbose('node-gyp root', 'in build directory, root = '
+ + node_root_dir)
+ } else if (path.basename(npm_parent_directory) === 'node_modules') {
+ // We are in a node install directory where this script lives in
+ // lib/node_modules/npm/node_modules/node-gyp/lib or
+ // node_modules/npm/node_modules/node-gyp/lib depending on the
+ // platform
+ if (processObj.platform === 'win32') {
+ node_root_dir = path.join(npm_parent_directory, '..')
+ } else {
+ node_root_dir = path.join(npm_parent_directory, '../..')
+ }
+ log.verbose('node-gyp root', 'in install directory, root = '
+ + node_root_dir)
+ } else {
+ // We don't know where we are, try working it out from the location
+ // of the node binary
+ var node_dir = path.dirname(processObj.execPath)
+ var directory_up = path.basename(node_dir)
+ if (directory_up === 'bin') {
+ node_root_dir = path.join(node_dir, '..')
+ } else if (directory_up === 'Release' || directory_up === 'Debug') {
+ // If we are a recently built node, and the directory structure
+ // is that of a repository. If we are on Windows then we only need
+ // to go one level up, everything else, two
+ if (processObj.platform === 'win32') {
+ node_root_dir = path.join(node_dir, '..')
+ } else {
+ node_root_dir = path.join(node_dir, '../..')
+ }
+ }
+ // Else return the default blank, "".
+ }
+ return node_root_dir
+}
+
+module.exports = findNodeDirectory
diff --git a/deps/npm/node_modules/node-gyp/lib/node-gyp.js b/deps/npm/node_modules/node-gyp/lib/node-gyp.js
index d6d6509a7a8b03..b84f17d7e2cf9f 100644
--- a/deps/npm/node_modules/node-gyp/lib/node-gyp.js
+++ b/deps/npm/node_modules/node-gyp/lib/node-gyp.js
@@ -164,7 +164,9 @@ proto.parseArgv = function parseOpts (argv) {
} else {
// add the user-defined options to the config
name = name.substring(npm_config_prefix.length)
- this.opts[name] = val
+ // gyp@741b7f1 enters an infinite loop when it encounters
+ // zero-length options so ensure those don't get through.
+ if (name) this.opts[name] = val
}
}, this)
diff --git a/deps/npm/node_modules/node-gyp/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/README.md b/deps/npm/node_modules/node-gyp/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/README.md
index 2aff0ebff4403e..421f3aa5f951a2 100644
--- a/deps/npm/node_modules/node-gyp/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/README.md
+++ b/deps/npm/node_modules/node-gyp/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/README.md
@@ -47,6 +47,15 @@ If there's no match, `undefined` will be returned.
If the `str` contains more `a` than `b` / there are unmatched pairs, the first match that was closed will be used. For example, `{{a}` will match `['{', 'a', '']`.
+### var r = balanced.range(a, b, str)
+
+For the first non-nested matching pair of `a` and `b` in `str`, return an
+array with indexes: `[ , ]`.
+
+If there's no match, `undefined` will be returned.
+
+If the `str` contains more `a` than `b` / there are unmatched pairs, the first match that was closed will be used. For example, `{{a}` will match `[ 1, 3 ]`.
+
## Installation
With [npm](https://npmjs.org) do:
diff --git a/deps/npm/node_modules/node-gyp/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/index.js b/deps/npm/node_modules/node-gyp/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/index.js
index d165ae8174ca82..75f3d71cba90bc 100644
--- a/deps/npm/node_modules/node-gyp/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/index.js
+++ b/deps/npm/node_modules/node-gyp/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/index.js
@@ -1,38 +1,50 @@
module.exports = balanced;
function balanced(a, b, str) {
- var bal = 0;
- var m = {};
- var ended = false;
-
- for (var i = 0; i < str.length; i++) {
- if (a == str.substr(i, a.length)) {
- if (!('start' in m)) m.start = i;
- bal++;
- }
- else if (b == str.substr(i, b.length) && 'start' in m) {
- ended = true;
- bal--;
- if (!bal) {
- m.end = i;
- m.pre = str.substr(0, m.start);
- m.body = (m.end - m.start > 1)
- ? str.substring(m.start + a.length, m.end)
- : '';
- m.post = str.slice(m.end + b.length);
- return m;
+ var r = range(a, b, str);
+
+ return r && {
+ start: r[0],
+ end: r[1],
+ pre: str.slice(0, r[0]),
+ body: str.slice(r[0] + a.length, r[1]),
+ post: str.slice(r[1] + b.length)
+ };
+}
+
+balanced.range = range;
+function range(a, b, str) {
+ var begs, beg, left, right, result;
+ var ai = str.indexOf(a);
+ var bi = str.indexOf(b, ai + 1);
+ var i = ai;
+
+ if (ai >= 0 && bi > 0) {
+ begs = [];
+ left = str.length;
+
+ while (i < str.length && i >= 0 && ! result) {
+ if (i == ai) {
+ begs.push(i);
+ ai = str.indexOf(a, i + 1);
+ } else if (begs.length == 1) {
+ result = [ begs.pop(), bi ];
+ } else {
+ beg = begs.pop();
+ if (beg < left) {
+ left = beg;
+ right = bi;
+ }
+
+ bi = str.indexOf(b, i + 1);
}
+
+ i = ai < bi && ai >= 0 ? ai : bi;
}
- }
- // if we opened more than we closed, find the one we closed
- if (bal && ended) {
- var start = m.start + a.length;
- m = balanced(a, b, str.substr(start));
- if (m) {
- m.start += start;
- m.end += start;
- m.pre = str.slice(0, start) + m.pre;
+ if (begs.length) {
+ result = [ left, right ];
}
- return m;
}
+
+ return result;
}
diff --git a/deps/npm/node_modules/node-gyp/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/package.json b/deps/npm/node_modules/node-gyp/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/package.json
index 662faff69d0dea..1877dcb55fd0b8 100644
--- a/deps/npm/node_modules/node-gyp/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/package.json
+++ b/deps/npm/node_modules/node-gyp/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/package.json
@@ -1,7 +1,7 @@
{
"name": "balanced-match",
"description": "Match balanced character pairs, like \"{\" and \"}\"",
- "version": "0.2.1",
+ "version": "0.3.0",
"repository": {
"type": "git",
"url": "git://github.com/juliangruber/balanced-match.git"
@@ -13,7 +13,7 @@
},
"dependencies": {},
"devDependencies": {
- "tape": "~1.1.1"
+ "tape": "~4.2.2"
},
"keywords": [
"match",
@@ -44,30 +44,13 @@
"android-browser/4.2..latest"
]
},
- "gitHead": "d743dd31d7376e0fcf99392a4be7227f2e99bf5d",
+ "readme": "# balanced-match\n\nMatch balanced string pairs, like `{` and `}` or `` and ``.\n\n[![build status](https://secure.travis-ci.org/juliangruber/balanced-match.svg)](http://travis-ci.org/juliangruber/balanced-match)\n[![downloads](https://img.shields.io/npm/dm/balanced-match.svg)](https://www.npmjs.org/package/balanced-match)\n\n[![testling badge](https://ci.testling.com/juliangruber/balanced-match.png)](https://ci.testling.com/juliangruber/balanced-match)\n\n## Example\n\nGet the first matching pair of braces:\n\n```js\nvar balanced = require('balanced-match');\n\nconsole.log(balanced('{', '}', 'pre{in{nested}}post'));\nconsole.log(balanced('{', '}', 'pre{first}between{second}post'));\n```\n\nThe matches are:\n\n```bash\n$ node example.js\n{ start: 3, end: 14, pre: 'pre', body: 'in{nested}', post: 'post' }\n{ start: 3,\n end: 9,\n pre: 'pre',\n body: 'first',\n post: 'between{second}post' }\n```\n\n## API\n\n### var m = balanced(a, b, str)\n\nFor the first non-nested matching pair of `a` and `b` in `str`, return an\nobject with those keys:\n\n* **start** the index of the first match of `a`\n* **end** the index of the matching `b`\n* **pre** the preamble, `a` and `b` not included\n* **body** the match, `a` and `b` not included\n* **post** the postscript, `a` and `b` not included\n\nIf there's no match, `undefined` will be returned.\n\nIf the `str` contains more `a` than `b` / there are unmatched pairs, the first match that was closed will be used. For example, `{{a}` will match `['{', 'a', '']`.\n\n### var r = balanced.range(a, b, str)\n\nFor the first non-nested matching pair of `a` and `b` in `str`, return an\narray with indexes: `[ , ]`.\n\nIf there's no match, `undefined` will be returned.\n\nIf the `str` contains more `a` than `b` / there are unmatched pairs, the first match that was closed will be used. For example, `{{a}` will match `[ 1, 3 ]`.\n\n## Installation\n\nWith [npm](https://npmjs.org) do:\n\n```bash\nnpm install balanced-match\n```\n\n## License\n\n(MIT)\n\nCopyright (c) 2013 Julian Gruber <julian@juliangruber.com>\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of\nthis software and associated documentation files (the \"Software\"), to deal in\nthe Software without restriction, including without limitation the rights to\nuse, copy, modify, merge, publish, distribute, sublicense, and/or sell copies\nof the Software, and to permit persons to whom the Software is furnished to do\nso, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n",
+ "readmeFilename": "README.md",
"bugs": {
"url": "https://github.com/juliangruber/balanced-match/issues"
},
- "_id": "balanced-match@0.2.1",
- "_shasum": "7bc658b4bed61eee424ad74f75f5c3e2c4df3cc7",
- "_from": "balanced-match@>=0.2.0 <0.3.0",
- "_npmVersion": "2.14.7",
- "_nodeVersion": "4.2.1",
- "_npmUser": {
- "name": "juliangruber",
- "email": "julian@juliangruber.com"
- },
- "dist": {
- "shasum": "7bc658b4bed61eee424ad74f75f5c3e2c4df3cc7",
- "tarball": "http://registry.npmjs.org/balanced-match/-/balanced-match-0.2.1.tgz"
- },
- "maintainers": [
- {
- "name": "juliangruber",
- "email": "julian@juliangruber.com"
- }
- ],
- "directories": {},
- "_resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-0.2.1.tgz",
- "readme": "ERROR: No README data found!"
+ "_id": "balanced-match@0.3.0",
+ "_shasum": "a91cdd1ebef1a86659e70ff4def01625fc2d6756",
+ "_resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-0.3.0.tgz",
+ "_from": "balanced-match@>=0.3.0 <0.4.0"
}
diff --git a/deps/npm/node_modules/node-gyp/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/test/balanced.js b/deps/npm/node_modules/node-gyp/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/test/balanced.js
index 36bfd39954850d..f5e98e3f2a3240 100644
--- a/deps/npm/node_modules/node-gyp/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/test/balanced.js
+++ b/deps/npm/node_modules/node-gyp/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/test/balanced.js
@@ -52,5 +52,33 @@ test('balanced', function(t) {
body: 'innest',
post: 'post'
});
+ t.deepEqual(balanced('{{', '}}', 'pre{{{in}}}post'), {
+ start: 3,
+ end: 9,
+ pre: 'pre',
+ body: '{in}',
+ post: 'post'
+ });
+ t.deepEqual(balanced('{{{', '}}', 'pre{{{in}}}post'), {
+ start: 3,
+ end: 8,
+ pre: 'pre',
+ body: 'in',
+ post: '}post'
+ });
+ t.deepEqual(balanced('{', '}', 'pre{{first}in{second}post'), {
+ start: 4,
+ end: 10,
+ pre: 'pre{',
+ body: 'first',
+ post: 'in{second}post'
+ });
+ t.deepEqual(balanced('', '?>', 'pre>post'), {
+ start: 3,
+ end: 4,
+ pre: 'pre',
+ body: '',
+ post: 'post'
+ });
t.end();
});
diff --git a/deps/npm/node_modules/node-gyp/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/package.json b/deps/npm/node_modules/node-gyp/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/package.json
index b516138098fba9..50cc7b58839e17 100644
--- a/deps/npm/node_modules/node-gyp/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/package.json
+++ b/deps/npm/node_modules/node-gyp/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/package.json
@@ -56,28 +56,14 @@
]
}
},
+ "readme": "concat-map\n==========\n\nConcatenative mapdashery.\n\n[![browser support](http://ci.testling.com/substack/node-concat-map.png)](http://ci.testling.com/substack/node-concat-map)\n\n[![build status](https://secure.travis-ci.org/substack/node-concat-map.png)](http://travis-ci.org/substack/node-concat-map)\n\nexample\n=======\n\n``` js\nvar concatMap = require('concat-map');\nvar xs = [ 1, 2, 3, 4, 5, 6 ];\nvar ys = concatMap(xs, function (x) {\n return x % 2 ? [ x - 0.1, x, x + 0.1 ] : [];\n});\nconsole.dir(ys);\n```\n\n***\n\n```\n[ 0.9, 1, 1.1, 2.9, 3, 3.1, 4.9, 5, 5.1 ]\n```\n\nmethods\n=======\n\n``` js\nvar concatMap = require('concat-map')\n```\n\nconcatMap(xs, fn)\n-----------------\n\nReturn an array of concatenated elements by calling `fn(x, i)` for each element\n`x` and each index `i` in the array `xs`.\n\nWhen `fn(x, i)` returns an array, its result will be concatenated with the\nresult array. If `fn(x, i)` returns anything else, that value will be pushed\nonto the end of the result array.\n\ninstall\n=======\n\nWith [npm](http://npmjs.org) do:\n\n```\nnpm install concat-map\n```\n\nlicense\n=======\n\nMIT\n\nnotes\n=====\n\nThis module was written while sitting high above the ground in a tree.\n",
+ "readmeFilename": "README.markdown",
"bugs": {
"url": "https://github.com/substack/node-concat-map/issues"
},
- "homepage": "https://github.com/substack/node-concat-map",
+ "homepage": "https://github.com/substack/node-concat-map#readme",
"_id": "concat-map@0.0.1",
- "dist": {
- "shasum": "d8a96bd77fd68df7793a73036a3ba0d5405d477b",
- "tarball": "http://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz"
- },
- "_from": "concat-map@0.0.1",
- "_npmVersion": "1.3.21",
- "_npmUser": {
- "name": "substack",
- "email": "mail@substack.net"
- },
- "maintainers": [
- {
- "name": "substack",
- "email": "mail@substack.net"
- }
- ],
"_shasum": "d8a96bd77fd68df7793a73036a3ba0d5405d477b",
"_resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz",
- "readme": "ERROR: No README data found!"
+ "_from": "concat-map@0.0.1"
}
diff --git a/deps/npm/node_modules/node-gyp/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/package.json b/deps/npm/node_modules/node-gyp/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/package.json
index 4cb3e05d7ceb6c..a2e05c7ac681d3 100644
--- a/deps/npm/node_modules/node-gyp/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/package.json
+++ b/deps/npm/node_modules/node-gyp/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/package.json
@@ -1,7 +1,7 @@
{
"name": "brace-expansion",
"description": "Brace expansion as known from sh/bash",
- "version": "1.1.1",
+ "version": "1.1.2",
"repository": {
"type": "git",
"url": "git://github.com/juliangruber/brace-expansion.git"
@@ -13,11 +13,11 @@
"gentest": "bash test/generate.sh"
},
"dependencies": {
- "balanced-match": "^0.2.0",
+ "balanced-match": "^0.3.0",
"concat-map": "0.0.1"
},
"devDependencies": {
- "tape": "^3.0.3"
+ "tape": "4.2.2"
},
"keywords": [],
"author": {
@@ -42,34 +42,13 @@
"android-browser/4.2..latest"
]
},
- "gitHead": "f50da498166d76ea570cf3b30179f01f0f119612",
+ "readme": "# brace-expansion\n\n[Brace expansion](https://www.gnu.org/software/bash/manual/html_node/Brace-Expansion.html), \nas known from sh/bash, in JavaScript.\n\n[![build status](https://secure.travis-ci.org/juliangruber/brace-expansion.svg)](http://travis-ci.org/juliangruber/brace-expansion)\n[![downloads](https://img.shields.io/npm/dm/brace-expansion.svg)](https://www.npmjs.org/package/brace-expansion)\n\n[![testling badge](https://ci.testling.com/juliangruber/brace-expansion.png)](https://ci.testling.com/juliangruber/brace-expansion)\n\n## Example\n\n```js\nvar expand = require('brace-expansion');\n\nexpand('file-{a,b,c}.jpg')\n// => ['file-a.jpg', 'file-b.jpg', 'file-c.jpg']\n\nexpand('-v{,,}')\n// => ['-v', '-v', '-v']\n\nexpand('file{0..2}.jpg')\n// => ['file0.jpg', 'file1.jpg', 'file2.jpg']\n\nexpand('file-{a..c}.jpg')\n// => ['file-a.jpg', 'file-b.jpg', 'file-c.jpg']\n\nexpand('file{2..0}.jpg')\n// => ['file2.jpg', 'file1.jpg', 'file0.jpg']\n\nexpand('file{0..4..2}.jpg')\n// => ['file0.jpg', 'file2.jpg', 'file4.jpg']\n\nexpand('file-{a..e..2}.jpg')\n// => ['file-a.jpg', 'file-c.jpg', 'file-e.jpg']\n\nexpand('file{00..10..5}.jpg')\n// => ['file00.jpg', 'file05.jpg', 'file10.jpg']\n\nexpand('{{A..C},{a..c}}')\n// => ['A', 'B', 'C', 'a', 'b', 'c']\n\nexpand('ppp{,config,oe{,conf}}')\n// => ['ppp', 'pppconfig', 'pppoe', 'pppoeconf']\n```\n\n## API\n\n```js\nvar expand = require('brace-expansion');\n```\n\n### var expanded = expand(str)\n\nReturn an array of all possible and valid expansions of `str`. If none are\nfound, `[str]` is returned.\n\nValid expansions are:\n\n```js\n/^(.*,)+(.+)?$/\n// {a,b,...}\n```\n\nA comma seperated list of options, like `{a,b}` or `{a,{b,c}}` or `{,a,}`.\n\n```js\n/^-?\\d+\\.\\.-?\\d+(\\.\\.-?\\d+)?$/\n// {x..y[..incr]}\n```\n\nA numeric sequence from `x` to `y` inclusive, with optional increment.\nIf `x` or `y` start with a leading `0`, all the numbers will be padded\nto have equal length. Negative numbers and backwards iteration work too.\n\n```js\n/^-?\\d+\\.\\.-?\\d+(\\.\\.-?\\d+)?$/\n// {x..y[..incr]}\n```\n\nAn alphabetic sequence from `x` to `y` inclusive, with optional increment.\n`x` and `y` must be exactly one character, and if given, `incr` must be a\nnumber.\n\nFor compatibility reasons, the string `${` is not eligible for brace expansion.\n\n## Installation\n\nWith [npm](https://npmjs.org) do:\n\n```bash\nnpm install brace-expansion\n```\n\n## Contributors\n\n- [Julian Gruber](https://github.com/juliangruber)\n- [Isaac Z. Schlueter](https://github.com/isaacs)\n\n## License\n\n(MIT)\n\nCopyright (c) 2013 Julian Gruber <julian@juliangruber.com>\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of\nthis software and associated documentation files (the \"Software\"), to deal in\nthe Software without restriction, including without limitation the rights to\nuse, copy, modify, merge, publish, distribute, sublicense, and/or sell copies\nof the Software, and to permit persons to whom the Software is furnished to do\nso, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n",
+ "readmeFilename": "README.md",
"bugs": {
"url": "https://github.com/juliangruber/brace-expansion/issues"
},
- "_id": "brace-expansion@1.1.1",
- "_shasum": "da5fb78aef4c44c9e4acf525064fb3208ebab045",
- "_from": "brace-expansion@>=1.0.0 <2.0.0",
- "_npmVersion": "2.6.1",
- "_nodeVersion": "0.10.36",
- "_npmUser": {
- "name": "juliangruber",
- "email": "julian@juliangruber.com"
- },
- "maintainers": [
- {
- "name": "juliangruber",
- "email": "julian@juliangruber.com"
- },
- {
- "name": "isaacs",
- "email": "isaacs@npmjs.com"
- }
- ],
- "dist": {
- "shasum": "da5fb78aef4c44c9e4acf525064fb3208ebab045",
- "tarball": "http://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.1.tgz"
- },
- "directories": {},
- "_resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.1.tgz",
- "readme": "ERROR: No README data found!"
+ "_id": "brace-expansion@1.1.2",
+ "_shasum": "f21445d0488b658e2771efd870eff51df29f04ef",
+ "_resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.2.tgz",
+ "_from": "brace-expansion@>=1.0.0 <2.0.0"
}
diff --git a/deps/npm/node_modules/node-gyp/node_modules/glob/node_modules/minimatch/package.json b/deps/npm/node_modules/node-gyp/node_modules/glob/node_modules/minimatch/package.json
index 3dc6beb49f684a..e9256630aa3819 100644
--- a/deps/npm/node_modules/node-gyp/node_modules/glob/node_modules/minimatch/package.json
+++ b/deps/npm/node_modules/node-gyp/node_modules/glob/node_modules/minimatch/package.json
@@ -33,31 +33,14 @@
"minimatch.js",
"browser.js"
],
- "gitHead": "6afb85f0c324b321f76a38df81891e562693e257",
+ "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\nIt works by converting glob expressions into JavaScript `RegExp`\nobjects.\n\n## Usage\n\n```javascript\nvar minimatch = require(\"minimatch\")\n\nminimatch(\"bar.foo\", \"*.foo\") // true!\nminimatch(\"bar.foo\", \"*.bar\") // false!\nminimatch(\"bar.foo\", \"*.+(bar|foo)\", { debug: true }) // true, and noisy!\n```\n\n## Features\n\nSupports these glob features:\n\n* Brace Expansion\n* Extended glob matching\n* \"Globstar\" `**` matching\n\nSee:\n\n* `man sh`\n* `man bash`\n* `man 3 fnmatch`\n* `man 5 gitignore`\n\n## Minimatch Class\n\nCreate a minimatch object by instanting the `minimatch.Minimatch` class.\n\n```javascript\nvar Minimatch = require(\"minimatch\").Minimatch\nvar mm = new Minimatch(pattern, options)\n```\n\n### Properties\n\n* `pattern` The original pattern the minimatch object represents.\n* `options` The options supplied to the constructor.\n* `set` A 2-dimensional array of regexp or string expressions.\n Each row in the\n array corresponds to a brace-expanded pattern. Each item in the row\n corresponds to a single path-part. For example, the pattern\n `{a,b/c}/d` would expand to a set of patterns like:\n\n [ [ a, d ]\n , [ b, c, d ] ]\n\n If a portion of the pattern doesn't have any \"magic\" in it\n (that is, it's something like `\"foo\"` rather than `fo*o?`), then it\n will be left as a string rather than converted to a regular\n expression.\n\n* `regexp` Created by the `makeRe` method. A single regular expression\n expressing the entire pattern. This is useful in cases where you wish\n to use the pattern somewhat like `fnmatch(3)` with `FNM_PATH` enabled.\n* `negate` True if the pattern is negated.\n* `comment` True if the pattern is a comment.\n* `empty` True if the pattern is `\"\"`.\n\n### Methods\n\n* `makeRe` Generate the `regexp` member if necessary, and return it.\n Will return `false` if the pattern is invalid.\n* `match(fname)` Return true if the filename matches the pattern, or\n false otherwise.\n* `matchOne(fileArray, patternArray, partial)` Take a `/`-split\n filename, and match it against a single row in the `regExpSet`. This\n method is mainly for internal use, but is exposed so that it can be\n used by a glob-walker that needs to avoid excessive filesystem calls.\n\nAll other methods are internal, and will be called as necessary.\n\n## Functions\n\nThe top-level exported function has a `cache` property, which is an LRU\ncache set to store 100 items. So, calling these methods repeatedly\nwith the same pattern and options will use the same Minimatch object,\nsaving the cost of parsing it multiple times.\n\n### minimatch(path, pattern, options)\n\nMain export. Tests a path against the pattern using the options.\n\n```javascript\nvar isJS = minimatch(file, \"*.js\", { matchBase: true })\n```\n\n### minimatch.filter(pattern, options)\n\nReturns a function that tests its\nsupplied argument, suitable for use with `Array.filter`. Example:\n\n```javascript\nvar javascripts = fileList.filter(minimatch.filter(\"*.js\", {matchBase: true}))\n```\n\n### minimatch.match(list, pattern, options)\n\nMatch against the list of\nfiles, in the style of fnmatch or glob. If nothing is matched, and\noptions.nonull is set, then return a list containing the pattern itself.\n\n```javascript\nvar javascripts = minimatch.match(fileList, \"*.js\", {matchBase: true}))\n```\n\n### minimatch.makeRe(pattern, options)\n\nMake a regular expression object from the pattern.\n\n## Options\n\nAll options are `false` by default.\n\n### debug\n\nDump a ton of stuff to stderr.\n\n### nobrace\n\nDo not expand `{a,b}` and `{1..3}` brace sets.\n\n### noglobstar\n\nDisable `**` matching against multiple folder names.\n\n### dot\n\nAllow patterns to match filenames starting with a period, even if\nthe pattern does not explicitly have a period in that spot.\n\nNote that by default, `a/**/b` will **not** match `a/.d/b`, unless `dot`\nis set.\n\n### noext\n\nDisable \"extglob\" style patterns like `+(a|b)`.\n\n### nocase\n\nPerform a case-insensitive match.\n\n### nonull\n\nWhen a match is not found by `minimatch.match`, return a list containing\nthe pattern itself if this option is set. When not set, an empty list\nis returned if there are no matches.\n\n### matchBase\n\nIf set, then patterns without slashes will be matched\nagainst the basename of the path if it contains slashes. For example,\n`a?b` would match the path `/xyz/123/acb`, but not `/xyz/acb/123`.\n\n### nocomment\n\nSuppress the behavior of treating `#` at the start of a pattern as a\ncomment.\n\n### nonegate\n\nSuppress the behavior of treating a leading `!` character as negation.\n\n### flipNegate\n\nReturns from negate expressions the same as if they were not negated.\n(Ie, true on a hit, false on a miss.)\n\n\n## Comparisons to other fnmatch/glob implementations\n\nWhile strict compliance with the existing standards is a worthwhile\ngoal, some discrepancies exist between minimatch and other\nimplementations, and are intentional.\n\nIf the pattern starts with a `!` character, then it is negated. Set the\n`nonegate` flag to suppress this behavior, and treat leading `!`\ncharacters normally. This is perhaps relevant if you wish to start the\npattern with a negative extglob pattern like `!(a|B)`. Multiple `!`\ncharacters at the start of a pattern will negate the pattern multiple\ntimes.\n\nIf a pattern starts with `#`, then it is treated as a comment, and\nwill not match anything. Use `\\#` to match a literal `#` at the\nstart of a line, or set the `nocomment` flag to suppress this behavior.\n\nThe double-star character `**` is supported by default, unless the\n`noglobstar` flag is set. This is supported in the manner of bsdglob\nand bash 4.1, where `**` only has special significance if it is the only\nthing in a path part. That is, `a/**/b` will match `a/x/y/b`, but\n`a/**b` will not.\n\nIf an escaped pattern has no matches, and the `nonull` flag is set,\nthen minimatch.match returns the pattern as-provided, rather than\ninterpreting the character escapes. For example,\n`minimatch.match([], \"\\\\*a\\\\?\")` will return `\"\\\\*a\\\\?\"` rather than\n`\"*a?\"`. This is akin to setting the `nullglob` option in bash, except\nthat it does not resolve escaped pattern characters.\n\nIf brace expansion is not disabled, then it is performed before any\nother interpretation of the glob pattern. Thus, a pattern like\n`+(a|{b),c)}`, which would not be valid in bash or zsh, is expanded\n**first** into the set of `+(a|b)` and `+(a|c)`, and those patterns are\nchecked for validity. Since those two are valid, matching proceeds.\n",
+ "readmeFilename": "README.md",
"bugs": {
"url": "https://github.com/isaacs/minimatch/issues"
},
"homepage": "https://github.com/isaacs/minimatch#readme",
"_id": "minimatch@2.0.10",
"_shasum": "8d087c39c6b38c001b97fca7ce6d0e1e80afbac7",
- "_from": "minimatch@>=2.0.1 <3.0.0",
- "_npmVersion": "3.1.0",
- "_nodeVersion": "2.2.1",
- "_npmUser": {
- "name": "isaacs",
- "email": "isaacs@npmjs.com"
- },
- "dist": {
- "shasum": "8d087c39c6b38c001b97fca7ce6d0e1e80afbac7",
- "tarball": "http://registry.npmjs.org/minimatch/-/minimatch-2.0.10.tgz"
- },
- "maintainers": [
- {
- "name": "isaacs",
- "email": "i@izs.me"
- }
- ],
- "directories": {},
"_resolved": "https://registry.npmjs.org/minimatch/-/minimatch-2.0.10.tgz",
- "readme": "ERROR: No README data found!"
+ "_from": "minimatch@>=2.0.1 <3.0.0"
}
diff --git a/deps/npm/node_modules/node-gyp/node_modules/glob/package.json b/deps/npm/node_modules/node-gyp/node_modules/glob/package.json
index ad70fb110ce271..84b72480f8925d 100644
--- a/deps/npm/node_modules/node-gyp/node_modules/glob/package.json
+++ b/deps/npm/node_modules/node-gyp/node_modules/glob/package.json
@@ -42,30 +42,14 @@
"benchclean": "bash benchclean.sh"
},
"license": "ISC",
- "gitHead": "a4e461ab59a837eee80a4d8dbdbf5ae1054a646f",
+ "readme": "[![Build Status](https://travis-ci.org/isaacs/node-glob.svg?branch=master)](https://travis-ci.org/isaacs/node-glob/) [![Dependency Status](https://david-dm.org/isaacs/node-glob.svg)](https://david-dm.org/isaacs/node-glob) [![devDependency Status](https://david-dm.org/isaacs/node-glob/dev-status.svg)](https://david-dm.org/isaacs/node-glob#info=devDependencies) [![optionalDependency Status](https://david-dm.org/isaacs/node-glob/optional-status.svg)](https://david-dm.org/isaacs/node-glob#info=optionalDependencies)\n\n# 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![](oh-my-glob.gif)\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## Glob Primer\n\n\"Globs\" are the patterns you type when you do stuff like `ls *.js` on\nthe command line, or put `build/*` in a `.gitignore` file.\n\nBefore parsing the path part patterns, braced sections are expanded\ninto a set. Braced sections start with `{` and end with `}`, with any\nnumber of comma-delimited sections within. Braced sections may contain\nslash characters, so `a{/b/c,bcd}` would expand into `a/b/c` and `abcd`.\n\nThe following characters have special magic meaning when used in a\npath portion:\n\n* `*` Matches 0 or more characters in a single path portion\n* `?` Matches 1 character\n* `[...]` Matches a range of characters, similar to a RegExp range.\n If the first character of the range is `!` or `^` then it matches\n any character not in the range.\n* `!(pattern|pattern|pattern)` Matches anything that does not match\n any of the patterns provided.\n* `?(pattern|pattern|pattern)` Matches zero or one occurrence of the\n patterns provided.\n* `+(pattern|pattern|pattern)` Matches one or more occurrences of the\n patterns provided.\n* `*(a|b|c)` Matches zero or more occurrences of the patterns provided\n* `@(pattern|pat*|pat?erN)` Matches exactly one of the patterns\n provided\n* `**` If a \"globstar\" is alone in a path portion, then it matches\n zero or more directories and subdirectories searching for matches.\n It does not crawl symlinked directories.\n\n### Dots\n\nIf a file or directory path portion has a `.` as the first character,\nthen it will not match any glob pattern unless that pattern's\ncorresponding path part also has a `.` as its first character.\n\nFor example, the pattern `a/.*/c` would match the file at `a/.b/c`.\nHowever the pattern `a/*/c` would not, because `*` does not start with\na dot character.\n\nYou can make glob treat dots as normal characters by setting\n`dot:true` in the options.\n\n### Basename Matching\n\nIf you set `matchBase:true` in the options, and the pattern has no\nslashes in it, then it will seek for any file anywhere in the tree\nwith a matching basename. For example, `*.js` would match\n`test/simple/basic.js`.\n\n### Negation\n\nThe intent for negation would be for a pattern starting with `!` to\nmatch everything that *doesn't* match the supplied pattern. However,\nthe implementation is weird, and for the time being, this should be\navoided. The behavior will change or be deprecated in version 5.\n\n### Empty Sets\n\nIf no matching files are found, then an empty array is returned. This\ndiffers from the shell, where the pattern itself is returned. For\nexample:\n\n $ echo a*s*d*f\n a*s*d*f\n\nTo get the bash-style behavior, set the `nonull:true` in the options.\n\n### See Also:\n\n* `man sh`\n* `man bash` (Search for \"Pattern Matching\")\n* `man 3 fnmatch`\n* `man 5 gitignore`\n* [minimatch documentation](https://github.com/isaacs/minimatch)\n\n## glob.hasMagic(pattern, [options])\n\nReturns `true` if there are any special characters in the pattern, and\n`false` otherwise.\n\nNote that the options affect the results. If `noext:true` is set in\nthe options object, then `+(a|b)` will not be considered a magic\npattern. If the pattern has a brace expansion, like `a/{b/c,x/y}`\nthen that is considered magical, unless `nobrace:true` is set in the\noptions.\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 instantiating 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* `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 * `'DIR'` - Path exists, and is not a directory\n * `'FILE'` - 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* `statCache` Cache of `fs.stat` results, to prevent statting the same\n path multiple times.\n* `symlinks` A record of which paths are symbolic links, which is\n relevant in resolving `**` patterns.\n* `realpathCache` An optional object which is passed to `fs.realpath`\n to minimize unnecessary syscalls. It is stored on the instantiated\n Glob object, and may be re-used.\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* `pause` Temporarily stop the search\n* `resume` Resume the search\n* `abort` Stop the search forever\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\nIf you are running many `glob` operations, you can pass a Glob object\nas the `options` argument to a subsequent operation to shortcut some\n`stat` and `readdir` calls. At the very least, you may pass in shared\n`symlinks`, `statCache`, `realpathCache`, and `cache` options, so that\nparallel glob operations will be sped up by sharing information about\nthe filesystem.\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.\n* `silent` When an unusual error is encountered when attempting to\n read a directory, a warning will be printed to stderr. Set the\n `silent` option to true to suppress these warnings.\n* `strict` When an unusual error is encountered when attempting to\n read a directory, the process will just continue on in search of\n other matches. Set the `strict` option to raise an error in these\n 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\n to 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* `symlinks` A cache of known symbolic links. You may pass in a\n previously generated `symlinks` object to save `lstat` calls when\n resolving `**` matches.\n* `sync` DEPRECATED: use `glob.sync(pattern, opts)` instead.\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. Set this\n 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* `debug` Set to enable debug logging in minimatch and glob.\n* `nobrace` Do not expand `{a,b}` and `{1..3}` brace sets.\n* `noglobstar` Do not match `**` against multiple filenames. (Ie,\n treat it as a normal `*` instead.)\n* `noext` Do not match `+(a|b)` \"extglob\" patterns.\n* `nocase` Perform a case-insensitive match. Note: on\n case-insensitive filesystems, non-magic patterns will match by\n default, since `stat` and `readdir` will not raise errors.\n* `matchBase` Perform a basename-only match if the pattern does not\n contain any slash characters. That is, `*.js` would be treated as\n equivalent to `**/*.js`, matching all js files in all directories.\n* `nonegate` Suppress `negate` behavior. (See below.)\n* `nocomment` Suppress `comment` behavior. (See below.)\n* `nonull` Return the pattern when no matches are found.\n* `nodir` Do not match directories, only files. (Note: to match\n *only* directories, simply put a `/` at the end of the pattern.)\n* `ignore` Add a pattern or an array of patterns to exclude matches.\n* `follow` Follow symlinked directories when expanding `**` patterns.\n Note that this can result in a lot of duplicate references in the\n presence of cyclic links.\n* `realpath` Set to true to call `fs.realpath` on all of the results.\n In the case of a symlink that cannot be resolved, the full absolute\n path to the matched entry is returned (though it will usually be a\n broken symlink)\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.3, 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\nNote that symlinked directories are not crawled as part of a `**`,\nthough their contents may match against subsequent portions of the\npattern. This prevents infinite loops and duplicates and the like.\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\n## Contributing\n\nAny change to behavior (including bugfixes) must come with a test.\n\nPatches that fail tests or reduce performance will be rejected.\n\n```\n# to run tests\nnpm test\n\n# to re-generate test fixtures\nnpm run test-regen\n\n# to benchmark against bash/zsh\nnpm run bench\n\n# to profile javascript\nnpm run prof\n```\n",
+ "readmeFilename": "README.md",
"bugs": {
"url": "https://github.com/isaacs/node-glob/issues"
},
- "homepage": "https://github.com/isaacs/node-glob",
+ "homepage": "https://github.com/isaacs/node-glob#readme",
"_id": "glob@4.5.3",
"_shasum": "c6cb73d3226c1efef04de3c56d012f03377ee15f",
- "_from": "glob@>=3.0.0 <4.0.0||>=4.0.0 <5.0.0",
- "_npmVersion": "2.7.1",
- "_nodeVersion": "1.4.2",
- "_npmUser": {
- "name": "isaacs",
- "email": "i@izs.me"
- },
- "maintainers": [
- {
- "name": "isaacs",
- "email": "i@izs.me"
- }
- ],
- "dist": {
- "shasum": "c6cb73d3226c1efef04de3c56d012f03377ee15f",
- "tarball": "http://registry.npmjs.org/glob/-/glob-4.5.3.tgz"
- },
- "directories": {},
- "_resolved": "https://registry.npmjs.org/glob/-/glob-4.5.3.tgz"
+ "_resolved": "https://registry.npmjs.org/glob/-/glob-4.5.3.tgz",
+ "_from": "glob@>=3.0.0 <4.0.0||>=4.0.0 <5.0.0"
}
diff --git a/deps/npm/node_modules/node-gyp/node_modules/minimatch/node_modules/lru-cache/.npmignore b/deps/npm/node_modules/node-gyp/node_modules/minimatch/node_modules/lru-cache/.npmignore
new file mode 100644
index 00000000000000..07e6e472cc75fa
--- /dev/null
+++ b/deps/npm/node_modules/node-gyp/node_modules/minimatch/node_modules/lru-cache/.npmignore
@@ -0,0 +1 @@
+/node_modules
diff --git a/deps/npm/node_modules/node-gyp/node_modules/minimatch/node_modules/lru-cache/.travis.yml b/deps/npm/node_modules/node-gyp/node_modules/minimatch/node_modules/lru-cache/.travis.yml
new file mode 100644
index 00000000000000..4af02b3d17e64c
--- /dev/null
+++ b/deps/npm/node_modules/node-gyp/node_modules/minimatch/node_modules/lru-cache/.travis.yml
@@ -0,0 +1,8 @@
+language: node_js
+node_js:
+ - '0.8'
+ - '0.10'
+ - '0.12'
+ - 'iojs'
+before_install:
+ - npm install -g npm@latest
diff --git a/deps/npm/node_modules/node-gyp/node_modules/minimatch/node_modules/lru-cache/CONTRIBUTORS b/deps/npm/node_modules/node-gyp/node_modules/minimatch/node_modules/lru-cache/CONTRIBUTORS
new file mode 100644
index 00000000000000..4a0bc5033a06e7
--- /dev/null
+++ b/deps/npm/node_modules/node-gyp/node_modules/minimatch/node_modules/lru-cache/CONTRIBUTORS
@@ -0,0 +1,14 @@
+# Authors, sorted by whether or not they are me
+Isaac Z. Schlueter
+Brian Cottingham
+Carlos Brito Lage
+Jesse Dailey
+Kevin O'Hara
+Marco Rogers
+Mark Cavage
+Marko Mikulicic
+Nathan Rajlich
+Satheesh Natesan
+Trent Mick
+ashleybrener
+n4kz
diff --git a/deps/npm/node_modules/node-gyp/node_modules/minimatch/node_modules/lru-cache/LICENSE b/deps/npm/node_modules/node-gyp/node_modules/minimatch/node_modules/lru-cache/LICENSE
new file mode 100644
index 00000000000000..19129e315fe593
--- /dev/null
+++ b/deps/npm/node_modules/node-gyp/node_modules/minimatch/node_modules/lru-cache/LICENSE
@@ -0,0 +1,15 @@
+The ISC License
+
+Copyright (c) Isaac Z. Schlueter and Contributors
+
+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/deps/npm/node_modules/node-gyp/node_modules/minimatch/node_modules/lru-cache/README.md b/deps/npm/node_modules/node-gyp/node_modules/minimatch/node_modules/lru-cache/README.md
new file mode 100644
index 00000000000000..c06814e0414d56
--- /dev/null
+++ b/deps/npm/node_modules/node-gyp/node_modules/minimatch/node_modules/lru-cache/README.md
@@ -0,0 +1,137 @@
+# 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.
+
+## Keys should always be Strings or Numbers
+
+Note: this module will print warnings to `console.error` if you use a
+key that is not a String or Number. Because items are stored in an
+object, which coerces keys to a string, it won't go well for you if
+you try to use a key that is not a unique string, it'll cause surprise
+collisions. For example:
+
+```JavaScript
+// Bad Example! Dont' do this!
+var cache = LRU()
+var a = {}
+var b = {}
+cache.set(a, 'this is a')
+cache.set(b, 'this is b')
+console.log(cache.get(a)) // prints: 'this is b'
+```
+
+## 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 `max`
+ 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, maxAge)`
+* `get(key) => value`
+
+ Both of these will update the "recently used"-ness of the key.
+ They do what you think. `max` is optional and overrides the
+ cache `max` option if provided.
+
+* `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.
+
+* `length()`
+
+ Return total length of objects in cache taking into account
+ `length` options function.
+
+* `itemCount`
+
+ Return total quantity of objects currently in cache. Note, that
+ `stale` (see options) items are returned as part of this item
+ count.
+
+* `dump()`
+
+ Return an array of the cache entries ready for serialization and usage
+ with 'destinationCache.load(arr)`.
+
+* `load(cacheEntriesArray)`
+
+ Loads another cache entries array, obtained with `sourceCache.dump()`,
+ into the cache. The destination cache is reset before loading new entries
diff --git a/deps/npm/node_modules/node-gyp/node_modules/minimatch/node_modules/lru-cache/lib/lru-cache.js b/deps/npm/node_modules/node-gyp/node_modules/minimatch/node_modules/lru-cache/lib/lru-cache.js
new file mode 100644
index 00000000000000..2bbe653be8ad08
--- /dev/null
+++ b/deps/npm/node_modules/node-gyp/node_modules/minimatch/node_modules/lru-cache/lib/lru-cache.js
@@ -0,0 +1,334 @@
+;(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 }
+
+var didTypeWarning = false
+function typeCheckKey(key) {
+ if (!didTypeWarning && typeof key !== 'string' && typeof key !== 'number') {
+ didTypeWarning = true
+ console.error(new TypeError("LRU: key must be a string or number. Almost certainly a bug! " + typeof key).stack)
+ }
+}
+
+function LRUCache (options) {
+ if (!(this instanceof LRUCache))
+ return new LRUCache(options)
+
+ if (typeof options === 'number')
+ options = { max: options }
+
+ if (!options)
+ options = {}
+
+ this._max = options.max
+ // Kind of weird to have a default max of Infinity, but oh well.
+ if (!this._max || !(typeof this._max === "number") || this._max <= 0 )
+ this._max = Infinity
+
+ this._lengthCalculator = options.length || naiveLength
+ if (typeof this._lengthCalculator !== "function")
+ this._lengthCalculator = naiveLength
+
+ this._allowStale = options.stale || false
+ this._maxAge = options.maxAge || null
+ this._dispose = options.dispose
+ this.reset()
+}
+
+// resize the cache when the max changes.
+Object.defineProperty(LRUCache.prototype, "max",
+ { set : function (mL) {
+ if (!mL || !(typeof mL === "number") || mL <= 0 ) mL = Infinity
+ this._max = mL
+ if (this._length > this._max) trim(this)
+ }
+ , get : function () { return this._max }
+ , enumerable : true
+ })
+
+// resize the cache when the lengthCalculator changes.
+Object.defineProperty(LRUCache.prototype, "lengthCalculator",
+ { set : function (lC) {
+ if (typeof lC !== "function") {
+ this._lengthCalculator = naiveLength
+ this._length = this._itemCount
+ for (var key in this._cache) {
+ this._cache[key].length = 1
+ }
+ } else {
+ this._lengthCalculator = lC
+ this._length = 0
+ for (var key in this._cache) {
+ this._cache[key].length = this._lengthCalculator(this._cache[key].value)
+ this._length += this._cache[key].length
+ }
+ }
+
+ if (this._length > this._max) trim(this)
+ }
+ , get : function () { return this._lengthCalculator }
+ , enumerable : true
+ })
+
+Object.defineProperty(LRUCache.prototype, "length",
+ { get : function () { return this._length }
+ , enumerable : true
+ })
+
+
+Object.defineProperty(LRUCache.prototype, "itemCount",
+ { get : function () { return this._itemCount }
+ , enumerable : true
+ })
+
+LRUCache.prototype.forEach = function (fn, thisp) {
+ thisp = thisp || this
+ var i = 0
+ var itemCount = this._itemCount
+
+ for (var k = this._mru - 1; k >= 0 && i < itemCount; k--) if (this._lruList[k]) {
+ i++
+ var hit = this._lruList[k]
+ if (isStale(this, hit)) {
+ del(this, hit)
+ if (!this._allowStale) hit = undefined
+ }
+ if (hit) {
+ fn.call(thisp, hit.value, hit.key, this)
+ }
+ }
+}
+
+LRUCache.prototype.keys = function () {
+ var keys = new Array(this._itemCount)
+ var i = 0
+ for (var k = this._mru - 1; k >= 0 && i < this._itemCount; k--) if (this._lruList[k]) {
+ var hit = this._lruList[k]
+ keys[i++] = hit.key
+ }
+ return keys
+}
+
+LRUCache.prototype.values = function () {
+ var values = new Array(this._itemCount)
+ var i = 0
+ for (var k = this._mru - 1; k >= 0 && i < this._itemCount; k--) if (this._lruList[k]) {
+ var hit = this._lruList[k]
+ values[i++] = hit.value
+ }
+ return values
+}
+
+LRUCache.prototype.reset = function () {
+ if (this._dispose && this._cache) {
+ for (var k in this._cache) {
+ this._dispose(k, this._cache[k].value)
+ }
+ }
+
+ this._cache = Object.create(null) // hash of items by key
+ this._lruList = Object.create(null) // list of items in order of use recency
+ this._mru = 0 // most recently used
+ this._lru = 0 // least recently used
+ this._length = 0 // number of items in the list
+ this._itemCount = 0
+}
+
+LRUCache.prototype.dump = function () {
+ var arr = []
+ var i = 0
+
+ for (var k = this._mru - 1; k >= 0 && i < this._itemCount; k--) if (this._lruList[k]) {
+ var hit = this._lruList[k]
+ if (!isStale(this, hit)) {
+ //Do not store staled hits
+ ++i
+ arr.push({
+ k: hit.key,
+ v: hit.value,
+ e: hit.now + (hit.maxAge || 0)
+ });
+ }
+ }
+ //arr has the most read first
+ return arr
+}
+
+LRUCache.prototype.dumpLru = function () {
+ return this._lruList
+}
+
+LRUCache.prototype.set = function (key, value, maxAge) {
+ maxAge = maxAge || this._maxAge
+ typeCheckKey(key)
+
+ var now = maxAge ? Date.now() : 0
+ var len = this._lengthCalculator(value)
+
+ if (hOP(this._cache, key)) {
+ if (len > this._max) {
+ del(this, this._cache[key])
+ return false
+ }
+ // dispose of the old one before overwriting
+ if (this._dispose)
+ this._dispose(key, this._cache[key].value)
+
+ this._cache[key].now = now
+ this._cache[key].maxAge = maxAge
+ this._cache[key].value = value
+ this._length += (len - this._cache[key].length)
+ this._cache[key].length = len
+ this.get(key)
+
+ if (this._length > this._max)
+ trim(this)
+
+ return true
+ }
+
+ var hit = new Entry(key, value, this._mru++, len, now, maxAge)
+
+ // oversized objects fall out of cache automatically.
+ if (hit.length > this._max) {
+ if (this._dispose) this._dispose(key, value)
+ return false
+ }
+
+ this._length += hit.length
+ this._lruList[hit.lu] = this._cache[key] = hit
+ this._itemCount ++
+
+ if (this._length > this._max)
+ trim(this)
+
+ return true
+}
+
+LRUCache.prototype.has = function (key) {
+ typeCheckKey(key)
+ if (!hOP(this._cache, key)) return false
+ var hit = this._cache[key]
+ if (isStale(this, hit)) {
+ return false
+ }
+ return true
+}
+
+LRUCache.prototype.get = function (key) {
+ typeCheckKey(key)
+ return get(this, key, true)
+}
+
+LRUCache.prototype.peek = function (key) {
+ typeCheckKey(key)
+ return get(this, key, false)
+}
+
+LRUCache.prototype.pop = function () {
+ var hit = this._lruList[this._lru]
+ del(this, hit)
+ return hit || null
+}
+
+LRUCache.prototype.del = function (key) {
+ typeCheckKey(key)
+ del(this, this._cache[key])
+}
+
+LRUCache.prototype.load = function (arr) {
+ //reset the cache
+ this.reset();
+
+ var now = Date.now()
+ //A previous serialized cache has the most recent items first
+ for (var l = arr.length - 1; l >= 0; l-- ) {
+ var hit = arr[l]
+ typeCheckKey(hit.k)
+ var expiresAt = hit.e || 0
+ if (expiresAt === 0) {
+ //the item was created without expiration in a non aged cache
+ this.set(hit.k, hit.v)
+ } else {
+ var maxAge = expiresAt - now
+ //dont add already expired items
+ if (maxAge > 0) this.set(hit.k, hit.v, maxAge)
+ }
+ }
+}
+
+function get (self, key, doUse) {
+ typeCheckKey(key)
+ var hit = self._cache[key]
+ if (hit) {
+ if (isStale(self, hit)) {
+ del(self, hit)
+ if (!self._allowStale) hit = undefined
+ } else {
+ if (doUse) use(self, hit)
+ }
+ if (hit) hit = hit.value
+ }
+ return hit
+}
+
+function isStale(self, hit) {
+ if (!hit || (!hit.maxAge && !self._maxAge)) return false
+ var stale = false;
+ var diff = Date.now() - hit.now
+ if (hit.maxAge) {
+ stale = diff > hit.maxAge
+ } else {
+ stale = self._maxAge && (diff > self._maxAge)
+ }
+ return stale;
+}
+
+function use (self, hit) {
+ shiftLU(self, hit)
+ hit.lu = self._mru ++
+ self._lruList[hit.lu] = hit
+}
+
+function trim (self) {
+ while (self._lru < self._mru && self._length > self._max)
+ del(self, self._lruList[self._lru])
+}
+
+function shiftLU (self, hit) {
+ delete self._lruList[ hit.lu ]
+ while (self._lru < self._mru && !self._lruList[self._lru]) self._lru ++
+}
+
+function del (self, hit) {
+ if (hit) {
+ if (self._dispose) self._dispose(hit.key, hit.value)
+ self._length -= hit.length
+ self._itemCount --
+ delete self._cache[ hit.key ]
+ shiftLU(self, hit)
+ }
+}
+
+// classy, since V8 prefers predictable objects.
+function Entry (key, value, lu, length, now, maxAge) {
+ this.key = key
+ this.value = value
+ this.lu = lu
+ this.length = length
+ this.now = now
+ if (maxAge) this.maxAge = maxAge
+}
+
+})()
diff --git a/deps/npm/node_modules/node-gyp/node_modules/minimatch/node_modules/lru-cache/package.json b/deps/npm/node_modules/node-gyp/node_modules/minimatch/node_modules/lru-cache/package.json
new file mode 100644
index 00000000000000..55f8aa534c3a0a
--- /dev/null
+++ b/deps/npm/node_modules/node-gyp/node_modules/minimatch/node_modules/lru-cache/package.json
@@ -0,0 +1,37 @@
+{
+ "name": "lru-cache",
+ "description": "A cache object that deletes the least-recently-used items.",
+ "version": "2.7.3",
+ "author": {
+ "name": "Isaac Z. Schlueter",
+ "email": "i@izs.me"
+ },
+ "keywords": [
+ "mru",
+ "lru",
+ "cache"
+ ],
+ "scripts": {
+ "test": "tap test --gc"
+ },
+ "main": "lib/lru-cache.js",
+ "repository": {
+ "type": "git",
+ "url": "git://github.com/isaacs/node-lru-cache.git"
+ },
+ "devDependencies": {
+ "tap": "^1.2.0",
+ "weak": ""
+ },
+ "license": "ISC",
+ "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## Keys should always be Strings or Numbers\n\nNote: this module will print warnings to `console.error` if you use a\nkey that is not a String or Number. Because items are stored in an\nobject, which coerces keys to a string, it won't go well for you if\nyou try to use a key that is not a unique string, it'll cause surprise\ncollisions. For example:\n\n```JavaScript\n// Bad Example! Dont' do this!\nvar cache = LRU()\nvar a = {}\nvar b = {}\ncache.set(a, 'this is a')\ncache.set(b, 'this is b')\nconsole.log(cache.get(a)) // prints: 'this is b'\n```\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 `max`\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, maxAge)`\n* `get(key) => value`\n\n Both of these will update the \"recently used\"-ness of the key.\n They do what you think. `max` is optional and overrides the\n cache `max` option if provided.\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\n* `length()`\n\n Return total length of objects in cache taking into account\n `length` options function.\n\n* `itemCount`\n\n Return total quantity of objects currently in cache. Note, that\n `stale` (see options) items are returned as part of this item\n count.\n\n* `dump()`\n\n Return an array of the cache entries ready for serialization and usage\n with 'destinationCache.load(arr)`.\n\n* `load(cacheEntriesArray)`\n\n Loads another cache entries array, obtained with `sourceCache.dump()`,\n into the cache. The destination cache is reset before loading new entries\n",
+ "readmeFilename": "README.md",
+ "bugs": {
+ "url": "https://github.com/isaacs/node-lru-cache/issues"
+ },
+ "homepage": "https://github.com/isaacs/node-lru-cache#readme",
+ "_id": "lru-cache@2.7.3",
+ "_shasum": "6d4524e8b955f95d4f5b58851ce21dd72fb4e952",
+ "_resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-2.7.3.tgz",
+ "_from": "lru-cache@>=2.0.0 <3.0.0"
+}
diff --git a/deps/npm/node_modules/node-gyp/node_modules/minimatch/node_modules/lru-cache/test/basic.js b/deps/npm/node_modules/node-gyp/node_modules/minimatch/node_modules/lru-cache/test/basic.js
new file mode 100644
index 00000000000000..b47225f109891f
--- /dev/null
+++ b/deps/npm/node_modules/node-gyp/node_modules/minimatch/node_modules/lru-cache/test/basic.js
@@ -0,0 +1,396 @@
+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()
+})
+
+
+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("lru recently updated 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")
+ t.equal(cache.length, 6) //CCC BB A
+ cache.set("a", "+A")
+ t.equal(cache.length, 7) //+A CCC BB
+ cache.set("b", "++BB")
+ t.equal(cache.length, 6) //++BB +A
+ t.equal(cache.get("c"), undefined)
+
+ cache.set("c", "oversized")
+ t.equal(cache.length, 6) //++BB +A
+ t.equal(cache.get("c"), undefined)
+
+ cache.set("a", "oversized")
+ t.equal(cache.length, 4) //++BB
+ t.equal(cache.get("a"), undefined)
+ t.equal(cache.get("b"), "++BB")
+ 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 + 25)
+
+ 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("individual item can have it's own maxAge", function(t) {
+ var cache = new LRU({
+ max: 5,
+ maxAge: 50
+ })
+
+ cache.set("a", "A", 20)
+ setTimeout(function () {
+ t.notOk(cache.get("a"))
+ t.end()
+ }, 25)
+})
+
+test("individual item can have it's own maxAge > cache's", function(t) {
+ var cache = new LRU({
+ max: 5,
+ maxAge: 20
+ })
+
+ cache.set("a", "A", 50)
+ setTimeout(function () {
+ t.equal(cache.get("a"), "A")
+ t.end()
+ }, 25)
+})
+
+test("disposal function", function(t) {
+ var disposed = false
+ var cache = new LRU({
+ max: 1,
+ dispose: function (k, n) {
+ disposed = n
+ }
+ })
+
+ cache.set(1, 1)
+ cache.set(2, 2)
+ t.equal(disposed, 1)
+ cache.set(3, 3)
+ t.equal(disposed, 2)
+ cache.reset()
+ t.equal(disposed, 3)
+ t.end()
+})
+
+test("disposal function on too big of item", function(t) {
+ var disposed = false
+ var cache = new LRU({
+ max: 1,
+ length: function (k) {
+ return k.length
+ },
+ dispose: function (k, n) {
+ disposed = n
+ }
+ })
+ var obj = [ 1, 2 ]
+
+ t.equal(disposed, false)
+ cache.set("obj", obj)
+ t.equal(disposed, obj)
+ t.end()
+})
+
+test("has()", function(t) {
+ var cache = new LRU({
+ max: 1,
+ maxAge: 10
+ })
+
+ cache.set('foo', 'bar')
+ t.equal(cache.has('foo'), true)
+ cache.set('blu', 'baz')
+ t.equal(cache.has('foo'), false)
+ t.equal(cache.has('blu'), true)
+ setTimeout(function() {
+ t.equal(cache.has('blu'), false)
+ t.end()
+ }, 15)
+})
+
+test("stale", function(t) {
+ var cache = new LRU({
+ maxAge: 10,
+ stale: true
+ })
+
+ cache.set('foo', 'bar')
+ t.equal(cache.get('foo'), 'bar')
+ t.equal(cache.has('foo'), true)
+ setTimeout(function() {
+ t.equal(cache.has('foo'), false)
+ t.equal(cache.get('foo'), 'bar')
+ t.equal(cache.get('foo'), undefined)
+ t.end()
+ }, 15)
+})
+
+test("lru update via set", function(t) {
+ var cache = LRU({ max: 2 });
+
+ cache.set('foo', 1);
+ cache.set('bar', 2);
+ cache.del('bar');
+ cache.set('baz', 3);
+ cache.set('qux', 4);
+
+ t.equal(cache.get('foo'), undefined)
+ t.equal(cache.get('bar'), undefined)
+ t.equal(cache.get('baz'), 3)
+ t.equal(cache.get('qux'), 4)
+ t.end()
+})
+
+test("least recently set w/ peek", function (t) {
+ var cache = new LRU(2)
+ cache.set("a", "A")
+ cache.set("b", "B")
+ t.equal(cache.peek("a"), "A")
+ cache.set("c", "C")
+ t.equal(cache.get("c"), "C")
+ t.equal(cache.get("b"), "B")
+ t.equal(cache.get("a"), undefined)
+ t.end()
+})
+
+test("pop the least used item", function (t) {
+ var cache = new LRU(3)
+ , last
+
+ cache.set("a", "A")
+ cache.set("b", "B")
+ cache.set("c", "C")
+
+ t.equal(cache.length, 3)
+ t.equal(cache.max, 3)
+
+ // Ensure we pop a, c, b
+ cache.get("b", "B")
+
+ last = cache.pop()
+ t.equal(last.key, "a")
+ t.equal(last.value, "A")
+ t.equal(cache.length, 2)
+ t.equal(cache.max, 3)
+
+ last = cache.pop()
+ t.equal(last.key, "c")
+ t.equal(last.value, "C")
+ t.equal(cache.length, 1)
+ t.equal(cache.max, 3)
+
+ last = cache.pop()
+ t.equal(last.key, "b")
+ t.equal(last.value, "B")
+ t.equal(cache.length, 0)
+ t.equal(cache.max, 3)
+
+ last = cache.pop()
+ t.equal(last, null)
+ t.equal(cache.length, 0)
+ t.equal(cache.max, 3)
+
+ t.end()
+})
diff --git a/deps/npm/node_modules/node-gyp/node_modules/minimatch/node_modules/lru-cache/test/foreach.js b/deps/npm/node_modules/node-gyp/node_modules/minimatch/node_modules/lru-cache/test/foreach.js
new file mode 100644
index 00000000000000..4190417cbc61d8
--- /dev/null
+++ b/deps/npm/node_modules/node-gyp/node_modules/minimatch/node_modules/lru-cache/test/foreach.js
@@ -0,0 +1,120 @@
+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.equal(i, order.length);
+
+ 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()
+})
+
+test('all entries are iterated over', function(t) {
+ var l = new LRU(5)
+ for (var i = 0; i < 10; i ++) {
+ l.set(i.toString(), i.toString(2))
+ }
+
+ var i = 0
+ l.forEach(function (val, key, cache) {
+ if (i > 0) {
+ cache.del(key)
+ }
+ i += 1
+ })
+
+ t.equal(i, 5)
+ t.equal(l.keys().length, 1)
+
+ t.end()
+})
+
+test('all stale entries are removed', function(t) {
+ var l = new LRU({ max: 5, maxAge: -5, stale: true })
+ for (var i = 0; i < 10; i ++) {
+ l.set(i.toString(), i.toString(2))
+ }
+
+ var i = 0
+ l.forEach(function () {
+ i += 1
+ })
+
+ t.equal(i, 5)
+ t.equal(l.keys().length, 0)
+
+ t.end()
+})
+
+test('expires', function (t) {
+ var l = new LRU({
+ max: 10,
+ maxAge: 50
+ })
+ for (var i = 0; i < 10; i++) {
+ l.set(i.toString(), i.toString(2), ((i % 2) ? 25 : undefined))
+ }
+
+ var i = 0
+ var order = [ 8, 6, 4, 2, 0 ]
+ setTimeout(function () {
+ 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.equal(i, order.length);
+
+ setTimeout(function () {
+ var count = 0;
+ l.forEach(function (val, key, cache) { count++; })
+ t.equal(0, count);
+ t.end()
+ }, 25)
+
+ }, 26)
+})
diff --git a/deps/npm/node_modules/node-gyp/node_modules/minimatch/node_modules/lru-cache/test/memory-leak.js b/deps/npm/node_modules/node-gyp/node_modules/minimatch/node_modules/lru-cache/test/memory-leak.js
new file mode 100644
index 00000000000000..b5912f6f168e5e
--- /dev/null
+++ b/deps/npm/node_modules/node-gyp/node_modules/minimatch/node_modules/lru-cache/test/memory-leak.js
@@ -0,0 +1,51 @@
+#!/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/deps/npm/node_modules/node-gyp/node_modules/minimatch/node_modules/lru-cache/test/serialize.js b/deps/npm/node_modules/node-gyp/node_modules/minimatch/node_modules/lru-cache/test/serialize.js
new file mode 100644
index 00000000000000..5fe5dc3d371f1e
--- /dev/null
+++ b/deps/npm/node_modules/node-gyp/node_modules/minimatch/node_modules/lru-cache/test/serialize.js
@@ -0,0 +1,215 @@
+var test = require('tap').test
+var LRU = require('../')
+
+test('dump', function (t) {
+ var cache = new LRU()
+
+ t.equal(cache.dump().length, 0, "nothing in dump for empty cache")
+
+ cache.set("a", "A")
+ cache.set("b", "B")
+ t.deepEqual(cache.dump(), [
+ { k: "b", v: "B", e: 0 },
+ { k: "a", v: "A", e: 0 }
+ ])
+
+ cache.set("a", "A");
+ t.deepEqual(cache.dump(), [
+ { k: "a", v: "A", e: 0 },
+ { k: "b", v: "B", e: 0 }
+ ])
+
+ cache.get("b");
+ t.deepEqual(cache.dump(), [
+ { k: "b", v: "B", e: 0 },
+ { k: "a", v: "A", e: 0 }
+ ])
+
+ cache.del("a");
+ t.deepEqual(cache.dump(), [
+ { k: "b", v: "B", e: 0 }
+ ])
+
+ t.end()
+})
+
+test("do not dump stale items", function(t) {
+ var cache = new LRU({
+ max: 5,
+ maxAge: 50
+ })
+
+ //expires at 50
+ cache.set("a", "A")
+
+ setTimeout(function () {
+ //expires at 75
+ cache.set("b", "B")
+ var s = cache.dump()
+ t.equal(s.length, 2)
+ t.equal(s[0].k, "b")
+ t.equal(s[1].k, "a")
+ }, 25)
+
+ setTimeout(function () {
+ //expires at 110
+ cache.set("c", "C")
+ var s = cache.dump()
+ t.equal(s.length, 2)
+ t.equal(s[0].k, "c")
+ t.equal(s[1].k, "b")
+ }, 60)
+
+ setTimeout(function () {
+ //expires at 130
+ cache.set("d", "D", 40)
+ var s = cache.dump()
+ t.equal(s.length, 2)
+ t.equal(s[0].k, "d")
+ t.equal(s[1].k, "c")
+ }, 90)
+
+ setTimeout(function () {
+ var s = cache.dump()
+ t.equal(s.length, 1)
+ t.equal(s[0].k, "d")
+ }, 120)
+
+ setTimeout(function () {
+ var s = cache.dump()
+ t.deepEqual(s, [])
+ t.end()
+ }, 155)
+})
+
+test("load basic cache", function(t) {
+ var cache = new LRU(),
+ copy = new LRU()
+
+ cache.set("a", "A")
+ cache.set("b", "B")
+
+ copy.load(cache.dump())
+ t.deepEquals(cache.dump(), copy.dump())
+
+ t.end()
+})
+
+
+test("load staled cache", function(t) {
+ var cache = new LRU({maxAge: 50}),
+ copy = new LRU({maxAge: 50}),
+ arr
+
+ //expires at 50
+ cache.set("a", "A")
+ setTimeout(function () {
+ //expires at 80
+ cache.set("b", "B")
+ arr = cache.dump()
+ t.equal(arr.length, 2)
+ }, 30)
+
+ setTimeout(function () {
+ copy.load(arr)
+ t.equal(copy.get("a"), undefined)
+ t.equal(copy.get("b"), "B")
+ }, 60)
+
+ setTimeout(function () {
+ t.equal(copy.get("b"), undefined)
+ t.end()
+ }, 90)
+})
+
+test("load to other size cache", function(t) {
+ var cache = new LRU({max: 2}),
+ copy = new LRU({max: 1})
+
+ cache.set("a", "A")
+ cache.set("b", "B")
+
+ copy.load(cache.dump())
+ t.equal(copy.get("a"), undefined)
+ t.equal(copy.get("b"), "B")
+
+ //update the last read from original cache
+ cache.get("a")
+ copy.load(cache.dump())
+ t.equal(copy.get("a"), "A")
+ t.equal(copy.get("b"), undefined)
+
+ t.end()
+})
+
+
+test("load to other age cache", function(t) {
+ var cache = new LRU({maxAge: 50}),
+ aged = new LRU({maxAge: 100}),
+ simple = new LRU(),
+ arr,
+ expired
+
+ //created at 0
+ //a would be valid till 0 + 50
+ cache.set("a", "A")
+ setTimeout(function () {
+ //created at 20
+ //b would be valid till 20 + 50
+ cache.set("b", "B")
+ //b would be valid till 20 + 70
+ cache.set("c", "C", 70)
+ arr = cache.dump()
+ t.equal(arr.length, 3)
+ }, 20)
+
+ setTimeout(function () {
+ t.equal(cache.get("a"), undefined)
+ t.equal(cache.get("b"), "B")
+ t.equal(cache.get("c"), "C")
+
+ aged.load(arr)
+ t.equal(aged.get("a"), undefined)
+ t.equal(aged.get("b"), "B")
+ t.equal(aged.get("c"), "C")
+
+ simple.load(arr)
+ t.equal(simple.get("a"), undefined)
+ t.equal(simple.get("b"), "B")
+ t.equal(simple.get("c"), "C")
+ }, 60)
+
+ setTimeout(function () {
+ t.equal(cache.get("a"), undefined)
+ t.equal(cache.get("b"), undefined)
+ t.equal(cache.get("c"), "C")
+
+ aged.load(arr)
+ t.equal(aged.get("a"), undefined)
+ t.equal(aged.get("b"), undefined)
+ t.equal(aged.get("c"), "C")
+
+ simple.load(arr)
+ t.equal(simple.get("a"), undefined)
+ t.equal(simple.get("b"), undefined)
+ t.equal(simple.get("c"), "C")
+ }, 80)
+
+ setTimeout(function () {
+ t.equal(cache.get("a"), undefined)
+ t.equal(cache.get("b"), undefined)
+ t.equal(cache.get("c"), undefined)
+
+ aged.load(arr)
+ t.equal(aged.get("a"), undefined)
+ t.equal(aged.get("b"), undefined)
+ t.equal(aged.get("c"), undefined)
+
+ simple.load(arr)
+ t.equal(simple.get("a"), undefined)
+ t.equal(simple.get("b"), undefined)
+ t.equal(simple.get("c"), undefined)
+ t.end()
+ }, 100)
+
+})
diff --git a/deps/npm/node_modules/node-gyp/node_modules/minimatch/node_modules/sigmund/package.json b/deps/npm/node_modules/node-gyp/node_modules/minimatch/node_modules/sigmund/package.json
index 4255e77a933eed..0432d4e4c55ee5 100644
--- a/deps/npm/node_modules/node-gyp/node_modules/minimatch/node_modules/sigmund/package.json
+++ b/deps/npm/node_modules/node-gyp/node_modules/minimatch/node_modules/sigmund/package.json
@@ -31,30 +31,14 @@
"url": "http://blog.izs.me/"
},
"license": "ISC",
- "gitHead": "527f97aa5bb253d927348698c0cd3bb267d098c6",
+ "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 cocaine-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 `util.inspect` and `JSON.stringify`, larger objects will\nproduce larger signature strings.\n\nBecause sigmund is a bit less strict than the more thorough\nalternatives, the strings will be shorter, and also there is a\nslightly higher chance for collisions. For example, these objects\nhave the same signature:\n\n var obj1 = {a:'b',c:/def/,g:['h','i',{j:'',k:'l'}]}\n var obj2 = {a:'b',c:'/def/',g:['h','i','{jkl']}\n\nLike a good Freudian, sigmund is most effective when you already have\nsome understanding of what you're looking for. It can help you help\nyourself, but you must be willing to do some work as well.\n\nCycles are handled, and cyclical objects are silently omitted (though\nthe key is included in the signature output.)\n\nThe second argument is the maximum depth, which defaults to 10,\nbecause that is the maximum object traversal depth covered by most\ninsurance carriers.\n",
+ "readmeFilename": "README.md",
"bugs": {
"url": "https://github.com/isaacs/sigmund/issues"
},
"homepage": "https://github.com/isaacs/sigmund#readme",
"_id": "sigmund@1.0.1",
"_shasum": "3ff21f198cad2175f9f3b781853fd94d0d19b590",
- "_from": "sigmund@>=1.0.0 <1.1.0",
- "_npmVersion": "2.10.0",
- "_nodeVersion": "2.0.1",
- "_npmUser": {
- "name": "isaacs",
- "email": "isaacs@npmjs.com"
- },
- "dist": {
- "shasum": "3ff21f198cad2175f9f3b781853fd94d0d19b590",
- "tarball": "http://registry.npmjs.org/sigmund/-/sigmund-1.0.1.tgz"
- },
- "maintainers": [
- {
- "name": "isaacs",
- "email": "i@izs.me"
- }
- ],
"_resolved": "https://registry.npmjs.org/sigmund/-/sigmund-1.0.1.tgz",
- "readme": "ERROR: No README data found!"
+ "_from": "sigmund@>=1.0.0 <1.1.0"
}
diff --git a/deps/npm/node_modules/node-gyp/node_modules/minimatch/package.json b/deps/npm/node_modules/node-gyp/node_modules/minimatch/package.json
index 8bf46ccae0c4f6..412ab5de12686d 100644
--- a/deps/npm/node_modules/node-gyp/node_modules/minimatch/package.json
+++ b/deps/npm/node_modules/node-gyp/node_modules/minimatch/package.json
@@ -29,30 +29,14 @@
"type": "MIT",
"url": "http://github.com/isaacs/minimatch/raw/master/LICENSE"
},
- "gitHead": "b374a643976eb55cdc19c60b6dd51ebe9bcc607a",
+ "readme": "# minimatch\n\nA minimal matching utility.\n\n[![Build Status](https://secure.travis-ci.org/isaacs/minimatch.png)](http://travis-ci.org/isaacs/minimatch)\n\n\nThis is the matching library used internally by npm.\n\nEventually, it will replace the C binding in node-glob.\n\nIt works by converting glob expressions into JavaScript `RegExp`\nobjects.\n\n## Usage\n\n```javascript\nvar minimatch = require(\"minimatch\")\n\nminimatch(\"bar.foo\", \"*.foo\") // true!\nminimatch(\"bar.foo\", \"*.bar\") // false!\nminimatch(\"bar.foo\", \"*.+(bar|foo)\", { debug: true }) // true, and noisy!\n```\n\n## Features\n\nSupports these glob features:\n\n* Brace Expansion\n* Extended glob matching\n* \"Globstar\" `**` matching\n\nSee:\n\n* `man sh`\n* `man bash`\n* `man 3 fnmatch`\n* `man 5 gitignore`\n\n## Minimatch Class\n\nCreate a minimatch object by instanting the `minimatch.Minimatch` class.\n\n```javascript\nvar Minimatch = require(\"minimatch\").Minimatch\nvar mm = new Minimatch(pattern, options)\n```\n\n### Properties\n\n* `pattern` The original pattern the minimatch object represents.\n* `options` The options supplied to the constructor.\n* `set` A 2-dimensional array of regexp or string expressions.\n Each row in the\n array corresponds to a brace-expanded pattern. Each item in the row\n corresponds to a single path-part. For example, the pattern\n `{a,b/c}/d` would expand to a set of patterns like:\n\n [ [ a, d ]\n , [ b, c, d ] ]\n\n If a portion of the pattern doesn't have any \"magic\" in it\n (that is, it's something like `\"foo\"` rather than `fo*o?`), then it\n will be left as a string rather than converted to a regular\n expression.\n\n* `regexp` Created by the `makeRe` method. A single regular expression\n expressing the entire pattern. This is useful in cases where you wish\n to use the pattern somewhat like `fnmatch(3)` with `FNM_PATH` enabled.\n* `negate` True if the pattern is negated.\n* `comment` True if the pattern is a comment.\n* `empty` True if the pattern is `\"\"`.\n\n### Methods\n\n* `makeRe` Generate the `regexp` member if necessary, and return it.\n Will return `false` if the pattern is invalid.\n* `match(fname)` Return true if the filename matches the pattern, or\n false otherwise.\n* `matchOne(fileArray, patternArray, partial)` Take a `/`-split\n filename, and match it against a single row in the `regExpSet`. This\n method is mainly for internal use, but is exposed so that it can be\n used by a glob-walker that needs to avoid excessive filesystem calls.\n\nAll other methods are internal, and will be called as necessary.\n\n## Functions\n\nThe top-level exported function has a `cache` property, which is an LRU\ncache set to store 100 items. So, calling these methods repeatedly\nwith the same pattern and options will use the same Minimatch object,\nsaving the cost of parsing it multiple times.\n\n### minimatch(path, pattern, options)\n\nMain export. Tests a path against the pattern using the options.\n\n```javascript\nvar isJS = minimatch(file, \"*.js\", { matchBase: true })\n```\n\n### minimatch.filter(pattern, options)\n\nReturns a function that tests its\nsupplied argument, suitable for use with `Array.filter`. Example:\n\n```javascript\nvar javascripts = fileList.filter(minimatch.filter(\"*.js\", {matchBase: true}))\n```\n\n### minimatch.match(list, pattern, options)\n\nMatch against the list of\nfiles, in the style of fnmatch or glob. If nothing is matched, and\noptions.nonull is set, then return a list containing the pattern itself.\n\n```javascript\nvar javascripts = minimatch.match(fileList, \"*.js\", {matchBase: true}))\n```\n\n### minimatch.makeRe(pattern, options)\n\nMake a regular expression object from the pattern.\n\n## Options\n\nAll options are `false` by default.\n\n### debug\n\nDump a ton of stuff to stderr.\n\n### nobrace\n\nDo not expand `{a,b}` and `{1..3}` brace sets.\n\n### noglobstar\n\nDisable `**` matching against multiple folder names.\n\n### dot\n\nAllow patterns to match filenames starting with a period, even if\nthe pattern does not explicitly have a period in that spot.\n\nNote that by default, `a/**/b` will **not** match `a/.d/b`, unless `dot`\nis set.\n\n### noext\n\nDisable \"extglob\" style patterns like `+(a|b)`.\n\n### nocase\n\nPerform a case-insensitive match.\n\n### nonull\n\nWhen a match is not found by `minimatch.match`, return a list containing\nthe pattern itself if this option is set. When not set, an empty list\nis returned if there are no matches.\n\n### matchBase\n\nIf set, then patterns without slashes will be matched\nagainst the basename of the path if it contains slashes. For example,\n`a?b` would match the path `/xyz/123/acb`, but not `/xyz/acb/123`.\n\n### nocomment\n\nSuppress the behavior of treating `#` at the start of a pattern as a\ncomment.\n\n### nonegate\n\nSuppress the behavior of treating a leading `!` character as negation.\n\n### flipNegate\n\nReturns from negate expressions the same as if they were not negated.\n(Ie, true on a hit, false on a miss.)\n\n\n## Comparisons to other fnmatch/glob implementations\n\nWhile strict compliance with the existing standards is a worthwhile\ngoal, some discrepancies exist between minimatch and other\nimplementations, and are intentional.\n\nIf the pattern starts with a `!` character, then it is negated. Set the\n`nonegate` flag to suppress this behavior, and treat leading `!`\ncharacters normally. This is perhaps relevant if you wish to start the\npattern with a negative extglob pattern like `!(a|B)`. Multiple `!`\ncharacters at the start of a pattern will negate the pattern multiple\ntimes.\n\nIf a pattern starts with `#`, then it is treated as a comment, and\nwill not match anything. Use `\\#` to match a literal `#` at the\nstart of a line, or set the `nocomment` flag to suppress this behavior.\n\nThe double-star character `**` is supported by default, unless the\n`noglobstar` flag is set. This is supported in the manner of bsdglob\nand bash 4.1, where `**` only has special significance if it is the only\nthing in a path part. That is, `a/**/b` will match `a/x/y/b`, but\n`a/**b` will not.\n\nIf an escaped pattern has no matches, and the `nonull` flag is set,\nthen minimatch.match returns the pattern as-provided, rather than\ninterpreting the character escapes. For example,\n`minimatch.match([], \"\\\\*a\\\\?\")` will return `\"\\\\*a\\\\?\"` rather than\n`\"*a?\"`. This is akin to setting the `nullglob` option in bash, except\nthat it does not resolve escaped pattern characters.\n\nIf brace expansion is not disabled, then it is performed before any\nother interpretation of the glob pattern. Thus, a pattern like\n`+(a|{b),c)}`, which would not be valid in bash or zsh, is expanded\n**first** into the set of `+(a|b)` and `+(a|c)`, and those patterns are\nchecked for validity. Since those two are valid, matching proceeds.\n",
+ "readmeFilename": "README.md",
"bugs": {
"url": "https://github.com/isaacs/minimatch/issues"
},
- "homepage": "https://github.com/isaacs/minimatch",
+ "homepage": "https://github.com/isaacs/minimatch#readme",
"_id": "minimatch@1.0.0",
"_shasum": "e0dd2120b49e1b724ce8d714c520822a9438576d",
- "_from": "minimatch@>=1.0.0 <2.0.0",
- "_npmVersion": "1.4.21",
- "_npmUser": {
- "name": "isaacs",
- "email": "i@izs.me"
- },
- "maintainers": [
- {
- "name": "isaacs",
- "email": "i@izs.me"
- }
- ],
- "dist": {
- "shasum": "e0dd2120b49e1b724ce8d714c520822a9438576d",
- "tarball": "http://registry.npmjs.org/minimatch/-/minimatch-1.0.0.tgz"
- },
- "directories": {},
"_resolved": "https://registry.npmjs.org/minimatch/-/minimatch-1.0.0.tgz",
- "readme": "ERROR: No README data found!"
+ "_from": "minimatch@>=1.0.0 <2.0.0"
}
diff --git a/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/are-we-there-yet/LICENSE b/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/are-we-there-yet/LICENSE
new file mode 100644
index 00000000000000..af4588069db82d
--- /dev/null
+++ b/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/are-we-there-yet/LICENSE
@@ -0,0 +1,5 @@
+Copyright (c) 2015, Rebecca Turner
+
+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/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/are-we-there-yet/README.md b/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/are-we-there-yet/README.md
index 3491c5956cc236..cff489810b4f54 100644
--- a/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/are-we-there-yet/README.md
+++ b/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/are-we-there-yet/README.md
@@ -128,7 +128,8 @@ Tracker
events. Defaults to undefined.
* **todo** *(optional)* The amount of work todo (a number). Defaults to 0.
-Ordinarily these are constructed as a part of a tracker group (via `newItem`) but they c
+Ordinarily these are constructed as a part of a tracker group (via
+`newItem`).
* var completed = tracker.completed()
diff --git a/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/are-we-there-yet/node_modules/delegates/package.json b/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/are-we-there-yet/node_modules/delegates/package.json
index ea3c1da0d490b2..4b732e7e3577cb 100644
--- a/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/are-we-there-yet/node_modules/delegates/package.json
+++ b/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/are-we-there-yet/node_modules/delegates/package.json
@@ -3,7 +3,7 @@
"version": "0.1.0",
"repository": {
"type": "git",
- "url": "git://github.com/visionmedia/node-delegates.git"
+ "url": "git+https://github.com/visionmedia/node-delegates.git"
},
"description": "delegate methods and accessors to another property",
"keywords": [
@@ -16,33 +16,14 @@
"should": "*"
},
"license": "MIT",
+ "readme": "\n# delegates\n\n Node method and accessor delegation utilty.\n\n## Installation\n\n```\n$ npm install delegates\n```\n\n## Example\n\n```js\nvar delegate = require('delegates');\n\n...\n\ndelegate(proto, 'request')\n .method('acceptsLanguages')\n .method('acceptsEncodings')\n .method('acceptsCharsets')\n .method('accepts')\n .method('is')\n .access('querystring')\n .access('idempotent')\n .access('socket')\n .access('length')\n .access('query')\n .access('search')\n .access('status')\n .access('method')\n .access('path')\n .access('body')\n .access('host')\n .access('url')\n .getter('subdomains')\n .getter('protocol')\n .getter('header')\n .getter('stale')\n .getter('fresh')\n .getter('secure')\n .getter('ips')\n .getter('ip')\n```\n\n# API\n\n## Delegate(proto, prop)\n\nCreates a delegator instance used to configure using the `prop` on the given\n`proto` object. (which is usually a prototype)\n\n## Delegate#method(name)\n\nAllows the given method `name` to be accessed on the host.\n\n## Delegate#getter(name)\n\nCreates a \"getter\" for the property with the given `name` on the delegated\nobject.\n\n## Delegate#setter(name)\n\nCreates a \"setter\" for the property with the given `name` on the delegated\nobject.\n\n## Delegate#access(name)\n\nCreates an \"accessor\" (ie: both getter *and* setter) for the property with the\ngiven `name` on the delegated object.\n\n## Delegate#fluent(name)\n\nA unique type of \"accessor\" that works for a \"fluent\" API. When called as a\ngetter, the method returns the expected value. However, if the method is called\nwith a value, it will return itself so it can be chained. For example:\n\n```js\ndelegate(proto, 'request')\n .fluent('query')\n\n// getter\nvar q = request.query();\n\n// setter (chainable)\nrequest\n .query({ a: 1 })\n .query({ b: 2 });\n```\n\n# License\n\n MIT\n",
+ "readmeFilename": "Readme.md",
"bugs": {
"url": "https://github.com/visionmedia/node-delegates/issues"
},
- "homepage": "https://github.com/visionmedia/node-delegates",
+ "homepage": "https://github.com/visionmedia/node-delegates#readme",
"_id": "delegates@0.1.0",
"_shasum": "b4b57be11a1653517a04b27f0949bdc327dfe390",
- "_from": "delegates@>=0.1.0 <0.2.0",
- "_npmVersion": "1.4.9",
- "_npmUser": {
- "name": "dominicbarnes",
- "email": "dominic@dbarnes.info"
- },
- "maintainers": [
- {
- "name": "tjholowaychuk",
- "email": "tj@vision-media.ca"
- },
- {
- "name": "dominicbarnes",
- "email": "dominic@dbarnes.info"
- }
- ],
- "dist": {
- "shasum": "b4b57be11a1653517a04b27f0949bdc327dfe390",
- "tarball": "http://registry.npmjs.org/delegates/-/delegates-0.1.0.tgz"
- },
- "directories": {},
"_resolved": "https://registry.npmjs.org/delegates/-/delegates-0.1.0.tgz",
- "readme": "ERROR: No README data found!"
+ "_from": "delegates@>=0.1.0 <0.2.0"
}
diff --git a/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/are-we-there-yet/package.json b/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/are-we-there-yet/package.json
index 759100666932a3..36966f6056d3bd 100644
--- a/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/are-we-there-yet/package.json
+++ b/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/are-we-there-yet/package.json
@@ -1,6 +1,6 @@
{
"name": "are-we-there-yet",
- "version": "1.0.4",
+ "version": "1.0.5",
"description": "Keep track of the overall completion of many dispirate processes",
"main": "index.js",
"scripts": {
@@ -24,28 +24,29 @@
},
"dependencies": {
"delegates": "^0.1.0",
- "readable-stream": "^1.1.13"
+ "readable-stream": "^2.0.0 || ^1.1.13"
},
- "gitHead": "7ce414849b81ab83935a935275def01914821bde",
- "_id": "are-we-there-yet@1.0.4",
- "_shasum": "527fe389f7bcba90806106b99244eaa07e886f85",
+ "gitHead": "abaff79ae17e9397eae19d29d2d75778d18aab3a",
+ "_id": "are-we-there-yet@1.0.5",
+ "_shasum": "239f26706da902a2bffb72c33de66fdfd3798ac5",
"_from": "are-we-there-yet@>=1.0.0 <1.1.0",
- "_npmVersion": "2.0.0",
+ "_npmVersion": "3.5.2",
+ "_nodeVersion": "4.2.2",
"_npmUser": {
"name": "iarna",
"email": "me@re-becca.org"
},
+ "dist": {
+ "shasum": "239f26706da902a2bffb72c33de66fdfd3798ac5",
+ "tarball": "http://registry.npmjs.org/are-we-there-yet/-/are-we-there-yet-1.0.5.tgz"
+ },
"maintainers": [
{
"name": "iarna",
"email": "me@re-becca.org"
}
],
- "dist": {
- "shasum": "527fe389f7bcba90806106b99244eaa07e886f85",
- "tarball": "http://registry.npmjs.org/are-we-there-yet/-/are-we-there-yet-1.0.4.tgz"
- },
"directories": {},
- "_resolved": "https://registry.npmjs.org/are-we-there-yet/-/are-we-there-yet-1.0.4.tgz",
+ "_resolved": "https://registry.npmjs.org/are-we-there-yet/-/are-we-there-yet-1.0.5.tgz",
"readme": "ERROR: No README data found!"
}
diff --git a/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/has-unicode/package.json b/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/has-unicode/package.json
index 6430bb74a470fc..61491a10cc1deb 100644
--- a/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/has-unicode/package.json
+++ b/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/has-unicode/package.json
@@ -27,27 +27,10 @@
"require-inject": "^1.1.1",
"tap": "^0.4.13"
},
- "gitHead": "d4ad300c67b25c197582e42e936ea928f7935d01",
+ "readme": "has-unicode\n===========\n\nTry to guess if your terminal supports unicode\n\n```javascript\nvar hasUnicode = require(\"has-unicode\")\n\nif (hasUnicode()) {\n // the terminal probably has unicode support\n}\n```\n```javascript\nvar hasUnicode = require(\"has-unicode\").tryHarder\nhasUnicode(function(unicodeSupported) {\n if (unicodeSupported) {\n // the terminal probably has unicode support\n }\n})\n```\n\n## Detecting Unicode\n\nWhat we actually detect is UTF-8 support, as that's what Node itself supports.\nIf you have a UTF-16 locale then you won't be detected as unicode capable.\n\n### Windows\n\nSince at least Windows 7, `cmd` and `powershell` have been unicode capable.\nAs such, we report any Windows installation as unicode capable.\n\n\n### Unix Like Operating Systems\n\nWe look at the environment variables `LC_ALL`, `LC_CTYPE`, and `LANG` in\nthat order. For `LC_ALL` and `LANG`, it looks for `.UTF-8` in the value. \nFor `LC_CTYPE` it looks to see if the value is `UTF-8`. This is sufficient\nfor most POSIX systems. While locale data can be put in `/etc/locale.conf`\nas well, AFAIK it's always copied into the environment.\n\n",
+ "readmeFilename": "README.md",
"_id": "has-unicode@1.0.1",
"_shasum": "c46fceea053eb8ec789bffbba25fca52dfdcf38e",
- "_from": "has-unicode@>=1.0.0 <2.0.0",
- "_npmVersion": "3.3.6",
- "_nodeVersion": "4.1.1",
- "_npmUser": {
- "name": "iarna",
- "email": "me@re-becca.org"
- },
- "dist": {
- "shasum": "c46fceea053eb8ec789bffbba25fca52dfdcf38e",
- "tarball": "http://registry.npmjs.org/has-unicode/-/has-unicode-1.0.1.tgz"
- },
- "maintainers": [
- {
- "name": "iarna",
- "email": "me@re-becca.org"
- }
- ],
- "directories": {},
"_resolved": "https://registry.npmjs.org/has-unicode/-/has-unicode-1.0.1.tgz",
- "readme": "ERROR: No README data found!"
+ "_from": "has-unicode@>=1.0.0 <2.0.0"
}
diff --git a/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.pad/node_modules/lodash._basetostring/package.json b/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.pad/node_modules/lodash._basetostring/package.json
index f592f32e198f3e..b305178dba5878 100644
--- a/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.pad/node_modules/lodash._basetostring/package.json
+++ b/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.pad/node_modules/lodash._basetostring/package.json
@@ -44,45 +44,13 @@
"scripts": {
"test": "echo \"See https://travis-ci.org/lodash/lodash-cli for testing details.\""
},
+ "readme": "# lodash._basetostring v3.0.1\n\nThe [modern build](https://github.com/lodash/lodash/wiki/Build-Differences) of [lodash’s](https://lodash.com/) internal `baseToString` exported as a [Node.js](http://nodejs.org/)/[io.js](https://iojs.org/) module.\n\n## Installation\n\nUsing npm:\n\n```bash\n$ {sudo -H} npm i -g npm\n$ npm i --save lodash._basetostring\n```\n\nIn Node.js/io.js:\n\n```js\nvar baseToString = require('lodash._basetostring');\n```\n\nSee the [package source](https://github.com/lodash/lodash/blob/3.0.1-npm-packages/lodash._basetostring) for more details.\n",
+ "readmeFilename": "README.md",
"bugs": {
"url": "https://github.com/lodash/lodash/issues"
},
"_id": "lodash._basetostring@3.0.1",
"_shasum": "d1861d877f824a52f669832dcaf3ee15566a07d5",
- "_from": "lodash._basetostring@>=3.0.0 <4.0.0",
- "_npmVersion": "2.12.0",
- "_nodeVersion": "0.12.5",
- "_npmUser": {
- "name": "jdalton",
- "email": "john.david.dalton@gmail.com"
- },
- "maintainers": [
- {
- "name": "jdalton",
- "email": "john.david.dalton@gmail.com"
- },
- {
- "name": "d10",
- "email": "demoneaux@gmail.com"
- },
- {
- "name": "kitcambridge",
- "email": "github@kitcambridge.be"
- },
- {
- "name": "mathias",
- "email": "mathias@qiwi.be"
- },
- {
- "name": "phated",
- "email": "blaine@iceddev.com"
- }
- ],
- "dist": {
- "shasum": "d1861d877f824a52f669832dcaf3ee15566a07d5",
- "tarball": "http://registry.npmjs.org/lodash._basetostring/-/lodash._basetostring-3.0.1.tgz"
- },
- "directories": {},
"_resolved": "https://registry.npmjs.org/lodash._basetostring/-/lodash._basetostring-3.0.1.tgz",
- "readme": "ERROR: No README data found!"
+ "_from": "lodash._basetostring@>=3.0.0 <4.0.0"
}
diff --git a/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.pad/node_modules/lodash._createpadding/node_modules/lodash.repeat/package.json b/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.pad/node_modules/lodash._createpadding/node_modules/lodash.repeat/package.json
index f941138c4bfdcf..f02acc4ba12027 100644
--- a/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.pad/node_modules/lodash._createpadding/node_modules/lodash.repeat/package.json
+++ b/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.pad/node_modules/lodash._createpadding/node_modules/lodash.repeat/package.json
@@ -53,45 +53,13 @@
"dependencies": {
"lodash._basetostring": "^3.0.0"
},
+ "readme": "# lodash.repeat v3.0.1\n\nThe [modern build](https://github.com/lodash/lodash/wiki/Build-Differences) of [lodash’s](https://lodash.com/) `_.repeat` exported as a [Node.js](http://nodejs.org/)/[io.js](https://iojs.org/) module.\n\n## Installation\n\nUsing npm:\n\n```bash\n$ {sudo -H} npm i -g npm\n$ npm i --save lodash.repeat\n```\n\nIn Node.js/io.js:\n\n```js\nvar repeat = require('lodash.repeat');\n```\n\nSee the [documentation](https://lodash.com/docs#repeat) or [package source](https://github.com/lodash/lodash/blob/3.0.1-npm-packages/lodash.repeat) for more details.\n",
+ "readmeFilename": "README.md",
"bugs": {
"url": "https://github.com/lodash/lodash/issues"
},
"_id": "lodash.repeat@3.0.1",
"_shasum": "f4b98dc7ef67256ce61e7874e1865edb208e0edf",
- "_from": "lodash.repeat@>=3.0.0 <4.0.0",
- "_npmVersion": "2.12.0",
- "_nodeVersion": "0.12.5",
- "_npmUser": {
- "name": "jdalton",
- "email": "john.david.dalton@gmail.com"
- },
- "maintainers": [
- {
- "name": "jdalton",
- "email": "john.david.dalton@gmail.com"
- },
- {
- "name": "d10",
- "email": "demoneaux@gmail.com"
- },
- {
- "name": "kitcambridge",
- "email": "github@kitcambridge.be"
- },
- {
- "name": "mathias",
- "email": "mathias@qiwi.be"
- },
- {
- "name": "phated",
- "email": "blaine@iceddev.com"
- }
- ],
- "dist": {
- "shasum": "f4b98dc7ef67256ce61e7874e1865edb208e0edf",
- "tarball": "http://registry.npmjs.org/lodash.repeat/-/lodash.repeat-3.0.1.tgz"
- },
- "directories": {},
"_resolved": "https://registry.npmjs.org/lodash.repeat/-/lodash.repeat-3.0.1.tgz",
- "readme": "ERROR: No README data found!"
+ "_from": "lodash.repeat@>=3.0.0 <4.0.0"
}
diff --git a/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.pad/node_modules/lodash._createpadding/package.json b/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.pad/node_modules/lodash._createpadding/package.json
index 376b174bee4ab4..b53f86c8fa4e62 100644
--- a/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.pad/node_modules/lodash._createpadding/package.json
+++ b/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.pad/node_modules/lodash._createpadding/package.json
@@ -47,45 +47,13 @@
"dependencies": {
"lodash.repeat": "^3.0.0"
},
+ "readme": "# lodash._createpadding v3.6.1\n\nThe [modern build](https://github.com/lodash/lodash/wiki/Build-Differences) of [lodash’s](https://lodash.com/) internal `createPadding` exported as a [Node.js](http://nodejs.org/)/[io.js](https://iojs.org/) module.\n\n## Installation\n\nUsing npm:\n\n```bash\n$ {sudo -H} npm i -g npm\n$ npm i --save lodash._createpadding\n```\n\nIn Node.js/io.js:\n\n```js\nvar createPadding = require('lodash._createpadding');\n```\n\nSee the [package source](https://github.com/lodash/lodash/blob/3.6.1-npm-packages/lodash._createpadding) for more details.\n",
+ "readmeFilename": "README.md",
"bugs": {
"url": "https://github.com/lodash/lodash/issues"
},
"_id": "lodash._createpadding@3.6.1",
"_shasum": "4907b438595adc54ee8935527a6c424c02c81a87",
- "_from": "lodash._createpadding@>=3.0.0 <4.0.0",
- "_npmVersion": "2.12.0",
- "_nodeVersion": "0.12.5",
- "_npmUser": {
- "name": "jdalton",
- "email": "john.david.dalton@gmail.com"
- },
- "maintainers": [
- {
- "name": "jdalton",
- "email": "john.david.dalton@gmail.com"
- },
- {
- "name": "d10",
- "email": "demoneaux@gmail.com"
- },
- {
- "name": "kitcambridge",
- "email": "github@kitcambridge.be"
- },
- {
- "name": "mathias",
- "email": "mathias@qiwi.be"
- },
- {
- "name": "phated",
- "email": "blaine@iceddev.com"
- }
- ],
- "dist": {
- "shasum": "4907b438595adc54ee8935527a6c424c02c81a87",
- "tarball": "http://registry.npmjs.org/lodash._createpadding/-/lodash._createpadding-3.6.1.tgz"
- },
- "directories": {},
"_resolved": "https://registry.npmjs.org/lodash._createpadding/-/lodash._createpadding-3.6.1.tgz",
- "readme": "ERROR: No README data found!"
+ "_from": "lodash._createpadding@>=3.0.0 <4.0.0"
}
diff --git a/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.pad/package.json b/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.pad/package.json
index c18ed47167af3a..b86f390b481654 100644
--- a/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.pad/package.json
+++ b/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.pad/package.json
@@ -54,45 +54,13 @@
"lodash._basetostring": "^3.0.0",
"lodash._createpadding": "^3.0.0"
},
+ "readme": "# lodash.pad v3.1.1\n\nThe [modern build](https://github.com/lodash/lodash/wiki/Build-Differences) of [lodash’s](https://lodash.com/) `_.pad` exported as a [Node.js](http://nodejs.org/)/[io.js](https://iojs.org/) module.\n\n## Installation\n\nUsing npm:\n\n```bash\n$ {sudo -H} npm i -g npm\n$ npm i --save lodash.pad\n```\n\nIn Node.js/io.js:\n\n```js\nvar pad = require('lodash.pad');\n```\n\nSee the [documentation](https://lodash.com/docs#pad) or [package source](https://github.com/lodash/lodash/blob/3.1.1-npm-packages/lodash.pad) for more details.\n",
+ "readmeFilename": "README.md",
"bugs": {
"url": "https://github.com/lodash/lodash/issues"
},
"_id": "lodash.pad@3.1.1",
"_shasum": "2e078ebc33b331d2ba34bf8732af129fd5c04624",
- "_from": "lodash.pad@>=3.0.0 <4.0.0",
- "_npmVersion": "2.12.0",
- "_nodeVersion": "0.12.5",
- "_npmUser": {
- "name": "jdalton",
- "email": "john.david.dalton@gmail.com"
- },
- "maintainers": [
- {
- "name": "jdalton",
- "email": "john.david.dalton@gmail.com"
- },
- {
- "name": "d10",
- "email": "demoneaux@gmail.com"
- },
- {
- "name": "kitcambridge",
- "email": "github@kitcambridge.be"
- },
- {
- "name": "mathias",
- "email": "mathias@qiwi.be"
- },
- {
- "name": "phated",
- "email": "blaine@iceddev.com"
- }
- ],
- "dist": {
- "shasum": "2e078ebc33b331d2ba34bf8732af129fd5c04624",
- "tarball": "http://registry.npmjs.org/lodash.pad/-/lodash.pad-3.1.1.tgz"
- },
- "directories": {},
"_resolved": "https://registry.npmjs.org/lodash.pad/-/lodash.pad-3.1.1.tgz",
- "readme": "ERROR: No README data found!"
+ "_from": "lodash.pad@>=3.0.0 <4.0.0"
}
diff --git a/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padleft/node_modules/lodash._basetostring/package.json b/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padleft/node_modules/lodash._basetostring/package.json
index f592f32e198f3e..b305178dba5878 100644
--- a/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padleft/node_modules/lodash._basetostring/package.json
+++ b/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padleft/node_modules/lodash._basetostring/package.json
@@ -44,45 +44,13 @@
"scripts": {
"test": "echo \"See https://travis-ci.org/lodash/lodash-cli for testing details.\""
},
+ "readme": "# lodash._basetostring v3.0.1\n\nThe [modern build](https://github.com/lodash/lodash/wiki/Build-Differences) of [lodash’s](https://lodash.com/) internal `baseToString` exported as a [Node.js](http://nodejs.org/)/[io.js](https://iojs.org/) module.\n\n## Installation\n\nUsing npm:\n\n```bash\n$ {sudo -H} npm i -g npm\n$ npm i --save lodash._basetostring\n```\n\nIn Node.js/io.js:\n\n```js\nvar baseToString = require('lodash._basetostring');\n```\n\nSee the [package source](https://github.com/lodash/lodash/blob/3.0.1-npm-packages/lodash._basetostring) for more details.\n",
+ "readmeFilename": "README.md",
"bugs": {
"url": "https://github.com/lodash/lodash/issues"
},
"_id": "lodash._basetostring@3.0.1",
"_shasum": "d1861d877f824a52f669832dcaf3ee15566a07d5",
- "_from": "lodash._basetostring@>=3.0.0 <4.0.0",
- "_npmVersion": "2.12.0",
- "_nodeVersion": "0.12.5",
- "_npmUser": {
- "name": "jdalton",
- "email": "john.david.dalton@gmail.com"
- },
- "maintainers": [
- {
- "name": "jdalton",
- "email": "john.david.dalton@gmail.com"
- },
- {
- "name": "d10",
- "email": "demoneaux@gmail.com"
- },
- {
- "name": "kitcambridge",
- "email": "github@kitcambridge.be"
- },
- {
- "name": "mathias",
- "email": "mathias@qiwi.be"
- },
- {
- "name": "phated",
- "email": "blaine@iceddev.com"
- }
- ],
- "dist": {
- "shasum": "d1861d877f824a52f669832dcaf3ee15566a07d5",
- "tarball": "http://registry.npmjs.org/lodash._basetostring/-/lodash._basetostring-3.0.1.tgz"
- },
- "directories": {},
"_resolved": "https://registry.npmjs.org/lodash._basetostring/-/lodash._basetostring-3.0.1.tgz",
- "readme": "ERROR: No README data found!"
+ "_from": "lodash._basetostring@>=3.0.0 <4.0.0"
}
diff --git a/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padleft/node_modules/lodash._createpadding/node_modules/lodash.repeat/package.json b/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padleft/node_modules/lodash._createpadding/node_modules/lodash.repeat/package.json
index f941138c4bfdcf..f02acc4ba12027 100644
--- a/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padleft/node_modules/lodash._createpadding/node_modules/lodash.repeat/package.json
+++ b/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padleft/node_modules/lodash._createpadding/node_modules/lodash.repeat/package.json
@@ -53,45 +53,13 @@
"dependencies": {
"lodash._basetostring": "^3.0.0"
},
+ "readme": "# lodash.repeat v3.0.1\n\nThe [modern build](https://github.com/lodash/lodash/wiki/Build-Differences) of [lodash’s](https://lodash.com/) `_.repeat` exported as a [Node.js](http://nodejs.org/)/[io.js](https://iojs.org/) module.\n\n## Installation\n\nUsing npm:\n\n```bash\n$ {sudo -H} npm i -g npm\n$ npm i --save lodash.repeat\n```\n\nIn Node.js/io.js:\n\n```js\nvar repeat = require('lodash.repeat');\n```\n\nSee the [documentation](https://lodash.com/docs#repeat) or [package source](https://github.com/lodash/lodash/blob/3.0.1-npm-packages/lodash.repeat) for more details.\n",
+ "readmeFilename": "README.md",
"bugs": {
"url": "https://github.com/lodash/lodash/issues"
},
"_id": "lodash.repeat@3.0.1",
"_shasum": "f4b98dc7ef67256ce61e7874e1865edb208e0edf",
- "_from": "lodash.repeat@>=3.0.0 <4.0.0",
- "_npmVersion": "2.12.0",
- "_nodeVersion": "0.12.5",
- "_npmUser": {
- "name": "jdalton",
- "email": "john.david.dalton@gmail.com"
- },
- "maintainers": [
- {
- "name": "jdalton",
- "email": "john.david.dalton@gmail.com"
- },
- {
- "name": "d10",
- "email": "demoneaux@gmail.com"
- },
- {
- "name": "kitcambridge",
- "email": "github@kitcambridge.be"
- },
- {
- "name": "mathias",
- "email": "mathias@qiwi.be"
- },
- {
- "name": "phated",
- "email": "blaine@iceddev.com"
- }
- ],
- "dist": {
- "shasum": "f4b98dc7ef67256ce61e7874e1865edb208e0edf",
- "tarball": "http://registry.npmjs.org/lodash.repeat/-/lodash.repeat-3.0.1.tgz"
- },
- "directories": {},
"_resolved": "https://registry.npmjs.org/lodash.repeat/-/lodash.repeat-3.0.1.tgz",
- "readme": "ERROR: No README data found!"
+ "_from": "lodash.repeat@>=3.0.0 <4.0.0"
}
diff --git a/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padleft/node_modules/lodash._createpadding/package.json b/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padleft/node_modules/lodash._createpadding/package.json
index 376b174bee4ab4..b53f86c8fa4e62 100644
--- a/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padleft/node_modules/lodash._createpadding/package.json
+++ b/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padleft/node_modules/lodash._createpadding/package.json
@@ -47,45 +47,13 @@
"dependencies": {
"lodash.repeat": "^3.0.0"
},
+ "readme": "# lodash._createpadding v3.6.1\n\nThe [modern build](https://github.com/lodash/lodash/wiki/Build-Differences) of [lodash’s](https://lodash.com/) internal `createPadding` exported as a [Node.js](http://nodejs.org/)/[io.js](https://iojs.org/) module.\n\n## Installation\n\nUsing npm:\n\n```bash\n$ {sudo -H} npm i -g npm\n$ npm i --save lodash._createpadding\n```\n\nIn Node.js/io.js:\n\n```js\nvar createPadding = require('lodash._createpadding');\n```\n\nSee the [package source](https://github.com/lodash/lodash/blob/3.6.1-npm-packages/lodash._createpadding) for more details.\n",
+ "readmeFilename": "README.md",
"bugs": {
"url": "https://github.com/lodash/lodash/issues"
},
"_id": "lodash._createpadding@3.6.1",
"_shasum": "4907b438595adc54ee8935527a6c424c02c81a87",
- "_from": "lodash._createpadding@>=3.0.0 <4.0.0",
- "_npmVersion": "2.12.0",
- "_nodeVersion": "0.12.5",
- "_npmUser": {
- "name": "jdalton",
- "email": "john.david.dalton@gmail.com"
- },
- "maintainers": [
- {
- "name": "jdalton",
- "email": "john.david.dalton@gmail.com"
- },
- {
- "name": "d10",
- "email": "demoneaux@gmail.com"
- },
- {
- "name": "kitcambridge",
- "email": "github@kitcambridge.be"
- },
- {
- "name": "mathias",
- "email": "mathias@qiwi.be"
- },
- {
- "name": "phated",
- "email": "blaine@iceddev.com"
- }
- ],
- "dist": {
- "shasum": "4907b438595adc54ee8935527a6c424c02c81a87",
- "tarball": "http://registry.npmjs.org/lodash._createpadding/-/lodash._createpadding-3.6.1.tgz"
- },
- "directories": {},
"_resolved": "https://registry.npmjs.org/lodash._createpadding/-/lodash._createpadding-3.6.1.tgz",
- "readme": "ERROR: No README data found!"
+ "_from": "lodash._createpadding@>=3.0.0 <4.0.0"
}
diff --git a/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padleft/package.json b/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padleft/package.json
index 55b0c256f9d1bc..ac84716ef6a44d 100644
--- a/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padleft/package.json
+++ b/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padleft/package.json
@@ -54,45 +54,13 @@
"lodash._basetostring": "^3.0.0",
"lodash._createpadding": "^3.0.0"
},
+ "readme": "# lodash.padleft v3.1.1\n\nThe [modern build](https://github.com/lodash/lodash/wiki/Build-Differences) of [lodash’s](https://lodash.com/) `_.padLeft` exported as a [Node.js](http://nodejs.org/)/[io.js](https://iojs.org/) module.\n\n## Installation\n\nUsing npm:\n\n```bash\n$ {sudo -H} npm i -g npm\n$ npm i --save lodash.padleft\n```\n\nIn Node.js/io.js:\n\n```js\nvar padLeft = require('lodash.padleft');\n```\n\nSee the [documentation](https://lodash.com/docs#padLeft) or [package source](https://github.com/lodash/lodash/blob/3.1.1-npm-packages/lodash.padleft) for more details.\n",
+ "readmeFilename": "README.md",
"bugs": {
"url": "https://github.com/lodash/lodash/issues"
},
"_id": "lodash.padleft@3.1.1",
"_shasum": "150151f1e0245edba15d50af2d71f1d5cff46530",
- "_from": "lodash.padleft@>=3.0.0 <4.0.0",
- "_npmVersion": "2.9.0",
- "_nodeVersion": "0.12.2",
- "_npmUser": {
- "name": "jdalton",
- "email": "john.david.dalton@gmail.com"
- },
- "maintainers": [
- {
- "name": "jdalton",
- "email": "john.david.dalton@gmail.com"
- },
- {
- "name": "d10",
- "email": "demoneaux@gmail.com"
- },
- {
- "name": "kitcambridge",
- "email": "github@kitcambridge.be"
- },
- {
- "name": "mathias",
- "email": "mathias@qiwi.be"
- },
- {
- "name": "phated",
- "email": "blaine@iceddev.com"
- }
- ],
- "dist": {
- "shasum": "150151f1e0245edba15d50af2d71f1d5cff46530",
- "tarball": "http://registry.npmjs.org/lodash.padleft/-/lodash.padleft-3.1.1.tgz"
- },
- "directories": {},
"_resolved": "https://registry.npmjs.org/lodash.padleft/-/lodash.padleft-3.1.1.tgz",
- "readme": "ERROR: No README data found!"
+ "_from": "lodash.padleft@>=3.0.0 <4.0.0"
}
diff --git a/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padright/node_modules/lodash._basetostring/package.json b/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padright/node_modules/lodash._basetostring/package.json
index f592f32e198f3e..b305178dba5878 100644
--- a/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padright/node_modules/lodash._basetostring/package.json
+++ b/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padright/node_modules/lodash._basetostring/package.json
@@ -44,45 +44,13 @@
"scripts": {
"test": "echo \"See https://travis-ci.org/lodash/lodash-cli for testing details.\""
},
+ "readme": "# lodash._basetostring v3.0.1\n\nThe [modern build](https://github.com/lodash/lodash/wiki/Build-Differences) of [lodash’s](https://lodash.com/) internal `baseToString` exported as a [Node.js](http://nodejs.org/)/[io.js](https://iojs.org/) module.\n\n## Installation\n\nUsing npm:\n\n```bash\n$ {sudo -H} npm i -g npm\n$ npm i --save lodash._basetostring\n```\n\nIn Node.js/io.js:\n\n```js\nvar baseToString = require('lodash._basetostring');\n```\n\nSee the [package source](https://github.com/lodash/lodash/blob/3.0.1-npm-packages/lodash._basetostring) for more details.\n",
+ "readmeFilename": "README.md",
"bugs": {
"url": "https://github.com/lodash/lodash/issues"
},
"_id": "lodash._basetostring@3.0.1",
"_shasum": "d1861d877f824a52f669832dcaf3ee15566a07d5",
- "_from": "lodash._basetostring@>=3.0.0 <4.0.0",
- "_npmVersion": "2.12.0",
- "_nodeVersion": "0.12.5",
- "_npmUser": {
- "name": "jdalton",
- "email": "john.david.dalton@gmail.com"
- },
- "maintainers": [
- {
- "name": "jdalton",
- "email": "john.david.dalton@gmail.com"
- },
- {
- "name": "d10",
- "email": "demoneaux@gmail.com"
- },
- {
- "name": "kitcambridge",
- "email": "github@kitcambridge.be"
- },
- {
- "name": "mathias",
- "email": "mathias@qiwi.be"
- },
- {
- "name": "phated",
- "email": "blaine@iceddev.com"
- }
- ],
- "dist": {
- "shasum": "d1861d877f824a52f669832dcaf3ee15566a07d5",
- "tarball": "http://registry.npmjs.org/lodash._basetostring/-/lodash._basetostring-3.0.1.tgz"
- },
- "directories": {},
"_resolved": "https://registry.npmjs.org/lodash._basetostring/-/lodash._basetostring-3.0.1.tgz",
- "readme": "ERROR: No README data found!"
+ "_from": "lodash._basetostring@>=3.0.0 <4.0.0"
}
diff --git a/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padright/node_modules/lodash._createpadding/node_modules/lodash.repeat/package.json b/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padright/node_modules/lodash._createpadding/node_modules/lodash.repeat/package.json
index f941138c4bfdcf..f02acc4ba12027 100644
--- a/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padright/node_modules/lodash._createpadding/node_modules/lodash.repeat/package.json
+++ b/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padright/node_modules/lodash._createpadding/node_modules/lodash.repeat/package.json
@@ -53,45 +53,13 @@
"dependencies": {
"lodash._basetostring": "^3.0.0"
},
+ "readme": "# lodash.repeat v3.0.1\n\nThe [modern build](https://github.com/lodash/lodash/wiki/Build-Differences) of [lodash’s](https://lodash.com/) `_.repeat` exported as a [Node.js](http://nodejs.org/)/[io.js](https://iojs.org/) module.\n\n## Installation\n\nUsing npm:\n\n```bash\n$ {sudo -H} npm i -g npm\n$ npm i --save lodash.repeat\n```\n\nIn Node.js/io.js:\n\n```js\nvar repeat = require('lodash.repeat');\n```\n\nSee the [documentation](https://lodash.com/docs#repeat) or [package source](https://github.com/lodash/lodash/blob/3.0.1-npm-packages/lodash.repeat) for more details.\n",
+ "readmeFilename": "README.md",
"bugs": {
"url": "https://github.com/lodash/lodash/issues"
},
"_id": "lodash.repeat@3.0.1",
"_shasum": "f4b98dc7ef67256ce61e7874e1865edb208e0edf",
- "_from": "lodash.repeat@>=3.0.0 <4.0.0",
- "_npmVersion": "2.12.0",
- "_nodeVersion": "0.12.5",
- "_npmUser": {
- "name": "jdalton",
- "email": "john.david.dalton@gmail.com"
- },
- "maintainers": [
- {
- "name": "jdalton",
- "email": "john.david.dalton@gmail.com"
- },
- {
- "name": "d10",
- "email": "demoneaux@gmail.com"
- },
- {
- "name": "kitcambridge",
- "email": "github@kitcambridge.be"
- },
- {
- "name": "mathias",
- "email": "mathias@qiwi.be"
- },
- {
- "name": "phated",
- "email": "blaine@iceddev.com"
- }
- ],
- "dist": {
- "shasum": "f4b98dc7ef67256ce61e7874e1865edb208e0edf",
- "tarball": "http://registry.npmjs.org/lodash.repeat/-/lodash.repeat-3.0.1.tgz"
- },
- "directories": {},
"_resolved": "https://registry.npmjs.org/lodash.repeat/-/lodash.repeat-3.0.1.tgz",
- "readme": "ERROR: No README data found!"
+ "_from": "lodash.repeat@>=3.0.0 <4.0.0"
}
diff --git a/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padright/node_modules/lodash._createpadding/package.json b/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padright/node_modules/lodash._createpadding/package.json
index 376b174bee4ab4..b53f86c8fa4e62 100644
--- a/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padright/node_modules/lodash._createpadding/package.json
+++ b/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padright/node_modules/lodash._createpadding/package.json
@@ -47,45 +47,13 @@
"dependencies": {
"lodash.repeat": "^3.0.0"
},
+ "readme": "# lodash._createpadding v3.6.1\n\nThe [modern build](https://github.com/lodash/lodash/wiki/Build-Differences) of [lodash’s](https://lodash.com/) internal `createPadding` exported as a [Node.js](http://nodejs.org/)/[io.js](https://iojs.org/) module.\n\n## Installation\n\nUsing npm:\n\n```bash\n$ {sudo -H} npm i -g npm\n$ npm i --save lodash._createpadding\n```\n\nIn Node.js/io.js:\n\n```js\nvar createPadding = require('lodash._createpadding');\n```\n\nSee the [package source](https://github.com/lodash/lodash/blob/3.6.1-npm-packages/lodash._createpadding) for more details.\n",
+ "readmeFilename": "README.md",
"bugs": {
"url": "https://github.com/lodash/lodash/issues"
},
"_id": "lodash._createpadding@3.6.1",
"_shasum": "4907b438595adc54ee8935527a6c424c02c81a87",
- "_from": "lodash._createpadding@>=3.0.0 <4.0.0",
- "_npmVersion": "2.12.0",
- "_nodeVersion": "0.12.5",
- "_npmUser": {
- "name": "jdalton",
- "email": "john.david.dalton@gmail.com"
- },
- "maintainers": [
- {
- "name": "jdalton",
- "email": "john.david.dalton@gmail.com"
- },
- {
- "name": "d10",
- "email": "demoneaux@gmail.com"
- },
- {
- "name": "kitcambridge",
- "email": "github@kitcambridge.be"
- },
- {
- "name": "mathias",
- "email": "mathias@qiwi.be"
- },
- {
- "name": "phated",
- "email": "blaine@iceddev.com"
- }
- ],
- "dist": {
- "shasum": "4907b438595adc54ee8935527a6c424c02c81a87",
- "tarball": "http://registry.npmjs.org/lodash._createpadding/-/lodash._createpadding-3.6.1.tgz"
- },
- "directories": {},
"_resolved": "https://registry.npmjs.org/lodash._createpadding/-/lodash._createpadding-3.6.1.tgz",
- "readme": "ERROR: No README data found!"
+ "_from": "lodash._createpadding@>=3.0.0 <4.0.0"
}
diff --git a/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padright/package.json b/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padright/package.json
index 2a40f94bfc3bfd..cf8ce7f968d73e 100644
--- a/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padright/package.json
+++ b/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padright/package.json
@@ -54,45 +54,13 @@
"lodash._basetostring": "^3.0.0",
"lodash._createpadding": "^3.0.0"
},
+ "readme": "# lodash.padright v3.1.1\n\nThe [modern build](https://github.com/lodash/lodash/wiki/Build-Differences) of [lodash’s](https://lodash.com/) `_.padRight` exported as a [Node.js](http://nodejs.org/)/[io.js](https://iojs.org/) module.\n\n## Installation\n\nUsing npm:\n\n```bash\n$ {sudo -H} npm i -g npm\n$ npm i --save lodash.padright\n```\n\nIn Node.js/io.js:\n\n```js\nvar padRight = require('lodash.padright');\n```\n\nSee the [documentation](https://lodash.com/docs#padRight) or [package source](https://github.com/lodash/lodash/blob/3.1.1-npm-packages/lodash.padright) for more details.\n",
+ "readmeFilename": "README.md",
"bugs": {
"url": "https://github.com/lodash/lodash/issues"
},
"_id": "lodash.padright@3.1.1",
"_shasum": "79f7770baaa39738c040aeb5465e8d88f2aacec0",
- "_from": "lodash.padright@>=3.0.0 <4.0.0",
- "_npmVersion": "2.9.0",
- "_nodeVersion": "0.12.2",
- "_npmUser": {
- "name": "jdalton",
- "email": "john.david.dalton@gmail.com"
- },
- "maintainers": [
- {
- "name": "jdalton",
- "email": "john.david.dalton@gmail.com"
- },
- {
- "name": "d10",
- "email": "demoneaux@gmail.com"
- },
- {
- "name": "kitcambridge",
- "email": "github@kitcambridge.be"
- },
- {
- "name": "mathias",
- "email": "mathias@qiwi.be"
- },
- {
- "name": "phated",
- "email": "blaine@iceddev.com"
- }
- ],
- "dist": {
- "shasum": "79f7770baaa39738c040aeb5465e8d88f2aacec0",
- "tarball": "http://registry.npmjs.org/lodash.padright/-/lodash.padright-3.1.1.tgz"
- },
- "directories": {},
"_resolved": "https://registry.npmjs.org/lodash.padright/-/lodash.padright-3.1.1.tgz",
- "readme": "ERROR: No README data found!"
+ "_from": "lodash.padright@>=3.0.0 <4.0.0"
}
diff --git a/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/package.json b/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/package.json
index d16cc33df97528..693ea43f6441d1 100644
--- a/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/package.json
+++ b/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/package.json
@@ -34,27 +34,10 @@
"devDependencies": {
"tap": "^0.4.13"
},
- "gitHead": "9f7eeeeed3b74a70f30b721d570435f6ffbc0168",
+ "readme": "gauge\n=====\n\nA nearly stateless terminal based horizontal guage / progress bar.\n\n```javascript\nvar Gauge = require(\"gauge\")\n\nvar gauge = new Gauge()\n\ngauge.show(\"test\", 0.20)\n\ngauge.pulse(\"this\")\n\ngauge.hide()\n```\n\n![](example.png)\n\n\n### `var gauge = new Gauge([options], [ansiStream])`\n\n* **options** – *(optional)* An option object. (See [below] for details.)\n* **ansiStream** – *(optional)* A stream that's been blessed by the [ansi]\n module to include various commands for controlling the cursor in a terminal.\n\n[ansi]: https://www.npmjs.com/package/ansi\n[below]: #theme-objects\n\nConstructs a new gauge. Gauges are drawn on a single line, and are not drawn\nif the current terminal isn't a tty.\n\nIf you resize your terminal in a way that can be detected then the gauge\nwill be drawn at the new size. As a general rule, growing your terminal will\nbe clean, but shrinking your terminal will result in cruft as we don't have\nenough information to know where what we wrote previously is now located.\n\nThe **options** object can have the following properties, all of which are\noptional:\n\n* maxUpdateFrequency: defaults to 50 msec, the gauge will not be drawn more\n than once in this period of time. This applies to `show` and `pulse`\n calls, but if you `hide` and then `show` the gauge it will draw it\n regardless of time since last draw.\n* theme: defaults to Gauge.unicode` if the terminal supports\n unicode according to [has-unicode], otherwise it defaults to `Gauge.ascii`.\n Details on the [theme object](#theme-objects) are documented elsewhere.\n* template: see [documentation elsewhere](#template-objects) for\n defaults and details.\n\n[has-unicode]: https://www.npmjs.com/package/has-unicode\n\nIf **ansiStream** isn't passed in, then one will be constructed from stderr\nwith `ansi(process.stderr)`.\n\n### `gauge.show([name, [completed]])`\n\n* **name** – *(optional)* The name of the current thing contributing to progress. Defaults to the last value used, or \"\".\n* **completed** – *(optional)* The portion completed as a value between 0 and 1. Defaults to the last value used, or 0.\n\nIf `process.stdout.isTTY` is false then this does nothing. If completed is 0\nand `gauge.pulse` has never been called, then similarly nothing will be printed.\n\nIf `maxUpdateFrequency` msec haven't passed since the last call to `show` or\n`pulse` then similarly, nothing will be printed. (Actually, the update is\ndeferred until `maxUpdateFrequency` msec have passed and if nothing else has\nhappened, the gauge update will happen.)\n\n### `gauge.hide()`\n\nRemoves the gauge from the terminal.\n\n### `gauge.pulse([name])`\n\n* **name** – *(optional)* The specific thing that triggered this pulse\n\nSpins the spinner in the gauge to show output. If **name** is included then\nit will be combined with the last name passed to `gauge.show` using the\nsubsection property of the theme (typically a right facing arrow).\n\n### `gauge.disable()`\n\nHides the gauge and ignores further calls to `show` or `pulse`.\n\n### `gauge.enable()`\n\nShows the gauge and resumes updating when `show` or `pulse` is called.\n\n### `gauge.setTheme(theme)`\n\nChange the active theme, will be displayed with the next show or pulse\n\n### `gauge.setTemplate(template)`\n\nChange the active template, will be displayed with the next show or pulse\n\n### Theme Objects\n\nThere are two theme objects available as a part of the module, `Gauge.unicode` and `Gauge.ascii`.\nTheme objects have the follow properties:\n\n| Property | Unicode | ASCII |\n| ---------- | ------- | ----- |\n| startgroup | ╢ | \\| |\n| endgroup | ╟ | \\| |\n| complete | █ | # |\n| incomplete | ░ | - |\n| spinner | ▀▐▄▌ | -\\\\\\|/ |\n| subsection | → | -> |\n\n*startgroup*, *endgroup* and *subsection* can be as many characters as you want.\n\n*complete* and *incomplete* should be a single character width each.\n\n*spinner* is a list of characters to use in turn when displaying an activity\nspinner. The Gauge will spin as many characters as you give here.\n\n### Template Objects\n\nA template is an array of objects and strings that, after being evaluated,\nwill be turned into the gauge line. The default template is:\n\n```javascript\n[\n {type: \"name\", separated: true, maxLength: 25, minLength: 25, align: \"left\"},\n {type: \"spinner\", separated: true},\n {type: \"startgroup\"},\n {type: \"completionbar\"},\n {type: \"endgroup\"}\n]\n```\n\nThe various template elements can either be **plain strings**, in which case they will\nbe be included verbatum in the output.\n\nIf the template element is an object, it can have the following keys:\n\n* *type* can be:\n * `name` – The most recent name passed to `show`; if this is in response to a\n `pulse` then the name passed to `pulse` will be appended along with the\n subsection property from the theme.\n * `spinner` – If you've ever called `pulse` this will be one of the characters\n from the spinner property of the theme.\n * `startgroup` – The `startgroup` property from the theme.\n * `completionbar` – This progress bar itself\n * `endgroup` – The `endgroup` property from the theme.\n* *separated* – If true, the element will be separated with spaces from things on\n either side (and margins count as space, so it won't be indented), but only\n if its included.\n* *maxLength* – The maximum length for this element. If its value is longer it\n will be truncated.\n* *minLength* – The minimum length for this element. If its value is shorter it\n will be padded according to the *align* value.\n* *align* – (Default: left) Possible values \"left\", \"right\" and \"center\". Works\n as you'd expect from word processors.\n* *length* – Provides a single value for both *minLength* and *maxLength*. If both\n *length* and *minLength or *maxLength* are specifed then the latter take precedence.\n\n### Tracking Completion\n\nIf you have more than one thing going on that you want to track completion\nof, you may find the related [are-we-there-yet] helpful. It's `change`\nevent can be wired up to the `show` method to get a more traditional\nprogress bar interface.\n\n[are-we-there-yet]: https://www.npmjs.com/package/are-we-there-yet\n",
+ "readmeFilename": "README.md",
"_id": "gauge@1.2.2",
"_shasum": "05b6730a19a8fcad3c340a142f0945222a3f815b",
- "_from": "gauge@>=1.2.0 <1.3.0",
- "_npmVersion": "3.1.0",
- "_nodeVersion": "0.10.38",
- "_npmUser": {
- "name": "iarna",
- "email": "me@re-becca.org"
- },
- "dist": {
- "shasum": "05b6730a19a8fcad3c340a142f0945222a3f815b",
- "tarball": "http://registry.npmjs.org/gauge/-/gauge-1.2.2.tgz"
- },
- "maintainers": [
- {
- "name": "iarna",
- "email": "me@re-becca.org"
- }
- ],
- "directories": {},
"_resolved": "https://registry.npmjs.org/gauge/-/gauge-1.2.2.tgz",
- "readme": "ERROR: No README data found!"
+ "_from": "gauge@>=1.2.0 <1.3.0"
}
diff --git a/deps/npm/node_modules/node-gyp/node_modules/npmlog/package.json b/deps/npm/node_modules/node-gyp/node_modules/npmlog/package.json
index cd7131f404419f..3637903fd7788a 100644
--- a/deps/npm/node_modules/node-gyp/node_modules/npmlog/package.json
+++ b/deps/npm/node_modules/node-gyp/node_modules/npmlog/package.json
@@ -24,34 +24,14 @@
"tap": ""
},
"license": "ISC",
- "gitHead": "4e1a73a567036064ded425a7d48c863d53550b4f",
+ "readme": "# npmlog\n\nThe logger util that npm uses.\n\nThis logger is very basic. It does the logging for npm. It supports\ncustom levels and colored output.\n\nBy default, logs are written to stderr. If you want to send log messages\nto outputs other than streams, then you can change the `log.stream`\nmember, or you can just listen to the events that it emits, and do\nwhatever you want with them.\n\n# Basic Usage\n\n```\nvar log = require('npmlog')\n\n// additional stuff ---------------------------+\n// message ----------+ |\n// prefix ----+ | |\n// level -+ | | |\n// v v v v\n log.info('fyi', 'I have a kitty cat: %j', myKittyCat)\n```\n\n## log.level\n\n* {String}\n\nThe level to display logs at. Any logs at or above this level will be\ndisplayed. The special level `silent` will prevent anything from being\ndisplayed ever.\n\n## log.record\n\n* {Array}\n\nAn array of all the log messages that have been entered.\n\n## log.maxRecordSize\n\n* {Number}\n\nThe maximum number of records to keep. If log.record gets bigger than\n10% over this value, then it is sliced down to 90% of this value.\n\nThe reason for the 10% window is so that it doesn't have to resize a\nlarge array on every log entry.\n\n## log.prefixStyle\n\n* {Object}\n\nA style object that specifies how prefixes are styled. (See below)\n\n## log.headingStyle\n\n* {Object}\n\nA style object that specifies how the heading is styled. (See below)\n\n## log.heading\n\n* {String} Default: \"\"\n\nIf set, a heading that is printed at the start of every line.\n\n## log.stream\n\n* {Stream} Default: `process.stderr`\n\nThe stream where output is written.\n\n## log.enableColor()\n\nForce colors to be used on all messages, regardless of the output\nstream.\n\n## log.disableColor()\n\nDisable colors on all messages.\n\n## log.enableProgress()\n\nEnable the display of log activity spinner and progress bar\n\n## log.disableProgress()\n\nDisable the display of a progress bar\n\n## log.enableUnicode()\n\nForce the unicode theme to be used for the progress bar.\n\n## log.disableUnicode()\n\nDisable the use of unicode in the progress bar.\n\n## log.setGaugeTemplate(template)\n\nOverrides the default gauge template.\n\n## log.pause()\n\nStop emitting messages to the stream, but do not drop them.\n\n## log.resume()\n\nEmit all buffered messages that were written while paused.\n\n## log.log(level, prefix, message, ...)\n\n* `level` {String} The level to emit the message at\n* `prefix` {String} A string prefix. Set to \"\" to skip.\n* `message...` Arguments to `util.format`\n\nEmit a log message at the specified level.\n\n## log\\[level](prefix, message, ...)\n\nFor example,\n\n* log.silly(prefix, message, ...)\n* log.verbose(prefix, message, ...)\n* log.info(prefix, message, ...)\n* log.http(prefix, message, ...)\n* log.warn(prefix, message, ...)\n* log.error(prefix, message, ...)\n\nLike `log.log(level, prefix, message, ...)`. In this way, each level is\ngiven a shorthand, so you can do `log.info(prefix, message)`.\n\n## log.addLevel(level, n, style, disp)\n\n* `level` {String} Level indicator\n* `n` {Number} The numeric level\n* `style` {Object} Object with fg, bg, inverse, etc.\n* `disp` {String} Optional replacement for `level` in the output.\n\nSets up a new level with a shorthand function and so forth.\n\nNote that if the number is `Infinity`, then setting the level to that\nwill cause all log messages to be suppressed. If the number is\n`-Infinity`, then the only way to show it is to enable all log messages.\n\n## log.newItem(name, todo, weight)\n\n* `name` {String} Optional; progress item name.\n* `todo` {Number} Optional; total amount of work to be done. Default 0.\n* `weight` {Number} Optional; the weight of this item relative to others. Default 1.\n\nThis adds a new `are-we-there-yet` item tracker to the progress tracker. The\nobject returned has the `log[level]` methods but is otherwise an\n`are-we-there-yet` `Tracker` object.\n\n## log.newStream(name, todo, weight)\n\nThis adds a new `are-we-there-yet` stream tracker to the progress tracker. The\nobject returned has the `log[level]` methods but is otherwise an\n`are-we-there-yet` `TrackerStream` object.\n\n## log.newGroup(name, weight)\n\nThis adds a new `are-we-there-yet` tracker group to the progress tracker. The\nobject returned has the `log[level]` methods but is otherwise an\n`are-we-there-yet` `TrackerGroup` object.\n\n# Events\n\nEvents are all emitted with the message object.\n\n* `log` Emitted for all messages\n* `log.` Emitted for all messages with the `` level.\n* `` Messages with prefixes also emit their prefix as an event.\n\n# Style Objects\n\nStyle objects can have the following fields:\n\n* `fg` {String} Color for the foreground text\n* `bg` {String} Color for the background\n* `bold`, `inverse`, `underline` {Boolean} Set the associated property\n* `bell` {Boolean} Make a noise (This is pretty annoying, probably.)\n\n# Message Objects\n\nEvery log event is emitted with a message object, and the `log.record`\nlist contains all of them that have been created. They have the\nfollowing fields:\n\n* `id` {Number}\n* `level` {String}\n* `prefix` {String}\n* `message` {String} Result of `util.format()`\n* `messageRaw` {Array} Arguments to `util.format()`\n",
+ "readmeFilename": "README.md",
"bugs": {
"url": "https://github.com/isaacs/npmlog/issues"
},
"homepage": "https://github.com/isaacs/npmlog#readme",
"_id": "npmlog@1.2.1",
"_shasum": "28e7be619609b53f7ad1dd300a10d64d716268b6",
- "_from": "npmlog@>=0.0.0 <1.0.0||>=1.0.0 <2.0.0",
- "_npmVersion": "2.10.0",
- "_nodeVersion": "2.0.1",
- "_npmUser": {
- "name": "isaacs",
- "email": "isaacs@npmjs.com"
- },
- "dist": {
- "shasum": "28e7be619609b53f7ad1dd300a10d64d716268b6",
- "tarball": "http://registry.npmjs.org/npmlog/-/npmlog-1.2.1.tgz"
- },
- "maintainers": [
- {
- "name": "isaacs",
- "email": "i@izs.me"
- },
- {
- "name": "iarna",
- "email": "me@re-becca.org"
- }
- ],
- "directories": {},
- "_resolved": "https://registry.npmjs.org/npmlog/-/npmlog-1.2.1.tgz"
+ "_resolved": "https://registry.npmjs.org/npmlog/-/npmlog-1.2.1.tgz",
+ "_from": "npmlog@>=0.0.0 <1.0.0||>=1.0.0 <2.0.0"
}
diff --git a/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/debug/node_modules/ms/package.json b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/debug/node_modules/ms/package.json
index 253335e6234907..7b5d86dbbda5e9 100644
--- a/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/debug/node_modules/ms/package.json
+++ b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/debug/node_modules/ms/package.json
@@ -17,32 +17,14 @@
"ms/index.js": "index.js"
}
},
- "gitHead": "713dcf26d9e6fd9dbc95affe7eff9783b7f1b909",
+ "readme": "# ms.js: miliseconds conversion utility\n\n```js\nms('2 days') // 172800000\nms('1d') // 86400000\nms('10h') // 36000000\nms('2.5 hrs') // 9000000\nms('2h') // 7200000\nms('1m') // 60000\nms('5s') // 5000\nms('100') // 100\n```\n\n```js\nms(60000) // \"1m\"\nms(2 * 60000) // \"2m\"\nms(ms('10 hours')) // \"10h\"\n```\n\n```js\nms(60000, { long: true }) // \"1 minute\"\nms(2 * 60000, { long: true }) // \"2 minutes\"\nms(ms('10 hours'), { long: true }) // \"10 hours\"\n```\n\n- Node/Browser compatible. Published as [`ms`](https://www.npmjs.org/package/ms) in [NPM](http://nodejs.org/download).\n- If a number is supplied to `ms`, a string with a unit is returned.\n- If a string that contains the number is supplied, it returns it as\na number (e.g: it returns `100` for `'100'`).\n- If you pass a string with a number and a valid unit, the number of\nequivalent ms is returned.\n\n## License\n\nMIT\n",
+ "readmeFilename": "README.md",
"bugs": {
"url": "https://github.com/guille/ms.js/issues"
},
- "homepage": "https://github.com/guille/ms.js",
+ "homepage": "https://github.com/guille/ms.js#readme",
"_id": "ms@0.7.1",
- "scripts": {},
"_shasum": "9cd13c03adbff25b65effde7ce864ee952017098",
- "_from": "ms@0.7.1",
- "_npmVersion": "2.7.5",
- "_nodeVersion": "0.12.2",
- "_npmUser": {
- "name": "rauchg",
- "email": "rauchg@gmail.com"
- },
- "maintainers": [
- {
- "name": "rauchg",
- "email": "rauchg@gmail.com"
- }
- ],
- "dist": {
- "shasum": "9cd13c03adbff25b65effde7ce864ee952017098",
- "tarball": "http://registry.npmjs.org/ms/-/ms-0.7.1.tgz"
- },
- "directories": {},
"_resolved": "https://registry.npmjs.org/ms/-/ms-0.7.1.tgz",
- "readme": "ERROR: No README data found!"
+ "_from": "ms@0.7.1"
}
diff --git a/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/debug/package.json b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/debug/package.json
index 7e6d9fc59a1755..ebe311fad9ab3a 100644
--- a/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/debug/package.json
+++ b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/debug/package.json
@@ -38,36 +38,14 @@
"debug/debug.js": "debug.js"
}
},
- "gitHead": "b38458422b5aa8aa6d286b10dfe427e8a67e2b35",
+ "readme": "# debug\n\n tiny node.js debugging utility modelled after node core's debugging technique.\n\n## Installation\n\n```bash\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#### Windows note\n\n On Windows the environment variable is set using the `set` command.\n\n ```cmd\n set DEBUG=*,-not_this\n ```\n\nThen, run the program to be debugged as usual.\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`. Consider the situation shown below where you have `worker:a` and `worker:b`, and wish to debug both. Somewhere in the code on your page, include:\n\n```js\nwindow.myDebug = require(\"debug\");\n```\n\n (\"debug\" is a global object in the browser so we give this object a different name.) When your page is open in the browser, type the following in the console:\n\n```js\nmyDebug.enable(\"worker:*\")\n```\n\n Refresh the page. Debug output will continue to be sent to the console until it is disabled by typing `myDebug.disable()` in the console.\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 b('doing some work');\n}, 1200);\n```\n\n#### Web Inspector Colors\n\n Colors are also enabled on \"Web Inspectors\" that understand the `%c` formatting\n option. These are WebKit web inspectors, Firefox ([since version\n 31](https://hacks.mozilla.org/2014/05/editable-box-model-multiple-selection-sublime-text-keys-much-more-firefox-developer-tools-episode-31/))\n and the Firebug plugin for Firefox (any version).\n\n Colored output looks something like:\n\n ![](https://cloud.githubusercontent.com/assets/71256/3139768/b98c5fd8-e8ef-11e3-862a-f7253b6f47c6.png)\n\n### stderr vs stdout\n\nYou can set an alternative logging method per-namespace by overriding the `log` method on a per-namespace or globally:\n\nExample _stdout.js_:\n\n```js\nvar debug = require('debug');\nvar error = debug('app:error');\n\n// by default stderr is used\nerror('goes to stderr!');\n\nvar log = debug('app:log');\n// set this namespace to log via console.log\nlog.log = console.log.bind(console); // don't forget to bind to console!\nlog('goes to stdout');\nerror('still goes to stderr!');\n\n// set all output to go via console.info\n// overrides all per-namespace log settings\ndebug.log = console.info.bind(console);\nerror('now goes to stdout via console.info');\nlog('still goes to stdout, but via console.info now');\n```\n\n### Save debug output to a file\n\nYou can save all debug statements to a file by piping them.\n\nExample:\n\n```bash\n$ DEBUG_FD=3 node your-app.js 3> whatever.log\n```\n\n## Authors\n\n - TJ Holowaychuk\n - Nathan Rajlich\n\n## License\n\n(The MIT License)\n\nCopyright (c) 2014 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/debug/issues"
},
- "homepage": "https://github.com/visionmedia/debug",
+ "homepage": "https://github.com/visionmedia/debug#readme",
"_id": "debug@2.2.0",
- "scripts": {},
"_shasum": "f87057e995b1a1f6ae6a4960664137bc56f039da",
- "_from": "debug@*",
- "_npmVersion": "2.7.4",
- "_nodeVersion": "0.12.2",
- "_npmUser": {
- "name": "tootallnate",
- "email": "nathan@tootallnate.net"
- },
- "maintainers": [
- {
- "name": "tjholowaychuk",
- "email": "tj@vision-media.ca"
- },
- {
- "name": "tootallnate",
- "email": "nathan@tootallnate.net"
- }
- ],
- "dist": {
- "shasum": "f87057e995b1a1f6ae6a4960664137bc56f039da",
- "tarball": "http://registry.npmjs.org/debug/-/debug-2.2.0.tgz"
- },
- "directories": {},
"_resolved": "https://registry.npmjs.org/debug/-/debug-2.2.0.tgz",
- "readme": "ERROR: No README data found!"
+ "_from": "debug@*"
}
diff --git a/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/package.json b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/package.json
index 8ed83ab2436443..f795cc352da0fd 100644
--- a/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/package.json
+++ b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/package.json
@@ -28,30 +28,14 @@
"engines": {
"node": "*"
},
- "gitHead": "65a5d884f25b4b7a1608e367d715d713dbd3b3d6",
+ "readme": "array-index\n===========\n### Invoke getter/setter functions on array-like objects\n[![Build Status](https://secure.travis-ci.org/TooTallNate/array-index.svg)](http://travis-ci.org/TooTallNate/array-index)\n\n\nThis little module provides an `ArrayIndex` constructor function that you can\ninherit from with your own objects. When a numbered property gets read, then the\n`__get__` function on the object will be invoked. When a numbered property gets\nset, then the `__set__` function on the object will be invoked.\n\n\nInstallation\n------------\n\nInstall with `npm`:\n\n``` bash\n$ npm install array-index\n```\n\n\nExamples\n--------\n\nA quick silly example, using `Math.sqrt()` for the \"getter\":\n\n``` js\nvar ArrayIndex = require('array-index')\n\n// let's just create a singleton instance.\nvar a = new ArrayIndex()\n\n// the \"__get__\" function is invoked for each \"a[n]\" access.\n// it is given a single argument, the \"index\" currently being accessed.\n// so here, we're passing in the `Math.sqrt()` function, so accessing\n// \"a[9]\" will return `Math.sqrt(9)`.\na.__get__ = Math.sqrt\n\n// the \"__get__\" and \"__set__\" functions are only invoked up\n// to \"a.length\", so we must set that manually.\na.length = 10\n\nconsole.log(a)\n// [ 0,\n// 1,\n// 1.4142135623730951,\n// 1.7320508075688772,\n// 2,\n// 2.23606797749979,\n// 2.449489742783178,\n// 2.6457513110645907,\n// 2.8284271247461903,\n// 3,\n// __get__: [Function: sqrt] ]\n```\n\nHere's an example of creating a subclass of `ArrayIndex` using `util.inherits()`:\n\n``` js\nvar ArrayIndex = require('array-index')\nvar inherits = require('util').inherits\n\nfunction MyArray (length) {\n // be sure to call the ArrayIndex constructor in your own constructor\n ArrayIndex.call(this, length)\n\n // the \"set\" object will contain values at indexes previously set,\n // so that they can be returned in the \"getter\" function. This is just a\n // silly example, your subclass will have more meaningful logic.\n Object.defineProperty(this, 'set', {\n value: Object.create(null),\n enumerable: false\n })\n}\n\n// inherit from the ArrayIndex's prototype\ninherits(MyArray, ArrayIndex)\n\nMyArray.prototype.__get__ = function (index) {\n if (index in this.set) return this.set[index]\n return index * 2\n}\n\nMyArray.prototype.__set__ = function (index, v) {\n this.set[index] = v\n}\n\n\n// and now you can create some instances\nvar a = new MyArray(15)\na[9] = a[10] = a[14] = '_'\na[0] = 'nate'\n\nconsole.log(a)\n// [ 'nate', 2, 4, 6, 8, 10, 12, 14, 16, '_', '_', 22, 24, 26, '_' ]\n```\n\nAPI\n---\n\nThe `ArrayIndex` base class is meant to be subclassed, but it also has a few\nconvenient functions built-in.\n\n### \"length\" -> Number\n\nThe length of the ArrayIndex instance. The `__get__` and `__set__` functions will\nonly be invoked on the object up to this \"length\". You may set this length at any\ntime to adjust the amount range where the getters/setters will be invoked.\n\n### \"toArray()\" -> Array\n\nReturns a new regular Array instance with the same values that this ArrayIndex\nclass would have. This function calls the `__get__` function repeatedly from\n`0...length-1` and returns the \"flattened\" array instance.\n\n### \"toJSON()\" -> Array\n\nAll `ArrayIndex` instances get basic support for `JSON.stringify()`, which is\nthe same as a \"flattened\" Array being stringified.\n\n### \"toString()\" -> String\n\nThe `toString()` override is basically just `array.toArray().toString()`.\n\n### \"format()\" -> String\n\nThe `inspect()` implementation for the REPL attempts to mimic what a regular\nArray looks like in the REPL.\n\n\nLicense\n-------\n\n(The MIT License)\n\nCopyright (c) 2012 Nathan Rajlich <nathan@tootallnate.net>\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/TooTallNate/array-index/issues"
},
- "homepage": "https://github.com/TooTallNate/array-index",
+ "homepage": "https://github.com/TooTallNate/array-index#readme",
"_id": "array-index@0.1.1",
"_shasum": "4d5eaf06cc3d925847cd73d1535c217ba306d3e1",
- "_from": "array-index@>=0.1.0 <0.2.0",
- "_npmVersion": "2.1.3",
- "_nodeVersion": "0.10.32",
- "_npmUser": {
- "name": "tootallnate",
- "email": "nathan@tootallnate.net"
- },
- "maintainers": [
- {
- "name": "tootallnate",
- "email": "nathan@tootallnate.net"
- }
- ],
- "dist": {
- "shasum": "4d5eaf06cc3d925847cd73d1535c217ba306d3e1",
- "tarball": "http://registry.npmjs.org/array-index/-/array-index-0.1.1.tgz"
- },
- "directories": {},
- "_resolved": "https://registry.npmjs.org/array-index/-/array-index-0.1.1.tgz"
+ "_resolved": "https://registry.npmjs.org/array-index/-/array-index-0.1.1.tgz",
+ "_from": "array-index@>=0.1.0 <0.2.0"
}
diff --git a/deps/npm/node_modules/node-gyp/node_modules/path-array/package.json b/deps/npm/node_modules/node-gyp/node_modules/path-array/package.json
index ad8edc9f83eedd..f61cec87c3c0cc 100644
--- a/deps/npm/node_modules/node-gyp/node_modules/path-array/package.json
+++ b/deps/npm/node_modules/node-gyp/node_modules/path-array/package.json
@@ -31,25 +31,10 @@
"devDependencies": {
"mocha": "~1.16.1"
},
- "gitHead": "5d1fedd54e4413459f67e4a4babb024144cd00d0",
+ "readme": "path-array\n==========\n### Treat your `$PATH` like a JavaScript Array\n[![Build Status](https://travis-ci.org/TooTallNate/path-array.svg?branch=master)](https://travis-ci.org/TooTallNate/path-array)\n\nThis module provides a JavaScript `Array` implementation that is backed by your\n`$PATH` env variable. That is, you can use regular Array functions like `shift()`,\n`pop()`, `push()`, `unshift()`, etc. to mutate your `$PATH`.\n\nAlso works for preparing an `env` object for passing to\n[`child_process.spawn()`][cp.spawn].\n\n\nInstallation\n------------\n\nInstall with `npm`:\n\n``` bash\n$ npm install path-array\n```\n\n\nExample\n-------\n\nInteracting with your own `$PATH` env variable:\n\n``` js\nvar PathArray = require('path-array');\n\n// no args uses `process.env` by default\nvar p = new PathArray();\n\nconsole.log(p);\n// [ './node_modules/.bin',\n// '/opt/local/bin',\n// '/opt/local/sbin',\n// '/usr/local/bin',\n// '/usr/local/sbin',\n// '/usr/bin',\n// '/bin',\n// '/usr/sbin',\n// '/sbin',\n// '/usr/local/bin',\n// '/opt/X11/bin' ]\n\n// push another path entry. this function mutates the `process.env.PATH`\np.unshift('/foo');\n\nconsole.log(process.env.PATH);\n// '/foo:./node_modules/.bin:/opt/local/bin:/opt/local/sbin:/usr/local/bin:/usr/local/sbin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/opt/X11/bin'\n```\n\n\nAPI\n---\n\n### new PathArray([env]) → PathArray\n\nCreates and returns a new `PathArray` instance with the given `env` object. If no\n`env` is specified, then [`process.env`][process.env] is used by default.\n\n\nLicense\n-------\n\n(The MIT License)\n\nCopyright (c) 2013 Nathan Rajlich <nathan@tootallnate.net>\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[process.env]: http://nodejs.org/docs/latest/api/process.html#process_process_env\n[cp.spawn]: http://nodejs.org/docs/latest/api/child_process.html#child_process_child_process_spawn_command_args_options\n",
+ "readmeFilename": "README.md",
"_id": "path-array@1.0.0",
"_shasum": "6c14130c33084f0150553c657b38397ab67aaa4e",
- "_from": "path-array@>=1.0.0 <2.0.0",
- "_npmVersion": "1.4.28",
- "_npmUser": {
- "name": "tootallnate",
- "email": "nathan@tootallnate.net"
- },
- "maintainers": [
- {
- "name": "tootallnate",
- "email": "nathan@tootallnate.net"
- }
- ],
- "dist": {
- "shasum": "6c14130c33084f0150553c657b38397ab67aaa4e",
- "tarball": "http://registry.npmjs.org/path-array/-/path-array-1.0.0.tgz"
- },
- "directories": {},
- "_resolved": "https://registry.npmjs.org/path-array/-/path-array-1.0.0.tgz"
+ "_resolved": "https://registry.npmjs.org/path-array/-/path-array-1.0.0.tgz",
+ "_from": "path-array@>=1.0.0 <2.0.0"
}
diff --git a/deps/npm/node_modules/node-gyp/node_modules/tar/.npmignore b/deps/npm/node_modules/node-gyp/node_modules/tar/.npmignore
deleted file mode 100644
index c167ad5b1c12f8..00000000000000
--- a/deps/npm/node_modules/node-gyp/node_modules/tar/.npmignore
+++ /dev/null
@@ -1,5 +0,0 @@
-.*.swp
-node_modules
-examples/extract/
-test/tmp/
-test/fixtures/
diff --git a/deps/npm/node_modules/node-gyp/node_modules/tar/.travis.yml b/deps/npm/node_modules/node-gyp/node_modules/tar/.travis.yml
deleted file mode 100644
index fca8ef019405d5..00000000000000
--- a/deps/npm/node_modules/node-gyp/node_modules/tar/.travis.yml
+++ /dev/null
@@ -1,4 +0,0 @@
-language: node_js
-node_js:
- - 0.10
- - 0.11
diff --git a/deps/npm/node_modules/node-gyp/node_modules/tar/LICENCE b/deps/npm/node_modules/node-gyp/node_modules/tar/LICENCE
deleted file mode 100644
index 74489e2e2658e7..00000000000000
--- a/deps/npm/node_modules/node-gyp/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/deps/npm/node_modules/node-gyp/node_modules/tar/README.md b/deps/npm/node_modules/node-gyp/node_modules/tar/README.md
deleted file mode 100644
index 424a2782bf7b59..00000000000000
--- a/deps/npm/node_modules/node-gyp/node_modules/tar/README.md
+++ /dev/null
@@ -1,48 +0,0 @@
-# node-tar
-
-Tar for Node.js.
-
-[![NPM](https://nodei.co/npm/tar.png)](https://nodei.co/npm/tar/)
-
-## API
-
-See `examples/` for usage examples.
-
-### var tar = require('tar')
-
-Returns an object with `.Pack`, `.Extract` and `.Parse` methods.
-
-### tar.Pack([properties])
-
-Returns a through stream. Use
-[fstream](https://npmjs.org/package/fstream) to write files into the
-pack stream and you will receive tar archive data from the pack
-stream.
-
-This only works with directories, it does not work with individual files.
-
-The optional `properties` object are used to set properties in the tar
-'Global Extended Header'.
-
-### tar.Extract([options])
-
-Returns a through stream. Write tar data to the stream and the files
-in the tarball will be extracted onto the filesystem.
-
-`options` can be:
-
-```js
-{
- path: '/path/to/extract/tar/into',
- strip: 0, // how many path segments to strip from the root when extracting
-}
-```
-
-`options` also get passed to the `fstream.Writer` instance that `tar`
-uses internally.
-
-### tar.Parse()
-
-Returns a writable stream. Write tar data to it and it will emit
-`entry` events for each entry parsed from the tarball. This is used by
-`tar.Extract`.
diff --git a/deps/npm/node_modules/node-gyp/node_modules/tar/examples/extracter.js b/deps/npm/node_modules/node-gyp/node_modules/tar/examples/extracter.js
deleted file mode 100644
index f6253a72c5cd3e..00000000000000
--- a/deps/npm/node_modules/node-gyp/node_modules/tar/examples/extracter.js
+++ /dev/null
@@ -1,19 +0,0 @@
-var tar = require("../tar.js")
- , fs = require("fs")
-
-
-function onError(err) {
- console.error('An error occurred:', err)
-}
-
-function onEnd() {
- console.log('Extracted!')
-}
-
-var extractor = tar.Extract({path: __dirname + "/extract"})
- .on('error', onError)
- .on('end', onEnd);
-
-fs.createReadStream(__dirname + "/../test/fixtures/c.tar")
- .on('error', onError)
- .pipe(extractor);
diff --git a/deps/npm/node_modules/node-gyp/node_modules/tar/examples/packer.js b/deps/npm/node_modules/node-gyp/node_modules/tar/examples/packer.js
deleted file mode 100644
index 039969ce300d12..00000000000000
--- a/deps/npm/node_modules/node-gyp/node_modules/tar/examples/packer.js
+++ /dev/null
@@ -1,24 +0,0 @@
-var tar = require("../tar.js")
- , fstream = require("fstream")
- , fs = require("fs")
-
-var dirDest = fs.createWriteStream('dir.tar')
-
-
-function onError(err) {
- console.error('An error occurred:', err)
-}
-
-function onEnd() {
- console.log('Packed!')
-}
-
-var packer = tar.Pack({ noProprietary: true })
- .on('error', onError)
- .on('end', onEnd);
-
-// This must be a "directory"
-fstream.Reader({ path: __dirname, type: "Directory" })
- .on('error', onError)
- .pipe(packer)
- .pipe(dirDest)
diff --git a/deps/npm/node_modules/node-gyp/node_modules/tar/examples/reader.js b/deps/npm/node_modules/node-gyp/node_modules/tar/examples/reader.js
deleted file mode 100644
index 39f3f0888a2cfd..00000000000000
--- a/deps/npm/node_modules/node-gyp/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/deps/npm/node_modules/node-gyp/node_modules/tar/lib/entry.js b/deps/npm/node_modules/node-gyp/node_modules/tar/lib/entry.js
deleted file mode 100644
index 4af5c410838af8..00000000000000
--- a/deps/npm/node_modules/node-gyp/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/deps/npm/node_modules/node-gyp/node_modules/tar/lib/extended-header-writer.js b/deps/npm/node_modules/node-gyp/node_modules/tar/lib/extended-header-writer.js
deleted file mode 100644
index 1728c4583ae060..00000000000000
--- a/deps/npm/node_modules/node-gyp/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/deps/npm/node_modules/node-gyp/node_modules/tar/lib/extended-header.js b/deps/npm/node_modules/node-gyp/node_modules/tar/lib/extended-header.js
deleted file mode 100644
index 74f432ceee5b24..00000000000000
--- a/deps/npm/node_modules/node-gyp/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/deps/npm/node_modules/node-gyp/node_modules/tar/lib/extract.js b/deps/npm/node_modules/node-gyp/node_modules/tar/lib/extract.js
deleted file mode 100644
index 9fb1e6fb1b502c..00000000000000
--- a/deps/npm/node_modules/node-gyp/node_modules/tar/lib/extract.js
+++ /dev/null
@@ -1,86 +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('error', function(err) {
- me.emit('error', err)
- })
-
- this._fst.on('drain', function() {
- me.emit('drain')
- })
-
- // 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/deps/npm/node_modules/node-gyp/node_modules/tar/lib/global-header-writer.js b/deps/npm/node_modules/node-gyp/node_modules/tar/lib/global-header-writer.js
deleted file mode 100644
index 0bfc7b80aa7c67..00000000000000
--- a/deps/npm/node_modules/node-gyp/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/deps/npm/node_modules/node-gyp/node_modules/tar/lib/header.js b/deps/npm/node_modules/node-gyp/node_modules/tar/lib/header.js
deleted file mode 100644
index 05b237c0c7b32a..00000000000000
--- a/deps/npm/node_modules/node-gyp/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/deps/npm/node_modules/node-gyp/node_modules/tar/lib/pack.js b/deps/npm/node_modules/node-gyp/node_modules/tar/lib/pack.js
deleted file mode 100644
index 3ff14dd695100e..00000000000000
--- a/deps/npm/node_modules/node-gyp/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/deps/npm/node_modules/node-gyp/node_modules/tar/lib/parse.js b/deps/npm/node_modules/node-gyp/node_modules/tar/lib/parse.js
deleted file mode 100644
index 8517c481bc6ef4..00000000000000
--- a/deps/npm/node_modules/node-gyp/node_modules/tar/lib/parse.js
+++ /dev/null
@@ -1,271 +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._ended = false
-
- 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) {
- if (this._eofStarted)
- this._ended = true
- this._eofStarted = true
- } else {
- 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
- return 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/deps/npm/node_modules/node-gyp/node_modules/tar/package.json b/deps/npm/node_modules/node-gyp/node_modules/tar/package.json
deleted file mode 100644
index 5aa78aec301062..00000000000000
--- a/deps/npm/node_modules/node-gyp/node_modules/tar/package.json
+++ /dev/null
@@ -1,60 +0,0 @@
-{
- "author": {
- "name": "Isaac Z. Schlueter",
- "email": "i@izs.me",
- "url": "http://blog.izs.me/"
- },
- "name": "tar",
- "description": "tar for node",
- "version": "1.0.3",
- "repository": {
- "type": "git",
- "url": "git://github.com/isaacs/node-tar.git"
- },
- "main": "tar.js",
- "scripts": {
- "test": "tap test/*.js"
- },
- "dependencies": {
- "block-stream": "*",
- "fstream": "^1.0.2",
- "inherits": "2"
- },
- "devDependencies": {
- "graceful-fs": "^3.0.2",
- "rimraf": "1.x",
- "tap": "0.x",
- "mkdirp": "^0.5.0"
- },
- "license": "BSD",
- "gitHead": "f4151128c585da236c6b1e278b762ecaedc20c15",
- "bugs": {
- "url": "https://github.com/isaacs/node-tar/issues"
- },
- "homepage": "https://github.com/isaacs/node-tar",
- "_id": "tar@1.0.3",
- "_shasum": "15bcdab244fa4add44e4244a0176edb8aa9a2b44",
- "_from": "tar@>=1.0.0 <2.0.0",
- "_npmVersion": "2.1.10",
- "_nodeVersion": "0.10.33",
- "_npmUser": {
- "name": "othiym23",
- "email": "ogd@aoaioxxysz.net"
- },
- "maintainers": [
- {
- "name": "isaacs",
- "email": "i@izs.me"
- },
- {
- "name": "othiym23",
- "email": "ogd@aoaioxxysz.net"
- }
- ],
- "dist": {
- "shasum": "15bcdab244fa4add44e4244a0176edb8aa9a2b44",
- "tarball": "http://registry.npmjs.org/tar/-/tar-1.0.3.tgz"
- },
- "directories": {},
- "_resolved": "https://registry.npmjs.org/tar/-/tar-1.0.3.tgz"
-}
diff --git a/deps/npm/node_modules/node-gyp/node_modules/tar/tar.js b/deps/npm/node_modules/node-gyp/node_modules/tar/tar.js
deleted file mode 100644
index a81298b9a0b126..00000000000000
--- a/deps/npm/node_modules/node-gyp/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/deps/npm/node_modules/node-gyp/node_modules/tar/test/00-setup-fixtures.js b/deps/npm/node_modules/node-gyp/node_modules/tar/test/00-setup-fixtures.js
deleted file mode 100644
index 1524ff7af05700..00000000000000
--- a/deps/npm/node_modules/node-gyp/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/deps/npm/node_modules/node-gyp/node_modules/tar/test/extract-move.js b/deps/npm/node_modules/node-gyp/node_modules/tar/test/extract-move.js
deleted file mode 100644
index 45400cd9bb818d..00000000000000
--- a/deps/npm/node_modules/node-gyp/node_modules/tar/test/extract-move.js
+++ /dev/null
@@ -1,132 +0,0 @@
-// Set the umask, so that it works the same everywhere.
-process.umask(parseInt('22', 8))
-
-var tap = require("tap")
- , tar = require("../tar.js")
- , fs = require("fs")
- , gfs = require("graceful-fs")
- , path = require("path")
- , file = path.resolve(__dirname, "fixtures/dir.tar")
- , target = path.resolve(__dirname, "tmp/extract-test")
- , index = 0
- , fstream = require("fstream")
- , rimraf = require("rimraf")
- , mkdirp = require("mkdirp")
-
- , ee = 0
- , expectEntries = [
- {
- "path" : "dir/",
- "mode" : "750",
- "type" : "5",
- "depth" : undefined,
- "size" : 0,
- "linkpath" : "",
- "nlink" : undefined,
- "dev" : undefined,
- "ino" : undefined
- },
- {
- "path" : "dir/sub/",
- "mode" : "750",
- "type" : "5",
- "depth" : undefined,
- "size" : 0,
- "linkpath" : "",
- "nlink" : undefined,
- "dev" : undefined,
- "ino" : undefined
- } ]
-
-function slow (fs, method, t1, t2) {
- var orig = fs[method]
- if (!orig) return null
- fs[method] = function () {
- var args = [].slice.call(arguments)
- console.error("slow", method, args[0])
- var cb = args.pop()
-
- setTimeout(function () {
- orig.apply(fs, args.concat(function(er, data) {
- setTimeout(function() {
- cb(er, data)
- }, t2)
- }))
- }, t1)
- }
-}
-
-// Make sure we get the graceful-fs that fstream is using.
-var gfs2
-try {
- gfs2 = require("fstream/node_modules/graceful-fs")
-} catch (er) {}
-
-var slowMethods = ["chown", "chmod", "utimes", "lutimes"]
-slowMethods.forEach(function (method) {
- var t1 = 500
- var t2 = 0
- slow(fs, method, t1, t2)
- slow(gfs, method, t1, t2)
- if (gfs2) {
- slow(gfs2, method, t1, t2)
- }
-})
-
-
-
-// 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("preclean", function (t) {
- rimraf.sync(target)
- /mkdirp.sync(target)
- t.pass("cleaned!")
- t.end()
-})
-
-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 () {
- rimraf.sync(target)
-
- 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!")
- })
-
- t.end()
- })
-
-
- 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)
- })
-})
diff --git a/deps/npm/node_modules/node-gyp/node_modules/tar/test/extract.js b/deps/npm/node_modules/node-gyp/node_modules/tar/test/extract.js
deleted file mode 100644
index eca4e7cc962db6..00000000000000
--- a/deps/npm/node_modules/node-gyp/node_modules/tar/test/extract.js
+++ /dev/null
@@ -1,367 +0,0 @@
-// Set the umask, so that it works the same everywhere.
-process.umask(parseInt('22', 8))
-
-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: '/200LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLL',
- mode: '120777',
- type: 'SymbolicLink',
- depth: 1,
- size: 200,
- linkpath: '200ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc',
- nlink: 1 },
- { path: '/200ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc',
- mode: '100644',
- type: 'Link',
- depth: 1,
- size: 200,
- linkpath: path.join(target, '200-hard'),
- nlink: 2 },
- { 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("preclean", function (t) {
- require("rimraf").sync(__dirname + "/tmp/extract-test")
- t.pass("cleaned!")
- t.end()
-})
-
-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/deps/npm/node_modules/node-gyp/node_modules/tar/test/fixtures.tgz b/deps/npm/node_modules/node-gyp/node_modules/tar/test/fixtures.tgz
deleted file mode 100644
index f1676023afa2bb..00000000000000
Binary files a/deps/npm/node_modules/node-gyp/node_modules/tar/test/fixtures.tgz and /dev/null differ
diff --git a/deps/npm/node_modules/node-gyp/node_modules/tar/test/header.js b/deps/npm/node_modules/node-gyp/node_modules/tar/test/header.js
deleted file mode 100644
index 8ea6f79500de73..00000000000000
--- a/deps/npm/node_modules/node-gyp/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/deps/npm/node_modules/node-gyp/node_modules/tar/test/pack-no-proprietary.js b/deps/npm/node_modules/node-gyp/node_modules/tar/test/pack-no-proprietary.js
deleted file mode 100644
index d4b03a1fe936be..00000000000000
--- a/deps/npm/node_modules/node-gyp/node_modules/tar/test/pack-no-proprietary.js
+++ /dev/null
@@ -1,886 +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/dir/',
- mode: 488,
- uid: uid,
- gid: gid,
- size: 0,
- type: '5',
- linkpath: '',
- ustar: 'ustar\u0000',
- ustarver: '00',
- uname: '',
- gname: '',
- devmaj: 0,
- devmin: 0,
- fill: '' } ]
-
- , [ 'entry',
- { path: 'fixtures/dir/sub/',
- mode: 488,
- uid: uid,
- gid: gid,
- size: 0,
- type: '5',
- 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", 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/deps/npm/node_modules/node-gyp/node_modules/tar/test/pack.js b/deps/npm/node_modules/node-gyp/node_modules/tar/test/pack.js
deleted file mode 100644
index bf033c12987862..00000000000000
--- a/deps/npm/node_modules/node-gyp/node_modules/tar/test/pack.js
+++ /dev/null
@@ -1,934 +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/dir/',
- mode: 488,
- uid: uid,
- gid: gid,
- size: 0,
- type: '5',
- linkpath: '',
- ustar: 'ustar\u0000',
- ustarver: '00',
- uname: '',
- gname: '',
- devmaj: 0,
- devmin: 0,
- fill: '' } ]
-
- , [ 'entry',
- { path: 'fixtures/dir/sub/',
- mode: 488,
- uid: uid,
- gid: gid,
- size: 0,
- type: '5',
- 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", 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/deps/npm/node_modules/node-gyp/node_modules/tar/test/parse.js b/deps/npm/node_modules/node-gyp/node_modules/tar/test/parse.js
deleted file mode 100644
index f765a50129bff1..00000000000000
--- a/deps/npm/node_modules/node-gyp/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/deps/npm/node_modules/node-gyp/node_modules/tar/test/zz-cleanup.js b/deps/npm/node_modules/node-gyp/node_modules/tar/test/zz-cleanup.js
deleted file mode 100644
index a00ff7faa03906..00000000000000
--- a/deps/npm/node_modules/node-gyp/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/deps/npm/node_modules/node-gyp/package.json b/deps/npm/node_modules/node-gyp/package.json
index 0fd880784566e7..b95bd06160f7df 100644
--- a/deps/npm/node_modules/node-gyp/package.json
+++ b/deps/npm/node_modules/node-gyp/package.json
@@ -11,7 +11,7 @@
"bindings",
"gyp"
],
- "version": "3.0.3",
+ "version": "3.2.1",
"installVersion": 9,
"author": {
"name": "Nathan Rajlich",
@@ -40,7 +40,7 @@
"request": "2",
"rimraf": "2",
"semver": "2.x || 3.x || 4 || 5",
- "tar": "^1.0.0",
+ "tar": "^2.0.0",
"which": "1"
},
"engines": {
@@ -52,32 +52,36 @@
"scripts": {
"test": "tape test/test-*"
},
- "gitHead": "d6b03851d366c7fa78e7d2f57c61bb074ea45ea3",
+ "gitHead": "89692c9187e10df944b0bf587ed44381b004a08c",
"bugs": {
"url": "https://github.com/nodejs/node-gyp/issues"
},
- "homepage": "https://github.com/nodejs/node-gyp",
- "_id": "node-gyp@3.0.3",
- "_shasum": "9b004219f4fa9efbfd78c5fc674aa12e58fb8694",
- "_from": "node-gyp@3.0.3",
- "_npmVersion": "2.14.2",
- "_nodeVersion": "4.0.0",
+ "homepage": "https://github.com/nodejs/node-gyp#readme",
+ "_id": "node-gyp@3.2.1",
+ "_shasum": "f5dd569970a508464cc3c15d7e9e8d2de8638dd5",
+ "_from": "node-gyp@>=3.2.1 <3.3.0",
+ "_npmVersion": "3.3.12",
+ "_nodeVersion": "6.0.0-pre",
"_npmUser": {
- "name": "rvagg",
- "email": "rod@vagg.org"
+ "name": "bnoordhuis",
+ "email": "info@bnoordhuis.nl"
},
"maintainers": [
{
"name": "TooTallNate",
"email": "nathan@tootallnate.net"
},
+ {
+ "name": "bnoordhuis",
+ "email": "info@bnoordhuis.nl"
+ },
{
"name": "fishrock123",
"email": "fishrock123@rocketmail.com"
},
{
"name": "isaacs",
- "email": "isaacs@npmjs.com"
+ "email": "i@izs.me"
},
{
"name": "rvagg",
@@ -89,9 +93,10 @@
}
],
"dist": {
- "shasum": "9b004219f4fa9efbfd78c5fc674aa12e58fb8694",
- "tarball": "http://registry.npmjs.org/node-gyp/-/node-gyp-3.0.3.tgz"
+ "shasum": "f5dd569970a508464cc3c15d7e9e8d2de8638dd5",
+ "tarball": "http://registry.npmjs.org/node-gyp/-/node-gyp-3.2.1.tgz"
},
"directories": {},
- "_resolved": "https://registry.npmjs.org/node-gyp/-/node-gyp-3.0.3.tgz"
+ "_resolved": "https://registry.npmjs.org/node-gyp/-/node-gyp-3.2.1.tgz",
+ "readme": "ERROR: No README data found!"
}
diff --git a/deps/npm/node_modules/node-gyp/src/win_delay_load_hook.c b/deps/npm/node_modules/node-gyp/src/win_delay_load_hook.c
index f397cfa195e448..b1e170aa13bd95 100644
--- a/deps/npm/node_modules/node-gyp/src/win_delay_load_hook.c
+++ b/deps/npm/node_modules/node-gyp/src/win_delay_load_hook.c
@@ -9,7 +9,10 @@
#ifdef _MSC_VER
+#ifndef WIN32_LEAN_AND_MEAN
#define WIN32_LEAN_AND_MEAN
+#endif
+
#include
#include
diff --git a/deps/npm/node_modules/node-gyp/test/test-find-node-directory.js b/deps/npm/node_modules/node-gyp/test/test-find-node-directory.js
new file mode 100644
index 00000000000000..46659d0cfe8fa2
--- /dev/null
+++ b/deps/npm/node_modules/node-gyp/test/test-find-node-directory.js
@@ -0,0 +1,115 @@
+var test = require('tape')
+var path = require('path')
+var findNodeDirectory = require('../lib/find-node-directory')
+
+var platforms = ['darwin', 'freebsd', 'linux', 'sunos', 'win32', 'aix']
+
+// we should find the directory based on the directory
+// the script is running in and it should match the layout
+// in a build tree where npm is installed in
+// .... /deps/npm
+test('test find-node-directory - node install', function (t) {
+ t.plan(platforms.length)
+ for (var next = 0; next < platforms.length; next++) {
+ var processObj = {execPath: '/x/y/bin/node', platform: platforms[next]}
+ t.equal(
+ findNodeDirectory('/x/deps/npm/node_modules/node-gyp/lib', processObj),
+ path.join('/x'))
+ }
+})
+
+// we should find the directory based on the directory
+// the script is running in and it should match the layout
+// in an installed tree where npm is installed in
+// .... /lib/node_modules/npm or .../node_modules/npm
+// depending on the patform
+test('test find-node-directory - node build', function (t) {
+ t.plan(platforms.length)
+ for (var next = 0; next < platforms.length; next++) {
+ var processObj = {execPath: '/x/y/bin/node', platform: platforms[next]}
+ if (platforms[next] === 'win32') {
+ t.equal(
+ findNodeDirectory('/y/node_modules/npm/node_modules/node-gyp/lib',
+ processObj), path.join('/y'))
+ } else {
+ t.equal(
+ findNodeDirectory('/y/lib/node_modules/npm/node_modules/node-gyp/lib',
+ processObj), path.join('/y'))
+ }
+ }
+})
+
+// we should find the directory based on the execPath
+// for node and match because it was in the bin directory
+test('test find-node-directory - node in bin directory', function (t) {
+ t.plan(platforms.length)
+ for (var next = 0; next < platforms.length; next++) {
+ var processObj = {execPath: '/x/y/bin/node', platform: platforms[next]}
+ t.equal(
+ findNodeDirectory('/nothere/npm/node_modules/node-gyp/lib', processObj),
+ path.join('/x/y'))
+ }
+})
+
+// we should find the directory based on the execPath
+// for node and match because it was in the Release directory
+test('test find-node-directory - node in build release dir', function (t) {
+ t.plan(platforms.length)
+ for (var next = 0; next < platforms.length; next++) {
+ var processObj
+ if (platforms[next] === 'win32') {
+ processObj = {execPath: '/x/y/Release/node', platform: platforms[next]}
+ } else {
+ processObj = {execPath: '/x/y/out/Release/node',
+ platform: platforms[next]}
+ }
+
+ t.equal(
+ findNodeDirectory('/nothere/npm/node_modules/node-gyp/lib', processObj),
+ path.join('/x/y'))
+ }
+})
+
+// we should find the directory based on the execPath
+// for node and match because it was in the Debug directory
+test('test find-node-directory - node in Debug release dir', function (t) {
+ t.plan(platforms.length)
+ for (var next = 0; next < platforms.length; next++) {
+ var processObj
+ if (platforms[next] === 'win32') {
+ processObj = {execPath: '/a/b/Debug/node', platform: platforms[next]}
+ } else {
+ processObj = {execPath: '/a/b/out/Debug/node', platform: platforms[next]}
+ }
+
+ t.equal(
+ findNodeDirectory('/nothere/npm/node_modules/node-gyp/lib', processObj),
+ path.join('/a/b'))
+ }
+})
+
+// we should not find it as it will not match based on the execPath nor
+// the directory from which the script is running
+test('test find-node-directory - not found', function (t) {
+ t.plan(platforms.length)
+ for (var next = 0; next < platforms.length; next++) {
+ var processObj = {execPath: '/x/y/z/y', platform:next}
+ t.equal(findNodeDirectory('/a/b/c/d', processObj), '')
+ }
+})
+
+// we should find the directory based on the directory
+// the script is running in and it should match the layout
+// in a build tree where npm is installed in
+// .... /deps/npm
+// same test as above but make sure additional directory entries
+// don't cause an issue
+test('test find-node-directory - node install', function (t) {
+ t.plan(platforms.length)
+ for (var next = 0; next < platforms.length; next++) {
+ var processObj = {execPath: '/x/y/bin/node', platform: platforms[next]}
+ t.equal(
+ findNodeDirectory('/x/y/z/a/b/c/deps/npm/node_modules/node-gyp/lib',
+ processObj), path.join('/x/y/z/a/b/c'))
+ }
+})
diff --git a/deps/npm/node_modules/node-gyp/test/test-find-python.js b/deps/npm/node_modules/node-gyp/test/test-find-python.js
new file mode 100644
index 00000000000000..7f5c3946794f20
--- /dev/null
+++ b/deps/npm/node_modules/node-gyp/test/test-find-python.js
@@ -0,0 +1,20 @@
+'use strict'
+
+var test = require('tape')
+var configure = require('../lib/configure')
+var execFile = require('child_process').execFile
+
+test('find python executable', function (t) {
+ t.plan(4)
+
+ configure.test.findPython('python', function (err, found) {
+ t.strictEqual(err, null)
+ var proc = execFile(found, ['-V'], function (err, stdout, stderr) {
+ t.strictEqual(err, null)
+ t.strictEqual(stdout, '')
+ t.ok(/Python 2/.test(stderr))
+ })
+ proc.stdout.setEncoding('utf-8')
+ proc.stderr.setEncoding('utf-8')
+ })
+})
diff --git a/deps/npm/node_modules/node-gyp/test/test-options.js b/deps/npm/node_modules/node-gyp/test/test-options.js
new file mode 100644
index 00000000000000..d097f81be62c8f
--- /dev/null
+++ b/deps/npm/node_modules/node-gyp/test/test-options.js
@@ -0,0 +1,25 @@
+'use strict';
+
+var test = require('tape')
+var gyp = require('../lib/node-gyp')
+
+test('options in environment', function (t) {
+ t.plan(1)
+
+ // `npm test` dumps a ton of npm_config_* variables in the environment.
+ Object.keys(process.env)
+ .filter(function(key) { return /^npm_config_/.test(key) })
+ .forEach(function(key) { delete process.env[key] })
+
+ // Zero-length keys should get filtered out.
+ process.env.npm_config_ = '42'
+ // Other keys should get added.
+ process.env.npm_config_x = '42'
+ // Except loglevel.
+ process.env.npm_config_loglevel = 'debug'
+
+ var g = gyp();
+ g.parseArgv(['rebuild']) // Also sets opts.argv.
+
+ t.deepEqual(Object.keys(g.opts).sort(), ['argv', 'x'])
+})
diff --git a/deps/npm/node_modules/npm-install-checks/node_modules/npmlog/node_modules/gauge/node_modules/lodash._basetostring/package.json b/deps/npm/node_modules/npm-install-checks/node_modules/npmlog/node_modules/gauge/node_modules/lodash._basetostring/package.json
deleted file mode 100644
index 93233eaac56239..00000000000000
--- a/deps/npm/node_modules/npm-install-checks/node_modules/npmlog/node_modules/gauge/node_modules/lodash._basetostring/package.json
+++ /dev/null
@@ -1,56 +0,0 @@
-{
- "name": "lodash._basetostring",
- "version": "3.0.1",
- "description": "The modern build of lodash’s internal `baseToString` as a module.",
- "homepage": "https://lodash.com/",
- "icon": "https://lodash.com/icon.svg",
- "license": "MIT",
- "author": {
- "name": "John-David Dalton",
- "email": "john.david.dalton@gmail.com",
- "url": "http://allyoucanleet.com/"
- },
- "contributors": [
- {
- "name": "John-David Dalton",
- "email": "john.david.dalton@gmail.com",
- "url": "http://allyoucanleet.com/"
- },
- {
- "name": "Benjamin Tan",
- "email": "demoneaux@gmail.com",
- "url": "https://d10.github.io/"
- },
- {
- "name": "Blaine Bublitz",
- "email": "blaine@iceddev.com",
- "url": "http://www.iceddev.com/"
- },
- {
- "name": "Kit Cambridge",
- "email": "github@kitcambridge.be",
- "url": "http://kitcambridge.be/"
- },
- {
- "name": "Mathias Bynens",
- "email": "mathias@qiwi.be",
- "url": "https://mathiasbynens.be/"
- }
- ],
- "repository": {
- "type": "git",
- "url": "git+https://github.com/lodash/lodash.git"
- },
- "scripts": {
- "test": "echo \"See https://travis-ci.org/lodash/lodash-cli for testing details.\""
- },
- "readme": "# lodash._basetostring v3.0.1\n\nThe [modern build](https://github.com/lodash/lodash/wiki/Build-Differences) of [lodash’s](https://lodash.com/) internal `baseToString` exported as a [Node.js](http://nodejs.org/)/[io.js](https://iojs.org/) module.\n\n## Installation\n\nUsing npm:\n\n```bash\n$ {sudo -H} npm i -g npm\n$ npm i --save lodash._basetostring\n```\n\nIn Node.js/io.js:\n\n```js\nvar baseToString = require('lodash._basetostring');\n```\n\nSee the [package source](https://github.com/lodash/lodash/blob/3.0.1-npm-packages/lodash._basetostring) for more details.\n",
- "readmeFilename": "README.md",
- "bugs": {
- "url": "https://github.com/lodash/lodash/issues"
- },
- "_id": "lodash._basetostring@3.0.1",
- "_shasum": "d1861d877f824a52f669832dcaf3ee15566a07d5",
- "_resolved": "https://registry.npmjs.org/lodash._basetostring/-/lodash._basetostring-3.0.1.tgz",
- "_from": "lodash._basetostring@3.0.1"
-}
diff --git a/deps/npm/node_modules/npm-install-checks/node_modules/npmlog/node_modules/gauge/node_modules/lodash._createpadding/package.json b/deps/npm/node_modules/npm-install-checks/node_modules/npmlog/node_modules/gauge/node_modules/lodash._createpadding/package.json
deleted file mode 100644
index 945409f3e1c152..00000000000000
--- a/deps/npm/node_modules/npm-install-checks/node_modules/npmlog/node_modules/gauge/node_modules/lodash._createpadding/package.json
+++ /dev/null
@@ -1,91 +0,0 @@
-{
- "name": "lodash._createpadding",
- "version": "3.6.1",
- "description": "The modern build of lodash’s internal `createPadding` as a module.",
- "homepage": "https://lodash.com/",
- "icon": "https://lodash.com/icon.svg",
- "license": "MIT",
- "author": {
- "name": "John-David Dalton",
- "email": "john.david.dalton@gmail.com",
- "url": "http://allyoucanleet.com/"
- },
- "contributors": [
- {
- "name": "John-David Dalton",
- "email": "john.david.dalton@gmail.com",
- "url": "http://allyoucanleet.com/"
- },
- {
- "name": "Benjamin Tan",
- "email": "demoneaux@gmail.com",
- "url": "https://d10.github.io/"
- },
- {
- "name": "Blaine Bublitz",
- "email": "blaine@iceddev.com",
- "url": "http://www.iceddev.com/"
- },
- {
- "name": "Kit Cambridge",
- "email": "github@kitcambridge.be",
- "url": "http://kitcambridge.be/"
- },
- {
- "name": "Mathias Bynens",
- "email": "mathias@qiwi.be",
- "url": "https://mathiasbynens.be/"
- }
- ],
- "repository": {
- "type": "git",
- "url": "git+https://github.com/lodash/lodash.git"
- },
- "scripts": {
- "test": "echo \"See https://travis-ci.org/lodash/lodash-cli for testing details.\""
- },
- "dependencies": {
- "lodash.repeat": "^3.0.0"
- },
- "bugs": {
- "url": "https://github.com/lodash/lodash/issues"
- },
- "_id": "lodash._createpadding@3.6.1",
- "_shasum": "4907b438595adc54ee8935527a6c424c02c81a87",
- "_from": "lodash._createpadding@3.6.1",
- "_npmVersion": "2.12.0",
- "_nodeVersion": "0.12.5",
- "_npmUser": {
- "name": "jdalton",
- "email": "john.david.dalton@gmail.com"
- },
- "maintainers": [
- {
- "name": "jdalton",
- "email": "john.david.dalton@gmail.com"
- },
- {
- "name": "d10",
- "email": "demoneaux@gmail.com"
- },
- {
- "name": "kitcambridge",
- "email": "github@kitcambridge.be"
- },
- {
- "name": "mathias",
- "email": "mathias@qiwi.be"
- },
- {
- "name": "phated",
- "email": "blaine@iceddev.com"
- }
- ],
- "dist": {
- "shasum": "4907b438595adc54ee8935527a6c424c02c81a87",
- "tarball": "http://registry.npmjs.org/lodash._createpadding/-/lodash._createpadding-3.6.1.tgz"
- },
- "directories": {},
- "_resolved": "https://registry.npmjs.org/lodash._createpadding/-/lodash._createpadding-3.6.1.tgz",
- "readme": "ERROR: No README data found!"
-}
diff --git a/deps/npm/node_modules/npm-install-checks/node_modules/npmlog/node_modules/gauge/node_modules/lodash._basetostring/LICENSE b/deps/npm/node_modules/npm-install-checks/node_modules/npmlog/node_modules/gauge/node_modules/lodash.pad/node_modules/lodash._basetostring/LICENSE
similarity index 100%
rename from deps/npm/node_modules/npm-install-checks/node_modules/npmlog/node_modules/gauge/node_modules/lodash._basetostring/LICENSE
rename to deps/npm/node_modules/npm-install-checks/node_modules/npmlog/node_modules/gauge/node_modules/lodash.pad/node_modules/lodash._basetostring/LICENSE
diff --git a/deps/npm/node_modules/npm-install-checks/node_modules/npmlog/node_modules/gauge/node_modules/lodash._basetostring/README.md b/deps/npm/node_modules/npm-install-checks/node_modules/npmlog/node_modules/gauge/node_modules/lodash.pad/node_modules/lodash._basetostring/README.md
similarity index 100%
rename from deps/npm/node_modules/npm-install-checks/node_modules/npmlog/node_modules/gauge/node_modules/lodash._basetostring/README.md
rename to deps/npm/node_modules/npm-install-checks/node_modules/npmlog/node_modules/gauge/node_modules/lodash.pad/node_modules/lodash._basetostring/README.md
diff --git a/deps/npm/node_modules/npm-install-checks/node_modules/npmlog/node_modules/gauge/node_modules/lodash._basetostring/index.js b/deps/npm/node_modules/npm-install-checks/node_modules/npmlog/node_modules/gauge/node_modules/lodash.pad/node_modules/lodash._basetostring/index.js
similarity index 100%
rename from deps/npm/node_modules/npm-install-checks/node_modules/npmlog/node_modules/gauge/node_modules/lodash._basetostring/index.js
rename to deps/npm/node_modules/npm-install-checks/node_modules/npmlog/node_modules/gauge/node_modules/lodash.pad/node_modules/lodash._basetostring/index.js
diff --git a/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash.pad/node_modules/lodash._basetostring/package.json b/deps/npm/node_modules/npm-install-checks/node_modules/npmlog/node_modules/gauge/node_modules/lodash.pad/node_modules/lodash._basetostring/package.json
similarity index 100%
rename from deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash.pad/node_modules/lodash._basetostring/package.json
rename to deps/npm/node_modules/npm-install-checks/node_modules/npmlog/node_modules/gauge/node_modules/lodash.pad/node_modules/lodash._basetostring/package.json
diff --git a/deps/npm/node_modules/npm-install-checks/node_modules/npmlog/node_modules/gauge/node_modules/lodash._createpadding/LICENSE b/deps/npm/node_modules/npm-install-checks/node_modules/npmlog/node_modules/gauge/node_modules/lodash.pad/node_modules/lodash._createpadding/LICENSE
similarity index 100%
rename from deps/npm/node_modules/npm-install-checks/node_modules/npmlog/node_modules/gauge/node_modules/lodash._createpadding/LICENSE
rename to deps/npm/node_modules/npm-install-checks/node_modules/npmlog/node_modules/gauge/node_modules/lodash.pad/node_modules/lodash._createpadding/LICENSE
diff --git a/deps/npm/node_modules/npm-install-checks/node_modules/npmlog/node_modules/gauge/node_modules/lodash._createpadding/README.md b/deps/npm/node_modules/npm-install-checks/node_modules/npmlog/node_modules/gauge/node_modules/lodash.pad/node_modules/lodash._createpadding/README.md
similarity index 100%
rename from deps/npm/node_modules/npm-install-checks/node_modules/npmlog/node_modules/gauge/node_modules/lodash._createpadding/README.md
rename to deps/npm/node_modules/npm-install-checks/node_modules/npmlog/node_modules/gauge/node_modules/lodash.pad/node_modules/lodash._createpadding/README.md
diff --git a/deps/npm/node_modules/npm-install-checks/node_modules/npmlog/node_modules/gauge/node_modules/lodash._createpadding/index.js b/deps/npm/node_modules/npm-install-checks/node_modules/npmlog/node_modules/gauge/node_modules/lodash.pad/node_modules/lodash._createpadding/index.js
similarity index 100%
rename from deps/npm/node_modules/npm-install-checks/node_modules/npmlog/node_modules/gauge/node_modules/lodash._createpadding/index.js
rename to deps/npm/node_modules/npm-install-checks/node_modules/npmlog/node_modules/gauge/node_modules/lodash.pad/node_modules/lodash._createpadding/index.js
diff --git a/deps/npm/node_modules/npm-install-checks/node_modules/npmlog/node_modules/gauge/node_modules/lodash._createpadding/node_modules/lodash.repeat/LICENSE b/deps/npm/node_modules/npm-install-checks/node_modules/npmlog/node_modules/gauge/node_modules/lodash.pad/node_modules/lodash._createpadding/node_modules/lodash.repeat/LICENSE
similarity index 100%
rename from deps/npm/node_modules/npm-install-checks/node_modules/npmlog/node_modules/gauge/node_modules/lodash._createpadding/node_modules/lodash.repeat/LICENSE
rename to deps/npm/node_modules/npm-install-checks/node_modules/npmlog/node_modules/gauge/node_modules/lodash.pad/node_modules/lodash._createpadding/node_modules/lodash.repeat/LICENSE
diff --git a/deps/npm/node_modules/npm-install-checks/node_modules/npmlog/node_modules/gauge/node_modules/lodash._createpadding/node_modules/lodash.repeat/README.md b/deps/npm/node_modules/npm-install-checks/node_modules/npmlog/node_modules/gauge/node_modules/lodash.pad/node_modules/lodash._createpadding/node_modules/lodash.repeat/README.md
similarity index 100%
rename from deps/npm/node_modules/npm-install-checks/node_modules/npmlog/node_modules/gauge/node_modules/lodash._createpadding/node_modules/lodash.repeat/README.md
rename to deps/npm/node_modules/npm-install-checks/node_modules/npmlog/node_modules/gauge/node_modules/lodash.pad/node_modules/lodash._createpadding/node_modules/lodash.repeat/README.md
diff --git a/deps/npm/node_modules/npm-install-checks/node_modules/npmlog/node_modules/gauge/node_modules/lodash._createpadding/node_modules/lodash.repeat/index.js b/deps/npm/node_modules/npm-install-checks/node_modules/npmlog/node_modules/gauge/node_modules/lodash.pad/node_modules/lodash._createpadding/node_modules/lodash.repeat/index.js
similarity index 100%
rename from deps/npm/node_modules/npm-install-checks/node_modules/npmlog/node_modules/gauge/node_modules/lodash._createpadding/node_modules/lodash.repeat/index.js
rename to deps/npm/node_modules/npm-install-checks/node_modules/npmlog/node_modules/gauge/node_modules/lodash.pad/node_modules/lodash._createpadding/node_modules/lodash.repeat/index.js
diff --git a/deps/npm/node_modules/npm-install-checks/node_modules/npmlog/node_modules/gauge/node_modules/lodash._createpadding/node_modules/lodash.repeat/package.json b/deps/npm/node_modules/npm-install-checks/node_modules/npmlog/node_modules/gauge/node_modules/lodash.pad/node_modules/lodash._createpadding/node_modules/lodash.repeat/package.json
similarity index 100%
rename from deps/npm/node_modules/npm-install-checks/node_modules/npmlog/node_modules/gauge/node_modules/lodash._createpadding/node_modules/lodash.repeat/package.json
rename to deps/npm/node_modules/npm-install-checks/node_modules/npmlog/node_modules/gauge/node_modules/lodash.pad/node_modules/lodash._createpadding/node_modules/lodash.repeat/package.json
diff --git a/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash.pad/node_modules/lodash._createpadding/package.json b/deps/npm/node_modules/npm-install-checks/node_modules/npmlog/node_modules/gauge/node_modules/lodash.pad/node_modules/lodash._createpadding/package.json
similarity index 100%
rename from deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash.pad/node_modules/lodash._createpadding/package.json
rename to deps/npm/node_modules/npm-install-checks/node_modules/npmlog/node_modules/gauge/node_modules/lodash.pad/node_modules/lodash._createpadding/package.json
diff --git a/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash.pad/node_modules/lodash._basetostring/LICENSE b/deps/npm/node_modules/npm-install-checks/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padleft/node_modules/lodash._basetostring/LICENSE
similarity index 100%
rename from deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash.pad/node_modules/lodash._basetostring/LICENSE
rename to deps/npm/node_modules/npm-install-checks/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padleft/node_modules/lodash._basetostring/LICENSE
diff --git a/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash.pad/node_modules/lodash._basetostring/README.md b/deps/npm/node_modules/npm-install-checks/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padleft/node_modules/lodash._basetostring/README.md
similarity index 100%
rename from deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash.pad/node_modules/lodash._basetostring/README.md
rename to deps/npm/node_modules/npm-install-checks/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padleft/node_modules/lodash._basetostring/README.md
diff --git a/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash.pad/node_modules/lodash._basetostring/index.js b/deps/npm/node_modules/npm-install-checks/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padleft/node_modules/lodash._basetostring/index.js
similarity index 100%
rename from deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash.pad/node_modules/lodash._basetostring/index.js
rename to deps/npm/node_modules/npm-install-checks/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padleft/node_modules/lodash._basetostring/index.js
diff --git a/deps/npm/node_modules/npm-install-checks/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padleft/node_modules/lodash._basetostring/package.json b/deps/npm/node_modules/npm-install-checks/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padleft/node_modules/lodash._basetostring/package.json
new file mode 100644
index 00000000000000..f592f32e198f3e
--- /dev/null
+++ b/deps/npm/node_modules/npm-install-checks/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padleft/node_modules/lodash._basetostring/package.json
@@ -0,0 +1,88 @@
+{
+ "name": "lodash._basetostring",
+ "version": "3.0.1",
+ "description": "The modern build of lodash’s internal `baseToString` as a module.",
+ "homepage": "https://lodash.com/",
+ "icon": "https://lodash.com/icon.svg",
+ "license": "MIT",
+ "author": {
+ "name": "John-David Dalton",
+ "email": "john.david.dalton@gmail.com",
+ "url": "http://allyoucanleet.com/"
+ },
+ "contributors": [
+ {
+ "name": "John-David Dalton",
+ "email": "john.david.dalton@gmail.com",
+ "url": "http://allyoucanleet.com/"
+ },
+ {
+ "name": "Benjamin Tan",
+ "email": "demoneaux@gmail.com",
+ "url": "https://d10.github.io/"
+ },
+ {
+ "name": "Blaine Bublitz",
+ "email": "blaine@iceddev.com",
+ "url": "http://www.iceddev.com/"
+ },
+ {
+ "name": "Kit Cambridge",
+ "email": "github@kitcambridge.be",
+ "url": "http://kitcambridge.be/"
+ },
+ {
+ "name": "Mathias Bynens",
+ "email": "mathias@qiwi.be",
+ "url": "https://mathiasbynens.be/"
+ }
+ ],
+ "repository": {
+ "type": "git",
+ "url": "git+https://github.com/lodash/lodash.git"
+ },
+ "scripts": {
+ "test": "echo \"See https://travis-ci.org/lodash/lodash-cli for testing details.\""
+ },
+ "bugs": {
+ "url": "https://github.com/lodash/lodash/issues"
+ },
+ "_id": "lodash._basetostring@3.0.1",
+ "_shasum": "d1861d877f824a52f669832dcaf3ee15566a07d5",
+ "_from": "lodash._basetostring@>=3.0.0 <4.0.0",
+ "_npmVersion": "2.12.0",
+ "_nodeVersion": "0.12.5",
+ "_npmUser": {
+ "name": "jdalton",
+ "email": "john.david.dalton@gmail.com"
+ },
+ "maintainers": [
+ {
+ "name": "jdalton",
+ "email": "john.david.dalton@gmail.com"
+ },
+ {
+ "name": "d10",
+ "email": "demoneaux@gmail.com"
+ },
+ {
+ "name": "kitcambridge",
+ "email": "github@kitcambridge.be"
+ },
+ {
+ "name": "mathias",
+ "email": "mathias@qiwi.be"
+ },
+ {
+ "name": "phated",
+ "email": "blaine@iceddev.com"
+ }
+ ],
+ "dist": {
+ "shasum": "d1861d877f824a52f669832dcaf3ee15566a07d5",
+ "tarball": "http://registry.npmjs.org/lodash._basetostring/-/lodash._basetostring-3.0.1.tgz"
+ },
+ "directories": {},
+ "_resolved": "https://registry.npmjs.org/lodash._basetostring/-/lodash._basetostring-3.0.1.tgz",
+ "readme": "ERROR: No README data found!"
+}
diff --git a/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash.pad/node_modules/lodash._createpadding/LICENSE b/deps/npm/node_modules/npm-install-checks/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padleft/node_modules/lodash._createpadding/LICENSE
similarity index 100%
rename from deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash.pad/node_modules/lodash._createpadding/LICENSE
rename to deps/npm/node_modules/npm-install-checks/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padleft/node_modules/lodash._createpadding/LICENSE
diff --git a/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash.pad/node_modules/lodash._createpadding/README.md b/deps/npm/node_modules/npm-install-checks/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padleft/node_modules/lodash._createpadding/README.md
similarity index 100%
rename from deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash.pad/node_modules/lodash._createpadding/README.md
rename to deps/npm/node_modules/npm-install-checks/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padleft/node_modules/lodash._createpadding/README.md
diff --git a/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash.pad/node_modules/lodash._createpadding/index.js b/deps/npm/node_modules/npm-install-checks/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padleft/node_modules/lodash._createpadding/index.js
similarity index 100%
rename from deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash.pad/node_modules/lodash._createpadding/index.js
rename to deps/npm/node_modules/npm-install-checks/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padleft/node_modules/lodash._createpadding/index.js
diff --git a/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash.pad/node_modules/lodash._createpadding/node_modules/lodash.repeat/LICENSE b/deps/npm/node_modules/npm-install-checks/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padleft/node_modules/lodash._createpadding/node_modules/lodash.repeat/LICENSE
similarity index 100%
rename from deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash.pad/node_modules/lodash._createpadding/node_modules/lodash.repeat/LICENSE
rename to deps/npm/node_modules/npm-install-checks/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padleft/node_modules/lodash._createpadding/node_modules/lodash.repeat/LICENSE
diff --git a/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash.pad/node_modules/lodash._createpadding/node_modules/lodash.repeat/README.md b/deps/npm/node_modules/npm-install-checks/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padleft/node_modules/lodash._createpadding/node_modules/lodash.repeat/README.md
similarity index 100%
rename from deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash.pad/node_modules/lodash._createpadding/node_modules/lodash.repeat/README.md
rename to deps/npm/node_modules/npm-install-checks/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padleft/node_modules/lodash._createpadding/node_modules/lodash.repeat/README.md
diff --git a/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash.pad/node_modules/lodash._createpadding/node_modules/lodash.repeat/index.js b/deps/npm/node_modules/npm-install-checks/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padleft/node_modules/lodash._createpadding/node_modules/lodash.repeat/index.js
similarity index 100%
rename from deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash.pad/node_modules/lodash._createpadding/node_modules/lodash.repeat/index.js
rename to deps/npm/node_modules/npm-install-checks/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padleft/node_modules/lodash._createpadding/node_modules/lodash.repeat/index.js
diff --git a/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash.pad/node_modules/lodash._createpadding/node_modules/lodash.repeat/package.json b/deps/npm/node_modules/npm-install-checks/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padleft/node_modules/lodash._createpadding/node_modules/lodash.repeat/package.json
similarity index 100%
rename from deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash.pad/node_modules/lodash._createpadding/node_modules/lodash.repeat/package.json
rename to deps/npm/node_modules/npm-install-checks/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padleft/node_modules/lodash._createpadding/node_modules/lodash.repeat/package.json
diff --git a/deps/npm/node_modules/npm-install-checks/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padleft/node_modules/lodash._createpadding/package.json b/deps/npm/node_modules/npm-install-checks/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padleft/node_modules/lodash._createpadding/package.json
new file mode 100644
index 00000000000000..376b174bee4ab4
--- /dev/null
+++ b/deps/npm/node_modules/npm-install-checks/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padleft/node_modules/lodash._createpadding/package.json
@@ -0,0 +1,91 @@
+{
+ "name": "lodash._createpadding",
+ "version": "3.6.1",
+ "description": "The modern build of lodash’s internal `createPadding` as a module.",
+ "homepage": "https://lodash.com/",
+ "icon": "https://lodash.com/icon.svg",
+ "license": "MIT",
+ "author": {
+ "name": "John-David Dalton",
+ "email": "john.david.dalton@gmail.com",
+ "url": "http://allyoucanleet.com/"
+ },
+ "contributors": [
+ {
+ "name": "John-David Dalton",
+ "email": "john.david.dalton@gmail.com",
+ "url": "http://allyoucanleet.com/"
+ },
+ {
+ "name": "Benjamin Tan",
+ "email": "demoneaux@gmail.com",
+ "url": "https://d10.github.io/"
+ },
+ {
+ "name": "Blaine Bublitz",
+ "email": "blaine@iceddev.com",
+ "url": "http://www.iceddev.com/"
+ },
+ {
+ "name": "Kit Cambridge",
+ "email": "github@kitcambridge.be",
+ "url": "http://kitcambridge.be/"
+ },
+ {
+ "name": "Mathias Bynens",
+ "email": "mathias@qiwi.be",
+ "url": "https://mathiasbynens.be/"
+ }
+ ],
+ "repository": {
+ "type": "git",
+ "url": "git+https://github.com/lodash/lodash.git"
+ },
+ "scripts": {
+ "test": "echo \"See https://travis-ci.org/lodash/lodash-cli for testing details.\""
+ },
+ "dependencies": {
+ "lodash.repeat": "^3.0.0"
+ },
+ "bugs": {
+ "url": "https://github.com/lodash/lodash/issues"
+ },
+ "_id": "lodash._createpadding@3.6.1",
+ "_shasum": "4907b438595adc54ee8935527a6c424c02c81a87",
+ "_from": "lodash._createpadding@>=3.0.0 <4.0.0",
+ "_npmVersion": "2.12.0",
+ "_nodeVersion": "0.12.5",
+ "_npmUser": {
+ "name": "jdalton",
+ "email": "john.david.dalton@gmail.com"
+ },
+ "maintainers": [
+ {
+ "name": "jdalton",
+ "email": "john.david.dalton@gmail.com"
+ },
+ {
+ "name": "d10",
+ "email": "demoneaux@gmail.com"
+ },
+ {
+ "name": "kitcambridge",
+ "email": "github@kitcambridge.be"
+ },
+ {
+ "name": "mathias",
+ "email": "mathias@qiwi.be"
+ },
+ {
+ "name": "phated",
+ "email": "blaine@iceddev.com"
+ }
+ ],
+ "dist": {
+ "shasum": "4907b438595adc54ee8935527a6c424c02c81a87",
+ "tarball": "http://registry.npmjs.org/lodash._createpadding/-/lodash._createpadding-3.6.1.tgz"
+ },
+ "directories": {},
+ "_resolved": "https://registry.npmjs.org/lodash._createpadding/-/lodash._createpadding-3.6.1.tgz",
+ "readme": "ERROR: No README data found!"
+}
diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/LICENSE.txt b/deps/npm/node_modules/npm-install-checks/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padright/node_modules/lodash._basetostring/LICENSE
similarity index 100%
rename from tools/eslint/node_modules/inquirer/node_modules/lodash/LICENSE.txt
rename to deps/npm/node_modules/npm-install-checks/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padright/node_modules/lodash._basetostring/LICENSE
diff --git a/deps/npm/node_modules/npm-install-checks/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padright/node_modules/lodash._basetostring/README.md b/deps/npm/node_modules/npm-install-checks/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padright/node_modules/lodash._basetostring/README.md
new file mode 100644
index 00000000000000..f81145e6ebe765
--- /dev/null
+++ b/deps/npm/node_modules/npm-install-checks/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padright/node_modules/lodash._basetostring/README.md
@@ -0,0 +1,20 @@
+# lodash._basetostring v3.0.1
+
+The [modern build](https://github.com/lodash/lodash/wiki/Build-Differences) of [lodash’s](https://lodash.com/) internal `baseToString` exported as a [Node.js](http://nodejs.org/)/[io.js](https://iojs.org/) module.
+
+## Installation
+
+Using npm:
+
+```bash
+$ {sudo -H} npm i -g npm
+$ npm i --save lodash._basetostring
+```
+
+In Node.js/io.js:
+
+```js
+var baseToString = require('lodash._basetostring');
+```
+
+See the [package source](https://github.com/lodash/lodash/blob/3.0.1-npm-packages/lodash._basetostring) for more details.
diff --git a/deps/npm/node_modules/npm-install-checks/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padright/node_modules/lodash._basetostring/index.js b/deps/npm/node_modules/npm-install-checks/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padright/node_modules/lodash._basetostring/index.js
new file mode 100644
index 00000000000000..db8ecc9fdd0094
--- /dev/null
+++ b/deps/npm/node_modules/npm-install-checks/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padright/node_modules/lodash._basetostring/index.js
@@ -0,0 +1,22 @@
+/**
+ * lodash 3.0.1 (Custom Build)
+ * Build: `lodash modern modularize exports="npm" -o ./`
+ * Copyright 2012-2015 The Dojo Foundation
+ * Based on Underscore.js 1.8.3
+ * Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
+ * Available under MIT license
+ */
+
+/**
+ * Converts `value` to a string if it's not one. An empty string is returned
+ * for `null` or `undefined` values.
+ *
+ * @private
+ * @param {*} value The value to process.
+ * @returns {string} Returns the string.
+ */
+function baseToString(value) {
+ return value == null ? '' : (value + '');
+}
+
+module.exports = baseToString;
diff --git a/deps/npm/node_modules/npm-install-checks/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padright/node_modules/lodash._basetostring/package.json b/deps/npm/node_modules/npm-install-checks/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padright/node_modules/lodash._basetostring/package.json
new file mode 100644
index 00000000000000..f592f32e198f3e
--- /dev/null
+++ b/deps/npm/node_modules/npm-install-checks/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padright/node_modules/lodash._basetostring/package.json
@@ -0,0 +1,88 @@
+{
+ "name": "lodash._basetostring",
+ "version": "3.0.1",
+ "description": "The modern build of lodash’s internal `baseToString` as a module.",
+ "homepage": "https://lodash.com/",
+ "icon": "https://lodash.com/icon.svg",
+ "license": "MIT",
+ "author": {
+ "name": "John-David Dalton",
+ "email": "john.david.dalton@gmail.com",
+ "url": "http://allyoucanleet.com/"
+ },
+ "contributors": [
+ {
+ "name": "John-David Dalton",
+ "email": "john.david.dalton@gmail.com",
+ "url": "http://allyoucanleet.com/"
+ },
+ {
+ "name": "Benjamin Tan",
+ "email": "demoneaux@gmail.com",
+ "url": "https://d10.github.io/"
+ },
+ {
+ "name": "Blaine Bublitz",
+ "email": "blaine@iceddev.com",
+ "url": "http://www.iceddev.com/"
+ },
+ {
+ "name": "Kit Cambridge",
+ "email": "github@kitcambridge.be",
+ "url": "http://kitcambridge.be/"
+ },
+ {
+ "name": "Mathias Bynens",
+ "email": "mathias@qiwi.be",
+ "url": "https://mathiasbynens.be/"
+ }
+ ],
+ "repository": {
+ "type": "git",
+ "url": "git+https://github.com/lodash/lodash.git"
+ },
+ "scripts": {
+ "test": "echo \"See https://travis-ci.org/lodash/lodash-cli for testing details.\""
+ },
+ "bugs": {
+ "url": "https://github.com/lodash/lodash/issues"
+ },
+ "_id": "lodash._basetostring@3.0.1",
+ "_shasum": "d1861d877f824a52f669832dcaf3ee15566a07d5",
+ "_from": "lodash._basetostring@>=3.0.0 <4.0.0",
+ "_npmVersion": "2.12.0",
+ "_nodeVersion": "0.12.5",
+ "_npmUser": {
+ "name": "jdalton",
+ "email": "john.david.dalton@gmail.com"
+ },
+ "maintainers": [
+ {
+ "name": "jdalton",
+ "email": "john.david.dalton@gmail.com"
+ },
+ {
+ "name": "d10",
+ "email": "demoneaux@gmail.com"
+ },
+ {
+ "name": "kitcambridge",
+ "email": "github@kitcambridge.be"
+ },
+ {
+ "name": "mathias",
+ "email": "mathias@qiwi.be"
+ },
+ {
+ "name": "phated",
+ "email": "blaine@iceddev.com"
+ }
+ ],
+ "dist": {
+ "shasum": "d1861d877f824a52f669832dcaf3ee15566a07d5",
+ "tarball": "http://registry.npmjs.org/lodash._basetostring/-/lodash._basetostring-3.0.1.tgz"
+ },
+ "directories": {},
+ "_resolved": "https://registry.npmjs.org/lodash._basetostring/-/lodash._basetostring-3.0.1.tgz",
+ "readme": "ERROR: No README data found!"
+}
diff --git a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/LICENSE.txt b/deps/npm/node_modules/npm-install-checks/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padright/node_modules/lodash._createpadding/LICENSE
similarity index 100%
rename from tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/LICENSE.txt
rename to deps/npm/node_modules/npm-install-checks/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padright/node_modules/lodash._createpadding/LICENSE
diff --git a/deps/npm/node_modules/npm-install-checks/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padright/node_modules/lodash._createpadding/README.md b/deps/npm/node_modules/npm-install-checks/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padright/node_modules/lodash._createpadding/README.md
new file mode 100644
index 00000000000000..f9c9411c70412e
--- /dev/null
+++ b/deps/npm/node_modules/npm-install-checks/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padright/node_modules/lodash._createpadding/README.md
@@ -0,0 +1,20 @@
+# lodash._createpadding v3.6.1
+
+The [modern build](https://github.com/lodash/lodash/wiki/Build-Differences) of [lodash’s](https://lodash.com/) internal `createPadding` exported as a [Node.js](http://nodejs.org/)/[io.js](https://iojs.org/) module.
+
+## Installation
+
+Using npm:
+
+```bash
+$ {sudo -H} npm i -g npm
+$ npm i --save lodash._createpadding
+```
+
+In Node.js/io.js:
+
+```js
+var createPadding = require('lodash._createpadding');
+```
+
+See the [package source](https://github.com/lodash/lodash/blob/3.6.1-npm-packages/lodash._createpadding) for more details.
diff --git a/deps/npm/node_modules/npm-install-checks/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padright/node_modules/lodash._createpadding/index.js b/deps/npm/node_modules/npm-install-checks/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padright/node_modules/lodash._createpadding/index.js
new file mode 100644
index 00000000000000..3541a8aae32935
--- /dev/null
+++ b/deps/npm/node_modules/npm-install-checks/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padright/node_modules/lodash._createpadding/index.js
@@ -0,0 +1,37 @@
+/**
+ * lodash 3.6.1 (Custom Build)
+ * Build: `lodash modern modularize exports="npm" -o ./`
+ * Copyright 2012-2015 The Dojo Foundation
+ * Based on Underscore.js 1.8.3
+ * Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
+ * Available under MIT license
+ */
+var repeat = require('lodash.repeat');
+
+/* Native method references for those with the same name as other `lodash` methods. */
+var nativeCeil = Math.ceil,
+ nativeIsFinite = global.isFinite;
+
+/**
+ * Creates the padding required for `string` based on the given `length`.
+ * The `chars` string is truncated if the number of characters exceeds `length`.
+ *
+ * @private
+ * @param {string} string The string to create padding for.
+ * @param {number} [length=0] The padding length.
+ * @param {string} [chars=' '] The string used as padding.
+ * @returns {string} Returns the pad for `string`.
+ */
+function createPadding(string, length, chars) {
+ var strLength = string.length;
+ length = +length;
+
+ if (strLength >= length || !nativeIsFinite(length)) {
+ return '';
+ }
+ var padLength = length - strLength;
+ chars = chars == null ? ' ' : (chars + '');
+ return repeat(chars, nativeCeil(padLength / chars.length)).slice(0, padLength);
+}
+
+module.exports = createPadding;
diff --git a/deps/npm/node_modules/npm-install-checks/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padright/node_modules/lodash._createpadding/node_modules/lodash.repeat/LICENSE b/deps/npm/node_modules/npm-install-checks/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padright/node_modules/lodash._createpadding/node_modules/lodash.repeat/LICENSE
new file mode 100644
index 00000000000000..9cd87e5dcefe58
--- /dev/null
+++ b/deps/npm/node_modules/npm-install-checks/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padright/node_modules/lodash._createpadding/node_modules/lodash.repeat/LICENSE
@@ -0,0 +1,22 @@
+Copyright 2012-2015 The Dojo Foundation
+Based on Underscore.js, copyright 2009-2015 Jeremy Ashkenas,
+DocumentCloud and Investigative Reporters & Editors
+
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+"Software"), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
diff --git a/deps/npm/node_modules/npm-install-checks/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padright/node_modules/lodash._createpadding/node_modules/lodash.repeat/README.md b/deps/npm/node_modules/npm-install-checks/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padright/node_modules/lodash._createpadding/node_modules/lodash.repeat/README.md
new file mode 100644
index 00000000000000..dec571a333a52a
--- /dev/null
+++ b/deps/npm/node_modules/npm-install-checks/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padright/node_modules/lodash._createpadding/node_modules/lodash.repeat/README.md
@@ -0,0 +1,20 @@
+# lodash.repeat v3.0.1
+
+The [modern build](https://github.com/lodash/lodash/wiki/Build-Differences) of [lodash’s](https://lodash.com/) `_.repeat` exported as a [Node.js](http://nodejs.org/)/[io.js](https://iojs.org/) module.
+
+## Installation
+
+Using npm:
+
+```bash
+$ {sudo -H} npm i -g npm
+$ npm i --save lodash.repeat
+```
+
+In Node.js/io.js:
+
+```js
+var repeat = require('lodash.repeat');
+```
+
+See the [documentation](https://lodash.com/docs#repeat) or [package source](https://github.com/lodash/lodash/blob/3.0.1-npm-packages/lodash.repeat) for more details.
diff --git a/deps/npm/node_modules/npm-install-checks/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padright/node_modules/lodash._createpadding/node_modules/lodash.repeat/index.js b/deps/npm/node_modules/npm-install-checks/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padright/node_modules/lodash._createpadding/node_modules/lodash.repeat/index.js
new file mode 100644
index 00000000000000..367913f56e0ada
--- /dev/null
+++ b/deps/npm/node_modules/npm-install-checks/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padright/node_modules/lodash._createpadding/node_modules/lodash.repeat/index.js
@@ -0,0 +1,55 @@
+/**
+ * lodash 3.0.1 (Custom Build)
+ * Build: `lodash modern modularize exports="npm" -o ./`
+ * Copyright 2012-2015 The Dojo Foundation
+ * Based on Underscore.js 1.8.3
+ * Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
+ * Available under MIT license
+ */
+var baseToString = require('lodash._basetostring');
+
+/* Native method references for those with the same name as other `lodash` methods. */
+var nativeFloor = Math.floor,
+ nativeIsFinite = global.isFinite;
+
+/**
+ * Repeats the given string `n` times.
+ *
+ * @static
+ * @memberOf _
+ * @category String
+ * @param {string} [string=''] The string to repeat.
+ * @param {number} [n=0] The number of times to repeat the string.
+ * @returns {string} Returns the repeated string.
+ * @example
+ *
+ * _.repeat('*', 3);
+ * // => '***'
+ *
+ * _.repeat('abc', 2);
+ * // => 'abcabc'
+ *
+ * _.repeat('abc', 0);
+ * // => ''
+ */
+function repeat(string, n) {
+ var result = '';
+ string = baseToString(string);
+ n = +n;
+ if (n < 1 || !string || !nativeIsFinite(n)) {
+ return result;
+ }
+ // Leverage the exponentiation by squaring algorithm for a faster repeat.
+ // See https://en.wikipedia.org/wiki/Exponentiation_by_squaring for more details.
+ do {
+ if (n % 2) {
+ result += string;
+ }
+ n = nativeFloor(n / 2);
+ string += string;
+ } while (n);
+
+ return result;
+}
+
+module.exports = repeat;
diff --git a/deps/npm/node_modules/npm-install-checks/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padright/node_modules/lodash._createpadding/node_modules/lodash.repeat/package.json b/deps/npm/node_modules/npm-install-checks/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padright/node_modules/lodash._createpadding/node_modules/lodash.repeat/package.json
new file mode 100644
index 00000000000000..f941138c4bfdcf
--- /dev/null
+++ b/deps/npm/node_modules/npm-install-checks/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padright/node_modules/lodash._createpadding/node_modules/lodash.repeat/package.json
@@ -0,0 +1,97 @@
+{
+ "name": "lodash.repeat",
+ "version": "3.0.1",
+ "description": "The modern build of lodash’s `_.repeat` as a module.",
+ "homepage": "https://lodash.com/",
+ "icon": "https://lodash.com/icon.svg",
+ "license": "MIT",
+ "keywords": [
+ "lodash",
+ "lodash-modularized",
+ "stdlib",
+ "util"
+ ],
+ "author": {
+ "name": "John-David Dalton",
+ "email": "john.david.dalton@gmail.com",
+ "url": "http://allyoucanleet.com/"
+ },
+ "contributors": [
+ {
+ "name": "John-David Dalton",
+ "email": "john.david.dalton@gmail.com",
+ "url": "http://allyoucanleet.com/"
+ },
+ {
+ "name": "Benjamin Tan",
+ "email": "demoneaux@gmail.com",
+ "url": "https://d10.github.io/"
+ },
+ {
+ "name": "Blaine Bublitz",
+ "email": "blaine@iceddev.com",
+ "url": "http://www.iceddev.com/"
+ },
+ {
+ "name": "Kit Cambridge",
+ "email": "github@kitcambridge.be",
+ "url": "http://kitcambridge.be/"
+ },
+ {
+ "name": "Mathias Bynens",
+ "email": "mathias@qiwi.be",
+ "url": "https://mathiasbynens.be/"
+ }
+ ],
+ "repository": {
+ "type": "git",
+ "url": "git+https://github.com/lodash/lodash.git"
+ },
+ "scripts": {
+ "test": "echo \"See https://travis-ci.org/lodash/lodash-cli for testing details.\""
+ },
+ "dependencies": {
+ "lodash._basetostring": "^3.0.0"
+ },
+ "bugs": {
+ "url": "https://github.com/lodash/lodash/issues"
+ },
+ "_id": "lodash.repeat@3.0.1",
+ "_shasum": "f4b98dc7ef67256ce61e7874e1865edb208e0edf",
+ "_from": "lodash.repeat@>=3.0.0 <4.0.0",
+ "_npmVersion": "2.12.0",
+ "_nodeVersion": "0.12.5",
+ "_npmUser": {
+ "name": "jdalton",
+ "email": "john.david.dalton@gmail.com"
+ },
+ "maintainers": [
+ {
+ "name": "jdalton",
+ "email": "john.david.dalton@gmail.com"
+ },
+ {
+ "name": "d10",
+ "email": "demoneaux@gmail.com"
+ },
+ {
+ "name": "kitcambridge",
+ "email": "github@kitcambridge.be"
+ },
+ {
+ "name": "mathias",
+ "email": "mathias@qiwi.be"
+ },
+ {
+ "name": "phated",
+ "email": "blaine@iceddev.com"
+ }
+ ],
+ "dist": {
+ "shasum": "f4b98dc7ef67256ce61e7874e1865edb208e0edf",
+ "tarball": "http://registry.npmjs.org/lodash.repeat/-/lodash.repeat-3.0.1.tgz"
+ },
+ "directories": {},
+ "_resolved": "https://registry.npmjs.org/lodash.repeat/-/lodash.repeat-3.0.1.tgz",
+ "readme": "ERROR: No README data found!"
+}
diff --git a/deps/npm/node_modules/npm-install-checks/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padright/node_modules/lodash._createpadding/package.json b/deps/npm/node_modules/npm-install-checks/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padright/node_modules/lodash._createpadding/package.json
new file mode 100644
index 00000000000000..376b174bee4ab4
--- /dev/null
+++ b/deps/npm/node_modules/npm-install-checks/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padright/node_modules/lodash._createpadding/package.json
@@ -0,0 +1,91 @@
+{
+ "name": "lodash._createpadding",
+ "version": "3.6.1",
+ "description": "The modern build of lodash’s internal `createPadding` as a module.",
+ "homepage": "https://lodash.com/",
+ "icon": "https://lodash.com/icon.svg",
+ "license": "MIT",
+ "author": {
+ "name": "John-David Dalton",
+ "email": "john.david.dalton@gmail.com",
+ "url": "http://allyoucanleet.com/"
+ },
+ "contributors": [
+ {
+ "name": "John-David Dalton",
+ "email": "john.david.dalton@gmail.com",
+ "url": "http://allyoucanleet.com/"
+ },
+ {
+ "name": "Benjamin Tan",
+ "email": "demoneaux@gmail.com",
+ "url": "https://d10.github.io/"
+ },
+ {
+ "name": "Blaine Bublitz",
+ "email": "blaine@iceddev.com",
+ "url": "http://www.iceddev.com/"
+ },
+ {
+ "name": "Kit Cambridge",
+ "email": "github@kitcambridge.be",
+ "url": "http://kitcambridge.be/"
+ },
+ {
+ "name": "Mathias Bynens",
+ "email": "mathias@qiwi.be",
+ "url": "https://mathiasbynens.be/"
+ }
+ ],
+ "repository": {
+ "type": "git",
+ "url": "git+https://github.com/lodash/lodash.git"
+ },
+ "scripts": {
+ "test": "echo \"See https://travis-ci.org/lodash/lodash-cli for testing details.\""
+ },
+ "dependencies": {
+ "lodash.repeat": "^3.0.0"
+ },
+ "bugs": {
+ "url": "https://github.com/lodash/lodash/issues"
+ },
+ "_id": "lodash._createpadding@3.6.1",
+ "_shasum": "4907b438595adc54ee8935527a6c424c02c81a87",
+ "_from": "lodash._createpadding@>=3.0.0 <4.0.0",
+ "_npmVersion": "2.12.0",
+ "_nodeVersion": "0.12.5",
+ "_npmUser": {
+ "name": "jdalton",
+ "email": "john.david.dalton@gmail.com"
+ },
+ "maintainers": [
+ {
+ "name": "jdalton",
+ "email": "john.david.dalton@gmail.com"
+ },
+ {
+ "name": "d10",
+ "email": "demoneaux@gmail.com"
+ },
+ {
+ "name": "kitcambridge",
+ "email": "github@kitcambridge.be"
+ },
+ {
+ "name": "mathias",
+ "email": "mathias@qiwi.be"
+ },
+ {
+ "name": "phated",
+ "email": "blaine@iceddev.com"
+ }
+ ],
+ "dist": {
+ "shasum": "4907b438595adc54ee8935527a6c424c02c81a87",
+ "tarball": "http://registry.npmjs.org/lodash._createpadding/-/lodash._createpadding-3.6.1.tgz"
+ },
+ "directories": {},
+ "_resolved": "https://registry.npmjs.org/lodash._createpadding/-/lodash._createpadding-3.6.1.tgz",
+ "readme": "ERROR: No README data found!"
+}
diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/node_modules/core-util-is/LICENSE b/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/node_modules/core-util-is/LICENSE
new file mode 100644
index 00000000000000..d8d7f9437dbf5a
--- /dev/null
+++ b/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/node_modules/core-util-is/LICENSE
@@ -0,0 +1,19 @@
+Copyright Node.js contributors. 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/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/node_modules/core-util-is/lib/util.js b/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/node_modules/core-util-is/lib/util.js
index 9074e8ebcb61e9..ff4c851c075a2f 100644
--- a/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/node_modules/core-util-is/lib/util.js
+++ b/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/node_modules/core-util-is/lib/util.js
@@ -21,8 +21,12 @@
// NOTE: These type checking functions intentionally don't use `instanceof`
// because it is fragile and can be easily faked with `Object.create()`.
-function isArray(ar) {
- return Array.isArray(ar);
+
+function isArray(arg) {
+ if (Array.isArray) {
+ return Array.isArray(arg);
+ }
+ return objectToString(arg) === '[object Array]';
}
exports.isArray = isArray;
@@ -62,7 +66,7 @@ function isUndefined(arg) {
exports.isUndefined = isUndefined;
function isRegExp(re) {
- return isObject(re) && objectToString(re) === '[object RegExp]';
+ return objectToString(re) === '[object RegExp]';
}
exports.isRegExp = isRegExp;
@@ -72,13 +76,12 @@ function isObject(arg) {
exports.isObject = isObject;
function isDate(d) {
- return isObject(d) && objectToString(d) === '[object Date]';
+ return objectToString(d) === '[object Date]';
}
exports.isDate = isDate;
function isError(e) {
- return isObject(e) &&
- (objectToString(e) === '[object Error]' || e instanceof Error);
+ return (objectToString(e) === '[object Error]' || e instanceof Error);
}
exports.isError = isError;
@@ -97,11 +100,8 @@ function isPrimitive(arg) {
}
exports.isPrimitive = isPrimitive;
-function isBuffer(arg) {
- return Buffer.isBuffer(arg);
-}
-exports.isBuffer = isBuffer;
+exports.isBuffer = Buffer.isBuffer;
function objectToString(o) {
return Object.prototype.toString.call(o);
-}
\ No newline at end of file
+}
diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/node_modules/core-util-is/package.json b/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/node_modules/core-util-is/package.json
index 466dfdfe0139b3..83e519e7b464a5 100644
--- a/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/node_modules/core-util-is/package.json
+++ b/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/node_modules/core-util-is/package.json
@@ -1,6 +1,6 @@
{
"name": "core-util-is",
- "version": "1.0.1",
+ "version": "1.0.2",
"description": "The `util.is*` functions introduced in Node v0.12.",
"main": "lib/util.js",
"repository": {
@@ -27,27 +27,17 @@
"bugs": {
"url": "https://github.com/isaacs/core-util-is/issues"
},
- "readme": "# core-util-is\n\nThe `util.is*` functions introduced in Node v0.12.\n",
- "readmeFilename": "README.md",
- "homepage": "https://github.com/isaacs/core-util-is",
- "_id": "core-util-is@1.0.1",
- "dist": {
- "shasum": "6b07085aef9a3ccac6ee53bf9d3df0c1521a5538",
- "tarball": "http://registry.npmjs.org/core-util-is/-/core-util-is-1.0.1.tgz"
+ "scripts": {
+ "test": "tap test.js"
},
- "_from": "core-util-is@>=1.0.0 <1.1.0",
- "_npmVersion": "1.3.23",
- "_npmUser": {
- "name": "isaacs",
- "email": "i@izs.me"
+ "devDependencies": {
+ "tap": "^2.3.0"
},
- "maintainers": [
- {
- "name": "isaacs",
- "email": "i@izs.me"
- }
- ],
- "directories": {},
- "_shasum": "6b07085aef9a3ccac6ee53bf9d3df0c1521a5538",
- "_resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.1.tgz"
+ "readme": "# core-util-is\n\nThe `util.is*` functions introduced in Node v0.12.\n",
+ "readmeFilename": "README.md",
+ "homepage": "https://github.com/isaacs/core-util-is#readme",
+ "_id": "core-util-is@1.0.2",
+ "_shasum": "b5fd54220aa2bc5ab57aab7140c940754503c1a7",
+ "_resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz",
+ "_from": "core-util-is@>=1.0.0 <1.1.0"
}
diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/node_modules/core-util-is/test.js b/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/node_modules/core-util-is/test.js
new file mode 100644
index 00000000000000..1a490c65ac8b5d
--- /dev/null
+++ b/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/node_modules/core-util-is/test.js
@@ -0,0 +1,68 @@
+var assert = require('tap');
+
+var t = require('./lib/util');
+
+assert.equal(t.isArray([]), true);
+assert.equal(t.isArray({}), false);
+
+assert.equal(t.isBoolean(null), false);
+assert.equal(t.isBoolean(true), true);
+assert.equal(t.isBoolean(false), true);
+
+assert.equal(t.isNull(null), true);
+assert.equal(t.isNull(undefined), false);
+assert.equal(t.isNull(false), false);
+assert.equal(t.isNull(), false);
+
+assert.equal(t.isNullOrUndefined(null), true);
+assert.equal(t.isNullOrUndefined(undefined), true);
+assert.equal(t.isNullOrUndefined(false), false);
+assert.equal(t.isNullOrUndefined(), true);
+
+assert.equal(t.isNumber(null), false);
+assert.equal(t.isNumber('1'), false);
+assert.equal(t.isNumber(1), true);
+
+assert.equal(t.isString(null), false);
+assert.equal(t.isString('1'), true);
+assert.equal(t.isString(1), false);
+
+assert.equal(t.isSymbol(null), false);
+assert.equal(t.isSymbol('1'), false);
+assert.equal(t.isSymbol(1), false);
+assert.equal(t.isSymbol(Symbol()), true);
+
+assert.equal(t.isUndefined(null), false);
+assert.equal(t.isUndefined(undefined), true);
+assert.equal(t.isUndefined(false), false);
+assert.equal(t.isUndefined(), true);
+
+assert.equal(t.isRegExp(null), false);
+assert.equal(t.isRegExp('1'), false);
+assert.equal(t.isRegExp(new RegExp()), true);
+
+assert.equal(t.isObject({}), true);
+assert.equal(t.isObject([]), true);
+assert.equal(t.isObject(new RegExp()), true);
+assert.equal(t.isObject(new Date()), true);
+
+assert.equal(t.isDate(null), false);
+assert.equal(t.isDate('1'), false);
+assert.equal(t.isDate(new Date()), true);
+
+assert.equal(t.isError(null), false);
+assert.equal(t.isError({ err: true }), false);
+assert.equal(t.isError(new Error()), true);
+
+assert.equal(t.isFunction(null), false);
+assert.equal(t.isFunction({ }), false);
+assert.equal(t.isFunction(function() {}), true);
+
+assert.equal(t.isPrimitive(null), true);
+assert.equal(t.isPrimitive(''), true);
+assert.equal(t.isPrimitive(0), true);
+assert.equal(t.isPrimitive(new Date()), false);
+
+assert.equal(t.isBuffer(null), false);
+assert.equal(t.isBuffer({}), false);
+assert.equal(t.isBuffer(new Buffer(0)), true);
diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/node_modules/core-util-is/util.js b/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/node_modules/core-util-is/util.js
deleted file mode 100644
index 007fa10575636d..00000000000000
--- a/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/node_modules/core-util-is/util.js
+++ /dev/null
@@ -1,106 +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.
-
-// NOTE: These type checking functions intentionally don't use `instanceof`
-// because it is fragile and can be easily faked with `Object.create()`.
-function isArray(ar) {
- return Array.isArray(ar);
-}
-exports.isArray = isArray;
-
-function isBoolean(arg) {
- return typeof arg === 'boolean';
-}
-exports.isBoolean = isBoolean;
-
-function isNull(arg) {
- return arg === null;
-}
-exports.isNull = isNull;
-
-function isNullOrUndefined(arg) {
- return arg == null;
-}
-exports.isNullOrUndefined = isNullOrUndefined;
-
-function isNumber(arg) {
- return typeof arg === 'number';
-}
-exports.isNumber = isNumber;
-
-function isString(arg) {
- return typeof arg === 'string';
-}
-exports.isString = isString;
-
-function isSymbol(arg) {
- return typeof arg === 'symbol';
-}
-exports.isSymbol = isSymbol;
-
-function isUndefined(arg) {
- return arg === void 0;
-}
-exports.isUndefined = isUndefined;
-
-function isRegExp(re) {
- return isObject(re) && objectToString(re) === '[object RegExp]';
-}
-exports.isRegExp = isRegExp;
-
-function isObject(arg) {
- return typeof arg === 'object' && arg !== null;
-}
-exports.isObject = isObject;
-
-function isDate(d) {
- return isObject(d) && objectToString(d) === '[object Date]';
-}
-exports.isDate = isDate;
-
-function isError(e) {
- return isObject(e) && objectToString(e) === '[object Error]';
-}
-exports.isError = isError;
-
-function isFunction(arg) {
- return typeof arg === 'function';
-}
-exports.isFunction = isFunction;
-
-function isPrimitive(arg) {
- return arg === null ||
- typeof arg === 'boolean' ||
- typeof arg === 'number' ||
- typeof arg === 'string' ||
- typeof arg === 'symbol' || // ES6 symbol
- typeof arg === 'undefined';
-}
-exports.isPrimitive = isPrimitive;
-
-function isBuffer(arg) {
- return arg instanceof Buffer;
-}
-exports.isBuffer = isBuffer;
-
-function objectToString(o) {
- return Object.prototype.toString.call(o);
-}
diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/node_modules/process-nextick-args/.travis.yml b/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/node_modules/process-nextick-args/.travis.yml
index 5ac98855343cee..36201b10017a5e 100644
--- a/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/node_modules/process-nextick-args/.travis.yml
+++ b/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/node_modules/process-nextick-args/.travis.yml
@@ -4,4 +4,9 @@ node_js:
- "0.10"
- "0.11"
- "0.12"
- - "iojs"
+ - "1.7.1"
+ - 1
+ - 2
+ - 3
+ - 4
+ - 5
diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/node_modules/process-nextick-args/index.js b/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/node_modules/process-nextick-args/index.js
index 049521cad7ba1b..571c276783c779 100644
--- a/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/node_modules/process-nextick-args/index.js
+++ b/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/node_modules/process-nextick-args/index.js
@@ -1,5 +1,12 @@
'use strict';
-module.exports = nextTick;
+
+if (!process.version ||
+ process.version.indexOf('v0.') === 0 ||
+ process.version.indexOf('v1.') === 0 && process.version.indexOf('v1.8.') !== 0) {
+ module.exports = nextTick;
+} else {
+ module.exports = process.nextTick;
+}
function nextTick(fn) {
var args = new Array(arguments.length - 1);
diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/node_modules/process-nextick-args/package.json b/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/node_modules/process-nextick-args/package.json
index 087586e8f8cedd..4019a28addcd88 100644
--- a/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/node_modules/process-nextick-args/package.json
+++ b/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/node_modules/process-nextick-args/package.json
@@ -1,6 +1,6 @@
{
"name": "process-nextick-args",
- "version": "1.0.3",
+ "version": "1.0.6",
"description": "process.nextTick but always with args",
"main": "index.js",
"scripts": {
@@ -19,19 +19,19 @@
"devDependencies": {
"tap": "~0.2.6"
},
- "gitHead": "e855846a69662b9489f1ad3dde1ebf2ccc4370b8",
- "_id": "process-nextick-args@1.0.3",
- "_shasum": "e272eed825d5e9f4ea74d8d73b1fe311c3beb630",
+ "gitHead": "e85787b05a8c3c1adb714f332d822e9162699c78",
+ "_id": "process-nextick-args@1.0.6",
+ "_shasum": "0f96b001cea90b12592ce566edb97ec11e69bd05",
"_from": "process-nextick-args@>=1.0.0 <1.1.0",
- "_npmVersion": "2.9.0",
- "_nodeVersion": "2.5.0",
+ "_npmVersion": "2.14.4",
+ "_nodeVersion": "4.1.1",
"_npmUser": {
"name": "cwmma",
"email": "calvin.metcalf@gmail.com"
},
"dist": {
- "shasum": "e272eed825d5e9f4ea74d8d73b1fe311c3beb630",
- "tarball": "http://registry.npmjs.org/process-nextick-args/-/process-nextick-args-1.0.3.tgz"
+ "shasum": "0f96b001cea90b12592ce566edb97ec11e69bd05",
+ "tarball": "http://registry.npmjs.org/process-nextick-args/-/process-nextick-args-1.0.6.tgz"
},
"maintainers": [
{
@@ -40,6 +40,6 @@
}
],
"directories": {},
- "_resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-1.0.3.tgz",
+ "_resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-1.0.6.tgz",
"readme": "ERROR: No README data found!"
}
diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/node_modules/string_decoder/package.json b/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/node_modules/string_decoder/package.json
index 0364d54ba46af6..ee70702359198d 100644
--- a/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/node_modules/string_decoder/package.json
+++ b/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/node_modules/string_decoder/package.json
@@ -22,33 +22,13 @@
"browserify"
],
"license": "MIT",
- "gitHead": "d46d4fd87cf1d06e031c23f1ba170ca7d4ade9a0",
+ "readme": "**string_decoder.js** (`require('string_decoder')`) from Node.js core\n\nCopyright Joyent, Inc. and other Node contributors. See LICENCE file for details.\n\nVersion numbers match the versions found in Node core, e.g. 0.10.24 matches Node 0.10.24, likewise 0.11.10 matches Node 0.11.10. **Prefer the stable version over the unstable.**\n\nThe *build/* directory contains a build script that will scrape the source from the [joyent/node](https://github.com/joyent/node) repo given a specific Node version.",
+ "readmeFilename": "README.md",
"bugs": {
"url": "https://github.com/rvagg/string_decoder/issues"
},
"_id": "string_decoder@0.10.31",
"_shasum": "62e203bc41766c6c28c9fc84301dab1c5310fa94",
- "_from": "string_decoder@>=0.10.0 <0.11.0",
- "_npmVersion": "1.4.23",
- "_npmUser": {
- "name": "rvagg",
- "email": "rod@vagg.org"
- },
- "maintainers": [
- {
- "name": "substack",
- "email": "mail@substack.net"
- },
- {
- "name": "rvagg",
- "email": "rod@vagg.org"
- }
- ],
- "dist": {
- "shasum": "62e203bc41766c6c28c9fc84301dab1c5310fa94",
- "tarball": "http://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz"
- },
- "directories": {},
"_resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz",
- "readme": "ERROR: No README data found!"
+ "_from": "string_decoder@>=0.10.0 <0.11.0"
}
diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/node_modules/util-deprecate/package.json b/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/node_modules/util-deprecate/package.json
index ae0c70f6c633f1..f68d8bb958657f 100644
--- a/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/node_modules/util-deprecate/package.json
+++ b/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/node_modules/util-deprecate/package.json
@@ -28,27 +28,10 @@
"url": "https://github.com/TooTallNate/util-deprecate/issues"
},
"homepage": "https://github.com/TooTallNate/util-deprecate",
- "gitHead": "475fb6857cd23fafff20c1be846c1350abf8e6d4",
+ "readme": "util-deprecate\n==============\n### The Node.js `util.deprecate()` function with browser support\n\nIn Node.js, this module simply re-exports the `util.deprecate()` function.\n\nIn the web browser (i.e. via browserify), a browser-specific implementation\nof the `util.deprecate()` function is used.\n\n\n## API\n\nA `deprecate()` function is the only thing exposed by this module.\n\n``` javascript\n// setup:\nexports.foo = deprecate(foo, 'foo() is deprecated, use bar() instead');\n\n\n// users see:\nfoo();\n// foo() is deprecated, use bar() instead\nfoo();\nfoo();\n```\n\n\n## License\n\n(The MIT License)\n\nCopyright (c) 2014 Nathan Rajlich \n\nPermission is hereby granted, free of charge, to any person\nobtaining a copy of this software and associated documentation\nfiles (the \"Software\"), to deal in the Software without\nrestriction, including without limitation the rights to use,\ncopy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the\nSoftware is furnished to do so, subject to the following\nconditions:\n\nThe above copyright notice and this permission notice shall be\nincluded in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\nEXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\nOF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\nNONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT\nHOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,\nWHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\nFROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR\nOTHER DEALINGS IN THE SOFTWARE.\n",
+ "readmeFilename": "README.md",
"_id": "util-deprecate@1.0.2",
"_shasum": "450d4dc9fa70de732762fbd2d4a28981419a0ccf",
- "_from": "util-deprecate@>=1.0.1 <1.1.0",
- "_npmVersion": "2.14.4",
- "_nodeVersion": "4.1.2",
- "_npmUser": {
- "name": "tootallnate",
- "email": "nathan@tootallnate.net"
- },
- "maintainers": [
- {
- "name": "tootallnate",
- "email": "nathan@tootallnate.net"
- }
- ],
- "dist": {
- "shasum": "450d4dc9fa70de732762fbd2d4a28981419a0ccf",
- "tarball": "http://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz"
- },
- "directories": {},
"_resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz",
- "readme": "ERROR: No README data found!"
+ "_from": "util-deprecate@>=1.0.1 <1.1.0"
}
diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/package.json b/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/package.json
index 248dbac49b9131..c0698efcb36108 100644
--- a/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/package.json
+++ b/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/package.json
@@ -34,43 +34,14 @@
"util": false
},
"license": "MIT",
- "gitHead": "f2a4f4a659bacbe742a494b7d2aede64fab0d4f9",
+ "readme": "# readable-stream\n\n***Node-core streams for userland*** [![Build Status](https://travis-ci.org/nodejs/readable-stream.svg?branch=master)](https://travis-ci.org/nodejs/readable-stream)\n\n\n[![NPM](https://nodei.co/npm/readable-stream.png?downloads=true&downloadRank=true)](https://nodei.co/npm/readable-stream/)\n[![NPM](https://nodei.co/npm-dl/readable-stream.png?&months=6&height=3)](https://nodei.co/npm/readable-stream/)\n\n\n[![Sauce Test Status](https://saucelabs.com/browser-matrix/readable-stream.svg)](https://saucelabs.com/u/readable-stream)\n\n```bash\nnpm install --save readable-stream\n```\n\n***Node-core streams for userland***\n\nThis package is a mirror of the Streams2 and Streams3 implementations in\nNode-core, including [documentation](doc/stream.markdown).\n\nIf you want to guarantee a stable streams base, regardless of what version of\nNode you, or the users of your libraries are using, use **readable-stream** *only* and avoid the *\"stream\"* module in Node-core, for background see [this blogpost](http://r.va.gg/2014/06/why-i-dont-use-nodes-core-stream-module.html).\n\nAs of version 2.0.0 **readable-stream** uses semantic versioning. \n\n# Streams WG Team Members\n\n* **Chris Dickinson** ([@chrisdickinson](https://github.com/chrisdickinson)) <christopher.s.dickinson@gmail.com>\n - Release GPG key: 9554F04D7259F04124DE6B476D5A82AC7E37093B\n* **Calvin Metcalf** ([@calvinmetcalf](https://github.com/calvinmetcalf)) <calvin.metcalf@gmail.com>\n - Release GPG key: F3EF5F62A87FC27A22E643F714CE4FF5015AA242\n* **Rod Vagg** ([@rvagg](https://github.com/rvagg)) <rod@vagg.org>\n - Release GPG key: DD8F2338BAE7501E3DD5AC78C273792F7D83545D\n* **Sam Newman** ([@sonewman](https://github.com/sonewman)) <newmansam@outlook.com>\n* **Mathias Buus** ([@mafintosh](https://github.com/mafintosh)) <mathiasbuus@gmail.com>\n* **Domenic Denicola** ([@domenic](https://github.com/domenic)) <d@domenic.me>\n",
+ "readmeFilename": "README.md",
"bugs": {
"url": "https://github.com/nodejs/readable-stream/issues"
},
"homepage": "https://github.com/nodejs/readable-stream#readme",
"_id": "readable-stream@2.0.4",
"_shasum": "2523ef27ffa339d7ba9da8603f2d0599d06edbd8",
- "_from": "readable-stream@>=2.0.0 <2.1.0",
- "_npmVersion": "2.14.4",
- "_nodeVersion": "4.1.1",
- "_npmUser": {
- "name": "cwmma",
- "email": "calvin.metcalf@gmail.com"
- },
- "dist": {
- "shasum": "2523ef27ffa339d7ba9da8603f2d0599d06edbd8",
- "tarball": "http://registry.npmjs.org/readable-stream/-/readable-stream-2.0.4.tgz"
- },
- "maintainers": [
- {
- "name": "isaacs",
- "email": "isaacs@npmjs.com"
- },
- {
- "name": "tootallnate",
- "email": "nathan@tootallnate.net"
- },
- {
- "name": "rvagg",
- "email": "rod@vagg.org"
- },
- {
- "name": "cwmma",
- "email": "calvin.metcalf@gmail.com"
- }
- ],
- "directories": {},
"_resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.0.4.tgz",
- "readme": "ERROR: No README data found!"
+ "_from": "readable-stream@>=2.0.0 <2.1.0"
}
diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/typedarray/package.json b/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/typedarray/package.json
index b8b59f5c303991..f946a953af73c6 100644
--- a/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/typedarray/package.json
+++ b/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/typedarray/package.json
@@ -52,28 +52,13 @@
"android-browser/4.2..latest"
]
},
+ "readme": "# typedarray\n\nTypedArray polyfill ripped from [this\nmodule](https://raw.github.com/inexorabletash/polyfill).\n\n[![build status](https://secure.travis-ci.org/substack/typedarray.png)](http://travis-ci.org/substack/typedarray)\n\n[![testling badge](https://ci.testling.com/substack/typedarray.png)](https://ci.testling.com/substack/typedarray)\n\n# example\n\n``` js\nvar Uint8Array = require('typedarray').Uint8Array;\nvar ua = new Uint8Array(5);\nua[1] = 256 + 55;\nconsole.log(ua[1]);\n```\n\noutput:\n\n```\n55\n```\n\n# methods\n\n``` js\nvar TA = require('typedarray')\n```\n\nThe `TA` object has the following constructors:\n\n* TA.ArrayBuffer\n* TA.DataView\n* TA.Float32Array\n* TA.Float64Array\n* TA.Int8Array\n* TA.Int16Array\n* TA.Int32Array\n* TA.Uint8Array\n* TA.Uint8ClampedArray\n* TA.Uint16Array\n* TA.Uint32Array\n\n# install\n\nWith [npm](https://npmjs.org) do:\n\n```\nnpm install typedarray\n```\n\nTo use this module in the browser, compile with\n[browserify](http://browserify.org)\nor download a UMD build from browserify CDN:\n\nhttp://wzrd.in/standalone/typedarray@latest\n\n# license\n\nMIT\n",
+ "readmeFilename": "readme.markdown",
"bugs": {
"url": "https://github.com/substack/typedarray/issues"
},
"_id": "typedarray@0.0.6",
- "dist": {
- "shasum": "867ac74e3864187b1d3d47d996a78ec5c8830777",
- "tarball": "http://registry.npmjs.org/typedarray/-/typedarray-0.0.6.tgz"
- },
- "_from": "typedarray@>=0.0.5 <0.1.0",
- "_npmVersion": "1.4.3",
- "_npmUser": {
- "name": "substack",
- "email": "mail@substack.net"
- },
- "maintainers": [
- {
- "name": "substack",
- "email": "mail@substack.net"
- }
- ],
- "directories": {},
"_shasum": "867ac74e3864187b1d3d47d996a78ec5c8830777",
"_resolved": "https://registry.npmjs.org/typedarray/-/typedarray-0.0.6.tgz",
- "readme": "ERROR: No README data found!"
+ "_from": "typedarray@>=0.0.5 <0.1.0"
}
diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/package.json b/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/package.json
index 5a3f8b401e4449..53820bc0b2ce94 100644
--- a/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/package.json
+++ b/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/package.json
@@ -54,28 +54,11 @@
"android-browser/4.2..latest"
]
},
- "gitHead": "522adc12d82f57c691a5f946fbc8ba08718dcdcb",
+ "readme": "# concat-stream\n\nWritable stream that concatenates all the data from a stream and calls a callback with the result. Use this when you want to collect all the data from a stream into a single buffer.\n\n[![Build Status](https://travis-ci.org/maxogden/concat-stream.svg?branch=master)](https://travis-ci.org/maxogden/concat-stream)\n\n[![NPM](https://nodei.co/npm/concat-stream.png)](https://nodei.co/npm/concat-stream/)\n\n### description\n\nStreams emit many buffers. If you want to collect all of the buffers, and when the stream ends concatenate all of the buffers together and receive a single buffer then this is the module for you.\n\nOnly use this if you know you can fit all of the output of your stream into a single Buffer (e.g. in RAM).\n\nThere are also `objectMode` streams that emit things other than Buffers, and you can concatenate these too. See below for details.\n\n## Related\n\n`stream-each` is part of the [mississippi stream utility collection](https://github.com/maxogden/mississippi) which includes more useful stream modules similar to this one.\n\n### examples\n\n#### Buffers\n\n```js\nvar fs = require('fs')\nvar concat = require('concat-stream')\n\nvar readStream = fs.createReadStream('cat.png')\nvar concatStream = concat(gotPicture)\n\nreadStream.on('error', handleError)\nreadStream.pipe(concatStream)\n\nfunction gotPicture(imageBuffer) {\n // imageBuffer is all of `cat.png` as a node.js Buffer\n}\n\nfunction handleError(err) {\n // handle your error appropriately here, e.g.:\n console.error(err) // print the error to STDERR\n process.exit(1) // exit program with non-zero exit code\n}\n\n```\n\n#### Arrays\n\n```js\nvar write = concat(function(data) {})\nwrite.write([1,2,3])\nwrite.write([4,5,6])\nwrite.end()\n// data will be [1,2,3,4,5,6] in the above callback\n```\n\n#### Uint8Arrays\n\n```js\nvar write = concat(function(data) {})\nvar a = new Uint8Array(3)\na[0] = 97; a[1] = 98; a[2] = 99\nwrite.write(a)\nwrite.write('!')\nwrite.end(Buffer('!!1'))\n```\n\nSee `test/` for more examples\n\n# methods\n\n```js\nvar concat = require('concat-stream')\n```\n\n## var writable = concat(opts={}, cb)\n\nReturn a `writable` stream that will fire `cb(data)` with all of the data that\nwas written to the stream. Data can be written to `writable` as strings,\nBuffers, arrays of byte integers, and Uint8Arrays. \n\nBy default `concat-stream` will give you back the same data type as the type of the first buffer written to the stream. Use `opts.encoding` to set what format `data` should be returned as, e.g. if you if you don't want to rely on the built-in type checking or for some other reason.\n\n* `string` - get a string\n* `buffer` - get back a Buffer\n* `array` - get an array of byte integers\n* `uint8array`, `u8`, `uint8` - get back a Uint8Array\n* `object`, get back an array of Objects\n\nIf you don't specify an encoding, and the types can't be inferred (e.g. you write things that aren't in the list above), it will try to convert concat them into a `Buffer`.\n\n# error handling\n\n`concat-stream` does not handle errors for you, so you must handle errors on whatever streams you pipe into `concat-stream`. This is a general rule when programming with node.js streams: always handle errors on each and every stream. Since `concat-stream` is not itself a stream it does not emit errors.\n\nWe recommend using [`end-of-stream`](https://npmjs.org/end-of-stream) or [`pump`](https://npmjs.org/pump) for writing error tolerant stream code.\n\n# license\n\nMIT LICENSE\n",
+ "readmeFilename": "readme.md",
"homepage": "https://github.com/maxogden/concat-stream#readme",
"_id": "concat-stream@1.5.1",
"_shasum": "f3b80acf9e1f48e3875c0688b41b6c31602eea1c",
- "_from": "concat-stream@>=1.4.6 <2.0.0",
- "_npmVersion": "2.14.2",
- "_nodeVersion": "4.0.0",
- "_npmUser": {
- "name": "maxogden",
- "email": "max@maxogden.com"
- },
- "dist": {
- "shasum": "f3b80acf9e1f48e3875c0688b41b6c31602eea1c",
- "tarball": "http://registry.npmjs.org/concat-stream/-/concat-stream-1.5.1.tgz"
- },
- "maintainers": [
- {
- "name": "maxogden",
- "email": "max@maxogden.com"
- }
- ],
- "directories": {},
"_resolved": "https://registry.npmjs.org/concat-stream/-/concat-stream-1.5.1.tgz",
- "readme": "ERROR: No README data found!"
+ "_from": "concat-stream@>=1.4.6 <2.0.0"
}
diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/retry/.npmignore b/deps/npm/node_modules/npm-registry-client/node_modules/retry/.npmignore
new file mode 100644
index 00000000000000..e7726a071b7f39
--- /dev/null
+++ b/deps/npm/node_modules/npm-registry-client/node_modules/retry/.npmignore
@@ -0,0 +1,2 @@
+/node_modules/*
+npm-debug.log
diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/retry/License b/deps/npm/node_modules/npm-registry-client/node_modules/retry/License
new file mode 100644
index 00000000000000..0b58de379fb308
--- /dev/null
+++ b/deps/npm/node_modules/npm-registry-client/node_modules/retry/License
@@ -0,0 +1,21 @@
+Copyright (c) 2011:
+Tim Koschützki (tim@debuggable.com)
+Felix Geisendörfer (felix@debuggable.com)
+
+ Permission is hereby granted, free of charge, to any person obtaining a copy
+ of this software and associated documentation files (the "Software"), to deal
+ in the Software without restriction, including without limitation the rights
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ copies of the Software, and to permit persons to whom the Software is
+ furnished to do so, subject to the following conditions:
+
+ The above copyright notice and this permission notice shall be included in
+ all copies or substantial portions of the Software.
+
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ THE SOFTWARE.
diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/retry/Makefile b/deps/npm/node_modules/npm-registry-client/node_modules/retry/Makefile
new file mode 100644
index 00000000000000..98e7167bbe359f
--- /dev/null
+++ b/deps/npm/node_modules/npm-registry-client/node_modules/retry/Makefile
@@ -0,0 +1,21 @@
+SHELL := /bin/bash
+
+test:
+ @node test/runner.js
+
+release-major: test
+ npm version major -m "Release %s"
+ git push
+ npm publish
+
+release-minor: test
+ npm version minor -m "Release %s"
+ git push
+ npm publish
+
+release-patch: test
+ npm version patch -m "Release %s"
+ git push
+ npm publish
+
+.PHONY: test
diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/retry/README.md b/deps/npm/node_modules/npm-registry-client/node_modules/retry/README.md
new file mode 100644
index 00000000000000..09d9c8a81bf121
--- /dev/null
+++ b/deps/npm/node_modules/npm-registry-client/node_modules/retry/README.md
@@ -0,0 +1,195 @@
+# retry
+
+Abstraction for exponential and custom retry strategies for failed operations.
+
+## Installation
+
+ npm install retry
+
+## Current Status
+
+This module has been tested and is ready to be used.
+
+## Tutorial
+
+The example below will retry a potentially failing `dns.resolve` operation
+`10` times using an exponential backoff strategy. With the default settings, this
+means the last attempt is made after `17 minutes and 3 seconds`.
+
+``` javascript
+var dns = require('dns');
+var retry = require('retry');
+
+function faultTolerantResolve(address, cb) {
+ var operation = retry.operation();
+
+ operation.attempt(function(currentAttempt) {
+ dns.resolve(address, function(err, addresses) {
+ if (operation.retry(err)) {
+ return;
+ }
+
+ cb(err ? operation.mainError() : null, addresses);
+ });
+ });
+}
+
+faultTolerantResolve('nodejs.org', function(err, addresses) {
+ console.log(err, addresses);
+});
+```
+
+Of course you can also configure the factors that go into the exponential
+backoff. See the API documentation below for all available settings.
+currentAttempt is an int representing the number of attempts so far.
+
+``` javascript
+var operation = retry.operation({
+ retries: 5,
+ factor: 3,
+ minTimeout: 1 * 1000,
+ maxTimeout: 60 * 1000,
+ randomize: true,
+});
+```
+
+## API
+
+### retry.operation([options])
+
+Creates a new `RetryOperation` object. See the `retry.timeouts()` function
+below for available `options`.
+
+### retry.timeouts([options])
+
+Returns an array of timeouts. All time `options` and return values are in
+milliseconds. If `options` is an array, a copy of that array is returned.
+
+`options` is a JS object that can contain any of the following keys:
+
+* `retries`: The maximum amount of times to retry the operation. Default is `10`.
+* `factor`: The exponential factor to use. Default is `2`.
+* `minTimeout`: The number of milliseconds before starting the first retry. Default is `1000`.
+* `maxTimeout`: The maximum number of milliseconds between two retries. Default is `Infinity`.
+* `randomize`: Randomizes the timeouts by multiplying with a factor between `1` to `2`. Default is `false`.
+
+The formula used to calculate the individual timeouts is:
+
+```
+var Math.min(random * minTimeout * Math.pow(factor, attempt), maxTimeout);
+```
+
+Have a look at [this article][article] for a better explanation of approach.
+
+If you want to tune your `factor` / `times` settings to attempt the last retry
+after a certain amount of time, you can use wolfram alpha. For example in order
+to tune for `10` attempts in `5 minutes`, you can use this equation:
+
+![screenshot](https://github.com/tim-kos/node-retry/raw/master/equation.gif)
+
+Explaining the various values from left to right:
+
+* `k = 0 ... 9`: The `retries` value (10)
+* `1000`: The `minTimeout` value in ms (1000)
+* `x^k`: No need to change this, `x` will be your resulting factor
+* `5 * 60 * 1000`: The desired total amount of time for retrying in ms (5 minutes)
+
+To make this a little easier for you, use wolfram alpha to do the calculations:
+
+
+
+[article]: http://dthain.blogspot.com/2009/02/exponential-backoff-in-distributed.html
+
+### retry.createTimeout(attempt, opts)
+
+Returns a new `timeout` (integer in milliseconds) based on the given parameters.
+
+`attempt` is an integer representing for which retry the timeout should be calculated. If your retry operation was executed 4 times you had one attempt and 3 retries. If you then want to calculate a new timeout, you should set `attempt` to 4 (attempts are zero-indexed).
+
+`opts` can include `factor`, `minTimeout`, `randomize` (boolean) and `maxTimeout`. They are documented above.
+
+`retry.createTimeout()` is used internally by `retry.timeouts()` and is public for you to be able to create your own timeouts for reinserting an item, see [issue #13](https://github.com/tim-kos/node-retry/issues/13).
+
+### retry.wrap(obj, [options], [methodNames])
+
+Wrap all functions of the `obj` with retry. Optionally you can pass operation options and
+an array of method names which need to be wrapped.
+
+```
+retry.wrap(obj)
+
+retry.wrap(obj, ['method1', 'method2']);
+
+retry.wrap(obj, {retries: 3});
+
+retry.wrap(obj, {retries: 3}, ['method1', 'method2']);
+```
+The `options` object can take any options that the usual call to `retry.operation` can take.
+
+### new RetryOperation(timeouts)
+
+Creates a new `RetryOperation` where `timeouts` is an array where each value is
+a timeout given in milliseconds.
+
+#### retryOperation.errors()
+
+Returns an array of all errors that have been passed to
+`retryOperation.retry()` so far.
+
+#### retryOperation.mainError()
+
+A reference to the error object that occured most frequently. Errors are
+compared using the `error.message` property.
+
+If multiple error messages occured the same amount of time, the last error
+object with that message is returned.
+
+If no errors occured so far, the value is `null`.
+
+#### retryOperation.attempt(fn, timeoutOps)
+
+Defines the function `fn` that is to be retried and executes it for the first
+time right away. The `fn` function can receive an optional `currentAttempt` callback that represents the number of attempts to execute `fn` so far.
+
+Optionally defines `timeoutOps` which is an object having a property `timeout` in miliseconds and a property `cb` callback function.
+Whenever your retry operation takes longer than `timeout` to execute, the timeout callback function `cb` is called.
+
+
+#### retryOperation.try(fn)
+
+This is an alias for `retryOperation.attempt(fn)`. This is deprecated.
+
+#### retryOperation.start(fn)
+
+This is an alias for `retryOperation.attempt(fn)`. This is deprecated.
+
+#### retryOperation.retry(error)
+
+Returns `false` when no `error` value is given, or the maximum amount of retries
+has been reached.
+
+Otherwise it returns `true`, and retries the operation after the timeout for
+the current attempt number.
+
+#### retryOperation.attempts()
+
+Returns an int representing the number of attempts it took to call `fn` before it was successful.
+
+## License
+
+retry is licensed under the MIT license.
+
+
+#Changelog
+
+0.7.0 Some bugfixes and made retry.createTimeout() public. Fixed issues [#10](https://github.com/tim-kos/node-retry/issues/10), [#12](https://github.com/tim-kos/node-retry/issues/12), and [#13](https://github.com/tim-kos/node-retry/issues/13).
+
+0.6.0 Introduced optional timeOps parameter for the attempt() function which is an object having a property timeout in miliseconds and a property cb callback function. Whenever your retry operation takes longer than timeout to execute, the timeout callback function cb is called.
+
+0.5.0 Some minor refactorings.
+
+0.4.0 Changed retryOperation.try() to retryOperation.attempt(). Deprecated the aliases start() and try() for it.
+
+0.3.0 Added retryOperation.start() which is an alias for retryOperation.try().
+
+0.2.0 Added attempts() function and parameter to retryOperation.try() representing the number of attempts it took to call fn().
diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/retry/equation.gif b/deps/npm/node_modules/npm-registry-client/node_modules/retry/equation.gif
new file mode 100644
index 00000000000000..97107237ba19f5
Binary files /dev/null and b/deps/npm/node_modules/npm-registry-client/node_modules/retry/equation.gif differ
diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/retry/example/dns.js b/deps/npm/node_modules/npm-registry-client/node_modules/retry/example/dns.js
new file mode 100644
index 00000000000000..d6351e9d05bb33
--- /dev/null
+++ b/deps/npm/node_modules/npm-registry-client/node_modules/retry/example/dns.js
@@ -0,0 +1,31 @@
+var dns = require('dns');
+var retry = require('../lib/retry');
+
+function faultTolerantResolve(address, cb) {
+ var opts = {
+ retries: 2,
+ factor: 2,
+ minTimeout: 1 * 1000,
+ maxTimeout: 2 * 1000,
+ randomize: true
+ };
+ var operation = retry.operation(opts);
+
+ operation.attempt(function(currentAttempt) {
+ dns.resolve(address, function(err, addresses) {
+ if (operation.retry(err)) {
+ return;
+ }
+
+ cb(operation.mainError(), operation.errors(), addresses);
+ });
+ });
+}
+
+faultTolerantResolve('nodejs.org', function(err, errors, addresses) {
+ console.warn('err:');
+ console.log(err);
+
+ console.warn('addresses:');
+ console.log(addresses);
+});
diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/retry/index.js b/deps/npm/node_modules/npm-registry-client/node_modules/retry/index.js
new file mode 100644
index 00000000000000..ee62f3a112c28b
--- /dev/null
+++ b/deps/npm/node_modules/npm-registry-client/node_modules/retry/index.js
@@ -0,0 +1 @@
+module.exports = require('./lib/retry');
\ No newline at end of file
diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/retry/lib/retry.js b/deps/npm/node_modules/npm-registry-client/node_modules/retry/lib/retry.js
new file mode 100644
index 00000000000000..94685652c426fd
--- /dev/null
+++ b/deps/npm/node_modules/npm-registry-client/node_modules/retry/lib/retry.js
@@ -0,0 +1,94 @@
+var RetryOperation = require('./retry_operation');
+
+exports.operation = function(options) {
+ var retryForever = false;
+ if (options && options.forever === true) retryForever = true;
+ var timeouts = exports.timeouts(options);
+ return new RetryOperation(timeouts, retryForever);
+};
+
+exports.timeouts = function(options) {
+ if (options instanceof Array) {
+ return [].concat(options);
+ }
+
+ var opts = {
+ retries: 10,
+ factor: 2,
+ minTimeout: 1 * 1000,
+ maxTimeout: Infinity,
+ randomize: false
+ };
+ for (var key in options) {
+ opts[key] = options[key];
+ }
+
+ if (opts.minTimeout > opts.maxTimeout) {
+ throw new Error('minTimeout is greater than maxTimeout');
+ }
+
+ var timeouts = [];
+ for (var i = 0; i < opts.retries; i++) {
+ timeouts.push(this.createTimeout(i, opts));
+ }
+
+ // sort the array numerically ascending
+ timeouts.sort(function(a,b) {
+ return a - b;
+ });
+
+ return timeouts;
+};
+
+exports.createTimeout = function(attempt, opts) {
+ var random = (opts.randomize)
+ ? (Math.random() + 1)
+ : 1;
+
+ var timeout = Math.round(random * opts.minTimeout * Math.pow(opts.factor, attempt));
+ timeout = Math.min(timeout, opts.maxTimeout);
+
+ return timeout;
+};
+
+exports.wrap = function(obj, options, methods) {
+ if (options instanceof Array) {
+ methods = options;
+ options = null;
+ }
+
+ if (!methods) {
+ methods = [];
+ for (var key in obj) {
+ if (typeof obj[key] === 'function') {
+ methods.push(key);
+ }
+ }
+ }
+
+ for (var i = 0; i < methods.length; i++) {
+ var method = methods[i];
+ var original = obj[method];
+
+ obj[method] = function retryWrapper() {
+ var op = exports.operation(options);
+ var args = Array.prototype.slice.call(arguments);
+ var callback = args.pop();
+
+ args.push(function(err) {
+ if (op.retry(err)) {
+ return;
+ }
+ if (err) {
+ arguments[0] = op.mainError();
+ }
+ callback.apply(this, arguments);
+ });
+
+ op.attempt(function() {
+ original.apply(obj, args);
+ });
+ };
+ obj[method].options = options;
+ }
+};
diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/retry/lib/retry_operation.js b/deps/npm/node_modules/npm-registry-client/node_modules/retry/lib/retry_operation.js
new file mode 100644
index 00000000000000..52b895544e6a58
--- /dev/null
+++ b/deps/npm/node_modules/npm-registry-client/node_modules/retry/lib/retry_operation.js
@@ -0,0 +1,120 @@
+function RetryOperation(timeouts, retryForever) {
+ this._timeouts = timeouts;
+ this._fn = null;
+ this._errors = [];
+ this._attempts = 1;
+ this._operationTimeout = null;
+ this._operationTimeoutCb = null;
+ this._timeout = null;
+
+ if (!!retryForever) {
+ this._cachedTimeouts = this._timeouts.slice(0);
+ }
+}
+module.exports = RetryOperation;
+
+RetryOperation.prototype.retry = function(err) {
+ if (this._timeout) {
+ clearTimeout(this._timeout);
+ }
+
+ if (!err) {
+ return false;
+ }
+
+ this._errors.push(err);
+
+ var timeout = this._timeouts.shift();
+ if (timeout === undefined) {
+ if (this._cachedTimeouts) {
+ // retry forever, only keep last error
+ this._errors.splice(this._errors.length - 1, this._errors.length);
+ this._timeouts = this._cachedTimeouts.slice(0);
+ timeout = this._timeouts.shift();
+ } else {
+ return false;
+ }
+ }
+
+ var self = this;
+ setTimeout(function() {
+ self._attempts++;
+
+ if (self._operationTimeoutCb) {
+ self._timeout = setTimeout(function() {
+ self._operationTimeoutCb(self._attempts);
+ }, self._operationTimeout);
+ }
+
+ self._fn(self._attempts);
+ }, timeout);
+
+ return true;
+};
+
+RetryOperation.prototype.attempt = function(fn, timeoutOps) {
+ this._fn = fn;
+
+ if (timeoutOps) {
+ if (timeoutOps.timeout) {
+ this._operationTimeout = timeoutOps.timeout;
+ }
+ if (timeoutOps.cb) {
+ this._operationTimeoutCb = timeoutOps.cb;
+ }
+ }
+
+ var self = this;
+ if (this._operationTimeoutCb) {
+ this._timeout = setTimeout(function() {
+ self._operationTimeoutCb();
+ }, self._operationTimeout);
+ }
+
+ this._fn(this._attempts);
+};
+
+RetryOperation.prototype.try = function(fn) {
+ console.log('Using RetryOperation.try() is deprecated');
+ this.attempt(fn);
+};
+
+RetryOperation.prototype.start = function(fn) {
+ console.log('Using RetryOperation.start() is deprecated');
+ this.attempt(fn);
+};
+
+RetryOperation.prototype.start = RetryOperation.prototype.try;
+
+RetryOperation.prototype.errors = function() {
+ return this._errors;
+};
+
+RetryOperation.prototype.attempts = function() {
+ return this._attempts;
+};
+
+RetryOperation.prototype.mainError = function() {
+ if (this._errors.length === 0) {
+ return null;
+ }
+
+ var counts = {};
+ var mainError = null;
+ var mainErrorCount = 0;
+
+ for (var i = 0; i < this._errors.length; i++) {
+ var error = this._errors[i];
+ var message = error.message;
+ var count = (counts[message] || 0) + 1;
+
+ counts[message] = count;
+
+ if (count >= mainErrorCount) {
+ mainError = error;
+ mainErrorCount = count;
+ }
+ }
+
+ return mainError;
+};
diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/retry/package.json b/deps/npm/node_modules/npm-registry-client/node_modules/retry/package.json
new file mode 100644
index 00000000000000..dea2f3b175605c
--- /dev/null
+++ b/deps/npm/node_modules/npm-registry-client/node_modules/retry/package.json
@@ -0,0 +1,54 @@
+{
+ "author": {
+ "name": "Tim Koschützki",
+ "email": "tim@debuggable.com",
+ "url": "http://debuggable.com/"
+ },
+ "name": "retry",
+ "description": "Abstraction for exponential and custom retry strategies for failed operations.",
+ "license": "MIT",
+ "version": "0.8.0",
+ "homepage": "https://github.com/tim-kos/node-retry",
+ "repository": {
+ "type": "git",
+ "url": "git://github.com/tim-kos/node-retry.git"
+ },
+ "directories": {
+ "lib": "./lib"
+ },
+ "main": "index",
+ "engines": {
+ "node": "*"
+ },
+ "dependencies": {},
+ "devDependencies": {
+ "fake": "0.2.0",
+ "far": "0.0.1"
+ },
+ "gitHead": "9446e803d6a41ae08732a4a215ae5bf1ff1ccfdd",
+ "bugs": {
+ "url": "https://github.com/tim-kos/node-retry/issues"
+ },
+ "_id": "retry@0.8.0",
+ "scripts": {},
+ "_shasum": "2367628dc0edb247b1eab649dc53ac8628ac2d5f",
+ "_from": "retry@>=0.8.0 <0.9.0",
+ "_npmVersion": "2.1.7",
+ "_nodeVersion": "0.10.33",
+ "_npmUser": {
+ "name": "tim-kos",
+ "email": "tim@debuggable.com"
+ },
+ "maintainers": [
+ {
+ "name": "tim-kos",
+ "email": "tim@debuggable.com"
+ }
+ ],
+ "dist": {
+ "shasum": "2367628dc0edb247b1eab649dc53ac8628ac2d5f",
+ "tarball": "http://registry.npmjs.org/retry/-/retry-0.8.0.tgz"
+ },
+ "_resolved": "https://registry.npmjs.org/retry/-/retry-0.8.0.tgz",
+ "readme": "ERROR: No README data found!"
+}
diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/retry/test/common.js b/deps/npm/node_modules/npm-registry-client/node_modules/retry/test/common.js
new file mode 100644
index 00000000000000..224720696ebac8
--- /dev/null
+++ b/deps/npm/node_modules/npm-registry-client/node_modules/retry/test/common.js
@@ -0,0 +1,10 @@
+var common = module.exports;
+var path = require('path');
+
+var rootDir = path.join(__dirname, '..');
+common.dir = {
+ lib: rootDir + '/lib'
+};
+
+common.assert = require('assert');
+common.fake = require('fake');
\ No newline at end of file
diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/retry/test/integration/test-retry-operation.js b/deps/npm/node_modules/npm-registry-client/node_modules/retry/test/integration/test-retry-operation.js
new file mode 100644
index 00000000000000..cecfa3b7310013
--- /dev/null
+++ b/deps/npm/node_modules/npm-registry-client/node_modules/retry/test/integration/test-retry-operation.js
@@ -0,0 +1,106 @@
+var common = require('../common');
+var assert = common.assert;
+var fake = common.fake.create();
+var retry = require(common.dir.lib + '/retry');
+
+(function testErrors() {
+ var operation = retry.operation();
+
+ var error = new Error('some error');
+ var error2 = new Error('some other error');
+ operation._errors.push(error);
+ operation._errors.push(error2);
+
+ assert.deepEqual(operation.errors(), [error, error2]);
+})();
+
+(function testMainErrorReturnsMostFrequentError() {
+ var operation = retry.operation();
+ var error = new Error('some error');
+ var error2 = new Error('some other error');
+
+ operation._errors.push(error);
+ operation._errors.push(error2);
+ operation._errors.push(error);
+
+ assert.strictEqual(operation.mainError(), error);
+})();
+
+(function testMainErrorReturnsLastErrorOnEqualCount() {
+ var operation = retry.operation();
+ var error = new Error('some error');
+ var error2 = new Error('some other error');
+
+ operation._errors.push(error);
+ operation._errors.push(error2);
+
+ assert.strictEqual(operation.mainError(), error2);
+})();
+
+(function testAttempt() {
+ var operation = retry.operation();
+ var fn = new Function();
+
+ var timeoutOpts = {
+ timeout: 1,
+ cb: function() {}
+ };
+ operation.attempt(fn, timeoutOpts);
+
+ assert.strictEqual(fn, operation._fn);
+ assert.strictEqual(timeoutOpts.timeout, operation._operationTimeout);
+ assert.strictEqual(timeoutOpts.cb, operation._operationTimeoutCb);
+})();
+
+(function testRetry() {
+ var times = 3;
+ var error = new Error('some error');
+ var operation = retry.operation([1, 2, 3]);
+ var attempts = 0;
+
+ var finalCallback = fake.callback('finalCallback');
+ fake.expectAnytime(finalCallback);
+
+ var fn = function() {
+ operation.attempt(function(currentAttempt) {
+ attempts++;
+ assert.equal(currentAttempt, attempts);
+ if (operation.retry(error)) {
+ return;
+ }
+
+ assert.strictEqual(attempts, 4);
+ assert.strictEqual(operation.attempts(), attempts);
+ assert.strictEqual(operation.mainError(), error);
+ finalCallback();
+ });
+ };
+
+ fn();
+})();
+
+(function testRetryForever() {
+ var error = new Error('some error');
+ var operation = retry.operation({ retries: 3, forever: true });
+ var attempts = 0;
+
+ var finalCallback = fake.callback('finalCallback');
+ fake.expectAnytime(finalCallback);
+
+ var fn = function() {
+ operation.attempt(function(currentAttempt) {
+ attempts++;
+ assert.equal(currentAttempt, attempts);
+ if (attempts !== 6 && operation.retry(error)) {
+ return;
+ }
+
+ assert.strictEqual(attempts, 6);
+ assert.strictEqual(operation.attempts(), attempts);
+ assert.strictEqual(operation.mainError(), error);
+ finalCallback();
+ });
+ };
+
+ fn();
+})();
diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/retry/test/integration/test-retry-wrap.js b/deps/npm/node_modules/npm-registry-client/node_modules/retry/test/integration/test-retry-wrap.js
new file mode 100644
index 00000000000000..7ca8bc7eb596b5
--- /dev/null
+++ b/deps/npm/node_modules/npm-registry-client/node_modules/retry/test/integration/test-retry-wrap.js
@@ -0,0 +1,77 @@
+var common = require('../common');
+var assert = common.assert;
+var fake = common.fake.create();
+var retry = require(common.dir.lib + '/retry');
+
+function getLib() {
+ return {
+ fn1: function() {},
+ fn2: function() {},
+ fn3: function() {}
+ };
+}
+
+(function wrapAll() {
+ var lib = getLib();
+ retry.wrap(lib);
+ assert.equal(lib.fn1.name, 'retryWrapper');
+ assert.equal(lib.fn2.name, 'retryWrapper');
+ assert.equal(lib.fn3.name, 'retryWrapper');
+}());
+
+(function wrapAllPassOptions() {
+ var lib = getLib();
+ retry.wrap(lib, {retries: 2});
+ assert.equal(lib.fn1.name, 'retryWrapper');
+ assert.equal(lib.fn2.name, 'retryWrapper');
+ assert.equal(lib.fn3.name, 'retryWrapper');
+ assert.equal(lib.fn1.options.retries, 2);
+ assert.equal(lib.fn2.options.retries, 2);
+ assert.equal(lib.fn3.options.retries, 2);
+}());
+
+(function wrapDefined() {
+ var lib = getLib();
+ retry.wrap(lib, ['fn2', 'fn3']);
+ assert.notEqual(lib.fn1.name, 'retryWrapper');
+ assert.equal(lib.fn2.name, 'retryWrapper');
+ assert.equal(lib.fn3.name, 'retryWrapper');
+}());
+
+(function wrapDefinedAndPassOptions() {
+ var lib = getLib();
+ retry.wrap(lib, {retries: 2}, ['fn2', 'fn3']);
+ assert.notEqual(lib.fn1.name, 'retryWrapper');
+ assert.equal(lib.fn2.name, 'retryWrapper');
+ assert.equal(lib.fn3.name, 'retryWrapper');
+ assert.equal(lib.fn2.options.retries, 2);
+ assert.equal(lib.fn3.options.retries, 2);
+}());
+
+(function runWrappedWithoutError() {
+ var callbackCalled;
+ var lib = {method: function(a, b, callback) {
+ assert.equal(a, 1);
+ assert.equal(b, 2);
+ assert.equal(typeof callback, 'function');
+ callback();
+ }};
+ retry.wrap(lib);
+ lib.method(1, 2, function() {
+ callbackCalled = true;
+ });
+ assert.ok(callbackCalled);
+}());
+
+(function runWrappedWithError() {
+ var callbackCalled;
+ var lib = {method: function(callback) {
+ callback(new Error('Some error'));
+ }};
+ retry.wrap(lib, {retries: 1});
+ lib.method(function(err) {
+ callbackCalled = true;
+ assert.ok(err instanceof Error);
+ });
+ assert.ok(!callbackCalled);
+}());
diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/retry/test/integration/test-timeouts.js b/deps/npm/node_modules/npm-registry-client/node_modules/retry/test/integration/test-timeouts.js
new file mode 100644
index 00000000000000..7206b0fb0b01d0
--- /dev/null
+++ b/deps/npm/node_modules/npm-registry-client/node_modules/retry/test/integration/test-timeouts.js
@@ -0,0 +1,69 @@
+var common = require('../common');
+var assert = common.assert;
+var retry = require(common.dir.lib + '/retry');
+
+(function testDefaultValues() {
+ var timeouts = retry.timeouts();
+
+ assert.equal(timeouts.length, 10);
+ assert.equal(timeouts[0], 1000);
+ assert.equal(timeouts[1], 2000);
+ assert.equal(timeouts[2], 4000);
+})();
+
+(function testDefaultValuesWithRandomize() {
+ var minTimeout = 5000;
+ var timeouts = retry.timeouts({
+ minTimeout: minTimeout,
+ randomize: true
+ });
+
+ assert.equal(timeouts.length, 10);
+ assert.ok(timeouts[0] > minTimeout);
+ assert.ok(timeouts[1] > timeouts[0]);
+ assert.ok(timeouts[2] > timeouts[1]);
+})();
+
+(function testPassedTimeoutsAreUsed() {
+ var timeoutsArray = [1000, 2000, 3000];
+ var timeouts = retry.timeouts(timeoutsArray);
+ assert.deepEqual(timeouts, timeoutsArray);
+ assert.notStrictEqual(timeouts, timeoutsArray);
+})();
+
+(function testTimeoutsAreWithinBoundaries() {
+ var minTimeout = 1000;
+ var maxTimeout = 10000;
+ var timeouts = retry.timeouts({
+ minTimeout: minTimeout,
+ maxTimeout: maxTimeout
+ });
+ for (var i = 0; i < timeouts; i++) {
+ assert.ok(timeouts[i] >= minTimeout);
+ assert.ok(timeouts[i] <= maxTimeout);
+ }
+})();
+
+(function testTimeoutsAreIncremental() {
+ var timeouts = retry.timeouts();
+ var lastTimeout = timeouts[0];
+ for (var i = 0; i < timeouts; i++) {
+ assert.ok(timeouts[i] > lastTimeout);
+ lastTimeout = timeouts[i];
+ }
+})();
+
+(function testTimeoutsAreIncrementalForFactorsLessThanOne() {
+ var timeouts = retry.timeouts({
+ retries: 3,
+ factor: 0.5
+ });
+
+ var expected = [250, 500, 1000];
+ assert.deepEqual(expected, timeouts);
+})();
+
+(function testRetries() {
+ var timeouts = retry.timeouts({retries: 2});
+ assert.strictEqual(timeouts.length, 2);
+})();
diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/retry/test/runner.js b/deps/npm/node_modules/npm-registry-client/node_modules/retry/test/runner.js
new file mode 100644
index 00000000000000..e0ee2f570fe3c0
--- /dev/null
+++ b/deps/npm/node_modules/npm-registry-client/node_modules/retry/test/runner.js
@@ -0,0 +1,5 @@
+var far = require('far').create();
+
+far.add(__dirname);
+far.include(/\/test-.*\.js$/);
+far.execute();
diff --git a/deps/npm/node_modules/npm-registry-client/package.json b/deps/npm/node_modules/npm-registry-client/package.json
index 5671705ab08989..7ead37785b2d14 100644
--- a/deps/npm/node_modules/npm-registry-client/package.json
+++ b/deps/npm/node_modules/npm-registry-client/package.json
@@ -6,7 +6,7 @@
},
"name": "npm-registry-client",
"description": "Client for the npm registry",
- "version": "7.0.8",
+ "version": "7.0.9",
"repository": {
"url": "git+https://github.com/npm/npm-registry-client.git"
},
@@ -27,7 +27,7 @@
"rimraf": "2",
"semver": "2 >=2.2.1 || 3.x || 4 || 5",
"slide": "^1.1.3",
- "npmlog": ""
+ "npmlog": "~2.0.0"
},
"devDependencies": {
"negotiator": "^0.4.9",
@@ -37,17 +37,46 @@
"tap": "^1.2.0"
},
"optionalDependencies": {
- "npmlog": ""
+ "npmlog": "~2.0.0"
},
"license": "ISC",
- "readme": "# npm-registry-client\n\nThe code that npm uses to talk to the registry.\n\nIt handles all the caching and HTTP calls.\n\n## Usage\n\n```javascript\nvar RegClient = require('npm-registry-client')\nvar client = new RegClient(config)\nvar uri = \"https://registry.npmjs.org/npm\"\nvar params = {timeout: 1000}\n\nclient.get(uri, params, function (error, data, raw, res) {\n // error is an error if there was a problem.\n // data is the parsed data object\n // raw is the json string\n // res is the response from couch\n})\n```\n\n# Registry URLs\n\nThe registry calls take either a full URL pointing to a resource in the\nregistry, or a base URL for the registry as a whole (including the registry\npath – but be sure to terminate the path with `/`). `http` and `https` URLs are\nthe only ones supported.\n\n## Using the client\n\nEvery call to the client follows the same pattern:\n\n* `uri` {String} The *fully-qualified* URI of the registry API method being\n invoked.\n* `params` {Object} Per-request parameters.\n* `callback` {Function} Callback to be invoked when the call is complete.\n\n### Credentials\n\nMany requests to the registry can by authenticated, and require credentials\nfor authorization. These credentials always look the same:\n\n* `username` {String}\n* `password` {String}\n* `email` {String}\n* `alwaysAuth` {Boolean} Whether calls to the target registry are always\n authed.\n\n**or**\n\n* `token` {String}\n* `alwaysAuth` {Boolean} Whether calls to the target registry are always\n authed.\n\n## API\n\n### client.access(uri, params, cb)\n\n* `uri` {String} Registry URL for the package's access API endpoint.\n Looks like `/-/package//access`.\n* `params` {Object} Object containing per-request properties.\n * `access` {String} New access level for the package. Can be either\n `public` or `restricted`. Registry will raise an error if trying\n to change the access level of an unscoped package.\n * `auth` {Credentials}\n\nSet the access level for scoped packages. For now, there are only two\naccess levels: \"public\" and \"restricted\".\n\n### client.adduser(uri, params, cb)\n\n* `uri` {String} Base registry URL.\n* `params` {Object} Object containing per-request properties.\n * `auth` {Credentials}\n* `cb` {Function}\n * `error` {Error | null}\n * `data` {Object} the parsed data object\n * `raw` {String} the json\n * `res` {Response Object} response from couch\n\nAdd a user account to the registry, or verify the credentials.\n\n### client.deprecate(uri, params, cb)\n\n* `uri` {String} Full registry URI for the deprecated package.\n* `params` {Object} Object containing per-request properties.\n * `version` {String} Semver version range.\n * `message` {String} The message to use as a deprecation warning.\n * `auth` {Credentials}\n* `cb` {Function}\n\nDeprecate a version of a package in the registry.\n\n### client.distTags.fetch(uri, params, cb)\n\n* `uri` {String} Base URL for the registry.\n* `params` {Object} Object containing per-request properties.\n * `package` {String} Name of the package.\n * `auth` {Credentials}\n* `cb` {Function}\n\nFetch all of the `dist-tags` for the named package.\n\n### client.distTags.add(uri, params, cb)\n\n* `uri` {String} Base URL for the registry.\n* `params` {Object} Object containing per-request properties.\n * `package` {String} Name of the package.\n * `distTag` {String} Name of the new `dist-tag`.\n * `version` {String} Exact version to be mapped to the `dist-tag`.\n * `auth` {Credentials}\n* `cb` {Function}\n\nAdd (or replace) a single dist-tag onto the named package.\n\n### client.distTags.set(uri, params, cb)\n\n* `uri` {String} Base URL for the registry.\n* `params` {Object} Object containing per-request properties.\n * `package` {String} Name of the package.\n * `distTags` {Object} Object containing a map from tag names to package\n versions.\n * `auth` {Credentials}\n* `cb` {Function}\n\nSet all of the `dist-tags` for the named package at once, creating any\n`dist-tags` that do not already exit. Any `dist-tags` not included in the\n`distTags` map will be removed.\n\n### client.distTags.update(uri, params, cb)\n\n* `uri` {String} Base URL for the registry.\n* `params` {Object} Object containing per-request properties.\n * `package` {String} Name of the package.\n * `distTags` {Object} Object containing a map from tag names to package\n versions.\n * `auth` {Credentials}\n* `cb` {Function}\n\nUpdate the values of multiple `dist-tags`, creating any `dist-tags` that do\nnot already exist. Any pre-existing `dist-tags` not included in the `distTags`\nmap will be left alone.\n\n### client.distTags.rm(uri, params, cb)\n\n* `uri` {String} Base URL for the registry.\n* `params` {Object} Object containing per-request properties.\n * `package` {String} Name of the package.\n * `distTag` {String} Name of the new `dist-tag`.\n * `auth` {Credentials}\n* `cb` {Function}\n\nRemove a single `dist-tag` from the named package.\n\n### client.get(uri, params, cb)\n\n* `uri` {String} The complete registry URI to fetch\n* `params` {Object} Object containing per-request properties.\n * `timeout` {Number} Duration before the request times out. Optional\n (default: never).\n * `follow` {Boolean} Follow 302/301 responses. Optional (default: true).\n * `staleOk` {Boolean} If there's cached data available, then return that to\n the callback quickly, and update the cache the background. Optional\n (default: false).\n * `auth` {Credentials} Optional.\n* `cb` {Function}\n\nFetches data from the registry via a GET request, saving it in the cache folder\nwith the ETag or the \"Last Modified\" timestamp.\n\n### client.publish(uri, params, cb)\n\n* `uri` {String} The registry URI for the package to publish.\n* `params` {Object} Object containing per-request properties.\n * `metadata` {Object} Package metadata.\n * `access` {String} Access for the package. Can be `public` or `restricted` (no default).\n * `body` {Stream} Stream of the package body / tarball.\n * `auth` {Credentials}\n* `cb` {Function}\n\nPublish a package to the registry.\n\nNote that this does not create the tarball from a folder.\n\n### client.star(uri, params, cb)\n\n* `uri` {String} The complete registry URI for the package to star.\n* `params` {Object} Object containing per-request properties.\n * `starred` {Boolean} True to star the package, false to unstar it. Optional\n (default: false).\n * `auth` {Credentials}\n* `cb` {Function}\n\nStar or unstar a package.\n\nNote that the user does not have to be the package owner to star or unstar a\npackage, though other writes do require that the user be the package owner.\n\n### client.stars(uri, params, cb)\n\n* `uri` {String} The base URL for the registry.\n* `params` {Object} Object containing per-request properties.\n * `username` {String} Name of user to fetch starred packages for. Optional\n (default: user in `auth`).\n * `auth` {Credentials} Optional (required if `username` is omitted).\n* `cb` {Function}\n\nView your own or another user's starred packages.\n\n### client.tag(uri, params, cb)\n\n* `uri` {String} The complete registry URI to tag\n* `params` {Object} Object containing per-request properties.\n * `version` {String} Version to tag.\n * `tag` {String} Tag name to apply.\n * `auth` {Credentials}\n* `cb` {Function}\n\nMark a version in the `dist-tags` hash, so that `pkg@tag` will fetch the\nspecified version.\n\n### client.unpublish(uri, params, cb)\n\n* `uri` {String} The complete registry URI of the package to unpublish.\n* `params` {Object} Object containing per-request properties.\n * `version` {String} version to unpublish. Optional – omit to unpublish all\n versions.\n * `auth` {Credentials}\n* `cb` {Function}\n\nRemove a version of a package (or all versions) from the registry. When the\nlast version us unpublished, the entire document is removed from the database.\n\n### client.whoami(uri, params, cb)\n\n* `uri` {String} The base registry for the URI.\n* `params` {Object} Object containing per-request properties.\n * `auth` {Credentials}\n* `cb` {Function}\n\nSimple call to see who the registry thinks you are. Especially useful with\ntoken-based auth.\n\n\n## PLUMBING\n\nThe below are primarily intended for use by the rest of the API, or by the npm\ncaching logic directly.\n\n### client.request(uri, params, cb)\n\n* `uri` {String} URI pointing to the resource to request.\n* `params` {Object} Object containing per-request properties.\n * `method` {String} HTTP method. Optional (default: \"GET\").\n * `body` {Stream | Buffer | String | Object} The request body. Objects\n that are not Buffers or Streams are encoded as JSON. Optional – body\n only used for write operations.\n * `etag` {String} The cached ETag. Optional.\n * `lastModified` {String} The cached Last-Modified timestamp. Optional.\n * `follow` {Boolean} Follow 302/301 responses. Optional (default: true).\n * `auth` {Credentials} Optional.\n* `cb` {Function}\n * `error` {Error | null}\n * `data` {Object} the parsed data object\n * `raw` {String} the json\n * `res` {Response Object} response from couch\n\nMake a generic request to the registry. All the other methods are wrappers\naround `client.request`.\n\n### client.fetch(uri, params, cb)\n\n* `uri` {String} The complete registry URI to upload to\n* `params` {Object} Object containing per-request properties.\n * `headers` {Stream} HTTP headers to be included with the request. Optional.\n * `auth` {Credentials} Optional.\n* `cb` {Function}\n\nFetch a package from a URL, with auth set appropriately if included. Used to\ncache remote tarballs as well as request package tarballs from the registry.\n\n# Configuration\n\nThe client uses its own configuration, which is just passed in as a simple\nnested object. The following are the supported values (with their defaults, if\nany):\n\n* `proxy.http` {URL} The URL to proxy HTTP requests through.\n* `proxy.https` {URL} The URL to proxy HTTPS requests through. Defaults to be\n the same as `proxy.http` if unset.\n* `proxy.localAddress` {IP} The local address to use on multi-homed systems.\n* `ssl.ca` {String} Certificate signing authority certificates to trust.\n* `ssl.certificate` {String} Client certificate (PEM encoded). Enable access\n to servers that require client certificates.\n* `ssl.key` {String} Private key (PEM encoded) for client certificate.\n* `ssl.strict` {Boolean} Whether or not to be strict with SSL certificates.\n Default = `true`\n* `retry.count` {Number} Number of times to retry on GET failures. Default = 2.\n* `retry.factor` {Number} `factor` setting for `node-retry`. Default = 10.\n* `retry.minTimeout` {Number} `minTimeout` setting for `node-retry`.\n Default = 10000 (10 seconds)\n* `retry.maxTimeout` {Number} `maxTimeout` setting for `node-retry`.\n Default = 60000 (60 seconds)\n* `userAgent` {String} User agent header to send. Default =\n `\"node/{process.version}\"`\n* `log` {Object} The logger to use. Defaults to `require(\"npmlog\")` if\n that works, otherwise logs are disabled.\n* `defaultTag` {String} The default tag to use when publishing new packages.\n Default = `\"latest\"`\n* `couchToken` {Object} A token for use with\n [couch-login](https://npmjs.org/package/couch-login).\n* `sessionToken` {string} A random identifier for this set of client requests.\n Default = 8 random hexadecimal bytes.\n",
- "readmeFilename": "README.md",
- "gitHead": "e56227b65d18c5158979509ee22a9c3f40cb6756",
+ "gitHead": "2c0c83149edb270829582a234703404b2ba1c410",
"bugs": {
"url": "https://github.com/npm/npm-registry-client/issues"
},
"homepage": "https://github.com/npm/npm-registry-client#readme",
- "_id": "npm-registry-client@7.0.8",
- "_shasum": "8c9fea64458fcc26f31da1219127e6e0ebfb0590",
- "_from": "npm-registry-client@>=7.0.8 <7.1.0"
+ "_id": "npm-registry-client@7.0.9",
+ "_shasum": "1baf86ee5285c4e6d38d4556208ded56049231bb",
+ "_from": "npm-registry-client@>=7.0.9 <7.1.0",
+ "_npmVersion": "3.4.1",
+ "_nodeVersion": "5.1.0",
+ "_npmUser": {
+ "name": "othiym23",
+ "email": "ogd@aoaioxxysz.net"
+ },
+ "dist": {
+ "shasum": "1baf86ee5285c4e6d38d4556208ded56049231bb",
+ "tarball": "http://registry.npmjs.org/npm-registry-client/-/npm-registry-client-7.0.9.tgz"
+ },
+ "maintainers": [
+ {
+ "name": "isaacs",
+ "email": "isaacs@npmjs.com"
+ },
+ {
+ "name": "othiym23",
+ "email": "ogd@aoaioxxysz.net"
+ },
+ {
+ "name": "iarna",
+ "email": "me@re-becca.org"
+ },
+ {
+ "name": "zkat",
+ "email": "kat@sykosomatic.org"
+ }
+ ],
+ "directories": {},
+ "_resolved": "https://registry.npmjs.org/npm-registry-client/-/npm-registry-client-7.0.9.tgz",
+ "readme": "ERROR: No README data found!"
}
diff --git a/deps/npm/node_modules/npmlog/node_modules/are-we-there-yet/.npmignore b/deps/npm/node_modules/npmlog/node_modules/are-we-there-yet/.npmignore
index 926ddf616c7c12..bc818974f8633f 100644
--- a/deps/npm/node_modules/npmlog/node_modules/are-we-there-yet/.npmignore
+++ b/deps/npm/node_modules/npmlog/node_modules/are-we-there-yet/.npmignore
@@ -1,3 +1,5 @@
*~
.#*
node_modules
+coverage
+.nyc_output
diff --git a/deps/npm/node_modules/npmlog/node_modules/are-we-there-yet/LICENSE b/deps/npm/node_modules/npmlog/node_modules/are-we-there-yet/LICENSE
new file mode 100644
index 00000000000000..af4588069db82d
--- /dev/null
+++ b/deps/npm/node_modules/npmlog/node_modules/are-we-there-yet/LICENSE
@@ -0,0 +1,5 @@
+Copyright (c) 2015, Rebecca Turner
+
+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/deps/npm/node_modules/npmlog/node_modules/are-we-there-yet/README.md b/deps/npm/node_modules/npmlog/node_modules/are-we-there-yet/README.md
index 52f9f9ae1ed4a2..ef2476e79f2eca 100644
--- a/deps/npm/node_modules/npmlog/node_modules/are-we-there-yet/README.md
+++ b/deps/npm/node_modules/npmlog/node_modules/are-we-there-yet/README.md
@@ -128,7 +128,8 @@ Tracker
events. Defaults to undefined.
* **todo** *(optional)* The amount of work todo (a number). Defaults to 0.
-Ordinarily these are constructed as a part of a tracker group (via `newItem`) but they c
+Ordinarily these are constructed as a part of a tracker group (via
+`newItem`).
* var completed = tracker.completed()
diff --git a/deps/npm/node_modules/npmlog/node_modules/are-we-there-yet/index.js b/deps/npm/node_modules/npmlog/node_modules/are-we-there-yet/index.js
index 22f47ac8852b89..9e7711935a32c0 100644
--- a/deps/npm/node_modules/npmlog/node_modules/are-we-there-yet/index.js
+++ b/deps/npm/node_modules/npmlog/node_modules/are-we-there-yet/index.js
@@ -1,21 +1,21 @@
"use strict"
-var stream = require("readable-stream");
+var stream = require("readable-stream")
var EventEmitter = require("events").EventEmitter
var util = require("util")
var delegate = require("delegates")
+function noteChange (trackerGroup) {
+ return function (name) {
+ trackerGroup.emit('change', name || trackerGroup.name);
+ }
+}
+
var TrackerGroup = exports.TrackerGroup = function (name) {
EventEmitter.call(this)
this.name = name
this.trackGroup = []
- var self = this
this.totalWeight = 0
- var noteChange = this.noteChange = function (name) {
- self.emit("change", name || this.name)
- }.bind(this)
- this.trackGroup.forEach(function(unit) {
- unit.on("change", noteChange)
- })
+ this.noteChange = noteChange(this)
}
util.inherits(TrackerGroup, EventEmitter)
@@ -23,9 +23,10 @@ TrackerGroup.prototype.completed = function () {
if (this.trackGroup.length==0) return 0
var valPerWeight = 1 / this.totalWeight
var completed = 0
- this.trackGroup.forEach(function(T) {
- completed += valPerWeight * T.weight * T.completed()
- })
+ for (var i = 0, len = this.trackGroup.length; i < len; i++){
+ var group = this.trackGroup[i];
+ completed += valPerWeight * group.weight * group.completed()
+ }
return completed
}
@@ -33,6 +34,7 @@ TrackerGroup.prototype.addUnit = function (unit, weight, noChange) {
unit.weight = weight || 1
this.totalWeight += unit.weight
this.trackGroup.push(unit)
+ // Bubble events back up
unit.on("change", this.noteChange)
if (! noChange) this.emit("change", this.name)
return unit
@@ -51,12 +53,12 @@ TrackerGroup.prototype.newStream = function (name, todo, weight) {
}
TrackerGroup.prototype.finish = function () {
- if (! this.trackGroup.length) { this.addUnit(new Tracker(), 1, true) }
- var self = this
- this.trackGroup.forEach(function(T) {
- T.removeListener("change", self.noteChange)
- T.finish()
- })
+ if (! this.trackGroup.length) this.addUnit(new Tracker(), 1, true)
+ for (var i = 0, len = this.trackGroup.length; i < len; i++) {
+ var group = this.trackGroup[i]
+ group.removeListener("change", this.noteChange)
+ group.finish()
+ }
this.emit("change", this.name)
}
@@ -85,7 +87,7 @@ var Tracker = exports.Tracker = function (name,todo) {
util.inherits(Tracker, EventEmitter)
Tracker.prototype.completed = function () {
- return this.workTodo==0 ? 0 : this.workDone / this.workTodo
+ return this.workTodo === 0 ? 0 : this.workDone / this.workTodo
}
Tracker.prototype.addWork = function (work) {
diff --git a/deps/npm/node_modules/npmlog/node_modules/are-we-there-yet/node_modules/delegates/History.md b/deps/npm/node_modules/npmlog/node_modules/are-we-there-yet/node_modules/delegates/History.md
index aee31a4c35b7f3..25959eab67b840 100644
--- a/deps/npm/node_modules/npmlog/node_modules/are-we-there-yet/node_modules/delegates/History.md
+++ b/deps/npm/node_modules/npmlog/node_modules/are-we-there-yet/node_modules/delegates/History.md
@@ -1,4 +1,10 @@
+1.0.0 / 2015-12-14
+==================
+
+ * Merge pull request #12 from kasicka/master
+ * Add license text
+
0.1.0 / 2014-10-17
==================
diff --git a/deps/npm/node_modules/npmlog/node_modules/are-we-there-yet/node_modules/delegates/License b/deps/npm/node_modules/npmlog/node_modules/are-we-there-yet/node_modules/delegates/License
new file mode 100644
index 00000000000000..60de60addbe7e9
--- /dev/null
+++ b/deps/npm/node_modules/npmlog/node_modules/are-we-there-yet/node_modules/delegates/License
@@ -0,0 +1,20 @@
+Copyright (c) 2015 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/deps/npm/node_modules/npmlog/node_modules/are-we-there-yet/node_modules/delegates/package.json b/deps/npm/node_modules/npmlog/node_modules/are-we-there-yet/node_modules/delegates/package.json
index ea3c1da0d490b2..52014b75679dee 100644
--- a/deps/npm/node_modules/npmlog/node_modules/are-we-there-yet/node_modules/delegates/package.json
+++ b/deps/npm/node_modules/npmlog/node_modules/are-we-there-yet/node_modules/delegates/package.json
@@ -1,9 +1,9 @@
{
"name": "delegates",
- "version": "0.1.0",
+ "version": "1.0.0",
"repository": {
"type": "git",
- "url": "git://github.com/visionmedia/node-delegates.git"
+ "url": "git+https://github.com/visionmedia/node-delegates.git"
},
"description": "delegate methods and accessors to another property",
"keywords": [
@@ -16,17 +16,20 @@
"should": "*"
},
"license": "MIT",
+ "gitHead": "c4dc07ef1ed51c2b2a63f3585e5ef949ee577a49",
"bugs": {
"url": "https://github.com/visionmedia/node-delegates/issues"
},
- "homepage": "https://github.com/visionmedia/node-delegates",
- "_id": "delegates@0.1.0",
- "_shasum": "b4b57be11a1653517a04b27f0949bdc327dfe390",
- "_from": "delegates@>=0.1.0 <0.2.0",
- "_npmVersion": "1.4.9",
+ "homepage": "https://github.com/visionmedia/node-delegates#readme",
+ "_id": "delegates@1.0.0",
+ "scripts": {},
+ "_shasum": "84c6e159b81904fdca59a0ef44cd870d31250f9a",
+ "_from": "delegates@>=1.0.0 <2.0.0",
+ "_npmVersion": "3.3.12",
+ "_nodeVersion": "4.2.1",
"_npmUser": {
- "name": "dominicbarnes",
- "email": "dominic@dbarnes.info"
+ "name": "tjholowaychuk",
+ "email": "tj@vision-media.ca"
},
"maintainers": [
{
@@ -39,10 +42,9 @@
}
],
"dist": {
- "shasum": "b4b57be11a1653517a04b27f0949bdc327dfe390",
- "tarball": "http://registry.npmjs.org/delegates/-/delegates-0.1.0.tgz"
+ "shasum": "84c6e159b81904fdca59a0ef44cd870d31250f9a",
+ "tarball": "http://registry.npmjs.org/delegates/-/delegates-1.0.0.tgz"
},
"directories": {},
- "_resolved": "https://registry.npmjs.org/delegates/-/delegates-0.1.0.tgz",
- "readme": "ERROR: No README data found!"
+ "_resolved": "https://registry.npmjs.org/delegates/-/delegates-1.0.0.tgz"
}
diff --git a/deps/npm/node_modules/npmlog/node_modules/are-we-there-yet/package.json b/deps/npm/node_modules/npmlog/node_modules/are-we-there-yet/package.json
index 759100666932a3..62b542cb9b853a 100644
--- a/deps/npm/node_modules/npmlog/node_modules/are-we-there-yet/package.json
+++ b/deps/npm/node_modules/npmlog/node_modules/are-we-there-yet/package.json
@@ -1,6 +1,6 @@
{
"name": "are-we-there-yet",
- "version": "1.0.4",
+ "version": "1.0.6",
"description": "Keep track of the overall completion of many dispirate processes",
"main": "index.js",
"scripts": {
@@ -20,32 +20,32 @@
},
"homepage": "https://github.com/iarna/are-we-there-yet",
"devDependencies": {
- "tap": "^0.4.13"
+ "tap": "^5.2.0"
},
"dependencies": {
- "delegates": "^0.1.0",
- "readable-stream": "^1.1.13"
- },
- "gitHead": "7ce414849b81ab83935a935275def01914821bde",
- "_id": "are-we-there-yet@1.0.4",
- "_shasum": "527fe389f7bcba90806106b99244eaa07e886f85",
- "_from": "are-we-there-yet@>=1.0.0 <1.1.0",
- "_npmVersion": "2.0.0",
+ "delegates": "^1.0.0",
+ "readable-stream": "^2.0.0 || ^1.1.13"
+ },
+ "gitHead": "5f19c8b6f9c5afb8b0b17308cb9d66f7027ae526",
+ "_id": "are-we-there-yet@1.0.6",
+ "_shasum": "a2d28c93102aa6cc96245a26cb954de06ec53f0c",
+ "_from": "are-we-there-yet@>=1.0.6 <1.1.0",
+ "_npmVersion": "3.6.0",
+ "_nodeVersion": "5.4.0",
"_npmUser": {
"name": "iarna",
"email": "me@re-becca.org"
},
+ "dist": {
+ "shasum": "a2d28c93102aa6cc96245a26cb954de06ec53f0c",
+ "tarball": "http://registry.npmjs.org/are-we-there-yet/-/are-we-there-yet-1.0.6.tgz"
+ },
"maintainers": [
{
"name": "iarna",
"email": "me@re-becca.org"
}
],
- "dist": {
- "shasum": "527fe389f7bcba90806106b99244eaa07e886f85",
- "tarball": "http://registry.npmjs.org/are-we-there-yet/-/are-we-there-yet-1.0.4.tgz"
- },
"directories": {},
- "_resolved": "https://registry.npmjs.org/are-we-there-yet/-/are-we-there-yet-1.0.4.tgz",
- "readme": "ERROR: No README data found!"
+ "_resolved": "https://registry.npmjs.org/are-we-there-yet/-/are-we-there-yet-1.0.6.tgz"
}
diff --git a/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/has-unicode/README.md b/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/has-unicode/README.md
index e9d3cc326c144a..5a03e5991c539e 100644
--- a/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/has-unicode/README.md
+++ b/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/has-unicode/README.md
@@ -26,9 +26,12 @@ If you have a UTF-16 locale then you won't be detected as unicode capable.
### Windows
-Since at least Windows 7, `cmd` and `powershell` have been unicode capable.
-As such, we report any Windows installation as unicode capable.
-
+Since at least Windows 7, `cmd` and `powershell` have been unicode capable,
+but unfortunately even then it's not guaranteed. In many localizations it
+still uses legacy code pages and there's no facility short of running
+programs or linking C++ that will let us detect this. As such, we
+report any Windows installation as NOT unicode capable, and recommend
+that you encourage your users to override this via config.
### Unix Like Operating Systems
diff --git a/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/has-unicode/index.js b/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/has-unicode/index.js
index e0907b510a8b9a..9bf537b1cd48e5 100644
--- a/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/has-unicode/index.js
+++ b/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/has-unicode/index.js
@@ -2,9 +2,13 @@
var os = require("os")
var hasUnicode = module.exports = function () {
- // Supported Win32 platforms (>XP) support unicode in the console, though
- // font support isn't fantastic.
- if (os.type() == "Windows_NT") { return true }
+ // Recent Win32 platforms (>XP) CAN support unicode in the console but
+ // don't have to, and in non-english locales often use traditional local
+ // code pages. There's no way, short of windows system calls or execing
+ // the chcp command line program to figure this out. As such, we default
+ // this to false and encourage your users to override it via config if
+ // appropriate.
+ if (os.type() == "Windows_NT") { return false }
var isUTF8 = /[.]UTF-8/
if (isUTF8.test(process.env.LC_ALL)
diff --git a/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/has-unicode/package.json b/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/has-unicode/package.json
index 6430bb74a470fc..a9d9a54f7c08da 100644
--- a/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/has-unicode/package.json
+++ b/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/has-unicode/package.json
@@ -1,6 +1,6 @@
{
"name": "has-unicode",
- "version": "1.0.1",
+ "version": "2.0.0",
"description": "Try to guess if your terminal supports unicode",
"main": "index.js",
"scripts": {
@@ -24,22 +24,22 @@
},
"homepage": "https://github.com/iarna/has-unicode",
"devDependencies": {
- "require-inject": "^1.1.1",
- "tap": "^0.4.13"
+ "require-inject": "^1.3.0",
+ "tap": "^2.3.1"
},
- "gitHead": "d4ad300c67b25c197582e42e936ea928f7935d01",
- "_id": "has-unicode@1.0.1",
- "_shasum": "c46fceea053eb8ec789bffbba25fca52dfdcf38e",
- "_from": "has-unicode@>=1.0.0 <2.0.0",
- "_npmVersion": "3.3.6",
- "_nodeVersion": "4.1.1",
+ "gitHead": "fdd5de141a5564bdb5bc991d951209da40f6a598",
+ "_id": "has-unicode@2.0.0",
+ "_shasum": "a3cd96c307ba41d559c5a2ee408c12a11c4c2ec3",
+ "_from": "has-unicode@>=2.0.0 <3.0.0",
+ "_npmVersion": "2.14.7",
+ "_nodeVersion": "4.2.2",
"_npmUser": {
"name": "iarna",
"email": "me@re-becca.org"
},
"dist": {
- "shasum": "c46fceea053eb8ec789bffbba25fca52dfdcf38e",
- "tarball": "http://registry.npmjs.org/has-unicode/-/has-unicode-1.0.1.tgz"
+ "shasum": "a3cd96c307ba41d559c5a2ee408c12a11c4c2ec3",
+ "tarball": "http://registry.npmjs.org/has-unicode/-/has-unicode-2.0.0.tgz"
},
"maintainers": [
{
@@ -48,6 +48,5 @@
}
],
"directories": {},
- "_resolved": "https://registry.npmjs.org/has-unicode/-/has-unicode-1.0.1.tgz",
- "readme": "ERROR: No README data found!"
+ "_resolved": "https://registry.npmjs.org/has-unicode/-/has-unicode-2.0.0.tgz"
}
diff --git a/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/has-unicode/test/index.js b/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/has-unicode/test/index.js
index 2394c14ef7fce9..cbdfda335088ee 100644
--- a/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/has-unicode/test/index.js
+++ b/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/has-unicode/test/index.js
@@ -7,7 +7,7 @@ test("Windows", function (t) {
var hasUnicode = requireInject("../index.js", {
os: { type: function () { return "Windows_NT" } }
})
- t.is(hasUnicode(), true, "Windows is assumed to be unicode aware")
+ t.is(hasUnicode(), false, "Windows is assumed NOT to be unicode aware")
})
test("Unix Env", function (t) {
t.plan(3)
diff --git a/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash.pad/LICENSE b/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash.pad/LICENSE
index 9cd87e5dcefe58..b054ca5a3ac7d6 100644
--- a/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash.pad/LICENSE
+++ b/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash.pad/LICENSE
@@ -1,5 +1,5 @@
-Copyright 2012-2015 The Dojo Foundation
-Based on Underscore.js, copyright 2009-2015 Jeremy Ashkenas,
+Copyright 2012-2016 The Dojo Foundation
+Based on Underscore.js, copyright 2009-2016 Jeremy Ashkenas,
DocumentCloud and Investigative Reporters & Editors
Permission is hereby granted, free of charge, to any person obtaining
diff --git a/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash.pad/README.md b/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash.pad/README.md
index 456d23ddf0c968..94491c81e6db90 100644
--- a/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash.pad/README.md
+++ b/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash.pad/README.md
@@ -1,20 +1,18 @@
-# lodash.pad v3.1.1
+# lodash.pad v3.2.2
-The [modern build](https://github.com/lodash/lodash/wiki/Build-Differences) of [lodash’s](https://lodash.com/) `_.pad` exported as a [Node.js](http://nodejs.org/)/[io.js](https://iojs.org/) module.
+The [lodash](https://lodash.com/) method `_.pad` exported as a [Node.js](https://nodejs.org/) module.
## Installation
Using npm:
-
```bash
$ {sudo -H} npm i -g npm
$ npm i --save lodash.pad
```
-In Node.js/io.js:
-
+In Node.js:
```js
var pad = require('lodash.pad');
```
-See the [documentation](https://lodash.com/docs#pad) or [package source](https://github.com/lodash/lodash/blob/3.1.1-npm-packages/lodash.pad) for more details.
+See the [documentation](https://lodash.com/docs#pad) or [package source](https://github.com/lodash/lodash/blob/3.2.2-npm-packages/lodash.pad) for more details.
diff --git a/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash.pad/index.js b/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash.pad/index.js
index a29ccea9ca189d..786b6a617e5f2e 100644
--- a/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash.pad/index.js
+++ b/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash.pad/index.js
@@ -1,18 +1,393 @@
/**
- * lodash 3.1.1 (Custom Build)
- * Build: `lodash modern modularize exports="npm" -o ./`
- * Copyright 2012-2015 The Dojo Foundation
+ * lodash 3.2.2 (Custom Build)
+ * Build: `lodash modularize exports="npm" -o ./`
+ * Copyright 2012-2016 The Dojo Foundation
* Based on Underscore.js 1.8.3
- * Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
+ * Copyright 2009-2016 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
* Available under MIT license
*/
-var baseToString = require('lodash._basetostring'),
- createPadding = require('lodash._createpadding');
+var repeat = require('lodash.repeat');
-/* Native method references for those with the same name as other `lodash` methods. */
+/** Used as references for various `Number` constants. */
+var INFINITY = 1 / 0,
+ MAX_INTEGER = 1.7976931348623157e+308,
+ NAN = 0 / 0;
+
+/** `Object#toString` result references. */
+var funcTag = '[object Function]',
+ genTag = '[object GeneratorFunction]',
+ symbolTag = '[object Symbol]';
+
+/** Used to match leading and trailing whitespace. */
+var reTrim = /^\s+|\s+$/g;
+
+/** Used to detect bad signed hexadecimal string values. */
+var reIsBadHex = /^[-+]0x[0-9a-f]+$/i;
+
+/** Used to detect binary string values. */
+var reIsBinary = /^0b[01]+$/i;
+
+/** Used to detect octal string values. */
+var reIsOctal = /^0o[0-7]+$/i;
+
+/** Used to compose unicode character classes. */
+var rsAstralRange = '\\ud800-\\udfff',
+ rsComboMarksRange = '\\u0300-\\u036f\\ufe20-\\ufe23',
+ rsComboSymbolsRange = '\\u20d0-\\u20f0',
+ rsVarRange = '\\ufe0e\\ufe0f';
+
+/** Used to compose unicode capture groups. */
+var rsAstral = '[' + rsAstralRange + ']',
+ rsCombo = '[' + rsComboMarksRange + rsComboSymbolsRange + ']',
+ rsFitz = '\\ud83c[\\udffb-\\udfff]',
+ rsModifier = '(?:' + rsCombo + '|' + rsFitz + ')',
+ rsNonAstral = '[^' + rsAstralRange + ']',
+ rsRegional = '(?:\\ud83c[\\udde6-\\uddff]){2}',
+ rsSurrPair = '[\\ud800-\\udbff][\\udc00-\\udfff]',
+ rsZWJ = '\\u200d';
+
+/** Used to compose unicode regexes. */
+var reOptMod = rsModifier + '?',
+ rsOptVar = '[' + rsVarRange + ']?',
+ rsOptJoin = '(?:' + rsZWJ + '(?:' + [rsNonAstral, rsRegional, rsSurrPair].join('|') + ')' + rsOptVar + reOptMod + ')*',
+ rsSeq = rsOptVar + reOptMod + rsOptJoin,
+ rsSymbol = '(?:' + [rsNonAstral + rsCombo + '?', rsCombo, rsRegional, rsSurrPair, rsAstral].join('|') + ')';
+
+/** Used to match [string symbols](https://mathiasbynens.be/notes/javascript-unicode). */
+var reComplexSymbol = RegExp(rsFitz + '(?=' + rsFitz + ')|' + rsSymbol + rsSeq, 'g');
+
+/** Used to detect strings with [zero-width joiners or code points from the astral planes](http://eev.ee/blog/2015/09/12/dark-corners-of-unicode/). */
+var reHasComplexSymbol = RegExp('[' + rsZWJ + rsAstralRange + rsComboMarksRange + rsComboSymbolsRange + rsVarRange + ']');
+
+/** Used to determine if values are of the language type `Object`. */
+var objectTypes = {
+ 'function': true,
+ 'object': true
+};
+
+/** Built-in method references without a dependency on `root`. */
+var freeParseInt = parseInt;
+
+/** Detect free variable `exports`. */
+var freeExports = (objectTypes[typeof exports] && exports && !exports.nodeType) ? exports : null;
+
+/** Detect free variable `module`. */
+var freeModule = (objectTypes[typeof module] && module && !module.nodeType) ? module : null;
+
+/** Detect free variable `global` from Node.js. */
+var freeGlobal = checkGlobal(freeExports && freeModule && typeof global == 'object' && global);
+
+/** Detect free variable `self`. */
+var freeSelf = checkGlobal(objectTypes[typeof self] && self);
+
+/** Detect free variable `window`. */
+var freeWindow = checkGlobal(objectTypes[typeof window] && window);
+
+/** Detect `this` as the global object. */
+var thisGlobal = checkGlobal(objectTypes[typeof this] && this);
+
+/**
+ * Used as a reference to the global object.
+ *
+ * The `this` value is used if it's the global object to avoid Greasemonkey's
+ * restricted `window` object, otherwise the `window` object is used.
+ */
+var root = freeGlobal || ((freeWindow !== (thisGlobal && thisGlobal.window)) && freeWindow) || freeSelf || thisGlobal || Function('return this')();
+
+/**
+ * Checks if `value` is a global object.
+ *
+ * @private
+ * @param {*} value The value to check.
+ * @returns {null|Object} Returns `value` if it's a global object, else `null`.
+ */
+function checkGlobal(value) {
+ return (value && value.Object === Object) ? value : null;
+}
+
+/**
+ * Gets the number of symbols in `string`.
+ *
+ * @private
+ * @param {string} string The string to inspect.
+ * @returns {number} Returns the string size.
+ */
+function stringSize(string) {
+ if (!(string && reHasComplexSymbol.test(string))) {
+ return string.length;
+ }
+ var result = reComplexSymbol.lastIndex = 0;
+ while (reComplexSymbol.test(string)) {
+ result++;
+ }
+ return result;
+}
+
+/**
+ * Converts `string` to an array.
+ *
+ * @private
+ * @param {string} string The string to convert.
+ * @returns {Array} Returns the converted array.
+ */
+function stringToArray(string) {
+ return string.match(reComplexSymbol);
+}
+
+/** Used for built-in method references. */
+var objectProto = Object.prototype;
+
+/**
+ * Used to resolve the [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring)
+ * of values.
+ */
+var objectToString = objectProto.toString;
+
+/** Built-in value references. */
+var Symbol = root.Symbol;
+
+/* Built-in method references for those with the same name as other `lodash` methods. */
var nativeCeil = Math.ceil,
- nativeFloor = Math.floor,
- nativeIsFinite = global.isFinite;
+ nativeFloor = Math.floor;
+
+/** Used to convert symbols to primitives and strings. */
+var symbolProto = Symbol ? Symbol.prototype : undefined,
+ symbolToString = Symbol ? symbolProto.toString : undefined;
+
+/**
+ * Creates the padding for `string` based on `length`. The `chars` string
+ * is truncated if the number of characters exceeds `length`.
+ *
+ * @private
+ * @param {string} string The string to create padding for.
+ * @param {number} [length=0] The padding length.
+ * @param {string} [chars=' '] The string used as padding.
+ * @returns {string} Returns the padding for `string`.
+ */
+function createPadding(string, length, chars) {
+ length = toInteger(length);
+
+ var strLength = stringSize(string);
+ if (!length || strLength >= length) {
+ return '';
+ }
+ var padLength = length - strLength;
+ chars = chars === undefined ? ' ' : (chars + '');
+
+ var result = repeat(chars, nativeCeil(padLength / stringSize(chars)));
+ return reHasComplexSymbol.test(chars)
+ ? stringToArray(result).slice(0, padLength).join('')
+ : result.slice(0, padLength);
+}
+
+/**
+ * Checks if `value` is classified as a `Function` object.
+ *
+ * @static
+ * @memberOf _
+ * @category Lang
+ * @param {*} value The value to check.
+ * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`.
+ * @example
+ *
+ * _.isFunction(_);
+ * // => true
+ *
+ * _.isFunction(/abc/);
+ * // => false
+ */
+function isFunction(value) {
+ // The use of `Object#toString` avoids issues with the `typeof` operator
+ // in Safari 8 which returns 'object' for typed array constructors, and
+ // PhantomJS 1.9 which returns 'function' for `NodeList` instances.
+ var tag = isObject(value) ? objectToString.call(value) : '';
+ return tag == funcTag || tag == genTag;
+}
+
+/**
+ * Checks if `value` is the [language type](https://es5.github.io/#x8) of `Object`.
+ * (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
+ *
+ * @static
+ * @memberOf _
+ * @category Lang
+ * @param {*} value The value to check.
+ * @returns {boolean} Returns `true` if `value` is an object, else `false`.
+ * @example
+ *
+ * _.isObject({});
+ * // => true
+ *
+ * _.isObject([1, 2, 3]);
+ * // => true
+ *
+ * _.isObject(_.noop);
+ * // => true
+ *
+ * _.isObject(null);
+ * // => false
+ */
+function isObject(value) {
+ var type = typeof value;
+ return !!value && (type == 'object' || type == 'function');
+}
+
+/**
+ * Checks if `value` is object-like. A value is object-like if it's not `null`
+ * and has a `typeof` result of "object".
+ *
+ * @static
+ * @memberOf _
+ * @category Lang
+ * @param {*} value The value to check.
+ * @returns {boolean} Returns `true` if `value` is object-like, else `false`.
+ * @example
+ *
+ * _.isObjectLike({});
+ * // => true
+ *
+ * _.isObjectLike([1, 2, 3]);
+ * // => true
+ *
+ * _.isObjectLike(_.noop);
+ * // => false
+ *
+ * _.isObjectLike(null);
+ * // => false
+ */
+function isObjectLike(value) {
+ return !!value && typeof value == 'object';
+}
+
+/**
+ * Checks if `value` is classified as a `Symbol` primitive or object.
+ *
+ * @static
+ * @memberOf _
+ * @category Lang
+ * @param {*} value The value to check.
+ * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`.
+ * @example
+ *
+ * _.isSymbol(Symbol.iterator);
+ * // => true
+ *
+ * _.isSymbol('abc');
+ * // => false
+ */
+function isSymbol(value) {
+ return typeof value == 'symbol' ||
+ (isObjectLike(value) && objectToString.call(value) == symbolTag);
+}
+
+/**
+ * Converts `value` to an integer.
+ *
+ * **Note:** This function is loosely based on [`ToInteger`](http://www.ecma-international.org/ecma-262/6.0/#sec-tointeger).
+ *
+ * @static
+ * @memberOf _
+ * @category Lang
+ * @param {*} value The value to convert.
+ * @returns {number} Returns the converted integer.
+ * @example
+ *
+ * _.toInteger(3);
+ * // => 3
+ *
+ * _.toInteger(Number.MIN_VALUE);
+ * // => 0
+ *
+ * _.toInteger(Infinity);
+ * // => 1.7976931348623157e+308
+ *
+ * _.toInteger('3');
+ * // => 3
+ */
+function toInteger(value) {
+ if (!value) {
+ return value === 0 ? value : 0;
+ }
+ value = toNumber(value);
+ if (value === INFINITY || value === -INFINITY) {
+ var sign = (value < 0 ? -1 : 1);
+ return sign * MAX_INTEGER;
+ }
+ var remainder = value % 1;
+ return value === value ? (remainder ? value - remainder : value) : 0;
+}
+
+/**
+ * Converts `value` to a number.
+ *
+ * @static
+ * @memberOf _
+ * @category Lang
+ * @param {*} value The value to process.
+ * @returns {number} Returns the number.
+ * @example
+ *
+ * _.toNumber(3);
+ * // => 3
+ *
+ * _.toNumber(Number.MIN_VALUE);
+ * // => 5e-324
+ *
+ * _.toNumber(Infinity);
+ * // => Infinity
+ *
+ * _.toNumber('3');
+ * // => 3
+ */
+function toNumber(value) {
+ if (isObject(value)) {
+ var other = isFunction(value.valueOf) ? value.valueOf() : value;
+ value = isObject(other) ? (other + '') : other;
+ }
+ if (typeof value != 'string') {
+ return value === 0 ? value : +value;
+ }
+ value = value.replace(reTrim, '');
+ var isBinary = reIsBinary.test(value);
+ return (isBinary || reIsOctal.test(value))
+ ? freeParseInt(value.slice(2), isBinary ? 2 : 8)
+ : (reIsBadHex.test(value) ? NAN : +value);
+}
+
+/**
+ * Converts `value` to a string if it's not one. An empty string is returned
+ * for `null` and `undefined` values. The sign of `-0` is preserved.
+ *
+ * @static
+ * @memberOf _
+ * @category Lang
+ * @param {*} value The value to process.
+ * @returns {string} Returns the string.
+ * @example
+ *
+ * _.toString(null);
+ * // => ''
+ *
+ * _.toString(-0);
+ * // => '-0'
+ *
+ * _.toString([1, 2, 3]);
+ * // => '1,2,3'
+ */
+function toString(value) {
+ // Exit early for strings to avoid a performance hit in some environments.
+ if (typeof value == 'string') {
+ return value;
+ }
+ if (value == null) {
+ return '';
+ }
+ if (isSymbol(value)) {
+ return Symbol ? symbolToString.call(value) : '';
+ }
+ var result = (value + '');
+ return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;
+}
/**
* Pads `string` on the left and right sides if it's shorter than `length`.
@@ -37,19 +412,18 @@ var nativeCeil = Math.ceil,
* // => 'abc'
*/
function pad(string, length, chars) {
- string = baseToString(string);
- length = +length;
+ string = toString(string);
+ length = toInteger(length);
- var strLength = string.length;
- if (strLength >= length || !nativeIsFinite(length)) {
+ var strLength = stringSize(string);
+ if (!length || strLength >= length) {
return string;
}
var mid = (length - strLength) / 2,
leftLength = nativeFloor(mid),
rightLength = nativeCeil(mid);
- chars = createPadding('', rightLength, chars);
- return chars.slice(0, leftLength) + string + chars;
+ return createPadding('', leftLength, chars) + string + createPadding('', rightLength, chars);
}
module.exports = pad;
diff --git a/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash.pad/node_modules/lodash.repeat/LICENSE b/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash.pad/node_modules/lodash.repeat/LICENSE
new file mode 100644
index 00000000000000..b054ca5a3ac7d6
--- /dev/null
+++ b/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash.pad/node_modules/lodash.repeat/LICENSE
@@ -0,0 +1,22 @@
+Copyright 2012-2016 The Dojo Foundation
+Based on Underscore.js, copyright 2009-2016 Jeremy Ashkenas,
+DocumentCloud and Investigative Reporters & Editors
+
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+"Software"), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
diff --git a/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash.pad/node_modules/lodash.repeat/README.md b/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash.pad/node_modules/lodash.repeat/README.md
new file mode 100644
index 00000000000000..a18ab41400d927
--- /dev/null
+++ b/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash.pad/node_modules/lodash.repeat/README.md
@@ -0,0 +1,18 @@
+# lodash.repeat v3.1.2
+
+The [lodash](https://lodash.com/) method `_.repeat` exported as a [Node.js](https://nodejs.org/) module.
+
+## Installation
+
+Using npm:
+```bash
+$ {sudo -H} npm i -g npm
+$ npm i --save lodash.repeat
+```
+
+In Node.js:
+```js
+var repeat = require('lodash.repeat');
+```
+
+See the [documentation](https://lodash.com/docs#repeat) or [package source](https://github.com/lodash/lodash/blob/3.1.2-npm-packages/lodash.repeat) for more details.
diff --git a/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash.pad/node_modules/lodash.repeat/index.js b/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash.pad/node_modules/lodash.repeat/index.js
new file mode 100644
index 00000000000000..f84e2a7f940304
--- /dev/null
+++ b/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash.pad/node_modules/lodash.repeat/index.js
@@ -0,0 +1,348 @@
+/**
+ * lodash 3.1.2 (Custom Build)
+ * Build: `lodash modularize exports="npm" -o ./`
+ * Copyright 2012-2016 The Dojo Foundation
+ * Based on Underscore.js 1.8.3
+ * Copyright 2009-2016 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
+ * Available under MIT license
+ */
+
+/** Used as references for various `Number` constants. */
+var INFINITY = 1 / 0,
+ MAX_SAFE_INTEGER = 9007199254740991,
+ MAX_INTEGER = 1.7976931348623157e+308,
+ NAN = 0 / 0;
+
+/** `Object#toString` result references. */
+var funcTag = '[object Function]',
+ genTag = '[object GeneratorFunction]',
+ symbolTag = '[object Symbol]';
+
+/** Used to match leading and trailing whitespace. */
+var reTrim = /^\s+|\s+$/g;
+
+/** Used to detect bad signed hexadecimal string values. */
+var reIsBadHex = /^[-+]0x[0-9a-f]+$/i;
+
+/** Used to detect binary string values. */
+var reIsBinary = /^0b[01]+$/i;
+
+/** Used to detect octal string values. */
+var reIsOctal = /^0o[0-7]+$/i;
+
+/** Used to determine if values are of the language type `Object`. */
+var objectTypes = {
+ 'function': true,
+ 'object': true
+};
+
+/** Built-in method references without a dependency on `root`. */
+var freeParseInt = parseInt;
+
+/** Detect free variable `exports`. */
+var freeExports = (objectTypes[typeof exports] && exports && !exports.nodeType) ? exports : null;
+
+/** Detect free variable `module`. */
+var freeModule = (objectTypes[typeof module] && module && !module.nodeType) ? module : null;
+
+/** Detect free variable `global` from Node.js. */
+var freeGlobal = checkGlobal(freeExports && freeModule && typeof global == 'object' && global);
+
+/** Detect free variable `self`. */
+var freeSelf = checkGlobal(objectTypes[typeof self] && self);
+
+/** Detect free variable `window`. */
+var freeWindow = checkGlobal(objectTypes[typeof window] && window);
+
+/** Detect `this` as the global object. */
+var thisGlobal = checkGlobal(objectTypes[typeof this] && this);
+
+/**
+ * Used as a reference to the global object.
+ *
+ * The `this` value is used if it's the global object to avoid Greasemonkey's
+ * restricted `window` object, otherwise the `window` object is used.
+ */
+var root = freeGlobal || ((freeWindow !== (thisGlobal && thisGlobal.window)) && freeWindow) || freeSelf || thisGlobal || Function('return this')();
+
+/**
+ * Checks if `value` is a global object.
+ *
+ * @private
+ * @param {*} value The value to check.
+ * @returns {null|Object} Returns `value` if it's a global object, else `null`.
+ */
+function checkGlobal(value) {
+ return (value && value.Object === Object) ? value : null;
+}
+
+/** Used for built-in method references. */
+var objectProto = Object.prototype;
+
+/**
+ * Used to resolve the [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring)
+ * of values.
+ */
+var objectToString = objectProto.toString;
+
+/** Built-in value references. */
+var Symbol = root.Symbol;
+
+/* Built-in method references for those with the same name as other `lodash` methods. */
+var nativeFloor = Math.floor;
+
+/** Used to convert symbols to primitives and strings. */
+var symbolProto = Symbol ? Symbol.prototype : undefined,
+ symbolToString = Symbol ? symbolProto.toString : undefined;
+
+/**
+ * Checks if `value` is classified as a `Function` object.
+ *
+ * @static
+ * @memberOf _
+ * @category Lang
+ * @param {*} value The value to check.
+ * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`.
+ * @example
+ *
+ * _.isFunction(_);
+ * // => true
+ *
+ * _.isFunction(/abc/);
+ * // => false
+ */
+function isFunction(value) {
+ // The use of `Object#toString` avoids issues with the `typeof` operator
+ // in Safari 8 which returns 'object' for typed array constructors, and
+ // PhantomJS 1.9 which returns 'function' for `NodeList` instances.
+ var tag = isObject(value) ? objectToString.call(value) : '';
+ return tag == funcTag || tag == genTag;
+}
+
+/**
+ * Checks if `value` is the [language type](https://es5.github.io/#x8) of `Object`.
+ * (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
+ *
+ * @static
+ * @memberOf _
+ * @category Lang
+ * @param {*} value The value to check.
+ * @returns {boolean} Returns `true` if `value` is an object, else `false`.
+ * @example
+ *
+ * _.isObject({});
+ * // => true
+ *
+ * _.isObject([1, 2, 3]);
+ * // => true
+ *
+ * _.isObject(_.noop);
+ * // => true
+ *
+ * _.isObject(null);
+ * // => false
+ */
+function isObject(value) {
+ var type = typeof value;
+ return !!value && (type == 'object' || type == 'function');
+}
+
+/**
+ * Checks if `value` is object-like. A value is object-like if it's not `null`
+ * and has a `typeof` result of "object".
+ *
+ * @static
+ * @memberOf _
+ * @category Lang
+ * @param {*} value The value to check.
+ * @returns {boolean} Returns `true` if `value` is object-like, else `false`.
+ * @example
+ *
+ * _.isObjectLike({});
+ * // => true
+ *
+ * _.isObjectLike([1, 2, 3]);
+ * // => true
+ *
+ * _.isObjectLike(_.noop);
+ * // => false
+ *
+ * _.isObjectLike(null);
+ * // => false
+ */
+function isObjectLike(value) {
+ return !!value && typeof value == 'object';
+}
+
+/**
+ * Checks if `value` is classified as a `Symbol` primitive or object.
+ *
+ * @static
+ * @memberOf _
+ * @category Lang
+ * @param {*} value The value to check.
+ * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`.
+ * @example
+ *
+ * _.isSymbol(Symbol.iterator);
+ * // => true
+ *
+ * _.isSymbol('abc');
+ * // => false
+ */
+function isSymbol(value) {
+ return typeof value == 'symbol' ||
+ (isObjectLike(value) && objectToString.call(value) == symbolTag);
+}
+
+/**
+ * Converts `value` to an integer.
+ *
+ * **Note:** This function is loosely based on [`ToInteger`](http://www.ecma-international.org/ecma-262/6.0/#sec-tointeger).
+ *
+ * @static
+ * @memberOf _
+ * @category Lang
+ * @param {*} value The value to convert.
+ * @returns {number} Returns the converted integer.
+ * @example
+ *
+ * _.toInteger(3);
+ * // => 3
+ *
+ * _.toInteger(Number.MIN_VALUE);
+ * // => 0
+ *
+ * _.toInteger(Infinity);
+ * // => 1.7976931348623157e+308
+ *
+ * _.toInteger('3');
+ * // => 3
+ */
+function toInteger(value) {
+ if (!value) {
+ return value === 0 ? value : 0;
+ }
+ value = toNumber(value);
+ if (value === INFINITY || value === -INFINITY) {
+ var sign = (value < 0 ? -1 : 1);
+ return sign * MAX_INTEGER;
+ }
+ var remainder = value % 1;
+ return value === value ? (remainder ? value - remainder : value) : 0;
+}
+
+/**
+ * Converts `value` to a number.
+ *
+ * @static
+ * @memberOf _
+ * @category Lang
+ * @param {*} value The value to process.
+ * @returns {number} Returns the number.
+ * @example
+ *
+ * _.toNumber(3);
+ * // => 3
+ *
+ * _.toNumber(Number.MIN_VALUE);
+ * // => 5e-324
+ *
+ * _.toNumber(Infinity);
+ * // => Infinity
+ *
+ * _.toNumber('3');
+ * // => 3
+ */
+function toNumber(value) {
+ if (isObject(value)) {
+ var other = isFunction(value.valueOf) ? value.valueOf() : value;
+ value = isObject(other) ? (other + '') : other;
+ }
+ if (typeof value != 'string') {
+ return value === 0 ? value : +value;
+ }
+ value = value.replace(reTrim, '');
+ var isBinary = reIsBinary.test(value);
+ return (isBinary || reIsOctal.test(value))
+ ? freeParseInt(value.slice(2), isBinary ? 2 : 8)
+ : (reIsBadHex.test(value) ? NAN : +value);
+}
+
+/**
+ * Converts `value` to a string if it's not one. An empty string is returned
+ * for `null` and `undefined` values. The sign of `-0` is preserved.
+ *
+ * @static
+ * @memberOf _
+ * @category Lang
+ * @param {*} value The value to process.
+ * @returns {string} Returns the string.
+ * @example
+ *
+ * _.toString(null);
+ * // => ''
+ *
+ * _.toString(-0);
+ * // => '-0'
+ *
+ * _.toString([1, 2, 3]);
+ * // => '1,2,3'
+ */
+function toString(value) {
+ // Exit early for strings to avoid a performance hit in some environments.
+ if (typeof value == 'string') {
+ return value;
+ }
+ if (value == null) {
+ return '';
+ }
+ if (isSymbol(value)) {
+ return Symbol ? symbolToString.call(value) : '';
+ }
+ var result = (value + '');
+ return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;
+}
+
+/**
+ * Repeats the given string `n` times.
+ *
+ * @static
+ * @memberOf _
+ * @category String
+ * @param {string} [string=''] The string to repeat.
+ * @param {number} [n=0] The number of times to repeat the string.
+ * @returns {string} Returns the repeated string.
+ * @example
+ *
+ * _.repeat('*', 3);
+ * // => '***'
+ *
+ * _.repeat('abc', 2);
+ * // => 'abcabc'
+ *
+ * _.repeat('abc', 0);
+ * // => ''
+ */
+function repeat(string, n) {
+ string = toString(string);
+ n = toInteger(n);
+
+ var result = '';
+ if (!string || n < 1 || n > MAX_SAFE_INTEGER) {
+ return result;
+ }
+ // Leverage the exponentiation by squaring algorithm for a faster repeat.
+ // See https://en.wikipedia.org/wiki/Exponentiation_by_squaring for more details.
+ do {
+ if (n % 2) {
+ result += string;
+ }
+ n = nativeFloor(n / 2);
+ string += string;
+ } while (n);
+
+ return result;
+}
+
+module.exports = repeat;
diff --git a/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash.pad/node_modules/lodash.repeat/package.json b/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash.pad/node_modules/lodash.repeat/package.json
new file mode 100644
index 00000000000000..ebe8dac4adb7a4
--- /dev/null
+++ b/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash.pad/node_modules/lodash.repeat/package.json
@@ -0,0 +1,77 @@
+{
+ "name": "lodash.repeat",
+ "version": "3.1.2",
+ "description": "The lodash method `_.repeat` exported as a module.",
+ "homepage": "https://lodash.com/",
+ "icon": "https://lodash.com/icon.svg",
+ "license": "MIT",
+ "keywords": [
+ "lodash-modularized",
+ "repeat"
+ ],
+ "author": {
+ "name": "John-David Dalton",
+ "email": "john.david.dalton@gmail.com",
+ "url": "http://allyoucanleet.com/"
+ },
+ "contributors": [
+ {
+ "name": "John-David Dalton",
+ "email": "john.david.dalton@gmail.com",
+ "url": "http://allyoucanleet.com/"
+ },
+ {
+ "name": "Blaine Bublitz",
+ "email": "blaine@iceddev.com",
+ "url": "https://github.com/phated"
+ },
+ {
+ "name": "Mathias Bynens",
+ "email": "mathias@qiwi.be",
+ "url": "https://mathiasbynens.be/"
+ }
+ ],
+ "repository": {
+ "type": "git",
+ "url": "git+https://github.com/lodash/lodash.git"
+ },
+ "scripts": {
+ "test": "echo \"See https://travis-ci.org/lodash/lodash-cli for testing details.\""
+ },
+ "bugs": {
+ "url": "https://github.com/lodash/lodash/issues"
+ },
+ "_id": "lodash.repeat@3.1.2",
+ "_shasum": "b5f35daab458353a7db5e45d439a1becfff4678d",
+ "_from": "lodash.repeat@>=3.0.0 <4.0.0",
+ "_npmVersion": "2.14.15",
+ "_nodeVersion": "5.4.0",
+ "_npmUser": {
+ "name": "jdalton",
+ "email": "john.david.dalton@gmail.com"
+ },
+ "dist": {
+ "shasum": "b5f35daab458353a7db5e45d439a1becfff4678d",
+ "tarball": "http://registry.npmjs.org/lodash.repeat/-/lodash.repeat-3.1.2.tgz"
+ },
+ "maintainers": [
+ {
+ "name": "jdalton",
+ "email": "john.david.dalton@gmail.com"
+ },
+ {
+ "name": "mathias",
+ "email": "mathias@qiwi.be"
+ },
+ {
+ "name": "phated",
+ "email": "blaine@iceddev.com"
+ }
+ ],
+ "_npmOperationalInternal": {
+ "host": "packages-6-west.internal.npmjs.com",
+ "tmp": "tmp/lodash.repeat-3.1.2.tgz_1454484666569_0.24294439097866416"
+ },
+ "directories": {},
+ "_resolved": "https://registry.npmjs.org/lodash.repeat/-/lodash.repeat-3.1.2.tgz"
+}
diff --git a/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash.pad/package.json b/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash.pad/package.json
index c18ed47167af3a..bda44d616150f7 100644
--- a/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash.pad/package.json
+++ b/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash.pad/package.json
@@ -1,15 +1,13 @@
{
"name": "lodash.pad",
- "version": "3.1.1",
- "description": "The modern build of lodash’s `_.pad` as a module.",
+ "version": "3.2.2",
+ "description": "The lodash method `_.pad` exported as a module.",
"homepage": "https://lodash.com/",
"icon": "https://lodash.com/icon.svg",
"license": "MIT",
"keywords": [
- "lodash",
"lodash-modularized",
- "stdlib",
- "util"
+ "pad"
],
"author": {
"name": "John-David Dalton",
@@ -22,20 +20,10 @@
"email": "john.david.dalton@gmail.com",
"url": "http://allyoucanleet.com/"
},
- {
- "name": "Benjamin Tan",
- "email": "demoneaux@gmail.com",
- "url": "https://d10.github.io/"
- },
{
"name": "Blaine Bublitz",
"email": "blaine@iceddev.com",
- "url": "http://www.iceddev.com/"
- },
- {
- "name": "Kit Cambridge",
- "email": "github@kitcambridge.be",
- "url": "http://kitcambridge.be/"
+ "url": "https://github.com/phated"
},
{
"name": "Mathias Bynens",
@@ -51,34 +39,29 @@
"test": "echo \"See https://travis-ci.org/lodash/lodash-cli for testing details.\""
},
"dependencies": {
- "lodash._basetostring": "^3.0.0",
- "lodash._createpadding": "^3.0.0"
+ "lodash.repeat": "^3.0.0"
},
"bugs": {
"url": "https://github.com/lodash/lodash/issues"
},
- "_id": "lodash.pad@3.1.1",
- "_shasum": "2e078ebc33b331d2ba34bf8732af129fd5c04624",
+ "_id": "lodash.pad@3.2.2",
+ "_shasum": "fb7fdded36eb773f839ab6b5291dac03cb65c88a",
"_from": "lodash.pad@>=3.0.0 <4.0.0",
- "_npmVersion": "2.12.0",
- "_nodeVersion": "0.12.5",
+ "_npmVersion": "2.14.15",
+ "_nodeVersion": "5.4.0",
"_npmUser": {
"name": "jdalton",
"email": "john.david.dalton@gmail.com"
},
+ "dist": {
+ "shasum": "fb7fdded36eb773f839ab6b5291dac03cb65c88a",
+ "tarball": "http://registry.npmjs.org/lodash.pad/-/lodash.pad-3.2.2.tgz"
+ },
"maintainers": [
{
"name": "jdalton",
"email": "john.david.dalton@gmail.com"
},
- {
- "name": "d10",
- "email": "demoneaux@gmail.com"
- },
- {
- "name": "kitcambridge",
- "email": "github@kitcambridge.be"
- },
{
"name": "mathias",
"email": "mathias@qiwi.be"
@@ -88,11 +71,10 @@
"email": "blaine@iceddev.com"
}
],
- "dist": {
- "shasum": "2e078ebc33b331d2ba34bf8732af129fd5c04624",
- "tarball": "http://registry.npmjs.org/lodash.pad/-/lodash.pad-3.1.1.tgz"
+ "_npmOperationalInternal": {
+ "host": "packages-9-west.internal.npmjs.com",
+ "tmp": "tmp/lodash.pad-3.2.2.tgz_1454484625805_0.547145590884611"
},
"directories": {},
- "_resolved": "https://registry.npmjs.org/lodash.pad/-/lodash.pad-3.1.1.tgz",
- "readme": "ERROR: No README data found!"
+ "_resolved": "https://registry.npmjs.org/lodash.pad/-/lodash.pad-3.2.2.tgz"
}
diff --git a/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padleft/node_modules/lodash._createpadding/node_modules/lodash.repeat/LICENSE b/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padleft/node_modules/lodash._createpadding/node_modules/lodash.repeat/LICENSE
index 9cd87e5dcefe58..b054ca5a3ac7d6 100644
--- a/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padleft/node_modules/lodash._createpadding/node_modules/lodash.repeat/LICENSE
+++ b/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padleft/node_modules/lodash._createpadding/node_modules/lodash.repeat/LICENSE
@@ -1,5 +1,5 @@
-Copyright 2012-2015 The Dojo Foundation
-Based on Underscore.js, copyright 2009-2015 Jeremy Ashkenas,
+Copyright 2012-2016 The Dojo Foundation
+Based on Underscore.js, copyright 2009-2016 Jeremy Ashkenas,
DocumentCloud and Investigative Reporters & Editors
Permission is hereby granted, free of charge, to any person obtaining
diff --git a/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padleft/node_modules/lodash._createpadding/node_modules/lodash.repeat/README.md b/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padleft/node_modules/lodash._createpadding/node_modules/lodash.repeat/README.md
index dec571a333a52a..a18ab41400d927 100644
--- a/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padleft/node_modules/lodash._createpadding/node_modules/lodash.repeat/README.md
+++ b/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padleft/node_modules/lodash._createpadding/node_modules/lodash.repeat/README.md
@@ -1,20 +1,18 @@
-# lodash.repeat v3.0.1
+# lodash.repeat v3.1.2
-The [modern build](https://github.com/lodash/lodash/wiki/Build-Differences) of [lodash’s](https://lodash.com/) `_.repeat` exported as a [Node.js](http://nodejs.org/)/[io.js](https://iojs.org/) module.
+The [lodash](https://lodash.com/) method `_.repeat` exported as a [Node.js](https://nodejs.org/) module.
## Installation
Using npm:
-
```bash
$ {sudo -H} npm i -g npm
$ npm i --save lodash.repeat
```
-In Node.js/io.js:
-
+In Node.js:
```js
var repeat = require('lodash.repeat');
```
-See the [documentation](https://lodash.com/docs#repeat) or [package source](https://github.com/lodash/lodash/blob/3.0.1-npm-packages/lodash.repeat) for more details.
+See the [documentation](https://lodash.com/docs#repeat) or [package source](https://github.com/lodash/lodash/blob/3.1.2-npm-packages/lodash.repeat) for more details.
diff --git a/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padleft/node_modules/lodash._createpadding/node_modules/lodash.repeat/index.js b/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padleft/node_modules/lodash._createpadding/node_modules/lodash.repeat/index.js
index 367913f56e0ada..f84e2a7f940304 100644
--- a/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padleft/node_modules/lodash._createpadding/node_modules/lodash.repeat/index.js
+++ b/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padleft/node_modules/lodash._createpadding/node_modules/lodash.repeat/index.js
@@ -1,16 +1,308 @@
/**
- * lodash 3.0.1 (Custom Build)
- * Build: `lodash modern modularize exports="npm" -o ./`
- * Copyright 2012-2015 The Dojo Foundation
+ * lodash 3.1.2 (Custom Build)
+ * Build: `lodash modularize exports="npm" -o ./`
+ * Copyright 2012-2016 The Dojo Foundation
* Based on Underscore.js 1.8.3
- * Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
+ * Copyright 2009-2016 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
* Available under MIT license
*/
-var baseToString = require('lodash._basetostring');
-/* Native method references for those with the same name as other `lodash` methods. */
-var nativeFloor = Math.floor,
- nativeIsFinite = global.isFinite;
+/** Used as references for various `Number` constants. */
+var INFINITY = 1 / 0,
+ MAX_SAFE_INTEGER = 9007199254740991,
+ MAX_INTEGER = 1.7976931348623157e+308,
+ NAN = 0 / 0;
+
+/** `Object#toString` result references. */
+var funcTag = '[object Function]',
+ genTag = '[object GeneratorFunction]',
+ symbolTag = '[object Symbol]';
+
+/** Used to match leading and trailing whitespace. */
+var reTrim = /^\s+|\s+$/g;
+
+/** Used to detect bad signed hexadecimal string values. */
+var reIsBadHex = /^[-+]0x[0-9a-f]+$/i;
+
+/** Used to detect binary string values. */
+var reIsBinary = /^0b[01]+$/i;
+
+/** Used to detect octal string values. */
+var reIsOctal = /^0o[0-7]+$/i;
+
+/** Used to determine if values are of the language type `Object`. */
+var objectTypes = {
+ 'function': true,
+ 'object': true
+};
+
+/** Built-in method references without a dependency on `root`. */
+var freeParseInt = parseInt;
+
+/** Detect free variable `exports`. */
+var freeExports = (objectTypes[typeof exports] && exports && !exports.nodeType) ? exports : null;
+
+/** Detect free variable `module`. */
+var freeModule = (objectTypes[typeof module] && module && !module.nodeType) ? module : null;
+
+/** Detect free variable `global` from Node.js. */
+var freeGlobal = checkGlobal(freeExports && freeModule && typeof global == 'object' && global);
+
+/** Detect free variable `self`. */
+var freeSelf = checkGlobal(objectTypes[typeof self] && self);
+
+/** Detect free variable `window`. */
+var freeWindow = checkGlobal(objectTypes[typeof window] && window);
+
+/** Detect `this` as the global object. */
+var thisGlobal = checkGlobal(objectTypes[typeof this] && this);
+
+/**
+ * Used as a reference to the global object.
+ *
+ * The `this` value is used if it's the global object to avoid Greasemonkey's
+ * restricted `window` object, otherwise the `window` object is used.
+ */
+var root = freeGlobal || ((freeWindow !== (thisGlobal && thisGlobal.window)) && freeWindow) || freeSelf || thisGlobal || Function('return this')();
+
+/**
+ * Checks if `value` is a global object.
+ *
+ * @private
+ * @param {*} value The value to check.
+ * @returns {null|Object} Returns `value` if it's a global object, else `null`.
+ */
+function checkGlobal(value) {
+ return (value && value.Object === Object) ? value : null;
+}
+
+/** Used for built-in method references. */
+var objectProto = Object.prototype;
+
+/**
+ * Used to resolve the [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring)
+ * of values.
+ */
+var objectToString = objectProto.toString;
+
+/** Built-in value references. */
+var Symbol = root.Symbol;
+
+/* Built-in method references for those with the same name as other `lodash` methods. */
+var nativeFloor = Math.floor;
+
+/** Used to convert symbols to primitives and strings. */
+var symbolProto = Symbol ? Symbol.prototype : undefined,
+ symbolToString = Symbol ? symbolProto.toString : undefined;
+
+/**
+ * Checks if `value` is classified as a `Function` object.
+ *
+ * @static
+ * @memberOf _
+ * @category Lang
+ * @param {*} value The value to check.
+ * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`.
+ * @example
+ *
+ * _.isFunction(_);
+ * // => true
+ *
+ * _.isFunction(/abc/);
+ * // => false
+ */
+function isFunction(value) {
+ // The use of `Object#toString` avoids issues with the `typeof` operator
+ // in Safari 8 which returns 'object' for typed array constructors, and
+ // PhantomJS 1.9 which returns 'function' for `NodeList` instances.
+ var tag = isObject(value) ? objectToString.call(value) : '';
+ return tag == funcTag || tag == genTag;
+}
+
+/**
+ * Checks if `value` is the [language type](https://es5.github.io/#x8) of `Object`.
+ * (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
+ *
+ * @static
+ * @memberOf _
+ * @category Lang
+ * @param {*} value The value to check.
+ * @returns {boolean} Returns `true` if `value` is an object, else `false`.
+ * @example
+ *
+ * _.isObject({});
+ * // => true
+ *
+ * _.isObject([1, 2, 3]);
+ * // => true
+ *
+ * _.isObject(_.noop);
+ * // => true
+ *
+ * _.isObject(null);
+ * // => false
+ */
+function isObject(value) {
+ var type = typeof value;
+ return !!value && (type == 'object' || type == 'function');
+}
+
+/**
+ * Checks if `value` is object-like. A value is object-like if it's not `null`
+ * and has a `typeof` result of "object".
+ *
+ * @static
+ * @memberOf _
+ * @category Lang
+ * @param {*} value The value to check.
+ * @returns {boolean} Returns `true` if `value` is object-like, else `false`.
+ * @example
+ *
+ * _.isObjectLike({});
+ * // => true
+ *
+ * _.isObjectLike([1, 2, 3]);
+ * // => true
+ *
+ * _.isObjectLike(_.noop);
+ * // => false
+ *
+ * _.isObjectLike(null);
+ * // => false
+ */
+function isObjectLike(value) {
+ return !!value && typeof value == 'object';
+}
+
+/**
+ * Checks if `value` is classified as a `Symbol` primitive or object.
+ *
+ * @static
+ * @memberOf _
+ * @category Lang
+ * @param {*} value The value to check.
+ * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`.
+ * @example
+ *
+ * _.isSymbol(Symbol.iterator);
+ * // => true
+ *
+ * _.isSymbol('abc');
+ * // => false
+ */
+function isSymbol(value) {
+ return typeof value == 'symbol' ||
+ (isObjectLike(value) && objectToString.call(value) == symbolTag);
+}
+
+/**
+ * Converts `value` to an integer.
+ *
+ * **Note:** This function is loosely based on [`ToInteger`](http://www.ecma-international.org/ecma-262/6.0/#sec-tointeger).
+ *
+ * @static
+ * @memberOf _
+ * @category Lang
+ * @param {*} value The value to convert.
+ * @returns {number} Returns the converted integer.
+ * @example
+ *
+ * _.toInteger(3);
+ * // => 3
+ *
+ * _.toInteger(Number.MIN_VALUE);
+ * // => 0
+ *
+ * _.toInteger(Infinity);
+ * // => 1.7976931348623157e+308
+ *
+ * _.toInteger('3');
+ * // => 3
+ */
+function toInteger(value) {
+ if (!value) {
+ return value === 0 ? value : 0;
+ }
+ value = toNumber(value);
+ if (value === INFINITY || value === -INFINITY) {
+ var sign = (value < 0 ? -1 : 1);
+ return sign * MAX_INTEGER;
+ }
+ var remainder = value % 1;
+ return value === value ? (remainder ? value - remainder : value) : 0;
+}
+
+/**
+ * Converts `value` to a number.
+ *
+ * @static
+ * @memberOf _
+ * @category Lang
+ * @param {*} value The value to process.
+ * @returns {number} Returns the number.
+ * @example
+ *
+ * _.toNumber(3);
+ * // => 3
+ *
+ * _.toNumber(Number.MIN_VALUE);
+ * // => 5e-324
+ *
+ * _.toNumber(Infinity);
+ * // => Infinity
+ *
+ * _.toNumber('3');
+ * // => 3
+ */
+function toNumber(value) {
+ if (isObject(value)) {
+ var other = isFunction(value.valueOf) ? value.valueOf() : value;
+ value = isObject(other) ? (other + '') : other;
+ }
+ if (typeof value != 'string') {
+ return value === 0 ? value : +value;
+ }
+ value = value.replace(reTrim, '');
+ var isBinary = reIsBinary.test(value);
+ return (isBinary || reIsOctal.test(value))
+ ? freeParseInt(value.slice(2), isBinary ? 2 : 8)
+ : (reIsBadHex.test(value) ? NAN : +value);
+}
+
+/**
+ * Converts `value` to a string if it's not one. An empty string is returned
+ * for `null` and `undefined` values. The sign of `-0` is preserved.
+ *
+ * @static
+ * @memberOf _
+ * @category Lang
+ * @param {*} value The value to process.
+ * @returns {string} Returns the string.
+ * @example
+ *
+ * _.toString(null);
+ * // => ''
+ *
+ * _.toString(-0);
+ * // => '-0'
+ *
+ * _.toString([1, 2, 3]);
+ * // => '1,2,3'
+ */
+function toString(value) {
+ // Exit early for strings to avoid a performance hit in some environments.
+ if (typeof value == 'string') {
+ return value;
+ }
+ if (value == null) {
+ return '';
+ }
+ if (isSymbol(value)) {
+ return Symbol ? symbolToString.call(value) : '';
+ }
+ var result = (value + '');
+ return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;
+}
/**
* Repeats the given string `n` times.
@@ -33,10 +325,11 @@ var nativeFloor = Math.floor,
* // => ''
*/
function repeat(string, n) {
+ string = toString(string);
+ n = toInteger(n);
+
var result = '';
- string = baseToString(string);
- n = +n;
- if (n < 1 || !string || !nativeIsFinite(n)) {
+ if (!string || n < 1 || n > MAX_SAFE_INTEGER) {
return result;
}
// Leverage the exponentiation by squaring algorithm for a faster repeat.
diff --git a/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padleft/node_modules/lodash._createpadding/node_modules/lodash.repeat/package.json b/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padleft/node_modules/lodash._createpadding/node_modules/lodash.repeat/package.json
index f941138c4bfdcf..0f5f95313cc0a4 100644
--- a/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padleft/node_modules/lodash._createpadding/node_modules/lodash.repeat/package.json
+++ b/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padleft/node_modules/lodash._createpadding/node_modules/lodash.repeat/package.json
@@ -1,15 +1,13 @@
{
"name": "lodash.repeat",
- "version": "3.0.1",
- "description": "The modern build of lodash’s `_.repeat` as a module.",
+ "version": "3.1.2",
+ "description": "The lodash method `_.repeat` exported as a module.",
"homepage": "https://lodash.com/",
"icon": "https://lodash.com/icon.svg",
"license": "MIT",
"keywords": [
- "lodash",
"lodash-modularized",
- "stdlib",
- "util"
+ "repeat"
],
"author": {
"name": "John-David Dalton",
@@ -22,20 +20,10 @@
"email": "john.david.dalton@gmail.com",
"url": "http://allyoucanleet.com/"
},
- {
- "name": "Benjamin Tan",
- "email": "demoneaux@gmail.com",
- "url": "https://d10.github.io/"
- },
{
"name": "Blaine Bublitz",
"email": "blaine@iceddev.com",
- "url": "http://www.iceddev.com/"
- },
- {
- "name": "Kit Cambridge",
- "email": "github@kitcambridge.be",
- "url": "http://kitcambridge.be/"
+ "url": "https://github.com/phated"
},
{
"name": "Mathias Bynens",
@@ -50,34 +38,27 @@
"scripts": {
"test": "echo \"See https://travis-ci.org/lodash/lodash-cli for testing details.\""
},
- "dependencies": {
- "lodash._basetostring": "^3.0.0"
- },
"bugs": {
"url": "https://github.com/lodash/lodash/issues"
},
- "_id": "lodash.repeat@3.0.1",
- "_shasum": "f4b98dc7ef67256ce61e7874e1865edb208e0edf",
+ "_id": "lodash.repeat@3.1.2",
+ "_shasum": "b5f35daab458353a7db5e45d439a1becfff4678d",
"_from": "lodash.repeat@>=3.0.0 <4.0.0",
- "_npmVersion": "2.12.0",
- "_nodeVersion": "0.12.5",
+ "_npmVersion": "2.14.15",
+ "_nodeVersion": "5.4.0",
"_npmUser": {
"name": "jdalton",
"email": "john.david.dalton@gmail.com"
},
+ "dist": {
+ "shasum": "b5f35daab458353a7db5e45d439a1becfff4678d",
+ "tarball": "http://registry.npmjs.org/lodash.repeat/-/lodash.repeat-3.1.2.tgz"
+ },
"maintainers": [
{
"name": "jdalton",
"email": "john.david.dalton@gmail.com"
},
- {
- "name": "d10",
- "email": "demoneaux@gmail.com"
- },
- {
- "name": "kitcambridge",
- "email": "github@kitcambridge.be"
- },
{
"name": "mathias",
"email": "mathias@qiwi.be"
@@ -87,11 +68,11 @@
"email": "blaine@iceddev.com"
}
],
- "dist": {
- "shasum": "f4b98dc7ef67256ce61e7874e1865edb208e0edf",
- "tarball": "http://registry.npmjs.org/lodash.repeat/-/lodash.repeat-3.0.1.tgz"
+ "_npmOperationalInternal": {
+ "host": "packages-6-west.internal.npmjs.com",
+ "tmp": "tmp/lodash.repeat-3.1.2.tgz_1454484666569_0.24294439097866416"
},
"directories": {},
- "_resolved": "https://registry.npmjs.org/lodash.repeat/-/lodash.repeat-3.0.1.tgz",
+ "_resolved": "https://registry.npmjs.org/lodash.repeat/-/lodash.repeat-3.1.2.tgz",
"readme": "ERROR: No README data found!"
}
diff --git a/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padleft/node_modules/lodash._createpadding/package.json b/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padleft/node_modules/lodash._createpadding/package.json
index 376b174bee4ab4..8b820a88571a5e 100644
--- a/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padleft/node_modules/lodash._createpadding/package.json
+++ b/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padleft/node_modules/lodash._createpadding/package.json
@@ -86,6 +86,5 @@
"tarball": "http://registry.npmjs.org/lodash._createpadding/-/lodash._createpadding-3.6.1.tgz"
},
"directories": {},
- "_resolved": "https://registry.npmjs.org/lodash._createpadding/-/lodash._createpadding-3.6.1.tgz",
- "readme": "ERROR: No README data found!"
+ "_resolved": "https://registry.npmjs.org/lodash._createpadding/-/lodash._createpadding-3.6.1.tgz"
}
diff --git a/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padleft/package.json b/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padleft/package.json
index 55b0c256f9d1bc..b8e25f6282d084 100644
--- a/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padleft/package.json
+++ b/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padleft/package.json
@@ -93,6 +93,5 @@
"tarball": "http://registry.npmjs.org/lodash.padleft/-/lodash.padleft-3.1.1.tgz"
},
"directories": {},
- "_resolved": "https://registry.npmjs.org/lodash.padleft/-/lodash.padleft-3.1.1.tgz",
- "readme": "ERROR: No README data found!"
+ "_resolved": "https://registry.npmjs.org/lodash.padleft/-/lodash.padleft-3.1.1.tgz"
}
diff --git a/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padright/node_modules/lodash._createpadding/node_modules/lodash.repeat/LICENSE b/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padright/node_modules/lodash._createpadding/node_modules/lodash.repeat/LICENSE
index 9cd87e5dcefe58..b054ca5a3ac7d6 100644
--- a/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padright/node_modules/lodash._createpadding/node_modules/lodash.repeat/LICENSE
+++ b/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padright/node_modules/lodash._createpadding/node_modules/lodash.repeat/LICENSE
@@ -1,5 +1,5 @@
-Copyright 2012-2015 The Dojo Foundation
-Based on Underscore.js, copyright 2009-2015 Jeremy Ashkenas,
+Copyright 2012-2016 The Dojo Foundation
+Based on Underscore.js, copyright 2009-2016 Jeremy Ashkenas,
DocumentCloud and Investigative Reporters & Editors
Permission is hereby granted, free of charge, to any person obtaining
diff --git a/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padright/node_modules/lodash._createpadding/node_modules/lodash.repeat/README.md b/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padright/node_modules/lodash._createpadding/node_modules/lodash.repeat/README.md
index dec571a333a52a..a18ab41400d927 100644
--- a/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padright/node_modules/lodash._createpadding/node_modules/lodash.repeat/README.md
+++ b/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padright/node_modules/lodash._createpadding/node_modules/lodash.repeat/README.md
@@ -1,20 +1,18 @@
-# lodash.repeat v3.0.1
+# lodash.repeat v3.1.2
-The [modern build](https://github.com/lodash/lodash/wiki/Build-Differences) of [lodash’s](https://lodash.com/) `_.repeat` exported as a [Node.js](http://nodejs.org/)/[io.js](https://iojs.org/) module.
+The [lodash](https://lodash.com/) method `_.repeat` exported as a [Node.js](https://nodejs.org/) module.
## Installation
Using npm:
-
```bash
$ {sudo -H} npm i -g npm
$ npm i --save lodash.repeat
```
-In Node.js/io.js:
-
+In Node.js:
```js
var repeat = require('lodash.repeat');
```
-See the [documentation](https://lodash.com/docs#repeat) or [package source](https://github.com/lodash/lodash/blob/3.0.1-npm-packages/lodash.repeat) for more details.
+See the [documentation](https://lodash.com/docs#repeat) or [package source](https://github.com/lodash/lodash/blob/3.1.2-npm-packages/lodash.repeat) for more details.
diff --git a/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padright/node_modules/lodash._createpadding/node_modules/lodash.repeat/index.js b/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padright/node_modules/lodash._createpadding/node_modules/lodash.repeat/index.js
index 367913f56e0ada..f84e2a7f940304 100644
--- a/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padright/node_modules/lodash._createpadding/node_modules/lodash.repeat/index.js
+++ b/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padright/node_modules/lodash._createpadding/node_modules/lodash.repeat/index.js
@@ -1,16 +1,308 @@
/**
- * lodash 3.0.1 (Custom Build)
- * Build: `lodash modern modularize exports="npm" -o ./`
- * Copyright 2012-2015 The Dojo Foundation
+ * lodash 3.1.2 (Custom Build)
+ * Build: `lodash modularize exports="npm" -o ./`
+ * Copyright 2012-2016 The Dojo Foundation
* Based on Underscore.js 1.8.3
- * Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
+ * Copyright 2009-2016 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
* Available under MIT license
*/
-var baseToString = require('lodash._basetostring');
-/* Native method references for those with the same name as other `lodash` methods. */
-var nativeFloor = Math.floor,
- nativeIsFinite = global.isFinite;
+/** Used as references for various `Number` constants. */
+var INFINITY = 1 / 0,
+ MAX_SAFE_INTEGER = 9007199254740991,
+ MAX_INTEGER = 1.7976931348623157e+308,
+ NAN = 0 / 0;
+
+/** `Object#toString` result references. */
+var funcTag = '[object Function]',
+ genTag = '[object GeneratorFunction]',
+ symbolTag = '[object Symbol]';
+
+/** Used to match leading and trailing whitespace. */
+var reTrim = /^\s+|\s+$/g;
+
+/** Used to detect bad signed hexadecimal string values. */
+var reIsBadHex = /^[-+]0x[0-9a-f]+$/i;
+
+/** Used to detect binary string values. */
+var reIsBinary = /^0b[01]+$/i;
+
+/** Used to detect octal string values. */
+var reIsOctal = /^0o[0-7]+$/i;
+
+/** Used to determine if values are of the language type `Object`. */
+var objectTypes = {
+ 'function': true,
+ 'object': true
+};
+
+/** Built-in method references without a dependency on `root`. */
+var freeParseInt = parseInt;
+
+/** Detect free variable `exports`. */
+var freeExports = (objectTypes[typeof exports] && exports && !exports.nodeType) ? exports : null;
+
+/** Detect free variable `module`. */
+var freeModule = (objectTypes[typeof module] && module && !module.nodeType) ? module : null;
+
+/** Detect free variable `global` from Node.js. */
+var freeGlobal = checkGlobal(freeExports && freeModule && typeof global == 'object' && global);
+
+/** Detect free variable `self`. */
+var freeSelf = checkGlobal(objectTypes[typeof self] && self);
+
+/** Detect free variable `window`. */
+var freeWindow = checkGlobal(objectTypes[typeof window] && window);
+
+/** Detect `this` as the global object. */
+var thisGlobal = checkGlobal(objectTypes[typeof this] && this);
+
+/**
+ * Used as a reference to the global object.
+ *
+ * The `this` value is used if it's the global object to avoid Greasemonkey's
+ * restricted `window` object, otherwise the `window` object is used.
+ */
+var root = freeGlobal || ((freeWindow !== (thisGlobal && thisGlobal.window)) && freeWindow) || freeSelf || thisGlobal || Function('return this')();
+
+/**
+ * Checks if `value` is a global object.
+ *
+ * @private
+ * @param {*} value The value to check.
+ * @returns {null|Object} Returns `value` if it's a global object, else `null`.
+ */
+function checkGlobal(value) {
+ return (value && value.Object === Object) ? value : null;
+}
+
+/** Used for built-in method references. */
+var objectProto = Object.prototype;
+
+/**
+ * Used to resolve the [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring)
+ * of values.
+ */
+var objectToString = objectProto.toString;
+
+/** Built-in value references. */
+var Symbol = root.Symbol;
+
+/* Built-in method references for those with the same name as other `lodash` methods. */
+var nativeFloor = Math.floor;
+
+/** Used to convert symbols to primitives and strings. */
+var symbolProto = Symbol ? Symbol.prototype : undefined,
+ symbolToString = Symbol ? symbolProto.toString : undefined;
+
+/**
+ * Checks if `value` is classified as a `Function` object.
+ *
+ * @static
+ * @memberOf _
+ * @category Lang
+ * @param {*} value The value to check.
+ * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`.
+ * @example
+ *
+ * _.isFunction(_);
+ * // => true
+ *
+ * _.isFunction(/abc/);
+ * // => false
+ */
+function isFunction(value) {
+ // The use of `Object#toString` avoids issues with the `typeof` operator
+ // in Safari 8 which returns 'object' for typed array constructors, and
+ // PhantomJS 1.9 which returns 'function' for `NodeList` instances.
+ var tag = isObject(value) ? objectToString.call(value) : '';
+ return tag == funcTag || tag == genTag;
+}
+
+/**
+ * Checks if `value` is the [language type](https://es5.github.io/#x8) of `Object`.
+ * (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
+ *
+ * @static
+ * @memberOf _
+ * @category Lang
+ * @param {*} value The value to check.
+ * @returns {boolean} Returns `true` if `value` is an object, else `false`.
+ * @example
+ *
+ * _.isObject({});
+ * // => true
+ *
+ * _.isObject([1, 2, 3]);
+ * // => true
+ *
+ * _.isObject(_.noop);
+ * // => true
+ *
+ * _.isObject(null);
+ * // => false
+ */
+function isObject(value) {
+ var type = typeof value;
+ return !!value && (type == 'object' || type == 'function');
+}
+
+/**
+ * Checks if `value` is object-like. A value is object-like if it's not `null`
+ * and has a `typeof` result of "object".
+ *
+ * @static
+ * @memberOf _
+ * @category Lang
+ * @param {*} value The value to check.
+ * @returns {boolean} Returns `true` if `value` is object-like, else `false`.
+ * @example
+ *
+ * _.isObjectLike({});
+ * // => true
+ *
+ * _.isObjectLike([1, 2, 3]);
+ * // => true
+ *
+ * _.isObjectLike(_.noop);
+ * // => false
+ *
+ * _.isObjectLike(null);
+ * // => false
+ */
+function isObjectLike(value) {
+ return !!value && typeof value == 'object';
+}
+
+/**
+ * Checks if `value` is classified as a `Symbol` primitive or object.
+ *
+ * @static
+ * @memberOf _
+ * @category Lang
+ * @param {*} value The value to check.
+ * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`.
+ * @example
+ *
+ * _.isSymbol(Symbol.iterator);
+ * // => true
+ *
+ * _.isSymbol('abc');
+ * // => false
+ */
+function isSymbol(value) {
+ return typeof value == 'symbol' ||
+ (isObjectLike(value) && objectToString.call(value) == symbolTag);
+}
+
+/**
+ * Converts `value` to an integer.
+ *
+ * **Note:** This function is loosely based on [`ToInteger`](http://www.ecma-international.org/ecma-262/6.0/#sec-tointeger).
+ *
+ * @static
+ * @memberOf _
+ * @category Lang
+ * @param {*} value The value to convert.
+ * @returns {number} Returns the converted integer.
+ * @example
+ *
+ * _.toInteger(3);
+ * // => 3
+ *
+ * _.toInteger(Number.MIN_VALUE);
+ * // => 0
+ *
+ * _.toInteger(Infinity);
+ * // => 1.7976931348623157e+308
+ *
+ * _.toInteger('3');
+ * // => 3
+ */
+function toInteger(value) {
+ if (!value) {
+ return value === 0 ? value : 0;
+ }
+ value = toNumber(value);
+ if (value === INFINITY || value === -INFINITY) {
+ var sign = (value < 0 ? -1 : 1);
+ return sign * MAX_INTEGER;
+ }
+ var remainder = value % 1;
+ return value === value ? (remainder ? value - remainder : value) : 0;
+}
+
+/**
+ * Converts `value` to a number.
+ *
+ * @static
+ * @memberOf _
+ * @category Lang
+ * @param {*} value The value to process.
+ * @returns {number} Returns the number.
+ * @example
+ *
+ * _.toNumber(3);
+ * // => 3
+ *
+ * _.toNumber(Number.MIN_VALUE);
+ * // => 5e-324
+ *
+ * _.toNumber(Infinity);
+ * // => Infinity
+ *
+ * _.toNumber('3');
+ * // => 3
+ */
+function toNumber(value) {
+ if (isObject(value)) {
+ var other = isFunction(value.valueOf) ? value.valueOf() : value;
+ value = isObject(other) ? (other + '') : other;
+ }
+ if (typeof value != 'string') {
+ return value === 0 ? value : +value;
+ }
+ value = value.replace(reTrim, '');
+ var isBinary = reIsBinary.test(value);
+ return (isBinary || reIsOctal.test(value))
+ ? freeParseInt(value.slice(2), isBinary ? 2 : 8)
+ : (reIsBadHex.test(value) ? NAN : +value);
+}
+
+/**
+ * Converts `value` to a string if it's not one. An empty string is returned
+ * for `null` and `undefined` values. The sign of `-0` is preserved.
+ *
+ * @static
+ * @memberOf _
+ * @category Lang
+ * @param {*} value The value to process.
+ * @returns {string} Returns the string.
+ * @example
+ *
+ * _.toString(null);
+ * // => ''
+ *
+ * _.toString(-0);
+ * // => '-0'
+ *
+ * _.toString([1, 2, 3]);
+ * // => '1,2,3'
+ */
+function toString(value) {
+ // Exit early for strings to avoid a performance hit in some environments.
+ if (typeof value == 'string') {
+ return value;
+ }
+ if (value == null) {
+ return '';
+ }
+ if (isSymbol(value)) {
+ return Symbol ? symbolToString.call(value) : '';
+ }
+ var result = (value + '');
+ return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;
+}
/**
* Repeats the given string `n` times.
@@ -33,10 +325,11 @@ var nativeFloor = Math.floor,
* // => ''
*/
function repeat(string, n) {
+ string = toString(string);
+ n = toInteger(n);
+
var result = '';
- string = baseToString(string);
- n = +n;
- if (n < 1 || !string || !nativeIsFinite(n)) {
+ if (!string || n < 1 || n > MAX_SAFE_INTEGER) {
return result;
}
// Leverage the exponentiation by squaring algorithm for a faster repeat.
diff --git a/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padright/node_modules/lodash._createpadding/node_modules/lodash.repeat/package.json b/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padright/node_modules/lodash._createpadding/node_modules/lodash.repeat/package.json
index f941138c4bfdcf..0f5f95313cc0a4 100644
--- a/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padright/node_modules/lodash._createpadding/node_modules/lodash.repeat/package.json
+++ b/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padright/node_modules/lodash._createpadding/node_modules/lodash.repeat/package.json
@@ -1,15 +1,13 @@
{
"name": "lodash.repeat",
- "version": "3.0.1",
- "description": "The modern build of lodash’s `_.repeat` as a module.",
+ "version": "3.1.2",
+ "description": "The lodash method `_.repeat` exported as a module.",
"homepage": "https://lodash.com/",
"icon": "https://lodash.com/icon.svg",
"license": "MIT",
"keywords": [
- "lodash",
"lodash-modularized",
- "stdlib",
- "util"
+ "repeat"
],
"author": {
"name": "John-David Dalton",
@@ -22,20 +20,10 @@
"email": "john.david.dalton@gmail.com",
"url": "http://allyoucanleet.com/"
},
- {
- "name": "Benjamin Tan",
- "email": "demoneaux@gmail.com",
- "url": "https://d10.github.io/"
- },
{
"name": "Blaine Bublitz",
"email": "blaine@iceddev.com",
- "url": "http://www.iceddev.com/"
- },
- {
- "name": "Kit Cambridge",
- "email": "github@kitcambridge.be",
- "url": "http://kitcambridge.be/"
+ "url": "https://github.com/phated"
},
{
"name": "Mathias Bynens",
@@ -50,34 +38,27 @@
"scripts": {
"test": "echo \"See https://travis-ci.org/lodash/lodash-cli for testing details.\""
},
- "dependencies": {
- "lodash._basetostring": "^3.0.0"
- },
"bugs": {
"url": "https://github.com/lodash/lodash/issues"
},
- "_id": "lodash.repeat@3.0.1",
- "_shasum": "f4b98dc7ef67256ce61e7874e1865edb208e0edf",
+ "_id": "lodash.repeat@3.1.2",
+ "_shasum": "b5f35daab458353a7db5e45d439a1becfff4678d",
"_from": "lodash.repeat@>=3.0.0 <4.0.0",
- "_npmVersion": "2.12.0",
- "_nodeVersion": "0.12.5",
+ "_npmVersion": "2.14.15",
+ "_nodeVersion": "5.4.0",
"_npmUser": {
"name": "jdalton",
"email": "john.david.dalton@gmail.com"
},
+ "dist": {
+ "shasum": "b5f35daab458353a7db5e45d439a1becfff4678d",
+ "tarball": "http://registry.npmjs.org/lodash.repeat/-/lodash.repeat-3.1.2.tgz"
+ },
"maintainers": [
{
"name": "jdalton",
"email": "john.david.dalton@gmail.com"
},
- {
- "name": "d10",
- "email": "demoneaux@gmail.com"
- },
- {
- "name": "kitcambridge",
- "email": "github@kitcambridge.be"
- },
{
"name": "mathias",
"email": "mathias@qiwi.be"
@@ -87,11 +68,11 @@
"email": "blaine@iceddev.com"
}
],
- "dist": {
- "shasum": "f4b98dc7ef67256ce61e7874e1865edb208e0edf",
- "tarball": "http://registry.npmjs.org/lodash.repeat/-/lodash.repeat-3.0.1.tgz"
+ "_npmOperationalInternal": {
+ "host": "packages-6-west.internal.npmjs.com",
+ "tmp": "tmp/lodash.repeat-3.1.2.tgz_1454484666569_0.24294439097866416"
},
"directories": {},
- "_resolved": "https://registry.npmjs.org/lodash.repeat/-/lodash.repeat-3.0.1.tgz",
+ "_resolved": "https://registry.npmjs.org/lodash.repeat/-/lodash.repeat-3.1.2.tgz",
"readme": "ERROR: No README data found!"
}
diff --git a/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padright/node_modules/lodash._createpadding/package.json b/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padright/node_modules/lodash._createpadding/package.json
index 376b174bee4ab4..8b820a88571a5e 100644
--- a/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padright/node_modules/lodash._createpadding/package.json
+++ b/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padright/node_modules/lodash._createpadding/package.json
@@ -86,6 +86,5 @@
"tarball": "http://registry.npmjs.org/lodash._createpadding/-/lodash._createpadding-3.6.1.tgz"
},
"directories": {},
- "_resolved": "https://registry.npmjs.org/lodash._createpadding/-/lodash._createpadding-3.6.1.tgz",
- "readme": "ERROR: No README data found!"
+ "_resolved": "https://registry.npmjs.org/lodash._createpadding/-/lodash._createpadding-3.6.1.tgz"
}
diff --git a/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padright/package.json b/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padright/package.json
index 2a40f94bfc3bfd..b8ab0fb942aff9 100644
--- a/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padright/package.json
+++ b/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padright/package.json
@@ -93,6 +93,5 @@
"tarball": "http://registry.npmjs.org/lodash.padright/-/lodash.padright-3.1.1.tgz"
},
"directories": {},
- "_resolved": "https://registry.npmjs.org/lodash.padright/-/lodash.padright-3.1.1.tgz",
- "readme": "ERROR: No README data found!"
+ "_resolved": "https://registry.npmjs.org/lodash.padright/-/lodash.padright-3.1.1.tgz"
}
diff --git a/deps/npm/node_modules/npmlog/node_modules/gauge/package.json b/deps/npm/node_modules/npmlog/node_modules/gauge/package.json
index d16cc33df97528..b4a64f9506dfee 100644
--- a/deps/npm/node_modules/npmlog/node_modules/gauge/package.json
+++ b/deps/npm/node_modules/npmlog/node_modules/gauge/package.json
@@ -1,6 +1,6 @@
{
"name": "gauge",
- "version": "1.2.2",
+ "version": "1.2.5",
"description": "A terminal based horizontal guage",
"main": "progress-bar.js",
"scripts": {
@@ -26,7 +26,7 @@
"homepage": "https://github.com/iarna/gauge",
"dependencies": {
"ansi": "^0.3.0",
- "has-unicode": "^1.0.0",
+ "has-unicode": "^2.0.0",
"lodash.pad": "^3.0.0",
"lodash.padleft": "^3.0.0",
"lodash.padright": "^3.0.0"
@@ -34,19 +34,19 @@
"devDependencies": {
"tap": "^0.4.13"
},
- "gitHead": "9f7eeeeed3b74a70f30b721d570435f6ffbc0168",
- "_id": "gauge@1.2.2",
- "_shasum": "05b6730a19a8fcad3c340a142f0945222a3f815b",
- "_from": "gauge@>=1.2.0 <1.3.0",
- "_npmVersion": "3.1.0",
- "_nodeVersion": "0.10.38",
+ "gitHead": "bd0bb377d121e17d343bba156dd92fe6a8b21581",
+ "_id": "gauge@1.2.5",
+ "_shasum": "b80f107dd1f7d3c5a85f5aa74f9e0124caac9da7",
+ "_from": "gauge@>=1.2.5 <1.3.0",
+ "_npmVersion": "3.6.0",
+ "_nodeVersion": "5.4.0",
"_npmUser": {
"name": "iarna",
"email": "me@re-becca.org"
},
"dist": {
- "shasum": "05b6730a19a8fcad3c340a142f0945222a3f815b",
- "tarball": "http://registry.npmjs.org/gauge/-/gauge-1.2.2.tgz"
+ "shasum": "b80f107dd1f7d3c5a85f5aa74f9e0124caac9da7",
+ "tarball": "http://registry.npmjs.org/gauge/-/gauge-1.2.5.tgz"
},
"maintainers": [
{
@@ -55,6 +55,5 @@
}
],
"directories": {},
- "_resolved": "https://registry.npmjs.org/gauge/-/gauge-1.2.2.tgz",
- "readme": "ERROR: No README data found!"
+ "_resolved": "https://registry.npmjs.org/gauge/-/gauge-1.2.5.tgz"
}
diff --git a/deps/npm/node_modules/npmlog/node_modules/gauge/progress-bar.js b/deps/npm/node_modules/npmlog/node_modules/gauge/progress-bar.js
index 16bdadc5103eee..00b3a77e19149b 100644
--- a/deps/npm/node_modules/npmlog/node_modules/gauge/progress-bar.js
+++ b/deps/npm/node_modules/npmlog/node_modules/gauge/progress-bar.js
@@ -36,7 +36,7 @@ var ProgressBar = module.exports = function (options, cursor) {
{type: "completionbar"},
{type: "endgroup"}
]
- this.updatefreq = options.maxUpdateFrequency || 50
+ this.updatefreq = options.maxUpdateFrequency == null ? 50 : options.maxUpdateFrequency
this.lastName = ""
this.lastCompleted = 0
this.spun = 0
@@ -132,13 +132,12 @@ ProgressBar.prototype.show = function(name, completed) {
if (!isTTY()) return
if (this.disabled) return
if (! this.spun && ! completed) return
- if (this.tryAgain) {
- clearTimeout(this.tryAgain)
- this.tryAgain = null
- }
+ if (this.tryAgain) return
var self = this
+
if (this.showing && new Date() - this.last < this.updatefreq) {
this.tryAgain = setTimeout(function () {
+ self.tryAgain = null
if (self.disabled) return
if (! self.spun && ! completed) return
drawBar()
diff --git a/deps/npm/node_modules/npmlog/node_modules/gauge/test/progress-bar.js b/deps/npm/node_modules/npmlog/node_modules/gauge/test/progress-bar.js
index 39939269f5b630..5d3e7e78fe000e 100644
--- a/deps/npm/node_modules/npmlog/node_modules/gauge/test/progress-bar.js
+++ b/deps/npm/node_modules/npmlog/node_modules/gauge/test/progress-bar.js
@@ -4,7 +4,7 @@ var ProgressBar = require("../progress-bar.js")
var cursor = []
var C
-var bar = new ProgressBar({theme: ProgressBar.ascii}, C = {
+var bar = new ProgressBar({theme: ProgressBar.ascii, maxUpdateFrequency: 0}, C = {
show: function () {
cursor.push(["show"])
return C
diff --git a/deps/npm/node_modules/npmlog/package.json b/deps/npm/node_modules/npmlog/package.json
index 40c1bc43ee7d62..2b0c4c9e828cb1 100644
--- a/deps/npm/node_modules/npmlog/package.json
+++ b/deps/npm/node_modules/npmlog/package.json
@@ -6,7 +6,7 @@
},
"name": "npmlog",
"description": "logger for npm",
- "version": "2.0.0",
+ "version": "2.0.2",
"repository": {
"type": "git",
"url": "git+https://github.com/npm/npmlog.git"
@@ -16,22 +16,46 @@
"test": "tap test/*.js"
},
"dependencies": {
- "ansi": "~0.3.0",
- "are-we-there-yet": "~1.0.0",
- "gauge": "~1.2.0"
+ "ansi": "~0.3.1",
+ "are-we-there-yet": "~1.0.6",
+ "gauge": "~1.2.5"
},
"devDependencies": {
- "tap": "~2.2.0"
+ "tap": "~5.1.2"
},
"license": "ISC",
- "readme": "# npmlog\n\nThe logger util that npm uses.\n\nThis logger is very basic. It does the logging for npm. It supports\ncustom levels and colored output.\n\nBy default, logs are written to stderr. If you want to send log messages\nto outputs other than streams, then you can change the `log.stream`\nmember, or you can just listen to the events that it emits, and do\nwhatever you want with them.\n\n# Basic Usage\n\n```\nvar log = require('npmlog')\n\n// additional stuff ---------------------------+\n// message ----------+ |\n// prefix ----+ | |\n// level -+ | | |\n// v v v v\n log.info('fyi', 'I have a kitty cat: %j', myKittyCat)\n```\n\n## log.level\n\n* {String}\n\nThe level to display logs at. Any logs at or above this level will be\ndisplayed. The special level `silent` will prevent anything from being\ndisplayed ever.\n\n## log.record\n\n* {Array}\n\nAn array of all the log messages that have been entered.\n\n## log.maxRecordSize\n\n* {Number}\n\nThe maximum number of records to keep. If log.record gets bigger than\n10% over this value, then it is sliced down to 90% of this value.\n\nThe reason for the 10% window is so that it doesn't have to resize a\nlarge array on every log entry.\n\n## log.prefixStyle\n\n* {Object}\n\nA style object that specifies how prefixes are styled. (See below)\n\n## log.headingStyle\n\n* {Object}\n\nA style object that specifies how the heading is styled. (See below)\n\n## log.heading\n\n* {String} Default: \"\"\n\nIf set, a heading that is printed at the start of every line.\n\n## log.stream\n\n* {Stream} Default: `process.stderr`\n\nThe stream where output is written.\n\n## log.enableColor()\n\nForce colors to be used on all messages, regardless of the output\nstream.\n\n## log.disableColor()\n\nDisable colors on all messages.\n\n## log.enableProgress()\n\nEnable the display of log activity spinner and progress bar\n\n## log.disableProgress()\n\nDisable the display of a progress bar\n\n## log.enableUnicode()\n\nForce the unicode theme to be used for the progress bar.\n\n## log.disableUnicode()\n\nDisable the use of unicode in the progress bar.\n\n## log.setGaugeTemplate(template)\n\nOverrides the default gauge template.\n\n## log.pause()\n\nStop emitting messages to the stream, but do not drop them.\n\n## log.resume()\n\nEmit all buffered messages that were written while paused.\n\n## log.log(level, prefix, message, ...)\n\n* `level` {String} The level to emit the message at\n* `prefix` {String} A string prefix. Set to \"\" to skip.\n* `message...` Arguments to `util.format`\n\nEmit a log message at the specified level.\n\n## log\\[level](prefix, message, ...)\n\nFor example,\n\n* log.silly(prefix, message, ...)\n* log.verbose(prefix, message, ...)\n* log.info(prefix, message, ...)\n* log.http(prefix, message, ...)\n* log.warn(prefix, message, ...)\n* log.error(prefix, message, ...)\n\nLike `log.log(level, prefix, message, ...)`. In this way, each level is\ngiven a shorthand, so you can do `log.info(prefix, message)`.\n\n## log.addLevel(level, n, style, disp)\n\n* `level` {String} Level indicator\n* `n` {Number} The numeric level\n* `style` {Object} Object with fg, bg, inverse, etc.\n* `disp` {String} Optional replacement for `level` in the output.\n\nSets up a new level with a shorthand function and so forth.\n\nNote that if the number is `Infinity`, then setting the level to that\nwill cause all log messages to be suppressed. If the number is\n`-Infinity`, then the only way to show it is to enable all log messages.\n\n## log.newItem(name, todo, weight)\n\n* `name` {String} Optional; progress item name.\n* `todo` {Number} Optional; total amount of work to be done. Default 0.\n* `weight` {Number} Optional; the weight of this item relative to others. Default 1.\n\nThis adds a new `are-we-there-yet` item tracker to the progress tracker. The\nobject returned has the `log[level]` methods but is otherwise an\n`are-we-there-yet` `Tracker` object.\n\n## log.newStream(name, todo, weight)\n\nThis adds a new `are-we-there-yet` stream tracker to the progress tracker. The\nobject returned has the `log[level]` methods but is otherwise an\n`are-we-there-yet` `TrackerStream` object.\n\n## log.newGroup(name, weight)\n\nThis adds a new `are-we-there-yet` tracker group to the progress tracker. The\nobject returned has the `log[level]` methods but is otherwise an\n`are-we-there-yet` `TrackerGroup` object.\n\n# Events\n\nEvents are all emitted with the message object.\n\n* `log` Emitted for all messages\n* `log.` Emitted for all messages with the `` level.\n* `` Messages with prefixes also emit their prefix as an event.\n\n# Style Objects\n\nStyle objects can have the following fields:\n\n* `fg` {String} Color for the foreground text\n* `bg` {String} Color for the background\n* `bold`, `inverse`, `underline` {Boolean} Set the associated property\n* `bell` {Boolean} Make a noise (This is pretty annoying, probably.)\n\n# Message Objects\n\nEvery log event is emitted with a message object, and the `log.record`\nlist contains all of them that have been created. They have the\nfollowing fields:\n\n* `id` {Number}\n* `level` {String}\n* `prefix` {String}\n* `message` {String} Result of `util.format()`\n* `messageRaw` {Array} Arguments to `util.format()`\n",
- "readmeFilename": "README.md",
- "gitHead": "6eaa3f8eec672bb7b56a4df9b55dbfff3b9c6a71",
+ "gitHead": "79dc582bf1ce4d2010454d89738a0a4dbd113be9",
"bugs": {
"url": "https://github.com/npm/npmlog/issues"
},
"homepage": "https://github.com/npm/npmlog#readme",
- "_id": "npmlog@2.0.0",
- "_shasum": "4076c200a3dda51133e6f3cf052130105f78bbdf",
- "_from": "npmlog@>=2.0.0 <2.1.0"
+ "_id": "npmlog@2.0.2",
+ "_shasum": "d0470238b9697b7c3c4d16bdea65a00b12a464ab",
+ "_from": "npmlog@2.0.2",
+ "_npmVersion": "3.6.0",
+ "_nodeVersion": "5.4.0",
+ "_npmUser": {
+ "name": "iarna",
+ "email": "me@re-becca.org"
+ },
+ "dist": {
+ "shasum": "d0470238b9697b7c3c4d16bdea65a00b12a464ab",
+ "tarball": "http://registry.npmjs.org/npmlog/-/npmlog-2.0.2.tgz"
+ },
+ "maintainers": [
+ {
+ "name": "iarna",
+ "email": "me@re-becca.org"
+ },
+ {
+ "name": "isaacs",
+ "email": "i@izs.me"
+ },
+ {
+ "name": "othiym23",
+ "email": "ogd@aoaioxxysz.net"
+ }
+ ],
+ "directories": {},
+ "_resolved": "https://registry.npmjs.org/npmlog/-/npmlog-2.0.2.tgz"
}
diff --git a/deps/npm/node_modules/once/package.json b/deps/npm/node_modules/once/package.json
index c85f12ebe1d4fa..dac31323c40212 100644
--- a/deps/npm/node_modules/once/package.json
+++ b/deps/npm/node_modules/once/package.json
@@ -1,6 +1,6 @@
{
"name": "once",
- "version": "1.3.2",
+ "version": "1.3.3",
"description": "Run a function exactly one time",
"main": "once.js",
"directories": {
@@ -10,11 +10,14 @@
"wrappy": "1"
},
"devDependencies": {
- "tap": "~0.3.0"
+ "tap": "^1.2.0"
},
"scripts": {
"test": "tap test/*.js"
},
+ "files": [
+ "once.js"
+ ],
"repository": {
"type": "git",
"url": "git://github.com/isaacs/once.git"
@@ -31,30 +34,14 @@
"url": "http://blog.izs.me/"
},
"license": "ISC",
- "gitHead": "e35eed5a7867574e2bf2260a1ba23970958b22f2",
+ "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\nTo check whether you function has been called, use `fn.called`. Once the\nfunction is called for the first time the return value of the original\nfunction is saved in `fn.value` and subsequent calls will continue to\nreturn this value.\n\n```javascript\nvar once = require('once')\n\nfunction load (cb) {\n cb = once(cb)\n var stream = createStream()\n stream.once('data', cb)\n stream.once('end', function () {\n if (!cb.called) cb(new Error('not found'))\n })\n}\n```\n",
+ "readmeFilename": "README.md",
"bugs": {
"url": "https://github.com/isaacs/once/issues"
},
"homepage": "https://github.com/isaacs/once#readme",
- "_id": "once@1.3.2",
- "_shasum": "d8feeca93b039ec1dcdee7741c92bdac5e28081b",
- "_from": "once@>=1.3.2 <1.4.0",
- "_npmVersion": "2.9.1",
- "_nodeVersion": "2.0.0",
- "_npmUser": {
- "name": "isaacs",
- "email": "isaacs@npmjs.com"
- },
- "dist": {
- "shasum": "d8feeca93b039ec1dcdee7741c92bdac5e28081b",
- "tarball": "http://registry.npmjs.org/once/-/once-1.3.2.tgz"
- },
- "maintainers": [
- {
- "name": "isaacs",
- "email": "i@izs.me"
- }
- ],
- "_resolved": "https://registry.npmjs.org/once/-/once-1.3.2.tgz",
- "readme": "ERROR: No README data found!"
+ "_id": "once@1.3.3",
+ "_shasum": "b2e261557ce4c314ec8304f3fa82663e4297ca20",
+ "_resolved": "https://registry.npmjs.org/once/-/once-1.3.3.tgz",
+ "_from": "once@>=1.3.3 <1.4.0"
}
diff --git a/deps/npm/node_modules/once/test/once.js b/deps/npm/node_modules/once/test/once.js
deleted file mode 100644
index c618360dfaeb56..00000000000000
--- a/deps/npm/node_modules/once/test/once.js
+++ /dev/null
@@ -1,23 +0,0 @@
-var test = require('tap').test
-var once = require('../once.js')
-
-test('once', function (t) {
- var f = 0
- function fn (g) {
- t.equal(f, 0)
- f ++
- return f + g + this
- }
- fn.ownProperty = {}
- var foo = once(fn)
- t.equal(fn.ownProperty, foo.ownProperty)
- t.notOk(foo.called)
- for (var i = 0; i < 1E3; i++) {
- t.same(f, i === 0 ? 0 : 1)
- var g = foo.call(1, 1)
- t.ok(foo.called)
- t.same(g, 3)
- t.same(f, 1)
- }
- t.end()
-})
diff --git a/deps/npm/node_modules/read-package-json/node_modules/glob/LICENSE b/deps/npm/node_modules/read-package-json/node_modules/glob/LICENSE
new file mode 100644
index 00000000000000..19129e315fe593
--- /dev/null
+++ b/deps/npm/node_modules/read-package-json/node_modules/glob/LICENSE
@@ -0,0 +1,15 @@
+The ISC License
+
+Copyright (c) Isaac Z. Schlueter and Contributors
+
+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/deps/npm/node_modules/read-package-json/node_modules/glob/README.md b/deps/npm/node_modules/read-package-json/node_modules/glob/README.md
new file mode 100644
index 00000000000000..6960483bac63c6
--- /dev/null
+++ b/deps/npm/node_modules/read-package-json/node_modules/glob/README.md
@@ -0,0 +1,359 @@
+# Glob
+
+Match files using the patterns the shell uses, like stars and stuff.
+
+[![Build Status](https://travis-ci.org/isaacs/node-glob.svg?branch=master)](https://travis-ci.org/isaacs/node-glob/) [![Build Status](https://ci.appveyor.com/api/projects/status/kd7f3yftf7unxlsx?svg=true)](https://ci.appveyor.com/project/isaacs/node-glob) [![Coverage Status](https://coveralls.io/repos/isaacs/node-glob/badge.svg?branch=master&service=github)](https://coveralls.io/github/isaacs/node-glob?branch=master)
+
+This is a glob implementation in JavaScript. It uses the `minimatch`
+library to do its matching.
+
+![](oh-my-glob.gif)
+
+## 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.
+})
+```
+
+## Glob Primer
+
+"Globs" are the patterns you type when you do stuff like `ls *.js` on
+the command line, or put `build/*` in a `.gitignore` file.
+
+Before parsing the path part patterns, braced sections are expanded
+into a set. Braced sections start with `{` and end with `}`, with any
+number of comma-delimited sections within. Braced sections may contain
+slash characters, so `a{/b/c,bcd}` would expand into `a/b/c` and `abcd`.
+
+The following characters have special magic meaning when used in a
+path portion:
+
+* `*` Matches 0 or more characters in a single path portion
+* `?` Matches 1 character
+* `[...]` Matches a range of characters, similar to a RegExp range.
+ If the first character of the range is `!` or `^` then it matches
+ any character not in the range.
+* `!(pattern|pattern|pattern)` Matches anything that does not match
+ any of the patterns provided.
+* `?(pattern|pattern|pattern)` Matches zero or one occurrence of the
+ patterns provided.
+* `+(pattern|pattern|pattern)` Matches one or more occurrences of the
+ patterns provided.
+* `*(a|b|c)` Matches zero or more occurrences of the patterns provided
+* `@(pattern|pat*|pat?erN)` Matches exactly one of the patterns
+ provided
+* `**` If a "globstar" is alone in a path portion, then it matches
+ zero or more directories and subdirectories searching for matches.
+ It does not crawl symlinked directories.
+
+### Dots
+
+If a file or directory path portion has a `.` as the first character,
+then it will not match any glob pattern unless that pattern's
+corresponding path part also has a `.` as its first character.
+
+For example, the pattern `a/.*/c` would match the file at `a/.b/c`.
+However the pattern `a/*/c` would not, because `*` does not start with
+a dot character.
+
+You can make glob treat dots as normal characters by setting
+`dot:true` in the options.
+
+### Basename Matching
+
+If you set `matchBase:true` in the options, and the pattern has no
+slashes in it, then it will seek for any file anywhere in the tree
+with a matching basename. For example, `*.js` would match
+`test/simple/basic.js`.
+
+### Empty Sets
+
+If no matching files are found, then an empty array is returned. This
+differs from the shell, where the pattern itself is returned. For
+example:
+
+ $ echo a*s*d*f
+ a*s*d*f
+
+To get the bash-style behavior, set the `nonull:true` in the options.
+
+### See Also:
+
+* `man sh`
+* `man bash` (Search for "Pattern Matching")
+* `man 3 fnmatch`
+* `man 5 gitignore`
+* [minimatch documentation](https://github.com/isaacs/minimatch)
+
+## glob.hasMagic(pattern, [options])
+
+Returns `true` if there are any special characters in the pattern, and
+`false` otherwise.
+
+Note that the options affect the results. If `noext:true` is set in
+the options object, then `+(a|b)` will not be considered a magic
+pattern. If the pattern has a brace expansion, like `a/{b/c,x/y}`
+then that is considered magical, unless `nobrace:true` is set in the
+options.
+
+## 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 instantiating 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.
+* `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.
+* `cache` Convenience object. Each field has the following possible
+ values:
+ * `false` - Path does not exist
+ * `true` - Path exists
+ * `'FILE'` - Path exists, and is not a directory
+ * `'DIR'` - Path exists, and is a directory
+ * `[file, entries, ...]` - Path exists, is a directory, and the
+ array value is the results of `fs.readdir`
+* `statCache` Cache of `fs.stat` results, to prevent statting the same
+ path multiple times.
+* `symlinks` A record of which paths are symbolic links, which is
+ relevant in resolving `**` patterns.
+* `realpathCache` An optional object which is passed to `fs.realpath`
+ to minimize unnecessary syscalls. It is stored on the instantiated
+ Glob object, and may be re-used.
+
+### 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 specific
+ thing that matched. It is not deduplicated or resolved to a realpath.
+* `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
+
+* `pause` Temporarily stop the search
+* `resume` Resume the search
+* `abort` Stop the search forever
+
+### 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.
+
+If you are running many `glob` operations, you can pass a Glob object
+as the `options` argument to a subsequent operation to shortcut some
+`stat` and `readdir` calls. At the very least, you may pass in shared
+`symlinks`, `statCache`, `realpathCache`, and `cache` options, so that
+parallel glob operations will be sped up by sharing information about
+the filesystem.
+
+* `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.
+* `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.)
+* `symlinks` A cache of known symbolic links. You may pass in a
+ previously generated `symlinks` object to save `lstat` calls when
+ resolving `**` matches.
+* `sync` DEPRECATED: use `glob.sync(pattern, opts)` instead.
+* `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).
+* `debug` Set to enable debug logging in minimatch and glob.
+* `nobrace` Do not expand `{a,b}` and `{1..3}` brace sets.
+* `noglobstar` Do not match `**` against multiple filenames. (Ie,
+ treat it as a normal `*` instead.)
+* `noext` Do not match `+(a|b)` "extglob" patterns.
+* `nocase` Perform a case-insensitive match. Note: on
+ case-insensitive filesystems, non-magic patterns will match by
+ default, since `stat` and `readdir` will not raise errors.
+* `matchBase` Perform a basename-only match if the pattern does not
+ contain any slash characters. That is, `*.js` would be treated as
+ equivalent to `**/*.js`, matching all js files in all directories.
+* `nodir` Do not match directories, only files. (Note: to match
+ *only* directories, simply put a `/` at the end of the pattern.)
+* `ignore` Add a pattern or an array of glob patterns to exclude matches.
+ Note: `ignore` patterns are *always* in `dot:true` mode, regardless
+ of any other settings.
+* `follow` Follow symlinked directories when expanding `**` patterns.
+ Note that this can result in a lot of duplicate references in the
+ presence of cyclic links.
+* `realpath` Set to true to call `fs.realpath` on all of the results.
+ In the case of a symlink that cannot be resolved, the full absolute
+ path to the matched entry is returned (though it will usually be a
+ broken symlink)
+
+## 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.
+
+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.3, 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 symlinked directories are not crawled as part of a `**`,
+though their contents may match against subsequent portions of the
+pattern. This prevents infinite loops and duplicates and the like.
+
+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.
+
+### Comments and Negation
+
+Previously, this module let you mark a pattern as a "comment" if it
+started with a `#` character, or a "negated" pattern if it started
+with a `!` character.
+
+These options were deprecated in version 5, and removed in version 6.
+
+To specify things that should not match, use the `ignore` option.
+
+## 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.
+
+## Contributing
+
+Any change to behavior (including bugfixes) must come with a test.
+
+Patches that fail tests or reduce performance will be rejected.
+
+```
+# to run tests
+npm test
+
+# to re-generate test fixtures
+npm run test-regen
+
+# to benchmark against bash/zsh
+npm run bench
+
+# to profile javascript
+npm run prof
+```
diff --git a/deps/npm/node_modules/read-package-json/node_modules/glob/common.js b/deps/npm/node_modules/read-package-json/node_modules/glob/common.js
new file mode 100644
index 00000000000000..c9127eb334f18b
--- /dev/null
+++ b/deps/npm/node_modules/read-package-json/node_modules/glob/common.js
@@ -0,0 +1,226 @@
+exports.alphasort = alphasort
+exports.alphasorti = alphasorti
+exports.setopts = setopts
+exports.ownProp = ownProp
+exports.makeAbs = makeAbs
+exports.finish = finish
+exports.mark = mark
+exports.isIgnored = isIgnored
+exports.childrenIgnored = childrenIgnored
+
+function ownProp (obj, field) {
+ return Object.prototype.hasOwnProperty.call(obj, field)
+}
+
+var path = require("path")
+var minimatch = require("minimatch")
+var isAbsolute = require("path-is-absolute")
+var Minimatch = minimatch.Minimatch
+
+function alphasorti (a, b) {
+ return a.toLowerCase().localeCompare(b.toLowerCase())
+}
+
+function alphasort (a, b) {
+ return a.localeCompare(b)
+}
+
+function setupIgnores (self, options) {
+ self.ignore = options.ignore || []
+
+ if (!Array.isArray(self.ignore))
+ self.ignore = [self.ignore]
+
+ if (self.ignore.length) {
+ self.ignore = self.ignore.map(ignoreMap)
+ }
+}
+
+// ignore patterns are always in dot:true mode.
+function ignoreMap (pattern) {
+ var gmatcher = null
+ if (pattern.slice(-3) === '/**') {
+ var gpattern = pattern.replace(/(\/\*\*)+$/, '')
+ gmatcher = new Minimatch(gpattern, { dot: true })
+ }
+
+ return {
+ matcher: new Minimatch(pattern, { dot: true }),
+ gmatcher: gmatcher
+ }
+}
+
+function setopts (self, pattern, options) {
+ if (!options)
+ options = {}
+
+ // 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
+ }
+
+ self.silent = !!options.silent
+ self.pattern = pattern
+ self.strict = options.strict !== false
+ self.realpath = !!options.realpath
+ self.realpathCache = options.realpathCache || Object.create(null)
+ self.follow = !!options.follow
+ self.dot = !!options.dot
+ self.mark = !!options.mark
+ self.nodir = !!options.nodir
+ if (self.nodir)
+ self.mark = true
+ self.sync = !!options.sync
+ self.nounique = !!options.nounique
+ self.nonull = !!options.nonull
+ self.nosort = !!options.nosort
+ self.nocase = !!options.nocase
+ self.stat = !!options.stat
+ self.noprocess = !!options.noprocess
+
+ self.maxLength = options.maxLength || Infinity
+ self.cache = options.cache || Object.create(null)
+ self.statCache = options.statCache || Object.create(null)
+ self.symlinks = options.symlinks || Object.create(null)
+
+ setupIgnores(self, options)
+
+ self.changedCwd = false
+ var cwd = process.cwd()
+ if (!ownProp(options, "cwd"))
+ self.cwd = cwd
+ else {
+ self.cwd = options.cwd
+ self.changedCwd = path.resolve(options.cwd) !== cwd
+ }
+
+ self.root = options.root || path.resolve(self.cwd, "/")
+ self.root = path.resolve(self.root)
+ if (process.platform === "win32")
+ self.root = self.root.replace(/\\/g, "/")
+
+ self.nomount = !!options.nomount
+
+ // disable comments and negation in Minimatch.
+ // Note that they are not supported in Glob itself anyway.
+ options.nonegate = true
+ options.nocomment = true
+
+ self.minimatch = new Minimatch(pattern, options)
+ self.options = self.minimatch.options
+}
+
+function finish (self) {
+ var nou = self.nounique
+ var all = nou ? [] : Object.create(null)
+
+ for (var i = 0, l = self.matches.length; i < l; i ++) {
+ var matches = self.matches[i]
+ if (!matches || Object.keys(matches).length === 0) {
+ if (self.nonull) {
+ // do like the shell, and spit out the literal glob
+ var literal = self.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 (!self.nosort)
+ all = all.sort(self.nocase ? alphasorti : alphasort)
+
+ // at *some* point we statted all of these
+ if (self.mark) {
+ for (var i = 0; i < all.length; i++) {
+ all[i] = self._mark(all[i])
+ }
+ if (self.nodir) {
+ all = all.filter(function (e) {
+ return !(/\/$/.test(e))
+ })
+ }
+ }
+
+ if (self.ignore.length)
+ all = all.filter(function(m) {
+ return !isIgnored(self, m)
+ })
+
+ self.found = all
+}
+
+function mark (self, p) {
+ var abs = makeAbs(self, p)
+ var c = self.cache[abs]
+ var m = p
+ if (c) {
+ var isDir = c === 'DIR' || Array.isArray(c)
+ var slash = p.slice(-1) === '/'
+
+ if (isDir && !slash)
+ m += '/'
+ else if (!isDir && slash)
+ m = m.slice(0, -1)
+
+ if (m !== p) {
+ var mabs = makeAbs(self, m)
+ self.statCache[mabs] = self.statCache[abs]
+ self.cache[mabs] = self.cache[abs]
+ }
+ }
+
+ return m
+}
+
+// lotta situps...
+function makeAbs (self, f) {
+ var abs = f
+ if (f.charAt(0) === '/') {
+ abs = path.join(self.root, f)
+ } else if (isAbsolute(f) || f === '') {
+ abs = f
+ } else if (self.changedCwd) {
+ abs = path.resolve(self.cwd, f)
+ } else {
+ abs = path.resolve(f)
+ }
+ return abs
+}
+
+
+// Return true, if pattern ends with globstar '**', for the accompanying parent directory.
+// Ex:- If node_modules/** is the pattern, add 'node_modules' to ignore list along with it's contents
+function isIgnored (self, path) {
+ if (!self.ignore.length)
+ return false
+
+ return self.ignore.some(function(item) {
+ return item.matcher.match(path) || !!(item.gmatcher && item.gmatcher.match(path))
+ })
+}
+
+function childrenIgnored (self, path) {
+ if (!self.ignore.length)
+ return false
+
+ return self.ignore.some(function(item) {
+ return !!(item.gmatcher && item.gmatcher.match(path))
+ })
+}
diff --git a/deps/npm/node_modules/read-package-json/node_modules/glob/glob.js b/deps/npm/node_modules/read-package-json/node_modules/glob/glob.js
new file mode 100644
index 00000000000000..a62da27ebd507a
--- /dev/null
+++ b/deps/npm/node_modules/read-package-json/node_modules/glob/glob.js
@@ -0,0 +1,765 @@
+// Approach:
+//
+// 1. Get the minimatch set
+// 2. For each pattern in the set, PROCESS(pattern, false)
+// 3. Store matches per-set, then uniq them
+//
+// PROCESS(pattern, inGlobStar)
+// 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.
+//
+// If inGlobStar and PREFIX is symlink and points to dir
+// set ENTRIES = []
+// else readdir(PREFIX) as ENTRIES
+// If fail, END
+//
+// with ENTRIES
+// 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 .. $], false)
+// // handle other cases.
+// for ENTRY in ENTRIES (not dotfiles)
+// // attach globstar + tail onto the entry
+// // Mark that this entry is a globstar match
+// PROCESS(pattern[0..n] + ENTRY + pattern[n .. $], true)
+//
+// 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')
+var minimatch = require('minimatch')
+var Minimatch = minimatch.Minimatch
+var inherits = require('inherits')
+var EE = require('events').EventEmitter
+var path = require('path')
+var assert = require('assert')
+var isAbsolute = require('path-is-absolute')
+var globSync = require('./sync.js')
+var common = require('./common.js')
+var alphasort = common.alphasort
+var alphasorti = common.alphasorti
+var setopts = common.setopts
+var ownProp = common.ownProp
+var inflight = require('inflight')
+var util = require('util')
+var childrenIgnored = common.childrenIgnored
+var isIgnored = common.isIgnored
+
+var once = require('once')
+
+function glob (pattern, options, cb) {
+ if (typeof options === 'function') cb = options, options = {}
+ if (!options) options = {}
+
+ if (options.sync) {
+ if (cb)
+ throw new TypeError('callback provided to sync glob')
+ return globSync(pattern, options)
+ }
+
+ return new Glob(pattern, options, cb)
+}
+
+glob.sync = globSync
+var GlobSync = glob.GlobSync = globSync.GlobSync
+
+// old api surface
+glob.glob = glob
+
+function extend (origin, add) {
+ if (add === null || typeof add !== 'object') {
+ return origin
+ }
+
+ var keys = Object.keys(add)
+ var i = keys.length
+ while (i--) {
+ origin[keys[i]] = add[keys[i]]
+ }
+ return origin
+}
+
+glob.hasMagic = function (pattern, options_) {
+ var options = extend({}, options_)
+ options.noprocess = true
+
+ var g = new Glob(pattern, options)
+ var set = g.minimatch.set
+ if (set.length > 1)
+ return true
+
+ for (var j = 0; j < set[0].length; j++) {
+ if (typeof set[0][j] !== 'string')
+ return true
+ }
+
+ return false
+}
+
+glob.Glob = Glob
+inherits(Glob, EE)
+function Glob (pattern, options, cb) {
+ if (typeof options === 'function') {
+ cb = options
+ options = null
+ }
+
+ if (options && options.sync) {
+ if (cb)
+ throw new TypeError('callback provided to sync glob')
+ return new GlobSync(pattern, options)
+ }
+
+ if (!(this instanceof Glob))
+ return new Glob(pattern, options, cb)
+
+ setopts(this, pattern, options)
+ this._didRealPath = false
+
+ // 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)
+
+ if (typeof cb === 'function') {
+ cb = once(cb)
+ this.on('error', cb)
+ this.on('end', function (matches) {
+ cb(null, matches)
+ })
+ }
+
+ var self = this
+ var n = this.minimatch.set.length
+ this._processing = 0
+ this.matches = new Array(n)
+
+ this._emitQueue = []
+ this._processQueue = []
+ this.paused = false
+
+ if (this.noprocess)
+ return this
+
+ if (n === 0)
+ return done()
+
+ for (var i = 0; i < n; i ++) {
+ this._process(this.minimatch.set[i], i, false, done)
+ }
+
+ function done () {
+ --self._processing
+ if (self._processing <= 0)
+ self._finish()
+ }
+}
+
+Glob.prototype._finish = function () {
+ assert(this instanceof Glob)
+ if (this.aborted)
+ return
+
+ if (this.realpath && !this._didRealpath)
+ return this._realpath()
+
+ common.finish(this)
+ this.emit('end', this.found)
+}
+
+Glob.prototype._realpath = function () {
+ if (this._didRealpath)
+ return
+
+ this._didRealpath = true
+
+ var n = this.matches.length
+ if (n === 0)
+ return this._finish()
+
+ var self = this
+ for (var i = 0; i < this.matches.length; i++)
+ this._realpathSet(i, next)
+
+ function next () {
+ if (--n === 0)
+ self._finish()
+ }
+}
+
+Glob.prototype._realpathSet = function (index, cb) {
+ var matchset = this.matches[index]
+ if (!matchset)
+ return cb()
+
+ var found = Object.keys(matchset)
+ var self = this
+ var n = found.length
+
+ if (n === 0)
+ return cb()
+
+ var set = this.matches[index] = Object.create(null)
+ found.forEach(function (p, i) {
+ // If there's a problem with the stat, then it means that
+ // one or more of the links in the realpath couldn't be
+ // resolved. just return the abs value in that case.
+ p = self._makeAbs(p)
+ fs.realpath(p, self.realpathCache, function (er, real) {
+ if (!er)
+ set[real] = true
+ else if (er.syscall === 'stat')
+ set[p] = true
+ else
+ self.emit('error', er) // srsly wtf right here
+
+ if (--n === 0) {
+ self.matches[index] = set
+ cb()
+ }
+ })
+ })
+}
+
+Glob.prototype._mark = function (p) {
+ return common.mark(this, p)
+}
+
+Glob.prototype._makeAbs = function (f) {
+ return common.makeAbs(this, f)
+}
+
+Glob.prototype.abort = function () {
+ this.aborted = true
+ this.emit('abort')
+}
+
+Glob.prototype.pause = function () {
+ if (!this.paused) {
+ this.paused = true
+ this.emit('pause')
+ }
+}
+
+Glob.prototype.resume = function () {
+ if (this.paused) {
+ this.emit('resume')
+ this.paused = false
+ if (this._emitQueue.length) {
+ var eq = this._emitQueue.slice(0)
+ this._emitQueue.length = 0
+ for (var i = 0; i < eq.length; i ++) {
+ var e = eq[i]
+ this._emitMatch(e[0], e[1])
+ }
+ }
+ if (this._processQueue.length) {
+ var pq = this._processQueue.slice(0)
+ this._processQueue.length = 0
+ for (var i = 0; i < pq.length; i ++) {
+ var p = pq[i]
+ this._processing--
+ this._process(p[0], p[1], p[2], p[3])
+ }
+ }
+ }
+}
+
+Glob.prototype._process = function (pattern, index, inGlobStar, cb) {
+ assert(this instanceof Glob)
+ assert(typeof cb === 'function')
+
+ if (this.aborted)
+ return
+
+ this._processing++
+ if (this.paused) {
+ this._processQueue.push([pattern, index, inGlobStar, cb])
+ return
+ }
+
+ //console.error('PROCESS %d', this._processing, pattern)
+
+ // 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:
+ this._processSimple(pattern.join('/'), index, 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).join('/')
+ break
+ }
+
+ var remain = pattern.slice(n)
+
+ // get the list of entries.
+ var read
+ if (prefix === null)
+ read = '.'
+ else if (isAbsolute(prefix) || isAbsolute(pattern.join('/'))) {
+ if (!prefix || !isAbsolute(prefix))
+ prefix = '/' + prefix
+ read = prefix
+ } else
+ read = prefix
+
+ var abs = this._makeAbs(read)
+
+ //if ignored, skip _processing
+ if (childrenIgnored(this, read))
+ return cb()
+
+ var isGlobStar = remain[0] === minimatch.GLOBSTAR
+ if (isGlobStar)
+ this._processGlobStar(prefix, read, abs, remain, index, inGlobStar, cb)
+ else
+ this._processReaddir(prefix, read, abs, remain, index, inGlobStar, cb)
+}
+
+Glob.prototype._processReaddir = function (prefix, read, abs, remain, index, inGlobStar, cb) {
+ var self = this
+ this._readdir(abs, inGlobStar, function (er, entries) {
+ return self._processReaddir2(prefix, read, abs, remain, index, inGlobStar, entries, cb)
+ })
+}
+
+Glob.prototype._processReaddir2 = function (prefix, read, abs, remain, index, inGlobStar, entries, cb) {
+
+ // if the abs isn't a dir, then nothing can match!
+ if (!entries)
+ return cb()
+
+ // 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 = remain[0]
+ var negate = !!this.minimatch.negate
+ var rawGlob = pn._glob
+ var dotOk = this.dot || rawGlob.charAt(0) === '.'
+
+ var matchedEntries = []
+ for (var i = 0; i < entries.length; i++) {
+ var e = entries[i]
+ if (e.charAt(0) !== '.' || dotOk) {
+ var m
+ if (negate && !prefix) {
+ m = !e.match(pn)
+ } else {
+ m = e.match(pn)
+ }
+ if (m)
+ matchedEntries.push(e)
+ }
+ }
+
+ //console.error('prd2', prefix, entries, remain[0]._glob, matchedEntries)
+
+ var len = matchedEntries.length
+ // If there are no matched entries, then nothing matches.
+ if (len === 0)
+ return cb()
+
+ // if this is the last remaining pattern bit, then no need for
+ // an additional stat *unless* the user has specified mark or
+ // stat explicitly. We know they exist, since readdir returned
+ // them.
+
+ if (remain.length === 1 && !this.mark && !this.stat) {
+ if (!this.matches[index])
+ this.matches[index] = Object.create(null)
+
+ for (var i = 0; i < len; i ++) {
+ var e = matchedEntries[i]
+ if (prefix) {
+ if (prefix !== '/')
+ e = prefix + '/' + e
+ else
+ e = prefix + e
+ }
+
+ if (e.charAt(0) === '/' && !this.nomount) {
+ e = path.join(this.root, e)
+ }
+ this._emitMatch(index, e)
+ }
+ // This was the last one, and no stats were needed
+ return cb()
+ }
+
+ // now test all matched entries as stand-ins for that part
+ // of the pattern.
+ remain.shift()
+ for (var i = 0; i < len; i ++) {
+ var e = matchedEntries[i]
+ var newPattern
+ if (prefix) {
+ if (prefix !== '/')
+ e = prefix + '/' + e
+ else
+ e = prefix + e
+ }
+ this._process([e].concat(remain), index, inGlobStar, cb)
+ }
+ cb()
+}
+
+Glob.prototype._emitMatch = function (index, e) {
+ if (this.aborted)
+ return
+
+ if (this.matches[index][e])
+ return
+
+ if (isIgnored(this, e))
+ return
+
+ if (this.paused) {
+ this._emitQueue.push([index, e])
+ return
+ }
+
+ var abs = this._makeAbs(e)
+
+ if (this.nodir) {
+ var c = this.cache[abs]
+ if (c === 'DIR' || Array.isArray(c))
+ return
+ }
+
+ if (this.mark)
+ e = this._mark(e)
+
+ this.matches[index][e] = true
+
+ var st = this.statCache[abs]
+ if (st)
+ this.emit('stat', e, st)
+
+ this.emit('match', e)
+}
+
+Glob.prototype._readdirInGlobStar = function (abs, cb) {
+ if (this.aborted)
+ return
+
+ // follow all symlinked directories forever
+ // just proceed as if this is a non-globstar situation
+ if (this.follow)
+ return this._readdir(abs, false, cb)
+
+ var lstatkey = 'lstat\0' + abs
+ var self = this
+ var lstatcb = inflight(lstatkey, lstatcb_)
+
+ if (lstatcb)
+ fs.lstat(abs, lstatcb)
+
+ function lstatcb_ (er, lstat) {
+ if (er)
+ return cb()
+
+ var isSym = lstat.isSymbolicLink()
+ self.symlinks[abs] = isSym
+
+ // If it's not a symlink or a dir, then it's definitely a regular file.
+ // don't bother doing a readdir in that case.
+ if (!isSym && !lstat.isDirectory()) {
+ self.cache[abs] = 'FILE'
+ cb()
+ } else
+ self._readdir(abs, false, cb)
+ }
+}
+
+Glob.prototype._readdir = function (abs, inGlobStar, cb) {
+ if (this.aborted)
+ return
+
+ cb = inflight('readdir\0'+abs+'\0'+inGlobStar, cb)
+ if (!cb)
+ return
+
+ //console.error('RD %j %j', +inGlobStar, abs)
+ if (inGlobStar && !ownProp(this.symlinks, abs))
+ return this._readdirInGlobStar(abs, cb)
+
+ if (ownProp(this.cache, abs)) {
+ var c = this.cache[abs]
+ if (!c || c === 'FILE')
+ return cb()
+
+ if (Array.isArray(c))
+ return cb(null, c)
+ }
+
+ var self = this
+ fs.readdir(abs, readdirCb(this, abs, cb))
+}
+
+function readdirCb (self, abs, cb) {
+ return function (er, entries) {
+ if (er)
+ self._readdirError(abs, er, cb)
+ else
+ self._readdirEntries(abs, entries, cb)
+ }
+}
+
+Glob.prototype._readdirEntries = function (abs, entries, cb) {
+ if (this.aborted)
+ return
+
+ // if we haven't asked to stat everything, then just
+ // assume that everything in there exists, so we can avoid
+ // having to stat it a second time.
+ if (!this.mark && !this.stat) {
+ for (var i = 0; i < entries.length; i ++) {
+ var e = entries[i]
+ if (abs === '/')
+ e = abs + e
+ else
+ e = abs + '/' + e
+ this.cache[e] = true
+ }
+ }
+
+ this.cache[abs] = entries
+ return cb(null, entries)
+}
+
+Glob.prototype._readdirError = function (f, er, cb) {
+ if (this.aborted)
+ return
+
+ // handle errors, and cache the information
+ switch (er.code) {
+ case 'ENOTSUP': // https://github.com/isaacs/node-glob/issues/205
+ case 'ENOTDIR': // totally normal. means it *does* exist.
+ this.cache[this._makeAbs(f)] = 'FILE'
+ break
+
+ case 'ENOENT': // not terribly unusual
+ case 'ELOOP':
+ case 'ENAMETOOLONG':
+ case 'UNKNOWN':
+ this.cache[this._makeAbs(f)] = false
+ break
+
+ default: // some unusual error. Treat as failure.
+ this.cache[this._makeAbs(f)] = false
+ if (this.strict) {
+ this.emit('error', er)
+ // If the error is handled, then we abort
+ // if not, we threw out of here
+ this.abort()
+ }
+ if (!this.silent)
+ console.error('glob error', er)
+ break
+ }
+
+ return cb()
+}
+
+Glob.prototype._processGlobStar = function (prefix, read, abs, remain, index, inGlobStar, cb) {
+ var self = this
+ this._readdir(abs, inGlobStar, function (er, entries) {
+ self._processGlobStar2(prefix, read, abs, remain, index, inGlobStar, entries, cb)
+ })
+}
+
+
+Glob.prototype._processGlobStar2 = function (prefix, read, abs, remain, index, inGlobStar, entries, cb) {
+ //console.error('pgs2', prefix, remain[0], entries)
+
+ // no entries means not a dir, so it can never have matches
+ // foo.txt/** doesn't match foo.txt
+ if (!entries)
+ return cb()
+
+ // test without the globstar, and with every child both below
+ // and replacing the globstar.
+ var remainWithoutGlobStar = remain.slice(1)
+ var gspref = prefix ? [ prefix ] : []
+ var noGlobStar = gspref.concat(remainWithoutGlobStar)
+
+ // the noGlobStar pattern exits the inGlobStar state
+ this._process(noGlobStar, index, false, cb)
+
+ var isSym = this.symlinks[abs]
+ var len = entries.length
+
+ // If it's a symlink, and we're in a globstar, then stop
+ if (isSym && inGlobStar)
+ return cb()
+
+ for (var i = 0; i < len; i++) {
+ var e = entries[i]
+ if (e.charAt(0) === '.' && !this.dot)
+ continue
+
+ // these two cases enter the inGlobStar state
+ var instead = gspref.concat(entries[i], remainWithoutGlobStar)
+ this._process(instead, index, true, cb)
+
+ var below = gspref.concat(entries[i], remain)
+ this._process(below, index, true, cb)
+ }
+
+ cb()
+}
+
+Glob.prototype._processSimple = function (prefix, index, cb) {
+ // XXX review this. Shouldn't it be doing the mounting etc
+ // before doing stat? kinda weird?
+ var self = this
+ this._stat(prefix, function (er, exists) {
+ self._processSimple2(prefix, index, er, exists, cb)
+ })
+}
+Glob.prototype._processSimple2 = function (prefix, index, er, exists, cb) {
+
+ //console.error('ps2', prefix, exists)
+
+ if (!this.matches[index])
+ this.matches[index] = Object.create(null)
+
+ // If it doesn't exist, then just mark the lack of results
+ if (!exists)
+ return cb()
+
+ if (prefix && isAbsolute(prefix) && !this.nomount) {
+ var trail = /[\/\\]$/.test(prefix)
+ if (prefix.charAt(0) === '/') {
+ prefix = path.join(this.root, prefix)
+ } else {
+ prefix = path.resolve(this.root, prefix)
+ if (trail)
+ prefix += '/'
+ }
+ }
+
+ if (process.platform === 'win32')
+ prefix = prefix.replace(/\\/g, '/')
+
+ // Mark this as a match
+ this._emitMatch(index, prefix)
+ cb()
+}
+
+// Returns either 'DIR', 'FILE', or false
+Glob.prototype._stat = function (f, cb) {
+ var abs = this._makeAbs(f)
+ var needDir = f.slice(-1) === '/'
+
+ if (f.length > this.maxLength)
+ return cb()
+
+ if (!this.stat && ownProp(this.cache, abs)) {
+ var c = this.cache[abs]
+
+ if (Array.isArray(c))
+ c = 'DIR'
+
+ // It exists, but maybe not how we need it
+ if (!needDir || c === 'DIR')
+ return cb(null, c)
+
+ if (needDir && c === 'FILE')
+ return cb()
+
+ // otherwise we have to stat, because maybe c=true
+ // if we know it exists, but not what it is.
+ }
+
+ var exists
+ var stat = this.statCache[abs]
+ if (stat !== undefined) {
+ if (stat === false)
+ return cb(null, stat)
+ else {
+ var type = stat.isDirectory() ? 'DIR' : 'FILE'
+ if (needDir && type === 'FILE')
+ return cb()
+ else
+ return cb(null, type, stat)
+ }
+ }
+
+ var self = this
+ var statcb = inflight('stat\0' + abs, lstatcb_)
+ if (statcb)
+ fs.lstat(abs, statcb)
+
+ function lstatcb_ (er, lstat) {
+ if (lstat && lstat.isSymbolicLink()) {
+ // If it's a symlink, then treat it as the target, unless
+ // the target does not exist, then treat it as a file.
+ return fs.stat(abs, function (er, stat) {
+ if (er)
+ self._stat2(f, abs, null, lstat, cb)
+ else
+ self._stat2(f, abs, er, stat, cb)
+ })
+ } else {
+ self._stat2(f, abs, er, lstat, cb)
+ }
+ }
+}
+
+Glob.prototype._stat2 = function (f, abs, er, stat, cb) {
+ if (er) {
+ this.statCache[abs] = false
+ return cb()
+ }
+
+ var needDir = f.slice(-1) === '/'
+ this.statCache[abs] = stat
+
+ if (abs.slice(-1) === '/' && !stat.isDirectory())
+ return cb(null, false, stat)
+
+ var c = stat.isDirectory() ? 'DIR' : 'FILE'
+ this.cache[abs] = this.cache[abs] || c
+
+ if (needDir && c !== 'DIR')
+ return cb()
+
+ return cb(null, c, stat)
+}
diff --git a/deps/npm/node_modules/read-package-json/node_modules/glob/node_modules/path-is-absolute/index.js b/deps/npm/node_modules/read-package-json/node_modules/glob/node_modules/path-is-absolute/index.js
new file mode 100644
index 00000000000000..19f103f908ac72
--- /dev/null
+++ b/deps/npm/node_modules/read-package-json/node_modules/glob/node_modules/path-is-absolute/index.js
@@ -0,0 +1,20 @@
+'use strict';
+
+function posix(path) {
+ return path.charAt(0) === '/';
+};
+
+function win32(path) {
+ // https://github.com/joyent/node/blob/b3fcc245fb25539909ef1d5eaa01dbf92e168633/lib/path.js#L56
+ var splitDeviceRe = /^([a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/]+[^\\\/]+)?([\\\/])?([\s\S]*?)$/;
+ var result = splitDeviceRe.exec(path);
+ var device = result[1] || '';
+ var isUnc = !!device && device.charAt(1) !== ':';
+
+ // UNC paths are always absolute
+ return !!result[2] || isUnc;
+};
+
+module.exports = process.platform === 'win32' ? win32 : posix;
+module.exports.posix = posix;
+module.exports.win32 = win32;
diff --git a/tools/eslint/node_modules/chalk/node_modules/has-ansi/license b/deps/npm/node_modules/read-package-json/node_modules/glob/node_modules/path-is-absolute/license
similarity index 100%
rename from tools/eslint/node_modules/chalk/node_modules/has-ansi/license
rename to deps/npm/node_modules/read-package-json/node_modules/glob/node_modules/path-is-absolute/license
diff --git a/deps/npm/node_modules/read-package-json/node_modules/glob/node_modules/path-is-absolute/package.json b/deps/npm/node_modules/read-package-json/node_modules/glob/node_modules/path-is-absolute/package.json
new file mode 100644
index 00000000000000..39372636f3fb4f
--- /dev/null
+++ b/deps/npm/node_modules/read-package-json/node_modules/glob/node_modules/path-is-absolute/package.json
@@ -0,0 +1,70 @@
+{
+ "name": "path-is-absolute",
+ "version": "1.0.0",
+ "description": "Node.js 0.12 path.isAbsolute() ponyfill",
+ "license": "MIT",
+ "repository": {
+ "type": "git",
+ "url": "git+https://github.com/sindresorhus/path-is-absolute.git"
+ },
+ "author": {
+ "name": "Sindre Sorhus",
+ "email": "sindresorhus@gmail.com",
+ "url": "sindresorhus.com"
+ },
+ "engines": {
+ "node": ">=0.10.0"
+ },
+ "scripts": {
+ "test": "node test.js"
+ },
+ "files": [
+ "index.js"
+ ],
+ "keywords": [
+ "path",
+ "paths",
+ "file",
+ "dir",
+ "absolute",
+ "isabsolute",
+ "is-absolute",
+ "built-in",
+ "util",
+ "utils",
+ "core",
+ "ponyfill",
+ "polyfill",
+ "shim",
+ "is",
+ "detect",
+ "check"
+ ],
+ "gitHead": "7a76a0c9f2263192beedbe0a820e4d0baee5b7a1",
+ "bugs": {
+ "url": "https://github.com/sindresorhus/path-is-absolute/issues"
+ },
+ "homepage": "https://github.com/sindresorhus/path-is-absolute",
+ "_id": "path-is-absolute@1.0.0",
+ "_shasum": "263dada66ab3f2fb10bf7f9d24dd8f3e570ef912",
+ "_from": "path-is-absolute@>=1.0.0 <2.0.0",
+ "_npmVersion": "2.5.1",
+ "_nodeVersion": "0.12.0",
+ "_npmUser": {
+ "name": "sindresorhus",
+ "email": "sindresorhus@gmail.com"
+ },
+ "maintainers": [
+ {
+ "name": "sindresorhus",
+ "email": "sindresorhus@gmail.com"
+ }
+ ],
+ "dist": {
+ "shasum": "263dada66ab3f2fb10bf7f9d24dd8f3e570ef912",
+ "tarball": "http://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.0.tgz"
+ },
+ "directories": {},
+ "_resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.0.tgz",
+ "readme": "ERROR: No README data found!"
+}
diff --git a/deps/npm/node_modules/read-package-json/node_modules/glob/node_modules/path-is-absolute/readme.md b/deps/npm/node_modules/read-package-json/node_modules/glob/node_modules/path-is-absolute/readme.md
new file mode 100644
index 00000000000000..cdf94f4309a27e
--- /dev/null
+++ b/deps/npm/node_modules/read-package-json/node_modules/glob/node_modules/path-is-absolute/readme.md
@@ -0,0 +1,51 @@
+# path-is-absolute [![Build Status](https://travis-ci.org/sindresorhus/path-is-absolute.svg?branch=master)](https://travis-ci.org/sindresorhus/path-is-absolute)
+
+> Node.js 0.12 [`path.isAbsolute()`](http://nodejs.org/api/path.html#path_path_isabsolute_path) ponyfill
+
+> Ponyfill: A polyfill that doesn't overwrite the native method
+
+
+## Install
+
+```
+$ npm install --save path-is-absolute
+```
+
+
+## Usage
+
+```js
+var pathIsAbsolute = require('path-is-absolute');
+
+// Linux
+pathIsAbsolute('/home/foo');
+//=> true
+
+// Windows
+pathIsAbsolute('C:/Users/');
+//=> true
+
+// Any OS
+pathIsAbsolute.posix('/home/foo');
+//=> true
+```
+
+
+## API
+
+See the [`path.isAbsolute()` docs](http://nodejs.org/api/path.html#path_path_isabsolute_path).
+
+### pathIsAbsolute(path)
+
+### pathIsAbsolute.posix(path)
+
+The Posix specific version.
+
+### pathIsAbsolute.win32(path)
+
+The Windows specific version.
+
+
+## License
+
+MIT © [Sindre Sorhus](http://sindresorhus.com)
diff --git a/deps/npm/node_modules/read-package-json/node_modules/glob/package.json b/deps/npm/node_modules/read-package-json/node_modules/glob/package.json
new file mode 100644
index 00000000000000..19e926cbf1035a
--- /dev/null
+++ b/deps/npm/node_modules/read-package-json/node_modules/glob/package.json
@@ -0,0 +1,73 @@
+{
+ "author": {
+ "name": "Isaac Z. Schlueter",
+ "email": "i@izs.me",
+ "url": "http://blog.izs.me/"
+ },
+ "name": "glob",
+ "description": "a little globber",
+ "version": "6.0.4",
+ "repository": {
+ "type": "git",
+ "url": "git://github.com/isaacs/node-glob.git"
+ },
+ "main": "glob.js",
+ "files": [
+ "glob.js",
+ "sync.js",
+ "common.js"
+ ],
+ "engines": {
+ "node": "*"
+ },
+ "dependencies": {
+ "inflight": "^1.0.4",
+ "inherits": "2",
+ "minimatch": "2 || 3",
+ "once": "^1.3.0",
+ "path-is-absolute": "^1.0.0"
+ },
+ "devDependencies": {
+ "mkdirp": "0",
+ "rimraf": "^2.2.8",
+ "tap": "^5.0.0",
+ "tick": "0.0.6"
+ },
+ "scripts": {
+ "prepublish": "npm run benchclean",
+ "profclean": "rm -f v8.log profile.txt",
+ "test": "tap test/*.js --cov",
+ "test-regen": "npm run profclean && TEST_REGEN=1 node test/00-setup.js",
+ "bench": "bash benchmark.sh",
+ "prof": "bash prof.sh && cat profile.txt",
+ "benchclean": "node benchclean.js"
+ },
+ "license": "ISC",
+ "gitHead": "3bd419c538737e56fda7e21c21ff52ca0c198df6",
+ "bugs": {
+ "url": "https://github.com/isaacs/node-glob/issues"
+ },
+ "homepage": "https://github.com/isaacs/node-glob#readme",
+ "_id": "glob@6.0.4",
+ "_shasum": "0f08860f6a155127b2fadd4f9ce24b1aab6e4d22",
+ "_from": "glob@>=6.0.0 <7.0.0",
+ "_npmVersion": "2.14.15",
+ "_nodeVersion": "4.0.0",
+ "_npmUser": {
+ "name": "isaacs",
+ "email": "i@izs.me"
+ },
+ "dist": {
+ "shasum": "0f08860f6a155127b2fadd4f9ce24b1aab6e4d22",
+ "tarball": "http://registry.npmjs.org/glob/-/glob-6.0.4.tgz"
+ },
+ "maintainers": [
+ {
+ "name": "isaacs",
+ "email": "i@izs.me"
+ }
+ ],
+ "directories": {},
+ "_resolved": "https://registry.npmjs.org/glob/-/glob-6.0.4.tgz",
+ "readme": "ERROR: No README data found!"
+}
diff --git a/deps/npm/node_modules/read-package-json/node_modules/glob/sync.js b/deps/npm/node_modules/read-package-json/node_modules/glob/sync.js
new file mode 100644
index 00000000000000..09883d2ce0c9de
--- /dev/null
+++ b/deps/npm/node_modules/read-package-json/node_modules/glob/sync.js
@@ -0,0 +1,460 @@
+module.exports = globSync
+globSync.GlobSync = GlobSync
+
+var fs = require('fs')
+var minimatch = require('minimatch')
+var Minimatch = minimatch.Minimatch
+var Glob = require('./glob.js').Glob
+var util = require('util')
+var path = require('path')
+var assert = require('assert')
+var isAbsolute = require('path-is-absolute')
+var common = require('./common.js')
+var alphasort = common.alphasort
+var alphasorti = common.alphasorti
+var setopts = common.setopts
+var ownProp = common.ownProp
+var childrenIgnored = common.childrenIgnored
+
+function globSync (pattern, options) {
+ if (typeof options === 'function' || arguments.length === 3)
+ throw new TypeError('callback provided to sync glob\n'+
+ 'See: https://github.com/isaacs/node-glob/issues/167')
+
+ return new GlobSync(pattern, options).found
+}
+
+function GlobSync (pattern, options) {
+ if (!pattern)
+ throw new Error('must provide pattern')
+
+ if (typeof options === 'function' || arguments.length === 3)
+ throw new TypeError('callback provided to sync glob\n'+
+ 'See: https://github.com/isaacs/node-glob/issues/167')
+
+ if (!(this instanceof GlobSync))
+ return new GlobSync(pattern, options)
+
+ setopts(this, pattern, options)
+
+ if (this.noprocess)
+ return this
+
+ var n = this.minimatch.set.length
+ this.matches = new Array(n)
+ for (var i = 0; i < n; i ++) {
+ this._process(this.minimatch.set[i], i, false)
+ }
+ this._finish()
+}
+
+GlobSync.prototype._finish = function () {
+ assert(this instanceof GlobSync)
+ if (this.realpath) {
+ var self = this
+ this.matches.forEach(function (matchset, index) {
+ var set = self.matches[index] = Object.create(null)
+ for (var p in matchset) {
+ try {
+ p = self._makeAbs(p)
+ var real = fs.realpathSync(p, self.realpathCache)
+ set[real] = true
+ } catch (er) {
+ if (er.syscall === 'stat')
+ set[self._makeAbs(p)] = true
+ else
+ throw er
+ }
+ }
+ })
+ }
+ common.finish(this)
+}
+
+
+GlobSync.prototype._process = function (pattern, index, inGlobStar) {
+ assert(this instanceof GlobSync)
+
+ // 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:
+ this._processSimple(pattern.join('/'), index)
+ 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).join('/')
+ break
+ }
+
+ var remain = pattern.slice(n)
+
+ // get the list of entries.
+ var read
+ if (prefix === null)
+ read = '.'
+ else if (isAbsolute(prefix) || isAbsolute(pattern.join('/'))) {
+ if (!prefix || !isAbsolute(prefix))
+ prefix = '/' + prefix
+ read = prefix
+ } else
+ read = prefix
+
+ var abs = this._makeAbs(read)
+
+ //if ignored, skip processing
+ if (childrenIgnored(this, read))
+ return
+
+ var isGlobStar = remain[0] === minimatch.GLOBSTAR
+ if (isGlobStar)
+ this._processGlobStar(prefix, read, abs, remain, index, inGlobStar)
+ else
+ this._processReaddir(prefix, read, abs, remain, index, inGlobStar)
+}
+
+
+GlobSync.prototype._processReaddir = function (prefix, read, abs, remain, index, inGlobStar) {
+ var entries = this._readdir(abs, inGlobStar)
+
+ // if the abs isn't a dir, then nothing can match!
+ if (!entries)
+ return
+
+ // 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 = remain[0]
+ var negate = !!this.minimatch.negate
+ var rawGlob = pn._glob
+ var dotOk = this.dot || rawGlob.charAt(0) === '.'
+
+ var matchedEntries = []
+ for (var i = 0; i < entries.length; i++) {
+ var e = entries[i]
+ if (e.charAt(0) !== '.' || dotOk) {
+ var m
+ if (negate && !prefix) {
+ m = !e.match(pn)
+ } else {
+ m = e.match(pn)
+ }
+ if (m)
+ matchedEntries.push(e)
+ }
+ }
+
+ var len = matchedEntries.length
+ // If there are no matched entries, then nothing matches.
+ if (len === 0)
+ return
+
+ // if this is the last remaining pattern bit, then no need for
+ // an additional stat *unless* the user has specified mark or
+ // stat explicitly. We know they exist, since readdir returned
+ // them.
+
+ if (remain.length === 1 && !this.mark && !this.stat) {
+ if (!this.matches[index])
+ this.matches[index] = Object.create(null)
+
+ for (var i = 0; i < len; i ++) {
+ var e = matchedEntries[i]
+ if (prefix) {
+ if (prefix.slice(-1) !== '/')
+ e = prefix + '/' + e
+ else
+ e = prefix + e
+ }
+
+ if (e.charAt(0) === '/' && !this.nomount) {
+ e = path.join(this.root, e)
+ }
+ this.matches[index][e] = true
+ }
+ // This was the last one, and no stats were needed
+ return
+ }
+
+ // now test all matched entries as stand-ins for that part
+ // of the pattern.
+ remain.shift()
+ for (var i = 0; i < len; i ++) {
+ var e = matchedEntries[i]
+ var newPattern
+ if (prefix)
+ newPattern = [prefix, e]
+ else
+ newPattern = [e]
+ this._process(newPattern.concat(remain), index, inGlobStar)
+ }
+}
+
+
+GlobSync.prototype._emitMatch = function (index, e) {
+ var abs = this._makeAbs(e)
+ if (this.mark)
+ e = this._mark(e)
+
+ if (this.matches[index][e])
+ return
+
+ if (this.nodir) {
+ var c = this.cache[this._makeAbs(e)]
+ if (c === 'DIR' || Array.isArray(c))
+ return
+ }
+
+ this.matches[index][e] = true
+ if (this.stat)
+ this._stat(e)
+}
+
+
+GlobSync.prototype._readdirInGlobStar = function (abs) {
+ // follow all symlinked directories forever
+ // just proceed as if this is a non-globstar situation
+ if (this.follow)
+ return this._readdir(abs, false)
+
+ var entries
+ var lstat
+ var stat
+ try {
+ lstat = fs.lstatSync(abs)
+ } catch (er) {
+ // lstat failed, doesn't exist
+ return null
+ }
+
+ var isSym = lstat.isSymbolicLink()
+ this.symlinks[abs] = isSym
+
+ // If it's not a symlink or a dir, then it's definitely a regular file.
+ // don't bother doing a readdir in that case.
+ if (!isSym && !lstat.isDirectory())
+ this.cache[abs] = 'FILE'
+ else
+ entries = this._readdir(abs, false)
+
+ return entries
+}
+
+GlobSync.prototype._readdir = function (abs, inGlobStar) {
+ var entries
+
+ if (inGlobStar && !ownProp(this.symlinks, abs))
+ return this._readdirInGlobStar(abs)
+
+ if (ownProp(this.cache, abs)) {
+ var c = this.cache[abs]
+ if (!c || c === 'FILE')
+ return null
+
+ if (Array.isArray(c))
+ return c
+ }
+
+ try {
+ return this._readdirEntries(abs, fs.readdirSync(abs))
+ } catch (er) {
+ this._readdirError(abs, er)
+ return null
+ }
+}
+
+GlobSync.prototype._readdirEntries = function (abs, entries) {
+ // if we haven't asked to stat everything, then just
+ // assume that everything in there exists, so we can avoid
+ // having to stat it a second time.
+ if (!this.mark && !this.stat) {
+ for (var i = 0; i < entries.length; i ++) {
+ var e = entries[i]
+ if (abs === '/')
+ e = abs + e
+ else
+ e = abs + '/' + e
+ this.cache[e] = true
+ }
+ }
+
+ this.cache[abs] = entries
+
+ // mark and cache dir-ness
+ return entries
+}
+
+GlobSync.prototype._readdirError = function (f, er) {
+ // handle errors, and cache the information
+ switch (er.code) {
+ case 'ENOTSUP': // https://github.com/isaacs/node-glob/issues/205
+ case 'ENOTDIR': // totally normal. means it *does* exist.
+ this.cache[this._makeAbs(f)] = 'FILE'
+ break
+
+ case 'ENOENT': // not terribly unusual
+ case 'ELOOP':
+ case 'ENAMETOOLONG':
+ case 'UNKNOWN':
+ this.cache[this._makeAbs(f)] = false
+ break
+
+ default: // some unusual error. Treat as failure.
+ this.cache[this._makeAbs(f)] = false
+ if (this.strict)
+ throw er
+ if (!this.silent)
+ console.error('glob error', er)
+ break
+ }
+}
+
+GlobSync.prototype._processGlobStar = function (prefix, read, abs, remain, index, inGlobStar) {
+
+ var entries = this._readdir(abs, inGlobStar)
+
+ // no entries means not a dir, so it can never have matches
+ // foo.txt/** doesn't match foo.txt
+ if (!entries)
+ return
+
+ // test without the globstar, and with every child both below
+ // and replacing the globstar.
+ var remainWithoutGlobStar = remain.slice(1)
+ var gspref = prefix ? [ prefix ] : []
+ var noGlobStar = gspref.concat(remainWithoutGlobStar)
+
+ // the noGlobStar pattern exits the inGlobStar state
+ this._process(noGlobStar, index, false)
+
+ var len = entries.length
+ var isSym = this.symlinks[abs]
+
+ // If it's a symlink, and we're in a globstar, then stop
+ if (isSym && inGlobStar)
+ return
+
+ for (var i = 0; i < len; i++) {
+ var e = entries[i]
+ if (e.charAt(0) === '.' && !this.dot)
+ continue
+
+ // these two cases enter the inGlobStar state
+ var instead = gspref.concat(entries[i], remainWithoutGlobStar)
+ this._process(instead, index, true)
+
+ var below = gspref.concat(entries[i], remain)
+ this._process(below, index, true)
+ }
+}
+
+GlobSync.prototype._processSimple = function (prefix, index) {
+ // XXX review this. Shouldn't it be doing the mounting etc
+ // before doing stat? kinda weird?
+ var exists = this._stat(prefix)
+
+ if (!this.matches[index])
+ this.matches[index] = Object.create(null)
+
+ // If it doesn't exist, then just mark the lack of results
+ if (!exists)
+ return
+
+ if (prefix && isAbsolute(prefix) && !this.nomount) {
+ var trail = /[\/\\]$/.test(prefix)
+ if (prefix.charAt(0) === '/') {
+ prefix = path.join(this.root, prefix)
+ } else {
+ prefix = path.resolve(this.root, prefix)
+ if (trail)
+ prefix += '/'
+ }
+ }
+
+ if (process.platform === 'win32')
+ prefix = prefix.replace(/\\/g, '/')
+
+ // Mark this as a match
+ this.matches[index][prefix] = true
+}
+
+// Returns either 'DIR', 'FILE', or false
+GlobSync.prototype._stat = function (f) {
+ var abs = this._makeAbs(f)
+ var needDir = f.slice(-1) === '/'
+
+ if (f.length > this.maxLength)
+ return false
+
+ if (!this.stat && ownProp(this.cache, abs)) {
+ var c = this.cache[abs]
+
+ if (Array.isArray(c))
+ c = 'DIR'
+
+ // It exists, but maybe not how we need it
+ if (!needDir || c === 'DIR')
+ return c
+
+ if (needDir && c === 'FILE')
+ return false
+
+ // otherwise we have to stat, because maybe c=true
+ // if we know it exists, but not what it is.
+ }
+
+ var exists
+ var stat = this.statCache[abs]
+ if (!stat) {
+ var lstat
+ try {
+ lstat = fs.lstatSync(abs)
+ } catch (er) {
+ return false
+ }
+
+ if (lstat.isSymbolicLink()) {
+ try {
+ stat = fs.statSync(abs)
+ } catch (er) {
+ stat = lstat
+ }
+ } else {
+ stat = lstat
+ }
+ }
+
+ this.statCache[abs] = stat
+
+ var c = stat.isDirectory() ? 'DIR' : 'FILE'
+ this.cache[abs] = this.cache[abs] || c
+
+ if (needDir && c !== 'DIR')
+ return false
+
+ return c
+}
+
+GlobSync.prototype._mark = function (p) {
+ return common.mark(this, p)
+}
+
+GlobSync.prototype._makeAbs = function (f) {
+ return common.makeAbs(this, f)
+}
diff --git a/deps/npm/node_modules/read-package-json/package.json b/deps/npm/node_modules/read-package-json/package.json
index 5c8a150a5dbc9a..a607dd06fed061 100644
--- a/deps/npm/node_modules/read-package-json/package.json
+++ b/deps/npm/node_modules/read-package-json/package.json
@@ -1,6 +1,6 @@
{
"name": "read-package-json",
- "version": "2.0.2",
+ "version": "2.0.3",
"author": {
"name": "Isaac Z. Schlueter",
"email": "i@izs.me",
@@ -16,7 +16,7 @@
"test": "standard && tap test/*.js"
},
"dependencies": {
- "glob": "^5.0.3",
+ "glob": "^6.0.0",
"json-parse-helpfulerror": "^1.0.2",
"normalize-package-data": "^2.0.0",
"graceful-fs": "^4.1.2"
@@ -29,14 +29,42 @@
"graceful-fs": "^4.1.2"
},
"license": "ISC",
- "readme": "# read-package-json\n\nThis is the thing that npm uses to read package.json files. It\nvalidates some stuff, and loads some default things.\n\nIt keeps a cache of the files you've read, so that you don't end\nup reading the same package.json file multiple times.\n\nNote that if you just want to see what's literally in the package.json\nfile, you can usually do `var data = require('some-module/package.json')`.\n\nThis module is basically only needed by npm, but it's handy to see what\nnpm will see when it looks at your package.\n\n## Usage\n\n```javascript\nvar readJson = require('read-package-json')\n\n// readJson(filename, [logFunction=noop], [strict=false], cb)\nreadJson('/path/to/package.json', console.error, false, function (er, data) {\n if (er) {\n console.error(\"There was an error reading the file\")\n return\n }\n\n console.error('the package data is', data)\n});\n```\n\n## readJson(file, [logFn = noop], [strict = false], cb)\n\n* `file` {String} The path to the package.json file\n* `logFn` {Function} Function to handle logging. Defaults to a noop.\n* `strict` {Boolean} True to enforce SemVer 2.0 version strings, and\n other strict requirements.\n* `cb` {Function} Gets called with `(er, data)`, as is The Node Way.\n\nReads the JSON file and does the things.\n\n## `package.json` Fields\n\nSee `man 5 package.json` or `npm help json`.\n\n## readJson.log\n\nBy default this is a reference to the `npmlog` module. But if that\nmodule can't be found, then it'll be set to just a dummy thing that does\nnothing.\n\nReplace with your own `{log,warn,error}` object for fun loggy time.\n\n## readJson.extras(file, data, cb)\n\nRun all the extra stuff relative to the file, with the parsed data.\n\nModifies the data as it does stuff. Calls the cb when it's done.\n\n## readJson.extraSet = [fn, fn, ...]\n\nArray of functions that are called by `extras`. Each one receives the\narguments `fn(file, data, cb)` and is expected to call `cb(er, data)`\nwhen done or when an error occurs.\n\nOrder is indeterminate, so each function should be completely\nindependent.\n\nMix and match!\n\n## readJson.cache\n\nThe `lru-cache` object that readJson uses to not read the same file over\nand over again. See\n[lru-cache](https://github.com/isaacs/node-lru-cache) for details.\n\n## Other Relevant Files Besides `package.json`\n\nSome other files have an effect on the resulting data object, in the\nfollowing ways:\n\n### `README?(.*)`\n\nIf there is a `README` or `README.*` file present, then npm will attach\na `readme` field to the data with the contents of this file.\n\nOwing to the fact that roughly 100% of existing node modules have\nMarkdown README files, it will generally be assumed to be Markdown,\nregardless of the extension. Please plan accordingly.\n\n### `server.js`\n\nIf there is a `server.js` file, and there is not already a\n`scripts.start` field, then `scripts.start` will be set to `node\nserver.js`.\n\n### `AUTHORS`\n\nIf there is not already a `contributors` field, then the `contributors`\nfield will be set to the contents of the `AUTHORS` file, split by lines,\nand parsed.\n\n### `bindings.gyp`\n\nIf a bindings.gyp file exists, and there is not already a\n`scripts.install` field, then the `scripts.install` field will be set to\n`node-gyp rebuild`.\n\n### `index.js`\n\nIf the json file does not exist, but there is a `index.js` file\npresent instead, and that file has a package comment, then it will try\nto parse the package comment, and use that as the data instead.\n\nA package comment looks like this:\n\n```javascript\n/**package\n * { \"name\": \"my-bare-module\"\n * , \"version\": \"1.2.3\"\n * , \"description\": \"etc....\" }\n **/\n\n// or...\n\n/**package\n{ \"name\": \"my-bare-module\"\n, \"version\": \"1.2.3\"\n, \"description\": \"etc....\" }\n**/\n```\n\nThe important thing is that it starts with `/**package`, and ends with\n`**/`. If the package.json file exists, then the index.js is not\nparsed.\n\n### `{directories.man}/*.[0-9]`\n\nIf there is not already a `man` field defined as an array of files or a\nsingle file, and\nthere is a `directories.man` field defined, then that directory will\nbe searched for manpages.\n\nAny valid manpages found in that directory will be assigned to the `man`\narray, and installed in the appropriate man directory at package install\ntime, when installed globally on a Unix system.\n\n### `{directories.bin}/*`\n\nIf there is not already a `bin` field defined as a string filename or a\nhash of ` : ` pairs, then the `directories.bin`\ndirectory will be searched and all the files within it will be linked as\nexecutables at install time.\n\nWhen installing locally, npm links bins into `node_modules/.bin`, which\nis in the `PATH` environ when npm runs scripts. When\ninstalling globally, they are linked into `{prefix}/bin`, which is\npresumably in the `PATH` environment variable.\n",
- "readmeFilename": "README.md",
- "gitHead": "0c51e0a836de1a6eaa0d4ce1a8692162598d1276",
+ "gitHead": "336a212716bb830781d7e71580adaeda377b69d9",
"bugs": {
"url": "https://github.com/npm/read-package-json/issues"
},
"homepage": "https://github.com/npm/read-package-json#readme",
- "_id": "read-package-json@2.0.2",
- "_shasum": "fba055da32caef82e8eff08fc0cac78fc1d027cd",
- "_from": "read-package-json@>=2.0.2 <2.1.0"
+ "_id": "read-package-json@2.0.3",
+ "_shasum": "f8cec1627053b54f384b353224545e607554c5d2",
+ "_from": "read-package-json@2.0.3",
+ "_npmVersion": "3.5.4",
+ "_nodeVersion": "4.2.2",
+ "_npmUser": {
+ "name": "iarna",
+ "email": "me@re-becca.org"
+ },
+ "dist": {
+ "shasum": "f8cec1627053b54f384b353224545e607554c5d2",
+ "tarball": "http://registry.npmjs.org/read-package-json/-/read-package-json-2.0.3.tgz"
+ },
+ "maintainers": [
+ {
+ "name": "iarna",
+ "email": "me@re-becca.org"
+ },
+ {
+ "name": "isaacs",
+ "email": "isaacs@npmjs.com"
+ },
+ {
+ "name": "othiym23",
+ "email": "ogd@aoaioxxysz.net"
+ },
+ {
+ "name": "zkat",
+ "email": "kat@sykosomatic.org"
+ }
+ ],
+ "directories": {},
+ "_resolved": "https://registry.npmjs.org/read-package-json/-/read-package-json-2.0.3.tgz"
}
diff --git a/deps/npm/node_modules/read-package-json/zunda b/deps/npm/node_modules/read-package-json/zunda
new file mode 100644
index 00000000000000..8a80494483ec17
--- /dev/null
+++ b/deps/npm/node_modules/read-package-json/zunda
@@ -0,0 +1 @@
+{"_id":"zunda","_rev":"2-d344ae8ca038029c6651c8fd579d3b39","name":"zunda","description":"Zunda for Node.js","dist-tags":{"latest":"0.0.1"},"versions":{"0.0.1":{"name":"zunda","version":"0.0.1","author":{"name":"inken"},"description":"Zunda for Node.js","main":"zunda.js","dependencies":{"execsync":"*"},"repository":{"type":"git","url":"https://github.com/inkenkun/node-zunda.git"},"keywords":["zunda"],"homepage":"http://x1.inkenkun.com/","license":"MIT","bugs":{"url":"https://github.com/inkenkun/node-zunda/issues"},"_id":"zunda@0.0.1","dist":{"shasum":"c54fe03aa53efbcf52fcd5c7da4180d3f37871c9","tarball":"http://registry.npmjs.org/zunda/-/zunda-0.0.1.tgz"},"_from":".","_npmVersion":"1.4.3","_npmUser":{"name":"inken","email":"inkenkun@gmail.com"},"maintainers":[{"name":"inken","email":"inkenkun@gmail.com"}],"directories":{}}},"readme":"# ZundaJS\r\n\r\nZundaの結果をパースする Node.js 用モジュールです。\r\n\r\n## Installation\r\n\r\n``` shell\r\n$ npm install zunda\r\n```\r\n\r\n\r\n## Usage\r\n\r\n### Asynchronous\r\n\r\n```javascript\r\n\tvar Zunda = new require('zunda')\r\n\t , zunda = new Zunda()\r\n\t;\r\n\tzunda.parse('次郎は大阪に行ったが、太郎は東京には行かず地元に残ろうとした', function(err, result) {\r\n\t\tif (err) throw err;\r\n\t\tconsole.log(result);\r\n\t});\r\n```\r\n\r\n### Synchronous\r\n\r\n```javascript\r\n\tvar Zunda = new require('zunda')\r\n\t , zunda = new Zunda()\r\n\t;\r\n\tvar result = zunda.parseSync('次郎は大阪に行ったが、太郎は東京には行かず地元に残ろうとした');\r\n\tconsole.log(result);\r\n```\r\n\r\n## Result\r\n\r\n\r\n\t [ \r\n\t { event: [ '#EVENT0', '4', 'wr:筆者', '非未来', '0', '叙述', '成立', '0', '0' ],\r\n words: '次郎は大阪に行ったが、',\r\n \t wakachi: '次郎 は 大阪 に 行っ た が 、' },\r\n { event: [ '#EVENT1', '13', 'wr:筆者', '未来', '0', '叙述', '不成立', '0', '0' ],\r\n words: '太郎は東京には行かず',\r\n wakachi: '太郎 は 東京 に は 行か ず' },\r\n { event: [ '#EVENT2', '17', 'wr:筆者', '未来', '0', '意志', '高確率', 'ポジティブ', '0' ],\r\n words: '地元に残ろうとした',\r\n wakachi: '地元 に 残ろ う と し た' },\r\n { event: [ '#EVENT3', '20', 'wr:筆者', '非未来', '0', '叙述', '成立', '0', '0' ],\r\n words: '残ろうとした',\r\n wakachi: '残ろ う と し た' } \r\n ]\r\n\r\n\r\n\r\n## Reference\r\n\r\nhicomiさんの mecab-async https://www.npmjs.org/package/mecab-async を参考にさせていただきました。\r\nzunda https://code.google.com/p/zunda/\r\n","maintainers":[{"name":"inken","email":"inkenkun@gmail.com"}],"time":{"modified":"2014-06-23T01:53:45.429Z","created":"2014-06-23T01:53:45.429Z","0.0.1":"2014-06-23T01:53:45.429Z"},"homepage":"http://x1.inkenkun.com/","keywords":["zunda"],"repository":{"type":"git","url":"https://github.com/inkenkun/node-zunda.git"},"author":{"name":"inken"},"bugs":{"url":"https://github.com/inkenkun/node-zunda/issues"},"license":"MIT","readmeFilename":"README.md","_attachments":{}}
\ No newline at end of file
diff --git a/deps/npm/node_modules/request/.travis.yml b/deps/npm/node_modules/request/.travis.yml
index d793e7f545f775..c24c59b5d5b4fa 100644
--- a/deps/npm/node_modules/request/.travis.yml
+++ b/deps/npm/node_modules/request/.travis.yml
@@ -1,9 +1,9 @@
language: node_js
node_js:
- - "4.0"
- - "io.js"
- - "0.12"
- - "0.10"
+ - node
+ - io.js
+ - 0.12
+ - 0.10
sudo: false
after_script: "npm run test-cov && cat ./coverage/lcov.info | codecov && cat ./coverage/lcov.info | coveralls"
diff --git a/deps/npm/node_modules/request/CHANGELOG.md b/deps/npm/node_modules/request/CHANGELOG.md
index a43c6726a479d5..86386a9ae5cba4 100644
--- a/deps/npm/node_modules/request/CHANGELOG.md
+++ b/deps/npm/node_modules/request/CHANGELOG.md
@@ -1,5 +1,45 @@
## Change Log
+### v2.68.0 (2016/01/27)
+- [#2036](https://github.com/request/request/pull/2036) Add AWS Signature Version 4 (@simov, @mirkods)
+- [#2022](https://github.com/request/request/pull/2022) Convert numeric multipart bodies to string (@simov, @feross)
+- [#2024](https://github.com/request/request/pull/2024) Update har-validator dependency for nsp advisory #76 (@TylerDixon)
+- [#2016](https://github.com/request/request/pull/2016) Update qs to version 6.0.2 🚀 (@greenkeeperio-bot)
+- [#2007](https://github.com/request/request/pull/2007) Use the `extend` module instead of util._extend (@simov)
+- [#2003](https://github.com/request/request/pull/2003) Update browserify to version 13.0.0 🚀 (@greenkeeperio-bot)
+- [#1989](https://github.com/request/request/pull/1989) Update buffer-equal to version 1.0.0 🚀 (@greenkeeperio-bot)
+- [#1956](https://github.com/request/request/pull/1956) Check form-data content-length value before setting up the header (@jongyoonlee)
+- [#1958](https://github.com/request/request/pull/1958) Use IncomingMessage.destroy method (@simov)
+- [#1952](https://github.com/request/request/pull/1952) Adds example for Tor proxy (@prometheansacrifice)
+- [#1943](https://github.com/request/request/pull/1943) Update eslint to version 1.10.3 🚀 (@simov, @greenkeeperio-bot)
+- [#1924](https://github.com/request/request/pull/1924) Update eslint to version 1.10.1 🚀 (@greenkeeperio-bot)
+- [#1915](https://github.com/request/request/pull/1915) Remove content-length and transfer-encoding headers from defaultProxyHeaderWhiteList (@yaxia)
+
+### v2.67.0 (2015/11/19)
+- [#1913](https://github.com/request/request/pull/1913) Update http-signature to version 1.1.0 🚀 (@greenkeeperio-bot)
+
+### v2.66.0 (2015/11/18)
+- [#1906](https://github.com/request/request/pull/1906) Update README URLs based on HTTP redirects (@ReadmeCritic)
+- [#1905](https://github.com/request/request/pull/1905) Convert typed arrays into regular buffers (@simov)
+- [#1902](https://github.com/request/request/pull/1902) node-uuid@1.4.7 breaks build 🚨 (@greenkeeperio-bot)
+- [#1894](https://github.com/request/request/pull/1894) Fix tunneling after redirection from https (Original: #1881) (@simov, @falms)
+- [#1893](https://github.com/request/request/pull/1893) Update eslint to version 1.9.0 🚀 (@greenkeeperio-bot)
+- [#1852](https://github.com/request/request/pull/1852) Update eslint to version 1.7.3 🚀 (@simov, @greenkeeperio-bot, @paulomcnally, @michelsalib, @arbaaz, @vladimirich, @LoicMahieu, @JoshWillik, @jzaefferer, @ryanwholey, @djchie, @thisconnect, @mgenereu, @acroca, @Sebmaster, @Bloutiouf)
+- [#1876](https://github.com/request/request/pull/1876) Implement loose matching for har mime types (@simov)
+- [#1875](https://github.com/request/request/pull/1875) Update bluebird to version 3.0.2 🚀 (@simov, @greenkeeperio-bot)
+- [#1871](https://github.com/request/request/pull/1871) Update browserify to version 12.0.1 🚀 (@greenkeeperio-bot)
+- [#1866](https://github.com/request/request/pull/1866) Add missing quotes on x-token property in README (@miguelmota)
+- [#1874](https://github.com/request/request/pull/1874) Fix typo in README.md (@gswalden)
+- [#1860](https://github.com/request/request/pull/1860) Improve referer header tests and docs (@simov)
+- [#1861](https://github.com/request/request/pull/1861) Remove redundant call to Stream constructor (@watson)
+- [#1857](https://github.com/request/request/pull/1857) Fix Referer header to point to the original host name (@simov)
+- [#1850](https://github.com/request/request/pull/1850) Update karma-coverage to version 0.5.3 🚀 (@greenkeeperio-bot)
+- [#1847](https://github.com/request/request/pull/1847) Use node's latest version when building (@simov)
+- [#1836](https://github.com/request/request/pull/1836) Tunnel: fix wrong property name (@Bloutiouf)
+- [#1820](https://github.com/request/request/pull/1820) Set href as request.js uses it (@mgenereu)
+- [#1840](https://github.com/request/request/pull/1840) Update http-signature to version 1.0.2 🚀 (@greenkeeperio-bot)
+- [#1845](https://github.com/request/request/pull/1845) Update istanbul to version 0.4.0 🚀 (@greenkeeperio-bot)
+
### v2.65.0 (2015/10/11)
- [#1833](https://github.com/request/request/pull/1833) Update aws-sign2 to version 0.6.0 🚀 (@greenkeeperio-bot)
- [#1811](https://github.com/request/request/pull/1811) Enable loose cookie parsing in tough-cookie (@Sebmaster)
@@ -430,7 +470,7 @@
- [#521](https://github.com/request/request/pull/521) Improving test-localAddress.js (@noway421)
- [#529](https://github.com/request/request/pull/529) dependencies versions bump (@jodaka)
-### v2.17.0 (2013/04/22)
+### v2.18.0 (2013/04/22)
- [#523](https://github.com/request/request/pull/523) Updating dependencies (@noway421)
- [#520](https://github.com/request/request/pull/520) Fixing test-tunnel.js (@noway421)
- [#519](https://github.com/request/request/pull/519) Update internal path state on post-creation QS changes (@jblebrun)
diff --git a/deps/npm/node_modules/request/README.md b/deps/npm/node_modules/request/README.md
index c18b022abe726d..6ee45b205d5473 100644
--- a/deps/npm/node_modules/request/README.md
+++ b/deps/npm/node_modules/request/README.md
@@ -161,7 +161,7 @@ request.post({url:'http://service.com/upload', form: {key:'value'}}, function(er
#### multipart/form-data (Multipart Form Uploads)
-For `multipart/form-data` we use the [form-data](https://github.com/felixge/node-form-data) library by [@felixge](https://github.com/felixge). For the most cases, you can pass your upload form data via the `formData` option.
+For `multipart/form-data` we use the [form-data](https://github.com/form-data/form-data) library by [@felixge](https://github.com/felixge). For the most cases, you can pass your upload form data via the `formData` option.
```js
@@ -179,7 +179,7 @@ var formData = {
],
// Pass optional meta-data with an 'options' object with style: {value: DATA, options: OPTIONS}
// Use case: for some types of streams, you'll need to provide "file"-related information manually.
- // See the `form-data` README for more information about options: https://github.com/felixge/node-form-data
+ // See the `form-data` README for more information about options: https://github.com/form-data/form-data
custom_file: {
value: fs.createReadStream('/dev/urandom'),
options: {
@@ -206,7 +206,7 @@ form.append('my_field', 'my_value');
form.append('my_buffer', new Buffer([1, 2, 3]));
form.append('custom_file', fs.createReadStream(__dirname + '/unicycle.jpg'), {filename: 'unicycle.jpg'});
```
-See the [form-data README](https://github.com/felixge/node-form-data) for more information & examples.
+See the [form-data README](https://github.com/form-data/form-data) for more information & examples.
#### multipart/related
@@ -472,7 +472,7 @@ HTTP/1.1 200 OK
At this point, the connection is left open, and the client is
communicating directly with the `endpoint-server.com` machine.
-See [the wikipedia page on HTTP Tunneling](http://en.wikipedia.org/wiki/HTTP_tunnel)
+See [the wikipedia page on HTTP Tunneling](https://en.wikipedia.org/wiki/HTTP_tunnel)
for more information.
By default, when proxying `http` traffic, request will simply make a
@@ -566,7 +566,7 @@ Here's some examples of valid `no_proxy` values:
## UNIX Domain Sockets
-`request` supports making requests to [UNIX Domain Sockets](http://en.wikipedia.org/wiki/Unix_domain_socket). To make one, use the following URL scheme:
+`request` supports making requests to [UNIX Domain Sockets](https://en.wikipedia.org/wiki/Unix_domain_socket). To make one, use the following URL scheme:
```js
/* Pattern */ 'http://unix:SOCKET:PATH'
@@ -746,7 +746,7 @@ The first argument can be either a `url` or an `options` object. The only requir
In non-chunked requests, data items with body streams are not allowed.
- `preambleCRLF` - append a newline/CRLF before the boundary of your `multipart/form-data` request.
- `postambleCRLF` - append a newline/CRLF at the end of the boundary of your `multipart/form-data` request.
-- `json` - sets `body` but to JSON representation of value and adds `Content-type: application/json` header. Additionally, parses the response body as JSON.
+- `json` - sets `body` to JSON representation of value and adds `Content-type: application/json` header. Additionally, parses the response body as JSON.
- `jsonReviver` - a [reviver function](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/parse) that will be passed to `JSON.parse()` when parsing a JSON response body.
---
@@ -754,7 +754,7 @@ The first argument can be either a `url` or an `options` object. The only requir
- `auth` - A hash containing values `user` || `username`, `pass` || `password`, and `sendImmediately` (optional). See documentation above.
- `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).
-- `aws` - `object` containing AWS signing information. Should have the properties `key`, `secret`. Also requires the property `bucket`, unless you’re specifying your `bucket` as part of the path, or the request doesn’t use a bucket (i.e. GET Services)
+- `aws` - `object` containing AWS signing information. Should have the properties `key`, `secret`. Also requires the property `bucket`, unless you’re specifying your `bucket` as part of the path, or the request doesn’t use a bucket (i.e. GET Services). If you want to use AWS sign version 4 use the parameter `sign_version` with value `4` otherwise the default is version 2. **Note:** you need to `npm install aws4` first.
- `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.
---
@@ -762,7 +762,7 @@ The first argument can be either a `url` or an `options` object. The only requir
- `followRedirect` - follow HTTP 3xx responses as redirects (default: `true`). This property can also be implemented as function which gets `response` object as a single argument and should return `true` if redirects should continue or `false` otherwise.
- `followAllRedirects` - follow non-GET HTTP 3xx responses as redirects (default: `false`)
- `maxRedirects` - the maximum number of redirects to follow (default: `10`)
-- `removeRefererHeader` - removes the referer header when a redirect happens (default: `false`).
+- `removeRefererHeader` - removes the referer header when a redirect happens (default: `false`). **Note:** if true, referer header set in the initial request is preserved during redirect chain.
---
@@ -799,8 +799,7 @@ default in Linux can be anywhere from 20-120 seconds][linux-timeout]).
- `tunnel` - controls the behavior of
[HTTP `CONNECT` tunneling](https://en.wikipedia.org/wiki/HTTP_tunnel#HTTP_CONNECT_tunneling)
as follows:
- - `undefined` (default) - `true` if the destination is `https` or a previous
- request in the redirect chain used a tunneling proxy, `false` otherwise
+ - `undefined` (default) - `true` if the destination is `https`, `false` otherwise
- `true` - always tunnel to the destination by making a `CONNECT` request to
the proxy
- `false` - request the destination as a `GET` request.
@@ -845,7 +844,7 @@ For example:
```js
//requests using baseRequest() will set the 'x-token' header
var baseRequest = request.defaults({
- headers: {x-token: 'my-token'}
+ headers: {'x-token': 'my-token'}
})
//requests using specialRequest() will include the 'x-token' header set in
@@ -933,7 +932,7 @@ There are at least three ways to debug the operation of `request`:
2. Set `require('request').debug = true` at any time (this does the same thing
as #1).
-3. Use the [request-debug module](https://github.com/nylen/request-debug) to
+3. Use the [request-debug module](https://github.com/request/request-debug) to
view request and response headers and bodies.
[back to top](#table-of-contents)
@@ -1076,9 +1075,9 @@ request('http://www.google.com', function() {
```
The cookie store must be a
-[`tough-cookie`](https://github.com/goinstant/tough-cookie)
+[`tough-cookie`](https://github.com/SalesforceEng/tough-cookie)
store and it must support synchronous operations; see the
-[`CookieStore` API docs](https://github.com/goinstant/tough-cookie/#cookiestore-api)
+[`CookieStore` API docs](https://github.com/SalesforceEng/tough-cookie#cookiestore-api)
for details.
To inspect your cookie jar after a request:
diff --git a/deps/npm/node_modules/request/lib/har.js b/deps/npm/node_modules/request/lib/har.js
index 83453a3274bbbe..30595748781ad1 100644
--- a/deps/npm/node_modules/request/lib/har.js
+++ b/deps/npm/node_modules/request/lib/har.js
@@ -3,7 +3,7 @@
var fs = require('fs')
var qs = require('querystring')
var validate = require('har-validator')
-var util = require('util')
+var extend = require('extend')
function Har (request) {
this.request = request
@@ -60,43 +60,53 @@ Har.prototype.prep = function (data) {
}
// prep body
- switch (data.postData.mimeType) {
- case 'multipart/mixed':
- case 'multipart/related':
- case 'multipart/form-data':
- case 'multipart/alternative':
- // reset values
- data.postData.mimeType = 'multipart/form-data'
- break
-
- case 'application/x-www-form-urlencoded':
- if (!data.postData.params) {
- data.postData.text = ''
- } else {
- data.postData.paramsObj = data.postData.params.reduce(this.reducer, {})
-
- // always overwrite
- data.postData.text = qs.stringify(data.postData.paramsObj)
- }
- break
-
- case 'text/json':
- case 'text/x-json':
- case 'application/json':
- case 'application/x-json':
- data.postData.mimeType = 'application/json'
-
- if (data.postData.text) {
- try {
- data.postData.jsonObj = JSON.parse(data.postData.text)
- } catch (e) {
- this.request.debug(e)
-
- // force back to text/plain
- data.postData.mimeType = 'text/plain'
- }
+ function some (arr) {
+ return arr.some(function (type) {
+ return data.postData.mimeType.indexOf(type) === 0
+ })
+ }
+
+ if (some([
+ 'multipart/mixed',
+ 'multipart/related',
+ 'multipart/form-data',
+ 'multipart/alternative'])) {
+
+ // reset values
+ data.postData.mimeType = 'multipart/form-data'
+ }
+
+ else if (some([
+ 'application/x-www-form-urlencoded'])) {
+
+ if (!data.postData.params) {
+ data.postData.text = ''
+ } else {
+ data.postData.paramsObj = data.postData.params.reduce(this.reducer, {})
+
+ // always overwrite
+ data.postData.text = qs.stringify(data.postData.paramsObj)
+ }
+ }
+
+ else if (some([
+ 'text/json',
+ 'text/x-json',
+ 'application/json',
+ 'application/x-json'])) {
+
+ data.postData.mimeType = 'application/json'
+
+ if (data.postData.text) {
+ try {
+ data.postData.jsonObj = JSON.parse(data.postData.text)
+ } catch (e) {
+ this.request.debug(e)
+
+ // force back to text/plain
+ data.postData.mimeType = 'text/plain'
}
- break
+ }
}
return data
@@ -108,7 +118,8 @@ Har.prototype.options = function (options) {
return options
}
- var har = util._extend({}, options.har)
+ var har = {}
+ extend(har, options.har)
// only process the first entry
if (har.log && har.log.entries) {
@@ -152,51 +163,50 @@ Har.prototype.options = function (options) {
options.headers = req.headersObj
}
- switch (req.postData.mimeType) {
- case 'application/x-www-form-urlencoded':
- options.form = req.postData.paramsObj
- break
-
- case 'application/json':
- if (req.postData.jsonObj) {
- options.body = req.postData.jsonObj
- options.json = true
- }
- break
-
- case 'multipart/form-data':
- options.formData = {}
+ function test (type) {
+ return req.postData.mimeType.indexOf(type) === 0
+ }
+ if (test('application/x-www-form-urlencoded')) {
+ options.form = req.postData.paramsObj
+ }
+ else if (test('application/json')) {
+ if (req.postData.jsonObj) {
+ options.body = req.postData.jsonObj
+ options.json = true
+ }
+ }
+ else if (test('multipart/form-data')) {
+ options.formData = {}
- req.postData.params.forEach(function (param) {
- var attachment = {}
+ req.postData.params.forEach(function (param) {
+ var attachment = {}
- if (!param.fileName && !param.fileName && !param.contentType) {
- options.formData[param.name] = param.value
- return
- }
+ if (!param.fileName && !param.fileName && !param.contentType) {
+ options.formData[param.name] = param.value
+ return
+ }
- // attempt to read from disk!
- if (param.fileName && !param.value) {
- attachment.value = fs.createReadStream(param.fileName)
- } else if (param.value) {
- attachment.value = param.value
- }
+ // attempt to read from disk!
+ if (param.fileName && !param.value) {
+ attachment.value = fs.createReadStream(param.fileName)
+ } else if (param.value) {
+ attachment.value = param.value
+ }
- if (param.fileName) {
- attachment.options = {
- filename: param.fileName,
- contentType: param.contentType ? param.contentType : null
- }
+ if (param.fileName) {
+ attachment.options = {
+ filename: param.fileName,
+ contentType: param.contentType ? param.contentType : null
}
-
- options.formData[param.name] = attachment
- })
- break
-
- default:
- if (req.postData.text) {
- options.body = req.postData.text
}
+
+ options.formData[param.name] = attachment
+ })
+ }
+ else {
+ if (req.postData.text) {
+ options.body = req.postData.text
+ }
}
return options
diff --git a/deps/npm/node_modules/request/lib/multipart.js b/deps/npm/node_modules/request/lib/multipart.js
index 03618588cc6320..c1281726187b6a 100644
--- a/deps/npm/node_modules/request/lib/multipart.js
+++ b/deps/npm/node_modules/request/lib/multipart.js
@@ -68,6 +68,9 @@ Multipart.prototype.build = function (parts, chunked) {
var body = chunked ? new CombinedStream() : []
function add (part) {
+ if (typeof part === 'number') {
+ part = part.toString()
+ }
return chunked ? body.append(part) : body.push(new Buffer(part))
}
diff --git a/deps/npm/node_modules/request/lib/redirect.js b/deps/npm/node_modules/request/lib/redirect.js
index b2d0f613a35d17..040dfe0e03d335 100644
--- a/deps/npm/node_modules/request/lib/redirect.js
+++ b/deps/npm/node_modules/request/lib/redirect.js
@@ -105,7 +105,7 @@ Redirect.prototype.onResponse = function (response) {
// handle the case where we change protocol from https to http or vice versa
if (request.uri.protocol !== uriPrev.protocol) {
- request._updateProtocol()
+ delete request.agent
}
self.redirects.push(
@@ -120,7 +120,6 @@ Redirect.prototype.onResponse = function (response) {
// request.method = 'GET' // Force all redirects to use GET || commented out fixes #215
delete request.src
delete request.req
- delete request.agent
delete request._started
if (response.statusCode !== 401 && response.statusCode !== 307) {
// Remove parameters from the previous response, unless this is the second request
@@ -141,7 +140,7 @@ Redirect.prototype.onResponse = function (response) {
}
if (!self.removeRefererHeader) {
- request.setHeader('referer', request.uri.href)
+ request.setHeader('referer', uriPrev.href)
}
request.emit('redirect')
diff --git a/deps/npm/node_modules/request/lib/tunnel.js b/deps/npm/node_modules/request/lib/tunnel.js
index cf28016e26ae36..bf96a8fec53361 100644
--- a/deps/npm/node_modules/request/lib/tunnel.js
+++ b/deps/npm/node_modules/request/lib/tunnel.js
@@ -12,7 +12,6 @@ var defaultProxyHeaderWhiteList = [
'cache-control',
'content-encoding',
'content-language',
- 'content-length',
'content-location',
'content-md5',
'content-range',
@@ -24,7 +23,6 @@ var defaultProxyHeaderWhiteList = [
'pragma',
'referer',
'te',
- 'transfer-encoding',
'user-agent',
'via'
]
@@ -34,7 +32,7 @@ var defaultProxyHeaderExclusiveList = [
]
function constructProxyHost(uriObject) {
- var port = uriObject.portA
+ var port = uriObject.port
, protocol = uriObject.protocol
, proxyHost = uriObject.hostname + ':'
@@ -109,22 +107,19 @@ function Tunnel (request) {
this.request = request
this.proxyHeaderWhiteList = defaultProxyHeaderWhiteList
this.proxyHeaderExclusiveList = []
-}
-
-Tunnel.prototype.isEnabled = function (options) {
- var request = this.request
- // Tunnel HTTPS by default, or if a previous request in the redirect chain
- // was tunneled. Allow the user to override this setting.
-
- // If self.tunnel is already set (because this is a redirect), use the
- // existing value.
if (typeof request.tunnel !== 'undefined') {
- return request.tunnel
+ this.tunnelOverride = request.tunnel
}
+}
+
+Tunnel.prototype.isEnabled = function () {
+ var self = this
+ , request = self.request
+ // Tunnel HTTPS by default. Allow the user to override this setting.
- // If options.tunnel is set (the user specified a value), use it.
- if (typeof options.tunnel !== 'undefined') {
- return options.tunnel
+ // If self.tunnelOverride is set (the user specified a value), use it.
+ if (typeof self.tunnelOverride !== 'undefined') {
+ return self.tunnelOverride
}
// If the destination is HTTPS, tunnel.
@@ -132,10 +127,8 @@ Tunnel.prototype.isEnabled = function (options) {
return true
}
- // Otherwise, leave tunnel unset, because if a later request in the redirect
- // chain is HTTPS then that request (and any subsequent ones) should be
- // tunneled.
- return undefined
+ // Otherwise, do not use tunnel.
+ return false
}
Tunnel.prototype.setup = function (options) {
diff --git a/deps/npm/node_modules/request/node_modules/aws4/.npmignore b/deps/npm/node_modules/request/node_modules/aws4/.npmignore
new file mode 100644
index 00000000000000..ccafa6b412bff2
--- /dev/null
+++ b/deps/npm/node_modules/request/node_modules/aws4/.npmignore
@@ -0,0 +1,3 @@
+test
+coverage
+examples
diff --git a/deps/npm/node_modules/request/node_modules/aws4/.travis.yml b/deps/npm/node_modules/request/node_modules/aws4/.travis.yml
new file mode 100644
index 00000000000000..61d06340455977
--- /dev/null
+++ b/deps/npm/node_modules/request/node_modules/aws4/.travis.yml
@@ -0,0 +1,5 @@
+language: node_js
+node_js:
+ - "0.10"
+ - "0.12"
+ - "4.2"
diff --git a/deps/npm/node_modules/request/node_modules/aws4/LICENSE b/deps/npm/node_modules/request/node_modules/aws4/LICENSE
new file mode 100644
index 00000000000000..4f321e599569f4
--- /dev/null
+++ b/deps/npm/node_modules/request/node_modules/aws4/LICENSE
@@ -0,0 +1,19 @@
+Copyright 2013 Michael Hart (michael.hart.au@gmail.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/deps/npm/node_modules/request/node_modules/aws4/README.md b/deps/npm/node_modules/request/node_modules/aws4/README.md
new file mode 100644
index 00000000000000..068a07a8359617
--- /dev/null
+++ b/deps/npm/node_modules/request/node_modules/aws4/README.md
@@ -0,0 +1,509 @@
+aws4
+----
+
+[![Build Status](https://secure.travis-ci.org/mhart/aws4.png?branch=master)](http://travis-ci.org/mhart/aws4)
+
+A small utility to sign vanilla node.js http(s) request options using Amazon's
+[AWS Signature Version 4](http://docs.amazonwebservices.com/general/latest/gr/signature-version-4.html).
+
+This signature is supported by nearly all Amazon services, including
+[S3](http://docs.aws.amazon.com/AmazonS3/latest/API/),
+[EC2](http://docs.aws.amazon.com/AWSEC2/latest/APIReference/),
+[DynamoDB](http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/API.html),
+[Kinesis](http://docs.aws.amazon.com/kinesis/latest/APIReference/),
+[Lambda](http://docs.aws.amazon.com/lambda/latest/dg/API_Reference.html),
+[SQS](http://docs.aws.amazon.com/AWSSimpleQueueService/latest/APIReference/),
+[SNS](http://docs.aws.amazon.com/sns/latest/api/),
+[IAM](http://docs.aws.amazon.com/IAM/latest/APIReference/),
+[STS](http://docs.aws.amazon.com/STS/latest/APIReference/),
+[RDS](http://docs.aws.amazon.com/AmazonRDS/latest/APIReference/),
+[CloudWatch](http://docs.aws.amazon.com/AmazonCloudWatch/latest/APIReference/),
+[CloudWatch Logs](http://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/),
+[CodeDeploy](http://docs.aws.amazon.com/codedeploy/latest/APIReference/),
+[CloudFront](http://docs.aws.amazon.com/AmazonCloudFront/latest/APIReference/),
+[CloudTrail](http://docs.aws.amazon.com/awscloudtrail/latest/APIReference/),
+[ElastiCache](http://docs.aws.amazon.com/AmazonElastiCache/latest/APIReference/),
+[EMR](http://docs.aws.amazon.com/ElasticMapReduce/latest/API/),
+[Glacier](http://docs.aws.amazon.com/amazonglacier/latest/dev/amazon-glacier-api.html),
+[CloudSearch](http://docs.aws.amazon.com/cloudsearch/latest/developerguide/APIReq.html),
+[Elastic Load Balancing](http://docs.aws.amazon.com/ElasticLoadBalancing/latest/APIReference/),
+[Elastic Transcoder](http://docs.aws.amazon.com/elastictranscoder/latest/developerguide/api-reference.html),
+[CloudFormation](http://docs.aws.amazon.com/AWSCloudFormation/latest/APIReference/),
+[Elastic Beanstalk](http://docs.aws.amazon.com/elasticbeanstalk/latest/api/),
+[Storage Gateway](http://docs.aws.amazon.com/storagegateway/latest/userguide/AWSStorageGatewayAPI.html),
+[Data Pipeline](http://docs.aws.amazon.com/datapipeline/latest/APIReference/),
+[Direct Connect](http://docs.aws.amazon.com/directconnect/latest/APIReference/),
+[Redshift](http://docs.aws.amazon.com/redshift/latest/APIReference/),
+[OpsWorks](http://docs.aws.amazon.com/opsworks/latest/APIReference/),
+[SES](http://docs.aws.amazon.com/ses/latest/APIReference/),
+[SWF](http://docs.aws.amazon.com/amazonswf/latest/apireference/),
+[AutoScaling](http://docs.aws.amazon.com/AutoScaling/latest/APIReference/),
+[Mobile Analytics](http://docs.aws.amazon.com/mobileanalytics/latest/ug/server-reference.html),
+[Cognito Identity](http://docs.aws.amazon.com/cognitoidentity/latest/APIReference/),
+[Cognito Sync](http://docs.aws.amazon.com/cognitosync/latest/APIReference/),
+[Container Service](http://docs.aws.amazon.com/AmazonECS/latest/APIReference/),
+[AppStream](http://docs.aws.amazon.com/appstream/latest/developerguide/appstream-api-rest.html),
+[Key Management Service](http://docs.aws.amazon.com/kms/latest/APIReference/),
+[Config](http://docs.aws.amazon.com/config/latest/APIReference/),
+[CloudHSM](http://docs.aws.amazon.com/cloudhsm/latest/dg/api-ref.html),
+[Route53](http://docs.aws.amazon.com/Route53/latest/APIReference/requests-rest.html) and
+[Route53 Domains](http://docs.aws.amazon.com/Route53/latest/APIReference/requests-rpc.html).
+
+Indeed, the only AWS services that *don't* support v4 as of 2014-12-30 are
+[Import/Export](http://docs.aws.amazon.com/AWSImportExport/latest/DG/api-reference.html) and
+[SimpleDB](http://docs.aws.amazon.com/AmazonSimpleDB/latest/DeveloperGuide/SDB_API.html)
+(they only support [AWS Signature Version 2](https://github.com/mhart/aws2)).
+
+It also provides defaults for a number of core AWS headers and
+request parameters, making it very easy to query AWS services, or
+build out a fully-featured AWS library.
+
+Example
+-------
+
+```javascript
+var http = require('http'),
+ https = require('https'),
+ aws4 = require('aws4')
+
+// given an options object you could pass to http.request
+var opts = {host: 'sqs.us-east-1.amazonaws.com', path: '/?Action=ListQueues'}
+
+// alternatively (as aws4 can infer the host):
+opts = {service: 'sqs', region: 'us-east-1', path: '/?Action=ListQueues'}
+
+// alternatively (as us-east-1 is default):
+opts = {service: 'sqs', path: '/?Action=ListQueues'}
+
+aws4.sign(opts) // assumes AWS credentials are available in process.env
+
+console.log(opts)
+/*
+{
+ host: 'sqs.us-east-1.amazonaws.com',
+ path: '/?Action=ListQueues',
+ headers: {
+ Host: 'sqs.us-east-1.amazonaws.com',
+ 'X-Amz-Date': '20121226T061030Z',
+ Authorization: 'AWS4-HMAC-SHA256 Credential=ABCDEF/20121226/us-east-1/sqs/aws4_request, ...'
+ }
+}
+*/
+
+// we can now use this to query AWS using the standard node.js http API
+http.request(opts, function(res) { res.pipe(process.stdout) }).end()
+/*
+
+
+...
+*/
+```
+
+More options
+------------
+
+```javascript
+// you can also pass AWS credentials in explicitly (otherwise taken from process.env)
+aws4.sign(opts, {accessKeyId: '', secretAccessKey: ''})
+
+// can also add the signature to query strings
+aws4.sign({service: 's3', path: '/my-bucket?X-Amz-Expires=12345', signQuery: true})
+
+// create a utility function to pipe to stdout (with https this time)
+function request(o) { https.request(o, function(res) { res.pipe(process.stdout) }).end(o.body || '') }
+
+// aws4 can infer the HTTP method if a body is passed in
+// method will be POST and Content-Type: 'application/x-www-form-urlencoded; charset=utf-8'
+request(aws4.sign({service: 'iam', body: 'Action=ListGroups&Version=2010-05-08'}))
+/*
+
+...
+*/
+
+// can specify any custom option or header as per usual
+request(aws4.sign({
+ service: 'dynamodb',
+ region: 'ap-southeast-2',
+ method: 'POST',
+ path: '/',
+ headers: {
+ 'Content-Type': 'application/x-amz-json-1.0',
+ 'X-Amz-Target': 'DynamoDB_20120810.ListTables'
+ },
+ body: '{}'
+}))
+/*
+{"TableNames":[]}
+...
+*/
+
+// works with all other services that support Signature Version 4
+
+request(aws4.sign({service: 's3', path: '/', signQuery: true}))
+/*
+
+...
+*/
+
+request(aws4.sign({service: 'ec2', path: '/?Action=DescribeRegions&Version=2014-06-15'}))
+/*
+
+...
+*/
+
+request(aws4.sign({service: 'sns', path: '/?Action=ListTopics&Version=2010-03-31'}))
+/*
+
+...
+*/
+
+request(aws4.sign({service: 'sts', path: '/?Action=GetSessionToken&Version=2011-06-15'}))
+/*
+
+...
+*/
+
+request(aws4.sign({service: 'cloudsearch', path: '/?Action=ListDomainNames&Version=2013-01-01'}))
+/*
+
+...
+*/
+
+request(aws4.sign({service: 'ses', path: '/?Action=ListIdentities&Version=2010-12-01'}))
+/*
+
+...
+*/
+
+request(aws4.sign({service: 'autoscaling', path: '/?Action=DescribeAutoScalingInstances&Version=2011-01-01'}))
+/*
+
+...
+*/
+
+request(aws4.sign({service: 'elasticloadbalancing', path: '/?Action=DescribeLoadBalancers&Version=2012-06-01'}))
+/*
+
+...
+*/
+
+request(aws4.sign({service: 'cloudformation', path: '/?Action=ListStacks&Version=2010-05-15'}))
+/*
+
+...
+*/
+
+request(aws4.sign({service: 'elasticbeanstalk', path: '/?Action=ListAvailableSolutionStacks&Version=2010-12-01'}))
+/*
+
+...
+*/
+
+request(aws4.sign({service: 'rds', path: '/?Action=DescribeDBInstances&Version=2012-09-17'}))
+/*
+
+...
+*/
+
+request(aws4.sign({service: 'monitoring', path: '/?Action=ListMetrics&Version=2010-08-01'}))
+/*
+
+...
+*/
+
+request(aws4.sign({service: 'redshift', path: '/?Action=DescribeClusters&Version=2012-12-01'}))
+/*
+
+...
+*/
+
+request(aws4.sign({service: 'cloudfront', path: '/2014-05-31/distribution'}))
+/*
+
+...
+*/
+
+request(aws4.sign({service: 'elasticache', path: '/?Action=DescribeCacheClusters&Version=2014-07-15'}))
+/*
+
+...
+*/
+
+request(aws4.sign({service: 'elasticmapreduce', path: '/?Action=DescribeJobFlows&Version=2009-03-31'}))
+/*
+
+...
+*/
+
+request(aws4.sign({service: 'route53', path: '/2013-04-01/hostedzone'}))
+/*
+
+...
+*/
+
+request(aws4.sign({service: 'appstream', path: '/applications'}))
+/*
+{"_links":{"curie":[{"href":"http://docs.aws.amazon.com/appstream/latest/...
+...
+*/
+
+request(aws4.sign({service: 'cognito-sync', path: '/identitypools'}))
+/*
+{"Count":0,"IdentityPoolUsages":[],"MaxResults":16,"NextToken":null}
+...
+*/
+
+request(aws4.sign({service: 'elastictranscoder', path: '/2012-09-25/pipelines'}))
+/*
+{"NextPageToken":null,"Pipelines":[]}
+...
+*/
+
+request(aws4.sign({service: 'lambda', path: '/2014-11-13/functions/'}))
+/*
+{"Functions":[],"NextMarker":null}
+...
+*/
+
+request(aws4.sign({service: 'ecs', path: '/?Action=ListClusters&Version=2014-11-13'}))
+/*
+
+...
+*/
+
+request(aws4.sign({service: 'glacier', path: '/-/vaults', headers: {'X-Amz-Glacier-Version': '2012-06-01'}}))
+/*
+{"Marker":null,"VaultList":[]}
+...
+*/
+
+request(aws4.sign({service: 'storagegateway', body: '{}', headers: {
+ 'Content-Type': 'application/x-amz-json-1.1',
+ 'X-Amz-Target': 'StorageGateway_20120630.ListGateways'
+}}))
+/*
+{"Gateways":[]}
+...
+*/
+
+request(aws4.sign({service: 'datapipeline', body: '{}', headers: {
+ 'Content-Type': 'application/x-amz-json-1.1',
+ 'X-Amz-Target': 'DataPipeline.ListPipelines'
+}}))
+/*
+{"hasMoreResults":false,"pipelineIdList":[]}
+...
+*/
+
+request(aws4.sign({service: 'opsworks', body: '{}', headers: {
+ 'Content-Type': 'application/x-amz-json-1.1',
+ 'X-Amz-Target': 'OpsWorks_20130218.DescribeStacks'
+}}))
+/*
+{"Stacks":[]}
+...
+*/
+
+request(aws4.sign({service: 'route53domains', body: '{}', headers: {
+ 'Content-Type': 'application/x-amz-json-1.1',
+ 'X-Amz-Target': 'Route53Domains_v20140515.ListDomains'
+}}))
+/*
+{"Domains":[]}
+...
+*/
+
+request(aws4.sign({service: 'kinesis', body: '{}', headers: {
+ 'Content-Type': 'application/x-amz-json-1.1',
+ 'X-Amz-Target': 'Kinesis_20131202.ListStreams'
+}}))
+/*
+{"HasMoreStreams":false,"StreamNames":[]}
+...
+*/
+
+request(aws4.sign({service: 'cloudtrail', body: '{}', headers: {
+ 'Content-Type': 'application/x-amz-json-1.1',
+ 'X-Amz-Target': 'CloudTrail_20131101.DescribeTrails'
+}}))
+/*
+{"trailList":[]}
+...
+*/
+
+request(aws4.sign({service: 'logs', body: '{}', headers: {
+ 'Content-Type': 'application/x-amz-json-1.1',
+ 'X-Amz-Target': 'Logs_20140328.DescribeLogGroups'
+}}))
+/*
+{"logGroups":[]}
+...
+*/
+
+request(aws4.sign({service: 'codedeploy', body: '{}', headers: {
+ 'Content-Type': 'application/x-amz-json-1.1',
+ 'X-Amz-Target': 'CodeDeploy_20141006.ListApplications'
+}}))
+/*
+{"applications":[]}
+...
+*/
+
+request(aws4.sign({service: 'directconnect', body: '{}', headers: {
+ 'Content-Type': 'application/x-amz-json-1.1',
+ 'X-Amz-Target': 'OvertureService.DescribeConnections'
+}}))
+/*
+{"connections":[]}
+...
+*/
+
+request(aws4.sign({service: 'kms', body: '{}', headers: {
+ 'Content-Type': 'application/x-amz-json-1.1',
+ 'X-Amz-Target': 'TrentService.ListKeys'
+}}))
+/*
+{"Keys":[],"Truncated":false}
+...
+*/
+
+request(aws4.sign({service: 'config', body: '{}', headers: {
+ 'Content-Type': 'application/x-amz-json-1.1',
+ 'X-Amz-Target': 'StarlingDoveService.DescribeDeliveryChannels'
+}}))
+/*
+{"DeliveryChannels":[]}
+...
+*/
+
+request(aws4.sign({service: 'cloudhsm', body: '{}', headers: {
+ 'Content-Type': 'application/x-amz-json-1.1',
+ 'X-Amz-Target': 'CloudHsmFrontendService.ListAvailableZones'
+}}))
+/*
+{"AZList":["us-east-1a","us-east-1b","us-east-1c"]}
+...
+*/
+
+request(aws4.sign({
+ service: 'swf',
+ body: '{"registrationStatus":"REGISTERED"}',
+ headers: {
+ 'Content-Type': 'application/x-amz-json-1.0',
+ 'X-Amz-Target': 'SimpleWorkflowService.ListDomains'
+ }
+}))
+/*
+{"domainInfos":[]}
+...
+*/
+
+request(aws4.sign({
+ service: 'cognito-identity',
+ body: '{"MaxResults": 1}',
+ headers: {
+ 'Content-Type': 'application/x-amz-json-1.1',
+ 'X-Amz-Target': 'AWSCognitoIdentityService.ListIdentityPools'
+ }
+}))
+/*
+{"IdentityPools":[]}
+...
+*/
+
+request(aws4.sign({
+ service: 'mobileanalytics',
+ path: '/2014-06-05/events',
+ body: JSON.stringify({events:[{
+ eventType: 'a',
+ timestamp: new Date().toISOString(),
+ session: {},
+ }]}),
+ headers: {
+ 'Content-Type': 'application/json',
+ 'X-Amz-Client-Context': JSON.stringify({
+ client: {client_id: 'a', app_title: 'a'},
+ custom: {},
+ env: {platform: 'a'},
+ services: {},
+ }),
+ }
+}))
+/*
+(HTTP 202, empty response)
+*/
+```
+
+API
+---
+
+### aws4.sign(requestOptions, [credentials])
+
+This calculates and populates the `Authorization` header of
+`requestOptions`, and any other necessary AWS headers and/or request
+options. Returns `requestOptions` as a convenience for chaining.
+
+`requestOptions` is an object holding the same options that the node.js
+[http.request](http://nodejs.org/docs/latest/api/http.html#http_http_request_options_callback)
+function takes.
+
+The following properties of `requestOptions` are used in the signing or
+populated if they don't already exist:
+
+- `hostname` or `host` (will be determined from `service` and `region` if not given)
+- `method` (will use `'GET'` if not given or `'POST'` if there is a `body`)
+- `path` (will use `'/'` if not given)
+- `body` (will use `''` if not given)
+- `service` (will be calculated from `hostname` or `host` if not given)
+- `region` (will be calculated from `hostname` or `host` or use `'us-east-1'` if not given)
+- `headers['Host']` (will use `hostname` or `host` or be calculated if not given)
+- `headers['Content-Type']` (will use `'application/x-www-form-urlencoded; charset=utf-8'`
+ if not given and there is a `body`)
+- `headers['Date']` (used to calculate the signature date if given, otherwise `new Date` is used)
+
+Your AWS credentials (which can be found in your
+[AWS console](https://portal.aws.amazon.com/gp/aws/securityCredentials))
+can be specified in one of two ways:
+
+- As the second argument, like this:
+
+```javascript
+aws4.sign(requestOptions, {
+ secretAccessKey: "",
+ accessKeyId: "",
+ sessionToken: ""
+})
+```
+
+- From `process.env`, such as this:
+
+```
+export AWS_SECRET_ACCESS_KEY=""
+export AWS_ACCESS_KEY_ID=""
+export AWS_SESSION_TOKEN=""
+```
+
+(will also use `AWS_ACCESS_KEY` and `AWS_SECRET_KEY` if available)
+
+The `sessionToken` property and `AWS_SESSION_TOKEN` environment variable are optional for signing
+with [IAM STS temporary credentials](http://docs.aws.amazon.com/STS/latest/UsingSTS/using-temp-creds.html).
+
+Installation
+------------
+
+With [npm](http://npmjs.org/) do:
+
+```
+npm install aws4
+```
+
+Thanks
+------
+
+Thanks to [@jed](https://github.com/jed) for his
+[dynamo-client](https://github.com/jed/dynamo-client) lib where I first
+committed and subsequently extracted this code.
+
+Also thanks to the
+[official node.js AWS SDK](https://github.com/aws/aws-sdk-js) for giving
+me a start on implementing the v4 signature.
diff --git a/deps/npm/node_modules/request/node_modules/aws4/aws4.js b/deps/npm/node_modules/request/node_modules/aws4/aws4.js
new file mode 100644
index 00000000000000..3ef54a468fc904
--- /dev/null
+++ b/deps/npm/node_modules/request/node_modules/aws4/aws4.js
@@ -0,0 +1,313 @@
+var aws4 = exports,
+ url = require('url'),
+ querystring = require('querystring'),
+ crypto = require('crypto'),
+ lru = require('lru-cache'),
+ credentialsCache = lru(1000)
+
+// http://docs.amazonwebservices.com/general/latest/gr/signature-version-4.html
+
+function hmac(key, string, encoding) {
+ return crypto.createHmac('sha256', key).update(string, 'utf8').digest(encoding)
+}
+
+function hash(string, encoding) {
+ return crypto.createHash('sha256').update(string, 'utf8').digest(encoding)
+}
+
+// This function assumes the string has already been percent encoded
+function encodeRfc3986(urlEncodedString) {
+ return urlEncodedString.replace(/[!'()*]/g, function(c) {
+ return '%' + c.charCodeAt(0).toString(16).toUpperCase()
+ })
+}
+
+// request: { path | body, [host], [method], [headers], [service], [region] }
+// credentials: { accessKeyId, secretAccessKey, [sessionToken] }
+function RequestSigner(request, credentials) {
+
+ if (typeof request === 'string') request = url.parse(request)
+
+ var headers = request.headers = (request.headers || {}),
+ hostParts = this.matchHost(request.hostname || request.host || headers.Host || headers.host)
+
+ this.request = request
+ this.credentials = credentials || this.defaultCredentials()
+
+ this.service = request.service || hostParts[0] || ''
+ this.region = request.region || hostParts[1] || 'us-east-1'
+
+ // SES uses a different domain from the service name
+ if (this.service === 'email') this.service = 'ses'
+
+ if (!request.method && request.body)
+ request.method = 'POST'
+
+ if (!headers.Host && !headers.host)
+ headers.Host = request.hostname || request.host || this.createHost()
+ if (!request.hostname && !request.host)
+ request.hostname = headers.Host || headers.host
+}
+
+RequestSigner.prototype.matchHost = function(host) {
+ var match = (host || '').match(/([^\.]+)\.(?:([^\.]*)\.)?amazonaws\.com$/)
+ var hostParts = (match || []).slice(1, 3)
+
+ // ES's hostParts are sometimes the other way round, if the value that is expected
+ // to be region equals ‘es’ switch them back
+ // e.g. search-cluster-name-aaaa00aaaa0aaa0aaaaaaa0aaa.us-east-1.es.amazonaws.com
+ if (hostParts[1] === 'es')
+ hostParts = hostParts.reverse()
+
+ return hostParts
+}
+
+// http://docs.aws.amazon.com/general/latest/gr/rande.html
+RequestSigner.prototype.isSingleRegion = function() {
+ // Special case for S3 and SimpleDB in us-east-1
+ if (['s3', 'sdb'].indexOf(this.service) >= 0 && this.region === 'us-east-1') return true
+
+ return ['cloudfront', 'ls', 'route53', 'iam', 'importexport', 'sts']
+ .indexOf(this.service) >= 0
+}
+
+RequestSigner.prototype.createHost = function() {
+ var region = this.isSingleRegion() ? '' :
+ (this.service === 's3' && this.region !== 'us-east-1' ? '-' : '.') + this.region,
+ service = this.service === 'ses' ? 'email' : this.service
+ return service + region + '.amazonaws.com'
+}
+
+RequestSigner.prototype.prepareRequest = function() {
+ this.parsePath()
+
+ var request = this.request, headers = request.headers, query
+
+ if (request.signQuery) {
+
+ this.parsedPath.query = query = this.parsedPath.query || {}
+
+ if (this.credentials.sessionToken)
+ query['X-Amz-Security-Token'] = this.credentials.sessionToken
+
+ if (this.service === 's3' && !query['X-Amz-Expires'])
+ query['X-Amz-Expires'] = 86400
+
+ if (query['X-Amz-Date'])
+ this.datetime = query['X-Amz-Date']
+ else
+ query['X-Amz-Date'] = this.getDateTime()
+
+ query['X-Amz-Algorithm'] = 'AWS4-HMAC-SHA256'
+ query['X-Amz-Credential'] = this.credentials.accessKeyId + '/' + this.credentialString()
+ query['X-Amz-SignedHeaders'] = this.signedHeaders()
+
+ } else {
+
+ if (!request.doNotModifyHeaders) {
+ if (request.body && !headers['Content-Type'] && !headers['content-type'])
+ headers['Content-Type'] = 'application/x-www-form-urlencoded; charset=utf-8'
+
+ if (request.body && !headers['Content-Length'] && !headers['content-length'])
+ headers['Content-Length'] = Buffer.byteLength(request.body)
+
+ if (this.credentials.sessionToken)
+ headers['X-Amz-Security-Token'] = this.credentials.sessionToken
+
+ if (this.service === 's3')
+ headers['X-Amz-Content-Sha256'] = hash(this.request.body || '', 'hex')
+
+ if (headers['X-Amz-Date'])
+ this.datetime = headers['X-Amz-Date']
+ else
+ headers['X-Amz-Date'] = this.getDateTime()
+ }
+
+ delete headers.Authorization
+ delete headers.authorization
+ }
+}
+
+RequestSigner.prototype.sign = function() {
+ if (!this.parsedPath) this.prepareRequest()
+
+ if (this.request.signQuery) {
+ this.parsedPath.query['X-Amz-Signature'] = this.signature()
+ } else {
+ this.request.headers.Authorization = this.authHeader()
+ }
+
+ this.request.path = this.formatPath()
+
+ return this.request
+}
+
+RequestSigner.prototype.getDateTime = function() {
+ if (!this.datetime) {
+ var headers = this.request.headers,
+ date = new Date(headers.Date || headers.date || new Date)
+
+ this.datetime = date.toISOString().replace(/[:\-]|\.\d{3}/g, '')
+ }
+ return this.datetime
+}
+
+RequestSigner.prototype.getDate = function() {
+ return this.getDateTime().substr(0, 8)
+}
+
+RequestSigner.prototype.authHeader = function() {
+ return [
+ 'AWS4-HMAC-SHA256 Credential=' + this.credentials.accessKeyId + '/' + this.credentialString(),
+ 'SignedHeaders=' + this.signedHeaders(),
+ 'Signature=' + this.signature(),
+ ].join(', ')
+}
+
+RequestSigner.prototype.signature = function() {
+ var date = this.getDate(),
+ cacheKey = [this.credentials.secretAccessKey, date, this.region, this.service].join(),
+ kDate, kRegion, kService, kCredentials = credentialsCache.get(cacheKey)
+ if (!kCredentials) {
+ kDate = hmac('AWS4' + this.credentials.secretAccessKey, date)
+ kRegion = hmac(kDate, this.region)
+ kService = hmac(kRegion, this.service)
+ kCredentials = hmac(kService, 'aws4_request')
+ credentialsCache.set(cacheKey, kCredentials)
+ }
+ return hmac(kCredentials, this.stringToSign(), 'hex')
+}
+
+RequestSigner.prototype.stringToSign = function() {
+ return [
+ 'AWS4-HMAC-SHA256',
+ this.getDateTime(),
+ this.credentialString(),
+ hash(this.canonicalString(), 'hex'),
+ ].join('\n')
+}
+
+RequestSigner.prototype.canonicalString = function() {
+ if (!this.parsedPath) this.prepareRequest()
+
+ var pathStr = this.parsedPath.path,
+ query = this.parsedPath.query,
+ queryStr = '',
+ normalizePath = this.service !== 's3',
+ decodePath = this.service === 's3' || this.request.doNotEncodePath,
+ decodeSlashesInPath = this.service === 's3',
+ firstValOnly = this.service === 's3',
+ bodyHash = this.service === 's3' && this.request.signQuery ?
+ 'UNSIGNED-PAYLOAD' : hash(this.request.body || '', 'hex')
+
+ if (query) {
+ queryStr = encodeRfc3986(querystring.stringify(Object.keys(query).sort().reduce(function(obj, key) {
+ if (!key) return obj
+ obj[key] = !Array.isArray(query[key]) ? query[key] :
+ (firstValOnly ? query[key][0] : query[key].slice().sort())
+ return obj
+ }, {})))
+ }
+ if (pathStr !== '/') {
+ if (normalizePath) pathStr = pathStr.replace(/\/{2,}/g, '/')
+ if (pathStr[0] === '/') pathStr = pathStr.slice(1)
+ pathStr = '/' + pathStr.split('/').reduce(function(path, piece) {
+ if (normalizePath && piece === '..') {
+ path.pop()
+ } else if (!normalizePath || piece !== '.') {
+ if (decodePath) piece = querystring.unescape(piece)
+ path.push(encodeRfc3986(querystring.escape(piece)))
+ }
+ return path
+ }, []).join('/')
+ if (decodeSlashesInPath) pathStr = pathStr.replace(/%2F/g, '/')
+ }
+
+ return [
+ this.request.method || 'GET',
+ pathStr,
+ queryStr,
+ this.canonicalHeaders() + '\n',
+ this.signedHeaders(),
+ bodyHash,
+ ].join('\n')
+}
+
+RequestSigner.prototype.canonicalHeaders = function() {
+ var headers = this.request.headers
+ function trimAll(header) {
+ return header.toString().trim().replace(/\s+/g, ' ')
+ }
+ return Object.keys(headers)
+ .sort(function(a, b) { return a.toLowerCase() < b.toLowerCase() ? -1 : 1 })
+ .map(function(key) { return key.toLowerCase() + ':' + trimAll(headers[key]) })
+ .join('\n')
+}
+
+RequestSigner.prototype.signedHeaders = function() {
+ return Object.keys(this.request.headers)
+ .map(function(key) { return key.toLowerCase() })
+ .sort()
+ .join(';')
+}
+
+RequestSigner.prototype.credentialString = function() {
+ return [
+ this.getDate(),
+ this.region,
+ this.service,
+ 'aws4_request',
+ ].join('/')
+}
+
+RequestSigner.prototype.defaultCredentials = function() {
+ var env = process.env
+ return {
+ accessKeyId: env.AWS_ACCESS_KEY_ID || env.AWS_ACCESS_KEY,
+ secretAccessKey: env.AWS_SECRET_ACCESS_KEY || env.AWS_SECRET_KEY,
+ sessionToken: env.AWS_SESSION_TOKEN,
+ }
+}
+
+RequestSigner.prototype.parsePath = function() {
+ var path = this.request.path || '/',
+ queryIx = path.indexOf('?'),
+ query = null
+
+ if (queryIx >= 0) {
+ query = querystring.parse(path.slice(queryIx + 1))
+ path = path.slice(0, queryIx)
+ }
+
+ // S3 doesn't always encode characters > 127 correctly and
+ // all services don't encode characters > 255 correctly
+ // So if there are non-reserved chars (and it's not already all % encoded), just encode them all
+ if (/[^0-9A-Za-z!'()*\-._~%/]/.test(path)) {
+ path = path.split('/').map(function(piece) {
+ return querystring.escape(querystring.unescape(piece))
+ }).join('/')
+ }
+
+ this.parsedPath = {
+ path: path,
+ query: query,
+ }
+}
+
+RequestSigner.prototype.formatPath = function() {
+ var path = this.parsedPath.path,
+ query = this.parsedPath.query
+
+ if (!query) return path
+
+ // Services don't support empty query string keys
+ if (query[''] != null) delete query['']
+
+ return path + '?' + encodeRfc3986(querystring.stringify(query))
+}
+
+aws4.RequestSigner = RequestSigner
+
+aws4.sign = function(request, credentials) {
+ return new RequestSigner(request, credentials).sign()
+}
diff --git a/deps/npm/node_modules/request/node_modules/aws4/example.js b/deps/npm/node_modules/request/node_modules/aws4/example.js
new file mode 100644
index 00000000000000..5d075409d5de95
--- /dev/null
+++ b/deps/npm/node_modules/request/node_modules/aws4/example.js
@@ -0,0 +1,371 @@
+var http = require('http'),
+ https = require('https'),
+ aws4 = require('aws4')
+
+// given an options object you could pass to http.request
+var opts = {host: 'sqs.us-east-1.amazonaws.com', path: '/?Action=ListQueues'}
+
+// alternatively (as aws4 can infer the host):
+opts = {service: 'sqs', region: 'us-east-1', path: '/?Action=ListQueues'}
+
+// alternatively (as us-east-1 is default):
+opts = {service: 'sqs', path: '/?Action=ListQueues'}
+
+aws4.sign(opts) // assumes AWS credentials are available in process.env
+
+console.log(opts)
+/*
+{
+ host: 'sqs.us-east-1.amazonaws.com',
+ path: '/?Action=ListQueues',
+ headers: {
+ Host: 'sqs.us-east-1.amazonaws.com',
+ 'X-Amz-Date': '20121226T061030Z',
+ Authorization: 'AWS4-HMAC-SHA256 Credential=ABCDEF/20121226/us-east-1/sqs/aws4_request, ...'
+ }
+}
+*/
+
+// we can now use this to query AWS using the standard node.js http API
+http.request(opts, function(res) { res.pipe(process.stdout) }).end()
+/*
+
+
+...
+*/
+
+// you can also pass AWS credentials in explicitly (otherwise taken from process.env)
+aws4.sign(opts, {accessKeyId: '', secretAccessKey: ''})
+
+// can also add the signature to query strings
+aws4.sign({service: 's3', path: '/my-bucket?X-Amz-Expires=12345', signQuery: true})
+
+// create a utility function to pipe to stdout (with https this time)
+function request(o) { https.request(o, function(res) { res.pipe(process.stdout) }).end(o.body || '') }
+
+// aws4 can infer the HTTP method if a body is passed in
+// method will be POST and Content-Type: 'application/x-www-form-urlencoded; charset=utf-8'
+request(aws4.sign({service: 'iam', body: 'Action=ListGroups&Version=2010-05-08'}))
+/*
+
+...
+*/
+
+// can specify any custom option or header as per usual
+request(aws4.sign({
+ service: 'dynamodb',
+ region: 'ap-southeast-2',
+ method: 'POST',
+ path: '/',
+ headers: {
+ 'Content-Type': 'application/x-amz-json-1.0',
+ 'X-Amz-Target': 'DynamoDB_20120810.ListTables'
+ },
+ body: '{}'
+}))
+/*
+{"TableNames":[]}
+...
+*/
+
+// works with all other services that support Signature Version 4
+
+request(aws4.sign({service: 's3', path: '/', signQuery: true}))
+/*
+
+...
+*/
+
+request(aws4.sign({service: 'ec2', path: '/?Action=DescribeRegions&Version=2014-06-15'}))
+/*
+
+...
+*/
+
+request(aws4.sign({service: 'sns', path: '/?Action=ListTopics&Version=2010-03-31'}))
+/*
+
+...
+*/
+
+request(aws4.sign({service: 'sts', path: '/?Action=GetSessionToken&Version=2011-06-15'}))
+/*
+
+...
+*/
+
+request(aws4.sign({service: 'cloudsearch', path: '/?Action=ListDomainNames&Version=2013-01-01'}))
+/*
+
+...
+*/
+
+request(aws4.sign({service: 'ses', path: '/?Action=ListIdentities&Version=2010-12-01'}))
+/*
+
+...
+*/
+
+request(aws4.sign({service: 'autoscaling', path: '/?Action=DescribeAutoScalingInstances&Version=2011-01-01'}))
+/*
+
+...
+*/
+
+request(aws4.sign({service: 'elasticloadbalancing', path: '/?Action=DescribeLoadBalancers&Version=2012-06-01'}))
+/*
+
+...
+*/
+
+request(aws4.sign({service: 'cloudformation', path: '/?Action=ListStacks&Version=2010-05-15'}))
+/*
+
+...
+*/
+
+request(aws4.sign({service: 'elasticbeanstalk', path: '/?Action=ListAvailableSolutionStacks&Version=2010-12-01'}))
+/*
+
+...
+*/
+
+request(aws4.sign({service: 'rds', path: '/?Action=DescribeDBInstances&Version=2012-09-17'}))
+/*
+
+...
+*/
+
+request(aws4.sign({service: 'monitoring', path: '/?Action=ListMetrics&Version=2010-08-01'}))
+/*
+
+...
+*/
+
+request(aws4.sign({service: 'redshift', path: '/?Action=DescribeClusters&Version=2012-12-01'}))
+/*
+
+...
+*/
+
+request(aws4.sign({service: 'cloudfront', path: '/2014-05-31/distribution'}))
+/*
+
+...
+*/
+
+request(aws4.sign({service: 'elasticache', path: '/?Action=DescribeCacheClusters&Version=2014-07-15'}))
+/*
+
+...
+*/
+
+request(aws4.sign({service: 'elasticmapreduce', path: '/?Action=DescribeJobFlows&Version=2009-03-31'}))
+/*
+
+...
+*/
+
+request(aws4.sign({service: 'route53', path: '/2013-04-01/hostedzone'}))
+/*
+
+...
+*/
+
+request(aws4.sign({service: 'appstream', path: '/applications'}))
+/*
+{"_links":{"curie":[{"href":"http://docs.aws.amazon.com/appstream/latest/...
+...
+*/
+
+request(aws4.sign({service: 'cognito-sync', path: '/identitypools'}))
+/*
+{"Count":0,"IdentityPoolUsages":[],"MaxResults":16,"NextToken":null}
+...
+*/
+
+request(aws4.sign({service: 'elastictranscoder', path: '/2012-09-25/pipelines'}))
+/*
+{"NextPageToken":null,"Pipelines":[]}
+...
+*/
+
+request(aws4.sign({service: 'lambda', path: '/2014-11-13/functions/'}))
+/*
+{"Functions":[],"NextMarker":null}
+...
+*/
+
+request(aws4.sign({service: 'ecs', path: '/?Action=ListClusters&Version=2014-11-13'}))
+/*
+
+...
+*/
+
+request(aws4.sign({service: 'glacier', path: '/-/vaults', headers: {'X-Amz-Glacier-Version': '2012-06-01'}}))
+/*
+{"Marker":null,"VaultList":[]}
+...
+*/
+
+request(aws4.sign({service: 'storagegateway', body: '{}', headers: {
+ 'Content-Type': 'application/x-amz-json-1.1',
+ 'X-Amz-Target': 'StorageGateway_20120630.ListGateways'
+}}))
+/*
+{"Gateways":[]}
+...
+*/
+
+request(aws4.sign({service: 'datapipeline', body: '{}', headers: {
+ 'Content-Type': 'application/x-amz-json-1.1',
+ 'X-Amz-Target': 'DataPipeline.ListPipelines'
+}}))
+/*
+{"hasMoreResults":false,"pipelineIdList":[]}
+...
+*/
+
+request(aws4.sign({service: 'opsworks', body: '{}', headers: {
+ 'Content-Type': 'application/x-amz-json-1.1',
+ 'X-Amz-Target': 'OpsWorks_20130218.DescribeStacks'
+}}))
+/*
+{"Stacks":[]}
+...
+*/
+
+request(aws4.sign({service: 'route53domains', body: '{}', headers: {
+ 'Content-Type': 'application/x-amz-json-1.1',
+ 'X-Amz-Target': 'Route53Domains_v20140515.ListDomains'
+}}))
+/*
+{"Domains":[]}
+...
+*/
+
+request(aws4.sign({service: 'kinesis', body: '{}', headers: {
+ 'Content-Type': 'application/x-amz-json-1.1',
+ 'X-Amz-Target': 'Kinesis_20131202.ListStreams'
+}}))
+/*
+{"HasMoreStreams":false,"StreamNames":[]}
+...
+*/
+
+request(aws4.sign({service: 'cloudtrail', body: '{}', headers: {
+ 'Content-Type': 'application/x-amz-json-1.1',
+ 'X-Amz-Target': 'CloudTrail_20131101.DescribeTrails'
+}}))
+/*
+{"trailList":[]}
+...
+*/
+
+request(aws4.sign({service: 'logs', body: '{}', headers: {
+ 'Content-Type': 'application/x-amz-json-1.1',
+ 'X-Amz-Target': 'Logs_20140328.DescribeLogGroups'
+}}))
+/*
+{"logGroups":[]}
+...
+*/
+
+request(aws4.sign({service: 'codedeploy', body: '{}', headers: {
+ 'Content-Type': 'application/x-amz-json-1.1',
+ 'X-Amz-Target': 'CodeDeploy_20141006.ListApplications'
+}}))
+/*
+{"applications":[]}
+...
+*/
+
+request(aws4.sign({service: 'directconnect', body: '{}', headers: {
+ 'Content-Type': 'application/x-amz-json-1.1',
+ 'X-Amz-Target': 'OvertureService.DescribeConnections'
+}}))
+/*
+{"connections":[]}
+...
+*/
+
+request(aws4.sign({service: 'kms', body: '{}', headers: {
+ 'Content-Type': 'application/x-amz-json-1.1',
+ 'X-Amz-Target': 'TrentService.ListKeys'
+}}))
+/*
+{"Keys":[],"Truncated":false}
+...
+*/
+
+request(aws4.sign({service: 'config', body: '{}', headers: {
+ 'Content-Type': 'application/x-amz-json-1.1',
+ 'X-Amz-Target': 'StarlingDoveService.DescribeDeliveryChannels'
+}}))
+/*
+{"DeliveryChannels":[]}
+...
+*/
+
+request(aws4.sign({service: 'cloudhsm', body: '{}', headers: {
+ 'Content-Type': 'application/x-amz-json-1.1',
+ 'X-Amz-Target': 'CloudHsmFrontendService.ListAvailableZones'
+}}))
+/*
+{"AZList":["us-east-1a","us-east-1b","us-east-1c"]}
+...
+*/
+
+request(aws4.sign({
+ service: 'swf',
+ body: '{"registrationStatus":"REGISTERED"}',
+ headers: {
+ 'Content-Type': 'application/x-amz-json-1.0',
+ 'X-Amz-Target': 'SimpleWorkflowService.ListDomains'
+ }
+}))
+/*
+{"domainInfos":[]}
+...
+*/
+
+request(aws4.sign({
+ service: 'cognito-identity',
+ body: '{"MaxResults": 1}',
+ headers: {
+ 'Content-Type': 'application/x-amz-json-1.1',
+ 'X-Amz-Target': 'AWSCognitoIdentityService.ListIdentityPools'
+ }
+}))
+/*
+{"IdentityPools":[]}
+...
+*/
+
+request(aws4.sign({
+ service: 'mobileanalytics',
+ path: '/2014-06-05/events',
+ body: JSON.stringify({events:[{
+ eventType: 'a',
+ timestamp: new Date().toISOString(),
+ session: {},
+ }]}),
+ headers: {
+ 'Content-Type': 'application/json',
+ 'X-Amz-Client-Context': JSON.stringify({
+ client: {client_id: 'a', app_title: 'a'},
+ custom: {},
+ env: {platform: 'a'},
+ services: {},
+ }),
+ }
+}))
+/*
+(HTTP 202, empty response)
+*/
+
+// Still not updated to v4...
+
+//request(aws4.sign({service: 'importexport', path: '/?Action=ListJobs&Version=2010-06-01'}))
+
+//request(aws4.sign({service: 'sdb', path: '/?Action=ListDomains&Version=2009-04-15'}))
diff --git a/deps/npm/node_modules/request/node_modules/aws4/node_modules/lru-cache/.npmignore b/deps/npm/node_modules/request/node_modules/aws4/node_modules/lru-cache/.npmignore
new file mode 100644
index 00000000000000..07e6e472cc75fa
--- /dev/null
+++ b/deps/npm/node_modules/request/node_modules/aws4/node_modules/lru-cache/.npmignore
@@ -0,0 +1 @@
+/node_modules
diff --git a/deps/npm/node_modules/request/node_modules/aws4/node_modules/lru-cache/.travis.yml b/deps/npm/node_modules/request/node_modules/aws4/node_modules/lru-cache/.travis.yml
new file mode 100644
index 00000000000000..4af02b3d17e64c
--- /dev/null
+++ b/deps/npm/node_modules/request/node_modules/aws4/node_modules/lru-cache/.travis.yml
@@ -0,0 +1,8 @@
+language: node_js
+node_js:
+ - '0.8'
+ - '0.10'
+ - '0.12'
+ - 'iojs'
+before_install:
+ - npm install -g npm@latest
diff --git a/deps/npm/node_modules/request/node_modules/aws4/node_modules/lru-cache/CONTRIBUTORS b/deps/npm/node_modules/request/node_modules/aws4/node_modules/lru-cache/CONTRIBUTORS
new file mode 100644
index 00000000000000..4a0bc5033a06e7
--- /dev/null
+++ b/deps/npm/node_modules/request/node_modules/aws4/node_modules/lru-cache/CONTRIBUTORS
@@ -0,0 +1,14 @@
+# Authors, sorted by whether or not they are me
+Isaac Z. Schlueter
+Brian Cottingham
+Carlos Brito Lage
+Jesse Dailey
+Kevin O'Hara
+Marco Rogers
+Mark Cavage
+Marko Mikulicic
+Nathan Rajlich
+Satheesh Natesan
+Trent Mick
+ashleybrener
+n4kz
diff --git a/deps/npm/node_modules/request/node_modules/aws4/node_modules/lru-cache/LICENSE b/deps/npm/node_modules/request/node_modules/aws4/node_modules/lru-cache/LICENSE
new file mode 100644
index 00000000000000..19129e315fe593
--- /dev/null
+++ b/deps/npm/node_modules/request/node_modules/aws4/node_modules/lru-cache/LICENSE
@@ -0,0 +1,15 @@
+The ISC License
+
+Copyright (c) Isaac Z. Schlueter and Contributors
+
+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/deps/npm/node_modules/request/node_modules/aws4/node_modules/lru-cache/README.md b/deps/npm/node_modules/request/node_modules/aws4/node_modules/lru-cache/README.md
new file mode 100644
index 00000000000000..c06814e0414d56
--- /dev/null
+++ b/deps/npm/node_modules/request/node_modules/aws4/node_modules/lru-cache/README.md
@@ -0,0 +1,137 @@
+# 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.
+
+## Keys should always be Strings or Numbers
+
+Note: this module will print warnings to `console.error` if you use a
+key that is not a String or Number. Because items are stored in an
+object, which coerces keys to a string, it won't go well for you if
+you try to use a key that is not a unique string, it'll cause surprise
+collisions. For example:
+
+```JavaScript
+// Bad Example! Dont' do this!
+var cache = LRU()
+var a = {}
+var b = {}
+cache.set(a, 'this is a')
+cache.set(b, 'this is b')
+console.log(cache.get(a)) // prints: 'this is b'
+```
+
+## 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 `max`
+ 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, maxAge)`
+* `get(key) => value`
+
+ Both of these will update the "recently used"-ness of the key.
+ They do what you think. `max` is optional and overrides the
+ cache `max` option if provided.
+
+* `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.
+
+* `length()`
+
+ Return total length of objects in cache taking into account
+ `length` options function.
+
+* `itemCount`
+
+ Return total quantity of objects currently in cache. Note, that
+ `stale` (see options) items are returned as part of this item
+ count.
+
+* `dump()`
+
+ Return an array of the cache entries ready for serialization and usage
+ with 'destinationCache.load(arr)`.
+
+* `load(cacheEntriesArray)`
+
+ Loads another cache entries array, obtained with `sourceCache.dump()`,
+ into the cache. The destination cache is reset before loading new entries
diff --git a/deps/npm/node_modules/request/node_modules/aws4/node_modules/lru-cache/lib/lru-cache.js b/deps/npm/node_modules/request/node_modules/aws4/node_modules/lru-cache/lib/lru-cache.js
new file mode 100644
index 00000000000000..2bbe653be8ad08
--- /dev/null
+++ b/deps/npm/node_modules/request/node_modules/aws4/node_modules/lru-cache/lib/lru-cache.js
@@ -0,0 +1,334 @@
+;(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 }
+
+var didTypeWarning = false
+function typeCheckKey(key) {
+ if (!didTypeWarning && typeof key !== 'string' && typeof key !== 'number') {
+ didTypeWarning = true
+ console.error(new TypeError("LRU: key must be a string or number. Almost certainly a bug! " + typeof key).stack)
+ }
+}
+
+function LRUCache (options) {
+ if (!(this instanceof LRUCache))
+ return new LRUCache(options)
+
+ if (typeof options === 'number')
+ options = { max: options }
+
+ if (!options)
+ options = {}
+
+ this._max = options.max
+ // Kind of weird to have a default max of Infinity, but oh well.
+ if (!this._max || !(typeof this._max === "number") || this._max <= 0 )
+ this._max = Infinity
+
+ this._lengthCalculator = options.length || naiveLength
+ if (typeof this._lengthCalculator !== "function")
+ this._lengthCalculator = naiveLength
+
+ this._allowStale = options.stale || false
+ this._maxAge = options.maxAge || null
+ this._dispose = options.dispose
+ this.reset()
+}
+
+// resize the cache when the max changes.
+Object.defineProperty(LRUCache.prototype, "max",
+ { set : function (mL) {
+ if (!mL || !(typeof mL === "number") || mL <= 0 ) mL = Infinity
+ this._max = mL
+ if (this._length > this._max) trim(this)
+ }
+ , get : function () { return this._max }
+ , enumerable : true
+ })
+
+// resize the cache when the lengthCalculator changes.
+Object.defineProperty(LRUCache.prototype, "lengthCalculator",
+ { set : function (lC) {
+ if (typeof lC !== "function") {
+ this._lengthCalculator = naiveLength
+ this._length = this._itemCount
+ for (var key in this._cache) {
+ this._cache[key].length = 1
+ }
+ } else {
+ this._lengthCalculator = lC
+ this._length = 0
+ for (var key in this._cache) {
+ this._cache[key].length = this._lengthCalculator(this._cache[key].value)
+ this._length += this._cache[key].length
+ }
+ }
+
+ if (this._length > this._max) trim(this)
+ }
+ , get : function () { return this._lengthCalculator }
+ , enumerable : true
+ })
+
+Object.defineProperty(LRUCache.prototype, "length",
+ { get : function () { return this._length }
+ , enumerable : true
+ })
+
+
+Object.defineProperty(LRUCache.prototype, "itemCount",
+ { get : function () { return this._itemCount }
+ , enumerable : true
+ })
+
+LRUCache.prototype.forEach = function (fn, thisp) {
+ thisp = thisp || this
+ var i = 0
+ var itemCount = this._itemCount
+
+ for (var k = this._mru - 1; k >= 0 && i < itemCount; k--) if (this._lruList[k]) {
+ i++
+ var hit = this._lruList[k]
+ if (isStale(this, hit)) {
+ del(this, hit)
+ if (!this._allowStale) hit = undefined
+ }
+ if (hit) {
+ fn.call(thisp, hit.value, hit.key, this)
+ }
+ }
+}
+
+LRUCache.prototype.keys = function () {
+ var keys = new Array(this._itemCount)
+ var i = 0
+ for (var k = this._mru - 1; k >= 0 && i < this._itemCount; k--) if (this._lruList[k]) {
+ var hit = this._lruList[k]
+ keys[i++] = hit.key
+ }
+ return keys
+}
+
+LRUCache.prototype.values = function () {
+ var values = new Array(this._itemCount)
+ var i = 0
+ for (var k = this._mru - 1; k >= 0 && i < this._itemCount; k--) if (this._lruList[k]) {
+ var hit = this._lruList[k]
+ values[i++] = hit.value
+ }
+ return values
+}
+
+LRUCache.prototype.reset = function () {
+ if (this._dispose && this._cache) {
+ for (var k in this._cache) {
+ this._dispose(k, this._cache[k].value)
+ }
+ }
+
+ this._cache = Object.create(null) // hash of items by key
+ this._lruList = Object.create(null) // list of items in order of use recency
+ this._mru = 0 // most recently used
+ this._lru = 0 // least recently used
+ this._length = 0 // number of items in the list
+ this._itemCount = 0
+}
+
+LRUCache.prototype.dump = function () {
+ var arr = []
+ var i = 0
+
+ for (var k = this._mru - 1; k >= 0 && i < this._itemCount; k--) if (this._lruList[k]) {
+ var hit = this._lruList[k]
+ if (!isStale(this, hit)) {
+ //Do not store staled hits
+ ++i
+ arr.push({
+ k: hit.key,
+ v: hit.value,
+ e: hit.now + (hit.maxAge || 0)
+ });
+ }
+ }
+ //arr has the most read first
+ return arr
+}
+
+LRUCache.prototype.dumpLru = function () {
+ return this._lruList
+}
+
+LRUCache.prototype.set = function (key, value, maxAge) {
+ maxAge = maxAge || this._maxAge
+ typeCheckKey(key)
+
+ var now = maxAge ? Date.now() : 0
+ var len = this._lengthCalculator(value)
+
+ if (hOP(this._cache, key)) {
+ if (len > this._max) {
+ del(this, this._cache[key])
+ return false
+ }
+ // dispose of the old one before overwriting
+ if (this._dispose)
+ this._dispose(key, this._cache[key].value)
+
+ this._cache[key].now = now
+ this._cache[key].maxAge = maxAge
+ this._cache[key].value = value
+ this._length += (len - this._cache[key].length)
+ this._cache[key].length = len
+ this.get(key)
+
+ if (this._length > this._max)
+ trim(this)
+
+ return true
+ }
+
+ var hit = new Entry(key, value, this._mru++, len, now, maxAge)
+
+ // oversized objects fall out of cache automatically.
+ if (hit.length > this._max) {
+ if (this._dispose) this._dispose(key, value)
+ return false
+ }
+
+ this._length += hit.length
+ this._lruList[hit.lu] = this._cache[key] = hit
+ this._itemCount ++
+
+ if (this._length > this._max)
+ trim(this)
+
+ return true
+}
+
+LRUCache.prototype.has = function (key) {
+ typeCheckKey(key)
+ if (!hOP(this._cache, key)) return false
+ var hit = this._cache[key]
+ if (isStale(this, hit)) {
+ return false
+ }
+ return true
+}
+
+LRUCache.prototype.get = function (key) {
+ typeCheckKey(key)
+ return get(this, key, true)
+}
+
+LRUCache.prototype.peek = function (key) {
+ typeCheckKey(key)
+ return get(this, key, false)
+}
+
+LRUCache.prototype.pop = function () {
+ var hit = this._lruList[this._lru]
+ del(this, hit)
+ return hit || null
+}
+
+LRUCache.prototype.del = function (key) {
+ typeCheckKey(key)
+ del(this, this._cache[key])
+}
+
+LRUCache.prototype.load = function (arr) {
+ //reset the cache
+ this.reset();
+
+ var now = Date.now()
+ //A previous serialized cache has the most recent items first
+ for (var l = arr.length - 1; l >= 0; l-- ) {
+ var hit = arr[l]
+ typeCheckKey(hit.k)
+ var expiresAt = hit.e || 0
+ if (expiresAt === 0) {
+ //the item was created without expiration in a non aged cache
+ this.set(hit.k, hit.v)
+ } else {
+ var maxAge = expiresAt - now
+ //dont add already expired items
+ if (maxAge > 0) this.set(hit.k, hit.v, maxAge)
+ }
+ }
+}
+
+function get (self, key, doUse) {
+ typeCheckKey(key)
+ var hit = self._cache[key]
+ if (hit) {
+ if (isStale(self, hit)) {
+ del(self, hit)
+ if (!self._allowStale) hit = undefined
+ } else {
+ if (doUse) use(self, hit)
+ }
+ if (hit) hit = hit.value
+ }
+ return hit
+}
+
+function isStale(self, hit) {
+ if (!hit || (!hit.maxAge && !self._maxAge)) return false
+ var stale = false;
+ var diff = Date.now() - hit.now
+ if (hit.maxAge) {
+ stale = diff > hit.maxAge
+ } else {
+ stale = self._maxAge && (diff > self._maxAge)
+ }
+ return stale;
+}
+
+function use (self, hit) {
+ shiftLU(self, hit)
+ hit.lu = self._mru ++
+ self._lruList[hit.lu] = hit
+}
+
+function trim (self) {
+ while (self._lru < self._mru && self._length > self._max)
+ del(self, self._lruList[self._lru])
+}
+
+function shiftLU (self, hit) {
+ delete self._lruList[ hit.lu ]
+ while (self._lru < self._mru && !self._lruList[self._lru]) self._lru ++
+}
+
+function del (self, hit) {
+ if (hit) {
+ if (self._dispose) self._dispose(hit.key, hit.value)
+ self._length -= hit.length
+ self._itemCount --
+ delete self._cache[ hit.key ]
+ shiftLU(self, hit)
+ }
+}
+
+// classy, since V8 prefers predictable objects.
+function Entry (key, value, lu, length, now, maxAge) {
+ this.key = key
+ this.value = value
+ this.lu = lu
+ this.length = length
+ this.now = now
+ if (maxAge) this.maxAge = maxAge
+}
+
+})()
diff --git a/deps/npm/node_modules/request/node_modules/aws4/node_modules/lru-cache/package.json b/deps/npm/node_modules/request/node_modules/aws4/node_modules/lru-cache/package.json
new file mode 100644
index 00000000000000..576b8dd894b5b2
--- /dev/null
+++ b/deps/npm/node_modules/request/node_modules/aws4/node_modules/lru-cache/package.json
@@ -0,0 +1,58 @@
+{
+ "name": "lru-cache",
+ "description": "A cache object that deletes the least-recently-used items.",
+ "version": "2.7.3",
+ "author": {
+ "name": "Isaac Z. Schlueter",
+ "email": "i@izs.me"
+ },
+ "keywords": [
+ "mru",
+ "lru",
+ "cache"
+ ],
+ "scripts": {
+ "test": "tap test --gc"
+ },
+ "main": "lib/lru-cache.js",
+ "repository": {
+ "type": "git",
+ "url": "git://github.com/isaacs/node-lru-cache.git"
+ },
+ "devDependencies": {
+ "tap": "^1.2.0",
+ "weak": ""
+ },
+ "license": "ISC",
+ "gitHead": "292048199f6d28b77fbe584279a1898e25e4c714",
+ "bugs": {
+ "url": "https://github.com/isaacs/node-lru-cache/issues"
+ },
+ "homepage": "https://github.com/isaacs/node-lru-cache#readme",
+ "_id": "lru-cache@2.7.3",
+ "_shasum": "6d4524e8b955f95d4f5b58851ce21dd72fb4e952",
+ "_from": "lru-cache@>=2.6.5 <3.0.0",
+ "_npmVersion": "3.3.2",
+ "_nodeVersion": "4.0.0",
+ "_npmUser": {
+ "name": "isaacs",
+ "email": "i@izs.me"
+ },
+ "dist": {
+ "shasum": "6d4524e8b955f95d4f5b58851ce21dd72fb4e952",
+ "tarball": "http://registry.npmjs.org/lru-cache/-/lru-cache-2.7.3.tgz"
+ },
+ "maintainers": [
+ {
+ "name": "isaacs",
+ "email": "isaacs@npmjs.com"
+ },
+ {
+ "name": "othiym23",
+ "email": "ogd@aoaioxxysz.net"
+ }
+ ],
+ "directories": {},
+ "_resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-2.7.3.tgz",
+ "readme": "ERROR: No README data found!"
+}
diff --git a/deps/npm/node_modules/request/node_modules/aws4/node_modules/lru-cache/test/basic.js b/deps/npm/node_modules/request/node_modules/aws4/node_modules/lru-cache/test/basic.js
new file mode 100644
index 00000000000000..b47225f109891f
--- /dev/null
+++ b/deps/npm/node_modules/request/node_modules/aws4/node_modules/lru-cache/test/basic.js
@@ -0,0 +1,396 @@
+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()
+})
+
+
+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("lru recently updated 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")
+ t.equal(cache.length, 6) //CCC BB A
+ cache.set("a", "+A")
+ t.equal(cache.length, 7) //+A CCC BB
+ cache.set("b", "++BB")
+ t.equal(cache.length, 6) //++BB +A
+ t.equal(cache.get("c"), undefined)
+
+ cache.set("c", "oversized")
+ t.equal(cache.length, 6) //++BB +A
+ t.equal(cache.get("c"), undefined)
+
+ cache.set("a", "oversized")
+ t.equal(cache.length, 4) //++BB
+ t.equal(cache.get("a"), undefined)
+ t.equal(cache.get("b"), "++BB")
+ 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 + 25)
+
+ 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("individual item can have it's own maxAge", function(t) {
+ var cache = new LRU({
+ max: 5,
+ maxAge: 50
+ })
+
+ cache.set("a", "A", 20)
+ setTimeout(function () {
+ t.notOk(cache.get("a"))
+ t.end()
+ }, 25)
+})
+
+test("individual item can have it's own maxAge > cache's", function(t) {
+ var cache = new LRU({
+ max: 5,
+ maxAge: 20
+ })
+
+ cache.set("a", "A", 50)
+ setTimeout(function () {
+ t.equal(cache.get("a"), "A")
+ t.end()
+ }, 25)
+})
+
+test("disposal function", function(t) {
+ var disposed = false
+ var cache = new LRU({
+ max: 1,
+ dispose: function (k, n) {
+ disposed = n
+ }
+ })
+
+ cache.set(1, 1)
+ cache.set(2, 2)
+ t.equal(disposed, 1)
+ cache.set(3, 3)
+ t.equal(disposed, 2)
+ cache.reset()
+ t.equal(disposed, 3)
+ t.end()
+})
+
+test("disposal function on too big of item", function(t) {
+ var disposed = false
+ var cache = new LRU({
+ max: 1,
+ length: function (k) {
+ return k.length
+ },
+ dispose: function (k, n) {
+ disposed = n
+ }
+ })
+ var obj = [ 1, 2 ]
+
+ t.equal(disposed, false)
+ cache.set("obj", obj)
+ t.equal(disposed, obj)
+ t.end()
+})
+
+test("has()", function(t) {
+ var cache = new LRU({
+ max: 1,
+ maxAge: 10
+ })
+
+ cache.set('foo', 'bar')
+ t.equal(cache.has('foo'), true)
+ cache.set('blu', 'baz')
+ t.equal(cache.has('foo'), false)
+ t.equal(cache.has('blu'), true)
+ setTimeout(function() {
+ t.equal(cache.has('blu'), false)
+ t.end()
+ }, 15)
+})
+
+test("stale", function(t) {
+ var cache = new LRU({
+ maxAge: 10,
+ stale: true
+ })
+
+ cache.set('foo', 'bar')
+ t.equal(cache.get('foo'), 'bar')
+ t.equal(cache.has('foo'), true)
+ setTimeout(function() {
+ t.equal(cache.has('foo'), false)
+ t.equal(cache.get('foo'), 'bar')
+ t.equal(cache.get('foo'), undefined)
+ t.end()
+ }, 15)
+})
+
+test("lru update via set", function(t) {
+ var cache = LRU({ max: 2 });
+
+ cache.set('foo', 1);
+ cache.set('bar', 2);
+ cache.del('bar');
+ cache.set('baz', 3);
+ cache.set('qux', 4);
+
+ t.equal(cache.get('foo'), undefined)
+ t.equal(cache.get('bar'), undefined)
+ t.equal(cache.get('baz'), 3)
+ t.equal(cache.get('qux'), 4)
+ t.end()
+})
+
+test("least recently set w/ peek", function (t) {
+ var cache = new LRU(2)
+ cache.set("a", "A")
+ cache.set("b", "B")
+ t.equal(cache.peek("a"), "A")
+ cache.set("c", "C")
+ t.equal(cache.get("c"), "C")
+ t.equal(cache.get("b"), "B")
+ t.equal(cache.get("a"), undefined)
+ t.end()
+})
+
+test("pop the least used item", function (t) {
+ var cache = new LRU(3)
+ , last
+
+ cache.set("a", "A")
+ cache.set("b", "B")
+ cache.set("c", "C")
+
+ t.equal(cache.length, 3)
+ t.equal(cache.max, 3)
+
+ // Ensure we pop a, c, b
+ cache.get("b", "B")
+
+ last = cache.pop()
+ t.equal(last.key, "a")
+ t.equal(last.value, "A")
+ t.equal(cache.length, 2)
+ t.equal(cache.max, 3)
+
+ last = cache.pop()
+ t.equal(last.key, "c")
+ t.equal(last.value, "C")
+ t.equal(cache.length, 1)
+ t.equal(cache.max, 3)
+
+ last = cache.pop()
+ t.equal(last.key, "b")
+ t.equal(last.value, "B")
+ t.equal(cache.length, 0)
+ t.equal(cache.max, 3)
+
+ last = cache.pop()
+ t.equal(last, null)
+ t.equal(cache.length, 0)
+ t.equal(cache.max, 3)
+
+ t.end()
+})
diff --git a/deps/npm/node_modules/request/node_modules/aws4/node_modules/lru-cache/test/foreach.js b/deps/npm/node_modules/request/node_modules/aws4/node_modules/lru-cache/test/foreach.js
new file mode 100644
index 00000000000000..4190417cbc61d8
--- /dev/null
+++ b/deps/npm/node_modules/request/node_modules/aws4/node_modules/lru-cache/test/foreach.js
@@ -0,0 +1,120 @@
+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.equal(i, order.length);
+
+ 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()
+})
+
+test('all entries are iterated over', function(t) {
+ var l = new LRU(5)
+ for (var i = 0; i < 10; i ++) {
+ l.set(i.toString(), i.toString(2))
+ }
+
+ var i = 0
+ l.forEach(function (val, key, cache) {
+ if (i > 0) {
+ cache.del(key)
+ }
+ i += 1
+ })
+
+ t.equal(i, 5)
+ t.equal(l.keys().length, 1)
+
+ t.end()
+})
+
+test('all stale entries are removed', function(t) {
+ var l = new LRU({ max: 5, maxAge: -5, stale: true })
+ for (var i = 0; i < 10; i ++) {
+ l.set(i.toString(), i.toString(2))
+ }
+
+ var i = 0
+ l.forEach(function () {
+ i += 1
+ })
+
+ t.equal(i, 5)
+ t.equal(l.keys().length, 0)
+
+ t.end()
+})
+
+test('expires', function (t) {
+ var l = new LRU({
+ max: 10,
+ maxAge: 50
+ })
+ for (var i = 0; i < 10; i++) {
+ l.set(i.toString(), i.toString(2), ((i % 2) ? 25 : undefined))
+ }
+
+ var i = 0
+ var order = [ 8, 6, 4, 2, 0 ]
+ setTimeout(function () {
+ 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.equal(i, order.length);
+
+ setTimeout(function () {
+ var count = 0;
+ l.forEach(function (val, key, cache) { count++; })
+ t.equal(0, count);
+ t.end()
+ }, 25)
+
+ }, 26)
+})
diff --git a/deps/npm/node_modules/request/node_modules/aws4/node_modules/lru-cache/test/memory-leak.js b/deps/npm/node_modules/request/node_modules/aws4/node_modules/lru-cache/test/memory-leak.js
new file mode 100644
index 00000000000000..b5912f6f168e5e
--- /dev/null
+++ b/deps/npm/node_modules/request/node_modules/aws4/node_modules/lru-cache/test/memory-leak.js
@@ -0,0 +1,51 @@
+#!/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/deps/npm/node_modules/request/node_modules/aws4/node_modules/lru-cache/test/serialize.js b/deps/npm/node_modules/request/node_modules/aws4/node_modules/lru-cache/test/serialize.js
new file mode 100644
index 00000000000000..5fe5dc3d371f1e
--- /dev/null
+++ b/deps/npm/node_modules/request/node_modules/aws4/node_modules/lru-cache/test/serialize.js
@@ -0,0 +1,215 @@
+var test = require('tap').test
+var LRU = require('../')
+
+test('dump', function (t) {
+ var cache = new LRU()
+
+ t.equal(cache.dump().length, 0, "nothing in dump for empty cache")
+
+ cache.set("a", "A")
+ cache.set("b", "B")
+ t.deepEqual(cache.dump(), [
+ { k: "b", v: "B", e: 0 },
+ { k: "a", v: "A", e: 0 }
+ ])
+
+ cache.set("a", "A");
+ t.deepEqual(cache.dump(), [
+ { k: "a", v: "A", e: 0 },
+ { k: "b", v: "B", e: 0 }
+ ])
+
+ cache.get("b");
+ t.deepEqual(cache.dump(), [
+ { k: "b", v: "B", e: 0 },
+ { k: "a", v: "A", e: 0 }
+ ])
+
+ cache.del("a");
+ t.deepEqual(cache.dump(), [
+ { k: "b", v: "B", e: 0 }
+ ])
+
+ t.end()
+})
+
+test("do not dump stale items", function(t) {
+ var cache = new LRU({
+ max: 5,
+ maxAge: 50
+ })
+
+ //expires at 50
+ cache.set("a", "A")
+
+ setTimeout(function () {
+ //expires at 75
+ cache.set("b", "B")
+ var s = cache.dump()
+ t.equal(s.length, 2)
+ t.equal(s[0].k, "b")
+ t.equal(s[1].k, "a")
+ }, 25)
+
+ setTimeout(function () {
+ //expires at 110
+ cache.set("c", "C")
+ var s = cache.dump()
+ t.equal(s.length, 2)
+ t.equal(s[0].k, "c")
+ t.equal(s[1].k, "b")
+ }, 60)
+
+ setTimeout(function () {
+ //expires at 130
+ cache.set("d", "D", 40)
+ var s = cache.dump()
+ t.equal(s.length, 2)
+ t.equal(s[0].k, "d")
+ t.equal(s[1].k, "c")
+ }, 90)
+
+ setTimeout(function () {
+ var s = cache.dump()
+ t.equal(s.length, 1)
+ t.equal(s[0].k, "d")
+ }, 120)
+
+ setTimeout(function () {
+ var s = cache.dump()
+ t.deepEqual(s, [])
+ t.end()
+ }, 155)
+})
+
+test("load basic cache", function(t) {
+ var cache = new LRU(),
+ copy = new LRU()
+
+ cache.set("a", "A")
+ cache.set("b", "B")
+
+ copy.load(cache.dump())
+ t.deepEquals(cache.dump(), copy.dump())
+
+ t.end()
+})
+
+
+test("load staled cache", function(t) {
+ var cache = new LRU({maxAge: 50}),
+ copy = new LRU({maxAge: 50}),
+ arr
+
+ //expires at 50
+ cache.set("a", "A")
+ setTimeout(function () {
+ //expires at 80
+ cache.set("b", "B")
+ arr = cache.dump()
+ t.equal(arr.length, 2)
+ }, 30)
+
+ setTimeout(function () {
+ copy.load(arr)
+ t.equal(copy.get("a"), undefined)
+ t.equal(copy.get("b"), "B")
+ }, 60)
+
+ setTimeout(function () {
+ t.equal(copy.get("b"), undefined)
+ t.end()
+ }, 90)
+})
+
+test("load to other size cache", function(t) {
+ var cache = new LRU({max: 2}),
+ copy = new LRU({max: 1})
+
+ cache.set("a", "A")
+ cache.set("b", "B")
+
+ copy.load(cache.dump())
+ t.equal(copy.get("a"), undefined)
+ t.equal(copy.get("b"), "B")
+
+ //update the last read from original cache
+ cache.get("a")
+ copy.load(cache.dump())
+ t.equal(copy.get("a"), "A")
+ t.equal(copy.get("b"), undefined)
+
+ t.end()
+})
+
+
+test("load to other age cache", function(t) {
+ var cache = new LRU({maxAge: 50}),
+ aged = new LRU({maxAge: 100}),
+ simple = new LRU(),
+ arr,
+ expired
+
+ //created at 0
+ //a would be valid till 0 + 50
+ cache.set("a", "A")
+ setTimeout(function () {
+ //created at 20
+ //b would be valid till 20 + 50
+ cache.set("b", "B")
+ //b would be valid till 20 + 70
+ cache.set("c", "C", 70)
+ arr = cache.dump()
+ t.equal(arr.length, 3)
+ }, 20)
+
+ setTimeout(function () {
+ t.equal(cache.get("a"), undefined)
+ t.equal(cache.get("b"), "B")
+ t.equal(cache.get("c"), "C")
+
+ aged.load(arr)
+ t.equal(aged.get("a"), undefined)
+ t.equal(aged.get("b"), "B")
+ t.equal(aged.get("c"), "C")
+
+ simple.load(arr)
+ t.equal(simple.get("a"), undefined)
+ t.equal(simple.get("b"), "B")
+ t.equal(simple.get("c"), "C")
+ }, 60)
+
+ setTimeout(function () {
+ t.equal(cache.get("a"), undefined)
+ t.equal(cache.get("b"), undefined)
+ t.equal(cache.get("c"), "C")
+
+ aged.load(arr)
+ t.equal(aged.get("a"), undefined)
+ t.equal(aged.get("b"), undefined)
+ t.equal(aged.get("c"), "C")
+
+ simple.load(arr)
+ t.equal(simple.get("a"), undefined)
+ t.equal(simple.get("b"), undefined)
+ t.equal(simple.get("c"), "C")
+ }, 80)
+
+ setTimeout(function () {
+ t.equal(cache.get("a"), undefined)
+ t.equal(cache.get("b"), undefined)
+ t.equal(cache.get("c"), undefined)
+
+ aged.load(arr)
+ t.equal(aged.get("a"), undefined)
+ t.equal(aged.get("b"), undefined)
+ t.equal(aged.get("c"), undefined)
+
+ simple.load(arr)
+ t.equal(simple.get("a"), undefined)
+ t.equal(simple.get("b"), undefined)
+ t.equal(simple.get("c"), undefined)
+ t.end()
+ }, 100)
+
+})
diff --git a/deps/npm/node_modules/request/node_modules/aws4/package.json b/deps/npm/node_modules/request/node_modules/aws4/package.json
new file mode 100644
index 00000000000000..38f9c00ca57ed2
--- /dev/null
+++ b/deps/npm/node_modules/request/node_modules/aws4/package.json
@@ -0,0 +1,104 @@
+{
+ "name": "aws4",
+ "version": "1.2.1",
+ "description": "Signs and prepares requests using AWS Signature Version 4",
+ "author": {
+ "name": "Michael Hart",
+ "email": "michael.hart.au@gmail.com",
+ "url": "http://github.com/mhart"
+ },
+ "main": "aws4.js",
+ "keywords": [
+ "amazon",
+ "aws",
+ "signature",
+ "s3",
+ "ec2",
+ "autoscaling",
+ "cloudformation",
+ "elasticloadbalancing",
+ "elb",
+ "elasticbeanstalk",
+ "cloudsearch",
+ "dynamodb",
+ "kinesis",
+ "lambda",
+ "glacier",
+ "sqs",
+ "sns",
+ "iam",
+ "sts",
+ "ses",
+ "swf",
+ "storagegateway",
+ "datapipeline",
+ "directconnect",
+ "redshift",
+ "opsworks",
+ "rds",
+ "monitoring",
+ "cloudtrail",
+ "cloudfront",
+ "codedeploy",
+ "elasticache",
+ "elasticmapreduce",
+ "elastictranscoder",
+ "emr",
+ "cloudwatch",
+ "mobileanalytics",
+ "cognitoidentity",
+ "cognitosync",
+ "cognito",
+ "containerservice",
+ "ecs",
+ "appstream",
+ "keymanagementservice",
+ "kms",
+ "config",
+ "cloudhsm",
+ "route53",
+ "route53domains",
+ "logs"
+ ],
+ "repository": {
+ "type": "git",
+ "url": "git+https://github.com/mhart/aws4.git"
+ },
+ "license": "MIT",
+ "dependencies": {
+ "lru-cache": "^2.6.5"
+ },
+ "devDependencies": {
+ "mocha": "^2.2.5",
+ "should": "^7.0.1"
+ },
+ "scripts": {
+ "test": "mocha ./test/fast.js ./test/slow.js -b -t 100s -R list"
+ },
+ "gitHead": "3d8a3a06a8415bd5255b4f60eb91576952e97f5c",
+ "bugs": {
+ "url": "https://github.com/mhart/aws4/issues"
+ },
+ "homepage": "https://github.com/mhart/aws4#readme",
+ "_id": "aws4@1.2.1",
+ "_shasum": "52b5659a4d32583d405f65e1124ac436d07fe5ac",
+ "_from": "aws4@>=1.2.1 <2.0.0",
+ "_npmVersion": "2.14.15",
+ "_nodeVersion": "4.2.4",
+ "_npmUser": {
+ "name": "hichaelmart",
+ "email": "michael.hart.au@gmail.com"
+ },
+ "maintainers": [
+ {
+ "name": "hichaelmart",
+ "email": "michael.hart.au@gmail.com"
+ }
+ ],
+ "dist": {
+ "shasum": "52b5659a4d32583d405f65e1124ac436d07fe5ac",
+ "tarball": "http://registry.npmjs.org/aws4/-/aws4-1.2.1.tgz"
+ },
+ "directories": {},
+ "_resolved": "https://registry.npmjs.org/aws4/-/aws4-1.2.1.tgz"
+}
diff --git a/deps/npm/node_modules/request/node_modules/bl/.travis.yml b/deps/npm/node_modules/request/node_modules/bl/.travis.yml
index 81c0814189c7b9..5cb0480b45457a 100644
--- a/deps/npm/node_modules/request/node_modules/bl/.travis.yml
+++ b/deps/npm/node_modules/request/node_modules/bl/.travis.yml
@@ -1,14 +1,13 @@
+sudo: false
language: node_js
-before_install:
- - curl --location http://git.io/1OcIZA | bash -s
node_js:
- - 0.8
- - 0.10
- - 0.11
+ - '0.10'
+ - '0.12'
+ - '4'
+ - '5'
branches:
only:
- master
notifications:
email:
- rod@vagg.org
-script: npm test
diff --git a/deps/npm/node_modules/request/node_modules/bl/bl.js b/deps/npm/node_modules/request/node_modules/bl/bl.js
index 7a2f99788e628e..b979ba82e434d2 100644
--- a/deps/npm/node_modules/request/node_modules/bl/bl.js
+++ b/deps/npm/node_modules/request/node_modules/bl/bl.js
@@ -52,6 +52,11 @@ BufferList.prototype.append = function (buf) {
var isBuffer = Buffer.isBuffer(buf) ||
buf instanceof BufferList
+ // coerce number arguments to strings, since Buffer(number) does
+ // uninitialized memory allocation
+ if (typeof buf == 'number')
+ buf = buf.toString()
+
this._bufs.push(isBuffer ? buf : new Buffer(buf))
this.length += buf.length
return this
diff --git a/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/.travis.yml b/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/.travis.yml
index f7968279b51e1d..cfe1c9439388b6 100644
--- a/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/.travis.yml
+++ b/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/.travis.yml
@@ -15,23 +15,33 @@ matrix:
env: TASK=test
- node_js: '0.12'
env: TASK=test
- - node_js: 'iojs'
+ - node_js: 1
env: TASK=test
- - node_js: 'iojs'
+ - node_js: 2
+ env: TASK=test
+ - node_js: 3
+ env: TASK=test
+ - node_js: 4
+ env: TASK=test
+ - node_js: 5
+ env: TASK=test
+ - node_js: node
+ env: TASK=test
+ - node_js: node
env: TASK=browser BROWSER_NAME=opera BROWSER_VERSION="11..latest"
- - node_js: 'iojs'
+ - node_js: node
env: TASK=browser BROWSER_NAME=ie BROWSER_VERSION="9..latest"
- - node_js: 'iojs'
+ - node_js: node
env: TASK=browser BROWSER_NAME=chrome BROWSER_VERSION="41..beta"
- - node_js: 'iojs'
+ - node_js: node
env: TASK=browser BROWSER_NAME=firefox BROWSER_VERSION="36..latest"
- - node_js: 'iojs'
+ - node_js: node
env: TASK=browser BROWSER_NAME=ipad BROWSER_VERSION="['6.1', '7.1', '8.2']"
- - node_js: 'iojs'
+ - node_js: node
env: TASK=browser BROWSER_NAME=iphone BROWSER_VERSION="['6.1', '7.1', '8.2']"
- - node_js: 'iojs'
+ - node_js: node
env: TASK=browser BROWSER_NAME=safari BROWSER_VERSION="5..latest"
- - node_js: 'iojs'
+ - node_js: node
env: TASK=browser BROWSER_NAME=android BROWSER_VERSION="4.0..latest"
script: "npm run $TASK"
env:
diff --git a/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/doc/stream.markdown b/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/doc/stream.markdown
index 4df9c088d13109..3988c0cbd0d9c9 100644
--- a/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/doc/stream.markdown
+++ b/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/doc/stream.markdown
@@ -3,8 +3,7 @@
Stability: 2 - Stable
A stream is an abstract interface implemented by various objects in
-Node.js. For example a [request to an HTTP
-server](https://iojs.org/dist/v4.1.2/doc/api/http.html#http_http_incomingmessage) is a stream, as is
+Node.js. 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][]
@@ -93,6 +92,17 @@ server.listen(1337);
// error: Unexpected token o
```
+### Class: stream.Duplex
+
+Duplex streams are streams that implement both the [Readable][] and
+[Writable][] interfaces. See above for usage.
+
+Examples of Duplex streams include:
+
+* [tcp sockets][]
+* [zlib streams][]
+* [crypto streams][]
+
### Class: stream.Readable
@@ -136,61 +146,22 @@ destinations drain and ask for more data.
Examples of readable streams include:
-* [http responses, on the client](https://iojs.org/dist/v4.1.2/doc/api/http.html#http_http_incomingmessage)
-* [http requests, on the server](https://iojs.org/dist/v4.1.2/doc/api/http.html#http_http_incomingmessage)
-* [fs read streams](https://iojs.org/dist/v4.1.2/doc/api/fs.html#fs_class_fs_readstream)
+* [http responses, on the client][]
+* [http requests, on the server][]
+* [fs read streams][]
* [zlib streams][]
* [crypto streams][]
* [tcp sockets][]
* [child process stdout and stderr][]
* [process.stdin][]
-#### Event: 'readable'
-
-When a chunk of data can be read from the stream, it will emit a
-`'readable'` event.
-
-In some cases, listening for a `'readable'` event will cause some data
-to be read into the internal buffer from the underlying system, if it
-hadn't already.
-
-```javascript
-var readable = getReadableStreamSomehow();
-readable.on('readable', function() {
- // there is some data to read now
-});
-```
-
-Once the internal buffer is drained, a `readable` event will fire
-again when more data is available.
-
-The `readable` event is not emitted in the "flowing" mode with the
-sole exception of the last one, on end-of-stream.
-
-The 'readable' event indicates that the stream has new information:
-either new data is available or the end of the stream has been reached.
-In the former case, `.read()` will return that data. In the latter case,
-`.read()` will return null. For instance, in the following example, `foo.txt`
-is an empty file:
-
-```javascript
-var fs = require('fs');
-var rr = fs.createReadStream('foo.txt');
-rr.on('readable', function() {
- console.log('readable:', rr.read());
-});
-rr.on('end', function() {
- console.log('end');
-});
-```
+#### Event: 'close'
-The output of running this script is:
+Emitted when the stream and any of its underlying resources (a file
+descriptor, for example) have been closed. The event indicates that
+no more events will be emitted, and no further computation will occur.
-```
-bash-3.2$ node test.js
-readable: null
-end
-```
+Not all streams will emit the 'close' event.
#### Event: 'data'
@@ -228,101 +199,75 @@ readable.on('end', function() {
});
```
-#### Event: 'close'
-
-Emitted when the stream and any of its underlying resources (a file
-descriptor, for example) have been closed. The event indicates that
-no more events will be emitted, and no further computation will occur.
-
-Not all streams will emit the 'close' event.
-
#### Event: 'error'
* {Error Object}
Emitted if there was an error receiving data.
-#### readable.read([size])
-
-* `size` {Number} Optional argument to specify how much data to read.
-* Return {String | Buffer | null}
-
-The `read()` method pulls some data out of the internal buffer and
-returns it. If there is no data available, then it will return
-`null`.
-
-If you pass in a `size` argument, then it will return that many
-bytes. If `size` bytes are not available, then it will return `null`,
-unless we've ended, in which case it will return the data remaining
-in the buffer.
+#### Event: 'readable'
-If you do not specify a `size` argument, then it will return all the
-data in the internal buffer.
+When a chunk of data can be read from the stream, it will emit a
+`'readable'` event.
-This method should only be called in paused mode. In flowing mode,
-this method is called automatically until the internal buffer is
-drained.
+In some cases, listening for a `'readable'` event will cause some data
+to be read into the internal buffer from the underlying system, if it
+hadn't already.
```javascript
var readable = getReadableStreamSomehow();
readable.on('readable', function() {
- var chunk;
- while (null !== (chunk = readable.read())) {
- console.log('got %d bytes of data', chunk.length);
- }
+ // there is some data to read now
});
```
-If this method returns a data chunk, then it will also trigger the
-emission of a [`'data'` event][].
-
-Note that calling `readable.read([size])` after the `end` event has been
-triggered will return `null`. No runtime error will be raised.
-
-#### readable.setEncoding(encoding)
-
-* `encoding` {String} The encoding to use.
-* Return: `this`
+Once the internal buffer is drained, a `readable` event will fire
+again when more data is available.
-Call this function to cause the stream to return strings of the
-specified encoding instead of Buffer objects. For example, if you do
-`readable.setEncoding('utf8')`, then the output data will be
-interpreted as UTF-8 data, and returned as strings. If you do
-`readable.setEncoding('hex')`, then the data will be encoded in
-hexadecimal string format.
+The `readable` event is not emitted in the "flowing" mode with the
+sole exception of the last one, on end-of-stream.
-This properly handles multi-byte characters that would otherwise be
-potentially mangled if you simply pulled the Buffers directly and
-called `buf.toString(encoding)` on them. If you want to read the data
-as strings, always use this method.
+The 'readable' event indicates that the stream has new information:
+either new data is available or the end of the stream has been reached.
+In the former case, `.read()` will return that data. In the latter case,
+`.read()` will return null. For instance, in the following example, `foo.txt`
+is an empty file:
```javascript
-var readable = getReadableStreamSomehow();
-readable.setEncoding('utf8');
-readable.on('data', function(chunk) {
- assert.equal(typeof chunk, 'string');
- console.log('got %d characters of string data', chunk.length);
+var fs = require('fs');
+var rr = fs.createReadStream('foo.txt');
+rr.on('readable', function() {
+ console.log('readable:', rr.read());
+});
+rr.on('end', function() {
+ console.log('end');
});
```
-#### readable.resume()
+The output of running this script is:
-* Return: `this`
+```
+bash-3.2$ node test.js
+readable: null
+end
+```
-This method will cause the readable stream to resume emitting `data`
-events.
+#### readable.isPaused()
-This method will switch the stream into flowing mode. If you do *not*
-want to consume the data from a stream, but you *do* want to get to
-its `end` event, you can call [`readable.resume()`][] to open the flow of
-data.
+* Return: `Boolean`
+
+This method returns whether or not the `readable` has been **explicitly**
+paused by client code (using `readable.pause()` without a corresponding
+`readable.resume()`).
```javascript
-var readable = getReadableStreamSomehow();
-readable.resume();
-readable.on('end', function() {
- console.log('got to the end, but did not read anything');
-});
+var readable = new stream.Readable
+
+readable.isPaused() // === false
+readable.pause()
+readable.isPaused() // === true
+readable.resume()
+readable.isPaused() // === false
```
#### readable.pause()
@@ -346,24 +291,6 @@ readable.on('data', function(chunk) {
});
```
-#### readable.isPaused()
-
-* Return: `Boolean`
-
-This method returns whether or not the `readable` has been **explicitly**
-paused by client code (using `readable.pause()` without a corresponding
-`readable.resume()`).
-
-```javascript
-var readable = new stream.Readable
-
-readable.isPaused() // === false
-readable.pause()
-readable.isPaused() // === true
-readable.resume()
-readable.isPaused() // === false
-```
-
#### readable.pipe(destination[, options])
* `destination` {[Writable][] Stream} The destination for writing data
@@ -416,54 +343,137 @@ reader.on('end', function() {
Note that `process.stderr` and `process.stdout` are never closed until
the process exits, regardless of the specified options.
-#### readable.unpipe([destination])
+#### readable.read([size])
-* `destination` {[Writable][] Stream} Optional specific stream to unpipe
+* `size` {Number} Optional argument to specify how much data to read.
+* Return {String | Buffer | null}
-This method will remove the hooks set up for a previous `pipe()` call.
+The `read()` method pulls some data out of the internal buffer and
+returns it. If there is no data available, then it will return
+`null`.
-If the destination is not specified, then all pipes are removed.
+If you pass in a `size` argument, then it will return that many
+bytes. If `size` bytes are not available, then it will return `null`,
+unless we've ended, in which case it will return the data remaining
+in the buffer.
-If the destination is specified, but no pipe is set up for it, then
-this is a no-op.
+If you do not specify a `size` argument, then it will return all the
+data in the internal buffer.
+
+This method should only be called in paused mode. In flowing mode,
+this method is called automatically until the internal buffer is
+drained.
```javascript
var readable = getReadableStreamSomehow();
-var writable = fs.createWriteStream('file.txt');
-// All the data from readable goes into 'file.txt',
-// but only for the first second
-readable.pipe(writable);
-setTimeout(function() {
- console.log('stop writing to file.txt');
- readable.unpipe(writable);
- console.log('manually close the file stream');
- writable.end();
-}, 1000);
+readable.on('readable', function() {
+ var chunk;
+ while (null !== (chunk = readable.read())) {
+ console.log('got %d bytes of data', chunk.length);
+ }
+});
```
-#### readable.unshift(chunk)
+If this method returns a data chunk, then it will also trigger the
+emission of a [`'data'` event][].
-* `chunk` {Buffer | String} Chunk of data to unshift onto the read queue
+Note that calling `readable.read([size])` after the `end` event has been
+triggered will return `null`. No runtime error will be raised.
-This is useful in certain 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, so that the stream can be
-passed on to some other party.
+#### readable.resume()
-Note that `stream.unshift(chunk)` cannot be called after the `end` event
-has been triggered; a runtime error will be raised.
+* Return: `this`
-If you find that you must often call `stream.unshift(chunk)` in your
-programs, consider implementing a [Transform][] stream instead. (See API
-for Stream Implementors, below.)
+This method will cause the readable stream to resume emitting `data`
+events.
+
+This method will switch the stream into flowing mode. If you do *not*
+want to consume the data from a stream, but you *do* want to get to
+its `end` event, you can call [`readable.resume()`][] to open the flow of
+data.
```javascript
-// Pull off a header delimited by \n\n
-// use unshift() if we get too much
-// Call the callback with (error, header, stream)
-var StringDecoder = require('string_decoder').StringDecoder;
-function parseHeader(stream, callback) {
- stream.on('error', callback);
+var readable = getReadableStreamSomehow();
+readable.resume();
+readable.on('end', function() {
+ console.log('got to the end, but did not read anything');
+});
+```
+
+#### readable.setEncoding(encoding)
+
+* `encoding` {String} The encoding to use.
+* Return: `this`
+
+Call this function to cause the stream to return strings of the
+specified encoding instead of Buffer objects. For example, if you do
+`readable.setEncoding('utf8')`, then the output data will be
+interpreted as UTF-8 data, and returned as strings. If you do
+`readable.setEncoding('hex')`, then the data will be encoded in
+hexadecimal string format.
+
+This properly handles multi-byte characters that would otherwise be
+potentially mangled if you simply pulled the Buffers directly and
+called `buf.toString(encoding)` on them. If you want to read the data
+as strings, always use this method.
+
+```javascript
+var readable = getReadableStreamSomehow();
+readable.setEncoding('utf8');
+readable.on('data', function(chunk) {
+ assert.equal(typeof chunk, 'string');
+ console.log('got %d characters of string data', chunk.length);
+});
+```
+
+#### readable.unpipe([destination])
+
+* `destination` {[Writable][] Stream} Optional specific stream to unpipe
+
+This method will remove the hooks set up for a previous `pipe()` call.
+
+If the destination is not specified, then all pipes are removed.
+
+If the destination is specified, but no pipe is set up for it, then
+this is a no-op.
+
+```javascript
+var readable = getReadableStreamSomehow();
+var writable = fs.createWriteStream('file.txt');
+// All the data from readable goes into 'file.txt',
+// but only for the first second
+readable.pipe(writable);
+setTimeout(function() {
+ console.log('stop writing to file.txt');
+ readable.unpipe(writable);
+ console.log('manually close the file stream');
+ writable.end();
+}, 1000);
+```
+
+#### readable.unshift(chunk)
+
+* `chunk` {Buffer | String} Chunk of data to unshift onto the read queue
+
+This is useful in certain 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, so that the stream can be
+passed on to some other party.
+
+Note that `stream.unshift(chunk)` cannot be called after the `end` event
+has been triggered; a runtime error will be raised.
+
+If you find that you must often call `stream.unshift(chunk)` in your
+programs, consider implementing a [Transform][] stream instead. (See API
+for Stream Implementors, below.)
+
+```javascript
+// Pull off a header delimited by \n\n
+// use unshift() if we get too much
+// Call the callback with (error, header, stream)
+var StringDecoder = require('string_decoder').StringDecoder;
+function parseHeader(stream, callback) {
+ stream.on('error', callback);
stream.on('readable', onReadable);
var decoder = new StringDecoder('utf8');
var header = '';
@@ -528,6 +538,16 @@ myReader.on('readable', function() {
});
```
+### Class: stream.Transform
+
+Transform streams are [Duplex][] streams where the output is in some way
+computed from the input. They implement both the [Readable][] and
+[Writable][] interfaces. See above for usage.
+
+Examples of Transform streams include:
+
+* [zlib streams][]
+* [crypto streams][]
### Class: stream.Writable
@@ -538,34 +558,15 @@ that you are writing data *to*.
Examples of writable streams include:
-* [http requests, on the client](https://iojs.org/dist/v4.1.2/doc/api/http.html#http_class_http_clientrequest)
-* [http responses, on the server](https://iojs.org/dist/v4.1.2/doc/api/http.html#http_class_http_serverresponse)
-* [fs write streams](https://iojs.org/dist/v4.1.2/doc/api/fs.html#fs_class_fs_writestream)
+* [http requests, on the client][]
+* [http responses, on the server][]
+* [fs write streams][]
* [zlib streams][]
* [crypto streams][]
* [tcp sockets][]
-* [child process stdin](https://iojs.org/dist/v4.1.2/doc/api/child_process.html#child_process_child_stdin)
+* [child process stdin][]
* [process.stdout][], [process.stderr][]
-#### writable.write(chunk[, encoding][, callback])
-
-* `chunk` {String | Buffer} The data to write
-* `encoding` {String} The encoding, if `chunk` is a String
-* `callback` {Function} Callback for when this chunk of data is flushed
-* Returns: {Boolean} True if the data was handled completely.
-
-This method writes some data to the underlying system, and calls the
-supplied callback once the data has been fully handled.
-
-The return value indicates if you should continue writing right now.
-If the data had to be buffered internally, then it will return
-`false`. Otherwise, it will return `true`.
-
-This return value is strictly advisory. You MAY continue to write,
-even if it returns `false`. However, writes will be buffered in
-memory, so it is best not to do this excessively. Instead, wait for
-the `drain` event before writing more data.
-
#### Event: 'drain'
If a [`writable.write(chunk)`][] call returns false, then the `drain`
@@ -600,40 +601,11 @@ function writeOneMillionTimes(writer, data, encoding, callback) {
}
```
-#### writable.cork()
-
-Forces buffering of all writes.
-
-Buffered data will be flushed either at `.uncork()` or at `.end()` call.
-
-#### writable.uncork()
-
-Flush all data, buffered since `.cork()` call.
-
-#### writable.setDefaultEncoding(encoding)
-
-* `encoding` {String} The new default encoding
-
-Sets the default encoding for a writable stream.
-
-#### writable.end([chunk][, encoding][, callback])
-
-* `chunk` {String | Buffer} Optional data to write
-* `encoding` {String} The encoding, if `chunk` is a String
-* `callback` {Function} Optional callback for when the stream is finished
-
-Call this method when no more data will be written to the stream. If
-supplied, the callback is attached as a listener on the `finish` event.
+#### Event: 'error'
-Calling [`write()`][] after calling [`end()`][] will raise an error.
+* {Error object}
-```javascript
-// write 'hello, ' and then end with 'world!'
-var file = fs.createWriteStream('example.txt');
-file.write('hello, ');
-file.end('world!');
-// writing more now is not allowed!
-```
+Emitted if there was an error when writing or piping data.
#### Event: 'finish'
@@ -686,34 +658,59 @@ reader.pipe(writer);
reader.unpipe(writer);
```
-#### Event: 'error'
+#### writable.cork()
-* {Error object}
+Forces buffering of all writes.
-Emitted if there was an error when writing or piping data.
+Buffered data will be flushed either at `.uncork()` or at `.end()` call.
-### Class: stream.Duplex
+#### writable.end([chunk][, encoding][, callback])
-Duplex streams are streams that implement both the [Readable][] and
-[Writable][] interfaces. See above for usage.
+* `chunk` {String | Buffer} Optional data to write
+* `encoding` {String} The encoding, if `chunk` is a String
+* `callback` {Function} Optional callback for when the stream is finished
-Examples of Duplex streams include:
+Call this method when no more data will be written to the stream. If
+supplied, the callback is attached as a listener on the `finish` event.
-* [tcp sockets][]
-* [zlib streams][]
-* [crypto streams][]
+Calling [`write()`][] after calling [`end()`][] will raise an error.
+```javascript
+// write 'hello, ' and then end with 'world!'
+var file = fs.createWriteStream('example.txt');
+file.write('hello, ');
+file.end('world!');
+// writing more now is not allowed!
+```
-### Class: stream.Transform
+#### writable.setDefaultEncoding(encoding)
-Transform streams are [Duplex][] streams where the output is in some way
-computed from the input. They implement both the [Readable][] and
-[Writable][] interfaces. See above for usage.
+* `encoding` {String} The new default encoding
-Examples of Transform streams include:
+Sets the default encoding for a writable stream.
-* [zlib streams][]
-* [crypto streams][]
+#### writable.uncork()
+
+Flush all data, buffered since `.cork()` call.
+
+#### writable.write(chunk[, encoding][, callback])
+
+* `chunk` {String | Buffer} The data to write
+* `encoding` {String} The encoding, if `chunk` is a String
+* `callback` {Function} Callback for when this chunk of data is flushed
+* Returns: {Boolean} True if the data was handled completely.
+
+This method writes some data to the underlying system, and calls the
+supplied callback once the data has been fully handled.
+
+The return value indicates if you should continue writing right now.
+If the data had to be buffered internally, then it will return
+`false`. Otherwise, it will return `true`.
+
+This return value is strictly advisory. You MAY continue to write,
+even if it returns `false`. However, writes will be buffered in
+memory, so it is best not to do this excessively. Instead, wait for
+the `drain` event before writing more data.
## API for Stream Implementors
@@ -796,6 +793,49 @@ methods described in [API for Stream Consumers][] above. Otherwise, you
can potentially cause adverse side effects in programs that consume
your streaming interfaces.
+### 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, callback)`][] 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.
+ * `readableObjectMode` {Boolean} Default=false. Sets `objectMode`
+ for readable side of the stream. Has no effect if `objectMode`
+ is `true`.
+ * `writableObjectMode` {Boolean} Default=false. Sets `objectMode`
+ for writable side of the stream. Has no effect if `objectMode`
+ is `true`.
+
+In classes that extend the Duplex class, make sure to call the
+constructor so that the buffering settings can be properly
+initialized.
+
+### 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 as a building block for novel sorts of streams.
+
### Class: stream.Readable
@@ -807,15 +847,115 @@ Please see above under [API for Stream Consumers][] for how to consume
streams in your programs. What follows is an explanation of how to
implement Readable streams in your programs.
-#### Example: A Counting Stream
-
-
-
-This is a basic example of a Readable stream. It emits the numerals
-from 1 to 1,000,000 in ascending order, and then ends.
+#### new stream.Readable([options])
-```javascript
-var Readable = require('stream').Readable;
+* `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, or 16 for `objectMode` streams
+ * `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. Default=false
+
+In classes that extend the Readable class, make sure to call the
+Readable constructor so that the buffering settings can be properly
+initialized.
+
+#### readable.\_read(size)
+
+* `size` {Number} Number of bytes to read asynchronously
+
+Note: **Implement this method, but do NOT call it directly.**
+
+This method is prefixed with an underscore because it is internal to the
+class that defines it and should only be called by the internal Readable
+class methods. All Readable stream implementations must provide a _read
+method to fetch data from the underlying resource.
+
+When _read is called, if data is available from the resource, `_read` should
+start pushing that data into the read queue by calling `this.push(dataChunk)`.
+`_read` should continue reading from the resource and pushing data until push
+returns false, at which point it should stop reading from the resource. Only
+when _read is called again after it has stopped should it start reading
+more data from the resource and pushing that data onto the queue.
+
+Note: once the `_read()` method is called, it will not be called again until
+the `push` method is called.
+
+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[, encoding])
+
+* `chunk` {Buffer | null | String} Chunk of data to push into the read queue
+* `encoding` {String} Encoding of String chunks. Must be a valid
+ Buffer encoding, such as `'utf8'` or `'ascii'`
+* return {Boolean} Whether or not more pushes should be performed
+
+Note: **This method should be called by Readable implementors, NOT
+by consumers of Readable streams.**
+
+If a value other than null is passed, The `push()` method adds a chunk of data
+into the queue for subsequent stream processors to consume. If `null` is
+passed, it signals the end of the stream (EOF), after which no more data
+can be written.
+
+The data added with `push` can be pulled out by calling the `read()` method
+when the `'readable'`event fires.
+
+This API is designed to be as flexible as possible. For example,
+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.
+
+util.inherits(SourceWrapper, Readable);
+
+function SourceWrapper(options) {
+ Readable.call(this, options);
+
+ this._source = getLowlevelSourceObject();
+ var self = this;
+
+ // Every time there's data, we push it into the internal buffer.
+ this._source.ondata = function(chunk) {
+ // if push() returns false, then we need to stop reading from source
+ if (!self.push(chunk))
+ self._source.readStop();
+ };
+
+ // When the source ends, we push the EOF-signaling `null` chunk
+ this._source.onend = function() {
+ self.push(null);
+ };
+}
+
+// _read will be called when the stream wants to pull more data in
+// the advisory size argument is ignored in this case.
+SourceWrapper.prototype._read = function(size) {
+ this._source.readStart();
+};
+```
+
+#### Example: A Counting Stream
+
+
+
+This is a basic example of a Readable stream. It emits the numerals
+from 1 to 1,000,000 in ascending order, and then ends.
+
+```javascript
+var Readable = require('stream').Readable;
var util = require('util');
util.inherits(Counter, Readable);
@@ -951,220 +1091,6 @@ SimpleProtocol.prototype._read = function(n) {
// with the parsed header data.
```
-
-#### 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, or 16 for `objectMode` streams
- * `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. Default=false
-
-In classes that extend the Readable class, make sure to call the
-Readable constructor so that the buffering settings can be properly
-initialized.
-
-#### readable.\_read(size)
-
-* `size` {Number} Number of bytes to read asynchronously
-
-Note: **Implement this method, but do NOT call it directly.**
-
-This method is prefixed with an underscore because it is internal to the
-class that defines it and should only be called by the internal Readable
-class methods. All Readable stream implementations must provide a _read
-method to fetch data from the underlying resource.
-
-When _read is called, if data is available from the resource, `_read` should
-start pushing that data into the read queue by calling `this.push(dataChunk)`.
-`_read` should continue reading from the resource and pushing data until push
-returns false, at which point it should stop reading from the resource. Only
-when _read is called again after it has stopped should it start reading
-more data from the resource and pushing that data onto the queue.
-
-Note: once the `_read()` method is called, it will not be called again until
-the `push` method is called.
-
-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[, encoding])
-
-* `chunk` {Buffer | null | String} Chunk of data to push into the read queue
-* `encoding` {String} Encoding of String chunks. Must be a valid
- Buffer encoding, such as `'utf8'` or `'ascii'`
-* return {Boolean} Whether or not more pushes should be performed
-
-Note: **This method should be called by Readable implementors, NOT
-by consumers of Readable streams.**
-
-If a value other than null is passed, The `push()` method adds a chunk of data
-into the queue for subsequent stream processors to consume. If `null` is
-passed, it signals the end of the stream (EOF), after which no more data
-can be written.
-
-The data added with `push` can be pulled out by calling the `read()` method
-when the `'readable'`event fires.
-
-This API is designed to be as flexible as possible. For example,
-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.
-
-util.inherits(SourceWrapper, Readable);
-
-function SourceWrapper(options) {
- Readable.call(this, options);
-
- this._source = getLowlevelSourceObject();
- var self = this;
-
- // Every time there's data, we push it into the internal buffer.
- this._source.ondata = function(chunk) {
- // if push() returns false, then we need to stop reading from source
- if (!self.push(chunk))
- self._source.readStop();
- };
-
- // When the source ends, we push the EOF-signaling `null` chunk
- this._source.onend = function() {
- self.push(null);
- };
-}
-
-// _read will be called when the stream wants to pull more data in
-// the advisory size argument is ignored in this case.
-SourceWrapper.prototype._read = function(size) {
- this._source.readStart();
-};
-```
-
-
-### Class: stream.Writable
-
-
-
-`stream.Writable` is an abstract class designed to be extended with an
-underlying implementation of the [`_write(chunk, encoding, callback)`][] method.
-
-Please see above under [API for Stream Consumers][] for how to consume
-writable streams in your programs. What follows is an explanation of
-how to implement Writable streams in your programs.
-
-#### new stream.Writable([options])
-
-* `options` {Object}
- * `highWaterMark` {Number} Buffer level when [`write()`][] starts
- returning false. Default=16kb, or 16 for `objectMode` streams
- * `decodeStrings` {Boolean} Whether or not to decode strings into
- Buffers before passing them to [`_write()`][]. Default=true
- * `objectMode` {Boolean} Whether or not the `write(anyObj)` is
- a valid operation. If set you can write arbitrary data instead
- of only `Buffer` / `String` data. Default=false
-
-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. If chunk is a buffer, then this is the special
- value - 'buffer', ignore it in this case.
-* `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.\_writev(chunks, callback)
-
-* `chunks` {Array} The chunks to be written. Each chunk has following
- format: `{ chunk: ..., encoding: ... }`.
-* `callback` {Function} Call this function (optionally with an error
- argument) when you are done processing the supplied chunks.
-
-Note: **This function MUST NOT be called directly.** It may be
-implemented by child classes, and called by the internal Writable
-class methods only.
-
-This function is completely optional to implement. In most cases it is
-unnecessary. If implemented, it will be called with all the chunks
-that are buffered in the write queue.
-
-
-### 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, callback)`][] 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.
- * `readableObjectMode` {Boolean} Default=false. Sets `objectMode`
- for readable side of the stream. Has no effect if `objectMode`
- is `true`.
- * `writableObjectMode` {Boolean} Default=false. Sets `objectMode`
- for writable side of the stream. Has no effect if `objectMode`
- is `true`.
-
-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
@@ -1183,12 +1109,47 @@ also implement the `_flush()` method. (See below.)
#### new stream.Transform([options])
-* `options` {Object} Passed to both Writable and Readable
- constructors.
+* `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.
+
+#### Events: 'finish' and 'end'
+
+The [`finish`][] and [`end`][] events are from the parent Writable
+and Readable classes respectively. The `finish` event is fired after
+`.end()` is called and all chunks have been processed by `_transform`,
+`end` is fired after all data has been output which is after the callback
+in `_flush` has been called.
+
+#### 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.
-In classes that extend the Transform class, make sure to call the
-constructor so that the buffering settings can be properly
-initialized.
+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.\_transform(chunk, encoding, callback)
@@ -1238,41 +1199,6 @@ 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.
-
-#### Events: 'finish' and 'end'
-
-The [`finish`][] and [`end`][] events are from the parent Writable
-and Readable classes respectively. The `finish` event is fired after
-`.end()` is called and all chunks have been processed by `_transform`,
-`end` is fired after all data has been output which is after the callback
-in `_flush` has been called.
-
#### Example: `SimpleProtocol` parser v2
The example above of a simple protocol parser can be implemented
@@ -1351,13 +1277,79 @@ SimpleProtocol.prototype._transform = function(chunk, encoding, done) {
// with the parsed header data.
```
+### Class: stream.Writable
-### 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 as a building block for novel sorts of streams.
+`stream.Writable` is an abstract class designed to be extended with an
+underlying implementation of the [`_write(chunk, encoding, callback)`][] method.
+
+Please see above under [API for Stream Consumers][] for how to consume
+writable streams in your programs. What follows is an explanation of
+how to implement Writable streams in your programs.
+
+#### new stream.Writable([options])
+
+* `options` {Object}
+ * `highWaterMark` {Number} Buffer level when [`write()`][] starts
+ returning false. Default=16kb, or 16 for `objectMode` streams
+ * `decodeStrings` {Boolean} Whether or not to decode strings into
+ Buffers before passing them to [`_write()`][]. Default=true
+ * `objectMode` {Boolean} Whether or not the `write(anyObj)` is
+ a valid operation. If set you can write arbitrary data instead
+ of only `Buffer` / `String` data. Default=false
+
+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. If chunk is a buffer, then this is the special
+ value - 'buffer', ignore it in this case.
+* `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.\_writev(chunks, callback)
+
+* `chunks` {Array} The chunks to be written. Each chunk has following
+ format: `{ chunk: ..., encoding: ... }`.
+* `callback` {Function} Call this function (optionally with an error
+ argument) when you are done processing the supplied chunks.
+
+Note: **This function MUST NOT be called directly.** It may be
+implemented by child classes, and called by the internal Writable
+class methods only.
+
+This function is completely optional to implement. In most cases it is
+unnecessary. If implemented, it will be called with all the chunks
+that are buffered in the write queue.
## Simplified Constructor API
@@ -1370,51 +1362,52 @@ This can be done by passing the appropriate methods as constructor options:
Examples:
-### Readable
+### Duplex
```javascript
-var readable = new stream.Readable({
+var duplex = new stream.Duplex({
read: function(n) {
// sets this._read under the hood
- }
-});
-```
-### Writable
-```javascript
-var writable = new stream.Writable({
+ // push data onto the read queue, passing null
+ // will signal the end of the stream (EOF)
+ this.push(chunk);
+ },
write: function(chunk, encoding, next) {
// sets this._write under the hood
+
+ // An optional error can be passed as the first argument
+ next()
}
});
// or
-var writable = new stream.Writable({
+var duplex = new stream.Duplex({
+ read: function(n) {
+ // sets this._read under the hood
+
+ // push data onto the read queue, passing null
+ // will signal the end of the stream (EOF)
+ this.push(chunk);
+ },
writev: function(chunks, next) {
// sets this._writev under the hood
+
+ // An optional error can be passed as the first argument
+ next()
}
});
```
-### Duplex
+### Readable
```javascript
-var duplex = new stream.Duplex({
+var readable = new stream.Readable({
read: function(n) {
// sets this._read under the hood
- },
- write: function(chunk, encoding, next) {
- // sets this._write under the hood
- }
-});
-
-// or
-var duplex = new stream.Duplex({
- read: function(n) {
- // sets this._read under the hood
- },
- writev: function(chunks, next) {
- // sets this._writev under the hood
+ // push data onto the read queue, passing null
+ // will signal the end of the stream (EOF)
+ this.push(chunk);
}
});
```
@@ -1424,9 +1417,43 @@ var duplex = new stream.Duplex({
var transform = new stream.Transform({
transform: function(chunk, encoding, next) {
// sets this._transform under the hood
+
+ // generate output as many times as needed
+ // this.push(chunk);
+
+ // call when the current chunk is consumed
+ next();
},
flush: function(done) {
// sets this._flush under the hood
+
+ // generate output as many times as needed
+ // this.push(chunk);
+
+ done();
+ }
+});
+```
+
+### Writable
+```javascript
+var writable = new stream.Writable({
+ write: function(chunk, encoding, next) {
+ // sets this._write under the hood
+
+ // An optional error can be passed as the first argument
+ next()
+ }
+});
+
+// or
+
+var writable = new stream.Writable({
+ writev: function(chunks, next) {
+ // sets this._writev under the hood
+
+ // An optional error can be passed as the first argument
+ next()
}
});
```
@@ -1458,40 +1485,6 @@ The purpose of streams, especially with the `pipe()` method, is to
limit the buffering of data to acceptable levels, so that sources and
destinations of varying speed will not overwhelm the available memory.
-### `stream.read(0)`
-
-There are some cases where you want to trigger a refresh of the
-underlying readable stream mechanisms, without actually consuming any
-data. In that case, you can call `stream.read(0)`, which will always
-return null.
-
-If the internal read buffer is below the `highWaterMark`, and the
-stream is not currently reading, then calling `read(0)` will trigger
-a low-level `_read` call.
-
-There is almost never a need to do this. However, you will see some
-cases in Node.js's internals where this is done, particularly in the
-Readable stream class internals.
-
-### `stream.push('')`
-
-Pushing a zero-byte string or Buffer (when not in [Object mode][]) has an
-interesting side effect. Because it *is* a call to
-[`stream.push()`][], it will end the `reading` process. However, it
-does *not* add any data to the readable buffer, so there's nothing for
-a user to consume.
-
-Very rarely, there are cases where you have no data to provide now,
-but the consumer of your stream (or, perhaps, another bit of your own
-code) will know when to check again, by calling `stream.read(0)`. In
-those cases, you *may* call `stream.push('')`.
-
-So far, the only use case for this functionality is in the
-[tls.CryptoStream][] class, which is deprecated in Node.js/io.js v1.0. If you
-find that you have to use `stream.push('')`, please consider another
-approach, because it almost certainly indicates that something is
-horribly wrong.
-
### Compatibility with Older Node.js Versions
@@ -1649,25 +1642,66 @@ JSONParseStream.prototype._flush = function(cb) {
};
```
+### `stream.read(0)`
+
+There are some cases where you want to trigger a refresh of the
+underlying readable stream mechanisms, without actually consuming any
+data. In that case, you can call `stream.read(0)`, which will always
+return null.
+
+If the internal read buffer is below the `highWaterMark`, and the
+stream is not currently reading, then calling `read(0)` will trigger
+a low-level `_read` call.
+
+There is almost never a need to do this. However, you will see some
+cases in Node.js's internals where this is done, particularly in the
+Readable stream class internals.
+
+### `stream.push('')`
+
+Pushing a zero-byte string or Buffer (when not in [Object mode][]) has an
+interesting side effect. Because it *is* a call to
+[`stream.push()`][], it will end the `reading` process. However, it
+does *not* add any data to the readable buffer, so there's nothing for
+a user to consume.
+
+Very rarely, there are cases where you have no data to provide now,
+but the consumer of your stream (or, perhaps, another bit of your own
+code) will know when to check again, by calling `stream.read(0)`. In
+those cases, you *may* call `stream.push('')`.
+
+So far, the only use case for this functionality is in the
+[tls.CryptoStream][] class, which is deprecated in Node.js/io.js v1.0. If you
+find that you have to use `stream.push('')`, please consider another
+approach, because it almost certainly indicates that something is
+horribly wrong.
-[EventEmitter]: https://iojs.org/dist/v4.1.2/doc/api/events.html#events_class_events_eventemitter
+[request to an HTTP server]: https://nodejs.org/docs/v5.1.0/api/http.html#http_http_incomingmessage
+[EventEmitter]: https://nodejs.org/docs/v5.1.0/api/events.html#events_class_events_eventemitter
[Object mode]: #stream_object_mode
[`stream.push(chunk)`]: #stream_readable_push_chunk_encoding
[`stream.push(null)`]: #stream_readable_push_chunk_encoding
[`stream.push()`]: #stream_readable_push_chunk_encoding
[`unpipe()`]: #stream_readable_unpipe_destination
[unpiped]: #stream_readable_unpipe_destination
-[tcp sockets]: https://iojs.org/dist/v4.1.2/doc/api/net.html#net_class_net_socket
+[tcp sockets]: https://nodejs.org/docs/v5.1.0/api/net.html#net_class_net_socket
+[http responses, on the client]: https://nodejs.org/docs/v5.1.0/api/http.html#http_http_incomingmessage
+[http requests, on the server]: https://nodejs.org/docs/v5.1.0/api/http.html#http_http_incomingmessage
+[http requests, on the client]: https://nodejs.org/docs/v5.1.0/api/http.html#http_class_http_clientrequest
+[http responses, on the server]: https://nodejs.org/docs/v5.1.0/api/http.html#http_class_http_serverresponse
+[fs read streams]: https://nodejs.org/docs/v5.1.0/api/fs.html#fs_class_fs_readstream
+[fs write streams]: https://nodejs.org/docs/v5.1.0/api/fs.html#fs_class_fs_writestream
[zlib streams]: zlib.html
[zlib]: zlib.html
[crypto streams]: crypto.html
[crypto]: crypto.html
-[tls.CryptoStream]: https://iojs.org/dist/v4.1.2/doc/api/tls.html#tls_class_cryptostream
-[process.stdin]: https://iojs.org/dist/v4.1.2/doc/api/process.html#process_process_stdin
-[stdout]: https://iojs.org/dist/v4.1.2/doc/api/process.html#process_process_stdout
-[process.stdout]: https://iojs.org/dist/v4.1.2/doc/api/process.html#process_process_stdout
-[process.stderr]: https://iojs.org/dist/v4.1.2/doc/api/process.html#process_process_stderr
-[child process stdout and stderr]: https://iojs.org/dist/v4.1.2/doc/api/child_process.html#child_process_child_stdout
+[tls.CryptoStream]: https://nodejs.org/docs/v5.1.0/api/tls.html#tls_class_cryptostream
+[process.stdin]: https://nodejs.org/docs/v5.1.0/api/process.html#process_process_stdin
+[stdout]: https://nodejs.org/docs/v5.1.0/api/process.html#process_process_stdout
+[process.stdout]: https://nodejs.org/docs/v5.1.0/api/process.html#process_process_stdout
+[process.stderr]: https://nodejs.org/docs/v5.1.0/api/process.html#process_process_stderr
+[child process stdout and stderr]: https://nodejs.org/docs/v5.1.0/api/child_process.html#child_process_child_stdout
+[child process stdin]: https://nodejs.org/docs/v5.1.0/api/child_process.html#child_process_child_stdin
[API for Stream Consumers]: #stream_api_for_stream_consumers
[API for Stream Implementors]: #stream_api_for_stream_implementors
[Readable]: #stream_class_stream_readable
@@ -1686,7 +1720,7 @@ JSONParseStream.prototype._flush = function(cb) {
[`_write(chunk, encoding, callback)`]: #stream_writable_write_chunk_encoding_callback_1
[`_write()`]: #stream_writable_write_chunk_encoding_callback_1
[_write]: #stream_writable_write_chunk_encoding_callback_1
-[`util.inherits`]: https://iojs.org/dist/v4.1.2/doc/api/util.html#util_util_inherits_constructor_superconstructor
+[`util.inherits`]: https://nodejs.org/docs/v5.1.0/api/util.html#util_util_inherits_constructor_superconstructor
[`end()`]: #stream_writable_end_chunk_encoding_callback
[`'data'` event]: #stream_event_data
[`resume()`]: #stream_readable_resume
diff --git a/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/lib/_stream_readable.js b/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/lib/_stream_readable.js
index b2986f5face98b..50852aee7e6e02 100644
--- a/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/lib/_stream_readable.js
+++ b/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/lib/_stream_readable.js
@@ -61,8 +61,9 @@ var StringDecoder;
util.inherits(Readable, Stream);
+var Duplex;
function ReadableState(options, stream) {
- var Duplex = require('./_stream_duplex');
+ Duplex = Duplex || require('./_stream_duplex');
options = options || {};
@@ -128,8 +129,9 @@ function ReadableState(options, stream) {
}
}
+var Duplex;
function Readable(options) {
- var Duplex = require('./_stream_duplex');
+ Duplex = Duplex || require('./_stream_duplex');
if (!(this instanceof Readable))
return new Readable(options);
@@ -550,6 +552,7 @@ Readable.prototype.pipe = function(dest, pipeOpts) {
var ondrain = pipeOnDrain(src);
dest.on('drain', ondrain);
+ var cleanedUp = false;
function cleanup() {
debug('cleanup');
// cleanup event handlers once the pipe is broken
@@ -562,6 +565,8 @@ Readable.prototype.pipe = function(dest, pipeOpts) {
src.removeListener('end', cleanup);
src.removeListener('data', ondata);
+ cleanedUp = true;
+
// if the reader is waiting for a drain event from this
// specific writer, then it would cause it to never start
// flowing again.
@@ -577,9 +582,16 @@ Readable.prototype.pipe = function(dest, pipeOpts) {
debug('ondata');
var ret = dest.write(chunk);
if (false === ret) {
- debug('false write response, pause',
- src._readableState.awaitDrain);
- src._readableState.awaitDrain++;
+ // If the user unpiped during `dest.write()`, it is possible
+ // to get stuck in a permanently paused state if that write
+ // also returned false.
+ if (state.pipesCount === 1 &&
+ state.pipes[0] === dest &&
+ src.listenerCount('data') === 1 &&
+ !cleanedUp) {
+ debug('false write response, pause', src._readableState.awaitDrain);
+ src._readableState.awaitDrain++;
+ }
src.pause();
}
}
@@ -879,6 +891,8 @@ function fromList(n, state) {
// read it all, truncate the array.
if (stringMode)
ret = list.join('');
+ else if (list.length === 1)
+ ret = list[0];
else
ret = Buffer.concat(list, length);
list.length = 0;
diff --git a/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/lib/_stream_writable.js b/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/lib/_stream_writable.js
index 091b991c73ecf3..1fa5eb695adde6 100644
--- a/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/lib/_stream_writable.js
+++ b/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/lib/_stream_writable.js
@@ -1,5 +1,5 @@
// A bit simpler than readable streams.
-// Implement an async ._write(chunk, cb), and it'll handle all
+// Implement an async ._write(chunk, encoding, cb), and it'll handle all
// the drain event emission and buffering.
'use strict';
@@ -55,8 +55,9 @@ function WriteReq(chunk, encoding, cb) {
this.next = null;
}
+var Duplex;
function WritableState(options, stream) {
- var Duplex = require('./_stream_duplex');
+ Duplex = Duplex || require('./_stream_duplex');
options = options || {};
@@ -164,8 +165,9 @@ Object.defineProperty(WritableState.prototype, 'buffer', {
}catch(_){}}());
+var Duplex;
function Writable(options) {
- var Duplex = require('./_stream_duplex');
+ Duplex = Duplex || require('./_stream_duplex');
// Writable ctor is applied to Duplexes, though they're not
// instanceof Writable, they're instanceof Readable.
diff --git a/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/core-util-is/LICENSE b/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/core-util-is/LICENSE
new file mode 100644
index 00000000000000..d8d7f9437dbf5a
--- /dev/null
+++ b/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/core-util-is/LICENSE
@@ -0,0 +1,19 @@
+Copyright Node.js contributors. 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/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/core-util-is/lib/util.js b/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/core-util-is/lib/util.js
index 9074e8ebcb61e9..ff4c851c075a2f 100644
--- a/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/core-util-is/lib/util.js
+++ b/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/core-util-is/lib/util.js
@@ -21,8 +21,12 @@
// NOTE: These type checking functions intentionally don't use `instanceof`
// because it is fragile and can be easily faked with `Object.create()`.
-function isArray(ar) {
- return Array.isArray(ar);
+
+function isArray(arg) {
+ if (Array.isArray) {
+ return Array.isArray(arg);
+ }
+ return objectToString(arg) === '[object Array]';
}
exports.isArray = isArray;
@@ -62,7 +66,7 @@ function isUndefined(arg) {
exports.isUndefined = isUndefined;
function isRegExp(re) {
- return isObject(re) && objectToString(re) === '[object RegExp]';
+ return objectToString(re) === '[object RegExp]';
}
exports.isRegExp = isRegExp;
@@ -72,13 +76,12 @@ function isObject(arg) {
exports.isObject = isObject;
function isDate(d) {
- return isObject(d) && objectToString(d) === '[object Date]';
+ return objectToString(d) === '[object Date]';
}
exports.isDate = isDate;
function isError(e) {
- return isObject(e) &&
- (objectToString(e) === '[object Error]' || e instanceof Error);
+ return (objectToString(e) === '[object Error]' || e instanceof Error);
}
exports.isError = isError;
@@ -97,11 +100,8 @@ function isPrimitive(arg) {
}
exports.isPrimitive = isPrimitive;
-function isBuffer(arg) {
- return Buffer.isBuffer(arg);
-}
-exports.isBuffer = isBuffer;
+exports.isBuffer = Buffer.isBuffer;
function objectToString(o) {
return Object.prototype.toString.call(o);
-}
\ No newline at end of file
+}
diff --git a/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/core-util-is/package.json b/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/core-util-is/package.json
index 466dfdfe0139b3..ddd227e64f99f4 100644
--- a/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/core-util-is/package.json
+++ b/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/core-util-is/package.json
@@ -1,6 +1,6 @@
{
"name": "core-util-is",
- "version": "1.0.1",
+ "version": "1.0.2",
"description": "The `util.is*` functions introduced in Node v0.12.",
"main": "lib/util.js",
"repository": {
@@ -27,20 +27,27 @@
"bugs": {
"url": "https://github.com/isaacs/core-util-is/issues"
},
- "readme": "# core-util-is\n\nThe `util.is*` functions introduced in Node v0.12.\n",
- "readmeFilename": "README.md",
- "homepage": "https://github.com/isaacs/core-util-is",
- "_id": "core-util-is@1.0.1",
- "dist": {
- "shasum": "6b07085aef9a3ccac6ee53bf9d3df0c1521a5538",
- "tarball": "http://registry.npmjs.org/core-util-is/-/core-util-is-1.0.1.tgz"
+ "scripts": {
+ "test": "tap test.js"
+ },
+ "devDependencies": {
+ "tap": "^2.3.0"
},
+ "gitHead": "a177da234df5638b363ddc15fa324619a38577c8",
+ "homepage": "https://github.com/isaacs/core-util-is#readme",
+ "_id": "core-util-is@1.0.2",
+ "_shasum": "b5fd54220aa2bc5ab57aab7140c940754503c1a7",
"_from": "core-util-is@>=1.0.0 <1.1.0",
- "_npmVersion": "1.3.23",
+ "_npmVersion": "3.3.2",
+ "_nodeVersion": "4.0.0",
"_npmUser": {
"name": "isaacs",
"email": "i@izs.me"
},
+ "dist": {
+ "shasum": "b5fd54220aa2bc5ab57aab7140c940754503c1a7",
+ "tarball": "http://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz"
+ },
"maintainers": [
{
"name": "isaacs",
@@ -48,6 +55,6 @@
}
],
"directories": {},
- "_shasum": "6b07085aef9a3ccac6ee53bf9d3df0c1521a5538",
- "_resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.1.tgz"
+ "_resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz",
+ "readme": "ERROR: No README data found!"
}
diff --git a/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/core-util-is/test.js b/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/core-util-is/test.js
new file mode 100644
index 00000000000000..1a490c65ac8b5d
--- /dev/null
+++ b/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/core-util-is/test.js
@@ -0,0 +1,68 @@
+var assert = require('tap');
+
+var t = require('./lib/util');
+
+assert.equal(t.isArray([]), true);
+assert.equal(t.isArray({}), false);
+
+assert.equal(t.isBoolean(null), false);
+assert.equal(t.isBoolean(true), true);
+assert.equal(t.isBoolean(false), true);
+
+assert.equal(t.isNull(null), true);
+assert.equal(t.isNull(undefined), false);
+assert.equal(t.isNull(false), false);
+assert.equal(t.isNull(), false);
+
+assert.equal(t.isNullOrUndefined(null), true);
+assert.equal(t.isNullOrUndefined(undefined), true);
+assert.equal(t.isNullOrUndefined(false), false);
+assert.equal(t.isNullOrUndefined(), true);
+
+assert.equal(t.isNumber(null), false);
+assert.equal(t.isNumber('1'), false);
+assert.equal(t.isNumber(1), true);
+
+assert.equal(t.isString(null), false);
+assert.equal(t.isString('1'), true);
+assert.equal(t.isString(1), false);
+
+assert.equal(t.isSymbol(null), false);
+assert.equal(t.isSymbol('1'), false);
+assert.equal(t.isSymbol(1), false);
+assert.equal(t.isSymbol(Symbol()), true);
+
+assert.equal(t.isUndefined(null), false);
+assert.equal(t.isUndefined(undefined), true);
+assert.equal(t.isUndefined(false), false);
+assert.equal(t.isUndefined(), true);
+
+assert.equal(t.isRegExp(null), false);
+assert.equal(t.isRegExp('1'), false);
+assert.equal(t.isRegExp(new RegExp()), true);
+
+assert.equal(t.isObject({}), true);
+assert.equal(t.isObject([]), true);
+assert.equal(t.isObject(new RegExp()), true);
+assert.equal(t.isObject(new Date()), true);
+
+assert.equal(t.isDate(null), false);
+assert.equal(t.isDate('1'), false);
+assert.equal(t.isDate(new Date()), true);
+
+assert.equal(t.isError(null), false);
+assert.equal(t.isError({ err: true }), false);
+assert.equal(t.isError(new Error()), true);
+
+assert.equal(t.isFunction(null), false);
+assert.equal(t.isFunction({ }), false);
+assert.equal(t.isFunction(function() {}), true);
+
+assert.equal(t.isPrimitive(null), true);
+assert.equal(t.isPrimitive(''), true);
+assert.equal(t.isPrimitive(0), true);
+assert.equal(t.isPrimitive(new Date()), false);
+
+assert.equal(t.isBuffer(null), false);
+assert.equal(t.isBuffer({}), false);
+assert.equal(t.isBuffer(new Buffer(0)), true);
diff --git a/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/core-util-is/util.js b/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/core-util-is/util.js
deleted file mode 100644
index 007fa10575636d..00000000000000
--- a/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/core-util-is/util.js
+++ /dev/null
@@ -1,106 +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.
-
-// NOTE: These type checking functions intentionally don't use `instanceof`
-// because it is fragile and can be easily faked with `Object.create()`.
-function isArray(ar) {
- return Array.isArray(ar);
-}
-exports.isArray = isArray;
-
-function isBoolean(arg) {
- return typeof arg === 'boolean';
-}
-exports.isBoolean = isBoolean;
-
-function isNull(arg) {
- return arg === null;
-}
-exports.isNull = isNull;
-
-function isNullOrUndefined(arg) {
- return arg == null;
-}
-exports.isNullOrUndefined = isNullOrUndefined;
-
-function isNumber(arg) {
- return typeof arg === 'number';
-}
-exports.isNumber = isNumber;
-
-function isString(arg) {
- return typeof arg === 'string';
-}
-exports.isString = isString;
-
-function isSymbol(arg) {
- return typeof arg === 'symbol';
-}
-exports.isSymbol = isSymbol;
-
-function isUndefined(arg) {
- return arg === void 0;
-}
-exports.isUndefined = isUndefined;
-
-function isRegExp(re) {
- return isObject(re) && objectToString(re) === '[object RegExp]';
-}
-exports.isRegExp = isRegExp;
-
-function isObject(arg) {
- return typeof arg === 'object' && arg !== null;
-}
-exports.isObject = isObject;
-
-function isDate(d) {
- return isObject(d) && objectToString(d) === '[object Date]';
-}
-exports.isDate = isDate;
-
-function isError(e) {
- return isObject(e) && objectToString(e) === '[object Error]';
-}
-exports.isError = isError;
-
-function isFunction(arg) {
- return typeof arg === 'function';
-}
-exports.isFunction = isFunction;
-
-function isPrimitive(arg) {
- return arg === null ||
- typeof arg === 'boolean' ||
- typeof arg === 'number' ||
- typeof arg === 'string' ||
- typeof arg === 'symbol' || // ES6 symbol
- typeof arg === 'undefined';
-}
-exports.isPrimitive = isPrimitive;
-
-function isBuffer(arg) {
- return arg instanceof Buffer;
-}
-exports.isBuffer = isBuffer;
-
-function objectToString(o) {
- return Object.prototype.toString.call(o);
-}
diff --git a/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/process-nextick-args/.travis.yml b/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/process-nextick-args/.travis.yml
index 5ac98855343cee..36201b10017a5e 100644
--- a/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/process-nextick-args/.travis.yml
+++ b/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/process-nextick-args/.travis.yml
@@ -4,4 +4,9 @@ node_js:
- "0.10"
- "0.11"
- "0.12"
- - "iojs"
+ - "1.7.1"
+ - 1
+ - 2
+ - 3
+ - 4
+ - 5
diff --git a/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/process-nextick-args/index.js b/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/process-nextick-args/index.js
index 049521cad7ba1b..571c276783c779 100644
--- a/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/process-nextick-args/index.js
+++ b/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/process-nextick-args/index.js
@@ -1,5 +1,12 @@
'use strict';
-module.exports = nextTick;
+
+if (!process.version ||
+ process.version.indexOf('v0.') === 0 ||
+ process.version.indexOf('v1.') === 0 && process.version.indexOf('v1.8.') !== 0) {
+ module.exports = nextTick;
+} else {
+ module.exports = process.nextTick;
+}
function nextTick(fn) {
var args = new Array(arguments.length - 1);
diff --git a/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/process-nextick-args/package.json b/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/process-nextick-args/package.json
index 087586e8f8cedd..0ccf22578d2caa 100644
--- a/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/process-nextick-args/package.json
+++ b/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/process-nextick-args/package.json
@@ -1,6 +1,6 @@
{
"name": "process-nextick-args",
- "version": "1.0.3",
+ "version": "1.0.6",
"description": "process.nextTick but always with args",
"main": "index.js",
"scripts": {
@@ -19,19 +19,19 @@
"devDependencies": {
"tap": "~0.2.6"
},
- "gitHead": "e855846a69662b9489f1ad3dde1ebf2ccc4370b8",
- "_id": "process-nextick-args@1.0.3",
- "_shasum": "e272eed825d5e9f4ea74d8d73b1fe311c3beb630",
- "_from": "process-nextick-args@>=1.0.0 <1.1.0",
- "_npmVersion": "2.9.0",
- "_nodeVersion": "2.5.0",
+ "gitHead": "e85787b05a8c3c1adb714f332d822e9162699c78",
+ "_id": "process-nextick-args@1.0.6",
+ "_shasum": "0f96b001cea90b12592ce566edb97ec11e69bd05",
+ "_from": "process-nextick-args@>=1.0.6 <1.1.0",
+ "_npmVersion": "2.14.4",
+ "_nodeVersion": "4.1.1",
"_npmUser": {
"name": "cwmma",
"email": "calvin.metcalf@gmail.com"
},
"dist": {
- "shasum": "e272eed825d5e9f4ea74d8d73b1fe311c3beb630",
- "tarball": "http://registry.npmjs.org/process-nextick-args/-/process-nextick-args-1.0.3.tgz"
+ "shasum": "0f96b001cea90b12592ce566edb97ec11e69bd05",
+ "tarball": "http://registry.npmjs.org/process-nextick-args/-/process-nextick-args-1.0.6.tgz"
},
"maintainers": [
{
@@ -40,6 +40,6 @@
}
],
"directories": {},
- "_resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-1.0.3.tgz",
+ "_resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-1.0.6.tgz",
"readme": "ERROR: No README data found!"
}
diff --git a/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/package.json b/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/package.json
index 4dbae1ff0d1520..d6a064e6fab39b 100644
--- a/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/package.json
+++ b/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/package.json
@@ -1,13 +1,13 @@
{
"name": "readable-stream",
- "version": "2.0.3",
+ "version": "2.0.5",
"description": "Streams3, a user-land copy of the stream library from iojs v2.x",
"main": "readable.js",
"dependencies": {
"core-util-is": "~1.0.0",
"inherits": "~2.0.1",
"isarray": "0.0.1",
- "process-nextick-args": "~1.0.0",
+ "process-nextick-args": "~1.0.6",
"string_decoder": "~0.10.x",
"util-deprecate": "~1.0.1"
},
@@ -34,23 +34,23 @@
"util": false
},
"license": "MIT",
- "gitHead": "58099551e1ea7d99f8d13495740c5ae3f5d98053",
+ "gitHead": "a4f23d8e451267684a8160679ce16e16149fe72b",
"bugs": {
"url": "https://github.com/nodejs/readable-stream/issues"
},
"homepage": "https://github.com/nodejs/readable-stream#readme",
- "_id": "readable-stream@2.0.3",
- "_shasum": "4ab16b2aba452374b542a3f4f528634b9b45bb5a",
- "_from": "readable-stream@>=2.0.0 <2.1.0",
- "_npmVersion": "2.14.4",
- "_nodeVersion": "4.1.1",
+ "_id": "readable-stream@2.0.5",
+ "_shasum": "a2426f8dcd4551c77a33f96edf2886a23c829669",
+ "_from": "readable-stream@>=2.0.5 <2.1.0",
+ "_npmVersion": "3.3.12",
+ "_nodeVersion": "5.1.1",
"_npmUser": {
"name": "cwmma",
"email": "calvin.metcalf@gmail.com"
},
"dist": {
- "shasum": "4ab16b2aba452374b542a3f4f528634b9b45bb5a",
- "tarball": "http://registry.npmjs.org/readable-stream/-/readable-stream-2.0.3.tgz"
+ "shasum": "a2426f8dcd4551c77a33f96edf2886a23c829669",
+ "tarball": "http://registry.npmjs.org/readable-stream/-/readable-stream-2.0.5.tgz"
},
"maintainers": [
{
@@ -71,6 +71,6 @@
}
],
"directories": {},
- "_resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.0.3.tgz",
+ "_resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.0.5.tgz",
"readme": "ERROR: No README data found!"
}
diff --git a/deps/npm/node_modules/request/node_modules/bl/package.json b/deps/npm/node_modules/request/node_modules/bl/package.json
index 1513847030a9eb..469ebc8ea3604a 100644
--- a/deps/npm/node_modules/request/node_modules/bl/package.json
+++ b/deps/npm/node_modules/request/node_modules/bl/package.json
@@ -1,11 +1,10 @@
{
"name": "bl",
- "version": "1.0.0",
+ "version": "1.0.2",
"description": "Buffer List: collect buffers and access with a standard readable Buffer interface, streamable too!",
"main": "bl.js",
"scripts": {
- "test": "node test/test.js | faucet",
- "test-local": "brtapsauce-local test/basic-test.js"
+ "test": "node test/test.js | faucet"
},
"repository": {
"type": "git",
@@ -25,23 +24,22 @@
],
"license": "MIT",
"dependencies": {
- "readable-stream": "~2.0.0"
+ "readable-stream": "~2.0.5"
},
"devDependencies": {
"tape": "~2.12.3",
"hash_file": "~0.1.1",
- "faucet": "~0.0.1",
- "brtapsauce": "~0.3.0"
+ "faucet": "~0.0.1"
},
- "gitHead": "1794938be6697a6d1e02cd942a4eea59b353347a",
+ "gitHead": "9f1e7ce410e28d68c0a6f678b93b4cc2273e585f",
"bugs": {
"url": "https://github.com/rvagg/bl/issues"
},
- "_id": "bl@1.0.0",
- "_shasum": "ada9a8a89a6d7ac60862f7dec7db207873e0c3f5",
+ "_id": "bl@1.0.2",
+ "_shasum": "8c66490d825ba84d560de1f62196a29555b3a0c4",
"_from": "bl@>=1.0.0 <1.1.0",
- "_npmVersion": "2.9.0",
- "_nodeVersion": "2.0.1-nightly20150618d2e4e03444",
+ "_npmVersion": "3.6.0",
+ "_nodeVersion": "5.5.0",
"_npmUser": {
"name": "rvagg",
"email": "rod@vagg.org"
@@ -53,10 +51,13 @@
}
],
"dist": {
- "shasum": "ada9a8a89a6d7ac60862f7dec7db207873e0c3f5",
- "tarball": "http://registry.npmjs.org/bl/-/bl-1.0.0.tgz"
+ "shasum": "8c66490d825ba84d560de1f62196a29555b3a0c4",
+ "tarball": "http://registry.npmjs.org/bl/-/bl-1.0.2.tgz"
+ },
+ "_npmOperationalInternal": {
+ "host": "packages-6-west.internal.npmjs.com",
+ "tmp": "tmp/bl-1.0.2.tgz_1454532811740_0.7871121023781598"
},
"directories": {},
- "_resolved": "https://registry.npmjs.org/bl/-/bl-1.0.0.tgz",
- "readme": "ERROR: No README data found!"
+ "_resolved": "https://registry.npmjs.org/bl/-/bl-1.0.2.tgz"
}
diff --git a/deps/npm/node_modules/request/node_modules/bl/test/basic-test.js b/deps/npm/node_modules/request/node_modules/bl/test/basic-test.js
deleted file mode 100644
index 75116a30f4e40e..00000000000000
--- a/deps/npm/node_modules/request/node_modules/bl/test/basic-test.js
+++ /dev/null
@@ -1,541 +0,0 @@
-var tape = require('tape')
- , crypto = require('crypto')
- , fs = require('fs')
- , hash = require('hash_file')
- , BufferList = require('../')
-
- , encodings =
- ('hex utf8 utf-8 ascii binary base64'
- + (process.browser ? '' : ' ucs2 ucs-2 utf16le utf-16le')).split(' ')
-
-tape('single bytes from single buffer', function (t) {
- var bl = new BufferList()
- bl.append(new Buffer('abcd'))
-
- t.equal(bl.length, 4)
-
- t.equal(bl.get(0), 97)
- t.equal(bl.get(1), 98)
- t.equal(bl.get(2), 99)
- t.equal(bl.get(3), 100)
-
- t.end()
-})
-
-tape('single bytes from multiple buffers', function (t) {
- var bl = new BufferList()
- bl.append(new Buffer('abcd'))
- bl.append(new Buffer('efg'))
- bl.append(new Buffer('hi'))
- bl.append(new Buffer('j'))
-
- t.equal(bl.length, 10)
-
- t.equal(bl.get(0), 97)
- t.equal(bl.get(1), 98)
- t.equal(bl.get(2), 99)
- t.equal(bl.get(3), 100)
- t.equal(bl.get(4), 101)
- t.equal(bl.get(5), 102)
- t.equal(bl.get(6), 103)
- t.equal(bl.get(7), 104)
- t.equal(bl.get(8), 105)
- t.equal(bl.get(9), 106)
- t.end()
-})
-
-tape('multi bytes from single buffer', function (t) {
- var bl = new BufferList()
- bl.append(new Buffer('abcd'))
-
- t.equal(bl.length, 4)
-
- t.equal(bl.slice(0, 4).toString('ascii'), 'abcd')
- t.equal(bl.slice(0, 3).toString('ascii'), 'abc')
- t.equal(bl.slice(1, 4).toString('ascii'), 'bcd')
-
- t.end()
-})
-
-tape('multiple bytes from multiple buffers', function (t) {
- var bl = new BufferList()
-
- bl.append(new Buffer('abcd'))
- bl.append(new Buffer('efg'))
- bl.append(new Buffer('hi'))
- bl.append(new Buffer('j'))
-
- t.equal(bl.length, 10)
-
- t.equal(bl.slice(0, 10).toString('ascii'), 'abcdefghij')
- t.equal(bl.slice(3, 10).toString('ascii'), 'defghij')
- t.equal(bl.slice(3, 6).toString('ascii'), 'def')
- t.equal(bl.slice(3, 8).toString('ascii'), 'defgh')
- t.equal(bl.slice(5, 10).toString('ascii'), 'fghij')
-
- t.end()
-})
-
-tape('multiple bytes from multiple buffer lists', function (t) {
- var bl = new BufferList()
-
- bl.append(new BufferList([new Buffer('abcd'), new Buffer('efg')]))
- bl.append(new BufferList([new Buffer('hi'), new Buffer('j')]))
-
- t.equal(bl.length, 10)
-
- t.equal(bl.slice(0, 10).toString('ascii'), 'abcdefghij')
- t.equal(bl.slice(3, 10).toString('ascii'), 'defghij')
- t.equal(bl.slice(3, 6).toString('ascii'), 'def')
- t.equal(bl.slice(3, 8).toString('ascii'), 'defgh')
- t.equal(bl.slice(5, 10).toString('ascii'), 'fghij')
-
- t.end()
-})
-
-tape('consuming from multiple buffers', function (t) {
- var bl = new BufferList()
-
- bl.append(new Buffer('abcd'))
- bl.append(new Buffer('efg'))
- bl.append(new Buffer('hi'))
- bl.append(new Buffer('j'))
-
- t.equal(bl.length, 10)
-
- t.equal(bl.slice(0, 10).toString('ascii'), 'abcdefghij')
-
- bl.consume(3)
- t.equal(bl.length, 7)
- t.equal(bl.slice(0, 7).toString('ascii'), 'defghij')
-
- bl.consume(2)
- t.equal(bl.length, 5)
- t.equal(bl.slice(0, 5).toString('ascii'), 'fghij')
-
- bl.consume(1)
- t.equal(bl.length, 4)
- t.equal(bl.slice(0, 4).toString('ascii'), 'ghij')
-
- bl.consume(1)
- t.equal(bl.length, 3)
- t.equal(bl.slice(0, 3).toString('ascii'), 'hij')
-
- bl.consume(2)
- t.equal(bl.length, 1)
- t.equal(bl.slice(0, 1).toString('ascii'), 'j')
-
- t.end()
-})
-
-tape('test readUInt8 / readInt8', function (t) {
- var buf1 = new Buffer(1)
- , buf2 = new Buffer(3)
- , buf3 = new Buffer(3)
- , bl = new BufferList()
-
- buf2[1] = 0x3
- buf2[2] = 0x4
- buf3[0] = 0x23
- buf3[1] = 0x42
-
- bl.append(buf1)
- bl.append(buf2)
- bl.append(buf3)
-
- t.equal(bl.readUInt8(2), 0x3)
- t.equal(bl.readInt8(2), 0x3)
- t.equal(bl.readUInt8(3), 0x4)
- t.equal(bl.readInt8(3), 0x4)
- t.equal(bl.readUInt8(4), 0x23)
- t.equal(bl.readInt8(4), 0x23)
- t.equal(bl.readUInt8(5), 0x42)
- t.equal(bl.readInt8(5), 0x42)
- t.end()
-})
-
-tape('test readUInt16LE / readUInt16BE / readInt16LE / readInt16BE', function (t) {
- var buf1 = new Buffer(1)
- , buf2 = new Buffer(3)
- , buf3 = new Buffer(3)
- , bl = new BufferList()
-
- buf2[1] = 0x3
- buf2[2] = 0x4
- buf3[0] = 0x23
- buf3[1] = 0x42
-
- bl.append(buf1)
- bl.append(buf2)
- bl.append(buf3)
-
- t.equal(bl.readUInt16BE(2), 0x0304)
- t.equal(bl.readUInt16LE(2), 0x0403)
- t.equal(bl.readInt16BE(2), 0x0304)
- t.equal(bl.readInt16LE(2), 0x0403)
- t.equal(bl.readUInt16BE(3), 0x0423)
- t.equal(bl.readUInt16LE(3), 0x2304)
- t.equal(bl.readInt16BE(3), 0x0423)
- t.equal(bl.readInt16LE(3), 0x2304)
- t.equal(bl.readUInt16BE(4), 0x2342)
- t.equal(bl.readUInt16LE(4), 0x4223)
- t.equal(bl.readInt16BE(4), 0x2342)
- t.equal(bl.readInt16LE(4), 0x4223)
- t.end()
-})
-
-tape('test readUInt32LE / readUInt32BE / readInt32LE / readInt32BE', function (t) {
- var buf1 = new Buffer(1)
- , buf2 = new Buffer(3)
- , buf3 = new Buffer(3)
- , bl = new BufferList()
-
- buf2[1] = 0x3
- buf2[2] = 0x4
- buf3[0] = 0x23
- buf3[1] = 0x42
-
- bl.append(buf1)
- bl.append(buf2)
- bl.append(buf3)
-
- t.equal(bl.readUInt32BE(2), 0x03042342)
- t.equal(bl.readUInt32LE(2), 0x42230403)
- t.equal(bl.readInt32BE(2), 0x03042342)
- t.equal(bl.readInt32LE(2), 0x42230403)
- t.end()
-})
-
-tape('test readFloatLE / readFloatBE', function (t) {
- var buf1 = new Buffer(1)
- , buf2 = new Buffer(3)
- , buf3 = new Buffer(3)
- , bl = new BufferList()
-
- buf2[1] = 0x00
- buf2[2] = 0x00
- buf3[0] = 0x80
- buf3[1] = 0x3f
-
- bl.append(buf1)
- bl.append(buf2)
- bl.append(buf3)
-
- t.equal(bl.readFloatLE(2), 0x01)
- t.end()
-})
-
-tape('test readDoubleLE / readDoubleBE', function (t) {
- var buf1 = new Buffer(1)
- , buf2 = new Buffer(3)
- , buf3 = new Buffer(10)
- , bl = new BufferList()
-
- buf2[1] = 0x55
- buf2[2] = 0x55
- buf3[0] = 0x55
- buf3[1] = 0x55
- buf3[2] = 0x55
- buf3[3] = 0x55
- buf3[4] = 0xd5
- buf3[5] = 0x3f
-
- bl.append(buf1)
- bl.append(buf2)
- bl.append(buf3)
-
- t.equal(bl.readDoubleLE(2), 0.3333333333333333)
- t.end()
-})
-
-tape('test toString', function (t) {
- var bl = new BufferList()
-
- bl.append(new Buffer('abcd'))
- bl.append(new Buffer('efg'))
- bl.append(new Buffer('hi'))
- bl.append(new Buffer('j'))
-
- t.equal(bl.toString('ascii', 0, 10), 'abcdefghij')
- t.equal(bl.toString('ascii', 3, 10), 'defghij')
- t.equal(bl.toString('ascii', 3, 6), 'def')
- t.equal(bl.toString('ascii', 3, 8), 'defgh')
- t.equal(bl.toString('ascii', 5, 10), 'fghij')
-
- t.end()
-})
-
-tape('test toString encoding', function (t) {
- var bl = new BufferList()
- , b = new Buffer('abcdefghij\xff\x00')
-
- bl.append(new Buffer('abcd'))
- bl.append(new Buffer('efg'))
- bl.append(new Buffer('hi'))
- bl.append(new Buffer('j'))
- bl.append(new Buffer('\xff\x00'))
-
- encodings.forEach(function (enc) {
- t.equal(bl.toString(enc), b.toString(enc), enc)
- })
-
- t.end()
-})
-
-!process.browser && tape('test stream', function (t) {
- var random = crypto.randomBytes(65534)
- , rndhash = hash(random, 'md5')
- , md5sum = crypto.createHash('md5')
- , bl = new BufferList(function (err, buf) {
- t.ok(Buffer.isBuffer(buf))
- t.ok(err === null)
- t.equal(rndhash, hash(bl.slice(), 'md5'))
- t.equal(rndhash, hash(buf, 'md5'))
-
- bl.pipe(fs.createWriteStream('/tmp/bl_test_rnd_out.dat'))
- .on('close', function () {
- var s = fs.createReadStream('/tmp/bl_test_rnd_out.dat')
- s.on('data', md5sum.update.bind(md5sum))
- s.on('end', function() {
- t.equal(rndhash, md5sum.digest('hex'), 'woohoo! correct hash!')
- t.end()
- })
- })
-
- })
-
- fs.writeFileSync('/tmp/bl_test_rnd.dat', random)
- fs.createReadStream('/tmp/bl_test_rnd.dat').pipe(bl)
-})
-
-tape('instantiation with Buffer', function (t) {
- var buf = crypto.randomBytes(1024)
- , buf2 = crypto.randomBytes(1024)
- , b = BufferList(buf)
-
- t.equal(buf.toString('hex'), b.slice().toString('hex'), 'same buffer')
- b = BufferList([ buf, buf2 ])
- t.equal(b.slice().toString('hex'), Buffer.concat([ buf, buf2 ]).toString('hex'), 'same buffer')
- t.end()
-})
-
-tape('test String appendage', function (t) {
- var bl = new BufferList()
- , b = new Buffer('abcdefghij\xff\x00')
-
- bl.append('abcd')
- bl.append('efg')
- bl.append('hi')
- bl.append('j')
- bl.append('\xff\x00')
-
- encodings.forEach(function (enc) {
- t.equal(bl.toString(enc), b.toString(enc))
- })
-
- t.end()
-})
-
-tape('write nothing, should get empty buffer', function (t) {
- t.plan(3)
- BufferList(function (err, data) {
- t.notOk(err, 'no error')
- t.ok(Buffer.isBuffer(data), 'got a buffer')
- t.equal(0, data.length, 'got a zero-length buffer')
- t.end()
- }).end()
-})
-
-tape('unicode string', function (t) {
- t.plan(2)
- var inp1 = '\u2600'
- , inp2 = '\u2603'
- , exp = inp1 + ' and ' + inp2
- , bl = BufferList()
- bl.write(inp1)
- bl.write(' and ')
- bl.write(inp2)
- t.equal(exp, bl.toString())
- t.equal(new Buffer(exp).toString('hex'), bl.toString('hex'))
-})
-
-tape('should emit finish', function (t) {
- var source = BufferList()
- , dest = BufferList()
-
- source.write('hello')
- source.pipe(dest)
-
- dest.on('finish', function () {
- t.equal(dest.toString('utf8'), 'hello')
- t.end()
- })
-})
-
-tape('basic copy', function (t) {
- var buf = crypto.randomBytes(1024)
- , buf2 = new Buffer(1024)
- , b = BufferList(buf)
-
- b.copy(buf2)
- t.equal(b.slice().toString('hex'), buf2.toString('hex'), 'same buffer')
- t.end()
-})
-
-tape('copy after many appends', function (t) {
- var buf = crypto.randomBytes(512)
- , buf2 = new Buffer(1024)
- , b = BufferList(buf)
-
- b.append(buf)
- b.copy(buf2)
- t.equal(b.slice().toString('hex'), buf2.toString('hex'), 'same buffer')
- t.end()
-})
-
-tape('copy at a precise position', function (t) {
- var buf = crypto.randomBytes(1004)
- , buf2 = new Buffer(1024)
- , b = BufferList(buf)
-
- b.copy(buf2, 20)
- t.equal(b.slice().toString('hex'), buf2.slice(20).toString('hex'), 'same buffer')
- t.end()
-})
-
-tape('copy starting from a precise location', function (t) {
- var buf = crypto.randomBytes(10)
- , buf2 = new Buffer(5)
- , b = BufferList(buf)
-
- b.copy(buf2, 0, 5)
- t.equal(b.slice(5).toString('hex'), buf2.toString('hex'), 'same buffer')
- t.end()
-})
-
-tape('copy in an interval', function (t) {
- var rnd = crypto.randomBytes(10)
- , b = BufferList(rnd) // put the random bytes there
- , actual = new Buffer(3)
- , expected = new Buffer(3)
-
- rnd.copy(expected, 0, 5, 8)
- b.copy(actual, 0, 5, 8)
-
- t.equal(actual.toString('hex'), expected.toString('hex'), 'same buffer')
- t.end()
-})
-
-tape('copy an interval between two buffers', function (t) {
- var buf = crypto.randomBytes(10)
- , buf2 = new Buffer(10)
- , b = BufferList(buf)
-
- b.append(buf)
- b.copy(buf2, 0, 5, 15)
-
- t.equal(b.slice(5, 15).toString('hex'), buf2.toString('hex'), 'same buffer')
- t.end()
-})
-
-tape('duplicate', function (t) {
- t.plan(2)
-
- var bl = new BufferList('abcdefghij\xff\x00')
- , dup = bl.duplicate()
-
- t.equal(bl.prototype, dup.prototype)
- t.equal(bl.toString('hex'), dup.toString('hex'))
-})
-
-tape('destroy no pipe', function (t) {
- t.plan(2)
-
- var bl = new BufferList('alsdkfja;lsdkfja;lsdk')
- bl.destroy()
-
- t.equal(bl._bufs.length, 0)
- t.equal(bl.length, 0)
-})
-
-!process.browser && tape('destroy with pipe before read end', function (t) {
- t.plan(2)
-
- var bl = new BufferList()
- fs.createReadStream(__dirname + '/sauce.js')
- .pipe(bl)
-
- bl.destroy()
-
- t.equal(bl._bufs.length, 0)
- t.equal(bl.length, 0)
-
-})
-
-!process.browser && tape('destroy with pipe before read end with race', function (t) {
- t.plan(2)
-
- var bl = new BufferList()
- fs.createReadStream(__dirname + '/sauce.js')
- .pipe(bl)
-
- setTimeout(function () {
- bl.destroy()
- setTimeout(function () {
- t.equal(bl._bufs.length, 0)
- t.equal(bl.length, 0)
- }, 500)
- }, 500)
-})
-
-!process.browser && tape('destroy with pipe after read end', function (t) {
- t.plan(2)
-
- var bl = new BufferList()
- fs.createReadStream(__dirname + '/sauce.js')
- .on('end', onEnd)
- .pipe(bl)
-
- function onEnd () {
- bl.destroy()
-
- t.equal(bl._bufs.length, 0)
- t.equal(bl.length, 0)
- }
-})
-
-!process.browser && tape('destroy with pipe while writing to a destination', function (t) {
- t.plan(4)
-
- var bl = new BufferList()
- , ds = new BufferList()
-
- fs.createReadStream(__dirname + '/sauce.js')
- .on('end', onEnd)
- .pipe(bl)
-
- function onEnd () {
- bl.pipe(ds)
-
- setTimeout(function () {
- bl.destroy()
-
- t.equals(bl._bufs.length, 0)
- t.equals(bl.length, 0)
-
- ds.destroy()
-
- t.equals(bl._bufs.length, 0)
- t.equals(bl.length, 0)
-
- }, 100)
- }
-})
-
-!process.browser && tape('handle error', function (t) {
- t.plan(2)
- fs.createReadStream('/does/not/exist').pipe(BufferList(function (err, data) {
- t.ok(err instanceof Error, 'has error')
- t.notOk(data, 'no data')
- }))
-})
diff --git a/deps/npm/node_modules/request/node_modules/bl/test/sauce.js b/deps/npm/node_modules/request/node_modules/bl/test/sauce.js
deleted file mode 100644
index a6d28625fbfeaf..00000000000000
--- a/deps/npm/node_modules/request/node_modules/bl/test/sauce.js
+++ /dev/null
@@ -1,38 +0,0 @@
-#!/usr/bin/env node
-
-const user = process.env.SAUCE_USER
- , key = process.env.SAUCE_KEY
- , path = require('path')
- , brtapsauce = require('brtapsauce')
- , testFile = path.join(__dirname, 'basic-test.js')
-
- , capabilities = [
- { browserName: 'chrome' , platform: 'Windows XP', version: '' }
- , { browserName: 'firefox' , platform: 'Windows 8' , version: '' }
- , { browserName: 'firefox' , platform: 'Windows XP', version: '4' }
- , { browserName: 'internet explorer' , platform: 'Windows 8' , version: '10' }
- , { browserName: 'internet explorer' , platform: 'Windows 7' , version: '9' }
- , { browserName: 'internet explorer' , platform: 'Windows 7' , version: '8' }
- , { browserName: 'internet explorer' , platform: 'Windows XP', version: '7' }
- , { browserName: 'internet explorer' , platform: 'Windows XP', version: '6' }
- , { browserName: 'safari' , platform: 'Windows 7' , version: '5' }
- , { browserName: 'safari' , platform: 'OS X 10.8' , version: '6' }
- , { browserName: 'opera' , platform: 'Windows 7' , version: '' }
- , { browserName: 'opera' , platform: 'Windows 7' , version: '11' }
- , { browserName: 'ipad' , platform: 'OS X 10.8' , version: '6' }
- , { browserName: 'android' , platform: 'Linux' , version: '4.0', 'device-type': 'tablet' }
- ]
-
-if (!user)
- throw new Error('Must set a SAUCE_USER env var')
-if (!key)
- throw new Error('Must set a SAUCE_KEY env var')
-
-brtapsauce({
- name : 'Traversty'
- , user : user
- , key : key
- , brsrc : testFile
- , capabilities : capabilities
- , options : { timeout: 60 * 6 }
-})
\ No newline at end of file
diff --git a/deps/npm/node_modules/request/node_modules/bl/test/test.js b/deps/npm/node_modules/request/node_modules/bl/test/test.js
index aa9b48771a2e9b..8c8d0cf2ae2d01 100644
--- a/deps/npm/node_modules/request/node_modules/bl/test/test.js
+++ b/deps/npm/node_modules/request/node_modules/bl/test/test.js
@@ -1,9 +1,557 @@
-require('./basic-test')
+var tape = require('tape')
+ , crypto = require('crypto')
+ , fs = require('fs')
+ , hash = require('hash_file')
+ , BufferList = require('../')
-if (!process.env.SAUCE_KEY || !process.env.SAUCE_USER)
- return console.log('SAUCE_KEY and/or SAUCE_USER not set, not running sauce tests')
+ , encodings =
+ ('hex utf8 utf-8 ascii binary base64'
+ + (process.browser ? '' : ' ucs2 ucs-2 utf16le utf-16le')).split(' ')
-if (!/v0\.10/.test(process.version))
- return console.log('Not Node v0.10.x, not running sauce tests')
+tape('single bytes from single buffer', function (t) {
+ var bl = new BufferList()
+ bl.append(new Buffer('abcd'))
-require('./sauce.js')
\ No newline at end of file
+ t.equal(bl.length, 4)
+
+ t.equal(bl.get(0), 97)
+ t.equal(bl.get(1), 98)
+ t.equal(bl.get(2), 99)
+ t.equal(bl.get(3), 100)
+
+ t.end()
+})
+
+tape('single bytes from multiple buffers', function (t) {
+ var bl = new BufferList()
+ bl.append(new Buffer('abcd'))
+ bl.append(new Buffer('efg'))
+ bl.append(new Buffer('hi'))
+ bl.append(new Buffer('j'))
+
+ t.equal(bl.length, 10)
+
+ t.equal(bl.get(0), 97)
+ t.equal(bl.get(1), 98)
+ t.equal(bl.get(2), 99)
+ t.equal(bl.get(3), 100)
+ t.equal(bl.get(4), 101)
+ t.equal(bl.get(5), 102)
+ t.equal(bl.get(6), 103)
+ t.equal(bl.get(7), 104)
+ t.equal(bl.get(8), 105)
+ t.equal(bl.get(9), 106)
+ t.end()
+})
+
+tape('multi bytes from single buffer', function (t) {
+ var bl = new BufferList()
+ bl.append(new Buffer('abcd'))
+
+ t.equal(bl.length, 4)
+
+ t.equal(bl.slice(0, 4).toString('ascii'), 'abcd')
+ t.equal(bl.slice(0, 3).toString('ascii'), 'abc')
+ t.equal(bl.slice(1, 4).toString('ascii'), 'bcd')
+
+ t.end()
+})
+
+tape('multiple bytes from multiple buffers', function (t) {
+ var bl = new BufferList()
+
+ bl.append(new Buffer('abcd'))
+ bl.append(new Buffer('efg'))
+ bl.append(new Buffer('hi'))
+ bl.append(new Buffer('j'))
+
+ t.equal(bl.length, 10)
+
+ t.equal(bl.slice(0, 10).toString('ascii'), 'abcdefghij')
+ t.equal(bl.slice(3, 10).toString('ascii'), 'defghij')
+ t.equal(bl.slice(3, 6).toString('ascii'), 'def')
+ t.equal(bl.slice(3, 8).toString('ascii'), 'defgh')
+ t.equal(bl.slice(5, 10).toString('ascii'), 'fghij')
+
+ t.end()
+})
+
+tape('multiple bytes from multiple buffer lists', function (t) {
+ var bl = new BufferList()
+
+ bl.append(new BufferList([new Buffer('abcd'), new Buffer('efg')]))
+ bl.append(new BufferList([new Buffer('hi'), new Buffer('j')]))
+
+ t.equal(bl.length, 10)
+
+ t.equal(bl.slice(0, 10).toString('ascii'), 'abcdefghij')
+ t.equal(bl.slice(3, 10).toString('ascii'), 'defghij')
+ t.equal(bl.slice(3, 6).toString('ascii'), 'def')
+ t.equal(bl.slice(3, 8).toString('ascii'), 'defgh')
+ t.equal(bl.slice(5, 10).toString('ascii'), 'fghij')
+
+ t.end()
+})
+
+tape('consuming from multiple buffers', function (t) {
+ var bl = new BufferList()
+
+ bl.append(new Buffer('abcd'))
+ bl.append(new Buffer('efg'))
+ bl.append(new Buffer('hi'))
+ bl.append(new Buffer('j'))
+
+ t.equal(bl.length, 10)
+
+ t.equal(bl.slice(0, 10).toString('ascii'), 'abcdefghij')
+
+ bl.consume(3)
+ t.equal(bl.length, 7)
+ t.equal(bl.slice(0, 7).toString('ascii'), 'defghij')
+
+ bl.consume(2)
+ t.equal(bl.length, 5)
+ t.equal(bl.slice(0, 5).toString('ascii'), 'fghij')
+
+ bl.consume(1)
+ t.equal(bl.length, 4)
+ t.equal(bl.slice(0, 4).toString('ascii'), 'ghij')
+
+ bl.consume(1)
+ t.equal(bl.length, 3)
+ t.equal(bl.slice(0, 3).toString('ascii'), 'hij')
+
+ bl.consume(2)
+ t.equal(bl.length, 1)
+ t.equal(bl.slice(0, 1).toString('ascii'), 'j')
+
+ t.end()
+})
+
+tape('test readUInt8 / readInt8', function (t) {
+ var buf1 = new Buffer(1)
+ , buf2 = new Buffer(3)
+ , buf3 = new Buffer(3)
+ , bl = new BufferList()
+
+ buf2[1] = 0x3
+ buf2[2] = 0x4
+ buf3[0] = 0x23
+ buf3[1] = 0x42
+
+ bl.append(buf1)
+ bl.append(buf2)
+ bl.append(buf3)
+
+ t.equal(bl.readUInt8(2), 0x3)
+ t.equal(bl.readInt8(2), 0x3)
+ t.equal(bl.readUInt8(3), 0x4)
+ t.equal(bl.readInt8(3), 0x4)
+ t.equal(bl.readUInt8(4), 0x23)
+ t.equal(bl.readInt8(4), 0x23)
+ t.equal(bl.readUInt8(5), 0x42)
+ t.equal(bl.readInt8(5), 0x42)
+ t.end()
+})
+
+tape('test readUInt16LE / readUInt16BE / readInt16LE / readInt16BE', function (t) {
+ var buf1 = new Buffer(1)
+ , buf2 = new Buffer(3)
+ , buf3 = new Buffer(3)
+ , bl = new BufferList()
+
+ buf2[1] = 0x3
+ buf2[2] = 0x4
+ buf3[0] = 0x23
+ buf3[1] = 0x42
+
+ bl.append(buf1)
+ bl.append(buf2)
+ bl.append(buf3)
+
+ t.equal(bl.readUInt16BE(2), 0x0304)
+ t.equal(bl.readUInt16LE(2), 0x0403)
+ t.equal(bl.readInt16BE(2), 0x0304)
+ t.equal(bl.readInt16LE(2), 0x0403)
+ t.equal(bl.readUInt16BE(3), 0x0423)
+ t.equal(bl.readUInt16LE(3), 0x2304)
+ t.equal(bl.readInt16BE(3), 0x0423)
+ t.equal(bl.readInt16LE(3), 0x2304)
+ t.equal(bl.readUInt16BE(4), 0x2342)
+ t.equal(bl.readUInt16LE(4), 0x4223)
+ t.equal(bl.readInt16BE(4), 0x2342)
+ t.equal(bl.readInt16LE(4), 0x4223)
+ t.end()
+})
+
+tape('test readUInt32LE / readUInt32BE / readInt32LE / readInt32BE', function (t) {
+ var buf1 = new Buffer(1)
+ , buf2 = new Buffer(3)
+ , buf3 = new Buffer(3)
+ , bl = new BufferList()
+
+ buf2[1] = 0x3
+ buf2[2] = 0x4
+ buf3[0] = 0x23
+ buf3[1] = 0x42
+
+ bl.append(buf1)
+ bl.append(buf2)
+ bl.append(buf3)
+
+ t.equal(bl.readUInt32BE(2), 0x03042342)
+ t.equal(bl.readUInt32LE(2), 0x42230403)
+ t.equal(bl.readInt32BE(2), 0x03042342)
+ t.equal(bl.readInt32LE(2), 0x42230403)
+ t.end()
+})
+
+tape('test readFloatLE / readFloatBE', function (t) {
+ var buf1 = new Buffer(1)
+ , buf2 = new Buffer(3)
+ , buf3 = new Buffer(3)
+ , bl = new BufferList()
+
+ buf2[1] = 0x00
+ buf2[2] = 0x00
+ buf3[0] = 0x80
+ buf3[1] = 0x3f
+
+ bl.append(buf1)
+ bl.append(buf2)
+ bl.append(buf3)
+
+ t.equal(bl.readFloatLE(2), 0x01)
+ t.end()
+})
+
+tape('test readDoubleLE / readDoubleBE', function (t) {
+ var buf1 = new Buffer(1)
+ , buf2 = new Buffer(3)
+ , buf3 = new Buffer(10)
+ , bl = new BufferList()
+
+ buf2[1] = 0x55
+ buf2[2] = 0x55
+ buf3[0] = 0x55
+ buf3[1] = 0x55
+ buf3[2] = 0x55
+ buf3[3] = 0x55
+ buf3[4] = 0xd5
+ buf3[5] = 0x3f
+
+ bl.append(buf1)
+ bl.append(buf2)
+ bl.append(buf3)
+
+ t.equal(bl.readDoubleLE(2), 0.3333333333333333)
+ t.end()
+})
+
+tape('test toString', function (t) {
+ var bl = new BufferList()
+
+ bl.append(new Buffer('abcd'))
+ bl.append(new Buffer('efg'))
+ bl.append(new Buffer('hi'))
+ bl.append(new Buffer('j'))
+
+ t.equal(bl.toString('ascii', 0, 10), 'abcdefghij')
+ t.equal(bl.toString('ascii', 3, 10), 'defghij')
+ t.equal(bl.toString('ascii', 3, 6), 'def')
+ t.equal(bl.toString('ascii', 3, 8), 'defgh')
+ t.equal(bl.toString('ascii', 5, 10), 'fghij')
+
+ t.end()
+})
+
+tape('test toString encoding', function (t) {
+ var bl = new BufferList()
+ , b = new Buffer('abcdefghij\xff\x00')
+
+ bl.append(new Buffer('abcd'))
+ bl.append(new Buffer('efg'))
+ bl.append(new Buffer('hi'))
+ bl.append(new Buffer('j'))
+ bl.append(new Buffer('\xff\x00'))
+
+ encodings.forEach(function (enc) {
+ t.equal(bl.toString(enc), b.toString(enc), enc)
+ })
+
+ t.end()
+})
+
+!process.browser && tape('test stream', function (t) {
+ var random = crypto.randomBytes(65534)
+ , rndhash = hash(random, 'md5')
+ , md5sum = crypto.createHash('md5')
+ , bl = new BufferList(function (err, buf) {
+ t.ok(Buffer.isBuffer(buf))
+ t.ok(err === null)
+ t.equal(rndhash, hash(bl.slice(), 'md5'))
+ t.equal(rndhash, hash(buf, 'md5'))
+
+ bl.pipe(fs.createWriteStream('/tmp/bl_test_rnd_out.dat'))
+ .on('close', function () {
+ var s = fs.createReadStream('/tmp/bl_test_rnd_out.dat')
+ s.on('data', md5sum.update.bind(md5sum))
+ s.on('end', function() {
+ t.equal(rndhash, md5sum.digest('hex'), 'woohoo! correct hash!')
+ t.end()
+ })
+ })
+
+ })
+
+ fs.writeFileSync('/tmp/bl_test_rnd.dat', random)
+ fs.createReadStream('/tmp/bl_test_rnd.dat').pipe(bl)
+})
+
+tape('instantiation with Buffer', function (t) {
+ var buf = crypto.randomBytes(1024)
+ , buf2 = crypto.randomBytes(1024)
+ , b = BufferList(buf)
+
+ t.equal(buf.toString('hex'), b.slice().toString('hex'), 'same buffer')
+ b = BufferList([ buf, buf2 ])
+ t.equal(b.slice().toString('hex'), Buffer.concat([ buf, buf2 ]).toString('hex'), 'same buffer')
+ t.end()
+})
+
+tape('test String appendage', function (t) {
+ var bl = new BufferList()
+ , b = new Buffer('abcdefghij\xff\x00')
+
+ bl.append('abcd')
+ bl.append('efg')
+ bl.append('hi')
+ bl.append('j')
+ bl.append('\xff\x00')
+
+ encodings.forEach(function (enc) {
+ t.equal(bl.toString(enc), b.toString(enc))
+ })
+
+ t.end()
+})
+
+tape('test Number appendage', function (t) {
+ var bl = new BufferList()
+ , b = new Buffer('1234567890')
+
+ bl.append(1234)
+ bl.append(567)
+ bl.append(89)
+ bl.append(0)
+
+ encodings.forEach(function (enc) {
+ t.equal(bl.toString(enc), b.toString(enc))
+ })
+
+ t.end()
+})
+
+tape('write nothing, should get empty buffer', function (t) {
+ t.plan(3)
+ BufferList(function (err, data) {
+ t.notOk(err, 'no error')
+ t.ok(Buffer.isBuffer(data), 'got a buffer')
+ t.equal(0, data.length, 'got a zero-length buffer')
+ t.end()
+ }).end()
+})
+
+tape('unicode string', function (t) {
+ t.plan(2)
+ var inp1 = '\u2600'
+ , inp2 = '\u2603'
+ , exp = inp1 + ' and ' + inp2
+ , bl = BufferList()
+ bl.write(inp1)
+ bl.write(' and ')
+ bl.write(inp2)
+ t.equal(exp, bl.toString())
+ t.equal(new Buffer(exp).toString('hex'), bl.toString('hex'))
+})
+
+tape('should emit finish', function (t) {
+ var source = BufferList()
+ , dest = BufferList()
+
+ source.write('hello')
+ source.pipe(dest)
+
+ dest.on('finish', function () {
+ t.equal(dest.toString('utf8'), 'hello')
+ t.end()
+ })
+})
+
+tape('basic copy', function (t) {
+ var buf = crypto.randomBytes(1024)
+ , buf2 = new Buffer(1024)
+ , b = BufferList(buf)
+
+ b.copy(buf2)
+ t.equal(b.slice().toString('hex'), buf2.toString('hex'), 'same buffer')
+ t.end()
+})
+
+tape('copy after many appends', function (t) {
+ var buf = crypto.randomBytes(512)
+ , buf2 = new Buffer(1024)
+ , b = BufferList(buf)
+
+ b.append(buf)
+ b.copy(buf2)
+ t.equal(b.slice().toString('hex'), buf2.toString('hex'), 'same buffer')
+ t.end()
+})
+
+tape('copy at a precise position', function (t) {
+ var buf = crypto.randomBytes(1004)
+ , buf2 = new Buffer(1024)
+ , b = BufferList(buf)
+
+ b.copy(buf2, 20)
+ t.equal(b.slice().toString('hex'), buf2.slice(20).toString('hex'), 'same buffer')
+ t.end()
+})
+
+tape('copy starting from a precise location', function (t) {
+ var buf = crypto.randomBytes(10)
+ , buf2 = new Buffer(5)
+ , b = BufferList(buf)
+
+ b.copy(buf2, 0, 5)
+ t.equal(b.slice(5).toString('hex'), buf2.toString('hex'), 'same buffer')
+ t.end()
+})
+
+tape('copy in an interval', function (t) {
+ var rnd = crypto.randomBytes(10)
+ , b = BufferList(rnd) // put the random bytes there
+ , actual = new Buffer(3)
+ , expected = new Buffer(3)
+
+ rnd.copy(expected, 0, 5, 8)
+ b.copy(actual, 0, 5, 8)
+
+ t.equal(actual.toString('hex'), expected.toString('hex'), 'same buffer')
+ t.end()
+})
+
+tape('copy an interval between two buffers', function (t) {
+ var buf = crypto.randomBytes(10)
+ , buf2 = new Buffer(10)
+ , b = BufferList(buf)
+
+ b.append(buf)
+ b.copy(buf2, 0, 5, 15)
+
+ t.equal(b.slice(5, 15).toString('hex'), buf2.toString('hex'), 'same buffer')
+ t.end()
+})
+
+tape('duplicate', function (t) {
+ t.plan(2)
+
+ var bl = new BufferList('abcdefghij\xff\x00')
+ , dup = bl.duplicate()
+
+ t.equal(bl.prototype, dup.prototype)
+ t.equal(bl.toString('hex'), dup.toString('hex'))
+})
+
+tape('destroy no pipe', function (t) {
+ t.plan(2)
+
+ var bl = new BufferList('alsdkfja;lsdkfja;lsdk')
+ bl.destroy()
+
+ t.equal(bl._bufs.length, 0)
+ t.equal(bl.length, 0)
+})
+
+!process.browser && tape('destroy with pipe before read end', function (t) {
+ t.plan(2)
+
+ var bl = new BufferList()
+ fs.createReadStream(__dirname + '/test.js')
+ .pipe(bl)
+
+ bl.destroy()
+
+ t.equal(bl._bufs.length, 0)
+ t.equal(bl.length, 0)
+
+})
+
+!process.browser && tape('destroy with pipe before read end with race', function (t) {
+ t.plan(2)
+
+ var bl = new BufferList()
+ fs.createReadStream(__dirname + '/test.js')
+ .pipe(bl)
+
+ setTimeout(function () {
+ bl.destroy()
+ setTimeout(function () {
+ t.equal(bl._bufs.length, 0)
+ t.equal(bl.length, 0)
+ }, 500)
+ }, 500)
+})
+
+!process.browser && tape('destroy with pipe after read end', function (t) {
+ t.plan(2)
+
+ var bl = new BufferList()
+ fs.createReadStream(__dirname + '/test.js')
+ .on('end', onEnd)
+ .pipe(bl)
+
+ function onEnd () {
+ bl.destroy()
+
+ t.equal(bl._bufs.length, 0)
+ t.equal(bl.length, 0)
+ }
+})
+
+!process.browser && tape('destroy with pipe while writing to a destination', function (t) {
+ t.plan(4)
+
+ var bl = new BufferList()
+ , ds = new BufferList()
+
+ fs.createReadStream(__dirname + '/test.js')
+ .on('end', onEnd)
+ .pipe(bl)
+
+ function onEnd () {
+ bl.pipe(ds)
+
+ setTimeout(function () {
+ bl.destroy()
+
+ t.equals(bl._bufs.length, 0)
+ t.equals(bl.length, 0)
+
+ ds.destroy()
+
+ t.equals(bl._bufs.length, 0)
+ t.equals(bl.length, 0)
+
+ }, 100)
+ }
+})
+
+!process.browser && tape('handle error', function (t) {
+ t.plan(2)
+ fs.createReadStream('/does/not/exist').pipe(BufferList(function (err, data) {
+ t.ok(err instanceof Error, 'has error')
+ t.notOk(data, 'no data')
+ }))
+})
diff --git a/deps/npm/node_modules/request/node_modules/forever-agent/package.json b/deps/npm/node_modules/request/node_modules/forever-agent/package.json
index 1d672c1c9a885e..f57036b527b128 100644
--- a/deps/npm/node_modules/request/node_modules/forever-agent/package.json
+++ b/deps/npm/node_modules/request/node_modules/forever-agent/package.json
@@ -18,14 +18,39 @@
"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",
+ "gitHead": "1b3b6163f2b3c2c4122bbfa288c1325c0df9871d",
"bugs": {
"url": "https://github.com/mikeal/forever-agent/issues"
},
- "homepage": "https://github.com/mikeal/forever-agent#readme",
+ "homepage": "https://github.com/mikeal/forever-agent",
"_id": "forever-agent@0.6.1",
+ "scripts": {},
"_shasum": "fbc71f0c41adeb37f96c577ad1ed42d8fdacca91",
+ "_from": "forever-agent@>=0.6.1 <0.7.0",
+ "_npmVersion": "1.4.28",
+ "_npmUser": {
+ "name": "simov",
+ "email": "simeonvelichkov@gmail.com"
+ },
+ "maintainers": [
+ {
+ "name": "mikeal",
+ "email": "mikeal.rogers@gmail.com"
+ },
+ {
+ "name": "nylen",
+ "email": "jnylen@gmail.com"
+ },
+ {
+ "name": "simov",
+ "email": "simeonvelichkov@gmail.com"
+ }
+ ],
+ "dist": {
+ "shasum": "fbc71f0c41adeb37f96c577ad1ed42d8fdacca91",
+ "tarball": "http://registry.npmjs.org/forever-agent/-/forever-agent-0.6.1.tgz"
+ },
+ "directories": {},
"_resolved": "https://registry.npmjs.org/forever-agent/-/forever-agent-0.6.1.tgz",
- "_from": "forever-agent@>=0.6.1 <0.7.0"
+ "readme": "ERROR: No README data found!"
}
diff --git a/deps/npm/node_modules/request/node_modules/form-data/node_modules/async/CHANGELOG.md b/deps/npm/node_modules/request/node_modules/form-data/node_modules/async/CHANGELOG.md
index b7a40dda522674..fcb2b2c0c90711 100644
--- a/deps/npm/node_modules/request/node_modules/form-data/node_modules/async/CHANGELOG.md
+++ b/deps/npm/node_modules/request/node_modules/form-data/node_modules/async/CHANGELOG.md
@@ -1,3 +1,15 @@
+# v1.5.2
+- Allow using `"consructor"` as an argument in `memoize` (#998)
+- Give a better error messsage when `auto` dependency checking fails (#994)
+- Various doc updates (#936, #956, #979, #1002)
+
+# v1.5.1
+- Fix issue with `pause` in `queue` with concurrency enabled (#946)
+- `while` and `until` now pass the final result to callback (#963)
+- `auto` will properly handle concurrency when there is no callback (#966)
+- `auto` will now properly stop execution when an error occurs (#988, #993)
+- Various doc fixes (#971, #980)
+
# v1.5.0
- Added `transform`, analogous to [`_.transform`](http://lodash.com/docs#transform) (#892)
diff --git a/deps/npm/node_modules/request/node_modules/form-data/node_modules/async/README.md b/deps/npm/node_modules/request/node_modules/form-data/node_modules/async/README.md
index 071d069b761b9d..3a0f017719b309 100644
--- a/deps/npm/node_modules/request/node_modules/form-data/node_modules/async/README.md
+++ b/deps/npm/node_modules/request/node_modules/form-data/node_modules/async/README.md
@@ -627,9 +627,9 @@ __Arguments__
* `iterator(item, callback)` - A truth test to apply to each item in the array
in parallel. The iterator is passed a `callback(truthValue)` which must be
called with a boolean argument once it has completed.
-* `callback(result)` - *Optional* 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.
+* `callback(result)` - *Optional* A callback which is called as soon as any iterator returns
+ `false`, or after all the iterator functions have finished. Result will be
+ either `true` or `false` depending on the values of the async tests.
**Note: the callbacks do not take an error as their first argument.**
@@ -773,7 +773,7 @@ __Arguments__
a `callback(err, result)` which it must call on completion with an error `err`
(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
+ have completed successfully. This function gets a results array (or object) containing all
the result arguments passed to the task callbacks.
__Example__
@@ -834,8 +834,9 @@ __Arguments__
* `fn(callback)` - A function which is called each time `test` passes. The function is
passed a `callback(err)`, which must be called once it has completed with an
optional `err` argument.
-* `callback(err)` - A callback which is called after the test fails and repeated
- execution of `fn` has stopped.
+* `callback(err, [results])` - A callback which is called after the test
+ function has failed and repeated execution of `fn` has stopped. `callback`
+ will be passed an error and any arguments passed to the final `fn`'s callback.
__Example__
@@ -846,10 +847,12 @@ async.whilst(
function () { return count < 5; },
function (callback) {
count++;
- setTimeout(callback, 1000);
+ setTimeout(function () {
+ callback(null, count);
+ }, 1000);
},
- function (err) {
- // 5 seconds have passed
+ function (err, n) {
+ // 5 seconds have passed, n = 5
}
);
```
@@ -870,7 +873,8 @@ the order of operations, the arguments `test` and `fn` are switched.
### until(test, fn, callback)
Repeatedly call `fn` until `test` returns `true`. Calls `callback` when stopped,
-or an error occurs.
+or an error occurs. `callback` will be passed an error and any arguments passed
+to the final `fn`'s callback.
The inverse of [`whilst`](#whilst).
@@ -981,6 +985,52 @@ async.waterfall([
// result now equals 'done'
});
```
+Or, with named functions:
+
+```js
+async.waterfall([
+ myFirstFunction,
+ mySecondFunction,
+ myLastFunction,
+], function (err, result) {
+ // result now equals 'done'
+});
+function myFirstFunction(callback) {
+ callback(null, 'one', 'two');
+}
+function mySecondFunction(arg1, arg2, callback) {
+ // arg1 now equals 'one' and arg2 now equals 'two'
+ callback(null, 'three');
+}
+function myLastFunction(arg1, callback) {
+ // arg1 now equals 'three'
+ callback(null, 'done');
+}
+```
+
+Or, if you need to pass any argument to the first function:
+
+```js
+async.waterfall([
+ async.apply(myFirstFunction, 'zero'),
+ mySecondFunction,
+ myLastFunction,
+], function (err, result) {
+ // result now equals 'done'
+});
+function myFirstFunction(arg1, callback) {
+ // arg1 now equals 'zero'
+ callback(null, 'one', 'two');
+}
+function mySecondFunction(arg1, arg2, callback) {
+ // arg1 now equals 'one' and arg2 now equals 'two'
+ callback(null, 'three');
+}
+function myLastFunction(arg1, callback) {
+ // arg1 now equals 'three'
+ callback(null, 'done');
+}
+```
---------------------------------------
@@ -1395,8 +1445,10 @@ result (if any) of the final attempt.
__Arguments__
-* `opts` - Can be either an object with `times` and `interval` or a number. `times` is how many attempts should be made before giving up. `interval` is how long to wait inbetween attempts. Defaults to {times: 5, interval: 0}
- * if a number is passed in it sets `times` only (with `interval` defaulting to 0).
+* `opts` - Can be either an object with `times` and `interval` or a number.
+ * `times` - The number of attempts to make before giving up. The default is `5`.
+ * `interval` - The time to wait between retries, in milliseconds. The default is `0`.
+ * If `opts` is a number, the number specifies the number of times to retry, with the default interval of `0`.
* `task(callback, results)` - A function which receives two arguments: (1) a `callback(err, result)`
which must be called when finished, passing `err` (which can be `null`) and the `result` of
the function's execution, and (2) a `results` object, containing the results of
@@ -1404,21 +1456,29 @@ __Arguments__
* `callback(err, results)` - An optional callback which is called when the
task has succeeded, or after the final failed attempt. It receives the `err` and `result` arguments of the last attempt at completing the `task`.
-The [`retry`](#retry) function can be used as a stand-alone control flow by passing a
-callback, as shown below:
+The [`retry`](#retry) function can be used as a stand-alone control flow by passing a callback, as shown below:
```js
+// try calling apiMethod 3 times
async.retry(3, apiMethod, function(err, result) {
// do something with the result
});
```
```js
+// try calling apiMethod 3 times, waiting 200 ms between each retry
async.retry({times: 3, interval: 200}, apiMethod, function(err, result) {
// do something with the result
});
```
+```js
+// try calling apiMethod the default 5 times no delay between each retry
+async.retry(apiMethod, function(err, result) {
+ // do something with the result
+});
+```
+
It can also be embedded within other control flow functions to retry individual methods
that are not as reliable, like this:
@@ -1723,6 +1783,32 @@ async.waterfall([
], callback)
```
+If the function passed to `asyncify` returns a Promise, that promises's resolved/rejected state will be used to call the callback, rather than simply the synchronous return value. Example:
+
+```js
+async.waterfall([
+ async.apply(fs.readFile, filename, "utf8"),
+ async.asyncify(function (contents) {
+ return db.model.create(contents);
+ }),
+ function (model, next) {
+ // `model` is the instantiated model object.
+ // If there was an error, this function would be skipped.
+ }
+], callback)
+```
+
+This also means you can asyncify ES2016 `async` functions.
+
+```js
+var q = async.queue(async.asyncify(async function (file) {
+ var intermediateStep = await processFile(file);
+ return await somePromise(intermediateStep)
+}));
+
+q.push(files);
+```
+
---------------------------------------
diff --git a/deps/npm/node_modules/request/node_modules/form-data/node_modules/async/dist/async.js b/deps/npm/node_modules/request/node_modules/form-data/node_modules/async/dist/async.js
index 888934402d32b7..ee0a268e6d7932 100644
--- a/deps/npm/node_modules/request/node_modules/form-data/node_modules/async/dist/async.js
+++ b/deps/npm/node_modules/request/node_modules/form-data/node_modules/async/dist/async.js
@@ -510,7 +510,7 @@
};
async.auto = function (tasks, concurrency, callback) {
- if (!callback) {
+ if (typeof arguments[1] === 'function') {
// concurrency is optional, shift the args.
callback = concurrency;
concurrency = null;
@@ -528,6 +528,8 @@
var results = {};
var runningTasks = 0;
+ var hasError = false;
+
var listeners = [];
function addListener(fn) {
listeners.unshift(fn);
@@ -550,6 +552,7 @@
});
_arrayEach(keys, function (k) {
+ if (hasError) return;
var task = _isArray(tasks[k]) ? tasks[k]: [tasks[k]];
var taskCallback = _restParam(function(err, args) {
runningTasks--;
@@ -562,6 +565,8 @@
safeResults[rkey] = val;
});
safeResults[k] = args;
+ hasError = true;
+
callback(err, safeResults);
}
else {
@@ -575,7 +580,7 @@
var dep;
while (len--) {
if (!(dep = tasks[requires[len]])) {
- throw new Error('Has inexistant dependency');
+ throw new Error('Has nonexistent dependency in ' + requires.join(', '));
}
if (_isArray(dep) && _indexOf(dep, k) >= 0) {
throw new Error('Has cyclic dependencies');
@@ -781,7 +786,7 @@
} else if (test.apply(this, args)) {
iterator(next);
} else {
- callback(null);
+ callback.apply(null, [null].concat(args));
}
});
iterator(next);
@@ -929,24 +934,23 @@
_insert(q, data, true, callback);
},
process: function () {
- if (!q.paused && workers < q.concurrency && q.tasks.length) {
- while(workers < q.concurrency && q.tasks.length){
- var tasks = q.payload ?
- q.tasks.splice(0, q.payload) :
- q.tasks.splice(0, q.tasks.length);
-
- var data = _map(tasks, function (task) {
- return task.data;
- });
+ while(!q.paused && workers < q.concurrency && q.tasks.length){
- if (q.tasks.length === 0) {
- q.empty();
- }
- workers += 1;
- workersList.push(tasks[0]);
- var cb = only_once(_next(q, tasks));
- worker(data, cb);
+ var tasks = q.payload ?
+ q.tasks.splice(0, q.payload) :
+ q.tasks.splice(0, q.tasks.length);
+
+ var data = _map(tasks, function (task) {
+ return task.data;
+ });
+
+ if (q.tasks.length === 0) {
+ q.empty();
}
+ workers += 1;
+ workersList.push(tasks[0]);
+ var cb = only_once(_next(q, tasks));
+ worker(data, cb);
}
},
length: function () {
@@ -1081,16 +1085,17 @@
async.memoize = function (fn, hasher) {
var memo = {};
var queues = {};
+ var has = Object.prototype.hasOwnProperty;
hasher = hasher || identity;
var memoized = _restParam(function memoized(args) {
var callback = args.pop();
var key = hasher.apply(null, args);
- if (key in memo) {
+ if (has.call(memo, key)) {
async.setImmediate(function () {
callback.apply(null, memo[key]);
});
}
- else if (key in queues) {
+ else if (has.call(queues, key)) {
queues[key].push(callback);
}
else {
diff --git a/deps/npm/node_modules/request/node_modules/form-data/node_modules/async/dist/async.min.js b/deps/npm/node_modules/request/node_modules/form-data/node_modules/async/dist/async.min.js
index b947fc48926004..2490016a06f95b 100644
--- a/deps/npm/node_modules/request/node_modules/form-data/node_modules/async/dist/async.min.js
+++ b/deps/npm/node_modules/request/node_modules/form-data/node_modules/async/dist/async.min.js
@@ -1,2 +1,2 @@
-!function(){function n(){}function t(n){return n}function e(n){return!!n}function r(n){return!n}function u(n){return function(){if(null===n)throw new Error("Callback was already called.");n.apply(this,arguments),n=null}}function i(n){return function(){null!==n&&(n.apply(this,arguments),n=null)}}function o(n){return M(n)||"number"==typeof n.length&&n.length>=0&&n.length%1===0}function c(n,t){for(var e=-1,r=n.length;++er?r:null}):(e=W(n),t=e.length,function(){return r++,t>r?e[r]:null})}function m(n,t){return t=null==t?n.length-1:+t,function(){for(var e=Math.max(arguments.length-t,0),r=Array(e),u=0;e>u;u++)r[u]=arguments[u+t];switch(t){case 0:return n.call(this,r);case 1:return n.call(this,arguments[0],r)}}}function y(n){return function(t,e,r){return n(t,r)}}function v(t){return function(e,r,o){o=i(o||n),e=e||[];var c=h(e);if(0>=t)return o(null);var a=!1,f=0,l=!1;!function s(){if(a&&0>=f)return o(null);for(;t>f&&!l;){var n=c();if(null===n)return a=!0,void(0>=f&&o(null));f+=1,r(e[n],n,u(function(n){f-=1,n?(o(n),l=!0):s()}))}}()}}function d(n){return function(t,e,r){return n(C.eachOf,t,e,r)}}function g(n){return function(t,e,r,u){return n(v(e),t,r,u)}}function k(n){return function(t,e,r){return n(C.eachOfSeries,t,e,r)}}function b(t,e,r,u){u=i(u||n),e=e||[];var c=o(e)?[]:{};t(e,function(n,t,e){r(n,function(n,r){c[t]=r,e(n)})},function(n){u(n,c)})}function w(n,t,e,r){var u=[];n(t,function(n,t,r){e(n,function(e){e&&u.push({index:t,value:n}),r()})},function(){r(a(u.sort(function(n,t){return n.index-t.index}),function(n){return n.value}))})}function O(n,t,e,r){w(n,t,function(n,t){e(n,function(n){t(!n)})},r)}function S(n,t,e){return function(r,u,i,o){function c(){o&&o(e(!1,void 0))}function a(n,r,u){return o?void i(n,function(r){o&&t(r)&&(o(e(!0,n)),o=i=!1),u()}):u()}arguments.length>3?n(r,u,a,c):(o=i,i=u,n(r,a,c))}}function E(n,t){return t}function L(t,e,r){r=r||n;var u=o(e)?[]:{};t(e,function(n,t,e){n(m(function(n,r){r.length<=1&&(r=r[0]),u[t]=r,e(n)}))},function(n){r(n,u)})}function I(n,t,e,r){var u=[];n(t,function(n,t,r){e(n,function(n,t){u=u.concat(t||[]),r(n)})},function(n){r(n,u)})}function x(t,e,r){function i(t,e,r,u){if(null!=u&&"function"!=typeof u)throw new Error("task callback must be a function");return t.started=!0,M(e)||(e=[e]),0===e.length&&t.idle()?C.setImmediate(function(){t.drain()}):(c(e,function(e){var i={data:e,callback:u||n};r?t.tasks.unshift(i):t.tasks.push(i),t.tasks.length===t.concurrency&&t.saturated()}),void C.setImmediate(t.process))}function o(n,t){return function(){f-=1;var e=!1,r=arguments;c(t,function(n){c(l,function(t,r){t!==n||e||(l.splice(r,1),e=!0)}),n.callback.apply(n,r)}),n.tasks.length+f===0&&n.drain(),n.process()}}if(null==e)e=1;else if(0===e)throw new Error("Concurrency must not be zero");var f=0,l=[],s={tasks:[],concurrency:e,payload:r,saturated:n,empty:n,drain:n,started:!1,paused:!1,push:function(n,t){i(s,n,!1,t)},kill:function(){s.drain=n,s.tasks=[]},unshift:function(n,t){i(s,n,!0,t)},process:function(){if(!s.paused&&f=t;t++)C.setImmediate(s.process)}}};return s}function j(n){return m(function(t,e){t.apply(null,e.concat([m(function(t,e){"object"==typeof console&&(t?console.error&&console.error(t):console[n]&&c(e,function(t){console[n](t)}))})]))})}function A(n){return function(t,e,r){n(f(t),e,r)}}function T(n){return m(function(t,e){var r=m(function(e){var r=this,u=e.pop();return n(t,function(n,t,u){n.apply(r,e.concat([u]))},u)});return e.length?r.apply(this,e):r})}function z(n){return m(function(t){var e=t.pop();t.push(function(){var n=arguments;r?C.setImmediate(function(){e.apply(null,n)}):e.apply(null,n)});var r=!0;n.apply(this,t),r=!1})}var q,C={},P="object"==typeof self&&self.self===self&&self||"object"==typeof global&&global.global===global&&global||this;null!=P&&(q=P.async),C.noConflict=function(){return P.async=q,C};var H=Object.prototype.toString,M=Array.isArray||function(n){return"[object Array]"===H.call(n)},U=function(n){var t=typeof n;return"function"===t||"object"===t&&!!n},W=Object.keys||function(n){var t=[];for(var e in n)n.hasOwnProperty(e)&&t.push(e);return t},B="function"==typeof setImmediate&&setImmediate,D=B?function(n){B(n)}:function(n){setTimeout(n,0)};"object"==typeof process&&"function"==typeof process.nextTick?C.nextTick=process.nextTick:C.nextTick=D,C.setImmediate=B?D:C.nextTick,C.forEach=C.each=function(n,t,e){return C.eachOf(n,y(t),e)},C.forEachSeries=C.eachSeries=function(n,t,e){return C.eachOfSeries(n,y(t),e)},C.forEachLimit=C.eachLimit=function(n,t,e,r){return v(t)(n,y(e),r)},C.forEachOf=C.eachOf=function(t,e,r){function o(n){f--,n?r(n):null===c&&0>=f&&r(null)}r=i(r||n),t=t||[];for(var c,a=h(t),f=0;null!=(c=a());)f+=1,e(t[c],c,u(o));0===f&&r(null)},C.forEachOfSeries=C.eachOfSeries=function(t,e,r){function o(){var n=!0;return null===a?r(null):(e(t[a],a,u(function(t){if(t)r(t);else{if(a=c(),null===a)return r(null);n?C.setImmediate(o):o()}})),void(n=!1))}r=i(r||n),t=t||[];var c=h(t),a=c();o()},C.forEachOfLimit=C.eachOfLimit=function(n,t,e,r){v(t)(n,e,r)},C.map=d(b),C.mapSeries=k(b),C.mapLimit=g(b),C.inject=C.foldl=C.reduce=function(n,t,e,r){C.eachOfSeries(n,function(n,r,u){e(t,n,function(n,e){t=e,u(n)})},function(n){r(n,t)})},C.foldr=C.reduceRight=function(n,e,r,u){var i=a(n,t).reverse();C.reduce(i,e,r,u)},C.transform=function(n,t,e,r){3===arguments.length&&(r=e,e=t,t=M(n)?[]:{}),C.eachOf(n,function(n,r,u){e(t,n,r,u)},function(n){r(n,t)})},C.select=C.filter=d(w),C.selectLimit=C.filterLimit=g(w),C.selectSeries=C.filterSeries=k(w),C.reject=d(O),C.rejectLimit=g(O),C.rejectSeries=k(O),C.any=C.some=S(C.eachOf,e,t),C.someLimit=S(C.eachOfLimit,e,t),C.all=C.every=S(C.eachOf,r,r),C.everyLimit=S(C.eachOfLimit,r,r),C.detect=S(C.eachOf,t,E),C.detectSeries=S(C.eachOfSeries,t,E),C.detectLimit=S(C.eachOfLimit,t,E),C.sortBy=function(n,t,e){function r(n,t){var e=n.criteria,r=t.criteria;return r>e?-1:e>r?1:0}C.map(n,function(n,e){t(n,function(t,r){t?e(t):e(null,{value:n,criteria:r})})},function(n,t){return n?e(n):void e(null,a(t.sort(r),function(n){return n.value}))})},C.auto=function(t,e,r){function u(n){d.unshift(n)}function o(n){var t=p(d,n);t>=0&&d.splice(t,1)}function a(){h--,c(d.slice(0),function(n){n()})}r||(r=e,e=null),r=i(r||n);var f=W(t),h=f.length;if(!h)return r(null);e||(e=h);var y={},v=0,d=[];u(function(){h||r(null,y)}),c(f,function(n){function i(){return e>v&&l(g,function(n,t){return n&&y.hasOwnProperty(t)},!0)&&!y.hasOwnProperty(n)}function c(){i()&&(v++,o(c),h[h.length-1](d,y))}for(var f,h=M(t[n])?t[n]:[t[n]],d=m(function(t,e){if(v--,e.length<=1&&(e=e[0]),t){var u={};s(y,function(n,t){u[t]=n}),u[n]=e,r(t,u)}else y[n]=e,C.setImmediate(a)}),g=h.slice(0,h.length-1),k=g.length;k--;){if(!(f=t[g[k]]))throw new Error("Has inexistant dependency");if(M(f)&&p(f,n)>=0)throw new Error("Has cyclic dependencies")}i()?(v++,h[h.length-1](d,y)):u(c)})},C.retry=function(n,t,e){function r(n,t){if("number"==typeof t)n.times=parseInt(t,10)||i;else{if("object"!=typeof t)throw new Error("Unsupported argument type for 'times': "+typeof t);n.times=parseInt(t.times,10)||i,n.interval=parseInt(t.interval,10)||o}}function u(n,t){function e(n,e){return function(r){n(function(n,t){r(!n||e,{err:n,result:t})},t)}}function r(n){return function(t){setTimeout(function(){t(null)},n)}}for(;a.times;){var u=!(a.times-=1);c.push(e(a.task,u)),!u&&a.interval>0&&c.push(r(a.interval))}C.series(c,function(t,e){e=e[e.length-1],(n||a.callback)(e.err,e.result)})}var i=5,o=0,c=[],a={times:i,interval:o},f=arguments.length;if(1>f||f>3)throw new Error("Invalid arguments - must be either (task), (task, callback), (times, task) or (times, task, callback)");return 2>=f&&"function"==typeof n&&(e=t,t=n),"function"!=typeof n&&r(a,n),a.callback=e,a.task=t,a.callback?u():u},C.waterfall=function(t,e){function r(n){return m(function(t,u){if(t)e.apply(null,[t].concat(u));else{var i=n.next();i?u.push(r(i)):u.push(e),z(n).apply(null,u)}})}if(e=i(e||n),!M(t)){var u=new Error("First argument to waterfall must be an array of functions");return e(u)}return t.length?void r(C.iterator(t))():e()},C.parallel=function(n,t){L(C.eachOf,n,t)},C.parallelLimit=function(n,t,e){L(v(t),n,e)},C.series=function(n,t){L(C.eachOfSeries,n,t)},C.iterator=function(n){function t(e){function r(){return n.length&&n[e].apply(null,arguments),r.next()}return r.next=function(){return er;){var i=r+(u-r+1>>>1);e(t,n[i])>=0?r=i:u=i-1}return r}function i(t,e,i,o){if(null!=o&&"function"!=typeof o)throw new Error("task callback must be a function");return t.started=!0,M(e)||(e=[e]),0===e.length?C.setImmediate(function(){t.drain()}):void c(e,function(e){var c={data:e,priority:i,callback:"function"==typeof o?o:n};t.tasks.splice(u(t.tasks,c,r)+1,0,c),t.tasks.length===t.concurrency&&t.saturated(),C.setImmediate(t.process)})}var o=C.queue(t,e);return o.push=function(n,t,e){i(o,n,t,e)},delete o.unshift,o},C.cargo=function(n,t){return x(n,1,t)},C.log=j("log"),C.dir=j("dir"),C.memoize=function(n,e){var r={},u={};e=e||t;var i=m(function(t){var i=t.pop(),o=e.apply(null,t);o in r?C.setImmediate(function(){i.apply(null,r[o])}):o in u?u[o].push(i):(u[o]=[i],n.apply(null,t.concat([m(function(n){r[o]=n;var t=u[o];delete u[o];for(var e=0,i=t.length;i>e;e++)t[e].apply(null,n)})])))});return i.memo=r,i.unmemoized=n,i},C.unmemoize=function(n){return function(){return(n.unmemoized||n).apply(null,arguments)}},C.times=A(C.map),C.timesSeries=A(C.mapSeries),C.timesLimit=function(n,t,e,r){return C.mapLimit(f(n),t,e,r)},C.seq=function(){var t=arguments;return m(function(e){var r=this,u=e[e.length-1];"function"==typeof u?e.pop():u=n,C.reduce(t,e,function(n,t,e){t.apply(r,n.concat([m(function(n,t){e(n,t)})]))},function(n,t){u.apply(r,[n].concat(t))})})},C.compose=function(){return C.seq.apply(null,Array.prototype.reverse.call(arguments))},C.applyEach=T(C.eachOf),C.applyEachSeries=T(C.eachOfSeries),C.forever=function(t,e){function r(n){return n?i(n):void o(r)}var i=u(e||n),o=z(t);r()},C.ensureAsync=z,C.constant=m(function(n){var t=[null].concat(n);return function(n){return n.apply(this,t)}}),C.wrapSync=C.asyncify=function(n){return m(function(t){var e,r=t.pop();try{e=n.apply(this,t)}catch(u){return r(u)}U(e)&&"function"==typeof e.then?e.then(function(n){r(null,n)})["catch"](function(n){r(n.message?n:new Error(n))}):r(null,e)})},"object"==typeof module&&module.exports?module.exports=C:"function"==typeof define&&define.amd?define([],function(){return C}):P.async=C}();
+!function(){function n(){}function t(n){return n}function e(n){return!!n}function r(n){return!n}function u(n){return function(){if(null===n)throw new Error("Callback was already called.");n.apply(this,arguments),n=null}}function i(n){return function(){null!==n&&(n.apply(this,arguments),n=null)}}function o(n){return M(n)||"number"==typeof n.length&&n.length>=0&&n.length%1===0}function c(n,t){for(var e=-1,r=n.length;++er?r:null}):(e=W(n),t=e.length,function(){return r++,t>r?e[r]:null})}function m(n,t){return t=null==t?n.length-1:+t,function(){for(var e=Math.max(arguments.length-t,0),r=Array(e),u=0;e>u;u++)r[u]=arguments[u+t];switch(t){case 0:return n.call(this,r);case 1:return n.call(this,arguments[0],r)}}}function y(n){return function(t,e,r){return n(t,r)}}function v(t){return function(e,r,o){o=i(o||n),e=e||[];var c=h(e);if(0>=t)return o(null);var a=!1,f=0,l=!1;!function s(){if(a&&0>=f)return o(null);for(;t>f&&!l;){var n=c();if(null===n)return a=!0,void(0>=f&&o(null));f+=1,r(e[n],n,u(function(n){f-=1,n?(o(n),l=!0):s()}))}}()}}function d(n){return function(t,e,r){return n(P.eachOf,t,e,r)}}function g(n){return function(t,e,r,u){return n(v(e),t,r,u)}}function k(n){return function(t,e,r){return n(P.eachOfSeries,t,e,r)}}function b(t,e,r,u){u=i(u||n),e=e||[];var c=o(e)?[]:{};t(e,function(n,t,e){r(n,function(n,r){c[t]=r,e(n)})},function(n){u(n,c)})}function w(n,t,e,r){var u=[];n(t,function(n,t,r){e(n,function(e){e&&u.push({index:t,value:n}),r()})},function(){r(a(u.sort(function(n,t){return n.index-t.index}),function(n){return n.value}))})}function O(n,t,e,r){w(n,t,function(n,t){e(n,function(n){t(!n)})},r)}function S(n,t,e){return function(r,u,i,o){function c(){o&&o(e(!1,void 0))}function a(n,r,u){return o?void i(n,function(r){o&&t(r)&&(o(e(!0,n)),o=i=!1),u()}):u()}arguments.length>3?n(r,u,a,c):(o=i,i=u,n(r,a,c))}}function E(n,t){return t}function L(t,e,r){r=r||n;var u=o(e)?[]:{};t(e,function(n,t,e){n(m(function(n,r){r.length<=1&&(r=r[0]),u[t]=r,e(n)}))},function(n){r(n,u)})}function j(n,t,e,r){var u=[];n(t,function(n,t,r){e(n,function(n,t){u=u.concat(t||[]),r(n)})},function(n){r(n,u)})}function I(t,e,r){function i(t,e,r,u){if(null!=u&&"function"!=typeof u)throw new Error("task callback must be a function");return t.started=!0,M(e)||(e=[e]),0===e.length&&t.idle()?P.setImmediate(function(){t.drain()}):(c(e,function(e){var i={data:e,callback:u||n};r?t.tasks.unshift(i):t.tasks.push(i),t.tasks.length===t.concurrency&&t.saturated()}),void P.setImmediate(t.process))}function o(n,t){return function(){f-=1;var e=!1,r=arguments;c(t,function(n){c(l,function(t,r){t!==n||e||(l.splice(r,1),e=!0)}),n.callback.apply(n,r)}),n.tasks.length+f===0&&n.drain(),n.process()}}if(null==e)e=1;else if(0===e)throw new Error("Concurrency must not be zero");var f=0,l=[],s={tasks:[],concurrency:e,payload:r,saturated:n,empty:n,drain:n,started:!1,paused:!1,push:function(n,t){i(s,n,!1,t)},kill:function(){s.drain=n,s.tasks=[]},unshift:function(n,t){i(s,n,!0,t)},process:function(){for(;!s.paused&&f=t;t++)P.setImmediate(s.process)}}};return s}function x(n){return m(function(t,e){t.apply(null,e.concat([m(function(t,e){"object"==typeof console&&(t?console.error&&console.error(t):console[n]&&c(e,function(t){console[n](t)}))})]))})}function A(n){return function(t,e,r){n(f(t),e,r)}}function T(n){return m(function(t,e){var r=m(function(e){var r=this,u=e.pop();return n(t,function(n,t,u){n.apply(r,e.concat([u]))},u)});return e.length?r.apply(this,e):r})}function z(n){return m(function(t){var e=t.pop();t.push(function(){var n=arguments;r?P.setImmediate(function(){e.apply(null,n)}):e.apply(null,n)});var r=!0;n.apply(this,t),r=!1})}var q,P={},C="object"==typeof self&&self.self===self&&self||"object"==typeof global&&global.global===global&&global||this;null!=C&&(q=C.async),P.noConflict=function(){return C.async=q,P};var H=Object.prototype.toString,M=Array.isArray||function(n){return"[object Array]"===H.call(n)},U=function(n){var t=typeof n;return"function"===t||"object"===t&&!!n},W=Object.keys||function(n){var t=[];for(var e in n)n.hasOwnProperty(e)&&t.push(e);return t},B="function"==typeof setImmediate&&setImmediate,D=B?function(n){B(n)}:function(n){setTimeout(n,0)};"object"==typeof process&&"function"==typeof process.nextTick?P.nextTick=process.nextTick:P.nextTick=D,P.setImmediate=B?D:P.nextTick,P.forEach=P.each=function(n,t,e){return P.eachOf(n,y(t),e)},P.forEachSeries=P.eachSeries=function(n,t,e){return P.eachOfSeries(n,y(t),e)},P.forEachLimit=P.eachLimit=function(n,t,e,r){return v(t)(n,y(e),r)},P.forEachOf=P.eachOf=function(t,e,r){function o(n){f--,n?r(n):null===c&&0>=f&&r(null)}r=i(r||n),t=t||[];for(var c,a=h(t),f=0;null!=(c=a());)f+=1,e(t[c],c,u(o));0===f&&r(null)},P.forEachOfSeries=P.eachOfSeries=function(t,e,r){function o(){var n=!0;return null===a?r(null):(e(t[a],a,u(function(t){if(t)r(t);else{if(a=c(),null===a)return r(null);n?P.setImmediate(o):o()}})),void(n=!1))}r=i(r||n),t=t||[];var c=h(t),a=c();o()},P.forEachOfLimit=P.eachOfLimit=function(n,t,e,r){v(t)(n,e,r)},P.map=d(b),P.mapSeries=k(b),P.mapLimit=g(b),P.inject=P.foldl=P.reduce=function(n,t,e,r){P.eachOfSeries(n,function(n,r,u){e(t,n,function(n,e){t=e,u(n)})},function(n){r(n,t)})},P.foldr=P.reduceRight=function(n,e,r,u){var i=a(n,t).reverse();P.reduce(i,e,r,u)},P.transform=function(n,t,e,r){3===arguments.length&&(r=e,e=t,t=M(n)?[]:{}),P.eachOf(n,function(n,r,u){e(t,n,r,u)},function(n){r(n,t)})},P.select=P.filter=d(w),P.selectLimit=P.filterLimit=g(w),P.selectSeries=P.filterSeries=k(w),P.reject=d(O),P.rejectLimit=g(O),P.rejectSeries=k(O),P.any=P.some=S(P.eachOf,e,t),P.someLimit=S(P.eachOfLimit,e,t),P.all=P.every=S(P.eachOf,r,r),P.everyLimit=S(P.eachOfLimit,r,r),P.detect=S(P.eachOf,t,E),P.detectSeries=S(P.eachOfSeries,t,E),P.detectLimit=S(P.eachOfLimit,t,E),P.sortBy=function(n,t,e){function r(n,t){var e=n.criteria,r=t.criteria;return r>e?-1:e>r?1:0}P.map(n,function(n,e){t(n,function(t,r){t?e(t):e(null,{value:n,criteria:r})})},function(n,t){return n?e(n):void e(null,a(t.sort(r),function(n){return n.value}))})},P.auto=function(t,e,r){function u(n){g.unshift(n)}function o(n){var t=p(g,n);t>=0&&g.splice(t,1)}function a(){h--,c(g.slice(0),function(n){n()})}"function"==typeof arguments[1]&&(r=e,e=null),r=i(r||n);var f=W(t),h=f.length;if(!h)return r(null);e||(e=h);var y={},v=0,d=!1,g=[];u(function(){h||r(null,y)}),c(f,function(n){function i(){return e>v&&l(k,function(n,t){return n&&y.hasOwnProperty(t)},!0)&&!y.hasOwnProperty(n)}function c(){i()&&(v++,o(c),h[h.length-1](g,y))}if(!d){for(var f,h=M(t[n])?t[n]:[t[n]],g=m(function(t,e){if(v--,e.length<=1&&(e=e[0]),t){var u={};s(y,function(n,t){u[t]=n}),u[n]=e,d=!0,r(t,u)}else y[n]=e,P.setImmediate(a)}),k=h.slice(0,h.length-1),b=k.length;b--;){if(!(f=t[k[b]]))throw new Error("Has nonexistent dependency in "+k.join(", "));if(M(f)&&p(f,n)>=0)throw new Error("Has cyclic dependencies")}i()?(v++,h[h.length-1](g,y)):u(c)}})},P.retry=function(n,t,e){function r(n,t){if("number"==typeof t)n.times=parseInt(t,10)||i;else{if("object"!=typeof t)throw new Error("Unsupported argument type for 'times': "+typeof t);n.times=parseInt(t.times,10)||i,n.interval=parseInt(t.interval,10)||o}}function u(n,t){function e(n,e){return function(r){n(function(n,t){r(!n||e,{err:n,result:t})},t)}}function r(n){return function(t){setTimeout(function(){t(null)},n)}}for(;a.times;){var u=!(a.times-=1);c.push(e(a.task,u)),!u&&a.interval>0&&c.push(r(a.interval))}P.series(c,function(t,e){e=e[e.length-1],(n||a.callback)(e.err,e.result)})}var i=5,o=0,c=[],a={times:i,interval:o},f=arguments.length;if(1>f||f>3)throw new Error("Invalid arguments - must be either (task), (task, callback), (times, task) or (times, task, callback)");return 2>=f&&"function"==typeof n&&(e=t,t=n),"function"!=typeof n&&r(a,n),a.callback=e,a.task=t,a.callback?u():u},P.waterfall=function(t,e){function r(n){return m(function(t,u){if(t)e.apply(null,[t].concat(u));else{var i=n.next();i?u.push(r(i)):u.push(e),z(n).apply(null,u)}})}if(e=i(e||n),!M(t)){var u=new Error("First argument to waterfall must be an array of functions");return e(u)}return t.length?void r(P.iterator(t))():e()},P.parallel=function(n,t){L(P.eachOf,n,t)},P.parallelLimit=function(n,t,e){L(v(t),n,e)},P.series=function(n,t){L(P.eachOfSeries,n,t)},P.iterator=function(n){function t(e){function r(){return n.length&&n[e].apply(null,arguments),r.next()}return r.next=function(){return er;){var i=r+(u-r+1>>>1);e(t,n[i])>=0?r=i:u=i-1}return r}function i(t,e,i,o){if(null!=o&&"function"!=typeof o)throw new Error("task callback must be a function");return t.started=!0,M(e)||(e=[e]),0===e.length?P.setImmediate(function(){t.drain()}):void c(e,function(e){var c={data:e,priority:i,callback:"function"==typeof o?o:n};t.tasks.splice(u(t.tasks,c,r)+1,0,c),t.tasks.length===t.concurrency&&t.saturated(),P.setImmediate(t.process)})}var o=P.queue(t,e);return o.push=function(n,t,e){i(o,n,t,e)},delete o.unshift,o},P.cargo=function(n,t){return I(n,1,t)},P.log=x("log"),P.dir=x("dir"),P.memoize=function(n,e){var r={},u={},i=Object.prototype.hasOwnProperty;e=e||t;var o=m(function(t){var o=t.pop(),c=e.apply(null,t);i.call(r,c)?P.setImmediate(function(){o.apply(null,r[c])}):i.call(u,c)?u[c].push(o):(u[c]=[o],n.apply(null,t.concat([m(function(n){r[c]=n;var t=u[c];delete u[c];for(var e=0,i=t.length;i>e;e++)t[e].apply(null,n)})])))});return o.memo=r,o.unmemoized=n,o},P.unmemoize=function(n){return function(){return(n.unmemoized||n).apply(null,arguments)}},P.times=A(P.map),P.timesSeries=A(P.mapSeries),P.timesLimit=function(n,t,e,r){return P.mapLimit(f(n),t,e,r)},P.seq=function(){var t=arguments;return m(function(e){var r=this,u=e[e.length-1];"function"==typeof u?e.pop():u=n,P.reduce(t,e,function(n,t,e){t.apply(r,n.concat([m(function(n,t){e(n,t)})]))},function(n,t){u.apply(r,[n].concat(t))})})},P.compose=function(){return P.seq.apply(null,Array.prototype.reverse.call(arguments))},P.applyEach=T(P.eachOf),P.applyEachSeries=T(P.eachOfSeries),P.forever=function(t,e){function r(n){return n?i(n):void o(r)}var i=u(e||n),o=z(t);r()},P.ensureAsync=z,P.constant=m(function(n){var t=[null].concat(n);return function(n){return n.apply(this,t)}}),P.wrapSync=P.asyncify=function(n){return m(function(t){var e,r=t.pop();try{e=n.apply(this,t)}catch(u){return r(u)}U(e)&&"function"==typeof e.then?e.then(function(n){r(null,n)})["catch"](function(n){r(n.message?n:new Error(n))}):r(null,e)})},"object"==typeof module&&module.exports?module.exports=P:"function"==typeof define&&define.amd?define([],function(){return P}):C.async=P}();
//# sourceMappingURL=dist/async.min.map
\ No newline at end of file
diff --git a/deps/npm/node_modules/request/node_modules/form-data/node_modules/async/lib/async.js b/deps/npm/node_modules/request/node_modules/form-data/node_modules/async/lib/async.js
index 888934402d32b7..ee0a268e6d7932 100644
--- a/deps/npm/node_modules/request/node_modules/form-data/node_modules/async/lib/async.js
+++ b/deps/npm/node_modules/request/node_modules/form-data/node_modules/async/lib/async.js
@@ -510,7 +510,7 @@
};
async.auto = function (tasks, concurrency, callback) {
- if (!callback) {
+ if (typeof arguments[1] === 'function') {
// concurrency is optional, shift the args.
callback = concurrency;
concurrency = null;
@@ -528,6 +528,8 @@
var results = {};
var runningTasks = 0;
+ var hasError = false;
+
var listeners = [];
function addListener(fn) {
listeners.unshift(fn);
@@ -550,6 +552,7 @@
});
_arrayEach(keys, function (k) {
+ if (hasError) return;
var task = _isArray(tasks[k]) ? tasks[k]: [tasks[k]];
var taskCallback = _restParam(function(err, args) {
runningTasks--;
@@ -562,6 +565,8 @@
safeResults[rkey] = val;
});
safeResults[k] = args;
+ hasError = true;
+
callback(err, safeResults);
}
else {
@@ -575,7 +580,7 @@
var dep;
while (len--) {
if (!(dep = tasks[requires[len]])) {
- throw new Error('Has inexistant dependency');
+ throw new Error('Has nonexistent dependency in ' + requires.join(', '));
}
if (_isArray(dep) && _indexOf(dep, k) >= 0) {
throw new Error('Has cyclic dependencies');
@@ -781,7 +786,7 @@
} else if (test.apply(this, args)) {
iterator(next);
} else {
- callback(null);
+ callback.apply(null, [null].concat(args));
}
});
iterator(next);
@@ -929,24 +934,23 @@
_insert(q, data, true, callback);
},
process: function () {
- if (!q.paused && workers < q.concurrency && q.tasks.length) {
- while(workers < q.concurrency && q.tasks.length){
- var tasks = q.payload ?
- q.tasks.splice(0, q.payload) :
- q.tasks.splice(0, q.tasks.length);
-
- var data = _map(tasks, function (task) {
- return task.data;
- });
+ while(!q.paused && workers < q.concurrency && q.tasks.length){
- if (q.tasks.length === 0) {
- q.empty();
- }
- workers += 1;
- workersList.push(tasks[0]);
- var cb = only_once(_next(q, tasks));
- worker(data, cb);
+ var tasks = q.payload ?
+ q.tasks.splice(0, q.payload) :
+ q.tasks.splice(0, q.tasks.length);
+
+ var data = _map(tasks, function (task) {
+ return task.data;
+ });
+
+ if (q.tasks.length === 0) {
+ q.empty();
}
+ workers += 1;
+ workersList.push(tasks[0]);
+ var cb = only_once(_next(q, tasks));
+ worker(data, cb);
}
},
length: function () {
@@ -1081,16 +1085,17 @@
async.memoize = function (fn, hasher) {
var memo = {};
var queues = {};
+ var has = Object.prototype.hasOwnProperty;
hasher = hasher || identity;
var memoized = _restParam(function memoized(args) {
var callback = args.pop();
var key = hasher.apply(null, args);
- if (key in memo) {
+ if (has.call(memo, key)) {
async.setImmediate(function () {
callback.apply(null, memo[key]);
});
}
- else if (key in queues) {
+ else if (has.call(queues, key)) {
queues[key].push(callback);
}
else {
diff --git a/deps/npm/node_modules/request/node_modules/form-data/node_modules/async/package.json b/deps/npm/node_modules/request/node_modules/form-data/node_modules/async/package.json
index 4460b7d34ce74e..369755e2948420 100644
--- a/deps/npm/node_modules/request/node_modules/form-data/node_modules/async/package.json
+++ b/deps/npm/node_modules/request/node_modules/form-data/node_modules/async/package.json
@@ -10,7 +10,7 @@
"author": {
"name": "Caolan McMahon"
},
- "version": "1.5.0",
+ "version": "1.5.2",
"keywords": [
"async",
"callback",
@@ -84,13 +84,13 @@
"tests"
]
},
- "gitHead": "621f13805aa326865b85dbbf7128baf7146ab976",
+ "gitHead": "9ab5c67b7cb3a4c3dad4a2d4552a2f6775545d6c",
"homepage": "https://github.com/caolan/async#readme",
- "_id": "async@1.5.0",
- "_shasum": "2796642723573859565633fc6274444bee2f8ce3",
+ "_id": "async@1.5.2",
+ "_shasum": "ec6a61ae56480c0c3cb241c95618e20892f9672a",
"_from": "async@>=1.4.0 <2.0.0",
- "_npmVersion": "2.14.2",
- "_nodeVersion": "0.10.26",
+ "_npmVersion": "3.5.2",
+ "_nodeVersion": "4.2.3",
"_npmUser": {
"name": "aearly",
"email": "alexander.early@gmail.com"
@@ -114,10 +114,10 @@
}
],
"dist": {
- "shasum": "2796642723573859565633fc6274444bee2f8ce3",
- "tarball": "http://registry.npmjs.org/async/-/async-1.5.0.tgz"
+ "shasum": "ec6a61ae56480c0c3cb241c95618e20892f9672a",
+ "tarball": "http://registry.npmjs.org/async/-/async-1.5.2.tgz"
},
"directories": {},
- "_resolved": "https://registry.npmjs.org/async/-/async-1.5.0.tgz",
+ "_resolved": "https://registry.npmjs.org/async/-/async-1.5.2.tgz",
"readme": "ERROR: No README data found!"
}
diff --git a/deps/npm/node_modules/request/node_modules/har-validator/README.md b/deps/npm/node_modules/request/node_modules/har-validator/README.md
index 2399b316e07e00..91526e6ddb666b 100644
--- a/deps/npm/node_modules/request/node_modules/har-validator/README.md
+++ b/deps/npm/node_modules/request/node_modules/har-validator/README.md
@@ -52,16 +52,9 @@ har-validator --schema request request.json
a full [HAR](http://www.softwareishard.com/blog/har-12-spec/) object
```js
-var HAR = require('./har.json')
-var validate = require('har-validator')
-
-validate(HAR)
- .then(function (HAR) {
- console.log('horray!')
- })
- .catch(function (error) {
- console.error(error)
- })
+validate(data)
+ .then(data => console.log('horray!'))
+ .catch(console.error)
```
### Validate.log(data)
@@ -72,14 +65,9 @@ validate(HAR)
a [log](http://www.softwareishard.com/blog/har-12-spec/#log) object
```js
-var validate = require('har-validator')
-
-validate.log(data.then(function (HAR) {
- console.log('horray!')
- })
- .catch(function (error) {
- console.error(error)
- })
+validate.log(data)
+ .then(data => console.log('horray!'))
+ .catch(console.error)
```
### Validate.cache(data)
@@ -90,14 +78,9 @@ validate.log(data.then(function (HAR) {
a [cache](http://www.softwareishard.com/blog/har-12-spec/#cache) object
```js
-var validate = require('har-validator')
-
-validate.cache(data.then(function (HAR) {
- console.log('horray!')
- })
- .catch(function (error) {
- console.error(error)
- })
+validate.cache(data)
+ .then(data => console.log('horray!'))
+ .catch(console.error)
```
### Validate.cacheEntry(data)
@@ -108,14 +91,9 @@ validate.cache(data.then(function (HAR) {
a ["beforeRequest" or "afterRequest"](http://www.softwareishard.com/blog/har-12-spec/#cache) objects
```js
-var validate = require('har-validator')
-
-validate.cacheEntry(data.then(function (HAR) {
- console.log('horray!')
- })
- .catch(function (error) {
- console.error(error)
- })
+validate.cacheEntry(data)
+ .then(data => console.log('horray!'))
+ .catch(console.error)
```
### Validate.content(data)
@@ -126,14 +104,9 @@ validate.cacheEntry(data.then(function (HAR) {
a [content](http://www.softwareishard.com/blog/har-12-spec/#content) object
```js
-var validate = require('har-validator')
-
-validate.content(data.then(function (HAR) {
- console.log('horray!')
- })
- .catch(function (error) {
- console.error(error)
- })
+validate.content(data)
+ .then(data => console.log('horray!'))
+ .catch(console.error)
```
### Validate.cookie(data)
@@ -144,14 +117,9 @@ validate.content(data.then(function (HAR) {
a [cookie](http://www.softwareishard.com/blog/har-12-spec/#cookies) object
```js
-var validate = require('har-validator')
-
-validate.cookie(data.then(function (HAR) {
- console.log('horray!')
- })
- .catch(function (error) {
- console.error(error)
- })
+validate.cookie(data)
+ .then(data => console.log('horray!'))
+ .catch(console.error)
```
### Validate.creator(data)
@@ -162,14 +130,9 @@ validate.cookie(data.then(function (HAR) {
a [creator](http://www.softwareishard.com/blog/har-12-spec/#creator) object
```js
-var validate = require('har-validator')
-
-validate.creator(data.then(function (HAR) {
- console.log('horray!')
- })
- .catch(function (error) {
- console.error(error)
- })
+validate.creator(data)
+ .then(data => console.log('horray!'))
+ .catch(console.error)
```
### Validate.entry(data)
@@ -180,14 +143,9 @@ validate.creator(data.then(function (HAR) {
an [entry](http://www.softwareishard.com/blog/har-12-spec/#entries) object
```js
-var validate = require('har-validator')
-
-validate.entry(data.then(function (HAR) {
- console.log('horray!')
- })
- .catch(function (error) {
- console.error(error)
- })
+validate.entry(data)
+ .then(data => console.log('horray!'))
+ .catch(console.error)
```
### Validate.log(data)
@@ -202,14 +160,9 @@ alias of [`Validate(data)`](#validate-data-callback-)
a [page](http://www.softwareishard.com/blog/har-12-spec/#pages) object
```js
-var validate = require('har-validator')
-
-validate.page(data.then(function (HAR) {
- console.log('horray!')
- })
- .catch(function (error) {
- console.error(error)
- })
+validate.page(data)
+ .then(data => console.log('horray!'))
+ .catch(console.error)
```
### Validate.pageTimings(data)
@@ -220,14 +173,9 @@ validate.page(data.then(function (HAR) {
a [pageTimings](http://www.softwareishard.com/blog/har-12-spec/#pageTimings) object
```js
-var validate = require('har-validator')
-
-validate.pageTimings(data.then(function (HAR) {
- console.log('horray!')
- })
- .catch(function (error) {
- console.error(error)
- })
+validate.pageTimings(data)
+ .then(data => console.log('horray!'))
+ .catch(console.error)
```
### Validate.postData(data)
@@ -238,14 +186,9 @@ validate.pageTimings(data.then(function (HAR) {
a [postData](http://www.softwareishard.com/blog/har-12-spec/#postData) object
```js
-var validate = require('har-validator')
-
-validate.postData(data.then(function (HAR) {
- console.log('horray!')
- })
- .catch(function (error) {
- console.error(error)
- })
+validate.postData(data)
+ .then(data => console.log('horray!'))
+ .catch(console.error)
```
### Validate.record(data)
@@ -256,14 +199,9 @@ validate.postData(data.then(function (HAR) {
a [record](http://www.softwareishard.com/blog/har-12-spec/#headers) object
```js
-var validate = require('har-validator')
-
-validate.record(data.then(function (HAR) {
- console.log('horray!')
- })
- .catch(function (error) {
- console.error(error)
- })
+validate.record(data)
+ .then(data => console.log('horray!'))
+ .catch(console.error)
```
### Validate.request(data)
@@ -274,14 +212,9 @@ validate.record(data.then(function (HAR) {
a [request](http://www.softwareishard.com/blog/har-12-spec/#request) object
```js
-var validate = require('har-validator')
-
-validate.request(data.then(function (HAR) {
- console.log('horray!')
- })
- .catch(function (error) {
- console.error(error)
- })
+validate.request(data)
+ .then(data => console.log('horray!'))
+ .catch(console.error)
```
### Validate.response(data)
@@ -292,14 +225,9 @@ validate.request(data.then(function (HAR) {
a [response](http://www.softwareishard.com/blog/har-12-spec/#response) object
```js
-var validate = require('har-validator')
-
-validate.cacheEntry(data.then(function (HAR) {
- console.log('horray!')
- })
- .catch(function (error) {
- console.error(error)
- })
+validate.cacheEntry(data)
+ .then(data => console.log('horray!'))
+ .catch(console.error)
```
### Validate.timings(data)
@@ -310,14 +238,9 @@ validate.cacheEntry(data.then(function (HAR) {
a [timings](http://www.softwareishard.com/blog/har-12-spec/#timings) object
```js
-var validate = require('har-validator')
-
-validate.timings(data.then(function (HAR) {
- console.log('horray!')
- })
- .catch(function (error) {
- console.error(error)
- })
+validate.timings(data)
+ .then(data => console.log('horray!'))
+ .catch(console.error)
```
----
diff --git a/deps/npm/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/ansi-styles/package.json b/deps/npm/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/ansi-styles/package.json
index f2e9595b8b5eb2..b6a9ceaea0fa60 100644
--- a/deps/npm/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/ansi-styles/package.json
+++ b/deps/npm/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/ansi-styles/package.json
@@ -14,14 +14,12 @@
},
"maintainers": [
{
- "name": "Sindre Sorhus",
- "email": "sindresorhus@gmail.com",
- "url": "sindresorhus.com"
+ "name": "sindresorhus",
+ "email": "sindresorhus@gmail.com"
},
{
- "name": "Joshua Appelman",
- "email": "jappelman@xebia.com",
- "url": "jbnicolai.com"
+ "name": "jbnicolai",
+ "email": "jappelman@xebia.com"
}
],
"engines": {
@@ -58,14 +56,25 @@
"devDependencies": {
"mocha": "*"
},
- "readme": "# ansi-styles [![Build Status](https://travis-ci.org/chalk/ansi-styles.svg?branch=master)](https://travis-ci.org/chalk/ansi-styles)\n\n> [ANSI escape codes](http://en.wikipedia.org/wiki/ANSI_escape_code#Colors_and_Styles) for styling strings in the terminal\n\nYou probably want the higher-level [chalk](https://github.com/chalk/chalk) module for styling your strings.\n\n![](screenshot.png)\n\n\n## Install\n\n```\n$ npm install --save ansi-styles\n```\n\n\n## Usage\n\n```js\nvar ansi = require('ansi-styles');\n\nconsole.log(ansi.green.open + 'Hello world!' + ansi.green.close);\n```\n\n\n## API\n\nEach style has an `open` and `close` property.\n\n\n## Styles\n\n### Modifiers\n\n- `reset`\n- `bold`\n- `dim`\n- `italic` *(not widely supported)*\n- `underline`\n- `inverse`\n- `hidden`\n- `strikethrough` *(not widely supported)*\n\n### 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## Advanced usage\n\nBy default you get a map of styles, but the styles are also available as groups. They are non-enumerable so they don't show up unless you access them explicitly. This makes it easier to expose only a subset in a higher-level module.\n\n- `ansi.modifiers`\n- `ansi.colors`\n- `ansi.bgColors`\n\n\n###### Example\n\n```js\nconsole.log(ansi.colors.green.open);\n```\n\n\n## License\n\nMIT © [Sindre Sorhus](http://sindresorhus.com)\n",
- "readmeFilename": "readme.md",
+ "gitHead": "18421cbe4a2d93359ec2599a894f704be126d066",
"bugs": {
"url": "https://github.com/chalk/ansi-styles/issues"
},
- "homepage": "https://github.com/chalk/ansi-styles#readme",
+ "homepage": "https://github.com/chalk/ansi-styles",
"_id": "ansi-styles@2.1.0",
"_shasum": "990f747146927b559a932bf92959163d60c0d0e2",
+ "_from": "ansi-styles@>=2.1.0 <3.0.0",
+ "_npmVersion": "2.10.1",
+ "_nodeVersion": "0.12.4",
+ "_npmUser": {
+ "name": "jbnicolai",
+ "email": "jappelman@xebia.com"
+ },
+ "dist": {
+ "shasum": "990f747146927b559a932bf92959163d60c0d0e2",
+ "tarball": "http://registry.npmjs.org/ansi-styles/-/ansi-styles-2.1.0.tgz"
+ },
+ "directories": {},
"_resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.1.0.tgz",
- "_from": "ansi-styles@>=2.1.0 <3.0.0"
+ "readme": "ERROR: No README data found!"
}
diff --git a/deps/npm/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/escape-string-regexp/index.js b/deps/npm/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/escape-string-regexp/index.js
index ac6572cabec57d..7834bf9b24c481 100644
--- a/deps/npm/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/escape-string-regexp/index.js
+++ b/deps/npm/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/escape-string-regexp/index.js
@@ -7,5 +7,5 @@ module.exports = function (str) {
throw new TypeError('Expected a string');
}
- return str.replace(matchOperatorsRe, '\\$&');
+ return str.replace(matchOperatorsRe, '\\$&');
};
diff --git a/deps/npm/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/escape-string-regexp/package.json b/deps/npm/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/escape-string-regexp/package.json
index b2bafb26a04f02..d0f6c0f9df51f4 100644
--- a/deps/npm/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/escape-string-regexp/package.json
+++ b/deps/npm/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/escape-string-regexp/package.json
@@ -1,6 +1,6 @@
{
"name": "escape-string-regexp",
- "version": "1.0.3",
+ "version": "1.0.4",
"description": "Escape RegExp special characters",
"license": "MIT",
"repository": {
@@ -10,52 +10,62 @@
"author": {
"name": "Sindre Sorhus",
"email": "sindresorhus@gmail.com",
- "url": "http://sindresorhus.com"
+ "url": "sindresorhus.com"
},
"maintainers": [
{
- "name": "Sindre Sorhus",
- "email": "sindresorhus@gmail.com",
- "url": "http://sindresorhus.com"
+ "name": "sindresorhus",
+ "email": "sindresorhus@gmail.com"
},
{
- "name": "Joshua Appelman",
- "email": "jappelman@xebia.com",
- "url": "http://jbnicolai.com"
+ "name": "jbnicolai",
+ "email": "jappelman@xebia.com"
}
],
"engines": {
"node": ">=0.8.0"
},
"scripts": {
- "test": "mocha"
+ "test": "xo && ava"
},
"files": [
"index.js"
],
"keywords": [
+ "escape",
"regex",
"regexp",
"re",
"regular",
"expression",
- "escape",
"string",
"str",
"special",
"characters"
],
"devDependencies": {
- "mocha": "*"
+ "ava": "*",
+ "xo": "*"
},
- "readme": "# escape-string-regexp [![Build Status](https://travis-ci.org/sindresorhus/escape-string-regexp.svg?branch=master)](https://travis-ci.org/sindresorhus/escape-string-regexp)\n\n> Escape RegExp special characters\n\n\n## Install\n\n```sh\n$ npm install --save escape-string-regexp\n```\n\n\n## Usage\n\n```js\nvar escapeStringRegexp = require('escape-string-regexp');\n\nvar escapedString = escapeStringRegexp('how much $ for a unicorn?');\n//=> how much \\$ for a unicorn\\?\n\nnew RegExp(escapedString);\n```\n\n\n## License\n\nMIT © [Sindre Sorhus](http://sindresorhus.com)\n",
- "readmeFilename": "readme.md",
+ "gitHead": "e9ca6832a9506ca26402cb0e6dc95efcf35b0b97",
"bugs": {
"url": "https://github.com/sindresorhus/escape-string-regexp/issues"
},
- "homepage": "https://github.com/sindresorhus/escape-string-regexp#readme",
- "_id": "escape-string-regexp@1.0.3",
- "_shasum": "9e2d8b25bc2555c3336723750e03f099c2735bb5",
- "_resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.3.tgz",
- "_from": "escape-string-regexp@>=1.0.2 <2.0.0"
+ "homepage": "https://github.com/sindresorhus/escape-string-regexp",
+ "_id": "escape-string-regexp@1.0.4",
+ "_shasum": "b85e679b46f72d03fbbe8a3bf7259d535c21b62f",
+ "_from": "escape-string-regexp@>=1.0.2 <2.0.0",
+ "_npmVersion": "2.14.7",
+ "_nodeVersion": "4.2.1",
+ "_npmUser": {
+ "name": "sindresorhus",
+ "email": "sindresorhus@gmail.com"
+ },
+ "dist": {
+ "shasum": "b85e679b46f72d03fbbe8a3bf7259d535c21b62f",
+ "tarball": "http://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.4.tgz"
+ },
+ "directories": {},
+ "_resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.4.tgz",
+ "readme": "ERROR: No README data found!"
}
diff --git a/deps/npm/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/escape-string-regexp/readme.md b/deps/npm/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/escape-string-regexp/readme.md
index 808a963a86235e..87ac82d5ef8bc9 100644
--- a/deps/npm/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/escape-string-regexp/readme.md
+++ b/deps/npm/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/escape-string-regexp/readme.md
@@ -5,7 +5,7 @@
## Install
-```sh
+```
$ npm install --save escape-string-regexp
```
@@ -13,10 +13,10 @@ $ npm install --save escape-string-regexp
## Usage
```js
-var escapeStringRegexp = require('escape-string-regexp');
+const escapeStringRegexp = require('escape-string-regexp');
-var escapedString = escapeStringRegexp('how much $ for a unicorn?');
-//=> how much \$ for a unicorn\?
+const escapedString = escapeStringRegexp('how much $ for a unicorn?');
+//=> 'how much \$ for a unicorn\?'
new RegExp(escapedString);
```
diff --git a/deps/npm/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/has-ansi/package.json b/deps/npm/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/has-ansi/package.json
index 15f623780f02e6..d39a62eb9150d7 100644
--- a/deps/npm/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/has-ansi/package.json
+++ b/deps/npm/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/has-ansi/package.json
@@ -14,14 +14,12 @@
},
"maintainers": [
{
- "name": "Sindre Sorhus",
- "email": "sindresorhus@gmail.com",
- "url": "sindresorhus.com"
+ "name": "sindresorhus",
+ "email": "sindresorhus@gmail.com"
},
{
- "name": "Joshua Appelman",
- "email": "jappelman@xebia.com",
- "url": "jbnicolai.com"
+ "name": "jbnicolai",
+ "email": "jappelman@xebia.com"
}
],
"engines": {
@@ -63,14 +61,25 @@
"devDependencies": {
"ava": "0.0.4"
},
- "readme": "# has-ansi [![Build Status](https://travis-ci.org/sindresorhus/has-ansi.svg?branch=master)](https://travis-ci.org/sindresorhus/has-ansi)\n\n> Check if a string has [ANSI escape codes](http://en.wikipedia.org/wiki/ANSI_escape_code)\n\n\n## Install\n\n```\n$ npm install --save has-ansi\n```\n\n\n## Usage\n\n```js\nvar hasAnsi = require('has-ansi');\n\nhasAnsi('\\u001b[4mcake\\u001b[0m');\n//=> true\n\nhasAnsi('cake');\n//=> false\n```\n\n\n## Related\n\n- [has-ansi-cli](https://github.com/sindresorhus/has-ansi-cli) - CLI for this module\n- [strip-ansi](https://github.com/sindresorhus/strip-ansi) - Strip ANSI escape codes\n- [ansi-regex](https://github.com/sindresorhus/ansi-regex) - Regular expression for matching ANSI escape codes\n- [chalk](https://github.com/sindresorhus/chalk) - Terminal string styling done right\n\n\n## License\n\nMIT © [Sindre Sorhus](http://sindresorhus.com)\n",
- "readmeFilename": "readme.md",
+ "gitHead": "0722275e1bef139fcd09137da6e5550c3cd368b9",
"bugs": {
"url": "https://github.com/sindresorhus/has-ansi/issues"
},
- "homepage": "https://github.com/sindresorhus/has-ansi#readme",
+ "homepage": "https://github.com/sindresorhus/has-ansi",
"_id": "has-ansi@2.0.0",
"_shasum": "34f5049ce1ecdf2b0649af3ef24e45ed35416d91",
+ "_from": "has-ansi@>=2.0.0 <3.0.0",
+ "_npmVersion": "2.11.2",
+ "_nodeVersion": "0.12.5",
+ "_npmUser": {
+ "name": "sindresorhus",
+ "email": "sindresorhus@gmail.com"
+ },
+ "dist": {
+ "shasum": "34f5049ce1ecdf2b0649af3ef24e45ed35416d91",
+ "tarball": "http://registry.npmjs.org/has-ansi/-/has-ansi-2.0.0.tgz"
+ },
+ "directories": {},
"_resolved": "https://registry.npmjs.org/has-ansi/-/has-ansi-2.0.0.tgz",
- "_from": "has-ansi@>=2.0.0 <3.0.0"
+ "readme": "ERROR: No README data found!"
}
diff --git a/deps/npm/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/supports-color/package.json b/deps/npm/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/supports-color/package.json
index c43b7aa8c3a54f..38a1ecb3cebb2a 100644
--- a/deps/npm/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/supports-color/package.json
+++ b/deps/npm/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/supports-color/package.json
@@ -14,14 +14,12 @@
},
"maintainers": [
{
- "name": "Sindre Sorhus",
- "email": "sindresorhus@gmail.com",
- "url": "sindresorhus.com"
+ "name": "sindresorhus",
+ "email": "sindresorhus@gmail.com"
},
{
- "name": "Joshua Appelman",
- "email": "jappelman@xebia.com",
- "url": "jbnicolai.com"
+ "name": "jbnicolai",
+ "email": "jappelman@xebia.com"
}
],
"engines": {
@@ -57,14 +55,25 @@
"mocha": "*",
"require-uncached": "^1.0.2"
},
- "readme": "# supports-color [![Build Status](https://travis-ci.org/chalk/supports-color.svg?branch=master)](https://travis-ci.org/chalk/supports-color)\n\n> Detect whether a terminal supports color\n\n\n## Install\n\n```\n$ npm install --save supports-color\n```\n\n\n## Usage\n\n```js\nvar supportsColor = require('supports-color');\n\nif (supportsColor) {\n\tconsole.log('Terminal supports color');\n}\n```\n\nIt obeys the `--color` and `--no-color` CLI flags.\n\nFor situations where using `--color` is not possible, add an environment variable `FORCE_COLOR` with any value to force color. Trumps `--no-color`.\n\n\n## Related\n\n- [supports-color-cli](https://github.com/chalk/supports-color-cli) - CLI for this module\n- [chalk](https://github.com/chalk/chalk) - Terminal string styling done right\n\n\n## License\n\nMIT © [Sindre Sorhus](http://sindresorhus.com)\n",
- "readmeFilename": "readme.md",
+ "gitHead": "8400d98ade32b2adffd50902c06d9e725a5c6588",
"bugs": {
"url": "https://github.com/chalk/supports-color/issues"
},
- "homepage": "https://github.com/chalk/supports-color#readme",
+ "homepage": "https://github.com/chalk/supports-color",
"_id": "supports-color@2.0.0",
"_shasum": "535d045ce6b6363fa40117084629995e9df324c7",
+ "_from": "supports-color@>=2.0.0 <3.0.0",
+ "_npmVersion": "2.11.2",
+ "_nodeVersion": "0.12.5",
+ "_npmUser": {
+ "name": "sindresorhus",
+ "email": "sindresorhus@gmail.com"
+ },
+ "dist": {
+ "shasum": "535d045ce6b6363fa40117084629995e9df324c7",
+ "tarball": "http://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz"
+ },
+ "directories": {},
"_resolved": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz",
- "_from": "supports-color@>=2.0.0 <3.0.0"
+ "readme": "ERROR: No README data found!"
}
diff --git a/deps/npm/node_modules/request/node_modules/har-validator/node_modules/chalk/package.json b/deps/npm/node_modules/request/node_modules/har-validator/node_modules/chalk/package.json
index 2ad36d4d983cab..dc5e754dd7e049 100644
--- a/deps/npm/node_modules/request/node_modules/har-validator/node_modules/chalk/package.json
+++ b/deps/npm/node_modules/request/node_modules/har-validator/node_modules/chalk/package.json
@@ -9,19 +9,16 @@
},
"maintainers": [
{
- "name": "Sindre Sorhus",
- "email": "sindresorhus@gmail.com",
- "url": "sindresorhus.com"
+ "name": "sindresorhus",
+ "email": "sindresorhus@gmail.com"
},
{
- "name": "Joshua Appelman",
- "email": "jappelman@xebia.com",
- "url": "jbnicolai.com"
+ "name": "jbnicolai",
+ "email": "jappelman@xebia.com"
},
{
- "name": "JD Ballard",
- "email": "i.am.qix@gmail.com",
- "url": "github.com/qix-"
+ "name": "unicorn",
+ "email": "sindresorhus+unicorn@gmail.com"
}
],
"engines": {
@@ -82,14 +79,25 @@
"mocha"
]
},
- "readme": "\n\t
\n\t
\n\t\n\t
\n\t
\n\t
\n
\n\n> Terminal string styling done right\n\n[![Build Status](https://travis-ci.org/chalk/chalk.svg?branch=master)](https://travis-ci.org/chalk/chalk)\n[![Coverage Status](https://coveralls.io/repos/chalk/chalk/badge.svg?branch=master)](https://coveralls.io/r/chalk/chalk?branch=master)\n[![](http://img.shields.io/badge/unicorn-approved-ff69b4.svg)](https://www.youtube.com/watch?v=9auOCbH5Ns4)\n\n\n[colors.js](https://github.com/Marak/colors.js) used to be the most popular string styling module, but it has serious deficiencies like extending `String.prototype` which causes all kinds of [problems](https://github.com/yeoman/yo/issues/68). Although there are other ones, they either do too much or not enough.\n\n**Chalk is a clean and focused alternative.**\n\n![](https://github.com/chalk/ansi-styles/raw/master/screenshot.png)\n\n\n## Why\n\n- Highly performant\n- Doesn't extend `String.prototype`\n- Expressive API\n- Ability to nest styles\n- Clean and focused\n- Auto-detects color support\n- Actively maintained\n- [Used by ~4500 modules](https://www.npmjs.com/browse/depended/chalk) as of July 15, 2015\n\n\n## Install\n\n```\n$ npm install --save chalk\n```\n\n\n## Usage\n\nChalk comes with an easy to use composable API where you just chain and nest the styles you want.\n\n```js\nvar chalk = require('chalk');\n\n// style a string\nchalk.blue('Hello world!');\n\n// combine styled and normal strings\nchalk.blue('Hello') + 'World' + chalk.red('!');\n\n// compose multiple styles using the chainable API\nchalk.blue.bgRed.bold('Hello world!');\n\n// pass in multiple arguments\nchalk.blue('Hello', 'World!', 'Foo', 'bar', 'biz', 'baz');\n\n// nest styles\nchalk.red('Hello', chalk.underline.bgBlue('world') + '!');\n\n// nest styles of the same type even (color, underline, background)\nchalk.green(\n\t'I am a green line ' +\n\tchalk.blue.underline.bold('with a blue substring') +\n\t' that becomes green again!'\n);\n```\n\nEasily define your own themes.\n\n```js\nvar chalk = require('chalk');\nvar error = chalk.bold.red;\nconsole.log(error('Error!'));\n```\n\nTake advantage of console.log [string substitution](http://nodejs.org/docs/latest/api/console.html#console_console_log_data).\n\n```js\nvar name = 'Sindre';\nconsole.log(chalk.green('Hello %s'), name);\n//=> Hello Sindre\n```\n\n\n## API\n\n### chalk.`
+
+
+
+ ESLint Report
+
+ {{renderText totalErrors totalWarnings}} - Generated on {{date}}
+
+
+
+
+ {{#each results}}
+
+
+ [+] {{this.filePath}}
+ {{renderText this.errorCount this.warningCount}}
+
+
+ {{#each this.messages}}
+
+ {{/each}}
+ {{/each}}
+
+
+
+
+
\ No newline at end of file
diff --git a/tools/eslint/lib/formatters/html.js b/tools/eslint/lib/formatters/html.js
new file mode 100644
index 00000000000000..435894d208b42e
--- /dev/null
+++ b/tools/eslint/lib/formatters/html.js
@@ -0,0 +1,88 @@
+/**
+ * @fileoverview HTML reporter
+ * @author Julian Laval
+ * @copyright 2015 Julian Laval. All rights reserved.
+ */
+"use strict";
+
+var handlebars = require("handlebars").create();
+var fs = require("fs");
+var path = require("path");
+
+//------------------------------------------------------------------------------
+// Helpers
+//------------------------------------------------------------------------------
+
+/**
+ * Given a word and a count, append an s if count is not one.
+ * @param {string} word A word in its singular form.
+ * @param {int} count A number controlling whether word should be pluralized.
+ * @returns {string} The original word with an s on the end if count is not one.
+ */
+function pluralize(word, count) {
+ return (count === 1 ? word : word + "s");
+}
+
+/**
+ * Renders text along the template of x problems (x errors, x warnings)
+ * @param {string} totalErrors Total errors
+ * @param {string} totalWarnings Total warnings
+ * @returns {string} The formatted string, pluralized where necessary
+ */
+handlebars.registerHelper("renderText", function(totalErrors, totalWarnings) {
+ var totalProblems = totalErrors + totalWarnings;
+ var renderedText = totalProblems + " " + pluralize("problem", totalProblems);
+ if (totalProblems !== 0) {
+ renderedText += " (" + totalErrors + " " + pluralize("error", totalErrors) + ", " + totalWarnings + " " + pluralize("warning", totalWarnings) + ")";
+ }
+ return renderedText;
+});
+
+/**
+ * Get the color based on whether there are errors/warnings...
+ * @param {string} totalErrors Total errors
+ * @param {string} totalWarnings Total warnings
+ * @returns {int} The color code (0 = green, 1 = yellow, 2 = red)
+ */
+handlebars.registerHelper("getColor", function(totalErrors, totalWarnings) {
+ if (totalErrors !== 0) {
+ return 2;
+ } else if (totalWarnings !== 0) {
+ return 1;
+ }
+ return 0;
+});
+
+/**
+ * Get the HTML row content based on the severity of the message
+ * @param {int} severity Severity of the message
+ * @returns {string} The generated HTML row
+ */
+handlebars.registerHelper("getSeverity", function(severity) {
+ // Return warning else error
+ return new handlebars.SafeString((severity === 1) ? "Warning " : "Error ");
+});
+
+//------------------------------------------------------------------------------
+// Public Interface
+//------------------------------------------------------------------------------
+
+module.exports = function(results) {
+
+ var template = fs.readFileSync(path.join(__dirname, "html-template.html"), "utf-8");
+
+ var data = {
+ date: new Date(),
+ totalErrors: 0,
+ totalWarnings: 0,
+ results: results
+ };
+
+ // Iterate over results to get totals
+ results.forEach(function(result) {
+ data.totalErrors += result.errorCount;
+ data.totalWarnings += result.warningCount;
+ });
+
+ return handlebars.compile(template)(data);
+};
diff --git a/tools/eslint/lib/formatters/json.js b/tools/eslint/lib/formatters/json.js
new file mode 100644
index 00000000000000..c1101970efa468
--- /dev/null
+++ b/tools/eslint/lib/formatters/json.js
@@ -0,0 +1,14 @@
+/**
+ * @fileoverview JSON reporter
+ * @author Burak Yigit Kaya aka BYK
+ * @copyright 2015 Burak Yigit Kaya. All rights reserved.
+ */
+"use strict";
+
+//------------------------------------------------------------------------------
+// Public Interface
+//------------------------------------------------------------------------------
+
+module.exports = function(results) {
+ return JSON.stringify(results);
+};
diff --git a/tools/eslint/lib/formatters/junit.js b/tools/eslint/lib/formatters/junit.js
index 7ee94135f6a84f..3d4a1db19cf8ec 100644
--- a/tools/eslint/lib/formatters/junit.js
+++ b/tools/eslint/lib/formatters/junit.js
@@ -10,6 +10,12 @@ var xmlescape = require("xml-escape");
// Helper Functions
//------------------------------------------------------------------------------
+/**
+ * Returns the severity of warning or error
+ * @param {object} message message object to examine
+ * @returns {string} severity level
+ * @private
+ */
function getMessageType(message) {
if (message.fatal || message.severity === 2) {
return "Error";
diff --git a/tools/eslint/lib/formatters/unix.js b/tools/eslint/lib/formatters/unix.js
new file mode 100644
index 00000000000000..2782b0cd0e3568
--- /dev/null
+++ b/tools/eslint/lib/formatters/unix.js
@@ -0,0 +1,59 @@
+/**
+ * @fileoverview unix-style formatter.
+ * @author oshi-shinobu
+ * @copyright 2015 oshi-shinobu. All rights reserved.
+ */
+"use strict";
+
+//------------------------------------------------------------------------------
+// Helper Functions
+//------------------------------------------------------------------------------
+
+/**
+ * Returns a canonical error level string based upon the error message passed in.
+ * @param {object} message Individual error message provided by eslint
+ * @returns {String} Error level string
+ */
+function getMessageType(message) {
+ if (message.fatal || message.severity === 2) {
+ return "Error";
+ } else {
+ return "Warning";
+ }
+}
+
+
+//------------------------------------------------------------------------------
+// Public Interface
+//------------------------------------------------------------------------------
+
+module.exports = function(results) {
+
+ var output = "",
+ total = 0;
+
+ results.forEach(function(result) {
+
+ var messages = result.messages;
+ total += messages.length;
+
+ messages.forEach(function(message) {
+
+ output += result.filePath + ":";
+ output += (message.line || 0) + ":";
+ output += (message.column || 0) + ":";
+ output += " " + message.message + " ";
+ output += "[" + getMessageType(message) +
+ (message.ruleId ? "/" + message.ruleId : "") + "]";
+ output += "\n";
+
+ });
+
+ });
+
+ if (total > 0) {
+ output += "\n" + total + " problem" + (total !== 1 ? "s" : "");
+ }
+
+ return output;
+};
diff --git a/tools/eslint/lib/ignored-paths.js b/tools/eslint/lib/ignored-paths.js
index 6d57da2776d16c..cbf67488c5ef5c 100644
--- a/tools/eslint/lib/ignored-paths.js
+++ b/tools/eslint/lib/ignored-paths.js
@@ -35,6 +35,12 @@ var ESLINT_IGNORE_FILENAME = ".eslintignore";
function loadIgnoreFile(filepath) {
var ignorePatterns = [];
+ /**
+ * Check if string is not empty
+ * @param {string} line string to examine
+ * @returns {boolean} True is its not empty
+ * @private
+ */
function nonEmpty(line) {
return line.trim() !== "" && line[0] !== "#";
}
@@ -85,7 +91,7 @@ function IgnoredPaths(patterns) {
* @param {Object} options object containing 'ignore' and 'ignorePath' properties
* @returns {IgnoredPaths} object, with patterns loaded from the ignore file
*/
-IgnoredPaths.load = function (options) {
+IgnoredPaths.load = function(options) {
var patterns;
options = options || {};
@@ -97,7 +103,7 @@ IgnoredPaths.load = function (options) {
}
if (options.ignorePattern) {
- patterns.push(options.ignorePattern);
+ patterns = patterns.concat(options.ignorePattern);
}
return new IgnoredPaths(patterns);
@@ -108,7 +114,7 @@ IgnoredPaths.load = function (options) {
* @param {string} filepath Path to check
* @returns {boolean} true if the file path matches one or more patterns, false otherwise
*/
-IgnoredPaths.prototype.contains = function (filepath) {
+IgnoredPaths.prototype.contains = function(filepath) {
if (this.patterns === null) {
throw new Error("No ignore patterns loaded, call 'load' first");
}
diff --git a/tools/eslint/lib/load-rules.js b/tools/eslint/lib/load-rules.js
index 62183f344d3b68..68bf144cc705af 100644
--- a/tools/eslint/lib/load-rules.js
+++ b/tools/eslint/lib/load-rules.js
@@ -33,7 +33,7 @@ module.exports = function(rulesDir) {
if (path.extname(file) !== ".js") {
return;
}
- rules[file.slice(0, -3)] = require(path.join(rulesDir, file));
+ rules[file.slice(0, -3)] = path.join(rulesDir, file);
});
return rules;
};
diff --git a/tools/eslint/lib/logging.js b/tools/eslint/lib/logging.js
new file mode 100644
index 00000000000000..b5e7260519dc72
--- /dev/null
+++ b/tools/eslint/lib/logging.js
@@ -0,0 +1,25 @@
+/**
+ * @fileoverview Handle logging for Eslint
+ * @author Gyandeep Singh
+ * @copyright 2015 Gyandeep Singh. All rights reserved.
+ */
+"use strict";
+
+/* istanbul ignore next */
+module.exports = {
+ /**
+ * Cover for console.log
+ * @returns {void}
+ */
+ info: function() {
+ console.log.apply(console, Array.prototype.slice.call(arguments));
+ },
+
+ /**
+ * Cover for console.error
+ * @returns {void}
+ */
+ error: function() {
+ console.error.apply(console, Array.prototype.slice.call(arguments));
+ }
+};
diff --git a/tools/eslint/lib/options.js b/tools/eslint/lib/options.js
index 58111090b6e191..3fee3854b0c4b3 100644
--- a/tools/eslint/lib/options.js
+++ b/tools/eslint/lib/options.js
@@ -1,6 +1,7 @@
/**
* @fileoverview Options configuration for optionator.
* @author George Zahariev
+ * See LICENSE in root directory for full license.
*/
"use strict";
@@ -19,114 +20,190 @@ module.exports = optionator({
prepend: "eslint [options] file.js [file.js] [dir]",
concatRepeatedArrays: true,
mergeRepeatedObjects: true,
- options: [{
- heading: "Options"
- }, {
- option: "help",
- alias: "h",
- type: "Boolean",
- description: "Show help"
- }, {
- option: "config",
- alias: "c",
- type: "path::String",
- description: "Use configuration from this file"
- }, {
- option: "rulesdir",
- type: "[path::String]",
- description: "Use additional rules from this directory"
- }, {
- option: "format",
- alias: "f",
- type: "String",
- default: "stylish",
- description: "Use a specific output format"
- }, {
- option: "version",
- alias: "v",
- type: "Boolean",
- description: "Outputs the version number"
- }, {
- option: "reset",
- type: "Boolean",
- default: "false",
- description: "Set all default rules to off"
- }, {
- option: "eslintrc",
- type: "Boolean",
- default: "true",
- description: "Disable use of configuration from .eslintrc"
- }, {
- option: "env",
- type: "[String]",
- description: "Specify environments"
- }, {
- option: "ext",
- type: "[String]",
- default: ".js",
- description: "Specify JavaScript file extensions"
- }, {
- option: "plugin",
- type: "[String]",
- description: "Specify plugins"
- }, {
- option: "global",
- type: "[String]",
- description: "Define global variables"
- }, {
- option: "rule",
- type: "Object",
- description: "Specify rules"
- },
- {
- option: "ignore-path",
- type: "path::String",
- description: "Specify path of ignore file"
- },
- {
- option: "ignore",
- type: "Boolean",
- default: "true",
- description: "Disable use of .eslintignore"
- },
- {
- option: "ignore-pattern",
- type: "String",
- description: "Pattern of files to ignore (in addition to those in .eslintignore)"
- },
- {
- option: "color",
- type: "Boolean",
- default: "true",
- description: "Disable color in piped output"
- },
- {
- option: "output-file",
- alias: "o",
- type: "path::String",
- description: "Specify file to write report to"
- },
- {
- option: "quiet",
- type: "Boolean",
- default: "false",
- description: "Report errors only"
- },
- {
- option: "stdin",
- type: "Boolean",
- default: "false",
- description: "Lint code provided on "
- },
- {
- option: "stdin-filename",
- type: "String",
- description: "Specify filename to process STDIN as"
- },
- {
- option: "init",
- type: "Boolean",
- default: "false",
- description: "Run config initialization wizard"
- }]
+ options: [
+ {
+ heading: "Basic configuration"
+ },
+ {
+ option: "config",
+ alias: "c",
+ type: "path::String",
+ description: "Use configuration from this file or shareable config"
+ },
+ {
+ option: "eslintrc",
+ type: "Boolean",
+ default: "true",
+ description: "Disable use of configuration from .eslintrc"
+ },
+ {
+ option: "env",
+ type: "[String]",
+ description: "Specify environments"
+ },
+ {
+ option: "ext",
+ type: "[String]",
+ default: ".js",
+ description: "Specify JavaScript file extensions"
+ },
+ {
+ option: "global",
+ type: "[String]",
+ description: "Define global variables"
+ },
+ {
+ option: "parser",
+ type: "String",
+ default: "espree",
+ description: "Specify the parser to be used"
+ },
+ {
+ heading: "Caching"
+ },
+ {
+ option: "cache",
+ type: "Boolean",
+ default: "false",
+ description: "Only check changed files"
+ },
+ {
+ option: "cache-file",
+ type: "path::String",
+ default: ".eslintcache",
+ description: "Path to the cache file. Deprecated: use --cache-location"
+ },
+ {
+ option: "cache-location",
+ type: "path::String",
+ description: "Path to the cache file or directory"
+ },
+ {
+ heading: "Specifying rules and plugins"
+ },
+ {
+ option: "rulesdir",
+ type: "[path::String]",
+ description: "Use additional rules from this directory"
+ },
+ {
+ option: "plugin",
+ type: "[String]",
+ description: "Specify plugins"
+ },
+ {
+ option: "rule",
+ type: "Object",
+ description: "Specify rules"
+ },
+ {
+ heading: "Ignoring files"
+ },
+ {
+ option: "ignore-path",
+ type: "path::String",
+ description: "Specify path of ignore file"
+ },
+ {
+ option: "ignore",
+ type: "Boolean",
+ default: "true",
+ description: "Disable use of .eslintignore"
+ },
+ {
+ option: "ignore-pattern",
+ type: "[String]",
+ description: "Pattern of files to ignore (in addition to those in .eslintignore)"
+ },
+ {
+ heading: "Using stdin"
+ },
+ {
+ option: "stdin",
+ type: "Boolean",
+ default: "false",
+ description: "Lint code provided on "
+ },
+ {
+ option: "stdin-filename",
+ type: "String",
+ description: "Specify filename to process STDIN as"
+ },
+ {
+ heading: "Handling warnings"
+ },
+ {
+ option: "quiet",
+ type: "Boolean",
+ default: "false",
+ description: "Report errors only"
+ },
+ {
+ option: "max-warnings",
+ type: "Number",
+ default: "-1",
+ description: "Number of warnings to trigger nonzero exit code"
+ },
+ {
+ heading: "Output"
+ },
+ {
+ option: "output-file",
+ alias: "o",
+ type: "path::String",
+ description: "Specify file to write report to"
+ },
+ {
+ option: "format",
+ alias: "f",
+ type: "String",
+ default: "stylish",
+ description: "Use a specific output format"
+ },
+ {
+ option: "color",
+ type: "Boolean",
+ default: "true",
+ description: "Disable color in piped output"
+ },
+ {
+ heading: "Miscellaneous"
+ },
+ {
+ option: "init",
+ type: "Boolean",
+ default: "false",
+ description: "Run config initialization wizard"
+ },
+ {
+ option: "fix",
+ type: "Boolean",
+ default: false,
+ description: "Automatically fix problems"
+ },
+ {
+ option: "debug",
+ type: "Boolean",
+ default: false,
+ description: "Output debugging information"
+ },
+ {
+ option: "help",
+ alias: "h",
+ type: "Boolean",
+ description: "Show help"
+ },
+ {
+ option: "version",
+ alias: "v",
+ type: "Boolean",
+ description: "Outputs the version number"
+ },
+ {
+ option: "inline-config",
+ type: "Boolean",
+ default: "true",
+ description: "Allow comments to change eslint config/rules"
+ }
+ ]
});
diff --git a/tools/eslint/lib/rule-context.js b/tools/eslint/lib/rule-context.js
index 0513685f6d6acb..847f2fb788107f 100644
--- a/tools/eslint/lib/rule-context.js
+++ b/tools/eslint/lib/rule-context.js
@@ -1,37 +1,61 @@
/**
* @fileoverview RuleContext utility for rules
* @author Nicholas C. Zakas
+ * @copyright 2013 Nicholas C. Zakas. All rights reserved.
+ * See LICENSE file in root directory for full license.
*/
"use strict";
+//------------------------------------------------------------------------------
+// Requirements
+//------------------------------------------------------------------------------
+
+var RuleFixer = require("./util/rule-fixer");
+
//------------------------------------------------------------------------------
// Constants
//------------------------------------------------------------------------------
var PASSTHROUGHS = [
- "getAllComments",
- "getAncestors",
- "getComments",
- "getFilename",
- "getFirstToken",
- "getFirstTokens",
- "getJSDocComment",
- "getLastToken",
- "getLastTokens",
- "getNodeByRangeIndex",
- "getScope",
- "getSource",
- "getSourceLines",
- "getTokenAfter",
- "getTokenBefore",
- "getTokenByRangeStart",
- "getTokens",
- "getTokensAfter",
- "getTokensBefore",
- "getTokensBetween",
- "markVariableAsUsed",
- "isMarkedAsUsed"
- ];
+ "getAllComments",
+ "getAncestors",
+ "getComments",
+ "getDeclaredVariables",
+ "getFilename",
+ "getFirstToken",
+ "getFirstTokens",
+ "getJSDocComment",
+ "getLastToken",
+ "getLastTokens",
+ "getNodeByRangeIndex",
+ "getScope",
+ "getSource",
+ "getSourceLines",
+ "getTokenAfter",
+ "getTokenBefore",
+ "getTokenByRangeStart",
+ "getTokens",
+ "getTokensAfter",
+ "getTokensBefore",
+ "getTokensBetween",
+ "markVariableAsUsed",
+ "isMarkedAsUsed"
+];
+
+//------------------------------------------------------------------------------
+// Typedefs
+//------------------------------------------------------------------------------
+
+/**
+ * An error message description
+ * @typedef {Object} MessageDescriptor
+ * @property {string} nodeType The type of node.
+ * @property {Location} loc The location of the problem.
+ * @property {string} message The problem message.
+ * @property {Object} [data] Optional data to use to fill in placeholders in the
+ * message.
+ * @property {Function} fix The function to call that creates a fix command.
+ */
//------------------------------------------------------------------------------
// Rule Definition
@@ -87,15 +111,47 @@ function RuleContext(ruleId, eslint, severity, options, settings, ecmaFeatures)
/**
* Passthrough to eslint.report() that automatically assigns the rule ID and severity.
- * @param {ASTNode} node The AST node related to the message.
+ * @param {ASTNode|MessageDescriptor} nodeOrDescriptor The AST node related to the message or a message
+ * descriptor.
* @param {Object=} location The location of the error.
* @param {string} message The message to display to the user.
* @param {Object} opts Optional template data which produces a formatted message
* with symbols being replaced by this object's values.
* @returns {void}
*/
- this.report = function(node, location, message, opts) {
- eslint.report(ruleId, severity, node, location, message, opts);
+ this.report = function(nodeOrDescriptor, location, message, opts) {
+
+ var descriptor,
+ fix = null;
+
+ // check to see if it's a new style call
+ if (arguments.length === 1) {
+ descriptor = nodeOrDescriptor;
+
+ // if there's a fix specified, get it
+ if (typeof descriptor.fix === "function") {
+ fix = descriptor.fix(new RuleFixer());
+ }
+
+ eslint.report(
+ ruleId, severity, descriptor.node,
+ descriptor.loc || descriptor.node.loc.start,
+ descriptor.message, descriptor.data, fix
+ );
+
+ return;
+ }
+
+ // old style call
+ eslint.report(ruleId, severity, nodeOrDescriptor, location, message, opts);
+ };
+
+ /**
+ * Passthrough to eslint.getSourceCode().
+ * @returns {SourceCode} The SourceCode object for the code.
+ */
+ this.getSourceCode = function() {
+ return eslint.getSourceCode();
};
}
diff --git a/tools/eslint/lib/rules.js b/tools/eslint/lib/rules.js
index eef942fcf15473..aafdbafefd18f7 100644
--- a/tools/eslint/lib/rules.js
+++ b/tools/eslint/lib/rules.js
@@ -31,8 +31,6 @@ function define(ruleId, ruleModule) {
rules[ruleId] = ruleModule;
}
-exports.define = define;
-
/**
* Loads and registers all rules from passed rules directory.
* @param {String} [rulesDir] Path to rules directory, may be relative. Defaults to `lib/rules`.
@@ -45,39 +43,49 @@ function load(rulesDir) {
});
}
-exports.load = load;
-
/**
* Registers all given rules of a plugin.
* @param {Object} pluginRules A key/value map of rule definitions.
* @param {String} pluginName The name of the plugin without prefix (`eslint-plugin-`).
* @returns {void}
*/
-exports.import = function (pluginRules, pluginName) {
- Object.keys(pluginRules).forEach(function (ruleId) {
+function importPlugin(pluginRules, pluginName) {
+ Object.keys(pluginRules).forEach(function(ruleId) {
var qualifiedRuleId = pluginName + "/" + ruleId,
rule = pluginRules[ruleId];
define(qualifiedRuleId, rule);
});
-};
+}
/**
* Access rule handler by id (file name).
* @param {String} ruleId Rule id (file name).
* @returns {Function} Rule handler.
*/
-exports.get = function(ruleId) {
- return rules[ruleId];
-};
+function get(ruleId) {
+ if (typeof rules[ruleId] === "string") {
+ return require(rules[ruleId]);
+ } else {
+ return rules[ruleId];
+ }
+}
/**
* Reset rules storage.
* Should be used only in tests.
* @returns {void}
*/
-exports.testClear = function() {
+function testClear() {
rules = Object.create(null);
+}
+
+module.exports = {
+ define: define,
+ load: load,
+ import: importPlugin,
+ get: get,
+ testClear: testClear
};
//------------------------------------------------------------------------------
diff --git a/tools/eslint/lib/rules/accessor-pairs.js b/tools/eslint/lib/rules/accessor-pairs.js
index 42734acf9a2fa5..e15ab3bef34374 100644
--- a/tools/eslint/lib/rules/accessor-pairs.js
+++ b/tools/eslint/lib/rules/accessor-pairs.js
@@ -6,6 +6,62 @@
"use strict";
+//------------------------------------------------------------------------------
+// Helpers
+//------------------------------------------------------------------------------
+
+/**
+ * Checks whether or not a given node is an `Identifier` node which was named a given name.
+ * @param {ASTNode} node - A node to check.
+ * @param {string} name - An expected name of the node.
+ * @returns {boolean} `true` if the node is an `Identifier` node which was named as expected.
+ */
+function isIdentifier(node, name) {
+ return node.type === "Identifier" && node.name === name;
+}
+
+/**
+ * Checks whether or not a given node is an argument of a specified method call.
+ * @param {ASTNode} node - A node to check.
+ * @param {number} index - An expected index of the node in arguments.
+ * @param {string} object - An expected name of the object of the method.
+ * @param {string} property - An expected name of the method.
+ * @returns {boolean} `true` if the node is an argument of the specified method call.
+ */
+function isArgumentOfMethodCall(node, index, object, property) {
+ var parent = node.parent;
+ return (
+ parent.type === "CallExpression" &&
+ parent.callee.type === "MemberExpression" &&
+ parent.callee.computed === false &&
+ isIdentifier(parent.callee.object, object) &&
+ isIdentifier(parent.callee.property, property) &&
+ parent.arguments[index] === node
+ );
+}
+
+/**
+ * Checks whether or not a given node is a property descriptor.
+ * @param {ASTNode} node - A node to check.
+ * @returns {boolean} `true` if the node is a property descriptor.
+ */
+function isPropertyDescriptor(node) {
+ // Object.defineProperty(obj, "foo", {set: ...})
+ if (isArgumentOfMethodCall(node, 2, "Object", "defineProperty") ||
+ isArgumentOfMethodCall(node, 2, "Reflect", "defineProperty")
+ ) {
+ return true;
+ }
+
+ // Object.defineProperties(obj, {foo: {set: ...}})
+ // Object.create(proto, {foo: {set: ...}})
+ node = node.parent.parent;
+ return node.type === "ObjectExpression" && (
+ isArgumentOfMethodCall(node, 1, "Object", "create") ||
+ isArgumentOfMethodCall(node, 1, "Object", "defineProperties")
+ );
+}
+
//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------
@@ -24,10 +80,19 @@ module.exports = function(context) {
function checkLonelySetGet(node) {
var isSetPresent = false;
var isGetPresent = false;
- var propLength = node.properties.length;
+ var isDescriptor = isPropertyDescriptor(node);
- for (var i = 0; i < propLength; i++) {
- var propToCheck = node.properties[i].kind === "init" ? node.properties[i].key.name : node.properties[i].kind;
+ for (var i = 0, end = node.properties.length; i < end; i++) {
+ var property = node.properties[i];
+
+ var propToCheck = "";
+ if (property.kind === "init") {
+ if (isDescriptor && !property.computed) {
+ propToCheck = property.key.name;
+ }
+ } else {
+ propToCheck = property.kind;
+ }
switch (propToCheck) {
case "set":
@@ -55,7 +120,7 @@ module.exports = function(context) {
}
return {
- "ObjectExpression": function (node) {
+ "ObjectExpression": function(node) {
if (checkSetWithoutGet || checkGetWithoutSet) {
checkLonelySetGet(node);
}
@@ -63,3 +128,18 @@ module.exports = function(context) {
};
};
+
+module.exports.schema = [
+ {
+ "type": "object",
+ "properties": {
+ "getWithoutSet": {
+ "type": "boolean"
+ },
+ "setWithoutGet": {
+ "type": "boolean"
+ }
+ },
+ "additionalProperties": false
+ }
+];
diff --git a/tools/eslint/lib/rules/array-bracket-spacing.js b/tools/eslint/lib/rules/array-bracket-spacing.js
index eaec76e294d08d..25c8ac3936032b 100644
--- a/tools/eslint/lib/rules/array-bracket-spacing.js
+++ b/tools/eslint/lib/rules/array-bracket-spacing.js
@@ -8,12 +8,15 @@
*/
"use strict";
+var astUtils = require("../ast-utils");
+
//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------
module.exports = function(context) {
- var spaced = context.options[0] === "always";
+ var spaced = context.options[0] === "always",
+ sourceCode = context.getSourceCode();
/**
* Determines whether an option is set, relative to the spacing option.
@@ -23,7 +26,7 @@ module.exports = function(context) {
* @returns {boolean} Whether or not the property is excluded.
*/
function isOptionSet(option) {
- return context.options[1] != null ? context.options[1][option] === !spaced : false;
+ return context.options[1] ? context.options[1][option] === !spaced : false;
}
var options = {
@@ -37,26 +40,6 @@ module.exports = function(context) {
// Helpers
//--------------------------------------------------------------------------
- /**
- * Determines whether two adjacent tokens are have whitespace between them.
- * @param {Object} left - The left token object.
- * @param {Object} right - The right token object.
- * @returns {boolean} Whether or not there is space between the tokens.
- */
- function isSpaced(left, right) {
- return left.range[1] < right.range[0];
- }
-
- /**
- * Determines whether two adjacent tokens are on the same line.
- * @param {Object} left - The left token object.
- * @param {Object} right - The right token object.
- * @returns {boolean} Whether or not the tokens are on the same line.
- */
- function isSameLine(left, right) {
- return left.loc.start.line === right.loc.start.line;
- }
-
/**
* Reports that there shouldn't be a space after the first token
* @param {ASTNode} node - The node to report in the event of an error.
@@ -64,8 +47,15 @@ module.exports = function(context) {
* @returns {void}
*/
function reportNoBeginningSpace(node, token) {
- context.report(node, token.loc.start,
- "There should be no space after '" + token.value + "'");
+ context.report({
+ node: node,
+ loc: token.loc.start,
+ message: "There should be no space after '" + token.value + "'",
+ fix: function(fixer) {
+ var nextToken = context.getSourceCode().getTokenAfter(token);
+ return fixer.removeRange([token.range[1], nextToken.range[0]]);
+ }
+ });
}
/**
@@ -75,8 +65,15 @@ module.exports = function(context) {
* @returns {void}
*/
function reportNoEndingSpace(node, token) {
- context.report(node, token.loc.start,
- "There should be no space before '" + token.value + "'");
+ context.report({
+ node: node,
+ loc: token.loc.start,
+ message: "There should be no space before '" + token.value + "'",
+ fix: function(fixer) {
+ var previousToken = context.getSourceCode().getTokenBefore(token);
+ return fixer.removeRange([previousToken.range[1], token.range[0]]);
+ }
+ });
}
/**
@@ -86,8 +83,14 @@ module.exports = function(context) {
* @returns {void}
*/
function reportRequiredBeginningSpace(node, token) {
- context.report(node, token.loc.start,
- "A space is required after '" + token.value + "'");
+ context.report({
+ node: node,
+ loc: token.loc.start,
+ message: "A space is required after '" + token.value + "'",
+ fix: function(fixer) {
+ return fixer.insertTextAfter(token, " ");
+ }
+ });
}
/**
@@ -97,8 +100,32 @@ module.exports = function(context) {
* @returns {void}
*/
function reportRequiredEndingSpace(node, token) {
- context.report(node, token.loc.start,
- "A space is required before '" + token.value + "'");
+ context.report({
+ node: node,
+ loc: token.loc.start,
+ message: "A space is required before '" + token.value + "'",
+ fix: function(fixer) {
+ return fixer.insertTextBefore(token, " ");
+ }
+ });
+ }
+
+ /**
+ * Determines if a node is an object type
+ * @param {ASTNode} node - The node to check.
+ * @returns {boolean} Whether or not the node is an object type.
+ */
+ function isObjectType(node) {
+ return node && (node.type === "ObjectExpression" || node.type === "ObjectPattern");
+ }
+
+ /**
+ * Determines if a node is an array type
+ * @param {ASTNode} node - The node to check.
+ * @returns {boolean} Whether or not the node is an array type.
+ */
+ function isArrayType(node) {
+ return node && (node.type === "ArrayExpression" || node.type === "ArrayPattern");
}
/**
@@ -107,41 +134,43 @@ module.exports = function(context) {
* @returns {void}
*/
function validateArraySpacing(node) {
- if (node.elements.length === 0) {
+ if (options.spaced && node.elements.length === 0) {
return;
}
var first = context.getFirstToken(node),
second = context.getFirstToken(node, 1),
penultimate = context.getLastToken(node, 1),
- last = context.getLastToken(node);
+ last = context.getLastToken(node),
+ firstElement = node.elements[0],
+ lastElement = node.elements[node.elements.length - 1];
var openingBracketMustBeSpaced =
- options.objectsInArraysException && second.value === "{" ||
- options.arraysInArraysException && second.value === "[" ||
+ options.objectsInArraysException && isObjectType(firstElement) ||
+ options.arraysInArraysException && isArrayType(firstElement) ||
options.singleElementException && node.elements.length === 1
? !options.spaced : options.spaced;
var closingBracketMustBeSpaced =
- options.objectsInArraysException && penultimate.value === "}" ||
- options.arraysInArraysException && penultimate.value === "]" ||
+ options.objectsInArraysException && isObjectType(lastElement) ||
+ options.arraysInArraysException && isArrayType(lastElement) ||
options.singleElementException && node.elements.length === 1
? !options.spaced : options.spaced;
- if (isSameLine(first, second)) {
- if (openingBracketMustBeSpaced && !isSpaced(first, second)) {
+ if (astUtils.isTokenOnSameLine(first, second)) {
+ if (openingBracketMustBeSpaced && !sourceCode.isSpaceBetweenTokens(first, second)) {
reportRequiredBeginningSpace(node, first);
}
- if (!openingBracketMustBeSpaced && isSpaced(first, second)) {
+ if (!openingBracketMustBeSpaced && sourceCode.isSpaceBetweenTokens(first, second)) {
reportNoBeginningSpace(node, first);
}
}
- if (isSameLine(penultimate, last)) {
- if (closingBracketMustBeSpaced && !isSpaced(penultimate, last)) {
+ if (first !== penultimate && astUtils.isTokenOnSameLine(penultimate, last)) {
+ if (closingBracketMustBeSpaced && !sourceCode.isSpaceBetweenTokens(penultimate, last)) {
reportRequiredEndingSpace(node, last);
}
- if (!closingBracketMustBeSpaced && isSpaced(penultimate, last)) {
+ if (!closingBracketMustBeSpaced && sourceCode.isSpaceBetweenTokens(penultimate, last)) {
reportNoEndingSpace(node, last);
}
}
diff --git a/tools/eslint/lib/rules/arrow-body-style.js b/tools/eslint/lib/rules/arrow-body-style.js
new file mode 100644
index 00000000000000..92c8dc33a33ee7
--- /dev/null
+++ b/tools/eslint/lib/rules/arrow-body-style.js
@@ -0,0 +1,71 @@
+/**
+ * @fileoverview Rule to require braces in arrow function body.
+ * @author Alberto Rodríguez
+ * @copyright 2015 Alberto Rodríguez. All rights reserved.
+ * See LICENSE file in root directory for full license.
+ */
+"use strict";
+
+//------------------------------------------------------------------------------
+// Rule Definition
+//------------------------------------------------------------------------------
+
+module.exports = function(context) {
+ var always = context.options[0] === "always";
+ var asNeeded = !context.options[0] || context.options[0] === "as-needed";
+
+ /**
+ * Determines whether a arrow function body needs braces
+ * @param {ASTNode} node The arrow function node.
+ * @returns {void}
+ */
+ function validate(node) {
+ var arrowBody = node.body;
+ if (arrowBody.type === "BlockStatement") {
+ var blockBody = arrowBody.body;
+
+ if (blockBody.length > 1) {
+ return;
+ }
+
+ if (blockBody.length === 0) {
+ var hasComments = context.getComments(arrowBody).trailing.length > 0;
+ if (hasComments) {
+ return;
+ }
+
+ context.report({
+ node: node,
+ loc: arrowBody.loc.start,
+ message: "Unexpected empty block in arrow body."
+ });
+ } else {
+ if (asNeeded && blockBody[0].type === "ReturnStatement") {
+ context.report({
+ node: node,
+ loc: arrowBody.loc.start,
+ message: "Unexpected block statement surrounding arrow body."
+ });
+ }
+ }
+ } else {
+ if (always) {
+ context.report({
+ node: node,
+ loc: arrowBody.loc.start,
+ message: "Expected block statement surrounding arrow body."
+ });
+ }
+ }
+ }
+
+ return {
+ "ArrowFunctionExpression": validate
+ };
+};
+
+module.exports.schema = [
+ {
+ "enum": ["always", "as-needed"]
+ }
+];
diff --git a/tools/eslint/lib/rules/arrow-parens.js b/tools/eslint/lib/rules/arrow-parens.js
new file mode 100644
index 00000000000000..2332dda12134c2
--- /dev/null
+++ b/tools/eslint/lib/rules/arrow-parens.js
@@ -0,0 +1,52 @@
+/**
+ * @fileoverview Rule to require parens in arrow function arguments.
+ * @author Jxck
+ * @copyright 2015 Jxck. All rights reserved.
+ */
+"use strict";
+
+//------------------------------------------------------------------------------
+// Rule Definition
+//------------------------------------------------------------------------------
+
+module.exports = function(context) {
+ var message = "Expected parentheses around arrow function argument.";
+ var asNeededMessage = "Unexpected parentheses around single function argument";
+ var asNeeded = context.options[0] === "as-needed";
+
+ /**
+ * Determines whether a arrow function argument end with `)`
+ * @param {ASTNode} node The arrow function node.
+ * @returns {void}
+ */
+ function parens(node) {
+ var token = context.getFirstToken(node);
+
+ // as-needed: x => x
+ if (asNeeded && node.params.length === 1 && node.params[0].type === "Identifier") {
+ if (token.type === "Punctuator" && token.value === "(") {
+ context.report(node, asNeededMessage);
+ }
+ return;
+ }
+
+ if (token.type === "Identifier") {
+ var after = context.getTokenAfter(token);
+
+ // (x) => x
+ if (after.value !== ")") {
+ context.report(node, message);
+ }
+ }
+ }
+
+ return {
+ "ArrowFunctionExpression": parens
+ };
+};
+
+module.exports.schema = [
+ {
+ "enum": ["always", "as-needed"]
+ }
+];
diff --git a/tools/eslint/lib/rules/arrow-spacing.js b/tools/eslint/lib/rules/arrow-spacing.js
new file mode 100644
index 00000000000000..c1b1d73fea21db
--- /dev/null
+++ b/tools/eslint/lib/rules/arrow-spacing.js
@@ -0,0 +1,124 @@
+/**
+ * @fileoverview Rule to require parens in arrow function arguments.
+ * @author Jxck
+ * @copyright 2015 Jxck. All rights reserved.
+ */
+"use strict";
+
+//------------------------------------------------------------------------------
+// Rule Definition
+//------------------------------------------------------------------------------
+
+module.exports = function(context) {
+ // merge rules with default
+ var rule = { before: true, after: true };
+ var option = context.options[0] || {};
+ rule.before = option.before !== false;
+ rule.after = option.after !== false;
+
+ /**
+ * Get tokens of arrow(`=>`) and before/after arrow.
+ * @param {ASTNode} node The arrow function node.
+ * @returns {Object} Tokens of arrow and before/after arrow.
+ */
+ function getTokens(node) {
+ var t = context.getFirstToken(node);
+ var before;
+ while (t.type !== "Punctuator" || t.value !== "=>") {
+ before = t;
+ t = context.getTokenAfter(t);
+ }
+ var after = context.getTokenAfter(t);
+ return { before: before, arrow: t, after: after };
+ }
+
+ /**
+ * Count spaces before/after arrow(`=>`) token.
+ * @param {Object} tokens Tokens before/after arrow.
+ * @returns {Object} count of space before/after arrow.
+ */
+ function countSpaces(tokens) {
+ var before = tokens.arrow.range[0] - tokens.before.range[1];
+ var after = tokens.after.range[0] - tokens.arrow.range[1];
+ return { before: before, after: after };
+ }
+
+ /**
+ * Determines whether space(s) before after arrow(`=>`) is satisfy rule.
+ * if before/after value is `true`, there should be space(s).
+ * if before/after value is `false`, there should be no space.
+ * @param {ASTNode} node The arrow function node.
+ * @returns {void}
+ */
+ function spaces(node) {
+ var tokens = getTokens(node);
+ var countSpace = countSpaces(tokens);
+
+ if (rule.before) {
+ // should be space(s) before arrow
+ if (countSpace.before === 0) {
+ context.report({
+ node: tokens.before,
+ message: "Missing space before =>",
+ fix: function(fixer) {
+ return fixer.insertTextBefore(tokens.arrow, " ");
+ }
+ });
+ }
+ } else {
+ // should be no space before arrow
+ if (countSpace.before > 0) {
+ context.report({
+ node: tokens.before,
+ message: "Unexpected space before =>",
+ fix: function(fixer) {
+ return fixer.removeRange([tokens.before.range[1], tokens.arrow.range[0]]);
+ }
+ });
+ }
+ }
+
+ if (rule.after) {
+ // should be space(s) after arrow
+ if (countSpace.after === 0) {
+ context.report({
+ node: tokens.after,
+ message: "Missing space after =>",
+ fix: function(fixer) {
+ return fixer.insertTextAfter(tokens.arrow, " ");
+ }
+ });
+ }
+ } else {
+ // should be no space after arrow
+ if (countSpace.after > 0) {
+ context.report({
+ node: tokens.after,
+ message: "Unexpected space after =>",
+ fix: function(fixer) {
+ return fixer.removeRange([tokens.arrow.range[1], tokens.after.range[0]]);
+ }
+ });
+ }
+ }
+ }
+
+ return {
+ "ArrowFunctionExpression": spaces
+ };
+};
+
+module.exports.schema = [
+ {
+ "type": "object",
+ "properties": {
+ "before": {
+ "type": "boolean"
+ },
+ "after": {
+ "type": "boolean"
+ }
+ },
+ "additionalProperties": false
+ }
+];
diff --git a/tools/eslint/lib/rules/block-scoped-var.js b/tools/eslint/lib/rules/block-scoped-var.js
index a463b12daf61bf..1c6b05538808ef 100644
--- a/tools/eslint/lib/rules/block-scoped-var.js
+++ b/tools/eslint/lib/rules/block-scoped-var.js
@@ -1,318 +1,140 @@
/**
* @fileoverview Rule to check for "block scoped" variables by binding context
* @author Matt DuVall
+ * @copyright 2015 Toru Nagashima. All rights reserved.
+ * @copyright 2015 Mathieu M-Gosselin. All rights reserved.
*/
"use strict";
//------------------------------------------------------------------------------
-// Rule Definition
+// Helpers
//------------------------------------------------------------------------------
-module.exports = function(context) {
-
- var scopeStack = [];
-
- //--------------------------------------------------------------------------
- // Helpers
- //--------------------------------------------------------------------------
-
- /**
- * Determines whether an identifier is in declaration position or is a non-declaration reference.
- * @param {ASTNode} id The identifier.
- * @param {ASTNode} parent The identifier's parent AST node.
- * @returns {Boolean} true when the identifier is in declaration position.
- */
- function isDeclaration(id, parent) {
- switch (parent.type) {
- case "FunctionDeclaration":
- case "FunctionExpression":
- return parent.params.indexOf(id) > -1 || id === parent.id;
-
- case "VariableDeclarator":
- return id === parent.id;
+/**
+ * Collects unresolved references from the global scope, then creates a map to references from its name.
+ * @param {RuleContext} context - The current context.
+ * @returns {object} A map object. Its key is the variable names. Its value is the references of each variable.
+ */
+function collectUnresolvedReferences(context) {
+ var unresolved = Object.create(null);
+ var references = context.getScope().through;
- case "CatchClause":
- return id === parent.param;
+ for (var i = 0; i < references.length; ++i) {
+ var reference = references[i];
+ var name = reference.identifier.name;
- default:
- return false;
+ if (name in unresolved === false) {
+ unresolved[name] = [];
}
+ unresolved[name].push(reference);
}
- /**
- * Determines whether an identifier is in property position.
- * @param {ASTNode} id The identifier.
- * @param {ASTNode} parent The identifier's parent AST node.
- * @returns {Boolean} true when the identifier is in property position.
- */
- function isProperty(id, parent) {
- switch (parent.type) {
- case "MemberExpression":
- return id === parent.property && !parent.computed;
+ return unresolved;
+}
- case "Property":
- return id === parent.key;
-
- default:
- return false;
- }
- }
+//------------------------------------------------------------------------------
+// Rule Definition
+//------------------------------------------------------------------------------
- /**
- * Pushes a new scope object on the scope stack.
- * @returns {void}
- */
- function pushScope() {
- scopeStack.push([]);
- }
+module.exports = function(context) {
+ var unresolvedReferences = Object.create(null);
+ var stack = [];
/**
- * Removes the topmost scope object from the scope stack.
+ * Makes a block scope.
+ * @param {ASTNode} node - A node of a scope.
* @returns {void}
*/
- function popScope() {
- scopeStack.pop();
+ function enterScope(node) {
+ stack.push(node.range);
}
/**
- * Declares the given names in the topmost scope object.
- * @param {[String]} names A list of names to declare.
+ * Pops the last block scope.
* @returns {void}
*/
- function declare(names) {
- [].push.apply(scopeStack[scopeStack.length - 1], names);
+ function exitScope() {
+ stack.pop();
}
- //--------------------------------------------------------------------------
- // Public API
- //--------------------------------------------------------------------------
-
/**
- * Declares all relevant identifiers for module imports.
- * @param {ASTNode} node The AST node representing an import.
+ * Reports a given reference.
+ * @param {escope.Reference} reference - A reference to report.
* @returns {void}
- * @private
*/
- function declareImports(node) {
- declare([node.local.name]);
-
- if (node.imported && node.imported.name !== node.local.name) {
- declare([node.imported.name]);
- }
+ function report(reference) {
+ var identifier = reference.identifier;
+ context.report(
+ identifier,
+ "\"{{name}}\" used outside of binding context.",
+ {name: identifier.name});
}
/**
- * Declares all relevant identifiers for classes.
- * @param {ASTNode} node The AST node representing a class.
+ * Finds and reports references which are outside of valid scopes.
+ * @param {ASTNode} node - A node to get variables.
* @returns {void}
- * @private
*/
- function declareClass(node) {
-
- if (node.id) {
- declare([node.id.name]);
+ function checkForVariables(node) {
+ if (node.kind !== "var") {
+ return;
}
- pushScope();
- }
-
- /**
- * Declares all relevant identifiers for classes.
- * @param {ASTNode} node The AST node representing a class.
- * @returns {void}
- * @private
- */
- function declareClassMethod(node) {
- pushScope();
+ var isGlobal = context.getScope().type === "global";
- declare([node.key.name]);
- }
+ // Defines a predicate to check whether or not a given reference is outside of valid scope.
+ var scopeRange = stack[stack.length - 1];
- /**
- * Add declarations based on the type of node being passed.
- * @param {ASTNode} node The node containing declarations.
- * @returns {void}
- * @private
- */
- function declareByNodeType(node) {
-
- var declarations = [];
-
- switch (node.type) {
- case "Identifier":
- declarations.push(node.name);
- break;
-
- case "ObjectPattern":
- node.properties.forEach(function(property) {
- declarations.push(property.key.name);
- if (property.value) {
- declarations.push(property.value.name);
- }
- });
- break;
-
- case "ArrayPattern":
- node.elements.forEach(function(element) {
- if (element) {
- declarations.push(element.name);
- }
- });
- break;
-
- case "AssignmentPattern":
- declareByNodeType(node.left);
- break;
-
- case "RestElement":
- declareByNodeType(node.argument);
- break;
-
- // no default
+ /**
+ * Check if a reference is out of scope
+ * @param {ASTNode} reference node to examine
+ * @returns {boolean} True is its outside the scope
+ * @private
+ */
+ function isOutsideOfScope(reference) {
+ var idRange = reference.identifier.range;
+ return idRange[0] < scopeRange[0] || idRange[1] > scopeRange[1];
}
- declare(declarations);
+ // Gets declared variables, and checks its references.
+ var variables = context.getDeclaredVariables(node);
+ for (var i = 0; i < variables.length; ++i) {
+ var variable = variables[i];
+ var references = variable.references;
- }
-
- /**
- * Adds declarations of the function parameters and pushes the scope
- * @param {ASTNode} node The node containing declarations.
- * @returns {void}
- * @private
- */
- function functionHandler(node) {
- pushScope();
-
- node.params.forEach(function(param) {
- declareByNodeType(param);
- });
-
- declare(node.rest ? [node.rest.name] : []);
- declare(["arguments"]);
- }
-
- /**
- * Adds declaration of the function name in its parent scope then process the function
- * @param {ASTNode} node The node containing declarations.
- * @returns {void}
- * @private
- */
- function functionDeclarationHandler(node) {
- declare(node.id ? [node.id.name] : []);
- functionHandler(node);
- }
-
- /**
- * Process function declarations and declares its name in its own scope
- * @param {ASTNode} node The node containing declarations.
- * @returns {void}
- * @private
- */
- function functionExpressionHandler(node) {
- functionHandler(node);
- declare(node.id ? [node.id.name] : []);
- }
-
- function variableDeclarationHandler(node) {
- node.declarations.forEach(function(declaration) {
- declareByNodeType(declaration.id);
- });
+ // Global variables are not resolved.
+ // In this case, use unresolved references.
+ if (isGlobal && variable.name in unresolvedReferences) {
+ references = unresolvedReferences[variable.name];
+ }
+ // Reports.
+ references.filter(isOutsideOfScope).forEach(report);
+ }
}
return {
- "Program": function() {
- var scope = context.getScope();
- scopeStack = [scope.variables.map(function(v) {
- return v.name;
- })];
-
- // global return creates another scope
- if (context.ecmaFeatures.globalReturn) {
- scope = scope.childScopes[0];
- scopeStack.push(scope.variables.map(function(v) {
- return v.name;
- }));
- }
- },
-
- "ImportSpecifier": declareImports,
- "ImportDefaultSpecifier": declareImports,
- "ImportNamespaceSpecifier": declareImports,
-
- "BlockStatement": function(node) {
- var statements = node.body;
- pushScope();
- statements.forEach(function(stmt) {
- if (stmt.type === "VariableDeclaration") {
- variableDeclarationHandler(stmt);
- } else if (stmt.type === "FunctionDeclaration") {
- declare([stmt.id.name]);
- }
- });
+ "Program": function(node) {
+ unresolvedReferences = collectUnresolvedReferences(context);
+ stack = [node.range];
},
- "VariableDeclaration": function (node) {
- variableDeclarationHandler(node);
- },
-
- "BlockStatement:exit": popScope,
-
- "CatchClause": function(node) {
- pushScope();
- declare([node.param.name]);
- },
- "CatchClause:exit": popScope,
-
- "FunctionDeclaration": functionDeclarationHandler,
- "FunctionDeclaration:exit": popScope,
-
- "ClassDeclaration": declareClass,
- "ClassDeclaration:exit": popScope,
-
- "ClassExpression": declareClass,
- "ClassExpression:exit": popScope,
-
- "MethodDefinition": declareClassMethod,
- "MethodDefinition:exit": popScope,
-
- "FunctionExpression": functionExpressionHandler,
- "FunctionExpression:exit": popScope,
-
- // Arrow functions cannot have names
- "ArrowFunctionExpression": functionHandler,
- "ArrowFunctionExpression:exit": popScope,
-
- "ForStatement": function() {
- pushScope();
- },
- "ForStatement:exit": popScope,
-
- "ForInStatement": function() {
- pushScope();
- },
- "ForInStatement:exit": popScope,
-
- "ForOfStatement": function() {
- pushScope();
- },
- "ForOfStatement:exit": popScope,
-
- "Identifier": function(node) {
- var ancestor = context.getAncestors().pop();
- if (isDeclaration(node, ancestor) || isProperty(node, ancestor) || ancestor.type === "LabeledStatement") {
- return;
- }
-
- for (var i = 0, l = scopeStack.length; i < l; i++) {
- if (scopeStack[i].indexOf(node.name) > -1) {
- return;
- }
- }
-
- context.report(node, "\"" + node.name + "\" used outside of binding context.");
- }
+ // Manages scopes.
+ "BlockStatement": enterScope,
+ "BlockStatement:exit": exitScope,
+ "ForStatement": enterScope,
+ "ForStatement:exit": exitScope,
+ "ForInStatement": enterScope,
+ "ForInStatement:exit": exitScope,
+ "ForOfStatement": enterScope,
+ "ForOfStatement:exit": exitScope,
+ "SwitchStatement": enterScope,
+ "SwitchStatement:exit": exitScope,
+ "CatchClause": enterScope,
+ "CatchClause:exit": exitScope,
+
+ // Finds and reports references which are outside of valid scope.
+ "VariableDeclaration": checkForVariables
};
};
diff --git a/tools/eslint/lib/rules/block-spacing.js b/tools/eslint/lib/rules/block-spacing.js
new file mode 100644
index 00000000000000..d7bbbf11a2b7d2
--- /dev/null
+++ b/tools/eslint/lib/rules/block-spacing.js
@@ -0,0 +1,119 @@
+/**
+ * @fileoverview A rule to disallow or enforce spaces inside of single line blocks.
+ * @author Toru Nagashima
+ * @copyright 2015 Toru Nagashima. All rights reserved.
+ */
+
+"use strict";
+
+var util = require("../ast-utils");
+
+//------------------------------------------------------------------------------
+// Rule Definition
+//------------------------------------------------------------------------------
+
+module.exports = function(context) {
+ var always = (context.options[0] !== "never"),
+ message = always ? "Requires a space" : "Unexpected space(s)",
+ sourceCode = context.getSourceCode();
+
+ /**
+ * Gets the open brace token from a given node.
+ * @param {ASTNode} node - A BlockStatement/SwitchStatement node to get.
+ * @returns {Token} The token of the open brace.
+ */
+ function getOpenBrace(node) {
+ if (node.type === "SwitchStatement") {
+ if (node.cases.length > 0) {
+ return context.getTokenBefore(node.cases[0]);
+ }
+ return context.getLastToken(node, 1);
+ }
+ return context.getFirstToken(node);
+ }
+
+ /**
+ * Checks whether or not:
+ * - given tokens are on same line.
+ * - there is/isn't a space between given tokens.
+ * @param {Token} left - A token to check.
+ * @param {Token} right - The token which is next to `left`.
+ * @returns {boolean}
+ * When the option is `"always"`, `true` if there are one or more spaces between given tokens.
+ * When the option is `"never"`, `true` if there are not any spaces between given tokens.
+ * If given tokens are not on same line, it's always `true`.
+ */
+ function isValid(left, right) {
+ return (
+ !util.isTokenOnSameLine(left, right) ||
+ sourceCode.isSpaceBetweenTokens(left, right) === always
+ );
+ }
+
+ /**
+ * Reports invalid spacing style inside braces.
+ * @param {ASTNode} node - A BlockStatement/SwitchStatement node to get.
+ * @returns {void}
+ */
+ function checkSpacingInsideBraces(node) {
+ // Gets braces and the first/last token of content.
+ var openBrace = getOpenBrace(node);
+ var closeBrace = context.getLastToken(node);
+ var firstToken = sourceCode.getTokenOrCommentAfter(openBrace);
+ var lastToken = sourceCode.getTokenOrCommentBefore(closeBrace);
+
+ // Skip if the node is invalid or empty.
+ if (openBrace.type !== "Punctuator" ||
+ openBrace.value !== "{" ||
+ closeBrace.type !== "Punctuator" ||
+ closeBrace.value !== "}" ||
+ firstToken === closeBrace
+ ) {
+ return;
+ }
+
+ // Skip line comments for option never
+ if (!always && firstToken.type === "Line") {
+ return;
+ }
+
+ // Check.
+ if (!isValid(openBrace, firstToken)) {
+ context.report({
+ node: node,
+ loc: openBrace.loc.start,
+ message: message + " after \"{\".",
+ fix: function(fixer) {
+ if (always) {
+ return fixer.insertTextBefore(firstToken, " ");
+ }
+
+ return fixer.removeRange([openBrace.range[1], firstToken.range[0]]);
+ }
+ });
+ }
+ if (!isValid(lastToken, closeBrace)) {
+ context.report({
+ node: node,
+ loc: closeBrace.loc.start,
+ message: message + " before \"}\".",
+ fix: function(fixer) {
+ if (always) {
+ return fixer.insertTextAfter(lastToken, " ");
+ }
+
+ return fixer.removeRange([lastToken.range[1], closeBrace.range[0]]);
+ }
+ });
+ }
+ }
+
+ return {
+ BlockStatement: checkSpacingInsideBraces,
+ SwitchStatement: checkSpacingInsideBraces
+ };
+};
+
+module.exports.schema = [
+ {enum: ["always", "never"]}
+];
diff --git a/tools/eslint/lib/rules/brace-style.js b/tools/eslint/lib/rules/brace-style.js
index 2e56377f05001b..a64d0c7811e1eb 100644
--- a/tools/eslint/lib/rules/brace-style.js
+++ b/tools/eslint/lib/rules/brace-style.js
@@ -14,10 +14,11 @@ module.exports = function(context) {
var params = context.options[1] || {};
var OPEN_MESSAGE = "Opening curly brace does not appear on the same line as controlling statement.",
+ OPEN_MESSAGE_ALLMAN = "Opening curly brace appears on the same line as controlling statement.",
BODY_MESSAGE = "Statement inside of curly braces should be on next line.",
CLOSE_MESSAGE = "Closing curly brace does not appear on the same line as the subsequent block.",
CLOSE_MESSAGE_SINGLE = "Closing curly brace should be on the same line as opening curly brace or on the line after the previous block.",
- CLOSE_MESSAGE_STROUSTRUP = "Closing curly brace appears on the same line as the subsequent block.";
+ CLOSE_MESSAGE_STROUSTRUP_ALLMAN = "Closing curly brace appears on the same line as the subsequent block.";
//--------------------------------------------------------------------------
// Helpers
@@ -57,28 +58,30 @@ module.exports = function(context) {
return function(node) {
[].forEach.call(blockProperties, function(blockProp) {
var block = node[blockProp], previousToken, curlyToken, curlyTokenEnd, curlyTokensOnSameLine;
- block = node[blockProp];
- if (isBlock(block)) {
+ if (!isBlock(block)) {
+ return;
+ }
- previousToken = context.getTokenBefore(block);
- curlyToken = context.getFirstToken(block);
- curlyTokenEnd = context.getLastToken(block);
- curlyTokensOnSameLine = curlyToken.loc.start.line === curlyTokenEnd.loc.start.line;
+ previousToken = context.getTokenBefore(block);
+ curlyToken = context.getFirstToken(block);
+ curlyTokenEnd = context.getLastToken(block);
+ curlyTokensOnSameLine = curlyToken.loc.start.line === curlyTokenEnd.loc.start.line;
- if (previousToken.loc.start.line !== curlyToken.loc.start.line) {
- context.report(node, OPEN_MESSAGE);
- } else if (block.body.length && params.allowSingleLine) {
+ if (style !== "allman" && previousToken.loc.start.line !== curlyToken.loc.start.line) {
+ context.report(node, OPEN_MESSAGE);
+ } else if (style === "allman" && previousToken.loc.start.line === curlyToken.loc.start.line && !params.allowSingleLine) {
+ context.report(node, OPEN_MESSAGE_ALLMAN);
+ }
- if (curlyToken.loc.start.line === block.body[0].loc.start.line && !curlyTokensOnSameLine) {
- context.report(block.body[0], BODY_MESSAGE);
- } else if (curlyTokenEnd.loc.start.line === block.body[block.body.length - 1].loc.start.line && !curlyTokensOnSameLine) {
- context.report(block.body[block.body.length - 1], CLOSE_MESSAGE_SINGLE);
- }
+ if (!block.body.length || curlyTokensOnSameLine && params.allowSingleLine) {
+ return;
+ }
- } else if (block.body.length && curlyToken.loc.start.line === block.body[0].loc.start.line) {
- context.report(block.body[0], BODY_MESSAGE);
- }
+ if (curlyToken.loc.start.line === block.body[0].loc.start.line) {
+ context.report(block.body[0], BODY_MESSAGE);
+ } else if (curlyTokenEnd.loc.start.line === block.body[block.body.length - 1].loc.start.line) {
+ context.report(block.body[block.body.length - 1], CLOSE_MESSAGE_SINGLE);
}
});
};
@@ -106,13 +109,13 @@ module.exports = function(context) {
tokens = context.getTokensBefore(node.alternate, 2);
if (style === "1tbs") {
- if (tokens[0].loc.start.line !== tokens[1].loc.start.line && isCurlyPunctuator(tokens[0]) ) {
+ if (tokens[0].loc.start.line !== tokens[1].loc.start.line &&
+ node.consequent.type === "BlockStatement" &&
+ isCurlyPunctuator(tokens[0]) ) {
context.report(node.alternate, CLOSE_MESSAGE);
}
- } else if (style === "stroustrup") {
- if (tokens[0].loc.start.line === tokens[1].loc.start.line) {
- context.report(node.alternate, CLOSE_MESSAGE_STROUSTRUP);
- }
+ } else if (tokens[0].loc.start.line === tokens[1].loc.start.line) {
+ context.report(node.alternate, CLOSE_MESSAGE_STROUSTRUP_ALLMAN);
}
}
@@ -136,10 +139,8 @@ module.exports = function(context) {
if (tokens[0].loc.start.line !== tokens[1].loc.start.line) {
context.report(node.finalizer, CLOSE_MESSAGE);
}
- } else if (style === "stroustrup") {
- if (tokens[0].loc.start.line === tokens[1].loc.start.line) {
- context.report(node.finalizer, CLOSE_MESSAGE_STROUSTRUP);
- }
+ } else if (tokens[0].loc.start.line === tokens[1].loc.start.line) {
+ context.report(node.finalizer, CLOSE_MESSAGE_STROUSTRUP_ALLMAN);
}
}
}
@@ -161,9 +162,9 @@ module.exports = function(context) {
if (previousToken.loc.start.line !== firstToken.loc.start.line) {
context.report(node, CLOSE_MESSAGE);
}
- } else if (style === "stroustrup") {
+ } else {
if (previousToken.loc.start.line === firstToken.loc.start.line) {
- context.report(node, CLOSE_MESSAGE_STROUSTRUP);
+ context.report(node, CLOSE_MESSAGE_STROUSTRUP_ALLMAN);
}
}
}
@@ -179,14 +180,14 @@ module.exports = function(context) {
var tokens;
if (node.cases && node.cases.length) {
tokens = context.getTokensBefore(node.cases[0], 2);
- if (tokens[0].loc.start.line !== tokens[1].loc.start.line) {
- context.report(node, OPEN_MESSAGE);
- }
} else {
tokens = context.getLastTokens(node, 3);
- if (tokens[0].loc.start.line !== tokens[1].loc.start.line) {
- context.report(node, OPEN_MESSAGE);
- }
+ }
+
+ if (style !== "allman" && tokens[0].loc.start.line !== tokens[1].loc.start.line) {
+ context.report(node, OPEN_MESSAGE);
+ } else if (style === "allman" && tokens[0].loc.start.line === tokens[1].loc.start.line) {
+ context.report(node, OPEN_MESSAGE_ALLMAN);
}
}
@@ -214,7 +215,7 @@ module.exports = function(context) {
module.exports.schema = [
{
- "enum": ["1tbs", "stroustrup"]
+ "enum": ["1tbs", "stroustrup", "allman"]
},
{
"type": "object",
diff --git a/tools/eslint/lib/rules/callback-return.js b/tools/eslint/lib/rules/callback-return.js
new file mode 100644
index 00000000000000..d2a5d5febc04d3
--- /dev/null
+++ b/tools/eslint/lib/rules/callback-return.js
@@ -0,0 +1,142 @@
+/**
+ * @fileoverview Enforce return after a callback.
+ * @author Jamund Ferguson
+ * @copyright 2015 Jamund Ferguson. All rights reserved.
+ */
+"use strict";
+
+//------------------------------------------------------------------------------
+// Rule Definition
+//------------------------------------------------------------------------------
+
+module.exports = function(context) {
+
+ var callbacks = context.options[0] || ["callback", "cb", "next"];
+
+ //--------------------------------------------------------------------------
+ // Helpers
+ //--------------------------------------------------------------------------
+
+ /**
+ * Find the closest parent matching a list of types.
+ * @param {ASTNode} node The node whose parents we are searching
+ * @param {Array} types The node types to match
+ * @returns {ASTNode} The matched node or undefined.
+ */
+ function findClosestParentOfType(node, types) {
+ if (!node.parent) {
+ return null;
+ }
+ if (types.indexOf(node.parent.type) === -1) {
+ return findClosestParentOfType(node.parent, types);
+ }
+ return node.parent;
+ }
+
+ /**
+ * Check to see if a CallExpression is in our callback list.
+ * @param {ASTNode} node The node to check against our callback names list.
+ * @returns {Boolean} Whether or not this function matches our callback name.
+ */
+ function isCallback(node) {
+ return node.callee.type === "Identifier" && callbacks.indexOf(node.callee.name) > -1;
+ }
+
+ /**
+ * Determines whether or not the callback is part of a callback expression.
+ * @param {ASTNode} node The callback node
+ * @param {ASTNode} parentNode The expression node
+ * @returns {boolean} Whether or not this is part of a callback expression
+ */
+ function isCallbackExpression(node, parentNode) {
+
+ // ensure the parent node exists and is an expression
+ if (!parentNode || parentNode.type !== "ExpressionStatement") {
+ return false;
+ }
+
+ // cb()
+ if (parentNode.expression === node) {
+ return true;
+ }
+
+ // special case for cb && cb() and similar
+ if (parentNode.expression.type === "BinaryExpression" || parentNode.expression.type === "LogicalExpression") {
+ if (parentNode.expression.right === node) {
+ return true;
+ }
+ }
+ }
+
+ //--------------------------------------------------------------------------
+ // Public
+ //--------------------------------------------------------------------------
+
+ return {
+ "CallExpression": function(node) {
+
+ // if we"re not a callback we can return
+ if (!isCallback(node)) {
+ return;
+ }
+
+ // find the closest block, return or loop
+ var closestBlock = findClosestParentOfType(node, ["BlockStatement", "ReturnStatement", "ArrowFunctionExpression"]) || {},
+ lastItem, parentType;
+
+ // if our parent is a return we know we're ok
+ if (closestBlock.type === "ReturnStatement" ) {
+ return;
+ }
+
+ // arrow functions don't always have blocks and implicitly return
+ if (closestBlock.type === "ArrowFunctionExpression") {
+ return;
+ }
+
+ // block statements are part of functions and most if statements
+ if (closestBlock.type === "BlockStatement") {
+
+ // find the last item in the block
+ lastItem = closestBlock.body[closestBlock.body.length - 1];
+
+ // if the callback is the last thing in a block that might be ok
+ if (isCallbackExpression(node, lastItem)) {
+
+ parentType = closestBlock.parent.type;
+
+ // but only if the block is part of a function
+ if (parentType === "FunctionExpression" ||
+ parentType === "FunctionDeclaration" ||
+ parentType === "ArrowFunctionExpression"
+ ) {
+ return;
+ }
+
+ }
+
+ // ending a block with a return is also ok
+ if (lastItem.type === "ReturnStatement") {
+
+ // but only if the callback is immediately before
+ if (isCallbackExpression(node, closestBlock.body[closestBlock.body.length - 2])) {
+ return;
+ }
+ }
+
+ }
+
+ // as long as you're the child of a function at this point you should be asked to return
+ if (findClosestParentOfType(node, ["FunctionDeclaration", "FunctionExpression", "ArrowFunctionExpression"])) {
+ context.report(node, "Expected return with your callback function.");
+ }
+
+ }
+
+ };
+};
+
+module.exports.schema = [{
+ type: "array",
+ items: { type: "string" }
+}];
diff --git a/tools/eslint/lib/rules/comma-dangle.js b/tools/eslint/lib/rules/comma-dangle.js
index 1c8f79ea9e0a16..d1755e2ab560a7 100644
--- a/tools/eslint/lib/rules/comma-dangle.js
+++ b/tools/eslint/lib/rules/comma-dangle.js
@@ -1,60 +1,203 @@
/**
* @fileoverview Rule to forbid or enforce dangling commas.
* @author Ian Christian Myers
+ * @copyright 2015 Toru Nagashima
* @copyright 2015 Mathias Schreck
* @copyright 2013 Ian Christian Myers
+ * See LICENSE file in root directory for full license.
*/
"use strict";
+//------------------------------------------------------------------------------
+// Helpers
+//------------------------------------------------------------------------------
+
+/**
+ * Gets the last element of a given array.
+ *
+ * @param {*[]} xs - An array to get.
+ * @returns {*} The last element, or undefined.
+ */
+function getLast(xs) {
+ if (xs.length === 0) {
+ return null;
+ }
+ return xs[xs.length - 1];
+}
+
+/**
+ * Checks whether or not a trailing comma is allowed in a given node.
+ * `ArrayPattern` which has `RestElement` disallows it.
+ *
+ * @param {ASTNode} node - A node to check.
+ * @param {ASTNode} lastItem - The node of the last element in the given node.
+ * @returns {boolean} `true` if a trailing comma is allowed.
+ */
+function isTrailingCommaAllowed(node, lastItem) {
+ switch (node.type) {
+ case "ArrayPattern":
+ // TODO(t-nagashima): Remove SpreadElement after https://github.com/eslint/espree/issues/194 was fixed.
+ return (
+ lastItem.type !== "RestElement" &&
+ lastItem.type !== "SpreadElement"
+ );
+
+ // TODO(t-nagashima): Remove this case after https://github.com/eslint/espree/issues/195 was fixed.
+ case "ArrayExpression":
+ return (
+ node.parent.type !== "ForOfStatement" ||
+ node.parent.left !== node ||
+ lastItem.type !== "SpreadElement"
+ );
+
+ default:
+ return true;
+ }
+}
+
//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------
-module.exports = function (context) {
- var allowDangle = context.options[0];
- var forbidDangle = allowDangle !== "always-multiline" && allowDangle !== "always";
+module.exports = function(context) {
+ var mode = context.options[0];
var UNEXPECTED_MESSAGE = "Unexpected trailing comma.";
var MISSING_MESSAGE = "Missing trailing comma.";
/**
- * Checks the given node for trailing comma and reports violations.
- * @param {ASTNode} node The node of an ObjectExpression or ArrayExpression
+ * Checks whether or not a given node is multiline.
+ * This rule handles a given node as multiline when the closing parenthesis
+ * and the last element are not on the same line.
+ *
+ * @param {ASTNode} node - A ndoe to check.
+ * @returns {boolean} `true` if the node is multiline.
+ */
+ function isMultiline(node) {
+ var lastItem = getLast(node.properties || node.elements || node.specifiers);
+ if (!lastItem) {
+ return false;
+ }
+
+ var sourceCode = context.getSourceCode(),
+ penultimateToken = sourceCode.getLastToken(lastItem),
+ lastToken = sourceCode.getLastToken(node);
+
+ if (lastToken.value === ",") {
+ penultimateToken = lastToken;
+ lastToken = sourceCode.getTokenAfter(lastToken);
+ }
+
+ return lastToken.loc.end.line !== penultimateToken.loc.end.line;
+ }
+
+ /**
+ * Reports a trailing comma if it exists.
+ *
+ * @param {ASTNode} node - A node to check. Its type is one of
+ * ObjectExpression, ObjectPattern, ArrayExpression, ArrayPattern,
+ * ImportDeclaration, and ExportNamedDeclaration.
* @returns {void}
*/
- function checkForTrailingComma(node) {
- var items = node.properties || node.elements,
- length = items.length,
- lastTokenOnNewLine,
- lastItem,
- penultimateToken,
- hasDanglingComma;
-
- if (length) {
- lastItem = items[length - 1];
- if (lastItem) {
- penultimateToken = context.getLastToken(node, 1);
- hasDanglingComma = penultimateToken.value === ",";
-
- if (forbidDangle && hasDanglingComma) {
- context.report(lastItem, penultimateToken.loc.start, UNEXPECTED_MESSAGE);
- } else if (allowDangle === "always-multiline") {
- lastTokenOnNewLine = node.loc.end.line !== penultimateToken.loc.end.line;
- if (hasDanglingComma && !lastTokenOnNewLine) {
- context.report(lastItem, penultimateToken.loc.start, UNEXPECTED_MESSAGE);
- } else if (!hasDanglingComma && lastTokenOnNewLine) {
- context.report(lastItem, penultimateToken.loc.end, MISSING_MESSAGE);
- }
- } else if (allowDangle === "always" && !hasDanglingComma) {
- context.report(lastItem, lastItem.loc.end, MISSING_MESSAGE);
- }
- }
+ function forbidTrailingComma(node) {
+ var lastItem = getLast(node.properties || node.elements || node.specifiers);
+ if (!lastItem || (node.type === "ImportDeclaration" && lastItem.type !== "ImportSpecifier")) {
+ return;
}
+
+ var sourceCode = context.getSourceCode(),
+ trailingToken;
+
+ // last item can be surrounded by parentheses for object and array literals
+ if (node.type === "ObjectExpression" || node.type === "ArrayExpression") {
+ trailingToken = sourceCode.getTokenBefore(sourceCode.getLastToken(node));
+ } else {
+ trailingToken = sourceCode.getTokenAfter(lastItem);
+ }
+
+ if (trailingToken.value === ",") {
+ context.report(
+ lastItem,
+ trailingToken.loc.start,
+ UNEXPECTED_MESSAGE);
+ }
+ }
+
+ /**
+ * Reports the last element of a given node if it does not have a trailing
+ * comma.
+ *
+ * If a given node is `ArrayPattern` which has `RestElement`, the trailing
+ * comma is disallowed, so report if it exists.
+ *
+ * @param {ASTNode} node - A node to check. Its type is one of
+ * ObjectExpression, ObjectPattern, ArrayExpression, ArrayPattern,
+ * ImportDeclaration, and ExportNamedDeclaration.
+ * @returns {void}
+ */
+ function forceTrailingComma(node) {
+ var lastItem = getLast(node.properties || node.elements || node.specifiers);
+ if (!lastItem || (node.type === "ImportDeclaration" && lastItem.type !== "ImportSpecifier")) {
+ return;
+ }
+ if (!isTrailingCommaAllowed(node, lastItem)) {
+ forbidTrailingComma(node);
+ return;
+ }
+
+ var sourceCode = context.getSourceCode(),
+ trailingToken;
+
+ // last item can be surrounded by parentheses for object and array literals
+ if (node.type === "ObjectExpression" || node.type === "ArrayExpression") {
+ trailingToken = sourceCode.getTokenBefore(sourceCode.getLastToken(node));
+ } else {
+ trailingToken = sourceCode.getTokenAfter(lastItem);
+ }
+
+ if (trailingToken.value !== ",") {
+ context.report(
+ lastItem,
+ lastItem.loc.end,
+ MISSING_MESSAGE);
+ }
+ }
+
+ /**
+ * If a given node is multiline, reports the last element of a given node
+ * when it does not have a trailing comma.
+ * Otherwise, reports a trailing comma if it exists.
+ *
+ * @param {ASTNode} node - A node to check. Its type is one of
+ * ObjectExpression, ObjectPattern, ArrayExpression, ArrayPattern,
+ * ImportDeclaration, and ExportNamedDeclaration.
+ * @returns {void}
+ */
+ function forceTrailingCommaIfMultiline(node) {
+ if (isMultiline(node)) {
+ forceTrailingComma(node);
+ } else {
+ forbidTrailingComma(node);
+ }
+ }
+
+ // Chooses a checking function.
+ var checkForTrailingComma;
+ if (mode === "always") {
+ checkForTrailingComma = forceTrailingComma;
+ } else if (mode === "always-multiline") {
+ checkForTrailingComma = forceTrailingCommaIfMultiline;
+ } else {
+ checkForTrailingComma = forbidTrailingComma;
}
return {
"ObjectExpression": checkForTrailingComma,
- "ArrayExpression": checkForTrailingComma
+ "ObjectPattern": checkForTrailingComma,
+ "ArrayExpression": checkForTrailingComma,
+ "ArrayPattern": checkForTrailingComma,
+ "ImportDeclaration": checkForTrailingComma,
+ "ExportNamedDeclaration": checkForTrailingComma
};
};
diff --git a/tools/eslint/lib/rules/comma-spacing.js b/tools/eslint/lib/rules/comma-spacing.js
index 5204801504a2e5..de7da6aff6a120 100644
--- a/tools/eslint/lib/rules/comma-spacing.js
+++ b/tools/eslint/lib/rules/comma-spacing.js
@@ -5,12 +5,17 @@
*/
"use strict";
+var astUtils = require("../ast-utils");
+
//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------
module.exports = function(context) {
+ var sourceCode = context.getSourceCode();
+ var tokensAndComments = sourceCode.tokensAndComments;
+
var options = {
before: context.options[0] ? !!context.options[0].before : false,
after: context.options[0] ? !!context.options[0].after : true
@@ -20,47 +25,8 @@ module.exports = function(context) {
// Helpers
//--------------------------------------------------------------------------
- // the index of the last comment that was checked
- var lastCommentIndex = 0;
- var allComments;
-
- /**
- * Determines the length of comment between 2 tokens
- * @param {Object} left - The left token object.
- * @param {Object} right - The right token object.
- * @returns {number} Length of comment in between tokens
- */
- function getCommentLengthBetweenTokens(left, right) {
- return allComments.reduce(function(val, comment) {
- if (left.range[1] <= comment.range[0] && comment.range[1] <= right.range[0]) {
- val = val + comment.range[1] - comment.range[0];
- }
- return val;
- }, 0);
- }
-
- /**
- * Determines whether two adjacent tokens have whitespace between them.
- * @param {Object} left - The left token object.
- * @param {Object} right - The right token object.
- * @returns {boolean} Whether or not there is space between the tokens.
- */
- function isSpaced(left, right) {
- var punctuationLength = context.getTokensBetween(left, right).length; // the length of any parenthesis
- var commentLenth = getCommentLengthBetweenTokens(left, right);
- return (left.range[1] + punctuationLength + commentLenth) < right.range[0];
- }
-
- /**
- * Checks whether two tokens are on the same line.
- * @param {ASTNode} left The leftmost token.
- * @param {ASTNode} right The rightmost token.
- * @returns {boolean} True if the tokens are on the same line, false if not.
- * @private
- */
- function isSameLine(left, right) {
- return left.loc.end.line === right.loc.start.line;
- }
+ // list of comma tokens to ignore for the check of leading whitespace
+ var commaTokensToIgnore = [];
/**
* Determines if a given token is a comma operator.
@@ -76,13 +42,39 @@ module.exports = function(context) {
* Reports a spacing error with an appropriate message.
* @param {ASTNode} node The binary expression node to report.
* @param {string} dir Is the error "before" or "after" the comma?
+ * @param {ASTNode} otherNode The node at the left or right of `node`
* @returns {void}
* @private
*/
- function report(node, dir) {
- context.report(node, options[dir] ?
- "A space is required " + dir + " ','." :
- "There should be no space " + dir + " ','.");
+ function report(node, dir, otherNode) {
+ context.report({
+ node: node,
+ fix: function(fixer) {
+ if (options[dir]) {
+ if (dir === "before") {
+ return fixer.insertTextBefore(node, " ");
+ } else {
+ return fixer.insertTextAfter(node, " ");
+ }
+ } else {
+ var start, end;
+ var newText = "";
+
+ if (dir === "before") {
+ start = otherNode.range[1];
+ end = node.range[0];
+ } else {
+ start = node.range[1];
+ end = otherNode.range[0];
+ }
+
+ return fixer.replaceTextRange([start, end], newText);
+ }
+ },
+ message: options[dir] ?
+ "A space is required " + dir + " ','." :
+ "There should be no space " + dir + " ','."
+ });
}
/**
@@ -96,47 +88,46 @@ module.exports = function(context) {
* @private
*/
function validateCommaItemSpacing(tokens, reportItem) {
- if (tokens.left && isSameLine(tokens.left, tokens.comma) &&
- (options.before !== isSpaced(tokens.left, tokens.comma))
+ if (tokens.left && astUtils.isTokenOnSameLine(tokens.left, tokens.comma) &&
+ (options.before !== sourceCode.isSpaceBetweenTokens(tokens.left, tokens.comma))
) {
- report(reportItem, "before");
+ report(reportItem, "before", tokens.left);
+ }
+
+ if (tokens.right && !options.after && tokens.right.type === "Line") {
+ return false;
}
- if (tokens.right && isSameLine(tokens.comma, tokens.right) &&
- (options.after !== isSpaced(tokens.comma, tokens.right))
+
+ if (tokens.right && astUtils.isTokenOnSameLine(tokens.comma, tokens.right) &&
+ (options.after !== sourceCode.isSpaceBetweenTokens(tokens.comma, tokens.right))
) {
- report(reportItem, "after");
+ report(reportItem, "after", tokens.right);
}
}
/**
- * Determines if a given source index is in a comment or not by checking
- * the index against the comment range. Since the check goes straight
- * through the file, once an index is passed a certain comment, we can
- * go to the next comment to check that.
- * @param {int} index The source index to check.
- * @param {ASTNode[]} comments An array of comment nodes.
- * @returns {boolean} True if the index is within a comment, false if not.
- * @private
+ * Adds null elements of the given ArrayExpression or ArrayPattern node to the ignore list.
+ * @param {ASTNode} node An ArrayExpression or ArrayPattern node.
+ * @returns {void}
*/
- function isIndexInComment(index, comments) {
-
- var comment;
+ function addNullElementsToIgnoreList(node) {
+ var previousToken = context.getFirstToken(node);
- while (lastCommentIndex < comments.length) {
+ node.elements.forEach(function(element) {
+ var token;
- comment = comments[lastCommentIndex];
+ if (element === null) {
+ token = context.getTokenAfter(previousToken);
- if (comment.range[0] <= index && index < comment.range[1]) {
- return true;
- } else if (index > comment.range[1]) {
- lastCommentIndex++;
+ if (isComma(token)) {
+ commaTokensToIgnore.push(token);
+ }
} else {
- break;
+ token = context.getTokenAfter(element);
}
- }
-
- return false;
+ previousToken = token;
+ });
}
//--------------------------------------------------------------------------
@@ -144,33 +135,34 @@ module.exports = function(context) {
//--------------------------------------------------------------------------
return {
- "Program": function() {
+ "Program:exit": function() {
- var source = context.getSource(),
- pattern = /,/g,
- commaToken,
- previousToken,
+ var previousToken,
nextToken;
- allComments = context.getAllComments();
- while (pattern.test(source)) {
-
- // do not flag anything inside of comments
- if (!isIndexInComment(pattern.lastIndex, allComments)) {
- commaToken = context.getTokenByRangeStart(pattern.lastIndex - 1);
-
- if (commaToken && commaToken.type !== "JSXText") {
- previousToken = context.getTokenBefore(commaToken);
- nextToken = context.getTokenAfter(commaToken);
- validateCommaItemSpacing({
- comma: commaToken,
- left: isComma(previousToken) ? null : previousToken,
- right: isComma(nextToken) ? null : nextToken
- }, commaToken);
- }
+ tokensAndComments.forEach(function(token, i) {
+
+ if (!isComma(token)) {
+ return;
}
- }
- }
+
+ if (token && token.type === "JSXText") {
+ return;
+ }
+
+ previousToken = tokensAndComments[i - 1];
+ nextToken = tokensAndComments[i + 1];
+
+ validateCommaItemSpacing({
+ comma: token,
+ left: isComma(previousToken) || commaTokensToIgnore.indexOf(token) > -1 ? null : previousToken,
+ right: isComma(nextToken) ? null : nextToken
+ }, token);
+ });
+ },
+ "ArrayExpression": addNullElementsToIgnoreList,
+ "ArrayPattern": addNullElementsToIgnoreList
+
};
};
diff --git a/tools/eslint/lib/rules/comma-style.js b/tools/eslint/lib/rules/comma-style.js
index 52e0ac47b0fa81..af001372c55249 100644
--- a/tools/eslint/lib/rules/comma-style.js
+++ b/tools/eslint/lib/rules/comma-style.js
@@ -7,6 +7,8 @@
"use strict";
+var astUtils = require("../ast-utils");
+
//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------
@@ -24,17 +26,6 @@ module.exports = function(context) {
// Helpers
//--------------------------------------------------------------------------
- /**
- * Checks whether two tokens are on the same line.
- * @param {ASTNode} left The leftmost token.
- * @param {ASTNode} right The rightmost token.
- * @returns {boolean} True if the tokens are on the same line, false if not.
- * @private
- */
- function isSameLine(left, right) {
- return left.loc.end.line === right.loc.start.line;
- }
-
/**
* Determines if a given token is a comma operator.
* @param {ASTNode} token The token to check.
@@ -57,13 +48,13 @@ module.exports = function(context) {
function validateCommaItemSpacing(previousItemToken, commaToken, currentItemToken, reportItem) {
// if single line
- if (isSameLine(commaToken, currentItemToken) &&
- isSameLine(previousItemToken, commaToken)) {
+ if (astUtils.isTokenOnSameLine(commaToken, currentItemToken) &&
+ astUtils.isTokenOnSameLine(previousItemToken, commaToken)) {
return;
- } else if (!isSameLine(commaToken, currentItemToken) &&
- !isSameLine(previousItemToken, commaToken)) {
+ } else if (!astUtils.isTokenOnSameLine(commaToken, currentItemToken) &&
+ !astUtils.isTokenOnSameLine(previousItemToken, commaToken)) {
// lone comma
context.report(reportItem, {
@@ -71,11 +62,11 @@ module.exports = function(context) {
column: commaToken.loc.start.column
}, "Bad line breaking before and after ','.");
- } else if (style === "first" && !isSameLine(commaToken, currentItemToken)) {
+ } else if (style === "first" && !astUtils.isTokenOnSameLine(commaToken, currentItemToken)) {
context.report(reportItem, "',' should be placed first.");
- } else if (style === "last" && isSameLine(commaToken, currentItemToken)) {
+ } else if (style === "last" && astUtils.isTokenOnSameLine(commaToken, currentItemToken)) {
context.report(reportItem, {
line: commaToken.loc.end.line,
diff --git a/tools/eslint/lib/rules/complexity.js b/tools/eslint/lib/rules/complexity.js
index b4e52784cbd237..e8dd3cf9920b6a 100644
--- a/tools/eslint/lib/rules/complexity.js
+++ b/tools/eslint/lib/rules/complexity.js
@@ -21,18 +21,28 @@ module.exports = function(context) {
// Using a stack to store complexity (handling nested functions)
var fns = [];
- // When parsing a new function, store it in our function stack
+ /**
+ * When parsing a new function, store it in our function stack
+ * @returns {void}
+ * @private
+ */
function startFunction() {
fns.push(1);
}
+ /**
+ * Evaluate the node at the end of function
+ * @param {ASTNode} node node to evaluate
+ * @returns {void}
+ * @private
+ */
function endFunction(node) {
var complexity = fns.pop(),
name = "anonymous";
if (node.id) {
name = node.id.name;
- } else if (node.parent.type === "MethodDefinition") {
+ } else if (node.parent.type === "MethodDefinition" || node.parent.type === "Property") {
name = node.parent.key.name;
}
@@ -41,12 +51,23 @@ module.exports = function(context) {
}
}
+ /**
+ * Increase the complexity of the function in context
+ * @returns {void}
+ * @private
+ */
function increaseComplexity() {
if (fns.length) {
fns[fns.length - 1] ++;
}
}
+ /**
+ * Increase the switch complexity in context
+ * @param {ASTNode} node node to evaluate
+ * @returns {void}
+ * @private
+ */
function increaseSwitchComplexity(node) {
// Avoiding `default`
if (node.test) {
@@ -54,6 +75,12 @@ module.exports = function(context) {
}
}
+ /**
+ * Increase the logical path complexity in context
+ * @param {ASTNode} node node to evaluate
+ * @returns {void}
+ * @private
+ */
function increaseLogicalComplexity(node) {
// Avoiding &&
if (node.operator === "||") {
diff --git a/tools/eslint/lib/rules/computed-property-spacing.js b/tools/eslint/lib/rules/computed-property-spacing.js
index 653a40eb0411a2..6462dfb90ee8f3 100644
--- a/tools/eslint/lib/rules/computed-property-spacing.js
+++ b/tools/eslint/lib/rules/computed-property-spacing.js
@@ -5,57 +5,54 @@
*/
"use strict";
+var astUtils = require("../ast-utils");
+
//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------
module.exports = function(context) {
+ var sourceCode = context.getSourceCode();
var propertyNameMustBeSpaced = context.options[0] === "always"; // default is "never"
//--------------------------------------------------------------------------
// Helpers
//--------------------------------------------------------------------------
- /**
- * Determines whether two adjacent tokens are have whitespace between them.
- * @param {Object} left - The left token object.
- * @param {Object} right - The right token object.
- * @returns {boolean} Whether or not there is space between the tokens.
- */
- function isSpaced(left, right) {
- return left.range[1] < right.range[0];
- }
-
- /**
- * Determines whether two adjacent tokens are on the same line.
- * @param {Object} left - The left token object.
- * @param {Object} right - The right token object.
- * @returns {boolean} Whether or not the tokens are on the same line.
- */
- function isSameLine(left, right) {
- return left.loc.start.line === right.loc.start.line;
- }
-
/**
* Reports that there shouldn't be a space after the first token
* @param {ASTNode} node - The node to report in the event of an error.
* @param {Token} token - The token to use for the report.
+ * @param {Token} tokenAfter - The token after `token`.
* @returns {void}
*/
- function reportNoBeginningSpace(node, token) {
- context.report(node, token.loc.start,
- "There should be no space after '" + token.value + "'");
+ function reportNoBeginningSpace(node, token, tokenAfter) {
+ context.report({
+ node: node,
+ loc: token.loc.start,
+ message: "There should be no space after '" + token.value + "'",
+ fix: function(fixer) {
+ return fixer.removeRange([token.range[1], tokenAfter.range[0]]);
+ }
+ });
}
/**
* Reports that there shouldn't be a space before the last token
* @param {ASTNode} node - The node to report in the event of an error.
* @param {Token} token - The token to use for the report.
+ * @param {Token} tokenBefore - The token before `token`.
* @returns {void}
*/
- function reportNoEndingSpace(node, token) {
- context.report(node, token.loc.start,
- "There should be no space before '" + token.value + "'");
+ function reportNoEndingSpace(node, token, tokenBefore) {
+ context.report({
+ node: node,
+ loc: token.loc.start,
+ message: "There should be no space before '" + token.value + "'",
+ fix: function(fixer) {
+ return fixer.removeRange([tokenBefore.range[1], token.range[0]]);
+ }
+ });
}
/**
@@ -65,8 +62,14 @@ module.exports = function(context) {
* @returns {void}
*/
function reportRequiredBeginningSpace(node, token) {
- context.report(node, token.loc.start,
- "A space is required after '" + token.value + "'");
+ context.report({
+ node: node,
+ loc: token.loc.start,
+ message: "A space is required after '" + token.value + "'",
+ fix: function(fixer) {
+ return fixer.insertTextAfter(token, " ");
+ }
+ });
}
/**
@@ -76,8 +79,14 @@ module.exports = function(context) {
* @returns {void}
*/
function reportRequiredEndingSpace(node, token) {
- context.report(node, token.loc.start,
- "A space is required before '" + token.value + "'");
+ context.report({
+ node: node,
+ loc: token.loc.start,
+ message: "A space is required before '" + token.value + "'",
+ fix: function(fixer) {
+ return fixer.insertTextBefore(token, " ");
+ }
+ });
}
/**
@@ -99,26 +108,26 @@ module.exports = function(context) {
last = context.getLastToken(property),
after = context.getTokenAfter(property);
- if (isSameLine(before, first)) {
+ if (astUtils.isTokenOnSameLine(before, first)) {
if (propertyNameMustBeSpaced) {
- if (!isSpaced(before, first) && isSameLine(before, first)) {
+ if (!sourceCode.isSpaceBetweenTokens(before, first) && astUtils.isTokenOnSameLine(before, first)) {
reportRequiredBeginningSpace(node, before);
}
} else {
- if (isSpaced(before, first)) {
- reportNoBeginningSpace(node, before);
+ if (sourceCode.isSpaceBetweenTokens(before, first)) {
+ reportNoBeginningSpace(node, before, first);
}
}
}
- if (isSameLine(last, after)) {
+ if (astUtils.isTokenOnSameLine(last, after)) {
if (propertyNameMustBeSpaced) {
- if (!isSpaced(last, after) && isSameLine(last, after)) {
+ if (!sourceCode.isSpaceBetweenTokens(last, after) && astUtils.isTokenOnSameLine(last, after)) {
reportRequiredEndingSpace(node, after);
}
} else {
- if (isSpaced(last, after)) {
- reportNoEndingSpace(node, after);
+ if (sourceCode.isSpaceBetweenTokens(last, after)) {
+ reportNoEndingSpace(node, after, last);
}
}
}
diff --git a/tools/eslint/lib/rules/consistent-this.js b/tools/eslint/lib/rules/consistent-this.js
index bcf7fefb051c1a..81dc8473e625a8 100644
--- a/tools/eslint/lib/rules/consistent-this.js
+++ b/tools/eslint/lib/rules/consistent-this.js
@@ -53,39 +53,35 @@ module.exports = function(context) {
*/
function ensureWasAssigned() {
var scope = context.getScope();
+ var variable = scope.set.get(alias);
+ if (!variable) {
+ return;
+ }
+
+ if (variable.defs.some(function(def) {
+ return def.node.type === "VariableDeclarator" &&
+ def.node.init !== null;
+ })) {
+ return;
+ }
- scope.variables.some(function (variable) {
- var lookup;
-
- if (variable.name === alias) {
- if (variable.defs.some(function (def) {
- return def.node.type === "VariableDeclarator" &&
- def.node.init !== null;
- })) {
- return true;
- }
-
- lookup = scope.type === "global" ? scope : variable;
-
- // The alias has been declared and not assigned: check it was
- // assigned later in the same scope.
- if (!lookup.references.some(function (reference) {
- var write = reference.writeExpr;
-
- if (reference.from === scope &&
- write && write.type === "ThisExpression" &&
- write.parent.operator === "=") {
- return true;
- }
- })) {
- variable.defs.map(function (def) {
- return def.node;
- }).forEach(reportBadAssignment);
- }
+ var lookup = (variable.references.length === 0 && scope.type === "global") ? scope : variable;
+ // The alias has been declared and not assigned: check it was
+ // assigned later in the same scope.
+ if (!lookup.references.some(function(reference) {
+ var write = reference.writeExpr;
+
+ if (reference.from === scope &&
+ write && write.type === "ThisExpression" &&
+ write.parent.operator === "=") {
return true;
}
- });
+ })) {
+ variable.defs.map(function(def) {
+ return def.node;
+ }).forEach(reportBadAssignment);
+ }
}
return {
@@ -93,7 +89,7 @@ module.exports = function(context) {
"FunctionExpression:exit": ensureWasAssigned,
"FunctionDeclaration:exit": ensureWasAssigned,
- "VariableDeclarator": function (node) {
+ "VariableDeclarator": function(node) {
var id = node.id;
var isDestructuring =
id.type === "ArrayPattern" || id.type === "ObjectPattern";
@@ -103,7 +99,7 @@ module.exports = function(context) {
}
},
- "AssignmentExpression": function (node) {
+ "AssignmentExpression": function(node) {
if (node.left.type === "Identifier") {
checkAssignment(node, node.left.name, node.right);
}
diff --git a/tools/eslint/lib/rules/constructor-super.js b/tools/eslint/lib/rules/constructor-super.js
index a8c77a15a5e950..217d90b9c13f4d 100644
--- a/tools/eslint/lib/rules/constructor-super.js
+++ b/tools/eslint/lib/rules/constructor-super.js
@@ -18,7 +18,7 @@ module.exports = function(context) {
* @returns {ClassDeclaration|ClassExpression|null} the found class node or `null`.
*/
function getClassInAncestor(node) {
- while (node != null) {
+ while (node) {
if (node.type === "ClassDeclaration" || node.type === "ClassExpression") {
return node;
}
@@ -34,7 +34,7 @@ module.exports = function(context) {
* @returns {boolean} whether or not a node is the null literal.
*/
function isNullLiteral(node) {
- return node != null && node.type === "Literal" && node.value === null;
+ return node && node.type === "Literal" && node.value === null;
}
/**
@@ -43,7 +43,7 @@ module.exports = function(context) {
* @returns {boolean} whether or not the current traversal context is on constructors.
*/
function isOnConstructor(item) {
- return item != null && item.scope === context.getScope().variableScope.upper.variableScope;
+ return item && item.scope === context.getScope().variableScope.upper.variableScope;
}
// A stack for checking context.
@@ -78,7 +78,7 @@ module.exports = function(context) {
var classNode = getClassInAncestor(node);
/* istanbul ignore if */
- if (classNode == null) {
+ if (!classNode) {
return;
}
diff --git a/tools/eslint/lib/rules/curly.js b/tools/eslint/lib/rules/curly.js
index df7ad4c570310e..dacd9c5ec5e198 100644
--- a/tools/eslint/lib/rules/curly.js
+++ b/tools/eslint/lib/rules/curly.js
@@ -1,9 +1,16 @@
/**
* @fileoverview Rule to flag statements without curly braces
* @author Nicholas C. Zakas
+ * @copyright 2015 Ivan Nikulin. All rights reserved.
*/
"use strict";
+//------------------------------------------------------------------------------
+// Requirements
+//------------------------------------------------------------------------------
+
+var astUtils = require("../ast-utils");
+
//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------
@@ -12,6 +19,8 @@ module.exports = function(context) {
var multiOnly = (context.options[0] === "multi");
var multiLine = (context.options[0] === "multi-line");
+ var multiOrNest = (context.options[0] === "multi-or-nest");
+ var consistent = (context.options[1] === "consistent");
//--------------------------------------------------------------------------
// Helpers
@@ -30,45 +39,189 @@ module.exports = function(context) {
}
/**
- * Checks the body of a node to see if it's a block statement. Depending on
- * the rule options, reports the appropriate problems.
+ * Determines if a given node is a one-liner.
+ * @param {ASTNode} node The node to check.
+ * @returns {boolean} True if the node is a one-liner.
+ * @private
+ */
+ function isOneLiner(node) {
+ var first = context.getFirstToken(node),
+ last = context.getLastToken(node);
+
+ return first.loc.start.line === last.loc.end.line;
+ }
+
+ /**
+ * Gets the `else` keyword token of a given `IfStatement` node.
+ * @param {ASTNode} node - A `IfStatement` node to get.
+ * @returns {Token} The `else` keyword token.
+ */
+ function getElseKeyword(node) {
+ var sourceCode = context.getSourceCode();
+ var token = sourceCode.getTokenAfter(node.consequent);
+
+ while (token.type !== "Keyword" || token.value !== "else") {
+ token = sourceCode.getTokenAfter(token);
+ }
+
+ return token;
+ }
+
+ /**
+ * Checks a given IfStatement node requires braces of the consequent chunk.
+ * This returns `true` when below:
+ *
+ * 1. The given node has the `alternate` node.
+ * 2. There is a `IfStatement` which doesn't have `alternate` node in the
+ * trailing statement chain of the `consequent` node.
+ *
+ * @param {ASTNode} node - A IfStatement node to check.
+ * @returns {boolean} `true` if the node requires braces of the consequent chunk.
+ */
+ function requiresBraceOfConsequent(node) {
+ if (node.alternate && node.consequent.type === "BlockStatement") {
+ if (node.consequent.body.length >= 2) {
+ return true;
+ }
+
+ node = node.consequent.body[0];
+ while (node) {
+ if (node.type === "IfStatement" && !node.alternate) {
+ return true;
+ }
+ node = astUtils.getTrailingStatement(node);
+ }
+ }
+
+ return false;
+ }
+
+ /**
+ * Reports "Expected { after ..." error
+ * @param {ASTNode} node The node to report.
+ * @param {string} name The name to report.
+ * @param {string} suffix Additional string to add to the end of a report.
+ * @returns {void}
+ * @private
+ */
+ function reportExpectedBraceError(node, name, suffix) {
+ context.report({
+ node: node,
+ loc: (name !== "else" ? node : getElseKeyword(node)).loc.start,
+ message: "Expected { after '{{name}}'{{suffix}}.",
+ data: {
+ name: name,
+ suffix: (suffix ? " " + suffix : "")
+ }
+ });
+ }
+
+ /**
+ * Reports "Unnecessary { after ..." error
+ * @param {ASTNode} node The node to report.
+ * @param {string} name The name to report.
+ * @param {string} suffix Additional string to add to the end of a report.
+ * @returns {void}
+ * @private
+ */
+ function reportUnnecessaryBraceError(node, name, suffix) {
+ context.report({
+ node: node,
+ loc: (name !== "else" ? node : getElseKeyword(node)).loc.start,
+ message: "Unnecessary { after '{{name}}'{{suffix}}.",
+ data: {
+ name: name,
+ suffix: (suffix ? " " + suffix : "")
+ }
+ });
+ }
+
+ /**
+ * Prepares to check the body of a node to see if it's a block statement.
* @param {ASTNode} node The node to report if there's a problem.
* @param {ASTNode} body The body node to check for blocks.
* @param {string} name The name to report if there's a problem.
* @param {string} suffix Additional string to add to the end of a report.
- * @returns {void}
+ * @returns {object} a prepared check object, with "actual", "expected", "check" properties.
+ * "actual" will be `true` or `false` whether the body is already a block statement.
+ * "expected" will be `true` or `false` if the body should be a block statement or not, or
+ * `null` if it doesn't matter, depending on the rule options. It can be modified to change
+ * the final behavior of "check".
+ * "check" will be a function reporting appropriate problems depending on the other
+ * properties.
*/
- function checkBody(node, body, name, suffix) {
+ function prepareCheck(node, body, name, suffix) {
var hasBlock = (body.type === "BlockStatement");
+ var expected = null;
- if (multiOnly) {
+ if (node.type === "IfStatement" && node.consequent === body && requiresBraceOfConsequent(node)) {
+ expected = true;
+ } else if (multiOnly) {
if (hasBlock && body.body.length === 1) {
- context.report(node, "Unnecessary { after '{{name}}'{{suffix}}.",
- {
- name: name,
- suffix: (suffix ? " " + suffix : "")
- }
- );
+ expected = false;
}
} else if (multiLine) {
- if (!hasBlock && !isCollapsedOneLiner(body)) {
- context.report(node, "Expected { after '{{name}}'{{suffix}}.",
- {
- name: name,
- suffix: (suffix ? " " + suffix : "")
- }
- );
+ if (!isCollapsedOneLiner(body)) {
+ expected = true;
+ }
+ } else if (multiOrNest) {
+ if (hasBlock && body.body.length === 1 && isOneLiner(body.body[0])) {
+ expected = false;
+ } else if (!isOneLiner(body)) {
+ expected = true;
}
} else {
- if (!hasBlock) {
- context.report(node, "Expected { after '{{name}}'{{suffix}}.",
- {
- name: name,
- suffix: (suffix ? " " + suffix : "")
+ expected = true;
+ }
+
+ return {
+ actual: hasBlock,
+ expected: expected,
+ check: function() {
+ if (this.expected !== null && this.expected !== this.actual) {
+ if (this.expected) {
+ reportExpectedBraceError(node, name, suffix);
+ } else {
+ reportUnnecessaryBraceError(node, name, suffix);
}
- );
+ }
+ }
+ };
+ }
+
+ /**
+ * Prepares to check the bodies of a "if", "else if" and "else" chain.
+ * @param {ASTNode} node The first IfStatement node of the chain.
+ * @returns {object[]} prepared checks for each body of the chain. See `prepareCheck` for more
+ * information.
+ */
+ function prepareIfChecks(node) {
+ var preparedChecks = [];
+ do {
+ preparedChecks.push(prepareCheck(node, node.consequent, "if", "condition"));
+ if (node.alternate && node.alternate.type !== "IfStatement") {
+ preparedChecks.push(prepareCheck(node, node.alternate, "else"));
+ break;
}
+ node = node.alternate;
+ } while (node);
+
+ if (consistent) {
+ // If any node should have or already have braces, make sure they all have braces.
+ // If all nodes shouldn't have braces, make sure they don't.
+ var expected = preparedChecks.some(function(preparedCheck) {
+ if (preparedCheck.expected !== null) {
+ return preparedCheck.expected;
+ }
+ return preparedCheck.actual;
+ });
+
+ preparedChecks.forEach(function(preparedCheck) {
+ preparedCheck.expected = expected;
+ });
}
+
+ return preparedChecks;
}
//--------------------------------------------------------------------------
@@ -76,34 +229,66 @@ module.exports = function(context) {
//--------------------------------------------------------------------------
return {
-
"IfStatement": function(node) {
-
- checkBody(node, node.consequent, "if", "condition");
-
- if (node.alternate && node.alternate.type !== "IfStatement") {
- checkBody(node, node.alternate, "else");
+ if (node.parent.type !== "IfStatement") {
+ prepareIfChecks(node).forEach(function(preparedCheck) {
+ preparedCheck.check();
+ });
}
-
},
"WhileStatement": function(node) {
- checkBody(node, node.body, "while", "condition");
+ prepareCheck(node, node.body, "while", "condition").check();
},
- "DoWhileStatement": function (node) {
- checkBody(node, node.body, "do");
+ "DoWhileStatement": function(node) {
+ prepareCheck(node, node.body, "do").check();
},
"ForStatement": function(node) {
- checkBody(node, node.body, "for", "condition");
+ prepareCheck(node, node.body, "for", "condition").check();
+ },
+
+ "ForInStatement": function(node) {
+ prepareCheck(node, node.body, "for-in").check();
+ },
+
+ "ForOfStatement": function(node) {
+ prepareCheck(node, node.body, "for-of").check();
}
};
-
};
-module.exports.schema = [
- {
- "enum": ["all", "multi", "multi-line"]
- }
-];
+module.exports.schema = {
+ "anyOf": [
+ {
+ "type": "array",
+ "items": [
+ {
+ "enum": [0, 1, 2]
+ },
+ {
+ "enum": ["all"]
+ }
+ ],
+ "minItems": 1,
+ "maxItems": 2
+ },
+ {
+ "type": "array",
+ "items": [
+ {
+ "enum": [0, 1, 2]
+ },
+ {
+ "enum": ["multi", "multi-line", "multi-or-nest"]
+ },
+ {
+ "enum": ["consistent"]
+ }
+ ],
+ "minItems": 1,
+ "maxItems": 3
+ }
+ ]
+};
diff --git a/tools/eslint/lib/rules/dot-location.js b/tools/eslint/lib/rules/dot-location.js
index 6e83b984887293..403ffe2d5e7767 100644
--- a/tools/eslint/lib/rules/dot-location.js
+++ b/tools/eslint/lib/rules/dot-location.js
@@ -6,27 +6,18 @@
"use strict";
+var astUtils = require("../ast-utils");
+
//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------
-module.exports = function (context) {
+module.exports = function(context) {
var config = context.options[0],
// default to onObject if no preference is passed
onObject = config === "object" || !config;
- /**
- * Checks whether two tokens are on the same line.
- * @param {Object} left The leftmost token.
- * @param {Object} right The rightmost token.
- * @returns {boolean} True if the tokens are on the same line, false if not.
- * @private
- */
- function isSameLine(left, right) {
- return left.loc.end.line === right.loc.start.line;
- }
-
/**
* Reports if the dot between object and property is on the correct loccation.
* @param {ASTNode} obj The object owning the property.
@@ -39,10 +30,10 @@ module.exports = function (context) {
if (dot.type === "Punctuator" && dot.value === ".") {
if (onObject) {
- if (!isSameLine(obj, dot)) {
+ if (!astUtils.isTokenOnSameLine(obj, dot)) {
context.report(node, dot.loc.start, "Expected dot to be on same line as object.");
}
- } else if (!isSameLine(dot, prop)) {
+ } else if (!astUtils.isTokenOnSameLine(dot, prop)) {
context.report(node, dot.loc.start, "Expected dot to be on same line as property.");
}
}
@@ -61,3 +52,9 @@ module.exports = function (context) {
"MemberExpression": checkNode
};
};
+
+module.exports.schema = [
+ {
+ "enum": ["object", "property"]
+ }
+];
diff --git a/tools/eslint/lib/rules/dot-notation.js b/tools/eslint/lib/rules/dot-notation.js
index 2198cd75470f37..255d08ada67394 100644
--- a/tools/eslint/lib/rules/dot-notation.js
+++ b/tools/eslint/lib/rules/dot-notation.js
@@ -9,67 +9,7 @@
//------------------------------------------------------------------------------
var validIdentifier = /^[a-zA-Z_$][a-zA-Z0-9_$]*$/;
-var keywords = [
- "this",
- "function",
- "if",
- "return",
- "var",
- "else",
- "for",
- "new",
- "in",
- "typeof",
- "while",
- "case",
- "break",
- "try",
- "catch",
- "delete",
- "throw",
- "switch",
- "continue",
- "default",
- "instanceof",
- "do",
- "void",
- "finally",
- "with",
- "debugger",
- "implements",
- "interface",
- "package",
- "private",
- "protected",
- "public",
- "static",
- "class",
- "enum",
- "export",
- "extends",
- "import",
- "super",
- "true",
- "false",
- "null",
- "abstract",
- "boolean",
- "byte",
- "char",
- "const",
- "double",
- "final",
- "float",
- "goto",
- "int",
- "long",
- "native",
- "short",
- "synchronized",
- "throws",
- "transient",
- "volatile"
-];
+var keywords = require("../util/keywords");
module.exports = function(context) {
var options = context.options[0] || {};
diff --git a/tools/eslint/lib/rules/eol-last.js b/tools/eslint/lib/rules/eol-last.js
index 2f68b8a7df1e2c..ebc4a596e3d1ca 100644
--- a/tools/eslint/lib/rules/eol-last.js
+++ b/tools/eslint/lib/rules/eol-last.js
@@ -18,8 +18,10 @@ module.exports = function(context) {
"Program": function checkBadEOF(node) {
// Get the whole source code, not for node only.
- var src = context.getSource(), location = {column: 1};
-
+ var src = context.getSource(),
+ location = {column: 1},
+ linebreakStyle = context.options[0] || "unix",
+ linebreak = linebreakStyle === "unix" ? "\n" : "\r\n";
if (src.length === 0) {
return;
}
@@ -27,7 +29,14 @@ module.exports = function(context) {
if (src[src.length - 1] !== "\n") {
// file is not newline-terminated
location.line = src.split(/\n/g).length;
- context.report(node, location, "Newline required at end of file but not found.");
+ context.report({
+ node: node,
+ loc: location,
+ message: "Newline required at end of file but not found.",
+ fix: function(fixer) {
+ return fixer.insertTextAfterRange([0, src.length], linebreak);
+ }
+ });
}
}
@@ -35,4 +44,8 @@ module.exports = function(context) {
};
-module.exports.schema = [];
+module.exports.schema = [
+ {
+ "enum": ["unix", "windows"]
+ }
+];
diff --git a/tools/eslint/lib/rules/eqeqeq.js b/tools/eslint/lib/rules/eqeqeq.js
index 1576d6c1ab500c..f4ef2e5ed7a866 100644
--- a/tools/eslint/lib/rules/eqeqeq.js
+++ b/tools/eslint/lib/rules/eqeqeq.js
@@ -1,6 +1,8 @@
/**
* @fileoverview Rule to flag statements that use != and == instead of !== and ===
* @author Nicholas C. Zakas
+ * @copyright 2013 Nicholas C. Zakas. All rights reserved.
+ * See LICENSE file in root directory for full license.
*/
"use strict";
@@ -11,6 +13,12 @@
module.exports = function(context) {
+ var sourceCode = context.getSourceCode(),
+ replacements = {
+ "==": "===",
+ "!=": "!=="
+ };
+
/**
* Checks if an expression is a typeof expression
* @param {ASTNode} node The node to check
@@ -71,7 +79,7 @@ module.exports = function(context) {
}
if (context.options[0] === "smart" && (isTypeOfBinary(node) ||
- areLiteralsAndSameType(node)) || isNullCheck(node)) {
+ areLiteralsAndSameType(node) || isNullCheck(node))) {
return;
}
@@ -79,11 +87,27 @@ module.exports = function(context) {
return;
}
- context.report(
- node, getOperatorLocation(node),
- "Expected '{{op}}=' and instead saw '{{op}}'.",
- {op: node.operator}
- );
+ context.report({
+ node: node,
+ loc: getOperatorLocation(node),
+ message: "Expected '{{op}}=' and instead saw '{{op}}'.",
+ data: { op: node.operator },
+ fix: function(fixer) {
+ var tokens = sourceCode.getTokensBetween(node.left, node.right),
+ opToken,
+ i;
+
+ for (i = 0; i < tokens.length; ++i) {
+ if (tokens[i].value === node.operator) {
+ opToken = tokens[i];
+ break;
+ }
+ }
+
+ return fixer.replaceTextRange(opToken.range, replacements[node.operator]);
+ }
+ });
+
}
};
diff --git a/tools/eslint/lib/rules/func-style.js b/tools/eslint/lib/rules/func-style.js
index c9d64b6d00bff4..3a26aa3e9956c4 100644
--- a/tools/eslint/lib/rules/func-style.js
+++ b/tools/eslint/lib/rules/func-style.js
@@ -12,38 +12,73 @@
module.exports = function(context) {
var style = context.options[0],
- enforceDeclarations = (style === "declaration");
+ allowArrowFunctions = context.options[1] && context.options[1].allowArrowFunctions === true,
+ enforceDeclarations = (style === "declaration"),
+ stack = [];
- return {
+ var nodesToCheck = {
+ "Program": function() {
+ stack = [];
+ },
"FunctionDeclaration": function(node) {
+ stack.push(false);
+
if (!enforceDeclarations) {
context.report(node, "Expected a function expression.");
}
},
+ "FunctionDeclaration:exit": function() {
+ stack.pop();
+ },
- "FunctionExpression": function() {
- var parent = context.getAncestors().pop();
+ "FunctionExpression": function(node) {
+ stack.push(false);
- if (enforceDeclarations && parent.type === "VariableDeclarator") {
- context.report(parent, "Expected a function declaration.");
+ if (enforceDeclarations && node.parent.type === "VariableDeclarator") {
+ context.report(node.parent, "Expected a function declaration.");
}
},
+ "FunctionExpression:exit": function() {
+ stack.pop();
+ },
- "ArrowFunctionExpression": function() {
- var parent = context.getAncestors().pop();
-
- if (enforceDeclarations && parent.type === "VariableDeclarator") {
- context.report(parent, "Expected a function declaration.");
+ "ThisExpression": function() {
+ if (stack.length > 0) {
+ stack[stack.length - 1] = true;
}
}
-
};
+ if (!allowArrowFunctions) {
+ nodesToCheck.ArrowFunctionExpression = function() {
+ stack.push(false);
+ };
+
+ nodesToCheck["ArrowFunctionExpression:exit"] = function(node) {
+ var hasThisExpr = stack.pop();
+
+ if (enforceDeclarations && !hasThisExpr && node.parent.type === "VariableDeclarator") {
+ context.report(node.parent, "Expected a function declaration.");
+ }
+ };
+ }
+
+ return nodesToCheck;
+
};
module.exports.schema = [
{
"enum": ["declaration", "expression"]
+ },
+ {
+ "type": "object",
+ "properties": {
+ "allowArrowFunctions": {
+ "type": "boolean"
+ }
+ },
+ "additionalProperties": false
}
];
diff --git a/tools/eslint/lib/rules/generator-star-spacing.js b/tools/eslint/lib/rules/generator-star-spacing.js
index 1769f300449bce..210638a4ec1adb 100644
--- a/tools/eslint/lib/rules/generator-star-spacing.js
+++ b/tools/eslint/lib/rules/generator-star-spacing.js
@@ -14,7 +14,7 @@
module.exports = function(context) {
var mode = (function(option) {
- if (option == null || typeof option === "string") {
+ if (!option || typeof option === "string") {
return {
before: { before: true, after: false },
after: { before: false, after: true },
@@ -36,14 +36,24 @@ module.exports = function(context) {
*/
function checkSpacing(side, leftToken, rightToken) {
if (!!(rightToken.range[0] - leftToken.range[1]) !== mode[side]) {
- context.report(
- leftToken.value === "*" ? leftToken : rightToken,
- "{{type}} space {{side}} *.",
- {
- type: mode[side] ? "Missing" : "Unexpected",
- side: side
+ var after = leftToken.value === "*";
+ var spaceRequired = mode[side];
+ var node = after ? leftToken : rightToken;
+ var type = spaceRequired ? "Missing" : "Unexpected";
+ var message = type + " space " + side + " *.";
+ context.report({
+ node: node,
+ message: message,
+ fix: function(fixer) {
+ if (spaceRequired) {
+ if (after) {
+ return fixer.insertTextAfter(node, " ");
+ }
+ return fixer.insertTextBefore(node, " ");
+ }
+ return fixer.removeRange([leftToken.range[1], rightToken.range[0]]);
}
- );
+ });
}
}
diff --git a/tools/eslint/lib/rules/generator-star.js b/tools/eslint/lib/rules/generator-star.js
deleted file mode 100644
index d6f3d2cdc58b6f..00000000000000
--- a/tools/eslint/lib/rules/generator-star.js
+++ /dev/null
@@ -1,76 +0,0 @@
-/**
- * @fileoverview Rule to check for the position of the * in your generator functions
- * @author Jamund Ferguson
- * @copyright 2014 Jamund Ferguson. All rights reserved.
- */
-
-"use strict";
-
-//------------------------------------------------------------------------------
-// Rule Definition
-//------------------------------------------------------------------------------
-
-module.exports = function(context) {
-
- var position = context.options[0] || "end";
-
- /**
- * Check the position of the star compared to the expected position.
- * @param {ASTNode} node - the entire function node
- * @returns {void}
- */
- function checkStarPosition(node) {
- var starToken;
-
- if (!node.generator) {
- return;
- }
-
- // Blocked, pending decision to fix or work around in eslint/espree#36
- if (context.getAncestors().pop().method) {
- return;
- }
-
- starToken = context.getFirstToken(node, 1);
-
- // check for function *name() {}
- if (position === "end") {
-
- // * starts where the next identifier begins
- if (starToken.range[1] !== context.getTokenAfter(starToken).range[0]) {
- context.report(node, "Expected a space before *.");
- }
- }
-
- // check for function* name() {}
- if (position === "start") {
-
- // * begins where the previous identifier ends
- if (starToken.range[0] !== context.getTokenBefore(starToken).range[1]) {
- context.report(node, "Expected no space before *.");
- }
- }
-
- // check for function * name() {}
- if (position === "middle") {
-
- // must be a space before and afer the *
- if (starToken.range[0] <= context.getTokenBefore(starToken).range[1] ||
- starToken.range[1] >= context.getTokenAfter(starToken).range[0]) {
- context.report(node, "Expected spaces around *.");
- }
- }
- }
-
- return {
- "FunctionDeclaration": checkStarPosition,
- "FunctionExpression": checkStarPosition
- };
-
-};
-
-module.exports.schema = [
- {
- "enum": ["start", "middle", "end"]
- }
-];
diff --git a/tools/eslint/lib/rules/global-require.js b/tools/eslint/lib/rules/global-require.js
new file mode 100644
index 00000000000000..f09657ee16f769
--- /dev/null
+++ b/tools/eslint/lib/rules/global-require.js
@@ -0,0 +1,35 @@
+/**
+ * @fileoverview Rule for disallowing require() outside of the top-level module context
+ * @author Jamund Ferguson
+ * @copyright 2015 Jamund Ferguson. All rights reserved.
+ */
+
+"use strict";
+
+var ACCEPTABLE_PARENTS = [
+ "AssignmentExpression",
+ "VariableDeclarator",
+ "MemberExpression",
+ "ExpressionStatement",
+ "CallExpression",
+ "ConditionalExpression",
+ "Program",
+ "VariableDeclaration"
+];
+
+module.exports = function(context) {
+ return {
+ "CallExpression": function(node) {
+ if (node.callee.name === "require") {
+ var isGoodRequire = context.getAncestors().every(function(parent) {
+ return ACCEPTABLE_PARENTS.indexOf(parent.type) > -1;
+ });
+ if (!isGoodRequire) {
+ context.report(node, "Unexpected require().");
+ }
+ }
+ }
+ };
+};
+
+module.exports.schema = [];
diff --git a/tools/eslint/lib/rules/global-strict.js b/tools/eslint/lib/rules/global-strict.js
deleted file mode 100644
index 97980f6fed2364..00000000000000
--- a/tools/eslint/lib/rules/global-strict.js
+++ /dev/null
@@ -1,49 +0,0 @@
-/**
- * @fileoverview Rule to flag or require global strict mode.
- * @author Nicholas C. Zakas
- */
-"use strict";
-
-//------------------------------------------------------------------------------
-// Rule Definition
-//------------------------------------------------------------------------------
-
-module.exports = function(context) {
-
- var mode = context.options[0];
-
- if (mode === "always") {
-
- return {
- "Program": function(node) {
- if (node.body.length > 0) {
- var statement = node.body[0];
-
- if (!(statement.type === "ExpressionStatement" && statement.expression.value === "use strict")) {
- context.report(node, "Use the global form of \"use strict\".");
- }
- }
- }
- };
-
- } else { // mode = "never"
-
- return {
- "ExpressionStatement": function(node) {
- var parent = context.getAncestors().pop();
-
- if (node.expression.value === "use strict" && parent.type === "Program") {
- context.report(node, "Use the function form of \"use strict\".");
- }
- }
- };
-
- }
-
-};
-
-module.exports.schema = [
- {
- "enum": ["always", "never"]
- }
-];
diff --git a/tools/eslint/lib/rules/handle-callback-err.js b/tools/eslint/lib/rules/handle-callback-err.js
index 438ea93c074f22..600a04fcfa8ef9 100644
--- a/tools/eslint/lib/rules/handle-callback-err.js
+++ b/tools/eslint/lib/rules/handle-callback-err.js
@@ -44,7 +44,7 @@ module.exports = function(context) {
* @returns {array} All parameters of the given scope.
*/
function getParameters(scope) {
- return scope.variables.filter(function (variable) {
+ return scope.variables.filter(function(variable) {
return variable.defs[0] && variable.defs[0].type === "Parameter";
});
}
diff --git a/tools/eslint/lib/rules/id-length.js b/tools/eslint/lib/rules/id-length.js
new file mode 100644
index 00000000000000..0ea42e14ef4bda
--- /dev/null
+++ b/tools/eslint/lib/rules/id-length.js
@@ -0,0 +1,106 @@
+/**
+ * @fileoverview Rule that warns when identifier names are shorter or longer
+ * than the values provided in configuration.
+ * @author Burak Yigit Kaya aka BYK
+ * @copyright 2015 Burak Yigit Kaya. All rights reserved.
+ * @copyright 2015 Mathieu M-Gosselin. All rights reserved.
+ */
+
+"use strict";
+
+//------------------------------------------------------------------------------
+// Rule Definition
+//------------------------------------------------------------------------------
+
+module.exports = function(context) {
+ var options = context.options[0] || {};
+ var minLength = typeof options.min !== "undefined" ? options.min : 2;
+ var maxLength = typeof options.max !== "undefined" ? options.max : Infinity;
+ var properties = options.properties !== "never";
+ var exceptions = (options.exceptions ? options.exceptions : [])
+ .reduce(function(obj, item) {
+ obj[item] = true;
+
+ return obj;
+ }, {});
+
+ var SUPPORTED_EXPRESSIONS = {
+ "MemberExpression": properties && function(parent) {
+ return !parent.computed && (
+ // regular property assignment
+ parent.parent.left === parent || (
+ // or the last identifier in an ObjectPattern destructuring
+ parent.parent.type === "Property" && parent.parent.value === parent &&
+ parent.parent.parent.type === "ObjectPattern" && parent.parent.parent.parent.left === parent.parent.parent
+ )
+ );
+ },
+ "AssignmentPattern": function(parent, node) {
+ return parent.left === node;
+ },
+ "VariableDeclarator": function(parent, node) {
+ return parent.id === node;
+ },
+ "Property": properties && function(parent, node) {
+ return parent.key === node;
+ },
+ "ImportDefaultSpecifier": true,
+ "RestElement": true,
+ "FunctionExpression": true,
+ "ArrowFunctionExpression": true,
+ "ClassDeclaration": true,
+ "FunctionDeclaration": true,
+ "MethodDefinition": true,
+ "CatchClause": true
+ };
+
+ return {
+ Identifier: function(node) {
+ var name = node.name;
+ var parent = node.parent;
+
+ var isShort = name.length < minLength;
+ var isLong = name.length > maxLength;
+ if (!(isShort || isLong) || exceptions[name]) {
+ return; // Nothing to report
+ }
+
+ var isValidExpression = SUPPORTED_EXPRESSIONS[parent.type];
+
+ if (isValidExpression && (isValidExpression === true || isValidExpression(parent, node))) {
+ context.report(
+ node,
+ isShort ?
+ "Identifier name '{{name}}' is too short. (< {{min}})" :
+ "Identifier name '{{name}}' is too long. (> {{max}})",
+ { name: name, min: minLength, max: maxLength }
+ );
+ }
+ }
+ };
+};
+
+module.exports.schema = [
+ {
+ "type": "object",
+ "properties": {
+ "min": {
+ "type": "number"
+ },
+ "max": {
+ "type": "number"
+ },
+ "exceptions": {
+ "type": "array",
+ "uniqueItems": true,
+ "items": {
+ "type": "string"
+ }
+ },
+ "properties": {
+ "enum": ["always", "never"]
+ }
+ },
+ "additionalProperties": false
+ }
+];
diff --git a/tools/eslint/lib/rules/id-match.js b/tools/eslint/lib/rules/id-match.js
new file mode 100644
index 00000000000000..416689c56835b0
--- /dev/null
+++ b/tools/eslint/lib/rules/id-match.js
@@ -0,0 +1,129 @@
+/**
+ * @fileoverview Rule to flag non-matching identifiers
+ * @author Matthieu Larcher
+ * @copyright 2015 Matthieu Larcher. All rights reserved.
+ * See LICENSE in root directory for full license.
+ */
+
+"use strict";
+
+//------------------------------------------------------------------------------
+// Rule Definition
+//------------------------------------------------------------------------------
+
+module.exports = function(context) {
+
+ //--------------------------------------------------------------------------
+ // Helpers
+ //--------------------------------------------------------------------------
+
+ var pattern = context.options[0] || "^.+$",
+ regexp = new RegExp(pattern);
+
+ var options = context.options[1] || {},
+ properties = options.properties;
+
+ // cast to boolean and default to false
+ properties = !!properties;
+
+
+ /**
+ * Checks if a string matches the provided pattern
+ * @param {String} name The string to check.
+ * @returns {boolean} if the string is a match
+ * @private
+ */
+ function isInvalid(name) {
+ return !regexp.test(name);
+ }
+
+ /**
+ * Verifies if we should report an error or not based on the effective
+ * parent node and the identifier name.
+ * @param {ASTNode} effectiveParent The effective parent node of the node to be reported
+ * @param {String} name The identifier name of the identifier node
+ * @returns {boolean} whether an error should be reported or not
+ */
+ function shouldReport(effectiveParent, name) {
+ return effectiveParent.type !== "CallExpression"
+ && effectiveParent.type !== "NewExpression" &&
+ isInvalid(name);
+ }
+
+ /**
+ * Reports an AST node as a rule violation.
+ * @param {ASTNode} node The node to report.
+ * @returns {void}
+ * @private
+ */
+ function report(node) {
+ context.report(node, "Identifier '{{name}}' does not match the pattern '{{pattern}}'.", {
+ name: node.name,
+ pattern: pattern
+ });
+ }
+
+ return {
+
+ "Identifier": function(node) {
+ var name = node.name,
+ effectiveParent = (node.parent.type === "MemberExpression") ? node.parent.parent : node.parent;
+
+ // MemberExpressions get special rules
+ if (node.parent.type === "MemberExpression") {
+ // return early if properties is false
+ if (!properties) {
+ return;
+ }
+
+ // Always check object names
+ if (node.parent.object.type === "Identifier" &&
+ node.parent.object.name === node.name) {
+ if (isInvalid(name)) {
+ report(node);
+ }
+
+ // Report AssignmentExpressions only if they are the left side of the assignment
+ } else if (effectiveParent.type === "AssignmentExpression" &&
+ (effectiveParent.right.type !== "MemberExpression" ||
+ effectiveParent.left.type === "MemberExpression" &&
+ effectiveParent.left.property.name === node.name)) {
+ if (isInvalid(name)) {
+ report(node);
+ }
+ }
+
+ // Properties have their own rules
+ } else if (node.parent.type === "Property") {
+ // return early if properties is false
+ if (!properties) {
+ return;
+ }
+
+ if (shouldReport(effectiveParent, name)) {
+ report(node);
+ }
+
+ // Report anything that is a match and not a CallExpression
+ } else if (shouldReport(effectiveParent, name)) {
+ report(node);
+ }
+ }
+
+ };
+
+};
+
+module.exports.schema = [
+ {
+ "type": "string"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "properties": {
+ "type": "boolean"
+ }
+ }
+ }
+];
diff --git a/tools/eslint/lib/rules/indent.js b/tools/eslint/lib/rules/indent.js
index d0cf27cca344c5..b69539b227a602 100644
--- a/tools/eslint/lib/rules/indent.js
+++ b/tools/eslint/lib/rules/indent.js
@@ -1,463 +1,677 @@
/**
* @fileoverview This option sets a specific tab width for your code
- * This rule has been ported and modified from JSCS.
- * @author Dmitriy Shekhovtsov
- * @copyright 2015 Dmitriy Shekhovtsov. All rights reserved.
- * @copyright 2013 Dulin Marat and other contributors.
- *
- * Permission is hereby granted, free of charge, to any person obtaining
- * a copy of this software and associated documentation files (the
- * "Software"), to deal in the Software without restriction, including
- * without limitation the rights to use, copy, modify, merge, publish,
- * distribute, sublicense, and/or sell copies of the Software, and to
- * permit persons to whom the Software is furnished to do so, subject to
- * the following conditions:
- *
- * The above copyright notice and this permission notice shall be
- * included in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
- * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
- * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
- * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-/*eslint no-use-before-define:[2, "nofunc"]*/
+
+ * This rule has been ported and modified from nodeca.
+ * @author Vitaly Puzrin
+ * @author Gyandeep Singh
+ * @copyright 2015 Vitaly Puzrin. All rights reserved.
+ * @copyright 2015 Gyandeep Singh. All rights reserved.
+ Copyright (C) 2014 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.
+*/
"use strict";
//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------
+var util = require("util");
+var assign = require("object-assign");
-module.exports = function (context) {
- // indentation defaults: 4 spaces
- var indentChar = " ";
- var indentSize = 4;
- var options = {indentSwitchCase: false};
+module.exports = function(context) {
+
+ var MESSAGE = "Expected indentation of {{needed}} {{type}} {{characters}} but found {{gotten}}.";
+ var DEFAULT_VARIABLE_INDENT = 1;
- var lines = null;
- var indentStack = [0];
- var linesToCheck = null;
- var breakIndents = null;
+ var indentType = "space";
+ var indentSize = 4;
+ var options = {
+ SwitchCase: 0,
+ VariableDeclarator: {
+ var: DEFAULT_VARIABLE_INDENT,
+ let: DEFAULT_VARIABLE_INDENT,
+ const: DEFAULT_VARIABLE_INDENT
+ }
+ };
if (context.options.length) {
if (context.options[0] === "tab") {
- indentChar = "\t";
indentSize = 1;
+ indentType = "tab";
} else /* istanbul ignore else : this will be caught by options validation */ if (typeof context.options[0] === "number") {
indentSize = context.options[0];
+ indentType = "space";
}
if (context.options[1]) {
var opts = context.options[1];
- options.indentSwitchCase = opts.indentSwitchCase === true;
+ options.SwitchCase = opts.SwitchCase || 0;
+ var variableDeclaratorRules = opts.VariableDeclarator;
+ if (typeof variableDeclaratorRules === "number") {
+ options.VariableDeclarator = {
+ var: variableDeclaratorRules,
+ let: variableDeclaratorRules,
+ const: variableDeclaratorRules
+ };
+ } else if (typeof variableDeclaratorRules === "object") {
+ assign(options.VariableDeclarator, variableDeclaratorRules);
+ }
}
}
- var blockParents = [
- "IfStatement",
- "WhileStatement",
- "DoWhileStatement",
- "ForStatement",
- "ForInStatement",
- "ForOfStatement",
- "FunctionDeclaration",
- "FunctionExpression",
- "ArrowExpression",
- "CatchClause",
- "WithStatement"
- ];
-
- var indentableNodes = {
- BlockStatement: "body",
- Program: "body",
- ObjectExpression: "properties",
- ArrayExpression: "elements",
- SwitchStatement: "cases"
+ var indentPattern = {
+ normal: indentType === "space" ? /^ +/ : /^\t+/,
+ excludeCommas: indentType === "space" ? /^[ ,]+/ : /^[\t,]+/
};
- if (options.indentSwitchCase) {
- indentableNodes.SwitchCase = "consequent";
- }
-
- //--------------------------------------------------------------------------
- // Helpers
- //--------------------------------------------------------------------------
+ var caseIndentStore = {};
/**
- * Mark line to be checked
- * @param {Number} line - line number
+ * Reports a given indent violation and properly pluralizes the message
+ * @param {ASTNode} node Node violating the indent rule
+ * @param {int} needed Expected indentation character count
+ * @param {int} gotten Indentation character count in the actual node/code
+ * @param {Object=} loc Error line and column location
+ * @param {boolean} isLastNodeCheck Is the error for last node check
* @returns {void}
*/
- function markCheckLine(line) {
- linesToCheck[line].check = true;
- }
+ function report(node, needed, gotten, loc, isLastNodeCheck) {
+ var msgContext = {
+ needed: needed,
+ type: indentType,
+ characters: needed === 1 ? "character" : "characters",
+ gotten: gotten
+ };
+ var indentChar = indentType === "space" ? " " : "\t";
+
+ /**
+ * Responsible for fixing the indentation issue fix
+ * @returns {Function} function to be executed by the fixer
+ * @private
+ */
+ function getFixerFunction() {
+ var rangeToFix = [];
+
+ if (needed > gotten) {
+ var spaces = "" + new Array(needed - gotten + 1).join(indentChar); // replace with repeat in future
+
+ if (isLastNodeCheck === true) {
+ rangeToFix = [
+ node.range[1] - 1,
+ node.range[1] - 1
+ ];
+ } else {
+ rangeToFix = [
+ node.range[0],
+ node.range[0]
+ ];
+ }
- /**
- * Mark line with targeted node to be checked
- * @param {ASTNode} checkNode - targeted node
- * @returns {void}
- */
- function markCheck(checkNode) {
- markCheckLine(checkNode.loc.start.line - 1);
- }
+ return function(fixer) {
+ return fixer.insertTextBeforeRange(rangeToFix, spaces);
+ };
+ } else {
+ if (isLastNodeCheck === true) {
+ rangeToFix = [
+ node.range[1] - (gotten - needed) - 1,
+ node.range[1] - 1
+ ];
+ } else {
+ rangeToFix = [
+ node.range[0] - (gotten - needed),
+ node.range[0]
+ ];
+ }
- /**
- * Sets pushing indent of current node
- * @param {ASTNode} node - targeted node
- * @param {Number} indents - indents count to push
- * @returns {void}
- */
- function markPush(node, indents) {
- linesToCheck[node.loc.start.line - 1].push.push(indents);
+ return function(fixer) {
+ return fixer.removeRange(rangeToFix);
+ };
+ }
+ }
+
+ if (loc) {
+ context.report({
+ node: node,
+ loc: loc,
+ message: MESSAGE,
+ data: msgContext,
+ fix: getFixerFunction()
+ });
+ } else {
+ context.report({
+ node: node,
+ message: MESSAGE,
+ data: msgContext,
+ fix: getFixerFunction()
+ });
+ }
}
/**
- * Marks line as outdent, end of block statement for example
- * @param {ASTNode} node - targeted node
- * @param {Number} outdents - count of outedents in targeted line
- * @returns {void}
+ * Get node indent
+ * @param {ASTNode|Token} node Node to examine
+ * @param {boolean} [byLastLine=false] get indent of node's last line
+ * @param {boolean} [excludeCommas=false] skip comma on start of line
+ * @returns {int} Indent
*/
- function markPop(node, outdents) {
- linesToCheck[node.loc.end.line - 1].pop.push(outdents);
+ function getNodeIndent(node, byLastLine, excludeCommas) {
+ var token = byLastLine ? context.getLastToken(node) : context.getFirstToken(node);
+ var src = context.getSource(token, token.loc.start.column);
+ var regExp = excludeCommas ? indentPattern.excludeCommas : indentPattern.normal;
+ var indent = regExp.exec(src);
+
+ return indent ? indent[0].length : 0;
}
/**
- * Set alt push for current node
- * @param {ASTNode} node - targeted node
- * @returns {void}
+ * Checks node is the first in its own start line. By default it looks by start line.
+ * @param {ASTNode} node The node to check
+ * @param {boolean} [byEndLocation=false] Lookup based on start position or end
+ * @returns {boolean} true if its the first in the its start line
*/
- function markPushAlt(node) {
- linesToCheck[node.loc.start.line - 1].pushAltLine.push(node.loc.end.line - 1);
+ function isNodeFirstInLine(node, byEndLocation) {
+ var firstToken = byEndLocation === true ? context.getLastToken(node, 1) : context.getTokenBefore(node),
+ startLine = byEndLocation === true ? node.loc.end.line : node.loc.start.line,
+ endLine = firstToken ? firstToken.loc.end.line : -1;
+
+ return startLine !== endLine;
}
/**
- * Marks end of node block to be checked
- * and marks targeted node as indent pushing
- * @param {ASTNode} pushNode - targeted node
- * @param {Number} indents - indent count to push
+ * Check indent for nodes list
+ * @param {ASTNode[]} nodes list of node objects
+ * @param {int} indent needed indent
+ * @param {boolean} [excludeCommas=false] skip comma on start of line
* @returns {void}
*/
- function markPushAndEndCheck(pushNode, indents) {
- markPush(pushNode, indents);
- markCheckLine(pushNode.loc.end.line - 1);
+ function checkNodesIndent(nodes, indent, excludeCommas) {
+ nodes.forEach(function(node) {
+ var nodeIndent = getNodeIndent(node, false, excludeCommas);
+ if (
+ node.type !== "ArrayExpression" && node.type !== "ObjectExpression" &&
+ nodeIndent !== indent && isNodeFirstInLine(node)
+ ) {
+ report(node, indent, nodeIndent);
+ }
+ });
}
/**
- * Mark node as switch case statement
- * and set push\pop indentation changes
- * @param {ASTNode} caseNode - targeted node
- * @param {ASTNode[]} children - consequent child nodes of case node
+ * Check last node line indent this detects, that block closed correctly
+ * @param {ASTNode} node Node to examine
+ * @param {int} lastLineIndent needed indent
* @returns {void}
*/
- function markCase(caseNode, children) {
- var outdentNode = getCaseOutdent(children);
-
- if (outdentNode) {
- // If a case statement has a `break` as a direct child and it is the
- // first one encountered, use it as the example for all future case indentation
- if (breakIndents === null) {
- breakIndents = (caseNode.loc.start.column === outdentNode.loc.start.column) ? 1 : 0;
- }
- markPop(outdentNode, breakIndents);
- } else {
- markPop(caseNode, 0);
+ function checkLastNodeLineIndent(node, lastLineIndent) {
+ var lastToken = context.getLastToken(node);
+ var endIndent = getNodeIndent(lastToken, true);
+
+ if (endIndent !== lastLineIndent && isNodeFirstInLine(node, true)) {
+ report(
+ node,
+ lastLineIndent,
+ endIndent,
+ { line: lastToken.loc.start.line, column: lastToken.loc.start.column },
+ true
+ );
}
}
/**
- * Mark child nodes to be checked later of targeted node,
- * only if child node not in same line as targeted one
- * (if child and parent nodes wrote in single line)
- * @param {ASTNode} node - targeted node
+ * Check first node line indent is correct
+ * @param {ASTNode} node Node to examine
+ * @param {int} firstLineIndent needed indent
* @returns {void}
*/
- function markChildren(node) {
- getChildren(node).forEach(function(childNode) {
- if (childNode.loc.start.line !== node.loc.start.line || node.type === "Program") {
- markCheck(childNode);
- }
- });
+ function checkFirstNodeLineIndent(node, firstLineIndent) {
+ var startIndent = getNodeIndent(node, false);
+ if (startIndent !== firstLineIndent && isNodeFirstInLine(node)) {
+ report(
+ node,
+ firstLineIndent,
+ startIndent,
+ { line: node.loc.start.line, column: node.loc.start.column }
+ );
+ }
}
/**
- * Mark child block as scope pushing and mark to check
- * @param {ASTNode} node - target node
- * @param {String} property - target node property containing child
- * @returns {void}
+ * Returns the VariableDeclarator based on the current node
+ * if not present then return null
+ * @param {ASTNode} node node to examine
+ * @returns {ASTNode|void} if found then node otherwise null
*/
- function markAlternateBlockStatement(node, property) {
- var child = node[property];
- if (child && child.type === "BlockStatement") {
- markCheck(child);
+ function getVariableDeclaratorNode(node) {
+ var parent = node.parent;
+
+ while (parent.type !== "VariableDeclarator" && parent.type !== "Program") {
+ parent = parent.parent;
}
+
+ return parent.type === "VariableDeclarator" ? parent : null;
}
/**
- * Checks whether node is multiline or single line
- * @param {ASTNode} node - target node
- * @returns {boolean} - is multiline node
+ * Check to see if the node is part of the multi-line variable declaration.
+ * Also if its on the same line as the varNode
+ * @param {ASTNode} node node to check
+ * @param {ASTNode} varNode variable declaration node to check against
+ * @returns {boolean} True if all the above condition satisfy
*/
- function isMultiline(node) {
- return node.loc.start.line !== node.loc.end.line;
+ function isNodeInVarOnTop(node, varNode) {
+ return varNode &&
+ varNode.parent.loc.start.line === node.loc.start.line &&
+ varNode.parent.declarations.length > 1;
}
/**
- * Get switch case statement outdent node if any
- * @param {ASTNode[]} caseChildren - case statement childs
- * @returns {ASTNode} - outdent node
+ * Check to see if the argument before the callee node is multi-line and
+ * there should only be 1 argument before the callee node
+ * @param {ASTNode} node node to check
+ * @returns {boolean} True if arguments are multi-line
*/
- function getCaseOutdent(caseChildren) {
- var outdentNode;
- caseChildren.some(function(node) {
- if (node.type === "BreakStatement") {
- outdentNode = node;
- return true;
- }
- });
+ function isArgBeforeCalleeNodeMultiline(node) {
+ var parent = node.parent;
+
+ if (parent.arguments.length >= 2 && parent.arguments[1] === node) {
+ return parent.arguments[0].loc.end.line > parent.arguments[0].loc.start.line;
+ }
- return outdentNode;
+ return false;
}
/**
- * Returns block containing node
- * @param {ASTNode} node - targeted node
- * @returns {ASTNode} - block node
+ * Check indent for function block content
+ * @param {ASTNode} node node to examine
+ * @returns {void}
*/
- function getBlockNodeToMark(node) {
- var parent = node.parent;
+ function checkIndentInFunctionBlock(node) {
+
+ // Search first caller in chain.
+ // Ex.:
+ //
+ // Models <- Identifier
+ // .User
+ // .find()
+ // .exec(function() {
+ // // function body
+ // });
+ //
+ // Looks for 'Models'
+ var calleeNode = node.parent; // FunctionExpression
+ var indent;
+
+ if (calleeNode.parent &&
+ (calleeNode.parent.type === "Property" ||
+ calleeNode.parent.type === "ArrayExpression")) {
+ // If function is part of array or object, comma can be put at left
+ indent = getNodeIndent(calleeNode, false, true);
+ } else {
+ // If function is standalone, simple calculate indent
+ indent = getNodeIndent(calleeNode);
+ }
+
+ if (calleeNode.parent.type === "CallExpression") {
+ var calleeParent = calleeNode.parent;
- // The parent of an else is the entire if/else block. To avoid over indenting
- // in the case of a non-block if with a block else, mark push where the else starts,
- // not where the if starts!
- if (parent.type === "IfStatement" && parent.alternate === node) {
- return node;
+ if (calleeNode.type !== "FunctionExpression" && calleeNode.type !== "ArrowFunctionExpression") {
+ if (calleeParent && calleeParent.loc.start.line < node.loc.start.line) {
+ indent = getNodeIndent(calleeParent);
+ }
+ } else {
+ if (isArgBeforeCalleeNodeMultiline(calleeNode) &&
+ calleeParent.callee.loc.start.line === calleeParent.callee.loc.end.line &&
+ !isNodeFirstInLine(calleeNode)) {
+ indent = getNodeIndent(calleeParent);
+ }
+ }
}
- // The end line to check of a do while statement needs to be the location of the
- // closing curly brace, not the while statement, to avoid marking the last line of
- // a multiline while as a line to check.
- if (parent.type === "DoWhileStatement") {
- return node;
+ // function body indent should be indent + indent size
+ indent += indentSize;
+
+ // check if the node is inside a variable
+ var parentVarNode = getVariableDeclaratorNode(node);
+ if (parentVarNode && isNodeInVarOnTop(node, parentVarNode)) {
+ indent += indentSize * options.VariableDeclarator[parentVarNode.parent.kind];
}
- // Detect bare blocks: a block whose parent doesn"t expect blocks in its syntax specifically.
- if (blockParents.indexOf(parent.type) === -1) {
- return node;
+ if (node.body.length > 0) {
+ checkNodesIndent(node.body, indent);
}
- return parent;
+ checkLastNodeLineIndent(node, indent - indentSize);
}
+
/**
- * Get node's children
- * @param {ASTNode} node - current node
- * @returns {ASTNode[]} - children
+ * Checks if the given node starts and ends on the same line
+ * @param {ASTNode} node The node to check
+ * @returns {boolean} Whether or not the block starts and ends on the same line.
*/
- function getChildren(node) {
- var childrenProperty = indentableNodes[node.type];
- return node[childrenProperty];
+ function isSingleLineNode(node) {
+ var lastToken = context.getLastToken(node),
+ startLine = node.loc.start.line,
+ endLine = lastToken.loc.end.line;
+
+ return startLine === endLine;
}
/**
- * Gets indentation in line `i`
- * @param {Number} i - number of line to get indentation
- * @returns {Number} - count of indentation symbols
+ * Check to see if the first element inside an array is an object and on the same line as the node
+ * If the node is not an array then it will return false.
+ * @param {ASTNode} node node to check
+ * @returns {boolean} success/failure
*/
- function getIndentationFromLine(i) {
- var rNotIndentChar = new RegExp("[^" + indentChar + "]");
- var firstContent = lines[i].search(rNotIndentChar);
- if (firstContent === -1) {
- firstContent = lines[i].length;
+ function isFirstArrayElementOnSameLine(node) {
+ if (node.type === "ArrayExpression" && node.elements[0]) {
+ return node.elements[0].loc.start.line === node.loc.start.line && node.elements[0].type === "ObjectExpression";
+ } else {
+ return false;
}
- return firstContent;
}
/**
- * Compares expected and actual indentation
- * and reports any violations
- * @param {ASTNode} node - node used only for reporting
+ * Check indent for array block content or object block content
+ * @param {ASTNode} node node to examine
* @returns {void}
*/
- function checkIndentations(node) {
- linesToCheck.forEach(function(line, i) {
- var actualIndentation = getIndentationFromLine(i);
- var expectedIndentation = getExpectedIndentation(line, actualIndentation);
-
- if (line.check) {
-
- if (actualIndentation !== expectedIndentation) {
- context.report(node,
- {line: i + 1, column: expectedIndentation},
- "Expected indentation of " + expectedIndentation + " characters.");
- // correct the indentation so that future lines
- // can be validated appropriately
- actualIndentation = expectedIndentation;
+ function checkIndentInArrayOrObjectBlock(node) {
+ // Skip inline
+ if (isSingleLineNode(node)) {
+ return;
+ }
+
+ var elements = (node.type === "ArrayExpression") ? node.elements : node.properties;
+
+ // filter out empty elements example would be [ , 2] so remove first element as espree considers it as null
+ elements = elements.filter(function(elem) {
+ return elem !== null;
+ });
+
+ // Skip if first element is in same line with this node
+ if (elements.length > 0 && elements[0].loc.start.line === node.loc.start.line) {
+ return;
+ }
+
+ var nodeIndent;
+ var elementsIndent;
+ var parentVarNode = getVariableDeclaratorNode(node);
+
+ // TODO - come up with a better strategy in future
+ if (isNodeFirstInLine(node)) {
+ var parent = node.parent;
+ var effectiveParent = parent;
+
+ if (parent.type === "MemberExpression") {
+ if (isNodeFirstInLine(parent)) {
+ effectiveParent = parent.parent.parent;
+ } else {
+ effectiveParent = parent.parent;
}
}
+ nodeIndent = getNodeIndent(effectiveParent);
+ if (parentVarNode && parentVarNode.loc.start.line !== node.loc.start.line) {
+ if (parent.type !== "VariableDeclarator" || parentVarNode === parentVarNode.parent.declarations[0]) {
+ nodeIndent = nodeIndent + (indentSize * options.VariableDeclarator[parentVarNode.parent.kind]);
+ } else if (parent.loc.start.line !== node.loc.start.line && parentVarNode === parentVarNode.parent.declarations[0]) {
+ nodeIndent = nodeIndent + indentSize;
+ }
+ } else if (!parentVarNode && !isFirstArrayElementOnSameLine(parent) && effectiveParent.type !== "MemberExpression" && effectiveParent.type !== "ExpressionStatement" && effectiveParent.type !== "AssignmentExpression" && effectiveParent.type !== "Property") {
+ nodeIndent = nodeIndent + indentSize;
+ }
+
+ elementsIndent = nodeIndent + indentSize;
+
+ checkFirstNodeLineIndent(node, nodeIndent);
+ } else {
+ nodeIndent = getNodeIndent(node);
+ elementsIndent = nodeIndent + indentSize;
+ }
+
+ // check if the node is a multiple variable declaration, if yes then make sure indentation takes into account
+ // variable indentation concept
+ if (isNodeInVarOnTop(node, parentVarNode)) {
+ elementsIndent += indentSize * options.VariableDeclarator[parentVarNode.parent.kind];
+ }
+
+ // Comma can be placed before property name
+ checkNodesIndent(elements, elementsIndent, true);
- if (line.push.length) {
- pushExpectedIndentations(line, actualIndentation);
+ if (elements.length > 0) {
+ // Skip last block line check if last item in same line
+ if (elements[elements.length - 1].loc.end.line === node.loc.end.line) {
+ return;
}
- });
+ }
+
+ checkLastNodeLineIndent(node, elementsIndent - indentSize);
}
/**
- * Counts expected indentation for given line number
- * @param {Number} line - line number
- * @param {Number} actual - actual indentation
- * @returns {number} - expected indentation
+ * Check if the node or node body is a BlockStatement or not
+ * @param {ASTNode} node node to test
+ * @returns {boolean} True if it or its body is a block statement
*/
- function getExpectedIndentation(line, actual) {
- var outdent = indentSize * Math.max.apply(null, line.pop);
+ function isNodeBodyBlock(node) {
+ return node.type === "BlockStatement" || (node.body && node.body.type === "BlockStatement") ||
+ (node.consequent && node.consequent.type === "BlockStatement");
+ }
- var idx = indentStack.length - 1;
- var expected = indentStack[idx];
+ /**
+ * Check indentation for blocks
+ * @param {ASTNode} node node to check
+ * @returns {void}
+ */
+ function blockIndentationCheck(node) {
+ // Skip inline blocks
+ if (isSingleLineNode(node)) {
+ return;
+ }
- if (!Array.isArray(expected)) {
- expected = [expected];
+ if (node.parent && (
+ node.parent.type === "FunctionExpression" ||
+ node.parent.type === "FunctionDeclaration" ||
+ node.parent.type === "ArrowFunctionExpression"
+ )) {
+ checkIndentInFunctionBlock(node);
+ return;
}
- expected = expected.map(function(value) {
- if (line.pop.length) {
- value -= outdent;
- }
+ var indent;
+ var nodesToCheck = [];
- return value;
- }).reduce(function(previous, current) {
- // when the expected is an array, resolve the value
- // back into a Number by checking both values are the actual indentation
- return actual === current ? current : previous;
- });
+ // For this statements we should check indent from statement begin
+ // (not from block begin)
+ var statementsWithProperties = [
+ "IfStatement", "WhileStatement", "ForStatement", "ForInStatement", "ForOfStatement", "DoWhileStatement"
+ ];
+
+ if (node.parent && statementsWithProperties.indexOf(node.parent.type) !== -1 && isNodeBodyBlock(node)) {
+ indent = getNodeIndent(node.parent);
+ } else {
+ indent = getNodeIndent(node);
+ }
- indentStack[idx] = expected;
+ if (node.type === "IfStatement" && node.consequent.type !== "BlockStatement") {
+ nodesToCheck = [node.consequent];
+ } else if (util.isArray(node.body)) {
+ nodesToCheck = node.body;
+ } else {
+ nodesToCheck = [node.body];
+ }
- line.pop.forEach(function() {
- indentStack.pop();
- });
+ if (nodesToCheck.length > 0) {
+ checkNodesIndent(nodesToCheck, indent + indentSize);
+ }
- return expected;
+ if (node.type === "BlockStatement") {
+ checkLastNodeLineIndent(node, indent);
+ }
+ }
+
+ /**
+ * Filter out the elements which are on the same line of each other or the node.
+ * basically have only 1 elements from each line except the variable declaration line.
+ * @param {ASTNode} node Variable declaration node
+ * @returns {ASTNode[]} Filtered elements
+ */
+ function filterOutSameLineVars(node) {
+ return node.declarations.reduce(function(finalCollection, elem) {
+ var lastElem = finalCollection[finalCollection.length - 1];
+
+ if ((elem.loc.start.line !== node.loc.start.line && !lastElem) ||
+ (lastElem && lastElem.loc.start.line !== elem.loc.start.line)) {
+ finalCollection.push(elem);
+ }
+
+ return finalCollection;
+ }, []);
}
/**
- * Store in stack expected indentations
- * @param {Number} line - current line
- * @param {Number} actualIndentation - actual indentation at current line
+ * Check indentation for variable declarations
+ * @param {ASTNode} node node to examine
* @returns {void}
*/
- function pushExpectedIndentations(line, actualIndentation) {
- var indents = Math.max.apply(null, line.push);
- var expected = actualIndentation + (indentSize * indents);
-
- // when a line has alternate indentations, push an array of possible values
- // on the stack, to be resolved when checked against an actual indentation
- if (line.pushAltLine.length) {
- expected = [expected];
- line.pushAltLine.forEach(function(altLine) {
- expected.push(getIndentationFromLine(altLine) + (indentSize * indents));
- });
+ function checkIndentInVariableDeclarations(node) {
+ var elements = filterOutSameLineVars(node);
+ var nodeIndent = getNodeIndent(node);
+ var lastElement = elements[elements.length - 1];
+
+ var elementsIndent = nodeIndent + indentSize * options.VariableDeclarator[node.kind];
+
+ // Comma can be placed before declaration
+ checkNodesIndent(elements, elementsIndent, true);
+
+ // Only check the last line if there is any token after the last item
+ if (context.getLastToken(node).loc.end.line <= lastElement.loc.end.line) {
+ return;
}
- line.push.forEach(function() {
- indentStack.push(expected);
- });
+ var tokenBeforeLastElement = context.getTokenBefore(lastElement);
+
+ if (tokenBeforeLastElement.value === ",") {
+ // Special case for comma-first syntax where the semicolon is indented
+ checkLastNodeLineIndent(node, getNodeIndent(tokenBeforeLastElement));
+ } else {
+ checkLastNodeLineIndent(node, elementsIndent - indentSize);
+ }
}
- //--------------------------------------------------------------------------
- // Public
- //--------------------------------------------------------------------------
+ /**
+ * Check and decide whether to check for indentation for blockless nodes
+ * Scenarios are for or while statements without braces around them
+ * @param {ASTNode} node node to examine
+ * @returns {void}
+ */
+ function blockLessNodes(node) {
+ if (node.body.type !== "BlockStatement") {
+ blockIndentationCheck(node);
+ }
+ }
- return {
- "Program": function (node) {
- lines = context.getSourceLines();
- linesToCheck = lines.map(function () {
- return {
- push: [],
- pushAltLine: [],
- pop: [],
- check: false
- };
- });
+ /**
+ * Returns the expected indentation for the case statement
+ * @param {ASTNode} node node to examine
+ * @param {int} [switchIndent] indent for switch statement
+ * @returns {int} indent size
+ */
+ function expectedCaseIndent(node, switchIndent) {
+ var switchNode = (node.type === "SwitchStatement") ? node : node.parent;
+ var caseIndent;
- if (!isMultiline(node)) {
- return;
+ if (caseIndentStore[switchNode.loc.start.line]) {
+ return caseIndentStore[switchNode.loc.start.line];
+ } else {
+ if (typeof switchIndent === "undefined") {
+ switchIndent = getNodeIndent(switchNode);
}
- markChildren(node);
- },
- "Program:exit": function (node) {
- checkIndentations(node);
- },
-
- "BlockStatement": function (node) {
- if (!isMultiline(node)) {
- return;
+ if (switchNode.cases.length > 0 && options.SwitchCase === 0) {
+ caseIndent = switchIndent;
+ } else {
+ caseIndent = switchIndent + (indentSize * options.SwitchCase);
}
- markChildren(node);
- markPop(node, 1);
+ caseIndentStore[switchNode.loc.start.line] = caseIndent;
+ return caseIndent;
+ }
+ }
- markPushAndEndCheck(getBlockNodeToMark(node), 1);
+ return {
+ "Program": function(node) {
+ if (node.body.length > 0) {
+ // Root nodes should have no indent
+ checkNodesIndent(node.body, getNodeIndent(node));
+ }
},
- "IfStatement": function (node) {
- markAlternateBlockStatement(node, "alternate");
- },
+ "BlockStatement": blockIndentationCheck,
- "TryStatement": function (node) {
- markAlternateBlockStatement(node, "handler");
- markAlternateBlockStatement(node, "finalizer");
- },
+ "WhileStatement": blockLessNodes,
- "SwitchStatement": function (node) {
- if (!isMultiline(node)) {
- return;
- }
+ "ForStatement": blockLessNodes,
- var indents = 1;
- var children = getChildren(node);
+ "ForInStatement": blockLessNodes,
- if (children.length && node.loc.start.column === children[0].loc.start.column) {
- indents = 0;
- }
+ "ForOfStatement": blockLessNodes,
- markChildren(node);
- markPop(node, indents);
- markPushAndEndCheck(node, indents);
- },
+ "DoWhileStatement": blockLessNodes,
- "SwitchCase": function (node) {
- if (!options.indentSwitchCase) {
- return;
+ "IfStatement": function(node) {
+ if (node.consequent.type !== "BlockStatement" && node.consequent.loc.start.line > node.loc.start.line) {
+ blockIndentationCheck(node);
}
+ },
- if (!isMultiline(node)) {
- return;
+ "VariableDeclaration": function(node) {
+ if (node.declarations[node.declarations.length - 1].loc.start.line > node.declarations[0].loc.start.line) {
+ checkIndentInVariableDeclarations(node);
}
+ },
- var children = getChildren(node);
+ "ObjectExpression": function(node) {
+ checkIndentInArrayOrObjectBlock(node);
+ },
- if (children.length === 1 && children[0].type === "BlockStatement") {
- return;
- }
+ "ArrayExpression": function(node) {
+ checkIndentInArrayOrObjectBlock(node);
+ },
- markPush(node, 1);
- markCheck(node);
- markChildren(node);
+ "SwitchStatement": function(node) {
+ // Switch is not a 'BlockStatement'
+ var switchIndent = getNodeIndent(node);
+ var caseIndent = expectedCaseIndent(node, switchIndent);
+ checkNodesIndent(node.cases, caseIndent);
- markCase(node, children);
- },
- // indentations inside of function expressions can be offset from
- // either the start of the function or the end of the function, therefore
- // mark all starting lines of functions as potential indentations
- "FunctionDeclaration": function (node) {
- markPushAlt(node);
+ checkLastNodeLineIndent(node, switchIndent);
},
- "FunctionExpression": function (node) {
- markPushAlt(node);
+
+ "SwitchCase": function(node) {
+ // Skip inline cases
+ if (isSingleLineNode(node)) {
+ return;
+ }
+ var caseIndent = expectedCaseIndent(node);
+ checkNodesIndent(node.consequent, caseIndent + indentSize);
}
};
@@ -477,8 +691,22 @@ module.exports.schema = [
{
"type": "object",
"properties": {
- "indentSwitchCase": {
- "type": "boolean"
+ "SwitchCase": {
+ "type": "integer"
+ },
+ "VariableDeclarator": {
+ "type": ["integer", "object"],
+ "properties": {
+ "var": {
+ "type": "integer"
+ },
+ "let": {
+ "type": "integer"
+ },
+ "const": {
+ "type": "integer"
+ }
+ }
}
},
"additionalProperties": false
diff --git a/tools/eslint/lib/rules/init-declarations.js b/tools/eslint/lib/rules/init-declarations.js
new file mode 100644
index 00000000000000..f10e91ccaef538
--- /dev/null
+++ b/tools/eslint/lib/rules/init-declarations.js
@@ -0,0 +1,120 @@
+/**
+ * @fileoverview A rule to control the style of variable initializations.
+ * @author Colin Ihrig
+ * @copyright 2015 Colin Ihrig. All rights reserved.
+ */
+
+"use strict";
+
+//------------------------------------------------------------------------------
+// Helpers
+//------------------------------------------------------------------------------
+
+/**
+ * Checks whether or not a given node is a for loop.
+ * @param {ASTNode} block - A node to check.
+ * @returns {boolean} `true` when the node is a for loop.
+ */
+function isForLoop(block) {
+ return block.type === "ForInStatement" ||
+ block.type === "ForOfStatement" ||
+ block.type === "ForStatement";
+}
+
+/**
+ * Checks whether or not a given declarator node has its initializer.
+ * @param {ASTNode} node - A declarator node to check.
+ * @returns {boolean} `true` when the node has its initializer.
+ */
+function isInitialized(node) {
+ var declaration = node.parent;
+ var block = declaration.parent;
+
+ if (isForLoop(block)) {
+ if (block.type === "ForStatement") {
+ return block.init === declaration;
+ }
+ return block.left === declaration;
+ }
+ return Boolean(node.init);
+}
+
+//------------------------------------------------------------------------------
+// Rule Definition
+//------------------------------------------------------------------------------
+
+module.exports = function(context) {
+
+ var MODE_ALWAYS = "always",
+ MODE_NEVER = "never";
+
+ var mode = context.options[0] || MODE_ALWAYS;
+ var params = context.options[1] || {};
+ //--------------------------------------------------------------------------
+ // Public API
+ //--------------------------------------------------------------------------
+
+ return {
+ "VariableDeclaration:exit": function(node) {
+
+ var kind = node.kind,
+ declarations = node.declarations;
+
+ for (var i = 0; i < declarations.length; ++i) {
+ var declaration = declarations[i],
+ id = declaration.id,
+ initialized = isInitialized(declaration),
+ isIgnoredForLoop = params.ignoreForLoopInit && isForLoop(node.parent);
+ if (id.type !== "Identifier") {
+ continue;
+ }
+
+ if (mode === MODE_ALWAYS && !initialized) {
+ context.report(declaration, "Variable '" + id.name + "' should be initialized on declaration.");
+ } else if (mode === MODE_NEVER && kind !== "const" && initialized && !isIgnoredForLoop) {
+ context.report(declaration, "Variable '" + id.name + "' should not be initialized on declaration.");
+ }
+ }
+ }
+ };
+};
+
+module.exports.schema = {
+ "anyOf": [
+ {
+ "type": "array",
+ "items": [
+ {
+ "enum": [0, 1, 2]
+ },
+ {
+ "enum": ["always"]
+ }
+ ],
+ "minItems": 1,
+ "maxItems": 2
+ },
+ {
+ "type": "array",
+ "items": [
+ {
+ "enum": [0, 1, 2]
+ },
+ {
+ "enum": ["never"]
+ },
+ {
+ "type": "object",
+ "properties": {
+ "ignoreForLoopInit": {
+ "type": "boolean"
+ }
+ },
+ "additionalProperties": false
+ }
+ ],
+ "minItems": 1,
+ "maxItems": 3
+ }
+ ]
+};
diff --git a/tools/eslint/lib/rules/jsx-quotes.js b/tools/eslint/lib/rules/jsx-quotes.js
new file mode 100644
index 00000000000000..dba716069903d7
--- /dev/null
+++ b/tools/eslint/lib/rules/jsx-quotes.js
@@ -0,0 +1,63 @@
+/**
+ * @fileoverview A rule to ensure consistent quotes used in jsx syntax.
+ * @author Mathias Schreck
+ * @copyright 2015 Mathias Schreck
+ */
+
+"use strict";
+
+//------------------------------------------------------------------------------
+// Requirements
+//------------------------------------------------------------------------------
+
+var astUtils = require("../ast-utils");
+
+//------------------------------------------------------------------------------
+// Constants
+//------------------------------------------------------------------------------
+
+var QUOTE_SETTINGS = {
+ "prefer-double": {
+ quote: "\"",
+ description: "singlequote"
+ },
+ "prefer-single": {
+ quote: "'",
+ description: "doublequote"
+ }
+};
+
+//------------------------------------------------------------------------------
+// Rule Definition
+//------------------------------------------------------------------------------
+
+module.exports = function(context) {
+ var quoteOption = context.options[0] || "prefer-double",
+ setting = QUOTE_SETTINGS[quoteOption];
+
+ /**
+ * Checks if the given string literal node uses the expected quotes
+ * @param {ASTNode} node - A string literal node.
+ * @returns {boolean} Whether or not the string literal used the expected quotes.
+ * @public
+ */
+ function usesExpectedQuotes(node) {
+ return node.value.indexOf(setting.quote) !== -1 || astUtils.isSurroundedBy(node.raw, setting.quote);
+ }
+
+ return {
+ "JSXAttribute": function(node) {
+ var attributeValue = node.value;
+
+ if (attributeValue && astUtils.isStringLiteral(attributeValue) && !usesExpectedQuotes(attributeValue)) {
+ context.report(attributeValue, "Unexpected usage of {{description}}.", setting);
+ }
+ }
+ };
+};
+
+module.exports.schema = [
+ {
+ "enum": [ "prefer-single", "prefer-double" ]
+ }
+];
diff --git a/tools/eslint/lib/rules/key-spacing.js b/tools/eslint/lib/rules/key-spacing.js
index 5ba944ea4ed5e7..a3d3a8904fd132 100644
--- a/tools/eslint/lib/rules/key-spacing.js
+++ b/tools/eslint/lib/rules/key-spacing.js
@@ -94,9 +94,27 @@ module.exports = function(context) {
var options = context.options[0] || {},
align = options.align,
+ mode = options.mode || "strict",
beforeColon = +!!options.beforeColon, // Defaults to false
afterColon = +!(options.afterColon === false); // Defaults to true
+ /**
+ * Starting from the given a node (a property.key node here) looks forward
+ * until it finds the last token before a colon punctuator and returns it.
+ * @param {ASTNode} node The node to start looking from.
+ * @returns {ASTNode} The last token before a colon punctuator.
+ */
+ function getLastTokenBeforeColon(node) {
+ var prevNode;
+
+ while (node && (node.type !== "Punctuator" || node.value !== ":")) {
+ prevNode = node;
+ node = context.getTokenAfter(node);
+ }
+
+ return prevNode;
+ }
+
/**
* Gets an object literal property's key as the identifier name or string value.
* @param {ASTNode} property Property node whose key to retrieve.
@@ -127,7 +145,9 @@ module.exports = function(context) {
firstTokenAfterColon = context.getTokenAfter(key, 1),
location = side === "key" ? key.loc.start : firstTokenAfterColon.loc.start;
- if (diff && !(expected && containsLineTerminator(whitespace))) {
+ if ((diff && mode === "strict" || diff < 0 && mode === "minimum") &&
+ !(expected && containsLineTerminator(whitespace))
+ ) {
context.report(property[side], location, messages[side], {
error: diff > 0 ? "Extra" : "Missing",
computed: property.computed ? "computed " : "",
@@ -143,26 +163,17 @@ module.exports = function(context) {
* @returns {int} Width of the key.
*/
function getKeyWidth(property) {
- var key = property.key,
- startToken, endToken;
+ var startToken, endToken;
- // [computed]: value
- if (property.computed) {
- startToken = context.getTokenBefore(key);
- endToken = context.getTokenAfter(key);
- return endToken.range[1] - startToken.range[0];
+ // Ignore shorthand methods and properties, as they have no colon
+ if (property.method || property.shorthand) {
+ return 0;
}
- // name: value
- if (key.type === "Identifier") {
- return key.name.length;
- }
+ startToken = context.getFirstToken(property);
+ endToken = getLastTokenBeforeColon(property.key);
- // "literal": value
- // 42: value
- if (key.type === "Literal") {
- return key.raw.length;
- }
+ return endToken.range[1] - startToken.range[0];
}
/**
@@ -297,7 +308,7 @@ module.exports = function(context) {
} else { // Strictly obey beforeColon and afterColon in each property
return {
- "Property": function (node) {
+ "Property": function(node) {
verifySpacing(node);
}
};
@@ -313,6 +324,9 @@ module.exports.schema = [
"align": {
"enum": ["colon", "value"]
},
+ "mode": {
+ "enum": ["strict", "minimum"]
+ },
"beforeColon": {
"type": "boolean"
},
diff --git a/tools/eslint/lib/rules/linebreak-style.js b/tools/eslint/lib/rules/linebreak-style.js
index b9afe7a4ba7965..29a9dfb7f0555a 100644
--- a/tools/eslint/lib/rules/linebreak-style.js
+++ b/tools/eslint/lib/rules/linebreak-style.js
@@ -12,26 +12,61 @@
// Rule Definition
//------------------------------------------------------------------------------
-module.exports = function (context) {
+module.exports = function(context) {
+
var EXPECTED_LF_MSG = "Expected linebreaks to be 'LF' but found 'CRLF'.",
EXPECTED_CRLF_MSG = "Expected linebreaks to be 'CRLF' but found 'LF'.";
+ //--------------------------------------------------------------------------
+ // Helpers
+ //--------------------------------------------------------------------------
+
+ /**
+ * Builds a fix function that replaces text at the specified range in the source text.
+ * @param {int[]} range The range to replace
+ * @param {string} text The text to insert.
+ * @returns {function} Fixer function
+ * @private
+ */
+ function createFix(range, text) {
+ return function(fixer) {
+ return fixer.replaceTextRange(range, text);
+ };
+ }
+
+ //--------------------------------------------------------------------------
+ // Public
+ //--------------------------------------------------------------------------
+
return {
"Program": function checkForlinebreakStyle(node) {
var linebreakStyle = context.options[0] || "unix",
expectedLF = linebreakStyle === "unix",
- linebreaks = context.getSource().match(/\r\n|\r|\n|\u2028|\u2029/g),
- lineOfError = -1;
+ expectedLFChars = expectedLF ? "\n" : "\r\n",
+ source = context.getSource(),
+ pattern = /\r\n|\r|\n|\u2028|\u2029/g,
+ match,
+ index,
+ range;
- if (linebreaks !== null) {
- lineOfError = linebreaks.indexOf(expectedLF ? "\r\n" : "\n");
- }
+ var i = 0;
+ while ((match = pattern.exec(source)) !== null) {
+ i++;
+ if (match[0] === expectedLFChars) {
+ continue;
+ }
- if (lineOfError !== -1) {
- context.report(node, {
- line: lineOfError + 1,
- column: context.getSourceLines()[lineOfError].length
- }, expectedLF ? EXPECTED_LF_MSG : EXPECTED_CRLF_MSG);
+ index = match.index;
+ range = [index, index + match[0].length];
+ context.report({
+ node: node,
+ loc: {
+ line: i,
+ column: context.getSourceLines()[i - 1].length
+ },
+ message: expectedLF ? EXPECTED_LF_MSG : EXPECTED_CRLF_MSG,
+ fix: createFix(range, expectedLFChars)
+ });
}
}
};
diff --git a/tools/eslint/lib/rules/lines-around-comment.js b/tools/eslint/lib/rules/lines-around-comment.js
index 655d83765923dd..e2416fc59ead42 100644
--- a/tools/eslint/lib/rules/lines-around-comment.js
+++ b/tools/eslint/lib/rules/lines-around-comment.js
@@ -1,10 +1,22 @@
/**
* @fileoverview Enforces empty lines around comments.
* @author Jamund Ferguson
+ * @copyright 2015 Mathieu M-Gosselin. All rights reserved.
* @copyright 2015 Jamund Ferguson. All rights reserved.
+ * @copyright 2015 Gyandeep Singh. All rights reserved.
*/
"use strict";
+//------------------------------------------------------------------------------
+// Requirements
+//------------------------------------------------------------------------------
+
+var assign = require("object-assign");
+
+//------------------------------------------------------------------------------
+// Helpers
+//------------------------------------------------------------------------------
+
/**
* Return an array with with any line numbers that are empty.
* @param {Array} lines An array of each line of the file.
@@ -31,7 +43,7 @@ function getEmptyLineNums(lines) {
*/
function getCommentLineNums(comments) {
var lines = [];
- comments.forEach(function (token) {
+ comments.forEach(function(token) {
var start = token.loc.start.line;
var end = token.loc.end.line;
lines.push(start, end);
@@ -55,7 +67,7 @@ function contains(val, array) {
module.exports = function(context) {
- var options = context.options[0] || {};
+ var options = context.options[0] ? assign({}, context.options[0]) : {};
options.beforeLineComment = options.beforeLineComment || false;
options.afterLineComment = options.afterLineComment || false;
options.beforeBlockComment = typeof options.beforeBlockComment !== "undefined" ? options.beforeBlockComment : true;
@@ -63,60 +75,139 @@ module.exports = function(context) {
options.allowBlockStart = options.allowBlockStart || false;
options.allowBlockEnd = options.allowBlockEnd || false;
+ var sourceCode = context.getSourceCode();
/**
- * Returns whether or not comments are not on lines starting with or ending with code
+ * Returns whether or not comments are on lines starting with or ending with code
* @param {ASTNode} node The comment node to check.
* @returns {boolean} True if the comment is not alone.
*/
function codeAroundComment(node) {
+ var token;
- var lines = context.getSourceLines();
+ token = node;
+ do {
+ token = sourceCode.getTokenOrCommentBefore(token);
+ } while (token && (token.type === "Block" || token.type === "Line"));
- // Get the whole line and cut it off at the start of the comment
- var startLine = lines[node.loc.start.line - 1];
- var endLine = lines[node.loc.end.line - 1];
+ if (token && token.loc.end.line === node.loc.start.line) {
+ return true;
+ }
- var preamble = startLine.slice(0, node.loc.start.column).trim();
+ token = node;
+ do {
+ token = sourceCode.getTokenOrCommentAfter(token);
+ } while (token && (token.type === "Block" || token.type === "Line"));
- // Also check after the comment
- var postamble = endLine.slice(node.loc.end.column).trim();
+ if (token && token.loc.start.line === node.loc.end.line) {
+ return true;
+ }
- // Should be false if there was only whitespace around the comment
- return !!(preamble || postamble);
+ return false;
}
/**
- * Returns whether or not comments are at the block start or not.
+ * Returns whether or not comments are inside a node type or not.
* @param {ASTNode} node The Comment node.
- * @returns {boolean} True if the comment is at block start.
+ * @param {ASTNode} parent The Comment parent node.
+ * @param {string} nodeType The parent type to check against.
+ * @returns {boolean} True if the comment is inside nodeType.
*/
- function isCommentAtBlockStart(node) {
+ function isCommentInsideNodeType(node, parent, nodeType) {
+ return parent.type === nodeType ||
+ (parent.body && parent.body.type === nodeType) ||
+ (parent.consequent && parent.consequent.type === nodeType);
+ }
+
+ /**
+ * Returns whether or not comments are at the parent start or not.
+ * @param {ASTNode} node The Comment node.
+ * @param {string} nodeType The parent type to check against.
+ * @returns {boolean} True if the comment is at parent start.
+ */
+ function isCommentAtParentStart(node, nodeType) {
var ancestors = context.getAncestors();
var parent;
if (ancestors.length) {
parent = ancestors.pop();
}
- return parent && (parent.type === "BlockStatement" || parent.body.type === "BlockStatement") &&
+
+ return parent && isCommentInsideNodeType(node, parent, nodeType) &&
node.loc.start.line - parent.loc.start.line === 1;
}
/**
- * Returns whether or not comments are at the block end or not.
+ * Returns whether or not comments are at the parent end or not.
* @param {ASTNode} node The Comment node.
- * @returns {boolean} True if the comment is at block end.
+ * @param {string} nodeType The parent type to check against.
+ * @returns {boolean} True if the comment is at parent end.
*/
- function isCommentAtBlockEnd(node) {
+ function isCommentAtParentEnd(node, nodeType) {
var ancestors = context.getAncestors();
var parent;
if (ancestors.length) {
parent = ancestors.pop();
}
- return parent && (parent.type === "BlockStatement" || parent.body.type === "BlockStatement") &&
+
+ return parent && isCommentInsideNodeType(node, parent, nodeType) &&
parent.loc.end.line - node.loc.end.line === 1;
}
+ /**
+ * Returns whether or not comments are at the block start or not.
+ * @param {ASTNode} node The Comment node.
+ * @returns {boolean} True if the comment is at block start.
+ */
+ function isCommentAtBlockStart(node) {
+ return isCommentAtParentStart(node, "ClassBody") || isCommentAtParentStart(node, "BlockStatement");
+ }
+
+ /**
+ * Returns whether or not comments are at the block end or not.
+ * @param {ASTNode} node The Comment node.
+ * @returns {boolean} True if the comment is at block end.
+ */
+ function isCommentAtBlockEnd(node) {
+ return isCommentAtParentEnd(node, "ClassBody") || isCommentAtParentEnd(node, "BlockStatement");
+ }
+
+ /**
+ * Returns whether or not comments are at the object start or not.
+ * @param {ASTNode} node The Comment node.
+ * @returns {boolean} True if the comment is at object start.
+ */
+ function isCommentAtObjectStart(node) {
+ return isCommentAtParentStart(node, "ObjectExpression") || isCommentAtParentStart(node, "ObjectPattern");
+ }
+
+ /**
+ * Returns whether or not comments are at the object end or not.
+ * @param {ASTNode} node The Comment node.
+ * @returns {boolean} True if the comment is at object end.
+ */
+ function isCommentAtObjectEnd(node) {
+ return isCommentAtParentEnd(node, "ObjectExpression") || isCommentAtParentEnd(node, "ObjectPattern");
+ }
+
+ /**
+ * Returns whether or not comments are at the array start or not.
+ * @param {ASTNode} node The Comment node.
+ * @returns {boolean} True if the comment is at array start.
+ */
+ function isCommentAtArrayStart(node) {
+ return isCommentAtParentStart(node, "ArrayExpression") || isCommentAtParentStart(node, "ArrayPattern");
+ }
+
+ /**
+ * Returns whether or not comments are at the array end or not.
+ * @param {ASTNode} node The Comment node.
+ * @returns {boolean} True if the comment is at array end.
+ */
+ function isCommentAtArrayEnd(node) {
+ return isCommentAtParentEnd(node, "ArrayExpression") || isCommentAtParentEnd(node, "ArrayPattern");
+ }
+
/**
* Checks if a comment node has lines around it (ignores inline comments)
* @param {ASTNode} node The Comment node.
@@ -142,7 +233,14 @@ module.exports = function(context) {
commentIsNotAlone = codeAroundComment(node);
var blockStartAllowed = options.allowBlockStart && isCommentAtBlockStart(node),
- blockEndAllowed = options.allowBlockEnd && isCommentAtBlockEnd(node);
+ blockEndAllowed = options.allowBlockEnd && isCommentAtBlockEnd(node),
+ objectStartAllowed = options.allowObjectStart && isCommentAtObjectStart(node),
+ objectEndAllowed = options.allowObjectEnd && isCommentAtObjectEnd(node),
+ arrayStartAllowed = options.allowArrayStart && isCommentAtArrayStart(node),
+ arrayEndAllowed = options.allowArrayEnd && isCommentAtArrayEnd(node);
+
+ var exceptionStartAllowed = blockStartAllowed || objectStartAllowed || arrayStartAllowed;
+ var exceptionEndAllowed = blockEndAllowed || objectEndAllowed || arrayEndAllowed;
// ignore top of the file and bottom of the file
if (prevLineNum < 1) {
@@ -158,12 +256,12 @@ module.exports = function(context) {
}
// check for newline before
- if (!blockStartAllowed && before && !contains(prevLineNum, commentAndEmptyLines)) {
+ if (!exceptionStartAllowed && before && !contains(prevLineNum, commentAndEmptyLines)) {
context.report(node, "Expected line before comment.");
}
// check for newline after
- if (!blockEndAllowed && after && !contains(nextLineNum, commentAndEmptyLines)) {
+ if (!exceptionEndAllowed && after && !contains(nextLineNum, commentAndEmptyLines)) {
context.report(node, "Expected line after comment.");
}
@@ -217,6 +315,18 @@ module.exports.schema = [
},
"allowBlockEnd": {
"type": "boolean"
+ },
+ "allowObjectStart": {
+ "type": "boolean"
+ },
+ "allowObjectEnd": {
+ "type": "boolean"
+ },
+ "allowArrayStart": {
+ "type": "boolean"
+ },
+ "allowArrayEnd": {
+ "type": "boolean"
}
},
"additionalProperties": false
diff --git a/tools/eslint/lib/rules/max-depth.js b/tools/eslint/lib/rules/max-depth.js
index 5b630ed2e5a650..a0159e1ccb5b2e 100644
--- a/tools/eslint/lib/rules/max-depth.js
+++ b/tools/eslint/lib/rules/max-depth.js
@@ -19,14 +19,30 @@ module.exports = function(context) {
var functionStack = [],
maxDepth = context.options[0] || 4;
+ /**
+ * When parsing a new function, store it in our function stack
+ * @returns {void}
+ * @private
+ */
function startFunction() {
functionStack.push(0);
}
+ /**
+ * When parsing is done then pop out the reference
+ * @returns {void}
+ * @private
+ */
function endFunction() {
functionStack.pop();
}
+ /**
+ * Save the block and Evaluate the node
+ * @param {ASTNode} node node to evaluate
+ * @returns {void}
+ * @private
+ */
function pushBlock(node) {
var len = ++functionStack[functionStack.length - 1];
@@ -36,6 +52,11 @@ module.exports = function(context) {
}
}
+ /**
+ * Pop the saved block
+ * @returns {void}
+ * @private
+ */
function popBlock() {
functionStack[functionStack.length - 1]--;
}
diff --git a/tools/eslint/lib/rules/max-len.js b/tools/eslint/lib/rules/max-len.js
index 8d0400dcea64c1..13cf73c68b322d 100644
--- a/tools/eslint/lib/rules/max-len.js
+++ b/tools/eslint/lib/rules/max-len.js
@@ -11,6 +11,12 @@
//------------------------------------------------------------------------------
module.exports = function(context) {
+ // takes some ideas from http://tools.ietf.org/html/rfc3986#appendix-B, however:
+ // - They're matching an entire string that we know is a URI
+ // - We're matching part of a string where we think there *might* be a URL
+ // - We're only concerned about URLs, as picking out any URI would cause too many false positives
+ // - We don't care about matching the entire URL, any small segment is fine
+ var URL_REGEXP = /[^:/?#]:\/\/[^?#]/;
/**
* Creates a string that is made up of repeating a given string a certain
@@ -32,23 +38,91 @@ module.exports = function(context) {
return result;
}
- var tabWidth = context.options[1] || 4;
-
var maxLength = context.options[0] || 80,
+ tabWidth = context.options[1] || 4,
+ ignoreOptions = context.options[2] || {},
+ ignorePattern = ignoreOptions.ignorePattern || null,
+ ignoreComments = ignoreOptions.ignoreComments || false,
+ ignoreUrls = ignoreOptions.ignoreUrls || false,
tabString = stringRepeat(" ", tabWidth);
+ if (ignorePattern) {
+ ignorePattern = new RegExp(ignorePattern);
+ }
+
//--------------------------------------------------------------------------
// Helpers
//--------------------------------------------------------------------------
+
+ /**
+ * Tells if a given comment is trailing: it starts on the current line and
+ * extends to or past the end of the current line.
+ * @param {string} line The source line we want to check for a trailing comment on
+ * @param {number} lineNumber The one-indexed line number for line
+ * @param {ASTNode} comment The comment to inspect
+ * @returns {boolean} If the comment is trailing on the given line
+ */
+ function isTrailingComment(line, lineNumber, comment) {
+ return comment &&
+ (comment.loc.start.line <= lineNumber && lineNumber <= comment.loc.end.line) &&
+ (comment.loc.end.line > lineNumber || comment.loc.end.column === line.length);
+ }
+
+ /**
+ * Gets the line after the comment and any remaining trailing whitespace is
+ * stripped.
+ * @param {string} line The source line with a trailing comment
+ * @param {number} lineNumber The one-indexed line number this is on
+ * @param {ASTNode} comment The comment to remove
+ * @returns {string} Line without comment and trailing whitepace
+ */
+ function stripTrailingComment(line, lineNumber, comment) {
+ if (comment.loc.start.line < lineNumber) {
+ // this entire line is a comment
+ return "";
+ } else {
+ // loc.column is zero-indexed
+ return line.slice(0, comment.loc.start.column).replace(/\s+$/, "");
+ }
+ }
+
+ /**
+ * Check the program for max length
+ * @param {ASTNode} node Node to examine
+ * @returns {void}
+ * @private
+ */
function checkProgramForMaxLength(node) {
- var lines = context.getSourceLines();
+ // split (honors line-ending)
+ var lines = context.getSourceLines(),
+ // list of comments to ignore
+ comments = ignoreComments ? context.getAllComments() : [],
+ // we iterate over comments in parallel with the lines
+ commentsIndex = 0;
- // Replace the tabs
- // Split (honors line-ending)
- // Iterate
lines.forEach(function(line, i) {
+ // i is zero-indexed, line numbers are one-indexed
+ var lineNumber = i + 1;
+ // we can short-circuit the comment checks if we're already out of comments to check
+ if (commentsIndex < comments.length) {
+ // iterate over comments until we find one past the current line
+ do {
+ var comment = comments[++commentsIndex];
+ } while (comment && comment.loc.start.line <= lineNumber);
+ // and step back by one
+ comment = comments[--commentsIndex];
+ if (isTrailingComment(line, lineNumber, comment)) {
+ line = stripTrailingComment(line, lineNumber, comment);
+ }
+ }
+ if (ignorePattern && ignorePattern.test(line) ||
+ ignoreUrls && URL_REGEXP.test(line)) {
+ // ignore this line
+ return;
+ }
+ // replace the tabs
if (line.replace(/\t/g, tabString).length > maxLength) {
- context.report(node, { line: i + 1, col: 1 }, "Line " + (i + 1) + " exceeds the maximum line length of " + maxLength + ".");
+ context.report(node, { line: lineNumber, column: 0 }, "Line " + (i + 1) + " exceeds the maximum line length of " + maxLength + ".");
}
});
}
@@ -72,5 +146,20 @@ module.exports.schema = [
{
"type": "integer",
"minimum": 0
+ },
+ {
+ "type": "object",
+ "properties": {
+ "ignorePattern": {
+ "type": "string"
+ },
+ "ignoreComments": {
+ "type": "boolean"
+ },
+ "ignoreUrls": {
+ "type": "boolean"
+ }
+ },
+ "additionalProperties": false
}
];
diff --git a/tools/eslint/lib/rules/max-nested-callbacks.js b/tools/eslint/lib/rules/max-nested-callbacks.js
index 2caff10764a455..10753bddf00dec 100644
--- a/tools/eslint/lib/rules/max-nested-callbacks.js
+++ b/tools/eslint/lib/rules/max-nested-callbacks.js
@@ -16,7 +16,7 @@ module.exports = function(context) {
// Constants
//--------------------------------------------------------------------------
- var THRESHOLD = context.options[0];
+ var THRESHOLD = context.options[0] || 10;
//--------------------------------------------------------------------------
// Helpers
diff --git a/tools/eslint/lib/rules/max-statements.js b/tools/eslint/lib/rules/max-statements.js
index 8c7f4fd31b15f2..35a4960e92d4d0 100644
--- a/tools/eslint/lib/rules/max-statements.js
+++ b/tools/eslint/lib/rules/max-statements.js
@@ -19,10 +19,21 @@ module.exports = function(context) {
var functionStack = [],
maxStatements = context.options[0] || 10;
+ /**
+ * When parsing a new function, store it in our function stack
+ * @returns {void}
+ * @private
+ */
function startFunction() {
functionStack.push(0);
}
+ /**
+ * Evaluate the node at the end of function
+ * @param {ASTNode} node node to evaluate
+ * @returns {void}
+ * @private
+ */
function endFunction(node) {
var count = functionStack.pop();
@@ -32,6 +43,12 @@ module.exports = function(context) {
}
}
+ /**
+ * Increment the count of the functions
+ * @param {ASTNode} node node to evaluate
+ * @returns {void}
+ * @private
+ */
function countStatements(node) {
functionStack[functionStack.length - 1] += node.body.length;
}
diff --git a/tools/eslint/lib/rules/new-cap.js b/tools/eslint/lib/rules/new-cap.js
index 3f47d9a5edb82e..9518b1eff0c0aa 100644
--- a/tools/eslint/lib/rules/new-cap.js
+++ b/tools/eslint/lib/rules/new-cap.js
@@ -7,6 +7,16 @@
"use strict";
+//------------------------------------------------------------------------------
+// Requirements
+//------------------------------------------------------------------------------
+
+var assign = require("object-assign");
+
+//------------------------------------------------------------------------------
+// Helpers
+//------------------------------------------------------------------------------
+
var CAPS_ALLOWED = [
"Array",
"Boolean",
@@ -28,6 +38,7 @@ var CAPS_ALLOWED = [
* @returns {string[]} Returns obj[key] if it's an Array, otherwise `fallback`
*/
function checkArray(obj, key, fallback) {
+ /* istanbul ignore if */
if (Object.prototype.hasOwnProperty.call(obj, key) && !Array.isArray(obj[key])) {
throw new TypeError(key + ", if provided, must be an Array");
}
@@ -66,9 +77,10 @@ function calculateCapIsNewExceptions(config) {
module.exports = function(context) {
- var config = context.options[0] || {};
+ var config = context.options[0] ? assign({}, context.options[0]) : {};
config.newIsCap = config.newIsCap !== false;
config.capIsNew = config.capIsNew !== false;
+ var skipProperties = config.properties === false;
var newIsCapExceptions = checkArray(config, "newIsCapExceptions", []).reduce(invert, {});
@@ -134,15 +146,17 @@ module.exports = function(context) {
* @returns {Boolean} Returns true if the callee may be capitalized
*/
function isCapAllowed(allowedMap, node, calleeName) {
- if (allowedMap[calleeName]) {
+ if (allowedMap[calleeName] || allowedMap[context.getSource(node.callee)]) {
return true;
}
+
if (calleeName === "UTC" && node.callee.type === "MemberExpression") {
// allow if callee is Date.UTC
return node.callee.object.type === "Identifier" &&
node.callee.object.name === "Date";
}
- return false;
+
+ return skipProperties && node.callee.type === "MemberExpression";
}
/**
@@ -217,6 +231,9 @@ module.exports.schema = [
"items": {
"type": "string"
}
+ },
+ "properties": {
+ "type": "boolean"
}
},
"additionalProperties": false
diff --git a/tools/eslint/lib/rules/newline-after-var.js b/tools/eslint/lib/rules/newline-after-var.js
index e1ade14bdeda97..9e7d8599319c6f 100644
--- a/tools/eslint/lib/rules/newline-after-var.js
+++ b/tools/eslint/lib/rules/newline-after-var.js
@@ -3,6 +3,7 @@
* @author Gopal Venkatesan
* @copyright 2015 Gopal Venkatesan. All rights reserved.
* @copyright 2015 Casey Visco. All rights reserved.
+ * @copyright 2015 Ian VanSchooten. All rights reserved.
*/
"use strict";
@@ -20,10 +21,11 @@ module.exports = function(context) {
// be treated as "always" and the only special case is "never"
var mode = context.options[0] === "never" ? "never" : "always";
- // Cache line numbers of comments for faster lookup
- var comments = context.getAllComments().map(function (token) {
- return token.loc.start.line;
- });
+ // Cache starting and ending line numbers of comments for faster lookup
+ var commentEndLine = context.getAllComments().reduce(function(result, token) {
+ result[token.loc.start.line] = token.loc.end.line;
+ return result;
+ }, {});
//--------------------------------------------------------------------------
@@ -61,6 +63,42 @@ module.exports = function(context) {
nodeType === "ExportDefaultDeclaration" || nodeType === "ExportAllDeclaration";
}
+ /**
+ * Determine if provided nodeType is a function specifier
+ * @private
+ * @param {string} nodeType - nodeType to test
+ * @returns {boolean} True if `nodeType` is a function specifier
+ */
+ function isFunctionSpecifier(nodeType) {
+ return nodeType === "FunctionDeclaration" || nodeType === "FunctionExpression" ||
+ nodeType === "ArrowFunctionExpression";
+ }
+
+ /**
+ * Determine if provided node is the last of his parent
+ * @private
+ * @param {ASTNode} node - node to test
+ * @returns {boolean} True if `node` is last of his parent
+ */
+ function isLastNode(node) {
+ return node.parent.body[node.parent.body.length - 1] === node;
+ }
+
+ /**
+ * Determine if a token starts more than one line after a comment ends
+ * @param {token} token The token being checked
+ * @param {integer} commentStartLine The line number on which the comment starts
+ * @returns {boolean} True if `token` does not start immediately after a comment
+ */
+ function hasBlankLineAfterComment(token, commentStartLine) {
+ var commentEnd = commentEndLine[commentStartLine];
+ // If there's another comment, repeat check for blank line
+ if (commentEndLine[commentEnd + 1]) {
+ return hasBlankLineAfterComment(token, commentEnd + 1);
+ }
+ return (token.loc.start.line > commentEndLine[commentStartLine] + 1);
+ }
+
/**
* Checks that a blank line exists after a variable declaration when mode is
* set to "always", or checks that there is no blank line when mode is set
@@ -97,15 +135,26 @@ module.exports = function(context) {
return;
}
+ // Ignore if it is last statement in a function
+ if (node.parent.parent && isFunctionSpecifier(node.parent.parent.type) && isLastNode(node)) {
+ return;
+ }
+
// Next statement is not a `var`...
noNextLineToken = nextToken.loc.start.line > nextLineNum;
- hasNextLineComment = comments.indexOf(nextLineNum) >= 0;
+ hasNextLineComment = (typeof commentEndLine[nextLineNum] !== "undefined");
if (mode === "never" && noNextLineToken && !hasNextLineComment) {
context.report(node, NEVER_MESSAGE, { identifier: node.name });
}
- if (mode === "always" && (!noNextLineToken || hasNextLineComment)) {
+ // Token on the next line, or comment without blank line
+ if (
+ mode === "always" && (
+ !noNextLineToken ||
+ hasNextLineComment && !hasBlankLineAfterComment(nextToken, nextLineNum)
+ )
+ ) {
context.report(node, ALWAYS_MESSAGE, { identifier: node.name });
}
}
diff --git a/tools/eslint/lib/rules/no-alert.js b/tools/eslint/lib/rules/no-alert.js
index 7d041eaf748b7c..bfe834b44a9af2 100644
--- a/tools/eslint/lib/rules/no-alert.js
+++ b/tools/eslint/lib/rules/no-alert.js
@@ -52,7 +52,7 @@ function getPropertyName(memberExpressionNode) {
* @returns {Reference|undefined} Returns the found reference or undefined if none were found.
*/
function findReference(scope, node) {
- var references = scope.references.filter(function (reference) {
+ var references = scope.references.filter(function(reference) {
return reference.identifier.range[0] === node.range[0] &&
reference.identifier.range[1] === node.range[1];
});
@@ -69,9 +69,8 @@ function findReference(scope, node) {
* @returns {boolean} Whether or not the name is shadowed globally.
*/
function isGloballyShadowed(globalScope, identifierName) {
- return globalScope.variables.some(function (variable) {
- return variable.name === identifierName && variable.defs.length > 0;
- });
+ var variable = globalScope.set.get(identifierName);
+ return Boolean(variable && variable.defs.length > 0);
}
/**
@@ -120,7 +119,7 @@ module.exports = function(context) {
return {
- "Program": function () {
+ "Program": function() {
globalScope = context.getScope();
},
diff --git a/tools/eslint/lib/rules/no-array-constructor.js b/tools/eslint/lib/rules/no-array-constructor.js
index b7167a49e5914e..ecf5837228b12a 100644
--- a/tools/eslint/lib/rules/no-array-constructor.js
+++ b/tools/eslint/lib/rules/no-array-constructor.js
@@ -11,6 +11,12 @@
module.exports = function(context) {
+ /**
+ * Disallow construction of dense arrays using the Array constructor
+ * @param {ASTNode} node node to evaluate
+ * @returns {void}
+ * @private
+ */
function check(node) {
if (
node.arguments.length !== 1 &&
diff --git a/tools/eslint/lib/rules/no-arrow-condition.js b/tools/eslint/lib/rules/no-arrow-condition.js
new file mode 100644
index 00000000000000..5e478652f63c95
--- /dev/null
+++ b/tools/eslint/lib/rules/no-arrow-condition.js
@@ -0,0 +1,88 @@
+/**
+ * @fileoverview A rule to warn against using arrow functions in conditions.
+ * @author Jxck
+ * @copyright 2015 Luke Karrys. All rights reserved.
+ * The MIT License (MIT)
+
+ * Copyright (c) 2015 Jxck
+
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+
+ * The above copyright notice and this permission notice shall be included in all
+ * copies or substantial portions of the Software.
+
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ */
+
+"use strict";
+
+//------------------------------------------------------------------------------
+// Helpers
+//------------------------------------------------------------------------------
+
+/**
+ * Checks whether or not a node is an arrow function expression.
+ * @param {ASTNode} node - node to test
+ * @returns {boolean} `true` if the node is an arrow function expression.
+ */
+function isArrowFunction(node) {
+ return node.test && node.test.type === "ArrowFunctionExpression";
+}
+
+/**
+ * Checks whether or not a node is a conditional expression.
+ * @param {ASTNode} node - node to test
+ * @returns {boolean} `true` if the node is a conditional expression.
+ */
+function isConditional(node) {
+ return node.body && node.body.type === "ConditionalExpression";
+}
+
+//------------------------------------------------------------------------------
+// Rule Definition
+//------------------------------------------------------------------------------
+
+module.exports = function(context) {
+ /**
+ * Reports if a conditional statement is an arrow function.
+ * @param {ASTNode} node - A node to check and report.
+ * @returns {void}
+ */
+ function checkCondition(node) {
+ if (isArrowFunction(node)) {
+ context.report(node, "Arrow function `=>` used inside {{statementType}} instead of comparison operator.", {statementType: node.type});
+ }
+ }
+
+ /**
+ * Reports if an arrow function contains an ambiguous conditional.
+ * @param {ASTNode} node - A node to check and report.
+ * @returns {void}
+ */
+ function checkArrowFunc(node) {
+ if (isConditional(node)) {
+ context.report(node, "Arrow function used ambiguously with a conditional expression.");
+ }
+ }
+
+ return {
+ "IfStatement": checkCondition,
+ "WhileStatement": checkCondition,
+ "ForStatement": checkCondition,
+ "ConditionalExpression": checkCondition,
+ "ArrowFunctionExpression": checkArrowFunc
+ };
+};
+
+module.exports.schema = [];
diff --git a/tools/eslint/lib/rules/no-case-declarations.js b/tools/eslint/lib/rules/no-case-declarations.js
new file mode 100644
index 00000000000000..443328b89e5b2e
--- /dev/null
+++ b/tools/eslint/lib/rules/no-case-declarations.js
@@ -0,0 +1,47 @@
+/**
+ * @fileoverview Rule to flag use of an lexical declarations inside a case clause
+ * @author Erik Arvidsson
+ * @copyright 2015 Erik Arvidsson. All rights reserved.
+ */
+"use strict";
+
+//------------------------------------------------------------------------------
+// Rule Definition
+//------------------------------------------------------------------------------
+
+module.exports = function(context) {
+
+ /**
+ * Checks whether or not a node is a lexical declaration.
+ * @param {ASTNode} node A direct child statement of a switch case.
+ * @returns {boolean} Whether or not the node is a lexical declaration.
+ */
+ function isLexicalDeclaration(node) {
+ switch (node.type) {
+ case "FunctionDeclaration":
+ case "ClassDeclaration":
+ return true;
+ case "VariableDeclaration":
+ return node.kind !== "var";
+ default:
+ return false;
+ }
+ }
+
+ return {
+ "SwitchCase": function(node) {
+ for (var i = 0; i < node.consequent.length; i++) {
+ var statement = node.consequent[i];
+ if (isLexicalDeclaration(statement)) {
+ context.report({
+ node: node,
+ message: "Unexpected lexical declaration in case block."
+ });
+ }
+ }
+ }
+ };
+
+};
+
+module.exports.schema = [];
diff --git a/tools/eslint/lib/rules/no-catch-shadow.js b/tools/eslint/lib/rules/no-catch-shadow.js
index 5776cd1780cb95..88eeb02fa6182c 100644
--- a/tools/eslint/lib/rules/no-catch-shadow.js
+++ b/tools/eslint/lib/rules/no-catch-shadow.js
@@ -5,6 +5,12 @@
"use strict";
+//------------------------------------------------------------------------------
+// Requirements
+//------------------------------------------------------------------------------
+
+var astUtils = require("../ast-utils");
+
//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------
@@ -15,20 +21,14 @@ module.exports = function(context) {
// Helpers
//--------------------------------------------------------------------------
+ /**
+ * Check if the parameters are been shadowed
+ * @param {object} scope current scope
+ * @param {string} name parameter name
+ * @returns {boolean} True is its been shadowed
+ */
function paramIsShadowing(scope, name) {
- var found = scope.variables.some(function(variable) {
- return variable.name === name;
- });
-
- if (found) {
- return true;
- }
-
- if (scope.upper) {
- return paramIsShadowing(scope.upper, name);
- }
-
- return false;
+ return astUtils.getVariableByName(scope, name) !== null;
}
//--------------------------------------------------------------------------
@@ -40,6 +40,12 @@ module.exports = function(context) {
"CatchClause": function(node) {
var scope = context.getScope();
+ // When blockBindings is enabled, CatchClause creates its own scope
+ // so start from one upper scope to exclude the current node
+ if (scope.block === node) {
+ scope = scope.upper;
+ }
+
if (paramIsShadowing(scope, node.param.name)) {
context.report(node, "Value of '{{name}}' may be overwritten in IE 8 and earlier.",
{ name: node.param.name });
diff --git a/tools/eslint/lib/rules/no-class-assign.js b/tools/eslint/lib/rules/no-class-assign.js
new file mode 100644
index 00000000000000..fe3b56cdf12879
--- /dev/null
+++ b/tools/eslint/lib/rules/no-class-assign.js
@@ -0,0 +1,48 @@
+/**
+ * @fileoverview A rule to disallow modifying variables of class declarations
+ * @author Toru Nagashima
+ * @copyright 2015 Toru Nagashima. All rights reserved.
+ */
+
+"use strict";
+
+var astUtils = require("../ast-utils");
+
+//------------------------------------------------------------------------------
+// Rule Definition
+//------------------------------------------------------------------------------
+
+module.exports = function(context) {
+
+ /**
+ * Finds and reports references that are non initializer and writable.
+ * @param {Variable} variable - A variable to check.
+ * @returns {void}
+ */
+ function checkVariable(variable) {
+ astUtils.getModifyingReferences(variable.references).forEach(function(reference) {
+ context.report(
+ reference.identifier,
+ "`{{name}}` is a class.",
+ {name: reference.identifier.name});
+
+ });
+ }
+
+ /**
+ * Finds and reports references that are non initializer and writable.
+ * @param {ASTNode} node - A ClassDeclaration/ClassExpression node to check.
+ * @returns {void}
+ */
+ function checkForClass(node) {
+ context.getDeclaredVariables(node).forEach(checkVariable);
+ }
+
+ return {
+ "ClassDeclaration": checkForClass,
+ "ClassExpression": checkForClass
+ };
+
+};
+
+module.exports.schema = [];
diff --git a/tools/eslint/lib/rules/no-comma-dangle.js b/tools/eslint/lib/rules/no-comma-dangle.js
deleted file mode 100644
index 899529efe8a07e..00000000000000
--- a/tools/eslint/lib/rules/no-comma-dangle.js
+++ /dev/null
@@ -1,45 +0,0 @@
-/**
- * @fileoverview Rule to flag trailing commas in object literals.
- * @author Ian Christian Myers
- */
-
-"use strict";
-
-//------------------------------------------------------------------------------
-// Rule Definition
-//------------------------------------------------------------------------------
-
-module.exports = function(context) {
-
- //-------------------------------------------------------------------------
- // Helpers
- //-------------------------------------------------------------------------
-
- function checkForTrailingComma(node) {
- var items = node.properties || node.elements,
- length = items.length,
- lastItem, penultimateToken;
-
- if (length) {
- lastItem = items[length - 1];
- if (lastItem) {
- penultimateToken = context.getLastToken(node, 1);
- if (penultimateToken.value === ",") {
- context.report(lastItem, penultimateToken.loc.start, "Trailing comma.");
- }
- }
- }
- }
-
- //--------------------------------------------------------------------------
- // Public API
- //--------------------------------------------------------------------------
-
- return {
- "ObjectExpression": checkForTrailingComma,
- "ArrayExpression": checkForTrailingComma
- };
-
-};
-
-module.exports.schema = [];
diff --git a/tools/eslint/lib/rules/no-cond-assign.js b/tools/eslint/lib/rules/no-cond-assign.js
index 2dc6251e39eac4..c83afca0afe68c 100644
--- a/tools/eslint/lib/rules/no-cond-assign.js
+++ b/tools/eslint/lib/rules/no-cond-assign.js
@@ -38,11 +38,11 @@ module.exports = function(context) {
function findConditionalAncestor(node) {
var currentAncestor = node;
- while ((currentAncestor = currentAncestor.parent)) {
+ do {
if (isConditionalTestExpression(currentAncestor)) {
return currentAncestor.parent;
}
- }
+ } while ((currentAncestor = currentAncestor.parent));
return null;
}
@@ -80,9 +80,19 @@ module.exports = function(context) {
* @returns {void}
*/
function testForAssign(node) {
- if (node.test && (node.test.type === "AssignmentExpression") && !isParenthesisedTwice(node.test)) {
+ if (node.test &&
+ (node.test.type === "AssignmentExpression") &&
+ (node.type === "ForStatement" ?
+ !isParenthesised(node.test) :
+ !isParenthesisedTwice(node.test)
+ )
+ ) {
// must match JSHint's error message
- context.report(node, "Expected a conditional expression and instead saw an assignment.");
+ context.report({
+ node: node,
+ loc: node.test.loc.start,
+ message: "Expected a conditional expression and instead saw an assignment."
+ });
}
}
diff --git a/tools/eslint/lib/rules/no-const-assign.js b/tools/eslint/lib/rules/no-const-assign.js
new file mode 100644
index 00000000000000..47e73b802e66c3
--- /dev/null
+++ b/tools/eslint/lib/rules/no-const-assign.js
@@ -0,0 +1,41 @@
+/**
+ * @fileoverview A rule to disallow modifying variables that are declared using `const`
+ * @author Toru Nagashima
+ * @copyright 2015 Toru Nagashima. All rights reserved.
+ */
+
+"use strict";
+
+var astUtils = require("../ast-utils");
+
+//------------------------------------------------------------------------------
+// Rule Definition
+//------------------------------------------------------------------------------
+
+module.exports = function(context) {
+
+ /**
+ * Finds and reports references that are non initializer and writable.
+ * @param {Variable} variable - A variable to check.
+ * @returns {void}
+ */
+ function checkVariable(variable) {
+ astUtils.getModifyingReferences(variable.references).forEach(function(reference) {
+ context.report(
+ reference.identifier,
+ "`{{name}}` is constant.",
+ {name: reference.identifier.name});
+ });
+ }
+
+ return {
+ "VariableDeclaration": function(node) {
+ if (node.kind === "const") {
+ context.getDeclaredVariables(node).forEach(checkVariable);
+ }
+ }
+ };
+
+};
+
+module.exports.schema = [];
diff --git a/tools/eslint/lib/rules/no-control-regex.js b/tools/eslint/lib/rules/no-control-regex.js
index cd57f73451082c..29c27fa5decc80 100644
--- a/tools/eslint/lib/rules/no-control-regex.js
+++ b/tools/eslint/lib/rules/no-control-regex.js
@@ -11,6 +11,12 @@
module.exports = function(context) {
+ /**
+ * Get the regex expression
+ * @param {ASTNode} node node to evaluate
+ * @returns {*} Regex if found else null
+ * @private
+ */
function getRegExp(node) {
if (node.value instanceof RegExp) {
diff --git a/tools/eslint/lib/rules/no-dupe-args.js b/tools/eslint/lib/rules/no-dupe-args.js
index cb6e558154c56b..80b52ca82ad015 100644
--- a/tools/eslint/lib/rules/no-dupe-args.js
+++ b/tools/eslint/lib/rules/no-dupe-args.js
@@ -2,6 +2,8 @@
* @fileoverview Rule to flag duplicate arguments
* @author Jamund Ferguson
* @copyright 2015 Jamund Ferguson. All rights reserved.
+ * @copyright 2015 Toru Nagashima. All rights reserved.
+ * See LICENSE file in root directory for full license.
*/
"use strict";
@@ -16,6 +18,15 @@ module.exports = function(context) {
// Helpers
//--------------------------------------------------------------------------
+ /**
+ * Checks whether or not a given definition is a parameter's.
+ * @param {escope.DefEntry} def - A definition to check.
+ * @returns {boolean} `true` if the definition is a parameter's.
+ */
+ function isParameter(def) {
+ return def.type === "Parameter";
+ }
+
/**
* Determines if a given node has duplicate parameters.
* @param {ASTNode} node The node to check.
@@ -23,56 +34,29 @@ module.exports = function(context) {
* @private
*/
function checkParams(node) {
- var params = {},
- dups = {};
+ var variables = context.getDeclaredVariables(node);
+ var keyMap = Object.create(null);
+ for (var i = 0; i < variables.length; ++i) {
+ var variable = variables[i];
- /**
- * Marks a given param as either seen or duplicated.
- * @param {string} name The name of the param to mark.
- * @returns {void}
- * @private
- */
- function markParam(name) {
- if (params.hasOwnProperty(name)) {
- dups[name] = 1;
- } else {
- params[name] = 1;
+ // TODO(nagashima): Remove this duplication check after https://github.com/estools/escope/pull/79
+ var key = "$" + variable.name; // to avoid __proto__.
+ if (!isParameter(variable.defs[0]) || keyMap[key]) {
+ continue;
}
- }
-
- // loop through and find each duplicate param
- node.params.forEach(function(param) {
-
- switch (param.type) {
- case "Identifier":
- markParam(param.name);
- break;
-
- case "ObjectPattern":
- param.properties.forEach(function(property) {
- markParam(property.key.name);
- });
- break;
-
- case "ArrayPattern":
- param.elements.forEach(function(element) {
-
- // Arrays can be sparse (unwanted arguments)
- if (element !== null) {
- markParam(element.name);
- }
- });
- break;
-
- // no default
+ keyMap[key] = true;
+
+ // Checks and reports duplications.
+ var defs = variable.defs.filter(isParameter);
+ if (defs.length >= 2) {
+ context.report({
+ node: node,
+ message: "Duplicate param '{{name}}'.",
+ data: {name: variable.name}
+ });
}
- });
-
- // log an error for each duplicate (not 2 for each)
- Object.keys(dups).forEach(function(currentParam) {
- context.report(node, "Duplicate param '{{key}}'.", { key: currentParam });
- });
+ }
}
//--------------------------------------------------------------------------
diff --git a/tools/eslint/lib/rules/no-dupe-class-members.js b/tools/eslint/lib/rules/no-dupe-class-members.js
new file mode 100644
index 00000000000000..c3adb2e2383c87
--- /dev/null
+++ b/tools/eslint/lib/rules/no-dupe-class-members.js
@@ -0,0 +1,82 @@
+/**
+ * @fileoverview A rule to disallow duplicate name in class members.
+ * @author Toru Nagashima
+ * @copyright 2015 Toru Nagashima. All rights reserved.
+ */
+
+"use strict";
+
+//------------------------------------------------------------------------------
+// Rule Definition
+//------------------------------------------------------------------------------
+
+module.exports = function(context) {
+ var stack = [];
+
+ /**
+ * Gets state of a given member name.
+ * @param {string} name - A name of a member.
+ * @param {boolean} isStatic - A flag which specifies that is a static member.
+ * @returns {object} A state of a given member name.
+ * - retv.init {boolean} A flag which shows the name is declared as normal member.
+ * - retv.get {boolean} A flag which shows the name is declared as getter.
+ * - retv.set {boolean} A flag which shows the name is declared as setter.
+ */
+ function getState(name, isStatic) {
+ var stateMap = stack[stack.length - 1];
+ var key = "$" + name; // to avoid "__proto__".
+
+ if (!stateMap[key]) {
+ stateMap[key] = {
+ nonStatic: {init: false, get: false, set: false},
+ static: {init: false, get: false, set: false}
+ };
+ }
+
+ return stateMap[key][isStatic ? "static" : "nonStatic"];
+ }
+
+ return {
+ // Initializes the stack of state of member declarations.
+ "Program": function() {
+ stack = [];
+ },
+
+ // Initializes state of member declarations for the class.
+ "ClassBody": function() {
+ stack.push(Object.create(null));
+ },
+
+ // Disposes the state for the class.
+ "ClassBody:exit": function() {
+ stack.pop();
+ },
+
+ // Reports the node if its name has been declared already.
+ "MethodDefinition": function(node) {
+ if (node.computed) {
+ return;
+ }
+
+ var name = node.key.name;
+ var state = getState(name, node.static);
+ var isDuplicate = false;
+ if (node.kind === "get") {
+ isDuplicate = (state.init || state.get);
+ state.get = true;
+ } else if (node.kind === "set") {
+ isDuplicate = (state.init || state.set);
+ state.set = true;
+ } else {
+ isDuplicate = (state.init || state.get || state.set);
+ state.init = true;
+ }
+
+ if (isDuplicate) {
+ context.report(node, "Duplicate name \"{{name}}\".", {name: name});
+ }
+ }
+ };
+};
+
+module.exports.schema = [];
diff --git a/tools/eslint/lib/rules/no-dupe-keys.js b/tools/eslint/lib/rules/no-dupe-keys.js
index 1f86c10d6ce187..e07f081b4b8570 100644
--- a/tools/eslint/lib/rules/no-dupe-keys.js
+++ b/tools/eslint/lib/rules/no-dupe-keys.js
@@ -22,13 +22,18 @@ module.exports = function(context) {
var nodeProps = Object.create(null);
node.properties.forEach(function(property) {
+
+ if (property.type !== "Property") {
+ return;
+ }
+
var keyName = property.key.name || property.key.value,
key = property.kind + "-" + keyName,
checkProperty = (!property.computed || property.key.type === "Literal");
if (checkProperty) {
if (nodeProps[key]) {
- context.report(node, "Duplicate key '{{key}}'.", { key: keyName });
+ context.report(node, property.loc.start, "Duplicate key '{{key}}'.", { key: keyName });
} else {
nodeProps[key] = true;
}
diff --git a/tools/eslint/lib/rules/no-duplicate-case.js b/tools/eslint/lib/rules/no-duplicate-case.js
index 978e63cade4241..72677f44d91c24 100644
--- a/tools/eslint/lib/rules/no-duplicate-case.js
+++ b/tools/eslint/lib/rules/no-duplicate-case.js
@@ -1,7 +1,9 @@
/**
* @fileoverview Rule to disallow a duplicate case label.
- * @author Dieter Oberkofler
+ * @author Dieter Oberkofler
+ * @author Burak Yigit Kaya
* @copyright 2015 Dieter Oberkofler. All rights reserved.
+ * @copyright 2015 Burak Yigit Kaya. All rights reserved.
*/
"use strict";
@@ -12,56 +14,20 @@
module.exports = function(context) {
- /**
- * Get a hash value for the node
- * @param {ASTNode} node The node.
- * @returns {string} A hash value for the node.
- * @private
- */
- function getHash(node) {
- if (node.type === "Literal") {
- return node.type + typeof node.value + node.value;
- } else if (node.type === "Identifier") {
- return node.type + typeof node.name + node.name;
- } else if (node.type === "MemberExpression") {
- return node.type + getHash(node.object) + getHash(node.property);
- } else if (node.type === "CallExpression") {
- return node.type + getHash(node.callee) + node.arguments.map(getHash).join("");
- } else if (node.type === "BinaryExpression") {
- return node.type + getHash(node.left) + node.operator + getHash(node.right);
- } else if (node.type === "ConditionalExpression") {
- return node.type + getHash(node.test) + getHash(node.consequent) + getHash(node.alternate);
- }
- }
-
- var switchStatement = [];
-
return {
+ "SwitchStatement": function(node) {
+ var mapping = {};
- "SwitchStatement": function(/*node*/) {
- switchStatement.push({});
- },
-
- "SwitchStatement:exit": function(/*node*/) {
- switchStatement.pop();
- },
-
- "SwitchCase": function(node) {
- var currentSwitch = switchStatement[switchStatement.length - 1],
- hashValue;
-
- if (node.test) {
- hashValue = getHash(node.test);
- if (typeof hashValue !== "undefined" && currentSwitch.hasOwnProperty(hashValue)) {
- context.report(node, "Duplicate case label.");
+ node.cases.forEach(function(switchCase) {
+ var key = context.getSource(switchCase.test);
+ if (mapping[key]) {
+ context.report(switchCase, "Duplicate case label.");
} else {
- currentSwitch[hashValue] = true;
+ mapping[key] = switchCase;
}
- }
+ });
}
-
};
-
};
module.exports.schema = [];
diff --git a/tools/eslint/lib/rules/no-else-return.js b/tools/eslint/lib/rules/no-else-return.js
index df674c4753c5b6..29b53842eb2a48 100644
--- a/tools/eslint/lib/rules/no-else-return.js
+++ b/tools/eslint/lib/rules/no-else-return.js
@@ -80,15 +80,30 @@ module.exports = function(context) {
/**
* Check the consequent/body node to make sure it is not
* a ReturnStatement or an IfStatement that returns on both
- * code paths. If it is, display the context report.
+ * code paths.
*
* @param {Node} node The consequent or body node
* @param {Node} alternate The alternate node
- * @returns {void}
+ * @returns {boolean} `true` if it is a Return/If node that always returns.
+ */
+ function checkForReturnOrIf(node) {
+ return checkForReturn(node) || checkForIf(node);
+ }
+
+
+ /**
+ * Check whether a node returns in every codepath.
+ * @param {Node} node The node to be checked
+ * @returns {boolean} `true` if it returns on every codepath.
*/
- function checkForReturnOrIf(node, alternate) {
- if (checkForReturn(node) || checkForIf(node)) {
- displayReport(alternate);
+ function alwaysReturns(node) {
+ // If we have a BlockStatement, check each consequent body node.
+ if (node.type === "BlockStatement") {
+ return node.body.some(checkForReturnOrIf);
+ // If not a block statement, make sure the consequent isn't a ReturnStatement
+ // or an IfStatement with returns on both paths
+ } else {
+ return checkForReturnOrIf(node);
}
}
@@ -98,23 +113,27 @@ module.exports = function(context) {
return {
- "IfStatement": function (node) {
- // Don't bother finding a ReturnStatement, if there's no `else`
- // or if the alternate is also an if (indicating an else if).
- if (hasElse(node)) {
- var consequent = node.consequent,
- alternate = node.alternate;
- // If we have a BlockStatement, check each consequent body node.
- if (consequent.type === "BlockStatement") {
- var body = consequent.body;
- body.forEach(function (bodyNode) {
- checkForReturnOrIf(bodyNode, alternate);
- });
- // If not a block statement, make sure the consequent isn't a ReturnStatement
- // or an IfStatement with returns on both paths
- } else {
- checkForReturnOrIf(consequent, alternate);
+ "IfStatement": function(node) {
+ var parent = context.getAncestors().pop(),
+ consequents,
+ alternate;
+
+ // Only "top-level" if statements are checked, meaning the first `if`
+ // in a `if-else-if-...` chain.
+ if (parent.type === "IfStatement" && parent.alternate === node) {
+ return;
+ }
+
+ for (consequents = []; node.type === "IfStatement"; node = node.alternate) {
+ if (!node.alternate) {
+ return;
}
+ consequents.push(node.consequent);
+ alternate = node.alternate;
+ }
+
+ if (consequents.every(alwaysReturns)) {
+ displayReport(alternate);
}
}
diff --git a/tools/eslint/lib/rules/no-empty-character-class.js b/tools/eslint/lib/rules/no-empty-character-class.js
index ccb01bd40c801e..b201da44f45627 100644
--- a/tools/eslint/lib/rules/no-empty-character-class.js
+++ b/tools/eslint/lib/rules/no-empty-character-class.js
@@ -41,3 +41,5 @@ module.exports = function(context) {
};
};
+
+module.exports.schema = [];
diff --git a/tools/eslint/lib/rules/no-empty-class.js b/tools/eslint/lib/rules/no-empty-class.js
deleted file mode 100644
index 94564f44988830..00000000000000
--- a/tools/eslint/lib/rules/no-empty-class.js
+++ /dev/null
@@ -1,45 +0,0 @@
-/**
- * @fileoverview Rule to flag the use of empty character classes in regular expressions
- * @author Ian Christian Myers
- */
-
-"use strict";
-
-//------------------------------------------------------------------------------
-// Helpers
-//------------------------------------------------------------------------------
-
-/*
-plain-English description of the following regexp:
-0. `^` fix the match at the beginning of the string
-1. `\/`: the `/` that begins the regexp
-2. `([^\\[]|\\.|\[([^\\\]]|\\.)+\])*`: regexp contents; 0 or more of the following
- 2.0. `[^\\[]`: any character that's not a `\` or a `[` (anything but escape sequences and character classes)
- 2.1. `\\.`: an escape sequence
- 2.2. `\[([^\\\]]|\\.)+\]`: a character class that isn't empty
-3. `\/` the `/` that ends the regexp
-4. `[gimy]*`: optional regexp flags
-5. `$`: fix the match at the end of the string
-*/
-var regex = /^\/([^\\[]|\\.|\[([^\\\]]|\\.)+\])*\/[gimy]*$/;
-
-//------------------------------------------------------------------------------
-// Rule Definition
-//------------------------------------------------------------------------------
-
-module.exports = function(context) {
-
- return {
-
- "Literal": function(node) {
- var token = context.getFirstToken(node);
- if (token.type === "RegularExpression" && !regex.test(token.value)) {
- context.report(node, "Empty class.");
- }
- }
-
- };
-
-};
-
-module.exports.schema = [];
diff --git a/tools/eslint/lib/rules/no-empty-label.js b/tools/eslint/lib/rules/no-empty-label.js
index f15694f6d0dc8c..126560046d1e38 100644
--- a/tools/eslint/lib/rules/no-empty-label.js
+++ b/tools/eslint/lib/rules/no-empty-label.js
@@ -17,7 +17,7 @@ module.exports = function(context) {
var type = node.body.type;
if (type !== "ForStatement" && type !== "WhileStatement" && type !== "DoWhileStatement" && type !== "SwitchStatement" && type !== "ForInStatement" && type !== "ForOfStatement") {
- context.report(node, "Unexpected label {{l}}", {l: node.label.name});
+ context.report(node, "Unexpected label \"{{l}}\"", {l: node.label.name});
}
}
};
diff --git a/tools/eslint/lib/rules/no-empty-pattern.js b/tools/eslint/lib/rules/no-empty-pattern.js
new file mode 100644
index 00000000000000..aa8515ad191317
--- /dev/null
+++ b/tools/eslint/lib/rules/no-empty-pattern.js
@@ -0,0 +1,28 @@
+/**
+ * @fileoverview Rule to disallow an empty pattern
+ * @author Alberto Rodríguez
+ * @copyright 2015 Alberto Rodríguez. All rights reserved.
+ * See LICENSE file in root directory for full license.
+ */
+"use strict";
+
+//------------------------------------------------------------------------------
+// Rule Definition
+//------------------------------------------------------------------------------
+
+module.exports = function(context) {
+ return {
+ "ObjectPattern": function(node) {
+ if (node.properties.length === 0) {
+ context.report(node, "Unexpected empty object pattern.");
+ }
+ },
+ "ArrayPattern": function(node) {
+ if (node.elements.length === 0) {
+ context.report(node, "Unexpected empty array pattern.");
+ }
+ }
+ };
+};
+
+module.exports.schema = [];
diff --git a/tools/eslint/lib/rules/no-ex-assign.js b/tools/eslint/lib/rules/no-ex-assign.js
index e9fd94bb775bf4..e658e475b46b27 100644
--- a/tools/eslint/lib/rules/no-ex-assign.js
+++ b/tools/eslint/lib/rules/no-ex-assign.js
@@ -5,36 +5,31 @@
"use strict";
+var astUtils = require("../ast-utils");
+
//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------
module.exports = function(context) {
- var catchStack = [];
+ /**
+ * Finds and reports references that are non initializer and writable.
+ * @param {Variable} variable - A variable to check.
+ * @returns {void}
+ */
+ function checkVariable(variable) {
+ astUtils.getModifyingReferences(variable.references).forEach(function(reference) {
+ context.report(
+ reference.identifier,
+ "Do not assign to the exception parameter.");
+ });
+ }
return {
-
"CatchClause": function(node) {
- catchStack.push(node.param.name);
- },
-
- "CatchClause:exit": function() {
- catchStack.pop();
- },
-
- "AssignmentExpression": function(node) {
-
- if (catchStack.length > 0) {
-
- var exceptionName = catchStack[catchStack.length - 1];
-
- if (node.left.name && node.left.name === exceptionName) {
- context.report(node, "Do not assign to the exception parameter.");
- }
- }
+ context.getDeclaredVariables(node).forEach(checkVariable);
}
-
};
};
diff --git a/tools/eslint/lib/rules/no-extend-native.js b/tools/eslint/lib/rules/no-extend-native.js
index 28404194b4dd45..49e139a29b524c 100644
--- a/tools/eslint/lib/rules/no-extend-native.js
+++ b/tools/eslint/lib/rules/no-extend-native.js
@@ -9,11 +9,7 @@
// Requirements
//------------------------------------------------------------------------------
-var BUILTINS = [
- "Object", "Function", "Array", "String", "Boolean", "Number", "Date",
- "RegExp", "Error", "EvalError", "RangeError", "ReferenceError",
- "SyntaxError", "TypeError", "URIError"
-];
+var globals = require("globals");
//------------------------------------------------------------------------------
// Rule Definition
@@ -23,10 +19,12 @@ module.exports = function(context) {
var config = context.options[0] || {};
var exceptions = config.exceptions || [];
- var modifiedBuiltins = BUILTINS;
+ var modifiedBuiltins = Object.keys(globals.builtin).filter(function(builtin) {
+ return builtin[0].toUpperCase() === builtin[0];
+ });
if (exceptions.length) {
- modifiedBuiltins = BUILTINS.filter(function(builtIn) {
+ modifiedBuiltins = modifiedBuiltins.filter(function(builtIn) {
return exceptions.indexOf(builtIn) === -1;
});
}
@@ -56,22 +54,21 @@ module.exports = function(context) {
});
},
- // handle the Object.defineProperty(Array.prototype) case
+ // handle the Object.definePropert[y|ies](Array.prototype) case
"CallExpression": function(node) {
var callee = node.callee,
subject,
object;
- // only worry about Object.defineProperty
+ // only worry about Object.definePropert[y|ies]
if (callee.type === "MemberExpression" &&
callee.object.name === "Object" &&
- callee.property.name === "defineProperty") {
+ (callee.property.name === "defineProperty" || callee.property.name === "defineProperties")) {
// verify the object being added to is a native prototype
subject = node.arguments[0];
- object = subject.object;
-
+ object = subject && subject.object;
if (object &&
object.type === "Identifier" &&
(modifiedBuiltins.indexOf(object.name) > -1) &&
diff --git a/tools/eslint/lib/rules/no-extra-bind.js b/tools/eslint/lib/rules/no-extra-bind.js
index 58ba05b74187df..6e16a53ac09914 100644
--- a/tools/eslint/lib/rules/no-extra-bind.js
+++ b/tools/eslint/lib/rules/no-extra-bind.js
@@ -2,6 +2,7 @@
* @fileoverview Rule to flag unnecessary bind calls
* @author Bence Dányi
* @copyright 2014 Bence Dányi. All rights reserved.
+ * See LICENSE in root directory for full license.
*/
"use strict";
@@ -56,8 +57,10 @@ module.exports = function(context) {
}
},
"CallExpression:exit": function(node) {
- var top = getTopScope();
- if (top.call === node && top.found === 0) {
+ var top = getTopScope(),
+ isArrowFunction = node.callee.type === "MemberExpression" && node.callee.object.type === "ArrowFunctionExpression";
+
+ if (top.call === node && (top.found === 0 || isArrowFunction)) {
context.report(node, "The function binding is unnecessary.");
scope.pop();
}
diff --git a/tools/eslint/lib/rules/no-extra-boolean-cast.js b/tools/eslint/lib/rules/no-extra-boolean-cast.js
index d27f3609a9a2a7..68c39fbb44f37f 100644
--- a/tools/eslint/lib/rules/no-extra-boolean-cast.js
+++ b/tools/eslint/lib/rules/no-extra-boolean-cast.js
@@ -12,7 +12,7 @@
module.exports = function(context) {
return {
- "UnaryExpression": function (node) {
+ "UnaryExpression": function(node) {
var ancestors = context.getAncestors(),
parent = ancestors.pop(),
grandparent = ancestors.pop();
diff --git a/tools/eslint/lib/rules/no-extra-parens.js b/tools/eslint/lib/rules/no-extra-parens.js
index 12b4c5d8761a51..29a716dd445b7d 100644
--- a/tools/eslint/lib/rules/no-extra-parens.js
+++ b/tools/eslint/lib/rules/no-extra-parens.js
@@ -2,6 +2,7 @@
* @fileoverview Disallow parenthesising higher precedence subexpressions.
* @author Michael Ficarra
* @copyright 2014 Michael Ficarra. All rights reserved.
+ * See LICENSE file in root directory for full license.
*/
"use strict";
@@ -74,6 +75,74 @@ module.exports = function(context) {
return ruleApplies(node) && isParenthesisedTwice(node);
}
+ /**
+ * Checks whether or not a given node is located at the head of ExpressionStatement.
+ * @param {ASTNode} node - A node to check.
+ * @returns {boolean} `true` if the node is located at the head of ExpressionStatement.
+ */
+ function isHeadOfExpressionStatement(node) {
+ var parent = node.parent;
+ while (parent) {
+ switch (parent.type) {
+ case "SequenceExpression":
+ if (parent.expressions[0] !== node || isParenthesised(node)) {
+ return false;
+ }
+ break;
+
+ case "UnaryExpression":
+ case "UpdateExpression":
+ if (parent.prefix || isParenthesised(node)) {
+ return false;
+ }
+ break;
+
+ case "BinaryExpression":
+ case "LogicalExpression":
+ if (parent.left !== node || isParenthesised(node)) {
+ return false;
+ }
+ break;
+
+ case "ConditionalExpression":
+ if (parent.test !== node || isParenthesised(node)) {
+ return false;
+ }
+ break;
+
+ case "CallExpression":
+ if (parent.callee !== node || isParenthesised(node)) {
+ return false;
+ }
+ break;
+
+ case "MemberExpression":
+ if (parent.object !== node || isParenthesised(node)) {
+ return false;
+ }
+ break;
+
+ case "ExpressionStatement":
+ return true;
+
+ default:
+ return false;
+ }
+
+ node = parent;
+ parent = parent.parent;
+ }
+
+ /* istanbul ignore next */
+ throw new Error("unreachable");
+ }
+
+ /**
+ * Get the precedence level based on the node type
+ * @param {ASTNode} node node to evaluate
+ * @returns {int} precedence level
+ * @private
+ */
function precedence(node) {
switch (node.type) {
@@ -149,17 +218,35 @@ module.exports = function(context) {
return 18;
}
+ /**
+ * Report the node
+ * @param {ASTNode} node node to evaluate
+ * @returns {void}
+ * @private
+ */
function report(node) {
var previousToken = context.getTokenBefore(node);
context.report(node, previousToken.loc.start, "Gratuitous parentheses around expression.");
}
+ /**
+ * Evaluate Unary update
+ * @param {ASTNode} node node to evaluate
+ * @returns {void}
+ * @private
+ */
function dryUnaryUpdate(node) {
if (hasExcessParens(node.argument) && precedence(node.argument) >= precedence(node)) {
report(node.argument);
}
}
+ /**
+ * Evaluate a new call
+ * @param {ASTNode} node node to evaluate
+ * @returns {void}
+ * @private
+ */
function dryCallNew(node) {
if (hasExcessParens(node.callee) && precedence(node.callee) >= precedence(node) && !(
node.type === "CallExpression" &&
@@ -182,6 +269,12 @@ module.exports = function(context) {
}
}
+ /**
+ * Evaluate binary logicals
+ * @param {ASTNode} node node to evaluate
+ * @returns {void}
+ * @private
+ */
function dryBinaryLogical(node) {
var prec = precedence(node);
if (hasExcessParens(node.left) && precedence(node.left) >= prec) {
@@ -239,11 +332,26 @@ module.exports = function(context) {
},
"ExpressionStatement": function(node) {
var firstToken;
- if (hasExcessParens(node.expression) && node.expression.type !== "CallExpression") {
+ if (hasExcessParens(node.expression)) {
firstToken = context.getFirstToken(node.expression);
+
// Pure object literals ({}) do not need parentheses but
// member expressions do ({}.toString())
- if (firstToken.value !== "{" || node.expression.type === "ObjectExpression") {
+ if ((
+ firstToken.value !== "{" ||
+ node.expression.type === "ObjectExpression"
+ ) &&
+ // For such as `(function(){}.foo.bar)`
+ (
+ firstToken.value !== "function" ||
+ node.expression.type === "FunctionExpression"
+ ) &&
+ // For such as `(class{}.foo.bar)`
+ (
+ firstToken.value !== "class" ||
+ node.expression.type === "ClassExpression"
+ )
+ ) {
report(node.expression);
}
}
@@ -291,6 +399,11 @@ module.exports = function(context) {
// RegExp literal is allowed to have parens (#1589)
(node.object.type === "Literal" && node.object.regex)
)
+ ) &&
+ !(
+ (node.object.type === "FunctionExpression" || node.object.type === "ClassExpression") &&
+ isHeadOfExpressionStatement(node) &&
+ !hasDoubleExcessParens(node.object)
)
) {
report(node.object);
diff --git a/tools/eslint/lib/rules/no-extra-semi.js b/tools/eslint/lib/rules/no-extra-semi.js
index a3897ef2275073..04c1eca9b06b8d 100644
--- a/tools/eslint/lib/rules/no-extra-semi.js
+++ b/tools/eslint/lib/rules/no-extra-semi.js
@@ -17,7 +17,13 @@ module.exports = function(context) {
* @returns {void}
*/
function report(nodeOrToken) {
- context.report(nodeOrToken, "Unnecessary semicolon.");
+ context.report({
+ node: nodeOrToken,
+ message: "Unnecessary semicolon.",
+ fix: function(fixer) {
+ return fixer.remove(nodeOrToken);
+ }
+ });
}
/**
@@ -40,11 +46,18 @@ module.exports = function(context) {
return {
/**
- * Reports this empty statement.
+ * Reports this empty statement, except if the parent node is a loop.
* @param {Node} node - A EmptyStatement node to be reported.
* @returns {void}
*/
- "EmptyStatement": report,
+ "EmptyStatement": function(node) {
+ var parent = node.parent,
+ allowedParentTypes = ["ForStatement", "ForInStatement", "ForOfStatement", "WhileStatement", "DoWhileStatement"];
+
+ if (allowedParentTypes.indexOf(parent.type) === -1) {
+ report(node);
+ }
+ },
/**
* Checks tokens from the head of this class body to the first MethodDefinition or the end of this class body.
diff --git a/tools/eslint/lib/rules/no-extra-strict.js b/tools/eslint/lib/rules/no-extra-strict.js
deleted file mode 100644
index a6b3bc1855ee5b..00000000000000
--- a/tools/eslint/lib/rules/no-extra-strict.js
+++ /dev/null
@@ -1,86 +0,0 @@
-/**
- * @fileoverview Rule to flag unnecessary strict directives.
- * @author Ian Christian Myers
- * @copyright 2014 Ian Christian Myers. All rights reserved.
- */
-"use strict";
-
-//------------------------------------------------------------------------------
-// Rule Definition
-//------------------------------------------------------------------------------
-
-module.exports = function(context) {
-
- function directives(block) {
- var ds = [], body = block.body, e, i, l;
-
- if (body) {
- for (i = 0, l = body.length; i < l; ++i) {
- e = body[i];
-
- if (
- e.type === "ExpressionStatement" &&
- e.expression.type === "Literal" &&
- typeof e.expression.value === "string"
- ) {
- ds.push(e.expression);
- } else {
- break;
- }
- }
- }
-
- return ds;
- }
-
- function isStrict(directive) {
- return directive.value === "use strict";
- }
-
- function checkForUnnecessaryUseStrict(node) {
- var useStrictDirectives = directives(node).filter(isStrict),
- scope,
- upper;
-
- switch (useStrictDirectives.length) {
- case 0:
- break;
-
- case 1:
- scope = context.getScope();
- upper = scope.upper;
-
- if (upper && upper.functionExpressionScope) {
- upper = upper.upper;
- }
-
- if (upper && upper.isStrict) {
- context.report(useStrictDirectives[0], "Unnecessary 'use strict'.");
- }
- break;
-
- default:
- context.report(useStrictDirectives[1], "Multiple 'use strict' directives.");
- }
- }
-
- return {
-
- "Program": checkForUnnecessaryUseStrict,
-
- "ArrowFunctionExpression": function(node) {
- checkForUnnecessaryUseStrict(node.body);
- },
-
- "FunctionExpression": function(node) {
- checkForUnnecessaryUseStrict(node.body);
- },
-
- "FunctionDeclaration": function(node) {
- checkForUnnecessaryUseStrict(node.body);
- }
- };
-
-};
-
-module.exports.schema = [];
diff --git a/tools/eslint/lib/rules/no-fallthrough.js b/tools/eslint/lib/rules/no-fallthrough.js
index e5974420385871..98334e3fc55e4e 100644
--- a/tools/eslint/lib/rules/no-fallthrough.js
+++ b/tools/eslint/lib/rules/no-fallthrough.js
@@ -5,7 +5,7 @@
"use strict";
-var FALLTHROUGH_COMMENT = /falls\sthrough/;
+var FALLTHROUGH_COMMENT = /falls?\s?through/i;
//------------------------------------------------------------------------------
// Rule Definition
@@ -48,8 +48,7 @@ module.exports = function(context) {
// check for comment
if (!comment || !FALLTHROUGH_COMMENT.test(comment.value)) {
-
- context.report(switchData.lastCase,
+ context.report(node,
"Expected a \"break\" statement before \"{{code}}\".",
{ code: node.test ? "case" : "default" });
}
diff --git a/tools/eslint/lib/rules/no-func-assign.js b/tools/eslint/lib/rules/no-func-assign.js
index a711f572a1f1f8..642d28792731c7 100644
--- a/tools/eslint/lib/rules/no-func-assign.js
+++ b/tools/eslint/lib/rules/no-func-assign.js
@@ -6,76 +6,80 @@
"use strict";
+var astUtils = require("../ast-utils");
+
//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------
module.exports = function(context) {
- //--------------------------------------------------------------------------
- // Helpers
- //--------------------------------------------------------------------------
+ var unresolved = Object.create(null);
- /*
- * Walk the scope chain looking for either a FunctionDeclaration or a
- * VariableDeclaration with the same name as left-hand side of the
- * AssignmentExpression. If we find the FunctionDeclaration first, then we
- * warn, because a FunctionDeclaration is trying to become a Variable or a
- * FunctionExpression. If we find a VariableDeclaration first, then we have
- * a legitimate shadow variable.
+ /**
+ * Collects unresolved references from the global scope, then creates a map to references from its name.
+ * Usage of the map is explained at `checkVariable(variable)`.
+ * @returns {void}
*/
- function checkIfIdentifierIsFunction(scope, name) {
- var variable,
- def,
- i,
- j;
-
- // Loop over all of the identifiers available in scope.
- for (i = 0; i < scope.variables.length; i++) {
- variable = scope.variables[i];
-
- // For each identifier, see if it was defined in _this_ scope.
- for (j = 0; j < variable.defs.length; j++) {
- def = variable.defs[j];
+ function collectUnresolvedReferences() {
+ unresolved = Object.create(null);
- // Identifier is a function and was declared in this scope
- if (def.type === "FunctionName" && def.name.name === name) {
- return true;
- }
+ var references = context.getScope().through;
+ for (var i = 0; i < references.length; ++i) {
+ var reference = references[i];
+ var name = reference.identifier.name;
- // Identifier is a variable and was declared in this scope. This
- // is a legitimate shadow variable.
- if (def.name && def.name.name === name) {
- return false;
- }
+ if (name in unresolved === false) {
+ unresolved[name] = [];
}
+ unresolved[name].push(reference);
}
-
- // Check the upper scope.
- if (scope.upper) {
- return checkIfIdentifierIsFunction(scope.upper, name);
- }
-
- // We've reached the global scope and haven't found anything.
- return false;
}
- //--------------------------------------------------------------------------
- // Public API
- //--------------------------------------------------------------------------
-
- return {
-
- "AssignmentExpression": function(node) {
- var scope = context.getScope(),
- name = node.left.name;
+ /**
+ * Reports a reference if is non initializer and writable.
+ * @param {References} references - Collection of reference to check.
+ * @returns {void}
+ */
+ function checkReference(references) {
+ astUtils.getModifyingReferences(references).forEach(function(reference) {
+ context.report(
+ reference.identifier,
+ "'{{name}}' is a function.",
+ {name: reference.identifier.name});
+ });
+ }
- if (checkIfIdentifierIsFunction(scope, name)) {
- context.report(node, "'{{name}}' is a function.", { name: name });
+ /**
+ * Finds and reports references that are non initializer and writable.
+ * @param {Variable} variable - A variable to check.
+ * @returns {void}
+ */
+ function checkVariable(variable) {
+ if (variable.defs[0].type === "FunctionName") {
+ // If the function is in global scope, its references are not resolved (by escope's design).
+ // So when references of the function are nothing, this checks in unresolved.
+ if (variable.references.length > 0) {
+ checkReference(variable.references);
+ } else if (unresolved[variable.name]) {
+ checkReference(unresolved[variable.name]);
}
-
}
+ }
+ /**
+ * Checks parameters of a given function node.
+ * @param {ASTNode} node - A function node to check.
+ * @returns {void}
+ */
+ function checkForFunction(node) {
+ context.getDeclaredVariables(node).forEach(checkVariable);
+ }
+
+ return {
+ "Program": collectUnresolvedReferences,
+ "FunctionDeclaration": checkForFunction,
+ "FunctionExpression": checkForFunction
};
};
diff --git a/tools/eslint/lib/rules/no-implicit-coercion.js b/tools/eslint/lib/rules/no-implicit-coercion.js
new file mode 100644
index 00000000000000..595412b184c62f
--- /dev/null
+++ b/tools/eslint/lib/rules/no-implicit-coercion.js
@@ -0,0 +1,220 @@
+/**
+ * @fileoverview A rule to disallow the type conversions with shorter notations.
+ * @author Toru Nagashima
+ * @copyright 2015 Toru Nagashima. All rights reserved.
+ */
+
+"use strict";
+
+//------------------------------------------------------------------------------
+// Helpers
+//------------------------------------------------------------------------------
+
+var INDEX_OF_PATTERN = /^(?:i|lastI)ndexOf$/;
+
+/**
+ * Parses and normalizes an option object.
+ * @param {object} options - An option object to parse.
+ * @returns {object} The parsed and normalized option object.
+ */
+function parseOptions(options) {
+ options = options || {};
+ return {
+ boolean: "boolean" in options ? Boolean(options.boolean) : true,
+ number: "number" in options ? Boolean(options.number) : true,
+ string: "string" in options ? Boolean(options.string) : true
+ };
+}
+
+/**
+ * Checks whether or not a node is a double logical nigating.
+ * @param {ASTNode} node - An UnaryExpression node to check.
+ * @returns {boolean} Whether or not the node is a double logical nigating.
+ */
+function isDoubleLogicalNegating(node) {
+ return (
+ node.operator === "!" &&
+ node.argument.type === "UnaryExpression" &&
+ node.argument.operator === "!"
+ );
+}
+
+/**
+ * Checks whether or not a node is a binary negating of `.indexOf()` method calling.
+ * @param {ASTNode} node - An UnaryExpression node to check.
+ * @returns {boolean} Whether or not the node is a binary negating of `.indexOf()` method calling.
+ */
+function isBinaryNegatingOfIndexOf(node) {
+ return (
+ node.operator === "~" &&
+ node.argument.type === "CallExpression" &&
+ node.argument.callee.type === "MemberExpression" &&
+ node.argument.callee.property.type === "Identifier" &&
+ INDEX_OF_PATTERN.test(node.argument.callee.property.name)
+ );
+}
+
+/**
+ * Checks whether or not a node is a multiplying by one.
+ * @param {BinaryExpression} node - A BinaryExpression node to check.
+ * @returns {boolean} Whether or not the node is a multiplying by one.
+ */
+function isMultiplyByOne(node) {
+ return node.operator === "*" && (
+ node.left.type === "Literal" && node.left.value === 1 ||
+ node.right.type === "Literal" && node.right.value === 1
+ );
+}
+
+/**
+ * Checks whether the result of a node is numeric or not
+ * @param {ASTNode} node The node to test
+ * @returns {boolean} true if the node is a number literal or a `Number()`, `parseInt` or `parseFloat` call
+ */
+function isNumeric(node) {
+ return (
+ node.type === "Literal" && typeof node.value === "number" ||
+ node.type === "CallExpression" && (
+ node.callee.name === "Number" ||
+ node.callee.name === "parseInt" ||
+ node.callee.name === "parseFloat"
+ )
+ );
+}
+
+/**
+ * Returns the first non-numeric operand in a BinaryExpression. Designed to be
+ * used from bottom to up since it walks up the BinaryExpression trees using
+ * node.parent to find the result.
+ * @param {BinaryExpression} node The BinaryExpression node to be walked up on
+ * @returns {ASTNode|undefined} The first non-numeric item in the BinaryExpression tree or undefined
+ */
+function getNonNumericOperand(node) {
+ var left = node.left, right = node.right;
+
+ if (right.type !== "BinaryExpression" && !isNumeric(right)) {
+ return right;
+ }
+
+ if (left.type !== "BinaryExpression" && !isNumeric(left)) {
+ return left;
+ }
+}
+
+/**
+ * Checks whether or not a node is a concatenating with an empty string.
+ * @param {ASTNode} node - A BinaryExpression node to check.
+ * @returns {boolean} Whether or not the node is a concatenating with an empty string.
+ */
+function isConcatWithEmptyString(node) {
+ return node.operator === "+" && (
+ (node.left.type === "Literal" && node.left.value === "") ||
+ (node.right.type === "Literal" && node.right.value === "")
+ );
+}
+
+/**
+ * Checks whether or not a node is appended with an empty string.
+ * @param {ASTNode} node - An AssignmentExpression node to check.
+ * @returns {boolean} Whether or not the node is appended with an empty string.
+ */
+function isAppendEmptyString(node) {
+ return node.operator === "+=" && node.right.type === "Literal" && node.right.value === "";
+}
+
+/**
+ * Gets a node that is the left or right operand of a node, is not the specified literal.
+ * @param {ASTNode} node - A BinaryExpression node to get.
+ * @param {any} value - A literal value to check.
+ * @returns {ASTNode} A node that is the left or right operand of the node, is not the specified literal.
+ */
+function getOtherOperand(node, value) {
+ if (node.left.type === "Literal" && node.left.value === value) {
+ return node.right;
+ }
+ return node.left;
+}
+
+//------------------------------------------------------------------------------
+// Rule Definition
+//------------------------------------------------------------------------------
+
+module.exports = function(context) {
+ var options = parseOptions(context.options[0]);
+
+ return {
+ "UnaryExpression": function(node) {
+ // !!foo
+ if (options.boolean && isDoubleLogicalNegating(node)) {
+ context.report(
+ node,
+ "use `Boolean({{code}})` instead.",
+ {code: context.getSource(node.argument.argument)});
+ }
+
+ // ~foo.indexOf(bar)
+ if (options.boolean && isBinaryNegatingOfIndexOf(node)) {
+ context.report(
+ node,
+ "use `{{code}} !== -1` instead.",
+ {code: context.getSource(node.argument)});
+ }
+
+ // +foo
+ if (options.number && node.operator === "+" && !isNumeric(node.argument)) {
+ context.report(
+ node,
+ "use `Number({{code}})` instead.",
+ {code: context.getSource(node.argument)});
+ }
+ },
+
+ // Use `:exit` to prevent double reporting
+ "BinaryExpression:exit": function(node) {
+ // 1 * foo
+ var nonNumericOperand = options.number && isMultiplyByOne(node) && getNonNumericOperand(node);
+ if (nonNumericOperand) {
+ context.report(
+ node,
+ "use `Number({{code}})` instead.",
+ {code: context.getSource(nonNumericOperand)});
+ }
+
+ // "" + foo
+ if (options.string && isConcatWithEmptyString(node)) {
+ context.report(
+ node,
+ "use `String({{code}})` instead.",
+ {code: context.getSource(getOtherOperand(node, ""))});
+ }
+ },
+
+ "AssignmentExpression": function(node) {
+ // foo += ""
+ if (options.string && isAppendEmptyString(node)) {
+ context.report(
+ node,
+ "use `{{code}} = String({{code}})` instead.",
+ {code: context.getSource(getOtherOperand(node, ""))});
+ }
+ }
+ };
+};
+
+module.exports.schema = [
+ {
+ "type": "object",
+ "properties": {
+ "boolean": {
+ "type": "boolean"
+ },
+ "number": {
+ "type": "boolean"
+ },
+ "string": {
+ "type": "boolean"
+ }
+ },
+ "additionalProperties": false
+ }
+];
diff --git a/tools/eslint/lib/rules/no-implied-eval.js b/tools/eslint/lib/rules/no-implied-eval.js
index 7fdc2f114ded38..971b7b4c765fc2 100644
--- a/tools/eslint/lib/rules/no-implied-eval.js
+++ b/tools/eslint/lib/rules/no-implied-eval.js
@@ -12,51 +12,86 @@
//------------------------------------------------------------------------------
module.exports = function(context) {
- var IMPLIED_EVAL = /set(?:Timeout|Interval)/;
+ var CALLEE_RE = /set(?:Timeout|Interval)|execScript/;
+
+ // Figures out if we should inspect a given binary expression. Is a stack of
+ // stacks, where the first element in each substack is a CallExpression.
+ var impliedEvalAncestorsStack = [];
//--------------------------------------------------------------------------
// Helpers
//--------------------------------------------------------------------------
/**
- * Checks if the first argument of a given CallExpression node is a string literal.
- * @param {ASTNode} node The CallExpression node the check.
- * @returns {boolean} True if the first argument is a string literal, false if not.
+ * Get the last element of an array, without modifying arr, like pop(), but non-destructive.
+ * @param {array} arr What to inspect
+ * @returns {*} The last element of arr
+ * @private
*/
- function hasStringLiteralArgument(node) {
- var firstArgument = node.arguments[0];
-
- return firstArgument && firstArgument.type === "Literal" && typeof firstArgument.value === "string";
+ function last(arr) {
+ return arr ? arr[arr.length - 1] : null;
}
/**
- * Checks if the given MemberExpression node is window.setTimeout or window.setInterval.
+ * Checks if the given MemberExpression node is a potentially implied eval identifier on window.
* @param {ASTNode} node The MemberExpression node to check.
- * @returns {boolean} Whether or not the given node is window.set*.
+ * @returns {boolean} Whether or not the given node is potentially an implied eval.
+ * @private
*/
- function isSetMemberExpression(node) {
+ function isImpliedEvalMemberExpression(node) {
var object = node.object,
property = node.property,
- hasSetPropertyName = IMPLIED_EVAL.test(property.name) || IMPLIED_EVAL.test(property.value);
-
- return object.name === "window" && hasSetPropertyName;
+ hasImpliedEvalName = CALLEE_RE.test(property.name) || CALLEE_RE.test(property.value);
+ return object.name === "window" && hasImpliedEvalName;
}
/**
- * Determines if a node represents a call to setTimeout/setInterval with
- * a string argument.
- * @param {ASTNode} node The node to check.
+ * Determines if a node represents a call to a potentially implied eval.
+ *
+ * This checks the callee name and that there's an argument, but not the type of the argument.
+ *
+ * @param {ASTNode} node The CallExpression to check.
* @returns {boolean} True if the node matches, false if not.
* @private
*/
- function isImpliedEval(node) {
+ function isImpliedEvalCallExpression(node) {
var isMemberExpression = (node.callee.type === "MemberExpression"),
isIdentifier = (node.callee.type === "Identifier"),
- isSetMethod = (isIdentifier && IMPLIED_EVAL.test(node.callee.name)) ||
- (isMemberExpression && isSetMemberExpression(node.callee));
+ isImpliedEvalCallee =
+ (isIdentifier && CALLEE_RE.test(node.callee.name)) ||
+ (isMemberExpression && isImpliedEvalMemberExpression(node.callee));
+
+ return isImpliedEvalCallee && node.arguments.length;
+ }
- return isSetMethod && hasStringLiteralArgument(node);
+ /**
+ * Checks that the parent is a direct descendent of an potential implied eval CallExpression, and if the parent is a CallExpression, that we're the first argument.
+ * @param {ASTNode} node The node to inspect the parent of.
+ * @returns {boolean} Was the parent a direct descendent, and is the child therefore potentially part of a dangerous argument?
+ * @private
+ */
+ function hasImpliedEvalParent(node) {
+ // make sure our parent is marked
+ return node.parent === last(last(impliedEvalAncestorsStack)) &&
+ // if our parent is a CallExpression, make sure we're the first argument
+ (node.parent.type !== "CallExpression" || node === node.parent.arguments[0]);
+ }
+
+ /**
+ * Checks if our parent is marked as part of an implied eval argument. If
+ * so, collapses the top of impliedEvalAncestorsStack and reports on the
+ * original CallExpression.
+ * @param {ASTNode} node The CallExpression to check.
+ * @returns {boolean} True if the node matches, false if not.
+ * @private
+ */
+ function checkString(node) {
+ if (hasImpliedEvalParent(node)) {
+ // remove the entire substack, to avoid duplicate reports
+ var substack = impliedEvalAncestorsStack.pop();
+ context.report(substack[0], "Implied eval. Consider passing a function instead of a string.");
+ }
}
//--------------------------------------------------------------------------
@@ -65,9 +100,41 @@ module.exports = function(context) {
return {
"CallExpression": function(node) {
- if (isImpliedEval(node)) {
- context.report(node, "Implied eval. Consider passing a function instead of a string.");
+ if (isImpliedEvalCallExpression(node)) {
+ // call expressions create a new substack
+ impliedEvalAncestorsStack.push([node]);
}
+ },
+
+ "CallExpression:exit": function(node) {
+ if (node === last(last(impliedEvalAncestorsStack))) {
+ // destroys the entire sub-stack, rather than just using
+ // last(impliedEvalAncestorsStack).pop(), as a CallExpression is
+ // always the bottom of a impliedEvalAncestorsStack substack.
+ impliedEvalAncestorsStack.pop();
+ }
+ },
+
+ "BinaryExpression": function(node) {
+ if (node.operator === "+" && hasImpliedEvalParent(node)) {
+ last(impliedEvalAncestorsStack).push(node);
+ }
+ },
+
+ "BinaryExpression:exit": function(node) {
+ if (node === last(last(impliedEvalAncestorsStack))) {
+ last(impliedEvalAncestorsStack).pop();
+ }
+ },
+
+ "Literal": function(node) {
+ if (typeof node.value === "string") {
+ checkString(node);
+ }
+ },
+
+ "TemplateLiteral": function(node) {
+ checkString(node);
}
};
diff --git a/tools/eslint/lib/rules/no-inline-comments.js b/tools/eslint/lib/rules/no-inline-comments.js
index 3941fd24c0fc21..4048802bc8c46a 100644
--- a/tools/eslint/lib/rules/no-inline-comments.js
+++ b/tools/eslint/lib/rules/no-inline-comments.js
@@ -5,6 +5,8 @@
*/
"use strict";
+var astUtils = require("../ast-utils");
+
//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------
@@ -28,8 +30,11 @@ module.exports = function(context) {
// Also check after the comment
var postamble = endLine.slice(node.loc.end.column).trim();
+ // Check that this comment isn't an ESLint directive
+ var isDirective = astUtils.isDirectiveComment(node);
+
// Should be empty if there was only whitespace around the comment
- if (preamble || postamble) {
+ if (!isDirective && (preamble || postamble)) {
context.report(node, "Unexpected comment inline with code.");
}
}
diff --git a/tools/eslint/lib/rules/no-invalid-regexp.js b/tools/eslint/lib/rules/no-invalid-regexp.js
index 63608c6c47497e..d46f9cb072e244 100644
--- a/tools/eslint/lib/rules/no-invalid-regexp.js
+++ b/tools/eslint/lib/rules/no-invalid-regexp.js
@@ -17,17 +17,29 @@ var espree = require("espree");
module.exports = function(context) {
+ /**
+ * Check if node is a string
+ * @param {ASTNode} node node to evaluate
+ * @returns {boolean} True if its a string
+ * @private
+ */
function isString(node) {
return node && node.type === "Literal" && typeof node.value === "string";
}
+ /**
+ * Validate strings passed to the RegExp constructor
+ * @param {ASTNode} node node to evaluate
+ * @returns {void}
+ * @private
+ */
function check(node) {
if (node.callee.type === "Identifier" && node.callee.name === "RegExp" && isString(node.arguments[0])) {
var flags = isString(node.arguments[1]) ? node.arguments[1].value : "";
try {
void new RegExp(node.arguments[0].value);
- } catch(e) {
+ } catch (e) {
context.report(node, e.message);
}
diff --git a/tools/eslint/lib/rules/no-invalid-this.js b/tools/eslint/lib/rules/no-invalid-this.js
new file mode 100644
index 00000000000000..37c67de0b5d5e8
--- /dev/null
+++ b/tools/eslint/lib/rules/no-invalid-this.js
@@ -0,0 +1,350 @@
+/**
+ * @fileoverview A rule to disallow `this` keywords outside of classes or class-like objects.
+ * @author Toru Nagashima
+ * @copyright 2015 Toru Nagashima. All rights reserved.
+ * See LICENSE file in root directory for full license.
+ */
+
+"use strict";
+
+//------------------------------------------------------------------------------
+// Requirements
+//------------------------------------------------------------------------------
+
+var astUtils = require("../ast-utils");
+
+//------------------------------------------------------------------------------
+// Helpers
+//------------------------------------------------------------------------------
+
+var thisTagPattern = /^[\s\*]*@this/m;
+var anyFunctionPattern = /^(?:Function(?:Declaration|Expression)|ArrowFunctionExpression)$/;
+var bindOrCallOrApplyPattern = /^(?:bind|call|apply)$/;
+var arrayOrTypedArrayPattern = /Array$/;
+var arrayMethodPattern = /^(?:every|filter|find|findIndex|forEach|map|some)$/;
+
+/**
+ * Checks whether or not a node is a constructor.
+ * @param {ASTNode} node - A function node to check.
+ * @returns {boolean} Wehether or not a node is a constructor.
+ */
+function isES5Constructor(node) {
+ return (
+ node.id &&
+ node.id.name[0] === node.id.name[0].toLocaleUpperCase()
+ );
+}
+
+/**
+ * Finds a function node from ancestors of a node.
+ * @param {ASTNode} node - A start node to find.
+ * @returns {Node|null} A found function node.
+ */
+function getUpperFunction(node) {
+ while (node) {
+ if (anyFunctionPattern.test(node.type)) {
+ return node;
+ }
+ node = node.parent;
+ }
+ return null;
+}
+
+/**
+ * Checks whether or not a node is callee.
+ * @param {ASTNode} node - A node to check.
+ * @returns {boolean} Whether or not the node is callee.
+ */
+function isCallee(node) {
+ return node.parent.type === "CallExpression" && node.parent.callee === node;
+}
+
+/**
+ * Checks whether or not a node is `Reclect.apply`.
+ * @param {ASTNode} node - A node to check.
+ * @returns {boolean} Whether or not the node is a `Reclect.apply`.
+ */
+function isReflectApply(node) {
+ return (
+ node.type === "MemberExpression" &&
+ node.object.type === "Identifier" &&
+ node.object.name === "Reflect" &&
+ node.property.type === "Identifier" &&
+ node.property.name === "apply" &&
+ node.computed === false
+ );
+}
+
+/**
+ * Checks whether or not a node is `Array.from`.
+ * @param {ASTNode} node - A node to check.
+ * @returns {boolean} Whether or not the node is a `Array.from`.
+ */
+function isArrayFrom(node) {
+ return (
+ node.type === "MemberExpression" &&
+ node.object.type === "Identifier" &&
+ arrayOrTypedArrayPattern.test(node.object.name) &&
+ node.property.type === "Identifier" &&
+ node.property.name === "from" &&
+ node.computed === false
+ );
+}
+
+/**
+ * Checks whether or not a node is a method which has `thisArg`.
+ * @param {ASTNode} node - A node to check.
+ * @returns {boolean} Whether or not the node is a method which has `thisArg`.
+ */
+function isMethodWhichHasThisArg(node) {
+ while (node) {
+ if (node.type === "Identifier") {
+ return arrayMethodPattern.test(node.name);
+ }
+ if (node.type === "MemberExpression" && !node.computed) {
+ node = node.property;
+ continue;
+ }
+
+ break;
+ }
+
+ return false;
+}
+
+//------------------------------------------------------------------------------
+// Rule Definition
+//------------------------------------------------------------------------------
+
+module.exports = function(context) {
+ var stack = [],
+ sourceCode = context.getSourceCode();
+
+
+ /**
+ * Checks whether or not a node has a `@this` tag in its comments.
+ * @param {ASTNode} node - A node to check.
+ * @returns {boolean} Whether or not the node has a `@this` tag in its comments.
+ */
+ function hasJSDocThisTag(node) {
+ var jsdocComment = sourceCode.getJSDocComment(node);
+ if (jsdocComment && thisTagPattern.test(jsdocComment.value)) {
+ return true;
+ }
+
+ // Checks `@this` in its leading comments for callbacks,
+ // because callbacks don't have its JSDoc comment.
+ // e.g.
+ // sinon.test(/* @this sinon.Sandbox */function() { this.spy(); });
+ return sourceCode.getComments(node).leading.some(function(comment) {
+ return thisTagPattern.test(comment.value);
+ });
+ }
+
+ /**
+ * Checks whether or not a node has valid `this`.
+ *
+ * First, this checks the node:
+ *
+ * - The function name starts with uppercase (it's a constructor).
+ * - The function has a JSDoc comment that has a @this tag.
+ *
+ * Next, this checks the location of the node.
+ * If the location is below, this judges `this` is valid.
+ *
+ * - The location is on an object literal.
+ * - The location assigns to a property.
+ * - The location is on an ES2015 class.
+ * - The location calls its `bind`/`call`/`apply` method directly.
+ * - The function is a callback of array methods (such as `.forEach()`) if `thisArg` is given.
+ *
+ * @param {ASTNode} node - A node to check.
+ * @returns {boolean} A found function node.
+ */
+ function hasValidThis(node) {
+ if (isES5Constructor(node) || hasJSDocThisTag(node)) {
+ return true;
+ }
+
+ while (node) {
+ var parent = node.parent;
+ switch (parent.type) {
+ // Looks up the destination.
+ // e.g.
+ // obj.foo = nativeFoo || function foo() { ... };
+ case "LogicalExpression":
+ case "ConditionalExpression":
+ node = parent;
+ break;
+
+ // If the upper function is IIFE, checks the destination of the return value.
+ // e.g.
+ // obj.foo = (function() {
+ // // setup...
+ // return function foo() { ... };
+ // })();
+ case "ReturnStatement":
+ var func = getUpperFunction(parent);
+ if (func === null || !isCallee(func)) {
+ return false;
+ }
+ node = func.parent;
+ break;
+
+ // e.g.
+ // var obj = { foo() { ... } };
+ // var obj = { foo: function() { ... } };
+ case "Property":
+ return true;
+
+ // e.g.
+ // obj.foo = foo() { ... };
+ case "AssignmentExpression":
+ return (
+ parent.right === node &&
+ parent.left.type === "MemberExpression"
+ );
+
+ // e.g.
+ // class A { constructor() { ... } }
+ // class A { foo() { ... } }
+ // class A { get foo() { ... } }
+ // class A { set foo() { ... } }
+ // class A { static foo() { ... } }
+ case "MethodDefinition":
+ return !parent.static;
+
+ // e.g.
+ // var foo = function foo() { ... }.bind(obj);
+ // (function foo() { ... }).call(obj);
+ // (function foo() { ... }).apply(obj, []);
+ case "MemberExpression":
+ return (
+ parent.object === node &&
+ parent.property.type === "Identifier" &&
+ bindOrCallOrApplyPattern.test(parent.property.name) &&
+ isCallee(parent) &&
+ parent.parent.arguments.length > 0 &&
+ !astUtils.isNullOrUndefined(parent.parent.arguments[0])
+ );
+
+ // e.g.
+ // Reflect.apply(function() {}, obj, []);
+ // Array.from([], function() {}, obj);
+ // list.forEach(function() {}, obj);
+ case "CallExpression":
+ if (isReflectApply(parent.callee)) {
+ return (
+ parent.arguments.length === 3 &&
+ parent.arguments[0] === node &&
+ !astUtils.isNullOrUndefined(parent.arguments[1])
+ );
+ }
+ if (isArrayFrom(parent.callee)) {
+ return (
+ parent.arguments.length === 3 &&
+ parent.arguments[1] === node &&
+ !astUtils.isNullOrUndefined(parent.arguments[2])
+ );
+ }
+ if (isMethodWhichHasThisArg(parent.callee)) {
+ return (
+ parent.arguments.length === 2 &&
+ parent.arguments[0] === node &&
+ !astUtils.isNullOrUndefined(parent.arguments[1])
+ );
+ }
+ return false;
+
+ // Otherwise `this` is invalid.
+ default:
+ return false;
+ }
+ }
+
+ /* istanbul ignore next */
+ throw new Error("unreachable");
+ }
+
+ /**
+ * Gets the current checking context.
+ *
+ * The return value has a flag that whether or not `this` keyword is valid.
+ * The flag is initialized when got at the first time.
+ *
+ * @returns {{valid: boolean}}
+ * an object which has a flag that whether or not `this` keyword is valid.
+ */
+ stack.getCurrent = function() {
+ var current = this[this.length - 1];
+ if (!current.init) {
+ current.init = true;
+ current.valid = hasValidThis(current.node);
+ }
+ return current;
+ };
+
+ /**
+ * Pushs new checking context into the stack.
+ *
+ * The checking context is not initialized yet.
+ * Because most functions don't have `this` keyword.
+ * When `this` keyword was found, the checking context is initialized.
+ *
+ * @param {ASTNode} node - A function node that was entered.
+ * @returns {void}
+ */
+ function enterFunction(node) {
+ // `this` can be invalid only under strict mode.
+ stack.push({
+ init: !context.getScope().isStrict,
+ node: node,
+ valid: true
+ });
+ }
+
+ /**
+ * Pops the current checking context from the stack.
+ * @returns {void}
+ */
+ function exitFunction() {
+ stack.pop();
+ }
+
+ return {
+ // `this` is invalid only under strict mode.
+ // Modules is always strict mode.
+ "Program": function(node) {
+ var scope = context.getScope();
+ var features = context.ecmaFeatures;
+
+ stack.push({
+ init: true,
+ node: node,
+ valid: !(
+ scope.isStrict ||
+ features.modules ||
+ (features.globalReturn && scope.childScopes[0].isStrict)
+ )
+ });
+ },
+ "Program:exit": function() {
+ stack.pop();
+ },
+
+ "FunctionDeclaration": enterFunction,
+ "FunctionDeclaration:exit": exitFunction,
+ "FunctionExpression": enterFunction,
+ "FunctionExpression:exit": exitFunction,
+
+ // Reports if `this` of the current context is invalid.
+ "ThisExpression": function(node) {
+ var current = stack.getCurrent();
+ if (current && !current.valid) {
+ context.report(node, "Unexpected `this`.");
+ }
+ }
+ };
+};
+
+module.exports.schema = [];
diff --git a/tools/eslint/lib/rules/no-irregular-whitespace.js b/tools/eslint/lib/rules/no-irregular-whitespace.js
index bfb30b8667ba9f..b49f747b8a08be 100644
--- a/tools/eslint/lib/rules/no-irregular-whitespace.js
+++ b/tools/eslint/lib/rules/no-irregular-whitespace.js
@@ -28,7 +28,7 @@ module.exports = function(context) {
var locStart = node.loc.start;
var locEnd = node.loc.end;
- errors = errors.filter(function (error) {
+ errors = errors.filter(function(error) {
var errorLoc = error[1];
if (errorLoc.line >= locStart.line && errorLoc.line <= locEnd.line) {
if (errorLoc.column >= locStart.column && (errorLoc.column <= locEnd.column || errorLoc.line < locEnd.line)) {
@@ -63,7 +63,7 @@ module.exports = function(context) {
function checkForIrregularWhitespace(node) {
var sourceLines = context.getSourceLines();
- sourceLines.forEach(function (sourceLine, lineIndex) {
+ sourceLines.forEach(function(sourceLine, lineIndex) {
var lineNumber = lineIndex + 1,
location,
match;
@@ -108,7 +108,7 @@ module.exports = function(context) {
}
return {
- "Program": function (node) {
+ "Program": function(node) {
/**
* As we can easily fire warnings for all white space issues with all the source its simpler to fire them here
* This means we can check all the application code without having to worry about issues caused in the parser tokens
@@ -122,11 +122,11 @@ module.exports = function(context) {
"Identifier": removeInvalidNodeErrors,
"Literal": removeInvalidNodeErrors,
- "Program:exit": function () {
+ "Program:exit": function() {
// If we have any errors remaining report on them
- errors.forEach(function (error) {
- context.report.apply(this, error);
+ errors.forEach(function(error) {
+ context.report.apply(context, error);
});
}
};
diff --git a/tools/eslint/lib/rules/no-label-var.js b/tools/eslint/lib/rules/no-label-var.js
index 8aa944e7a85b5b..20fbfc182df41f 100644
--- a/tools/eslint/lib/rules/no-label-var.js
+++ b/tools/eslint/lib/rules/no-label-var.js
@@ -5,6 +5,12 @@
"use strict";
+//------------------------------------------------------------------------------
+// Requirements
+//------------------------------------------------------------------------------
+
+var astUtils = require("../ast-utils");
+
//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------
@@ -15,28 +21,15 @@ module.exports = function(context) {
// Helpers
//--------------------------------------------------------------------------
- function findIdentifier(scope, identifier) {
- var found = false;
-
- scope.variables.forEach(function(variable) {
- if (variable.name === identifier) {
- found = true;
- }
- });
-
- scope.references.forEach(function(reference) {
- if (reference.identifier.name === identifier) {
- found = true;
- }
- });
-
- // If we have not found the identifier in this scope, check the parent
- // scope.
- if (scope.upper && !found) {
- return findIdentifier(scope.upper, identifier);
- }
-
- return found;
+ /**
+ * Check if the identifier is present inside current scope
+ * @param {object} scope current scope
+ * @param {string} name To evaluate
+ * @returns {boolean} True if its present
+ * @private
+ */
+ function findIdentifier(scope, name) {
+ return astUtils.getVariableByName(scope, name) !== null;
}
//--------------------------------------------------------------------------
diff --git a/tools/eslint/lib/rules/no-loop-func.js b/tools/eslint/lib/rules/no-loop-func.js
index e8f5262090be42..d82d6d7cc6a0cd 100644
--- a/tools/eslint/lib/rules/no-loop-func.js
+++ b/tools/eslint/lib/rules/no-loop-func.js
@@ -6,44 +6,104 @@
"use strict";
+//------------------------------------------------------------------------------
+// Helpers
+//------------------------------------------------------------------------------
+
+/**
+ * Gets the containing loop node of a specified node.
+ *
+ * We don't need to check nested functions, so this ignores those.
+ * `Scope.through` contains references of nested functions.
+ *
+ * @param {ASTNode} node - An AST node to get.
+ * @returns {ASTNode|null} The containing loop node of the specified node, or `null`.
+ */
+function getContainingLoopNode(node) {
+ var parent = node.parent;
+ while (parent) {
+ switch (parent.type) {
+ case "WhileStatement":
+ case "DoWhileStatement":
+ return parent;
+
+ case "ForStatement":
+ // `init` is outside of the loop.
+ if (parent.init !== node) {
+ return parent;
+ }
+ break;
+
+ case "ForInStatement":
+ case "ForOfStatement":
+ // `right` is outside of the loop.
+ if (parent.right !== node) {
+ return parent;
+ }
+ break;
+
+ case "ArrowFunctionExpression":
+ case "FunctionExpression":
+ case "FunctionDeclaration":
+ // We don't need to check nested functions.
+ return null;
+
+ default:
+ break;
+ }
+
+ node = parent;
+ parent = node.parent;
+ }
+
+ return null;
+}
+
+/**
+ * Checks whether or not a reference refers to a variable that is block-binding in the loop.
+ * @param {ASTNode} loopNode - A containing loop node.
+ * @param {escope.Reference} reference - A reference to check.
+ * @returns {boolean} Whether or not a reference refers to a variable that is block-binding in the loop.
+ */
+function isBlockBindingsInLoop(loopNode, reference) {
+ // A reference to a `let`/`const` variable always has a resolved variable.
+ var variable = reference.resolved;
+ var definition = variable && variable.defs[0];
+ var declaration = definition && definition.parent;
+
+ return (
+ // Checks whether this is `let`/`const`.
+ declaration &&
+ declaration.type === "VariableDeclaration" &&
+ (declaration.kind === "let" || declaration.kind === "const") &&
+ // Checks whether this is in the loop.
+ declaration.range[0] > loopNode.range[0] &&
+ declaration.range[1] < loopNode.range[1]
+ );
+}
+
//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------
module.exports = function(context) {
/**
- * Reports if the given node has an ancestor node which is a loop.
+ * Reports such functions:
+ *
+ * - has an ancestor node which is a loop.
+ * - has a reference that refers to a variable that is block-binding in the loop.
+ *
* @param {ASTNode} node The AST node to check.
* @returns {boolean} Whether or not the node is within a loop.
*/
function checkForLoops(node) {
- var ancestors = context.getAncestors();
-
- /**
- * Checks if the given node is a loop and current context is in the loop.
- * @param {ASTNode} ancestor The AST node to check.
- * @param {number} index The index of ancestor in ancestors.
- * @returns {boolean} Whether or not the node is a loop and current context is in the loop.
- */
- function isInLoop(ancestor, index) {
- switch (ancestor.type) {
- case "ForStatement":
- return ancestor.init !== ancestors[index + 1];
-
- case "ForInStatement":
- case "ForOfStatement":
- return ancestor.right !== ancestors[index + 1];
-
- case "WhileStatement":
- case "DoWhileStatement":
- return true;
-
- default:
- return false;
- }
+ var loopNode = getContainingLoopNode(node);
+ if (!loopNode) {
+ return;
}
- if (ancestors.some(isInLoop)) {
+ var references = context.getScope().through;
+ if (references.length > 0 && !references.every(isBlockBindingsInLoop.bind(null, loopNode))) {
context.report(node, "Don't make functions within a loop");
}
}
diff --git a/tools/eslint/lib/rules/no-magic-numbers.js b/tools/eslint/lib/rules/no-magic-numbers.js
new file mode 100644
index 00000000000000..a88b08747f5b17
--- /dev/null
+++ b/tools/eslint/lib/rules/no-magic-numbers.js
@@ -0,0 +1,130 @@
+/**
+ * @fileoverview Rule to flag statements that use magic numbers (adapted from https://github.com/danielstjules/buddy.js)
+ * @author Vincent Lemeunier
+ * @copyright 2015 Vincent Lemeunier. All rights reserved.
+ *
+ * This rule was adapted from danielstjules/buddy.js
+ * The MIT License (MIT)
+ *
+ * Copyright (c) 2014 Daniel St. Jules
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+
+ * The above copyright notice and this permission notice shall be included in all
+ * copies or substantial portions of the Software.
+
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ *
+ * See LICENSE file in root directory for full license.
+ */
+
+"use strict";
+
+//------------------------------------------------------------------------------
+// Rule Definition
+//------------------------------------------------------------------------------
+
+module.exports = function(context) {
+ var config = context.options[0] || {},
+ ignore = config.ignore || [0, 1, 2],
+ detectObjects = !!config.detectObjects,
+ enforceConst = !!config.enforceConst;
+
+ /**
+ * Returns whether the node is number literal
+ * @param {Node} node - the node literal being evaluated
+ * @returns {boolean} true if the node is a number literal
+ */
+ function isNumber(node) {
+ return typeof node.value === "number";
+ }
+
+ /**
+ * Returns whether the number should be ignored
+ * @param {number} num - the number
+ * @returns {boolean} true if the number should be ignored
+ */
+ function shouldIgnoreNumber(num) {
+ return ignore.indexOf(num) !== -1;
+ }
+
+
+ return {
+ "Literal": function(node) {
+ var parent = node.parent,
+ value = node.value,
+ raw = node.raw,
+ okTypes = detectObjects ? [] : ["ObjectExpression", "Property", "AssignmentExpression"];
+
+ if (!isNumber(node)) {
+ return;
+ }
+
+ if (parent.type === "UnaryExpression" && parent.operator === "-") {
+ node = parent;
+ parent = node.parent;
+ value = -value;
+ raw = "-" + raw;
+ }
+
+ if (shouldIgnoreNumber(value)) {
+ return;
+ }
+
+ // don't warn on parseInt() or Number.parseInt() radix
+ if (parent.type === "CallExpression" && node === parent.arguments[1] &&
+ (parent.callee.name === "parseInt" ||
+ parent.callee.type === "MemberExpression" &&
+ parent.callee.object.name === "Number" &&
+ parent.callee.property.name === "parseInt")
+ ) {
+ return;
+ }
+
+ if (parent.type === "VariableDeclarator") {
+ if (enforceConst && parent.parent.kind !== "const") {
+ context.report({
+ node: node,
+ message: "Number constants declarations must use 'const'"
+ });
+ }
+ } else if (okTypes.indexOf(parent.type) === -1) {
+ context.report({
+ node: node,
+ message: "No magic number: " + raw
+ });
+ }
+ }
+ };
+};
+
+module.exports.schema = [{
+ "type": "object",
+ "properties": {
+ "detectObjects": {
+ "type": "boolean"
+ },
+ "enforceConst": {
+ "type": "boolean"
+ },
+ "ignore": {
+ "type": "array",
+ "items": {
+ "type": "number"
+ },
+ "uniqueItems": true
+ }
+ },
+ "additionalProperties": false
+}];
diff --git a/tools/eslint/lib/rules/no-mixed-requires.js b/tools/eslint/lib/rules/no-mixed-requires.js
index fe2309691c0a24..eca480f132b773 100644
--- a/tools/eslint/lib/rules/no-mixed-requires.js
+++ b/tools/eslint/lib/rules/no-mixed-requires.js
@@ -107,7 +107,7 @@ module.exports = function(context) {
function isMixed(declarations) {
var contains = {};
- declarations.forEach(function (declaration) {
+ declarations.forEach(function(declaration) {
var type = getDeclarationType(declaration.init);
contains[type] = true;
});
@@ -127,7 +127,7 @@ module.exports = function(context) {
function isGrouped(declarations) {
var found = {};
- declarations.forEach(function (declaration) {
+ declarations.forEach(function(declaration) {
if (getDeclarationType(declaration.init) === DECL_REQUIRE) {
found[inferModuleType(declaration.init)] = true;
}
@@ -140,7 +140,13 @@ module.exports = function(context) {
return {
"VariableDeclaration": function(node) {
- var grouping = !!context.options[0];
+ var grouping = false;
+
+ if (typeof context.options[0] === "object") {
+ grouping = context.options[0].grouping;
+ } else {
+ grouping = !!context.options[0];
+ }
if (isMixed(node.declarations)) {
context.report(
@@ -160,6 +166,19 @@ module.exports = function(context) {
module.exports.schema = [
{
- "type": "boolean"
+ "oneOf": [
+ {
+ "type": "boolean"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "grouping": {
+ "type": "boolean"
+ }
+ },
+ "additionalProperties": false
+ }
+ ]
}
];
diff --git a/tools/eslint/lib/rules/no-mixed-spaces-and-tabs.js b/tools/eslint/lib/rules/no-mixed-spaces-and-tabs.js
index b6e29bacf21dac..6ce27dadc74905 100644
--- a/tools/eslint/lib/rules/no-mixed-spaces-and-tabs.js
+++ b/tools/eslint/lib/rules/no-mixed-spaces-and-tabs.js
@@ -3,6 +3,7 @@
* @author Jary Niebur
* @copyright 2014 Nicholas C. Zakas. All rights reserved.
* @copyright 2014 Jary Niebur. All rights reserved.
+ * See LICENSE in root directory for full license.
*/
"use strict";
@@ -12,7 +13,8 @@
module.exports = function(context) {
- var smartTabs;
+ var smartTabs,
+ ignoredLocs = [];
switch (context.options[0]) {
case true: // Support old syntax, maybe add deprecation warning here
@@ -23,8 +25,35 @@ module.exports = function(context) {
smartTabs = false;
}
- var COMMENT_START = /^\s*\/\*/,
- MAYBE_COMMENT = /^\s*\*/;
+ /**
+ * Determines if a given line and column are before a location.
+ * @param {Location} loc The location object from an AST node.
+ * @param {int} line The line to check.
+ * @param {int} column The column to check.
+ * @returns {boolean} True if the line and column are before the location, false if not.
+ * @private
+ */
+ function beforeLoc(loc, line, column) {
+ if (line < loc.start.line) {
+ return true;
+ }
+ return line === loc.start.line && column < loc.start.column;
+ }
+
+ /**
+ * Determines if a given line and column are after a location.
+ * @param {Location} loc The location object from an AST node.
+ * @param {int} line The line to check.
+ * @param {int} column The column to check.
+ * @returns {boolean} True if the line and column are after the location, false if not.
+ * @private
+ */
+ function afterLoc(loc, line, column) {
+ if (line > loc.end.line) {
+ return true;
+ }
+ return line === loc.end.line && column > loc.end.column;
+ }
//--------------------------------------------------------------------------
// Public
@@ -32,7 +61,11 @@ module.exports = function(context) {
return {
- "Program": function(node) {
+ "TemplateElement": function(node) {
+ ignoredLocs.push(node.loc);
+ },
+
+ "Program:exit": function(node) {
/*
* At least one space followed by a tab
* or the reverse before non-tab/-space
@@ -40,7 +73,24 @@ module.exports = function(context) {
*/
var regex = /^(?=[\t ]*(\t | \t))/,
match,
- lines = context.getSourceLines();
+ lines = context.getSourceLines(),
+ comments = context.getAllComments();
+
+ comments.forEach(function(comment) {
+ ignoredLocs.push(comment.loc);
+ });
+
+ ignoredLocs.sort(function(first, second) {
+ if (beforeLoc(first, second.start.line, second.start.column)) {
+ return 1;
+ }
+
+ if (beforeLoc(second, first.start.line, second.start.column)) {
+ return -1;
+ }
+
+ return 0;
+ });
if (smartTabs) {
/*
@@ -54,11 +104,21 @@ module.exports = function(context) {
match = regex.exec(line);
if (match) {
-
- if (!MAYBE_COMMENT.test(line) && !COMMENT_START.test(lines[i - 1])) {
- context.report(node, { line: i + 1, column: match.index + 1 }, "Mixed spaces and tabs.");
+ var lineNumber = i + 1,
+ column = match.index + 1;
+
+ for (var j = 0; j < ignoredLocs.length; j++) {
+ if (beforeLoc(ignoredLocs[j], lineNumber, column)) {
+ continue;
+ }
+ if (afterLoc(ignoredLocs[j], lineNumber, column)) {
+ continue;
+ }
+
+ return;
}
+ context.report(node, { line: lineNumber, column: column }, "Mixed spaces and tabs.");
}
});
}
diff --git a/tools/eslint/lib/rules/no-multi-spaces.js b/tools/eslint/lib/rules/no-multi-spaces.js
index f4d469859bd5ce..c6177e32825c5b 100644
--- a/tools/eslint/lib/rules/no-multi-spaces.js
+++ b/tools/eslint/lib/rules/no-multi-spaces.js
@@ -20,7 +20,7 @@ module.exports = function(context) {
lastCommentIndex = 0;
if (options && options.exceptions) {
- Object.keys(options.exceptions).forEach(function (key) {
+ Object.keys(options.exceptions).forEach(function(key) {
if (options.exceptions[key]) {
exceptions[key] = true;
} else {
@@ -72,24 +72,44 @@ module.exports = function(context) {
allComments = context.getAllComments(),
pattern = /[^\n\r\u2028\u2029 ] {2,}/g, // note: repeating space
token,
+ previousToken,
parent;
+
+ /**
+ * Creates a fix function that removes the multiple spaces between the two tokens
+ * @param {RuleFixer} leftToken left token
+ * @param {RuleFixer} rightToken right token
+ * @returns {function} fix function
+ * @private
+ */
+ function createFix(leftToken, rightToken) {
+ return function(fixer) {
+ return fixer.replaceTextRange([leftToken.range[1], rightToken.range[0]], " ");
+ };
+ }
+
while (pattern.test(source)) {
// do not flag anything inside of comments
if (!isIndexInComment(pattern.lastIndex, allComments)) {
token = context.getTokenByRangeStart(pattern.lastIndex);
-
if (token) {
+ previousToken = context.getTokenBefore(token);
+
if (hasExceptions) {
parent = context.getNodeByRangeIndex(pattern.lastIndex - 1);
}
if (!parent || !exceptions[parent.type]) {
- context.report(token, token.loc.start,
- "Multiple spaces found before '{{value}}'.",
- { value: token.value });
+ context.report({
+ node: token,
+ loc: token.loc.start,
+ message: "Multiple spaces found before '{{value}}'.",
+ data: { value: token.value },
+ fix: createFix(previousToken, token)
+ });
}
}
diff --git a/tools/eslint/lib/rules/no-multiple-empty-lines.js b/tools/eslint/lib/rules/no-multiple-empty-lines.js
index 4b293fac301488..46080277bc377a 100644
--- a/tools/eslint/lib/rules/no-multiple-empty-lines.js
+++ b/tools/eslint/lib/rules/no-multiple-empty-lines.js
@@ -13,13 +13,15 @@
module.exports = function(context) {
// Use options.max or 2 as default
- var numLines = 2;
+ var max = 2,
+ maxEOF;
// store lines that appear empty but really aren't
var notEmpty = [];
if (context.options.length) {
- numLines = context.options[0].max;
+ max = context.options[0].max;
+ maxEOF = context.options[0].maxEOF;
}
//--------------------------------------------------------------------------
@@ -45,17 +47,28 @@ module.exports = function(context) {
location,
trimmedLines = lines.map(function(str) {
return str.trim();
- });
+ }),
+ firstOfEndingBlankLines;
// add the notEmpty lines in there with a placeholder
notEmpty.forEach(function(x, i) {
trimmedLines[i] = x;
});
- // swallow the final newline, as some editors add it automatically
- // and we don't want it to cause an issue
- if (trimmedLines[trimmedLines.length - 1] === "") {
- trimmedLines = trimmedLines.slice(0, -1);
+ if (typeof maxEOF === "undefined") {
+ // swallow the final newline, as some editors add it
+ // automatically and we don't want it to cause an issue
+ if (trimmedLines[trimmedLines.length - 1] === "") {
+ trimmedLines = trimmedLines.slice(0, -1);
+ }
+ firstOfEndingBlankLines = trimmedLines.length;
+ } else {
+ // save the number of the first of the last blank lines
+ firstOfEndingBlankLines = trimmedLines.length;
+ while (trimmedLines[firstOfEndingBlankLines - 1] === ""
+ && firstOfEndingBlankLines > 0) {
+ firstOfEndingBlankLines--;
+ }
}
// Aggregate and count blank lines
@@ -67,12 +80,22 @@ module.exports = function(context) {
if (lastLocation === currentLocation - 1) {
blankCounter++;
} else {
- if (blankCounter >= numLines) {
- location = {
- line: lastLocation + 1,
- column: lines[lastLocation].length
- };
- context.report(node, location, "Multiple blank lines not allowed.");
+ location = {
+ line: lastLocation + 1,
+ column: 1
+ };
+ if (lastLocation < firstOfEndingBlankLines) {
+ // within the file, not at the end
+ if (blankCounter >= max) {
+ context.report(node, location,
+ "More than " + max + " blank " + (max === 1 ? "line" : "lines") + " not allowed.");
+ }
+ } else {
+ // inside the last blank lines
+ if (blankCounter >= maxEOF) {
+ context.report(node, location,
+ "Too many blank lines at the end of file. Max of " + maxEOF + " allowed.");
+ }
}
// Finally, reset the blank counter
@@ -90,6 +113,9 @@ module.exports.schema = [
"properties": {
"max": {
"type": "integer"
+ },
+ "maxEOF": {
+ "type": "integer"
}
},
"required": ["max"],
diff --git a/tools/eslint/lib/rules/no-native-reassign.js b/tools/eslint/lib/rules/no-native-reassign.js
index 1cbbbcbb850f3c..78d8c971188593 100644
--- a/tools/eslint/lib/rules/no-native-reassign.js
+++ b/tools/eslint/lib/rules/no-native-reassign.js
@@ -11,35 +11,58 @@
module.exports = function(context) {
- var NATIVE_OBJECTS = ["Array", "Boolean", "Date", "decodeURI",
- "decodeURIComponent", "encodeURI", "encodeURIComponent",
- "Error", "eval", "EvalError", "Function", "isFinite",
- "isNaN", "JSON", "Math", "Number", "Object", "parseInt",
- "parseFloat", "RangeError", "ReferenceError", "RegExp",
- "String", "SyntaxError", "TypeError", "URIError",
- "Map", "NaN", "Set", "WeakMap", "Infinity", "undefined"];
- var config = context.options[0] || {};
- var exceptions = config.exceptions || [];
- var modifiedNativeObjects = NATIVE_OBJECTS;
-
- if (exceptions.length) {
- modifiedNativeObjects = NATIVE_OBJECTS.filter(function(builtIn) {
- return exceptions.indexOf(builtIn) === -1;
- });
+ var config = context.options[0];
+ var exceptions = (config && config.exceptions) || [];
+
+ /**
+ * Gets the names of writeable built-in variables.
+ * @param {escope.Scope} scope - A scope to get.
+ * @returns {object} A map that its key is variable names.
+ */
+ function getBuiltinGlobals(scope) {
+ return scope.variables.reduce(function(retv, variable) {
+ if (variable.writeable === false && variable.name !== "__proto__") {
+ retv[variable.name] = true;
+ }
+ return retv;
+ }, Object.create(null));
}
- return {
+ /**
+ * Reports if a given reference's name is same as native object's.
+ * @param {object} builtins - A map that its key is a variable name.
+ * @param {Reference} reference - A reference to check.
+ * @param {int} index - The index of the reference in the references.
+ * @param {Reference[]} references - The array that the reference belongs to.
+ * @returns {void}
+ */
+ function checkThroughReference(builtins, reference, index, references) {
+ var identifier = reference.identifier;
- "AssignmentExpression": function(node) {
- if (modifiedNativeObjects.indexOf(node.left.name) >= 0) {
- context.report(node, node.left.name + " is a read-only native object.");
- }
- },
+ if (identifier &&
+ builtins[identifier.name] &&
+ exceptions.indexOf(identifier.name) === -1 &&
+ reference.init === false &&
+ reference.isWrite() &&
+ // Destructuring assignments can have multiple default value,
+ // so possibly there are multiple writeable references for the same identifier.
+ (index === 0 || references[index - 1].identifier !== identifier)
+ ) {
+ context.report(
+ identifier,
+ "{{name}} is a read-only native object.",
+ {name: identifier.name});
+ }
+ }
- "VariableDeclarator": function(node) {
- if (modifiedNativeObjects.indexOf(node.id.name) >= 0) {
- context.report(node, "Redefinition of '{{nativeObject}}'.", { nativeObject: node.id.name });
- }
+ return {
+ // Checks assignments of global variables.
+ // References to implicit global variables are not resolved,
+ // so those are in the `through` of the global scope.
+ "Program": function() {
+ var globalScope = context.getScope();
+ var builtins = getBuiltinGlobals(globalScope);
+ globalScope.through.forEach(checkThroughReference.bind(null, builtins));
}
};
@@ -51,9 +74,7 @@ module.exports.schema = [
"properties": {
"exceptions": {
"type": "array",
- "items": {
- "type": "string"
- },
+ "items": {"type": "string"},
"uniqueItems": true
}
},
diff --git a/tools/eslint/lib/rules/no-negated-condition.js b/tools/eslint/lib/rules/no-negated-condition.js
new file mode 100644
index 00000000000000..0d5b283e54aef6
--- /dev/null
+++ b/tools/eslint/lib/rules/no-negated-condition.js
@@ -0,0 +1,74 @@
+/**
+ * @fileoverview Rule to disallow a negated condition
+ * @author Alberto Rodríguez
+ * @copyright 2015 Alberto Rodríguez. All rights reserved.
+ * See LICENSE file in root directory for full license.
+ */
+"use strict";
+
+//------------------------------------------------------------------------------
+// Rule Definition
+//------------------------------------------------------------------------------
+
+module.exports = function(context) {
+
+ /**
+ * Determines if a given node is an if-else without a condition on the else
+ * @param {ASTNode} node The node to check.
+ * @returns {boolean} True if the node has an else without an if.
+ * @private
+ */
+ function hasElseWithoutCondition(node) {
+ return node.alternate && node.alternate.type !== "IfStatement";
+ }
+
+ /**
+ * Determines if a given node is a negated unary expression
+ * @param {Object} test The test object to check.
+ * @returns {boolean} True if the node is a negated unary expression.
+ * @private
+ */
+ function isNegatedUnaryExpression(test) {
+ return test.type === "UnaryExpression" && test.operator === "!";
+ }
+
+ /**
+ * Determines if a given node is a negated binary expression
+ * @param {Test} test The test to check.
+ * @returns {boolean} True if the node is a negated binary expression.
+ * @private
+ */
+ function isNegatedBinaryExpression(test) {
+ return test.type === "BinaryExpression" &&
+ (test.operator === "!=" || test.operator === "!==");
+ }
+
+ /**
+ * Determines if a given node has a negated if expression
+ * @param {ASTNode} node The node to check.
+ * @returns {boolean} True if the node has a negated if expression.
+ * @private
+ */
+ function isNegatedIf(node) {
+ return isNegatedUnaryExpression(node.test) || isNegatedBinaryExpression(node.test);
+ }
+
+ return {
+ "IfStatement": function(node) {
+ if (!hasElseWithoutCondition(node)) {
+ return;
+ }
+
+ if (isNegatedIf(node)) {
+ context.report(node, "Unexpected negated condition.");
+ }
+ },
+ "ConditionalExpression": function(node) {
+ if (isNegatedIf(node)) {
+ context.report(node, "Unexpected negated condition.");
+ }
+ }
+ };
+};
+
+module.exports.schema = [];
diff --git a/tools/eslint/lib/rules/no-new-func.js b/tools/eslint/lib/rules/no-new-func.js
index c7900e0c8f4b1f..dee7ec7f4d9892 100644
--- a/tools/eslint/lib/rules/no-new-func.js
+++ b/tools/eslint/lib/rules/no-new-func.js
@@ -11,13 +11,25 @@
module.exports = function(context) {
- return {
+ //--------------------------------------------------------------------------
+ // Helpers
+ //--------------------------------------------------------------------------
- "NewExpression": function(node) {
- if (node.callee.name === "Function") {
- context.report(node, "The Function constructor is eval.");
- }
+ /**
+ * Checks if the callee if the Function constructor, and if so, reports an issue.
+ * @param {ASTNode} node The node to check and report on
+ * @returns {void}
+ * @private
+ */
+ function validateCallee(node) {
+ if (node.callee.name === "Function") {
+ context.report(node, "The Function constructor is eval.");
}
+ }
+
+ return {
+ "NewExpression": validateCallee,
+ "CallExpression": validateCallee
};
};
diff --git a/tools/eslint/lib/rules/no-param-reassign.js b/tools/eslint/lib/rules/no-param-reassign.js
index c425246535261c..6bfa681afb46b9 100644
--- a/tools/eslint/lib/rules/no-param-reassign.js
+++ b/tools/eslint/lib/rules/no-param-reassign.js
@@ -9,79 +9,128 @@
// Rule Definition
//------------------------------------------------------------------------------
-module.exports = function(context) {
+var stopNodePattern = /(?:Statement|Declaration|Function(?:Expression)?|Program)$/;
- //--------------------------------------------------------------------------
- // Helpers
- //--------------------------------------------------------------------------
+module.exports = function(context) {
+ var props = context.options[0] && Boolean(context.options[0].props);
/**
- * Finds the declaration for a given variable by name, searching up the scope tree.
- * @param {Scope} scope The scope in which to search.
- * @param {String} name The name of the variable.
- * @returns {Variable} The declaration information for the given variable, or null if no declaration was found.
+ * Checks whether or not a reference modifies its variable.
+ * If the `props` option is `true`, this checks whether or not the reference modifies properties of its variable also.
+ * @param {Reference} reference - A reference to check.
+ * @returns {boolean} Whether or not the reference modifies its variable.
*/
- function findDeclaration(scope, name) {
- var variables = scope.variables;
+ function isModifying(reference) {
+ if (reference.isWrite()) {
+ return true;
+ }
+
+ // Checks whether its property is modified.
+ if (props) {
+ var node = reference.identifier;
+ var parent = node.parent;
+ while (parent && !stopNodePattern.test(parent.type)) {
+ switch (parent.type) {
+ // e.g. foo.a = 0;
+ case "AssignmentExpression":
+ return parent.left === node;
+
+ // e.g. ++foo.a;
+ case "UpdateExpression":
+ return true;
+
+ // e.g. delete foo.a;
+ case "UnaryExpression":
+ if (parent.operator === "delete") {
+ return true;
+ }
+ break;
+
+ // EXCLUDES: e.g. cache.get(foo.a).b = 0;
+ case "CallExpression":
+ if (parent.callee !== node) {
+ return false;
+ }
+ break;
- for (var i = 0; i < variables.length; i++) {
- if (variables[i].name === name) {
- return variables[i];
+ // EXCLUDES: e.g. cache[foo.a] = 0;
+ case "MemberExpression":
+ if (parent.property === node) {
+ return false;
+ }
+ break;
+
+ default:
+ break;
+ }
+
+ node = parent;
+ parent = parent.parent;
}
}
- if (scope.upper) {
- return findDeclaration(scope.upper, name);
- } else {
- return null;
- }
+ return false;
}
/**
- * Determines if a given variable is declared as a function parameter.
- * @param {Variable} variable The variable declaration.
- * @returns {boolean} True if the variable is a function parameter, false otherwise.
+ * Reports a reference if is non initializer and writable.
+ * @param {Reference} reference - A reference to check.
+ * @param {int} index - The index of the reference in the references.
+ * @param {Reference[]} references - The array that the reference belongs to.
+ * @returns {void}
*/
- function isParameter(variable) {
- var defs = variable.defs;
+ function checkReference(reference, index, references) {
+ var identifier = reference.identifier;
- for (var i = 0; i < defs.length; i++) {
- if (defs[i].type === "Parameter") {
- return true;
- }
+ if (identifier &&
+ !reference.init &&
+ isModifying(reference) &&
+ // Destructuring assignments can have multiple default value,
+ // so possibly there are multiple writeable references for the same identifier.
+ (index === 0 || references[index - 1].identifier !== identifier)
+ ) {
+ context.report(
+ identifier,
+ "Assignment to function parameter '{{name}}'.",
+ {name: identifier.name});
}
-
- return false;
}
/**
- * Checks whether a given node is an assignment to a function parameter.
- * If so, a linting error will be reported.
- * @param {ASTNode} node The node to check.
- * @param {String} name The name of the variable being assigned to.
+ * Finds and reports references that are non initializer and writable.
+ * @param {Variable} variable - A variable to check.
* @returns {void}
*/
- function checkParameter(node, name) {
- var declaration = findDeclaration(context.getScope(), name);
-
- if (declaration && isParameter(declaration)) {
- context.report(node, "Assignment to function parameter '{{name}}'.", { name: name });
+ function checkVariable(variable) {
+ if (variable.defs[0].type === "Parameter") {
+ variable.references.forEach(checkReference);
}
}
- //--------------------------------------------------------------------------
- // Public
- //--------------------------------------------------------------------------
+ /**
+ * Checks parameters of a given function node.
+ * @param {ASTNode} node - A function node to check.
+ * @returns {void}
+ */
+ function checkForFunction(node) {
+ context.getDeclaredVariables(node).forEach(checkVariable);
+ }
return {
- "AssignmentExpression": function(node) {
- checkParameter(node, node.left.name);
- },
-
- "UpdateExpression": function(node) {
- checkParameter(node, node.argument.name);
- }
+ // `:exit` is needed for the `node.parent` property of identifier nodes.
+ "FunctionDeclaration:exit": checkForFunction,
+ "FunctionExpression:exit": checkForFunction,
+ "ArrowFunctionExpression:exit": checkForFunction
};
+
};
-module.exports.schema = [];
+module.exports.schema = [
+ {
+ "type": "object",
+ "properties": {
+ "props": {"type": "boolean"}
+ },
+ "additionalProperties": false
+ }
+];
diff --git a/tools/eslint/lib/rules/no-plusplus.js b/tools/eslint/lib/rules/no-plusplus.js
index de8e861034dddd..42df6a5f2d3d0b 100644
--- a/tools/eslint/lib/rules/no-plusplus.js
+++ b/tools/eslint/lib/rules/no-plusplus.js
@@ -1,6 +1,7 @@
/**
* @fileoverview Rule to flag use of unary increment and decrement operators.
* @author Ian Christian Myers
+ * @author Brody McKee (github.com/mrmckeb)
*/
"use strict";
@@ -11,9 +12,19 @@
module.exports = function(context) {
+ var config = context.options[0],
+ allowInForAfterthought = false;
+
+ if (typeof config === "object") {
+ allowInForAfterthought = config.allowForLoopAfterthoughts === true;
+ }
+
return {
"UpdateExpression": function(node) {
+ if (allowInForAfterthought && node.parent.type === "ForStatement") {
+ return;
+ }
context.report(node, "Unary operator '" + node.operator + "' used.");
}
@@ -21,4 +32,14 @@ module.exports = function(context) {
};
-module.exports.schema = [];
+module.exports.schema = [
+ {
+ "type": "object",
+ "properties": {
+ "allowForLoopAfterthoughts": {
+ "type": "boolean"
+ }
+ },
+ "additionalProperties": false
+ }
+];
diff --git a/tools/eslint/lib/rules/no-redeclare.js b/tools/eslint/lib/rules/no-redeclare.js
index 80a6783ad5a023..2911ecb2e66670 100644
--- a/tools/eslint/lib/rules/no-redeclare.js
+++ b/tools/eslint/lib/rules/no-redeclare.js
@@ -10,22 +10,31 @@
//------------------------------------------------------------------------------
module.exports = function(context) {
+ var options = {
+ builtinGlobals: Boolean(context.options[0] && context.options[0].builtinGlobals)
+ };
/**
* Find variables in a given scope and flag redeclared ones.
- * @param {Scope} scope An escope scope object.
+ * @param {Scope} scope - An escope scope object.
* @returns {void}
* @private
*/
function findVariablesInScope(scope) {
scope.variables.forEach(function(variable) {
- if (variable.identifiers && variable.identifiers.length > 1) {
+ var hasBuiltin = options.builtinGlobals && "writeable" in variable;
+ var count = (hasBuiltin ? 1 : 0) + variable.identifiers.length;
+
+ if (count >= 2) {
variable.identifiers.sort(function(a, b) {
return a.range[1] - b.range[1];
});
- for (var i = 1, l = variable.identifiers.length; i < l; i++) {
- context.report(variable.identifiers[i], "{{a}} is already defined", {a: variable.name});
+ for (var i = (hasBuiltin ? 0 : 1), l = variable.identifiers.length; i < l; i++) {
+ context.report(
+ variable.identifiers[i],
+ "\"{{a}}\" is already defined",
+ {a: variable.name});
}
}
});
@@ -33,36 +42,52 @@ module.exports = function(context) {
}
/**
- * Find variables in a given node's associated scope.
- * @param {ASTNode} node The node to check.
+ * Find variables in the current scope.
* @returns {void}
* @private
*/
- function findVariables(node) {
+ function checkForGlobal() {
var scope = context.getScope();
- findVariablesInScope(scope);
-
- // globalReturn means one extra scope to check
- if (node.type === "Program" && context.ecmaFeatures.globalReturn) {
+ // Nodejs env or modules has a special scope.
+ if (context.ecmaFeatures.globalReturn || context.ecmaFeatures.modules) {
findVariablesInScope(scope.childScopes[0]);
+ } else {
+ findVariablesInScope(scope);
}
}
+ /**
+ * Find variables in the current scope.
+ * @returns {void}
+ * @private
+ */
+ function checkForBlock() {
+ findVariablesInScope(context.getScope());
+ }
+
if (context.ecmaFeatures.blockBindings) {
return {
- "Program": findVariables,
- "BlockStatement": findVariables,
- "SwitchStatement": findVariables
+ "Program": checkForGlobal,
+ "BlockStatement": checkForBlock,
+ "SwitchStatement": checkForBlock
};
} else {
return {
- "Program": findVariables,
- "FunctionDeclaration": findVariables,
- "FunctionExpression": findVariables,
- "ArrowFunctionExpression": findVariables
+ "Program": checkForGlobal,
+ "FunctionDeclaration": checkForBlock,
+ "FunctionExpression": checkForBlock,
+ "ArrowFunctionExpression": checkForBlock
};
}
};
-module.exports.schema = [];
+module.exports.schema = [
+ {
+ "type": "object",
+ "properties": {
+ "builtinGlobals": {"type": "boolean"}
+ },
+ "additionalProperties": false
+ }
+];
diff --git a/tools/eslint/lib/rules/no-reserved-keys.js b/tools/eslint/lib/rules/no-reserved-keys.js
deleted file mode 100644
index 9165442b59466a..00000000000000
--- a/tools/eslint/lib/rules/no-reserved-keys.js
+++ /dev/null
@@ -1,56 +0,0 @@
-/**
- * @fileoverview Rule to disallow reserved words being used as keys
- * @author Emil Bay
- * @copyright 2014 Emil Bay. All rights reserved.
- */
-
-"use strict";
-
-//------------------------------------------------------------------------------
-// Rule Definition
-//------------------------------------------------------------------------------
-
-module.exports = function(context) {
-
- var MESSAGE = "Reserved word '{{key}}' used as key.";
-
- var reservedWords = [
- "abstract",
- "boolean", "break", "byte",
- "case", "catch", "char", "class", "const", "continue",
- "debugger", "default", "delete", "do", "double",
- "else", "enum", "export", "extends",
- "final", "finally", "float", "for", "function",
- "goto",
- "if", "implements", "import", "in", "instanceof", "int", "interface",
- "long",
- "native", "new",
- "package", "private", "protected", "public",
- "return",
- "short", "static", "super", "switch", "synchronized",
- "this", "throw", "throws", "transient", "try", "typeof",
- "var", "void", "volatile",
- "while", "with"
- ];
-
- return {
-
- "ObjectExpression": function(node) {
- node.properties.forEach(function(property) {
-
- if (property.key.type === "Identifier") {
- var keyName = property.key.name;
-
- if (reservedWords.indexOf("" + keyName) !== -1) {
- context.report(node, MESSAGE, { key: keyName });
- }
- }
-
- });
-
- }
- };
-
-};
-
-module.exports.schema = [];
diff --git a/tools/eslint/lib/rules/no-restricted-modules.js b/tools/eslint/lib/rules/no-restricted-modules.js
index b2213ea00dbdc2..3266c75ad6fe0d 100644
--- a/tools/eslint/lib/rules/no-restricted-modules.js
+++ b/tools/eslint/lib/rules/no-restricted-modules.js
@@ -8,7 +8,7 @@
// Rule Definition
//------------------------------------------------------------------------------
-module.exports = function (context) {
+module.exports = function(context) {
// trim restricted module names
var restrictedModules = context.options;
@@ -57,7 +57,7 @@ module.exports = function (context) {
}
return {
- "CallExpression": function (node) {
+ "CallExpression": function(node) {
if (isRequireCall(node)) {
var restrictedModuleName = getRestrictedModuleName(node);
diff --git a/tools/eslint/lib/rules/no-restricted-syntax.js b/tools/eslint/lib/rules/no-restricted-syntax.js
new file mode 100644
index 00000000000000..67eb7415faaa60
--- /dev/null
+++ b/tools/eslint/lib/rules/no-restricted-syntax.js
@@ -0,0 +1,46 @@
+/**
+ * @fileoverview Rule to flag use of certain node types
+ * @author Burak Yigit Kaya
+ * @copyright 2015 Burak Yigit Kaya. All rights reserved.
+ */
+"use strict";
+
+//------------------------------------------------------------------------------
+// Rule Definition
+//------------------------------------------------------------------------------
+
+var nodeTypes = require("espree").Syntax;
+
+module.exports = function(context) {
+ /**
+ * Generates a warning from the provided node, saying that node type is not allowed.
+ * @param {ASTNode} node The node to warn on
+ * @returns {void}
+ */
+ function warn(node) {
+ context.report(node, "Using \"{{type}}\" is not allowed.", node);
+ }
+
+ return context.options.reduce(function(result, nodeType) {
+ result[nodeType] = warn;
+
+ return result;
+ }, {});
+
+};
+
+module.exports.schema = {
+ "type": "array",
+ "items": [
+ {
+ "enum": [0, 1, 2]
+ },
+ {
+ "enum": Object.keys(nodeTypes).map(function(k) {
+ return nodeTypes[k];
+ })
+ }
+ ],
+ "uniqueItems": true,
+ "minItems": 1
+};
diff --git a/tools/eslint/lib/rules/no-return-assign.js b/tools/eslint/lib/rules/no-return-assign.js
index d3133357ad183d..767414c49ffbac 100644
--- a/tools/eslint/lib/rules/no-return-assign.js
+++ b/tools/eslint/lib/rules/no-return-assign.js
@@ -14,7 +14,7 @@
* @returns {boolean} Whether or not the node is an `AssignmentExpression`.
*/
function isAssignment(node) {
- return node != null && node.type === "AssignmentExpression";
+ return node && node.type === "AssignmentExpression";
}
/**
diff --git a/tools/eslint/lib/rules/no-script-url.js b/tools/eslint/lib/rules/no-script-url.js
index 72521aecf1975a..9526061b24fe3e 100644
--- a/tools/eslint/lib/rules/no-script-url.js
+++ b/tools/eslint/lib/rules/no-script-url.js
@@ -2,8 +2,8 @@
* @fileoverview Rule to flag when using javascript: urls
* @author Ilya Volodin
*/
-/*jshint scripturl: true */
-/*eslint no-script-url: 0*/
+/* jshint scripturl: true */
+/* eslint no-script-url: 0 */
"use strict";
diff --git a/tools/eslint/lib/rules/no-sequences.js b/tools/eslint/lib/rules/no-sequences.js
index 9f7bfe3e7d14a2..538e36a12fc2a6 100644
--- a/tools/eslint/lib/rules/no-sequences.js
+++ b/tools/eslint/lib/rules/no-sequences.js
@@ -34,7 +34,7 @@ module.exports = function(context) {
* @returns {boolean} True if parens around node belong to parent node.
*/
function requiresExtraParens(node) {
- return node.parent && parenthesized[node.parent.type] != null &&
+ return node.parent && parenthesized[node.parent.type] &&
node === node.parent[parenthesized[node.parent.type]];
}
@@ -85,7 +85,8 @@ module.exports = function(context) {
}
}
- context.report(node, "Unexpected use of comma operator.");
+ var child = context.getTokenAfter(node.expressions[0]);
+ context.report(node, child.loc.start, "Unexpected use of comma operator.");
}
};
diff --git a/tools/eslint/lib/rules/no-shadow-restricted-names.js b/tools/eslint/lib/rules/no-shadow-restricted-names.js
index ff3d058ce41fd7..760c12cacdd3b9 100644
--- a/tools/eslint/lib/rules/no-shadow-restricted-names.js
+++ b/tools/eslint/lib/rules/no-shadow-restricted-names.js
@@ -13,6 +13,12 @@ module.exports = function(context) {
var RESTRICTED = ["undefined", "NaN", "Infinity", "arguments", "eval"];
+ /**
+ * Check if the node name is present inside the restricted list
+ * @param {ASTNode} id id to evaluate
+ * @returns {void}
+ * @private
+ */
function checkForViolation(id) {
if (RESTRICTED.indexOf(id.name) > -1) {
context.report(id, "Shadowing of global property \"" + id.name + "\".");
diff --git a/tools/eslint/lib/rules/no-shadow.js b/tools/eslint/lib/rules/no-shadow.js
index 060c668d570600..35c5a04f2e6e08 100644
--- a/tools/eslint/lib/rules/no-shadow.js
+++ b/tools/eslint/lib/rules/no-shadow.js
@@ -6,6 +6,12 @@
"use strict";
+//------------------------------------------------------------------------------
+// Requirements
+//------------------------------------------------------------------------------
+
+var astUtils = require("../ast-utils");
+
//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------
@@ -13,9 +19,21 @@
module.exports = function(context) {
var options = {
- hoist: (context.options[0] && context.options[0].hoist) || "functions"
+ builtinGlobals: Boolean(context.options[0] && context.options[0].builtinGlobals),
+ hoist: (context.options[0] && context.options[0].hoist) || "functions",
+ allow: (context.options[0] && context.options[0].allow) || []
};
+ /**
+ * Check if variable name is allowed.
+ *
+ * @param {ASTNode} variable The variable to check.
+ * @returns {boolean} Whether or not the variable name is allowed.
+ */
+ function isAllowed(variable) {
+ return options.allow.indexOf(variable.name) !== -1;
+ }
+
/**
* Checks if a variable of the class name in the class scope of ClassDeclaration.
*
@@ -49,8 +67,8 @@ module.exports = function(context) {
var inner = innerDef && innerDef.name.range;
return (
- outer != null &&
- inner != null &&
+ outer &&
+ inner &&
outer[0] < inner[0] &&
inner[1] < outer[1] &&
((innerDef.type === "FunctionName" && innerDef.node.type === "FunctionExpression") || innerDef.node.type === "ClassExpression") &&
@@ -79,85 +97,53 @@ module.exports = function(context) {
var inner = getNameRange(variable);
var outer = getNameRange(scopeVar);
return (
- inner != null &&
- outer != null &&
+ inner &&
+ outer &&
inner[1] < outer[0] &&
// Excepts FunctionDeclaration if is {"hoist":"function"}.
- (options.hoist !== "functions" || outerDef == null || outerDef.node.type !== "FunctionDeclaration")
+ (options.hoist !== "functions" || !outerDef || outerDef.node.type !== "FunctionDeclaration")
);
}
- /**
- * Checks if a variable is contained in the list of given scope variables.
- * @param {Object} variable The variable to check.
- * @param {Array} scopeVars The scope variables to look for.
- * @returns {boolean} Whether or not the variable is contains in the list of scope variables.
- */
- function isContainedInScopeVars(variable, scopeVars) {
- return scopeVars.some(function (scopeVar) {
- return (
- scopeVar.identifiers.length > 0 &&
- variable.name === scopeVar.name &&
- !isDuplicatedClassNameVariable(scopeVar) &&
- !isOnInitializer(variable, scopeVar) &&
- !(options.hoist !== "all" && isInTdz(variable, scopeVar))
- );
- });
- }
-
- /**
- * Checks if the given variables are shadowed in the given scope.
- * @param {Array} variables The variables to look for
- * @param {Object} scope The scope to be checked.
- * @returns {Array} Variables which are not declared in the given scope.
- */
- function checkShadowsInScope(variables, scope) {
-
- var passedVars = [];
-
- variables.forEach(function (variable) {
- // "arguments" is a special case that has no identifiers (#1759)
- if (variable.identifiers.length > 0 && isContainedInScopeVars(variable, scope.variables)) {
- context.report(
- variable.identifiers[0],
- "{{name}} is already declared in the upper scope.",
- {name: variable.name});
- } else {
- passedVars.push(variable);
- }
- });
-
- return passedVars;
- }
-
/**
* Checks the current context for shadowed variables.
* @param {Scope} scope - Fixme
* @returns {void}
*/
function checkForShadows(scope) {
- var variables = scope.variables.filter(function(variable) {
- return (
- // Skip "arguments".
- variable.identifiers.length > 0 &&
- // Skip variables of a class name in the class scope of ClassDeclaration.
- !isDuplicatedClassNameVariable(variable)
- );
- });
-
- // iterate through the array of variables and find duplicates with the upper scope
- var upper = scope.upper;
- while (upper && variables.length) {
- variables = checkShadowsInScope(variables, upper);
- upper = upper.upper;
+ var variables = scope.variables;
+ for (var i = 0; i < variables.length; ++i) {
+ var variable = variables[i];
+
+ // Skips "arguments" or variables of a class name in the class scope of ClassDeclaration.
+ if (variable.identifiers.length === 0 ||
+ isDuplicatedClassNameVariable(variable) ||
+ isAllowed(variable)
+ ) {
+ continue;
+ }
+
+ // Gets shadowed variable.
+ var shadowed = astUtils.getVariableByName(scope.upper, variable.name);
+ if (shadowed &&
+ (shadowed.identifiers.length > 0 || (options.builtinGlobals && "writeable" in shadowed)) &&
+ !isOnInitializer(variable, shadowed) &&
+ !(options.hoist !== "all" && isInTdz(variable, shadowed))
+ ) {
+ context.report({
+ node: variable.identifiers[0],
+ message: "\"{{name}}\" is already declared in the upper scope.",
+ data: variable
+ });
+ }
}
}
return {
- "Program:exit": function () {
- var globalScope = context.getScope(),
- stack = globalScope.childScopes.slice(),
- scope;
+ "Program:exit": function() {
+ var globalScope = context.getScope();
+ var stack = globalScope.childScopes.slice();
+ var scope;
while (stack.length) {
scope = stack.pop();
@@ -173,9 +159,15 @@ module.exports.schema = [
{
"type": "object",
"properties": {
- "hoist": {
- "enum": ["all", "functions", "never"]
+ "builtinGlobals": {"type": "boolean"},
+ "hoist": {"enum": ["all", "functions", "never"]},
+ "allow": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
}
- }
+ },
+ "additionalProperties": false
}
];
diff --git a/tools/eslint/lib/rules/no-space-before-semi.js b/tools/eslint/lib/rules/no-space-before-semi.js
deleted file mode 100644
index 4c2fffd9027e55..00000000000000
--- a/tools/eslint/lib/rules/no-space-before-semi.js
+++ /dev/null
@@ -1,98 +0,0 @@
-/**
- * @fileoverview Rule to disallow whitespace before the semicolon
- * @author Jonathan Kingston
- * @copyright 2015 Mathias Schreck
- * @copyright 2014 Jonathan Kingston
- */
-
-"use strict";
-
-//------------------------------------------------------------------------------
-// Rule Definition
-//------------------------------------------------------------------------------
-
-module.exports = function(context) {
-
- /**
- * Determines whether two adjacent tokens are have whitespace between them.
- * @param {Object} left - The left token object.
- * @param {Object} right - The right token object.
- * @returns {boolean} Whether or not there is space between the tokens.
- */
- function isSpaced(left, right) {
- return left.range[1] < right.range[0];
- }
-
- /**
- * Checks whether two tokens are on the same line.
- * @param {Object} left The leftmost token.
- * @param {Object} right The rightmost token.
- * @returns {boolean} True if the tokens are on the same line, false if not.
- * @private
- */
- function isSameLine(left, right) {
- return left.loc.end.line === right.loc.start.line;
- }
-
- /**
- * Checks if a given token has leading whitespace.
- * @param {Object} token The token to check.
- * @returns {boolean} True if the given token has leading space, false if not.
- */
- function hasLeadingSpace(token) {
- var tokenBefore = context.getTokenBefore(token);
- return isSameLine(tokenBefore, token) && isSpaced(tokenBefore, token);
- }
-
- /**
- * Checks if the given token is a semicolon.
- * @param {Token} token The token to check.
- * @returns {boolean} Whether or not the given token is a semicolon.
- */
- function isSemicolon(token) {
- return token.type === "Punctuator" && token.value === ";";
- }
-
- /**
- * Reports if the given token has leading space.
- * @param {Token} token The semicolon token to check.
- * @param {ASTNode} node The corresponding node of the token.
- * @returns {void}
- */
- function checkSemiTokenForLeadingSpace(token, node) {
- if (isSemicolon(token) && hasLeadingSpace(token)) {
- context.report(node, token.loc.start, "Unexpected whitespace before semicolon.");
- }
- }
-
- /**
- * Checks leading space before the semicolon with the assumption that the last token is the semicolon.
- * @param {ASTNode} node The node to check.
- * @returns {void}
- */
- function checkNode(node) {
- var token = context.getLastToken(node);
- checkSemiTokenForLeadingSpace(token, node);
- }
-
- return {
- "VariableDeclaration": checkNode,
- "ExpressionStatement": checkNode,
- "BreakStatement": checkNode,
- "ContinueStatement": checkNode,
- "DebuggerStatement": checkNode,
- "ReturnStatement": checkNode,
- "ThrowStatement": checkNode,
- "ForStatement": function (node) {
- if (node.init) {
- checkSemiTokenForLeadingSpace(context.getTokenAfter(node.init), node);
- }
-
- if (node.test) {
- checkSemiTokenForLeadingSpace(context.getTokenAfter(node.test), node);
- }
- }
- };
-};
-
-module.exports.schema = [];
diff --git a/tools/eslint/lib/rules/no-spaced-func.js b/tools/eslint/lib/rules/no-spaced-func.js
index cd3e8f975d3c8f..551a3c609717c5 100644
--- a/tools/eslint/lib/rules/no-spaced-func.js
+++ b/tools/eslint/lib/rules/no-spaced-func.js
@@ -11,19 +11,42 @@
module.exports = function(context) {
+ var sourceCode = context.getSourceCode();
+
+ /**
+ * Check if open space is present in a function name
+ * @param {ASTNode} node node to evaluate
+ * @returns {void}
+ * @private
+ */
function detectOpenSpaces(node) {
- var lastCalleeToken = context.getLastToken(node.callee);
- var tokens = context.getTokens(node);
- var i = tokens.indexOf(lastCalleeToken), l = tokens.length;
- while (i < l && tokens[i].value !== "(") {
- ++i;
- }
- if (i >= l) {
- return;
+ var lastCalleeToken = sourceCode.getLastToken(node.callee),
+ prevToken = lastCalleeToken,
+ parenToken = sourceCode.getTokenAfter(lastCalleeToken);
+
+ // advances to an open parenthesis.
+ while (
+ parenToken &&
+ parenToken.range[1] < node.range[1] &&
+ parenToken.value !== "("
+ ) {
+ prevToken = parenToken;
+ parenToken = sourceCode.getTokenAfter(parenToken);
}
+
// look for a space between the callee and the open paren
- if (tokens[i - 1].range[1] !== tokens[i].range[0]) {
- context.report(node, "Unexpected space between function name and paren.");
+ if (parenToken &&
+ parenToken.range[1] < node.range[1] &&
+ sourceCode.isSpaceBetweenTokens(prevToken, parenToken)
+ ) {
+ context.report({
+ node: node,
+ loc: lastCalleeToken.loc.start,
+ message: "Unexpected space between function name and paren.",
+ fix: function(fixer) {
+ return fixer.removeRange([prevToken.range[1], parenToken.range[0]]);
+ }
+ });
}
}
diff --git a/tools/eslint/lib/rules/no-sync.js b/tools/eslint/lib/rules/no-sync.js
index c26e003f6ef2cb..481514b83d492b 100644
--- a/tools/eslint/lib/rules/no-sync.js
+++ b/tools/eslint/lib/rules/no-sync.js
@@ -3,7 +3,7 @@
* @author Matt DuVall
*/
-/*jshint node:true*/
+/* jshint node:true */
"use strict";
diff --git a/tools/eslint/lib/rules/no-this-before-super.js b/tools/eslint/lib/rules/no-this-before-super.js
index bd0836eec78cd2..6f1225d63b9847 100644
--- a/tools/eslint/lib/rules/no-this-before-super.js
+++ b/tools/eslint/lib/rules/no-this-before-super.js
@@ -18,7 +18,7 @@ module.exports = function(context) {
* @returns {ClassDeclaration|ClassExpression|null} the found class node, or `null`.
*/
function getClassInAncestor(node) {
- while (node != null) {
+ while (node) {
if (node.type === "ClassDeclaration" || node.type === "ClassExpression") {
return node;
}
@@ -34,7 +34,7 @@ module.exports = function(context) {
* @returns {boolean} whether or not a node is the null literal.
*/
function isNullLiteral(node) {
- return node != null && node.type === "Literal" && node.value === null;
+ return node && node.type === "Literal" && node.value === null;
}
/**
@@ -43,7 +43,7 @@ module.exports = function(context) {
* @returns {boolean} whether or not a node is the callee of a call expression.
*/
function isCallee(node) {
- return node != null && node.parent.type === "CallExpression" && node.parent.callee === node;
+ return node && node.parent.type === "CallExpression" && node.parent.callee === node;
}
/**
@@ -53,7 +53,7 @@ module.exports = function(context) {
*/
function isBeforeSuperCalling(item) {
return (
- item != null &&
+ item &&
item.scope === context.getScope().variableScope.upper.variableScope &&
item.superCalled === false
);
@@ -91,7 +91,7 @@ module.exports = function(context) {
// Skip if it has no extends or `extends null`.
var classNode = getClassInAncestor(node);
- if (classNode == null || classNode.superClass == null || isNullLiteral(classNode.superClass)) {
+ if (!classNode || !classNode.superClass || isNullLiteral(classNode.superClass)) {
return;
}
diff --git a/tools/eslint/lib/rules/no-throw-literal.js b/tools/eslint/lib/rules/no-throw-literal.js
index a04784ae8f251c..1a0c01ab360690 100644
--- a/tools/eslint/lib/rules/no-throw-literal.js
+++ b/tools/eslint/lib/rules/no-throw-literal.js
@@ -1,11 +1,49 @@
/**
* @fileoverview Rule to restrict what can be thrown as an exception.
* @author Dieter Oberkofler
+ * @copyright 2015 Ian VanSchooten. All rights reserved.
* @copyright 2015 Dieter Oberkofler. All rights reserved.
*/
"use strict";
+//------------------------------------------------------------------------------
+// Helpers
+//------------------------------------------------------------------------------
+
+/**
+ * Determine if a node has a possiblity to be an Error object
+ * @param {ASTNode} node ASTNode to check
+ * @returns {boolean} True if there is a chance it contains an Error obj
+ */
+function couldBeError(node) {
+ switch (node.type) {
+ case "Identifier":
+ case "CallExpression":
+ case "NewExpression":
+ case "MemberExpression":
+ case "TaggedTemplateExpression":
+ case "YieldExpression":
+ return true; // possibly an error object.
+
+ case "AssignmentExpression":
+ return couldBeError(node.right);
+
+ case "SequenceExpression":
+ var exprs = node.expressions;
+ return exprs.length !== 0 && couldBeError(exprs[exprs.length - 1]);
+
+ case "LogicalExpression":
+ return couldBeError(node.left) || couldBeError(node.right);
+
+ case "ConditionalExpression":
+ return couldBeError(node.consequent) || couldBeError(node.alternate);
+
+ default:
+ return false;
+ }
+}
+
//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------
@@ -15,9 +53,8 @@ module.exports = function(context) {
return {
"ThrowStatement": function(node) {
-
- if (node.argument.type === "Literal") {
- context.report(node, "Do not throw a literal.");
+ if (!couldBeError(node.argument)) {
+ context.report(node, "Expected an object to be thrown.");
} else if (node.argument.type === "Identifier") {
if (node.argument.name === "undefined") {
context.report(node, "Do not throw undefined.");
diff --git a/tools/eslint/lib/rules/no-trailing-spaces.js b/tools/eslint/lib/rules/no-trailing-spaces.js
index a54cfe8cce8033..ac3c975d6e3eba 100644
--- a/tools/eslint/lib/rules/no-trailing-spaces.js
+++ b/tools/eslint/lib/rules/no-trailing-spaces.js
@@ -13,11 +13,32 @@ module.exports = function(context) {
var BLANK_CLASS = "[ \t\u00a0\u2000-\u200b\u2028\u2029\u3000]",
SKIP_BLANK = "^" + BLANK_CLASS + "*$",
- NONBLANK = BLANK_CLASS + "$";
+ NONBLANK = BLANK_CLASS + "+$";
var options = context.options[0] || {},
skipBlankLines = options.skipBlankLines || false;
+ /**
+ * Report the error message
+ * @param {ASTNode} node node to report
+ * @param {int[]} location range information
+ * @param {int[]} fixRange Range based on the whole program
+ * @returns {void}
+ */
+ function report(node, location, fixRange) {
+ // Passing node is a bit dirty, because message data will contain
+ // big text in `source`. But... who cares :) ?
+ // One more kludge will not make worse the bloody wizardry of this plugin.
+ context.report({
+ node: node,
+ loc: location,
+ message: "Trailing spaces not allowed.",
+ fix: function(fixer) {
+ return fixer.removeRange(fixRange);
+ }
+ });
+ }
+
//--------------------------------------------------------------------------
// Public
@@ -33,11 +54,21 @@ module.exports = function(context) {
var src = context.getSource(),
re = new RegExp(NONBLANK),
skipMatch = new RegExp(SKIP_BLANK),
- matches, lines = src.split(/\r?\n/), location;
+ matches, lines = src.split(/\r?\n/),
+ linebreaks = context.getSource().match(/\r\n|\r|\n|\u2028|\u2029/g),
+ location,
+ totalLength = 0,
+ fixRange = [];
for (var i = 0, ii = lines.length; i < ii; i++) {
-
matches = re.exec(lines[i]);
+
+ // Always add linebreak length to line length to accommodate for line break (\n or \r\n)
+ // Because during the fix time they also reserve one spot in the array.
+ // Usually linebreak length is 2 for \r\n (CRLF) and 1 for \n (LF)
+ var linebreakLength = linebreaks && linebreaks[i] ? linebreaks[i].length : 1;
+ var lineLength = lines[i].length + linebreakLength;
+
if (matches) {
// If the line has only whitespace, and skipBlankLines
@@ -47,14 +78,15 @@ module.exports = function(context) {
}
location = {
line: i + 1,
- column: lines[i].length - matches[0].length + 1
+ column: matches.index
};
- // Passing node is a bit dirty, because message data will contain
- // big text in `source`. But... who cares :) ?
- // One more kludge will not make worse the bloody wizardry of this plugin.
- context.report(node, location, "Trailing spaces not allowed.");
+ fixRange = [totalLength + location.column, totalLength + lineLength - linebreakLength];
+
+ report(node, location, fixRange);
}
+
+ totalLength += lineLength;
}
}
diff --git a/tools/eslint/lib/rules/no-undef-init.js b/tools/eslint/lib/rules/no-undef-init.js
index fc08c9b5088ac8..1348c641e362a8 100644
--- a/tools/eslint/lib/rules/no-undef-init.js
+++ b/tools/eslint/lib/rules/no-undef-init.js
@@ -1,6 +1,8 @@
/**
* @fileoverview Rule to flag when initializing to undefined
* @author Ilya Volodin
+ * @copyright 2013 Ilya Volodin. All rights reserved.
+ * See LICENSE in root directory for full license.
*/
"use strict";
@@ -14,10 +16,10 @@ module.exports = function(context) {
return {
"VariableDeclarator": function(node) {
- var name = node.id.name;
- var init = node.init && node.init.name;
+ var name = node.id.name,
+ init = node.init && node.init.name;
- if (init === "undefined") {
+ if (init === "undefined" && node.parent.kind !== "const") {
context.report(node, "It's not necessary to initialize '{{name}}' to undefined.", { name: name });
}
}
diff --git a/tools/eslint/lib/rules/no-undef.js b/tools/eslint/lib/rules/no-undef.js
index 7e15cfaf21db28..988d677cd72e02 100644
--- a/tools/eslint/lib/rules/no-undef.js
+++ b/tools/eslint/lib/rules/no-undef.js
@@ -10,12 +10,20 @@
// Requirements
//------------------------------------------------------------------------------
-// none!
+var astUtils = require("../ast-utils");
//------------------------------------------------------------------------------
// Helpers
//------------------------------------------------------------------------------
+var hasOwnProperty = Object.prototype.hasOwnProperty;
+
+/**
+ * Check if a variable is an implicit declaration
+ * @param {ASTNode} variable node to evaluate
+ * @returns {boolean} True if its an implicit declaration
+ * @private
+ */
function isImplicitGlobal(variable) {
return variable.defs.every(function(def) {
return def.type === "ImplicitGlobalVariable";
@@ -29,18 +37,13 @@ function isImplicitGlobal(variable) {
* @returns {Variable} The variable, or null if ref refers to an undeclared variable.
*/
function getDeclaredGlobalVariable(scope, ref) {
- var declaredGlobal = null;
- scope.variables.some(function(variable) {
- if (variable.name === ref.identifier.name) {
- // If it's an implicit global, it must have a `writeable` field (indicating it was declared)
- if (!isImplicitGlobal(variable) || {}.hasOwnProperty.call(variable, "writeable")) {
- declaredGlobal = variable;
- return true;
- }
- }
- return false;
- });
- return declaredGlobal;
+ var variable = astUtils.getVariableByName(scope, ref.identifier.name);
+
+ // If it's an implicit global, it must have a `writeable` field (indicating it was declared)
+ if (variable && (!isImplicitGlobal(variable) || hasOwnProperty.call(variable, "writeable"))) {
+ return variable;
+ }
+ return null;
}
/**
@@ -62,9 +65,12 @@ module.exports = function(context) {
var NOT_DEFINED_MESSAGE = "\"{{name}}\" is not defined.",
READ_ONLY_MESSAGE = "\"{{name}}\" is read only.";
+ var options = context.options[0];
+ var considerTypeOf = options && options.typeof === true || false;
+
return {
- "Program:exit": function(/*node*/) {
+ "Program:exit": function(/* node */) {
var globalScope = context.getScope();
@@ -72,7 +78,7 @@ module.exports = function(context) {
var variable = getDeclaredGlobalVariable(globalScope, ref),
name = ref.identifier.name;
- if (hasTypeOfOperator(ref.identifier)) {
+ if (hasTypeOfOperator(ref.identifier) && !considerTypeOf) {
return;
}
@@ -89,4 +95,14 @@ module.exports = function(context) {
};
-module.exports.schema = [];
+module.exports.schema = [
+ {
+ "type": "object",
+ "properties": {
+ "typeof": {
+ "type": "boolean"
+ }
+ },
+ "additionalProperties": false
+ }
+];
diff --git a/tools/eslint/lib/rules/no-underscore-dangle.js b/tools/eslint/lib/rules/no-underscore-dangle.js
index 38ad52f74fc4c2..4c11ff0387a99c 100644
--- a/tools/eslint/lib/rules/no-underscore-dangle.js
+++ b/tools/eslint/lib/rules/no-underscore-dangle.js
@@ -11,49 +11,99 @@
module.exports = function(context) {
+ var ALLOWED_VARIABLES = context.options[0] && context.options[0].allow ? context.options[0].allow : [];
+
//-------------------------------------------------------------------------
// Helpers
//-------------------------------------------------------------------------
+ /**
+ * Check if identifier is present inside the allowed option
+ * @param {string} identifier name of the node
+ * @returns {boolean} true if its is present
+ * @private
+ */
+ function isAllowed(identifier) {
+ return ALLOWED_VARIABLES.some(function(ident) {
+ return ident === identifier;
+ });
+ }
+
+ /**
+ * Check if identifier has a underscore at the end
+ * @param {ASTNode} identifier node to evaluate
+ * @returns {boolean} true if its is present
+ * @private
+ */
function hasTrailingUnderscore(identifier) {
var len = identifier.length;
return identifier !== "_" && (identifier[0] === "_" || identifier[len - 1] === "_");
}
+ /**
+ * Check if identifier is a special case member expression
+ * @param {ASTNode} identifier node to evaluate
+ * @returns {boolean} true if its is a special case
+ * @private
+ */
function isSpecialCaseIdentifierForMemberExpression(identifier) {
return identifier === "__proto__";
}
+ /**
+ * Check if identifier is a special case variable expression
+ * @param {ASTNode} identifier node to evaluate
+ * @returns {boolean} true if its is a special case
+ * @private
+ */
function isSpecialCaseIdentifierInVariableExpression(identifier) {
// Checks for the underscore library usage here
return identifier === "_";
}
+ /**
+ * Check if function has a underscore at the end
+ * @param {ASTNode} node node to evaluate
+ * @returns {void}
+ * @private
+ */
function checkForTrailingUnderscoreInFunctionDeclaration(node) {
if (node.id) {
var identifier = node.id.name;
- if (typeof identifier !== "undefined" && hasTrailingUnderscore(identifier)) {
+ if (typeof identifier !== "undefined" && hasTrailingUnderscore(identifier) && !isAllowed(identifier)) {
context.report(node, "Unexpected dangling \"_\" in \"" + identifier + "\".");
}
}
}
+ /**
+ * Check if variable expression has a underscore at the end
+ * @param {ASTNode} node node to evaluate
+ * @returns {void}
+ * @private
+ */
function checkForTrailingUnderscoreInVariableExpression(node) {
var identifier = node.id.name;
if (typeof identifier !== "undefined" && hasTrailingUnderscore(identifier) &&
- !isSpecialCaseIdentifierInVariableExpression(identifier)) {
+ !isSpecialCaseIdentifierInVariableExpression(identifier) && !isAllowed(identifier)) {
context.report(node, "Unexpected dangling \"_\" in \"" + identifier + "\".");
}
}
+ /**
+ * Check if member expression has a underscore at the end
+ * @param {ASTNode} node node to evaluate
+ * @returns {void}
+ * @private
+ */
function checkForTrailingUnderscoreInMemberExpression(node) {
var identifier = node.property.name;
if (typeof identifier !== "undefined" && hasTrailingUnderscore(identifier) &&
- !isSpecialCaseIdentifierForMemberExpression(identifier)) {
+ !isSpecialCaseIdentifierForMemberExpression(identifier) && !isAllowed(identifier)) {
context.report(node, "Unexpected dangling \"_\" in \"" + identifier + "\".");
}
}
@@ -70,4 +120,17 @@ module.exports = function(context) {
};
-module.exports.schema = [];
+module.exports.schema = [
+ {
+ "type": "object",
+ "properties": {
+ "allow": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ }
+ },
+ "additionalProperties": false
+ }
+];
diff --git a/tools/eslint/lib/rules/no-unneeded-ternary.js b/tools/eslint/lib/rules/no-unneeded-ternary.js
index 6aa944673138d3..fcbff265f91db0 100644
--- a/tools/eslint/lib/rules/no-unneeded-ternary.js
+++ b/tools/eslint/lib/rules/no-unneeded-ternary.js
@@ -12,17 +12,8 @@
//------------------------------------------------------------------------------
module.exports = function(context) {
-
- /**
- * Reports an AST node as a rule violation.
- * @param {ASTNode} mainNode The node to report.
- * @param {object} culpritNode - The token which has a problem
- * @returns {void}
- * @private
- */
- function report(mainNode, culpritNode) {
- context.report(mainNode, culpritNode.loc.start, "Unnecessary use of boolean literals in conditional expression");
- }
+ var options = context.options[0] || {};
+ var defaultAssignment = options.defaultAssignment !== false;
/**
* Test if the node is a boolean literal
@@ -34,15 +25,38 @@ module.exports = function(context) {
return node.type === "Literal" && typeof node.value === "boolean";
}
+ /**
+ * Test if the node matches the pattern id ? id : expression
+ * @param {ASTNode} node - The ConditionalExpression to check.
+ * @returns {boolean} True if the pattern is matched, and false otherwise
+ * @private
+ */
+ function matchesDefaultAssignment(node) {
+ return node.test.type === "Identifier" &&
+ node.consequent.type === "Identifier" &&
+ node.test.name === node.consequent.name;
+ }
+
return {
"ConditionalExpression": function(node) {
-
if (isBooleanLiteral(node.alternate) && isBooleanLiteral(node.consequent)) {
- report(node, node.consequent);
+ context.report(node, node.consequent.loc.start, "Unnecessary use of boolean literals in conditional expression");
+ } else if (!defaultAssignment && matchesDefaultAssignment(node)) {
+ context.report(node, node.consequent.loc.start, "Unnecessary use of conditional expression for default assignment");
}
}
};
};
-module.exports.schema = [];
+module.exports.schema = [
+ {
+ "type": "object",
+ "properties": {
+ "defaultAssignment": {
+ "type": "boolean"
+ }
+ },
+ "additionalProperties": false
+ }
+];
diff --git a/tools/eslint/lib/rules/no-unreachable.js b/tools/eslint/lib/rules/no-unreachable.js
index 1f169a64d53b31..5da0ecd0c65848 100644
--- a/tools/eslint/lib/rules/no-unreachable.js
+++ b/tools/eslint/lib/rules/no-unreachable.js
@@ -8,7 +8,14 @@
// Helpers
//------------------------------------------------------------------------------
-
+/**
+ * Report the node
+ * @param {object} context Current context as passed to the rule
+ * @param {ASTNode} node node to evaluate
+ * @param {string} unreachableType Type of the statement
+ * @returns {void}
+ * @private
+ */
function report(context, node, unreachableType) {
var keyword;
switch (unreachableType) {
@@ -51,7 +58,7 @@ module.exports = function(context) {
});
}
- /*
+ /**
* Verifies that the given node is the last node or followed exclusively by
* hoisted declarations
* @param {ASTNode} node Node that should be the last node
diff --git a/tools/eslint/lib/rules/no-unused-expressions.js b/tools/eslint/lib/rules/no-unused-expressions.js
index f78cf30196be74..82e21c04e7c306 100644
--- a/tools/eslint/lib/rules/no-unused-expressions.js
+++ b/tools/eslint/lib/rules/no-unused-expressions.js
@@ -10,10 +10,13 @@
//------------------------------------------------------------------------------
module.exports = function(context) {
+ var config = context.options[0] || {},
+ allowShortCircuit = config.allowShortCircuit || false,
+ allowTernary = config.allowTernary || false;
/**
* @param {ASTNode} node - any node
- * @returns {Boolean} whether the given node structurally represents a directive
+ * @returns {boolean} whether the given node structurally represents a directive
*/
function looksLikeDirective(node) {
return node.type === "ExpressionStatement" &&
@@ -45,7 +48,7 @@ module.exports = function(context) {
/**
* @param {ASTNode} node - any node
* @param {ASTNode[]} ancestors - the given node's ancestors
- * @returns {Boolean} whether the given node is considered a directive in its current position
+ * @returns {boolean} whether the given node is considered a directive in its current position
*/
function isDirective(node, ancestors) {
var parent = ancestors[ancestors.length - 1],
@@ -55,17 +58,31 @@ module.exports = function(context) {
directives(parent).indexOf(node) >= 0;
}
- return {
- "ExpressionStatement": function(node) {
+ /**
+ * Determines whether or not a given node is a valid expression. Recurses on short circuit eval and ternary nodes if enabled by flags.
+ * @param {ASTNode} node - any node
+ * @returns {boolean} whether the given node is a valid expression
+ */
+ function isValidExpression(node) {
+ if (allowTernary) {
+ // Recursive check for ternary and logical expressions
+ if (node.type === "ConditionalExpression") {
+ return isValidExpression(node.consequent) && isValidExpression(node.alternate);
+ }
+ }
+ if (allowShortCircuit) {
+ if (node.type === "LogicalExpression") {
+ return isValidExpression(node.right);
+ }
+ }
- var type = node.expression.type,
- ancestors = context.getAncestors();
+ return /^(?:Assignment|Call|New|Update|Yield)Expression$/.test(node.type) ||
+ (node.type === "UnaryExpression" && ["delete", "void"].indexOf(node.operator) >= 0);
+ }
- if (
- !/^(?:Assignment|Call|New|Update|Yield)Expression$/.test(type) &&
- (type !== "UnaryExpression" || ["delete", "void"].indexOf(node.expression.operator) < 0) &&
- !isDirective(node, ancestors)
- ) {
+ return {
+ "ExpressionStatement": function(node) {
+ if (!isValidExpression(node.expression) && !isDirective(node, context.getAncestors())) {
context.report(node, "Expected an assignment or function call and instead saw an expression.");
}
}
@@ -73,4 +90,17 @@ module.exports = function(context) {
};
-module.exports.schema = [];
+module.exports.schema = [
+ {
+ "type": "object",
+ "properties": {
+ "allowShortCircuit": {
+ "type": "boolean"
+ },
+ "allowTernary": {
+ "type": "boolean"
+ }
+ },
+ "additionalProperties": false
+ }
+];
diff --git a/tools/eslint/lib/rules/no-unused-vars.js b/tools/eslint/lib/rules/no-unused-vars.js
index 6b3b7f334e206f..ec7274b63e8e55 100644
--- a/tools/eslint/lib/rules/no-unused-vars.js
+++ b/tools/eslint/lib/rules/no-unused-vars.js
@@ -5,25 +5,41 @@
"use strict";
+//------------------------------------------------------------------------------
+// Requirements
+//------------------------------------------------------------------------------
+
+var escape = require("escape-string-regexp");
+
//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------
module.exports = function(context) {
- var MESSAGE = "{{name}} is defined but never used";
+ var MESSAGE = "\"{{name}}\" is defined but never used";
var config = {
vars: "all",
args: "after-used"
};
- if (context.options[0]) {
- if (typeof context.options[0] === "string") {
- config.vars = context.options[0];
+ var firstOption = context.options[0];
+
+ if (firstOption) {
+ if (typeof firstOption === "string") {
+ config.vars = firstOption;
} else {
- config.vars = context.options[0].vars || config.vars;
- config.args = context.options[0].args || config.args;
+ config.vars = firstOption.vars || config.vars;
+ config.args = firstOption.args || config.args;
+
+ if (firstOption.varsIgnorePattern) {
+ config.varsIgnorePattern = new RegExp(firstOption.varsIgnorePattern);
+ }
+
+ if (firstOption.argsIgnorePattern) {
+ config.argsIgnorePattern = new RegExp(firstOption.argsIgnorePattern);
+ }
}
}
@@ -31,7 +47,6 @@ module.exports = function(context) {
// Helpers
//--------------------------------------------------------------------------
-
/**
* Determines if a given variable is being exported from a module.
* @param {Variable} variable - EScope variable object.
@@ -47,7 +62,7 @@ module.exports = function(context) {
var node = definition.node;
if (node.type === "VariableDeclarator") {
node = node.parent;
- } else if (definition.type === "Parameter" && node.type === "FunctionDeclaration") {
+ } else if (definition.type === "Parameter") {
return false;
}
@@ -77,7 +92,7 @@ module.exports = function(context) {
function isSelfReference(ref, nodes) {
var scope = ref.from;
- while (scope != null) {
+ while (scope) {
if (nodes.indexOf(scope.block) >= 0) {
return true;
}
@@ -95,14 +110,14 @@ module.exports = function(context) {
* @returns {boolean} True if the variable is used
*/
function isUsedVariable(variable, references) {
- var functionNodes = variable.defs.filter(function (def) {
- return def.type === "FunctionName";
- }).map(function (def) {
- return def.node;
- }),
+ var functionNodes = variable.defs.filter(function(def) {
+ return def.type === "FunctionName";
+ }).map(function(def) {
+ return def.node;
+ }),
isFunctionDefinition = functionNodes.length > 0;
- return references.some(function (ref) {
+ return references.some(function(ref) {
return isReadRef(ref) && !(isFunctionDefinition && isSelfReference(ref, functionNodes));
});
}
@@ -156,7 +171,7 @@ module.exports = function(context) {
if (scope.type === "class" && scope.block.id === variable.identifiers[0]) {
continue;
}
- // skip function expression names
+ // skip function expression names and variables marked with markVariableAsUsed()
if (scope.functionExpressionScope || variable.eslintUsed) {
continue;
}
@@ -167,7 +182,7 @@ module.exports = function(context) {
// explicit global variables don't have definitions.
var def = variable.defs[0];
- if (def != null) {
+ if (def) {
var type = def.type;
// skip catch variables
@@ -175,19 +190,31 @@ module.exports = function(context) {
continue;
}
- // skip any setter argument
- if (type === "Parameter" && def.node.parent.type === "Property" && def.node.parent.kind === "set") {
- continue;
- }
-
- // if "args" option is "none", skip any parameter
- if (config.args === "none" && type === "Parameter") {
- continue;
- }
-
- // if "args" option is "after-used", skip all but the last parameter
- if (config.args === "after-used" && type === "Parameter" && def.index < def.node.params.length - 1) {
- continue;
+ if (type === "Parameter") {
+ // skip any setter argument
+ if (def.node.parent.type === "Property" && def.node.parent.kind === "set") {
+ continue;
+ }
+
+ // if "args" option is "none", skip any parameter
+ if (config.args === "none") {
+ continue;
+ }
+
+ // skip ignored parameters
+ if (config.argsIgnorePattern && config.argsIgnorePattern.test(def.name.name)) {
+ continue;
+ }
+
+ // if "args" option is "after-used", skip all but the last parameter
+ if (config.args === "after-used" && def.index < def.node.params.length - 1) {
+ continue;
+ }
+ } else {
+ // skip ignored variables
+ if (config.varsIgnorePattern && config.varsIgnorePattern.test(def.name.name)) {
+ continue;
+ }
}
}
@@ -206,6 +233,50 @@ module.exports = function(context) {
return unusedVars;
}
+ /**
+ * Gets the index of a given variable name in a given comment.
+ * @param {escope.Variable} variable - A variable to get.
+ * @param {ASTNode} comment - A comment node which includes the variable name.
+ * @returns {number} The index of the variable name's location.
+ */
+ function getColumnInComment(variable, comment) {
+ var namePattern = new RegExp("[\\s,]" + escape(variable.name) + "(?:$|[\\s,:])", "g");
+
+ // To ignore the first text "global".
+ namePattern.lastIndex = comment.value.indexOf("global") + 6;
+
+ // Search a given variable name.
+ var match = namePattern.exec(comment.value);
+ return match ? match.index + 1 : 0;
+ }
+
+ /**
+ * Creates the correct location of a given variables.
+ * The location is at its name string in a `/*global` comment.
+ *
+ * @param {escope.Variable} variable - A variable to get its location.
+ * @returns {{line: number, column: number}} The location object for the variable.
+ */
+ function getLocation(variable) {
+ var comment = variable.eslintExplicitGlobalComment;
+ var baseLoc = comment.loc.start;
+ var column = getColumnInComment(variable, comment);
+ var prefix = comment.value.slice(0, column);
+ var lineInComment = (prefix.match(/\n/g) || []).length;
+
+ if (lineInComment > 0) {
+ column -= 1 + prefix.lastIndexOf("\n");
+ } else {
+ // 2 is for `/*`
+ column += baseLoc.column + 2;
+ }
+
+ return {
+ line: baseLoc.line + lineInComment,
+ column: column
+ };
+ }
+
//--------------------------------------------------------------------------
// Public
//--------------------------------------------------------------------------
@@ -219,8 +290,10 @@ module.exports = function(context) {
for (var i = 0, l = unusedVars.length; i < l; ++i) {
var unusedVar = unusedVars[i];
- if (unusedVar.eslintExplicitGlobal) {
- context.report(programNode, MESSAGE, unusedVar);
+ if (unusedVar.eslintUsed) {
+ continue; // explicitly exported variables
+ } else if (unusedVar.eslintExplicitGlobal) {
+ context.report(programNode, getLocation(unusedVar), MESSAGE, unusedVar);
} else if (unusedVar.defs.length > 0) {
context.report(unusedVar.identifiers[0], MESSAGE, unusedVar);
}
@@ -242,8 +315,14 @@ module.exports.schema = [
"vars": {
"enum": ["all", "local"]
},
+ "varsIgnorePattern": {
+ "type": "string"
+ },
"args": {
"enum": ["all", "after-used", "none"]
+ },
+ "argsIgnorePattern": {
+ "type": "string"
}
}
}
diff --git a/tools/eslint/lib/rules/no-use-before-define.js b/tools/eslint/lib/rules/no-use-before-define.js
index baf0780e711481..9518d9e50b1fab 100644
--- a/tools/eslint/lib/rules/no-use-before-define.js
+++ b/tools/eslint/lib/rules/no-use-before-define.js
@@ -6,6 +6,12 @@
"use strict";
+//------------------------------------------------------------------------------
+// Requirements
+//------------------------------------------------------------------------------
+
+var astUtils = require("../ast-utils");
+
//------------------------------------------------------------------------------
// Constants
//------------------------------------------------------------------------------
@@ -18,26 +24,6 @@ var NO_FUNC = "nofunc";
module.exports = function(context) {
- /**
- * Finds variable declarations in a given scope.
- * @param {string} name The variable name to find.
- * @param {Scope} scope The scope to search in.
- * @returns {Object} The variable declaration object.
- * @private
- */
- function findDeclaration(name, scope) {
- // try searching in the current scope first
- for (var i = 0, l = scope.variables.length; i < l; i++) {
- if (scope.variables[i].name === name) {
- return scope.variables[i];
- }
- }
- // check if there's upper scope and call recursivly till we find the variable
- if (scope.upper) {
- return findDeclaration(name, scope.upper);
- }
- }
-
/**
* Finds and validates all variables in a given scope.
* @param {Scope} scope The scope object.
@@ -47,10 +33,17 @@ module.exports = function(context) {
function findVariablesInScope(scope) {
var typeOption = context.options[0];
+ /**
+ * Report the node
+ * @param {object} reference reference object
+ * @param {ASTNode} declaration node to evaluate
+ * @returns {void}
+ * @private
+ */
function checkLocationAndReport(reference, declaration) {
if (typeOption !== NO_FUNC || declaration.defs[0].type !== "FunctionName") {
if (declaration.identifiers[0].range[1] > reference.identifier.range[1]) {
- context.report(reference.identifier, "{{a}} was used before it was defined", {a: reference.identifier.name});
+ context.report(reference.identifier, "\"{{a}}\" was used before it was defined", {a: reference.identifier.name});
}
}
}
@@ -61,7 +54,7 @@ module.exports = function(context) {
if (reference.resolved && reference.resolved.identifiers.length > 0) {
checkLocationAndReport(reference, reference.resolved);
} else {
- var declaration = findDeclaration(reference.identifier.name, scope);
+ var declaration = astUtils.getVariableByName(scope, reference.identifier.name);
// if there're no identifiers, this is a global environment variable
if (declaration && declaration.identifiers.length !== 0) {
checkLocationAndReport(reference, declaration);
@@ -82,7 +75,7 @@ module.exports = function(context) {
findVariablesInScope(scope);
}
- return {
+ var ruleDefinition = {
"Program": function() {
var scope = context.getScope();
findVariablesInScope(scope);
@@ -91,11 +84,22 @@ module.exports = function(context) {
if (context.ecmaFeatures.globalReturn || context.ecmaFeatures.modules) {
findVariablesInScope(scope.childScopes[0]);
}
- },
- "FunctionExpression": findVariables,
- "FunctionDeclaration": findVariables,
- "ArrowFunctionExpression": findVariables
+ }
};
+
+ if (context.ecmaFeatures.blockBindings) {
+ ruleDefinition.BlockStatement = ruleDefinition.SwitchStatement = findVariables;
+
+ ruleDefinition.ArrowFunctionExpression = function(node) {
+ if (node.body.type !== "BlockStatement") {
+ findVariables(node);
+ }
+ };
+ } else {
+ ruleDefinition.FunctionExpression = ruleDefinition.FunctionDeclaration = ruleDefinition.ArrowFunctionExpression = findVariables;
+ }
+
+ return ruleDefinition;
};
module.exports.schema = [
diff --git a/tools/eslint/lib/rules/no-useless-call.js b/tools/eslint/lib/rules/no-useless-call.js
new file mode 100644
index 00000000000000..8af37d78911077
--- /dev/null
+++ b/tools/eslint/lib/rules/no-useless-call.js
@@ -0,0 +1,96 @@
+/**
+ * @fileoverview A rule to disallow unnecessary `.call()` and `.apply()`.
+ * @author Toru Nagashima
+ * @copyright 2015 Toru Nagashima. All rights reserved.
+ */
+
+"use strict";
+
+var astUtils = require("../ast-utils");
+
+//------------------------------------------------------------------------------
+// Helpers
+//------------------------------------------------------------------------------
+
+/**
+ * Checks whether or not a node is a `.call()`/`.apply()`.
+ * @param {ASTNode} node - A CallExpression node to check.
+ * @returns {boolean} Whether or not the node is a `.call()`/`.apply()`.
+ */
+function isCallOrNonVariadicApply(node) {
+ return (
+ node.callee.type === "MemberExpression" &&
+ node.callee.property.type === "Identifier" &&
+ node.callee.computed === false &&
+ (
+ (node.callee.property.name === "call" && node.arguments.length >= 1) ||
+ (node.callee.property.name === "apply" && node.arguments.length === 2 && node.arguments[1].type === "ArrayExpression")
+ )
+ );
+}
+
+/**
+ * Checks whether or not the tokens of two given nodes are same.
+ * @param {ASTNode} left - A node 1 to compare.
+ * @param {ASTNode} right - A node 2 to compare.
+ * @param {RuleContext} context - The ESLint rule context object.
+ * @returns {boolean} the source code for the given node.
+ */
+function equalTokens(left, right, context) {
+ var tokensL = context.getTokens(left);
+ var tokensR = context.getTokens(right);
+
+ if (tokensL.length !== tokensR.length) {
+ return false;
+ }
+ for (var i = 0; i < tokensL.length; ++i) {
+ if (tokensL[i].type !== tokensR[i].type ||
+ tokensL[i].value !== tokensR[i].value
+ ) {
+ return false;
+ }
+ }
+
+ return true;
+}
+
+/**
+ * Checks whether or not `thisArg` is not changed by `.call()`/`.apply()`.
+ * @param {ASTNode|null} expectedThis - The node that is the owner of the applied function.
+ * @param {ASTNode} thisArg - The node that is given to the first argument of the `.call()`/`.apply()`.
+ * @param {RuleContext} context - The ESLint rule context object.
+ * @returns {boolean} Whether or not `thisArg` is not changed by `.call()`/`.apply()`.
+ */
+function isValidThisArg(expectedThis, thisArg, context) {
+ if (!expectedThis) {
+ return astUtils.isNullOrUndefined(thisArg);
+ }
+ return equalTokens(expectedThis, thisArg, context);
+}
+
+//------------------------------------------------------------------------------
+// Rule Definition
+//------------------------------------------------------------------------------
+
+module.exports = function(context) {
+ return {
+ "CallExpression": function(node) {
+ if (!isCallOrNonVariadicApply(node)) {
+ return;
+ }
+
+ var applied = node.callee.object;
+ var expectedThis = (applied.type === "MemberExpression") ? applied.object : null;
+ var thisArg = node.arguments[0];
+
+ if (isValidThisArg(expectedThis, thisArg, context)) {
+ context.report(
+ node,
+ "unnecessary \".{{name}}()\".",
+ {name: node.callee.property.name});
+ }
+ }
+ };
+};
+
+module.exports.schema = [];
diff --git a/tools/eslint/lib/rules/no-useless-concat.js b/tools/eslint/lib/rules/no-useless-concat.js
new file mode 100644
index 00000000000000..6f230a96d3385a
--- /dev/null
+++ b/tools/eslint/lib/rules/no-useless-concat.js
@@ -0,0 +1,89 @@
+/**
+ * @fileoverview disallow unncessary concatenation of template strings
+ * @author Henry Zhu
+ * @copyright 2015 Henry Zhu. All rights reserved.
+ * See LICENSE file in root directory for full license.
+ */
+"use strict";
+
+//------------------------------------------------------------------------------
+// Requirements
+//------------------------------------------------------------------------------
+
+var astUtils = require("../ast-utils");
+
+//------------------------------------------------------------------------------
+// Helpers
+//------------------------------------------------------------------------------
+
+/**
+ * Checks whether or not a given node is a concatenation.
+ * @param {ASTNode} node - A node to check.
+ * @returns {boolean} `true` if the node is a concatenation.
+ */
+function isConcatenation(node) {
+ return node.type === "BinaryExpression" && node.operator === "+";
+}
+
+/**
+ * Get's the right most node on the left side of a BinaryExpression with + operator.
+ * @param {ASTNode} node - A BinaryExpression node to check.
+ * @returns {ASTNode} node
+ */
+function getLeft(node) {
+ var left = node.left;
+ while (isConcatenation(left)) {
+ left = left.right;
+ }
+ return left;
+}
+
+/**
+ * Get's the left most node on the right side of a BinaryExpression with + operator.
+ * @param {ASTNode} node - A BinaryExpression node to check.
+ * @returns {ASTNode} node
+ */
+function getRight(node) {
+ var right = node.right;
+ while (isConcatenation(right)) {
+ right = right.left;
+ }
+ return right;
+}
+
+//------------------------------------------------------------------------------
+// Rule Definition
+//------------------------------------------------------------------------------
+
+module.exports = function(context) {
+ return {
+ BinaryExpression: function(node) {
+ // check if not concatenation
+ if (node.operator !== "+") {
+ return;
+ }
+
+ // account for the `foo + "a" + "b"` case
+ var left = getLeft(node);
+ var right = getRight(node);
+
+ if (astUtils.isStringLiteral(left) &&
+ astUtils.isStringLiteral(right) &&
+ astUtils.isTokenOnSameLine(left, right)
+ ) {
+ // move warning location to operator
+ var operatorToken = context.getTokenAfter(left);
+ while (operatorToken.value !== "+") {
+ operatorToken = context.getTokenAfter(operatorToken);
+ }
+
+ context.report(
+ node,
+ operatorToken.loc.start,
+ "Unexpected string concatenation of literals.");
+ }
+ }
+ };
+};
+
+module.exports.schema = [];
diff --git a/tools/eslint/lib/rules/no-var.js b/tools/eslint/lib/rules/no-var.js
index 53d9cc27ae122b..05cb6e99eca58e 100644
--- a/tools/eslint/lib/rules/no-var.js
+++ b/tools/eslint/lib/rules/no-var.js
@@ -13,7 +13,7 @@
module.exports = function(context) {
return {
- "VariableDeclaration": function (node) {
+ "VariableDeclaration": function(node) {
if (node.kind === "var") {
context.report(node, "Unexpected var, use let or const instead.");
}
diff --git a/tools/eslint/lib/rules/no-warning-comments.js b/tools/eslint/lib/rules/no-warning-comments.js
index 5e842bc754f927..65768fe74f9e58 100644
--- a/tools/eslint/lib/rules/no-warning-comments.js
+++ b/tools/eslint/lib/rules/no-warning-comments.js
@@ -5,15 +5,18 @@
"use strict";
+var astUtils = require("../ast-utils");
+
//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------
-module.exports = function (context) {
+module.exports = function(context) {
var configuration = context.options[0] || {},
warningTerms = configuration.terms || ["todo", "fixme", "xxx"],
location = configuration.location || "start",
+ selfConfigRegEx = /\bno-warning-comments\b/,
warningRegExps;
/**
@@ -54,7 +57,7 @@ module.exports = function (context) {
function commentContainsWarningTerm(comment) {
var matches = [];
- warningRegExps.forEach(function (regex, index) {
+ warningRegExps.forEach(function(regex, index) {
if (regex.test(comment)) {
matches.push(warningTerms[index]);
}
@@ -69,10 +72,14 @@ module.exports = function (context) {
* @returns {void} undefined.
*/
function checkComment(node) {
+ if (astUtils.isDirectiveComment(node) && selfConfigRegEx.test(node.value)) {
+ return;
+ }
+
var matches = commentContainsWarningTerm(node.value);
- matches.forEach(function (matchedTerm) {
- context.report(node, "Unexpected " + matchedTerm + " comment.");
+ matches.forEach(function(matchedTerm) {
+ context.report(node, "Unexpected \"" + matchedTerm + "\" comment.");
});
}
diff --git a/tools/eslint/lib/rules/no-wrap-func.js b/tools/eslint/lib/rules/no-wrap-func.js
deleted file mode 100644
index d69a743c98e565..00000000000000
--- a/tools/eslint/lib/rules/no-wrap-func.js
+++ /dev/null
@@ -1,65 +0,0 @@
-/**
- * @fileoverview Rule to flag wrapping non-iife in parens
- * @author Ilya Volodin
- * @copyright 2013 Ilya Volodin. All rights reserved.
- */
-
-"use strict";
-
-//------------------------------------------------------------------------------
-// Rule Definition
-//------------------------------------------------------------------------------
-
-module.exports = function(context) {
-
- /**
- * Checks a function expression to see if its surrounded by parens.
- * @param {ASTNode} node The node to check.
- * @returns {void}
- * @private
- */
- function checkFunction(node) {
- var previousToken, nextToken, isCall;
-
- if (node.type === "ArrowFunctionExpression" &&
- /(?:Call|New|Logical|Binary|Conditional|Update)Expression/.test(node.parent.type)
- ) {
- return;
- }
-
- // (function() {}).foo
- if (node.parent.type === "MemberExpression" && node.parent.object === node) {
- return;
- }
-
- // (function(){})()
- isCall = /CallExpression|NewExpression/.test(node.parent.type);
- if (isCall && node.parent.callee === node) {
- return;
- }
-
- previousToken = context.getTokenBefore(node);
- nextToken = context.getTokenAfter(node);
-
- // f(function(){}) and new f(function(){})
- if (isCall) {
-
- // if the previousToken is right after the callee
- if (node.parent.callee.range[1] === previousToken.range[0]) {
- return;
- }
- }
-
- if (previousToken.value === "(" && nextToken.value === ")") {
- context.report(node, "Wrapping non-IIFE function literals in parens is unnecessary.");
- }
- }
-
- return {
- "ArrowFunctionExpression": checkFunction,
- "FunctionExpression": checkFunction
- };
-
-};
-
-module.exports.schema = [];
diff --git a/tools/eslint/lib/rules/object-curly-spacing.js b/tools/eslint/lib/rules/object-curly-spacing.js
index d4d200d36ee619..a3c68c5d89ed97 100644
--- a/tools/eslint/lib/rules/object-curly-spacing.js
+++ b/tools/eslint/lib/rules/object-curly-spacing.js
@@ -5,15 +5,20 @@
* @copyright 2014 Michael Ficarra. No rights reserved.
* @copyright 2014 Vignesh Anand. All rights reserved.
* @copyright 2015 Jamund Ferguson. All rights reserved.
+ * @copyright 2015 Toru Nagashima. All rights reserved.
+ * See LICENSE file in root directory for full license.
*/
"use strict";
+var astUtils = require("../ast-utils");
+
//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------
module.exports = function(context) {
- var spaced = context.options[0] === "always";
+ var spaced = context.options[0] === "always",
+ sourceCode = context.getSourceCode();
/**
* Determines whether an option is set, relative to the spacing option.
@@ -23,7 +28,7 @@ module.exports = function(context) {
* @returns {boolean} Whether or not the property is excluded.
*/
function isOptionSet(option) {
- return context.options[1] != null ? context.options[1][option] === !spaced : false;
+ return context.options[1] ? context.options[1][option] === !spaced : false;
}
var options = {
@@ -36,26 +41,6 @@ module.exports = function(context) {
// Helpers
//--------------------------------------------------------------------------
- /**
- * Determines whether two adjacent tokens are have whitespace between them.
- * @param {Object} left - The left token object.
- * @param {Object} right - The right token object.
- * @returns {boolean} Whether or not there is space between the tokens.
- */
- function isSpaced(left, right) {
- return left.range[1] < right.range[0];
- }
-
- /**
- * Determines whether two adjacent tokens are on the same line.
- * @param {Object} left - The left token object.
- * @param {Object} right - The right token object.
- * @returns {boolean} Whether or not the tokens are on the same line.
- */
- function isSameLine(left, right) {
- return left.loc.start.line === right.loc.start.line;
- }
-
/**
* Reports that there shouldn't be a space after the first token
* @param {ASTNode} node - The node to report in the event of an error.
@@ -63,8 +48,15 @@ module.exports = function(context) {
* @returns {void}
*/
function reportNoBeginningSpace(node, token) {
- context.report(node, token.loc.start,
- "There should be no space after '" + token.value + "'");
+ context.report({
+ node: node,
+ loc: token.loc.end,
+ message: "There should be no space after '" + token.value + "'",
+ fix: function(fixer) {
+ var nextToken = context.getSourceCode().getTokenAfter(token);
+ return fixer.removeRange([token.range[1], nextToken.range[0]]);
+ }
+ });
}
/**
@@ -74,8 +66,15 @@ module.exports = function(context) {
* @returns {void}
*/
function reportNoEndingSpace(node, token) {
- context.report(node, token.loc.start,
- "There should be no space before '" + token.value + "'");
+ context.report({
+ node: node,
+ loc: token.loc.start,
+ message: "There should be no space before '" + token.value + "'",
+ fix: function(fixer) {
+ var previousToken = context.getSourceCode().getTokenBefore(token);
+ return fixer.removeRange([previousToken.range[1], token.range[0]]);
+ }
+ });
}
/**
@@ -85,8 +84,14 @@ module.exports = function(context) {
* @returns {void}
*/
function reportRequiredBeginningSpace(node, token) {
- context.report(node, token.loc.start,
- "A space is required after '" + token.value + "'");
+ context.report({
+ node: node,
+ loc: token.loc.end,
+ message: "A space is required after '" + token.value + "'",
+ fix: function(fixer) {
+ return fixer.insertTextAfter(token, " ");
+ }
+ });
}
/**
@@ -96,8 +101,14 @@ module.exports = function(context) {
* @returns {void}
*/
function reportRequiredEndingSpace(node, token) {
- context.report(node, token.loc.start,
- "A space is required before '" + token.value + "'");
+ context.report({
+ node: node,
+ loc: token.loc.start,
+ message: "A space is required before '" + token.value + "'",
+ fix: function(fixer) {
+ return fixer.insertTextBefore(token, " ");
+ }
+ });
}
/**
@@ -113,101 +124,124 @@ module.exports = function(context) {
var closingCurlyBraceMustBeSpaced =
options.arraysInObjectsException && penultimate.value === "]" ||
options.objectsInObjectsException && penultimate.value === "}"
- ? !options.spaced : options.spaced;
+ ? !options.spaced : options.spaced,
+ firstSpaced, lastSpaced;
- if (isSameLine(first, second)) {
- if (options.spaced && !isSpaced(first, second)) {
+ if (astUtils.isTokenOnSameLine(first, second)) {
+ firstSpaced = sourceCode.isSpaceBetweenTokens(first, second);
+ if (options.spaced && !firstSpaced) {
reportRequiredBeginningSpace(node, first);
}
- if (!options.spaced && isSpaced(first, second)) {
+ if (!options.spaced && firstSpaced) {
reportNoBeginningSpace(node, first);
}
}
- if (isSameLine(penultimate, last)) {
- if (closingCurlyBraceMustBeSpaced && !isSpaced(penultimate, last)) {
+ if (astUtils.isTokenOnSameLine(penultimate, last)) {
+ lastSpaced = sourceCode.isSpaceBetweenTokens(penultimate, last);
+ if (closingCurlyBraceMustBeSpaced && !lastSpaced) {
reportRequiredEndingSpace(node, last);
}
- if (!closingCurlyBraceMustBeSpaced && isSpaced(penultimate, last)) {
+ if (!closingCurlyBraceMustBeSpaced && lastSpaced) {
reportNoEndingSpace(node, last);
}
}
}
- //--------------------------------------------------------------------------
- // Public
- //--------------------------------------------------------------------------
+ /**
+ * Reports a given object node if spacing in curly braces is invalid.
+ * @param {ASTNode} node - An ObjectExpression or ObjectPattern node to check.
+ * @returns {void}
+ */
+ function checkForObject(node) {
+ if (node.properties.length === 0) {
+ return;
+ }
- return {
+ var first = sourceCode.getFirstToken(node),
+ last = sourceCode.getLastToken(node),
+ second = sourceCode.getTokenAfter(first),
+ penultimate = sourceCode.getTokenBefore(last);
- // var {x} = y;
- ObjectPattern: function(node) {
- var firstSpecifier = node.properties[0],
- lastSpecifier = node.properties[node.properties.length - 1];
-
- var first = context.getTokenBefore(firstSpecifier),
- second = context.getFirstToken(firstSpecifier),
- penultimate = context.getLastToken(lastSpecifier),
- last = context.getTokenAfter(lastSpecifier);
-
- // support trailing commas
- if (last.value === ",") {
- penultimate = last;
- last = context.getTokenAfter(last);
- }
+ validateBraceSpacing(node, first, second, penultimate, last);
+ }
- validateBraceSpacing(node, first, second, penultimate, last);
- },
+ /**
+ * Reports a given import node if spacing in curly braces is invalid.
+ * @param {ASTNode} node - An ImportDeclaration node to check.
+ * @returns {void}
+ */
+ function checkForImport(node) {
+ if (node.specifiers.length === 0) {
+ return;
+ }
- // import {y} from 'x';
- ImportDeclaration: function(node) {
+ var firstSpecifier = node.specifiers[0],
+ lastSpecifier = node.specifiers[node.specifiers.length - 1];
- var firstSpecifier = node.specifiers[0],
- lastSpecifier = node.specifiers[node.specifiers.length - 1];
+ if (lastSpecifier.type !== "ImportSpecifier") {
+ return;
+ }
+ if (firstSpecifier.type !== "ImportSpecifier") {
+ firstSpecifier = node.specifiers[1];
+ }
- // don't do anything for namespace or default imports
- if (firstSpecifier && lastSpecifier && firstSpecifier.type === "ImportSpecifier" && lastSpecifier.type === "ImportSpecifier") {
- var first = context.getTokenBefore(firstSpecifier),
- second = context.getFirstToken(firstSpecifier),
- penultimate = context.getLastToken(lastSpecifier),
- last = context.getTokenAfter(lastSpecifier);
+ var first = sourceCode.getTokenBefore(firstSpecifier),
+ last = sourceCode.getTokenAfter(lastSpecifier);
- validateBraceSpacing(node, first, second, penultimate, last);
- }
+ // to support a trailing comma.
+ if (last.value === ",") {
+ last = sourceCode.getTokenAfter(last);
+ }
- },
+ var second = sourceCode.getTokenAfter(first),
+ penultimate = sourceCode.getTokenBefore(last);
- // export {name} from 'yo';
- ExportNamedDeclaration: function(node) {
- if (!node.specifiers.length) {
- return;
- }
+ validateBraceSpacing(node, first, second, penultimate, last);
+ }
- var firstSpecifier = node.specifiers[0],
- lastSpecifier = node.specifiers[node.specifiers.length - 1],
- first = context.getTokenBefore(firstSpecifier),
- second = context.getFirstToken(firstSpecifier),
- penultimate = context.getLastToken(lastSpecifier),
- last = context.getTokenAfter(lastSpecifier);
+ /**
+ * Reports a given export node if spacing in curly braces is invalid.
+ * @param {ASTNode} node - An ExportNamedDeclaration node to check.
+ * @returns {void}
+ */
+ function checkForExport(node) {
+ if (node.specifiers.length === 0) {
+ return;
+ }
- validateBraceSpacing(node, first, second, penultimate, last);
+ var firstSpecifier = node.specifiers[0],
+ lastSpecifier = node.specifiers[node.specifiers.length - 1],
+ first = sourceCode.getTokenBefore(firstSpecifier),
+ last = sourceCode.getTokenAfter(lastSpecifier);
- },
+ // to support a trailing comma.
+ if (last.value === ",") {
+ last = sourceCode.getTokenAfter(last);
+ }
- // var y = {x: 'y'}
- ObjectExpression: function(node) {
- if (node.properties.length === 0) {
- return;
- }
+ var second = sourceCode.getTokenAfter(first),
+ penultimate = sourceCode.getTokenBefore(last);
- var first = context.getFirstToken(node),
- second = context.getFirstToken(node, 1),
- penultimate = context.getLastToken(node, 1),
- last = context.getLastToken(node);
+ validateBraceSpacing(node, first, second, penultimate, last);
+ }
- validateBraceSpacing(node, first, second, penultimate, last);
- }
+ //--------------------------------------------------------------------------
+ // Public
+ //--------------------------------------------------------------------------
+
+ return {
+ // var {x} = y;
+ ObjectPattern: checkForObject,
+
+ // var y = {x: 'y'}
+ ObjectExpression: checkForObject,
+ // import {y} from 'x';
+ ImportDeclaration: checkForImport,
+
+ // export {name} from 'yo';
+ ExportNamedDeclaration: checkForExport
};
};
diff --git a/tools/eslint/lib/rules/object-shorthand.js b/tools/eslint/lib/rules/object-shorthand.js
index 6244332e4f73cd..078f842ffd8466 100644
--- a/tools/eslint/lib/rules/object-shorthand.js
+++ b/tools/eslint/lib/rules/object-shorthand.js
@@ -44,11 +44,12 @@ module.exports = function(context) {
return;
}
- if (node.kind === "get" || node.kind === "set") {
+ // getters, setters and computed properties are ignored
+ if (node.kind === "get" || node.kind === "set" || node.computed) {
return;
}
- if (node.value.type === "FunctionExpression" && node.value.id == null && APPLY_TO_METHODS) {
+ if (node.value.type === "FunctionExpression" && !node.value.id && APPLY_TO_METHODS) {
// {x: function(){}} should be written as {x() {}}
context.report(node, "Expected method shorthand.");
diff --git a/tools/eslint/lib/rules/one-var.js b/tools/eslint/lib/rules/one-var.js
index 1457e826cccd33..55c81143930337 100644
--- a/tools/eslint/lib/rules/one-var.js
+++ b/tools/eslint/lib/rules/one-var.js
@@ -18,7 +18,7 @@ module.exports = function(context) {
var MODE_ALWAYS = "always",
MODE_NEVER = "never";
- var mode = context.options[0];
+ var mode = context.options[0] || MODE_ALWAYS;
var options = {
};
@@ -217,6 +217,8 @@ module.exports = function(context) {
"ArrowFunctionExpression": startFunction,
"BlockStatement": startBlock,
"ForStatement": startBlock,
+ "ForInStatement": startBlock,
+ "ForOfStatement": startBlock,
"SwitchStatement": startBlock,
"VariableDeclaration": function(node) {
@@ -263,6 +265,8 @@ module.exports = function(context) {
},
"ForStatement:exit": endBlock,
+ "ForOfStatement:exit": endBlock,
+ "ForInStatement:exit": endBlock,
"SwitchStatement:exit": endBlock,
"BlockStatement:exit": endBlock,
"Program:exit": endFunction,
diff --git a/tools/eslint/lib/rules/operator-linebreak.js b/tools/eslint/lib/rules/operator-linebreak.js
index c70b09ad5c922a..d23032ea4a70fb 100644
--- a/tools/eslint/lib/rules/operator-linebreak.js
+++ b/tools/eslint/lib/rules/operator-linebreak.js
@@ -6,37 +6,41 @@
"use strict";
+var assign = require("object-assign"),
+ astUtils = require("../ast-utils");
+
//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------
module.exports = function(context) {
- var style = context.options[0] || "after";
+ var usedDefaultGlobal = !context.options[0];
+ var globalStyle = context.options[0] || "after";
+ var options = context.options[1] || {};
+ var styleOverrides = options.overrides ? assign({}, options.overrides) : {};
+
+ if (usedDefaultGlobal && !styleOverrides["?"]) {
+ styleOverrides["?"] = "before";
+ }
+
+ if (usedDefaultGlobal && !styleOverrides[":"]) {
+ styleOverrides[":"] = "before";
+ }
//--------------------------------------------------------------------------
// Helpers
//--------------------------------------------------------------------------
- /**
- * Checks whether two tokens are on the same line.
- * @param {ASTNode} left The leftmost token.
- * @param {ASTNode} right The rightmost token.
- * @returns {boolean} True if the tokens are on the same line, false if not.
- * @private
- */
- function isSameLine(left, right) {
- return left.loc.end.line === right.loc.start.line;
- }
-
/**
* Checks the operator placement
- * @param {ASTNode} node The binary operator node to check
+ * @param {ASTNode} node The node to check
+ * @param {ASTNode} leftSide The node that comes before the operator in `node`
* @private
* @returns {void}
*/
- function validateBinaryExpression(node) {
- var leftToken = context.getLastToken(node.left || node.id);
+ function validateNode(node, leftSide) {
+ var leftToken = context.getLastToken(leftSide);
var operatorToken = context.getTokenAfter(leftToken);
// When the left part of a binary expression is a single expression wrapped in
@@ -51,15 +55,16 @@ module.exports = function(context) {
var rightToken = context.getTokenAfter(operatorToken);
var operator = operatorToken.value;
+ var style = styleOverrides[operator] || globalStyle;
// if single line
- if (isSameLine(leftToken, operatorToken) &&
- isSameLine(operatorToken, rightToken)) {
+ if (astUtils.isTokenOnSameLine(leftToken, operatorToken) &&
+ astUtils.isTokenOnSameLine(operatorToken, rightToken)) {
return;
- } else if (!isSameLine(leftToken, operatorToken) &&
- !isSameLine(operatorToken, rightToken)) {
+ } else if (!astUtils.isTokenOnSameLine(leftToken, operatorToken) &&
+ !astUtils.isTokenOnSameLine(operatorToken, rightToken)) {
// lone operator
context.report(node, {
@@ -67,14 +72,14 @@ module.exports = function(context) {
column: operatorToken.loc.end.column
}, "Bad line breaking before and after '" + operator + "'.");
- } else if (style === "before" && isSameLine(leftToken, operatorToken)) {
+ } else if (style === "before" && astUtils.isTokenOnSameLine(leftToken, operatorToken)) {
context.report(node, {
line: operatorToken.loc.end.line,
column: operatorToken.loc.end.column
}, "'" + operator + "' should be placed at the beginning of the line.");
- } else if (style === "after" && isSameLine(operatorToken, rightToken)) {
+ } else if (style === "after" && astUtils.isTokenOnSameLine(operatorToken, rightToken)) {
context.report(node, {
line: operatorToken.loc.end.line,
@@ -91,6 +96,15 @@ module.exports = function(context) {
}
}
+ /**
+ * Validates a binary expression using `validateNode`
+ * @param {BinaryExpression|LogicalExpression|AssignmentExpression} node node to be validated
+ * @returns {void}
+ */
+ function validateBinaryExpression(node) {
+ validateNode(node, node.left);
+ }
+
//--------------------------------------------------------------------------
// Public
//--------------------------------------------------------------------------
@@ -99,16 +113,35 @@ module.exports = function(context) {
"BinaryExpression": validateBinaryExpression,
"LogicalExpression": validateBinaryExpression,
"AssignmentExpression": validateBinaryExpression,
- "VariableDeclarator": function (node) {
+ "VariableDeclarator": function(node) {
if (node.init) {
- validateBinaryExpression(node);
+ validateNode(node, node.id);
}
+ },
+ "ConditionalExpression": function(node) {
+ validateNode(node, node.test);
+ validateNode(node, node.consequent);
}
};
};
module.exports.schema = [
{
- "enum": ["after", "before", "none"]
+ "enum": ["after", "before", "none", null]
+ },
+ {
+ "type": "object",
+ "properties": {
+ "overrides": {
+ "type": "object",
+ "properties": {
+ "anyOf": {
+ "type": "string",
+ "enum": ["after", "before", "none"]
+ }
+ }
+ }
+ },
+ "additionalProperties": false
}
];
diff --git a/tools/eslint/lib/rules/padded-blocks.js b/tools/eslint/lib/rules/padded-blocks.js
index edb44637bea92f..56e6a7822844f5 100644
--- a/tools/eslint/lib/rules/padded-blocks.js
+++ b/tools/eslint/lib/rules/padded-blocks.js
@@ -10,12 +10,36 @@
// Rule Definition
//------------------------------------------------------------------------------
-module.exports = function (context) {
+module.exports = function(context) {
var requirePadding = context.options[0] !== "never";
var ALWAYS_MESSAGE = "Block must be padded by blank lines.",
NEVER_MESSAGE = "Block must not be padded by blank lines.";
+ /**
+ * Retrieves an array of all comments defined inside the given node.
+ * @param {ASTNode} node The AST node.
+ * @returns {ASTNode[]} An array of comment nodes.
+ */
+ function getCommentsInNode(node) {
+ var allComments = context.getAllComments();
+
+ return allComments.filter(function(comment) {
+ return node.range[0] < comment.range[0] &&
+ node.range[1] > comment.range[1];
+ });
+ }
+
+ /**
+ * Checks if the location of a node or token is before the location of another node or token
+ * @param {ASTNode|Token} a The node or token to check if its location is before b.
+ * @param {ASTNode|Token} b The node or token which will be compared with a.
+ * @returns {boolean} True if a is located before b.
+ */
+ function isLocatedBefore(a, b) {
+ return a.range[1] < b.range[0];
+ }
+
/**
* Checks if the given non empty block node has a blank line before its first child node.
* @param {ASTNode} node The AST node of a BlockStatement.
@@ -26,10 +50,11 @@ module.exports = function (context) {
first = node.body[0],
firstLine = first.loc.start.line,
expectedFirstLine = blockStart + 2,
- leadingComments = context.getComments(first).leading;
+ comments = getCommentsInNode(node),
+ firstComment = comments[0];
- if (leadingComments.length > 0) {
- firstLine = leadingComments[0].loc.start.line;
+ if (firstComment && isLocatedBefore(firstComment, first)) {
+ firstLine = firstComment.loc.start.line;
}
return expectedFirstLine <= firstLine;
@@ -43,12 +68,14 @@ module.exports = function (context) {
function isBlockBottomPadded(node) {
var blockEnd = node.loc.end.line,
last = node.body[node.body.length - 1],
- lastLine = context.getLastToken(last).loc.end.line,
+ lastToken = context.getLastToken(last),
+ lastLine = lastToken.loc.end.line,
expectedLastLine = blockEnd - 2,
- trailingComments = context.getComments(last).trailing;
+ comments = getCommentsInNode(node),
+ lastComment = comments[comments.length - 1];
- if (trailingComments.length > 0) {
- lastLine = trailingComments[trailingComments.length - 1].loc.end.line;
+ if (lastComment && isLocatedBefore(lastToken, lastComment)) {
+ lastLine = lastComment.loc.end.line;
}
return lastLine <= expectedLastLine;
diff --git a/tools/eslint/lib/rules/prefer-arrow-callback.js b/tools/eslint/lib/rules/prefer-arrow-callback.js
new file mode 100644
index 00000000000000..f7f26ca2581b99
--- /dev/null
+++ b/tools/eslint/lib/rules/prefer-arrow-callback.js
@@ -0,0 +1,206 @@
+/**
+ * @fileoverview A rule to suggest using arrow functions as callbacks.
+ * @author Toru Nagashima
+ * @copyright 2015 Toru Nagashima. All rights reserved.
+ */
+
+"use strict";
+
+//------------------------------------------------------------------------------
+// Helpers
+//------------------------------------------------------------------------------
+
+/**
+ * Checks whether or not a given variable is a function name.
+ * @param {escope.Variable} variable - A variable to check.
+ * @returns {boolean} `true` if the variable is a function name.
+ */
+function isFunctionName(variable) {
+ return variable && variable.defs[0].type === "FunctionName";
+}
+
+/**
+ * Checks whether or not a given MetaProperty node equals to a given value.
+ * @param {ASTNode} node - A MetaProperty node to check.
+ * @param {string} metaName - The name of `MetaProperty.meta`.
+ * @param {string} propertyName - The name of `MetaProperty.property`.
+ * @returns {boolean} `true` if the node is the specific value.
+ */
+function checkMetaProperty(node, metaName, propertyName) {
+ // TODO: Remove this if block after https://github.com/eslint/espree/issues/206 was fixed.
+ if (typeof node.meta === "string") {
+ return node.meta === metaName && node.property === propertyName;
+ }
+ return node.meta.name === metaName && node.property.name === propertyName;
+}
+
+/**
+ * Gets the variable object of `arguments` which is defined implicitly.
+ * @param {escope.Scope} scope - A scope to get.
+ * @returns {escope.Variable} The found variable object.
+ */
+function getVariableOfArguments(scope) {
+ var variables = scope.variables;
+ for (var i = 0; i < variables.length; ++i) {
+ var variable = variables[i];
+ if (variable.name === "arguments") {
+ // If there was a parameter which is named "arguments", the implicit "arguments" is not defined.
+ // So does fast return with null.
+ return (variable.identifiers.length === 0) ? variable : null;
+ }
+ }
+
+ /* istanbul ignore next */
+ return null;
+}
+
+/**
+ * Checkes whether or not a given node is a callback.
+ * @param {ASTNode} node - A node to check.
+ * @returns {object}
+ * {boolean} retv.isCallback - `true` if the node is a callback.
+ * {boolean} retv.isLexicalThis - `true` if the node is with `.bind(this)`.
+ */
+function getCallbackInfo(node) {
+ var retv = {isCallback: false, isLexicalThis: false};
+ var parent = node.parent;
+ while (node) {
+ switch (parent.type) {
+ // Checks parents recursively.
+ case "LogicalExpression":
+ case "ConditionalExpression":
+ break;
+
+ // Checks whether the parent node is `.bind(this)` call.
+ case "MemberExpression":
+ if (parent.object === node &&
+ !parent.property.computed &&
+ parent.property.type === "Identifier" &&
+ parent.property.name === "bind" &&
+ parent.parent.type === "CallExpression" &&
+ parent.parent.callee === parent
+ ) {
+ retv.isLexicalThis = (
+ parent.parent.arguments.length === 1 &&
+ parent.parent.arguments[0].type === "ThisExpression"
+ );
+ node = parent;
+ parent = parent.parent;
+ } else {
+ return retv;
+ }
+ break;
+
+ // Checks whether the node is a callback.
+ case "CallExpression":
+ case "NewExpression":
+ if (parent.callee !== node) {
+ retv.isCallback = true;
+ }
+ return retv;
+
+ default:
+ return retv;
+ }
+
+ node = parent;
+ parent = parent.parent;
+ }
+
+ /* istanbul ignore next */
+ throw new Error("unreachable");
+}
+
+//------------------------------------------------------------------------------
+// Rule Definition
+//------------------------------------------------------------------------------
+
+module.exports = function(context) {
+ // {Array<{this: boolean, super: boolean, meta: boolean}>}
+ // - this - A flag which shows there are one or more ThisExpression.
+ // - super - A flag which shows there are one or more Super.
+ // - meta - A flag which shows there are one or more MethProperty.
+ var stack = [];
+
+ /**
+ * Pushes new function scope with all `false` flags.
+ * @returns {void}
+ */
+ function enterScope() {
+ stack.push({this: false, super: false, meta: false});
+ }
+
+ /**
+ * Pops a function scope from the stack.
+ * @returns {{this: boolean, super: boolean, meta: boolean}} The information of the last scope.
+ */
+ function exitScope() {
+ return stack.pop();
+ }
+
+ return {
+ // Reset internal state.
+ Program: function() {
+ stack = [];
+ },
+
+ // If there are below, it cannot replace with arrow functions merely.
+ ThisExpression: function() {
+ var info = stack[stack.length - 1];
+ if (info) {
+ info.this = true;
+ }
+ },
+ Super: function() {
+ var info = stack[stack.length - 1];
+ if (info) {
+ info.super = true;
+ }
+ },
+ MetaProperty: function(node) {
+ var info = stack[stack.length - 1];
+ if (info && checkMetaProperty(node, "new", "target")) {
+ info.meta = true;
+ }
+ },
+
+ // To skip nested scopes.
+ FunctionDeclaration: enterScope,
+ "FunctionDeclaration:exit": exitScope,
+
+ // Main.
+ FunctionExpression: enterScope,
+ "FunctionExpression:exit": function(node) {
+ var scopeInfo = exitScope();
+
+ // Skip generators.
+ if (node.generator) {
+ return;
+ }
+
+ // Skip recursive functions.
+ var nameVar = context.getDeclaredVariables(node)[0];
+ if (isFunctionName(nameVar) && nameVar.references.length > 0) {
+ return;
+ }
+
+ // Skip if it's using arguments.
+ var variable = getVariableOfArguments(context.getScope());
+ if (variable && variable.references.length > 0) {
+ return;
+ }
+
+ // Reports if it's a callback which can replace with arrows.
+ var callbackInfo = getCallbackInfo(node);
+ if (callbackInfo.isCallback &&
+ (!scopeInfo.this || callbackInfo.isLexicalThis) &&
+ !scopeInfo.super &&
+ !scopeInfo.meta
+ ) {
+ context.report(node, "Unexpected function expression.");
+ }
+ }
+ };
+};
+
+module.exports.schema = [];
diff --git a/tools/eslint/lib/rules/prefer-const.js b/tools/eslint/lib/rules/prefer-const.js
index ee7eba14b7b6a4..64c239132d159a 100644
--- a/tools/eslint/lib/rules/prefer-const.js
+++ b/tools/eslint/lib/rules/prefer-const.js
@@ -50,8 +50,8 @@ module.exports = function(context) {
var references = variable.references;
var identifier = variable.identifiers[0];
- if (statement != null &&
- identifier != null &&
+ if (statement &&
+ identifier &&
declaration.type === "VariableDeclaration" &&
declaration.kind === "let" &&
(statement.type !== "ForStatement" || statement.init !== declaration) &&
@@ -75,7 +75,7 @@ module.exports = function(context) {
var pushAll = Function.apply.bind(Array.prototype.push);
return {
- "Program:exit": function () {
+ "Program:exit": function() {
var stack = [context.getScope()];
while (stack.length) {
var scope = stack.pop();
diff --git a/tools/eslint/lib/rules/prefer-reflect.js b/tools/eslint/lib/rules/prefer-reflect.js
new file mode 100644
index 00000000000000..4d320614bb0d2d
--- /dev/null
+++ b/tools/eslint/lib/rules/prefer-reflect.js
@@ -0,0 +1,100 @@
+/**
+ * @fileoverview Rule to suggest using "Reflect" api over Function/Object methods
+ * @author Keith Cirkel
+ * @copyright 2015 Keith Cirkel. All rights reserved.
+ */
+"use strict";
+
+//------------------------------------------------------------------------------
+// Rule Definition
+//------------------------------------------------------------------------------
+
+module.exports = function(context) {
+ var existingNames = {
+ "apply": "Function.prototype.apply",
+ "call": "Function.prototype.call",
+ "defineProperty": "Object.defineProperty",
+ "getOwnPropertyDescriptor": "Object.getOwnPropertyDescriptor",
+ "getPrototypeOf": "Object.getPrototypeOf",
+ "setPrototypeOf": "Object.setPrototypeOf",
+ "isExtensible": "Object.isExtensible",
+ "getOwnPropertyNames": "Object.getOwnPropertyNames",
+ "preventExtensions": "Object.preventExtensions"
+ };
+
+ var reflectSubsitutes = {
+ "apply": "Reflect.apply",
+ "call": "Reflect.apply",
+ "defineProperty": "Reflect.defineProperty",
+ "getOwnPropertyDescriptor": "Reflect.getOwnPropertyDescriptor",
+ "getPrototypeOf": "Reflect.getPrototypeOf",
+ "setPrototypeOf": "Reflect.setPrototypeOf",
+ "isExtensible": "Reflect.isExtensible",
+ "getOwnPropertyNames": "Reflect.getOwnPropertyNames",
+ "preventExtensions": "Reflect.preventExtensions"
+ };
+
+ var exceptions = (context.options[0] || {}).exceptions || [];
+
+ /**
+ * Reports the Reflect violation based on the `existing` and `substitute`
+ * @param {Object} node The node that violates the rule.
+ * @param {string} existing The existing method name that has been used.
+ * @param {string} substitute The Reflect substitute that should be used.
+ * @returns {void}
+ */
+ function report(node, existing, substitute) {
+ context.report(node, "Avoid using {{existing}}, instead use {{substitute}}", {
+ existing: existing,
+ substitute: substitute
+ });
+ }
+
+ return {
+ "CallExpression": function(node) {
+ var methodName = (node.callee.property || {}).name;
+ var isReflectCall = (node.callee.object || {}).name === "Reflect";
+ var hasReflectSubsitute = reflectSubsitutes.hasOwnProperty(methodName);
+ var userConfiguredException = exceptions.indexOf(methodName) !== -1;
+ if (hasReflectSubsitute && !isReflectCall && !userConfiguredException) {
+ report(node, existingNames[methodName], reflectSubsitutes[methodName]);
+ }
+ },
+ "UnaryExpression": function(node) {
+ var isDeleteOperator = node.operator === "delete";
+ var targetsIdentifier = node.argument.type === "Identifier";
+ var userConfiguredException = exceptions.indexOf("delete") !== -1;
+ if (isDeleteOperator && !targetsIdentifier && !userConfiguredException) {
+ report(node, "the delete keyword", "Reflect.deleteProperty");
+ }
+ }
+ };
+
+};
+
+module.exports.schema = [
+ {
+ "type": "object",
+ "properties": {
+ "exceptions": {
+ "type": "array",
+ "items": {
+ "enum": [
+ "apply",
+ "call",
+ "delete",
+ "defineProperty",
+ "getOwnPropertyDescriptor",
+ "getPrototypeOf",
+ "setPrototypeOf",
+ "isExtensible",
+ "getOwnPropertyNames",
+ "preventExtensions"
+ ]
+ },
+ "uniqueItems": true
+ }
+ },
+ "additionalProperties": false
+ }
+];
diff --git a/tools/eslint/lib/rules/prefer-spread.js b/tools/eslint/lib/rules/prefer-spread.js
new file mode 100644
index 00000000000000..fe4e2603bfbee1
--- /dev/null
+++ b/tools/eslint/lib/rules/prefer-spread.js
@@ -0,0 +1,92 @@
+/**
+ * @fileoverview A rule to suggest using of the spread operator instead of `.apply()`.
+ * @author Toru Nagashima
+ * @copyright 2015 Toru Nagashima. All rights reserved.
+ */
+
+"use strict";
+
+var astUtils = require("../ast-utils");
+
+//------------------------------------------------------------------------------
+// Helpers
+//------------------------------------------------------------------------------
+
+/**
+ * Checks whether or not a node is a `.apply()` for variadic.
+ * @param {ASTNode} node - A CallExpression node to check.
+ * @returns {boolean} Whether or not the node is a `.apply()` for variadic.
+ */
+function isVariadicApplyCalling(node) {
+ return (
+ node.callee.type === "MemberExpression" &&
+ node.callee.property.type === "Identifier" &&
+ node.callee.property.name === "apply" &&
+ node.callee.computed === false &&
+ node.arguments.length === 2 &&
+ node.arguments[1].type !== "ArrayExpression"
+ );
+}
+
+/**
+ * Checks whether or not the tokens of two given nodes are same.
+ * @param {ASTNode} left - A node 1 to compare.
+ * @param {ASTNode} right - A node 2 to compare.
+ * @param {RuleContext} context - The ESLint rule context object.
+ * @returns {boolean} the source code for the given node.
+ */
+function equalTokens(left, right, context) {
+ var tokensL = context.getTokens(left);
+ var tokensR = context.getTokens(right);
+
+ if (tokensL.length !== tokensR.length) {
+ return false;
+ }
+ for (var i = 0; i < tokensL.length; ++i) {
+ if (tokensL[i].type !== tokensR[i].type ||
+ tokensL[i].value !== tokensR[i].value
+ ) {
+ return false;
+ }
+ }
+
+ return true;
+}
+
+/**
+ * Checks whether or not `thisArg` is not changed by `.apply()`.
+ * @param {ASTNode|null} expectedThis - The node that is the owner of the applied function.
+ * @param {ASTNode} thisArg - The node that is given to the first argument of the `.apply()`.
+ * @param {RuleContext} context - The ESLint rule context object.
+ * @returns {boolean} Whether or not `thisArg` is not changed by `.apply()`.
+ */
+function isValidThisArg(expectedThis, thisArg, context) {
+ if (!expectedThis) {
+ return astUtils.isNullOrUndefined(thisArg);
+ }
+ return equalTokens(expectedThis, thisArg, context);
+}
+
+//------------------------------------------------------------------------------
+// Rule Definition
+//------------------------------------------------------------------------------
+
+module.exports = function(context) {
+ return {
+ "CallExpression": function(node) {
+ if (!isVariadicApplyCalling(node)) {
+ return;
+ }
+
+ var applied = node.callee.object;
+ var expectedThis = (applied.type === "MemberExpression") ? applied.object : null;
+ var thisArg = node.arguments[0];
+
+ if (isValidThisArg(expectedThis, thisArg, context)) {
+ context.report(node, "use the spread operator instead of the \".apply()\".");
+ }
+ }
+ };
+};
+
+module.exports.schema = [];
diff --git a/tools/eslint/lib/rules/prefer-template.js b/tools/eslint/lib/rules/prefer-template.js
new file mode 100644
index 00000000000000..7cb4e03e79c4d8
--- /dev/null
+++ b/tools/eslint/lib/rules/prefer-template.js
@@ -0,0 +1,96 @@
+/**
+ * @fileoverview A rule to suggest using template literals instead of string concatenation.
+ * @author Toru Nagashima
+ * @copyright 2015 Toru Nagashima. All rights reserved.
+ */
+
+"use strict";
+
+//------------------------------------------------------------------------------
+// Requirements
+//------------------------------------------------------------------------------
+
+var astUtils = require("../ast-utils");
+
+//------------------------------------------------------------------------------
+// Helpers
+//------------------------------------------------------------------------------
+
+/**
+ * Checks whether or not a given node is a concatenation.
+ * @param {ASTNode} node - A node to check.
+ * @returns {boolean} `true` if the node is a concatenation.
+ */
+function isConcatenation(node) {
+ return node.type === "BinaryExpression" && node.operator === "+";
+}
+
+/**
+ * Gets the top binary expression node for concatenation in parents of a given node.
+ * @param {ASTNode} node - A node to get.
+ * @returns {ASTNode} the top binary expression node in parents of a given node.
+ */
+function getTopConcatBinaryExpression(node) {
+ while (isConcatenation(node.parent)) {
+ node = node.parent;
+ }
+ return node;
+}
+
+/**
+ * Checks whether or not a given binary expression has non string literals.
+ * @param {ASTNode} node - A node to check.
+ * @returns {boolean} `true` if the node has non string literals.
+ */
+function hasNonStringLiteral(node) {
+ if (isConcatenation(node)) {
+ // `left` is deeper than `right` normally.
+ return hasNonStringLiteral(node.right) || hasNonStringLiteral(node.left);
+ }
+ return !astUtils.isStringLiteral(node);
+}
+
+//------------------------------------------------------------------------------
+// Rule Definition
+//------------------------------------------------------------------------------
+
+module.exports = function(context) {
+ var done = Object.create(null);
+
+ /**
+ * Reports if a given node is string concatenation with non string literals.
+ *
+ * @param {ASTNode} node - A node to check.
+ * @returns {void}
+ */
+ function checkForStringConcat(node) {
+ if (!astUtils.isStringLiteral(node) || !isConcatenation(node.parent)) {
+ return;
+ }
+
+ var topBinaryExpr = getTopConcatBinaryExpression(node.parent);
+
+ // Checks whether or not this node had been checked already.
+ if (done[topBinaryExpr.range[0]]) {
+ return;
+ }
+ done[topBinaryExpr.range[0]] = true;
+
+ if (hasNonStringLiteral(topBinaryExpr)) {
+ context.report(
+ topBinaryExpr,
+ "Unexpected string concatenation.");
+ }
+ }
+
+ return {
+ Program: function() {
+ done = Object.create(null);
+ },
+
+ Literal: checkForStringConcat,
+ TemplateLiteral: checkForStringConcat
+ };
+};
+
+module.exports.schema = [];
diff --git a/tools/eslint/lib/rules/quote-props.js b/tools/eslint/lib/rules/quote-props.js
index 225dbfe8f86acf..29ce2370417949 100644
--- a/tools/eslint/lib/rules/quote-props.js
+++ b/tools/eslint/lib/rules/quote-props.js
@@ -2,6 +2,7 @@
* @fileoverview Rule to flag non-quoted property names in object literals.
* @author Mathias Bynens
* @copyright 2014 Brandon Mills. All rights reserved.
+ * @copyright 2015 Tomasz Olędzki. All rights reserved.
*/
"use strict";
@@ -9,7 +10,8 @@
// Requirements
//------------------------------------------------------------------------------
-var espree = require("espree");
+var espree = require("espree"),
+ keywords = require("../util/keywords");
//------------------------------------------------------------------------------
// Rule Definition
@@ -17,17 +19,53 @@ var espree = require("espree");
module.exports = function(context) {
- var MODE = context.options[0];
+ var MODE = context.options[0],
+ KEYWORDS = context.options[1] && context.options[1].keywords,
+ CHECK_UNNECESSARY = !context.options[1] || context.options[1].unnecessary !== false,
+ NUMBERS = context.options[1] && context.options[1].numbers,
+
+ MESSAGE_UNNECESSARY = "Unnecessarily quoted property `{{property}}` found.",
+ MESSAGE_UNQUOTED = "Unquoted property `{{property}}` found.",
+ MESSAGE_NUMERIC = "Unquoted number literal `{{property}}` used as key.",
+ MESSAGE_RESERVED = "Unquoted reserved word `{{property}}` used as key.";
+
+
+ /**
+ * Checks whether a certain string constitutes an ES3 token
+ * @param {string} tokenStr - The string to be checked.
+ * @returns {boolean} `true` if it is an ES3 token.
+ */
+ function isKeyword(tokenStr) {
+ return keywords.indexOf(tokenStr) >= 0;
+ }
+
+ /**
+ * Checks if an espree-tokenized key has redundant quotes (i.e. whether quotes are unnecessary)
+ * @param {espreeTokens} tokens The espree-tokenized node key
+ * @param {boolean} [skipNumberLiterals=false] Indicates whether number literals should be checked
+ * @returns {boolean} Whether or not a key has redundant quotes.
+ * @private
+ */
+ function areQuotesRedundant(tokens, skipNumberLiterals) {
+ return tokens.length === 1 &&
+ (["Identifier", "Keyword", "Null", "Boolean"].indexOf(tokens[0].type) >= 0 ||
+ (tokens[0].type === "Numeric" && !skipNumberLiterals && "" + +tokens[0].value === tokens[0].value));
+ }
/**
* Ensures that a property's key is quoted only when necessary
* @param {ASTNode} node Property AST node
* @returns {void}
*/
- function asNeeded(node) {
+ function checkUnnecessaryQuotes(node) {
var key = node.key,
+ isKeywordToken,
tokens;
+ if (node.method || node.computed || node.shorthand) {
+ return;
+ }
+
if (key.type === "Literal" && typeof key.value === "string") {
try {
tokens = espree.tokenize(key.value);
@@ -35,12 +73,23 @@ module.exports = function(context) {
return;
}
- if (tokens.length === 1 &&
- (["Identifier", "Null", "Boolean"].indexOf(tokens[0].type) >= 0 ||
- (tokens[0].type === "Numeric" && "" + +tokens[0].value === tokens[0].value))
- ) {
- context.report(node, "Unnecessarily quoted property `{{value}}` found.", key);
+ if (tokens.length !== 1) {
+ return;
+ }
+
+ isKeywordToken = isKeyword(tokens[0].value);
+
+ if (isKeywordToken && KEYWORDS) {
+ return;
}
+
+ if (CHECK_UNNECESSARY && areQuotesRedundant(tokens, NUMBERS)) {
+ context.report(node, MESSAGE_UNNECESSARY, {property: key.value});
+ }
+ } else if (KEYWORDS && key.type === "Identifier" && isKeyword(key.name)) {
+ context.report(node, MESSAGE_RESERVED, {property: key.name});
+ } else if (NUMBERS && key.type === "Literal" && typeof key.value === "number") {
+ context.report(node, MESSAGE_NUMERIC, {property: key.value});
}
}
@@ -49,24 +98,131 @@ module.exports = function(context) {
* @param {ASTNode} node Property AST node
* @returns {void}
*/
- function always(node) {
+ function checkOmittedQuotes(node) {
var key = node.key;
- if (!node.method && !(key.type === "Literal" && typeof key.value === "string")) {
- context.report(node, "Unquoted property `{{key}}` found.", {
- key: key.name || key.value
+ if (!node.method && !node.computed && !node.shorthand && !(key.type === "Literal" && typeof key.value === "string")) {
+ context.report(node, MESSAGE_UNQUOTED, {
+ property: key.name || key.value
});
}
}
+ /**
+ * Ensures that an object's keys are consistently quoted, optionally checks for redundancy of quotes
+ * @param {ASTNode} node Property AST node
+ * @param {boolean} checkQuotesRedundancy Whether to check quotes' redundancy
+ * @returns {void}
+ */
+ function checkConsistency(node, checkQuotesRedundancy) {
+ var quotes = false,
+ lackOfQuotes = false,
+ necessaryQuotes = false;
+
+ node.properties.forEach(function(property) {
+ var key = property.key,
+ tokens;
+
+ if (!key || property.method || property.computed || property.shorthand) {
+ return;
+ }
+
+ if (key.type === "Literal" && typeof key.value === "string") {
+
+ quotes = true;
+
+ if (checkQuotesRedundancy) {
+ try {
+ tokens = espree.tokenize(key.value);
+ } catch (e) {
+ necessaryQuotes = true;
+ return;
+ }
+
+ necessaryQuotes = necessaryQuotes || !areQuotesRedundant(tokens) || KEYWORDS && isKeyword(tokens[0].value);
+ }
+ } else if (KEYWORDS && checkQuotesRedundancy && key.type === "Identifier" && isKeyword(key.name)) {
+ necessaryQuotes = true;
+ context.report(node, "Properties should be quoted as `{{property}}` is a reserved word.", {property: key.name});
+ } else {
+ lackOfQuotes = true;
+ }
+
+ if (quotes && lackOfQuotes) {
+ context.report(node, "Inconsistently quoted property `{{key}}` found.", {
+ key: key.name || key.value
+ });
+ }
+ });
+
+ if (checkQuotesRedundancy && quotes && !necessaryQuotes) {
+ context.report(node, "Properties shouldn't be quoted as all quotes are redundant.");
+ }
+ }
+
return {
- "Property": MODE === "as-needed" ? asNeeded : always
+ "Property": function(node) {
+ if (MODE === "always" || !MODE) {
+ checkOmittedQuotes(node);
+ }
+ if (MODE === "as-needed") {
+ checkUnnecessaryQuotes(node);
+ }
+ },
+ "ObjectExpression": function(node) {
+ if (MODE === "consistent") {
+ checkConsistency(node, false);
+ }
+ if (MODE === "consistent-as-needed") {
+ checkConsistency(node, true);
+ }
+ }
};
};
-module.exports.schema = [
- {
- "enum": ["always", "as-needed"]
- }
-];
+module.exports.schema = {
+ "anyOf": [
+ {
+ "type": "array",
+ "items": [
+ {
+ "enum": [0, 1, 2]
+ },
+ {
+ "enum": ["always", "as-needed", "consistent", "consistent-as-needed"]
+ }
+ ],
+ "minItems": 1,
+ "maxItems": 2
+ },
+ {
+ "type": "array",
+ "items": [
+ {
+ "enum": [0, 1, 2]
+ },
+ {
+ "enum": ["always", "as-needed", "consistent", "consistent-as-needed"]
+ },
+ {
+ "type": "object",
+ "properties": {
+ "keywords": {
+ "type": "boolean"
+ },
+ "unnecessary": {
+ "type": "boolean"
+ },
+ "numbers": {
+ "type": "boolean"
+ }
+ },
+ "additionalProperties": false
+ }
+ ],
+ "minItems": 1,
+ "maxItems": 3
+ }
+ ]
+};
diff --git a/tools/eslint/lib/rules/quotes.js b/tools/eslint/lib/rules/quotes.js
index 7d4626b9aedc13..6f12add2fdfe6f 100644
--- a/tools/eslint/lib/rules/quotes.js
+++ b/tools/eslint/lib/rules/quotes.js
@@ -1,10 +1,18 @@
/**
* @fileoverview A rule to choose between single and double quote marks
* @author Matt DuVall , Brandon Payton
+ * @copyright 2013 Matt DuVall. All rights reserved.
+ * See LICENSE file in root directory for full license.
*/
"use strict";
+//------------------------------------------------------------------------------
+// Requirements
+//------------------------------------------------------------------------------
+
+var astUtils = require("../ast-utils");
+
//------------------------------------------------------------------------------
// Constants
//------------------------------------------------------------------------------
@@ -26,34 +34,126 @@ var QUOTE_SETTINGS = {
description: "backtick"
}
};
+/**
+ * Switches quoting of javascript string between ' " and `
+ * escaping and unescaping as necessary.
+ * Only escaping of the minimal set of characters is changed.
+ * Note: escaping of newlines when switching from backtick to other quotes is not handled.
+ * @param {string} str - A string to convert.
+ * @returns {string} The string with changed quotes.
+ * @private
+ */
+QUOTE_SETTINGS.double.convert =
+QUOTE_SETTINGS.single.convert =
+QUOTE_SETTINGS.backtick.convert = function(str) {
+ var newQuote = this.quote;
+ var oldQuote = str[0];
+ if (newQuote === oldQuote) {
+ return str;
+ }
+ return newQuote + str.slice(1, -1).replace(/\\(\${|\r\n?|\n|.)|["'`]|\${|(\r\n?|\n)/g, function(match, escaped, newline) {
+ if (escaped === oldQuote || oldQuote === "`" && escaped === "${") {
+ return escaped; // unescape
+ }
+ if (match === newQuote || newQuote === "`" && match === "${") {
+ return "\\" + match; // escape
+ }
+ if (newline && oldQuote === "`") {
+ return "\\n"; // escape newlines
+ }
+ return match;
+ }) + newQuote;
+};
-var AVOID_ESCAPE = "avoid-escape";
+var AVOID_ESCAPE = "avoid-escape",
+ FUNCTION_TYPE = /^(?:Arrow)?Function(?:Declaration|Expression)$/;
//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------
module.exports = function(context) {
+ /**
+ * Determines if a given node is part of JSX syntax.
+ * @param {ASTNode} node The node to check.
+ * @returns {boolean} True if the node is a JSX node, false if not.
+ * @private
+ */
+ function isJSXElement(node) {
+ return node.type.indexOf("JSX") === 0;
+ }
/**
- * Validate that a string passed in is surrounded by the specified character
- * @param {string} val The text to check.
- * @param {string} character The character to see if it's surrounded by.
- * @returns {boolean} True if the text is surrounded by the character, false if not.
+ * Checks whether or not a given node is a directive.
+ * The directive is a `ExpressionStatement` which has only a string literal.
+ * @param {ASTNode} node - A node to check.
+ * @returns {boolean} Whether or not the node is a directive.
* @private
*/
- function isSurroundedBy(val, character) {
- return val[0] === character && val[val.length - 1] === character;
+ function isDirective(node) {
+ return (
+ node.type === "ExpressionStatement" &&
+ node.expression.type === "Literal" &&
+ typeof node.expression.value === "string"
+ );
}
/**
- * Determines if a given node is part of JSX syntax.
- * @param {ASTNode} node The node to check.
- * @returns {boolean} True if the node is a JSX node, false if not.
+ * Checks whether or not a given node is a part of directive prologues.
+ * See also: http://www.ecma-international.org/ecma-262/6.0/#sec-directive-prologues-and-the-use-strict-directive
+ * @param {ASTNode} node - A node to check.
+ * @returns {boolean} Whether or not the node is a part of directive prologues.
* @private
*/
- function isJSXElement(node) {
- return node.type.indexOf("JSX") === 0;
+ function isPartOfDirectivePrologue(node) {
+ var block = node.parent.parent;
+ if (block.type !== "Program" && (block.type !== "BlockStatement" || !FUNCTION_TYPE.test(block.parent.type))) {
+ return false;
+ }
+
+ // Check the node is at a prologue.
+ for (var i = 0; i < block.body.length; ++i) {
+ var statement = block.body[i];
+
+ if (statement === node.parent) {
+ return true;
+ }
+ if (!isDirective(statement)) {
+ break;
+ }
+ }
+
+ return false;
+ }
+
+ /**
+ * Checks whether or not a given node is allowed as non backtick.
+ * @param {ASTNode} node - A node to check.
+ * @returns {boolean} Whether or not the node is allowed as non backtick.
+ * @private
+ */
+ function isAllowedAsNonBacktick(node) {
+ var parent = node.parent;
+
+ switch (parent.type) {
+ // Directive Prologues.
+ case "ExpressionStatement":
+ return isPartOfDirectivePrologue(node);
+
+ // LiteralPropertyName.
+ case "Property":
+ return parent.key === node && !parent.computed;
+
+ // ModuleSpecifier.
+ case "ImportDeclaration":
+ case "ExportNamedDeclaration":
+ case "ExportAllDeclaration":
+ return parent.source === node;
+
+ // Others don't allow.
+ default:
+ return false;
+ }
}
return {
@@ -67,14 +167,20 @@ module.exports = function(context) {
isValid;
if (settings && typeof val === "string") {
- isValid = isJSXElement(node.parent) || isSurroundedBy(rawVal, settings.quote);
+ isValid = (quoteOption === "backtick" && isAllowedAsNonBacktick(node)) || isJSXElement(node.parent) || astUtils.isSurroundedBy(rawVal, settings.quote);
if (!isValid && avoidEscape) {
- isValid = isSurroundedBy(rawVal, settings.alternateQuote) && rawVal.indexOf(settings.quote) >= 0;
+ isValid = astUtils.isSurroundedBy(rawVal, settings.alternateQuote) && rawVal.indexOf(settings.quote) >= 0;
}
if (!isValid) {
- context.report(node, "Strings must use " + settings.description + ".");
+ context.report({
+ node: node,
+ message: "Strings must use " + settings.description + ".",
+ fix: function(fixer) {
+ return fixer.replaceText(node, settings.convert(node.raw));
+ }
+ });
}
}
}
diff --git a/tools/eslint/lib/rules/radix.js b/tools/eslint/lib/rules/radix.js
index ac93b9e60788f3..9ec5231fddad1b 100644
--- a/tools/eslint/lib/rules/radix.js
+++ b/tools/eslint/lib/rules/radix.js
@@ -11,31 +11,66 @@
module.exports = function(context) {
+ var MODE_ALWAYS = "always",
+ MODE_AS_NEEDED = "as-needed";
+
+ var mode = context.options[0] || MODE_ALWAYS;
+
return {
"CallExpression": function(node) {
var radix;
- if (node.callee.name === "parseInt") {
+ if (!(node.callee.name === "parseInt" || (
+ node.callee.type === "MemberExpression" &&
+ node.callee.object.name === "Number" &&
+ node.callee.property.name === "parseInt"
+ )
+ )) {
+ return;
+ }
- if (node.arguments.length < 2) {
- context.report(node, "Missing radix parameter.");
- } else {
+ if (node.arguments.length === 0) {
+ context.report({
+ node: node,
+ message: "Missing parameters."
+ });
+ } else if (node.arguments.length < 2 && mode === MODE_ALWAYS) {
+ context.report({
+ node: node,
+ message: "Missing radix parameter."
+ });
+ } else if (node.arguments.length > 1 && mode === MODE_AS_NEEDED &&
+ (node.arguments[1] && node.arguments[1].type === "Literal" &&
+ node.arguments[1].value === 10)
+ ) {
+ context.report({
+ node: node,
+ message: "Redundant radix parameter."
+ });
+ } else {
- radix = node.arguments[1];
+ radix = node.arguments[1];
- // don't allow non-numeric literals or undefined
- if ((radix.type === "Literal" && typeof radix.value !== "number") ||
- (radix.type === "Identifier" && radix.name === "undefined")
- ) {
- context.report(node, "Invalid radix parameter.");
- }
+ // don't allow non-numeric literals or undefined
+ if (radix &&
+ ((radix.type === "Literal" && typeof radix.value !== "number") ||
+ (radix.type === "Identifier" && radix.name === "undefined"))
+ ) {
+ context.report({
+ node: node,
+ message: "Invalid radix parameter."
+ });
}
-
}
+
}
};
};
-module.exports.schema = [];
+module.exports.schema = [
+ {
+ "enum": ["always", "as-needed"]
+ }
+];
diff --git a/tools/eslint/lib/rules/require-jsdoc.js b/tools/eslint/lib/rules/require-jsdoc.js
new file mode 100644
index 00000000000000..79379140bc79e6
--- /dev/null
+++ b/tools/eslint/lib/rules/require-jsdoc.js
@@ -0,0 +1,97 @@
+/**
+ * @fileoverview Rule to check for jsdoc presence.
+ * @author Gyandeep Singh
+ * @copyright 2015 Gyandeep Singh. All rights reserved.
+ */
+"use strict";
+
+var assign = require("object-assign");
+
+module.exports = function(context) {
+ var source = context.getSourceCode();
+ var DEFAULT_OPTIONS = {
+ "FunctionDeclaration": true,
+ "MethodDefinition": false,
+ "ClassDeclaration": false
+ };
+ var options = assign(DEFAULT_OPTIONS, context.options[0] && context.options[0].require || {});
+
+ /**
+ * Report the error message
+ * @param {ASTNode} node node to report
+ * @returns {void}
+ */
+ function report(node) {
+ context.report(node, "Missing JSDoc comment.");
+ }
+
+ /**
+ * Check if the jsdoc comment is present for class methods
+ * @param {ASTNode} node node to examine
+ * @returns {void}
+ */
+ function checkClassMethodJsDoc(node) {
+ if (node.parent.type === "MethodDefinition") {
+ var jsdocComment = source.getJSDocComment(node);
+
+ if (!jsdocComment) {
+ report(node);
+ }
+ }
+ }
+
+ /**
+ * Check if the jsdoc comment is present or not.
+ * @param {ASTNode} node node to examine
+ * @returns {void}
+ */
+ function checkJsDoc(node) {
+ var jsdocComment = source.getJSDocComment(node);
+
+ if (!jsdocComment) {
+ report(node);
+ }
+ }
+
+ return {
+ "FunctionDeclaration": function(node) {
+ if (options.FunctionDeclaration) {
+ checkJsDoc(node);
+ }
+ },
+ "FunctionExpression": function(node) {
+ if (options.MethodDefinition) {
+ checkClassMethodJsDoc(node);
+ }
+ },
+ "ClassDeclaration": function(node) {
+ if (options.ClassDeclaration) {
+ checkJsDoc(node);
+ }
+ }
+ };
+};
+
+module.exports.schema = [
+ {
+ "type": "object",
+ "properties": {
+ "require": {
+ "type": "object",
+ "properties": {
+ "ClassDeclaration": {
+ "type": "boolean"
+ },
+ "MethodDefinition": {
+ "type": "boolean"
+ },
+ "FunctionDeclaration": {
+ "type": "boolean"
+ }
+ },
+ "additionalProperties": false
+ }
+ },
+ "additionalProperties": false
+ }
+];
diff --git a/tools/eslint/lib/rules/require-yield.js b/tools/eslint/lib/rules/require-yield.js
new file mode 100644
index 00000000000000..f7a0d40c58fac5
--- /dev/null
+++ b/tools/eslint/lib/rules/require-yield.js
@@ -0,0 +1,62 @@
+/**
+ * @fileoverview Rule to flag the generator functions that does not have yield.
+ * @author Toru Nagashima
+ * @copyright 2015 Toru Nagashima. All rights reserved.
+ */
+
+"use strict";
+
+//------------------------------------------------------------------------------
+// Rule Definition
+//------------------------------------------------------------------------------
+
+module.exports = function(context) {
+ var stack = [];
+
+ /**
+ * If the node is a generator function, start counting `yield` keywords.
+ * @param {Node} node - A function node to check.
+ * @returns {void}
+ */
+ function beginChecking(node) {
+ if (node.generator) {
+ stack.push(0);
+ }
+ }
+
+ /**
+ * If the node is a generator function, end counting `yield` keywords, then
+ * reports result.
+ * @param {Node} node - A function node to check.
+ * @returns {void}
+ */
+ function endChecking(node) {
+ if (!node.generator) {
+ return;
+ }
+
+ var countYield = stack.pop();
+ if (countYield === 0 && node.body.body.length > 0) {
+ context.report(
+ node,
+ "This generator function does not have `yield`.");
+ }
+ }
+
+ return {
+ "FunctionDeclaration": beginChecking,
+ "FunctionDeclaration:exit": endChecking,
+ "FunctionExpression": beginChecking,
+ "FunctionExpression:exit": endChecking,
+
+ // Increases the count of `yield` keyword.
+ "YieldExpression": function() {
+ /* istanbul ignore else */
+ if (stack.length > 0) {
+ stack[stack.length - 1] += 1;
+ }
+ }
+ };
+};
+
+module.exports.schema = [];
diff --git a/tools/eslint/lib/rules/semi-spacing.js b/tools/eslint/lib/rules/semi-spacing.js
index fddebfcf3296fa..7164d5b6aeb235 100644
--- a/tools/eslint/lib/rules/semi-spacing.js
+++ b/tools/eslint/lib/rules/semi-spacing.js
@@ -6,15 +6,18 @@
"use strict";
+var astUtils = require("../ast-utils");
+
//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------
-module.exports = function (context) {
+module.exports = function(context) {
var config = context.options[0],
requireSpaceBefore = false,
- requireSpaceAfter = true;
+ requireSpaceAfter = true,
+ sourceCode = context.getSourceCode();
if (typeof config === "object") {
if (config.hasOwnProperty("before")) {
@@ -25,27 +28,6 @@ module.exports = function (context) {
}
}
- /**
- * Determines whether two adjacent tokens have whitespace between them.
- * @param {Object} left - The left token object.
- * @param {Object} right - The right token object.
- * @returns {boolean} Whether or not there is space between the tokens.
- */
- function isSpaced(left, right) {
- return left.range[1] < right.range[0];
- }
-
- /**
- * Checks whether two tokens are on the same line.
- * @param {Object} left The leftmost token.
- * @param {Object} right The rightmost token.
- * @returns {boolean} True if the tokens are on the same line, false if not.
- * @private
- */
- function isSameLine(left, right) {
- return left.loc.end.line === right.loc.start.line;
- }
-
/**
* Checks if a given token has leading whitespace.
* @param {Object} token The token to check.
@@ -53,7 +35,7 @@ module.exports = function (context) {
*/
function hasLeadingSpace(token) {
var tokenBefore = context.getTokenBefore(token);
- return tokenBefore && isSameLine(tokenBefore, token) && isSpaced(tokenBefore, token);
+ return tokenBefore && astUtils.isTokenOnSameLine(tokenBefore, token) && sourceCode.isSpaceBetweenTokens(tokenBefore, token);
}
/**
@@ -63,7 +45,7 @@ module.exports = function (context) {
*/
function hasTrailingSpace(token) {
var tokenAfter = context.getTokenAfter(token);
- return tokenAfter && isSameLine(token, tokenAfter) && isSpaced(token, tokenAfter);
+ return tokenAfter && astUtils.isTokenOnSameLine(token, tokenAfter) && sourceCode.isSpaceBetweenTokens(token, tokenAfter);
}
/**
@@ -73,7 +55,31 @@ module.exports = function (context) {
*/
function isLastTokenInCurrentLine(token) {
var tokenAfter = context.getTokenAfter(token);
- return !(tokenAfter && isSameLine(token, tokenAfter));
+ return !(tokenAfter && astUtils.isTokenOnSameLine(token, tokenAfter));
+ }
+
+ /**
+ * Checks if the given token is the first token in its line
+ * @param {Token} token The token to check.
+ * @returns {boolean} Whether or not the token is the first in its line.
+ */
+ function isFirstTokenInCurrentLine(token) {
+ var tokenBefore = context.getTokenBefore(token);
+ return !(tokenBefore && astUtils.isTokenOnSameLine(token, tokenBefore));
+ }
+
+ /**
+ * Checks if the next token of a given token is a closing parenthesis.
+ * @param {Token} token The token to check.
+ * @returns {boolean} Whether or not the next token of a given token is a closing parenthesis.
+ */
+ function isBeforeClosingParen(token) {
+ var nextToken = context.getTokenAfter(token);
+ return (
+ nextToken &&
+ nextToken.type === "Punctuator" &&
+ (nextToken.value === "}" || nextToken.value === ")")
+ );
}
/**
@@ -107,7 +113,7 @@ module.exports = function (context) {
}
}
- if (!isLastTokenInCurrentLine(token)) {
+ if (!isFirstTokenInCurrentLine(token) && !isLastTokenInCurrentLine(token) && !isBeforeClosingParen(token)) {
if (hasTrailingSpace(token)) {
if (!requireSpaceAfter) {
context.report(node, location, "Unexpected whitespace after semicolon.");
@@ -139,7 +145,7 @@ module.exports = function (context) {
"DebuggerStatement": checkNode,
"ReturnStatement": checkNode,
"ThrowStatement": checkNode,
- "ForStatement": function (node) {
+ "ForStatement": function(node) {
if (node.init) {
checkSemicolonSpacing(context.getTokenAfter(node.init), node);
}
diff --git a/tools/eslint/lib/rules/semi.js b/tools/eslint/lib/rules/semi.js
index 7cd19632f55ba3..f20902b5deb43a 100644
--- a/tools/eslint/lib/rules/semi.js
+++ b/tools/eslint/lib/rules/semi.js
@@ -1,17 +1,21 @@
/**
* @fileoverview Rule to flag missing semicolons.
* @author Nicholas C. Zakas
+ * @copyright 2013 Nicholas C. Zakas. All rights reserved.
+ * See LICENSE file in root directory for full license.
*/
"use strict";
//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------
+
module.exports = function(context) {
var OPT_OUT_PATTERN = /[\[\(\/\+\-]/; // One of [(/+-
- var always = context.options[0] !== "never";
+ var always = context.options[0] !== "never",
+ sourceCode = context.getSourceCode();
//--------------------------------------------------------------------------
// Helpers
@@ -23,8 +27,32 @@ module.exports = function(context) {
* @returns {void}
*/
function report(node) {
- var message = always ? "Missing semicolon." : "Extra semicolon.";
- context.report(node, context.getLastToken(node).loc.end, message);
+ var message,
+ fix,
+ lastToken = sourceCode.getLastToken(node),
+ loc = lastToken.loc;
+
+ if (always) {
+ message = "Missing semicolon.";
+ loc = loc.end;
+ fix = function(fixer) {
+ return fixer.insertTextAfter(lastToken, ";");
+ };
+ } else {
+ message = "Extra semicolon.";
+ loc = loc.start;
+ fix = function(fixer) {
+ return fixer.remove(lastToken);
+ };
+ }
+
+ context.report({
+ node: node,
+ loc: loc,
+ message: message,
+ fix: fix
+ });
+
}
/**
@@ -110,17 +138,18 @@ module.exports = function(context) {
"ExpressionStatement": checkForSemicolon,
"ReturnStatement": checkForSemicolon,
"ThrowStatement": checkForSemicolon,
+ "DoWhileStatement": checkForSemicolon,
"DebuggerStatement": checkForSemicolon,
"BreakStatement": checkForSemicolon,
"ContinueStatement": checkForSemicolon,
"ImportDeclaration": checkForSemicolon,
"ExportAllDeclaration": checkForSemicolon,
- "ExportNamedDeclaration": function (node) {
+ "ExportNamedDeclaration": function(node) {
if (!node.declaration) {
checkForSemicolon(node);
}
},
- "ExportDefaultDeclaration": function (node) {
+ "ExportDefaultDeclaration": function(node) {
if (!/(?:Class|Function)Declaration/.test(node.declaration.type)) {
checkForSemicolon(node);
}
diff --git a/tools/eslint/lib/rules/sort-vars.js b/tools/eslint/lib/rules/sort-vars.js
index 0a699f2ccda3a4..9aa85c8cbd09e2 100644
--- a/tools/eslint/lib/rules/sort-vars.js
+++ b/tools/eslint/lib/rules/sort-vars.js
@@ -17,6 +17,10 @@ module.exports = function(context) {
return {
"VariableDeclaration": function(node) {
node.declarations.reduce(function(memo, decl) {
+ if (decl.id.type === "ObjectPattern" || decl.id.type === "ArrayPattern") {
+ return memo;
+ }
+
var lastVariableName = memo.id.name,
currenVariableName = decl.id.name;
diff --git a/tools/eslint/lib/rules/space-after-function-name.js b/tools/eslint/lib/rules/space-after-function-name.js
deleted file mode 100644
index 15d2286a2ad552..00000000000000
--- a/tools/eslint/lib/rules/space-after-function-name.js
+++ /dev/null
@@ -1,49 +0,0 @@
-/**
- * @fileoverview Rule to enforce consistent spacing after function names
- * @author Roberto Vidal
- * @copyright 2014 Roberto Vidal. All rights reserved.
- */
-"use strict";
-
-//------------------------------------------------------------------------------
-// Rule Definition
-//------------------------------------------------------------------------------
-
-module.exports = function(context) {
-
- var requiresSpace = context.options[0] === "always";
-
- /**
- * Reports if the give named function node has the correct spacing after its name
- *
- * @param {ASTNode} node The node to which the potential problem belongs.
- * @returns {void}
- */
- function check(node) {
- var tokens = context.getFirstTokens(node, 3),
- hasSpace = tokens[1].range[1] < tokens[2].range[0];
-
- if (hasSpace !== requiresSpace) {
- context.report(node, "Function name \"{{name}}\" must {{not}}be followed by whitespace.", {
- name: node.id.name,
- not: requiresSpace ? "" : "not "
- });
- }
- }
-
- return {
- "FunctionDeclaration": check,
- "FunctionExpression": function (node) {
- if (node.id) {
- check(node);
- }
- }
- };
-
-};
-
-module.exports.schema = [
- {
- "enum": ["always", "never"]
- }
-];
diff --git a/tools/eslint/lib/rules/space-after-keywords.js b/tools/eslint/lib/rules/space-after-keywords.js
index 007f80ca7158a8..eeed6d2a60a675 100644
--- a/tools/eslint/lib/rules/space-after-keywords.js
+++ b/tools/eslint/lib/rules/space-after-keywords.js
@@ -23,13 +23,45 @@ module.exports = function(context) {
* @returns {void}
*/
function checkTokens(node, left, right) {
+ if (right.type !== "Punctuator") {
+ return;
+ }
+
var hasSpace = left.range[1] < right.range[0],
value = left.value;
if (hasSpace !== requiresSpace) {
- context.report(node, "Keyword \"{{value}}\" must {{not}}be followed by whitespace.", {
- value: value,
- not: requiresSpace ? "" : "not "
+ context.report({
+ node: node,
+ loc: left.loc.end,
+ message: "Keyword \"{{value}}\" must {{not}}be followed by whitespace.",
+ data: {
+ value: value,
+ not: requiresSpace ? "" : "not "
+ },
+ fix: function(fixer) {
+ if (requiresSpace) {
+ return fixer.insertTextAfter(left, " ");
+ } else {
+ return fixer.removeRange([left.range[1], right.range[0]]);
+ }
+ }
+ });
+ } else if (left.loc.end.line !== right.loc.start.line) {
+ context.report({
+ node: node,
+ loc: left.loc.end,
+ message: "Keyword \"{{value}}\" must not be followed by a newline.",
+ data: {
+ value: value
+ },
+ fix: function(fixer) {
+ var text = "";
+ if (requiresSpace) {
+ text = " ";
+ }
+ return fixer.replaceTextRange([left.range[1], right.range[0]], text);
+ }
});
}
}
@@ -45,7 +77,7 @@ module.exports = function(context) {
}
return {
- "IfStatement": function (node) {
+ "IfStatement": function(node) {
check(node);
// check the `else`
if (node.alternate && node.alternate.type !== "IfStatement") {
@@ -56,21 +88,21 @@ module.exports = function(context) {
"ForOfStatement": check,
"ForInStatement": check,
"WhileStatement": check,
- "DoWhileStatement": function (node) {
+ "DoWhileStatement": function(node) {
check(node);
// check the `while`
var whileTokens = context.getTokensAfter(node.body, 2);
checkTokens(node, whileTokens[0], whileTokens[1]);
},
"SwitchStatement": check,
- "TryStatement": function (node) {
+ "TryStatement": function(node) {
check(node);
// check the `finally`
if (node.finalizer) {
checkTokens(node.finalizer, context.getTokenBefore(node.finalizer), context.getFirstToken(node.finalizer));
}
},
- "CatchStatement": check,
+ "CatchClause": check,
"WithStatement": check
};
};
diff --git a/tools/eslint/lib/rules/space-before-blocks.js b/tools/eslint/lib/rules/space-before-blocks.js
index 799770537dd122..24c1d9b31b6ce4 100644
--- a/tools/eslint/lib/rules/space-before-blocks.js
+++ b/tools/eslint/lib/rules/space-before-blocks.js
@@ -6,31 +6,34 @@
"use strict";
+var astUtils = require("../ast-utils");
+
//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------
-module.exports = function (context) {
- var requireSpace = context.options[0] !== "never";
+module.exports = function(context) {
+ var config = context.options[0],
+ sourceCode = context.getSourceCode(),
+ checkFunctions = true,
+ checkKeywords = true;
- /**
- * Determines whether two adjacent tokens are have whitespace between them.
- * @param {Object} left - The left token object.
- * @param {Object} right - The right token object.
- * @returns {boolean} Whether or not there is space between the tokens.
- */
- function isSpaced(left, right) {
- return left.range[1] < right.range[0];
+ if (typeof config === "object") {
+ checkFunctions = config.functions !== "never";
+ checkKeywords = config.keywords !== "never";
+ } else if (config === "never") {
+ checkFunctions = false;
+ checkKeywords = false;
}
/**
- * Determines whether two adjacent tokens are on the same line.
- * @param {Object} left - The left token object.
- * @param {Object} right - The right token object.
- * @returns {boolean} Whether or not the tokens are on the same line.
+ * Checks whether or not a given token is an arrow operator (=>).
+ *
+ * @param {Token} token - A token to check.
+ * @returns {boolean} `true` if the token is an arrow operator.
*/
- function isSameLine(left, right) {
- return left.loc.start.line === right.loc.start.line;
+ function isArrow(token) {
+ return token.type === "Punctuator" && token.value === "=>";
}
/**
@@ -40,18 +43,38 @@ module.exports = function (context) {
*/
function checkPrecedingSpace(node) {
var precedingToken = context.getTokenBefore(node),
- hasSpace;
+ hasSpace,
+ parent,
+ requireSpace;
- if (precedingToken && isSameLine(precedingToken, node)) {
- hasSpace = isSpaced(precedingToken, node);
+ if (precedingToken && !isArrow(precedingToken) && astUtils.isTokenOnSameLine(precedingToken, node)) {
+ hasSpace = sourceCode.isSpaceBetweenTokens(precedingToken, node);
+ parent = context.getAncestors().pop();
+ if (parent.type === "FunctionExpression" || parent.type === "FunctionDeclaration") {
+ requireSpace = checkFunctions;
+ } else {
+ requireSpace = checkKeywords;
+ }
if (requireSpace) {
if (!hasSpace) {
- context.report(node, "Missing space before opening brace.");
+ context.report({
+ node: node,
+ message: "Missing space before opening brace.",
+ fix: function(fixer) {
+ return fixer.insertTextBefore(node, " ");
+ }
+ });
}
} else {
if (hasSpace) {
- context.report(node, "Unexpected space before opening brace.");
+ context.report({
+ node: node,
+ message: "Unexpected space before opening brace.",
+ fix: function(fixer) {
+ return fixer.removeRange([precedingToken.range[1], node.range[0]]);
+ }
+ });
}
}
}
@@ -79,6 +102,7 @@ module.exports = function (context) {
return {
"BlockStatement": checkPrecedingSpace,
+ "ClassBody": checkPrecedingSpace,
"SwitchStatement": checkSpaceBeforeCaseBlock
};
@@ -86,6 +110,22 @@ module.exports = function (context) {
module.exports.schema = [
{
- "enum": ["always", "never"]
+ "oneOf": [
+ {
+ "enum": ["always", "never"]
+ },
+ {
+ "type": "object",
+ "properties": {
+ "keywords": {
+ "enum": ["always", "never"]
+ },
+ "functions": {
+ "enum": ["always", "never"]
+ }
+ },
+ "additionalProperties": false
+ }
+ ]
}
];
diff --git a/tools/eslint/lib/rules/space-before-function-paren.js b/tools/eslint/lib/rules/space-before-function-paren.js
index fde281c88cb37b..b96acb6678c42e 100644
--- a/tools/eslint/lib/rules/space-before-function-paren.js
+++ b/tools/eslint/lib/rules/space-before-function-paren.js
@@ -2,6 +2,7 @@
* @fileoverview Rule to validate spacing before function paren.
* @author Mathias Schreck
* @copyright 2015 Mathias Schreck
+ * See LICENSE in root directory for full license.
*/
"use strict";
@@ -12,6 +13,7 @@
module.exports = function(context) {
var configuration = context.options[0],
+ sourceCode = context.getSourceCode(),
requireAnonymousFunctionSpacing = true,
requireNamedFunctionSpacing = true;
@@ -23,16 +25,6 @@ module.exports = function(context) {
requireNamedFunctionSpacing = false;
}
- /**
- * Determines whether two adjacent tokens are have whitespace between them.
- * @param {Object} left - The left token object.
- * @param {Object} right - The right token object.
- * @returns {boolean} Whether or not there is space between the tokens.
- */
- function isSpaced(left, right) {
- return left.range[1] < right.range[0];
- }
-
/**
* Determines whether a function has a name.
* @param {ASTNode} node The function node.
@@ -45,7 +37,7 @@ module.exports = function(context) {
return true;
}
- parent = context.getAncestors().pop();
+ parent = node.parent;
return parent.type === "MethodDefinition" ||
(parent.type === "Property" &&
(
@@ -63,7 +55,6 @@ module.exports = function(context) {
*/
function validateSpacingBeforeParentheses(node) {
var isNamed = isNamedFunction(node),
- tokens,
leftToken,
rightToken,
location;
@@ -72,40 +63,34 @@ module.exports = function(context) {
return;
}
- tokens = context.getTokens(node);
-
- if (node.generator) {
- if (node.id) {
- leftToken = tokens[2];
- rightToken = tokens[3];
- } else {
- // Object methods are named but don't have an id
- leftToken = context.getTokenBefore(node);
- rightToken = tokens[0];
- }
- } else if (isNamed) {
- if (node.id) {
- leftToken = tokens[1];
- rightToken = tokens[2];
- } else {
- // Object methods are named but don't have an id
- leftToken = context.getTokenBefore(node);
- rightToken = tokens[0];
- }
- } else {
- leftToken = tokens[0];
- rightToken = tokens[1];
+ rightToken = sourceCode.getFirstToken(node);
+ while (rightToken.value !== "(") {
+ rightToken = sourceCode.getTokenAfter(rightToken);
}
-
+ leftToken = context.getTokenBefore(rightToken);
location = leftToken.loc.end;
- if (isSpaced(leftToken, rightToken)) {
+ if (sourceCode.isSpaceBetweenTokens(leftToken, rightToken)) {
if ((isNamed && !requireNamedFunctionSpacing) || (!isNamed && !requireAnonymousFunctionSpacing)) {
- context.report(node, location, "Unexpected space before function parentheses.");
+ context.report({
+ node: node,
+ loc: location,
+ message: "Unexpected space before function parentheses.",
+ fix: function(fixer) {
+ return fixer.removeRange([leftToken.range[1], rightToken.range[0]]);
+ }
+ });
}
} else {
if ((isNamed && requireNamedFunctionSpacing) || (!isNamed && requireAnonymousFunctionSpacing)) {
- context.report(node, location, "Missing space before function parentheses.");
+ context.report({
+ node: node,
+ loc: location,
+ message: "Missing space before function parentheses.",
+ fix: function(fixer) {
+ return fixer.insertTextAfter(leftToken, " ");
+ }
+ });
}
}
}
diff --git a/tools/eslint/lib/rules/space-before-function-parentheses.js b/tools/eslint/lib/rules/space-before-function-parentheses.js
deleted file mode 100644
index 9d275c62887756..00000000000000
--- a/tools/eslint/lib/rules/space-before-function-parentheses.js
+++ /dev/null
@@ -1,139 +0,0 @@
-/**
- * @fileoverview Rule to validate spacing before function parentheses.
- * @author Mathias Schreck
- * @copyright 2015 Mathias Schreck
- */
-"use strict";
-
-//------------------------------------------------------------------------------
-// Rule Definition
-//------------------------------------------------------------------------------
-
-module.exports = function(context) {
-
- var configuration = context.options[0],
- requireAnonymousFunctionSpacing = true,
- requireNamedFunctionSpacing = true;
-
- if (typeof configuration === "object") {
- requireAnonymousFunctionSpacing = configuration.anonymous !== "never";
- requireNamedFunctionSpacing = configuration.named !== "never";
- } else if (configuration === "never") {
- requireAnonymousFunctionSpacing = false;
- requireNamedFunctionSpacing = false;
- }
-
- /**
- * Determines whether two adjacent tokens are have whitespace between them.
- * @param {Object} left - The left token object.
- * @param {Object} right - The right token object.
- * @returns {boolean} Whether or not there is space between the tokens.
- */
- function isSpaced(left, right) {
- return left.range[1] < right.range[0];
- }
-
- /**
- * Determines whether a function has a name.
- * @param {ASTNode} node The function node.
- * @returns {boolean} Whether the function has a name.
- */
- function isNamedFunction(node) {
- var parent;
-
- if (node.id) {
- return true;
- }
-
- parent = context.getAncestors().pop();
- return parent.type === "MethodDefinition" ||
- (parent.type === "Property" &&
- (
- parent.kind === "get" ||
- parent.kind === "set" ||
- parent.method
- )
- );
- }
-
- /**
- * Validates the spacing before function parentheses.
- * @param {ASTNode} node The node to be validated.
- * @returns {void}
- */
- function validateSpacingBeforeParentheses(node) {
- var isNamed = isNamedFunction(node),
- tokens,
- leftToken,
- rightToken,
- location;
-
- if (node.generator && !isNamed) {
- return;
- }
-
- tokens = context.getTokens(node);
-
- if (node.generator) {
- if (node.id) {
- leftToken = tokens[2];
- rightToken = tokens[3];
- } else {
- // Object methods are named but don't have an id
- leftToken = context.getTokenBefore(node);
- rightToken = tokens[0];
- }
- } else if (isNamed) {
- if (node.id) {
- leftToken = tokens[1];
- rightToken = tokens[2];
- } else {
- // Object methods are named but don't have an id
- leftToken = context.getTokenBefore(node);
- rightToken = tokens[0];
- }
- } else {
- leftToken = tokens[0];
- rightToken = tokens[1];
- }
-
- location = leftToken.loc.end;
-
- if (isSpaced(leftToken, rightToken)) {
- if ((isNamed && !requireNamedFunctionSpacing) || (!isNamed && !requireAnonymousFunctionSpacing)) {
- context.report(node, location, "Unexpected space before function parentheses.");
- }
- } else {
- if ((isNamed && requireNamedFunctionSpacing) || (!isNamed && requireAnonymousFunctionSpacing)) {
- context.report(node, location, "Missing space before function parentheses.");
- }
- }
- }
-
- return {
- "FunctionDeclaration": validateSpacingBeforeParentheses,
- "FunctionExpression": validateSpacingBeforeParentheses
- };
-};
-
-module.exports.schema = [
- {
- "oneOf": [
- {
- "enum": ["always", "never"]
- },
- {
- "type": "object",
- "properties": {
- "anonymous": {
- "enum": ["always", "never"]
- },
- "named": {
- "enum": ["always", "never"]
- }
- },
- "additionalProperties": false
- }
- ]
- }
-];
diff --git a/tools/eslint/lib/rules/space-before-keywords.js b/tools/eslint/lib/rules/space-before-keywords.js
new file mode 100644
index 00000000000000..cba8cffa5fd15e
--- /dev/null
+++ b/tools/eslint/lib/rules/space-before-keywords.js
@@ -0,0 +1,214 @@
+/**
+ * @fileoverview Require or disallow spaces before keywords
+ * @author Marko Raatikka
+ * @copyright 2015 Marko Raatikka. All rights reserved.
+ * See LICENSE file in root directory for full license.
+ */
+"use strict";
+
+var astUtils = require("../ast-utils");
+
+//------------------------------------------------------------------------------
+// Rule Definition
+//------------------------------------------------------------------------------
+
+var ERROR_MSG_SPACE_EXPECTED = "Missing space before keyword \"{{keyword}}\".";
+var ERROR_MSG_NO_SPACE_EXPECTED = "Unexpected space before keyword \"{{keyword}}\".";
+
+module.exports = function(context) {
+
+ var sourceCode = context.getSourceCode();
+
+ var SPACE_REQUIRED = context.options[0] !== "never";
+
+ //--------------------------------------------------------------------------
+ // Helpers
+ //--------------------------------------------------------------------------
+
+ /**
+ * Report the error message
+ * @param {ASTNode} node node to report
+ * @param {string} message Error message to be displayed
+ * @param {object} data Data object for the rule message
+ * @returns {void}
+ */
+ function report(node, message, data) {
+ context.report({
+ node: node,
+ message: message,
+ data: data,
+ fix: function(fixer) {
+ if (SPACE_REQUIRED) {
+ return fixer.insertTextBefore(node, " ");
+ } else {
+ var tokenBefore = context.getTokenBefore(node);
+ return fixer.removeRange([tokenBefore.range[1], node.range[0]]);
+ }
+ }
+ });
+ }
+
+ /**
+ * Check if a token meets the criteria
+ *
+ * @param {ASTNode} node The node to check
+ * @param {Object} left The left-hand side token of the node
+ * @param {Object} right The right-hand side token of the node
+ * @param {Object} options See check()
+ * @returns {void}
+ */
+ function checkTokens(node, left, right, options) {
+
+ if (!left) {
+ return;
+ }
+
+ if (left.type === "Keyword") {
+ return;
+ }
+
+ if (!SPACE_REQUIRED && typeof options.requireSpace === "undefined") {
+ return;
+ }
+
+ options = options || {};
+ options.allowedPrecedingChars = options.allowedPrecedingChars || [ "{" ];
+ options.requireSpace = typeof options.requireSpace === "undefined" ? SPACE_REQUIRED : options.requireSpace;
+
+ var hasSpace = sourceCode.isSpaceBetweenTokens(left, right);
+ var spaceOk = hasSpace === options.requireSpace;
+
+ if (spaceOk) {
+ return;
+ }
+
+ if (!astUtils.isTokenOnSameLine(left, right)) {
+ if (!options.requireSpace) {
+ report(node, ERROR_MSG_NO_SPACE_EXPECTED, { keyword: right.value });
+ }
+ return;
+ }
+
+ if (!options.requireSpace) {
+ report(node, ERROR_MSG_NO_SPACE_EXPECTED, { keyword: right.value });
+ return;
+ }
+
+ if (options.allowedPrecedingChars.indexOf(left.value) !== -1) {
+ return;
+ }
+
+ report(node, ERROR_MSG_SPACE_EXPECTED, { keyword: right.value });
+
+ }
+
+ /**
+ * Get right and left tokens of a node and check to see if they meet the given criteria
+ *
+ * @param {ASTNode} node The node to check
+ * @param {Object} options Options to validate the node against
+ * @param {Array} options.allowedPrecedingChars Characters that can precede the right token
+ * @param {Boolean} options.requireSpace Whether or not the right token needs to be
+ * preceded by a space
+ * @returns {void}
+ */
+ function check(node, options) {
+
+ options = options || {};
+
+ var left = context.getTokenBefore(node);
+ var right = context.getFirstToken(node);
+
+ checkTokens(node, left, right, options);
+
+ }
+
+ //--------------------------------------------------------------------------
+ // Public
+ //--------------------------------------------------------------------------
+
+ return {
+
+ "IfStatement": function(node) {
+ // if
+ check(node);
+ // else
+ if (node.alternate) {
+ var tokens = context.getTokensBefore(node.alternate, 2);
+ if (tokens[0].value === "}") {
+ check(tokens[1], { requireSpace: SPACE_REQUIRED });
+ }
+ }
+ },
+ "ForStatement": check,
+ "ForInStatement": check,
+ "WhileStatement": check,
+ "DoWhileStatement": function(node) {
+ var whileNode = context.getTokenAfter(node.body);
+ // do
+ check(node);
+ // while
+ check(whileNode, { requireSpace: SPACE_REQUIRED });
+ },
+ "SwitchStatement": function(node) {
+ // switch
+ check(node);
+ // case/default
+ node.cases.forEach(function(caseNode) {
+ check(caseNode);
+ });
+ },
+ "ThrowStatement": check,
+ "TryStatement": function(node) {
+ // try
+ check(node);
+ // finally
+ if (node.finalizer) {
+ check(context.getTokenBefore(node.finalizer), { requireSpace: SPACE_REQUIRED });
+ }
+ },
+ "CatchClause": function(node) {
+ check(node, { requireSpace: SPACE_REQUIRED });
+ },
+ "WithStatement": check,
+ "VariableDeclaration": function(node) {
+ check(node, { allowedPrecedingChars: [ "(", "{" ] });
+ },
+ "ReturnStatement": check,
+ "BreakStatement": check,
+ "LabeledStatement": check,
+ "ContinueStatement": check,
+ "FunctionDeclaration": check,
+ "FunctionExpression": function(node) {
+ var left = context.getTokenBefore(node);
+ var right = context.getFirstToken(node);
+
+ // If it's a method, a getter, or a setter, the first token is not the `function` keyword.
+ if (right.type !== "Keyword") {
+ return;
+ }
+
+ checkTokens(node, left, right, { allowedPrecedingChars: [ "(", "{", "[" ] });
+ },
+ "YieldExpression": function(node) {
+ check(node, { allowedPrecedingChars: [ "(", "{" ] });
+ },
+ "ForOfStatement": check,
+ "ClassBody": function(node) {
+
+ // Find the 'class' token
+ while (node.value !== "class") {
+ node = context.getTokenBefore(node);
+ }
+
+ check(node);
+ }
+ };
+
+};
+
+module.exports.schema = [
+ {
+ "enum": ["always", "never"]
+ }
+];
diff --git a/tools/eslint/lib/rules/space-in-brackets.js b/tools/eslint/lib/rules/space-in-brackets.js
deleted file mode 100644
index aac889c95d262c..00000000000000
--- a/tools/eslint/lib/rules/space-in-brackets.js
+++ /dev/null
@@ -1,305 +0,0 @@
-/**
- * @fileoverview Disallows or enforces spaces inside of brackets.
- * @author Ian Christian Myers
- * @copyright 2014 Brandyn Bennett. All rights reserved.
- * @copyright 2014 Michael Ficarra. No rights reserved.
- * @copyright 2014 Vignesh Anand. All rights reserved.
- */
-"use strict";
-
-//------------------------------------------------------------------------------
-// Rule Definition
-//------------------------------------------------------------------------------
-
-module.exports = function(context) {
- var spaced = context.options[0] === "always";
-
- /**
- * Determines whether an option is set, relative to the spacing option.
- * If spaced is "always", then check whether option is set to false.
- * If spaced is "never", then check whether option is set to true.
- * @param {Object} option - The option to exclude.
- * @returns {boolean} Whether or not the property is excluded.
- */
- function isOptionSet(option) {
- return context.options[1] != null ? context.options[1][option] === !spaced : false;
- }
-
- var options = {
- spaced: spaced,
- singleElementException: isOptionSet("singleValue"),
- objectsInArraysException: isOptionSet("objectsInArrays"),
- arraysInArraysException: isOptionSet("arraysInArrays"),
- arraysInObjectsException: isOptionSet("arraysInObjects"),
- objectsInObjectsException: isOptionSet("objectsInObjects"),
- propertyNameException: isOptionSet("propertyName")
- };
-
- //--------------------------------------------------------------------------
- // Helpers
- //--------------------------------------------------------------------------
-
- /**
- * Determines whether two adjacent tokens are have whitespace between them.
- * @param {Object} left - The left token object.
- * @param {Object} right - The right token object.
- * @returns {boolean} Whether or not there is space between the tokens.
- */
- function isSpaced(left, right) {
- return left.range[1] < right.range[0];
- }
-
- /**
- * Determines whether two adjacent tokens are on the same line.
- * @param {Object} left - The left token object.
- * @param {Object} right - The right token object.
- * @returns {boolean} Whether or not the tokens are on the same line.
- */
- function isSameLine(left, right) {
- return left.loc.start.line === right.loc.start.line;
- }
-
- /**
- * Reports that there shouldn't be a space after the first token
- * @param {ASTNode} node - The node to report in the event of an error.
- * @param {Token} token - The token to use for the report.
- * @returns {void}
- */
- function reportNoBeginningSpace(node, token) {
- context.report(node, token.loc.start,
- "There should be no space after '" + token.value + "'");
- }
-
- /**
- * Reports that there shouldn't be a space before the last token
- * @param {ASTNode} node - The node to report in the event of an error.
- * @param {Token} token - The token to use for the report.
- * @returns {void}
- */
- function reportNoEndingSpace(node, token) {
- context.report(node, token.loc.start,
- "There should be no space before '" + token.value + "'");
- }
-
- /**
- * Reports that there should be a space after the first token
- * @param {ASTNode} node - The node to report in the event of an error.
- * @param {Token} token - The token to use for the report.
- * @returns {void}
- */
- function reportRequiredBeginningSpace(node, token) {
- context.report(node, token.loc.start,
- "A space is required after '" + token.value + "'");
- }
-
- /**
- * Reports that there should be a space before the last token
- * @param {ASTNode} node - The node to report in the event of an error.
- * @param {Token} token - The token to use for the report.
- * @returns {void}
- */
- function reportRequiredEndingSpace(node, token) {
- context.report(node, token.loc.start,
- "A space is required before '" + token.value + "'");
- }
-
-
- /**
- * Determines if spacing in curly braces is valid.
- * @param {ASTNode} node The AST node to check.
- * @param {Token} first The first token to check (should be the opening brace)
- * @param {Token} second The second token to check (should be first after the opening brace)
- * @param {Token} penultimate The penultimate token to check (should be last before closing brace)
- * @param {Token} last The last token to check (should be closing brace)
- * @returns {void}
- */
- function validateBraceSpacing(node, first, second, penultimate, last) {
- var closingCurlyBraceMustBeSpaced =
- options.arraysInObjectsException && penultimate.value === "]" ||
- options.objectsInObjectsException && penultimate.value === "}"
- ? !options.spaced : options.spaced;
-
- if (isSameLine(first, second)) {
- if (options.spaced && !isSpaced(first, second)) {
- reportRequiredBeginningSpace(node, first);
- }
- if (!options.spaced && isSpaced(first, second)) {
- reportNoBeginningSpace(node, first);
- }
- }
-
- if (isSameLine(penultimate, last)) {
- if (closingCurlyBraceMustBeSpaced && !isSpaced(penultimate, last)) {
- reportRequiredEndingSpace(node, last);
- }
- if (!closingCurlyBraceMustBeSpaced && isSpaced(penultimate, last)) {
- reportNoEndingSpace(node, last);
- }
- }
- }
-
- //--------------------------------------------------------------------------
- // Public
- //--------------------------------------------------------------------------
-
- return {
-
- MemberExpression: function(node) {
- if (!node.computed) {
- return;
- }
-
- var property = node.property,
- before = context.getTokenBefore(property),
- first = context.getFirstToken(property),
- last = context.getLastToken(property),
- after = context.getTokenAfter(property);
-
- var propertyNameMustBeSpaced = options.propertyNameException ?
- !options.spaced : options.spaced;
-
- if (isSameLine(before, first)) {
- if (propertyNameMustBeSpaced) {
- if (!isSpaced(before, first) && isSameLine(before, first)) {
- reportRequiredBeginningSpace(node, before);
- }
- } else {
- if (isSpaced(before, first)) {
- reportNoBeginningSpace(node, before);
- }
- }
- }
-
- if (isSameLine(last, after)) {
- if (propertyNameMustBeSpaced) {
- if (!isSpaced(last, after) && isSameLine(last, after)) {
- reportRequiredEndingSpace(node, after);
- }
- } else {
- if (isSpaced(last, after)) {
- reportNoEndingSpace(node, after);
- }
- }
- }
- },
-
- ArrayExpression: function(node) {
- if (node.elements.length === 0) {
- return;
- }
-
- var first = context.getFirstToken(node),
- second = context.getFirstToken(node, 1),
- penultimate = context.getLastToken(node, 1),
- last = context.getLastToken(node);
-
- var openingBracketMustBeSpaced =
- options.objectsInArraysException && second.value === "{" ||
- options.arraysInArraysException && second.value === "[" ||
- options.singleElementException && node.elements.length === 1
- ? !options.spaced : options.spaced;
-
- var closingBracketMustBeSpaced =
- options.objectsInArraysException && penultimate.value === "}" ||
- options.arraysInArraysException && penultimate.value === "]" ||
- options.singleElementException && node.elements.length === 1
- ? !options.spaced : options.spaced;
-
- if (isSameLine(first, second)) {
- if (openingBracketMustBeSpaced && !isSpaced(first, second)) {
- reportRequiredBeginningSpace(node, first);
- }
- if (!openingBracketMustBeSpaced && isSpaced(first, second)) {
- reportNoBeginningSpace(node, first);
- }
- }
-
- if (isSameLine(penultimate, last)) {
- if (closingBracketMustBeSpaced && !isSpaced(penultimate, last)) {
- reportRequiredEndingSpace(node, last);
- }
- if (!closingBracketMustBeSpaced && isSpaced(penultimate, last)) {
- reportNoEndingSpace(node, last);
- }
- }
- },
-
- ImportDeclaration: function(node) {
-
- var firstSpecifier = node.specifiers[0],
- lastSpecifier = node.specifiers[node.specifiers.length - 1];
-
- // don't do anything for namespace or default imports
- if (firstSpecifier && lastSpecifier && firstSpecifier.type === "ImportSpecifier" && lastSpecifier.type === "ImportSpecifier") {
- var first = context.getTokenBefore(firstSpecifier),
- second = context.getFirstToken(firstSpecifier),
- penultimate = context.getLastToken(lastSpecifier),
- last = context.getTokenAfter(lastSpecifier);
-
- validateBraceSpacing(node, first, second, penultimate, last);
- }
-
- },
-
- ExportNamedDeclaration: function(node) {
- if (!node.specifiers.length) {
- return;
- }
-
- var firstSpecifier = node.specifiers[0],
- lastSpecifier = node.specifiers[node.specifiers.length - 1],
- first = context.getTokenBefore(firstSpecifier),
- second = context.getFirstToken(firstSpecifier),
- penultimate = context.getLastToken(lastSpecifier),
- last = context.getTokenAfter(lastSpecifier);
-
- validateBraceSpacing(node, first, second, penultimate, last);
-
- },
-
- ObjectExpression: function(node) {
- if (node.properties.length === 0) {
- return;
- }
-
- var first = context.getFirstToken(node),
- second = context.getFirstToken(node, 1),
- penultimate = context.getLastToken(node, 1),
- last = context.getLastToken(node);
-
- validateBraceSpacing(node, first, second, penultimate, last);
- }
-
- };
-
-};
-
-module.exports.schema = [
- {
- "enum": ["always", "never"]
- },
- {
- "type": "object",
- "properties": {
- "singleValue": {
- "type": "boolean"
- },
- "objectsInArrays": {
- "type": "boolean"
- },
- "arraysInArrays": {
- "type": "boolean"
- },
- "arraysInObjects": {
- "type": "boolean"
- },
- "objectsInObjects": {
- "type": "boolean"
- },
- "propertyName": {
- "type": "boolean"
- }
- },
- "additionalProperties": false
- }
-];
diff --git a/tools/eslint/lib/rules/space-in-parens.js b/tools/eslint/lib/rules/space-in-parens.js
index 407d763b322953..789acdbdea1d0c 100644
--- a/tools/eslint/lib/rules/space-in-parens.js
+++ b/tools/eslint/lib/rules/space-in-parens.js
@@ -6,6 +6,8 @@
*/
"use strict";
+var astUtils = require("../ast-utils");
+
//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------
@@ -14,249 +16,205 @@ module.exports = function(context) {
var MISSING_SPACE_MESSAGE = "There must be a space inside this paren.",
REJECTED_SPACE_MESSAGE = "There should be no spaces inside this paren.",
- exceptionsArray = (context.options.length === 2) ? context.options[1].exceptions : [],
+ ALWAYS = context.options[0] === "always",
+
+ exceptionsArrayOptions = (context.options.length === 2) ? context.options[1].exceptions : [],
options = {},
- rejectedSpaceRegExp,
- missingSpaceRegExp,
- spaceChecks;
-
- if (exceptionsArray && exceptionsArray.length) {
- options.braceException = exceptionsArray.indexOf("{}") !== -1 || false;
- options.bracketException = exceptionsArray.indexOf("[]") !== -1 || false;
- options.parenException = exceptionsArray.indexOf("()") !== -1 || false;
- options.empty = exceptionsArray.indexOf("empty") !== -1 || false;
+ exceptions;
+
+ if (exceptionsArrayOptions.length) {
+ options.braceException = exceptionsArrayOptions.indexOf("{}") !== -1;
+ options.bracketException = exceptionsArrayOptions.indexOf("[]") !== -1;
+ options.parenException = exceptionsArrayOptions.indexOf("()") !== -1;
+ options.empty = exceptionsArrayOptions.indexOf("empty") !== -1;
}
/**
- * Used with the `never` option to produce, given the exception options,
- * two regular expressions to check for missing and rejected spaces.
+ * Produces an object with the opener and closer exception values
* @param {Object} opts The exception options
- * @returns {Object} `missingSpace` and `rejectedSpace` regular expressions
+ * @returns {Object} `openers` and `closers` exception values
* @private
*/
- function getNeverChecks(opts) {
- var missingSpaceOpeners = [],
- missingSpaceClosers = [],
- rejectedSpaceOpeners = ["\\s"],
- rejectedSpaceClosers = ["\\s"],
- missingSpaceCheck,
- rejectedSpaceCheck;
-
- // Populate openers and closers
- if (opts.braceException) {
- missingSpaceOpeners.push("\\{");
- missingSpaceClosers.push("\\}");
- rejectedSpaceOpeners.push("\\{");
- rejectedSpaceClosers.push("\\}");
- }
- if (opts.bracketException) {
- missingSpaceOpeners.push("\\[");
- missingSpaceClosers.push("\\]");
- rejectedSpaceOpeners.push("\\[");
- rejectedSpaceClosers.push("\\]");
- }
- if (opts.parenException) {
- missingSpaceOpeners.push("\\(");
- missingSpaceClosers.push("\\)");
- rejectedSpaceOpeners.push("\\(");
- rejectedSpaceClosers.push("\\)");
- }
- if (opts.empty) {
- missingSpaceOpeners.push("\\)");
- missingSpaceClosers.push("\\(");
- rejectedSpaceOpeners.push("\\)");
- rejectedSpaceClosers.push("\\(");
+ function getExceptions() {
+ var openers = [],
+ closers = [];
+ if (options.braceException) {
+ openers.push("{");
+ closers.push("}");
}
- if (missingSpaceOpeners.length) {
- missingSpaceCheck = "\\((" + missingSpaceOpeners.join("|") + ")";
- if (missingSpaceClosers.length) {
- missingSpaceCheck += "|";
- }
+ if (options.bracketException) {
+ openers.push("[");
+ closers.push("]");
}
- if (missingSpaceClosers.length) {
- missingSpaceCheck += "(" + missingSpaceClosers.join("|") + ")\\)";
- }
-
- // compose the rejected regexp
- rejectedSpaceCheck = "\\( +[^" + rejectedSpaceOpeners.join("") + "]";
- rejectedSpaceCheck += "|[^" + rejectedSpaceClosers.join("") + "] +\\)";
- return {
- // e.g. \((\{)|(\})\) --- where {} is an exception
- missingSpace: missingSpaceCheck || ".^",
- // e.g. \( +[^ \n\r\{]|[^ \n\r\}] +\) --- where {} is an exception
- rejectedSpace: rejectedSpaceCheck
- };
- }
-
- /**
- * Used with the `always` option to produce, given the exception options,
- * two regular expressions to check for missing and rejected spaces.
- * @param {Object} opts The exception options
- * @returns {Object} `missingSpace` and `rejectedSpace` regular expressions
- * @private
- */
- function getAlwaysChecks(opts) {
- var missingSpaceOpeners = ["\\s", "\\)"],
- missingSpaceClosers = ["\\s", "\\("],
- rejectedSpaceOpeners = [],
- rejectedSpaceClosers = [],
- missingSpaceCheck,
- rejectedSpaceCheck;
-
- // Populate openers and closers
- if (opts.braceException) {
- missingSpaceOpeners.push("\\{");
- missingSpaceClosers.push("\\}");
- rejectedSpaceOpeners.push(" \\{");
- rejectedSpaceClosers.push("\\} ");
- }
- if (opts.bracketException) {
- missingSpaceOpeners.push("\\[");
- missingSpaceClosers.push("\\]");
- rejectedSpaceOpeners.push(" \\[");
- rejectedSpaceClosers.push("\\] ");
+ if (options.parenException) {
+ openers.push("(");
+ closers.push(")");
}
- if (opts.parenException) {
- missingSpaceOpeners.push("\\(");
- missingSpaceClosers.push("\\)");
- rejectedSpaceOpeners.push(" \\(");
- rejectedSpaceClosers.push("\\) ");
- }
- if (opts.empty) {
- rejectedSpaceOpeners.push(" \\)");
- rejectedSpaceClosers.push("\\( ");
- }
-
- // compose the allowed regexp
- missingSpaceCheck = "\\([^" + missingSpaceOpeners.join("") + "]";
- missingSpaceCheck += "|[^" + missingSpaceClosers.join("") + "]\\)";
- // compose the rejected regexp
- if (rejectedSpaceOpeners.length) {
- rejectedSpaceCheck = "\\((" + rejectedSpaceOpeners.join("|") + ")";
- if (rejectedSpaceClosers.length) {
- rejectedSpaceCheck += "|";
- }
- }
- if (rejectedSpaceClosers.length) {
- rejectedSpaceCheck += "(" + rejectedSpaceClosers.join("|") + ")\\)";
+ if (options.empty) {
+ openers.push(")");
+ closers.push("(");
}
return {
- // e.g. \([^ \)\r\n\{]|[^ \(\r\n\}]\) --- where {} is an exception
- missingSpace: missingSpaceCheck,
- // e.g. \(( \{})|(\} )\) --- where {} is an excpetion
- rejectedSpace: rejectedSpaceCheck || ".^"
+ openers: openers,
+ closers: closers
};
}
- spaceChecks = (context.options[0] === "always") ? getAlwaysChecks(options) : getNeverChecks(options);
- missingSpaceRegExp = new RegExp(spaceChecks.missingSpace, "mg");
- rejectedSpaceRegExp = new RegExp(spaceChecks.rejectedSpace, "mg");
-
-
//--------------------------------------------------------------------------
// Helpers
//--------------------------------------------------------------------------
-
- var skipRanges = [];
+ var sourceCode = context.getSourceCode();
/**
- * Adds the range of a node to the set to be skipped when checking parens
- * @param {ASTNode} node The node to skip
- * @returns {void}
- * @private
+ * Determines if a token is one of the exceptions for the opener paren
+ * @param {Object} token The token to check
+ * @returns {boolean} True if the token is one of the exceptions for the opener paren
*/
- function addSkipRange(node) {
- skipRanges.push(node.range);
+ function isOpenerException(token) {
+ return token.type === "Punctuator" && exceptions.openers.indexOf(token.value) >= 0;
}
/**
- * Sorts the skipRanges array. Must be called before shouldSkip
- * @returns {void}
- * @private
+ * Determines if a token is one of the exceptions for the closer paren
+ * @param {Object} token The token to check
+ * @returns {boolean} True if the token is one of the exceptions for the closer paren
*/
- function sortSkipRanges() {
- skipRanges.sort(function (a, b) {
- return a[0] - b[0];
- });
+ function isCloserException(token) {
+ return token.type === "Punctuator" && exceptions.closers.indexOf(token.value) >= 0;
}
/**
- * Checks if a certain position in the source should be skipped
- * @param {Number} pos The 0-based index in the source
- * @returns {boolean} whether the position should be skipped
- * @private
+ * Determines if an opener paren should have a missing space after it
+ * @param {Object} left The paren token
+ * @param {Object} right The token after it
+ * @returns {boolean} True if the paren should have a space
*/
- function shouldSkip(pos) {
- var i, len, range;
- for (i = 0, len = skipRanges.length; i < len; i += 1) {
- range = skipRanges[i];
- if (pos < range[0]) {
- break;
- } else if (pos < range[1]) {
- return true;
+ function shouldOpenerHaveSpace(left, right) {
+ if (sourceCode.isSpaceBetweenTokens(left, right)) {
+ return false;
+ }
+
+ if (ALWAYS) {
+ if (right.type === "Punctuator" && right.value === ")") {
+ return false;
}
+ return !isOpenerException(right);
+ } else {
+ return isOpenerException(right);
}
- return false;
}
+ /**
+ * Determines if an closer paren should have a missing space after it
+ * @param {Object} left The token before the paren
+ * @param {Object} right The paren token
+ * @returns {boolean} True if the paren should have a space
+ */
+ function shouldCloserHaveSpace(left, right) {
+ if (left.type === "Punctuator" && left.value === "(") {
+ return false;
+ }
- //--------------------------------------------------------------------------
- // Public
- //--------------------------------------------------------------------------
-
- return {
+ if (sourceCode.isSpaceBetweenTokens(left, right)) {
+ return false;
+ }
- "Program:exit": function checkParenSpaces(node) {
+ if (ALWAYS) {
+ return !isCloserException(left);
+ } else {
+ return isCloserException(left);
+ }
+ }
- var nextMatch,
- nextLine,
- column,
- line = 1,
- source = context.getSource(),
- pos = 0;
+ /**
+ * Determines if an opener paren should not have an existing space after it
+ * @param {Object} left The paren token
+ * @param {Object} right The token after it
+ * @returns {boolean} True if the paren should reject the space
+ */
+ function shouldOpenerRejectSpace(left, right) {
+ if (right.type === "Line") {
+ return false;
+ }
- function checkMatch(match, message) {
- if (source.charAt(match.index) !== "(") {
- // Matched a closing paren pattern
- match.index += 1;
- }
+ if (!astUtils.isTokenOnSameLine(left, right)) {
+ return false;
+ }
- if (!shouldSkip(match.index)) {
- while ((nextLine = source.indexOf("\n", pos)) !== -1 && nextLine < match.index) {
- pos = nextLine + 1;
- line += 1;
- }
- column = match.index - pos;
+ if (!sourceCode.isSpaceBetweenTokens(left, right)) {
+ return false;
+ }
- context.report(node, { line: line, column: column }, message);
- }
- }
+ if (ALWAYS) {
+ return isOpenerException(right);
+ } else {
+ return !isOpenerException(right);
+ }
+ }
- sortSkipRanges();
+ /**
+ * Determines if an closer paren should not have an existing space after it
+ * @param {Object} left The token before the paren
+ * @param {Object} right The paren token
+ * @returns {boolean} True if the paren should reject the space
+ */
+ function shouldCloserRejectSpace(left, right) {
+ if (left.type === "Punctuator" && left.value === "(") {
+ return false;
+ }
- while ((nextMatch = rejectedSpaceRegExp.exec(source)) !== null) {
- checkMatch(nextMatch, REJECTED_SPACE_MESSAGE);
- }
+ if (!astUtils.isTokenOnSameLine(left, right)) {
+ return false;
+ }
- while ((nextMatch = missingSpaceRegExp.exec(source)) !== null) {
- checkMatch(nextMatch, MISSING_SPACE_MESSAGE);
- }
+ if (!sourceCode.isSpaceBetweenTokens(left, right)) {
+ return false;
+ }
- },
+ if (ALWAYS) {
+ return isCloserException(left);
+ } else {
+ return !isCloserException(left);
+ }
+ }
+ //--------------------------------------------------------------------------
+ // Public
+ //--------------------------------------------------------------------------
- // These nodes can contain parentheses that this rule doesn't care about
+ return {
+ "Program": function checkParenSpaces(node) {
+ var tokens, prevToken, nextToken;
+ exceptions = getExceptions();
+ tokens = sourceCode.tokensAndComments;
- LineComment: addSkipRange,
+ tokens.forEach(function(token, i) {
+ prevToken = tokens[i - 1];
+ nextToken = tokens[i + 1];
- BlockComment: addSkipRange,
+ if (token.type !== "Punctuator") {
+ return;
+ }
- Literal: addSkipRange
+ if (token.value !== "(" && token.value !== ")") {
+ return;
+ }
+ if (token.value === "(" && shouldOpenerHaveSpace(token, nextToken)) {
+ context.report(node, token.loc.end, MISSING_SPACE_MESSAGE);
+ } else if (token.value === "(" && shouldOpenerRejectSpace(token, nextToken)) {
+ context.report(node, token.loc.end, REJECTED_SPACE_MESSAGE);
+ } else if (token.value === ")" && shouldCloserHaveSpace(prevToken, token)) {
+ context.report(node, token.loc.end, MISSING_SPACE_MESSAGE);
+ } else if (token.value === ")" && shouldCloserRejectSpace(prevToken, token)) {
+ context.report(node, token.loc.end, REJECTED_SPACE_MESSAGE);
+ }
+ });
+ }
};
};
diff --git a/tools/eslint/lib/rules/space-infix-ops.js b/tools/eslint/lib/rules/space-infix-ops.js
index 4c094c7280c114..8d696e65b9f6e5 100644
--- a/tools/eslint/lib/rules/space-infix-ops.js
+++ b/tools/eslint/lib/rules/space-infix-ops.js
@@ -48,9 +48,36 @@ module.exports = function(context) {
* @private
*/
function report(mainNode, culpritToken) {
- context.report(mainNode, culpritToken.loc.start, "Infix operators must be spaced.");
+ context.report({
+ node: mainNode,
+ loc: culpritToken.loc.start,
+ message: "Infix operators must be spaced.",
+ fix: function(fixer) {
+ var previousToken = context.getTokenBefore(culpritToken);
+ var afterToken = context.getTokenAfter(culpritToken);
+ var fixString = "";
+
+ if (culpritToken.range[0] - previousToken.range[1] === 0) {
+ fixString = " ";
+ }
+
+ fixString += culpritToken.value;
+
+ if (afterToken.range[0] - culpritToken.range[1] === 0) {
+ fixString += " ";
+ }
+
+ return fixer.replaceText(culpritToken, fixString);
+ }
+ });
}
+ /**
+ * Check if the node is binary then report
+ * @param {ASTNode} node node to evaluate
+ * @returns {void}
+ * @private
+ */
function checkBinary(node) {
var nonSpacedNode = getFirstNonSpacedToken(node.left, node.right);
@@ -61,6 +88,12 @@ module.exports = function(context) {
}
}
+ /**
+ * Check if the node is conditional
+ * @param {ASTNode} node node to evaluate
+ * @returns {void}
+ * @private
+ */
function checkConditional(node) {
var nonSpacedConsequesntNode = getFirstNonSpacedToken(node.test, node.consequent);
var nonSpacedAlternateNode = getFirstNonSpacedToken(node.consequent, node.alternate);
@@ -72,6 +105,12 @@ module.exports = function(context) {
}
}
+ /**
+ * Check if the node is a variable
+ * @param {ASTNode} node node to evaluate
+ * @returns {void}
+ * @private
+ */
function checkVar(node) {
var nonSpacedNode;
@@ -85,6 +124,7 @@ module.exports = function(context) {
return {
"AssignmentExpression": checkBinary,
+ "AssignmentPattern": checkBinary,
"BinaryExpression": checkBinary,
"LogicalExpression": checkBinary,
"ConditionalExpression": checkConditional,
diff --git a/tools/eslint/lib/rules/space-return-throw-case.js b/tools/eslint/lib/rules/space-return-throw-case.js
index 8b1bb984cf46a7..2c2816088bdf13 100644
--- a/tools/eslint/lib/rules/space-return-throw-case.js
+++ b/tools/eslint/lib/rules/space-return-throw-case.js
@@ -10,12 +10,24 @@
module.exports = function(context) {
+ /**
+ * Check if the node for spaces
+ * @param {ASTNode} node node to evaluate
+ * @returns {void}
+ * @private
+ */
function check(node) {
var tokens = context.getFirstTokens(node, 2),
value = tokens[0].value;
if (tokens[0].range[1] >= tokens[1].range[0]) {
- context.report(node, "Keyword \"" + value + "\" must be followed by whitespace.");
+ context.report({
+ node: node,
+ message: "Keyword \"" + value + "\" must be followed by whitespace.",
+ fix: function(fixer) {
+ return fixer.insertTextAfterRange(tokens[0].range, " ");
+ }
+ });
}
}
diff --git a/tools/eslint/lib/rules/space-unary-ops.js b/tools/eslint/lib/rules/space-unary-ops.js
index 48d146b779b134..5dfae954e96bd3 100644
--- a/tools/eslint/lib/rules/space-unary-ops.js
+++ b/tools/eslint/lib/rules/space-unary-ops.js
@@ -17,12 +17,13 @@ module.exports = function(context) {
//--------------------------------------------------------------------------
/**
- * Check if the parent unary operator is "!" in order to know if it's "!!" convert to Boolean or just "!" negation
+ * Check if the node is the first "!" in a "!!" convert to Boolean expression
* @param {ASTnode} node AST node
- * @returns {boolean} Whether or not the parent is unary "!" operator
+ * @returns {boolean} Whether or not the node is first "!" in "!!"
*/
- function isParentUnaryBangExpression(node) {
- return node && node.parent && node.parent.type === "UnaryExpression" && node.parent.operator === "!";
+ function isFirstBangInBangBangExpression(node) {
+ return node && node.type === "UnaryExpression" && node.argument.operator === "!" &&
+ node.argument && node.argument.type === "UnaryExpression" && node.argument.operator === "!";
}
/**
@@ -39,18 +40,33 @@ module.exports = function(context) {
* @param {ASTnode} node AST node
* @param {object} firstToken first token from the AST node
* @param {object} secondToken second token from the AST node
+ * @param {string} word The word to be used for reporting
* @returns {void}
*/
- function checkUnaryWordOperatorForSpaces(node, firstToken, secondToken) {
+ function checkUnaryWordOperatorForSpaces(node, firstToken, secondToken, word) {
+ word = word || firstToken.value;
+
if (options.words) {
if (secondToken.range[0] === firstToken.range[1]) {
- context.report(node, "Unary word operator \"" + firstToken.value + "\" must be followed by whitespace.");
+ context.report({
+ node: node,
+ message: "Unary word operator \"" + word + "\" must be followed by whitespace.",
+ fix: function(fixer) {
+ return fixer.insertTextAfter(firstToken, " ");
+ }
+ });
}
}
if (!options.words && isArgumentObjectExpression(node)) {
if (secondToken.range[0] > firstToken.range[1]) {
- context.report(node, "Unexpected space after unary word operator \"" + firstToken.value + "\".");
+ context.report({
+ node: node,
+ message: "Unexpected space after unary word operator \"" + word + "\".",
+ fix: function(fixer) {
+ return fixer.removeRange([firstToken.range[1], secondToken.range[0]]);
+ }
+ });
}
}
}
@@ -72,25 +88,49 @@ module.exports = function(context) {
if (options.nonwords) {
if (node.prefix) {
- if (isParentUnaryBangExpression(node)) {
+ if (isFirstBangInBangBangExpression(node)) {
return void 0;
}
if (firstToken.range[1] === secondToken.range[0]) {
- context.report(node, "Unary operator \"" + firstToken.value + "\" must be followed by whitespace.");
+ context.report({
+ node: node,
+ message: "Unary operator \"" + firstToken.value + "\" must be followed by whitespace.",
+ fix: function(fixer) {
+ return fixer.insertTextAfter(firstToken, " ");
+ }
+ });
}
} else {
if (firstToken.range[1] === secondToken.range[0]) {
- context.report(node, "Space is required before unary expressions \"" + secondToken.value + "\".");
+ context.report({
+ node: node,
+ message: "Space is required before unary expressions \"" + secondToken.value + "\".",
+ fix: function(fixer) {
+ return fixer.insertTextBefore(secondToken, " ");
+ }
+ });
}
}
} else {
if (node.prefix) {
if (secondToken.range[0] > firstToken.range[1]) {
- context.report(node, "Unexpected space after unary operator \"" + firstToken.value + "\".");
+ context.report({
+ node: node,
+ message: "Unexpected space after unary operator \"" + firstToken.value + "\".",
+ fix: function(fixer) {
+ return fixer.removeRange([firstToken.range[1], secondToken.range[0]]);
+ }
+ });
}
} else {
if (secondToken.range[0] > firstToken.range[1]) {
- context.report(node, "Unexpected space before unary operator \"" + secondToken.value + "\".");
+ context.report({
+ node: node,
+ message: "Unexpected space before unary operator \"" + secondToken.value + "\".",
+ fix: function(fixer) {
+ return fixer.removeRange([firstToken.range[1], secondToken.range[0]]);
+ }
+ });
}
}
}
@@ -103,7 +143,22 @@ module.exports = function(context) {
return {
"UnaryExpression": checkForSpaces,
"UpdateExpression": checkForSpaces,
- "NewExpression": checkForSpaces
+ "NewExpression": checkForSpaces,
+ "YieldExpression": function(node) {
+ var tokens = context.getFirstTokens(node, 3),
+ word = "yield";
+
+ if (!node.argument) {
+ return;
+ }
+
+ if (node.delegate) {
+ word += "*";
+ checkUnaryWordOperatorForSpaces(node, tokens[1], tokens[2], word);
+ } else {
+ checkUnaryWordOperatorForSpaces(node, tokens[0], tokens[1], word);
+ }
+ }
};
};
diff --git a/tools/eslint/lib/rules/spaced-comment.js b/tools/eslint/lib/rules/spaced-comment.js
index a57cd8699d095b..585dc7aec1b017 100644
--- a/tools/eslint/lib/rules/spaced-comment.js
+++ b/tools/eslint/lib/rules/spaced-comment.js
@@ -1,111 +1,181 @@
/**
* @fileoverview Source code for spaced-comments rule
* @author Gyandeep Singh
+ * @copyright 2015 Toru Nagashima. All rights reserved.
* @copyright 2015 Gyandeep Singh. All rights reserved.
* @copyright 2014 Greg Cochard. All rights reserved.
*/
"use strict";
+var escapeStringRegexp = require("escape-string-regexp");
+
//------------------------------------------------------------------------------
-// Rule Definition
+// Helpers
//------------------------------------------------------------------------------
-module.exports = function(context) {
-
- // Unless the first option is never, require a space
- var requireSpace = context.options[0] !== "never";
+/**
+ * Escapes the control characters of a given string.
+ * @param {string} s - A string to escape.
+ * @returns {string} An escaped string.
+ */
+function escape(s) {
+ var isOneChar = s.length === 1;
+ s = escapeStringRegexp(s);
+ return isOneChar ? s : "(?:" + s + ")";
+}
- // Default to match anything, so all will fail if there are no exceptions
- var exceptionMatcher = new RegExp(" ");
- var markerMatcher = new RegExp(" ");
- var jsDocMatcher = new RegExp("((^(\\*)))[ \\n]");
+/**
+ * Escapes the control characters of a given string.
+ * And adds a repeat flag.
+ * @param {string} s - A string to escape.
+ * @returns {string} An escaped string.
+ */
+function escapeAndRepeat(s) {
+ return escape(s) + "+";
+}
- // Fetch the options dict
- var hasOptions = context.options.length === 2;
- var optionsDict = hasOptions ? context.options[1] : {};
+/**
+ * Parses `markers` option.
+ * If markers don't include `"*"`, this adds `"*"` to allow JSDoc comments.
+ * @param {string[]} [markers] - A marker list.
+ * @returns {string[]} A marker list.
+ */
+function parseMarkersOption(markers) {
+ markers = markers ? markers.slice(0) : [];
- // Grab the exceptions array and build a RegExp matcher for it
- var hasExceptions = hasOptions && optionsDict.exceptions && optionsDict.exceptions.length;
- var unescapedExceptions = hasExceptions ? optionsDict.exceptions : [];
- var exceptions;
+ // `*` is a marker for JSDoc comments.
+ if (markers.indexOf("*") === -1) {
+ markers.push("*");
+ }
- // Now do the same for markers
- var hasMarkers = hasOptions && optionsDict.markers && optionsDict.markers.length;
- var unescapedMarkers = hasMarkers ? optionsDict.markers : [];
- var markers;
+ return markers;
+}
- function escaper(s) {
- return s.replace(/([.*+?${}()|\^\[\]\/\\])/g, "\\$1");
+/**
+ * Creates RegExp object for `always` mode.
+ * Generated pattern is below:
+ *
+ * 1. First, a marker or nothing.
+ * 2. Next, a space or an exception pattern sequence.
+ *
+ * @param {string[]} markers - A marker list.
+ * @param {string[]} exceptions - A exception pattern list.
+ * @returns {RegExp} A RegExp object for `always` mode.
+ */
+function createAlwaysStylePattern(markers, exceptions) {
+ var pattern = "^";
+
+ // A marker or nothing.
+ // ["*"] ==> "\*?"
+ // ["*", "!"] ==> "(?:\*|!)?"
+ // ["*", "/", "!<"] ==> "(?:\*|\/|(?:!<))?" ==> https://jex.im/regulex/#!embed=false&flags=&re=(%3F%3A%5C*%7C%5C%2F%7C(%3F%3A!%3C))%3F
+ if (markers.length === 1) {
+ // the marker.
+ pattern += escape(markers[0]);
+ } else {
+ // one of markers.
+ pattern += "(?:";
+ pattern += markers.map(escape).join("|");
+ pattern += ")";
}
-
- if (hasExceptions) {
- exceptions = unescapedExceptions.map(escaper);
- exceptionMatcher = new RegExp("(^(" + exceptions.join(")+$)|(^(") + ")+$)");
+ pattern += "?"; // or nothing.
+
+ // A space or an exception pattern sequence.
+ // [] ==> "\s"
+ // ["-"] ==> "(?:\s|\-+$)"
+ // ["-", "="] ==> "(?:\s|(?:\-+|=+)$)"
+ // ["-", "=", "--=="] ==> "(?:\s|(?:\-+|=+|(?:\-\-==)+)$)" ==> https://jex.im/regulex/#!embed=false&flags=&re=(%3F%3A%5Cs%7C(%3F%3A%5C-%2B%7C%3D%2B%7C(%3F%3A%5C-%5C-%3D%3D)%2B)%24)
+ if (exceptions.length === 0) {
+ // a space.
+ pattern += "\\s";
+ } else {
+ // a space or...
+ pattern += "(?:\\s|";
+ if (exceptions.length === 1) {
+ // a sequence of the exception pattern.
+ pattern += escapeAndRepeat(exceptions[0]);
+ } else {
+ // a sequence of one of exception patterns.
+ pattern += "(?:";
+ pattern += exceptions.map(escapeAndRepeat).join("|");
+ pattern += ")";
+ }
+ pattern += "(?:$|[\n\r]))"; // the sequence continues until the end.
}
+ return new RegExp(pattern);
+}
- if (hasMarkers) {
- markers = unescapedMarkers.map(escaper);
-
- // the markerMatcher includes any markers in the list, followed by space/tab
- markerMatcher = new RegExp("((^(" + markers.join("))|(^(") + ")))[ \\t\\n]");
- }
+/**
+ * Creates RegExp object for `never` mode.
+ * Generated pattern is below:
+ *
+ * 1. First, a marker or nothing (captured).
+ * 2. Next, a space or a tab.
+ *
+ * @param {string[]} markers - A marker list.
+ * @returns {RegExp} A RegExp object for `never` mode.
+ */
+function createNeverStylePattern(markers) {
+ var pattern = "^(" + markers.map(escape).join("|") + ")?[ \t]";
+ return new RegExp(pattern);
+}
- /**
- * Check to see if the block comment is jsDoc comment
- * @param {ASTNode} node comment node
- * @returns {boolean} True if its jsdoc comment
- * @private
- */
- function isJsdoc(node) {
- // make sure comment type is block and it start with /**\n
- return node.type === "Block" && jsDocMatcher.test(node.value);
- }
+//------------------------------------------------------------------------------
+// Rule Definition
+//------------------------------------------------------------------------------
+module.exports = function(context) {
+ // Unless the first option is never, require a space
+ var requireSpace = context.options[0] !== "never";
- function checkCommentForSpace(node) {
- var commentIdentifier = node.type === "Block" ? "/*" : "//";
+ // Parse the second options.
+ // If markers don't include `"*"`, it's added automatically for JSDoc comments.
+ var config = context.options[1] || {};
+ var styleRules = ["block", "line"].reduce(function(rule, type) {
+ var markers = parseMarkersOption(config[type] && config[type].markers || config.markers);
+ var exceptions = config[type] && config[type].exceptions || config.exceptions || [];
- if (requireSpace) {
+ // Create RegExp object for valid patterns.
+ rule[type] = {
+ regex: requireSpace ? createAlwaysStylePattern(markers, exceptions) : createNeverStylePattern(markers),
+ hasExceptions: exceptions.length > 0
+ };
- // If length is zero, ignore it
- if (node.value.length === 0) {
- return;
- }
+ return rule;
+ }, {});
- // if comment is jsdoc style then ignore it
- if (isJsdoc(node)) {
- return;
- }
+ /**
+ * Reports a given comment if it's invalid.
+ * @param {ASTNode} node - a comment node to check.
+ * @returns {void}
+ */
+ function checkCommentForSpace(node) {
+ var type = node.type.toLowerCase(),
+ rule = styleRules[type],
+ commentIdentifier = type === "block" ? "/*" : "//";
- // Check for markers now, and short-circuit if found
- if (hasMarkers && markerMatcher.test(node.value)) {
- return;
- }
+ // Ignores empty comments.
+ if (node.value.length === 0) {
+ return;
+ }
- // Space expected and not found
- if (node.value.indexOf(" ") !== 0 && node.value.indexOf("\t") !== 0 && node.value.indexOf("\n") !== 0) {
-
- /*
- * Do two tests; one for space starting the line,
- * and one for a comment comprised only of exceptions
- */
- if (hasExceptions && !exceptionMatcher.test(node.value)) {
- context.report(node, "Expected exception block, space or tab after " + commentIdentifier + " in comment.");
- } else if (!hasExceptions) {
- context.report(node, "Expected space or tab after " + commentIdentifier + " in comment.");
+ // Checks.
+ if (requireSpace) {
+ if (!rule.regex.test(node.value)) {
+ if (rule.hasExceptions) {
+ context.report(node, "Expected exception block, space or tab after \"" + commentIdentifier + "\" in comment.");
+ } else {
+ context.report(node, "Expected space or tab after \"" + commentIdentifier + "\" in comment.");
}
}
-
} else {
-
- if (node.value.indexOf(" ") === 0 || node.value.indexOf("\t") === 0) {
- context.report(node, "Unexpected space or tab after " + commentIdentifier + " in comment.");
- }
- // there won't be a space or tab after commentIdentifier here, but check for the markers and whitespace
- if (hasMarkers && markerMatcher.test(node.value)) {
- var matches = node.value.match(markerMatcher), match = matches.length ? matches[0] : "";
-
- context.report(node, "Unexpected space or tab after marker (" + match + ") in comment.");
+ var matched = rule.regex.exec(node.value);
+ if (matched) {
+ if (!matched[1]) {
+ context.report(node, "Unexpected space or tab after \"" + commentIdentifier + "\" in comment.");
+ } else {
+ context.report(node, "Unexpected space or tab after marker (" + matched[1] + ") in comment.");
+ }
}
}
}
@@ -136,6 +206,42 @@ module.exports.schema = [
"items": {
"type": "string"
}
+ },
+ "line": {
+ "type": "object",
+ "properties": {
+ "exceptions": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ "markers": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ }
+ },
+ "additionalProperties": false
+ },
+ "block": {
+ "type": "object",
+ "properties": {
+ "exceptions": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ "markers": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ }
+ },
+ "additionalProperties": false
}
},
"additionalProperties": false
diff --git a/tools/eslint/lib/rules/spaced-line-comment.js b/tools/eslint/lib/rules/spaced-line-comment.js
deleted file mode 100644
index 1e2d952f294469..00000000000000
--- a/tools/eslint/lib/rules/spaced-line-comment.js
+++ /dev/null
@@ -1,89 +0,0 @@
-/**
- * @fileoverview Enforces or disallows a space beginning a single-line comment.
- * @author Greg Cochard
- * @copyright 2014 Greg Cochard. All rights reserved.
- */
-"use strict";
-
-//------------------------------------------------------------------------------
-// Rule Definition
-//------------------------------------------------------------------------------
-
-module.exports = function(context) {
-
- // Unless the first option is never, require a space
- var requireSpace = context.options[0] !== "never";
-
- // Default to match anything, so all will fail if there are no exceptions
- var exceptionMatcher = new RegExp(" ");
-
- // Grab the exceptions array and build a RegExp matcher for it
- var hasExceptions = context.options.length === 2;
- var unescapedExceptions = hasExceptions ? context.options[1].exceptions : [];
- var exceptions;
-
- if (unescapedExceptions.length) {
- exceptions = unescapedExceptions.map(function(s) {
- return s.replace(/([.*+?${}()|\^\[\]\/\\])/g, "\\$1");
- });
- exceptionMatcher = new RegExp("(^(" + exceptions.join(")+$)|(^(") + ")+$)");
- }
-
-
- //--------------------------------------------------------------------------
- // Public
- //--------------------------------------------------------------------------
-
- return {
-
- "LineComment": function checkCommentForSpace(node) {
-
- if (requireSpace) {
-
- // If length is zero, ignore it
- if (node.value.length === 0) {
- return;
- }
-
- // Space expected and not found
- if (node.value.indexOf(" ") !== 0 && node.value.indexOf("\t") !== 0) {
-
- /*
- * Do two tests; one for space starting the line,
- * and one for a comment comprised only of exceptions
- */
- if (hasExceptions && !exceptionMatcher.test(node.value)) {
- context.report(node, "Expected exception block, space or tab after // in comment.");
- } else if (!hasExceptions) {
- context.report(node, "Expected space or tab after // in comment.");
- }
- }
-
- } else {
-
- if (node.value.indexOf(" ") === 0 || node.value.indexOf("\t") === 0) {
- context.report(node, "Unexpected space or tab after // in comment.");
- }
- }
- }
-
- };
-};
-
-module.exports.schema = [
- {
- "enum": ["always", "never"]
- },
- {
- "type": "object",
- "properties": {
- "exceptions": {
- "type": "array",
- "items": {
- "type": "string"
- }
- }
- },
- "additionalProperties": false
- }
-];
diff --git a/tools/eslint/lib/rules/strict.js b/tools/eslint/lib/rules/strict.js
index a398d7dbecf9dc..3f3b56bc9e1a3f 100644
--- a/tools/eslint/lib/rules/strict.js
+++ b/tools/eslint/lib/rules/strict.js
@@ -17,7 +17,9 @@ var messages = {
global: "Use the global form of \"use strict\".",
multiple: "Multiple \"use strict\" directives.",
never: "Strict mode is not permitted.",
- unnecessary: "Unnecessary \"use strict\" directive."
+ unnecessary: "Unnecessary \"use strict\" directive.",
+ unnecessaryInModules: "\"use strict\" is unnecessary inside of modules.",
+ unnecessaryInClasses: "\"use strict\" is unnecessary inside of classes."
};
/**
@@ -53,10 +55,7 @@ function getUseStrictDirectives(statements) {
module.exports = function(context) {
- var mode = context.options[0],
- isModule = context.ecmaFeatures.modules,
- modes = {},
- scopes = [];
+ var mode = context.options[0];
/**
* Report a node or array of nodes with a given message.
@@ -77,117 +76,87 @@ module.exports = function(context) {
}
//--------------------------------------------------------------------------
- // "deprecated" mode (default)
+ // "never" mode
//--------------------------------------------------------------------------
- /**
- * Determines if a given node is "use strict".
- * @param {ASTNode} node The node to check.
- * @returns {boolean} True if the node is a strict pragma, false if not.
- * @void
- */
- function isStrictPragma(node) {
- return (node && node.type === "ExpressionStatement" &&
- node.expression.value === "use strict");
- }
-
- /**
- * When you enter a scope, push the strict value from the previous scope
- * onto the stack.
- * @param {ASTNode} node The AST node being checked.
- * @returns {void}
- * @private
- */
- function enterScope(node) {
-
- var isStrict = false,
- isProgram = (node.type === "Program"),
- isParentGlobal = scopes.length === 1,
- isParentStrict = scopes.length ? scopes[scopes.length - 1] : false;
-
- // look for the "use strict" pragma
- if (isModule) {
- isStrict = true;
- } else if (isProgram) {
- isStrict = isStrictPragma(node.body[0]) || isParentStrict;
- } else {
- isStrict = node.body.body && isStrictPragma(node.body.body[0]) || isParentStrict;
- }
-
- scopes.push(isStrict);
-
- // never warn if the parent is strict or the function is strict
- if (!isParentStrict && !isStrict && isParentGlobal) {
- context.report(node, "Missing \"use strict\" statement.");
- }
- }
-
- /**
- * When you exit a scope, pop off the top scope and see if it's true or
- * false.
- * @returns {void}
- * @private
- */
- function exitScope() {
- scopes.pop();
+ if (mode === "never") {
+ return {
+ "Program": function(node) {
+ report(getUseStrictDirectives(node.body), messages.never);
+ },
+ "FunctionDeclaration": function(node) {
+ report(getUseStrictDirectives(node.body.body), messages.never);
+ },
+ "FunctionExpression": function(node) {
+ report(getUseStrictDirectives(node.body.body), messages.never);
+ },
+ "ArrowFunctionExpression": function(node) {
+ if (node.body.type === "BlockStatement") {
+ report(getUseStrictDirectives(node.body.body), messages.never);
+ }
+ }
+ };
}
- modes.deprecated = {
- "Program": enterScope,
- "FunctionDeclaration": enterScope,
- "FunctionExpression": enterScope,
- "ArrowFunctionExpression": enterScope,
-
- "Program:exit": exitScope,
- "FunctionDeclaration:exit": exitScope,
- "FunctionExpression:exit": exitScope,
- "ArrowFunctionExpression:exit": exitScope
- };
-
//--------------------------------------------------------------------------
- // "never" mode
+ // If this is modules, all "use strict" directives are unnecessary.
//--------------------------------------------------------------------------
- modes.never = {
- "Program": function(node) {
- report(getUseStrictDirectives(node.body), messages.never);
- },
- "FunctionDeclaration": function(node) {
- report(getUseStrictDirectives(node.body.body), messages.never);
- },
- "FunctionExpression": function(node) {
- report(getUseStrictDirectives(node.body.body), messages.never);
- }
- };
+ if (context.ecmaFeatures.modules) {
+ return {
+ "Program": function(node) {
+ report(getUseStrictDirectives(node.body), messages.unnecessaryInModules);
+ },
+ "FunctionDeclaration": function(node) {
+ report(getUseStrictDirectives(node.body.body), messages.unnecessaryInModules);
+ },
+ "FunctionExpression": function(node) {
+ report(getUseStrictDirectives(node.body.body), messages.unnecessaryInModules);
+ },
+ "ArrowFunctionExpression": function(node) {
+ if (node.body.type === "BlockStatement") {
+ report(getUseStrictDirectives(node.body.body), messages.unnecessaryInModules);
+ }
+ }
+ };
+ }
//--------------------------------------------------------------------------
// "global" mode
//--------------------------------------------------------------------------
- modes.global = {
- "Program": function(node) {
- var useStrictDirectives = getUseStrictDirectives(node.body);
-
- if (!isModule && node.body.length && useStrictDirectives.length < 1) {
- report(node, messages.global);
- } else if (isModule) {
- report(useStrictDirectives, messages.unnecessary);
- } else {
- report(useStrictDirectives.slice(1), messages.multiple);
+ if (mode === "global") {
+ return {
+ "Program": function(node) {
+ var useStrictDirectives = getUseStrictDirectives(node.body);
+
+ if (node.body.length > 0 && useStrictDirectives.length === 0) {
+ report(node, messages.global);
+ } else {
+ report(useStrictDirectives.slice(1), messages.multiple);
+ }
+ },
+ "FunctionDeclaration": function(node) {
+ report(getUseStrictDirectives(node.body.body), messages.global);
+ },
+ "FunctionExpression": function(node) {
+ report(getUseStrictDirectives(node.body.body), messages.global);
+ },
+ "ArrowFunctionExpression": function(node) {
+ if (node.body.type === "BlockStatement") {
+ report(getUseStrictDirectives(node.body.body), messages.global);
+ }
}
- },
- "FunctionDeclaration": function(node) {
- report(getUseStrictDirectives(node.body.body), messages.global);
- },
- "FunctionExpression": function(node) {
- report(getUseStrictDirectives(node.body.body), messages.global);
- }
- };
+ };
+ }
//--------------------------------------------------------------------------
- // "function" mode
+ // "function" mode (Default)
//--------------------------------------------------------------------------
+ var scopes = [],
+ classScopes = [];
+
/**
* Entering a function pushes a new nested scope onto the stack. The new
* scope is true if the nested function is strict mode code.
@@ -195,18 +164,22 @@ module.exports = function(context) {
* @returns {void}
*/
function enterFunction(node) {
- var useStrictDirectives = getUseStrictDirectives(node.body.body),
- isParentGlobal = scopes.length === 0,
- isParentStrict = isModule || (scopes.length && scopes[scopes.length - 1]),
- isStrict = useStrictDirectives.length > 0 || isModule;
+ var isInClass = classScopes.length > 0,
+ isParentGlobal = scopes.length === 0 && classScopes.length === 0,
+ isParentStrict = scopes.length > 0 && scopes[scopes.length - 1],
+ isNotBlock = node.body.type !== "BlockStatement",
+ useStrictDirectives = isNotBlock ? [] : getUseStrictDirectives(node.body.body),
+ isStrict = useStrictDirectives.length > 0;
if (isStrict) {
- if (isParentStrict && useStrictDirectives.length) {
+ if (isParentStrict) {
report(useStrictDirectives[0], messages.unnecessary);
+ } else if (isInClass) {
+ report(useStrictDirectives[0], messages.unnecessaryInClasses);
}
report(useStrictDirectives.slice(1), messages.multiple);
- } else if (isParentGlobal && !isModule) {
+ } else if (isParentGlobal) {
report(node, messages.function);
}
@@ -221,18 +194,27 @@ module.exports = function(context) {
scopes.pop();
}
- modes.function = {
+ return {
"Program": function(node) {
report(getUseStrictDirectives(node.body), messages.function);
},
+
+ // Inside of class bodies are always strict mode.
+ "ClassBody": function() {
+ classScopes.push(true);
+ },
+ "ClassBody:exit": function() {
+ classScopes.pop();
+ },
+
"FunctionDeclaration": enterFunction,
"FunctionExpression": enterFunction,
+ "ArrowFunctionExpression": enterFunction,
+
"FunctionDeclaration:exit": exitFunction,
- "FunctionExpression:exit": exitFunction
+ "FunctionExpression:exit": exitFunction,
+ "ArrowFunctionExpression:exit": exitFunction
};
-
- return modes[mode || "deprecated"];
-
};
module.exports.schema = [
diff --git a/tools/eslint/lib/rules/use-isnan.js b/tools/eslint/lib/rules/use-isnan.js
index f5c327f4bcdb0b..7d65f9c0d85921 100644
--- a/tools/eslint/lib/rules/use-isnan.js
+++ b/tools/eslint/lib/rules/use-isnan.js
@@ -11,10 +11,10 @@
// Rule Definition
//------------------------------------------------------------------------------
-module.exports = function (context) {
+module.exports = function(context) {
return {
- "BinaryExpression": function (node) {
+ "BinaryExpression": function(node) {
if (/^(?:[<>]|[!=]=)=?$/.test(node.operator) && (node.left.name === "NaN" || node.right.name === "NaN")) {
context.report(node, "Use the isNaN function to compare with NaN.");
}
diff --git a/tools/eslint/lib/rules/valid-jsdoc.js b/tools/eslint/lib/rules/valid-jsdoc.js
index bab6037d17663b..2832a8a5d064ed 100644
--- a/tools/eslint/lib/rules/valid-jsdoc.js
+++ b/tools/eslint/lib/rules/valid-jsdoc.js
@@ -19,11 +19,13 @@ module.exports = function(context) {
var options = context.options[0] || {},
prefer = options.prefer || {},
+ sourceCode = context.getSourceCode(),
// these both default to true, so you have to explicitly make them false
requireReturn = options.requireReturn !== false,
requireParamDescription = options.requireParamDescription !== false,
- requireReturnDescription = options.requireReturnDescription !== false;
+ requireReturnDescription = options.requireReturnDescription !== false,
+ requireReturnType = options.requireReturnType !== false;
//--------------------------------------------------------------------------
// Helpers
@@ -32,13 +34,27 @@ module.exports = function(context) {
// Using a stack to store if a function returns or not (handling nested functions)
var fns = [];
+ /**
+ * Check if node type is a Class
+ * @param {ASTNode} node node to check.
+ * @returns {boolean} True is its a class
+ * @private
+ */
+ function isTypeClass(node) {
+ return node.type === "ClassExpression" || node.type === "ClassDeclaration";
+ }
+
/**
* When parsing a new function, store it in our function stack.
+ * @param {ASTNode} node A function node to check.
* @returns {void}
* @private
*/
- function startFunction() {
- fns.push({returnPresent: false});
+ function startFunction(node) {
+ fns.push({
+ returnPresent: (node.type === "ArrowFunctionExpression" && node.body.type !== "BlockStatement") ||
+ isTypeClass(node)
+ });
}
/**
@@ -55,6 +71,16 @@ module.exports = function(context) {
}
}
+ /**
+ * Check if return tag type is void or undefined
+ * @param {Object} tag JSDoc tag
+ * @returns {boolean} True if its of type void or undefined
+ * @private
+ */
+ function isValidReturnType(tag) {
+ return tag.type === null || tag.type.name === "void" || tag.type.type === "UndefinedLiteral";
+ }
+
/**
* Validate the JSDoc node and output warnings if anything is wrong.
* @param {ASTNode} node The AST node to check.
@@ -62,10 +88,11 @@ module.exports = function(context) {
* @private
*/
function checkJSDoc(node) {
- var jsdocNode = context.getJSDocComment(node),
+ var jsdocNode = sourceCode.getJSDocComment(node),
functionData = fns.pop(),
hasReturns = false,
hasConstructor = false,
+ isOverride = false,
params = Object.create(null),
jsdoc;
@@ -94,6 +121,8 @@ module.exports = function(context) {
switch (tag.title) {
case "param":
+ case "arg":
+ case "argument":
if (!tag.type) {
context.report(jsdocNode, "Missing JSDoc parameter type for '{{name}}'.", { name: tag.name });
}
@@ -113,14 +142,14 @@ module.exports = function(context) {
case "returns":
hasReturns = true;
- if (!requireReturn && !functionData.returnPresent && tag.type.name !== "void" && tag.type.name !== "undefined") {
+ if (!requireReturn && !functionData.returnPresent && (tag.type === null || !isValidReturnType(tag))) {
context.report(jsdocNode, "Unexpected @" + tag.title + " tag; function has no return statement.");
} else {
- if (!tag.type) {
+ if (requireReturnType && !tag.type) {
context.report(jsdocNode, "Missing JSDoc return type.");
}
- if (tag.type.name !== "void" && !tag.description && requireReturnDescription) {
+ if (!isValidReturnType(tag) && !tag.description && requireReturnDescription) {
context.report(jsdocNode, "Missing JSDoc return description.");
}
}
@@ -132,43 +161,58 @@ module.exports = function(context) {
hasConstructor = true;
break;
+ case "override":
+ case "inheritdoc":
+ isOverride = true;
+ break;
+
// no default
}
// check tag preferences
- if (prefer.hasOwnProperty(tag.title)) {
+ if (prefer.hasOwnProperty(tag.title) && tag.title !== prefer[tag.title]) {
context.report(jsdocNode, "Use @{{name}} instead.", { name: prefer[tag.title] });
}
});
// check for functions missing @returns
- if (!hasReturns && !hasConstructor && node.parent.kind !== "get") {
+ if (!isOverride && !hasReturns && !hasConstructor && node.parent.kind !== "get" && !isTypeClass(node)) {
if (requireReturn || functionData.returnPresent) {
- context.report(jsdocNode, "Missing JSDoc @returns for function.");
+ context.report(jsdocNode, "Missing JSDoc @" + (prefer.returns || "returns") + " for function.");
}
}
// check the parameters
var jsdocParams = Object.keys(params);
- node.params.forEach(function(param, i) {
- var name = param.name;
-
- // TODO(nzakas): Figure out logical things to do with destructured, default, rest params
- if (param.type === "Identifier") {
- if (jsdocParams[i] && (name !== jsdocParams[i])) {
- context.report(jsdocNode, "Expected JSDoc for '{{name}}' but found '{{jsdocName}}'.", {
- name: name,
- jsdocName: jsdocParams[i]
- });
- } else if (!params[name]) {
- context.report(jsdocNode, "Missing JSDoc for parameter '{{name}}'.", {
- name: name
- });
+ if (node.params) {
+ node.params.forEach(function(param, i) {
+ var name = param.name;
+
+ // TODO(nzakas): Figure out logical things to do with destructured, default, rest params
+ if (param.type === "Identifier") {
+ if (jsdocParams[i] && (name !== jsdocParams[i])) {
+ context.report(jsdocNode, "Expected JSDoc for '{{name}}' but found '{{jsdocName}}'.", {
+ name: name,
+ jsdocName: jsdocParams[i]
+ });
+ } else if (!params[name] && !isOverride) {
+ context.report(jsdocNode, "Missing JSDoc for parameter '{{name}}'.", {
+ name: name
+ });
+ }
}
+ });
+ }
+
+ if (options.matchDescription) {
+ var regex = new RegExp(options.matchDescription);
+
+ if (!regex.test(jsdoc.description)) {
+ context.report(jsdocNode, "JSDoc description does not satisfy the regex pattern.");
}
- });
+ }
}
@@ -182,9 +226,13 @@ module.exports = function(context) {
"ArrowFunctionExpression": startFunction,
"FunctionExpression": startFunction,
"FunctionDeclaration": startFunction,
+ "ClassExpression": startFunction,
+ "ClassDeclaration": startFunction,
"ArrowFunctionExpression:exit": checkJSDoc,
"FunctionExpression:exit": checkJSDoc,
"FunctionDeclaration:exit": checkJSDoc,
+ "ClassExpression:exit": checkJSDoc,
+ "ClassDeclaration:exit": checkJSDoc,
"ReturnStatement": addReturn
};
@@ -208,6 +256,12 @@ module.exports.schema = [
},
"requireReturnDescription": {
"type": "boolean"
+ },
+ "matchDescription": {
+ "type": "string"
+ },
+ "requireReturnType": {
+ "type": "boolean"
}
},
"additionalProperties": false
diff --git a/tools/eslint/lib/rules/valid-typeof.js b/tools/eslint/lib/rules/valid-typeof.js
index cbeb7b12e8f800..d67a46bf3dd7ce 100644
--- a/tools/eslint/lib/rules/valid-typeof.js
+++ b/tools/eslint/lib/rules/valid-typeof.js
@@ -19,7 +19,7 @@ module.exports = function(context) {
return {
- "UnaryExpression": function (node) {
+ "UnaryExpression": function(node) {
var parent, sibling;
if (node.operator === "typeof") {
diff --git a/tools/eslint/lib/rules/vars-on-top.js b/tools/eslint/lib/rules/vars-on-top.js
index 5917c674ec4680..84af6477a0ef29 100644
--- a/tools/eslint/lib/rules/vars-on-top.js
+++ b/tools/eslint/lib/rules/vars-on-top.js
@@ -11,7 +11,7 @@
// Rule Definition
//------------------------------------------------------------------------------
-module.exports = function (context) {
+module.exports = function(context) {
var errorMessage = "All \"var\" declarations must be at the top of the function scope.";
//--------------------------------------------------------------------------
@@ -95,13 +95,13 @@ module.exports = function (context) {
//--------------------------------------------------------------------------
return {
- "VariableDeclaration": function (node) {
+ "VariableDeclaration": function(node) {
var ancestors = context.getAncestors();
var parent = ancestors.pop();
var grandParent = ancestors.pop();
- if (node.kind === "var") {// check variable is `var` type and not `let` or `const`
- if (parent.type === "Program") {// That means its a global variable
+ if (node.kind === "var") { // check variable is `var` type and not `let` or `const`
+ if (parent.type === "Program") { // That means its a global variable
globalVarCheck(node, parent);
} else {
blockScopeVarCheck(node, parent, grandParent);
diff --git a/tools/eslint/lib/rules/wrap-iife.js b/tools/eslint/lib/rules/wrap-iife.js
index 6291425efb86f9..87d4d5ed696655 100644
--- a/tools/eslint/lib/rules/wrap-iife.js
+++ b/tools/eslint/lib/rules/wrap-iife.js
@@ -14,6 +14,12 @@ module.exports = function(context) {
var style = context.options[0] || "outside";
+ /**
+ * Check if the node is wrapped in ()
+ * @param {ASTNode} node node to evaluate
+ * @returns {boolean} True if it is wrapped
+ * @private
+ */
function wrapped(node) {
var previousToken = context.getTokenBefore(node),
nextToken = context.getTokenAfter(node);
diff --git a/tools/eslint/lib/rules/yoda.js b/tools/eslint/lib/rules/yoda.js
index ab5e7d04c92bdb..57ac261b95a790 100644
--- a/tools/eslint/lib/rules/yoda.js
+++ b/tools/eslint/lib/rules/yoda.js
@@ -114,7 +114,7 @@ function same(a, b) {
// Rule Definition
//------------------------------------------------------------------------------
-module.exports = function (context) {
+module.exports = function(context) {
// Default to "never" (!always) if no option
var always = (context.options[0] === "always");
@@ -197,6 +197,7 @@ module.exports = function (context) {
// Comparisons must always be yoda-style: if ("blue" === color)
if (
(node.right.type === "Literal" || looksLikeLiteral(node.right)) &&
+ !(node.left.type === "Literal" || looksLikeLiteral(node.left)) &&
!(!isEqualityOperator(node.operator) && onlyEquality) &&
isComparisonOperator(node.operator) &&
!(exceptRange && isRangeTest(context.getAncestors().pop()))
@@ -209,6 +210,7 @@ module.exports = function (context) {
// Comparisons must never be yoda-style (default)
if (
(node.left.type === "Literal" || looksLikeLiteral(node.left)) &&
+ !(node.right.type === "Literal" || looksLikeLiteral(node.right)) &&
!(!isEqualityOperator(node.operator) && onlyEquality) &&
isComparisonOperator(node.operator) &&
!(exceptRange && isRangeTest(context.getAncestors().pop()))
diff --git a/tools/eslint/lib/testers/event-generator-tester.js b/tools/eslint/lib/testers/event-generator-tester.js
new file mode 100644
index 00000000000000..ce2f3c8cc1f1d8
--- /dev/null
+++ b/tools/eslint/lib/testers/event-generator-tester.js
@@ -0,0 +1,63 @@
+/**
+ * @fileoverview Helpers to test EventGenerator interface.
+ * @author Toru Nagashima
+ * @copyright 2015 Toru Nagashima. All rights reserved.
+ * See LICENSE file in root directory for full license.
+ */
+"use strict";
+
+/* global describe, it */
+
+//------------------------------------------------------------------------------
+// Requirements
+//------------------------------------------------------------------------------
+
+var assert = require("assert");
+
+//------------------------------------------------------------------------------
+// Public Interface
+//------------------------------------------------------------------------------
+
+module.exports = {
+ /**
+ * Overrideable `describe` function to test.
+ * @param {string} text - A description.
+ * @param {function} method - A test logic.
+ * @returns {any} The returned value with the test logic.
+ */
+ describe: (typeof describe === "function") ? describe : function(text, method) {
+ return method.apply(this);
+ },
+
+ /**
+ * Overrideable `it` function to test.
+ * @param {string} text - A description.
+ * @param {function} method - A test logic.
+ * @returns {any} The returned value with the test logic.
+ */
+ it: (typeof it === "function") ? it : function(text, method) {
+ return method.apply(this);
+ },
+
+ /**
+ * Does some tests to check a given object implements the EventGenerator interface.
+ * @param {object} instance - An object to check.
+ * @returns {void}
+ */
+ testEventGeneratorInterface: function(instance) {
+ this.describe("should implement EventGenerator interface", function() {
+ this.it("should have `emitter` property.", function() {
+ assert.equal(typeof instance.emitter, "object");
+ assert.equal(typeof instance.emitter.emit, "function");
+ });
+
+ this.it("should have `enterNode` property.", function() {
+ assert.equal(typeof instance.enterNode, "function");
+ });
+
+ this.it("should have `leaveNode` property.", function() {
+ assert.equal(typeof instance.leaveNode, "function");
+ });
+ }.bind(this));
+ }
+};
diff --git a/tools/eslint/lib/testers/rule-tester.js b/tools/eslint/lib/testers/rule-tester.js
new file mode 100644
index 00000000000000..5a8b8a4701eca2
--- /dev/null
+++ b/tools/eslint/lib/testers/rule-tester.js
@@ -0,0 +1,421 @@
+/**
+ * @fileoverview Mocha test wrapper
+ * @author Ilya Volodin
+ * @copyright 2015 Kevin Partington. All rights reserved.
+ * @copyright 2015 Nicholas C. Zakas. All rights reserved.
+ * @copyright 2014 Ilya Volodin. All rights reserved.
+ * See LICENSE file in root directory for full license.
+ */
+"use strict";
+
+/* global describe, it */
+
+/*
+ * This is a wrapper around mocha to allow for DRY unittests for eslint
+ * Format:
+ * RuleTester.add("{ruleName}", {
+ * valid: [
+ * "{code}",
+ * { code: "{code}", options: {options}, global: {globals}, globals: {globals}, parser: "{parser}", settings: {settings} }
+ * ],
+ * invalid: [
+ * { code: "{code}", errors: {numErrors} },
+ * { code: "{code}", errors: ["{errorMessage}"] },
+ * { code: "{code}", options: {options}, global: {globals}, parser: "{parser}", settings: {settings}, errors: [{ message: "{errorMessage}", type: "{errorNodeType}"}] }
+ * ]
+ * });
+ *
+ * Variables:
+ * {code} - String that represents the code to be tested
+ * {options} - Arguments that are passed to the configurable rules.
+ * {globals} - An object representing a list of variables that are
+ * registered as globals
+ * {parser} - String representing the parser to use
+ * {settings} - An object representing global settings for all rules
+ * {numErrors} - If failing case doesn't need to check error message,
+ * this integer will specify how many errors should be
+ * received
+ * {errorMessage} - Message that is returned by the rule on failure
+ * {errorNodeType} - AST node type that is returned by they rule as
+ * a cause of the failure.
+ *
+ * Requirements:
+ * Each rule has to have at least one invalid and at least one valid check.
+ * If one of them is missing, the test will be marked as failed.
+ */
+
+//------------------------------------------------------------------------------
+// Requirements
+//------------------------------------------------------------------------------
+
+var assert = require("assert"),
+ util = require("util"),
+ merge = require("lodash.merge"),
+ omit = require("lodash.omit"),
+ clone = require("lodash.clonedeep"),
+ validator = require("../config/config-validator"),
+ validate = require("is-my-json-valid"),
+ eslint = require("../eslint"),
+ rules = require("../rules"),
+ metaSchema = require("../../conf/json-schema-schema.json"),
+ SourceCodeFixer = require("../util/source-code-fixer");
+
+//------------------------------------------------------------------------------
+// Private Members
+//------------------------------------------------------------------------------
+// testerDefaultConfig must not be modified as it allows to reset the tester to
+// the initial default configuration
+var testerDefaultConfig = { rules: {} };
+var defaultConfig = { rules: {} };
+// List every parameters possible on a test case that are not related to eslint
+// configuration
+var RuleTesterParameters = [
+ "code",
+ "filename",
+ "options",
+ "args",
+ "errors"
+];
+
+var validateSchema = validate(metaSchema, { verbose: true });
+
+var hasOwnProperty = Function.call.bind(Object.hasOwnProperty);
+
+/**
+ * Clones a given value deeply.
+ * Note: This ignores `parent` property.
+ *
+ * @param {any} x - A value to clone.
+ * @returns {any} A cloned value.
+ */
+function cloneDeeplyExcludesParent(x) {
+ if (typeof x === "object" && x !== null) {
+ if (Array.isArray(x)) {
+ return x.map(cloneDeeplyExcludesParent);
+ }
+
+ var retv = {};
+ for (var key in x) {
+ if (key !== "parent" && hasOwnProperty(x, key)) {
+ retv[key] = cloneDeeplyExcludesParent(x[key]);
+ }
+ }
+
+ return retv;
+ }
+
+ return x;
+}
+
+/**
+ * Freezes a given value deeply.
+ *
+ * @param {any} x - A value to freeze.
+ * @returns {void}
+ */
+function freezeDeeply(x) {
+ if (typeof x === "object" && x !== null) {
+ if (Array.isArray(x)) {
+ x.forEach(freezeDeeply);
+ } else {
+ for (var key in x) {
+ if (key !== "parent" && hasOwnProperty(x, key)) {
+ freezeDeeply(x[key]);
+ }
+ }
+ }
+ Object.freeze(x);
+ }
+}
+
+//------------------------------------------------------------------------------
+// Public Interface
+//------------------------------------------------------------------------------
+
+/**
+ * Creates a new instance of RuleTester.
+ * @param {Object} [testerConfig] Optional, extra configuration for the tester
+ * @constructor
+ */
+function RuleTester(testerConfig) {
+
+ /**
+ * The configuration to use for this tester. Combination of the tester
+ * configuration and the default configuration.
+ * @type {Object}
+ */
+ this.testerConfig = merge(
+ // we have to clone because merge uses the object on the left for
+ // recipient
+ clone(defaultConfig),
+ testerConfig
+ );
+}
+
+/**
+ * Set the configuration to use for all future tests
+ * @param {Object} config the configuration to use.
+ * @returns {void}
+ */
+RuleTester.setDefaultConfig = function(config) {
+ if (typeof config !== "object") {
+ throw new Error("RuleTester.setDefaultConfig: config must be an object");
+ }
+ defaultConfig = config;
+
+ // Make sure the rules object exists since it is assumed to exist later
+ defaultConfig.rules = defaultConfig.rules || {};
+};
+
+/**
+ * Get the current configuration used for all tests
+ * @returns {Object} the current configuration
+ */
+RuleTester.getDefaultConfig = function() {
+ return defaultConfig;
+};
+
+/**
+ * Reset the configuration to the initial configuration of the tester removing
+ * any changes made until now.
+ * @returns {void}
+ */
+RuleTester.resetDefaultConfig = function() {
+ defaultConfig = clone(testerDefaultConfig);
+};
+
+// default separators for testing
+RuleTester.describe = (typeof describe === "function") ? describe : function(text, method) {
+ return method.apply(this);
+};
+
+RuleTester.it = (typeof it === "function") ? it : function(text, method) {
+ return method.apply(this);
+};
+
+RuleTester.prototype = {
+
+ /**
+ * Define a rule for one particular run of tests.
+ * @param {string} name The name of the rule to define.
+ * @param {Function} rule The rule definition.
+ * @returns {void}
+ */
+ defineRule: function(name, rule) {
+ eslint.defineRule(name, rule);
+ },
+
+ /**
+ * Adds a new rule test to execute.
+ * @param {string} ruleName The name of the rule to run.
+ * @param {Function} rule The rule to test.
+ * @param {Object} test The collection of tests to run.
+ * @returns {void}
+ */
+ run: function(ruleName, rule, test) {
+
+ var testerConfig = this.testerConfig,
+ result = {};
+
+ /* eslint-disable no-shadow */
+
+ /**
+ * Run the rule for the given item
+ * @param {string} ruleName name of the rule
+ * @param {string|object} item Item to run the rule against
+ * @returns {object} Eslint run result
+ * @private
+ */
+ function runRuleForItem(ruleName, item) {
+ var config = clone(testerConfig),
+ code, filename, schema, beforeAST, afterAST;
+
+ if (typeof item === "string") {
+ code = item;
+ } else {
+ code = item.code;
+ // Assumes everything on the item is a config except for the
+ // parameters used by this tester
+ var itemConfig = omit(item, RuleTesterParameters);
+ // Create the config object from the tester config and this item
+ // specific configurations.
+ config = merge(
+ config,
+ itemConfig
+ );
+ }
+
+ if (item.filename) {
+ filename = item.filename;
+ }
+
+ if (item.options) {
+ var options = item.options.concat();
+ options.unshift(1);
+ config.rules[ruleName] = options;
+ } else {
+ config.rules[ruleName] = 1;
+ }
+
+ eslint.defineRule(ruleName, rule);
+
+ schema = validator.getRuleOptionsSchema(ruleName);
+
+ validateSchema(schema);
+
+ if (validateSchema.errors) {
+ throw new Error([
+ "Schema for rule " + ruleName + " is invalid:"
+ ].concat(validateSchema.errors.map(function(error) {
+ return "\t" + error.field + ": " + error.message;
+ })).join("\n"));
+ }
+
+ validator.validate(config, "rule-tester");
+
+ // Setup AST getters.
+ // To check whether or not AST was not modified in verify.
+ eslint.reset();
+ eslint.on("Program", function(node) {
+ beforeAST = cloneDeeplyExcludesParent(node);
+
+ eslint.on("Program:exit", function(node) {
+ afterAST = cloneDeeplyExcludesParent(node);
+ });
+ });
+
+ // Freezes rule-context properties.
+ var originalGet = rules.get;
+ try {
+ rules.get = function(ruleId) {
+ var rule = originalGet(ruleId);
+ return function(context) {
+ Object.freeze(context);
+ freezeDeeply(context.options);
+ freezeDeeply(context.settings);
+ freezeDeeply(context.ecmaFeatures);
+
+ return rule(context);
+ };
+ };
+
+ return {
+ messages: eslint.verify(code, config, filename, true),
+ beforeAST: beforeAST,
+ afterAST: afterAST
+ };
+ } finally {
+ rules.get = originalGet;
+ }
+ }
+
+ /**
+ * Check if the template is valid or not
+ * all valid cases go through this
+ * @param {string} ruleName name of the rule
+ * @param {string|object} item Item to run the rule against
+ * @returns {void}
+ * @private
+ */
+ function testValidTemplate(ruleName, item) {
+ var result = runRuleForItem(ruleName, item);
+ var messages = result.messages;
+
+ assert.equal(messages.length, 0, util.format("Should have no errors but had %d: %s",
+ messages.length, util.inspect(messages)));
+
+ assert.deepEqual(
+ result.beforeAST,
+ result.afterAST,
+ "Rule should not modify AST."
+ );
+ }
+
+ /**
+ * Check if the template is invalid or not
+ * all invalid cases go through this.
+ * @param {string} ruleName name of the rule
+ * @param {string|object} item Item to run the rule against
+ * @returns {void}
+ * @private
+ */
+ function testInvalidTemplate(ruleName, item) {
+ var result = runRuleForItem(ruleName, item);
+ var messages = result.messages;
+
+ if (typeof item.errors === "number") {
+ assert.equal(messages.length, item.errors, util.format("Should have %d errors but had %d: %s",
+ item.errors, messages.length, util.inspect(messages)));
+ } else {
+ assert.equal(messages.length, item.errors.length,
+ util.format("Should have %d errors but had %d: %s",
+ item.errors.length, messages.length, util.inspect(messages)));
+
+ if (item.hasOwnProperty("output")) {
+ var fixResult = SourceCodeFixer.applyFixes(eslint.getSourceCode(), messages);
+ assert.equal(fixResult.output, item.output, "Output is incorrect.");
+ }
+
+ for (var i = 0, l = item.errors.length; i < l; i++) {
+ assert.ok(!("fatal" in messages[i]), "A fatal parsing error occurred: " + messages[i].message);
+ assert.equal(messages[i].ruleId, ruleName, "Error rule name should be the same as the name of the rule being tested");
+
+ if (typeof item.errors[i] === "string") {
+ // Just an error message.
+
+ assert.equal(messages[i].message, item.errors[i], "Error message should be " + item.errors[i]);
+ } else if (typeof item.errors[i] === "object") {
+ // Error object. This may have a message, node type,
+ // line, and/or column.
+
+ if (item.errors[i].message) {
+ assert.equal(messages[i].message, item.errors[i].message, "Error message should be " + item.errors[i].message);
+ }
+
+ if (item.errors[i].type) {
+ assert.equal(messages[i].nodeType, item.errors[i].type, "Error type should be " + item.errors[i].type);
+ }
+
+ if (item.errors[i].hasOwnProperty("line")) {
+ assert.equal(messages[i].line, item.errors[i].line, "Error line should be " + item.errors[i].line);
+ }
+
+ if (item.errors[i].hasOwnProperty("column")) {
+ assert.equal(messages[i].column, item.errors[i].column, "Error column should be " + item.errors[i].column);
+ }
+ } else {
+ // Only string or object errors are valid.
+ assert.fail(messages[i], null, "Error should be a string or object.");
+ }
+ }
+ }
+
+ assert.deepEqual(
+ result.beforeAST,
+ result.afterAST,
+ "Rule should not modify AST."
+ );
+ }
+
+ // this creates a mocha test suite and pipes all supplied info
+ // through one of the templates above.
+ RuleTester.describe(ruleName, function() {
+ test.valid.forEach(function(valid) {
+ RuleTester.it(valid.code || valid, function() {
+ testValidTemplate(ruleName, valid);
+ });
+ });
+
+ test.invalid.forEach(function(invalid) {
+ RuleTester.it(invalid.code, function() {
+ testInvalidTemplate(ruleName, invalid);
+ });
+ });
+ });
+
+ return result.suite;
+ }
+};
+
+
+module.exports = RuleTester;
diff --git a/tools/eslint/lib/timing.js b/tools/eslint/lib/timing.js
index 06e8da70b97e58..3af3a43c58e9e7 100644
--- a/tools/eslint/lib/timing.js
+++ b/tools/eslint/lib/timing.js
@@ -11,11 +11,27 @@
//------------------------------------------------------------------------------
/* istanbul ignore next */
+/**
+ * Align the string to left
+ * @param {string} str string to evaluate
+ * @param {int} len length of the string
+ * @param {string} ch delimiter character
+ * @returns {string} modified string
+ * @private
+ */
function alignLeft(str, len, ch) {
return str + new Array(len - str.length + 1).join(ch || " ");
}
/* istanbul ignore next */
+/**
+ * Align the string to right
+ * @param {string} str string to evaluate
+ * @param {int} len length of the string
+ * @param {string} ch delimiter character
+ * @returns {string} modified string
+ * @private
+ */
function alignRight(str, len, ch) {
return new Array(len - str.length + 1).join(ch || " ") + str;
}
@@ -30,6 +46,12 @@ var HEADERS = ["Rule", "Time (ms)", "Relative"];
var ALIGN = [alignLeft, alignRight, alignRight];
/* istanbul ignore next */
+/**
+ * display the data
+ * @param {object} data Data object to be displayed
+ * @returns {string} modified string
+ * @private
+ */
function display(data) {
var total = 0;
var rows = Object.keys(data)
@@ -82,6 +104,13 @@ module.exports = (function() {
var data = Object.create(null);
+ /**
+ * Time the run
+ * @param {*} key key from the data object
+ * @param {Function} fn function to be called
+ * @returns {Function} function to be executed
+ * @private
+ */
function time(key, fn) {
if (typeof data[key] === "undefined") {
data[key] = 0;
diff --git a/tools/eslint/lib/util.js b/tools/eslint/lib/util.js
index 9fe594a4aed093..fb1a7a33d5de19 100644
--- a/tools/eslint/lib/util.js
+++ b/tools/eslint/lib/util.js
@@ -14,72 +14,36 @@ var PLUGIN_NAME_PREFIX = "eslint-plugin-",
// Public Interface
//------------------------------------------------------------------------------
-/**
- * Merges two config objects. This will not only add missing keys, but will also modify values to match.
- * @param {Object} base config object
- * @param {Object} custom config object. Overrides in this config object will take priority over base.
- * @returns {Object} merged config object.
- */
-exports.mergeConfigs = function mergeConfigs(base, custom) {
-
- Object.keys(custom).forEach(function (key) {
- var property = custom[key];
-
- if (key === "plugins") {
- if (!base[key]) {
- base[key] = [];
- }
-
- property.forEach(function (plugin) {
- // skip duplicates
- if (base[key].indexOf(plugin) === -1) {
- base[key].push(plugin);
- }
- });
- return;
- }
-
- if (Array.isArray(base[key]) && !Array.isArray(property) && typeof property === "number") {
- // assume that we are just overriding first attribute
- base[key][0] = custom[key];
- return;
- }
-
- if (typeof property === "object" && !Array.isArray(property) && property !== null) {
- // base[key] might not exist, so be careful with recursion here
- base[key] = mergeConfigs(base[key] || {}, custom[key]);
- } else {
- base[key] = custom[key];
- }
- });
-
- return base;
-};
/**
* Removes the prefix `eslint-plugin-` from a plugin name.
* @param {string} pluginName The name of the plugin which may have the prefix.
* @returns {string} The name of the plugin without prefix.
*/
-exports.removePluginPrefix = function removePluginPrefix(pluginName) {
+function removePluginPrefix(pluginName) {
return pluginName.indexOf(PLUGIN_NAME_PREFIX) === 0 ? pluginName.substring(PLUGIN_NAME_PREFIX.length) : pluginName;
-};
+}
/**
* @param {string} pluginName The name of the plugin which may have the prefix.
* @returns {string} The name of the plugins namepace if it has one.
*/
-exports.getNamespace = function getNamespace(pluginName) {
+function getNamespace(pluginName) {
return pluginName.match(NAMESPACE_REGEX) ? pluginName.match(NAMESPACE_REGEX)[0] : "";
-};
+}
/**
* Removes the namespace from a plugin name.
* @param {string} pluginName The name of the plugin which may have the prefix.
* @returns {string} The name of the plugin without the namespace.
*/
-exports.removeNameSpace = function removeNameSpace(pluginName) {
+function removeNameSpace(pluginName) {
return pluginName.replace(NAMESPACE_REGEX, "");
-};
+}
-exports.PLUGIN_NAME_PREFIX = PLUGIN_NAME_PREFIX;
+module.exports = {
+ removePluginPrefix: removePluginPrefix,
+ getNamespace: getNamespace,
+ removeNameSpace: removeNameSpace,
+ "PLUGIN_NAME_PREFIX": PLUGIN_NAME_PREFIX
+};
diff --git a/tools/eslint/lib/util/comment-event-generator.js b/tools/eslint/lib/util/comment-event-generator.js
new file mode 100644
index 00000000000000..fb56ee1c05141a
--- /dev/null
+++ b/tools/eslint/lib/util/comment-event-generator.js
@@ -0,0 +1,116 @@
+/**
+ * @fileoverview The event generator for comments.
+ * @author Toru Nagashima
+ * @copyright 2015 Toru Nagashima. All rights reserved.
+ * See LICENSE file in root directory for full license.
+ */
+
+"use strict";
+
+//------------------------------------------------------------------------------
+// Helpers
+//------------------------------------------------------------------------------
+
+/**
+ * Check collection of comments to prevent double event for comment as
+ * leading and trailing, then emit event if passing
+ * @param {ASTNode[]} comments - Collection of comment nodes
+ * @param {EventEmitter} emitter - The event emitter which is the destination of events.
+ * @param {Object[]} locs - List of locations of previous comment nodes
+ * @param {string} eventName - Event name postfix
+ * @returns {void}
+ */
+function emitComments(comments, emitter, locs, eventName) {
+ if (comments.length > 0) {
+ comments.forEach(function(node) {
+ var index = locs.indexOf(node.loc);
+ if (index >= 0) {
+ locs.splice(index, 1);
+ } else {
+ locs.push(node.loc);
+ emitter.emit(node.type + eventName, node);
+ }
+ });
+ }
+}
+
+/**
+ * Shortcut to check and emit enter of comment nodes
+ * @param {CommentEventGenerator} generator - A generator to emit.
+ * @param {ASTNode[]} comments - Collection of comment nodes
+ * @returns {void}
+ */
+function emitCommentsEnter(generator, comments) {
+ emitComments(
+ comments,
+ generator.emitter,
+ generator.commentLocsEnter,
+ "Comment");
+}
+
+/**
+ * Shortcut to check and emit exit of comment nodes
+ * @param {CommentEventGenerator} generator - A generator to emit.
+ * @param {ASTNode[]} comments Collection of comment nodes
+ * @returns {void}
+ */
+function emitCommentsExit(generator, comments) {
+ emitComments(
+ comments,
+ generator.emitter,
+ generator.commentLocsExit,
+ "Comment:exit");
+}
+
+//------------------------------------------------------------------------------
+// Public Interface
+//------------------------------------------------------------------------------
+
+/**
+ * The event generator for comments.
+ * This is the decorator pattern.
+ * This generates events of comments before/after events which are generated the original generator.
+ *
+ * @param {EventGenerator} originalEventGenerator - An event generator which is the decoration target.
+ * @param {SourceCode} sourceCode - A source code which has comments.
+ * @returns {CommentEventGenerator} new instance.
+ */
+function CommentEventGenerator(originalEventGenerator, sourceCode) {
+ this.original = originalEventGenerator;
+ this.emitter = originalEventGenerator.emitter;
+ this.sourceCode = sourceCode;
+ this.commentLocsEnter = [];
+ this.commentLocsExit = [];
+}
+
+CommentEventGenerator.prototype = {
+ constructor: CommentEventGenerator,
+
+ /**
+ * Emits an event of entering comments.
+ * @param {ASTNode} node - A node which was entered.
+ * @returns {void}
+ */
+ enterNode: function enterNode(node) {
+ var comments = this.sourceCode.getComments(node);
+
+ emitCommentsEnter(this, comments.leading);
+ this.original.enterNode(node);
+ emitCommentsEnter(this, comments.trailing);
+ },
+
+ /**
+ * Emits an event of leaving comments.
+ * @param {ASTNode} node - A node which was left.
+ * @returns {void}
+ */
+ leaveNode: function leaveNode(node) {
+ var comments = this.sourceCode.getComments(node);
+
+ emitCommentsExit(this, comments.trailing);
+ this.original.leaveNode(node);
+ emitCommentsExit(this, comments.leading);
+ }
+};
+
+module.exports = CommentEventGenerator;
diff --git a/tools/eslint/lib/util/estraverse.js b/tools/eslint/lib/util/estraverse.js
new file mode 100644
index 00000000000000..53015fe06794af
--- /dev/null
+++ b/tools/eslint/lib/util/estraverse.js
@@ -0,0 +1,54 @@
+/**
+ * @fileoverview Patch for estraverse
+ * @author Toru Nagashima
+ * @copyright 2015 Toru Nagashima. All rights reserved.
+ * See LICENSE file in root directory for full license.
+ */
+"use strict";
+
+//------------------------------------------------------------------------------
+// Requirements
+//------------------------------------------------------------------------------
+
+var estraverse = require("estraverse"),
+ jsxKeys = require("estraverse-fb/keys");
+
+//------------------------------------------------------------------------------
+// Helers
+//------------------------------------------------------------------------------
+
+var experimentalKeys = {
+ ExperimentalRestProperty: ["argument"],
+ ExperimentalSpreadProperty: ["argument"]
+};
+
+/**
+ * Adds a given keys to Syntax and VisitorKeys of estraverse.
+ *
+ * @param {object} keys - Key definitions to add.
+ * This is an object as map.
+ * Keys are the node type.
+ * Values are an array of property names to visit.
+ * @returns {void}
+ */
+function installKeys(keys) {
+ for (var key in keys) {
+ if (keys.hasOwnProperty(key)) {
+ estraverse.Syntax[key] = key;
+ if (keys[key]) {
+ estraverse.VisitorKeys[key] = keys[key];
+ }
+ }
+ }
+}
+
+// Add JSX node types.
+installKeys(jsxKeys);
+// Add Experimental node types.
+installKeys(experimentalKeys);
+
+//------------------------------------------------------------------------------
+// Public Interface
+//------------------------------------------------------------------------------
+
+module.exports = estraverse;
diff --git a/tools/eslint/lib/util/glob-util.js b/tools/eslint/lib/util/glob-util.js
new file mode 100644
index 00000000000000..2a28604ffa4f86
--- /dev/null
+++ b/tools/eslint/lib/util/glob-util.js
@@ -0,0 +1,149 @@
+/**
+ * @fileoverview Utilities for working with globs and the filesystem.
+ * @author Ian VanSchooten
+ * @copyright 2015 Ian VanSchooten. All rights reserved.
+ * See LICENSE in root directory for full license.
+ */
+"use strict";
+
+//------------------------------------------------------------------------------
+// Requirements
+//------------------------------------------------------------------------------
+
+var debug = require("debug"),
+ fs = require("fs"),
+ glob = require("glob"),
+ shell = require("shelljs"),
+
+ IgnoredPaths = require("../ignored-paths");
+
+debug = debug("eslint:glob-util");
+
+//------------------------------------------------------------------------------
+// Helpers
+//------------------------------------------------------------------------------
+
+/**
+ * Checks if a provided path is a directory and returns a glob string matching
+ * all files under that directory if so, the path itself otherwise.
+ *
+ * Reason for this is that `glob` needs `/**` to collect all the files under a
+ * directory where as our previous implementation without `glob` simply walked
+ * a directory that is passed. So this is to maintain backwards compatibility.
+ *
+ * Also makes sure all path separators are POSIX style for `glob` compatibility.
+ *
+ * @param {string[]} [extensions] An array of accepted extensions
+ * @returns {Function} A function that takes a pathname and returns a glob that
+ * matches all files with the provided extensions if
+ * pathname is a directory.
+ */
+function processPath(extensions) {
+ var suffix = "/**";
+
+ if (extensions) {
+ if (extensions.length === 1) {
+ suffix += "/*." + extensions[0];
+ } else {
+ suffix += "/*.{" + extensions.join(",") + "}";
+ }
+ }
+
+ /**
+ * A function that converts a directory name to a glob pattern
+ *
+ * @param {string} pathname The directory path to be modified
+ * @returns {string} The glob path or the file path itself
+ * @private
+ */
+ return function(pathname) {
+ var newPath = pathname;
+
+ if (shell.test("-d", pathname)) {
+ newPath = pathname.replace(/[\/\\]$/, "") + suffix;
+ }
+
+ return newPath.replace(/\\/g, "/").replace(/^\.\//, "");
+ };
+}
+
+//------------------------------------------------------------------------------
+// Public Interface
+//------------------------------------------------------------------------------
+
+/**
+ * Resolves the patterns into glob-based patterns for easier handling.
+ * @param {string[]} patterns File patterns (such as passed on the command line).
+ * @param {string[]} extensions List of valid file extensions.
+ * @returns {string[]} The equivalent glob patterns.
+ */
+function resolveFileGlobPatterns(patterns, extensions) {
+ extensions = extensions || [".js"];
+
+ extensions = extensions.map(function(ext) {
+ return ext.charAt(0) === "." ? ext.substr(1) : ext;
+ });
+
+ return patterns.map(processPath(extensions));
+}
+
+/**
+ * Build a list of absolute filesnames on which ESLint will act.
+ * Ignored files are excluded from the results, as are duplicates.
+ *
+ * @param {string[]} globPatterns Glob patterns.
+ * @param {Object} [options] An options object.
+ * @param {boolean} [options.ignore] False disables use of .eslintignore.
+ * @param {string} [options.ignorePath] The ignore file to use instead of .eslintignore.
+ * @param {string} [options.ignorePattern] A pattern of files to ignore.
+ * @returns {string[]} Resolved absolute filenames.
+ */
+function listFilesToProcess(globPatterns, options) {
+ var ignoredPaths,
+ ignoredPathsList,
+ files = [],
+ added = {},
+ globOptions;
+
+ /**
+ * Executes the linter on a file defined by the `filename`. Skips
+ * unsupported file extensions and any files that are already linted.
+ * @param {string} filename The file to be processed
+ * @returns {void}
+ */
+ function addFile(filename) {
+ if (ignoredPaths.contains(filename)) {
+ return;
+ }
+ filename = fs.realpathSync(filename);
+ if (added[filename]) {
+ return;
+ }
+ files.push(filename);
+ added[filename] = true;
+ }
+
+ options = options || { ignore: true };
+ ignoredPaths = IgnoredPaths.load(options);
+ ignoredPathsList = ignoredPaths.patterns || [];
+ globOptions = {
+ nodir: true,
+ ignore: ignoredPathsList
+ };
+
+ debug("Creating list of files to process.");
+ globPatterns.forEach(function(pattern) {
+ if (shell.test("-f", pattern)) {
+ addFile(pattern);
+ } else {
+ glob.sync(pattern, globOptions).forEach(addFile);
+ }
+ });
+
+ return files;
+}
+
+module.exports = {
+ resolveFileGlobPatterns: resolveFileGlobPatterns,
+ listFilesToProcess: listFilesToProcess
+};
diff --git a/tools/eslint/lib/util/keywords.js b/tools/eslint/lib/util/keywords.js
new file mode 100644
index 00000000000000..dde29c6b76c06a
--- /dev/null
+++ b/tools/eslint/lib/util/keywords.js
@@ -0,0 +1,68 @@
+/**
+ * @fileoverview A shared list of ES3 keywords.
+ * @author Josh Perez
+ * @copyright 2015 Jose Roberto Vidal. All rights reserved.
+ */
+"use strict";
+
+module.exports = [
+ "abstract",
+ "boolean",
+ "break",
+ "byte",
+ "case",
+ "catch",
+ "char",
+ "class",
+ "const",
+ "continue",
+ "debugger",
+ "default",
+ "delete",
+ "do",
+ "double",
+ "else",
+ "enum",
+ "export",
+ "extends",
+ "false",
+ "final",
+ "finally",
+ "float",
+ "for",
+ "function",
+ "goto",
+ "if",
+ "implements",
+ "import",
+ "in",
+ "instanceof",
+ "int",
+ "interface",
+ "long",
+ "native",
+ "new",
+ "null",
+ "package",
+ "private",
+ "protected",
+ "public",
+ "return",
+ "short",
+ "static",
+ "super",
+ "switch",
+ "synchronized",
+ "this",
+ "throw",
+ "throws",
+ "transient",
+ "true",
+ "try",
+ "typeof",
+ "var",
+ "void",
+ "volatile",
+ "while",
+ "with"
+];
diff --git a/tools/eslint/lib/util/node-event-generator.js b/tools/eslint/lib/util/node-event-generator.js
new file mode 100644
index 00000000000000..002bd29dfe3ed0
--- /dev/null
+++ b/tools/eslint/lib/util/node-event-generator.js
@@ -0,0 +1,55 @@
+/**
+ * @fileoverview The event generator for AST nodes.
+ * @author Toru Nagashima
+ * @copyright 2015 Toru Nagashima. All rights reserved.
+ * See LICENSE file in root directory for full license.
+ */
+
+"use strict";
+
+//------------------------------------------------------------------------------
+// Public Interface
+//------------------------------------------------------------------------------
+
+/**
+ * The event generator for AST nodes.
+ * This implements below interface.
+ *
+ * ```ts
+ * interface EventGenerator {
+ * emitter: EventEmitter;
+ * enterNode(node: ASTNode): void;
+ * leaveNode(node: ASTNode): void;
+ * }
+ * ```
+ *
+ * @param {EventEmitter} emitter - An event emitter which is the destination of events.
+ * @returns {NodeEventGenerator} new instance.
+ */
+function NodeEventGenerator(emitter) {
+ this.emitter = emitter;
+}
+
+NodeEventGenerator.prototype = {
+ constructor: NodeEventGenerator,
+
+ /**
+ * Emits an event of entering AST node.
+ * @param {ASTNode} node - A node which was entered.
+ * @returns {void}
+ */
+ enterNode: function enterNode(node) {
+ this.emitter.emit(node.type, node);
+ },
+
+ /**
+ * Emits an event of leaving AST node.
+ * @param {ASTNode} node - A node which was left.
+ * @returns {void}
+ */
+ leaveNode: function leaveNode(node) {
+ this.emitter.emit(node.type + ":exit", node);
+ }
+};
+
+module.exports = NodeEventGenerator;
diff --git a/tools/eslint/lib/util/rule-fixer.js b/tools/eslint/lib/util/rule-fixer.js
new file mode 100644
index 00000000000000..0f9ef9adf3c73f
--- /dev/null
+++ b/tools/eslint/lib/util/rule-fixer.js
@@ -0,0 +1,147 @@
+/**
+ * @fileoverview An object that creates fix commands for rules.
+ * @author Nicholas C. Zakas
+ * @copyright 2015 Nicholas C. Zakas. All rights reserved.
+ * See LICENSE file in root directory for full license.
+ */
+"use strict";
+
+//------------------------------------------------------------------------------
+// Requirements
+//------------------------------------------------------------------------------
+
+// none!
+
+//------------------------------------------------------------------------------
+// Helpers
+//------------------------------------------------------------------------------
+
+/**
+ * Creates a fix command that inserts text at the specified index in the source text.
+ * @param {int} index The 0-based index at which to insert the new text.
+ * @param {string} text The text to insert.
+ * @returns {Object} The fix command.
+ * @private
+ */
+function insertTextAt(index, text) {
+ return {
+ range: [index, index],
+ text: text
+ };
+}
+
+//------------------------------------------------------------------------------
+// Public Interface
+//------------------------------------------------------------------------------
+
+/**
+ * Creates code fixing commands for rules.
+ * @constructor
+ */
+function RuleFixer() {
+ Object.freeze(this);
+}
+
+RuleFixer.prototype = {
+ constructor: RuleFixer,
+
+ /**
+ * Creates a fix command that inserts text after the given node or token.
+ * The fix is not applied until applyFixes() is called.
+ * @param {ASTNode|Token} nodeOrToken The node or token to insert after.
+ * @param {string} text The text to insert.
+ * @returns {Object} The fix command.
+ */
+ insertTextAfter: function(nodeOrToken, text) {
+ return this.insertTextAfterRange(nodeOrToken.range, text);
+ },
+
+ /**
+ * Creates a fix command that inserts text after the specified range in the source text.
+ * The fix is not applied until applyFixes() is called.
+ * @param {int[]} range The range to replace, first item is start of range, second
+ * is end of range.
+ * @param {string} text The text to insert.
+ * @returns {Object} The fix command.
+ */
+ insertTextAfterRange: function(range, text) {
+ return insertTextAt(range[1], text);
+ },
+
+ /**
+ * Creates a fix command that inserts text before the given node or token.
+ * The fix is not applied until applyFixes() is called.
+ * @param {ASTNode|Token} nodeOrToken The node or token to insert before.
+ * @param {string} text The text to insert.
+ * @returns {Object} The fix command.
+ */
+ insertTextBefore: function(nodeOrToken, text) {
+ return this.insertTextBeforeRange(nodeOrToken.range, text);
+ },
+
+ /**
+ * Creates a fix command that inserts text before the specified range in the source text.
+ * The fix is not applied until applyFixes() is called.
+ * @param {int[]} range The range to replace, first item is start of range, second
+ * is end of range.
+ * @param {string} text The text to insert.
+ * @returns {Object} The fix command.
+ */
+ insertTextBeforeRange: function(range, text) {
+ return insertTextAt(range[0], text);
+ },
+
+ /**
+ * Creates a fix command that replaces text at the node or token.
+ * The fix is not applied until applyFixes() is called.
+ * @param {ASTNode|Token} nodeOrToken The node or token to remove.
+ * @param {string} text The text to insert.
+ * @returns {Object} The fix command.
+ */
+ replaceText: function(nodeOrToken, text) {
+ return this.replaceTextRange(nodeOrToken.range, text);
+ },
+
+ /**
+ * Creates a fix command that replaces text at the specified range in the source text.
+ * The fix is not applied until applyFixes() is called.
+ * @param {int[]} range The range to replace, first item is start of range, second
+ * is end of range.
+ * @param {string} text The text to insert.
+ * @returns {Object} The fix command.
+ */
+ replaceTextRange: function(range, text) {
+ return {
+ range: range,
+ text: text
+ };
+ },
+
+ /**
+ * Creates a fix command that removes the node or token from the source.
+ * The fix is not applied until applyFixes() is called.
+ * @param {ASTNode|Token} nodeOrToken The node or token to remove.
+ * @returns {Object} The fix command.
+ */
+ remove: function(nodeOrToken) {
+ return this.removeRange(nodeOrToken.range);
+ },
+
+ /**
+ * Creates a fix command that removes the specified range of text from the source.
+ * The fix is not applied until applyFixes() is called.
+ * @param {int[]} range The range to remove, first item is start of range, second
+ * is end of range.
+ * @returns {Object} The fix command.
+ */
+ removeRange: function(range) {
+ return {
+ range: range,
+ text: ""
+ };
+ }
+
+};
+
+
+module.exports = RuleFixer;
diff --git a/tools/eslint/lib/util/source-code-fixer.js b/tools/eslint/lib/util/source-code-fixer.js
new file mode 100644
index 00000000000000..8a8d99e9e86551
--- /dev/null
+++ b/tools/eslint/lib/util/source-code-fixer.js
@@ -0,0 +1,123 @@
+/**
+ * @fileoverview An object that caches and applies source code fixes.
+ * @author Nicholas C. Zakas
+ * @copyright 2015 Nicholas C. Zakas. All rights reserved.
+ * See LICENSE file in root directory for full license.
+ */
+"use strict";
+
+//------------------------------------------------------------------------------
+// Requirements
+//------------------------------------------------------------------------------
+
+var debug = require("debug")("eslint:text-fixer");
+
+//------------------------------------------------------------------------------
+// Helpers
+//------------------------------------------------------------------------------
+
+/**
+ * Compares items in a messages array by line and column.
+ * @param {Message} a The first message.
+ * @param {Message} b The second message.
+ * @returns {int} -1 if a comes before b, 1 if a comes after b, 0 if equal.
+ * @private
+ */
+function compareMessagesByLocation(a, b) {
+ var lineDiff = a.line - b.line;
+
+ if (lineDiff === 0) {
+ return a.column - b.column;
+ } else {
+ return lineDiff;
+ }
+}
+
+//------------------------------------------------------------------------------
+// Public Interface
+//------------------------------------------------------------------------------
+
+/**
+ * Utility for apply fixes to source code.
+ * @constructor
+ */
+function SourceCodeFixer() {
+ Object.freeze(this);
+}
+
+/**
+ * Applies the fixes specified by the messages to the given text. Tries to be
+ * smart about the fixes and won't apply fixes over the same area in the text.
+ * @param {SourceCode} sourceCode The source code to apply the changes to.
+ * @param {Message[]} messages The array of messages reported by ESLint.
+ * @returns {Object} An object containing the fixed text and any unfixed messages.
+ */
+SourceCodeFixer.applyFixes = function(sourceCode, messages) {
+
+ debug("Applying fixes");
+
+ if (!sourceCode) {
+ debug("No source code to fix");
+ return {
+ fixed: false,
+ messages: messages,
+ output: ""
+ };
+ }
+
+ // clone the array
+ var remainingMessages = [],
+ fixes = [],
+ text = sourceCode.text,
+ lastFixPos = text.length + 1;
+
+ messages.forEach(function(problem) {
+ if (problem.hasOwnProperty("fix")) {
+ fixes.push(problem);
+ } else {
+ remainingMessages.push(problem);
+ }
+ });
+
+ if (fixes.length) {
+ debug("Found fixes to apply");
+
+ // sort in reverse order of occurrence
+ fixes.sort(function(a, b) {
+ if (a.fix.range[1] <= b.fix.range[0]) {
+ return 1;
+ } else {
+ return -1;
+ }
+ });
+
+ // split into array of characters for easier manipulation
+ var chars = text.split("");
+
+ fixes.forEach(function(problem) {
+ var fix = problem.fix;
+
+ if (fix.range[1] < lastFixPos) {
+ chars.splice(fix.range[0], fix.range[1] - fix.range[0], fix.text);
+ lastFixPos = fix.range[0];
+ } else {
+ remainingMessages.push(problem);
+ }
+ });
+
+ return {
+ fixed: true,
+ messages: remainingMessages.sort(compareMessagesByLocation),
+ output: chars.join("")
+ };
+ } else {
+ debug("No fixes to apply");
+ return {
+ fixed: false,
+ messages: messages,
+ output: text
+ };
+ }
+};
+
+module.exports = SourceCodeFixer;
diff --git a/tools/eslint/lib/util/source-code.js b/tools/eslint/lib/util/source-code.js
new file mode 100644
index 00000000000000..6ef0f91995561b
--- /dev/null
+++ b/tools/eslint/lib/util/source-code.js
@@ -0,0 +1,288 @@
+/**
+ * @fileoverview Abstraction of JavaScript source code.
+ * @author Nicholas C. Zakas
+ * @copyright 2015 Nicholas C. Zakas. All rights reserved.
+ * See LICENSE file in root directory for full license.
+ */
+"use strict";
+/* eslint no-underscore-dangle: 0*/
+
+//------------------------------------------------------------------------------
+// Requirements
+//------------------------------------------------------------------------------
+
+var createTokenStore = require("../token-store.js"),
+ estraverse = require("./estraverse"),
+ assign = require("object-assign");
+
+//------------------------------------------------------------------------------
+// Private
+//------------------------------------------------------------------------------
+
+/**
+ * Validates that the given AST has the required information.
+ * @param {ASTNode} ast The Program node of the AST to check.
+ * @throws {Error} If the AST doesn't contain the correct information.
+ * @returns {void}
+ * @private
+ */
+function validate(ast) {
+
+ if (!ast.tokens) {
+ throw new Error("AST is missing the tokens array.");
+ }
+
+ if (!ast.comments) {
+ throw new Error("AST is missing the comments array.");
+ }
+
+ if (!ast.loc) {
+ throw new Error("AST is missing location information.");
+ }
+
+ if (!ast.range) {
+ throw new Error("AST is missing range information");
+ }
+}
+
+/**
+ * Finds a JSDoc comment node in an array of comment nodes.
+ * @param {ASTNode[]} comments The array of comment nodes to search.
+ * @param {int} line Line number to look around
+ * @returns {ASTNode} The node if found, null if not.
+ * @private
+ */
+function findJSDocComment(comments, line) {
+
+ if (comments) {
+ for (var i = comments.length - 1; i >= 0; i--) {
+ if (comments[i].type === "Block" && comments[i].value.charAt(0) === "*") {
+
+ if (line - comments[i].loc.end.line <= 1) {
+ return comments[i];
+ } else {
+ break;
+ }
+ }
+ }
+ }
+
+ return null;
+}
+
+/**
+ * Check to see if its a ES6 export declaration
+ * @param {ASTNode} astNode - any node
+ * @returns {boolean} whether the given node represents a export declaration
+ * @private
+ */
+function looksLikeExport(astNode) {
+ return astNode.type === "ExportDefaultDeclaration" || astNode.type === "ExportNamedDeclaration" ||
+ astNode.type === "ExportAllDeclaration" || astNode.type === "ExportSpecifier";
+}
+
+
+//------------------------------------------------------------------------------
+// Public Interface
+//------------------------------------------------------------------------------
+
+/**
+ * Represents parsed source code.
+ * @param {string} text The source code text.
+ * @param {ASTNode} ast The Program node of the AST representing the code.
+ * @constructor
+ */
+function SourceCode(text, ast) {
+
+ validate(ast);
+
+ /**
+ * The original text source code.
+ * @type string
+ */
+ this.text = text;
+
+ /**
+ * The parsed AST for the source code.
+ * @type ASTNode
+ */
+ this.ast = ast;
+
+ /**
+ * The source code split into lines according to ECMA-262 specification.
+ * This is done to avoid each rule needing to do so separately.
+ * @type string[]
+ */
+ this.lines = text.split(/\r\n|\r|\n|\u2028|\u2029/g);
+
+ this.tokensAndComments = ast.tokens.concat(ast.comments).sort(function(left, right) {
+ return left.range[0] - right.range[0];
+ });
+
+ // create token store methods
+ var tokenStore = createTokenStore(ast.tokens);
+ Object.keys(tokenStore).forEach(function(methodName) {
+ this[methodName] = tokenStore[methodName];
+ }, this);
+
+ var tokensAndCommentsStore = createTokenStore(this.tokensAndComments);
+ this.getTokenOrCommentBefore = tokensAndCommentsStore.getTokenBefore;
+ this.getTokenOrCommentAfter = tokensAndCommentsStore.getTokenAfter;
+
+ // don't allow modification of this object
+ Object.freeze(this);
+ Object.freeze(this.lines);
+}
+
+SourceCode.prototype = {
+ constructor: SourceCode,
+
+ /**
+ * Gets the source code for the given node.
+ * @param {ASTNode=} node The AST node to get the text for.
+ * @param {int=} beforeCount The number of characters before the node to retrieve.
+ * @param {int=} afterCount The number of characters after the node to retrieve.
+ * @returns {string} The text representing the AST node.
+ */
+ getText: function(node, beforeCount, afterCount) {
+ if (node) {
+ return (this.text !== null) ? this.text.slice(Math.max(node.range[0] - (beforeCount || 0), 0),
+ node.range[1] + (afterCount || 0)) : null;
+ } else {
+ return this.text;
+ }
+
+ },
+
+ /**
+ * Gets the entire source text split into an array of lines.
+ * @returns {Array} The source text as an array of lines.
+ */
+ getLines: function() {
+ return this.lines;
+ },
+
+ /**
+ * Retrieves an array containing all comments in the source code.
+ * @returns {ASTNode[]} An array of comment nodes.
+ */
+ getAllComments: function() {
+ return this.ast.comments;
+ },
+
+ /**
+ * Gets all comments for the given node.
+ * @param {ASTNode} node The AST node to get the comments for.
+ * @returns {Object} The list of comments indexed by their position.
+ * @public
+ */
+ getComments: function(node) {
+
+ var leadingComments = node.leadingComments || [],
+ trailingComments = node.trailingComments || [];
+
+ /*
+ * espree adds a "comments" array on Program nodes rather than
+ * leadingComments/trailingComments. Comments are only left in the
+ * Program node comments array if there is no executable code.
+ */
+ if (node.type === "Program") {
+ if (node.body.length === 0) {
+ leadingComments = node.comments;
+ }
+ }
+
+ return {
+ leading: leadingComments,
+ trailing: trailingComments
+ };
+ },
+
+ /**
+ * Retrieves the JSDoc comment for a given node.
+ * @param {ASTNode} node The AST node to get the comment for.
+ * @returns {ASTNode} The BlockComment node containing the JSDoc for the
+ * given node or null if not found.
+ * @public
+ */
+ getJSDocComment: function(node) {
+
+ var parent = node.parent,
+ line = node.loc.start.line;
+
+ switch (node.type) {
+ case "FunctionDeclaration":
+ if (looksLikeExport(parent)) {
+ return findJSDocComment(parent.leadingComments, line);
+ } else {
+ return findJSDocComment(node.leadingComments, line);
+ }
+ break;
+
+ case "ClassDeclaration":
+ return findJSDocComment(node.leadingComments, line);
+
+ case "ClassExpression":
+ return findJSDocComment(parent.parent.leadingComments, line);
+
+ case "ArrowFunctionExpression":
+ case "FunctionExpression":
+
+ if (parent.type !== "CallExpression" && parent.type !== "NewExpression") {
+ while (parent && !parent.leadingComments && !/Function/.test(parent.type)) {
+ parent = parent.parent;
+ }
+
+ return parent && (parent.type !== "FunctionDeclaration") ? findJSDocComment(parent.leadingComments, line) : null;
+ }
+
+ // falls through
+
+ default:
+ return null;
+ }
+ },
+
+ /**
+ * Gets the deepest node containing a range index.
+ * @param {int} index Range index of the desired node.
+ * @returns {ASTNode} The node if found or null if not found.
+ */
+ getNodeByRangeIndex: function(index) {
+ var result = null;
+
+ estraverse.traverse(this.ast, {
+ enter: function(node, parent) {
+ if (node.range[0] <= index && index < node.range[1]) {
+ result = assign({ parent: parent }, node);
+ } else {
+ this.skip();
+ }
+ },
+ leave: function(node) {
+ if (node === result) {
+ this.break();
+ }
+ }
+ });
+
+ return result;
+ },
+
+ /**
+ * Determines if two tokens have at least one whitespace character
+ * between them. This completely disregards comments in making the
+ * determination, so comments count as zero-length substrings.
+ * @param {Token} first The token to check after.
+ * @param {Token} second The token to check before.
+ * @returns {boolean} True if there is only space between tokens, false
+ * if there is anything other than whitespace between tokens.
+ */
+ isSpaceBetweenTokens: function(first, second) {
+ var text = this.text.slice(first.range[1], second.range[0]);
+ return /\s/.test(text.replace(/\/\*.*?\*\//g, ""));
+ }
+};
+
+
+module.exports = SourceCode;
diff --git a/tools/eslint/lib/util/traverse.js b/tools/eslint/lib/util/traverse.js
deleted file mode 100644
index ba5520e341bb46..00000000000000
--- a/tools/eslint/lib/util/traverse.js
+++ /dev/null
@@ -1,105 +0,0 @@
-/**
- * @fileoverview Simple directory traversal logic.
- * @author Nicholas C. Zakas
- */
-
-"use strict";
-
-//------------------------------------------------------------------------------
-// Requirements
-//------------------------------------------------------------------------------
-
-var fs = require("fs"),
- path = require("path"),
- debug = require("debug");
-
-//------------------------------------------------------------------------------
-// Helpers
-//------------------------------------------------------------------------------
-
-debug = debug("eslint:traverse");
-
-/**
- * Walks a path recursively calling the callback on each file.
- * @param {string} name The file or directory path.
- * @param {string[]} extensions The file extensions that should cause the callback
- * to be called.
- * @param {Function} exclude The function to check if file/path should be excluded.
- * @param {Function} callback The function to call on each file.
- * @returns {void}
- * @private
- */
-function walk(name, extensions, exclude, callback) {
-
- var stat, basename;
-
- stat = fs.statSync(name);
-
- function traverse(dir, stack) {
- stack.push(dir);
-
- fs.readdirSync(path.join.apply(path, stack)).forEach(function(file) {
- var filePath, fileStat;
-
- // skip all hidded things (dirs, files, links)
- if (file[0] === ".") {
- return;
- }
-
- filePath = path.join.apply(path, stack.concat([file]));
- fileStat = fs.statSync(filePath);
-
- // if this file or directory is excluded from linting, skip over it.
- if (exclude && exclude(filePath)) {
- // console.log("Ignoring " + filePath);
- debug("Ignoring " + filePath);
- return;
- }
-
- // only call callback for files with correct extensions
- if (fileStat.isFile() && extensions.indexOf(path.extname(filePath)) > -1) {
- callback(filePath);
- } else if (fileStat.isDirectory()) {
- traverse(file, stack);
- }
- });
- stack.pop();
- }
-
- basename = path.basename(name);
-
- // don't ignore cases like 'eslint ./'
- if ((basename !== "." && basename !== ".." && basename[0] === ".") ||
- (exclude && exclude(name))) {
-
- debug("Ignoring " + name);
- return;
- }
-
- // always call callback for any files that are passed on the command line
- if (stat.isFile()) {
- callback(name);
- } else {
- traverse(name, []);
- }
-}
-
-/**
- * Traverses multiple directories and calls a callback on each file.
- * @param {Object} options The option for the traversal.
- * param {string[]} options.files An array of file and directory paths to traverse.
- * param {Function} options.exclude The function to check if file/path should be excluded.
- * @param {Function} callback A function to call for each file.
- * @returns {void}
- */
-module.exports = function traverse(options, callback) {
-
- var files = options.files,
- exclude = options.exclude,
- extensions = options.extensions;
-
- files.forEach(function(file) {
- walk(file, extensions, exclude, callback);
- });
-
-};
diff --git a/tools/eslint/node_modules/.bin/handlebars b/tools/eslint/node_modules/.bin/handlebars
new file mode 120000
index 00000000000000..fb7d090fccaf28
--- /dev/null
+++ b/tools/eslint/node_modules/.bin/handlebars
@@ -0,0 +1 @@
+../handlebars/bin/handlebars
\ No newline at end of file
diff --git a/tools/eslint/node_modules/.bin/rimraf b/tools/eslint/node_modules/.bin/rimraf
new file mode 120000
index 00000000000000..4cd49a49ddfc17
--- /dev/null
+++ b/tools/eslint/node_modules/.bin/rimraf
@@ -0,0 +1 @@
+../rimraf/bin.js
\ No newline at end of file
diff --git a/tools/eslint/node_modules/.bin/shjs b/tools/eslint/node_modules/.bin/shjs
new file mode 120000
index 00000000000000..a0449975bf894c
--- /dev/null
+++ b/tools/eslint/node_modules/.bin/shjs
@@ -0,0 +1 @@
+../shelljs/bin/shjs
\ No newline at end of file
diff --git a/tools/eslint/node_modules/.bin/uglifyjs b/tools/eslint/node_modules/.bin/uglifyjs
new file mode 120000
index 00000000000000..fef3468b6f6c6f
--- /dev/null
+++ b/tools/eslint/node_modules/.bin/uglifyjs
@@ -0,0 +1 @@
+../uglify-js/bin/uglifyjs
\ No newline at end of file
diff --git a/tools/eslint/node_modules/.bin/user-home b/tools/eslint/node_modules/.bin/user-home
deleted file mode 120000
index d72d76bb49f555..00000000000000
--- a/tools/eslint/node_modules/.bin/user-home
+++ /dev/null
@@ -1 +0,0 @@
-../user-home/cli.js
\ No newline at end of file
diff --git a/tools/eslint/node_modules/align-text/LICENSE b/tools/eslint/node_modules/align-text/LICENSE
new file mode 100644
index 00000000000000..65f90aca8c2fff
--- /dev/null
+++ b/tools/eslint/node_modules/align-text/LICENSE
@@ -0,0 +1,21 @@
+The MIT License (MIT)
+
+Copyright (c) 2015, Jon Schlinkert.
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION 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/tools/eslint/node_modules/align-text/README.md b/tools/eslint/node_modules/align-text/README.md
new file mode 100644
index 00000000000000..6b1f85c2e12737
--- /dev/null
+++ b/tools/eslint/node_modules/align-text/README.md
@@ -0,0 +1,236 @@
+# align-text [![NPM version](https://badge.fury.io/js/align-text.svg)](http://badge.fury.io/js/align-text) [![Build Status](https://travis-ci.org/jonschlinkert/align-text.svg)](https://travis-ci.org/jonschlinkert/align-text)
+
+> Align the text in a string.
+
+**Examples**
+
+Align text values in an array:
+
+```js
+align([1, 2, 3, 100]);
+//=> [' 1', ' 2', ' 3', '100']
+```
+
+Or [do stuff like this](./example.js):
+
+[![screen shot 2015-06-09 at 2 08 34 am](https://cloud.githubusercontent.com/assets/383994/8051597/7b716fbc-0e4c-11e5-9aef-4493fd22db58.png)](./example.js)
+
+Visit [the example](./example.js) to see how this works.
+
+## Install
+
+Install with [npm](https://www.npmjs.com/)
+
+```sh
+$ npm i align-text --save
+```
+
+## Usage
+
+```js
+var align = require('align-text');
+align(text, callback_function_or_integer);
+```
+
+**Params**
+
+* `text` can be a **string or array**. If a string is passed, a string will be returned. If an array is passed, an array will be returned.
+* `callback|integer`: if an integer, the text will be indented by that amount. If a function, it must return an integer representing the amount of leading indentation to use as `align` loops over each line.
+
+**Example**
+
+```js
+align(text, 4);
+```
+
+Would align:
+
+```
+abc
+abc
+abc
+```
+
+To:
+
+```
+ abc
+ abc
+ abc
+```
+
+## callback
+
+### params
+
+The callback is used to determine the indentation of each line and gets the following params:
+
+* `len` the length of the "current" line
+* `longest` the length of the longest line
+* `line` the current line (string) being aligned
+* `lines` the array of all lines
+
+### return
+
+The callback may return:
+
+* an integer that represents the number of spaces to use for padding,
+* or an object with the following properties:
+ - `indent`: **{Number}** the amount of indentation to use. Default is `0` when an object is returned.
+ - `character`: **{String}** the character to use for indentation. Default is `''` (empty string) when an object is returned.
+ - `prefix`: **{String}** leading characters to use at the beginning of each line. `''` (empty string) when an object is returned.
+
+**Integer example:**
+
+```js
+// calculate half the difference between the length
+// of the current line and the longest line
+function centerAlign(len, longest, line, lines) {
+ return Math.floor((longest - len) / 2);
+}
+```
+
+**Object example:**
+
+```js
+function centerAlign(len, longest, line, lines) {
+ return {
+ character: '\t',
+ indent: Math.floor((longest - len) / 2),
+ prefix: '~ ',
+ }
+}
+```
+
+## Usage examples
+
+### Center align
+
+Using the `centerAlign` function from above:
+
+```js
+align(text, centerAlign);
+```
+
+Would align this text:
+
+```js
+Lorem ipsum dolor sit amet
+consectetur adipiscin
+elit, sed do eiusmod tempor incididun
+ut labore et dolor
+magna aliqua. Ut enim ad mini
+veniam, quis
+```
+
+Resulting in this:
+
+```
+ Lorem ipsum dolor sit amet,
+ consectetur adipiscing
+elit, sed do eiusmod tempor incididunt
+ ut labore et dolore
+ magna aliqua. Ut enim ad minim
+ veniam, quis
+```
+
+**Customize**
+
+If you wanted to add more padding on the left, just pass the number in the callback.
+
+For example, to add 4 spaces before every line:
+
+```js
+function centerAlign(len, longest, line, lines) {
+ return 4 + Math.floor((longest - len) / 2);
+}
+```
+
+Would result in:
+
+```
+ Lorem ipsum dolor sit amet,
+ consectetur adipiscing
+ elit, sed do eiusmod tempor incididunt
+ ut labore et dolore
+ magna aliqua. Ut enim ad minim
+ veniam, quis
+```
+
+### Bullets
+
+```js
+align(text, function (len, max, line, lines) {
+ return {prefix: ' - '};
+});
+```
+
+Would return:
+
+```
+- Lorem ipsum dolor sit amet,
+- consectetur adipiscing
+- elit, sed do eiusmod tempor incididunt
+- ut labore et dolore
+- magna aliqua. Ut enim ad minim
+- veniam, quis
+```
+
+### Different indent character
+
+```js
+align(text, function (len, max, line, lines) {
+ return {
+ indent: Math.floor((max - len) / 2),
+ character: '~',
+ };
+});
+```
+
+Would return
+
+```
+~~~~~Lorem ipsum dolor sit amet,
+~~~~~~~~consectetur adipiscing
+elit, sed do eiusmod tempor incididunt
+~~~~~~~~~ut labore et dolore
+~~~~magna aliqua. Ut enim ad minim
+~~~~~~~~~~~~~veniam, quis
+```
+
+## Related projects
+
+* [center-align](https://github.com/jonschlinkert/center-align): Center-align the text in a string.
+* [justify](https://github.com/bahamas10/node-justify): Left or right (or both) justify text using a custom width and character
+* [longest](https://github.com/jonschlinkert/longest): Get the longest item in an array.
+* [right-align](https://github.com/jonschlinkert/right-align): Right-align the text in a string.
+* [repeat-string](https://github.com/jonschlinkert/repeat-string): Repeat the given string n times. Fastest implementation for repeating a string.
+* [word-wrap](https://github.com/jonschlinkert/word-wrap): Wrap words to a specified length.
+
+## Running tests
+
+Install dev dependencies:
+
+```sh
+$ npm i -d && npm test
+```
+
+## Contributing
+
+Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](https://github.com/jonschlinkert/align-text/issues/new)
+
+## Author
+
+**Jon Schlinkert**
+
++ [github/jonschlinkert](https://github.com/jonschlinkert)
++ [twitter/jonschlinkert](http://twitter.com/jonschlinkert)
+
+## License
+
+Copyright © 2015 [Jon Schlinkert](https://github.com/jonschlinkert)
+Released under the MIT license.
+
+***
+
+_This file was generated by [verb-cli](https://github.com/assemble/verb-cli) on June 09, 2015._
diff --git a/tools/eslint/node_modules/align-text/index.js b/tools/eslint/node_modules/align-text/index.js
new file mode 100644
index 00000000000000..75902a3f3d84da
--- /dev/null
+++ b/tools/eslint/node_modules/align-text/index.js
@@ -0,0 +1,52 @@
+/*!
+ * align-text
+ *
+ * Copyright (c) 2015, Jon Schlinkert.
+ * Licensed under the MIT License.
+ */
+
+'use strict';
+
+var typeOf = require('kind-of');
+var repeat = require('repeat-string');
+var longest = require('longest');
+
+module.exports = function alignText(val, fn) {
+ var lines, type = typeOf(val);
+
+ if (type === 'array') {
+ lines = val;
+ } else if (type === 'string') {
+ lines = val.split(/(?:\r\n|\n)/);
+ } else {
+ throw new TypeError('align-text expects a string or array.');
+ }
+
+ var fnType = typeOf(fn);
+ var len = lines.length;
+ var max = longest(lines);
+ var res = [], i = 0;
+
+ while (len--) {
+ var line = String(lines[i++]);
+ var diff;
+
+ if (fnType === 'function') {
+ diff = fn(line.length, max.length, line, lines, i);
+ } else if (fnType === 'number') {
+ diff = fn;
+ } else {
+ diff = max.length - line.length;
+ }
+
+ if (typeOf(diff) === 'number') {
+ res.push(repeat(' ', diff) + line);
+ } else if (typeOf(diff) === 'object') {
+ var result = repeat(diff.character || ' ', diff.indent || 0);
+ res.push((diff.prefix || '') + result + line);
+ }
+ }
+
+ if (type === 'array') return res;
+ return res.join('\n');
+};
diff --git a/tools/eslint/node_modules/align-text/package.json b/tools/eslint/node_modules/align-text/package.json
new file mode 100644
index 00000000000000..e0e0b9c7ff6244
--- /dev/null
+++ b/tools/eslint/node_modules/align-text/package.json
@@ -0,0 +1,101 @@
+{
+ "_args": [
+ [
+ "align-text@^0.1.0",
+ "/Users/mzasso/git/forks/node/node_modules/eslint/node_modules/center-align"
+ ]
+ ],
+ "_from": "align-text@>=0.1.0 <0.2.0",
+ "_id": "align-text@0.1.3",
+ "_inCache": true,
+ "_installable": true,
+ "_location": "/eslint/align-text",
+ "_nodeVersion": "0.12.4",
+ "_npmUser": {
+ "email": "github@sellside.com",
+ "name": "jonschlinkert"
+ },
+ "_npmVersion": "2.10.1",
+ "_phantomChildren": {},
+ "_requested": {
+ "name": "align-text",
+ "raw": "align-text@^0.1.0",
+ "rawSpec": "^0.1.0",
+ "scope": null,
+ "spec": ">=0.1.0 <0.2.0",
+ "type": "range"
+ },
+ "_requiredBy": [
+ "/eslint/center-align",
+ "/eslint/right-align"
+ ],
+ "_resolved": "https://registry.npmjs.org/align-text/-/align-text-0.1.3.tgz",
+ "_shasum": "72db3983872eec2313919c9426a993a41afe93f7",
+ "_shrinkwrap": null,
+ "_spec": "align-text@^0.1.0",
+ "_where": "/Users/mzasso/git/forks/node/node_modules/eslint/node_modules/center-align",
+ "author": {
+ "name": "Jon Schlinkert",
+ "url": "https://github.com/jonschlinkert"
+ },
+ "bugs": {
+ "url": "https://github.com/jonschlinkert/align-text/issues"
+ },
+ "dependencies": {
+ "kind-of": "^2.0.0",
+ "longest": "^1.0.1",
+ "repeat-string": "^1.5.2"
+ },
+ "description": "Align the text in a string.",
+ "devDependencies": {
+ "mocha": "*",
+ "should": "*",
+ "word-wrap": "^1.0.3"
+ },
+ "directories": {},
+ "dist": {
+ "shasum": "72db3983872eec2313919c9426a993a41afe93f7",
+ "tarball": "http://registry.npmjs.org/align-text/-/align-text-0.1.3.tgz"
+ },
+ "engines": {
+ "node": ">=0.10.0"
+ },
+ "files": [
+ "index.js"
+ ],
+ "gitHead": "11c2e834ff2c63f9844bddf189fea5cab921e44d",
+ "homepage": "https://github.com/jonschlinkert/align-text",
+ "keywords": [
+ "align",
+ "align-center",
+ "alignment",
+ "center",
+ "center-align",
+ "indent",
+ "pad",
+ "padding",
+ "right",
+ "right-align",
+ "text",
+ "typography"
+ ],
+ "license": "MIT",
+ "main": "index.js",
+ "maintainers": [
+ {
+ "name": "jonschlinkert",
+ "email": "github@sellside.com"
+ }
+ ],
+ "name": "align-text",
+ "optionalDependencies": {},
+ "readme": "ERROR: No README data found!",
+ "repository": {
+ "type": "git",
+ "url": "git://github.com/jonschlinkert/align-text.git"
+ },
+ "scripts": {
+ "test": "mocha"
+ },
+ "version": "0.1.3"
+}
diff --git a/tools/eslint/node_modules/amdefine/LICENSE b/tools/eslint/node_modules/amdefine/LICENSE
new file mode 100644
index 00000000000000..af46c6df3a1464
--- /dev/null
+++ b/tools/eslint/node_modules/amdefine/LICENSE
@@ -0,0 +1,58 @@
+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-2015, 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-2015, 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/tools/eslint/node_modules/amdefine/README.md b/tools/eslint/node_modules/amdefine/README.md
new file mode 100644
index 00000000000000..037a6e817e3286
--- /dev/null
+++ b/tools/eslint/node_modules/amdefine/README.md
@@ -0,0 +1,171 @@
+# 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 modules 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/tools/eslint/node_modules/amdefine/amdefine.js b/tools/eslint/node_modules/amdefine/amdefine.js
new file mode 100644
index 00000000000000..0c4a954a1d3b01
--- /dev/null
+++ b/tools/eslint/node_modules/amdefine/amdefine.js
@@ -0,0 +1,301 @@
+/** vim: et:ts=4:sw=4:sts=4
+ * @license amdefine 1.0.0 Copyright (c) 2011-2015, 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.
+ if (callback) {
+ 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/tools/eslint/node_modules/amdefine/intercept.js b/tools/eslint/node_modules/amdefine/intercept.js
new file mode 100644
index 00000000000000..771a98301fbf21
--- /dev/null
+++ b/tools/eslint/node_modules/amdefine/intercept.js
@@ -0,0 +1,36 @@
+/*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/tools/eslint/node_modules/amdefine/package.json b/tools/eslint/node_modules/amdefine/package.json
new file mode 100644
index 00000000000000..75392136afd3df
--- /dev/null
+++ b/tools/eslint/node_modules/amdefine/package.json
@@ -0,0 +1,74 @@
+{
+ "_args": [
+ [
+ "amdefine@>=0.0.4",
+ "/Users/mzasso/git/forks/node/node_modules/eslint/node_modules/source-map"
+ ]
+ ],
+ "_from": "amdefine@>=0.0.4",
+ "_id": "amdefine@1.0.0",
+ "_inCache": true,
+ "_installable": true,
+ "_location": "/eslint/amdefine",
+ "_nodeVersion": "0.10.36",
+ "_npmUser": {
+ "email": "jrburke@gmail.com",
+ "name": "jrburke"
+ },
+ "_npmVersion": "2.12.1",
+ "_phantomChildren": {},
+ "_requested": {
+ "name": "amdefine",
+ "raw": "amdefine@>=0.0.4",
+ "rawSpec": ">=0.0.4",
+ "scope": null,
+ "spec": ">=0.0.4",
+ "type": "range"
+ },
+ "_requiredBy": [
+ "/eslint/source-map"
+ ],
+ "_resolved": "https://registry.npmjs.org/amdefine/-/amdefine-1.0.0.tgz",
+ "_shasum": "fd17474700cb5cc9c2b709f0be9d23ce3c198c33",
+ "_shrinkwrap": null,
+ "_spec": "amdefine@>=0.0.4",
+ "_where": "/Users/mzasso/git/forks/node/node_modules/eslint/node_modules/source-map",
+ "author": {
+ "email": "jrburke@gmail.com",
+ "name": "James Burke",
+ "url": "http://github.com/jrburke"
+ },
+ "bugs": {
+ "url": "https://github.com/jrburke/amdefine/issues"
+ },
+ "dependencies": {},
+ "description": "Provide AMD's define() API for declaring modules in the AMD format",
+ "devDependencies": {},
+ "directories": {},
+ "dist": {
+ "shasum": "fd17474700cb5cc9c2b709f0be9d23ce3c198c33",
+ "tarball": "http://registry.npmjs.org/amdefine/-/amdefine-1.0.0.tgz"
+ },
+ "engines": {
+ "node": ">=0.4.2"
+ },
+ "gitHead": "578bc4a3f7dede33f3f3e10edde0c1607005d761",
+ "homepage": "http://github.com/jrburke/amdefine",
+ "license": "BSD-3-Clause AND MIT",
+ "main": "./amdefine.js",
+ "maintainers": [
+ {
+ "name": "jrburke",
+ "email": "jrburke@gmail.com"
+ }
+ ],
+ "name": "amdefine",
+ "optionalDependencies": {},
+ "readme": "ERROR: No README data found!",
+ "repository": {
+ "type": "git",
+ "url": "git+https://github.com/jrburke/amdefine.git"
+ },
+ "scripts": {},
+ "version": "1.0.0"
+}
diff --git a/tools/eslint/node_modules/ansi-escapes/index.js b/tools/eslint/node_modules/ansi-escapes/index.js
new file mode 100644
index 00000000000000..6bc26c82a2812f
--- /dev/null
+++ b/tools/eslint/node_modules/ansi-escapes/index.js
@@ -0,0 +1,79 @@
+'use strict';
+var ESC = '\u001b[';
+var x = module.exports;
+
+x.cursorTo = function (x, y) {
+ if (arguments.length === 0) {
+ return ESC + 'H';
+ }
+
+ if (arguments.length === 1) {
+ return ESC + (x + 1) + 'G';
+ }
+
+ return ESC + (y + 1) + ';' + (x + 1) + 'H';
+};
+
+x.cursorMove = function (x, y) {
+ var ret = '';
+
+ if (x < 0) {
+ ret += ESC + (-x) + 'D';
+ } else if (x > 0) {
+ ret += ESC + x + 'C';
+ }
+
+ if (y < 0) {
+ ret += ESC + (-y) + 'A';
+ } else if (y > 0) {
+ ret += ESC + y + 'B';
+ }
+
+ return ret;
+};
+
+x.cursorUp = function (count) {
+ return ESC + (typeof count === 'number' ? count : 1) + 'A';
+};
+
+x.cursorDown = function (count) {
+ return ESC + (typeof count === 'number' ? count : 1) + 'B';
+};
+
+x.cursorForward = function (count) {
+ return ESC + (typeof count === 'number' ? count : 1) + 'C';
+};
+
+x.cursorBackward = function (count) {
+ return ESC + (typeof count === 'number' ? count : 1) + 'D';
+};
+
+x.cursorLeft = ESC + '1000D';
+x.cursorSavePosition = ESC + 's';
+x.cursorRestorePosition = ESC + 'u';
+x.cursorGetPosition = ESC + '6n';
+x.cursorNextLine = ESC + 'E';
+x.cursorPrevLine = ESC + 'F';
+x.cursorHide = ESC + '?25l';
+x.cursorShow = ESC + '?25h';
+
+x.eraseLines = function (count) {
+ var clear = '';
+
+ for (var i = 0; i < count; i++) {
+ clear += x.cursorLeft + x.eraseEndLine + (i < count - 1 ? x.cursorUp() : '');
+ }
+
+ return clear;
+};
+
+x.eraseEndLine = ESC + 'K';
+x.eraseStartLine = ESC + '1K';
+x.eraseLine = ESC + '2K';
+x.eraseDown = ESC + 'J';
+x.eraseUp = ESC + '1J';
+x.eraseScreen = ESC + '2J';
+x.scrollUp = ESC + 'S';
+x.scrollDown = ESC + 'T';
+
+x.beep = '\u0007';
diff --git a/tools/eslint/node_modules/chalk/node_modules/strip-ansi/node_modules/ansi-regex/license b/tools/eslint/node_modules/ansi-escapes/license
similarity index 100%
rename from tools/eslint/node_modules/chalk/node_modules/strip-ansi/node_modules/ansi-regex/license
rename to tools/eslint/node_modules/ansi-escapes/license
diff --git a/tools/eslint/node_modules/ansi-escapes/package.json b/tools/eslint/node_modules/ansi-escapes/package.json
new file mode 100644
index 00000000000000..08882e58dbddd4
--- /dev/null
+++ b/tools/eslint/node_modules/ansi-escapes/package.json
@@ -0,0 +1,104 @@
+{
+ "_args": [
+ [
+ "ansi-escapes@^1.1.0",
+ "/Users/mzasso/git/forks/node/node_modules/eslint/node_modules/inquirer"
+ ]
+ ],
+ "_from": "ansi-escapes@>=1.1.0 <2.0.0",
+ "_id": "ansi-escapes@1.1.1",
+ "_inCache": true,
+ "_installable": true,
+ "_location": "/eslint/ansi-escapes",
+ "_nodeVersion": "4.2.4",
+ "_npmUser": {
+ "email": "sindresorhus@gmail.com",
+ "name": "sindresorhus"
+ },
+ "_npmVersion": "2.14.12",
+ "_phantomChildren": {},
+ "_requested": {
+ "name": "ansi-escapes",
+ "raw": "ansi-escapes@^1.1.0",
+ "rawSpec": "^1.1.0",
+ "scope": null,
+ "spec": ">=1.1.0 <2.0.0",
+ "type": "range"
+ },
+ "_requiredBy": [
+ "/eslint/inquirer"
+ ],
+ "_resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-1.1.1.tgz",
+ "_shasum": "cc9c0b193ac4c2b99a19f9b9fbc18ff5edd1d0a8",
+ "_shrinkwrap": null,
+ "_spec": "ansi-escapes@^1.1.0",
+ "_where": "/Users/mzasso/git/forks/node/node_modules/eslint/node_modules/inquirer",
+ "author": {
+ "email": "sindresorhus@gmail.com",
+ "name": "Sindre Sorhus",
+ "url": "sindresorhus.com"
+ },
+ "bugs": {
+ "url": "https://github.com/sindresorhus/ansi-escapes/issues"
+ },
+ "dependencies": {},
+ "description": "ANSI escape codes for manipulating the terminal",
+ "devDependencies": {
+ "ava": "*",
+ "xo": "*"
+ },
+ "directories": {},
+ "dist": {
+ "shasum": "cc9c0b193ac4c2b99a19f9b9fbc18ff5edd1d0a8",
+ "tarball": "http://registry.npmjs.org/ansi-escapes/-/ansi-escapes-1.1.1.tgz"
+ },
+ "engines": {
+ "node": ">=0.10.0"
+ },
+ "files": [
+ "index.js"
+ ],
+ "gitHead": "3dff027c48a59a377ed44b6d942b1b4f007c326f",
+ "homepage": "https://github.com/sindresorhus/ansi-escapes",
+ "keywords": [
+ "ansi",
+ "cli",
+ "code",
+ "codes",
+ "command-line",
+ "console",
+ "control",
+ "cursor",
+ "escape",
+ "escapes",
+ "formatting",
+ "log",
+ "logging",
+ "sequence",
+ "shell",
+ "string",
+ "terminal",
+ "text",
+ "tty",
+ "vt100",
+ "xterm"
+ ],
+ "license": "MIT",
+ "maintainers": [
+ {
+ "name": "sindresorhus",
+ "email": "sindresorhus@gmail.com"
+ }
+ ],
+ "name": "ansi-escapes",
+ "optionalDependencies": {},
+ "readme": "ERROR: No README data found!",
+ "repository": {
+ "type": "git",
+ "url": "git+https://github.com/sindresorhus/ansi-escapes.git"
+ },
+ "scripts": {
+ "test": "xo && ava"
+ },
+ "version": "1.1.1"
+}
diff --git a/tools/eslint/node_modules/ansi-escapes/readme.md b/tools/eslint/node_modules/ansi-escapes/readme.md
new file mode 100644
index 00000000000000..54762b7f240f8f
--- /dev/null
+++ b/tools/eslint/node_modules/ansi-escapes/readme.md
@@ -0,0 +1,132 @@
+# ansi-escapes [![Build Status](https://travis-ci.org/sindresorhus/ansi-escapes.svg?branch=master)](https://travis-ci.org/sindresorhus/ansi-escapes)
+
+> [ANSI escape codes](http://www.termsys.demon.co.uk/vtansi.htm) for manipulating the terminal
+
+
+## Install
+
+```
+$ npm install --save ansi-escapes
+```
+
+
+## Usage
+
+```js
+var ansiEscapes = require('ansi-escapes');
+
+// moves the cursor two rows up and to the left
+process.stdout.write(ansiEscapes.cursorUp(2) + ansiEscapes.cursorLeft);
+//=> '\u001b[2A\u001b[1000D'
+```
+
+
+## API
+
+### cursorTo([x, [y]])
+
+Set the absolute position of the cursor. `x0` `y0` is the top left of the screen.
+
+Specify either both `x` & `y`, only `x`, or nothing.
+
+### cursorMove(x, [y])
+
+Set the position of the cursor relative to its current position.
+
+### cursorUp(count)
+
+Move cursor up a specific amount of rows. Default is `1`.
+
+### cursorDown(count)
+
+Move cursor down a specific amount of rows. Default is `1`.
+
+### cursorForward(count)
+
+Move cursor forward a specific amount of rows. Default is `1`.
+
+### cursorBackward(count)
+
+Move cursor backward a specific amount of rows. Default is `1`.
+
+### cursorLeft
+
+Move cursor to the left side.
+
+### cursorSavePosition
+
+Save cursor position.
+
+### cursorRestorePosition
+
+Restore saved cursor position.
+
+### cursorGetPosition
+
+Get cursor position.
+
+### cursorNextLine
+
+Move cursor to the next line.
+
+### cursorPrevLine
+
+Move cursor to the previous line.
+
+### cursorHide
+
+Hide cursor.
+
+### cursorShow
+
+Show cursor.
+
+### eraseLines(count)
+
+Erase from the current cursor position up the specified amount of rows.
+
+### eraseEndLine
+
+Erase from the current cursor position to the end of the current line.
+
+### eraseStartLine
+
+Erase from the current cursor position to the start of the current line.
+
+### eraseLine
+
+Erase the entire current line.
+
+### eraseDown
+
+Erase the screen from the current line down to the bottom of the screen.
+
+### eraseUp
+
+Erase the screen from the current line up to the top of the screen.
+
+### eraseScreen
+
+Erase the screen and move the cursor the top left position.
+
+### scrollUp
+
+Scroll display up one line.
+
+### scrollDown
+
+Scroll display down one line.
+
+### beep
+
+Output a beeping sound.
+
+
+## Related
+
+- [ansi-styles](https://github.com/chalk/ansi-styles) - ANSI escape codes for styling strings in the terminal
+
+
+## License
+
+MIT © [Sindre Sorhus](http://sindresorhus.com)
diff --git a/tools/eslint/node_modules/ansi-regex/index.js b/tools/eslint/node_modules/ansi-regex/index.js
new file mode 100644
index 00000000000000..4906755bc93573
--- /dev/null
+++ b/tools/eslint/node_modules/ansi-regex/index.js
@@ -0,0 +1,4 @@
+'use strict';
+module.exports = function () {
+ return /[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]/g;
+};
diff --git a/tools/eslint/node_modules/chalk/node_modules/supports-color/license b/tools/eslint/node_modules/ansi-regex/license
similarity index 100%
rename from tools/eslint/node_modules/chalk/node_modules/supports-color/license
rename to tools/eslint/node_modules/ansi-regex/license
diff --git a/tools/eslint/node_modules/ansi-regex/package.json b/tools/eslint/node_modules/ansi-regex/package.json
new file mode 100644
index 00000000000000..229a24c2d4c2d2
--- /dev/null
+++ b/tools/eslint/node_modules/ansi-regex/package.json
@@ -0,0 +1,114 @@
+{
+ "_args": [
+ [
+ "ansi-regex@^2.0.0",
+ "/Users/mzasso/git/forks/node/node_modules/eslint/node_modules/has-ansi"
+ ]
+ ],
+ "_from": "ansi-regex@>=2.0.0 <3.0.0",
+ "_id": "ansi-regex@2.0.0",
+ "_inCache": true,
+ "_installable": true,
+ "_location": "/eslint/ansi-regex",
+ "_nodeVersion": "0.12.5",
+ "_npmUser": {
+ "email": "sindresorhus@gmail.com",
+ "name": "sindresorhus"
+ },
+ "_npmVersion": "2.11.2",
+ "_phantomChildren": {},
+ "_requested": {
+ "name": "ansi-regex",
+ "raw": "ansi-regex@^2.0.0",
+ "rawSpec": "^2.0.0",
+ "scope": null,
+ "spec": ">=2.0.0 <3.0.0",
+ "type": "range"
+ },
+ "_requiredBy": [
+ "/eslint/has-ansi",
+ "/eslint/inquirer",
+ "/eslint/strip-ansi"
+ ],
+ "_resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.0.0.tgz",
+ "_shasum": "c5061b6e0ef8a81775e50f5d66151bf6bf371107",
+ "_shrinkwrap": null,
+ "_spec": "ansi-regex@^2.0.0",
+ "_where": "/Users/mzasso/git/forks/node/node_modules/eslint/node_modules/has-ansi",
+ "author": {
+ "email": "sindresorhus@gmail.com",
+ "name": "Sindre Sorhus",
+ "url": "sindresorhus.com"
+ },
+ "bugs": {
+ "url": "https://github.com/sindresorhus/ansi-regex/issues"
+ },
+ "dependencies": {},
+ "description": "Regular expression for matching ANSI escape codes",
+ "devDependencies": {
+ "mocha": "*"
+ },
+ "directories": {},
+ "dist": {
+ "shasum": "c5061b6e0ef8a81775e50f5d66151bf6bf371107",
+ "tarball": "http://registry.npmjs.org/ansi-regex/-/ansi-regex-2.0.0.tgz"
+ },
+ "engines": {
+ "node": ">=0.10.0"
+ },
+ "files": [
+ "index.js"
+ ],
+ "gitHead": "57c3f2941a73079fa8b081e02a522e3d29913e2f",
+ "homepage": "https://github.com/sindresorhus/ansi-regex",
+ "keywords": [
+ "256",
+ "ansi",
+ "cli",
+ "color",
+ "colors",
+ "colour",
+ "command-line",
+ "console",
+ "escape",
+ "find",
+ "formatting",
+ "match",
+ "pattern",
+ "re",
+ "regex",
+ "regexp",
+ "rgb",
+ "shell",
+ "string",
+ "styles",
+ "terminal",
+ "test",
+ "text",
+ "tty",
+ "xterm"
+ ],
+ "license": "MIT",
+ "maintainers": [
+ {
+ "name": "sindresorhus",
+ "email": "sindresorhus@gmail.com"
+ },
+ {
+ "name": "jbnicolai",
+ "email": "jappelman@xebia.com"
+ }
+ ],
+ "name": "ansi-regex",
+ "optionalDependencies": {},
+ "readme": "ERROR: No README data found!",
+ "repository": {
+ "type": "git",
+ "url": "git+https://github.com/sindresorhus/ansi-regex.git"
+ },
+ "scripts": {
+ "test": "mocha test/test.js",
+ "view-supported": "node test/viewCodes.js"
+ },
+ "version": "2.0.0"
+}
diff --git a/tools/eslint/node_modules/ansi-regex/readme.md b/tools/eslint/node_modules/ansi-regex/readme.md
new file mode 100644
index 00000000000000..1a4894ec1110e3
--- /dev/null
+++ b/tools/eslint/node_modules/ansi-regex/readme.md
@@ -0,0 +1,31 @@
+# ansi-regex [![Build Status](https://travis-ci.org/sindresorhus/ansi-regex.svg?branch=master)](https://travis-ci.org/sindresorhus/ansi-regex)
+
+> Regular expression for matching [ANSI escape codes](http://en.wikipedia.org/wiki/ANSI_escape_code)
+
+
+## Install
+
+```
+$ npm install --save ansi-regex
+```
+
+
+## Usage
+
+```js
+var ansiRegex = require('ansi-regex');
+
+ansiRegex().test('\u001b[4mcake\u001b[0m');
+//=> true
+
+ansiRegex().test('cake');
+//=> false
+
+'\u001b[4mcake\u001b[0m'.match(ansiRegex());
+//=> ['\u001b[4m', '\u001b[0m']
+```
+
+
+## License
+
+MIT © [Sindre Sorhus](http://sindresorhus.com)
diff --git a/tools/eslint/node_modules/ansi-styles/index.js b/tools/eslint/node_modules/ansi-styles/index.js
new file mode 100644
index 00000000000000..78945278f78a72
--- /dev/null
+++ b/tools/eslint/node_modules/ansi-styles/index.js
@@ -0,0 +1,65 @@
+'use strict';
+
+function assembleStyles () {
+ var styles = {
+ modifiers: {
+ reset: [0, 0],
+ bold: [1, 22], // 21 isn't widely supported and 22 does the same thing
+ dim: [2, 22],
+ italic: [3, 23],
+ underline: [4, 24],
+ inverse: [7, 27],
+ hidden: [8, 28],
+ strikethrough: [9, 29]
+ },
+ colors: {
+ black: [30, 39],
+ red: [31, 39],
+ green: [32, 39],
+ yellow: [33, 39],
+ blue: [34, 39],
+ magenta: [35, 39],
+ cyan: [36, 39],
+ white: [37, 39],
+ gray: [90, 39]
+ },
+ bgColors: {
+ bgBlack: [40, 49],
+ bgRed: [41, 49],
+ bgGreen: [42, 49],
+ bgYellow: [43, 49],
+ bgBlue: [44, 49],
+ bgMagenta: [45, 49],
+ bgCyan: [46, 49],
+ bgWhite: [47, 49]
+ }
+ };
+
+ // fix humans
+ styles.colors.grey = styles.colors.gray;
+
+ Object.keys(styles).forEach(function (groupName) {
+ var group = styles[groupName];
+
+ Object.keys(group).forEach(function (styleName) {
+ var style = group[styleName];
+
+ styles[styleName] = group[styleName] = {
+ open: '\u001b[' + style[0] + 'm',
+ close: '\u001b[' + style[1] + 'm'
+ };
+ });
+
+ Object.defineProperty(styles, groupName, {
+ value: group,
+ enumerable: false
+ });
+ });
+
+ return styles;
+}
+
+Object.defineProperty(module, 'exports', {
+ enumerable: true,
+ get: assembleStyles
+});
diff --git a/tools/eslint/node_modules/inquirer/node_modules/ansi-regex/license b/tools/eslint/node_modules/ansi-styles/license
similarity index 100%
rename from tools/eslint/node_modules/inquirer/node_modules/ansi-regex/license
rename to tools/eslint/node_modules/ansi-styles/license
diff --git a/tools/eslint/node_modules/ansi-styles/package.json b/tools/eslint/node_modules/ansi-styles/package.json
new file mode 100644
index 00000000000000..b462cc504856c3
--- /dev/null
+++ b/tools/eslint/node_modules/ansi-styles/package.json
@@ -0,0 +1,106 @@
+{
+ "_args": [
+ [
+ "ansi-styles@^2.1.0",
+ "/Users/mzasso/git/forks/node/node_modules/eslint/node_modules/chalk"
+ ]
+ ],
+ "_from": "ansi-styles@>=2.1.0 <3.0.0",
+ "_id": "ansi-styles@2.1.0",
+ "_inCache": true,
+ "_installable": true,
+ "_location": "/eslint/ansi-styles",
+ "_nodeVersion": "0.12.4",
+ "_npmUser": {
+ "email": "jappelman@xebia.com",
+ "name": "jbnicolai"
+ },
+ "_npmVersion": "2.10.1",
+ "_phantomChildren": {},
+ "_requested": {
+ "name": "ansi-styles",
+ "raw": "ansi-styles@^2.1.0",
+ "rawSpec": "^2.1.0",
+ "scope": null,
+ "spec": ">=2.1.0 <3.0.0",
+ "type": "range"
+ },
+ "_requiredBy": [
+ "/eslint/chalk"
+ ],
+ "_resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.1.0.tgz",
+ "_shasum": "990f747146927b559a932bf92959163d60c0d0e2",
+ "_shrinkwrap": null,
+ "_spec": "ansi-styles@^2.1.0",
+ "_where": "/Users/mzasso/git/forks/node/node_modules/eslint/node_modules/chalk",
+ "author": {
+ "email": "sindresorhus@gmail.com",
+ "name": "Sindre Sorhus",
+ "url": "sindresorhus.com"
+ },
+ "bugs": {
+ "url": "https://github.com/chalk/ansi-styles/issues"
+ },
+ "dependencies": {},
+ "description": "ANSI escape codes for styling strings in the terminal",
+ "devDependencies": {
+ "mocha": "*"
+ },
+ "directories": {},
+ "dist": {
+ "shasum": "990f747146927b559a932bf92959163d60c0d0e2",
+ "tarball": "http://registry.npmjs.org/ansi-styles/-/ansi-styles-2.1.0.tgz"
+ },
+ "engines": {
+ "node": ">=0.10.0"
+ },
+ "files": [
+ "index.js"
+ ],
+ "gitHead": "18421cbe4a2d93359ec2599a894f704be126d066",
+ "homepage": "https://github.com/chalk/ansi-styles",
+ "keywords": [
+ "256",
+ "ansi",
+ "cli",
+ "color",
+ "colors",
+ "colour",
+ "command-line",
+ "console",
+ "escape",
+ "formatting",
+ "log",
+ "logging",
+ "rgb",
+ "shell",
+ "string",
+ "styles",
+ "terminal",
+ "text",
+ "tty",
+ "xterm"
+ ],
+ "license": "MIT",
+ "maintainers": [
+ {
+ "name": "sindresorhus",
+ "email": "sindresorhus@gmail.com"
+ },
+ {
+ "name": "jbnicolai",
+ "email": "jappelman@xebia.com"
+ }
+ ],
+ "name": "ansi-styles",
+ "optionalDependencies": {},
+ "readme": "ERROR: No README data found!",
+ "repository": {
+ "type": "git",
+ "url": "git+https://github.com/chalk/ansi-styles.git"
+ },
+ "scripts": {
+ "test": "mocha"
+ },
+ "version": "2.1.0"
+}
diff --git a/tools/eslint/node_modules/ansi-styles/readme.md b/tools/eslint/node_modules/ansi-styles/readme.md
new file mode 100644
index 00000000000000..3f933f6162e58e
--- /dev/null
+++ b/tools/eslint/node_modules/ansi-styles/readme.md
@@ -0,0 +1,86 @@
+# ansi-styles [![Build Status](https://travis-ci.org/chalk/ansi-styles.svg?branch=master)](https://travis-ci.org/chalk/ansi-styles)
+
+> [ANSI escape codes](http://en.wikipedia.org/wiki/ANSI_escape_code#Colors_and_Styles) for styling strings in the terminal
+
+You probably want the higher-level [chalk](https://github.com/chalk/chalk) module for styling your strings.
+
+![](screenshot.png)
+
+
+## Install
+
+```
+$ npm install --save ansi-styles
+```
+
+
+## Usage
+
+```js
+var ansi = require('ansi-styles');
+
+console.log(ansi.green.open + 'Hello world!' + ansi.green.close);
+```
+
+
+## API
+
+Each style has an `open` and `close` property.
+
+
+## Styles
+
+### Modifiers
+
+- `reset`
+- `bold`
+- `dim`
+- `italic` *(not widely supported)*
+- `underline`
+- `inverse`
+- `hidden`
+- `strikethrough` *(not widely supported)*
+
+### Colors
+
+- `black`
+- `red`
+- `green`
+- `yellow`
+- `blue`
+- `magenta`
+- `cyan`
+- `white`
+- `gray`
+
+### Background colors
+
+- `bgBlack`
+- `bgRed`
+- `bgGreen`
+- `bgYellow`
+- `bgBlue`
+- `bgMagenta`
+- `bgCyan`
+- `bgWhite`
+
+
+## Advanced usage
+
+By default you get a map of styles, but the styles are also available as groups. They are non-enumerable so they don't show up unless you access them explicitly. This makes it easier to expose only a subset in a higher-level module.
+
+- `ansi.modifiers`
+- `ansi.colors`
+- `ansi.bgColors`
+
+
+###### Example
+
+```js
+console.log(ansi.colors.green.open);
+```
+
+
+## License
+
+MIT © [Sindre Sorhus](http://sindresorhus.com)
diff --git a/tools/eslint/node_modules/js-yaml/node_modules/argparse/LICENSE b/tools/eslint/node_modules/argparse/LICENSE
similarity index 100%
rename from tools/eslint/node_modules/js-yaml/node_modules/argparse/LICENSE
rename to tools/eslint/node_modules/argparse/LICENSE
diff --git a/tools/eslint/node_modules/argparse/README.md b/tools/eslint/node_modules/argparse/README.md
new file mode 100644
index 00000000000000..1f84bf293de65f
--- /dev/null
+++ b/tools/eslint/node_modules/argparse/README.md
@@ -0,0 +1,241 @@
+argparse
+========
+
+[![Build Status](https://secure.travis-ci.org/nodeca/argparse.png?branch=master)](http://travis-ci.org/nodeca/argparse)
+[![NPM version](https://img.shields.io/npm/v/argparse.svg)](https://www.npmjs.org/package/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. Difference with original.**
+
+- Method names changed to camelCase. See [generated docs](http://nodeca.github.com/argparse/).
+- Use `defaultValue` instead of `default`.
+
+
+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: null)
+- ```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: `path.basename(process.argv[1])`)
+- ```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/tools/eslint/node_modules/js-yaml/node_modules/argparse/index.js b/tools/eslint/node_modules/argparse/index.js
similarity index 100%
rename from tools/eslint/node_modules/js-yaml/node_modules/argparse/index.js
rename to tools/eslint/node_modules/argparse/index.js
diff --git a/tools/eslint/node_modules/js-yaml/node_modules/argparse/lib/action.js b/tools/eslint/node_modules/argparse/lib/action.js
similarity index 100%
rename from tools/eslint/node_modules/js-yaml/node_modules/argparse/lib/action.js
rename to tools/eslint/node_modules/argparse/lib/action.js
diff --git a/tools/eslint/node_modules/js-yaml/node_modules/argparse/lib/action/append.js b/tools/eslint/node_modules/argparse/lib/action/append.js
similarity index 99%
rename from tools/eslint/node_modules/js-yaml/node_modules/argparse/lib/action/append.js
rename to tools/eslint/node_modules/argparse/lib/action/append.js
index 48c6dbe30de5d6..79df02e579b0f5 100644
--- a/tools/eslint/node_modules/js-yaml/node_modules/argparse/lib/action/append.js
+++ b/tools/eslint/node_modules/argparse/lib/action/append.js
@@ -51,5 +51,3 @@ ActionAppend.prototype.call = function (parser, namespace, values) {
items.push(values);
namespace.set(this.dest, items);
};
-
-
diff --git a/tools/eslint/node_modules/js-yaml/node_modules/argparse/lib/action/append/constant.js b/tools/eslint/node_modules/argparse/lib/action/append/constant.js
similarity index 100%
rename from tools/eslint/node_modules/js-yaml/node_modules/argparse/lib/action/append/constant.js
rename to tools/eslint/node_modules/argparse/lib/action/append/constant.js
diff --git a/tools/eslint/node_modules/js-yaml/node_modules/argparse/lib/action/count.js b/tools/eslint/node_modules/argparse/lib/action/count.js
similarity index 100%
rename from tools/eslint/node_modules/js-yaml/node_modules/argparse/lib/action/count.js
rename to tools/eslint/node_modules/argparse/lib/action/count.js
diff --git a/tools/eslint/node_modules/js-yaml/node_modules/argparse/lib/action/help.js b/tools/eslint/node_modules/argparse/lib/action/help.js
similarity index 100%
rename from tools/eslint/node_modules/js-yaml/node_modules/argparse/lib/action/help.js
rename to tools/eslint/node_modules/argparse/lib/action/help.js
diff --git a/tools/eslint/node_modules/js-yaml/node_modules/argparse/lib/action/store.js b/tools/eslint/node_modules/argparse/lib/action/store.js
similarity index 100%
rename from tools/eslint/node_modules/js-yaml/node_modules/argparse/lib/action/store.js
rename to tools/eslint/node_modules/argparse/lib/action/store.js
diff --git a/tools/eslint/node_modules/js-yaml/node_modules/argparse/lib/action/store/constant.js b/tools/eslint/node_modules/argparse/lib/action/store/constant.js
similarity index 100%
rename from tools/eslint/node_modules/js-yaml/node_modules/argparse/lib/action/store/constant.js
rename to tools/eslint/node_modules/argparse/lib/action/store/constant.js
diff --git a/tools/eslint/node_modules/js-yaml/node_modules/argparse/lib/action/store/false.js b/tools/eslint/node_modules/argparse/lib/action/store/false.js
similarity index 100%
rename from tools/eslint/node_modules/js-yaml/node_modules/argparse/lib/action/store/false.js
rename to tools/eslint/node_modules/argparse/lib/action/store/false.js
diff --git a/tools/eslint/node_modules/js-yaml/node_modules/argparse/lib/action/store/true.js b/tools/eslint/node_modules/argparse/lib/action/store/true.js
similarity index 100%
rename from tools/eslint/node_modules/js-yaml/node_modules/argparse/lib/action/store/true.js
rename to tools/eslint/node_modules/argparse/lib/action/store/true.js
diff --git a/tools/eslint/node_modules/js-yaml/node_modules/argparse/lib/action/subparsers.js b/tools/eslint/node_modules/argparse/lib/action/subparsers.js
similarity index 99%
rename from tools/eslint/node_modules/js-yaml/node_modules/argparse/lib/action/subparsers.js
rename to tools/eslint/node_modules/argparse/lib/action/subparsers.js
index 257714d40e0e3f..45f034564c08df 100644
--- a/tools/eslint/node_modules/js-yaml/node_modules/argparse/lib/action/subparsers.js
+++ b/tools/eslint/node_modules/argparse/lib/action/subparsers.js
@@ -144,5 +144,3 @@ ActionSubparsers.prototype.call = function (parser, namespace, values) {
// parse all the remaining options into the namespace
parser.parseArgs(argStrings, namespace);
};
-
-
diff --git a/tools/eslint/node_modules/js-yaml/node_modules/argparse/lib/action/version.js b/tools/eslint/node_modules/argparse/lib/action/version.js
similarity index 99%
rename from tools/eslint/node_modules/js-yaml/node_modules/argparse/lib/action/version.js
rename to tools/eslint/node_modules/argparse/lib/action/version.js
index a17877c0bacc3c..cf262408f197a4 100644
--- a/tools/eslint/node_modules/js-yaml/node_modules/argparse/lib/action/version.js
+++ b/tools/eslint/node_modules/argparse/lib/action/version.js
@@ -45,6 +45,3 @@ ActionVersion.prototype.call = function (parser) {
formatter.addText(version);
parser.exit(0, formatter.formatHelp());
};
-
-
-
diff --git a/tools/eslint/node_modules/js-yaml/node_modules/argparse/lib/action_container.js b/tools/eslint/node_modules/argparse/lib/action_container.js
similarity index 100%
rename from tools/eslint/node_modules/js-yaml/node_modules/argparse/lib/action_container.js
rename to tools/eslint/node_modules/argparse/lib/action_container.js
diff --git a/tools/eslint/node_modules/js-yaml/node_modules/argparse/lib/argparse.js b/tools/eslint/node_modules/argparse/lib/argparse.js
similarity index 100%
rename from tools/eslint/node_modules/js-yaml/node_modules/argparse/lib/argparse.js
rename to tools/eslint/node_modules/argparse/lib/argparse.js
diff --git a/tools/eslint/node_modules/js-yaml/node_modules/argparse/lib/argument/error.js b/tools/eslint/node_modules/argparse/lib/argument/error.js
similarity index 100%
rename from tools/eslint/node_modules/js-yaml/node_modules/argparse/lib/argument/error.js
rename to tools/eslint/node_modules/argparse/lib/argument/error.js
diff --git a/tools/eslint/node_modules/js-yaml/node_modules/argparse/lib/argument/exclusive.js b/tools/eslint/node_modules/argparse/lib/argument/exclusive.js
similarity index 99%
rename from tools/eslint/node_modules/js-yaml/node_modules/argparse/lib/argument/exclusive.js
rename to tools/eslint/node_modules/argparse/lib/argument/exclusive.js
index 8287e00d0464f3..deaca28b8303dc 100644
--- a/tools/eslint/node_modules/js-yaml/node_modules/argparse/lib/argument/exclusive.js
+++ b/tools/eslint/node_modules/argparse/lib/argument/exclusive.js
@@ -51,4 +51,3 @@ MutuallyExclusiveGroup.prototype._removeAction = function (action) {
this._container._removeAction(action);
this._groupActions.remove(action);
};
-
diff --git a/tools/eslint/node_modules/argparse/lib/argument/group.js b/tools/eslint/node_modules/argparse/lib/argument/group.js
new file mode 100644
index 00000000000000..ad7693869bc4e5
--- /dev/null
+++ b/tools/eslint/node_modules/argparse/lib/argument/group.js
@@ -0,0 +1,74 @@
+/** 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/tools/eslint/node_modules/js-yaml/node_modules/argparse/lib/argument_parser.js b/tools/eslint/node_modules/argparse/lib/argument_parser.js
similarity index 99%
rename from tools/eslint/node_modules/js-yaml/node_modules/argparse/lib/argument_parser.js
rename to tools/eslint/node_modules/argparse/lib/argument_parser.js
index 2b4cee395eb8f3..c429ca929b1a1c 100644
--- a/tools/eslint/node_modules/js-yaml/node_modules/argparse/lib/argument_parser.js
+++ b/tools/eslint/node_modules/argparse/lib/argument_parser.js
@@ -53,6 +53,9 @@ var Namespace = require('./namespace');
* [1]:http://docs.python.org/dev/library/argparse.html#argumentparser-objects
**/
var ArgumentParser = module.exports = function ArgumentParser(options) {
+ if (!(this instanceof ArgumentParser)) {
+ return new ArgumentParser(options);
+ }
var self = this;
options = options || {};
@@ -738,9 +741,8 @@ ArgumentParser.prototype._parseOptional = function (argString) {
// 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];
+ optionString = argString.split('=', 1)[0];
+ argExplicit = argString.slice(optionString.length + 1);
if (!!this._optionStringActions[optionString]) {
action = this._optionStringActions[optionString];
diff --git a/tools/eslint/node_modules/js-yaml/node_modules/argparse/lib/const.js b/tools/eslint/node_modules/argparse/lib/const.js
similarity index 100%
rename from tools/eslint/node_modules/js-yaml/node_modules/argparse/lib/const.js
rename to tools/eslint/node_modules/argparse/lib/const.js
diff --git a/tools/eslint/node_modules/js-yaml/node_modules/argparse/lib/help/added_formatters.js b/tools/eslint/node_modules/argparse/lib/help/added_formatters.js
similarity index 100%
rename from tools/eslint/node_modules/js-yaml/node_modules/argparse/lib/help/added_formatters.js
rename to tools/eslint/node_modules/argparse/lib/help/added_formatters.js
diff --git a/tools/eslint/node_modules/js-yaml/node_modules/argparse/lib/help/formatter.js b/tools/eslint/node_modules/argparse/lib/help/formatter.js
similarity index 100%
rename from tools/eslint/node_modules/js-yaml/node_modules/argparse/lib/help/formatter.js
rename to tools/eslint/node_modules/argparse/lib/help/formatter.js
diff --git a/tools/eslint/node_modules/js-yaml/node_modules/argparse/lib/namespace.js b/tools/eslint/node_modules/argparse/lib/namespace.js
similarity index 100%
rename from tools/eslint/node_modules/js-yaml/node_modules/argparse/lib/namespace.js
rename to tools/eslint/node_modules/argparse/lib/namespace.js
diff --git a/tools/eslint/node_modules/argparse/package.json b/tools/eslint/node_modules/argparse/package.json
new file mode 100644
index 00000000000000..2ad636b89cabcb
--- /dev/null
+++ b/tools/eslint/node_modules/argparse/package.json
@@ -0,0 +1,87 @@
+{
+ "_args": [
+ [
+ "argparse@^1.0.2",
+ "/Users/mzasso/git/forks/node/node_modules/eslint/node_modules/js-yaml"
+ ]
+ ],
+ "_from": "argparse@>=1.0.2 <2.0.0",
+ "_id": "argparse@1.0.3",
+ "_inCache": true,
+ "_installable": true,
+ "_location": "/eslint/argparse",
+ "_nodeVersion": "4.2.1",
+ "_npmUser": {
+ "email": "vitaly@rcdesign.ru",
+ "name": "vitaly"
+ },
+ "_npmVersion": "2.14.7",
+ "_phantomChildren": {},
+ "_requested": {
+ "name": "argparse",
+ "raw": "argparse@^1.0.2",
+ "rawSpec": "^1.0.2",
+ "scope": null,
+ "spec": ">=1.0.2 <2.0.0",
+ "type": "range"
+ },
+ "_requiredBy": [
+ "/eslint/js-yaml"
+ ],
+ "_resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.3.tgz",
+ "_shasum": "14389deeb0c28fc4cda9405b9f532a4e3785ce84",
+ "_shrinkwrap": null,
+ "_spec": "argparse@^1.0.2",
+ "_where": "/Users/mzasso/git/forks/node/node_modules/eslint/node_modules/js-yaml",
+ "bugs": {
+ "url": "https://github.com/nodeca/argparse/issues"
+ },
+ "contributors": [
+ {
+ "name": "Eugene Shkuropat"
+ },
+ {
+ "name": "Paul Jacobson"
+ }
+ ],
+ "dependencies": {
+ "lodash": ">= 3.2.0 < 4.0.0",
+ "sprintf-js": "~1.0.2"
+ },
+ "description": "Very powerful CLI arguments parser. Native port of argparse - python's options parsing library",
+ "devDependencies": {
+ "mocha": "*"
+ },
+ "directories": {},
+ "dist": {
+ "shasum": "14389deeb0c28fc4cda9405b9f532a4e3785ce84",
+ "tarball": "http://registry.npmjs.org/argparse/-/argparse-1.0.3.tgz"
+ },
+ "gitHead": "e46e471f113ba31074c0d0c156f93fd7a618b27c",
+ "homepage": "https://github.com/nodeca/argparse",
+ "keywords": [
+ "argparse",
+ "args",
+ "cli",
+ "option",
+ "parser"
+ ],
+ "license": "MIT",
+ "maintainers": [
+ {
+ "name": "vitaly",
+ "email": "vitaly@rcdesign.ru"
+ }
+ ],
+ "name": "argparse",
+ "optionalDependencies": {},
+ "readme": "ERROR: No README data found!",
+ "repository": {
+ "type": "git",
+ "url": "git+https://github.com/nodeca/argparse.git"
+ },
+ "scripts": {
+ "test": "make test"
+ },
+ "version": "1.0.3"
+}
diff --git a/tools/eslint/node_modules/array-union/index.js b/tools/eslint/node_modules/array-union/index.js
new file mode 100644
index 00000000000000..e33f38a1eb4acd
--- /dev/null
+++ b/tools/eslint/node_modules/array-union/index.js
@@ -0,0 +1,6 @@
+'use strict';
+var arrayUniq = require('array-uniq');
+
+module.exports = function () {
+ return arrayUniq([].concat.apply([], arguments));
+};
diff --git a/tools/eslint/node_modules/array-union/package.json b/tools/eslint/node_modules/array-union/package.json
new file mode 100644
index 00000000000000..1f5d2a9b772d97
--- /dev/null
+++ b/tools/eslint/node_modules/array-union/package.json
@@ -0,0 +1,94 @@
+{
+ "_args": [
+ [
+ "array-union@^1.0.1",
+ "/Users/mzasso/git/forks/node/node_modules/eslint/node_modules/globby"
+ ]
+ ],
+ "_from": "array-union@>=1.0.1 <2.0.0",
+ "_id": "array-union@1.0.1",
+ "_inCache": true,
+ "_installable": true,
+ "_location": "/eslint/array-union",
+ "_nodeVersion": "0.10.32",
+ "_npmUser": {
+ "email": "sindresorhus@gmail.com",
+ "name": "sindresorhus"
+ },
+ "_npmVersion": "2.1.5",
+ "_phantomChildren": {},
+ "_requested": {
+ "name": "array-union",
+ "raw": "array-union@^1.0.1",
+ "rawSpec": "^1.0.1",
+ "scope": null,
+ "spec": ">=1.0.1 <2.0.0",
+ "type": "range"
+ },
+ "_requiredBy": [
+ "/eslint/globby"
+ ],
+ "_resolved": "https://registry.npmjs.org/array-union/-/array-union-1.0.1.tgz",
+ "_shasum": "4d410fc8395cb247637124bade9e3f547d5d55f2",
+ "_shrinkwrap": null,
+ "_spec": "array-union@^1.0.1",
+ "_where": "/Users/mzasso/git/forks/node/node_modules/eslint/node_modules/globby",
+ "author": {
+ "email": "sindresorhus@gmail.com",
+ "name": "Sindre Sorhus",
+ "url": "http://sindresorhus.com"
+ },
+ "bugs": {
+ "url": "https://github.com/sindresorhus/array-union/issues"
+ },
+ "dependencies": {
+ "array-uniq": "^1.0.1"
+ },
+ "description": "Create an array of unique values, in order, from the input arrays",
+ "devDependencies": {
+ "mocha": "*"
+ },
+ "directories": {},
+ "dist": {
+ "shasum": "4d410fc8395cb247637124bade9e3f547d5d55f2",
+ "tarball": "http://registry.npmjs.org/array-union/-/array-union-1.0.1.tgz"
+ },
+ "engines": {
+ "node": ">=0.10.0"
+ },
+ "files": [
+ "index.js"
+ ],
+ "gitHead": "d0e72cc6fbff57273032e45050c51ff44c8e137c",
+ "homepage": "https://github.com/sindresorhus/array-union",
+ "keywords": [
+ "arr",
+ "array",
+ "combine",
+ "duplicate",
+ "merge",
+ "remove",
+ "set",
+ "union",
+ "uniq",
+ "unique"
+ ],
+ "license": "MIT",
+ "maintainers": [
+ {
+ "name": "sindresorhus",
+ "email": "sindresorhus@gmail.com"
+ }
+ ],
+ "name": "array-union",
+ "optionalDependencies": {},
+ "readme": "ERROR: No README data found!",
+ "repository": {
+ "type": "git",
+ "url": "git+https://github.com/sindresorhus/array-union.git"
+ },
+ "scripts": {
+ "test": "mocha"
+ },
+ "version": "1.0.1"
+}
diff --git a/tools/eslint/node_modules/array-union/readme.md b/tools/eslint/node_modules/array-union/readme.md
new file mode 100644
index 00000000000000..dbae3615e7e905
--- /dev/null
+++ b/tools/eslint/node_modules/array-union/readme.md
@@ -0,0 +1,28 @@
+# array-union [![Build Status](https://travis-ci.org/sindresorhus/array-union.svg?branch=master)](https://travis-ci.org/sindresorhus/array-union)
+
+> Create an array of unique values, in order, from the input arrays
+
+
+## Install
+
+```sh
+$ npm install --save array-union
+```
+
+
+## Usage
+
+```js
+var arrayUnion = require('array-union');
+
+arrayUnion([1, 1, 2, 3], [2, 3]);
+//=> [1, 2, 3]
+
+arrayUnion(['foo', 'foo', 'bar'], ['foo']);
+//=> ['foo', 'bar']
+```
+
+
+## License
+
+MIT © [Sindre Sorhus](http://sindresorhus.com)
diff --git a/tools/eslint/node_modules/array-uniq/index.js b/tools/eslint/node_modules/array-uniq/index.js
new file mode 100644
index 00000000000000..40f81b8a080d89
--- /dev/null
+++ b/tools/eslint/node_modules/array-uniq/index.js
@@ -0,0 +1,60 @@
+'use strict';
+
+// there's 3 implementations written in increasing order of efficiency
+
+// 1 - no Set type is defined
+function uniqNoSet(arr) {
+ var ret = [];
+
+ for (var i = 0; i < arr.length; i++) {
+ if (ret.indexOf(arr[i]) === -1) {
+ ret.push(arr[i]);
+ }
+ }
+
+ return ret;
+}
+
+// 2 - a simple Set type is defined
+function uniqSet(arr) {
+ var seen = new Set();
+ return arr.filter(function (el) {
+ if (!seen.has(el)) {
+ seen.add(el);
+ return true;
+ }
+ });
+}
+
+// 3 - a standard Set type is defined and it has a forEach method
+function uniqSetWithForEach(arr) {
+ var ret = [];
+
+ (new Set(arr)).forEach(function (el) {
+ ret.push(el);
+ });
+
+ return ret;
+}
+
+// V8 currently has a broken implementation
+// https://github.com/joyent/node/issues/8449
+function doesForEachActuallyWork() {
+ var ret = false;
+
+ (new Set([true])).forEach(function (el) {
+ ret = el;
+ });
+
+ return ret === true;
+}
+
+if ('Set' in global) {
+ if (typeof Set.prototype.forEach === 'function' && doesForEachActuallyWork()) {
+ module.exports = uniqSetWithForEach;
+ } else {
+ module.exports = uniqSet;
+ }
+} else {
+ module.exports = uniqNoSet;
+}
diff --git a/tools/eslint/node_modules/array-uniq/package.json b/tools/eslint/node_modules/array-uniq/package.json
new file mode 100644
index 00000000000000..de38a3eb85d07c
--- /dev/null
+++ b/tools/eslint/node_modules/array-uniq/package.json
@@ -0,0 +1,92 @@
+{
+ "_args": [
+ [
+ "array-uniq@^1.0.1",
+ "/Users/mzasso/git/forks/node/node_modules/eslint/node_modules/array-union"
+ ]
+ ],
+ "_from": "array-uniq@>=1.0.1 <2.0.0",
+ "_id": "array-uniq@1.0.2",
+ "_inCache": true,
+ "_installable": true,
+ "_location": "/eslint/array-uniq",
+ "_nodeVersion": "0.10.32",
+ "_npmUser": {
+ "email": "sindresorhus@gmail.com",
+ "name": "sindresorhus"
+ },
+ "_npmVersion": "2.1.5",
+ "_phantomChildren": {},
+ "_requested": {
+ "name": "array-uniq",
+ "raw": "array-uniq@^1.0.1",
+ "rawSpec": "^1.0.1",
+ "scope": null,
+ "spec": ">=1.0.1 <2.0.0",
+ "type": "range"
+ },
+ "_requiredBy": [
+ "/eslint/array-union"
+ ],
+ "_resolved": "https://registry.npmjs.org/array-uniq/-/array-uniq-1.0.2.tgz",
+ "_shasum": "5fcc373920775723cfd64d65c64bef53bf9eba6d",
+ "_shrinkwrap": null,
+ "_spec": "array-uniq@^1.0.1",
+ "_where": "/Users/mzasso/git/forks/node/node_modules/eslint/node_modules/array-union",
+ "author": {
+ "email": "sindresorhus@gmail.com",
+ "name": "Sindre Sorhus",
+ "url": "http://sindresorhus.com"
+ },
+ "bugs": {
+ "url": "https://github.com/sindresorhus/array-uniq/issues"
+ },
+ "dependencies": {},
+ "description": "Create an array without duplicates",
+ "devDependencies": {
+ "es6-set": "^0.1.0",
+ "mocha": "*",
+ "require-uncached": "^1.0.2"
+ },
+ "directories": {},
+ "dist": {
+ "shasum": "5fcc373920775723cfd64d65c64bef53bf9eba6d",
+ "tarball": "http://registry.npmjs.org/array-uniq/-/array-uniq-1.0.2.tgz"
+ },
+ "engines": {
+ "node": ">=0.10.0"
+ },
+ "files": [
+ "index.js"
+ ],
+ "gitHead": "d5e311f37692dfd25ec216490df10632ce5f69f3",
+ "homepage": "https://github.com/sindresorhus/array-uniq",
+ "keywords": [
+ "arr",
+ "array",
+ "duplicate",
+ "es6",
+ "remove",
+ "set",
+ "uniq",
+ "unique"
+ ],
+ "license": "MIT",
+ "maintainers": [
+ {
+ "name": "sindresorhus",
+ "email": "sindresorhus@gmail.com"
+ }
+ ],
+ "name": "array-uniq",
+ "optionalDependencies": {},
+ "readme": "ERROR: No README data found!",
+ "repository": {
+ "type": "git",
+ "url": "git+https://github.com/sindresorhus/array-uniq.git"
+ },
+ "scripts": {
+ "test": "mocha"
+ },
+ "version": "1.0.2"
+}
diff --git a/tools/eslint/node_modules/array-uniq/readme.md b/tools/eslint/node_modules/array-uniq/readme.md
new file mode 100644
index 00000000000000..5183d07ec13ff3
--- /dev/null
+++ b/tools/eslint/node_modules/array-uniq/readme.md
@@ -0,0 +1,30 @@
+# array-uniq [![Build Status](https://travis-ci.org/sindresorhus/array-uniq.svg?branch=master)](https://travis-ci.org/sindresorhus/array-uniq)
+
+> Create an array without duplicates
+
+It's already pretty fast, but will be much faster when [Set](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set) becomes available in V8 (especially with large arrays).
+
+
+## Install
+
+```sh
+$ npm install --save array-uniq
+```
+
+
+## Usage
+
+```js
+var arrayUniq = require('array-uniq');
+
+arrayUniq([1, 1, 2, 3, 3]);
+//=> [1, 2, 3]
+
+arrayUniq(['foo', 'foo', 'bar', 'foo']);
+//=> ['foo', 'bar']
+```
+
+
+## License
+
+MIT © [Sindre Sorhus](http://sindresorhus.com)
diff --git a/tools/eslint/node_modules/arrify/index.js b/tools/eslint/node_modules/arrify/index.js
new file mode 100644
index 00000000000000..2a2fdeeb1dc5a5
--- /dev/null
+++ b/tools/eslint/node_modules/arrify/index.js
@@ -0,0 +1,8 @@
+'use strict';
+module.exports = function (val) {
+ if (val === null || val === undefined) {
+ return [];
+ }
+
+ return Array.isArray(val) ? val : [val];
+};
diff --git a/tools/eslint/node_modules/arrify/license b/tools/eslint/node_modules/arrify/license
new file mode 100644
index 00000000000000..654d0bfe943437
--- /dev/null
+++ b/tools/eslint/node_modules/arrify/license
@@ -0,0 +1,21 @@
+The MIT License (MIT)
+
+Copyright (c) Sindre Sorhus (sindresorhus.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/tools/eslint/node_modules/arrify/package.json b/tools/eslint/node_modules/arrify/package.json
new file mode 100644
index 00000000000000..10844b8b2c9dde
--- /dev/null
+++ b/tools/eslint/node_modules/arrify/package.json
@@ -0,0 +1,89 @@
+{
+ "_args": [
+ [
+ "arrify@^1.0.0",
+ "/Users/mzasso/git/forks/node/node_modules/eslint/node_modules/globby"
+ ]
+ ],
+ "_from": "arrify@>=1.0.0 <2.0.0",
+ "_id": "arrify@1.0.1",
+ "_inCache": true,
+ "_installable": true,
+ "_location": "/eslint/arrify",
+ "_nodeVersion": "4.2.1",
+ "_npmUser": {
+ "email": "sindresorhus@gmail.com",
+ "name": "sindresorhus"
+ },
+ "_npmVersion": "3.5.2",
+ "_phantomChildren": {},
+ "_requested": {
+ "name": "arrify",
+ "raw": "arrify@^1.0.0",
+ "rawSpec": "^1.0.0",
+ "scope": null,
+ "spec": ">=1.0.0 <2.0.0",
+ "type": "range"
+ },
+ "_requiredBy": [
+ "/eslint/globby"
+ ],
+ "_resolved": "https://registry.npmjs.org/arrify/-/arrify-1.0.1.tgz",
+ "_shasum": "898508da2226f380df904728456849c1501a4b0d",
+ "_shrinkwrap": null,
+ "_spec": "arrify@^1.0.0",
+ "_where": "/Users/mzasso/git/forks/node/node_modules/eslint/node_modules/globby",
+ "author": {
+ "email": "sindresorhus@gmail.com",
+ "name": "Sindre Sorhus",
+ "url": "sindresorhus.com"
+ },
+ "bugs": {
+ "url": "https://github.com/sindresorhus/arrify/issues"
+ },
+ "dependencies": {},
+ "description": "Convert a value to an array",
+ "devDependencies": {
+ "ava": "*",
+ "xo": "*"
+ },
+ "directories": {},
+ "dist": {
+ "shasum": "898508da2226f380df904728456849c1501a4b0d",
+ "tarball": "http://registry.npmjs.org/arrify/-/arrify-1.0.1.tgz"
+ },
+ "engines": {
+ "node": ">=0.10.0"
+ },
+ "files": [
+ "index.js"
+ ],
+ "gitHead": "087edee1a58d5adaac6cae5a107886121ef43783",
+ "homepage": "https://github.com/sindresorhus/arrify#readme",
+ "keywords": [
+ "arr",
+ "array",
+ "arrayify",
+ "arrify",
+ "convert",
+ "value"
+ ],
+ "license": "MIT",
+ "maintainers": [
+ {
+ "name": "sindresorhus",
+ "email": "sindresorhus@gmail.com"
+ }
+ ],
+ "name": "arrify",
+ "optionalDependencies": {},
+ "readme": "ERROR: No README data found!",
+ "repository": {
+ "type": "git",
+ "url": "git+https://github.com/sindresorhus/arrify.git"
+ },
+ "scripts": {
+ "test": "xo && ava"
+ },
+ "version": "1.0.1"
+}
diff --git a/tools/eslint/node_modules/arrify/readme.md b/tools/eslint/node_modules/arrify/readme.md
new file mode 100644
index 00000000000000..183d07576f1aee
--- /dev/null
+++ b/tools/eslint/node_modules/arrify/readme.md
@@ -0,0 +1,36 @@
+# arrify [![Build Status](https://travis-ci.org/sindresorhus/arrify.svg?branch=master)](https://travis-ci.org/sindresorhus/arrify)
+
+> Convert a value to an array
+
+
+## Install
+
+```
+$ npm install --save arrify
+```
+
+
+## Usage
+
+```js
+const arrify = require('arrify');
+
+arrify('unicorn');
+//=> ['unicorn']
+
+arrify(['unicorn']);
+//=> ['unicorn']
+
+arrify(null);
+//=> []
+
+arrify(undefined);
+//=> []
+```
+
+*Supplying `null` or `undefined` results in an empty array.*
+
+
+## License
+
+MIT © [Sindre Sorhus](http://sindresorhus.com)
diff --git a/tools/eslint/node_modules/async/LICENSE b/tools/eslint/node_modules/async/LICENSE
new file mode 100644
index 00000000000000..8f29698588533b
--- /dev/null
+++ b/tools/eslint/node_modules/async/LICENSE
@@ -0,0 +1,19 @@
+Copyright (c) 2010-2014 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/tools/eslint/node_modules/async/README.md b/tools/eslint/node_modules/async/README.md
new file mode 100644
index 00000000000000..3a0f017719b309
--- /dev/null
+++ b/tools/eslint/node_modules/async/README.md
@@ -0,0 +1,1877 @@
+# Async.js
+
+[![Build Status via Travis CI](https://travis-ci.org/caolan/async.svg?branch=master)](https://travis-ci.org/caolan/async)
+[![NPM version](http://img.shields.io/npm/v/async.svg)](https://www.npmjs.org/package/async)
+[![Coverage Status](https://coveralls.io/repos/caolan/async/badge.svg?branch=master)](https://coveralls.io/r/caolan/async?branch=master)
+[![Join the chat at https://gitter.im/caolan/async](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/caolan/async?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
+
+
+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) and installable via `npm install async`,
+it can also be used directly in the browser.
+
+Async is also installable via:
+
+- [bower](http://bower.io/): `bower install async`
+- [component](https://github.com/component/component): `component install
+ caolan/async`
+- [jam](http://jamjs.org/): `jam install async`
+- [spm](http://spmjs.io/): `spm install async`
+
+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 [(StackOverflow)](http://stackoverflow.com/questions/tagged/async.js)
+### Synchronous iteration functions
+
+If you get an error like `RangeError: Maximum call stack size exceeded.` or other stack overflow issues when using async, you are likely using a synchronous iterator. By *synchronous* we mean a function that calls its callback on the same tick in the javascript event loop, without doing any I/O or using any timers. Calling many callbacks iteratively will quickly overflow the stack. If you run into this issue, just defer your callback with `async.setImmediate` to start a new call stack on the next tick of the event loop.
+
+This can also arise by accident if you callback early in certain cases:
+
+```js
+async.eachSeries(hugeArray, function iterator(item, callback) {
+ if (inCache(item)) {
+ callback(null, cache[item]); // if many items are cached, you'll overflow
+ } else {
+ doSomeIO(item, callback);
+ }
+}, function done() {
+ //...
+});
+```
+
+Just change it to:
+
+```js
+async.eachSeries(hugeArray, function iterator(item, callback) {
+ if (inCache(item)) {
+ async.setImmediate(function () {
+ callback(null, cache[item]);
+ });
+ } else {
+ doSomeIO(item, callback);
+ //...
+```
+
+Async guards against synchronous functions in some, but not all, cases. If you are still running into stack overflows, you can defer as suggested above, or wrap functions with [`async.ensureAsync`](#ensureAsync) Functions that are asynchronous by their nature do not have this problem and don't need the extra callback deferral.
+
+If JavaScript's event loop is still a bit nebulous, check out [this article](http://blog.carbonfive.com/2013/10/27/the-javascript-event-loop-explained/) or [this talk](http://2014.jsconf.eu/speakers/philip-roberts-what-the-heck-is-the-event-loop-anyway.html) for more detailed information about how it works.
+
+
+### Multiple callbacks
+
+Make sure to always `return` when calling a callback early, otherwise you will cause multiple callbacks and unpredictable behavior in many cases.
+
+```js
+async.waterfall([
+ function (callback) {
+ getSomething(options, function (err, result) {
+ if (err) {
+ callback(new Error("failed getting something:" + err.message));
+ // we should return here
+ }
+ // since we did not return, this callback still will be called and
+ // `processData` will be called twice
+ callback(null, result);
+ });
+ },
+ processData
+], done)
+```
+
+It is always good practice to `return callback(err, result)` whenever a callback call is not the last statement of a function.
+
+
+### 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](https://github.com/caolan/async/blob/master/lib/async.js).
+Alternatively, you can install using Node Package Manager (`npm`):
+
+ npm install async
+
+As well as using Bower:
+
+ bower 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
+
+Some functions are also available in the following forms:
+* `Series` - the same as `` but runs only a single async operation at a time
+* `Limit` - the same as `` but runs a maximum of `limit` async operations at a time
+
+### Collections
+
+* [`each`](#each), `eachSeries`, `eachLimit`
+* [`forEachOf`](#forEachOf), `forEachOfSeries`, `forEachOfLimit`
+* [`map`](#map), `mapSeries`, `mapLimit`
+* [`filter`](#filter), `filterSeries`, `filterLimit`
+* [`reject`](#reject), `rejectSeries`, `rejectLimit`
+* [`reduce`](#reduce), [`reduceRight`](#reduceRight)
+* [`detect`](#detect), `detectSeries`, `detectLimit`
+* [`sortBy`](#sortBy)
+* [`some`](#some), `someLimit`
+* [`every`](#every), `everyLimit`
+* [`concat`](#concat), `concatSeries`
+
+### Control Flow
+
+* [`series`](#seriestasks-callback)
+* [`parallel`](#parallel), `parallelLimit`
+* [`whilst`](#whilst), [`doWhilst`](#doWhilst)
+* [`until`](#until), [`doUntil`](#doUntil)
+* [`during`](#during), [`doDuring`](#doDuring)
+* [`forever`](#forever)
+* [`waterfall`](#waterfall)
+* [`compose`](#compose)
+* [`seq`](#seq)
+* [`applyEach`](#applyEach), `applyEachSeries`
+* [`queue`](#queue), [`priorityQueue`](#priorityQueue)
+* [`cargo`](#cargo)
+* [`auto`](#auto)
+* [`retry`](#retry)
+* [`iterator`](#iterator)
+* [`times`](#times), `timesSeries`, `timesLimit`
+
+### Utils
+
+* [`apply`](#apply)
+* [`nextTick`](#nextTick)
+* [`memoize`](#memoize)
+* [`unmemoize`](#unmemoize)
+* [`ensureAsync`](#ensureAsync)
+* [`constant`](#constant)
+* [`asyncify`](#asyncify)
+* [`wrapSync`](#wrapSync)
+* [`log`](#log)
+* [`dir`](#dir)
+* [`noConflict`](#noConflict)
+
+## Collections
+
+
+
+### each(arr, iterator, [callback])
+
+Applies the function `iterator` to each item in `arr`, 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 its `callback`, the main
+`callback` (for the `each` function) is immediately called with the error.
+
+Note, that since this function applies `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 `arr`.
+ The iterator is passed a `callback(err)` which must be called once it has
+ completed. If no error has occurred, the `callback` should be run without
+ arguments or with an explicit `null` argument. The array index is not passed
+ to the iterator. If you need the index, use [`forEachOf`](#forEachOf).
+* `callback(err)` - *Optional* A callback which is called when all `iterator` functions
+ have finished, or an error occurs.
+
+__Examples__
+
+
+```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
+});
+```
+
+```js
+// assuming openFiles is an array of file names
+
+async.each(openFiles, function(file, callback) {
+
+ // Perform operation on file here.
+ console.log('Processing file ' + file);
+
+ if( file.length > 32 ) {
+ console.log('This file name is too long');
+ callback('File name too long');
+ } else {
+ // Do work to process file here
+ console.log('File processed');
+ callback();
+ }
+}, function(err){
+ // if any of the file processing produced an error, err would equal that error
+ if( err ) {
+ // One of the iterations produced an error.
+ // All processing will now stop.
+ console.log('A file failed to process');
+ } else {
+ console.log('All files have been processed successfully');
+ }
+});
+```
+
+__Related__
+
+* eachSeries(arr, iterator, [callback])
+* eachLimit(arr, limit, iterator, [callback])
+
+---------------------------------------
+
+
+
+
+### forEachOf(obj, iterator, [callback])
+
+Like `each`, except that it iterates over objects, and passes the key as the second argument to the iterator.
+
+__Arguments__
+
+* `obj` - An object or array to iterate over.
+* `iterator(item, key, callback)` - A function to apply to each item in `obj`.
+The `key` is the item's key, or index in the case of an array. The iterator is
+passed a `callback(err)` which must be called once it has completed. If no
+error has occurred, the callback should be run without arguments or with an
+explicit `null` argument.
+* `callback(err)` - *Optional* A callback which is called when all `iterator` functions have finished, or an error occurs.
+
+__Example__
+
+```js
+var obj = {dev: "/dev.json", test: "/test.json", prod: "/prod.json"};
+var configs = {};
+
+async.forEachOf(obj, function (value, key, callback) {
+ fs.readFile(__dirname + value, "utf8", function (err, data) {
+ if (err) return callback(err);
+ try {
+ configs[key] = JSON.parse(data);
+ } catch (e) {
+ return callback(e);
+ }
+ callback();
+ })
+}, function (err) {
+ if (err) console.error(err.message);
+ // configs is now a map of JSON data
+ doSomethingWith(configs);
+})
+```
+
+__Related__
+
+* forEachOfSeries(obj, iterator, [callback])
+* forEachOfLimit(obj, limit, iterator, [callback])
+
+---------------------------------------
+
+
+### map(arr, iterator, [callback])
+
+Produces a new array of values by mapping each value in `arr` through
+the `iterator` function. The `iterator` is called with an item from `arr` and a
+callback for when it has finished processing. Each of these callback takes 2 arguments:
+an `error`, and the transformed item from `arr`. If `iterator` passes an error to its
+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 `arr`.
+
+__Arguments__
+
+* `arr` - An array to iterate over.
+* `iterator(item, callback)` - A function to apply to each item in `arr`.
+ 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)` - *Optional* A callback which is called when all `iterator`
+ functions have finished, or an error occurs. Results is an array of the
+ transformed items from the `arr`.
+
+__Example__
+
+```js
+async.map(['file1','file2','file3'], fs.stat, function(err, results){
+ // results is now an array of stats for each file
+});
+```
+
+__Related__
+* mapSeries(arr, iterator, [callback])
+* mapLimit(arr, limit, iterator, [callback])
+
+---------------------------------------
+
+
+
+### filter(arr, iterator, [callback])
+
+__Alias:__ `select`
+
+Returns a new array of all the values in `arr` 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 `arr`.
+ The `iterator` is passed a `callback(truthValue)`, which must be called with a
+ boolean argument once it has completed.
+* `callback(results)` - *Optional* 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
+});
+```
+
+__Related__
+
+* filterSeries(arr, iterator, [callback])
+* filterLimit(arr, limit, iterator, [callback])
+
+---------------------------------------
+
+
+### reject(arr, iterator, [callback])
+
+The opposite of [`filter`](#filter). Removes values that pass an `async` truth test.
+
+__Related__
+
+* rejectSeries(arr, iterator, [callback])
+* rejectLimit(arr, limit, iterator, [callback])
+
+---------------------------------------
+
+
+### reduce(arr, memo, iterator, [callback])
+
+__Aliases:__ `inject`, `foldl`
+
+Reduces `arr` 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, and 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)` - *Optional* 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`](#reduce), only operates on `arr` in reverse order.
+
+
+---------------------------------------
+
+
+### detect(arr, iterator, [callback])
+
+Returns the first value in `arr` 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 `arr` (in terms of order) that passes the test.
+
+If order within the original `arr` is important, then look at [`detectSeries`](#detectSeries).
+
+__Arguments__
+
+* `arr` - An array to iterate over.
+* `iterator(item, callback)` - A truth test to apply to each item in `arr`.
+ The iterator is passed a `callback(truthValue)` which must be called with a
+ boolean argument once it has completed. **Note: this callback does not take an error as its first argument.**
+* `callback(result)` - *Optional* 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. **Note: this callback does not take an error as its first argument.**
+
+__Example__
+
+```js
+async.detect(['file1','file2','file3'], fs.exists, function(result){
+ // result now equals the first file in the list that exists
+});
+```
+
+__Related__
+
+* detectSeries(arr, iterator, [callback])
+* detectLimit(arr, limit, iterator, [callback])
+
+---------------------------------------
+
+
+### sortBy(arr, iterator, [callback])
+
+Sorts a list by the results of running each `arr` value through an async `iterator`.
+
+__Arguments__
+
+* `arr` - An array to iterate over.
+* `iterator(item, callback)` - A function to apply to each item in `arr`.
+ 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)` - *Optional* A callback which is called after all the `iterator`
+ functions have finished, or an error occurs. Results is the items from
+ the original `arr` 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
+});
+```
+
+__Sort Order__
+
+By modifying the callback parameter the sorting order can be influenced:
+
+```js
+//ascending order
+async.sortBy([1,9,3,5], function(x, callback){
+ callback(null, x);
+}, function(err,result){
+ //result callback
+} );
+
+//descending order
+async.sortBy([1,9,3,5], function(x, callback){
+ callback(null, x*-1); //<- x*-1 instead of x, turns the order around
+}, function(err,result){
+ //result callback
+} );
+```
+
+---------------------------------------
+
+
+### some(arr, iterator, [callback])
+
+__Alias:__ `any`
+
+Returns `true` if at least one element in the `arr` 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
+ in parallel. The iterator is passed a `callback(truthValue)`` which must be
+ called with a boolean argument once it has completed.
+* `callback(result)` - *Optional* 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.
+
+ **Note: the callbacks do not take an error as their first argument.**
+__Example__
+
+```js
+async.some(['file1','file2','file3'], fs.exists, function(result){
+ // if result is true then at least one of the files exists
+});
+```
+
+__Related__
+
+* someLimit(arr, limit, iterator, callback)
+
+---------------------------------------
+
+
+### every(arr, iterator, [callback])
+
+__Alias:__ `all`
+
+Returns `true` if every element in `arr` 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
+ in parallel. The iterator is passed a `callback(truthValue)` which must be
+ called with a boolean argument once it has completed.
+* `callback(result)` - *Optional* A callback which is called as soon as any iterator returns
+ `false`, or after all the iterator functions have finished. Result will be
+ either `true` or `false` depending on the values of the async tests.
+
+ **Note: the callbacks do not take an error as their first argument.**
+
+__Example__
+
+```js
+async.every(['file1','file2','file3'], fs.exists, function(result){
+ // if result is true then every file exists
+});
+```
+
+__Related__
+
+* everyLimit(arr, limit, iterator, callback)
+
+---------------------------------------
+
+
+### concat(arr, iterator, [callback])
+
+Applies `iterator` to each item in `arr`, concatenating the results. Returns the
+concatenated list. The `iterator`s 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 `arr` passed to the `iterator` function.
+
+__Arguments__
+
+* `arr` - An array to iterate over.
+* `iterator(item, callback)` - A function to apply to each item in `arr`.
+ 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)` - *Optional* A callback which is called after all the `iterator`
+ functions have finished, or an error occurs. 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
+});
+```
+
+__Related__
+
+* concatSeries(arr, iterator, [callback])
+
+
+## Control Flow
+
+
+### series(tasks, [callback])
+
+Run the functions in the `tasks` array 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 `callback` is immediately called with the value of the error.
+Otherwise, `callback` receives an array of results when `tasks` have completed.
+
+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
+[`series`](#series).
+
+**Note** that while many implementations preserve the order of object properties, the
+[ECMAScript Language Specification](http://www.ecma-international.org/ecma-262/5.1/#sec-8.6)
+explicitly states that
+
+> The mechanics and order of enumerating the properties is not specified.
+
+So if you rely on the order in which your series of functions are executed, and want
+this to work on all platforms, consider using an array.
+
+__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 `err` (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 the `tasks` 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.
+
+**Note:** `parallel` is about kicking-off I/O tasks in parallel, not about parallel execution of code. If your tasks do not use any timers or perform any I/O, they will actually be executed in series. Any synchronous setup sections for each task will happen one after the other. JavaScript remains single-threaded.
+
+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
+[`parallel`](#parallel).
+
+
+__Arguments__
+
+* `tasks` - An array or object containing functions to run. Each function is passed
+ a `callback(err, result)` which it must call on completion with an error `err`
+ (which can be `null`) and an optional `result` value.
+* `callback(err, results)` - An optional callback to run once all the functions
+ have completed successfully. 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}
+});
+```
+
+__Related__
+
+* parallelLimit(tasks, limit, [callback])
+
+---------------------------------------
+
+
+### whilst(test, fn, callback)
+
+Repeatedly call `fn`, while `test` returns `true`. Calls `callback` when stopped,
+or an error occurs.
+
+__Arguments__
+
+* `test()` - synchronous truth test to perform before each execution of `fn`.
+* `fn(callback)` - A function which is called each time `test` passes. The function is
+ passed a `callback(err)`, which must be called once it has completed with an
+ optional `err` argument.
+* `callback(err, [results])` - A callback which is called after the test
+ function has failed and repeated execution of `fn` has stopped. `callback`
+ will be passed an error and any arguments passed to the final `fn`'s callback.
+
+__Example__
+
+```js
+var count = 0;
+
+async.whilst(
+ function () { return count < 5; },
+ function (callback) {
+ count++;
+ setTimeout(function () {
+ callback(null, count);
+ }, 1000);
+ },
+ function (err, n) {
+ // 5 seconds have passed, n = 5
+ }
+);
+```
+
+---------------------------------------
+
+
+### doWhilst(fn, test, callback)
+
+The post-check version of [`whilst`](#whilst). To reflect the difference in
+the order of operations, the arguments `test` and `fn` 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 `callback` when stopped,
+or an error occurs. `callback` will be passed an error and any arguments passed
+to the final `fn`'s callback.
+
+The inverse of [`whilst`](#whilst).
+
+---------------------------------------
+
+
+### doUntil(fn, test, callback)
+
+Like [`doWhilst`](#doWhilst), except the `test` is inverted. Note the argument ordering differs from `until`.
+
+---------------------------------------
+
+
+### during(test, fn, callback)
+
+Like [`whilst`](#whilst), except the `test` is an asynchronous function that is passed a callback in the form of `function (err, truth)`. If error is passed to `test` or `fn`, the main callback is immediately called with the value of the error.
+
+__Example__
+
+```js
+var count = 0;
+
+async.during(
+ function (callback) {
+ return callback(null, count < 5);
+ },
+ function (callback) {
+ count++;
+ setTimeout(callback, 1000);
+ },
+ function (err) {
+ // 5 seconds have passed
+ }
+);
+```
+
+---------------------------------------
+
+
+### doDuring(fn, test, callback)
+
+The post-check version of [`during`](#during). To reflect the difference in
+the order of operations, the arguments `test` and `fn` are switched.
+
+Also a version of [`doWhilst`](#doWhilst) with asynchronous `test` function.
+
+---------------------------------------
+
+
+### forever(fn, [errback])
+
+Calls the asynchronous function `fn` with a callback parameter that allows it to
+call itself again, in series, indefinitely.
+
+If an error is passed to the callback then `errback` is called with the
+error, and execution stops, otherwise it will never be called.
+
+```js
+async.forever(
+ function(next) {
+ // next is suitable for passing to things that need a callback(err [, whatever]);
+ // it will result in this function being called again.
+ },
+ function(err) {
+ // if next is called with a value in its first parameter, it will appear
+ // in here as 'err', and execution will stop.
+ }
+);
+```
+
+---------------------------------------
+
+
+### waterfall(tasks, [callback])
+
+Runs the `tasks` array of functions in series, each passing their results to the next in
+the array. However, if any of the `tasks` pass an error to their own 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) {
+ // arg1 now equals 'one' and arg2 now equals 'two'
+ callback(null, 'three');
+ },
+ function(arg1, callback) {
+ // arg1 now equals 'three'
+ callback(null, 'done');
+ }
+], function (err, result) {
+ // result now equals 'done'
+});
+```
+Or, with named functions:
+
+```js
+async.waterfall([
+ myFirstFunction,
+ mySecondFunction,
+ myLastFunction,
+], function (err, result) {
+ // result now equals 'done'
+});
+function myFirstFunction(callback) {
+ callback(null, 'one', 'two');
+}
+function mySecondFunction(arg1, arg2, callback) {
+ // arg1 now equals 'one' and arg2 now equals 'two'
+ callback(null, 'three');
+}
+function myLastFunction(arg1, callback) {
+ // arg1 now equals 'three'
+ callback(null, 'done');
+}
+```
+
+Or, if you need to pass any argument to the first function:
+
+```js
+async.waterfall([
+ async.apply(myFirstFunction, 'zero'),
+ mySecondFunction,
+ myLastFunction,
+], function (err, result) {
+ // result now equals 'done'
+});
+function myFirstFunction(arg1, callback) {
+ // arg1 now equals 'zero'
+ callback(null, 'one', 'two');
+}
+function mySecondFunction(arg1, arg2, callback) {
+ // arg1 now equals 'one' and arg2 now equals 'two'
+ callback(null, 'three');
+}
+function myLastFunction(arg1, callback) {
+ // arg1 now equals 'three'
+ callback(null, '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
+});
+```
+
+---------------------------------------
+
+### seq(fn1, fn2...)
+
+Version of the compose function that is more natural to read.
+Each function consumes the return value of the previous function.
+It is the equivalent of [`compose`](#compose) with the arguments reversed.
+
+Each function is executed with the `this` binding of the composed function.
+
+__Arguments__
+
+* `functions...` - the asynchronous functions to compose
+
+
+__Example__
+
+```js
+// Requires lodash (or underscore), express3 and dresende's orm2.
+// Part of an app, that fetches cats of the logged user.
+// This example uses `seq` function to avoid overnesting and error
+// handling clutter.
+app.get('/cats', function(request, response) {
+ var User = request.models.User;
+ async.seq(
+ _.bind(User.get, User), // 'User.get' has signature (id, callback(err, data))
+ function(user, fn) {
+ user.getCats(fn); // 'getCats' has signature (callback(err, data))
+ }
+ )(req.session.user_id, function (err, cats) {
+ if (err) {
+ console.error(err);
+ response.json({ status: 'error', message: err.message });
+ } else {
+ response.json({ status: 'ok', message: 'Cats found', data: cats });
+ }
+ });
+});
+```
+
+---------------------------------------
+
+### applyEach(fns, args..., callback)
+
+Applies the provided arguments to each function in the array, calling
+`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
+);
+```
+
+__Related__
+
+* applyEachSeries(tasks, args..., [callback])
+
+---------------------------------------
+
+
+### queue(worker, [concurrency])
+
+Creates a `queue` object with the specified `concurrency`. Tasks added to the
+`queue` are processed in parallel (up to the `concurrency` limit). If all
+`worker`s are in progress, the task is queued until one becomes available.
+Once a `worker` completes a `task`, that `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. If you want to handle errors from an individual task, pass a callback to `q.push()`.
+* `concurrency` - An `integer` for determining how many `worker` functions should be
+ run in parallel. If omitted, the concurrency defaults to `1`. If the concurrency is `0`, an error is thrown.
+
+__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.
+* `started` - a function returning whether or not any items have been pushed and processed by the queue
+* `running()` - a function returning the number of items currently being processed.
+* `workersList()` - a function returning the array of items currently being processed.
+* `idle()` - a function returning false if there are items waiting or being processed, or true if not.
+* `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`. Calls `callback` once
+ the `worker` has finished processing the task. Instead of a single task, a `tasks` array
+ 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` limit,
+ 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`.
+* `paused` - a boolean for determining whether the queue is in a paused state
+* `pause()` - a function that pauses the processing of tasks until `resume()` is called.
+* `resume()` - a function that resumes the processing of queued tasks when the queue is paused.
+* `kill()` - a function that removes the `drain` callback and empties remaining tasks from the queue forcing it to go idle.
+
+__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 item');
+});
+
+// add some items to the front of the queue
+
+q.unshift({name: 'bar'}, function (err) {
+ console.log('finished processing bar');
+});
+```
+
+
+---------------------------------------
+
+
+### priorityQueue(worker, concurrency)
+
+The same as [`queue`](#queue) only tasks are assigned a priority and completed in ascending priority order. There are two differences between `queue` and `priorityQueue` objects:
+
+* `push(task, priority, [callback])` - `priority` should be a number. If an array of
+ `tasks` is given, all tasks will be assigned the same priority.
+* The `unshift` method was removed.
+
+---------------------------------------
+
+
+### 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 becomes available. Once
+the `worker` has completed some tasks, each callback of those tasks is called.
+Check out [these](https://camo.githubusercontent.com/6bbd36f4cf5b35a0f11a96dcd2e97711ffc2fb37/68747470733a2f2f662e636c6f75642e6769746875622e636f6d2f6173736574732f313637363837312f36383130382f62626330636662302d356632392d313165322d393734662d3333393763363464633835382e676966) [animations](https://camo.githubusercontent.com/f4810e00e1c5f5f8addbe3e9f49064fd5d102699/68747470733a2f2f662e636c6f75642e6769746875622e636f6d2f6173736574732f313637363837312f36383130312f38346339323036362d356632392d313165322d383134662d3964336430323431336266642e676966) for how `cargo` and `queue` work.
+
+While [queue](#queue) passes only one task to one of a group of workers
+at a time, cargo passes an array of tasks to a single worker, repeating
+when the worker is finished.
+
+__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 `err` 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])` - Adds `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`.
+* `idle()`, `pause()`, `resume()`, `kill()` - cargo inherits all of the same methods and event calbacks as [`queue`](#queue)
+
+__Example__
+
+```js
+// create a cargo object with payload 2
+
+var cargo = async.cargo(function (tasks, callback) {
+ for(var i=0; i
+### auto(tasks, [concurrency], [callback])
+
+Determines the best order for running the functions in `tasks`, 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, the `auto` sequence will stop. Further tasks will not execute (so any other functions depending on it will not run), and the main `callback` is immediately called 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. Each of its properties is either a function or an array of
+ requirements, with the function itself the last item in the array. The object's key
+ of a property serves as the name of the task defined by that property,
+ i.e. can be used when specifying requirements for other tasks.
+ 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.
+* `concurrency` - An optional `integer` for determining the maximum number of tasks that can be run in parallel. By default, as many as possible.
+* `callback(err, results)` - An optional callback which is called when all the
+ tasks have been completed. It receives the `err` argument if any `tasks`
+ pass an error to their callback. Results are always returned; however, if
+ an error occurs, no further `tasks` will be performed, and the results
+ object will only contain partial results.
+
+
+__Example__
+
+```js
+async.auto({
+ get_data: function(callback){
+ console.log('in get_data');
+ // async code to get some data
+ callback(null, 'data', 'converted to array');
+ },
+ make_folder: function(callback){
+ console.log('in make_folder');
+ // async code to create a directory to store a file in
+ // this is run at the same time as getting the data
+ callback(null, 'folder');
+ },
+ write_file: ['get_data', 'make_folder', function(callback, results){
+ console.log('in write_file', JSON.stringify(results));
+ // 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){
+ console.log('in email_link', JSON.stringify(results));
+ // once the file is written let's email a link to it...
+ // results.write_file contains the filename returned by write_file.
+ callback(null, {'file':results.write_file, 'email':'user@example.com'});
+ }]
+}, function(err, results) {
+ console.log('err = ', err);
+ console.log('results = ', results);
+});
+```
+
+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){
+ console.log('in get_data');
+ // async code to get some data
+ callback(null, 'data', 'converted to array');
+ },
+ function(callback){
+ console.log('in make_folder');
+ // async code to create a directory to store a file in
+ // this is run at the same time as getting the data
+ callback(null, 'folder');
+ }
+],
+function(err, results){
+ async.series([
+ function(callback){
+ console.log('in write_file', JSON.stringify(results));
+ // once there is some data and the directory exists,
+ // write the data to a file in the directory
+ results.push('filename');
+ callback(null);
+ },
+ function(callback){
+ console.log('in email_link', JSON.stringify(results));
+ // once the file is written let's email a link to it...
+ callback(null, {'file':results.pop(), 'email':'user@example.com'});
+ }
+ ]);
+});
+```
+
+For a complicated series of `async` tasks, using the [`auto`](#auto) function makes adding
+new tasks much easier (and the code more readable).
+
+
+---------------------------------------
+
+
+### retry([opts = {times: 5, interval: 0}| 5], task, [callback])
+
+Attempts to get a successful response from `task` no more than `times` times before
+returning an error. If the task is successful, the `callback` will be passed the result
+of the successful task. If all attempts fail, the callback will be passed the error and
+result (if any) of the final attempt.
+
+__Arguments__
+
+* `opts` - Can be either an object with `times` and `interval` or a number.
+ * `times` - The number of attempts to make before giving up. The default is `5`.
+ * `interval` - The time to wait between retries, in milliseconds. The default is `0`.
+ * If `opts` is a number, the number specifies the number of times to retry, with the default interval of `0`.
+* `task(callback, results)` - A function which receives two arguments: (1) a `callback(err, result)`
+ which must be called when finished, passing `err` (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 (if nested inside another control flow).
+* `callback(err, results)` - An optional callback which is called when the
+ task has succeeded, or after the final failed attempt. It receives the `err` and `result` arguments of the last attempt at completing the `task`.
+
+The [`retry`](#retry) function can be used as a stand-alone control flow by passing a callback, as shown below:
+
+```js
+// try calling apiMethod 3 times
+async.retry(3, apiMethod, function(err, result) {
+ // do something with the result
+});
+```
+
+```js
+// try calling apiMethod 3 times, waiting 200 ms between each retry
+async.retry({times: 3, interval: 200}, apiMethod, function(err, result) {
+ // do something with the result
+});
+```
+
+```js
+// try calling apiMethod the default 5 times no delay between each retry
+async.retry(apiMethod, function(err, result) {
+ // do something with the result
+});
+```
+
+It can also be embedded within other control flow functions to retry individual methods
+that are not as reliable, like this:
+
+```js
+async.auto({
+ users: api.getUsers.bind(api),
+ payments: async.retry(3, api.getPayments.bind(api))
+}, function(err, results) {
+ // do something with the results
+});
+```
+
+
+---------------------------------------
+
+
+### iterator(tasks)
+
+Creates an iterator function which calls the next function in the `tasks` array,
+returning a continuation to call the next one after that. It's also possible to
+“peek” at the next iterator with `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.
+
+Useful as a 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), setImmediate(callback)
+
+Calls `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 `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, iterator, [callback])
+
+Calls the `iterator` function `n` times, and accumulates results in the same manner
+you would use with [`map`](#map).
+
+__Arguments__
+
+* `n` - The number of times to run the function.
+* `iterator` - The function to call `n` times.
+* `callback` - see [`map`](#map)
+
+__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
+});
+```
+
+__Related__
+
+* timesSeries(n, iterator, [callback])
+* timesLimit(n, limit, iterator, [callback])
+
+
+## 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.
+
+If no hash function is specified, the first argument is used as a hash key, which may work reasonably if it is a string or a data type that converts to a distinct string. Note that objects and arrays will not behave reasonably. Neither will cases where the other arguments are significant. In such cases, specify your own hash function.
+
+The cache of results is exposed as the `memo` property of the function returned
+by `memoize`.
+
+__Arguments__
+
+* `fn` - The function 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 [`memoize`](#memoize)d function, reverting it to the original, unmemoized
+form. Handy for testing.
+
+__Arguments__
+
+* `fn` - the memoized function
+
+---------------------------------------
+
+
+### ensureAsync(fn)
+
+Wrap an async function and ensure it calls its callback on a later tick of the event loop. If the function already calls its callback on a next tick, no extra deferral is added. This is useful for preventing stack overflows (`RangeError: Maximum call stack size exceeded`) and generally keeping [Zalgo](http://blog.izs.me/post/59142742143/designing-apis-for-asynchrony) contained.
+
+__Arguments__
+
+* `fn` - an async function, one that expects a node-style callback as its last argument
+
+Returns a wrapped function with the exact same call signature as the function passed in.
+
+__Example__
+
+```js
+function sometimesAsync(arg, callback) {
+ if (cache[arg]) {
+ return callback(null, cache[arg]); // this would be synchronous!!
+ } else {
+ doSomeIO(arg, callback); // this IO would be asynchronous
+ }
+}
+
+// this has a risk of stack overflows if many results are cached in a row
+async.mapSeries(args, sometimesAsync, done);
+
+// this will defer sometimesAsync's callback if necessary,
+// preventing stack overflows
+async.mapSeries(args, async.ensureAsync(sometimesAsync), done);
+
+```
+
+---------------------------------------
+
+
+### constant(values...)
+
+Returns a function that when called, calls-back with the values provided. Useful as the first function in a `waterfall`, or for plugging values in to `auto`.
+
+__Example__
+
+```js
+async.waterfall([
+ async.constant(42),
+ function (value, next) {
+ // value === 42
+ },
+ //...
+], callback);
+
+async.waterfall([
+ async.constant(filename, "utf8"),
+ fs.readFile,
+ function (fileData, next) {
+ //...
+ }
+ //...
+], callback);
+
+async.auto({
+ hostname: async.constant("https://server.net/"),
+ port: findFreePort,
+ launchServer: ["hostname", "port", function (cb, options) {
+ startServer(options, cb);
+ }],
+ //...
+}, callback);
+
+```
+
+---------------------------------------
+
+
+
+### asyncify(func)
+
+__Alias:__ `wrapSync`
+
+Take a sync function and make it async, passing its return value to a callback. This is useful for plugging sync functions into a waterfall, series, or other async functions. Any arguments passed to the generated function will be passed to the wrapped function (except for the final callback argument). Errors thrown will be passed to the callback.
+
+__Example__
+
+```js
+async.waterfall([
+ async.apply(fs.readFile, filename, "utf8"),
+ async.asyncify(JSON.parse),
+ function (data, next) {
+ // data is the result of parsing the text.
+ // If there was a parsing error, it would have been caught.
+ }
+], callback)
+```
+
+If the function passed to `asyncify` returns a Promise, that promises's resolved/rejected state will be used to call the callback, rather than simply the synchronous return value. Example:
+
+```js
+async.waterfall([
+ async.apply(fs.readFile, filename, "utf8"),
+ async.asyncify(function (contents) {
+ return db.model.create(contents);
+ }),
+ function (model, next) {
+ // `model` is the instantiated model object.
+ // If there was an error, this function would be skipped.
+ }
+], callback)
+```
+
+This also means you can asyncify ES2016 `async` functions.
+
+```js
+var q = async.queue(async.asyncify(async function (file) {
+ var intermediateStep = await processFile(file);
+ return await somePromise(intermediateStep)
+}));
+
+q.push(files);
+```
+
+---------------------------------------
+
+
+### 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/tools/eslint/node_modules/async/dist/async.js b/tools/eslint/node_modules/async/dist/async.js
new file mode 100644
index 00000000000000..ee0a268e6d7932
--- /dev/null
+++ b/tools/eslint/node_modules/async/dist/async.js
@@ -0,0 +1,1265 @@
+/*!
+ * async
+ * https://github.com/caolan/async
+ *
+ * Copyright 2010-2014 Caolan McMahon
+ * Released under the MIT license
+ */
+(function () {
+
+ var async = {};
+ function noop() {}
+ function identity(v) {
+ return v;
+ }
+ function toBool(v) {
+ return !!v;
+ }
+ function notId(v) {
+ return !v;
+ }
+
+ // global on the server, window in the browser
+ var previous_async;
+
+ // Establish the root object, `window` (`self`) in the browser, `global`
+ // on the server, or `this` in some virtual machines. We use `self`
+ // instead of `window` for `WebWorker` support.
+ var root = typeof self === 'object' && self.self === self && self ||
+ typeof global === 'object' && global.global === global && global ||
+ this;
+
+ if (root != null) {
+ previous_async = root.async;
+ }
+
+ async.noConflict = function () {
+ root.async = previous_async;
+ return async;
+ };
+
+ function only_once(fn) {
+ return function() {
+ if (fn === null) throw new Error("Callback was already called.");
+ fn.apply(this, arguments);
+ fn = null;
+ };
+ }
+
+ function _once(fn) {
+ return function() {
+ if (fn === null) return;
+ fn.apply(this, arguments);
+ fn = null;
+ };
+ }
+
+ //// cross-browser compatiblity functions ////
+
+ var _toString = Object.prototype.toString;
+
+ var _isArray = Array.isArray || function (obj) {
+ return _toString.call(obj) === '[object Array]';
+ };
+
+ // Ported from underscore.js isObject
+ var _isObject = function(obj) {
+ var type = typeof obj;
+ return type === 'function' || type === 'object' && !!obj;
+ };
+
+ function _isArrayLike(arr) {
+ return _isArray(arr) || (
+ // has a positive integer length property
+ typeof arr.length === "number" &&
+ arr.length >= 0 &&
+ arr.length % 1 === 0
+ );
+ }
+
+ function _arrayEach(arr, iterator) {
+ var index = -1,
+ length = arr.length;
+
+ while (++index < length) {
+ iterator(arr[index], index, arr);
+ }
+ }
+
+ function _map(arr, iterator) {
+ var index = -1,
+ length = arr.length,
+ result = Array(length);
+
+ while (++index < length) {
+ result[index] = iterator(arr[index], index, arr);
+ }
+ return result;
+ }
+
+ function _range(count) {
+ return _map(Array(count), function (v, i) { return i; });
+ }
+
+ function _reduce(arr, iterator, memo) {
+ _arrayEach(arr, function (x, i, a) {
+ memo = iterator(memo, x, i, a);
+ });
+ return memo;
+ }
+
+ function _forEachOf(object, iterator) {
+ _arrayEach(_keys(object), function (key) {
+ iterator(object[key], key);
+ });
+ }
+
+ function _indexOf(arr, item) {
+ for (var i = 0; i < arr.length; i++) {
+ if (arr[i] === item) return i;
+ }
+ return -1;
+ }
+
+ var _keys = Object.keys || function (obj) {
+ var keys = [];
+ for (var k in obj) {
+ if (obj.hasOwnProperty(k)) {
+ keys.push(k);
+ }
+ }
+ return keys;
+ };
+
+ function _keyIterator(coll) {
+ var i = -1;
+ var len;
+ var keys;
+ if (_isArrayLike(coll)) {
+ len = coll.length;
+ return function next() {
+ i++;
+ return i < len ? i : null;
+ };
+ } else {
+ keys = _keys(coll);
+ len = keys.length;
+ return function next() {
+ i++;
+ return i < len ? keys[i] : null;
+ };
+ }
+ }
+
+ // Similar to ES6's rest param (http://ariya.ofilabs.com/2013/03/es6-and-rest-parameter.html)
+ // This accumulates the arguments passed into an array, after a given index.
+ // From underscore.js (https://github.com/jashkenas/underscore/pull/2140).
+ function _restParam(func, startIndex) {
+ startIndex = startIndex == null ? func.length - 1 : +startIndex;
+ return function() {
+ var length = Math.max(arguments.length - startIndex, 0);
+ var rest = Array(length);
+ for (var index = 0; index < length; index++) {
+ rest[index] = arguments[index + startIndex];
+ }
+ switch (startIndex) {
+ case 0: return func.call(this, rest);
+ case 1: return func.call(this, arguments[0], rest);
+ }
+ // Currently unused but handle cases outside of the switch statement:
+ // var args = Array(startIndex + 1);
+ // for (index = 0; index < startIndex; index++) {
+ // args[index] = arguments[index];
+ // }
+ // args[startIndex] = rest;
+ // return func.apply(this, args);
+ };
+ }
+
+ function _withoutIndex(iterator) {
+ return function (value, index, callback) {
+ return iterator(value, callback);
+ };
+ }
+
+ //// exported async module functions ////
+
+ //// nextTick implementation with browser-compatible fallback ////
+
+ // capture the global reference to guard against fakeTimer mocks
+ var _setImmediate = typeof setImmediate === 'function' && setImmediate;
+
+ var _delay = _setImmediate ? function(fn) {
+ // not a direct alias for IE10 compatibility
+ _setImmediate(fn);
+ } : function(fn) {
+ setTimeout(fn, 0);
+ };
+
+ if (typeof process === 'object' && typeof process.nextTick === 'function') {
+ async.nextTick = process.nextTick;
+ } else {
+ async.nextTick = _delay;
+ }
+ async.setImmediate = _setImmediate ? _delay : async.nextTick;
+
+
+ async.forEach =
+ async.each = function (arr, iterator, callback) {
+ return async.eachOf(arr, _withoutIndex(iterator), callback);
+ };
+
+ async.forEachSeries =
+ async.eachSeries = function (arr, iterator, callback) {
+ return async.eachOfSeries(arr, _withoutIndex(iterator), callback);
+ };
+
+
+ async.forEachLimit =
+ async.eachLimit = function (arr, limit, iterator, callback) {
+ return _eachOfLimit(limit)(arr, _withoutIndex(iterator), callback);
+ };
+
+ async.forEachOf =
+ async.eachOf = function (object, iterator, callback) {
+ callback = _once(callback || noop);
+ object = object || [];
+
+ var iter = _keyIterator(object);
+ var key, completed = 0;
+
+ while ((key = iter()) != null) {
+ completed += 1;
+ iterator(object[key], key, only_once(done));
+ }
+
+ if (completed === 0) callback(null);
+
+ function done(err) {
+ completed--;
+ if (err) {
+ callback(err);
+ }
+ // Check key is null in case iterator isn't exhausted
+ // and done resolved synchronously.
+ else if (key === null && completed <= 0) {
+ callback(null);
+ }
+ }
+ };
+
+ async.forEachOfSeries =
+ async.eachOfSeries = function (obj, iterator, callback) {
+ callback = _once(callback || noop);
+ obj = obj || [];
+ var nextKey = _keyIterator(obj);
+ var key = nextKey();
+ function iterate() {
+ var sync = true;
+ if (key === null) {
+ return callback(null);
+ }
+ iterator(obj[key], key, only_once(function (err) {
+ if (err) {
+ callback(err);
+ }
+ else {
+ key = nextKey();
+ if (key === null) {
+ return callback(null);
+ } else {
+ if (sync) {
+ async.setImmediate(iterate);
+ } else {
+ iterate();
+ }
+ }
+ }
+ }));
+ sync = false;
+ }
+ iterate();
+ };
+
+
+
+ async.forEachOfLimit =
+ async.eachOfLimit = function (obj, limit, iterator, callback) {
+ _eachOfLimit(limit)(obj, iterator, callback);
+ };
+
+ function _eachOfLimit(limit) {
+
+ return function (obj, iterator, callback) {
+ callback = _once(callback || noop);
+ obj = obj || [];
+ var nextKey = _keyIterator(obj);
+ if (limit <= 0) {
+ return callback(null);
+ }
+ var done = false;
+ var running = 0;
+ var errored = false;
+
+ (function replenish () {
+ if (done && running <= 0) {
+ return callback(null);
+ }
+
+ while (running < limit && !errored) {
+ var key = nextKey();
+ if (key === null) {
+ done = true;
+ if (running <= 0) {
+ callback(null);
+ }
+ return;
+ }
+ running += 1;
+ iterator(obj[key], key, only_once(function (err) {
+ running -= 1;
+ if (err) {
+ callback(err);
+ errored = true;
+ }
+ else {
+ replenish();
+ }
+ }));
+ }
+ })();
+ };
+ }
+
+
+ function doParallel(fn) {
+ return function (obj, iterator, callback) {
+ return fn(async.eachOf, obj, iterator, callback);
+ };
+ }
+ function doParallelLimit(fn) {
+ return function (obj, limit, iterator, callback) {
+ return fn(_eachOfLimit(limit), obj, iterator, callback);
+ };
+ }
+ function doSeries(fn) {
+ return function (obj, iterator, callback) {
+ return fn(async.eachOfSeries, obj, iterator, callback);
+ };
+ }
+
+ function _asyncMap(eachfn, arr, iterator, callback) {
+ callback = _once(callback || noop);
+ arr = arr || [];
+ var results = _isArrayLike(arr) ? [] : {};
+ eachfn(arr, function (value, index, callback) {
+ iterator(value, function (err, v) {
+ results[index] = v;
+ callback(err);
+ });
+ }, function (err) {
+ callback(err, results);
+ });
+ }
+
+ async.map = doParallel(_asyncMap);
+ async.mapSeries = doSeries(_asyncMap);
+ async.mapLimit = doParallelLimit(_asyncMap);
+
+ // reduce only has a series version, as doing reduce in parallel won't
+ // work in many situations.
+ async.inject =
+ async.foldl =
+ async.reduce = function (arr, memo, iterator, callback) {
+ async.eachOfSeries(arr, function (x, i, callback) {
+ iterator(memo, x, function (err, v) {
+ memo = v;
+ callback(err);
+ });
+ }, function (err) {
+ callback(err, memo);
+ });
+ };
+
+ async.foldr =
+ async.reduceRight = function (arr, memo, iterator, callback) {
+ var reversed = _map(arr, identity).reverse();
+ async.reduce(reversed, memo, iterator, callback);
+ };
+
+ async.transform = function (arr, memo, iterator, callback) {
+ if (arguments.length === 3) {
+ callback = iterator;
+ iterator = memo;
+ memo = _isArray(arr) ? [] : {};
+ }
+
+ async.eachOf(arr, function(v, k, cb) {
+ iterator(memo, v, k, cb);
+ }, function(err) {
+ callback(err, memo);
+ });
+ };
+
+ function _filter(eachfn, arr, iterator, callback) {
+ var results = [];
+ eachfn(arr, function (x, index, callback) {
+ iterator(x, function (v) {
+ if (v) {
+ results.push({index: index, value: x});
+ }
+ callback();
+ });
+ }, function () {
+ callback(_map(results.sort(function (a, b) {
+ return a.index - b.index;
+ }), function (x) {
+ return x.value;
+ }));
+ });
+ }
+
+ async.select =
+ async.filter = doParallel(_filter);
+
+ async.selectLimit =
+ async.filterLimit = doParallelLimit(_filter);
+
+ async.selectSeries =
+ async.filterSeries = doSeries(_filter);
+
+ function _reject(eachfn, arr, iterator, callback) {
+ _filter(eachfn, arr, function(value, cb) {
+ iterator(value, function(v) {
+ cb(!v);
+ });
+ }, callback);
+ }
+ async.reject = doParallel(_reject);
+ async.rejectLimit = doParallelLimit(_reject);
+ async.rejectSeries = doSeries(_reject);
+
+ function _createTester(eachfn, check, getResult) {
+ return function(arr, limit, iterator, cb) {
+ function done() {
+ if (cb) cb(getResult(false, void 0));
+ }
+ function iteratee(x, _, callback) {
+ if (!cb) return callback();
+ iterator(x, function (v) {
+ if (cb && check(v)) {
+ cb(getResult(true, x));
+ cb = iterator = false;
+ }
+ callback();
+ });
+ }
+ if (arguments.length > 3) {
+ eachfn(arr, limit, iteratee, done);
+ } else {
+ cb = iterator;
+ iterator = limit;
+ eachfn(arr, iteratee, done);
+ }
+ };
+ }
+
+ async.any =
+ async.some = _createTester(async.eachOf, toBool, identity);
+
+ async.someLimit = _createTester(async.eachOfLimit, toBool, identity);
+
+ async.all =
+ async.every = _createTester(async.eachOf, notId, notId);
+
+ async.everyLimit = _createTester(async.eachOfLimit, notId, notId);
+
+ function _findGetResult(v, x) {
+ return x;
+ }
+ async.detect = _createTester(async.eachOf, identity, _findGetResult);
+ async.detectSeries = _createTester(async.eachOfSeries, identity, _findGetResult);
+ async.detectLimit = _createTester(async.eachOfLimit, identity, _findGetResult);
+
+ 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 {
+ callback(null, _map(results.sort(comparator), function (x) {
+ return x.value;
+ }));
+ }
+
+ });
+
+ function comparator(left, right) {
+ var a = left.criteria, b = right.criteria;
+ return a < b ? -1 : a > b ? 1 : 0;
+ }
+ };
+
+ async.auto = function (tasks, concurrency, callback) {
+ if (typeof arguments[1] === 'function') {
+ // concurrency is optional, shift the args.
+ callback = concurrency;
+ concurrency = null;
+ }
+ callback = _once(callback || noop);
+ var keys = _keys(tasks);
+ var remainingTasks = keys.length;
+ if (!remainingTasks) {
+ return callback(null);
+ }
+ if (!concurrency) {
+ concurrency = remainingTasks;
+ }
+
+ var results = {};
+ var runningTasks = 0;
+
+ var hasError = false;
+
+ var listeners = [];
+ function addListener(fn) {
+ listeners.unshift(fn);
+ }
+ function removeListener(fn) {
+ var idx = _indexOf(listeners, fn);
+ if (idx >= 0) listeners.splice(idx, 1);
+ }
+ function taskComplete() {
+ remainingTasks--;
+ _arrayEach(listeners.slice(0), function (fn) {
+ fn();
+ });
+ }
+
+ addListener(function () {
+ if (!remainingTasks) {
+ callback(null, results);
+ }
+ });
+
+ _arrayEach(keys, function (k) {
+ if (hasError) return;
+ var task = _isArray(tasks[k]) ? tasks[k]: [tasks[k]];
+ var taskCallback = _restParam(function(err, args) {
+ runningTasks--;
+ if (args.length <= 1) {
+ args = args[0];
+ }
+ if (err) {
+ var safeResults = {};
+ _forEachOf(results, function(val, rkey) {
+ safeResults[rkey] = val;
+ });
+ safeResults[k] = args;
+ hasError = true;
+
+ callback(err, safeResults);
+ }
+ else {
+ results[k] = args;
+ async.setImmediate(taskComplete);
+ }
+ });
+ var requires = task.slice(0, task.length - 1);
+ // prevent dead-locks
+ var len = requires.length;
+ var dep;
+ while (len--) {
+ if (!(dep = tasks[requires[len]])) {
+ throw new Error('Has nonexistent dependency in ' + requires.join(', '));
+ }
+ if (_isArray(dep) && _indexOf(dep, k) >= 0) {
+ throw new Error('Has cyclic dependencies');
+ }
+ }
+ function ready() {
+ return runningTasks < concurrency && _reduce(requires, function (a, x) {
+ return (a && results.hasOwnProperty(x));
+ }, true) && !results.hasOwnProperty(k);
+ }
+ if (ready()) {
+ runningTasks++;
+ task[task.length - 1](taskCallback, results);
+ }
+ else {
+ addListener(listener);
+ }
+ function listener() {
+ if (ready()) {
+ runningTasks++;
+ removeListener(listener);
+ task[task.length - 1](taskCallback, results);
+ }
+ }
+ });
+ };
+
+
+
+ async.retry = function(times, task, callback) {
+ var DEFAULT_TIMES = 5;
+ var DEFAULT_INTERVAL = 0;
+
+ var attempts = [];
+
+ var opts = {
+ times: DEFAULT_TIMES,
+ interval: DEFAULT_INTERVAL
+ };
+
+ function parseTimes(acc, t){
+ if(typeof t === 'number'){
+ acc.times = parseInt(t, 10) || DEFAULT_TIMES;
+ } else if(typeof t === 'object'){
+ acc.times = parseInt(t.times, 10) || DEFAULT_TIMES;
+ acc.interval = parseInt(t.interval, 10) || DEFAULT_INTERVAL;
+ } else {
+ throw new Error('Unsupported argument type for \'times\': ' + typeof t);
+ }
+ }
+
+ var length = arguments.length;
+ if (length < 1 || length > 3) {
+ throw new Error('Invalid arguments - must be either (task), (task, callback), (times, task) or (times, task, callback)');
+ } else if (length <= 2 && typeof times === 'function') {
+ callback = task;
+ task = times;
+ }
+ if (typeof times !== 'function') {
+ parseTimes(opts, times);
+ }
+ opts.callback = callback;
+ opts.task = task;
+
+ function wrappedTask(wrappedCallback, wrappedResults) {
+ function retryAttempt(task, finalAttempt) {
+ return function(seriesCallback) {
+ task(function(err, result){
+ seriesCallback(!err || finalAttempt, {err: err, result: result});
+ }, wrappedResults);
+ };
+ }
+
+ function retryInterval(interval){
+ return function(seriesCallback){
+ setTimeout(function(){
+ seriesCallback(null);
+ }, interval);
+ };
+ }
+
+ while (opts.times) {
+
+ var finalAttempt = !(opts.times-=1);
+ attempts.push(retryAttempt(opts.task, finalAttempt));
+ if(!finalAttempt && opts.interval > 0){
+ attempts.push(retryInterval(opts.interval));
+ }
+ }
+
+ async.series(attempts, function(done, data){
+ data = data[data.length - 1];
+ (wrappedCallback || opts.callback)(data.err, data.result);
+ });
+ }
+
+ // If a callback is passed, run this as a controll flow
+ return opts.callback ? wrappedTask() : wrappedTask;
+ };
+
+ async.waterfall = function (tasks, callback) {
+ callback = _once(callback || noop);
+ if (!_isArray(tasks)) {
+ var err = new Error('First argument to waterfall must be an array of functions');
+ return callback(err);
+ }
+ if (!tasks.length) {
+ return callback();
+ }
+ function wrapIterator(iterator) {
+ return _restParam(function (err, args) {
+ if (err) {
+ callback.apply(null, [err].concat(args));
+ }
+ else {
+ var next = iterator.next();
+ if (next) {
+ args.push(wrapIterator(next));
+ }
+ else {
+ args.push(callback);
+ }
+ ensureAsync(iterator).apply(null, args);
+ }
+ });
+ }
+ wrapIterator(async.iterator(tasks))();
+ };
+
+ function _parallel(eachfn, tasks, callback) {
+ callback = callback || noop;
+ var results = _isArrayLike(tasks) ? [] : {};
+
+ eachfn(tasks, function (task, key, callback) {
+ task(_restParam(function (err, args) {
+ if (args.length <= 1) {
+ args = args[0];
+ }
+ results[key] = args;
+ callback(err);
+ }));
+ }, function (err) {
+ callback(err, results);
+ });
+ }
+
+ async.parallel = function (tasks, callback) {
+ _parallel(async.eachOf, tasks, callback);
+ };
+
+ async.parallelLimit = function(tasks, limit, callback) {
+ _parallel(_eachOfLimit(limit), tasks, callback);
+ };
+
+ async.series = function(tasks, callback) {
+ _parallel(async.eachOfSeries, tasks, callback);
+ };
+
+ async.iterator = function (tasks) {
+ function makeCallback(index) {
+ function fn() {
+ 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 = _restParam(function (fn, args) {
+ return _restParam(function (callArgs) {
+ return fn.apply(
+ null, args.concat(callArgs)
+ );
+ });
+ });
+
+ function _concat(eachfn, arr, fn, callback) {
+ var result = [];
+ eachfn(arr, function (x, index, cb) {
+ fn(x, function (err, y) {
+ result = result.concat(y || []);
+ cb(err);
+ });
+ }, function (err) {
+ callback(err, result);
+ });
+ }
+ async.concat = doParallel(_concat);
+ async.concatSeries = doSeries(_concat);
+
+ async.whilst = function (test, iterator, callback) {
+ callback = callback || noop;
+ if (test()) {
+ var next = _restParam(function(err, args) {
+ if (err) {
+ callback(err);
+ } else if (test.apply(this, args)) {
+ iterator(next);
+ } else {
+ callback.apply(null, [null].concat(args));
+ }
+ });
+ iterator(next);
+ } else {
+ callback(null);
+ }
+ };
+
+ async.doWhilst = function (iterator, test, callback) {
+ var calls = 0;
+ return async.whilst(function() {
+ return ++calls <= 1 || test.apply(this, arguments);
+ }, iterator, callback);
+ };
+
+ async.until = function (test, iterator, callback) {
+ return async.whilst(function() {
+ return !test.apply(this, arguments);
+ }, iterator, callback);
+ };
+
+ async.doUntil = function (iterator, test, callback) {
+ return async.doWhilst(iterator, function() {
+ return !test.apply(this, arguments);
+ }, callback);
+ };
+
+ async.during = function (test, iterator, callback) {
+ callback = callback || noop;
+
+ var next = _restParam(function(err, args) {
+ if (err) {
+ callback(err);
+ } else {
+ args.push(check);
+ test.apply(this, args);
+ }
+ });
+
+ var check = function(err, truth) {
+ if (err) {
+ callback(err);
+ } else if (truth) {
+ iterator(next);
+ } else {
+ callback(null);
+ }
+ };
+
+ test(check);
+ };
+
+ async.doDuring = function (iterator, test, callback) {
+ var calls = 0;
+ async.during(function(next) {
+ if (calls++ < 1) {
+ next(null, true);
+ } else {
+ test.apply(this, arguments);
+ }
+ }, iterator, callback);
+ };
+
+ function _queue(worker, concurrency, payload) {
+ if (concurrency == null) {
+ concurrency = 1;
+ }
+ else if(concurrency === 0) {
+ throw new Error('Concurrency must not be zero');
+ }
+ function _insert(q, data, pos, callback) {
+ if (callback != null && typeof callback !== "function") {
+ throw new Error("task callback must be a function");
+ }
+ q.started = true;
+ if (!_isArray(data)) {
+ data = [data];
+ }
+ if(data.length === 0 && q.idle()) {
+ // call drain immediately if there are no tasks
+ return async.setImmediate(function() {
+ q.drain();
+ });
+ }
+ _arrayEach(data, function(task) {
+ var item = {
+ data: task,
+ callback: callback || noop
+ };
+
+ if (pos) {
+ q.tasks.unshift(item);
+ } else {
+ q.tasks.push(item);
+ }
+
+ if (q.tasks.length === q.concurrency) {
+ q.saturated();
+ }
+ });
+ async.setImmediate(q.process);
+ }
+ function _next(q, tasks) {
+ return function(){
+ workers -= 1;
+
+ var removed = false;
+ var args = arguments;
+ _arrayEach(tasks, function (task) {
+ _arrayEach(workersList, function (worker, index) {
+ if (worker === task && !removed) {
+ workersList.splice(index, 1);
+ removed = true;
+ }
+ });
+
+ task.callback.apply(task, args);
+ });
+ if (q.tasks.length + workers === 0) {
+ q.drain();
+ }
+ q.process();
+ };
+ }
+
+ var workers = 0;
+ var workersList = [];
+ var q = {
+ tasks: [],
+ concurrency: concurrency,
+ payload: payload,
+ saturated: noop,
+ empty: noop,
+ drain: noop,
+ started: false,
+ paused: false,
+ push: function (data, callback) {
+ _insert(q, data, false, callback);
+ },
+ kill: function () {
+ q.drain = noop;
+ q.tasks = [];
+ },
+ unshift: function (data, callback) {
+ _insert(q, data, true, callback);
+ },
+ process: function () {
+ while(!q.paused && workers < q.concurrency && q.tasks.length){
+
+ var tasks = q.payload ?
+ q.tasks.splice(0, q.payload) :
+ q.tasks.splice(0, q.tasks.length);
+
+ var data = _map(tasks, function (task) {
+ return task.data;
+ });
+
+ if (q.tasks.length === 0) {
+ q.empty();
+ }
+ workers += 1;
+ workersList.push(tasks[0]);
+ var cb = only_once(_next(q, tasks));
+ worker(data, cb);
+ }
+ },
+ length: function () {
+ return q.tasks.length;
+ },
+ running: function () {
+ return workers;
+ },
+ workersList: function () {
+ return workersList;
+ },
+ idle: function() {
+ return q.tasks.length + workers === 0;
+ },
+ pause: function () {
+ q.paused = true;
+ },
+ resume: function () {
+ if (q.paused === false) { return; }
+ q.paused = false;
+ var resumeCount = Math.min(q.concurrency, q.tasks.length);
+ // Need to call q.process once per concurrent
+ // worker to preserve full concurrency after pause
+ for (var w = 1; w <= resumeCount; w++) {
+ async.setImmediate(q.process);
+ }
+ }
+ };
+ return q;
+ }
+
+ async.queue = function (worker, concurrency) {
+ var q = _queue(function (items, cb) {
+ worker(items[0], cb);
+ }, concurrency, 1);
+
+ return q;
+ };
+
+ async.priorityQueue = function (worker, concurrency) {
+
+ function _compareTasks(a, b){
+ return a.priority - b.priority;
+ }
+
+ function _binarySearch(sequence, item, compare) {
+ var beg = -1,
+ end = sequence.length - 1;
+ while (beg < end) {
+ var mid = beg + ((end - beg + 1) >>> 1);
+ if (compare(item, sequence[mid]) >= 0) {
+ beg = mid;
+ } else {
+ end = mid - 1;
+ }
+ }
+ return beg;
+ }
+
+ function _insert(q, data, priority, callback) {
+ if (callback != null && typeof callback !== "function") {
+ throw new Error("task callback must be a function");
+ }
+ q.started = true;
+ if (!_isArray(data)) {
+ data = [data];
+ }
+ if(data.length === 0) {
+ // call drain immediately if there are no tasks
+ return async.setImmediate(function() {
+ q.drain();
+ });
+ }
+ _arrayEach(data, function(task) {
+ var item = {
+ data: task,
+ priority: priority,
+ callback: typeof callback === 'function' ? callback : noop
+ };
+
+ q.tasks.splice(_binarySearch(q.tasks, item, _compareTasks) + 1, 0, item);
+
+ if (q.tasks.length === q.concurrency) {
+ q.saturated();
+ }
+ async.setImmediate(q.process);
+ });
+ }
+
+ // Start with a normal queue
+ var q = async.queue(worker, concurrency);
+
+ // Override push to accept second parameter representing priority
+ q.push = function (data, priority, callback) {
+ _insert(q, data, priority, callback);
+ };
+
+ // Remove unshift function
+ delete q.unshift;
+
+ return q;
+ };
+
+ async.cargo = function (worker, payload) {
+ return _queue(worker, 1, payload);
+ };
+
+ function _console_fn(name) {
+ return _restParam(function (fn, args) {
+ fn.apply(null, args.concat([_restParam(function (err, args) {
+ if (typeof console === 'object') {
+ if (err) {
+ if (console.error) {
+ console.error(err);
+ }
+ }
+ else if (console[name]) {
+ _arrayEach(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 = {};
+ var has = Object.prototype.hasOwnProperty;
+ hasher = hasher || identity;
+ var memoized = _restParam(function memoized(args) {
+ var callback = args.pop();
+ var key = hasher.apply(null, args);
+ if (has.call(memo, key)) {
+ async.setImmediate(function () {
+ callback.apply(null, memo[key]);
+ });
+ }
+ else if (has.call(queues, key)) {
+ queues[key].push(callback);
+ }
+ else {
+ queues[key] = [callback];
+ fn.apply(null, args.concat([_restParam(function (args) {
+ memo[key] = args;
+ var q = queues[key];
+ delete queues[key];
+ for (var i = 0, l = q.length; i < l; i++) {
+ q[i].apply(null, args);
+ }
+ })]));
+ }
+ });
+ memoized.memo = memo;
+ memoized.unmemoized = fn;
+ return memoized;
+ };
+
+ async.unmemoize = function (fn) {
+ return function () {
+ return (fn.unmemoized || fn).apply(null, arguments);
+ };
+ };
+
+ function _times(mapper) {
+ return function (count, iterator, callback) {
+ mapper(_range(count), iterator, callback);
+ };
+ }
+
+ async.times = _times(async.map);
+ async.timesSeries = _times(async.mapSeries);
+ async.timesLimit = function (count, limit, iterator, callback) {
+ return async.mapLimit(_range(count), limit, iterator, callback);
+ };
+
+ async.seq = function (/* functions... */) {
+ var fns = arguments;
+ return _restParam(function (args) {
+ var that = this;
+
+ var callback = args[args.length - 1];
+ if (typeof callback == 'function') {
+ args.pop();
+ } else {
+ callback = noop;
+ }
+
+ async.reduce(fns, args, function (newargs, fn, cb) {
+ fn.apply(that, newargs.concat([_restParam(function (err, nextargs) {
+ cb(err, nextargs);
+ })]));
+ },
+ function (err, results) {
+ callback.apply(that, [err].concat(results));
+ });
+ });
+ };
+
+ async.compose = function (/* functions... */) {
+ return async.seq.apply(null, Array.prototype.reverse.call(arguments));
+ };
+
+
+ function _applyEach(eachfn) {
+ return _restParam(function(fns, args) {
+ var go = _restParam(function(args) {
+ var that = this;
+ var callback = args.pop();
+ return eachfn(fns, function (fn, _, cb) {
+ fn.apply(that, args.concat([cb]));
+ },
+ callback);
+ });
+ if (args.length) {
+ return go.apply(this, args);
+ }
+ else {
+ return go;
+ }
+ });
+ }
+
+ async.applyEach = _applyEach(async.eachOf);
+ async.applyEachSeries = _applyEach(async.eachOfSeries);
+
+
+ async.forever = function (fn, callback) {
+ var done = only_once(callback || noop);
+ var task = ensureAsync(fn);
+ function next(err) {
+ if (err) {
+ return done(err);
+ }
+ task(next);
+ }
+ next();
+ };
+
+ function ensureAsync(fn) {
+ return _restParam(function (args) {
+ var callback = args.pop();
+ args.push(function () {
+ var innerArgs = arguments;
+ if (sync) {
+ async.setImmediate(function () {
+ callback.apply(null, innerArgs);
+ });
+ } else {
+ callback.apply(null, innerArgs);
+ }
+ });
+ var sync = true;
+ fn.apply(this, args);
+ sync = false;
+ });
+ }
+
+ async.ensureAsync = ensureAsync;
+
+ async.constant = _restParam(function(values) {
+ var args = [null].concat(values);
+ return function (callback) {
+ return callback.apply(this, args);
+ };
+ });
+
+ async.wrapSync =
+ async.asyncify = function asyncify(func) {
+ return _restParam(function (args) {
+ var callback = args.pop();
+ var result;
+ try {
+ result = func.apply(this, args);
+ } catch (e) {
+ return callback(e);
+ }
+ // if result is Promise object
+ if (_isObject(result) && typeof result.then === "function") {
+ result.then(function(value) {
+ callback(null, value);
+ })["catch"](function(err) {
+ callback(err.message ? err : new Error(err));
+ });
+ } else {
+ callback(null, result);
+ }
+ });
+ };
+
+ // Node.js
+ if (typeof module === 'object' && module.exports) {
+ module.exports = async;
+ }
+ // AMD / RequireJS
+ else if (typeof define === 'function' && define.amd) {
+ define([], function () {
+ return async;
+ });
+ }
+ // included directly via
-
-
-
-
-
diff --git a/tools/eslint/node_modules/doctrine/coverage/lcov-report/prettify.css b/tools/eslint/node_modules/doctrine/coverage/lcov-report/prettify.css
deleted file mode 100644
index b317a7cda31a44..00000000000000
--- a/tools/eslint/node_modules/doctrine/coverage/lcov-report/prettify.css
+++ /dev/null
@@ -1 +0,0 @@
-.pln{color:#000}@media screen{.str{color:#080}.kwd{color:#008}.com{color:#800}.typ{color:#606}.lit{color:#066}.pun,.opn,.clo{color:#660}.tag{color:#008}.atn{color:#606}.atv{color:#080}.dec,.var{color:#606}.fun{color:red}}@media print,projection{.str{color:#060}.kwd{color:#006;font-weight:bold}.com{color:#600;font-style:italic}.typ{color:#404;font-weight:bold}.lit{color:#044}.pun,.opn,.clo{color:#440}.tag{color:#006;font-weight:bold}.atn{color:#404}.atv{color:#060}}pre.prettyprint{padding:2px;border:1px solid #888}ol.linenums{margin-top:0;margin-bottom:0}li.L0,li.L1,li.L2,li.L3,li.L5,li.L6,li.L7,li.L8{list-style-type:none}li.L1,li.L3,li.L5,li.L7,li.L9{background:#eee}
diff --git a/tools/eslint/node_modules/doctrine/coverage/lcov-report/prettify.js b/tools/eslint/node_modules/doctrine/coverage/lcov-report/prettify.js
deleted file mode 100644
index ef51e03866898f..00000000000000
--- a/tools/eslint/node_modules/doctrine/coverage/lcov-report/prettify.js
+++ /dev/null
@@ -1 +0,0 @@
-window.PR_SHOULD_USE_CONTINUATION=true;(function(){var h=["break,continue,do,else,for,if,return,while"];var u=[h,"auto,case,char,const,default,double,enum,extern,float,goto,int,long,register,short,signed,sizeof,static,struct,switch,typedef,union,unsigned,void,volatile"];var p=[u,"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"];var l=[p,"alignof,align_union,asm,axiom,bool,concept,concept_map,const_cast,constexpr,decltype,dynamic_cast,explicit,export,friend,inline,late_check,mutable,namespace,nullptr,reinterpret_cast,static_assert,static_cast,template,typeid,typename,using,virtual,where"];var x=[p,"abstract,boolean,byte,extends,final,finally,implements,import,instanceof,null,native,package,strictfp,super,synchronized,throws,transient"];var R=[x,"as,base,by,checked,decimal,delegate,descending,dynamic,event,fixed,foreach,from,group,implicit,in,interface,internal,into,is,lock,object,out,override,orderby,params,partial,readonly,ref,sbyte,sealed,stackalloc,string,select,uint,ulong,unchecked,unsafe,ushort,var"];var r="all,and,by,catch,class,else,extends,false,finally,for,if,in,is,isnt,loop,new,no,not,null,of,off,on,or,return,super,then,true,try,unless,until,when,while,yes";var w=[p,"debugger,eval,export,function,get,null,set,undefined,var,with,Infinity,NaN"];var s="caller,delete,die,do,dump,elsif,eval,exit,foreach,for,goto,if,import,last,local,my,next,no,our,print,package,redo,require,sub,undef,unless,until,use,wantarray,while,BEGIN,END";var I=[h,"and,as,assert,class,def,del,elif,except,exec,finally,from,global,import,in,is,lambda,nonlocal,not,or,pass,print,raise,try,with,yield,False,True,None"];var f=[h,"alias,and,begin,case,class,def,defined,elsif,end,ensure,false,in,module,next,nil,not,or,redo,rescue,retry,self,super,then,true,undef,unless,until,when,yield,BEGIN,END"];var H=[h,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"];var A=[l,R,w,s+I,f,H];var e=/^(DIR|FILE|vector|(de|priority_)?queue|list|stack|(const_)?iterator|(multi)?(set|map)|bitset|u?(int|float)\d*)/;var C="str";var z="kwd";var j="com";var O="typ";var G="lit";var L="pun";var F="pln";var m="tag";var E="dec";var J="src";var P="atn";var n="atv";var N="nocode";var M="(?:^^\\.?|[+-]|\\!|\\!=|\\!==|\\#|\\%|\\%=|&|&&|&&=|&=|\\(|\\*|\\*=|\\+=|\\,|\\-=|\\->|\\/|\\/=|:|::|\\;|<|<<|<<=|<=|=|==|===|>|>=|>>|>>=|>>>|>>>=|\\?|\\@|\\[|\\^|\\^=|\\^\\^|\\^\\^=|\\{|\\||\\|=|\\|\\||\\|\\|=|\\~|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\s*";function k(Z){var ad=0;var S=false;var ac=false;for(var V=0,U=Z.length;V122)){if(!(al<65||ag>90)){af.push([Math.max(65,ag)|32,Math.min(al,90)|32])}if(!(al<97||ag>122)){af.push([Math.max(97,ag)&~32,Math.min(al,122)&~32])}}}}af.sort(function(av,au){return(av[0]-au[0])||(au[1]-av[1])});var ai=[];var ap=[NaN,NaN];for(var ar=0;arat[0]){if(at[1]+1>at[0]){an.push("-")}an.push(T(at[1]))}}an.push("]");return an.join("")}function W(al){var aj=al.source.match(new RegExp("(?:\\[(?:[^\\x5C\\x5D]|\\\\[\\s\\S])*\\]|\\\\u[A-Fa-f0-9]{4}|\\\\x[A-Fa-f0-9]{2}|\\\\[0-9]+|\\\\[^ux0-9]|\\(\\?[:!=]|[\\(\\)\\^]|[^\\x5B\\x5C\\(\\)\\^]+)","g"));var ah=aj.length;var an=[];for(var ak=0,am=0;ak=2&&ai==="["){aj[ak]=X(ag)}else{if(ai!=="\\"){aj[ak]=ag.replace(/[a-zA-Z]/g,function(ao){var ap=ao.charCodeAt(0);return"["+String.fromCharCode(ap&~32,ap|32)+"]"})}}}}return aj.join("")}var aa=[];for(var V=0,U=Z.length;V=0;){S[ac.charAt(ae)]=Y}}var af=Y[1];var aa=""+af;if(!ag.hasOwnProperty(aa)){ah.push(af);ag[aa]=null}}ah.push(/[\0-\uffff]/);V=k(ah)})();var X=T.length;var W=function(ah){var Z=ah.sourceCode,Y=ah.basePos;var ad=[Y,F];var af=0;var an=Z.match(V)||[];var aj={};for(var ae=0,aq=an.length;ae=5&&"lang-"===ap.substring(0,5);if(am&&!(ai&&typeof ai[1]==="string")){am=false;ap=J}if(!am){aj[ag]=ap}}var ab=af;af+=ag.length;if(!am){ad.push(Y+ab,ap)}else{var al=ai[1];var ak=ag.indexOf(al);var ac=ak+al.length;if(ai[2]){ac=ag.length-ai[2].length;ak=ac-al.length}var ar=ap.substring(5);B(Y+ab,ag.substring(0,ak),W,ad);B(Y+ab+ak,al,q(ar,al),ad);B(Y+ab+ac,ag.substring(ac),W,ad)}}ah.decorations=ad};return W}function i(T){var W=[],S=[];if(T.tripleQuotedStrings){W.push([C,/^(?:\'\'\'(?:[^\'\\]|\\[\s\S]|\'{1,2}(?=[^\']))*(?:\'\'\'|$)|\"\"\"(?:[^\"\\]|\\[\s\S]|\"{1,2}(?=[^\"]))*(?:\"\"\"|$)|\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$))/,null,"'\""])}else{if(T.multiLineStrings){W.push([C,/^(?:\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$)|\`(?:[^\\\`]|\\[\s\S])*(?:\`|$))/,null,"'\"`"])}else{W.push([C,/^(?:\'(?:[^\\\'\r\n]|\\.)*(?:\'|$)|\"(?:[^\\\"\r\n]|\\.)*(?:\"|$))/,null,"\"'"])}}if(T.verbatimStrings){S.push([C,/^@\"(?:[^\"]|\"\")*(?:\"|$)/,null])}var Y=T.hashComments;if(Y){if(T.cStyleComments){if(Y>1){W.push([j,/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,null,"#"])}else{W.push([j,/^#(?:(?:define|elif|else|endif|error|ifdef|include|ifndef|line|pragma|undef|warning)\b|[^\r\n]*)/,null,"#"])}S.push([C,/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h|[a-z]\w*)>/,null])}else{W.push([j,/^#[^\r\n]*/,null,"#"])}}if(T.cStyleComments){S.push([j,/^\/\/[^\r\n]*/,null]);S.push([j,/^\/\*[\s\S]*?(?:\*\/|$)/,null])}if(T.regexLiterals){var X=("/(?=[^/*])(?:[^/\\x5B\\x5C]|\\x5C[\\s\\S]|\\x5B(?:[^\\x5C\\x5D]|\\x5C[\\s\\S])*(?:\\x5D|$))+/");S.push(["lang-regex",new RegExp("^"+M+"("+X+")")])}var V=T.types;if(V){S.push([O,V])}var U=(""+T.keywords).replace(/^ | $/g,"");if(U.length){S.push([z,new RegExp("^(?:"+U.replace(/[\s,]+/g,"|")+")\\b"),null])}W.push([F,/^\s+/,null," \r\n\t\xA0"]);S.push([G,/^@[a-z_$][a-z_$@0-9]*/i,null],[O,/^(?:[@_]?[A-Z]+[a-z][A-Za-z_$@0-9]*|\w+_t\b)/,null],[F,/^[a-z_$][a-z_$@0-9]*/i,null],[G,new RegExp("^(?:0x[a-f0-9]+|(?:\\d(?:_\\d+)*\\d*(?:\\.\\d*)?|\\.\\d\\+)(?:e[+\\-]?\\d+)?)[a-z]*","i"),null,"0123456789"],[F,/^\\[\s\S]?/,null],[L,/^.[^\s\w\.$@\'\"\`\/\#\\]*/,null]);return g(W,S)}var K=i({keywords:A,hashComments:true,cStyleComments:true,multiLineStrings:true,regexLiterals:true});function Q(V,ag){var U=/(?:^|\s)nocode(?:\s|$)/;var ab=/\r\n?|\n/;var ac=V.ownerDocument;var S;if(V.currentStyle){S=V.currentStyle.whiteSpace}else{if(window.getComputedStyle){S=ac.defaultView.getComputedStyle(V,null).getPropertyValue("white-space")}}var Z=S&&"pre"===S.substring(0,3);var af=ac.createElement("LI");while(V.firstChild){af.appendChild(V.firstChild)}var W=[af];function ae(al){switch(al.nodeType){case 1:if(U.test(al.className)){break}if("BR"===al.nodeName){ad(al);if(al.parentNode){al.parentNode.removeChild(al)}}else{for(var an=al.firstChild;an;an=an.nextSibling){ae(an)}}break;case 3:case 4:if(Z){var am=al.nodeValue;var aj=am.match(ab);if(aj){var ai=am.substring(0,aj.index);al.nodeValue=ai;var ah=am.substring(aj.index+aj[0].length);if(ah){var ak=al.parentNode;ak.insertBefore(ac.createTextNode(ah),al.nextSibling)}ad(al);if(!ai){al.parentNode.removeChild(al)}}}break}}function ad(ak){while(!ak.nextSibling){ak=ak.parentNode;if(!ak){return}}function ai(al,ar){var aq=ar?al.cloneNode(false):al;var ao=al.parentNode;if(ao){var ap=ai(ao,1);var an=al.nextSibling;ap.appendChild(aq);for(var am=an;am;am=an){an=am.nextSibling;ap.appendChild(am)}}return aq}var ah=ai(ak.nextSibling,0);for(var aj;(aj=ah.parentNode)&&aj.nodeType===1;){ah=aj}W.push(ah)}for(var Y=0;Y=S){ah+=2}if(V>=ap){Z+=2}}}var t={};function c(U,V){for(var S=V.length;--S>=0;){var T=V[S];if(!t.hasOwnProperty(T)){t[T]=U}else{if(window.console){console.warn("cannot override language handler %s",T)}}}}function q(T,S){if(!(T&&t.hasOwnProperty(T))){T=/^\s*]*(?:>|$)/],[j,/^<\!--[\s\S]*?(?:-\->|$)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],[L,/^(?:<[%?]|[%?]>)/],["lang-",/^]*>([\s\S]+?)<\/xmp\b[^>]*>/i],["lang-js",/^
-
-
-
-
-
-
-
-
-
- Parse Tree
-
- Stringified
-
-
-