From ae4e6cac19f60838468daf609ea09d30f5511e68 Mon Sep 17 00:00:00 2001 From: Alyssa Nicoll Date: Mon, 2 Feb 2015 17:32:10 -0500 Subject: [PATCH 1/3] Adding in firebase --- .DS_Store | Bin 0 -> 6148 bytes app/js/app.js | 2 +- app/js/controllers/notes-index-controller.js | 7 ++++-- app/js/resources/note.js | 24 ++++++++++++++----- app/js/services/note.js | 1 + app/server/views/index.html | 4 ++++ 6 files changed, 29 insertions(+), 9 deletions(-) create mode 100644 .DS_Store diff --git a/.DS_Store b/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..5008ddfcf53c02e82d7eee2e57c38e5672ef89f6 GIT binary patch literal 6148 zcmeH~Jr2S!425mzP>H1@V-^m;4Wg<&0T*E43hX&L&p$$qDprKhvt+--jT7}7np#A3 zem<@ulZcFPQ@L2!n>{z**++&mCkOWA81W14cNZlEfg7;MkzE(HCqgga^y>{tEnwC%0;vJ&^%eQ zLs35+`xjp>T0 + + + + From 3a4b10d389ee2d131b80ed9a141d5f9b9b31131e Mon Sep 17 00:00:00 2001 From: Alyssa Nicoll Date: Tue, 10 Mar 2015 16:12:19 -0400 Subject: [PATCH 2/3] Start of app for the codeTV --- .DS_Store | Bin 6148 -> 6148 bytes app/js/app.js | 2 +- app/js/controllers/notes-index-controller.js | 7 +- app/js/controllers/users-index-controller.js | 14 +- app/js/resources/note.js | 23 +- app/js/resources/user.js | 22 +- app/server/views/index.html | 10 +- .../directives/nw-category-item.html | 2 +- node_modules/bcrypt/build/Makefile | 4 +- .../bcrypt/build/Release/bcrypt_lib.node | Bin 37144 -> 37120 bytes .../obj.target/bcrypt_lib/src/bcrypt.o | Bin 10964 -> 10964 bytes .../obj.target/bcrypt_lib/src/bcrypt_node.o | Bin 128380 -> 128428 bytes .../obj.target/bcrypt_lib/src/blowfish.o | Bin 28408 -> 28400 bytes node_modules/bcrypt/package.json | 2 +- node_modules/body-parser/HISTORY.md | 73 +- node_modules/body-parser/LICENSE | 2 +- node_modules/body-parser/README.md | 260 +- node_modules/body-parser/index.js | 10 + node_modules/body-parser/lib/read.js | 35 +- node_modules/body-parser/lib/types/json.js | 76 +- node_modules/body-parser/lib/types/raw.js | 40 +- node_modules/body-parser/lib/types/text.js | 59 +- .../body-parser/lib/types/urlencoded.js | 102 +- .../node_modules/content-type/HISTORY.md | 9 + .../node_modules/content-type/LICENSE | 22 + .../node_modules/content-type/README.md | 92 + .../node_modules/content-type/index.js | 214 + .../node_modules/content-type/package.json | 64 + .../body-parser/node_modules/debug/.jshintrc | 3 + .../body-parser/node_modules/debug/.npmignore | 6 + .../body-parser/node_modules/debug/History.md | 177 + .../body-parser/node_modules/debug/Makefile | 33 + .../body-parser/node_modules/debug/Readme.md | 178 + .../body-parser/node_modules/debug/bower.json | 28 + .../body-parser/node_modules/debug/browser.js | 175 + .../node_modules/debug/component.json | 19 + .../body-parser/node_modules/debug/debug.js | 197 + .../body-parser/node_modules/debug/node.js | 209 + .../debug/node_modules/ms/.npmignore | 5 + .../debug/node_modules/ms/LICENSE | 20 + .../debug/node_modules/ms/README.md | 35 + .../debug/node_modules/ms/index.js | 123 + .../debug/node_modules/ms/package.json | 47 + .../node_modules/debug/package.json | 72 + .../node_modules/depd/package.json | 19 +- .../node_modules/iconv-lite/.npmignore | 1 + .../node_modules/iconv-lite/.travis.yml | 6 +- .../node_modules/iconv-lite/Changelog.md | 23 + .../node_modules/iconv-lite/README.md | 13 +- .../node_modules/iconv-lite/README.md~ | 54 - .../iconv-lite/encodings/dbcs-codec.js | 9 +- .../iconv-lite/encodings/dbcs-data.js | 6 +- .../iconv-lite/encodings/index.js | 3 +- .../iconv-lite/encodings/sbcs-data.js | 12 +- .../node_modules/iconv-lite/package.json | 30 +- .../node_modules/on-finished/HISTORY.md | 10 + .../node_modules/on-finished/README.md | 37 +- .../node_modules/on-finished/index.js | 86 +- .../on-finished/node_modules/ee-first/LICENSE | 44 +- .../node_modules/ee-first/README.md | 143 +- .../node_modules/ee-first/index.js | 128 +- .../node_modules/ee-first/package.json | 18 +- .../node_modules/on-finished/package.json | 28 +- .../body-parser/node_modules/qs/CHANGELOG.md | 21 + .../body-parser/node_modules/qs/Makefile | 8 +- .../body-parser/node_modules/qs/README.md | 11 +- .../body-parser/node_modules/qs/index.js | 2 +- .../body-parser/node_modules/qs/lib/parse.js | 1 + .../node_modules/qs/lib/stringify.js | 37 +- .../body-parser/node_modules/qs/lib/utils.js | 61 +- .../body-parser/node_modules/qs/package.json | 40 +- .../body-parser/node_modules/qs/test/parse.js | 62 +- .../node_modules/qs/test/stringify.js | 48 +- .../node_modules/raw-body/HISTORY.md | 18 + .../body-parser/node_modules/raw-body/LICENSE | 21 + .../node_modules/raw-body/README.md | 44 +- .../node_modules/raw-body/package.json | 41 +- .../node_modules/type-is/HISTORY.md | 43 + .../node_modules/type-is/README.md | 21 +- .../body-parser/node_modules/type-is/index.js | 80 +- .../node_modules}/media-typer/HISTORY.md | 0 .../node_modules}/media-typer/LICENSE | 0 .../node_modules}/media-typer/README.md | 0 .../node_modules}/media-typer/index.js | 0 .../node_modules}/media-typer/package.json | 0 .../node_modules/mime-types/HISTORY.md | 46 + .../node_modules/mime-db/HISTORY.md | 166 + .../mime-types/node_modules/mime-db/README.md | 42 +- .../mime-types/node_modules/mime-db/db.json | 332 +- .../node_modules/mime-db/package.json | 72 +- .../node_modules/mime-types/package.json | 28 +- .../node_modules/type-is/package.json | 24 +- node_modules/body-parser/package.json | 41 +- .../bower/node_modules/archy/package.json | 7 +- .../node_modules/graceful-fs/package.json | 2 +- .../node_modules/mout/.editorconfig | 20 + .../bower-config/node_modules/mout/.jshintrc | 69 + .../bower-config/node_modules/mout/.npmignore | 30 + .../node_modules/mout/.travis.yml | 15 + .../node_modules/mout/CHANGELOG.md | 156 + .../node_modules/mout/CONTRIBUTING.md | 61 + .../bower-config/node_modules/mout/LICENSE.md | 21 + .../bower-config/node_modules/mout/README.md | 63 + .../bower-config/node_modules/mout/array.js | 50 + .../node_modules/mout/array/append.js | 21 + .../node_modules/mout/array/collect.js | 27 + .../node_modules/mout/array/combine.js | 22 + .../node_modules/mout/array/compact.js | 13 + .../node_modules/mout/array/contains.js | 10 + .../node_modules/mout/array/difference.js | 23 + .../node_modules/mout/array/every.js | 27 + .../node_modules/mout/array/filter.js | 26 + .../node_modules/mout/array/find.js | 13 + .../node_modules/mout/array/findIndex.js | 23 + .../node_modules/mout/array/findLast.js | 13 + .../node_modules/mout/array/findLastIndex.js | 24 + .../node_modules/mout/array/flatten.js | 43 + .../node_modules/mout/array/forEach.js | 23 + .../node_modules/mout/array/indexOf.js | 28 + .../node_modules/mout/array/insert.js | 15 + .../node_modules/mout/array/intersection.js | 24 + .../node_modules/mout/array/invoke.js | 23 + .../node_modules/mout/array/join.js | 17 + .../node_modules/mout/array/lastIndexOf.js | 28 + .../node_modules/mout/array/map.js | 22 + .../node_modules/mout/array/max.js | 34 + .../node_modules/mout/array/min.js | 34 + .../node_modules/mout/array/pick.js | 31 + .../node_modules/mout/array/pluck.js | 12 + .../node_modules/mout/array/range.js | 27 + .../node_modules/mout/array/reduce.js | 33 + .../node_modules/mout/array/reduceRight.js | 34 + .../node_modules/mout/array/reject.js | 25 + .../node_modules/mout/array/remove.js | 13 + .../node_modules/mout/array/removeAll.js | 15 + .../node_modules/mout/array/shuffle.js | 28 + .../node_modules/mout/array/slice.js | 35 + .../node_modules/mout/array/some.js | 27 + .../node_modules/mout/array/sort.js | 55 + .../node_modules/mout/array/sortBy.js | 19 + .../node_modules/mout/array/split.js | 35 + .../node_modules/mout/array/toLookup.js | 28 + .../node_modules/mout/array/union.js | 19 + .../node_modules/mout/array/unique.js | 25 + .../node_modules/mout/array/xor.js | 26 + .../node_modules/mout/array/zip.js | 28 + .../node_modules/mout/collection.js | 22 + .../node_modules/mout/collection/contains.js | 9 + .../node_modules/mout/collection/every.js | 9 + .../node_modules/mout/collection/filter.js | 23 + .../node_modules/mout/collection/find.js | 10 + .../node_modules/mout/collection/forEach.js | 9 + .../node_modules/mout/collection/make_.js | 19 + .../node_modules/mout/collection/map.js | 23 + .../node_modules/mout/collection/max.js | 10 + .../node_modules/mout/collection/min.js | 10 + .../node_modules/mout/collection/pluck.js | 14 + .../node_modules/mout/collection/reduce.js | 9 + .../node_modules/mout/collection/reject.js | 16 + .../node_modules/mout/collection/size.js | 19 + .../node_modules/mout/collection/some.js | 9 + .../bower-config/node_modules/mout/date.js | 22 + .../node_modules/mout/date/dayOfTheYear.js | 13 + .../node_modules/mout/date/diff.js | 130 + .../node_modules/mout/date/i18n/de-DE.js | 61 + .../node_modules/mout/date/i18n/en-US.js | 61 + .../node_modules/mout/date/i18n/pt-BR.js | 61 + .../node_modules/mout/date/i18n_.js | 14 + .../node_modules/mout/date/isLeapYear.js | 15 + .../node_modules/mout/date/isSame.js | 16 + .../node_modules/mout/date/parseIso.js | 146 + .../node_modules/mout/date/quarter.js | 16 + .../node_modules/mout/date/startOf.js | 54 + .../node_modules/mout/date/strftime.js | 121 + .../node_modules/mout/date/timezoneAbbr.js | 17 + .../node_modules/mout/date/timezoneOffset.js | 16 + .../mout/date/totalDaysInMonth.js | 25 + .../node_modules/mout/date/totalDaysInYear.js | 13 + .../node_modules/mout/date/weekOfTheYear.js | 16 + .../node_modules/mout/doc/array.md | 903 + .../node_modules/mout/doc/collection.md | 233 + .../node_modules/mout/doc/date.md | 307 + .../node_modules/mout/doc/function.md | 279 + .../node_modules/mout/doc/lang.md | 469 + .../node_modules/mout/doc/math.md | 298 + .../node_modules/mout/doc/number.md | 274 + .../node_modules/mout/doc/object.md | 780 + .../node_modules/mout/doc/queryString.md | 115 + .../node_modules/mout/doc/random.md | 232 + .../node_modules/mout/doc/string.md | 626 + .../node_modules/mout/doc/time.md | 64 + .../node_modules/mout/function.js | 22 + .../node_modules/mout/function/awaitDelay.js | 22 + .../node_modules/mout/function/bind.js | 19 + .../node_modules/mout/function/compose.js | 23 + .../node_modules/mout/function/constant.js | 14 + .../node_modules/mout/function/debounce.js | 32 + .../node_modules/mout/function/func.js | 14 + .../node_modules/mout/function/identity.js | 12 + .../mout/function/makeIterator_.js | 34 + .../node_modules/mout/function/partial.js | 15 + .../node_modules/mout/function/prop.js | 14 + .../node_modules/mout/function/series.js | 22 + .../node_modules/mout/function/throttle.js | 33 + .../node_modules/mout/function/timeout.js | 17 + .../node_modules/mout/function/times.js | 17 + .../bower-config/node_modules/mout/index.js | 25 + .../bower-config/node_modules/mout/lang.js | 37 + .../node_modules/mout/lang/clone.js | 49 + .../node_modules/mout/lang/createObject.js | 18 + .../node_modules/mout/lang/ctorApply.js | 17 + .../node_modules/mout/lang/deepClone.js | 48 + .../node_modules/mout/lang/defaults.js | 17 + .../mout/lang/inheritPrototype.js | 18 + .../bower-config/node_modules/mout/lang/is.js | 23 + .../node_modules/mout/lang/isArguments.js | 15 + .../node_modules/mout/lang/isArray.js | 8 + .../node_modules/mout/lang/isBoolean.js | 8 + .../node_modules/mout/lang/isDate.js | 8 + .../node_modules/mout/lang/isEmpty.js | 24 + .../node_modules/mout/lang/isFinite.js | 21 + .../node_modules/mout/lang/isFunction.js | 8 + .../node_modules/mout/lang/isInteger.js | 12 + .../node_modules/mout/lang/isKind.js | 9 + .../node_modules/mout/lang/isNaN.js | 16 + .../node_modules/mout/lang/isNull.js | 9 + .../node_modules/mout/lang/isNumber.js | 8 + .../node_modules/mout/lang/isObject.js | 8 + .../node_modules/mout/lang/isPlainObject.js | 13 + .../node_modules/mout/lang/isRegExp.js | 8 + .../node_modules/mout/lang/isString.js | 8 + .../node_modules/mout/lang/isUndefined.js | 10 + .../node_modules/mout/lang/isnt.js | 12 + .../node_modules/mout/lang/kindOf.js | 20 + .../node_modules/mout/lang/toArray.js | 31 + .../node_modules/mout/lang/toNumber.js | 20 + .../node_modules/mout/lang/toString.js | 13 + .../bower-config/node_modules/mout/math.js | 19 + .../node_modules/mout/math/ceil.js | 11 + .../node_modules/mout/math/clamp.js | 9 + .../node_modules/mout/math/countSteps.js | 16 + .../node_modules/mout/math/floor.js | 10 + .../node_modules/mout/math/inRange.js | 11 + .../node_modules/mout/math/isNear.js | 9 + .../node_modules/mout/math/lerp.js | 11 + .../node_modules/mout/math/loop.js | 10 + .../node_modules/mout/math/map.js | 11 + .../node_modules/mout/math/norm.js | 9 + .../node_modules/mout/math/round.js | 12 + .../bower-config/node_modules/mout/number.js | 24 + .../node_modules/mout/number/MAX_INT.js | 6 + .../node_modules/mout/number/MAX_UINT.js | 6 + .../node_modules/mout/number/MIN_INT.js | 6 + .../node_modules/mout/number/abbreviate.js | 35 + .../mout/number/currencyFormat.js | 27 + .../mout/number/enforcePrecision.js | 12 + .../node_modules/mout/number/isNaN.js | 14 + .../node_modules/mout/number/nth.js | 25 + .../node_modules/mout/number/ordinal.js | 14 + .../node_modules/mout/number/pad.js | 14 + .../node_modules/mout/number/rol.js | 10 + .../node_modules/mout/number/ror.js | 10 + .../node_modules/mout/number/sign.js | 15 + .../node_modules/mout/number/toInt.js | 17 + .../node_modules/mout/number/toUInt.js | 15 + .../node_modules/mout/number/toUInt31.js | 15 + .../bower-config/node_modules/mout/object.js | 42 + .../node_modules/mout/object/bindAll.js | 19 + .../node_modules/mout/object/contains.js | 13 + .../node_modules/mout/object/deepEquals.js | 27 + .../node_modules/mout/object/deepFillIn.js | 33 + .../node_modules/mout/object/deepMatches.js | 55 + .../node_modules/mout/object/deepMixIn.js | 34 + .../node_modules/mout/object/equals.js | 36 + .../node_modules/mout/object/every.js | 23 + .../node_modules/mout/object/fillIn.js | 21 + .../node_modules/mout/object/filter.js | 20 + .../node_modules/mout/object/find.js | 21 + .../node_modules/mout/object/forIn.js | 76 + .../node_modules/mout/object/forOwn.js | 19 + .../node_modules/mout/object/functions.js | 18 + .../node_modules/mout/object/get.js | 20 + .../node_modules/mout/object/has.js | 15 + .../node_modules/mout/object/hasOwn.js | 12 + .../node_modules/mout/object/keys.js | 16 + .../node_modules/mout/object/map.js | 18 + .../node_modules/mout/object/matches.js | 20 + .../node_modules/mout/object/max.js | 12 + .../node_modules/mout/object/merge.js | 40 + .../node_modules/mout/object/min.js | 12 + .../node_modules/mout/object/mixIn.js | 28 + .../node_modules/mout/object/namespace.js | 19 + .../node_modules/mout/object/pick.js | 18 + .../node_modules/mout/object/pluck.js | 13 + .../node_modules/mout/object/reduce.js | 29 + .../node_modules/mout/object/reject.js | 16 + .../node_modules/mout/object/set.js | 17 + .../node_modules/mout/object/size.js | 16 + .../node_modules/mout/object/some.js | 21 + .../node_modules/mout/object/unset.js | 23 + .../node_modules/mout/object/values.js | 16 + .../node_modules/mout/package.json | 157 + .../node_modules/mout/queryString.js | 15 + .../node_modules/mout/queryString/contains.js | 12 + .../node_modules/mout/queryString/decode.js | 38 + .../node_modules/mout/queryString/encode.js | 27 + .../node_modules/mout/queryString/getParam.js | 15 + .../node_modules/mout/queryString/getQuery.js | 13 + .../node_modules/mout/queryString/parse.js | 13 + .../node_modules/mout/queryString/setParam.js | 28 + .../bower-config/node_modules/mout/random.js | 17 + .../node_modules/mout/random/choice.js | 15 + .../node_modules/mout/random/guid.js | 24 + .../node_modules/mout/random/rand.js | 15 + .../node_modules/mout/random/randBit.js | 11 + .../node_modules/mout/random/randBool.js | 12 + .../node_modules/mout/random/randHex.js | 19 + .../node_modules/mout/random/randInt.js | 18 + .../node_modules/mout/random/randSign.js | 11 + .../node_modules/mout/random/random.js | 18 + .../node_modules/mout/src/array.js | 50 + .../node_modules/mout/src/array/append.js | 21 + .../node_modules/mout/src/array/collect.js | 26 + .../node_modules/mout/src/array/combine.js | 22 + .../node_modules/mout/src/array/compact.js | 13 + .../node_modules/mout/src/array/contains.js | 10 + .../node_modules/mout/src/array/difference.js | 19 + .../node_modules/mout/src/array/every.js | 27 + .../node_modules/mout/src/array/filter.js | 26 + .../node_modules/mout/src/array/find.js | 13 + .../node_modules/mout/src/array/findIndex.js | 23 + .../node_modules/mout/src/array/findLast.js | 13 + .../mout/src/array/findLastIndex.js | 24 + .../node_modules/mout/src/array/flatten.js | 42 + .../node_modules/mout/src/array/forEach.js | 23 + .../node_modules/mout/src/array/indexOf.js | 28 + .../node_modules/mout/src/array/insert.js | 14 + .../mout/src/array/intersection.js | 20 + .../node_modules/mout/src/array/invoke.js | 23 + .../node_modules/mout/src/array/join.js | 17 + .../mout/src/array/lastIndexOf.js | 28 + .../node_modules/mout/src/array/map.js | 22 + .../node_modules/mout/src/array/max.js | 34 + .../node_modules/mout/src/array/min.js | 34 + .../node_modules/mout/src/array/pick.js | 31 + .../node_modules/mout/src/array/pluck.js | 12 + .../node_modules/mout/src/array/range.js | 27 + .../node_modules/mout/src/array/reduce.js | 33 + .../mout/src/array/reduceRight.js | 34 + .../node_modules/mout/src/array/reject.js | 25 + .../node_modules/mout/src/array/remove.js | 13 + .../node_modules/mout/src/array/removeAll.js | 15 + .../node_modules/mout/src/array/shuffle.js | 28 + .../node_modules/mout/src/array/slice.js | 35 + .../node_modules/mout/src/array/some.js | 27 + .../node_modules/mout/src/array/sort.js | 55 + .../node_modules/mout/src/array/sortBy.js | 18 + .../node_modules/mout/src/array/split.js | 35 + .../node_modules/mout/src/array/toLookup.js | 28 + .../node_modules/mout/src/array/union.js | 18 + .../node_modules/mout/src/array/unique.js | 25 + .../node_modules/mout/src/array/xor.js | 24 + .../node_modules/mout/src/array/zip.js | 27 + .../node_modules/mout/src/collection.js | 22 + .../mout/src/collection/contains.js | 7 + .../node_modules/mout/src/collection/every.js | 7 + .../mout/src/collection/filter.js | 22 + .../node_modules/mout/src/collection/find.js | 8 + .../mout/src/collection/forEach.js | 7 + .../node_modules/mout/src/collection/make_.js | 19 + .../node_modules/mout/src/collection/map.js | 20 + .../node_modules/mout/src/collection/max.js | 8 + .../node_modules/mout/src/collection/min.js | 8 + .../node_modules/mout/src/collection/pluck.js | 14 + .../mout/src/collection/reduce.js | 7 + .../mout/src/collection/reject.js | 15 + .../node_modules/mout/src/collection/size.js | 18 + .../node_modules/mout/src/collection/some.js | 7 + .../node_modules/mout/src/date.js | 22 + .../mout/src/date/dayOfTheYear.js | 13 + .../node_modules/mout/src/date/diff.js | 128 + .../node_modules/mout/src/date/i18n/de-DE.js | 61 + .../node_modules/mout/src/date/i18n/en-US.js | 61 + .../node_modules/mout/src/date/i18n/pt-BR.js | 61 + .../node_modules/mout/src/date/i18n_.js | 13 + .../node_modules/mout/src/date/isLeapYear.js | 15 + .../node_modules/mout/src/date/isSame.js | 16 + .../node_modules/mout/src/date/parseIso.js | 146 + .../node_modules/mout/src/date/quarter.js | 16 + .../node_modules/mout/src/date/startOf.js | 54 + .../node_modules/mout/src/date/strftime.js | 115 + .../mout/src/date/timezoneAbbr.js | 17 + .../mout/src/date/timezoneOffset.js | 16 + .../mout/src/date/totalDaysInMonth.js | 24 + .../mout/src/date/totalDaysInYear.js | 13 + .../mout/src/date/weekOfTheYear.js | 16 + .../node_modules/mout/src/function.js | 22 + .../mout/src/function/awaitDelay.js | 20 + .../node_modules/mout/src/function/bind.js | 19 + .../node_modules/mout/src/function/compose.js | 23 + .../mout/src/function/constant.js | 14 + .../mout/src/function/debounce.js | 32 + .../node_modules/mout/src/function/func.js | 14 + .../mout/src/function/identity.js | 12 + .../mout/src/function/makeIterator_.js | 32 + .../node_modules/mout/src/function/partial.js | 15 + .../node_modules/mout/src/function/prop.js | 14 + .../node_modules/mout/src/function/series.js | 22 + .../mout/src/function/throttle.js | 33 + .../node_modules/mout/src/function/timeout.js | 17 + .../node_modules/mout/src/function/times.js | 17 + .../node_modules/mout/src/index.js | 25 + .../node_modules/mout/src/lang.js | 37 + .../node_modules/mout/src/lang/clone.js | 47 + .../mout/src/lang/createObject.js | 18 + .../node_modules/mout/src/lang/ctorApply.js | 17 + .../node_modules/mout/src/lang/deepClone.js | 45 + .../node_modules/mout/src/lang/defaults.js | 16 + .../mout/src/lang/inheritPrototype.js | 18 + .../node_modules/mout/src/lang/is.js | 23 + .../node_modules/mout/src/lang/isArguments.js | 15 + .../node_modules/mout/src/lang/isArray.js | 8 + .../node_modules/mout/src/lang/isBoolean.js | 8 + .../node_modules/mout/src/lang/isDate.js | 8 + .../node_modules/mout/src/lang/isEmpty.js | 23 + .../node_modules/mout/src/lang/isFinite.js | 21 + .../node_modules/mout/src/lang/isFunction.js | 8 + .../node_modules/mout/src/lang/isInteger.js | 12 + .../node_modules/mout/src/lang/isKind.js | 9 + .../node_modules/mout/src/lang/isNaN.js | 15 + .../node_modules/mout/src/lang/isNull.js | 9 + .../node_modules/mout/src/lang/isNumber.js | 8 + .../node_modules/mout/src/lang/isObject.js | 8 + .../mout/src/lang/isPlainObject.js | 13 + .../node_modules/mout/src/lang/isRegExp.js | 8 + .../node_modules/mout/src/lang/isString.js | 8 + .../node_modules/mout/src/lang/isUndefined.js | 10 + .../node_modules/mout/src/lang/isnt.js | 12 + .../node_modules/mout/src/lang/kindOf.js | 20 + .../node_modules/mout/src/lang/toArray.js | 31 + .../node_modules/mout/src/lang/toNumber.js | 20 + .../node_modules/mout/src/lang/toString.js | 13 + .../node_modules/mout/src/math.js | 19 + .../node_modules/mout/src/math/ceil.js | 11 + .../node_modules/mout/src/math/clamp.js | 9 + .../node_modules/mout/src/math/countSteps.js | 16 + .../node_modules/mout/src/math/floor.js | 10 + .../node_modules/mout/src/math/inRange.js | 11 + .../node_modules/mout/src/math/isNear.js | 9 + .../node_modules/mout/src/math/lerp.js | 11 + .../node_modules/mout/src/math/loop.js | 10 + .../node_modules/mout/src/math/map.js | 10 + .../node_modules/mout/src/math/norm.js | 9 + .../node_modules/mout/src/math/round.js | 12 + .../node_modules/mout/src/number.js | 24 + .../node_modules/mout/src/number/MAX_INT.js | 6 + .../node_modules/mout/src/number/MAX_UINT.js | 6 + .../node_modules/mout/src/number/MIN_INT.js | 6 + .../mout/src/number/abbreviate.js | 35 + .../mout/src/number/currencyFormat.js | 27 + .../mout/src/number/enforcePrecision.js | 12 + .../node_modules/mout/src/number/isNaN.js | 14 + .../node_modules/mout/src/number/nth.js | 25 + .../node_modules/mout/src/number/ordinal.js | 13 + .../node_modules/mout/src/number/pad.js | 13 + .../node_modules/mout/src/number/rol.js | 10 + .../node_modules/mout/src/number/ror.js | 10 + .../node_modules/mout/src/number/sign.js | 15 + .../node_modules/mout/src/number/toInt.js | 17 + .../node_modules/mout/src/number/toUInt.js | 15 + .../node_modules/mout/src/number/toUInt31.js | 15 + .../node_modules/mout/src/object.js | 42 + .../node_modules/mout/src/object/bindAll.js | 16 + .../node_modules/mout/src/object/contains.js | 13 + .../mout/src/object/deepEquals.js | 26 + .../mout/src/object/deepFillIn.js | 32 + .../mout/src/object/deepMatches.js | 54 + .../node_modules/mout/src/object/deepMixIn.js | 33 + .../node_modules/mout/src/object/equals.js | 34 + .../node_modules/mout/src/object/every.js | 22 + .../node_modules/mout/src/object/fillIn.js | 19 + .../node_modules/mout/src/object/filter.js | 19 + .../node_modules/mout/src/object/find.js | 20 + .../node_modules/mout/src/object/forIn.js | 76 + .../node_modules/mout/src/object/forOwn.js | 18 + .../node_modules/mout/src/object/functions.js | 18 + .../node_modules/mout/src/object/get.js | 20 + .../node_modules/mout/src/object/has.js | 15 + .../node_modules/mout/src/object/hasOwn.js | 12 + .../node_modules/mout/src/object/keys.js | 16 + .../node_modules/mout/src/object/map.js | 17 + .../node_modules/mout/src/object/matches.js | 20 + .../node_modules/mout/src/object/max.js | 11 + .../node_modules/mout/src/object/merge.js | 38 + .../node_modules/mout/src/object/min.js | 11 + .../node_modules/mout/src/object/mixIn.js | 28 + .../node_modules/mout/src/object/namespace.js | 19 + .../node_modules/mout/src/object/pick.js | 18 + .../node_modules/mout/src/object/pluck.js | 12 + .../node_modules/mout/src/object/reduce.js | 28 + .../node_modules/mout/src/object/reject.js | 15 + .../node_modules/mout/src/object/set.js | 17 + .../node_modules/mout/src/object/size.js | 16 + .../node_modules/mout/src/object/some.js | 20 + .../node_modules/mout/src/object/unset.js | 23 + .../node_modules/mout/src/object/values.js | 16 + .../node_modules/mout/src/queryString.js | 15 + .../mout/src/queryString/contains.js | 12 + .../mout/src/queryString/decode.js | 35 + .../mout/src/queryString/encode.js | 25 + .../mout/src/queryString/getParam.js | 14 + .../mout/src/queryString/getQuery.js | 13 + .../mout/src/queryString/parse.js | 12 + .../mout/src/queryString/setParam.js | 28 + .../node_modules/mout/src/random.js | 17 + .../node_modules/mout/src/random/choice.js | 14 + .../node_modules/mout/src/random/guid.js | 23 + .../node_modules/mout/src/random/rand.js | 13 + .../node_modules/mout/src/random/randBit.js | 11 + .../node_modules/mout/src/random/randBool.js | 12 + .../node_modules/mout/src/random/randHex.js | 19 + .../node_modules/mout/src/random/randInt.js | 16 + .../node_modules/mout/src/random/randSign.js | 11 + .../node_modules/mout/src/random/random.js | 18 + .../node_modules/mout/src/string.js | 46 + .../mout/src/string/WHITE_SPACES.js | 12 + .../node_modules/mout/src/string/camelCase.js | 16 + .../node_modules/mout/src/string/contains.js | 14 + .../node_modules/mout/src/string/crop.js | 11 + .../node_modules/mout/src/string/endsWith.js | 13 + .../mout/src/string/escapeHtml.js | 18 + .../mout/src/string/escapeRegExp.js | 12 + .../mout/src/string/escapeUnicode.js | 21 + .../node_modules/mout/src/string/hyphenate.js | 12 + .../node_modules/mout/src/string/insert.js | 20 + .../mout/src/string/interpolate.js | 21 + .../node_modules/mout/src/string/lowerCase.js | 11 + .../node_modules/mout/src/string/lpad.js | 16 + .../node_modules/mout/src/string/ltrim.js | 33 + .../node_modules/mout/src/string/makePath.js | 14 + .../mout/src/string/normalizeLineBreaks.js | 18 + .../mout/src/string/pascalCase.js | 11 + .../mout/src/string/properCase.js | 11 + .../mout/src/string/removeNonASCII.js | 14 + .../mout/src/string/removeNonWord.js | 14 + .../node_modules/mout/src/string/repeat.js | 25 + .../node_modules/mout/src/string/replace.js | 32 + .../mout/src/string/replaceAccents.js | 36 + .../node_modules/mout/src/string/rpad.js | 14 + .../node_modules/mout/src/string/rtrim.js | 32 + .../mout/src/string/sentenceCase.js | 13 + .../node_modules/mout/src/string/slugify.js | 21 + .../mout/src/string/startsWith.js | 13 + .../mout/src/string/stripHtmlTags.js | 11 + .../node_modules/mout/src/string/trim.js | 12 + .../node_modules/mout/src/string/truncate.js | 20 + .../node_modules/mout/src/string/typecast.js | 29 + .../mout/src/string/unCamelCase.js | 23 + .../mout/src/string/underscore.js | 11 + .../mout/src/string/unescapeHtml.js | 18 + .../mout/src/string/unescapeUnicode.js | 16 + .../mout/src/string/unhyphenate.js | 10 + .../node_modules/mout/src/string/upperCase.js | 10 + .../node_modules/mout/src/time.js | 12 + .../node_modules/mout/src/time/convert.js | 41 + .../node_modules/mout/src/time/now.js | 18 + .../node_modules/mout/src/time/parseMs.js | 17 + .../mout/src/time/toTimeString.js | 23 + .../bower-config/node_modules/mout/string.js | 46 + .../node_modules/mout/string/WHITE_SPACES.js | 12 + .../node_modules/mout/string/camelCase.js | 20 + .../node_modules/mout/string/contains.js | 14 + .../node_modules/mout/string/crop.js | 12 + .../node_modules/mout/string/endsWith.js | 13 + .../node_modules/mout/string/escapeHtml.js | 18 + .../node_modules/mout/string/escapeRegExp.js | 12 + .../node_modules/mout/string/escapeUnicode.js | 21 + .../node_modules/mout/string/hyphenate.js | 14 + .../node_modules/mout/string/insert.js | 21 + .../node_modules/mout/string/interpolate.js | 19 + .../node_modules/mout/string/lowerCase.js | 11 + .../node_modules/mout/string/lpad.js | 17 + .../node_modules/mout/string/ltrim.js | 34 + .../node_modules/mout/string/makePath.js | 15 + .../mout/string/normalizeLineBreaks.js | 18 + .../node_modules/mout/string/pascalCase.js | 13 + .../node_modules/mout/string/properCase.js | 13 + .../mout/string/removeNonASCII.js | 14 + .../node_modules/mout/string/removeNonWord.js | 14 + .../node_modules/mout/string/repeat.js | 26 + .../node_modules/mout/string/replace.js | 33 + .../mout/string/replaceAccents.js | 36 + .../node_modules/mout/string/rpad.js | 15 + .../node_modules/mout/string/rtrim.js | 33 + .../node_modules/mout/string/sentenceCase.js | 15 + .../node_modules/mout/string/slugify.js | 24 + .../node_modules/mout/string/startsWith.js | 13 + .../node_modules/mout/string/stripHtmlTags.js | 11 + .../node_modules/mout/string/trim.js | 15 + .../node_modules/mout/string/truncate.js | 21 + .../node_modules/mout/string/typecast.js | 29 + .../node_modules/mout/string/unCamelCase.js | 23 + .../node_modules/mout/string/underscore.js | 13 + .../node_modules/mout/string/unescapeHtml.js | 18 + .../mout/string/unescapeUnicode.js | 16 + .../node_modules/mout/string/unhyphenate.js | 10 + .../node_modules/mout/string/upperCase.js | 10 + .../bower-config/node_modules/mout/time.js | 12 + .../node_modules/mout/time/convert.js | 41 + .../node_modules/mout/time/now.js | 18 + .../node_modules/mout/time/parseMs.js | 17 + .../node_modules/mout/time/toTimeString.js | 24 + .../node_modules/minimist/package.json | 2 +- .../node_modules/deep-extend/package.json | 2 +- .../node_modules/graceful-fs/package.json | 2 +- .../node_modules/intersect/package.json | 2 +- .../bower-registry-client/.travis.yml | 8 +- .../bower-registry-client/Gruntfile.js | 18 +- .../bower-registry-client/README.md | 13 +- .../bower-registry-client/lib/register.js | 4 +- .../bower-registry-client/lib/unregister.js | 4 +- .../node_modules/request/.eslintrc | 22 + .../node_modules/request/.npmignore | 1 + .../node_modules/request/.travis.yml | 11 + .../node_modules/request/CHANGELOG.md | 394 + .../node_modules/request/CONTRIBUTING.md | 44 + .../node_modules/request/README.md | 585 +- .../request/disabled.appveyor.yml | 36 + .../node_modules/request/examples/README.md | 115 + .../node_modules/request/index.js | 217 +- .../node_modules/request/lib/cookies.js | 39 + .../node_modules/request/lib/copy.js | 4 +- .../node_modules/request/lib/debug.js | 14 +- .../node_modules/request/lib/getSafe.js | 34 - .../node_modules/request/lib/helpers.js | 89 + .../request/node_modules/.bin/uuid | 1 + .../{aws-sign => aws-sign2}/LICENSE | 0 .../{aws-sign => aws-sign2}/README.md | 0 .../{aws-sign => aws-sign2}/index.js | 2 +- .../{aws-sign => aws-sign2}/package.json | 28 +- .../request/node_modules/bl/.jshintrc | 59 + .../request/node_modules/bl/.npmignore | 1 + .../request/node_modules/bl/.travis.yml | 11 + .../request/node_modules/bl/LICENSE.md | 13 + .../request/node_modules/bl/README.md | 198 + .../request/node_modules/bl/bl.js | 216 + .../node_modules/readable-stream/.npmignore | 5 + .../bl/node_modules/readable-stream/LICENSE | 18 + .../bl/node_modules/readable-stream/README.md | 15 + .../bl/node_modules/readable-stream/duplex.js | 1 + .../readable-stream/lib/_stream_duplex.js | 89 + .../lib/_stream_passthrough.js | 46 + .../readable-stream/lib/_stream_readable.js | 982 + .../readable-stream/lib/_stream_transform.js | 210 + .../readable-stream/lib/_stream_writable.js | 386 + .../node_modules/core-util-is/README.md | 3 + .../node_modules/core-util-is/float.patch | 604 + .../node_modules/core-util-is/lib/util.js | 107 + .../node_modules/core-util-is/package.json | 54 + .../node_modules/core-util-is/util.js | 106 + .../node_modules/inherits/LICENSE | 16 + .../node_modules/inherits/README.md | 42 + .../node_modules/inherits/inherits.js | 1 + .../node_modules/inherits/inherits_browser.js | 23 + .../node_modules/inherits/package.json | 51 + .../node_modules/inherits/test.js | 25 + .../node_modules/isarray/README.md | 54 + .../node_modules/isarray/build/build.js | 209 + .../node_modules/isarray/component.json | 19 + .../node_modules/isarray/index.js | 3 + .../node_modules/isarray/package.json | 53 + .../node_modules/string_decoder/.npmignore | 2 + .../node_modules/string_decoder/LICENSE | 20 + .../node_modules/string_decoder/README.md | 7 + .../node_modules/string_decoder/index.js | 221 + .../node_modules/string_decoder/package.json | 54 + .../node_modules/readable-stream/package.json | 70 + .../readable-stream/passthrough.js | 1 + .../node_modules/readable-stream/readable.js | 8 + .../node_modules/readable-stream/transform.js | 1 + .../node_modules/readable-stream/writable.js | 1 + .../request/node_modules/bl/package.json | 62 + .../node_modules/bl/test/basic-test.js | 541 + .../request/node_modules/bl/test/sauce.js | 38 + .../request/node_modules/bl/test/test.js | 9 + .../request/node_modules/caseless/README.md | 45 + .../request/node_modules/caseless/index.js | 65 + .../node_modules/caseless/package.json | 52 + .../request/node_modules/caseless/test.js | 40 + .../node_modules => }/combined-stream/License | 0 .../combined-stream/Readme.md | 0 .../combined-stream/lib/combined_stream.js | 14 +- .../node_modules/delayed-stream/.gitignore | 0 .../node_modules/delayed-stream/License | 0 .../node_modules/delayed-stream/Makefile | 0 .../node_modules/delayed-stream/Readme.md | 0 .../delayed-stream/lib/delayed_stream.js | 0 .../node_modules/delayed-stream/package.json | 0 .../delayed-stream/test/common.js | 0 .../integration/test-delayed-http-upload.js | 0 .../test-delayed-stream-auto-pause.js | 0 .../integration/test-delayed-stream-pause.js | 0 .../test/integration/test-delayed-stream.js | 0 .../integration/test-handle-source-errors.js | 0 .../test/integration/test-max-data-size.js | 0 .../test/integration/test-pipe-resumes.js | 0 .../test/integration/test-proxy-readable.js | 0 .../node_modules/delayed-stream/test/run.js | 0 .../combined-stream/package.json | 25 +- .../request/node_modules/cookie-jar/LICENSE | 55 - .../request/node_modules/cookie-jar/README.md | 4 - .../request/node_modules/cookie-jar/index.js | 67 - .../request/node_modules/cookie-jar/jar.js | 72 - .../node_modules/cookie-jar/package.json | 49 - .../node_modules/cookie-jar/tests/run.js | 40 - .../cookie-jar/tests/test-cookie.js | 29 - .../cookie-jar/tests/test-cookiejar.js | 90 - .../node_modules/form-data/lib/form_data.js | 2 +- .../node_modules/mime-types/HISTORY.md | 85 + .../node_modules/mime-types}/LICENSE | 0 .../node_modules/mime-types/README.md | 99 + .../node_modules/mime-types/index.js | 63 + .../node_modules/mime-db/HISTORY.md | 166 + .../mime-types/node_modules/mime-db}/LICENSE | 0 .../mime-types/node_modules/mime-db/README.md | 76 + .../mime-types/node_modules/mime-db/db.json | 6299 ++++ .../mime-types/node_modules/mime-db/index.js | 11 + .../node_modules/mime-db/package.json | 93 + .../node_modules/mime-types/package.json | 84 + .../node_modules/form-data/package.json | 23 +- .../request/node_modules/hawk/.npmignore | 36 +- .../request/node_modules/hawk/.travis.yml | 10 +- .../request/node_modules/hawk/README.md | 8 +- .../request/node_modules/hawk/lib/browser.js | 34 +- .../request/node_modules/hawk/lib/client.js | 6 +- .../request/node_modules/hawk/lib/crypto.js | 7 + .../request/node_modules/hawk/lib/index.js | 2 +- .../request/node_modules/hawk/lib/server.js | 5 +- .../request/node_modules/hawk/package.json | 16 +- .../request/node_modules/hawk/test/browser.js | 46 + .../node_modules/http-signature/README.md | 86 +- .../http-signature/http_signing.md | 26 +- .../node_modules/http-signature/lib/index.js | 1 + .../node_modules/http-signature/lib/signer.js | 1 - .../node_modules/http-signature/lib/util.js | 59 +- .../node_modules/assert-plus/assert.js | 71 +- .../node_modules/assert-plus/package.json | 30 +- .../node_modules/ctype/.npmignore | 1 + .../node_modules/ctype/CHANGELOG | 9 +- .../node_modules/ctype/package.json | 21 +- .../node_modules/ctype/tst/ctf/float.json | 13 - .../node_modules/ctype/tst/ctf/int.json | 13 - .../node_modules/ctype/tst/ctf/psinfo.json | 104 - .../node_modules/ctype/tst/ctf/struct.json | 19 - .../node_modules/ctype/tst/ctf/tst.fail.js | 39 - .../node_modules/ctype/tst/ctf/tst.float.js | 14 - .../node_modules/ctype/tst/ctf/tst.int.js | 14 - .../node_modules/ctype/tst/ctf/tst.psinfo.js | 17 - .../node_modules/ctype/tst/ctf/tst.struct.js | 18 - .../node_modules/ctype/tst/ctf/tst.typedef.js | 15 - .../node_modules/ctype/tst/ctf/typedef.json | 14 - .../ctype/tst/ctio/float/tst.rfloat.js | 767 - .../ctype/tst/ctio/float/tst.wfloat.js | 753 - .../node_modules/ctype/tst/ctio/int/tst.64.js | 638 - .../ctype/tst/ctio/int/tst.rint.js | 101 - .../ctype/tst/ctio/int/tst.wbounds.js | 53 - .../ctype/tst/ctio/int/tst.wint.js | 92 - .../ctype/tst/ctio/uint/tst.64.js | 451 - .../ctype/tst/ctio/uint/tst.roundtrip.js | 81 - .../ctype/tst/ctio/uint/tst.ruint.js | 95 - .../ctype/tst/ctio/uint/tst.wuint.js | 156 - .../ctype/tst/ctype/tst.basicr.js | 50 - .../ctype/tst/ctype/tst.basicw.js | 44 - .../node_modules/ctype/tst/ctype/tst.char.js | 42 - .../ctype/tst/ctype/tst.endian.js | 45 - .../ctype/tst/ctype/tst.oldwrite.js | 28 - .../ctype/tst/ctype/tst.readSize.js | 128 - .../ctype/tst/ctype/tst.structw.js | 28 - .../ctype/tst/ctype/tst.writeStruct.js | 31 - .../node_modules/http-signature/package.json | 64 +- .../node_modules/mime-types/.npmignore | 14 + .../node_modules/mime-types/.travis.yml | 12 + .../request/node_modules/mime-types/LICENSE | 22 + .../request/node_modules/mime-types/Makefile | 9 + .../request/node_modules/mime-types/README.md | 101 + .../node_modules/mime-types/SOURCES.md | 17 + .../node_modules/mime-types/component.json | 16 + .../node_modules/mime-types/lib/custom.json | 27 + .../node_modules/mime-types/lib/index.js | 75 + .../node_modules/mime-types/lib/mime.json | 3317 ++ .../node_modules/mime-types/lib/node.json | 55 + .../node_modules/mime-types/package.json | 69 + .../request/node_modules/mime/README.md | 66 - .../request/node_modules/mime/mime.js | 114 - .../request/node_modules/mime/package.json | 59 - .../request/node_modules/mime/test.js | 84 - .../node_modules/mime/types/mime.types | 1588 - .../node_modules/mime/types/node.types | 77 - .../request/node_modules/node-uuid/LICENSE.md | 23 +- .../request/node_modules/node-uuid/README.md | 40 +- .../request/node_modules/node-uuid/bin/uuid | 26 + .../request/node_modules/node-uuid/bower.json | 23 + .../node_modules/node-uuid/component.json | 4 +- .../node_modules/node-uuid/package.json | 37 +- .../request/node_modules/node-uuid/uuid.js | 16 +- .../request/node_modules/oauth-sign/index.js | 89 +- .../node_modules/oauth-sign/package.json | 29 +- .../request/node_modules/oauth-sign/test.js | 14 + .../request/node_modules/qs/.gitmodules | 6 - .../request/node_modules/qs/.jshintignore | 1 + .../request/node_modules/qs/.jshintrc | 10 + .../request/node_modules/qs/.npmignore | 25 +- .../request/node_modules/qs}/.travis.yml | 4 +- .../request/node_modules/qs/CHANGELOG.md | 68 + .../request/node_modules/qs/CONTRIBUTING.md | 1 + .../request/node_modules/qs/LICENSE | 28 + .../request/node_modules/qs/Makefile | 8 + .../request/node_modules/qs/Readme.md | 238 +- .../request/node_modules/qs/index.js | 367 +- .../request/node_modules/qs/lib/index.js | 15 + .../request/node_modules/qs/lib/parse.js | 157 + .../request/node_modules/qs/lib/stringify.js | 77 + .../request/node_modules/qs/lib/utils.js | 132 + .../request/node_modules/qs/package.json | 71 +- .../request/node_modules/qs/test/parse.js | 413 + .../request/node_modules/qs/test/stringify.js | 179 + .../node_modules/stringstream/.npmignore | 15 + .../node_modules/stringstream/.travis.yml | 4 + .../node_modules/stringstream/LICENSE.txt | 4 + .../node_modules/stringstream/README.md | 38 + .../node_modules/stringstream/example.js | 27 + .../node_modules/stringstream/package.json | 49 + .../node_modules/stringstream/stringstream.js | 102 + .../node_modules/tough-cookie/.jshintrc | 70 + .../node_modules/tough-cookie/.npmignore | 3 + .../node_modules/tough-cookie/.travis.yml | 8 + .../request/node_modules/tough-cookie/LICENSE | 78 + .../node_modules/tough-cookie/README.md | 412 + .../tough-cookie/generate-pubsuffix.js | 239 + .../node_modules/tough-cookie/lib/cookie.js | 1107 + .../node_modules/tough-cookie/lib/memstore.js | 123 + .../tough-cookie/lib/pubsuffix.js | 69 + .../node_modules/tough-cookie/lib/store.js | 37 + .../node_modules/punycode/LICENSE-MIT.txt | 20 + .../node_modules/punycode/README.md | 176 + .../node_modules/punycode/package.json | 81 + .../node_modules/punycode/punycode.js | 530 + .../node_modules/tough-cookie/package.json | 67 + .../tough-cookie/public-suffix.txt | 5229 +++ .../request/node_modules/tough-cookie/test.js | 1625 + .../node_modules/tunnel-agent/.jshintrc | 5 + .../node_modules/tunnel-agent/index.js | 15 +- .../node_modules/tunnel-agent/package.json | 24 +- .../node_modules/request/package.json | 87 +- .../node_modules/request/release.sh | 45 + .../node_modules/request/request.js | 1553 +- .../request/tests/googledoodle.jpg | Bin 38510 -> 0 bytes .../node_modules/request/tests/run.js | 40 - .../node_modules/request/tests/server.js | 90 - .../node_modules/request/tests/squid.conf | 77 - .../node_modules/request/tests/ssl/ca/ca.cnf | 20 - .../node_modules/request/tests/ssl/ca/ca.crl | 0 .../node_modules/request/tests/ssl/ca/ca.crt | 17 - .../node_modules/request/tests/ssl/ca/ca.csr | 13 - .../node_modules/request/tests/ssl/ca/ca.key | 18 - .../node_modules/request/tests/ssl/ca/ca.srl | 1 - .../request/tests/ssl/ca/server.cnf | 19 - .../request/tests/ssl/ca/server.crt | 16 - .../request/tests/ssl/ca/server.csr | 11 - .../request/tests/ssl/ca/server.js | 28 - .../request/tests/ssl/ca/server.key | 9 - .../node_modules/request/tests/ssl/npm-ca.crt | 16 - .../node_modules/request/tests/ssl/test.crt | 15 - .../node_modules/request/tests/ssl/test.key | 15 - .../request/tests/test-agentOptions.js | 23 - .../request/tests/test-basic-auth.js | 163 - .../node_modules/request/tests/test-body.js | 122 - .../request/tests/test-defaults.js | 129 - .../request/tests/test-digest-auth.js | 69 - .../request/tests/test-emptyBody.js | 20 - .../node_modules/request/tests/test-errors.js | 37 - .../request/tests/test-follow-all-303.js | 30 - .../request/tests/test-follow-all.js | 36 - .../node_modules/request/tests/test-form.js | 79 - .../node_modules/request/tests/test-hawk.js | 33 - .../request/tests/test-headers.js | 52 - .../request/tests/test-http-signature.js | 106 - .../request/tests/test-httpModule.js | 94 - .../request/tests/test-https-strict.js | 97 - .../node_modules/request/tests/test-https.js | 87 - .../node_modules/request/tests/test-isUrl.js | 28 - .../request/tests/test-localAddress.js | 15 - .../node_modules/request/tests/test-oauth.js | 117 - .../request/tests/test-onelineproxy.js | 46 - .../node_modules/request/tests/test-params.js | 93 - .../request/tests/test-piped-redirect.js | 42 - .../node_modules/request/tests/test-pipes.js | 216 - .../node_modules/request/tests/test-pool.js | 16 - .../tests/test-protocol-changing-redirect.js | 61 - .../node_modules/request/tests/test-proxy.js | 39 - .../node_modules/request/tests/test-qs.js | 42 - .../request/tests/test-redirect.js | 155 - .../node_modules/request/tests/test-s3.js | 13 - .../request/tests/test-timeout.js | 87 - .../node_modules/request/tests/test-toJSON.js | 14 - .../node_modules/request/tests/test-tunnel.js | 75 - .../node_modules/request/tests/unicycle.jpg | Bin 19806 -> 0 bytes .../bower-registry-client/package.json | 42 +- .../bower-registry-client/test/Client.js | 1 + .../bower/node_modules/cardinal/package.json | 3 +- .../node_modules/escape-string-regexp/license | 21 + .../escape-string-regexp/package.json | 38 +- .../bower/node_modules/chalk/package.json | 3 +- .../node_modules/isarray/package.json | 2 - .../node_modules/string_decoder/package.json | 3 +- .../node_modules/readable-stream/package.json | 3 +- .../node_modules/decompress-zip/package.json | 3 +- .../node_modules/minimatch/.npmignore | 2 +- .../node_modules/minimatch/README.md | 2 - .../node_modules/minimatch/benchmark.js | 15 + .../node_modules/minimatch/browser.js | 1181 + .../node_modules/minimatch/minimatch.js | 268 +- .../node_modules/brace-expansion}/.npmignore | 2 +- .../node_modules/brace-expansion/.travis.yml | 3 + .../node_modules/brace-expansion/README.md | 121 + .../node_modules/brace-expansion/example.js | 8 + .../node_modules/brace-expansion/index.js | 191 + .../node_modules/balanced-match}/.npmignore | 2 +- .../node_modules/balanced-match}/.travis.yml | 0 .../node_modules/balanced-match/Makefile | 6 + .../node_modules/balanced-match/README.md | 80 + .../node_modules/balanced-match/example.js | 5 + .../node_modules/balanced-match/index.js | 38 + .../node_modules/balanced-match/package.json | 72 + .../balanced-match/test/balanced.js | 56 + .../node_modules/concat-map/.travis.yml | 4 + .../node_modules/concat-map}/LICENSE | 0 .../node_modules/concat-map/README.markdown | 62 + .../node_modules/concat-map/example/map.js | 6 + .../node_modules/concat-map/index.js | 13 + .../node_modules/concat-map/package.json | 82 + .../node_modules/concat-map/test/map.js | 39 + .../node_modules/brace-expansion/package.json | 74 + .../brace-expansion/test/bash-comparison.js | 32 + .../brace-expansion/test/bash-results.txt | 1075 + .../brace-expansion/test/cases.txt | 182 + .../brace-expansion/test/dollar.js | 9 + .../brace-expansion/test/empty-option.js | 10 + .../brace-expansion/test/generate.sh | 24 + .../test/negative-increment.js | 15 + .../brace-expansion/test/nested.js | 16 + .../brace-expansion/test/order.js | 10 + .../node_modules/brace-expansion/test/pad.js | 13 + .../brace-expansion/test/same-type.js | 7 + .../brace-expansion/test/sequence.js | 50 + .../minimatch/node_modules/sigmund/LICENSE | 27 - .../minimatch/node_modules/sigmund/README.md | 53 - .../minimatch/node_modules/sigmund/bench.js | 283 - .../node_modules/sigmund/package.json | 58 - .../minimatch/node_modules/sigmund/sigmund.js | 39 - .../node_modules/sigmund/test/basic.js | 24 - .../node_modules/minimatch/package.json | 27 +- .../node_modules/minimatch/test/basic.js | 2 +- .../minimatch/test/brace-expand.js | 17 +- .../node_modules/minimatch/test/caching.js | 14 - .../node_modules/fstream-ignore/package.json | 21 +- .../fstream/examples/filter-pipe.js | 4 +- .../node_modules/fstream/examples/pipe.js | 2 +- .../node_modules/fstream/examples/reader.js | 22 +- .../node_modules/fstream/lib/file-reader.js | 4 + .../bower/node_modules/fstream/lib/writer.js | 2 +- .../bower/node_modules/fstream/package.json | 27 +- .../bower/node_modules/glob/package.json | 5 +- .../bower/node_modules/graceful-fs/fs.js | 2 +- .../node_modules/graceful-fs/package.json | 19 +- .../node_modules/source-map/CHANGELOG.md | 21 + .../node_modules/source-map/README.md | 26 + .../source-map/lib/source-map/base64-vlq.js | 4 +- .../lib/source-map/binary-search.js | 29 +- .../source-map/lib/source-map/mapping-list.js | 86 + .../lib/source-map/source-map-consumer.js | 144 +- .../lib/source-map/source-map-generator.js | 25 +- .../source-map/lib/source-map/source-node.js | 30 +- .../node_modules/source-map/package.json | 28 +- .../test/source-map/test-binary-search.js | 8 +- .../source-map/test-source-map-consumer.js | 171 + .../source-map/test-source-map-generator.js | 21 + .../source-map/test/source-map/util.js | 16 + .../node_modules/handlebars/package.json | 5 +- .../cli-color/node_modules/es5-ext/.lint | 13 +- .../node_modules/es5-ext/.travis.yml | 2 + .../cli-color/node_modules/es5-ext/CHANGES | 14 + .../es6-iterator/LICENCE => LICENSE} | 2 +- .../cli-color/node_modules/es5-ext/README.md | 37 +- .../es5-ext/array/#/e-index-of.js | 4 +- .../es5-ext/array/#/e-last-index-of.js | 4 +- .../node_modules/es5-ext/array/from/shim.js | 8 +- .../node_modules/es5-ext/function/#/index.js | 15 +- .../es5-ext/function/#/to-string-tokens.js | 11 + .../node_modules/es5-ext/math/trunc/shim.js | 4 +- .../node_modules/es6-iterator/.travis.yml | 2 + .../es5-ext/node_modules/es6-iterator/CHANGES | 12 +- .../LICENCE => es6-iterator/LICENSE} | 2 +- .../node_modules/es6-iterator/README.md | 10 +- .../node_modules/es6-iterator/index.js | 6 +- .../node_modules/es6-iterator/package.json | 34 +- .../node_modules/es6-iterator/test/array.js | 6 +- .../node_modules/es6-iterator/test/index.js | 2 +- .../es5-ext/node_modules/es6-symbol/.lint | 4 +- .../es5-ext/node_modules/es6-symbol/CHANGES | 22 + .../es6-symbol/LICENSE} | 2 +- .../es5-ext/node_modules/es6-symbol/README.md | 20 +- .../node_modules/es6-symbol/is-implemented.js | 1 - .../node_modules/es6-symbol/is-symbol.js | 9 +- .../node_modules/es6-symbol/package.json | 26 +- .../node_modules/es6-symbol/polyfill.js | 70 +- .../node_modules/es6-symbol/test/polyfill.js | 10 + .../es6-symbol/test/valid-iterable.js | 14 - .../{valid-symbol.js => validate-symbol.js} | 0 .../{valid-symbol.js => validate-symbol.js} | 0 .../es5-ext/number/is-integer/shim.js | 7 +- .../es5-ext/number/is-nan/shim.js | 2 +- .../node_modules/es5-ext/object/compare.js | 6 +- .../node_modules/es5-ext/object/eq.js | 2 +- .../node_modules/es5-ext/object/index.js | 2 + .../node_modules/es5-ext/object/is-empty.js | 2 +- .../node_modules/es5-ext/object/is-object.js | 2 +- .../es5-ext/object/is-plain-object.js | 2 +- .../node_modules/es5-ext/object/is.js | 2 +- .../es5-ext/object/normalize-options.js | 13 +- .../node_modules/es5-ext/object/serialize.js | 36 + .../es5-ext/object/unserialize.js | 7 + .../node_modules/es5-ext/package.json | 33 +- .../es5-ext/string/#/camel-to-hyphen.js | 2 +- .../node_modules/es5-ext/string/index.js | 1 + .../es5-ext/string/random-uniq.js | 11 + .../es5-ext/test/array/from/shim.js | 20 +- .../es5-ext/test/array/of/shim.js | 12 +- .../test/function/#/to-string-tokens.js | 12 + .../es5-ext/test/math/trunc/shim.js | 4 +- .../es5-ext/test/object/is-plain-object.js | 2 +- .../es5-ext/test/object/key-of.js | 2 +- .../es5-ext/test/object/normalize-options.js | 11 +- .../es5-ext/test/object/serialize.js | 25 + .../es5-ext/test/object/unserialize.js | 24 + .../es5-ext/test/object/valid-object.js | 2 +- .../node_modules/es5-ext/test/string/#/at.js | 2 +- .../es5-ext/test/string/#/camel-to-hyphen.js | 2 +- .../test/string/#/code-point-at/shim.js | 4 +- .../es5-ext/test/string/#/hyphen-to-camel.js | 2 +- .../node_modules/es5-ext/test/string/#/pad.js | 4 +- .../es5-ext/test/string/random-uniq.js | 14 + .../node_modules/es6-iterator/.travis.yml | 2 + .../node_modules/es6-iterator/CHANGES | 12 +- .../node_modules/es6-iterator/LICENCE | 19 - .../node_modules/es6-iterator/LICENSE | 19 + .../node_modules/es6-iterator/README.md | 10 +- .../node_modules/es6-iterator/index.js | 6 +- .../node_modules/es6-symbol/.lint | 13 + .../node_modules/es6-symbol/.npmignore | 4 + .../node_modules/es6-symbol/.travis.yml | 9 + .../node_modules/es6-symbol/CHANGES | 34 + .../node_modules/es6-symbol/LICENSE | 19 + .../node_modules/es6-symbol/README.md | 71 + .../node_modules/es6-symbol/implement.js | 7 + .../node_modules/es6-symbol/index.js | 3 + .../node_modules/es6-symbol/is-implemented.js | 18 + .../es6-symbol/is-native-implemented.js | 8 + .../node_modules/es6-symbol/is-symbol.js | 5 + .../node_modules/es6-symbol/package.json | 62 + .../node_modules/es6-symbol/polyfill.js | 77 + .../node_modules/es6-symbol/test/implement.js | 3 + .../node_modules/es6-symbol/test/index.js | 12 + .../es6-symbol/test/is-implemented.js | 14 + .../es6-symbol/test/is-native-implemented.js | 3 + .../node_modules/es6-symbol/test/is-symbol.js | 16 + .../node_modules/es6-symbol/test/polyfill.js | 27 + .../es6-symbol/test/validate-symbol.js} | 0 .../es6-symbol/validate-symbol.js} | 0 .../node_modules/es6-iterator/package.json | 33 +- .../node_modules/es6-iterator/test/array.js | 6 +- .../node_modules/es6-iterator/test/index.js | 2 +- .../node_modules/es6-symbol/package.json | 3 +- .../node_modules/es6-weak-map/package.json | 3 +- .../node_modules/event-emitter/.travis.yml | 2 + .../node_modules/event-emitter/CHANGES | 8 + .../node_modules/event-emitter/LICENCE | 19 - .../node_modules/event-emitter/LICENSE | 19 + .../node_modules/event-emitter/README.md | 13 +- .../event-emitter/benchmark/many-on.js | 2 +- .../event-emitter/benchmark/single-on.js | 2 +- .../node_modules/event-emitter/package.json | 30 +- .../event-emitter/test/has-listeners.js | 4 +- .../node_modules/event-emitter/test/unify.js | 2 +- .../node_modules/memoizee/package.json | 3 +- .../inquirer/node_modules/figures/index.js | 8 +- .../node_modules/figures/package.json | 19 +- .../node_modules/mute-stream/package.json | 2 +- .../node_modules/readline2/.npmignore | 5 - .../inquirer/node_modules/readline2/README.md | 4 +- .../inquirer/node_modules/readline2/index.js | 15 +- .../{chalk/node_modules => }/.bin/strip-ansi | 0 .../readline2/node_modules/chalk/index.js | 63 - .../node_modules/ansi-styles/ansi-styles.js | 38 - .../node_modules/ansi-styles/package.json | 75 - .../chalk/node_modules/ansi-styles/readme.md | 65 - .../chalk/node_modules/has-color/index.js | 32 - .../chalk/node_modules/has-color/package.json | 71 - .../chalk/node_modules/has-color/readme.md | 30 - .../chalk/node_modules/strip-ansi/cli.js | 27 - .../chalk/node_modules/strip-ansi/index.js | 4 - .../chalk/node_modules/strip-ansi/readme.md | 46 - .../readline2/node_modules/chalk/package.json | 78 - .../readline2/node_modules/chalk/readme.md | 158 - .../readline2/node_modules/strip-ansi/cli.js | 47 + .../node_modules/strip-ansi/index.js | 6 + .../node_modules/ansi-regex/index.js | 4 + .../node_modules/ansi-regex/license | 21 + .../node_modules/ansi-regex/package.json | 85 + .../node_modules/ansi-regex/readme.md | 33 + .../node_modules/strip-ansi/package.json | 43 +- .../node_modules/strip-ansi/readme.md | 43 + .../node_modules/readline2/package.json | 43 +- .../inquirer/node_modules/rx/.coveralls.yml | 4 +- .../inquirer/node_modules/rx/.jamignore | 28 +- .../inquirer/node_modules/rx/.jscsrc | 54 + .../inquirer/node_modules/rx/.jscsrc.todo | 19 + .../inquirer/node_modules/rx/authors.txt | 6 +- .../inquirer/node_modules/rx/bower.json | 140 +- .../inquirer/node_modules/rx/component.json | 105 +- .../node_modules/rx/dist/rx.aggregates.js | 1272 +- .../node_modules/rx/dist/rx.aggregates.map | 2 +- .../node_modules/rx/dist/rx.aggregates.min.js | 2 +- .../node_modules/rx/dist/rx.all.compat.js | 15201 ++++---- .../node_modules/rx/dist/rx.all.compat.map | 2 +- .../node_modules/rx/dist/rx.all.compat.min.js | 7 +- .../inquirer/node_modules/rx/dist/rx.all.js | 15097 ++++---- .../inquirer/node_modules/rx/dist/rx.all.map | 2 +- .../node_modules/rx/dist/rx.all.min.js | 7 +- .../node_modules/rx/dist/rx.async.compat.js | 952 +- .../node_modules/rx/dist/rx.async.compat.map | 2 +- .../rx/dist/rx.async.compat.min.js | 2 +- .../inquirer/node_modules/rx/dist/rx.async.js | 816 +- .../node_modules/rx/dist/rx.async.map | 2 +- .../node_modules/rx/dist/rx.async.min.js | 2 +- .../node_modules/rx/dist/rx.backpressure.js | 683 +- .../node_modules/rx/dist/rx.backpressure.map | 2 +- .../rx/dist/rx.backpressure.min.js | 2 +- .../node_modules/rx/dist/rx.binding.js | 551 +- .../node_modules/rx/dist/rx.binding.map | 2 +- .../node_modules/rx/dist/rx.binding.min.js | 2 +- .../node_modules/rx/dist/rx.coincidence.js | 961 +- .../node_modules/rx/dist/rx.coincidence.map | 2 +- .../rx/dist/rx.coincidence.min.js | 2 +- .../node_modules/rx/dist/rx.compat.js | 7657 +++-- .../node_modules/rx/dist/rx.compat.map | 2 +- .../node_modules/rx/dist/rx.compat.min.js | 4 +- .../node_modules/rx/dist/rx.experimental.js | 583 +- .../node_modules/rx/dist/rx.experimental.map | 2 +- .../rx/dist/rx.experimental.min.js | 2 +- .../node_modules/rx/dist/rx.joinpatterns.js | 250 +- .../node_modules/rx/dist/rx.joinpatterns.map | 2 +- .../rx/dist/rx.joinpatterns.min.js | 2 +- .../inquirer/node_modules/rx/dist/rx.js | 7555 ++-- .../node_modules/rx/dist/rx.lite.compat.js | 9999 +++--- .../node_modules/rx/dist/rx.lite.compat.map | 2 +- .../rx/dist/rx.lite.compat.min.js | 5 +- .../node_modules/rx/dist/rx.lite.extras.js | 538 +- .../node_modules/rx/dist/rx.lite.extras.map | 2 +- .../rx/dist/rx.lite.extras.min.js | 2 +- .../inquirer/node_modules/rx/dist/rx.lite.js | 8441 ++--- .../inquirer/node_modules/rx/dist/rx.lite.map | 2 +- .../node_modules/rx/dist/rx.lite.min.js | 4 +- .../inquirer/node_modules/rx/dist/rx.map | 2 +- .../inquirer/node_modules/rx/dist/rx.min.js | 4 +- .../node_modules/rx/dist/rx.sorting.js | 72 + .../node_modules/rx/dist/rx.sorting.map | 1 + .../node_modules/rx/dist/rx.sorting.min.js | 3 + .../node_modules/rx/dist/rx.testing.js | 858 +- .../node_modules/rx/dist/rx.testing.map | 2 +- .../node_modules/rx/dist/rx.testing.min.js | 2 +- .../inquirer/node_modules/rx/dist/rx.time.js | 1006 +- .../inquirer/node_modules/rx/dist/rx.time.map | 2 +- .../node_modules/rx/dist/rx.time.min.js | 2 +- .../node_modules/rx/dist/rx.virtualtime.js | 19 +- .../node_modules/rx/dist/rx.virtualtime.map | 2 +- .../rx/dist/rx.virtualtime.min.js | 2 +- .../inquirer/node_modules/rx/index.js | 403 +- .../inquirer/node_modules/rx/license.txt | 30 +- .../inquirer/node_modules/rx/logos/logo.png | Bin 0 -> 12929 bytes .../inquirer/node_modules/rx/package.json | 18 +- .../inquirer/node_modules/rx/readme.md | 821 +- .../rx/src/core/abstractobserver.js | 5 + .../rx/src/core/anonymousobservable.js | 83 +- .../rx/src/core/autodetachobserver.js | 101 +- .../rx/src/core/backpressure/controlled.js | 116 + .../core/backpressure/controlledobservable.js | 22 - .../core/backpressure/controlledsubject.js | 126 - .../rx/src/core/backpressure/pausable.js | 6 +- .../src/core/backpressure/pausablebuffered.js | 282 +- .../rx/src/core/backpressure/pauser.js | 22 + .../rx/src/core/backpressure/stopandawait.js | 8 - .../rx/src/core/backpressure/stopandwait.js | 73 + .../backpressure/stopandwaitobservable.js | 71 - .../rx/src/core/backpressure/windowed.js | 90 +- .../core/backpressure/windowedobservable.js | 78 - .../rx/src/core/checkedobserver.js | 78 +- .../rx/src/core/concurrency/catchscheduler.js | 128 +- .../currentthreadscheduler-lite.js | 60 - .../concurrency/currentthreadscheduler.js | 98 +- .../core/concurrency/immediatescheduler.js | 24 +- .../rx/src/core/concurrency/scheduleditem.js | 40 +- .../concurrency/scheduleperiodicrecursive.js | 48 +- .../rx/src/core/concurrency/scheduler.js | 48 - .../core/concurrency/scheduler.periodic.js | 2 +- .../core/concurrency/scheduler.recursive.js | 238 +- .../src/core/concurrency/timeoutscheduler.js | 316 +- .../core/concurrency/virtualtimescheduler.js | 16 +- .../src/core/disposables/booleandisposable.js | 91 +- .../core/disposables/compositedisposable.js | 139 +- .../rx/src/core/disposables/disposable.js | 71 +- .../core/disposables/refcountdisposable.js | 118 +- .../core/disposables/scheduleddisposable.js | 31 +- .../node_modules/rx/src/core/enumerable.js | 171 + .../rx/src/core/{internal => }/enumerator.js | 0 .../node_modules/rx/src/core/exports.js | 17 - .../rx/src/core/expressions/compiler.ts | 983 + .../core/{ => headers}/aggregatesheader.js | 40 +- .../rx/src/core/headers}/asyncheader.js | 26 +- .../rx/src/core/{ => headers}/asyncintro.js | 0 .../src/core/headers}/backpressureheader.js | 8 +- .../src/core/headers}/basicheader-modern.js | 68 +- .../rx/src/core/headers}/basicheader.js | 70 +- .../src/core/{ => headers}/bindingheader.js | 42 +- .../core/{ => headers}/coincidenceheader.js | 36 +- .../core/{ => headers}/enumeratorheader.js | 30 +- .../core/{ => headers}/experimentalheader.js | 8 +- .../rx/src/core/headers/exports.js | 17 + .../rx/src/core/{ => headers}/intro.js | 2 +- .../rx/src/core/headers/joinpatternsheader.js | 16 + .../rx/src/core/{ => headers}/license.js | 0 .../core/{ => headers}/liteextrasheader.js | 64 +- .../rx/src/core/headers}/liteheader-compat.js | 72 +- .../rx/src/core/{ => headers}/liteheader.js | 72 +- .../rx/src/core/{ => headers}/outro.js | 0 .../rx/src/core/headers/sortingheader.js | 6 + .../rx/src/core/{ => headers}/subintro.js | 0 .../rx/src/core/{ => headers}/suboutro.js | 0 .../rx/src/core/headers/testheader.js | 12 + .../rx/src/core/headers/testintro.js | 32 + .../rx/src/core/{ => headers}/timeheader.js | 43 +- .../core/{ => headers}/virtualtimeheader.js | 3 +- .../rx/src/core/internal/bindcallback.js | 25 + .../rx/src/core/internal/deprecate.js | 4 + .../rx/src/core/internal/dictionary.js | 494 +- .../rx/src/core/internal/dontenums.js | 9 + .../rx/src/core/internal/enumerable.js | 134 - .../rx/src/core/internal/errors.js | 37 + .../rx/src/core/internal/isequal.js | 555 +- .../rx/src/core/internal/objecttypes.js | 9 - .../rx/src/core/internal/polyfills.js | 88 +- .../rx/src/core/internal/priorityqueue.js | 170 +- .../rx/src/core/internal/trycatch.js | 18 + .../node_modules/rx/src/core/internal/util.js | 71 +- .../rx/src/core/joinpatternsheader.js | 24 - .../rx/src/core/joins/joinobserver.js | 110 +- .../rx/src/core/linq/connectableobservable.js | 2 +- .../linq/observable/_elementatordefault.js | 39 +- .../rx/src/core/linq/observable/_extremaby.js | 14 +- .../rx/src/core/linq/observable/_findvalue.js | 47 +- .../rx/src/core/linq/observable/_firstonly.js | 10 +- .../core/linq/observable/_firstordefault.js | 30 +- .../core/linq/observable/_lastordefault.js | 32 +- .../_observabletimerdateandperiod.js | 28 +- .../core/linq/observable/_singleordefault.js | 14 +- .../rx/src/core/linq/observable/aggregate.js | 64 +- .../rx/src/core/linq/observable/all.js | 16 - .../rx/src/core/linq/observable/amb.js | 41 +- .../rx/src/core/linq/observable/any.js | 22 - .../src/core/linq/observable/asobservable.js | 3 +- .../rx/src/core/linq/observable/average.js | 46 +- ...meourcount.js => bufferwithtimeorcount.js} | 34 +- .../rx/src/core/linq/observable/catch.js | 22 +- .../rx/src/core/linq/observable/catchproto.js | 70 +- .../linq/observable/combinedsynchronized.js | 26 + .../src/core/linq/observable/combinelatest.js | 124 +- .../linq/observable/combinelatestproto.js | 37 +- .../rx/src/core/linq/observable/concat.js | 23 +- .../rx/src/core/linq/observable/concatall.js | 7 + .../rx/src/core/linq/observable/concatmap.js | 86 +- .../core/linq/observable/concatmapobserver.js | 14 +- .../core/linq/observable/concatobservable.js | 7 - .../src/core/linq/observable/concatproto.js | 22 +- .../rx/src/core/linq/observable/count.js | 30 +- .../rx/src/core/linq/observable/create.js | 6 +- .../observable/{throttle.js => debounce.js} | 93 +- ...ithselector.js => debouncewithselector.js} | 107 +- .../core/linq/observable/defaultifempty.js | 28 +- .../rx/src/core/linq/observable/delay.js | 2 +- .../core/linq/observable/delaywithselector.js | 116 +- .../src/core/linq/observable/dematerialize.js | 22 +- .../rx/src/core/linq/observable/distinct.js | 11 +- .../linq/observable/distinctuntilchanged.js | 83 +- .../rx/src/core/linq/observable/do.js | 149 +- .../rx/src/core/linq/observable/dowhile.js | 20 +- .../rx/src/core/linq/observable/elementat.js | 20 +- .../linq/observable/elementatordefault.js | 24 +- .../rx/src/core/linq/observable/every.js | 15 + .../rx/src/core/linq/observable/exclusive.js | 2 +- .../src/core/linq/observable/exclusivemap.js | 11 +- .../rx/src/core/linq/observable/expand.js | 6 +- .../rx/src/core/linq/observable/finally.js | 63 +- .../rx/src/core/linq/observable/finalvalue.js | 17 - .../rx/src/core/linq/observable/find.js | 18 +- .../rx/src/core/linq/observable/findindex.js | 20 +- .../rx/src/core/linq/observable/first.js | 28 +- .../core/linq/observable/firstordefault.js | 29 +- .../observable/flatmapwithconcurrencylimit.js | 87 +- .../rx/src/core/linq/observable/forkjoin.js | 125 +- .../src/core/linq/observable/forkjoinproto.js | 157 +- .../rx/src/core/linq/observable/from.js | 217 +- .../rx/src/core/linq/observable/fromarray.js | 43 +- .../src/core/linq/observable/fromcallback.js | 81 +- .../core/linq/observable/fromevent-modern.js | 184 +- .../rx/src/core/linq/observable/fromevent.js | 320 +- .../core/linq/observable/fromeventpattern.js | 3 +- .../core/linq/observable/fromnodecallback.js | 89 +- .../src/core/linq/observable/frompromise.js | 6 +- .../src/core/linq/observable/groupbyuntil.js | 2 +- .../rx/src/core/linq/observable/groupjoin.js | 2 +- .../core/linq/observable/ignoreelements.js | 6 +- .../observable/{contains.js => includes.js} | 74 +- .../rx/src/core/linq/observable/indexof.js | 62 +- .../rx/src/core/linq/observable/join.js | 206 +- .../src/core/linq/observable/jortsortuntil.js | 2 +- .../rx/src/core/linq/observable/last.js | 25 +- .../src/core/linq/observable/lastordefault.js | 29 +- .../rx/src/core/linq/observable/let.js | 20 +- .../rx/src/core/linq/observable/manyselect.js | 134 +- .../src/core/linq/observable/materialize.js | 2 +- .../rx/src/core/linq/observable/max.js | 24 +- .../rx/src/core/linq/observable/maxby.js | 26 +- .../rx/src/core/linq/observable/merge.js | 50 +- .../{mergeobservable.js => mergeall.js} | 14 +- .../core/linq/observable/mergedelayerror.js | 80 + .../rx/src/core/linq/observable/mergeproto.js | 12 +- .../rx/src/core/linq/observable/min.js | 24 +- .../rx/src/core/linq/observable/minby.js | 28 +- .../rx/src/core/linq/observable/multicast.js | 2 +- .../rx/src/core/linq/observable/observeon.js | 2 +- .../rx/src/core/linq/observable/of.js | 59 +- .../core/linq/observable/ofarraychanges.js | 22 + .../core/linq/observable/ofobjectchanges.js | 22 + .../core/linq/observable/onerrorresumenext.js | 59 +- .../rx/src/core/linq/observable/pairs.js | 21 + .../rx/src/core/linq/observable/pairwise.js | 2 +- .../rx/src/core/linq/observable/partition.js | 5 +- .../rx/src/core/linq/observable/pluck.js | 30 +- .../rx/src/core/linq/observable/reduce.js | 55 +- .../src/core/linq/observable/repeatproto.js | 20 +- .../rx/src/core/linq/observable/retry.js | 26 +- .../rx/src/core/linq/observable/retrywhen.js | 13 + .../rx/src/core/linq/observable/return.js | 42 +- .../rx/src/core/linq/observable/sample.js | 85 +- .../rx/src/core/linq/observable/scan.js | 14 +- .../rx/src/core/linq/observable/select.js | 44 +- .../rx/src/core/linq/observable/selectmany.js | 87 +- .../linq/observable/selectmanyobserver.js | 2 +- .../src/core/linq/observable/sequenceequal.js | 198 +- .../rx/src/core/linq/observable/share.js | 4 - .../rx/src/core/linq/observable/sharevalue.js | 4 - .../rx/src/core/linq/observable/single.js | 3 - .../core/linq/observable/singleinstance.js | 20 + .../core/linq/observable/singleordefault.js | 2 +- .../rx/src/core/linq/observable/skip.js | 24 +- .../rx/src/core/linq/observable/skiplast.js | 9 +- .../core/linq/observable/skiplastwithtime.js | 12 +- .../rx/src/core/linq/observable/skipuntil.js | 12 +- .../core/linq/observable/skipuntilwithtime.js | 9 +- .../rx/src/core/linq/observable/skipwhile.js | 15 +- .../src/core/linq/observable/skipwithtime.js | 2 +- .../rx/src/core/linq/observable/some.js | 25 + .../rx/src/core/linq/observable/spawn.js | 421 +- .../rx/src/core/linq/observable/startwith.js | 38 +- .../src/core/linq/observable/subscribeon.js | 2 +- .../rx/src/core/linq/observable/sum.js | 27 +- .../rx/src/core/linq/observable/switch.js | 4 +- .../rx/src/core/linq/observable/take.js | 24 +- .../rx/src/core/linq/observable/takelast.js | 43 +- .../core/linq/observable/takelastbuffer.js | 10 +- .../linq/observable/takelastbufferwithtime.js | 12 +- .../core/linq/observable/takelastwithtime.js | 10 +- .../rx/src/core/linq/observable/takeuntil.js | 8 +- .../core/linq/observable/takeuntilwithtime.js | 8 +- .../rx/src/core/linq/observable/takewhile.js | 19 +- .../src/core/linq/observable/takewithtime.js | 6 +- .../rx/src/core/linq/observable/thendo.js} | 18 +- .../src/core/linq/observable/throttlefirst.js | 24 + .../rx/src/core/linq/observable/throw.js | 12 +- .../rx/src/core/linq/observable/timeout.js | 4 +- .../linq/observable/timeoutwithselector.js | 136 +- .../rx/src/core/linq/observable/toarray.js | 14 +- .../rx/src/core/linq/observable/toasync.js | 6 - .../rx/src/core/linq/observable/tomap.js | 81 +- .../rx/src/core/linq/observable/topromise.js | 2 +- .../rx/src/core/linq/observable/toset.js | 37 +- .../rx/src/core/linq/observable/transduce.js | 37 + .../rx/src/core/linq/observable/when.js | 84 +- .../rx/src/core/linq/observable/where.js | 52 +- .../rx/src/core/linq/observable/window.js | 210 +- .../core/linq/observable/windowwithcount.js | 104 +- .../core/linq/observable/windowwithtime.js | 158 +- .../linq/observable/windowwithtimeorcount.js | 120 +- .../core/linq/observable/withlatestfrom.js | 64 + .../rx/src/core/linq/observable/zip.js | 22 +- .../rx/src/core/linq/observable/ziparray.js | 103 +- .../rx/src/core/linq/observable/zipproto.js | 167 +- .../core/longstacktraces/longstackbegin.js | 10 + .../src/core/longstacktraces/longstackend.js | 2 + .../core/longstacktraces/longstacktraces.js | 84 + .../node_modules/rx/src/core/notification.js | 197 +- .../node_modules/rx/src/core/observable.js | 136 +- .../rx/src/core/observeonobserver.js | 55 +- .../rx/src/core/observer-extras.js | 38 + .../node_modules/rx/src/core/observer-lite.js | 32 - .../node_modules/rx/src/core/observer.js | 142 +- .../rx/src/core/perf/observablebase.js | 37 + .../src/core/perf/operators/combinelatest.js | 92 + .../perf/operators/distinctuntilchanged.js | 81 + .../rx/src/core/perf/operators/filter.js | 64 + .../rx/src/core/perf/operators/from.js | 164 + .../rx/src/core/perf/operators/fromarray.js | 10 + .../perf/operators/fromarrayobservable.js | 34 + .../rx/src/core/perf/operators/map.js | 73 + .../rx/src/core/perf/operators/mergeall.js | 102 + .../rx/src/core/perf/operators/mergeproto.js | 125 + .../rx/src/core/perf/operators/of.js | 25 + .../rx/src/core/perf/operators/range.js | 51 + .../rx/src/core/perf/operators/reduce.js | 70 + .../rx/src/core/perf/operators/scan.js | 76 + .../rx/src/core/perf/operators/switch.js | 76 + .../rx/src/core/perf/operators/tap.js | 103 + .../rx/src/core/perf/operators/toarray.js | 51 + .../node_modules/rx/src/core/polyfills.js | 123 - .../rx/src/core/scheduledobserver.js | 130 +- .../rx/src/core/subjects/anonymoussubject.js | 50 +- .../rx/src/core/subjects/asyncsubject.js | 241 +- .../rx/src/core/subjects/behaviorsubject.js | 195 +- .../rx/src/core/subjects/innersubscription.js | 27 +- .../rx/src/core/subjects/replaysubject.js | 275 +- .../rx/src/core/subjects/subject.js | 208 +- .../node_modules/rx/src/core/testheader.js | 19 - .../rx/src/core/testing/coldobservable.js | 65 +- .../rx/src/core/testing/hotobservable.js | 87 +- .../rx/src/core/testing/mockdisposable.js | 23 +- .../rx/src/core/testing/mockobserver.js | 55 +- .../rx/src/core/testing/mockpromise.js | 54 + .../rx/src/core/testing/reactivetest.js | 162 +- .../rx/src/core/testing/testscheduler.js | 300 +- .../node_modules/rx/src/core/testintro.js | 32 - .../inquirer/node_modules/rx/travis.sh | 118 +- .../inquirer/node_modules/rx/ts/rx-lite.d.ts | 1255 +- .../inquirer/node_modules/rx/ts/rx.all.d.ts | 20 + .../inquirer/node_modules/rx/ts/rx.all.ts | 20 - .../node_modules/rx/ts/rx.async-lite.d.ts | 137 +- .../rx/ts/rx.backpressure-lite.d.ts | 97 +- .../node_modules/rx/ts/rx.backpressure.d.ts | 22 +- .../inquirer/node_modules/rx/ts/rx.d.ts | 169 +- .../node_modules/rx/ts/rx.joinpatterns.d.ts | 120 +- .../inquirer/node_modules/rx/ts/rx.lite.d.ts | 65 +- .../node_modules/rx/ts/rx.testing.d.ts | 126 +- .../node_modules/rx/ts/rx.time-lite.d.ts | 99 +- .../inquirer/node_modules/rx/ts/rx.time.d.ts | 96 +- .../node_modules/rx/ts/rx.virtualtime.d.ts | 80 +- .../bower/node_modules/inquirer/package.json | 3 +- .../node_modules/escape-string-regexp/license | 21 + .../escape-string-regexp/package.json | 37 +- .../node_modules/ansi-regex/package.json | 2 +- .../node_modules/ansi-regex/package.json | 2 +- .../node_modules/configstore/index.js} | 7 +- .../configstore/node_modules/.bin/user-home | 1 + .../js-yaml/{HISTORY.md => CHANGELOG.md} | 71 + .../configstore/node_modules/js-yaml/LICENSE | 2 +- .../node_modules/js-yaml/README.md | 9 +- .../node_modules/js-yaml/bin/js-yaml.js | 24 +- .../node_modules/js-yaml/bower.json | 4 +- .../node_modules/js-yaml/dist/js-yaml.js | 3666 ++ .../node_modules/js-yaml/dist/js-yaml.min.js | 3 + .../js-yaml/examples/custom_types.js | 68 +- .../js-yaml/examples/custom_types.yml} | 2 +- .../js-yaml/examples/sample_document.js | 2 +- ...mple_document.yaml => sample_document.yml} | 0 .../configstore/node_modules/js-yaml/index.js | 8 - .../node_modules/js-yaml/index_browser.js | 7 - .../js-yaml/lib/js-yaml/common.js | 16 +- .../js-yaml/lib/js-yaml/dumper.js | 139 +- .../js-yaml/lib/js-yaml/loader.js | 912 +- .../node_modules/js-yaml/lib/js-yaml/type.js | 44 +- .../js-yaml/lib/js-yaml/type/binary.js | 182 +- .../js-yaml/lib/js-yaml/type/bool.js | 66 +- .../js-yaml/lib/js-yaml/type/float.js | 52 +- .../js-yaml/lib/js-yaml/type/int.js | 176 +- .../js-yaml/lib/js-yaml/type/js/function.js | 58 +- .../js-yaml/lib/js-yaml/type/js/regexp.js | 60 +- .../js-yaml/lib/js-yaml/type/js/undefined.js | 21 +- .../js-yaml/lib/js-yaml/type/map.js | 5 +- .../js-yaml/lib/js-yaml/type/merge.js | 11 +- .../js-yaml/lib/js-yaml/type/null.js | 36 +- .../js-yaml/lib/js-yaml/type/omap.js | 17 +- .../js-yaml/lib/js-yaml/type/pairs.js | 35 +- .../js-yaml/lib/js-yaml/type/seq.js | 5 +- .../js-yaml/lib/js-yaml/type/set.js | 17 +- .../js-yaml/lib/js-yaml/type/str.js | 5 +- .../js-yaml/lib/js-yaml/type/timestamp.js | 45 +- .../node_modules/argparse/CHANGELOG.md} | 21 + .../js-yaml/node_modules/argparse/README.md | 12 +- .../argparse/examples/testformatters.js | 4 +- .../argparse/lib/action/subparsers.js | 2 +- .../argparse/lib/action_container.js | 8 +- .../argparse/lib/argument_parser.js | 41 +- .../argparse/lib/help/added_formatters.js | 6 +- .../argparse/lib/help/formatter.js | 53 +- .../node_modules/argparse/lib/namespace.js | 2 +- .../argparse/node_modules/lodash/LICENSE.txt | 22 + .../argparse/node_modules/lodash/README.md | 118 + .../argparse/node_modules/lodash/array.js | 42 + .../node_modules/lodash/array/chunk.js | 47 + .../node_modules/lodash/array/compact.js | 30 + .../node_modules/lodash/array/difference.js | 39 + .../node_modules/lodash/array/drop.js | 39 + .../node_modules/lodash/array/dropRight.js | 40 + .../lodash/array/dropRightWhile.js | 61 + .../node_modules/lodash/array/dropWhile.js | 62 + .../node_modules/lodash/array/fill.js | 29 + .../node_modules/lodash/array/findIndex.js | 63 + .../lodash/array/findLastIndex.js | 61 + .../node_modules/lodash/array/first.js | 22 + .../node_modules/lodash/array/flatten.js | 32 + .../node_modules/lodash/array/flattenDeep.js | 21 + .../node_modules/lodash/array/head.js | 1 + .../node_modules/lodash/array/indexOf.js | 55 + .../node_modules/lodash/array/initial.js | 20 + .../node_modules/lodash/array/intersection.js | 68 + .../node_modules/lodash/array/last.js | 19 + .../node_modules/lodash/array/lastIndexOf.js | 57 + .../node_modules/lodash/array/object.js | 1 + .../node_modules/lodash/array/pull.js | 52 + .../node_modules/lodash/array/pullAt.js | 33 + .../node_modules/lodash/array/remove.js | 64 + .../node_modules/lodash/array/rest.js | 21 + .../node_modules/lodash/array/slice.js | 30 + .../node_modules/lodash/array/sortedIndex.js | 60 + .../lodash/array/sortedLastIndex.js | 32 + .../node_modules/lodash/array/tail.js | 1 + .../node_modules/lodash/array/take.js | 39 + .../node_modules/lodash/array/takeRight.js | 40 + .../lodash/array/takeRightWhile.js | 61 + .../node_modules/lodash/array/takeWhile.js | 62 + .../node_modules/lodash/array/union.js | 27 + .../node_modules/lodash/array/uniq.js | 75 + .../node_modules/lodash/array/unique.js | 1 + .../node_modules/lodash/array/unzip.js | 37 + .../node_modules/lodash/array/without.js | 28 + .../argparse/node_modules/lodash/array/xor.js | 39 + .../argparse/node_modules/lodash/array/zip.js | 28 + .../node_modules/lodash/array/zipObject.js | 39 + .../argparse/node_modules/lodash/chain.js | 15 + .../node_modules/lodash/chain/chain.js | 33 + .../node_modules/lodash/chain/commit.js | 1 + .../node_modules/lodash/chain/lodash.js | 109 + .../node_modules/lodash/chain/plant.js | 1 + .../node_modules/lodash/chain/reverse.js | 1 + .../argparse/node_modules/lodash/chain/run.js | 1 + .../argparse/node_modules/lodash/chain/tap.js | 27 + .../node_modules/lodash/chain/thru.js | 23 + .../node_modules/lodash/chain/toJSON.js | 1 + .../node_modules/lodash/chain/toString.js | 1 + .../node_modules/lodash/chain/value.js | 1 + .../node_modules/lodash/chain/valueOf.js | 1 + .../node_modules/lodash/chain/wrapperChain.js | 32 + .../lodash/chain/wrapperCommit.js | 32 + .../node_modules/lodash/chain/wrapperPlant.js | 43 + .../lodash/chain/wrapperReverse.js | 38 + .../lodash/chain/wrapperToString.js | 17 + .../node_modules/lodash/chain/wrapperValue.js | 20 + .../node_modules/lodash/collection.js | 42 + .../node_modules/lodash/collection/all.js | 1 + .../node_modules/lodash/collection/any.js | 1 + .../node_modules/lodash/collection/at.js | 34 + .../node_modules/lodash/collection/collect.js | 1 + .../lodash/collection/contains.js | 1 + .../node_modules/lodash/collection/countBy.js | 51 + .../node_modules/lodash/collection/detect.js | 1 + .../node_modules/lodash/collection/each.js | 1 + .../lodash/collection/eachRight.js | 1 + .../node_modules/lodash/collection/every.js | 63 + .../node_modules/lodash/collection/filter.js | 60 + .../node_modules/lodash/collection/find.js | 65 + .../lodash/collection/findLast.js | 28 + .../lodash/collection/findWhere.js | 37 + .../node_modules/lodash/collection/foldl.js | 1 + .../node_modules/lodash/collection/foldr.js | 1 + .../node_modules/lodash/collection/forEach.js | 38 + .../lodash/collection/forEachRight.js | 29 + .../node_modules/lodash/collection/groupBy.js | 56 + .../node_modules/lodash/collection/include.js | 1 + .../lodash/collection/includes.js | 61 + .../node_modules/lodash/collection/indexBy.js | 50 + .../node_modules/lodash/collection/inject.js | 1 + .../node_modules/lodash/collection/invoke.js | 30 + .../node_modules/lodash/collection/map.js | 64 + .../node_modules/lodash/collection/max.js | 53 + .../node_modules/lodash/collection/min.js | 53 + .../lodash/collection/partition.js | 61 + .../node_modules/lodash/collection/pluck.js | 31 + .../node_modules/lodash/collection/reduce.js | 46 + .../lodash/collection/reduceRight.js | 31 + .../node_modules/lodash/collection/reject.js | 60 + .../node_modules/lodash/collection/sample.js | 38 + .../node_modules/lodash/collection/select.js | 1 + .../node_modules/lodash/collection/shuffle.js | 36 + .../node_modules/lodash/collection/size.js | 29 + .../node_modules/lodash/collection/some.js | 64 + .../node_modules/lodash/collection/sortBy.js | 68 + .../lodash/collection/sortByAll.js | 53 + .../node_modules/lodash/collection/where.js | 37 + .../argparse/node_modules/lodash/date.js | 3 + .../argparse/node_modules/lodash/date/now.js | 22 + .../argparse/node_modules/lodash/function.js | 26 + .../node_modules/lodash/function/after.js | 48 + .../node_modules/lodash/function/ary.js | 34 + .../node_modules/lodash/function/backflow.js | 1 + .../node_modules/lodash/function/before.js | 41 + .../node_modules/lodash/function/bind.js | 58 + .../node_modules/lodash/function/bindAll.js | 39 + .../node_modules/lodash/function/bindKey.js | 68 + .../node_modules/lodash/function/compose.js | 1 + .../node_modules/lodash/function/curry.js | 59 + .../lodash/function/curryRight.js | 56 + .../node_modules/lodash/function/debounce.js | 186 + .../node_modules/lodash/function/defer.js | 22 + .../node_modules/lodash/function/delay.js | 23 + .../node_modules/lodash/function/flow.js | 52 + .../node_modules/lodash/function/flowRight.js | 52 + .../node_modules/lodash/function/memoize.js | 81 + .../node_modules/lodash/function/negate.js | 32 + .../node_modules/lodash/function/once.js | 24 + .../node_modules/lodash/function/partial.js | 50 + .../lodash/function/partialRight.js | 49 + .../node_modules/lodash/function/rearg.js | 38 + .../node_modules/lodash/function/spread.js | 45 + .../node_modules/lodash/function/throttle.js | 71 + .../node_modules/lodash/function/wrap.js | 33 + .../argparse/node_modules/lodash/index.js | 11242 ++++++ .../lodash/internal/LazyWrapper.js | 21 + .../lodash/internal/LodashWrapper.js | 15 + .../node_modules/lodash/internal/MapCache.js | 24 + .../node_modules/lodash/internal/SetCache.js | 29 + .../node_modules/lodash/internal/arrayCopy.js | 20 + .../node_modules/lodash/internal/arrayEach.js | 22 + .../lodash/internal/arrayEachRight.js | 21 + .../lodash/internal/arrayEvery.js | 23 + .../lodash/internal/arrayFilter.js | 25 + .../node_modules/lodash/internal/arrayMap.js | 21 + .../node_modules/lodash/internal/arrayMax.js | 25 + .../node_modules/lodash/internal/arrayMin.js | 25 + .../lodash/internal/arrayReduce.js | 26 + .../lodash/internal/arrayReduceRight.js | 24 + .../node_modules/lodash/internal/arraySome.js | 23 + .../lodash/internal/assignDefaults.js | 13 + .../lodash/internal/assignOwnDefaults.js | 26 + .../lodash/internal/baseAssign.js | 35 + .../node_modules/lodash/internal/baseAt.js | 32 + .../lodash/internal/baseBindAll.js | 26 + .../lodash/internal/baseCallback.js | 36 + .../node_modules/lodash/internal/baseClone.js | 130 + .../lodash/internal/baseCompareAscending.js | 25 + .../node_modules/lodash/internal/baseCopy.js | 25 + .../lodash/internal/baseCreate.js | 23 + .../node_modules/lodash/internal/baseDelay.js | 23 + .../lodash/internal/baseDifference.js | 52 + .../node_modules/lodash/internal/baseEach.js | 30 + .../lodash/internal/baseEachRight.js | 28 + .../node_modules/lodash/internal/baseEvery.js | 22 + .../node_modules/lodash/internal/baseFill.js | 31 + .../lodash/internal/baseFilter.js | 22 + .../node_modules/lodash/internal/baseFind.js | 25 + .../lodash/internal/baseFlatten.js | 45 + .../node_modules/lodash/internal/baseFor.js | 30 + .../node_modules/lodash/internal/baseForIn.js | 17 + .../lodash/internal/baseForOwn.js | 17 + .../lodash/internal/baseForOwnRight.js | 17 + .../lodash/internal/baseForRight.js | 27 + .../lodash/internal/baseFunctions.js | 27 + .../lodash/internal/baseIndexOf.js | 27 + .../lodash/internal/baseInvoke.js | 28 + .../lodash/internal/baseIsEqual.js | 34 + .../lodash/internal/baseIsEqualDeep.js | 101 + .../lodash/internal/baseIsMatch.js | 58 + .../node_modules/lodash/internal/baseMap.js | 20 + .../lodash/internal/baseMatches.js | 45 + .../lodash/internal/baseMatchesProperty.js | 24 + .../node_modules/lodash/internal/baseMerge.js | 45 + .../lodash/internal/baseMergeDeep.js | 67 + .../lodash/internal/baseProperty.js | 14 + .../lodash/internal/basePullAt.js | 35 + .../lodash/internal/baseRandom.js | 20 + .../lodash/internal/baseReduce.js | 24 + .../lodash/internal/baseSetData.js | 17 + .../node_modules/lodash/internal/baseSlice.js | 32 + .../node_modules/lodash/internal/baseSome.js | 23 + .../lodash/internal/baseSortBy.js | 21 + .../lodash/internal/baseToString.js | 16 + .../node_modules/lodash/internal/baseUniq.js | 57 + .../lodash/internal/baseValues.js | 22 + .../lodash/internal/baseWrapperValue.js | 37 + .../lodash/internal/binaryIndex.js | 40 + .../lodash/internal/binaryIndexBy.js | 54 + .../lodash/internal/bindCallback.js | 39 + .../lodash/internal/bufferClone.js | 55 + .../lodash/internal/cacheIndexOf.js | 19 + .../node_modules/lodash/internal/cachePush.js | 20 + .../lodash/internal/charAtCallback.js | 12 + .../lodash/internal/charsLeftIndex.js | 18 + .../lodash/internal/charsRightIndex.js | 17 + .../lodash/internal/compareAscending.js | 16 + .../internal/compareMultipleAscending.js | 34 + .../lodash/internal/composeArgs.js | 34 + .../lodash/internal/composeArgsRight.js | 36 + .../lodash/internal/createAggregator.js | 37 + .../lodash/internal/createAssigner.js | 40 + .../lodash/internal/createBindWrapper.js | 21 + .../lodash/internal/createCache.js | 22 + .../lodash/internal/createCompounder.js | 26 + .../lodash/internal/createCtorWrapper.js | 23 + .../lodash/internal/createExtremum.js | 38 + .../lodash/internal/createHybridWrapper.js | 104 + .../node_modules/lodash/internal/createPad.js | 32 + .../lodash/internal/createPartialWrapper.js | 42 + .../lodash/internal/createWrapper.js | 86 + .../lodash/internal/deburrLetter.js | 33 + .../lodash/internal/equalArrays.js | 54 + .../lodash/internal/equalByTag.js | 49 + .../lodash/internal/equalObjects.js | 72 + .../lodash/internal/escapeHtmlChar.js | 22 + .../lodash/internal/escapeStringChar.js | 23 + .../lodash/internal/extremumBy.js | 34 + .../node_modules/lodash/internal/getData.js | 15 + .../node_modules/lodash/internal/getView.js | 33 + .../lodash/internal/indexOfNaN.js | 24 + .../lodash/internal/initCloneArray.js | 26 + .../lodash/internal/initCloneByTag.js | 64 + .../lodash/internal/initCloneObject.js | 16 + .../lodash/internal/isBindable.js | 38 + .../node_modules/lodash/internal/isIndex.js | 22 + .../lodash/internal/isIterateeCall.js | 28 + .../node_modules/lodash/internal/isLength.js | 23 + .../lodash/internal/isObjectLike.js | 12 + .../node_modules/lodash/internal/isSpace.js | 14 + .../lodash/internal/isStrictComparable.js | 15 + .../node_modules/lodash/internal/lazyClone.js | 28 + .../lodash/internal/lazyReverse.js | 23 + .../node_modules/lodash/internal/lazyValue.js | 71 + .../node_modules/lodash/internal/mapDelete.js | 14 + .../node_modules/lodash/internal/mapGet.js | 14 + .../node_modules/lodash/internal/mapHas.js | 20 + .../node_modules/lodash/internal/mapSet.js | 18 + .../node_modules/lodash/internal/mergeData.js | 99 + .../node_modules/lodash/internal/metaMap.js | 9 + .../lodash/internal/pickByArray.js | 28 + .../lodash/internal/pickByCallback.js | 22 + .../node_modules/lodash/internal/reEscape.js | 4 + .../lodash/internal/reEvaluate.js | 4 + .../lodash/internal/reInterpolate.js | 4 + .../node_modules/lodash/internal/reorder.js | 29 + .../lodash/internal/replaceHolders.js | 28 + .../node_modules/lodash/internal/setData.js | 41 + .../lodash/internal/shimIsPlainObject.js | 51 + .../node_modules/lodash/internal/shimKeys.js | 42 + .../lodash/internal/sortedUniq.js | 29 + .../lodash/internal/toIterable.js | 22 + .../node_modules/lodash/internal/toObject.js | 14 + .../lodash/internal/trimmedLeftIndex.js | 19 + .../lodash/internal/trimmedRightIndex.js | 18 + .../lodash/internal/unescapeHtmlChar.js | 22 + .../lodash/internal/wrapperClone.js | 18 + .../argparse/node_modules/lodash/lang.js | 27 + .../node_modules/lodash/lang/clone.js | 65 + .../node_modules/lodash/lang/cloneDeep.js | 52 + .../node_modules/lodash/lang/isArguments.js | 38 + .../node_modules/lodash/lang/isArray.js | 41 + .../node_modules/lodash/lang/isBoolean.js | 36 + .../node_modules/lodash/lang/isDate.js | 36 + .../node_modules/lodash/lang/isElement.js | 42 + .../node_modules/lodash/lang/isEmpty.js | 48 + .../node_modules/lodash/lang/isEqual.js | 55 + .../node_modules/lodash/lang/isError.js | 37 + .../node_modules/lodash/lang/isFinite.js | 40 + .../node_modules/lodash/lang/isFunction.js | 50 + .../node_modules/lodash/lang/isMatch.js | 74 + .../node_modules/lodash/lang/isNaN.js | 35 + .../node_modules/lodash/lang/isNative.js | 55 + .../node_modules/lodash/lang/isNull.js | 21 + .../node_modules/lodash/lang/isNumber.js | 42 + .../node_modules/lodash/lang/isObject.js | 30 + .../node_modules/lodash/lang/isPlainObject.js | 62 + .../node_modules/lodash/lang/isRegExp.js | 36 + .../node_modules/lodash/lang/isString.js | 36 + .../node_modules/lodash/lang/isTypedArray.js | 75 + .../node_modules/lodash/lang/isUndefined.js | 21 + .../node_modules/lodash/lang/toArray.js | 29 + .../node_modules/lodash/lang/toPlainObject.js | 31 + .../argparse/node_modules/lodash/number.js | 3 + .../node_modules/lodash/number/random.js | 70 + .../argparse/node_modules/lodash/object.js | 27 + .../node_modules/lodash/object/assign.js | 35 + .../node_modules/lodash/object/create.js | 46 + .../node_modules/lodash/object/defaults.js | 30 + .../node_modules/lodash/object/extend.js | 1 + .../node_modules/lodash/object/findKey.js | 57 + .../node_modules/lodash/object/findLastKey.js | 57 + .../node_modules/lodash/object/forIn.js | 39 + .../node_modules/lodash/object/forInRight.js | 35 + .../node_modules/lodash/object/forOwn.js | 31 + .../node_modules/lodash/object/forOwnRight.js | 28 + .../node_modules/lodash/object/functions.js | 23 + .../node_modules/lodash/object/has.js | 26 + .../node_modules/lodash/object/invert.js | 62 + .../node_modules/lodash/object/keys.js | 48 + .../node_modules/lodash/object/keysIn.js | 65 + .../node_modules/lodash/object/mapValues.js | 54 + .../node_modules/lodash/object/merge.js | 52 + .../node_modules/lodash/object/methods.js | 1 + .../node_modules/lodash/object/omit.js | 51 + .../node_modules/lodash/object/pairs.js | 30 + .../node_modules/lodash/object/pick.js | 41 + .../node_modules/lodash/object/result.js | 41 + .../node_modules/lodash/object/transform.js | 63 + .../node_modules/lodash/object/values.js | 33 + .../node_modules/lodash/object/valuesIn.js | 31 + .../argparse/node_modules/lodash/package.json | 94 + .../argparse/node_modules/lodash/string.js | 25 + .../node_modules/lodash/string/camelCase.js | 28 + .../node_modules/lodash/string/capitalize.js | 21 + .../node_modules/lodash/string/deburr.js | 27 + .../node_modules/lodash/string/endsWith.js | 36 + .../node_modules/lodash/string/escape.js | 48 + .../lodash/string/escapeRegExp.js | 32 + .../node_modules/lodash/string/kebabCase.js | 28 + .../node_modules/lodash/string/pad.js | 50 + .../node_modules/lodash/string/padLeft.js | 32 + .../node_modules/lodash/string/padRight.js | 32 + .../node_modules/lodash/string/parseInt.js | 67 + .../node_modules/lodash/string/repeat.js | 49 + .../node_modules/lodash/string/snakeCase.js | 27 + .../node_modules/lodash/string/startCase.js | 28 + .../node_modules/lodash/string/startsWith.js | 33 + .../node_modules/lodash/string/template.js | 229 + .../lodash/string/templateSettings.js | 67 + .../node_modules/lodash/string/trim.js | 42 + .../node_modules/lodash/string/trimLeft.js | 36 + .../node_modules/lodash/string/trimRight.js | 36 + .../node_modules/lodash/string/trunc.js | 97 + .../node_modules/lodash/string/unescape.js | 33 + .../node_modules/lodash/string/words.js | 38 + .../argparse/node_modules/lodash/support.js | 75 + .../argparse/node_modules/lodash/utility.js | 16 + .../node_modules/lodash/utility/attempt.js | 32 + .../node_modules/lodash/utility/callback.js | 51 + .../node_modules/lodash/utility/constant.js | 22 + .../node_modules/lodash/utility/identity.js | 19 + .../node_modules/lodash/utility/iteratee.js | 1 + .../node_modules/lodash/utility/matches.js | 33 + .../lodash/utility/matchesProperty.js | 35 + .../node_modules/lodash/utility/mixin.js | 87 + .../node_modules/lodash/utility/noop.js | 17 + .../node_modules/lodash/utility/property.js | 30 + .../node_modules/lodash/utility/propertyOf.js | 26 + .../node_modules/lodash/utility/range.js | 67 + .../node_modules/lodash/utility/times.js | 55 + .../node_modules/lodash/utility/uniqueId.js | 27 + .../node_modules/sprintf-js/.npmignore | 1 + .../argparse/node_modules/sprintf-js/LICENSE | 24 + .../node_modules/sprintf-js/README.md | 82 + .../node_modules/sprintf-js/bower.json | 14 + .../node_modules/sprintf-js/demo/angular.html | 20 + .../sprintf-js/dist/angular-sprintf.min.js | 4 + .../sprintf-js/dist/angular-sprintf.min.map | 1 + .../sprintf-js/dist/sprintf.min.js | 4 + .../sprintf-js/dist/sprintf.min.map | 1 + .../node_modules/sprintf-js/gruntfile.js | 36 + .../node_modules/sprintf-js/package.json | 51 + .../sprintf-js/src/angular-sprintf.js | 18 + .../node_modules/sprintf-js/src/sprintf.js | 195 + .../node_modules/sprintf-js/test/test.js | 72 + .../node_modules/underscore.string/Gemfile | 4 - .../underscore.string/Gemfile.lock | 17 - .../underscore.string/README.markdown | 814 - .../underscore.string/component.json | 11 - .../dist/underscore.string.min.js | 1 - .../lib/underscore.string.js | 673 - .../underscore.string/libpeerconnection.log | 0 .../underscore.string/test/run-qunit.js | 45 - .../underscore.string/test/speed.js | 148 - .../underscore.string/test/strings.js | 685 - .../test/strings_standalone.js | 12 - .../test/test_underscore/arrays.js | 200 - .../test/test_underscore/chaining.js | 59 - .../test/test_underscore/collections.js | 426 - .../test/test_underscore/functions.js | 259 - .../test/test_underscore/index.html | 45 - .../test/test_underscore/objects.js | 548 - .../test/test_underscore/utility.js | 249 - .../test/test_underscore/vendor/jquery.js | 9404 ----- .../test/test_underscore/vendor/qunit.css | 235 - .../test/test_underscore/vendor/qunit.js | 1977 -- .../underscore.string/test/underscore.js | 1201 - .../node_modules/underscore/.npmignore | 4 - .../node_modules/underscore/.travis.yml | 5 - .../argparse/node_modules/underscore/CNAME | 1 - .../node_modules/underscore/CONTRIBUTING.md | 9 - .../argparse/node_modules/underscore/LICENSE | 22 - .../node_modules/underscore/README.md | 19 - .../node_modules/underscore/favicon.ico | Bin 1406 -> 0 bytes .../node_modules/underscore/index.html | 2467 -- .../argparse/node_modules/underscore/index.js | 1 - .../node_modules/underscore/package.json | 52 - .../node_modules/underscore/underscore-min.js | 1 - .../node_modules/underscore/underscore.js | 1226 - .../node_modules/argparse/package.json | 36 +- .../js-yaml/node_modules/esprima/README.md | 71 +- .../node_modules/esprima/bin/esparse.js | 12 +- .../node_modules/esprima/bin/esvalidate.js | 44 +- .../js-yaml/node_modules/esprima/esprima.js | 4274 +-- .../js-yaml/node_modules/esprima/package.json | 52 +- .../node_modules/esprima/test/compat.js | 7 +- .../node_modules/esprima/test/reflect.js | 118 +- .../js-yaml/node_modules/esprima/test/run.js | 3 +- .../node_modules/esprima/test/runner.js | 147 +- .../js-yaml/node_modules/esprima/test/test.js | 28593 +++++++++++----- .../node_modules/js-yaml/package.json | 29 +- .../node_modules/object-assign/index.js | 26 + .../object-assign/object-assign.js | 52 - .../node_modules/object-assign/package.json | 27 +- .../node_modules/object-assign/readme.md | 22 +- .../configstore/node_modules/user-home/cli.js | 26 + .../node_modules/user-home/index.js | 15 + .../node_modules/user-home/license | 21 + .../node_modules/user-home/package.json | 68 + .../node_modules/user-home/readme.md | 42 + .../node_modules/uuid/benchmark/package.json | 4 +- .../node_modules/uuid/buffer-browser.js | 1 - .../configstore/node_modules/uuid/buffer.js | 1 - .../node_modules/uuid/package.json | 19 +- .../configstore/node_modules/uuid/uuid.js | 8 +- .../node_modules/xdg-basedir/index.js | 26 + .../node_modules/xdg-basedir/license | 21 + .../node_modules/xdg-basedir/package.json | 68 + .../node_modules/xdg-basedir/readme.md | 60 + .../node_modules/configstore/package.json | 41 +- .../node_modules/configstore/readme.md | 4 +- .../cli-color/node_modules/es5-ext/.lint | 13 +- .../node_modules/es5-ext/.travis.yml | 2 + .../cli-color/node_modules/es5-ext/CHANGES | 14 + .../cli-color/node_modules/es5-ext/LICENCE | 19 - .../cli-color/node_modules/es5-ext/LICENSE | 19 + .../cli-color/node_modules/es5-ext/README.md | 37 +- .../es5-ext/array/#/e-index-of.js | 4 +- .../es5-ext/array/#/e-last-index-of.js | 4 +- .../node_modules/es5-ext/array/from/shim.js | 8 +- .../node_modules/es5-ext/function/#/index.js | 15 +- .../es5-ext/function/#/to-string-tokens.js | 11 + .../node_modules/es5-ext/math/trunc/shim.js | 4 +- .../node_modules/es6-iterator/.travis.yml | 2 + .../es5-ext/node_modules/es6-iterator/CHANGES | 12 +- .../es5-ext/node_modules/es6-iterator/LICENCE | 19 - .../es5-ext/node_modules/es6-iterator/LICENSE | 19 + .../node_modules/es6-iterator/README.md | 10 +- .../node_modules/es6-iterator/index.js | 6 +- .../node_modules/es6-iterator/package.json | 34 +- .../node_modules/es6-iterator/test/array.js | 6 +- .../node_modules/es6-iterator/test/index.js | 2 +- .../es5-ext/node_modules/es6-symbol/.lint | 4 +- .../es5-ext/node_modules/es6-symbol/CHANGES | 22 + .../es5-ext/node_modules/es6-symbol/LICENCE | 19 - .../es5-ext/node_modules/es6-symbol/LICENSE | 19 + .../es5-ext/node_modules/es6-symbol/README.md | 20 +- .../node_modules/es6-symbol/is-implemented.js | 1 - .../node_modules/es6-symbol/is-symbol.js | 9 +- .../node_modules/es6-symbol/package.json | 26 +- .../node_modules/es6-symbol/polyfill.js | 70 +- .../node_modules/es6-symbol/test/polyfill.js | 10 + .../es6-symbol/test/valid-iterable.js | 14 - .../es6-symbol/test/validate-symbol.js | 19 + .../es6-symbol/validate-symbol.js | 8 + .../es5-ext/number/is-integer/shim.js | 7 +- .../es5-ext/number/is-nan/shim.js | 2 +- .../node_modules/es5-ext/object/compare.js | 6 +- .../node_modules/es5-ext/object/eq.js | 2 +- .../node_modules/es5-ext/object/index.js | 2 + .../node_modules/es5-ext/object/is-empty.js | 2 +- .../node_modules/es5-ext/object/is-object.js | 2 +- .../es5-ext/object/is-plain-object.js | 2 +- .../node_modules/es5-ext/object/is.js | 2 +- .../es5-ext/object/normalize-options.js | 13 +- .../node_modules/es5-ext/object/serialize.js | 36 + .../es5-ext/object/unserialize.js | 7 + .../node_modules/es5-ext/package.json | 32 +- .../es5-ext/string/#/camel-to-hyphen.js | 2 +- .../node_modules/es5-ext/string/index.js | 1 + .../es5-ext/string/random-uniq.js | 11 + .../es5-ext/test/array/from/shim.js | 20 +- .../es5-ext/test/array/of/shim.js | 12 +- .../test/function/#/to-string-tokens.js | 12 + .../es5-ext/test/math/trunc/shim.js | 4 +- .../es5-ext/test/object/is-plain-object.js | 2 +- .../es5-ext/test/object/key-of.js | 2 +- .../es5-ext/test/object/normalize-options.js | 11 +- .../es5-ext/test/object/serialize.js | 25 + .../es5-ext/test/object/unserialize.js | 24 + .../es5-ext/test/object/valid-object.js | 2 +- .../node_modules/es5-ext/test/string/#/at.js | 2 +- .../es5-ext/test/string/#/camel-to-hyphen.js | 2 +- .../test/string/#/code-point-at/shim.js | 4 +- .../es5-ext/test/string/#/hyphen-to-camel.js | 2 +- .../node_modules/es5-ext/test/string/#/pad.js | 4 +- .../es5-ext/test/string/random-uniq.js | 14 + .../node_modules/es6-iterator/.travis.yml | 2 + .../node_modules/es6-iterator/CHANGES | 12 +- .../node_modules/es6-iterator/LICENCE | 19 - .../node_modules/es6-iterator/LICENSE | 19 + .../node_modules/es6-iterator/README.md | 10 +- .../node_modules/es6-iterator/index.js | 6 +- .../node_modules/es6-symbol/.lint | 13 + .../node_modules/es6-symbol/.npmignore | 4 + .../node_modules/es6-symbol/.travis.yml | 9 + .../node_modules/es6-symbol/CHANGES | 34 + .../node_modules/es6-symbol/LICENSE | 19 + .../node_modules/es6-symbol/README.md | 71 + .../node_modules/es6-symbol/implement.js | 7 + .../node_modules/es6-symbol/index.js | 3 + .../node_modules/es6-symbol/is-implemented.js | 18 + .../es6-symbol/is-native-implemented.js | 8 + .../node_modules/es6-symbol/is-symbol.js | 5 + .../node_modules/es6-symbol/package.json | 63 + .../node_modules/es6-symbol/polyfill.js | 77 + .../node_modules/es6-symbol/test/implement.js | 3 + .../node_modules/es6-symbol/test/index.js | 12 + .../es6-symbol/test/is-implemented.js | 14 + .../es6-symbol/test/is-native-implemented.js | 3 + .../node_modules/es6-symbol/test/is-symbol.js | 16 + .../node_modules/es6-symbol/test/polyfill.js | 27 + .../es6-symbol/test/validate-symbol.js | 19 + .../es6-symbol/validate-symbol.js | 8 + .../node_modules/es6-iterator/package.json | 32 +- .../node_modules/es6-iterator/test/array.js | 6 +- .../node_modules/es6-iterator/test/index.js | 2 +- .../node_modules/event-emitter/.travis.yml | 2 + .../node_modules/event-emitter/CHANGES | 8 + .../node_modules/event-emitter/LICENCE | 19 - .../node_modules/event-emitter/LICENSE | 19 + .../node_modules/event-emitter/README.md | 13 +- .../event-emitter/benchmark/many-on.js | 2 +- .../event-emitter/benchmark/single-on.js | 2 +- .../node_modules/event-emitter/package.json | 29 +- .../event-emitter/test/has-listeners.js | 4 +- .../node_modules/event-emitter/test/unify.js | 2 +- .../node_modules/mute-stream/package.json | 5 +- .../node_modules/readline2/.npmignore | 5 - .../inquirer/node_modules/readline2/README.md | 4 +- .../inquirer/node_modules/readline2/index.js | 15 +- .../{chalk/node_modules => }/.bin/strip-ansi | 0 .../readline2/node_modules/chalk/index.js | 63 - .../node_modules/ansi-styles/ansi-styles.js | 38 - .../node_modules/ansi-styles/package.json | 75 - .../chalk/node_modules/ansi-styles/readme.md | 65 - .../chalk/node_modules/has-color/index.js | 32 - .../chalk/node_modules/has-color/package.json | 71 - .../chalk/node_modules/has-color/readme.md | 30 - .../chalk/node_modules/strip-ansi/cli.js | 27 - .../chalk/node_modules/strip-ansi/index.js | 4 - .../chalk/node_modules/strip-ansi/readme.md | 46 - .../readline2/node_modules/chalk/package.json | 78 - .../readline2/node_modules/chalk/readme.md | 158 - .../readline2/node_modules/strip-ansi/cli.js | 47 + .../node_modules/strip-ansi/index.js | 6 + .../node_modules/ansi-regex/index.js | 4 + .../node_modules/ansi-regex/license | 21 + .../node_modules/ansi-regex/package.json | 85 + .../node_modules/ansi-regex/readme.md | 33 + .../node_modules/strip-ansi/package.json | 43 +- .../node_modules/strip-ansi/readme.md | 43 + .../node_modules/readline2/package.json | 42 +- .../inquirer/node_modules/rx/.coveralls.yml | 4 +- .../inquirer/node_modules/rx/.jamignore | 28 +- .../inquirer/node_modules/rx/.jscsrc | 54 + .../inquirer/node_modules/rx/.jscsrc.todo | 19 + .../inquirer/node_modules/rx/authors.txt | 6 +- .../inquirer/node_modules/rx/bower.json | 140 +- .../inquirer/node_modules/rx/component.json | 105 +- .../node_modules/rx/dist/rx.aggregates.js | 1272 +- .../node_modules/rx/dist/rx.aggregates.map | 2 +- .../node_modules/rx/dist/rx.aggregates.min.js | 2 +- .../node_modules/rx/dist/rx.all.compat.js | 15201 ++++---- .../node_modules/rx/dist/rx.all.compat.map | 2 +- .../node_modules/rx/dist/rx.all.compat.min.js | 7 +- .../inquirer/node_modules/rx/dist/rx.all.js | 15097 ++++---- .../inquirer/node_modules/rx/dist/rx.all.map | 2 +- .../node_modules/rx/dist/rx.all.min.js | 7 +- .../node_modules/rx/dist/rx.async.compat.js | 952 +- .../node_modules/rx/dist/rx.async.compat.map | 2 +- .../rx/dist/rx.async.compat.min.js | 2 +- .../inquirer/node_modules/rx/dist/rx.async.js | 816 +- .../node_modules/rx/dist/rx.async.map | 2 +- .../node_modules/rx/dist/rx.async.min.js | 2 +- .../node_modules/rx/dist/rx.backpressure.js | 683 +- .../node_modules/rx/dist/rx.backpressure.map | 2 +- .../rx/dist/rx.backpressure.min.js | 2 +- .../node_modules/rx/dist/rx.binding.js | 551 +- .../node_modules/rx/dist/rx.binding.map | 2 +- .../node_modules/rx/dist/rx.binding.min.js | 2 +- .../node_modules/rx/dist/rx.coincidence.js | 961 +- .../node_modules/rx/dist/rx.coincidence.map | 2 +- .../rx/dist/rx.coincidence.min.js | 2 +- .../node_modules/rx/dist/rx.compat.js | 7657 +++-- .../node_modules/rx/dist/rx.compat.map | 2 +- .../node_modules/rx/dist/rx.compat.min.js | 4 +- .../node_modules/rx/dist/rx.experimental.js | 583 +- .../node_modules/rx/dist/rx.experimental.map | 2 +- .../rx/dist/rx.experimental.min.js | 2 +- .../node_modules/rx/dist/rx.joinpatterns.js | 250 +- .../node_modules/rx/dist/rx.joinpatterns.map | 2 +- .../rx/dist/rx.joinpatterns.min.js | 2 +- .../inquirer/node_modules/rx/dist/rx.js | 7555 ++-- .../node_modules/rx/dist/rx.lite.compat.js | 9999 +++--- .../node_modules/rx/dist/rx.lite.compat.map | 2 +- .../rx/dist/rx.lite.compat.min.js | 5 +- .../node_modules/rx/dist/rx.lite.extras.js | 538 +- .../node_modules/rx/dist/rx.lite.extras.map | 2 +- .../rx/dist/rx.lite.extras.min.js | 2 +- .../inquirer/node_modules/rx/dist/rx.lite.js | 8441 ++--- .../inquirer/node_modules/rx/dist/rx.lite.map | 2 +- .../node_modules/rx/dist/rx.lite.min.js | 4 +- .../inquirer/node_modules/rx/dist/rx.map | 2 +- .../inquirer/node_modules/rx/dist/rx.min.js | 4 +- .../node_modules/rx/dist/rx.sorting.js | 72 + .../node_modules/rx/dist/rx.sorting.map | 1 + .../node_modules/rx/dist/rx.sorting.min.js | 3 + .../node_modules/rx/dist/rx.testing.js | 858 +- .../node_modules/rx/dist/rx.testing.map | 2 +- .../node_modules/rx/dist/rx.testing.min.js | 2 +- .../inquirer/node_modules/rx/dist/rx.time.js | 1006 +- .../inquirer/node_modules/rx/dist/rx.time.map | 2 +- .../node_modules/rx/dist/rx.time.min.js | 2 +- .../node_modules/rx/dist/rx.virtualtime.js | 19 +- .../node_modules/rx/dist/rx.virtualtime.map | 2 +- .../rx/dist/rx.virtualtime.min.js | 2 +- .../inquirer/node_modules/rx/index.js | 403 +- .../inquirer/node_modules/rx/license.txt | 30 +- .../inquirer/node_modules/rx/logos/logo.png | Bin 0 -> 12929 bytes .../inquirer/node_modules/rx/package.json | 19 +- .../inquirer/node_modules/rx/readme.md | 821 +- .../rx/src/core/abstractobserver.js | 5 + .../rx/src/core/anonymousobservable.js | 83 +- .../rx/src/core/autodetachobserver.js | 101 +- .../rx/src/core/backpressure/controlled.js | 116 + .../core/backpressure/controlledobservable.js | 22 - .../core/backpressure/controlledsubject.js | 126 - .../rx/src/core/backpressure/pausable.js | 6 +- .../src/core/backpressure/pausablebuffered.js | 282 +- .../rx/src/core/backpressure/pauser.js | 22 + .../rx/src/core/backpressure/stopandawait.js | 8 - .../rx/src/core/backpressure/stopandwait.js | 73 + .../backpressure/stopandwaitobservable.js | 71 - .../rx/src/core/backpressure/windowed.js | 90 +- .../core/backpressure/windowedobservable.js | 78 - .../rx/src/core/checkedobserver.js | 78 +- .../rx/src/core/concurrency/catchscheduler.js | 128 +- .../currentthreadscheduler-lite.js | 60 - .../concurrency/currentthreadscheduler.js | 98 +- .../core/concurrency/immediatescheduler.js | 24 +- .../rx/src/core/concurrency/scheduleditem.js | 40 +- .../concurrency/scheduleperiodicrecursive.js | 48 +- .../rx/src/core/concurrency/scheduler.js | 48 - .../core/concurrency/scheduler.periodic.js | 2 +- .../core/concurrency/scheduler.recursive.js | 238 +- .../src/core/concurrency/timeoutscheduler.js | 316 +- .../core/concurrency/virtualtimescheduler.js | 16 +- .../src/core/disposables/booleandisposable.js | 91 +- .../core/disposables/compositedisposable.js | 139 +- .../rx/src/core/disposables/disposable.js | 71 +- .../core/disposables/refcountdisposable.js | 118 +- .../core/disposables/scheduleddisposable.js | 31 +- .../node_modules/rx/src/core/enumerable.js | 171 + .../rx/src/core/{internal => }/enumerator.js | 0 .../node_modules/rx/src/core/exports.js | 17 - .../rx/src/core/expressions/compiler.ts | 983 + .../core/{ => headers}/aggregatesheader.js | 40 +- .../rx/src/core/headers}/asyncheader.js | 26 +- .../rx/src/core/{ => headers}/asyncintro.js | 0 .../src/core/headers}/backpressureheader.js | 8 +- .../src/core/headers}/basicheader-modern.js | 68 +- .../rx/src/core/headers}/basicheader.js | 70 +- .../src/core/{ => headers}/bindingheader.js | 42 +- .../core/{ => headers}/coincidenceheader.js | 36 +- .../core/{ => headers}/enumeratorheader.js | 30 +- .../core/{ => headers}/experimentalheader.js | 8 +- .../rx/src/core/headers/exports.js | 17 + .../rx/src/core/{ => headers}/intro.js | 2 +- .../rx/src/core/headers/joinpatternsheader.js | 16 + .../rx/src/core/{ => headers}/license.js | 0 .../core/{ => headers}/liteextrasheader.js | 64 +- .../rx/src/core/headers}/liteheader-compat.js | 72 +- .../rx/src/core/{ => headers}/liteheader.js | 72 +- .../rx/src/core/{ => headers}/outro.js | 0 .../rx/src/core/headers/sortingheader.js | 6 + .../rx/src/core/{ => headers}/subintro.js | 0 .../rx/src/core/{ => headers}/suboutro.js | 0 .../rx/src/core/headers/testheader.js | 12 + .../rx/src/core/headers/testintro.js | 32 + .../rx/src/core/{ => headers}/timeheader.js | 43 +- .../core/{ => headers}/virtualtimeheader.js | 3 +- .../rx/src/core/internal/bindcallback.js | 25 + .../rx/src/core/internal/deprecate.js | 4 + .../rx/src/core/internal/dictionary.js | 494 +- .../rx/src/core/internal/dontenums.js | 9 + .../rx/src/core/internal/enumerable.js | 134 - .../rx/src/core/internal/errors.js | 37 + .../rx/src/core/internal/isequal.js | 555 +- .../rx/src/core/internal/objecttypes.js | 9 - .../rx/src/core/internal/polyfills.js | 88 +- .../rx/src/core/internal/priorityqueue.js | 170 +- .../rx/src/core/internal/trycatch.js | 18 + .../node_modules/rx/src/core/internal/util.js | 71 +- .../rx/src/core/joinpatternsheader.js | 24 - .../rx/src/core/joins/joinobserver.js | 110 +- .../rx/src/core/linq/connectableobservable.js | 2 +- .../linq/observable/_elementatordefault.js | 39 +- .../rx/src/core/linq/observable/_extremaby.js | 14 +- .../rx/src/core/linq/observable/_findvalue.js | 47 +- .../rx/src/core/linq/observable/_firstonly.js | 10 +- .../core/linq/observable/_firstordefault.js | 30 +- .../core/linq/observable/_lastordefault.js | 32 +- .../_observabletimerdateandperiod.js | 28 +- .../core/linq/observable/_singleordefault.js | 14 +- .../rx/src/core/linq/observable/aggregate.js | 64 +- .../rx/src/core/linq/observable/all.js | 16 - .../rx/src/core/linq/observable/amb.js | 41 +- .../rx/src/core/linq/observable/any.js | 22 - .../src/core/linq/observable/asobservable.js | 3 +- .../rx/src/core/linq/observable/average.js | 46 +- ...meourcount.js => bufferwithtimeorcount.js} | 34 +- .../rx/src/core/linq/observable/catch.js | 22 +- .../rx/src/core/linq/observable/catchproto.js | 70 +- .../linq/observable/combinedsynchronized.js | 26 + .../src/core/linq/observable/combinelatest.js | 124 +- .../linq/observable/combinelatestproto.js | 37 +- .../rx/src/core/linq/observable/concat.js | 23 +- .../rx/src/core/linq/observable/concatall.js | 7 + .../rx/src/core/linq/observable/concatmap.js | 86 +- .../core/linq/observable/concatmapobserver.js | 14 +- .../core/linq/observable/concatobservable.js | 7 - .../src/core/linq/observable/concatproto.js | 22 +- .../rx/src/core/linq/observable/count.js | 30 +- .../rx/src/core/linq/observable/create.js | 6 +- .../observable/{throttle.js => debounce.js} | 93 +- ...ithselector.js => debouncewithselector.js} | 107 +- .../core/linq/observable/defaultifempty.js | 28 +- .../rx/src/core/linq/observable/delay.js | 2 +- .../core/linq/observable/delaywithselector.js | 116 +- .../src/core/linq/observable/dematerialize.js | 22 +- .../rx/src/core/linq/observable/distinct.js | 11 +- .../linq/observable/distinctuntilchanged.js | 83 +- .../rx/src/core/linq/observable/do.js | 149 +- .../rx/src/core/linq/observable/dowhile.js | 20 +- .../rx/src/core/linq/observable/elementat.js | 20 +- .../linq/observable/elementatordefault.js | 24 +- .../rx/src/core/linq/observable/every.js | 15 + .../rx/src/core/linq/observable/exclusive.js | 2 +- .../src/core/linq/observable/exclusivemap.js | 11 +- .../rx/src/core/linq/observable/expand.js | 6 +- .../rx/src/core/linq/observable/finally.js | 63 +- .../rx/src/core/linq/observable/finalvalue.js | 17 - .../rx/src/core/linq/observable/find.js | 18 +- .../rx/src/core/linq/observable/findindex.js | 20 +- .../rx/src/core/linq/observable/first.js | 28 +- .../core/linq/observable/firstordefault.js | 29 +- .../observable/flatmapwithconcurrencylimit.js | 87 +- .../rx/src/core/linq/observable/forkjoin.js | 125 +- .../src/core/linq/observable/forkjoinproto.js | 157 +- .../rx/src/core/linq/observable/from.js | 217 +- .../rx/src/core/linq/observable/fromarray.js | 43 +- .../src/core/linq/observable/fromcallback.js | 81 +- .../core/linq/observable/fromevent-modern.js | 184 +- .../rx/src/core/linq/observable/fromevent.js | 320 +- .../core/linq/observable/fromeventpattern.js | 3 +- .../core/linq/observable/fromnodecallback.js | 89 +- .../src/core/linq/observable/frompromise.js | 6 +- .../src/core/linq/observable/groupbyuntil.js | 2 +- .../rx/src/core/linq/observable/groupjoin.js | 2 +- .../core/linq/observable/ignoreelements.js | 6 +- .../observable/{contains.js => includes.js} | 74 +- .../rx/src/core/linq/observable/indexof.js | 62 +- .../rx/src/core/linq/observable/join.js | 206 +- .../src/core/linq/observable/jortsortuntil.js | 2 +- .../rx/src/core/linq/observable/last.js | 25 +- .../src/core/linq/observable/lastordefault.js | 29 +- .../rx/src/core/linq/observable/let.js | 20 +- .../rx/src/core/linq/observable/manyselect.js | 134 +- .../src/core/linq/observable/materialize.js | 2 +- .../rx/src/core/linq/observable/max.js | 24 +- .../rx/src/core/linq/observable/maxby.js | 26 +- .../rx/src/core/linq/observable/merge.js | 50 +- .../{mergeobservable.js => mergeall.js} | 14 +- .../core/linq/observable/mergedelayerror.js | 80 + .../rx/src/core/linq/observable/mergeproto.js | 12 +- .../rx/src/core/linq/observable/min.js | 24 +- .../rx/src/core/linq/observable/minby.js | 28 +- .../rx/src/core/linq/observable/multicast.js | 2 +- .../rx/src/core/linq/observable/observeon.js | 2 +- .../rx/src/core/linq/observable/of.js | 59 +- .../core/linq/observable/ofarraychanges.js | 22 + .../core/linq/observable/ofobjectchanges.js | 22 + .../core/linq/observable/onerrorresumenext.js | 59 +- .../rx/src/core/linq/observable/pairs.js | 21 + .../rx/src/core/linq/observable/pairwise.js | 2 +- .../rx/src/core/linq/observable/partition.js | 5 +- .../rx/src/core/linq/observable/pluck.js | 30 +- .../rx/src/core/linq/observable/reduce.js | 55 +- .../src/core/linq/observable/repeatproto.js | 20 +- .../rx/src/core/linq/observable/retry.js | 26 +- .../rx/src/core/linq/observable/retrywhen.js | 13 + .../rx/src/core/linq/observable/return.js | 42 +- .../rx/src/core/linq/observable/sample.js | 85 +- .../rx/src/core/linq/observable/scan.js | 14 +- .../rx/src/core/linq/observable/select.js | 44 +- .../rx/src/core/linq/observable/selectmany.js | 87 +- .../linq/observable/selectmanyobserver.js | 2 +- .../src/core/linq/observable/sequenceequal.js | 198 +- .../rx/src/core/linq/observable/share.js | 4 - .../rx/src/core/linq/observable/sharevalue.js | 4 - .../rx/src/core/linq/observable/single.js | 3 - .../core/linq/observable/singleinstance.js | 20 + .../core/linq/observable/singleordefault.js | 2 +- .../rx/src/core/linq/observable/skip.js | 24 +- .../rx/src/core/linq/observable/skiplast.js | 9 +- .../core/linq/observable/skiplastwithtime.js | 12 +- .../rx/src/core/linq/observable/skipuntil.js | 12 +- .../core/linq/observable/skipuntilwithtime.js | 9 +- .../rx/src/core/linq/observable/skipwhile.js | 15 +- .../src/core/linq/observable/skipwithtime.js | 2 +- .../rx/src/core/linq/observable/some.js | 25 + .../rx/src/core/linq/observable/spawn.js | 421 +- .../rx/src/core/linq/observable/startwith.js | 38 +- .../src/core/linq/observable/subscribeon.js | 2 +- .../rx/src/core/linq/observable/sum.js | 27 +- .../rx/src/core/linq/observable/switch.js | 4 +- .../rx/src/core/linq/observable/take.js | 24 +- .../rx/src/core/linq/observable/takelast.js | 43 +- .../core/linq/observable/takelastbuffer.js | 10 +- .../linq/observable/takelastbufferwithtime.js | 12 +- .../core/linq/observable/takelastwithtime.js | 10 +- .../rx/src/core/linq/observable/takeuntil.js | 8 +- .../core/linq/observable/takeuntilwithtime.js | 8 +- .../rx/src/core/linq/observable/takewhile.js | 19 +- .../src/core/linq/observable/takewithtime.js | 6 +- .../rx/src/core/linq/observable/thendo.js} | 18 +- .../src/core/linq/observable/throttlefirst.js | 24 + .../rx/src/core/linq/observable/throw.js | 12 +- .../rx/src/core/linq/observable/timeout.js | 4 +- .../linq/observable/timeoutwithselector.js | 136 +- .../rx/src/core/linq/observable/toarray.js | 14 +- .../rx/src/core/linq/observable/toasync.js | 6 - .../rx/src/core/linq/observable/tomap.js | 81 +- .../rx/src/core/linq/observable/topromise.js | 2 +- .../rx/src/core/linq/observable/toset.js | 37 +- .../rx/src/core/linq/observable/transduce.js | 37 + .../rx/src/core/linq/observable/when.js | 84 +- .../rx/src/core/linq/observable/where.js | 52 +- .../rx/src/core/linq/observable/window.js | 210 +- .../core/linq/observable/windowwithcount.js | 104 +- .../core/linq/observable/windowwithtime.js | 158 +- .../linq/observable/windowwithtimeorcount.js | 120 +- .../core/linq/observable/withlatestfrom.js | 64 + .../rx/src/core/linq/observable/zip.js | 22 +- .../rx/src/core/linq/observable/ziparray.js | 103 +- .../rx/src/core/linq/observable/zipproto.js | 167 +- .../core/longstacktraces/longstackbegin.js | 10 + .../src/core/longstacktraces/longstackend.js | 2 + .../core/longstacktraces/longstacktraces.js | 84 + .../node_modules/rx/src/core/notification.js | 197 +- .../node_modules/rx/src/core/observable.js | 136 +- .../rx/src/core/observeonobserver.js | 55 +- .../rx/src/core/observer-extras.js | 38 + .../node_modules/rx/src/core/observer-lite.js | 32 - .../node_modules/rx/src/core/observer.js | 142 +- .../rx/src/core/perf/observablebase.js | 37 + .../src/core/perf/operators/combinelatest.js | 92 + .../perf/operators/distinctuntilchanged.js | 81 + .../rx/src/core/perf/operators/filter.js | 64 + .../rx/src/core/perf/operators/from.js | 164 + .../rx/src/core/perf/operators/fromarray.js | 10 + .../perf/operators/fromarrayobservable.js | 34 + .../rx/src/core/perf/operators/map.js | 73 + .../rx/src/core/perf/operators/mergeall.js | 102 + .../rx/src/core/perf/operators/mergeproto.js | 125 + .../rx/src/core/perf/operators/of.js | 25 + .../rx/src/core/perf/operators/range.js | 51 + .../rx/src/core/perf/operators/reduce.js | 70 + .../rx/src/core/perf/operators/scan.js | 76 + .../rx/src/core/perf/operators/switch.js | 76 + .../rx/src/core/perf/operators/tap.js | 103 + .../rx/src/core/perf/operators/toarray.js | 51 + .../node_modules/rx/src/core/polyfills.js | 123 - .../rx/src/core/scheduledobserver.js | 130 +- .../rx/src/core/subjects/anonymoussubject.js | 50 +- .../rx/src/core/subjects/asyncsubject.js | 241 +- .../rx/src/core/subjects/behaviorsubject.js | 195 +- .../rx/src/core/subjects/innersubscription.js | 27 +- .../rx/src/core/subjects/replaysubject.js | 275 +- .../rx/src/core/subjects/subject.js | 208 +- .../node_modules/rx/src/core/testheader.js | 19 - .../rx/src/core/testing/coldobservable.js | 65 +- .../rx/src/core/testing/hotobservable.js | 87 +- .../rx/src/core/testing/mockdisposable.js | 23 +- .../rx/src/core/testing/mockobserver.js | 55 +- .../rx/src/core/testing/mockpromise.js | 54 + .../rx/src/core/testing/reactivetest.js | 162 +- .../rx/src/core/testing/testscheduler.js | 300 +- .../node_modules/rx/src/core/testintro.js | 32 - .../inquirer/node_modules/rx/travis.sh | 118 +- .../inquirer/node_modules/rx/ts/rx-lite.d.ts | 1255 +- .../inquirer/node_modules/rx/ts/rx.all.d.ts | 20 + .../inquirer/node_modules/rx/ts/rx.all.ts | 20 - .../node_modules/rx/ts/rx.async-lite.d.ts | 137 +- .../rx/ts/rx.backpressure-lite.d.ts | 97 +- .../node_modules/rx/ts/rx.backpressure.d.ts | 22 +- .../inquirer/node_modules/rx/ts/rx.d.ts | 169 +- .../node_modules/rx/ts/rx.joinpatterns.d.ts | 120 +- .../inquirer/node_modules/rx/ts/rx.lite.d.ts | 65 +- .../node_modules/rx/ts/rx.testing.d.ts | 126 +- .../node_modules/rx/ts/rx.time-lite.d.ts | 99 +- .../inquirer/node_modules/rx/ts/rx.time.d.ts | 96 +- .../node_modules/rx/ts/rx.virtualtime.d.ts | 80 +- .../insight/node_modules/os-name/cli.js | 6 +- .../insight/node_modules/os-name/index.js | 19 +- .../node_modules/minimist/.travis.yml | 4 + .../osx-release/node_modules/minimist/LICENSE | 18 + .../node_modules}/minimist/example/parse.js | 0 .../node_modules}/minimist/index.js | 0 .../node_modules}/minimist/package.json | 0 .../node_modules}/minimist/readme.markdown | 0 .../node_modules}/minimist/test/all_bool.js | 0 .../node_modules}/minimist/test/bool.js | 0 .../node_modules}/minimist/test/dash.js | 0 .../minimist/test/default_bool.js | 0 .../node_modules}/minimist/test/dotted.js | 0 .../node_modules}/minimist/test/long.js | 0 .../node_modules}/minimist/test/num.js | 0 .../node_modules}/minimist/test/parse.js | 0 .../minimist/test/parse_modified.js | 0 .../node_modules}/minimist/test/short.js | 0 .../node_modules}/minimist/test/stop_early.js | 0 .../node_modules}/minimist/test/unknown.js | 0 .../node_modules}/minimist/test/whitespace.js | 0 .../os-name/node_modules/win-release/index.js | 19 + .../node_modules/win-release/package.json | 65 + .../node_modules/win-release/readme.md | 54 + .../insight/node_modules/os-name/package.json | 23 +- .../node_modules/punycode/LICENSE-MIT.txt | 2 +- .../node_modules/punycode/README.md | 6 +- .../node_modules/punycode/package.json | 33 +- .../node_modules/punycode/punycode.js | 12 +- .../bower/node_modules/insight/package.json | 3 +- node_modules/bower/node_modules/junk/index.js | 4 +- node_modules/bower/node_modules/junk/license | 21 + .../bower/node_modules/junk/package.json | 21 +- .../mkdirp/node_modules/minimist/package.json | 3 +- .../bower/node_modules/mout/package.json | 2 +- node_modules/bower/node_modules/opn/license | 21 + .../bower/node_modules/opn/package.json | 21 +- node_modules/bower/node_modules/opn/xdg-open | 302 +- .../node_modules/p-throttler/package.json | 3 +- .../node_modules/mute-stream/package.json | 3 +- .../bower/node_modules/promptly/package.json | 3 +- .../bower/node_modules/q/package.json | 2 +- .../request-progress/package.json | 3 +- .../request/node_modules/.bin/uuid | 1 + .../request/node_modules/bl/README.md | 7 +- .../request/node_modules/bl/bl.js | 2 +- .../bl/node_modules/readable-stream/LICENSE | 41 +- .../bl/node_modules/readable-stream/README.md | 4 +- .../node_modules/isarray/package.json | 5 +- .../node_modules/readable-stream/package.json | 16 +- .../node_modules/readable-stream/readable.js | 3 +- .../request/node_modules/bl/package.json | 17 +- .../node_modules/caseless/package.json | 3 +- .../combined-stream/lib/combined_stream.js | 14 +- .../node_modules/combined-stream/package.json | 24 +- .../form-data/node_modules/mime/package.json | 5 +- .../node_modules/http-signature/README.md | 86 +- .../http-signature/http_signing.md | 26 +- .../node_modules/http-signature/lib/index.js | 1 + .../node_modules/http-signature/lib/signer.js | 1 - .../node_modules/http-signature/lib/util.js | 59 +- .../node_modules/assert-plus/assert.js | 71 +- .../node_modules/assert-plus/package.json | 27 +- .../node_modules/ctype/.npmignore | 1 + .../node_modules/ctype/CHANGELOG | 9 +- .../node_modules/ctype/package.json | 18 +- .../node_modules/ctype/tst/ctf/float.json | 13 - .../node_modules/ctype/tst/ctf/int.json | 13 - .../node_modules/ctype/tst/ctf/psinfo.json | 104 - .../node_modules/ctype/tst/ctf/struct.json | 19 - .../node_modules/ctype/tst/ctf/tst.fail.js | 39 - .../node_modules/ctype/tst/ctf/tst.float.js | 14 - .../node_modules/ctype/tst/ctf/tst.int.js | 14 - .../node_modules/ctype/tst/ctf/tst.psinfo.js | 17 - .../node_modules/ctype/tst/ctf/tst.struct.js | 18 - .../node_modules/ctype/tst/ctf/tst.typedef.js | 15 - .../node_modules/ctype/tst/ctf/typedef.json | 14 - .../ctype/tst/ctio/float/tst.rfloat.js | 767 - .../ctype/tst/ctio/float/tst.wfloat.js | 753 - .../node_modules/ctype/tst/ctio/int/tst.64.js | 638 - .../ctype/tst/ctio/int/tst.rint.js | 101 - .../ctype/tst/ctio/int/tst.wbounds.js | 53 - .../ctype/tst/ctio/int/tst.wint.js | 92 - .../ctype/tst/ctio/uint/tst.64.js | 451 - .../ctype/tst/ctio/uint/tst.roundtrip.js | 81 - .../ctype/tst/ctio/uint/tst.ruint.js | 95 - .../ctype/tst/ctio/uint/tst.wuint.js | 156 - .../ctype/tst/ctype/tst.basicr.js | 50 - .../ctype/tst/ctype/tst.basicw.js | 44 - .../node_modules/ctype/tst/ctype/tst.char.js | 42 - .../ctype/tst/ctype/tst.endian.js | 45 - .../ctype/tst/ctype/tst.oldwrite.js | 28 - .../ctype/tst/ctype/tst.readSize.js | 128 - .../ctype/tst/ctype/tst.structw.js | 28 - .../ctype/tst/ctype/tst.writeStruct.js | 31 - .../node_modules/http-signature/package.json | 63 +- .../node_modules/mime-types/package.json | 2 +- .../request/node_modules/node-uuid/LICENSE.md | 23 +- .../request/node_modules/node-uuid/README.md | 40 +- .../request/node_modules/node-uuid/bin/uuid | 26 + .../request/node_modules/node-uuid/bower.json | 23 + .../node_modules/node-uuid/component.json | 4 +- .../node_modules/node-uuid/package.json | 36 +- .../request/node_modules/node-uuid/uuid.js | 16 +- .../node_modules/oauth-sign/package.json | 4 +- .../node_modules/punycode/LICENSE-MIT.txt | 2 +- .../node_modules/punycode/README.md | 6 +- .../node_modules/punycode/package.json | 32 +- .../node_modules/punycode/punycode.js | 12 +- .../bower/node_modules/request/package.json | 5 +- .../bower/node_modules/retry/package.json | 6 +- .../bower/node_modules/rimraf/package.json | 2 +- .../bower/node_modules/semver/package.json | 2 +- .../bower/node_modules/shell-quote/index.js | 4 +- .../node_modules/shell-quote/package.json | 20 +- .../node_modules/shell-quote/test/quote.js | 5 + .../node_modules/stringify-object/index.js | 6 +- .../node_modules/stringify-object/license | 21 + .../stringify-object/package.json | 19 +- .../node_modules/stringify-object/readme.md | 8 +- .../once/node_modules/wrappy/package.json | 3 +- .../node_modules/once/package.json | 3 +- .../node_modules/end-of-stream/package.json | 3 +- .../pump/node_modules/once/package.json | 4 +- .../tar-fs/node_modules/pump/package.json | 3 +- .../tar-stream/node_modules/bl/README.md | 7 +- .../tar-stream/node_modules/bl/bl.js | 2 +- .../tar-stream/node_modules/bl/package.json | 17 +- .../node_modules/end-of-stream/package.json | 3 +- .../node_modules/readable-stream/LICENSE | 41 +- .../node_modules/readable-stream/README.md | 4 +- .../node_modules/isarray/package.json | 5 +- .../node_modules/readable-stream/package.json | 16 +- .../node_modules/readable-stream/readable.js | 3 +- .../node_modules/xtend/package.json | 3 +- .../node_modules/tar-stream/package.json | 3 +- .../bower/node_modules/tar-fs/package.json | 3 +- .../bower/node_modules/tmp/package.json | 3 +- .../node_modules/configstore/index.js} | 7 +- .../configstore/node_modules/.bin/user-home | 1 + .../js-yaml/{HISTORY.md => CHANGELOG.md} | 71 + .../configstore/node_modules/js-yaml/LICENSE | 2 +- .../node_modules/js-yaml/README.md | 9 +- .../node_modules/js-yaml/bin/js-yaml.js | 24 +- .../node_modules/js-yaml/bower.json | 4 +- .../node_modules/js-yaml/dist/js-yaml.js | 3666 ++ .../node_modules/js-yaml/dist/js-yaml.min.js | 3 + .../js-yaml/examples/custom_types.js | 68 +- .../js-yaml/examples/custom_types.yml} | 2 +- .../js-yaml/examples/sample_document.js | 2 +- ...mple_document.yaml => sample_document.yml} | 0 .../configstore/node_modules/js-yaml/index.js | 8 - .../node_modules/js-yaml/index_browser.js | 7 - .../js-yaml/lib/js-yaml/common.js | 16 +- .../js-yaml/lib/js-yaml/dumper.js | 139 +- .../js-yaml/lib/js-yaml/loader.js | 912 +- .../node_modules/js-yaml/lib/js-yaml/type.js | 44 +- .../js-yaml/lib/js-yaml/type/binary.js | 182 +- .../js-yaml/lib/js-yaml/type/bool.js | 66 +- .../js-yaml/lib/js-yaml/type/float.js | 52 +- .../js-yaml/lib/js-yaml/type/int.js | 176 +- .../js-yaml/lib/js-yaml/type/js/function.js | 58 +- .../js-yaml/lib/js-yaml/type/js/regexp.js | 60 +- .../js-yaml/lib/js-yaml/type/js/undefined.js | 21 +- .../js-yaml/lib/js-yaml/type/map.js | 5 +- .../js-yaml/lib/js-yaml/type/merge.js | 11 +- .../js-yaml/lib/js-yaml/type/null.js | 36 +- .../js-yaml/lib/js-yaml/type/omap.js | 17 +- .../js-yaml/lib/js-yaml/type/pairs.js | 35 +- .../js-yaml/lib/js-yaml/type/seq.js | 5 +- .../js-yaml/lib/js-yaml/type/set.js | 17 +- .../js-yaml/lib/js-yaml/type/str.js | 5 +- .../js-yaml/lib/js-yaml/type/timestamp.js | 45 +- .../node_modules/argparse/CHANGELOG.md} | 21 + .../js-yaml/node_modules/argparse/README.md | 12 +- .../argparse/examples/testformatters.js | 4 +- .../argparse/lib/action/subparsers.js | 2 +- .../argparse/lib/action_container.js | 8 +- .../argparse/lib/argument_parser.js | 41 +- .../argparse/lib/help/added_formatters.js | 6 +- .../argparse/lib/help/formatter.js | 53 +- .../node_modules/argparse/lib/namespace.js | 2 +- .../argparse/node_modules/lodash/LICENSE.txt | 22 + .../argparse/node_modules/lodash/README.md | 118 + .../argparse/node_modules/lodash/array.js | 42 + .../node_modules/lodash/array/chunk.js | 47 + .../node_modules/lodash/array/compact.js | 30 + .../node_modules/lodash/array/difference.js | 39 + .../node_modules/lodash/array/drop.js | 39 + .../node_modules/lodash/array/dropRight.js | 40 + .../lodash/array/dropRightWhile.js | 61 + .../node_modules/lodash/array/dropWhile.js | 62 + .../node_modules/lodash/array/fill.js | 29 + .../node_modules/lodash/array/findIndex.js | 63 + .../lodash/array/findLastIndex.js | 61 + .../node_modules/lodash/array/first.js | 22 + .../node_modules/lodash/array/flatten.js | 32 + .../node_modules/lodash/array/flattenDeep.js | 21 + .../node_modules/lodash/array/head.js | 1 + .../node_modules/lodash/array/indexOf.js | 55 + .../node_modules/lodash/array/initial.js | 20 + .../node_modules/lodash/array/intersection.js | 68 + .../node_modules/lodash/array/last.js | 19 + .../node_modules/lodash/array/lastIndexOf.js | 57 + .../node_modules/lodash/array/object.js | 1 + .../node_modules/lodash/array/pull.js | 52 + .../node_modules/lodash/array/pullAt.js | 33 + .../node_modules/lodash/array/remove.js | 64 + .../node_modules/lodash/array/rest.js | 21 + .../node_modules/lodash/array/slice.js | 30 + .../node_modules/lodash/array/sortedIndex.js | 60 + .../lodash/array/sortedLastIndex.js | 32 + .../node_modules/lodash/array/tail.js | 1 + .../node_modules/lodash/array/take.js | 39 + .../node_modules/lodash/array/takeRight.js | 40 + .../lodash/array/takeRightWhile.js | 61 + .../node_modules/lodash/array/takeWhile.js | 62 + .../node_modules/lodash/array/union.js | 27 + .../node_modules/lodash/array/uniq.js | 75 + .../node_modules/lodash/array/unique.js | 1 + .../node_modules/lodash/array/unzip.js | 37 + .../node_modules/lodash/array/without.js | 28 + .../argparse/node_modules/lodash/array/xor.js | 39 + .../argparse/node_modules/lodash/array/zip.js | 28 + .../node_modules/lodash/array/zipObject.js | 39 + .../argparse/node_modules/lodash/chain.js | 15 + .../node_modules/lodash/chain/chain.js | 33 + .../node_modules/lodash/chain/commit.js | 1 + .../node_modules/lodash/chain/lodash.js | 109 + .../node_modules/lodash/chain/plant.js | 1 + .../node_modules/lodash/chain/reverse.js | 1 + .../argparse/node_modules/lodash/chain/run.js | 1 + .../argparse/node_modules/lodash/chain/tap.js | 27 + .../node_modules/lodash/chain/thru.js | 23 + .../node_modules/lodash/chain/toJSON.js | 1 + .../node_modules/lodash/chain/toString.js | 1 + .../node_modules/lodash/chain/value.js | 1 + .../node_modules/lodash/chain/valueOf.js | 1 + .../node_modules/lodash/chain/wrapperChain.js | 32 + .../lodash/chain/wrapperCommit.js | 32 + .../node_modules/lodash/chain/wrapperPlant.js | 43 + .../lodash/chain/wrapperReverse.js | 38 + .../lodash/chain/wrapperToString.js | 17 + .../node_modules/lodash/chain/wrapperValue.js | 20 + .../node_modules/lodash/collection.js | 42 + .../node_modules/lodash/collection/all.js | 1 + .../node_modules/lodash/collection/any.js | 1 + .../node_modules/lodash/collection/at.js | 34 + .../node_modules/lodash/collection/collect.js | 1 + .../lodash/collection/contains.js | 1 + .../node_modules/lodash/collection/countBy.js | 51 + .../node_modules/lodash/collection/detect.js | 1 + .../node_modules/lodash/collection/each.js | 1 + .../lodash/collection/eachRight.js | 1 + .../node_modules/lodash/collection/every.js | 63 + .../node_modules/lodash/collection/filter.js | 60 + .../node_modules/lodash/collection/find.js | 65 + .../lodash/collection/findLast.js | 28 + .../lodash/collection/findWhere.js | 37 + .../node_modules/lodash/collection/foldl.js | 1 + .../node_modules/lodash/collection/foldr.js | 1 + .../node_modules/lodash/collection/forEach.js | 38 + .../lodash/collection/forEachRight.js | 29 + .../node_modules/lodash/collection/groupBy.js | 56 + .../node_modules/lodash/collection/include.js | 1 + .../lodash/collection/includes.js | 61 + .../node_modules/lodash/collection/indexBy.js | 50 + .../node_modules/lodash/collection/inject.js | 1 + .../node_modules/lodash/collection/invoke.js | 30 + .../node_modules/lodash/collection/map.js | 64 + .../node_modules/lodash/collection/max.js | 53 + .../node_modules/lodash/collection/min.js | 53 + .../lodash/collection/partition.js | 61 + .../node_modules/lodash/collection/pluck.js | 31 + .../node_modules/lodash/collection/reduce.js | 46 + .../lodash/collection/reduceRight.js | 31 + .../node_modules/lodash/collection/reject.js | 60 + .../node_modules/lodash/collection/sample.js | 38 + .../node_modules/lodash/collection/select.js | 1 + .../node_modules/lodash/collection/shuffle.js | 36 + .../node_modules/lodash/collection/size.js | 29 + .../node_modules/lodash/collection/some.js | 64 + .../node_modules/lodash/collection/sortBy.js | 68 + .../lodash/collection/sortByAll.js | 53 + .../node_modules/lodash/collection/where.js | 37 + .../argparse/node_modules/lodash/date.js | 3 + .../argparse/node_modules/lodash/date/now.js | 22 + .../argparse/node_modules/lodash/function.js | 26 + .../node_modules/lodash/function/after.js | 48 + .../node_modules/lodash/function/ary.js | 34 + .../node_modules/lodash/function/backflow.js | 1 + .../node_modules/lodash/function/before.js | 41 + .../node_modules/lodash/function/bind.js | 58 + .../node_modules/lodash/function/bindAll.js | 39 + .../node_modules/lodash/function/bindKey.js | 68 + .../node_modules/lodash/function/compose.js | 1 + .../node_modules/lodash/function/curry.js | 59 + .../lodash/function/curryRight.js | 56 + .../node_modules/lodash/function/debounce.js | 186 + .../node_modules/lodash/function/defer.js | 22 + .../node_modules/lodash/function/delay.js | 23 + .../node_modules/lodash/function/flow.js | 52 + .../node_modules/lodash/function/flowRight.js | 52 + .../node_modules/lodash/function/memoize.js | 81 + .../node_modules/lodash/function/negate.js | 32 + .../node_modules/lodash/function/once.js | 24 + .../node_modules/lodash/function/partial.js | 50 + .../lodash/function/partialRight.js | 49 + .../node_modules/lodash/function/rearg.js | 38 + .../node_modules/lodash/function/spread.js | 45 + .../node_modules/lodash/function/throttle.js | 71 + .../node_modules/lodash/function/wrap.js | 33 + .../argparse/node_modules/lodash/index.js | 11242 ++++++ .../lodash/internal/LazyWrapper.js | 21 + .../lodash/internal/LodashWrapper.js | 15 + .../node_modules/lodash/internal/MapCache.js | 24 + .../node_modules/lodash/internal/SetCache.js | 29 + .../node_modules/lodash/internal/arrayCopy.js | 20 + .../node_modules/lodash/internal/arrayEach.js | 22 + .../lodash/internal/arrayEachRight.js | 21 + .../lodash/internal/arrayEvery.js | 23 + .../lodash/internal/arrayFilter.js | 25 + .../node_modules/lodash/internal/arrayMap.js | 21 + .../node_modules/lodash/internal/arrayMax.js | 25 + .../node_modules/lodash/internal/arrayMin.js | 25 + .../lodash/internal/arrayReduce.js | 26 + .../lodash/internal/arrayReduceRight.js | 24 + .../node_modules/lodash/internal/arraySome.js | 23 + .../lodash/internal/assignDefaults.js | 13 + .../lodash/internal/assignOwnDefaults.js | 26 + .../lodash/internal/baseAssign.js | 35 + .../node_modules/lodash/internal/baseAt.js | 32 + .../lodash/internal/baseBindAll.js | 26 + .../lodash/internal/baseCallback.js | 36 + .../node_modules/lodash/internal/baseClone.js | 130 + .../lodash/internal/baseCompareAscending.js | 25 + .../node_modules/lodash/internal/baseCopy.js | 25 + .../lodash/internal/baseCreate.js | 23 + .../node_modules/lodash/internal/baseDelay.js | 23 + .../lodash/internal/baseDifference.js | 52 + .../node_modules/lodash/internal/baseEach.js | 30 + .../lodash/internal/baseEachRight.js | 28 + .../node_modules/lodash/internal/baseEvery.js | 22 + .../node_modules/lodash/internal/baseFill.js | 31 + .../lodash/internal/baseFilter.js | 22 + .../node_modules/lodash/internal/baseFind.js | 25 + .../lodash/internal/baseFlatten.js | 45 + .../node_modules/lodash/internal/baseFor.js | 30 + .../node_modules/lodash/internal/baseForIn.js | 17 + .../lodash/internal/baseForOwn.js | 17 + .../lodash/internal/baseForOwnRight.js | 17 + .../lodash/internal/baseForRight.js | 27 + .../lodash/internal/baseFunctions.js | 27 + .../lodash/internal/baseIndexOf.js | 27 + .../lodash/internal/baseInvoke.js | 28 + .../lodash/internal/baseIsEqual.js | 34 + .../lodash/internal/baseIsEqualDeep.js | 101 + .../lodash/internal/baseIsMatch.js | 58 + .../node_modules/lodash/internal/baseMap.js | 20 + .../lodash/internal/baseMatches.js | 45 + .../lodash/internal/baseMatchesProperty.js | 24 + .../node_modules/lodash/internal/baseMerge.js | 45 + .../lodash/internal/baseMergeDeep.js | 67 + .../lodash/internal/baseProperty.js | 14 + .../lodash/internal/basePullAt.js | 35 + .../lodash/internal/baseRandom.js | 20 + .../lodash/internal/baseReduce.js | 24 + .../lodash/internal/baseSetData.js | 17 + .../node_modules/lodash/internal/baseSlice.js | 32 + .../node_modules/lodash/internal/baseSome.js | 23 + .../lodash/internal/baseSortBy.js | 21 + .../lodash/internal/baseToString.js | 16 + .../node_modules/lodash/internal/baseUniq.js | 57 + .../lodash/internal/baseValues.js | 22 + .../lodash/internal/baseWrapperValue.js | 37 + .../lodash/internal/binaryIndex.js | 40 + .../lodash/internal/binaryIndexBy.js | 54 + .../lodash/internal/bindCallback.js | 39 + .../lodash/internal/bufferClone.js | 55 + .../lodash/internal/cacheIndexOf.js | 19 + .../node_modules/lodash/internal/cachePush.js | 20 + .../lodash/internal/charAtCallback.js | 12 + .../lodash/internal/charsLeftIndex.js | 18 + .../lodash/internal/charsRightIndex.js | 17 + .../lodash/internal/compareAscending.js | 16 + .../internal/compareMultipleAscending.js | 34 + .../lodash/internal/composeArgs.js | 34 + .../lodash/internal/composeArgsRight.js | 36 + .../lodash/internal/createAggregator.js | 37 + .../lodash/internal/createAssigner.js | 40 + .../lodash/internal/createBindWrapper.js | 21 + .../lodash/internal/createCache.js | 22 + .../lodash/internal/createCompounder.js | 26 + .../lodash/internal/createCtorWrapper.js | 23 + .../lodash/internal/createExtremum.js | 38 + .../lodash/internal/createHybridWrapper.js | 104 + .../node_modules/lodash/internal/createPad.js | 32 + .../lodash/internal/createPartialWrapper.js | 42 + .../lodash/internal/createWrapper.js | 86 + .../lodash/internal/deburrLetter.js | 33 + .../lodash/internal/equalArrays.js | 54 + .../lodash/internal/equalByTag.js | 49 + .../lodash/internal/equalObjects.js | 72 + .../lodash/internal/escapeHtmlChar.js | 22 + .../lodash/internal/escapeStringChar.js | 23 + .../lodash/internal/extremumBy.js | 34 + .../node_modules/lodash/internal/getData.js | 15 + .../node_modules/lodash/internal/getView.js | 33 + .../lodash/internal/indexOfNaN.js | 24 + .../lodash/internal/initCloneArray.js | 26 + .../lodash/internal/initCloneByTag.js | 64 + .../lodash/internal/initCloneObject.js | 16 + .../lodash/internal/isBindable.js | 38 + .../node_modules/lodash/internal/isIndex.js | 22 + .../lodash/internal/isIterateeCall.js | 28 + .../node_modules/lodash/internal/isLength.js | 23 + .../lodash/internal/isObjectLike.js | 12 + .../node_modules/lodash/internal/isSpace.js | 14 + .../lodash/internal/isStrictComparable.js | 15 + .../node_modules/lodash/internal/lazyClone.js | 28 + .../lodash/internal/lazyReverse.js | 23 + .../node_modules/lodash/internal/lazyValue.js | 71 + .../node_modules/lodash/internal/mapDelete.js | 14 + .../node_modules/lodash/internal/mapGet.js | 14 + .../node_modules/lodash/internal/mapHas.js | 20 + .../node_modules/lodash/internal/mapSet.js | 18 + .../node_modules/lodash/internal/mergeData.js | 99 + .../node_modules/lodash/internal/metaMap.js | 9 + .../lodash/internal/pickByArray.js | 28 + .../lodash/internal/pickByCallback.js | 22 + .../node_modules/lodash/internal/reEscape.js | 4 + .../lodash/internal/reEvaluate.js | 4 + .../lodash/internal/reInterpolate.js | 4 + .../node_modules/lodash/internal/reorder.js | 29 + .../lodash/internal/replaceHolders.js | 28 + .../node_modules/lodash/internal/setData.js | 41 + .../lodash/internal/shimIsPlainObject.js | 51 + .../node_modules/lodash/internal/shimKeys.js | 42 + .../lodash/internal/sortedUniq.js | 29 + .../lodash/internal/toIterable.js | 22 + .../node_modules/lodash/internal/toObject.js | 14 + .../lodash/internal/trimmedLeftIndex.js | 19 + .../lodash/internal/trimmedRightIndex.js | 18 + .../lodash/internal/unescapeHtmlChar.js | 22 + .../lodash/internal/wrapperClone.js | 18 + .../argparse/node_modules/lodash/lang.js | 27 + .../node_modules/lodash/lang/clone.js | 65 + .../node_modules/lodash/lang/cloneDeep.js | 52 + .../node_modules/lodash/lang/isArguments.js | 38 + .../node_modules/lodash/lang/isArray.js | 41 + .../node_modules/lodash/lang/isBoolean.js | 36 + .../node_modules/lodash/lang/isDate.js | 36 + .../node_modules/lodash/lang/isElement.js | 42 + .../node_modules/lodash/lang/isEmpty.js | 48 + .../node_modules/lodash/lang/isEqual.js | 55 + .../node_modules/lodash/lang/isError.js | 37 + .../node_modules/lodash/lang/isFinite.js | 40 + .../node_modules/lodash/lang/isFunction.js | 50 + .../node_modules/lodash/lang/isMatch.js | 74 + .../node_modules/lodash/lang/isNaN.js | 35 + .../node_modules/lodash/lang/isNative.js | 55 + .../node_modules/lodash/lang/isNull.js | 21 + .../node_modules/lodash/lang/isNumber.js | 42 + .../node_modules/lodash/lang/isObject.js | 30 + .../node_modules/lodash/lang/isPlainObject.js | 62 + .../node_modules/lodash/lang/isRegExp.js | 36 + .../node_modules/lodash/lang/isString.js | 36 + .../node_modules/lodash/lang/isTypedArray.js | 75 + .../node_modules/lodash/lang/isUndefined.js | 21 + .../node_modules/lodash/lang/toArray.js | 29 + .../node_modules/lodash/lang/toPlainObject.js | 31 + .../argparse/node_modules/lodash/number.js | 3 + .../node_modules/lodash/number/random.js | 70 + .../argparse/node_modules/lodash/object.js | 27 + .../node_modules/lodash/object/assign.js | 35 + .../node_modules/lodash/object/create.js | 46 + .../node_modules/lodash/object/defaults.js | 30 + .../node_modules/lodash/object/extend.js | 1 + .../node_modules/lodash/object/findKey.js | 57 + .../node_modules/lodash/object/findLastKey.js | 57 + .../node_modules/lodash/object/forIn.js | 39 + .../node_modules/lodash/object/forInRight.js | 35 + .../node_modules/lodash/object/forOwn.js | 31 + .../node_modules/lodash/object/forOwnRight.js | 28 + .../node_modules/lodash/object/functions.js | 23 + .../node_modules/lodash/object/has.js | 26 + .../node_modules/lodash/object/invert.js | 62 + .../node_modules/lodash/object/keys.js | 48 + .../node_modules/lodash/object/keysIn.js | 65 + .../node_modules/lodash/object/mapValues.js | 54 + .../node_modules/lodash/object/merge.js | 52 + .../node_modules/lodash/object/methods.js | 1 + .../node_modules/lodash/object/omit.js | 51 + .../node_modules/lodash/object/pairs.js | 30 + .../node_modules/lodash/object/pick.js | 41 + .../node_modules/lodash/object/result.js | 41 + .../node_modules/lodash/object/transform.js | 63 + .../node_modules/lodash/object/values.js | 33 + .../node_modules/lodash/object/valuesIn.js | 31 + .../argparse/node_modules/lodash/package.json | 93 + .../argparse/node_modules/lodash/string.js | 25 + .../node_modules/lodash/string/camelCase.js | 28 + .../node_modules/lodash/string/capitalize.js | 21 + .../node_modules/lodash/string/deburr.js | 27 + .../node_modules/lodash/string/endsWith.js | 36 + .../node_modules/lodash/string/escape.js | 48 + .../lodash/string/escapeRegExp.js | 32 + .../node_modules/lodash/string/kebabCase.js | 28 + .../node_modules/lodash/string/pad.js | 50 + .../node_modules/lodash/string/padLeft.js | 32 + .../node_modules/lodash/string/padRight.js | 32 + .../node_modules/lodash/string/parseInt.js | 67 + .../node_modules/lodash/string/repeat.js | 49 + .../node_modules/lodash/string/snakeCase.js | 27 + .../node_modules/lodash/string/startCase.js | 28 + .../node_modules/lodash/string/startsWith.js | 33 + .../node_modules/lodash/string/template.js | 229 + .../lodash/string/templateSettings.js | 67 + .../node_modules/lodash/string/trim.js | 42 + .../node_modules/lodash/string/trimLeft.js | 36 + .../node_modules/lodash/string/trimRight.js | 36 + .../node_modules/lodash/string/trunc.js | 97 + .../node_modules/lodash/string/unescape.js | 33 + .../node_modules/lodash/string/words.js | 38 + .../argparse/node_modules/lodash/support.js | 75 + .../argparse/node_modules/lodash/utility.js | 16 + .../node_modules/lodash/utility/attempt.js | 32 + .../node_modules/lodash/utility/callback.js | 51 + .../node_modules/lodash/utility/constant.js | 22 + .../node_modules/lodash/utility/identity.js | 19 + .../node_modules/lodash/utility/iteratee.js | 1 + .../node_modules/lodash/utility/matches.js | 33 + .../lodash/utility/matchesProperty.js | 35 + .../node_modules/lodash/utility/mixin.js | 87 + .../node_modules/lodash/utility/noop.js | 17 + .../node_modules/lodash/utility/property.js | 30 + .../node_modules/lodash/utility/propertyOf.js | 26 + .../node_modules/lodash/utility/range.js | 67 + .../node_modules/lodash/utility/times.js | 55 + .../node_modules/lodash/utility/uniqueId.js | 27 + .../node_modules/sprintf-js/.npmignore | 1 + .../argparse/node_modules/sprintf-js/LICENSE | 24 + .../node_modules/sprintf-js/README.md | 82 + .../node_modules/sprintf-js/bower.json | 14 + .../node_modules/sprintf-js/demo/angular.html | 20 + .../sprintf-js/dist/angular-sprintf.min.js | 4 + .../sprintf-js/dist/angular-sprintf.min.map | 1 + .../sprintf-js/dist/sprintf.min.js | 4 + .../sprintf-js/dist/sprintf.min.map | 1 + .../node_modules/sprintf-js/gruntfile.js | 36 + .../node_modules/sprintf-js/package.json | 50 + .../sprintf-js/src/angular-sprintf.js | 18 + .../node_modules/sprintf-js/src/sprintf.js | 195 + .../node_modules/sprintf-js/test/test.js | 72 + .../underscore.string/.travis.yml | 8 - .../node_modules/underscore.string/Gemfile | 4 - .../underscore.string/Gemfile.lock | 17 - .../node_modules/underscore.string/Rakefile | 23 - .../underscore.string/component.json | 11 - .../dist/underscore.string.min.js | 1 - .../lib/underscore.string.js | 673 - .../underscore.string/libpeerconnection.log | 0 .../underscore.string/package.json | 98 - .../underscore.string/test/speed.js | 148 - .../underscore.string/test/strings.js | 685 - .../underscore.string/test/test.html | 31 - .../test/test_standalone.html | 18 - .../test/test_underscore/arrays.js | 200 - .../test/test_underscore/chaining.js | 59 - .../test/test_underscore/collections.js | 426 - .../test/test_underscore/functions.js | 259 - .../test/test_underscore/index.html | 45 - .../test/test_underscore/objects.js | 548 - .../test/test_underscore/speed.js | 75 - .../test/test_underscore/utility.js | 249 - .../test/test_underscore/vendor/jquery.js | 9404 ----- .../test/test_underscore/vendor/jslitmus.js | 670 - .../test/test_underscore/vendor/qunit.css | 235 - .../test/test_underscore/vendor/qunit.js | 1977 -- .../underscore.string/test/underscore.js | 1201 - .../node_modules/underscore/.npmignore | 4 - .../node_modules/underscore/.travis.yml | 5 - .../argparse/node_modules/underscore/CNAME | 1 - .../node_modules/underscore/CONTRIBUTING.md | 9 - .../argparse/node_modules/underscore/LICENSE | 22 - .../node_modules/underscore/README.md | 19 - .../node_modules/underscore/favicon.ico | Bin 1406 -> 0 bytes .../node_modules/underscore/index.html | 2467 -- .../argparse/node_modules/underscore/index.js | 1 - .../node_modules/underscore/package.json | 52 - .../node_modules/underscore/underscore-min.js | 1 - .../node_modules/underscore/underscore.js | 1226 - .../node_modules/argparse/package.json | 35 +- .../js-yaml/node_modules/esprima/README.md | 71 +- .../node_modules/esprima/bin/esparse.js | 12 +- .../node_modules/esprima/bin/esvalidate.js | 44 +- .../js-yaml/node_modules/esprima/esprima.js | 4274 +-- .../js-yaml/node_modules/esprima/package.json | 53 +- .../node_modules/esprima/test/compat.js | 7 +- .../node_modules/esprima/test/reflect.js | 118 +- .../js-yaml/node_modules/esprima/test/run.js | 3 +- .../node_modules/esprima/test/runner.js | 147 +- .../js-yaml/node_modules/esprima/test/test.js | 28593 +++++++++++----- .../node_modules/js-yaml/package.json | 29 +- .../node_modules/object-assign/index.js | 26 + .../object-assign/object-assign.js | 52 - .../node_modules/object-assign/package.json | 28 +- .../node_modules/object-assign/readme.md | 22 +- .../configstore/node_modules/user-home/cli.js | 26 + .../node_modules/user-home/index.js | 15 + .../node_modules/user-home/license | 21 + .../node_modules/user-home/package.json | 68 + .../node_modules/user-home/readme.md | 42 + .../node_modules/uuid/benchmark/package.json | 4 +- .../node_modules/uuid/buffer-browser.js | 1 - .../configstore/node_modules/uuid/buffer.js | 1 - .../node_modules/uuid/package.json | 19 +- .../configstore/node_modules/uuid/uuid.js | 8 +- .../node_modules/xdg-basedir/index.js | 26 + .../node_modules/xdg-basedir/license | 21 + .../node_modules/xdg-basedir/package.json | 68 + .../node_modules/xdg-basedir/readme.md | 60 + .../node_modules/configstore/package.json | 41 +- .../node_modules/configstore/readme.md | 4 +- .../node_modules/inherits/package.json | 2 +- .../npmconf/node_modules/ini/LICENSE | 32 +- .../npmconf/node_modules/ini/ini.js | 2 +- .../npmconf/node_modules/ini/package.json | 18 +- .../node_modules/ini/test/fixtures/foo.ini | 2 + .../npmconf/node_modules/ini/test/foo.js | 2 + .../node_modules/npmconf/package.json | 3 +- .../node_modules/update-notifier/package.json | 3 +- node_modules/bower/node_modules/which/LICENSE | 32 +- .../bower/node_modules/which/package.json | 41 +- .../bower/node_modules/which/which.js | 9 +- node_modules/cookie-parser/HISTORY.md | 5 + node_modules/cookie-parser/README.md | 8 +- .../node_modules/cookie-signature/History.md | 13 +- .../node_modules/cookie-signature/Makefile | 7 - .../node_modules/cookie-signature/index.js | 8 +- .../cookie-signature/package.json | 23 +- node_modules/cookie-parser/package.json | 26 +- node_modules/cookie-session/HISTORY.md | 22 + node_modules/cookie-session/LICENSE | 22 + node_modules/cookie-session/Readme.md | 72 +- node_modules/cookie-session/index.js | 65 +- .../node_modules/cookies/.npmignore | 3 +- .../node_modules/cookies/History.md | 53 +- .../node_modules/cookies/README.md | 5 +- .../node_modules/cookies/lib/cookies.js | 16 +- .../node_modules/cookies/package.json | 39 +- .../node_modules/cookies/test/express.js | 80 - .../node_modules/cookies/test/http.js | 79 - .../node_modules/cookies/test/restify.js | 69 - .../node_modules/debug/History.md | 50 +- .../node_modules/debug/Readme.md | 24 +- .../node_modules/debug/bower.json | 28 + .../node_modules/debug/browser.js | 42 +- .../node_modules/debug/component.json | 4 +- .../debug/node_modules/ms/LICENSE | 20 + .../debug/node_modules/ms/README.md | 8 +- .../debug/node_modules/ms/index.js | 14 +- .../debug/node_modules/ms/package.json | 23 +- .../node_modules/debug/package.json | 23 +- .../node_modules/on-headers}/.npmignore | 0 .../node_modules/on-headers/History.md | 11 + .../node_modules/on-headers/LICENSE | 22 + .../node_modules/on-headers/README.md | 59 + .../node_modules/on-headers/index.js | 91 + .../node_modules/on-headers/package.json | 59 + node_modules/cookie-session/package.json | 50 +- node_modules/csurf/HISTORY.md | 74 +- node_modules/csurf/LICENSE | 1 + node_modules/csurf/README.md | 128 +- node_modules/csurf/index.js | 44 +- .../node_modules/cookie-signature/History.md | 13 +- .../node_modules/cookie-signature/Makefile | 7 - .../node_modules/cookie-signature/index.js | 8 +- .../cookie-signature/package.json | 23 +- .../csurf/node_modules/csrf/HISTORY.md | 50 + node_modules/csurf/node_modules/csrf/LICENSE | 22 + .../csurf/node_modules/csrf/README.md | 57 +- node_modules/csurf/node_modules/csrf/index.js | 21 +- .../csrf/node_modules/base64-url/.npmignore | 12 - .../csrf/node_modules/base64-url/.travis.yml | 12 - .../csrf/node_modules/base64-url/LICENSE | 4 +- .../csrf/node_modules/base64-url/README.md | 54 +- .../csrf/node_modules/base64-url/index.js | 13 +- .../csrf/node_modules/base64-url/package.json | 45 +- .../node_modules/base64-url/test/index.js | 24 - .../csrf/node_modules/rndm/README.md | 16 +- .../csrf/node_modules/rndm/index.js | 30 +- .../csrf/node_modules/rndm/package.json | 52 +- .../csrf/node_modules/scmp/.travis.yml | 1 + .../csrf/node_modules/scmp/LICENSE | 24 + .../csrf/node_modules/scmp/README.md | 4 +- .../csrf/node_modules/scmp/index.js | 5 +- .../csrf/node_modules/scmp/package.json | 21 +- .../csrf/node_modules/uid-safe/HISTORY.md | 26 + .../csrf/node_modules/uid-safe/README.md | 64 +- .../csrf/node_modules/uid-safe/index.js | 107 +- .../uid-safe/node_modules/mz/.npmignore | 2 - .../uid-safe/node_modules/mz/HISTORY.md | 6 - .../uid-safe/node_modules/mz/README.md | 114 - .../uid-safe/node_modules/mz/_promisify.js | 34 - .../node_modules/mz/_promisify_all.js | 24 - .../uid-safe/node_modules/mz/child_process.js | 8 - .../uid-safe/node_modules/mz/crypto.js | 9 - .../uid-safe/node_modules/mz/dns.js | 16 - .../uid-safe/node_modules/mz/fs.js | 42 - .../node_modules/native-or-bluebird/index.js | 9 - .../uid-safe/node_modules/mz/package.json | 58 - .../uid-safe/node_modules/mz/zlib.js | 13 - .../node_modules/native-or-bluebird/LICENSE | 22 + .../native-or-bluebird/README.md | 0 .../node_modules/native-or-bluebird/index.js | 10 + .../native-or-bluebird/package.json | 19 +- .../native-or-bluebird/promise.js | 0 .../csrf/node_modules/uid-safe/package.json | 57 +- .../csrf/node_modules/uid-safe/test.js | 46 - .../csurf/node_modules/csrf/package.json | 58 +- .../csurf/node_modules/http-errors/HISTORY.md | 76 + .../csurf/node_modules/http-errors/index.js | 66 +- .../node_modules/inherits/package.json | 2 +- .../node_modules/statuses/README.md | 4 +- .../node_modules/statuses/codes.json | 2 +- .../node_modules/statuses/package.json | 24 +- .../node_modules/http-errors/package.json | 41 +- node_modules/csurf/package.json | 37 +- node_modules/ejs/package.json | 2 +- .../express/node_modules/cookie/package.json | 3 +- .../debug/node_modules/ms/package.json | 25 +- .../node_modules/escape-html/package.json | 2 - .../express/node_modules/qs/package.json | 4 +- .../send/node_modules/mime/package.json | 4 +- .../express/node_modules/type-is/package.json | 3 +- .../node_modules/utils-merge/package.json | 2 - node_modules/express/package.json | 2 +- .../node_modules/escape-string-regexp/license | 21 + .../escape-string-regexp/package.json | 38 +- .../node_modules/ansi-regex/package.json | 2 +- .../node_modules/ansi-regex/package.json | 2 +- .../node_modules/which/LICENSE | 32 +- .../node_modules/which/package.json | 42 +- .../node_modules/which/which.js | 9 +- node_modules/grunt-contrib-sass/package.json | 2 +- .../node_modules/async/package.json | 2 +- .../gaze/node_modules/globule/package.json | 2 +- .../node_modules/lodash/package.json | 2 +- .../node_modules/debug/package.json | 2 +- .../node_modules/faye-websocket/package.json | 2 +- .../noptify/node_modules/nopt/package.json | 2 +- .../tiny-lr-fork/node_modules/qs/package.json | 2 +- .../grunt/node_modules/async/package.json | 2 +- .../node_modules/coffee-script/package.json | 2 +- .../grunt/node_modules/colors/package.json | 2 +- .../node_modules/dateformat/package.json | 3 +- .../node_modules/findup-sync/package.json | 2 +- .../grunt/node_modules/glob/package.json | 2 +- .../node_modules/colors/MIT-LICENSE.txt | 22 + .../node_modules/colors/ReadMe.md | 77 + .../node_modules/colors/colors.js | 342 + .../node_modules/colors/example.html | 76 + .../node_modules/colors/example.js | 77 + .../node_modules/colors/package.json | 46 + .../node_modules/colors/test.js | 70 + .../colors/themes/winston-dark.js | 12 + .../colors/themes/winston-light.js | 12 + .../node_modules/lodash/package.json | 2 +- .../underscore.string/package.json | 2 +- .../grunt-legacy-util/node_modules/.bin/which | 1 + .../node_modules/async/.gitmodules | 9 + .../node_modules/async/.npmignore | 4 + .../node_modules/async}/LICENSE | 2 +- .../node_modules/async/Makefile | 25 + .../node_modules/async/README.md | 1021 + .../node_modules/async/index.js | 3 + .../node_modules/async/lib/async.js | 692 + .../node_modules/async/package.json | 57 + .../node_modules/lodash/README.md | 140 + .../node_modules/lodash/lodash.js | 4258 +++ .../node_modules/lodash/lodash.min.js | 35 + .../node_modules/lodash/lodash.underscore.js | 3688 ++ .../lodash/lodash.underscore.min.js | 28 + .../node_modules/lodash/package.json | 79 + .../underscore.string/.travis.yml | 0 .../node_modules/underscore.string/Gemfile | 5 + .../underscore.string/Gemfile.lock | 34 + .../underscore.string/README.markdown | 192 +- .../node_modules/underscore.string/Rakefile | 15 +- .../dist/underscore.string.min.js | 1 + .../lib/underscore.string.js | 525 + .../underscore.string/package.json | 26 +- .../underscore.string/test/run-qunit.js | 5 +- .../underscore.string/test/speed.js | 10 - .../underscore.string/test/strings.js | 438 + .../test/strings_standalone.js | 2 +- .../underscore.string/test/test.html | 0 .../test/test_standalone.html | 0 .../test/test_underscore/arrays.js | 166 + .../test/test_underscore/chaining.js | 14 +- .../test/test_underscore/collections.js | 270 + .../test/test_underscore/functions.js | 198 + .../test/test_underscore/objects.js | 233 +- .../test/test_underscore/speed.js | 11 +- .../test/test_underscore/temp.js | 27 + .../test/test_underscore/temp_tests.html | 19 + .../test/test_underscore/test.html | 43 + .../test/test_underscore/utility.js | 155 + .../test/test_underscore/vendor/jquery.js | 19 + .../test/test_underscore/vendor/jslitmus.js | 0 .../test/test_underscore/vendor/qunit.css | 97 +- .../test/test_underscore/vendor/qunit.js | 2360 ++ .../underscore.string/test/underscore.js | 684 +- .../node_modules/which/LICENSE | 15 + .../node_modules/which/README.md | 5 + .../node_modules/which/bin/which | 14 + .../node_modules/which/package.json | 46 + .../node_modules/which/which.js | 101 + .../node_modules/iconv-lite/package.json | 2 +- .../js-yaml/node_modules/argparse/HISTORY.md | 6 + .../js-yaml/node_modules/argparse/README.md | 6 +- .../argparse/lib/argument_parser.js | 29 +- .../argparse/lib/help/formatter.js | 17 +- .../node_modules/underscore.string/.npmignore | 2 + .../underscore.string/.travis.yml | 8 +- .../node_modules/underscore.string/Gemfile | 4 - .../underscore.string/Gemfile.lock | 17 - .../underscore.string/README.markdown | 21 +- .../node_modules/underscore.string/Rakefile | 23 - .../node_modules/underscore.string/bower.json | 33 + .../underscore.string/component.json | 2 +- .../dist/underscore.string.min.js | 1 - .../node_modules/underscore.string/foo.js | 10 + .../underscore.string/gulpfile.js | 26 + .../lib/underscore.string.js | 8 +- .../underscore.string/package.json | 30 +- .../underscore.string/test/run-qunit.js | 45 - .../underscore.string/test/strings.js | 685 - .../test/strings_standalone.js | 12 - .../underscore.string/test/test.html | 31 - .../test/test_standalone.html | 18 - .../test/test_underscore/arrays.js | 200 - .../test/test_underscore/collections.js | 426 - .../test/test_underscore/functions.js | 259 - .../test/test_underscore/index.html | 45 - .../test/test_underscore/speed.js | 75 - .../test/test_underscore/utility.js | 249 - .../test/test_underscore/vendor/jquery.js | 9404 ----- .../test/test_underscore/vendor/jslitmus.js | 670 - .../test/test_underscore/vendor/qunit.js | 1977 -- .../node_modules/underscore/.npmignore | 4 - .../node_modules/underscore/.travis.yml | 5 - .../argparse/node_modules/underscore/CNAME | 1 - .../node_modules/underscore/CONTRIBUTING.md | 9 - .../argparse/node_modules/underscore/LICENSE | 3 +- .../node_modules/underscore/README.md | 5 +- .../node_modules/underscore/favicon.ico | Bin 1406 -> 0 bytes .../node_modules/underscore/index.html | 2467 -- .../argparse/node_modules/underscore/index.js | 1 - .../node_modules/underscore/package.json | 48 +- .../node_modules/underscore/underscore-min.js | 7 +- .../node_modules/underscore/underscore.js | 1145 +- .../node_modules/argparse/package.json | 33 +- .../grunt/node_modules/js-yaml/package.json | 2 +- .../grunt/node_modules/lodash/package.json | 2 +- .../grunt/node_modules/minimatch/package.json | 2 +- .../grunt/node_modules/nopt/package.json | 2 +- .../grunt/node_modules/rimraf/package.json | 2 +- .../underscore.string/package.json | 2 +- node_modules/grunt/node_modules/which/LICENSE | 32 +- .../grunt/node_modules/which/package.json | 41 +- .../grunt/node_modules/which/which.js | 9 +- .../accepts/node_modules/mime/package.json | 6 +- .../node_modules/escape-html/package.json | 5 +- .../send/node_modules/mime/package.json | 6 +- .../send/node_modules/mime/package.json | 6 +- .../type-is/node_modules/mime/package.json | 6 +- .../node_modules/utils-merge/package.json | 3 +- .../node_modules/truncate/README.md | 8 +- .../node_modules/truncate/package.json | 31 +- .../node-inspector/node_modules/which/LICENSE | 32 +- .../node_modules/which/package.json | 42 +- .../node_modules/which/which.js | 9 +- .../node_modules/ws/build/Makefile | 4 +- .../ws/build/Release/bufferutil.node | Bin 18236 -> 18228 bytes .../obj.target/bufferutil/src/bufferutil.o | Bin 76744 -> 76728 bytes .../obj.target/validation/src/validation.o | Bin 81648 -> 81648 bytes .../ws/build/Release/validation.node | Bin 18444 -> 18428 bytes .../node_modules/ws/build/binding.Makefile | 2 +- .../ws/node_modules/options/package.json | 3 +- node_modules/node-inspector/package.json | 2 +- .../LICENSE-MIT => passport-local/LICENSE} | 2 +- node_modules/passport-local/README.md | 73 + node_modules/passport-local/lib/index.js | 15 + node_modules/passport-local/lib/strategy.js | 101 + node_modules/passport-local/lib/utils.js | 11 + .../node_modules/passport-strategy/.jshintrc | 20 + .../passport-strategy/.travis.yml | 15 + .../node_modules/passport-strategy/LICENSE} | 4 +- .../node_modules/passport-strategy/README.md | 61 + .../passport-strategy/lib/index.js | 15 + .../passport-strategy/lib/strategy.js | 28 + .../passport-strategy/package.json | 72 + node_modules/passport-local/package.json | 67 + node_modules/sequelize/node_modules/.bin/uuid | 1 + .../node_modules/node-uuid/LICENSE.md | 23 +- .../node_modules/node-uuid/README.md | 40 +- .../sequelize/node_modules/node-uuid/bin/uuid | 26 + .../node_modules/node-uuid/bower.json | 23 + .../node_modules/node-uuid/component.json | 4 +- .../node_modules/node-uuid/package.json | 37 +- .../sequelize/node_modules/node-uuid/uuid.js | 16 +- node_modules/sequelize/package.json | 5 +- node_modules/sqlite3/package.json | 3 +- node_modules/underscore/package.json | 3 +- 3360 files changed, 281663 insertions(+), 191766 deletions(-) create mode 100644 node_modules/body-parser/node_modules/content-type/HISTORY.md create mode 100644 node_modules/body-parser/node_modules/content-type/LICENSE create mode 100644 node_modules/body-parser/node_modules/content-type/README.md create mode 100644 node_modules/body-parser/node_modules/content-type/index.js create mode 100644 node_modules/body-parser/node_modules/content-type/package.json create mode 100644 node_modules/body-parser/node_modules/debug/.jshintrc create mode 100644 node_modules/body-parser/node_modules/debug/.npmignore create mode 100644 node_modules/body-parser/node_modules/debug/History.md create mode 100644 node_modules/body-parser/node_modules/debug/Makefile create mode 100644 node_modules/body-parser/node_modules/debug/Readme.md create mode 100644 node_modules/body-parser/node_modules/debug/bower.json create mode 100644 node_modules/body-parser/node_modules/debug/browser.js create mode 100644 node_modules/body-parser/node_modules/debug/component.json create mode 100644 node_modules/body-parser/node_modules/debug/debug.js create mode 100644 node_modules/body-parser/node_modules/debug/node.js create mode 100644 node_modules/body-parser/node_modules/debug/node_modules/ms/.npmignore create mode 100644 node_modules/body-parser/node_modules/debug/node_modules/ms/LICENSE create mode 100644 node_modules/body-parser/node_modules/debug/node_modules/ms/README.md create mode 100644 node_modules/body-parser/node_modules/debug/node_modules/ms/index.js create mode 100644 node_modules/body-parser/node_modules/debug/node_modules/ms/package.json create mode 100644 node_modules/body-parser/node_modules/debug/package.json delete mode 100644 node_modules/body-parser/node_modules/iconv-lite/README.md~ mode change 100755 => 100644 node_modules/body-parser/node_modules/qs/package.json create mode 100644 node_modules/body-parser/node_modules/raw-body/LICENSE rename node_modules/body-parser/node_modules/{ => type-is/node_modules}/media-typer/HISTORY.md (100%) rename node_modules/body-parser/node_modules/{ => type-is/node_modules}/media-typer/LICENSE (100%) rename node_modules/body-parser/node_modules/{ => type-is/node_modules}/media-typer/README.md (100%) rename node_modules/body-parser/node_modules/{ => type-is/node_modules}/media-typer/index.js (100%) rename node_modules/body-parser/node_modules/{ => type-is/node_modules}/media-typer/package.json (100%) create mode 100644 node_modules/body-parser/node_modules/type-is/node_modules/mime-types/node_modules/mime-db/HISTORY.md create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/.editorconfig create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/.jshintrc create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/.npmignore create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/.travis.yml create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/CHANGELOG.md create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/CONTRIBUTING.md create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/LICENSE.md create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/README.md create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/array.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/array/append.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/array/collect.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/array/combine.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/array/compact.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/array/contains.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/array/difference.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/array/every.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/array/filter.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/array/find.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/array/findIndex.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/array/findLast.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/array/findLastIndex.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/array/flatten.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/array/forEach.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/array/indexOf.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/array/insert.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/array/intersection.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/array/invoke.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/array/join.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/array/lastIndexOf.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/array/map.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/array/max.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/array/min.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/array/pick.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/array/pluck.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/array/range.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/array/reduce.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/array/reduceRight.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/array/reject.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/array/remove.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/array/removeAll.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/array/shuffle.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/array/slice.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/array/some.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/array/sort.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/array/sortBy.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/array/split.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/array/toLookup.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/array/union.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/array/unique.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/array/xor.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/array/zip.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/collection.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/collection/contains.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/collection/every.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/collection/filter.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/collection/find.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/collection/forEach.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/collection/make_.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/collection/map.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/collection/max.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/collection/min.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/collection/pluck.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/collection/reduce.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/collection/reject.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/collection/size.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/collection/some.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/date.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/date/dayOfTheYear.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/date/diff.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/date/i18n/de-DE.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/date/i18n/en-US.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/date/i18n/pt-BR.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/date/i18n_.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/date/isLeapYear.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/date/isSame.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/date/parseIso.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/date/quarter.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/date/startOf.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/date/strftime.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/date/timezoneAbbr.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/date/timezoneOffset.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/date/totalDaysInMonth.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/date/totalDaysInYear.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/date/weekOfTheYear.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/doc/array.md create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/doc/collection.md create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/doc/date.md create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/doc/function.md create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/doc/lang.md create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/doc/math.md create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/doc/number.md create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/doc/object.md create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/doc/queryString.md create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/doc/random.md create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/doc/string.md create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/doc/time.md create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/function.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/function/awaitDelay.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/function/bind.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/function/compose.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/function/constant.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/function/debounce.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/function/func.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/function/identity.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/function/makeIterator_.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/function/partial.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/function/prop.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/function/series.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/function/throttle.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/function/timeout.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/function/times.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/index.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/lang.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/lang/clone.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/lang/createObject.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/lang/ctorApply.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/lang/deepClone.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/lang/defaults.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/lang/inheritPrototype.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/lang/is.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/lang/isArguments.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/lang/isArray.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/lang/isBoolean.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/lang/isDate.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/lang/isEmpty.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/lang/isFinite.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/lang/isFunction.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/lang/isInteger.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/lang/isKind.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/lang/isNaN.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/lang/isNull.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/lang/isNumber.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/lang/isObject.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/lang/isPlainObject.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/lang/isRegExp.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/lang/isString.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/lang/isUndefined.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/lang/isnt.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/lang/kindOf.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/lang/toArray.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/lang/toNumber.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/lang/toString.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/math.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/math/ceil.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/math/clamp.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/math/countSteps.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/math/floor.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/math/inRange.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/math/isNear.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/math/lerp.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/math/loop.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/math/map.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/math/norm.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/math/round.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/number.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/number/MAX_INT.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/number/MAX_UINT.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/number/MIN_INT.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/number/abbreviate.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/number/currencyFormat.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/number/enforcePrecision.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/number/isNaN.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/number/nth.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/number/ordinal.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/number/pad.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/number/rol.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/number/ror.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/number/sign.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/number/toInt.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/number/toUInt.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/number/toUInt31.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/object.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/object/bindAll.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/object/contains.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/object/deepEquals.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/object/deepFillIn.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/object/deepMatches.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/object/deepMixIn.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/object/equals.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/object/every.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/object/fillIn.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/object/filter.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/object/find.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/object/forIn.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/object/forOwn.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/object/functions.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/object/get.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/object/has.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/object/hasOwn.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/object/keys.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/object/map.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/object/matches.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/object/max.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/object/merge.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/object/min.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/object/mixIn.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/object/namespace.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/object/pick.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/object/pluck.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/object/reduce.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/object/reject.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/object/set.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/object/size.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/object/some.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/object/unset.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/object/values.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/package.json create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/queryString.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/queryString/contains.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/queryString/decode.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/queryString/encode.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/queryString/getParam.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/queryString/getQuery.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/queryString/parse.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/queryString/setParam.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/random.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/random/choice.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/random/guid.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/random/rand.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/random/randBit.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/random/randBool.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/random/randHex.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/random/randInt.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/random/randSign.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/random/random.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/src/array.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/src/array/append.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/src/array/collect.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/src/array/combine.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/src/array/compact.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/src/array/contains.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/src/array/difference.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/src/array/every.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/src/array/filter.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/src/array/find.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/src/array/findIndex.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/src/array/findLast.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/src/array/findLastIndex.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/src/array/flatten.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/src/array/forEach.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/src/array/indexOf.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/src/array/insert.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/src/array/intersection.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/src/array/invoke.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/src/array/join.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/src/array/lastIndexOf.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/src/array/map.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/src/array/max.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/src/array/min.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/src/array/pick.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/src/array/pluck.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/src/array/range.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/src/array/reduce.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/src/array/reduceRight.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/src/array/reject.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/src/array/remove.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/src/array/removeAll.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/src/array/shuffle.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/src/array/slice.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/src/array/some.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/src/array/sort.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/src/array/sortBy.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/src/array/split.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/src/array/toLookup.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/src/array/union.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/src/array/unique.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/src/array/xor.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/src/array/zip.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/src/collection.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/src/collection/contains.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/src/collection/every.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/src/collection/filter.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/src/collection/find.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/src/collection/forEach.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/src/collection/make_.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/src/collection/map.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/src/collection/max.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/src/collection/min.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/src/collection/pluck.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/src/collection/reduce.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/src/collection/reject.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/src/collection/size.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/src/collection/some.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/src/date.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/src/date/dayOfTheYear.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/src/date/diff.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/src/date/i18n/de-DE.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/src/date/i18n/en-US.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/src/date/i18n/pt-BR.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/src/date/i18n_.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/src/date/isLeapYear.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/src/date/isSame.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/src/date/parseIso.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/src/date/quarter.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/src/date/startOf.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/src/date/strftime.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/src/date/timezoneAbbr.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/src/date/timezoneOffset.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/src/date/totalDaysInMonth.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/src/date/totalDaysInYear.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/src/date/weekOfTheYear.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/src/function.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/src/function/awaitDelay.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/src/function/bind.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/src/function/compose.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/src/function/constant.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/src/function/debounce.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/src/function/func.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/src/function/identity.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/src/function/makeIterator_.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/src/function/partial.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/src/function/prop.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/src/function/series.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/src/function/throttle.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/src/function/timeout.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/src/function/times.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/src/index.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/src/lang.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/src/lang/clone.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/src/lang/createObject.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/src/lang/ctorApply.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/src/lang/deepClone.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/src/lang/defaults.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/src/lang/inheritPrototype.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/src/lang/is.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/src/lang/isArguments.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/src/lang/isArray.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/src/lang/isBoolean.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/src/lang/isDate.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/src/lang/isEmpty.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/src/lang/isFinite.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/src/lang/isFunction.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/src/lang/isInteger.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/src/lang/isKind.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/src/lang/isNaN.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/src/lang/isNull.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/src/lang/isNumber.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/src/lang/isObject.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/src/lang/isPlainObject.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/src/lang/isRegExp.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/src/lang/isString.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/src/lang/isUndefined.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/src/lang/isnt.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/src/lang/kindOf.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/src/lang/toArray.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/src/lang/toNumber.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/src/lang/toString.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/src/math.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/src/math/ceil.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/src/math/clamp.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/src/math/countSteps.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/src/math/floor.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/src/math/inRange.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/src/math/isNear.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/src/math/lerp.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/src/math/loop.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/src/math/map.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/src/math/norm.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/src/math/round.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/src/number.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/src/number/MAX_INT.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/src/number/MAX_UINT.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/src/number/MIN_INT.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/src/number/abbreviate.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/src/number/currencyFormat.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/src/number/enforcePrecision.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/src/number/isNaN.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/src/number/nth.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/src/number/ordinal.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/src/number/pad.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/src/number/rol.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/src/number/ror.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/src/number/sign.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/src/number/toInt.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/src/number/toUInt.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/src/number/toUInt31.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/src/object.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/src/object/bindAll.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/src/object/contains.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/src/object/deepEquals.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/src/object/deepFillIn.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/src/object/deepMatches.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/src/object/deepMixIn.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/src/object/equals.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/src/object/every.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/src/object/fillIn.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/src/object/filter.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/src/object/find.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/src/object/forIn.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/src/object/forOwn.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/src/object/functions.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/src/object/get.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/src/object/has.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/src/object/hasOwn.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/src/object/keys.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/src/object/map.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/src/object/matches.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/src/object/max.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/src/object/merge.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/src/object/min.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/src/object/mixIn.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/src/object/namespace.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/src/object/pick.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/src/object/pluck.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/src/object/reduce.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/src/object/reject.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/src/object/set.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/src/object/size.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/src/object/some.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/src/object/unset.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/src/object/values.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/src/queryString.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/src/queryString/contains.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/src/queryString/decode.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/src/queryString/encode.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/src/queryString/getParam.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/src/queryString/getQuery.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/src/queryString/parse.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/src/queryString/setParam.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/src/random.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/src/random/choice.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/src/random/guid.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/src/random/rand.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/src/random/randBit.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/src/random/randBool.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/src/random/randHex.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/src/random/randInt.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/src/random/randSign.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/src/random/random.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/src/string.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/src/string/WHITE_SPACES.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/src/string/camelCase.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/src/string/contains.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/src/string/crop.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/src/string/endsWith.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/src/string/escapeHtml.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/src/string/escapeRegExp.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/src/string/escapeUnicode.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/src/string/hyphenate.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/src/string/insert.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/src/string/interpolate.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/src/string/lowerCase.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/src/string/lpad.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/src/string/ltrim.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/src/string/makePath.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/src/string/normalizeLineBreaks.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/src/string/pascalCase.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/src/string/properCase.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/src/string/removeNonASCII.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/src/string/removeNonWord.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/src/string/repeat.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/src/string/replace.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/src/string/replaceAccents.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/src/string/rpad.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/src/string/rtrim.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/src/string/sentenceCase.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/src/string/slugify.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/src/string/startsWith.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/src/string/stripHtmlTags.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/src/string/trim.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/src/string/truncate.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/src/string/typecast.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/src/string/unCamelCase.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/src/string/underscore.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/src/string/unescapeHtml.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/src/string/unescapeUnicode.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/src/string/unhyphenate.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/src/string/upperCase.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/src/time.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/src/time/convert.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/src/time/now.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/src/time/parseMs.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/src/time/toTimeString.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/string.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/string/WHITE_SPACES.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/string/camelCase.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/string/contains.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/string/crop.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/string/endsWith.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/string/escapeHtml.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/string/escapeRegExp.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/string/escapeUnicode.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/string/hyphenate.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/string/insert.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/string/interpolate.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/string/lowerCase.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/string/lpad.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/string/ltrim.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/string/makePath.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/string/normalizeLineBreaks.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/string/pascalCase.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/string/properCase.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/string/removeNonASCII.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/string/removeNonWord.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/string/repeat.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/string/replace.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/string/replaceAccents.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/string/rpad.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/string/rtrim.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/string/sentenceCase.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/string/slugify.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/string/startsWith.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/string/stripHtmlTags.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/string/trim.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/string/truncate.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/string/typecast.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/string/unCamelCase.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/string/underscore.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/string/unescapeHtml.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/string/unescapeUnicode.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/string/unhyphenate.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/string/upperCase.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/time.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/time/convert.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/time/now.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/time/parseMs.js create mode 100644 node_modules/bower/node_modules/bower-config/node_modules/mout/time/toTimeString.js create mode 100644 node_modules/bower/node_modules/bower-registry-client/node_modules/request/.eslintrc create mode 100644 node_modules/bower/node_modules/bower-registry-client/node_modules/request/.travis.yml create mode 100644 node_modules/bower/node_modules/bower-registry-client/node_modules/request/CHANGELOG.md create mode 100644 node_modules/bower/node_modules/bower-registry-client/node_modules/request/CONTRIBUTING.md create mode 100644 node_modules/bower/node_modules/bower-registry-client/node_modules/request/disabled.appveyor.yml create mode 100644 node_modules/bower/node_modules/bower-registry-client/node_modules/request/examples/README.md create mode 100644 node_modules/bower/node_modules/bower-registry-client/node_modules/request/lib/cookies.js delete mode 100644 node_modules/bower/node_modules/bower-registry-client/node_modules/request/lib/getSafe.js create mode 100644 node_modules/bower/node_modules/bower-registry-client/node_modules/request/lib/helpers.js create mode 120000 node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/.bin/uuid rename node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/{aws-sign => aws-sign2}/LICENSE (100%) rename node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/{aws-sign => aws-sign2}/README.md (100%) rename node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/{aws-sign => aws-sign2}/index.js (98%) rename node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/{aws-sign => aws-sign2}/package.json (67%) create mode 100644 node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/bl/.jshintrc create mode 100644 node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/bl/.npmignore create mode 100644 node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/bl/.travis.yml create mode 100644 node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/bl/LICENSE.md create mode 100644 node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/bl/README.md create mode 100644 node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/bl/bl.js create mode 100644 node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/bl/node_modules/readable-stream/.npmignore create mode 100644 node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/bl/node_modules/readable-stream/LICENSE create mode 100644 node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/bl/node_modules/readable-stream/README.md create mode 100644 node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/bl/node_modules/readable-stream/duplex.js create mode 100644 node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/bl/node_modules/readable-stream/lib/_stream_duplex.js create mode 100644 node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/bl/node_modules/readable-stream/lib/_stream_passthrough.js create mode 100644 node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/bl/node_modules/readable-stream/lib/_stream_readable.js create mode 100644 node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/bl/node_modules/readable-stream/lib/_stream_transform.js create mode 100644 node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/bl/node_modules/readable-stream/lib/_stream_writable.js create mode 100644 node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/core-util-is/README.md create mode 100644 node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/core-util-is/float.patch create mode 100644 node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/core-util-is/lib/util.js create mode 100644 node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/core-util-is/package.json create mode 100644 node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/core-util-is/util.js create mode 100644 node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/inherits/LICENSE create mode 100644 node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/inherits/README.md create mode 100644 node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/inherits/inherits.js create mode 100644 node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/inherits/inherits_browser.js create mode 100644 node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/inherits/package.json create mode 100644 node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/inherits/test.js create mode 100644 node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/isarray/README.md create mode 100644 node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/isarray/build/build.js create mode 100644 node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/isarray/component.json create mode 100644 node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/isarray/index.js create mode 100644 node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/isarray/package.json create mode 100644 node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/string_decoder/.npmignore create mode 100644 node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/string_decoder/LICENSE create mode 100644 node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/string_decoder/README.md create mode 100644 node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/string_decoder/index.js create mode 100644 node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/string_decoder/package.json create mode 100644 node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/bl/node_modules/readable-stream/package.json create mode 100644 node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/bl/node_modules/readable-stream/passthrough.js create mode 100644 node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/bl/node_modules/readable-stream/readable.js create mode 100644 node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/bl/node_modules/readable-stream/transform.js create mode 100644 node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/bl/node_modules/readable-stream/writable.js create mode 100644 node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/bl/package.json create mode 100644 node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/bl/test/basic-test.js create mode 100644 node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/bl/test/sauce.js create mode 100644 node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/bl/test/test.js create mode 100644 node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/caseless/README.md create mode 100644 node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/caseless/index.js create mode 100644 node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/caseless/package.json create mode 100644 node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/caseless/test.js rename node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/{form-data/node_modules => }/combined-stream/License (100%) rename node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/{form-data/node_modules => }/combined-stream/Readme.md (100%) rename node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/{form-data/node_modules => }/combined-stream/lib/combined_stream.js (89%) rename node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/{form-data/node_modules => }/combined-stream/node_modules/delayed-stream/.gitignore (100%) rename node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/{form-data/node_modules => }/combined-stream/node_modules/delayed-stream/License (100%) rename node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/{form-data/node_modules => }/combined-stream/node_modules/delayed-stream/Makefile (100%) rename node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/{form-data/node_modules => }/combined-stream/node_modules/delayed-stream/Readme.md (100%) rename node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/{form-data/node_modules => }/combined-stream/node_modules/delayed-stream/lib/delayed_stream.js (100%) rename node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/{form-data/node_modules => }/combined-stream/node_modules/delayed-stream/package.json (100%) rename node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/{form-data/node_modules => }/combined-stream/node_modules/delayed-stream/test/common.js (100%) rename node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/{form-data/node_modules => }/combined-stream/node_modules/delayed-stream/test/integration/test-delayed-http-upload.js (100%) rename node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/{form-data/node_modules => }/combined-stream/node_modules/delayed-stream/test/integration/test-delayed-stream-auto-pause.js (100%) rename node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/{form-data/node_modules => }/combined-stream/node_modules/delayed-stream/test/integration/test-delayed-stream-pause.js (100%) rename node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/{form-data/node_modules => }/combined-stream/node_modules/delayed-stream/test/integration/test-delayed-stream.js (100%) rename node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/{form-data/node_modules => }/combined-stream/node_modules/delayed-stream/test/integration/test-handle-source-errors.js (100%) rename node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/{form-data/node_modules => }/combined-stream/node_modules/delayed-stream/test/integration/test-max-data-size.js (100%) rename node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/{form-data/node_modules => }/combined-stream/node_modules/delayed-stream/test/integration/test-pipe-resumes.js (100%) rename node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/{form-data/node_modules => }/combined-stream/node_modules/delayed-stream/test/integration/test-proxy-readable.js (100%) rename node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/{form-data/node_modules => }/combined-stream/node_modules/delayed-stream/test/run.js (100%) rename node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/{form-data/node_modules => }/combined-stream/package.json (75%) delete mode 100644 node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/cookie-jar/LICENSE delete mode 100644 node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/cookie-jar/README.md delete mode 100644 node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/cookie-jar/index.js delete mode 100644 node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/cookie-jar/jar.js delete mode 100644 node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/cookie-jar/package.json delete mode 100644 node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/cookie-jar/tests/run.js delete mode 100644 node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/cookie-jar/tests/test-cookie.js delete mode 100644 node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/cookie-jar/tests/test-cookiejar.js create mode 100644 node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/form-data/node_modules/mime-types/HISTORY.md rename node_modules/{csurf/node_modules/csrf/node_modules/uid-safe/node_modules/mz => bower/node_modules/bower-registry-client/node_modules/request/node_modules/form-data/node_modules/mime-types}/LICENSE (100%) create mode 100644 node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/form-data/node_modules/mime-types/README.md create mode 100644 node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/form-data/node_modules/mime-types/index.js create mode 100644 node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/form-data/node_modules/mime-types/node_modules/mime-db/HISTORY.md rename node_modules/{csurf/node_modules/csrf/node_modules/uid-safe/node_modules/mz/node_modules/native-or-bluebird => bower/node_modules/bower-registry-client/node_modules/request/node_modules/form-data/node_modules/mime-types/node_modules/mime-db}/LICENSE (100%) create mode 100644 node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/form-data/node_modules/mime-types/node_modules/mime-db/README.md create mode 100644 node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/form-data/node_modules/mime-types/node_modules/mime-db/db.json create mode 100644 node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/form-data/node_modules/mime-types/node_modules/mime-db/index.js create mode 100644 node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/form-data/node_modules/mime-types/node_modules/mime-db/package.json create mode 100644 node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/form-data/node_modules/mime-types/package.json create mode 100644 node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/http-signature/node_modules/ctype/.npmignore delete mode 100644 node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/http-signature/node_modules/ctype/tst/ctf/float.json delete mode 100644 node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/http-signature/node_modules/ctype/tst/ctf/int.json delete mode 100644 node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/http-signature/node_modules/ctype/tst/ctf/psinfo.json delete mode 100644 node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/http-signature/node_modules/ctype/tst/ctf/struct.json delete mode 100644 node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/http-signature/node_modules/ctype/tst/ctf/tst.fail.js delete mode 100644 node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/http-signature/node_modules/ctype/tst/ctf/tst.float.js delete mode 100644 node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/http-signature/node_modules/ctype/tst/ctf/tst.int.js delete mode 100644 node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/http-signature/node_modules/ctype/tst/ctf/tst.psinfo.js delete mode 100644 node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/http-signature/node_modules/ctype/tst/ctf/tst.struct.js delete mode 100644 node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/http-signature/node_modules/ctype/tst/ctf/tst.typedef.js delete mode 100644 node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/http-signature/node_modules/ctype/tst/ctf/typedef.json delete mode 100644 node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/http-signature/node_modules/ctype/tst/ctio/float/tst.rfloat.js delete mode 100644 node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/http-signature/node_modules/ctype/tst/ctio/float/tst.wfloat.js delete mode 100644 node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/http-signature/node_modules/ctype/tst/ctio/int/tst.64.js delete mode 100644 node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/http-signature/node_modules/ctype/tst/ctio/int/tst.rint.js delete mode 100644 node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/http-signature/node_modules/ctype/tst/ctio/int/tst.wbounds.js delete mode 100644 node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/http-signature/node_modules/ctype/tst/ctio/int/tst.wint.js delete mode 100644 node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/http-signature/node_modules/ctype/tst/ctio/uint/tst.64.js delete mode 100644 node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/http-signature/node_modules/ctype/tst/ctio/uint/tst.roundtrip.js delete mode 100644 node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/http-signature/node_modules/ctype/tst/ctio/uint/tst.ruint.js delete mode 100644 node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/http-signature/node_modules/ctype/tst/ctio/uint/tst.wuint.js delete mode 100644 node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/http-signature/node_modules/ctype/tst/ctype/tst.basicr.js delete mode 100644 node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/http-signature/node_modules/ctype/tst/ctype/tst.basicw.js delete mode 100644 node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/http-signature/node_modules/ctype/tst/ctype/tst.char.js delete mode 100644 node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/http-signature/node_modules/ctype/tst/ctype/tst.endian.js delete mode 100644 node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/http-signature/node_modules/ctype/tst/ctype/tst.oldwrite.js delete mode 100644 node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/http-signature/node_modules/ctype/tst/ctype/tst.readSize.js delete mode 100644 node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/http-signature/node_modules/ctype/tst/ctype/tst.structw.js delete mode 100644 node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/http-signature/node_modules/ctype/tst/ctype/tst.writeStruct.js create mode 100644 node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/mime-types/.npmignore create mode 100644 node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/mime-types/.travis.yml create mode 100644 node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/mime-types/LICENSE create mode 100644 node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/mime-types/Makefile create mode 100644 node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/mime-types/README.md create mode 100644 node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/mime-types/SOURCES.md create mode 100644 node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/mime-types/component.json create mode 100644 node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/mime-types/lib/custom.json create mode 100644 node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/mime-types/lib/index.js create mode 100644 node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/mime-types/lib/mime.json create mode 100644 node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/mime-types/lib/node.json create mode 100644 node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/mime-types/package.json delete mode 100644 node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/mime/README.md delete mode 100644 node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/mime/mime.js delete mode 100644 node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/mime/package.json delete mode 100644 node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/mime/test.js delete mode 100644 node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/mime/types/mime.types delete mode 100644 node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/mime/types/node.types create mode 100755 node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/node-uuid/bin/uuid create mode 100644 node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/node-uuid/bower.json delete mode 100644 node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/qs/.gitmodules create mode 100644 node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/qs/.jshintignore create mode 100644 node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/qs/.jshintrc rename node_modules/{cookie-session/node_modules/cookies => bower/node_modules/bower-registry-client/node_modules/request/node_modules/qs}/.travis.yml (61%) create mode 100644 node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/qs/CHANGELOG.md create mode 100644 node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/qs/CONTRIBUTING.md create mode 100755 node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/qs/LICENSE create mode 100644 node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/qs/Makefile mode change 100644 => 100755 node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/qs/Readme.md create mode 100755 node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/qs/lib/index.js create mode 100755 node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/qs/lib/parse.js create mode 100755 node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/qs/lib/stringify.js create mode 100755 node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/qs/lib/utils.js create mode 100755 node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/qs/test/parse.js create mode 100755 node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/qs/test/stringify.js create mode 100644 node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/stringstream/.npmignore create mode 100644 node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/stringstream/.travis.yml create mode 100644 node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/stringstream/LICENSE.txt create mode 100644 node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/stringstream/README.md create mode 100644 node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/stringstream/example.js create mode 100644 node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/stringstream/package.json create mode 100644 node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/stringstream/stringstream.js create mode 100644 node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/tough-cookie/.jshintrc create mode 100644 node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/tough-cookie/.npmignore create mode 100644 node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/tough-cookie/.travis.yml create mode 100644 node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/tough-cookie/LICENSE create mode 100644 node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/tough-cookie/README.md create mode 100644 node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/tough-cookie/generate-pubsuffix.js create mode 100644 node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/tough-cookie/lib/cookie.js create mode 100644 node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/tough-cookie/lib/memstore.js create mode 100644 node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/tough-cookie/lib/pubsuffix.js create mode 100644 node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/tough-cookie/lib/store.js create mode 100644 node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/tough-cookie/node_modules/punycode/LICENSE-MIT.txt create mode 100644 node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/tough-cookie/node_modules/punycode/README.md create mode 100644 node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/tough-cookie/node_modules/punycode/package.json create mode 100644 node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/tough-cookie/node_modules/punycode/punycode.js create mode 100644 node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/tough-cookie/package.json create mode 100644 node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/tough-cookie/public-suffix.txt create mode 100644 node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/tough-cookie/test.js create mode 100644 node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/tunnel-agent/.jshintrc mode change 100755 => 100644 node_modules/bower/node_modules/bower-registry-client/node_modules/request/package.json create mode 100755 node_modules/bower/node_modules/bower-registry-client/node_modules/request/release.sh delete mode 100644 node_modules/bower/node_modules/bower-registry-client/node_modules/request/tests/googledoodle.jpg delete mode 100644 node_modules/bower/node_modules/bower-registry-client/node_modules/request/tests/run.js delete mode 100644 node_modules/bower/node_modules/bower-registry-client/node_modules/request/tests/server.js delete mode 100644 node_modules/bower/node_modules/bower-registry-client/node_modules/request/tests/squid.conf delete mode 100644 node_modules/bower/node_modules/bower-registry-client/node_modules/request/tests/ssl/ca/ca.cnf delete mode 100644 node_modules/bower/node_modules/bower-registry-client/node_modules/request/tests/ssl/ca/ca.crl delete mode 100644 node_modules/bower/node_modules/bower-registry-client/node_modules/request/tests/ssl/ca/ca.crt delete mode 100644 node_modules/bower/node_modules/bower-registry-client/node_modules/request/tests/ssl/ca/ca.csr delete mode 100644 node_modules/bower/node_modules/bower-registry-client/node_modules/request/tests/ssl/ca/ca.key delete mode 100644 node_modules/bower/node_modules/bower-registry-client/node_modules/request/tests/ssl/ca/ca.srl delete mode 100644 node_modules/bower/node_modules/bower-registry-client/node_modules/request/tests/ssl/ca/server.cnf delete mode 100644 node_modules/bower/node_modules/bower-registry-client/node_modules/request/tests/ssl/ca/server.crt delete mode 100644 node_modules/bower/node_modules/bower-registry-client/node_modules/request/tests/ssl/ca/server.csr delete mode 100644 node_modules/bower/node_modules/bower-registry-client/node_modules/request/tests/ssl/ca/server.js delete mode 100644 node_modules/bower/node_modules/bower-registry-client/node_modules/request/tests/ssl/ca/server.key delete mode 100644 node_modules/bower/node_modules/bower-registry-client/node_modules/request/tests/ssl/npm-ca.crt delete mode 100644 node_modules/bower/node_modules/bower-registry-client/node_modules/request/tests/ssl/test.crt delete mode 100644 node_modules/bower/node_modules/bower-registry-client/node_modules/request/tests/ssl/test.key delete mode 100644 node_modules/bower/node_modules/bower-registry-client/node_modules/request/tests/test-agentOptions.js delete mode 100644 node_modules/bower/node_modules/bower-registry-client/node_modules/request/tests/test-basic-auth.js delete mode 100644 node_modules/bower/node_modules/bower-registry-client/node_modules/request/tests/test-body.js delete mode 100644 node_modules/bower/node_modules/bower-registry-client/node_modules/request/tests/test-defaults.js delete mode 100644 node_modules/bower/node_modules/bower-registry-client/node_modules/request/tests/test-digest-auth.js delete mode 100644 node_modules/bower/node_modules/bower-registry-client/node_modules/request/tests/test-emptyBody.js delete mode 100644 node_modules/bower/node_modules/bower-registry-client/node_modules/request/tests/test-errors.js delete mode 100644 node_modules/bower/node_modules/bower-registry-client/node_modules/request/tests/test-follow-all-303.js delete mode 100644 node_modules/bower/node_modules/bower-registry-client/node_modules/request/tests/test-follow-all.js delete mode 100644 node_modules/bower/node_modules/bower-registry-client/node_modules/request/tests/test-form.js delete mode 100755 node_modules/bower/node_modules/bower-registry-client/node_modules/request/tests/test-hawk.js delete mode 100644 node_modules/bower/node_modules/bower-registry-client/node_modules/request/tests/test-headers.js delete mode 100755 node_modules/bower/node_modules/bower-registry-client/node_modules/request/tests/test-http-signature.js delete mode 100644 node_modules/bower/node_modules/bower-registry-client/node_modules/request/tests/test-httpModule.js delete mode 100644 node_modules/bower/node_modules/bower-registry-client/node_modules/request/tests/test-https-strict.js delete mode 100644 node_modules/bower/node_modules/bower-registry-client/node_modules/request/tests/test-https.js delete mode 100644 node_modules/bower/node_modules/bower-registry-client/node_modules/request/tests/test-isUrl.js delete mode 100644 node_modules/bower/node_modules/bower-registry-client/node_modules/request/tests/test-localAddress.js delete mode 100644 node_modules/bower/node_modules/bower-registry-client/node_modules/request/tests/test-oauth.js delete mode 100644 node_modules/bower/node_modules/bower-registry-client/node_modules/request/tests/test-onelineproxy.js delete mode 100644 node_modules/bower/node_modules/bower-registry-client/node_modules/request/tests/test-params.js delete mode 100644 node_modules/bower/node_modules/bower-registry-client/node_modules/request/tests/test-piped-redirect.js delete mode 100644 node_modules/bower/node_modules/bower-registry-client/node_modules/request/tests/test-pipes.js delete mode 100644 node_modules/bower/node_modules/bower-registry-client/node_modules/request/tests/test-pool.js delete mode 100644 node_modules/bower/node_modules/bower-registry-client/node_modules/request/tests/test-protocol-changing-redirect.js delete mode 100644 node_modules/bower/node_modules/bower-registry-client/node_modules/request/tests/test-proxy.js delete mode 100644 node_modules/bower/node_modules/bower-registry-client/node_modules/request/tests/test-qs.js delete mode 100644 node_modules/bower/node_modules/bower-registry-client/node_modules/request/tests/test-redirect.js delete mode 100644 node_modules/bower/node_modules/bower-registry-client/node_modules/request/tests/test-s3.js delete mode 100644 node_modules/bower/node_modules/bower-registry-client/node_modules/request/tests/test-timeout.js delete mode 100644 node_modules/bower/node_modules/bower-registry-client/node_modules/request/tests/test-toJSON.js delete mode 100644 node_modules/bower/node_modules/bower-registry-client/node_modules/request/tests/test-tunnel.js delete mode 100644 node_modules/bower/node_modules/bower-registry-client/node_modules/request/tests/unicycle.jpg create mode 100644 node_modules/bower/node_modules/chalk/node_modules/escape-string-regexp/license create mode 100644 node_modules/bower/node_modules/fstream-ignore/node_modules/minimatch/benchmark.js create mode 100644 node_modules/bower/node_modules/fstream-ignore/node_modules/minimatch/browser.js rename node_modules/{csurf/node_modules/csrf/node_modules/rndm => bower/node_modules/fstream-ignore/node_modules/minimatch/node_modules/brace-expansion}/.npmignore (54%) create mode 100644 node_modules/bower/node_modules/fstream-ignore/node_modules/minimatch/node_modules/brace-expansion/.travis.yml create mode 100644 node_modules/bower/node_modules/fstream-ignore/node_modules/minimatch/node_modules/brace-expansion/README.md create mode 100644 node_modules/bower/node_modules/fstream-ignore/node_modules/minimatch/node_modules/brace-expansion/example.js create mode 100644 node_modules/bower/node_modules/fstream-ignore/node_modules/minimatch/node_modules/brace-expansion/index.js rename node_modules/{csurf/node_modules/csrf/node_modules/uid-safe => bower/node_modules/fstream-ignore/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match}/.npmignore (54%) rename node_modules/bower/node_modules/{insight/node_modules/os-name/node_modules/minimist => fstream-ignore/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match}/.travis.yml (100%) create mode 100644 node_modules/bower/node_modules/fstream-ignore/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/Makefile create mode 100644 node_modules/bower/node_modules/fstream-ignore/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/README.md create mode 100644 node_modules/bower/node_modules/fstream-ignore/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/example.js create mode 100644 node_modules/bower/node_modules/fstream-ignore/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/index.js create mode 100644 node_modules/bower/node_modules/fstream-ignore/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/package.json create mode 100644 node_modules/bower/node_modules/fstream-ignore/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/test/balanced.js create mode 100644 node_modules/bower/node_modules/fstream-ignore/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/.travis.yml rename node_modules/bower/node_modules/{insight/node_modules/os-name/node_modules/minimist => fstream-ignore/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map}/LICENSE (100%) create mode 100644 node_modules/bower/node_modules/fstream-ignore/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/README.markdown create mode 100644 node_modules/bower/node_modules/fstream-ignore/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/example/map.js create mode 100644 node_modules/bower/node_modules/fstream-ignore/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/index.js create mode 100644 node_modules/bower/node_modules/fstream-ignore/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/package.json create mode 100644 node_modules/bower/node_modules/fstream-ignore/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/test/map.js create mode 100644 node_modules/bower/node_modules/fstream-ignore/node_modules/minimatch/node_modules/brace-expansion/package.json create mode 100644 node_modules/bower/node_modules/fstream-ignore/node_modules/minimatch/node_modules/brace-expansion/test/bash-comparison.js create mode 100644 node_modules/bower/node_modules/fstream-ignore/node_modules/minimatch/node_modules/brace-expansion/test/bash-results.txt create mode 100644 node_modules/bower/node_modules/fstream-ignore/node_modules/minimatch/node_modules/brace-expansion/test/cases.txt create mode 100644 node_modules/bower/node_modules/fstream-ignore/node_modules/minimatch/node_modules/brace-expansion/test/dollar.js create mode 100644 node_modules/bower/node_modules/fstream-ignore/node_modules/minimatch/node_modules/brace-expansion/test/empty-option.js create mode 100644 node_modules/bower/node_modules/fstream-ignore/node_modules/minimatch/node_modules/brace-expansion/test/generate.sh create mode 100644 node_modules/bower/node_modules/fstream-ignore/node_modules/minimatch/node_modules/brace-expansion/test/negative-increment.js create mode 100644 node_modules/bower/node_modules/fstream-ignore/node_modules/minimatch/node_modules/brace-expansion/test/nested.js create mode 100644 node_modules/bower/node_modules/fstream-ignore/node_modules/minimatch/node_modules/brace-expansion/test/order.js create mode 100644 node_modules/bower/node_modules/fstream-ignore/node_modules/minimatch/node_modules/brace-expansion/test/pad.js create mode 100644 node_modules/bower/node_modules/fstream-ignore/node_modules/minimatch/node_modules/brace-expansion/test/same-type.js create mode 100644 node_modules/bower/node_modules/fstream-ignore/node_modules/minimatch/node_modules/brace-expansion/test/sequence.js delete mode 100644 node_modules/bower/node_modules/fstream-ignore/node_modules/minimatch/node_modules/sigmund/LICENSE delete mode 100644 node_modules/bower/node_modules/fstream-ignore/node_modules/minimatch/node_modules/sigmund/README.md delete mode 100644 node_modules/bower/node_modules/fstream-ignore/node_modules/minimatch/node_modules/sigmund/bench.js delete mode 100644 node_modules/bower/node_modules/fstream-ignore/node_modules/minimatch/node_modules/sigmund/package.json delete mode 100644 node_modules/bower/node_modules/fstream-ignore/node_modules/minimatch/node_modules/sigmund/sigmund.js delete mode 100644 node_modules/bower/node_modules/fstream-ignore/node_modules/minimatch/node_modules/sigmund/test/basic.js delete mode 100644 node_modules/bower/node_modules/fstream-ignore/node_modules/minimatch/test/caching.js create mode 100644 node_modules/bower/node_modules/handlebars/node_modules/uglify-js/node_modules/source-map/lib/source-map/mapping-list.js rename node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/{node_modules/es6-iterator/LICENCE => LICENSE} (94%) create mode 100644 node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/function/#/to-string-tokens.js rename node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/node_modules/{es6-symbol/LICENCE => es6-iterator/LICENSE} (94%) rename node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/{LICENCE => node_modules/es6-symbol/LICENSE} (94%) delete mode 100644 node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/node_modules/es6-symbol/test/valid-iterable.js rename node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/node_modules/es6-symbol/test/{valid-symbol.js => validate-symbol.js} (100%) rename node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/node_modules/es6-symbol/{valid-symbol.js => validate-symbol.js} (100%) create mode 100644 node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/object/serialize.js create mode 100644 node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/object/unserialize.js create mode 100644 node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/string/random-uniq.js create mode 100644 node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/test/function/#/to-string-tokens.js create mode 100644 node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/test/object/serialize.js create mode 100644 node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/test/object/unserialize.js create mode 100644 node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/test/string/random-uniq.js delete mode 100644 node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/memoizee/node_modules/es6-weak-map/node_modules/es6-iterator/LICENCE create mode 100644 node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/memoizee/node_modules/es6-weak-map/node_modules/es6-iterator/LICENSE create mode 100644 node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/memoizee/node_modules/es6-weak-map/node_modules/es6-iterator/node_modules/es6-symbol/.lint create mode 100644 node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/memoizee/node_modules/es6-weak-map/node_modules/es6-iterator/node_modules/es6-symbol/.npmignore create mode 100644 node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/memoizee/node_modules/es6-weak-map/node_modules/es6-iterator/node_modules/es6-symbol/.travis.yml create mode 100644 node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/memoizee/node_modules/es6-weak-map/node_modules/es6-iterator/node_modules/es6-symbol/CHANGES create mode 100644 node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/memoizee/node_modules/es6-weak-map/node_modules/es6-iterator/node_modules/es6-symbol/LICENSE create mode 100644 node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/memoizee/node_modules/es6-weak-map/node_modules/es6-iterator/node_modules/es6-symbol/README.md create mode 100644 node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/memoizee/node_modules/es6-weak-map/node_modules/es6-iterator/node_modules/es6-symbol/implement.js create mode 100644 node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/memoizee/node_modules/es6-weak-map/node_modules/es6-iterator/node_modules/es6-symbol/index.js create mode 100644 node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/memoizee/node_modules/es6-weak-map/node_modules/es6-iterator/node_modules/es6-symbol/is-implemented.js create mode 100644 node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/memoizee/node_modules/es6-weak-map/node_modules/es6-iterator/node_modules/es6-symbol/is-native-implemented.js create mode 100644 node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/memoizee/node_modules/es6-weak-map/node_modules/es6-iterator/node_modules/es6-symbol/is-symbol.js create mode 100644 node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/memoizee/node_modules/es6-weak-map/node_modules/es6-iterator/node_modules/es6-symbol/package.json create mode 100644 node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/memoizee/node_modules/es6-weak-map/node_modules/es6-iterator/node_modules/es6-symbol/polyfill.js create mode 100644 node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/memoizee/node_modules/es6-weak-map/node_modules/es6-iterator/node_modules/es6-symbol/test/implement.js create mode 100644 node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/memoizee/node_modules/es6-weak-map/node_modules/es6-iterator/node_modules/es6-symbol/test/index.js create mode 100644 node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/memoizee/node_modules/es6-weak-map/node_modules/es6-iterator/node_modules/es6-symbol/test/is-implemented.js create mode 100644 node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/memoizee/node_modules/es6-weak-map/node_modules/es6-iterator/node_modules/es6-symbol/test/is-native-implemented.js create mode 100644 node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/memoizee/node_modules/es6-weak-map/node_modules/es6-iterator/node_modules/es6-symbol/test/is-symbol.js create mode 100644 node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/memoizee/node_modules/es6-weak-map/node_modules/es6-iterator/node_modules/es6-symbol/test/polyfill.js rename node_modules/bower/node_modules/{insight/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/node_modules/es6-symbol/test/valid-symbol.js => inquirer/node_modules/cli-color/node_modules/memoizee/node_modules/es6-weak-map/node_modules/es6-iterator/node_modules/es6-symbol/test/validate-symbol.js} (100%) rename node_modules/bower/node_modules/{insight/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/node_modules/es6-symbol/valid-symbol.js => inquirer/node_modules/cli-color/node_modules/memoizee/node_modules/es6-weak-map/node_modules/es6-iterator/node_modules/es6-symbol/validate-symbol.js} (100%) delete mode 100644 node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/memoizee/node_modules/event-emitter/LICENCE create mode 100644 node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/memoizee/node_modules/event-emitter/LICENSE delete mode 100644 node_modules/bower/node_modules/inquirer/node_modules/readline2/.npmignore rename node_modules/bower/node_modules/inquirer/node_modules/readline2/node_modules/{chalk/node_modules => }/.bin/strip-ansi (100%) delete mode 100644 node_modules/bower/node_modules/inquirer/node_modules/readline2/node_modules/chalk/index.js delete mode 100644 node_modules/bower/node_modules/inquirer/node_modules/readline2/node_modules/chalk/node_modules/ansi-styles/ansi-styles.js delete mode 100644 node_modules/bower/node_modules/inquirer/node_modules/readline2/node_modules/chalk/node_modules/ansi-styles/package.json delete mode 100644 node_modules/bower/node_modules/inquirer/node_modules/readline2/node_modules/chalk/node_modules/ansi-styles/readme.md delete mode 100644 node_modules/bower/node_modules/inquirer/node_modules/readline2/node_modules/chalk/node_modules/has-color/index.js delete mode 100644 node_modules/bower/node_modules/inquirer/node_modules/readline2/node_modules/chalk/node_modules/has-color/package.json delete mode 100644 node_modules/bower/node_modules/inquirer/node_modules/readline2/node_modules/chalk/node_modules/has-color/readme.md delete mode 100755 node_modules/bower/node_modules/inquirer/node_modules/readline2/node_modules/chalk/node_modules/strip-ansi/cli.js delete mode 100644 node_modules/bower/node_modules/inquirer/node_modules/readline2/node_modules/chalk/node_modules/strip-ansi/index.js delete mode 100644 node_modules/bower/node_modules/inquirer/node_modules/readline2/node_modules/chalk/node_modules/strip-ansi/readme.md delete mode 100644 node_modules/bower/node_modules/inquirer/node_modules/readline2/node_modules/chalk/package.json delete mode 100644 node_modules/bower/node_modules/inquirer/node_modules/readline2/node_modules/chalk/readme.md create mode 100755 node_modules/bower/node_modules/inquirer/node_modules/readline2/node_modules/strip-ansi/cli.js create mode 100644 node_modules/bower/node_modules/inquirer/node_modules/readline2/node_modules/strip-ansi/index.js create mode 100644 node_modules/bower/node_modules/inquirer/node_modules/readline2/node_modules/strip-ansi/node_modules/ansi-regex/index.js create mode 100644 node_modules/bower/node_modules/inquirer/node_modules/readline2/node_modules/strip-ansi/node_modules/ansi-regex/license create mode 100644 node_modules/bower/node_modules/inquirer/node_modules/readline2/node_modules/strip-ansi/node_modules/ansi-regex/package.json create mode 100644 node_modules/bower/node_modules/inquirer/node_modules/readline2/node_modules/strip-ansi/node_modules/ansi-regex/readme.md rename node_modules/bower/node_modules/{insight/node_modules/inquirer/node_modules/readline2/node_modules/chalk => inquirer/node_modules/readline2}/node_modules/strip-ansi/package.json (67%) create mode 100644 node_modules/bower/node_modules/inquirer/node_modules/readline2/node_modules/strip-ansi/readme.md create mode 100644 node_modules/bower/node_modules/inquirer/node_modules/rx/.jscsrc create mode 100644 node_modules/bower/node_modules/inquirer/node_modules/rx/.jscsrc.todo create mode 100644 node_modules/bower/node_modules/inquirer/node_modules/rx/dist/rx.sorting.js create mode 100644 node_modules/bower/node_modules/inquirer/node_modules/rx/dist/rx.sorting.map create mode 100644 node_modules/bower/node_modules/inquirer/node_modules/rx/dist/rx.sorting.min.js create mode 100644 node_modules/bower/node_modules/inquirer/node_modules/rx/logos/logo.png delete mode 100644 node_modules/bower/node_modules/inquirer/node_modules/rx/src/core/backpressure/controlledobservable.js delete mode 100644 node_modules/bower/node_modules/inquirer/node_modules/rx/src/core/backpressure/controlledsubject.js create mode 100644 node_modules/bower/node_modules/inquirer/node_modules/rx/src/core/backpressure/pauser.js delete mode 100644 node_modules/bower/node_modules/inquirer/node_modules/rx/src/core/backpressure/stopandawait.js create mode 100644 node_modules/bower/node_modules/inquirer/node_modules/rx/src/core/backpressure/stopandwait.js delete mode 100644 node_modules/bower/node_modules/inquirer/node_modules/rx/src/core/backpressure/stopandwaitobservable.js delete mode 100644 node_modules/bower/node_modules/inquirer/node_modules/rx/src/core/backpressure/windowedobservable.js delete mode 100644 node_modules/bower/node_modules/inquirer/node_modules/rx/src/core/concurrency/currentthreadscheduler-lite.js create mode 100644 node_modules/bower/node_modules/inquirer/node_modules/rx/src/core/enumerable.js rename node_modules/bower/node_modules/inquirer/node_modules/rx/src/core/{internal => }/enumerator.js (100%) delete mode 100644 node_modules/bower/node_modules/inquirer/node_modules/rx/src/core/exports.js create mode 100644 node_modules/bower/node_modules/inquirer/node_modules/rx/src/core/expressions/compiler.ts rename node_modules/bower/node_modules/inquirer/node_modules/rx/src/core/{ => headers}/aggregatesheader.js (63%) rename node_modules/bower/node_modules/{insight/node_modules/inquirer/node_modules/rx/src/core => inquirer/node_modules/rx/src/core/headers}/asyncheader.js (80%) rename node_modules/bower/node_modules/inquirer/node_modules/rx/src/core/{ => headers}/asyncintro.js (100%) rename node_modules/bower/node_modules/{insight/node_modules/inquirer/node_modules/rx/src/core => inquirer/node_modules/rx/src/core/headers}/backpressureheader.js (68%) rename node_modules/bower/node_modules/{insight/node_modules/inquirer/node_modules/rx/src/core => inquirer/node_modules/rx/src/core/headers}/basicheader-modern.js (83%) rename node_modules/bower/node_modules/{insight/node_modules/inquirer/node_modules/rx/src/core => inquirer/node_modules/rx/src/core/headers}/basicheader.js (84%) rename node_modules/bower/node_modules/inquirer/node_modules/rx/src/core/{ => headers}/bindingheader.js (70%) rename node_modules/bower/node_modules/inquirer/node_modules/rx/src/core/{ => headers}/coincidenceheader.js (81%) rename node_modules/bower/node_modules/inquirer/node_modules/rx/src/core/{ => headers}/enumeratorheader.js (58%) rename node_modules/bower/node_modules/inquirer/node_modules/rx/src/core/{ => headers}/experimentalheader.js (84%) create mode 100644 node_modules/bower/node_modules/inquirer/node_modules/rx/src/core/headers/exports.js rename node_modules/bower/node_modules/inquirer/node_modules/rx/src/core/{ => headers}/intro.js (89%) create mode 100644 node_modules/bower/node_modules/inquirer/node_modules/rx/src/core/headers/joinpatternsheader.js rename node_modules/bower/node_modules/inquirer/node_modules/rx/src/core/{ => headers}/license.js (100%) rename node_modules/bower/node_modules/inquirer/node_modules/rx/src/core/{ => headers}/liteextrasheader.js (71%) rename node_modules/bower/node_modules/{insight/node_modules/inquirer/node_modules/rx/src/core => inquirer/node_modules/rx/src/core/headers}/liteheader-compat.js (84%) rename node_modules/bower/node_modules/inquirer/node_modules/rx/src/core/{ => headers}/liteheader.js (83%) rename node_modules/bower/node_modules/inquirer/node_modules/rx/src/core/{ => headers}/outro.js (100%) create mode 100644 node_modules/bower/node_modules/inquirer/node_modules/rx/src/core/headers/sortingheader.js rename node_modules/bower/node_modules/inquirer/node_modules/rx/src/core/{ => headers}/subintro.js (100%) rename node_modules/bower/node_modules/inquirer/node_modules/rx/src/core/{ => headers}/suboutro.js (100%) create mode 100644 node_modules/bower/node_modules/inquirer/node_modules/rx/src/core/headers/testheader.js create mode 100644 node_modules/bower/node_modules/inquirer/node_modules/rx/src/core/headers/testintro.js rename node_modules/bower/node_modules/inquirer/node_modules/rx/src/core/{ => headers}/timeheader.js (88%) rename node_modules/bower/node_modules/inquirer/node_modules/rx/src/core/{ => headers}/virtualtimeheader.js (71%) create mode 100644 node_modules/bower/node_modules/inquirer/node_modules/rx/src/core/internal/bindcallback.js create mode 100644 node_modules/bower/node_modules/inquirer/node_modules/rx/src/core/internal/deprecate.js create mode 100644 node_modules/bower/node_modules/inquirer/node_modules/rx/src/core/internal/dontenums.js delete mode 100644 node_modules/bower/node_modules/inquirer/node_modules/rx/src/core/internal/enumerable.js create mode 100644 node_modules/bower/node_modules/inquirer/node_modules/rx/src/core/internal/errors.js delete mode 100644 node_modules/bower/node_modules/inquirer/node_modules/rx/src/core/internal/objecttypes.js create mode 100644 node_modules/bower/node_modules/inquirer/node_modules/rx/src/core/internal/trycatch.js delete mode 100644 node_modules/bower/node_modules/inquirer/node_modules/rx/src/core/joinpatternsheader.js delete mode 100644 node_modules/bower/node_modules/inquirer/node_modules/rx/src/core/linq/observable/all.js delete mode 100644 node_modules/bower/node_modules/inquirer/node_modules/rx/src/core/linq/observable/any.js rename node_modules/bower/node_modules/inquirer/node_modules/rx/src/core/linq/observable/{bufferwithtimeourcount.js => bufferwithtimeorcount.js} (98%) create mode 100644 node_modules/bower/node_modules/inquirer/node_modules/rx/src/core/linq/observable/combinedsynchronized.js create mode 100644 node_modules/bower/node_modules/inquirer/node_modules/rx/src/core/linq/observable/concatall.js delete mode 100644 node_modules/bower/node_modules/inquirer/node_modules/rx/src/core/linq/observable/concatobservable.js rename node_modules/bower/node_modules/inquirer/node_modules/rx/src/core/linq/observable/{throttle.js => debounce.js} (67%) rename node_modules/bower/node_modules/inquirer/node_modules/rx/src/core/linq/observable/{throttlewithselector.js => debouncewithselector.js} (67%) create mode 100644 node_modules/bower/node_modules/inquirer/node_modules/rx/src/core/linq/observable/every.js delete mode 100644 node_modules/bower/node_modules/inquirer/node_modules/rx/src/core/linq/observable/finalvalue.js rename node_modules/bower/node_modules/inquirer/node_modules/rx/src/core/linq/observable/{contains.js => includes.js} (57%) rename node_modules/bower/node_modules/inquirer/node_modules/rx/src/core/linq/observable/{mergeobservable.js => mergeall.js} (62%) create mode 100644 node_modules/bower/node_modules/inquirer/node_modules/rx/src/core/linq/observable/mergedelayerror.js create mode 100644 node_modules/bower/node_modules/inquirer/node_modules/rx/src/core/linq/observable/ofarraychanges.js create mode 100644 node_modules/bower/node_modules/inquirer/node_modules/rx/src/core/linq/observable/ofobjectchanges.js create mode 100644 node_modules/bower/node_modules/inquirer/node_modules/rx/src/core/linq/observable/pairs.js create mode 100644 node_modules/bower/node_modules/inquirer/node_modules/rx/src/core/linq/observable/retrywhen.js create mode 100644 node_modules/bower/node_modules/inquirer/node_modules/rx/src/core/linq/observable/singleinstance.js create mode 100644 node_modules/bower/node_modules/inquirer/node_modules/rx/src/core/linq/observable/some.js rename node_modules/bower/node_modules/{insight/node_modules/inquirer/node_modules/rx/src/core/linq/observable/then.js => inquirer/node_modules/rx/src/core/linq/observable/thendo.js} (76%) create mode 100644 node_modules/bower/node_modules/inquirer/node_modules/rx/src/core/linq/observable/throttlefirst.js create mode 100644 node_modules/bower/node_modules/inquirer/node_modules/rx/src/core/linq/observable/transduce.js create mode 100644 node_modules/bower/node_modules/inquirer/node_modules/rx/src/core/linq/observable/withlatestfrom.js create mode 100644 node_modules/bower/node_modules/inquirer/node_modules/rx/src/core/longstacktraces/longstackbegin.js create mode 100644 node_modules/bower/node_modules/inquirer/node_modules/rx/src/core/longstacktraces/longstackend.js create mode 100644 node_modules/bower/node_modules/inquirer/node_modules/rx/src/core/longstacktraces/longstacktraces.js create mode 100644 node_modules/bower/node_modules/inquirer/node_modules/rx/src/core/perf/observablebase.js create mode 100644 node_modules/bower/node_modules/inquirer/node_modules/rx/src/core/perf/operators/combinelatest.js create mode 100644 node_modules/bower/node_modules/inquirer/node_modules/rx/src/core/perf/operators/distinctuntilchanged.js create mode 100644 node_modules/bower/node_modules/inquirer/node_modules/rx/src/core/perf/operators/filter.js create mode 100644 node_modules/bower/node_modules/inquirer/node_modules/rx/src/core/perf/operators/from.js create mode 100644 node_modules/bower/node_modules/inquirer/node_modules/rx/src/core/perf/operators/fromarray.js create mode 100644 node_modules/bower/node_modules/inquirer/node_modules/rx/src/core/perf/operators/fromarrayobservable.js create mode 100644 node_modules/bower/node_modules/inquirer/node_modules/rx/src/core/perf/operators/map.js create mode 100644 node_modules/bower/node_modules/inquirer/node_modules/rx/src/core/perf/operators/mergeall.js create mode 100644 node_modules/bower/node_modules/inquirer/node_modules/rx/src/core/perf/operators/mergeproto.js create mode 100644 node_modules/bower/node_modules/inquirer/node_modules/rx/src/core/perf/operators/of.js create mode 100644 node_modules/bower/node_modules/inquirer/node_modules/rx/src/core/perf/operators/range.js create mode 100644 node_modules/bower/node_modules/inquirer/node_modules/rx/src/core/perf/operators/reduce.js create mode 100644 node_modules/bower/node_modules/inquirer/node_modules/rx/src/core/perf/operators/scan.js create mode 100644 node_modules/bower/node_modules/inquirer/node_modules/rx/src/core/perf/operators/switch.js create mode 100644 node_modules/bower/node_modules/inquirer/node_modules/rx/src/core/perf/operators/tap.js create mode 100644 node_modules/bower/node_modules/inquirer/node_modules/rx/src/core/perf/operators/toarray.js delete mode 100644 node_modules/bower/node_modules/inquirer/node_modules/rx/src/core/polyfills.js delete mode 100644 node_modules/bower/node_modules/inquirer/node_modules/rx/src/core/testheader.js create mode 100644 node_modules/bower/node_modules/inquirer/node_modules/rx/src/core/testing/mockpromise.js delete mode 100644 node_modules/bower/node_modules/inquirer/node_modules/rx/src/core/testintro.js create mode 100644 node_modules/bower/node_modules/inquirer/node_modules/rx/ts/rx.all.d.ts delete mode 100644 node_modules/bower/node_modules/inquirer/node_modules/rx/ts/rx.all.ts create mode 100644 node_modules/bower/node_modules/insight/node_modules/chalk/node_modules/escape-string-regexp/license rename node_modules/bower/node_modules/{update-notifier/node_modules/configstore/configstore.js => insight/node_modules/configstore/index.js} (91%) create mode 120000 node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/.bin/user-home rename node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/{HISTORY.md => CHANGELOG.md} (75%) create mode 100644 node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/dist/js-yaml.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/dist/js-yaml.min.js rename node_modules/bower/node_modules/{update-notifier/node_modules/configstore/node_modules/js-yaml/examples/custom_types.yaml => insight/node_modules/configstore/node_modules/js-yaml/examples/custom_types.yml} (90%) rename node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/examples/{sample_document.yaml => sample_document.yml} (100%) delete mode 100644 node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/index_browser.js rename node_modules/bower/node_modules/{update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/HISTORY.md => insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/CHANGELOG.md} (84%) create mode 100644 node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/LICENSE.txt create mode 100644 node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/README.md create mode 100644 node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/array.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/array/chunk.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/array/compact.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/array/difference.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/array/drop.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/array/dropRight.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/array/dropRightWhile.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/array/dropWhile.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/array/fill.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/array/findIndex.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/array/findLastIndex.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/array/first.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/array/flatten.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/array/flattenDeep.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/array/head.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/array/indexOf.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/array/initial.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/array/intersection.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/array/last.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/array/lastIndexOf.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/array/object.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/array/pull.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/array/pullAt.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/array/remove.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/array/rest.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/array/slice.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/array/sortedIndex.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/array/sortedLastIndex.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/array/tail.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/array/take.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/array/takeRight.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/array/takeRightWhile.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/array/takeWhile.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/array/union.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/array/uniq.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/array/unique.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/array/unzip.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/array/without.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/array/xor.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/array/zip.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/array/zipObject.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/chain.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/chain/chain.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/chain/commit.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/chain/lodash.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/chain/plant.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/chain/reverse.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/chain/run.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/chain/tap.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/chain/thru.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/chain/toJSON.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/chain/toString.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/chain/value.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/chain/valueOf.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/chain/wrapperChain.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/chain/wrapperCommit.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/chain/wrapperPlant.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/chain/wrapperReverse.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/chain/wrapperToString.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/chain/wrapperValue.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/collection.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/collection/all.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/collection/any.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/collection/at.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/collection/collect.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/collection/contains.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/collection/countBy.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/collection/detect.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/collection/each.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/collection/eachRight.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/collection/every.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/collection/filter.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/collection/find.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/collection/findLast.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/collection/findWhere.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/collection/foldl.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/collection/foldr.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/collection/forEach.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/collection/forEachRight.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/collection/groupBy.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/collection/include.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/collection/includes.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/collection/indexBy.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/collection/inject.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/collection/invoke.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/collection/map.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/collection/max.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/collection/min.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/collection/partition.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/collection/pluck.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/collection/reduce.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/collection/reduceRight.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/collection/reject.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/collection/sample.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/collection/select.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/collection/shuffle.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/collection/size.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/collection/some.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/collection/sortBy.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/collection/sortByAll.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/collection/where.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/date.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/date/now.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/function.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/function/after.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/function/ary.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/function/backflow.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/function/before.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/function/bind.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/function/bindAll.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/function/bindKey.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/function/compose.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/function/curry.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/function/curryRight.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/function/debounce.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/function/defer.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/function/delay.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/function/flow.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/function/flowRight.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/function/memoize.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/function/negate.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/function/once.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/function/partial.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/function/partialRight.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/function/rearg.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/function/spread.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/function/throttle.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/function/wrap.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/index.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/LazyWrapper.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/LodashWrapper.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/MapCache.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/SetCache.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/arrayCopy.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/arrayEach.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/arrayEachRight.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/arrayEvery.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/arrayFilter.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/arrayMap.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/arrayMax.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/arrayMin.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/arrayReduce.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/arrayReduceRight.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/arraySome.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/assignDefaults.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/assignOwnDefaults.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/baseAssign.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/baseAt.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/baseBindAll.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/baseCallback.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/baseClone.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/baseCompareAscending.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/baseCopy.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/baseCreate.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/baseDelay.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/baseDifference.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/baseEach.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/baseEachRight.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/baseEvery.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/baseFill.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/baseFilter.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/baseFind.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/baseFlatten.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/baseFor.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/baseForIn.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/baseForOwn.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/baseForOwnRight.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/baseForRight.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/baseFunctions.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/baseIndexOf.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/baseInvoke.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/baseIsEqual.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/baseIsEqualDeep.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/baseIsMatch.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/baseMap.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/baseMatches.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/baseMatchesProperty.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/baseMerge.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/baseMergeDeep.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/baseProperty.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/basePullAt.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/baseRandom.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/baseReduce.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/baseSetData.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/baseSlice.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/baseSome.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/baseSortBy.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/baseToString.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/baseUniq.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/baseValues.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/baseWrapperValue.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/binaryIndex.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/binaryIndexBy.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/bindCallback.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/bufferClone.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/cacheIndexOf.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/cachePush.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/charAtCallback.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/charsLeftIndex.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/charsRightIndex.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/compareAscending.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/compareMultipleAscending.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/composeArgs.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/composeArgsRight.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/createAggregator.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/createAssigner.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/createBindWrapper.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/createCache.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/createCompounder.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/createCtorWrapper.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/createExtremum.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/createHybridWrapper.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/createPad.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/createPartialWrapper.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/createWrapper.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/deburrLetter.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/equalArrays.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/equalByTag.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/equalObjects.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/escapeHtmlChar.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/escapeStringChar.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/extremumBy.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/getData.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/getView.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/indexOfNaN.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/initCloneArray.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/initCloneByTag.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/initCloneObject.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/isBindable.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/isIndex.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/isIterateeCall.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/isLength.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/isObjectLike.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/isSpace.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/isStrictComparable.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/lazyClone.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/lazyReverse.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/lazyValue.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/mapDelete.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/mapGet.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/mapHas.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/mapSet.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/mergeData.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/metaMap.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/pickByArray.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/pickByCallback.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/reEscape.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/reEvaluate.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/reInterpolate.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/reorder.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/replaceHolders.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/setData.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/shimIsPlainObject.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/shimKeys.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/sortedUniq.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/toIterable.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/toObject.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/trimmedLeftIndex.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/trimmedRightIndex.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/unescapeHtmlChar.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/wrapperClone.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/lang.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/lang/clone.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/lang/cloneDeep.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/lang/isArguments.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/lang/isArray.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/lang/isBoolean.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/lang/isDate.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/lang/isElement.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/lang/isEmpty.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/lang/isEqual.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/lang/isError.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/lang/isFinite.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/lang/isFunction.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/lang/isMatch.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/lang/isNaN.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/lang/isNative.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/lang/isNull.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/lang/isNumber.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/lang/isObject.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/lang/isPlainObject.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/lang/isRegExp.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/lang/isString.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/lang/isTypedArray.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/lang/isUndefined.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/lang/toArray.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/lang/toPlainObject.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/number.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/number/random.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/object.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/object/assign.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/object/create.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/object/defaults.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/object/extend.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/object/findKey.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/object/findLastKey.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/object/forIn.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/object/forInRight.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/object/forOwn.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/object/forOwnRight.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/object/functions.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/object/has.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/object/invert.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/object/keys.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/object/keysIn.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/object/mapValues.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/object/merge.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/object/methods.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/object/omit.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/object/pairs.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/object/pick.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/object/result.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/object/transform.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/object/values.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/object/valuesIn.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/package.json create mode 100644 node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/string.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/string/camelCase.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/string/capitalize.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/string/deburr.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/string/endsWith.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/string/escape.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/string/escapeRegExp.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/string/kebabCase.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/string/pad.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/string/padLeft.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/string/padRight.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/string/parseInt.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/string/repeat.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/string/snakeCase.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/string/startCase.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/string/startsWith.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/string/template.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/string/templateSettings.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/string/trim.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/string/trimLeft.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/string/trimRight.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/string/trunc.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/string/unescape.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/string/words.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/support.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/utility.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/utility/attempt.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/utility/callback.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/utility/constant.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/utility/identity.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/utility/iteratee.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/utility/matches.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/utility/matchesProperty.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/utility/mixin.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/utility/noop.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/utility/property.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/utility/propertyOf.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/utility/range.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/utility/times.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/utility/uniqueId.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/sprintf-js/.npmignore create mode 100644 node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/sprintf-js/LICENSE create mode 100644 node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/sprintf-js/README.md create mode 100644 node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/sprintf-js/bower.json create mode 100644 node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/sprintf-js/demo/angular.html create mode 100644 node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/sprintf-js/dist/angular-sprintf.min.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/sprintf-js/dist/angular-sprintf.min.map create mode 100644 node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/sprintf-js/dist/sprintf.min.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/sprintf-js/dist/sprintf.min.map create mode 100644 node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/sprintf-js/gruntfile.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/sprintf-js/package.json create mode 100644 node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/sprintf-js/src/angular-sprintf.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/sprintf-js/src/sprintf.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/sprintf-js/test/test.js delete mode 100644 node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/Gemfile delete mode 100644 node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/Gemfile.lock delete mode 100644 node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/README.markdown delete mode 100644 node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/component.json delete mode 100644 node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/dist/underscore.string.min.js delete mode 100644 node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/lib/underscore.string.js delete mode 100644 node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/libpeerconnection.log delete mode 100644 node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/test/run-qunit.js delete mode 100644 node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/test/speed.js delete mode 100644 node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/test/strings.js delete mode 100644 node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/test/strings_standalone.js delete mode 100644 node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/test/test_underscore/arrays.js delete mode 100644 node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/test/test_underscore/chaining.js delete mode 100644 node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/test/test_underscore/collections.js delete mode 100644 node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/test/test_underscore/functions.js delete mode 100644 node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/test/test_underscore/index.html delete mode 100644 node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/test/test_underscore/objects.js delete mode 100644 node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/test/test_underscore/utility.js delete mode 100644 node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/test/test_underscore/vendor/jquery.js delete mode 100644 node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/test/test_underscore/vendor/qunit.css delete mode 100644 node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/test/test_underscore/vendor/qunit.js delete mode 100644 node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/test/underscore.js delete mode 100644 node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/underscore/.npmignore delete mode 100644 node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/underscore/.travis.yml delete mode 100644 node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/underscore/CNAME delete mode 100644 node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/underscore/CONTRIBUTING.md delete mode 100644 node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/underscore/LICENSE delete mode 100644 node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/underscore/README.md delete mode 100644 node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/underscore/favicon.ico delete mode 100644 node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/underscore/index.html delete mode 100644 node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/underscore/index.js delete mode 100644 node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/underscore/package.json delete mode 100644 node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/underscore/underscore-min.js delete mode 100644 node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/underscore/underscore.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/object-assign/index.js delete mode 100644 node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/object-assign/object-assign.js create mode 100755 node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/user-home/cli.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/user-home/index.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/user-home/license create mode 100644 node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/user-home/package.json create mode 100644 node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/user-home/readme.md delete mode 100644 node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/uuid/buffer-browser.js delete mode 100644 node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/uuid/buffer.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/xdg-basedir/index.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/xdg-basedir/license create mode 100644 node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/xdg-basedir/package.json create mode 100644 node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/xdg-basedir/readme.md delete mode 100644 node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/LICENCE create mode 100644 node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/LICENSE create mode 100644 node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/function/#/to-string-tokens.js delete mode 100644 node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/node_modules/es6-iterator/LICENCE create mode 100644 node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/node_modules/es6-iterator/LICENSE delete mode 100644 node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/node_modules/es6-symbol/LICENCE create mode 100644 node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/node_modules/es6-symbol/LICENSE delete mode 100644 node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/node_modules/es6-symbol/test/valid-iterable.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/node_modules/es6-symbol/test/validate-symbol.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/node_modules/es6-symbol/validate-symbol.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/object/serialize.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/object/unserialize.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/string/random-uniq.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/test/function/#/to-string-tokens.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/test/object/serialize.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/test/object/unserialize.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/test/string/random-uniq.js delete mode 100644 node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/memoizee/node_modules/es6-weak-map/node_modules/es6-iterator/LICENCE create mode 100644 node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/memoizee/node_modules/es6-weak-map/node_modules/es6-iterator/LICENSE create mode 100644 node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/memoizee/node_modules/es6-weak-map/node_modules/es6-iterator/node_modules/es6-symbol/.lint create mode 100644 node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/memoizee/node_modules/es6-weak-map/node_modules/es6-iterator/node_modules/es6-symbol/.npmignore create mode 100644 node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/memoizee/node_modules/es6-weak-map/node_modules/es6-iterator/node_modules/es6-symbol/.travis.yml create mode 100644 node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/memoizee/node_modules/es6-weak-map/node_modules/es6-iterator/node_modules/es6-symbol/CHANGES create mode 100644 node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/memoizee/node_modules/es6-weak-map/node_modules/es6-iterator/node_modules/es6-symbol/LICENSE create mode 100644 node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/memoizee/node_modules/es6-weak-map/node_modules/es6-iterator/node_modules/es6-symbol/README.md create mode 100644 node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/memoizee/node_modules/es6-weak-map/node_modules/es6-iterator/node_modules/es6-symbol/implement.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/memoizee/node_modules/es6-weak-map/node_modules/es6-iterator/node_modules/es6-symbol/index.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/memoizee/node_modules/es6-weak-map/node_modules/es6-iterator/node_modules/es6-symbol/is-implemented.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/memoizee/node_modules/es6-weak-map/node_modules/es6-iterator/node_modules/es6-symbol/is-native-implemented.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/memoizee/node_modules/es6-weak-map/node_modules/es6-iterator/node_modules/es6-symbol/is-symbol.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/memoizee/node_modules/es6-weak-map/node_modules/es6-iterator/node_modules/es6-symbol/package.json create mode 100644 node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/memoizee/node_modules/es6-weak-map/node_modules/es6-iterator/node_modules/es6-symbol/polyfill.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/memoizee/node_modules/es6-weak-map/node_modules/es6-iterator/node_modules/es6-symbol/test/implement.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/memoizee/node_modules/es6-weak-map/node_modules/es6-iterator/node_modules/es6-symbol/test/index.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/memoizee/node_modules/es6-weak-map/node_modules/es6-iterator/node_modules/es6-symbol/test/is-implemented.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/memoizee/node_modules/es6-weak-map/node_modules/es6-iterator/node_modules/es6-symbol/test/is-native-implemented.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/memoizee/node_modules/es6-weak-map/node_modules/es6-iterator/node_modules/es6-symbol/test/is-symbol.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/memoizee/node_modules/es6-weak-map/node_modules/es6-iterator/node_modules/es6-symbol/test/polyfill.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/memoizee/node_modules/es6-weak-map/node_modules/es6-iterator/node_modules/es6-symbol/test/validate-symbol.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/memoizee/node_modules/es6-weak-map/node_modules/es6-iterator/node_modules/es6-symbol/validate-symbol.js delete mode 100644 node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/memoizee/node_modules/event-emitter/LICENCE create mode 100644 node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/memoizee/node_modules/event-emitter/LICENSE delete mode 100644 node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/readline2/.npmignore rename node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/readline2/node_modules/{chalk/node_modules => }/.bin/strip-ansi (100%) delete mode 100644 node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/readline2/node_modules/chalk/index.js delete mode 100644 node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/readline2/node_modules/chalk/node_modules/ansi-styles/ansi-styles.js delete mode 100644 node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/readline2/node_modules/chalk/node_modules/ansi-styles/package.json delete mode 100644 node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/readline2/node_modules/chalk/node_modules/ansi-styles/readme.md delete mode 100644 node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/readline2/node_modules/chalk/node_modules/has-color/index.js delete mode 100644 node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/readline2/node_modules/chalk/node_modules/has-color/package.json delete mode 100644 node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/readline2/node_modules/chalk/node_modules/has-color/readme.md delete mode 100755 node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/readline2/node_modules/chalk/node_modules/strip-ansi/cli.js delete mode 100644 node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/readline2/node_modules/chalk/node_modules/strip-ansi/index.js delete mode 100644 node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/readline2/node_modules/chalk/node_modules/strip-ansi/readme.md delete mode 100644 node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/readline2/node_modules/chalk/package.json delete mode 100644 node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/readline2/node_modules/chalk/readme.md create mode 100755 node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/readline2/node_modules/strip-ansi/cli.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/readline2/node_modules/strip-ansi/index.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/readline2/node_modules/strip-ansi/node_modules/ansi-regex/index.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/readline2/node_modules/strip-ansi/node_modules/ansi-regex/license create mode 100644 node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/readline2/node_modules/strip-ansi/node_modules/ansi-regex/package.json create mode 100644 node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/readline2/node_modules/strip-ansi/node_modules/ansi-regex/readme.md rename node_modules/bower/node_modules/{inquirer/node_modules/readline2/node_modules/chalk => insight/node_modules/inquirer/node_modules/readline2}/node_modules/strip-ansi/package.json (67%) create mode 100644 node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/readline2/node_modules/strip-ansi/readme.md create mode 100644 node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/rx/.jscsrc create mode 100644 node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/rx/.jscsrc.todo create mode 100644 node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/rx/dist/rx.sorting.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/rx/dist/rx.sorting.map create mode 100644 node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/rx/dist/rx.sorting.min.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/rx/logos/logo.png delete mode 100644 node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/rx/src/core/backpressure/controlledobservable.js delete mode 100644 node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/rx/src/core/backpressure/controlledsubject.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/rx/src/core/backpressure/pauser.js delete mode 100644 node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/rx/src/core/backpressure/stopandawait.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/rx/src/core/backpressure/stopandwait.js delete mode 100644 node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/rx/src/core/backpressure/stopandwaitobservable.js delete mode 100644 node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/rx/src/core/backpressure/windowedobservable.js delete mode 100644 node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/rx/src/core/concurrency/currentthreadscheduler-lite.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/rx/src/core/enumerable.js rename node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/rx/src/core/{internal => }/enumerator.js (100%) delete mode 100644 node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/rx/src/core/exports.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/rx/src/core/expressions/compiler.ts rename node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/rx/src/core/{ => headers}/aggregatesheader.js (63%) rename node_modules/bower/node_modules/{inquirer/node_modules/rx/src/core => insight/node_modules/inquirer/node_modules/rx/src/core/headers}/asyncheader.js (80%) rename node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/rx/src/core/{ => headers}/asyncintro.js (100%) rename node_modules/bower/node_modules/{inquirer/node_modules/rx/src/core => insight/node_modules/inquirer/node_modules/rx/src/core/headers}/backpressureheader.js (68%) rename node_modules/bower/node_modules/{inquirer/node_modules/rx/src/core => insight/node_modules/inquirer/node_modules/rx/src/core/headers}/basicheader-modern.js (83%) rename node_modules/bower/node_modules/{inquirer/node_modules/rx/src/core => insight/node_modules/inquirer/node_modules/rx/src/core/headers}/basicheader.js (84%) rename node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/rx/src/core/{ => headers}/bindingheader.js (70%) rename node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/rx/src/core/{ => headers}/coincidenceheader.js (81%) rename node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/rx/src/core/{ => headers}/enumeratorheader.js (58%) rename node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/rx/src/core/{ => headers}/experimentalheader.js (84%) create mode 100644 node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/rx/src/core/headers/exports.js rename node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/rx/src/core/{ => headers}/intro.js (89%) create mode 100644 node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/rx/src/core/headers/joinpatternsheader.js rename node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/rx/src/core/{ => headers}/license.js (100%) rename node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/rx/src/core/{ => headers}/liteextrasheader.js (71%) rename node_modules/bower/node_modules/{inquirer/node_modules/rx/src/core => insight/node_modules/inquirer/node_modules/rx/src/core/headers}/liteheader-compat.js (84%) rename node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/rx/src/core/{ => headers}/liteheader.js (83%) rename node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/rx/src/core/{ => headers}/outro.js (100%) create mode 100644 node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/rx/src/core/headers/sortingheader.js rename node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/rx/src/core/{ => headers}/subintro.js (100%) rename node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/rx/src/core/{ => headers}/suboutro.js (100%) create mode 100644 node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/rx/src/core/headers/testheader.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/rx/src/core/headers/testintro.js rename node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/rx/src/core/{ => headers}/timeheader.js (88%) rename node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/rx/src/core/{ => headers}/virtualtimeheader.js (71%) create mode 100644 node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/rx/src/core/internal/bindcallback.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/rx/src/core/internal/deprecate.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/rx/src/core/internal/dontenums.js delete mode 100644 node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/rx/src/core/internal/enumerable.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/rx/src/core/internal/errors.js delete mode 100644 node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/rx/src/core/internal/objecttypes.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/rx/src/core/internal/trycatch.js delete mode 100644 node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/rx/src/core/joinpatternsheader.js delete mode 100644 node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/rx/src/core/linq/observable/all.js delete mode 100644 node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/rx/src/core/linq/observable/any.js rename node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/rx/src/core/linq/observable/{bufferwithtimeourcount.js => bufferwithtimeorcount.js} (98%) create mode 100644 node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/rx/src/core/linq/observable/combinedsynchronized.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/rx/src/core/linq/observable/concatall.js delete mode 100644 node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/rx/src/core/linq/observable/concatobservable.js rename node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/rx/src/core/linq/observable/{throttle.js => debounce.js} (67%) rename node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/rx/src/core/linq/observable/{throttlewithselector.js => debouncewithselector.js} (67%) create mode 100644 node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/rx/src/core/linq/observable/every.js delete mode 100644 node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/rx/src/core/linq/observable/finalvalue.js rename node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/rx/src/core/linq/observable/{contains.js => includes.js} (57%) rename node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/rx/src/core/linq/observable/{mergeobservable.js => mergeall.js} (62%) create mode 100644 node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/rx/src/core/linq/observable/mergedelayerror.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/rx/src/core/linq/observable/ofarraychanges.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/rx/src/core/linq/observable/ofobjectchanges.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/rx/src/core/linq/observable/pairs.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/rx/src/core/linq/observable/retrywhen.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/rx/src/core/linq/observable/singleinstance.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/rx/src/core/linq/observable/some.js rename node_modules/bower/node_modules/{inquirer/node_modules/rx/src/core/linq/observable/then.js => insight/node_modules/inquirer/node_modules/rx/src/core/linq/observable/thendo.js} (76%) create mode 100644 node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/rx/src/core/linq/observable/throttlefirst.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/rx/src/core/linq/observable/transduce.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/rx/src/core/linq/observable/withlatestfrom.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/rx/src/core/longstacktraces/longstackbegin.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/rx/src/core/longstacktraces/longstackend.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/rx/src/core/longstacktraces/longstacktraces.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/rx/src/core/perf/observablebase.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/rx/src/core/perf/operators/combinelatest.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/rx/src/core/perf/operators/distinctuntilchanged.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/rx/src/core/perf/operators/filter.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/rx/src/core/perf/operators/from.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/rx/src/core/perf/operators/fromarray.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/rx/src/core/perf/operators/fromarrayobservable.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/rx/src/core/perf/operators/map.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/rx/src/core/perf/operators/mergeall.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/rx/src/core/perf/operators/mergeproto.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/rx/src/core/perf/operators/of.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/rx/src/core/perf/operators/range.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/rx/src/core/perf/operators/reduce.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/rx/src/core/perf/operators/scan.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/rx/src/core/perf/operators/switch.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/rx/src/core/perf/operators/tap.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/rx/src/core/perf/operators/toarray.js delete mode 100644 node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/rx/src/core/polyfills.js delete mode 100644 node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/rx/src/core/testheader.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/rx/src/core/testing/mockpromise.js delete mode 100644 node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/rx/src/core/testintro.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/rx/ts/rx.all.d.ts delete mode 100644 node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/rx/ts/rx.all.ts create mode 100644 node_modules/bower/node_modules/insight/node_modules/os-name/node_modules/osx-release/node_modules/minimist/.travis.yml create mode 100644 node_modules/bower/node_modules/insight/node_modules/os-name/node_modules/osx-release/node_modules/minimist/LICENSE rename node_modules/bower/node_modules/insight/node_modules/os-name/node_modules/{ => osx-release/node_modules}/minimist/example/parse.js (100%) rename node_modules/bower/node_modules/insight/node_modules/os-name/node_modules/{ => osx-release/node_modules}/minimist/index.js (100%) rename node_modules/bower/node_modules/insight/node_modules/os-name/node_modules/{ => osx-release/node_modules}/minimist/package.json (100%) rename node_modules/bower/node_modules/insight/node_modules/os-name/node_modules/{ => osx-release/node_modules}/minimist/readme.markdown (100%) rename node_modules/bower/node_modules/insight/node_modules/os-name/node_modules/{ => osx-release/node_modules}/minimist/test/all_bool.js (100%) rename node_modules/bower/node_modules/insight/node_modules/os-name/node_modules/{ => osx-release/node_modules}/minimist/test/bool.js (100%) rename node_modules/bower/node_modules/insight/node_modules/os-name/node_modules/{ => osx-release/node_modules}/minimist/test/dash.js (100%) rename node_modules/bower/node_modules/insight/node_modules/os-name/node_modules/{ => osx-release/node_modules}/minimist/test/default_bool.js (100%) rename node_modules/bower/node_modules/insight/node_modules/os-name/node_modules/{ => osx-release/node_modules}/minimist/test/dotted.js (100%) rename node_modules/bower/node_modules/insight/node_modules/os-name/node_modules/{ => osx-release/node_modules}/minimist/test/long.js (100%) rename node_modules/bower/node_modules/insight/node_modules/os-name/node_modules/{ => osx-release/node_modules}/minimist/test/num.js (100%) rename node_modules/bower/node_modules/insight/node_modules/os-name/node_modules/{ => osx-release/node_modules}/minimist/test/parse.js (100%) rename node_modules/bower/node_modules/insight/node_modules/os-name/node_modules/{ => osx-release/node_modules}/minimist/test/parse_modified.js (100%) rename node_modules/bower/node_modules/insight/node_modules/os-name/node_modules/{ => osx-release/node_modules}/minimist/test/short.js (100%) rename node_modules/bower/node_modules/insight/node_modules/os-name/node_modules/{ => osx-release/node_modules}/minimist/test/stop_early.js (100%) rename node_modules/bower/node_modules/insight/node_modules/os-name/node_modules/{ => osx-release/node_modules}/minimist/test/unknown.js (100%) rename node_modules/bower/node_modules/insight/node_modules/os-name/node_modules/{ => osx-release/node_modules}/minimist/test/whitespace.js (100%) create mode 100644 node_modules/bower/node_modules/insight/node_modules/os-name/node_modules/win-release/index.js create mode 100644 node_modules/bower/node_modules/insight/node_modules/os-name/node_modules/win-release/package.json create mode 100644 node_modules/bower/node_modules/insight/node_modules/os-name/node_modules/win-release/readme.md create mode 100644 node_modules/bower/node_modules/junk/license create mode 100644 node_modules/bower/node_modules/opn/license create mode 120000 node_modules/bower/node_modules/request/node_modules/.bin/uuid create mode 100644 node_modules/bower/node_modules/request/node_modules/http-signature/node_modules/ctype/.npmignore delete mode 100644 node_modules/bower/node_modules/request/node_modules/http-signature/node_modules/ctype/tst/ctf/float.json delete mode 100644 node_modules/bower/node_modules/request/node_modules/http-signature/node_modules/ctype/tst/ctf/int.json delete mode 100644 node_modules/bower/node_modules/request/node_modules/http-signature/node_modules/ctype/tst/ctf/psinfo.json delete mode 100644 node_modules/bower/node_modules/request/node_modules/http-signature/node_modules/ctype/tst/ctf/struct.json delete mode 100644 node_modules/bower/node_modules/request/node_modules/http-signature/node_modules/ctype/tst/ctf/tst.fail.js delete mode 100644 node_modules/bower/node_modules/request/node_modules/http-signature/node_modules/ctype/tst/ctf/tst.float.js delete mode 100644 node_modules/bower/node_modules/request/node_modules/http-signature/node_modules/ctype/tst/ctf/tst.int.js delete mode 100644 node_modules/bower/node_modules/request/node_modules/http-signature/node_modules/ctype/tst/ctf/tst.psinfo.js delete mode 100644 node_modules/bower/node_modules/request/node_modules/http-signature/node_modules/ctype/tst/ctf/tst.struct.js delete mode 100644 node_modules/bower/node_modules/request/node_modules/http-signature/node_modules/ctype/tst/ctf/tst.typedef.js delete mode 100644 node_modules/bower/node_modules/request/node_modules/http-signature/node_modules/ctype/tst/ctf/typedef.json delete mode 100644 node_modules/bower/node_modules/request/node_modules/http-signature/node_modules/ctype/tst/ctio/float/tst.rfloat.js delete mode 100644 node_modules/bower/node_modules/request/node_modules/http-signature/node_modules/ctype/tst/ctio/float/tst.wfloat.js delete mode 100644 node_modules/bower/node_modules/request/node_modules/http-signature/node_modules/ctype/tst/ctio/int/tst.64.js delete mode 100644 node_modules/bower/node_modules/request/node_modules/http-signature/node_modules/ctype/tst/ctio/int/tst.rint.js delete mode 100644 node_modules/bower/node_modules/request/node_modules/http-signature/node_modules/ctype/tst/ctio/int/tst.wbounds.js delete mode 100644 node_modules/bower/node_modules/request/node_modules/http-signature/node_modules/ctype/tst/ctio/int/tst.wint.js delete mode 100644 node_modules/bower/node_modules/request/node_modules/http-signature/node_modules/ctype/tst/ctio/uint/tst.64.js delete mode 100644 node_modules/bower/node_modules/request/node_modules/http-signature/node_modules/ctype/tst/ctio/uint/tst.roundtrip.js delete mode 100644 node_modules/bower/node_modules/request/node_modules/http-signature/node_modules/ctype/tst/ctio/uint/tst.ruint.js delete mode 100644 node_modules/bower/node_modules/request/node_modules/http-signature/node_modules/ctype/tst/ctio/uint/tst.wuint.js delete mode 100644 node_modules/bower/node_modules/request/node_modules/http-signature/node_modules/ctype/tst/ctype/tst.basicr.js delete mode 100644 node_modules/bower/node_modules/request/node_modules/http-signature/node_modules/ctype/tst/ctype/tst.basicw.js delete mode 100644 node_modules/bower/node_modules/request/node_modules/http-signature/node_modules/ctype/tst/ctype/tst.char.js delete mode 100644 node_modules/bower/node_modules/request/node_modules/http-signature/node_modules/ctype/tst/ctype/tst.endian.js delete mode 100644 node_modules/bower/node_modules/request/node_modules/http-signature/node_modules/ctype/tst/ctype/tst.oldwrite.js delete mode 100644 node_modules/bower/node_modules/request/node_modules/http-signature/node_modules/ctype/tst/ctype/tst.readSize.js delete mode 100644 node_modules/bower/node_modules/request/node_modules/http-signature/node_modules/ctype/tst/ctype/tst.structw.js delete mode 100644 node_modules/bower/node_modules/request/node_modules/http-signature/node_modules/ctype/tst/ctype/tst.writeStruct.js create mode 100755 node_modules/bower/node_modules/request/node_modules/node-uuid/bin/uuid create mode 100644 node_modules/bower/node_modules/request/node_modules/node-uuid/bower.json create mode 100644 node_modules/bower/node_modules/stringify-object/license rename node_modules/bower/node_modules/{insight/node_modules/configstore/configstore.js => update-notifier/node_modules/configstore/index.js} (91%) create mode 120000 node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/.bin/user-home rename node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/{HISTORY.md => CHANGELOG.md} (75%) create mode 100644 node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/dist/js-yaml.js create mode 100644 node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/dist/js-yaml.min.js rename node_modules/bower/node_modules/{insight/node_modules/configstore/node_modules/js-yaml/examples/custom_types.yaml => update-notifier/node_modules/configstore/node_modules/js-yaml/examples/custom_types.yml} (90%) rename node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/examples/{sample_document.yaml => sample_document.yml} (100%) delete mode 100644 node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/index_browser.js rename node_modules/bower/node_modules/{insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/HISTORY.md => update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/CHANGELOG.md} (84%) create mode 100644 node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/LICENSE.txt create mode 100644 node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/README.md create mode 100644 node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/array.js create mode 100644 node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/array/chunk.js create mode 100644 node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/array/compact.js create mode 100644 node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/array/difference.js create mode 100644 node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/array/drop.js create mode 100644 node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/array/dropRight.js create mode 100644 node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/array/dropRightWhile.js create mode 100644 node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/array/dropWhile.js create mode 100644 node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/array/fill.js create mode 100644 node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/array/findIndex.js create mode 100644 node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/array/findLastIndex.js create mode 100644 node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/array/first.js create mode 100644 node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/array/flatten.js create mode 100644 node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/array/flattenDeep.js create mode 100644 node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/array/head.js create mode 100644 node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/array/indexOf.js create mode 100644 node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/array/initial.js create mode 100644 node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/array/intersection.js create mode 100644 node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/array/last.js create mode 100644 node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/array/lastIndexOf.js create mode 100644 node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/array/object.js create mode 100644 node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/array/pull.js create mode 100644 node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/array/pullAt.js create mode 100644 node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/array/remove.js create mode 100644 node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/array/rest.js create mode 100644 node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/array/slice.js create mode 100644 node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/array/sortedIndex.js create mode 100644 node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/array/sortedLastIndex.js create mode 100644 node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/array/tail.js create mode 100644 node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/array/take.js create mode 100644 node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/array/takeRight.js create mode 100644 node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/array/takeRightWhile.js create mode 100644 node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/array/takeWhile.js create mode 100644 node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/array/union.js create mode 100644 node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/array/uniq.js create mode 100644 node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/array/unique.js create mode 100644 node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/array/unzip.js create mode 100644 node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/array/without.js create mode 100644 node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/array/xor.js create mode 100644 node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/array/zip.js create mode 100644 node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/array/zipObject.js create mode 100644 node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/chain.js create mode 100644 node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/chain/chain.js create mode 100644 node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/chain/commit.js create mode 100644 node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/chain/lodash.js create mode 100644 node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/chain/plant.js create mode 100644 node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/chain/reverse.js create mode 100644 node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/chain/run.js create mode 100644 node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/chain/tap.js create mode 100644 node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/chain/thru.js create mode 100644 node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/chain/toJSON.js create mode 100644 node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/chain/toString.js create mode 100644 node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/chain/value.js create mode 100644 node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/chain/valueOf.js create mode 100644 node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/chain/wrapperChain.js create mode 100644 node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/chain/wrapperCommit.js create mode 100644 node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/chain/wrapperPlant.js create mode 100644 node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/chain/wrapperReverse.js create mode 100644 node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/chain/wrapperToString.js create mode 100644 node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/chain/wrapperValue.js create mode 100644 node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/collection.js create mode 100644 node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/collection/all.js create mode 100644 node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/collection/any.js create mode 100644 node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/collection/at.js create mode 100644 node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/collection/collect.js create mode 100644 node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/collection/contains.js create mode 100644 node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/collection/countBy.js create mode 100644 node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/collection/detect.js create mode 100644 node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/collection/each.js create mode 100644 node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/collection/eachRight.js create mode 100644 node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/collection/every.js create mode 100644 node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/collection/filter.js create mode 100644 node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/collection/find.js create mode 100644 node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/collection/findLast.js create mode 100644 node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/collection/findWhere.js create mode 100644 node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/collection/foldl.js create mode 100644 node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/collection/foldr.js create mode 100644 node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/collection/forEach.js create mode 100644 node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/collection/forEachRight.js create mode 100644 node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/collection/groupBy.js create mode 100644 node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/collection/include.js create mode 100644 node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/collection/includes.js create mode 100644 node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/collection/indexBy.js create mode 100644 node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/collection/inject.js create mode 100644 node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/collection/invoke.js create mode 100644 node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/collection/map.js create mode 100644 node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/collection/max.js create mode 100644 node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/collection/min.js create mode 100644 node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/collection/partition.js create mode 100644 node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/collection/pluck.js create mode 100644 node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/collection/reduce.js create mode 100644 node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/collection/reduceRight.js create mode 100644 node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/collection/reject.js create mode 100644 node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/collection/sample.js create mode 100644 node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/collection/select.js create mode 100644 node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/collection/shuffle.js create mode 100644 node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/collection/size.js create mode 100644 node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/collection/some.js create mode 100644 node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/collection/sortBy.js create mode 100644 node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/collection/sortByAll.js create mode 100644 node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/collection/where.js create mode 100644 node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/date.js create mode 100644 node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/date/now.js create mode 100644 node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/function.js create mode 100644 node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/function/after.js create mode 100644 node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/function/ary.js create mode 100644 node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/function/backflow.js create mode 100644 node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/function/before.js create mode 100644 node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/function/bind.js create mode 100644 node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/function/bindAll.js create mode 100644 node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/function/bindKey.js create mode 100644 node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/function/compose.js create mode 100644 node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/function/curry.js create mode 100644 node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/function/curryRight.js create mode 100644 node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/function/debounce.js create mode 100644 node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/function/defer.js create mode 100644 node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/function/delay.js create mode 100644 node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/function/flow.js create mode 100644 node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/function/flowRight.js create mode 100644 node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/function/memoize.js create mode 100644 node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/function/negate.js create mode 100644 node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/function/once.js create mode 100644 node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/function/partial.js create mode 100644 node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/function/partialRight.js create mode 100644 node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/function/rearg.js create mode 100644 node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/function/spread.js create mode 100644 node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/function/throttle.js create mode 100644 node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/function/wrap.js create mode 100644 node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/index.js create mode 100644 node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/LazyWrapper.js create mode 100644 node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/LodashWrapper.js create mode 100644 node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/MapCache.js create mode 100644 node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/SetCache.js create mode 100644 node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/arrayCopy.js create mode 100644 node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/arrayEach.js create mode 100644 node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/arrayEachRight.js create mode 100644 node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/arrayEvery.js create mode 100644 node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/arrayFilter.js create mode 100644 node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/arrayMap.js create mode 100644 node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/arrayMax.js create mode 100644 node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/arrayMin.js create mode 100644 node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/arrayReduce.js create mode 100644 node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/arrayReduceRight.js create mode 100644 node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/arraySome.js create mode 100644 node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/assignDefaults.js create mode 100644 node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/assignOwnDefaults.js create mode 100644 node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/baseAssign.js create mode 100644 node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/baseAt.js create mode 100644 node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/baseBindAll.js create mode 100644 node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/baseCallback.js create mode 100644 node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/baseClone.js create mode 100644 node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/baseCompareAscending.js create mode 100644 node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/baseCopy.js create mode 100644 node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/baseCreate.js create mode 100644 node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/baseDelay.js create mode 100644 node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/baseDifference.js create mode 100644 node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/baseEach.js create mode 100644 node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/baseEachRight.js create mode 100644 node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/baseEvery.js create mode 100644 node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/baseFill.js create mode 100644 node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/baseFilter.js create mode 100644 node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/baseFind.js create mode 100644 node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/baseFlatten.js create mode 100644 node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/baseFor.js create mode 100644 node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/baseForIn.js create mode 100644 node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/baseForOwn.js create mode 100644 node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/baseForOwnRight.js create mode 100644 node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/baseForRight.js create mode 100644 node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/baseFunctions.js create mode 100644 node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/baseIndexOf.js create mode 100644 node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/baseInvoke.js create mode 100644 node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/baseIsEqual.js create mode 100644 node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/baseIsEqualDeep.js create mode 100644 node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/baseIsMatch.js create mode 100644 node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/baseMap.js create mode 100644 node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/baseMatches.js create mode 100644 node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/baseMatchesProperty.js create mode 100644 node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/baseMerge.js create mode 100644 node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/baseMergeDeep.js create mode 100644 node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/baseProperty.js create mode 100644 node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/basePullAt.js create mode 100644 node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/baseRandom.js create mode 100644 node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/baseReduce.js create mode 100644 node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/baseSetData.js create mode 100644 node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/baseSlice.js create mode 100644 node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/baseSome.js create mode 100644 node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/baseSortBy.js create mode 100644 node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/baseToString.js create mode 100644 node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/baseUniq.js create mode 100644 node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/baseValues.js create mode 100644 node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/baseWrapperValue.js create mode 100644 node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/binaryIndex.js create mode 100644 node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/binaryIndexBy.js create mode 100644 node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/bindCallback.js create mode 100644 node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/bufferClone.js create mode 100644 node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/cacheIndexOf.js create mode 100644 node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/cachePush.js create mode 100644 node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/charAtCallback.js create mode 100644 node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/charsLeftIndex.js create mode 100644 node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/charsRightIndex.js create mode 100644 node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/compareAscending.js create mode 100644 node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/compareMultipleAscending.js create mode 100644 node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/composeArgs.js create mode 100644 node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/composeArgsRight.js create mode 100644 node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/createAggregator.js create mode 100644 node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/createAssigner.js create mode 100644 node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/createBindWrapper.js create mode 100644 node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/createCache.js create mode 100644 node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/createCompounder.js create mode 100644 node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/createCtorWrapper.js create mode 100644 node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/createExtremum.js create mode 100644 node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/createHybridWrapper.js create mode 100644 node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/createPad.js create mode 100644 node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/createPartialWrapper.js create mode 100644 node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/createWrapper.js create mode 100644 node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/deburrLetter.js create mode 100644 node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/equalArrays.js create mode 100644 node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/equalByTag.js create mode 100644 node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/equalObjects.js create mode 100644 node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/escapeHtmlChar.js create mode 100644 node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/escapeStringChar.js create mode 100644 node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/extremumBy.js create mode 100644 node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/getData.js create mode 100644 node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/getView.js create mode 100644 node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/indexOfNaN.js create mode 100644 node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/initCloneArray.js create mode 100644 node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/initCloneByTag.js create mode 100644 node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/initCloneObject.js create mode 100644 node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/isBindable.js create mode 100644 node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/isIndex.js create mode 100644 node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/isIterateeCall.js create mode 100644 node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/isLength.js create mode 100644 node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/isObjectLike.js create mode 100644 node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/isSpace.js create mode 100644 node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/isStrictComparable.js create mode 100644 node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/lazyClone.js create mode 100644 node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/lazyReverse.js create mode 100644 node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/lazyValue.js create mode 100644 node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/mapDelete.js create mode 100644 node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/mapGet.js create mode 100644 node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/mapHas.js create mode 100644 node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/mapSet.js create mode 100644 node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/mergeData.js create mode 100644 node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/metaMap.js create mode 100644 node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/pickByArray.js create mode 100644 node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/pickByCallback.js create mode 100644 node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/reEscape.js create mode 100644 node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/reEvaluate.js create mode 100644 node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/reInterpolate.js create mode 100644 node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/reorder.js create mode 100644 node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/replaceHolders.js create mode 100644 node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/setData.js create mode 100644 node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/shimIsPlainObject.js create mode 100644 node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/shimKeys.js create mode 100644 node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/sortedUniq.js create mode 100644 node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/toIterable.js create mode 100644 node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/toObject.js create mode 100644 node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/trimmedLeftIndex.js create mode 100644 node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/trimmedRightIndex.js create mode 100644 node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/unescapeHtmlChar.js create mode 100644 node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/wrapperClone.js create mode 100644 node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/lang.js create mode 100644 node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/lang/clone.js create mode 100644 node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/lang/cloneDeep.js create mode 100644 node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/lang/isArguments.js create mode 100644 node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/lang/isArray.js create mode 100644 node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/lang/isBoolean.js create mode 100644 node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/lang/isDate.js create mode 100644 node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/lang/isElement.js create mode 100644 node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/lang/isEmpty.js create mode 100644 node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/lang/isEqual.js create mode 100644 node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/lang/isError.js create mode 100644 node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/lang/isFinite.js create mode 100644 node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/lang/isFunction.js create mode 100644 node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/lang/isMatch.js create mode 100644 node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/lang/isNaN.js create mode 100644 node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/lang/isNative.js create mode 100644 node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/lang/isNull.js create mode 100644 node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/lang/isNumber.js create mode 100644 node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/lang/isObject.js create mode 100644 node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/lang/isPlainObject.js create mode 100644 node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/lang/isRegExp.js create mode 100644 node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/lang/isString.js create mode 100644 node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/lang/isTypedArray.js create mode 100644 node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/lang/isUndefined.js create mode 100644 node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/lang/toArray.js create mode 100644 node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/lang/toPlainObject.js create mode 100644 node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/number.js create mode 100644 node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/number/random.js create mode 100644 node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/object.js create mode 100644 node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/object/assign.js create mode 100644 node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/object/create.js create mode 100644 node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/object/defaults.js create mode 100644 node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/object/extend.js create mode 100644 node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/object/findKey.js create mode 100644 node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/object/findLastKey.js create mode 100644 node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/object/forIn.js create mode 100644 node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/object/forInRight.js create mode 100644 node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/object/forOwn.js create mode 100644 node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/object/forOwnRight.js create mode 100644 node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/object/functions.js create mode 100644 node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/object/has.js create mode 100644 node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/object/invert.js create mode 100644 node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/object/keys.js create mode 100644 node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/object/keysIn.js create mode 100644 node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/object/mapValues.js create mode 100644 node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/object/merge.js create mode 100644 node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/object/methods.js create mode 100644 node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/object/omit.js create mode 100644 node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/object/pairs.js create mode 100644 node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/object/pick.js create mode 100644 node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/object/result.js create mode 100644 node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/object/transform.js create mode 100644 node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/object/values.js create mode 100644 node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/object/valuesIn.js create mode 100644 node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/package.json create mode 100644 node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/string.js create mode 100644 node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/string/camelCase.js create mode 100644 node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/string/capitalize.js create mode 100644 node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/string/deburr.js create mode 100644 node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/string/endsWith.js create mode 100644 node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/string/escape.js create mode 100644 node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/string/escapeRegExp.js create mode 100644 node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/string/kebabCase.js create mode 100644 node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/string/pad.js create mode 100644 node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/string/padLeft.js create mode 100644 node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/string/padRight.js create mode 100644 node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/string/parseInt.js create mode 100644 node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/string/repeat.js create mode 100644 node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/string/snakeCase.js create mode 100644 node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/string/startCase.js create mode 100644 node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/string/startsWith.js create mode 100644 node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/string/template.js create mode 100644 node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/string/templateSettings.js create mode 100644 node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/string/trim.js create mode 100644 node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/string/trimLeft.js create mode 100644 node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/string/trimRight.js create mode 100644 node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/string/trunc.js create mode 100644 node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/string/unescape.js create mode 100644 node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/string/words.js create mode 100644 node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/support.js create mode 100644 node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/utility.js create mode 100644 node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/utility/attempt.js create mode 100644 node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/utility/callback.js create mode 100644 node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/utility/constant.js create mode 100644 node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/utility/identity.js create mode 100644 node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/utility/iteratee.js create mode 100644 node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/utility/matches.js create mode 100644 node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/utility/matchesProperty.js create mode 100644 node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/utility/mixin.js create mode 100644 node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/utility/noop.js create mode 100644 node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/utility/property.js create mode 100644 node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/utility/propertyOf.js create mode 100644 node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/utility/range.js create mode 100644 node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/utility/times.js create mode 100644 node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/utility/uniqueId.js create mode 100644 node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/sprintf-js/.npmignore create mode 100644 node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/sprintf-js/LICENSE create mode 100644 node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/sprintf-js/README.md create mode 100644 node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/sprintf-js/bower.json create mode 100644 node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/sprintf-js/demo/angular.html create mode 100644 node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/sprintf-js/dist/angular-sprintf.min.js create mode 100644 node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/sprintf-js/dist/angular-sprintf.min.map create mode 100644 node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/sprintf-js/dist/sprintf.min.js create mode 100644 node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/sprintf-js/dist/sprintf.min.map create mode 100644 node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/sprintf-js/gruntfile.js create mode 100644 node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/sprintf-js/package.json create mode 100644 node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/sprintf-js/src/angular-sprintf.js create mode 100644 node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/sprintf-js/src/sprintf.js create mode 100644 node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/sprintf-js/test/test.js delete mode 100644 node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/.travis.yml delete mode 100644 node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/Gemfile delete mode 100644 node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/Gemfile.lock delete mode 100644 node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/Rakefile delete mode 100644 node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/component.json delete mode 100644 node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/dist/underscore.string.min.js delete mode 100644 node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/lib/underscore.string.js delete mode 100644 node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/libpeerconnection.log delete mode 100644 node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/package.json delete mode 100644 node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/test/speed.js delete mode 100644 node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/test/strings.js delete mode 100644 node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/test/test.html delete mode 100644 node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/test/test_standalone.html delete mode 100644 node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/test/test_underscore/arrays.js delete mode 100644 node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/test/test_underscore/chaining.js delete mode 100644 node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/test/test_underscore/collections.js delete mode 100644 node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/test/test_underscore/functions.js delete mode 100644 node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/test/test_underscore/index.html delete mode 100644 node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/test/test_underscore/objects.js delete mode 100644 node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/test/test_underscore/speed.js delete mode 100644 node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/test/test_underscore/utility.js delete mode 100644 node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/test/test_underscore/vendor/jquery.js delete mode 100644 node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/test/test_underscore/vendor/jslitmus.js delete mode 100644 node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/test/test_underscore/vendor/qunit.css delete mode 100644 node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/test/test_underscore/vendor/qunit.js delete mode 100644 node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/test/underscore.js delete mode 100644 node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/underscore/.npmignore delete mode 100644 node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/underscore/.travis.yml delete mode 100644 node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/underscore/CNAME delete mode 100644 node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/underscore/CONTRIBUTING.md delete mode 100644 node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/underscore/LICENSE delete mode 100644 node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/underscore/README.md delete mode 100644 node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/underscore/favicon.ico delete mode 100644 node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/underscore/index.html delete mode 100644 node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/underscore/index.js delete mode 100644 node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/underscore/package.json delete mode 100644 node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/underscore/underscore-min.js delete mode 100644 node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/underscore/underscore.js create mode 100644 node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/object-assign/index.js delete mode 100644 node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/object-assign/object-assign.js create mode 100755 node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/user-home/cli.js create mode 100644 node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/user-home/index.js create mode 100644 node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/user-home/license create mode 100644 node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/user-home/package.json create mode 100644 node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/user-home/readme.md delete mode 100644 node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/uuid/buffer-browser.js delete mode 100644 node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/uuid/buffer.js create mode 100644 node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/xdg-basedir/index.js create mode 100644 node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/xdg-basedir/license create mode 100644 node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/xdg-basedir/package.json create mode 100644 node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/xdg-basedir/readme.md delete mode 100644 node_modules/cookie-parser/node_modules/cookie-signature/Makefile create mode 100644 node_modules/cookie-session/HISTORY.md create mode 100644 node_modules/cookie-session/LICENSE delete mode 100644 node_modules/cookie-session/node_modules/cookies/test/express.js delete mode 100644 node_modules/cookie-session/node_modules/cookies/test/http.js delete mode 100644 node_modules/cookie-session/node_modules/cookies/test/restify.js create mode 100644 node_modules/cookie-session/node_modules/debug/bower.json create mode 100644 node_modules/cookie-session/node_modules/debug/node_modules/ms/LICENSE rename node_modules/{body-parser/node_modules/raw-body => cookie-session/node_modules/on-headers}/.npmignore (100%) create mode 100644 node_modules/cookie-session/node_modules/on-headers/History.md create mode 100644 node_modules/cookie-session/node_modules/on-headers/LICENSE create mode 100644 node_modules/cookie-session/node_modules/on-headers/README.md create mode 100644 node_modules/cookie-session/node_modules/on-headers/index.js create mode 100644 node_modules/cookie-session/node_modules/on-headers/package.json delete mode 100644 node_modules/csurf/node_modules/cookie-signature/Makefile create mode 100644 node_modules/csurf/node_modules/csrf/HISTORY.md create mode 100644 node_modules/csurf/node_modules/csrf/LICENSE delete mode 100644 node_modules/csurf/node_modules/csrf/node_modules/base64-url/.npmignore delete mode 100644 node_modules/csurf/node_modules/csrf/node_modules/base64-url/.travis.yml delete mode 100644 node_modules/csurf/node_modules/csrf/node_modules/base64-url/test/index.js create mode 100644 node_modules/csurf/node_modules/csrf/node_modules/scmp/LICENSE create mode 100644 node_modules/csurf/node_modules/csrf/node_modules/uid-safe/HISTORY.md delete mode 100644 node_modules/csurf/node_modules/csrf/node_modules/uid-safe/node_modules/mz/.npmignore delete mode 100644 node_modules/csurf/node_modules/csrf/node_modules/uid-safe/node_modules/mz/HISTORY.md delete mode 100644 node_modules/csurf/node_modules/csrf/node_modules/uid-safe/node_modules/mz/README.md delete mode 100644 node_modules/csurf/node_modules/csrf/node_modules/uid-safe/node_modules/mz/_promisify.js delete mode 100644 node_modules/csurf/node_modules/csrf/node_modules/uid-safe/node_modules/mz/_promisify_all.js delete mode 100644 node_modules/csurf/node_modules/csrf/node_modules/uid-safe/node_modules/mz/child_process.js delete mode 100644 node_modules/csurf/node_modules/csrf/node_modules/uid-safe/node_modules/mz/crypto.js delete mode 100644 node_modules/csurf/node_modules/csrf/node_modules/uid-safe/node_modules/mz/dns.js delete mode 100644 node_modules/csurf/node_modules/csrf/node_modules/uid-safe/node_modules/mz/fs.js delete mode 100644 node_modules/csurf/node_modules/csrf/node_modules/uid-safe/node_modules/mz/node_modules/native-or-bluebird/index.js delete mode 100644 node_modules/csurf/node_modules/csrf/node_modules/uid-safe/node_modules/mz/package.json delete mode 100644 node_modules/csurf/node_modules/csrf/node_modules/uid-safe/node_modules/mz/zlib.js create mode 100644 node_modules/csurf/node_modules/csrf/node_modules/uid-safe/node_modules/native-or-bluebird/LICENSE rename node_modules/csurf/node_modules/csrf/node_modules/uid-safe/node_modules/{mz/node_modules => }/native-or-bluebird/README.md (100%) create mode 100644 node_modules/csurf/node_modules/csrf/node_modules/uid-safe/node_modules/native-or-bluebird/index.js rename node_modules/csurf/node_modules/csrf/node_modules/uid-safe/node_modules/{mz/node_modules => }/native-or-bluebird/package.json (78%) rename node_modules/csurf/node_modules/csrf/node_modules/uid-safe/node_modules/{mz/node_modules => }/native-or-bluebird/promise.js (100%) delete mode 100644 node_modules/csurf/node_modules/csrf/node_modules/uid-safe/test.js create mode 100644 node_modules/csurf/node_modules/http-errors/HISTORY.md create mode 100644 node_modules/grunt-contrib-sass/node_modules/chalk/node_modules/escape-string-regexp/license create mode 100644 node_modules/grunt/node_modules/grunt-legacy-log/node_modules/colors/MIT-LICENSE.txt create mode 100644 node_modules/grunt/node_modules/grunt-legacy-log/node_modules/colors/ReadMe.md create mode 100644 node_modules/grunt/node_modules/grunt-legacy-log/node_modules/colors/colors.js create mode 100644 node_modules/grunt/node_modules/grunt-legacy-log/node_modules/colors/example.html create mode 100644 node_modules/grunt/node_modules/grunt-legacy-log/node_modules/colors/example.js create mode 100644 node_modules/grunt/node_modules/grunt-legacy-log/node_modules/colors/package.json create mode 100644 node_modules/grunt/node_modules/grunt-legacy-log/node_modules/colors/test.js create mode 100644 node_modules/grunt/node_modules/grunt-legacy-log/node_modules/colors/themes/winston-dark.js create mode 100644 node_modules/grunt/node_modules/grunt-legacy-log/node_modules/colors/themes/winston-light.js create mode 120000 node_modules/grunt/node_modules/grunt-legacy-util/node_modules/.bin/which create mode 100644 node_modules/grunt/node_modules/grunt-legacy-util/node_modules/async/.gitmodules create mode 100644 node_modules/grunt/node_modules/grunt-legacy-util/node_modules/async/.npmignore rename node_modules/{bower/node_modules/bower-registry-client/node_modules/request/node_modules/mime => grunt/node_modules/grunt-legacy-util/node_modules/async}/LICENSE (95%) create mode 100644 node_modules/grunt/node_modules/grunt-legacy-util/node_modules/async/Makefile create mode 100644 node_modules/grunt/node_modules/grunt-legacy-util/node_modules/async/README.md create mode 100644 node_modules/grunt/node_modules/grunt-legacy-util/node_modules/async/index.js create mode 100644 node_modules/grunt/node_modules/grunt-legacy-util/node_modules/async/lib/async.js create mode 100644 node_modules/grunt/node_modules/grunt-legacy-util/node_modules/async/package.json create mode 100644 node_modules/grunt/node_modules/grunt-legacy-util/node_modules/lodash/README.md create mode 100644 node_modules/grunt/node_modules/grunt-legacy-util/node_modules/lodash/lodash.js create mode 100644 node_modules/grunt/node_modules/grunt-legacy-util/node_modules/lodash/lodash.min.js create mode 100644 node_modules/grunt/node_modules/grunt-legacy-util/node_modules/lodash/lodash.underscore.js create mode 100644 node_modules/grunt/node_modules/grunt-legacy-util/node_modules/lodash/lodash.underscore.min.js create mode 100644 node_modules/grunt/node_modules/grunt-legacy-util/node_modules/lodash/package.json rename node_modules/{bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse => grunt/node_modules/grunt-legacy-util}/node_modules/underscore.string/.travis.yml (100%) create mode 100644 node_modules/grunt/node_modules/grunt-legacy-util/node_modules/underscore.string/Gemfile create mode 100644 node_modules/grunt/node_modules/grunt-legacy-util/node_modules/underscore.string/Gemfile.lock rename node_modules/{bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse => grunt/node_modules/grunt-legacy-util}/node_modules/underscore.string/README.markdown (79%) rename node_modules/{bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse => grunt/node_modules/grunt-legacy-util}/node_modules/underscore.string/Rakefile (63%) create mode 100644 node_modules/grunt/node_modules/grunt-legacy-util/node_modules/underscore.string/dist/underscore.string.min.js create mode 100644 node_modules/grunt/node_modules/grunt-legacy-util/node_modules/underscore.string/lib/underscore.string.js rename node_modules/{bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse => grunt/node_modules/grunt-legacy-util}/node_modules/underscore.string/package.json (82%) rename node_modules/{bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse => grunt/node_modules/grunt-legacy-util}/node_modules/underscore.string/test/run-qunit.js (85%) rename node_modules/grunt/node_modules/{js-yaml/node_modules/argparse => grunt-legacy-util}/node_modules/underscore.string/test/speed.js (90%) create mode 100644 node_modules/grunt/node_modules/grunt-legacy-util/node_modules/underscore.string/test/strings.js rename node_modules/{bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse => grunt/node_modules/grunt-legacy-util}/node_modules/underscore.string/test/strings_standalone.js (84%) rename node_modules/{bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse => grunt/node_modules/grunt-legacy-util}/node_modules/underscore.string/test/test.html (100%) rename node_modules/{bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse => grunt/node_modules/grunt-legacy-util}/node_modules/underscore.string/test/test_standalone.html (100%) create mode 100644 node_modules/grunt/node_modules/grunt-legacy-util/node_modules/underscore.string/test/test_underscore/arrays.js rename node_modules/grunt/node_modules/{js-yaml/node_modules/argparse => grunt-legacy-util}/node_modules/underscore.string/test/test_underscore/chaining.js (71%) create mode 100644 node_modules/grunt/node_modules/grunt-legacy-util/node_modules/underscore.string/test/test_underscore/collections.js create mode 100644 node_modules/grunt/node_modules/grunt-legacy-util/node_modules/underscore.string/test/test_underscore/functions.js rename node_modules/grunt/node_modules/{js-yaml/node_modules/argparse => grunt-legacy-util}/node_modules/underscore.string/test/test_underscore/objects.js (76%) rename node_modules/{bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse => grunt/node_modules/grunt-legacy-util}/node_modules/underscore.string/test/test_underscore/speed.js (86%) create mode 100644 node_modules/grunt/node_modules/grunt-legacy-util/node_modules/underscore.string/test/test_underscore/temp.js create mode 100644 node_modules/grunt/node_modules/grunt-legacy-util/node_modules/underscore.string/test/test_underscore/temp_tests.html create mode 100644 node_modules/grunt/node_modules/grunt-legacy-util/node_modules/underscore.string/test/test_underscore/test.html create mode 100644 node_modules/grunt/node_modules/grunt-legacy-util/node_modules/underscore.string/test/test_underscore/utility.js create mode 100644 node_modules/grunt/node_modules/grunt-legacy-util/node_modules/underscore.string/test/test_underscore/vendor/jquery.js rename node_modules/{bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse => grunt/node_modules/grunt-legacy-util}/node_modules/underscore.string/test/test_underscore/vendor/jslitmus.js (100%) rename node_modules/grunt/node_modules/{js-yaml/node_modules/argparse => grunt-legacy-util}/node_modules/underscore.string/test/test_underscore/vendor/qunit.css (64%) create mode 100644 node_modules/grunt/node_modules/grunt-legacy-util/node_modules/underscore.string/test/test_underscore/vendor/qunit.js rename node_modules/grunt/node_modules/{js-yaml/node_modules/argparse => grunt-legacy-util}/node_modules/underscore.string/test/underscore.js (61%) create mode 100644 node_modules/grunt/node_modules/grunt-legacy-util/node_modules/which/LICENSE create mode 100644 node_modules/grunt/node_modules/grunt-legacy-util/node_modules/which/README.md create mode 100755 node_modules/grunt/node_modules/grunt-legacy-util/node_modules/which/bin/which create mode 100644 node_modules/grunt/node_modules/grunt-legacy-util/node_modules/which/package.json create mode 100644 node_modules/grunt/node_modules/grunt-legacy-util/node_modules/which/which.js create mode 100644 node_modules/grunt/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/.npmignore delete mode 100644 node_modules/grunt/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/Gemfile delete mode 100644 node_modules/grunt/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/Gemfile.lock delete mode 100644 node_modules/grunt/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/Rakefile create mode 100644 node_modules/grunt/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/bower.json delete mode 100644 node_modules/grunt/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/dist/underscore.string.min.js create mode 100644 node_modules/grunt/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/foo.js create mode 100644 node_modules/grunt/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/gulpfile.js delete mode 100644 node_modules/grunt/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/test/run-qunit.js delete mode 100644 node_modules/grunt/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/test/strings.js delete mode 100644 node_modules/grunt/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/test/strings_standalone.js delete mode 100644 node_modules/grunt/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/test/test.html delete mode 100644 node_modules/grunt/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/test/test_standalone.html delete mode 100644 node_modules/grunt/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/test/test_underscore/arrays.js delete mode 100644 node_modules/grunt/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/test/test_underscore/collections.js delete mode 100644 node_modules/grunt/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/test/test_underscore/functions.js delete mode 100644 node_modules/grunt/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/test/test_underscore/index.html delete mode 100644 node_modules/grunt/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/test/test_underscore/speed.js delete mode 100644 node_modules/grunt/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/test/test_underscore/utility.js delete mode 100644 node_modules/grunt/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/test/test_underscore/vendor/jquery.js delete mode 100644 node_modules/grunt/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/test/test_underscore/vendor/jslitmus.js delete mode 100644 node_modules/grunt/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/test/test_underscore/vendor/qunit.js delete mode 100644 node_modules/grunt/node_modules/js-yaml/node_modules/argparse/node_modules/underscore/.npmignore delete mode 100644 node_modules/grunt/node_modules/js-yaml/node_modules/argparse/node_modules/underscore/.travis.yml delete mode 100644 node_modules/grunt/node_modules/js-yaml/node_modules/argparse/node_modules/underscore/CNAME delete mode 100644 node_modules/grunt/node_modules/js-yaml/node_modules/argparse/node_modules/underscore/CONTRIBUTING.md delete mode 100644 node_modules/grunt/node_modules/js-yaml/node_modules/argparse/node_modules/underscore/favicon.ico delete mode 100644 node_modules/grunt/node_modules/js-yaml/node_modules/argparse/node_modules/underscore/index.html delete mode 100644 node_modules/grunt/node_modules/js-yaml/node_modules/argparse/node_modules/underscore/index.js rename node_modules/{bower/node_modules/inquirer/node_modules/readline2/LICENSE-MIT => passport-local/LICENSE} (96%) create mode 100644 node_modules/passport-local/README.md create mode 100644 node_modules/passport-local/lib/index.js create mode 100644 node_modules/passport-local/lib/strategy.js create mode 100644 node_modules/passport-local/lib/utils.js create mode 100644 node_modules/passport-local/node_modules/passport-strategy/.jshintrc create mode 100644 node_modules/passport-local/node_modules/passport-strategy/.travis.yml rename node_modules/{bower/node_modules/insight/node_modules/inquirer/node_modules/readline2/LICENSE-MIT => passport-local/node_modules/passport-strategy/LICENSE} (94%) create mode 100644 node_modules/passport-local/node_modules/passport-strategy/README.md create mode 100644 node_modules/passport-local/node_modules/passport-strategy/lib/index.js create mode 100644 node_modules/passport-local/node_modules/passport-strategy/lib/strategy.js create mode 100644 node_modules/passport-local/node_modules/passport-strategy/package.json create mode 100644 node_modules/passport-local/package.json create mode 120000 node_modules/sequelize/node_modules/.bin/uuid create mode 100755 node_modules/sequelize/node_modules/node-uuid/bin/uuid create mode 100644 node_modules/sequelize/node_modules/node-uuid/bower.json diff --git a/.DS_Store b/.DS_Store index 5008ddfcf53c02e82d7eee2e57c38e5672ef89f6..3ca8c7f3437d4cccec4544a45a94fd4b8b63c486 100644 GIT binary patch literal 6148 zcmeHKu};H441L!IsTCc{#)1?ER-}$>Q57WiZY+QZDo729M6>4;SQyy)1+ee|@CB5K z&jH(KH3_A#RS4OV@7o>eBFyu$^^DTDsFCbbQ8SJQ$s4 zX};uX8-JAnes=-(F~$|9jraHQepk1pSsW+D^c;BG>ORQhEaK8ES!v5JtKUScm~&to zXULH^vhBXURF*2&{Bd?KxiqHA^wm<&gS}f0>fst05?tT}smuyYXmwN19PAt&|KwY{ z%jDom?y~aS+U1U!c_s(jUvn#YnOANEQ<3LkWGT(-y<|aM};mFH$T$`fxaHKAdKD+Mzhf zPUnZ>4i|Z}(HJlWnhdo4vd{JZaCQIR46>CmU<~{#23!!2;vqef*4Cwm<60Y%o|3Y# oU+HlXLK7*)AjHF;Q%yo+1YW5HK<@2y9-+oW`{$am(+{342+ UKzW7)kiy9(Jj$D6L{=~Z03?GC0RR91 diff --git a/app/js/app.js b/app/js/app.js index 45508f0..bbe72ba 100644 --- a/app/js/app.js +++ b/app/js/app.js @@ -1,5 +1,5 @@ // Declare app level module which depends on ngRoute -angular.module('NoteWrangler', ['ngRoute', 'ngResource', 'Gravatar', 'firebase']) +angular.module('NoteWrangler', ['ngRoute', 'ngResource', 'Gravatar']) .config(function($gravatarProvider){ $gravatarProvider.setSize(100); }); diff --git a/app/js/controllers/notes-index-controller.js b/app/js/controllers/notes-index-controller.js index 3746ad5..e5a3c57 100644 --- a/app/js/controllers/notes-index-controller.js +++ b/app/js/controllers/notes-index-controller.js @@ -1,14 +1,15 @@ -angular.module('NoteWrangler').controller('NotesIndexController', function($scope, Note, Session) { +angular.module('NoteWrangler') +.controller('NotesIndexController', function($scope, Note, Session) { // Without NgResource // Note.all().success(function(data) { // $scope.notes = data; // }); // With NgResource - // $scope.notes = Note.query(); + $scope.notes = Note.query(); // With Firebase - $scope.notes = Note(); + Session.sessionData().success(function(sessionUser) { // Create a new User from the session user data diff --git a/app/js/controllers/users-index-controller.js b/app/js/controllers/users-index-controller.js index c11c062..a8b2a3d 100644 --- a/app/js/controllers/users-index-controller.js +++ b/app/js/controllers/users-index-controller.js @@ -1,13 +1,17 @@ -angular.module('NoteWrangler').controller('UsersIndexController', function($scope, User, $gravatar) { - +angular.module('NoteWrangler') +.controller('UsersIndexController', function($scope, User, $gravatar) { + // Without NgResource // User.all().success(function(data) { // $scope.users = data; // }); - + // With NgResource - $scope.users = User.query(); - + // $scope.users = User.query(); + + // With Firebase + $scope.users = User(); + $scope.gravatarUrl = function(user) { return $gravatar.generate(user.email); } diff --git a/app/js/resources/note.js b/app/js/resources/note.js index 938aea6..4b3c3ca 100644 --- a/app/js/resources/note.js +++ b/app/js/resources/note.js @@ -2,23 +2,12 @@ This is a way of handling ajax requests using NgResource, it performs a similar function to the Note Service. */ -// -// angular.module('NoteWrangler').factory('Note', function NoteFactory($resource) { -// return $resource('/notes/:id', {}, { -// update: { -// method: "PUT" -// } -// }); -// }); - angular.module('NoteWrangler') -.factory('Note', function NoteFactory($firebase) { - return function() { - // creating a snapshot of our data - var ref = new Firebase("https://notewrangler.firebaseio.com/notes"); - // using $firebase to synchronize data between clients and database and turn it into an object - var sync = $firebase(ref); - return sync.$asObject(); - } +.factory('Note', function NoteFactory($resource) { + return $resource('/notes/:id', {}, { + update: { + method: "PUT" + } + }); }); diff --git a/app/js/resources/user.js b/app/js/resources/user.js index 4249e7c..8a8b953 100644 --- a/app/js/resources/user.js +++ b/app/js/resources/user.js @@ -3,10 +3,20 @@ This is a way of handling ajax requests using NgResource, it performs a similar to the UserService. */ -angular.module('NoteWrangler').factory('User', function UserFactory($resource) { - return $resource('/users/:id', {}, { - update: { - method: "PUT" - } - }); +// angular.module('NoteWrangler') +// .factory('User', function UserFactory($resource) { +// return $resource('/users/:id', {}, { +// update: { +// method: "PUT" +// } +// }); +// }); +// + +angular.module('NoteWrangler') +.factory('User', function UserFactory($firebaseArray) { + return function(){ + var ref = new Firebase('https://notewrangler.firebaseio.com/users'); + return $firebaseArray(ref); + }; }); diff --git a/app/server/views/index.html b/app/server/views/index.html index 0aee2da..9173e20 100644 --- a/app/server/views/index.html +++ b/app/server/views/index.html @@ -26,10 +26,10 @@ - @@ -40,7 +40,7 @@
-
+
@@ -54,10 +54,6 @@ - - - - diff --git a/app/templates/directives/nw-category-item.html b/app/templates/directives/nw-category-item.html index 901d526..0631a0f 100644 --- a/app/templates/directives/nw-category-item.html +++ b/app/templates/directives/nw-category-item.html @@ -4,7 +4,7 @@ {{category.name}} - ({{categoryCount()}}) + Dao;=IUZt z=#&}pi=;VVsu6G`Mk9V~bYOxSM~IRD5{syybD4iBCMFw^kw}=H+jCyi-Wa^eJMHh> z&v)N_-QtIgfkVddJ2_IoP|gbZEqs%+`JS2jqur-!YhOzI;u}p|S@dSP5TXz-;cyD! zbc$Q?Yb{>Ico}#J*$$f>HFJdc0>H7xD3OV?j=?9qJy_MI>bdO1&#iN$xcb|TMwOCy zRblw)79}C(;rH?kdm;9eB^x1$@dYqjE%_n%FrI~2t7Y7faK5!pR)g7Q$w$G5u@_<( z_dyclmtY1gc^P~dT@VX+zWw>Zjt{hsF?Uhiy)sl74jj;(v zFm8uwjJu#Z=#l%OCFt=U#y**I97n4;X0#hON@xzhgXdsxgk;cK8s_XN&c2Htqzewc2zmLA6KRNMG^88x0jXZFhj-!@CGf*8gvki_^3m>rh<6nq#j zLkwd+Br(>4*=flq!H01WVi@0pB*xQVhAiXHT=0kLq#I%(ORk3`#vU-cEExwM#;+jO zWf|A<;Cz>AWQHyCK0H5aWtUdb%HD#Ou*Z7_vz2p&81qqfiap6L!a7wi{8Yb&UB=!7 z$#7{jgxMuH_81?g7ugrsadbY`H}G>EVcWa=JG*f)&Em#WuG$YTA+KluT1wu*=3S18 zk2!H}88!IX?odw7y^RL^tCC#9?zn>-Wba%~evLiLKE`gllj_IW6DddWRm`Uen(v|p z73?GI2iTvpJJ}c6al8Er>VKO3_1)wtcE?JxtAOTPP=&_%#ad3BQ3)&&_JoHVXK&=k z|Cutr8e{iT{WQCi;Oq^pMpHB<8&YqY@UT#wVzl+FzwyTKd7yX=wIH|!0Z2K4PBKw$|>aVc#aBEdr zgafMucH*6@@(8<(>$kJFu!q=>FHGIP5Tl&9gafPcJ^O9;47-_KjCWQb2hwk3L>Uk6 z{eJ4dJ5`T6#=k*((73)?sukj-ZJu9@+X-%QRdWSyZRP+Cnm^GzsoAw4yMG1So?p~x z4Z1WR(LAL&7tccG0xLCd()=trn%;nMzk)=AWn5#xOv5I*5zIzQ?t&o3 z{gA+T7?K#L!ECbR9}vXofkcyE-Vdjn{DFg63nz65{a=$Z@@Z0Q9W*K16;Kwo@LnAl z!!V994wo@L2W1hz9D`8AA2^A9G9P>zt;SfZJ-BfLjS+V880>aPMyxeYa`r>czJczi z4(T`tWzCi>fewtjVI1QiTyD13yo1ZBmhq5>ihoCE_A7v3izV-Y1jY_XVtf(IR!g3P zAjW?nfw2gZ81DnK&61rE#5e>AjBi2`V+zc6%aA!x-M&fsAkl8gI!I!C3e2d5ix9*( z3yG*@9-FP##Ut*`yjth~$hz6)D zrh;~oic&W!*^=` zmZ#Z&@t*jBeR3I1AkU=w)KYQ<`_CohFgt$#02(Z=@!a zgG;TBQg$1zj5-?G9&Ybv?_$5kerQGd`Gq*kiCG*-9Y3*$*)Dt%HDDdPB<;TWU*v!? zZrr=8ssAw7+h3|tGL`?2luMU_@? zK=T>R4t)2S6I`wNF3nNRPm^2cm*gd_;I!uRnpdq@I02vLEt?O8u^la4&4E~? zyFJvowZeS%bz%ETutRx*s^cte+wr|dp}=>pHU(H1;5^D A^Z)<= diff --git a/node_modules/bcrypt/build/Release/obj.target/bcrypt_lib/src/bcrypt.o b/node_modules/bcrypt/build/Release/obj.target/bcrypt_lib/src/bcrypt.o index 7cfa8e3a60c79d5096cd348897dcaaa08342d883..d12b2495c10bee1003c950e3f92f6daae343b47c 100644 GIT binary patch delta 1339 zcmZ8hT}V@582-L+r@WkM<=BSbGGNT@}nhACQ_g-Hh+l8BKccoA%obYT+8 zk%aJ~F3Ri=VIW2Xg>)r^f;UNd7hM#AH;EVhJkPh|R=)V|eV^z3`_A{{TE|+){98?~ zSnsrkK(s*oCxK*0-*6Qyf;>Zz8F<75zn6`d^yntd=r{KNBra)ejft{=Lw(kgZ=rh(xGK$ zzD`4jQwZZtI@3`5r;3dC*2UcY&TIJ0G3!olS$vsUA<6HIp-N=^1TlxOcE&XW<8l-y zVV0pXA|+3jvYj$Qb{0k1AtJfyAHWthX7DEQ=@jN}80ZpeBi^s_TO^J*be2SwBDk(l zC-DKvZ=51NpTYa!ijt3DH=)v$GOWg%oE}z_Ob!aGMJU!#^Lm+Js7aTVtA@ndj-a2R z2E;he7~-syJDhgK9vyz8UvDh^gRv2`(wnq$Axow8HLpHci>TJ_Du;1tS-){V#;rPE zm0VAnKBrsOS$)MF;pkxB@PIi~ZKiDN;K?gPvFetq*JJ0BpNfxb$#D3KG`Ruz6AS1? z8QX>Vycq9i5W=k>p0@M(f{7zg3ZLk|`IVMg8mwuutFjq_sMCf0Wp}CB75A|!+HbSd zcGU(d=tkW-8pw<$AInUkC;JLLHbF!-nT}5;hSu z2!9<`U*1J%A+#o&9?F~ zmfKF1`$WQBWL!n5`?sj_E=qIDA`)H)9F|c`-%IKn1$>~BtET2Vd^Z6fVft!nuETd5 z@JT|#S;HqMFm*}7yM}KP(diKhlSbYY;LP}O!o#F_Gr$kO(ElVs|5L!nSg<$mc_#D* znF|?cu`;H;%w%eE|KuR;wP?>Nw_c=Wj)~EnVq+0mL5_9CX%w@q5ivtyC1$@z#%>AB zlUXF?5zcY4ko672cw1o&DnvLo{VlPDN3-}FaLWe9Zs7QXZNTL+zme1N22X&9N}?YL zr+{~GtnmhLM;31-mlZ7&yGF`&&O@@jj_x7ZNk^lQoP=aG*{>4`n(TB|y0S^Uc|X>RX+!9>;aR{ZIkky@vn>Ds diff --git a/node_modules/bcrypt/build/Release/obj.target/bcrypt_lib/src/bcrypt_node.o b/node_modules/bcrypt/build/Release/obj.target/bcrypt_lib/src/bcrypt_node.o index 0b9939afabc6821c106ca87e7016d832fb90286f..5f0df9f2fd9947d5f31286db09f6d8ee828955c5 100644 GIT binary patch delta 32303 zcma)l33wF6)^^uS&m@zONdly^CleANA#6dm07BRo0RdSAm3;>x0c3|^l}$EV84$cI zg5ZWIDlVwtRoqZT}FN$~r>Z=R>C>%8aGsj5>|r@E`Ud;a`3 z=Kk+uHk2i|yi*wbm3!sMXt}ZP)nebqomY!%H~zR?l-nD{`sCg5iaF{@bzW(gxLTx# zo>kPrM0Jiirp}w~#jX~~J>F2%+O_KZr2Vq1UB-LYtL(~ZD75P+MaLesYq^`Jrn5MXk zGgwYfbbl}1{4ab4cg)t82 zz&8goyaTM@(};J*A;bg1=XNaMrr}+6%;c_yQRsfo^A5&}9 zvBL8m$TE^Ixbl;P=Mu;*INZlv`Dw!AgAU1k(Ul(%hPN*yFLnX@*_b9>VXbxGyUT?T zu@k^4vj5IX3r?Gh{HzY~xgHb)IaYgenqizqg{;mH{QK{}+a@0U;%56G(Uq~pYzSbJUhjoto2kRR1C zf`-+7JCZ}QZyz)p{$XGwQo~hL8^PB(cwYyYDU>Aw6tc?E+tav8dVO3>Dvzdl59EY{KGCl#=X5#BAqO?-W2 z{4}tHS->|`#?ydxBEFG$FjC{*0Oyi%YvlyXfIUduu8cnp>PY~%k`anx0N)4f6!FcK@vnfT%mKcoGF}VVHN@|zjE?|zEAg$B@g2Z| zuamK@GUI(<@pFOSSsBj&)}HvkD&t*%-AH_UCA>PvxU~}&R{dIbSk(cO=YX{nhut}^ zPM60j;JI9dHC9hGjLg=`9|+G@P@S8D>L6Xv0SM7Sxu(DcxvDdbs~)<0(g$+PBp$UN z%1dkd8ezBw7rcl|vD7$8jsg1pXmEOmIY!O806W+>##5o_+xjstmnD?ly*pXsii=12S> zjc`v}pInu7Hr$c+(SeR&N%p5z*e{~j7=b}x-^SEu zJPrRL^}S%7B>Ov${ZO5n@$VxZlLq>nq>KEBw zq>)l_yQeid$eat>xJEimm#J-_S zld3X*0u3|*rTolMUG#6Gqs1G|J+9eYik%($|~ zhA|6=*}+aOOo_W0(SMWdNV4b@qDBeGPE{(W+B6lc>&fm+=^N%CdW_^%m5rn($iR1C z6*d9;ntx$4273{1J)=h~kL2M2VvjPRG zQBC#qz)B#`+UM$KcwR>=)~;5VQJT@zFq+^n=U2_G70^E9EOA=QvFSjdv+QAoDW1Az zhB3sRQlyFgI4!^BK^j_Tb#=y_Ewx(l!l&jv~jd(rS4tfWB{^DGZc;(7`Zj zbcD=~s(M=kokq@1Fa2DU-pxSYw#$lAO8<*kt4@%)t4a=mu|SuQb8l6>Yk|IDuPZ9> ze1cfIeW)n++TzaYTE{%>*dovl(0g%E@U&MuAm0oQ@O-)x^9b6-t?iXJ6rwSHpht-+ zvA`05_t_2WWqAIL*af>6Vm0Bq+S!xqWd<)KqDJNzcl^!OwNI)k&;xOplibeuy1NyG zj6esVgUP9=${7xH7CAGkaux#JM9#dboPPm5ltI?ws;nbGKe7YGDZw*{{Y{xQRb^su zg&)9SZm7yB0@{(B+pBVV0Ub-u9aT9~fvzEEdnHaA)Or)({bcQ~!~*9rpl^_KPgTw- zpg-8>QGs6&OLar$U{#sAK)aIjcva3opfkyNx+-Tm(B0%bSC#WH&{xTMu@Z+Bcn9$J zWWDU(g+^xo)eRbN!bRgSUvclN%xMSoTKh=-lwe(Skghn)<8H@a>eK^)P9^6xxAwG- z-Y0;*P0s7?9&p7`InF>fYjK!wxVOnG>~L9FfFtCbaPNxZumbM`{*|nEt0ppQ;OY{G zd8$&ak){#Qp7w?YDZy(In@O1u-0x%DL=|Q!&>iG_=%#y(;@l7PC2~G;AFj-K8|Wo+ zPFK!Rd%jRj!+0Kt`KiOMuZ*JkZ-VzT`Cn+h+p(D`F9rHEObIqXtS1ihtEw_XfX*Z5 z>#CeJK=+b!rYh%QpeM*VTZLof@&-?sxDsK+bh+qB?r6pOqFeli9wQ1GpdX0b6trcm znIPhMm+5@9isbgN7d_!`J@JGW6wvz?S zO$HmaH{<8RkIJjDNvJGuV$C?yncN>$o^LhKz2qcSRzs={Exsm?ty0W<#5ko#;U6YewJ)-kB7OmoaV-1DXp%(I zry#Z-hv^C5XGjf3U^~!%lN0OFBf=L|iMJhYwJPFsN@Q#rm92g}a3!V1`aCsFqh%9B&+H=&0Ns2 z?s^n7(~uGa?CemQLf*XQKSDg6xPpzqvp|k!&`D)@^lF;J`j9MpShJMO-w=}>Bg^CX zq;u42@JTj!a7o4u~NmAZ|1=O{d|2gqUjspc8MV~D*^epju{ zt(I5v65-ei==!=bq0C!xjNHA>%*K26sxw=NJsCH$kdc-u7Wz6zEuzHI4RbCD{5&7G z{=vz}A;S@g-2C(Q)yQW?W;$#rWHK%bBuV{hQ37p+sa4Lg8#6C2iI2DaMxX>Tx+MC# z%13D=Pl`X-BI zG;fk)>!K9Rn*>CFy1m=-WB|^ zUqyEXiKtBd2GUo)1gjzClWT(!=?Y4Tzbn8D)fboqqr_|KEpMIeV*JdILDel#$-1RBGv^Q^N$$LclqR) zKgY0n`>?1!GL67BfM=0)F-A`(Ndw5nViHh!gYip@vy!Jd+rc@^G{44Z$Lgdx3iMNQ zev7f+Ym*dg&iIT1xqwO4*?h)hc@QzI1cbuMK#28c zvW$Wtp{%lok#SLu^p}r|zpte7@VKzYUYXc)O@peV!Q?8Fk$f18$Y@YW{oevqgMm5F zT1wiVg3OQFN3TrFR!;D29k9*gvGKR%YbW?@7MuQ;D|3RQ3UHl|!+a-p5yhazk|oOv z0sWqw4`aiq?*{<-KJ&kb)~gNv>DYJbRZ2Mk=n8T^k4kwiz&2bD_-V4vszldC@_Pet zB8p(1k4hy6WL_5FtH}B*ip6^&BX20+TgWnf;Zhobe*yW({=RKSD(h}0faiAVbqUBP zc5b_-o(@H*fqiYeMxHw`a&NS6K}^7?6YV4IvVxDnM#4NC6JEB;+m(q7Ili8iee)(- zU9N-r{(@nBTmm=pRw9`cIvOP;FDfZy8R`v-%erq9ZZSgzBlo--KUL%I>R zp5sP>&TaWR>N5hl5Ym?n`_LzlgHJYgY$#9bDYhZm4b?aQj>&C{bDDV~rv6Px_W&5? zN3@1ff2l)%OgdP9okM>@dSU&on(k$uCa@rzzD@d#uchC}KIG76K*vU1H=hNap{z>pelMSuWpe345_A4K{i3s!rIoZzZl;W8!W34;odJZ7=qdlxs!IWPR ztBZka{wQ}JUS(!_Z=(_59%TLGWlv)n4$Be;`T?Cu&hJ$@Hv`>IjuGSBOX)Pv0sW8t zW2cm$3uCDk4$~V`MQ=l({m6-lxdOf^D#sD1rMzm3jnVedvofo1R^xa`l4UpY)&P-L zZ3#q`n3203YSYXzSN6!ph%sNYmy5G)b_Hl&;+wreW7Mp0=&L~|x%0Q%k9H1}-VgLG z9Aw3xe zx|+kJ>ypb9zW+j-kMD~M{^I~uU74D7Rnq?7z&L8}@9NZbFlb?(jH>JJ z@D{SJ@A;m?bceLcP3Ke8{6N+)AhR|K+Ay`eTI&I`n4Z|;rr-=^JR!EYH{#P6w_=M& zA$}dynYpo9yfBUp>TUDcU|epD6+kQ7LLxp&8~!Juv~s)OBIT1m10!M!rNr++cFGn^ zO9ByZvlyG2K2fJs%~)te5B*J{ZfydAlDu0&?VgDS9TD!NQ)?qX=YagZ_MDzs^}cT%>3(&|z3eHNsX(RIezvF8vpvKscfT2u zom>t^r2DBfey)M2?nl+^HA>q50vJc_yk2PoRrmWDS8T#;yAn!6^HD zuSTsOXlWSLN+Er#mPX!DH$8c^!Rtrl{9Vbw(FvKk?DTOG-=h9UG=6$ri78iX;{c7(CkBM5y) z7M4ANVRyrO`pet97tqS?TOvNW0^lEob(6{+pr4daz6Fd(2T)4<4+B&kfT?MzejVee z-hUFDqxOHUcIL8Y#!NLT^FRm{5Ong0-b@#J~2x?hgBMId~&TPZ$22^ z+1K&pVOTtGA5cD=X0C{!YSq?{o@C_RFwQU@8Nf92Xq+#g~?-`h|0&Ae(AVvo>R%7mK#43H=jDl}lA!c|PzS(&gMI8*H0ekrZy zB38v@N+$1KaJ0!#ydYX?#f372PBsm2lp%E9dw`bMCD){szK2+qzH>sA zF9vm}VhF{_D*@*dJ9v#19E(_$o}y&JTM9NJgdSn!A0zaff+SMwZ6LoB zeNE^aq(EHIFgoBc-xAD@=DrGNBXG6Dcqh!rgBC;O^gaaLNm*3ut3x<11bMkp^?_(u zg%>yop4_?lP^f(%XXoZsFbeFW{Zlf(LQE_|IlhZ%HUcp~TH8PN&j@xxY!&%ulk|Ko zZ=yNsbTQ=BhmqT04IYX!A5Vx_GzHTtZnaLYHsqu6rX{D@?5`X;6*Me*-l5Y#r@0$m z0xd0^jwwBeMT>yDp$Ez(mI2Hwp&Aa92?$$+kScJXEI=lqe3r_5IstV{S~gd#*ZGiSCN1zT)q4S0SnN2i4g8EokBX23-efF~hQ>zyt zCX94038Zs1EA>kI?7+g<3=by2+|+nGZBT>4STJL9yos25f5YhZUZ46kPBF3Rd>|k_ z0Jw1x0>i#>(0uW`{q3Nf+B1^iJaW8m0e%WmUvBDtoMKGxmq1!48%A7CYJ-Cfu6@jv zv$70##kr|-af%h`bRX#l+hX^Eu`BS*>UEjH*ICG&f=IKIjPDY&U}V?EK1TDtIfikt zE7CfPF)hA?#4!$!mb2EP_Rq`NP0F49-{nd-)HMvLqRAp!ru4cz%=HqOy@^2c3q`mB z?52elM6h<1u~tVgQ;Yz%sU4C<3S~$}5DeZuL^GO~qbhfTA)kxkW`<71(WdJnuTrJp ziGL8RB3C-UhSsq}7PIs{7*Oh5A?enlQJZvJL3G9;Mhn#?)k_vvj_!fyxp9bY7*E1? zeh%9A%AbZ~-E9QGw&-RGYf}umKe4)cdRET`lp!ml?IZdkQQW0s1r%ur9PwWmGG1k zaEL#n4b!0l&@RHCIVR}v2*^(fopc~s!%Kh~iw=<*o&zBB?I>#)u5c%KouKgiW^6Erpt}Bu4Z7$b2uAI~$vo zGlz1u#VG|p{9gr)(qMg^>n53Nr`JJ?rg3ZG!2X*gop$HMtMC-bY4pz6>TkQd)BrUd z!zD3^odj>C$)9(|wQ#dN0ng5E(hH7bawo)V%FC3l9eW{dqFcn*f)K}Cc3U8P+9ffT z5+a`xiP*wMTW+}?1@MvSTaT#G{%eloFvlWV_%2G~1Ef9&^)%EZJ_M@U zub`^;2KC4rR4s%*7gTE^&nRyrlHQT!@pl6_+CDm>=Ew@f)>7mc5+r>h*~wc0JVEf4 zDDY(fKM{OA4Ep-Qn1(;$YOKTHNIc~{D5UiGO8{PNw-}k@8HCtOd&tP_(nW}Er|_AG z8fnkudx5@8&QDc1{&#?$vk#1{>G=(@6#M0oxxpi-ZCax3*@!cXk$Agwnp+)mlk{wR zK|V|ih3MIgKt9ad97kepaUK@trJiac?+e%ADL8T#1{UD7j?tnjLV25j-c3$}WR%gJ zB-_vk><9F3d-kYY&vC@QwYQB5cz#DL!9F@FH)!=WjD|Q8d+G^6=c#;uUMsM!CVK!? zst(4yD}8r?nb5UPK=^RoaY-VGt4h3ZL!J>7xSSW}XGdrC|CzCfcI`C0bH zF@YGF=-6H#OYS^zn0_Z*wy z=_F&55bGmjtH);CI0UirI1+2PREKej8kpj6a$Nmz>A|Au(Y^qjRZLT-YMQkUr=)6{ zJHWZeP9B#&#?>Dwmjr6ybPttubh+W#BI>={;H>6RXmQ|HoVGLC)Ab2_YS=tRV7J2= zP$hZbVQ`Mv>&M|mBEs<#5N&S2ocn0cZ9o%-s*qR=TwEgRZ+}d>z zYl$Oq3|?7u>?KEOpabCkWX(WcDRI|1^XBT4c z*)Z@ z&dq*ldQx1#LElrTFIl;lKr@H&tzyJ`x)ZUJZY=U#FJoKm@1xuiq10jpBszfmM{k4#03!*O8Qxcvr=+o?HL$>KON4kLLSPZhYe=#{#*^8&9c&Z~-&)zyUy;@7e5@!Xv;xyPkGPNLXC}RYR>>tWAJmr#+ zP@d~qEMq0*xp5m1yNe$ui61)oc(zLBafm%CW9KV! z<6lGU9L0Pw_WAPk_`e-GEyfO(=Xi2&;6=fRX}R%j8KY#27<)uTdi-^u=i*50BvX3U zkhWi&RuF%$!x=#xsR>5lB?p-%(|W!HebH_^J-6Ub#FBcVkEdsN2Fuu=(+lFKIAZa!_JQeX_W3Ds!B`HoWnjeaLeG0| zI3m0h&BRrUkyQ(!@CW0A=mfmBsqO{fAI*-i8nqRM0>*{`HCI+oqS)jxYRF8e(#zKi zcrEO|);j|ljs)Q*{Wo~0B2JI#zuqV~fGI~5yt-+D(vp>8k-LnDFckOp?%JDpmSbzJ{O*!6o z5c_kOojo(Pnh!Ng{w`1*r&7CYX3bz{#HJF=b=K5D=fGKUdAG-xhswGASr$=`hOkHhf)=y{%kn%l>R;iq#l+!c`I2-wwbeyV|Vm)ahik3b$KA8~<|2E1Q)ae3-n}s(l%~(tiS{ zzZf0(F?v#1p>GbYyo`2CPDWYU<471DVN+Pj82+AM@p2$xG}BOIqAY3hVt@~kG0{n9 ze>5w>^Aw=3?eAx$2fs(mC@90Vuqdd7OG43O@<_wjhNDIwUY85evesG>dp2QqER<39 z0^_R3A@eomI!ZYu)-fX1kzzgPGeu`g7(I+pSUbg0qe)nE2B{W{9Mw&vYSkL{j@h+E zjD2i&%NhqUHj--hX5(D_5>@s2$WETqE68=T21qQ7j!%JCj1Hmhc{OOEa%EM)4zToq zs^A4ApI8NKJ_IBEHrzwXJLRpYKW?Lm?bKM%(BOWw#C}I`hZO94t~=I8fvEx&%2Ku> z_z}Q&!dWRs^Lvs11xG`^6qZ;u7+7Ynu+rWb{gP%4gD6iYl&8QElErD61C#s5%3C(c zZu&p7H>2R49JVZYzl1KsY2ngFU35+luopiomR^o* z6QAG$ywUs$lxiF#qAf>kMip!Y@?R`5yUx6VEVkzh3uxy~f5TEyrfb^L9y_mnP%e+o z5?mkc-xm3qGm^NiU^GA16yA9}ymO^B)pQt1G?j^N5PY^u37QlB4}wjQM+pRF6>3sZ z%T+;U`M6Zn>YXdljllmEPD>S3=4MF7JTQ`mS7GEq<4!P&!VIa_=-3^MwqdXd^D@%8 z%9y^h4EN4oAgDc&%8F>9FFE-V;THIqIl**|8|ig~<*JldfA%GkQHonfVO zU<^%EnIF(+F>owIk@tfO$A}y|CD=w3+WmsH(k`#T0P0AzZwb<1dxM42s~lO6j06VT zP;yHq!E9Rdli?g5MaLD_vPqQm0Q6dPis;VJJf=H7BZJhk7pbw{ir5XnE;4;IV;!8p zxJj_Af3(BNUxZlGG`5gOE=)C*t>qDNB(`FT6;Rdg|CpfkO^j5Tr5x49=nJ?O?mHA! z+zTzLFhN-xqx4uEj1uQ<0X2v+1UGn$=4ZjGF}dm>x_1-HDo0zo9&HqC^?wj7ZIq+S z_24GdADb9I6&i+GOuUpVzgJMor*~!1A7nm8$A8tv-pUxK)W6MT=HH+(%)?1?7HPf- zWgWrHol3~mk3^SJYLM zO6%d`s40`+LQP(v_5B`gA2Y>ClDZ5Fg>XJxt#3tEeXv4djbsaBz+Yetw|`i|0TZ`W zc^JuphnWN?Y`_DE4wsM&1F*x=#@SUo42vwM64%D@@Hgw1UhZ$oFv|YX6&ORA`*IZP z`DEmT-?-}PECxO{4*4R>zn6CZU$PvttU!5!KI|&W#cfDXS=u|7S^e%s26IpqH6&EM zI}PdS0Lu0itjKF}1;yx?f^KtPIE552I$nq2c0_@;Z+WL6JBxJ{cLjR#gHfzhzjP-m ztA^J%YIu3?onROnkRmn5`zWG8M7^_8XX50EP4C|UZekOHyFe?Oa-8qF!$=YN+pO4kcq&&#epKz8->XmM+h za>{-b@c}AnouyuXi*$Ew1Nlm7bIN@dC6^QJbLAZKyc8@=gPs;&+5=WKkWT?gbsb?m zy%lvfiACuDJBna_BQF;FUts)Ob>TS1Onbum3|-l<&Lb4ouLxb1YcZd!i$`c$sR%t* zK0>cmgfPY`K^SY5A@mtgu+Hj(XwV8?hZ8&|`%VdaZp3 zW30y!##+xK^jWVVjI-WF7;k-zu$uJ?!UW4)0(WZFM3`vhAWX6vB22bgAgpe+M_9w^ ziLjp^O+lDyEkKxNtw5M=-HI^7+J-RG+KVvDdI({*^%TNf>qUeC>urR2 z)+Y#SS!WUETR$Nzu>L?;+wv@h%dyfB*0t&&EVQmbSY)+BSkLOW6kW8wH5^0(YbwHq z)_jDGteX)ww$>vov9=>@V(mkCh4m1^rq+`Pn^`X+Y;L`Yu!VIBVN2^Xgr(MZ2wPbf z5w^Bmn0(q;@d&T9G7z@4Y9nlCH9~mAuv#ud{zna~1IXtLw#xyl58{S35}~jrA#_Wr}KFw;hALLdrNk3I+Ub6KXw96h3>RNF_BU~fk%>1>a|Ga znhv3-K%>;pgXS|bX-|Vjsow@IYw--|G?D$OLq7`|rT&j2e-v~}k^Kv3K9-aA9O$y3 z$o>-mU4sO=iR_r0wL%K?5!orx^l*`#54r;jM1Hx*o&;JJi1ciceN!|&Uu4gXq<7~p z60j=(_YA4P9n9YVwPMxXY0^V2bQEtI%b&?cMqNJR-Zxswk}o z0Q3jIPh_GD?)=9Ad<;PLY63?9d=U-21mHUWj(zh_0Js2P6FV}KZ19Tgq3CVOctIeW zz396MDCkq@3285MeHf?Mw4EY*6Cy2GfxF~ZfA(Idr|bc3BGH5B?^~H@V|rJ}rL(r) zK?p{oK{L9VgK;X$=!dRWF)u0DLY#_3@hJ>{b#rI2Qa%IL)o>}l_i zynp4fTTWf|aqv%g@vvLo_SLTY%^T zh-Oxpx8qcn+1qn7&b-{pggOk$TR>g~sZ6ND%PzgSemjmUUM&poNZ=#TLDJsrIuNJf zX?K~~-$K3`d(dt?2Z+%c_Bp%Fpd7AYr$PY?S305nP677Z+N<73XE=`MUZagiI@)-o zqm4&8Y`m+Wlt8rgNJm?bG_3a}%JmFA+iRf9MD`z`r5#=e-3`{YH{4cp9Ig2&rQQIF zV$qsmT3a(rM_ZHfw5AIcl+zP|a*>@JP0zsicm>+Ox8rZG6MPe_jK$tR0KAB3PL9_L zulWd~nKRSl5uLCLaU+m9F5))Evs9j;z&k)7bAs%v^dhTBPNb=f^sb1T%OR7NS?ZaB z^8zwk$)vME(w}FxPLydEI;z^(&)%LH{2|xy?u7IJxa^E&-un^lj%eOu?;%95L^M$1 zeGbt=L~}cPUqjT-Xeaq3?H|zQZBqOt(DgvmmWlLl5YJRkVy0h2-1{U3<#IAl7gxjO z%sxh!i}Yl~Gws2fsx?0jq%h+K&vQ7B1e!5ami$GK(@74K1*f;T#PK?umG;cFw{9vM z@+2b@5q#%!_hR6UA0nx{TrQhH z;KsKnfUMvr61szI`KjG3R5$lK$cQ8S#`moNr^p9=kMcQR_r@K;Dd+5Yp%QW4ejqd~ zmp8rgu7sS5s5=neD^>h%7jNz;X4q3Vw`?zU)(}*h>2jVPt|^}$c5ghguo=Ci$Pjzd zn9G5M&G@9F$kg+N4+}Vpx76)MX}RuB zjq)B`Q#%$KLmDH4;V7lZSBssx8b=mZMBP-~3zZcY?DJbnRR!kB3Y-sDV1A?mNo%2N zNu&ZbNH2}9z{ESEDp2Z{71(`8R0XbA*r_|3qXLOrTh#miR^ZQ}SlM6&R-yuS`PRV! zY2$UWh(V}QPiU{#PiSA;tcLx~)_M_hJ*sl6wTHm6%R%N^V} z75zuZ?hM~N$fOu5)nL-p*xHs+#%3LJ1403Z@ z+QYZE!y^2S?N?zD{y*D0iMDphjvfuA8ULgilQ0~W8UL%Ek}p%;-0k#|V6$`fJv*X$ z#bBgBxBg;BRIiw?u+*JV*mi|owev5LX7|`t7vZ#B4N!m`yP6h9_nKgI6*fmzp*TiX z;qP6UX#LE)vZc8isH$!bV)?S`T}9wj+*KQu3*A)<;gfe|MeE*CN%zVq-My7=v75TH zcURKAlDfO^rtayxse8+A>OQ=?L5VcnXxV)$ph0!tF?xhO9&Ece_+HlfhrL;HTSmL3 z&6RRo6qVzHm*u!f<#@u$5w1>m)J4Jh!%-Gi6J@CjhU^2nZ5N>=EV*8&zShQHD4d!{Eyl&v=bkf`bB!RhGY^-eVBMZ^+>mHzs zec}O{`1Aubv1@-}8(GTFSjt^UtNg_0;aOIi@{G3Rl+LWePycDjD*T2j92~npUv!ij z7E!~21Za?UUdAO_%y&WMe3#Jq4qi4M*Ya4F7Rw`bd>cuE754E5+oEjo2iP^69jM=u z7Li?L7ZaI+IAj+IOR4*(`l4em?Y*fn zJJ5bEyh|venJatUOXu`h#>0D9GKK^u00-9ymj5+0FrZ*gq zN2P;`RXZM zCQKXCsQ1(vV+I|p|8BKi7_9OaA8J2aY`6P(V-I~gTWm9vPb^~D4CB9Zl|bjv+65vr z{YZawA|ThULnpyS;9IvVc8k!_1$ZrFTky?h_iZNK7BhN1y-6 zoP6htsaCI4spR7jh%R2G=z^|_|2VJc@#D57^6O5~;=#2$qhe@(Qt59zTWpYs6jbf&CO(K6gE91itbCNet@*KM(DtW0e1 zrF~Sum@`t*{I960wUIA~f!%(QlGzk`V3|lQ;YK5q9@hntFN=ZB(c?+J=?B_r3Pbhk z)uGbm;uMqhFhA)GWo~S$bT&3hpXu{1RH(9>+ z1#UMq0e{CsTL8QM8WMW)W>H7Phd#Sm3=?;S+OI&PObrcKA#!_hPni|{7KV6!oJ=PF z&5OA>rsQK7Y>}!>F5g!K?v!qoYVKB{lPg62V7}o;Ew5ry<&ST{kal{oe0dG@E2tBH zd{vVCd)7+Q;0G3%D>q=;-3+I)TH&dozAHtI=6qX_;*K-nwl3)((0%yhlR2!|%fsQ9 zMi2o{St4&&m7?(#4yGNnL5dkSgg#p-@>94cOBGpA#Vuj}Mo6Df!UtQKV!lqnw**N$ zjn235NIOl@BJ}hsk$PiyTt*Rgx|w{75VYgd5@Bib+l@ki-#4fX?ti3nBNpvsDJ9f?wKy2$>u!YWcS3+4A1Y;~xcDGf9uViJC@Hf&fB?TYaFEuH%ZLF% znky9iu`83d^;mOvS9HBHacuI z^ce1pcnu}>!f=(4PdaPpN~B^!J{4SmGk*NM1R;J)L+j!q9wDyl)d(tOziIQEku167 zM=|a}=#>1d387O>Xnfkr;0I6%HOvh|{NN^`bAfP;_(4-bd>%~koh8?Q32_x%Lo3S^#Bc9t=yUW2O7WFa4RP^}5Le=~c|Px=AnwNN9KR1@ilP|T z7In(sb&K#Lz1oW09H108O0-nXG6gkn5LPxw>*8{(mXhD(MnXPeq_gBF!>Nl)LM|gH zt;nxc5vvDfIwkj22yv@LmtTH63(zh|Yi0bBBc-^~r4#Z?RfHBq3dXG(LfjeDQd|Zn z6zn!Lte+nlBG#*MSU(qt3CTZ)!x=wLbA%GwhZFK^WQ5)+4(sRlx(NM_v(8d}JqXaR z5%n|Y!Cg~~n=0DYT;M0ftu|e8zKlVLFOF$t{8BR^K9`_vu`NzP{Eohc=9VdF7rKg8 z&yTV&Az#;q)M!KvemRcV2dIZm$uId3I*zWcvy|@-0Fp1aLJmLqJuaO2oiLqHezg{m z{05?unitC3Bm(Lyrr_L$Hq*kqnPo2g!~uF8e;s=%XmY1;_4$4wrT8X{E(^bpK!|&@ zx?=q30U>_tT1(~hQIH>Q!x`z^JEqvp(O z+!iCmoig22{IC_Fn8p!ZeIyh#_>PZG85^U-`1*l{p8u^W)PL<3|s4%G0_<_{Ra-#huorC_#&8 zDZZq^g#W%ate^jnK}i0G1?2GK(mNrp$ny^(`0Ih(iM!txnZ7y z_$t1J`0-^*JrM{)+y^1VeP=E8wr(Wu&uM6RP1u-Xe7;9p@kprG7K{u2St&UU5NK(> zkU@y=OlXKN6%gXP2pW2Fp@QThq%t|TEhxn&F|?HYdH^6k6sHZxj|NhzIxV8w#o#9g ziJgr&EPlnG5SM>-kq`J3^e(!GhU7oXK#Jcl*APE$!i4-VlrF{DItt>4c(oL_nIVPG zlt*S2ew~vkKPn1~@dXq@$=8LIHPWrjU2?6Td(4#LwzIA!w`K_ODHJWmcVP*A(jyFw z27Ax1~=YvApu)M9Ll>93MO*+9=R{K$^3Irly(bv`ou z`AiidZWZc;+%Y7?Eks=m{sjgh{`G@PUxxC7^u&J84U2K7k`OmAb;`Edlm8KEUv6zu ziaVZKil0Iy^q+_o`89t+d=ydJhhO&t6f}0DuWKi|J)p$+;a@E#zu}6M%b-j{yv3(7 z6TLtuAjIdr zwPE?$20}Z~O*IscCM5I*s;0B#elQ_E*Q0guE7OFyq2)5XGRq~0e*c#kn(kX0kB8~d znZG$S;&D;8o){lm^|{CuGeh_Av^4ZGPa8tt@U%7L`vRxkp(38{4|T_>??)9>jXN$( zihd|-rs?IHzE9IfH9bnxuV{L!rr*}|(9jdq{%z=eoJtMzAmQ5O2vW(j9V1m UdwvVeo(P%W4sH2Le3AJ70D?4A@&Et; delta 32270 zcma)l33wF6)^=B>XOhV>Nq}_rWQGJt2>TKUvV?s{76CzJ-((LvvNSu0$ks|k@v?}@ zRX~)hh@yfD*In_7;*LA+xLw8df8VO=nMv^bzJH#ltLwby)TyddRj0eFs(bc-8TiYYLJ_Y;sENIo4? z5GTABK$ep{8B>rVynlk+j>B^*rXWLj1JEJ4|BfjL3d1)5lD~EX`-#|A-C->Ue9ufF zMBKIDG;;pR$*|{Nhy1Kg3He?W134x>G0QOCM}@4e5d7<}zd9s62c)7EknTXdPv;uO z#WtY!B2SOkm~9xZle`modb~c64Ph_qu9$)%kMCnBN&#e5c=K>#O{}|P3YvHV4MBcT z*RTz%=T0PtX8%5DHUi_os6`FEsWyT;E(4r_H)d^oUm z#Me~C9biuqUt1M_3D~d1*Hy*Md4|zs9^2vis*E;ZjK^WEuZm9xc02KnRq=lUJ4<|1 zRs3UMHRc1~Toum+)|2=a;&!CQg8|NrwRK>plmbDQ0_NsV2U{?~qwJJUVSS9h>s^WJ7 zv;RZJj;f6JfTdgq{PwDNKCo`Y|4|k14Qv+iomKD}9OKq*SXlLI*DXO_?hGAr1ru>2M?gG`d6jUeaf*ynr9aPM8xS*ICOcPTd-96iR4AZmH%EsBSLI{Ob7h#Om5TVCvhS0Ri5PGe42$3rN z1BiOfjLfbevU(A@h;d-}MCK3>*~(0`q~S?~Lox^EeAdk{;>?4&$sliT11LtoXL@Sn z1`t0?BmA>HayIfL@Gt<4_$h4!Mj(AJ%AVFfFXf<=PhADZTr%pv9!_Hf?gn}r(X&iW zh7u3_8;ny>jnHx<_b@I&zS%BLFnT{4m0eAb&l2Hkw{!!*OF z>o^64-VqjK#|rYj*CY0-bFQFp(%Xo6)1mP_Z~uIibuQeI_R+x}U`h75YV3cb*BHU8 z!QRf)pLrYoP3rr=dW-BYz0Uo0YbCsgcwz?VuO(ev6Y*}Ozw^3giq3o>STgw!&WVDW ziAHb&0Ga+L0i|}Lz!mPWkh4csDs07>ErNYZ;;B3U~8bmorZO@yi*X{>-4Fc?R^lj51pyN{zRt_Aup$F7%_{R(0~P-c`bs;=JV?5y|ION%c> zY$*=20tKp>sCs(vMj%f+U)Rg>{s*xnC$T82EWd?ew8CL7uAW;5po7U-;kKA-)2o0k zc19MZc^i})#z<#jQTCvl5j%y$+)`c7r$Ey>g0t1Pl><7`HqC)fBFCxLYM~84-*Y}I z3YNX!32wJDWOh~8TMl$SIlF!Ib5VM42YS{iFHS3q>4N(z9OfO>atKZVx|W=Ks_Wef z^fhN=aiRAk#PXaY#ran@>8kE^%ww)Cf?WW;6AuNC`LqM_&*1-qg_1OUZJrN zO$-1%K~#wa*8)7`G^(HFeFm|MPG7__;kvpwQ|o8j7n4yVbG#>EO%3gnGKFE3;xMOp z-0^i+8weS}?m$P7Q&F8W9_V6n=2hqLLEtuW7FFlm0rXfFS<9=lP6GYF36`YUUy+Y{ zdGm(qGKoOzkh8furxDN|JtzG{uCA#$i6^*;kd*1?V--@djyj19Xr+ILsG3uD{f&uL3%U zoEJUX)4F;e2YQyAmpr}TilcH|h-|jvFkklUkayVOvK#<SItp-z8$p;<5?W$IhWl)8AbD72k#g1Khk`UYcs#R73kk6&2EO+037Bg z)n!HkT}IBQ)j6Ai?kDH7>YO7$&yaJz8pp`z1D-H(C&Gvs6GKmOYa7)UU7AGvlr{o|NMH3XZJm@)9SDZJOOrQgN=aZ5Ky{OL$a$!7z`hIgDIDfo)W%|} z)Nwn}cCvu^7TBo0nQ$HasJt7SiOTXJ){HmZi~EDh^KAmUpPZEHoFhQrAt%Fhy(QB4 z=`Ozo9PjjLQtU1A;wj6yu1RtH6^PBjfeX0ZB-4Hy>ix{isJ#^EP2}`7^*9UO>O%co z$bXKu36{lbZ#5`7Q|37YoCP?{E30$X0X;>|LDQlkVUh=(u1%9On#QrAhMP4%1~>e` zQ8&$*+B7qrOmn2khlEDb{Pp?(>F4ZdnwcYcQ^4~mp1(OHjLx1CLne)vA5^S5g%_+Oo)YAj615W8K z3sl@2oQ34BH2VOFkq;~a61I^tM2Rc~`yfTunVb%Q2ue*6SE7I!nm5RLDz!%N1welg ze$*UwX$g1ZiX3Ndk1AmfuhF~Q63(}n|74Ya8CbH2drVF{=psVINSUD|rb0rNaBp-8 zqa+HLp?Q}qq0(vu9|I)s3?4UiFV~m+55PF>g=X{FaLvSnKK zABf40k>hoJ($~~#6x`=*YH8W|<1pHoeSxfp%JFAN;FmuE9!QwqdcqH!M*eol3iIdq z+Q;BrIICvXN}y9gxoV#Q`8}a57Yh9WvKH0XO<>7CkwY|;1*8el#*?GrmVo*ZZW)d8 zF`hH!W}67ACJcfL0B<3yJi)!QRyh=~m}X}r@aQ}XwmTb3t@Pc*yGG%`dw`s99xctX zpGWLH^1Ewo9yPrZss+bZOxM?g31!}jW9095uWWo~r=y9!vQ@Gt<3ScO(o!Wt-{+`F zl(-hq$!kgQm&I@f_EhAM<%&ce{`vT76fh$*6E+kw8K(tOq<%Fifwsb>RbFGaWM5hm zKOg&zU@2sDN%Vb{pVCI$WjUC0)m|YaU$S`L; zZZzFnFg`L~+7$w_UqyEXiKt8iUZk&j3szIgr`87}(iN1FKp%ivsxL4zwzv`xOabSV zv$&1AHLTISHj45zN5bKHYJx098@m7%)RsVz+$^h4&fbK){(vjQg3?!%o` zOp%hhf4ofRqufi_EQ;TwGdtGPi*>aN!VW52JC&nRQV%(Q#W{t2-u&J;$C=;7=C-sE z>jsYbTP%v|DImxEA(qYCpGEbPX#}qXyqK(?V)f-DWiZ*8Oadw&F#a3s&g5y%UT{t@ z&CjvgvASta0sVxWUt*m%+NRi-F+QhIPM{XbOIYC+OcD#DWH>VUjokg-qRv@3n~!^~ zcti}V20~%wBgFhOSw`V1LOERp=7!ZrgUMMYBlQFr zkw#&0872-Z0 zhxuCEGKxWqB}*3C0rUrQ-i`~S{%-;3=ggQohS3;@`F`AM^{b>D4s-)KA4aA8I> z3GkC-omYvjisbhi;94kxc_Av59FU<9;QnO&8O7qWkP#XScnevkKU_*9cn6RVoNwA^ zrL*p45_lfBUVj4l$jR@}!rQ$VHE^!%(Ac{ZBX^dw0WlwpI>R~MA;*3cHWKEs*zmMf z=7&UNe4!Np)Q|Q z8F8GaQ$1${yoYonY(3YF*zRNbM(Q(yg%HxW4ExYMkb_?~c3fph>nU*{*%#F}|BB7; zjB|$hN^FDcknR8&<~y{8(O{iRzf0O~;JEaAq?b0>rRl!r`vjKc9snTy#;4M6yy$1FQL4^xvk%-3Sw@$i7E z=5Ab5q$@cSb|sqg2sqM}yk4Di2Ap4cEqWu?eRS7p;$a2pvd)HG7CCvaX8~B!&%GJ; zb1G3mXJ=2Ry2Up_p==ah%-lwC+vFQn*sCFP+WD@N^6kNwrXUIZcb3q#s($lGrP{lP zFPT!8{|Gdqlk$@4c2Yu@dbIat)?tr^js|2fhKSSJcXIXNd1j{9Hd+9_oUHGCyo$06$7G3vLxCGrF5Eq1O3kVu1lI7i?LJ>hv|#0rnfoJq2$EIHivJD%5ef}Dev0iVzoW= zRhiW{6FDAIWZ8|-W+3veEs3ZSGxGOBZH8GMlRL2qV$9d<8^fz@?mW=E#W(wb#;Dog z(wBoy@f7TJ9_$({yC3KqILw|gZlTX8V|)xWg{9~fLp3b4<`e)O-~_r^^#{T)xSi)0 zB)hcp#I{3HI=Ft_tUixn1XS%RiIScADHxHiqS6Esp*xjw`2++bj6IIv0;4Nfb-|#<)%N^1xH(fwc^DSA!pv>AR?8wyeZtZfI#q`FN zv;b!;<4JKP{ScqexD{727V%L~XXeM{@WwdK*30G#z_`>HYk^j^g+%<6HUdvTY1MY$ zAmvj(1tVe$r6drK?368-nzo>H9Jce6fOE=up@(||bOgzT`Cm`u!D&5^i;n1-=G}wX zX(zj9roEQcs2f)}7iUp&7j)g!07%2Ql1CB0hw+wiC1(&n&UpK{k}nWH!+5v2l5L28 z#dzPi{LFH83QT4%!QDi44}D{MnjrXj2i+Vcq7+g>v=x4e8*%k;`zC!`&KbzKohyK3 zm)diwREA;mZBMID4~SPa-%80&odHI~d@4=A0jSJJ)ij@y4*Uy@Q_g^186%a4Ee9>k zR)OG#7Fc!0VfGBTH`6s`2BCX_K1a^w0V>ky8$gm<0=+7Nsz;n)9^li?GrjU`K6sVT zCCm*dJBZq)Amt>{f-p1)ki3t!T`05&(7%{)b(D7cCL?qb@V8{Gi?EC!-33RBc|*W; zVKv*^Y>d!lfaM&N6O|w|5U8Ak+8%`lCjs3`H9G?CHC@%W_B}vPlC#t0gkA+&o-sKLNBBn#z1CDv`W@ zHVT)++#-KJ!W6S8kh>ibUY^WG0ZU#3?gWrat&Ib`1{Caf7WT=h|HEaG?pKf8OLoD` z04lxq6Md{c-5_4I`^}N;)VW|px}QoD;B18IepJm~qof1RfpN+S_01Tfy5BFjV-sd$ zfB5O8_ERXW^kmKa`pF}B4p2oNirCWccFhJd^N_F9FpBx~c7=REXwcqCtrKz%^^Ntu z3CLtQvC0veMoE8EavGzPaIiBhRZ-H~l`Ra1_TK3c=_QP_K5WeBa6vBdD6S4WK6(p)nH;yfHsN}N%T=i^f-{?(?bSIYsM9`jc2whphJy1EIeP?)tSab#8jWlO zH-c9WI?a880NE-hInTxMQb1#w*RXhzxi4uWeIxH{jH30Sj`jJaI7!3OAIj@glwr$9 z8m(#B-y@dgMm#814lL9JhKRB(7rOsLSH7Zt8% z!mi4MUBH>`J9$U@w~ZEhS1681CBC;&ifvq zrB2g9X=U#qR;};6qRN+uI#e@+;)F`U`N**cS@smfs`V5l6JAm<3g4fF%H=qan)`8rWn^(Xnc1~Q8mi+}{zGX=MWkj`i@*7BQpBQZxUAw)>*Mu?+!}9M@-mzI zg-fS{hDCpJ=?u^ro<@IymKM&$CEdoPMbOhI9?B(_1V4uALZKw2-LwXbZ8`yB}5Y< zsGo&3LhAq@aGn^FUZW9W!pP*5KqhCi(mOflhZMzei?KI9J;liw+OQ}I%-B3%GOoRU zpwsxSPX7|8*tkq?2*?ZqZc>cE>r5NESp4ODF*L8v!W1}EH{jV{B#?qIFU*Bk$Jd1RxcQ9jyUfrbJ*Z;R%+2(rK8c7w+meDe0 zSA}q`m%xH;1WJD_#s-ldT4+fG>rxeKa~xNS3Ba~>K(a`o49Qpp#(mWor87~LJz&Uv zFN(eLUl>? zl0~~~dl|;9I7APOC*i-a5Z$KT&!gZ{Mgwe*ZlR1Bc}9n%j+iE!jBX=(Brwhks@Dr()Nsi5lyB}NxMZ)GI(T)*n+94c>5bQDL=7ev zec9Xlp-{popX0QoWt8^yk|kld!1%*&%*lwNSRY}_!5!)jkEEZ z44WyTPNejd`i%CS;3=o$5Whzorqet?cN6}=H9@DNAU`2=#)V`J{{+-Tbc)pQdjK-u z&a#H#3U`6mv4!_%m)(^$?8xM@K&vJoVw4Y=j+1&JN9>2uQWS2qe+>*DuD4=um4em; z)P?Z%ZmBvA0l9+EG8d8sy?qhxbDD@Yk&?~;B1?LiENQslZBbI;odfPpnyZ~`3MLmF zXu4wrjqz3f!i$iRz(zDuT;hNSPhgeh<9|~+8@tRfe_B)qh>Hvp09$h`7 zbWo%EdmzO|`7Rfilf&Gypop#q+ zy|IhrWAx6r8vpTh%K$YS!zDR|odj>C$)9h|m6+4)19(AhtG;j?Q@bEuOWvk*@6i`& zlRYA#HiS6laytXzZkOaZN{9kVBx4C1ZMpqw6u?iWe-olc$1gdK!yLm14u3xSjO3f8)7<5f+oWgP5Ap$8sFI$|2o}M-m*GgRBQC(gywy`po$($ zKKg>7^Hjb+)B&t3$R13Us)O-jp^O{48mtPkNBk{&Ay^y9o)}@%9Dcs6WQ1-RV8q}h zfYIZ!yq`kqtg~!fUgGG1kY5&>iPKr}2ik!mLl(%th`q57w%AOtA+E(i%NR9_=j74BA9{GK`QAS<-tmv z_A=Th<~{h-uz8H&KV8n?YRQ8~z&Yt`nur&P5aaH>#gf>3~z5C6n?JPr^XSi-HR!a5sQu1g;CN1hC0DJt@n(RmLtLb~|GCILX&$ zc^{OqMu?q|vA&2skJ!7;)N8ZiKV}R^a#N?`+M3R^$%&1BaiKPz^K_KqT1SR!Fn)+m z*2&{kOsM6}Chh!uZGN2+#M}z_j`PXnp!Xvgi=UG3{jZEQno{gd7)tKdQwrnr7z3VM-x)n6 z124xlae$vC}3iYQd_Y!R5GQLoZ1aChgPRg`m?`Roo zKdmsHV?rve<9s(QGcBq?-f%f>$VpHhEp-@GJPsATWbCVH#qnzygK+YahzceBw98p1 zIkNT)jG(~%hD@`SoD}*2KLfmt1kM;|@AP7C1!9|=R}tHZ*kfB~EDw#UNYz7e6mm&hi;)-gLwoJGafqOl(KV`N2Lo zjc|_7D2yM=7{Oxa+nHJ3xss7IGvB*L#+uH|kG~nQeH0l?k@$lyInFsMP#h>btt zLKT3r;{W54E1XdkS>BI8;^`JTlThNnoIpikd@*Cdlka5;Zx_k9sv_Te4Ppx%yCOe+ zHDfrE-*)ry?vl(GAohriU8u-UconhlDdvxLF3ikKFt5>cMyzAc%<~qKc1F+2Pw4D& zTE#k}D>4&CfwplZcabT*n@Kw_&MHi}&*hA!j`SoW_@ax=y~sqLWH-XLEN<%IrR{VfSq8YBk1~7?!5HGz$i$58BE8iy;DA~mfZ`nIRx|FId#7eJwXOW z?PcKXAh$rAhc7_>!CfGqBvjXhlx(;~4PR4SQ$M>Fb!*%6`3;5SPoDb%uSuKGl^^U-SE&ygaiSu*Q7m(E^+-^y21M4NP ze15KdguKgC`!d=ta0Vw2GD{lrE_zZ}p?@K*yoz>AwZQI1kx>ygg{6!U7yuS;2a?7y z4Mir)lBTW!_z)SB-E_`7^OL;C0e$IwGe6V*0WqVnEAE9wVLjXuie43C3}ZKrn*DiS zE=22kH8`c#Y$|!q*(fcvTd`Y>^Qcj6=j)--pSfAxg(UlTLFYj2qP>iEyv#{nY zQmvM`s+&pGsx_Ql3+jkO=hTAMH6QMa8;Lso*f^IzLsk7ha8eicwK?h45Q&A+`BCsn z&>_?_uLfzg^6FqGSbK1F@JA${Tn#K8j*-3{&yey-`8L!akI}^L(wJ>%@E}^^uq(Jr z3J&`X* z6uUyQIIRm{^1uZ7$R^ok|1S)X9(fNY&qgQlBe&(DME-M(NU$=mFo&@h)Wll8{MiMP#qH6^ARw+UM zwf`T2&5%ba1Z5R!QBmuSHnV(KDr)mubHf-8{?Bw;Qb^`zNX9ZSQbtu{grM;*Fp9$r zsn+P+6O8s@uo?3*GC9kbxw{AbW! zOMLEpzBor3RkFmOp^ebihx|y;<1CU5`P>ODX_CzTqM9~l%gn0^oKZ^(`$Pu1J*)&B z;FWj`)GMx$upFeep?@Qo-#!#%Oh6%T>$4cL79Cn3lUJ7Xyd;yNrG;awXVM=f``b*~ zFpn3JM_ZI%8CzGjE3EWA7$cHZ=7;oI44D8?&Op0%#-%kFOdYkH z4K@vSw_PN?%JEIeNMNvyAh&c1%%(Lz63*d4bX;*In?y+uMz2Mui0%xfu|4q_8KjmS zM2+<}#Kr*oiRq&m8{q_|PJv|u<6KU`GQ?WsvW2{IVycB~Ew7Lxu?b2vl)Dv?vX>tc_82sxC%}`?i1@L|K9hJVxnxurj7rA4K2lq-4fV$&#`i^rp(YbArpoUXlvxoGN_7559jvX4cT4@t zbPn7LaCS@C~Gmr`n$g6qSAc6VKrzmYthi~Af%N=<6TW~1~8 zO3_2e@nb5gGQnF#kK9dBO2L}b{$5ZyxlAD?%T}S5GB;U4qf1^dx5h=XYs_NT_+7~7 zpw5Fa``2y4-w5pVNP)8YxH)RUB)CzNH)sRCLE9%zcax;A!h#)~4`=J!kku5d%CJVV zg)#U~FvdIIuHb-)U#UEdWWmEsffF|10Ys;ZNQME}X=Rh#Y959~mY0&4EtBAHHm$tW z-;`sN{jDo7MlkpFDAv=d$O*rRHPl%Qd1xZ?MV5c9?D>CWIet~4@&x_aRg{a{oTRdJ zcCWGq-iHhpqAF@gsCsu9-p2)$?dP!~FUlDdqjMU%&As6iQo!hZ6^7e!1v>uKU2Jw1 zt2b8#`YeRAv---*W!a19+Tr*5B7Ms!s}UR3ebwUNk4$ZpZbi9E7U{lmlzqCj>WTcw zhhq1=gpJ+(4@-X8Zd6tcug}%+^4)VSK8J)9>3O~f5nY9-Z+`kBoV;W#aB=lr5dbDCx-llJlJ{K zuf6nQwQX&oUHxLU872GM9@>U^v_&5Ggk7q#Rq3~A<`H20O;hWIU#=G$Qf^B%Ie10o zZ=`>HS_+n3fVk`~YIU^ib-0zP%BAly%3`yl`cYM1UJO=~CDqeC9_=OBWo)CAl7s(m zNuz9&!2P`J>Vsuh{|PN_4OLD#fFeFXC70!>*WV)DUE4sul3Gf+Pow1WqJ6HiffOvu zfSy*LJA4RuMv<)d*p%Rf;gq>Wa{BK*2_9Frv0)kHX2YCLk2nG=wqM zbqGDyDukxB5uw-GfzW3iKp1O1hA_^07NOsI6=A&fHo^q!ON5EmZwQkt{|dNMD-&U| zRe&(XYK}0~YKyRj)eT`yYXHJp)>Sr6Y1Tx9mNgq;y0rpfhP44|n_7DjHnR>OY;HY-u!Z#m!j{$x2urQk z5w^14McCT<6k(Zl0bv{KSA>^YvAFoOwNenav+@zPx9TJ8V6{Ma+_2iMLjEW4eM^u} z;`(G}9I^%@Zdel$3Tr097;7OykF^@1X>CU6wQfb|v-Tj2wGJVSvmQq1x1K^6Z@q*t z!8(gD(Rv?Yl64+o!1@+pvh`ntDVDLC4HCB+`PVSIzqK9<(HS>;bLrse-ZQrGO@EQw z7h)}DYC2BjjsV@krBg)ijiBd|uH-f!k-Gwl&MpLf3+N(|yA!l=9q8?#n~2=ULFbab z6?AKSDYOyS{s%%!#&KUSC|ZsvX65GMl#-d`oq}@(;7smU65g54JsWcE1yGXl^n~d+ z6?rm_#70Ve6kC!|>a9o>GaEvWf<~#I1l zp8(xjmdNc0DQ7QXY(+C4*|$t{ba1C;5dNu(ZDkRE&y=tTkr~iivYH< zBQwcnpU54H-lmLa1G&YAzMF)C9!J;6INALOPH`E#Mec2gv|La&~w1+f1R90VhU~e~<>=#qeKzRFtWFfLH=OFaP{Ov@} zc(pQoV}MUU2gx|y{VJSBW!z!rehc|T_MpAk2Z+%c_Bne^TMpN-Q=tHcE1l3mHvxug zc=(bJr^DeXZA`j}$c;r#awL$(@NEtHDAV5wx*YmI%cdla(K`sVYNJE|SKRt<{@{CVJr0}1r_6--FG+a%%?4+a1PCB~mq@&ADI=bwnTjPTgzRojn zPYRP|94R@8Vs&(UTZ=FI5#{NhHB|PJTnw?SD`iuB0+<~tYZwdTy#P|S`*7CN@D)Mw ztTTCQU3(XX)v}C-qZ;EVsvg}Kq@(LYI=Vijqw7ODx;~_%>q8oCk%o*<&%+STcmzPX zm=r`LHwaXE3W6v_aWsumG>@iHiuRyoi%~uUo}~wXE9oW(j1sw%Kub?UdXmW998J#@ zF}an_W~Y|8+PTvS*#p4Lc+s~R>DMBfo1Z=tr`WiD%tH2L*zO>>E#VY0&U7!vX+g&G zzDQ?y0sCH~jYm4#c%-9^M>=f0-cU*)+Ipm;tw$Qx`yAzZoSyAP(B&f6KuM$>UIN_% z)^#@DRBIxwd5%&q14XfD%`mO48K$GHNqJf`7HZ|?iNH*eYemy@Fg~7x_8**to9o)I zgO#=1_Zxs05Y5Z;`QSB=BAUG-GXc?S??!x=ncXAeHhQpB-m$`YOH1^_s+< zn#}Hqo9iKyk=@2S8|NitVrLwZE&)k@p4~24rd{c(YVSO8bGD5ym-%)>dN^Em)+*nA zMEfBcw0%bq?SyE4Q{R(_HbgXgs_#WaYce`T?xZyk^))N`80bxiW~>sKpCg{Fc4B7! zgt+e!49fLnzF(4v+nEE5t`?c8h-W*)wk4LH22zxDjrZR;j{%xBLYDjmkh4jSlm(}^ zxXAH3iv7cDJGX5sAN~Yx^+RP-LYGY$j!!p++75y%HKvFLV^HHMqG5YbQ}-fpKZ5Um z?p_R;b`D8BGs_{!-!yK>^i+IXi1~7mtv_*ER@TeE02y(d-}v4NaJt;+dxHCXJzI9! z)4z8XRW=nrIR`37=JTOfK9!JD5%mPZXQhh2oRV8Qi-pdNTUvLNI%^6l&5m(*57&~r zhdo=4FKtOLDYC?!8O-I-(w5xmD6%!ZYiUcLbN-f+WacMljK)F7oNt`k+v`NIwF(=u zy*?&zmT#}ugVJ)|of_pcxTbb3HHJ4q2BT0)QJ^L}bv2GJt%!Q4x(6yNE;<*sm#GRY zk`=fRuE63*1=4PWt`(6AWRPANU4hBBMpdB9BP+1?)~E_xt+2DVmZAd5x3#MOzgFP) z5mr0+0gZD4QL~(4=1)$;+w01wUfJG5DG@Dzr5bAE z*Ga{F5luU#oU{J+!bnAbQP^YAST+hh=bOV9Zf`AGv+JoTtGj_3!;(g#ys&_HQ1+Q3 z6jgY(?6YMql3E41>)JV^c6Pud{H~q7F$w?GΜ}({xv_M$(MG(~Kz?Wy*|ys9o~q zs+)V?QPgp8g88Iz7^1*y6<>B!XCC; za+|i8qHVX&Zkga@-5F)ON00`#yW-9$JH4y0bp@a_nJtwheUrODz6MZ zbqnpXTXyAm?2;(hJ8#|_6yG?%-djIk7V`|tZY5#_ z`Y8I&QOvq|w!E^mPb;VM{@JMVk^QsAv$?g|jxUXjZyU*~Ht_MKvVkuo=mw5XC(Rv1 z5}3Qyma67Hz7!3=@c>=y(E~K``v+*^n1e-aWhp;kDfb|)@)IA1ud>pVpJ_`@@5L&7 z|5a;N;TKfl@PvZ}qO;Vnj2aFlL4&mOs#c3BbjViDcLkmAuvL?AFOO+yu{u)6{~(Dy z&w1g#_9$DzA$HA{hZ?k|MPyeQiPaA649_v?nrKh5E2?j0Lu`!laeiD}-lYvE47yfewE@=1(;|e$GpXoyV-DrkmpUP_N zrui+LW`G;b2&Wn3MuUg#Q=^haQ|H{7;lV+3MlZZ}`ouw#M$ei#^x8R-I!>QBck1X_ zy#_U&K4Z@KhVu^(em!xINT{q>Aa*+aeQ`%p7K$Ba>X~IM8Q#yhj%CDVmCDDKi0sUh zSD=%Cyb>eT#!cRB)G;}-8PtKl zo|U*qt|=N-rmYksL-PGMpsu~-TVJ4Et8b{hc_sQKx1liqi^yOwGB~I+=uvrkrMN8S zp-|=HOGH*vxu^%R2O-8^D{bu~dMs=ht!nIcrcmXuRd^aWQMqK5$nH8`x5b_bDm7oq zM+J<9V-(H*f~sB{z5qsqm(Yb^+(;sdc^Q$FVb%3ww02vDz~o@`Kj`?E^vFG z3HUo*`7GcV&sCLQtPyoZN@eO=F;eWStXPXinNzuXt;p}oHDgxv3mD?*i87h|w=U-5 znv&Zr*do=NT)vM8+%4Tk)!ZE_z3W85FuuV@Ezjek$sgZxA?@~H`EnZQ=TIm9_$nm% z|GZI>20x&{Tu-k=M_Yrty7darsa(EJ)NIMO0V(b}6E545{ubSbKkmF?#hx97CF0RU z@b?6jpRW=1Lh`*rkZ#HNh6a-k-Ao}ouUDpCFACDQE2a+qk{7sN9p(*#RGR0z@ zf-eD*cH5jU*^zczqHX2Z*NgONd{v*Y+soujf}mZORtttEzr$Dr_$J)Z%(7x_&vim_XBcE*Necx#I?L+Gq1)`b@!ZTF1!z<@?Hn z_(@xfsc_OmxGUl{mDF>iR6=fK)=(#;VnS~EEyNi=em#N^Kb4_%agL4J3pIR9|)JQ2#Wa)(b5EUW$JuArJ$CVgD zT=>&coaH8D_m~&f&u<73>)Rx(pYy+ju8UNOS2;pS9m5Ivu`xogm4x;4b6kXe#aU-5 zKMn-w=ZN}6i*Tz!F|L_tTXX)N5LeQ4#rduUp-J#YTABPS*31m+mw);Li2Levkr$>YDSmESE925K z6D~qR4RO_r5EsI9Q}Mf1gkqaSboG~zZSWNyosu7PpcvmS(2)F&FQ6MELnSauN%0*3 zE!9!?4lY`0h@Xj}uCArwEcvz`A->3`r4HMAsH}-JGQTZNF@DoPSNvn$BK%(f?czSx zrD%#4(NcT|g9)F4@74PG_ZNiZUsR~p<;*%EPPp^`ANac*xf6RPGF12pWkSASSU=Z^ z332gQ8anf-6vfN`CVs7@jJU( zimS*_kFStNt||jDn3?4}#bGhNUqUGLs<5&ax|O*IuJv;XnNnO;*0toy3n6YY(NcWX zmC$>=!q5a;r{sl>4|4;O^^&kiyAHk99+C-!T8Sd0sigt$JbQ}V0Sgno;( zFIO%JaY0i{jnWgYbUxlsKoePUoFP(t}^8+DAQ0E zZCMk&KqurEhA71aVr?ESmlNU&x`x(<6vS6sw633RvplFPk>xNS%4;zy(jalINx?gF(UDNY5y!O=NE>5`B&i0Il9{$tJk6G@itWt z$@7jX_s&*@7OBd3D6^ck?%}l7fPB?i8~oa8EfK17O_!>x<(JN?;CMu#HdEDoQNsY` zS5jmYXANyL41_n7SekJB_x9AePgeady4^$ehT67D?KZLi^CH7=Fv^?hxawm3O z%%gkM$QUGZ<{rA0Q#g)wvx=!|E^suv40hgZ zjOCNT?94H#n&r$5QsvBm(a8RRZf+y5ikddkB^m_XRXGGnR7AH5r$L3|{0*@+TtRGI zvu{2D=$ijKU?V(N0^SB}8i~E#0ADy(xc(KL+n9{ zP#hORXx6xkOjJa-hgZXKfeZ}N08b4Z9Oqz80oN%Ehe>+$uLVBC^k%%vAL0IIE!?K~ zPceUlHm3^iBx6H`ewzC}CSxEfKlQH(+vJ(lYL{>rxZ+@7ML{~PYzTCfrZ*zAC!w%F zUpYx1kmmxS7z<6Z(Be!I##v9Y(EY%i^(0679WV>K$o3^PSt=11+1^4}CF1IIB0zpE zH4i^=@3Yy+!#vo3v?t;UcRrKDiP#-XNyJCQU{6E~_3~E8vEYhjEP9$Z4MtMJ@JD3r zoW-rS1@>O9mb#B)$pp5|z;m=R>`Ux25vQ#%nV3`BZgbg0OT)fq7XsT{x=6oW%VDCl zQ`{w7R4rc!bv~=M&qIq>+XA_tM!Y2}m1ry3)3vzgmcC+haftSqJ@)UB4%?pclHDHr z0O1suyy^_!Zd!K3GCnsH=4JPQm)$pT9>oMb;AQm?xJO=|yF@KcbtZSxraeZ(&tcO} z(x$yY`9qnqYQ1SE+3CmmqA9snAp_BmNe-Q z#VIDTO(8T*4b41?rpq>QM!ZkM6F|lBc>pZJU_81 zmR`dsp;cg~^E2Ic8m{R4W+tWUBybPZ_)Q$BHwgPT0tXr6NZM?NZM3pl=P!$;^?4?k z>M+g!|3eDVw-j1Cstjz1t%F0+-3ot7yV{QYTe69$V?$8M0d6lGDC=j96>HF$=a~> zy6I)9v? zi4BWleo-lJuIdTBynV~NZ};yg?^ktXd*fR>HkG#y?%dRq=&osUCXUtZbiX`|Q;9Nr z%lcfx>m1laj#2o_j_MvXQW;3IUzgF2CE-h$7P7{zGlowe!j<%bK)EGx0>)%fF_*LKDwyj2LVmz=(2iYd7ugJA*&bu jLePZY5}%c#DMz9+y2j_$e=xli$ZUG8jVI1-i#YxRSyUAB delta 3639 zcmb7HTTB#J7@jk`+(B7bSP+Y#R5U4GB2lU+7(ftH7G#muU=@=JXp6>Bjn-yu+6N!1 zVLS1qYQ0B&@S)k5G(5CwZHsALjYrYv&_pJ}iD%EFQ zGVAltFV@Ys>C7mr)*sbYv1d_E(GrasGIf3owWigQP+;xz6yWTje_zS6XDf;jPNQVwV;v-MBWS^J?pJ@1p$CphnH6&b!+TgOnF7 zl`t)(e~V$zy#DCygfo-FU*U5UkJ_Qs+$4M;t*~>oMtS}P-i$}>PVqSMyf-nN+Ho}l z?=~Z0E2UJ$O{D!ds_9wineJZBDH=$NMX7tG!0sLX&Pi z1MD>Ucfu7Mc_HB)!uktge3xO|%)7)5?3#IxpDX!kWW0yEvt(bVl*8({%3)vUW?$!K z7jPThHT!z97hq;I`v$1Q zdY5%EuOKW!2Sw<#L z+2jhaUFnY0{bEZZv1s=UgV+LsN;FXL9ILP3{rzqr0X{HAxpG7P?d!?hjy1moD`cK8G&Dq5B(5h1~K2VACue zhEaqlaMJ~Zt{2@kUBFC)yG{{zP))$(hI#`y&_kRrm|M~oH*7{^H5JYY$F+GO7&~Cx z`2P=KV(uJjZMU8j76c_2%0!tz%TZP)${LA9S(zx=3#^sRjaBAAD%&*8R^}9j;=72@ z=hlicr?y#3nINRHE}lOY<<(#+y%J4^@r#{1fm0)T2dM8IPEC#Iz5h(V#;;~O`fEh* zL0~PWE>^z-oBeX|rLU0cVKmRHvOX&+)>G}YvK=x}C=PKN+YXr^q(e^97sFOnv3=Zh zi1cJXq-~@04w1f$SeC5D`-o-gJ4DMZU@iU4Sm_RI_KPFe%V-O7u)<`E+90isJo?4D zUR=0YCg15~dt#zcJmEC9J@I^Kbxxl>#S31uCG8(LAz39pMi|Uw$?CK~^wjhLrHZ2K zOTqy)-@3V^y{NUXb5~DqS8I3Y_HFGwecj7@yWV}fb9-a!+}^EyZ< zqfv@yfqg&XKFmIAZ7dfl;5Ify;{7|m4=-Ho42EuZkyj^p8~S0pqGPr)#s@7c$j$aC3c*`TR8CzRwBub9Jzxfbb%fB$g&3Bq>q6t zgNvO5*agO2>vrqSFn -Copyright (c) 2014 Douglas Christopher Wilson +Copyright (c) 2014-2015 Douglas Christopher Wilson Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the diff --git a/node_modules/body-parser/README.md b/node_modules/body-parser/README.md index 094a52e..8a7d6a8 100644 --- a/node_modules/body-parser/README.md +++ b/node_modules/body-parser/README.md @@ -8,12 +8,23 @@ Node.js body parsing middleware. -This does not handle multipart bodies, due to their complex and typically large nature. For multipart bodies, you may be interested in the following modules: +_This does not handle multipart bodies_, due to their complex and typically +large nature. For multipart bodies, you may be interested in the following +modules: -- [busboy](https://www.npmjs.org/package/busboy#readme) and [connect-busboy](https://www.npmjs.org/package/connect-busboy#readme) -- [multiparty](https://www.npmjs.org/package/multiparty#readme) and [connect-multiparty](https://www.npmjs.org/package/connect-multiparty#readme) -- [formidable](https://www.npmjs.org/package/formidable#readme) -- [multer](https://www.npmjs.org/package/multer#readme) + * [busboy](https://www.npmjs.org/package/busboy#readme) and + [connect-busboy](https://www.npmjs.org/package/connect-busboy#readme) + * [multiparty](https://www.npmjs.org/package/multiparty#readme) and + [connect-multiparty](https://www.npmjs.org/package/connect-multiparty#readme) + * [formidable](https://www.npmjs.org/package/formidable#readme) + * [multer](https://www.npmjs.org/package/multer#readme) + +This module provides the following parsers: + + * [JSON body parser](#bodyparserjsonoptions) + * [Raw body parser](#bodyparserrawoptions) + * [Text body parser](#bodyparsertextoptions) + * [URL-encoded form body parser](#bodyparserurlencodedoptions) Other body parsers you might be interested in: @@ -34,84 +45,218 @@ var bodyParser = require('body-parser') ### bodyParser.json(options) -Returns middleware that only parses `json`. This parser accepts any Unicode encoding of the body and supports automatic inflation of `gzip` and `deflate` encodings. +Returns middleware that only parses `json`. This parser accepts any Unicode +encoding of the body and supports automatic inflation of `gzip` and `deflate` +encodings. + +A new `body` object containing the parsed data is populated on the `request` +object after the middleware (i.e. `req.body`). + +#### Options + +The `json` function takes an option `options` object that may contain any of +the following keys: + +##### inflate + +When set to `true`, then deflated (compressed) bodies will be inflated; when +`false`, deflated bodies are rejected. Defaults to `true`. + +##### limit + +Controls the maximum request body size. If this is a number, then the value +specifies the number of bytes; if it is a string, the value is passed to the +[bytes](https://www.npmjs.com/package/bytes) library for parsing. Defaults +to `'100kb'`. -The options are: +##### reviver -- `strict` - only parse objects and arrays. (default: `true`) -- `inflate` - if deflated bodies will be inflated. (default: `true`) -- `limit` - maximum request body size. (default: `<100kb>`) -- `reviver` - passed to `JSON.parse()` -- `type` - request content-type to parse (default: `json`) -- `verify` - function to verify body content +The `reviver` option is passed directly to `JSON.parse` as the second +argument. You can find more information on this argument +[in the MDN documentation about JSON.parse](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/parse#Example.3A_Using_the_reviver_parameter). -The `type` argument is passed directly to the [type-is](https://www.npmjs.org/package/type-is#readme) library. This can be an extension name (like `json`), a mime type (like `application/json`), or a mime time with a wildcard (like `*/json`). +##### strict -The `verify` argument, if supplied, is called as `verify(req, res, buf, encoding)`, where `buf` is a `Buffer` of the raw request body and `encoding` is the encoding of the request. The parsing can be aborted by throwing an error. +When set to `true`, will only accept arrays and objects; when `false` will +accept anything `JSON.parse` accepts. Defaults to `true`. -The `reviver` argument is passed directly to `JSON.parse` as the second argument. You can find more information on this argument [in the MDN documentation about JSON.parse](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/parse#Example.3A_Using_the_reviver_parameter). +##### type + +The `type` option is used to determine what media type the middleware will +parse. This option can be a function or a string. If a string, `type` option +is passed directly to the [type-is](https://www.npmjs.org/package/type-is#readme) +library and this can be an extension name (like `json`), a mime type (like +`application/json`), or a mime time with a wildcard (like `*/*` or `*/json`). +If a function, the `type` option is called as `fn(req)` and the request is +parsed if it returns a truthy value. Defaults to `json`. + +##### verify + +The `verify` option, if supplied, is called as `verify(req, res, buf, encoding)`, +where `buf` is a `Buffer` of the raw request body and `encoding` is the +encoding of the request. The parsing can be aborted by throwing an error. ### bodyParser.raw(options) -Returns middleware that parses all bodies as a `Buffer`. This parser supports automatic inflation of `gzip` and `deflate` encodings. +Returns middleware that parses all bodies as a `Buffer`. This parser +supports automatic inflation of `gzip` and `deflate` encodings. + +A new `body` object containing the parsed data is populated on the `request` +object after the middleware (i.e. `req.body`). This will be a `Buffer` object +of the body. + +#### Options + +The `raw` function takes an option `options` object that may contain any of +the following keys: + +##### inflate + +When set to `true`, then deflated (compressed) bodies will be inflated; when +`false`, deflated bodies are rejected. Defaults to `true`. + +##### limit -The options are: +Controls the maximum request body size. If this is a number, then the value +specifies the number of bytes; if it is a string, the value is passed to the +[bytes](https://www.npmjs.com/package/bytes) library for parsing. Defaults +to `'100kb'`. -- `inflate` - if deflated bodies will be inflated. (default: `true`) -- `limit` - maximum request body size. (default: `<100kb>`) -- `type` - request content-type to parse (default: `application/octet-stream`) -- `verify` - function to verify body content +##### type -The `type` argument is passed directly to the [type-is](https://www.npmjs.org/package/type-is#readme) library. This can be an extension name (like `bin`), a mime type (like `application/octet-stream`), or a mime time with a wildcard (like `application/*`). +The `type` option is used to determine what media type the middleware will +parse. This option can be a function or a string. If a string, `type` option +is passed directly to the [type-is](https://www.npmjs.org/package/type-is#readme) +library and this can be an extension name (like `bin`), a mime type (like +`application/octet-stream`), or a mime time with a wildcard (like `*/*` or +`application/*`). If a function, the `type` option is called as `fn(req)` +and the request is parsed if it returns a truthy value. Defaults to +`application/octet-stream`. -The `verify` argument, if supplied, is called as `verify(req, res, buf, encoding)`, where `buf` is a `Buffer` of the raw request body and `encoding` is the encoding of the request. The parsing can be aborted by throwing an error. +##### verify + +The `verify` option, if supplied, is called as `verify(req, res, buf, encoding)`, +where `buf` is a `Buffer` of the raw request body and `encoding` is the +encoding of the request. The parsing can be aborted by throwing an error. ### bodyParser.text(options) -Returns middleware that parses all bodies as a string. This parser supports automatic inflation of `gzip` and `deflate` encodings. +Returns middleware that parses all bodies as a string. This parser supports +automatic inflation of `gzip` and `deflate` encodings. + +A new `body` string containing the parsed data is populated on the `request` +object after the middleware (i.e. `req.body`). This will be a string of the +body. + +#### Options + +The `text` function takes an option `options` object that may contain any of +the following keys: + +##### defaultCharset + +Specify the default character set for the text content if the charset is not +specified in the `Content-Type` header of the request. Defaults to `utf-8`. + +##### inflate + +When set to `true`, then deflated (compressed) bodies will be inflated; when +`false`, deflated bodies are rejected. Defaults to `true`. + +##### limit -The options are: +Controls the maximum request body size. If this is a number, then the value +specifies the number of bytes; if it is a string, the value is passed to the +[bytes](https://www.npmjs.com/package/bytes) library for parsing. Defaults +to `'100kb'`. -- `defaultCharset` - the default charset to parse as, if not specified in content-type. (default: `utf-8`) -- `inflate` - if deflated bodies will be inflated. (default: `true`) -- `limit` - maximum request body size. (default: `<100kb>`) -- `type` - request content-type to parse (default: `text/plain`) -- `verify` - function to verify body content +##### type -The `type` argument is passed directly to the [type-is](https://www.npmjs.org/package/type-is#readme) library. This can be an extension name (like `txt`), a mime type (like `text/plain`), or a mime time with a wildcard (like `text/*`). +The `type` option is used to determine what media type the middleware will +parse. This option can be a function or a string. If a string, `type` option +is passed directly to the [type-is](https://www.npmjs.org/package/type-is#readme) +library and this can be an extension name (like `txt`), a mime type (like +`text/plain`), or a mime time with a wildcard (like `*/*` or `text/*`). +If a function, the `type` option is called as `fn(req)` and the request is +parsed if it returns a truthy value. Defaults to `text/plain`. -The `verify` argument, if supplied, is called as `verify(req, res, buf, encoding)`, where `buf` is a `Buffer` of the raw request body and `encoding` is the encoding of the request. The parsing can be aborted by throwing an error. +##### verify + +The `verify` option, if supplied, is called as `verify(req, res, buf, encoding)`, +where `buf` is a `Buffer` of the raw request body and `encoding` is the +encoding of the request. The parsing can be aborted by throwing an error. ### bodyParser.urlencoded(options) -Returns middleware that only parses `urlencoded` bodies. This parser accepts only UTF-8 encoding of the body and supports automatic inflation of `gzip` and `deflate` encodings. +Returns middleware that only parses `urlencoded` bodies. This parser accepts +only UTF-8 encoding of the body and supports automatic inflation of `gzip` +and `deflate` encodings. + +A new `body` object containing the parsed data is populated on the `request` +object after the middleware (i.e. `req.body`). This object will contain +key-value pairs, where the value can be a string or array (when `extended` is +`false`), or any type (when `extended` is `true`). + +#### Options + +The `urlencoded` function takes an option `options` object that may contain +any of the following keys: + +##### extended + +The `extended` option allows to choose between parsing the URL-encoded data +with the `querystring` library (when `false`) or the `qs` library (when +`true`). The "extended" syntax allows for rich objects and arrays to be +encoded into the URL-encoded format, allowing for a JSON-like experience +with URL-encoded. For more information, please +[see the qs library](https://www.npmjs.org/package/qs#readme). + +Defaults to `true`, but using the default has been deprecated. Please +research into the difference between `qs` and `querystring` and choose the +appropriate setting. + +##### inflate + +When set to `true`, then deflated (compressed) bodies will be inflated; when +`false`, deflated bodies are rejected. Defaults to `true`. -The options are: +##### limit -- `extended` - parse extended syntax with the [qs](https://www.npmjs.org/package/qs#readme) module. (default: `true`) -- `inflate` - if deflated bodies will be inflated. (default: `true`) -- `limit` - maximum request body size. (default: `<100kb>`) -- `parameterLimit` - maximum number of parameters. (default: `1000`) -- `type` - request content-type to parse (default: `urlencoded`) -- `verify` - function to verify body content +Controls the maximum request body size. If this is a number, then the value +specifies the number of bytes; if it is a string, the value is passed to the +[bytes](https://www.npmjs.com/package/bytes) library for parsing. Defaults +to `'100kb'`. -The `extended` argument allows to choose between parsing the urlencoded data with the `querystring` library (when `false`) or the `qs` library (when `true`). The "extended" syntax allows for rich objects and arrays to be encoded into the urlencoded format, allowing for a JSON-like experience with urlencoded. For more information, please [see the qs library](https://www.npmjs.org/package/qs#readme). +##### parameterLimit -The `parameterLimit` argument controls the maximum number of parameters that are allowed in the urlencoded data. If a request contains more parameters than this value, a 415 will be returned to the client. +The `parameterLimit` option controls the maximum number of parameters that +are allowed in the URL-encoded data. If a request contains more parameters +than this value, a 413 will be returned to the client. Defaults to `1000`. -The `type` argument is passed directly to the [type-is](https://www.npmjs.org/package/type-is#readme) library. This can be an extension name (like `urlencoded`), a mime type (like `application/x-www-form-urlencoded`), or a mime time with a wildcard (like `*/x-www-form-urlencoded`). +##### type -The `verify` argument, if supplied, is called as `verify(req, res, buf, encoding)`, where `buf` is a `Buffer` of the raw request body and `encoding` is the encoding of the request. The parsing can be aborted by throwing an error. +The `type` option is used to determine what media type the middleware will +parse. This option can be a function or a string. If a string, `type` option +is passed directly to the [type-is](https://www.npmjs.org/package/type-is#readme) +library and this can be an extension name (like `urlencoded`), a mime type (like +`application/x-www-form-urlencoded`), or a mime time with a wildcard (like +`*/x-www-form-urlencoded`). If a function, the `type` option is called as +`fn(req)` and the request is parsed if it returns a truthy value. Defaults +to `urlencoded`. -### req.body +##### verify -A new `body` object containing the parsed data is populated on the `request` object after the middleware. +The `verify` option, if supplied, is called as `verify(req, res, buf, encoding)`, +where `buf` is a `Buffer` of the raw request body and `encoding` is the +encoding of the request. The parsing can be aborted by throwing an error. ## Examples ### express/connect top-level generic -This example demonstrates adding a generic JSON and urlencoded parser as a top-level middleware, which will parse the bodies of all incoming requests. This is the simplest setup. +This example demonstrates adding a generic JSON and URL-encoded parser as a +top-level middleware, which will parse the bodies of all incoming requests. +This is the simplest setup. ```js var express = require('express') @@ -134,7 +279,9 @@ app.use(function (req, res) { ### express route-specific -This example demonstrates adding body parsers specifically to the routes that need them. In general, this is the most recommend way to use body-parser with express. +This example demonstrates adding body parsers specifically to the routes that +need them. In general, this is the most recommend way to use body-parser with +express. ```js var express = require('express') @@ -151,7 +298,7 @@ var urlencodedParser = bodyParser.urlencoded({ extended: false }) // POST /login gets urlencoded bodies app.post('/login', urlencodedParser, function (req, res) { if (!req.body) return res.sendStatus(400) - res.send('welcome, ' + res.body.username) + res.send('welcome, ' + req.body.username) }) // POST /api/users gets JSON bodies @@ -163,7 +310,8 @@ app.post('/api/users', jsonParser, function (req, res) { ### change content-type for parsers -All the parsers accept a `type` option which allows you to change the `Content-Type` that the middleware will parse. +All the parsers accept a `type` option which allows you to change the +`Content-Type` that the middleware will parse. ```js // parse various different custom JSON types as JSON @@ -180,13 +328,13 @@ app.use(bodyParser.text({ type: 'text/html' })) [MIT](LICENSE) -[npm-image]: https://img.shields.io/npm/v/body-parser.svg?style=flat +[npm-image]: https://img.shields.io/npm/v/body-parser.svg [npm-url]: https://npmjs.org/package/body-parser -[travis-image]: https://img.shields.io/travis/expressjs/body-parser.svg?style=flat +[travis-image]: https://img.shields.io/travis/expressjs/body-parser/master.svg [travis-url]: https://travis-ci.org/expressjs/body-parser -[coveralls-image]: https://img.shields.io/coveralls/expressjs/body-parser.svg?style=flat +[coveralls-image]: https://img.shields.io/coveralls/expressjs/body-parser/master.svg [coveralls-url]: https://coveralls.io/r/expressjs/body-parser?branch=master -[downloads-image]: https://img.shields.io/npm/dm/body-parser.svg?style=flat +[downloads-image]: https://img.shields.io/npm/dm/body-parser.svg [downloads-url]: https://npmjs.org/package/body-parser -[gratipay-image]: https://img.shields.io/gratipay/dougwilson.svg?style=flat +[gratipay-image]: https://img.shields.io/gratipay/dougwilson.svg [gratipay-url]: https://www.gratipay.com/dougwilson/ diff --git a/node_modules/body-parser/index.js b/node_modules/body-parser/index.js index 7c87204..a47ef89 100644 --- a/node_modules/body-parser/index.js +++ b/node_modules/body-parser/index.js @@ -12,8 +12,18 @@ var deprecate = require('depd')('body-parser') var fs = require('fs') var path = require('path') +/** + * @typedef Parsers + * @type {function} + * @property {function} json + * @property {function} raw + * @property {function} text + * @property {function} urlencoded + */ + /** * Module exports. + * @type {Parsers} */ exports = module.exports = deprecate.function(bodyParser, diff --git a/node_modules/body-parser/lib/read.js b/node_modules/body-parser/lib/read.js index 0880a3d..6423203 100644 --- a/node_modules/body-parser/lib/read.js +++ b/node_modules/body-parser/lib/read.js @@ -1,6 +1,6 @@ /*! * body-parser - * Copyright(c) 2014 Douglas Christopher Wilson + * Copyright(c) 2014-2015 Douglas Christopher Wilson * MIT Licensed */ @@ -11,7 +11,6 @@ var getBody = require('raw-body') var iconv = require('iconv-lite') var onFinished = require('on-finished') -var typer = require('media-typer') var zlib = require('zlib') /** @@ -27,39 +26,42 @@ module.exports = read * @param {object} res * @param {function} next * @param {function} parse - * @param {object} options + * @param {function} debug + * @param {object} [options] * @api private */ -function read(req, res, next, parse, options) { +function read(req, res, next, parse, debug, options) { var length var stream // flag as parsed req._body = true + var opts = options || {} + try { - stream = contentstream(req, options.inflate) + stream = contentstream(req, debug, opts.inflate) length = stream.length delete stream.length } catch (err) { return next(err) } - options = options || {} - options.length = length + opts.length = length - var encoding = options.encoding !== null - ? options.encoding || 'utf-8' + var encoding = opts.encoding !== null + ? opts.encoding || 'utf-8' : null - var verify = options.verify + var verify = opts.verify - options.encoding = verify + opts.encoding = verify ? null : encoding // read body - getBody(stream, options, function (err, body) { + debug('read body') + getBody(stream, opts, function (err, body) { if (err) { if (!err.status) { err.status = 400 @@ -83,6 +85,7 @@ function read(req, res, next, parse, options) { // verify if (verify) { try { + debug('verify body') verify(req, res, body, encoding) } catch (err) { if (!err.status) err.status = 403 @@ -92,6 +95,7 @@ function read(req, res, next, parse, options) { // parse try { + debug('parse body') body = typeof body !== 'string' && encoding !== null ? iconv.decode(body, encoding) : body @@ -112,17 +116,20 @@ function read(req, res, next, parse, options) { * Get the content stream of the request. * * @param {object} req + * @param {function} debug * @param {boolean} [inflate=true] * @return {object} * @api private */ -function contentstream(req, inflate) { +function contentstream(req, debug, inflate) { var encoding = (req.headers['content-encoding'] || 'identity').toLowerCase() var err var length = req.headers['content-length'] var stream + debug('content-encoding "%s"', encoding) + if (inflate === false && encoding !== 'identity') { err = new Error('content encoding unsupported') err.status = 415 @@ -132,10 +139,12 @@ function contentstream(req, inflate) { switch (encoding) { case 'deflate': stream = zlib.createInflate() + debug('inflate body') req.pipe(stream) break case 'gzip': stream = zlib.createGunzip() + debug('gunzip body') req.pipe(stream) break case 'identity': diff --git a/node_modules/body-parser/lib/types/json.js b/node_modules/body-parser/lib/types/json.js index d5b22af..f6ccbc3 100644 --- a/node_modules/body-parser/lib/types/json.js +++ b/node_modules/body-parser/lib/types/json.js @@ -1,7 +1,7 @@ /*! * body-parser * Copyright(c) 2014 Jonathan Ong - * Copyright(c) 2014 Douglas Christopher Wilson + * Copyright(c) 2014-2015 Douglas Christopher Wilson * MIT Licensed */ @@ -10,8 +10,9 @@ */ var bytes = require('bytes') +var contentType = require('content-type') +var debug = require('debug')('body-parser:json') var read = require('../read') -var typer = require('media-typer') var typeis = require('type-is') /** @@ -22,9 +23,17 @@ module.exports = json /** * RegExp to match the first non-space in a string. + * + * Allowed whitespace is defined in RFC 7159: + * + * ws = *( + * %x20 / ; Space + * %x09 / ; Horizontal tab + * %x0A / ; Line feed or New line + * %x0D ) ; Carriage return */ -var firstcharRegExp = /^\s*(.)/ +var firstcharRegExp = /^[\x20\x09\x0a\x0d]*(.)/ /** * Create a middleware to parse JSON bodies. @@ -50,6 +59,11 @@ function json(options) { throw new TypeError('option verify must be function') } + // create the appropriate type checking function + var shouldParse = typeof type !== 'function' + ? typeChecker(type) + : type + function parse(body) { if (body.length === 0) { // special-case empty json body, as it's a common client-side mistake @@ -61,31 +75,45 @@ function json(options) { var first = firstchar(body) if (first !== '{' && first !== '[') { + debug('strict violation') throw new Error('invalid json') } } + debug('parse json') return JSON.parse(body, reviver) } return function jsonParser(req, res, next) { - if (req._body) return next() + if (req._body) { + return debug('body already parsed'), next() + } + req.body = req.body || {} - if (!typeis(req, type)) return next() + // skip requests without bodies + if (!typeis.hasBody(req)) { + return debug('skip empty body'), next() + } + + debug('content-type %s', JSON.stringify(req.headers['content-type'])) + + // determine if request should be parsed + if (!shouldParse(req)) { + return debug('skip parsing'), next() + } - // RFC 7159 sec 8.1 - var charset = (typer.parse(req).parameters.charset || 'utf-8').toLowerCase() + // assert charset per RFC 7159 sec 8.1 + var charset = getCharset(req) || 'utf-8' if (charset.substr(0, 4) !== 'utf-') { var err = new Error('unsupported charset "' + charset.toUpperCase() + '"') err.charset = charset err.status = 415 - next(err) - return + return debug('invalid charset'), next(err) } // read - read(req, res, next, parse, { + read(req, res, next, parse, debug, { encoding: charset, inflate: inflate, limit: limit, @@ -107,3 +135,31 @@ function firstchar(str) { var match = firstcharRegExp.exec(str) return match ? match[1] : '' } + +/** + * Get the charset of a request. + * + * @param {object} req + * @api private + */ + +function getCharset(req) { + try { + return contentType.parse(req).parameters.charset.toLowerCase() + } catch (e) { + return undefined + } +} + +/** + * Get the simple type checker. + * + * @param {string} type + * @return {function} + */ + +function typeChecker(type) { + return function checkType(req) { + return Boolean(typeis(req, type)) + } +} diff --git a/node_modules/body-parser/lib/types/raw.js b/node_modules/body-parser/lib/types/raw.js index 9d7e49a..4f3f544 100644 --- a/node_modules/body-parser/lib/types/raw.js +++ b/node_modules/body-parser/lib/types/raw.js @@ -1,6 +1,6 @@ /*! * body-parser - * Copyright(c) 2014 Douglas Christopher Wilson + * Copyright(c) 2014-2015 Douglas Christopher Wilson * MIT Licensed */ @@ -9,6 +9,7 @@ */ var bytes = require('bytes') +var debug = require('debug')('body-parser:raw') var read = require('../read') var typeis = require('type-is') @@ -40,18 +41,36 @@ function raw(options) { throw new TypeError('option verify must be function') } + // create the appropriate type checking function + var shouldParse = typeof type !== 'function' + ? typeChecker(type) + : type + function parse(buf) { return buf } return function rawParser(req, res, next) { - if (req._body) return next() + if (req._body) { + return debug('body already parsed'), next() + } + req.body = req.body || {} - if (!typeis(req, type)) return next() + // skip requests without bodies + if (!typeis.hasBody(req)) { + return debug('skip empty body'), next() + } + + debug('content-type %s', JSON.stringify(req.headers['content-type'])) + + // determine if request should be parsed + if (!shouldParse(req)) { + return debug('skip parsing'), next() + } // read - read(req, res, next, parse, { + read(req, res, next, parse, debug, { encoding: null, inflate: inflate, limit: limit, @@ -59,3 +78,16 @@ function raw(options) { }) } } + +/** + * Get the simple type checker. + * + * @param {string} type + * @return {function} + */ + +function typeChecker(type) { + return function checkType(req) { + return Boolean(typeis(req, type)) + } +} diff --git a/node_modules/body-parser/lib/types/text.js b/node_modules/body-parser/lib/types/text.js index 2330b5b..c4c725c 100644 --- a/node_modules/body-parser/lib/types/text.js +++ b/node_modules/body-parser/lib/types/text.js @@ -1,6 +1,6 @@ /*! * body-parser - * Copyright(c) 2014 Douglas Christopher Wilson + * Copyright(c) 2014-2015 Douglas Christopher Wilson * MIT Licensed */ @@ -9,9 +9,10 @@ */ var bytes = require('bytes') +var contentType = require('content-type') +var debug = require('debug')('body-parser:text') var read = require('../read') var typeis = require('type-is') -var typer = require('media-typer') /** * Module exports. @@ -42,21 +43,39 @@ function text(options) { throw new TypeError('option verify must be function') } + // create the appropriate type checking function + var shouldParse = typeof type !== 'function' + ? typeChecker(type) + : type + function parse(buf) { return buf } return function textParser(req, res, next) { - if (req._body) return next() + if (req._body) { + return debug('body already parsed'), next() + } + req.body = req.body || {} - if (!typeis(req, type)) return next() + // skip requests without bodies + if (!typeis.hasBody(req)) { + return debug('skip empty body'), next() + } + + debug('content-type %s', JSON.stringify(req.headers['content-type'])) + + // determine if request should be parsed + if (!shouldParse(req)) { + return debug('skip parsing'), next() + } // get charset - var charset = typer.parse(req).parameters.charset || defaultCharset + var charset = getCharset(req) || defaultCharset // read - read(req, res, next, parse, { + read(req, res, next, parse, debug, { encoding: charset, inflate: inflate, limit: limit, @@ -64,3 +83,31 @@ function text(options) { }) } } + +/** + * Get the charset of a request. + * + * @param {object} req + * @api private + */ + +function getCharset(req) { + try { + return contentType.parse(req).parameters.charset.toLowerCase() + } catch (e) { + return undefined + } +} + +/** + * Get the simple type checker. + * + * @param {string} type + * @return {function} + */ + +function typeChecker(type) { + return function checkType(req) { + return Boolean(typeis(req, type)) + } +} diff --git a/node_modules/body-parser/lib/types/urlencoded.js b/node_modules/body-parser/lib/types/urlencoded.js index 83eb6c3..d1cd4d8 100644 --- a/node_modules/body-parser/lib/types/urlencoded.js +++ b/node_modules/body-parser/lib/types/urlencoded.js @@ -1,7 +1,7 @@ /*! * body-parser * Copyright(c) 2014 Jonathan Ong - * Copyright(c) 2014 Douglas Christopher Wilson + * Copyright(c) 2014-2015 Douglas Christopher Wilson * MIT Licensed */ @@ -10,9 +10,10 @@ */ var bytes = require('bytes') +var contentType = require('content-type') +var debug = require('debug')('body-parser:urlencoded') var deprecate = require('depd')('body-parser') var read = require('../read') -var typer = require('media-typer') var typeis = require('type-is') /** @@ -55,10 +56,16 @@ function urlencoded(options){ throw new TypeError('option verify must be function') } + // create the appropriate query parser var queryparse = extended ? extendedparser(options) : simpleparser(options) + // create the appropriate type checking function + var shouldParse = typeof type !== 'function' + ? typeChecker(type) + : type + function parse(body) { return body.length ? queryparse(body) @@ -66,22 +73,36 @@ function urlencoded(options){ } return function urlencodedParser(req, res, next) { - if (req._body) return next(); + if (req._body) { + return debug('body already parsed'), next() + } + req.body = req.body || {} - if (!typeis(req, type)) return next(); + // skip requests without bodies + if (!typeis.hasBody(req)) { + return debug('skip empty body'), next() + } + + debug('content-type %s', JSON.stringify(req.headers['content-type'])) + + // determine if request should be parsed + if (!shouldParse(req)) { + return debug('skip parsing'), next() + } - var charset = (typer.parse(req).parameters.charset || 'utf-8').toLowerCase() + // assert charset + var charset = getCharset(req) || 'utf-8' if (charset !== 'utf-8') { var err = new Error('unsupported charset "' + charset.toUpperCase() + '"') err.charset = charset err.status = 415 - next(err) - return + return debug('invalid charset'), next(err) } // read - read(req, res, next, parse, { + read(req, res, next, parse, debug, { + debug: debug, encoding: charset, inflate: inflate, limit: limit, @@ -110,35 +131,51 @@ function extendedparser(options) { parameterLimit = parameterLimit | 0 } - var opts = { - arrayLimit: 100, - parameterLimit: parameterLimit - } - return function queryparse(body) { - if (overlimit(body, parameterLimit)) { + var paramCount = parameterCount(body, parameterLimit) + + if (paramCount === undefined) { var err = new Error('too many parameters') err.status = 413 + debug('too many parameters') throw err } - return parse(body, opts) + var arrayLimit = Math.max(100, paramCount) + + debug('parse extended urlencoding') + return parse(body, { + arrayLimit: arrayLimit, + depth: Infinity, + parameterLimit: parameterLimit + }) } } /** - * Determine if the parameter count is over the limit. + * Get the charset of a request. * - * @param {string} body - * @param {number} limit + * @param {object} req * @api private */ -function overlimit(body, limit) { - if (limit === Infinity) { - return false +function getCharset(req) { + try { + return contentType.parse(req).parameters.charset.toLowerCase() + } catch (e) { + return undefined } +} +/** + * Count the number of parameters, stopping once limit reached + * + * @param {string} body + * @param {number} limit + * @api private + */ + +function parameterCount(body, limit) { var count = 0 var index = 0 @@ -147,11 +184,11 @@ function overlimit(body, limit) { index++ if (count === limit) { - return true + return undefined } } - return false + return count } /** @@ -196,12 +233,29 @@ function simpleparser(options) { } return function queryparse(body) { - if (overlimit(body, parameterLimit)) { + var paramCount = parameterCount(body, parameterLimit) + + if (paramCount === undefined) { var err = new Error('too many parameters') err.status = 413 + debug('too many parameters') throw err } + debug('parse urlencoding') return parse(body, undefined, undefined, {maxKeys: parameterLimit}) } } + +/** + * Get the simple type checker. + * + * @param {string} type + * @return {function} + */ + +function typeChecker(type) { + return function checkType(req) { + return Boolean(typeis(req, type)) + } +} diff --git a/node_modules/body-parser/node_modules/content-type/HISTORY.md b/node_modules/body-parser/node_modules/content-type/HISTORY.md new file mode 100644 index 0000000..8a623a2 --- /dev/null +++ b/node_modules/body-parser/node_modules/content-type/HISTORY.md @@ -0,0 +1,9 @@ +1.0.1 / 2015-02-13 +================== + + * Improve missing `Content-Type` header error message + +1.0.0 / 2015-02-01 +================== + + * Initial implementation, derived from `media-typer@0.3.0` diff --git a/node_modules/body-parser/node_modules/content-type/LICENSE b/node_modules/body-parser/node_modules/content-type/LICENSE new file mode 100644 index 0000000..34b1a2d --- /dev/null +++ b/node_modules/body-parser/node_modules/content-type/LICENSE @@ -0,0 +1,22 @@ +(The MIT License) + +Copyright (c) 2015 Douglas Christopher Wilson + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +'Software'), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/body-parser/node_modules/content-type/README.md b/node_modules/body-parser/node_modules/content-type/README.md new file mode 100644 index 0000000..3ed6741 --- /dev/null +++ b/node_modules/body-parser/node_modules/content-type/README.md @@ -0,0 +1,92 @@ +# content-type + +[![NPM Version][npm-image]][npm-url] +[![NPM Downloads][downloads-image]][downloads-url] +[![Node.js Version][node-version-image]][node-version-url] +[![Build Status][travis-image]][travis-url] +[![Test Coverage][coveralls-image]][coveralls-url] + +Create and parse HTTP Content-Type header according to RFC 7231 + +## Installation + +```sh +$ npm install content-type +``` + +## API + +```js +var contentType = require('content-type') +``` + +### contentType.parse(string) + +```js +var obj = contentType.parse('image/svg+xml; charset=utf-8') +``` + +Parse a content type string. This will return an object with the following +properties (examples are shown for the string `'image/svg+xml; charset=utf-8'`): + + - `type`: The media type (the type and subtype, always lower case). + Example: `'image/svg+xml'` + + - `parameters`: An object of the parameters in the media type (name of parameter + always lower case). Example: `{charset: 'utf-8'}` + +Throws a `TypeError` if the string is missing or invalid. + +### contentType.parse(req) + +```js +var obj = contentType.parse(req) +``` + +Parse the `content-type` header from the given `req`. Short-cut for +`contentType.parse(req.headers['content-type'])`. + +Throws a `TypeError` if the `Content-Type` header is missing or invalid. + +### contentType.parse(res) + +```js +var obj = contentType.parse(res) +``` + +Parse the `content-type` header set on the given `res`. Short-cut for +`contentType.parse(res.getHeader('content-type'))`. + +Throws a `TypeError` if the `Content-Type` header is missing or invalid. + +### contentType.format(obj) + +```js +var str = contentType.format({type: 'image/svg+xml'}) +``` + +Format an object into a content type string. This will return a string of the +content type for the given object with the following properties (examples are +shown that produce the string `'image/svg+xml; charset=utf-8'`): + + - `type`: The media type (will be lower-cased). Example: `'image/svg+xml'` + + - `parameters`: An object of the parameters in the media type (name of the + parameter will be lower-cased). Example: `{charset: 'utf-8'}` + +Throws a `TypeError` if the object contains an invalid type or parameter names. + +## License + +[MIT](LICENSE) + +[npm-image]: https://img.shields.io/npm/v/content-type.svg +[npm-url]: https://npmjs.org/package/content-type +[node-version-image]: https://img.shields.io/node/v/content-type.svg +[node-version-url]: http://nodejs.org/download/ +[travis-image]: https://img.shields.io/travis/jshttp/content-type/master.svg +[travis-url]: https://travis-ci.org/jshttp/content-type +[coveralls-image]: https://img.shields.io/coveralls/jshttp/content-type/master.svg +[coveralls-url]: https://coveralls.io/r/jshttp/content-type +[downloads-image]: https://img.shields.io/npm/dm/content-type.svg +[downloads-url]: https://npmjs.org/package/content-type diff --git a/node_modules/body-parser/node_modules/content-type/index.js b/node_modules/body-parser/node_modules/content-type/index.js new file mode 100644 index 0000000..6a2ea9f --- /dev/null +++ b/node_modules/body-parser/node_modules/content-type/index.js @@ -0,0 +1,214 @@ +/*! + * content-type + * Copyright(c) 2015 Douglas Christopher Wilson + * MIT Licensed + */ + +/** + * RegExp to match *( ";" parameter ) in RFC 7231 sec 3.1.1.1 + * + * parameter = token "=" ( token / quoted-string ) + * token = 1*tchar + * tchar = "!" / "#" / "$" / "%" / "&" / "'" / "*" + * / "+" / "-" / "." / "^" / "_" / "`" / "|" / "~" + * / DIGIT / ALPHA + * ; any VCHAR, except delimiters + * quoted-string = DQUOTE *( qdtext / quoted-pair ) DQUOTE + * qdtext = HTAB / SP / %x21 / %x23-5B / %x5D-7E / obs-text + * obs-text = %x80-FF + * quoted-pair = "\" ( HTAB / SP / VCHAR / obs-text ) + */ +var paramRegExp = /; *([!#$%&'\*\+\-\.\^_`\|~0-9A-Za-z]+) *= *("(?:[\u000b\u0020\u0021\u0023-\u005b\u005d-\u007e\u0080-\u00ff]|\\[\u000b\u0020-\u00ff])*"|[!#$%&'\*\+\-\.\^_`\|~0-9A-Za-z]+) */g +var textRegExp = /^[\u000b\u0020-\u007e\u0080-\u00ff]+$/ +var tokenRegExp = /^[!#$%&'\*\+\-\.\^_`\|~0-9A-Za-z]+$/ + +/** + * RegExp to match quoted-pair in RFC 7230 sec 3.2.6 + * + * quoted-pair = "\" ( HTAB / SP / VCHAR / obs-text ) + * obs-text = %x80-FF + */ +var qescRegExp = /\\([\u000b\u0020-\u00ff])/g + +/** + * RegExp to match chars that must be quoted-pair in RFC 7230 sec 3.2.6 + */ +var quoteRegExp = /([\\"])/g + +/** + * RegExp to match type in RFC 6838 + * + * media-type = type "/" subtype + * type = token + * subtype = token + */ +var typeRegExp = /^[!#$%&'\*\+\-\.\^_`\|~0-9A-Za-z]+\/[!#$%&'\*\+\-\.\^_`\|~0-9A-Za-z]+$/ + +/** + * Module exports. + * @public + */ + +exports.format = format +exports.parse = parse + +/** + * Format object to media type. + * + * @param {object} obj + * @return {string} + * @public + */ + +function format(obj) { + if (!obj || typeof obj !== 'object') { + throw new TypeError('argument obj is required') + } + + var parameters = obj.parameters + var type = obj.type + + if (!type || !typeRegExp.test(type)) { + throw new TypeError('invalid type') + } + + var string = type + + // append parameters + if (parameters && typeof parameters === 'object') { + var param + var params = Object.keys(parameters).sort() + + for (var i = 0; i < params.length; i++) { + param = params[i] + + if (!tokenRegExp.test(param)) { + throw new TypeError('invalid parameter name') + } + + string += '; ' + param + '=' + qstring(parameters[param]) + } + } + + return string +} + +/** + * Parse media type to object. + * + * @param {string|object} string + * @return {Object} + * @public + */ + +function parse(string) { + if (!string) { + throw new TypeError('argument string is required') + } + + if (typeof string === 'object') { + // support req/res-like objects as argument + string = getcontenttype(string) + + if (typeof string !== 'string') { + throw new TypeError('content-type header is missing from object'); + } + } + + if (typeof string !== 'string') { + throw new TypeError('argument string is required to be a string') + } + + var index = string.indexOf(';') + var type = index !== -1 + ? string.substr(0, index).trim() + : string.trim() + + if (!typeRegExp.test(type)) { + throw new TypeError('invalid media type') + } + + var key + var match + var obj = new ContentType(type.toLowerCase()) + var value + + paramRegExp.lastIndex = index + + while (match = paramRegExp.exec(string)) { + if (match.index !== index) { + throw new TypeError('invalid parameter format') + } + + index += match[0].length + key = match[1].toLowerCase() + value = match[2] + + if (value[0] === '"') { + // remove quotes and escapes + value = value + .substr(1, value.length - 2) + .replace(qescRegExp, '$1') + } + + obj.parameters[key] = value + } + + if (index !== -1 && index !== string.length) { + throw new TypeError('invalid parameter format') + } + + return obj +} + +/** + * Get content-type from req/res objects. + * + * @param {object} + * @return {Object} + * @private + */ + +function getcontenttype(obj) { + if (typeof obj.getHeader === 'function') { + // res-like + return obj.getHeader('content-type') + } + + if (typeof obj.headers === 'object') { + // req-like + return obj.headers && obj.headers['content-type'] + } +} + +/** + * Quote a string if necessary. + * + * @param {string} val + * @return {string} + * @private + */ + +function qstring(val) { + var str = String(val) + + // no need to quote tokens + if (tokenRegExp.test(str)) { + return str + } + + if (str.length > 0 && !textRegExp.test(str)) { + throw new TypeError('invalid parameter value') + } + + return '"' + str.replace(quoteRegExp, '\\$1') + '"' +} + +/** + * Class to represent a content type. + * @private + */ +function ContentType(type) { + this.parameters = Object.create(null) + this.type = type +} diff --git a/node_modules/body-parser/node_modules/content-type/package.json b/node_modules/body-parser/node_modules/content-type/package.json new file mode 100644 index 0000000..dedcfe4 --- /dev/null +++ b/node_modules/body-parser/node_modules/content-type/package.json @@ -0,0 +1,64 @@ +{ + "name": "content-type", + "description": "Create and parse HTTP Content-Type header", + "version": "1.0.1", + "author": { + "name": "Douglas Christopher Wilson", + "email": "doug@somethingdoug.com" + }, + "license": "MIT", + "keywords": [ + "content-type", + "http", + "req", + "res", + "rfc7231" + ], + "repository": { + "type": "git", + "url": "https://github.com/jshttp/content-type" + }, + "devDependencies": { + "istanbul": "0.3.5", + "mocha": "~1.21.5" + }, + "files": [ + "LICENSE", + "HISTORY.md", + "README.md", + "index.js" + ], + "engines": { + "node": ">= 0.6" + }, + "scripts": { + "test": "mocha --reporter spec --check-leaks --bail test/", + "test-ci": "istanbul cover node_modules/mocha/bin/_mocha --report lcovonly -- --reporter spec --check-leaks test/", + "test-cov": "istanbul cover node_modules/mocha/bin/_mocha -- --reporter dot --check-leaks test/" + }, + "gitHead": "3aa58f9c5a358a3634b8601602177888b4a477d8", + "bugs": { + "url": "https://github.com/jshttp/content-type/issues" + }, + "homepage": "https://github.com/jshttp/content-type", + "_id": "content-type@1.0.1", + "_shasum": "a19d2247327dc038050ce622b7a154ec59c5e600", + "_from": "content-type@~1.0.1", + "_npmVersion": "1.4.28", + "_npmUser": { + "name": "dougwilson", + "email": "doug@somethingdoug.com" + }, + "maintainers": [ + { + "name": "dougwilson", + "email": "doug@somethingdoug.com" + } + ], + "dist": { + "shasum": "a19d2247327dc038050ce622b7a154ec59c5e600", + "tarball": "http://registry.npmjs.org/content-type/-/content-type-1.0.1.tgz" + }, + "directories": {}, + "_resolved": "https://registry.npmjs.org/content-type/-/content-type-1.0.1.tgz" +} diff --git a/node_modules/body-parser/node_modules/debug/.jshintrc b/node_modules/body-parser/node_modules/debug/.jshintrc new file mode 100644 index 0000000..299877f --- /dev/null +++ b/node_modules/body-parser/node_modules/debug/.jshintrc @@ -0,0 +1,3 @@ +{ + "laxbreak": true +} diff --git a/node_modules/body-parser/node_modules/debug/.npmignore b/node_modules/body-parser/node_modules/debug/.npmignore new file mode 100644 index 0000000..7e6163d --- /dev/null +++ b/node_modules/body-parser/node_modules/debug/.npmignore @@ -0,0 +1,6 @@ +support +test +examples +example +*.sock +dist diff --git a/node_modules/body-parser/node_modules/debug/History.md b/node_modules/body-parser/node_modules/debug/History.md new file mode 100644 index 0000000..76999e4 --- /dev/null +++ b/node_modules/body-parser/node_modules/debug/History.md @@ -0,0 +1,177 @@ + +2.1.2 / 2015-03-01 +================== + + * dist: recompile + * update "ms" to v0.7.0 + * package: update "browserify" to v9.0.3 + * component: fix "ms.js" repo location + * changed bower package name + * updated documentation about using debug in a browser + * fix: security error on safari (#167, #168, @yields) + +2.1.1 / 2014-12-29 +================== + + * browser: use `typeof` to check for `console` existence + * browser: check for `console.log` truthiness (fix IE 8/9) + * browser: add support for Chrome apps + * Readme: added Windows usage remarks + * Add `bower.json` to properly support bower install + +2.1.0 / 2014-10-15 +================== + + * node: implement `DEBUG_FD` env variable support + * package: update "browserify" to v6.1.0 + * package: add "license" field to package.json (#135, @panuhorsmalahti) + +2.0.0 / 2014-09-01 +================== + + * package: update "browserify" to v5.11.0 + * node: use stderr rather than stdout for logging (#29, @stephenmathieson) + +1.0.4 / 2014-07-15 +================== + + * dist: recompile + * example: remove `console.info()` log usage + * example: add "Content-Type" UTF-8 header to browser example + * browser: place %c marker after the space character + * browser: reset the "content" color via `color: inherit` + * browser: add colors support for Firefox >= v31 + * debug: prefer an instance `log()` function over the global one (#119) + * Readme: update documentation about styled console logs for FF v31 (#116, @wryk) + +1.0.3 / 2014-07-09 +================== + + * Add support for multiple wildcards in namespaces (#122, @seegno) + * browser: fix lint + +1.0.2 / 2014-06-10 +================== + + * browser: update color palette (#113, @gscottolson) + * common: make console logging function configurable (#108, @timoxley) + * node: fix %o colors on old node <= 0.8.x + * Makefile: find node path using shell/which (#109, @timoxley) + +1.0.1 / 2014-06-06 +================== + + * browser: use `removeItem()` to clear localStorage + * browser, node: don't set DEBUG if namespaces is undefined (#107, @leedm777) + * package: add "contributors" section + * node: fix comment typo + * README: list authors + +1.0.0 / 2014-06-04 +================== + + * make ms diff be global, not be scope + * debug: ignore empty strings in enable() + * node: make DEBUG_COLORS able to disable coloring + * *: export the `colors` array + * npmignore: don't publish the `dist` dir + * Makefile: refactor to use browserify + * package: add "browserify" as a dev dependency + * Readme: add Web Inspector Colors section + * node: reset terminal color for the debug content + * node: map "%o" to `util.inspect()` + * browser: map "%j" to `JSON.stringify()` + * debug: add custom "formatters" + * debug: use "ms" module for humanizing the diff + * Readme: add "bash" syntax highlighting + * browser: add Firebug color support + * browser: add colors for WebKit browsers + * node: apply log to `console` + * rewrite: abstract common logic for Node & browsers + * add .jshintrc file + +0.8.1 / 2014-04-14 +================== + + * package: re-add the "component" section + +0.8.0 / 2014-03-30 +================== + + * add `enable()` method for nodejs. Closes #27 + * change from stderr to stdout + * remove unnecessary index.js file + +0.7.4 / 2013-11-13 +================== + + * remove "browserify" key from package.json (fixes something in browserify) + +0.7.3 / 2013-10-30 +================== + + * fix: catch localStorage security error when cookies are blocked (Chrome) + * add debug(err) support. Closes #46 + * add .browser prop to package.json. Closes #42 + +0.7.2 / 2013-02-06 +================== + + * fix package.json + * fix: Mobile Safari (private mode) is broken with debug + * fix: Use unicode to send escape character to shell instead of octal to work with strict mode javascript + +0.7.1 / 2013-02-05 +================== + + * add repository URL to package.json + * add DEBUG_COLORED to force colored output + * add browserify support + * fix component. Closes #24 + +0.7.0 / 2012-05-04 +================== + + * Added .component to package.json + * Added debug.component.js build + +0.6.0 / 2012-03-16 +================== + + * Added support for "-" prefix in DEBUG [Vinay Pulim] + * Added `.enabled` flag to the node version [TooTallNate] + +0.5.0 / 2012-02-02 +================== + + * Added: humanize diffs. Closes #8 + * Added `debug.disable()` to the CS variant + * Removed padding. Closes #10 + * Fixed: persist client-side variant again. Closes #9 + +0.4.0 / 2012-02-01 +================== + + * Added browser variant support for older browsers [TooTallNate] + * Added `debug.enable('project:*')` to browser variant [TooTallNate] + * Added padding to diff (moved it to the right) + +0.3.0 / 2012-01-26 +================== + + * Added millisecond diff when isatty, otherwise UTC string + +0.2.0 / 2012-01-22 +================== + + * Added wildcard support + +0.1.0 / 2011-12-02 +================== + + * Added: remove colors unless stderr isatty [TooTallNate] + +0.0.1 / 2010-01-03 +================== + + * Initial release diff --git a/node_modules/body-parser/node_modules/debug/Makefile b/node_modules/body-parser/node_modules/debug/Makefile new file mode 100644 index 0000000..b0bde6e --- /dev/null +++ b/node_modules/body-parser/node_modules/debug/Makefile @@ -0,0 +1,33 @@ + +# get Makefile directory name: http://stackoverflow.com/a/5982798/376773 +THIS_MAKEFILE_PATH:=$(word $(words $(MAKEFILE_LIST)),$(MAKEFILE_LIST)) +THIS_DIR:=$(shell cd $(dir $(THIS_MAKEFILE_PATH));pwd) + +# BIN directory +BIN := $(THIS_DIR)/node_modules/.bin + +# applications +NODE ?= $(shell which node) +NPM ?= $(NODE) $(shell which npm) +BROWSERIFY ?= $(NODE) $(BIN)/browserify + +all: dist/debug.js + +install: node_modules + +clean: + @rm -rf node_modules dist + +dist: + @mkdir -p $@ + +dist/debug.js: node_modules browser.js debug.js dist + @$(BROWSERIFY) \ + --standalone debug \ + . > $@ + +node_modules: package.json + @NODE_ENV= $(NPM) install + @touch node_modules + +.PHONY: all install clean diff --git a/node_modules/body-parser/node_modules/debug/Readme.md b/node_modules/body-parser/node_modules/debug/Readme.md new file mode 100644 index 0000000..40e4b4a --- /dev/null +++ b/node_modules/body-parser/node_modules/debug/Readme.md @@ -0,0 +1,178 @@ +# debug + + tiny node.js debugging utility modelled after node core's debugging technique. + +## Installation + +```bash +$ npm install debug +``` + +## Usage + + With `debug` you simply invoke the exported function to generate your debug function, passing it a name which will determine if a noop function is returned, or a decorated `console.error`, so all of the `console` format string goodies you're used to work fine. A unique color is selected per-function for visibility. + +Example _app.js_: + +```js +var debug = require('debug')('http') + , http = require('http') + , name = 'My App'; + +// fake app + +debug('booting %s', name); + +http.createServer(function(req, res){ + debug(req.method + ' ' + req.url); + res.end('hello\n'); +}).listen(3000, function(){ + debug('listening'); +}); + +// fake worker of some kind + +require('./worker'); +``` + +Example _worker.js_: + +```js +var debug = require('debug')('worker'); + +setInterval(function(){ + debug('doing some work'); +}, 1000); +``` + + The __DEBUG__ environment variable is then used to enable these based on space or comma-delimited names. Here are some examples: + + ![debug http and worker](http://f.cl.ly/items/18471z1H402O24072r1J/Screenshot.png) + + ![debug worker](http://f.cl.ly/items/1X413v1a3M0d3C2c1E0i/Screenshot.png) + +#### Windows note + + On Windows the environment variable is set using the `set` command. + + ```cmd + set DEBUG=*,-not_this + ``` + +Then, run the program to be debugged as ususal. + +## Millisecond diff + + When actively developing an application it can be useful to see when the time spent between one `debug()` call and the next. Suppose for example you invoke `debug()` before requesting a resource, and after as well, the "+NNNms" will show you how much time was spent between calls. + + ![](http://f.cl.ly/items/2i3h1d3t121M2Z1A3Q0N/Screenshot.png) + + When stdout is not a TTY, `Date#toUTCString()` is used, making it more useful for logging the debug information as shown below: + + ![](http://f.cl.ly/items/112H3i0e0o0P0a2Q2r11/Screenshot.png) + +## Conventions + + If you're using this in one or more of your libraries, you _should_ use the name of your library so that developers may toggle debugging as desired without guessing names. If you have more than one debuggers you _should_ prefix them with your library name and use ":" to separate features. For example "bodyParser" from Connect would then be "connect:bodyParser". + +## Wildcards + + The `*` character may be used as a wildcard. Suppose for example your library has debuggers named "connect:bodyParser", "connect:compress", "connect:session", instead of listing all three with `DEBUG=connect:bodyParser,connect.compress,connect:session`, you may simply do `DEBUG=connect:*`, or to run everything using this module simply use `DEBUG=*`. + + You can also exclude specific debuggers by prefixing them with a "-" character. For example, `DEBUG=*,-connect:*` would include all debuggers except those starting with "connect:". + +## Browser support + + Debug works in the browser as well, currently persisted by `localStorage`. 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: + +```js +window.myDebug = require("debug"); +``` + + ("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: + +```js +myDebug.enable("worker:*") +``` + + Refresh the page. Debug output will continue to be sent to the console until it is disabled by typing `myDebug.disable()` in the console. + +```js +a = debug('worker:a'); +b = debug('worker:b'); + +setInterval(function(){ + a('doing some work'); +}, 1000); + +setInterval(function(){ + b('doing some work'); +}, 1200); +``` + +#### Web Inspector Colors + + Colors are also enabled on "Web Inspectors" that understand the `%c` formatting + option. These are WebKit web inspectors, Firefox ([since version + 31](https://hacks.mozilla.org/2014/05/editable-box-model-multiple-selection-sublime-text-keys-much-more-firefox-developer-tools-episode-31/)) + and the Firebug plugin for Firefox (any version). + + Colored output looks something like: + + ![](https://cloud.githubusercontent.com/assets/71256/3139768/b98c5fd8-e8ef-11e3-862a-f7253b6f47c6.png) + +### stderr vs stdout + +You can set an alternative logging method per-namespace by overriding the `log` method on a per-namespace or globally: + +Example _stderr.js_: + +```js +var debug = require('../'); +var log = debug('app:log'); + +// by default console.log is used +log('goes to stdout!'); + +var error = debug('app:error'); +// set this namespace to log via console.error +error.log = console.error.bind(console); // don't forget to bind to console! +error('goes to stderr'); +log('still goes to stdout!'); + +// set all output to go via console.warn +// overrides all per-namespace log settings +debug.log = console.warn.bind(console); +log('now goes to stderr via console.warn'); +error('still goes to stderr, but via console.warn now'); +``` + +## Authors + + - TJ Holowaychuk + - Nathan Rajlich + +## License + +(The MIT License) + +Copyright (c) 2014 TJ Holowaychuk <tj@vision-media.ca> + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +'Software'), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/body-parser/node_modules/debug/bower.json b/node_modules/body-parser/node_modules/debug/bower.json new file mode 100644 index 0000000..37d8333 --- /dev/null +++ b/node_modules/body-parser/node_modules/debug/bower.json @@ -0,0 +1,28 @@ +{ + "name": "visionmedia-debug", + "main": "dist/debug.js", + "version": "2.1.2", + "homepage": "https://github.com/visionmedia/debug", + "authors": [ + "TJ Holowaychuk " + ], + "description": "visionmedia-debug", + "moduleType": [ + "amd", + "es6", + "globals", + "node" + ], + "keywords": [ + "visionmedia", + "debug" + ], + "license": "MIT", + "ignore": [ + "**/.*", + "node_modules", + "bower_components", + "test", + "tests" + ] +} diff --git a/node_modules/body-parser/node_modules/debug/browser.js b/node_modules/body-parser/node_modules/debug/browser.js new file mode 100644 index 0000000..55f4cf9 --- /dev/null +++ b/node_modules/body-parser/node_modules/debug/browser.js @@ -0,0 +1,175 @@ + +/** + * This is the web browser implementation of `debug()`. + * + * Expose `debug()` as the module. + */ + +exports = module.exports = require('./debug'); +exports.log = log; +exports.formatArgs = formatArgs; +exports.save = save; +exports.load = load; +exports.useColors = useColors; + +/** + * Use chrome.storage.local if we are in an app + */ + +var storage; + +if (typeof chrome !== 'undefined' && typeof chrome.storage !== 'undefined') + storage = chrome.storage.local; +else + storage = localstorage(); + +/** + * Colors. + */ + +exports.colors = [ + 'lightseagreen', + 'forestgreen', + 'goldenrod', + 'dodgerblue', + 'darkorchid', + 'crimson' +]; + +/** + * Currently only WebKit-based Web Inspectors, Firefox >= v31, + * and the Firebug extension (any Firefox version) are known + * to support "%c" CSS customizations. + * + * TODO: add a `localStorage` variable to explicitly enable/disable colors + */ + +function useColors() { + // is webkit? http://stackoverflow.com/a/16459606/376773 + return ('WebkitAppearance' in document.documentElement.style) || + // is firebug? http://stackoverflow.com/a/398120/376773 + (window.console && (console.firebug || (console.exception && console.table))) || + // is firefox >= v31? + // https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages + (navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/) && parseInt(RegExp.$1, 10) >= 31); +} + +/** + * Map %j to `JSON.stringify()`, since no Web Inspectors do that by default. + */ + +exports.formatters.j = function(v) { + return JSON.stringify(v); +}; + + +/** + * Colorize log arguments if enabled. + * + * @api public + */ + +function formatArgs() { + var args = arguments; + var useColors = this.useColors; + + args[0] = (useColors ? '%c' : '') + + this.namespace + + (useColors ? ' %c' : ' ') + + args[0] + + (useColors ? '%c ' : ' ') + + '+' + exports.humanize(this.diff); + + if (!useColors) return args; + + var c = 'color: ' + this.color; + args = [args[0], c, 'color: inherit'].concat(Array.prototype.slice.call(args, 1)); + + // the final "%c" is somewhat tricky, because there could be other + // arguments passed either before or after the %c, so we need to + // figure out the correct index to insert the CSS into + var index = 0; + var lastC = 0; + args[0].replace(/%[a-z%]/g, function(match) { + if ('%%' === match) return; + index++; + if ('%c' === match) { + // we only are interested in the *last* %c + // (the user may have provided their own) + lastC = index; + } + }); + + args.splice(lastC, 0, c); + return args; +} + +/** + * Invokes `console.log()` when available. + * No-op when `console.log` is not a "function". + * + * @api public + */ + +function log() { + // this hackery is required for IE8/9, where + // the `console.log` function doesn't have 'apply' + return 'object' === typeof console + && console.log + && Function.prototype.apply.call(console.log, console, arguments); +} + +/** + * Save `namespaces`. + * + * @param {String} namespaces + * @api private + */ + +function save(namespaces) { + try { + if (null == namespaces) { + storage.removeItem('debug'); + } else { + storage.debug = namespaces; + } + } catch(e) {} +} + +/** + * Load `namespaces`. + * + * @return {String} returns the previously persisted debug modes + * @api private + */ + +function load() { + var r; + try { + r = storage.debug; + } catch(e) {} + return r; +} + +/** + * Enable namespaces listed in `localStorage.debug` initially. + */ + +exports.enable(load()); + +/** + * Localstorage attempts to return the localstorage. + * + * This is necessary because safari throws + * when a user disables cookies/localstorage + * and you attempt to access it. + * + * @return {LocalStorage} + * @api private + */ + +function localstorage(){ + try { + return window.localStorage; + } catch (e) {} +} diff --git a/node_modules/body-parser/node_modules/debug/component.json b/node_modules/body-parser/node_modules/debug/component.json new file mode 100644 index 0000000..2d7b906 --- /dev/null +++ b/node_modules/body-parser/node_modules/debug/component.json @@ -0,0 +1,19 @@ +{ + "name": "debug", + "repo": "visionmedia/debug", + "description": "small debugging utility", + "version": "2.1.2", + "keywords": [ + "debug", + "log", + "debugger" + ], + "main": "browser.js", + "scripts": [ + "browser.js", + "debug.js" + ], + "dependencies": { + "rauchg/ms.js": "0.7.0" + } +} diff --git a/node_modules/body-parser/node_modules/debug/debug.js b/node_modules/body-parser/node_modules/debug/debug.js new file mode 100644 index 0000000..7571a86 --- /dev/null +++ b/node_modules/body-parser/node_modules/debug/debug.js @@ -0,0 +1,197 @@ + +/** + * This is the common logic for both the Node.js and web browser + * implementations of `debug()`. + * + * Expose `debug()` as the module. + */ + +exports = module.exports = debug; +exports.coerce = coerce; +exports.disable = disable; +exports.enable = enable; +exports.enabled = enabled; +exports.humanize = require('ms'); + +/** + * The currently active debug mode names, and names to skip. + */ + +exports.names = []; +exports.skips = []; + +/** + * Map of special "%n" handling functions, for the debug "format" argument. + * + * Valid key names are a single, lowercased letter, i.e. "n". + */ + +exports.formatters = {}; + +/** + * Previously assigned color. + */ + +var prevColor = 0; + +/** + * Previous log timestamp. + */ + +var prevTime; + +/** + * Select a color. + * + * @return {Number} + * @api private + */ + +function selectColor() { + return exports.colors[prevColor++ % exports.colors.length]; +} + +/** + * Create a debugger with the given `namespace`. + * + * @param {String} namespace + * @return {Function} + * @api public + */ + +function debug(namespace) { + + // define the `disabled` version + function disabled() { + } + disabled.enabled = false; + + // define the `enabled` version + function enabled() { + + var self = enabled; + + // set `diff` timestamp + var curr = +new Date(); + var ms = curr - (prevTime || curr); + self.diff = ms; + self.prev = prevTime; + self.curr = curr; + prevTime = curr; + + // add the `color` if not set + if (null == self.useColors) self.useColors = exports.useColors(); + if (null == self.color && self.useColors) self.color = selectColor(); + + var args = Array.prototype.slice.call(arguments); + + args[0] = exports.coerce(args[0]); + + if ('string' !== typeof args[0]) { + // anything else let's inspect with %o + args = ['%o'].concat(args); + } + + // apply any `formatters` transformations + var index = 0; + args[0] = args[0].replace(/%([a-z%])/g, function(match, format) { + // if we encounter an escaped % then don't increase the array index + if (match === '%%') return match; + index++; + var formatter = exports.formatters[format]; + if ('function' === typeof formatter) { + var val = args[index]; + match = formatter.call(self, val); + + // now we need to remove `args[index]` since it's inlined in the `format` + args.splice(index, 1); + index--; + } + return match; + }); + + if ('function' === typeof exports.formatArgs) { + args = exports.formatArgs.apply(self, args); + } + var logFn = enabled.log || exports.log || console.log.bind(console); + logFn.apply(self, args); + } + enabled.enabled = true; + + var fn = exports.enabled(namespace) ? enabled : disabled; + + fn.namespace = namespace; + + return fn; +} + +/** + * Enables a debug mode by namespaces. This can include modes + * separated by a colon and wildcards. + * + * @param {String} namespaces + * @api public + */ + +function enable(namespaces) { + exports.save(namespaces); + + var split = (namespaces || '').split(/[\s,]+/); + var len = split.length; + + for (var i = 0; i < len; i++) { + if (!split[i]) continue; // ignore empty strings + namespaces = split[i].replace(/\*/g, '.*?'); + if (namespaces[0] === '-') { + exports.skips.push(new RegExp('^' + namespaces.substr(1) + '$')); + } else { + exports.names.push(new RegExp('^' + namespaces + '$')); + } + } +} + +/** + * Disable debug output. + * + * @api public + */ + +function disable() { + exports.enable(''); +} + +/** + * Returns true if the given mode name is enabled, false otherwise. + * + * @param {String} name + * @return {Boolean} + * @api public + */ + +function enabled(name) { + var i, len; + for (i = 0, len = exports.skips.length; i < len; i++) { + if (exports.skips[i].test(name)) { + return false; + } + } + for (i = 0, len = exports.names.length; i < len; i++) { + if (exports.names[i].test(name)) { + return true; + } + } + return false; +} + +/** + * Coerce `val`. + * + * @param {Mixed} val + * @return {Mixed} + * @api private + */ + +function coerce(val) { + if (val instanceof Error) return val.stack || val.message; + return val; +} diff --git a/node_modules/body-parser/node_modules/debug/node.js b/node_modules/body-parser/node_modules/debug/node.js new file mode 100644 index 0000000..5dc999f --- /dev/null +++ b/node_modules/body-parser/node_modules/debug/node.js @@ -0,0 +1,209 @@ + +/** + * Module dependencies. + */ + +var tty = require('tty'); +var util = require('util'); + +/** + * This is the Node.js implementation of `debug()`. + * + * Expose `debug()` as the module. + */ + +exports = module.exports = require('./debug'); +exports.log = log; +exports.formatArgs = formatArgs; +exports.save = save; +exports.load = load; +exports.useColors = useColors; + +/** + * Colors. + */ + +exports.colors = [6, 2, 3, 4, 5, 1]; + +/** + * The file descriptor to write the `debug()` calls to. + * Set the `DEBUG_FD` env variable to override with another value. i.e.: + * + * $ DEBUG_FD=3 node script.js 3>debug.log + */ + +var fd = parseInt(process.env.DEBUG_FD, 10) || 2; +var stream = 1 === fd ? process.stdout : + 2 === fd ? process.stderr : + createWritableStdioStream(fd); + +/** + * Is stdout a TTY? Colored output is enabled when `true`. + */ + +function useColors() { + var debugColors = (process.env.DEBUG_COLORS || '').trim().toLowerCase(); + if (0 === debugColors.length) { + return tty.isatty(fd); + } else { + return '0' !== debugColors + && 'no' !== debugColors + && 'false' !== debugColors + && 'disabled' !== debugColors; + } +} + +/** + * Map %o to `util.inspect()`, since Node doesn't do that out of the box. + */ + +var inspect = (4 === util.inspect.length ? + // node <= 0.8.x + function (v, colors) { + return util.inspect(v, void 0, void 0, colors); + } : + // node > 0.8.x + function (v, colors) { + return util.inspect(v, { colors: colors }); + } +); + +exports.formatters.o = function(v) { + return inspect(v, this.useColors) + .replace(/\s*\n\s*/g, ' '); +}; + +/** + * Adds ANSI color escape codes if enabled. + * + * @api public + */ + +function formatArgs() { + var args = arguments; + var useColors = this.useColors; + var name = this.namespace; + + if (useColors) { + var c = this.color; + + args[0] = ' \u001b[9' + c + 'm' + name + ' ' + + '\u001b[0m' + + args[0] + '\u001b[3' + c + 'm' + + ' +' + exports.humanize(this.diff) + '\u001b[0m'; + } else { + args[0] = new Date().toUTCString() + + ' ' + name + ' ' + args[0]; + } + return args; +} + +/** + * Invokes `console.error()` with the specified arguments. + */ + +function log() { + return stream.write(util.format.apply(this, arguments) + '\n'); +} + +/** + * Save `namespaces`. + * + * @param {String} namespaces + * @api private + */ + +function save(namespaces) { + if (null == namespaces) { + // If you set a process.env field to null or undefined, it gets cast to the + // string 'null' or 'undefined'. Just delete instead. + delete process.env.DEBUG; + } else { + process.env.DEBUG = namespaces; + } +} + +/** + * Load `namespaces`. + * + * @return {String} returns the previously persisted debug modes + * @api private + */ + +function load() { + return process.env.DEBUG; +} + +/** + * Copied from `node/src/node.js`. + * + * XXX: It's lame that node doesn't expose this API out-of-the-box. It also + * relies on the undocumented `tty_wrap.guessHandleType()` which is also lame. + */ + +function createWritableStdioStream (fd) { + var stream; + var tty_wrap = process.binding('tty_wrap'); + + // Note stream._type is used for test-module-load-list.js + + switch (tty_wrap.guessHandleType(fd)) { + case 'TTY': + stream = new tty.WriteStream(fd); + stream._type = 'tty'; + + // Hack to have stream not keep the event loop alive. + // See https://github.com/joyent/node/issues/1726 + if (stream._handle && stream._handle.unref) { + stream._handle.unref(); + } + break; + + case 'FILE': + var fs = require('fs'); + stream = new fs.SyncWriteStream(fd, { autoClose: false }); + stream._type = 'fs'; + break; + + case 'PIPE': + case 'TCP': + var net = require('net'); + stream = new net.Socket({ + fd: fd, + readable: false, + writable: true + }); + + // FIXME Should probably have an option in net.Socket to create a + // stream from an existing fd which is writable only. But for now + // we'll just add this hack and set the `readable` member to false. + // Test: ./node test/fixtures/echo.js < /etc/passwd + stream.readable = false; + stream.read = null; + stream._type = 'pipe'; + + // FIXME Hack to have stream not keep the event loop alive. + // See https://github.com/joyent/node/issues/1726 + if (stream._handle && stream._handle.unref) { + stream._handle.unref(); + } + break; + + default: + // Probably an error on in uv_guess_handle() + throw new Error('Implement me. Unknown stream file type!'); + } + + // For supporting legacy API we put the FD here. + stream.fd = fd; + + stream._isStdio = true; + + return stream; +} + +/** + * Enable namespaces listed in `process.env.DEBUG` initially. + */ + +exports.enable(load()); diff --git a/node_modules/body-parser/node_modules/debug/node_modules/ms/.npmignore b/node_modules/body-parser/node_modules/debug/node_modules/ms/.npmignore new file mode 100644 index 0000000..d1aa0ce --- /dev/null +++ b/node_modules/body-parser/node_modules/debug/node_modules/ms/.npmignore @@ -0,0 +1,5 @@ +node_modules +test +History.md +Makefile +component.json diff --git a/node_modules/body-parser/node_modules/debug/node_modules/ms/LICENSE b/node_modules/body-parser/node_modules/debug/node_modules/ms/LICENSE new file mode 100644 index 0000000..6c07561 --- /dev/null +++ b/node_modules/body-parser/node_modules/debug/node_modules/ms/LICENSE @@ -0,0 +1,20 @@ +(The MIT License) + +Copyright (c) 2014 Guillermo Rauch + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of +the Software, and to permit persons to whom the Software is furnished to do so, +subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS +FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR +COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/body-parser/node_modules/debug/node_modules/ms/README.md b/node_modules/body-parser/node_modules/debug/node_modules/ms/README.md new file mode 100644 index 0000000..0fd54fd --- /dev/null +++ b/node_modules/body-parser/node_modules/debug/node_modules/ms/README.md @@ -0,0 +1,35 @@ +# ms.js: miliseconds conversion utility + +```js +ms('2 days') // 172800000 +ms('1d') // 86400000 +ms('10h') // 36000000 +ms('2.5 hrs') // 9000000 +ms('2h') // 7200000 +ms('1m') // 60000 +ms('5s') // 5000 +ms('100') // 100 +``` + +```js +ms(60000) // "1m" +ms(2 * 60000) // "2m" +ms(ms('10 hours')) // "10h" +``` + +```js +ms(60000, { long: true }) // "1 minute" +ms(2 * 60000, { long: true }) // "2 minutes" +ms(ms('10 hours'), { long: true }) // "10 hours" +``` + +- Node/Browser compatible. Published as [`ms`](https://www.npmjs.org/package/ms) in [NPM](nodejs.org/download). +- If a number is supplied to `ms`, a string with a unit is returned. +- If a string that contains the number is supplied, it returns it as +a number (e.g: it returns `100` for `'100'`). +- If you pass a string with a number and a valid unit, the number of +equivalent ms is returned. + +## License + +MIT diff --git a/node_modules/body-parser/node_modules/debug/node_modules/ms/index.js b/node_modules/body-parser/node_modules/debug/node_modules/ms/index.js new file mode 100644 index 0000000..e79bfa1 --- /dev/null +++ b/node_modules/body-parser/node_modules/debug/node_modules/ms/index.js @@ -0,0 +1,123 @@ +/** + * Helpers. + */ + +var s = 1000; +var m = s * 60; +var h = m * 60; +var d = h * 24; +var y = d * 365.25; + +/** + * Parse or format the given `val`. + * + * Options: + * + * - `long` verbose formatting [false] + * + * @param {String|Number} val + * @param {Object} options + * @return {String|Number} + * @api public + */ + +module.exports = function(val, options){ + options = options || {}; + if ('string' == typeof val) return parse(val); + return options.long + ? long(val) + : short(val); +}; + +/** + * Parse the given `str` and return milliseconds. + * + * @param {String} str + * @return {Number} + * @api private + */ + +function parse(str) { + var match = /^((?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(str); + if (!match) return; + var n = parseFloat(match[1]); + var type = (match[2] || 'ms').toLowerCase(); + switch (type) { + case 'years': + case 'year': + case 'yrs': + case 'yr': + case 'y': + return n * y; + case 'days': + case 'day': + case 'd': + return n * d; + case 'hours': + case 'hour': + case 'hrs': + case 'hr': + case 'h': + return n * h; + case 'minutes': + case 'minute': + case 'mins': + case 'min': + case 'm': + return n * m; + case 'seconds': + case 'second': + case 'secs': + case 'sec': + case 's': + return n * s; + case 'milliseconds': + case 'millisecond': + case 'msecs': + case 'msec': + case 'ms': + return n; + } +} + +/** + * Short format for `ms`. + * + * @param {Number} ms + * @return {String} + * @api private + */ + +function short(ms) { + if (ms >= d) return Math.round(ms / d) + 'd'; + if (ms >= h) return Math.round(ms / h) + 'h'; + if (ms >= m) return Math.round(ms / m) + 'm'; + if (ms >= s) return Math.round(ms / s) + 's'; + return ms + 'ms'; +} + +/** + * Long format for `ms`. + * + * @param {Number} ms + * @return {String} + * @api private + */ + +function long(ms) { + return plural(ms, d, 'day') + || plural(ms, h, 'hour') + || plural(ms, m, 'minute') + || plural(ms, s, 'second') + || ms + ' ms'; +} + +/** + * Pluralization helper. + */ + +function plural(ms, n, name) { + if (ms < n) return; + if (ms < n * 1.5) return Math.floor(ms / n) + ' ' + name; + return Math.ceil(ms / n) + ' ' + name + 's'; +} diff --git a/node_modules/body-parser/node_modules/debug/node_modules/ms/package.json b/node_modules/body-parser/node_modules/debug/node_modules/ms/package.json new file mode 100644 index 0000000..ec3ea9b --- /dev/null +++ b/node_modules/body-parser/node_modules/debug/node_modules/ms/package.json @@ -0,0 +1,47 @@ +{ + "name": "ms", + "version": "0.7.0", + "description": "Tiny ms conversion utility", + "repository": { + "type": "git", + "url": "git://github.com/guille/ms.js.git" + }, + "main": "./index", + "devDependencies": { + "mocha": "*", + "expect.js": "*", + "serve": "*" + }, + "component": { + "scripts": { + "ms/index.js": "index.js" + } + }, + "gitHead": "1e9cd9b05ef0dc26f765434d2bfee42394376e52", + "bugs": { + "url": "https://github.com/guille/ms.js/issues" + }, + "homepage": "https://github.com/guille/ms.js", + "_id": "ms@0.7.0", + "scripts": {}, + "_shasum": "865be94c2e7397ad8a57da6a633a6e2f30798b83", + "_from": "ms@0.7.0", + "_npmVersion": "1.4.21", + "_npmUser": { + "name": "rauchg", + "email": "rauchg@gmail.com" + }, + "maintainers": [ + { + "name": "rauchg", + "email": "rauchg@gmail.com" + } + ], + "dist": { + "shasum": "865be94c2e7397ad8a57da6a633a6e2f30798b83", + "tarball": "http://registry.npmjs.org/ms/-/ms-0.7.0.tgz" + }, + "directories": {}, + "_resolved": "https://registry.npmjs.org/ms/-/ms-0.7.0.tgz", + "readme": "ERROR: No README data found!" +} diff --git a/node_modules/body-parser/node_modules/debug/package.json b/node_modules/body-parser/node_modules/debug/package.json new file mode 100644 index 0000000..184f980 --- /dev/null +++ b/node_modules/body-parser/node_modules/debug/package.json @@ -0,0 +1,72 @@ +{ + "name": "debug", + "version": "2.1.2", + "repository": { + "type": "git", + "url": "git://github.com/visionmedia/debug.git" + }, + "description": "small debugging utility", + "keywords": [ + "debug", + "log", + "debugger" + ], + "author": { + "name": "TJ Holowaychuk", + "email": "tj@vision-media.ca" + }, + "contributors": [ + { + "name": "Nathan Rajlich", + "email": "nathan@tootallnate.net", + "url": "http://n8.io" + } + ], + "license": "MIT", + "dependencies": { + "ms": "0.7.0" + }, + "devDependencies": { + "browserify": "9.0.3", + "mocha": "*" + }, + "main": "./node.js", + "browser": "./browser.js", + "component": { + "scripts": { + "debug/index.js": "browser.js", + "debug/debug.js": "debug.js" + } + }, + "gitHead": "ef0b37817e88df724511e648c8c168618e892530", + "bugs": { + "url": "https://github.com/visionmedia/debug/issues" + }, + "homepage": "https://github.com/visionmedia/debug", + "_id": "debug@2.1.2", + "scripts": {}, + "_shasum": "d5853ec48011eafd9ec80a5c4733332c1e767a43", + "_from": "debug@~2.1.1", + "_npmVersion": "1.4.28", + "_npmUser": { + "name": "tootallnate", + "email": "nathan@tootallnate.net" + }, + "maintainers": [ + { + "name": "tjholowaychuk", + "email": "tj@vision-media.ca" + }, + { + "name": "tootallnate", + "email": "nathan@tootallnate.net" + } + ], + "dist": { + "shasum": "d5853ec48011eafd9ec80a5c4733332c1e767a43", + "tarball": "http://registry.npmjs.org/debug/-/debug-2.1.2.tgz" + }, + "directories": {}, + "_resolved": "https://registry.npmjs.org/debug/-/debug-2.1.2.tgz", + "readme": "ERROR: No README data found!" +} diff --git a/node_modules/body-parser/node_modules/depd/package.json b/node_modules/body-parser/node_modules/depd/package.json index 622dc27..021f13e 100644 --- a/node_modules/body-parser/node_modules/depd/package.json +++ b/node_modules/body-parser/node_modules/depd/package.json @@ -38,7 +38,8 @@ "test-cov": "istanbul cover node_modules/mocha/bin/_mocha -- --reporter dot --require should test/", "test-travis": "istanbul cover node_modules/mocha/bin/_mocha --report lcovonly -- --reporter spec --require should test/" }, - "gitHead": "08b5a2182c8c1fdf7420e4ff8532bfd7e266a7b2", + "readme": "# depd\n\n[![NPM Version][npm-version-image]][npm-url]\n[![NPM Downloads][npm-downloads-image]][npm-url]\n[![Node.js Version][node-image]][node-url]\n[![Build Status][travis-image]][travis-url]\n[![Coverage Status][coveralls-image]][coveralls-url]\n[![Gratipay][gratipay-image]][gratipay-url]\n\nDeprecate all the things\n\n> With great modules comes great responsibility; mark things deprecated!\n\n## Install\n\n```sh\n$ npm install depd\n```\n\n## API\n\n```js\nvar deprecate = require('depd')('my-module')\n```\n\nThis library allows you to display deprecation messages to your users.\nThis library goes above and beyond with deprecation warnings by\nintrospection of the call stack (but only the bits that it is interested\nin).\n\nInstead of just warning on the first invocation of a deprecated\nfunction and never again, this module will warn on the first invocation\nof a deprecated function per unique call site, making it ideal to alert\nusers of all deprecated uses across the code base, rather than just\nwhatever happens to execute first.\n\nThe deprecation warnings from this module also include the file and line\ninformation for the call into the module that the deprecated function was\nin.\n\n**NOTE** this library has a similar interface to the `debug` module, and\nthis module uses the calling file to get the boundary for the call stacks,\nso you should always create a new `deprecate` object in each file and not\nwithin some central file.\n\n### depd(namespace)\n\nCreate a new deprecate function that uses the given namespace name in the\nmessages and will display the call site prior to the stack entering the\nfile this function was called from. It is highly suggested you use the\nname of your module as the namespace.\n\n### deprecate(message)\n\nCall this function from deprecated code to display a deprecation message.\nThis message will appear once per unique caller site. Caller site is the\nfirst call site in the stack in a different file from the caller of this\nfunction.\n\nIf the message is omitted, a message is generated for you based on the site\nof the `deprecate()` call and will display the name of the function called,\nsimilar to the name displayed in a stack trace.\n\n### deprecate.function(fn, message)\n\nCall this function to wrap a given function in a deprecation message on any\ncall to the function. An optional message can be supplied to provide a custom\nmessage.\n\n### deprecate.property(obj, prop, message)\n\nCall this function to wrap a given property on object in a deprecation message\non any accessing or setting of the property. An optional message can be supplied\nto provide a custom message.\n\nThe method must be called on the object where the property belongs (not\ninherited from the prototype).\n\nIf the property is a data descriptor, it will be converted to an accessor\ndescriptor in order to display the deprecation message.\n\n### process.on('deprecation', fn)\n\nThis module will allow easy capturing of deprecation errors by emitting the\nerrors as the type \"deprecation\" on the global `process`. If there are no\nlisteners for this type, the errors are written to STDERR as normal, but if\nthere are any listeners, nothing will be written to STDERR and instead only\nemitted. From there, you can write the errors in a different format or to a\nlogging source.\n\nThe error represents the deprecation and is emitted only once with the same\nrules as writing to STDERR. The error has the following properties:\n\n - `message` - This is the message given by the library\n - `name` - This is always `'DeprecationError'`\n - `namespace` - This is the namespace the deprecation came from\n - `stack` - This is the stack of the call to the deprecated thing\n\nExample `error.stack` output:\n\n```\nDeprecationError: my-cool-module deprecated oldfunction\n at Object. ([eval]-wrapper:6:22)\n at Module._compile (module.js:456:26)\n at evalScript (node.js:532:25)\n at startup (node.js:80:7)\n at node.js:902:3\n```\n\n### process.env.NO_DEPRECATION\n\nAs a user of modules that are deprecated, the environment variable `NO_DEPRECATION`\nis provided as a quick solution to silencing deprecation warnings from being\noutput. The format of this is similar to that of `DEBUG`:\n\n```sh\n$ NO_DEPRECATION=my-module,othermod node app.js\n```\n\nThis will suppress deprecations from being output for \"my-module\" and \"othermod\".\nThe value is a list of comma-separated namespaces. To suppress every warning\nacross all namespaces, use the value `*` for a namespace.\n\nProviding the argument `--no-deprecation` to the `node` executable will suppress\nall deprecations (only available in Node.js 0.8 or higher).\n\n**NOTE** This will not suppress the deperecations given to any \"deprecation\"\nevent listeners, just the output to STDERR.\n\n### process.env.TRACE_DEPRECATION\n\nAs a user of modules that are deprecated, the environment variable `TRACE_DEPRECATION`\nis provided as a solution to getting more detailed location information in deprecation\nwarnings by including the entire stack trace. The format of this is the same as\n`NO_DEPRECATION`:\n\n```sh\n$ TRACE_DEPRECATION=my-module,othermod node app.js\n```\n\nThis will include stack traces for deprecations being output for \"my-module\" and\n\"othermod\". The value is a list of comma-separated namespaces. To trace every\nwarning across all namespaces, use the value `*` for a namespace.\n\nProviding the argument `--trace-deprecation` to the `node` executable will trace\nall deprecations (only available in Node.js 0.8 or higher).\n\n**NOTE** This will not trace the deperecations silenced by `NO_DEPRECATION`.\n\n## Display\n\n![message](files/message.png)\n\nWhen a user calls a function in your library that you mark deprecated, they\nwill see the following written to STDERR (in the given colors, similar colors\nand layout to the `debug` module):\n\n```\nbright cyan bright yellow\n| | reset cyan\n| | | |\n▼ ▼ ▼ ▼\nmy-cool-module deprecated oldfunction [eval]-wrapper:6:22\n▲ ▲ ▲ ▲\n| | | |\nnamespace | | location of mycoolmod.oldfunction() call\n | deprecation message\n the word \"deprecated\"\n```\n\nIf the user redirects their STDERR to a file or somewhere that does not support\ncolors, they see (similar layout to the `debug` module):\n\n```\nSun, 15 Jun 2014 05:21:37 GMT my-cool-module deprecated oldfunction at [eval]-wrapper:6:22\n▲ ▲ ▲ ▲ ▲\n| | | | |\ntimestamp of message namespace | | location of mycoolmod.oldfunction() call\n | deprecation message\n the word \"deprecated\"\n```\n\n## Examples\n\n### Deprecating all calls to a function\n\nThis will display a deprecated message about \"oldfunction\" being deprecated\nfrom \"my-module\" on STDERR.\n\n```js\nvar deprecate = require('depd')('my-cool-module')\n\n// message automatically derived from function name\n// Object.oldfunction\nexports.oldfunction = deprecate.function(function oldfunction() {\n // all calls to function are deprecated\n})\n\n// specific message\nexports.oldfunction = deprecate.function(function () {\n // all calls to function are deprecated\n}, 'oldfunction')\n```\n\n### Conditionally deprecating a function call\n\nThis will display a deprecated message about \"weirdfunction\" being deprecated\nfrom \"my-module\" on STDERR when called with less than 2 arguments.\n\n```js\nvar deprecate = require('depd')('my-cool-module')\n\nexports.weirdfunction = function () {\n if (arguments.length < 2) {\n // calls with 0 or 1 args are deprecated\n deprecate('weirdfunction args < 2')\n }\n}\n```\n\nWhen calling `deprecate` as a function, the warning is counted per call site\nwithin your own module, so you can display different deprecations depending\non different situations and the users will still get all the warnings:\n\n```js\nvar deprecate = require('depd')('my-cool-module')\n\nexports.weirdfunction = function () {\n if (arguments.length < 2) {\n // calls with 0 or 1 args are deprecated\n deprecate('weirdfunction args < 2')\n } else if (typeof arguments[0] !== 'string') {\n // calls with non-string first argument are deprecated\n deprecate('weirdfunction non-string first arg')\n }\n}\n```\n\n### Deprecating property access\n\nThis will display a deprecated message about \"oldprop\" being deprecated\nfrom \"my-module\" on STDERR when accessed. A deprecation will be displayed\nwhen setting the value and when getting the value.\n\n```js\nvar deprecate = require('depd')('my-cool-module')\n\nexports.oldprop = 'something'\n\n// message automatically derives from property name\ndeprecate.property(exports, 'oldprop')\n\n// explicit message\ndeprecate.property(exports, 'oldprop', 'oldprop >= 0.10')\n```\n\n## License\n\n[MIT](LICENSE)\n\n[npm-version-image]: https://img.shields.io/npm/v/depd.svg?style=flat\n[npm-downloads-image]: https://img.shields.io/npm/dm/depd.svg?style=flat\n[npm-url]: https://npmjs.org/package/depd\n[travis-image]: https://img.shields.io/travis/dougwilson/nodejs-depd.svg?style=flat\n[travis-url]: https://travis-ci.org/dougwilson/nodejs-depd\n[coveralls-image]: https://img.shields.io/coveralls/dougwilson/nodejs-depd.svg?style=flat\n[coveralls-url]: https://coveralls.io/r/dougwilson/nodejs-depd?branch=master\n[node-image]: https://img.shields.io/node/v/depd.svg?style=flat\n[node-url]: http://nodejs.org/download/\n[gratipay-image]: https://img.shields.io/gratipay/dougwilson.svg?style=flat\n[gratipay-url]: https://www.gratipay.com/dougwilson/\n", + "readmeFilename": "Readme.md", "bugs": { "url": "https://github.com/dougwilson/nodejs-depd/issues" }, @@ -46,21 +47,5 @@ "_id": "depd@1.0.0", "_shasum": "2fda0d00e98aae2845d4991ab1bf1f2a199073d5", "_from": "depd@~1.0.0", - "_npmVersion": "1.4.21", - "_npmUser": { - "name": "dougwilson", - "email": "doug@somethingdoug.com" - }, - "maintainers": [ - { - "name": "dougwilson", - "email": "doug@somethingdoug.com" - } - ], - "dist": { - "shasum": "2fda0d00e98aae2845d4991ab1bf1f2a199073d5", - "tarball": "http://registry.npmjs.org/depd/-/depd-1.0.0.tgz" - }, - "directories": {}, "_resolved": "https://registry.npmjs.org/depd/-/depd-1.0.0.tgz" } diff --git a/node_modules/body-parser/node_modules/iconv-lite/.npmignore b/node_modules/body-parser/node_modules/iconv-lite/.npmignore index 6c69ea0..5cd2673 100644 --- a/node_modules/body-parser/node_modules/iconv-lite/.npmignore +++ b/node_modules/body-parser/node_modules/iconv-lite/.npmignore @@ -3,3 +3,4 @@ generation test wiki +coverage diff --git a/node_modules/body-parser/node_modules/iconv-lite/.travis.yml b/node_modules/body-parser/node_modules/iconv-lite/.travis.yml index 9169b9f..b409bbc 100644 --- a/node_modules/body-parser/node_modules/iconv-lite/.travis.yml +++ b/node_modules/body-parser/node_modules/iconv-lite/.travis.yml @@ -1,5 +1,5 @@ language: node_js node_js: - - 0.8 - - 0.10 - - 0.11 + #- "0.8" + - "0.10" + - "0.11" diff --git a/node_modules/body-parser/node_modules/iconv-lite/Changelog.md b/node_modules/body-parser/node_modules/iconv-lite/Changelog.md index 75db5f9..648b50f 100644 --- a/node_modules/body-parser/node_modules/iconv-lite/Changelog.md +++ b/node_modules/body-parser/node_modules/iconv-lite/Changelog.md @@ -1,17 +1,40 @@ +# 0.4.7 / 2015-02-05 + + * stop official support of Node.js v0.8. Should still work, but no guarantees. + reason: Packages needed for testing are hard to get on Travis CI. + * work in environment where Object.prototype is monkey patched with enumerable + props (#89). + + +# 0.4.6 / 2015-01-12 + + * fix rare aliases of single-byte encodings (thanks @mscdex) + * double the timeout for dbcs tests to make them less flaky on travis + + +# 0.4.5 / 2014-11-20 + + * fix windows-31j and x-sjis encoding support (@nleush) + * minor fix: undefined variable reference when internal error happens + + # 0.4.4 / 2014-07-16 * added encodings UTF-7 (RFC2152) and UTF-7-IMAP (RFC3501 Section 5.1.3) * fixed streaming base64 encoding + # 0.4.3 / 2014-06-14 * added encodings UTF-16BE and UTF-16 with BOM + # 0.4.2 / 2014-06-12 * don't throw exception if `extendNodeEncodings()` is called more than once + # 0.4.1 / 2014-06-11 * codepage 808 added diff --git a/node_modules/body-parser/node_modules/iconv-lite/README.md b/node_modules/body-parser/node_modules/iconv-lite/README.md index f8d0845..146886d 100644 --- a/node_modules/body-parser/node_modules/iconv-lite/README.md +++ b/node_modules/body-parser/node_modules/iconv-lite/README.md @@ -3,7 +3,8 @@ * Doesn't need native code compilation. Works on Windows and in sandboxed environments like [Cloud9](http://c9.io). - * Used in popular projects like [Grunt](http://gruntjs.com/), [Nodemailer](http://www.nodemailer.com/), [Yeoman](http://yeoman.io/) and others. + * Used in popular projects like [Express.js (body_parser)](https://github.com/expressjs/body-parser), + [Grunt](http://gruntjs.com/), [Nodemailer](http://www.nodemailer.com/), [Yeoman](http://yeoman.io/) and others. * Faster than [node-iconv](https://github.com/bnoordhuis/node-iconv) (see below for performance comparison). * Intuitive encode/decode API * Streaming support for Node v0.10+ @@ -118,7 +119,9 @@ Note: your results may vary, so please always check on your hardware. ## Notes When decoding, be sure to supply a Buffer to decode() method, otherwise [bad things usually happen](https://github.com/ashtuchkin/iconv-lite/wiki/Use-Buffers-when-decoding). -Untranslatable characters are set to � or ?. No transliteration is currently supported. +Untranslatable characters are set to � or ?. No transliteration is currently supported. +Uses BOM to determine endianness, but doesn't remove it. Use ['strip-bom' module](https://github.com/sindresorhus/strip-bom). +Node versions 0.10.31 and 0.11.13 are buggy, don't use them (see #65, #77). ## Testing @@ -130,8 +133,12 @@ $ npm test $ # To view performance: $ node test/performance.js + +$ # To view test coverage: +$ npm run coverage +$ open coverage/lcov-report/index.html ``` ## Adoption [![NPM](https://nodei.co/npm-dl/iconv-lite.png)](https://nodei.co/npm/iconv-lite/) - +[![Codeship Status for ashtuchkin/iconv-lite](https://www.codeship.io/projects/81670840-fa72-0131-4520-4a01a6c01acc/status)](https://www.codeship.io/projects/29053) diff --git a/node_modules/body-parser/node_modules/iconv-lite/README.md~ b/node_modules/body-parser/node_modules/iconv-lite/README.md~ deleted file mode 100644 index 5f57561..0000000 --- a/node_modules/body-parser/node_modules/iconv-lite/README.md~ +++ /dev/null @@ -1,54 +0,0 @@ -iconv-lite - native javascript conversion between character encodings. -====================================================================== - -## Usage - - var iconv = require('iconv-lite'); - - // Convert from an encoded buffer to string. - str = iconv.fromEncoding(buf, 'win-1251'); - // Or - str = iconv.decode(buf, 'win-1251'); - - // Convert from string to an encoded buffer. - buf = iconv.toEncoding("Sample input string", 'win-1251'); - // Or - buf = iconv.encode("Sample input string", 'win-1251'); - -## Supported encodings - -Currently only a small part of encodings supported: - -* All node.js native encodings: 'utf8', 'ucs2', 'ascii', 'binary', 'base64'. -* 'latin1' -* Cyrillic encodings: 'windows-1251', 'koi8-r', 'iso 8859-5'. - -Other encodings are easy to add, see the source. Please, participate. - - -## Encoding/decoding speed - -Comparison with iconv module (1000 times 256kb, on Core i5/2.5 GHz). - - Operation\module iconv iconv-lite (this) - toEncoding('win1251') 19.57 mb/s 49.04 mb/s - fromEncoding('win1251') 16.39 mb/s 24.11 mb/s - - -## Notes - -This module is JavaScript-only, thus can be used in a sandboxed environment like [Cloud9](http://c9.io). - -Untranslatable characters are set to '?'. No transliteration is currently supported, pull requests are welcome. - -## Testing - - npm install --dev iconv-lite - vows - -## TODO - -* Support streaming character conversion, something like util.pipe(req, iconv.fromEncodingStream('latin1')). -* Add more encodings. -* Add transliteration (best fit char). -* Add tests and correct support of variable-byte encodings (currently work is delegated to node). diff --git a/node_modules/body-parser/node_modules/iconv-lite/encodings/dbcs-codec.js b/node_modules/body-parser/node_modules/iconv-lite/encodings/dbcs-codec.js index fd3681c..aa88bb5 100644 --- a/node_modules/body-parser/node_modules/iconv-lite/encodings/dbcs-codec.js +++ b/node_modules/body-parser/node_modules/iconv-lite/encodings/dbcs-codec.js @@ -80,8 +80,11 @@ function DBCSCodec(options) { this._fillEncodeTable(0, 0, skipEncodeChars); // Add more encoding pairs when needed. - for (var uChar in options.encodeAdd || {}) - this._setEncodeChar(uChar.charCodeAt(0), options.encodeAdd[uChar]); + if (options.encodeAdd) { + for (var uChar in options.encodeAdd) + if (Object.prototype.hasOwnProperty.call(options.encodeAdd, uChar)) + this._setEncodeChar(uChar.charCodeAt(0), options.encodeAdd[uChar]); + } this.defCharSB = this.encodeTable[0][options.iconv.defaultCharSingleByte.charCodeAt(0)]; if (this.defCharSB === UNASSIGNED) this.defCharSB = this.encodeTable[0]['?']; @@ -503,7 +506,7 @@ function decoderDBCSWrite(buf) { uCode = seq[seq.length-1]; } else - throw new Error("Unknown table value when decoding: " + val); + throw new Error("iconv-lite internal error: invalid decoding table value " + uCode + " at " + nodeIdx + "/" + curByte); // Write the character to buffer, handling higher planes using surrogate pair. if (uCode > 0xFFFF) { diff --git a/node_modules/body-parser/node_modules/iconv-lite/encodings/dbcs-data.js b/node_modules/body-parser/node_modules/iconv-lite/encodings/dbcs-data.js index 44be66c..140b775 100644 --- a/node_modules/body-parser/node_modules/iconv-lite/encodings/dbcs-data.js +++ b/node_modules/body-parser/node_modules/iconv-lite/encodings/dbcs-data.js @@ -47,8 +47,8 @@ module.exports = { 'csshiftjis': 'shiftjis', 'mskanji': 'shiftjis', 'sjis': 'shiftjis', - 'windows-31j': 'shiftjis', - 'x-sjis': 'shiftjis', + 'windows31j': 'shiftjis', + 'xsjis': 'shiftjis', 'windows932': 'shiftjis', '932': 'shiftjis', 'cp932': 'shiftjis', @@ -165,4 +165,4 @@ module.exports = { 'csbig5': 'big5hkscs', 'xxbig5': 'big5hkscs', -}; \ No newline at end of file +}; diff --git a/node_modules/body-parser/node_modules/iconv-lite/encodings/index.js b/node_modules/body-parser/node_modules/iconv-lite/encodings/index.js index 2cda918..1b786be 100644 --- a/node_modules/body-parser/node_modules/iconv-lite/encodings/index.js +++ b/node_modules/body-parser/node_modules/iconv-lite/encodings/index.js @@ -16,5 +16,6 @@ var modules = [ for (var i = 0; i < modules.length; i++) { var module = modules[i]; for (var enc in module) - exports[enc] = module[enc]; + if (Object.prototype.hasOwnProperty.call(module, enc)) + exports[enc] = module[enc]; } diff --git a/node_modules/body-parser/node_modules/iconv-lite/encodings/sbcs-data.js b/node_modules/body-parser/node_modules/iconv-lite/encodings/sbcs-data.js index 74fb34b..adc5fbc 100644 --- a/node_modules/body-parser/node_modules/iconv-lite/encodings/sbcs-data.js +++ b/node_modules/body-parser/node_modules/iconv-lite/encodings/sbcs-data.js @@ -19,15 +19,15 @@ module.exports = { // Aliases of generated encodings. "ascii8bit": "ascii", "usascii": "ascii", - "ansix3.4": "ascii", - "ansix3.41968": "ascii", - "ansix3.41986": "ascii", + "ansix34": "ascii", + "ansix341968": "ascii", + "ansix341986": "ascii", "csascii": "ascii", "cp367": "ascii", "ibm367": "ascii", "isoir6": "ascii", "iso646us": "ascii", - "iso646.irv": "ascii", + "iso646irv": "ascii", "us": "ascii", "latin1": "iso88591", @@ -110,8 +110,8 @@ module.exports = { "isoceltic": "iso885914", "tis6200": "tis620", - "tis620.25291": "tis620", - "tis620.25330": "tis620", + "tis62025291": "tis620", + "tis62025330": "tis620", "10000": "macroman", "10006": "macgreek", diff --git a/node_modules/body-parser/node_modules/iconv-lite/package.json b/node_modules/body-parser/node_modules/iconv-lite/package.json index ee348fa..385cda1 100644 --- a/node_modules/body-parser/node_modules/iconv-lite/package.json +++ b/node_modules/body-parser/node_modules/iconv-lite/package.json @@ -1,7 +1,7 @@ { "name": "iconv-lite", "description": "Convert character encodings in pure javascript.", - "version": "0.4.4", + "version": "0.4.7", "license": "MIT", "keywords": [ "iconv", @@ -57,6 +57,10 @@ { "name": "Mithgol", "url": "https://github.com/Mithgol" + }, + { + "name": "Nazar Leush", + "url": "https://github.com/nleush" } ], "main": "./lib/index.js", @@ -72,6 +76,8 @@ "node": ">=0.8.0" }, "scripts": { + "coverage": "istanbul cover _mocha -- --grep .", + "coverage-open": "open coverage/lcov-report/index.html", "test": "mocha --reporter spec --grep ." }, "browser": { @@ -80,17 +86,19 @@ }, "devDependencies": { "mocha": "*", - "request": "*", + "request": "2.47", "unorm": "*", "errto": "*", "async": "*", - "iconv": "~2.1.4" + "istanbul": "*", + "iconv": "2.1.4" }, - "gitHead": "9f0b0a7631d167322f47c2202aa3e5b090945131", - "_id": "iconv-lite@0.4.4", - "_shasum": "e95f2e41db0735fc21652f7827a5ee32e63c83a8", - "_from": "iconv-lite@0.4.4", - "_npmVersion": "1.4.14", + "gitHead": "820336d20d947159895c80daab55bac4261ff53c", + "_id": "iconv-lite@0.4.7", + "_shasum": "89d32fec821bf8597f44609b4bc09bed5c209a23", + "_from": "iconv-lite@0.4.7", + "_npmVersion": "2.1.6", + "_nodeVersion": "0.10.33", "_npmUser": { "name": "ashtuchkin", "email": "ashtuchkin@gmail.com" @@ -102,9 +110,9 @@ } ], "dist": { - "shasum": "e95f2e41db0735fc21652f7827a5ee32e63c83a8", - "tarball": "http://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.4.tgz" + "shasum": "89d32fec821bf8597f44609b4bc09bed5c209a23", + "tarball": "http://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.7.tgz" }, "directories": {}, - "_resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.4.tgz" + "_resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.7.tgz" } diff --git a/node_modules/body-parser/node_modules/on-finished/HISTORY.md b/node_modules/body-parser/node_modules/on-finished/HISTORY.md index 0aa241b..5d1e1c9 100644 --- a/node_modules/body-parser/node_modules/on-finished/HISTORY.md +++ b/node_modules/body-parser/node_modules/on-finished/HISTORY.md @@ -1,3 +1,13 @@ +2.2.0 / 2014-12-22 +================== + + * Add message object to callback arguments + +2.1.1 / 2014-10-22 +================== + + * Fix handling of pipelined requests + 2.1.0 / 2014-08-16 ================== diff --git a/node_modules/body-parser/node_modules/on-finished/README.md b/node_modules/body-parser/node_modules/on-finished/README.md index 887b5c3..29d6991 100644 --- a/node_modules/body-parser/node_modules/on-finished/README.md +++ b/node_modules/body-parser/node_modules/on-finished/README.md @@ -1,9 +1,10 @@ # on-finished -[![NPM Version](http://img.shields.io/npm/v/on-finished.svg?style=flat)](https://www.npmjs.org/package/on-finished) -[![Node.js Version](http://img.shields.io/badge/node.js->=_0.8-brightgreen.svg?style=flat)](http://nodejs.org/download/) -[![Build Status](http://img.shields.io/travis/jshttp/on-finished.svg?style=flat)](https://travis-ci.org/jshttp/on-finished) -[![Coverage Status](https://img.shields.io/coveralls/jshttp/on-finished.svg?style=flat)](https://coveralls.io/r/jshttp/on-finished) +[![NPM Version][npm-image]][npm-url] +[![NPM Downloads][downloads-image]][downloads-url] +[![Node.js Version][node-version-image]][node-version-url] +[![Build Status][travis-image]][travis-url] +[![Test Coverage][coveralls-image]][coveralls-url] Execute a callback when a request closes, finishes, or errors. @@ -23,14 +24,18 @@ var onFinished = require('on-finished') Attach a listener to listen for the response to finish. The listener will be invoked only once when the response finished. If the response finished -to to an error, the first argument will contain the error. +to to an error, the first argument will contain the error. If the response +has already finished, the listener will be invoked. Listening to the end of a response would be used to close things associated with the response, like open files. +Listener is invoked as `listener(err, res)`. + ```js -onFinished(res, function (err) { +onFinished(res, function (err, res) { // clean up open fds, etc. + // err contains the error is request error'd }) ``` @@ -38,11 +43,14 @@ onFinished(res, function (err) { Attach a listener to listen for the request to finish. The listener will be invoked only once when the request finished. If the request finished -to to an error, the first argument will contain the error. +to to an error, the first argument will contain the error. If the request +has already finished, the listener will be invoked. Listening to the end of a request would be used to know when to continue after reading the data. +Listener is invoked as `listener(err, req)`. + ```js var data = '' @@ -51,7 +59,7 @@ res.on('data', function (str) { data += str }) -onFinished(req, function (err) { +onFinished(req, function (err, req) { // data is read unless there is err }) ``` @@ -74,7 +82,7 @@ once the response finishes. ```js var destroy = require('destroy') var http = require('http') -var onFinished = require('finished') +var onFinished = require('on-finished') http.createServer(function onRequest(req, res) { var stream = fs.createReadStream('package.json') @@ -88,3 +96,14 @@ http.createServer(function onRequest(req, res) { ## License [MIT](LICENSE) + +[npm-image]: https://img.shields.io/npm/v/on-finished.svg?style=flat +[npm-url]: https://npmjs.org/package/on-finished +[node-version-image]: https://img.shields.io/node/v/on-finished.svg?style=flat +[node-version-url]: http://nodejs.org/download/ +[travis-image]: https://img.shields.io/travis/jshttp/on-finished.svg?style=flat +[travis-url]: https://travis-ci.org/jshttp/on-finished +[coveralls-image]: https://img.shields.io/coveralls/jshttp/on-finished.svg?style=flat +[coveralls-url]: https://coveralls.io/r/jshttp/on-finished?branch=master +[downloads-image]: https://img.shields.io/npm/dm/on-finished.svg?style=flat +[downloads-url]: https://npmjs.org/package/on-finished diff --git a/node_modules/body-parser/node_modules/on-finished/index.js b/node_modules/body-parser/node_modules/on-finished/index.js index a505561..f68161c 100644 --- a/node_modules/body-parser/node_modules/on-finished/index.js +++ b/node_modules/body-parser/node_modules/on-finished/index.js @@ -39,7 +39,7 @@ var defer = typeof setImmediate === 'function' function onFinished(msg, listener) { if (isFinished(msg) !== false) { - defer(listener) + defer(listener, null, msg) return msg } @@ -50,7 +50,7 @@ function onFinished(msg, listener) { } /** - * Determine is message is already finished. + * Determine if message is already finished. * * @param {object} msg * @return {boolean} @@ -62,7 +62,7 @@ function isFinished(msg) { if (typeof msg.finished === 'boolean') { // OutgoingMessage - return Boolean(!socket || msg.finished || !socket.writable) + return Boolean(msg.finished || (socket && !socket.writable)) } if (typeof msg.complete === 'boolean') { @@ -74,6 +74,56 @@ function isFinished(msg) { return undefined } +/** + * Attach a finished listener to the message. + * + * @param {object} msg + * @param {function} callback + * @private + */ + +function attachFinishedListener(msg, callback) { + var eeMsg + var eeSocket + var finished = false + + function onFinish(error) { + eeMsg.cancel() + eeSocket.cancel() + + finished = true + callback(error) + } + + // finished on first message event + eeMsg = eeSocket = first([[msg, 'end', 'finish']], onFinish) + + function onSocket(socket) { + // remove listener + msg.removeListener('socket', onSocket) + + if (finished) return + if (eeMsg !== eeSocket) return + + // finished on first socket event + eeSocket = first([[socket, 'error', 'close']], onFinish) + } + + if (msg.socket) { + // socket already assigned + onSocket(msg.socket) + return + } + + // wait for socket to be assigned + msg.on('socket', onSocket) + + if (msg.socket === undefined) { + // node.js 0.8 patch + patchAssignSocket(msg, onSocket) + } +} + /** * Attach the listener to the message. * @@ -84,17 +134,11 @@ function isFinished(msg) { function attachListener(msg, listener) { var attached = msg.__onFinished - var socket = msg.socket // create a private single listener with queue if (!attached || !attached.queue) { attached = msg.__onFinished = createListener(msg) - - // finished on first event - first([ - [socket, 'error', 'close'], - [msg, 'end', 'finish'], - ], attached) + attachFinishedListener(msg, attached) } attached.queue.push(listener) @@ -117,7 +161,7 @@ function createListener(msg) { listener.queue = null for (var i = 0; i < queue.length; i++) { - queue[i](err) + queue[i](err, msg) } } @@ -125,3 +169,23 @@ function createListener(msg) { return listener } + +/** + * Patch ServerResponse.prototype.assignSocket for node.js 0.8. + * + * @param {ServerResponse} res + * @param {function} callback + * @private + */ + +function patchAssignSocket(res, callback) { + var assignSocket = res.assignSocket + + if (typeof assignSocket !== 'function') return + + // res.on('socket', callback) is broken in 0.8 + res.assignSocket = function _assignSocket(socket) { + assignSocket.call(this, socket) + callback(socket) + } +} diff --git a/node_modules/body-parser/node_modules/on-finished/node_modules/ee-first/LICENSE b/node_modules/body-parser/node_modules/on-finished/node_modules/ee-first/LICENSE index a7ae8ee..c1b15a1 100644 --- a/node_modules/body-parser/node_modules/on-finished/node_modules/ee-first/LICENSE +++ b/node_modules/body-parser/node_modules/on-finished/node_modules/ee-first/LICENSE @@ -1,22 +1,22 @@ - -The MIT License (MIT) - -Copyright (c) 2014 Jonathan Ong me@jongleberry.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. + +The MIT License (MIT) + +Copyright (c) 2014 Jonathan Ong me@jongleberry.com + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/node_modules/body-parser/node_modules/on-finished/node_modules/ee-first/README.md b/node_modules/body-parser/node_modules/on-finished/node_modules/ee-first/README.md index 0ebc0aa..bb16aab 100644 --- a/node_modules/body-parser/node_modules/on-finished/node_modules/ee-first/README.md +++ b/node_modules/body-parser/node_modules/on-finished/node_modules/ee-first/README.md @@ -1,63 +1,80 @@ -# EE First - -[![NPM version][npm-image]][npm-url] -[![Build status][travis-image]][travis-url] -[![Test coverage][coveralls-image]][coveralls-url] -[![License][license-image]][license-url] -[![Downloads][downloads-image]][downloads-url] -[![Gittip][gittip-image]][gittip-url] - -Get the first event in a set of event emitters and event pairs, -then clean up after itself. - -## Install - -```sh -$ npm install ee-first -``` - -## API - -```js -var first = require('ee-first') -``` - -### first(arr, listener) - -Invoke `listener` on the first event from the list specified in `arr`. `arr` is -an array of arrays, with each array in the format `[ee, ...event]`. `listener` -will be called only once, the first time any of the given events are emitted. If -`error` is one of the listened events, then if that fires first, the `listener` -will be given the `err` argument. - -The `listener` is invoked as `listener(err, ee, event, args)`, where `err` is the -first argument emitted from an `error` event, if applicable; `ee` is the event -emitter that fired; `event` is the string event name that fired; and `args` is an -array of the arguments that were emitted on the event. - -```js -var ee1 = new EventEmitter() -var ee2 = new EventEmitter() - -first([ - [ee1, 'close', 'end', 'error'], - [ee2, 'error'] -], function (err, ee, event, args) { - // listener invoked -}) -``` - -[npm-image]: https://img.shields.io/npm/v/ee-first.svg?style=flat-square -[npm-url]: https://npmjs.org/package/ee-first -[github-tag]: http://img.shields.io/github/tag/jonathanong/ee-first.svg?style=flat-square -[github-url]: https://github.com/jonathanong/ee-first/tags -[travis-image]: https://img.shields.io/travis/jonathanong/ee-first.svg?style=flat-square -[travis-url]: https://travis-ci.org/jonathanong/ee-first -[coveralls-image]: https://img.shields.io/coveralls/jonathanong/ee-first.svg?style=flat-square -[coveralls-url]: https://coveralls.io/r/jonathanong/ee-first?branch=master -[license-image]: http://img.shields.io/npm/l/ee-first.svg?style=flat-square -[license-url]: LICENSE.md -[downloads-image]: http://img.shields.io/npm/dm/ee-first.svg?style=flat-square -[downloads-url]: https://npmjs.org/package/ee-first -[gittip-image]: https://img.shields.io/gittip/jonathanong.svg?style=flat-square -[gittip-url]: https://www.gittip.com/jonathanong/ +# EE First + +[![NPM version][npm-image]][npm-url] +[![Build status][travis-image]][travis-url] +[![Test coverage][coveralls-image]][coveralls-url] +[![License][license-image]][license-url] +[![Downloads][downloads-image]][downloads-url] +[![Gittip][gittip-image]][gittip-url] + +Get the first event in a set of event emitters and event pairs, +then clean up after itself. + +## Install + +```sh +$ npm install ee-first +``` + +## API + +```js +var first = require('ee-first') +``` + +### first(arr, listener) + +Invoke `listener` on the first event from the list specified in `arr`. `arr` is +an array of arrays, with each array in the format `[ee, ...event]`. `listener` +will be called only once, the first time any of the given events are emitted. If +`error` is one of the listened events, then if that fires first, the `listener` +will be given the `err` argument. + +The `listener` is invoked as `listener(err, ee, event, args)`, where `err` is the +first argument emitted from an `error` event, if applicable; `ee` is the event +emitter that fired; `event` is the string event name that fired; and `args` is an +array of the arguments that were emitted on the event. + +```js +var ee1 = new EventEmitter() +var ee2 = new EventEmitter() + +first([ + [ee1, 'close', 'end', 'error'], + [ee2, 'error'] +], function (err, ee, event, args) { + // listener invoked +}) +``` + +#### .cancel() + +The group of listeners can be cancelled before being invoked and have all the event +listeners removed from the underlying event emitters. + +```js +var thunk = first([ + [ee1, 'close', 'end', 'error'], + [ee2, 'error'] +], function (err, ee, event, args) { + // listener invoked +}) + +// cancel and clean up +thunk.cancel() +``` + +[npm-image]: https://img.shields.io/npm/v/ee-first.svg?style=flat-square +[npm-url]: https://npmjs.org/package/ee-first +[github-tag]: http://img.shields.io/github/tag/jonathanong/ee-first.svg?style=flat-square +[github-url]: https://github.com/jonathanong/ee-first/tags +[travis-image]: https://img.shields.io/travis/jonathanong/ee-first.svg?style=flat-square +[travis-url]: https://travis-ci.org/jonathanong/ee-first +[coveralls-image]: https://img.shields.io/coveralls/jonathanong/ee-first.svg?style=flat-square +[coveralls-url]: https://coveralls.io/r/jonathanong/ee-first?branch=master +[license-image]: http://img.shields.io/npm/l/ee-first.svg?style=flat-square +[license-url]: LICENSE.md +[downloads-image]: http://img.shields.io/npm/dm/ee-first.svg?style=flat-square +[downloads-url]: https://npmjs.org/package/ee-first +[gittip-image]: https://img.shields.io/gittip/jonathanong.svg?style=flat-square +[gittip-url]: https://www.gittip.com/jonathanong/ diff --git a/node_modules/body-parser/node_modules/on-finished/node_modules/ee-first/index.js b/node_modules/body-parser/node_modules/on-finished/node_modules/ee-first/index.js index d0c48c9..1d66203 100644 --- a/node_modules/body-parser/node_modules/on-finished/node_modules/ee-first/index.js +++ b/node_modules/body-parser/node_modules/on-finished/node_modules/ee-first/index.js @@ -1,60 +1,68 @@ - -module.exports = function first(stuff, done) { - if (!Array.isArray(stuff)) - throw new TypeError('arg must be an array of [ee, events...] arrays') - - var cleanups = [] - - for (var i = 0; i < stuff.length; i++) { - var arr = stuff[i] - - if (!Array.isArray(arr) || arr.length < 2) - throw new TypeError('each array member must be [ee, events...]') - - var ee = arr[0] - - for (var j = 1; j < arr.length; j++) { - var event = arr[j] - var fn = listener(event, cleanup) - - // listen to the event - ee.on(event, fn) - // push this listener to the list of cleanups - cleanups.push({ - ee: ee, - event: event, - fn: fn, - }) - } - } - - return function (fn) { - done = fn - } - - function cleanup() { - var x - for (var i = 0; i < cleanups.length; i++) { - x = cleanups[i] - x.ee.removeListener(x.event, x.fn) - } - done.apply(null, arguments) - } -} - -function listener(event, done) { - return function onevent(arg1) { - var args = new Array(arguments.length) - var ee = this - var err = event === 'error' - ? arg1 - : null - - // copy args to prevent arguments escaping scope - for (var i = 0; i < args.length; i++) { - args[i] = arguments[i] - } - - done(err, ee, event, args) - } -} + +module.exports = function first(stuff, done) { + if (!Array.isArray(stuff)) + throw new TypeError('arg must be an array of [ee, events...] arrays') + + var cleanups = [] + + for (var i = 0; i < stuff.length; i++) { + var arr = stuff[i] + + if (!Array.isArray(arr) || arr.length < 2) + throw new TypeError('each array member must be [ee, events...]') + + var ee = arr[0] + + for (var j = 1; j < arr.length; j++) { + var event = arr[j] + var fn = listener(event, callback) + + // listen to the event + ee.on(event, fn) + // push this listener to the list of cleanups + cleanups.push({ + ee: ee, + event: event, + fn: fn, + }) + } + } + + function callback() { + cleanup() + done.apply(null, arguments) + } + + function cleanup() { + var x + for (var i = 0; i < cleanups.length; i++) { + x = cleanups[i] + x.ee.removeListener(x.event, x.fn) + } + } + + function thunk(fn) { + done = fn + } + + thunk.cancel = cleanup + + return thunk +} + +function listener(event, done) { + return function onevent(arg1) { + var args = new Array(arguments.length) + var ee = this + var err = event === 'error' + ? arg1 + : null + + // copy args to prevent arguments escaping scope + for (var i = 0; i < args.length; i++) { + args[i] = arguments[i] + } + + done(err, ee, event, args) + } +} diff --git a/node_modules/body-parser/node_modules/on-finished/node_modules/ee-first/package.json b/node_modules/body-parser/node_modules/on-finished/node_modules/ee-first/package.json index f19f55e..af11b2a 100644 --- a/node_modules/body-parser/node_modules/on-finished/node_modules/ee-first/package.json +++ b/node_modules/body-parser/node_modules/on-finished/node_modules/ee-first/package.json @@ -1,7 +1,7 @@ { "name": "ee-first", "description": "return the first event in a set of ee/event pairs", - "version": "1.0.5", + "version": "1.1.0", "author": { "name": "Jonathan Ong", "email": "me@jongleberry.com", @@ -19,7 +19,7 @@ "url": "https://github.com/jonathanong/ee-first" }, "devDependencies": { - "istanbul": "0.3.0", + "istanbul": "0.3.2", "mocha": "1" }, "files": [ @@ -31,14 +31,14 @@ "test-cov": "istanbul cover node_modules/mocha/bin/_mocha -- --reporter dot --check-leaks test/", "test-travis": "istanbul cover node_modules/mocha/bin/_mocha --report lcovonly -- --reporter spec --check-leaks test/" }, - "gitHead": "c9d9a6881863c0d2fcc2e4ac99a170088c205304", + "gitHead": "a6412004da4745941af2fc98ec30c8da570da7ea", "bugs": { "url": "https://github.com/jonathanong/ee-first/issues" }, "homepage": "https://github.com/jonathanong/ee-first", - "_id": "ee-first@1.0.5", - "_shasum": "8c9b212898d8cd9f1a9436650ce7be202c9e9ff0", - "_from": "ee-first@1.0.5", + "_id": "ee-first@1.1.0", + "_shasum": "6a0d7c6221e490feefd92ec3f441c9ce8cd097f4", + "_from": "ee-first@1.1.0", "_npmVersion": "1.4.21", "_npmUser": { "name": "dougwilson", @@ -55,9 +55,9 @@ } ], "dist": { - "shasum": "8c9b212898d8cd9f1a9436650ce7be202c9e9ff0", - "tarball": "http://registry.npmjs.org/ee-first/-/ee-first-1.0.5.tgz" + "shasum": "6a0d7c6221e490feefd92ec3f441c9ce8cd097f4", + "tarball": "http://registry.npmjs.org/ee-first/-/ee-first-1.1.0.tgz" }, "directories": {}, - "_resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.0.5.tgz" + "_resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.0.tgz" } diff --git a/node_modules/body-parser/node_modules/on-finished/package.json b/node_modules/body-parser/node_modules/on-finished/package.json index df7402d..0a2884b 100644 --- a/node_modules/body-parser/node_modules/on-finished/package.json +++ b/node_modules/body-parser/node_modules/on-finished/package.json @@ -1,7 +1,7 @@ { "name": "on-finished", "description": "Execute a callback when a request closes, finishes, or errors", - "version": "2.1.0", + "version": "2.2.0", "contributors": [ { "name": "Douglas Christopher Wilson", @@ -19,14 +19,14 @@ "url": "https://github.com/jshttp/on-finished" }, "dependencies": { - "ee-first": "1.0.5" + "ee-first": "1.1.0" }, "devDependencies": { - "istanbul": "0.3.0", - "mocha": "~1.21.4" + "istanbul": "0.3.5", + "mocha": "~2.0.1" }, - "engine": { - "node": ">= 0.8.0" + "engines": { + "node": ">= 0.8" }, "files": [ "HISTORY.md", @@ -38,15 +38,15 @@ "test-cov": "istanbul cover node_modules/mocha/bin/_mocha -- --reporter dot --check-leaks test/", "test-travis": "istanbul cover node_modules/mocha/bin/_mocha --report lcovonly -- --reporter spec --check-leaks test/" }, - "gitHead": "1ad808e704e2aeda3a7464b78cacead2fb453727", + "gitHead": "fcd56f5674721cac92a16eff93547929716f5192", "bugs": { "url": "https://github.com/jshttp/on-finished/issues" }, "homepage": "https://github.com/jshttp/on-finished", - "_id": "on-finished@2.1.0", - "_shasum": "0c539f09291e8ffadde0c8a25850fb2cedc7022d", - "_from": "on-finished@2.1.0", - "_npmVersion": "1.4.21", + "_id": "on-finished@2.2.0", + "_shasum": "e6ba6a09a3482d6b7969bc3da92c86f0a967605e", + "_from": "on-finished@~2.2.0", + "_npmVersion": "1.4.28", "_npmUser": { "name": "dougwilson", "email": "doug@somethingdoug.com" @@ -62,9 +62,9 @@ } ], "dist": { - "shasum": "0c539f09291e8ffadde0c8a25850fb2cedc7022d", - "tarball": "http://registry.npmjs.org/on-finished/-/on-finished-2.1.0.tgz" + "shasum": "e6ba6a09a3482d6b7969bc3da92c86f0a967605e", + "tarball": "http://registry.npmjs.org/on-finished/-/on-finished-2.2.0.tgz" }, "directories": {}, - "_resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.1.0.tgz" + "_resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.2.0.tgz" } diff --git a/node_modules/body-parser/node_modules/qs/CHANGELOG.md b/node_modules/body-parser/node_modules/qs/CHANGELOG.md index ed42edc..f5ee8b4 100644 --- a/node_modules/body-parser/node_modules/qs/CHANGELOG.md +++ b/node_modules/body-parser/node_modules/qs/CHANGELOG.md @@ -1,4 +1,25 @@ +## [**2.3.3**](https://github.com/hapijs/qs/issues?milestone=18&state=open) +- [**#59**](https://github.com/hapijs/qs/issues/59) make sure array indexes are >= 0, closes #57 +- [**#58**](https://github.com/hapijs/qs/issues/58) make qs usable for browser loader + +## [**2.3.2**](https://github.com/hapijs/qs/issues?milestone=17&state=closed) +- [**#55**](https://github.com/hapijs/qs/issues/55) allow merging a string into an object + +## [**2.3.1**](https://github.com/hapijs/qs/issues?milestone=16&state=closed) +- [**#52**](https://github.com/hapijs/qs/issues/52) Return "undefined" and "false" instead of throwing "TypeError". + +## [**2.3.0**](https://github.com/hapijs/qs/issues?milestone=15&state=closed) +- [**#50**](https://github.com/hapijs/qs/issues/50) add option to omit array indices, closes #46 + +## [**2.2.5**](https://github.com/hapijs/qs/issues?milestone=14&state=closed) +- [**#39**](https://github.com/hapijs/qs/issues/39) Is there an alternative to Buffer.isBuffer? +- [**#49**](https://github.com/hapijs/qs/issues/49) refactor utils.merge, fixes #45 +- [**#41**](https://github.com/hapijs/qs/issues/41) avoid browserifying Buffer, for #39 + +## [**2.2.4**](https://github.com/hapijs/qs/issues?milestone=13&state=closed) +- [**#38**](https://github.com/hapijs/qs/issues/38) how to handle object keys beginning with a number + ## [**2.2.3**](https://github.com/hapijs/qs/issues?milestone=12&state=closed) - [**#37**](https://github.com/hapijs/qs/issues/37) parser discards first empty value in array - [**#36**](https://github.com/hapijs/qs/issues/36) Update to lab 4.x diff --git a/node_modules/body-parser/node_modules/qs/Makefile b/node_modules/body-parser/node_modules/qs/Makefile index 600a700..31cc899 100644 --- a/node_modules/body-parser/node_modules/qs/Makefile +++ b/node_modules/body-parser/node_modules/qs/Makefile @@ -1,8 +1,8 @@ test: - @node node_modules/lab/bin/lab + @node node_modules/lab/bin/lab -a code -L test-cov: - @node node_modules/lab/bin/lab -t 100 + @node node_modules/lab/bin/lab -a code -t 100 -L test-cov-html: - @node node_modules/lab/bin/lab -r html -o coverage.html + @node node_modules/lab/bin/lab -a code -L -r html -o coverage.html -.PHONY: test test-cov test-cov-html \ No newline at end of file +.PHONY: test test-cov test-cov-html diff --git a/node_modules/body-parser/node_modules/qs/README.md b/node_modules/body-parser/node_modules/qs/README.md index a6f99ab..21bf3fa 100755 --- a/node_modules/body-parser/node_modules/qs/README.md +++ b/node_modules/body-parser/node_modules/qs/README.md @@ -153,6 +153,8 @@ Qs.parse('a[1]=b', { arrayLimit: 0 }); // { a: { '1': 'b' } } ``` +To disable array parsing entirely, set `arrayLimit` to `-1`. + If you mix notations, **qs** will merge the two items into an object: ```javascript @@ -184,13 +186,20 @@ Qs.stringify({ a: { b: 'c' } }); Examples beyond this point will be shown as though the output is not URI encoded for clarity. Please note that the return values in these cases *will* be URI encoded during real usage. -When arrays are stringified, they are always given explicit indices: +When arrays are stringified, by default they are given explicit indices: ```javascript Qs.stringify({ a: ['b', 'c', 'd'] }); // 'a[0]=b&a[1]=c&a[2]=d' ``` +You may override this by setting the `indices` option to `false`: + +```javascript +Qs.stringify({ a: ['b', 'c', 'd'] }, { indices: false }); +// 'a=b&a=c&a=d' +``` + Empty strings and null values will omit the value, but the equals sign (=) remains in place: ```javascript diff --git a/node_modules/body-parser/node_modules/qs/index.js b/node_modules/body-parser/node_modules/qs/index.js index bb0a047..2291cd8 100644 --- a/node_modules/body-parser/node_modules/qs/index.js +++ b/node_modules/body-parser/node_modules/qs/index.js @@ -1 +1 @@ -module.exports = require('./lib'); +module.exports = require('./lib/'); diff --git a/node_modules/body-parser/node_modules/qs/lib/parse.js b/node_modules/body-parser/node_modules/qs/lib/parse.js index 3627397..4e7d02a 100755 --- a/node_modules/body-parser/node_modules/qs/lib/parse.js +++ b/node_modules/body-parser/node_modules/qs/lib/parse.js @@ -62,6 +62,7 @@ internals.parseObject = function (chain, val, options) { if (!isNaN(index) && root !== cleanRoot && indexString === cleanRoot && + index >= 0 && index <= options.arrayLimit) { obj = []; diff --git a/node_modules/body-parser/node_modules/qs/lib/stringify.js b/node_modules/body-parser/node_modules/qs/lib/stringify.js index 582577a..b441104 100755 --- a/node_modules/body-parser/node_modules/qs/lib/stringify.js +++ b/node_modules/body-parser/node_modules/qs/lib/stringify.js @@ -6,11 +6,12 @@ var Utils = require('./utils'); // Declare internals var internals = { - delimiter: '&' + delimiter: '&', + indices: true }; -internals.stringify = function (obj, prefix) { +internals.stringify = function (obj, prefix, options) { if (Utils.isBuffer(obj)) { obj = obj.toString(); @@ -31,9 +32,20 @@ internals.stringify = function (obj, prefix) { var values = []; - for (var key in obj) { - if (obj.hasOwnProperty(key)) { - values = values.concat(internals.stringify(obj[key], prefix + '[' + key + ']')); + if (typeof obj === 'undefined') { + return values; + } + + var objKeys = Object.keys(obj); + for (var i = 0, il = objKeys.length; i < il; ++i) { + var key = objKeys[i]; + if (!options.indices && + Array.isArray(obj)) { + + values = values.concat(internals.stringify(obj[key], prefix, options)); + } + else { + values = values.concat(internals.stringify(obj[key], prefix + '[' + key + ']', options)); } } @@ -45,13 +57,20 @@ module.exports = function (obj, options) { options = options || {}; var delimiter = typeof options.delimiter === 'undefined' ? internals.delimiter : options.delimiter; + options.indices = typeof options.indices === 'boolean' ? options.indices : internals.indices; var keys = []; - for (var key in obj) { - if (obj.hasOwnProperty(key)) { - keys = keys.concat(internals.stringify(obj[key], key)); - } + if (typeof obj !== 'object' || + obj === null) { + + return ''; + } + + var objKeys = Object.keys(obj); + for (var i = 0, il = objKeys.length; i < il; ++i) { + var key = objKeys[i]; + keys = keys.concat(internals.stringify(obj[key], key, options)); } return keys.join(delimiter); diff --git a/node_modules/body-parser/node_modules/qs/lib/utils.js b/node_modules/body-parser/node_modules/qs/lib/utils.js index c0b915d..5240bd5 100755 --- a/node_modules/body-parser/node_modules/qs/lib/utils.js +++ b/node_modules/body-parser/node_modules/qs/lib/utils.js @@ -26,29 +26,26 @@ exports.merge = function (target, source) { return target; } - if (Array.isArray(source)) { - for (var i = 0, il = source.length; i < il; ++i) { - if (typeof source[i] !== 'undefined') { - if (typeof target[i] === 'object') { - target[i] = exports.merge(target[i], source[i]); - } - else { - target[i] = source[i]; - } - } + if (typeof source !== 'object') { + if (Array.isArray(target)) { + target.push(source); + } + else { + target[source] = true; } return target; } - if (Array.isArray(target)) { - if (typeof source !== 'object') { - target.push(source); - return target; - } - else { - target = exports.arrayToObject(target); - } + if (typeof target !== 'object') { + target = [target].concat(source); + return target; + } + + if (Array.isArray(target) && + !Array.isArray(source)) { + + target = exports.arrayToObject(target); } var keys = Object.keys(source); @@ -56,18 +53,11 @@ exports.merge = function (target, source) { var key = keys[k]; var value = source[key]; - if (value && - typeof value === 'object') { - - if (!target[key]) { - target[key] = value; - } - else { - target[key] = exports.merge(target[key], value); - } + if (!target[key]) { + target[key] = value; } else { - target[key] = value; + target[key] = exports.merge(target[key], value); } } @@ -104,7 +94,7 @@ exports.compact = function (obj, refs) { if (Array.isArray(obj)) { var compacted = []; - for (var i = 0, l = obj.length; i < l; ++i) { + for (var i = 0, il = obj.length; i < il; ++i) { if (typeof obj[i] !== 'undefined') { compacted.push(obj[i]); } @@ -114,7 +104,7 @@ exports.compact = function (obj, refs) { } var keys = Object.keys(obj); - for (var i = 0, il = keys.length; i < il; ++i) { + for (i = 0, il = keys.length; i < il; ++i) { var key = keys[i]; obj[key] = exports.compact(obj[key], refs); } @@ -130,10 +120,13 @@ exports.isRegExp = function (obj) { exports.isBuffer = function (obj) { - if (typeof Buffer !== 'undefined') { - return Buffer.isBuffer(obj); - } - else { + if (obj === null || + typeof obj === 'undefined') { + return false; } + + return !!(obj.constructor && + obj.constructor.isBuffer && + obj.constructor.isBuffer(obj)); }; diff --git a/node_modules/body-parser/node_modules/qs/package.json b/node_modules/body-parser/node_modules/qs/package.json old mode 100755 new mode 100644 index e30cd41..607211f --- a/node_modules/body-parser/node_modules/qs/package.json +++ b/node_modules/body-parser/node_modules/qs/package.json @@ -1,12 +1,13 @@ { "name": "qs", - "version": "2.2.4", + "version": "2.3.3", "description": "A querystring parser that supports nesting and arrays, with a depth limit", "homepage": "https://github.com/hapijs/qs", "main": "index.js", "dependencies": {}, "devDependencies": { - "lab": "4.x.x" + "code": "1.x.x", + "lab": "5.x.x" }, "scripts": { "test": "make test-cov" @@ -19,42 +20,19 @@ "querystring", "qs" ], - "author": { - "name": "Nathan LaFreniere", - "email": "quitlahok@gmail.com" - }, "licenses": [ { "type": "BSD", "url": "http://github.com/hapijs/qs/raw/master/LICENSE" } ], - "gitHead": "9775242fa57cbfa4db62e4b0aa4f82b23e2ce6af", + "readme": "# qs\n\nA querystring parsing and stringifying library with some added security.\n\n[![Build Status](https://secure.travis-ci.org/hapijs/qs.svg)](http://travis-ci.org/hapijs/qs)\n\nLead Maintainer: [Nathan LaFreniere](https://github.com/nlf)\n\nThe **qs** module was originally created and maintained by [TJ Holowaychuk](https://github.com/visionmedia/node-querystring).\n\n## Usage\n\n```javascript\nvar Qs = require('qs');\n\nvar obj = Qs.parse('a=c'); // { a: 'c' }\nvar str = Qs.stringify(obj); // 'a=c'\n```\n\n### Parsing Objects\n\n```javascript\nQs.parse(string, [options]);\n```\n\n**qs** allows you to create nested objects within your query strings, by surrounding the name of sub-keys with square brackets `[]`.\nFor example, the string `'foo[bar]=baz'` converts to:\n\n```javascript\n{\n foo: {\n bar: 'baz'\n }\n}\n```\n\nURI encoded strings work too:\n\n```javascript\nQs.parse('a%5Bb%5D=c');\n// { a: { b: 'c' } }\n```\n\nYou can also nest your objects, like `'foo[bar][baz]=foobarbaz'`:\n\n```javascript\n{\n foo: {\n bar: {\n baz: 'foobarbaz'\n }\n }\n}\n```\n\nBy default, when nesting objects **qs** will only parse up to 5 children deep. This means if you attempt to parse a string like\n`'a[b][c][d][e][f][g][h][i]=j'` your resulting object will be:\n\n```javascript\n{\n a: {\n b: {\n c: {\n d: {\n e: {\n f: {\n '[g][h][i]': 'j'\n }\n }\n }\n }\n }\n }\n}\n```\n\nThis depth can be overridden by passing a `depth` option to `Qs.parse(string, [options])`:\n\n```javascript\nQs.parse('a[b][c][d][e][f][g][h][i]=j', { depth: 1 });\n// { a: { b: { '[c][d][e][f][g][h][i]': 'j' } } }\n```\n\nThe depth limit helps mitigate abuse when **qs** is used to parse user input, and it is recommended to keep it a reasonably small number.\n\nFor similar reasons, by default **qs** will only parse up to 1000 parameters. This can be overridden by passing a `parameterLimit` option:\n\n```javascript\nQs.parse('a=b&c=d', { parameterLimit: 1 });\n// { a: 'b' }\n```\n\nAn optional delimiter can also be passed:\n\n```javascript\nQs.parse('a=b;c=d', { delimiter: ';' });\n// { a: 'b', c: 'd' }\n```\n\nDelimiters can be a regular expression too:\n\n```javascript\nQs.parse('a=b;c=d,e=f', { delimiter: /[;,]/ });\n// { a: 'b', c: 'd', e: 'f' }\n```\n\n### Parsing Arrays\n\n**qs** can also parse arrays using a similar `[]` notation:\n\n```javascript\nQs.parse('a[]=b&a[]=c');\n// { a: ['b', 'c'] }\n```\n\nYou may specify an index as well:\n\n```javascript\nQs.parse('a[1]=c&a[0]=b');\n// { a: ['b', 'c'] }\n```\n\nNote that the only difference between an index in an array and a key in an object is that the value between the brackets must be a number\nto create an array. When creating arrays with specific indices, **qs** will compact a sparse array to only the existing values preserving\ntheir order:\n\n```javascript\nQs.parse('a[1]=b&a[15]=c');\n// { a: ['b', 'c'] }\n```\n\nNote that an empty string is also a value, and will be preserved:\n\n```javascript\nQs.parse('a[]=&a[]=b');\n// { a: ['', 'b'] }\nQs.parse('a[0]=b&a[1]=&a[2]=c');\n// { a: ['b', '', 'c'] }\n```\n\n**qs** will also limit specifying indices in an array to a maximum index of `20`. Any array members with an index of greater than `20` will\ninstead be converted to an object with the index as the key:\n\n```javascript\nQs.parse('a[100]=b');\n// { a: { '100': 'b' } }\n```\n\nThis limit can be overridden by passing an `arrayLimit` option:\n\n```javascript\nQs.parse('a[1]=b', { arrayLimit: 0 });\n// { a: { '1': 'b' } }\n```\n\nTo disable array parsing entirely, set `arrayLimit` to `-1`.\n\nIf you mix notations, **qs** will merge the two items into an object:\n\n```javascript\nQs.parse('a[0]=b&a[b]=c');\n// { a: { '0': 'b', b: 'c' } }\n```\n\nYou can also create arrays of objects:\n\n```javascript\nQs.parse('a[][b]=c');\n// { a: [{ b: 'c' }] }\n```\n\n### Stringifying\n\n```javascript\nQs.stringify(object, [options]);\n```\n\nWhen stringifying, **qs** always URI encodes output. Objects are stringified as you would expect:\n\n```javascript\nQs.stringify({ a: 'b' });\n// 'a=b'\nQs.stringify({ a: { b: 'c' } });\n// 'a%5Bb%5D=c'\n```\n\nExamples beyond this point will be shown as though the output is not URI encoded for clarity. Please note that the return values in these cases *will* be URI encoded during real usage.\n\nWhen arrays are stringified, by default they are given explicit indices:\n\n```javascript\nQs.stringify({ a: ['b', 'c', 'd'] });\n// 'a[0]=b&a[1]=c&a[2]=d'\n```\n\nYou may override this by setting the `indices` option to `false`:\n\n```javascript\nQs.stringify({ a: ['b', 'c', 'd'] }, { indices: false });\n// 'a=b&a=c&a=d'\n```\n\nEmpty strings and null values will omit the value, but the equals sign (=) remains in place:\n\n```javascript\nQs.stringify({ a: '' });\n// 'a='\n```\n\nProperties that are set to `undefined` will be omitted entirely:\n\n```javascript\nQs.stringify({ a: null, b: undefined });\n// 'a='\n```\n\nThe delimiter may be overridden with stringify as well:\n\n```javascript\nQs.stringify({ a: 'b', c: 'd' }, { delimiter: ';' });\n// 'a=b;c=d'\n```\n", + "readmeFilename": "README.md", "bugs": { "url": "https://github.com/hapijs/qs/issues" }, - "_id": "qs@2.2.4", - "_shasum": "2e9fbcd34b540e3421c924ecd01e90aa975319c8", - "_from": "qs@2.2.4", - "_npmVersion": "1.4.23", - "_npmUser": { - "name": "nlf", - "email": "quitlahok@gmail.com" - }, - "maintainers": [ - { - "name": "nlf", - "email": "quitlahok@gmail.com" - }, - { - "name": "hueniverse", - "email": "eran@hueniverse.com" - } - ], - "dist": { - "shasum": "2e9fbcd34b540e3421c924ecd01e90aa975319c8", - "tarball": "http://registry.npmjs.org/qs/-/qs-2.2.4.tgz" - }, - "directories": {}, - "_resolved": "https://registry.npmjs.org/qs/-/qs-2.2.4.tgz" + "_id": "qs@2.3.3", + "_shasum": "e9e85adbe75da0bbe4c8e0476a086290f863b404", + "_from": "qs@2.3.3", + "_resolved": "https://registry.npmjs.org/qs/-/qs-2.3.3.tgz" } diff --git a/node_modules/body-parser/node_modules/qs/test/parse.js b/node_modules/body-parser/node_modules/qs/test/parse.js index 22083f6..6c20cc1 100755 --- a/node_modules/body-parser/node_modules/qs/test/parse.js +++ b/node_modules/body-parser/node_modules/qs/test/parse.js @@ -1,5 +1,7 @@ +/* eslint no-extend-native:0 */ // Load modules +var Code = require('code'); var Lab = require('lab'); var Qs = require('../'); @@ -12,14 +14,12 @@ var internals = {}; // Test shortcuts var lab = exports.lab = Lab.script(); -var expect = Lab.expect; -var before = lab.before; -var after = lab.after; +var expect = Code.expect; var describe = lab.experiment; var it = lab.test; -describe('#parse', function () { +describe('parse()', function () { it('parses a simple string', function (done) { @@ -82,6 +82,17 @@ describe('#parse', function () { done(); }); + it('parses a mix of simple and explicit arrays', function (done) { + + expect(Qs.parse('a=b&a[]=c')).to.deep.equal({ a: ['b', 'c'] }); + expect(Qs.parse('a[]=b&a=c')).to.deep.equal({ a: ['b', 'c'] }); + expect(Qs.parse('a[0]=b&a=c')).to.deep.equal({ a: ['b', 'c'] }); + expect(Qs.parse('a=b&a[0]=c')).to.deep.equal({ a: ['b', 'c'] }); + expect(Qs.parse('a[1]=b&a=c')).to.deep.equal({ a: ['b', 'c'] }); + expect(Qs.parse('a=b&a[1]=c')).to.deep.equal({ a: ['b', 'c'] }); + done(); + }); + it('parses a nested array', function (done) { expect(Qs.parse('a[b][]=c&a[b][]=d')).to.deep.equal({ a: { b: ['c', 'd'] } }); @@ -149,6 +160,12 @@ describe('#parse', function () { done(); }); + it('can add keys to objects', function (done) { + + expect(Qs.parse('a[b]=c&a=d')).to.deep.equal({ a: { b: 'c', d: true } }); + done(); + }); + it('correctly prunes undefined values when converting an array to an object', function (done) { expect(Qs.parse('a[2]=b&a[99999999]=c')).to.deep.equal({ a: { '2': 'b', '99999999': 'c' } }); @@ -287,6 +304,8 @@ describe('#parse', function () { it('allows overriding array limit', function (done) { + expect(Qs.parse('a[0]=b', { arrayLimit: -1 })).to.deep.equal({ a: { '0': 'b' } }); + expect(Qs.parse('a[-1]=b', { arrayLimit: -1 })).to.deep.equal({ a: { '-1': 'b' } }); expect(Qs.parse('a[0]=b&a[1]=c', { arrayLimit: 0 })).to.deep.equal({ a: { '0': 'b', '1': 'c' } }); done(); }); @@ -294,14 +313,14 @@ describe('#parse', function () { it('parses an object', function (done) { var input = { - "user[name]": {"pop[bob]": 3}, - "user[email]": null + 'user[name]': {'pop[bob]': 3}, + 'user[email]': null }; var expected = { - "user": { - "name": {"pop[bob]": 3}, - "email": null + 'user': { + 'name': {'pop[bob]': 3}, + 'email': null } }; @@ -314,14 +333,14 @@ describe('#parse', function () { it('parses an object and not child values', function (done) { var input = { - "user[name]": {"pop[bob]": { "test": 3 }}, - "user[email]": null + 'user[name]': {'pop[bob]': { 'test': 3 }}, + 'user[email]': null }; var expected = { - "user": { - "name": {"pop[bob]": { "test": 3 }}, - "email": null + 'user': { + 'name': {'pop[bob]': { 'test': 3 }}, + 'email': null } }; @@ -335,8 +354,9 @@ describe('#parse', function () { var tempBuffer = global.Buffer; delete global.Buffer; - expect(Qs.parse('a=b&c=d')).to.deep.equal({ a: 'b', c: 'd' }); + var result = Qs.parse('a=b&c=d'); global.Buffer = tempBuffer; + expect(result).to.deep.equal({ a: 'b', c: 'd' }); done(); }); @@ -356,10 +376,10 @@ describe('#parse', function () { expect(function () { parsed = Qs.parse({ 'foo[bar]': 'baz', 'foo[baz]': a }); - }).to.not.throw(Error); + }).to.not.throw(); - expect(parsed).to.have.key('foo'); - expect(parsed.foo).to.have.keys('bar', 'baz'); + expect(parsed).to.contain('foo'); + expect(parsed.foo).to.contain('bar', 'baz'); expect(parsed.foo.bar).to.equal('baz'); expect(parsed.foo.baz).to.deep.equal(a); done(); @@ -369,9 +389,11 @@ describe('#parse', function () { var a = Object.create(null); a.b = 'c'; - + expect(Qs.parse(a)).to.deep.equal({ b: 'c' }); - expect(Qs.parse({ a: a })).to.deep.equal({ a: { b: 'c' } }); + var result = Qs.parse({ a: a }); + expect(result).to.contain('a'); + expect(result.a).to.deep.equal(a); done(); }); diff --git a/node_modules/body-parser/node_modules/qs/test/stringify.js b/node_modules/body-parser/node_modules/qs/test/stringify.js index b96b52b..75e397a 100755 --- a/node_modules/body-parser/node_modules/qs/test/stringify.js +++ b/node_modules/body-parser/node_modules/qs/test/stringify.js @@ -1,5 +1,7 @@ +/* eslint no-extend-native:0 */ // Load modules +var Code = require('code'); var Lab = require('lab'); var Qs = require('../'); @@ -12,14 +14,12 @@ var internals = {}; // Test shortcuts var lab = exports.lab = Lab.script(); -var expect = Lab.expect; -var before = lab.before; -var after = lab.after; +var expect = Code.expect; var describe = lab.experiment; var it = lab.test; -describe('#stringify', function () { +describe('stringify()', function () { it('stringifies a querystring object', function (done) { @@ -42,6 +42,12 @@ describe('#stringify', function () { done(); }); + it('omits array indices when asked', function (done) { + + expect(Qs.stringify({ a: ['b', 'c', 'd'] }, { indices: false })).to.equal('a=b&a=c&a=d'); + done(); + }); + it('stringifies a nested array value', function (done) { expect(Qs.stringify({ a: { b: ['c', 'd'] } })).to.equal('a%5Bb%5D%5B0%5D=c&a%5Bb%5D%5B1%5D=d'); @@ -55,6 +61,12 @@ describe('#stringify', function () { done(); }); + it('does not omit object keys when indices = false', function (done) { + + expect(Qs.stringify({ a: [{ b: 'c' }] }, { indices: false })).to.equal('a%5Bb%5D=c'); + done(); + }); + it('stringifies a complicated object', function (done) { expect(Qs.stringify({ a: { b: 'c', d: 'e' } })).to.equal('a%5Bb%5D=c&a%5Bd%5D=e'); @@ -70,6 +82,34 @@ describe('#stringify', function () { done(); }); + it('stringifies an empty object', function (done) { + + var obj = Object.create(null); + obj.a = 'b'; + expect(Qs.stringify(obj)).to.equal('a=b'); + done(); + }); + + it('returns an empty string for invalid input', function (done) { + + expect(Qs.stringify(undefined)).to.equal(''); + expect(Qs.stringify(false)).to.equal(''); + expect(Qs.stringify(null)).to.equal(''); + expect(Qs.stringify('')).to.equal(''); + done(); + }); + + it('stringifies an object with an empty object as a child', function (done) { + + var obj = { + a: Object.create(null) + }; + + obj.a.b = 'c'; + expect(Qs.stringify(obj)).to.equal('a%5Bb%5D=c'); + done(); + }); + it('drops keys with a value of undefined', function (done) { expect(Qs.stringify({ a: undefined })).to.equal(''); diff --git a/node_modules/body-parser/node_modules/raw-body/HISTORY.md b/node_modules/body-parser/node_modules/raw-body/HISTORY.md index 7772dcc..9bf7d86 100644 --- a/node_modules/body-parser/node_modules/raw-body/HISTORY.md +++ b/node_modules/body-parser/node_modules/raw-body/HISTORY.md @@ -1,3 +1,21 @@ +1.3.3 / 2015-02-08 +================== + + * deps: iconv-lite@0.4.7 + - Gracefully support enumerables on `Object.prototype` + +1.3.2 / 2015-01-20 +================== + + * deps: iconv-lite@0.4.6 + - Fix rare aliases of single-byte encodings + +1.3.1 / 2014-11-21 +================== + + * deps: iconv-lite@0.4.5 + - Fix Windows-31J and X-SJIS encoding support + 1.3.0 / 2014-07-20 ================== diff --git a/node_modules/body-parser/node_modules/raw-body/LICENSE b/node_modules/body-parser/node_modules/raw-body/LICENSE new file mode 100644 index 0000000..1af6bb3 --- /dev/null +++ b/node_modules/body-parser/node_modules/raw-body/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2013 Jonathan Ong me@jongleberry.com + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/node_modules/body-parser/node_modules/raw-body/README.md b/node_modules/body-parser/node_modules/raw-body/README.md index e95d000..9b610b2 100644 --- a/node_modules/body-parser/node_modules/raw-body/README.md +++ b/node_modules/body-parser/node_modules/raw-body/README.md @@ -1,8 +1,11 @@ # raw-body -[![NPM version](https://badge.fury.io/js/raw-body.svg)](http://badge.fury.io/js/raw-body) -[![Build Status](https://travis-ci.org/stream-utils/raw-body.svg?branch=master)](https://travis-ci.org/stream-utils/raw-body) -[![Coverage Status](https://img.shields.io/coveralls/stream-utils/raw-body.svg?branch=master)](https://coveralls.io/r/stream-utils/raw-body) +[![NPM version][npm-image]][npm-url] +[![Build status][travis-image]][travis-url] +[![Test coverage][coveralls-image]][coveralls-url] +[![Dependency Status][david-image]][david-url] +[![License][license-image]][license-url] +[![Downloads][downloads-image]][downloads-url] Gets the entire buffer of a stream either as a `Buffer` or a string. Validates the stream's length against an expected length and maximum limit. @@ -78,26 +81,15 @@ and you are responsible for correctly disposing the stream. For HTTP requests, no handling is required if you send a response. For streams that use file descriptors, you should `stream.destroy()` or `stream.close()` to prevent leaks. -## License - -The MIT License (MIT) - -Copyright (c) 2013 Jonathan Ong me@jongleberry.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. +[npm-image]: https://img.shields.io/npm/v/raw-body.svg?style=flat-square +[npm-url]: https://npmjs.org/package/raw-body +[travis-image]: https://img.shields.io/travis/stream-utils/raw-body.svg?style=flat-square +[travis-url]: https://travis-ci.org/stream-utils/raw-body +[coveralls-image]: https://img.shields.io/coveralls/stream-utils/raw-body.svg?style=flat-square +[coveralls-url]: https://coveralls.io/r/stream-utils/raw-body +[david-image]: http://img.shields.io/david/stream-utils/raw-body.svg?style=flat-square +[david-url]: https://david-dm.org/stream-utils/raw-body +[license-image]: http://img.shields.io/npm/l/raw-body.svg?style=flat-square +[license-url]: LICENSE +[downloads-image]: http://img.shields.io/npm/dm/raw-body.svg?style=flat-square +[downloads-url]: https://npmjs.org/package/raw-body diff --git a/node_modules/body-parser/node_modules/raw-body/package.json b/node_modules/body-parser/node_modules/raw-body/package.json index 51c1eb8..096cdd4 100644 --- a/node_modules/body-parser/node_modules/raw-body/package.json +++ b/node_modules/body-parser/node_modules/raw-body/package.json @@ -1,7 +1,7 @@ { "name": "raw-body", "description": "Get and validate the raw body of a readable stream.", - "version": "1.3.0", + "version": "1.3.3", "author": { "name": "Jonathan Ong", "email": "me@jongleberry.com", @@ -20,37 +20,41 @@ "license": "MIT", "repository": { "type": "git", - "url": "git://github.com/stream-utils/raw-body" + "url": "https://github.com/stream-utils/raw-body" }, "dependencies": { - "bytes": "1", - "iconv-lite": "0.4.4" + "bytes": "1.0.0", + "iconv-lite": "0.4.7" }, "devDependencies": { - "istanbul": "0.3.0", - "mocha": "~1.20.1", - "readable-stream": "~1.0.17", - "through2": "~0.5.1" + "istanbul": "0.3.5", + "mocha": "~2.1.0", + "readable-stream": "~1.0.33", + "through2": "0.6.3" }, "engines": { "node": ">= 0.8.0" }, + "files": [ + "HISTORY.md", + "LICENSE", + "README.md", + "index.js" + ], "scripts": { "test": "mocha --reporter spec --bail test/", "test-cov": "istanbul cover node_modules/mocha/bin/_mocha -- --reporter dot test/", "test-travis": "istanbul cover node_modules/mocha/bin/_mocha --report lcovonly -- --reporter spec test/" }, + "gitHead": "54a27e595f513e03007be907dca4e7e57c88257f", "bugs": { "url": "https://github.com/stream-utils/raw-body/issues" }, "homepage": "https://github.com/stream-utils/raw-body", - "_id": "raw-body@1.3.0", - "dist": { - "shasum": "978230a156a5548f42eef14de22d0f4f610083d1", - "tarball": "http://registry.npmjs.org/raw-body/-/raw-body-1.3.0.tgz" - }, - "_from": "raw-body@1.3.0", - "_npmVersion": "1.4.3", + "_id": "raw-body@1.3.3", + "_shasum": "8841af3f64ad50a351dc77f229118b40c28fa58c", + "_from": "raw-body@1.3.3", + "_npmVersion": "1.4.28", "_npmUser": { "name": "dougwilson", "email": "doug@somethingdoug.com" @@ -65,7 +69,10 @@ "email": "doug@somethingdoug.com" } ], + "dist": { + "shasum": "8841af3f64ad50a351dc77f229118b40c28fa58c", + "tarball": "http://registry.npmjs.org/raw-body/-/raw-body-1.3.3.tgz" + }, "directories": {}, - "_shasum": "978230a156a5548f42eef14de22d0f4f610083d1", - "_resolved": "https://registry.npmjs.org/raw-body/-/raw-body-1.3.0.tgz" + "_resolved": "https://registry.npmjs.org/raw-body/-/raw-body-1.3.3.tgz" } diff --git a/node_modules/body-parser/node_modules/type-is/HISTORY.md b/node_modules/body-parser/node_modules/type-is/HISTORY.md index c8097f1..b806aa3 100644 --- a/node_modules/body-parser/node_modules/type-is/HISTORY.md +++ b/node_modules/body-parser/node_modules/type-is/HISTORY.md @@ -1,3 +1,46 @@ +1.6.0 / 2015-02-12 +================== + + * fix false-positives in `hasBody` `Transfer-Encoding` check + * support wildcard for both type and subtype (`*/*`) + +1.5.7 / 2015-02-09 +================== + + * fix argument reassignment + * deps: mime-types@~2.0.9 + - Add new mime types + +1.5.6 / 2015-01-29 +================== + + * deps: mime-types@~2.0.8 + - Add new mime types + +1.5.5 / 2014-12-30 +================== + + * deps: mime-types@~2.0.7 + - Add new mime types + - Fix missing extensions + - Fix various invalid MIME type entries + - Remove example template MIME types + - deps: mime-db@~1.5.0 + +1.5.4 / 2014-12-10 +================== + + * deps: mime-types@~2.0.4 + - Add new mime types + - deps: mime-db@~1.3.0 + +1.5.3 / 2014-11-09 +================== + + * deps: mime-types@~2.0.3 + - Add new mime types + - deps: mime-db@~1.2.0 + 1.5.2 / 2014-09-28 ================== diff --git a/node_modules/body-parser/node_modules/type-is/README.md b/node_modules/body-parser/node_modules/type-is/README.md index 99e5320..2e32a2b 100644 --- a/node_modules/body-parser/node_modules/type-is/README.md +++ b/node_modules/body-parser/node_modules/type-is/README.md @@ -41,15 +41,32 @@ is(req, ['application/json']) // 'application/json' is(req, ['html']) // false ``` -#### Each type can be: +### type = is.is(mediaType, types) + +`mediaType` is the [media type](https://tools.ietf.org/html/rfc6838) string. `types` is an array of types. + +```js +var mediaType = 'application/json' + +is.is(mediaType, ['json']) // 'json' +is.is(mediaType, ['html', 'json']) // 'json' +is.is(mediaType, ['application/*']) // 'application/json' +is.is(mediaType, ['application/json']) // 'application/json' + +is.is(mediaType, ['html']) // false +``` + +### Each type can be: - An extension name such as `json`. This name will be returned if matched. - A mime type such as `application/json`. -- A mime type with a wildcard such as `*/json` or `application/*`. The full mime type will be returned if matched +- A mime type with a wildcard such as `*/*` or `*/json` or `application/*`. The full mime type will be returned if matched. - A suffix such as `+json`. This can be combined with a wildcard such as `*/vnd+json` or `application/*+json`. The full mime type will be returned if matched. `false` will be returned if no type matches. +`null` will be returned if the request does not have a body. + ## Examples #### Example body parser diff --git a/node_modules/body-parser/node_modules/type-is/index.js b/node_modules/body-parser/node_modules/type-is/index.js index 8d220d1..f1060f4 100644 --- a/node_modules/body-parser/node_modules/type-is/index.js +++ b/node_modules/body-parser/node_modules/type-is/index.js @@ -27,10 +27,10 @@ function typeis(value, types_) { var types = types_ // remove parameters and normalize - value = typenormalize(value) + var val = typenormalize(value) // no type or invalid - if (!value) { + if (!val) { return false } @@ -43,13 +43,15 @@ function typeis(value, types_) { } // no types, return the content type - if (!types || !types.length) return value; + if (!types || !types.length) { + return val + } var type for (i = 0; i < types.length; i++) { - if (mimeMatch(normalize(type = types[i]), value)) { + if (mimeMatch(normalize(type = types[i]), val)) { return type[0] === '+' || ~type.indexOf('*') - ? value + ? val : type } } @@ -70,9 +72,8 @@ function typeis(value, types_) { */ function hasbody(req) { - var headers = req.headers; - if ('transfer-encoding' in headers) return true; - return !isNaN(headers['content-length']); + return req.headers['transfer-encoding'] !== undefined + || !isNaN(req.headers['content-length']) } /** @@ -141,15 +142,22 @@ function typeofrequest(req, types_) { function normalize(type) { switch (type) { - case 'urlencoded': return 'application/x-www-form-urlencoded'; + case 'urlencoded': + type = 'application/x-www-form-urlencoded' + break case 'multipart': - type = 'multipart/*'; - break; + type = 'multipart/*' + break + } + + if (type[0] === '+') { + // "+json" -> "*/*+json" expando + type = '*/*' + type } - return type[0] === '+' || ~type.indexOf('/') - ? type - : mime.lookup(type) + return type.indexOf('/') === -1 + ? mime.lookup(type) + : type } /** @@ -169,42 +177,32 @@ function mimeMatch(expected, actual) { return false } - // exact match - if (expected === actual) { - return true - } - - actual = actual.split('/'); + // split types + var actualParts = actual.split('/') + var expectedParts = expected.split('/') - if (expected[0] === '+') { - // support +suffix - return Boolean(actual[1]) - && expected.length <= actual[1].length - && expected === actual[1].substr(0 - expected.length) + // invalid format + if (actualParts.length !== 2 || expectedParts.length !== 2) { + return false } - if (!~expected.indexOf('*')) return false; - - expected = expected.split('/'); - - if (expected[0] === '*') { - // support */yyy - return expected[1] === actual[1] + // validate type + if (expectedParts[0] !== '*' && expectedParts[0] !== actualParts[0]) { + return false } - if (expected[1] === '*') { - // support xxx/* - return expected[0] === actual[0] + // validate suffix wildcard + if (expectedParts[1].substr(0, 2) === '*+') { + return expectedParts[1].length <= actualParts[1].length + 1 + && expectedParts[1].substr(1) === actualParts[1].substr(1 - expectedParts[1].length) } - if (expected[1][0] === '*' && expected[1][1] === '+') { - // support xxx/*+zzz - return expected[0] === actual[0] - && expected[1].length <= actual[1].length + 1 - && expected[1].substr(1) === actual[1].substr(1 - expected[1].length) + // validate subtype + if (expectedParts[1] !== '*' && expectedParts[1] !== actualParts[1]) { + return false } - return false + return true } /** diff --git a/node_modules/body-parser/node_modules/media-typer/HISTORY.md b/node_modules/body-parser/node_modules/type-is/node_modules/media-typer/HISTORY.md similarity index 100% rename from node_modules/body-parser/node_modules/media-typer/HISTORY.md rename to node_modules/body-parser/node_modules/type-is/node_modules/media-typer/HISTORY.md diff --git a/node_modules/body-parser/node_modules/media-typer/LICENSE b/node_modules/body-parser/node_modules/type-is/node_modules/media-typer/LICENSE similarity index 100% rename from node_modules/body-parser/node_modules/media-typer/LICENSE rename to node_modules/body-parser/node_modules/type-is/node_modules/media-typer/LICENSE diff --git a/node_modules/body-parser/node_modules/media-typer/README.md b/node_modules/body-parser/node_modules/type-is/node_modules/media-typer/README.md similarity index 100% rename from node_modules/body-parser/node_modules/media-typer/README.md rename to node_modules/body-parser/node_modules/type-is/node_modules/media-typer/README.md diff --git a/node_modules/body-parser/node_modules/media-typer/index.js b/node_modules/body-parser/node_modules/type-is/node_modules/media-typer/index.js similarity index 100% rename from node_modules/body-parser/node_modules/media-typer/index.js rename to node_modules/body-parser/node_modules/type-is/node_modules/media-typer/index.js diff --git a/node_modules/body-parser/node_modules/media-typer/package.json b/node_modules/body-parser/node_modules/type-is/node_modules/media-typer/package.json similarity index 100% rename from node_modules/body-parser/node_modules/media-typer/package.json rename to node_modules/body-parser/node_modules/type-is/node_modules/media-typer/package.json diff --git a/node_modules/body-parser/node_modules/type-is/node_modules/mime-types/HISTORY.md b/node_modules/body-parser/node_modules/type-is/node_modules/mime-types/HISTORY.md index 6071381..da8b3f8 100644 --- a/node_modules/body-parser/node_modules/type-is/node_modules/mime-types/HISTORY.md +++ b/node_modules/body-parser/node_modules/type-is/node_modules/mime-types/HISTORY.md @@ -1,3 +1,49 @@ +2.0.9 / 2015-02-09 +================== + + * deps: mime-db@~1.7.0 + - Add new mime types + - Community extensions ownership transferred from `node-mime` + +2.0.8 / 2015-01-29 +================== + + * deps: mime-db@~1.6.0 + - Add new mime types + +2.0.7 / 2014-12-30 +================== + + * deps: mime-db@~1.5.0 + - Add new mime types + - Fix various invalid MIME type entries + +2.0.6 / 2014-12-30 +================== + + * deps: mime-db@~1.4.0 + - Add new mime types + - Fix various invalid MIME type entries + - Remove example template MIME types + +2.0.5 / 2014-12-29 +================== + + * deps: mime-db@~1.3.1 + - Fix missing extensions + +2.0.4 / 2014-12-10 +================== + + * deps: mime-db@~1.3.0 + - Add new mime types + +2.0.3 / 2014-11-09 +================== + + * deps: mime-db@~1.2.0 + - Add new mime types + 2.0.2 / 2014-09-28 ================== diff --git a/node_modules/body-parser/node_modules/type-is/node_modules/mime-types/node_modules/mime-db/HISTORY.md b/node_modules/body-parser/node_modules/type-is/node_modules/mime-types/node_modules/mime-db/HISTORY.md new file mode 100644 index 0000000..e5ffba4 --- /dev/null +++ b/node_modules/body-parser/node_modules/type-is/node_modules/mime-types/node_modules/mime-db/HISTORY.md @@ -0,0 +1,166 @@ +1.7.0 / 2015-02-08 +================== + + * Add `application/vnd.gerber` + * Add `application/vnd.msa-disk-image` + +1.6.1 / 2015-02-05 +================== + + * Community extensions ownership transferred from `node-mime` + +1.6.0 / 2015-01-29 +================== + + * Add `application/jose` + * Add `application/jose+json` + * Add `application/json-seq` + * Add `application/jwk+json` + * Add `application/jwk-set+json` + * Add `application/jwt` + * Add `application/rdap+json` + * Add `application/vnd.gov.sk.e-form+xml` + * Add `application/vnd.ims.imsccv1p3` + +1.5.0 / 2014-12-30 +================== + + * Add `application/vnd.oracle.resource+json` + * Fix various invalid MIME type entries + - `application/mbox+xml` + - `application/oscp-response` + - `application/vwg-multiplexed` + - `audio/g721` + +1.4.0 / 2014-12-21 +================== + + * Add `application/vnd.ims.imsccv1p2` + * Fix various invalid MIME type entries + - `application/vnd-acucobol` + - `application/vnd-curl` + - `application/vnd-dart` + - `application/vnd-dxr` + - `application/vnd-fdf` + - `application/vnd-mif` + - `application/vnd-sema` + - `application/vnd-wap-wmlc` + - `application/vnd.adobe.flash-movie` + - `application/vnd.dece-zip` + - `application/vnd.dvb_service` + - `application/vnd.micrografx-igx` + - `application/vnd.sealed-doc` + - `application/vnd.sealed-eml` + - `application/vnd.sealed-mht` + - `application/vnd.sealed-ppt` + - `application/vnd.sealed-tiff` + - `application/vnd.sealed-xls` + - `application/vnd.sealedmedia.softseal-html` + - `application/vnd.sealedmedia.softseal-pdf` + - `application/vnd.wap-slc` + - `application/vnd.wap-wbxml` + - `audio/vnd.sealedmedia.softseal-mpeg` + - `image/vnd-djvu` + - `image/vnd-svf` + - `image/vnd-wap-wbmp` + - `image/vnd.sealed-png` + - `image/vnd.sealedmedia.softseal-gif` + - `image/vnd.sealedmedia.softseal-jpg` + - `model/vnd-dwf` + - `model/vnd.parasolid.transmit-binary` + - `model/vnd.parasolid.transmit-text` + - `text/vnd-a` + - `text/vnd-curl` + - `text/vnd.wap-wml` + * Remove example template MIME types + - `application/example` + - `audio/example` + - `image/example` + - `message/example` + - `model/example` + - `multipart/example` + - `text/example` + - `video/example` + +1.3.1 / 2014-12-16 +================== + + * Fix missing extensions + - `application/json5` + - `text/hjson` + +1.3.0 / 2014-12-07 +================== + + * Add `application/a2l` + * Add `application/aml` + * Add `application/atfx` + * Add `application/atxml` + * Add `application/cdfx+xml` + * Add `application/dii` + * Add `application/json5` + * Add `application/lxf` + * Add `application/mf4` + * Add `application/vnd.apache.thrift.compact` + * Add `application/vnd.apache.thrift.json` + * Add `application/vnd.coffeescript` + * Add `application/vnd.enphase.envoy` + * Add `application/vnd.ims.imsccv1p1` + * Add `text/csv-schema` + * Add `text/hjson` + * Add `text/markdown` + * Add `text/yaml` + +1.2.0 / 2014-11-09 +================== + + * Add `application/cea` + * Add `application/dit` + * Add `application/vnd.gov.sk.e-form+zip` + * Add `application/vnd.tmd.mediaflex.api+xml` + * Type `application/epub+zip` is now IANA-registered + +1.1.2 / 2014-10-23 +================== + + * Rebuild database for `application/x-www-form-urlencoded` change + +1.1.1 / 2014-10-20 +================== + + * Mark `application/x-www-form-urlencoded` as compressible. + +1.1.0 / 2014-09-28 +================== + + * Add `application/font-woff2` + +1.0.3 / 2014-09-25 +================== + + * Fix engine requirement in package + +1.0.2 / 2014-09-25 +================== + + * Add `application/coap-group+json` + * Add `application/dcd` + * Add `application/vnd.apache.thrift.binary` + * Add `image/vnd.tencent.tap` + * Mark all JSON-derived types as compressible + * Update `text/vtt` data + +1.0.1 / 2014-08-30 +================== + + * Fix extension ordering + +1.0.0 / 2014-08-30 +================== + + * Add `application/atf` + * Add `application/merge-patch+json` + * Add `multipart/x-mixed-replace` + * Add `source: 'apache'` metadata + * Add `source: 'iana'` metadata + * Remove badly-assumed charset data diff --git a/node_modules/body-parser/node_modules/type-is/node_modules/mime-types/node_modules/mime-db/README.md b/node_modules/body-parser/node_modules/type-is/node_modules/mime-types/node_modules/mime-db/README.md index 3b6364e..1dde234 100644 --- a/node_modules/body-parser/node_modules/type-is/node_modules/mime-types/node_modules/mime-db/README.md +++ b/node_modules/body-parser/node_modules/type-is/node_modules/mime-types/node_modules/mime-db/README.md @@ -7,24 +7,17 @@ [![Coverage Status][coveralls-image]][coveralls-url] This is a database of all mime types. -It consistents of a single, public JSON file and does not include any logic, -allowing it to remain as unopinionated as possible with an API. +It consists of a single, public JSON file and does not include any logic, +allowing it to remain as un-opinionated as possible with an API. It aggregates data from the following sources: - http://www.iana.org/assignments/media-types/media-types.xhtml - http://svn.apache.org/repos/asf/httpd/httpd/trunk/docs/conf/mime.types -## Usage +## Installation ```bash -npm i mime-db -``` - -```js -var db = require('mime-db'); - -// grab data on .js files -var data = db['application/javascript']; +npm install mime-db ``` If you're crazy enough to use this in the browser, @@ -34,6 +27,15 @@ you can just grab the JSON file: https://cdn.rawgit.com/jshttp/mime-db/master/db.json ``` +## Usage + +```js +var db = require('mime-db'); + +// grab data on .js files +var data = db['application/javascript']; +``` + ## Data Structure The JSON file is a map lookup for lowercased mime types. @@ -49,18 +51,20 @@ Each mime type has the following properties: If unknown, every property could be `undefined`. -## Repository Structure - -- `scripts` - these are scripts to run to build the database -- `src/` - this is a folder of files created from remote sources like Apache and IANA -- `lib/` - this is a folder of our own custom sources and db, which will be merged into `db.json` -- `db.json` - the final built JSON file for end-user usage - ## Contributing -To edit the database, only make PRs against files in the `lib/` folder. +To edit the database, only make PRs against `src/custom.json` or +`src/custom-suffix.json`. + To update the build, run `npm run update`. +## Adding Custom Media Types + +The best way to get new media types included in this library is to register +them with the IANA. The community registration procedure is outlined in +[RFC 6838 section 5](http://tools.ietf.org/html/rfc6838#section-5). Types +registered with the IANA are automatically pulled into this library. + [npm-version-image]: https://img.shields.io/npm/v/mime-db.svg?style=flat [npm-downloads-image]: https://img.shields.io/npm/dm/mime-db.svg?style=flat [npm-url]: https://npmjs.org/package/mime-db diff --git a/node_modules/body-parser/node_modules/type-is/node_modules/mime-types/node_modules/mime-db/db.json b/node_modules/body-parser/node_modules/type-is/node_modules/mime-types/node_modules/mime-db/db.json index 6887056..283c1de 100644 --- a/node_modules/body-parser/node_modules/type-is/node_modules/mime-types/node_modules/mime-db/db.json +++ b/node_modules/body-parser/node_modules/type-is/node_modules/mime-types/node_modules/mime-db/db.json @@ -8,6 +8,9 @@ "application/3gpp-ims+xml": { "source": "iana" }, + "application/a2l": { + "source": "iana" + }, "application/activemessage": { "source": "iana" }, @@ -51,6 +54,9 @@ "source": "iana", "compressible": true }, + "application/aml": { + "source": "iana" + }, "application/andrew-inset": { "source": "iana", "extensions": ["ez"] @@ -65,6 +71,9 @@ "application/atf": { "source": "iana" }, + "application/atfx": { + "source": "iana" + }, "application/atom+xml": { "source": "iana", "compressible": true, @@ -84,6 +93,9 @@ "source": "iana", "extensions": ["atomsvc"] }, + "application/atxml": { + "source": "iana" + }, "application/auth-policy+xml": { "source": "iana" }, @@ -119,6 +131,9 @@ "source": "iana", "extensions": ["ccxml"] }, + "application/cdfx+xml": { + "source": "iana" + }, "application/cdmi-capability": { "source": "iana", "extensions": ["cdmia"] @@ -139,6 +154,9 @@ "source": "iana", "extensions": ["cdmiq"] }, + "application/cea": { + "source": "iana" + }, "application/cea-2018+xml": { "source": "iana" }, @@ -212,6 +230,12 @@ "application/dicom": { "source": "iana" }, + "application/dii": { + "source": "iana" + }, + "application/dit": { + "source": "iana" + }, "application/dns": { "source": "iana" }, @@ -263,15 +287,12 @@ "source": "iana" }, "application/epub+zip": { - "source": "apache", + "source": "iana", "extensions": ["epub"] }, "application/eshop": { "source": "iana" }, - "application/example": { - "source": "iana" - }, "application/exi": { "source": "iana", "extensions": ["exi"] @@ -407,6 +428,13 @@ "compressible": true, "extensions": ["js"] }, + "application/jose": { + "source": "iana" + }, + "application/jose+json": { + "source": "iana", + "compressible": true + }, "application/jrd+json": { "source": "iana", "compressible": true @@ -421,11 +449,28 @@ "source": "iana", "compressible": true }, + "application/json-seq": { + "source": "iana" + }, + "application/json5": { + "extensions": ["json5"] + }, "application/jsonml+json": { "source": "apache", "compressible": true, "extensions": ["jsonml"] }, + "application/jwk+json": { + "source": "iana", + "compressible": true + }, + "application/jwk-set+json": { + "source": "iana", + "compressible": true + }, + "application/jwt": { + "source": "iana" + }, "application/kpml-request+xml": { "source": "iana" }, @@ -449,6 +494,9 @@ "application/lostsync+xml": { "source": "iana" }, + "application/lxf": { + "source": "iana" + }, "application/mac-binhex40": { "source": "iana", "extensions": ["hqx"] @@ -520,12 +568,9 @@ "source": "iana" }, "application/mbox": { - "source": "apache", + "source": "iana", "extensions": ["mbox"] }, - "application/mbox+xml": { - "source": "iana" - }, "application/media-policy-dataset+xml": { "source": "iana" }, @@ -552,6 +597,9 @@ "source": "iana", "extensions": ["mets"] }, + "application/mf4": { + "source": "iana" + }, "application/mikey": { "source": "iana" }, @@ -631,7 +679,7 @@ "source": "iana" }, "application/ocsp-response": { - "source": "apache" + "source": "iana" }, "application/octet-stream": { "source": "iana", @@ -662,9 +710,6 @@ "source": "apache", "extensions": ["onetoc","onetoc2","onetmp","onepkg"] }, - "application/oscp-response": { - "source": "iana" - }, "application/oxps": { "source": "iana", "extensions": ["oxps"] @@ -792,6 +837,10 @@ "application/raptorfec": { "source": "iana" }, + "application/rdap+json": { + "source": "iana", + "compressible": true + }, "application/rdf+xml": { "source": "iana", "compressible": true, @@ -1085,30 +1134,6 @@ "application/vividence.scriptfile": { "source": "apache" }, - "application/vnd-acucobol": { - "source": "iana" - }, - "application/vnd-curl": { - "source": "iana" - }, - "application/vnd-dart": { - "source": "iana" - }, - "application/vnd-dxr": { - "source": "iana" - }, - "application/vnd-fdf": { - "source": "iana" - }, - "application/vnd-mif": { - "source": "iana" - }, - "application/vnd-sema": { - "source": "iana" - }, - "application/vnd-wap-wmlc": { - "source": "iana" - }, "application/vnd.3gpp.bsf+xml": { "source": "iana" }, @@ -1150,7 +1175,7 @@ "extensions": ["imp"] }, "application/vnd.acucobol": { - "source": "apache", + "source": "iana", "extensions": ["acu"] }, "application/vnd.acucorp": { @@ -1161,7 +1186,7 @@ "source": "apache", "extensions": ["air"] }, - "application/vnd.adobe.flash-movie": { + "application/vnd.adobe.flash.movie": { "source": "iana" }, "application/vnd.adobe.formscentral.fcdt": { @@ -1236,6 +1261,12 @@ "application/vnd.apache.thrift.binary": { "source": "iana" }, + "application/vnd.apache.thrift.compact": { + "source": "iana" + }, + "application/vnd.apache.thrift.json": { + "source": "iana" + }, "application/vnd.api+json": { "source": "iana", "compressible": true @@ -1347,6 +1378,9 @@ "source": "iana", "extensions": ["c11amz"] }, + "application/vnd.coffeescript": { + "source": "iana" + }, "application/vnd.collection+json": { "source": "iana", "compressible": true @@ -1422,7 +1456,7 @@ "source": "iana" }, "application/vnd.curl": { - "source": "apache" + "source": "iana" }, "application/vnd.curl.car": { "source": "apache", @@ -1439,7 +1473,7 @@ "source": "iana" }, "application/vnd.dart": { - "source": "apache", + "source": "iana", "compressible": true, "extensions": ["dart"] }, @@ -1450,9 +1484,6 @@ "application/vnd.debian.binary-package": { "source": "iana" }, - "application/vnd.dece-zip": { - "source": "iana" - }, "application/vnd.dece.data": { "source": "iana", "extensions": ["uvf","uvvf","uvd","uvvd"] @@ -1466,7 +1497,7 @@ "extensions": ["uvx","uvvx"] }, "application/vnd.dece.zip": { - "source": "apache", + "source": "iana", "extensions": ["uvz","uvvz"] }, "application/vnd.denovo.fcselayout-link": { @@ -1580,14 +1611,11 @@ "source": "iana" }, "application/vnd.dvb.service": { - "source": "apache", + "source": "iana", "extensions": ["svc"] }, - "application/vnd.dvb_service": { - "source": "iana" - }, "application/vnd.dxr": { - "source": "apache" + "source": "iana" }, "application/vnd.dynageo": { "source": "iana", @@ -1628,6 +1656,9 @@ "source": "iana", "extensions": ["nml"] }, + "application/vnd.enphase.envoy": { + "source": "iana" + }, "application/vnd.eprints.data+xml": { "source": "iana" }, @@ -1739,7 +1770,7 @@ "source": "iana" }, "application/vnd.fdf": { - "source": "apache", + "source": "iana", "extensions": ["fdf"] }, "application/vnd.fdsn.mseed": { @@ -1869,6 +1900,9 @@ "source": "iana", "extensions": ["g3w"] }, + "application/vnd.gerber": { + "source": "iana" + }, "application/vnd.globalplatform.card-content-mgt": { "source": "iana" }, @@ -1889,6 +1923,12 @@ "compressible": false, "extensions": ["kmz"] }, + "application/vnd.gov.sk.e-form+xml": { + "source": "iana" + }, + "application/vnd.gov.sk.e-form+zip": { + "source": "iana" + }, "application/vnd.grafeq": { "source": "iana", "extensions": ["gqf","gqs"] @@ -2025,6 +2065,15 @@ "source": "iana", "extensions": ["ivu"] }, + "application/vnd.ims.imsccv1p1": { + "source": "iana" + }, + "application/vnd.ims.imsccv1p2": { + "source": "iana" + }, + "application/vnd.ims.imsccv1p3": { + "source": "iana" + }, "application/vnd.ims.lis.v2.result+json": { "source": "iana", "compressible": true @@ -2315,15 +2364,12 @@ "source": "iana", "extensions": ["mfm"] }, - "application/vnd.micrografx-igx": { - "source": "iana" - }, "application/vnd.micrografx.flo": { "source": "iana", "extensions": ["flo"] }, "application/vnd.micrografx.igx": { - "source": "apache", + "source": "iana", "extensions": ["igx"] }, "application/vnd.miele+json": { @@ -2331,7 +2377,7 @@ "compressible": true }, "application/vnd.mif": { - "source": "apache", + "source": "iana", "extensions": ["mif"] }, "application/vnd.minisoft-hp3000-save": { @@ -2556,6 +2602,9 @@ "compressible": false, "extensions": ["xps"] }, + "application/vnd.msa-disk-image": { + "source": "iana" + }, "application/vnd.mseq": { "source": "iana", "extensions": ["mseq"] @@ -3183,6 +3232,10 @@ "application/vnd.openxmlformats-package.relationships+xml": { "source": "iana" }, + "application/vnd.oracle.resource+json": { + "source": "iana", + "compressible": true + }, "application/vnd.orange.indata": { "source": "iana" }, @@ -3292,7 +3345,7 @@ "extensions": ["ptid"] }, "application/vnd.pwg-multiplexed": { - "source": "apache" + "source": "iana" }, "application/vnd.pwg-xhtml-print+xml": { "source": "iana" @@ -3415,24 +3468,6 @@ "application/vnd.scribus": { "source": "iana" }, - "application/vnd.sealed-doc": { - "source": "iana" - }, - "application/vnd.sealed-eml": { - "source": "iana" - }, - "application/vnd.sealed-mht": { - "source": "iana" - }, - "application/vnd.sealed-ppt": { - "source": "iana" - }, - "application/vnd.sealed-tiff": { - "source": "iana" - }, - "application/vnd.sealed-xls": { - "source": "iana" - }, "application/vnd.sealed.3df": { "source": "iana" }, @@ -3440,44 +3475,38 @@ "source": "iana" }, "application/vnd.sealed.doc": { - "source": "apache" + "source": "iana" }, "application/vnd.sealed.eml": { - "source": "apache" + "source": "iana" }, "application/vnd.sealed.mht": { - "source": "apache" + "source": "iana" }, "application/vnd.sealed.net": { "source": "iana" }, "application/vnd.sealed.ppt": { - "source": "apache" + "source": "iana" }, "application/vnd.sealed.tiff": { - "source": "apache" - }, - "application/vnd.sealed.xls": { - "source": "apache" - }, - "application/vnd.sealedmedia.softseal-html": { "source": "iana" }, - "application/vnd.sealedmedia.softseal-pdf": { + "application/vnd.sealed.xls": { "source": "iana" }, "application/vnd.sealedmedia.softseal.html": { - "source": "apache" + "source": "iana" }, "application/vnd.sealedmedia.softseal.pdf": { - "source": "apache" + "source": "iana" }, "application/vnd.seemail": { "source": "iana", "extensions": ["see"] }, "application/vnd.sema": { - "source": "apache", + "source": "iana", "extensions": ["sema"] }, "application/vnd.semd": { @@ -3681,6 +3710,9 @@ "source": "iana", "extensions": ["pcap","cap","dmp"] }, + "application/vnd.tmd.mediaflex.api+xml": { + "source": "iana" + }, "application/vnd.tmobile-livetv": { "source": "iana", "extensions": ["tmo"] @@ -3796,24 +3828,18 @@ "source": "iana", "extensions": ["vsf"] }, - "application/vnd.wap-slc": { - "source": "iana" - }, - "application/vnd.wap-wbxml": { - "source": "iana" - }, "application/vnd.wap.sic": { "source": "iana" }, "application/vnd.wap.slc": { - "source": "apache" + "source": "iana" }, "application/vnd.wap.wbxml": { - "source": "apache", + "source": "iana", "extensions": ["wbxml"] }, "application/vnd.wap.wmlc": { - "source": "apache", + "source": "iana", "extensions": ["wmlc"] }, "application/vnd.wap.wmlscriptc": { @@ -3965,9 +3991,6 @@ "application/vq-rtcpxr": { "source": "iana" }, - "application/vwg-multiplexed": { - "source": "iana" - }, "application/watcherinfo+xml": { "source": "iana" }, @@ -4447,11 +4470,9 @@ "compressible": true, "extensions": ["webapp"] }, - "application/x-www-form-urlencode": { - "compressible": false - }, "application/x-www-form-urlencoded": { - "source": "iana" + "source": "iana", + "compressible": true }, "application/x-x509-ca-cert": { "source": "apache", @@ -4710,23 +4731,17 @@ "audio/evrcwb1": { "source": "iana" }, - "audio/example": { - "source": "iana" - }, "audio/fwdred": { "source": "iana" }, "audio/g719": { "source": "iana" }, - "audio/g721": { - "source": "iana" - }, "audio/g722": { "source": "iana" }, "audio/g7221": { - "source": "apache" + "source": "iana" }, "audio/g723": { "source": "iana" @@ -5040,11 +5055,8 @@ "audio/vnd.rn-realaudio": { "compressible": false }, - "audio/vnd.sealedmedia.softseal-mpeg": { - "source": "iana" - }, "audio/vnd.sealedmedia.softseal.mpeg": { - "source": "apache" + "source": "iana" }, "audio/vnd.vmx.cvsd": { "source": "iana" @@ -5157,9 +5169,6 @@ "source": "iana", "extensions": ["cgm"] }, - "image/example": { - "source": "iana" - }, "image/fits": { "source": "iana" }, @@ -5235,15 +5244,6 @@ "image/tiff-fx": { "source": "iana" }, - "image/vnd-djvu": { - "source": "iana" - }, - "image/vnd-svf": { - "source": "iana" - }, - "image/vnd-wap-wbmp": { - "source": "iana" - }, "image/vnd.adobe.photoshop": { "source": "iana", "compressible": true, @@ -5260,7 +5260,7 @@ "extensions": ["uvi","uvvi","uvg","uvvg"] }, "image/vnd.djvu": { - "source": "apache", + "source": "iana", "extensions": ["djvu","djv"] }, "image/vnd.dvb.subtitle": { @@ -5319,26 +5319,17 @@ "image/vnd.radiance": { "source": "iana" }, - "image/vnd.sealed-png": { - "source": "iana" - }, "image/vnd.sealed.png": { - "source": "apache" - }, - "image/vnd.sealedmedia.softseal-gif": { - "source": "iana" - }, - "image/vnd.sealedmedia.softseal-jpg": { "source": "iana" }, "image/vnd.sealedmedia.softseal.gif": { - "source": "apache" + "source": "iana" }, "image/vnd.sealedmedia.softseal.jpg": { - "source": "apache" + "source": "iana" }, "image/vnd.svf": { - "source": "apache" + "source": "iana" }, "image/vnd.tencent.tap": { "source": "iana" @@ -5347,7 +5338,7 @@ "source": "iana" }, "image/vnd.wap.wbmp": { - "source": "apache", + "source": "iana", "extensions": ["wbmp"] }, "image/vnd.xiff": { @@ -5439,9 +5430,6 @@ "message/disposition-notification": { "source": "iana" }, - "message/example": { - "source": "iana" - }, "message/external-body": { "source": "iana" }, @@ -5498,10 +5486,6 @@ "message/vnd.wfa.wsc": { "source": "iana" }, - "model/example": { - "source": "iana", - "compressible": false - }, "model/iges": { "source": "iana", "compressible": false, @@ -5512,15 +5496,12 @@ "compressible": false, "extensions": ["msh","mesh","silo"] }, - "model/vnd-dwf": { - "source": "iana" - }, "model/vnd.collada+xml": { "source": "iana", "extensions": ["dae"] }, "model/vnd.dwf": { - "source": "apache", + "source": "iana", "extensions": ["dwf"] }, "model/vnd.flatland.3dml": { @@ -5531,10 +5512,10 @@ "extensions": ["gdl"] }, "model/vnd.gs-gdl": { - "source": "iana" + "source": "apache" }, "model/vnd.gs.gdl": { - "source": "apache" + "source": "iana" }, "model/vnd.gtw": { "source": "iana", @@ -5550,17 +5531,11 @@ "model/vnd.opengex": { "source": "iana" }, - "model/vnd.parasolid.transmit-binary": { - "source": "iana" - }, - "model/vnd.parasolid.transmit-text": { - "source": "iana" - }, "model/vnd.parasolid.transmit.binary": { - "source": "apache" + "source": "iana" }, "model/vnd.parasolid.transmit.text": { - "source": "apache" + "source": "iana" }, "model/vnd.valve.source.compiled-map": { "source": "iana" @@ -5612,9 +5587,6 @@ "source": "iana", "compressible": false }, - "multipart/example": { - "source": "iana" - }, "multipart/form-data": { "source": "iana", "compressible": false @@ -5677,6 +5649,9 @@ "compressible": true, "extensions": ["csv"] }, + "text/csv-schema": { + "source": "iana" + }, "text/directory": { "source": "iana" }, @@ -5692,15 +5667,15 @@ "text/enriched": { "source": "iana" }, - "text/example": { - "source": "iana" - }, "text/fwdred": { "source": "iana" }, "text/grammar-ref-list": { "source": "iana" }, + "text/hjson": { + "extensions": ["hjson"] + }, "text/html": { "source": "iana", "compressible": true, @@ -5723,6 +5698,9 @@ "text/less": { "extensions": ["less"] }, + "text/markdown": { + "source": "iana" + }, "text/mizar": { "source": "iana" }, @@ -5814,17 +5792,14 @@ "compressible": true, "extensions": ["vcard"] }, - "text/vnd-a": { - "source": "iana" - }, - "text/vnd-curl": { + "text/vnd.a": { "source": "iana" }, "text/vnd.abc": { "source": "iana" }, "text/vnd.curl": { - "source": "apache", + "source": "iana", "extensions": ["curl"] }, "text/vnd.curl.dcurl": { @@ -5903,9 +5878,6 @@ "text/vnd.trolltech.linguist": { "source": "iana" }, - "text/vnd.wap-wml": { - "source": "iana" - }, "text/vnd.wap.si": { "source": "iana" }, @@ -5913,7 +5885,7 @@ "source": "iana" }, "text/vnd.wap.wml": { - "source": "apache", + "source": "iana", "extensions": ["wml"] }, "text/vnd.wap.wmlscript": { @@ -6005,6 +5977,9 @@ "text/xml-external-parsed-entity": { "source": "iana" }, + "text/yaml": { + "extensions": ["yaml","yml"] + }, "video/1d-interleaved-parityfec": { "source": "apache" }, @@ -6031,9 +6006,6 @@ "video/dv": { "source": "apache" }, - "video/example": { - "source": "apache" - }, "video/h261": { "source": "apache", "extensions": ["h261"] diff --git a/node_modules/body-parser/node_modules/type-is/node_modules/mime-types/node_modules/mime-db/package.json b/node_modules/body-parser/node_modules/type-is/node_modules/mime-types/node_modules/mime-db/package.json index 4d705f1..30e3e66 100644 --- a/node_modules/body-parser/node_modules/type-is/node_modules/mime-types/node_modules/mime-db/package.json +++ b/node_modules/body-parser/node_modules/type-is/node_modules/mime-types/node_modules/mime-db/package.json @@ -1,63 +1,77 @@ { "name": "mime-db", "description": "Media Type Database", - "version": "1.1.1", + "version": "1.7.0", "author": { "name": "Jonathan Ong", "email": "me@jongleberry.com", "url": "http://jongleberry.com" }, + "contributors": [ + { + "name": "Douglas Christopher Wilson", + "email": "doug@somethingdoug.com" + }, + { + "name": "Robert Kieffer", + "email": "robert@broofa.com", + "url": "http://github.com/broofa" + } + ], "license": "MIT", + "keywords": [ + "mime", + "db", + "type", + "types", + "database", + "charset", + "charsets" + ], "repository": { "type": "git", "url": "https://github.com/jshttp/mime-db" }, "devDependencies": { - "co": "3", + "co": "4", "cogent": "1", "csv-parse": "0", "gnode": "0.1.0", - "istanbul": "0.3.2", + "istanbul": "0.3.5", "mocha": "~1.21.4", + "raw-body": "~1.3.2", "stream-to-array": "2" }, - "engines": { - "node": ">= 0.6" - }, "files": [ + "HISTORY.md", "LICENSE", + "README.md", "db.json", "index.js" ], + "engines": { + "node": ">= 0.6" + }, "scripts": { - "update": "gnode scripts/extensions && gnode scripts/types && node scripts/build", - "clean": "rm src/*", + "build": "node scripts/build", + "fetch": "gnode scripts/extensions && gnode scripts/types", "test": "mocha --reporter spec --bail --check-leaks test/", "test-cov": "istanbul cover node_modules/mocha/bin/_mocha -- --reporter dot --check-leaks test/", - "test-travis": "istanbul cover node_modules/mocha/bin/_mocha --report lcovonly -- --reporter spec --check-leaks test/" + "test-travis": "istanbul cover node_modules/mocha/bin/_mocha --report lcovonly -- --reporter spec --check-leaks test/", + "update": "npm run fetch && npm run build" }, - "keywords": [ - "mime", - "db", - "type", - "types", - "database", - "charset", - "charsets" - ], - "gitHead": "edc213cbc9828807ea29ea3cc290b4fd485eae91", + "gitHead": "972cc3ed48530ab7aca7a155bf2dbd1b13aa8f86", "bugs": { "url": "https://github.com/jshttp/mime-db/issues" }, "homepage": "https://github.com/jshttp/mime-db", - "_id": "mime-db@1.1.1", - "_shasum": "0fc890cda05d0edadefde73d241ef7e28d110a98", - "_from": "mime-db@~1.1.0", - "_npmVersion": "2.1.4", - "_nodeVersion": "0.11.14", + "_id": "mime-db@1.7.0", + "_shasum": "36cf66a6c52ea71827bde287f77c254f5ef1b8d3", + "_from": "mime-db@~1.7.0", + "_npmVersion": "1.4.28", "_npmUser": { - "name": "jongleberry", - "email": "jonathanrichardong@gmail.com" + "name": "dougwilson", + "email": "doug@somethingdoug.com" }, "maintainers": [ { @@ -70,9 +84,9 @@ } ], "dist": { - "shasum": "0fc890cda05d0edadefde73d241ef7e28d110a98", - "tarball": "http://registry.npmjs.org/mime-db/-/mime-db-1.1.1.tgz" + "shasum": "36cf66a6c52ea71827bde287f77c254f5ef1b8d3", + "tarball": "http://registry.npmjs.org/mime-db/-/mime-db-1.7.0.tgz" }, "directories": {}, - "_resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.1.1.tgz" + "_resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.7.0.tgz" } diff --git a/node_modules/body-parser/node_modules/type-is/node_modules/mime-types/package.json b/node_modules/body-parser/node_modules/type-is/node_modules/mime-types/package.json index d1d53ff..60d4fc3 100644 --- a/node_modules/body-parser/node_modules/type-is/node_modules/mime-types/package.json +++ b/node_modules/body-parser/node_modules/type-is/node_modules/mime-types/package.json @@ -1,8 +1,12 @@ { "name": "mime-types", "description": "The ultimate javascript content-type utility.", - "version": "2.0.2", + "version": "2.0.9", "contributors": [ + { + "name": "Douglas Christopher Wilson", + "email": "doug@somethingdoug.com" + }, { "name": "Jeremiah Senkpiel", "email": "fishrock123@rocketmail.com", @@ -24,11 +28,11 @@ "url": "https://github.com/jshttp/mime-types" }, "dependencies": { - "mime-db": "~1.1.0" + "mime-db": "~1.7.0" }, "devDependencies": { - "istanbul": "0", - "mocha": "1" + "istanbul": "0.3.5", + "mocha": "~1.21.5" }, "files": [ "HISTORY.md", @@ -43,15 +47,15 @@ "test-cov": "istanbul cover node_modules/mocha/bin/_mocha -- --reporter dot test/test.js", "test-travis": "istanbul cover node_modules/mocha/bin/_mocha --report lcovonly -- --reporter dot test/test.js" }, - "gitHead": "7272f212651dcaca233803c58dc251b20668ca61", + "gitHead": "1c6d55da440b6a9d2c0e9c2faac98e6b1be47fc7", "bugs": { "url": "https://github.com/jshttp/mime-types/issues" }, "homepage": "https://github.com/jshttp/mime-types", - "_id": "mime-types@2.0.2", - "_shasum": "c74b779f2896c367888622bd537aaaad4c0a2c08", - "_from": "mime-types@~2.0.2", - "_npmVersion": "1.4.21", + "_id": "mime-types@2.0.9", + "_shasum": "e8449aff27b1245ddc6641b524439ae80c4b78a6", + "_from": "mime-types@~2.0.9", + "_npmVersion": "1.4.28", "_npmUser": { "name": "dougwilson", "email": "doug@somethingdoug.com" @@ -71,9 +75,9 @@ } ], "dist": { - "shasum": "c74b779f2896c367888622bd537aaaad4c0a2c08", - "tarball": "http://registry.npmjs.org/mime-types/-/mime-types-2.0.2.tgz" + "shasum": "e8449aff27b1245ddc6641b524439ae80c4b78a6", + "tarball": "http://registry.npmjs.org/mime-types/-/mime-types-2.0.9.tgz" }, "directories": {}, - "_resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.0.2.tgz" + "_resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.0.9.tgz" } diff --git a/node_modules/body-parser/node_modules/type-is/package.json b/node_modules/body-parser/node_modules/type-is/package.json index 00e6e21..95d739e 100644 --- a/node_modules/body-parser/node_modules/type-is/package.json +++ b/node_modules/body-parser/node_modules/type-is/package.json @@ -1,7 +1,7 @@ { "name": "type-is", "description": "Infer the content-type of a request.", - "version": "1.5.2", + "version": "1.6.0", "author": { "name": "Jonathan Ong", "email": "me@jongleberry.com", @@ -20,11 +20,11 @@ }, "dependencies": { "media-typer": "0.3.0", - "mime-types": "~2.0.2" + "mime-types": "~2.0.9" }, "devDependencies": { - "istanbul": "~0.3.0", - "mocha": "1" + "istanbul": "0.3.5", + "mocha": "~1.21.5" }, "engines": { "node": ">= 0.6" @@ -44,15 +44,15 @@ "type", "checking" ], - "gitHead": "53b2d3f2c0177ac89576055d327d543291d36879", + "gitHead": "8386837f91cfbf9f21f02758dee36655a901e1c4", "bugs": { "url": "https://github.com/jshttp/type-is/issues" }, "homepage": "https://github.com/jshttp/type-is", - "_id": "type-is@1.5.2", - "_shasum": "8291bbe845a904acfaffd05a41fdeb234bfa9e5f", - "_from": "type-is@~1.5.1", - "_npmVersion": "1.4.21", + "_id": "type-is@1.6.0", + "_shasum": "efcb9223fafad5a03be14d8f6c9e1785f2c0e7c3", + "_from": "type-is@~1.6.0", + "_npmVersion": "1.4.28", "_npmUser": { "name": "dougwilson", "email": "doug@somethingdoug.com" @@ -84,9 +84,9 @@ } ], "dist": { - "shasum": "8291bbe845a904acfaffd05a41fdeb234bfa9e5f", - "tarball": "http://registry.npmjs.org/type-is/-/type-is-1.5.2.tgz" + "shasum": "efcb9223fafad5a03be14d8f6c9e1785f2c0e7c3", + "tarball": "http://registry.npmjs.org/type-is/-/type-is-1.6.0.tgz" }, "directories": {}, - "_resolved": "https://registry.npmjs.org/type-is/-/type-is-1.5.2.tgz" + "_resolved": "https://registry.npmjs.org/type-is/-/type-is-1.6.0.tgz" } diff --git a/node_modules/body-parser/package.json b/node_modules/body-parser/package.json index 76a2525..0f0f5bc 100644 --- a/node_modules/body-parser/package.json +++ b/node_modules/body-parser/package.json @@ -1,7 +1,7 @@ { "name": "body-parser", "description": "Node.js body parsing middleware", - "version": "1.9.0", + "version": "1.12.0", "contributors": [ { "name": "Douglas Christopher Wilson", @@ -20,19 +20,20 @@ }, "dependencies": { "bytes": "1.0.0", + "content-type": "~1.0.1", + "debug": "~2.1.1", "depd": "~1.0.0", - "iconv-lite": "0.4.4", - "media-typer": "0.3.0", - "on-finished": "2.1.0", - "qs": "2.2.4", - "raw-body": "1.3.0", - "type-is": "~1.5.1" + "iconv-lite": "0.4.7", + "on-finished": "~2.2.0", + "qs": "2.3.3", + "raw-body": "1.3.3", + "type-is": "~1.6.0" }, "devDependencies": { - "istanbul": "0.3.2", - "mocha": "~1.21.4", - "should": "~4.0.4", - "supertest": "~0.13.0" + "istanbul": "0.3.5", + "methods": "~1.1.1", + "mocha": "~2.1.0", + "supertest": "~0.15.0" }, "files": [ "lib/", @@ -44,19 +45,19 @@ "node": ">= 0.8" }, "scripts": { - "test": "mocha --require should --require test/support/env --reporter spec --check-leaks --bail test/", + "test": "mocha --require test/support/env --reporter spec --check-leaks --bail test/", "test-cov": "istanbul cover node_modules/mocha/bin/_mocha -- --require test/support/env --reporter dot --check-leaks test/", "test-travis": "istanbul cover node_modules/mocha/bin/_mocha --report lcovonly -- --require test/support/env --reporter spec --check-leaks test/" }, - "gitHead": "263f602e6ae34add6332c1eb4caa808893b0b711", + "gitHead": "9ec4d920fc0fbfc8351ff528d19b24d80612e3e0", "bugs": { "url": "https://github.com/expressjs/body-parser/issues" }, "homepage": "https://github.com/expressjs/body-parser", - "_id": "body-parser@1.9.0", - "_shasum": "95d72943b1a4f67f56bbac9e0dcc837b68703605", - "_from": "body-parser@^1.4.3", - "_npmVersion": "1.4.21", + "_id": "body-parser@1.12.0", + "_shasum": "9750fc3cc1080b34a13d18c79840cd559979fce5", + "_from": "body-parser@1.12.0", + "_npmVersion": "1.4.28", "_npmUser": { "name": "dougwilson", "email": "doug@somethingdoug.com" @@ -88,9 +89,9 @@ } ], "dist": { - "shasum": "95d72943b1a4f67f56bbac9e0dcc837b68703605", - "tarball": "http://registry.npmjs.org/body-parser/-/body-parser-1.9.0.tgz" + "shasum": "9750fc3cc1080b34a13d18c79840cd559979fce5", + "tarball": "http://registry.npmjs.org/body-parser/-/body-parser-1.12.0.tgz" }, "directories": {}, - "_resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.9.0.tgz" + "_resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.12.0.tgz" } diff --git a/node_modules/bower/node_modules/archy/package.json b/node_modules/bower/node_modules/archy/package.json index 78cb6d9..f3a3d52 100644 --- a/node_modules/bower/node_modules/archy/package.json +++ b/node_modules/bower/node_modules/archy/package.json @@ -59,5 +59,10 @@ ], "_shasum": "910f43bf66141fc335564597abc189df44b3d35e", "_from": "archy@0.0.2", - "_resolved": "https://registry.npmjs.org/archy/-/archy-0.0.2.tgz" + "_resolved": "https://registry.npmjs.org/archy/-/archy-0.0.2.tgz", + "bugs": { + "url": "https://github.com/substack/node-archy/issues" + }, + "readme": "ERROR: No README data found!", + "homepage": "https://github.com/substack/node-archy" } diff --git a/node_modules/bower/node_modules/bower-config/node_modules/graceful-fs/package.json b/node_modules/bower/node_modules/bower-config/node_modules/graceful-fs/package.json index dc22856..d78e908 100644 --- a/node_modules/bower/node_modules/bower-config/node_modules/graceful-fs/package.json +++ b/node_modules/bower/node_modules/bower-config/node_modules/graceful-fs/package.json @@ -47,7 +47,7 @@ "shasum": "7cd2cdb228a4a3f36e95efa6cc142de7d1a136d0", "tarball": "http://registry.npmjs.org/graceful-fs/-/graceful-fs-2.0.3.tgz" }, - "_from": "graceful-fs@~2.0.0", + "_from": "graceful-fs@2.0.3", "_npmVersion": "1.4.6", "_npmUser": { "name": "isaacs", diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/.editorconfig b/node_modules/bower/node_modules/bower-config/node_modules/mout/.editorconfig new file mode 100644 index 0000000..e036e24 --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/.editorconfig @@ -0,0 +1,20 @@ +; EditorConfig is awesome: http://EditorConfig.org + +; top-most EditorConfig file +root = true + +; base rules +[*] +end_of_line = lf +insert_final_newline = false +indent_style = space +indent_size = 4 +charset = utf-8 +trim_trailing_whitespace = true + +; The default indent on package.json is 2 spaces, better to keep it so we can +; use `npm install --save` and other features that rewrites the package.json +; file automatically +[package.json] +indent_style = space +indent_size = 2 diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/.jshintrc b/node_modules/bower/node_modules/bower-config/node_modules/mout/.jshintrc new file mode 100644 index 0000000..bbdb29c --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/.jshintrc @@ -0,0 +1,69 @@ +{ + // Settings + "passfail" : false, // Stop on first error. + "maxerr" : 50, // Maximum error before stopping. + + + // Predefined globals whom JSHint will ignore. + "browser" : true, // Standard browser globals e.g. `window`, `document`. + "couch" : false, + "dojo" : false, + "jquery" : true, + "mootools" : false, + "node" : false, + "prototypejs" : false, + "rhino" : false, + "wsh" : false, + + // Custom globals. + "predef" : [ + "define", + "require" + ], + + + // Development. + "debug" : false, // Allow debugger statements e.g. browser breakpoints. + "devel" : false, // Allow developments statements e.g. `console.log();`. + + + // EcmaScript 5. + "es5" : false, // Allow EcmaScript 5 syntax. + "globalstrict" : false, // Allow global "use strict" (also enables 'strict'). + "strict" : false, // Require `use strict` pragma in every file. + + + // The Good Parts. + "asi" : false, // Tolerate Automatic Semicolon Insertion (no semicolons). + "bitwise" : false, // Prohibit bitwise operators (&, |, ^, etc.). + "boss" : true, // Tolerate assignments inside if, for & while. Usually conditions & loops are for comparison, not assignments. + "curly" : false, // Require {} for every new block or scope. + "eqeqeq" : true, // Require triple equals i.e. `===`. + "eqnull" : true, // Tolerate use of `== null`. + "evil" : false, // Tolerate use of `eval`. + "expr" : false, // Tolerate `ExpressionStatement` as Programs. + "forin" : false, // Tolerate `for in` loops without `hasOwnPrototype`. + "immed" : true, // Require immediate invocations to be wrapped in parens e.g. `( function(){}() );` + "latedef" : false, // Prohibit variable use before definition. + "laxbreak" : false, // Tolerate unsafe line breaks e.g. `return [\n] x` without semicolons. + "loopfunc" : false, // Allow functions to be defined within loops. + "noarg" : true, // Prohibit use of `arguments.caller` and `arguments.callee`. + "regexdash" : true, // Tolerate unescaped last dash i.e. `[-...]`. + "regexp" : false, // Prohibit `.` and `[^...]` in regular expressions. + "scripturl" : false, // Tolerate script-targeted URLs. + "shadow" : false, // Allows re-define variables later in code e.g. `var x=1; x=2;`. + "supernew" : false, // Tolerate `new function () { ... };` and `new Object;`. + "undef" : false, // Require all non-global variables be declared before they are used. + + + // Personal styling prefrences. + "newcap" : true, // Require capitalization of all constructor functions e.g. `new F()`. + "noempty" : true, // Prohipit use of empty blocks. + "nomen" : false, // Prohibit use of initial or trailing underbars in names. + "nonew" : true, // Prohibit use of constructors for side-effects. + "onevar" : false, // Allow only one `var` statement per function. + "plusplus" : false, // Prohibit use of `++` & `--`. + "sub" : false, // Tolerate all forms of subscript notation besides dot notation e.g. `dict['key']` instead of `dict.key`. + "trailing" : true, // Prohibit trailing whitespaces. + "white" : false // Check against strict whitespace and indentation rules. +} diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/.npmignore b/node_modules/bower/node_modules/bower-config/node_modules/mout/.npmignore new file mode 100644 index 0000000..1341acd --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/.npmignore @@ -0,0 +1,30 @@ +# dumb files +# ========== + +.tmp* +.project +.settings/ +.livereload +.DS_Store? +ehthumbs.db +Icon? +Thumbs.db + + +# stuff not needed by node +# ======================== + +node_modules/ +tests/ +_build/ +doc_html/ +coverage/ + +# we keep the doc/ folder in case npm decides to display it in the future +# also good in case user is using an old version or working offline + +# we also keep the src/ folder in case the user still needs the AMD modules +# after build (see issue #102) + +bower.json +build.js diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/.travis.yml b/node_modules/bower/node_modules/bower-config/node_modules/mout/.travis.yml new file mode 100644 index 0000000..324041b --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/.travis.yml @@ -0,0 +1,15 @@ + language: node_js + node_js: + - "0.8" + script: + - "npm test --coverage" + - "jshint src" + notifications: + irc: + channels: + - "irc.freenode.org#moutjs" + on_success: always + on_failure: always + use_notice: true + skip_join: true + diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/CHANGELOG.md b/node_modules/bower/node_modules/bower-config/node_modules/mout/CHANGELOG.md new file mode 100644 index 0000000..80e4292 --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/CHANGELOG.md @@ -0,0 +1,156 @@ +mout changelog +============== + +v0.9.1 (2014/04/08) +------------------- + + - fix `array/slice` behavior when start and end are higher than length. + + +v0.9.0 (2014/02/04) +------------------- + + - add `date/quarter`; + - add `function/constant`; + - add `random/randBool`; + - add un-padded 12-hour (`%l`) to `date/strftime`; + - fix `array/slice` on IE < 9 by using a custom implementation. + - fix `object/forIn` iteration for IE < 9 constructor property; + - improve `lang/inheritPrototype` by returning the `prototype`; + - improve `string/removeNonWord` to cover more chars; + - improve `string/repeat` performance; + - improve `string/unescapeHtml` by accepting leading zeros for `'`; + + +v0.8.0 (2013/11/22) +------------------- + + - add `array/findLast`. + - add `array/findLastIndex`. + - add `array/slice` and use it internally. + - add `array/sortBy` + - add `function/awaitDelay`. + - add `function/identity` + - add `number/isNaN`. + - add `number/nth`. + - add `number/ordinal`. + - allows nested replacement patterns in `string/interpolate`. + - change `function/makeIterator_` behavior (uses `identity` by default). + - simplify `string/escapeRegExp`. + - support custom equality on `array/compare`. + + +v0.7.1 (2013/09/18) +------------------- + + - fix `null` value handling in object/get. + + +v0.7.0 (2013/09/05) +------------------- + + - add bower ignores. + - add german translation for date localization. + - alias `function` package as `fn` since "function" is a reserved keyword. + - allow second argument on `array/pick`. + - improve `string/makePath` to not remove "//" after protocol. + - make sure methods inside `number` package works with mixed types. + - support arrays on `queryString/encode`. + - support multiple values for same property on `queryString/decode`. + - add `cancel()` method to `throttled/debounced` functions. + - add `function/times`. + - add `lang/toNumber`. + - add `string/insert`. + - add `super_` to constructor on `lang/inheritPrototype`. + + +v0.6.0 (2013/05/22) +------------------- + + - add optional delimeter to `string/unCamelCase` + - allow custom char on `number/pad` + - allow underscore characters in `string/removeNonWord` + - accept `level` on `array/flatten` instead of a flag + - convert underscores to camelCase in `string/camelCase` + - remove `create()` from number/currencyFormat + - add `date/dayOfTheYear` + - add `date/diff` + - add `date/isSame` + - add `date/startOf` + - add `date/strftime` + - add `date/timezoneAbbr` + - add `date/timezoneOffset` + - add `date/totalDaysInYear` + - add `date/weekOfTheYear` + - add `function/timeout` + - add `object/bindAll` + - add `object/functions` + - add `time/convert` + + +v0.5.0 (2013/04/04) +------------------- + + - add `array/collect` + - add `callback` parameter to `object/equals` and `object/deepEquals` to allow + custom compare operations. + - normalize behavior in `array/*` methods to treat `null` values as empty + arrays when reading from array + - add `date/parseIso` + - add `date/isLeapYear` + - add `date/totalDaysInMonth` + - add `object/deepMatches` + - change `function/makeIterator_` to use `deepMatches` (affects nearly all + iteration methods) + - add `thisObj` parameter to `array/min` and `array/max` + + +v0.4.0 (2013/02/26) +------------------- + + - add `object/equals` + - add `object/deepEquals` + - add `object/matches`. + - add `lang/is` and `lang/isnt`. + - add `lang/isInteger`. + - add `array/findIndex`. + - add shorthand syntax to `array/*`, `object/*` and `collection/*` methods. + - improve `number/sign` behavior when value is NaN or +0 or -0. + - improve `lang/isNaN` to actually check if value *is not a number* without + coercing value; so `[]`, `""`, `null` and `"12"` are considered NaN (#39). + - improve `string/contains` to match ES6 behavior (add fromIndex argument). + + +v0.3.0 (2013/02/01) +------------------- + + - add `lang/clone`. + - add `lang/toString`. + - add `string/replace`. + - add `string/WHITE_SPACES` + - rename `function/curry` to `function/partial`. + - allow custom chars in `string/trim`, `ltrim`, and `rtrim`. + - convert values to strings in the `string/*` functions. + + +v0.2.0 (2013/01/13) +------------------- + + - fix bug in `math/ceil` for negative radixes. + - change `object/deepFillIn` and `object/deepMixIn` to recurse only if both + existing and new values are plain objects. Will not recurse into arrays + or objects not created by the Object constructor. + - add `lang/isPlainObject` to check if a file is a valid object and is created + by the Object constructor + - change `lang/clone` behavior when dealing with custom types (avoid cloning + it by default) and add second argument to allow custom behavior if needed. + - rename `lang/clone` to `lang/deepClone`. + - add VERSION property to index.js + - simplify `math/floor`, `math/round`, `math/ceil` and `math/countSteps`. + + +v0.1.0 (2013/01/09) +------------------- + +- Rename project from "amd-utils" to "mout" + diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/CONTRIBUTING.md b/node_modules/bower/node_modules/bower-config/node_modules/mout/CONTRIBUTING.md new file mode 100644 index 0000000..65d9add --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/CONTRIBUTING.md @@ -0,0 +1,61 @@ +# Contributing + +Fork the repo at https://github.com/mout/mout + + > "Write clearly, don't be too clever" - The Elements of Programming Style + +Avoid unnamed functions and follow the other modules structure. By only using named functions it will be easier to extract the code from the AMD module if needed and it will also give better error messages, JavaScript minifiers like [Google Closure Compiler](http://code.google.com/closure/compiler/) and [UglifyJS](https://github.com/mishoo/UglifyJS) will make sure code is as small/optimized as possible. + + > "Make it clear before you make it faster." - The Elements of Programming Style + +Be sure to always create tests for each proposed module. Features will only be merged if they contain proper tests and documentation. + + > "Good code is its own best documentation." - Steve McConnell + +We should do a code review before merging to make sure names makes sense and implementation is as good as possible. + +Try to split your pull requests into logical groups, the smaller the easier to be reviewed/merged. + + + +## Tests & Code Coverage ## + +Tests can be found inside the `tests` folder, to execute them in the browser open the `tests/runner.html`. The same tests also work on node.js by running `npm test`. + +We should have tests for all methods and ensure we have a high code coverage through our continuous integration server ([travis](https://travis-ci.org/mout/mout)). When you ask for a pull request Travis will automatically run the tests on node.js and check the code coverage as well. + +We run `node build pkg` automatically before any `npm test`, so specs and packages should always be in sync. (will avoid human mistakes) + +To check code coverage run `npm test --coverage`, it will generate the reports inside the `coverage` folder and also log the results. Please note that node.js doesn't execute all code branches since we have some conditionals that are only met on old JavaScript engines (eg. IE 7-8), so we will never have 100% code coverage (but should be close to it). + + + +## Build Script ## + +The [build script](https://github.com/mout/mout/wiki/Build-Script) can be extremely helpful and can avoid human mistakes, use it. + + + +## Admins / Pull Requests ## + +Even if you are an admin (have commit rights) please do pull requests when adding new features or changing current behavior, that way we can review the work and discuss. Feel free to push changes that doesn't affect behavior without asking for a pull request (readme, changelog, build script, typos, refactoring, ...). + + + +## Large changes ## + +If you are proposing some major change, please create an issue to discuss it first. (maybe it's outside the scope of the project) + + + +## Questions / IRC / Wiki / Issue Tracker ## + +When in doubt ask someone on IRC to help you ([#moutjs on irc.freenode.net](http://webchat.freenode.net/?channels=moutjs)) or create a [new issue](http://github.com/mout/mout/issues). + +The [project wiki](https://github.com/mout/mout/wiki) can also be a good resource of information. + + +--- + +Check the [contributors list at github](https://github.com/mout/mout/contributors). + diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/LICENSE.md b/node_modules/bower/node_modules/bower-config/node_modules/mout/LICENSE.md new file mode 100644 index 0000000..e9ccc2b --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/LICENSE.md @@ -0,0 +1,21 @@ +# The MIT License (MIT) +## Copyright (c) 2012, 2013 moutjs team and contributors (http://moutjs.com) + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies +of the Software, and to permit persons to whom the Software is furnished to do +so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. + diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/README.md b/node_modules/bower/node_modules/bower-config/node_modules/mout/README.md new file mode 100644 index 0000000..872943b --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/README.md @@ -0,0 +1,63 @@ +![mout](http://moutjs.com/logo.png "Modular JavaScript Utilties") + +http://moutjs.com/ + +[![Build Status](https://travis-ci.org/mout/mout.png?branch=master)](https://travis-ci.org/mout/mout) + +All code is library agnostic and consist mostly of helper methods that aren't +directly related with the DOM, the purpose of this library isn't to replace +Dojo, jQuery, YUI, Mootools, etc, but to provide modular solutions for common +problems that aren't solved by most of them. Consider it as a crossbrowser +JavaScript standard library. + + + +## Main goals ## + + - increase code reuse; + - be clear (code should be clean/readable); + - be easy to debug; + - be easy to maintain; + - follow best practices; + - follow standards when possible; + - **don't convert JavaScript into another language!** + - be compatible with other frameworks; + - be modular; + - have unit tests for all modules; + - work on multiple environments (IE7+, modern browsers, node.js); + + + +## What shouldn't be here ## + + - UI components; + - CSS selector engine; + - Event system - pub/sub; + - Template engine; + - Anything that isn't generic enough to be on a standard library; + - Anything that could be a separate library and/or isn't a modular utility... + + + +## API Documentation ## + +Online documentation can be found at http://moutjs.com/ or inside the +`doc` folder. + + + +## FAQ / Wiki / IRC ## + +For more info about project structure, design decisions, tips, how to +contribute, build system, etc, please check the [project +wiki](https://github.com/mout/mout/wiki). + +We also have an IRC channel [#moutjs on +irc.freenode.net](http://webchat.freenode.net/?channels=moutjs) + + + +## License ## + +Released under the [MIT License](http://www.opensource.org/licenses/mit-license.php). + diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/array.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/array.js new file mode 100644 index 0000000..0ccae2d --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/array.js @@ -0,0 +1,50 @@ + + +//automatically generated, do not edit! +//run `node build` instead +module.exports = { + 'append' : require('./array/append'), + 'collect' : require('./array/collect'), + 'combine' : require('./array/combine'), + 'compact' : require('./array/compact'), + 'contains' : require('./array/contains'), + 'difference' : require('./array/difference'), + 'every' : require('./array/every'), + 'filter' : require('./array/filter'), + 'find' : require('./array/find'), + 'findIndex' : require('./array/findIndex'), + 'findLast' : require('./array/findLast'), + 'findLastIndex' : require('./array/findLastIndex'), + 'flatten' : require('./array/flatten'), + 'forEach' : require('./array/forEach'), + 'indexOf' : require('./array/indexOf'), + 'insert' : require('./array/insert'), + 'intersection' : require('./array/intersection'), + 'invoke' : require('./array/invoke'), + 'join' : require('./array/join'), + 'lastIndexOf' : require('./array/lastIndexOf'), + 'map' : require('./array/map'), + 'max' : require('./array/max'), + 'min' : require('./array/min'), + 'pick' : require('./array/pick'), + 'pluck' : require('./array/pluck'), + 'range' : require('./array/range'), + 'reduce' : require('./array/reduce'), + 'reduceRight' : require('./array/reduceRight'), + 'reject' : require('./array/reject'), + 'remove' : require('./array/remove'), + 'removeAll' : require('./array/removeAll'), + 'shuffle' : require('./array/shuffle'), + 'slice' : require('./array/slice'), + 'some' : require('./array/some'), + 'sort' : require('./array/sort'), + 'sortBy' : require('./array/sortBy'), + 'split' : require('./array/split'), + 'toLookup' : require('./array/toLookup'), + 'union' : require('./array/union'), + 'unique' : require('./array/unique'), + 'xor' : require('./array/xor'), + 'zip' : require('./array/zip') +}; + + diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/array/append.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/array/append.js new file mode 100644 index 0000000..bf74037 --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/array/append.js @@ -0,0 +1,21 @@ + + + /** + * Appends an array to the end of another. + * The first array will be modified. + */ + function append(arr1, arr2) { + if (arr2 == null) { + return arr1; + } + + var pad = arr1.length, + i = -1, + len = arr2.length; + while (++i < len) { + arr1[pad + i] = arr2[i]; + } + return arr1; + } + module.exports = append; + diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/array/collect.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/array/collect.js new file mode 100644 index 0000000..5863749 --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/array/collect.js @@ -0,0 +1,27 @@ +var append = require('./append'); +var makeIterator = require('../function/makeIterator_'); + + /** + * Maps the items in the array and concatenates the result arrays. + */ + function collect(arr, callback, thisObj){ + callback = makeIterator(callback, thisObj); + var results = []; + if (arr == null) { + return results; + } + + var i = -1, len = arr.length; + while (++i < len) { + var value = callback(arr[i], i, arr); + if (value != null) { + append(results, value); + } + } + + return results; + } + + module.exports = collect; + + diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/array/combine.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/array/combine.js new file mode 100644 index 0000000..d66e621 --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/array/combine.js @@ -0,0 +1,22 @@ +var indexOf = require('./indexOf'); + + /** + * Combines an array with all the items of another. + * Does not allow duplicates and is case and type sensitive. + */ + function combine(arr1, arr2) { + if (arr2 == null) { + return arr1; + } + + var i = -1, len = arr2.length; + while (++i < len) { + if (indexOf(arr1, arr2[i]) === -1) { + arr1.push(arr2[i]); + } + } + + return arr1; + } + module.exports = combine; + diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/array/compact.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/array/compact.js new file mode 100644 index 0000000..74c176e --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/array/compact.js @@ -0,0 +1,13 @@ +var filter = require('./filter'); + + /** + * Remove all null/undefined items from array. + */ + function compact(arr) { + return filter(arr, function(val){ + return (val != null); + }); + } + + module.exports = compact; + diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/array/contains.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/array/contains.js new file mode 100644 index 0000000..92bb6ad --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/array/contains.js @@ -0,0 +1,10 @@ +var indexOf = require('./indexOf'); + + /** + * If array contains values. + */ + function contains(arr, val) { + return indexOf(arr, val) !== -1; + } + module.exports = contains; + diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/array/difference.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/array/difference.js new file mode 100644 index 0000000..ca57524 --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/array/difference.js @@ -0,0 +1,23 @@ +var unique = require('./unique'); +var filter = require('./filter'); +var some = require('./some'); +var contains = require('./contains'); +var slice = require('./slice'); + + + /** + * Return a new Array with elements that aren't present in the other Arrays. + */ + function difference(arr) { + var arrs = slice(arguments, 1), + result = filter(unique(arr), function(needle){ + return !some(arrs, function(haystack){ + return contains(haystack, needle); + }); + }); + return result; + } + + module.exports = difference; + + diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/array/every.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/array/every.js new file mode 100644 index 0000000..ac59883 --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/array/every.js @@ -0,0 +1,27 @@ +var makeIterator = require('../function/makeIterator_'); + + /** + * Array every + */ + function every(arr, callback, thisObj) { + callback = makeIterator(callback, thisObj); + var result = true; + if (arr == null) { + return result; + } + + var i = -1, len = arr.length; + while (++i < len) { + // we iterate over sparse items since there is no way to make it + // work properly on IE 7-8. see #64 + if (!callback(arr[i], i, arr) ) { + result = false; + break; + } + } + + return result; + } + + module.exports = every; + diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/array/filter.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/array/filter.js new file mode 100644 index 0000000..f0e7419 --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/array/filter.js @@ -0,0 +1,26 @@ +var makeIterator = require('../function/makeIterator_'); + + /** + * Array filter + */ + function filter(arr, callback, thisObj) { + callback = makeIterator(callback, thisObj); + var results = []; + if (arr == null) { + return results; + } + + var i = -1, len = arr.length, value; + while (++i < len) { + value = arr[i]; + if (callback(value, i, arr)) { + results.push(value); + } + } + + return results; + } + + module.exports = filter; + + diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/array/find.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/array/find.js new file mode 100644 index 0000000..b4a7313 --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/array/find.js @@ -0,0 +1,13 @@ +var findIndex = require('./findIndex'); + + /** + * Returns first item that matches criteria + */ + function find(arr, iterator, thisObj){ + var idx = findIndex(arr, iterator, thisObj); + return idx >= 0? arr[idx] : void(0); + } + + module.exports = find; + + diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/array/findIndex.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/array/findIndex.js new file mode 100644 index 0000000..53f22a5 --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/array/findIndex.js @@ -0,0 +1,23 @@ +var makeIterator = require('../function/makeIterator_'); + + /** + * Returns the index of the first item that matches criteria + */ + function findIndex(arr, iterator, thisObj){ + iterator = makeIterator(iterator, thisObj); + if (arr == null) { + return -1; + } + + var i = -1, len = arr.length; + while (++i < len) { + if (iterator(arr[i], i, arr)) { + return i; + } + } + + return -1; + } + + module.exports = findIndex; + diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/array/findLast.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/array/findLast.js new file mode 100644 index 0000000..84ba4bf --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/array/findLast.js @@ -0,0 +1,13 @@ +var findLastIndex = require('./findLastIndex'); + + /** + * Returns last item that matches criteria + */ + function findLast(arr, iterator, thisObj){ + var idx = findLastIndex(arr, iterator, thisObj); + return idx >= 0? arr[idx] : void(0); + } + + module.exports = findLast; + + diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/array/findLastIndex.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/array/findLastIndex.js new file mode 100644 index 0000000..d5aacdc --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/array/findLastIndex.js @@ -0,0 +1,24 @@ +var makeIterator = require('../function/makeIterator_'); + + /** + * Returns the index of the last item that matches criteria + */ + function findLastIndex(arr, iterator, thisObj){ + iterator = makeIterator(iterator, thisObj); + if (arr == null) { + return -1; + } + + var n = arr.length; + while (n-- >= 0) { + if (iterator(arr[n], n, arr)) { + return n; + } + } + + return -1; + } + + module.exports = findLastIndex; + + diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/array/flatten.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/array/flatten.js new file mode 100644 index 0000000..aa9757a --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/array/flatten.js @@ -0,0 +1,43 @@ +var isArray = require('../lang/isArray'); +var append = require('./append'); + + /* + * Helper function to flatten to a destination array. + * Used to remove the need to create intermediate arrays while flattening. + */ + function flattenTo(arr, result, level) { + if (arr == null) { + return result; + } else if (level === 0) { + append(result, arr); + return result; + } + + var value, + i = -1, + len = arr.length; + while (++i < len) { + value = arr[i]; + if (isArray(value)) { + flattenTo(value, result, level - 1); + } else { + result.push(value); + } + } + return result; + } + + /** + * Recursively flattens an array. + * A new array containing all the elements is returned. + * If `shallow` is true, it will only flatten one level. + */ + function flatten(arr, level) { + level = level == null? -1 : level; + return flattenTo(arr, [], level); + } + + module.exports = flatten; + + + diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/array/forEach.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/array/forEach.js new file mode 100644 index 0000000..268e506 --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/array/forEach.js @@ -0,0 +1,23 @@ + + + /** + * Array forEach + */ + function forEach(arr, callback, thisObj) { + if (arr == null) { + return; + } + var i = -1, + len = arr.length; + while (++i < len) { + // we iterate over sparse items since there is no way to make it + // work properly on IE 7-8. see #64 + if ( callback.call(thisObj, arr[i], i, arr) === false ) { + break; + } + } + } + + module.exports = forEach; + + diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/array/indexOf.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/array/indexOf.js new file mode 100644 index 0000000..6a9ac83 --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/array/indexOf.js @@ -0,0 +1,28 @@ + + + /** + * Array.indexOf + */ + function indexOf(arr, item, fromIndex) { + fromIndex = fromIndex || 0; + if (arr == null) { + return -1; + } + + var len = arr.length, + i = fromIndex < 0 ? len + fromIndex : fromIndex; + while (i < len) { + // we iterate over sparse items since there is no way to make it + // work properly on IE 7-8. see #64 + if (arr[i] === item) { + return i; + } + + i++; + } + + return -1; + } + + module.exports = indexOf; + diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/array/insert.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/array/insert.js new file mode 100644 index 0000000..20bd442 --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/array/insert.js @@ -0,0 +1,15 @@ +var difference = require('./difference'); +var slice = require('./slice'); + + /** + * Insert item into array if not already present. + */ + function insert(arr, rest_items) { + var diff = difference(slice(arguments, 1), arr); + if (diff.length) { + Array.prototype.push.apply(arr, diff); + } + return arr.length; + } + module.exports = insert; + diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/array/intersection.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/array/intersection.js new file mode 100644 index 0000000..34957ab --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/array/intersection.js @@ -0,0 +1,24 @@ +var unique = require('./unique'); +var filter = require('./filter'); +var every = require('./every'); +var contains = require('./contains'); +var slice = require('./slice'); + + + /** + * Return a new Array with elements common to all Arrays. + * - based on underscore.js implementation + */ + function intersection(arr) { + var arrs = slice(arguments, 1), + result = filter(unique(arr), function(needle){ + return every(arrs, function(haystack){ + return contains(haystack, needle); + }); + }); + return result; + } + + module.exports = intersection; + + diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/array/invoke.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/array/invoke.js new file mode 100644 index 0000000..32ec584 --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/array/invoke.js @@ -0,0 +1,23 @@ +var slice = require('./slice'); + + /** + * Call `methodName` on each item of the array passing custom arguments if + * needed. + */ + function invoke(arr, methodName, var_args){ + if (arr == null) { + return arr; + } + + var args = slice(arguments, 2); + var i = -1, len = arr.length, value; + while (++i < len) { + value = arr[i]; + value[methodName].apply(value, args); + } + + return arr; + } + + module.exports = invoke; + diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/array/join.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/array/join.js new file mode 100644 index 0000000..71d8bd2 --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/array/join.js @@ -0,0 +1,17 @@ +var filter = require('./filter'); + + function isValidString(val) { + return (val != null && val !== ''); + } + + /** + * Joins strings with the specified separator inserted between each value. + * Null values and empty strings will be excluded. + */ + function join(items, separator) { + separator = separator || ''; + return filter(items, isValidString).join(separator); + } + + module.exports = join; + diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/array/lastIndexOf.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/array/lastIndexOf.js new file mode 100644 index 0000000..ee44a25 --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/array/lastIndexOf.js @@ -0,0 +1,28 @@ + + + /** + * Array lastIndexOf + */ + function lastIndexOf(arr, item, fromIndex) { + if (arr == null) { + return -1; + } + + var len = arr.length; + fromIndex = (fromIndex == null || fromIndex >= len)? len - 1 : fromIndex; + fromIndex = (fromIndex < 0)? len + fromIndex : fromIndex; + + while (fromIndex >= 0) { + // we iterate over sparse items since there is no way to make it + // work properly on IE 7-8. see #64 + if (arr[fromIndex] === item) { + return fromIndex; + } + fromIndex--; + } + + return -1; + } + + module.exports = lastIndexOf; + diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/array/map.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/array/map.js new file mode 100644 index 0000000..7b7fb33 --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/array/map.js @@ -0,0 +1,22 @@ +var makeIterator = require('../function/makeIterator_'); + + /** + * Array map + */ + function map(arr, callback, thisObj) { + callback = makeIterator(callback, thisObj); + var results = []; + if (arr == null){ + return results; + } + + var i = -1, len = arr.length; + while (++i < len) { + results[i] = callback(arr[i], i, arr); + } + + return results; + } + + module.exports = map; + diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/array/max.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/array/max.js new file mode 100644 index 0000000..0b8f259 --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/array/max.js @@ -0,0 +1,34 @@ +var makeIterator = require('../function/makeIterator_'); + + /** + * Return maximum value inside array + */ + function max(arr, iterator, thisObj){ + if (arr == null || !arr.length) { + return Infinity; + } else if (arr.length && !iterator) { + return Math.max.apply(Math, arr); + } else { + iterator = makeIterator(iterator, thisObj); + var result, + compare = -Infinity, + value, + temp; + + var i = -1, len = arr.length; + while (++i < len) { + value = arr[i]; + temp = iterator(value, i, arr); + if (temp > compare) { + compare = temp; + result = value; + } + } + + return result; + } + } + + module.exports = max; + + diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/array/min.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/array/min.js new file mode 100644 index 0000000..ed6cc6a --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/array/min.js @@ -0,0 +1,34 @@ +var makeIterator = require('../function/makeIterator_'); + + /** + * Return minimum value inside array + */ + function min(arr, iterator, thisObj){ + if (arr == null || !arr.length) { + return -Infinity; + } else if (arr.length && !iterator) { + return Math.min.apply(Math, arr); + } else { + iterator = makeIterator(iterator, thisObj); + var result, + compare = Infinity, + value, + temp; + + var i = -1, len = arr.length; + while (++i < len) { + value = arr[i]; + temp = iterator(value, i, arr); + if (temp < compare) { + compare = temp; + result = value; + } + } + + return result; + } + } + + module.exports = min; + + diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/array/pick.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/array/pick.js new file mode 100644 index 0000000..6408678 --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/array/pick.js @@ -0,0 +1,31 @@ +var randInt = require('../random/randInt'); + + /** + * Remove random item(s) from the Array and return it. + * Returns an Array of items if [nItems] is provided or a single item if + * it isn't specified. + */ + function pick(arr, nItems){ + if (nItems != null) { + var result = []; + if (nItems > 0 && arr && arr.length) { + nItems = nItems > arr.length? arr.length : nItems; + while (nItems--) { + result.push( pickOne(arr) ); + } + } + return result; + } + return (arr && arr.length)? pickOne(arr) : void(0); + } + + + function pickOne(arr){ + var idx = randInt(0, arr.length - 1); + return arr.splice(idx, 1)[0]; + } + + + module.exports = pick; + + diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/array/pluck.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/array/pluck.js new file mode 100644 index 0000000..fef4043 --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/array/pluck.js @@ -0,0 +1,12 @@ +var map = require('./map'); + + /** + * Extract a list of property values. + */ + function pluck(arr, propName){ + return map(arr, propName); + } + + module.exports = pluck; + + diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/array/range.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/array/range.js new file mode 100644 index 0000000..31d3c77 --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/array/range.js @@ -0,0 +1,27 @@ +var countSteps = require('../math/countSteps'); + + /** + * Returns an Array of numbers inside range. + */ + function range(start, stop, step) { + if (stop == null) { + stop = start; + start = 0; + } + step = step || 1; + + var result = [], + nSteps = countSteps(stop - start, step), + i = start; + + while (i <= stop) { + result.push(i); + i += step; + } + + return result; + } + + module.exports = range; + + diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/array/reduce.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/array/reduce.js new file mode 100644 index 0000000..827f428 --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/array/reduce.js @@ -0,0 +1,33 @@ + + + /** + * Array reduce + */ + function reduce(arr, fn, initVal) { + // check for args.length since initVal might be "undefined" see #gh-57 + var hasInit = arguments.length > 2, + result = initVal; + + if (arr == null || !arr.length) { + if (!hasInit) { + throw new Error('reduce of empty array with no initial value'); + } else { + return initVal; + } + } + + var i = -1, len = arr.length; + while (++i < len) { + if (!hasInit) { + result = arr[i]; + hasInit = true; + } else { + result = fn(result, arr[i], i, arr); + } + } + + return result; + } + + module.exports = reduce; + diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/array/reduceRight.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/array/reduceRight.js new file mode 100644 index 0000000..e36fd4a --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/array/reduceRight.js @@ -0,0 +1,34 @@ + + + /** + * Array reduceRight + */ + function reduceRight(arr, fn, initVal) { + // check for args.length since initVal might be "undefined" see #gh-57 + var hasInit = arguments.length > 2; + + if (arr == null || !arr.length) { + if (hasInit) { + return initVal; + } else { + throw new Error('reduce of empty array with no initial value'); + } + } + + var i = arr.length, result = initVal, value; + while (--i >= 0) { + // we iterate over sparse items since there is no way to make it + // work properly on IE 7-8. see #64 + value = arr[i]; + if (!hasInit) { + result = value; + hasInit = true; + } else { + result = fn(result, value, i, arr); + } + } + return result; + } + + module.exports = reduceRight; + diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/array/reject.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/array/reject.js new file mode 100644 index 0000000..0cfc8b1 --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/array/reject.js @@ -0,0 +1,25 @@ +var makeIterator = require('../function/makeIterator_'); + + /** + * Array reject + */ + function reject(arr, callback, thisObj) { + callback = makeIterator(callback, thisObj); + var results = []; + if (arr == null) { + return results; + } + + var i = -1, len = arr.length, value; + while (++i < len) { + value = arr[i]; + if (!callback(value, i, arr)) { + results.push(value); + } + } + + return results; + } + + module.exports = reject; + diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/array/remove.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/array/remove.js new file mode 100644 index 0000000..aa6517d --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/array/remove.js @@ -0,0 +1,13 @@ +var indexOf = require('./indexOf'); + + /** + * Remove a single item from the array. + * (it won't remove duplicates, just a single item) + */ + function remove(arr, item){ + var idx = indexOf(arr, item); + if (idx !== -1) arr.splice(idx, 1); + } + + module.exports = remove; + diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/array/removeAll.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/array/removeAll.js new file mode 100644 index 0000000..d5f7f3b --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/array/removeAll.js @@ -0,0 +1,15 @@ +var indexOf = require('./indexOf'); + + /** + * Remove all instances of an item from array. + */ + function removeAll(arr, item){ + var idx = indexOf(arr, item); + while (idx !== -1) { + arr.splice(idx, 1); + idx = indexOf(arr, item, idx); + } + } + + module.exports = removeAll; + diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/array/shuffle.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/array/shuffle.js new file mode 100644 index 0000000..99d0660 --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/array/shuffle.js @@ -0,0 +1,28 @@ +var randInt = require('../random/randInt'); + + /** + * Shuffle array items. + */ + function shuffle(arr) { + var results = [], + rnd; + if (arr == null) { + return results; + } + + var i = -1, len = arr.length, value; + while (++i < len) { + if (!i) { + results[0] = arr[0]; + } else { + rnd = randInt(0, i); + results[i] = results[rnd]; + results[rnd] = arr[i]; + } + } + + return results; + } + + module.exports = shuffle; + diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/array/slice.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/array/slice.js new file mode 100644 index 0000000..0a4d5cf --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/array/slice.js @@ -0,0 +1,35 @@ + + + /** + * Create slice of source array or array-like object + */ + function slice(arr, start, end){ + var len = arr.length; + + if (start == null) { + start = 0; + } else if (start < 0) { + start = Math.max(len + start, 0); + } else { + start = Math.min(start, len); + } + + if (end == null) { + end = len; + } else if (end < 0) { + end = Math.max(len + end, 0); + } else { + end = Math.min(end, len); + } + + var result = []; + while (start < end) { + result.push(arr[start++]); + } + + return result; + } + + module.exports = slice; + + diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/array/some.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/array/some.js new file mode 100644 index 0000000..8d17772 --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/array/some.js @@ -0,0 +1,27 @@ +var makeIterator = require('../function/makeIterator_'); + + /** + * Array some + */ + function some(arr, callback, thisObj) { + callback = makeIterator(callback, thisObj); + var result = false; + if (arr == null) { + return result; + } + + var i = -1, len = arr.length; + while (++i < len) { + // we iterate over sparse items since there is no way to make it + // work properly on IE 7-8. see #64 + if ( callback(arr[i], i, arr) ) { + result = true; + break; + } + } + + return result; + } + + module.exports = some; + diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/array/sort.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/array/sort.js new file mode 100644 index 0000000..7807339 --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/array/sort.js @@ -0,0 +1,55 @@ + + + /** + * Merge sort (http://en.wikipedia.org/wiki/Merge_sort) + */ + function mergeSort(arr, compareFn) { + if (arr == null) { + return []; + } else if (arr.length < 2) { + return arr; + } + + if (compareFn == null) { + compareFn = defaultCompare; + } + + var mid, left, right; + + mid = ~~(arr.length / 2); + left = mergeSort( arr.slice(0, mid), compareFn ); + right = mergeSort( arr.slice(mid, arr.length), compareFn ); + + return merge(left, right, compareFn); + } + + function defaultCompare(a, b) { + return a < b ? -1 : (a > b? 1 : 0); + } + + function merge(left, right, compareFn) { + var result = []; + + while (left.length && right.length) { + if (compareFn(left[0], right[0]) <= 0) { + // if 0 it should preserve same order (stable) + result.push(left.shift()); + } else { + result.push(right.shift()); + } + } + + if (left.length) { + result.push.apply(result, left); + } + + if (right.length) { + result.push.apply(result, right); + } + + return result; + } + + module.exports = mergeSort; + + diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/array/sortBy.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/array/sortBy.js new file mode 100644 index 0000000..b84544c --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/array/sortBy.js @@ -0,0 +1,19 @@ +var sort = require('./sort'); +var makeIterator = require('../function/makeIterator_'); + + /* + * Sort array by the result of the callback + */ + function sortBy(arr, callback, context){ + callback = makeIterator(callback, context); + + return sort(arr, function(a, b) { + a = callback(a); + b = callback(b); + return (a < b) ? -1 : ((a > b) ? 1 : 0); + }); + } + + module.exports = sortBy; + + diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/array/split.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/array/split.js new file mode 100644 index 0000000..4f3ba50 --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/array/split.js @@ -0,0 +1,35 @@ + + + /** + * Split array into a fixed number of segments. + */ + function split(array, segments) { + segments = segments || 2; + var results = []; + if (array == null) { + return results; + } + + var minLength = Math.floor(array.length / segments), + remainder = array.length % segments, + i = 0, + len = array.length, + segmentIndex = 0, + segmentLength; + + while (i < len) { + segmentLength = minLength; + if (segmentIndex < remainder) { + segmentLength++; + } + + results.push(array.slice(i, i + segmentLength)); + + segmentIndex++; + i += segmentLength; + } + + return results; + } + module.exports = split; + diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/array/toLookup.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/array/toLookup.js new file mode 100644 index 0000000..ce4c55d --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/array/toLookup.js @@ -0,0 +1,28 @@ +var isFunction = require('../lang/isFunction'); + + /** + * Creates an object that holds a lookup for the objects in the array. + */ + function toLookup(arr, key) { + var result = {}; + if (arr == null) { + return result; + } + + var i = -1, len = arr.length, value; + if (isFunction(key)) { + while (++i < len) { + value = arr[i]; + result[key(value)] = value; + } + } else { + while (++i < len) { + value = arr[i]; + result[value[key]] = value; + } + } + + return result; + } + module.exports = toLookup; + diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/array/union.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/array/union.js new file mode 100644 index 0000000..f1334a9 --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/array/union.js @@ -0,0 +1,19 @@ +var unique = require('./unique'); +var append = require('./append'); + + /** + * Concat multiple arrays and remove duplicates + */ + function union(arrs) { + var results = []; + var i = -1, len = arguments.length; + while (++i < len) { + append(results, arguments[i]); + } + + return unique(results); + } + + module.exports = union; + + diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/array/unique.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/array/unique.js new file mode 100644 index 0000000..5db2510 --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/array/unique.js @@ -0,0 +1,25 @@ +var filter = require('./filter'); + + /** + * @return {array} Array of unique items + */ + function unique(arr, compare){ + compare = compare || isEqual; + return filter(arr, function(item, i, arr){ + var n = arr.length; + while (++i < n) { + if ( compare(item, arr[i]) ) { + return false; + } + } + return true; + }); + } + + function isEqual(a, b){ + return a === b; + } + + module.exports = unique; + + diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/array/xor.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/array/xor.js new file mode 100644 index 0000000..c125a99 --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/array/xor.js @@ -0,0 +1,26 @@ +var unique = require('./unique'); +var filter = require('./filter'); +var contains = require('./contains'); + + + /** + * Exclusive OR. Returns items that are present in a single array. + * - like ptyhon's `symmetric_difference` + */ + function xor(arr1, arr2) { + arr1 = unique(arr1); + arr2 = unique(arr2); + + var a1 = filter(arr1, function(item){ + return !contains(arr2, item); + }), + a2 = filter(arr2, function(item){ + return !contains(arr1, item); + }); + + return a1.concat(a2); + } + + module.exports = xor; + + diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/array/zip.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/array/zip.js new file mode 100644 index 0000000..8bce9c0 --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/array/zip.js @@ -0,0 +1,28 @@ +var max = require('./max'); +var map = require('./map'); + + function getLength(arr) { + return arr == null ? 0 : arr.length; + } + + /** + * Merges together the values of each of the arrays with the values at the + * corresponding position. + */ + function zip(arr){ + var len = arr ? max(map(arguments, getLength)) : 0, + results = [], + i = -1; + while (++i < len) { + // jshint loopfunc: true + results.push(map(arguments, function(item) { + return item == null ? undefined : item[i]; + })); + } + + return results; + } + + module.exports = zip; + + diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/collection.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/collection.js new file mode 100644 index 0000000..d5cf6ca --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/collection.js @@ -0,0 +1,22 @@ + + +//automatically generated, do not edit! +//run `node build` instead +module.exports = { + 'contains' : require('./collection/contains'), + 'every' : require('./collection/every'), + 'filter' : require('./collection/filter'), + 'find' : require('./collection/find'), + 'forEach' : require('./collection/forEach'), + 'make_' : require('./collection/make_'), + 'map' : require('./collection/map'), + 'max' : require('./collection/max'), + 'min' : require('./collection/min'), + 'pluck' : require('./collection/pluck'), + 'reduce' : require('./collection/reduce'), + 'reject' : require('./collection/reject'), + 'size' : require('./collection/size'), + 'some' : require('./collection/some') +}; + + diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/collection/contains.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/collection/contains.js new file mode 100644 index 0000000..a73f994 --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/collection/contains.js @@ -0,0 +1,9 @@ +var make = require('./make_'); +var arrContains = require('../array/contains'); +var objContains = require('../object/contains'); + + /** + */ + module.exports = make(arrContains, objContains); + + diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/collection/every.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/collection/every.js new file mode 100644 index 0000000..300e03c --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/collection/every.js @@ -0,0 +1,9 @@ +var make = require('./make_'); +var arrEvery = require('../array/every'); +var objEvery = require('../object/every'); + + /** + */ + module.exports = make(arrEvery, objEvery); + + diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/collection/filter.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/collection/filter.js new file mode 100644 index 0000000..3875700 --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/collection/filter.js @@ -0,0 +1,23 @@ +var forEach = require('./forEach'); +var makeIterator = require('../function/makeIterator_'); + + /** + * filter collection values, returns array. + */ + function filter(list, iterator, thisObj) { + iterator = makeIterator(iterator, thisObj); + var results = []; + if (!list) { + return results; + } + forEach(list, function(value, index, list) { + if (iterator(value, index, list)) { + results[results.length] = value; + } + }); + return results; + } + + module.exports = filter; + + diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/collection/find.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/collection/find.js new file mode 100644 index 0000000..14317e6 --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/collection/find.js @@ -0,0 +1,10 @@ +var make = require('./make_'); +var arrFind = require('../array/find'); +var objFind = require('../object/find'); + + /** + * Find value that returns true on iterator check. + */ + module.exports = make(arrFind, objFind); + + diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/collection/forEach.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/collection/forEach.js new file mode 100644 index 0000000..6e28dcb --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/collection/forEach.js @@ -0,0 +1,9 @@ +var make = require('./make_'); +var arrForEach = require('../array/forEach'); +var objForEach = require('../object/forOwn'); + + /** + */ + module.exports = make(arrForEach, objForEach); + + diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/collection/make_.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/collection/make_.js new file mode 100644 index 0000000..4fb8a81 --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/collection/make_.js @@ -0,0 +1,19 @@ +var slice = require('../array/slice'); + + /** + * internal method used to create other collection modules. + */ + function makeCollectionMethod(arrMethod, objMethod, defaultReturn) { + return function(){ + var args = slice(arguments); + if (args[0] == null) { + return defaultReturn; + } + // array-like is treated as array + return (typeof args[0].length === 'number')? arrMethod.apply(null, args) : objMethod.apply(null, args); + }; + } + + module.exports = makeCollectionMethod; + + diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/collection/map.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/collection/map.js new file mode 100644 index 0000000..fc157f5 --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/collection/map.js @@ -0,0 +1,23 @@ +var isObject = require('../lang/isObject'); +var values = require('../object/values'); +var arrMap = require('../array/map'); +var makeIterator = require('../function/makeIterator_'); + + /** + * Map collection values, returns Array. + */ + function map(list, callback, thisObj) { + callback = makeIterator(callback, thisObj); + // list.length to check array-like object, if not array-like + // we simply map all the object values + if( isObject(list) && list.length == null ){ + list = values(list); + } + return arrMap(list, function (val, key, list) { + return callback(val, key, list); + }); + } + + module.exports = map; + + diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/collection/max.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/collection/max.js new file mode 100644 index 0000000..a8490e7 --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/collection/max.js @@ -0,0 +1,10 @@ +var make = require('./make_'); +var arrMax = require('../array/max'); +var objMax = require('../object/max'); + + /** + * Get maximum value inside collection + */ + module.exports = make(arrMax, objMax); + + diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/collection/min.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/collection/min.js new file mode 100644 index 0000000..51d9f14 --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/collection/min.js @@ -0,0 +1,10 @@ +var make = require('./make_'); +var arrMin = require('../array/min'); +var objMin = require('../object/min'); + + /** + * Get minimum value inside collection. + */ + module.exports = make(arrMin, objMin); + + diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/collection/pluck.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/collection/pluck.js new file mode 100644 index 0000000..9b28377 --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/collection/pluck.js @@ -0,0 +1,14 @@ +var map = require('./map'); + + /** + * Extract a list of property values. + */ + function pluck(list, key) { + return map(list, function(value) { + return value[key]; + }); + } + + module.exports = pluck; + + diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/collection/reduce.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/collection/reduce.js new file mode 100644 index 0000000..4c07573 --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/collection/reduce.js @@ -0,0 +1,9 @@ +var make = require('./make_'); +var arrReduce = require('../array/reduce'); +var objReduce = require('../object/reduce'); + + /** + */ + module.exports = make(arrReduce, objReduce); + + diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/collection/reject.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/collection/reject.js new file mode 100644 index 0000000..2a92e3b --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/collection/reject.js @@ -0,0 +1,16 @@ +var filter = require('./filter'); +var makeIterator = require('../function/makeIterator_'); + + /** + * Inverse or collection/filter + */ + function reject(list, iterator, thisObj) { + iterator = makeIterator(iterator, thisObj); + return filter(list, function(value, index, list) { + return !iterator(value, index, list); + }, thisObj); + } + + module.exports = reject; + + diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/collection/size.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/collection/size.js new file mode 100644 index 0000000..244e33e --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/collection/size.js @@ -0,0 +1,19 @@ +var isArray = require('../lang/isArray'); +var objSize = require('../object/size'); + + /** + * Get collection size + */ + function size(list) { + if (!list) { + return 0; + } + if (isArray(list)) { + return list.length; + } + return objSize(list); + } + + module.exports = size; + + diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/collection/some.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/collection/some.js new file mode 100644 index 0000000..48fd252 --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/collection/some.js @@ -0,0 +1,9 @@ +var make = require('./make_'); +var arrSome = require('../array/some'); +var objSome = require('../object/some'); + + /** + */ + module.exports = make(arrSome, objSome); + + diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/date.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/date.js new file mode 100644 index 0000000..9c2efe9 --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/date.js @@ -0,0 +1,22 @@ + + +//automatically generated, do not edit! +//run `node build` instead +module.exports = { + 'dayOfTheYear' : require('./date/dayOfTheYear'), + 'diff' : require('./date/diff'), + 'i18n_' : require('./date/i18n_'), + 'isLeapYear' : require('./date/isLeapYear'), + 'isSame' : require('./date/isSame'), + 'parseIso' : require('./date/parseIso'), + 'quarter' : require('./date/quarter'), + 'startOf' : require('./date/startOf'), + 'strftime' : require('./date/strftime'), + 'timezoneAbbr' : require('./date/timezoneAbbr'), + 'timezoneOffset' : require('./date/timezoneOffset'), + 'totalDaysInMonth' : require('./date/totalDaysInMonth'), + 'totalDaysInYear' : require('./date/totalDaysInYear'), + 'weekOfTheYear' : require('./date/weekOfTheYear') +}; + + diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/date/dayOfTheYear.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/date/dayOfTheYear.js new file mode 100644 index 0000000..85905c5 --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/date/dayOfTheYear.js @@ -0,0 +1,13 @@ +var isDate = require('../lang/isDate'); + + /** + * return the day of the year (1..366) + */ + function dayOfTheYear(date){ + return (Date.UTC(date.getFullYear(), date.getMonth(), date.getDate()) - + Date.UTC(date.getFullYear(), 0, 1)) / 86400000 + 1; + } + + module.exports = dayOfTheYear; + + diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/date/diff.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/date/diff.js new file mode 100644 index 0000000..1131cdc --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/date/diff.js @@ -0,0 +1,130 @@ +var totalDaysInMonth = require('./totalDaysInMonth'); +var totalDaysInYear = require('./totalDaysInYear'); +var convert = require('../time/convert'); + + /** + * calculate the difference between dates (range) + */ + function diff(start, end, unitName){ + // sort the dates to make it easier to process (specially year/month) + if (start > end) { + var swap = start; + start = end; + end = swap; + } + + var output; + + if (unitName === 'month') { + output = getMonthsDiff(start, end); + } else if (unitName === 'year'){ + output = getYearsDiff(start, end); + } else if (unitName != null) { + if (unitName === 'day') { + // ignore timezone difference because of daylight savings time + start = toUtc(start); + end = toUtc(end); + } + output = convert(end - start, 'ms', unitName); + } else { + output = end - start; + } + + return output; + } + + + function toUtc(d){ + // we ignore timezone differences on purpose because of daylight + // savings time, otherwise it would return fractional days/weeks even + // if a full day elapsed. eg: + // Wed Feb 12 2014 00:00:00 GMT-0200 (BRST) + // Sun Feb 16 2014 00:00:00 GMT-0300 (BRT) + // diff should be 4 days and not 4.041666666666667 + return Date.UTC(d.getUTCFullYear(), d.getUTCMonth(), d.getUTCDate(), + d.getHours(), d.getMinutes(), d.getSeconds(), + d.getMilliseconds()); + } + + + function getMonthsDiff(start, end){ + return getElapsedMonths(start, end) + + getElapsedYears(start, end) * 12 + + getFractionalMonth(start, end); + } + + + function getYearsDiff(start, end){ + var elapsedYears = getElapsedYears(start, end); + return elapsedYears + getFractionalYear(start, end, elapsedYears); + } + + + function getElapsedMonths(start, end){ + var monthDiff = end.getMonth() - start.getMonth(); + if (monthDiff < 0) { + monthDiff += 12; + } + // less than a full month + if (start.getDate() > end.getDate()) { + monthDiff -= 1; + } + return monthDiff; + } + + + function getElapsedYears(start, end){ + var yearDiff = end.getFullYear() - start.getFullYear(); + // less than a full year + if (start.getMonth() > end.getMonth()) { + yearDiff -= 1; + } + return yearDiff; + } + + + function getFractionalMonth(start, end){ + var fractionalDiff = 0; + var startDay = start.getDate(); + var endDay = end.getDate(); + + if (startDay !== endDay) { + var startTotalDays = totalDaysInMonth(start); + var endTotalDays = totalDaysInMonth(end); + var totalDays; + var daysElapsed; + + if (startDay > endDay) { + // eg: Jan 29 - Feb 27 (29 days elapsed but not a full month) + var baseDay = startTotalDays - startDay; + daysElapsed = endDay + baseDay; + // total days should be relative to 1st day of next month if + // startDay > endTotalDays + totalDays = (startDay > endTotalDays)? + endTotalDays + baseDay + 1 : startDay + baseDay; + } else { + // fractional is only based on endMonth eg: Jan 12 - Feb 18 + // (6 fractional days, 28 days until next full month) + daysElapsed = endDay - startDay; + totalDays = endTotalDays; + } + + fractionalDiff = daysElapsed / totalDays; + } + + return fractionalDiff; + } + + + function getFractionalYear(start, end, elapsedYears){ + var base = elapsedYears? + new Date(end.getFullYear(), start.getMonth(), start.getDate()) : + start; + var elapsedDays = diff(base, end, 'day'); + return elapsedDays / totalDaysInYear(end); + } + + + module.exports = diff; + + diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/date/i18n/de-DE.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/date/i18n/de-DE.js new file mode 100644 index 0000000..b3ab620 --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/date/i18n/de-DE.js @@ -0,0 +1,61 @@ + + // de-DE (German) + module.exports = { + "am" : "", + "pm" : "", + + "x": "%d/%m/%y", + "X": "%H:%M:%S", + "c": "%a %d %b %Y %H:%M:%S %Z", + + "months" : [ + "Januar", + "Februar", + "März", + "April", + "Mai", + "Juni", + "Juli", + "August", + "September", + "Oktober", + "November", + "Dezember" + ], + + "months_abbr" : [ + "Jan", + "Febr", + "März", + "Apr", + "Mai", + "Juni", + "Juli", + "Aug", + "Sept", + "Okt", + "Nov", + "Dez" + ], + + "days" : [ + "Sonntag", + "Montag", + "Dienstag", + "Mittwoch", + "Donnerstag", + "Freitag", + "Samstag" + ], + + "days_abbr" : [ + "So", + "Mo", + "Di", + "Mi", + "Do", + "Fr", + "Sa" + ] + }; + diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/date/i18n/en-US.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/date/i18n/en-US.js new file mode 100644 index 0000000..f9526ce --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/date/i18n/en-US.js @@ -0,0 +1,61 @@ + + // en-US (English, United States) + module.exports = { + "am" : "AM", + "pm" : "PM", + + "x": "%m/%d/%y", + "X": "%H:%M:%S", + "c": "%a %d %b %Y %I:%M:%S %p %Z", + + "months" : [ + "January", + "February", + "March", + "April", + "May", + "June", + "July", + "August", + "September", + "October", + "November", + "December" + ], + + "months_abbr" : [ + "Jan", + "Feb", + "Mar", + "Apr", + "May", + "Jun", + "Jul", + "Aug", + "Sep", + "Oct", + "Nov", + "Dec" + ], + + "days" : [ + "Sunday", + "Monday", + "Tuesday", + "Wednesday", + "Thursday", + "Friday", + "Saturday" + ], + + "days_abbr" : [ + "Sun", + "Mon", + "Tue", + "Wed", + "Thu", + "Fri", + "Sat" + ] + }; + diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/date/i18n/pt-BR.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/date/i18n/pt-BR.js new file mode 100644 index 0000000..71ebadb --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/date/i18n/pt-BR.js @@ -0,0 +1,61 @@ + + // pt-BR (Brazillian Portuguese) + module.exports = { + "am" : "", + "pm" : "", + + "x": "%d/%m/%y", + "X": "%H:%M:%S", + "c": "%a %d %b %Y %H:%M:%S %Z", + + "months" : [ + "Janeiro", + "Fevereiro", + "Março", + "Abril", + "Maio", + "Junho", + "Julho", + "Agosto", + "Setembro", + "Outubro", + "Novembro", + "Dezembro" + ], + + "months_abbr" : [ + "Jan", + "Fev", + "Mar", + "Abr", + "Mai", + "Jun", + "Jul", + "Ago", + "Set", + "Out", + "Nov", + "Dez" + ], + + "days" : [ + "Domingo", + "Segunda", + "Terça", + "Quarta", + "Quinta", + "Sexta", + "Sábado" + ], + + "days_abbr" : [ + "Dom", + "Seg", + "Ter", + "Qua", + "Qui", + "Sex", + "Sáb" + ] + }; + diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/date/i18n_.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/date/i18n_.js new file mode 100644 index 0000000..723fc10 --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/date/i18n_.js @@ -0,0 +1,14 @@ +var mixIn = require('../object/mixIn'); +var enUS = require('./i18n/en-US'); + + // we also use mixIn to make sure we don't affect the original locale + var activeLocale = mixIn({}, enUS, { + // we expose a "set" method to allow overriding the global locale + set : function(localeData){ + mixIn(activeLocale, localeData); + } + }); + + module.exports = activeLocale; + + diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/date/isLeapYear.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/date/isLeapYear.js new file mode 100644 index 0000000..4212870 --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/date/isLeapYear.js @@ -0,0 +1,15 @@ +var isDate = require('../lang/isDate'); + + /** + * checks if it's a leap year + */ + function isLeapYear(fullYear){ + if (isDate(fullYear)) { + fullYear = fullYear.getFullYear(); + } + return fullYear % 400 === 0 || (fullYear % 100 !== 0 && fullYear % 4 === 0); + } + + module.exports = isLeapYear; + + diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/date/isSame.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/date/isSame.js new file mode 100644 index 0000000..4097d29 --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/date/isSame.js @@ -0,0 +1,16 @@ +var startOf = require('./startOf'); + + /** + * Check if date is "same" with optional period + */ + function isSame(date1, date2, period){ + if (period) { + date1 = startOf(date1, period); + date2 = startOf(date2, period); + } + return Number(date1) === Number(date2); + } + + module.exports = isSame; + + diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/date/parseIso.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/date/parseIso.js new file mode 100644 index 0000000..40a70a8 --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/date/parseIso.js @@ -0,0 +1,146 @@ +var some = require('../array/some'); + + var datePatterns = [ + /^([0-9]{4})$/, // YYYY + /^([0-9]{4})-([0-9]{2})$/, // YYYY-MM (YYYYMM not allowed) + /^([0-9]{4})-?([0-9]{2})-?([0-9]{2})$/ // YYYY-MM-DD or YYYYMMDD + ]; + var ORD_DATE = /^([0-9]{4})-?([0-9]{3})$/; // YYYY-DDD + + var timePatterns = [ + /^([0-9]{2}(?:\.[0-9]*)?)$/, // HH.hh + /^([0-9]{2}):?([0-9]{2}(?:\.[0-9]*)?)$/, // HH:MM.mm + /^([0-9]{2}):?([0-9]{2}):?([0-9]{2}(\.[0-9]*)?)$/ // HH:MM:SS.ss + ]; + + var DATE_TIME = /^(.+)T(.+)$/; + var TIME_ZONE = /^(.+)([+\-])([0-9]{2}):?([0-9]{2})$/; + + function matchAll(str, patterns) { + var match; + var found = some(patterns, function(pattern) { + return !!(match = pattern.exec(str)); + }); + + return found ? match : null; + } + + function getDate(year, month, day) { + var date = new Date(Date.UTC(year, month, day)); + + // Explicitly set year to avoid Date.UTC making dates < 100 relative to + // 1900 + date.setUTCFullYear(year); + + var valid = + date.getUTCFullYear() === year && + date.getUTCMonth() === month && + date.getUTCDate() === day; + return valid ? +date : NaN; + } + + function parseOrdinalDate(str) { + var match = ORD_DATE.exec(str); + if (match ) { + var year = +match[1], + day = +match[2], + date = new Date(Date.UTC(year, 0, day)); + + if (date.getUTCFullYear() === year) { + return +date; + } + } + + return NaN; + } + + function parseDate(str) { + var match, year, month, day; + + match = matchAll(str, datePatterns); + if (match === null) { + // Ordinal dates are verified differently. + return parseOrdinalDate(str); + } + + year = (match[1] === void 0) ? 0 : +match[1]; + month = (match[2] === void 0) ? 0 : +match[2] - 1; + day = (match[3] === void 0) ? 1 : +match[3]; + + return getDate(year, month, day); + } + + function getTime(hr, min, sec) { + var valid = + (hr < 24 && hr >= 0 && + min < 60 && min >= 0 && + sec < 60 && min >= 0) || + (hr === 24 && min === 0 && sec === 0); + if (!valid) { + return NaN; + } + + return ((hr * 60 + min) * 60 + sec) * 1000; + } + + function parseOffset(str) { + var match; + if (str.charAt(str.length - 1) === 'Z') { + str = str.substring(0, str.length - 1); + } else { + match = TIME_ZONE.exec(str); + if (match) { + var hours = +match[3], + minutes = (match[4] === void 0) ? 0 : +match[4], + offset = getTime(hours, minutes, 0); + + if (match[2] === '-') { + offset *= -1; + } + + return { offset: offset, time: match[1] }; + } + } + + // No time zone specified, assume UTC + return { offset: 0, time: str }; + } + + function parseTime(str) { + var match; + var offset = parseOffset(str); + + str = offset.time; + offset = offset.offset; + if (isNaN(offset)) { + return NaN; + } + + match = matchAll(str, timePatterns); + if (match === null) { + return NaN; + } + + var hours = (match[1] === void 0) ? 0 : +match[1], + minutes = (match[2] === void 0) ? 0 : +match[2], + seconds = (match[3] === void 0) ? 0 : +match[3]; + + return getTime(hours, minutes, seconds) - offset; + } + + /** + * Parse an ISO8601 formatted date string, and return a Date object. + */ + function parseISO8601(str){ + var match = DATE_TIME.exec(str); + if (!match) { + // No time specified + return parseDate(str); + } + + return parseDate(match[1]) + parseTime(match[2]); + } + + module.exports = parseISO8601; + + diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/date/quarter.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/date/quarter.js new file mode 100644 index 0000000..8f61076 --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/date/quarter.js @@ -0,0 +1,16 @@ + + + /** + * gets date quarter + */ + function quarter(date){ + var month = date.getMonth(); + if (month < 3) return 1; + if (month < 6) return 2; + if (month < 9) return 3; + return 4; + } + + module.exports = quarter; + + diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/date/startOf.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/date/startOf.js new file mode 100644 index 0000000..072bc0e --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/date/startOf.js @@ -0,0 +1,54 @@ +var clone = require('../lang/clone'); + + /** + * get a new Date object representing start of period + */ + function startOf(date, period){ + date = clone(date); + + // intentionally removed "break" from switch since start of + // month/year/etc should also reset the following periods + switch (period) { + case 'year': + date.setMonth(0); + /* falls through */ + case 'month': + date.setDate(1); + /* falls through */ + case 'week': + case 'day': + date.setHours(0); + /* falls through */ + case 'hour': + date.setMinutes(0); + /* falls through */ + case 'minute': + date.setSeconds(0); + /* falls through */ + case 'second': + date.setMilliseconds(0); + break; + default: + throw new Error('"'+ period +'" is not a valid period'); + } + + // week is the only case that should reset the weekDay and maybe even + // overflow to previous month + if (period === 'week') { + var weekDay = date.getDay(); + var baseDate = date.getDate(); + if (weekDay) { + if (weekDay >= baseDate) { + //start of the week is on previous month + date.setDate(0); + } + date.setDate(date.getDate() - date.getDay()); + } + } + + return date; + } + + module.exports = startOf; + + diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/date/strftime.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/date/strftime.js new file mode 100644 index 0000000..5e56633 --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/date/strftime.js @@ -0,0 +1,121 @@ +var pad = require('../number/pad'); +var lpad = require('../string/lpad'); +var i18n = require('./i18n_'); +var dayOfTheYear = require('./dayOfTheYear'); +var timezoneOffset = require('./timezoneOffset'); +var timezoneAbbr = require('./timezoneAbbr'); +var weekOfTheYear = require('./weekOfTheYear'); + + var _combinations = { + 'D': '%m/%d/%y', + 'F': '%Y-%m-%d', + 'r': '%I:%M:%S %p', + 'R': '%H:%M', + 'T': '%H:%M:%S', + 'x': 'locale', + 'X': 'locale', + 'c': 'locale' + }; + + + /** + * format date based on strftime format + */ + function strftime(date, format, localeData){ + localeData = localeData || i18n; + var reToken = /%([a-z%])/gi; + + function makeIterator(fn) { + return function(match, token){ + return fn(date, token, localeData); + }; + } + + return format + .replace(reToken, makeIterator(expandCombinations)) + .replace(reToken, makeIterator(convertToken)); + } + + + function expandCombinations(date, token, l10n){ + if (token in _combinations) { + var expanded = _combinations[token]; + return expanded === 'locale'? l10n[token] : expanded; + } else { + return '%'+ token; + } + } + + + function convertToken(date, token, l10n){ + switch (token){ + case 'a': + return l10n.days_abbr[date.getDay()]; + case 'A': + return l10n.days[date.getDay()]; + case 'h': + case 'b': + return l10n.months_abbr[date.getMonth()]; + case 'B': + return l10n.months[date.getMonth()]; + case 'C': + return pad(Math.floor(date.getFullYear() / 100), 2); + case 'd': + return pad(date.getDate(), 2); + case 'e': + return pad(date.getDate(), 2, ' '); + case 'H': + return pad(date.getHours(), 2); + case 'I': + return pad(date.getHours() % 12, 2); + case 'j': + return pad(dayOfTheYear(date), 3); + case 'l': + return lpad(date.getHours() % 12, 2); + case 'L': + return pad(date.getMilliseconds(), 3); + case 'm': + return pad(date.getMonth() + 1, 2); + case 'M': + return pad(date.getMinutes(), 2); + case 'n': + return '\n'; + case 'p': + return date.getHours() >= 12? l10n.pm : l10n.am; + case 'P': + return convertToken(date, 'p', l10n).toLowerCase(); + case 's': + return date.getTime() / 1000; + case 'S': + return pad(date.getSeconds(), 2); + case 't': + return '\t'; + case 'u': + var day = date.getDay(); + return day === 0? 7 : day; + case 'U': + return pad(weekOfTheYear(date), 2); + case 'w': + return date.getDay(); + case 'W': + return pad(weekOfTheYear(date, 1), 2); + case 'y': + return pad(date.getFullYear() % 100, 2); + case 'Y': + return pad(date.getFullYear(), 4); + case 'z': + return timezoneOffset(date); + case 'Z': + return timezoneAbbr(date); + case '%': + return '%'; + default: + // keep unrecognized tokens + return '%'+ token; + } + } + + + module.exports = strftime; + + diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/date/timezoneAbbr.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/date/timezoneAbbr.js new file mode 100644 index 0000000..b100687 --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/date/timezoneAbbr.js @@ -0,0 +1,17 @@ +var timezoneOffset = require('./timezoneOffset'); + + /** + * Abbreviated time zone name or similar information. + */ + function timezoneAbbr(date){ + // Date.toString gives different results depending on the + // browser/system so we fallback to timezone offset + // chrome: 'Mon Apr 08 2013 09:02:04 GMT-0300 (BRT)' + // IE: 'Mon Apr 8 09:02:04 UTC-0300 2013' + var tz = /\(([A-Z]{3,4})\)/.exec(date.toString()); + return tz? tz[1] : timezoneOffset(date); + } + + module.exports = timezoneAbbr; + + diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/date/timezoneOffset.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/date/timezoneOffset.js new file mode 100644 index 0000000..9492dce --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/date/timezoneOffset.js @@ -0,0 +1,16 @@ +var pad = require('../number/pad'); + + /** + * time zone as hour and minute offset from UTC (e.g. +0900) + */ + function timezoneOffset(date){ + var offset = date.getTimezoneOffset(); + var abs = Math.abs(offset); + var h = pad(Math.floor(abs / 60), 2); + var m = pad(abs % 60, 2); + return (offset > 0? '-' : '+') + h + m; + } + + module.exports = timezoneOffset; + + diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/date/totalDaysInMonth.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/date/totalDaysInMonth.js new file mode 100644 index 0000000..8aafeb8 --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/date/totalDaysInMonth.js @@ -0,0 +1,25 @@ +var isDate = require('../lang/isDate'); +var isLeapYear = require('./isLeapYear'); + + var DAYS_IN_MONTH = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]; + + /** + * returns the total amount of days in the month (considering leap years) + */ + function totalDaysInMonth(fullYear, monthIndex){ + if (isDate(fullYear)) { + var date = fullYear; + year = date.getFullYear(); + monthIndex = date.getMonth(); + } + + if (monthIndex === 1 && isLeapYear(fullYear)) { + return 29; + } else { + return DAYS_IN_MONTH[monthIndex]; + } + } + + module.exports = totalDaysInMonth; + + diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/date/totalDaysInYear.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/date/totalDaysInYear.js new file mode 100644 index 0000000..b4b7e9b --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/date/totalDaysInYear.js @@ -0,0 +1,13 @@ +var isLeapYear = require('./isLeapYear'); + + /** + * return the amount of days in the year following the gregorian calendar + * and leap years + */ + function totalDaysInYear(fullYear){ + return isLeapYear(fullYear)? 366 : 365; + } + + module.exports = totalDaysInYear; + + diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/date/weekOfTheYear.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/date/weekOfTheYear.js new file mode 100644 index 0000000..dd51b7f --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/date/weekOfTheYear.js @@ -0,0 +1,16 @@ +var dayOfTheYear = require('./dayOfTheYear'); + + /** + * Return the week of the year based on given firstDayOfWeek + */ + function weekOfTheYear(date, firstDayOfWeek){ + firstDayOfWeek = firstDayOfWeek == null? 0 : firstDayOfWeek; + var doy = dayOfTheYear(date); + var dow = (7 + date.getDay() - firstDayOfWeek) % 7; + var relativeWeekDay = 6 - firstDayOfWeek - dow; + return Math.floor((doy + relativeWeekDay) / 7); + } + + module.exports = weekOfTheYear; + + diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/doc/array.md b/node_modules/bower/node_modules/bower-config/node_modules/mout/doc/array.md new file mode 100644 index 0000000..a69c333 --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/doc/array.md @@ -0,0 +1,903 @@ +# array # + +Array utilities. + + + + +## append(arr1, arr2):Array + +Appends an array to the end of the other. +The first array will be modified and will contain the appended items. + +See: [`union()`](#union), [`combine()`](#combine) + +```js +var foo = ['a', 'b'], + bar = ['b', 'd']; + +append(foo, bar); // ['a', 'b', 'b', 'd'] +``` + + + +## collect(arr, callback, [thisObj]):Array + +Maps the items in `arr` and concatenates the resulting arrays. + +See: [`map()`](#map) + +```js +collect([1, 2, 3], function(val) { + return [val, val % 2]; +}); // [1, 1, 2, 0, 3, 1]; + +collect(['a', 'bb', ''], function(val) { + return val.split(''); +}); // ['a', 'b', 'b'] +``` + +It also supports a shorthand syntax: + +```js +var items = [{ a: [1] }, { b: 'foo' }, { a: [2, 3] }]; +collect(items, 'a'); // [1, 2, 3]; +``` + + + +## combine(arr1, arr2):Array + +Combines an array with all the items of another. +The first array will be modified and will contain the combined items. +Does not allow duplicates and is case and type sensitive. + +See: [`union()`](#union), [`append()`](#append) + +```js +var foo = ['a', 'b'], + bar = ['b', 'd']; + +combine(foo, bar); // ['a', 'b', 'd'] +``` + + + +## compact(arr):Array + +Returns a new Array without any `null` or `undefined` values. Note that it will +keep empty strings and other falsy values (simillar to Ruby Array#compact). + +```js +var arr = [0, 1, null, false, '', 'foo', undefined, 'bar']; +compact(arr); // [0, 1, false, '', 'foo', 'bar']; +``` + + + +## contains(arr, value):Boolean + +Checks if Array contains value. Alias to `indexOf(arr, val) !== -1`. + +```js +var arr = [1, 2, 3]; +contains(arr, 2); // true +contains(arr, 'foo'); // false +``` + + + +## difference(...arrs):Array + +Return a new Array with elements that aren't present in the other Arrays +besides the first one. + +Works like [Python set#difference](http://docs.python.org/library/stdtypes.html#set.difference). + +It will remove duplicates. + +See: [`xor()`](#xor), [`intersection()`](#intersection) + +```js +var a = ['a', 'b', 1]; +var b = ['c', 1]; +difference(a, b); // ['a', 'b'] +``` + + + +## every(arr, callback, [thisObj]):Array + +Crossbrowser `Array.every()`. + +Tests whether all elements in the array pass the test implemented by the provided function. + +It differs from ES5 since it will also loop over sparse items in the array to +normalize the behavior across browsers (avoid inconsistencies). + +```js +var items = [1, 'foo', 'bar']; +every(items, isString); // false +every(items, isFunction); // false +every(items, function(val, key, arr){ + return val != null; +}); // true +``` + +more info at [MDN Array#every](https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Array/every) + +It also supports a shorthand syntax: + +```js +var items = [{id:1, active:true}, {id:3, active:true}, {id:8, active:true}]; +// all items with `id === 8` +every(items, {id:8}); // false +// `active` is truthy on all items +every(items, 'active'); // true +``` + + + +## filter(arr, callback, [thisObj]):Array + +Crossbrowser `Array.filter()`. + +Creates a new array with all elements that pass the callback test. + +It differs from ES5 since it will also loop over sparse items in the array to +normalize the behavior across browsers (avoid inconsistencies). + +```js +var nums = [1, 2, 3, 4, 5, 6]; +var oddNumbers = filter(nums, function(val, key, arr){ + return (val % 2) !== 0; +}); +// > [1, 3, 5] +``` + +more info at [MDN Array#filter](https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Array/filter) + +Filter also supports shorthand notation: + +```js +var users = [ + {name:'john', surname:'connor', beard:false}, + {name:'john', surname:'doe', beard:true}, + {name:'jane', surname:'doe', beard:false} +]; +// filter item that matches all properties/values pairs +filter(arr, {name:'john', beard:false}); +// > [{name:'john', surnname:'connor', beard:false}] +// items where 'beard' is a truthy value +filter(arr, 'beard'); +// > [{name:'john', surnname:'doe', beard:true}] +``` + +See [`reject()`](#reject) + + + +## find(arr, callback, [thisObj]):* + +Loops through all the items in the Array and returns the first one that passes +a truth test (callback). + +```js +var arr = [123, {a:'b'}, 'foo', 'bar']; +find(arr, isString); // "foo" +find(arr, isNumber); // 123 +find(arr, isObject); // {a:'b'} +``` + +Find also supports shorthand notation: + +```js +var users = [ + {name:'john', surname:'connor', beard:false}, + {name:'john', surname:'doe', beard:true} +]; +// first item that matches all properties/values pairs +find(arr, {name:'john'}); // {name:'john', surnname:'connor', beard:false} +// first item where 'beard' is a truthy value +find(arr, 'beard'); // {name:'john', surnname:'doe', beard:true} +``` + +See: [findIndex()](#findIndex), [findLast()](#findLast), +[findLastIndex()](#findLastIndex) + + + +## findLast(arr, callback, [thisObj]):* + +Loops through all the items in the Array (starting from last item) and returns +the first one that passes a truth test (callback). + +```js +var arr = [123, {a:'b'}, 'foo', 'bar']; +findLast(arr, isString); // "bar" +findLast(arr, isNumber); // 123 +findLast(arr, isObject); // {a:'b'} +``` + +`findLast` also supports shorthand notation: + +```js +var users = [ + {name:'john', surname:'connor', beard:false}, + {name:'john', surname:'doe', beard:true} +]; +// last item that matches all properties/values pairs +findLast(arr, {name:'john'}); // {name:'john', surnname:'doe', beard:true} +// last item where 'beard' is a truthy value +findLast(arr, 'beard'); // {name:'john', surnname:'doe', beard:true} +``` + +See: [find()](#find), [findIndex()](#findIndex), +[findLastIndex()](#findLastIndex) + + + +## findIndex(arr, iterator, [thisObj]):Number + +Loops through the items in the Array and returns the index of the first one +that passes a truth test (callback). + +Returns `-1` if no item was found that passes the truth test. + +```js +var arr = [1, { a: 1 }, 'foo', 'bar']; +findIndex(arr, isString); // 2 +findIndex(arr, isNumber); // 0 +findIndex(arr, isObject); // 1 +findIndex(arr, isRegExp); // -1 +``` + +`findIndex` also supports shorthand notation: + +```js +var pets = [ + { pet: 'dog', name: 'Sam' }, + { pet: 'dog', name: 'Maggie' } +]; + +findIndex(pets, { pet: 'dog' }); // 0 +findIndex(pets, { name: 'Maggie' }); // 1 +``` + +See: [find()](#find), [findLastIndex()](#findLastIndex) + + + +## findLastIndex(arr, iterator, [thisObj]):Number + +Loops through the items in the Array on the reverse order and returns the index +of the first one that passes a truth test (callback). + +Returns `-1` if no item was found that passes the truth test. + +```js +var arr = [1, { a: 1 }, 'foo', 'bar']; +findLastIndex(arr, isString); // 3 +findLastIndex(arr, isNumber); // 0 +findLastIndex(arr, isObject); // 1 +findLastIndex(arr, isRegExp); // -1 +``` + +`findLastndex` also supports shorthand notation: + +```js +var pets = [ + { pet: 'dog', name: 'Sam' }, + { pet: 'dog', name: 'Maggie' } +]; + +findLastIndex(pets, { pet: 'dog' }); // 1 +findLastIndex(pets, { name: 'Sam' }); // 0 +``` + +See: [find()](#find), [findIndex()](#findIndex) + + + +## flatten(arr, [level]):Array + +Recursively flattens an array. A new array containing all the elements is +returned. If `level` is specified, it will only flatten up to that level. + +### Example + +```js +flatten([1, [2], [3, [4, 5]]]); +// > [1, 2, 3, 4, 5] +flatten([1, [2], [3, [4, 5]]], 1); +// > [1, 2, 3, [4, 5]] +``` + + + +## forEach(arr, callback, [thisObj]):void + +Crossbrowser `Array.forEach()`. + +It allows exiting the iteration early by returning `false` on the callback. + +It differs from ES5 since it will also loop over sparse items in the array to +normalize the behavior across browsers (avoid inconsistencies). + +```js +var items = ['foo', 'bar', 'lorem', 'ipsum']; +forEach(items, function(val, key, arr){ + console.log(key +' : '+ val); + if (val === 'lorem') { + // stop iteration (break) + return false; + } +}); +``` + +more info at [MDN Array#forEach](https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Array/forEach) + + + +## indexOf(arr, item, [fromIndex]):Number + +Crossbrowser `Array.indexOf()`. + +It differs from ES5 since it will also loop over sparse items in the array to +normalize the behavior across browsers (avoid inconsistencies). + +more info at [MDN Array#indexOf](https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Array/indexOf) + + + + +## insert(arr, ...items):Number + +Push items into array only if they aren't contained by it. Returns the new +`length` of the array. + +See: [`remove()`](#remove), [`removeAll()`](#removeAll), +[`contains()`](#contains) + +```js +var arr = ['a', 'b']; +insert(arr, 'a'); // 2 : ['a', 'b'] +insert(arr, 'c'); // 3 : ['a', 'b', 'c'] +insert(arr, 1, 2, 'b'); // 5 : ['a', 'b', 'c', 1, 2] +``` + + + +## intersection(...arrs):Array + +Return a new Array with elements common to all Arrays. + +Similar to Python set#intersection and underscore.js intersection. + +It will remove duplicates. + +See: [`difference()`](#difference), [`xor()`](#xor) + +```js +var a = ['a', 'b', 1], + b = ['c', 1], + c = [1, 2, 3]; +intersection(a, b, c); // [1] +``` + + + +## invoke(arr, methodName[, ...args]):Array + +Call `methodName` on each item of the array passing custom arguments if needed. + +```js +invoke([[3,2,1], [9,5,2]], 'sort'); // [[1,2,3], [2,5,9]] +``` + + + +## join(arr, [separator]):String + +Joins the strings in `arr`, inserting `separator` between each value. + +This ignores null values and empty strings that are in the array. `separator` +defaults to an empty string. This will convert all non-string objects in the +array to a string. + +### Example + +```js +join(['a', 'b', 'c']); // 'abc' +join(['foo', 'bar'], ', '); // 'foo, bar' +join([null, 'foo', '', 'bar', undefined], ':'); // 'foo:bar' +``` + + + +## lastIndexOf(arr, item, [fromIndex]):Number + +Crossbrowser `Array.lastIndexOf()`. + +It differs from ES5 since it will also loop over sparse items in the array to +normalize the behavior across browsers (avoid inconsistencies). + +more info at [MDN Array#lastIndexOf](https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Array/lastIndexOf) + + + +## map(arr, callback, [thisObj]]):Array + +Crossbrowser `Array.map()`. + +Creates a new array with the results of calling a provided function on every +element in this array. + +It differs from ES5 since it will also loop over sparse items in the array to +normalize the behavior across browsers (avoid inconsistencies). + +See: [`collect()`](#collect) + +```js +var nums = [1,2,3,4]; +var double = map(nums, function(val, key, arr){ + return val * 2; +}); +// > [2, 4, 6, 8] +``` + +more info at [MDN Array#map](https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Array/map) + +It also supports a shorthand notation which can be used to achieve same result +as [`array/pluck`](#pluck): + +```js +var src = ['lorem', 'ipsum', 'foo', 'amet']; +// grab the "length" property of all items +var lengths = map(src, 'length'); // [5, 5, 3, 4] +``` + + + +## max(arr, [iterator], [thisObj]):* + +Returns maximum value inside array or use a custom iterator to define how items +should be compared. + +See: [`min()`](#min) + +```js +max([10, 2, 7]); // 10 +max(['foo', 'lorem', 'amet'], function(val){ + return val.length; +}); // 'lorem' +``` + +It also supports a shorthand notation: + +```js +max(['foo', 'lorem', 'amet'], 'length'); // "lorem" +``` + + + +## min(arr, [iterator], [thisObj]):* + +Returns minimum value inside array or use a custom iterator to define how items +should be compared. + +See: [`max()`](#max) + +```js +min([10, 2, 7]); // 2 +min(['foo', 'lorem', 'amet'], function(val){ + return val.length; +}); // 'foo' +``` + +It also supports a shorthand notation: + +```js +min(['foo', 'lorem', 'amet'], 'length'); // "foo" +``` + + + +## pick(arr, [nItems]):* + +Gets random item(s) and removes it from the original array. + +If `nItems` is specified it will return a new Array contained the *picked* +items otherwise it returns a single item. + +See: [`random/choice()`](./random.html#choice) + +### Example: + +```js +var arr = [1, 2, 3, 4, 5, 6]; +var item1 = pick(arr); // 4 +var item2 = pick(arr); // 1 +var items = pick(arr, 2); // [5, 2] +console.log(arr); // [3, 6] +``` + + + +## pluck(arr, propName):Array + +Extract a list of property values. + +See: [`function/prop()`](function.html#prop) + +```js +var users = [{name : 'John', age: 21}, {name: 'Jane', age : 27}]; +var names = pluck(users, 'name'); // ["John", "Jane"] +var ages = pluck(users, 'age'); // [21, 27] +``` + + + +## range([start], stop[, step]):Array + +Creates a new Array with all the values inside the range. Works similarly to +Python#range or PHP#range. + +### Arguments + + 1. `[start]` (Number) : Range start. Default is `0`. + 2. `stop` (Number) : Range limit. + 3. `[step]` (Number) : Step size. Default is `1`. + +### Example + +```js +range(5); // [0, 1, 2, 3, 4, 5] +range(0, 5); // [0, 1, 2, 3, 4, 5] +range(0, 5, 2); // [0, 2, 4] +range(20, 40, 5); // [20, 25, 30, 35, 40] +``` + + + +## reduce(arr, fn):* + +Crossbrowser `Array.reduce()`. + +Apply a function against an accumulator and each value of the array (from +left-to-right) as to reduce it to a single value. + +It differs from ES5 since it will also loop over sparse items in the array to +normalize the behavior across browsers (avoid inconsistencies). + +more info at [MDN Array#reduce](https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Array/reduce) + + + +## reduceRight(arr, fn):* + +Crossbrowser `Array.reduceRight()`. + +Apply a function simultaneously against two values of the array (from +right-to-left) as to reduce it to a single value. + +It differs from ES5 since it will also loop over sparse items in the array to +normalize the behavior across browsers (avoid inconsistencies). + +more info at [MDN Array#reduceRight](https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Array/reduceRight) + + + +## reject(arr, fn, thisObj):Array + +Creates a new array with all the elements that do **not** pass the truth test. +Opposite of [`filter()`](#filter). + +See [`filter()`](#filter) + +### Example + +```js +var numbers = [1, 2, 3, 4, 5, 6]; +reject(numbers, function(x) { return (x % 2) !== 0; }); // [2, 4, 6] +``` + +It also supports a shorthand syntax: + +```js +var users = [ + {name:'john', surname:'connor', beard:false}, + {name:'john', surname:'doe', beard:true}, + {name:'jane', surname:'doe', beard:false} +]; +// reject items that matches all properties/values pairs +reject(arr, {name:'john'}); +// > [{name:'jane', surnname:'doe', beard:false}] +// reject items where 'beard' is a truthy value +filter(arr, 'beard'); +// > [{name:'john', surnname:'connor', beard:false}, +// {name:'jane', surname:'doe', beard:false}] +``` + + + +## remove(arr, item):void + +Remove a single item from the array. + +IMPORTANT: it won't remove duplicates, just a single item. + +### Example + +```js +var foo = [1, 2, 3, 4]; +remove(foo, 2); +console.log(foo); // [1, 3, 4] +``` + + + +## removeAll(arr, item):void + +Remove all instances of an item from the array. + +### Example + +```js +var foo = [1, 2, 3, 4, 2, 2]; +removeAll(foo, 2); +console.log(foo); // [1, 3, 4]; +``` + + + +## shuffle(arr):Array + +Returns a new Array with items randomly sorted (shuffled). Similar to Ruby Array#shuffle. + +### Example + +```js +var arr = ['a', 'b', 'c', 'd', 'e']; +shuffle(arr); // ['b', 'd', 'e', 'c', 'a'] +``` + + + +## slice(arr, [start], [end]):Array + +Returns a new array containing the items from `arr` from the start index to the +end index. + +If `start` is omitted, it will start at `0`. If `end` is omitted, it will used +the last index of the array. If `start` or `end` is negative, it is used as an +offset from the end of the array. + +It will also convert array-like objects to arrays. + +### Example + +```js +slice([1, 2, 3, 4], 1, 2); // [2, 3] +slice([1, 2, 3], 1); // [2, 3] +slice([1, 2, 3]); // [1, 2, 3] +slice({ length: 2, 0: 'a', 1: 'b' }); // ['a', 'b'] +slice([1, 2, 3], 0, -1); // [1, 2] +slice([1, 2, 3], -2); // [2, 3] +``` + + + +## some(arr, callback, [thisObj]):Array + +Crossbrowser `Array.some()`. + +Tests whether some element in the array passes the test implemented by the provided function. + +It differs from ES5 since it will also loop over sparse items in the array to +normalize the behavior across browsers (avoid inconsistencies). + +```js +var items = [1, 'foo', 'bar']; +some(items, isString); // true +some(items, isFunction); // false +``` + +more info at [MDN Array#some](https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Array/some) + +It also supports a shorthand syntax: + +```js +var items = [{id:1, active:true}, {id:3, active:false}, {id:8, active:false}]; +// at least one item with `id === 8` +some(items, {id:8}); // true +// `active` is truthy on at least one item +some(items, 'active'); // true +``` + +see also: [`object/matches`](object.html#matches) + + + +## sort(arr, [compareFn]):Array + +Returns a sorted Array using the [Merge Sort](http://en.wikipedia.org/wiki/Merge_sort) algorithm (stable sort). + +The `Array.prototype.sort` browser implementations differ since the sorting algorithm isn't described in the ES spec - [in V8 it isn't stable](http://code.google.com/p/v8/issues/detail?id=90) and [on Firefox it is stable](https://bugzilla.mozilla.org/show_bug.cgi?id=224128) - so this function doesn't use the browser native implementation and is recommended in cases where a stable sort is required (items should preserve same order if already sorted). + +**Important:** It does logical comparisson by default (greater/less than) and +not a string comparisson like the native `Array#sort`. + +### compareFn + +If `compareFn` is supplied elements are sorted based on the value returned by +the `compareFn`. + + - If `compareFn(a, b)` is less than `0`, sort `a` to a lower index than `b`. + - If `compareFn(a, b)` returns `0`, leave `a` and `b` unchanged with respect + to each other, but sorted with respect to all different elements. + - If `compareFn(a, b)` is greater than `0`, sort `b` to a lower index than + `a`. + +See: [`sortBy`](#sortBy) + +### Example + +```js +sort([187, 23, 47, 987, 12, 59, 0]); // [0, 12, 23, 47, 59, 187, 987] +sort(['a', 'z', 'c', 'beta', 'b']); // ['a', 'b', 'beta', 'c', 'z'] + +// ['sit', 'amet', 'lorem', 'ipsum'] +sort(['lorem', 'ipsum', 'sit', 'amet'], function(a, b){ + // sort by length, items with same length + // will keep the relative order (stable) + return a.length - b.length; +}); + +// [4, 3, 2, 1] +sort([2, 3, 1, 4], function(a, b){ + // reverse sort + return b - a; +}); +``` + + + +## sortBy(arr, callback, [context]):Array + +Returns an array sorted by the result of the callback. + +The callback is called for each item that is to be sorted, and the +results of the callback are used to sort the array. The callback +is called with the item as the first parameter, optionally with +the provided context. + +It also supports a shorthand notation which can be used to sort by a property +name. + +See: [`sort`](#sort) + +```js +// Returns [{ a: 1 }, { a: 2 }, { a: 3 }] +sortBy([{ a: 1 }, { a: 3 }, { a: 2 }], + function(item) { return item.a; }); + +// Same as above, using shorthand notation +sortBy([{ a: 1 }, { a: 3 }, { a: 2 }], 'a'); +``` + + + +## split(arr, [segments]):Array + +Splits an array into a fixed number of segments. + +The number of segments is specified by `segments` and defaults to 2. If the +array cannot be evenly split, the first segments will contain the extra items. +If `arr` is empty, an empty array is returned. If `arr.length` is less than +`segments`, then the resulting array will have `arr.length` number of +single-element arrays. + +### Example +```js +split([1, 2, 3, 4, 5], 3) // [ [1, 2], [3, 4], [5] ] +split([1, 2, 3, 4, 5]) // [ [1, 2, 3], [4, 5] ] +split([]) // [] +split([1, 2], 3) // [ [1], [2] ] +``` + + + +## toLookup(arr, key):Object + +Create an object that indexes the items in the array by a key. If `key` is a function, the key for each value in the resulting object will be the result of calling the function with the value as an argument. Otherwise `key` specifies the property on each value to use as the key. + +### Example + +```js +var foo = [{ name: 'a', thing: 1 }, { name: 'b', thing: 2 }]; +// { a: { name: 'a', thing: 1 }, b: { name: 'b', thing: 2 } } +toLookup(foo, 'name'); +// same as above +toLookup(foo, function (value) { return value.name; }); +``` + + + +## union(...arrs):Array + +Concat multiple arrays removing duplicates. + +```js +var a = ['a', 'b'], + b = ['c', 'a'], + c = [1, 'b', 2, 3, 'a']; + +//note that unique remove from begin to end +union(a, b, c); // ['c', 1, 'b', 2, 3, 'a'] +``` + + + +## unique(arr, [compare]):Array + +Return a new Array of unique items. + +**IMPORTANT:** duplicates are removed starting from begining of array. + +```js +var arr = [1, 2, 3, 4, 2, 2, 4]; +var foo = unique(arr); +console.log(foo); +// > [1, 3, 2, 4]; + +// you also have the option to set a custom compare function +var users = [{name: 'john'}, {name: 'paul'}, {name: 'john'}]; +var uniqueNames = unique(arr, function(a, b){ + return a.name === b.name; +}); +console.log(uniqueNames); +// > [{name: 'paul'}, {name: 'john'}] +``` + + + +## xor(arr1, arr2):Array + +Exclusive OR. Returns items that are present in a single array. + +Works like [Python set#symmetric_difference](http://docs.python.org/library/stdtypes.html#set.symmetric_difference) renamed for brevity. + +It will remove duplicates. + +See: [`difference()`](#difference), [`intersection()`](#intersection) + +```js +var a = ['a', 'b', 1]; +var b = ['c', 1]; +xor(a, b); // ['a', 'b', 'c'] +``` + + + +## zip(...arrs):Array + +Groups the elements of each array at their corresponding indexes. + +Useful for separate data sources that are coordinated through matching array +indexes. For a matrix of nested arrays, `zip.apply(...)` can transpose the +matrix in a similar fashion. + +```js +// [['moe', 30, true], ['larry', 40, false], ['curly', 50, false]] +zip(['moe', 'larry', 'curly'], [30, 40, 50], [true, false, false]); +``` + + + + +------------------------------------------------------------------------------- + +For more usage examples check specs inside `/tests` folder. Unit tests are the +best documentation you can get... + diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/doc/collection.md b/node_modules/bower/node_modules/bower-config/node_modules/mout/doc/collection.md new file mode 100644 index 0000000..2ffcab1 --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/doc/collection.md @@ -0,0 +1,233 @@ +# collection # + +Methods for dealing with collections (Array or Objects). + + + +## contains(list, value):Boolean + +Checks if collection contains value. + +```js +contains({a: 1, b: 2, c: 'bar'}, 2); // true +contains([1, 2, 3], 'foo'); // false +``` + +See: [array/contains](array.html#contains), [object/contains](object.html#contains) + + + +## every(list, callback, [thisObj]):Boolean + +Tests whether all values in the collection pass the test implemented by the +provided callback. + +```js +var obj = { + a: 1, + b: 2, + c: 3, + d: 'string' +}; + +every(obj, isNumber); // false +``` + +See: [array/every](array.html#every), [object/every](object.html#every) + + + +## filter(list, callback, [thisObj]):Array + +Filter collection properties. + +See: [array/filter](array.html#filter), [object/filter](object.html#filter) + + + +## find(list, callback, [thisObj]):* + +Loops through all the values in the collection and returns the first one that +passes a truth test (callback). + +**Important:** loop order over objects properties isn't guaranteed to be the +same on all environments. + +```js +find({a: 'foo', b: 12}, isString); // 'foo' +find(['foo', 12], isNumber); // 12 +``` + +See: [array/find](array.html#find), [object/find](object.html#find) + + + +## forEach(list, callback, [thisObj]) + +Loop through all values of the collection. + +See: [array/forEach](array.html#forEach), [object/forOwn](object.html#forOwn) + + + +## map(list, callback, [thisObj]):Array + +Returns a new collection where the properties values are the result of calling +the callback for each property in the original collection. + +See: [array/map](array.html#map), [object/map](object.html#map) + + + +## max(list, [iterator]):* + +Returns maximum value inside collection or use a custom iterator to define how +items should be compared. + +See: [`min()`](#min), [array/max](array.html#max), [object/max](object.html#max) + +```js +max({a: 100, b: 2, c: 1, d: 3, e: 200}); // 200 +max(['foo', 'lorem', 'amet'], function(val){ + return val.length; +}); // 'lorem' +``` + + + +## min(list, [iterator]):* + +Returns minimum value inside collection or use a custom iterator to define how +items should be compared. + +See: [`max()`](#max), [array/min](array.html#min), [object/min](object.html#min) + +```js +min([10, 2, 7]); // 2 +min({a: 'foo', b: 'lorem', c: 'amet'}, function(val){ + return val.length; +}); // 'foo' +``` + + + +## pluck(list, propName):Array + +Extract a list of property values. + +```js +var users = [ + { + name : 'John', + age : 21 + }, + { + name : 'Jane', + age : 27 + } +]; + +pluck(users, 'name'); // ["John", "Jane"] +pluck(users, 'age'); // [21, 27] + +users = { + first: { + name : 'John', + age : 21 + }, + second: { + name : 'Mary', + age : 25 + } +}; + +pluck(users, 'name'); // ['John', 'Mary'] +``` + +See: [array/pluck](array.html#pluck), [object/pluck](object.html#pluck) + + + +## reduce(list, callback, initial, [thisObj]):* + +Apply a function against an accumulator and each value in the collection as to +reduce it to a single value. + +```js +var obj = {a: 1, b: 2, c: 3, d: 4}; + +function sum(prev, cur, key, list) { + return prev + cur; +} + +reduce(obj, sum); // 10 +``` + +See: [array/reduce](array.html#reduce), [object/reduce](object.html#reduce) + + + +## reject(list, fn, [thisObj]):Array + +Creates a new array with all the elements that do **not** pass the truth test. +Opposite of [`filter()`](#filter). + +### Example + +```js +var numbers = [1, 2, 3, 4, 5]; +reject(numbers, function(x) { return (x % 2) !== 0; }); // [2, 4] + +var obj = {a: 1, b: 2, c: 3, d: 4, e: 5}; +reject(obj, function(x) { return (x % 2) !== 0; }); // [2, 4] +``` + +See: [array/reject](array.html#reject), [object/reject](object.html#reject) + + + +## size(list):Number + +Returns the number of values in the collection. + +```js +var obj = { + foo : 1, + bar : 2, + lorem : 3 +}; +size(obj); // 3 +size([1,2,3]); // 3 +size(null); // 0 +``` + +See: [object/size](object.html#size) + + + +## some(list, callback, [thisObj]):Boolean + +Tests whether any values in the collection pass the test implemented by the +provided callback. + +```js +var obj = { + a: 1, + b: 2, + c: 3, + d: 'string' +}; + +some(obj, isNumber); // true +some(obj, isString); // true +some([1, 2, 3], isNumber) // true +some([1, 2, 3], isString) // false +``` + +See: [array/some](array.html#some), [object/some](object.html#some) + + +------------------------------------------------------------------------------- + +For more usage examples check specs inside `/tests` folder. Unit tests are the +best documentation you can get... diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/doc/date.md b/node_modules/bower/node_modules/bower-config/node_modules/mout/doc/date.md new file mode 100644 index 0000000..e140399 --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/doc/date.md @@ -0,0 +1,307 @@ +# date # + +Date utilities. + + +## dayOfTheYear(date):Number + +How many days elapsed since begining of the year (following gregorian +calendar). + +```js +// Jan 1st +dayOfTheYear(new Date(2013, 0, 1)); // 1 +// Dec 31th +dayOfTheYear(new Date(2013, 11, 31)); // 364 +``` + + + +## diff(date1, date2, [unitName]):Number + +Calculate the difference between dates (range). + +The returned value is always positive. The default `unitName` is `"ms"`. + +Available units: `year`, `month`, `week`, `day`, `hour`, `minute`, `second`, +`millisecond`. + +See: [`time/convert()`](time.html#convert) + +```js +var d1 = new Date(2012, 4, 5); +var d2 = new Date(2013, 4, 8); +diff(d1, d2); // 31795200000 +diff(d1, d2, 'hour'); // 8832 +diff(d1, d2, 'week'); // 52.57142857142857 +diff(d1, d2, 'month'); // 12.096774193548388 +diff(d1, d2, 'year'); // 1.0082191780821919 +``` + + + +## isLeapYear(fullYear|date):Boolean + +Checks if it's a [leap year](http://en.wikipedia.org/wiki/Leap_year) according +to the Gregorian calendar. + +see: [`totalDaysInMonth()`](#totalDaysInMonth) + +```js +isLeapYear(2012); // true +isLeapYear(2013); // false +isLeapYear(new Date(2012, 2, 28)); // true +``` + + +## isSame(date1, date2[, period]):Boolean + +Check if both dates are the "same". + +You can pass an optional *period* used to set the comparisson precision. + +Available periods: `year`, `month`, `week`, `day`, `hour`, `minute`, `second`. + +```js +var date1 = new Date(2013, 1, 3); +var date2 = new Date(2013, 2, 9); +isSame(date1, date2); // false +isSame(date1, date2, 'day'); // false +isSame(date1, date2, 'month'); // false +isSame(date1, date2, 'year'); // true +``` + + + +## parseIso(str):Number + +Parses an [ISO8601](http://en.wikipedia.org/wiki/Iso8601) date and returns the +number of milliseconds since January 1, 1970, 00:00:00 UTC, or `NaN` if it is +not a valid ISO8601 date. + +This parses *all* ISO8601 dates, including dates without times, [ordinal +dates](https://en.wikipedia.org/wiki/ISO_8601#Ordinal_dates), and the compact +representation (omitting delimeters). The only exception is [ISO week +dates](https://en.wikipedia.org/wiki/ISO_week_date), which are not parsed. + +If no time zone offset is specified, it assumes UTC time. + +```js +// Jan 01, 1970 00:00 GMT +parseIso('1970-01-01T00:00:00') // 0 +parseIso('1970-001') // 0 +parseIso('1970-01-01') // 0 +parseIso('19700101T000000.00') // 0 +parseIso('1970-01-01T02:00+02:00') // 0 + +// Jan 02, 2000 20:10 GMT+04:00 +parseIso('2000-01-02T20:10+04:00') // 946829400000 +``` + + +## quarter(date):Number + +Get a number between 1 to 4 that represents the quarter of the year. + +```js +quarter(new Date(2013, 1, 19)); // 1 +quarter(new Date(2013, 4, 12)); // 2 +quarter(new Date(2013, 7, 25)); // 3 +quarter(new Date(2013, 10, 8)); // 4 +``` + + +## startOf(date, period):Date + +Get a new Date at the start of the period. + +Available periods: `year`, `month`, `week`, `day`, `hour`, `minute`, `second`. + +```js +// Apr 05 2013 11:27:43 +var date = new Date(2013, 3, 5, 11, 27, 43, 123); +startOf(date, 'year'); // Jan 01 2013 00:00:00 +startOf(date, 'month'); // Apr 01 2013 00:00:00 +startOf(date, 'day'); // Apr 05 2013 00:00:00 +startOf(date, 'hour'); // Apr 05 2013 11:00:00 +``` + + + +## strftime(date, format, [l10n]):String + +Format date based on strftime format. + +Replaced tokens: + +
+
%a
locale's abbreviated weekday name.
+
%A
locale's full weekday name.
+
%b
locale's abbreviated month name.
+
%B
locale's full month name.
+
%c
locale's appropriate date and time representation.
+
%C
century number (the year divided by 100 and truncated +to an integer) as a decimal number [00..99].
+
%d
day of the month as a decimal number [01..31].
+
%D
same as %m/%d/%y.
+
%e
day of the month as a decimal number [1..31]; +a single digit is preceded by a space.
+
%F
The ISO 8601 date format (%Y-%m-%d)
+
%h
same as %b.
+
%H
hour (24-hour clock) as a decimal number [00..23].
+
%I
hour (12-hour clock) as a decimal number [01..12].
+
%j
day of the year as a decimal number [001..366].
+
%l
hour (12-hour clock) as a decimal number (range 1 to 12); single digits are preceded by a blank
+
%L
zero-padded milliseconds [000..999]
+
%m
month as a decimal number [01..12].
+
%M
minute as a decimal number [00..59].
+
%n
newline character.
+
%p
locale's equivalent of either "am" or "pm"
+
%P
locale's equivalent of either "AM" or "PM"
+
%r
time in a.m. and +p.m. notation; in the POSIX locale this is equivalent to %I:%M:%S %p.
+
%R
time in 24 hour notation (%H:%M).
+
%s
seconds since Epoch (1970-01-01 00:00:00 UTC)
+
%S
second as a decimal number [00..60].
+
%t
tab character.
+
%T
time (%H:%M:%S).
+
%u
weekday as a decimal number [1..7], with 1 representing +Monday.
+
%U
week number of the year (Sunday as the first day of +the week) as a decimal number [00..53].
+
%V
week number of the year (Monday as the first day of the +week) as a decimal number [01..53]. If the week containing 1 January has +four or more days in the new year, then it is considered week 1. Otherwise, +it is the last week of the previous year, and the next week is week 1.
+
%w
weekday as a decimal number [0..6], with 0 representing +Sunday.
+
%W
week number of the year (Monday as the first day of +the week) as a decimal number [00..53]. All days in a new year preceding +the first Monday are considered to be in week 0.
+
%x
locale's appropriate date representation.
+
%X
locale's appropriate time representation.
+
%y
year without century as a decimal number [00..99].
+
%Y
year with century as a decimal number.
+
%Z
timezone name or abbreviation, or by no bytes +if no timezone information exists.
+
%%
is replaced by %.
+
+ +```js +var date = new Date(2013, 3, 8, 9, 2, 4); +strftime(date, '%Y-%m-%d'); // "2013-04-08" +strftime(date, '%R'); // "09:02" +strftime(date, '%Y-%m-%dT%H:%M:%S%z'); // "2013-04-08T09:02:04+0000" +``` + +You can also set a custom locale: + +```js +var ptBr = require('mout/date/i18n/pt-BR'); +strftime(date, '%a, %d %b', ptBr); // 'Seg, 08 Abr' +strftime(date, '%A, %d %B', ptBr); // 'Segunda, 08 Abril' +``` + +To set it globally: + +```js +require('mout/date/i18n_').set( customLocaleData ); +``` + +See [date/i18n](https://github.com/mout/mout/tree/master/src/date/i18n) +for localization examples. + + + +## timezoneAbbr(date):String + +Return timezone abbreviation or similar data. + +The result will vary based on the OS/browser since some environments doesn't +provide enough info about the current locale. + +```js +// IE 7-8 +timezoneAbbr(new Date()); // "-0500" +// Chrome, FF, V8 +timezoneAbbr(new Date()); // "EST" +``` + + + +## timezoneOffset(date):String + +Return time zone as hour and minute offset from UTC (e.g. +0900). + +It's important to note that JavaScript Date object will use the system locale +info to determinate the [timezone +offset](https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Date/getTimezoneOffset) +and that daylight saving time affects the result. + +```js +// if system locale is EST +timezoneOffset(new Date()); // -0500 +``` + + + +## totalDaysInMonth(fullYear, monthIndex):Number + +Returns the amount of days in the month taking into consideration leap years +(following Gregorian calendar). + +see: [`isLeapYear()`](#isLeapYear) + +```js +totalDaysInMonth(2008, 1); // 29 (leap year) +totalDaysInMonth(2009, 1); // 28 + +// you can also pass a Date object as single argument +totalDaysInMonth( new Date(2013, 0, 1) ); // 31 +``` + + +## totalDaysInYear(fullYear):Number + +Returns the amount of days in the year taking into consideration leap years +(following Gregorian calendar). + +see: [`isLeapYear()`](#isLeapYear), [`totalDaysInMonth()`](#totalDaysInMonth) + +```js +totalDaysInYear(2008); // 366 (leap year) +totalDaysInYear(2009); // 365 + +// you can also pass a Date object as single argument +totalDaysInYear( new Date(2013, 0, 1) ); // 365 +``` + + + +## weekOfTheYear(date, [firstDayOfWeek]):Number + +Returns how many weeks elapsed since start of the year (`0..53`). + +`firstDayOfWeek` can be `0` (Sunday) or `1` (Monday). By default weeks start at +Sunday. + +It will return `0` if `date` is before the first `firstDayOfWeek` of the year. + +```js +// Tue Jan 01 2013 +weekOfTheYear( new Date(2013,0,1) ); // 0 +// Wed Jan 09 2013 +weekOfTheYear( new Date(2013,0,9) ); // 1 +// Sun Jan 01 2012 +weekOfTheYear( new Date(2012,0,1) ); // 1 +// Mon Jan 09 2012 +weekOfTheYear( new Date(2012,0,9) ); // 2 +``` + + + +------------------------------------------------------------------------------- + +For more usage examples check specs inside `/tests` folder. Unit tests are the +best documentation you can get... + diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/doc/function.md b/node_modules/bower/node_modules/bower-config/node_modules/mout/doc/function.md new file mode 100644 index 0000000..b35304a --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/doc/function.md @@ -0,0 +1,279 @@ +# function # + +Function*(al)* utilities. + + +## awaitDelay(fn, delay):Function + +Returns a function that ensures that `fn` is only called *after* `delay` +milliseconds have elapsed. When the returned function is called before the +delay has elapsed, it will wait until the delay has elapsed and then call `fn`. +When the returned function is called after the delay has elapsed, it will call +`fn` after the next "tick" (it will always be called asynchronously). The +context and arguments that the returned function is called in are applied to +`fn`. + +In the below example `onLoaded` will not be executed before a 1000 millisecond +delay. Even if `loadImages` loads and calls `callback` earlier. However, say +the images take 1500 milliseconds to load, it will trigger `onLoaded` +immediately. + +```js +var callback = after(onLoaded, 1000); +loadImages(callback); +function onLoaded(){ + console.log('loaded'); +} +``` + +You can also cancel de delayed call by simply using the native `clearTimeout` +method (like a regular `setTimeout` call). + +```js +var timeoutId = callback(); +// onLoaded won't be called since it was canceled before the 1000ms delay +clearTimeout(timeoutId); +``` + +### Arguments: + + 1. `fn` (Function) : Target Function + 2. `delay` (Number) : Delay of execution in milliseconds + +See: [`debounce()`](#debounce) + + + +## bind(fn, context, [...args]):Function + +Return a function that will execute in the given context, optionally adding any additional supplied parameters to the beginning of the arguments collection. + +### Arguments + + 1. `fn` (Function) : Target Function + 2. `context` (Object) : Execution context (object used as `this`) + 3. `[...args]` (*) : Arguments (0...n arguments) + +See: [`partial()`](#partial), [object/bindAll](./object.html#bindAll) + + + +## compose(...fn):Function + +Returns the composition of a list of functions, where each function consumes +the return value of the function that follows. In math terms, composing the +functions `f()`, `g()`, and `h()` produces `f(g(h()))`. + +```js +function add2(x) { return x + 2 } +function multi2(x) { return x * 2 } +map([1, 2, 3], compose(add2, multi2)); // [4, 6, 8] + +//same as +map([1, 2, 3], function(x){ + return add2( multi2(x) ); +}); +``` + + + +## constant(value):Function + +Returns a new function that will always return `value` when called. + +```js +var f = constant('foo'); +f(); // 'foo' + +// Provided arguments are ignored; value is always returned +f(1); // 'foo' + +f = constant({ foo: 'bar' }); +f(); // { foo: 'bar' } +``` + + + +## debounce(fn, delay[, isAsap]):Function + +Creates a function that will delay the execution of `fn` until after `delay` +milliseconds have elapsed since the last time it was invoked. + +Subsequent calls to the debounced function will return the result of the last +`fn` call. + +```js +// sometimes less is more +var lazyRedraw = debounce(redraw, 300); +foo.on.resize.add(lazyRedraw); +``` + +In this visualization, `|` is a debounced-function call and `X` is the actual +callback execution: + + Default + ||||||||||||||||||||||||| (pause) ||||||||||||||||||||||||| + X X + + Debounced with `isAsap == true`: + ||||||||||||||||||||||||| (pause) ||||||||||||||||||||||||| + X X + +You also have the option to cancel the debounced call if it didn't happen yet: + +```js +lazyRedraw(); +// lazyRedraw won't be called since `cancel` was called before the `delay` +lazyRedraw.cancel(); +``` + +See: [`throttle()`](#throttle) + + +## func(name):Function + +Returns a function that calls a method with given `name` on supplied object. +Useful for iteration methods like `array/map` and `array/forEach`. + +See: [`prop()`](#prop) + +```js +// will call the method `getName()` for each `user` +var names = map(users, func('getName')); +``` + + + +## identity(val):* + +Returns the first argument provided to it. + +```js +identity(3); // 3 +identity(1,2,3); // 1 +identity('foo'); // "foo" +``` + + + +## partial(fn, [...args]):Function + +Return a partially applied function supplying default arguments. + +This method is similar to [`bind`](#bind), except it does not alter the this +binding. + +### Arguments + + 1. `fn` (Function) : Target Function + 2. `[...args]` (*) : Arguments (0...n arguments) + +See: [`bind()`](#bind) + +```js +function add(a, b){ return a + b } +var add10 = partial(add, 10); +console.log( add10(2) ); // 12 +``` + + + +## prop(name):Function + +Returns a function that gets a property with given `name` from supplied object. +Useful for using in conjunction with `array/map` and/or for creating getters. + +See: [`array/pluck()`](array.html#pluck) + +```js +var users = [{name:"John", age:21}, {name:"Jane", age:25}]; +// ["John", "Jane"] +var names = map(users, prop('name')); +``` + + + +## series(...fn):Function + +Returns a function that will execute all the supplied functions in order and +passing the same parameters to all of them. Useful for combining multiple +`array/forEach` into a single one and/or for debugging. + +```js +// call `console.log()` and `doStuff()` for each item item in the array +forEach(arr, series(console.log, doStuff)); +``` + + + +## throttle(fn, interval):Function + +Creates a function that, when executed, will only call the `fn` function at +most once per every `interval` milliseconds. + +If the throttled function is invoked more than once during the wait timeout, +`fn` will also be called on the trailing edge of the timeout. + +Subsequent calls to the throttled function will return the result of the last +`fn` call. + +```js +// sometimes less is more +var lazyRedraw = throttle(redraw, 300); +foo.on.resize.add(lazyRedraw); +``` + +In this visualization, `|` is a throttled-function call and `X` is the actual +`fn` execution: + + ||||||||||||||||||||||||| (pause) ||||||||||||||||||||||||| + X X X X X X X X X X X X + +You also have the option to cancel the throttled call if it didn't happen yet: + +```js +lazyRedraw(); +setTimeout(function(){ + lazyRedraw(); + // lazyRedraw will be called only once since `cancel` was called before + // the `interval` for 2nd call completed + lazyRedraw.cancel(); +}, 250); +``` + +See: [`debounce()`](#debounce) + + +## timeout(fn, millis, context, [...args]):Number + +Functions as a wrapper for `setTimeout`. Calls a the function `fn` after a given delay `millis` in milliseconds. +The function is called within the specified context. The return value can be used to clear the timeout using `clearTimeout`. + +```js +var id = timeout(doStuff, 300, this); + +clearTimeout(id); +``` + +## times(n, callback, [context]):void + +Iterates over a callback `n` times. + +### Arguments + + 1. `n` (Number) : Number of iterations + 2. `callback` (Function) : Closure executed for every iteration + 3. `context` (Object) : Execution context (object used as `this`) + +```js +var output = ''; +times(5, function(i) { + output += i.toString(); +}); +// output: 01234 +``` + +------------------------------------------------------------------------------- + +For more usage examples check specs inside `/tests` folder. Unit tests are the +best documentation you can get... diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/doc/lang.md b/node_modules/bower/node_modules/bower-config/node_modules/mout/doc/lang.md new file mode 100644 index 0000000..8ac503f --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/doc/lang.md @@ -0,0 +1,469 @@ +# lang # + +Language Utilities. Easier inheritance, scope handling, type checks. + + + +## clone(val):* + +Clone native types like Object, Array, RegExp, Date and primitives. + +This method will not clone values that are referenced within `val`. It will +only copy the value reference to the new value. If the value is not a plain +object but is an object, it will return the value unchanged. + +### Example + +```js +var a = { foo: 'bar' }; +var b = clone(a); +console.log(a === b); // false +console.log(a.foo === b.foo); // true + +var c = [1, 2, 3]; +var d = clone(b); +console.log(c === d); // false +console.log(c); // [1, 2, 3] +``` + +See: [`deepClone()`](#deepClone) + + + +## createObject(parent, [props]):Object + +Create Object using prototypal inheritance and setting custom properties. + +Mix between [Douglas Crockford Prototypal Inheritance](http://javascript.crockford.com/prototypal.html) and [`object/mixIn`](./object.html#mixIn). + +### Arguments + + 1. `parent` (Object) : Parent Object + 2. `[props]` (Object) : Object properties + +### Example + +```js +var base = { + trace : function(){ + console.log(this.name); + } +}; + +var myObj = createObject(base, { + name : 'Lorem Ipsum' +}); + +myObject.trace(); // "Lorem Ipsum" +``` + + + +## ctorApply(constructor, args):Object + +Do `Function.prototype.apply()` on a constructor while maintaining prototype +chain. + +```js +function Person(name, surname) { + this.name = name; + this.surname = surname; +} + +Person.prototype.walk = function(){ + console.log(this.name +' is walking'); +}; + +var args = ['John', 'Doe']; + +// "similar" effect as calling `new Person("John", "Doe")` +var john = ctorApply(Person, args); +john.walk(); // "John is walking" +``` + + + +## deepClone(val, [instanceClone]):* + +Deep clone native types like Object, Array, RegExp, Date and primitives. + +The `instanceClone` function will be invoked to clone objects that are not +"plain" objects (as defined by [`isPlainObject`](#isPlainObject)) if it is +provided. If `instanceClone` is not specified, it will not attempt to clone +non-plain objects, and will copy the object reference. + +### Example + +```js +var a = {foo:'bar', obj: {a:1, b:2}}; +var b = deepClone(a); // {foo:'bar', obj: {a:1, b:2}} +console.log( a === b ); // false +console.log( a.obj === b.obj ); // false + +var c = [1, 2, [3, 4]]; +var d = deepClone(c); // [1, 2, [3, 4]] +var e = c.concat(); // [1, 2, [3, 4]] + +console.log( c[2] === d[2] ); // false +// concat doesn't do a deep clone, arrays are passed by reference +console.log( e[2] === d[2] ); // true + +function Custom() { } +function cloneCustom(x) { return new Custom(); } +var f = { test: new Custom() }; +var g = deepClone(f, cloneCustom); +g.test === f.test // false, since new Custom instance will be created +``` + +See: [`clone()`](#clone) + + + +## defaults(val, ...defaults):void + +Return first value that isn't `null` or `undefined`. + + function doSomethingAwesome(foo, bar) { + // default arguments + foo = defaults(foo, 'lorem'); + bar = defaults(bar, 123); + // ... + } + + + +## inheritPrototype(childCtor, parentCtor):Object + +Inherit the prototype methods from one constructor into another. + +Similar to [node.js util/inherits](http://nodejs.org/docs/latest/api/util.html#util_util_inherits_constructor_superconstructor). + +It returns the the `childCtor.prototype` for convenience. + +```js +function Foo(name){ + this.name = name; +} +Foo.prototype = { + getName : function(){ + return this.name; + } +}; + +function Bar(name){ + Foo.call(this, name); +} +//should be called before calling constructor +var proto = inheritPrototype(Bar, Foo); + +// for convenience we return the new prototype object +console.log(proto === Bar.prototype); // true + +var myObj = new Bar('lorem ipsum'); +myObj.getName(); // "lorem ipsum" + +console.log(myObj instanceof Foo); // true + +// you also have access to the "super" constructor +console.log(Bar.super_ === Foo); // true +``` + + +## is(x, y):Boolean + +Check if both values are identical/egal. + +```js +// wtfjs +NaN === NaN; // false +-0 === +0; // true + +is(NaN, NaN); // true +is(-0, +0); // false +is('a', 'b'); // false +``` + +See: [`isnt()`](#isnt) + + + +## isnt(x, y):Boolean + +Check if both values are not identical/egal. + +```js +// wtfjs +NaN === NaN; // false +-0 === +0; // true + +isnt(NaN, NaN); // false +isnt(-0, +0); // true +isnt('a', 'b'); // true +``` + +See: [`is()`](#is) + + + + +## isArguments(val):Boolean + +If value is an "Arguments" object. + + + +## isArray(val):Boolean + +If value is an Array. Uses native ES5 `Array.isArray()` if available. + + + +## isBoolean(val):Boolean + +If value is a Boolean. + + + +## isDate(val):Boolean + +If value is a Date. + + + +## isEmpty(val):Boolean + +Checks if Array/Object/String is empty. + + +```js +isEmpty(''); // true +isEmpty('bar'); // false +isEmpty([]); // true +isEmpty([1, 2]); // false +isEmpty({}); // true +isEmpty({a:1, b:2}); // false +``` + + +## isFinite(val):Boolean + +Checks if value is Finite. + +**IMPORTANT:** This is not the same as native `isFinite`, which will return +`true` for values that can be coerced into finite numbers. See +http://es5.github.com/#x15.1.2.5. + +```js +isFinite(123); // true +isFinite(Infinity); // false + +// this is different than native behavior +isFinite(''); // false +isFinite(true); // false +isFinite([]); // false +isFinite(null); // false +``` + + +## isFunction(val):Boolean + +If value is a Function. + + + +## isKind(val, kind):Boolean + +If value is of "kind". (used internally by some of the *isSomething* checks). + +Favor the other methods since strings are commonly mistyped and also because +some "kinds" can only be accurately checked by using other methods (e.g. +`Arguments`), some of the other checks are also faster. + +```js +isKind([1,2], 'Array'); // true +isKind(3, 'Array'); // false +isKind(3, 'Number'); // true +``` + +See: [`kindOf()`](#kindOf) + + + +## isInteger(val):Boolean + +Check if value is an integer. + +```js +isInteger(123); // true +isInteger(123.45); // false +isInteger({}); // false +isInteger('foo'); // false +isInteger('123'); // false +``` + + + +## isNaN(val):Boolean + +Check if value is not a number. + +It doesn't coerce value into number before doing the check, giving better +results than native `isNaN`. Returns `true` for everything besides numeric +values. + +**IMPORTANT:** behavior is very different than the native `isNaN` and way more +useful!!! See: http://es5.github.io/#x15.1.2.4 + +```js +isNaN(123); // false + +isNaN(NaN); // true +isNaN({}); // true +isNaN(undefined); // true +isNaN([4,5]); // true + +// these are all "false" on native isNaN and main reason why this module exists +isNaN(''); // true +isNaN(null); // true +isNaN(true); // true +isNaN(false); // true +isNaN("123"); // true +isNaN([]); // true +isNaN([5]); // true +``` + + + +## isNull(val):Boolean + +If value is `null`. + + + +## isNumber(val):Boolean + +If value is a Number. + + + +## isObject(val):Boolean + +If value is an Object. + + + +## isPlainObject(val):Boolean + +If the value is an Object created by the Object constructor. + + + +## isRegExp(val):Boolean + +If value is a RegExp. + + + +## isString(val):Boolean + +If value is a String. + + + +## isUndefined(val):Boolean + +If value is `undefined`. + + + +## kindOf(val):String + +Gets kind of value (e.g. "String", "Number", "RegExp", "Null", "Date"). +Used internally by `isKind()` and most of the other *isSomething* checks. + +```js +kindOf([1,2]); // "Array" +kindOf('foo'); // "String" +kindOf(3); // "Number" +``` + +See: [`isKind()`](#isKind) + + +## toArray(val):Array + +Convert array-like object into Array or wrap value into Array. + +```js +toArray({ + "0" : "foo", + "1" : "bar", + "length" : 2 +}); // ["foo", "bar"] + +function foo(){ + return toArray(arguments); +} +foo("lorem", 123); // ["lorem", 123] + +toArray("lorem ipsum"); // ["lorem ipsum"] +toArray(window); // [window] +toArray({foo:"bar", lorem:123}); // [{foo:"bar", lorem:123}] +``` + +See: object/values() + + + +## toNumber(val):Number + +Convert value into number. + +```js +// numeric values are typecasted as Number +toNumber('123'); // 123 +toNumber(-567); // -567 + +// falsy values returns zero +toNumber(''); // 0 +toNumber(null); // 0 +toNumber(undefined); // 0 +toNumber(false); // 0 + +// non-numeric values returns NaN +toNumber('asd'); // NaN +toNumber({}); // NaN +toNumber([]); // NaN + +// Date objects return milliseconds since epoch +toNumber(new Date(1985, 6, 23)); // 490935600000 +``` + + + +## toString(val):String + +Convert any value to its string representation. + +Will return an empty string for `undefined` or `null`, otherwise will convert +the value to its string representation. + +```js +// null and undefined are converted into empty strings +toString(null); // "" +toString(undefined); // "" + +toString(1); // "1" +toString([1,2,3]); // "1,2,3" +toString(false); // "false" + +// uses `val.toString()` to convert value +toString({toString:funtion(){ return 'foo'; }}); // "foo" +``` + + + +------------------------------------------------------------------------------- + +For more usage examples check specs inside `/tests` folder. Unit tests are the +best documentation you can get... diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/doc/math.md b/node_modules/bower/node_modules/bower-config/node_modules/mout/doc/math.md new file mode 100644 index 0000000..f45be3e --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/doc/math.md @@ -0,0 +1,298 @@ +# math # + +Math utilities. + + +## ceil(val[, step]):Number + +Round value up to full steps. Similar to `Math.ceil()` but can round value +to an arbitrary *radix*. + + ceil(7.2); // 8 + ceil(7.8); // 8 + ceil(7, 5); // 10 + ceil(11, 5); // 15 + ceil(15, 5); // 15 + +### Common use cases + +Round values by increments of 5/10/1000/etc. + +See: [`round()`](#round), [`floor()`](#floor), [`countSteps()`](#countSteps) + + + +## clamp(val, min, max):Number + +Clamps value inside range. + +`clamp()` is extremely useful in cases where you need to limit a value inside +a certain range. So instead of doing a complex `if/else` to filter/process the +value you can restrict it to always be inside the desired range: + + clamp(-5, 0, 10); // 0 + clamp(7, 1, 10); // 7 + clamp(8, 1, 10); // 8 + clamp(10, 1, 10); // 10 + clamp(11, 1, 10); // 10 + +If the value is smaller than `min` it returns the `min`, if `val` is higher +than `max` it returns `max`. + +### Common use cases + +Any situation where you need to limit a number inside a range like: slider +position, image galleries (so user can't skip to an image that doesn't +exist), drag and drop, scroll boundaries, etc. + +See: [`loop()`](#loop) + + + + +## countSteps(val, step[, overflow]):Number + +Count number of full steps. + +### Arguments: + + 1. `val` (Number) : Value. + 2. `step` (Number) : Step size. + 3. `[overflow]` (Number) : Maximum number of steps, nSteps will loop if +`>=` than overflow. + + +Count steps is very useful for cases where you need to know how many "full +steps" the number *completed*. Think of it as a division that only returns +integers and ignore remainders. + + countSteps(3, 5); // 0 + countSteps(6, 5); // 1 + countSteps(12, 5); // 2 + countSteps(18, 5); // 3 + countSteps(21, 5); // 4 + +You can also set an `overflow` which will reset the *counter* before reaching +this number. + + countSteps(3, 5, 3); // 0 + countSteps(6, 5, 3); // 1 + countSteps(12, 5, 3); // 2 + countSteps(18, 5, 3); // 0 + countSteps(21, 5, 3); // 1 + +### Common use cases + +#### How many items fit inside an area: + + var containerWidth = 100; + var itemWidth = 8; + var howManyFit = countSteps(containerWidth, itemWidth); // 12 + +#### Split value into different scales or convert value from one scale to another + +From [mout/time/parseMs](time.html#parseMs): + + function parseMs(ms){ + return { + milliseconds : countSteps(ms, 1, 1000), + seconds : countSteps(ms, 1000, 60), + minutes : countSteps(ms, 60000, 60), + hours : countSteps(ms, 3600000, 24), + days : countSteps(ms, 86400000) + }; + } + + // {days:27, hours:4, minutes:26, seconds:5, milliseconds:454} + parseMs(2348765454); + + + +## floor(val[, step]):Number + +Round value down to full steps. Similar to `Math.floor()` but can round value +to an arbitrary *radix*. (formerly `snap`) + + floor(7.2); // 7 + floor(7.8); // 7 + floor(7, 5); // 5 + floor(11, 5); // 10 + floor(15, 5); // 15 + +### Common use cases + +Round values by increments of 5/10/1000/etc. + +See: [`round()`](#round), [`ceil()`](#ceil), [`countSteps()`](#countSteps) + + + +## inRange(val, min, max[, threshold]):Boolean + +Checks if value is inside the range. + + inRange(-6, 1, 10); // false + inRange( 5, 1, 10); // true + inRange(12, 1, 10); // false + +The threshold can be useful when you want granular control of what should match +and/or the precision could change at runtime or by some configuration option, +avoids the clutter of adding/subtracting the `threshold` from `mix` and `max`. + + inRange(12, 1, 10, 2); // true + inRange(13, 1, 10, 2); // false + +### Common use cases + +Anything that needs to check if value is inside a range, be it collision +detection, limiting interaction by mouse position, ignoring parts of the logic +that shouldn't happen if value isn't valid, simplify `if/else` conditions, +making code more readable, etc... + + + + +## isNear(val, target, threshold):Boolean + +Check if value is close to target. + +Similar to `inRange()` but used to check if value is close to a certain value +or match the desired value. Basically to simplify `if/else` conditions and to +make code clearer. + + isNear( 10.2, 10, 0.5); // true + isNear( 10.5, 10, 0.5); // true + isNear(10.51, 10, 0.5); // false + +### Common use cases + +Games where a certain action should happen if an *actor* is close to a target, +gravity fields, any numeric check that has some tolerance. + + + + +## lerp(ratio, start, end):Number + +Linear interpolation. + + lerp(0.5, 0, 10); // 5 + lerp(0.75, 0, 10); // 7.5 + +### Common use cases + +Linear interpolation is commonly used to create animations of elements moving +from one point to another, where you simply update the current ratio (which in +this case represents time) and get back the position of the element at that +"frame". + +The core idea of `lerp` is that you are using a number that goes from `0` to +`1` to specify a ratio inside that scale. This concept can be applied to +convert numbers from different scales easily. + +See: [`map()`](#map), [`norm()`](#norm) + + + + +## loop(val, min, max):Number + +Loops value inside range. Will return `min` if `val > max` and `max` if `val +< min`, otherwise it returns `val`. + + loop(-1, 0, 10); // 10 + loop( 1, 0, 10); // 1 + loop( 5, 0, 10); // 5 + loop( 9, 0, 10); // 9 + loop(10, 0, 10); // 10 + loop(11, 0, 10); // 0 + +Similar to [`clamp()`](#clamp) but *loops* the value inside the range when an +overflow occurs. + +### Common use cases + +Image galleries, infinite scroll, any kind of logic that requires that the +first item should be displayed after the last one or the last one should be +displayed after first if going on the opposite direction. + +See: [`clamp()`](#clamp) + + + + +## map(val, min1, max1, min2, max2):Number + +Maps a number from one scale to another. + + map(3, 0, 4, -1, 1) // 0.5 + map(3, 0, 10, 0, 100) // 30 + +### Common use cases + +Very useful to convert values from/to multiple scales. + +Let's suppose we have a slider that needs to go from `2000` to `5000` and that slider +has `300px` of width, here is how we would translate the knob position into the +current value: + + var knobX = 123; + var sliderWid = 300; + var minVal = 2000; + var maxVal = 5000; + + var curVal = map(knobX, 0, sliderWid, minVal, maxVal); // 3230 + +See: [`lerp()`](#lerp), [`norm()`](#norm) + + + + +## norm(val, min, max):Number + +Gets normalized ratio of value inside range. + + norm(50, 0, 100); // 0.5 + norm(75, 0, 100); // 0.75 + +### Common use cases + +Convert values between scales, used by [`map()`](#map) internally. Direct +opposite of [`lerp()`](#lerp). + +See: [`lerp()`](#lerp), [`map()`](#map) + + + +## round(val[, step]):Number + +Round value to full steps. Similar to `Math.round()` but allow setting an +arbitrary *radix*. + + // default + round(0.22); // 0 + round(0.49); // 0 + round(0.51); // 1 + + // custom radix + round(0.22, 0.5); // 0 + round(0.49, 0.5); // 0.5 + round(0.51, 0.5); // 0.5 + round(0.74, 0.5); // 0.5 + round(0.75, 0.5); // 1 + round(1.24, 0.5); // 1 + round(1.25, 0.5); // 1.5 + round(1.74, 0.5); // 1.5 + +### Common use cases + +Round values by increments of 0.5/5/10/1000/etc. + +See: [`floor()`](#floor), [`ceil()`](#ceil), [`countSteps()`](#countSteps) + + + +------------------------------------------------------------------------------- + +For more usage more info check the specs and source code. + diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/doc/number.md b/node_modules/bower/node_modules/bower-config/node_modules/mout/doc/number.md new file mode 100644 index 0000000..dcad6e3 --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/doc/number.md @@ -0,0 +1,274 @@ +# number # + +Number utilities. + + +## abbreviate(val[, nDecimalDigits, dictionary]):String + +Abbreviate number to thousands (K), millions (M) or billions (B). + +The default value for `nDecimalDigits` is `1`. + +### Example + + abbreviate(123456); // "123.5K" + abbreviate(12345678); // "12.3M" + abbreviate(1234567890); // "1.2B" + +You can set the amount of decimal digits (default is `1`): + + abbreviate(543); // "0.5K" + abbreviate(543, 1); // "0.5K" + abbreviate(543, 2); // "0.54K" + abbreviate(543, 3); // "0.543K" + +You can customize the abbreviation by passing a custom "dictionary": + + var _ptbrDict = { + thousands : ' mil', + millions : ' Mi', + billions : ' Bi' + }; + function customAbbr(val) { + return abbreviate(val, 1, _ptbrDict); + } + + customAbbr(123456); // "123.5 mil" + customAbbr(12345678); // "12.3 Mi" + customAbbr(1234567890); // "1.2 Bi" + + + +## currencyFormat(val[, nDecimalDigits, decimalSeparator, thousandsSeparator]):String + +Format a number as currency. + +### Example: + + currencyFormat(1000); // "1,000.00" + currencyFormat(1000, 1); // "1,000.0" + currencyFormat(1000, 2, ',', '.'); // "1.000,00" + + + +## enforcePrecision(val, nDecimalDigits):Number + +Enforce a specific amount of decimal digits and also fix floating point +rounding issues. + +### Example: + +```js +enforcePrecision(0.615, 2); // 0.62 +enforcePrecision(0.625, 2); // 0.63 +//floating point rounding "error" (rounds to odd number) ++(0.615).toFixed(2); // 0.61 ++(0.625).toFixed(2); // 0.63 +``` + + +## isNaN(val):Boolean + +ES6 `Number.isNaN()`, checks if supplied value is `NaN`. + +```js +// only returns `true` for `NaN` +isNaN(NaN); // true +isNaN(0 / 0); // true + +// everything else is `false` +isNaN(true); // false +isNaN(123); // false +isNaN('asd'); // false +isNaN('NaN'); // false +``` + + +## MAX_INT:Number + +Maximum 32-bit signed integer value. `Math.pow(2, 31) - 1` + +### Example: + +```js +console.log( MAX_INT ); // 2147483647 +``` + + +## MAX_UINT:Number + +Maximum 32-bit unsigned integer value. `Math.pow(2, 32) - 1` + +### Example: + +```js +console.log( MAX_UINT ); // 4294967295 +``` + + +## MIN_INT:Number + +Minimum 32-bit signed integer value. `Math.pow(2, 31) * -1`. + +### Example: + +```js +console.log( MIN_INT ); // -2147483648 +``` + + +## nth(n):String + +Returns the "nth" of number. (`"st"`, `"nd"`, `"rd"`, `"th"`) + +```js +nth(1); // "st" +nth(2); // "nd" +nth(12); // "th" +nth(22); // "nd" +nth(23); // "rd" +nth(34); // "th" +``` + +See: [`ordinal()`](#ordinal) + + + +## ordinal(n):String + +Converts number into ordinal form (1st, 2nd, 3rd, 4th, ...) + +```js +ordinal(1); // "1st" +ordinal(2); // "2nd" +ordinal(3); // "3rd" +ordinal(14); // "14th" +ordinal(21); // "21st" +``` + +See: [`nth()`](#nth) + + + +## pad(n, minLength[, char]):String + +Add padding zeros if `n.length` < `minLength`. + +### Example: + +```js +pad(1, 5); // "00001" +pad(12, 5); // "00012" +pad(123, 5); // "00123" +pad(1234, 5); // "01234" +pad(12345, 5); // "12345" +pad(123456, 5); // "123456" + +// you can also specify the "char" used for padding +pad(12, 5, '_'); // "___12" +``` + +see: [string/lpad](./string.html#lpad) + + + +## rol(val, shift):Number + +Bitwise circular shift left. + +More info at [Wikipedia#Circular_shift](http://en.wikipedia.org/wiki/Circular_shift) + + + +## ror(val, shift):Number + +Bitwise circular shift right. + +More info at [Wikipedia#Circular_shift](http://en.wikipedia.org/wiki/Circular_shift) + + + +## sign(val):Number + +Returns `-1` if value is negative, `0` if the value is `0` and `1` if value is positive. Useful for +multiplications. + +```js +sign(-123); // -1 +sign(123); // 1 +sign(0); // 0 +``` + + + +## toInt(val):Number + +"Convert" value into an 32-bit integer. Works like `Math.floor` if `val > 0` and +`Math.ceil` if `val < 0`. + +**IMPORTANT:** val will wrap at [number/MIN_INT](#MIN_INT) and +[number/MAX_INT](#MAX_INT). + +Created because most people don't know bitwise operations and also because this +feature is commonly needed. + +[Perf tests](http://jsperf.com/vs-vs-parseint-bitwise-operators/7) + +### Example: + +```js +toInt(1.25); // 1 +toInt(0.75); // 0 +toInt(-0.55); // 0 +toInt(-5.0001) // -5 +``` + + + +## toUInt(val):Number + +"Convert" value into an 32-bit unsigned integer. + +Works like AS3#uint(). + +**IMPORTANT:** val will wrap at 2^32. + +### Example: + +```js +toUInt(1.25); // 1 +toUInt(0.75); // 0 +toUInt(-0.55); // 0 +toUInt(-5.0001); // 4294967291 +toUInt(Math.pow(2,32) - 0.5); // 4294967295 +toUInt(Math.pow(2,32) + 0.5); // 0 +``` + + +## toUInt31(val):Number + +"Convert" value into an 31-bit unsigned integer (since 1 bit is used for sign). + +Useful since all bitwise operators besides `>>>` treat numbers as signed +integers. + +**IMPORTANT:** val will wrap at 2^31 and negative numbers will be treated as +`zero`. + +### Example: + +```js +toUInt31(1.25); // 1 +toUInt31(0.75); // 0 +toUInt31(-0.55); // 0 +toUInt31(-5.0001); // 0 +toUInt31(Math.pow(2,31) - 0.5); // 21474836470 +toUInt31(Math.pow(2,31) + 0.5); // 0 +``` + + +------------------------------------------------------------------------------- + +For more usage examples check specs inside `/tests` folder. Unit tests are the +best documentation you can get... + diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/doc/object.md b/node_modules/bower/node_modules/bower-config/node_modules/mout/doc/object.md new file mode 100644 index 0000000..b120aee --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/doc/object.md @@ -0,0 +1,780 @@ +# object # + +Object utilities. + + + +## bindAll(obj, [...methodNames]):void + +Bind methods of the target object to always execute on its own context +(ovewritting the original function). + +See: [function/bind](./function.html#bind) + +```js +var view = { + name: 'Lorem Ipsum', + logNameOnClick: function() { + console.log(this.name); + } +}; + +// binds all methods by default +bindAll(view); +jQuery('#docs').on('click', view.logNameOnClick); +``` + +You can also specify the list of methods that you want to bind (in case you +just want to bind a few of them). + +```js +// only the listed methods will be bound to `obj` context +bindAll(obj, 'logNameOnClick', 'doAwesomeStuffOnDrag'); +``` + + + +## contains(obj, value):Boolean + +Similar to [Array/contains](array.html#contains). Checks if Object contains +value. + +```js +var obj = { + a: 1, + b: 2, + c: 'bar' +}; +contains(obj, 2); // true +contains(obj, 'foo'); // false +``` + + + +## deepEquals(a, b, [callback]):Boolean + +Recursively tests whether two objects contain the same keys and equal values. + +`callback` specifies the equality comparison function used to compare +non-object values. It defaults to using the strict equals (`===`) operator. + +If the values are both an object, it will recurse into the objects, checking if +their keys/values are equal. It will only check the keys and values contained +by the objects; it will not check the objects' prototypes. If the either of +the values are not objects, they will be checked using the `callback` function. + +Example: + +```js +deepEquals({ a: 1 }, { a: 1 }); // true +deepEquals({ value: { a: 1 } }, { value: { a: 1 } }); // true +deepEquals({ value: { a: 1 } }, { value: { a: 2 } }); // false +deepEquals({ value: { a: 1 } }, { value: { a: 1, b: 2 } }); // false +deepEquals({}, null); // false +deepEquals(null, null); // true +deepEquals( + { a: { b: 1 } }, + { a: { b: '1' } }, + function(a, b) { return a == b; }); // true +``` + +See: [`equals()`](#equals) + + + +## deepFillIn(target, ...objects):Object + +Fill missing properties recursively. + +It's different from `deepMixIn` since it won't override any existing property. +It's also different from `merge` since it won't clone child objects during the +process. + +It returns the target object and mutates it in place. + +See: [`fillIn()`](#fillIn), [`deepMixIn()`](#deepMixIn), [`merge()`](#merge) + +```js +var base = { + foo : { + bar : 123 + }, + lorem : 'ipsum' +}; +var options = deepFillIn({foo : { baz : 45 }, lorem : 'amet'}, base); +// > {foo: {bar:123, baz : 45}, lorem : 'amet'} +``` + + + +## deepMatches(target, pattern):Boolean + +Recursively checks if object contains all properties/value pairs. When both +the target and pattern values are arrays, it checks that the target value +contain matches for all the items in the pattern array (independent of order). + +```js +var john = { + name: 'John', + age: 22, + pets: [ + { type: 'cat', name: 'Grumpy Cat' }, + { type: 'dog', name: 'Hawk' } + ] +}; + +deepMatches(john, { name: 'John' }); // true +deepMatches(john, { age: 21 }); // false +deepMatches(john, { pets: [ { type: 'cat' } ] }); // true +deepMatches(john, { pets: [ { name: 'Hawk' } ] }); // true +deepMatches(john, { pets: [ { name: 'Hairball' } ] }); // false +``` + +See [`matches()`](#matches) + + + +## deepMixIn(target, ...objects):Object + +Mixes objects into the target object, recursively mixing existing child objects +as well. + +It will only recursively mix objects if both (existing and new) values are +plain objects. + +Returns the target object. Like [`merge()`](#merge), but mutates the target +object, and does not clone child objects. + +```js +var target = { + foo: { + name: "foo", + id: 1 + } +}; + +deepMixIn(target, { foo: { id: 2 } }); +console.log(target); // { foo: { name: "foo", id: 2 } } +``` + +See: [`mixIn()`](#mixIn), [`merge()`](#merge), [`deepFillIn()`](#deepFillIn) + + + +## equals(a, b, [callback]):Boolean + +Tests whether two objects contain the same keys and values. + +`callback` specifies the equality comparison function used to compare the +values. It defaults to using the strict equals (`===`) operator. + +It will only check the keys and values contained by the objects; it will not +check the objects' prototypes. If either of the values are not objects, they +will be compared using the `callback` function. + +```js +equals({}, {}); // true +equals({ a: 1 }, { a: 1 }); // true +equals({ a: 1 }, { a: 2 }); // false +equals({ a: 1, b: 2 }, { a: 1 }); // false +equals({ a: 1 }, { a: 1, b: 2 }); // false +equals(null, null); // true +equals(null, {}); // false +equals({ a: 1 }, { a: '1' }, function(a, b) { return a == b; }); // true +``` + + + +## every(obj, callback, [thisObj]):Boolean + +Similar to [Array/every](array.html#every). Tests whether all properties in the +object pass the test implemented by the provided callback. + +```js +var obj = { + a: 1, + b: 2, + c: 3, + d: 'string' +}; + +every(obj, isNumber); // false +``` + + + +## fillIn(obj, ...default):Object + +Fill in missing properties in object with values from the *defaults* objects. + + var base = { + foo : 'bar', + num : 123 + }; + + fillIn({foo:'ipsum'}, base); // {foo:'ipsum', num:123} + +PS: it allows merging multiple objects at once, the first ones will take +precedence. + +See: [`mixIn()`](#mixIn), [`merge()`](#merge), [`deepFillIn()`](#deepFillIn) + + + +## filter(obj, callback, [thisObj]) + +Returns a new object containing all properties where `callback` returns true, +similar to Array/filter. It does not use properties from the object's +prototype. + +Callback receives the same arguments as `forOwn()`. + +See: [`forOwn()`](#forOwn), [`forIn()`](#forIn), [`pick()`](#pick) + +```js +var obj = { + foo: 'value', + bar: 'bar value' +}; + +// returns { bar: 'bar value' } +filter(obj, function(v) { return value.length > 5; }); + +// returns { foo: 'value' } +filter(obj, function(v, k) { return k === 'foo'; }); +``` + + + +## find(obj, callback, [thisObj]) + +Loops through all the properties in the Object and returns the first one that +passes a truth test (callback), similar to [Array/find](array.html#find). +Unlike Array/find, order of iteration is not guaranteed. + +```js +var obj = { + a: 'foo', + b: 12 +}; + +find(obj, isString); // 'foo' +find(obj, isNumber); // 12 +``` + + + +## forIn(obj, callback[, thisObj]) + +Iterate over all properties of an Object, similar to +[Array/forEach](array.html#forEach). + +It [avoids don't enum bug on IE](https://developer.mozilla.org/en/ECMAScript_DontEnum_attribute#JScript_DontEnum_Bug). +It **will** iterate over inherited (enumerable) properties from the prototype. + +It allows exiting the iteration early by returning `false` on the callback. + +See: [`forOwn()`](#forOwn), [`keys()`](#keys), [`values()`](#values) + +### Callback arguments + +Callback will receive the following arguments: + + 1. Property Value (*) + 2. Key name (String) + 3. Target object (Object) + +### Example + +```js +function Foo(){ + this.foo = 1; + this.bar = 2; +} + +Foo.prototype.lorem = 4; + +var obj = new Foo(); + +var result = 0; +var keys = []; + +forIn(obj, function(val, key, o){ + result += val; + keys.push(key); +}); + +console.log(result); // 7 +console.log(keys); // ['foo', 'bar', 'lorem'] +``` + + + +## forOwn(obj, callback[, thisObj]) + +Iterate over all own properties from an Object, similar to +[Array/forEach](array.html#forEach). + +It [avoids don't enum bug on IE](https://developer.mozilla.org/en/ECMAScript_DontEnum_attribute#JScript_DontEnum_Bug). +Notice that it **won't** iterate over properties from the prototype. + +It allows exiting the iteration early by returning `false` on the callback. + +See: [`forIn()`](#forIn), [`keys()`](#keys), [`values()`](#values) + +### Callback arguments + +Callback will receive the following arguments: + + 1. Property Value (*) + 2. Key name (String) + 3. Target object (Object) + +### Example + +```js +function Foo(){ + this.foo = 1; + this.bar = 2; +} + +// will be ignored +Foo.prototype.lorem = 4; + +var obj = new Foo(); + +var result = 0; +var keys = []; + +forOwn(obj, function(val, key, o){ + result += val; + keys.push(key); +}); + +console.log(result); // 3 +console.log(keys); // ['foo', 'bar'] +``` + + + +## functions(obj):Array + +Returns a sorted list of all enumerable properties that have function values +(including inherited properties). + +```js +var obj = { + foo : function(){}, + bar : 'baz' +}; +functions(obj); // ['foo'] +``` + + + +## get(obj, propName):* + +Returns nested property value. Will return `undefined` if property doesn't +exist. + +See: [`set()`](#set), [`namespace()`](#namespace), [`has()`](#has) + +```js +var lorem = { + ipsum : { + dolor : { + sit : 'amet' + } + } + }; + +get(lorem, 'ipsum.dolor.sit'); // "amet" +get(lorem, 'foo.bar'); // undefined +``` + + + +## has(obj, propName):Boolean + +Checks if object contains a child property. Useful for cases where you need to +check if an object contain a *nested* property. It will get properties +inherited by the prototype. + +see: [`hasOwn()`](#hasOwn), [`get()`](#get) + +```js +var a = { + b : { + c : 123 + } + }; + +has(a, 'b.c'); // true +has(a, 'foo.c'); // false +``` + +### Common use case + +```js +if( has(a, 'foo.c') ){ // false + // ... +} + +if( a.foo.c ){ // ReferenceError: `foo` is not defined + // ... +} +``` + + + +## hasOwn(obj, propName):Boolean + +Safer `Object.hasOwnProperty`. Returns a boolean indicating whether the object +has the specified property. + +see: [`has()`](#has) + +```js +var obj = { + foo: 1, + hasOwnProperty : 'bar' +}; + +obj.hasOwnProperty('foo'); // ERROR! hasOwnProperty is not a function + +hasOwn(obj, 'foo'); // true +hasOwn(obj, 'hasOwnProperty'); // true +hasOwn(obj, 'toString'); // false +``` + + + +## keys(obj):Array + +Returns an array of all own enumerable properties found upon a given object. +It will use the native `Object.keys` if present. + +PS: it won't return properties from the prototype. + +See: [`forOwn()`](#forOwn), [`values()`](#values) + +```js +var obj = { + foo : 1, + bar : 2, + lorem : 3 +}; +keys(obj); // ['foo', 'bar', 'lorem'] +``` + + + +## map(obj, callback, [thisObj]):Object + +Returns a new object where the property values are the result of calling the +callback for each property in the original object, similar to Array/map. + +The callback function receives the same arguments as in `forOwn()`. + +See: [`forOwn()`](#forOwn) + +```js +var obj = { foo: 1, bar: 2 }, + data = { foo: 0, bar: 1 }; + +map(obj, function(v) { return v + 1; }); // { foo: 2, bar: 3 } +map(obj, function(v, k) { return k; }); // { foo: "foo", bar: "bar" } +map(obj, function(v, k) { return this[k]; }, data); // { foo: 0, bar: 1 } +``` + + + +## matches(obj, props):Boolean + +Checks if object contains all properties/values pairs. Useful for validation +and filtering. + +```js +var john = {age:25, hair:'long', beard:true}; +var mark = {age:27, hair:'short', beard:false}; +var hippie = {hair:'long', beard:true}; +matches(john, hippie); // true +matches(mark, hippie); // false +``` + +See [`deepMatches()`](#deepMatches) + + + +## merge(...objects):Object + +Deep merges objects. Note that objects and properties will be cloned during the +process to avoid undesired side effects. It return a new object and won't +affect source objects. + +```js +var obj1 = {a: {b: 1, c: 1, d: {e: 1, f: 1}}}; +var obj2 = {a: {b: 2, d : {f : 'yeah'} }}; + +merge(obj1, obj2); // {a: {b : 2, c : 1, d : {e : 1, f : 'yeah'}}} +``` + +See: [`deepMixIn()`](#deepMixIn), [`deepFillIn()`](#deepFillIn) + + + +## max(obj[, iterator]):* + +Returns maximum value inside object or use a custom iterator to define how +items should be compared. Similar to [Array/max](array.html#max). + +See: [`min()`](#min) + +```js +max({a: 100, b: 2, c: 1, d: 3, e: 200}); // 200 +max({a: 'foo', b: 'lorem', c: 'amet'}, function(val){ + return val.length; +}); // 'lorem' +``` + + + +## min(obj[, iterator]):* + +Returns minimum value inside object or use a custom iterator to define how +items should be compared. Similar to [Array/min](array.html#min). + +See: [`max()`](#max) + +```js +min({a: 100, b: 2, c: 1, d: 3, e: 200}); // 1 +min({a: 'foo', b: 'lorem', c: 'amet'}, function(val){ + return val.length; +}); // 'foo' +``` + + + +## mixIn(target, ...objects):Object + +Combine properties from all the objects into first one. + +This method affects target object in place, if you want to create a new Object +pass an empty object as first parameter. + +### Arguments + + 1. `target` (Object) : Target Object. + 2. `...objects` (...Object) : Objects to be combined (0...n objects). + +### Example + +```js +var a = {foo: "bar"}; +var b = {lorem: 123}; + +mixIn({}, a, b); // {foo: "bar", lorem: 123} +console.log(a); // {foo: "bar"} + +mixIn(a, b); // {foo: "bar", lorem: 123} +console.log(a); // {foo: "bar", lorem: 123} +``` + +See: [`fillIn()`](#fillIn), [`merge()`](#merge) + + + + +## namespace(obj, propName):Object + +Creates an empty object inside namespace if not existent. Will return created +object or existing object. + +See: [`get()`](#get), [`set()`](#set) + +```js +var obj = {}; +namespace(obj, 'foo.bar'); // {} +console.log(obj); // {foo:{bar:{}}} +``` + + + +## pick(obj, ...keys):Object + +Return a copy of the object that contains only the whitelisted keys. + +See: [`filter()`](#filter) + +```js +var user = { + firstName : 'John', + lastName : 'Doe', + dob : '1985/07/23', + gender : 'male' +}; + +// can pass an array of keys as second argument +var keys = ['firstName', 'dob'] +pick(user, keys); // {firstName:"John", dob: "1985/07/23"} + +// or multiple arguments +pick(user, 'firstName', 'lastName'); // {firstName:"John", lastName: "Doe"} +``` + + + +## pluck(obj, propName):Object + +Extract an object containing property values with keys as they appear in the +passed object. + +```js +var users = { + first: { + name : 'John', + age : 21 + }, + second: { + name : 'Mary', + age : 25 + } +}; + +pluck(users, 'name'); // {first: 'John', second: 'Mary'} ); +pluck(users, 'age'); // {first: 21, second: 25} ); +``` + + + +## reduce(obj, callback, initial, [thisObj]):* + +Similar to [Array/reduce](array.html#reduce). + +Apply a function against an accumulator and each property of the object (order +is undefined) as to reduce it to a single value. + +```js +var obj = {a: 1, b: 2, c: 3, d: 4}; + +function sum(prev, cur, key, list) { + compare1.push(prev); + return prev + cur; +} + +reduce(obj, sum); // 10 +``` + + + +## reject(obj, callback, thisObj):Object + +Returns a new object containing all properties where `callback` returns true, +similar to [Array/reject](array.html#reject). It does not use properties from +the object's prototype. Opposite of [`filter()`](#filter). + +See [`filter()`](#filter) + +### Example + +```js +var obj = {a: 1, b: 2, c: 3, d: 4, e: 5}; +reject(obj, function(x) { return (x % 2) !== 0; }); // {b: 2, d: 4} +``` + + + +## values(obj):Array + +Returns an array of all own enumerable properties values found upon a given object. + +PS: it won't return properties from the prototype. + +See: [`forOwn()`](#forOwn), [`keys()`](#keys) + +```js +var obj = { + foo : 1, + bar : 2, + lorem : 3 +}; +values(obj); // [1, 2, 3] +``` + + + +## set(obj, propName, value) + +Sets a nested property value. + +See: [`get()`](#get), [`namespace()`](#namespace) + +```js +var obj = {}; +set(obj, 'foo.bar', 123); +console.log(obj.foo.bar); // 123 +console.log(obj); // {foo:{bar:123}} +``` + + + +## size(obj):Number + +Returns the count of own enumerable properties found upon a given object. + +PS: it won't return properties from the prototype. + +See: [`forOwn()`](#forOwn), [`keys()`](#keys) + +```js +var obj = { + foo : 1, + bar : 2, + lorem : 3 +}; +size(obj); // 3 +``` + + + +## some(obj, callback, [thisObj]):Boolean + +Similar to [Array/some](array.html#some). Tests whether any properties in the +object pass the test implemented by the provided callback. + +```js +var obj = { + a: 1, + b: 2, + c: 3, + d: 'string' +}; + +some(obj, isNumber); // true +``` + + + +## unset(obj, propName):Boolean + +Delete object property if existent and returns a boolean indicating succes. It +will also return `true` if property doesn't exist. + +Some properties can't be deleted, to understand why [check this +article](http://perfectionkills.com/understanding-delete/). + +See: [`set()`](#set) + +```js +var lorem = { + ipsum : { + dolor : { + sit : 'amet' + } + } + }; + +unset(lorem, 'ipsum.dolor.sit'); // true +console.log(lorem.ipsum.dolor); // {} +unset(lorem, 'foo.bar'); // true +``` diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/doc/queryString.md b/node_modules/bower/node_modules/bower-config/node_modules/mout/doc/queryString.md new file mode 100644 index 0000000..1be3c10 --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/doc/queryString.md @@ -0,0 +1,115 @@ +# queryString # + +Utilities for query string manipulation. + + + +## contains(url, paramName):Boolen + +Checks if query string contains parameter. + +### Arguments: + + 1. `url` (String) : URL or query string. + 2. `paramName` (String) : Parameter name. + +### Example: + +```js +var url = 'example.com/?lorem=ipsum'; +contains(url, 'lorem'); // true +contains(url, 'foo'); //false +``` + + + +## decode(queryStr[, shouldTypecast]):Object + +Parses query string and creates an object of keys => vals. + +Will typecast value with [`string/typecast`](string.html#typecast) by default +and decode string parameters using `decodeURIComponent()`. + +```js +var query = '?foo=bar&lorem=123'; +decode(query); // {foo: "bar", lorem: 123} +decode(query, false); // {foo: "bar", lorem: "123"} +``` + + +## encode(obj):String + +Encode object into a query string. + +Will encode parameters with `encodeURIComponent()`. + +```js +encode({foo: "bar", lorem: 123}); // "?foo=bar&lorem=123" +``` + + +## getParam(url, param[, shouldTypecast]):* + +Get query parameter value. + +Will typecast value with [`string/typecast`](string.html#typecast) by default. + +See: [`setParam()`](#setParam) + +### Arguments: + + 1. `url` (String) : Url. + 2. `param` (String) : Parameter name. + 3. `[shouldTypecast]` (Boolean) : If it should typecast value. + +### Example: + +```js +var url = 'example.com/?foo=bar&lorem=123&ipsum=false'; +getParam(url, 'dolor'); // "amet" +getParam(url, 'lorem'); // 123 +getParam(url, 'lorem', false); // "123" +``` + + +## parse(url[, shouldTypecast]):Object + +Parses URL, extracts query string and decodes it. + +It will typecast all properties of the query object unless second argument is +`false`. + +Alias to: `decode(getQuery(url))`. + +```js +var url = 'example.com/?lorem=ipsum&a=123'; +parse(url); // {lorem: "ipsum", a: 123} +parse(url, false); // {lorem: "ipsum", a: "123"} +``` + + +## getQuery(url):String + +Gets full query as string with all special chars decoded. + +```js +getQuery('example.com/?lorem=ipsum'); // "?lorem=ipsum" +``` + + +## setParam(url, paramName, value):String + +Add new query string parameter to URL or update existing value. + +See: [`getParam()`](#getParam) + +```js +setParam('?foo=bar&lorem=0', 'lorem', 'ipsum'); // '?foo=bar&lorem=ipsum' +setParam('?lorem=1', 'foo', 123); // '?lorem=1&foo=123' +``` + + +------------------------------------------------------------------------------- + +For more usage examples check specs inside `/tests` folder. Unit tests are the +best documentation you can get... diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/doc/random.md b/node_modules/bower/node_modules/bower-config/node_modules/mout/doc/random.md new file mode 100644 index 0000000..a6b0b17 --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/doc/random.md @@ -0,0 +1,232 @@ +# random # + +Pseudo-random generators. + +mout uses `Math.random` by default on all the pseudo-random generators, if +you need a seeded random or a better algorithm see the [`random()`](#random) +documentation for instructions. + + + +## choice(...items):* + +Returns a random element from the supplied arguments or from an array if single +argument is an array. + +### Example: + +```js +choice(1, 2, 3, 4, 5); // 3 + +var arr = ['lorem', 'ipsum', 'dolor']; +choice(arr); // 'dolor' +``` + + + +## guid():String + +Generates a pseudo-random [Globally Unique Identifier](http://en.wikipedia.org/wiki/Globally_unique_identifier) (v4). + +Since the total number of GUIDs is 2122 the chance of generating the +same value twice is negligible. + +**Important:** this method uses `Math.random` by default so the UUID isn't +*safe* (sequence of outputs can be predicted in some cases), check the +[`random()`](#random) documentation for more info on how to replace the default +PRNG if you need extra safety or need *seeded* results. + +See: [`randHex()`](#randHex), [`random()`](#random) + +### Example: + +```js +guid(); // 830e9f50-ac7f-4369-a14f-ed0e62b2fa0b +guid(); // 5de3d09b-e79c-4727-932b-48c49228d508 +``` + + + +## rand([min], [max]):Number + +Gets a random number inside range or snap to min/max values. + +### Arguments: + + 1. `[min]` (Number) : Minimum value. Defaults to `number/MIN_INT`. + 2. `[max]` (Number) : Maximum value. Defaults to `number/MAX_INT`. + + +### Example: + +```js +rand(); // 448740433.55274725 +rand(); // -31797596.097682 +rand(0, 10); // 7.369723 +rand(0, 10); // 5.987042 +``` + +See: [`random()`](#random) + + + +## randBit():Number + +Returns a random "bit" (0 or 1). Useful for addition/subtraction. + +It's slightly faster than `choice(0, 1)` since implementation is simpler (not +that it will make a huge difference in most cases). + +See: [`choice()`](#choice) + +### Example: + +```js +randBit(); // 1 +randBit(); // 0 + +//same effect as +choice(0, 1); +``` + + +## randBool():Boolean + +Returns a random Boolean (`true` or `false`). + +Since this is very common it makes sense to abstract it into a discrete method. + +### Example: + +```js +randBool(); // true +randBool(); // false +``` + + + +## randHex([size]):String + +Returns a random hexadecimal string. + +The default `size` is `6`. + +### Example: + +```js +randHex(); // "dd8575" +randHex(); // "e6baeb" +randHex(2); // "a2" +randHex(30); // "effd7e2ad9a4a3067e30525fab983a" +``` + + + +## randInt([min], [max]):Number + +Gets a random integer inside range or snap to min/max values. + +### Arguments: + + 1. `[min]` (Number) : Minimum value. Defaults to `number/MIN_INT`. + 2. `[max]` (Number) : Maximum value. Defaults to `number/MAX_INT`. + + +### Example: + +```js +randInt(); // 448740433 +randInt(); // -31797596 +randInt(0, 10); // 7 +randInt(0, 10); // 5 +``` + + + +## randSign():Number + +Returns a random "sign" (-1 or 1). Useful for multiplications. + +It's slightly faster than `choice(-1, 1)` since implementation is simpler (not +that it will make a huge difference in most cases). + +See: [`choice()`](#choice) + +### Example: + +```js +randSign(); // -1 +randSign(); // 1 + +//same effect as +choice(-1, 1); +``` + + + +## random():Number + +Returns a random number between `0` and `1`. Same as `Math.random()`. + +```js +random(); // 0.35435103671625257 +random(); // 0.8768321881070733 +``` + +**Important:** No methods inside mout should call `Math.random()` +directly, they all use `random/random` as a proxy, that way we can +inject/replace the pseudo-random number generator if needed (ie. in case we +need a seeded random or a better algorithm than the native one). + +### Replacing the PRNG + +In some cases we might need better/different algorithms than the one provided +by `Math.random` (ie. safer, seeded). + +Because of licensing issues, file size limitations and different needs we +decided to **not** implement a custom PRNG and instead provide a easy way to +override the default behavior. - [issue #99](https://github.com/millermedeiros/amd-utils/issues/99) + +If you are using mout with a loader that supports the [AMD map +config](https://github.com/amdjs/amdjs-api/wiki/Common-Config), such as +[RequireJS](http://requirejs.org/), you can use it to replace the PRNG +(recommended approach): + +```js +requirejs.config({ + map : { + // all modules will load "my_custom_prng" instead of + // "mout/random/random" + '*' : { + 'mout/random/random' : 'my_custom_prng' + } + } +}); +``` + +You also have the option to override `random.get` in case you are using +mout on node.js or with a loader which doesn't support the map config: + +```js +// replace the PRNG +var n = 0; +random.get = function(){ + return ++n % 2? 0 : 1; // not so random :P +}; +random(); // 0 +random(); // 1 +random(); // 0 +random(); // 1 +``` + +See this [detailed explanation about PRNG in +JavaScript](http://baagoe.org/en/w/index.php/Better_random_numbers_for_javascript) +to understand the issues with the native `Math.random` and also for a list of +algorithms that could be used instead. + + + +------------------------------------------------------------------------------- + +For more usage examples check specs inside `/tests` folder. Unit tests are the +best documentation you can get... diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/doc/string.md b/node_modules/bower/node_modules/bower-config/node_modules/mout/doc/string.md new file mode 100644 index 0000000..70a36fc --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/doc/string.md @@ -0,0 +1,626 @@ +# string # + +String utilities. + + +## camelCase(str):String + +Convert string to "camelCase" text. + +See: [`pascalCase()`](#pascalCase), [`unCamelCase()`](#unCamelCase) + +### Example + +```js +camelCase('lorem-ipsum-dolor'); // "loremIpsumDolor" +camelCase('lorem ipsum dolor'); // "loremIpsumDolor" +``` + + + +## contains(str, substring, [fromIndex]):Boolean + +Checks if string contains the given substring. + +See: [`startsWith()`](#startsWith), [`endsWith()`](#endsWith) + +### Example + +```js +contains('lorem', 'or'); // true +contains('lorem', 'bar'); // false +``` + + + +## crop(str, maxChars, [append]):String + +Truncate string at full words. Alias to `truncate(str, maxChars, append, true);`. + +See: [`truncate()`](#truncate) + +### Example + +```js +crop('lorem ipsum dolor', 10); // "lorem..." +crop('lorem ipsum dolor', 10, '+'); // "lorem+" +``` + + + +## endsWith(str, suffix):Boolean + +Checks if string ends with specified suffix. + +See: [`startsWith()`](#startsWith), [`contains()`](#contains) + +### Example + +```js +endsWith('lorem ipsum', 'lorem'); // false +endsWith('lorem ipsum', 'ipsum'); // true +``` + + + +## escapeHtml(str):String + +Escapes the following special characters for use in HTML: + +* `&` becomes `&` +* `<` becomes `<` +* `>` becomes `>` +* `'` becomes `'` +* `"` becomes `"` + +No other characters are escaped. To HTML-escape other characters as well, use a third-party library like [_he_](http://mths.be/he). + +See: [`unescapeHtml()`](#unescapeHtml) + +### Example + +```js +escapeHtml('lorem & "ipsum"'); // "lorem &amp; &quot;ipsum&quot;" +``` + + + +## escapeRegExp(str):String + +Escape special chars to be used as literals in RegExp constructors. + +### Example + +```js +str = escapeRegExp('[lorem.ipsum]'); // "\\[lorem\\.ipsum\\]" +reg = new RegExp(str); // /\[lorem\.ipsum\]/ +``` + + + +## escapeUnicode(str[, shouldEscapePrintable]):String + +Unicode escape chars. + +It will only escape non-printable ASCII chars unless `shouldEscapePrintable` is +set to `true`. + +See: [`unescapeUnicode()`](#unescapeUnicode) + +```js +escapeUnicode('føo bår'); +// > "f\u00f8o b\u00e5r" +escapeUnicode('føo bår', true); +// > "\u0066\u00f8\u006f\u0020\u0062\u00e5\u0072" +``` + + + +## hyphenate(str):String + +Replaces spaces with hyphens, split camelCase text, remove non-word chars, +remove accents and convert to lower case. + +See: [`slugify()`](#slugify), [`underscore()`](#underscore), +[`unhyphenate`](#unhyphenate) + +```js +hyphenate(' %# lorem ipsum ? $ dolor'); // "lorem-ipsum-dolor" +hyphenate('spéçïãl çhârs'); // "special-chars" +hyphenate('loremIpsum'); // "lorem-ipsum" +``` + + + +## insert(str, index, partial):String + +Inserts a `partial` before the given `index` in the provided `str`. +If the index is larger than the length of the string the partial is appended at the end. +A negative index is treated as `length - index` where `length` is the length or the string. + +```js +insert('this is a sentence', 10, 'sample '); // "this is a sample sentence" +insert('foo', 100, 'bar'); // "foobar" +insert('image.png', -4, '-large'); // "image-large.png" +``` + +## interpolate(str, replacements[, syntax]):String + +String interpolation. Format/replace tokens with object properties. + +```js +var tmpl = 'Hello {{name}}!'; +interpolate(tmpl, {name: 'World'}); // "Hello World!" +interpolate(tmpl, {name: 'Lorem Ipsum'}); // "Hello Lorem Ipsum!" + +tmpl = 'Hello {{name.first}}!'; +interpolate(tmpl, {name: {first: 'Lorem'}}); // "Hello Lorem!" +``` + +It uses a mustache-like syntax by default but you can set your own format if +needed. You can also use Arrays for the replacements (since Arrays are +objects as well): + +```js +// matches everything inside "${}" +var syntax = /\$\{([^}]+)\}/g; +var tmpl = "Hello ${0}!"; +interpolate(tmpl, ['Foo Bar'], syntax); // "Hello Foo Bar!" +``` + + + +## lowerCase(str):String + +"Safer" `String.toLowerCase()`. (Used internally) + +### Example + +```js +(null).toLowerCase(); // Error! +(undefined).toLowerCase(); // Error! +lowerCase(null); // "" +lowerCase(undefined); // "" +``` + + + +## lpad(str, minLength[, char]):String + +Pad string from left with `char` if its' length is smaller than `minLen`. + +See: [`rpad()`](#rpad) + +### Example + +```js +lpad('a', 5); // " a" +lpad('a', 5, '-'); // "----a" +lpad('abc', 3, '-'); // "abc" +lpad('abc', 4, '-'); // "-abc" +``` + + + +## ltrim(str, [chars]):String + +Remove chars or white-spaces from beginning of string. + +`chars` is an array of chars to remove from the beginning of the string. If +`chars` is not specified, Unicode whitespace chars will be used instead. + +See: [`rtrim()`](#rtrim), [`trim()`](#trim) + +### Example + +```js +ltrim(' lorem ipsum '); // "lorem ipsum " +ltrim('--lorem ipsum--', ['-']); // "lorem ipsum--" +``` + + + +## makePath(...args):String + +Group arguments as path segments, if any of the args is `null` or `undefined` +it will be ignored from resulting path. It will also remove duplicate "/". + +See: [`array/join()`](array.html#join) + +### Example + +```js +makePath('lorem', 'ipsum', null, 'dolor'); // "lorem/ipsum/dolor" +makePath('foo///bar/'); // "foo/bar/" +``` + + + +## normalizeLineBreaks(str, [lineBreak]):String + +Normalize line breaks to a single format. Defaults to Unix `\n`. + +It handles DOS (`\r\n`), Mac (`\r`) and Unix (`\n`) formats. + +### Example + +```js +// "foo\nbar\nlorem\nipsum" +normalizeLineBreaks('foo\nbar\r\nlorem\ripsum'); + +// "foo\rbar\rlorem\ripsum" +normalizeLineBreaks('foo\nbar\r\nlorem\ripsum', '\r'); + +// "foo bar lorem ipsum" +normalizeLineBreaks('foo\nbar\r\nlorem\ripsum', ' '); +``` + + + +## pascalCase(str):String + +Convert string to "PascalCase" text. + +See: [`camelCase()`](#camelCase) + +### Example + +```js +pascalCase('lorem-ipsum-dolor'); // "LoremIpsumDolor" +pascalCase('lorem ipsum dolor'); // "LoremIpsumDolor" +``` + + + +## properCase(str):String + +UPPERCASE first char of each word, lowercase other chars. + +### Example + +```js +properCase('loRem iPSum'); // "Lorem Ipsum" +``` + + + +## removeNonASCII(str):String + +Remove [non-printable ASCII +chars](http://en.wikipedia.org/wiki/ASCII#ASCII_printable_characters). + +### Example + +```js +removeNonASCII('äÄçÇéÉêlorem-ipsumöÖÐþúÚ'); // "lorem-ipsum" +``` + + + +## removeNonWord(str):String + +Remove non-word chars. + +### Example + +```js +var str = 'lorem ~!@#$%^&*()_+`-={}[]|\\:";\'/?><., ipsum'; +removeNonWord(str); // "lorem - ipsum" +``` + + + +## repeat(str, n):String + +Repeat string n-times. + +### Example + +```js +repeat('a', 3); // "aaa" +repeat('bc', 2); // "bcbc" +repeat('a', 0); // "" +``` + + + +## replace(str, search, replacements):String + +Replace string(s) with the replacement(s) in the source. + +`search` and `replacements` can be an array, or a single item. For every item +in `search`, it will call `str.replace` with the search item and the matching +replacement in `replacements`. If `replacements` only contains one replacement, +it will be used for all the searches, otherwise it will use the replacement at +the same index as the search. + +### Example + +```js +replace('foo bar', 'foo', 'test'); // "test bar" +replace('test 1 2', ['1', '2'], 'n'); // "test n n" +replace('test 1 2', ['1', '2'], ['one', 'two']); // "test one two" +replace('123abc', [/\d/g, /[a-z]/g], ['0', '.']); // "000..." +``` + + + +## replaceAccents(str):String + +Replaces all accented chars with regular ones. + +**Important:** Only covers **Basic Latin** and **Latin-1** unicode chars. + +### Example + +```js +replaceAccents('spéçïãl çhârs'); // "special chars" +``` + + + +## rpad(str, minLength[, char]):String + +Pad string from right with `char` if its' length is smaller than `minLen`. + +See: [`lpad()`](#lpad) + +### Example + +```js +rpad('a', 5); // "a " +rpad('a', 5, '-'); // "a----" +rpad('abc', 3, '-'); // "abc" +rpad('abc', 4, '-'); // "abc-" +``` + + + +## rtrim(str, [chars]):String + +Remove chars or white-spaces from end of string. + +`chars` is an array of chars to remove from the end of the string. If +`chars` is not specified, Unicode whitespace chars will be used instead. + +See: [`trim()`](#trim), [`ltrim()`](#ltrim) + +### Example + +```js +rtrim(' lorem ipsum '); // " lorem ipsum" +rtrim('--lorem ipsum--', ['-']); // "--lorem ipsum" +``` + + + +## sentenceCase(str):String + +UPPERCASE first char of each sentence and lowercase other chars. + +### Example + +```js +var str = 'Lorem IpSum DoLOr. maeCeNnas Ullamcor.'; +sentenceCase(str); // "Lorem ipsum dolor. Maecennas ullamcor." +``` + + + +## stripHtmlTags(str):String + +Remove HTML/XML tags from string. + +### Example + +```js +var str = '

lorem ipsum

'; +stripHtmlTags(str); // "lorem ipsum" +``` + + + +## startsWith(str, prefix):Boolean + +Checks if string starts with specified prefix. + +See: [`endsWith()`](#endsWith), [`contains()`](#contains) + +### Example + +```js +startsWith('lorem ipsum', 'lorem'); // true +startsWith('lorem ipsum', 'ipsum'); // false +``` + + + +## slugify(str[, delimeter]):String + +Convert to lower case, remove accents, remove non-word chars and replace spaces +with the delimeter. The default delimeter is a hyphen. + +Note that this does not split camelCase text. + +See: [`hyphenate()`](#hyphenate) and [`underscore()`](#underscore) + +### Example + +```js +var str = 'loremIpsum dolor spéçïãl chârs'; +slugify(str); // "loremipsum-dolor-special-chars" +slugify(str, '_'); // "loremipsum_dolor_special_chars" +``` + + + +## trim(str, [chars]):String + +Remove chars or white-spaces from beginning and end of string. + +`chars` is an array of chars to remove from the beginning and end of the +string. If `chars` is not specified, Unicode whitespace chars will be used +instead. + +See: [`rtrim()`](#rtrim), [`ltrim()`](#ltrim) + +### Example + +```js +trim(' lorem ipsum '); // "lorem ipsum" +trim('-+-lorem ipsum-+-', ['-', '+']); // "lorem ipsum" +``` + + + +## truncate(str, maxChars, [append], [onlyFullWords]):String + +Limit number of chars. Returned string `length` will be `<= maxChars`. + +See: [`crop()`](#crop) + +### Arguments + + 1. `str` (String) : String + 2. `maxChars` (Number) : Maximum number of characters including `append.length`. + 3. `[append]` (String) : Value that should be added to the end of string. + Defaults to "...". + 4. `[onlyFullWords]` (Boolean) : If it shouldn't break words. Default is + `false`. (favor [`crop()`](#crop) since code will be clearer). + +### Example + +```js +truncate('lorem ipsum dolor', 11); // "lorem ip..." +truncate('lorem ipsum dolor', 11, '+'); // "lorem ipsu+" +truncate('lorem ipsum dolor', 11, null, true); // "lorem..." +``` + + + +## typecast(str):* + +Parses string and convert it into a native value. + +### Example + +```js +typecast('lorem ipsum'); // "lorem ipsum" +typecast('123'); // 123 +typecast('123.45'); // 123.45 +typecast('false'); // false +typecast('true'); // true +typecast('null'); // null +typecast('undefined'); // undefined +``` + + + +## unCamelCase(str, [delimiter]):String + +Add the delimiter between camelCase text and convert first char of each word to +lower case. + +The delimiter defaults to a space character. + +See: [`camelCase()`][#camelCase] + +### Example + +```js +unCamelCase('loremIpsumDolor'); // "lorem ipsum dolor" +unCamelCase('loremIpsumDolor', '-'); // "lorem-ipsum-color" +``` + + +## underscore(str):String + +Replaces spaces with underscores, split camelCase text, remove non-word chars, +remove accents and convert to lower case. + +See: [`slugify()`](#slugify), [`hyphenate()`](#hyphenate) + +```js +underscore(' %# lorem ipsum ? $ dolor'); // "lorem_ipsum_dolor" +underscore('spéçïãl çhârs'); // "special_chars" +underscore('loremIpsum'); // "lorem_ipsum" +``` + + + +## unescapeHtml(str):String + +Unescapes the following HTML character references back into the raw symbol they map to: + +* `&` becomes `&` +* `<` becomes `<` +* `>` becomes `>` +* `'` becomes `'` +* `"` becomes `"` + +No other HTML character references are unescaped. To HTML-unescape other entities as well, use a third-party library like [_he_](http://mths.be/he). + + +See: [`escapeHtml()`](#escapeHtml) + +### Example + +```js +unescapeHtml('lorem &amp; &quot;ipsum&quot;'); // 'lorem & "ipsum"' +``` + + + +## unescapeUnicode(str):String + +Unescapes unicode char sequences. + +See: [`escapeUnicode()`](#escapeUnicode) + +```js +unescapeUnicode('\\u0066\\u00f8\\u006f\\u0020\\u0062\\u00e5\\u0072'); +// > 'føo bår' +``` + + + +## unhyphenate(str):String + +Replaces hyphens with spaces. (only hyphens between word chars) + +See : [`hyphenate()`](#hyphenate) + +### Example + +```js +unhyphenate('lorem-ipsum-dolor'); // "lorem ipsum dolor" +``` + + +## upperCase(str):String + +"Safer" `String.toUpperCase()`. (Used internally) + +### Example + +```js +(null).toUpperCase(); // Error! +(undefined).toUpperCase(); // Error! +upperCase(null); // "" +upperCase(undefined); // "" +``` + + + +## WHITE_SPACES:Array + +Constant array of all [Unicode white-space +characters](http://en.wikipedia.org/wiki/Whitespace_character). + + + +------------------------------------------------------------------------------- + +For more usage examples check specs inside `/tests` folder. Unit tests are the +best documentation you can get... + diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/doc/time.md b/node_modules/bower/node_modules/bower-config/node_modules/mout/doc/time.md new file mode 100644 index 0000000..628c2a9 --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/doc/time.md @@ -0,0 +1,64 @@ +# time # + +Utilities for time manipulation. + + +## convert(value, sourceUnit, [destinationUnit]):Number + +Converts time between units. + +Available units: `millisecond`, `second`, `minute`, `hour`, `day`, `week`. +Abbreviations: `ms`, `s`, `m`, `h`, `d`, `w`. + +We do **not** support year and month as a time unit since their values are not +fixed. + +The default `destinationUnit` is `ms`. + +```js +convert(1, 'minute'); // 60000 +convert(2.5, 's', 'ms'); // 2500 +convert(2, 'm', 's'); // 120 +convert(500, 'ms', 's'); // 0.5 +``` + + + +## now():Number + +Returns the number of milliseconds elapsed since 1 January 1970 00:00:00 UTC. +Uses `Date.now()` if available. + +### Example + +```js +now(); // 1335449614650 +``` + + + +## parseMs(ms):Object + +Parse timestamp (milliseconds) into an object `{milliseconds:number, +seconds:number, minutes:number, hours:number, days:number}`. + +### Example + +```js +// {days:27, hours:4, minutes:26, seconds:5, milliseconds:454} +parseMs(2348765454); +``` + + + +## toTimeString(ms):String + +Convert timestamp (milliseconds) into a time string in the format "[H:]MM:SS". + +### Example + +```js +toTimeString(12513); // "00:12" +toTimeString(951233); // "15:51" +toTimeString(8765235); // "2:26:05" +``` diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/function.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/function.js new file mode 100644 index 0000000..53254c3 --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/function.js @@ -0,0 +1,22 @@ + + +//automatically generated, do not edit! +//run `node build` instead +module.exports = { + 'awaitDelay' : require('./function/awaitDelay'), + 'bind' : require('./function/bind'), + 'compose' : require('./function/compose'), + 'constant' : require('./function/constant'), + 'debounce' : require('./function/debounce'), + 'func' : require('./function/func'), + 'identity' : require('./function/identity'), + 'makeIterator_' : require('./function/makeIterator_'), + 'partial' : require('./function/partial'), + 'prop' : require('./function/prop'), + 'series' : require('./function/series'), + 'throttle' : require('./function/throttle'), + 'timeout' : require('./function/timeout'), + 'times' : require('./function/times') +}; + + diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/function/awaitDelay.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/function/awaitDelay.js new file mode 100644 index 0000000..8c9b1a3 --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/function/awaitDelay.js @@ -0,0 +1,22 @@ +var now = require('../time/now'); +var timeout = require('./timeout'); +var append = require('../array/append'); + + /** + * Ensure a minimum delay for callbacks + */ + function awaitDelay( callback, delay ){ + var baseTime = now() + delay; + return function() { + // ensure all browsers will execute it asynchronously (avoid hard + // to catch errors) not using "0" because of old browsers and also + // since new browsers increase the value to be at least "4" + // http://www.whatwg.org/specs/web-apps/current-work/multipage/timers.html#dom-windowtimers-settimeout + var ms = Math.max(baseTime - now(), 4); + return timeout.apply(this, append([callback, ms, this], arguments)); + }; + } + + module.exports = awaitDelay; + + diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/function/bind.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/function/bind.js new file mode 100644 index 0000000..c6c4719 --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/function/bind.js @@ -0,0 +1,19 @@ +var slice = require('../array/slice'); + + /** + * Return a function that will execute in the given context, optionally adding any additional supplied parameters to the beginning of the arguments collection. + * @param {Function} fn Function. + * @param {object} context Execution context. + * @param {rest} args Arguments (0...n arguments). + * @return {Function} Wrapped Function. + */ + function bind(fn, context, args){ + var argsArr = slice(arguments, 2); //curried args + return function(){ + return fn.apply(context, argsArr.concat(slice(arguments))); + }; + } + + module.exports = bind; + + diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/function/compose.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/function/compose.js new file mode 100644 index 0000000..8cd5c5f --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/function/compose.js @@ -0,0 +1,23 @@ + + + /** + * Returns a function that composes multiple functions, passing results to + * each other. + */ + function compose() { + var fns = arguments; + return function(arg){ + // only cares about the first argument since the chain can only + // deal with a single return value anyway. It should start from + // the last fn. + var n = fns.length; + while (n--) { + arg = fns[n].call(this, arg); + } + return arg; + }; + } + + module.exports = compose; + + diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/function/constant.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/function/constant.js new file mode 100644 index 0000000..ab932d9 --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/function/constant.js @@ -0,0 +1,14 @@ + + + /** + * Returns a new function that will return the value + */ + function constant(value){ + return function() { + return value; + }; + } + + module.exports = constant; + + diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/function/debounce.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/function/debounce.js new file mode 100644 index 0000000..7f6f302 --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/function/debounce.js @@ -0,0 +1,32 @@ + + + /** + * Debounce callback execution + */ + function debounce(fn, threshold, isAsap){ + var timeout, result; + function debounced(){ + var args = arguments, context = this; + function delayed(){ + if (! isAsap) { + result = fn.apply(context, args); + } + timeout = null; + } + if (timeout) { + clearTimeout(timeout); + } else if (isAsap) { + result = fn.apply(context, args); + } + timeout = setTimeout(delayed, threshold); + return result; + } + debounced.cancel = function(){ + clearTimeout(timeout); + }; + return debounced; + } + + module.exports = debounce; + + diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/function/func.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/function/func.js new file mode 100644 index 0000000..b81bf0a --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/function/func.js @@ -0,0 +1,14 @@ + + + /** + * Returns a function that call a method on the passed object + */ + function func(name){ + return function(obj){ + return obj[name](); + }; + } + + module.exports = func; + + diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/function/identity.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/function/identity.js new file mode 100644 index 0000000..d07b01a --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/function/identity.js @@ -0,0 +1,12 @@ + + + /** + * Returns the first argument provided to it. + */ + function identity(val){ + return val; + } + + module.exports = identity; + + diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/function/makeIterator_.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/function/makeIterator_.js new file mode 100644 index 0000000..20cc0e7 --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/function/makeIterator_.js @@ -0,0 +1,34 @@ +var identity = require('./identity'); +var prop = require('./prop'); +var deepMatches = require('../object/deepMatches'); + + /** + * Converts argument into a valid iterator. + * Used internally on most array/object/collection methods that receives a + * callback/iterator providing a shortcut syntax. + */ + function makeIterator(src, thisObj){ + if (src == null) { + return identity; + } + switch(typeof src) { + case 'function': + // function is the first to improve perf (most common case) + // also avoid using `Function#call` if not needed, which boosts + // perf a lot in some cases + return (typeof thisObj !== 'undefined')? function(val, i, arr){ + return src.call(thisObj, val, i, arr); + } : src; + case 'object': + return function(val){ + return deepMatches(val, src); + }; + case 'string': + case 'number': + return prop(src); + } + } + + module.exports = makeIterator; + + diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/function/partial.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/function/partial.js new file mode 100644 index 0000000..0e3927d --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/function/partial.js @@ -0,0 +1,15 @@ +var slice = require('../array/slice'); + + /** + * Creates a partially applied function. + */ + function partial(fn, var_args){ + var argsArr = slice(arguments, 1); //curried args + return function(){ + return fn.apply(this, argsArr.concat(slice(arguments))); + }; + } + + module.exports = partial; + + diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/function/prop.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/function/prop.js new file mode 100644 index 0000000..734acb7 --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/function/prop.js @@ -0,0 +1,14 @@ + + + /** + * Returns a function that gets a property of the passed object + */ + function prop(name){ + return function(obj){ + return obj[name]; + }; + } + + module.exports = prop; + + diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/function/series.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/function/series.js new file mode 100644 index 0000000..25159c2 --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/function/series.js @@ -0,0 +1,22 @@ + + + /** + * Returns a function that will execute a list of functions in sequence + * passing the same arguments to each one. (useful for batch processing + * items during a forEach loop) + */ + function series(){ + var fns = arguments; + return function(){ + var i = 0, + n = fns.length; + while (i < n) { + fns[i].apply(this, arguments); + i += 1; + } + }; + } + + module.exports = series; + + diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/function/throttle.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/function/throttle.js new file mode 100644 index 0000000..0a5e161 --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/function/throttle.js @@ -0,0 +1,33 @@ +var now = require('../time/now'); + + /** + */ + function throttle(fn, delay){ + var context, timeout, result, args, + diff, prevCall = 0; + function delayed(){ + prevCall = now(); + timeout = null; + result = fn.apply(context, args); + } + function throttled(){ + context = this; + args = arguments; + diff = delay - (now() - prevCall); + if (diff <= 0) { + clearTimeout(timeout); + delayed(); + } else if (! timeout) { + timeout = setTimeout(delayed, diff); + } + return result; + } + throttled.cancel = function(){ + clearTimeout(timeout); + }; + return throttled; + } + + module.exports = throttle; + + diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/function/timeout.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/function/timeout.js new file mode 100644 index 0000000..509dd68 --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/function/timeout.js @@ -0,0 +1,17 @@ +var slice = require('../array/slice'); + + /** + * Delays the call of a function within a given context. + */ + function timeout(fn, millis, context){ + + var args = slice(arguments, 3); + + return setTimeout(function() { + fn.apply(context, args); + }, millis); + } + + module.exports = timeout; + + diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/function/times.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/function/times.js new file mode 100644 index 0000000..04a11c2 --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/function/times.js @@ -0,0 +1,17 @@ + + + /** + * Iterates over a callback a set amount of times + */ + function times(n, callback, thisObj){ + var i = -1; + while (++i < n) { + if ( callback.call(thisObj, i) === false ) { + break; + } + } + } + + module.exports = times; + + diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/index.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/index.js new file mode 100644 index 0000000..d4dddd6 --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/index.js @@ -0,0 +1,25 @@ +/**@license + * mout v0.9.1 | http://moutjs.com | MIT license + */ + + +//automatically generated, do not edit! +//run `node build` instead +module.exports = { + 'VERSION' : '0.9.1', + 'array' : require('./array'), + 'collection' : require('./collection'), + 'date' : require('./date'), + 'function' : require('./function'), + 'lang' : require('./lang'), + 'math' : require('./math'), + 'number' : require('./number'), + 'object' : require('./object'), + 'queryString' : require('./queryString'), + 'random' : require('./random'), + 'string' : require('./string'), + 'time' : require('./time'), + 'fn' : require('./function') +}; + + diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/lang.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/lang.js new file mode 100644 index 0000000..024f7fa --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/lang.js @@ -0,0 +1,37 @@ + + +//automatically generated, do not edit! +//run `node build` instead +module.exports = { + 'clone' : require('./lang/clone'), + 'createObject' : require('./lang/createObject'), + 'ctorApply' : require('./lang/ctorApply'), + 'deepClone' : require('./lang/deepClone'), + 'defaults' : require('./lang/defaults'), + 'inheritPrototype' : require('./lang/inheritPrototype'), + 'is' : require('./lang/is'), + 'isArguments' : require('./lang/isArguments'), + 'isArray' : require('./lang/isArray'), + 'isBoolean' : require('./lang/isBoolean'), + 'isDate' : require('./lang/isDate'), + 'isEmpty' : require('./lang/isEmpty'), + 'isFinite' : require('./lang/isFinite'), + 'isFunction' : require('./lang/isFunction'), + 'isInteger' : require('./lang/isInteger'), + 'isKind' : require('./lang/isKind'), + 'isNaN' : require('./lang/isNaN'), + 'isNull' : require('./lang/isNull'), + 'isNumber' : require('./lang/isNumber'), + 'isObject' : require('./lang/isObject'), + 'isPlainObject' : require('./lang/isPlainObject'), + 'isRegExp' : require('./lang/isRegExp'), + 'isString' : require('./lang/isString'), + 'isUndefined' : require('./lang/isUndefined'), + 'isnt' : require('./lang/isnt'), + 'kindOf' : require('./lang/kindOf'), + 'toArray' : require('./lang/toArray'), + 'toNumber' : require('./lang/toNumber'), + 'toString' : require('./lang/toString') +}; + + diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/lang/clone.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/lang/clone.js new file mode 100644 index 0000000..33c4e94 --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/lang/clone.js @@ -0,0 +1,49 @@ +var kindOf = require('./kindOf'); +var isPlainObject = require('./isPlainObject'); +var mixIn = require('../object/mixIn'); + + /** + * Clone native types. + */ + function clone(val){ + switch (kindOf(val)) { + case 'Object': + return cloneObject(val); + case 'Array': + return cloneArray(val); + case 'RegExp': + return cloneRegExp(val); + case 'Date': + return cloneDate(val); + default: + return val; + } + } + + function cloneObject(source) { + if (isPlainObject(source)) { + return mixIn({}, source); + } else { + return source; + } + } + + function cloneRegExp(r) { + var flags = ''; + flags += r.multiline ? 'm' : ''; + flags += r.global ? 'g' : ''; + flags += r.ignorecase ? 'i' : ''; + return new RegExp(r.source, flags); + } + + function cloneDate(date) { + return new Date(+date); + } + + function cloneArray(arr) { + return arr.slice(); + } + + module.exports = clone; + + diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/lang/createObject.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/lang/createObject.js new file mode 100644 index 0000000..bbc14c1 --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/lang/createObject.js @@ -0,0 +1,18 @@ +var mixIn = require('../object/mixIn'); + + /** + * Create Object using prototypal inheritance and setting custom properties. + * - Mix between Douglas Crockford Prototypal Inheritance and the EcmaScript 5 `Object.create()` method. + * @param {object} parent Parent Object. + * @param {object} [props] Object properties. + * @return {object} Created object. + */ + function createObject(parent, props){ + function F(){} + F.prototype = parent; + return mixIn(new F(), props); + + } + module.exports = createObject; + + diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/lang/ctorApply.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/lang/ctorApply.js new file mode 100644 index 0000000..d68dc50 --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/lang/ctorApply.js @@ -0,0 +1,17 @@ + + + function F(){} + + /** + * Do fn.apply on a constructor. + */ + function ctorApply(ctor, args) { + F.prototype = ctor.prototype; + var instance = new F(); + ctor.apply(instance, args); + return instance; + } + + module.exports = ctorApply; + + diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/lang/deepClone.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/lang/deepClone.js new file mode 100644 index 0000000..25fd95f --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/lang/deepClone.js @@ -0,0 +1,48 @@ +var clone = require('./clone'); +var forOwn = require('../object/forOwn'); +var kindOf = require('./kindOf'); +var isPlainObject = require('./isPlainObject'); + + /** + * Recursively clone native types. + */ + function deepClone(val, instanceClone) { + switch ( kindOf(val) ) { + case 'Object': + return cloneObject(val, instanceClone); + case 'Array': + return cloneArray(val, instanceClone); + default: + return clone(val); + } + } + + function cloneObject(source, instanceClone) { + if (isPlainObject(source)) { + var out = {}; + forOwn(source, function(val, key) { + this[key] = deepClone(val, instanceClone); + }, out); + return out; + } else if (instanceClone) { + return instanceClone(source); + } else { + return source; + } + } + + function cloneArray(arr, instanceClone) { + var out = [], + i = -1, + n = arr.length, + val; + while (++i < n) { + out[i] = deepClone(arr[i], instanceClone); + } + return out; + } + + module.exports = deepClone; + + + diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/lang/defaults.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/lang/defaults.js new file mode 100644 index 0000000..1111b2e --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/lang/defaults.js @@ -0,0 +1,17 @@ +var toArray = require('./toArray'); +var find = require('../array/find'); + + /** + * Return first non void argument + */ + function defaults(var_args){ + return find(toArray(arguments), nonVoid); + } + + function nonVoid(val){ + return val != null; + } + + module.exports = defaults; + + diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/lang/inheritPrototype.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/lang/inheritPrototype.js new file mode 100644 index 0000000..1c9da1f --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/lang/inheritPrototype.js @@ -0,0 +1,18 @@ +var createObject = require('./createObject'); + + /** + * Inherit prototype from another Object. + * - inspired by Nicholas Zackas Solution + * @param {object} child Child object + * @param {object} parent Parent Object + */ + function inheritPrototype(child, parent){ + var p = createObject(parent.prototype); + p.constructor = child; + child.prototype = p; + child.super_ = parent; + return p; + } + + module.exports = inheritPrototype; + diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/lang/is.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/lang/is.js new file mode 100644 index 0000000..4a83573 --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/lang/is.js @@ -0,0 +1,23 @@ + + + /** + * Check if both arguments are egal. + */ + function is(x, y){ + // implementation borrowed from harmony:egal spec + if (x === y) { + // 0 === -0, but they are not identical + return x !== 0 || 1 / x === 1 / y; + } + + // NaN !== NaN, but they are identical. + // NaNs are the only non-reflexive value, i.e., if x !== x, + // then x is a NaN. + // isNaN is broken: it converts its argument to number, so + // isNaN("foo") => true + return x !== x && y !== y; + } + + module.exports = is; + + diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/lang/isArguments.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/lang/isArguments.js new file mode 100644 index 0000000..f7b08ba --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/lang/isArguments.js @@ -0,0 +1,15 @@ +var isKind = require('./isKind'); + + /** + */ + var isArgs = isKind(arguments, 'Arguments')? + function(val){ + return isKind(val, 'Arguments'); + } : + function(val){ + // Arguments is an Object on IE7 + return !!(val && Object.prototype.hasOwnProperty.call(val, 'callee')); + }; + + module.exports = isArgs; + diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/lang/isArray.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/lang/isArray.js new file mode 100644 index 0000000..262ee40 --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/lang/isArray.js @@ -0,0 +1,8 @@ +var isKind = require('./isKind'); + /** + */ + var isArray = Array.isArray || function (val) { + return isKind(val, 'Array'); + }; + module.exports = isArray; + diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/lang/isBoolean.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/lang/isBoolean.js new file mode 100644 index 0000000..86557cb --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/lang/isBoolean.js @@ -0,0 +1,8 @@ +var isKind = require('./isKind'); + /** + */ + function isBoolean(val) { + return isKind(val, 'Boolean'); + } + module.exports = isBoolean; + diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/lang/isDate.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/lang/isDate.js new file mode 100644 index 0000000..4a5130f --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/lang/isDate.js @@ -0,0 +1,8 @@ +var isKind = require('./isKind'); + /** + */ + function isDate(val) { + return isKind(val, 'Date'); + } + module.exports = isDate; + diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/lang/isEmpty.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/lang/isEmpty.js new file mode 100644 index 0000000..0e9f77d --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/lang/isEmpty.js @@ -0,0 +1,24 @@ +var forOwn = require('../object/forOwn'); +var isArray = require('./isArray'); + + function isEmpty(val){ + if (val == null) { + // typeof null == 'object' so we check it first + return false; + } else if ( typeof val === 'string' || isArray(val) ) { + return !val.length; + } else if ( typeof val === 'object' || typeof val === 'function' ) { + var result = true; + forOwn(val, function(){ + result = false; + return false; // break loop + }); + return result; + } else { + return false; + } + } + + module.exports = isEmpty; + + diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/lang/isFinite.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/lang/isFinite.js new file mode 100644 index 0000000..6d4006f --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/lang/isFinite.js @@ -0,0 +1,21 @@ +var isNumber = require('./isNumber'); + + var global = this; + + /** + * Check if value is finite + */ + function isFinite(val){ + var is = false; + if (typeof val === 'string' && val !== '') { + is = global.isFinite( parseFloat(val) ); + } else if (isNumber(val)){ + // need to use isNumber because of Number constructor + is = global.isFinite( val ); + } + return is; + } + + module.exports = isFinite; + + diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/lang/isFunction.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/lang/isFunction.js new file mode 100644 index 0000000..216879f --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/lang/isFunction.js @@ -0,0 +1,8 @@ +var isKind = require('./isKind'); + /** + */ + function isFunction(val) { + return isKind(val, 'Function'); + } + module.exports = isFunction; + diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/lang/isInteger.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/lang/isInteger.js new file mode 100644 index 0000000..29f95d9 --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/lang/isInteger.js @@ -0,0 +1,12 @@ +var isNumber = require('./isNumber'); + + /** + * Check if value is an integer + */ + function isInteger(val){ + return isNumber(val) && (val % 1 === 0); + } + + module.exports = isInteger; + + diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/lang/isKind.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/lang/isKind.js new file mode 100644 index 0000000..02301e0 --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/lang/isKind.js @@ -0,0 +1,9 @@ +var kindOf = require('./kindOf'); + /** + * Check if value is from a specific "kind". + */ + function isKind(val, kind){ + return kindOf(val) === kind; + } + module.exports = isKind; + diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/lang/isNaN.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/lang/isNaN.js new file mode 100644 index 0000000..b1018ec --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/lang/isNaN.js @@ -0,0 +1,16 @@ +var isNumber = require('./isNumber'); +var $isNaN = require('../number/isNaN'); + + /** + * Check if value is NaN for realz + */ + function isNaN(val){ + // based on the fact that NaN !== NaN + // need to check if it's a number to avoid conflicts with host objects + // also need to coerce ToNumber to avoid edge case `new Number(NaN)` + return !isNumber(val) || $isNaN(Number(val)); + } + + module.exports = isNaN; + + diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/lang/isNull.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/lang/isNull.js new file mode 100644 index 0000000..6252f9e --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/lang/isNull.js @@ -0,0 +1,9 @@ + + /** + */ + function isNull(val){ + return val === null; + } + module.exports = isNull; + + diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/lang/isNumber.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/lang/isNumber.js new file mode 100644 index 0000000..126c1cc --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/lang/isNumber.js @@ -0,0 +1,8 @@ +var isKind = require('./isKind'); + /** + */ + function isNumber(val) { + return isKind(val, 'Number'); + } + module.exports = isNumber; + diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/lang/isObject.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/lang/isObject.js new file mode 100644 index 0000000..7350c89 --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/lang/isObject.js @@ -0,0 +1,8 @@ +var isKind = require('./isKind'); + /** + */ + function isObject(val) { + return isKind(val, 'Object'); + } + module.exports = isObject; + diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/lang/isPlainObject.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/lang/isPlainObject.js new file mode 100644 index 0000000..b81342e --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/lang/isPlainObject.js @@ -0,0 +1,13 @@ + + + /** + * Checks if the value is created by the `Object` constructor. + */ + function isPlainObject(value) { + return (!!value && typeof value === 'object' && + value.constructor === Object); + } + + module.exports = isPlainObject; + + diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/lang/isRegExp.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/lang/isRegExp.js new file mode 100644 index 0000000..fc5459a --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/lang/isRegExp.js @@ -0,0 +1,8 @@ +var isKind = require('./isKind'); + /** + */ + function isRegExp(val) { + return isKind(val, 'RegExp'); + } + module.exports = isRegExp; + diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/lang/isString.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/lang/isString.js new file mode 100644 index 0000000..f890658 --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/lang/isString.js @@ -0,0 +1,8 @@ +var isKind = require('./isKind'); + /** + */ + function isString(val) { + return isKind(val, 'String'); + } + module.exports = isString; + diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/lang/isUndefined.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/lang/isUndefined.js new file mode 100644 index 0000000..fb2261d --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/lang/isUndefined.js @@ -0,0 +1,10 @@ + + var UNDEF; + + /** + */ + function isUndef(val){ + return val === UNDEF; + } + module.exports = isUndef; + diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/lang/isnt.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/lang/isnt.js new file mode 100644 index 0000000..9dad58c --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/lang/isnt.js @@ -0,0 +1,12 @@ +var is = require('./is'); + + /** + * Check if both values are not identical/egal + */ + function isnt(x, y){ + return !is(x, y); + } + + module.exports = isnt; + + diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/lang/kindOf.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/lang/kindOf.js new file mode 100644 index 0000000..663464d --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/lang/kindOf.js @@ -0,0 +1,20 @@ + + + var _rKind = /^\[object (.*)\]$/, + _toString = Object.prototype.toString, + UNDEF; + + /** + * Gets the "kind" of value. (e.g. "String", "Number", etc) + */ + function kindOf(val) { + if (val === null) { + return 'Null'; + } else if (val === UNDEF) { + return 'Undefined'; + } else { + return _rKind.exec( _toString.call(val) )[1]; + } + } + module.exports = kindOf; + diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/lang/toArray.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/lang/toArray.js new file mode 100644 index 0000000..e39b873 --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/lang/toArray.js @@ -0,0 +1,31 @@ +var kindOf = require('./kindOf'); + + var _win = this; + + /** + * Convert array-like object into array + */ + function toArray(val){ + var ret = [], + kind = kindOf(val), + n; + + if (val != null) { + if ( val.length == null || kind === 'String' || kind === 'Function' || kind === 'RegExp' || val === _win ) { + //string, regexp, function have .length but user probably just want + //to wrap value into an array.. + ret[ret.length] = val; + } else { + //window returns true on isObject in IE7 and may have length + //property. `typeof NodeList` returns `function` on Safari so + //we can't use it (#58) + n = val.length; + while (n--) { + ret[n] = val[n]; + } + } + } + return ret; + } + module.exports = toArray; + diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/lang/toNumber.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/lang/toNumber.js new file mode 100644 index 0000000..8b6df34 --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/lang/toNumber.js @@ -0,0 +1,20 @@ +var isArray = require('./isArray'); + + /** + * covert value into number if numeric + */ + function toNumber(val){ + // numberic values should come first because of -0 + if (typeof val === 'number') return val; + // we want all falsy values (besides -0) to return zero to avoid + // headaches + if (!val) return 0; + if (typeof val === 'string') return parseFloat(val); + // arrays are edge cases. `Number([4]) === 4` + if (isArray(val)) return NaN; + return Number(val); + } + + module.exports = toNumber; + + diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/lang/toString.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/lang/toString.js new file mode 100644 index 0000000..ae5c2b0 --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/lang/toString.js @@ -0,0 +1,13 @@ + + + /** + * Typecast a value to a String, using an empty string value for null or + * undefined. + */ + function toString(val){ + return val == null ? '' : val.toString(); + } + + module.exports = toString; + + diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/math.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/math.js new file mode 100644 index 0000000..c6ee889 --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/math.js @@ -0,0 +1,19 @@ + + +//automatically generated, do not edit! +//run `node build` instead +module.exports = { + 'ceil' : require('./math/ceil'), + 'clamp' : require('./math/clamp'), + 'countSteps' : require('./math/countSteps'), + 'floor' : require('./math/floor'), + 'inRange' : require('./math/inRange'), + 'isNear' : require('./math/isNear'), + 'lerp' : require('./math/lerp'), + 'loop' : require('./math/loop'), + 'map' : require('./math/map'), + 'norm' : require('./math/norm'), + 'round' : require('./math/round') +}; + + diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/math/ceil.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/math/ceil.js new file mode 100644 index 0000000..a279e15 --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/math/ceil.js @@ -0,0 +1,11 @@ + + /** + * Round value up with a custom radix. + */ + function ceil(val, step){ + step = Math.abs(step || 1); + return Math.ceil(val / step) * step; + } + + module.exports = ceil; + diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/math/clamp.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/math/clamp.js new file mode 100644 index 0000000..e929a9a --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/math/clamp.js @@ -0,0 +1,9 @@ + + /** + * Clamps value inside range. + */ + function clamp(val, min, max){ + return val < min? min : (val > max? max : val); + } + module.exports = clamp; + diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/math/countSteps.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/math/countSteps.js new file mode 100644 index 0000000..60ac90c --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/math/countSteps.js @@ -0,0 +1,16 @@ + + /** + * Count number of full steps. + */ + function countSteps(val, step, overflow){ + val = Math.floor(val / step); + + if (overflow) { + return val % overflow; + } + + return val; + } + + module.exports = countSteps; + diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/math/floor.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/math/floor.js new file mode 100644 index 0000000..9de5053 --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/math/floor.js @@ -0,0 +1,10 @@ + + /** + * Floor value to full steps. + */ + function floor(val, step){ + step = Math.abs(step || 1); + return Math.floor(val / step) * step; + } + module.exports = floor; + diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/math/inRange.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/math/inRange.js new file mode 100644 index 0000000..763218f --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/math/inRange.js @@ -0,0 +1,11 @@ + + /** + * Checks if value is inside the range. + */ + function inRange(val, min, max, threshold){ + threshold = threshold || 0; + return (val + threshold >= min && val - threshold <= max); + } + + module.exports = inRange; + diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/math/isNear.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/math/isNear.js new file mode 100644 index 0000000..45486b6 --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/math/isNear.js @@ -0,0 +1,9 @@ + + /** + * Check if value is close to target. + */ + function isNear(val, target, threshold){ + return (Math.abs(val - target) <= threshold); + } + module.exports = isNear; + diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/math/lerp.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/math/lerp.js new file mode 100644 index 0000000..111e271 --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/math/lerp.js @@ -0,0 +1,11 @@ + + /** + * Linear interpolation. + * IMPORTANT:will return `Infinity` if numbers overflow Number.MAX_VALUE + */ + function lerp(ratio, start, end){ + return start + (end - start) * ratio; + } + + module.exports = lerp; + diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/math/loop.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/math/loop.js new file mode 100644 index 0000000..35207c1 --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/math/loop.js @@ -0,0 +1,10 @@ + + /** + * Loops value inside range. + */ + function loop(val, min, max){ + return val < min? max : (val > max? min : val); + } + + module.exports = loop; + diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/math/map.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/math/map.js new file mode 100644 index 0000000..96c4b78 --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/math/map.js @@ -0,0 +1,11 @@ +var lerp = require('./lerp'); +var norm = require('./norm'); + /** + * Maps a number from one scale to another. + * @example map(3, 0, 4, -1, 1) -> 0.5 + */ + function map(val, min1, max1, min2, max2){ + return lerp( norm(val, min1, max1), min2, max2 ); + } + module.exports = map; + diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/math/norm.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/math/norm.js new file mode 100644 index 0000000..54caf78 --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/math/norm.js @@ -0,0 +1,9 @@ + + /** + * Gets normalized ratio of value inside range. + */ + function norm(val, min, max){ + return (val - min) / (max - min); + } + module.exports = norm; + diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/math/round.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/math/round.js new file mode 100644 index 0000000..d108e6c --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/math/round.js @@ -0,0 +1,12 @@ + + /** + * Round number to a specific radix + */ + function round(value, radix){ + radix = radix || 1; // default round 1 + return Math.round(value / radix) * radix; + } + + module.exports = round; + + diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/number.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/number.js new file mode 100644 index 0000000..d7a3fe2 --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/number.js @@ -0,0 +1,24 @@ + + +//automatically generated, do not edit! +//run `node build` instead +module.exports = { + 'MAX_INT' : require('./number/MAX_INT'), + 'MAX_UINT' : require('./number/MAX_UINT'), + 'MIN_INT' : require('./number/MIN_INT'), + 'abbreviate' : require('./number/abbreviate'), + 'currencyFormat' : require('./number/currencyFormat'), + 'enforcePrecision' : require('./number/enforcePrecision'), + 'isNaN' : require('./number/isNaN'), + 'nth' : require('./number/nth'), + 'ordinal' : require('./number/ordinal'), + 'pad' : require('./number/pad'), + 'rol' : require('./number/rol'), + 'ror' : require('./number/ror'), + 'sign' : require('./number/sign'), + 'toInt' : require('./number/toInt'), + 'toUInt' : require('./number/toUInt'), + 'toUInt31' : require('./number/toUInt31') +}; + + diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/number/MAX_INT.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/number/MAX_INT.js new file mode 100644 index 0000000..1d6f0e4 --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/number/MAX_INT.js @@ -0,0 +1,6 @@ +/** + * @constant Maximum 32-bit signed integer value. (2^31 - 1) + */ + + module.exports = 2147483647; + diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/number/MAX_UINT.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/number/MAX_UINT.js new file mode 100644 index 0000000..700da0f --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/number/MAX_UINT.js @@ -0,0 +1,6 @@ +/** + * @constant Maximum 32-bit unsigned integet value (2^32 - 1) + */ + + module.exports = 4294967295; + diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/number/MIN_INT.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/number/MIN_INT.js new file mode 100644 index 0000000..b34ab2c --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/number/MIN_INT.js @@ -0,0 +1,6 @@ +/** + * @constant Minimum 32-bit signed integer value (-2^31). + */ + + module.exports = -2147483648; + diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/number/abbreviate.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/number/abbreviate.js new file mode 100644 index 0000000..dd6716b --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/number/abbreviate.js @@ -0,0 +1,35 @@ +var enforcePrecision = require('./enforcePrecision'); + + var _defaultDict = { + thousand : 'K', + million : 'M', + billion : 'B' + }; + + /** + * Abbreviate number if bigger than 1000. (eg: 2.5K, 17.5M, 3.4B, ...) + */ + function abbreviateNumber(val, nDecimals, dict){ + nDecimals = nDecimals != null? nDecimals : 1; + dict = dict || _defaultDict; + val = enforcePrecision(val, nDecimals); + + var str, mod; + + if (val < 1000000) { + mod = enforcePrecision(val / 1000, nDecimals); + // might overflow to next scale during rounding + str = mod < 1000? mod + dict.thousand : 1 + dict.million; + } else if (val < 1000000000) { + mod = enforcePrecision(val / 1000000, nDecimals); + str = mod < 1000? mod + dict.million : 1 + dict.billion; + } else { + str = enforcePrecision(val / 1000000000, nDecimals) + dict.billion; + } + + return str; + } + + module.exports = abbreviateNumber; + + diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/number/currencyFormat.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/number/currencyFormat.js new file mode 100644 index 0000000..c85a668 --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/number/currencyFormat.js @@ -0,0 +1,27 @@ +var toNumber = require('../lang/toNumber'); + + /** + * Converts number into currency format + */ + function currencyFormat(val, nDecimalDigits, decimalSeparator, thousandsSeparator) { + val = toNumber(val); + nDecimalDigits = nDecimalDigits == null? 2 : nDecimalDigits; + decimalSeparator = decimalSeparator == null? '.' : decimalSeparator; + thousandsSeparator = thousandsSeparator == null? ',' : thousandsSeparator; + + //can't use enforce precision since it returns a number and we are + //doing a RegExp over the string + var fixed = val.toFixed(nDecimalDigits), + //separate begin [$1], middle [$2] and decimal digits [$4] + parts = new RegExp('^(-?\\d{1,3})((?:\\d{3})+)(\\.(\\d{'+ nDecimalDigits +'}))?$').exec( fixed ); + + if(parts){ //val >= 1000 || val <= -1000 + return parts[1] + parts[2].replace(/\d{3}/g, thousandsSeparator + '$&') + (parts[4] ? decimalSeparator + parts[4] : ''); + }else{ + return fixed.replace('.', decimalSeparator); + } + } + + module.exports = currencyFormat; + + diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/number/enforcePrecision.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/number/enforcePrecision.js new file mode 100644 index 0000000..3d3b2d4 --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/number/enforcePrecision.js @@ -0,0 +1,12 @@ +var toNumber = require('../lang/toNumber'); + /** + * Enforce a specific amount of decimal digits and also fix floating + * point rounding issues. + */ + function enforcePrecision(val, nDecimalDigits){ + val = toNumber(val); + var pow = Math.pow(10, nDecimalDigits); + return +(Math.round(val * pow) / pow).toFixed(nDecimalDigits); + } + module.exports = enforcePrecision; + diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/number/isNaN.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/number/isNaN.js new file mode 100644 index 0000000..3799f3b --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/number/isNaN.js @@ -0,0 +1,14 @@ + + + /** + * ES6 Number.isNaN + * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/isNaN + */ + function isNaN(val){ + // jshint eqeqeq:false + return typeof val === 'number' && val != val; + } + + module.exports = isNaN; + + diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/number/nth.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/number/nth.js new file mode 100644 index 0000000..43ffb21 --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/number/nth.js @@ -0,0 +1,25 @@ + + + /** + * Returns "nth" of number (1 = "st", 2 = "nd", 3 = "rd", 4..10 = "th", ...) + */ + function nth(i) { + var t = (i % 100); + if (t >= 10 && t <= 20) { + return 'th'; + } + switch(i % 10) { + case 1: + return 'st'; + case 2: + return 'nd'; + case 3: + return 'rd'; + default: + return 'th'; + } + } + + module.exports = nth; + + diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/number/ordinal.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/number/ordinal.js new file mode 100644 index 0000000..939a0fa --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/number/ordinal.js @@ -0,0 +1,14 @@ +var toInt = require('./toInt'); +var nth = require('./nth'); + + /** + * converts number into ordinal form (1st, 2nd, 3rd, 4th, ...) + */ + function ordinal(n){ + n = toInt(n); + return n + nth(n); + } + + module.exports = ordinal; + + diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/number/pad.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/number/pad.js new file mode 100644 index 0000000..1f83af4 --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/number/pad.js @@ -0,0 +1,14 @@ +var lpad = require('../string/lpad'); +var toNumber = require('../lang/toNumber'); + + /** + * Add padding zeros if n.length < minLength. + */ + function pad(n, minLength, char){ + n = toNumber(n); + return lpad(''+ n, minLength, char || '0'); + } + + module.exports = pad; + + diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/number/rol.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/number/rol.js new file mode 100644 index 0000000..ecd58da --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/number/rol.js @@ -0,0 +1,10 @@ + + /** + * Bitwise circular shift left + * http://en.wikipedia.org/wiki/Circular_shift + */ + function rol(val, shift){ + return (val << shift) | (val >> (32 - shift)); + } + module.exports = rol; + diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/number/ror.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/number/ror.js new file mode 100644 index 0000000..2eda81d --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/number/ror.js @@ -0,0 +1,10 @@ + + /** + * Bitwise circular shift right + * http://en.wikipedia.org/wiki/Circular_shift + */ + function ror(val, shift){ + return (val >> shift) | (val << (32 - shift)); + } + module.exports = ror; + diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/number/sign.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/number/sign.js new file mode 100644 index 0000000..7f9a1e2 --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/number/sign.js @@ -0,0 +1,15 @@ +var toNumber = require('../lang/toNumber'); + + /** + * Get sign of the value. + */ + function sign(val) { + var num = toNumber(val); + if (num === 0) return num; // +0 and +0 === 0 + if (isNaN(num)) return num; // NaN + return num < 0? -1 : 1; + } + + module.exports = sign; + + diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/number/toInt.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/number/toInt.js new file mode 100644 index 0000000..72fd7de --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/number/toInt.js @@ -0,0 +1,17 @@ + + + /** + * "Convert" value into an 32-bit integer. + * Works like `Math.floor` if val > 0 and `Math.ceil` if val < 0. + * IMPORTANT: val will wrap at 2^31 and -2^31. + * Perf tests: http://jsperf.com/vs-vs-parseint-bitwise-operators/7 + */ + function toInt(val){ + // we do not use lang/toNumber because of perf and also because it + // doesn't break the functionality + return ~~val; + } + + module.exports = toInt; + + diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/number/toUInt.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/number/toUInt.js new file mode 100644 index 0000000..d279656 --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/number/toUInt.js @@ -0,0 +1,15 @@ + + + /** + * "Convert" value into a 32-bit unsigned integer. + * IMPORTANT: Value will wrap at 2^32. + */ + function toUInt(val){ + // we do not use lang/toNumber because of perf and also because it + // doesn't break the functionality + return val >>> 0; + } + + module.exports = toUInt; + + diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/number/toUInt31.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/number/toUInt31.js new file mode 100644 index 0000000..6cd3bb5 --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/number/toUInt31.js @@ -0,0 +1,15 @@ +var MAX_INT = require('./MAX_INT'); + + /** + * "Convert" value into an 31-bit unsigned integer (since 1 bit is used for sign). + * IMPORTANT: value wil wrap at 2^31, if negative will return 0. + */ + function toUInt31(val){ + // we do not use lang/toNumber because of perf and also because it + // doesn't break the functionality + return (val <= 0)? 0 : (val > MAX_INT? ~~(val % (MAX_INT + 1)) : ~~val); + } + + module.exports = toUInt31; + + diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/object.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/object.js new file mode 100644 index 0000000..76c0642 --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/object.js @@ -0,0 +1,42 @@ + + +//automatically generated, do not edit! +//run `node build` instead +module.exports = { + 'bindAll' : require('./object/bindAll'), + 'contains' : require('./object/contains'), + 'deepEquals' : require('./object/deepEquals'), + 'deepFillIn' : require('./object/deepFillIn'), + 'deepMatches' : require('./object/deepMatches'), + 'deepMixIn' : require('./object/deepMixIn'), + 'equals' : require('./object/equals'), + 'every' : require('./object/every'), + 'fillIn' : require('./object/fillIn'), + 'filter' : require('./object/filter'), + 'find' : require('./object/find'), + 'forIn' : require('./object/forIn'), + 'forOwn' : require('./object/forOwn'), + 'functions' : require('./object/functions'), + 'get' : require('./object/get'), + 'has' : require('./object/has'), + 'hasOwn' : require('./object/hasOwn'), + 'keys' : require('./object/keys'), + 'map' : require('./object/map'), + 'matches' : require('./object/matches'), + 'max' : require('./object/max'), + 'merge' : require('./object/merge'), + 'min' : require('./object/min'), + 'mixIn' : require('./object/mixIn'), + 'namespace' : require('./object/namespace'), + 'pick' : require('./object/pick'), + 'pluck' : require('./object/pluck'), + 'reduce' : require('./object/reduce'), + 'reject' : require('./object/reject'), + 'set' : require('./object/set'), + 'size' : require('./object/size'), + 'some' : require('./object/some'), + 'unset' : require('./object/unset'), + 'values' : require('./object/values') +}; + + diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/object/bindAll.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/object/bindAll.js new file mode 100644 index 0000000..c8a2034 --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/object/bindAll.js @@ -0,0 +1,19 @@ +var functions = require('./functions'); +var bind = require('../function/bind'); +var forEach = require('../array/forEach'); +var slice = require('../array/slice'); + + /** + * Binds methods of the object to be run in it's own context. + */ + function bindAll(obj, rest_methodNames){ + var keys = arguments.length > 1? + slice(arguments, 1) : functions(obj); + forEach(keys, function(key){ + obj[key] = bind(obj[key], obj); + }); + } + + module.exports = bindAll; + + diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/object/contains.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/object/contains.js new file mode 100644 index 0000000..8076e2c --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/object/contains.js @@ -0,0 +1,13 @@ +var some = require('./some'); + + /** + * Check if object contains value + */ + function contains(obj, needle) { + return some(obj, function(val) { + return (val === needle); + }); + } + module.exports = contains; + + diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/object/deepEquals.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/object/deepEquals.js new file mode 100644 index 0000000..fcde944 --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/object/deepEquals.js @@ -0,0 +1,27 @@ +var isObject = require('../lang/isObject'); +var equals = require('./equals'); + + function defaultCompare(a, b) { + return a === b; + } + + /** + * Recursively checks for same properties and values. + */ + function deepEquals(a, b, callback){ + callback = callback || defaultCompare; + + if (!isObject(a) || !isObject(b)) { + return callback(a, b); + } + + function compare(a, b){ + return deepEquals(a, b, callback); + } + + return equals(a, b, compare); + } + + module.exports = deepEquals; + + diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/object/deepFillIn.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/object/deepFillIn.js new file mode 100644 index 0000000..6568ea8 --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/object/deepFillIn.js @@ -0,0 +1,33 @@ +var forOwn = require('./forOwn'); +var isPlainObject = require('../lang/isPlainObject'); + + /** + * Deeply copy missing properties in the target from the defaults. + */ + function deepFillIn(target, defaults){ + var i = 0, + n = arguments.length, + obj; + + while(++i < n) { + obj = arguments[i]; + if (obj) { + // jshint loopfunc: true + forOwn(obj, function(newValue, key) { + var curValue = target[key]; + if (curValue == null) { + target[key] = newValue; + } else if (isPlainObject(curValue) && + isPlainObject(newValue)) { + deepFillIn(curValue, newValue); + } + }); + } + } + + return target; + } + + module.exports = deepFillIn; + + diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/object/deepMatches.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/object/deepMatches.js new file mode 100644 index 0000000..3366c52 --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/object/deepMatches.js @@ -0,0 +1,55 @@ +var forOwn = require('./forOwn'); +var isArray = require('../lang/isArray'); + + function containsMatch(array, pattern) { + var i = -1, length = array.length; + while (++i < length) { + if (deepMatches(array[i], pattern)) { + return true; + } + } + + return false; + } + + function matchArray(target, pattern) { + var i = -1, patternLength = pattern.length; + while (++i < patternLength) { + if (!containsMatch(target, pattern[i])) { + return false; + } + } + + return true; + } + + function matchObject(target, pattern) { + var result = true; + forOwn(pattern, function(val, key) { + if (!deepMatches(target[key], val)) { + // Return false to break out of forOwn early + return (result = false); + } + }); + + return result; + } + + /** + * Recursively check if the objects match. + */ + function deepMatches(target, pattern){ + if (target && typeof target === 'object') { + if (isArray(target) && isArray(pattern)) { + return matchArray(target, pattern); + } else { + return matchObject(target, pattern); + } + } else { + return target === pattern; + } + } + + module.exports = deepMatches; + + diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/object/deepMixIn.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/object/deepMixIn.js new file mode 100644 index 0000000..a97e98d --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/object/deepMixIn.js @@ -0,0 +1,34 @@ +var forOwn = require('./forOwn'); +var isPlainObject = require('../lang/isPlainObject'); + + /** + * Mixes objects into the target object, recursively mixing existing child + * objects. + */ + function deepMixIn(target, objects) { + var i = 0, + n = arguments.length, + obj; + + while(++i < n){ + obj = arguments[i]; + if (obj) { + forOwn(obj, copyProp, target); + } + } + + return target; + } + + function copyProp(val, key) { + var existing = this[key]; + if (isPlainObject(val) && isPlainObject(existing)) { + deepMixIn(existing, val); + } else { + this[key] = val; + } + } + + module.exports = deepMixIn; + + diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/object/equals.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/object/equals.js new file mode 100644 index 0000000..f50cbe4 --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/object/equals.js @@ -0,0 +1,36 @@ +var hasOwn = require('./hasOwn'); +var every = require('./every'); +var isObject = require('../lang/isObject'); + + function defaultCompare(a, b) { + return a === b; + } + + // Makes a function to compare the object values from the specified compare + // operation callback. + function makeCompare(callback) { + return function(value, key) { + return hasOwn(this, key) && callback(value, this[key]); + }; + } + + function checkProperties(value, key) { + return hasOwn(this, key); + } + + /** + * Checks if two objects have the same keys and values. + */ + function equals(a, b, callback) { + callback = callback || defaultCompare; + + if (!isObject(a) || !isObject(b)) { + return callback(a, b); + } + + return (every(a, makeCompare(callback), b) && + every(b, checkProperties, a)); + } + + module.exports = equals; + diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/object/every.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/object/every.js new file mode 100644 index 0000000..01106e5 --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/object/every.js @@ -0,0 +1,23 @@ +var forOwn = require('./forOwn'); +var makeIterator = require('../function/makeIterator_'); + + /** + * Object every + */ + function every(obj, callback, thisObj) { + callback = makeIterator(callback, thisObj); + var result = true; + forOwn(obj, function(val, key) { + // we consider any falsy values as "false" on purpose so shorthand + // syntax can be used to check property existence + if (!callback(val, key, obj)) { + result = false; + return false; // break + } + }); + return result; + } + + module.exports = every; + + diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/object/fillIn.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/object/fillIn.js new file mode 100644 index 0000000..4010e28 --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/object/fillIn.js @@ -0,0 +1,21 @@ +var forEach = require('../array/forEach'); +var slice = require('../array/slice'); +var forOwn = require('./forOwn'); + + /** + * Copy missing properties in the obj from the defaults. + */ + function fillIn(obj, var_defaults){ + forEach(slice(arguments, 1), function(base){ + forOwn(base, function(val, key){ + if (obj[key] == null) { + obj[key] = val; + } + }); + }); + return obj; + } + + module.exports = fillIn; + + diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/object/filter.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/object/filter.js new file mode 100644 index 0000000..3a83a92 --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/object/filter.js @@ -0,0 +1,20 @@ +var forOwn = require('./forOwn'); +var makeIterator = require('../function/makeIterator_'); + + /** + * Creates a new object with all the properties where the callback returns + * true. + */ + function filterValues(obj, callback, thisObj) { + callback = makeIterator(callback, thisObj); + var output = {}; + forOwn(obj, function(value, key, obj) { + if (callback(value, key, obj)) { + output[key] = value; + } + }); + + return output; + } + module.exports = filterValues; + diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/object/find.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/object/find.js new file mode 100644 index 0000000..d39c070 --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/object/find.js @@ -0,0 +1,21 @@ +var some = require('./some'); +var makeIterator = require('../function/makeIterator_'); + + /** + * Returns first item that matches criteria + */ + function find(obj, callback, thisObj) { + callback = makeIterator(callback, thisObj); + var result; + some(obj, function(value, key, obj) { + if (callback(value, key, obj)) { + result = value; + return true; //break + } + }); + return result; + } + + module.exports = find; + + diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/object/forIn.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/object/forIn.js new file mode 100644 index 0000000..7fe96ce --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/object/forIn.js @@ -0,0 +1,76 @@ +var hasOwn = require('./hasOwn'); + + var _hasDontEnumBug, + _dontEnums; + + function checkDontEnum(){ + _dontEnums = [ + 'toString', + 'toLocaleString', + 'valueOf', + 'hasOwnProperty', + 'isPrototypeOf', + 'propertyIsEnumerable', + 'constructor' + ]; + + _hasDontEnumBug = true; + + for (var key in {'toString': null}) { + _hasDontEnumBug = false; + } + } + + /** + * Similar to Array/forEach but works over object properties and fixes Don't + * Enum bug on IE. + * based on: http://whattheheadsaid.com/2010/10/a-safer-object-keys-compatibility-implementation + */ + function forIn(obj, fn, thisObj){ + var key, i = 0; + // no need to check if argument is a real object that way we can use + // it for arrays, functions, date, etc. + + //post-pone check till needed + if (_hasDontEnumBug == null) checkDontEnum(); + + for (key in obj) { + if (exec(fn, obj, key, thisObj) === false) { + break; + } + } + + + if (_hasDontEnumBug) { + var ctor = obj.constructor, + isProto = !!ctor && obj === ctor.prototype; + + while (key = _dontEnums[i++]) { + // For constructor, if it is a prototype object the constructor + // is always non-enumerable unless defined otherwise (and + // enumerated above). For non-prototype objects, it will have + // to be defined on this object, since it cannot be defined on + // any prototype objects. + // + // For other [[DontEnum]] properties, check if the value is + // different than Object prototype value. + if ( + (key !== 'constructor' || + (!isProto && hasOwn(obj, key))) && + obj[key] !== Object.prototype[key] + ) { + if (exec(fn, obj, key, thisObj) === false) { + break; + } + } + } + } + } + + function exec(fn, obj, key, thisObj){ + return fn.call(thisObj, obj[key], key, obj); + } + + module.exports = forIn; + + diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/object/forOwn.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/object/forOwn.js new file mode 100644 index 0000000..5f2dfbf --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/object/forOwn.js @@ -0,0 +1,19 @@ +var hasOwn = require('./hasOwn'); +var forIn = require('./forIn'); + + /** + * Similar to Array/forEach but works over object properties and fixes Don't + * Enum bug on IE. + * based on: http://whattheheadsaid.com/2010/10/a-safer-object-keys-compatibility-implementation + */ + function forOwn(obj, fn, thisObj){ + forIn(obj, function(val, key){ + if (hasOwn(obj, key)) { + return fn.call(thisObj, obj[key], key, obj); + } + }); + } + + module.exports = forOwn; + + diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/object/functions.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/object/functions.js new file mode 100644 index 0000000..f571797 --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/object/functions.js @@ -0,0 +1,18 @@ +var forIn = require('./forIn'); + + /** + * return a list of all enumerable properties that have function values + */ + function functions(obj){ + var keys = []; + forIn(obj, function(val, key){ + if (typeof val === 'function'){ + keys.push(key); + } + }); + return keys.sort(); + } + + module.exports = functions; + + diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/object/get.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/object/get.js new file mode 100644 index 0000000..7cf9d9b --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/object/get.js @@ -0,0 +1,20 @@ + + + /** + * get "nested" object property + */ + function get(obj, prop){ + var parts = prop.split('.'), + last = parts.pop(); + + while (prop = parts.shift()) { + obj = obj[prop]; + if (typeof obj !== 'object' || !obj) return; + } + + return obj[last]; + } + + module.exports = get; + + diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/object/has.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/object/has.js new file mode 100644 index 0000000..ca9f228 --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/object/has.js @@ -0,0 +1,15 @@ +var get = require('./get'); + + var UNDEF; + + /** + * Check if object has nested property. + */ + function has(obj, prop){ + return get(obj, prop) !== UNDEF; + } + + module.exports = has; + + + diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/object/hasOwn.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/object/hasOwn.js new file mode 100644 index 0000000..7e3c82a --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/object/hasOwn.js @@ -0,0 +1,12 @@ + + + /** + * Safer Object.hasOwnProperty + */ + function hasOwn(obj, prop){ + return Object.prototype.hasOwnProperty.call(obj, prop); + } + + module.exports = hasOwn; + + diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/object/keys.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/object/keys.js new file mode 100644 index 0000000..dd2f4f5 --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/object/keys.js @@ -0,0 +1,16 @@ +var forOwn = require('./forOwn'); + + /** + * Get object keys + */ + var keys = Object.keys || function (obj) { + var keys = []; + forOwn(obj, function(val, key){ + keys.push(key); + }); + return keys; + }; + + module.exports = keys; + + diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/object/map.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/object/map.js new file mode 100644 index 0000000..dd449a7 --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/object/map.js @@ -0,0 +1,18 @@ +var forOwn = require('./forOwn'); +var makeIterator = require('../function/makeIterator_'); + + /** + * Creates a new object where all the values are the result of calling + * `callback`. + */ + function mapValues(obj, callback, thisObj) { + callback = makeIterator(callback, thisObj); + var output = {}; + forOwn(obj, function(val, key, obj) { + output[key] = callback(val, key, obj); + }); + + return output; + } + module.exports = mapValues; + diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/object/matches.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/object/matches.js new file mode 100644 index 0000000..6074faa --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/object/matches.js @@ -0,0 +1,20 @@ +var forOwn = require('./forOwn'); + + /** + * checks if a object contains all given properties/values + */ + function matches(target, props){ + // can't use "object/every" because of circular dependency + var result = true; + forOwn(props, function(val, key){ + if (target[key] !== val) { + // break loop at first difference + return (result = false); + } + }); + return result; + } + + module.exports = matches; + + diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/object/max.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/object/max.js new file mode 100644 index 0000000..3e8e92c --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/object/max.js @@ -0,0 +1,12 @@ +var arrMax = require('../array/max'); +var values = require('./values'); + + /** + * Returns maximum value inside object. + */ + function max(obj, compareFn) { + return arrMax(values(obj), compareFn); + } + + module.exports = max; + diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/object/merge.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/object/merge.js new file mode 100644 index 0000000..6961f60 --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/object/merge.js @@ -0,0 +1,40 @@ +var hasOwn = require('./hasOwn'); +var deepClone = require('../lang/deepClone'); +var isObject = require('../lang/isObject'); + + /** + * Deep merge objects. + */ + function merge() { + var i = 1, + key, val, obj, target; + + // make sure we don't modify source element and it's properties + // objects are passed by reference + target = deepClone( arguments[0] ); + + while (obj = arguments[i++]) { + for (key in obj) { + if ( ! hasOwn(obj, key) ) { + continue; + } + + val = obj[key]; + + if ( isObject(val) && isObject(target[key]) ){ + // inception, deep merge objects + target[key] = merge(target[key], val); + } else { + // make sure arrays, regexp, date, objects are cloned + target[key] = deepClone(val); + } + + } + } + + return target; + } + + module.exports = merge; + + diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/object/min.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/object/min.js new file mode 100644 index 0000000..e1e6697 --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/object/min.js @@ -0,0 +1,12 @@ +var arrMin = require('../array/min'); +var values = require('./values'); + + /** + * Returns minimum value inside object. + */ + function min(obj, iterator) { + return arrMin(values(obj), iterator); + } + + module.exports = min; + diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/object/mixIn.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/object/mixIn.js new file mode 100644 index 0000000..55ec8fd --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/object/mixIn.js @@ -0,0 +1,28 @@ +var forOwn = require('./forOwn'); + + /** + * Combine properties from all the objects into first one. + * - This method affects target object in place, if you want to create a new Object pass an empty object as first param. + * @param {object} target Target Object + * @param {...object} objects Objects to be combined (0...n objects). + * @return {object} Target Object. + */ + function mixIn(target, objects){ + var i = 0, + n = arguments.length, + obj; + while(++i < n){ + obj = arguments[i]; + if (obj != null) { + forOwn(obj, copyProp, target); + } + } + return target; + } + + function copyProp(val, key){ + this[key] = val; + } + + module.exports = mixIn; + diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/object/namespace.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/object/namespace.js new file mode 100644 index 0000000..c6e79f6 --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/object/namespace.js @@ -0,0 +1,19 @@ +var forEach = require('../array/forEach'); + + /** + * Create nested object if non-existent + */ + function namespace(obj, path){ + if (!path) return obj; + forEach(path.split('.'), function(key){ + if (!obj[key]) { + obj[key] = {}; + } + obj = obj[key]; + }); + return obj; + } + + module.exports = namespace; + + diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/object/pick.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/object/pick.js new file mode 100644 index 0000000..da5a564 --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/object/pick.js @@ -0,0 +1,18 @@ +var slice = require('../array/slice'); + + /** + * Return a copy of the object, filtered to only have values for the whitelisted keys. + */ + function pick(obj, var_keys){ + var keys = typeof arguments[1] !== 'string'? arguments[1] : slice(arguments, 1), + out = {}, + i = 0, key; + while (key = keys[i++]) { + out[key] = obj[key]; + } + return out; + } + + module.exports = pick; + + diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/object/pluck.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/object/pluck.js new file mode 100644 index 0000000..e844df4 --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/object/pluck.js @@ -0,0 +1,13 @@ +var map = require('./map'); +var prop = require('../function/prop'); + + /** + * Extract a list of property values. + */ + function pluck(obj, propName){ + return map(obj, prop(propName)); + } + + module.exports = pluck; + + diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/object/reduce.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/object/reduce.js new file mode 100644 index 0000000..6f19a3a --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/object/reduce.js @@ -0,0 +1,29 @@ +var forOwn = require('./forOwn'); +var size = require('./size'); + + /** + * Object reduce + */ + function reduce(obj, callback, memo, thisObj) { + var initial = arguments.length > 2; + + if (!size(obj) && !initial) { + throw new Error('reduce of empty object with no initial value'); + } + + forOwn(obj, function(value, key, list) { + if (!initial) { + memo = value; + initial = true; + } + else { + memo = callback.call(thisObj, memo, value, key, list); + } + }); + + return memo; + } + + module.exports = reduce; + + diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/object/reject.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/object/reject.js new file mode 100644 index 0000000..7464379 --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/object/reject.js @@ -0,0 +1,16 @@ +var filter = require('./filter'); +var makeIterator = require('../function/makeIterator_'); + + /** + * Object reject + */ + function reject(obj, callback, thisObj) { + callback = makeIterator(callback, thisObj); + return filter(obj, function(value, index, obj) { + return !callback(value, index, obj); + }, thisObj); + } + + module.exports = reject; + + diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/object/set.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/object/set.js new file mode 100644 index 0000000..9b3cdc4 --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/object/set.js @@ -0,0 +1,17 @@ +var namespace = require('./namespace'); + + /** + * set "nested" object property + */ + function set(obj, prop, val){ + var parts = (/^(.+)\.(.+)$/).exec(prop); + if (parts){ + namespace(obj, parts[1])[parts[2]] = val; + } else { + obj[prop] = val; + } + } + + module.exports = set; + + diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/object/size.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/object/size.js new file mode 100644 index 0000000..9788595 --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/object/size.js @@ -0,0 +1,16 @@ +var forOwn = require('./forOwn'); + + /** + * Get object size + */ + function size(obj) { + var count = 0; + forOwn(obj, function(){ + count++; + }); + return count; + } + + module.exports = size; + + diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/object/some.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/object/some.js new file mode 100644 index 0000000..384c6f3 --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/object/some.js @@ -0,0 +1,21 @@ +var forOwn = require('./forOwn'); +var makeIterator = require('../function/makeIterator_'); + + /** + * Object some + */ + function some(obj, callback, thisObj) { + callback = makeIterator(callback, thisObj); + var result = false; + forOwn(obj, function(val, key) { + if (callback(val, key, obj)) { + result = true; + return false; // break + } + }); + return result; + } + + module.exports = some; + + diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/object/unset.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/object/unset.js new file mode 100644 index 0000000..343bca0 --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/object/unset.js @@ -0,0 +1,23 @@ +var has = require('./has'); + + /** + * Unset object property. + */ + function unset(obj, prop){ + if (has(obj, prop)) { + var parts = prop.split('.'), + last = parts.pop(); + while (prop = parts.shift()) { + obj = obj[prop]; + } + return (delete obj[last]); + + } else { + // if property doesn't exist treat as deleted + return true; + } + } + + module.exports = unset; + + diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/object/values.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/object/values.js new file mode 100644 index 0000000..265a693 --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/object/values.js @@ -0,0 +1,16 @@ +var forOwn = require('./forOwn'); + + /** + * Get object values + */ + function values(obj) { + var vals = []; + forOwn(obj, function(val, key){ + vals.push(val); + }); + return vals; + } + + module.exports = values; + + diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/package.json b/node_modules/bower/node_modules/bower-config/node_modules/mout/package.json new file mode 100644 index 0000000..7264ec5 --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/package.json @@ -0,0 +1,157 @@ +{ + "name": "mout", + "description": "Modular Utilities", + "version": "0.9.1", + "homepage": "http://moutjs.com/", + "contributors": [ + { + "name": "Adam Nowotny" + }, + { + "name": "André Cruz", + "email": "amdfcruz@gmail.com" + }, + { + "name": "Conrad Zimmerman", + "url": "http://www.conradz.com" + }, + { + "name": "Friedemann Altrock", + "email": "frodenius@gmail.com" + }, + { + "name": "Igor Almeida", + "email": "igor.p.almeida@gmail.com" + }, + { + "name": "Jarrod Overson", + "url": "http://jarrodoverson.com" + }, + { + "name": "Miller Medeiros", + "email": "contact@millermedeiros.com", + "url": "http://blog.millermedeiros.com" + }, + { + "name": "Mathias Paumgarten", + "email": "mail@mathias-paumgarten.com" + }, + { + "name": "Zach Shipley" + } + ], + "keywords": [ + "utilities", + "functional", + "amd-utils", + "stdlib" + ], + "repository": { + "type": "git", + "url": "git://github.com/mout/mout.git" + }, + "licenses": [ + { + "type": "MIT", + "url": "http://www.opensource.org/licenses/mit-license.php" + } + ], + "bugs": { + "url": "https://github.com/mout/mout/issues/" + }, + "main": "./index.js", + "scripts": { + "pretest": "node build pkg", + "test": "istanbul test tests/runner.js --hook-run-in-context" + }, + "directories": { + "doc": "./doc" + }, + "devDependencies": { + "istanbul": "~0.1.27", + "jasmine-node": "~1.2.2", + "requirejs": "2.x", + "nodefy": "*", + "mdoc": "~0.3.2", + "handlebars": "~1.0.6", + "commander": "~1.0.5", + "rocambole": "~0.2.3", + "jshint": "2.x", + "rimraf": "~2.2.2", + "regenerate": "~0.5.4" + }, + "testling": { + "preprocess": "node build testling", + "browsers": { + "ie": [ + 7, + 8, + 9, + 10 + ], + "firefox": [ + 17, + "nightly" + ], + "chrome": [ + 23, + "canary" + ], + "opera": [ + 12, + "next" + ], + "safari": [ + 5.1, + 6 + ], + "iphone": [ + 6 + ], + "ipad": [ + 6 + ] + }, + "scripts": [ + "tests/lib/jasmine/jasmine.js", + "tests/lib/jasmine/jasmine.async.js", + "tests/lib/jasmine/jasmine-tap.js", + "tests/lib/requirejs/require.js", + "tests/testling/src.js", + "tests/testling/specs.js", + "tests/runner.js" + ] + }, + "_id": "mout@0.9.1", + "dist": { + "shasum": "84f0f3fd6acc7317f63de2affdcc0cee009b0477", + "tarball": "http://registry.npmjs.org/mout/-/mout-0.9.1.tgz" + }, + "_from": "mout@0.9.1", + "_npmVersion": "1.4.3", + "_npmUser": { + "name": "millermedeiros", + "email": "miller@millermedeiros.com" + }, + "maintainers": [ + { + "name": "millermedeiros", + "email": "miller@millermedeiros.com" + }, + { + "name": "satazor", + "email": "andremiguelcruz@msn.com" + }, + { + "name": "conradz", + "email": "me@conradz.com" + }, + { + "name": "mathias.paumgarten", + "email": "mail@mathias-paumgarten.com" + } + ], + "_shasum": "84f0f3fd6acc7317f63de2affdcc0cee009b0477", + "_resolved": "https://registry.npmjs.org/mout/-/mout-0.9.1.tgz", + "readme": "ERROR: No README data found!" +} diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/queryString.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/queryString.js new file mode 100644 index 0000000..22685a7 --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/queryString.js @@ -0,0 +1,15 @@ + + +//automatically generated, do not edit! +//run `node build` instead +module.exports = { + 'contains' : require('./queryString/contains'), + 'decode' : require('./queryString/decode'), + 'encode' : require('./queryString/encode'), + 'getParam' : require('./queryString/getParam'), + 'getQuery' : require('./queryString/getQuery'), + 'parse' : require('./queryString/parse'), + 'setParam' : require('./queryString/setParam') +}; + + diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/queryString/contains.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/queryString/contains.js new file mode 100644 index 0000000..da678cf --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/queryString/contains.js @@ -0,0 +1,12 @@ +var getQuery = require('./getQuery'); + + /** + * Checks if query string contains parameter. + */ + function contains(url, paramName) { + var regex = new RegExp('(\\?|&)'+ paramName +'=', 'g'); //matches `?param=` or `¶m=` + return regex.test(getQuery(url)); + } + + module.exports = contains; + diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/queryString/decode.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/queryString/decode.js new file mode 100644 index 0000000..1c15785 --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/queryString/decode.js @@ -0,0 +1,38 @@ +var typecast = require('../string/typecast'); +var isString = require('../lang/isString'); +var isArray = require('../lang/isArray'); +var hasOwn = require('../object/hasOwn'); + + /** + * Decode query string into an object of keys => vals. + */ + function decode(queryStr, shouldTypecast) { + var queryArr = (queryStr || '').replace('?', '').split('&'), + count = -1, + length = queryArr.length, + obj = {}, + item, pValue, pName, toSet; + + while (++count < length) { + item = queryArr[count].split('='); + pName = item[0]; + if (!pName || !pName.length){ + continue; + } + pValue = shouldTypecast === false ? item[1] : typecast(item[1]); + toSet = isString(pValue) ? decodeURIComponent(pValue) : pValue; + if (hasOwn(obj,pName)){ + if(isArray(obj[pName])){ + obj[pName].push(toSet); + } else { + obj[pName] = [obj[pName],toSet]; + } + } else { + obj[pName] = toSet; + } + } + return obj; + } + + module.exports = decode; + diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/queryString/encode.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/queryString/encode.js new file mode 100644 index 0000000..3a4fd0a --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/queryString/encode.js @@ -0,0 +1,27 @@ +var forOwn = require('../object/forOwn'); +var isArray = require('../lang/isArray'); +var forEach = require('../array/forEach'); + + /** + * Encode object into a query string. + */ + function encode(obj){ + var query = [], + arrValues, reg; + forOwn(obj, function (val, key) { + if (isArray(val)) { + arrValues = key + '='; + reg = new RegExp('&'+key+'+=$'); + forEach(val, function (aValue) { + arrValues += encodeURIComponent(aValue) + '&' + key + '='; + }); + query.push(arrValues.replace(reg, '')); + } else { + query.push(key + '=' + encodeURIComponent(val)); + } + }); + return (query.length) ? '?' + query.join('&') : ''; + } + + module.exports = encode; + diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/queryString/getParam.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/queryString/getParam.js new file mode 100644 index 0000000..f149c3e --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/queryString/getParam.js @@ -0,0 +1,15 @@ +var typecast = require('../string/typecast'); +var getQuery = require('./getQuery'); + + /** + * Get query parameter value. + */ + function getParam(url, param, shouldTypecast){ + var regexp = new RegExp('(\\?|&)'+ param + '=([^&]*)'), //matches `?param=value` or `¶m=value`, value = $2 + result = regexp.exec( getQuery(url) ), + val = (result && result[2])? result[2] : null; + return shouldTypecast === false? val : typecast(val); + } + + module.exports = getParam; + diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/queryString/getQuery.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/queryString/getQuery.js new file mode 100644 index 0000000..5194af2 --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/queryString/getQuery.js @@ -0,0 +1,13 @@ + + + /** + * Gets full query as string with all special chars decoded. + */ + function getQuery(url) { + url = url.replace(/#.*/, ''); //removes hash (to avoid getting hash query) + var queryString = /\?[a-zA-Z0-9\=\&\%\$\-\_\.\+\!\*\'\(\)\,]+/.exec(url); //valid chars according to: http://www.ietf.org/rfc/rfc1738.txt + return (queryString)? decodeURIComponent(queryString[0]) : ''; + } + + module.exports = getQuery; + diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/queryString/parse.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/queryString/parse.js new file mode 100644 index 0000000..532906c --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/queryString/parse.js @@ -0,0 +1,13 @@ +var decode = require('./decode'); +var getQuery = require('./getQuery'); + + /** + * Get query string, parses and decodes it. + */ + function parse(url, shouldTypecast) { + return decode(getQuery(url), shouldTypecast); + } + + module.exports = parse; + + diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/queryString/setParam.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/queryString/setParam.js new file mode 100644 index 0000000..052a9ba --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/queryString/setParam.js @@ -0,0 +1,28 @@ + + + /** + * Set query string parameter value + */ + function setParam(url, paramName, value){ + url = url || ''; + + var re = new RegExp('(\\?|&)'+ paramName +'=[^&]*' ); + var param = paramName +'='+ encodeURIComponent( value ); + + if ( re.test(url) ) { + return url.replace(re, '$1'+ param); + } else { + if (url.indexOf('?') === -1) { + url += '?'; + } + if (url.indexOf('=') !== -1) { + url += '&'; + } + return url + param; + } + + } + + module.exports = setParam; + + diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/random.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/random.js new file mode 100644 index 0000000..19d6dae --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/random.js @@ -0,0 +1,17 @@ + + +//automatically generated, do not edit! +//run `node build` instead +module.exports = { + 'choice' : require('./random/choice'), + 'guid' : require('./random/guid'), + 'rand' : require('./random/rand'), + 'randBit' : require('./random/randBit'), + 'randBool' : require('./random/randBool'), + 'randHex' : require('./random/randHex'), + 'randInt' : require('./random/randInt'), + 'randSign' : require('./random/randSign'), + 'random' : require('./random/random') +}; + + diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/random/choice.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/random/choice.js new file mode 100644 index 0000000..51aa82a --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/random/choice.js @@ -0,0 +1,15 @@ +var randInt = require('./randInt'); +var isArray = require('../lang/isArray'); + + /** + * Returns a random element from the supplied arguments + * or from the array (if single argument is an array). + */ + function choice(items) { + var target = (arguments.length === 1 && isArray(items))? items : arguments; + return target[ randInt(0, target.length - 1) ]; + } + + module.exports = choice; + + diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/random/guid.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/random/guid.js new file mode 100644 index 0000000..41f6edd --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/random/guid.js @@ -0,0 +1,24 @@ +var randHex = require('./randHex'); +var choice = require('./choice'); + + /** + * Returns pseudo-random guid (UUID v4) + * IMPORTANT: it's not totally "safe" since randHex/choice uses Math.random + * by default and sequences can be predicted in some cases. See the + * "random/random" documentation for more info about it and how to replace + * the default PRNG. + */ + function guid() { + return ( + randHex(8)+'-'+ + randHex(4)+'-'+ + // v4 UUID always contain "4" at this position to specify it was + // randomly generated + '4' + randHex(3) +'-'+ + // v4 UUID always contain chars [a,b,8,9] at this position + choice(8, 9, 'a', 'b') + randHex(3)+'-'+ + randHex(12) + ); + } + module.exports = guid; + diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/random/rand.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/random/rand.js new file mode 100644 index 0000000..782dec8 --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/random/rand.js @@ -0,0 +1,15 @@ +var random = require('./random'); +var MIN_INT = require('../number/MIN_INT'); +var MAX_INT = require('../number/MAX_INT'); + + /** + * Returns random number inside range + */ + function rand(min, max){ + min = min == null? MIN_INT : min; + max = max == null? MAX_INT : max; + return min + (max - min) * random(); + } + + module.exports = rand; + diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/random/randBit.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/random/randBit.js new file mode 100644 index 0000000..04f7aa5 --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/random/randBit.js @@ -0,0 +1,11 @@ +var randBool = require('./randBool'); + + /** + * Returns random bit (0 or 1) + */ + function randomBit() { + return randBool()? 1 : 0; + } + + module.exports = randomBit; + diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/random/randBool.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/random/randBool.js new file mode 100644 index 0000000..d3d35cb --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/random/randBool.js @@ -0,0 +1,12 @@ +var random = require('./random'); + + /** + * returns a random boolean value (true or false) + */ + function randBool(){ + return random() >= 0.5; + } + + module.exports = randBool; + + diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/random/randHex.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/random/randHex.js new file mode 100644 index 0000000..d8d711c --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/random/randHex.js @@ -0,0 +1,19 @@ +var choice = require('./choice'); + + var _chars = '0123456789abcdef'.split(''); + + /** + * Returns a random hexadecimal string + */ + function randHex(size){ + size = size && size > 0? size : 6; + var str = ''; + while (size--) { + str += choice(_chars); + } + return str; + } + + module.exports = randHex; + + diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/random/randInt.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/random/randInt.js new file mode 100644 index 0000000..e237d96 --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/random/randInt.js @@ -0,0 +1,18 @@ +var MIN_INT = require('../number/MIN_INT'); +var MAX_INT = require('../number/MAX_INT'); +var rand = require('./rand'); + + /** + * Gets random integer inside range or snap to min/max values. + */ + function randInt(min, max){ + min = min == null? MIN_INT : ~~min; + max = max == null? MAX_INT : ~~max; + // can't be max + 0.5 otherwise it will round up if `rand` + // returns `max` causing it to overflow range. + // -0.5 and + 0.49 are required to avoid bias caused by rounding + return Math.round( rand(min - 0.5, max + 0.499999999999) ); + } + + module.exports = randInt; + diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/random/randSign.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/random/randSign.js new file mode 100644 index 0000000..75a1a51 --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/random/randSign.js @@ -0,0 +1,11 @@ +var randBool = require('./randBool'); + + /** + * Returns random sign (-1 or 1) + */ + function randomSign() { + return randBool()? 1 : -1; + } + + module.exports = randomSign; + diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/random/random.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/random/random.js new file mode 100644 index 0000000..670a3cc --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/random/random.js @@ -0,0 +1,18 @@ + + + /** + * Just a wrapper to Math.random. No methods inside mout/random should call + * Math.random() directly so we can inject the pseudo-random number + * generator if needed (ie. in case we need a seeded random or a better + * algorithm than the native one) + */ + function random(){ + return random.get(); + } + + // we expose the method so it can be swapped if needed + random.get = Math.random; + + module.exports = random; + + diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/src/array.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/array.js new file mode 100644 index 0000000..456e7be --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/array.js @@ -0,0 +1,50 @@ +define(function(require){ + +//automatically generated, do not edit! +//run `node build` instead +return { + 'append' : require('./array/append'), + 'collect' : require('./array/collect'), + 'combine' : require('./array/combine'), + 'compact' : require('./array/compact'), + 'contains' : require('./array/contains'), + 'difference' : require('./array/difference'), + 'every' : require('./array/every'), + 'filter' : require('./array/filter'), + 'find' : require('./array/find'), + 'findIndex' : require('./array/findIndex'), + 'findLast' : require('./array/findLast'), + 'findLastIndex' : require('./array/findLastIndex'), + 'flatten' : require('./array/flatten'), + 'forEach' : require('./array/forEach'), + 'indexOf' : require('./array/indexOf'), + 'insert' : require('./array/insert'), + 'intersection' : require('./array/intersection'), + 'invoke' : require('./array/invoke'), + 'join' : require('./array/join'), + 'lastIndexOf' : require('./array/lastIndexOf'), + 'map' : require('./array/map'), + 'max' : require('./array/max'), + 'min' : require('./array/min'), + 'pick' : require('./array/pick'), + 'pluck' : require('./array/pluck'), + 'range' : require('./array/range'), + 'reduce' : require('./array/reduce'), + 'reduceRight' : require('./array/reduceRight'), + 'reject' : require('./array/reject'), + 'remove' : require('./array/remove'), + 'removeAll' : require('./array/removeAll'), + 'shuffle' : require('./array/shuffle'), + 'slice' : require('./array/slice'), + 'some' : require('./array/some'), + 'sort' : require('./array/sort'), + 'sortBy' : require('./array/sortBy'), + 'split' : require('./array/split'), + 'toLookup' : require('./array/toLookup'), + 'union' : require('./array/union'), + 'unique' : require('./array/unique'), + 'xor' : require('./array/xor'), + 'zip' : require('./array/zip') +}; + +}); diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/src/array/append.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/array/append.js new file mode 100644 index 0000000..549d875 --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/array/append.js @@ -0,0 +1,21 @@ +define(function () { + + /** + * Appends an array to the end of another. + * The first array will be modified. + */ + function append(arr1, arr2) { + if (arr2 == null) { + return arr1; + } + + var pad = arr1.length, + i = -1, + len = arr2.length; + while (++i < len) { + arr1[pad + i] = arr2[i]; + } + return arr1; + } + return append; +}); diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/src/array/collect.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/array/collect.js new file mode 100644 index 0000000..8f60cda --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/array/collect.js @@ -0,0 +1,26 @@ +define(['./append', '../function/makeIterator_'], function (append, makeIterator) { + + /** + * Maps the items in the array and concatenates the result arrays. + */ + function collect(arr, callback, thisObj){ + callback = makeIterator(callback, thisObj); + var results = []; + if (arr == null) { + return results; + } + + var i = -1, len = arr.length; + while (++i < len) { + var value = callback(arr[i], i, arr); + if (value != null) { + append(results, value); + } + } + + return results; + } + + return collect; + +}); diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/src/array/combine.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/array/combine.js new file mode 100644 index 0000000..22efb86 --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/array/combine.js @@ -0,0 +1,22 @@ +define(['./indexOf'], function (indexOf) { + + /** + * Combines an array with all the items of another. + * Does not allow duplicates and is case and type sensitive. + */ + function combine(arr1, arr2) { + if (arr2 == null) { + return arr1; + } + + var i = -1, len = arr2.length; + while (++i < len) { + if (indexOf(arr1, arr2[i]) === -1) { + arr1.push(arr2[i]); + } + } + + return arr1; + } + return combine; +}); diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/src/array/compact.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/array/compact.js new file mode 100644 index 0000000..02a8109 --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/array/compact.js @@ -0,0 +1,13 @@ +define(['./filter'], function (filter) { + + /** + * Remove all null/undefined items from array. + */ + function compact(arr) { + return filter(arr, function(val){ + return (val != null); + }); + } + + return compact; +}); diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/src/array/contains.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/array/contains.js new file mode 100644 index 0000000..fca4f7c --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/array/contains.js @@ -0,0 +1,10 @@ +define(['./indexOf'], function (indexOf) { + + /** + * If array contains values. + */ + function contains(arr, val) { + return indexOf(arr, val) !== -1; + } + return contains; +}); diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/src/array/difference.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/array/difference.js new file mode 100644 index 0000000..0d52c25 --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/array/difference.js @@ -0,0 +1,19 @@ +define(['./unique', './filter', './some', './contains', './slice'], function (unique, filter, some, contains, slice) { + + + /** + * Return a new Array with elements that aren't present in the other Arrays. + */ + function difference(arr) { + var arrs = slice(arguments, 1), + result = filter(unique(arr), function(needle){ + return !some(arrs, function(haystack){ + return contains(haystack, needle); + }); + }); + return result; + } + + return difference; + +}); diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/src/array/every.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/array/every.js new file mode 100644 index 0000000..78ba46d --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/array/every.js @@ -0,0 +1,27 @@ +define(['../function/makeIterator_'], function (makeIterator) { + + /** + * Array every + */ + function every(arr, callback, thisObj) { + callback = makeIterator(callback, thisObj); + var result = true; + if (arr == null) { + return result; + } + + var i = -1, len = arr.length; + while (++i < len) { + // we iterate over sparse items since there is no way to make it + // work properly on IE 7-8. see #64 + if (!callback(arr[i], i, arr) ) { + result = false; + break; + } + } + + return result; + } + + return every; +}); diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/src/array/filter.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/array/filter.js new file mode 100644 index 0000000..38add18 --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/array/filter.js @@ -0,0 +1,26 @@ +define(['../function/makeIterator_'], function (makeIterator) { + + /** + * Array filter + */ + function filter(arr, callback, thisObj) { + callback = makeIterator(callback, thisObj); + var results = []; + if (arr == null) { + return results; + } + + var i = -1, len = arr.length, value; + while (++i < len) { + value = arr[i]; + if (callback(value, i, arr)) { + results.push(value); + } + } + + return results; + } + + return filter; + +}); diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/src/array/find.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/array/find.js new file mode 100644 index 0000000..3957dcd --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/array/find.js @@ -0,0 +1,13 @@ +define(['./findIndex'], function (findIndex) { + + /** + * Returns first item that matches criteria + */ + function find(arr, iterator, thisObj){ + var idx = findIndex(arr, iterator, thisObj); + return idx >= 0? arr[idx] : void(0); + } + + return find; + +}); diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/src/array/findIndex.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/array/findIndex.js new file mode 100644 index 0000000..59dfeeb --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/array/findIndex.js @@ -0,0 +1,23 @@ +define(['../function/makeIterator_'], function (makeIterator) { + + /** + * Returns the index of the first item that matches criteria + */ + function findIndex(arr, iterator, thisObj){ + iterator = makeIterator(iterator, thisObj); + if (arr == null) { + return -1; + } + + var i = -1, len = arr.length; + while (++i < len) { + if (iterator(arr[i], i, arr)) { + return i; + } + } + + return -1; + } + + return findIndex; +}); diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/src/array/findLast.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/array/findLast.js new file mode 100644 index 0000000..9308fa6 --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/array/findLast.js @@ -0,0 +1,13 @@ +define(['./findLastIndex'], function (findLastIndex) { + + /** + * Returns last item that matches criteria + */ + function findLast(arr, iterator, thisObj){ + var idx = findLastIndex(arr, iterator, thisObj); + return idx >= 0? arr[idx] : void(0); + } + + return findLast; + +}); diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/src/array/findLastIndex.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/array/findLastIndex.js new file mode 100644 index 0000000..6a10312 --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/array/findLastIndex.js @@ -0,0 +1,24 @@ +define(['../function/makeIterator_'], function (makeIterator) { + + /** + * Returns the index of the last item that matches criteria + */ + function findLastIndex(arr, iterator, thisObj){ + iterator = makeIterator(iterator, thisObj); + if (arr == null) { + return -1; + } + + var n = arr.length; + while (n-- >= 0) { + if (iterator(arr[n], n, arr)) { + return n; + } + } + + return -1; + } + + return findLastIndex; + +}); diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/src/array/flatten.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/array/flatten.js new file mode 100644 index 0000000..42e87f4 --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/array/flatten.js @@ -0,0 +1,42 @@ +define(['../lang/isArray', './append'], function (isArray, append) { + + /* + * Helper function to flatten to a destination array. + * Used to remove the need to create intermediate arrays while flattening. + */ + function flattenTo(arr, result, level) { + if (arr == null) { + return result; + } else if (level === 0) { + append(result, arr); + return result; + } + + var value, + i = -1, + len = arr.length; + while (++i < len) { + value = arr[i]; + if (isArray(value)) { + flattenTo(value, result, level - 1); + } else { + result.push(value); + } + } + return result; + } + + /** + * Recursively flattens an array. + * A new array containing all the elements is returned. + * If `shallow` is true, it will only flatten one level. + */ + function flatten(arr, level) { + level = level == null? -1 : level; + return flattenTo(arr, [], level); + } + + return flatten; + +}); + diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/src/array/forEach.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/array/forEach.js new file mode 100644 index 0000000..0e04586 --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/array/forEach.js @@ -0,0 +1,23 @@ +define(function () { + + /** + * Array forEach + */ + function forEach(arr, callback, thisObj) { + if (arr == null) { + return; + } + var i = -1, + len = arr.length; + while (++i < len) { + // we iterate over sparse items since there is no way to make it + // work properly on IE 7-8. see #64 + if ( callback.call(thisObj, arr[i], i, arr) === false ) { + break; + } + } + } + + return forEach; + +}); diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/src/array/indexOf.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/array/indexOf.js new file mode 100644 index 0000000..0e75f99 --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/array/indexOf.js @@ -0,0 +1,28 @@ +define(function () { + + /** + * Array.indexOf + */ + function indexOf(arr, item, fromIndex) { + fromIndex = fromIndex || 0; + if (arr == null) { + return -1; + } + + var len = arr.length, + i = fromIndex < 0 ? len + fromIndex : fromIndex; + while (i < len) { + // we iterate over sparse items since there is no way to make it + // work properly on IE 7-8. see #64 + if (arr[i] === item) { + return i; + } + + i++; + } + + return -1; + } + + return indexOf; +}); diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/src/array/insert.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/array/insert.js new file mode 100644 index 0000000..a3d7196 --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/array/insert.js @@ -0,0 +1,14 @@ +define(['./difference', './slice'], function (difference, slice) { + + /** + * Insert item into array if not already present. + */ + function insert(arr, rest_items) { + var diff = difference(slice(arguments, 1), arr); + if (diff.length) { + Array.prototype.push.apply(arr, diff); + } + return arr.length; + } + return insert; +}); diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/src/array/intersection.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/array/intersection.js new file mode 100644 index 0000000..8d0baa4 --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/array/intersection.js @@ -0,0 +1,20 @@ +define(['./unique', './filter', './every', './contains', './slice'], function (unique, filter, every, contains, slice) { + + + /** + * Return a new Array with elements common to all Arrays. + * - based on underscore.js implementation + */ + function intersection(arr) { + var arrs = slice(arguments, 1), + result = filter(unique(arr), function(needle){ + return every(arrs, function(haystack){ + return contains(haystack, needle); + }); + }); + return result; + } + + return intersection; + +}); diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/src/array/invoke.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/array/invoke.js new file mode 100644 index 0000000..860d72a --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/array/invoke.js @@ -0,0 +1,23 @@ +define(['./slice'], function (slice) { + + /** + * Call `methodName` on each item of the array passing custom arguments if + * needed. + */ + function invoke(arr, methodName, var_args){ + if (arr == null) { + return arr; + } + + var args = slice(arguments, 2); + var i = -1, len = arr.length, value; + while (++i < len) { + value = arr[i]; + value[methodName].apply(value, args); + } + + return arr; + } + + return invoke; +}); diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/src/array/join.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/array/join.js new file mode 100644 index 0000000..2c618d2 --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/array/join.js @@ -0,0 +1,17 @@ +define(['./filter'], function(filter) { + + function isValidString(val) { + return (val != null && val !== ''); + } + + /** + * Joins strings with the specified separator inserted between each value. + * Null values and empty strings will be excluded. + */ + function join(items, separator) { + separator = separator || ''; + return filter(items, isValidString).join(separator); + } + + return join; +}); diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/src/array/lastIndexOf.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/array/lastIndexOf.js new file mode 100644 index 0000000..931235f --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/array/lastIndexOf.js @@ -0,0 +1,28 @@ +define(function () { + + /** + * Array lastIndexOf + */ + function lastIndexOf(arr, item, fromIndex) { + if (arr == null) { + return -1; + } + + var len = arr.length; + fromIndex = (fromIndex == null || fromIndex >= len)? len - 1 : fromIndex; + fromIndex = (fromIndex < 0)? len + fromIndex : fromIndex; + + while (fromIndex >= 0) { + // we iterate over sparse items since there is no way to make it + // work properly on IE 7-8. see #64 + if (arr[fromIndex] === item) { + return fromIndex; + } + fromIndex--; + } + + return -1; + } + + return lastIndexOf; +}); diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/src/array/map.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/array/map.js new file mode 100644 index 0000000..14377ab --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/array/map.js @@ -0,0 +1,22 @@ +define(['../function/makeIterator_'], function (makeIterator) { + + /** + * Array map + */ + function map(arr, callback, thisObj) { + callback = makeIterator(callback, thisObj); + var results = []; + if (arr == null){ + return results; + } + + var i = -1, len = arr.length; + while (++i < len) { + results[i] = callback(arr[i], i, arr); + } + + return results; + } + + return map; +}); diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/src/array/max.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/array/max.js new file mode 100644 index 0000000..d0628f0 --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/array/max.js @@ -0,0 +1,34 @@ +define(['../function/makeIterator_'], function (makeIterator) { + + /** + * Return maximum value inside array + */ + function max(arr, iterator, thisObj){ + if (arr == null || !arr.length) { + return Infinity; + } else if (arr.length && !iterator) { + return Math.max.apply(Math, arr); + } else { + iterator = makeIterator(iterator, thisObj); + var result, + compare = -Infinity, + value, + temp; + + var i = -1, len = arr.length; + while (++i < len) { + value = arr[i]; + temp = iterator(value, i, arr); + if (temp > compare) { + compare = temp; + result = value; + } + } + + return result; + } + } + + return max; + +}); diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/src/array/min.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/array/min.js new file mode 100644 index 0000000..07a0c71 --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/array/min.js @@ -0,0 +1,34 @@ +define(['../function/makeIterator_'], function (makeIterator) { + + /** + * Return minimum value inside array + */ + function min(arr, iterator, thisObj){ + if (arr == null || !arr.length) { + return -Infinity; + } else if (arr.length && !iterator) { + return Math.min.apply(Math, arr); + } else { + iterator = makeIterator(iterator, thisObj); + var result, + compare = Infinity, + value, + temp; + + var i = -1, len = arr.length; + while (++i < len) { + value = arr[i]; + temp = iterator(value, i, arr); + if (temp < compare) { + compare = temp; + result = value; + } + } + + return result; + } + } + + return min; + +}); diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/src/array/pick.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/array/pick.js new file mode 100644 index 0000000..dc5b222 --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/array/pick.js @@ -0,0 +1,31 @@ +define(['../random/randInt'], function (randInt) { + + /** + * Remove random item(s) from the Array and return it. + * Returns an Array of items if [nItems] is provided or a single item if + * it isn't specified. + */ + function pick(arr, nItems){ + if (nItems != null) { + var result = []; + if (nItems > 0 && arr && arr.length) { + nItems = nItems > arr.length? arr.length : nItems; + while (nItems--) { + result.push( pickOne(arr) ); + } + } + return result; + } + return (arr && arr.length)? pickOne(arr) : void(0); + } + + + function pickOne(arr){ + var idx = randInt(0, arr.length - 1); + return arr.splice(idx, 1)[0]; + } + + + return pick; + +}); diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/src/array/pluck.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/array/pluck.js new file mode 100644 index 0000000..c908856 --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/array/pluck.js @@ -0,0 +1,12 @@ +define(['./map'], function (map) { + + /** + * Extract a list of property values. + */ + function pluck(arr, propName){ + return map(arr, propName); + } + + return pluck; + +}); diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/src/array/range.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/array/range.js new file mode 100644 index 0000000..148ebf9 --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/array/range.js @@ -0,0 +1,27 @@ +define(['../math/countSteps'], function (countSteps) { + + /** + * Returns an Array of numbers inside range. + */ + function range(start, stop, step) { + if (stop == null) { + stop = start; + start = 0; + } + step = step || 1; + + var result = [], + nSteps = countSteps(stop - start, step), + i = start; + + while (i <= stop) { + result.push(i); + i += step; + } + + return result; + } + + return range; + +}); diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/src/array/reduce.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/array/reduce.js new file mode 100644 index 0000000..5f97ae8 --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/array/reduce.js @@ -0,0 +1,33 @@ +define(function () { + + /** + * Array reduce + */ + function reduce(arr, fn, initVal) { + // check for args.length since initVal might be "undefined" see #gh-57 + var hasInit = arguments.length > 2, + result = initVal; + + if (arr == null || !arr.length) { + if (!hasInit) { + throw new Error('reduce of empty array with no initial value'); + } else { + return initVal; + } + } + + var i = -1, len = arr.length; + while (++i < len) { + if (!hasInit) { + result = arr[i]; + hasInit = true; + } else { + result = fn(result, arr[i], i, arr); + } + } + + return result; + } + + return reduce; +}); diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/src/array/reduceRight.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/array/reduceRight.js new file mode 100644 index 0000000..ddae0e7 --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/array/reduceRight.js @@ -0,0 +1,34 @@ +define(function () { + + /** + * Array reduceRight + */ + function reduceRight(arr, fn, initVal) { + // check for args.length since initVal might be "undefined" see #gh-57 + var hasInit = arguments.length > 2; + + if (arr == null || !arr.length) { + if (hasInit) { + return initVal; + } else { + throw new Error('reduce of empty array with no initial value'); + } + } + + var i = arr.length, result = initVal, value; + while (--i >= 0) { + // we iterate over sparse items since there is no way to make it + // work properly on IE 7-8. see #64 + value = arr[i]; + if (!hasInit) { + result = value; + hasInit = true; + } else { + result = fn(result, value, i, arr); + } + } + return result; + } + + return reduceRight; +}); diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/src/array/reject.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/array/reject.js new file mode 100644 index 0000000..cad4038 --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/array/reject.js @@ -0,0 +1,25 @@ +define(['../function/makeIterator_'], function(makeIterator) { + + /** + * Array reject + */ + function reject(arr, callback, thisObj) { + callback = makeIterator(callback, thisObj); + var results = []; + if (arr == null) { + return results; + } + + var i = -1, len = arr.length, value; + while (++i < len) { + value = arr[i]; + if (!callback(value, i, arr)) { + results.push(value); + } + } + + return results; + } + + return reject; +}); diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/src/array/remove.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/array/remove.js new file mode 100644 index 0000000..dec9134 --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/array/remove.js @@ -0,0 +1,13 @@ +define(['./indexOf'], function(indexOf){ + + /** + * Remove a single item from the array. + * (it won't remove duplicates, just a single item) + */ + function remove(arr, item){ + var idx = indexOf(arr, item); + if (idx !== -1) arr.splice(idx, 1); + } + + return remove; +}); diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/src/array/removeAll.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/array/removeAll.js new file mode 100644 index 0000000..e81022b --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/array/removeAll.js @@ -0,0 +1,15 @@ +define(['./indexOf'], function(indexOf){ + + /** + * Remove all instances of an item from array. + */ + function removeAll(arr, item){ + var idx = indexOf(arr, item); + while (idx !== -1) { + arr.splice(idx, 1); + idx = indexOf(arr, item, idx); + } + } + + return removeAll; +}); diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/src/array/shuffle.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/array/shuffle.js new file mode 100644 index 0000000..891d167 --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/array/shuffle.js @@ -0,0 +1,28 @@ +define(['../random/randInt'], function (randInt) { + + /** + * Shuffle array items. + */ + function shuffle(arr) { + var results = [], + rnd; + if (arr == null) { + return results; + } + + var i = -1, len = arr.length, value; + while (++i < len) { + if (!i) { + results[0] = arr[0]; + } else { + rnd = randInt(0, i); + results[i] = results[rnd]; + results[rnd] = arr[i]; + } + } + + return results; + } + + return shuffle; +}); diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/src/array/slice.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/array/slice.js new file mode 100644 index 0000000..994caba --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/array/slice.js @@ -0,0 +1,35 @@ +define(function () { + + /** + * Create slice of source array or array-like object + */ + function slice(arr, start, end){ + var len = arr.length; + + if (start == null) { + start = 0; + } else if (start < 0) { + start = Math.max(len + start, 0); + } else { + start = Math.min(start, len); + } + + if (end == null) { + end = len; + } else if (end < 0) { + end = Math.max(len + end, 0); + } else { + end = Math.min(end, len); + } + + var result = []; + while (start < end) { + result.push(arr[start++]); + } + + return result; + } + + return slice; + +}); diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/src/array/some.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/array/some.js new file mode 100644 index 0000000..e46a978 --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/array/some.js @@ -0,0 +1,27 @@ +define(['../function/makeIterator_'], function (makeIterator) { + + /** + * Array some + */ + function some(arr, callback, thisObj) { + callback = makeIterator(callback, thisObj); + var result = false; + if (arr == null) { + return result; + } + + var i = -1, len = arr.length; + while (++i < len) { + // we iterate over sparse items since there is no way to make it + // work properly on IE 7-8. see #64 + if ( callback(arr[i], i, arr) ) { + result = true; + break; + } + } + + return result; + } + + return some; +}); diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/src/array/sort.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/array/sort.js new file mode 100644 index 0000000..4c19404 --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/array/sort.js @@ -0,0 +1,55 @@ +define(function () { + + /** + * Merge sort (http://en.wikipedia.org/wiki/Merge_sort) + */ + function mergeSort(arr, compareFn) { + if (arr == null) { + return []; + } else if (arr.length < 2) { + return arr; + } + + if (compareFn == null) { + compareFn = defaultCompare; + } + + var mid, left, right; + + mid = ~~(arr.length / 2); + left = mergeSort( arr.slice(0, mid), compareFn ); + right = mergeSort( arr.slice(mid, arr.length), compareFn ); + + return merge(left, right, compareFn); + } + + function defaultCompare(a, b) { + return a < b ? -1 : (a > b? 1 : 0); + } + + function merge(left, right, compareFn) { + var result = []; + + while (left.length && right.length) { + if (compareFn(left[0], right[0]) <= 0) { + // if 0 it should preserve same order (stable) + result.push(left.shift()); + } else { + result.push(right.shift()); + } + } + + if (left.length) { + result.push.apply(result, left); + } + + if (right.length) { + result.push.apply(result, right); + } + + return result; + } + + return mergeSort; + +}); diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/src/array/sortBy.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/array/sortBy.js new file mode 100644 index 0000000..2797194 --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/array/sortBy.js @@ -0,0 +1,18 @@ +define(['./sort', '../function/makeIterator_'], function (sort, makeIterator) { + + /* + * Sort array by the result of the callback + */ + function sortBy(arr, callback, context){ + callback = makeIterator(callback, context); + + return sort(arr, function(a, b) { + a = callback(a); + b = callback(b); + return (a < b) ? -1 : ((a > b) ? 1 : 0); + }); + } + + return sortBy; + +}); diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/src/array/split.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/array/split.js new file mode 100644 index 0000000..a17275e --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/array/split.js @@ -0,0 +1,35 @@ +define(function() { + + /** + * Split array into a fixed number of segments. + */ + function split(array, segments) { + segments = segments || 2; + var results = []; + if (array == null) { + return results; + } + + var minLength = Math.floor(array.length / segments), + remainder = array.length % segments, + i = 0, + len = array.length, + segmentIndex = 0, + segmentLength; + + while (i < len) { + segmentLength = minLength; + if (segmentIndex < remainder) { + segmentLength++; + } + + results.push(array.slice(i, i + segmentLength)); + + segmentIndex++; + i += segmentLength; + } + + return results; + } + return split; +}); diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/src/array/toLookup.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/array/toLookup.js new file mode 100644 index 0000000..aac8fd1 --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/array/toLookup.js @@ -0,0 +1,28 @@ +define(['../lang/isFunction'], function (isFunction) { + + /** + * Creates an object that holds a lookup for the objects in the array. + */ + function toLookup(arr, key) { + var result = {}; + if (arr == null) { + return result; + } + + var i = -1, len = arr.length, value; + if (isFunction(key)) { + while (++i < len) { + value = arr[i]; + result[key(value)] = value; + } + } else { + while (++i < len) { + value = arr[i]; + result[value[key]] = value; + } + } + + return result; + } + return toLookup; +}); diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/src/array/union.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/array/union.js new file mode 100644 index 0000000..5f9922e --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/array/union.js @@ -0,0 +1,18 @@ +define(['./unique', './append'], function (unique, append) { + + /** + * Concat multiple arrays and remove duplicates + */ + function union(arrs) { + var results = []; + var i = -1, len = arguments.length; + while (++i < len) { + append(results, arguments[i]); + } + + return unique(results); + } + + return union; + +}); diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/src/array/unique.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/array/unique.js new file mode 100644 index 0000000..c4a011a --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/array/unique.js @@ -0,0 +1,25 @@ +define(['./filter'], function(filter){ + + /** + * @return {array} Array of unique items + */ + function unique(arr, compare){ + compare = compare || isEqual; + return filter(arr, function(item, i, arr){ + var n = arr.length; + while (++i < n) { + if ( compare(item, arr[i]) ) { + return false; + } + } + return true; + }); + } + + function isEqual(a, b){ + return a === b; + } + + return unique; +}); + diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/src/array/xor.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/array/xor.js new file mode 100644 index 0000000..7df89d9 --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/array/xor.js @@ -0,0 +1,24 @@ +define(['./unique', './filter', './contains'], function (unique, filter, contains) { + + + /** + * Exclusive OR. Returns items that are present in a single array. + * - like ptyhon's `symmetric_difference` + */ + function xor(arr1, arr2) { + arr1 = unique(arr1); + arr2 = unique(arr2); + + var a1 = filter(arr1, function(item){ + return !contains(arr2, item); + }), + a2 = filter(arr2, function(item){ + return !contains(arr1, item); + }); + + return a1.concat(a2); + } + + return xor; + +}); diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/src/array/zip.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/array/zip.js new file mode 100644 index 0000000..bd0dbb8 --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/array/zip.js @@ -0,0 +1,27 @@ +define(['./max', './map'], function (max, map) { + + function getLength(arr) { + return arr == null ? 0 : arr.length; + } + + /** + * Merges together the values of each of the arrays with the values at the + * corresponding position. + */ + function zip(arr){ + var len = arr ? max(map(arguments, getLength)) : 0, + results = [], + i = -1; + while (++i < len) { + // jshint loopfunc: true + results.push(map(arguments, function(item) { + return item == null ? undefined : item[i]; + })); + } + + return results; + } + + return zip; + +}); diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/src/collection.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/collection.js new file mode 100644 index 0000000..386e6da --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/collection.js @@ -0,0 +1,22 @@ +define(function(require){ + +//automatically generated, do not edit! +//run `node build` instead +return { + 'contains' : require('./collection/contains'), + 'every' : require('./collection/every'), + 'filter' : require('./collection/filter'), + 'find' : require('./collection/find'), + 'forEach' : require('./collection/forEach'), + 'make_' : require('./collection/make_'), + 'map' : require('./collection/map'), + 'max' : require('./collection/max'), + 'min' : require('./collection/min'), + 'pluck' : require('./collection/pluck'), + 'reduce' : require('./collection/reduce'), + 'reject' : require('./collection/reject'), + 'size' : require('./collection/size'), + 'some' : require('./collection/some') +}; + +}); diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/src/collection/contains.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/collection/contains.js new file mode 100644 index 0000000..192167e --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/collection/contains.js @@ -0,0 +1,7 @@ +define(['./make_', '../array/contains', '../object/contains'], function (make, arrContains, objContains) { + + /** + */ + return make(arrContains, objContains); + +}); diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/src/collection/every.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/collection/every.js new file mode 100644 index 0000000..6317f50 --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/collection/every.js @@ -0,0 +1,7 @@ +define(['./make_', '../array/every', '../object/every'], function (make, arrEvery, objEvery) { + + /** + */ + return make(arrEvery, objEvery); + +}); diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/src/collection/filter.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/collection/filter.js new file mode 100644 index 0000000..4e7fadc --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/collection/filter.js @@ -0,0 +1,22 @@ +define(['./forEach', '../function/makeIterator_'], function (forEach, makeIterator) { + + /** + * filter collection values, returns array. + */ + function filter(list, iterator, thisObj) { + iterator = makeIterator(iterator, thisObj); + var results = []; + if (!list) { + return results; + } + forEach(list, function(value, index, list) { + if (iterator(value, index, list)) { + results[results.length] = value; + } + }); + return results; + } + + return filter; + +}); diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/src/collection/find.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/collection/find.js new file mode 100644 index 0000000..681f941 --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/collection/find.js @@ -0,0 +1,8 @@ +define(['./make_', '../array/find', '../object/find'], function(make, arrFind, objFind) { + + /** + * Find value that returns true on iterator check. + */ + return make(arrFind, objFind); + +}); diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/src/collection/forEach.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/collection/forEach.js new file mode 100644 index 0000000..3b39d3e --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/collection/forEach.js @@ -0,0 +1,7 @@ +define(['./make_', '../array/forEach', '../object/forOwn'], function (make, arrForEach, objForEach) { + + /** + */ + return make(arrForEach, objForEach); + +}); diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/src/collection/make_.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/collection/make_.js new file mode 100644 index 0000000..290a651 --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/collection/make_.js @@ -0,0 +1,19 @@ +define(['../array/slice'], function(slice){ + + /** + * internal method used to create other collection modules. + */ + function makeCollectionMethod(arrMethod, objMethod, defaultReturn) { + return function(){ + var args = slice(arguments); + if (args[0] == null) { + return defaultReturn; + } + // array-like is treated as array + return (typeof args[0].length === 'number')? arrMethod.apply(null, args) : objMethod.apply(null, args); + }; + } + + return makeCollectionMethod; + +}); diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/src/collection/map.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/collection/map.js new file mode 100644 index 0000000..96e2498 --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/collection/map.js @@ -0,0 +1,20 @@ +define(['../lang/isObject', '../object/values', '../array/map', '../function/makeIterator_'], function (isObject, values, arrMap, makeIterator) { + + /** + * Map collection values, returns Array. + */ + function map(list, callback, thisObj) { + callback = makeIterator(callback, thisObj); + // list.length to check array-like object, if not array-like + // we simply map all the object values + if( isObject(list) && list.length == null ){ + list = values(list); + } + return arrMap(list, function (val, key, list) { + return callback(val, key, list); + }); + } + + return map; + +}); diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/src/collection/max.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/collection/max.js new file mode 100644 index 0000000..de9a6da --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/collection/max.js @@ -0,0 +1,8 @@ +define(['./make_', '../array/max', '../object/max'], function (make, arrMax, objMax) { + + /** + * Get maximum value inside collection + */ + return make(arrMax, objMax); + +}); diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/src/collection/min.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/collection/min.js new file mode 100644 index 0000000..f0c239a --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/collection/min.js @@ -0,0 +1,8 @@ +define(['./make_', '../array/min', '../object/min'], function (make, arrMin, objMin) { + + /** + * Get minimum value inside collection. + */ + return make(arrMin, objMin); + +}); diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/src/collection/pluck.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/collection/pluck.js new file mode 100644 index 0000000..ef784a7 --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/collection/pluck.js @@ -0,0 +1,14 @@ +define(['./map'], function (map) { + + /** + * Extract a list of property values. + */ + function pluck(list, key) { + return map(list, function(value) { + return value[key]; + }); + } + + return pluck; + +}); diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/src/collection/reduce.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/collection/reduce.js new file mode 100644 index 0000000..bd05d43 --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/collection/reduce.js @@ -0,0 +1,7 @@ +define(['./make_', '../array/reduce', '../object/reduce'], function (make, arrReduce, objReduce) { + + /** + */ + return make(arrReduce, objReduce); + +}); diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/src/collection/reject.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/collection/reject.js new file mode 100644 index 0000000..581adfd --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/collection/reject.js @@ -0,0 +1,15 @@ +define(['./filter', '../function/makeIterator_'], function (filter, makeIterator) { + + /** + * Inverse or collection/filter + */ + function reject(list, iterator, thisObj) { + iterator = makeIterator(iterator, thisObj); + return filter(list, function(value, index, list) { + return !iterator(value, index, list); + }, thisObj); + } + + return reject; + +}); diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/src/collection/size.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/collection/size.js new file mode 100644 index 0000000..4e5ab41 --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/collection/size.js @@ -0,0 +1,18 @@ +define(['../lang/isArray', '../object/size'], function (isArray, objSize) { + + /** + * Get collection size + */ + function size(list) { + if (!list) { + return 0; + } + if (isArray(list)) { + return list.length; + } + return objSize(list); + } + + return size; + +}); diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/src/collection/some.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/collection/some.js new file mode 100644 index 0000000..c0aebee --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/collection/some.js @@ -0,0 +1,7 @@ +define(['./make_', '../array/some', '../object/some'], function (make, arrSome, objSome) { + + /** + */ + return make(arrSome, objSome); + +}); diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/src/date.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/date.js new file mode 100644 index 0000000..b3038ee --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/date.js @@ -0,0 +1,22 @@ +define(function(require){ + +//automatically generated, do not edit! +//run `node build` instead +return { + 'dayOfTheYear' : require('./date/dayOfTheYear'), + 'diff' : require('./date/diff'), + 'i18n_' : require('./date/i18n_'), + 'isLeapYear' : require('./date/isLeapYear'), + 'isSame' : require('./date/isSame'), + 'parseIso' : require('./date/parseIso'), + 'quarter' : require('./date/quarter'), + 'startOf' : require('./date/startOf'), + 'strftime' : require('./date/strftime'), + 'timezoneAbbr' : require('./date/timezoneAbbr'), + 'timezoneOffset' : require('./date/timezoneOffset'), + 'totalDaysInMonth' : require('./date/totalDaysInMonth'), + 'totalDaysInYear' : require('./date/totalDaysInYear'), + 'weekOfTheYear' : require('./date/weekOfTheYear') +}; + +}); diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/src/date/dayOfTheYear.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/date/dayOfTheYear.js new file mode 100644 index 0000000..dc77ae1 --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/date/dayOfTheYear.js @@ -0,0 +1,13 @@ +define(['../lang/isDate'], function (isDate) { + + /** + * return the day of the year (1..366) + */ + function dayOfTheYear(date){ + return (Date.UTC(date.getFullYear(), date.getMonth(), date.getDate()) - + Date.UTC(date.getFullYear(), 0, 1)) / 86400000 + 1; + } + + return dayOfTheYear; + +}); diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/src/date/diff.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/date/diff.js new file mode 100644 index 0000000..667165f --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/date/diff.js @@ -0,0 +1,128 @@ +define(['./totalDaysInMonth', './totalDaysInYear', '../time/convert'], function(totalDaysInMonth, totalDaysInYear, convert){ + + /** + * calculate the difference between dates (range) + */ + function diff(start, end, unitName){ + // sort the dates to make it easier to process (specially year/month) + if (start > end) { + var swap = start; + start = end; + end = swap; + } + + var output; + + if (unitName === 'month') { + output = getMonthsDiff(start, end); + } else if (unitName === 'year'){ + output = getYearsDiff(start, end); + } else if (unitName != null) { + if (unitName === 'day') { + // ignore timezone difference because of daylight savings time + start = toUtc(start); + end = toUtc(end); + } + output = convert(end - start, 'ms', unitName); + } else { + output = end - start; + } + + return output; + } + + + function toUtc(d){ + // we ignore timezone differences on purpose because of daylight + // savings time, otherwise it would return fractional days/weeks even + // if a full day elapsed. eg: + // Wed Feb 12 2014 00:00:00 GMT-0200 (BRST) + // Sun Feb 16 2014 00:00:00 GMT-0300 (BRT) + // diff should be 4 days and not 4.041666666666667 + return Date.UTC(d.getUTCFullYear(), d.getUTCMonth(), d.getUTCDate(), + d.getHours(), d.getMinutes(), d.getSeconds(), + d.getMilliseconds()); + } + + + function getMonthsDiff(start, end){ + return getElapsedMonths(start, end) + + getElapsedYears(start, end) * 12 + + getFractionalMonth(start, end); + } + + + function getYearsDiff(start, end){ + var elapsedYears = getElapsedYears(start, end); + return elapsedYears + getFractionalYear(start, end, elapsedYears); + } + + + function getElapsedMonths(start, end){ + var monthDiff = end.getMonth() - start.getMonth(); + if (monthDiff < 0) { + monthDiff += 12; + } + // less than a full month + if (start.getDate() > end.getDate()) { + monthDiff -= 1; + } + return monthDiff; + } + + + function getElapsedYears(start, end){ + var yearDiff = end.getFullYear() - start.getFullYear(); + // less than a full year + if (start.getMonth() > end.getMonth()) { + yearDiff -= 1; + } + return yearDiff; + } + + + function getFractionalMonth(start, end){ + var fractionalDiff = 0; + var startDay = start.getDate(); + var endDay = end.getDate(); + + if (startDay !== endDay) { + var startTotalDays = totalDaysInMonth(start); + var endTotalDays = totalDaysInMonth(end); + var totalDays; + var daysElapsed; + + if (startDay > endDay) { + // eg: Jan 29 - Feb 27 (29 days elapsed but not a full month) + var baseDay = startTotalDays - startDay; + daysElapsed = endDay + baseDay; + // total days should be relative to 1st day of next month if + // startDay > endTotalDays + totalDays = (startDay > endTotalDays)? + endTotalDays + baseDay + 1 : startDay + baseDay; + } else { + // fractional is only based on endMonth eg: Jan 12 - Feb 18 + // (6 fractional days, 28 days until next full month) + daysElapsed = endDay - startDay; + totalDays = endTotalDays; + } + + fractionalDiff = daysElapsed / totalDays; + } + + return fractionalDiff; + } + + + function getFractionalYear(start, end, elapsedYears){ + var base = elapsedYears? + new Date(end.getFullYear(), start.getMonth(), start.getDate()) : + start; + var elapsedDays = diff(base, end, 'day'); + return elapsedDays / totalDaysInYear(end); + } + + + return diff; + +}); diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/src/date/i18n/de-DE.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/date/i18n/de-DE.js new file mode 100644 index 0000000..46f5c6a --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/date/i18n/de-DE.js @@ -0,0 +1,61 @@ +define(function(){ + // de-DE (German) + return { + "am" : "", + "pm" : "", + + "x": "%d/%m/%y", + "X": "%H:%M:%S", + "c": "%a %d %b %Y %H:%M:%S %Z", + + "months" : [ + "Januar", + "Februar", + "März", + "April", + "Mai", + "Juni", + "Juli", + "August", + "September", + "Oktober", + "November", + "Dezember" + ], + + "months_abbr" : [ + "Jan", + "Febr", + "März", + "Apr", + "Mai", + "Juni", + "Juli", + "Aug", + "Sept", + "Okt", + "Nov", + "Dez" + ], + + "days" : [ + "Sonntag", + "Montag", + "Dienstag", + "Mittwoch", + "Donnerstag", + "Freitag", + "Samstag" + ], + + "days_abbr" : [ + "So", + "Mo", + "Di", + "Mi", + "Do", + "Fr", + "Sa" + ] + }; +}); diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/src/date/i18n/en-US.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/date/i18n/en-US.js new file mode 100644 index 0000000..5e640c2 --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/date/i18n/en-US.js @@ -0,0 +1,61 @@ +define(function(){ + // en-US (English, United States) + return { + "am" : "AM", + "pm" : "PM", + + "x": "%m/%d/%y", + "X": "%H:%M:%S", + "c": "%a %d %b %Y %I:%M:%S %p %Z", + + "months" : [ + "January", + "February", + "March", + "April", + "May", + "June", + "July", + "August", + "September", + "October", + "November", + "December" + ], + + "months_abbr" : [ + "Jan", + "Feb", + "Mar", + "Apr", + "May", + "Jun", + "Jul", + "Aug", + "Sep", + "Oct", + "Nov", + "Dec" + ], + + "days" : [ + "Sunday", + "Monday", + "Tuesday", + "Wednesday", + "Thursday", + "Friday", + "Saturday" + ], + + "days_abbr" : [ + "Sun", + "Mon", + "Tue", + "Wed", + "Thu", + "Fri", + "Sat" + ] + }; +}); diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/src/date/i18n/pt-BR.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/date/i18n/pt-BR.js new file mode 100644 index 0000000..47256dd --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/date/i18n/pt-BR.js @@ -0,0 +1,61 @@ +define(function(){ + // pt-BR (Brazillian Portuguese) + return { + "am" : "", + "pm" : "", + + "x": "%d/%m/%y", + "X": "%H:%M:%S", + "c": "%a %d %b %Y %H:%M:%S %Z", + + "months" : [ + "Janeiro", + "Fevereiro", + "Março", + "Abril", + "Maio", + "Junho", + "Julho", + "Agosto", + "Setembro", + "Outubro", + "Novembro", + "Dezembro" + ], + + "months_abbr" : [ + "Jan", + "Fev", + "Mar", + "Abr", + "Mai", + "Jun", + "Jul", + "Ago", + "Set", + "Out", + "Nov", + "Dez" + ], + + "days" : [ + "Domingo", + "Segunda", + "Terça", + "Quarta", + "Quinta", + "Sexta", + "Sábado" + ], + + "days_abbr" : [ + "Dom", + "Seg", + "Ter", + "Qua", + "Qui", + "Sex", + "Sáb" + ] + }; +}); diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/src/date/i18n_.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/date/i18n_.js new file mode 100644 index 0000000..c04ce88 --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/date/i18n_.js @@ -0,0 +1,13 @@ +define(['../object/mixIn', './i18n/en-US'], function(mixIn, enUS){ + + // we also use mixIn to make sure we don't affect the original locale + var activeLocale = mixIn({}, enUS, { + // we expose a "set" method to allow overriding the global locale + set : function(localeData){ + mixIn(activeLocale, localeData); + } + }); + + return activeLocale; + +}); diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/src/date/isLeapYear.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/date/isLeapYear.js new file mode 100644 index 0000000..e400b43 --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/date/isLeapYear.js @@ -0,0 +1,15 @@ +define(['../lang/isDate'], function (isDate) { + + /** + * checks if it's a leap year + */ + function isLeapYear(fullYear){ + if (isDate(fullYear)) { + fullYear = fullYear.getFullYear(); + } + return fullYear % 400 === 0 || (fullYear % 100 !== 0 && fullYear % 4 === 0); + } + + return isLeapYear; + +}); diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/src/date/isSame.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/date/isSame.js new file mode 100644 index 0000000..f30531f --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/date/isSame.js @@ -0,0 +1,16 @@ +define(['./startOf'], function (startOf) { + + /** + * Check if date is "same" with optional period + */ + function isSame(date1, date2, period){ + if (period) { + date1 = startOf(date1, period); + date2 = startOf(date2, period); + } + return Number(date1) === Number(date2); + } + + return isSame; + +}); diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/src/date/parseIso.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/date/parseIso.js new file mode 100644 index 0000000..b21c879 --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/date/parseIso.js @@ -0,0 +1,146 @@ +define(['../array/some'], function (some) { + + var datePatterns = [ + /^([0-9]{4})$/, // YYYY + /^([0-9]{4})-([0-9]{2})$/, // YYYY-MM (YYYYMM not allowed) + /^([0-9]{4})-?([0-9]{2})-?([0-9]{2})$/ // YYYY-MM-DD or YYYYMMDD + ]; + var ORD_DATE = /^([0-9]{4})-?([0-9]{3})$/; // YYYY-DDD + + var timePatterns = [ + /^([0-9]{2}(?:\.[0-9]*)?)$/, // HH.hh + /^([0-9]{2}):?([0-9]{2}(?:\.[0-9]*)?)$/, // HH:MM.mm + /^([0-9]{2}):?([0-9]{2}):?([0-9]{2}(\.[0-9]*)?)$/ // HH:MM:SS.ss + ]; + + var DATE_TIME = /^(.+)T(.+)$/; + var TIME_ZONE = /^(.+)([+\-])([0-9]{2}):?([0-9]{2})$/; + + function matchAll(str, patterns) { + var match; + var found = some(patterns, function(pattern) { + return !!(match = pattern.exec(str)); + }); + + return found ? match : null; + } + + function getDate(year, month, day) { + var date = new Date(Date.UTC(year, month, day)); + + // Explicitly set year to avoid Date.UTC making dates < 100 relative to + // 1900 + date.setUTCFullYear(year); + + var valid = + date.getUTCFullYear() === year && + date.getUTCMonth() === month && + date.getUTCDate() === day; + return valid ? +date : NaN; + } + + function parseOrdinalDate(str) { + var match = ORD_DATE.exec(str); + if (match ) { + var year = +match[1], + day = +match[2], + date = new Date(Date.UTC(year, 0, day)); + + if (date.getUTCFullYear() === year) { + return +date; + } + } + + return NaN; + } + + function parseDate(str) { + var match, year, month, day; + + match = matchAll(str, datePatterns); + if (match === null) { + // Ordinal dates are verified differently. + return parseOrdinalDate(str); + } + + year = (match[1] === void 0) ? 0 : +match[1]; + month = (match[2] === void 0) ? 0 : +match[2] - 1; + day = (match[3] === void 0) ? 1 : +match[3]; + + return getDate(year, month, day); + } + + function getTime(hr, min, sec) { + var valid = + (hr < 24 && hr >= 0 && + min < 60 && min >= 0 && + sec < 60 && min >= 0) || + (hr === 24 && min === 0 && sec === 0); + if (!valid) { + return NaN; + } + + return ((hr * 60 + min) * 60 + sec) * 1000; + } + + function parseOffset(str) { + var match; + if (str.charAt(str.length - 1) === 'Z') { + str = str.substring(0, str.length - 1); + } else { + match = TIME_ZONE.exec(str); + if (match) { + var hours = +match[3], + minutes = (match[4] === void 0) ? 0 : +match[4], + offset = getTime(hours, minutes, 0); + + if (match[2] === '-') { + offset *= -1; + } + + return { offset: offset, time: match[1] }; + } + } + + // No time zone specified, assume UTC + return { offset: 0, time: str }; + } + + function parseTime(str) { + var match; + var offset = parseOffset(str); + + str = offset.time; + offset = offset.offset; + if (isNaN(offset)) { + return NaN; + } + + match = matchAll(str, timePatterns); + if (match === null) { + return NaN; + } + + var hours = (match[1] === void 0) ? 0 : +match[1], + minutes = (match[2] === void 0) ? 0 : +match[2], + seconds = (match[3] === void 0) ? 0 : +match[3]; + + return getTime(hours, minutes, seconds) - offset; + } + + /** + * Parse an ISO8601 formatted date string, and return a Date object. + */ + function parseISO8601(str){ + var match = DATE_TIME.exec(str); + if (!match) { + // No time specified + return parseDate(str); + } + + return parseDate(match[1]) + parseTime(match[2]); + } + + return parseISO8601; + +}); diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/src/date/quarter.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/date/quarter.js new file mode 100644 index 0000000..62b9206 --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/date/quarter.js @@ -0,0 +1,16 @@ +define(function () { + + /** + * gets date quarter + */ + function quarter(date){ + var month = date.getMonth(); + if (month < 3) return 1; + if (month < 6) return 2; + if (month < 9) return 3; + return 4; + } + + return quarter; + +}); diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/src/date/startOf.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/date/startOf.js new file mode 100644 index 0000000..747f114 --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/date/startOf.js @@ -0,0 +1,54 @@ +define(['../lang/clone'], function (clone) { + + /** + * get a new Date object representing start of period + */ + function startOf(date, period){ + date = clone(date); + + // intentionally removed "break" from switch since start of + // month/year/etc should also reset the following periods + switch (period) { + case 'year': + date.setMonth(0); + /* falls through */ + case 'month': + date.setDate(1); + /* falls through */ + case 'week': + case 'day': + date.setHours(0); + /* falls through */ + case 'hour': + date.setMinutes(0); + /* falls through */ + case 'minute': + date.setSeconds(0); + /* falls through */ + case 'second': + date.setMilliseconds(0); + break; + default: + throw new Error('"'+ period +'" is not a valid period'); + } + + // week is the only case that should reset the weekDay and maybe even + // overflow to previous month + if (period === 'week') { + var weekDay = date.getDay(); + var baseDate = date.getDate(); + if (weekDay) { + if (weekDay >= baseDate) { + //start of the week is on previous month + date.setDate(0); + } + date.setDate(date.getDate() - date.getDay()); + } + } + + return date; + } + + return startOf; + +}); diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/src/date/strftime.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/date/strftime.js new file mode 100644 index 0000000..9c09c69 --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/date/strftime.js @@ -0,0 +1,115 @@ +define(['../number/pad', '../string/lpad', './i18n_', './dayOfTheYear', './timezoneOffset', './timezoneAbbr', './weekOfTheYear'], function (pad, lpad, i18n, dayOfTheYear, timezoneOffset, timezoneAbbr, weekOfTheYear) { + + var _combinations = { + 'D': '%m/%d/%y', + 'F': '%Y-%m-%d', + 'r': '%I:%M:%S %p', + 'R': '%H:%M', + 'T': '%H:%M:%S', + 'x': 'locale', + 'X': 'locale', + 'c': 'locale' + }; + + + /** + * format date based on strftime format + */ + function strftime(date, format, localeData){ + localeData = localeData || i18n; + var reToken = /%([a-z%])/gi; + + function makeIterator(fn) { + return function(match, token){ + return fn(date, token, localeData); + }; + } + + return format + .replace(reToken, makeIterator(expandCombinations)) + .replace(reToken, makeIterator(convertToken)); + } + + + function expandCombinations(date, token, l10n){ + if (token in _combinations) { + var expanded = _combinations[token]; + return expanded === 'locale'? l10n[token] : expanded; + } else { + return '%'+ token; + } + } + + + function convertToken(date, token, l10n){ + switch (token){ + case 'a': + return l10n.days_abbr[date.getDay()]; + case 'A': + return l10n.days[date.getDay()]; + case 'h': + case 'b': + return l10n.months_abbr[date.getMonth()]; + case 'B': + return l10n.months[date.getMonth()]; + case 'C': + return pad(Math.floor(date.getFullYear() / 100), 2); + case 'd': + return pad(date.getDate(), 2); + case 'e': + return pad(date.getDate(), 2, ' '); + case 'H': + return pad(date.getHours(), 2); + case 'I': + return pad(date.getHours() % 12, 2); + case 'j': + return pad(dayOfTheYear(date), 3); + case 'l': + return lpad(date.getHours() % 12, 2); + case 'L': + return pad(date.getMilliseconds(), 3); + case 'm': + return pad(date.getMonth() + 1, 2); + case 'M': + return pad(date.getMinutes(), 2); + case 'n': + return '\n'; + case 'p': + return date.getHours() >= 12? l10n.pm : l10n.am; + case 'P': + return convertToken(date, 'p', l10n).toLowerCase(); + case 's': + return date.getTime() / 1000; + case 'S': + return pad(date.getSeconds(), 2); + case 't': + return '\t'; + case 'u': + var day = date.getDay(); + return day === 0? 7 : day; + case 'U': + return pad(weekOfTheYear(date), 2); + case 'w': + return date.getDay(); + case 'W': + return pad(weekOfTheYear(date, 1), 2); + case 'y': + return pad(date.getFullYear() % 100, 2); + case 'Y': + return pad(date.getFullYear(), 4); + case 'z': + return timezoneOffset(date); + case 'Z': + return timezoneAbbr(date); + case '%': + return '%'; + default: + // keep unrecognized tokens + return '%'+ token; + } + } + + + return strftime; + +}); diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/src/date/timezoneAbbr.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/date/timezoneAbbr.js new file mode 100644 index 0000000..225a685 --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/date/timezoneAbbr.js @@ -0,0 +1,17 @@ +define(['./timezoneOffset'], function(timezoneOffset) { + + /** + * Abbreviated time zone name or similar information. + */ + function timezoneAbbr(date){ + // Date.toString gives different results depending on the + // browser/system so we fallback to timezone offset + // chrome: 'Mon Apr 08 2013 09:02:04 GMT-0300 (BRT)' + // IE: 'Mon Apr 8 09:02:04 UTC-0300 2013' + var tz = /\(([A-Z]{3,4})\)/.exec(date.toString()); + return tz? tz[1] : timezoneOffset(date); + } + + return timezoneAbbr; + +}); diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/src/date/timezoneOffset.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/date/timezoneOffset.js new file mode 100644 index 0000000..ca06705 --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/date/timezoneOffset.js @@ -0,0 +1,16 @@ +define(['../number/pad'], function (pad) { + + /** + * time zone as hour and minute offset from UTC (e.g. +0900) + */ + function timezoneOffset(date){ + var offset = date.getTimezoneOffset(); + var abs = Math.abs(offset); + var h = pad(Math.floor(abs / 60), 2); + var m = pad(abs % 60, 2); + return (offset > 0? '-' : '+') + h + m; + } + + return timezoneOffset; + +}); diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/src/date/totalDaysInMonth.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/date/totalDaysInMonth.js new file mode 100644 index 0000000..98f7e9d --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/date/totalDaysInMonth.js @@ -0,0 +1,24 @@ +define(['../lang/isDate', './isLeapYear'], function (isDate, isLeapYear) { + + var DAYS_IN_MONTH = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]; + + /** + * returns the total amount of days in the month (considering leap years) + */ + function totalDaysInMonth(fullYear, monthIndex){ + if (isDate(fullYear)) { + var date = fullYear; + year = date.getFullYear(); + monthIndex = date.getMonth(); + } + + if (monthIndex === 1 && isLeapYear(fullYear)) { + return 29; + } else { + return DAYS_IN_MONTH[monthIndex]; + } + } + + return totalDaysInMonth; + +}); diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/src/date/totalDaysInYear.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/date/totalDaysInYear.js new file mode 100644 index 0000000..e9036b4 --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/date/totalDaysInYear.js @@ -0,0 +1,13 @@ +define(['./isLeapYear'], function (isLeapYear) { + + /** + * return the amount of days in the year following the gregorian calendar + * and leap years + */ + function totalDaysInYear(fullYear){ + return isLeapYear(fullYear)? 366 : 365; + } + + return totalDaysInYear; + +}); diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/src/date/weekOfTheYear.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/date/weekOfTheYear.js new file mode 100644 index 0000000..8dabc45 --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/date/weekOfTheYear.js @@ -0,0 +1,16 @@ +define(['./dayOfTheYear'], function (dayOfTheYear) { + + /** + * Return the week of the year based on given firstDayOfWeek + */ + function weekOfTheYear(date, firstDayOfWeek){ + firstDayOfWeek = firstDayOfWeek == null? 0 : firstDayOfWeek; + var doy = dayOfTheYear(date); + var dow = (7 + date.getDay() - firstDayOfWeek) % 7; + var relativeWeekDay = 6 - firstDayOfWeek - dow; + return Math.floor((doy + relativeWeekDay) / 7); + } + + return weekOfTheYear; + +}); diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/src/function.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/function.js new file mode 100644 index 0000000..5104780 --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/function.js @@ -0,0 +1,22 @@ +define(function(require){ + +//automatically generated, do not edit! +//run `node build` instead +return { + 'awaitDelay' : require('./function/awaitDelay'), + 'bind' : require('./function/bind'), + 'compose' : require('./function/compose'), + 'constant' : require('./function/constant'), + 'debounce' : require('./function/debounce'), + 'func' : require('./function/func'), + 'identity' : require('./function/identity'), + 'makeIterator_' : require('./function/makeIterator_'), + 'partial' : require('./function/partial'), + 'prop' : require('./function/prop'), + 'series' : require('./function/series'), + 'throttle' : require('./function/throttle'), + 'timeout' : require('./function/timeout'), + 'times' : require('./function/times') +}; + +}); diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/src/function/awaitDelay.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/function/awaitDelay.js new file mode 100644 index 0000000..88bea6e --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/function/awaitDelay.js @@ -0,0 +1,20 @@ +define(['../time/now', './timeout', '../array/append'], function (now, timeout, append) { + + /** + * Ensure a minimum delay for callbacks + */ + function awaitDelay( callback, delay ){ + var baseTime = now() + delay; + return function() { + // ensure all browsers will execute it asynchronously (avoid hard + // to catch errors) not using "0" because of old browsers and also + // since new browsers increase the value to be at least "4" + // http://www.whatwg.org/specs/web-apps/current-work/multipage/timers.html#dom-windowtimers-settimeout + var ms = Math.max(baseTime - now(), 4); + return timeout.apply(this, append([callback, ms, this], arguments)); + }; + } + + return awaitDelay; + +}); diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/src/function/bind.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/function/bind.js new file mode 100644 index 0000000..787c298 --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/function/bind.js @@ -0,0 +1,19 @@ +define(['../array/slice'], function(slice){ + + /** + * Return a function that will execute in the given context, optionally adding any additional supplied parameters to the beginning of the arguments collection. + * @param {Function} fn Function. + * @param {object} context Execution context. + * @param {rest} args Arguments (0...n arguments). + * @return {Function} Wrapped Function. + */ + function bind(fn, context, args){ + var argsArr = slice(arguments, 2); //curried args + return function(){ + return fn.apply(context, argsArr.concat(slice(arguments))); + }; + } + + return bind; +}); + diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/src/function/compose.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/function/compose.js new file mode 100644 index 0000000..d8b228f --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/function/compose.js @@ -0,0 +1,23 @@ +define(function () { + + /** + * Returns a function that composes multiple functions, passing results to + * each other. + */ + function compose() { + var fns = arguments; + return function(arg){ + // only cares about the first argument since the chain can only + // deal with a single return value anyway. It should start from + // the last fn. + var n = fns.length; + while (n--) { + arg = fns[n].call(this, arg); + } + return arg; + }; + } + + return compose; + +}); diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/src/function/constant.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/function/constant.js new file mode 100644 index 0000000..addd412 --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/function/constant.js @@ -0,0 +1,14 @@ +define(function () { + + /** + * Returns a new function that will return the value + */ + function constant(value){ + return function() { + return value; + }; + } + + return constant; + +}); diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/src/function/debounce.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/function/debounce.js new file mode 100644 index 0000000..8c5fd47 --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/function/debounce.js @@ -0,0 +1,32 @@ +define(function () { + + /** + * Debounce callback execution + */ + function debounce(fn, threshold, isAsap){ + var timeout, result; + function debounced(){ + var args = arguments, context = this; + function delayed(){ + if (! isAsap) { + result = fn.apply(context, args); + } + timeout = null; + } + if (timeout) { + clearTimeout(timeout); + } else if (isAsap) { + result = fn.apply(context, args); + } + timeout = setTimeout(delayed, threshold); + return result; + } + debounced.cancel = function(){ + clearTimeout(timeout); + }; + return debounced; + } + + return debounce; + +}); diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/src/function/func.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/function/func.js new file mode 100644 index 0000000..b920e00 --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/function/func.js @@ -0,0 +1,14 @@ +define(function () { + + /** + * Returns a function that call a method on the passed object + */ + function func(name){ + return function(obj){ + return obj[name](); + }; + } + + return func; + +}); diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/src/function/identity.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/function/identity.js new file mode 100644 index 0000000..59f7182 --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/function/identity.js @@ -0,0 +1,12 @@ +define(function () { + + /** + * Returns the first argument provided to it. + */ + function identity(val){ + return val; + } + + return identity; + +}); diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/src/function/makeIterator_.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/function/makeIterator_.js new file mode 100644 index 0000000..771ea19 --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/function/makeIterator_.js @@ -0,0 +1,32 @@ +define(['./identity', './prop', '../object/deepMatches'], function(identity, prop, deepMatches) { + + /** + * Converts argument into a valid iterator. + * Used internally on most array/object/collection methods that receives a + * callback/iterator providing a shortcut syntax. + */ + function makeIterator(src, thisObj){ + if (src == null) { + return identity; + } + switch(typeof src) { + case 'function': + // function is the first to improve perf (most common case) + // also avoid using `Function#call` if not needed, which boosts + // perf a lot in some cases + return (typeof thisObj !== 'undefined')? function(val, i, arr){ + return src.call(thisObj, val, i, arr); + } : src; + case 'object': + return function(val){ + return deepMatches(val, src); + }; + case 'string': + case 'number': + return prop(src); + } + } + + return makeIterator; + +}); diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/src/function/partial.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/function/partial.js new file mode 100644 index 0000000..f825767 --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/function/partial.js @@ -0,0 +1,15 @@ +define(['../array/slice'], function (slice) { + + /** + * Creates a partially applied function. + */ + function partial(fn, var_args){ + var argsArr = slice(arguments, 1); //curried args + return function(){ + return fn.apply(this, argsArr.concat(slice(arguments))); + }; + } + + return partial; + +}); diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/src/function/prop.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/function/prop.js new file mode 100644 index 0000000..c9df78c --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/function/prop.js @@ -0,0 +1,14 @@ +define(function () { + + /** + * Returns a function that gets a property of the passed object + */ + function prop(name){ + return function(obj){ + return obj[name]; + }; + } + + return prop; + +}); diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/src/function/series.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/function/series.js new file mode 100644 index 0000000..c8856a2 --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/function/series.js @@ -0,0 +1,22 @@ +define(function () { + + /** + * Returns a function that will execute a list of functions in sequence + * passing the same arguments to each one. (useful for batch processing + * items during a forEach loop) + */ + function series(){ + var fns = arguments; + return function(){ + var i = 0, + n = fns.length; + while (i < n) { + fns[i].apply(this, arguments); + i += 1; + } + }; + } + + return series; + +}); diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/src/function/throttle.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/function/throttle.js new file mode 100644 index 0000000..9fb47b2 --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/function/throttle.js @@ -0,0 +1,33 @@ +define(['../time/now'], function (now) { + + /** + */ + function throttle(fn, delay){ + var context, timeout, result, args, + diff, prevCall = 0; + function delayed(){ + prevCall = now(); + timeout = null; + result = fn.apply(context, args); + } + function throttled(){ + context = this; + args = arguments; + diff = delay - (now() - prevCall); + if (diff <= 0) { + clearTimeout(timeout); + delayed(); + } else if (! timeout) { + timeout = setTimeout(delayed, diff); + } + return result; + } + throttled.cancel = function(){ + clearTimeout(timeout); + }; + return throttled; + } + + return throttle; + +}); diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/src/function/timeout.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/function/timeout.js new file mode 100644 index 0000000..61b832c --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/function/timeout.js @@ -0,0 +1,17 @@ +define(['../array/slice'], function (slice) { + + /** + * Delays the call of a function within a given context. + */ + function timeout(fn, millis, context){ + + var args = slice(arguments, 3); + + return setTimeout(function() { + fn.apply(context, args); + }, millis); + } + + return timeout; + +}); diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/src/function/times.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/function/times.js new file mode 100644 index 0000000..ec10cae --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/function/times.js @@ -0,0 +1,17 @@ +define(function () { + + /** + * Iterates over a callback a set amount of times + */ + function times(n, callback, thisObj){ + var i = -1; + while (++i < n) { + if ( callback.call(thisObj, i) === false ) { + break; + } + } + } + + return times; + +}); diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/src/index.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/index.js new file mode 100644 index 0000000..5d1ef28 --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/index.js @@ -0,0 +1,25 @@ +/**@license + * mout v0.9.1 | http://moutjs.com | MIT license + */ +define(function(require){ + +//automatically generated, do not edit! +//run `node build` instead +return { + 'VERSION' : '0.9.1', + 'array' : require('./array'), + 'collection' : require('./collection'), + 'date' : require('./date'), + 'function' : require('./function'), + 'lang' : require('./lang'), + 'math' : require('./math'), + 'number' : require('./number'), + 'object' : require('./object'), + 'queryString' : require('./queryString'), + 'random' : require('./random'), + 'string' : require('./string'), + 'time' : require('./time'), + 'fn' : require('./function') +}; + +}); diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/src/lang.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/lang.js new file mode 100644 index 0000000..434916a --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/lang.js @@ -0,0 +1,37 @@ +define(function(require){ + +//automatically generated, do not edit! +//run `node build` instead +return { + 'clone' : require('./lang/clone'), + 'createObject' : require('./lang/createObject'), + 'ctorApply' : require('./lang/ctorApply'), + 'deepClone' : require('./lang/deepClone'), + 'defaults' : require('./lang/defaults'), + 'inheritPrototype' : require('./lang/inheritPrototype'), + 'is' : require('./lang/is'), + 'isArguments' : require('./lang/isArguments'), + 'isArray' : require('./lang/isArray'), + 'isBoolean' : require('./lang/isBoolean'), + 'isDate' : require('./lang/isDate'), + 'isEmpty' : require('./lang/isEmpty'), + 'isFinite' : require('./lang/isFinite'), + 'isFunction' : require('./lang/isFunction'), + 'isInteger' : require('./lang/isInteger'), + 'isKind' : require('./lang/isKind'), + 'isNaN' : require('./lang/isNaN'), + 'isNull' : require('./lang/isNull'), + 'isNumber' : require('./lang/isNumber'), + 'isObject' : require('./lang/isObject'), + 'isPlainObject' : require('./lang/isPlainObject'), + 'isRegExp' : require('./lang/isRegExp'), + 'isString' : require('./lang/isString'), + 'isUndefined' : require('./lang/isUndefined'), + 'isnt' : require('./lang/isnt'), + 'kindOf' : require('./lang/kindOf'), + 'toArray' : require('./lang/toArray'), + 'toNumber' : require('./lang/toNumber'), + 'toString' : require('./lang/toString') +}; + +}); diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/src/lang/clone.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/lang/clone.js new file mode 100644 index 0000000..468489a --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/lang/clone.js @@ -0,0 +1,47 @@ +define(['./kindOf', './isPlainObject', '../object/mixIn'], function (kindOf, isPlainObject, mixIn) { + + /** + * Clone native types. + */ + function clone(val){ + switch (kindOf(val)) { + case 'Object': + return cloneObject(val); + case 'Array': + return cloneArray(val); + case 'RegExp': + return cloneRegExp(val); + case 'Date': + return cloneDate(val); + default: + return val; + } + } + + function cloneObject(source) { + if (isPlainObject(source)) { + return mixIn({}, source); + } else { + return source; + } + } + + function cloneRegExp(r) { + var flags = ''; + flags += r.multiline ? 'm' : ''; + flags += r.global ? 'g' : ''; + flags += r.ignorecase ? 'i' : ''; + return new RegExp(r.source, flags); + } + + function cloneDate(date) { + return new Date(+date); + } + + function cloneArray(arr) { + return arr.slice(); + } + + return clone; + +}); diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/src/lang/createObject.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/lang/createObject.js new file mode 100644 index 0000000..f766150 --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/lang/createObject.js @@ -0,0 +1,18 @@ +define(['../object/mixIn'], function(mixIn){ + + /** + * Create Object using prototypal inheritance and setting custom properties. + * - Mix between Douglas Crockford Prototypal Inheritance and the EcmaScript 5 `Object.create()` method. + * @param {object} parent Parent Object. + * @param {object} [props] Object properties. + * @return {object} Created object. + */ + function createObject(parent, props){ + function F(){} + F.prototype = parent; + return mixIn(new F(), props); + + } + return createObject; +}); + diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/src/lang/ctorApply.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/lang/ctorApply.js new file mode 100644 index 0000000..a9ac1c5 --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/lang/ctorApply.js @@ -0,0 +1,17 @@ +define(function () { + + function F(){} + + /** + * Do fn.apply on a constructor. + */ + function ctorApply(ctor, args) { + F.prototype = ctor.prototype; + var instance = new F(); + ctor.apply(instance, args); + return instance; + } + + return ctorApply; + +}); diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/src/lang/deepClone.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/lang/deepClone.js new file mode 100644 index 0000000..d45c10a --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/lang/deepClone.js @@ -0,0 +1,45 @@ +define(['./clone', '../object/forOwn', './kindOf', './isPlainObject'], function (clone, forOwn, kindOf, isPlainObject) { + + /** + * Recursively clone native types. + */ + function deepClone(val, instanceClone) { + switch ( kindOf(val) ) { + case 'Object': + return cloneObject(val, instanceClone); + case 'Array': + return cloneArray(val, instanceClone); + default: + return clone(val); + } + } + + function cloneObject(source, instanceClone) { + if (isPlainObject(source)) { + var out = {}; + forOwn(source, function(val, key) { + this[key] = deepClone(val, instanceClone); + }, out); + return out; + } else if (instanceClone) { + return instanceClone(source); + } else { + return source; + } + } + + function cloneArray(arr, instanceClone) { + var out = [], + i = -1, + n = arr.length, + val; + while (++i < n) { + out[i] = deepClone(arr[i], instanceClone); + } + return out; + } + + return deepClone; + +}); + diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/src/lang/defaults.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/lang/defaults.js new file mode 100644 index 0000000..5156b1b --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/lang/defaults.js @@ -0,0 +1,16 @@ +define(['./toArray', '../array/find'], function (toArray, find) { + + /** + * Return first non void argument + */ + function defaults(var_args){ + return find(toArray(arguments), nonVoid); + } + + function nonVoid(val){ + return val != null; + } + + return defaults; + +}); diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/src/lang/inheritPrototype.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/lang/inheritPrototype.js new file mode 100644 index 0000000..64c9178 --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/lang/inheritPrototype.js @@ -0,0 +1,18 @@ +define(['./createObject'], function(createObject){ + + /** + * Inherit prototype from another Object. + * - inspired by Nicholas Zackas Solution + * @param {object} child Child object + * @param {object} parent Parent Object + */ + function inheritPrototype(child, parent){ + var p = createObject(parent.prototype); + p.constructor = child; + child.prototype = p; + child.super_ = parent; + return p; + } + + return inheritPrototype; +}); diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/src/lang/is.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/lang/is.js new file mode 100644 index 0000000..261a207 --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/lang/is.js @@ -0,0 +1,23 @@ +define(function () { + + /** + * Check if both arguments are egal. + */ + function is(x, y){ + // implementation borrowed from harmony:egal spec + if (x === y) { + // 0 === -0, but they are not identical + return x !== 0 || 1 / x === 1 / y; + } + + // NaN !== NaN, but they are identical. + // NaNs are the only non-reflexive value, i.e., if x !== x, + // then x is a NaN. + // isNaN is broken: it converts its argument to number, so + // isNaN("foo") => true + return x !== x && y !== y; + } + + return is; + +}); diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/src/lang/isArguments.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/lang/isArguments.js new file mode 100644 index 0000000..f889ee8 --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/lang/isArguments.js @@ -0,0 +1,15 @@ +define(['./isKind'], function (isKind) { + + /** + */ + var isArgs = isKind(arguments, 'Arguments')? + function(val){ + return isKind(val, 'Arguments'); + } : + function(val){ + // Arguments is an Object on IE7 + return !!(val && Object.prototype.hasOwnProperty.call(val, 'callee')); + }; + + return isArgs; +}); diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/src/lang/isArray.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/lang/isArray.js new file mode 100644 index 0000000..886e2aa --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/lang/isArray.js @@ -0,0 +1,8 @@ +define(['./isKind'], function (isKind) { + /** + */ + var isArray = Array.isArray || function (val) { + return isKind(val, 'Array'); + }; + return isArray; +}); diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/src/lang/isBoolean.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/lang/isBoolean.js new file mode 100644 index 0000000..1ca27a6 --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/lang/isBoolean.js @@ -0,0 +1,8 @@ +define(['./isKind'], function (isKind) { + /** + */ + function isBoolean(val) { + return isKind(val, 'Boolean'); + } + return isBoolean; +}); diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/src/lang/isDate.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/lang/isDate.js new file mode 100644 index 0000000..2708d67 --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/lang/isDate.js @@ -0,0 +1,8 @@ +define(['./isKind'], function (isKind) { + /** + */ + function isDate(val) { + return isKind(val, 'Date'); + } + return isDate; +}); diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/src/lang/isEmpty.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/lang/isEmpty.js new file mode 100644 index 0000000..4cc3d2d --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/lang/isEmpty.js @@ -0,0 +1,23 @@ +define(['../object/forOwn', './isArray'], function (forOwn, isArray) { + + function isEmpty(val){ + if (val == null) { + // typeof null == 'object' so we check it first + return false; + } else if ( typeof val === 'string' || isArray(val) ) { + return !val.length; + } else if ( typeof val === 'object' || typeof val === 'function' ) { + var result = true; + forOwn(val, function(){ + result = false; + return false; // break loop + }); + return result; + } else { + return false; + } + } + + return isEmpty; + +}); diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/src/lang/isFinite.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/lang/isFinite.js new file mode 100644 index 0000000..5a982f4 --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/lang/isFinite.js @@ -0,0 +1,21 @@ +define(['./isNumber'], function (isNumber) { + + var global = this; + + /** + * Check if value is finite + */ + function isFinite(val){ + var is = false; + if (typeof val === 'string' && val !== '') { + is = global.isFinite( parseFloat(val) ); + } else if (isNumber(val)){ + // need to use isNumber because of Number constructor + is = global.isFinite( val ); + } + return is; + } + + return isFinite; + +}); diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/src/lang/isFunction.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/lang/isFunction.js new file mode 100644 index 0000000..ff5df7f --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/lang/isFunction.js @@ -0,0 +1,8 @@ +define(['./isKind'], function (isKind) { + /** + */ + function isFunction(val) { + return isKind(val, 'Function'); + } + return isFunction; +}); diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/src/lang/isInteger.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/lang/isInteger.js new file mode 100644 index 0000000..1931f51 --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/lang/isInteger.js @@ -0,0 +1,12 @@ +define(['./isNumber'], function (isNumber) { + + /** + * Check if value is an integer + */ + function isInteger(val){ + return isNumber(val) && (val % 1 === 0); + } + + return isInteger; + +}); diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/src/lang/isKind.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/lang/isKind.js new file mode 100644 index 0000000..6937a12 --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/lang/isKind.js @@ -0,0 +1,9 @@ +define(['./kindOf'], function (kindOf) { + /** + * Check if value is from a specific "kind". + */ + function isKind(val, kind){ + return kindOf(val) === kind; + } + return isKind; +}); diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/src/lang/isNaN.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/lang/isNaN.js new file mode 100644 index 0000000..2219404 --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/lang/isNaN.js @@ -0,0 +1,15 @@ +define(['./isNumber', '../number/isNaN'], function (isNumber, $isNaN) { + + /** + * Check if value is NaN for realz + */ + function isNaN(val){ + // based on the fact that NaN !== NaN + // need to check if it's a number to avoid conflicts with host objects + // also need to coerce ToNumber to avoid edge case `new Number(NaN)` + return !isNumber(val) || $isNaN(Number(val)); + } + + return isNaN; + +}); diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/src/lang/isNull.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/lang/isNull.js new file mode 100644 index 0000000..506e05e --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/lang/isNull.js @@ -0,0 +1,9 @@ +define(function () { + /** + */ + function isNull(val){ + return val === null; + } + return isNull; +}); + diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/src/lang/isNumber.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/lang/isNumber.js new file mode 100644 index 0000000..9a832c5 --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/lang/isNumber.js @@ -0,0 +1,8 @@ +define(['./isKind'], function (isKind) { + /** + */ + function isNumber(val) { + return isKind(val, 'Number'); + } + return isNumber; +}); diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/src/lang/isObject.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/lang/isObject.js new file mode 100644 index 0000000..0befb06 --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/lang/isObject.js @@ -0,0 +1,8 @@ +define(['./isKind'], function (isKind) { + /** + */ + function isObject(val) { + return isKind(val, 'Object'); + } + return isObject; +}); diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/src/lang/isPlainObject.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/lang/isPlainObject.js new file mode 100644 index 0000000..406a279 --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/lang/isPlainObject.js @@ -0,0 +1,13 @@ +define(function () { + + /** + * Checks if the value is created by the `Object` constructor. + */ + function isPlainObject(value) { + return (!!value && typeof value === 'object' && + value.constructor === Object); + } + + return isPlainObject; + +}); diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/src/lang/isRegExp.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/lang/isRegExp.js new file mode 100644 index 0000000..d78a03d --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/lang/isRegExp.js @@ -0,0 +1,8 @@ +define(['./isKind'], function (isKind) { + /** + */ + function isRegExp(val) { + return isKind(val, 'RegExp'); + } + return isRegExp; +}); diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/src/lang/isString.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/lang/isString.js new file mode 100644 index 0000000..8a42fe0 --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/lang/isString.js @@ -0,0 +1,8 @@ +define(['./isKind'], function (isKind) { + /** + */ + function isString(val) { + return isKind(val, 'String'); + } + return isString; +}); diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/src/lang/isUndefined.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/lang/isUndefined.js new file mode 100644 index 0000000..c57b28e --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/lang/isUndefined.js @@ -0,0 +1,10 @@ +define(function () { + var UNDEF; + + /** + */ + function isUndef(val){ + return val === UNDEF; + } + return isUndef; +}); diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/src/lang/isnt.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/lang/isnt.js new file mode 100644 index 0000000..d433622 --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/lang/isnt.js @@ -0,0 +1,12 @@ +define(['./is'], function (is) { + + /** + * Check if both values are not identical/egal + */ + function isnt(x, y){ + return !is(x, y); + } + + return isnt; + +}); diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/src/lang/kindOf.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/lang/kindOf.js new file mode 100644 index 0000000..97d21d1 --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/lang/kindOf.js @@ -0,0 +1,20 @@ +define(function () { + + var _rKind = /^\[object (.*)\]$/, + _toString = Object.prototype.toString, + UNDEF; + + /** + * Gets the "kind" of value. (e.g. "String", "Number", etc) + */ + function kindOf(val) { + if (val === null) { + return 'Null'; + } else if (val === UNDEF) { + return 'Undefined'; + } else { + return _rKind.exec( _toString.call(val) )[1]; + } + } + return kindOf; +}); diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/src/lang/toArray.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/lang/toArray.js new file mode 100644 index 0000000..552916f --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/lang/toArray.js @@ -0,0 +1,31 @@ +define(['./kindOf'], function (kindOf) { + + var _win = this; + + /** + * Convert array-like object into array + */ + function toArray(val){ + var ret = [], + kind = kindOf(val), + n; + + if (val != null) { + if ( val.length == null || kind === 'String' || kind === 'Function' || kind === 'RegExp' || val === _win ) { + //string, regexp, function have .length but user probably just want + //to wrap value into an array.. + ret[ret.length] = val; + } else { + //window returns true on isObject in IE7 and may have length + //property. `typeof NodeList` returns `function` on Safari so + //we can't use it (#58) + n = val.length; + while (n--) { + ret[n] = val[n]; + } + } + } + return ret; + } + return toArray; +}); diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/src/lang/toNumber.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/lang/toNumber.js new file mode 100644 index 0000000..3976738 --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/lang/toNumber.js @@ -0,0 +1,20 @@ +define(['./isArray'], function (isArray) { + + /** + * covert value into number if numeric + */ + function toNumber(val){ + // numberic values should come first because of -0 + if (typeof val === 'number') return val; + // we want all falsy values (besides -0) to return zero to avoid + // headaches + if (!val) return 0; + if (typeof val === 'string') return parseFloat(val); + // arrays are edge cases. `Number([4]) === 4` + if (isArray(val)) return NaN; + return Number(val); + } + + return toNumber; + +}); diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/src/lang/toString.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/lang/toString.js new file mode 100644 index 0000000..c28b89a --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/lang/toString.js @@ -0,0 +1,13 @@ +define(function () { + + /** + * Typecast a value to a String, using an empty string value for null or + * undefined. + */ + function toString(val){ + return val == null ? '' : val.toString(); + } + + return toString; + +}); diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/src/math.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/math.js new file mode 100644 index 0000000..e2ba870 --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/math.js @@ -0,0 +1,19 @@ +define(function(require){ + +//automatically generated, do not edit! +//run `node build` instead +return { + 'ceil' : require('./math/ceil'), + 'clamp' : require('./math/clamp'), + 'countSteps' : require('./math/countSteps'), + 'floor' : require('./math/floor'), + 'inRange' : require('./math/inRange'), + 'isNear' : require('./math/isNear'), + 'lerp' : require('./math/lerp'), + 'loop' : require('./math/loop'), + 'map' : require('./math/map'), + 'norm' : require('./math/norm'), + 'round' : require('./math/round') +}; + +}); diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/src/math/ceil.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/math/ceil.js new file mode 100644 index 0000000..d73b058 --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/math/ceil.js @@ -0,0 +1,11 @@ +define(function(){ + /** + * Round value up with a custom radix. + */ + function ceil(val, step){ + step = Math.abs(step || 1); + return Math.ceil(val / step) * step; + } + + return ceil; +}); diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/src/math/clamp.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/math/clamp.js new file mode 100644 index 0000000..fb5a148 --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/math/clamp.js @@ -0,0 +1,9 @@ +define(function(){ + /** + * Clamps value inside range. + */ + function clamp(val, min, max){ + return val < min? min : (val > max? max : val); + } + return clamp; +}); diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/src/math/countSteps.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/math/countSteps.js new file mode 100644 index 0000000..0ecb32f --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/math/countSteps.js @@ -0,0 +1,16 @@ +define(function(){ + /** + * Count number of full steps. + */ + function countSteps(val, step, overflow){ + val = Math.floor(val / step); + + if (overflow) { + return val % overflow; + } + + return val; + } + + return countSteps; +}); diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/src/math/floor.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/math/floor.js new file mode 100644 index 0000000..8a4456b --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/math/floor.js @@ -0,0 +1,10 @@ +define(function(){ + /** + * Floor value to full steps. + */ + function floor(val, step){ + step = Math.abs(step || 1); + return Math.floor(val / step) * step; + } + return floor; +}); diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/src/math/inRange.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/math/inRange.js new file mode 100644 index 0000000..0c89053 --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/math/inRange.js @@ -0,0 +1,11 @@ +define(function(){ + /** + * Checks if value is inside the range. + */ + function inRange(val, min, max, threshold){ + threshold = threshold || 0; + return (val + threshold >= min && val - threshold <= max); + } + + return inRange; +}); diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/src/math/isNear.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/math/isNear.js new file mode 100644 index 0000000..b308a0b --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/math/isNear.js @@ -0,0 +1,9 @@ +define(function(){ + /** + * Check if value is close to target. + */ + function isNear(val, target, threshold){ + return (Math.abs(val - target) <= threshold); + } + return isNear; +}); diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/src/math/lerp.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/math/lerp.js new file mode 100644 index 0000000..26b99d0 --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/math/lerp.js @@ -0,0 +1,11 @@ +define(function(){ + /** + * Linear interpolation. + * IMPORTANT:will return `Infinity` if numbers overflow Number.MAX_VALUE + */ + function lerp(ratio, start, end){ + return start + (end - start) * ratio; + } + + return lerp; +}); diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/src/math/loop.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/math/loop.js new file mode 100644 index 0000000..c735ecf --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/math/loop.js @@ -0,0 +1,10 @@ +define(function(){ + /** + * Loops value inside range. + */ + function loop(val, min, max){ + return val < min? max : (val > max? min : val); + } + + return loop; +}); diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/src/math/map.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/math/map.js new file mode 100644 index 0000000..bf7dc5d --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/math/map.js @@ -0,0 +1,10 @@ +define(['./lerp', './norm'], function(lerp, norm){ + /** + * Maps a number from one scale to another. + * @example map(3, 0, 4, -1, 1) -> 0.5 + */ + function map(val, min1, max1, min2, max2){ + return lerp( norm(val, min1, max1), min2, max2 ); + } + return map; +}); diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/src/math/norm.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/math/norm.js new file mode 100644 index 0000000..fccae20 --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/math/norm.js @@ -0,0 +1,9 @@ +define(function(){ + /** + * Gets normalized ratio of value inside range. + */ + function norm(val, min, max){ + return (val - min) / (max - min); + } + return norm; +}); diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/src/math/round.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/math/round.js new file mode 100644 index 0000000..b43e4ac --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/math/round.js @@ -0,0 +1,12 @@ +define(function () { + /** + * Round number to a specific radix + */ + function round(value, radix){ + radix = radix || 1; // default round 1 + return Math.round(value / radix) * radix; + } + + return round; + +}); diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/src/number.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/number.js new file mode 100644 index 0000000..6d8d6fc --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/number.js @@ -0,0 +1,24 @@ +define(function(require){ + +//automatically generated, do not edit! +//run `node build` instead +return { + 'MAX_INT' : require('./number/MAX_INT'), + 'MAX_UINT' : require('./number/MAX_UINT'), + 'MIN_INT' : require('./number/MIN_INT'), + 'abbreviate' : require('./number/abbreviate'), + 'currencyFormat' : require('./number/currencyFormat'), + 'enforcePrecision' : require('./number/enforcePrecision'), + 'isNaN' : require('./number/isNaN'), + 'nth' : require('./number/nth'), + 'ordinal' : require('./number/ordinal'), + 'pad' : require('./number/pad'), + 'rol' : require('./number/rol'), + 'ror' : require('./number/ror'), + 'sign' : require('./number/sign'), + 'toInt' : require('./number/toInt'), + 'toUInt' : require('./number/toUInt'), + 'toUInt31' : require('./number/toUInt31') +}; + +}); diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/src/number/MAX_INT.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/number/MAX_INT.js new file mode 100644 index 0000000..23a6e1a --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/number/MAX_INT.js @@ -0,0 +1,6 @@ +/** + * @constant Maximum 32-bit signed integer value. (2^31 - 1) + */ +define(function(){ + return 2147483647; +}); diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/src/number/MAX_UINT.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/number/MAX_UINT.js new file mode 100644 index 0000000..a035096 --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/number/MAX_UINT.js @@ -0,0 +1,6 @@ +/** + * @constant Maximum 32-bit unsigned integet value (2^32 - 1) + */ +define(function(){ + return 4294967295; +}); diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/src/number/MIN_INT.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/number/MIN_INT.js new file mode 100644 index 0000000..9b3e978 --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/number/MIN_INT.js @@ -0,0 +1,6 @@ +/** + * @constant Minimum 32-bit signed integer value (-2^31). + */ +define(function(){ + return -2147483648; +}); diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/src/number/abbreviate.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/number/abbreviate.js new file mode 100644 index 0000000..7e7405a --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/number/abbreviate.js @@ -0,0 +1,35 @@ +define(['./enforcePrecision'], function (enforcePrecision) { + + var _defaultDict = { + thousand : 'K', + million : 'M', + billion : 'B' + }; + + /** + * Abbreviate number if bigger than 1000. (eg: 2.5K, 17.5M, 3.4B, ...) + */ + function abbreviateNumber(val, nDecimals, dict){ + nDecimals = nDecimals != null? nDecimals : 1; + dict = dict || _defaultDict; + val = enforcePrecision(val, nDecimals); + + var str, mod; + + if (val < 1000000) { + mod = enforcePrecision(val / 1000, nDecimals); + // might overflow to next scale during rounding + str = mod < 1000? mod + dict.thousand : 1 + dict.million; + } else if (val < 1000000000) { + mod = enforcePrecision(val / 1000000, nDecimals); + str = mod < 1000? mod + dict.million : 1 + dict.billion; + } else { + str = enforcePrecision(val / 1000000000, nDecimals) + dict.billion; + } + + return str; + } + + return abbreviateNumber; + +}); diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/src/number/currencyFormat.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/number/currencyFormat.js new file mode 100644 index 0000000..1e5fecb --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/number/currencyFormat.js @@ -0,0 +1,27 @@ +define(['../lang/toNumber'], function (toNumber) { + + /** + * Converts number into currency format + */ + function currencyFormat(val, nDecimalDigits, decimalSeparator, thousandsSeparator) { + val = toNumber(val); + nDecimalDigits = nDecimalDigits == null? 2 : nDecimalDigits; + decimalSeparator = decimalSeparator == null? '.' : decimalSeparator; + thousandsSeparator = thousandsSeparator == null? ',' : thousandsSeparator; + + //can't use enforce precision since it returns a number and we are + //doing a RegExp over the string + var fixed = val.toFixed(nDecimalDigits), + //separate begin [$1], middle [$2] and decimal digits [$4] + parts = new RegExp('^(-?\\d{1,3})((?:\\d{3})+)(\\.(\\d{'+ nDecimalDigits +'}))?$').exec( fixed ); + + if(parts){ //val >= 1000 || val <= -1000 + return parts[1] + parts[2].replace(/\d{3}/g, thousandsSeparator + '$&') + (parts[4] ? decimalSeparator + parts[4] : ''); + }else{ + return fixed.replace('.', decimalSeparator); + } + } + + return currencyFormat; + +}); diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/src/number/enforcePrecision.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/number/enforcePrecision.js new file mode 100644 index 0000000..1e65e50 --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/number/enforcePrecision.js @@ -0,0 +1,12 @@ +define(['../lang/toNumber'], function(toNumber){ + /** + * Enforce a specific amount of decimal digits and also fix floating + * point rounding issues. + */ + function enforcePrecision(val, nDecimalDigits){ + val = toNumber(val); + var pow = Math.pow(10, nDecimalDigits); + return +(Math.round(val * pow) / pow).toFixed(nDecimalDigits); + } + return enforcePrecision; +}); diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/src/number/isNaN.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/number/isNaN.js new file mode 100644 index 0000000..3f1ebb6 --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/number/isNaN.js @@ -0,0 +1,14 @@ +define(function () { + + /** + * ES6 Number.isNaN + * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/isNaN + */ + function isNaN(val){ + // jshint eqeqeq:false + return typeof val === 'number' && val != val; + } + + return isNaN; + +}); diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/src/number/nth.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/number/nth.js new file mode 100644 index 0000000..e991e2b --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/number/nth.js @@ -0,0 +1,25 @@ +define(function () { + + /** + * Returns "nth" of number (1 = "st", 2 = "nd", 3 = "rd", 4..10 = "th", ...) + */ + function nth(i) { + var t = (i % 100); + if (t >= 10 && t <= 20) { + return 'th'; + } + switch(i % 10) { + case 1: + return 'st'; + case 2: + return 'nd'; + case 3: + return 'rd'; + default: + return 'th'; + } + } + + return nth; + +}); diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/src/number/ordinal.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/number/ordinal.js new file mode 100644 index 0000000..17927fc --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/number/ordinal.js @@ -0,0 +1,13 @@ +define(['./toInt', './nth'], function (toInt, nth) { + + /** + * converts number into ordinal form (1st, 2nd, 3rd, 4th, ...) + */ + function ordinal(n){ + n = toInt(n); + return n + nth(n); + } + + return ordinal; + +}); diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/src/number/pad.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/number/pad.js new file mode 100644 index 0000000..194a3df --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/number/pad.js @@ -0,0 +1,13 @@ +define(['../string/lpad', '../lang/toNumber'], function(lpad, toNumber){ + + /** + * Add padding zeros if n.length < minLength. + */ + function pad(n, minLength, char){ + n = toNumber(n); + return lpad(''+ n, minLength, char || '0'); + } + + return pad; + +}); diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/src/number/rol.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/number/rol.js new file mode 100644 index 0000000..a148f44 --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/number/rol.js @@ -0,0 +1,10 @@ +define(function(){ + /** + * Bitwise circular shift left + * http://en.wikipedia.org/wiki/Circular_shift + */ + function rol(val, shift){ + return (val << shift) | (val >> (32 - shift)); + } + return rol; +}); diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/src/number/ror.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/number/ror.js new file mode 100644 index 0000000..b5c66f9 --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/number/ror.js @@ -0,0 +1,10 @@ +define(function(){ + /** + * Bitwise circular shift right + * http://en.wikipedia.org/wiki/Circular_shift + */ + function ror(val, shift){ + return (val >> shift) | (val << (32 - shift)); + } + return ror; +}); diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/src/number/sign.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/number/sign.js new file mode 100644 index 0000000..b387c95 --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/number/sign.js @@ -0,0 +1,15 @@ +define(['../lang/toNumber'], function (toNumber) { + + /** + * Get sign of the value. + */ + function sign(val) { + var num = toNumber(val); + if (num === 0) return num; // +0 and +0 === 0 + if (isNaN(num)) return num; // NaN + return num < 0? -1 : 1; + } + + return sign; + +}); diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/src/number/toInt.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/number/toInt.js new file mode 100644 index 0000000..5ea59e5 --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/number/toInt.js @@ -0,0 +1,17 @@ +define(function(){ + + /** + * "Convert" value into an 32-bit integer. + * Works like `Math.floor` if val > 0 and `Math.ceil` if val < 0. + * IMPORTANT: val will wrap at 2^31 and -2^31. + * Perf tests: http://jsperf.com/vs-vs-parseint-bitwise-operators/7 + */ + function toInt(val){ + // we do not use lang/toNumber because of perf and also because it + // doesn't break the functionality + return ~~val; + } + + return toInt; + +}); diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/src/number/toUInt.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/number/toUInt.js new file mode 100644 index 0000000..36bbdad --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/number/toUInt.js @@ -0,0 +1,15 @@ +define(function () { + + /** + * "Convert" value into a 32-bit unsigned integer. + * IMPORTANT: Value will wrap at 2^32. + */ + function toUInt(val){ + // we do not use lang/toNumber because of perf and also because it + // doesn't break the functionality + return val >>> 0; + } + + return toUInt; + +}); diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/src/number/toUInt31.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/number/toUInt31.js new file mode 100644 index 0000000..c1c4aff --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/number/toUInt31.js @@ -0,0 +1,15 @@ +define(['./MAX_INT'], function(MAX_INT){ + + /** + * "Convert" value into an 31-bit unsigned integer (since 1 bit is used for sign). + * IMPORTANT: value wil wrap at 2^31, if negative will return 0. + */ + function toUInt31(val){ + // we do not use lang/toNumber because of perf and also because it + // doesn't break the functionality + return (val <= 0)? 0 : (val > MAX_INT? ~~(val % (MAX_INT + 1)) : ~~val); + } + + return toUInt31; + +}); diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/src/object.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/object.js new file mode 100644 index 0000000..343e782 --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/object.js @@ -0,0 +1,42 @@ +define(function(require){ + +//automatically generated, do not edit! +//run `node build` instead +return { + 'bindAll' : require('./object/bindAll'), + 'contains' : require('./object/contains'), + 'deepEquals' : require('./object/deepEquals'), + 'deepFillIn' : require('./object/deepFillIn'), + 'deepMatches' : require('./object/deepMatches'), + 'deepMixIn' : require('./object/deepMixIn'), + 'equals' : require('./object/equals'), + 'every' : require('./object/every'), + 'fillIn' : require('./object/fillIn'), + 'filter' : require('./object/filter'), + 'find' : require('./object/find'), + 'forIn' : require('./object/forIn'), + 'forOwn' : require('./object/forOwn'), + 'functions' : require('./object/functions'), + 'get' : require('./object/get'), + 'has' : require('./object/has'), + 'hasOwn' : require('./object/hasOwn'), + 'keys' : require('./object/keys'), + 'map' : require('./object/map'), + 'matches' : require('./object/matches'), + 'max' : require('./object/max'), + 'merge' : require('./object/merge'), + 'min' : require('./object/min'), + 'mixIn' : require('./object/mixIn'), + 'namespace' : require('./object/namespace'), + 'pick' : require('./object/pick'), + 'pluck' : require('./object/pluck'), + 'reduce' : require('./object/reduce'), + 'reject' : require('./object/reject'), + 'set' : require('./object/set'), + 'size' : require('./object/size'), + 'some' : require('./object/some'), + 'unset' : require('./object/unset'), + 'values' : require('./object/values') +}; + +}); diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/src/object/bindAll.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/object/bindAll.js new file mode 100644 index 0000000..76576d6 --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/object/bindAll.js @@ -0,0 +1,16 @@ +define(['./functions', '../function/bind', '../array/forEach', '../array/slice'], function (functions, bind, forEach, slice) { + + /** + * Binds methods of the object to be run in it's own context. + */ + function bindAll(obj, rest_methodNames){ + var keys = arguments.length > 1? + slice(arguments, 1) : functions(obj); + forEach(keys, function(key){ + obj[key] = bind(obj[key], obj); + }); + } + + return bindAll; + +}); diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/src/object/contains.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/object/contains.js new file mode 100644 index 0000000..297e898 --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/object/contains.js @@ -0,0 +1,13 @@ +define(['./some'], function (some) { + + /** + * Check if object contains value + */ + function contains(obj, needle) { + return some(obj, function(val) { + return (val === needle); + }); + } + return contains; + +}); diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/src/object/deepEquals.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/object/deepEquals.js new file mode 100644 index 0000000..8b7d5d1 --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/object/deepEquals.js @@ -0,0 +1,26 @@ +define(['../lang/isObject', './equals'], function (isObject, equals) { + + function defaultCompare(a, b) { + return a === b; + } + + /** + * Recursively checks for same properties and values. + */ + function deepEquals(a, b, callback){ + callback = callback || defaultCompare; + + if (!isObject(a) || !isObject(b)) { + return callback(a, b); + } + + function compare(a, b){ + return deepEquals(a, b, callback); + } + + return equals(a, b, compare); + } + + return deepEquals; + +}); diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/src/object/deepFillIn.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/object/deepFillIn.js new file mode 100644 index 0000000..ee69c3d --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/object/deepFillIn.js @@ -0,0 +1,32 @@ +define(['./forOwn', '../lang/isPlainObject'], function (forOwn, isPlainObject) { + + /** + * Deeply copy missing properties in the target from the defaults. + */ + function deepFillIn(target, defaults){ + var i = 0, + n = arguments.length, + obj; + + while(++i < n) { + obj = arguments[i]; + if (obj) { + // jshint loopfunc: true + forOwn(obj, function(newValue, key) { + var curValue = target[key]; + if (curValue == null) { + target[key] = newValue; + } else if (isPlainObject(curValue) && + isPlainObject(newValue)) { + deepFillIn(curValue, newValue); + } + }); + } + } + + return target; + } + + return deepFillIn; + +}); diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/src/object/deepMatches.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/object/deepMatches.js new file mode 100644 index 0000000..2eae629 --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/object/deepMatches.js @@ -0,0 +1,54 @@ +define(['./forOwn', '../lang/isArray'], function(forOwn, isArray) { + + function containsMatch(array, pattern) { + var i = -1, length = array.length; + while (++i < length) { + if (deepMatches(array[i], pattern)) { + return true; + } + } + + return false; + } + + function matchArray(target, pattern) { + var i = -1, patternLength = pattern.length; + while (++i < patternLength) { + if (!containsMatch(target, pattern[i])) { + return false; + } + } + + return true; + } + + function matchObject(target, pattern) { + var result = true; + forOwn(pattern, function(val, key) { + if (!deepMatches(target[key], val)) { + // Return false to break out of forOwn early + return (result = false); + } + }); + + return result; + } + + /** + * Recursively check if the objects match. + */ + function deepMatches(target, pattern){ + if (target && typeof target === 'object') { + if (isArray(target) && isArray(pattern)) { + return matchArray(target, pattern); + } else { + return matchObject(target, pattern); + } + } else { + return target === pattern; + } + } + + return deepMatches; + +}); diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/src/object/deepMixIn.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/object/deepMixIn.js new file mode 100644 index 0000000..1b4178e --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/object/deepMixIn.js @@ -0,0 +1,33 @@ +define(['./forOwn', '../lang/isPlainObject'], function (forOwn, isPlainObject) { + + /** + * Mixes objects into the target object, recursively mixing existing child + * objects. + */ + function deepMixIn(target, objects) { + var i = 0, + n = arguments.length, + obj; + + while(++i < n){ + obj = arguments[i]; + if (obj) { + forOwn(obj, copyProp, target); + } + } + + return target; + } + + function copyProp(val, key) { + var existing = this[key]; + if (isPlainObject(val) && isPlainObject(existing)) { + deepMixIn(existing, val); + } else { + this[key] = val; + } + } + + return deepMixIn; + +}); diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/src/object/equals.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/object/equals.js new file mode 100644 index 0000000..596cb95 --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/object/equals.js @@ -0,0 +1,34 @@ +define(['./hasOwn', './every', '../lang/isObject'], function(hasOwn, every, isObject) { + + function defaultCompare(a, b) { + return a === b; + } + + // Makes a function to compare the object values from the specified compare + // operation callback. + function makeCompare(callback) { + return function(value, key) { + return hasOwn(this, key) && callback(value, this[key]); + }; + } + + function checkProperties(value, key) { + return hasOwn(this, key); + } + + /** + * Checks if two objects have the same keys and values. + */ + function equals(a, b, callback) { + callback = callback || defaultCompare; + + if (!isObject(a) || !isObject(b)) { + return callback(a, b); + } + + return (every(a, makeCompare(callback), b) && + every(b, checkProperties, a)); + } + + return equals; +}); diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/src/object/every.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/object/every.js new file mode 100644 index 0000000..52983a5 --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/object/every.js @@ -0,0 +1,22 @@ +define(['./forOwn', '../function/makeIterator_'], function(forOwn, makeIterator) { + + /** + * Object every + */ + function every(obj, callback, thisObj) { + callback = makeIterator(callback, thisObj); + var result = true; + forOwn(obj, function(val, key) { + // we consider any falsy values as "false" on purpose so shorthand + // syntax can be used to check property existence + if (!callback(val, key, obj)) { + result = false; + return false; // break + } + }); + return result; + } + + return every; + +}); diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/src/object/fillIn.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/object/fillIn.js new file mode 100644 index 0000000..363beab --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/object/fillIn.js @@ -0,0 +1,19 @@ +define(['../array/forEach', '../array/slice', './forOwn'], function (forEach, slice, forOwn) { + + /** + * Copy missing properties in the obj from the defaults. + */ + function fillIn(obj, var_defaults){ + forEach(slice(arguments, 1), function(base){ + forOwn(base, function(val, key){ + if (obj[key] == null) { + obj[key] = val; + } + }); + }); + return obj; + } + + return fillIn; + +}); diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/src/object/filter.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/object/filter.js new file mode 100644 index 0000000..f213b91 --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/object/filter.js @@ -0,0 +1,19 @@ +define(['./forOwn', '../function/makeIterator_'], function(forOwn, makeIterator) { + + /** + * Creates a new object with all the properties where the callback returns + * true. + */ + function filterValues(obj, callback, thisObj) { + callback = makeIterator(callback, thisObj); + var output = {}; + forOwn(obj, function(value, key, obj) { + if (callback(value, key, obj)) { + output[key] = value; + } + }); + + return output; + } + return filterValues; +}); diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/src/object/find.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/object/find.js new file mode 100644 index 0000000..47e6b09 --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/object/find.js @@ -0,0 +1,20 @@ +define(['./some', '../function/makeIterator_'], function(some, makeIterator) { + + /** + * Returns first item that matches criteria + */ + function find(obj, callback, thisObj) { + callback = makeIterator(callback, thisObj); + var result; + some(obj, function(value, key, obj) { + if (callback(value, key, obj)) { + result = value; + return true; //break + } + }); + return result; + } + + return find; + +}); diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/src/object/forIn.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/object/forIn.js new file mode 100644 index 0000000..90f2706 --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/object/forIn.js @@ -0,0 +1,76 @@ +define(['./hasOwn'], function (hasOwn) { + + var _hasDontEnumBug, + _dontEnums; + + function checkDontEnum(){ + _dontEnums = [ + 'toString', + 'toLocaleString', + 'valueOf', + 'hasOwnProperty', + 'isPrototypeOf', + 'propertyIsEnumerable', + 'constructor' + ]; + + _hasDontEnumBug = true; + + for (var key in {'toString': null}) { + _hasDontEnumBug = false; + } + } + + /** + * Similar to Array/forEach but works over object properties and fixes Don't + * Enum bug on IE. + * based on: http://whattheheadsaid.com/2010/10/a-safer-object-keys-compatibility-implementation + */ + function forIn(obj, fn, thisObj){ + var key, i = 0; + // no need to check if argument is a real object that way we can use + // it for arrays, functions, date, etc. + + //post-pone check till needed + if (_hasDontEnumBug == null) checkDontEnum(); + + for (key in obj) { + if (exec(fn, obj, key, thisObj) === false) { + break; + } + } + + + if (_hasDontEnumBug) { + var ctor = obj.constructor, + isProto = !!ctor && obj === ctor.prototype; + + while (key = _dontEnums[i++]) { + // For constructor, if it is a prototype object the constructor + // is always non-enumerable unless defined otherwise (and + // enumerated above). For non-prototype objects, it will have + // to be defined on this object, since it cannot be defined on + // any prototype objects. + // + // For other [[DontEnum]] properties, check if the value is + // different than Object prototype value. + if ( + (key !== 'constructor' || + (!isProto && hasOwn(obj, key))) && + obj[key] !== Object.prototype[key] + ) { + if (exec(fn, obj, key, thisObj) === false) { + break; + } + } + } + } + } + + function exec(fn, obj, key, thisObj){ + return fn.call(thisObj, obj[key], key, obj); + } + + return forIn; + +}); diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/src/object/forOwn.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/object/forOwn.js new file mode 100644 index 0000000..b40cbaf --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/object/forOwn.js @@ -0,0 +1,18 @@ +define(['./hasOwn', './forIn'], function (hasOwn, forIn) { + + /** + * Similar to Array/forEach but works over object properties and fixes Don't + * Enum bug on IE. + * based on: http://whattheheadsaid.com/2010/10/a-safer-object-keys-compatibility-implementation + */ + function forOwn(obj, fn, thisObj){ + forIn(obj, function(val, key){ + if (hasOwn(obj, key)) { + return fn.call(thisObj, obj[key], key, obj); + } + }); + } + + return forOwn; + +}); diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/src/object/functions.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/object/functions.js new file mode 100644 index 0000000..60fee3d --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/object/functions.js @@ -0,0 +1,18 @@ +define(['./forIn'], function (forIn) { + + /** + * return a list of all enumerable properties that have function values + */ + function functions(obj){ + var keys = []; + forIn(obj, function(val, key){ + if (typeof val === 'function'){ + keys.push(key); + } + }); + return keys.sort(); + } + + return functions; + +}); diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/src/object/get.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/object/get.js new file mode 100644 index 0000000..b498153 --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/object/get.js @@ -0,0 +1,20 @@ +define(function () { + + /** + * get "nested" object property + */ + function get(obj, prop){ + var parts = prop.split('.'), + last = parts.pop(); + + while (prop = parts.shift()) { + obj = obj[prop]; + if (typeof obj !== 'object' || !obj) return; + } + + return obj[last]; + } + + return get; + +}); diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/src/object/has.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/object/has.js new file mode 100644 index 0000000..cc29817 --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/object/has.js @@ -0,0 +1,15 @@ +define(['./get'], function (get) { + + var UNDEF; + + /** + * Check if object has nested property. + */ + function has(obj, prop){ + return get(obj, prop) !== UNDEF; + } + + return has; + +}); + diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/src/object/hasOwn.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/object/hasOwn.js new file mode 100644 index 0000000..5c53bcf --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/object/hasOwn.js @@ -0,0 +1,12 @@ +define(function () { + + /** + * Safer Object.hasOwnProperty + */ + function hasOwn(obj, prop){ + return Object.prototype.hasOwnProperty.call(obj, prop); + } + + return hasOwn; + +}); diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/src/object/keys.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/object/keys.js new file mode 100644 index 0000000..ed7c4f9 --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/object/keys.js @@ -0,0 +1,16 @@ +define(['./forOwn'], function (forOwn) { + + /** + * Get object keys + */ + var keys = Object.keys || function (obj) { + var keys = []; + forOwn(obj, function(val, key){ + keys.push(key); + }); + return keys; + }; + + return keys; + +}); diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/src/object/map.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/object/map.js new file mode 100644 index 0000000..2958f6b --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/object/map.js @@ -0,0 +1,17 @@ +define(['./forOwn', '../function/makeIterator_'], function(forOwn, makeIterator) { + + /** + * Creates a new object where all the values are the result of calling + * `callback`. + */ + function mapValues(obj, callback, thisObj) { + callback = makeIterator(callback, thisObj); + var output = {}; + forOwn(obj, function(val, key, obj) { + output[key] = callback(val, key, obj); + }); + + return output; + } + return mapValues; +}); diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/src/object/matches.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/object/matches.js new file mode 100644 index 0000000..73ff427 --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/object/matches.js @@ -0,0 +1,20 @@ +define(['./forOwn'], function (forOwn) { + + /** + * checks if a object contains all given properties/values + */ + function matches(target, props){ + // can't use "object/every" because of circular dependency + var result = true; + forOwn(props, function(val, key){ + if (target[key] !== val) { + // break loop at first difference + return (result = false); + } + }); + return result; + } + + return matches; + +}); diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/src/object/max.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/object/max.js new file mode 100644 index 0000000..ef311dc --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/object/max.js @@ -0,0 +1,11 @@ +define(['../array/max', './values'], function(arrMax, values) { + + /** + * Returns maximum value inside object. + */ + function max(obj, compareFn) { + return arrMax(values(obj), compareFn); + } + + return max; +}); diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/src/object/merge.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/object/merge.js new file mode 100644 index 0000000..d7cfede --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/object/merge.js @@ -0,0 +1,38 @@ +define(['./hasOwn', '../lang/deepClone', '../lang/isObject'], function (hasOwn, deepClone, isObject) { + + /** + * Deep merge objects. + */ + function merge() { + var i = 1, + key, val, obj, target; + + // make sure we don't modify source element and it's properties + // objects are passed by reference + target = deepClone( arguments[0] ); + + while (obj = arguments[i++]) { + for (key in obj) { + if ( ! hasOwn(obj, key) ) { + continue; + } + + val = obj[key]; + + if ( isObject(val) && isObject(target[key]) ){ + // inception, deep merge objects + target[key] = merge(target[key], val); + } else { + // make sure arrays, regexp, date, objects are cloned + target[key] = deepClone(val); + } + + } + } + + return target; + } + + return merge; + +}); diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/src/object/min.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/object/min.js new file mode 100644 index 0000000..9fb4c1a --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/object/min.js @@ -0,0 +1,11 @@ +define(['../array/min', './values'], function(arrMin, values) { + + /** + * Returns minimum value inside object. + */ + function min(obj, iterator) { + return arrMin(values(obj), iterator); + } + + return min; +}); diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/src/object/mixIn.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/object/mixIn.js new file mode 100644 index 0000000..6210b7e --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/object/mixIn.js @@ -0,0 +1,28 @@ +define(['./forOwn'], function(forOwn){ + + /** + * Combine properties from all the objects into first one. + * - This method affects target object in place, if you want to create a new Object pass an empty object as first param. + * @param {object} target Target Object + * @param {...object} objects Objects to be combined (0...n objects). + * @return {object} Target Object. + */ + function mixIn(target, objects){ + var i = 0, + n = arguments.length, + obj; + while(++i < n){ + obj = arguments[i]; + if (obj != null) { + forOwn(obj, copyProp, target); + } + } + return target; + } + + function copyProp(val, key){ + this[key] = val; + } + + return mixIn; +}); diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/src/object/namespace.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/object/namespace.js new file mode 100644 index 0000000..7ed65db --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/object/namespace.js @@ -0,0 +1,19 @@ +define(['../array/forEach'], function (forEach) { + + /** + * Create nested object if non-existent + */ + function namespace(obj, path){ + if (!path) return obj; + forEach(path.split('.'), function(key){ + if (!obj[key]) { + obj[key] = {}; + } + obj = obj[key]; + }); + return obj; + } + + return namespace; + +}); diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/src/object/pick.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/object/pick.js new file mode 100644 index 0000000..9d5e351 --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/object/pick.js @@ -0,0 +1,18 @@ +define(['../array/slice'], function(slice){ + + /** + * Return a copy of the object, filtered to only have values for the whitelisted keys. + */ + function pick(obj, var_keys){ + var keys = typeof arguments[1] !== 'string'? arguments[1] : slice(arguments, 1), + out = {}, + i = 0, key; + while (key = keys[i++]) { + out[key] = obj[key]; + } + return out; + } + + return pick; + +}); diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/src/object/pluck.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/object/pluck.js new file mode 100644 index 0000000..d47744b --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/object/pluck.js @@ -0,0 +1,12 @@ +define(['./map', '../function/prop'], function (map, prop) { + + /** + * Extract a list of property values. + */ + function pluck(obj, propName){ + return map(obj, prop(propName)); + } + + return pluck; + +}); diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/src/object/reduce.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/object/reduce.js new file mode 100644 index 0000000..d3a5778 --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/object/reduce.js @@ -0,0 +1,28 @@ +define(['./forOwn', './size'], function(forOwn, size) { + + /** + * Object reduce + */ + function reduce(obj, callback, memo, thisObj) { + var initial = arguments.length > 2; + + if (!size(obj) && !initial) { + throw new Error('reduce of empty object with no initial value'); + } + + forOwn(obj, function(value, key, list) { + if (!initial) { + memo = value; + initial = true; + } + else { + memo = callback.call(thisObj, memo, value, key, list); + } + }); + + return memo; + } + + return reduce; + +}); diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/src/object/reject.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/object/reject.js new file mode 100644 index 0000000..8429642 --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/object/reject.js @@ -0,0 +1,15 @@ +define(['./filter', '../function/makeIterator_'], function (filter, makeIterator) { + + /** + * Object reject + */ + function reject(obj, callback, thisObj) { + callback = makeIterator(callback, thisObj); + return filter(obj, function(value, index, obj) { + return !callback(value, index, obj); + }, thisObj); + } + + return reject; + +}); diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/src/object/set.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/object/set.js new file mode 100644 index 0000000..b8fa25a --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/object/set.js @@ -0,0 +1,17 @@ +define(['./namespace'], function (namespace) { + + /** + * set "nested" object property + */ + function set(obj, prop, val){ + var parts = (/^(.+)\.(.+)$/).exec(prop); + if (parts){ + namespace(obj, parts[1])[parts[2]] = val; + } else { + obj[prop] = val; + } + } + + return set; + +}); diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/src/object/size.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/object/size.js new file mode 100644 index 0000000..c6e377c --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/object/size.js @@ -0,0 +1,16 @@ +define(['./forOwn'], function (forOwn) { + + /** + * Get object size + */ + function size(obj) { + var count = 0; + forOwn(obj, function(){ + count++; + }); + return count; + } + + return size; + +}); diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/src/object/some.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/object/some.js new file mode 100644 index 0000000..1bd6fda --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/object/some.js @@ -0,0 +1,20 @@ +define(['./forOwn', '../function/makeIterator_'], function(forOwn, makeIterator) { + + /** + * Object some + */ + function some(obj, callback, thisObj) { + callback = makeIterator(callback, thisObj); + var result = false; + forOwn(obj, function(val, key) { + if (callback(val, key, obj)) { + result = true; + return false; // break + } + }); + return result; + } + + return some; + +}); diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/src/object/unset.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/object/unset.js new file mode 100644 index 0000000..787fc19 --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/object/unset.js @@ -0,0 +1,23 @@ +define(['./has'], function (has) { + + /** + * Unset object property. + */ + function unset(obj, prop){ + if (has(obj, prop)) { + var parts = prop.split('.'), + last = parts.pop(); + while (prop = parts.shift()) { + obj = obj[prop]; + } + return (delete obj[last]); + + } else { + // if property doesn't exist treat as deleted + return true; + } + } + + return unset; + +}); diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/src/object/values.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/object/values.js new file mode 100644 index 0000000..b311fd0 --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/object/values.js @@ -0,0 +1,16 @@ +define(['./forOwn'], function (forOwn) { + + /** + * Get object values + */ + function values(obj) { + var vals = []; + forOwn(obj, function(val, key){ + vals.push(val); + }); + return vals; + } + + return values; + +}); diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/src/queryString.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/queryString.js new file mode 100644 index 0000000..4434612 --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/queryString.js @@ -0,0 +1,15 @@ +define(function(require){ + +//automatically generated, do not edit! +//run `node build` instead +return { + 'contains' : require('./queryString/contains'), + 'decode' : require('./queryString/decode'), + 'encode' : require('./queryString/encode'), + 'getParam' : require('./queryString/getParam'), + 'getQuery' : require('./queryString/getQuery'), + 'parse' : require('./queryString/parse'), + 'setParam' : require('./queryString/setParam') +}; + +}); diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/src/queryString/contains.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/queryString/contains.js new file mode 100644 index 0000000..a6d11cc --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/queryString/contains.js @@ -0,0 +1,12 @@ +define(['./getQuery'], function (getQuery) { + + /** + * Checks if query string contains parameter. + */ + function contains(url, paramName) { + var regex = new RegExp('(\\?|&)'+ paramName +'=', 'g'); //matches `?param=` or `¶m=` + return regex.test(getQuery(url)); + } + + return contains; +}); diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/src/queryString/decode.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/queryString/decode.js new file mode 100644 index 0000000..50da3f6 --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/queryString/decode.js @@ -0,0 +1,35 @@ +define(['../string/typecast', '../lang/isString', '../lang/isArray', '../object/hasOwn'], function (typecast, isString, isArray, hasOwn) { + + /** + * Decode query string into an object of keys => vals. + */ + function decode(queryStr, shouldTypecast) { + var queryArr = (queryStr || '').replace('?', '').split('&'), + count = -1, + length = queryArr.length, + obj = {}, + item, pValue, pName, toSet; + + while (++count < length) { + item = queryArr[count].split('='); + pName = item[0]; + if (!pName || !pName.length){ + continue; + } + pValue = shouldTypecast === false ? item[1] : typecast(item[1]); + toSet = isString(pValue) ? decodeURIComponent(pValue) : pValue; + if (hasOwn(obj,pName)){ + if(isArray(obj[pName])){ + obj[pName].push(toSet); + } else { + obj[pName] = [obj[pName],toSet]; + } + } else { + obj[pName] = toSet; + } + } + return obj; + } + + return decode; +}); diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/src/queryString/encode.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/queryString/encode.js new file mode 100644 index 0000000..c249287 --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/queryString/encode.js @@ -0,0 +1,25 @@ +define(['../object/forOwn','../lang/isArray','../array/forEach'], function (forOwn,isArray,forEach) { + + /** + * Encode object into a query string. + */ + function encode(obj){ + var query = [], + arrValues, reg; + forOwn(obj, function (val, key) { + if (isArray(val)) { + arrValues = key + '='; + reg = new RegExp('&'+key+'+=$'); + forEach(val, function (aValue) { + arrValues += encodeURIComponent(aValue) + '&' + key + '='; + }); + query.push(arrValues.replace(reg, '')); + } else { + query.push(key + '=' + encodeURIComponent(val)); + } + }); + return (query.length) ? '?' + query.join('&') : ''; + } + + return encode; +}); diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/src/queryString/getParam.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/queryString/getParam.js new file mode 100644 index 0000000..d981372 --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/queryString/getParam.js @@ -0,0 +1,14 @@ +define(['../string/typecast', './getQuery'], function (typecast, getQuery) { + + /** + * Get query parameter value. + */ + function getParam(url, param, shouldTypecast){ + var regexp = new RegExp('(\\?|&)'+ param + '=([^&]*)'), //matches `?param=value` or `¶m=value`, value = $2 + result = regexp.exec( getQuery(url) ), + val = (result && result[2])? result[2] : null; + return shouldTypecast === false? val : typecast(val); + } + + return getParam; +}); diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/src/queryString/getQuery.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/queryString/getQuery.js new file mode 100644 index 0000000..aa3d99f --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/queryString/getQuery.js @@ -0,0 +1,13 @@ +define(function () { + + /** + * Gets full query as string with all special chars decoded. + */ + function getQuery(url) { + url = url.replace(/#.*/, ''); //removes hash (to avoid getting hash query) + var queryString = /\?[a-zA-Z0-9\=\&\%\$\-\_\.\+\!\*\'\(\)\,]+/.exec(url); //valid chars according to: http://www.ietf.org/rfc/rfc1738.txt + return (queryString)? decodeURIComponent(queryString[0]) : ''; + } + + return getQuery; +}); diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/src/queryString/parse.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/queryString/parse.js new file mode 100644 index 0000000..ac153e3 --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/queryString/parse.js @@ -0,0 +1,12 @@ +define(['./decode', './getQuery'], function (decode, getQuery) { + + /** + * Get query string, parses and decodes it. + */ + function parse(url, shouldTypecast) { + return decode(getQuery(url), shouldTypecast); + } + + return parse; +}); + diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/src/queryString/setParam.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/queryString/setParam.js new file mode 100644 index 0000000..97081aa --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/queryString/setParam.js @@ -0,0 +1,28 @@ +define(function () { + + /** + * Set query string parameter value + */ + function setParam(url, paramName, value){ + url = url || ''; + + var re = new RegExp('(\\?|&)'+ paramName +'=[^&]*' ); + var param = paramName +'='+ encodeURIComponent( value ); + + if ( re.test(url) ) { + return url.replace(re, '$1'+ param); + } else { + if (url.indexOf('?') === -1) { + url += '?'; + } + if (url.indexOf('=') !== -1) { + url += '&'; + } + return url + param; + } + + } + + return setParam; + +}); diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/src/random.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/random.js new file mode 100644 index 0000000..4df1b06 --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/random.js @@ -0,0 +1,17 @@ +define(function(require){ + +//automatically generated, do not edit! +//run `node build` instead +return { + 'choice' : require('./random/choice'), + 'guid' : require('./random/guid'), + 'rand' : require('./random/rand'), + 'randBit' : require('./random/randBit'), + 'randBool' : require('./random/randBool'), + 'randHex' : require('./random/randHex'), + 'randInt' : require('./random/randInt'), + 'randSign' : require('./random/randSign'), + 'random' : require('./random/random') +}; + +}); diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/src/random/choice.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/random/choice.js new file mode 100644 index 0000000..0d0c38d --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/random/choice.js @@ -0,0 +1,14 @@ +define(['./randInt', '../lang/isArray'], function (randInt, isArray) { + + /** + * Returns a random element from the supplied arguments + * or from the array (if single argument is an array). + */ + function choice(items) { + var target = (arguments.length === 1 && isArray(items))? items : arguments; + return target[ randInt(0, target.length - 1) ]; + } + + return choice; + +}); diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/src/random/guid.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/random/guid.js new file mode 100644 index 0000000..82f3a2d --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/random/guid.js @@ -0,0 +1,23 @@ +define(['./randHex', './choice'], function (randHex, choice) { + + /** + * Returns pseudo-random guid (UUID v4) + * IMPORTANT: it's not totally "safe" since randHex/choice uses Math.random + * by default and sequences can be predicted in some cases. See the + * "random/random" documentation for more info about it and how to replace + * the default PRNG. + */ + function guid() { + return ( + randHex(8)+'-'+ + randHex(4)+'-'+ + // v4 UUID always contain "4" at this position to specify it was + // randomly generated + '4' + randHex(3) +'-'+ + // v4 UUID always contain chars [a,b,8,9] at this position + choice(8, 9, 'a', 'b') + randHex(3)+'-'+ + randHex(12) + ); + } + return guid; +}); diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/src/random/rand.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/random/rand.js new file mode 100644 index 0000000..b8c231d --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/random/rand.js @@ -0,0 +1,13 @@ +define(['./random', '../number/MIN_INT', '../number/MAX_INT'], function(random, MIN_INT, MAX_INT){ + + /** + * Returns random number inside range + */ + function rand(min, max){ + min = min == null? MIN_INT : min; + max = max == null? MAX_INT : max; + return min + (max - min) * random(); + } + + return rand; +}); diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/src/random/randBit.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/random/randBit.js new file mode 100644 index 0000000..398fa2c --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/random/randBit.js @@ -0,0 +1,11 @@ +define(['./randBool'], function (randBool) { + + /** + * Returns random bit (0 or 1) + */ + function randomBit() { + return randBool()? 1 : 0; + } + + return randomBit; +}); diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/src/random/randBool.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/random/randBool.js new file mode 100644 index 0000000..8d9be0b --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/random/randBool.js @@ -0,0 +1,12 @@ +define(['./random'], function (random) { + + /** + * returns a random boolean value (true or false) + */ + function randBool(){ + return random() >= 0.5; + } + + return randBool; + +}); diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/src/random/randHex.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/random/randHex.js new file mode 100644 index 0000000..6e9bf1c --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/random/randHex.js @@ -0,0 +1,19 @@ +define(['./choice'], function (choice) { + + var _chars = '0123456789abcdef'.split(''); + + /** + * Returns a random hexadecimal string + */ + function randHex(size){ + size = size && size > 0? size : 6; + var str = ''; + while (size--) { + str += choice(_chars); + } + return str; + } + + return randHex; + +}); diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/src/random/randInt.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/random/randInt.js new file mode 100644 index 0000000..1750e9d --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/random/randInt.js @@ -0,0 +1,16 @@ +define(['../number/MIN_INT', '../number/MAX_INT', './rand'], function(MIN_INT, MAX_INT, rand){ + + /** + * Gets random integer inside range or snap to min/max values. + */ + function randInt(min, max){ + min = min == null? MIN_INT : ~~min; + max = max == null? MAX_INT : ~~max; + // can't be max + 0.5 otherwise it will round up if `rand` + // returns `max` causing it to overflow range. + // -0.5 and + 0.49 are required to avoid bias caused by rounding + return Math.round( rand(min - 0.5, max + 0.499999999999) ); + } + + return randInt; +}); diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/src/random/randSign.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/random/randSign.js new file mode 100644 index 0000000..1171b40 --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/random/randSign.js @@ -0,0 +1,11 @@ +define(['./randBool'], function (randBool) { + + /** + * Returns random sign (-1 or 1) + */ + function randomSign() { + return randBool()? 1 : -1; + } + + return randomSign; +}); diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/src/random/random.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/random/random.js new file mode 100644 index 0000000..4270822 --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/random/random.js @@ -0,0 +1,18 @@ +define(function () { + + /** + * Just a wrapper to Math.random. No methods inside mout/random should call + * Math.random() directly so we can inject the pseudo-random number + * generator if needed (ie. in case we need a seeded random or a better + * algorithm than the native one) + */ + function random(){ + return random.get(); + } + + // we expose the method so it can be swapped if needed + random.get = Math.random; + + return random; + +}); diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/src/string.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/string.js new file mode 100644 index 0000000..a157e4c --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/string.js @@ -0,0 +1,46 @@ +define(function(require){ + +//automatically generated, do not edit! +//run `node build` instead +return { + 'WHITE_SPACES' : require('./string/WHITE_SPACES'), + 'camelCase' : require('./string/camelCase'), + 'contains' : require('./string/contains'), + 'crop' : require('./string/crop'), + 'endsWith' : require('./string/endsWith'), + 'escapeHtml' : require('./string/escapeHtml'), + 'escapeRegExp' : require('./string/escapeRegExp'), + 'escapeUnicode' : require('./string/escapeUnicode'), + 'hyphenate' : require('./string/hyphenate'), + 'insert' : require('./string/insert'), + 'interpolate' : require('./string/interpolate'), + 'lowerCase' : require('./string/lowerCase'), + 'lpad' : require('./string/lpad'), + 'ltrim' : require('./string/ltrim'), + 'makePath' : require('./string/makePath'), + 'normalizeLineBreaks' : require('./string/normalizeLineBreaks'), + 'pascalCase' : require('./string/pascalCase'), + 'properCase' : require('./string/properCase'), + 'removeNonASCII' : require('./string/removeNonASCII'), + 'removeNonWord' : require('./string/removeNonWord'), + 'repeat' : require('./string/repeat'), + 'replace' : require('./string/replace'), + 'replaceAccents' : require('./string/replaceAccents'), + 'rpad' : require('./string/rpad'), + 'rtrim' : require('./string/rtrim'), + 'sentenceCase' : require('./string/sentenceCase'), + 'slugify' : require('./string/slugify'), + 'startsWith' : require('./string/startsWith'), + 'stripHtmlTags' : require('./string/stripHtmlTags'), + 'trim' : require('./string/trim'), + 'truncate' : require('./string/truncate'), + 'typecast' : require('./string/typecast'), + 'unCamelCase' : require('./string/unCamelCase'), + 'underscore' : require('./string/underscore'), + 'unescapeHtml' : require('./string/unescapeHtml'), + 'unescapeUnicode' : require('./string/unescapeUnicode'), + 'unhyphenate' : require('./string/unhyphenate'), + 'upperCase' : require('./string/upperCase') +}; + +}); diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/src/string/WHITE_SPACES.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/string/WHITE_SPACES.js new file mode 100644 index 0000000..e830d86 --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/string/WHITE_SPACES.js @@ -0,0 +1,12 @@ +define(function() { + /** + * Contains all Unicode white-spaces. Taken from + * http://en.wikipedia.org/wiki/Whitespace_character. + */ + return [ + ' ', '\n', '\r', '\t', '\f', '\v', '\u00A0', '\u1680', '\u180E', + '\u2000', '\u2001', '\u2002', '\u2003', '\u2004', '\u2005', '\u2006', + '\u2007', '\u2008', '\u2009', '\u200A', '\u2028', '\u2029', '\u202F', + '\u205F', '\u3000' + ]; +}); diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/src/string/camelCase.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/string/camelCase.js new file mode 100644 index 0000000..02e6c04 --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/string/camelCase.js @@ -0,0 +1,16 @@ +define(['../lang/toString', './replaceAccents', './removeNonWord', './upperCase', './lowerCase'], function(toString, replaceAccents, removeNonWord, upperCase, lowerCase){ + /** + * Convert string to camelCase text. + */ + function camelCase(str){ + str = toString(str); + str = replaceAccents(str); + str = removeNonWord(str) + .replace(/[\-_]/g, ' ') //convert all hyphens and underscores to spaces + .replace(/\s[a-z]/g, upperCase) //convert first char of each word to UPPERCASE + .replace(/\s+/g, '') //remove spaces + .replace(/^[A-Z]/g, lowerCase); //convert first char to lowercase + return str; + } + return camelCase; +}); diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/src/string/contains.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/string/contains.js new file mode 100644 index 0000000..825b5a5 --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/string/contains.js @@ -0,0 +1,14 @@ +define(['../lang/toString'], function(toString) { + + /** + * Searches for a given substring + */ + function contains(str, substring, fromIndex){ + str = toString(str); + substring = toString(substring); + return str.indexOf(substring, fromIndex) !== -1; + } + + return contains; + +}); diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/src/string/crop.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/string/crop.js new file mode 100644 index 0000000..3c073f0 --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/string/crop.js @@ -0,0 +1,11 @@ +define(['../lang/toString', './truncate'], function (toString, truncate) { + /** + * Truncate string at full words. + */ + function crop(str, maxChars, append) { + str = toString(str); + return truncate(str, maxChars, append, true); + } + + return crop; +}); diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/src/string/endsWith.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/string/endsWith.js new file mode 100644 index 0000000..31a73f2 --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/string/endsWith.js @@ -0,0 +1,13 @@ +define(['../lang/toString'], function(toString) { + /** + * Checks if string ends with specified suffix. + */ + function endsWith(str, suffix) { + str = toString(str); + suffix = toString(suffix); + + return str.indexOf(suffix, str.length - suffix.length) !== -1; + } + + return endsWith; +}); diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/src/string/escapeHtml.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/string/escapeHtml.js new file mode 100644 index 0000000..de34b61 --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/string/escapeHtml.js @@ -0,0 +1,18 @@ +define(['../lang/toString'], function(toString) { + + /** + * Escapes a string for insertion into HTML. + */ + function escapeHtml(str){ + str = toString(str) + .replace(/&/g, '&') + .replace(//g, '>') + .replace(/'/g, ''') + .replace(/"/g, '"'); + return str; + } + + return escapeHtml; + +}); diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/src/string/escapeRegExp.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/string/escapeRegExp.js new file mode 100644 index 0000000..862655b --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/string/escapeRegExp.js @@ -0,0 +1,12 @@ +define(['../lang/toString'], function(toString) { + + /** + * Escape RegExp string chars. + */ + function escapeRegExp(str) { + return toString(str).replace(/\W/g,'\\$&'); + } + + return escapeRegExp; + +}); diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/src/string/escapeUnicode.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/string/escapeUnicode.js new file mode 100644 index 0000000..bd5e8c4 --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/string/escapeUnicode.js @@ -0,0 +1,21 @@ +define(['../lang/toString'], function(toString) { + + /** + * Escape string into unicode sequences + */ + function escapeUnicode(str, shouldEscapePrintable){ + str = toString(str); + return str.replace(/[\s\S]/g, function(ch){ + // skip printable ASCII chars if we should not escape them + if (!shouldEscapePrintable && (/[\x20-\x7E]/).test(ch)) { + return ch; + } + // we use "000" and slice(-4) for brevity, need to pad zeros, + // unicode escape always have 4 chars after "\u" + return '\\u'+ ('000'+ ch.charCodeAt(0).toString(16)).slice(-4); + }); + } + + return escapeUnicode; + +}); diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/src/string/hyphenate.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/string/hyphenate.js new file mode 100644 index 0000000..679c405 --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/string/hyphenate.js @@ -0,0 +1,12 @@ +define(['../lang/toString', './slugify', './unCamelCase'], function(toString, slugify, unCamelCase){ + /** + * Replaces spaces with hyphens, split camelCase text, remove non-word chars, remove accents and convert to lower case. + */ + function hyphenate(str){ + str = toString(str); + str = unCamelCase(str); + return slugify(str, "-"); + } + + return hyphenate; +}); diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/src/string/insert.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/string/insert.js new file mode 100644 index 0000000..79c45be --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/string/insert.js @@ -0,0 +1,20 @@ +define(['../math/clamp', '../lang/toString'], function (clamp, toString) { + + /** + * Inserts a string at a given index. + */ + function insert(string, index, partial){ + string = toString(string); + + if (index < 0) { + index = string.length + index; + } + + index = clamp(index, 0, string.length); + + return string.substr(0, index) + partial + string.substr(index); + } + + return insert; + +}); diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/src/string/interpolate.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/string/interpolate.js new file mode 100644 index 0000000..b5e7f4b --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/string/interpolate.js @@ -0,0 +1,21 @@ +define([ + '../lang/toString', + '../object/get' +], function(toString, get) { + + var stache = /\{\{([^\}]+)\}\}/g; //mustache-like + + /** + * String interpolation + */ + function interpolate(template, replacements, syntax){ + template = toString(template); + var replaceFn = function(match, prop){ + return toString( get(replacements, prop) ); + }; + return template.replace(syntax || stache, replaceFn); + } + + return interpolate; + +}); diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/src/string/lowerCase.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/string/lowerCase.js new file mode 100644 index 0000000..b045d69 --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/string/lowerCase.js @@ -0,0 +1,11 @@ +define(['../lang/toString'], function(toString){ + /** + * "Safer" String.toLowerCase() + */ + function lowerCase(str){ + str = toString(str); + return str.toLowerCase(); + } + + return lowerCase; +}); diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/src/string/lpad.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/string/lpad.js new file mode 100644 index 0000000..134b415 --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/string/lpad.js @@ -0,0 +1,16 @@ +define(['../lang/toString', './repeat'], function(toString, repeat) { + + /** + * Pad string with `char` if its' length is smaller than `minLen` + */ + function lpad(str, minLen, ch) { + str = toString(str); + ch = ch || ' '; + + return (str.length < minLen) ? + repeat(ch, minLen - str.length) + str : str; + } + + return lpad; + +}); diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/src/string/ltrim.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/string/ltrim.js new file mode 100644 index 0000000..477df95 --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/string/ltrim.js @@ -0,0 +1,33 @@ +define(['../lang/toString', './WHITE_SPACES'], function(toString, WHITE_SPACES){ + /** + * Remove chars from beginning of string. + */ + function ltrim(str, chars) { + str = toString(str); + chars = chars || WHITE_SPACES; + + var start = 0, + len = str.length, + charLen = chars.length, + found = true, + i, c; + + while (found && start < len) { + found = false; + i = -1; + c = str.charAt(start); + + while (++i < charLen) { + if (c === chars[i]) { + found = true; + start++; + break; + } + } + } + + return (start >= len) ? '' : str.substr(start, len); + } + + return ltrim; +}); diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/src/string/makePath.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/string/makePath.js new file mode 100644 index 0000000..3a6869e --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/string/makePath.js @@ -0,0 +1,14 @@ +define(['../array/join', '../array/slice'], function(join, slice){ + + /** + * Group arguments as path segments, if any of the args is `null` or an + * empty string it will be ignored from resulting path. + */ + function makePath(var_args){ + var result = join(slice(arguments), '/'); + // need to disconsider duplicate '/' after protocol (eg: 'http://') + return result.replace(/([^:\/]|^)\/{2,}/g, '$1/'); + } + + return makePath; +}); diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/src/string/normalizeLineBreaks.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/string/normalizeLineBreaks.js new file mode 100644 index 0000000..44e4194 --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/string/normalizeLineBreaks.js @@ -0,0 +1,18 @@ +define(['../lang/toString'], function (toString) { + + /** + * Convert line-breaks from DOS/MAC to a single standard (UNIX by default) + */ + function normalizeLineBreaks(str, lineEnd) { + str = toString(str); + lineEnd = lineEnd || '\n'; + + return str + .replace(/\r\n/g, lineEnd) // DOS + .replace(/\r/g, lineEnd) // Mac + .replace(/\n/g, lineEnd); // Unix + } + + return normalizeLineBreaks; + +}); diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/src/string/pascalCase.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/string/pascalCase.js new file mode 100644 index 0000000..ead9ead --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/string/pascalCase.js @@ -0,0 +1,11 @@ +define(['../lang/toString', './camelCase', './upperCase'], function(toString, camelCase, upperCase){ + /** + * camelCase + UPPERCASE first char + */ + function pascalCase(str){ + str = toString(str); + return camelCase(str).replace(/^[a-z]/, upperCase); + } + + return pascalCase; +}); diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/src/string/properCase.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/string/properCase.js new file mode 100644 index 0000000..2987b50 --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/string/properCase.js @@ -0,0 +1,11 @@ +define(['../lang/toString', './lowerCase', './upperCase'], function(toString, lowerCase, upperCase){ + /** + * UPPERCASE first char of each word. + */ + function properCase(str){ + str = toString(str); + return lowerCase(str).replace(/^\w|\s\w/g, upperCase); + } + + return properCase; +}); diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/src/string/removeNonASCII.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/string/removeNonASCII.js new file mode 100644 index 0000000..4905869 --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/string/removeNonASCII.js @@ -0,0 +1,14 @@ +define(['../lang/toString'], function(toString){ + /** + * Remove non-printable ASCII chars + */ + function removeNonASCII(str){ + str = toString(str); + + // Matches non-printable ASCII chars - + // http://en.wikipedia.org/wiki/ASCII#ASCII_printable_characters + return str.replace(/[^\x20-\x7E]/g, ''); + } + + return removeNonASCII; +}); diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/src/string/removeNonWord.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/string/removeNonWord.js new file mode 100644 index 0000000..fb737d7 --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/string/removeNonWord.js @@ -0,0 +1,14 @@ +define(['../lang/toString'], function(toString){ + // This pattern is generated by the _build/pattern-removeNonWord.js script + var PATTERN = /[^\x20\x2D0-9A-Z\x5Fa-z\xC0-\xD6\xD8-\xF6\xF8-\xFF]/g; + + /** + * Remove non-word chars. + */ + function removeNonWord(str){ + str = toString(str); + return str.replace(PATTERN, ''); + } + + return removeNonWord; +}); diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/src/string/repeat.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/string/repeat.js new file mode 100644 index 0000000..0a25d83 --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/string/repeat.js @@ -0,0 +1,25 @@ +define(['../lang/toString', '../number/toInt'], function(toString, toInt){ + + /** + * Repeat string n times + */ + function repeat(str, n){ + var result = ''; + str = toString(str); + n = toInt(n); + if (n < 1) { + return ''; + } + while (n > 0) { + if (n % 2) { + result += str; + } + n = Math.floor(n / 2); + str += str; + } + return result; + } + + return repeat; + +}); diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/src/string/replace.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/string/replace.js new file mode 100644 index 0000000..8b762fd --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/string/replace.js @@ -0,0 +1,32 @@ +define(['../lang/toString', '../lang/toArray'], function (toString, toArray) { + + /** + * Replace string(s) with the replacement(s) in the source. + */ + function replace(str, search, replacements) { + str = toString(str); + search = toArray(search); + replacements = toArray(replacements); + + var searchLength = search.length, + replacementsLength = replacements.length; + + if (replacementsLength !== 1 && searchLength !== replacementsLength) { + throw new Error('Unequal number of searches and replacements'); + } + + var i = -1; + while (++i < searchLength) { + // Use the first replacement for all searches if only one + // replacement is provided + str = str.replace( + search[i], + replacements[(replacementsLength === 1) ? 0 : i]); + } + + return str; + } + + return replace; + +}); diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/src/string/replaceAccents.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/string/replaceAccents.js new file mode 100644 index 0000000..3a63f55 --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/string/replaceAccents.js @@ -0,0 +1,36 @@ +define(['../lang/toString'], function(toString){ + /** + * Replaces all accented chars with regular ones + */ + function replaceAccents(str){ + str = toString(str); + + // verifies if the String has accents and replace them + if (str.search(/[\xC0-\xFF]/g) > -1) { + str = str + .replace(/[\xC0-\xC5]/g, "A") + .replace(/[\xC6]/g, "AE") + .replace(/[\xC7]/g, "C") + .replace(/[\xC8-\xCB]/g, "E") + .replace(/[\xCC-\xCF]/g, "I") + .replace(/[\xD0]/g, "D") + .replace(/[\xD1]/g, "N") + .replace(/[\xD2-\xD6\xD8]/g, "O") + .replace(/[\xD9-\xDC]/g, "U") + .replace(/[\xDD]/g, "Y") + .replace(/[\xDE]/g, "P") + .replace(/[\xE0-\xE5]/g, "a") + .replace(/[\xE6]/g, "ae") + .replace(/[\xE7]/g, "c") + .replace(/[\xE8-\xEB]/g, "e") + .replace(/[\xEC-\xEF]/g, "i") + .replace(/[\xF1]/g, "n") + .replace(/[\xF2-\xF6\xF8]/g, "o") + .replace(/[\xF9-\xFC]/g, "u") + .replace(/[\xFE]/g, "p") + .replace(/[\xFD\xFF]/g, "y"); + } + return str; + } + return replaceAccents; +}); diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/src/string/rpad.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/string/rpad.js new file mode 100644 index 0000000..2efd9c8 --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/string/rpad.js @@ -0,0 +1,14 @@ +define(['../lang/toString', './repeat'], function (toString, repeat) { + + /** + * Pad string with `char` if its' length is smaller than `minLen` + */ + function rpad(str, minLen, ch) { + str = toString(str); + ch = ch || ' '; + return (str.length < minLen)? str + repeat(ch, minLen - str.length) : str; + } + + return rpad; + +}); diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/src/string/rtrim.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/string/rtrim.js new file mode 100644 index 0000000..a4cc282 --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/string/rtrim.js @@ -0,0 +1,32 @@ +define(['../lang/toString', './WHITE_SPACES'], function(toString, WHITE_SPACES){ + /** + * Remove chars from end of string. + */ + function rtrim(str, chars) { + str = toString(str); + chars = chars || WHITE_SPACES; + + var end = str.length - 1, + charLen = chars.length, + found = true, + i, c; + + while (found && end >= 0) { + found = false; + i = -1; + c = str.charAt(end); + + while (++i < charLen) { + if (c === chars[i]) { + found = true; + end--; + break; + } + } + } + + return (end >= 0) ? str.substring(0, end + 1) : ''; + } + + return rtrim; +}); diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/src/string/sentenceCase.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/string/sentenceCase.js new file mode 100644 index 0000000..cfe45af --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/string/sentenceCase.js @@ -0,0 +1,13 @@ +define(['../lang/toString', './lowerCase', './upperCase'], function(toString, lowerCase, upperCase){ + /** + * UPPERCASE first char of each sentence and lowercase other chars. + */ + function sentenceCase(str){ + str = toString(str); + + // Replace first char of each sentence (new line or after '.\s+') to + // UPPERCASE + return lowerCase(str).replace(/(^\w)|\.\s+(\w)/gm, upperCase); + } + return sentenceCase; +}); diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/src/string/slugify.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/string/slugify.js new file mode 100644 index 0000000..c6d68c7 --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/string/slugify.js @@ -0,0 +1,21 @@ +define(['../lang/toString', './replaceAccents', './removeNonWord', './trim'], function(toString, replaceAccents, removeNonWord, trim){ + /** + * Convert to lower case, remove accents, remove non-word chars and + * replace spaces with the specified delimeter. + * Does not split camelCase text. + */ + function slugify(str, delimeter){ + str = toString(str); + + if (delimeter == null) { + delimeter = "-"; + } + str = replaceAccents(str); + str = removeNonWord(str); + str = trim(str) //should come after removeNonWord + .replace(/ +/g, delimeter) //replace spaces with delimeter + .toLowerCase(); + return str; + } + return slugify; +}); diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/src/string/startsWith.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/string/startsWith.js new file mode 100644 index 0000000..88ae545 --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/string/startsWith.js @@ -0,0 +1,13 @@ +define(['../lang/toString'], function (toString) { + /** + * Checks if string starts with specified prefix. + */ + function startsWith(str, prefix) { + str = toString(str); + prefix = toString(prefix); + + return str.indexOf(prefix) === 0; + } + + return startsWith; +}); diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/src/string/stripHtmlTags.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/string/stripHtmlTags.js new file mode 100644 index 0000000..e8da956 --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/string/stripHtmlTags.js @@ -0,0 +1,11 @@ +define(['../lang/toString'], function(toString){ + /** + * Remove HTML tags from string. + */ + function stripHtmlTags(str){ + str = toString(str); + + return str.replace(/<[^>]*>/g, ''); + } + return stripHtmlTags; +}); diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/src/string/trim.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/string/trim.js new file mode 100644 index 0000000..5552604 --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/string/trim.js @@ -0,0 +1,12 @@ +define(['../lang/toString', './WHITE_SPACES', './ltrim', './rtrim'], function(toString, WHITE_SPACES, ltrim, rtrim){ + /** + * Remove white-spaces from beginning and end of string. + */ + function trim(str, chars) { + str = toString(str); + chars = chars || WHITE_SPACES; + return ltrim(rtrim(str, chars), chars); + } + + return trim; +}); diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/src/string/truncate.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/string/truncate.js new file mode 100644 index 0000000..34000d9 --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/string/truncate.js @@ -0,0 +1,20 @@ +define(['../lang/toString', './trim'], function(toString, trim){ + /** + * Limit number of chars. + */ + function truncate(str, maxChars, append, onlyFullWords){ + str = toString(str); + append = append || '...'; + maxChars = onlyFullWords? maxChars + 1 : maxChars; + + str = trim(str); + if(str.length <= maxChars){ + return str; + } + str = str.substr(0, maxChars - append.length); + //crop at last space or remove trailing whitespace + str = onlyFullWords? str.substr(0, str.lastIndexOf(' ')) : trim(str); + return str + append; + } + return truncate; +}); diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/src/string/typecast.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/string/typecast.js new file mode 100644 index 0000000..a7c8315 --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/string/typecast.js @@ -0,0 +1,29 @@ +define(function () { + + var UNDEF; + + /** + * Parses string and convert it into a native value. + */ + function typecast(val) { + var r; + if ( val === null || val === 'null' ) { + r = null; + } else if ( val === 'true' ) { + r = true; + } else if ( val === 'false' ) { + r = false; + } else if ( val === UNDEF || val === 'undefined' ) { + r = UNDEF; + } else if ( val === '' || isNaN(val) ) { + //isNaN('') returns false + r = val; + } else { + //parseFloat(null || '') returns NaN + r = parseFloat(val); + } + return r; + } + + return typecast; +}); diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/src/string/unCamelCase.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/string/unCamelCase.js new file mode 100644 index 0000000..eeef39b --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/string/unCamelCase.js @@ -0,0 +1,23 @@ +define(['../lang/toString'], function(toString){ + + var CAMEL_CASE_BORDER = /([a-z\xE0-\xFF])([A-Z\xC0\xDF])/g; + + /** + * Add space between camelCase text. + */ + function unCamelCase(str, delimiter){ + if (delimiter == null) { + delimiter = ' '; + } + + function join(str, c1, c2) { + return c1 + delimiter + c2; + } + + str = toString(str); + str = str.replace(CAMEL_CASE_BORDER, join); + str = str.toLowerCase(); //add space between camelCase text + return str; + } + return unCamelCase; +}); diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/src/string/underscore.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/string/underscore.js new file mode 100644 index 0000000..75dd464 --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/string/underscore.js @@ -0,0 +1,11 @@ +define(['../lang/toString', './slugify', './unCamelCase'], function(toString, slugify, unCamelCase){ + /** + * Replaces spaces with underscores, split camelCase text, remove non-word chars, remove accents and convert to lower case. + */ + function underscore(str){ + str = toString(str); + str = unCamelCase(str); + return slugify(str, "_"); + } + return underscore; +}); diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/src/string/unescapeHtml.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/string/unescapeHtml.js new file mode 100644 index 0000000..ca89042 --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/string/unescapeHtml.js @@ -0,0 +1,18 @@ +define(['../lang/toString'], function (toString) { + + /** + * Unescapes HTML special chars + */ + function unescapeHtml(str){ + str = toString(str) + .replace(/&/g , '&') + .replace(/</g , '<') + .replace(/>/g , '>') + .replace(/�*39;/g , "'") + .replace(/"/g, '"'); + return str; + } + + return unescapeHtml; + +}); diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/src/string/unescapeUnicode.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/string/unescapeUnicode.js new file mode 100644 index 0000000..d4a7ba1 --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/string/unescapeUnicode.js @@ -0,0 +1,16 @@ +define(['../lang/toString'], function(toString) { + + /** + * Unescape unicode char sequences + */ + function unescapeUnicode(str){ + str = toString(str); + return str.replace(/\\u[0-9a-f]{4}/g, function(ch){ + var code = parseInt(ch.slice(2), 16); + return String.fromCharCode(code); + }); + } + + return unescapeUnicode; + +}); diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/src/string/unhyphenate.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/string/unhyphenate.js new file mode 100644 index 0000000..6ac2fa4 --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/string/unhyphenate.js @@ -0,0 +1,10 @@ +define(['../lang/toString'], function(toString){ + /** + * Replaces hyphens with spaces. (only hyphens between word chars) + */ + function unhyphenate(str){ + str = toString(str); + return str.replace(/(\w)(-)(\w)/g, '$1 $3'); + } + return unhyphenate; +}); diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/src/string/upperCase.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/string/upperCase.js new file mode 100644 index 0000000..8b2073e --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/string/upperCase.js @@ -0,0 +1,10 @@ +define(['../lang/toString'], function(toString){ + /** + * "Safer" String.toUpperCase() + */ + function upperCase(str){ + str = toString(str); + return str.toUpperCase(); + } + return upperCase; +}); diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/src/time.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/time.js new file mode 100644 index 0000000..67c9068 --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/time.js @@ -0,0 +1,12 @@ +define(function(require){ + +//automatically generated, do not edit! +//run `node build` instead +return { + 'convert' : require('./time/convert'), + 'now' : require('./time/now'), + 'parseMs' : require('./time/parseMs'), + 'toTimeString' : require('./time/toTimeString') +}; + +}); diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/src/time/convert.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/time/convert.js new file mode 100644 index 0000000..2de0cf2 --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/time/convert.js @@ -0,0 +1,41 @@ +define(function () { + + /** + * convert time into another unit + */ + function convert(val, sourceUnitName, destinationUnitName){ + destinationUnitName = destinationUnitName || 'ms'; + return (val * getUnit(sourceUnitName)) / getUnit(destinationUnitName); + } + + + //TODO: maybe extract to a separate module + function getUnit(unitName){ + switch(unitName){ + case 'ms': + case 'millisecond': + return 1; + case 's': + case 'second': + return 1000; + case 'm': + case 'minute': + return 60000; + case 'h': + case 'hour': + return 3600000; + case 'd': + case 'day': + return 86400000; + case 'w': + case 'week': + return 604800000; + default: + throw new Error('"'+ unitName + '" is not a valid unit'); + } + } + + + return convert; + +}); diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/src/time/now.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/time/now.js new file mode 100644 index 0000000..4b2d03c --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/time/now.js @@ -0,0 +1,18 @@ +define(function () { + + /** + * Get current time in miliseconds + */ + function now(){ + // yes, we defer the work to another function to allow mocking it + // during the tests + return now.get(); + } + + now.get = (typeof Date.now === 'function')? Date.now : function(){ + return +(new Date()); + }; + + return now; + +}); diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/src/time/parseMs.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/time/parseMs.js new file mode 100644 index 0000000..964929a --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/time/parseMs.js @@ -0,0 +1,17 @@ +define(['../math/countSteps'], function(countSteps){ + + /** + * Parse timestamp into an object. + */ + function parseMs(ms){ + return { + milliseconds : countSteps(ms, 1, 1000), + seconds : countSteps(ms, 1000, 60), + minutes : countSteps(ms, 60000, 60), + hours : countSteps(ms, 3600000, 24), + days : countSteps(ms, 86400000) + }; + } + + return parseMs; +}); diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/src/time/toTimeString.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/time/toTimeString.js new file mode 100644 index 0000000..edf1821 --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/src/time/toTimeString.js @@ -0,0 +1,23 @@ +define(['../math/countSteps', '../number/pad'], function(countSteps, pad){ + + var HOUR = 3600000, + MINUTE = 60000, + SECOND = 1000; + + /** + * Format timestamp into a time string. + */ + function toTimeString(ms){ + var h = ms < HOUR ? 0 : countSteps(ms, HOUR), + m = ms < MINUTE ? 0 : countSteps(ms, MINUTE, 60), + s = ms < SECOND ? 0 : countSteps(ms, SECOND, 60), + str = ''; + + str += h? h + ':' : ''; + str += pad(m, 2) + ':'; + str += pad(s, 2); + + return str; + } + return toTimeString; +}); diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/string.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/string.js new file mode 100644 index 0000000..6115811 --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/string.js @@ -0,0 +1,46 @@ + + +//automatically generated, do not edit! +//run `node build` instead +module.exports = { + 'WHITE_SPACES' : require('./string/WHITE_SPACES'), + 'camelCase' : require('./string/camelCase'), + 'contains' : require('./string/contains'), + 'crop' : require('./string/crop'), + 'endsWith' : require('./string/endsWith'), + 'escapeHtml' : require('./string/escapeHtml'), + 'escapeRegExp' : require('./string/escapeRegExp'), + 'escapeUnicode' : require('./string/escapeUnicode'), + 'hyphenate' : require('./string/hyphenate'), + 'insert' : require('./string/insert'), + 'interpolate' : require('./string/interpolate'), + 'lowerCase' : require('./string/lowerCase'), + 'lpad' : require('./string/lpad'), + 'ltrim' : require('./string/ltrim'), + 'makePath' : require('./string/makePath'), + 'normalizeLineBreaks' : require('./string/normalizeLineBreaks'), + 'pascalCase' : require('./string/pascalCase'), + 'properCase' : require('./string/properCase'), + 'removeNonASCII' : require('./string/removeNonASCII'), + 'removeNonWord' : require('./string/removeNonWord'), + 'repeat' : require('./string/repeat'), + 'replace' : require('./string/replace'), + 'replaceAccents' : require('./string/replaceAccents'), + 'rpad' : require('./string/rpad'), + 'rtrim' : require('./string/rtrim'), + 'sentenceCase' : require('./string/sentenceCase'), + 'slugify' : require('./string/slugify'), + 'startsWith' : require('./string/startsWith'), + 'stripHtmlTags' : require('./string/stripHtmlTags'), + 'trim' : require('./string/trim'), + 'truncate' : require('./string/truncate'), + 'typecast' : require('./string/typecast'), + 'unCamelCase' : require('./string/unCamelCase'), + 'underscore' : require('./string/underscore'), + 'unescapeHtml' : require('./string/unescapeHtml'), + 'unescapeUnicode' : require('./string/unescapeUnicode'), + 'unhyphenate' : require('./string/unhyphenate'), + 'upperCase' : require('./string/upperCase') +}; + + diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/string/WHITE_SPACES.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/string/WHITE_SPACES.js new file mode 100644 index 0000000..03e0125 --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/string/WHITE_SPACES.js @@ -0,0 +1,12 @@ + + /** + * Contains all Unicode white-spaces. Taken from + * http://en.wikipedia.org/wiki/Whitespace_character. + */ + module.exports = [ + ' ', '\n', '\r', '\t', '\f', '\v', '\u00A0', '\u1680', '\u180E', + '\u2000', '\u2001', '\u2002', '\u2003', '\u2004', '\u2005', '\u2006', + '\u2007', '\u2008', '\u2009', '\u200A', '\u2028', '\u2029', '\u202F', + '\u205F', '\u3000' + ]; + diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/string/camelCase.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/string/camelCase.js new file mode 100644 index 0000000..aadb69a --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/string/camelCase.js @@ -0,0 +1,20 @@ +var toString = require('../lang/toString'); +var replaceAccents = require('./replaceAccents'); +var removeNonWord = require('./removeNonWord'); +var upperCase = require('./upperCase'); +var lowerCase = require('./lowerCase'); + /** + * Convert string to camelCase text. + */ + function camelCase(str){ + str = toString(str); + str = replaceAccents(str); + str = removeNonWord(str) + .replace(/[\-_]/g, ' ') //convert all hyphens and underscores to spaces + .replace(/\s[a-z]/g, upperCase) //convert first char of each word to UPPERCASE + .replace(/\s+/g, '') //remove spaces + .replace(/^[A-Z]/g, lowerCase); //convert first char to lowercase + return str; + } + module.exports = camelCase; + diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/string/contains.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/string/contains.js new file mode 100644 index 0000000..cb22cae --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/string/contains.js @@ -0,0 +1,14 @@ +var toString = require('../lang/toString'); + + /** + * Searches for a given substring + */ + function contains(str, substring, fromIndex){ + str = toString(str); + substring = toString(substring); + return str.indexOf(substring, fromIndex) !== -1; + } + + module.exports = contains; + + diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/string/crop.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/string/crop.js new file mode 100644 index 0000000..53b93b4 --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/string/crop.js @@ -0,0 +1,12 @@ +var toString = require('../lang/toString'); +var truncate = require('./truncate'); + /** + * Truncate string at full words. + */ + function crop(str, maxChars, append) { + str = toString(str); + return truncate(str, maxChars, append, true); + } + + module.exports = crop; + diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/string/endsWith.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/string/endsWith.js new file mode 100644 index 0000000..d504e9d --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/string/endsWith.js @@ -0,0 +1,13 @@ +var toString = require('../lang/toString'); + /** + * Checks if string ends with specified suffix. + */ + function endsWith(str, suffix) { + str = toString(str); + suffix = toString(suffix); + + return str.indexOf(suffix, str.length - suffix.length) !== -1; + } + + module.exports = endsWith; + diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/string/escapeHtml.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/string/escapeHtml.js new file mode 100644 index 0000000..e67c4b2 --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/string/escapeHtml.js @@ -0,0 +1,18 @@ +var toString = require('../lang/toString'); + + /** + * Escapes a string for insertion into HTML. + */ + function escapeHtml(str){ + str = toString(str) + .replace(/&/g, '&') + .replace(//g, '>') + .replace(/'/g, ''') + .replace(/"/g, '"'); + return str; + } + + module.exports = escapeHtml; + + diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/string/escapeRegExp.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/string/escapeRegExp.js new file mode 100644 index 0000000..02d743c --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/string/escapeRegExp.js @@ -0,0 +1,12 @@ +var toString = require('../lang/toString'); + + /** + * Escape RegExp string chars. + */ + function escapeRegExp(str) { + return toString(str).replace(/\W/g,'\\$&'); + } + + module.exports = escapeRegExp; + + diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/string/escapeUnicode.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/string/escapeUnicode.js new file mode 100644 index 0000000..ec649ad --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/string/escapeUnicode.js @@ -0,0 +1,21 @@ +var toString = require('../lang/toString'); + + /** + * Escape string into unicode sequences + */ + function escapeUnicode(str, shouldEscapePrintable){ + str = toString(str); + return str.replace(/[\s\S]/g, function(ch){ + // skip printable ASCII chars if we should not escape them + if (!shouldEscapePrintable && (/[\x20-\x7E]/).test(ch)) { + return ch; + } + // we use "000" and slice(-4) for brevity, need to pad zeros, + // unicode escape always have 4 chars after "\u" + return '\\u'+ ('000'+ ch.charCodeAt(0).toString(16)).slice(-4); + }); + } + + module.exports = escapeUnicode; + + diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/string/hyphenate.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/string/hyphenate.js new file mode 100644 index 0000000..95e3243 --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/string/hyphenate.js @@ -0,0 +1,14 @@ +var toString = require('../lang/toString'); +var slugify = require('./slugify'); +var unCamelCase = require('./unCamelCase'); + /** + * Replaces spaces with hyphens, split camelCase text, remove non-word chars, remove accents and convert to lower case. + */ + function hyphenate(str){ + str = toString(str); + str = unCamelCase(str); + return slugify(str, "-"); + } + + module.exports = hyphenate; + diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/string/insert.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/string/insert.js new file mode 100644 index 0000000..8f042c6 --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/string/insert.js @@ -0,0 +1,21 @@ +var clamp = require('../math/clamp'); +var toString = require('../lang/toString'); + + /** + * Inserts a string at a given index. + */ + function insert(string, index, partial){ + string = toString(string); + + if (index < 0) { + index = string.length + index; + } + + index = clamp(index, 0, string.length); + + return string.substr(0, index) + partial + string.substr(index); + } + + module.exports = insert; + + diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/string/interpolate.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/string/interpolate.js new file mode 100644 index 0000000..efbbf7d --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/string/interpolate.js @@ -0,0 +1,19 @@ +var toString = require('../lang/toString'); +var get = require('../object/get'); + + var stache = /\{\{([^\}]+)\}\}/g; //mustache-like + + /** + * String interpolation + */ + function interpolate(template, replacements, syntax){ + template = toString(template); + var replaceFn = function(match, prop){ + return toString( get(replacements, prop) ); + }; + return template.replace(syntax || stache, replaceFn); + } + + module.exports = interpolate; + + diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/string/lowerCase.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/string/lowerCase.js new file mode 100644 index 0000000..30bb7ad --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/string/lowerCase.js @@ -0,0 +1,11 @@ +var toString = require('../lang/toString'); + /** + * "Safer" String.toLowerCase() + */ + function lowerCase(str){ + str = toString(str); + return str.toLowerCase(); + } + + module.exports = lowerCase; + diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/string/lpad.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/string/lpad.js new file mode 100644 index 0000000..63641d3 --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/string/lpad.js @@ -0,0 +1,17 @@ +var toString = require('../lang/toString'); +var repeat = require('./repeat'); + + /** + * Pad string with `char` if its' length is smaller than `minLen` + */ + function lpad(str, minLen, ch) { + str = toString(str); + ch = ch || ' '; + + return (str.length < minLen) ? + repeat(ch, minLen - str.length) + str : str; + } + + module.exports = lpad; + + diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/string/ltrim.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/string/ltrim.js new file mode 100644 index 0000000..23d7b33 --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/string/ltrim.js @@ -0,0 +1,34 @@ +var toString = require('../lang/toString'); +var WHITE_SPACES = require('./WHITE_SPACES'); + /** + * Remove chars from beginning of string. + */ + function ltrim(str, chars) { + str = toString(str); + chars = chars || WHITE_SPACES; + + var start = 0, + len = str.length, + charLen = chars.length, + found = true, + i, c; + + while (found && start < len) { + found = false; + i = -1; + c = str.charAt(start); + + while (++i < charLen) { + if (c === chars[i]) { + found = true; + start++; + break; + } + } + } + + return (start >= len) ? '' : str.substr(start, len); + } + + module.exports = ltrim; + diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/string/makePath.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/string/makePath.js new file mode 100644 index 0000000..c337cec --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/string/makePath.js @@ -0,0 +1,15 @@ +var join = require('../array/join'); +var slice = require('../array/slice'); + + /** + * Group arguments as path segments, if any of the args is `null` or an + * empty string it will be ignored from resulting path. + */ + function makePath(var_args){ + var result = join(slice(arguments), '/'); + // need to disconsider duplicate '/' after protocol (eg: 'http://') + return result.replace(/([^:\/]|^)\/{2,}/g, '$1/'); + } + + module.exports = makePath; + diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/string/normalizeLineBreaks.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/string/normalizeLineBreaks.js new file mode 100644 index 0000000..8a8dccf --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/string/normalizeLineBreaks.js @@ -0,0 +1,18 @@ +var toString = require('../lang/toString'); + + /** + * Convert line-breaks from DOS/MAC to a single standard (UNIX by default) + */ + function normalizeLineBreaks(str, lineEnd) { + str = toString(str); + lineEnd = lineEnd || '\n'; + + return str + .replace(/\r\n/g, lineEnd) // DOS + .replace(/\r/g, lineEnd) // Mac + .replace(/\n/g, lineEnd); // Unix + } + + module.exports = normalizeLineBreaks; + + diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/string/pascalCase.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/string/pascalCase.js new file mode 100644 index 0000000..fd19035 --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/string/pascalCase.js @@ -0,0 +1,13 @@ +var toString = require('../lang/toString'); +var camelCase = require('./camelCase'); +var upperCase = require('./upperCase'); + /** + * camelCase + UPPERCASE first char + */ + function pascalCase(str){ + str = toString(str); + return camelCase(str).replace(/^[a-z]/, upperCase); + } + + module.exports = pascalCase; + diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/string/properCase.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/string/properCase.js new file mode 100644 index 0000000..61636be --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/string/properCase.js @@ -0,0 +1,13 @@ +var toString = require('../lang/toString'); +var lowerCase = require('./lowerCase'); +var upperCase = require('./upperCase'); + /** + * UPPERCASE first char of each word. + */ + function properCase(str){ + str = toString(str); + return lowerCase(str).replace(/^\w|\s\w/g, upperCase); + } + + module.exports = properCase; + diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/string/removeNonASCII.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/string/removeNonASCII.js new file mode 100644 index 0000000..fb46381 --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/string/removeNonASCII.js @@ -0,0 +1,14 @@ +var toString = require('../lang/toString'); + /** + * Remove non-printable ASCII chars + */ + function removeNonASCII(str){ + str = toString(str); + + // Matches non-printable ASCII chars - + // http://en.wikipedia.org/wiki/ASCII#ASCII_printable_characters + return str.replace(/[^\x20-\x7E]/g, ''); + } + + module.exports = removeNonASCII; + diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/string/removeNonWord.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/string/removeNonWord.js new file mode 100644 index 0000000..ffb05a9 --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/string/removeNonWord.js @@ -0,0 +1,14 @@ +var toString = require('../lang/toString'); + // This pattern is generated by the _build/pattern-removeNonWord.js script + var PATTERN = /[^\x20\x2D0-9A-Z\x5Fa-z\xC0-\xD6\xD8-\xF6\xF8-\xFF]/g; + + /** + * Remove non-word chars. + */ + function removeNonWord(str){ + str = toString(str); + return str.replace(PATTERN, ''); + } + + module.exports = removeNonWord; + diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/string/repeat.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/string/repeat.js new file mode 100644 index 0000000..df0dc1e --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/string/repeat.js @@ -0,0 +1,26 @@ +var toString = require('../lang/toString'); +var toInt = require('../number/toInt'); + + /** + * Repeat string n times + */ + function repeat(str, n){ + var result = ''; + str = toString(str); + n = toInt(n); + if (n < 1) { + return ''; + } + while (n > 0) { + if (n % 2) { + result += str; + } + n = Math.floor(n / 2); + str += str; + } + return result; + } + + module.exports = repeat; + + diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/string/replace.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/string/replace.js new file mode 100644 index 0000000..14433fc --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/string/replace.js @@ -0,0 +1,33 @@ +var toString = require('../lang/toString'); +var toArray = require('../lang/toArray'); + + /** + * Replace string(s) with the replacement(s) in the source. + */ + function replace(str, search, replacements) { + str = toString(str); + search = toArray(search); + replacements = toArray(replacements); + + var searchLength = search.length, + replacementsLength = replacements.length; + + if (replacementsLength !== 1 && searchLength !== replacementsLength) { + throw new Error('Unequal number of searches and replacements'); + } + + var i = -1; + while (++i < searchLength) { + // Use the first replacement for all searches if only one + // replacement is provided + str = str.replace( + search[i], + replacements[(replacementsLength === 1) ? 0 : i]); + } + + return str; + } + + module.exports = replace; + + diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/string/replaceAccents.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/string/replaceAccents.js new file mode 100644 index 0000000..bb22126 --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/string/replaceAccents.js @@ -0,0 +1,36 @@ +var toString = require('../lang/toString'); + /** + * Replaces all accented chars with regular ones + */ + function replaceAccents(str){ + str = toString(str); + + // verifies if the String has accents and replace them + if (str.search(/[\xC0-\xFF]/g) > -1) { + str = str + .replace(/[\xC0-\xC5]/g, "A") + .replace(/[\xC6]/g, "AE") + .replace(/[\xC7]/g, "C") + .replace(/[\xC8-\xCB]/g, "E") + .replace(/[\xCC-\xCF]/g, "I") + .replace(/[\xD0]/g, "D") + .replace(/[\xD1]/g, "N") + .replace(/[\xD2-\xD6\xD8]/g, "O") + .replace(/[\xD9-\xDC]/g, "U") + .replace(/[\xDD]/g, "Y") + .replace(/[\xDE]/g, "P") + .replace(/[\xE0-\xE5]/g, "a") + .replace(/[\xE6]/g, "ae") + .replace(/[\xE7]/g, "c") + .replace(/[\xE8-\xEB]/g, "e") + .replace(/[\xEC-\xEF]/g, "i") + .replace(/[\xF1]/g, "n") + .replace(/[\xF2-\xF6\xF8]/g, "o") + .replace(/[\xF9-\xFC]/g, "u") + .replace(/[\xFE]/g, "p") + .replace(/[\xFD\xFF]/g, "y"); + } + return str; + } + module.exports = replaceAccents; + diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/string/rpad.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/string/rpad.js new file mode 100644 index 0000000..99f6378 --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/string/rpad.js @@ -0,0 +1,15 @@ +var toString = require('../lang/toString'); +var repeat = require('./repeat'); + + /** + * Pad string with `char` if its' length is smaller than `minLen` + */ + function rpad(str, minLen, ch) { + str = toString(str); + ch = ch || ' '; + return (str.length < minLen)? str + repeat(ch, minLen - str.length) : str; + } + + module.exports = rpad; + + diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/string/rtrim.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/string/rtrim.js new file mode 100644 index 0000000..66ba80e --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/string/rtrim.js @@ -0,0 +1,33 @@ +var toString = require('../lang/toString'); +var WHITE_SPACES = require('./WHITE_SPACES'); + /** + * Remove chars from end of string. + */ + function rtrim(str, chars) { + str = toString(str); + chars = chars || WHITE_SPACES; + + var end = str.length - 1, + charLen = chars.length, + found = true, + i, c; + + while (found && end >= 0) { + found = false; + i = -1; + c = str.charAt(end); + + while (++i < charLen) { + if (c === chars[i]) { + found = true; + end--; + break; + } + } + } + + return (end >= 0) ? str.substring(0, end + 1) : ''; + } + + module.exports = rtrim; + diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/string/sentenceCase.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/string/sentenceCase.js new file mode 100644 index 0000000..354104c --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/string/sentenceCase.js @@ -0,0 +1,15 @@ +var toString = require('../lang/toString'); +var lowerCase = require('./lowerCase'); +var upperCase = require('./upperCase'); + /** + * UPPERCASE first char of each sentence and lowercase other chars. + */ + function sentenceCase(str){ + str = toString(str); + + // Replace first char of each sentence (new line or after '.\s+') to + // UPPERCASE + return lowerCase(str).replace(/(^\w)|\.\s+(\w)/gm, upperCase); + } + module.exports = sentenceCase; + diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/string/slugify.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/string/slugify.js new file mode 100644 index 0000000..142f0d9 --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/string/slugify.js @@ -0,0 +1,24 @@ +var toString = require('../lang/toString'); +var replaceAccents = require('./replaceAccents'); +var removeNonWord = require('./removeNonWord'); +var trim = require('./trim'); + /** + * Convert to lower case, remove accents, remove non-word chars and + * replace spaces with the specified delimeter. + * Does not split camelCase text. + */ + function slugify(str, delimeter){ + str = toString(str); + + if (delimeter == null) { + delimeter = "-"; + } + str = replaceAccents(str); + str = removeNonWord(str); + str = trim(str) //should come after removeNonWord + .replace(/ +/g, delimeter) //replace spaces with delimeter + .toLowerCase(); + return str; + } + module.exports = slugify; + diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/string/startsWith.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/string/startsWith.js new file mode 100644 index 0000000..bce2bd2 --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/string/startsWith.js @@ -0,0 +1,13 @@ +var toString = require('../lang/toString'); + /** + * Checks if string starts with specified prefix. + */ + function startsWith(str, prefix) { + str = toString(str); + prefix = toString(prefix); + + return str.indexOf(prefix) === 0; + } + + module.exports = startsWith; + diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/string/stripHtmlTags.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/string/stripHtmlTags.js new file mode 100644 index 0000000..01d17b0 --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/string/stripHtmlTags.js @@ -0,0 +1,11 @@ +var toString = require('../lang/toString'); + /** + * Remove HTML tags from string. + */ + function stripHtmlTags(str){ + str = toString(str); + + return str.replace(/<[^>]*>/g, ''); + } + module.exports = stripHtmlTags; + diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/string/trim.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/string/trim.js new file mode 100644 index 0000000..9652b0c --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/string/trim.js @@ -0,0 +1,15 @@ +var toString = require('../lang/toString'); +var WHITE_SPACES = require('./WHITE_SPACES'); +var ltrim = require('./ltrim'); +var rtrim = require('./rtrim'); + /** + * Remove white-spaces from beginning and end of string. + */ + function trim(str, chars) { + str = toString(str); + chars = chars || WHITE_SPACES; + return ltrim(rtrim(str, chars), chars); + } + + module.exports = trim; + diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/string/truncate.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/string/truncate.js new file mode 100644 index 0000000..a98d6c7 --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/string/truncate.js @@ -0,0 +1,21 @@ +var toString = require('../lang/toString'); +var trim = require('./trim'); + /** + * Limit number of chars. + */ + function truncate(str, maxChars, append, onlyFullWords){ + str = toString(str); + append = append || '...'; + maxChars = onlyFullWords? maxChars + 1 : maxChars; + + str = trim(str); + if(str.length <= maxChars){ + return str; + } + str = str.substr(0, maxChars - append.length); + //crop at last space or remove trailing whitespace + str = onlyFullWords? str.substr(0, str.lastIndexOf(' ')) : trim(str); + return str + append; + } + module.exports = truncate; + diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/string/typecast.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/string/typecast.js new file mode 100644 index 0000000..c1386a4 --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/string/typecast.js @@ -0,0 +1,29 @@ + + + var UNDEF; + + /** + * Parses string and convert it into a native value. + */ + function typecast(val) { + var r; + if ( val === null || val === 'null' ) { + r = null; + } else if ( val === 'true' ) { + r = true; + } else if ( val === 'false' ) { + r = false; + } else if ( val === UNDEF || val === 'undefined' ) { + r = UNDEF; + } else if ( val === '' || isNaN(val) ) { + //isNaN('') returns false + r = val; + } else { + //parseFloat(null || '') returns NaN + r = parseFloat(val); + } + return r; + } + + module.exports = typecast; + diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/string/unCamelCase.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/string/unCamelCase.js new file mode 100644 index 0000000..4968f37 --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/string/unCamelCase.js @@ -0,0 +1,23 @@ +var toString = require('../lang/toString'); + + var CAMEL_CASE_BORDER = /([a-z\xE0-\xFF])([A-Z\xC0\xDF])/g; + + /** + * Add space between camelCase text. + */ + function unCamelCase(str, delimiter){ + if (delimiter == null) { + delimiter = ' '; + } + + function join(str, c1, c2) { + return c1 + delimiter + c2; + } + + str = toString(str); + str = str.replace(CAMEL_CASE_BORDER, join); + str = str.toLowerCase(); //add space between camelCase text + return str; + } + module.exports = unCamelCase; + diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/string/underscore.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/string/underscore.js new file mode 100644 index 0000000..ebd6e2b --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/string/underscore.js @@ -0,0 +1,13 @@ +var toString = require('../lang/toString'); +var slugify = require('./slugify'); +var unCamelCase = require('./unCamelCase'); + /** + * Replaces spaces with underscores, split camelCase text, remove non-word chars, remove accents and convert to lower case. + */ + function underscore(str){ + str = toString(str); + str = unCamelCase(str); + return slugify(str, "_"); + } + module.exports = underscore; + diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/string/unescapeHtml.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/string/unescapeHtml.js new file mode 100644 index 0000000..ad1987d --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/string/unescapeHtml.js @@ -0,0 +1,18 @@ +var toString = require('../lang/toString'); + + /** + * Unescapes HTML special chars + */ + function unescapeHtml(str){ + str = toString(str) + .replace(/&/g , '&') + .replace(/</g , '<') + .replace(/>/g , '>') + .replace(/�*39;/g , "'") + .replace(/"/g, '"'); + return str; + } + + module.exports = unescapeHtml; + + diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/string/unescapeUnicode.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/string/unescapeUnicode.js new file mode 100644 index 0000000..0b7fb73 --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/string/unescapeUnicode.js @@ -0,0 +1,16 @@ +var toString = require('../lang/toString'); + + /** + * Unescape unicode char sequences + */ + function unescapeUnicode(str){ + str = toString(str); + return str.replace(/\\u[0-9a-f]{4}/g, function(ch){ + var code = parseInt(ch.slice(2), 16); + return String.fromCharCode(code); + }); + } + + module.exports = unescapeUnicode; + + diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/string/unhyphenate.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/string/unhyphenate.js new file mode 100644 index 0000000..311dfa1 --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/string/unhyphenate.js @@ -0,0 +1,10 @@ +var toString = require('../lang/toString'); + /** + * Replaces hyphens with spaces. (only hyphens between word chars) + */ + function unhyphenate(str){ + str = toString(str); + return str.replace(/(\w)(-)(\w)/g, '$1 $3'); + } + module.exports = unhyphenate; + diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/string/upperCase.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/string/upperCase.js new file mode 100644 index 0000000..6c92552 --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/string/upperCase.js @@ -0,0 +1,10 @@ +var toString = require('../lang/toString'); + /** + * "Safer" String.toUpperCase() + */ + function upperCase(str){ + str = toString(str); + return str.toUpperCase(); + } + module.exports = upperCase; + diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/time.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/time.js new file mode 100644 index 0000000..9f53329 --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/time.js @@ -0,0 +1,12 @@ + + +//automatically generated, do not edit! +//run `node build` instead +module.exports = { + 'convert' : require('./time/convert'), + 'now' : require('./time/now'), + 'parseMs' : require('./time/parseMs'), + 'toTimeString' : require('./time/toTimeString') +}; + + diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/time/convert.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/time/convert.js new file mode 100644 index 0000000..852a0f0 --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/time/convert.js @@ -0,0 +1,41 @@ + + + /** + * convert time into another unit + */ + function convert(val, sourceUnitName, destinationUnitName){ + destinationUnitName = destinationUnitName || 'ms'; + return (val * getUnit(sourceUnitName)) / getUnit(destinationUnitName); + } + + + //TODO: maybe extract to a separate module + function getUnit(unitName){ + switch(unitName){ + case 'ms': + case 'millisecond': + return 1; + case 's': + case 'second': + return 1000; + case 'm': + case 'minute': + return 60000; + case 'h': + case 'hour': + return 3600000; + case 'd': + case 'day': + return 86400000; + case 'w': + case 'week': + return 604800000; + default: + throw new Error('"'+ unitName + '" is not a valid unit'); + } + } + + + module.exports = convert; + + diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/time/now.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/time/now.js new file mode 100644 index 0000000..0cedb18 --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/time/now.js @@ -0,0 +1,18 @@ + + + /** + * Get current time in miliseconds + */ + function now(){ + // yes, we defer the work to another function to allow mocking it + // during the tests + return now.get(); + } + + now.get = (typeof Date.now === 'function')? Date.now : function(){ + return +(new Date()); + }; + + module.exports = now; + + diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/time/parseMs.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/time/parseMs.js new file mode 100644 index 0000000..6d99797 --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/time/parseMs.js @@ -0,0 +1,17 @@ +var countSteps = require('../math/countSteps'); + + /** + * Parse timestamp into an object. + */ + function parseMs(ms){ + return { + milliseconds : countSteps(ms, 1, 1000), + seconds : countSteps(ms, 1000, 60), + minutes : countSteps(ms, 60000, 60), + hours : countSteps(ms, 3600000, 24), + days : countSteps(ms, 86400000) + }; + } + + module.exports = parseMs; + diff --git a/node_modules/bower/node_modules/bower-config/node_modules/mout/time/toTimeString.js b/node_modules/bower/node_modules/bower-config/node_modules/mout/time/toTimeString.js new file mode 100644 index 0000000..101d69f --- /dev/null +++ b/node_modules/bower/node_modules/bower-config/node_modules/mout/time/toTimeString.js @@ -0,0 +1,24 @@ +var countSteps = require('../math/countSteps'); +var pad = require('../number/pad'); + + var HOUR = 3600000, + MINUTE = 60000, + SECOND = 1000; + + /** + * Format timestamp into a time string. + */ + function toTimeString(ms){ + var h = ms < HOUR ? 0 : countSteps(ms, HOUR), + m = ms < MINUTE ? 0 : countSteps(ms, MINUTE, 60), + s = ms < SECOND ? 0 : countSteps(ms, SECOND, 60), + str = ''; + + str += h? h + ':' : ''; + str += pad(m, 2) + ':'; + str += pad(s, 2); + + return str; + } + module.exports = toTimeString; + diff --git a/node_modules/bower/node_modules/bower-config/node_modules/optimist/node_modules/minimist/package.json b/node_modules/bower/node_modules/bower-config/node_modules/optimist/node_modules/minimist/package.json index 54f611b..ed2314e 100644 --- a/node_modules/bower/node_modules/bower-config/node_modules/optimist/node_modules/minimist/package.json +++ b/node_modules/bower/node_modules/bower-config/node_modules/optimist/node_modules/minimist/package.json @@ -48,7 +48,7 @@ "shasum": "de3f98543dbf96082be48ad1a0c7cda836301dcf", "tarball": "http://registry.npmjs.org/minimist/-/minimist-0.0.10.tgz" }, - "_from": "minimist@~0.0.1", + "_from": "minimist@0.0.10", "_npmVersion": "1.4.3", "_npmUser": { "name": "substack", diff --git a/node_modules/bower/node_modules/bower-json/node_modules/deep-extend/package.json b/node_modules/bower/node_modules/bower-json/node_modules/deep-extend/package.json index b7862f6..2735417 100644 --- a/node_modules/bower/node_modules/bower-json/node_modules/deep-extend/package.json +++ b/node_modules/bower/node_modules/bower-json/node_modules/deep-extend/package.json @@ -41,7 +41,7 @@ "shasum": "7a16ba69729132340506170494bc83f7076fe08f", "tarball": "http://registry.npmjs.org/deep-extend/-/deep-extend-0.2.11.tgz" }, - "_from": "deep-extend@~0.2.5", + "_from": "deep-extend@0.2.11", "_npmVersion": "1.4.6", "_npmUser": { "name": "unclechu", diff --git a/node_modules/bower/node_modules/bower-json/node_modules/graceful-fs/package.json b/node_modules/bower/node_modules/bower-json/node_modules/graceful-fs/package.json index dc22856..d78e908 100644 --- a/node_modules/bower/node_modules/bower-json/node_modules/graceful-fs/package.json +++ b/node_modules/bower/node_modules/bower-json/node_modules/graceful-fs/package.json @@ -47,7 +47,7 @@ "shasum": "7cd2cdb228a4a3f36e95efa6cc142de7d1a136d0", "tarball": "http://registry.npmjs.org/graceful-fs/-/graceful-fs-2.0.3.tgz" }, - "_from": "graceful-fs@~2.0.0", + "_from": "graceful-fs@2.0.3", "_npmVersion": "1.4.6", "_npmUser": { "name": "isaacs", diff --git a/node_modules/bower/node_modules/bower-json/node_modules/intersect/package.json b/node_modules/bower/node_modules/bower-json/node_modules/intersect/package.json index f0c68a7..48312d0 100644 --- a/node_modules/bower/node_modules/bower-json/node_modules/intersect/package.json +++ b/node_modules/bower/node_modules/bower-json/node_modules/intersect/package.json @@ -44,7 +44,7 @@ "shasum": "c1a4a5e5eac6ede4af7504cc07e0ada7bc9f4920", "tarball": "http://registry.npmjs.org/intersect/-/intersect-0.0.3.tgz" }, - "_from": "intersect@~0.0.3", + "_from": "intersect@0.0.3", "_npmVersion": "1.2.14", "_npmUser": { "name": "juliangruber", diff --git a/node_modules/bower/node_modules/bower-registry-client/.travis.yml b/node_modules/bower/node_modules/bower-registry-client/.travis.yml index 7ab0926..dedfc07 100644 --- a/node_modules/bower/node_modules/bower-registry-client/.travis.yml +++ b/node_modules/bower/node_modules/bower-registry-client/.travis.yml @@ -1,6 +1,6 @@ -before_script: - - npm install -g grunt-cli +sudo: false language: node_js node_js: - - "0.10" - - "0.8" + - 'iojs' + - '0.12' + - '0.10' diff --git a/node_modules/bower/node_modules/bower-registry-client/Gruntfile.js b/node_modules/bower/node_modules/bower-registry-client/Gruntfile.js index 11042a5..d7e9d44 100644 --- a/node_modules/bower/node_modules/bower-registry-client/Gruntfile.js +++ b/node_modules/bower/node_modules/bower-registry-client/Gruntfile.js @@ -1,14 +1,10 @@ +'use strict'; module.exports = function (grunt) { - - 'use strict'; - grunt.loadNpmTasks('grunt-contrib-jshint'); grunt.loadNpmTasks('grunt-contrib-watch'); grunt.loadNpmTasks('grunt-simple-mocha'); - // Project configuration. grunt.initConfig({ - jshint: { files: [ 'Gruntfile.js', @@ -19,12 +15,14 @@ module.exports = function (grunt) { jshintrc: '.jshintrc' } }, - simplemocha: { options: { - reporter: 'spec' + reporter: 'spec', + timeout: 20000 + }, + full: { + src: ['test/runner.js'] }, - full: { src: ['test/runner.js'] }, short: { options: { reporter: 'dot' @@ -38,16 +36,12 @@ module.exports = function (grunt) { src: ['test/runner.js'] } }, - - watch: { files: ['<%= jshint.files %>'], tasks: ['jshint', 'simplemocha:short'] } - }); - // Default task. grunt.registerTask('test', ['simplemocha:full']); grunt.registerTask('default', ['jshint', 'test']); }; diff --git a/node_modules/bower/node_modules/bower-registry-client/README.md b/node_modules/bower/node_modules/bower-registry-client/README.md index 6896e27..32661bf 100644 --- a/node_modules/bower/node_modules/bower-registry-client/README.md +++ b/node_modules/bower/node_modules/bower-registry-client/README.md @@ -1,12 +1,18 @@ -# bower-registry-client [![Build Status](https://secure.travis-ci.org/bower/registry-client.png?branch=master)](http://travis-ci.org/bower/registry-client) +# bower-registry-client [![Build Status](https://travis-ci.org/bower/registry-client.png?branch=master)](https://travis-ci.org/bower/registry-client) -This module allows you to easily interact with the Bower server API. +> Provides easy interaction with the Bower registry + + +## Install + +``` +$ npm install --save bower-registry-client +``` ## Usage ```js - var RegistryClient = require('bower-registry-client'); var registry = new RegistryClient(options, logger); ``` @@ -142,7 +148,6 @@ RegistryClient.clearRuntimeCache(); ``` - ## License Released under the [MIT License](http://www.opensource.org/licenses/mit-license.php). diff --git a/node_modules/bower/node_modules/bower-registry-client/lib/register.js b/node_modules/bower/node_modules/bower-registry-client/lib/register.js index fb43189..dcbdf6f 100644 --- a/node_modules/bower/node_modules/bower-registry-client/lib/register.js +++ b/node_modules/bower/node_modules/bower-registry-client/lib/register.js @@ -35,7 +35,7 @@ function register(name, url, callback) { } // Duplicate - if (response.statusCode === 406) { + if (response.statusCode === 403) { return callback(createError('Duplicate package', 'EDUPLICATE')); } @@ -46,7 +46,7 @@ function register(name, url, callback) { // Everything other than 201 is unknown if (response.statusCode !== 201) { - return callback(createError('Unknown error: ' + response.statusCode, 'EUNKNOWN')); + return callback(createError('Unknown error: ' + response.statusCode + ' - ' + response.body, 'EUNKNOWN')); } callback(null, { diff --git a/node_modules/bower/node_modules/bower-registry-client/lib/unregister.js b/node_modules/bower/node_modules/bower-registry-client/lib/unregister.js index 9d49304..0955c2b 100644 --- a/node_modules/bower/node_modules/bower-registry-client/lib/unregister.js +++ b/node_modules/bower/node_modules/bower-registry-client/lib/unregister.js @@ -31,12 +31,12 @@ function unregister(name, callback) { // Forbidden if (response.statusCode === 403) { - return callback(createError('Not authorized', 'EFORBIDDEN')); + return callback(createError(response.body, 'EFORBIDDEN')); } // Everything other than 204 is unknown if (response.statusCode !== 204) { - return callback(createError('Unknown error: ' + response.statusCode + ', ' + response.body, 'EUNKNOWN')); + return callback(createError(response.body, 'EUNKNOWN')); } callback(null, { diff --git a/node_modules/bower/node_modules/bower-registry-client/node_modules/request/.eslintrc b/node_modules/bower/node_modules/bower-registry-client/node_modules/request/.eslintrc new file mode 100644 index 0000000..9c3350d --- /dev/null +++ b/node_modules/bower/node_modules/bower-registry-client/node_modules/request/.eslintrc @@ -0,0 +1,22 @@ +{ + "env": { + "node": true + }, + "rules": { + // Disallow semi-colons, unless needed to disambiguate statement + "semi": [2, "never"], + // Require strings to use single quotes + "quotes": [2, "single"], + // Require curly braces for all control statements + "curly": 2, + // Disallow using variables and functions before they've been defined + "no-use-before-define": 2, + // Allow any case for variable naming + "camelcase": 0, + // Disallow unused variables, except as function arguments + "no-unused-vars": [2, {"args":"none"}], + // Allow leading underscores for method names + // REASON: we use underscores to denote private methods + "no-underscore-dangle": 0 + } +} diff --git a/node_modules/bower/node_modules/bower-registry-client/node_modules/request/.npmignore b/node_modules/bower/node_modules/bower-registry-client/node_modules/request/.npmignore index 3c3629e..80e59ef 100644 --- a/node_modules/bower/node_modules/bower-registry-client/node_modules/request/.npmignore +++ b/node_modules/bower/node_modules/bower-registry-client/node_modules/request/.npmignore @@ -1 +1,2 @@ +tests node_modules diff --git a/node_modules/bower/node_modules/bower-registry-client/node_modules/request/.travis.yml b/node_modules/bower/node_modules/bower-registry-client/node_modules/request/.travis.yml new file mode 100644 index 0000000..90e06c1 --- /dev/null +++ b/node_modules/bower/node_modules/bower-registry-client/node_modules/request/.travis.yml @@ -0,0 +1,11 @@ +language: node_js +node_js: + - "0.8" + - "0.10" +before_install: npm install -g npm@~1.4.6 +after_script: ./node_modules/.bin/istanbul cover ./node_modules/tape/bin/tape tests/test-*.js --report lcovonly && cat ./coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js --verbose +webhooks: + urls: https://webhooks.gitter.im/e/237280ed4796c19cc626 + on_success: change # options: [always|never|change] default: always + on_failure: always # options: [always|never|change] default: always + on_start: false # default: false diff --git a/node_modules/bower/node_modules/bower-registry-client/node_modules/request/CHANGELOG.md b/node_modules/bower/node_modules/bower-registry-client/node_modules/request/CHANGELOG.md new file mode 100644 index 0000000..f4e5431 --- /dev/null +++ b/node_modules/bower/node_modules/bower-registry-client/node_modules/request/CHANGELOG.md @@ -0,0 +1,394 @@ +## Change Log + +### v2.51.0 (2014/12/10) +- [#1310](https://github.com/request/request/pull/1310) Revert changes introduced in https://github.com/request/request/pull/1282 (@simov) + +### v2.50.0 (2014/12/09) +- [#1308](https://github.com/request/request/pull/1308) Add browser test to keep track of browserify compability. (@eiriksm) +- [#1299](https://github.com/request/request/pull/1299) Add optional support for jsonReviver (@poislagarde) +- [#1277](https://github.com/request/request/pull/1277) Add Coveralls configuration (@simov) +- [#1307](https://github.com/request/request/pull/1307) Upgrade form-data, add back browserify compability. Fixes #455. (@eiriksm) +- [#1305](https://github.com/request/request/pull/1305) Fix typo in README.md (@LewisJEllis) +- [#1288](https://github.com/request/request/pull/1288) Update README.md to explain custom file use case (@cliffcrosland) + +### v2.49.0 (2014/11/28) +- [#1295](https://github.com/request/request/pull/1295) fix(proxy): no-proxy false positive (@oliamb) +- [#1292](https://github.com/request/request/pull/1292) Upgrade `caseless` to 0.8.1 (@mmalecki) +- [#1276](https://github.com/request/request/pull/1276) Set transfer encoding for multipart/related to chunked by default (@simov) +- [#1275](https://github.com/request/request/pull/1275) Fix multipart content-type headers detection (@simov) +- [#1269](https://github.com/request/request/pull/1269) adds streams example for review (@tbuchok) +- [#1238](https://github.com/request/request/pull/1238) Add examples README.md (@simov) + +### v2.48.0 (2014/11/12) +- [#1263](https://github.com/request/request/pull/1263) Fixed a syntax error / typo in README.md (@xna2) +- [#1253](https://github.com/request/request/pull/1253) Add multipart chunked flag (@simov, @nylen) +- [#1251](https://github.com/request/request/pull/1251) Clarify that defaults() does not modify global defaults (@nylen) +- [#1250](https://github.com/request/request/pull/1250) Improve documentation for pool and maxSockets options (@nylen) +- [#1237](https://github.com/request/request/pull/1237) Documenting error handling when using streams (@vmattos) +- [#1244](https://github.com/request/request/pull/1244) Finalize changelog command (@nylen) +- [#1241](https://github.com/request/request/pull/1241) Fix typo (@alexanderGugel) +- [#1223](https://github.com/request/request/pull/1223) Show latest version number instead of "upcoming" in changelog (@nylen) +- [#1236](https://github.com/request/request/pull/1236) Document how to use custom CA in README (#1229) (@hypesystem) +- [#1228](https://github.com/request/request/pull/1228) Support for oauth with RSA-SHA1 signing (@nylen) +- [#1216](https://github.com/request/request/pull/1216) Made json and multipart options coexist (@nylen, @simov) +- [#1225](https://github.com/request/request/pull/1225) Allow header white/exclusive lists in any case. (@RReverser) + +### v2.47.0 (2014/10/26) +- [#1222](https://github.com/request/request/pull/1222) Move from mikeal/request to request/request (@nylen) +- [#1220](https://github.com/request/request/pull/1220) update qs dependency to 2.3.1 (@FredKSchott) +- [#1212](https://github.com/request/request/pull/1212) Improve tests/test-timeout.js (@nylen) +- [#1219](https://github.com/request/request/pull/1219) remove old globalAgent workaround for node 0.4 (@request) +- [#1214](https://github.com/request/request/pull/1214) Remove cruft left over from optional dependencies (@nylen) +- [#1215](https://github.com/request/request/pull/1215) Add proxyHeaderExclusiveList option for proxy-only headers. (@RReverser) +- [#1211](https://github.com/request/request/pull/1211) Allow 'Host' header instead of 'host' and remember case across redirects (@nylen) +- [#1208](https://github.com/request/request/pull/1208) Improve release script (@nylen) +- [#1213](https://github.com/request/request/pull/1213) Support for custom cookie store (@nylen, @mitsuru) +- [#1197](https://github.com/request/request/pull/1197) Clean up some code around setting the agent (@FredKSchott) +- [#1209](https://github.com/request/request/pull/1209) Improve multipart form append test (@simov) +- [#1207](https://github.com/request/request/pull/1207) Update changelog (@nylen) +- [#1185](https://github.com/request/request/pull/1185) Stream multipart/related bodies (@simov) + +### v2.46.0 (2014/10/23) +- [#1198](https://github.com/request/request/pull/1198) doc for TLS/SSL protocol options (@shawnzhu) +- [#1200](https://github.com/request/request/pull/1200) Add a Gitter chat badge to README.md (@gitter-badger) +- [#1196](https://github.com/request/request/pull/1196) Upgrade taper test reporter to v0.3.0 (@nylen) +- [#1199](https://github.com/request/request/pull/1199) Fix lint error: undeclared var i (@nylen) +- [#1191](https://github.com/request/request/pull/1191) Move self.proxy decision logic out of init and into a helper (@FredKSchott) +- [#1190](https://github.com/request/request/pull/1190) Move _buildRequest() logic back into init (@FredKSchott) +- [#1186](https://github.com/request/request/pull/1186) Support Smarter Unix URL Scheme (@FredKSchott) +- [#1178](https://github.com/request/request/pull/1178) update form documentation for new usage (@FredKSchott) +- [#1180](https://github.com/request/request/pull/1180) Enable no-mixed-requires linting rule (@nylen) +- [#1184](https://github.com/request/request/pull/1184) Don't forward authorization header across redirects to different hosts (@nylen) +- [#1183](https://github.com/request/request/pull/1183) Correct README about pre and postamble CRLF using multipart and not mult... (@netpoetica) +- [#1179](https://github.com/request/request/pull/1179) Lint tests directory (@nylen) +- [#1169](https://github.com/request/request/pull/1169) add metadata for form-data file field (@dotcypress) +- [#1173](https://github.com/request/request/pull/1173) remove optional dependencies (@seanstrom) +- [#1165](https://github.com/request/request/pull/1165) Cleanup event listeners and remove function creation from init (@FredKSchott) +- [#1174](https://github.com/request/request/pull/1174) update the request.cookie docs to have a valid cookie example (@seanstrom) +- [#1168](https://github.com/request/request/pull/1168) create a detach helper and use detach helper in replace of nextTick (@seanstrom) +- [#1171](https://github.com/request/request/pull/1171) in post can send form data and use callback (@MiroRadenovic) +- [#1159](https://github.com/request/request/pull/1159) accept charset for x-www-form-urlencoded content-type (@seanstrom) +- [#1157](https://github.com/request/request/pull/1157) Update README.md: body with json=true (@Rob--W) +- [#1164](https://github.com/request/request/pull/1164) Disable tests/test-timeout.js on Travis (@nylen) +- [#1153](https://github.com/request/request/pull/1153) Document how to run a single test (@nylen) +- [#1144](https://github.com/request/request/pull/1144) adds documentation for the "response" event within the streaming section (@tbuchok) +- [#1162](https://github.com/request/request/pull/1162) Update eslintrc file to no longer allow past errors (@FredKSchott) +- [#1155](https://github.com/request/request/pull/1155) Support/use self everywhere (@seanstrom) +- [#1161](https://github.com/request/request/pull/1161) fix no-use-before-define lint warnings (@emkay) +- [#1156](https://github.com/request/request/pull/1156) adding curly brackets to get rid of lint errors (@emkay) +- [#1151](https://github.com/request/request/pull/1151) Fix localAddress test on OS X (@nylen) +- [#1145](https://github.com/request/request/pull/1145) documentation: fix outdated reference to setCookieSync old name in README (@FredKSchott) +- [#1131](https://github.com/request/request/pull/1131) Update pool documentation (@FredKSchott) +- [#1143](https://github.com/request/request/pull/1143) Rewrite all tests to use tape (@nylen) +- [#1137](https://github.com/request/request/pull/1137) Add ability to specifiy querystring lib in options. (@jgrund) +- [#1138](https://github.com/request/request/pull/1138) allow hostname and port in place of host on uri (@cappslock) +- [#1134](https://github.com/request/request/pull/1134) Fix multiple redirects and `self.followRedirect` (@blakeembrey) +- [#1130](https://github.com/request/request/pull/1130) documentation fix: add note about npm test for contributing (@FredKSchott) +- [#1120](https://github.com/request/request/pull/1120) Support/refactor request setup tunnel (@seanstrom) +- [#1129](https://github.com/request/request/pull/1129) linting fix: convert double quote strings to use single quotes (@FredKSchott) +- [#1124](https://github.com/request/request/pull/1124) linting fix: remove unneccesary semi-colons (@FredKSchott) + +### v2.45.0 (2014/10/06) +- [#1128](https://github.com/request/request/pull/1128) Add test for setCookie regression (@nylen) +- [#1127](https://github.com/request/request/pull/1127) added tests around using objects as values in a query string (@bcoe) +- [#1103](https://github.com/request/request/pull/1103) Support/refactor request constructor (@nylen, @seanstrom) +- [#1119](https://github.com/request/request/pull/1119) add basic linting to request library (@FredKSchott) +- [#1121](https://github.com/request/request/pull/1121) Revert "Explicitly use sync versions of cookie functions" (@nylen) +- [#1118](https://github.com/request/request/pull/1118) linting fix: Restructure bad empty if statement (@FredKSchott) +- [#1117](https://github.com/request/request/pull/1117) Fix a bad check for valid URIs (@FredKSchott) +- [#1113](https://github.com/request/request/pull/1113) linting fix: space out operators (@FredKSchott) +- [#1116](https://github.com/request/request/pull/1116) Fix typo in `noProxyHost` definition (@FredKSchott) +- [#1114](https://github.com/request/request/pull/1114) linting fix: Added a `new` operator that was missing when creating and throwing a new error (@FredKSchott) +- [#1096](https://github.com/request/request/pull/1096) No_proxy support (@samcday) +- [#1107](https://github.com/request/request/pull/1107) linting-fix: remove unused variables (@FredKSchott) +- [#1112](https://github.com/request/request/pull/1112) linting fix: Make return values consistent and more straitforward (@FredKSchott) +- [#1111](https://github.com/request/request/pull/1111) linting fix: authPieces was getting redeclared (@FredKSchott) +- [#1105](https://github.com/request/request/pull/1105) Use strict mode in request (@FredKSchott) +- [#1110](https://github.com/request/request/pull/1110) linting fix: replace lazy '==' with more strict '===' (@FredKSchott) +- [#1109](https://github.com/request/request/pull/1109) linting fix: remove function call from if-else conditional statement (@FredKSchott) +- [#1102](https://github.com/request/request/pull/1102) Fix to allow setting a `requester` on recursive calls to `request.defaults` (@tikotzky) +- [#1095](https://github.com/request/request/pull/1095) Tweaking engines in package.json (@pdehaan) +- [#1082](https://github.com/request/request/pull/1082) Forward the socket event from the httpModule request (@seanstrom) +- [#972](https://github.com/request/request/pull/972) Clarify gzip handling in the README (@kevinoid) +- [#1089](https://github.com/request/request/pull/1089) Mention that encoding defaults to utf8, not Buffer (@stuartpb) +- [#1088](https://github.com/request/request/pull/1088) Fix cookie example in README.md and make it more clear (@pipi32167) +- [#1027](https://github.com/request/request/pull/1027) Add support for multipart form data in request options. (@crocket) +- [#1076](https://github.com/request/request/pull/1076) use Request.abort() to abort the request when the request has timed-out (@seanstrom) +- [#1068](https://github.com/request/request/pull/1068) add optional postamble required by .NET multipart requests (@netpoetica) + +### v2.43.0 (2014/09/18) +- [#1057](https://github.com/request/request/pull/1057) Defaults should not overwrite defined options (@davidwood) +- [#1046](https://github.com/request/request/pull/1046) Propagate datastream errors, useful in case gzip fails. (@ZJONSSON, @Janpot) +- [#1063](https://github.com/request/request/pull/1063) copy the input headers object #1060 (@finnp) +- [#1031](https://github.com/request/request/pull/1031) Explicitly use sync versions of cookie functions (@ZJONSSON) +- [#1056](https://github.com/request/request/pull/1056) Fix redirects when passing url.parse(x) as URL to convenience method (@nylen) + +### v2.42.0 (2014/09/04) +- [#1053](https://github.com/request/request/pull/1053) Fix #1051 Parse auth properly when using non-tunneling proxy (@isaacs) + +### v2.41.0 (2014/09/04) +- [#1050](https://github.com/request/request/pull/1050) Pass whitelisted headers to tunneling proxy. Organize all tunneling logic. (@isaacs, @Feldhacker) +- [#1035](https://github.com/request/request/pull/1035) souped up nodei.co badge (@rvagg) +- [#1048](https://github.com/request/request/pull/1048) Aws is now possible over a proxy (@steven-aerts) +- [#1039](https://github.com/request/request/pull/1039) extract out helper functions to a helper file (@seanstrom) +- [#1021](https://github.com/request/request/pull/1021) Support/refactor indexjs (@seanstrom) +- [#1033](https://github.com/request/request/pull/1033) Improve and document debug options (@nylen) +- [#1034](https://github.com/request/request/pull/1034) Fix readme headings (@nylen) +- [#1030](https://github.com/request/request/pull/1030) Allow recursive request.defaults (@tikotzky) +- [#1029](https://github.com/request/request/pull/1029) Fix a couple of typos (@nylen) +- [#675](https://github.com/request/request/pull/675) Checking for SSL fault on connection before reading SSL properties (@VRMink) +- [#989](https://github.com/request/request/pull/989) Added allowRedirect function. Should return true if redirect is allowed or false otherwise (@doronin) +- [#1025](https://github.com/request/request/pull/1025) [fixes #1023] Set self._ended to true once response has ended (@mridgway) +- [#1020](https://github.com/request/request/pull/1020) Add back removed debug metadata (@FredKSchott) +- [#1008](https://github.com/request/request/pull/1008) Moving to module instead of cutomer buffer concatenation. (@mikeal) +- [#770](https://github.com/request/request/pull/770) Added dependency badge for README file; (@timgluz) +- [#1016](https://github.com/request/request/pull/1016) toJSON no longer results in an infinite loop, returns simple objects (@FredKSchott) +- [#1018](https://github.com/request/request/pull/1018) Remove pre-0.4.4 HTTPS fix (@mmalecki) +- [#1006](https://github.com/request/request/pull/1006) Migrate to caseless, fixes #1001 (@mikeal) +- [#995](https://github.com/request/request/pull/995) Fix parsing array of objects (@sjonnet19) +- [#999](https://github.com/request/request/pull/999) Fix fallback for browserify for optional modules. (@eiriksm) +- [#996](https://github.com/request/request/pull/996) Wrong oauth signature when multiple same param keys exist [updated] (@bengl) + +### v2.40.0 (2014/08/06) +- [#992](https://github.com/request/request/pull/992) Fix security vulnerability. Update qs (@poeticninja) +- [#988](https://github.com/request/request/pull/988) “--” -> “—” (@upisfree) +- [#987](https://github.com/request/request/pull/987) Show optional modules as being loaded by the module that reqeusted them (@iarna) + +### v2.39.0 (2014/07/24) +- [#976](https://github.com/request/request/pull/976) Update README.md (@fosco-maestro) + +### v2.38.0 (2014/07/22) +- [#952](https://github.com/request/request/pull/952) Adding support to client certificate with proxy use case (@ofirshaked) +- [#884](https://github.com/request/request/pull/884) Documented tough-cookie installation. (@wbyoung) +- [#935](https://github.com/request/request/pull/935) Correct repository url (@fritx) +- [#963](https://github.com/request/request/pull/963) Update changelog (@nylen) +- [#960](https://github.com/request/request/pull/960) Support gzip with encoding on node pre-v0.9.4 (@kevinoid) +- [#953](https://github.com/request/request/pull/953) Add async Content-Length computation when using form-data (@LoicMahieu) +- [#844](https://github.com/request/request/pull/844) Add support for HTTP[S]_PROXY environment variables. Fixes #595. (@jvmccarthy) +- [#946](https://github.com/request/request/pull/946) defaults: merge headers (@aj0strow) + +### v2.37.0 (2014/07/07) +- [#957](https://github.com/request/request/pull/957) Silence EventEmitter memory leak warning #311 (@watson) +- [#955](https://github.com/request/request/pull/955) check for content-length header before setting it in nextTick (@camilleanne) +- [#951](https://github.com/request/request/pull/951) Add support for gzip content decoding (@kevinoid) +- [#949](https://github.com/request/request/pull/949) Manually enter querystring in form option (@charlespwd) +- [#944](https://github.com/request/request/pull/944) Make request work with browserify (@eiriksm) +- [#943](https://github.com/request/request/pull/943) New mime module (@eiriksm) +- [#927](https://github.com/request/request/pull/927) Bump version of hawk dep. (@samccone) +- [#907](https://github.com/request/request/pull/907) append secureOptions to poolKey (@medovob) + +### v2.35.0 (2014/05/17) +- [#901](https://github.com/request/request/pull/901) Fixes #555 (@pigulla) +- [#897](https://github.com/request/request/pull/897) merge with default options (@vohof) +- [#891](https://github.com/request/request/pull/891) fixes 857 - options object is mutated by calling request (@lalitkapoor) +- [#869](https://github.com/request/request/pull/869) Pipefilter test (@tgohn) +- [#866](https://github.com/request/request/pull/866) Fix typo (@dandv) +- [#861](https://github.com/request/request/pull/861) Add support for RFC 6750 Bearer Tokens (@phedny) +- [#809](https://github.com/request/request/pull/809) upgrade tunnel-proxy to 0.4.0 (@ksato9700) +- [#850](https://github.com/request/request/pull/850) Fix word consistency in readme (@0xNobody) +- [#810](https://github.com/request/request/pull/810) add some exposition to mpu example in README.md (@mikermcneil) +- [#840](https://github.com/request/request/pull/840) improve error reporting for invalid protocols (@FND) +- [#821](https://github.com/request/request/pull/821) added secureOptions back (@nw) +- [#815](https://github.com/request/request/pull/815) Create changelog based on pull requests (@lalitkapoor) + +### v2.34.0 (2014/02/18) +- [#516](https://github.com/request/request/pull/516) UNIX Socket URL Support (@lyuzashi) +- [#801](https://github.com/request/request/pull/801) 794 ignore cookie parsing and domain errors (@lalitkapoor) +- [#802](https://github.com/request/request/pull/802) Added the Apache license to the package.json. (@keskival) +- [#793](https://github.com/request/request/pull/793) Adds content-length calculation when submitting forms using form-data li... (@Juul) +- [#785](https://github.com/request/request/pull/785) Provide ability to override content-type when `json` option used (@vvo) +- [#781](https://github.com/request/request/pull/781) simpler isReadStream function (@joaojeronimo) + +### v2.32.0 (2014/01/16) +- [#767](https://github.com/request/request/pull/767) Use tough-cookie CookieJar sync API (@stash) +- [#764](https://github.com/request/request/pull/764) Case-insensitive authentication scheme (@bobyrizov) +- [#763](https://github.com/request/request/pull/763) Upgrade tough-cookie to 0.10.0 (@stash) +- [#744](https://github.com/request/request/pull/744) Use Cookie.parse (@lalitkapoor) +- [#757](https://github.com/request/request/pull/757) require aws-sign2 (@mafintosh) + +### v2.31.0 (2014/01/08) +- [#645](https://github.com/request/request/pull/645) update twitter api url to v1.1 (@mick) +- [#746](https://github.com/request/request/pull/746) README: Markdown code highlight (@weakish) +- [#745](https://github.com/request/request/pull/745) updating setCookie example to make it clear that the callback is required (@emkay) +- [#742](https://github.com/request/request/pull/742) Add note about JSON output body type (@iansltx) +- [#741](https://github.com/request/request/pull/741) README example is using old cookie jar api (@emkay) +- [#736](https://github.com/request/request/pull/736) Fix callback arguments documentation (@mmalecki) + +### v2.30.0 (2013/12/13) +- [#732](https://github.com/request/request/pull/732) JSHINT: Creating global 'for' variable. Should be 'for (var ...'. (@Fritz-Lium) +- [#730](https://github.com/request/request/pull/730) better HTTP DIGEST support (@dai-shi) +- [#728](https://github.com/request/request/pull/728) Fix TypeError when calling request.cookie (@scarletmeow) + +### v2.29.0 (2013/12/06) +- [#727](https://github.com/request/request/pull/727) fix requester bug (@jchris) + +### v2.28.0 (2013/12/04) +- [#724](https://github.com/request/request/pull/724) README.md: add custom HTTP Headers example. (@tcort) +- [#719](https://github.com/request/request/pull/719) Made a comment gender neutral. (@oztu) +- [#715](https://github.com/request/request/pull/715) Request.multipart no longer crashes when header 'Content-type' present (@pastaclub) +- [#710](https://github.com/request/request/pull/710) Fixing listing in callback part of docs. (@lukasz-zak) +- [#696](https://github.com/request/request/pull/696) Edited README.md for formatting and clarity of phrasing (@Zearin) +- [#694](https://github.com/request/request/pull/694) Typo in README (@VRMink) +- [#690](https://github.com/request/request/pull/690) Handle blank password in basic auth. (@diversario) +- [#682](https://github.com/request/request/pull/682) Optional dependencies (@Turbo87) +- [#683](https://github.com/request/request/pull/683) Travis CI support (@Turbo87) +- [#674](https://github.com/request/request/pull/674) change cookie module,to tough-cookie.please check it . (@sxyizhiren) +- [#666](https://github.com/request/request/pull/666) make `ciphers` and `secureProtocol` to work in https request (@richarddong) +- [#656](https://github.com/request/request/pull/656) Test case for #304. (@diversario) +- [#662](https://github.com/request/request/pull/662) option.tunnel to explicitly disable tunneling (@seanmonstar) +- [#659](https://github.com/request/request/pull/659) fix failure when running with NODE_DEBUG=request, and a test for that (@jrgm) +- [#630](https://github.com/request/request/pull/630) Send random cnonce for HTTP Digest requests (@wprl) + +### v2.27.0 (2013/08/15) +- [#619](https://github.com/request/request/pull/619) decouple things a bit (@joaojeronimo) + +### v2.26.0 (2013/08/07) +- [#613](https://github.com/request/request/pull/613) Fixes #583, moved initialization of self.uri.pathname (@lexander) +- [#605](https://github.com/request/request/pull/605) Only include ":" + pass in Basic Auth if it's defined (fixes #602) (@bendrucker) + +### v2.24.0 (2013/07/23) +- [#596](https://github.com/request/request/pull/596) Global agent is being used when pool is specified (@Cauldrath) +- [#594](https://github.com/request/request/pull/594) Emit complete event when there is no callback (@RomainLK) +- [#601](https://github.com/request/request/pull/601) Fixed a small typo (@michalstanko) + +### v2.23.0 (2013/07/23) +- [#589](https://github.com/request/request/pull/589) Prevent setting headers after they are sent (@geek) +- [#587](https://github.com/request/request/pull/587) Global cookie jar disabled by default (@threepointone) + +### v2.22.0 (2013/07/05) +- [#544](https://github.com/request/request/pull/544) Update http-signature version. (@davidlehn) +- [#581](https://github.com/request/request/pull/581) Fix spelling of "ignoring." (@bigeasy) +- [#568](https://github.com/request/request/pull/568) use agentOptions to create agent when specified in request (@SamPlacette) +- [#564](https://github.com/request/request/pull/564) Fix redirections (@criloz) +- [#541](https://github.com/request/request/pull/541) The exported request function doesn't have an auth method (@tschaub) +- [#542](https://github.com/request/request/pull/542) Expose Request class (@regality) + +### v2.21.0 (2013/04/30) +- [#536](https://github.com/request/request/pull/536) Allow explicitly empty user field for basic authentication. (@mikeando) +- [#532](https://github.com/request/request/pull/532) fix typo (@fredericosilva) +- [#497](https://github.com/request/request/pull/497) Added redirect event (@Cauldrath) +- [#503](https://github.com/request/request/pull/503) Fix basic auth for passwords that contain colons (@tonistiigi) +- [#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) +- [#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) +- [#510](https://github.com/request/request/pull/510) Add HTTP Signature support. (@davidlehn) +- [#502](https://github.com/request/request/pull/502) Fix POST (and probably other) requests that are retried after 401 Unauthorized (@nylen) +- [#508](https://github.com/request/request/pull/508) Honor the .strictSSL option when using proxies (tunnel-agent) (@jhs) +- [#512](https://github.com/request/request/pull/512) Make password optional to support the format: http://username@hostname/ (@pajato1) +- [#513](https://github.com/request/request/pull/513) add 'localAddress' support (@yyfrankyy) +- [#498](https://github.com/request/request/pull/498) Moving response emit above setHeaders on destination streams (@kenperkins) +- [#490](https://github.com/request/request/pull/490) Empty response body (3-rd argument) must be passed to callback as an empty string (@Olegas) +- [#479](https://github.com/request/request/pull/479) Changing so if Accept header is explicitly set, sending json does not ov... (@RoryH) +- [#475](https://github.com/request/request/pull/475) Use `unescape` from `querystring` (@shimaore) +- [#473](https://github.com/request/request/pull/473) V0.10 compat (@isaacs) +- [#471](https://github.com/request/request/pull/471) Using querystring library from visionmedia (@kbackowski) +- [#461](https://github.com/request/request/pull/461) Strip the UTF8 BOM from a UTF encoded response (@kppullin) +- [#460](https://github.com/request/request/pull/460) hawk 0.10.0 (@hueniverse) +- [#462](https://github.com/request/request/pull/462) if query params are empty, then request path shouldn't end with a '?' (merges cleanly now) (@jaipandya) +- [#456](https://github.com/request/request/pull/456) hawk 0.9.0 (@hueniverse) +- [#429](https://github.com/request/request/pull/429) Copy options before adding callback. (@nrn) +- [#454](https://github.com/request/request/pull/454) Destroy the response if present when destroying the request (clean merge) (@mafintosh) +- [#310](https://github.com/request/request/pull/310) Twitter Oauth Stuff Out of Date; Now Updated (@joemccann) +- [#413](https://github.com/request/request/pull/413) rename googledoodle.png to .jpg (@nfriedly) +- [#448](https://github.com/request/request/pull/448) Convenience method for PATCH (@mloar) +- [#444](https://github.com/request/request/pull/444) protect against double callbacks on error path (@spollack) +- [#433](https://github.com/request/request/pull/433) Added support for HTTPS cert & key (@mmalecki) +- [#430](https://github.com/request/request/pull/430) Respect specified {Host,host} headers, not just {host} (@andrewschaaf) +- [#415](https://github.com/request/request/pull/415) Fixed a typo. (@jerem) +- [#338](https://github.com/request/request/pull/338) Add more auth options, including digest support (@nylen) +- [#403](https://github.com/request/request/pull/403) Optimize environment lookup to happen once only (@mmalecki) +- [#398](https://github.com/request/request/pull/398) Add more reporting to tests (@mmalecki) +- [#388](https://github.com/request/request/pull/388) Ensure "safe" toJSON doesn't break EventEmitters (@othiym23) +- [#381](https://github.com/request/request/pull/381) Resolving "Invalid signature. Expected signature base string: " (@landeiro) +- [#380](https://github.com/request/request/pull/380) Fixes missing host header on retried request when using forever agent (@mac-) +- [#376](https://github.com/request/request/pull/376) Headers lost on redirect (@kapetan) +- [#375](https://github.com/request/request/pull/375) Fix for missing oauth_timestamp parameter (@jplock) +- [#374](https://github.com/request/request/pull/374) Correct Host header for proxy tunnel CONNECT (@youurayy) +- [#370](https://github.com/request/request/pull/370) Twitter reverse auth uses x_auth_mode not x_auth_type (@drudge) +- [#369](https://github.com/request/request/pull/369) Don't remove x_auth_mode for Twitter reverse auth (@drudge) +- [#344](https://github.com/request/request/pull/344) Make AWS auth signing find headers correctly (@nlf) +- [#363](https://github.com/request/request/pull/363) rfc3986 on base_uri, now passes tests (@jeffmarshall) +- [#362](https://github.com/request/request/pull/362) Running `rfc3986` on `base_uri` in `oauth.hmacsign` instead of just `encodeURIComponent` (@jeffmarshall) +- [#361](https://github.com/request/request/pull/361) Don't create a Content-Length header if we already have it set (@danjenkins) +- [#360](https://github.com/request/request/pull/360) Delete self._form along with everything else on redirect (@jgautier) +- [#355](https://github.com/request/request/pull/355) stop sending erroneous headers on redirected requests (@azylman) +- [#332](https://github.com/request/request/pull/332) Fix #296 - Only set Content-Type if body exists (@Marsup) +- [#343](https://github.com/request/request/pull/343) Allow AWS to work in more situations, added a note in the README on its usage (@nlf) +- [#320](https://github.com/request/request/pull/320) request.defaults() doesn't need to wrap jar() (@StuartHarris) +- [#322](https://github.com/request/request/pull/322) Fix + test for piped into request bumped into redirect. #321 (@alexindigo) +- [#326](https://github.com/request/request/pull/326) Do not try to remove listener from an undefined connection (@strk) +- [#318](https://github.com/request/request/pull/318) Pass servername to tunneling secure socket creation (@isaacs) +- [#317](https://github.com/request/request/pull/317) Workaround for #313 (@isaacs) +- [#293](https://github.com/request/request/pull/293) Allow parser errors to bubble up to request (@mscdex) +- [#290](https://github.com/request/request/pull/290) A test for #289 (@isaacs) +- [#280](https://github.com/request/request/pull/280) Like in node.js print options if NODE_DEBUG contains the word request (@Filirom1) +- [#207](https://github.com/request/request/pull/207) Fix #206 Change HTTP/HTTPS agent when redirecting between protocols (@isaacs) +- [#214](https://github.com/request/request/pull/214) documenting additional behavior of json option (@jphaas) +- [#272](https://github.com/request/request/pull/272) Boundary begins with CRLF? (@elspoono) +- [#284](https://github.com/request/request/pull/284) Remove stray `console.log()` call in multipart generator. (@bcherry) +- [#241](https://github.com/request/request/pull/241) Composability updates suggested by issue #239 (@polotek) +- [#282](https://github.com/request/request/pull/282) OAuth Authorization header contains non-"oauth_" parameters (@jplock) +- [#279](https://github.com/request/request/pull/279) fix tests with boundary by injecting boundry from header (@benatkin) +- [#273](https://github.com/request/request/pull/273) Pipe back pressure issue (@mafintosh) +- [#268](https://github.com/request/request/pull/268) I'm not OCD seriously (@TehShrike) +- [#263](https://github.com/request/request/pull/263) Bug in OAuth key generation for sha1 (@nanodocumet) +- [#265](https://github.com/request/request/pull/265) uncaughtException when redirected to invalid URI (@naholyr) +- [#262](https://github.com/request/request/pull/262) JSON test should check for equality (@timshadel) +- [#261](https://github.com/request/request/pull/261) Setting 'pool' to 'false' does NOT disable Agent pooling (@timshadel) +- [#249](https://github.com/request/request/pull/249) Fix for the fix of your (closed) issue #89 where self.headers[content-length] is set to 0 for all methods (@sethbridges) +- [#255](https://github.com/request/request/pull/255) multipart allow body === '' ( the empty string ) (@Filirom1) +- [#260](https://github.com/request/request/pull/260) fixed just another leak of 'i' (@sreuter) +- [#246](https://github.com/request/request/pull/246) Fixing the set-cookie header (@jeromegn) +- [#243](https://github.com/request/request/pull/243) Dynamic boundary (@zephrax) +- [#240](https://github.com/request/request/pull/240) don't error when null is passed for options (@polotek) +- [#211](https://github.com/request/request/pull/211) Replace all occurrences of special chars in RFC3986 (@chriso) +- [#224](https://github.com/request/request/pull/224) Multipart content-type change (@janjongboom) +- [#217](https://github.com/request/request/pull/217) need to use Authorization (titlecase) header with Tumblr OAuth (@visnup) +- [#203](https://github.com/request/request/pull/203) Fix cookie and redirect bugs and add auth support for HTTPS tunnel (@milewise) +- [#199](https://github.com/request/request/pull/199) Tunnel (@isaacs) +- [#198](https://github.com/request/request/pull/198) Bugfix on forever usage of util.inherits (@isaacs) +- [#197](https://github.com/request/request/pull/197) Make ForeverAgent work with HTTPS (@isaacs) +- [#193](https://github.com/request/request/pull/193) Fixes GH-119 (@goatslacker) +- [#188](https://github.com/request/request/pull/188) Add abort support to the returned request (@itay) +- [#176](https://github.com/request/request/pull/176) Querystring option (@csainty) +- [#182](https://github.com/request/request/pull/182) Fix request.defaults to support (uri, options, callback) api (@twilson63) +- [#180](https://github.com/request/request/pull/180) Modified the post, put, head and del shortcuts to support uri optional param (@twilson63) +- [#179](https://github.com/request/request/pull/179) fix to add opts in .pipe(stream, opts) (@substack) +- [#177](https://github.com/request/request/pull/177) Issue #173 Support uri as first and optional config as second argument (@twilson63) +- [#170](https://github.com/request/request/pull/170) can't create a cookie in a wrapped request (defaults) (@fabianonunes) +- [#168](https://github.com/request/request/pull/168) Picking off an EasyFix by adding some missing mimetypes. (@serby) +- [#161](https://github.com/request/request/pull/161) Fix cookie jar/headers.cookie collision (#125) (@papandreou) +- [#162](https://github.com/request/request/pull/162) Fix issue #159 (@dpetukhov) +- [#90](https://github.com/request/request/pull/90) add option followAllRedirects to follow post/put redirects (@jroes) +- [#148](https://github.com/request/request/pull/148) Retry Agent (@thejh) +- [#146](https://github.com/request/request/pull/146) Multipart should respect content-type if previously set (@apeace) +- [#144](https://github.com/request/request/pull/144) added "form" option to readme (@petejkim) +- [#133](https://github.com/request/request/pull/133) Fixed cookies parsing (@afanasy) +- [#135](https://github.com/request/request/pull/135) host vs hostname (@iangreenleaf) +- [#132](https://github.com/request/request/pull/132) return the body as a Buffer when encoding is set to null (@jahewson) +- [#112](https://github.com/request/request/pull/112) Support using a custom http-like module (@jhs) +- [#104](https://github.com/request/request/pull/104) Cookie handling contains bugs (@janjongboom) +- [#121](https://github.com/request/request/pull/121) Another patch for cookie handling regression (@jhurliman) +- [#117](https://github.com/request/request/pull/117) Remove the global `i` (@3rd-Eden) +- [#110](https://github.com/request/request/pull/110) Update to Iris Couch URL (@jhs) +- [#86](https://github.com/request/request/pull/86) Can't post binary to multipart requests (@developmentseed) +- [#105](https://github.com/request/request/pull/105) added test for proxy option. (@dominictarr) +- [#102](https://github.com/request/request/pull/102) Implemented cookies - closes issue 82: https://github.com/mikeal/request/issues/82 (@alessioalex) +- [#97](https://github.com/request/request/pull/97) Typo in previous pull causes TypeError in non-0.5.11 versions (@isaacs) +- [#96](https://github.com/request/request/pull/96) Authless parsed url host support (@isaacs) +- [#81](https://github.com/request/request/pull/81) Enhance redirect handling (@danmactough) +- [#78](https://github.com/request/request/pull/78) Don't try to do strictSSL for non-ssl connections (@isaacs) +- [#76](https://github.com/request/request/pull/76) Bug when a request fails and a timeout is set (@Marsup) +- [#70](https://github.com/request/request/pull/70) add test script to package.json (@isaacs) +- [#73](https://github.com/request/request/pull/73) Fix #71 Respect the strictSSL flag (@isaacs) +- [#69](https://github.com/request/request/pull/69) Flatten chunked requests properly (@isaacs) +- [#67](https://github.com/request/request/pull/67) fixed global variable leaks (@aheckmann) +- [#66](https://github.com/request/request/pull/66) Do not overwrite established content-type headers for read stream deliver (@voodootikigod) +- [#53](https://github.com/request/request/pull/53) Parse json: Issue #51 (@benatkin) +- [#45](https://github.com/request/request/pull/45) Added timeout option (@mbrevoort) +- [#35](https://github.com/request/request/pull/35) The "end" event isn't emitted for some responses (@voxpelli) +- [#31](https://github.com/request/request/pull/31) Error on piping a request to a destination (@tobowers) \ No newline at end of file diff --git a/node_modules/bower/node_modules/bower-registry-client/node_modules/request/CONTRIBUTING.md b/node_modules/bower/node_modules/bower-registry-client/node_modules/request/CONTRIBUTING.md new file mode 100644 index 0000000..06b1968 --- /dev/null +++ b/node_modules/bower/node_modules/bower-registry-client/node_modules/request/CONTRIBUTING.md @@ -0,0 +1,44 @@ +# This is an OPEN Open Source Project + +----------------------------------------- + +## What? + +Individuals making significant and valuable contributions are given +commit-access to the project to contribute as they see fit. This project is +more like an open wiki than a standard guarded open source project. + +## Rules + +There are a few basic ground-rules for contributors: + +1. **No `--force` pushes** or modifying the Git history in any way. +1. **Non-master branches** ought to be used for ongoing work. +1. **External API changes and significant modifications** ought to be subject + to an **internal pull-request** to solicit feedback from other contributors. +1. Internal pull-requests to solicit feedback are *encouraged* for any other + non-trivial contribution but left to the discretion of the contributor. +1. For significant changes wait a full 24 hours before merging so that active + contributors who are distributed throughout the world have a chance to weigh + in. +1. Contributors should attempt to adhere to the prevailing code-style. +1. Run `npm test` locally before submitting your PR, to catch any easy to miss + style & testing issues. To diagnose test failures, there are two ways to + run a single test file: + - `node_modules/.bin/taper tests/test-file.js` - run using the default + [`taper`](https://github.com/nylen/taper) test reporter. + - `node tests/test-file.js` - view the raw + [tap](https://testanything.org/) output. + + +## Releases + +Declaring formal releases remains the prerogative of the project maintainer. + +## Changes to this arrangement + +This is an experiment and feedback is welcome! This document may also be +subject to pull-requests or changes by contributors where you believe you have +something valuable to add or change. + +----------------------------------------- diff --git a/node_modules/bower/node_modules/bower-registry-client/node_modules/request/README.md b/node_modules/bower/node_modules/bower-registry-client/node_modules/request/README.md index 712bbe1..59d62c2 100644 --- a/node_modules/bower/node_modules/bower-registry-client/node_modules/request/README.md +++ b/node_modules/bower/node_modules/bower-registry-client/node_modules/request/README.md @@ -1,6 +1,7 @@ -# Request -- Simplified HTTP client +# Request — Simplified HTTP client +[![NPM](https://nodei.co/npm/request.png?downloads=true&downloadRank=true&stars=true)](https://nodei.co/npm/request/) -[![NPM](https://nodei.co/npm/request.png)](https://nodei.co/npm/request/) +[![Gitter](https://badges.gitter.im/Join Chat.svg)](https://gitter.im/request/request?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) ## Super simple to use @@ -23,19 +24,42 @@ You can stream any response to a file stream. request('http://google.com/doodle.png').pipe(fs.createWriteStream('doodle.png')) ``` -You can also stream a file to a PUT or POST request. This method will also check the file extension against a mapping of file extensions to content-types, in this case `application/json`, and use the proper content-type in the PUT request if one is not already provided in the headers. +You can also stream a file to a PUT or POST request. This method will also check the file extension against a mapping of file extensions to content-types (in this case `application/json`) and use the proper `content-type` in the PUT request (if the headers don’t already provide one). ```javascript fs.createReadStream('file.json').pipe(request.put('http://mysite.com/obj.json')) ``` -Request can also pipe to itself. When doing so the content-type and content-length will be preserved in the PUT headers. +Request can also `pipe` to itself. When doing so, `content-type` and `content-length` are preserved in the PUT headers. ```javascript request.get('http://google.com/img.png').pipe(request.put('http://mysite.com/img.png')) ``` -Now let's get fancy. +Request emits a "response" event when a response is received. The `response` argument will be an instance of [http.IncomingMessage](http://nodejs.org/api/http.html#http_http_incomingmessage). + +```javascript +request + .get('http://google.com/img.png') + .on('response', function(response) { + console.log(response.statusCode) // 200 + console.log(response.headers['content-type']) // 'image/png' + }) + .pipe(request.put('http://mysite.com/img.png')) +``` + +To easily handle errors when streaming requests, listen to the `error` event before piping: + +```javascript +request + .get('http://mysite.com/doodle.png') + .on('error', function(err) { + console.log(err) + }) + .pipe(fs.createWriteStream('doodle.png')) +``` + +Now let’s get fancy. ```javascript http.createServer(function (req, resp) { @@ -49,7 +73,7 @@ http.createServer(function (req, resp) { }) ``` -You can also pipe() from a http.ServerRequest instance and to a http.ServerResponse instance. The HTTP method and headers will be sent as well as the entity-body data. Which means that, if you don't really care about security, you can do: +You can also `pipe()` from `http.ServerRequest` instances, as well as to `http.ServerResponse` instances. The HTTP method, headers, and entity-body data will be sent. Which means that, if you don't really care about security, you can do: ```javascript http.createServer(function (req, resp) { @@ -61,7 +85,7 @@ http.createServer(function (req, resp) { }) ``` -And since pipe() returns the destination stream in node 0.5.x you can do one line proxying :) +And since `pipe()` returns the destination stream in ≥ Node 0.5.x you can do one line proxying. :) ```javascript req.pipe(request('http://mysite.com/doodle.png')).pipe(resp) @@ -78,30 +102,233 @@ http.createServer(function (req, resp) { } }) ``` + You can still use intermediate proxies, the requests will still follow HTTP forwards, etc. +## Proxies + +If you specify a `proxy` option, then the request (and any subsequent +redirects) will be sent via a connection to the proxy server. + +If your endpoint is an `https` url, and you are using a proxy, then +request will send a `CONNECT` request to the proxy server *first*, and +then use the supplied connection to connect to the endpoint. + +That is, first it will make a request like: + +``` +HTTP/1.1 CONNECT endpoint-server.com:80 +Host: proxy-server.com +User-Agent: whatever user agent you specify +``` + +and then the proxy server make a TCP connection to `endpoint-server` +on port `80`, and return a response that looks like: + +``` +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) +for more information. + +By default, when proxying `http` traffic, request will simply make a +standard proxied `http` request. This is done by making the `url` +section of the initial line of the request a fully qualified url to +the endpoint. + +For example, it will make a single request that looks like: + +``` +HTTP/1.1 GET http://endpoint-server.com/some-url +Host: proxy-server.com +Other-Headers: all go here + +request body or whatever +``` + +Because a pure "http over http" tunnel offers no additional security +or other features, it is generally simpler to go with a +straightforward HTTP proxy in this case. However, if you would like +to force a tunneling proxy, you may set the `tunnel` option to `true`. + +If you are using a tunneling proxy, you may set the +`proxyHeaderWhiteList` to share certain headers with the proxy. + +You can also set the `proxyHeaderExclusiveList` to share certain +headers only with the proxy and not with destination host. + +By default, this set is: + +``` +accept +accept-charset +accept-encoding +accept-language +accept-ranges +cache-control +content-encoding +content-language +content-length +content-location +content-md5 +content-range +content-type +connection +date +expect +max-forwards +pragma +proxy-authorization +referer +te +transfer-encoding +user-agent +via +``` + +Note that, when using a tunneling proxy, the `proxy-authorization` +header and any headers from custom `proxyHeaderExclusiveList` are +*never* sent to the endpoint server, but only to the proxy server. + +### Controlling proxy behaviour using environment variables + +The following environment variables are respected by `request`: + + * `HTTP_PROXY` / `http_proxy` + * `HTTPS_PROXY` / `https_proxy` + * `NO_PROXY` / `no_proxy` + +When `HTTP_PROXY` / `http_proxy` are set, they will be used to proxy non-SSL requests that do not have an explicit `proxy` configuration option present. Similarly, `HTTPS_PROXY` / `https_proxy` will be respected for SSL requests that do not have an explicit `proxy` configuration option. It is valid to define a proxy in one of the environment variables, but then override it for a specific request, using the `proxy` configuration option. Furthermore, the `proxy` configuration option can be explicitly set to false / null to opt out of proxying altogether for that request. + +`request` is also aware of the `NO_PROXY`/`no_proxy` environment variables. These variables provide a granular way to opt out of proxying, on a per-host basis. It should contain a comma separated list of hosts to opt out of proxying. It is also possible to opt of proxying when a particular destination port is used. Finally, the variable may be set to `*` to opt out of the implicit proxy configuration of the other environment variables. + +Here's some examples of valid `no_proxy` values: + + * `google.com` - don't proxy HTTP/HTTPS requests to Google. + * `google.com:443` - don't proxy HTTPS requests to Google, but *do* proxy HTTP requests to Google. + * `google.com:443, yahoo.com:80` - don't proxy HTTPS requests to Google, and don't proxy HTTP requests to Yahoo! + * `*` - ignore `https_proxy`/`http_proxy` environment variables altogether. + +## UNIX Socket + +`request` supports making requests to [UNIX Domain Sockets](http://en.wikipedia.org/wiki/Unix_domain_socket). To make one, use the following URL scheme: + +```javascript +/* Pattern */ 'http://unix:SOCKET:PATH' +/* Example */ request.get('http://unix:/absolute/path/to/unix.socket:/request/path') +``` + +Note: The `SOCKET` path is assumed to be absolute to the root of the host file system. + + ## Forms `request` supports `application/x-www-form-urlencoded` and `multipart/form-data` form uploads. For `multipart/related` refer to the `multipart` API. -Url encoded forms are simple +#### application/x-www-form-urlencoded (URL-Encoded Forms) + +URL-encoded forms are simple. ```javascript request.post('http://service.com/upload', {form:{key:'value'}}) // or request.post('http://service.com/upload').form({key:'value'}) +// or +request.post({url:'http://service.com/upload', form: {key:'value'}}, function(err,httpResponse,body){ /* ... */ }) ``` -For `multipart/form-data` we use the [form-data](https://github.com/felixge/node-form-data) library by [@felixge](https://github.com/felixge). You don't need to worry about piping the form object or setting the headers, `request` will handle that for you. +#### 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. + ```javascript -var r = request.post('http://service.com/upload') -var form = r.form() -form.append('my_field', 'my_value') -form.append('my_buffer', new Buffer([1, 2, 3])) -form.append('my_file', fs.createReadStream(path.join(__dirname, 'doodle.png')) -form.append('remote_file', request('http://google.com/doodle.png')) +var formData = { + // Pass a simple key-value pair + my_field: 'my_value', + // Pass data via Buffers + my_buffer: new Buffer([1, 2, 3]), + // Pass data via Streams + my_file: fs.createReadStream(__dirname + '/unicycle.jpg'), + // Pass multiple values /w an Array + attachments: [ + fs.createReadStream(__dirname + '/attachment1.jpg'), + fs.createReadStream(__dirname + '/attachment2.jpg') + ], + // 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 + custom_file: { + value: fs.createReadStream('/dev/urandom'), + options: { + filename: 'topsecret.jpg', + contentType: 'image/jpg' + } + } +}; +request.post({url:'http://service.com/upload', formData: formData}, function optionalCallback(err, httpResponse, body) { + if (err) { + return console.error('upload failed:', err); + } + console.log('Upload successful! Server responded with:', body); +}); +``` + +For advanced cases, you can access the form-data object itself via `r.form()`. This can be modified until the request is fired on the next cycle of the event-loop. (Note that this calling `form()` will clear the currently set form data for that request.) + +```javascript +// NOTE: Advanced use-case, for normal use see 'formData' usage above +var r = request.post('http://service.com/upload', function optionalCallback(err, httpResponse, body) { // ... + +var form = r.form(); +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. + +#### multipart/related + +Some variations in different HTTP implementations require a newline/CRLF before, after, or both before and after the boundary of a `multipart/related` request (using the multipart option). This has been observed in the .NET WebAPI version 4.0. You can turn on a boundary preambleCRLF or postamble by passing them as `true` to your request options. + +```javascript + request({ + method: 'PUT', + preambleCRLF: true, + postambleCRLF: true, + uri: 'http://service.com/upload', + multipart: [ + { + 'content-type': 'application/json' + body: JSON.stringify({foo: 'bar', _attachments: {'message.txt': {follows: true, length: 18, 'content_type': 'text/plain' }}}) + }, + { body: 'I am an attachment' }, + { body: fs.createReadStream('image.png') } + ], + // alternatively pass an object containing additional options + multipart: { + chunked: false, + data: [ + { + 'content-type': 'application/json', + body: JSON.stringify({foo: 'bar', _attachments: {'message.txt': {follows: true, length: 18, 'content_type': 'text/plain' }}}) + }, + { body: 'I am an attachment' } + ] + } + }, + function (error, response, body) { + if (error) { + return console.error('upload failed:', error); + } + console.log('Upload successful! Server responded with:', body); + }) +``` + ## HTTP Authentication @@ -115,16 +342,43 @@ request.get('http://some.server.com/', { 'sendImmediately': false } }); +// or +request.get('http://some.server.com/').auth(null, null, true, 'bearerToken'); +// or +request.get('http://some.server.com/', { + 'auth': { + 'bearer': 'bearerToken' + } +}); ``` -If passed as an option, `auth` should be a hash containing values `user` || `username`, `password` || `pass`, and `sendImmediately` (optional). The method form takes parameters `auth(username, password, sendImmediately)`. +If passed as an option, `auth` should be a hash containing values `user` || `username`, `pass` || `password`, and `sendImmediately` (optional). The method form takes parameters `auth(username, password, sendImmediately)`. + +`sendImmediately` defaults to `true`, which causes a basic authentication header to be sent. If `sendImmediately` is `false`, then `request` will retry with a proper authentication header after receiving a `401` response from the server (which must contain a `WWW-Authenticate` header indicating the required authentication method). + +Note that you can also use for basic authentication a trick using the URL itself, as specified in [RFC 1738](http://www.ietf.org/rfc/rfc1738.txt). +Simply pass the `user:password` before the host with an `@` sign. + +```javascript +var username = 'username', + password = 'password', + url = 'http://' + username + ':' + password + '@some.server.com'; + +request({url: url}, function (error, response, body) { + // Do more stuff with 'body' here +}); +``` -`sendImmediately` defaults to true, which will cause a basic authentication header to be sent. If `sendImmediately` is `false`, then `request` will retry with a proper authentication header after receiving a 401 response from the server (which must contain a `WWW-Authenticate` header indicating the required authentication method). +Digest authentication is supported, but it only works with `sendImmediately` set to `false`; otherwise `request` will send basic authentication on the initial request, which will probably cause the request to fail. -Digest authentication is supported, but it only works with `sendImmediately` set to `false` (otherwise `request` will send basic authentication on the initial request, which will probably cause the request to fail). +Bearer authentication is supported, and is activated when the `bearer` value is available. The value may be either a `String` or a `Function` returning a `String`. Using a function to supply the bearer token is particularly useful if used in conjuction with `defaults` to allow a single function to supply the last known token at the time or sending a request or to compute one on the fly. ## OAuth Signing +[OAuth version 1.0](https://tools.ietf.org/html/rfc5849) is supported. The +default signing algorithm is +[HMAC-SHA1](https://tools.ietf.org/html/rfc5849#section-3.4.2): + ```javascript // Twitter OAuth var qs = require('querystring') @@ -157,7 +411,7 @@ request.post({url:url, oauth:oauth}, function (e, r, body) { , token: perm_token.oauth_token , token_secret: perm_token.oauth_token_secret } - , url = 'https://api.twitter.com/1/users/show.json?' + , url = 'https://api.twitter.com/1.1/users/show.json?' , params = { screen_name: perm_token.screen_name , user_id: perm_token.user_id @@ -171,39 +425,160 @@ request.post({url:url, oauth:oauth}, function (e, r, body) { }) ``` +For [RSA-SHA1 signing](https://tools.ietf.org/html/rfc5849#section-3.4.3), make +the following changes to the OAuth options object: +* Pass `signature_method : 'RSA-SHA1'` +* Instead of `consumer_secret`, specify a `private_key` string in + [PEM format](http://how2ssl.com/articles/working_with_pem_files/) + +## Custom HTTP Headers + +HTTP Headers, such as `User-Agent`, can be set in the `options` object. +In the example below, we call the github API to find out the number +of stars and forks for the request repository. This requires a +custom `User-Agent` header as well as https. + +```javascript +var request = require('request'); + +var options = { + url: 'https://api.github.com/repos/request/request', + headers: { + 'User-Agent': 'request' + } +}; + +function callback(error, response, body) { + if (!error && response.statusCode == 200) { + var info = JSON.parse(body); + console.log(info.stargazers_count + " Stars"); + console.log(info.forks_count + " Forks"); + } +} + +request(options, callback); +``` +## TLS/SSL Protocol -### request(options, callback) +TLS/SSL Protocol options, such as `cert`, `key` and `passphrase`, can be +set in the `agentOptions` property of the `options` object. +In the example below, we call an API requires client side SSL certificate +(in PEM format) with passphrase protected private key (in PEM format) and disable the SSLv3 protocol: -The first argument can be either a url or an options object. The only required option is uri, all others are optional. +```javascript +var fs = require('fs') + , path = require('path') + , certFile = path.resolve(__dirname, 'ssl/client.crt') + , keyFile = path.resolve(__dirname, 'ssl/client.key') + , request = require('request'); + +var options = { + url: 'https://api.some-server.com/', + agentOptions: { + cert: fs.readFileSync(certFile), + key: fs.readFileSync(keyFile), + // Or use `pfx` property replacing `cert` and `key` when using private key, certificate and CA certs in PFX or PKCS12 format: + // pfx: fs.readFileSync(pfxFilePath), + passphrase: 'password', + securityOptions: 'SSL_OP_NO_SSLv3' + } +}; -* `uri` || `url` - fully qualified uri or a parsed url object from url.parse() -* `qs` - object containing querystring values to be appended to the uri -* `method` - http method, defaults to GET -* `headers` - http headers, defaults to {} -* `body` - entity body for PATCH, POST and PUT requests. Must be buffer or string. -* `form` - when passed an object this will set `body` but to a querystring representation of value and adds `Content-type: application/x-www-form-urlencoded; charset=utf-8` header. When passed no option a FormData instance is returned that will be piped to request. -* `auth` - A hash containing values `user` || `username`, `password` || `pass`, and `sendImmediately` (optional). See documentation above. -* `json` - sets `body` but to JSON representation of value and adds `Content-type: application/json` header. Additionally, parses the response body as json. -* `multipart` - (experimental) array of objects which contains their own headers and `body` attribute. Sends `multipart/related` request. See example below. -* `followRedirect` - follow HTTP 3xx responses as redirects. defaults to true. -* `followAllRedirects` - follow non-GET HTTP 3xx responses as redirects. defaults to false. -* `maxRedirects` - the maximum number of redirects to follow, defaults to 10. -* `encoding` - Encoding to be used on `setEncoding` of response data. If set to `null`, the body is returned as a Buffer. -* `pool` - A hash object containing the agents for these requests. If omitted this request will use the global pool which is set to node's default maxSockets. -* `pool.maxSockets` - Integer containing the maximum amount of sockets in the pool. +request.get(options); +``` + +It is able to force using SSLv3 only by specifying `secureProtocol`: + +```javascript +request.get({ + url: 'https://api.some-server.com/', + agentOptions: { + secureProtocol: 'SSLv3_method' + } +}); +``` + +It is possible to accept other certificates than those signed by generally allowed Certificate Authorities (CAs). +This can be useful, for example, when using self-signed certificates. +To allow a different certificate, you can specify the signing CA by adding the contents of the CA's certificate file to the `agentOptions`: + +```javascript +request.get({ + url: 'https://api.some-server.com/', + agentOptions: { + ca: fs.readFileSync('ca.cert.pem') + } +}); +``` + +## request(options, callback) + +The first argument can be either a `url` or an `options` object. The only required option is `uri`; all others are optional. + +* `uri` || `url` - fully qualified uri or a parsed url object from `url.parse()` +* `qs` - object containing querystring values to be appended to the `uri` +* `useQuerystring` - If true, use `querystring` to stringify and parse + querystrings, otherwise use `qs` (default: `false`). Set this option to + `true` if you need arrays to be serialized as `foo=bar&foo=baz` instead of the + default `foo[0]=bar&foo[1]=baz`. +* `method` - http method (default: `"GET"`) +* `headers` - http headers (default: `{}`) +* `body` - entity body for PATCH, POST and PUT requests. Must be a `Buffer` or `String`, unless `json` is `true`. If `json` is `true`, then `body` must be a JSON-serializable object. +* `form` - when passed an object or a querystring, this sets `body` to a querystring representation of value, and adds `Content-type: application/x-www-form-urlencoded` header. When passed no options, a `FormData` instance is returned (and is piped to request). See "Forms" section above. +* `formData` - Data to pass for a `multipart/form-data` request. See + [Forms](#forms) section above. +* `multipart` - array of objects which contain their own headers and `body` + attributes. Sends a `multipart/related` request. See [Forms](#forms) section + above. + * Alternatively you can pass in an object `{chunked: false, data: []}` where + `chunked` is used to specify whether the request is sent in + [chunked transfer encoding](https://en.wikipedia.org/wiki/Chunked_transfer_encoding) + (the default is `chunked: true`). In non-chunked requests, data items with + body streams are not allowed. +* `auth` - A hash containing values `user` || `username`, `pass` || `password`, and `sendImmediately` (optional). See documentation above. +* `json` - sets `body` but to JSON representation of value and adds `Content-type: application/json` header. Additionally, parses the response body as JSON. +* `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. +* `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. +* `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`) +* `encoding` - Encoding to be used on `setEncoding` of response data. If `null`, the `body` is returned as a `Buffer`. Anything else **(including the default value of `undefined`)** will be passed as the [encoding](http://nodejs.org/api/buffer.html#buffer_buffer) parameter to `toString()` (meaning this is effectively `utf8` by default). +* `pool` - An object describing which agents to use for the request. If this option is omitted the request will use the global agent (as long as [your options allow for it](request.js#L747)). Otherwise, request will search the pool for your custom agent. If no custom agent is found, a new agent will be created and added to the pool. + * A `maxSockets` property can also be provided on the `pool` object to set the max number of sockets for all agents created (ex: `pool: {maxSockets: Infinity}`). + * Note that if you are sending multiple requests in a loop and creating + multiple new `pool` objects, `maxSockets` will not work as intended. To + work around this, either use [`request.defaults`](#requestdefaultsoptions) + with your pool options or create the pool object with the `maxSockets` + property outside of the loop. * `timeout` - Integer containing the number of milliseconds to wait for a request to respond before aborting the request -* `proxy` - An HTTP proxy to be used. Support proxy Auth with Basic Auth the same way it's supported with the `url` parameter by embedding the auth info in the uri. -* `oauth` - Options for OAuth HMAC-SHA1 signing, see documentation above. +* `proxy` - An HTTP proxy to be used. Supports proxy Auth with Basic Auth, identical to support for the `url` parameter (by embedding the auth info in the `uri`) +* `oauth` - Options for OAuth HMAC-SHA1 signing. See documentation above. * `hawk` - Options for [Hawk signing](https://github.com/hueniverse/hawk). The `credentials` key must contain the necessary signing info, [see hawk docs for details](https://github.com/hueniverse/hawk#usage-example). -* `strictSSL` - Set to `true` to require that SSL certificates be valid. Note: to use your own certificate authority, you need to specify an agent that was created with that ca as an option. -* `jar` - Set to `true` if you want cookies to be remembered for future use, or define your custom cookie jar (see examples section) -* `aws` - object containing aws signing information, should have the properties `key` and `secret` as well as `bucket` unless you're specifying your bucket as part of the path, or you are making a request that doesn't use a bucket (i.e. GET Services) +* `strictSSL` - If `true`, requires SSL certificates be valid. **Note:** to use your own certificate authority, you need to specify an agent that was created with that CA as an option. +* `agentOptions` - Object containing user agent options. See documentation above. **Note:** [see tls API doc for TLS/SSL options](http://nodejs.org/api/tls.html#tls_tls_connect_options_callback). + +* `jar` - If `true` and `tough-cookie` is installed, remember cookies for future use (or define your custom cookie jar; see examples section) +* `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) * `httpSignature` - Options for the [HTTP Signature Scheme](https://github.com/joyent/node-http-signature/blob/master/http_signing.md) using [Joyent's library](https://github.com/joyent/node-http-signature). The `keyId` and `key` properties must be specified. See the docs for other options. * `localAddress` - Local interface to bind for network connections. +* `gzip` - If `true`, add an `Accept-Encoding` header to request compressed content encodings from the server (if not already present) and decode supported content encodings in the response. **Note:** Automatic decoding of the response content is performed on the body data returned through `request` (both through the `request` stream and passed to the callback function) but is not performed on the `response` stream (available from the `response` event) which is the unmodified `http.IncomingMessage` object which may contain compressed data. See example below. +* `tunnel` - If `true`, then *always* use a tunneling proxy. If + `false` (default), then tunneling will only be used if the + destination is `https`, or if a previous request in the redirect + chain used a tunneling proxy. +* `proxyHeaderWhiteList` - A whitelist of headers to send to a + tunneling proxy. +* `proxyHeaderExclusiveList` - A whitelist of headers to send + exclusively to a tunneling proxy and not to destination. -The callback argument gets 3 arguments. The first is an error when applicable (usually from the http.Client option not the http.ClientRequest object). The second is an http.ClientResponse object. The third is the response body String or Buffer. +The callback argument gets 3 arguments: + +1. An `error` when applicable (usually from [`http.ClientRequest`](http://nodejs.org/api/http.html#http_class_http_clientrequest) object) +2. An [`http.IncomingMessage`](http://nodejs.org/api/http.html#http_http_incomingmessage) object +3. The third is the `response` body (`String` or `Buffer`, or JSON object if the `json` option is supplied) ## Convenience methods @@ -211,11 +586,32 @@ There are also shorthand methods for different HTTP METHODs and some other conve ### request.defaults(options) -This method returns a wrapper around the normal request API that defaults to whatever options you pass in to it. +This method **returns a wrapper** around the normal request API that defaults +to whatever options you pass to it. + +**Note:** `request.defaults()` **does not** modify the global request API; +instead, it **returns a wrapper** that has your default settings applied to it. + +**Note:** You can call `.defaults()` on the wrapper that is returned from +`request.defaults` to add/override defaults that were previously defaulted. + +For example: +```javascript +//requests using baseRequest() will set the 'x-token' header +var baseRequest = request.defaults({ + headers: {x-token: 'my-token'} +}) + +//requests using specialRequest() will include the 'x-token' header set in +//baseRequest and will also include the 'special' header +var specialRequest = baseRequest.defaults({ + headers: {special: 'special value'} +}) +``` ### request.put -Same as request() but defaults to `method: "PUT"`. +Same as `request()`, but defaults to `method: "PUT"`. ```javascript request.put(url) @@ -223,7 +619,7 @@ request.put(url) ### request.patch -Same as request() but defaults to `method: "PATCH"`. +Same as `request()`, but defaults to `method: "PATCH"`. ```javascript request.patch(url) @@ -231,7 +627,7 @@ request.patch(url) ### request.post -Same as request() but defaults to `method: "POST"`. +Same as `request()`, but defaults to `method: "POST"`. ```javascript request.post(url) @@ -247,7 +643,7 @@ request.head(url) ### request.del -Same as request() but defaults to `method: "DELETE"`. +Same as `request()`, but defaults to `method: "DELETE"`. ```javascript request.del(url) @@ -255,7 +651,7 @@ request.del(url) ### request.get -Alias to normal request method for uniformity. +Same as `request()` (for uniformity). ```javascript request.get(url) @@ -265,9 +661,9 @@ request.get(url) Function that creates a new cookie. ```javascript -request.cookie('cookie_string_here') +request.cookie('key1=value1') ``` -### request.jar +### request.jar() Function that creates a new cookie jar. @@ -302,7 +698,39 @@ request.jar() } ) ``` -Cookies are disabled by default (else, they would be used in subsequent requests). To enable cookies set jar to true (either in defaults or in the options sent). + +For backwards-compatibility, response compression is not supported by default. +To accept gzip-compressed responses, set the `gzip` option to `true`. Note +that the body data passed through `request` is automatically decompressed +while the response object is unmodified and will contain compressed data if +the server sent a compressed response. + +```javascript + var request = require('request') + request( + { method: 'GET' + , uri: 'http://www.google.com' + , gzip: true + } + , function (error, response, body) { + // body is the decompressed response body + console.log('server encoded the data as: ' + (response.headers['content-encoding'] || 'identity')) + console.log('the decoded data is: ' + body) + } + ).on('data', function(data) { + // decompressed data as it is received + console.log('decoded chunk: ' + data) + }) + .on('response', function(response) { + // unmodified http.IncomingMessage object + response.on('data', function(data) { + // compressed data as it is received + console.log('received ' + data.length + ' bytes of compressed data') + }) + }) +``` + +Cookies are disabled by default (else, they would be used in subsequent requests). To enable cookies, set `jar` to `true` (either in `defaults` or `options`) and install `tough-cookie`. ```javascript var request = request.defaults({jar: true}) @@ -311,7 +739,7 @@ request('http://www.google.com', function () { }) ``` -If you to use a custom cookie jar (instead of letting request use its own global cookie jar) you do so by setting the jar default or by specifying it as an option: +To use a custom cookie jar (instead of `request`’s global cookie jar), set `jar` to an instance of `request.jar()` (either in `defaults` or `options`) ```javascript var j = request.jar() @@ -320,13 +748,60 @@ request('http://www.google.com', function () { request('http://images.google.com') }) ``` + OR +```javascript +var j = request.jar(); +var cookie = request.cookie('key1=value1'); +var url = 'http://www.google.com'; +j.setCookie(cookie, url); +request({url: url, jar: j}, function () { + request('http://images.google.com') +}) +``` + +To use a custom cookie store (such as a +[`FileCookieStore`](https://github.com/mitsuru/tough-cookie-filestore) +which supports saving to and restoring from JSON files), pass it as a parameter +to `request.jar()`: + +```javascript +var FileCookieStore = require('tough-cookie-filestore'); +// NOTE - currently the 'cookies.json' file must already exist! +var j = request.jar(new FileCookieStore('cookies.json')); +request = request.defaults({ jar : j }) +request('http://www.google.com', function() { + request('http://images.google.com') +}) +``` + +The cookie store must be a +[`tough-cookie`](https://github.com/goinstant/tough-cookie) +store and it must support synchronous operations; see the +[`CookieStore` API docs](https://github.com/goinstant/tough-cookie/#cookiestore-api) +for details. + +To inspect your cookie jar after a request: + ```javascript var j = request.jar() -var cookie = request.cookie('your_cookie_here') -j.add(cookie) request({url: 'http://www.google.com', jar: j}, function () { - request('http://images.google.com') + var cookie_string = j.getCookieString(uri); // "key1=value1; key2=value2; ..." + var cookies = j.getCookies(uri); + // [{key: 'key1', value: 'value1', domain: "www.google.com", ...}, ...] }) ``` + +## Debugging + +There are at least three ways to debug the operation of `request`: + +1. Launch the node process like `NODE_DEBUG=request node script.js` + (`lib,request,otherlib` works too). + +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 + view request and response headers and bodies. diff --git a/node_modules/bower/node_modules/bower-registry-client/node_modules/request/disabled.appveyor.yml b/node_modules/bower/node_modules/bower-registry-client/node_modules/request/disabled.appveyor.yml new file mode 100644 index 0000000..238f3d6 --- /dev/null +++ b/node_modules/bower/node_modules/bower-registry-client/node_modules/request/disabled.appveyor.yml @@ -0,0 +1,36 @@ +# http://www.appveyor.com/docs/appveyor-yml + +# Fix line endings in Windows. (runs before repo cloning) +init: + - git config --global core.autocrlf input + +# Test against these versions of Node.js. +environment: + matrix: + - nodejs_version: "0.10" + - nodejs_version: "0.8" + - nodejs_version: "0.11" + +# Allow failing jobs for bleeding-edge Node.js versions. +matrix: + allow_failures: + - nodejs_version: "0.11" + +# Install scripts. (runs after repo cloning) +install: + # Get the latest stable version of Node 0.STABLE.latest + - ps: Update-NodeJsInstallation (Get-NodeJsLatestBuild $env:nodejs_version) + # Typical npm stuff. + - npm install + +# Post-install test scripts. +test_script: + # Output useful info for debugging. + - ps: "npm test # PowerShell" # Pass comment to PS for easier debugging + - cmd: npm test + +# Don't actually build. +build: off + +# Set build version format here instead of in the admin panel. +version: "{build}" diff --git a/node_modules/bower/node_modules/bower-registry-client/node_modules/request/examples/README.md b/node_modules/bower/node_modules/bower-registry-client/node_modules/request/examples/README.md new file mode 100644 index 0000000..526d71b --- /dev/null +++ b/node_modules/bower/node_modules/bower-registry-client/node_modules/request/examples/README.md @@ -0,0 +1,115 @@ + +# Authentication + +## OAuth + +### OAuth1.0 Refresh Token + +- http://oauth.googlecode.com/svn/spec/ext/session/1.0/drafts/1/spec.html#anchor4 +- https://developer.yahoo.com/oauth/guide/oauth-refreshaccesstoken.html + +```js +request.post('https://api.login.yahoo.com/oauth/v2/get_token', { + oauth: { + consumer_key: '...', + consumer_secret: '...', + token: '...', + token_secret: '...', + session_handle: '...' + } +}, function (err, res, body) { + var result = require('querystring').parse(body) + // assert.equal(typeof result, 'object') +}) +``` + +### OAuth2 Refresh Token + +- https://tools.ietf.org/html/draft-ietf-oauth-v2-31#section-6 + +```js +request.post('https://accounts.google.com/o/oauth2/token', { + form: { + grant_type: 'refresh_token', + client_id: '...', + client_secret: '...', + refresh_token: '...' + }, + json: true +}, function (err, res, body) { + // assert.equal(typeof body, 'object') +}) +``` + +# Multipart + +## multipart/form-data + +### Flickr Image Upload + +- https://www.flickr.com/services/api/upload.api.html + +```js +request.post('https://up.flickr.com/services/upload', { + oauth: { + consumer_key: '...', + consumer_secret: '...', + token: '...', + token_secret: '...' + }, + // all meta data should be included here for proper signing + qs: { + title: 'My cat is awesome', + description: 'Sent on ' + new Date(), + is_public: 1 + }, + // again the same meta data + the actual photo + formData: { + title: 'My cat is awesome', + description: 'Sent on ' + new Date(), + is_public: 1, + photo:fs.createReadStream('cat.png') + }, + json: true +}, function (err, res, body) { + // assert.equal(typeof body, 'object') +}) +``` + +# Streams + +## `POST` data + +Use Request as a Writable stream to easily `POST` Readable streams (like files, other HTTP requests, or otherwise). + +TL;DR: Pipe a Readable Stream onto Request via: + +``` +READABLE.pipe(request.post(URL)); +``` + +A more detailed example: + +```js +var fs = require('fs') + , path = require('path') + , http = require('http') + , request = require('request') + , TMP_FILE_PATH = path.join(path.sep, 'tmp', 'foo') +; + +// write a temporary file: +fs.writeFileSync(TMP_FILE_PATH, 'foo bar baz quk\n'); + +http.createServer(function(req, res) { + console.log('the server is receiving data!\n'); + req + .on('end', res.end.bind(res)) + .pipe(process.stdout) + ; +}).listen(3000).unref(); + +fs.createReadStream(TMP_FILE_PATH) + .pipe(request.post('http://127.0.0.1:3000')) +; +``` diff --git a/node_modules/bower/node_modules/bower-registry-client/node_modules/request/index.js b/node_modules/bower/node_modules/bower-registry-client/node_modules/request/index.js index 06b407d..99b8386 100755 --- a/node_modules/bower/node_modules/bower-registry-client/node_modules/request/index.js +++ b/node_modules/bower/node_modules/bower-registry-client/node_modules/request/index.js @@ -12,138 +12,165 @@ // See the License for the specific language governing permissions and // limitations under the License. -var Cookie = require('cookie-jar') - , CookieJar = Cookie.Jar - , cookieJar = new CookieJar +'use strict' - , copy = require('./lib/copy') - , Request = require('./request') - ; +var extend = require('util')._extend + , cookies = require('./lib/cookies') + , helpers = require('./lib/helpers') +var isFunction = helpers.isFunction + , constructObject = helpers.constructObject + , filterForCallback = helpers.filterForCallback + , constructOptionsFrom = helpers.constructOptionsFrom + , paramsHaveRequestBody = helpers.paramsHaveRequestBody // organize params for patch, post, put, head, del function initParams(uri, options, callback) { - if ((typeof options === 'function') && !callback) callback = options - if (options && typeof options === 'object') { - options.uri = uri - } else if (typeof uri === 'string') { - options = {uri:uri} - } else { - options = uri - uri = options.uri - } - return { uri: uri, options: options, callback: callback } + callback = filterForCallback([options, callback]) + options = constructOptionsFrom(uri, options) + + return constructObject() + .extend({callback: callback}) + .extend({options: options}) + .extend({uri: options.uri}) + .done() } function request (uri, options, callback) { - if (typeof uri === 'undefined') throw new Error('undefined is not a valid uri or options object.') - if ((typeof options === 'function') && !callback) callback = options - if (options && typeof options === 'object') { - options.uri = uri - } else if (typeof uri === 'string') { - options = {uri:uri} - } else { - options = uri + if (typeof uri === 'undefined') { + throw new Error('undefined is not a valid uri or options object.') } - options = copy(options) + var params = initParams(uri, options, callback) + options = params.options + options.callback = params.callback + options.uri = params.uri - if (callback) options.callback = callback - var r = new Request(options) - return r + return new request.Request(options) } -module.exports = request - -request.Request = Request; +function requester(params) { + if(typeof params.options._requester === 'function') { + return params.options._requester + } + return request +} -request.debug = process.env.NODE_DEBUG && /request/.test(process.env.NODE_DEBUG) +request.get = function (uri, options, callback) { + var params = initParams(uri, options, callback) + params.options.method = 'GET' + return requester(params)(params.uri || null, params.options, params.callback) +} -request.initParams = initParams +request.head = function (uri, options, callback) { + var params = initParams(uri, options, callback) + params.options.method = 'HEAD' -request.defaults = function (options, requester) { - var def = function (method) { - var d = function (uri, opts, callback) { - var params = initParams(uri, opts, callback) - for (var i in options) { - if (params.options[i] === undefined) params.options[i] = options[i] - } - if(typeof requester === 'function') { - if(method === request) { - method = requester - } else { - params.options._requester = requester - } - } - return method(params.options, params.callback) - } - return d + if (paramsHaveRequestBody(params)) { + throw new Error('HTTP HEAD requests MUST NOT include a request body.') } - var de = def(request) - de.get = def(request.get) - de.patch = def(request.patch) - de.post = def(request.post) - de.put = def(request.put) - de.head = def(request.head) - de.del = def(request.del) - de.cookie = def(request.cookie) - de.jar = request.jar - return de -} -request.forever = function (agentOptions, optionsArg) { - var options = {} - if (optionsArg) { - for (option in optionsArg) { - options[option] = optionsArg[option] - } - } - if (agentOptions) options.agentOptions = agentOptions - options.forever = true - return request.defaults(options) + return requester(params)(params.uri || null, params.options, params.callback) } -request.get = request request.post = function (uri, options, callback) { var params = initParams(uri, options, callback) params.options.method = 'POST' - return request(params.uri || null, params.options, params.callback) + return requester(params)(params.uri || null, params.options, params.callback) } + request.put = function (uri, options, callback) { var params = initParams(uri, options, callback) params.options.method = 'PUT' - return request(params.uri || null, params.options, params.callback) + return requester(params)(params.uri || null, params.options, params.callback) } + request.patch = function (uri, options, callback) { var params = initParams(uri, options, callback) params.options.method = 'PATCH' - return request(params.uri || null, params.options, params.callback) -} -request.head = function (uri, options, callback) { - var params = initParams(uri, options, callback) - params.options.method = 'HEAD' - if (params.options.body || - params.options.requestBodyStream || - (params.options.json && typeof params.options.json !== 'boolean') || - params.options.multipart) { - throw new Error("HTTP HEAD requests MUST NOT include a request body.") - } - return request(params.uri || null, params.options, params.callback) + return requester(params)(params.uri || null, params.options, params.callback) } + request.del = function (uri, options, callback) { var params = initParams(uri, options, callback) params.options.method = 'DELETE' - if(typeof params.options._requester === 'function') { - request = params.options._requester - } - return request(params.uri || null, params.options, params.callback) + return requester(params)(params.uri || null, params.options, params.callback) } -request.jar = function () { - return new CookieJar + +request.jar = function (store) { + return cookies.jar(store) } + request.cookie = function (str) { - if (str && str.uri) str = str.uri - if (typeof str !== 'string') throw new Error("The cookie function only accepts STRING as param") - return new Cookie(str) + return cookies.parse(str) +} + +request.defaults = function (options, requester) { + var self = this + var wrap = function (method) { + var headerlessOptions = function (options) { + options = extend({}, options) + delete options.headers + return options + } + + var getHeaders = function (params, options) { + return constructObject() + .extend(options.headers) + .extend(params.options.headers) + .done() + } + + return function (uri, opts, callback) { + var params = initParams(uri, opts, callback) + params.options = extend(headerlessOptions(options), params.options) + + if (options.headers) { + params.options.headers = getHeaders(params, options) + } + + if (isFunction(requester)) { + if (method === self) { + method = requester + } else { + params.options._requester = requester + } + } + + return method(params.options, params.callback) + } + } + + var defaults = wrap(self) + defaults.get = wrap(self.get) + defaults.patch = wrap(self.patch) + defaults.post = wrap(self.post) + defaults.put = wrap(self.put) + defaults.head = wrap(self.head) + defaults.del = wrap(self.del) + defaults.cookie = wrap(self.cookie) + defaults.jar = self.jar + defaults.defaults = self.defaults + return defaults +} + +request.forever = function (agentOptions, optionsArg) { + var options = constructObject() + if (optionsArg) { + options.extend(optionsArg) + } + if (agentOptions) { + options.agentOptions = agentOptions + } + + options.extend({forever: true}) + return request.defaults(options.done()) } + +// Exports + +module.exports = request +request.Request = require('./request') +request.debug = process.env.NODE_DEBUG && /\brequest\b/.test(process.env.NODE_DEBUG) +request.initParams = initParams diff --git a/node_modules/bower/node_modules/bower-registry-client/node_modules/request/lib/cookies.js b/node_modules/bower/node_modules/bower-registry-client/node_modules/request/lib/cookies.js new file mode 100644 index 0000000..adde7c6 --- /dev/null +++ b/node_modules/bower/node_modules/bower-registry-client/node_modules/request/lib/cookies.js @@ -0,0 +1,39 @@ +'use strict' + +var tough = require('tough-cookie') + +var Cookie = tough.Cookie + , CookieJar = tough.CookieJar + + +exports.parse = function(str) { + if (str && str.uri) { + str = str.uri + } + if (typeof str !== 'string') { + throw new Error('The cookie function only accepts STRING as param') + } + return Cookie.parse(str) +} + +// Adapt the sometimes-Async api of tough.CookieJar to our requirements +function RequestJar(store) { + var self = this + self._jar = new CookieJar(store) +} +RequestJar.prototype.setCookie = function(cookieOrStr, uri, options) { + var self = this + return self._jar.setCookieSync(cookieOrStr, uri, options || {}) +} +RequestJar.prototype.getCookieString = function(uri) { + var self = this + return self._jar.getCookieStringSync(uri) +} +RequestJar.prototype.getCookies = function(uri) { + var self = this + return self._jar.getCookiesSync(uri) +} + +exports.jar = function(store) { + return new RequestJar(store) +} diff --git a/node_modules/bower/node_modules/bower-registry-client/node_modules/request/lib/copy.js b/node_modules/bower/node_modules/bower-registry-client/node_modules/request/lib/copy.js index 56831ff..ad162a5 100644 --- a/node_modules/bower/node_modules/bower-registry-client/node_modules/request/lib/copy.js +++ b/node_modules/bower/node_modules/bower-registry-client/node_modules/request/lib/copy.js @@ -1,3 +1,5 @@ +'use strict' + module.exports = function copy (obj) { var o = {} @@ -5,4 +7,4 @@ function copy (obj) { o[i] = obj[i] }) return o -} \ No newline at end of file +} diff --git a/node_modules/bower/node_modules/bower-registry-client/node_modules/request/lib/debug.js b/node_modules/bower/node_modules/bower-registry-client/node_modules/request/lib/debug.js index 462259f..25e3ded 100644 --- a/node_modules/bower/node_modules/bower-registry-client/node_modules/request/lib/debug.js +++ b/node_modules/bower/node_modules/bower-registry-client/node_modules/request/lib/debug.js @@ -1,5 +1,11 @@ -module.exports = -function debug () { - if (/\brequest\b/.test(process.env.NODE_DEBUG)) +'use strict' + +var util = require('util') + , request = require('../index') + + +module.exports = function debug() { + if (request.debug) { console.error('REQUEST %s', util.format.apply(util, arguments)) -} \ No newline at end of file + } +} diff --git a/node_modules/bower/node_modules/bower-registry-client/node_modules/request/lib/getSafe.js b/node_modules/bower/node_modules/bower-registry-client/node_modules/request/lib/getSafe.js deleted file mode 100644 index 28e07ea..0000000 --- a/node_modules/bower/node_modules/bower-registry-client/node_modules/request/lib/getSafe.js +++ /dev/null @@ -1,34 +0,0 @@ -// Safe toJSON -module.exports = -function getSafe (self, uuid) { - if (typeof self === 'object' || typeof self === 'function') var safe = {} - if (Array.isArray(self)) var safe = [] - - var recurse = [] - - Object.defineProperty(self, uuid, {}) - - var attrs = Object.keys(self).filter(function (i) { - if (i === uuid) return false - if ( (typeof self[i] !== 'object' && typeof self[i] !== 'function') || self[i] === null) return true - return !(Object.getOwnPropertyDescriptor(self[i], uuid)) - }) - - - for (var i=0;i* + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/bl/README.md b/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/bl/README.md new file mode 100644 index 0000000..6b7fb6d --- /dev/null +++ b/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/bl/README.md @@ -0,0 +1,198 @@ +# bl *(BufferList)* + +**A Node.js Buffer list collector, reader and streamer thingy.** + +[![NPM](https://nodei.co/npm/bl.png?downloads=true&downloadRank=true)](https://nodei.co/npm/bl/) +[![NPM](https://nodei.co/npm-dl/bl.png?months=6&height=3)](https://nodei.co/npm/bl/) + +**bl** is a storage object for collections of Node Buffers, exposing them with the main Buffer readable API. Also works as a duplex stream so you can collect buffers from a stream that emits them and emit buffers to a stream that consumes them! + +The original buffers are kept intact and copies are only done as necessary. Any reads that require the use of a single original buffer will return a slice of that buffer only (which references the same memory as the original buffer). Reads that span buffers perform concatenation as required and return the results transparently. + +```js +const BufferList = require('bl') + +var bl = new BufferList() +bl.append(new Buffer('abcd')) +bl.append(new Buffer('efg')) +bl.append('hi') // bl will also accept & convert Strings +bl.append(new Buffer('j')) +bl.append(new Buffer([ 0x3, 0x4 ])) + +console.log(bl.length) // 12 + +console.log(bl.slice(0, 10).toString('ascii')) // 'abcdefghij' +console.log(bl.slice(3, 10).toString('ascii')) // 'defghij' +console.log(bl.slice(3, 6).toString('ascii')) // 'def' +console.log(bl.slice(3, 8).toString('ascii')) // 'defgh' +console.log(bl.slice(5, 10).toString('ascii')) // 'fghij' + +// or just use toString! +console.log(bl.toString()) // 'abcdefghij\u0003\u0004' +console.log(bl.toString('ascii', 3, 8)) // 'defgh' +console.log(bl.toString('ascii', 5, 10)) // 'fghij' + +// other standard Buffer readables +console.log(bl.readUInt16BE(10)) // 0x0304 +console.log(bl.readUInt16LE(10)) // 0x0403 +``` + +Give it a callback in the constructor and use it just like **[concat-stream](https://github.com/maxogden/node-concat-stream)**: + +```js +const bl = require('bl') + , fs = require('fs') + +fs.createReadStream('README.md') + .pipe(bl(function (err, data) { // note 'new' isn't strictly required + // `data` is a complete Buffer object containing the full data + console.log(data.toString()) + })) +``` + +Note that when you use the *callback* method like this, the resulting `data` parameter is a concatenation of all `Buffer` objects in the list. If you want to avoid the overhead of this concatenation (in cases of extreme performance consciousness), then avoid the *callback* method and just listen to `'end'` instead, like a standard Stream. + +Or to fetch a URL using [hyperquest](https://github.com/substack/hyperquest) (should work with [request](http://github.com/mikeal/request) and even plain Node http too!): +```js +const hyperquest = require('hyperquest') + , bl = require('bl') + , url = 'https://raw.github.com/rvagg/bl/master/README.md' + +hyperquest(url).pipe(bl(function (err, data) { + console.log(data.toString()) +})) +``` + +Or, use it as a readable stream to recompose a list of Buffers to an output source: + +```js +const BufferList = require('bl') + , fs = require('fs') + +var bl = new BufferList() +bl.append(new Buffer('abcd')) +bl.append(new Buffer('efg')) +bl.append(new Buffer('hi')) +bl.append(new Buffer('j')) + +bl.pipe(fs.createWriteStream('gibberish.txt')) +``` + +## API + + *
new BufferList([ callback ]) + * bl.length + * bl.append(buffer) + * bl.get(index) + * bl.slice([ start[, end ] ]) + * bl.copy(dest, [ destStart, [ srcStart [, srcEnd ] ] ]) + * bl.duplicate() + * bl.consume(bytes) + * bl.toString([encoding, [ start, [ end ]]]) + * bl.readDoubleBE(), bl.readDoubleLE(), bl.readFloatBE(), bl.readFloatLE(), bl.readInt32BE(), bl.readInt32LE(), bl.readUInt32BE(), bl.readUInt32LE(), bl.readInt16BE(), bl.readInt16LE(), bl.readUInt16BE(), bl.readUInt16LE(), bl.readInt8(), bl.readUInt8() + * Streams + +-------------------------------------------------------- + +### new BufferList([ callback | buffer | buffer array ]) +The constructor takes an optional callback, if supplied, the callback will be called with an error argument followed by a reference to the **bl** instance, when `bl.end()` is called (i.e. from a piped stream). This is a convenient method of collecting the entire contents of a stream, particularly when the stream is *chunky*, such as a network stream. + +Normally, no arguments are required for the constructor, but you can initialise the list by passing in a single `Buffer` object or an array of `Buffer` object. + +`new` is not strictly required, if you don't instantiate a new object, it will be done automatically for you so you can create a new instance simply with: + +```js +var bl = require('bl') +var myinstance = bl() + +// equivilant to: + +var BufferList = require('bl') +var myinstance = new BufferList() +``` + +-------------------------------------------------------- + +### bl.length +Get the length of the list in bytes. This is the sum of the lengths of all of the buffers contained in the list, minus any initial offset for a semi-consumed buffer at the beginning. Should accurately represent the total number of bytes that can be read from the list. + +-------------------------------------------------------- + +### bl.append(buffer) +`append(buffer)` adds an additional buffer or BufferList to the internal list. + +-------------------------------------------------------- + +### bl.get(index) +`get()` will return the byte at the specified index. + +-------------------------------------------------------- + +### bl.slice([ start, [ end ] ]) +`slice()` returns a new `Buffer` object containing the bytes within the range specified. Both `start` and `end` are optional and will default to the beginning and end of the list respectively. + +If the requested range spans a single internal buffer then a slice of that buffer will be returned which shares the original memory range of that Buffer. If the range spans multiple buffers then copy operations will likely occur to give you a uniform Buffer. + +-------------------------------------------------------- + +### bl.copy(dest, [ destStart, [ srcStart [, srcEnd ] ] ]) +`copy()` copies the content of the list in the `dest` buffer, starting from `destStart` and containing the bytes within the range specified with `srcStart` to `srcEnd`. `destStart`, `start` and `end` are optional and will default to the beginning of the `dest` buffer, and the beginning and end of the list respectively. + +-------------------------------------------------------- + +### bl.duplicate() +`duplicate()` performs a **shallow-copy** of the list. The internal Buffers remains the same, so if you change the underlying Buffers, the change will be reflected in both the original and the duplicate. This method is needed if you want to call `consume()` or `pipe()` and still keep the original list.Example: + +```js +var bl = new BufferList() + +bl.append('hello') +bl.append(' world') +bl.append('\n') + +bl.duplicate().pipe(process.stdout, { end: false }) + +console.log(bl.toString()) +``` + +-------------------------------------------------------- + +### bl.consume(bytes) +`consume()` will shift bytes *off the start of the list*. The number of bytes consumed don't need to line up with the sizes of the internal Buffers—initial offsets will be calculated accordingly in order to give you a consistent view of the data. + +-------------------------------------------------------- + +### bl.toString([encoding, [ start, [ end ]]]) +`toString()` will return a string representation of the buffer. The optional `start` and `end` arguments are passed on to `slice()`, while the `encoding` is passed on to `toString()` of the resulting Buffer. See the [Buffer#toString()](http://nodejs.org/docs/latest/api/buffer.html#buffer_buf_tostring_encoding_start_end) documentation for more information. + +-------------------------------------------------------- + +### bl.readDoubleBE(), bl.readDoubleLE(), bl.readFloatBE(), bl.readFloatLE(), bl.readInt32BE(), bl.readInt32LE(), bl.readUInt32BE(), bl.readUInt32LE(), bl.readInt16BE(), bl.readInt16LE(), bl.readUInt16BE(), bl.readUInt16LE(), bl.readInt8(), bl.readUInt8() + +All of the standard byte-reading methods of the `Buffer` interface are implemented and will operate across internal Buffer boundaries transparently. + +See the [Buffer](http://nodejs.org/docs/latest/api/buffer.html) documentation for how these work. + +-------------------------------------------------------- + +### Streams +**bl** is a Node **[Duplex Stream](http://nodejs.org/docs/latest/api/stream.html#stream_class_stream_duplex)**, so it can be read from and written to like a standard Node stream. You can also `pipe()` to and from a **bl** instance. + +-------------------------------------------------------- + +## Contributors + +**bl** is brought to you by the following hackers: + + * [Rod Vagg](https://github.com/rvagg) + * [Matteo Collina](https://github.com/mcollina) + * [Jarett Cruger](https://github.com/jcrugzz) + +======= + + +## License & copyright + +Copyright (c) 2013-2014 bl contributors (listed above). + +bl is licensed under the MIT license. All rights not explicitly granted in the MIT license are reserved. See the included LICENSE.md file for more details. diff --git a/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/bl/bl.js b/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/bl/bl.js new file mode 100644 index 0000000..7a2f997 --- /dev/null +++ b/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/bl/bl.js @@ -0,0 +1,216 @@ +var DuplexStream = require('readable-stream/duplex') + , util = require('util') + +function BufferList (callback) { + if (!(this instanceof BufferList)) + return new BufferList(callback) + + this._bufs = [] + this.length = 0 + + if (typeof callback == 'function') { + this._callback = callback + + var piper = function (err) { + if (this._callback) { + this._callback(err) + this._callback = null + } + }.bind(this) + + this.on('pipe', function (src) { + src.on('error', piper) + }) + this.on('unpipe', function (src) { + src.removeListener('error', piper) + }) + } + else if (Buffer.isBuffer(callback)) + this.append(callback) + else if (Array.isArray(callback)) { + callback.forEach(function (b) { + Buffer.isBuffer(b) && this.append(b) + }.bind(this)) + } + + DuplexStream.call(this) +} + +util.inherits(BufferList, DuplexStream) + +BufferList.prototype._offset = function (offset) { + var tot = 0, i = 0, _t + for (; i < this._bufs.length; i++) { + _t = tot + this._bufs[i].length + if (offset < _t) + return [ i, offset - tot ] + tot = _t + } +} + +BufferList.prototype.append = function (buf) { + var isBuffer = Buffer.isBuffer(buf) || + buf instanceof BufferList + + this._bufs.push(isBuffer ? buf : new Buffer(buf)) + this.length += buf.length + return this +} + +BufferList.prototype._write = function (buf, encoding, callback) { + this.append(buf) + if (callback) + callback() +} + +BufferList.prototype._read = function (size) { + if (!this.length) + return this.push(null) + size = Math.min(size, this.length) + this.push(this.slice(0, size)) + this.consume(size) +} + +BufferList.prototype.end = function (chunk) { + DuplexStream.prototype.end.call(this, chunk) + + if (this._callback) { + this._callback(null, this.slice()) + this._callback = null + } +} + +BufferList.prototype.get = function (index) { + return this.slice(index, index + 1)[0] +} + +BufferList.prototype.slice = function (start, end) { + return this.copy(null, 0, start, end) +} + +BufferList.prototype.copy = function (dst, dstStart, srcStart, srcEnd) { + if (typeof srcStart != 'number' || srcStart < 0) + srcStart = 0 + if (typeof srcEnd != 'number' || srcEnd > this.length) + srcEnd = this.length + if (srcStart >= this.length) + return dst || new Buffer(0) + if (srcEnd <= 0) + return dst || new Buffer(0) + + var copy = !!dst + , off = this._offset(srcStart) + , len = srcEnd - srcStart + , bytes = len + , bufoff = (copy && dstStart) || 0 + , start = off[1] + , l + , i + + // copy/slice everything + if (srcStart === 0 && srcEnd == this.length) { + if (!copy) // slice, just return a full concat + return Buffer.concat(this._bufs) + + // copy, need to copy individual buffers + for (i = 0; i < this._bufs.length; i++) { + this._bufs[i].copy(dst, bufoff) + bufoff += this._bufs[i].length + } + + return dst + } + + // easy, cheap case where it's a subset of one of the buffers + if (bytes <= this._bufs[off[0]].length - start) { + return copy + ? this._bufs[off[0]].copy(dst, dstStart, start, start + bytes) + : this._bufs[off[0]].slice(start, start + bytes) + } + + if (!copy) // a slice, we need something to copy in to + dst = new Buffer(len) + + for (i = off[0]; i < this._bufs.length; i++) { + l = this._bufs[i].length - start + + if (bytes > l) { + this._bufs[i].copy(dst, bufoff, start) + } else { + this._bufs[i].copy(dst, bufoff, start, start + bytes) + break + } + + bufoff += l + bytes -= l + + if (start) + start = 0 + } + + return dst +} + +BufferList.prototype.toString = function (encoding, start, end) { + return this.slice(start, end).toString(encoding) +} + +BufferList.prototype.consume = function (bytes) { + while (this._bufs.length) { + if (bytes > this._bufs[0].length) { + bytes -= this._bufs[0].length + this.length -= this._bufs[0].length + this._bufs.shift() + } else { + this._bufs[0] = this._bufs[0].slice(bytes) + this.length -= bytes + break + } + } + return this +} + +BufferList.prototype.duplicate = function () { + var i = 0 + , copy = new BufferList() + + for (; i < this._bufs.length; i++) + copy.append(this._bufs[i]) + + return copy +} + +BufferList.prototype.destroy = function () { + this._bufs.length = 0; + this.length = 0; + this.push(null); +} + +;(function () { + var methods = { + 'readDoubleBE' : 8 + , 'readDoubleLE' : 8 + , 'readFloatBE' : 4 + , 'readFloatLE' : 4 + , 'readInt32BE' : 4 + , 'readInt32LE' : 4 + , 'readUInt32BE' : 4 + , 'readUInt32LE' : 4 + , 'readInt16BE' : 2 + , 'readInt16LE' : 2 + , 'readUInt16BE' : 2 + , 'readUInt16LE' : 2 + , 'readInt8' : 1 + , 'readUInt8' : 1 + } + + for (var m in methods) { + (function (m) { + BufferList.prototype[m] = function (offset) { + return this.slice(offset, offset + methods[m])[m](0) + } + }(m)) + } +}()) + +module.exports = BufferList diff --git a/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/bl/node_modules/readable-stream/.npmignore b/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/bl/node_modules/readable-stream/.npmignore new file mode 100644 index 0000000..38344f8 --- /dev/null +++ b/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/bl/node_modules/readable-stream/.npmignore @@ -0,0 +1,5 @@ +build/ +test/ +examples/ +fs.js +zlib.js \ No newline at end of file diff --git a/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/bl/node_modules/readable-stream/LICENSE b/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/bl/node_modules/readable-stream/LICENSE new file mode 100644 index 0000000..e3d4e69 --- /dev/null +++ b/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/bl/node_modules/readable-stream/LICENSE @@ -0,0 +1,18 @@ +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 +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +IN THE SOFTWARE. diff --git a/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/bl/node_modules/readable-stream/README.md b/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/bl/node_modules/readable-stream/README.md new file mode 100644 index 0000000..3fb3e80 --- /dev/null +++ b/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/bl/node_modules/readable-stream/README.md @@ -0,0 +1,15 @@ +# readable-stream + +***Node-core streams for userland*** + +[![NPM](https://nodei.co/npm/readable-stream.png?downloads=true&downloadRank=true)](https://nodei.co/npm/readable-stream/) +[![NPM](https://nodei.co/npm-dl/readable-stream.png?&months=6&height=3)](https://nodei.co/npm/readable-stream/) + +This package is a mirror of the Streams2 and Streams3 implementations in Node-core. + +If you want to guarantee a stable streams base, regardless of what version of Node you, or the users of your libraries are using, use **readable-stream** *only* and avoid the *"stream"* module in Node-core. + +**readable-stream** comes in two major versions, v1.0.x and v1.1.x. The former tracks the Streams2 implementation in Node 0.10, including bug-fixes and minor improvements as they are added. The latter tracks Streams3 as it develops in Node 0.11; we will likely see a v1.2.x branch for Node 0.12. + +**readable-stream** uses proper patch-level versioning so if you pin to `"~1.0.0"` you’ll get the latest Node 0.10 Streams2 implementation, including any fixes and minor non-breaking improvements. The patch-level versions of 1.0.x and 1.1.x should mirror the patch-level versions of Node-core releases. You should prefer the **1.0.x** releases for now and when you’re ready to start using Streams3, pin to `"~1.1.0"` + diff --git a/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/bl/node_modules/readable-stream/duplex.js b/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/bl/node_modules/readable-stream/duplex.js new file mode 100644 index 0000000..ca807af --- /dev/null +++ b/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/bl/node_modules/readable-stream/duplex.js @@ -0,0 +1 @@ +module.exports = require("./lib/_stream_duplex.js") diff --git a/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/bl/node_modules/readable-stream/lib/_stream_duplex.js b/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/bl/node_modules/readable-stream/lib/_stream_duplex.js new file mode 100644 index 0000000..b513d61 --- /dev/null +++ b/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/bl/node_modules/readable-stream/lib/_stream_duplex.js @@ -0,0 +1,89 @@ +// Copyright Joyent, Inc. and other Node contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. + +// a duplex stream is just a stream that is both readable and writable. +// Since JS doesn't have multiple prototypal inheritance, this class +// prototypally inherits from Readable, and then parasitically from +// Writable. + +module.exports = Duplex; + +/**/ +var objectKeys = Object.keys || function (obj) { + var keys = []; + for (var key in obj) keys.push(key); + return keys; +} +/**/ + + +/**/ +var util = require('core-util-is'); +util.inherits = require('inherits'); +/**/ + +var Readable = require('./_stream_readable'); +var Writable = require('./_stream_writable'); + +util.inherits(Duplex, Readable); + +forEach(objectKeys(Writable.prototype), function(method) { + if (!Duplex.prototype[method]) + Duplex.prototype[method] = Writable.prototype[method]; +}); + +function Duplex(options) { + if (!(this instanceof Duplex)) + return new Duplex(options); + + Readable.call(this, options); + Writable.call(this, options); + + if (options && options.readable === false) + this.readable = false; + + if (options && options.writable === false) + this.writable = false; + + this.allowHalfOpen = true; + if (options && options.allowHalfOpen === false) + this.allowHalfOpen = false; + + this.once('end', onend); +} + +// the no-half-open enforcer +function onend() { + // if we allow half-open state, or if the writable side ended, + // then we're ok. + if (this.allowHalfOpen || this._writableState.ended) + return; + + // no more data can be written. + // But allow more writes to happen in this tick. + process.nextTick(this.end.bind(this)); +} + +function forEach (xs, f) { + for (var i = 0, l = xs.length; i < l; i++) { + f(xs[i], i); + } +} diff --git a/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/bl/node_modules/readable-stream/lib/_stream_passthrough.js b/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/bl/node_modules/readable-stream/lib/_stream_passthrough.js new file mode 100644 index 0000000..895ca50 --- /dev/null +++ b/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/bl/node_modules/readable-stream/lib/_stream_passthrough.js @@ -0,0 +1,46 @@ +// Copyright Joyent, Inc. and other Node contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. + +// a passthrough stream. +// basically just the most minimal sort of Transform stream. +// Every written chunk gets output as-is. + +module.exports = PassThrough; + +var Transform = require('./_stream_transform'); + +/**/ +var util = require('core-util-is'); +util.inherits = require('inherits'); +/**/ + +util.inherits(PassThrough, Transform); + +function PassThrough(options) { + if (!(this instanceof PassThrough)) + return new PassThrough(options); + + Transform.call(this, options); +} + +PassThrough.prototype._transform = function(chunk, encoding, cb) { + cb(null, chunk); +}; diff --git a/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/bl/node_modules/readable-stream/lib/_stream_readable.js b/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/bl/node_modules/readable-stream/lib/_stream_readable.js new file mode 100644 index 0000000..6307220 --- /dev/null +++ b/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/bl/node_modules/readable-stream/lib/_stream_readable.js @@ -0,0 +1,982 @@ +// Copyright Joyent, Inc. and other Node contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. + +module.exports = Readable; + +/**/ +var isArray = require('isarray'); +/**/ + + +/**/ +var Buffer = require('buffer').Buffer; +/**/ + +Readable.ReadableState = ReadableState; + +var EE = require('events').EventEmitter; + +/**/ +if (!EE.listenerCount) EE.listenerCount = function(emitter, type) { + return emitter.listeners(type).length; +}; +/**/ + +var Stream = require('stream'); + +/**/ +var util = require('core-util-is'); +util.inherits = require('inherits'); +/**/ + +var StringDecoder; + +util.inherits(Readable, Stream); + +function ReadableState(options, stream) { + options = options || {}; + + // the point at which it stops calling _read() to fill the buffer + // Note: 0 is a valid value, means "don't call _read preemptively ever" + var hwm = options.highWaterMark; + this.highWaterMark = (hwm || hwm === 0) ? hwm : 16 * 1024; + + // cast to ints. + this.highWaterMark = ~~this.highWaterMark; + + this.buffer = []; + this.length = 0; + this.pipes = null; + this.pipesCount = 0; + this.flowing = false; + this.ended = false; + this.endEmitted = false; + this.reading = false; + + // In streams that never have any data, and do push(null) right away, + // the consumer can miss the 'end' event if they do some I/O before + // consuming the stream. So, we don't emit('end') until some reading + // happens. + this.calledRead = false; + + // a flag to be able to tell if the onwrite cb is called immediately, + // or on a later tick. We set this to true at first, becuase any + // actions that shouldn't happen until "later" should generally also + // not happen before the first write call. + this.sync = true; + + // whenever we return null, then we set a flag to say + // that we're awaiting a 'readable' event emission. + this.needReadable = false; + this.emittedReadable = false; + this.readableListening = false; + + + // object stream flag. Used to make read(n) ignore n and to + // make all the buffer merging and length checks go away + this.objectMode = !!options.objectMode; + + // Crypto is kind of old and crusty. Historically, its default string + // encoding is 'binary' so we have to make this configurable. + // Everything else in the universe uses 'utf8', though. + this.defaultEncoding = options.defaultEncoding || 'utf8'; + + // when piping, we only care about 'readable' events that happen + // after read()ing all the bytes and not getting any pushback. + this.ranOut = false; + + // the number of writers that are awaiting a drain event in .pipe()s + this.awaitDrain = 0; + + // if true, a maybeReadMore has been scheduled + this.readingMore = false; + + this.decoder = null; + this.encoding = null; + if (options.encoding) { + if (!StringDecoder) + StringDecoder = require('string_decoder/').StringDecoder; + this.decoder = new StringDecoder(options.encoding); + this.encoding = options.encoding; + } +} + +function Readable(options) { + if (!(this instanceof Readable)) + return new Readable(options); + + this._readableState = new ReadableState(options, this); + + // legacy + this.readable = true; + + Stream.call(this); +} + +// Manually shove something into the read() buffer. +// This returns true if the highWaterMark has not been hit yet, +// similar to how Writable.write() returns true if you should +// write() some more. +Readable.prototype.push = function(chunk, encoding) { + var state = this._readableState; + + if (typeof chunk === 'string' && !state.objectMode) { + encoding = encoding || state.defaultEncoding; + if (encoding !== state.encoding) { + chunk = new Buffer(chunk, encoding); + encoding = ''; + } + } + + return readableAddChunk(this, state, chunk, encoding, false); +}; + +// Unshift should *always* be something directly out of read() +Readable.prototype.unshift = function(chunk) { + var state = this._readableState; + return readableAddChunk(this, state, chunk, '', true); +}; + +function readableAddChunk(stream, state, chunk, encoding, addToFront) { + var er = chunkInvalid(state, chunk); + if (er) { + stream.emit('error', er); + } else if (chunk === null || chunk === undefined) { + state.reading = false; + if (!state.ended) + onEofChunk(stream, state); + } else if (state.objectMode || chunk && chunk.length > 0) { + if (state.ended && !addToFront) { + var e = new Error('stream.push() after EOF'); + stream.emit('error', e); + } else if (state.endEmitted && addToFront) { + var e = new Error('stream.unshift() after end event'); + stream.emit('error', e); + } else { + if (state.decoder && !addToFront && !encoding) + chunk = state.decoder.write(chunk); + + // update the buffer info. + state.length += state.objectMode ? 1 : chunk.length; + if (addToFront) { + state.buffer.unshift(chunk); + } else { + state.reading = false; + state.buffer.push(chunk); + } + + if (state.needReadable) + emitReadable(stream); + + maybeReadMore(stream, state); + } + } else if (!addToFront) { + state.reading = false; + } + + return needMoreData(state); +} + + + +// if it's past the high water mark, we can push in some more. +// Also, if we have no data yet, we can stand some +// more bytes. This is to work around cases where hwm=0, +// such as the repl. Also, if the push() triggered a +// readable event, and the user called read(largeNumber) such that +// needReadable was set, then we ought to push more, so that another +// 'readable' event will be triggered. +function needMoreData(state) { + return !state.ended && + (state.needReadable || + state.length < state.highWaterMark || + state.length === 0); +} + +// backwards compatibility. +Readable.prototype.setEncoding = function(enc) { + if (!StringDecoder) + StringDecoder = require('string_decoder/').StringDecoder; + this._readableState.decoder = new StringDecoder(enc); + this._readableState.encoding = enc; +}; + +// Don't raise the hwm > 128MB +var MAX_HWM = 0x800000; +function roundUpToNextPowerOf2(n) { + if (n >= MAX_HWM) { + n = MAX_HWM; + } else { + // Get the next highest power of 2 + n--; + for (var p = 1; p < 32; p <<= 1) n |= n >> p; + n++; + } + return n; +} + +function howMuchToRead(n, state) { + if (state.length === 0 && state.ended) + return 0; + + if (state.objectMode) + return n === 0 ? 0 : 1; + + if (n === null || isNaN(n)) { + // only flow one buffer at a time + if (state.flowing && state.buffer.length) + return state.buffer[0].length; + else + return state.length; + } + + if (n <= 0) + return 0; + + // If we're asking for more than the target buffer level, + // then raise the water mark. Bump up to the next highest + // power of 2, to prevent increasing it excessively in tiny + // amounts. + if (n > state.highWaterMark) + state.highWaterMark = roundUpToNextPowerOf2(n); + + // don't have that much. return null, unless we've ended. + if (n > state.length) { + if (!state.ended) { + state.needReadable = true; + return 0; + } else + return state.length; + } + + return n; +} + +// you can override either this method, or the async _read(n) below. +Readable.prototype.read = function(n) { + var state = this._readableState; + state.calledRead = true; + var nOrig = n; + var ret; + + if (typeof n !== 'number' || n > 0) + state.emittedReadable = false; + + // if we're doing read(0) to trigger a readable event, but we + // already have a bunch of data in the buffer, then just trigger + // the 'readable' event and move on. + if (n === 0 && + state.needReadable && + (state.length >= state.highWaterMark || state.ended)) { + emitReadable(this); + return null; + } + + n = howMuchToRead(n, state); + + // if we've ended, and we're now clear, then finish it up. + if (n === 0 && state.ended) { + ret = null; + + // In cases where the decoder did not receive enough data + // to produce a full chunk, then immediately received an + // EOF, state.buffer will contain [, ]. + // howMuchToRead will see this and coerce the amount to + // read to zero (because it's looking at the length of the + // first in state.buffer), and we'll end up here. + // + // This can only happen via state.decoder -- no other venue + // exists for pushing a zero-length chunk into state.buffer + // and triggering this behavior. In this case, we return our + // remaining data and end the stream, if appropriate. + if (state.length > 0 && state.decoder) { + ret = fromList(n, state); + state.length -= ret.length; + } + + if (state.length === 0) + endReadable(this); + + return ret; + } + + // All the actual chunk generation logic needs to be + // *below* the call to _read. The reason is that in certain + // synthetic stream cases, such as passthrough streams, _read + // may be a completely synchronous operation which may change + // the state of the read buffer, providing enough data when + // before there was *not* enough. + // + // So, the steps are: + // 1. Figure out what the state of things will be after we do + // a read from the buffer. + // + // 2. If that resulting state will trigger a _read, then call _read. + // Note that this may be asynchronous, or synchronous. Yes, it is + // deeply ugly to write APIs this way, but that still doesn't mean + // that the Readable class should behave improperly, as streams are + // designed to be sync/async agnostic. + // Take note if the _read call is sync or async (ie, if the read call + // has returned yet), so that we know whether or not it's safe to emit + // 'readable' etc. + // + // 3. Actually pull the requested chunks out of the buffer and return. + + // if we need a readable event, then we need to do some reading. + var doRead = state.needReadable; + + // if we currently have less than the highWaterMark, then also read some + if (state.length - n <= state.highWaterMark) + doRead = true; + + // however, if we've ended, then there's no point, and if we're already + // reading, then it's unnecessary. + if (state.ended || state.reading) + doRead = false; + + if (doRead) { + state.reading = true; + state.sync = true; + // if the length is currently zero, then we *need* a readable event. + if (state.length === 0) + state.needReadable = true; + // call internal read method + this._read(state.highWaterMark); + state.sync = false; + } + + // If _read called its callback synchronously, then `reading` + // will be false, and we need to re-evaluate how much data we + // can return to the user. + if (doRead && !state.reading) + n = howMuchToRead(nOrig, state); + + if (n > 0) + ret = fromList(n, state); + else + ret = null; + + if (ret === null) { + state.needReadable = true; + n = 0; + } + + state.length -= n; + + // If we have nothing in the buffer, then we want to know + // as soon as we *do* get something into the buffer. + if (state.length === 0 && !state.ended) + state.needReadable = true; + + // If we happened to read() exactly the remaining amount in the + // buffer, and the EOF has been seen at this point, then make sure + // that we emit 'end' on the very next tick. + if (state.ended && !state.endEmitted && state.length === 0) + endReadable(this); + + return ret; +}; + +function chunkInvalid(state, chunk) { + var er = null; + if (!Buffer.isBuffer(chunk) && + 'string' !== typeof chunk && + chunk !== null && + chunk !== undefined && + !state.objectMode) { + er = new TypeError('Invalid non-string/buffer chunk'); + } + return er; +} + + +function onEofChunk(stream, state) { + if (state.decoder && !state.ended) { + var chunk = state.decoder.end(); + if (chunk && chunk.length) { + state.buffer.push(chunk); + state.length += state.objectMode ? 1 : chunk.length; + } + } + state.ended = true; + + // if we've ended and we have some data left, then emit + // 'readable' now to make sure it gets picked up. + if (state.length > 0) + emitReadable(stream); + else + endReadable(stream); +} + +// Don't emit readable right away in sync mode, because this can trigger +// another read() call => stack overflow. This way, it might trigger +// a nextTick recursion warning, but that's not so bad. +function emitReadable(stream) { + var state = stream._readableState; + state.needReadable = false; + if (state.emittedReadable) + return; + + state.emittedReadable = true; + if (state.sync) + process.nextTick(function() { + emitReadable_(stream); + }); + else + emitReadable_(stream); +} + +function emitReadable_(stream) { + stream.emit('readable'); +} + + +// at this point, the user has presumably seen the 'readable' event, +// and called read() to consume some data. that may have triggered +// in turn another _read(n) call, in which case reading = true if +// it's in progress. +// However, if we're not ended, or reading, and the length < hwm, +// then go ahead and try to read some more preemptively. +function maybeReadMore(stream, state) { + if (!state.readingMore) { + state.readingMore = true; + process.nextTick(function() { + maybeReadMore_(stream, state); + }); + } +} + +function maybeReadMore_(stream, state) { + var len = state.length; + while (!state.reading && !state.flowing && !state.ended && + state.length < state.highWaterMark) { + stream.read(0); + if (len === state.length) + // didn't get any data, stop spinning. + break; + else + len = state.length; + } + state.readingMore = false; +} + +// abstract method. to be overridden in specific implementation classes. +// call cb(er, data) where data is <= n in length. +// for virtual (non-string, non-buffer) streams, "length" is somewhat +// arbitrary, and perhaps not very meaningful. +Readable.prototype._read = function(n) { + this.emit('error', new Error('not implemented')); +}; + +Readable.prototype.pipe = function(dest, pipeOpts) { + var src = this; + var state = this._readableState; + + switch (state.pipesCount) { + case 0: + state.pipes = dest; + break; + case 1: + state.pipes = [state.pipes, dest]; + break; + default: + state.pipes.push(dest); + break; + } + state.pipesCount += 1; + + var doEnd = (!pipeOpts || pipeOpts.end !== false) && + dest !== process.stdout && + dest !== process.stderr; + + var endFn = doEnd ? onend : cleanup; + if (state.endEmitted) + process.nextTick(endFn); + else + src.once('end', endFn); + + dest.on('unpipe', onunpipe); + function onunpipe(readable) { + if (readable !== src) return; + cleanup(); + } + + function onend() { + dest.end(); + } + + // when the dest drains, it reduces the awaitDrain counter + // on the source. This would be more elegant with a .once() + // handler in flow(), but adding and removing repeatedly is + // too slow. + var ondrain = pipeOnDrain(src); + dest.on('drain', ondrain); + + function cleanup() { + // cleanup event handlers once the pipe is broken + dest.removeListener('close', onclose); + dest.removeListener('finish', onfinish); + dest.removeListener('drain', ondrain); + dest.removeListener('error', onerror); + dest.removeListener('unpipe', onunpipe); + src.removeListener('end', onend); + src.removeListener('end', cleanup); + + // if the reader is waiting for a drain event from this + // specific writer, then it would cause it to never start + // flowing again. + // So, if this is awaiting a drain, then we just call it now. + // If we don't know, then assume that we are waiting for one. + if (!dest._writableState || dest._writableState.needDrain) + ondrain(); + } + + // if the dest has an error, then stop piping into it. + // however, don't suppress the throwing behavior for this. + function onerror(er) { + unpipe(); + dest.removeListener('error', onerror); + if (EE.listenerCount(dest, 'error') === 0) + dest.emit('error', er); + } + // This is a brutally ugly hack to make sure that our error handler + // is attached before any userland ones. NEVER DO THIS. + if (!dest._events || !dest._events.error) + dest.on('error', onerror); + else if (isArray(dest._events.error)) + dest._events.error.unshift(onerror); + else + dest._events.error = [onerror, dest._events.error]; + + + + // Both close and finish should trigger unpipe, but only once. + function onclose() { + dest.removeListener('finish', onfinish); + unpipe(); + } + dest.once('close', onclose); + function onfinish() { + dest.removeListener('close', onclose); + unpipe(); + } + dest.once('finish', onfinish); + + function unpipe() { + src.unpipe(dest); + } + + // tell the dest that it's being piped to + dest.emit('pipe', src); + + // start the flow if it hasn't been started already. + if (!state.flowing) { + // the handler that waits for readable events after all + // the data gets sucked out in flow. + // This would be easier to follow with a .once() handler + // in flow(), but that is too slow. + this.on('readable', pipeOnReadable); + + state.flowing = true; + process.nextTick(function() { + flow(src); + }); + } + + return dest; +}; + +function pipeOnDrain(src) { + return function() { + var dest = this; + var state = src._readableState; + state.awaitDrain--; + if (state.awaitDrain === 0) + flow(src); + }; +} + +function flow(src) { + var state = src._readableState; + var chunk; + state.awaitDrain = 0; + + function write(dest, i, list) { + var written = dest.write(chunk); + if (false === written) { + state.awaitDrain++; + } + } + + while (state.pipesCount && null !== (chunk = src.read())) { + + if (state.pipesCount === 1) + write(state.pipes, 0, null); + else + forEach(state.pipes, write); + + src.emit('data', chunk); + + // if anyone needs a drain, then we have to wait for that. + if (state.awaitDrain > 0) + return; + } + + // if every destination was unpiped, either before entering this + // function, or in the while loop, then stop flowing. + // + // NB: This is a pretty rare edge case. + if (state.pipesCount === 0) { + state.flowing = false; + + // if there were data event listeners added, then switch to old mode. + if (EE.listenerCount(src, 'data') > 0) + emitDataEvents(src); + return; + } + + // at this point, no one needed a drain, so we just ran out of data + // on the next readable event, start it over again. + state.ranOut = true; +} + +function pipeOnReadable() { + if (this._readableState.ranOut) { + this._readableState.ranOut = false; + flow(this); + } +} + + +Readable.prototype.unpipe = function(dest) { + var state = this._readableState; + + // if we're not piping anywhere, then do nothing. + if (state.pipesCount === 0) + return this; + + // just one destination. most common case. + if (state.pipesCount === 1) { + // passed in one, but it's not the right one. + if (dest && dest !== state.pipes) + return this; + + if (!dest) + dest = state.pipes; + + // got a match. + state.pipes = null; + state.pipesCount = 0; + this.removeListener('readable', pipeOnReadable); + state.flowing = false; + if (dest) + dest.emit('unpipe', this); + return this; + } + + // slow case. multiple pipe destinations. + + if (!dest) { + // remove all. + var dests = state.pipes; + var len = state.pipesCount; + state.pipes = null; + state.pipesCount = 0; + this.removeListener('readable', pipeOnReadable); + state.flowing = false; + + for (var i = 0; i < len; i++) + dests[i].emit('unpipe', this); + return this; + } + + // try to find the right one. + var i = indexOf(state.pipes, dest); + if (i === -1) + return this; + + state.pipes.splice(i, 1); + state.pipesCount -= 1; + if (state.pipesCount === 1) + state.pipes = state.pipes[0]; + + dest.emit('unpipe', this); + + return this; +}; + +// set up data events if they are asked for +// Ensure readable listeners eventually get something +Readable.prototype.on = function(ev, fn) { + var res = Stream.prototype.on.call(this, ev, fn); + + if (ev === 'data' && !this._readableState.flowing) + emitDataEvents(this); + + if (ev === 'readable' && this.readable) { + var state = this._readableState; + if (!state.readableListening) { + state.readableListening = true; + state.emittedReadable = false; + state.needReadable = true; + if (!state.reading) { + this.read(0); + } else if (state.length) { + emitReadable(this, state); + } + } + } + + return res; +}; +Readable.prototype.addListener = Readable.prototype.on; + +// pause() and resume() are remnants of the legacy readable stream API +// If the user uses them, then switch into old mode. +Readable.prototype.resume = function() { + emitDataEvents(this); + this.read(0); + this.emit('resume'); +}; + +Readable.prototype.pause = function() { + emitDataEvents(this, true); + this.emit('pause'); +}; + +function emitDataEvents(stream, startPaused) { + var state = stream._readableState; + + if (state.flowing) { + // https://github.com/isaacs/readable-stream/issues/16 + throw new Error('Cannot switch to old mode now.'); + } + + var paused = startPaused || false; + var readable = false; + + // convert to an old-style stream. + stream.readable = true; + stream.pipe = Stream.prototype.pipe; + stream.on = stream.addListener = Stream.prototype.on; + + stream.on('readable', function() { + readable = true; + + var c; + while (!paused && (null !== (c = stream.read()))) + stream.emit('data', c); + + if (c === null) { + readable = false; + stream._readableState.needReadable = true; + } + }); + + stream.pause = function() { + paused = true; + this.emit('pause'); + }; + + stream.resume = function() { + paused = false; + if (readable) + process.nextTick(function() { + stream.emit('readable'); + }); + else + this.read(0); + this.emit('resume'); + }; + + // now make it start, just in case it hadn't already. + stream.emit('readable'); +} + +// wrap an old-style stream as the async data source. +// This is *not* part of the readable stream interface. +// It is an ugly unfortunate mess of history. +Readable.prototype.wrap = function(stream) { + var state = this._readableState; + var paused = false; + + var self = this; + stream.on('end', function() { + if (state.decoder && !state.ended) { + var chunk = state.decoder.end(); + if (chunk && chunk.length) + self.push(chunk); + } + + self.push(null); + }); + + stream.on('data', function(chunk) { + if (state.decoder) + chunk = state.decoder.write(chunk); + + // don't skip over falsy values in objectMode + //if (state.objectMode && util.isNullOrUndefined(chunk)) + if (state.objectMode && (chunk === null || chunk === undefined)) + return; + else if (!state.objectMode && (!chunk || !chunk.length)) + return; + + var ret = self.push(chunk); + if (!ret) { + paused = true; + stream.pause(); + } + }); + + // proxy all the other methods. + // important when wrapping filters and duplexes. + for (var i in stream) { + if (typeof stream[i] === 'function' && + typeof this[i] === 'undefined') { + this[i] = function(method) { return function() { + return stream[method].apply(stream, arguments); + }}(i); + } + } + + // proxy certain important events. + var events = ['error', 'close', 'destroy', 'pause', 'resume']; + forEach(events, function(ev) { + stream.on(ev, self.emit.bind(self, ev)); + }); + + // when we try to consume some more bytes, simply unpause the + // underlying stream. + self._read = function(n) { + if (paused) { + paused = false; + stream.resume(); + } + }; + + return self; +}; + + + +// exposed for testing purposes only. +Readable._fromList = fromList; + +// Pluck off n bytes from an array of buffers. +// Length is the combined lengths of all the buffers in the list. +function fromList(n, state) { + var list = state.buffer; + var length = state.length; + var stringMode = !!state.decoder; + var objectMode = !!state.objectMode; + var ret; + + // nothing in the list, definitely empty. + if (list.length === 0) + return null; + + if (length === 0) + ret = null; + else if (objectMode) + ret = list.shift(); + else if (!n || n >= length) { + // read it all, truncate the array. + if (stringMode) + ret = list.join(''); + else + ret = Buffer.concat(list, length); + list.length = 0; + } else { + // read just some of it. + if (n < list[0].length) { + // just take a part of the first list item. + // slice is the same for buffers and strings. + var buf = list[0]; + ret = buf.slice(0, n); + list[0] = buf.slice(n); + } else if (n === list[0].length) { + // first list is a perfect match + ret = list.shift(); + } else { + // complex case. + // we have enough to cover it, but it spans past the first buffer. + if (stringMode) + ret = ''; + else + ret = new Buffer(n); + + var c = 0; + for (var i = 0, l = list.length; i < l && c < n; i++) { + var buf = list[0]; + var cpy = Math.min(n - c, buf.length); + + if (stringMode) + ret += buf.slice(0, cpy); + else + buf.copy(ret, c, 0, cpy); + + if (cpy < buf.length) + list[0] = buf.slice(cpy); + else + list.shift(); + + c += cpy; + } + } + } + + return ret; +} + +function endReadable(stream) { + var state = stream._readableState; + + // If we get here before consuming all the bytes, then that is a + // bug in node. Should never happen. + if (state.length > 0) + throw new Error('endReadable called on non-empty stream'); + + if (!state.endEmitted && state.calledRead) { + state.ended = true; + process.nextTick(function() { + // Check that we didn't get one last unshift. + if (!state.endEmitted && state.length === 0) { + state.endEmitted = true; + stream.readable = false; + stream.emit('end'); + } + }); + } +} + +function forEach (xs, f) { + for (var i = 0, l = xs.length; i < l; i++) { + f(xs[i], i); + } +} + +function indexOf (xs, x) { + for (var i = 0, l = xs.length; i < l; i++) { + if (xs[i] === x) return i; + } + return -1; +} diff --git a/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/bl/node_modules/readable-stream/lib/_stream_transform.js b/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/bl/node_modules/readable-stream/lib/_stream_transform.js new file mode 100644 index 0000000..eb188df --- /dev/null +++ b/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/bl/node_modules/readable-stream/lib/_stream_transform.js @@ -0,0 +1,210 @@ +// Copyright Joyent, Inc. and other Node contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. + + +// a transform stream is a readable/writable stream where you do +// something with the data. Sometimes it's called a "filter", +// but that's not a great name for it, since that implies a thing where +// some bits pass through, and others are simply ignored. (That would +// be a valid example of a transform, of course.) +// +// While the output is causally related to the input, it's not a +// necessarily symmetric or synchronous transformation. For example, +// a zlib stream might take multiple plain-text writes(), and then +// emit a single compressed chunk some time in the future. +// +// Here's how this works: +// +// The Transform stream has all the aspects of the readable and writable +// stream classes. When you write(chunk), that calls _write(chunk,cb) +// internally, and returns false if there's a lot of pending writes +// buffered up. When you call read(), that calls _read(n) until +// there's enough pending readable data buffered up. +// +// In a transform stream, the written data is placed in a buffer. When +// _read(n) is called, it transforms the queued up data, calling the +// buffered _write cb's as it consumes chunks. If consuming a single +// written chunk would result in multiple output chunks, then the first +// outputted bit calls the readcb, and subsequent chunks just go into +// the read buffer, and will cause it to emit 'readable' if necessary. +// +// This way, back-pressure is actually determined by the reading side, +// since _read has to be called to start processing a new chunk. However, +// a pathological inflate type of transform can cause excessive buffering +// here. For example, imagine a stream where every byte of input is +// interpreted as an integer from 0-255, and then results in that many +// bytes of output. Writing the 4 bytes {ff,ff,ff,ff} would result in +// 1kb of data being output. In this case, you could write a very small +// amount of input, and end up with a very large amount of output. In +// such a pathological inflating mechanism, there'd be no way to tell +// the system to stop doing the transform. A single 4MB write could +// cause the system to run out of memory. +// +// However, even in such a pathological case, only a single written chunk +// would be consumed, and then the rest would wait (un-transformed) until +// the results of the previous transformed chunk were consumed. + +module.exports = Transform; + +var Duplex = require('./_stream_duplex'); + +/**/ +var util = require('core-util-is'); +util.inherits = require('inherits'); +/**/ + +util.inherits(Transform, Duplex); + + +function TransformState(options, stream) { + this.afterTransform = function(er, data) { + return afterTransform(stream, er, data); + }; + + this.needTransform = false; + this.transforming = false; + this.writecb = null; + this.writechunk = null; +} + +function afterTransform(stream, er, data) { + var ts = stream._transformState; + ts.transforming = false; + + var cb = ts.writecb; + + if (!cb) + return stream.emit('error', new Error('no writecb in Transform class')); + + ts.writechunk = null; + ts.writecb = null; + + if (data !== null && data !== undefined) + stream.push(data); + + if (cb) + cb(er); + + var rs = stream._readableState; + rs.reading = false; + if (rs.needReadable || rs.length < rs.highWaterMark) { + stream._read(rs.highWaterMark); + } +} + + +function Transform(options) { + if (!(this instanceof Transform)) + return new Transform(options); + + Duplex.call(this, options); + + var ts = this._transformState = new TransformState(options, this); + + // when the writable side finishes, then flush out anything remaining. + var stream = this; + + // start out asking for a readable event once data is transformed. + this._readableState.needReadable = true; + + // we have implemented the _read method, and done the other things + // that Readable wants before the first _read call, so unset the + // sync guard flag. + this._readableState.sync = false; + + this.once('finish', function() { + if ('function' === typeof this._flush) + this._flush(function(er) { + done(stream, er); + }); + else + done(stream); + }); +} + +Transform.prototype.push = function(chunk, encoding) { + this._transformState.needTransform = false; + return Duplex.prototype.push.call(this, chunk, encoding); +}; + +// This is the part where you do stuff! +// override this function in implementation classes. +// 'chunk' is an input chunk. +// +// Call `push(newChunk)` to pass along transformed output +// to the readable side. You may call 'push' zero or more times. +// +// Call `cb(err)` when you are done with this chunk. If you pass +// an error, then that'll put the hurt on the whole operation. If you +// never call cb(), then you'll never get another chunk. +Transform.prototype._transform = function(chunk, encoding, cb) { + throw new Error('not implemented'); +}; + +Transform.prototype._write = function(chunk, encoding, cb) { + var ts = this._transformState; + ts.writecb = cb; + ts.writechunk = chunk; + ts.writeencoding = encoding; + if (!ts.transforming) { + var rs = this._readableState; + if (ts.needTransform || + rs.needReadable || + rs.length < rs.highWaterMark) + this._read(rs.highWaterMark); + } +}; + +// Doesn't matter what the args are here. +// _transform does all the work. +// That we got here means that the readable side wants more data. +Transform.prototype._read = function(n) { + var ts = this._transformState; + + if (ts.writechunk !== null && ts.writecb && !ts.transforming) { + ts.transforming = true; + this._transform(ts.writechunk, ts.writeencoding, ts.afterTransform); + } else { + // mark that we need a transform, so that any data that comes in + // will get processed, now that we've asked for it. + ts.needTransform = true; + } +}; + + +function done(stream, er) { + if (er) + return stream.emit('error', er); + + // if there's nothing in the write buffer, then that means + // that nothing more will ever be provided + var ws = stream._writableState; + var rs = stream._readableState; + var ts = stream._transformState; + + if (ws.length) + throw new Error('calling transform done when ws.length != 0'); + + if (ts.transforming) + throw new Error('calling transform done when still transforming'); + + return stream.push(null); +} diff --git a/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/bl/node_modules/readable-stream/lib/_stream_writable.js b/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/bl/node_modules/readable-stream/lib/_stream_writable.js new file mode 100644 index 0000000..4bdaa4f --- /dev/null +++ b/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/bl/node_modules/readable-stream/lib/_stream_writable.js @@ -0,0 +1,386 @@ +// Copyright Joyent, Inc. and other Node contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. + +// A bit simpler than readable streams. +// Implement an async ._write(chunk, cb), and it'll handle all +// the drain event emission and buffering. + +module.exports = Writable; + +/**/ +var Buffer = require('buffer').Buffer; +/**/ + +Writable.WritableState = WritableState; + + +/**/ +var util = require('core-util-is'); +util.inherits = require('inherits'); +/**/ + +var Stream = require('stream'); + +util.inherits(Writable, Stream); + +function WriteReq(chunk, encoding, cb) { + this.chunk = chunk; + this.encoding = encoding; + this.callback = cb; +} + +function WritableState(options, stream) { + options = options || {}; + + // the point at which write() starts returning false + // Note: 0 is a valid value, means that we always return false if + // the entire buffer is not flushed immediately on write() + var hwm = options.highWaterMark; + this.highWaterMark = (hwm || hwm === 0) ? hwm : 16 * 1024; + + // object stream flag to indicate whether or not this stream + // contains buffers or objects. + this.objectMode = !!options.objectMode; + + // cast to ints. + this.highWaterMark = ~~this.highWaterMark; + + this.needDrain = false; + // at the start of calling end() + this.ending = false; + // when end() has been called, and returned + this.ended = false; + // when 'finish' is emitted + this.finished = false; + + // should we decode strings into buffers before passing to _write? + // this is here so that some node-core streams can optimize string + // handling at a lower level. + var noDecode = options.decodeStrings === false; + this.decodeStrings = !noDecode; + + // Crypto is kind of old and crusty. Historically, its default string + // encoding is 'binary' so we have to make this configurable. + // Everything else in the universe uses 'utf8', though. + this.defaultEncoding = options.defaultEncoding || 'utf8'; + + // not an actual buffer we keep track of, but a measurement + // of how much we're waiting to get pushed to some underlying + // socket or file. + this.length = 0; + + // a flag to see when we're in the middle of a write. + this.writing = false; + + // a flag to be able to tell if the onwrite cb is called immediately, + // or on a later tick. We set this to true at first, becuase any + // actions that shouldn't happen until "later" should generally also + // not happen before the first write call. + this.sync = true; + + // a flag to know if we're processing previously buffered items, which + // may call the _write() callback in the same tick, so that we don't + // end up in an overlapped onwrite situation. + this.bufferProcessing = false; + + // the callback that's passed to _write(chunk,cb) + this.onwrite = function(er) { + onwrite(stream, er); + }; + + // the callback that the user supplies to write(chunk,encoding,cb) + this.writecb = null; + + // the amount that is being written when _write is called. + this.writelen = 0; + + this.buffer = []; + + // True if the error was already emitted and should not be thrown again + this.errorEmitted = false; +} + +function Writable(options) { + var Duplex = require('./_stream_duplex'); + + // Writable ctor is applied to Duplexes, though they're not + // instanceof Writable, they're instanceof Readable. + if (!(this instanceof Writable) && !(this instanceof Duplex)) + return new Writable(options); + + this._writableState = new WritableState(options, this); + + // legacy. + this.writable = true; + + Stream.call(this); +} + +// Otherwise people can pipe Writable streams, which is just wrong. +Writable.prototype.pipe = function() { + this.emit('error', new Error('Cannot pipe. Not readable.')); +}; + + +function writeAfterEnd(stream, state, cb) { + var er = new Error('write after end'); + // TODO: defer error events consistently everywhere, not just the cb + stream.emit('error', er); + process.nextTick(function() { + cb(er); + }); +} + +// If we get something that is not a buffer, string, null, or undefined, +// and we're not in objectMode, then that's an error. +// Otherwise stream chunks are all considered to be of length=1, and the +// watermarks determine how many objects to keep in the buffer, rather than +// how many bytes or characters. +function validChunk(stream, state, chunk, cb) { + var valid = true; + if (!Buffer.isBuffer(chunk) && + 'string' !== typeof chunk && + chunk !== null && + chunk !== undefined && + !state.objectMode) { + var er = new TypeError('Invalid non-string/buffer chunk'); + stream.emit('error', er); + process.nextTick(function() { + cb(er); + }); + valid = false; + } + return valid; +} + +Writable.prototype.write = function(chunk, encoding, cb) { + var state = this._writableState; + var ret = false; + + if (typeof encoding === 'function') { + cb = encoding; + encoding = null; + } + + if (Buffer.isBuffer(chunk)) + encoding = 'buffer'; + else if (!encoding) + encoding = state.defaultEncoding; + + if (typeof cb !== 'function') + cb = function() {}; + + if (state.ended) + writeAfterEnd(this, state, cb); + else if (validChunk(this, state, chunk, cb)) + ret = writeOrBuffer(this, state, chunk, encoding, cb); + + return ret; +}; + +function decodeChunk(state, chunk, encoding) { + if (!state.objectMode && + state.decodeStrings !== false && + typeof chunk === 'string') { + chunk = new Buffer(chunk, encoding); + } + return chunk; +} + +// if we're already writing something, then just put this +// in the queue, and wait our turn. Otherwise, call _write +// If we return false, then we need a drain event, so set that flag. +function writeOrBuffer(stream, state, chunk, encoding, cb) { + chunk = decodeChunk(state, chunk, encoding); + if (Buffer.isBuffer(chunk)) + encoding = 'buffer'; + var len = state.objectMode ? 1 : chunk.length; + + state.length += len; + + var ret = state.length < state.highWaterMark; + // we must ensure that previous needDrain will not be reset to false. + if (!ret) + state.needDrain = true; + + if (state.writing) + state.buffer.push(new WriteReq(chunk, encoding, cb)); + else + doWrite(stream, state, len, chunk, encoding, cb); + + return ret; +} + +function doWrite(stream, state, len, chunk, encoding, cb) { + state.writelen = len; + state.writecb = cb; + state.writing = true; + state.sync = true; + stream._write(chunk, encoding, state.onwrite); + state.sync = false; +} + +function onwriteError(stream, state, sync, er, cb) { + if (sync) + process.nextTick(function() { + cb(er); + }); + else + cb(er); + + stream._writableState.errorEmitted = true; + stream.emit('error', er); +} + +function onwriteStateUpdate(state) { + state.writing = false; + state.writecb = null; + state.length -= state.writelen; + state.writelen = 0; +} + +function onwrite(stream, er) { + var state = stream._writableState; + var sync = state.sync; + var cb = state.writecb; + + onwriteStateUpdate(state); + + if (er) + onwriteError(stream, state, sync, er, cb); + else { + // Check if we're actually ready to finish, but don't emit yet + var finished = needFinish(stream, state); + + if (!finished && !state.bufferProcessing && state.buffer.length) + clearBuffer(stream, state); + + if (sync) { + process.nextTick(function() { + afterWrite(stream, state, finished, cb); + }); + } else { + afterWrite(stream, state, finished, cb); + } + } +} + +function afterWrite(stream, state, finished, cb) { + if (!finished) + onwriteDrain(stream, state); + cb(); + if (finished) + finishMaybe(stream, state); +} + +// Must force callback to be called on nextTick, so that we don't +// emit 'drain' before the write() consumer gets the 'false' return +// value, and has a chance to attach a 'drain' listener. +function onwriteDrain(stream, state) { + if (state.length === 0 && state.needDrain) { + state.needDrain = false; + stream.emit('drain'); + } +} + + +// if there's something in the buffer waiting, then process it +function clearBuffer(stream, state) { + state.bufferProcessing = true; + + for (var c = 0; c < state.buffer.length; c++) { + var entry = state.buffer[c]; + var chunk = entry.chunk; + var encoding = entry.encoding; + var cb = entry.callback; + var len = state.objectMode ? 1 : chunk.length; + + doWrite(stream, state, len, chunk, encoding, cb); + + // if we didn't call the onwrite immediately, then + // it means that we need to wait until it does. + // also, that means that the chunk and cb are currently + // being processed, so move the buffer counter past them. + if (state.writing) { + c++; + break; + } + } + + state.bufferProcessing = false; + if (c < state.buffer.length) + state.buffer = state.buffer.slice(c); + else + state.buffer.length = 0; +} + +Writable.prototype._write = function(chunk, encoding, cb) { + cb(new Error('not implemented')); +}; + +Writable.prototype.end = function(chunk, encoding, cb) { + var state = this._writableState; + + if (typeof chunk === 'function') { + cb = chunk; + chunk = null; + encoding = null; + } else if (typeof encoding === 'function') { + cb = encoding; + encoding = null; + } + + if (typeof chunk !== 'undefined' && chunk !== null) + this.write(chunk, encoding); + + // ignore unnecessary end() calls. + if (!state.ending && !state.finished) + endWritable(this, state, cb); +}; + + +function needFinish(stream, state) { + return (state.ending && + state.length === 0 && + !state.finished && + !state.writing); +} + +function finishMaybe(stream, state) { + var need = needFinish(stream, state); + if (need) { + state.finished = true; + stream.emit('finish'); + } + return need; +} + +function endWritable(stream, state, cb) { + state.ending = true; + finishMaybe(stream, state); + if (cb) { + if (state.finished) + process.nextTick(cb); + else + stream.once('finish', cb); + } + state.ended = true; +} diff --git a/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/core-util-is/README.md b/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/core-util-is/README.md new file mode 100644 index 0000000..5a76b41 --- /dev/null +++ b/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/core-util-is/README.md @@ -0,0 +1,3 @@ +# core-util-is + +The `util.is*` functions introduced in Node v0.12. diff --git a/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/core-util-is/float.patch b/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/core-util-is/float.patch new file mode 100644 index 0000000..a06d5c0 --- /dev/null +++ b/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/core-util-is/float.patch @@ -0,0 +1,604 @@ +diff --git a/lib/util.js b/lib/util.js +index a03e874..9074e8e 100644 +--- a/lib/util.js ++++ b/lib/util.js +@@ -19,430 +19,6 @@ + // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE + // USE OR OTHER DEALINGS IN THE SOFTWARE. + +-var formatRegExp = /%[sdj%]/g; +-exports.format = function(f) { +- if (!isString(f)) { +- var objects = []; +- for (var i = 0; i < arguments.length; i++) { +- objects.push(inspect(arguments[i])); +- } +- return objects.join(' '); +- } +- +- var i = 1; +- var args = arguments; +- var len = args.length; +- var str = String(f).replace(formatRegExp, function(x) { +- if (x === '%%') return '%'; +- if (i >= len) return x; +- switch (x) { +- case '%s': return String(args[i++]); +- case '%d': return Number(args[i++]); +- case '%j': +- try { +- return JSON.stringify(args[i++]); +- } catch (_) { +- return '[Circular]'; +- } +- default: +- return x; +- } +- }); +- for (var x = args[i]; i < len; x = args[++i]) { +- if (isNull(x) || !isObject(x)) { +- str += ' ' + x; +- } else { +- str += ' ' + inspect(x); +- } +- } +- return str; +-}; +- +- +-// Mark that a method should not be used. +-// Returns a modified function which warns once by default. +-// If --no-deprecation is set, then it is a no-op. +-exports.deprecate = function(fn, msg) { +- // Allow for deprecating things in the process of starting up. +- if (isUndefined(global.process)) { +- return function() { +- return exports.deprecate(fn, msg).apply(this, arguments); +- }; +- } +- +- if (process.noDeprecation === true) { +- return fn; +- } +- +- var warned = false; +- function deprecated() { +- if (!warned) { +- if (process.throwDeprecation) { +- throw new Error(msg); +- } else if (process.traceDeprecation) { +- console.trace(msg); +- } else { +- console.error(msg); +- } +- warned = true; +- } +- return fn.apply(this, arguments); +- } +- +- return deprecated; +-}; +- +- +-var debugs = {}; +-var debugEnviron; +-exports.debuglog = function(set) { +- if (isUndefined(debugEnviron)) +- debugEnviron = process.env.NODE_DEBUG || ''; +- set = set.toUpperCase(); +- if (!debugs[set]) { +- if (new RegExp('\\b' + set + '\\b', 'i').test(debugEnviron)) { +- var pid = process.pid; +- debugs[set] = function() { +- var msg = exports.format.apply(exports, arguments); +- console.error('%s %d: %s', set, pid, msg); +- }; +- } else { +- debugs[set] = function() {}; +- } +- } +- return debugs[set]; +-}; +- +- +-/** +- * Echos the value of a value. Trys to print the value out +- * in the best way possible given the different types. +- * +- * @param {Object} obj The object to print out. +- * @param {Object} opts Optional options object that alters the output. +- */ +-/* legacy: obj, showHidden, depth, colors*/ +-function inspect(obj, opts) { +- // default options +- var ctx = { +- seen: [], +- stylize: stylizeNoColor +- }; +- // legacy... +- if (arguments.length >= 3) ctx.depth = arguments[2]; +- if (arguments.length >= 4) ctx.colors = arguments[3]; +- if (isBoolean(opts)) { +- // legacy... +- ctx.showHidden = opts; +- } else if (opts) { +- // got an "options" object +- exports._extend(ctx, opts); +- } +- // set default options +- if (isUndefined(ctx.showHidden)) ctx.showHidden = false; +- if (isUndefined(ctx.depth)) ctx.depth = 2; +- if (isUndefined(ctx.colors)) ctx.colors = false; +- if (isUndefined(ctx.customInspect)) ctx.customInspect = true; +- if (ctx.colors) ctx.stylize = stylizeWithColor; +- return formatValue(ctx, obj, ctx.depth); +-} +-exports.inspect = inspect; +- +- +-// http://en.wikipedia.org/wiki/ANSI_escape_code#graphics +-inspect.colors = { +- 'bold' : [1, 22], +- 'italic' : [3, 23], +- 'underline' : [4, 24], +- 'inverse' : [7, 27], +- 'white' : [37, 39], +- 'grey' : [90, 39], +- 'black' : [30, 39], +- 'blue' : [34, 39], +- 'cyan' : [36, 39], +- 'green' : [32, 39], +- 'magenta' : [35, 39], +- 'red' : [31, 39], +- 'yellow' : [33, 39] +-}; +- +-// Don't use 'blue' not visible on cmd.exe +-inspect.styles = { +- 'special': 'cyan', +- 'number': 'yellow', +- 'boolean': 'yellow', +- 'undefined': 'grey', +- 'null': 'bold', +- 'string': 'green', +- 'date': 'magenta', +- // "name": intentionally not styling +- 'regexp': 'red' +-}; +- +- +-function stylizeWithColor(str, styleType) { +- var style = inspect.styles[styleType]; +- +- if (style) { +- return '\u001b[' + inspect.colors[style][0] + 'm' + str + +- '\u001b[' + inspect.colors[style][1] + 'm'; +- } else { +- return str; +- } +-} +- +- +-function stylizeNoColor(str, styleType) { +- return str; +-} +- +- +-function arrayToHash(array) { +- var hash = {}; +- +- array.forEach(function(val, idx) { +- hash[val] = true; +- }); +- +- return hash; +-} +- +- +-function formatValue(ctx, value, recurseTimes) { +- // Provide a hook for user-specified inspect functions. +- // Check that value is an object with an inspect function on it +- if (ctx.customInspect && +- value && +- isFunction(value.inspect) && +- // Filter out the util module, it's inspect function is special +- value.inspect !== exports.inspect && +- // Also filter out any prototype objects using the circular check. +- !(value.constructor && value.constructor.prototype === value)) { +- var ret = value.inspect(recurseTimes, ctx); +- if (!isString(ret)) { +- ret = formatValue(ctx, ret, recurseTimes); +- } +- return ret; +- } +- +- // Primitive types cannot have properties +- var primitive = formatPrimitive(ctx, value); +- if (primitive) { +- return primitive; +- } +- +- // Look up the keys of the object. +- var keys = Object.keys(value); +- var visibleKeys = arrayToHash(keys); +- +- if (ctx.showHidden) { +- keys = Object.getOwnPropertyNames(value); +- } +- +- // Some type of object without properties can be shortcutted. +- if (keys.length === 0) { +- if (isFunction(value)) { +- var name = value.name ? ': ' + value.name : ''; +- return ctx.stylize('[Function' + name + ']', 'special'); +- } +- if (isRegExp(value)) { +- return ctx.stylize(RegExp.prototype.toString.call(value), 'regexp'); +- } +- if (isDate(value)) { +- return ctx.stylize(Date.prototype.toString.call(value), 'date'); +- } +- if (isError(value)) { +- return formatError(value); +- } +- } +- +- var base = '', array = false, braces = ['{', '}']; +- +- // Make Array say that they are Array +- if (isArray(value)) { +- array = true; +- braces = ['[', ']']; +- } +- +- // Make functions say that they are functions +- if (isFunction(value)) { +- var n = value.name ? ': ' + value.name : ''; +- base = ' [Function' + n + ']'; +- } +- +- // Make RegExps say that they are RegExps +- if (isRegExp(value)) { +- base = ' ' + RegExp.prototype.toString.call(value); +- } +- +- // Make dates with properties first say the date +- if (isDate(value)) { +- base = ' ' + Date.prototype.toUTCString.call(value); +- } +- +- // Make error with message first say the error +- if (isError(value)) { +- base = ' ' + formatError(value); +- } +- +- if (keys.length === 0 && (!array || value.length == 0)) { +- return braces[0] + base + braces[1]; +- } +- +- if (recurseTimes < 0) { +- if (isRegExp(value)) { +- return ctx.stylize(RegExp.prototype.toString.call(value), 'regexp'); +- } else { +- return ctx.stylize('[Object]', 'special'); +- } +- } +- +- ctx.seen.push(value); +- +- var output; +- if (array) { +- output = formatArray(ctx, value, recurseTimes, visibleKeys, keys); +- } else { +- output = keys.map(function(key) { +- return formatProperty(ctx, value, recurseTimes, visibleKeys, key, array); +- }); +- } +- +- ctx.seen.pop(); +- +- return reduceToSingleString(output, base, braces); +-} +- +- +-function formatPrimitive(ctx, value) { +- if (isUndefined(value)) +- return ctx.stylize('undefined', 'undefined'); +- if (isString(value)) { +- var simple = '\'' + JSON.stringify(value).replace(/^"|"$/g, '') +- .replace(/'/g, "\\'") +- .replace(/\\"/g, '"') + '\''; +- return ctx.stylize(simple, 'string'); +- } +- if (isNumber(value)) { +- // Format -0 as '-0'. Strict equality won't distinguish 0 from -0, +- // so instead we use the fact that 1 / -0 < 0 whereas 1 / 0 > 0 . +- if (value === 0 && 1 / value < 0) +- return ctx.stylize('-0', 'number'); +- return ctx.stylize('' + value, 'number'); +- } +- if (isBoolean(value)) +- return ctx.stylize('' + value, 'boolean'); +- // For some reason typeof null is "object", so special case here. +- if (isNull(value)) +- return ctx.stylize('null', 'null'); +-} +- +- +-function formatError(value) { +- return '[' + Error.prototype.toString.call(value) + ']'; +-} +- +- +-function formatArray(ctx, value, recurseTimes, visibleKeys, keys) { +- var output = []; +- for (var i = 0, l = value.length; i < l; ++i) { +- if (hasOwnProperty(value, String(i))) { +- output.push(formatProperty(ctx, value, recurseTimes, visibleKeys, +- String(i), true)); +- } else { +- output.push(''); +- } +- } +- keys.forEach(function(key) { +- if (!key.match(/^\d+$/)) { +- output.push(formatProperty(ctx, value, recurseTimes, visibleKeys, +- key, true)); +- } +- }); +- return output; +-} +- +- +-function formatProperty(ctx, value, recurseTimes, visibleKeys, key, array) { +- var name, str, desc; +- desc = Object.getOwnPropertyDescriptor(value, key) || { value: value[key] }; +- if (desc.get) { +- if (desc.set) { +- str = ctx.stylize('[Getter/Setter]', 'special'); +- } else { +- str = ctx.stylize('[Getter]', 'special'); +- } +- } else { +- if (desc.set) { +- str = ctx.stylize('[Setter]', 'special'); +- } +- } +- if (!hasOwnProperty(visibleKeys, key)) { +- name = '[' + key + ']'; +- } +- if (!str) { +- if (ctx.seen.indexOf(desc.value) < 0) { +- if (isNull(recurseTimes)) { +- str = formatValue(ctx, desc.value, null); +- } else { +- str = formatValue(ctx, desc.value, recurseTimes - 1); +- } +- if (str.indexOf('\n') > -1) { +- if (array) { +- str = str.split('\n').map(function(line) { +- return ' ' + line; +- }).join('\n').substr(2); +- } else { +- str = '\n' + str.split('\n').map(function(line) { +- return ' ' + line; +- }).join('\n'); +- } +- } +- } else { +- str = ctx.stylize('[Circular]', 'special'); +- } +- } +- if (isUndefined(name)) { +- if (array && key.match(/^\d+$/)) { +- return str; +- } +- name = JSON.stringify('' + key); +- if (name.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)) { +- name = name.substr(1, name.length - 2); +- name = ctx.stylize(name, 'name'); +- } else { +- name = name.replace(/'/g, "\\'") +- .replace(/\\"/g, '"') +- .replace(/(^"|"$)/g, "'"); +- name = ctx.stylize(name, 'string'); +- } +- } +- +- return name + ': ' + str; +-} +- +- +-function reduceToSingleString(output, base, braces) { +- var numLinesEst = 0; +- var length = output.reduce(function(prev, cur) { +- numLinesEst++; +- if (cur.indexOf('\n') >= 0) numLinesEst++; +- return prev + cur.replace(/\u001b\[\d\d?m/g, '').length + 1; +- }, 0); +- +- if (length > 60) { +- return braces[0] + +- (base === '' ? '' : base + '\n ') + +- ' ' + +- output.join(',\n ') + +- ' ' + +- braces[1]; +- } +- +- return braces[0] + base + ' ' + output.join(', ') + ' ' + braces[1]; +-} +- +- + // 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) { +@@ -522,166 +98,10 @@ function isPrimitive(arg) { + exports.isPrimitive = isPrimitive; + + function isBuffer(arg) { +- return arg instanceof Buffer; ++ return Buffer.isBuffer(arg); + } + exports.isBuffer = isBuffer; + + function objectToString(o) { + return Object.prototype.toString.call(o); +-} +- +- +-function pad(n) { +- return n < 10 ? '0' + n.toString(10) : n.toString(10); +-} +- +- +-var months = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', +- 'Oct', 'Nov', 'Dec']; +- +-// 26 Feb 16:19:34 +-function timestamp() { +- var d = new Date(); +- var time = [pad(d.getHours()), +- pad(d.getMinutes()), +- pad(d.getSeconds())].join(':'); +- return [d.getDate(), months[d.getMonth()], time].join(' '); +-} +- +- +-// log is just a thin wrapper to console.log that prepends a timestamp +-exports.log = function() { +- console.log('%s - %s', timestamp(), exports.format.apply(exports, arguments)); +-}; +- +- +-/** +- * Inherit the prototype methods from one constructor into another. +- * +- * The Function.prototype.inherits from lang.js rewritten as a standalone +- * function (not on Function.prototype). NOTE: If this file is to be loaded +- * during bootstrapping this function needs to be rewritten using some native +- * functions as prototype setup using normal JavaScript does not work as +- * expected during bootstrapping (see mirror.js in r114903). +- * +- * @param {function} ctor Constructor function which needs to inherit the +- * prototype. +- * @param {function} superCtor Constructor function to inherit prototype from. +- */ +-exports.inherits = function(ctor, superCtor) { +- ctor.super_ = superCtor; +- ctor.prototype = Object.create(superCtor.prototype, { +- constructor: { +- value: ctor, +- enumerable: false, +- writable: true, +- configurable: true +- } +- }); +-}; +- +-exports._extend = function(origin, add) { +- // Don't do anything if add isn't an object +- if (!add || !isObject(add)) return origin; +- +- var keys = Object.keys(add); +- var i = keys.length; +- while (i--) { +- origin[keys[i]] = add[keys[i]]; +- } +- return origin; +-}; +- +-function hasOwnProperty(obj, prop) { +- return Object.prototype.hasOwnProperty.call(obj, prop); +-} +- +- +-// Deprecated old stuff. +- +-exports.p = exports.deprecate(function() { +- for (var i = 0, len = arguments.length; i < len; ++i) { +- console.error(exports.inspect(arguments[i])); +- } +-}, 'util.p: Use console.error() instead'); +- +- +-exports.exec = exports.deprecate(function() { +- return require('child_process').exec.apply(this, arguments); +-}, 'util.exec is now called `child_process.exec`.'); +- +- +-exports.print = exports.deprecate(function() { +- for (var i = 0, len = arguments.length; i < len; ++i) { +- process.stdout.write(String(arguments[i])); +- } +-}, 'util.print: Use console.log instead'); +- +- +-exports.puts = exports.deprecate(function() { +- for (var i = 0, len = arguments.length; i < len; ++i) { +- process.stdout.write(arguments[i] + '\n'); +- } +-}, 'util.puts: Use console.log instead'); +- +- +-exports.debug = exports.deprecate(function(x) { +- process.stderr.write('DEBUG: ' + x + '\n'); +-}, 'util.debug: Use console.error instead'); +- +- +-exports.error = exports.deprecate(function(x) { +- for (var i = 0, len = arguments.length; i < len; ++i) { +- process.stderr.write(arguments[i] + '\n'); +- } +-}, 'util.error: Use console.error instead'); +- +- +-exports.pump = exports.deprecate(function(readStream, writeStream, callback) { +- var callbackCalled = false; +- +- function call(a, b, c) { +- if (callback && !callbackCalled) { +- callback(a, b, c); +- callbackCalled = true; +- } +- } +- +- readStream.addListener('data', function(chunk) { +- if (writeStream.write(chunk) === false) readStream.pause(); +- }); +- +- writeStream.addListener('drain', function() { +- readStream.resume(); +- }); +- +- readStream.addListener('end', function() { +- writeStream.end(); +- }); +- +- readStream.addListener('close', function() { +- call(); +- }); +- +- readStream.addListener('error', function(err) { +- writeStream.end(); +- call(err); +- }); +- +- writeStream.addListener('error', function(err) { +- readStream.destroy(); +- call(err); +- }); +-}, 'util.pump(): Use readableStream.pipe() instead'); +- +- +-var uv; +-exports._errnoException = function(err, syscall) { +- if (isUndefined(uv)) uv = process.binding('uv'); +- var errname = uv.errname(err); +- var e = new Error(syscall + ' ' + errname); +- e.code = errname; +- e.errno = errname; +- e.syscall = syscall; +- return e; +-}; ++} \ No newline at end of file diff --git a/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/core-util-is/lib/util.js b/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/core-util-is/lib/util.js new file mode 100644 index 0000000..9074e8e --- /dev/null +++ b/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/core-util-is/lib/util.js @@ -0,0 +1,107 @@ +// 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]' || e instanceof 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 Buffer.isBuffer(arg); +} +exports.isBuffer = isBuffer; + +function objectToString(o) { + return Object.prototype.toString.call(o); +} \ No newline at end of file diff --git a/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/core-util-is/package.json b/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/core-util-is/package.json new file mode 100644 index 0000000..2b7593c --- /dev/null +++ b/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/core-util-is/package.json @@ -0,0 +1,54 @@ +{ + "name": "core-util-is", + "version": "1.0.1", + "description": "The `util.is*` functions introduced in Node v0.12.", + "main": "lib/util.js", + "repository": { + "type": "git", + "url": "git://github.com/isaacs/core-util-is" + }, + "keywords": [ + "util", + "isBuffer", + "isArray", + "isNumber", + "isString", + "isRegExp", + "isThis", + "isThat", + "polyfill" + ], + "author": { + "name": "Isaac Z. Schlueter", + "email": "i@izs.me", + "url": "http://blog.izs.me/" + }, + "license": "MIT", + "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" + }, + "_from": "core-util-is@~1.0.0", + "_npmVersion": "1.3.23", + "_npmUser": { + "name": "isaacs", + "email": "i@izs.me" + }, + "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", + "scripts": {} +} diff --git a/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/core-util-is/util.js b/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/core-util-is/util.js new file mode 100644 index 0000000..007fa10 --- /dev/null +++ b/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/core-util-is/util.js @@ -0,0 +1,106 @@ +// 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/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/inherits/LICENSE b/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/inherits/LICENSE new file mode 100644 index 0000000..dea3013 --- /dev/null +++ b/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/inherits/LICENSE @@ -0,0 +1,16 @@ +The ISC License + +Copyright (c) Isaac Z. Schlueter + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH +REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, +INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM +LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR +OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR +PERFORMANCE OF THIS SOFTWARE. + diff --git a/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/inherits/README.md b/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/inherits/README.md new file mode 100644 index 0000000..b1c5665 --- /dev/null +++ b/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/inherits/README.md @@ -0,0 +1,42 @@ +Browser-friendly inheritance fully compatible with standard node.js +[inherits](http://nodejs.org/api/util.html#util_util_inherits_constructor_superconstructor). + +This package exports standard `inherits` from node.js `util` module in +node environment, but also provides alternative browser-friendly +implementation through [browser +field](https://gist.github.com/shtylman/4339901). Alternative +implementation is a literal copy of standard one located in standalone +module to avoid requiring of `util`. It also has a shim for old +browsers with no `Object.create` support. + +While keeping you sure you are using standard `inherits` +implementation in node.js environment, it allows bundlers such as +[browserify](https://github.com/substack/node-browserify) to not +include full `util` package to your client code if all you need is +just `inherits` function. It worth, because browser shim for `util` +package is large and `inherits` is often the single function you need +from it. + +It's recommended to use this package instead of +`require('util').inherits` for any code that has chances to be used +not only in node.js but in browser too. + +## usage + +```js +var inherits = require('inherits'); +// then use exactly as the standard one +``` + +## note on version ~1.0 + +Version ~1.0 had completely different motivation and is not compatible +neither with 2.0 nor with standard node.js `inherits`. + +If you are using version ~1.0 and planning to switch to ~2.0, be +careful: + +* new version uses `super_` instead of `super` for referencing + superclass +* new version overwrites current prototype while old one preserves any + existing fields on it diff --git a/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/inherits/inherits.js b/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/inherits/inherits.js new file mode 100644 index 0000000..29f5e24 --- /dev/null +++ b/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/inherits/inherits.js @@ -0,0 +1 @@ +module.exports = require('util').inherits diff --git a/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/inherits/inherits_browser.js b/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/inherits/inherits_browser.js new file mode 100644 index 0000000..c1e78a7 --- /dev/null +++ b/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/inherits/inherits_browser.js @@ -0,0 +1,23 @@ +if (typeof Object.create === 'function') { + // implementation from standard node.js 'util' module + module.exports = function inherits(ctor, superCtor) { + ctor.super_ = superCtor + ctor.prototype = Object.create(superCtor.prototype, { + constructor: { + value: ctor, + enumerable: false, + writable: true, + configurable: true + } + }); + }; +} else { + // old school shim for old browsers + module.exports = function inherits(ctor, superCtor) { + ctor.super_ = superCtor + var TempCtor = function () {} + TempCtor.prototype = superCtor.prototype + ctor.prototype = new TempCtor() + ctor.prototype.constructor = ctor + } +} diff --git a/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/inherits/package.json b/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/inherits/package.json new file mode 100644 index 0000000..3d69f4f --- /dev/null +++ b/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/inherits/package.json @@ -0,0 +1,51 @@ +{ + "name": "inherits", + "description": "Browser-friendly inheritance fully compatible with standard node.js inherits()", + "version": "2.0.1", + "keywords": [ + "inheritance", + "class", + "klass", + "oop", + "object-oriented", + "inherits", + "browser", + "browserify" + ], + "main": "./inherits.js", + "browser": "./inherits_browser.js", + "repository": { + "type": "git", + "url": "git://github.com/isaacs/inherits" + }, + "license": "ISC", + "scripts": { + "test": "node test" + }, + "readme": "Browser-friendly inheritance fully compatible with standard node.js\n[inherits](http://nodejs.org/api/util.html#util_util_inherits_constructor_superconstructor).\n\nThis package exports standard `inherits` from node.js `util` module in\nnode environment, but also provides alternative browser-friendly\nimplementation through [browser\nfield](https://gist.github.com/shtylman/4339901). Alternative\nimplementation is a literal copy of standard one located in standalone\nmodule to avoid requiring of `util`. It also has a shim for old\nbrowsers with no `Object.create` support.\n\nWhile keeping you sure you are using standard `inherits`\nimplementation in node.js environment, it allows bundlers such as\n[browserify](https://github.com/substack/node-browserify) to not\ninclude full `util` package to your client code if all you need is\njust `inherits` function. It worth, because browser shim for `util`\npackage is large and `inherits` is often the single function you need\nfrom it.\n\nIt's recommended to use this package instead of\n`require('util').inherits` for any code that has chances to be used\nnot only in node.js but in browser too.\n\n## usage\n\n```js\nvar inherits = require('inherits');\n// then use exactly as the standard one\n```\n\n## note on version ~1.0\n\nVersion ~1.0 had completely different motivation and is not compatible\nneither with 2.0 nor with standard node.js `inherits`.\n\nIf you are using version ~1.0 and planning to switch to ~2.0, be\ncareful:\n\n* new version uses `super_` instead of `super` for referencing\n superclass\n* new version overwrites current prototype while old one preserves any\n existing fields on it\n", + "readmeFilename": "README.md", + "bugs": { + "url": "https://github.com/isaacs/inherits/issues" + }, + "_id": "inherits@2.0.1", + "dist": { + "shasum": "b17d08d326b4423e568eff719f91b0b1cbdf69f1", + "tarball": "http://registry.npmjs.org/inherits/-/inherits-2.0.1.tgz" + }, + "_from": "inherits@~2.0.1", + "_npmVersion": "1.3.8", + "_npmUser": { + "name": "isaacs", + "email": "i@izs.me" + }, + "maintainers": [ + { + "name": "isaacs", + "email": "i@izs.me" + } + ], + "directories": {}, + "_shasum": "b17d08d326b4423e568eff719f91b0b1cbdf69f1", + "_resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.1.tgz", + "homepage": "https://github.com/isaacs/inherits" +} diff --git a/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/inherits/test.js b/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/inherits/test.js new file mode 100644 index 0000000..fc53012 --- /dev/null +++ b/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/inherits/test.js @@ -0,0 +1,25 @@ +var inherits = require('./inherits.js') +var assert = require('assert') + +function test(c) { + assert(c.constructor === Child) + assert(c.constructor.super_ === Parent) + assert(Object.getPrototypeOf(c) === Child.prototype) + assert(Object.getPrototypeOf(Object.getPrototypeOf(c)) === Parent.prototype) + assert(c instanceof Child) + assert(c instanceof Parent) +} + +function Child() { + Parent.call(this) + test(this) +} + +function Parent() {} + +inherits(Child, Parent) + +var c = new Child +test(c) + +console.log('ok') diff --git a/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/isarray/README.md b/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/isarray/README.md new file mode 100644 index 0000000..052a62b --- /dev/null +++ b/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/isarray/README.md @@ -0,0 +1,54 @@ + +# isarray + +`Array#isArray` for older browsers. + +## Usage + +```js +var isArray = require('isarray'); + +console.log(isArray([])); // => true +console.log(isArray({})); // => false +``` + +## Installation + +With [npm](http://npmjs.org) do + +```bash +$ npm install isarray +``` + +Then bundle for the browser with +[browserify](https://github.com/substack/browserify). + +With [component](http://component.io) do + +```bash +$ component install juliangruber/isarray +``` + +## License + +(MIT) + +Copyright (c) 2013 Julian Gruber <julian@juliangruber.com> + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies +of the Software, and to permit persons to whom the Software is furnished to do +so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/isarray/build/build.js b/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/isarray/build/build.js new file mode 100644 index 0000000..ec58596 --- /dev/null +++ b/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/isarray/build/build.js @@ -0,0 +1,209 @@ + +/** + * Require the given path. + * + * @param {String} path + * @return {Object} exports + * @api public + */ + +function require(path, parent, orig) { + var resolved = require.resolve(path); + + // lookup failed + if (null == resolved) { + orig = orig || path; + parent = parent || 'root'; + var err = new Error('Failed to require "' + orig + '" from "' + parent + '"'); + err.path = orig; + err.parent = parent; + err.require = true; + throw err; + } + + var module = require.modules[resolved]; + + // perform real require() + // by invoking the module's + // registered function + if (!module.exports) { + module.exports = {}; + module.client = module.component = true; + module.call(this, module.exports, require.relative(resolved), module); + } + + return module.exports; +} + +/** + * Registered modules. + */ + +require.modules = {}; + +/** + * Registered aliases. + */ + +require.aliases = {}; + +/** + * Resolve `path`. + * + * Lookup: + * + * - PATH/index.js + * - PATH.js + * - PATH + * + * @param {String} path + * @return {String} path or null + * @api private + */ + +require.resolve = function(path) { + if (path.charAt(0) === '/') path = path.slice(1); + var index = path + '/index.js'; + + var paths = [ + path, + path + '.js', + path + '.json', + path + '/index.js', + path + '/index.json' + ]; + + for (var i = 0; i < paths.length; i++) { + var path = paths[i]; + if (require.modules.hasOwnProperty(path)) return path; + } + + if (require.aliases.hasOwnProperty(index)) { + return require.aliases[index]; + } +}; + +/** + * Normalize `path` relative to the current path. + * + * @param {String} curr + * @param {String} path + * @return {String} + * @api private + */ + +require.normalize = function(curr, path) { + var segs = []; + + if ('.' != path.charAt(0)) return path; + + curr = curr.split('/'); + path = path.split('/'); + + for (var i = 0; i < path.length; ++i) { + if ('..' == path[i]) { + curr.pop(); + } else if ('.' != path[i] && '' != path[i]) { + segs.push(path[i]); + } + } + + return curr.concat(segs).join('/'); +}; + +/** + * Register module at `path` with callback `definition`. + * + * @param {String} path + * @param {Function} definition + * @api private + */ + +require.register = function(path, definition) { + require.modules[path] = definition; +}; + +/** + * Alias a module definition. + * + * @param {String} from + * @param {String} to + * @api private + */ + +require.alias = function(from, to) { + if (!require.modules.hasOwnProperty(from)) { + throw new Error('Failed to alias "' + from + '", it does not exist'); + } + require.aliases[to] = from; +}; + +/** + * Return a require function relative to the `parent` path. + * + * @param {String} parent + * @return {Function} + * @api private + */ + +require.relative = function(parent) { + var p = require.normalize(parent, '..'); + + /** + * lastIndexOf helper. + */ + + function lastIndexOf(arr, obj) { + var i = arr.length; + while (i--) { + if (arr[i] === obj) return i; + } + return -1; + } + + /** + * The relative require() itself. + */ + + function localRequire(path) { + var resolved = localRequire.resolve(path); + return require(resolved, parent, path); + } + + /** + * Resolve relative to the parent. + */ + + localRequire.resolve = function(path) { + var c = path.charAt(0); + if ('/' == c) return path.slice(1); + if ('.' == c) return require.normalize(p, path); + + // resolve deps by returning + // the dep in the nearest "deps" + // directory + var segs = parent.split('/'); + var i = lastIndexOf(segs, 'deps') + 1; + if (!i) i = 0; + path = segs.slice(0, i + 1).join('/') + '/deps/' + path; + return path; + }; + + /** + * Check if module is defined at `path`. + */ + + localRequire.exists = function(path) { + return require.modules.hasOwnProperty(localRequire.resolve(path)); + }; + + return localRequire; +}; +require.register("isarray/index.js", function(exports, require, module){ +module.exports = Array.isArray || function (arr) { + return Object.prototype.toString.call(arr) == '[object Array]'; +}; + +}); +require.alias("isarray/index.js", "isarray/index.js"); + diff --git a/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/isarray/component.json b/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/isarray/component.json new file mode 100644 index 0000000..9e31b68 --- /dev/null +++ b/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/isarray/component.json @@ -0,0 +1,19 @@ +{ + "name" : "isarray", + "description" : "Array#isArray for older browsers", + "version" : "0.0.1", + "repository" : "juliangruber/isarray", + "homepage": "https://github.com/juliangruber/isarray", + "main" : "index.js", + "scripts" : [ + "index.js" + ], + "dependencies" : {}, + "keywords": ["browser","isarray","array"], + "author": { + "name": "Julian Gruber", + "email": "mail@juliangruber.com", + "url": "http://juliangruber.com" + }, + "license": "MIT" +} diff --git a/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/isarray/index.js b/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/isarray/index.js new file mode 100644 index 0000000..5f5ad45 --- /dev/null +++ b/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/isarray/index.js @@ -0,0 +1,3 @@ +module.exports = Array.isArray || function (arr) { + return Object.prototype.toString.call(arr) == '[object Array]'; +}; diff --git a/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/isarray/package.json b/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/isarray/package.json new file mode 100644 index 0000000..19228ab --- /dev/null +++ b/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/isarray/package.json @@ -0,0 +1,53 @@ +{ + "name": "isarray", + "description": "Array#isArray for older browsers", + "version": "0.0.1", + "repository": { + "type": "git", + "url": "git://github.com/juliangruber/isarray.git" + }, + "homepage": "https://github.com/juliangruber/isarray", + "main": "index.js", + "scripts": { + "test": "tap test/*.js" + }, + "dependencies": {}, + "devDependencies": { + "tap": "*" + }, + "keywords": [ + "browser", + "isarray", + "array" + ], + "author": { + "name": "Julian Gruber", + "email": "mail@juliangruber.com", + "url": "http://juliangruber.com" + }, + "license": "MIT", + "_id": "isarray@0.0.1", + "dist": { + "shasum": "8a18acfca9a8f4177e09abfc6038939b05d1eedf", + "tarball": "http://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz" + }, + "_from": "isarray@0.0.1", + "_npmVersion": "1.2.18", + "_npmUser": { + "name": "juliangruber", + "email": "julian@juliangruber.com" + }, + "maintainers": [ + { + "name": "juliangruber", + "email": "julian@juliangruber.com" + } + ], + "directories": {}, + "_shasum": "8a18acfca9a8f4177e09abfc6038939b05d1eedf", + "_resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", + "bugs": { + "url": "https://github.com/juliangruber/isarray/issues" + }, + "readme": "ERROR: No README data found!" +} diff --git a/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/string_decoder/.npmignore b/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/string_decoder/.npmignore new file mode 100644 index 0000000..206320c --- /dev/null +++ b/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/string_decoder/.npmignore @@ -0,0 +1,2 @@ +build +test diff --git a/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/string_decoder/LICENSE b/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/string_decoder/LICENSE new file mode 100644 index 0000000..6de584a --- /dev/null +++ b/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/string_decoder/LICENSE @@ -0,0 +1,20 @@ +Copyright Joyent, Inc. and other Node contributors. + +Permission is hereby granted, free of charge, to any person obtaining a +copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to permit +persons to whom the Software is furnished to do so, subject to the +following conditions: + +The above copyright notice and this permission notice shall be included +in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/string_decoder/README.md b/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/string_decoder/README.md new file mode 100644 index 0000000..4d2aa00 --- /dev/null +++ b/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/string_decoder/README.md @@ -0,0 +1,7 @@ +**string_decoder.js** (`require('string_decoder')`) from Node.js core + +Copyright Joyent, Inc. and other Node contributors. See LICENCE file for details. + +Version numbers match the versions found in Node core, e.g. 0.10.24 matches Node 0.10.24, likewise 0.11.10 matches Node 0.11.10. **Prefer the stable version over the unstable.** + +The *build/* directory contains a build script that will scrape the source from the [joyent/node](https://github.com/joyent/node) repo given a specific Node version. \ No newline at end of file diff --git a/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/string_decoder/index.js b/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/string_decoder/index.js new file mode 100644 index 0000000..b00e54f --- /dev/null +++ b/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/string_decoder/index.js @@ -0,0 +1,221 @@ +// Copyright Joyent, Inc. and other Node contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. + +var Buffer = require('buffer').Buffer; + +var isBufferEncoding = Buffer.isEncoding + || function(encoding) { + switch (encoding && encoding.toLowerCase()) { + case 'hex': case 'utf8': case 'utf-8': case 'ascii': case 'binary': case 'base64': case 'ucs2': case 'ucs-2': case 'utf16le': case 'utf-16le': case 'raw': return true; + default: return false; + } + } + + +function assertEncoding(encoding) { + if (encoding && !isBufferEncoding(encoding)) { + throw new Error('Unknown encoding: ' + encoding); + } +} + +// StringDecoder provides an interface for efficiently splitting a series of +// buffers into a series of JS strings without breaking apart multi-byte +// characters. CESU-8 is handled as part of the UTF-8 encoding. +// +// @TODO Handling all encodings inside a single object makes it very difficult +// to reason about this code, so it should be split up in the future. +// @TODO There should be a utf8-strict encoding that rejects invalid UTF-8 code +// points as used by CESU-8. +var StringDecoder = exports.StringDecoder = function(encoding) { + this.encoding = (encoding || 'utf8').toLowerCase().replace(/[-_]/, ''); + assertEncoding(encoding); + switch (this.encoding) { + case 'utf8': + // CESU-8 represents each of Surrogate Pair by 3-bytes + this.surrogateSize = 3; + break; + case 'ucs2': + case 'utf16le': + // UTF-16 represents each of Surrogate Pair by 2-bytes + this.surrogateSize = 2; + this.detectIncompleteChar = utf16DetectIncompleteChar; + break; + case 'base64': + // Base-64 stores 3 bytes in 4 chars, and pads the remainder. + this.surrogateSize = 3; + this.detectIncompleteChar = base64DetectIncompleteChar; + break; + default: + this.write = passThroughWrite; + return; + } + + // Enough space to store all bytes of a single character. UTF-8 needs 4 + // bytes, but CESU-8 may require up to 6 (3 bytes per surrogate). + this.charBuffer = new Buffer(6); + // Number of bytes received for the current incomplete multi-byte character. + this.charReceived = 0; + // Number of bytes expected for the current incomplete multi-byte character. + this.charLength = 0; +}; + + +// write decodes the given buffer and returns it as JS string that is +// guaranteed to not contain any partial multi-byte characters. Any partial +// character found at the end of the buffer is buffered up, and will be +// returned when calling write again with the remaining bytes. +// +// Note: Converting a Buffer containing an orphan surrogate to a String +// currently works, but converting a String to a Buffer (via `new Buffer`, or +// Buffer#write) will replace incomplete surrogates with the unicode +// replacement character. See https://codereview.chromium.org/121173009/ . +StringDecoder.prototype.write = function(buffer) { + var charStr = ''; + // if our last write ended with an incomplete multibyte character + while (this.charLength) { + // determine how many remaining bytes this buffer has to offer for this char + var available = (buffer.length >= this.charLength - this.charReceived) ? + this.charLength - this.charReceived : + buffer.length; + + // add the new bytes to the char buffer + buffer.copy(this.charBuffer, this.charReceived, 0, available); + this.charReceived += available; + + if (this.charReceived < this.charLength) { + // still not enough chars in this buffer? wait for more ... + return ''; + } + + // remove bytes belonging to the current character from the buffer + buffer = buffer.slice(available, buffer.length); + + // get the character that was split + charStr = this.charBuffer.slice(0, this.charLength).toString(this.encoding); + + // CESU-8: lead surrogate (D800-DBFF) is also the incomplete character + var charCode = charStr.charCodeAt(charStr.length - 1); + if (charCode >= 0xD800 && charCode <= 0xDBFF) { + this.charLength += this.surrogateSize; + charStr = ''; + continue; + } + this.charReceived = this.charLength = 0; + + // if there are no more bytes in this buffer, just emit our char + if (buffer.length === 0) { + return charStr; + } + break; + } + + // determine and set charLength / charReceived + this.detectIncompleteChar(buffer); + + var end = buffer.length; + if (this.charLength) { + // buffer the incomplete character bytes we got + buffer.copy(this.charBuffer, 0, buffer.length - this.charReceived, end); + end -= this.charReceived; + } + + charStr += buffer.toString(this.encoding, 0, end); + + var end = charStr.length - 1; + var charCode = charStr.charCodeAt(end); + // CESU-8: lead surrogate (D800-DBFF) is also the incomplete character + if (charCode >= 0xD800 && charCode <= 0xDBFF) { + var size = this.surrogateSize; + this.charLength += size; + this.charReceived += size; + this.charBuffer.copy(this.charBuffer, size, 0, size); + buffer.copy(this.charBuffer, 0, 0, size); + return charStr.substring(0, end); + } + + // or just emit the charStr + return charStr; +}; + +// detectIncompleteChar determines if there is an incomplete UTF-8 character at +// the end of the given buffer. If so, it sets this.charLength to the byte +// length that character, and sets this.charReceived to the number of bytes +// that are available for this character. +StringDecoder.prototype.detectIncompleteChar = function(buffer) { + // determine how many bytes we have to check at the end of this buffer + var i = (buffer.length >= 3) ? 3 : buffer.length; + + // Figure out if one of the last i bytes of our buffer announces an + // incomplete char. + for (; i > 0; i--) { + var c = buffer[buffer.length - i]; + + // See http://en.wikipedia.org/wiki/UTF-8#Description + + // 110XXXXX + if (i == 1 && c >> 5 == 0x06) { + this.charLength = 2; + break; + } + + // 1110XXXX + if (i <= 2 && c >> 4 == 0x0E) { + this.charLength = 3; + break; + } + + // 11110XXX + if (i <= 3 && c >> 3 == 0x1E) { + this.charLength = 4; + break; + } + } + this.charReceived = i; +}; + +StringDecoder.prototype.end = function(buffer) { + var res = ''; + if (buffer && buffer.length) + res = this.write(buffer); + + if (this.charReceived) { + var cr = this.charReceived; + var buf = this.charBuffer; + var enc = this.encoding; + res += buf.slice(0, cr).toString(enc); + } + + return res; +}; + +function passThroughWrite(buffer) { + return buffer.toString(this.encoding); +} + +function utf16DetectIncompleteChar(buffer) { + this.charReceived = buffer.length % 2; + this.charLength = this.charReceived ? 2 : 0; +} + +function base64DetectIncompleteChar(buffer) { + this.charReceived = buffer.length % 3; + this.charLength = this.charReceived ? 3 : 0; +} diff --git a/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/string_decoder/package.json b/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/string_decoder/package.json new file mode 100644 index 0000000..a8c586b --- /dev/null +++ b/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/string_decoder/package.json @@ -0,0 +1,54 @@ +{ + "name": "string_decoder", + "version": "0.10.31", + "description": "The string_decoder module from Node core", + "main": "index.js", + "dependencies": {}, + "devDependencies": { + "tap": "~0.4.8" + }, + "scripts": { + "test": "tap test/simple/*.js" + }, + "repository": { + "type": "git", + "url": "git://github.com/rvagg/string_decoder.git" + }, + "homepage": "https://github.com/rvagg/string_decoder", + "keywords": [ + "string", + "decoder", + "browser", + "browserify" + ], + "license": "MIT", + "gitHead": "d46d4fd87cf1d06e031c23f1ba170ca7d4ade9a0", + "bugs": { + "url": "https://github.com/rvagg/string_decoder/issues" + }, + "_id": "string_decoder@0.10.31", + "_shasum": "62e203bc41766c6c28c9fc84301dab1c5310fa94", + "_from": "string_decoder@~0.10.x", + "_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!" +} diff --git a/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/bl/node_modules/readable-stream/package.json b/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/bl/node_modules/readable-stream/package.json new file mode 100644 index 0000000..d9251ca --- /dev/null +++ b/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/bl/node_modules/readable-stream/package.json @@ -0,0 +1,70 @@ +{ + "name": "readable-stream", + "version": "1.0.33", + "description": "Streams2, a user-land copy of the stream library from Node.js v0.10.x", + "main": "readable.js", + "dependencies": { + "core-util-is": "~1.0.0", + "isarray": "0.0.1", + "string_decoder": "~0.10.x", + "inherits": "~2.0.1" + }, + "devDependencies": { + "tap": "~0.2.6" + }, + "scripts": { + "test": "tap test/simple/*.js" + }, + "repository": { + "type": "git", + "url": "git://github.com/isaacs/readable-stream" + }, + "keywords": [ + "readable", + "stream", + "pipe" + ], + "browser": { + "util": false + }, + "author": { + "name": "Isaac Z. Schlueter", + "email": "i@izs.me", + "url": "http://blog.izs.me/" + }, + "license": "MIT", + "gitHead": "0bf97a117c5646556548966409ebc57a6dda2638", + "bugs": { + "url": "https://github.com/isaacs/readable-stream/issues" + }, + "homepage": "https://github.com/isaacs/readable-stream", + "_id": "readable-stream@1.0.33", + "_shasum": "3a360dd66c1b1d7fd4705389860eda1d0f61126c", + "_from": "readable-stream@~1.0.26", + "_npmVersion": "1.4.28", + "_npmUser": { + "name": "rvagg", + "email": "rod@vagg.org" + }, + "maintainers": [ + { + "name": "isaacs", + "email": "i@izs.me" + }, + { + "name": "tootallnate", + "email": "nathan@tootallnate.net" + }, + { + "name": "rvagg", + "email": "rod@vagg.org" + } + ], + "dist": { + "shasum": "3a360dd66c1b1d7fd4705389860eda1d0f61126c", + "tarball": "http://registry.npmjs.org/readable-stream/-/readable-stream-1.0.33.tgz" + }, + "directories": {}, + "_resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.0.33.tgz", + "readme": "ERROR: No README data found!" +} diff --git a/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/bl/node_modules/readable-stream/passthrough.js b/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/bl/node_modules/readable-stream/passthrough.js new file mode 100644 index 0000000..27e8d8a --- /dev/null +++ b/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/bl/node_modules/readable-stream/passthrough.js @@ -0,0 +1 @@ +module.exports = require("./lib/_stream_passthrough.js") diff --git a/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/bl/node_modules/readable-stream/readable.js b/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/bl/node_modules/readable-stream/readable.js new file mode 100644 index 0000000..8b5337b --- /dev/null +++ b/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/bl/node_modules/readable-stream/readable.js @@ -0,0 +1,8 @@ +var Stream = require('stream'); // hack to fix a circular dependency issue when used with browserify +exports = module.exports = require('./lib/_stream_readable.js'); +exports.Stream = Stream; +exports.Readable = exports; +exports.Writable = require('./lib/_stream_writable.js'); +exports.Duplex = require('./lib/_stream_duplex.js'); +exports.Transform = require('./lib/_stream_transform.js'); +exports.PassThrough = require('./lib/_stream_passthrough.js'); diff --git a/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/bl/node_modules/readable-stream/transform.js b/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/bl/node_modules/readable-stream/transform.js new file mode 100644 index 0000000..5d482f0 --- /dev/null +++ b/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/bl/node_modules/readable-stream/transform.js @@ -0,0 +1 @@ +module.exports = require("./lib/_stream_transform.js") diff --git a/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/bl/node_modules/readable-stream/writable.js b/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/bl/node_modules/readable-stream/writable.js new file mode 100644 index 0000000..e1e9efd --- /dev/null +++ b/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/bl/node_modules/readable-stream/writable.js @@ -0,0 +1 @@ +module.exports = require("./lib/_stream_writable.js") diff --git a/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/bl/package.json b/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/bl/package.json new file mode 100644 index 0000000..13ca9ef --- /dev/null +++ b/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/bl/package.json @@ -0,0 +1,62 @@ +{ + "name": "bl", + "version": "0.9.4", + "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" + }, + "repository": { + "type": "git", + "url": "https://github.com/rvagg/bl.git" + }, + "homepage": "https://github.com/rvagg/bl", + "authors": [ + "Rod Vagg (https://github.com/rvagg)", + "Matteo Collina (https://github.com/mcollina)", + "Jarett Cruger (https://github.com/jcrugzz)" + ], + "keywords": [ + "buffer", + "buffers", + "stream", + "awesomesauce" + ], + "license": "MIT", + "dependencies": { + "readable-stream": "~1.0.26" + }, + "devDependencies": { + "tape": "~2.12.3", + "hash_file": "~0.1.1", + "faucet": "~0.0.1", + "brtapsauce": "~0.3.0" + }, + "gitHead": "e7f90703c5f90ca26f60455ea6ad0b6be4a9feee", + "bugs": { + "url": "https://github.com/rvagg/bl/issues" + }, + "_id": "bl@0.9.4", + "_shasum": "4702ddf72fbe0ecd82787c00c113aea1935ad0e7", + "_from": "bl@~0.9.0", + "_npmVersion": "2.1.18", + "_nodeVersion": "1.0.3", + "_npmUser": { + "name": "rvagg", + "email": "rod@vagg.org" + }, + "maintainers": [ + { + "name": "rvagg", + "email": "rod@vagg.org" + } + ], + "dist": { + "shasum": "4702ddf72fbe0ecd82787c00c113aea1935ad0e7", + "tarball": "http://registry.npmjs.org/bl/-/bl-0.9.4.tgz" + }, + "directories": {}, + "_resolved": "https://registry.npmjs.org/bl/-/bl-0.9.4.tgz", + "readme": "ERROR: No README data found!" +} diff --git a/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/bl/test/basic-test.js b/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/bl/test/basic-test.js new file mode 100644 index 0000000..75116a3 --- /dev/null +++ b/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/bl/test/basic-test.js @@ -0,0 +1,541 @@ +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/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/bl/test/sauce.js b/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/bl/test/sauce.js new file mode 100644 index 0000000..a6d2862 --- /dev/null +++ b/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/bl/test/sauce.js @@ -0,0 +1,38 @@ +#!/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/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/bl/test/test.js b/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/bl/test/test.js new file mode 100644 index 0000000..aa9b487 --- /dev/null +++ b/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/bl/test/test.js @@ -0,0 +1,9 @@ +require('./basic-test') + +if (!process.env.SAUCE_KEY || !process.env.SAUCE_USER) + return console.log('SAUCE_KEY and/or SAUCE_USER not set, not running sauce tests') + +if (!/v0\.10/.test(process.version)) + return console.log('Not Node v0.10.x, not running sauce tests') + +require('./sauce.js') \ No newline at end of file diff --git a/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/caseless/README.md b/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/caseless/README.md new file mode 100644 index 0000000..e5077a2 --- /dev/null +++ b/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/caseless/README.md @@ -0,0 +1,45 @@ +## Caseless -- wrap an object to set and get property with caseless semantics but also preserve caseing. + +This library is incredibly useful when working with HTTP headers. It allows you to get/set/check for headers in a caseless manner while also preserving the caseing of headers the first time they are set. + +## Usage + +```javascript +var headers = {} + , c = caseless(headers) + ; +c.set('a-Header', 'asdf') +c.get('a-header') === 'asdf' +``` + +## has(key) + +Has takes a name and if it finds a matching header will return that header name with the preserved caseing it was set with. + +```javascript +c.has('a-header') === 'a-Header' +``` + +## set(key, value[, clobber=true]) + +Set is fairly straight forward except that if the header exists and clobber is disabled it will add `','+value` to the existing header. + +```javascript +c.set('a-Header', 'fdas') +c.set('a-HEADER', 'more', false) +c.get('a-header') === 'fdsa,more' +``` + +## swap(key) + +Swaps the casing of a header with the new one that is passed in. + +```javascript +var headers = {} + , c = caseless(headers) + ; +c.set('a-Header', 'fdas') +c.swap('a-HEADER') +c.has('a-header') === 'a-HEADER' +headers === {'a-HEADER': 'fdas'} +``` diff --git a/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/caseless/index.js b/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/caseless/index.js new file mode 100644 index 0000000..607eea2 --- /dev/null +++ b/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/caseless/index.js @@ -0,0 +1,65 @@ +function Caseless (dict) { + this.dict = dict +} +Caseless.prototype.set = function (name, value, clobber) { + if (typeof name === 'object') { + for (var i in name) { + this.set(i, name[i], value) + } + } else { + if (typeof clobber === 'undefined') clobber = true + var has = this.has(name) + + if (!clobber && has) this.dict[has] = this.dict[has] + ',' + value + else this.dict[has || name] = value + return has + } +} +Caseless.prototype.has = function (name) { + var keys = Object.keys(this.dict) + , name = name.toLowerCase() + ; + for (var i=0;i - * MIT Licensed - */ - -/** - * Module dependencies. - */ - -var url = require('url'); - -/** - * Initialize a new `Cookie` with the given cookie `str` and `req`. - * - * @param {String} str - * @param {IncomingRequest} req - * @api private - */ - -var Cookie = exports = module.exports = function Cookie(str, req) { - this.str = str; - - // Map the key/val pairs - str.split(/ *; */).reduce(function(obj, pair){ - var p = pair.indexOf('='); - var key = p > 0 ? pair.substring(0, p).trim() : pair.trim(); - var lowerCasedKey = key.toLowerCase(); - var value = p > 0 ? pair.substring(p + 1).trim() : true; - - if (!obj.name) { - // First key is the name - obj.name = key; - obj.value = value; - } - else if (lowerCasedKey === 'httponly') { - obj.httpOnly = value; - } - else { - obj[lowerCasedKey] = value; - } - return obj; - }, this); - - // Expires - this.expires = this.expires - ? new Date(this.expires) - : Infinity; - - // Default or trim path - this.path = this.path - ? this.path.trim(): req - ? url.parse(req.url).pathname: '/'; -}; - -/** - * Return the original cookie string. - * - * @return {String} - * @api public - */ - -Cookie.prototype.toString = function(){ - return this.str; -}; - -module.exports.Jar = require('./jar') \ No newline at end of file diff --git a/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/cookie-jar/jar.js b/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/cookie-jar/jar.js deleted file mode 100644 index 34920e0..0000000 --- a/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/cookie-jar/jar.js +++ /dev/null @@ -1,72 +0,0 @@ -/*! -* Tobi - CookieJar -* Copyright(c) 2010 LearnBoost -* MIT Licensed -*/ - -/** -* Module dependencies. -*/ - -var url = require('url'); - -/** -* Initialize a new `CookieJar`. -* -* @api private -*/ - -var CookieJar = exports = module.exports = function CookieJar() { - this.cookies = []; -}; - -/** -* Add the given `cookie` to the jar. -* -* @param {Cookie} cookie -* @api private -*/ - -CookieJar.prototype.add = function(cookie){ - this.cookies = this.cookies.filter(function(c){ - // Avoid duplication (same path, same name) - return !(c.name == cookie.name && c.path == cookie.path); - }); - this.cookies.push(cookie); -}; - -/** -* Get cookies for the given `req`. -* -* @param {IncomingRequest} req -* @return {Array} -* @api private -*/ - -CookieJar.prototype.get = function(req){ - var path = url.parse(req.url).pathname - , now = new Date - , specificity = {}; - return this.cookies.filter(function(cookie){ - if (0 == path.indexOf(cookie.path) && now < cookie.expires - && cookie.path.length > (specificity[cookie.name] || 0)) - return specificity[cookie.name] = cookie.path.length; - }); -}; - -/** -* Return Cookie string for the given `req`. -* -* @param {IncomingRequest} req -* @return {String} -* @api private -*/ - -CookieJar.prototype.cookieString = function(req){ - var cookies = this.get(req); - if (cookies.length) { - return cookies.map(function(cookie){ - return cookie.name + '=' + cookie.value; - }).join('; '); - } -}; diff --git a/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/cookie-jar/package.json b/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/cookie-jar/package.json deleted file mode 100644 index b7a2610..0000000 --- a/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/cookie-jar/package.json +++ /dev/null @@ -1,49 +0,0 @@ -{ - "author": { - "name": "Mikeal Rogers", - "email": "mikeal.rogers@gmail.com", - "url": "http://www.futurealoof.com" - }, - "name": "cookie-jar", - "description": "Cookie Jar. Originally pulled form tobi, maintained as vendor in request, now a standalone module.", - "version": "0.3.0", - "repository": { - "url": "https://github.com/mikeal/cookie-jar" - }, - "main": "index.js", - "scripts": { - "test": "node tests/run.js" - }, - "dependencies": {}, - "devDependencies": {}, - "optionalDependencies": {}, - "engines": { - "node": "*" - }, - "readme": "cookie-jar\n==========\n\nCookie Jar. Originally pulled from LearnBoost/tobi, maintained as vendor in request, now a standalone module.\n", - "readmeFilename": "README.md", - "_id": "cookie-jar@0.3.0", - "dist": { - "shasum": "bc9a27d4e2b97e186cd57c9e2063cb99fa68cccc", - "tarball": "http://registry.npmjs.org/cookie-jar/-/cookie-jar-0.3.0.tgz" - }, - "_from": "cookie-jar@~0.3.0", - "_npmVersion": "1.2.14", - "_npmUser": { - "name": "mikeal", - "email": "mikeal.rogers@gmail.com" - }, - "maintainers": [ - { - "name": "mikeal", - "email": "mikeal.rogers@gmail.com" - } - ], - "directories": {}, - "_shasum": "bc9a27d4e2b97e186cd57c9e2063cb99fa68cccc", - "_resolved": "https://registry.npmjs.org/cookie-jar/-/cookie-jar-0.3.0.tgz", - "bugs": { - "url": "https://github.com/mikeal/cookie-jar/issues" - }, - "homepage": "https://github.com/mikeal/cookie-jar" -} diff --git a/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/cookie-jar/tests/run.js b/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/cookie-jar/tests/run.js deleted file mode 100644 index e717f02..0000000 --- a/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/cookie-jar/tests/run.js +++ /dev/null @@ -1,40 +0,0 @@ -var spawn = require('child_process').spawn - , exitCode = 0 - , timeout = 10000 - , fs = require('fs') - ; - -fs.readdir(__dirname, function (e, files) { - if (e) throw e - - var tests = files.filter(function (f) {return f.slice(0, 'test-'.length) === 'test-'}) - - var next = function () { - if (tests.length === 0) process.exit(exitCode); - - var file = tests.shift() - console.log(file) - var proc = spawn('node', [ 'tests/' + file ]) - - var killed = false - var t = setTimeout(function () { - proc.kill() - exitCode += 1 - console.error(file + ' timeout') - killed = true - }, timeout) - - proc.stdout.pipe(process.stdout) - proc.stderr.pipe(process.stderr) - proc.on('exit', function (code) { - if (code && !killed) console.error(file + ' failed') - exitCode += code || 0 - clearTimeout(t) - next() - }) - } - next() - -}) - - diff --git a/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/cookie-jar/tests/test-cookie.js b/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/cookie-jar/tests/test-cookie.js deleted file mode 100644 index 2cdc835..0000000 --- a/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/cookie-jar/tests/test-cookie.js +++ /dev/null @@ -1,29 +0,0 @@ -var Cookie = require('../index') - , assert = require('assert'); - -var str = 'Sid="s543qactge.wKE61E01Bs%2BKhzmxrwrnug="; Path=/; httpOnly; Expires=Sat, 04 Dec 2010 23:27:28 GMT'; -var cookie = new Cookie(str); - -// test .toString() -assert.equal(cookie.toString(), str); - -// test .path -assert.equal(cookie.path, '/'); - -// test .httpOnly -assert.equal(cookie.httpOnly, true); - -// test .name -assert.equal(cookie.name, 'Sid'); - -// test .value -assert.equal(cookie.value, '"s543qactge.wKE61E01Bs%2BKhzmxrwrnug="'); - -// test .expires -assert.equal(cookie.expires instanceof Date, true); - -// test .path default -var cookie = new Cookie('foo=bar', { url: 'http://foo.com/bar' }); -assert.equal(cookie.path, '/bar'); - -console.log('All tests passed'); diff --git a/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/cookie-jar/tests/test-cookiejar.js b/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/cookie-jar/tests/test-cookiejar.js deleted file mode 100644 index a33cfb2..0000000 --- a/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/cookie-jar/tests/test-cookiejar.js +++ /dev/null @@ -1,90 +0,0 @@ -var Cookie = require('../index') - , Jar = Cookie.Jar - , assert = require('assert'); - -function expires(ms) { - return new Date(Date.now() + ms).toUTCString(); -} - -// test .get() expiration -(function() { - var jar = new Jar; - var cookie = new Cookie('sid=1234; path=/; expires=' + expires(1000)); - jar.add(cookie); - setTimeout(function(){ - var cookies = jar.get({ url: 'http://foo.com/foo' }); - assert.equal(cookies.length, 1); - assert.equal(cookies[0], cookie); - setTimeout(function(){ - var cookies = jar.get({ url: 'http://foo.com/foo' }); - assert.equal(cookies.length, 0); - }, 1000); - }, 5); -})(); - -// test .get() path support -(function() { - var jar = new Jar; - var a = new Cookie('sid=1234; path=/'); - var b = new Cookie('sid=1111; path=/foo/bar'); - var c = new Cookie('sid=2222; path=/'); - jar.add(a); - jar.add(b); - jar.add(c); - - // should remove the duplicates - assert.equal(jar.cookies.length, 2); - - // same name, same path, latter prevails - var cookies = jar.get({ url: 'http://foo.com/' }); - assert.equal(cookies.length, 1); - assert.equal(cookies[0], c); - - // same name, diff path, path specifity prevails, latter prevails - var cookies = jar.get({ url: 'http://foo.com/foo/bar' }); - assert.equal(cookies.length, 1); - assert.equal(cookies[0], b); - - var jar = new Jar; - var a = new Cookie('sid=1111; path=/foo/bar'); - var b = new Cookie('sid=1234; path=/'); - jar.add(a); - jar.add(b); - - var cookies = jar.get({ url: 'http://foo.com/foo/bar' }); - assert.equal(cookies.length, 1); - assert.equal(cookies[0], a); - - var cookies = jar.get({ url: 'http://foo.com/' }); - assert.equal(cookies.length, 1); - assert.equal(cookies[0], b); - - var jar = new Jar; - var a = new Cookie('sid=1111; path=/foo/bar'); - var b = new Cookie('sid=3333; path=/foo/bar'); - var c = new Cookie('pid=3333; path=/foo/bar'); - var d = new Cookie('sid=2222; path=/foo/'); - var e = new Cookie('sid=1234; path=/'); - jar.add(a); - jar.add(b); - jar.add(c); - jar.add(d); - jar.add(e); - - var cookies = jar.get({ url: 'http://foo.com/foo/bar' }); - assert.equal(cookies.length, 2); - assert.equal(cookies[0], b); - assert.equal(cookies[1], c); - - var cookies = jar.get({ url: 'http://foo.com/foo/' }); - assert.equal(cookies.length, 1); - assert.equal(cookies[0], d); - - var cookies = jar.get({ url: 'http://foo.com/' }); - assert.equal(cookies.length, 1); - assert.equal(cookies[0], e); -})(); - -setTimeout(function() { - console.log('All tests passed'); -}, 1200); diff --git a/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/form-data/lib/form_data.js b/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/form-data/lib/form_data.js index b8bd158..5b33f55 100644 --- a/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/form-data/lib/form_data.js +++ b/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/form-data/lib/form_data.js @@ -5,7 +5,7 @@ var http = require('http'); var https = require('https'); var parseUrl = require('url').parse; var fs = require('fs'); -var mime = require('mime'); +var mime = require('mime-types'); var async = require('async'); module.exports = FormData; diff --git a/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/form-data/node_modules/mime-types/HISTORY.md b/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/form-data/node_modules/mime-types/HISTORY.md new file mode 100644 index 0000000..da8b3f8 --- /dev/null +++ b/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/form-data/node_modules/mime-types/HISTORY.md @@ -0,0 +1,85 @@ +2.0.9 / 2015-02-09 +================== + + * deps: mime-db@~1.7.0 + - Add new mime types + - Community extensions ownership transferred from `node-mime` + +2.0.8 / 2015-01-29 +================== + + * deps: mime-db@~1.6.0 + - Add new mime types + +2.0.7 / 2014-12-30 +================== + + * deps: mime-db@~1.5.0 + - Add new mime types + - Fix various invalid MIME type entries + +2.0.6 / 2014-12-30 +================== + + * deps: mime-db@~1.4.0 + - Add new mime types + - Fix various invalid MIME type entries + - Remove example template MIME types + +2.0.5 / 2014-12-29 +================== + + * deps: mime-db@~1.3.1 + - Fix missing extensions + +2.0.4 / 2014-12-10 +================== + + * deps: mime-db@~1.3.0 + - Add new mime types + +2.0.3 / 2014-11-09 +================== + + * deps: mime-db@~1.2.0 + - Add new mime types + +2.0.2 / 2014-09-28 +================== + + * deps: mime-db@~1.1.0 + - Add new mime types + - Add additional compressible + - Update charsets + +2.0.1 / 2014-09-07 +================== + + * Support Node.js 0.6 + +2.0.0 / 2014-09-02 +================== + + * Use `mime-db` + * Remove `.define()` + +1.0.2 / 2014-08-04 +================== + + * Set charset=utf-8 for `text/javascript` + +1.0.1 / 2014-06-24 +================== + + * Add `text/jsx` type + +1.0.0 / 2014-05-12 +================== + + * Return `false` for unknown types + * Set charset=utf-8 for `application/json` + +0.1.0 / 2014-05-02 +================== + + * Initial release diff --git a/node_modules/csurf/node_modules/csrf/node_modules/uid-safe/node_modules/mz/LICENSE b/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/form-data/node_modules/mime-types/LICENSE similarity index 100% rename from node_modules/csurf/node_modules/csrf/node_modules/uid-safe/node_modules/mz/LICENSE rename to node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/form-data/node_modules/mime-types/LICENSE diff --git a/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/form-data/node_modules/mime-types/README.md b/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/form-data/node_modules/mime-types/README.md new file mode 100644 index 0000000..99d658b --- /dev/null +++ b/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/form-data/node_modules/mime-types/README.md @@ -0,0 +1,99 @@ +# mime-types + +[![NPM Version][npm-image]][npm-url] +[![NPM Downloads][downloads-image]][downloads-url] +[![Node.js Version][node-version-image]][node-version-url] +[![Build Status][travis-image]][travis-url] +[![Test Coverage][coveralls-image]][coveralls-url] + +The ultimate javascript content-type utility. + +Similar to [node-mime](https://github.com/broofa/node-mime), except: + +- __No fallbacks.__ Instead of naively returning the first available type, `mime-types` simply returns `false`, + so do `var type = mime.lookup('unrecognized') || 'application/octet-stream'`. +- No `new Mime()` business, so you could do `var lookup = require('mime-types').lookup`. +- Additional mime types are added such as jade and stylus via [mime-db](https://github.com/jshttp/mime-db) +- No `.define()` functionality + +Otherwise, the API is compatible. + +## Install + +```sh +$ npm install mime-types +``` + +## Adding Types + +All mime types are based on [mime-db](https://github.com/jshttp/mime-db), +so open a PR there if you'd like to add mime types. + +## API + +```js +var mime = require('mime-types') +``` + +All functions return `false` if input is invalid or not found. + +### mime.lookup(path) + +Lookup the content-type associated with a file. + +```js +mime.lookup('json') // 'application/json' +mime.lookup('.md') // 'text/x-markdown' +mime.lookup('file.html') // 'text/html' +mime.lookup('folder/file.js') // 'application/javascript' + +mime.lookup('cats') // false +``` + +### mime.contentType(type) + +Create a full content-type header given a content-type or extension. + +```js +mime.contentType('markdown') // 'text/x-markdown; charset=utf-8' +mime.contentType('file.json') // 'application/json; charset=utf-8' +``` + +### mime.extension(type) + +Get the default extension for a content-type. + +```js +mime.extension('application/octet-stream') // 'bin' +``` + +### mime.charset(type) + +Lookup the implied default charset of a content-type. + +```js +mime.charset('text/x-markdown') // 'UTF-8' +``` + +### var type = mime.types[extension] + +A map of content-types by extension. + +### [extensions...] = mime.extensions[type] + +A map of extensions by content-type. + +## License + +[MIT](LICENSE) + +[npm-image]: https://img.shields.io/npm/v/mime-types.svg?style=flat +[npm-url]: https://npmjs.org/package/mime-types +[node-version-image]: https://img.shields.io/badge/node.js-%3E%3D_0.6-brightgreen.svg?style=flat +[node-version-url]: http://nodejs.org/download/ +[travis-image]: https://img.shields.io/travis/jshttp/mime-types.svg?style=flat +[travis-url]: https://travis-ci.org/jshttp/mime-types +[coveralls-image]: https://img.shields.io/coveralls/jshttp/mime-types.svg?style=flat +[coveralls-url]: https://coveralls.io/r/jshttp/mime-types +[downloads-image]: https://img.shields.io/npm/dm/mime-types.svg?style=flat +[downloads-url]: https://npmjs.org/package/mime-types diff --git a/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/form-data/node_modules/mime-types/index.js b/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/form-data/node_modules/mime-types/index.js new file mode 100644 index 0000000..b46a202 --- /dev/null +++ b/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/form-data/node_modules/mime-types/index.js @@ -0,0 +1,63 @@ + +var db = require('mime-db') + +// types[extension] = type +exports.types = Object.create(null) +// extensions[type] = [extensions] +exports.extensions = Object.create(null) + +Object.keys(db).forEach(function (name) { + var mime = db[name] + var exts = mime.extensions + if (!exts || !exts.length) return + exports.extensions[name] = exts + exts.forEach(function (ext) { + exports.types[ext] = name + }) +}) + +exports.lookup = function (string) { + if (!string || typeof string !== "string") return false + // remove any leading paths, though we should just use path.basename + string = string.replace(/.*[\.\/\\]/, '').toLowerCase() + if (!string) return false + return exports.types[string] || false +} + +exports.extension = function (type) { + if (!type || typeof type !== "string") return false + // to do: use media-typer + type = type.match(/^\s*([^;\s]*)(?:;|\s|$)/) + if (!type) return false + var exts = exports.extensions[type[1].toLowerCase()] + if (!exts || !exts.length) return false + return exts[0] +} + +// type has to be an exact mime type +exports.charset = function (type) { + var mime = db[type] + if (mime && mime.charset) return mime.charset + + // default text/* to utf-8 + if (/^text\//.test(type)) return 'UTF-8' + + return false +} + +// backwards compatibility +exports.charsets = { + lookup: exports.charset +} + +// to do: maybe use set-type module or something +exports.contentType = function (type) { + if (!type || typeof type !== "string") return false + if (!~type.indexOf('/')) type = exports.lookup(type) + if (!type) return false + if (!~type.indexOf('charset')) { + var charset = exports.charset(type) + if (charset) type += '; charset=' + charset.toLowerCase() + } + return type +} diff --git a/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/form-data/node_modules/mime-types/node_modules/mime-db/HISTORY.md b/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/form-data/node_modules/mime-types/node_modules/mime-db/HISTORY.md new file mode 100644 index 0000000..e5ffba4 --- /dev/null +++ b/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/form-data/node_modules/mime-types/node_modules/mime-db/HISTORY.md @@ -0,0 +1,166 @@ +1.7.0 / 2015-02-08 +================== + + * Add `application/vnd.gerber` + * Add `application/vnd.msa-disk-image` + +1.6.1 / 2015-02-05 +================== + + * Community extensions ownership transferred from `node-mime` + +1.6.0 / 2015-01-29 +================== + + * Add `application/jose` + * Add `application/jose+json` + * Add `application/json-seq` + * Add `application/jwk+json` + * Add `application/jwk-set+json` + * Add `application/jwt` + * Add `application/rdap+json` + * Add `application/vnd.gov.sk.e-form+xml` + * Add `application/vnd.ims.imsccv1p3` + +1.5.0 / 2014-12-30 +================== + + * Add `application/vnd.oracle.resource+json` + * Fix various invalid MIME type entries + - `application/mbox+xml` + - `application/oscp-response` + - `application/vwg-multiplexed` + - `audio/g721` + +1.4.0 / 2014-12-21 +================== + + * Add `application/vnd.ims.imsccv1p2` + * Fix various invalid MIME type entries + - `application/vnd-acucobol` + - `application/vnd-curl` + - `application/vnd-dart` + - `application/vnd-dxr` + - `application/vnd-fdf` + - `application/vnd-mif` + - `application/vnd-sema` + - `application/vnd-wap-wmlc` + - `application/vnd.adobe.flash-movie` + - `application/vnd.dece-zip` + - `application/vnd.dvb_service` + - `application/vnd.micrografx-igx` + - `application/vnd.sealed-doc` + - `application/vnd.sealed-eml` + - `application/vnd.sealed-mht` + - `application/vnd.sealed-ppt` + - `application/vnd.sealed-tiff` + - `application/vnd.sealed-xls` + - `application/vnd.sealedmedia.softseal-html` + - `application/vnd.sealedmedia.softseal-pdf` + - `application/vnd.wap-slc` + - `application/vnd.wap-wbxml` + - `audio/vnd.sealedmedia.softseal-mpeg` + - `image/vnd-djvu` + - `image/vnd-svf` + - `image/vnd-wap-wbmp` + - `image/vnd.sealed-png` + - `image/vnd.sealedmedia.softseal-gif` + - `image/vnd.sealedmedia.softseal-jpg` + - `model/vnd-dwf` + - `model/vnd.parasolid.transmit-binary` + - `model/vnd.parasolid.transmit-text` + - `text/vnd-a` + - `text/vnd-curl` + - `text/vnd.wap-wml` + * Remove example template MIME types + - `application/example` + - `audio/example` + - `image/example` + - `message/example` + - `model/example` + - `multipart/example` + - `text/example` + - `video/example` + +1.3.1 / 2014-12-16 +================== + + * Fix missing extensions + - `application/json5` + - `text/hjson` + +1.3.0 / 2014-12-07 +================== + + * Add `application/a2l` + * Add `application/aml` + * Add `application/atfx` + * Add `application/atxml` + * Add `application/cdfx+xml` + * Add `application/dii` + * Add `application/json5` + * Add `application/lxf` + * Add `application/mf4` + * Add `application/vnd.apache.thrift.compact` + * Add `application/vnd.apache.thrift.json` + * Add `application/vnd.coffeescript` + * Add `application/vnd.enphase.envoy` + * Add `application/vnd.ims.imsccv1p1` + * Add `text/csv-schema` + * Add `text/hjson` + * Add `text/markdown` + * Add `text/yaml` + +1.2.0 / 2014-11-09 +================== + + * Add `application/cea` + * Add `application/dit` + * Add `application/vnd.gov.sk.e-form+zip` + * Add `application/vnd.tmd.mediaflex.api+xml` + * Type `application/epub+zip` is now IANA-registered + +1.1.2 / 2014-10-23 +================== + + * Rebuild database for `application/x-www-form-urlencoded` change + +1.1.1 / 2014-10-20 +================== + + * Mark `application/x-www-form-urlencoded` as compressible. + +1.1.0 / 2014-09-28 +================== + + * Add `application/font-woff2` + +1.0.3 / 2014-09-25 +================== + + * Fix engine requirement in package + +1.0.2 / 2014-09-25 +================== + + * Add `application/coap-group+json` + * Add `application/dcd` + * Add `application/vnd.apache.thrift.binary` + * Add `image/vnd.tencent.tap` + * Mark all JSON-derived types as compressible + * Update `text/vtt` data + +1.0.1 / 2014-08-30 +================== + + * Fix extension ordering + +1.0.0 / 2014-08-30 +================== + + * Add `application/atf` + * Add `application/merge-patch+json` + * Add `multipart/x-mixed-replace` + * Add `source: 'apache'` metadata + * Add `source: 'iana'` metadata + * Remove badly-assumed charset data diff --git a/node_modules/csurf/node_modules/csrf/node_modules/uid-safe/node_modules/mz/node_modules/native-or-bluebird/LICENSE b/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/form-data/node_modules/mime-types/node_modules/mime-db/LICENSE similarity index 100% rename from node_modules/csurf/node_modules/csrf/node_modules/uid-safe/node_modules/mz/node_modules/native-or-bluebird/LICENSE rename to node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/form-data/node_modules/mime-types/node_modules/mime-db/LICENSE diff --git a/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/form-data/node_modules/mime-types/node_modules/mime-db/README.md b/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/form-data/node_modules/mime-types/node_modules/mime-db/README.md new file mode 100644 index 0000000..1dde234 --- /dev/null +++ b/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/form-data/node_modules/mime-types/node_modules/mime-db/README.md @@ -0,0 +1,76 @@ +# mime-db + +[![NPM Version][npm-version-image]][npm-url] +[![NPM Downloads][npm-downloads-image]][npm-url] +[![Node.js Version][node-image]][node-url] +[![Build Status][travis-image]][travis-url] +[![Coverage Status][coveralls-image]][coveralls-url] + +This is a database of all mime types. +It consists of a single, public JSON file and does not include any logic, +allowing it to remain as un-opinionated as possible with an API. +It aggregates data from the following sources: + +- http://www.iana.org/assignments/media-types/media-types.xhtml +- http://svn.apache.org/repos/asf/httpd/httpd/trunk/docs/conf/mime.types + +## Installation + +```bash +npm install mime-db +``` + +If you're crazy enough to use this in the browser, +you can just grab the JSON file: + +``` +https://cdn.rawgit.com/jshttp/mime-db/master/db.json +``` + +## Usage + +```js +var db = require('mime-db'); + +// grab data on .js files +var data = db['application/javascript']; +``` + +## Data Structure + +The JSON file is a map lookup for lowercased mime types. +Each mime type has the following properties: + +- `.source` - where the mime type is defined. + If not set, it's probably a custom media type. + - `apache` - [Apache common media types](http://svn.apache.org/repos/asf/httpd/httpd/trunk/docs/conf/mime.types) + - `iana` - [IANA-defined media types](http://www.iana.org/assignments/media-types/media-types.xhtml) +- `.extensions[]` - known extensions associated with this mime type. +- `.compressible` - whether a file of this type is can be gzipped. +- `.charset` - the default charset associated with this type, if any. + +If unknown, every property could be `undefined`. + +## Contributing + +To edit the database, only make PRs against `src/custom.json` or +`src/custom-suffix.json`. + +To update the build, run `npm run update`. + +## Adding Custom Media Types + +The best way to get new media types included in this library is to register +them with the IANA. The community registration procedure is outlined in +[RFC 6838 section 5](http://tools.ietf.org/html/rfc6838#section-5). Types +registered with the IANA are automatically pulled into this library. + +[npm-version-image]: https://img.shields.io/npm/v/mime-db.svg?style=flat +[npm-downloads-image]: https://img.shields.io/npm/dm/mime-db.svg?style=flat +[npm-url]: https://npmjs.org/package/mime-db +[travis-image]: https://img.shields.io/travis/jshttp/mime-db.svg?style=flat +[travis-url]: https://travis-ci.org/jshttp/mime-db +[coveralls-image]: https://img.shields.io/coveralls/jshttp/mime-db.svg?style=flat +[coveralls-url]: https://coveralls.io/r/jshttp/mime-db?branch=master +[node-image]: https://img.shields.io/node/v/mime-db.svg?style=flat +[node-url]: http://nodejs.org/download/ diff --git a/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/form-data/node_modules/mime-types/node_modules/mime-db/db.json b/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/form-data/node_modules/mime-types/node_modules/mime-db/db.json new file mode 100644 index 0000000..283c1de --- /dev/null +++ b/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/form-data/node_modules/mime-types/node_modules/mime-db/db.json @@ -0,0 +1,6299 @@ +{ + "application/1d-interleaved-parityfec": { + "source": "iana" + }, + "application/3gpdash-qoe-report+xml": { + "source": "iana" + }, + "application/3gpp-ims+xml": { + "source": "iana" + }, + "application/a2l": { + "source": "iana" + }, + "application/activemessage": { + "source": "iana" + }, + "application/alto-costmap+json": { + "source": "iana", + "compressible": true + }, + "application/alto-costmapfilter+json": { + "source": "iana", + "compressible": true + }, + "application/alto-directory+json": { + "source": "iana", + "compressible": true + }, + "application/alto-endpointcost+json": { + "source": "iana", + "compressible": true + }, + "application/alto-endpointcostparams+json": { + "source": "iana", + "compressible": true + }, + "application/alto-endpointprop+json": { + "source": "iana", + "compressible": true + }, + "application/alto-endpointpropparams+json": { + "source": "iana", + "compressible": true + }, + "application/alto-error+json": { + "source": "iana", + "compressible": true + }, + "application/alto-networkmap+json": { + "source": "iana", + "compressible": true + }, + "application/alto-networkmapfilter+json": { + "source": "iana", + "compressible": true + }, + "application/aml": { + "source": "iana" + }, + "application/andrew-inset": { + "source": "iana", + "extensions": ["ez"] + }, + "application/applefile": { + "source": "iana" + }, + "application/applixware": { + "source": "apache", + "extensions": ["aw"] + }, + "application/atf": { + "source": "iana" + }, + "application/atfx": { + "source": "iana" + }, + "application/atom+xml": { + "source": "iana", + "compressible": true, + "extensions": ["atom"] + }, + "application/atomcat+xml": { + "source": "iana", + "extensions": ["atomcat"] + }, + "application/atomdeleted+xml": { + "source": "iana" + }, + "application/atomicmail": { + "source": "iana" + }, + "application/atomsvc+xml": { + "source": "iana", + "extensions": ["atomsvc"] + }, + "application/atxml": { + "source": "iana" + }, + "application/auth-policy+xml": { + "source": "iana" + }, + "application/bacnet-xdd+zip": { + "source": "iana" + }, + "application/batch-smtp": { + "source": "iana" + }, + "application/beep+xml": { + "source": "iana" + }, + "application/calendar+json": { + "source": "iana", + "compressible": true + }, + "application/calendar+xml": { + "source": "iana" + }, + "application/call-completion": { + "source": "iana" + }, + "application/cals-1840": { + "source": "iana" + }, + "application/cbor": { + "source": "iana" + }, + "application/ccmp+xml": { + "source": "iana" + }, + "application/ccxml+xml": { + "source": "iana", + "extensions": ["ccxml"] + }, + "application/cdfx+xml": { + "source": "iana" + }, + "application/cdmi-capability": { + "source": "iana", + "extensions": ["cdmia"] + }, + "application/cdmi-container": { + "source": "iana", + "extensions": ["cdmic"] + }, + "application/cdmi-domain": { + "source": "iana", + "extensions": ["cdmid"] + }, + "application/cdmi-object": { + "source": "iana", + "extensions": ["cdmio"] + }, + "application/cdmi-queue": { + "source": "iana", + "extensions": ["cdmiq"] + }, + "application/cea": { + "source": "iana" + }, + "application/cea-2018+xml": { + "source": "iana" + }, + "application/cellml+xml": { + "source": "iana" + }, + "application/cfw": { + "source": "iana" + }, + "application/cms": { + "source": "iana" + }, + "application/cnrp+xml": { + "source": "iana" + }, + "application/coap-group+json": { + "source": "iana", + "compressible": true + }, + "application/commonground": { + "source": "iana" + }, + "application/conference-info+xml": { + "source": "iana" + }, + "application/cpl+xml": { + "source": "iana" + }, + "application/csrattrs": { + "source": "iana" + }, + "application/csta+xml": { + "source": "iana" + }, + "application/cstadata+xml": { + "source": "iana" + }, + "application/cu-seeme": { + "source": "apache", + "extensions": ["cu"] + }, + "application/cybercash": { + "source": "iana" + }, + "application/dart": { + "compressible": true + }, + "application/dash+xml": { + "source": "iana", + "extensions": ["mdp"] + }, + "application/dashdelta": { + "source": "iana" + }, + "application/davmount+xml": { + "source": "iana", + "extensions": ["davmount"] + }, + "application/dca-rft": { + "source": "iana" + }, + "application/dcd": { + "source": "iana" + }, + "application/dec-dx": { + "source": "iana" + }, + "application/dialog-info+xml": { + "source": "iana" + }, + "application/dicom": { + "source": "iana" + }, + "application/dii": { + "source": "iana" + }, + "application/dit": { + "source": "iana" + }, + "application/dns": { + "source": "iana" + }, + "application/docbook+xml": { + "source": "apache", + "extensions": ["dbk"] + }, + "application/dskpp+xml": { + "source": "iana" + }, + "application/dssc+der": { + "source": "iana", + "extensions": ["dssc"] + }, + "application/dssc+xml": { + "source": "iana", + "extensions": ["xdssc"] + }, + "application/dvcs": { + "source": "iana" + }, + "application/ecmascript": { + "source": "iana", + "compressible": true, + "extensions": ["ecma"] + }, + "application/edi-consent": { + "source": "iana" + }, + "application/edi-x12": { + "source": "iana", + "compressible": false + }, + "application/edifact": { + "source": "iana", + "compressible": false + }, + "application/emma+xml": { + "source": "iana", + "extensions": ["emma"] + }, + "application/emotionml+xml": { + "source": "iana" + }, + "application/encaprtp": { + "source": "iana" + }, + "application/epp+xml": { + "source": "iana" + }, + "application/epub+zip": { + "source": "iana", + "extensions": ["epub"] + }, + "application/eshop": { + "source": "iana" + }, + "application/exi": { + "source": "iana", + "extensions": ["exi"] + }, + "application/fastinfoset": { + "source": "iana" + }, + "application/fastsoap": { + "source": "iana" + }, + "application/fdt+xml": { + "source": "iana" + }, + "application/fits": { + "source": "iana" + }, + "application/font-sfnt": { + "source": "iana" + }, + "application/font-tdpfr": { + "source": "iana", + "extensions": ["pfr"] + }, + "application/font-woff": { + "source": "iana", + "compressible": false, + "extensions": ["woff"] + }, + "application/font-woff2": { + "compressible": false, + "extensions": ["woff2"] + }, + "application/framework-attributes+xml": { + "source": "iana" + }, + "application/gml+xml": { + "source": "apache", + "extensions": ["gml"] + }, + "application/gpx+xml": { + "source": "apache", + "extensions": ["gpx"] + }, + "application/gxf": { + "source": "apache", + "extensions": ["gxf"] + }, + "application/gzip": { + "source": "iana", + "compressible": false + }, + "application/h224": { + "source": "iana" + }, + "application/held+xml": { + "source": "iana" + }, + "application/http": { + "source": "iana" + }, + "application/hyperstudio": { + "source": "iana", + "extensions": ["stk"] + }, + "application/ibe-key-request+xml": { + "source": "iana" + }, + "application/ibe-pkg-reply+xml": { + "source": "iana" + }, + "application/ibe-pp-data": { + "source": "iana" + }, + "application/iges": { + "source": "iana" + }, + "application/im-iscomposing+xml": { + "source": "iana" + }, + "application/index": { + "source": "iana" + }, + "application/index.cmd": { + "source": "iana" + }, + "application/index.obj": { + "source": "iana" + }, + "application/index.response": { + "source": "iana" + }, + "application/index.vnd": { + "source": "iana" + }, + "application/inkml+xml": { + "source": "iana", + "extensions": ["ink","inkml"] + }, + "application/iotp": { + "source": "iana" + }, + "application/ipfix": { + "source": "iana", + "extensions": ["ipfix"] + }, + "application/ipp": { + "source": "iana" + }, + "application/isup": { + "source": "iana" + }, + "application/its+xml": { + "source": "iana" + }, + "application/java-archive": { + "source": "apache", + "compressible": false, + "extensions": ["jar"] + }, + "application/java-serialized-object": { + "source": "apache", + "compressible": false, + "extensions": ["ser"] + }, + "application/java-vm": { + "source": "apache", + "compressible": false, + "extensions": ["class"] + }, + "application/javascript": { + "source": "iana", + "charset": "UTF-8", + "compressible": true, + "extensions": ["js"] + }, + "application/jose": { + "source": "iana" + }, + "application/jose+json": { + "source": "iana", + "compressible": true + }, + "application/jrd+json": { + "source": "iana", + "compressible": true + }, + "application/json": { + "source": "iana", + "charset": "UTF-8", + "compressible": true, + "extensions": ["json","map"] + }, + "application/json-patch+json": { + "source": "iana", + "compressible": true + }, + "application/json-seq": { + "source": "iana" + }, + "application/json5": { + "extensions": ["json5"] + }, + "application/jsonml+json": { + "source": "apache", + "compressible": true, + "extensions": ["jsonml"] + }, + "application/jwk+json": { + "source": "iana", + "compressible": true + }, + "application/jwk-set+json": { + "source": "iana", + "compressible": true + }, + "application/jwt": { + "source": "iana" + }, + "application/kpml-request+xml": { + "source": "iana" + }, + "application/kpml-response+xml": { + "source": "iana" + }, + "application/ld+json": { + "source": "iana", + "compressible": true + }, + "application/link-format": { + "source": "iana" + }, + "application/load-control+xml": { + "source": "iana" + }, + "application/lost+xml": { + "source": "iana", + "extensions": ["lostxml"] + }, + "application/lostsync+xml": { + "source": "iana" + }, + "application/lxf": { + "source": "iana" + }, + "application/mac-binhex40": { + "source": "iana", + "extensions": ["hqx"] + }, + "application/mac-compactpro": { + "source": "apache", + "extensions": ["cpt"] + }, + "application/macwriteii": { + "source": "iana" + }, + "application/mads+xml": { + "source": "iana", + "extensions": ["mads"] + }, + "application/marc": { + "source": "iana", + "extensions": ["mrc"] + }, + "application/marcxml+xml": { + "source": "iana", + "extensions": ["mrcx"] + }, + "application/mathematica": { + "source": "iana", + "extensions": ["ma","nb","mb"] + }, + "application/mathml+xml": { + "source": "iana", + "extensions": ["mathml"] + }, + "application/mathml-content+xml": { + "source": "iana" + }, + "application/mathml-presentation+xml": { + "source": "iana" + }, + "application/mbms-associated-procedure-description+xml": { + "source": "iana" + }, + "application/mbms-deregister+xml": { + "source": "iana" + }, + "application/mbms-envelope+xml": { + "source": "iana" + }, + "application/mbms-msk+xml": { + "source": "iana" + }, + "application/mbms-msk-response+xml": { + "source": "iana" + }, + "application/mbms-protection-description+xml": { + "source": "iana" + }, + "application/mbms-reception-report+xml": { + "source": "iana" + }, + "application/mbms-register+xml": { + "source": "iana" + }, + "application/mbms-register-response+xml": { + "source": "iana" + }, + "application/mbms-schedule+xml": { + "source": "iana" + }, + "application/mbms-user-service-description+xml": { + "source": "iana" + }, + "application/mbox": { + "source": "iana", + "extensions": ["mbox"] + }, + "application/media-policy-dataset+xml": { + "source": "iana" + }, + "application/media_control+xml": { + "source": "iana" + }, + "application/mediaservercontrol+xml": { + "source": "iana", + "extensions": ["mscml"] + }, + "application/merge-patch+json": { + "source": "iana", + "compressible": true + }, + "application/metalink+xml": { + "source": "apache", + "extensions": ["metalink"] + }, + "application/metalink4+xml": { + "source": "iana", + "extensions": ["meta4"] + }, + "application/mets+xml": { + "source": "iana", + "extensions": ["mets"] + }, + "application/mf4": { + "source": "iana" + }, + "application/mikey": { + "source": "iana" + }, + "application/mods+xml": { + "source": "iana", + "extensions": ["mods"] + }, + "application/moss-keys": { + "source": "iana" + }, + "application/moss-signature": { + "source": "iana" + }, + "application/mosskey-data": { + "source": "iana" + }, + "application/mosskey-request": { + "source": "iana" + }, + "application/mp21": { + "source": "iana", + "extensions": ["m21","mp21"] + }, + "application/mp4": { + "source": "iana", + "extensions": ["mp4s","m4p"] + }, + "application/mpeg4-generic": { + "source": "iana" + }, + "application/mpeg4-iod": { + "source": "iana" + }, + "application/mpeg4-iod-xmt": { + "source": "iana" + }, + "application/mrb-consumer+xml": { + "source": "iana" + }, + "application/mrb-publish+xml": { + "source": "iana" + }, + "application/msc-ivr+xml": { + "source": "iana" + }, + "application/msc-mixer+xml": { + "source": "iana" + }, + "application/msword": { + "source": "iana", + "compressible": false, + "extensions": ["doc","dot"] + }, + "application/mxf": { + "source": "iana", + "extensions": ["mxf"] + }, + "application/nasdata": { + "source": "iana" + }, + "application/news-checkgroups": { + "source": "iana" + }, + "application/news-groupinfo": { + "source": "iana" + }, + "application/news-transmission": { + "source": "iana" + }, + "application/nlsml+xml": { + "source": "iana" + }, + "application/nss": { + "source": "iana" + }, + "application/ocsp-request": { + "source": "iana" + }, + "application/ocsp-response": { + "source": "iana" + }, + "application/octet-stream": { + "source": "iana", + "compressible": false, + "extensions": ["bin","dms","lrf","mar","so","dist","distz","pkg","bpk","dump","elc","deploy","buffer"] + }, + "application/oda": { + "source": "iana", + "extensions": ["oda"] + }, + "application/odx": { + "source": "iana" + }, + "application/oebps-package+xml": { + "source": "iana", + "extensions": ["opf"] + }, + "application/ogg": { + "source": "iana", + "compressible": false, + "extensions": ["ogx"] + }, + "application/omdoc+xml": { + "source": "apache", + "extensions": ["omdoc"] + }, + "application/onenote": { + "source": "apache", + "extensions": ["onetoc","onetoc2","onetmp","onepkg"] + }, + "application/oxps": { + "source": "iana", + "extensions": ["oxps"] + }, + "application/p2p-overlay+xml": { + "source": "iana" + }, + "application/parityfec": { + "source": "iana" + }, + "application/patch-ops-error+xml": { + "source": "iana", + "extensions": ["xer"] + }, + "application/pdf": { + "source": "iana", + "compressible": false, + "extensions": ["pdf"] + }, + "application/pdx": { + "source": "iana" + }, + "application/pgp-encrypted": { + "source": "iana", + "compressible": false, + "extensions": ["pgp"] + }, + "application/pgp-keys": { + "source": "iana" + }, + "application/pgp-signature": { + "source": "iana", + "extensions": ["asc","sig"] + }, + "application/pics-rules": { + "source": "apache", + "extensions": ["prf"] + }, + "application/pidf+xml": { + "source": "iana" + }, + "application/pidf-diff+xml": { + "source": "iana" + }, + "application/pkcs10": { + "source": "iana", + "extensions": ["p10"] + }, + "application/pkcs7-mime": { + "source": "iana", + "extensions": ["p7m","p7c"] + }, + "application/pkcs7-signature": { + "source": "iana", + "extensions": ["p7s"] + }, + "application/pkcs8": { + "source": "iana", + "extensions": ["p8"] + }, + "application/pkix-attr-cert": { + "source": "iana", + "extensions": ["ac"] + }, + "application/pkix-cert": { + "source": "iana", + "extensions": ["cer"] + }, + "application/pkix-crl": { + "source": "iana", + "extensions": ["crl"] + }, + "application/pkix-pkipath": { + "source": "iana", + "extensions": ["pkipath"] + }, + "application/pkixcmp": { + "source": "iana", + "extensions": ["pki"] + }, + "application/pls+xml": { + "source": "iana", + "extensions": ["pls"] + }, + "application/poc-settings+xml": { + "source": "iana" + }, + "application/postscript": { + "source": "iana", + "compressible": true, + "extensions": ["ai","eps","ps"] + }, + "application/provenance+xml": { + "source": "iana" + }, + "application/prs.alvestrand.titrax-sheet": { + "source": "iana" + }, + "application/prs.cww": { + "source": "iana", + "extensions": ["cww"] + }, + "application/prs.hpub+zip": { + "source": "iana" + }, + "application/prs.nprend": { + "source": "iana" + }, + "application/prs.plucker": { + "source": "iana" + }, + "application/prs.rdf-xml-crypt": { + "source": "iana" + }, + "application/prs.xsf+xml": { + "source": "iana" + }, + "application/pskc+xml": { + "source": "iana", + "extensions": ["pskcxml"] + }, + "application/qsig": { + "source": "iana" + }, + "application/raptorfec": { + "source": "iana" + }, + "application/rdap+json": { + "source": "iana", + "compressible": true + }, + "application/rdf+xml": { + "source": "iana", + "compressible": true, + "extensions": ["rdf"] + }, + "application/reginfo+xml": { + "source": "iana", + "extensions": ["rif"] + }, + "application/relax-ng-compact-syntax": { + "source": "iana", + "extensions": ["rnc"] + }, + "application/remote-printing": { + "source": "iana" + }, + "application/reputon+json": { + "source": "iana", + "compressible": true + }, + "application/resource-lists+xml": { + "source": "iana", + "extensions": ["rl"] + }, + "application/resource-lists-diff+xml": { + "source": "iana", + "extensions": ["rld"] + }, + "application/riscos": { + "source": "iana" + }, + "application/rlmi+xml": { + "source": "iana" + }, + "application/rls-services+xml": { + "source": "iana", + "extensions": ["rs"] + }, + "application/rpki-ghostbusters": { + "source": "iana", + "extensions": ["gbr"] + }, + "application/rpki-manifest": { + "source": "iana", + "extensions": ["mft"] + }, + "application/rpki-roa": { + "source": "iana", + "extensions": ["roa"] + }, + "application/rpki-updown": { + "source": "iana" + }, + "application/rsd+xml": { + "source": "apache", + "extensions": ["rsd"] + }, + "application/rss+xml": { + "source": "apache", + "compressible": true, + "extensions": ["rss"] + }, + "application/rtf": { + "source": "iana", + "compressible": true, + "extensions": ["rtf"] + }, + "application/rtploopback": { + "source": "iana" + }, + "application/rtx": { + "source": "iana" + }, + "application/samlassertion+xml": { + "source": "iana" + }, + "application/samlmetadata+xml": { + "source": "iana" + }, + "application/sbml+xml": { + "source": "iana", + "extensions": ["sbml"] + }, + "application/scaip+xml": { + "source": "iana" + }, + "application/scvp-cv-request": { + "source": "iana", + "extensions": ["scq"] + }, + "application/scvp-cv-response": { + "source": "iana", + "extensions": ["scs"] + }, + "application/scvp-vp-request": { + "source": "iana", + "extensions": ["spq"] + }, + "application/scvp-vp-response": { + "source": "iana", + "extensions": ["spp"] + }, + "application/sdp": { + "source": "iana", + "extensions": ["sdp"] + }, + "application/sep+xml": { + "source": "iana" + }, + "application/sep-exi": { + "source": "iana" + }, + "application/session-info": { + "source": "iana" + }, + "application/set-payment": { + "source": "iana" + }, + "application/set-payment-initiation": { + "source": "iana", + "extensions": ["setpay"] + }, + "application/set-registration": { + "source": "iana" + }, + "application/set-registration-initiation": { + "source": "iana", + "extensions": ["setreg"] + }, + "application/sgml": { + "source": "iana" + }, + "application/sgml-open-catalog": { + "source": "iana" + }, + "application/shf+xml": { + "source": "iana", + "extensions": ["shf"] + }, + "application/sieve": { + "source": "iana" + }, + "application/simple-filter+xml": { + "source": "iana" + }, + "application/simple-message-summary": { + "source": "iana" + }, + "application/simplesymbolcontainer": { + "source": "iana" + }, + "application/slate": { + "source": "iana" + }, + "application/smil": { + "source": "iana" + }, + "application/smil+xml": { + "source": "iana", + "extensions": ["smi","smil"] + }, + "application/smpte336m": { + "source": "iana" + }, + "application/soap+fastinfoset": { + "source": "iana" + }, + "application/soap+xml": { + "source": "iana", + "compressible": true + }, + "application/sparql-query": { + "source": "iana", + "extensions": ["rq"] + }, + "application/sparql-results+xml": { + "source": "iana", + "extensions": ["srx"] + }, + "application/spirits-event+xml": { + "source": "iana" + }, + "application/sql": { + "source": "iana" + }, + "application/srgs": { + "source": "iana", + "extensions": ["gram"] + }, + "application/srgs+xml": { + "source": "iana", + "extensions": ["grxml"] + }, + "application/sru+xml": { + "source": "iana", + "extensions": ["sru"] + }, + "application/ssdl+xml": { + "source": "apache", + "extensions": ["ssdl"] + }, + "application/ssml+xml": { + "source": "iana", + "extensions": ["ssml"] + }, + "application/tamp-apex-update": { + "source": "iana" + }, + "application/tamp-apex-update-confirm": { + "source": "iana" + }, + "application/tamp-community-update": { + "source": "iana" + }, + "application/tamp-community-update-confirm": { + "source": "iana" + }, + "application/tamp-error": { + "source": "iana" + }, + "application/tamp-sequence-adjust": { + "source": "iana" + }, + "application/tamp-sequence-adjust-confirm": { + "source": "iana" + }, + "application/tamp-status-query": { + "source": "iana" + }, + "application/tamp-status-response": { + "source": "iana" + }, + "application/tamp-update": { + "source": "iana" + }, + "application/tamp-update-confirm": { + "source": "iana" + }, + "application/tar": { + "compressible": true + }, + "application/tei+xml": { + "source": "iana", + "extensions": ["tei","teicorpus"] + }, + "application/thraud+xml": { + "source": "iana", + "extensions": ["tfi"] + }, + "application/timestamp-query": { + "source": "iana" + }, + "application/timestamp-reply": { + "source": "iana" + }, + "application/timestamped-data": { + "source": "iana", + "extensions": ["tsd"] + }, + "application/ttml+xml": { + "source": "iana" + }, + "application/tve-trigger": { + "source": "iana" + }, + "application/ulpfec": { + "source": "iana" + }, + "application/urc-grpsheet+xml": { + "source": "iana" + }, + "application/urc-ressheet+xml": { + "source": "iana" + }, + "application/urc-targetdesc+xml": { + "source": "iana" + }, + "application/urc-uisocketdesc+xml": { + "source": "iana" + }, + "application/vcard+json": { + "source": "iana", + "compressible": true + }, + "application/vcard+xml": { + "source": "iana" + }, + "application/vemmi": { + "source": "iana" + }, + "application/vividence.scriptfile": { + "source": "apache" + }, + "application/vnd.3gpp.bsf+xml": { + "source": "iana" + }, + "application/vnd.3gpp.pic-bw-large": { + "source": "iana", + "extensions": ["plb"] + }, + "application/vnd.3gpp.pic-bw-small": { + "source": "iana", + "extensions": ["psb"] + }, + "application/vnd.3gpp.pic-bw-var": { + "source": "iana", + "extensions": ["pvb"] + }, + "application/vnd.3gpp.sms": { + "source": "iana" + }, + "application/vnd.3gpp2.bcmcsinfo+xml": { + "source": "iana" + }, + "application/vnd.3gpp2.sms": { + "source": "iana" + }, + "application/vnd.3gpp2.tcap": { + "source": "iana", + "extensions": ["tcap"] + }, + "application/vnd.3m.post-it-notes": { + "source": "iana", + "extensions": ["pwn"] + }, + "application/vnd.accpac.simply.aso": { + "source": "iana", + "extensions": ["aso"] + }, + "application/vnd.accpac.simply.imp": { + "source": "iana", + "extensions": ["imp"] + }, + "application/vnd.acucobol": { + "source": "iana", + "extensions": ["acu"] + }, + "application/vnd.acucorp": { + "source": "iana", + "extensions": ["atc","acutc"] + }, + "application/vnd.adobe.air-application-installer-package+zip": { + "source": "apache", + "extensions": ["air"] + }, + "application/vnd.adobe.flash.movie": { + "source": "iana" + }, + "application/vnd.adobe.formscentral.fcdt": { + "source": "iana", + "extensions": ["fcdt"] + }, + "application/vnd.adobe.fxp": { + "source": "iana", + "extensions": ["fxp","fxpl"] + }, + "application/vnd.adobe.partial-upload": { + "source": "iana" + }, + "application/vnd.adobe.xdp+xml": { + "source": "iana", + "extensions": ["xdp"] + }, + "application/vnd.adobe.xfdf": { + "source": "iana", + "extensions": ["xfdf"] + }, + "application/vnd.aether.imp": { + "source": "iana" + }, + "application/vnd.ah-barcode": { + "source": "iana" + }, + "application/vnd.ahead.space": { + "source": "iana", + "extensions": ["ahead"] + }, + "application/vnd.airzip.filesecure.azf": { + "source": "iana", + "extensions": ["azf"] + }, + "application/vnd.airzip.filesecure.azs": { + "source": "iana", + "extensions": ["azs"] + }, + "application/vnd.amazon.ebook": { + "source": "apache", + "extensions": ["azw"] + }, + "application/vnd.americandynamics.acc": { + "source": "iana", + "extensions": ["acc"] + }, + "application/vnd.amiga.ami": { + "source": "iana", + "extensions": ["ami"] + }, + "application/vnd.amundsen.maze+xml": { + "source": "iana" + }, + "application/vnd.android.package-archive": { + "source": "apache", + "compressible": false, + "extensions": ["apk"] + }, + "application/vnd.anser-web-certificate-issue-initiation": { + "source": "iana", + "extensions": ["cii"] + }, + "application/vnd.anser-web-funds-transfer-initiation": { + "source": "apache", + "extensions": ["fti"] + }, + "application/vnd.antix.game-component": { + "source": "iana", + "extensions": ["atx"] + }, + "application/vnd.apache.thrift.binary": { + "source": "iana" + }, + "application/vnd.apache.thrift.compact": { + "source": "iana" + }, + "application/vnd.apache.thrift.json": { + "source": "iana" + }, + "application/vnd.api+json": { + "source": "iana", + "compressible": true + }, + "application/vnd.apple.installer+xml": { + "source": "iana", + "extensions": ["mpkg"] + }, + "application/vnd.apple.mpegurl": { + "source": "iana", + "extensions": ["m3u8"] + }, + "application/vnd.arastra.swi": { + "source": "iana" + }, + "application/vnd.aristanetworks.swi": { + "source": "iana", + "extensions": ["swi"] + }, + "application/vnd.artsquare": { + "source": "iana" + }, + "application/vnd.astraea-software.iota": { + "source": "iana", + "extensions": ["iota"] + }, + "application/vnd.audiograph": { + "source": "iana", + "extensions": ["aep"] + }, + "application/vnd.autopackage": { + "source": "iana" + }, + "application/vnd.avistar+xml": { + "source": "iana" + }, + "application/vnd.balsamiq.bmml+xml": { + "source": "iana" + }, + "application/vnd.bekitzur-stech+json": { + "source": "iana", + "compressible": true + }, + "application/vnd.blueice.multipass": { + "source": "iana", + "extensions": ["mpm"] + }, + "application/vnd.bluetooth.ep.oob": { + "source": "iana" + }, + "application/vnd.bluetooth.le.oob": { + "source": "iana" + }, + "application/vnd.bmi": { + "source": "iana", + "extensions": ["bmi"] + }, + "application/vnd.businessobjects": { + "source": "iana", + "extensions": ["rep"] + }, + "application/vnd.cab-jscript": { + "source": "iana" + }, + "application/vnd.canon-cpdl": { + "source": "iana" + }, + "application/vnd.canon-lips": { + "source": "iana" + }, + "application/vnd.cendio.thinlinc.clientconf": { + "source": "iana" + }, + "application/vnd.century-systems.tcp_stream": { + "source": "iana" + }, + "application/vnd.chemdraw+xml": { + "source": "iana", + "extensions": ["cdxml"] + }, + "application/vnd.chipnuts.karaoke-mmd": { + "source": "iana", + "extensions": ["mmd"] + }, + "application/vnd.cinderella": { + "source": "iana", + "extensions": ["cdy"] + }, + "application/vnd.cirpack.isdn-ext": { + "source": "iana" + }, + "application/vnd.claymore": { + "source": "iana", + "extensions": ["cla"] + }, + "application/vnd.cloanto.rp9": { + "source": "iana", + "extensions": ["rp9"] + }, + "application/vnd.clonk.c4group": { + "source": "iana", + "extensions": ["c4g","c4d","c4f","c4p","c4u"] + }, + "application/vnd.cluetrust.cartomobile-config": { + "source": "iana", + "extensions": ["c11amc"] + }, + "application/vnd.cluetrust.cartomobile-config-pkg": { + "source": "iana", + "extensions": ["c11amz"] + }, + "application/vnd.coffeescript": { + "source": "iana" + }, + "application/vnd.collection+json": { + "source": "iana", + "compressible": true + }, + "application/vnd.collection.doc+json": { + "source": "iana", + "compressible": true + }, + "application/vnd.collection.next+json": { + "source": "iana", + "compressible": true + }, + "application/vnd.commerce-battelle": { + "source": "iana" + }, + "application/vnd.commonspace": { + "source": "iana", + "extensions": ["csp"] + }, + "application/vnd.contact.cmsg": { + "source": "iana", + "extensions": ["cdbcmsg"] + }, + "application/vnd.cosmocaller": { + "source": "iana", + "extensions": ["cmc"] + }, + "application/vnd.crick.clicker": { + "source": "iana", + "extensions": ["clkx"] + }, + "application/vnd.crick.clicker.keyboard": { + "source": "iana", + "extensions": ["clkk"] + }, + "application/vnd.crick.clicker.palette": { + "source": "iana", + "extensions": ["clkp"] + }, + "application/vnd.crick.clicker.template": { + "source": "iana", + "extensions": ["clkt"] + }, + "application/vnd.crick.clicker.wordbank": { + "source": "iana", + "extensions": ["clkw"] + }, + "application/vnd.criticaltools.wbs+xml": { + "source": "iana", + "extensions": ["wbs"] + }, + "application/vnd.ctc-posml": { + "source": "iana", + "extensions": ["pml"] + }, + "application/vnd.ctct.ws+xml": { + "source": "iana" + }, + "application/vnd.cups-pdf": { + "source": "iana" + }, + "application/vnd.cups-postscript": { + "source": "iana" + }, + "application/vnd.cups-ppd": { + "source": "iana", + "extensions": ["ppd"] + }, + "application/vnd.cups-raster": { + "source": "iana" + }, + "application/vnd.cups-raw": { + "source": "iana" + }, + "application/vnd.curl": { + "source": "iana" + }, + "application/vnd.curl.car": { + "source": "apache", + "extensions": ["car"] + }, + "application/vnd.curl.pcurl": { + "source": "apache", + "extensions": ["pcurl"] + }, + "application/vnd.cyan.dean.root+xml": { + "source": "iana" + }, + "application/vnd.cybank": { + "source": "iana" + }, + "application/vnd.dart": { + "source": "iana", + "compressible": true, + "extensions": ["dart"] + }, + "application/vnd.data-vision.rdz": { + "source": "iana", + "extensions": ["rdz"] + }, + "application/vnd.debian.binary-package": { + "source": "iana" + }, + "application/vnd.dece.data": { + "source": "iana", + "extensions": ["uvf","uvvf","uvd","uvvd"] + }, + "application/vnd.dece.ttml+xml": { + "source": "iana", + "extensions": ["uvt","uvvt"] + }, + "application/vnd.dece.unspecified": { + "source": "iana", + "extensions": ["uvx","uvvx"] + }, + "application/vnd.dece.zip": { + "source": "iana", + "extensions": ["uvz","uvvz"] + }, + "application/vnd.denovo.fcselayout-link": { + "source": "iana", + "extensions": ["fe_launch"] + }, + "application/vnd.desmume-movie": { + "source": "iana" + }, + "application/vnd.dir-bi.plate-dl-nosuffix": { + "source": "iana" + }, + "application/vnd.dm.delegation+xml": { + "source": "iana" + }, + "application/vnd.dna": { + "source": "iana", + "extensions": ["dna"] + }, + "application/vnd.document+json": { + "source": "iana", + "compressible": true + }, + "application/vnd.dolby.mlp": { + "source": "apache", + "extensions": ["mlp"] + }, + "application/vnd.dolby.mobile.1": { + "source": "iana" + }, + "application/vnd.dolby.mobile.2": { + "source": "iana" + }, + "application/vnd.doremir.scorecloud-binary-document": { + "source": "iana" + }, + "application/vnd.dpgraph": { + "source": "iana", + "extensions": ["dpg"] + }, + "application/vnd.dreamfactory": { + "source": "iana", + "extensions": ["dfac"] + }, + "application/vnd.ds-keypoint": { + "source": "apache", + "extensions": ["kpxx"] + }, + "application/vnd.dtg.local": { + "source": "iana" + }, + "application/vnd.dtg.local.flash": { + "source": "iana" + }, + "application/vnd.dtg.local.html": { + "source": "iana" + }, + "application/vnd.dvb.ait": { + "source": "iana", + "extensions": ["ait"] + }, + "application/vnd.dvb.dvbj": { + "source": "iana" + }, + "application/vnd.dvb.esgcontainer": { + "source": "iana" + }, + "application/vnd.dvb.ipdcdftnotifaccess": { + "source": "iana" + }, + "application/vnd.dvb.ipdcesgaccess": { + "source": "iana" + }, + "application/vnd.dvb.ipdcesgaccess2": { + "source": "iana" + }, + "application/vnd.dvb.ipdcesgpdd": { + "source": "iana" + }, + "application/vnd.dvb.ipdcroaming": { + "source": "iana" + }, + "application/vnd.dvb.iptv.alfec-base": { + "source": "iana" + }, + "application/vnd.dvb.iptv.alfec-enhancement": { + "source": "iana" + }, + "application/vnd.dvb.notif-aggregate-root+xml": { + "source": "iana" + }, + "application/vnd.dvb.notif-container+xml": { + "source": "iana" + }, + "application/vnd.dvb.notif-generic+xml": { + "source": "iana" + }, + "application/vnd.dvb.notif-ia-msglist+xml": { + "source": "iana" + }, + "application/vnd.dvb.notif-ia-registration-request+xml": { + "source": "iana" + }, + "application/vnd.dvb.notif-ia-registration-response+xml": { + "source": "iana" + }, + "application/vnd.dvb.notif-init+xml": { + "source": "iana" + }, + "application/vnd.dvb.pfr": { + "source": "iana" + }, + "application/vnd.dvb.service": { + "source": "iana", + "extensions": ["svc"] + }, + "application/vnd.dxr": { + "source": "iana" + }, + "application/vnd.dynageo": { + "source": "iana", + "extensions": ["geo"] + }, + "application/vnd.dzr": { + "source": "iana" + }, + "application/vnd.easykaraoke.cdgdownload": { + "source": "iana" + }, + "application/vnd.ecdis-update": { + "source": "iana" + }, + "application/vnd.ecowin.chart": { + "source": "iana", + "extensions": ["mag"] + }, + "application/vnd.ecowin.filerequest": { + "source": "iana" + }, + "application/vnd.ecowin.fileupdate": { + "source": "iana" + }, + "application/vnd.ecowin.series": { + "source": "iana" + }, + "application/vnd.ecowin.seriesrequest": { + "source": "iana" + }, + "application/vnd.ecowin.seriesupdate": { + "source": "iana" + }, + "application/vnd.emclient.accessrequest+xml": { + "source": "iana" + }, + "application/vnd.enliven": { + "source": "iana", + "extensions": ["nml"] + }, + "application/vnd.enphase.envoy": { + "source": "iana" + }, + "application/vnd.eprints.data+xml": { + "source": "iana" + }, + "application/vnd.epson.esf": { + "source": "iana", + "extensions": ["esf"] + }, + "application/vnd.epson.msf": { + "source": "iana", + "extensions": ["msf"] + }, + "application/vnd.epson.quickanime": { + "source": "iana", + "extensions": ["qam"] + }, + "application/vnd.epson.salt": { + "source": "iana", + "extensions": ["slt"] + }, + "application/vnd.epson.ssf": { + "source": "iana", + "extensions": ["ssf"] + }, + "application/vnd.ericsson.quickcall": { + "source": "iana" + }, + "application/vnd.eszigno3+xml": { + "source": "iana", + "extensions": ["es3","et3"] + }, + "application/vnd.etsi.aoc+xml": { + "source": "iana" + }, + "application/vnd.etsi.asic-e+zip": { + "source": "iana" + }, + "application/vnd.etsi.asic-s+zip": { + "source": "iana" + }, + "application/vnd.etsi.cug+xml": { + "source": "iana" + }, + "application/vnd.etsi.iptvcommand+xml": { + "source": "iana" + }, + "application/vnd.etsi.iptvdiscovery+xml": { + "source": "iana" + }, + "application/vnd.etsi.iptvprofile+xml": { + "source": "iana" + }, + "application/vnd.etsi.iptvsad-bc+xml": { + "source": "iana" + }, + "application/vnd.etsi.iptvsad-cod+xml": { + "source": "iana" + }, + "application/vnd.etsi.iptvsad-npvr+xml": { + "source": "iana" + }, + "application/vnd.etsi.iptvservice+xml": { + "source": "iana" + }, + "application/vnd.etsi.iptvsync+xml": { + "source": "iana" + }, + "application/vnd.etsi.iptvueprofile+xml": { + "source": "iana" + }, + "application/vnd.etsi.mcid+xml": { + "source": "iana" + }, + "application/vnd.etsi.mheg5": { + "source": "iana" + }, + "application/vnd.etsi.overload-control-policy-dataset+xml": { + "source": "iana" + }, + "application/vnd.etsi.pstn+xml": { + "source": "iana" + }, + "application/vnd.etsi.sci+xml": { + "source": "iana" + }, + "application/vnd.etsi.simservs+xml": { + "source": "iana" + }, + "application/vnd.etsi.timestamp-token": { + "source": "iana" + }, + "application/vnd.etsi.tsl+xml": { + "source": "iana" + }, + "application/vnd.etsi.tsl.der": { + "source": "iana" + }, + "application/vnd.eudora.data": { + "source": "iana" + }, + "application/vnd.ezpix-album": { + "source": "iana", + "extensions": ["ez2"] + }, + "application/vnd.ezpix-package": { + "source": "iana", + "extensions": ["ez3"] + }, + "application/vnd.f-secure.mobile": { + "source": "iana" + }, + "application/vnd.fdf": { + "source": "iana", + "extensions": ["fdf"] + }, + "application/vnd.fdsn.mseed": { + "source": "iana", + "extensions": ["mseed"] + }, + "application/vnd.fdsn.seed": { + "source": "iana", + "extensions": ["seed","dataless"] + }, + "application/vnd.ffsns": { + "source": "iana" + }, + "application/vnd.fints": { + "source": "iana" + }, + "application/vnd.flographit": { + "source": "iana", + "extensions": ["gph"] + }, + "application/vnd.fluxtime.clip": { + "source": "iana", + "extensions": ["ftc"] + }, + "application/vnd.font-fontforge-sfd": { + "source": "iana" + }, + "application/vnd.framemaker": { + "source": "iana", + "extensions": ["fm","frame","maker","book"] + }, + "application/vnd.frogans.fnc": { + "source": "iana", + "extensions": ["fnc"] + }, + "application/vnd.frogans.ltf": { + "source": "iana", + "extensions": ["ltf"] + }, + "application/vnd.fsc.weblaunch": { + "source": "iana", + "extensions": ["fsc"] + }, + "application/vnd.fujitsu.oasys": { + "source": "iana", + "extensions": ["oas"] + }, + "application/vnd.fujitsu.oasys2": { + "source": "iana", + "extensions": ["oa2"] + }, + "application/vnd.fujitsu.oasys3": { + "source": "iana", + "extensions": ["oa3"] + }, + "application/vnd.fujitsu.oasysgp": { + "source": "iana", + "extensions": ["fg5"] + }, + "application/vnd.fujitsu.oasysprs": { + "source": "iana", + "extensions": ["bh2"] + }, + "application/vnd.fujixerox.art-ex": { + "source": "iana" + }, + "application/vnd.fujixerox.art4": { + "source": "iana" + }, + "application/vnd.fujixerox.ddd": { + "source": "iana", + "extensions": ["ddd"] + }, + "application/vnd.fujixerox.docuworks": { + "source": "iana", + "extensions": ["xdw"] + }, + "application/vnd.fujixerox.docuworks.binder": { + "source": "iana", + "extensions": ["xbd"] + }, + "application/vnd.fujixerox.docuworks.container": { + "source": "iana" + }, + "application/vnd.fujixerox.hbpl": { + "source": "iana" + }, + "application/vnd.fut-misnet": { + "source": "iana" + }, + "application/vnd.fuzzysheet": { + "source": "iana", + "extensions": ["fzs"] + }, + "application/vnd.genomatix.tuxedo": { + "source": "iana", + "extensions": ["txd"] + }, + "application/vnd.geo+json": { + "source": "iana", + "compressible": true + }, + "application/vnd.geocube+xml": { + "source": "iana" + }, + "application/vnd.geogebra.file": { + "source": "iana", + "extensions": ["ggb"] + }, + "application/vnd.geogebra.tool": { + "source": "iana", + "extensions": ["ggt"] + }, + "application/vnd.geometry-explorer": { + "source": "iana", + "extensions": ["gex","gre"] + }, + "application/vnd.geonext": { + "source": "iana", + "extensions": ["gxt"] + }, + "application/vnd.geoplan": { + "source": "iana", + "extensions": ["g2w"] + }, + "application/vnd.geospace": { + "source": "iana", + "extensions": ["g3w"] + }, + "application/vnd.gerber": { + "source": "iana" + }, + "application/vnd.globalplatform.card-content-mgt": { + "source": "iana" + }, + "application/vnd.globalplatform.card-content-mgt-response": { + "source": "iana" + }, + "application/vnd.gmx": { + "source": "iana", + "extensions": ["gmx"] + }, + "application/vnd.google-earth.kml+xml": { + "source": "iana", + "compressible": true, + "extensions": ["kml"] + }, + "application/vnd.google-earth.kmz": { + "source": "iana", + "compressible": false, + "extensions": ["kmz"] + }, + "application/vnd.gov.sk.e-form+xml": { + "source": "iana" + }, + "application/vnd.gov.sk.e-form+zip": { + "source": "iana" + }, + "application/vnd.grafeq": { + "source": "iana", + "extensions": ["gqf","gqs"] + }, + "application/vnd.gridmp": { + "source": "iana" + }, + "application/vnd.groove-account": { + "source": "iana", + "extensions": ["gac"] + }, + "application/vnd.groove-help": { + "source": "iana", + "extensions": ["ghf"] + }, + "application/vnd.groove-identity-message": { + "source": "iana", + "extensions": ["gim"] + }, + "application/vnd.groove-injector": { + "source": "iana", + "extensions": ["grv"] + }, + "application/vnd.groove-tool-message": { + "source": "iana", + "extensions": ["gtm"] + }, + "application/vnd.groove-tool-template": { + "source": "iana", + "extensions": ["tpl"] + }, + "application/vnd.groove-vcard": { + "source": "iana", + "extensions": ["vcg"] + }, + "application/vnd.hal+json": { + "source": "iana", + "compressible": true + }, + "application/vnd.hal+xml": { + "source": "iana", + "extensions": ["hal"] + }, + "application/vnd.handheld-entertainment+xml": { + "source": "iana", + "extensions": ["zmm"] + }, + "application/vnd.hbci": { + "source": "iana", + "extensions": ["hbci"] + }, + "application/vnd.hcl-bireports": { + "source": "iana" + }, + "application/vnd.heroku+json": { + "source": "iana", + "compressible": true + }, + "application/vnd.hhe.lesson-player": { + "source": "iana", + "extensions": ["les"] + }, + "application/vnd.hp-hpgl": { + "source": "iana", + "extensions": ["hpgl"] + }, + "application/vnd.hp-hpid": { + "source": "iana", + "extensions": ["hpid"] + }, + "application/vnd.hp-hps": { + "source": "iana", + "extensions": ["hps"] + }, + "application/vnd.hp-jlyt": { + "source": "iana", + "extensions": ["jlt"] + }, + "application/vnd.hp-pcl": { + "source": "iana", + "extensions": ["pcl"] + }, + "application/vnd.hp-pclxl": { + "source": "iana", + "extensions": ["pclxl"] + }, + "application/vnd.httphone": { + "source": "iana" + }, + "application/vnd.hydrostatix.sof-data": { + "source": "iana" + }, + "application/vnd.hzn-3d-crossword": { + "source": "iana" + }, + "application/vnd.ibm.afplinedata": { + "source": "iana" + }, + "application/vnd.ibm.electronic-media": { + "source": "iana" + }, + "application/vnd.ibm.minipay": { + "source": "iana", + "extensions": ["mpy"] + }, + "application/vnd.ibm.modcap": { + "source": "iana", + "extensions": ["afp","listafp","list3820"] + }, + "application/vnd.ibm.rights-management": { + "source": "iana", + "extensions": ["irm"] + }, + "application/vnd.ibm.secure-container": { + "source": "iana", + "extensions": ["sc"] + }, + "application/vnd.iccprofile": { + "source": "iana", + "extensions": ["icc","icm"] + }, + "application/vnd.ieee.1905": { + "source": "iana" + }, + "application/vnd.igloader": { + "source": "iana", + "extensions": ["igl"] + }, + "application/vnd.immervision-ivp": { + "source": "iana", + "extensions": ["ivp"] + }, + "application/vnd.immervision-ivu": { + "source": "iana", + "extensions": ["ivu"] + }, + "application/vnd.ims.imsccv1p1": { + "source": "iana" + }, + "application/vnd.ims.imsccv1p2": { + "source": "iana" + }, + "application/vnd.ims.imsccv1p3": { + "source": "iana" + }, + "application/vnd.ims.lis.v2.result+json": { + "source": "iana", + "compressible": true + }, + "application/vnd.ims.lti.v2.toolconsumerprofile+json": { + "source": "iana", + "compressible": true + }, + "application/vnd.ims.lti.v2.toolproxy+json": { + "source": "iana", + "compressible": true + }, + "application/vnd.ims.lti.v2.toolproxy.id+json": { + "source": "iana", + "compressible": true + }, + "application/vnd.ims.lti.v2.toolsettings+json": { + "source": "iana", + "compressible": true + }, + "application/vnd.ims.lti.v2.toolsettings.simple+json": { + "source": "iana", + "compressible": true + }, + "application/vnd.informedcontrol.rms+xml": { + "source": "iana" + }, + "application/vnd.informix-visionary": { + "source": "iana" + }, + "application/vnd.infotech.project": { + "source": "iana" + }, + "application/vnd.infotech.project+xml": { + "source": "iana" + }, + "application/vnd.innopath.wamp.notification": { + "source": "iana" + }, + "application/vnd.insors.igm": { + "source": "iana", + "extensions": ["igm"] + }, + "application/vnd.intercon.formnet": { + "source": "iana", + "extensions": ["xpw","xpx"] + }, + "application/vnd.intergeo": { + "source": "iana", + "extensions": ["i2g"] + }, + "application/vnd.intertrust.digibox": { + "source": "iana" + }, + "application/vnd.intertrust.nncp": { + "source": "iana" + }, + "application/vnd.intu.qbo": { + "source": "iana", + "extensions": ["qbo"] + }, + "application/vnd.intu.qfx": { + "source": "iana", + "extensions": ["qfx"] + }, + "application/vnd.iptc.g2.catalogitem+xml": { + "source": "iana" + }, + "application/vnd.iptc.g2.conceptitem+xml": { + "source": "iana" + }, + "application/vnd.iptc.g2.knowledgeitem+xml": { + "source": "iana" + }, + "application/vnd.iptc.g2.newsitem+xml": { + "source": "iana" + }, + "application/vnd.iptc.g2.newsmessage+xml": { + "source": "iana" + }, + "application/vnd.iptc.g2.packageitem+xml": { + "source": "iana" + }, + "application/vnd.iptc.g2.planningitem+xml": { + "source": "iana" + }, + "application/vnd.ipunplugged.rcprofile": { + "source": "iana", + "extensions": ["rcprofile"] + }, + "application/vnd.irepository.package+xml": { + "source": "iana", + "extensions": ["irp"] + }, + "application/vnd.is-xpr": { + "source": "iana", + "extensions": ["xpr"] + }, + "application/vnd.isac.fcs": { + "source": "iana", + "extensions": ["fcs"] + }, + "application/vnd.jam": { + "source": "iana", + "extensions": ["jam"] + }, + "application/vnd.japannet-directory-service": { + "source": "iana" + }, + "application/vnd.japannet-jpnstore-wakeup": { + "source": "iana" + }, + "application/vnd.japannet-payment-wakeup": { + "source": "iana" + }, + "application/vnd.japannet-registration": { + "source": "iana" + }, + "application/vnd.japannet-registration-wakeup": { + "source": "iana" + }, + "application/vnd.japannet-setstore-wakeup": { + "source": "iana" + }, + "application/vnd.japannet-verification": { + "source": "iana" + }, + "application/vnd.japannet-verification-wakeup": { + "source": "iana" + }, + "application/vnd.jcp.javame.midlet-rms": { + "source": "iana", + "extensions": ["rms"] + }, + "application/vnd.jisp": { + "source": "iana", + "extensions": ["jisp"] + }, + "application/vnd.joost.joda-archive": { + "source": "iana", + "extensions": ["joda"] + }, + "application/vnd.jsk.isdn-ngn": { + "source": "iana" + }, + "application/vnd.kahootz": { + "source": "iana", + "extensions": ["ktz","ktr"] + }, + "application/vnd.kde.karbon": { + "source": "iana", + "extensions": ["karbon"] + }, + "application/vnd.kde.kchart": { + "source": "iana", + "extensions": ["chrt"] + }, + "application/vnd.kde.kformula": { + "source": "iana", + "extensions": ["kfo"] + }, + "application/vnd.kde.kivio": { + "source": "iana", + "extensions": ["flw"] + }, + "application/vnd.kde.kontour": { + "source": "iana", + "extensions": ["kon"] + }, + "application/vnd.kde.kpresenter": { + "source": "iana", + "extensions": ["kpr","kpt"] + }, + "application/vnd.kde.kspread": { + "source": "iana", + "extensions": ["ksp"] + }, + "application/vnd.kde.kword": { + "source": "iana", + "extensions": ["kwd","kwt"] + }, + "application/vnd.kenameaapp": { + "source": "iana", + "extensions": ["htke"] + }, + "application/vnd.kidspiration": { + "source": "iana", + "extensions": ["kia"] + }, + "application/vnd.kinar": { + "source": "iana", + "extensions": ["kne","knp"] + }, + "application/vnd.koan": { + "source": "iana", + "extensions": ["skp","skd","skt","skm"] + }, + "application/vnd.kodak-descriptor": { + "source": "iana", + "extensions": ["sse"] + }, + "application/vnd.las.las+xml": { + "source": "iana", + "extensions": ["lasxml"] + }, + "application/vnd.liberty-request+xml": { + "source": "iana" + }, + "application/vnd.llamagraphics.life-balance.desktop": { + "source": "iana", + "extensions": ["lbd"] + }, + "application/vnd.llamagraphics.life-balance.exchange+xml": { + "source": "iana", + "extensions": ["lbe"] + }, + "application/vnd.lotus-1-2-3": { + "source": "iana", + "extensions": ["123"] + }, + "application/vnd.lotus-approach": { + "source": "iana", + "extensions": ["apr"] + }, + "application/vnd.lotus-freelance": { + "source": "iana", + "extensions": ["pre"] + }, + "application/vnd.lotus-notes": { + "source": "iana", + "extensions": ["nsf"] + }, + "application/vnd.lotus-organizer": { + "source": "iana", + "extensions": ["org"] + }, + "application/vnd.lotus-screencam": { + "source": "iana", + "extensions": ["scm"] + }, + "application/vnd.lotus-wordpro": { + "source": "iana", + "extensions": ["lwp"] + }, + "application/vnd.macports.portpkg": { + "source": "iana", + "extensions": ["portpkg"] + }, + "application/vnd.marlin.drm.actiontoken+xml": { + "source": "iana" + }, + "application/vnd.marlin.drm.conftoken+xml": { + "source": "iana" + }, + "application/vnd.marlin.drm.license+xml": { + "source": "iana" + }, + "application/vnd.marlin.drm.mdcf": { + "source": "iana" + }, + "application/vnd.mason+json": { + "source": "iana", + "compressible": true + }, + "application/vnd.maxmind.maxmind-db": { + "source": "iana" + }, + "application/vnd.mcd": { + "source": "iana", + "extensions": ["mcd"] + }, + "application/vnd.medcalcdata": { + "source": "iana", + "extensions": ["mc1"] + }, + "application/vnd.mediastation.cdkey": { + "source": "iana", + "extensions": ["cdkey"] + }, + "application/vnd.meridian-slingshot": { + "source": "iana" + }, + "application/vnd.mfer": { + "source": "iana", + "extensions": ["mwf"] + }, + "application/vnd.mfmp": { + "source": "iana", + "extensions": ["mfm"] + }, + "application/vnd.micrografx.flo": { + "source": "iana", + "extensions": ["flo"] + }, + "application/vnd.micrografx.igx": { + "source": "iana", + "extensions": ["igx"] + }, + "application/vnd.miele+json": { + "source": "iana", + "compressible": true + }, + "application/vnd.mif": { + "source": "iana", + "extensions": ["mif"] + }, + "application/vnd.minisoft-hp3000-save": { + "source": "iana" + }, + "application/vnd.mitsubishi.misty-guard.trustweb": { + "source": "iana" + }, + "application/vnd.mobius.daf": { + "source": "iana", + "extensions": ["daf"] + }, + "application/vnd.mobius.dis": { + "source": "iana", + "extensions": ["dis"] + }, + "application/vnd.mobius.mbk": { + "source": "iana", + "extensions": ["mbk"] + }, + "application/vnd.mobius.mqy": { + "source": "iana", + "extensions": ["mqy"] + }, + "application/vnd.mobius.msl": { + "source": "iana", + "extensions": ["msl"] + }, + "application/vnd.mobius.plc": { + "source": "iana", + "extensions": ["plc"] + }, + "application/vnd.mobius.txf": { + "source": "iana", + "extensions": ["txf"] + }, + "application/vnd.mophun.application": { + "source": "iana", + "extensions": ["mpn"] + }, + "application/vnd.mophun.certificate": { + "source": "iana", + "extensions": ["mpc"] + }, + "application/vnd.motorola.flexsuite": { + "source": "iana" + }, + "application/vnd.motorola.flexsuite.adsi": { + "source": "iana" + }, + "application/vnd.motorola.flexsuite.fis": { + "source": "iana" + }, + "application/vnd.motorola.flexsuite.gotap": { + "source": "iana" + }, + "application/vnd.motorola.flexsuite.kmr": { + "source": "iana" + }, + "application/vnd.motorola.flexsuite.ttc": { + "source": "iana" + }, + "application/vnd.motorola.flexsuite.wem": { + "source": "iana" + }, + "application/vnd.motorola.iprm": { + "source": "iana" + }, + "application/vnd.mozilla.xul+xml": { + "source": "iana", + "compressible": true, + "extensions": ["xul"] + }, + "application/vnd.ms-3mfdocument": { + "source": "iana" + }, + "application/vnd.ms-artgalry": { + "source": "iana", + "extensions": ["cil"] + }, + "application/vnd.ms-asf": { + "source": "iana" + }, + "application/vnd.ms-cab-compressed": { + "source": "iana", + "extensions": ["cab"] + }, + "application/vnd.ms-color.iccprofile": { + "source": "apache" + }, + "application/vnd.ms-excel": { + "source": "iana", + "compressible": false, + "extensions": ["xls","xlm","xla","xlc","xlt","xlw"] + }, + "application/vnd.ms-excel.addin.macroenabled.12": { + "source": "iana", + "extensions": ["xlam"] + }, + "application/vnd.ms-excel.sheet.binary.macroenabled.12": { + "source": "iana", + "extensions": ["xlsb"] + }, + "application/vnd.ms-excel.sheet.macroenabled.12": { + "source": "iana", + "extensions": ["xlsm"] + }, + "application/vnd.ms-excel.template.macroenabled.12": { + "source": "iana", + "extensions": ["xltm"] + }, + "application/vnd.ms-fontobject": { + "source": "iana", + "compressible": true, + "extensions": ["eot"] + }, + "application/vnd.ms-htmlhelp": { + "source": "iana", + "extensions": ["chm"] + }, + "application/vnd.ms-ims": { + "source": "iana", + "extensions": ["ims"] + }, + "application/vnd.ms-lrm": { + "source": "iana", + "extensions": ["lrm"] + }, + "application/vnd.ms-office.activex+xml": { + "source": "iana" + }, + "application/vnd.ms-officetheme": { + "source": "iana", + "extensions": ["thmx"] + }, + "application/vnd.ms-opentype": { + "source": "apache", + "compressible": true + }, + "application/vnd.ms-package.obfuscated-opentype": { + "source": "apache" + }, + "application/vnd.ms-pki.seccat": { + "source": "apache", + "extensions": ["cat"] + }, + "application/vnd.ms-pki.stl": { + "source": "apache", + "extensions": ["stl"] + }, + "application/vnd.ms-playready.initiator+xml": { + "source": "iana" + }, + "application/vnd.ms-powerpoint": { + "source": "iana", + "compressible": false, + "extensions": ["ppt","pps","pot"] + }, + "application/vnd.ms-powerpoint.addin.macroenabled.12": { + "source": "iana", + "extensions": ["ppam"] + }, + "application/vnd.ms-powerpoint.presentation.macroenabled.12": { + "source": "iana", + "extensions": ["pptm"] + }, + "application/vnd.ms-powerpoint.slide.macroenabled.12": { + "source": "iana", + "extensions": ["sldm"] + }, + "application/vnd.ms-powerpoint.slideshow.macroenabled.12": { + "source": "iana", + "extensions": ["ppsm"] + }, + "application/vnd.ms-powerpoint.template.macroenabled.12": { + "source": "iana", + "extensions": ["potm"] + }, + "application/vnd.ms-printing.printticket+xml": { + "source": "apache" + }, + "application/vnd.ms-project": { + "source": "iana", + "extensions": ["mpp","mpt"] + }, + "application/vnd.ms-tnef": { + "source": "iana" + }, + "application/vnd.ms-windows.printerpairing": { + "source": "iana" + }, + "application/vnd.ms-wmdrm.lic-chlg-req": { + "source": "iana" + }, + "application/vnd.ms-wmdrm.lic-resp": { + "source": "iana" + }, + "application/vnd.ms-wmdrm.meter-chlg-req": { + "source": "iana" + }, + "application/vnd.ms-wmdrm.meter-resp": { + "source": "iana" + }, + "application/vnd.ms-word.document.macroenabled.12": { + "source": "iana", + "extensions": ["docm"] + }, + "application/vnd.ms-word.template.macroenabled.12": { + "source": "iana", + "extensions": ["dotm"] + }, + "application/vnd.ms-works": { + "source": "iana", + "extensions": ["wps","wks","wcm","wdb"] + }, + "application/vnd.ms-wpl": { + "source": "iana", + "extensions": ["wpl"] + }, + "application/vnd.ms-xpsdocument": { + "source": "iana", + "compressible": false, + "extensions": ["xps"] + }, + "application/vnd.msa-disk-image": { + "source": "iana" + }, + "application/vnd.mseq": { + "source": "iana", + "extensions": ["mseq"] + }, + "application/vnd.msign": { + "source": "iana" + }, + "application/vnd.multiad.creator": { + "source": "iana" + }, + "application/vnd.multiad.creator.cif": { + "source": "iana" + }, + "application/vnd.music-niff": { + "source": "iana" + }, + "application/vnd.musician": { + "source": "iana", + "extensions": ["mus"] + }, + "application/vnd.muvee.style": { + "source": "iana", + "extensions": ["msty"] + }, + "application/vnd.mynfc": { + "source": "iana", + "extensions": ["taglet"] + }, + "application/vnd.ncd.control": { + "source": "iana" + }, + "application/vnd.ncd.reference": { + "source": "iana" + }, + "application/vnd.nervana": { + "source": "iana" + }, + "application/vnd.netfpx": { + "source": "iana" + }, + "application/vnd.neurolanguage.nlu": { + "source": "iana", + "extensions": ["nlu"] + }, + "application/vnd.nintendo.nitro.rom": { + "source": "iana" + }, + "application/vnd.nintendo.snes.rom": { + "source": "iana" + }, + "application/vnd.nitf": { + "source": "iana", + "extensions": ["ntf","nitf"] + }, + "application/vnd.noblenet-directory": { + "source": "iana", + "extensions": ["nnd"] + }, + "application/vnd.noblenet-sealer": { + "source": "iana", + "extensions": ["nns"] + }, + "application/vnd.noblenet-web": { + "source": "iana", + "extensions": ["nnw"] + }, + "application/vnd.nokia.catalogs": { + "source": "iana" + }, + "application/vnd.nokia.conml+wbxml": { + "source": "iana" + }, + "application/vnd.nokia.conml+xml": { + "source": "iana" + }, + "application/vnd.nokia.iptv.config+xml": { + "source": "iana" + }, + "application/vnd.nokia.isds-radio-presets": { + "source": "iana" + }, + "application/vnd.nokia.landmark+wbxml": { + "source": "iana" + }, + "application/vnd.nokia.landmark+xml": { + "source": "iana" + }, + "application/vnd.nokia.landmarkcollection+xml": { + "source": "iana" + }, + "application/vnd.nokia.n-gage.ac+xml": { + "source": "iana" + }, + "application/vnd.nokia.n-gage.data": { + "source": "iana", + "extensions": ["ngdat"] + }, + "application/vnd.nokia.n-gage.symbian.install": { + "source": "iana" + }, + "application/vnd.nokia.ncd": { + "source": "iana" + }, + "application/vnd.nokia.pcd+wbxml": { + "source": "iana" + }, + "application/vnd.nokia.pcd+xml": { + "source": "iana" + }, + "application/vnd.nokia.radio-preset": { + "source": "iana", + "extensions": ["rpst"] + }, + "application/vnd.nokia.radio-presets": { + "source": "iana", + "extensions": ["rpss"] + }, + "application/vnd.novadigm.edm": { + "source": "iana", + "extensions": ["edm"] + }, + "application/vnd.novadigm.edx": { + "source": "iana", + "extensions": ["edx"] + }, + "application/vnd.novadigm.ext": { + "source": "iana", + "extensions": ["ext"] + }, + "application/vnd.ntt-local.content-share": { + "source": "iana" + }, + "application/vnd.ntt-local.file-transfer": { + "source": "iana" + }, + "application/vnd.ntt-local.ogw_remote-access": { + "source": "iana" + }, + "application/vnd.ntt-local.sip-ta_remote": { + "source": "iana" + }, + "application/vnd.ntt-local.sip-ta_tcp_stream": { + "source": "iana" + }, + "application/vnd.oasis.opendocument.chart": { + "source": "iana", + "extensions": ["odc"] + }, + "application/vnd.oasis.opendocument.chart-template": { + "source": "iana", + "extensions": ["otc"] + }, + "application/vnd.oasis.opendocument.database": { + "source": "iana", + "extensions": ["odb"] + }, + "application/vnd.oasis.opendocument.formula": { + "source": "iana", + "extensions": ["odf"] + }, + "application/vnd.oasis.opendocument.formula-template": { + "source": "iana", + "extensions": ["odft"] + }, + "application/vnd.oasis.opendocument.graphics": { + "source": "iana", + "compressible": false, + "extensions": ["odg"] + }, + "application/vnd.oasis.opendocument.graphics-template": { + "source": "iana", + "extensions": ["otg"] + }, + "application/vnd.oasis.opendocument.image": { + "source": "iana", + "extensions": ["odi"] + }, + "application/vnd.oasis.opendocument.image-template": { + "source": "iana", + "extensions": ["oti"] + }, + "application/vnd.oasis.opendocument.presentation": { + "source": "iana", + "compressible": false, + "extensions": ["odp"] + }, + "application/vnd.oasis.opendocument.presentation-template": { + "source": "iana", + "extensions": ["otp"] + }, + "application/vnd.oasis.opendocument.spreadsheet": { + "source": "iana", + "compressible": false, + "extensions": ["ods"] + }, + "application/vnd.oasis.opendocument.spreadsheet-template": { + "source": "iana", + "extensions": ["ots"] + }, + "application/vnd.oasis.opendocument.text": { + "source": "iana", + "compressible": false, + "extensions": ["odt"] + }, + "application/vnd.oasis.opendocument.text-master": { + "source": "iana", + "extensions": ["odm"] + }, + "application/vnd.oasis.opendocument.text-template": { + "source": "iana", + "extensions": ["ott"] + }, + "application/vnd.oasis.opendocument.text-web": { + "source": "iana", + "extensions": ["oth"] + }, + "application/vnd.obn": { + "source": "iana" + }, + "application/vnd.oftn.l10n+json": { + "source": "iana", + "compressible": true + }, + "application/vnd.oipf.contentaccessdownload+xml": { + "source": "iana" + }, + "application/vnd.oipf.contentaccessstreaming+xml": { + "source": "iana" + }, + "application/vnd.oipf.cspg-hexbinary": { + "source": "iana" + }, + "application/vnd.oipf.dae.svg+xml": { + "source": "iana" + }, + "application/vnd.oipf.dae.xhtml+xml": { + "source": "iana" + }, + "application/vnd.oipf.mippvcontrolmessage+xml": { + "source": "iana" + }, + "application/vnd.oipf.pae.gem": { + "source": "iana" + }, + "application/vnd.oipf.spdiscovery+xml": { + "source": "iana" + }, + "application/vnd.oipf.spdlist+xml": { + "source": "iana" + }, + "application/vnd.oipf.ueprofile+xml": { + "source": "iana" + }, + "application/vnd.oipf.userprofile+xml": { + "source": "iana" + }, + "application/vnd.olpc-sugar": { + "source": "iana", + "extensions": ["xo"] + }, + "application/vnd.oma-scws-config": { + "source": "iana" + }, + "application/vnd.oma-scws-http-request": { + "source": "iana" + }, + "application/vnd.oma-scws-http-response": { + "source": "iana" + }, + "application/vnd.oma.bcast.associated-procedure-parameter+xml": { + "source": "iana" + }, + "application/vnd.oma.bcast.drm-trigger+xml": { + "source": "iana" + }, + "application/vnd.oma.bcast.imd+xml": { + "source": "iana" + }, + "application/vnd.oma.bcast.ltkm": { + "source": "iana" + }, + "application/vnd.oma.bcast.notification+xml": { + "source": "iana" + }, + "application/vnd.oma.bcast.provisioningtrigger": { + "source": "iana" + }, + "application/vnd.oma.bcast.sgboot": { + "source": "iana" + }, + "application/vnd.oma.bcast.sgdd+xml": { + "source": "iana" + }, + "application/vnd.oma.bcast.sgdu": { + "source": "iana" + }, + "application/vnd.oma.bcast.simple-symbol-container": { + "source": "iana" + }, + "application/vnd.oma.bcast.smartcard-trigger+xml": { + "source": "iana" + }, + "application/vnd.oma.bcast.sprov+xml": { + "source": "iana" + }, + "application/vnd.oma.bcast.stkm": { + "source": "iana" + }, + "application/vnd.oma.cab-address-book+xml": { + "source": "iana" + }, + "application/vnd.oma.cab-feature-handler+xml": { + "source": "iana" + }, + "application/vnd.oma.cab-pcc+xml": { + "source": "iana" + }, + "application/vnd.oma.cab-subs-invite+xml": { + "source": "iana" + }, + "application/vnd.oma.cab-user-prefs+xml": { + "source": "iana" + }, + "application/vnd.oma.dcd": { + "source": "iana" + }, + "application/vnd.oma.dcdc": { + "source": "iana" + }, + "application/vnd.oma.dd2+xml": { + "source": "iana", + "extensions": ["dd2"] + }, + "application/vnd.oma.drm.risd+xml": { + "source": "iana" + }, + "application/vnd.oma.group-usage-list+xml": { + "source": "iana" + }, + "application/vnd.oma.pal+xml": { + "source": "iana" + }, + "application/vnd.oma.poc.detailed-progress-report+xml": { + "source": "iana" + }, + "application/vnd.oma.poc.final-report+xml": { + "source": "iana" + }, + "application/vnd.oma.poc.groups+xml": { + "source": "iana" + }, + "application/vnd.oma.poc.invocation-descriptor+xml": { + "source": "iana" + }, + "application/vnd.oma.poc.optimized-progress-report+xml": { + "source": "iana" + }, + "application/vnd.oma.push": { + "source": "iana" + }, + "application/vnd.oma.scidm.messages+xml": { + "source": "iana" + }, + "application/vnd.oma.xcap-directory+xml": { + "source": "iana" + }, + "application/vnd.omads-email+xml": { + "source": "iana" + }, + "application/vnd.omads-file+xml": { + "source": "iana" + }, + "application/vnd.omads-folder+xml": { + "source": "iana" + }, + "application/vnd.omaloc-supl-init": { + "source": "iana" + }, + "application/vnd.openeye.oeb": { + "source": "iana" + }, + "application/vnd.openofficeorg.extension": { + "source": "apache", + "extensions": ["oxt"] + }, + "application/vnd.openxmlformats-officedocument.custom-properties+xml": { + "source": "iana" + }, + "application/vnd.openxmlformats-officedocument.customxmlproperties+xml": { + "source": "iana" + }, + "application/vnd.openxmlformats-officedocument.drawing+xml": { + "source": "iana" + }, + "application/vnd.openxmlformats-officedocument.drawingml.chart+xml": { + "source": "iana" + }, + "application/vnd.openxmlformats-officedocument.drawingml.chartshapes+xml": { + "source": "iana" + }, + "application/vnd.openxmlformats-officedocument.drawingml.diagramcolors+xml": { + "source": "iana" + }, + "application/vnd.openxmlformats-officedocument.drawingml.diagramdata+xml": { + "source": "iana" + }, + "application/vnd.openxmlformats-officedocument.drawingml.diagramlayout+xml": { + "source": "iana" + }, + "application/vnd.openxmlformats-officedocument.drawingml.diagramstyle+xml": { + "source": "iana" + }, + "application/vnd.openxmlformats-officedocument.extended-properties+xml": { + "source": "iana" + }, + "application/vnd.openxmlformats-officedocument.presentationml-template": { + "source": "iana" + }, + "application/vnd.openxmlformats-officedocument.presentationml.commentauthors+xml": { + "source": "iana" + }, + "application/vnd.openxmlformats-officedocument.presentationml.comments+xml": { + "source": "iana" + }, + "application/vnd.openxmlformats-officedocument.presentationml.handoutmaster+xml": { + "source": "iana" + }, + "application/vnd.openxmlformats-officedocument.presentationml.notesmaster+xml": { + "source": "iana" + }, + "application/vnd.openxmlformats-officedocument.presentationml.notesslide+xml": { + "source": "iana" + }, + "application/vnd.openxmlformats-officedocument.presentationml.presentation": { + "source": "iana", + "compressible": false, + "extensions": ["pptx"] + }, + "application/vnd.openxmlformats-officedocument.presentationml.presentation.main+xml": { + "source": "iana" + }, + "application/vnd.openxmlformats-officedocument.presentationml.presprops+xml": { + "source": "iana" + }, + "application/vnd.openxmlformats-officedocument.presentationml.slide": { + "source": "iana", + "extensions": ["sldx"] + }, + "application/vnd.openxmlformats-officedocument.presentationml.slide+xml": { + "source": "iana" + }, + "application/vnd.openxmlformats-officedocument.presentationml.slidelayout+xml": { + "source": "iana" + }, + "application/vnd.openxmlformats-officedocument.presentationml.slidemaster+xml": { + "source": "iana" + }, + "application/vnd.openxmlformats-officedocument.presentationml.slideshow": { + "source": "iana", + "extensions": ["ppsx"] + }, + "application/vnd.openxmlformats-officedocument.presentationml.slideshow.main+xml": { + "source": "iana" + }, + "application/vnd.openxmlformats-officedocument.presentationml.slideupdateinfo+xml": { + "source": "iana" + }, + "application/vnd.openxmlformats-officedocument.presentationml.tablestyles+xml": { + "source": "iana" + }, + "application/vnd.openxmlformats-officedocument.presentationml.tags+xml": { + "source": "iana" + }, + "application/vnd.openxmlformats-officedocument.presentationml.template": { + "source": "apache", + "extensions": ["potx"] + }, + "application/vnd.openxmlformats-officedocument.presentationml.template.main+xml": { + "source": "iana" + }, + "application/vnd.openxmlformats-officedocument.presentationml.viewprops+xml": { + "source": "iana" + }, + "application/vnd.openxmlformats-officedocument.spreadsheetml-template": { + "source": "iana" + }, + "application/vnd.openxmlformats-officedocument.spreadsheetml.calcchain+xml": { + "source": "iana" + }, + "application/vnd.openxmlformats-officedocument.spreadsheetml.chartsheet+xml": { + "source": "iana" + }, + "application/vnd.openxmlformats-officedocument.spreadsheetml.comments+xml": { + "source": "iana" + }, + "application/vnd.openxmlformats-officedocument.spreadsheetml.connections+xml": { + "source": "iana" + }, + "application/vnd.openxmlformats-officedocument.spreadsheetml.dialogsheet+xml": { + "source": "iana" + }, + "application/vnd.openxmlformats-officedocument.spreadsheetml.externallink+xml": { + "source": "iana" + }, + "application/vnd.openxmlformats-officedocument.spreadsheetml.pivotcachedefinition+xml": { + "source": "iana" + }, + "application/vnd.openxmlformats-officedocument.spreadsheetml.pivotcacherecords+xml": { + "source": "iana" + }, + "application/vnd.openxmlformats-officedocument.spreadsheetml.pivottable+xml": { + "source": "iana" + }, + "application/vnd.openxmlformats-officedocument.spreadsheetml.querytable+xml": { + "source": "iana" + }, + "application/vnd.openxmlformats-officedocument.spreadsheetml.revisionheaders+xml": { + "source": "iana" + }, + "application/vnd.openxmlformats-officedocument.spreadsheetml.revisionlog+xml": { + "source": "iana" + }, + "application/vnd.openxmlformats-officedocument.spreadsheetml.sharedstrings+xml": { + "source": "iana" + }, + "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet": { + "source": "iana", + "compressible": false, + "extensions": ["xlsx"] + }, + "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml": { + "source": "iana" + }, + "application/vnd.openxmlformats-officedocument.spreadsheetml.sheetmetadata+xml": { + "source": "iana" + }, + "application/vnd.openxmlformats-officedocument.spreadsheetml.styles+xml": { + "source": "iana" + }, + "application/vnd.openxmlformats-officedocument.spreadsheetml.table+xml": { + "source": "iana" + }, + "application/vnd.openxmlformats-officedocument.spreadsheetml.tablesinglecells+xml": { + "source": "iana" + }, + "application/vnd.openxmlformats-officedocument.spreadsheetml.template": { + "source": "apache", + "extensions": ["xltx"] + }, + "application/vnd.openxmlformats-officedocument.spreadsheetml.template.main+xml": { + "source": "iana" + }, + "application/vnd.openxmlformats-officedocument.spreadsheetml.usernames+xml": { + "source": "iana" + }, + "application/vnd.openxmlformats-officedocument.spreadsheetml.volatiledependencies+xml": { + "source": "iana" + }, + "application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml": { + "source": "iana" + }, + "application/vnd.openxmlformats-officedocument.theme+xml": { + "source": "iana" + }, + "application/vnd.openxmlformats-officedocument.themeoverride+xml": { + "source": "iana" + }, + "application/vnd.openxmlformats-officedocument.vmldrawing": { + "source": "iana" + }, + "application/vnd.openxmlformats-officedocument.wordprocessingml-template": { + "source": "iana" + }, + "application/vnd.openxmlformats-officedocument.wordprocessingml.comments+xml": { + "source": "iana" + }, + "application/vnd.openxmlformats-officedocument.wordprocessingml.document": { + "source": "iana", + "compressible": false, + "extensions": ["docx"] + }, + "application/vnd.openxmlformats-officedocument.wordprocessingml.document.glossary+xml": { + "source": "iana" + }, + "application/vnd.openxmlformats-officedocument.wordprocessingml.document.main+xml": { + "source": "iana" + }, + "application/vnd.openxmlformats-officedocument.wordprocessingml.endnotes+xml": { + "source": "iana" + }, + "application/vnd.openxmlformats-officedocument.wordprocessingml.fonttable+xml": { + "source": "iana" + }, + "application/vnd.openxmlformats-officedocument.wordprocessingml.footer+xml": { + "source": "iana" + }, + "application/vnd.openxmlformats-officedocument.wordprocessingml.footnotes+xml": { + "source": "iana" + }, + "application/vnd.openxmlformats-officedocument.wordprocessingml.numbering+xml": { + "source": "iana" + }, + "application/vnd.openxmlformats-officedocument.wordprocessingml.settings+xml": { + "source": "iana" + }, + "application/vnd.openxmlformats-officedocument.wordprocessingml.styles+xml": { + "source": "iana" + }, + "application/vnd.openxmlformats-officedocument.wordprocessingml.template": { + "source": "apache", + "extensions": ["dotx"] + }, + "application/vnd.openxmlformats-officedocument.wordprocessingml.template.main+xml": { + "source": "iana" + }, + "application/vnd.openxmlformats-officedocument.wordprocessingml.websettings+xml": { + "source": "iana" + }, + "application/vnd.openxmlformats-package.core-properties+xml": { + "source": "iana" + }, + "application/vnd.openxmlformats-package.digital-signature-xmlsignature+xml": { + "source": "iana" + }, + "application/vnd.openxmlformats-package.relationships+xml": { + "source": "iana" + }, + "application/vnd.oracle.resource+json": { + "source": "iana", + "compressible": true + }, + "application/vnd.orange.indata": { + "source": "iana" + }, + "application/vnd.osa.netdeploy": { + "source": "iana" + }, + "application/vnd.osgeo.mapguide.package": { + "source": "iana", + "extensions": ["mgp"] + }, + "application/vnd.osgi.bundle": { + "source": "iana" + }, + "application/vnd.osgi.dp": { + "source": "iana", + "extensions": ["dp"] + }, + "application/vnd.osgi.subsystem": { + "source": "iana", + "extensions": ["esa"] + }, + "application/vnd.otps.ct-kip+xml": { + "source": "iana" + }, + "application/vnd.palm": { + "source": "iana", + "extensions": ["pdb","pqa","oprc"] + }, + "application/vnd.panoply": { + "source": "iana" + }, + "application/vnd.paos+xml": { + "source": "iana" + }, + "application/vnd.paos.xml": { + "source": "apache" + }, + "application/vnd.pawaafile": { + "source": "iana", + "extensions": ["paw"] + }, + "application/vnd.pcos": { + "source": "iana" + }, + "application/vnd.pg.format": { + "source": "iana", + "extensions": ["str"] + }, + "application/vnd.pg.osasli": { + "source": "iana", + "extensions": ["ei6"] + }, + "application/vnd.piaccess.application-licence": { + "source": "iana" + }, + "application/vnd.picsel": { + "source": "iana", + "extensions": ["efif"] + }, + "application/vnd.pmi.widget": { + "source": "iana", + "extensions": ["wg"] + }, + "application/vnd.poc.group-advertisement+xml": { + "source": "iana" + }, + "application/vnd.pocketlearn": { + "source": "iana", + "extensions": ["plf"] + }, + "application/vnd.powerbuilder6": { + "source": "iana", + "extensions": ["pbd"] + }, + "application/vnd.powerbuilder6-s": { + "source": "iana" + }, + "application/vnd.powerbuilder7": { + "source": "iana" + }, + "application/vnd.powerbuilder7-s": { + "source": "iana" + }, + "application/vnd.powerbuilder75": { + "source": "iana" + }, + "application/vnd.powerbuilder75-s": { + "source": "iana" + }, + "application/vnd.preminet": { + "source": "iana" + }, + "application/vnd.previewsystems.box": { + "source": "iana", + "extensions": ["box"] + }, + "application/vnd.proteus.magazine": { + "source": "iana", + "extensions": ["mgz"] + }, + "application/vnd.publishare-delta-tree": { + "source": "iana", + "extensions": ["qps"] + }, + "application/vnd.pvi.ptid1": { + "source": "iana", + "extensions": ["ptid"] + }, + "application/vnd.pwg-multiplexed": { + "source": "iana" + }, + "application/vnd.pwg-xhtml-print+xml": { + "source": "iana" + }, + "application/vnd.qualcomm.brew-app-res": { + "source": "iana" + }, + "application/vnd.quark.quarkxpress": { + "source": "iana", + "extensions": ["qxd","qxt","qwd","qwt","qxl","qxb"] + }, + "application/vnd.quobject-quoxdocument": { + "source": "iana" + }, + "application/vnd.radisys.moml+xml": { + "source": "iana" + }, + "application/vnd.radisys.msml+xml": { + "source": "iana" + }, + "application/vnd.radisys.msml-audit+xml": { + "source": "iana" + }, + "application/vnd.radisys.msml-audit-conf+xml": { + "source": "iana" + }, + "application/vnd.radisys.msml-audit-conn+xml": { + "source": "iana" + }, + "application/vnd.radisys.msml-audit-dialog+xml": { + "source": "iana" + }, + "application/vnd.radisys.msml-audit-stream+xml": { + "source": "iana" + }, + "application/vnd.radisys.msml-conf+xml": { + "source": "iana" + }, + "application/vnd.radisys.msml-dialog+xml": { + "source": "iana" + }, + "application/vnd.radisys.msml-dialog-base+xml": { + "source": "iana" + }, + "application/vnd.radisys.msml-dialog-fax-detect+xml": { + "source": "iana" + }, + "application/vnd.radisys.msml-dialog-fax-sendrecv+xml": { + "source": "iana" + }, + "application/vnd.radisys.msml-dialog-group+xml": { + "source": "iana" + }, + "application/vnd.radisys.msml-dialog-speech+xml": { + "source": "iana" + }, + "application/vnd.radisys.msml-dialog-transform+xml": { + "source": "iana" + }, + "application/vnd.rainstor.data": { + "source": "iana" + }, + "application/vnd.rapid": { + "source": "iana" + }, + "application/vnd.realvnc.bed": { + "source": "iana", + "extensions": ["bed"] + }, + "application/vnd.recordare.musicxml": { + "source": "iana", + "extensions": ["mxl"] + }, + "application/vnd.recordare.musicxml+xml": { + "source": "iana", + "extensions": ["musicxml"] + }, + "application/vnd.renlearn.rlprint": { + "source": "iana" + }, + "application/vnd.rig.cryptonote": { + "source": "iana", + "extensions": ["cryptonote"] + }, + "application/vnd.rim.cod": { + "source": "apache", + "extensions": ["cod"] + }, + "application/vnd.rn-realmedia": { + "source": "apache", + "extensions": ["rm"] + }, + "application/vnd.rn-realmedia-vbr": { + "source": "apache", + "extensions": ["rmvb"] + }, + "application/vnd.route66.link66+xml": { + "source": "iana", + "extensions": ["link66"] + }, + "application/vnd.rs-274x": { + "source": "iana" + }, + "application/vnd.ruckus.download": { + "source": "iana" + }, + "application/vnd.s3sms": { + "source": "iana" + }, + "application/vnd.sailingtracker.track": { + "source": "iana", + "extensions": ["st"] + }, + "application/vnd.sbm.cid": { + "source": "iana" + }, + "application/vnd.sbm.mid2": { + "source": "iana" + }, + "application/vnd.scribus": { + "source": "iana" + }, + "application/vnd.sealed.3df": { + "source": "iana" + }, + "application/vnd.sealed.csf": { + "source": "iana" + }, + "application/vnd.sealed.doc": { + "source": "iana" + }, + "application/vnd.sealed.eml": { + "source": "iana" + }, + "application/vnd.sealed.mht": { + "source": "iana" + }, + "application/vnd.sealed.net": { + "source": "iana" + }, + "application/vnd.sealed.ppt": { + "source": "iana" + }, + "application/vnd.sealed.tiff": { + "source": "iana" + }, + "application/vnd.sealed.xls": { + "source": "iana" + }, + "application/vnd.sealedmedia.softseal.html": { + "source": "iana" + }, + "application/vnd.sealedmedia.softseal.pdf": { + "source": "iana" + }, + "application/vnd.seemail": { + "source": "iana", + "extensions": ["see"] + }, + "application/vnd.sema": { + "source": "iana", + "extensions": ["sema"] + }, + "application/vnd.semd": { + "source": "iana", + "extensions": ["semd"] + }, + "application/vnd.semf": { + "source": "iana", + "extensions": ["semf"] + }, + "application/vnd.shana.informed.formdata": { + "source": "iana", + "extensions": ["ifm"] + }, + "application/vnd.shana.informed.formtemplate": { + "source": "iana", + "extensions": ["itp"] + }, + "application/vnd.shana.informed.interchange": { + "source": "iana", + "extensions": ["iif"] + }, + "application/vnd.shana.informed.package": { + "source": "iana", + "extensions": ["ipk"] + }, + "application/vnd.simtech-mindmapper": { + "source": "iana", + "extensions": ["twd","twds"] + }, + "application/vnd.siren+json": { + "source": "iana", + "compressible": true + }, + "application/vnd.smaf": { + "source": "iana", + "extensions": ["mmf"] + }, + "application/vnd.smart.notebook": { + "source": "iana" + }, + "application/vnd.smart.teacher": { + "source": "iana", + "extensions": ["teacher"] + }, + "application/vnd.software602.filler.form+xml": { + "source": "iana" + }, + "application/vnd.software602.filler.form-xml-zip": { + "source": "iana" + }, + "application/vnd.solent.sdkm+xml": { + "source": "iana", + "extensions": ["sdkm","sdkd"] + }, + "application/vnd.spotfire.dxp": { + "source": "iana", + "extensions": ["dxp"] + }, + "application/vnd.spotfire.sfs": { + "source": "iana", + "extensions": ["sfs"] + }, + "application/vnd.sss-cod": { + "source": "iana" + }, + "application/vnd.sss-dtf": { + "source": "iana" + }, + "application/vnd.sss-ntf": { + "source": "iana" + }, + "application/vnd.stardivision.calc": { + "source": "apache", + "extensions": ["sdc"] + }, + "application/vnd.stardivision.draw": { + "source": "apache", + "extensions": ["sda"] + }, + "application/vnd.stardivision.impress": { + "source": "apache", + "extensions": ["sdd"] + }, + "application/vnd.stardivision.math": { + "source": "apache", + "extensions": ["smf"] + }, + "application/vnd.stardivision.writer": { + "source": "apache", + "extensions": ["sdw","vor"] + }, + "application/vnd.stardivision.writer-global": { + "source": "apache", + "extensions": ["sgl"] + }, + "application/vnd.stepmania.package": { + "source": "iana", + "extensions": ["smzip"] + }, + "application/vnd.stepmania.stepchart": { + "source": "iana", + "extensions": ["sm"] + }, + "application/vnd.street-stream": { + "source": "iana" + }, + "application/vnd.sun.wadl+xml": { + "source": "iana" + }, + "application/vnd.sun.xml.calc": { + "source": "apache", + "extensions": ["sxc"] + }, + "application/vnd.sun.xml.calc.template": { + "source": "apache", + "extensions": ["stc"] + }, + "application/vnd.sun.xml.draw": { + "source": "apache", + "extensions": ["sxd"] + }, + "application/vnd.sun.xml.draw.template": { + "source": "apache", + "extensions": ["std"] + }, + "application/vnd.sun.xml.impress": { + "source": "apache", + "extensions": ["sxi"] + }, + "application/vnd.sun.xml.impress.template": { + "source": "apache", + "extensions": ["sti"] + }, + "application/vnd.sun.xml.math": { + "source": "apache", + "extensions": ["sxm"] + }, + "application/vnd.sun.xml.writer": { + "source": "apache", + "extensions": ["sxw"] + }, + "application/vnd.sun.xml.writer.global": { + "source": "apache", + "extensions": ["sxg"] + }, + "application/vnd.sun.xml.writer.template": { + "source": "apache", + "extensions": ["stw"] + }, + "application/vnd.sus-calendar": { + "source": "iana", + "extensions": ["sus","susp"] + }, + "application/vnd.svd": { + "source": "iana", + "extensions": ["svd"] + }, + "application/vnd.swiftview-ics": { + "source": "iana" + }, + "application/vnd.symbian.install": { + "source": "apache", + "extensions": ["sis","sisx"] + }, + "application/vnd.syncml+xml": { + "source": "iana", + "extensions": ["xsm"] + }, + "application/vnd.syncml.dm+wbxml": { + "source": "iana", + "extensions": ["bdm"] + }, + "application/vnd.syncml.dm+xml": { + "source": "iana", + "extensions": ["xdm"] + }, + "application/vnd.syncml.dm.notification": { + "source": "iana" + }, + "application/vnd.syncml.dmddf+wbxml": { + "source": "iana" + }, + "application/vnd.syncml.dmddf+xml": { + "source": "iana" + }, + "application/vnd.syncml.dmtnds+wbxml": { + "source": "iana" + }, + "application/vnd.syncml.dmtnds+xml": { + "source": "iana" + }, + "application/vnd.syncml.ds.notification": { + "source": "iana" + }, + "application/vnd.tao.intent-module-archive": { + "source": "iana", + "extensions": ["tao"] + }, + "application/vnd.tcpdump.pcap": { + "source": "iana", + "extensions": ["pcap","cap","dmp"] + }, + "application/vnd.tmd.mediaflex.api+xml": { + "source": "iana" + }, + "application/vnd.tmobile-livetv": { + "source": "iana", + "extensions": ["tmo"] + }, + "application/vnd.trid.tpt": { + "source": "iana", + "extensions": ["tpt"] + }, + "application/vnd.triscape.mxs": { + "source": "iana", + "extensions": ["mxs"] + }, + "application/vnd.trueapp": { + "source": "iana", + "extensions": ["tra"] + }, + "application/vnd.truedoc": { + "source": "iana" + }, + "application/vnd.ubisoft.webplayer": { + "source": "iana" + }, + "application/vnd.ufdl": { + "source": "iana", + "extensions": ["ufd","ufdl"] + }, + "application/vnd.uiq.theme": { + "source": "iana", + "extensions": ["utz"] + }, + "application/vnd.umajin": { + "source": "iana", + "extensions": ["umj"] + }, + "application/vnd.unity": { + "source": "iana", + "extensions": ["unityweb"] + }, + "application/vnd.uoml+xml": { + "source": "iana", + "extensions": ["uoml"] + }, + "application/vnd.uplanet.alert": { + "source": "iana" + }, + "application/vnd.uplanet.alert-wbxml": { + "source": "iana" + }, + "application/vnd.uplanet.bearer-choice": { + "source": "iana" + }, + "application/vnd.uplanet.bearer-choice-wbxml": { + "source": "iana" + }, + "application/vnd.uplanet.cacheop": { + "source": "iana" + }, + "application/vnd.uplanet.cacheop-wbxml": { + "source": "iana" + }, + "application/vnd.uplanet.channel": { + "source": "iana" + }, + "application/vnd.uplanet.channel-wbxml": { + "source": "iana" + }, + "application/vnd.uplanet.list": { + "source": "iana" + }, + "application/vnd.uplanet.list-wbxml": { + "source": "iana" + }, + "application/vnd.uplanet.listcmd": { + "source": "iana" + }, + "application/vnd.uplanet.listcmd-wbxml": { + "source": "iana" + }, + "application/vnd.uplanet.signal": { + "source": "iana" + }, + "application/vnd.valve.source.material": { + "source": "iana" + }, + "application/vnd.vcx": { + "source": "iana", + "extensions": ["vcx"] + }, + "application/vnd.vd-study": { + "source": "iana" + }, + "application/vnd.vectorworks": { + "source": "iana" + }, + "application/vnd.verimatrix.vcas": { + "source": "iana" + }, + "application/vnd.vidsoft.vidconference": { + "source": "iana" + }, + "application/vnd.visio": { + "source": "iana", + "extensions": ["vsd","vst","vss","vsw"] + }, + "application/vnd.visionary": { + "source": "iana", + "extensions": ["vis"] + }, + "application/vnd.vividence.scriptfile": { + "source": "iana" + }, + "application/vnd.vsf": { + "source": "iana", + "extensions": ["vsf"] + }, + "application/vnd.wap.sic": { + "source": "iana" + }, + "application/vnd.wap.slc": { + "source": "iana" + }, + "application/vnd.wap.wbxml": { + "source": "iana", + "extensions": ["wbxml"] + }, + "application/vnd.wap.wmlc": { + "source": "iana", + "extensions": ["wmlc"] + }, + "application/vnd.wap.wmlscriptc": { + "source": "iana", + "extensions": ["wmlsc"] + }, + "application/vnd.webturbo": { + "source": "iana", + "extensions": ["wtb"] + }, + "application/vnd.wfa.p2p": { + "source": "iana" + }, + "application/vnd.wfa.wsc": { + "source": "iana" + }, + "application/vnd.windows.devicepairing": { + "source": "iana" + }, + "application/vnd.wmc": { + "source": "iana" + }, + "application/vnd.wmf.bootstrap": { + "source": "iana" + }, + "application/vnd.wolfram.mathematica": { + "source": "iana" + }, + "application/vnd.wolfram.mathematica.package": { + "source": "iana" + }, + "application/vnd.wolfram.player": { + "source": "iana", + "extensions": ["nbp"] + }, + "application/vnd.wordperfect": { + "source": "iana", + "extensions": ["wpd"] + }, + "application/vnd.wqd": { + "source": "iana", + "extensions": ["wqd"] + }, + "application/vnd.wrq-hp3000-labelled": { + "source": "iana" + }, + "application/vnd.wt.stf": { + "source": "iana", + "extensions": ["stf"] + }, + "application/vnd.wv.csp+wbxml": { + "source": "iana" + }, + "application/vnd.wv.csp+xml": { + "source": "iana" + }, + "application/vnd.wv.ssp+xml": { + "source": "iana" + }, + "application/vnd.xacml+json": { + "source": "iana", + "compressible": true + }, + "application/vnd.xara": { + "source": "iana", + "extensions": ["xar"] + }, + "application/vnd.xfdl": { + "source": "iana", + "extensions": ["xfdl"] + }, + "application/vnd.xfdl.webform": { + "source": "iana" + }, + "application/vnd.xmi+xml": { + "source": "iana" + }, + "application/vnd.xmpie.cpkg": { + "source": "iana" + }, + "application/vnd.xmpie.dpkg": { + "source": "iana" + }, + "application/vnd.xmpie.plan": { + "source": "iana" + }, + "application/vnd.xmpie.ppkg": { + "source": "iana" + }, + "application/vnd.xmpie.xlim": { + "source": "iana" + }, + "application/vnd.yamaha.hv-dic": { + "source": "iana", + "extensions": ["hvd"] + }, + "application/vnd.yamaha.hv-script": { + "source": "iana", + "extensions": ["hvs"] + }, + "application/vnd.yamaha.hv-voice": { + "source": "iana", + "extensions": ["hvp"] + }, + "application/vnd.yamaha.openscoreformat": { + "source": "iana", + "extensions": ["osf"] + }, + "application/vnd.yamaha.openscoreformat.osfpvg+xml": { + "source": "iana", + "extensions": ["osfpvg"] + }, + "application/vnd.yamaha.remote-setup": { + "source": "iana" + }, + "application/vnd.yamaha.smaf-audio": { + "source": "iana", + "extensions": ["saf"] + }, + "application/vnd.yamaha.smaf-phrase": { + "source": "iana", + "extensions": ["spf"] + }, + "application/vnd.yamaha.through-ngn": { + "source": "iana" + }, + "application/vnd.yamaha.tunnel-udpencap": { + "source": "iana" + }, + "application/vnd.yaoweme": { + "source": "iana" + }, + "application/vnd.yellowriver-custom-menu": { + "source": "iana", + "extensions": ["cmp"] + }, + "application/vnd.zul": { + "source": "iana", + "extensions": ["zir","zirz"] + }, + "application/vnd.zzazz.deck+xml": { + "source": "iana", + "extensions": ["zaz"] + }, + "application/voicexml+xml": { + "source": "iana", + "extensions": ["vxml"] + }, + "application/vq-rtcpxr": { + "source": "iana" + }, + "application/watcherinfo+xml": { + "source": "iana" + }, + "application/whoispp-query": { + "source": "iana" + }, + "application/whoispp-response": { + "source": "iana" + }, + "application/widget": { + "source": "iana", + "extensions": ["wgt"] + }, + "application/winhlp": { + "source": "apache", + "extensions": ["hlp"] + }, + "application/wita": { + "source": "iana" + }, + "application/wordperfect5.1": { + "source": "iana" + }, + "application/wsdl+xml": { + "source": "iana", + "extensions": ["wsdl"] + }, + "application/wspolicy+xml": { + "source": "iana", + "extensions": ["wspolicy"] + }, + "application/x-7z-compressed": { + "source": "apache", + "compressible": false, + "extensions": ["7z"] + }, + "application/x-abiword": { + "source": "apache", + "extensions": ["abw"] + }, + "application/x-ace-compressed": { + "source": "apache", + "extensions": ["ace"] + }, + "application/x-amf": { + "source": "apache" + }, + "application/x-apple-diskimage": { + "source": "apache", + "extensions": ["dmg"] + }, + "application/x-authorware-bin": { + "source": "apache", + "extensions": ["aab","x32","u32","vox"] + }, + "application/x-authorware-map": { + "source": "apache", + "extensions": ["aam"] + }, + "application/x-authorware-seg": { + "source": "apache", + "extensions": ["aas"] + }, + "application/x-bcpio": { + "source": "apache", + "extensions": ["bcpio"] + }, + "application/x-bittorrent": { + "source": "apache", + "extensions": ["torrent"] + }, + "application/x-blorb": { + "source": "apache", + "extensions": ["blb","blorb"] + }, + "application/x-bzip": { + "source": "apache", + "compressible": false, + "extensions": ["bz"] + }, + "application/x-bzip2": { + "source": "apache", + "compressible": false, + "extensions": ["bz2","boz"] + }, + "application/x-cbr": { + "source": "apache", + "extensions": ["cbr","cba","cbt","cbz","cb7"] + }, + "application/x-cdlink": { + "source": "apache", + "extensions": ["vcd"] + }, + "application/x-cfs-compressed": { + "source": "apache", + "extensions": ["cfs"] + }, + "application/x-chat": { + "source": "apache", + "extensions": ["chat"] + }, + "application/x-chess-pgn": { + "source": "apache", + "extensions": ["pgn"] + }, + "application/x-chrome-extension": { + "extensions": ["crx"] + }, + "application/x-compress": { + "source": "apache" + }, + "application/x-conference": { + "source": "apache", + "extensions": ["nsc"] + }, + "application/x-cpio": { + "source": "apache", + "extensions": ["cpio"] + }, + "application/x-csh": { + "source": "apache", + "extensions": ["csh"] + }, + "application/x-deb": { + "compressible": false + }, + "application/x-debian-package": { + "source": "apache", + "extensions": ["deb","udeb"] + }, + "application/x-dgc-compressed": { + "source": "apache", + "extensions": ["dgc"] + }, + "application/x-director": { + "source": "apache", + "extensions": ["dir","dcr","dxr","cst","cct","cxt","w3d","fgd","swa"] + }, + "application/x-doom": { + "source": "apache", + "extensions": ["wad"] + }, + "application/x-dtbncx+xml": { + "source": "apache", + "extensions": ["ncx"] + }, + "application/x-dtbook+xml": { + "source": "apache", + "extensions": ["dtb"] + }, + "application/x-dtbresource+xml": { + "source": "apache", + "extensions": ["res"] + }, + "application/x-dvi": { + "source": "apache", + "compressible": false, + "extensions": ["dvi"] + }, + "application/x-envoy": { + "source": "apache", + "extensions": ["evy"] + }, + "application/x-eva": { + "source": "apache", + "extensions": ["eva"] + }, + "application/x-font-bdf": { + "source": "apache", + "extensions": ["bdf"] + }, + "application/x-font-dos": { + "source": "apache" + }, + "application/x-font-framemaker": { + "source": "apache" + }, + "application/x-font-ghostscript": { + "source": "apache", + "extensions": ["gsf"] + }, + "application/x-font-libgrx": { + "source": "apache" + }, + "application/x-font-linux-psf": { + "source": "apache", + "extensions": ["psf"] + }, + "application/x-font-otf": { + "source": "apache", + "compressible": true, + "extensions": ["otf"] + }, + "application/x-font-pcf": { + "source": "apache", + "extensions": ["pcf"] + }, + "application/x-font-snf": { + "source": "apache", + "extensions": ["snf"] + }, + "application/x-font-speedo": { + "source": "apache" + }, + "application/x-font-sunos-news": { + "source": "apache" + }, + "application/x-font-ttf": { + "source": "apache", + "compressible": true, + "extensions": ["ttf","ttc"] + }, + "application/x-font-type1": { + "source": "apache", + "extensions": ["pfa","pfb","pfm","afm"] + }, + "application/x-font-vfont": { + "source": "apache" + }, + "application/x-freearc": { + "source": "apache", + "extensions": ["arc"] + }, + "application/x-futuresplash": { + "source": "apache", + "extensions": ["spl"] + }, + "application/x-gca-compressed": { + "source": "apache", + "extensions": ["gca"] + }, + "application/x-glulx": { + "source": "apache", + "extensions": ["ulx"] + }, + "application/x-gnumeric": { + "source": "apache", + "extensions": ["gnumeric"] + }, + "application/x-gramps-xml": { + "source": "apache", + "extensions": ["gramps"] + }, + "application/x-gtar": { + "source": "apache", + "extensions": ["gtar"] + }, + "application/x-gzip": { + "source": "apache" + }, + "application/x-hdf": { + "source": "apache", + "extensions": ["hdf"] + }, + "application/x-install-instructions": { + "source": "apache", + "extensions": ["install"] + }, + "application/x-iso9660-image": { + "source": "apache", + "extensions": ["iso"] + }, + "application/x-java-jnlp-file": { + "source": "apache", + "compressible": false, + "extensions": ["jnlp"] + }, + "application/x-javascript": { + "compressible": true + }, + "application/x-latex": { + "source": "apache", + "compressible": false, + "extensions": ["latex"] + }, + "application/x-lua-bytecode": { + "extensions": ["luac"] + }, + "application/x-lzh-compressed": { + "source": "apache", + "extensions": ["lzh","lha"] + }, + "application/x-mie": { + "source": "apache", + "extensions": ["mie"] + }, + "application/x-mobipocket-ebook": { + "source": "apache", + "extensions": ["prc","mobi"] + }, + "application/x-mpegurl": { + "compressible": false + }, + "application/x-ms-application": { + "source": "apache", + "extensions": ["application"] + }, + "application/x-ms-shortcut": { + "source": "apache", + "extensions": ["lnk"] + }, + "application/x-ms-wmd": { + "source": "apache", + "extensions": ["wmd"] + }, + "application/x-ms-wmz": { + "source": "apache", + "extensions": ["wmz"] + }, + "application/x-ms-xbap": { + "source": "apache", + "extensions": ["xbap"] + }, + "application/x-msaccess": { + "source": "apache", + "extensions": ["mdb"] + }, + "application/x-msbinder": { + "source": "apache", + "extensions": ["obd"] + }, + "application/x-mscardfile": { + "source": "apache", + "extensions": ["crd"] + }, + "application/x-msclip": { + "source": "apache", + "extensions": ["clp"] + }, + "application/x-msdownload": { + "source": "apache", + "extensions": ["exe","dll","com","bat","msi"] + }, + "application/x-msmediaview": { + "source": "apache", + "extensions": ["mvb","m13","m14"] + }, + "application/x-msmetafile": { + "source": "apache", + "extensions": ["wmf","wmz","emf","emz"] + }, + "application/x-msmoney": { + "source": "apache", + "extensions": ["mny"] + }, + "application/x-mspublisher": { + "source": "apache", + "extensions": ["pub"] + }, + "application/x-msschedule": { + "source": "apache", + "extensions": ["scd"] + }, + "application/x-msterminal": { + "source": "apache", + "extensions": ["trm"] + }, + "application/x-mswrite": { + "source": "apache", + "extensions": ["wri"] + }, + "application/x-netcdf": { + "source": "apache", + "extensions": ["nc","cdf"] + }, + "application/x-nzb": { + "source": "apache", + "extensions": ["nzb"] + }, + "application/x-pkcs12": { + "source": "apache", + "compressible": false, + "extensions": ["p12","pfx"] + }, + "application/x-pkcs7-certificates": { + "source": "apache", + "extensions": ["p7b","spc"] + }, + "application/x-pkcs7-certreqresp": { + "source": "apache", + "extensions": ["p7r"] + }, + "application/x-rar-compressed": { + "source": "apache", + "compressible": false, + "extensions": ["rar"] + }, + "application/x-research-info-systems": { + "source": "apache", + "extensions": ["ris"] + }, + "application/x-sh": { + "source": "apache", + "compressible": true, + "extensions": ["sh"] + }, + "application/x-shar": { + "source": "apache", + "extensions": ["shar"] + }, + "application/x-shockwave-flash": { + "source": "apache", + "compressible": false, + "extensions": ["swf"] + }, + "application/x-silverlight-app": { + "source": "apache", + "extensions": ["xap"] + }, + "application/x-sql": { + "source": "apache", + "extensions": ["sql"] + }, + "application/x-stuffit": { + "source": "apache", + "compressible": false, + "extensions": ["sit"] + }, + "application/x-stuffitx": { + "source": "apache", + "extensions": ["sitx"] + }, + "application/x-subrip": { + "source": "apache", + "extensions": ["srt"] + }, + "application/x-sv4cpio": { + "source": "apache", + "extensions": ["sv4cpio"] + }, + "application/x-sv4crc": { + "source": "apache", + "extensions": ["sv4crc"] + }, + "application/x-t3vm-image": { + "source": "apache", + "extensions": ["t3"] + }, + "application/x-tads": { + "source": "apache", + "extensions": ["gam"] + }, + "application/x-tar": { + "source": "apache", + "compressible": true, + "extensions": ["tar"] + }, + "application/x-tcl": { + "source": "apache", + "extensions": ["tcl"] + }, + "application/x-tex": { + "source": "apache", + "extensions": ["tex"] + }, + "application/x-tex-tfm": { + "source": "apache", + "extensions": ["tfm"] + }, + "application/x-texinfo": { + "source": "apache", + "extensions": ["texinfo","texi"] + }, + "application/x-tgif": { + "source": "apache", + "extensions": ["obj"] + }, + "application/x-ustar": { + "source": "apache", + "extensions": ["ustar"] + }, + "application/x-wais-source": { + "source": "apache", + "extensions": ["src"] + }, + "application/x-web-app-manifest+json": { + "compressible": true, + "extensions": ["webapp"] + }, + "application/x-www-form-urlencoded": { + "source": "iana", + "compressible": true + }, + "application/x-x509-ca-cert": { + "source": "apache", + "extensions": ["der","crt"] + }, + "application/x-xfig": { + "source": "apache", + "extensions": ["fig"] + }, + "application/x-xliff+xml": { + "source": "apache", + "extensions": ["xlf"] + }, + "application/x-xpinstall": { + "source": "apache", + "compressible": false, + "extensions": ["xpi"] + }, + "application/x-xz": { + "source": "apache", + "extensions": ["xz"] + }, + "application/x-zmachine": { + "source": "apache", + "extensions": ["z1","z2","z3","z4","z5","z6","z7","z8"] + }, + "application/x400-bp": { + "source": "iana" + }, + "application/xacml+xml": { + "source": "iana" + }, + "application/xaml+xml": { + "source": "apache", + "extensions": ["xaml"] + }, + "application/xcap-att+xml": { + "source": "iana" + }, + "application/xcap-caps+xml": { + "source": "iana" + }, + "application/xcap-diff+xml": { + "source": "iana", + "extensions": ["xdf"] + }, + "application/xcap-el+xml": { + "source": "iana" + }, + "application/xcap-error+xml": { + "source": "iana" + }, + "application/xcap-ns+xml": { + "source": "iana" + }, + "application/xcon-conference-info+xml": { + "source": "iana" + }, + "application/xcon-conference-info-diff+xml": { + "source": "iana" + }, + "application/xenc+xml": { + "source": "iana", + "extensions": ["xenc"] + }, + "application/xhtml+xml": { + "source": "iana", + "compressible": true, + "extensions": ["xhtml","xht"] + }, + "application/xhtml-voice+xml": { + "source": "iana" + }, + "application/xml": { + "source": "iana", + "compressible": true, + "extensions": ["xml","xsl","xsd"] + }, + "application/xml-dtd": { + "source": "iana", + "compressible": true, + "extensions": ["dtd"] + }, + "application/xml-external-parsed-entity": { + "source": "iana" + }, + "application/xml-patch+xml": { + "source": "iana" + }, + "application/xmpp+xml": { + "source": "iana" + }, + "application/xop+xml": { + "source": "iana", + "compressible": true, + "extensions": ["xop"] + }, + "application/xproc+xml": { + "source": "apache", + "extensions": ["xpl"] + }, + "application/xslt+xml": { + "source": "iana", + "extensions": ["xslt"] + }, + "application/xspf+xml": { + "source": "apache", + "extensions": ["xspf"] + }, + "application/xv+xml": { + "source": "iana", + "extensions": ["mxml","xhvml","xvml","xvm"] + }, + "application/yang": { + "source": "iana", + "extensions": ["yang"] + }, + "application/yin+xml": { + "source": "iana", + "extensions": ["yin"] + }, + "application/zip": { + "source": "iana", + "compressible": false, + "extensions": ["zip"] + }, + "application/zlib": { + "source": "iana" + }, + "audio/1d-interleaved-parityfec": { + "source": "iana" + }, + "audio/32kadpcm": { + "source": "iana" + }, + "audio/3gpp": { + "source": "iana" + }, + "audio/3gpp2": { + "source": "iana" + }, + "audio/ac3": { + "source": "iana" + }, + "audio/adpcm": { + "source": "apache", + "extensions": ["adp"] + }, + "audio/amr": { + "source": "iana" + }, + "audio/amr-wb": { + "source": "iana" + }, + "audio/amr-wb+": { + "source": "iana" + }, + "audio/aptx": { + "source": "iana" + }, + "audio/asc": { + "source": "iana" + }, + "audio/atrac-advanced-lossless": { + "source": "iana" + }, + "audio/atrac-x": { + "source": "iana" + }, + "audio/atrac3": { + "source": "iana" + }, + "audio/basic": { + "source": "iana", + "compressible": false, + "extensions": ["au","snd"] + }, + "audio/bv16": { + "source": "iana" + }, + "audio/bv32": { + "source": "iana" + }, + "audio/clearmode": { + "source": "iana" + }, + "audio/cn": { + "source": "iana" + }, + "audio/dat12": { + "source": "iana" + }, + "audio/dls": { + "source": "iana" + }, + "audio/dsr-es201108": { + "source": "iana" + }, + "audio/dsr-es202050": { + "source": "iana" + }, + "audio/dsr-es202211": { + "source": "iana" + }, + "audio/dsr-es202212": { + "source": "iana" + }, + "audio/dv": { + "source": "iana" + }, + "audio/dvi4": { + "source": "iana" + }, + "audio/eac3": { + "source": "iana" + }, + "audio/encaprtp": { + "source": "iana" + }, + "audio/evrc": { + "source": "iana" + }, + "audio/evrc-qcp": { + "source": "iana" + }, + "audio/evrc0": { + "source": "iana" + }, + "audio/evrc1": { + "source": "iana" + }, + "audio/evrcb": { + "source": "iana" + }, + "audio/evrcb0": { + "source": "iana" + }, + "audio/evrcb1": { + "source": "iana" + }, + "audio/evrcnw": { + "source": "iana" + }, + "audio/evrcnw0": { + "source": "iana" + }, + "audio/evrcnw1": { + "source": "iana" + }, + "audio/evrcwb": { + "source": "iana" + }, + "audio/evrcwb0": { + "source": "iana" + }, + "audio/evrcwb1": { + "source": "iana" + }, + "audio/fwdred": { + "source": "iana" + }, + "audio/g719": { + "source": "iana" + }, + "audio/g722": { + "source": "iana" + }, + "audio/g7221": { + "source": "iana" + }, + "audio/g723": { + "source": "iana" + }, + "audio/g726-16": { + "source": "iana" + }, + "audio/g726-24": { + "source": "iana" + }, + "audio/g726-32": { + "source": "iana" + }, + "audio/g726-40": { + "source": "iana" + }, + "audio/g728": { + "source": "iana" + }, + "audio/g729": { + "source": "iana" + }, + "audio/g7291": { + "source": "iana" + }, + "audio/g729d": { + "source": "iana" + }, + "audio/g729e": { + "source": "iana" + }, + "audio/gsm": { + "source": "iana" + }, + "audio/gsm-efr": { + "source": "iana" + }, + "audio/gsm-hr-08": { + "source": "iana" + }, + "audio/ilbc": { + "source": "iana" + }, + "audio/ip-mr_v2.5": { + "source": "iana" + }, + "audio/isac": { + "source": "apache" + }, + "audio/l16": { + "source": "iana" + }, + "audio/l20": { + "source": "iana" + }, + "audio/l24": { + "source": "iana", + "compressible": false + }, + "audio/l8": { + "source": "iana" + }, + "audio/lpc": { + "source": "iana" + }, + "audio/midi": { + "source": "apache", + "extensions": ["mid","midi","kar","rmi"] + }, + "audio/mobile-xmf": { + "source": "iana" + }, + "audio/mp4": { + "source": "iana", + "compressible": false, + "extensions": ["mp4a","m4a"] + }, + "audio/mp4a-latm": { + "source": "iana" + }, + "audio/mpa": { + "source": "iana" + }, + "audio/mpa-robust": { + "source": "iana" + }, + "audio/mpeg": { + "source": "iana", + "compressible": false, + "extensions": ["mpga","mp2","mp2a","mp3","m2a","m3a"] + }, + "audio/mpeg4-generic": { + "source": "iana" + }, + "audio/musepack": { + "source": "apache" + }, + "audio/ogg": { + "source": "iana", + "compressible": false, + "extensions": ["oga","ogg","spx"] + }, + "audio/opus": { + "source": "apache" + }, + "audio/parityfec": { + "source": "iana" + }, + "audio/pcma": { + "source": "iana" + }, + "audio/pcma-wb": { + "source": "iana" + }, + "audio/pcmu": { + "source": "iana" + }, + "audio/pcmu-wb": { + "source": "iana" + }, + "audio/prs.sid": { + "source": "iana" + }, + "audio/qcelp": { + "source": "iana" + }, + "audio/raptorfec": { + "source": "iana" + }, + "audio/red": { + "source": "iana" + }, + "audio/rtp-enc-aescm128": { + "source": "iana" + }, + "audio/rtp-midi": { + "source": "iana" + }, + "audio/rtploopback": { + "source": "iana" + }, + "audio/rtx": { + "source": "iana" + }, + "audio/s3m": { + "source": "apache", + "extensions": ["s3m"] + }, + "audio/silk": { + "source": "apache", + "extensions": ["sil"] + }, + "audio/smv": { + "source": "iana" + }, + "audio/smv-qcp": { + "source": "iana" + }, + "audio/smv0": { + "source": "iana" + }, + "audio/sp-midi": { + "source": "iana" + }, + "audio/speex": { + "source": "iana" + }, + "audio/t140c": { + "source": "iana" + }, + "audio/t38": { + "source": "iana" + }, + "audio/telephone-event": { + "source": "iana" + }, + "audio/tone": { + "source": "iana" + }, + "audio/uemclip": { + "source": "iana" + }, + "audio/ulpfec": { + "source": "iana" + }, + "audio/vdvi": { + "source": "iana" + }, + "audio/vmr-wb": { + "source": "iana" + }, + "audio/vnd.3gpp.iufp": { + "source": "iana" + }, + "audio/vnd.4sb": { + "source": "iana" + }, + "audio/vnd.audiokoz": { + "source": "iana" + }, + "audio/vnd.celp": { + "source": "iana" + }, + "audio/vnd.cisco.nse": { + "source": "iana" + }, + "audio/vnd.cmles.radio-events": { + "source": "iana" + }, + "audio/vnd.cns.anp1": { + "source": "iana" + }, + "audio/vnd.cns.inf1": { + "source": "iana" + }, + "audio/vnd.dece.audio": { + "source": "iana", + "extensions": ["uva","uvva"] + }, + "audio/vnd.digital-winds": { + "source": "iana", + "extensions": ["eol"] + }, + "audio/vnd.dlna.adts": { + "source": "iana" + }, + "audio/vnd.dolby.heaac.1": { + "source": "iana" + }, + "audio/vnd.dolby.heaac.2": { + "source": "iana" + }, + "audio/vnd.dolby.mlp": { + "source": "iana" + }, + "audio/vnd.dolby.mps": { + "source": "iana" + }, + "audio/vnd.dolby.pl2": { + "source": "iana" + }, + "audio/vnd.dolby.pl2x": { + "source": "iana" + }, + "audio/vnd.dolby.pl2z": { + "source": "iana" + }, + "audio/vnd.dolby.pulse.1": { + "source": "iana" + }, + "audio/vnd.dra": { + "source": "iana", + "extensions": ["dra"] + }, + "audio/vnd.dts": { + "source": "iana", + "extensions": ["dts"] + }, + "audio/vnd.dts.hd": { + "source": "iana", + "extensions": ["dtshd"] + }, + "audio/vnd.dvb.file": { + "source": "iana" + }, + "audio/vnd.everad.plj": { + "source": "iana" + }, + "audio/vnd.hns.audio": { + "source": "iana" + }, + "audio/vnd.lucent.voice": { + "source": "iana", + "extensions": ["lvp"] + }, + "audio/vnd.ms-playready.media.pya": { + "source": "iana", + "extensions": ["pya"] + }, + "audio/vnd.nokia.mobile-xmf": { + "source": "iana" + }, + "audio/vnd.nortel.vbk": { + "source": "iana" + }, + "audio/vnd.nuera.ecelp4800": { + "source": "iana", + "extensions": ["ecelp4800"] + }, + "audio/vnd.nuera.ecelp7470": { + "source": "iana", + "extensions": ["ecelp7470"] + }, + "audio/vnd.nuera.ecelp9600": { + "source": "iana", + "extensions": ["ecelp9600"] + }, + "audio/vnd.octel.sbc": { + "source": "iana" + }, + "audio/vnd.qcelp": { + "source": "iana" + }, + "audio/vnd.rhetorex.32kadpcm": { + "source": "iana" + }, + "audio/vnd.rip": { + "source": "iana", + "extensions": ["rip"] + }, + "audio/vnd.rn-realaudio": { + "compressible": false + }, + "audio/vnd.sealedmedia.softseal.mpeg": { + "source": "iana" + }, + "audio/vnd.vmx.cvsd": { + "source": "iana" + }, + "audio/vnd.wave": { + "compressible": false + }, + "audio/vorbis": { + "source": "iana", + "compressible": false + }, + "audio/vorbis-config": { + "source": "iana" + }, + "audio/webm": { + "source": "apache", + "compressible": false, + "extensions": ["weba"] + }, + "audio/x-aac": { + "source": "apache", + "compressible": false, + "extensions": ["aac"] + }, + "audio/x-aiff": { + "source": "apache", + "extensions": ["aif","aiff","aifc"] + }, + "audio/x-caf": { + "source": "apache", + "compressible": false, + "extensions": ["caf"] + }, + "audio/x-flac": { + "source": "apache", + "extensions": ["flac"] + }, + "audio/x-matroska": { + "source": "apache", + "extensions": ["mka"] + }, + "audio/x-mpegurl": { + "source": "apache", + "extensions": ["m3u"] + }, + "audio/x-ms-wax": { + "source": "apache", + "extensions": ["wax"] + }, + "audio/x-ms-wma": { + "source": "apache", + "extensions": ["wma"] + }, + "audio/x-pn-realaudio": { + "source": "apache", + "extensions": ["ram","ra"] + }, + "audio/x-pn-realaudio-plugin": { + "source": "apache", + "extensions": ["rmp"] + }, + "audio/x-tta": { + "source": "apache" + }, + "audio/x-wav": { + "source": "apache", + "extensions": ["wav"] + }, + "audio/xm": { + "source": "apache", + "extensions": ["xm"] + }, + "chemical/x-cdx": { + "source": "apache", + "extensions": ["cdx"] + }, + "chemical/x-cif": { + "source": "apache", + "extensions": ["cif"] + }, + "chemical/x-cmdf": { + "source": "apache", + "extensions": ["cmdf"] + }, + "chemical/x-cml": { + "source": "apache", + "extensions": ["cml"] + }, + "chemical/x-csml": { + "source": "apache", + "extensions": ["csml"] + }, + "chemical/x-pdb": { + "source": "apache" + }, + "chemical/x-xyz": { + "source": "apache", + "extensions": ["xyz"] + }, + "font/opentype": { + "compressible": true, + "extensions": ["otf"] + }, + "image/bmp": { + "source": "apache", + "compressible": true, + "extensions": ["bmp"] + }, + "image/cgm": { + "source": "iana", + "extensions": ["cgm"] + }, + "image/fits": { + "source": "iana" + }, + "image/g3fax": { + "source": "iana", + "extensions": ["g3"] + }, + "image/gif": { + "source": "iana", + "compressible": false, + "extensions": ["gif"] + }, + "image/ief": { + "source": "iana", + "extensions": ["ief"] + }, + "image/jp2": { + "source": "iana" + }, + "image/jpeg": { + "source": "iana", + "compressible": false, + "extensions": ["jpeg","jpg","jpe"] + }, + "image/jpm": { + "source": "iana" + }, + "image/jpx": { + "source": "iana" + }, + "image/ktx": { + "source": "iana", + "extensions": ["ktx"] + }, + "image/naplps": { + "source": "iana" + }, + "image/pjpeg": { + "compressible": false + }, + "image/png": { + "source": "iana", + "compressible": false, + "extensions": ["png"] + }, + "image/prs.btif": { + "source": "iana", + "extensions": ["btif"] + }, + "image/prs.pti": { + "source": "iana" + }, + "image/pwg-raster": { + "source": "iana" + }, + "image/sgi": { + "source": "apache", + "extensions": ["sgi"] + }, + "image/svg+xml": { + "source": "iana", + "compressible": true, + "extensions": ["svg","svgz"] + }, + "image/t38": { + "source": "iana" + }, + "image/tiff": { + "source": "iana", + "compressible": false, + "extensions": ["tiff","tif"] + }, + "image/tiff-fx": { + "source": "iana" + }, + "image/vnd.adobe.photoshop": { + "source": "iana", + "compressible": true, + "extensions": ["psd"] + }, + "image/vnd.airzip.accelerator.azv": { + "source": "iana" + }, + "image/vnd.cns.inf2": { + "source": "iana" + }, + "image/vnd.dece.graphic": { + "source": "iana", + "extensions": ["uvi","uvvi","uvg","uvvg"] + }, + "image/vnd.djvu": { + "source": "iana", + "extensions": ["djvu","djv"] + }, + "image/vnd.dvb.subtitle": { + "source": "iana", + "extensions": ["sub"] + }, + "image/vnd.dwg": { + "source": "iana", + "extensions": ["dwg"] + }, + "image/vnd.dxf": { + "source": "iana", + "extensions": ["dxf"] + }, + "image/vnd.fastbidsheet": { + "source": "iana", + "extensions": ["fbs"] + }, + "image/vnd.fpx": { + "source": "iana", + "extensions": ["fpx"] + }, + "image/vnd.fst": { + "source": "iana", + "extensions": ["fst"] + }, + "image/vnd.fujixerox.edmics-mmr": { + "source": "iana", + "extensions": ["mmr"] + }, + "image/vnd.fujixerox.edmics-rlc": { + "source": "iana", + "extensions": ["rlc"] + }, + "image/vnd.globalgraphics.pgb": { + "source": "iana" + }, + "image/vnd.microsoft.icon": { + "source": "iana" + }, + "image/vnd.mix": { + "source": "iana" + }, + "image/vnd.ms-modi": { + "source": "iana", + "extensions": ["mdi"] + }, + "image/vnd.ms-photo": { + "source": "apache", + "extensions": ["wdp"] + }, + "image/vnd.net-fpx": { + "source": "iana", + "extensions": ["npx"] + }, + "image/vnd.radiance": { + "source": "iana" + }, + "image/vnd.sealed.png": { + "source": "iana" + }, + "image/vnd.sealedmedia.softseal.gif": { + "source": "iana" + }, + "image/vnd.sealedmedia.softseal.jpg": { + "source": "iana" + }, + "image/vnd.svf": { + "source": "iana" + }, + "image/vnd.tencent.tap": { + "source": "iana" + }, + "image/vnd.valve.source.texture": { + "source": "iana" + }, + "image/vnd.wap.wbmp": { + "source": "iana", + "extensions": ["wbmp"] + }, + "image/vnd.xiff": { + "source": "iana", + "extensions": ["xif"] + }, + "image/webp": { + "source": "apache", + "extensions": ["webp"] + }, + "image/x-3ds": { + "source": "apache", + "extensions": ["3ds"] + }, + "image/x-cmu-raster": { + "source": "apache", + "extensions": ["ras"] + }, + "image/x-cmx": { + "source": "apache", + "extensions": ["cmx"] + }, + "image/x-freehand": { + "source": "apache", + "extensions": ["fh","fhc","fh4","fh5","fh7"] + }, + "image/x-icon": { + "source": "apache", + "compressible": true, + "extensions": ["ico"] + }, + "image/x-mrsid-image": { + "source": "apache", + "extensions": ["sid"] + }, + "image/x-pcx": { + "source": "apache", + "extensions": ["pcx"] + }, + "image/x-pict": { + "source": "apache", + "extensions": ["pic","pct"] + }, + "image/x-portable-anymap": { + "source": "apache", + "extensions": ["pnm"] + }, + "image/x-portable-bitmap": { + "source": "apache", + "extensions": ["pbm"] + }, + "image/x-portable-graymap": { + "source": "apache", + "extensions": ["pgm"] + }, + "image/x-portable-pixmap": { + "source": "apache", + "extensions": ["ppm"] + }, + "image/x-rgb": { + "source": "apache", + "extensions": ["rgb"] + }, + "image/x-tga": { + "source": "apache", + "extensions": ["tga"] + }, + "image/x-xbitmap": { + "source": "apache", + "extensions": ["xbm"] + }, + "image/x-xcf": { + "compressible": false + }, + "image/x-xpixmap": { + "source": "apache", + "extensions": ["xpm"] + }, + "image/x-xwindowdump": { + "source": "apache", + "extensions": ["xwd"] + }, + "message/cpim": { + "source": "iana" + }, + "message/delivery-status": { + "source": "iana" + }, + "message/disposition-notification": { + "source": "iana" + }, + "message/external-body": { + "source": "iana" + }, + "message/feedback-report": { + "source": "iana" + }, + "message/global": { + "source": "iana" + }, + "message/global-delivery-status": { + "source": "iana" + }, + "message/global-disposition-notification": { + "source": "iana" + }, + "message/global-headers": { + "source": "iana" + }, + "message/http": { + "source": "iana", + "compressible": false + }, + "message/imdn+xml": { + "source": "iana", + "compressible": true + }, + "message/news": { + "source": "iana" + }, + "message/partial": { + "source": "iana", + "compressible": false + }, + "message/rfc822": { + "source": "iana", + "compressible": true, + "extensions": ["eml","mime"] + }, + "message/s-http": { + "source": "iana" + }, + "message/sip": { + "source": "iana" + }, + "message/sipfrag": { + "source": "iana" + }, + "message/tracking-status": { + "source": "iana" + }, + "message/vnd.si.simp": { + "source": "iana" + }, + "message/vnd.wfa.wsc": { + "source": "iana" + }, + "model/iges": { + "source": "iana", + "compressible": false, + "extensions": ["igs","iges"] + }, + "model/mesh": { + "source": "iana", + "compressible": false, + "extensions": ["msh","mesh","silo"] + }, + "model/vnd.collada+xml": { + "source": "iana", + "extensions": ["dae"] + }, + "model/vnd.dwf": { + "source": "iana", + "extensions": ["dwf"] + }, + "model/vnd.flatland.3dml": { + "source": "iana" + }, + "model/vnd.gdl": { + "source": "iana", + "extensions": ["gdl"] + }, + "model/vnd.gs-gdl": { + "source": "apache" + }, + "model/vnd.gs.gdl": { + "source": "iana" + }, + "model/vnd.gtw": { + "source": "iana", + "extensions": ["gtw"] + }, + "model/vnd.moml+xml": { + "source": "iana" + }, + "model/vnd.mts": { + "source": "iana", + "extensions": ["mts"] + }, + "model/vnd.opengex": { + "source": "iana" + }, + "model/vnd.parasolid.transmit.binary": { + "source": "iana" + }, + "model/vnd.parasolid.transmit.text": { + "source": "iana" + }, + "model/vnd.valve.source.compiled-map": { + "source": "iana" + }, + "model/vnd.vtu": { + "source": "iana", + "extensions": ["vtu"] + }, + "model/vrml": { + "source": "iana", + "compressible": false, + "extensions": ["wrl","vrml"] + }, + "model/x3d+binary": { + "source": "apache", + "compressible": false, + "extensions": ["x3db","x3dbz"] + }, + "model/x3d+fastinfoset": { + "source": "iana" + }, + "model/x3d+vrml": { + "source": "apache", + "compressible": false, + "extensions": ["x3dv","x3dvz"] + }, + "model/x3d+xml": { + "source": "iana", + "compressible": true, + "extensions": ["x3d","x3dz"] + }, + "model/x3d-vrml": { + "source": "iana" + }, + "multipart/alternative": { + "source": "iana", + "compressible": false + }, + "multipart/appledouble": { + "source": "iana" + }, + "multipart/byteranges": { + "source": "iana" + }, + "multipart/digest": { + "source": "iana" + }, + "multipart/encrypted": { + "source": "iana", + "compressible": false + }, + "multipart/form-data": { + "source": "iana", + "compressible": false + }, + "multipart/header-set": { + "source": "iana" + }, + "multipart/mixed": { + "source": "iana", + "compressible": false + }, + "multipart/parallel": { + "source": "iana" + }, + "multipart/related": { + "source": "iana", + "compressible": false + }, + "multipart/report": { + "source": "iana" + }, + "multipart/signed": { + "source": "iana", + "compressible": false + }, + "multipart/voice-message": { + "source": "iana" + }, + "multipart/x-mixed-replace": { + "source": "iana" + }, + "text/1d-interleaved-parityfec": { + "source": "iana" + }, + "text/cache-manifest": { + "source": "iana", + "compressible": true, + "extensions": ["appcache","manifest"] + }, + "text/calendar": { + "source": "iana", + "extensions": ["ics","ifb"] + }, + "text/calender": { + "compressible": true + }, + "text/cmd": { + "compressible": true + }, + "text/coffeescript": { + "extensions": ["coffee"] + }, + "text/css": { + "source": "iana", + "compressible": true, + "extensions": ["css"] + }, + "text/csv": { + "source": "iana", + "compressible": true, + "extensions": ["csv"] + }, + "text/csv-schema": { + "source": "iana" + }, + "text/directory": { + "source": "iana" + }, + "text/dns": { + "source": "iana" + }, + "text/ecmascript": { + "source": "iana" + }, + "text/encaprtp": { + "source": "iana" + }, + "text/enriched": { + "source": "iana" + }, + "text/fwdred": { + "source": "iana" + }, + "text/grammar-ref-list": { + "source": "iana" + }, + "text/hjson": { + "extensions": ["hjson"] + }, + "text/html": { + "source": "iana", + "compressible": true, + "extensions": ["html","htm"] + }, + "text/jade": { + "extensions": ["jade"] + }, + "text/javascript": { + "source": "iana", + "compressible": true + }, + "text/jcr-cnd": { + "source": "iana" + }, + "text/jsx": { + "compressible": true, + "extensions": ["jsx"] + }, + "text/less": { + "extensions": ["less"] + }, + "text/markdown": { + "source": "iana" + }, + "text/mizar": { + "source": "iana" + }, + "text/n3": { + "source": "iana", + "compressible": true, + "extensions": ["n3"] + }, + "text/parameters": { + "source": "iana" + }, + "text/parityfec": { + "source": "iana" + }, + "text/plain": { + "source": "iana", + "compressible": true, + "extensions": ["txt","text","conf","def","list","log","in","ini"] + }, + "text/provenance-notation": { + "source": "iana" + }, + "text/prs.fallenstein.rst": { + "source": "iana" + }, + "text/prs.lines.tag": { + "source": "iana", + "extensions": ["dsc"] + }, + "text/raptorfec": { + "source": "iana" + }, + "text/red": { + "source": "iana" + }, + "text/rfc822-headers": { + "source": "iana" + }, + "text/richtext": { + "source": "iana", + "compressible": true, + "extensions": ["rtx"] + }, + "text/rtf": { + "source": "iana" + }, + "text/rtp-enc-aescm128": { + "source": "iana" + }, + "text/rtploopback": { + "source": "iana" + }, + "text/rtx": { + "source": "iana" + }, + "text/sgml": { + "source": "iana", + "extensions": ["sgml","sgm"] + }, + "text/stylus": { + "extensions": ["stylus","styl"] + }, + "text/t140": { + "source": "iana" + }, + "text/tab-separated-values": { + "source": "iana", + "compressible": true, + "extensions": ["tsv"] + }, + "text/troff": { + "source": "iana", + "extensions": ["t","tr","roff","man","me","ms"] + }, + "text/turtle": { + "source": "iana", + "extensions": ["ttl"] + }, + "text/ulpfec": { + "source": "iana" + }, + "text/uri-list": { + "source": "iana", + "compressible": true, + "extensions": ["uri","uris","urls"] + }, + "text/vcard": { + "source": "iana", + "compressible": true, + "extensions": ["vcard"] + }, + "text/vnd.a": { + "source": "iana" + }, + "text/vnd.abc": { + "source": "iana" + }, + "text/vnd.curl": { + "source": "iana", + "extensions": ["curl"] + }, + "text/vnd.curl.dcurl": { + "source": "apache", + "extensions": ["dcurl"] + }, + "text/vnd.curl.mcurl": { + "source": "apache", + "extensions": ["mcurl"] + }, + "text/vnd.curl.scurl": { + "source": "apache", + "extensions": ["scurl"] + }, + "text/vnd.debian.copyright": { + "source": "iana" + }, + "text/vnd.dmclientscript": { + "source": "iana" + }, + "text/vnd.dvb.subtitle": { + "source": "iana", + "extensions": ["sub"] + }, + "text/vnd.esmertec.theme-descriptor": { + "source": "iana" + }, + "text/vnd.fly": { + "source": "iana", + "extensions": ["fly"] + }, + "text/vnd.fmi.flexstor": { + "source": "iana", + "extensions": ["flx"] + }, + "text/vnd.graphviz": { + "source": "iana", + "extensions": ["gv"] + }, + "text/vnd.in3d.3dml": { + "source": "iana", + "extensions": ["3dml"] + }, + "text/vnd.in3d.spot": { + "source": "iana", + "extensions": ["spot"] + }, + "text/vnd.iptc.newsml": { + "source": "iana" + }, + "text/vnd.iptc.nitf": { + "source": "iana" + }, + "text/vnd.latex-z": { + "source": "iana" + }, + "text/vnd.motorola.reflex": { + "source": "iana" + }, + "text/vnd.ms-mediapackage": { + "source": "iana" + }, + "text/vnd.net2phone.commcenter.command": { + "source": "iana" + }, + "text/vnd.radisys.msml-basic-layout": { + "source": "iana" + }, + "text/vnd.si.uricatalogue": { + "source": "iana" + }, + "text/vnd.sun.j2me.app-descriptor": { + "source": "iana", + "extensions": ["jad"] + }, + "text/vnd.trolltech.linguist": { + "source": "iana" + }, + "text/vnd.wap.si": { + "source": "iana" + }, + "text/vnd.wap.sl": { + "source": "iana" + }, + "text/vnd.wap.wml": { + "source": "iana", + "extensions": ["wml"] + }, + "text/vnd.wap.wmlscript": { + "source": "iana", + "extensions": ["wmls"] + }, + "text/vtt": { + "charset": "UTF-8", + "compressible": true, + "extensions": ["vtt"] + }, + "text/x-asm": { + "source": "apache", + "extensions": ["s","asm"] + }, + "text/x-c": { + "source": "apache", + "extensions": ["c","cc","cxx","cpp","h","hh","dic"] + }, + "text/x-component": { + "extensions": ["htc"] + }, + "text/x-fortran": { + "source": "apache", + "extensions": ["f","for","f77","f90"] + }, + "text/x-gwt-rpc": { + "compressible": true + }, + "text/x-handlebars-template": { + "extensions": ["hbs"] + }, + "text/x-java-source": { + "source": "apache", + "extensions": ["java"] + }, + "text/x-jquery-tmpl": { + "compressible": true + }, + "text/x-lua": { + "extensions": ["lua"] + }, + "text/x-markdown": { + "compressible": true, + "extensions": ["markdown","md","mkd"] + }, + "text/x-nfo": { + "source": "apache", + "extensions": ["nfo"] + }, + "text/x-opml": { + "source": "apache", + "extensions": ["opml"] + }, + "text/x-pascal": { + "source": "apache", + "extensions": ["p","pas"] + }, + "text/x-sass": { + "extensions": ["sass"] + }, + "text/x-scss": { + "extensions": ["scss"] + }, + "text/x-setext": { + "source": "apache", + "extensions": ["etx"] + }, + "text/x-sfv": { + "source": "apache", + "extensions": ["sfv"] + }, + "text/x-uuencode": { + "source": "apache", + "extensions": ["uu"] + }, + "text/x-vcalendar": { + "source": "apache", + "extensions": ["vcs"] + }, + "text/x-vcard": { + "source": "apache", + "extensions": ["vcf"] + }, + "text/xml": { + "source": "iana", + "compressible": true + }, + "text/xml-external-parsed-entity": { + "source": "iana" + }, + "text/yaml": { + "extensions": ["yaml","yml"] + }, + "video/1d-interleaved-parityfec": { + "source": "apache" + }, + "video/3gpp": { + "source": "apache", + "extensions": ["3gp"] + }, + "video/3gpp-tt": { + "source": "apache" + }, + "video/3gpp2": { + "source": "apache", + "extensions": ["3g2"] + }, + "video/bmpeg": { + "source": "apache" + }, + "video/bt656": { + "source": "apache" + }, + "video/celb": { + "source": "apache" + }, + "video/dv": { + "source": "apache" + }, + "video/h261": { + "source": "apache", + "extensions": ["h261"] + }, + "video/h263": { + "source": "apache", + "extensions": ["h263"] + }, + "video/h263-1998": { + "source": "apache" + }, + "video/h263-2000": { + "source": "apache" + }, + "video/h264": { + "source": "apache", + "extensions": ["h264"] + }, + "video/h264-rcdo": { + "source": "apache" + }, + "video/h264-svc": { + "source": "apache" + }, + "video/jpeg": { + "source": "apache", + "extensions": ["jpgv"] + }, + "video/jpeg2000": { + "source": "apache" + }, + "video/jpm": { + "source": "apache", + "extensions": ["jpm","jpgm"] + }, + "video/mj2": { + "source": "apache", + "extensions": ["mj2","mjp2"] + }, + "video/mp1s": { + "source": "apache" + }, + "video/mp2p": { + "source": "apache" + }, + "video/mp2t": { + "source": "apache", + "extensions": ["ts"] + }, + "video/mp4": { + "source": "apache", + "compressible": false, + "extensions": ["mp4","mp4v","mpg4"] + }, + "video/mp4v-es": { + "source": "apache" + }, + "video/mpeg": { + "source": "apache", + "compressible": false, + "extensions": ["mpeg","mpg","mpe","m1v","m2v"] + }, + "video/mpeg4-generic": { + "source": "apache" + }, + "video/mpv": { + "source": "apache" + }, + "video/nv": { + "source": "apache" + }, + "video/ogg": { + "source": "apache", + "compressible": false, + "extensions": ["ogv"] + }, + "video/parityfec": { + "source": "apache" + }, + "video/pointer": { + "source": "apache" + }, + "video/quicktime": { + "source": "apache", + "compressible": false, + "extensions": ["qt","mov"] + }, + "video/raw": { + "source": "apache" + }, + "video/rtp-enc-aescm128": { + "source": "apache" + }, + "video/rtx": { + "source": "apache" + }, + "video/smpte292m": { + "source": "apache" + }, + "video/ulpfec": { + "source": "apache" + }, + "video/vc1": { + "source": "apache" + }, + "video/vnd.cctv": { + "source": "apache" + }, + "video/vnd.dece.hd": { + "source": "apache", + "extensions": ["uvh","uvvh"] + }, + "video/vnd.dece.mobile": { + "source": "apache", + "extensions": ["uvm","uvvm"] + }, + "video/vnd.dece.mp4": { + "source": "apache" + }, + "video/vnd.dece.pd": { + "source": "apache", + "extensions": ["uvp","uvvp"] + }, + "video/vnd.dece.sd": { + "source": "apache", + "extensions": ["uvs","uvvs"] + }, + "video/vnd.dece.video": { + "source": "apache", + "extensions": ["uvv","uvvv"] + }, + "video/vnd.directv.mpeg": { + "source": "apache" + }, + "video/vnd.directv.mpeg-tts": { + "source": "apache" + }, + "video/vnd.dlna.mpeg-tts": { + "source": "apache" + }, + "video/vnd.dvb.file": { + "source": "apache", + "extensions": ["dvb"] + }, + "video/vnd.fvt": { + "source": "apache", + "extensions": ["fvt"] + }, + "video/vnd.hns.video": { + "source": "apache" + }, + "video/vnd.iptvforum.1dparityfec-1010": { + "source": "apache" + }, + "video/vnd.iptvforum.1dparityfec-2005": { + "source": "apache" + }, + "video/vnd.iptvforum.2dparityfec-1010": { + "source": "apache" + }, + "video/vnd.iptvforum.2dparityfec-2005": { + "source": "apache" + }, + "video/vnd.iptvforum.ttsavc": { + "source": "apache" + }, + "video/vnd.iptvforum.ttsmpeg2": { + "source": "apache" + }, + "video/vnd.motorola.video": { + "source": "apache" + }, + "video/vnd.motorola.videop": { + "source": "apache" + }, + "video/vnd.mpegurl": { + "source": "apache", + "extensions": ["mxu","m4u"] + }, + "video/vnd.ms-playready.media.pyv": { + "source": "apache", + "extensions": ["pyv"] + }, + "video/vnd.nokia.interleaved-multimedia": { + "source": "apache" + }, + "video/vnd.nokia.videovoip": { + "source": "apache" + }, + "video/vnd.objectvideo": { + "source": "apache" + }, + "video/vnd.sealed.mpeg1": { + "source": "apache" + }, + "video/vnd.sealed.mpeg4": { + "source": "apache" + }, + "video/vnd.sealed.swf": { + "source": "apache" + }, + "video/vnd.sealedmedia.softseal.mov": { + "source": "apache" + }, + "video/vnd.uvvu.mp4": { + "source": "apache", + "extensions": ["uvu","uvvu"] + }, + "video/vnd.vivo": { + "source": "apache", + "extensions": ["viv"] + }, + "video/webm": { + "source": "apache", + "compressible": false, + "extensions": ["webm"] + }, + "video/x-f4v": { + "source": "apache", + "extensions": ["f4v"] + }, + "video/x-fli": { + "source": "apache", + "extensions": ["fli"] + }, + "video/x-flv": { + "source": "apache", + "compressible": false, + "extensions": ["flv"] + }, + "video/x-m4v": { + "source": "apache", + "extensions": ["m4v"] + }, + "video/x-matroska": { + "source": "apache", + "compressible": false, + "extensions": ["mkv","mk3d","mks"] + }, + "video/x-mng": { + "source": "apache", + "extensions": ["mng"] + }, + "video/x-ms-asf": { + "source": "apache", + "extensions": ["asf","asx"] + }, + "video/x-ms-vob": { + "source": "apache", + "extensions": ["vob"] + }, + "video/x-ms-wm": { + "source": "apache", + "extensions": ["wm"] + }, + "video/x-ms-wmv": { + "source": "apache", + "compressible": false, + "extensions": ["wmv"] + }, + "video/x-ms-wmx": { + "source": "apache", + "extensions": ["wmx"] + }, + "video/x-ms-wvx": { + "source": "apache", + "extensions": ["wvx"] + }, + "video/x-msvideo": { + "source": "apache", + "extensions": ["avi"] + }, + "video/x-sgi-movie": { + "source": "apache", + "extensions": ["movie"] + }, + "video/x-smv": { + "source": "apache", + "extensions": ["smv"] + }, + "x-conference/x-cooltalk": { + "source": "apache", + "extensions": ["ice"] + }, + "x-shader/x-fragment": { + "compressible": true + }, + "x-shader/x-vertex": { + "compressible": true + } +} diff --git a/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/form-data/node_modules/mime-types/node_modules/mime-db/index.js b/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/form-data/node_modules/mime-types/node_modules/mime-db/index.js new file mode 100644 index 0000000..551031f --- /dev/null +++ b/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/form-data/node_modules/mime-types/node_modules/mime-db/index.js @@ -0,0 +1,11 @@ +/*! + * mime-db + * Copyright(c) 2014 Jonathan Ong + * MIT Licensed + */ + +/** + * Module exports. + */ + +module.exports = require('./db.json') diff --git a/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/form-data/node_modules/mime-types/node_modules/mime-db/package.json b/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/form-data/node_modules/mime-types/node_modules/mime-db/package.json new file mode 100644 index 0000000..135ef18 --- /dev/null +++ b/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/form-data/node_modules/mime-types/node_modules/mime-db/package.json @@ -0,0 +1,93 @@ +{ + "name": "mime-db", + "description": "Media Type Database", + "version": "1.7.0", + "author": { + "name": "Jonathan Ong", + "email": "me@jongleberry.com", + "url": "http://jongleberry.com" + }, + "contributors": [ + { + "name": "Douglas Christopher Wilson", + "email": "doug@somethingdoug.com" + }, + { + "name": "Robert Kieffer", + "email": "robert@broofa.com", + "url": "http://github.com/broofa" + } + ], + "license": "MIT", + "keywords": [ + "mime", + "db", + "type", + "types", + "database", + "charset", + "charsets" + ], + "repository": { + "type": "git", + "url": "https://github.com/jshttp/mime-db" + }, + "devDependencies": { + "co": "4", + "cogent": "1", + "csv-parse": "0", + "gnode": "0.1.0", + "istanbul": "0.3.5", + "mocha": "~1.21.4", + "raw-body": "~1.3.2", + "stream-to-array": "2" + }, + "files": [ + "HISTORY.md", + "LICENSE", + "README.md", + "db.json", + "index.js" + ], + "engines": { + "node": ">= 0.6" + }, + "scripts": { + "build": "node scripts/build", + "fetch": "gnode scripts/extensions && gnode scripts/types", + "test": "mocha --reporter spec --bail --check-leaks test/", + "test-cov": "istanbul cover node_modules/mocha/bin/_mocha -- --reporter dot --check-leaks test/", + "test-travis": "istanbul cover node_modules/mocha/bin/_mocha --report lcovonly -- --reporter spec --check-leaks test/", + "update": "npm run fetch && npm run build" + }, + "gitHead": "972cc3ed48530ab7aca7a155bf2dbd1b13aa8f86", + "bugs": { + "url": "https://github.com/jshttp/mime-db/issues" + }, + "homepage": "https://github.com/jshttp/mime-db", + "_id": "mime-db@1.7.0", + "_shasum": "36cf66a6c52ea71827bde287f77c254f5ef1b8d3", + "_from": "mime-db@~1.7.0", + "_npmVersion": "1.4.28", + "_npmUser": { + "name": "dougwilson", + "email": "doug@somethingdoug.com" + }, + "maintainers": [ + { + "name": "jongleberry", + "email": "jonathanrichardong@gmail.com" + }, + { + "name": "dougwilson", + "email": "doug@somethingdoug.com" + } + ], + "dist": { + "shasum": "36cf66a6c52ea71827bde287f77c254f5ef1b8d3", + "tarball": "http://registry.npmjs.org/mime-db/-/mime-db-1.7.0.tgz" + }, + "directories": {}, + "_resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.7.0.tgz", + "readme": "ERROR: No README data found!" +} diff --git a/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/form-data/node_modules/mime-types/package.json b/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/form-data/node_modules/mime-types/package.json new file mode 100644 index 0000000..9bf426b --- /dev/null +++ b/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/form-data/node_modules/mime-types/package.json @@ -0,0 +1,84 @@ +{ + "name": "mime-types", + "description": "The ultimate javascript content-type utility.", + "version": "2.0.9", + "contributors": [ + { + "name": "Douglas Christopher Wilson", + "email": "doug@somethingdoug.com" + }, + { + "name": "Jeremiah Senkpiel", + "email": "fishrock123@rocketmail.com", + "url": "https://searchbeam.jit.su" + }, + { + "name": "Jonathan Ong", + "email": "me@jongleberry.com", + "url": "http://jongleberry.com" + } + ], + "license": "MIT", + "keywords": [ + "mime", + "types" + ], + "repository": { + "type": "git", + "url": "https://github.com/jshttp/mime-types" + }, + "dependencies": { + "mime-db": "~1.7.0" + }, + "devDependencies": { + "istanbul": "0.3.5", + "mocha": "~1.21.5" + }, + "files": [ + "HISTORY.md", + "LICENSE", + "index.js" + ], + "engines": { + "node": ">= 0.6" + }, + "scripts": { + "test": "mocha --reporter spec test/test.js", + "test-cov": "istanbul cover node_modules/mocha/bin/_mocha -- --reporter dot test/test.js", + "test-travis": "istanbul cover node_modules/mocha/bin/_mocha --report lcovonly -- --reporter dot test/test.js" + }, + "gitHead": "1c6d55da440b6a9d2c0e9c2faac98e6b1be47fc7", + "bugs": { + "url": "https://github.com/jshttp/mime-types/issues" + }, + "homepage": "https://github.com/jshttp/mime-types", + "_id": "mime-types@2.0.9", + "_shasum": "e8449aff27b1245ddc6641b524439ae80c4b78a6", + "_from": "mime-types@~2.0.3", + "_npmVersion": "1.4.28", + "_npmUser": { + "name": "dougwilson", + "email": "doug@somethingdoug.com" + }, + "maintainers": [ + { + "name": "jongleberry", + "email": "jonathanrichardong@gmail.com" + }, + { + "name": "fishrock123", + "email": "fishrock123@rocketmail.com" + }, + { + "name": "dougwilson", + "email": "doug@somethingdoug.com" + } + ], + "dist": { + "shasum": "e8449aff27b1245ddc6641b524439ae80c4b78a6", + "tarball": "http://registry.npmjs.org/mime-types/-/mime-types-2.0.9.tgz" + }, + "directories": {}, + "_resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.0.9.tgz", + "readme": "ERROR: No README data found!" +} diff --git a/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/form-data/package.json b/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/form-data/package.json index afda8b6..e212e23 100644 --- a/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/form-data/package.json +++ b/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/form-data/package.json @@ -6,7 +6,7 @@ }, "name": "form-data", "description": "A module to create readable \"multipart/form-data\" streams. Can be used to submit forms and file uploads to other web applications.", - "version": "0.1.4", + "version": "0.2.0", "repository": { "type": "git", "url": "git://github.com/felixge/node-form-data.git" @@ -19,9 +19,9 @@ "node": ">= 0.8" }, "dependencies": { + "async": "~0.9.0", "combined-stream": "~0.0.4", - "mime": "~1.2.11", - "async": "~0.9.0" + "mime-types": "~2.0.3" }, "licenses": [ { @@ -35,15 +35,15 @@ "formidable": "~1.0.14", "request": "~2.36.0" }, - "gitHead": "5f5f4809ea685f32658809fa0f13d7eface0e45a", + "gitHead": "dfc1a2aef40b97807e2ffe477da06cb2c37e259f", "bugs": { "url": "https://github.com/felixge/node-form-data/issues" }, "homepage": "https://github.com/felixge/node-form-data", - "_id": "form-data@0.1.4", - "_shasum": "91abd788aba9702b1aabfa8bc01031a2ac9e3b12", - "_from": "form-data@~0.1.0", - "_npmVersion": "1.4.14", + "_id": "form-data@0.2.0", + "_shasum": "26f8bc26da6440e299cbdcfb69035c4f77a6e466", + "_from": "form-data@~0.2.0", + "_npmVersion": "1.4.28", "_npmUser": { "name": "alexindigo", "email": "iam@alexindigo.com" @@ -71,10 +71,9 @@ } ], "dist": { - "shasum": "91abd788aba9702b1aabfa8bc01031a2ac9e3b12", - "tarball": "http://registry.npmjs.org/form-data/-/form-data-0.1.4.tgz" + "shasum": "26f8bc26da6440e299cbdcfb69035c4f77a6e466", + "tarball": "http://registry.npmjs.org/form-data/-/form-data-0.2.0.tgz" }, "directories": {}, - "_resolved": "https://registry.npmjs.org/form-data/-/form-data-0.1.4.tgz", - "readme": "ERROR: No README data found!" + "_resolved": "https://registry.npmjs.org/form-data/-/form-data-0.2.0.tgz" } diff --git a/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/hawk/.npmignore b/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/hawk/.npmignore index 77ba16c..b3bb517 100644 --- a/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/hawk/.npmignore +++ b/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/hawk/.npmignore @@ -1,18 +1,18 @@ -.idea -*.iml -npm-debug.log -dump.rdb -node_modules -results.tap -results.xml -npm-shrinkwrap.json -config.json -.DS_Store -*/.DS_Store -*/*/.DS_Store -._* -*/._* -*/*/._* -coverage.* -lib-cov - +.idea +*.iml +npm-debug.log +dump.rdb +node_modules +results.tap +results.xml +npm-shrinkwrap.json +config.json +.DS_Store +*/.DS_Store +*/*/.DS_Store +._* +*/._* +*/*/._* +coverage.* +lib-cov + diff --git a/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/hawk/.travis.yml b/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/hawk/.travis.yml index 047f7e3..40ca59e 100755 --- a/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/hawk/.travis.yml +++ b/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/hawk/.travis.yml @@ -1,5 +1,5 @@ -language: node_js - -node_js: - - 0.10 - +language: node_js + +node_js: + - 0.10 + diff --git a/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/hawk/README.md b/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/hawk/README.md index 010bac6..36312f4 100755 --- a/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/hawk/README.md +++ b/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/hawk/README.md @@ -548,11 +548,9 @@ and suggestions. ### Where can I find **Hawk** implementations in other languages? -**Hawk**'s only reference implementation is provided in JavaScript as a node.js module. However, others are actively porting it to other -platforms. There is already a [PHP](https://github.com/alexbilbie/PHP-Hawk), -[.NET](https://github.com/pcibraro/hawknet), and [JAVA](https://github.com/wealdtech/hawk) libraries available. The full list -is maintained [here](https://github.com/hueniverse/hawk/issues?labels=port). Please add an issue if you are working on another -port. A cross-platform test-suite is in the works. +**Hawk**'s only reference implementation is provided in JavaScript as a node.js module. However, it has been ported to other languages. +The full list is maintained [here](https://github.com/hueniverse/hawk/issues?labels=port&state=closed). Please add an issue if you are +working on another port. A cross-platform test-suite is in the works. ### Why isn't the algorithm part of the challenge or dynamically negotiated? diff --git a/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/hawk/lib/browser.js b/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/hawk/lib/browser.js index 27494f2..1ff0cd3 100755 --- a/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/hawk/lib/browser.js +++ b/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/hawk/lib/browser.js @@ -24,17 +24,17 @@ hawk.client = { uri: 'http://example.com/resource?a=b' method: HTTP verb (e.g. 'GET', 'POST') options: { - + // Required - + credentials: { id: 'dh37fgj492je', key: 'aoijedoaijsdlaksjdl', algorithm: 'sha256' // 'sha1', 'sha256' }, - + // Optional - + ext: 'application-specific', // Application specific data sent via the ext attribute timestamp: Date.now() / 1000, // A pre-calculated timestamp in seconds nonce: '2334f34f', // A pre-generated nonce @@ -60,6 +60,7 @@ hawk.client = { !method || typeof method !== 'string' || !options || typeof options !== 'object') { + result.err = 'Invalid argument type'; return result; } @@ -75,11 +76,12 @@ hawk.client = { !credentials.key || !credentials.algorithm) { - // Invalid credential object + result.err = 'Invalid credential object'; return result; } if (hawk.crypto.algorithms.indexOf(credentials.algorithm) === -1) { + result.err = 'Unknown algorithm'; return result; } @@ -267,6 +269,20 @@ hawk.client = { }; return result; + }, + + authenticateTimestamp: function (message, credentials, updateClock) { // updateClock defaults to true + + var tsm = hawk.crypto.calculateTsMac(message.ts, credentials); + if (tsm !== message.tsm) { + return false; + } + + if (updateClock !== false) { + hawk.utils.setNtpOffset(message.ts - Math.floor(Date.now() / 1000)); // Keep offset at 1 second precision + } + + return true; } }; @@ -351,7 +367,13 @@ hawk.utils = { setNtpOffset: function (offset) { - hawk.utils.storage.setItem('hawk_ntp_offset', offset); + try { + hawk.utils.storage.setItem('hawk_ntp_offset', offset); + } + catch (err) { + console.error('[hawk] could not write to storage.'); + console.error(err); + } }, getNtpOffset: function () { diff --git a/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/hawk/lib/client.js b/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/hawk/lib/client.js index 4198458..1002a9d 100755 --- a/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/hawk/lib/client.js +++ b/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/hawk/lib/client.js @@ -54,6 +54,7 @@ exports.header = function (uri, method, options) { !method || typeof method !== 'string' || !options || typeof options !== 'object') { + result.err = 'Invalid argument type'; return result; } @@ -69,11 +70,12 @@ exports.header = function (uri, method, options) { !credentials.key || !credentials.algorithm) { - // Invalid credential object + result.err = 'Invalid credential object'; return result; } if (Crypto.algorithms.indexOf(credentials.algorithm) === -1) { + result.err = 'Unknown algorithm'; return result; } @@ -156,6 +158,8 @@ exports.authenticate = function (res, credentials, artifacts, options) { return false; } + // Validate server timestamp (not used to update clock since it is done via the SNPT client) + if (attributes.ts) { var tsm = Crypto.calculateTsMac(attributes.ts, credentials); if (tsm !== attributes.tsm) { diff --git a/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/hawk/lib/crypto.js b/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/hawk/lib/crypto.js index 150340a..9825c7d 100755 --- a/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/hawk/lib/crypto.js +++ b/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/hawk/lib/crypto.js @@ -109,3 +109,10 @@ exports.calculateTsMac = function (ts, credentials) { return hmac.digest('base64'); }; + +exports.timestampMessage = function (credentials, localtimeOffsetMsec) { + + var now = Math.floor((Utils.now() + (localtimeOffsetMsec || 0)) / 1000); + var tsm = exports.calculateTsMac(now, credentials); + return { ts: now, tsm: tsm }; +}; diff --git a/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/hawk/lib/index.js b/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/hawk/lib/index.js index 1d713cb..a883882 100755 --- a/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/hawk/lib/index.js +++ b/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/hawk/lib/index.js @@ -2,6 +2,7 @@ exports.error = exports.Error = require('boom'); exports.sntp = require('sntp'); + exports.server = require('./server'); exports.client = require('./client'); exports.crypto = require('./crypto'); @@ -12,4 +13,3 @@ exports.uri = { getBewit: exports.client.getBewit }; - diff --git a/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/hawk/lib/server.js b/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/hawk/lib/server.js index 478c47b..59464ed 100755 --- a/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/hawk/lib/server.js +++ b/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/hawk/lib/server.js @@ -191,9 +191,8 @@ exports.authenticate = function (req, credentialsFunc, options, callback) { // Check timestamp staleness if (Math.abs((attributes.ts * 1000) - now) > (options.timestampSkewSec * 1000)) { - var fresh = Math.floor((Utils.now() + (options.localtimeOffsetMsec || 0)) / 1000); // Get fresh now - var tsm = Crypto.calculateTsMac(fresh, credentials); - return callback(Boom.unauthorized('Stale timestamp', 'Hawk', { ts: fresh, tsm: tsm }), credentials, artifacts); + var tsm = Crypto.timestampMessage(credentials, options.localtimeOffsetMsec); + return callback(Boom.unauthorized('Stale timestamp', 'Hawk', tsm), credentials, artifacts); } // Successful authentication diff --git a/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/hawk/package.json b/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/hawk/package.json index 1355ece..fadd7a9 100755 --- a/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/hawk/package.json +++ b/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/hawk/package.json @@ -1,7 +1,7 @@ { "name": "hawk", "description": "HTTP Hawk Authentication Scheme", - "version": "1.0.0", + "version": "1.1.1", "author": { "name": "Eran Hammer", "email": "eran@hueniverse.com", @@ -45,13 +45,13 @@ "bugs": { "url": "https://github.com/hueniverse/hawk/issues" }, - "_id": "hawk@1.0.0", + "_id": "hawk@1.1.1", "dist": { - "shasum": "b90bb169807285411da7ffcb8dd2598502d3b52d", - "tarball": "http://registry.npmjs.org/hawk/-/hawk-1.0.0.tgz" + "shasum": "87cd491f9b46e4e2aeaca335416766885d2d1ed9", + "tarball": "http://registry.npmjs.org/hawk/-/hawk-1.1.1.tgz" }, - "_from": "hawk@~1.0.0", - "_npmVersion": "1.2.32", + "_from": "hawk@1.1.1", + "_npmVersion": "1.3.8", "_npmUser": { "name": "hueniverse", "email": "eran@hueniverse.com" @@ -63,8 +63,8 @@ } ], "directories": {}, - "_shasum": "b90bb169807285411da7ffcb8dd2598502d3b52d", - "_resolved": "https://registry.npmjs.org/hawk/-/hawk-1.0.0.tgz", + "_shasum": "87cd491f9b46e4e2aeaca335416766885d2d1ed9", + "_resolved": "https://registry.npmjs.org/hawk/-/hawk-1.1.1.tgz", "readme": "ERROR: No README data found!", "homepage": "https://github.com/hueniverse/hawk" } diff --git a/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/hawk/test/browser.js b/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/hawk/test/browser.js index b25a10f..5bcb910 100755 --- a/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/hawk/test/browser.js +++ b/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/hawk/test/browser.js @@ -728,6 +728,30 @@ describe('Browser', function () { }); }); }); + + describe('#authenticateTimestamp', function (done) { + + it('should validate a timestamp', function (done) { + + credentialsFunc('123456', function (err, credentials) { + + var tsm = Hawk.crypto.timestampMessage(credentials); + expect(Browser.client.authenticateTimestamp(tsm, credentials)).to.equal(true); + done(); + }); + }); + + it('should detect a bad timestamp', function (done) { + + credentialsFunc('123456', function (err, credentials) { + + var tsm = Hawk.crypto.timestampMessage(credentials); + tsm.ts = 4; + expect(Browser.client.authenticateTimestamp(tsm, credentials)).to.equal(false); + done(); + }); + }); + }); }); describe('#parseAuthorizationHeader', function (done) { @@ -768,4 +792,26 @@ describe('Browser', function () { done(); }); }); + + describe('#setNtpOffset', function (done) { + + it('catches localStorage errors', function (done) { + + var orig = Browser.utils.storage.setItem; + var error = console.error; + var count = 0; + console.error = function () { if (count++ === 2) { console.error.error; } }; + Browser.utils.storage.setItem = function () { + + Browser.utils.storage.setItem = orig; + throw new Error() + }; + + expect(function () { + Browser.utils.setNtpOffset(100); + }).not.to.throw(); + + done(); + }); + }); }); diff --git a/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/http-signature/README.md b/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/http-signature/README.md index 0c70714..de487d3 100644 --- a/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/http-signature/README.md +++ b/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/http-signature/README.md @@ -6,61 +6,65 @@ for Joyent's [HTTP Signature Scheme](http_signing.md). ## Usage Note the example below signs a request with the same key/cert used to start an -HTTP server. This is almost certainly not what you actaully want, but is just +HTTP server. This is almost certainly not what you actually want, but is just used to illustrate the API calls; you will need to provide your own key management in addition to this library. ### Client - var fs = require('fs'); - var https = require('https'); - var httpSignature = require('http-signature'); +```js +var fs = require('fs'); +var https = require('https'); +var httpSignature = require('http-signature'); - var key = fs.readFileSync('./key.pem', 'ascii'); +var key = fs.readFileSync('./key.pem', 'ascii'); - var options = { - host: 'localhost', - port: 8443, - path: '/', - method: 'GET', - headers: {} - }; +var options = { + host: 'localhost', + port: 8443, + path: '/', + method: 'GET', + headers: {} +}; - // Adds a 'Date' header in, signs it, and adds the - // 'Authorization' header in. - var req = https.request(options, function(res) { - console.log(res.statusCode); - }); +// Adds a 'Date' header in, signs it, and adds the +// 'Authorization' header in. +var req = https.request(options, function(res) { + console.log(res.statusCode); +}); - httpSignature.sign(req, { - key: key, - keyId: './cert.pem' - }); +httpSignature.sign(req, { + key: key, + keyId: './cert.pem' +}); - req.end(); +req.end(); +``` ### Server - var fs = require('fs'); - var https = require('https'); - var httpSignature = require('http-signature'); - - var options = { - key: fs.readFileSync('./key.pem'), - cert: fs.readFileSync('./cert.pem') - }; - - https.createServer(options, function (req, res) { - var rc = 200; - var parsed = httpSignature.parseRequest(req); - var pub = fs.readFileSync(parsed.keyId, 'ascii'); - if (!httpSignature.verifySignature(parsed, pub)) - rc = 401; - - res.writeHead(rc); - res.end(); - }).listen(8443); +```js +var fs = require('fs'); +var https = require('https'); +var httpSignature = require('http-signature'); + +var options = { + key: fs.readFileSync('./key.pem'), + cert: fs.readFileSync('./cert.pem') +}; + +https.createServer(options, function (req, res) { + var rc = 200; + var parsed = httpSignature.parseRequest(req); + var pub = fs.readFileSync(parsed.keyId, 'ascii'); + if (!httpSignature.verifySignature(parsed, pub)) + rc = 401; + + res.writeHead(rc); + res.end(); +}).listen(8443); +``` ## Installation diff --git a/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/http-signature/http_signing.md b/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/http-signature/http_signing.md index ba7321d..dd81ee5 100644 --- a/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/http-signature/http_signing.md +++ b/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/http-signature/http_signing.md @@ -17,7 +17,7 @@ This protocol is intended to provide a standard way for clients to sign HTTP requests. RFC2617 (HTTP Authentication) defines Basic and Digest authentication mechanisms, and RFC5246 (TLS 1.2) defines client-auth, both of which are widely employed on the Internet today. However, it is common place that the burdens of -PKI prevent web service operators from deploying that methodoloy, and so many +PKI prevent web service operators from deploying that methodology, and so many fall back to Basic authentication, which has poor security characteristics. Additionally, OAuth provides a fully-specified alternative for authorization @@ -109,14 +109,14 @@ the values of each HTTP header specified by `headers` in the order they appear. 1. If the header name is not `request-line` then append the lowercased header name followed with an ASCII colon `:` and an ASCII space ` `. -2. If the header name is `request-line` then appened the HTTP request line, +2. If the header name is `request-line` then append the HTTP request line, otherwise append the header value. 3. If value is not the last value then append an ASCII newline `\n`. The string MUST NOT include a trailing ASCII newline. # Example Requests -All requests refer to the following request (body ommitted): +All requests refer to the following request (body omitted): POST /foo HTTP/1.1 Host: example.org @@ -182,7 +182,7 @@ Currently supported algorithm names are: Note the default parameterization of the `Signature` scheme is only safe if all requests are carried over a secure transport (i.e., TLS). Sending the default scheme over a non-secure transport will leave the request vulnerable to -spoofing, tampering, replay/repudiaton, and integrity violations (if using the +spoofing, tampering, replay/repudiation, and integrity violations (if using the STRIDE threat-modeling methodology). ## Insecure Transports @@ -195,7 +195,7 @@ against any tampering from clients. ## Nonces Nonces are out of scope for this document simply because many service providers -fail to implement them correctly, or do not adopt security specfiications +fail to implement them correctly, or do not adopt security specifications because of the infrastructure complexity. Given the `header` parameterization, a service provider is fully enabled to add nonce semantics into this scheme by using something like an `x-request-nonce` header, and ensuring it is signed @@ -234,12 +234,12 @@ will want to enforce, but service providers SHOULD at minimum include the The following test data uses the RSA (2048b) keys, which we will refer to as `keyId=Test` in the following samples: - -----BEGIN PUBLIC KEY----- - MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDCFENGw33yGihy92pDjZQhl0C3 - 6rPJj+CvfSC8+q28hxA161QFNUd13wuCTUcq0Qd2qsBe/2hFyc2DCJJg0h1L78+6 - Z4UMR7EOcpfdUE9Hf3m/hs+FUR45uBJeDK1HSFHD8bHKD6kv8FPGfJTotc+2xjJw - oYi+1hqp1fIekaxsyQIDAQAB - -----END PUBLIC KEY----- + -----BEGIN PUBLIC KEY----- + MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDCFENGw33yGihy92pDjZQhl0C3 + 6rPJj+CvfSC8+q28hxA161QFNUd13wuCTUcq0Qd2qsBe/2hFyc2DCJJg0h1L78+6 + Z4UMR7EOcpfdUE9Hf3m/hs+FUR45uBJeDK1HSFHD8bHKD6kv8FPGfJTotc+2xjJw + oYi+1hqp1fIekaxsyQIDAQAB + -----END PUBLIC KEY----- -----BEGIN RSA PRIVATE KEY----- MIICXgIBAAKBgQDCFENGw33yGihy92pDjZQhl0C36rPJj+CvfSC8+q28hxA161QF @@ -276,7 +276,7 @@ The string to sign would be: The Authorization header would be: - Authorization: Signature keyId="Test",algorithm="rsa-sha256",signature="JldXnt8W9t643M2Sce10gqCh/+E7QIYLiI+bSjnFBGCti7s+mPPvOjVb72sbd1FjeOUwPTDpKbrQQORrm+xBYfAwCxF3LBSSzORvyJ5nRFCFxfJ3nlQD6Kdxhw8wrVZX5nSem4A/W3C8qH5uhFTRwF4ruRjh+ENHWuovPgO/HGQ=" + Authorization: Signature keyId="Test",algorithm="rsa-sha256",signature="ATp0r26dbMIxOopqw0OfABDT7CKMIoENumuruOtarj8n/97Q3htHFYpH8yOSQk3Z5zh8UxUym6FYTb5+A0Nz3NRsXJibnYi7brE/4tx5But9kkFGzG+xpUmimN4c3TMN7OFH//+r8hBf7BT9/GmHDUVZT2JzWGLZES2xDOUuMtA=" ### All Headers @@ -292,5 +292,5 @@ inserted for readability): The Authorization header would be: - Authorization: Signature keyId="Test",algorithm="rsa-sha256",headers="request-line host date content-type content-md5 content-length",signature="Gm7W/r+e90REDpWytALMrft4MqZxCmslOTOvwJX17ViEBA5E65QqvWI0vIH3l/vSsGiaMVmuUgzYsJLYMLcm5dGrv1+a+0fCoUdVKPZWHyImQEqpLkopVwqEH67LVECFBqFTAKlQgBn676zrfXQbb+b/VebAsNUtvQMe6cTjnDY=" + Authorization: Signature keyId="Test",algorithm="rsa-sha256",headers="request-line host date content-type content-md5 content-length",signature="H/AaTDkJvLELy4i1RujnKlS6dm8QWiJvEpn9cKRMi49kKF+mohZ15z1r+mF+XiKS5kOOscyS83olfBtsVhYjPg2Ei3/D9D4Mvb7bFm9IaLJgYTFFuQCghrKQQFPiqJN320emjHxFowpIm1BkstnEU7lktH/XdXVBo8a6Uteiztw=" diff --git a/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/http-signature/lib/index.js b/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/http-signature/lib/index.js index 3ac70b7..217a5dd 100644 --- a/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/http-signature/lib/index.js +++ b/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/http-signature/lib/index.js @@ -19,6 +19,7 @@ module.exports = { sshKeyToPEM: util.sshKeyToPEM, sshKeyFingerprint: util.fingerprint, + pemToRsaSSHKey: util.pemToRsaSSHKey, verify: verify.verifySignature, verifySignature: verify.verifySignature diff --git a/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/http-signature/lib/signer.js b/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/http-signature/lib/signer.js index 8095f0d..3507f4d 100644 --- a/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/http-signature/lib/signer.js +++ b/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/http-signature/lib/signer.js @@ -146,7 +146,6 @@ module.exports = { } stringToSign += h + ': ' + value; } else { - value = stringToSign += request.method + ' ' + request.path + ' HTTP/' + options.httpVersion; } diff --git a/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/http-signature/lib/util.js b/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/http-signature/lib/util.js index 30bbf04..e7d915e 100644 --- a/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/http-signature/lib/util.js +++ b/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/http-signature/lib/util.js @@ -243,7 +243,62 @@ module.exports = { } return fp; - } - + }, + /** + * Converts a PKGCS#8 PEM file to an OpenSSH public key (rsa) + * + * The reverse of the above function. + */ + pemToRsaSSHKey: function pemToRsaSSHKey(pem, comment) { + assert.equal('string', typeof pem, 'typeof pem'); + + // chop off the BEGIN PUBLIC KEY and END PUBLIC KEY portion + var cleaned = pem.split('\n').slice(1, -2).join(''); + + var buf = new Buffer(cleaned, 'base64'); + + var der = new asn1.BerReader(buf); + + der.readSequence(); + der.readSequence(); + + var oid = der.readOID(); + assert.equal(oid, '1.2.840.113549.1.1.1', 'pem not in RSA format'); + + // Null -- XXX this probably isn't good practice + der.readByte(); + der.readByte(); + + // bit string sequence + der.readSequence(0x03); + der.readByte(); + der.readSequence(); + + // modulus + assert.equal(der.peek(), asn1.Ber.Integer, 'modulus not an integer'); + der._offset = der.readLength(der.offset + 1); + var modulus = der._buf.slice(der.offset, der.offset + der.length); + der._offset += der.length; + + // exponent + assert.equal(der.peek(), asn1.Ber.Integer, 'exponent not an integer'); + der._offset = der.readLength(der.offset + 1); + var exponent = der._buf.slice(der.offset, der.offset + der.length); + der._offset += der.length; + + // now, make the key + var type = new Buffer('ssh-rsa'); + var buffer = new Buffer(4 + type.length + 4 + modulus.length + 4 + exponent.length); + var i = 0; + buffer.writeUInt32BE(type.length, i); i += 4; + type.copy(buffer, i); i += type.length; + buffer.writeUInt32BE(exponent.length, i); i += 4; + exponent.copy(buffer, i); i += exponent.length; + buffer.writeUInt32BE(modulus.length, i); i += 4; + modulus.copy(buffer, i); i += modulus.length; + + var s = type.toString() + ' ' + buffer.toString('base64') + ' ' + (comment || ''); + return s; + } }; diff --git a/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/http-signature/node_modules/assert-plus/assert.js b/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/http-signature/node_modules/assert-plus/assert.js index 70583f1..ff2ba02 100644 --- a/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/http-signature/node_modules/assert-plus/assert.js +++ b/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/http-signature/node_modules/assert-plus/assert.js @@ -9,6 +9,7 @@ var util = require('util'); ///--- Globals var NDEBUG = process.env.NODE_NDEBUG || false; +var UUID_REGEXP = /^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$/; @@ -53,6 +54,28 @@ function _assert(arg, type, name, stackFunc) { } +function _instanceof(arg, type, name, stackFunc) { + if (!NDEBUG) { + name = name || type; + stackFunc = stackFunc || _instanceof.caller; + + if (!(arg instanceof type)) { + throw new assert.AssertionError({ + message: _(TYPE_REQUIRED, name, type.name), + actual: _getClass(arg), + expected: type.name, + operator: 'instanceof', + stackStartFunction: stackFunc + }); + } + } +} + +function _getClass(object) { + return (Object.prototype.toString.call(object).slice(8, -1)); +}; + + ///--- API @@ -85,7 +108,7 @@ function bool(arg, name) { function buffer(arg, name) { if (!Buffer.isBuffer(arg)) { throw new assert.AssertionError({ - message: _(TYPE_REQUIRED, name, type), + message: _(TYPE_REQUIRED, name || '', 'Buffer'), actual: typeof (arg), expected: 'buffer', operator: 'Buffer.isBuffer', @@ -102,6 +125,15 @@ function func(arg, name) { function number(arg, name) { _assert(arg, 'number', name); + if (!NDEBUG && (isNaN(arg) || !isFinite(arg))) { + throw new assert.AssertionError({ + message: _(TYPE_REQUIRED, name, 'number'), + actual: arg, + expected: 'number', + operator: 'isNaN', + stackStartFunction: number + }); + } } @@ -111,15 +143,16 @@ function object(arg, name) { function stream(arg, name) { - if (!(arg instanceof Stream)) { - throw new assert.AssertionError({ - message: _(TYPE_REQUIRED, name, type), - actual: typeof (arg), - expected: 'Stream', - operator: 'instanceof', - stackStartFunction: buffer - }); - } + _instanceof(arg, Stream, name); +} + + +function date(arg, name) { + _instanceof(arg, Date, name); +} + +function regexp(arg, name) { + _instanceof(arg, RegExp, name); } @@ -128,17 +161,33 @@ function string(arg, name) { } +function uuid(arg, name) { + string(arg, name); + if (!NDEBUG && !UUID_REGEXP.test(arg)) { + throw new assert.AssertionError({ + message: _(TYPE_REQUIRED, name, 'uuid'), + actual: 'string', + expected: 'uuid', + operator: 'test', + stackStartFunction: uuid + }); + } +} + ///--- Exports module.exports = { bool: bool, buffer: buffer, + date: date, func: func, number: number, object: object, + regexp: regexp, stream: stream, - string: string + string: string, + uuid: uuid }; diff --git a/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/http-signature/node_modules/assert-plus/package.json b/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/http-signature/node_modules/assert-plus/package.json index 29500a2..d2578b0 100644 --- a/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/http-signature/node_modules/assert-plus/package.json +++ b/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/http-signature/node_modules/assert-plus/package.json @@ -5,20 +5,28 @@ }, "name": "assert-plus", "description": "Extra assertions on top of node's assert module", - "version": "0.1.2", + "version": "0.1.5", "main": "./assert.js", - "dependencies": {}, "devDependencies": {}, "optionalDependencies": {}, + "repository": { + "type": "git", + "url": "https://github.com/mcavage/node-assert-plus.git" + }, "engines": { - "node": ">=0.6" + "node": ">=0.8" }, - "_id": "assert-plus@0.1.2", + "bugs": { + "url": "https://github.com/mcavage/node-assert-plus/issues" + }, + "dependencies": {}, + "_id": "assert-plus@0.1.5", "dist": { - "shasum": "d93ffdbb67ac5507779be316a7d65146417beef8", - "tarball": "http://registry.npmjs.org/assert-plus/-/assert-plus-0.1.2.tgz" + "shasum": "ee74009413002d84cec7219c6ac811812e723160", + "tarball": "http://registry.npmjs.org/assert-plus/-/assert-plus-0.1.5.tgz" }, - "_npmVersion": "1.1.59", + "_from": "assert-plus@^0.1.5", + "_npmVersion": "1.3.11", "_npmUser": { "name": "mcavage", "email": "mcavage@gmail.com" @@ -30,8 +38,8 @@ } ], "directories": {}, - "_shasum": "d93ffdbb67ac5507779be316a7d65146417beef8", - "_from": "assert-plus@0.1.2", - "_resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-0.1.2.tgz", - "readme": "ERROR: No README data found!" + "_shasum": "ee74009413002d84cec7219c6ac811812e723160", + "_resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-0.1.5.tgz", + "readme": "ERROR: No README data found!", + "homepage": "https://github.com/mcavage/node-assert-plus" } diff --git a/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/http-signature/node_modules/ctype/.npmignore b/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/http-signature/node_modules/ctype/.npmignore new file mode 100644 index 0000000..dc6d3b2 --- /dev/null +++ b/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/http-signature/node_modules/ctype/.npmignore @@ -0,0 +1 @@ +tst/ diff --git a/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/http-signature/node_modules/ctype/CHANGELOG b/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/http-signature/node_modules/ctype/CHANGELOG index 078c03c..426da9e 100644 --- a/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/http-signature/node_modules/ctype/CHANGELOG +++ b/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/http-signature/node_modules/ctype/CHANGELOG @@ -4,7 +4,14 @@ in it. The commit message also has the corresponding github issue. i.e. CTYPE-42 would be issue 42. Each issue can be found at: https://github.com/rmustacc/node-ctype/issues/%d. -CTYPE v0.5.2 +v0.5.3 +CTYPE-50 Release 0.5.3 +Contributed by Nick Schonning: +CTYPE-49 Add repository section to package.json +Contributed by Jonathan Ong: +CTYPE-48 Create .npmignore + +v0.5.2 CTYPE-46 Release 0.5.2 CTYPE-45 error in setEndian logic diff --git a/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/http-signature/node_modules/ctype/package.json b/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/http-signature/node_modules/ctype/package.json index 474e54d..2d6990c 100644 --- a/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/http-signature/node_modules/ctype/package.json +++ b/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/http-signature/node_modules/ctype/package.json @@ -1,6 +1,6 @@ { "name": "ctype", - "version": "0.5.2", + "version": "0.5.3", "description": "read and write binary structures and data types", "homepage": "https://github.com/rmustacc/node-ctype", "author": { @@ -11,10 +11,14 @@ "node": ">= 0.4" }, "main": "ctype.js", - "_id": "ctype@0.5.2", + "repository": { + "type": "git", + "url": "https://github.com/rmustacc/node-ctype.git" + }, + "_id": "ctype@0.5.3", "dist": { - "shasum": "fe8091d468a373a0b0c9ff8bbfb3425c00973a1d", - "tarball": "http://registry.npmjs.org/ctype/-/ctype-0.5.2.tgz" + "shasum": "82c18c2461f74114ef16c135224ad0b9144ca12f", + "tarball": "http://registry.npmjs.org/ctype/-/ctype-0.5.3.tgz" }, "_npmVersion": "1.1.59", "_npmUser": { @@ -28,8 +32,11 @@ } ], "directories": {}, - "_shasum": "fe8091d468a373a0b0c9ff8bbfb3425c00973a1d", - "_from": "ctype@0.5.2", - "_resolved": "https://registry.npmjs.org/ctype/-/ctype-0.5.2.tgz", + "_shasum": "82c18c2461f74114ef16c135224ad0b9144ca12f", + "_from": "ctype@0.5.3", + "_resolved": "https://registry.npmjs.org/ctype/-/ctype-0.5.3.tgz", + "bugs": { + "url": "https://github.com/rmustacc/node-ctype/issues" + }, "readme": "ERROR: No README data found!" } diff --git a/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/http-signature/node_modules/ctype/tst/ctf/float.json b/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/http-signature/node_modules/ctype/tst/ctf/float.json deleted file mode 100644 index 29d7bd8..0000000 --- a/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/http-signature/node_modules/ctype/tst/ctf/float.json +++ /dev/null @@ -1,13 +0,0 @@ -{ "metadata": - { - "ctf2json_version": "1.0", - "created_at": 1316563626, - "derived_from": "/lib/libc.so", - "ctf_version": 2, - "requested_types": [ "float" ] - }, -"data": - [ - { "name": "float", "float": { "length": 4 } } - ] -} diff --git a/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/http-signature/node_modules/ctype/tst/ctf/int.json b/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/http-signature/node_modules/ctype/tst/ctf/int.json deleted file mode 100644 index f9773a1..0000000 --- a/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/http-signature/node_modules/ctype/tst/ctf/int.json +++ /dev/null @@ -1,13 +0,0 @@ -{ "metadata": - { - "ctf2json_version": "1.0", - "created_at": 1316563631, - "derived_from": "/lib/libc.so", - "ctf_version": 2, - "requested_types": [ "int" ] - }, -"data": - [ - { "name": "int", "integer": { "length": 4, "signed": true } } - ] -} diff --git a/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/http-signature/node_modules/ctype/tst/ctf/psinfo.json b/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/http-signature/node_modules/ctype/tst/ctf/psinfo.json deleted file mode 100644 index e0ee5e0..0000000 --- a/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/http-signature/node_modules/ctype/tst/ctf/psinfo.json +++ /dev/null @@ -1,104 +0,0 @@ -{ "metadata": - { - "ctf2json_version": "1.0", - "created_at": 1316563573, - "derived_from": "/lib/libc.so", - "ctf_version": 2, - "requested_types": [ "psinfo_t" ] - }, -"data": - [ - { "name": "int", "integer": { "length": 4, "signed": true } }, - { "name": "char", "integer": { "length": 1, "signed": true } }, - { "name": "unsigned short", "integer": { "length": 2, "signed": false } }, - { "name": "long", "integer": { "length": 4, "signed": true } }, - { "name": "unsigned", "integer": { "length": 4, "signed": false } }, - { "name": "size_t", "typedef": "unsigned" }, - { "name": "unsigned long", "integer": { "length": 4, "signed": false } }, - { "name": "time_t", "typedef": "long" }, - { "name": "struct timespec", "struct": [ - { "name": "tv_sec", "type": "time_t" }, - { "name": "tv_nsec", "type": "long" } - ] }, - { "name": "zoneid_t", "typedef": "long" }, - { "name": "taskid_t", "typedef": "long" }, - { "name": "dev_t", "typedef": "unsigned long" }, - { "name": "uid_t", "typedef": "unsigned" }, - { "name": "gid_t", "typedef": "unsigned" }, - { "name": "timestruc_t", "typedef": "struct timespec" }, - { "name": "short", "integer": { "length": 2, "signed": true } }, - { "name": "projid_t", "typedef": "long" }, - { "name": "ushort_t", "typedef": "unsigned short" }, - { "name": "poolid_t", "typedef": "long" }, - { "name": "uintptr_t", "typedef": "unsigned" }, - { "name": "id_t", "typedef": "long" }, - { "name": "pid_t", "typedef": "long" }, - { "name": "processorid_t", "typedef": "int" }, - { "name": "psetid_t", "typedef": "int" }, - { "name": "struct lwpsinfo", "struct": [ - { "name": "pr_flag", "type": "int" }, - { "name": "pr_lwpid", "type": "id_t" }, - { "name": "pr_addr", "type": "uintptr_t" }, - { "name": "pr_wchan", "type": "uintptr_t" }, - { "name": "pr_stype", "type": "char" }, - { "name": "pr_state", "type": "char" }, - { "name": "pr_sname", "type": "char" }, - { "name": "pr_nice", "type": "char" }, - { "name": "pr_syscall", "type": "short" }, - { "name": "pr_oldpri", "type": "char" }, - { "name": "pr_cpu", "type": "char" }, - { "name": "pr_pri", "type": "int" }, - { "name": "pr_pctcpu", "type": "ushort_t" }, - { "name": "pr_pad", "type": "ushort_t" }, - { "name": "pr_start", "type": "timestruc_t" }, - { "name": "pr_time", "type": "timestruc_t" }, - { "name": "pr_clname", "type": "char [8]" }, - { "name": "pr_name", "type": "char [16]" }, - { "name": "pr_onpro", "type": "processorid_t" }, - { "name": "pr_bindpro", "type": "processorid_t" }, - { "name": "pr_bindpset", "type": "psetid_t" }, - { "name": "pr_lgrp", "type": "int" }, - { "name": "pr_filler", "type": "int [4]" } - ] }, - { "name": "lwpsinfo_t", "typedef": "struct lwpsinfo" }, - { "name": "struct psinfo", "struct": [ - { "name": "pr_flag", "type": "int" }, - { "name": "pr_nlwp", "type": "int" }, - { "name": "pr_pid", "type": "pid_t" }, - { "name": "pr_ppid", "type": "pid_t" }, - { "name": "pr_pgid", "type": "pid_t" }, - { "name": "pr_sid", "type": "pid_t" }, - { "name": "pr_uid", "type": "uid_t" }, - { "name": "pr_euid", "type": "uid_t" }, - { "name": "pr_gid", "type": "gid_t" }, - { "name": "pr_egid", "type": "gid_t" }, - { "name": "pr_addr", "type": "uintptr_t" }, - { "name": "pr_size", "type": "size_t" }, - { "name": "pr_rssize", "type": "size_t" }, - { "name": "pr_pad1", "type": "size_t" }, - { "name": "pr_ttydev", "type": "dev_t" }, - { "name": "pr_pctcpu", "type": "ushort_t" }, - { "name": "pr_pctmem", "type": "ushort_t" }, - { "name": "pr_start", "type": "timestruc_t" }, - { "name": "pr_time", "type": "timestruc_t" }, - { "name": "pr_ctime", "type": "timestruc_t" }, - { "name": "pr_fname", "type": "char [16]" }, - { "name": "pr_psargs", "type": "char [80]" }, - { "name": "pr_wstat", "type": "int" }, - { "name": "pr_argc", "type": "int" }, - { "name": "pr_argv", "type": "uintptr_t" }, - { "name": "pr_envp", "type": "uintptr_t" }, - { "name": "pr_dmodel", "type": "char" }, - { "name": "pr_pad2", "type": "char [3]" }, - { "name": "pr_taskid", "type": "taskid_t" }, - { "name": "pr_projid", "type": "projid_t" }, - { "name": "pr_nzomb", "type": "int" }, - { "name": "pr_poolid", "type": "poolid_t" }, - { "name": "pr_zoneid", "type": "zoneid_t" }, - { "name": "pr_contract", "type": "id_t" }, - { "name": "pr_filler", "type": "int [1]" }, - { "name": "pr_lwp", "type": "lwpsinfo_t" } - ] }, - { "name": "psinfo_t", "typedef": "struct psinfo" } - ] -} diff --git a/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/http-signature/node_modules/ctype/tst/ctf/struct.json b/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/http-signature/node_modules/ctype/tst/ctf/struct.json deleted file mode 100644 index e0542ff..0000000 --- a/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/http-signature/node_modules/ctype/tst/ctf/struct.json +++ /dev/null @@ -1,19 +0,0 @@ -{ "metadata": - { - "ctf2json_version": "1.0", - "created_at": 1316563648, - "derived_from": "/lib/libc.so", - "ctf_version": 2, - "requested_types": [ "timestruc_t" ] - }, -"data": - [ - { "name": "long", "integer": { "length": 4, "signed": true } }, - { "name": "time_t", "typedef": "long" }, - { "name": "struct timespec", "struct": [ - { "name": "tv_sec", "type": "time_t" }, - { "name": "tv_nsec", "type": "long" } - ] }, - { "name": "timestruc_t", "typedef": "struct timespec" } - ] -} diff --git a/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/http-signature/node_modules/ctype/tst/ctf/tst.fail.js b/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/http-signature/node_modules/ctype/tst/ctf/tst.fail.js deleted file mode 100644 index d6a52cb..0000000 --- a/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/http-signature/node_modules/ctype/tst/ctf/tst.fail.js +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Test several conditions that should always cause us to throw. - */ -var mod_assert = require('assert'); -var mod_ctype = require('../../ctype.js'); - -var cases = [ -{ json: { }, msg: 'bad JSON - no metadata or data' }, -{ json: { metadata: {} }, msg: 'bad JSON - bad metadata section' }, -{ json: { metadata: { 'JSON version': [] } }, - msg: 'bad JSON - bad JSON version' }, -{ json: { metadata: { 'JSON version': 2 } }, - msg: 'bad JSON - bad JSON version' }, -{ json: { metadata: { 'JSON version': '100.20' } }, - msg: 'bad JSON - bad JSON version' }, -{ json: { metadata: { 'JSON version': '1.0' } }, - msg: 'missing data section' }, -{ json: { metadata: { 'JSON version': '1.0' }, data: 1 }, - msg: 'invalid data section' }, -{ json: { metadata: { 'JSON version': '1.0' }, data: 1.1 }, - msg: 'invalid data section' }, -{ json: { metadata: { 'JSON version': '1.0' }, data: '1.1' }, - msg: 'invalid data section' }, -{ json: { metadata: { 'JSON version': '1.0' }, data: {} }, - msg: 'invalid data section' } -]; - -function test() -{ - var ii; - - for (ii = 0; ii < cases.length; ii++) { - mod_assert.throws(function () { - mod_ctype.parseCTF(cases[ii].json); - }, Error, cases[ii].msg); - } -} - -test(); diff --git a/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/http-signature/node_modules/ctype/tst/ctf/tst.float.js b/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/http-signature/node_modules/ctype/tst/ctf/tst.float.js deleted file mode 100644 index f214499..0000000 --- a/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/http-signature/node_modules/ctype/tst/ctf/tst.float.js +++ /dev/null @@ -1,14 +0,0 @@ -var mod_fs = require('fs'); -var mod_ctype = require('../../ctype.js'); -var mod_assert = require('assert'); - -function test() -{ - var data, parser; - - data = JSON.parse(mod_fs.readFileSync('./float.json').toString()); - parser = mod_ctype.parseCTF(data, { endian: 'big' }); - mod_assert.deepEqual(parser.lstypes(), {}); -} - -test(); diff --git a/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/http-signature/node_modules/ctype/tst/ctf/tst.int.js b/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/http-signature/node_modules/ctype/tst/ctf/tst.int.js deleted file mode 100644 index 0ec0f76..0000000 --- a/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/http-signature/node_modules/ctype/tst/ctf/tst.int.js +++ /dev/null @@ -1,14 +0,0 @@ -var mod_fs = require('fs'); -var mod_ctype = require('../../ctype.js'); -var mod_assert = require('assert'); - -function test() -{ - var data, parser; - - data = JSON.parse(mod_fs.readFileSync('./int.json').toString()); - parser = mod_ctype.parseCTF(data, { endian: 'big' }); - mod_assert.deepEqual(parser.lstypes(), { 'int': 'int32_t' }); -} - -test(); diff --git a/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/http-signature/node_modules/ctype/tst/ctf/tst.psinfo.js b/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/http-signature/node_modules/ctype/tst/ctf/tst.psinfo.js deleted file mode 100644 index ca1a544..0000000 --- a/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/http-signature/node_modules/ctype/tst/ctf/tst.psinfo.js +++ /dev/null @@ -1,17 +0,0 @@ -var mod_fs = require('fs'); -var mod_ctype = require('../../ctype.js'); -var mod_assert = require('assert'); - -/* - * This is too unwieldly to actually write out. Just make sure we can parse it - * without errrors. - */ -function test() -{ - var data; - - data = JSON.parse(mod_fs.readFileSync('./psinfo.json').toString()); - mod_ctype.parseCTF(data, { endian: 'big' }); -} - -test(); diff --git a/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/http-signature/node_modules/ctype/tst/ctf/tst.struct.js b/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/http-signature/node_modules/ctype/tst/ctf/tst.struct.js deleted file mode 100644 index c62f41f..0000000 --- a/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/http-signature/node_modules/ctype/tst/ctf/tst.struct.js +++ /dev/null @@ -1,18 +0,0 @@ -var mod_fs = require('fs'); -var mod_ctype = require('../../ctype.js'); -var mod_assert = require('assert'); - -function test() -{ - var data, parser; - - data = JSON.parse(mod_fs.readFileSync('./struct.json').toString()); - parser = mod_ctype.parseCTF(data, { endian: 'big' }); - mod_assert.deepEqual(parser.lstypes(), { 'long': 'int32_t', - 'time_t': 'long', - 'timestruc_t': 'struct timespec', - 'struct timespec': [ { 'tv_sec': { 'type': 'time_t' } }, - { 'tv_nsec': { 'type': 'long' } } ] }); -} - -test(); diff --git a/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/http-signature/node_modules/ctype/tst/ctf/tst.typedef.js b/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/http-signature/node_modules/ctype/tst/ctf/tst.typedef.js deleted file mode 100644 index 9006cd1..0000000 --- a/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/http-signature/node_modules/ctype/tst/ctf/tst.typedef.js +++ /dev/null @@ -1,15 +0,0 @@ -var mod_fs = require('fs'); -var mod_ctype = require('../../ctype.js'); -var mod_assert = require('assert'); - -function test() -{ - var data, parser; - - data = JSON.parse(mod_fs.readFileSync('./typedef.json').toString()); - parser = mod_ctype.parseCTF(data, { endian: 'big' }); - mod_assert.deepEqual(parser.lstypes(), { 'bar_t': 'int', - 'int': 'int32_t' }); -} - -test(); diff --git a/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/http-signature/node_modules/ctype/tst/ctf/typedef.json b/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/http-signature/node_modules/ctype/tst/ctf/typedef.json deleted file mode 100644 index 35ddb50..0000000 --- a/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/http-signature/node_modules/ctype/tst/ctf/typedef.json +++ /dev/null @@ -1,14 +0,0 @@ -{ "metadata": - { - "ctf2json_version": "1.0", - "created_at": 1316302348, - "derived_from": "/lib/libc.so", - "ctf_version": 2, - "requested_types": [ "bar_t" ] - }, -"data": - [ - { "name": "int", "integer": { "length": 4, "signed": true } }, - { "name": "bar_t", "typedef": "int" } - ] -} diff --git a/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/http-signature/node_modules/ctype/tst/ctio/float/tst.rfloat.js b/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/http-signature/node_modules/ctype/tst/ctio/float/tst.rfloat.js deleted file mode 100644 index 2c9504a..0000000 --- a/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/http-signature/node_modules/ctype/tst/ctio/float/tst.rfloat.js +++ /dev/null @@ -1,767 +0,0 @@ -/* - * Battery of tests to break our floating point implementation. Oh ho ho. - * - * There are a few useful ways to generate the expected output. The first is - * just write a C program and write raw bytes out and inspect with xxd. Remember - * to consider whether or not you're on a big endian or little endian machine. - * Another useful site I found to help with some of this was: - * - * http://babbage.cs.qc.edu/IEEE-754/ - */ - -var mod_ctype = require('../../../ctio.js'); -var ASSERT = require('assert'); - -function testfloat() -{ - var buffer = new Buffer(4); - /* Start off with some of the easy ones: +zero */ - buffer[0] = 0; - buffer[1] = 0; - buffer[2] = 0; - buffer[3] = 0; - - ASSERT.equal(0, mod_ctype.rfloat(buffer, 'big', 0)); - ASSERT.equal(0, mod_ctype.rfloat(buffer, 'little', 0)); - - /* Test -0 */ - buffer[0] = 0x80; - ASSERT.equal(0, mod_ctype.rfloat(buffer, 'big', 0)); - buffer[3] = buffer[0]; - buffer[0] = 0; - ASSERT.equal(0, mod_ctype.rfloat(buffer, 'little', 0)); - - /* Catch +infin */ - buffer[0] = 0x7f; - buffer[1] = 0x80; - buffer[2] = 0x00; - buffer[3] = 0x00; - ASSERT.equal(Number.POSITIVE_INFINITY, - mod_ctype.rfloat(buffer, 'big', 0)); - buffer[3] = 0x7f; - buffer[2] = 0x80; - buffer[1] = 0x00; - buffer[0] = 0x00; - ASSERT.equal(Number.POSITIVE_INFINITY, - mod_ctype.rfloat(buffer, 'litle', 0)); - - /* Catch -infin */ - buffer[0] = 0xff; - buffer[1] = 0x80; - buffer[2] = 0x00; - buffer[3] = 0x00; - ASSERT.equal(Number.NEGATIVE_INFINITY, - mod_ctype.rfloat(buffer, 'big', 0)); - buffer[3] = 0xff; - buffer[2] = 0x80; - buffer[1] = 0x00; - buffer[0] = 0x00; - ASSERT.equal(Number.NEGATIVE_INFINITY, - mod_ctype.rfloat(buffer, 'litle', 0)); - - /* Catch NaN */ - - buffer[0] = 0x7f; - buffer[1] = 0x80; - buffer[2] = 0x00; - buffer[3] = 0x23; - ASSERT.ok(isNaN(mod_ctype.rfloat(buffer, 'big', 0))); - buffer[3] = 0x7f; - buffer[2] = 0x80; - buffer[1] = 0x00; - buffer[0] = 0x23; - ASSERT.ok(isNaN(mod_ctype.rfloat(buffer, 'little', 0))); - - /* Catch -infin */ - buffer[0] = 0xff; - buffer[1] = 0x80; - buffer[2] = 0x00; - buffer[3] = 0x23; - ASSERT.ok(isNaN(mod_ctype.rfloat(buffer, 'big', 0))); - buffer[3] = 0xff; - buffer[2] = 0x80; - buffer[1] = 0x00; - buffer[0] = 0x23; - ASSERT.ok(isNaN(mod_ctype.rfloat(buffer, 'little', 0))); - - /* On to some basic tests */ - /* 1.125 */ - buffer[0] = 0x3f; - buffer[1] = 0x90; - buffer[2] = 0x00; - buffer[3] = 0x00; - ASSERT.equal(1.125, mod_ctype.rfloat(buffer, 'big', 0)); - - buffer[3] = 0x3f; - buffer[2] = 0x90; - buffer[1] = 0x00; - buffer[0] = 0x00; - ASSERT.equal(1.125, mod_ctype.rfloat(buffer, 'little', 0)); - - /* ff34a2b0 -2.4010576103645774e+38 */ - buffer[0] = 0xff; - buffer[1] = 0x34; - buffer[2] = 0xa2; - buffer[3] = 0xb0; - ASSERT.equal(-2.4010576103645774e+38, - mod_ctype.rfloat(buffer, 'big', 0)); - - buffer[3] = 0xff; - buffer[2] = 0x34; - buffer[1] = 0xa2; - buffer[0] = 0xb0; - ASSERT.equal(-2.4010576103645774e+38, - mod_ctype.rfloat(buffer, 'little', 0)); - - /* Denormalized tests */ - - /* 0003f89a +/- 3.6468792534053364e-40 */ - buffer[0] = 0x00; - buffer[1] = 0x03; - buffer[2] = 0xf8; - buffer[3] = 0x9a; - ASSERT.equal(3.6468792534053364e-40, - mod_ctype.rfloat(buffer, 'big', 0)); - - buffer[3] = 0x00; - buffer[2] = 0x03; - buffer[1] = 0xf8; - buffer[0] = 0x9a; - ASSERT.equal(3.6468792534053364e-40, - mod_ctype.rfloat(buffer, 'little', 0)); - - buffer[0] = 0x80; - buffer[1] = 0x03; - buffer[2] = 0xf8; - buffer[3] = 0x9a; - ASSERT.equal(-3.6468792534053364e-40, - mod_ctype.rfloat(buffer, 'big', 0)); - - buffer[3] = 0x80; - buffer[2] = 0x03; - buffer[1] = 0xf8; - buffer[0] = 0x9a; - ASSERT.equal(-3.6468792534053364e-40, - mod_ctype.rfloat(buffer, 'little', 0)); - - - /* Maximum and minimum normalized and denormalized values */ - - /* Largest normalized number +/- 3.4028234663852886e+38 */ - - buffer[0] = 0x7f; - buffer[1] = 0x7f; - buffer[2] = 0xff; - buffer[3] = 0xff; - ASSERT.equal(3.4028234663852886e+38, - mod_ctype.rfloat(buffer, 'big', 0)); - - buffer[3] = 0x7f; - buffer[2] = 0x7f; - buffer[1] = 0xff; - buffer[0] = 0xff; - ASSERT.equal(3.4028234663852886e+38, - mod_ctype.rfloat(buffer, 'little', 0)); - - buffer[0] = 0xff; - buffer[1] = 0x7f; - buffer[2] = 0xff; - buffer[3] = 0xff; - ASSERT.equal(-3.4028234663852886e+38, - mod_ctype.rfloat(buffer, 'big', 0)); - - buffer[3] = 0xff; - buffer[2] = 0x7f; - buffer[1] = 0xff; - buffer[0] = 0xff; - ASSERT.equal(-3.4028234663852886e+38, - mod_ctype.rfloat(buffer, 'little', 0)); - - /* Smallest normalied number +/- 1.1754943508222875e-38 */ - buffer[0] = 0x00; - buffer[1] = 0x80; - buffer[2] = 0x00; - buffer[3] = 0x00; - ASSERT.equal(1.1754943508222875e-38, - mod_ctype.rfloat(buffer, 'big', 0)); - - buffer[3] = 0x00; - buffer[2] = 0x80; - buffer[1] = 0x00; - buffer[0] = 0x00; - ASSERT.equal(1.1754943508222875e-38, - mod_ctype.rfloat(buffer, 'little', 0)); - - buffer[0] = 0x80; - buffer[1] = 0x80; - buffer[2] = 0x00; - buffer[3] = 0x00; - ASSERT.equal(-1.1754943508222875e-38, - mod_ctype.rfloat(buffer, 'big', 0)); - - buffer[3] = 0x80; - buffer[2] = 0x80; - buffer[1] = 0x00; - buffer[0] = 0x00; - ASSERT.equal(-1.1754943508222875e-38, - mod_ctype.rfloat(buffer, 'little', 0)); - - - /* Smallest denormalized number 1.401298464324817e-45 */ - buffer[0] = 0x00; - buffer[1] = 0x00; - buffer[2] = 0x00; - buffer[3] = 0x01; - ASSERT.equal(1.401298464324817e-45, - mod_ctype.rfloat(buffer, 'big', 0)); - - buffer[3] = 0x00; - buffer[2] = 0x00; - buffer[1] = 0x00; - buffer[0] = 0x01; - ASSERT.equal(1.401298464324817e-45, - mod_ctype.rfloat(buffer, 'little', 0)); - - buffer[0] = 0x80; - buffer[1] = 0x00; - buffer[2] = 0x00; - buffer[3] = 0x01; - ASSERT.equal(-1.401298464324817e-45, - mod_ctype.rfloat(buffer, 'big', 0)); - - buffer[3] = 0x80; - buffer[2] = 0x00; - buffer[1] = 0x00; - buffer[0] = 0x01; - ASSERT.equal(-1.401298464324817e-45, - mod_ctype.rfloat(buffer, 'little', 0)); - - /* Largest denormalized value +/- 1.1754942106924411e-38 */ - buffer[0] = 0x00; - buffer[1] = 0x7f; - buffer[2] = 0xff; - buffer[3] = 0xff; - ASSERT.equal(1.1754942106924411e-38, - mod_ctype.rfloat(buffer, 'big', 0)); - - buffer[3] = 0x00; - buffer[2] = 0x7f; - buffer[1] = 0xff; - buffer[0] = 0xff; - ASSERT.equal(1.1754942106924411e-38, - mod_ctype.rfloat(buffer, 'little', 0)); - - buffer[0] = 0x80; - buffer[1] = 0x7f; - buffer[2] = 0xff; - buffer[3] = 0xff; - ASSERT.equal(-1.1754942106924411e-38, - mod_ctype.rfloat(buffer, 'big', 0)); - - buffer[3] = 0x80; - buffer[2] = 0x7f; - buffer[1] = 0xff; - buffer[0] = 0xff; - ASSERT.equal(-1.1754942106924411e-38, - mod_ctype.rfloat(buffer, 'little', 0)); - - /* Do some quick offset testing */ - buffer = new Buffer(6); - buffer[0] = 0x7f; - buffer[1] = 0x4e; - buffer[2] = 0x8a; - buffer[3] = 0x79; - buffer[4] = 0xcd; - buffer[5] = 0x3f; - - ASSERT.equal(2.745399582697325e+38, - mod_ctype.rfloat(buffer, 'big', 0)); - ASSERT.equal(1161619072, - mod_ctype.rfloat(buffer, 'big', 1)); - ASSERT.equal(-1.2027516403607578e-32, - mod_ctype.rfloat(buffer, 'big', 2)); - - ASSERT.equal(8.97661320504413e+34, - mod_ctype.rfloat(buffer, 'little', 0)); - ASSERT.equal(-261661920, - mod_ctype.rfloat(buffer, 'little', 1)); - ASSERT.equal(1.605271577835083, - mod_ctype.rfloat(buffer, 'little', 2)); - -} - -function testdouble() -{ - var buffer = new Buffer(10); - - /* Check 0 */ - buffer[0] = 0; - buffer[1] = 0; - buffer[2] = 0; - buffer[3] = 0; - buffer[4] = 0; - buffer[5] = 0; - buffer[6] = 0; - buffer[7] = 0; - ASSERT.equal(0, - mod_ctype.rdouble(buffer, 'big', 0)); - ASSERT.equal(0, - mod_ctype.rdouble(buffer, 'little', 0)); - - buffer[0] = 0x80; - buffer[1] = 0; - buffer[2] = 0; - buffer[3] = 0; - buffer[4] = 0; - buffer[5] = 0; - buffer[6] = 0; - buffer[7] = 0; - ASSERT.equal(0, - mod_ctype.rdouble(buffer, 'big', 0)); - buffer[7] = 0x80; - buffer[6] = 0; - buffer[5] = 0; - buffer[4] = 0; - buffer[3] = 0; - buffer[2] = 0; - buffer[1] = 0; - buffer[0] = 0; - ASSERT.equal(0, - mod_ctype.rdouble(buffer, 'little', 0)); - - /* Check NaN */ - buffer[0] = 0x7f; - buffer[1] = 0xf0; - buffer[2] = 0; - buffer[3] = 0; - buffer[4] = 0; - buffer[5] = 0; - buffer[6] = 0; - buffer[7] = 23; - ASSERT.ok(isNaN(mod_ctype.rdouble(buffer, 'big', 0))); - - buffer[7] = 0x7f; - buffer[6] = 0xf0; - buffer[5] = 0; - buffer[4] = 0; - buffer[3] = 0; - buffer[2] = 0; - buffer[1] = 0; - buffer[0] = 23; - ASSERT.ok(isNaN(mod_ctype.rdouble(buffer, 'little', 0))); - - buffer[0] = 0xff; - buffer[1] = 0xf0; - buffer[2] = 0; - buffer[3] = 0; - buffer[4] = 0; - buffer[5] = 0; - buffer[6] = 0; - buffer[7] = 23; - ASSERT.ok(isNaN(mod_ctype.rdouble(buffer, 'big', 0))); - - buffer[7] = 0xff; - buffer[6] = 0xf0; - buffer[5] = 0; - buffer[4] = 0; - buffer[3] = 0; - buffer[2] = 0; - buffer[1] = 0; - buffer[0] = 23; - ASSERT.ok(isNaN(mod_ctype.rdouble(buffer, 'little', 0))); - - /* pos inf */ - buffer[0] = 0x7f; - buffer[1] = 0xf0; - buffer[2] = 0; - buffer[3] = 0; - buffer[4] = 0; - buffer[5] = 0; - buffer[6] = 0; - buffer[7] = 0; - ASSERT.equal(Number.POSITIVE_INFINITY, - mod_ctype.rdouble(buffer, 'big', 0)); - - buffer[7] = 0x7f; - buffer[6] = 0xf0; - buffer[5] = 0; - buffer[4] = 0; - buffer[3] = 0; - buffer[2] = 0; - buffer[1] = 0; - buffer[0] = 0; - ASSERT.equal(Number.POSITIVE_INFINITY, - mod_ctype.rdouble(buffer, 'little', 0)); - - /* neg inf */ - buffer[0] = 0xff; - buffer[1] = 0xf0; - buffer[2] = 0; - buffer[3] = 0; - buffer[4] = 0; - buffer[5] = 0; - buffer[6] = 0; - buffer[7] = 0; - ASSERT.equal(Number.NEGATIVE_INFINITY, - mod_ctype.rdouble(buffer, 'big', 0)); - - buffer[7] = 0xff; - buffer[6] = 0xf0; - buffer[5] = 0; - buffer[4] = 0; - buffer[3] = 0; - buffer[2] = 0; - buffer[1] = 0; - buffer[0] = 0; - ASSERT.equal(Number.NEGATIVE_INFINITY, - mod_ctype.rdouble(buffer, 'little', 0)); - - /* Simple normalized values */ - - /* +/- 1.125 */ - buffer[0] = 0x3f; - buffer[1] = 0xf2; - buffer[2] = 0; - buffer[3] = 0; - buffer[4] = 0; - buffer[5] = 0; - buffer[6] = 0; - buffer[7] = 0; - ASSERT.equal(1.125, - mod_ctype.rdouble(buffer, 'big', 0)); - - buffer[7] = 0x3f; - buffer[6] = 0xf2; - buffer[5] = 0; - buffer[4] = 0; - buffer[3] = 0; - buffer[2] = 0; - buffer[1] = 0; - buffer[0] = 0; - ASSERT.equal(1.125, - mod_ctype.rdouble(buffer, 'little', 0)); - - buffer[0] = 0xbf; - buffer[1] = 0xf2; - buffer[2] = 0; - buffer[3] = 0; - buffer[4] = 0; - buffer[5] = 0; - buffer[6] = 0; - buffer[7] = 0; - ASSERT.equal(-1.125, - mod_ctype.rdouble(buffer, 'big', 0)); - - buffer[7] = 0xbf; - buffer[6] = 0xf2; - buffer[5] = 0; - buffer[4] = 0; - buffer[3] = 0; - buffer[2] = 0; - buffer[1] = 0; - buffer[0] = 0; - ASSERT.equal(-1.125, - mod_ctype.rdouble(buffer, 'little', 0)); - - /* +/- 1.4397318913736026e+283 */ - buffer[0] = 0x7a; - buffer[1] = 0xb8; - buffer[2] = 0xc9; - buffer[3] = 0x34; - buffer[4] = 0x72; - buffer[5] = 0x16; - buffer[6] = 0xf9; - buffer[7] = 0x0e; - ASSERT.equal(1.4397318913736026e+283, - mod_ctype.rdouble(buffer, 'big', 0)); - - buffer[7] = 0x7a; - buffer[6] = 0xb8; - buffer[5] = 0xc9; - buffer[4] = 0x34; - buffer[3] = 0x72; - buffer[2] = 0x16; - buffer[1] = 0xf9; - buffer[0] = 0x0e; - ASSERT.equal(1.4397318913736026e+283, - mod_ctype.rdouble(buffer, 'little', 0)); - - buffer[0] = 0xfa; - buffer[1] = 0xb8; - buffer[2] = 0xc9; - buffer[3] = 0x34; - buffer[4] = 0x72; - buffer[5] = 0x16; - buffer[6] = 0xf9; - buffer[7] = 0x0e; - ASSERT.equal(-1.4397318913736026e+283, - mod_ctype.rdouble(buffer, 'big', 0)); - - buffer[7] = 0xfa; - buffer[6] = 0xb8; - buffer[5] = 0xc9; - buffer[4] = 0x34; - buffer[3] = 0x72; - buffer[2] = 0x16; - buffer[1] = 0xf9; - buffer[0] = 0x0e; - ASSERT.equal(-1.4397318913736026e+283, - mod_ctype.rdouble(buffer, 'little', 0)); - - /* Denormalized values */ - /* +/- 8.82521232268344e-309 */ - buffer[0] = 0x00; - buffer[1] = 0x06; - buffer[2] = 0x58; - buffer[3] = 0x94; - buffer[4] = 0x13; - buffer[5] = 0x27; - buffer[6] = 0x8a; - buffer[7] = 0xcd; - ASSERT.equal(8.82521232268344e-309, - mod_ctype.rdouble(buffer, 'big', 0)); - - buffer[7] = 0x00; - buffer[6] = 0x06; - buffer[5] = 0x58; - buffer[4] = 0x94; - buffer[3] = 0x13; - buffer[2] = 0x27; - buffer[1] = 0x8a; - buffer[0] = 0xcd; - ASSERT.equal(8.82521232268344e-309, - mod_ctype.rdouble(buffer, 'little', 0)); - - buffer[0] = 0x80; - buffer[1] = 0x06; - buffer[2] = 0x58; - buffer[3] = 0x94; - buffer[4] = 0x13; - buffer[5] = 0x27; - buffer[6] = 0x8a; - buffer[7] = 0xcd; - ASSERT.equal(-8.82521232268344e-309, - mod_ctype.rdouble(buffer, 'big', 0)); - - buffer[7] = 0x80; - buffer[6] = 0x06; - buffer[5] = 0x58; - buffer[4] = 0x94; - buffer[3] = 0x13; - buffer[2] = 0x27; - buffer[1] = 0x8a; - buffer[0] = 0xcd; - ASSERT.equal(-8.82521232268344e-309, - mod_ctype.rdouble(buffer, 'little', 0)); - - /* Edge cases, maximum and minimum values */ - - /* Smallest denormalized value 5e-324 */ - buffer[0] = 0x00; - buffer[1] = 0x00; - buffer[2] = 0x00; - buffer[3] = 0x00; - buffer[4] = 0x00; - buffer[5] = 0x00; - buffer[6] = 0x00; - buffer[7] = 0x01; - ASSERT.equal(5e-324, - mod_ctype.rdouble(buffer, 'big', 0)); - - buffer[7] = 0x00; - buffer[6] = 0x00; - buffer[5] = 0x00; - buffer[4] = 0x00; - buffer[3] = 0x00; - buffer[2] = 0x00; - buffer[1] = 0x00; - buffer[0] = 0x01; - ASSERT.equal(5e-324, - mod_ctype.rdouble(buffer, 'little', 0)); - - buffer[0] = 0x80; - buffer[1] = 0x00; - buffer[2] = 0x00; - buffer[3] = 0x00; - buffer[4] = 0x00; - buffer[5] = 0x00; - buffer[6] = 0x00; - buffer[7] = 0x01; - ASSERT.equal(-5e-324, - mod_ctype.rdouble(buffer, 'big', 0)); - - buffer[7] = 0x80; - buffer[6] = 0x00; - buffer[5] = 0x00; - buffer[4] = 0x00; - buffer[3] = 0x00; - buffer[2] = 0x00; - buffer[1] = 0x00; - buffer[0] = 0x01; - ASSERT.equal(-5e-324, - mod_ctype.rdouble(buffer, 'little', 0)); - - /* Largest denormalized value 2.225073858507201e-308 */ - buffer[0] = 0x00; - buffer[1] = 0x0f; - buffer[2] = 0xff; - buffer[3] = 0xff; - buffer[4] = 0xff; - buffer[5] = 0xff; - buffer[6] = 0xff; - buffer[7] = 0xff; - ASSERT.equal(2.225073858507201e-308, - mod_ctype.rdouble(buffer, 'big', 0)); - - buffer[7] = 0x00; - buffer[6] = 0x0f; - buffer[5] = 0xff; - buffer[4] = 0xff; - buffer[3] = 0xff; - buffer[2] = 0xff; - buffer[1] = 0xff; - buffer[0] = 0xff; - ASSERT.equal(2.225073858507201e-308, - mod_ctype.rdouble(buffer, 'little', 0)); - - buffer[0] = 0x80; - buffer[1] = 0x0f; - buffer[2] = 0xff; - buffer[3] = 0xff; - buffer[4] = 0xff; - buffer[5] = 0xff; - buffer[6] = 0xff; - buffer[7] = 0xff; - ASSERT.equal(-2.225073858507201e-308, - mod_ctype.rdouble(buffer, 'big', 0)); - - buffer[7] = 0x80; - buffer[6] = 0x0f; - buffer[5] = 0xff; - buffer[4] = 0xff; - buffer[3] = 0xff; - buffer[2] = 0xff; - buffer[1] = 0xff; - buffer[0] = 0xff; - ASSERT.equal(-2.225073858507201e-308, - mod_ctype.rdouble(buffer, 'little', 0)); - - /* Smallest normalized value 2.2250738585072014e-308 */ - buffer[0] = 0x00; - buffer[1] = 0x10; - buffer[2] = 0x00; - buffer[3] = 0x00; - buffer[4] = 0x00; - buffer[5] = 0x00; - buffer[6] = 0x00; - buffer[7] = 0x00; - ASSERT.equal(2.2250738585072014e-308, - mod_ctype.rdouble(buffer, 'big', 0)); - - buffer[7] = 0x00; - buffer[6] = 0x10; - buffer[5] = 0x00; - buffer[4] = 0x00; - buffer[3] = 0x00; - buffer[2] = 0x00; - buffer[1] = 0x00; - buffer[0] = 0x00; - ASSERT.equal(2.2250738585072014e-308, - mod_ctype.rdouble(buffer, 'little', 0)); - - buffer[0] = 0x80; - buffer[1] = 0x10; - buffer[2] = 0x00; - buffer[3] = 0x00; - buffer[4] = 0x00; - buffer[5] = 0x00; - buffer[6] = 0x00; - buffer[7] = 0x00; - ASSERT.equal(-2.2250738585072014e-308, - mod_ctype.rdouble(buffer, 'big', 0)); - - buffer[7] = 0x80; - buffer[6] = 0x10; - buffer[5] = 0x00; - buffer[4] = 0x00; - buffer[3] = 0x00; - buffer[2] = 0x00; - buffer[1] = 0x00; - buffer[0] = 0x00; - ASSERT.equal(-2.2250738585072014e-308, - mod_ctype.rdouble(buffer, 'little', 0)); - - /* Largest normalized value 1.7976931348623157e+308 */ - buffer[0] = 0x7f; - buffer[1] = 0xef; - buffer[2] = 0xff; - buffer[3] = 0xff; - buffer[4] = 0xff; - buffer[5] = 0xff; - buffer[6] = 0xff; - buffer[7] = 0xff; - ASSERT.equal(1.7976931348623157e+308, - mod_ctype.rdouble(buffer, 'big', 0)); - - buffer[7] = 0x7f; - buffer[6] = 0xef; - buffer[5] = 0xff; - buffer[4] = 0xff; - buffer[3] = 0xff; - buffer[2] = 0xff; - buffer[1] = 0xff; - buffer[0] = 0xff; - ASSERT.equal(1.7976931348623157e+308, - mod_ctype.rdouble(buffer, 'little', 0)); - - buffer[0] = 0xff; - buffer[1] = 0xef; - buffer[2] = 0xff; - buffer[3] = 0xff; - buffer[4] = 0xff; - buffer[5] = 0xff; - buffer[6] = 0xff; - buffer[7] = 0xff; - ASSERT.equal(-1.7976931348623157e+308, - mod_ctype.rdouble(buffer, 'big', 0)); - - buffer[7] = 0xff; - buffer[6] = 0xef; - buffer[5] = 0xff; - buffer[4] = 0xff; - buffer[3] = 0xff; - buffer[2] = 0xff; - buffer[1] = 0xff; - buffer[0] = 0xff; - ASSERT.equal(-1.7976931348623157e+308, - mod_ctype.rdouble(buffer, 'little', 0)); - - /* Try offsets */ - buffer[0] = 0xde; - buffer[1] = 0xad; - buffer[2] = 0xbe; - buffer[3] = 0xef; - buffer[4] = 0xba; - buffer[5] = 0xdd; - buffer[6] = 0xca; - buffer[7] = 0xfe; - buffer[8] = 0x16; - buffer[9] = 0x79; - - ASSERT.equal(-1.1885958404126936e+148, - mod_ctype.rdouble(buffer, 'big', 0)); - ASSERT.equal(-2.4299184080448593e-88, - mod_ctype.rdouble(buffer, 'big', 1)); - ASSERT.equal(-0.000015130017658081283, - mod_ctype.rdouble(buffer, 'big', 2)); - - ASSERT.equal(-5.757458694845505e+302, - mod_ctype.rdouble(buffer, 'little', 0)); - ASSERT.equal(6.436459604192476e-198, - mod_ctype.rdouble(buffer, 'little', 1)); - ASSERT.equal(1.9903745632417286e+275, - mod_ctype.rdouble(buffer, 'little', 2)); -} - -testfloat(); -testdouble(); diff --git a/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/http-signature/node_modules/ctype/tst/ctio/float/tst.wfloat.js b/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/http-signature/node_modules/ctype/tst/ctio/float/tst.wfloat.js deleted file mode 100644 index b5fd95c..0000000 --- a/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/http-signature/node_modules/ctype/tst/ctio/float/tst.wfloat.js +++ /dev/null @@ -1,753 +0,0 @@ -/* - * Another place to find bugs that may yet plague us. This time with writing out - * floats to arrays. We are lazy and did basically just take the opposite of our - * test code to read in values. - */ - -var mod_ctype = require('../../../ctio.js'); -var ASSERT = require('assert'); - - -/* - * A useful thing to keep around for debugging - * console.log('buffer[0]: ' + buffer[0].toString(16)); - * console.log('buffer[1]: ' + buffer[1].toString(16)); - * console.log('buffer[2]: ' + buffer[2].toString(16)); - * console.log('buffer[3]: ' + buffer[3].toString(16)); - * console.log('buffer[4]: ' + buffer[4].toString(16)); - * console.log('buffer[5]: ' + buffer[5].toString(16)); - * console.log('buffer[6]: ' + buffer[6].toString(16)); - * console.log('buffer[7]: ' + buffer[7].toString(16)); - */ - -function testfloat() -{ - var buffer = new Buffer(4); - mod_ctype.wfloat(0, 'big', buffer, 0); - /* Start off with some of the easy ones: +zero */ - ASSERT.equal(0, buffer[0]); - ASSERT.equal(0, buffer[1]); - ASSERT.equal(0, buffer[2]); - ASSERT.equal(0, buffer[3]); - mod_ctype.wfloat(0, 'little', buffer, 0); - ASSERT.equal(0, buffer[0]); - ASSERT.equal(0, buffer[1]); - ASSERT.equal(0, buffer[2]); - ASSERT.equal(0, buffer[3]); - - /* Catch +infin */ - mod_ctype.wfloat(Number.POSITIVE_INFINITY, 'big', buffer, 0); - ASSERT.equal(0x7f, buffer[0]); - ASSERT.equal(0x80, buffer[1]); - ASSERT.equal(0x00, buffer[2]); - ASSERT.equal(0x00, buffer[3]); - mod_ctype.wfloat(Number.POSITIVE_INFINITY, 'little', buffer, 0); - ASSERT.equal(0x7f, buffer[3]); - ASSERT.equal(0x80, buffer[2]); - ASSERT.equal(0x00, buffer[1]); - ASSERT.equal(0x00, buffer[0]); - - /* Catch -infin */ - mod_ctype.wfloat(Number.NEGATIVE_INFINITY, 'big', buffer, 0); - ASSERT.equal(0xff, buffer[0]); - ASSERT.equal(0x80, buffer[1]); - ASSERT.equal(0x00, buffer[2]); - ASSERT.equal(0x00, buffer[3]); - mod_ctype.wfloat(Number.NEGATIVE_INFINITY, 'little', buffer, 0); - ASSERT.equal(0xff, buffer[3]); - ASSERT.equal(0x80, buffer[2]); - ASSERT.equal(0x00, buffer[1]); - ASSERT.equal(0x00, buffer[0]); - - /* Catch NaN */ - - /* - * NaN Is a litle weird in its requirements, so we're going to encode a - * bit of how we actually implement it into this test. Probably not the - * best, since technically the sign is a don't care and the mantissa - * needs to just be non-zero. - */ - mod_ctype.wfloat(NaN, 'big', buffer, 0); - ASSERT.equal(0x7f, buffer[0]); - ASSERT.equal(0x80, buffer[1]); - ASSERT.equal(0x00, buffer[2]); - ASSERT.equal(0x17, buffer[3]); - mod_ctype.wfloat(NaN, 'little', buffer, 0); - ASSERT.equal(0x7f, buffer[3]); - ASSERT.equal(0x80, buffer[2]); - ASSERT.equal(0x00, buffer[1]); - ASSERT.equal(0x17, buffer[0]); - - /* On to some basic tests */ - /* 1.125 */ - mod_ctype.wfloat(1.125, 'big', buffer, 0); - ASSERT.equal(0x3f, buffer[0]); - ASSERT.equal(0x90, buffer[1]); - ASSERT.equal(0x00, buffer[2]); - ASSERT.equal(0x00, buffer[3]); - mod_ctype.wfloat(1.125, 'little', buffer, 0); - ASSERT.equal(0x3f, buffer[3]); - ASSERT.equal(0x90, buffer[2]); - ASSERT.equal(0x00, buffer[1]); - ASSERT.equal(0x00, buffer[0]); - - mod_ctype.wfloat(1.0000001192092896, 'big', buffer, 0); - ASSERT.equal(0x3f, buffer[0]); - ASSERT.equal(0x80, buffer[1]); - ASSERT.equal(0x00, buffer[2]); - ASSERT.equal(0x01, buffer[3]); - mod_ctype.wfloat(1.0000001192092896, 'little', buffer, 0); - ASSERT.equal(0x3f, buffer[3]); - ASSERT.equal(0x80, buffer[2]); - ASSERT.equal(0x00, buffer[1]); - ASSERT.equal(0x01, buffer[0]); - - mod_ctype.wfloat(1.0000001192092896, 'big', buffer, 0); - ASSERT.equal(0x3f, buffer[0]); - ASSERT.equal(0x80, buffer[1]); - ASSERT.equal(0x00, buffer[2]); - ASSERT.equal(0x01, buffer[3]); - mod_ctype.wfloat(1.0000001192092896, 'little', buffer, 0); - ASSERT.equal(0x3f, buffer[3]); - ASSERT.equal(0x80, buffer[2]); - ASSERT.equal(0x00, buffer[1]); - ASSERT.equal(0x01, buffer[0]); - - mod_ctype.wfloat(2.3283067140944524e-10, 'big', buffer, 0); - ASSERT.equal(0x2f, buffer[0]); - ASSERT.equal(0x80, buffer[1]); - ASSERT.equal(0x00, buffer[2]); - ASSERT.equal(0x01, buffer[3]); - mod_ctype.wfloat(2.3283067140944524e-10, 'little', buffer, 0); - ASSERT.equal(0x2f, buffer[3]); - ASSERT.equal(0x80, buffer[2]); - ASSERT.equal(0x00, buffer[1]); - ASSERT.equal(0x01, buffer[0]); - - /* ff34a2b0 -2.4010576103645774e+38 */ - mod_ctype.wfloat(-2.4010576103645774e+38, - 'big', buffer, 0); - ASSERT.equal(0xff, buffer[0]); - ASSERT.equal(0x34, buffer[1]); - ASSERT.equal(0xa2, buffer[2]); - ASSERT.equal(0xb0, buffer[3]); - mod_ctype.wfloat(-2.4010576103645774e+38, - 'little', buffer, 0); - ASSERT.equal(0xff, buffer[3]); - ASSERT.equal(0x34, buffer[2]); - ASSERT.equal(0xa2, buffer[1]); - ASSERT.equal(0xb0, buffer[0]); - - /* Denormalized tests */ - - /* 0003f89a +/- 3.6468792534053364e-40 */ - mod_ctype.wfloat(3.6468792534053364e-40, - 'big', buffer, 0); - ASSERT.equal(0x00, buffer[0]); - ASSERT.equal(0x03, buffer[1]); - ASSERT.equal(0xf8, buffer[2]); - ASSERT.equal(0x9a, buffer[3]); - mod_ctype.wfloat(3.6468792534053364e-40, - 'little', buffer, 0); - ASSERT.equal(0x00, buffer[3]); - ASSERT.equal(0x03, buffer[2]); - ASSERT.equal(0xf8, buffer[1]); - ASSERT.equal(0x9a, buffer[0]); - - mod_ctype.wfloat(-3.6468792534053364e-40, - 'big', buffer, 0); - ASSERT.equal(0x80, buffer[0]); - ASSERT.equal(0x03, buffer[1]); - ASSERT.equal(0xf8, buffer[2]); - ASSERT.equal(0x9a, buffer[3]); - mod_ctype.wfloat(-3.6468792534053364e-40, - 'little', buffer, 0); - ASSERT.equal(0x80, buffer[3]); - ASSERT.equal(0x03, buffer[2]); - ASSERT.equal(0xf8, buffer[1]); - ASSERT.equal(0x9a, buffer[0]); - - /* Maximum and minimum normalized and denormalized values */ - - /* Largest normalized number +/- 3.4028234663852886e+38 */ - - mod_ctype.wfloat(3.4028234663852886e+38, - 'big', buffer, 0); - ASSERT.equal(0x7f, buffer[0]); - ASSERT.equal(0x7f, buffer[1]); - ASSERT.equal(0xff, buffer[2]); - ASSERT.equal(0xff, buffer[3]); - mod_ctype.wfloat(3.4028234663852886e+38, - 'little', buffer, 0); - ASSERT.equal(0x7f, buffer[3]); - ASSERT.equal(0x7f, buffer[2]); - ASSERT.equal(0xff, buffer[1]); - ASSERT.equal(0xff, buffer[0]); - - mod_ctype.wfloat(-3.4028234663852886e+38, - 'big', buffer, 0); - ASSERT.equal(0xff, buffer[0]); - ASSERT.equal(0x7f, buffer[1]); - ASSERT.equal(0xff, buffer[2]); - ASSERT.equal(0xff, buffer[3]); - mod_ctype.wfloat(-3.4028234663852886e+38, - 'little', buffer, 0); - ASSERT.equal(0xff, buffer[3]); - ASSERT.equal(0x7f, buffer[2]); - ASSERT.equal(0xff, buffer[1]); - ASSERT.equal(0xff, buffer[0]); - - /* Smallest normalied number +/- 1.1754943508222875e-38 */ - - mod_ctype.wfloat(1.1754943508222875e-38, - 'big', buffer, 0); - ASSERT.equal(0x00, buffer[0]); - ASSERT.equal(0x80, buffer[1]); - ASSERT.equal(0x00, buffer[2]); - ASSERT.equal(0x00, buffer[3]); - mod_ctype.wfloat(1.1754943508222875e-38, - 'little', buffer, 0); - ASSERT.equal(0x00, buffer[3]); - ASSERT.equal(0x80, buffer[2]); - ASSERT.equal(0x00, buffer[1]); - ASSERT.equal(0x00, buffer[0]); - - mod_ctype.wfloat(-1.1754943508222875e-38, - 'big', buffer, 0); - ASSERT.equal(0x80, buffer[0]); - ASSERT.equal(0x80, buffer[1]); - ASSERT.equal(0x00, buffer[2]); - ASSERT.equal(0x00, buffer[3]); - mod_ctype.wfloat(-1.1754943508222875e-38, - 'little', buffer, 0); - ASSERT.equal(0x80, buffer[3]); - ASSERT.equal(0x80, buffer[2]); - ASSERT.equal(0x00, buffer[1]); - ASSERT.equal(0x00, buffer[0]); - - /* Smallest denormalized number 1.401298464324817e-45 */ - mod_ctype.wfloat(1.401298464324817e-45, - 'big', buffer, 0); - ASSERT.equal(0x00, buffer[0]); - ASSERT.equal(0x00, buffer[1]); - ASSERT.equal(0x00, buffer[2]); - ASSERT.equal(0x01, buffer[3]); - mod_ctype.wfloat(1.401298464324817e-45, - 'little', buffer, 0); - ASSERT.equal(0x00, buffer[3]); - ASSERT.equal(0x00, buffer[2]); - ASSERT.equal(0x00, buffer[1]); - ASSERT.equal(0x01, buffer[0]); - - mod_ctype.wfloat(-1.401298464324817e-45, - 'big', buffer, 0); - ASSERT.equal(0x80, buffer[0]); - ASSERT.equal(0x00, buffer[1]); - ASSERT.equal(0x00, buffer[2]); - ASSERT.equal(0x01, buffer[3]); - mod_ctype.wfloat(-1.401298464324817e-45, - 'little', buffer, 0); - ASSERT.equal(0x80, buffer[3]); - ASSERT.equal(0x00, buffer[2]); - ASSERT.equal(0x00, buffer[1]); - ASSERT.equal(0x01, buffer[0]); - - /* Largest denormalized value +/- 1.1754942106924411e-38 */ - - mod_ctype.wfloat(1.1754942106924411e-38, - 'big', buffer, 0); - ASSERT.equal(0x00, buffer[0]); - ASSERT.equal(0x7f, buffer[1]); - ASSERT.equal(0xff, buffer[2]); - ASSERT.equal(0xff, buffer[3]); - mod_ctype.wfloat(1.1754942106924411e-38, - 'little', buffer, 0); - ASSERT.equal(0x00, buffer[3]); - ASSERT.equal(0x7f, buffer[2]); - ASSERT.equal(0xff, buffer[1]); - ASSERT.equal(0xff, buffer[0]); - - mod_ctype.wfloat(-1.1754942106924411e-38, - 'big', buffer, 0); - ASSERT.equal(0x80, buffer[0]); - ASSERT.equal(0x7f, buffer[1]); - ASSERT.equal(0xff, buffer[2]); - ASSERT.equal(0xff, buffer[3]); - mod_ctype.wfloat(-1.1754942106924411e-38, - 'little', buffer, 0); - ASSERT.equal(0x80, buffer[3]); - ASSERT.equal(0x7f, buffer[2]); - ASSERT.equal(0xff, buffer[1]); - ASSERT.equal(0xff, buffer[0]); - - /* Do some quick offset testing */ - buffer = new Buffer(6); - mod_ctype.wfloat(-1.2027516403607578e-32, - 'big', buffer, 2); - ASSERT.equal(0x8a, buffer[2]); - ASSERT.equal(0x79, buffer[3]); - ASSERT.equal(0xcd, buffer[4]); - ASSERT.equal(0x3f, buffer[5]); - - mod_ctype.wfloat(-1.2027516403607578e-32, - 'little', buffer, 2); - ASSERT.equal(0x8a, buffer[5]); - ASSERT.equal(0x79, buffer[4]); - ASSERT.equal(0xcd, buffer[3]); - ASSERT.equal(0x3f, buffer[2]); - -} - -function testdouble() -{ - var buffer = new Buffer(10); - - /* Check 0 */ - mod_ctype.wdouble(0, 'big', buffer, 0); - ASSERT.equal(0x00, buffer[0]); - ASSERT.equal(0x00, buffer[1]); - ASSERT.equal(0x00, buffer[2]); - ASSERT.equal(0x00, buffer[3]); - ASSERT.equal(0x00, buffer[4]); - ASSERT.equal(0x00, buffer[5]); - ASSERT.equal(0x00, buffer[6]); - ASSERT.equal(0x00, buffer[7]); - mod_ctype.wdouble(0, 'little', buffer, 0); - ASSERT.equal(0x00, buffer[7]); - ASSERT.equal(0x00, buffer[6]); - ASSERT.equal(0x00, buffer[5]); - ASSERT.equal(0x00, buffer[4]); - ASSERT.equal(0x00, buffer[3]); - ASSERT.equal(0x00, buffer[2]); - ASSERT.equal(0x00, buffer[1]); - ASSERT.equal(0x00, buffer[0]); - - /* Check NaN */ - /* Similar to floats we are only generating a subset of values */ - mod_ctype.wdouble(NaN, 'big', buffer, 0); - ASSERT.equal(0x7f, buffer[0]); - ASSERT.equal(0xf0, buffer[1]); - ASSERT.equal(0x00, buffer[2]); - ASSERT.equal(0x00, buffer[3]); - ASSERT.equal(0x00, buffer[4]); - ASSERT.equal(0x00, buffer[5]); - ASSERT.equal(0x00, buffer[6]); - ASSERT.equal(0x17, buffer[7]); - mod_ctype.wdouble(NaN, 'little', buffer, 0); - ASSERT.equal(0x7f, buffer[7]); - ASSERT.equal(0xf0, buffer[6]); - ASSERT.equal(0x00, buffer[5]); - ASSERT.equal(0x00, buffer[4]); - ASSERT.equal(0x00, buffer[3]); - ASSERT.equal(0x00, buffer[2]); - ASSERT.equal(0x00, buffer[1]); - ASSERT.equal(0x17, buffer[0]); - - /* pos inf */ - mod_ctype.wdouble(Number.POSITIVE_INFINITY, - 'big', buffer, 0); - ASSERT.equal(0x7f, buffer[0]); - ASSERT.equal(0xf0, buffer[1]); - ASSERT.equal(0x00, buffer[2]); - ASSERT.equal(0x00, buffer[3]); - ASSERT.equal(0x00, buffer[4]); - ASSERT.equal(0x00, buffer[5]); - ASSERT.equal(0x00, buffer[6]); - ASSERT.equal(0x00, buffer[7]); - mod_ctype.wdouble(Number.POSITIVE_INFINITY, - 'little', buffer, 0); - ASSERT.equal(0x7f, buffer[7]); - ASSERT.equal(0xf0, buffer[6]); - ASSERT.equal(0x00, buffer[5]); - ASSERT.equal(0x00, buffer[4]); - ASSERT.equal(0x00, buffer[3]); - ASSERT.equal(0x00, buffer[2]); - ASSERT.equal(0x00, buffer[1]); - ASSERT.equal(0x00, buffer[0]); - - /* neg inf */ - mod_ctype.wdouble(Number.NEGATIVE_INFINITY, - 'big', buffer, 0); - ASSERT.equal(0xff, buffer[0]); - ASSERT.equal(0xf0, buffer[1]); - ASSERT.equal(0x00, buffer[2]); - ASSERT.equal(0x00, buffer[3]); - ASSERT.equal(0x00, buffer[4]); - ASSERT.equal(0x00, buffer[5]); - ASSERT.equal(0x00, buffer[6]); - ASSERT.equal(0x00, buffer[7]); - mod_ctype.wdouble(Number.NEGATIVE_INFINITY, - 'little', buffer, 0); - ASSERT.equal(0xff, buffer[7]); - ASSERT.equal(0xf0, buffer[6]); - ASSERT.equal(0x00, buffer[5]); - ASSERT.equal(0x00, buffer[4]); - ASSERT.equal(0x00, buffer[3]); - ASSERT.equal(0x00, buffer[2]); - ASSERT.equal(0x00, buffer[1]); - ASSERT.equal(0x00, buffer[0]); - - /* Simple normalized values */ - - /* +/- 1.125 */ - mod_ctype.wdouble(1.125, - 'big', buffer, 0); - ASSERT.equal(0x3f, buffer[0]); - ASSERT.equal(0xf2, buffer[1]); - ASSERT.equal(0x00, buffer[2]); - ASSERT.equal(0x00, buffer[3]); - ASSERT.equal(0x00, buffer[4]); - ASSERT.equal(0x00, buffer[5]); - ASSERT.equal(0x00, buffer[6]); - ASSERT.equal(0x00, buffer[7]); - - mod_ctype.wdouble(1.125, - 'little', buffer, 0); - ASSERT.equal(0x3f, buffer[7]); - ASSERT.equal(0xf2, buffer[6]); - ASSERT.equal(0x00, buffer[5]); - ASSERT.equal(0x00, buffer[4]); - ASSERT.equal(0x00, buffer[3]); - ASSERT.equal(0x00, buffer[2]); - ASSERT.equal(0x00, buffer[1]); - ASSERT.equal(0x00, buffer[0]); - - mod_ctype.wdouble(-1.125, - 'big', buffer, 0); - ASSERT.equal(0xbf, buffer[0]); - ASSERT.equal(0xf2, buffer[1]); - ASSERT.equal(0x00, buffer[2]); - ASSERT.equal(0x00, buffer[3]); - ASSERT.equal(0x00, buffer[4]); - ASSERT.equal(0x00, buffer[5]); - ASSERT.equal(0x00, buffer[6]); - ASSERT.equal(0x00, buffer[7]); - - mod_ctype.wdouble(-1.125, - 'little', buffer, 0); - ASSERT.equal(0xbf, buffer[7]); - ASSERT.equal(0xf2, buffer[6]); - ASSERT.equal(0x00, buffer[5]); - ASSERT.equal(0x00, buffer[4]); - ASSERT.equal(0x00, buffer[3]); - ASSERT.equal(0x00, buffer[2]); - ASSERT.equal(0x00, buffer[1]); - ASSERT.equal(0x00, buffer[0]); - - - /* +/- 1.4397318913736026e+283 */ - mod_ctype.wdouble(1.4397318913736026e+283, - 'big', buffer, 0); - ASSERT.equal(0x7a, buffer[0]); - ASSERT.equal(0xb8, buffer[1]); - ASSERT.equal(0xc9, buffer[2]); - ASSERT.equal(0x34, buffer[3]); - ASSERT.equal(0x72, buffer[4]); - ASSERT.equal(0x16, buffer[5]); - ASSERT.equal(0xf9, buffer[6]); - ASSERT.equal(0x0e, buffer[7]); - - mod_ctype.wdouble(1.4397318913736026e+283, - 'little', buffer, 0); - ASSERT.equal(0x7a, buffer[7]); - ASSERT.equal(0xb8, buffer[6]); - ASSERT.equal(0xc9, buffer[5]); - ASSERT.equal(0x34, buffer[4]); - ASSERT.equal(0x72, buffer[3]); - ASSERT.equal(0x16, buffer[2]); - ASSERT.equal(0xf9, buffer[1]); - ASSERT.equal(0x0e, buffer[0]); - - mod_ctype.wdouble(-1.4397318913736026e+283, - 'big', buffer, 0); - ASSERT.equal(0xfa, buffer[0]); - ASSERT.equal(0xb8, buffer[1]); - ASSERT.equal(0xc9, buffer[2]); - ASSERT.equal(0x34, buffer[3]); - ASSERT.equal(0x72, buffer[4]); - ASSERT.equal(0x16, buffer[5]); - ASSERT.equal(0xf9, buffer[6]); - ASSERT.equal(0x0e, buffer[7]); - - mod_ctype.wdouble(-1.4397318913736026e+283, - 'little', buffer, 0); - ASSERT.equal(0xfa, buffer[7]); - ASSERT.equal(0xb8, buffer[6]); - ASSERT.equal(0xc9, buffer[5]); - ASSERT.equal(0x34, buffer[4]); - ASSERT.equal(0x72, buffer[3]); - ASSERT.equal(0x16, buffer[2]); - ASSERT.equal(0xf9, buffer[1]); - ASSERT.equal(0x0e, buffer[0]); - - /* Denormalized values */ - /* +/- 8.82521232268344e-309 */ - mod_ctype.wdouble(8.82521232268344e-309, - 'big', buffer, 0); - ASSERT.equal(0x00, buffer[0]); - ASSERT.equal(0x06, buffer[1]); - ASSERT.equal(0x58, buffer[2]); - ASSERT.equal(0x94, buffer[3]); - ASSERT.equal(0x13, buffer[4]); - ASSERT.equal(0x27, buffer[5]); - ASSERT.equal(0x8a, buffer[6]); - ASSERT.equal(0xcd, buffer[7]); - - mod_ctype.wdouble(8.82521232268344e-309, - 'little', buffer, 0); - ASSERT.equal(0x00, buffer[7]); - ASSERT.equal(0x06, buffer[6]); - ASSERT.equal(0x58, buffer[5]); - ASSERT.equal(0x94, buffer[4]); - ASSERT.equal(0x13, buffer[3]); - ASSERT.equal(0x27, buffer[2]); - ASSERT.equal(0x8a, buffer[1]); - ASSERT.equal(0xcd, buffer[0]); - - mod_ctype.wdouble(-8.82521232268344e-309, - 'big', buffer, 0); - ASSERT.equal(0x80, buffer[0]); - ASSERT.equal(0x06, buffer[1]); - ASSERT.equal(0x58, buffer[2]); - ASSERT.equal(0x94, buffer[3]); - ASSERT.equal(0x13, buffer[4]); - ASSERT.equal(0x27, buffer[5]); - ASSERT.equal(0x8a, buffer[6]); - ASSERT.equal(0xcd, buffer[7]); - - mod_ctype.wdouble(-8.82521232268344e-309, - 'little', buffer, 0); - ASSERT.equal(0x80, buffer[7]); - ASSERT.equal(0x06, buffer[6]); - ASSERT.equal(0x58, buffer[5]); - ASSERT.equal(0x94, buffer[4]); - ASSERT.equal(0x13, buffer[3]); - ASSERT.equal(0x27, buffer[2]); - ASSERT.equal(0x8a, buffer[1]); - ASSERT.equal(0xcd, buffer[0]); - - - /* Edge cases, maximum and minimum values */ - - /* Smallest denormalized value 5e-324 */ - mod_ctype.wdouble(5e-324, - 'big', buffer, 0); - ASSERT.equal(0x00, buffer[0]); - ASSERT.equal(0x00, buffer[1]); - ASSERT.equal(0x00, buffer[2]); - ASSERT.equal(0x00, buffer[3]); - ASSERT.equal(0x00, buffer[4]); - ASSERT.equal(0x00, buffer[5]); - ASSERT.equal(0x00, buffer[6]); - ASSERT.equal(0x01, buffer[7]); - - mod_ctype.wdouble(5e-324, - 'little', buffer, 0); - ASSERT.equal(0x00, buffer[7]); - ASSERT.equal(0x00, buffer[6]); - ASSERT.equal(0x00, buffer[5]); - ASSERT.equal(0x00, buffer[4]); - ASSERT.equal(0x00, buffer[3]); - ASSERT.equal(0x00, buffer[2]); - ASSERT.equal(0x00, buffer[1]); - ASSERT.equal(0x01, buffer[0]); - - mod_ctype.wdouble(-5e-324, - 'big', buffer, 0); - ASSERT.equal(0x80, buffer[0]); - ASSERT.equal(0x00, buffer[1]); - ASSERT.equal(0x00, buffer[2]); - ASSERT.equal(0x00, buffer[3]); - ASSERT.equal(0x00, buffer[4]); - ASSERT.equal(0x00, buffer[5]); - ASSERT.equal(0x00, buffer[6]); - ASSERT.equal(0x01, buffer[7]); - - mod_ctype.wdouble(-5e-324, - 'little', buffer, 0); - ASSERT.equal(0x80, buffer[7]); - ASSERT.equal(0x00, buffer[6]); - ASSERT.equal(0x00, buffer[5]); - ASSERT.equal(0x00, buffer[4]); - ASSERT.equal(0x00, buffer[3]); - ASSERT.equal(0x00, buffer[2]); - ASSERT.equal(0x00, buffer[1]); - ASSERT.equal(0x01, buffer[0]); - - - - /* Largest denormalized value 2.225073858507201e-308 */ - mod_ctype.wdouble(2.225073858507201e-308, - 'big', buffer, 0); - ASSERT.equal(0x00, buffer[0]); - ASSERT.equal(0x0f, buffer[1]); - ASSERT.equal(0xff, buffer[2]); - ASSERT.equal(0xff, buffer[3]); - ASSERT.equal(0xff, buffer[4]); - ASSERT.equal(0xff, buffer[5]); - ASSERT.equal(0xff, buffer[6]); - ASSERT.equal(0xff, buffer[7]); - - mod_ctype.wdouble(2.225073858507201e-308, - 'little', buffer, 0); - ASSERT.equal(0x00, buffer[7]); - ASSERT.equal(0x0f, buffer[6]); - ASSERT.equal(0xff, buffer[5]); - ASSERT.equal(0xff, buffer[4]); - ASSERT.equal(0xff, buffer[3]); - ASSERT.equal(0xff, buffer[2]); - ASSERT.equal(0xff, buffer[1]); - ASSERT.equal(0xff, buffer[0]); - - mod_ctype.wdouble(-2.225073858507201e-308, - 'big', buffer, 0); - ASSERT.equal(0x80, buffer[0]); - ASSERT.equal(0x0f, buffer[1]); - ASSERT.equal(0xff, buffer[2]); - ASSERT.equal(0xff, buffer[3]); - ASSERT.equal(0xff, buffer[4]); - ASSERT.equal(0xff, buffer[5]); - ASSERT.equal(0xff, buffer[6]); - ASSERT.equal(0xff, buffer[7]); - - mod_ctype.wdouble(-2.225073858507201e-308, - 'little', buffer, 0); - ASSERT.equal(0x80, buffer[7]); - ASSERT.equal(0x0f, buffer[6]); - ASSERT.equal(0xff, buffer[5]); - ASSERT.equal(0xff, buffer[4]); - ASSERT.equal(0xff, buffer[3]); - ASSERT.equal(0xff, buffer[2]); - ASSERT.equal(0xff, buffer[1]); - ASSERT.equal(0xff, buffer[0]); - - - /* Smallest normalized value 2.2250738585072014e-308 */ - mod_ctype.wdouble(2.2250738585072014e-308, - 'big', buffer, 0); - ASSERT.equal(0x00, buffer[0]); - ASSERT.equal(0x10, buffer[1]); - ASSERT.equal(0x00, buffer[2]); - ASSERT.equal(0x00, buffer[3]); - ASSERT.equal(0x00, buffer[4]); - ASSERT.equal(0x00, buffer[5]); - ASSERT.equal(0x00, buffer[6]); - ASSERT.equal(0x00, buffer[7]); - - mod_ctype.wdouble(2.2250738585072014e-308, - 'little', buffer, 0); - ASSERT.equal(0x00, buffer[7]); - ASSERT.equal(0x10, buffer[6]); - ASSERT.equal(0x00, buffer[5]); - ASSERT.equal(0x00, buffer[4]); - ASSERT.equal(0x00, buffer[3]); - ASSERT.equal(0x00, buffer[2]); - ASSERT.equal(0x00, buffer[1]); - ASSERT.equal(0x00, buffer[0]); - - mod_ctype.wdouble(-2.2250738585072014e-308, - 'big', buffer, 0); - ASSERT.equal(0x80, buffer[0]); - ASSERT.equal(0x10, buffer[1]); - ASSERT.equal(0x00, buffer[2]); - ASSERT.equal(0x00, buffer[3]); - ASSERT.equal(0x00, buffer[4]); - ASSERT.equal(0x00, buffer[5]); - ASSERT.equal(0x00, buffer[6]); - ASSERT.equal(0x00, buffer[7]); - - mod_ctype.wdouble(-2.2250738585072014e-308, - 'little', buffer, 0); - ASSERT.equal(0x80, buffer[7]); - ASSERT.equal(0x10, buffer[6]); - ASSERT.equal(0x00, buffer[5]); - ASSERT.equal(0x00, buffer[4]); - ASSERT.equal(0x00, buffer[3]); - ASSERT.equal(0x00, buffer[2]); - ASSERT.equal(0x00, buffer[1]); - ASSERT.equal(0x00, buffer[0]); - - - /* Largest normalized value 1.7976931348623157e+308 */ - mod_ctype.wdouble(1.7976931348623157e+308, - 'big', buffer, 0); - ASSERT.equal(0x7f, buffer[0]); - ASSERT.equal(0xef, buffer[1]); - ASSERT.equal(0xff, buffer[2]); - ASSERT.equal(0xff, buffer[3]); - ASSERT.equal(0xff, buffer[4]); - ASSERT.equal(0xff, buffer[5]); - ASSERT.equal(0xff, buffer[6]); - ASSERT.equal(0xff, buffer[7]); - - mod_ctype.wdouble(1.7976931348623157e+308, - 'little', buffer, 0); - ASSERT.equal(0x7f, buffer[7]); - ASSERT.equal(0xef, buffer[6]); - ASSERT.equal(0xff, buffer[5]); - ASSERT.equal(0xff, buffer[4]); - ASSERT.equal(0xff, buffer[3]); - ASSERT.equal(0xff, buffer[2]); - ASSERT.equal(0xff, buffer[1]); - ASSERT.equal(0xff, buffer[0]); - - mod_ctype.wdouble(-1.7976931348623157e+308, - 'big', buffer, 0); - ASSERT.equal(0xff, buffer[0]); - ASSERT.equal(0xef, buffer[1]); - ASSERT.equal(0xff, buffer[2]); - ASSERT.equal(0xff, buffer[3]); - ASSERT.equal(0xff, buffer[4]); - ASSERT.equal(0xff, buffer[5]); - ASSERT.equal(0xff, buffer[6]); - ASSERT.equal(0xff, buffer[7]); - - mod_ctype.wdouble(-1.7976931348623157e+308, - 'little', buffer, 0); - ASSERT.equal(0xff, buffer[7]); - ASSERT.equal(0xef, buffer[6]); - ASSERT.equal(0xff, buffer[5]); - ASSERT.equal(0xff, buffer[4]); - ASSERT.equal(0xff, buffer[3]); - ASSERT.equal(0xff, buffer[2]); - ASSERT.equal(0xff, buffer[1]); - ASSERT.equal(0xff, buffer[0]); - - - /* Try offsets */ - buffer[0] = 0xde; - buffer[1] = 0xad; - buffer[2] = 0xbe; - buffer[3] = 0xef; - buffer[4] = 0xba; - buffer[5] = 0xdd; - buffer[6] = 0xca; - buffer[7] = 0xfe; - buffer[8] = 0x16; - buffer[9] = 0x79; - - mod_ctype.wdouble(-0.000015130017658081283, - 'big', buffer, 2); - ASSERT.equal(0xbe, buffer[2]); - ASSERT.equal(0xef, buffer[3]); - ASSERT.equal(0xba, buffer[4]); - ASSERT.equal(0xdd, buffer[5]); - ASSERT.equal(0xca, buffer[6]); - ASSERT.equal(0xfe, buffer[7]); - ASSERT.equal(0x16, buffer[8]); - ASSERT.equal(0x79, buffer[9]); - - mod_ctype.wdouble(-0.000015130017658081283, - 'little', buffer, 2); - ASSERT.equal(0xbe, buffer[9]); - ASSERT.equal(0xef, buffer[8]); - ASSERT.equal(0xba, buffer[7]); - ASSERT.equal(0xdd, buffer[6]); - ASSERT.equal(0xca, buffer[5]); - ASSERT.equal(0xfe, buffer[4]); - ASSERT.equal(0x16, buffer[3]); - ASSERT.equal(0x79, buffer[2]); -} - -testfloat(); -testdouble(); diff --git a/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/http-signature/node_modules/ctype/tst/ctio/int/tst.64.js b/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/http-signature/node_modules/ctype/tst/ctio/int/tst.64.js deleted file mode 100644 index 1ffdac0..0000000 --- a/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/http-signature/node_modules/ctype/tst/ctio/int/tst.64.js +++ /dev/null @@ -1,638 +0,0 @@ -/* - * Test our ability to read and write signed 64-bit integers. - */ - -var mod_ctype = require('../../../ctio.js'); -var ASSERT = require('assert'); - -function testRead() -{ - var res, data; - data = new Buffer(10); - - data[0] = 0x32; - data[1] = 0x65; - data[2] = 0x42; - data[3] = 0x56; - data[4] = 0x23; - data[5] = 0xff; - data[6] = 0xff; - data[7] = 0xff; - data[8] = 0x89; - data[9] = 0x11; - res = mod_ctype.rsint64(data, 'big', 0); - ASSERT.equal(0x32654256, res[0]); - ASSERT.equal(0x23ffffff, res[1]); - res = mod_ctype.rsint64(data, 'big', 1); - ASSERT.equal(0x65425623, res[0]); - ASSERT.equal(0xffffff89, res[1]); - res = mod_ctype.rsint64(data, 'big', 2); - ASSERT.equal(0x425623ff, res[0]); - ASSERT.equal(0xffff8911, res[1]); - res = mod_ctype.rsint64(data, 'little', 0); - ASSERT.equal(-0x000000dc, res[0]); - ASSERT.equal(-0xa9bd9ace, res[1]); - res = mod_ctype.rsint64(data, 'little', 1); - ASSERT.equal(-0x76000000, res[0]); - ASSERT.equal(-0xdca9bd9b, res[1]); - res = mod_ctype.rsint64(data, 'little', 2); - ASSERT.equal(0x1189ffff, res[0]); - ASSERT.equal(0xff235642, res[1]); - - data.fill(0x00); - res = mod_ctype.rsint64(data, 'big', 0); - ASSERT.equal(0x00000000, res[0]); - ASSERT.equal(0x00000000, res[1]); - res = mod_ctype.rsint64(data, 'big', 1); - ASSERT.equal(0x00000000, res[0]); - ASSERT.equal(0x00000000, res[1]); - res = mod_ctype.rsint64(data, 'big', 2); - ASSERT.equal(0x00000000, res[0]); - ASSERT.equal(0x00000000, res[1]); - res = mod_ctype.rsint64(data, 'little', 0); - ASSERT.equal(0x00000000, res[0]); - ASSERT.equal(0x00000000, res[1]); - res = mod_ctype.rsint64(data, 'little', 1); - ASSERT.equal(0x00000000, res[0]); - ASSERT.equal(0x00000000, res[1]); - res = mod_ctype.rsint64(data, 'little', 2); - ASSERT.equal(0x00000000, res[0]); - ASSERT.equal(0x00000000, res[1]); - - data.fill(0xff); - res = mod_ctype.rsint64(data, 'big', 0); - ASSERT.equal(0x00000000, res[0]); - ASSERT.equal(-1, res[1]); - res = mod_ctype.rsint64(data, 'big', 1); - ASSERT.equal(0x00000000, res[0]); - ASSERT.equal(-1, res[1]); - res = mod_ctype.rsint64(data, 'big', 2); - ASSERT.equal(0x00000000, res[0]); - ASSERT.equal(-1, res[1]); - res = mod_ctype.rsint64(data, 'little', 0); - ASSERT.equal(0x00000000, res[0]); - ASSERT.equal(-1, res[1]); - res = mod_ctype.rsint64(data, 'little', 1); - ASSERT.equal(0x00000000, res[0]); - ASSERT.equal(-1, res[1]); - res = mod_ctype.rsint64(data, 'little', 2); - ASSERT.equal(0x00000000, res[0]); - ASSERT.equal(-1, res[1]); - - data[0] = 0x80; - data[1] = 0x00; - data[2] = 0x00; - data[3] = 0x00; - data[4] = 0x00; - data[5] = 0x00; - data[6] = 0x00; - data[7] = 0x00; - res = mod_ctype.rsint64(data, 'big', 0); - ASSERT.equal(-0x80000000, res[0]); - ASSERT.equal(0, res[1]); - - - data[7] = 0x80; - data[6] = 0x00; - data[5] = 0x00; - data[4] = 0x00; - data[3] = 0x00; - data[2] = 0x00; - data[1] = 0x00; - data[0] = 0x00; - res = mod_ctype.rsint64(data, 'little', 0); - ASSERT.equal(-0x80000000, res[0]); - ASSERT.equal(0, res[1]); - - data[0] = 0x80; - data[1] = 0x00; - data[2] = 0x00; - data[3] = 0x00; - data[4] = 0x00; - data[5] = 0x00; - data[6] = 0x00; - data[7] = 0x01; - res = mod_ctype.rsint64(data, 'big', 0); - ASSERT.equal(-0x7fffffff, res[0]); - ASSERT.equal(-0xffffffff, res[1]); - - -} - -function testWriteZero() -{ - var data, buf; - buf = new Buffer(10); - - buf.fill(0x66); - data = [0, 0]; - mod_ctype.wsint64(data, 'big', buf, 0); - ASSERT.equal(0, buf[0]); - ASSERT.equal(0, buf[1]); - ASSERT.equal(0, buf[2]); - ASSERT.equal(0, buf[3]); - ASSERT.equal(0, buf[4]); - ASSERT.equal(0, buf[5]); - ASSERT.equal(0, buf[6]); - ASSERT.equal(0, buf[7]); - ASSERT.equal(0x66, buf[8]); - ASSERT.equal(0x66, buf[9]); - - buf.fill(0x66); - data = [0, 0]; - mod_ctype.wsint64(data, 'big', buf, 1); - ASSERT.equal(0x66, buf[0]); - ASSERT.equal(0, buf[1]); - ASSERT.equal(0, buf[2]); - ASSERT.equal(0, buf[3]); - ASSERT.equal(0, buf[4]); - ASSERT.equal(0, buf[5]); - ASSERT.equal(0, buf[6]); - ASSERT.equal(0, buf[7]); - ASSERT.equal(0, buf[8]); - ASSERT.equal(0x66, buf[9]); - - buf.fill(0x66); - data = [0, 0]; - mod_ctype.wsint64(data, 'big', buf, 2); - ASSERT.equal(0x66, buf[0]); - ASSERT.equal(0x66, buf[1]); - ASSERT.equal(0, buf[2]); - ASSERT.equal(0, buf[3]); - ASSERT.equal(0, buf[4]); - ASSERT.equal(0, buf[5]); - ASSERT.equal(0, buf[6]); - ASSERT.equal(0, buf[7]); - ASSERT.equal(0, buf[8]); - ASSERT.equal(0, buf[9]); - - - buf.fill(0x66); - data = [0, 0]; - mod_ctype.wsint64(data, 'little', buf, 0); - ASSERT.equal(0, buf[0]); - ASSERT.equal(0, buf[1]); - ASSERT.equal(0, buf[2]); - ASSERT.equal(0, buf[3]); - ASSERT.equal(0, buf[4]); - ASSERT.equal(0, buf[5]); - ASSERT.equal(0, buf[6]); - ASSERT.equal(0, buf[7]); - ASSERT.equal(0x66, buf[8]); - ASSERT.equal(0x66, buf[9]); - - buf.fill(0x66); - data = [0, 0]; - mod_ctype.wsint64(data, 'little', buf, 1); - ASSERT.equal(0x66, buf[0]); - ASSERT.equal(0, buf[1]); - ASSERT.equal(0, buf[2]); - ASSERT.equal(0, buf[3]); - ASSERT.equal(0, buf[4]); - ASSERT.equal(0, buf[5]); - ASSERT.equal(0, buf[6]); - ASSERT.equal(0, buf[7]); - ASSERT.equal(0, buf[8]); - ASSERT.equal(0x66, buf[9]); - - buf.fill(0x66); - data = [0, 0]; - mod_ctype.wsint64(data, 'little', buf, 2); - ASSERT.equal(0x66, buf[0]); - ASSERT.equal(0x66, buf[1]); - ASSERT.equal(0, buf[2]); - ASSERT.equal(0, buf[3]); - ASSERT.equal(0, buf[4]); - ASSERT.equal(0, buf[5]); - ASSERT.equal(0, buf[6]); - ASSERT.equal(0, buf[7]); - ASSERT.equal(0, buf[8]); - ASSERT.equal(0, buf[9]); -} - -/* - * Also include tests that are going to force us to go into a negative value and - * insure that it's written correctly. - */ -function testWrite() -{ - var data, buf; - - buf = new Buffer(10); - data = [ 0x234456, 0x87 ]; - buf.fill(0x66); - mod_ctype.wsint64(data, 'big', buf, 0); - ASSERT.equal(0x00, buf[0]); - ASSERT.equal(0x23, buf[1]); - ASSERT.equal(0x44, buf[2]); - ASSERT.equal(0x56, buf[3]); - ASSERT.equal(0x00, buf[4]); - ASSERT.equal(0x00, buf[5]); - ASSERT.equal(0x00, buf[6]); - ASSERT.equal(0x87, buf[7]); - ASSERT.equal(0x66, buf[8]); - ASSERT.equal(0x66, buf[9]); - - buf.fill(0x66); - mod_ctype.wsint64(data, 'big', buf, 1); - ASSERT.equal(0x66, buf[0]); - ASSERT.equal(0x00, buf[1]); - ASSERT.equal(0x23, buf[2]); - ASSERT.equal(0x44, buf[3]); - ASSERT.equal(0x56, buf[4]); - ASSERT.equal(0x00, buf[5]); - ASSERT.equal(0x00, buf[6]); - ASSERT.equal(0x00, buf[7]); - ASSERT.equal(0x87, buf[8]); - ASSERT.equal(0x66, buf[9]); - - buf.fill(0x66); - mod_ctype.wsint64(data, 'big', buf, 2); - ASSERT.equal(0x66, buf[0]); - ASSERT.equal(0x66, buf[1]); - ASSERT.equal(0x00, buf[2]); - ASSERT.equal(0x23, buf[3]); - ASSERT.equal(0x44, buf[4]); - ASSERT.equal(0x56, buf[5]); - ASSERT.equal(0x00, buf[6]); - ASSERT.equal(0x00, buf[7]); - ASSERT.equal(0x00, buf[8]); - ASSERT.equal(0x87, buf[9]); - - buf.fill(0x66); - mod_ctype.wsint64(data, 'little', buf, 0); - ASSERT.equal(0x87, buf[0]); - ASSERT.equal(0x00, buf[1]); - ASSERT.equal(0x00, buf[2]); - ASSERT.equal(0x00, buf[3]); - ASSERT.equal(0x56, buf[4]); - ASSERT.equal(0x44, buf[5]); - ASSERT.equal(0x23, buf[6]); - ASSERT.equal(0x00, buf[7]); - ASSERT.equal(0x66, buf[8]); - ASSERT.equal(0x66, buf[9]); - - buf.fill(0x66); - mod_ctype.wsint64(data, 'little', buf, 1); - ASSERT.equal(0x66, buf[0]); - ASSERT.equal(0x87, buf[1]); - ASSERT.equal(0x00, buf[2]); - ASSERT.equal(0x00, buf[3]); - ASSERT.equal(0x00, buf[4]); - ASSERT.equal(0x56, buf[5]); - ASSERT.equal(0x44, buf[6]); - ASSERT.equal(0x23, buf[7]); - ASSERT.equal(0x00, buf[8]); - ASSERT.equal(0x66, buf[9]); - - - buf.fill(0x66); - mod_ctype.wsint64(data, 'little', buf, 2); - ASSERT.equal(0x66, buf[0]); - ASSERT.equal(0x66, buf[1]); - ASSERT.equal(0x87, buf[2]); - ASSERT.equal(0x00, buf[3]); - ASSERT.equal(0x00, buf[4]); - ASSERT.equal(0x00, buf[5]); - ASSERT.equal(0x56, buf[6]); - ASSERT.equal(0x44, buf[7]); - ASSERT.equal(0x23, buf[8]); - ASSERT.equal(0x00, buf[9]); - - data = [0x3421, 0x34abcdba]; - buf.fill(0x66); - mod_ctype.wsint64(data, 'big', buf, 0); - ASSERT.equal(0x00, buf[0]); - ASSERT.equal(0x00, buf[1]); - ASSERT.equal(0x34, buf[2]); - ASSERT.equal(0x21, buf[3]); - ASSERT.equal(0x34, buf[4]); - ASSERT.equal(0xab, buf[5]); - ASSERT.equal(0xcd, buf[6]); - ASSERT.equal(0xba, buf[7]); - ASSERT.equal(0x66, buf[8]); - ASSERT.equal(0x66, buf[9]); - - buf.fill(0x66); - mod_ctype.wsint64(data, 'big', buf, 1); - ASSERT.equal(0x66, buf[0]); - ASSERT.equal(0x00, buf[1]); - ASSERT.equal(0x00, buf[2]); - ASSERT.equal(0x34, buf[3]); - ASSERT.equal(0x21, buf[4]); - ASSERT.equal(0x34, buf[5]); - ASSERT.equal(0xab, buf[6]); - ASSERT.equal(0xcd, buf[7]); - ASSERT.equal(0xba, buf[8]); - ASSERT.equal(0x66, buf[9]); - - buf.fill(0x66); - mod_ctype.wsint64(data, 'big', buf, 2); - ASSERT.equal(0x66, buf[0]); - ASSERT.equal(0x66, buf[1]); - ASSERT.equal(0x00, buf[2]); - ASSERT.equal(0x00, buf[3]); - ASSERT.equal(0x34, buf[4]); - ASSERT.equal(0x21, buf[5]); - ASSERT.equal(0x34, buf[6]); - ASSERT.equal(0xab, buf[7]); - ASSERT.equal(0xcd, buf[8]); - ASSERT.equal(0xba, buf[9]); - - buf.fill(0x66); - mod_ctype.wsint64(data, 'little', buf, 0); - ASSERT.equal(0xba, buf[0]); - ASSERT.equal(0xcd, buf[1]); - ASSERT.equal(0xab, buf[2]); - ASSERT.equal(0x34, buf[3]); - ASSERT.equal(0x21, buf[4]); - ASSERT.equal(0x34, buf[5]); - ASSERT.equal(0x00, buf[6]); - ASSERT.equal(0x00, buf[7]); - ASSERT.equal(0x66, buf[8]); - ASSERT.equal(0x66, buf[9]); - - buf.fill(0x66); - mod_ctype.wsint64(data, 'little', buf, 1); - ASSERT.equal(0x66, buf[0]); - ASSERT.equal(0xba, buf[1]); - ASSERT.equal(0xcd, buf[2]); - ASSERT.equal(0xab, buf[3]); - ASSERT.equal(0x34, buf[4]); - ASSERT.equal(0x21, buf[5]); - ASSERT.equal(0x34, buf[6]); - ASSERT.equal(0x00, buf[7]); - ASSERT.equal(0x00, buf[8]); - ASSERT.equal(0x66, buf[9]); - - buf.fill(0x66); - mod_ctype.wsint64(data, 'little', buf, 2); - ASSERT.equal(0x66, buf[0]); - ASSERT.equal(0x66, buf[1]); - ASSERT.equal(0xba, buf[2]); - ASSERT.equal(0xcd, buf[3]); - ASSERT.equal(0xab, buf[4]); - ASSERT.equal(0x34, buf[5]); - ASSERT.equal(0x21, buf[6]); - ASSERT.equal(0x34, buf[7]); - ASSERT.equal(0x00, buf[8]); - ASSERT.equal(0x00, buf[9]); - - - data = [ -0x80000000, 0 ]; - buf.fill(0x66); - mod_ctype.wsint64(data, 'big', buf, 0); - ASSERT.equal(0x80, buf[0]); - ASSERT.equal(0x00, buf[1]); - ASSERT.equal(0x00, buf[2]); - ASSERT.equal(0x00, buf[3]); - ASSERT.equal(0x00, buf[4]); - ASSERT.equal(0x00, buf[5]); - ASSERT.equal(0x00, buf[6]); - ASSERT.equal(0x00, buf[7]); - ASSERT.equal(0x66, buf[8]); - ASSERT.equal(0x66, buf[9]); - - buf.fill(0x66); - mod_ctype.wsint64(data, 'little', buf, 0); - ASSERT.equal(0x00, buf[0]); - ASSERT.equal(0x00, buf[1]); - ASSERT.equal(0x00, buf[2]); - ASSERT.equal(0x00, buf[3]); - ASSERT.equal(0x00, buf[4]); - ASSERT.equal(0x00, buf[5]); - ASSERT.equal(0x00, buf[6]); - ASSERT.equal(0x80, buf[7]); - ASSERT.equal(0x66, buf[8]); - ASSERT.equal(0x66, buf[9]); - - data = [ -0x7fffffff, -0xffffffff ]; - buf.fill(0x66); - mod_ctype.wsint64(data, 'big', buf, 0); - ASSERT.equal(0x80, buf[0]); - ASSERT.equal(0x00, buf[1]); - ASSERT.equal(0x00, buf[2]); - ASSERT.equal(0x00, buf[3]); - ASSERT.equal(0x00, buf[4]); - ASSERT.equal(0x00, buf[5]); - ASSERT.equal(0x00, buf[6]); - ASSERT.equal(0x01, buf[7]); - ASSERT.equal(0x66, buf[8]); - ASSERT.equal(0x66, buf[9]); - - buf.fill(0x66); - mod_ctype.wsint64(data, 'little', buf, 0); - ASSERT.equal(0x01, buf[0]); - ASSERT.equal(0x00, buf[1]); - ASSERT.equal(0x00, buf[2]); - ASSERT.equal(0x00, buf[3]); - ASSERT.equal(0x00, buf[4]); - ASSERT.equal(0x00, buf[5]); - ASSERT.equal(0x00, buf[6]); - ASSERT.equal(0x80, buf[7]); - ASSERT.equal(0x66, buf[8]); - ASSERT.equal(0x66, buf[9]); - - data = [ 0x0, -0x1]; - buf.fill(0x66); - mod_ctype.wsint64(data, 'big', buf, 0); - ASSERT.equal(0xff, buf[0]); - ASSERT.equal(0xff, buf[1]); - ASSERT.equal(0xff, buf[2]); - ASSERT.equal(0xff, buf[3]); - ASSERT.equal(0xff, buf[4]); - ASSERT.equal(0xff, buf[5]); - ASSERT.equal(0xff, buf[6]); - ASSERT.equal(0xff, buf[7]); - ASSERT.equal(0x66, buf[8]); - ASSERT.equal(0x66, buf[9]); - - buf.fill(0x66); - mod_ctype.wsint64(data, 'little', buf, 0); - ASSERT.equal(0xff, buf[0]); - ASSERT.equal(0xff, buf[1]); - ASSERT.equal(0xff, buf[2]); - ASSERT.equal(0xff, buf[3]); - ASSERT.equal(0xff, buf[4]); - ASSERT.equal(0xff, buf[5]); - ASSERT.equal(0xff, buf[6]); - ASSERT.equal(0xff, buf[7]); - ASSERT.equal(0x66, buf[8]); - ASSERT.equal(0x66, buf[9]); -} - -/* - * Make sure we catch invalid writes. - */ -function testWriteInvalid() -{ - var data, buf; - - /* Buffer too small */ - buf = new Buffer(4); - data = [ 0, 0]; - ASSERT.throws(function () { - mod_ctype.wsint64(data, 'big', buf, 0); - }, Error, 'buffer too small'); - ASSERT.throws(function () { - mod_ctype.wsint64(data, 'little', buf, 0); - }, Error, 'buffer too small'); - - /* Beyond the end of the buffer */ - buf = new Buffer(12); - data = [ 0, 0]; - ASSERT.throws(function () { - mod_ctype.wsint64(data, 'little', buf, 11); - }, Error, 'write beyond end of buffer'); - ASSERT.throws(function () { - mod_ctype.wsint64(data, 'big', buf, 11); - }, Error, 'write beyond end of buffer'); - - /* Write fractional values */ - buf = new Buffer(12); - data = [ 3.33, 0 ]; - ASSERT.throws(function () { - mod_ctype.wsint64(data, 'big', buf, 1); - }, Error, 'write fractions'); - ASSERT.throws(function () { - mod_ctype.wsint64(data, 'little', buf, 1); - }, Error, 'write fractions'); - - data = [ 0, 3.3 ]; - ASSERT.throws(function () { - mod_ctype.wsint64(data, 'big', buf, 1); - }, Error, 'write fractions'); - ASSERT.throws(function () { - mod_ctype.wsint64(data, 'little', buf, 1); - }, Error, 'write fractions'); - - data = [ -3.33, 0 ]; - ASSERT.throws(function () { - mod_ctype.wsint64(data, 'big', buf, 1); - }, Error, 'write fractions'); - ASSERT.throws(function () { - mod_ctype.wsint64(data, 'little', buf, 1); - }, Error, 'write fractions'); - - data = [ 0, -3.3 ]; - ASSERT.throws(function () { - mod_ctype.wsint64(data, 'big', buf, 1); - }, Error, 'write fractions'); - ASSERT.throws(function () { - mod_ctype.wsint64(data, 'little', buf, 1); - }, Error, 'write fractions'); - - data = [ 3.33, 2.42 ]; - ASSERT.throws(function () { - mod_ctype.wsint64(data, 'big', buf, 1); - }, Error, 'write fractions'); - ASSERT.throws(function () { - mod_ctype.wsint64(data, 'little', buf, 1); - }, Error, 'write fractions'); - - data = [ 3.33, -2.42 ]; - ASSERT.throws(function () { - mod_ctype.wsint64(data, 'big', buf, 1); - }, Error, 'write fractions'); - ASSERT.throws(function () { - mod_ctype.wsint64(data, 'little', buf, 1); - }, Error, 'write fractions'); - - data = [ -3.33, -2.42 ]; - ASSERT.throws(function () { - mod_ctype.wsint64(data, 'big', buf, 1); - }, Error, 'write fractions'); - ASSERT.throws(function () { - mod_ctype.wsint64(data, 'little', buf, 1); - }, Error, 'write fractions'); - - data = [ -3.33, 2.42 ]; - ASSERT.throws(function () { - mod_ctype.wsint64(data, 'big', buf, 1); - }, Error, 'write fractions'); - ASSERT.throws(function () { - mod_ctype.wsint64(data, 'little', buf, 1); - }, Error, 'write fractions'); - - /* Signs don't match */ - buf = new Buffer(12); - data = [ 0x800000, -0x32 ]; - ASSERT.throws(function () { - mod_ctype.wsint64(data, 'big', buf, 1); - }, Error, 'write too large'); - ASSERT.throws(function () { - mod_ctype.wsint64(data, 'little', buf, 1); - }, Error, 'write too large'); - - data = [ -0x800000, 0x32 ]; - ASSERT.throws(function () { - mod_ctype.wsint64(data, 'big', buf, 1); - }, Error, 'write too large'); - ASSERT.throws(function () { - mod_ctype.wsint64(data, 'little', buf, 1); - }, Error, 'write too large'); - - /* Write values that are too large */ - buf = new Buffer(12); - data = [ 0x80000000, 0 ]; - ASSERT.throws(function () { - mod_ctype.wsint64(data, 'big', buf, 1); - }, Error, 'write too large'); - ASSERT.throws(function () { - mod_ctype.wsint64(data, 'little', buf, 1); - }, Error, 'write too large'); - - data = [ 0x7fffffff, 0x100000000 ]; - ASSERT.throws(function () { - mod_ctype.wsint64(data, 'big', buf, 1); - }, Error, 'write too large'); - ASSERT.throws(function () { - mod_ctype.wsint64(data, 'little', buf, 1); - }, Error, 'write too large'); - - data = [ 0x00, 0x800000000 ]; - ASSERT.throws(function () { - mod_ctype.wsint64(data, 'big', buf, 1); - }, Error, 'write too large'); - ASSERT.throws(function () { - mod_ctype.wsint64(data, 'little', buf, 1); - }, Error, 'write too large'); - - data = [ 0xffffffffff, 0xffffff238 ]; - ASSERT.throws(function () { - mod_ctype.wsint64(data, 'big', buf, 1); - }, Error, 'write too large'); - ASSERT.throws(function () { - mod_ctype.wsint64(data, 'little', buf, 1); - }, Error, 'write too large'); - - data = [ 0x23, 0xffffff238 ]; - ASSERT.throws(function () { - mod_ctype.wsint64(data, 'big', buf, 1); - }, Error, 'write too large'); - ASSERT.throws(function () { - mod_ctype.wsint64(data, 'little', buf, 1); - }, Error, 'write too large'); - - data = [ -0x80000000, -0xfff238 ]; - ASSERT.throws(function () { - mod_ctype.wsint64(data, 'big', buf, 1); - }, Error, 'write too large'); - ASSERT.throws(function () { - mod_ctype.wsint64(data, 'little', buf, 1); - }, Error, 'write too large'); - - data = [ -0x80000004, -0xfff238 ]; - ASSERT.throws(function () { - mod_ctype.wsint64(data, 'big', buf, 1); - }, Error, 'write too large'); - ASSERT.throws(function () { - mod_ctype.wsint64(data, 'little', buf, 1); - }, Error, 'write too large'); -} - - -testRead(); -testWrite(); -testWriteZero(); -testWriteInvalid(); diff --git a/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/http-signature/node_modules/ctype/tst/ctio/int/tst.rint.js b/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/http-signature/node_modules/ctype/tst/ctio/int/tst.rint.js deleted file mode 100644 index 5236d26..0000000 --- a/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/http-signature/node_modules/ctype/tst/ctio/int/tst.rint.js +++ /dev/null @@ -1,101 +0,0 @@ -/* - * Tests to verify we're reading in signed integers correctly - */ -var mod_ctype = require('../../../ctio.js'); -var ASSERT = require('assert'); - -/* - * Test 8 bit signed integers - */ -function test8() -{ - var data = new Buffer(4); - - data[0] = 0x23; - ASSERT.equal(0x23, mod_ctype.rsint8(data, 'big', 0)); - ASSERT.equal(0x23, mod_ctype.rsint8(data, 'little', 0)); - - data[0] = 0xff; - ASSERT.equal(-1, mod_ctype.rsint8(data, 'big', 0)); - ASSERT.equal(-1, mod_ctype.rsint8(data, 'little', 0)); - - data[0] = 0x87; - data[1] = 0xab; - data[2] = 0x7c; - data[3] = 0xef; - ASSERT.equal(-121, mod_ctype.rsint8(data, 'big', 0)); - ASSERT.equal(-85, mod_ctype.rsint8(data, 'big', 1)); - ASSERT.equal(124, mod_ctype.rsint8(data, 'big', 2)); - ASSERT.equal(-17, mod_ctype.rsint8(data, 'big', 3)); - ASSERT.equal(-121, mod_ctype.rsint8(data, 'little', 0)); - ASSERT.equal(-85, mod_ctype.rsint8(data, 'little', 1)); - ASSERT.equal(124, mod_ctype.rsint8(data, 'little', 2)); - ASSERT.equal(-17, mod_ctype.rsint8(data, 'little', 3)); -} - -function test16() -{ - var buffer = new Buffer(6); - buffer[0] = 0x16; - buffer[1] = 0x79; - ASSERT.equal(0x1679, mod_ctype.rsint16(buffer, 'big', 0)); - ASSERT.equal(0x7916, mod_ctype.rsint16(buffer, 'little', 0)); - - buffer[0] = 0xff; - buffer[1] = 0x80; - ASSERT.equal(-128, mod_ctype.rsint16(buffer, 'big', 0)); - ASSERT.equal(-32513, mod_ctype.rsint16(buffer, 'little', 0)); - - /* test offset with weenix */ - buffer[0] = 0x77; - buffer[1] = 0x65; - buffer[2] = 0x65; - buffer[3] = 0x6e; - buffer[4] = 0x69; - buffer[5] = 0x78; - ASSERT.equal(0x7765, mod_ctype.rsint16(buffer, 'big', 0)); - ASSERT.equal(0x6565, mod_ctype.rsint16(buffer, 'big', 1)); - ASSERT.equal(0x656e, mod_ctype.rsint16(buffer, 'big', 2)); - ASSERT.equal(0x6e69, mod_ctype.rsint16(buffer, 'big', 3)); - ASSERT.equal(0x6978, mod_ctype.rsint16(buffer, 'big', 4)); - ASSERT.equal(0x6577, mod_ctype.rsint16(buffer, 'little', 0)); - ASSERT.equal(0x6565, mod_ctype.rsint16(buffer, 'little', 1)); - ASSERT.equal(0x6e65, mod_ctype.rsint16(buffer, 'little', 2)); - ASSERT.equal(0x696e, mod_ctype.rsint16(buffer, 'little', 3)); - ASSERT.equal(0x7869, mod_ctype.rsint16(buffer, 'little', 4)); -} - -function test32() -{ - var buffer = new Buffer(6); - buffer[0] = 0x43; - buffer[1] = 0x53; - buffer[2] = 0x16; - buffer[3] = 0x79; - ASSERT.equal(0x43531679, mod_ctype.rsint32(buffer, 'big', 0)); - ASSERT.equal(0x79165343, mod_ctype.rsint32(buffer, 'little', 0)); - - buffer[0] = 0xff; - buffer[1] = 0xfe; - buffer[2] = 0xef; - buffer[3] = 0xfa; - ASSERT.equal(-69638, mod_ctype.rsint32(buffer, 'big', 0)); - ASSERT.equal(-84934913, mod_ctype.rsint32(buffer, 'little', 0)); - - buffer[0] = 0x42; - buffer[1] = 0xc3; - buffer[2] = 0x95; - buffer[3] = 0xa9; - buffer[4] = 0x36; - buffer[5] = 0x17; - ASSERT.equal(0x42c395a9, mod_ctype.rsint32(buffer, 'big', 0)); - ASSERT.equal(-1013601994, mod_ctype.rsint32(buffer, 'big', 1)); - ASSERT.equal(-1784072681, mod_ctype.rsint32(buffer, 'big', 2)); - ASSERT.equal(-1449802942, mod_ctype.rsint32(buffer, 'little', 0)); - ASSERT.equal(917083587, mod_ctype.rsint32(buffer, 'little', 1)); - ASSERT.equal(389458325, mod_ctype.rsint32(buffer, 'little', 2)); -} - -test8(); -test16(); -test32(); diff --git a/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/http-signature/node_modules/ctype/tst/ctio/int/tst.wbounds.js b/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/http-signature/node_modules/ctype/tst/ctio/int/tst.wbounds.js deleted file mode 100644 index 5488177..0000000 --- a/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/http-signature/node_modules/ctype/tst/ctio/int/tst.wbounds.js +++ /dev/null @@ -1,53 +0,0 @@ -/* - * Test to make sure that we properly are erroring whenever we try to write - * beyond the size of the integer. - */ - -var mod_ctio = require('../../../ctio.js'); -var mod_assert = require('assert'); -var tb = new Buffer(16); /* Largest buffer we'll need */ - -var cases = [ - { func: - function () { - mod_ctio.wsint8(0x80, 'big', tb, 0); - }, test: '+int8_t' }, - { func: - function () { - mod_ctio.wsint8(-0x81, 'big', tb, 0); - }, test: '-int8_t' }, - - { func: - function () { - mod_ctio.wsint16(0x8000, 'big', tb, 0); - }, test: '+int16_t' }, - { func: - function () { - mod_ctio.wsint16(-0x8001, 'big', tb, 0); - }, test: '-int16_t' }, - { func: - function () { - mod_ctio.wsint32(0x80000000, 'big', tb, 0); - }, test: '+int32_t' }, - { func: - function () { - mod_ctio.wsint32(-0x80000001, 'big', tb, 0); - }, test: '-int32_t' }, - { func: - function () { - mod_ctio.wsint64([ 0x80000000, 0 ], 'big', tb, 0); - }, test: '+int64_t' }, - { func: - function () { - mod_ctio.wsint64([ -0x80000000, -1 ], 'big', tb, 0); - }, test: '-int64_t' } -]; - -function test() -{ - var ii; - for (ii = 0; ii < cases.length; ii++) - mod_assert.throws(cases[ii]['func'], Error, cases[ii]['test']); -} - -test(); diff --git a/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/http-signature/node_modules/ctype/tst/ctio/int/tst.wint.js b/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/http-signature/node_modules/ctype/tst/ctio/int/tst.wint.js deleted file mode 100644 index 98b6a32..0000000 --- a/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/http-signature/node_modules/ctype/tst/ctio/int/tst.wint.js +++ /dev/null @@ -1,92 +0,0 @@ -/* - * Tests to verify we're writing signed integers correctly - */ -var mod_ctype = require('../../../ctio.js'); -var ASSERT = require('assert'); - -function test8() -{ - var buffer = new Buffer(4); - mod_ctype.wsint8(0x23, 'big', buffer, 0); - mod_ctype.wsint8(0x23, 'little', buffer, 1); - mod_ctype.wsint8(-5, 'big', buffer, 2); - mod_ctype.wsint8(-5, 'little', buffer, 3); - - ASSERT.equal(0x23, buffer[0]); - ASSERT.equal(0x23, buffer[1]); - ASSERT.equal(0xfb, buffer[2]); - ASSERT.equal(0xfb, buffer[3]); - - /* Make sure we handle truncation correctly */ - ASSERT.throws(function () { - mod_ctype.wsint8(0xabc, 'big', buffer, 0); - }); - ASSERT.throws(function () { - mod_ctype.wsint8(0xabc, 'little', buffer, 0); - }); -} - -function test16() -{ - var buffer = new Buffer(6); - mod_ctype.wsint16(0x0023, 'big', buffer, 0); - mod_ctype.wsint16(0x0023, 'little', buffer, 2); - ASSERT.equal(0x00, buffer[0]); - ASSERT.equal(0x23, buffer[1]); - ASSERT.equal(0x23, buffer[2]); - ASSERT.equal(0x00, buffer[3]); - mod_ctype.wsint16(-5, 'big', buffer, 0); - mod_ctype.wsint16(-5, 'little', buffer, 2); - ASSERT.equal(0xff, buffer[0]); - ASSERT.equal(0xfb, buffer[1]); - ASSERT.equal(0xfb, buffer[2]); - ASSERT.equal(0xff, buffer[3]); - - mod_ctype.wsint16(-1679, 'big', buffer, 1); - mod_ctype.wsint16(-1679, 'little', buffer, 3); - ASSERT.equal(0xf9, buffer[1]); - ASSERT.equal(0x71, buffer[2]); - ASSERT.equal(0x71, buffer[3]); - ASSERT.equal(0xf9, buffer[4]); -} - -function test32() -{ - var buffer = new Buffer(8); - mod_ctype.wsint32(0x23, 'big', buffer, 0); - mod_ctype.wsint32(0x23, 'little', buffer, 4); - ASSERT.equal(0x00, buffer[0]); - ASSERT.equal(0x00, buffer[1]); - ASSERT.equal(0x00, buffer[2]); - ASSERT.equal(0x23, buffer[3]); - ASSERT.equal(0x23, buffer[4]); - ASSERT.equal(0x00, buffer[5]); - ASSERT.equal(0x00, buffer[6]); - ASSERT.equal(0x00, buffer[7]); - - mod_ctype.wsint32(-5, 'big', buffer, 0); - mod_ctype.wsint32(-5, 'little', buffer, 4); - ASSERT.equal(0xff, buffer[0]); - ASSERT.equal(0xff, buffer[1]); - ASSERT.equal(0xff, buffer[2]); - ASSERT.equal(0xfb, buffer[3]); - ASSERT.equal(0xfb, buffer[4]); - ASSERT.equal(0xff, buffer[5]); - ASSERT.equal(0xff, buffer[6]); - ASSERT.equal(0xff, buffer[7]); - - mod_ctype.wsint32(-805306713, 'big', buffer, 0); - mod_ctype.wsint32(-805306713, 'litle', buffer, 4); - ASSERT.equal(0xcf, buffer[0]); - ASSERT.equal(0xff, buffer[1]); - ASSERT.equal(0xfe, buffer[2]); - ASSERT.equal(0xa7, buffer[3]); - ASSERT.equal(0xa7, buffer[4]); - ASSERT.equal(0xfe, buffer[5]); - ASSERT.equal(0xff, buffer[6]); - ASSERT.equal(0xcf, buffer[7]); -} - -test8(); -test16(); -test32(); diff --git a/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/http-signature/node_modules/ctype/tst/ctio/uint/tst.64.js b/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/http-signature/node_modules/ctype/tst/ctio/uint/tst.64.js deleted file mode 100644 index cf66ac7..0000000 --- a/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/http-signature/node_modules/ctype/tst/ctio/uint/tst.64.js +++ /dev/null @@ -1,451 +0,0 @@ -/* - * Test our ability to read and write unsigned 64-bit integers. - */ - -var mod_ctype = require('../../../ctio.js'); -var ASSERT = require('assert'); - -function testRead() -{ - var res, data; - data = new Buffer(10); - - data[0] = 0x32; - data[1] = 0x65; - data[2] = 0x42; - data[3] = 0x56; - data[4] = 0x23; - data[5] = 0xff; - data[6] = 0xff; - data[7] = 0xff; - data[8] = 0x89; - data[9] = 0x11; - res = mod_ctype.ruint64(data, 'big', 0); - ASSERT.equal(0x32654256, res[0]); - ASSERT.equal(0x23ffffff, res[1]); - res = mod_ctype.ruint64(data, 'big', 1); - ASSERT.equal(0x65425623, res[0]); - ASSERT.equal(0xffffff89, res[1]); - res = mod_ctype.ruint64(data, 'big', 2); - ASSERT.equal(0x425623ff, res[0]); - ASSERT.equal(0xffff8911, res[1]); - res = mod_ctype.ruint64(data, 'little', 0); - ASSERT.equal(0xffffff23, res[0]); - ASSERT.equal(0x56426532, res[1]); - res = mod_ctype.ruint64(data, 'little', 1); - ASSERT.equal(0x89ffffff, res[0]); - ASSERT.equal(0x23564265, res[1]); - res = mod_ctype.ruint64(data, 'little', 2); - ASSERT.equal(0x1189ffff, res[0]); - ASSERT.equal(0xff235642, res[1]); - -} - -function testReadOver() -{ - var res, data; - data = new Buffer(10); - - data[0] = 0x80; - data[1] = 0xff; - data[2] = 0x80; - data[3] = 0xff; - data[4] = 0x80; - data[5] = 0xff; - data[6] = 0x80; - data[7] = 0xff; - data[8] = 0x80; - data[9] = 0xff; - res = mod_ctype.ruint64(data, 'big', 0); - ASSERT.equal(0x80ff80ff, res[0]); - ASSERT.equal(0x80ff80ff, res[1]); - res = mod_ctype.ruint64(data, 'big', 1); - ASSERT.equal(0xff80ff80, res[0]); - ASSERT.equal(0xff80ff80, res[1]); - res = mod_ctype.ruint64(data, 'big', 2); - ASSERT.equal(0x80ff80ff, res[0]); - ASSERT.equal(0x80ff80ff, res[1]); - res = mod_ctype.ruint64(data, 'little', 0); - ASSERT.equal(0xff80ff80, res[0]); - ASSERT.equal(0xff80ff80, res[1]); - res = mod_ctype.ruint64(data, 'little', 1); - ASSERT.equal(0x80ff80ff, res[0]); - ASSERT.equal(0x80ff80ff, res[1]); - res = mod_ctype.ruint64(data, 'little', 2); - ASSERT.equal(0xff80ff80, res[0]); - ASSERT.equal(0xff80ff80, res[1]); -} - -function testWriteZero() -{ - var data, buf; - buf = new Buffer(10); - - buf.fill(0x66); - data = [0, 0]; - mod_ctype.wuint64(data, 'big', buf, 0); - ASSERT.equal(0, buf[0]); - ASSERT.equal(0, buf[1]); - ASSERT.equal(0, buf[2]); - ASSERT.equal(0, buf[3]); - ASSERT.equal(0, buf[4]); - ASSERT.equal(0, buf[5]); - ASSERT.equal(0, buf[6]); - ASSERT.equal(0, buf[7]); - ASSERT.equal(0x66, buf[8]); - ASSERT.equal(0x66, buf[9]); - - buf.fill(0x66); - data = [0, 0]; - mod_ctype.wuint64(data, 'big', buf, 1); - ASSERT.equal(0x66, buf[0]); - ASSERT.equal(0, buf[1]); - ASSERT.equal(0, buf[2]); - ASSERT.equal(0, buf[3]); - ASSERT.equal(0, buf[4]); - ASSERT.equal(0, buf[5]); - ASSERT.equal(0, buf[6]); - ASSERT.equal(0, buf[7]); - ASSERT.equal(0, buf[8]); - ASSERT.equal(0x66, buf[9]); - - buf.fill(0x66); - data = [0, 0]; - mod_ctype.wuint64(data, 'big', buf, 2); - ASSERT.equal(0x66, buf[0]); - ASSERT.equal(0x66, buf[1]); - ASSERT.equal(0, buf[2]); - ASSERT.equal(0, buf[3]); - ASSERT.equal(0, buf[4]); - ASSERT.equal(0, buf[5]); - ASSERT.equal(0, buf[6]); - ASSERT.equal(0, buf[7]); - ASSERT.equal(0, buf[8]); - ASSERT.equal(0, buf[9]); - - - buf.fill(0x66); - data = [0, 0]; - mod_ctype.wuint64(data, 'little', buf, 0); - ASSERT.equal(0, buf[0]); - ASSERT.equal(0, buf[1]); - ASSERT.equal(0, buf[2]); - ASSERT.equal(0, buf[3]); - ASSERT.equal(0, buf[4]); - ASSERT.equal(0, buf[5]); - ASSERT.equal(0, buf[6]); - ASSERT.equal(0, buf[7]); - ASSERT.equal(0x66, buf[8]); - ASSERT.equal(0x66, buf[9]); - - buf.fill(0x66); - data = [0, 0]; - mod_ctype.wuint64(data, 'little', buf, 1); - ASSERT.equal(0x66, buf[0]); - ASSERT.equal(0, buf[1]); - ASSERT.equal(0, buf[2]); - ASSERT.equal(0, buf[3]); - ASSERT.equal(0, buf[4]); - ASSERT.equal(0, buf[5]); - ASSERT.equal(0, buf[6]); - ASSERT.equal(0, buf[7]); - ASSERT.equal(0, buf[8]); - ASSERT.equal(0x66, buf[9]); - - buf.fill(0x66); - data = [0, 0]; - mod_ctype.wuint64(data, 'little', buf, 2); - ASSERT.equal(0x66, buf[0]); - ASSERT.equal(0x66, buf[1]); - ASSERT.equal(0, buf[2]); - ASSERT.equal(0, buf[3]); - ASSERT.equal(0, buf[4]); - ASSERT.equal(0, buf[5]); - ASSERT.equal(0, buf[6]); - ASSERT.equal(0, buf[7]); - ASSERT.equal(0, buf[8]); - ASSERT.equal(0, buf[9]); -} - -/* - * Also include tests that are going to force us to go into a negative value and - * insure that it's written correctly. - */ -function testWrite() -{ - var data, buf; - - buf = new Buffer(10); - data = [ 0x234456, 0x87 ]; - buf.fill(0x66); - mod_ctype.wuint64(data, 'big', buf, 0); - ASSERT.equal(0x00, buf[0]); - ASSERT.equal(0x23, buf[1]); - ASSERT.equal(0x44, buf[2]); - ASSERT.equal(0x56, buf[3]); - ASSERT.equal(0x00, buf[4]); - ASSERT.equal(0x00, buf[5]); - ASSERT.equal(0x00, buf[6]); - ASSERT.equal(0x87, buf[7]); - ASSERT.equal(0x66, buf[8]); - ASSERT.equal(0x66, buf[9]); - - buf.fill(0x66); - mod_ctype.wuint64(data, 'big', buf, 1); - ASSERT.equal(0x66, buf[0]); - ASSERT.equal(0x00, buf[1]); - ASSERT.equal(0x23, buf[2]); - ASSERT.equal(0x44, buf[3]); - ASSERT.equal(0x56, buf[4]); - ASSERT.equal(0x00, buf[5]); - ASSERT.equal(0x00, buf[6]); - ASSERT.equal(0x00, buf[7]); - ASSERT.equal(0x87, buf[8]); - ASSERT.equal(0x66, buf[9]); - - buf.fill(0x66); - mod_ctype.wuint64(data, 'big', buf, 2); - ASSERT.equal(0x66, buf[0]); - ASSERT.equal(0x66, buf[1]); - ASSERT.equal(0x00, buf[2]); - ASSERT.equal(0x23, buf[3]); - ASSERT.equal(0x44, buf[4]); - ASSERT.equal(0x56, buf[5]); - ASSERT.equal(0x00, buf[6]); - ASSERT.equal(0x00, buf[7]); - ASSERT.equal(0x00, buf[8]); - ASSERT.equal(0x87, buf[9]); - - buf.fill(0x66); - mod_ctype.wuint64(data, 'little', buf, 0); - ASSERT.equal(0x87, buf[0]); - ASSERT.equal(0x00, buf[1]); - ASSERT.equal(0x00, buf[2]); - ASSERT.equal(0x00, buf[3]); - ASSERT.equal(0x56, buf[4]); - ASSERT.equal(0x44, buf[5]); - ASSERT.equal(0x23, buf[6]); - ASSERT.equal(0x00, buf[7]); - ASSERT.equal(0x66, buf[8]); - ASSERT.equal(0x66, buf[9]); - - buf.fill(0x66); - mod_ctype.wuint64(data, 'little', buf, 1); - ASSERT.equal(0x66, buf[0]); - ASSERT.equal(0x87, buf[1]); - ASSERT.equal(0x00, buf[2]); - ASSERT.equal(0x00, buf[3]); - ASSERT.equal(0x00, buf[4]); - ASSERT.equal(0x56, buf[5]); - ASSERT.equal(0x44, buf[6]); - ASSERT.equal(0x23, buf[7]); - ASSERT.equal(0x00, buf[8]); - ASSERT.equal(0x66, buf[9]); - - - buf.fill(0x66); - mod_ctype.wuint64(data, 'little', buf, 2); - ASSERT.equal(0x66, buf[0]); - ASSERT.equal(0x66, buf[1]); - ASSERT.equal(0x87, buf[2]); - ASSERT.equal(0x00, buf[3]); - ASSERT.equal(0x00, buf[4]); - ASSERT.equal(0x00, buf[5]); - ASSERT.equal(0x56, buf[6]); - ASSERT.equal(0x44, buf[7]); - ASSERT.equal(0x23, buf[8]); - ASSERT.equal(0x00, buf[9]); - - data = [0xffff3421, 0x34abcdba]; - buf.fill(0x66); - mod_ctype.wuint64(data, 'big', buf, 0); - ASSERT.equal(0xff, buf[0]); - ASSERT.equal(0xff, buf[1]); - ASSERT.equal(0x34, buf[2]); - ASSERT.equal(0x21, buf[3]); - ASSERT.equal(0x34, buf[4]); - ASSERT.equal(0xab, buf[5]); - ASSERT.equal(0xcd, buf[6]); - ASSERT.equal(0xba, buf[7]); - ASSERT.equal(0x66, buf[8]); - ASSERT.equal(0x66, buf[9]); - - buf.fill(0x66); - mod_ctype.wuint64(data, 'big', buf, 1); - ASSERT.equal(0x66, buf[0]); - ASSERT.equal(0xff, buf[1]); - ASSERT.equal(0xff, buf[2]); - ASSERT.equal(0x34, buf[3]); - ASSERT.equal(0x21, buf[4]); - ASSERT.equal(0x34, buf[5]); - ASSERT.equal(0xab, buf[6]); - ASSERT.equal(0xcd, buf[7]); - ASSERT.equal(0xba, buf[8]); - ASSERT.equal(0x66, buf[9]); - - buf.fill(0x66); - mod_ctype.wuint64(data, 'big', buf, 2); - ASSERT.equal(0x66, buf[0]); - ASSERT.equal(0x66, buf[1]); - ASSERT.equal(0xff, buf[2]); - ASSERT.equal(0xff, buf[3]); - ASSERT.equal(0x34, buf[4]); - ASSERT.equal(0x21, buf[5]); - ASSERT.equal(0x34, buf[6]); - ASSERT.equal(0xab, buf[7]); - ASSERT.equal(0xcd, buf[8]); - ASSERT.equal(0xba, buf[9]); - - buf.fill(0x66); - mod_ctype.wuint64(data, 'little', buf, 0); - ASSERT.equal(0xba, buf[0]); - ASSERT.equal(0xcd, buf[1]); - ASSERT.equal(0xab, buf[2]); - ASSERT.equal(0x34, buf[3]); - ASSERT.equal(0x21, buf[4]); - ASSERT.equal(0x34, buf[5]); - ASSERT.equal(0xff, buf[6]); - ASSERT.equal(0xff, buf[7]); - ASSERT.equal(0x66, buf[8]); - ASSERT.equal(0x66, buf[9]); - - buf.fill(0x66); - mod_ctype.wuint64(data, 'little', buf, 1); - ASSERT.equal(0x66, buf[0]); - ASSERT.equal(0xba, buf[1]); - ASSERT.equal(0xcd, buf[2]); - ASSERT.equal(0xab, buf[3]); - ASSERT.equal(0x34, buf[4]); - ASSERT.equal(0x21, buf[5]); - ASSERT.equal(0x34, buf[6]); - ASSERT.equal(0xff, buf[7]); - ASSERT.equal(0xff, buf[8]); - ASSERT.equal(0x66, buf[9]); - - buf.fill(0x66); - mod_ctype.wuint64(data, 'little', buf, 2); - ASSERT.equal(0x66, buf[0]); - ASSERT.equal(0x66, buf[1]); - ASSERT.equal(0xba, buf[2]); - ASSERT.equal(0xcd, buf[3]); - ASSERT.equal(0xab, buf[4]); - ASSERT.equal(0x34, buf[5]); - ASSERT.equal(0x21, buf[6]); - ASSERT.equal(0x34, buf[7]); - ASSERT.equal(0xff, buf[8]); - ASSERT.equal(0xff, buf[9]); -} - -/* - * Make sure we catch invalid writes. - */ -function testWriteInvalid() -{ - var data, buf; - - /* Buffer too small */ - buf = new Buffer(4); - data = [ 0, 0]; - ASSERT.throws(function () { - mod_ctype.wuint64(data, 'big', buf, 0); - }, Error, 'buffer too small'); - ASSERT.throws(function () { - mod_ctype.wuint64(data, 'little', buf, 0); - }, Error, 'buffer too small'); - - /* Beyond the end of the buffer */ - buf = new Buffer(12); - data = [ 0, 0]; - ASSERT.throws(function () { - mod_ctype.wuint64(data, 'little', buf, 11); - }, Error, 'write beyond end of buffer'); - ASSERT.throws(function () { - mod_ctype.wuint64(data, 'big', buf, 11); - }, Error, 'write beyond end of buffer'); - - /* Write negative values */ - buf = new Buffer(12); - data = [ -3, 0 ]; - ASSERT.throws(function () { - mod_ctype.wuint64(data, 'big', buf, 1); - }, Error, 'write negative number'); - ASSERT.throws(function () { - mod_ctype.wuint64(data, 'little', buf, 1); - }, Error, 'write negative number'); - - data = [ 0, -3 ]; - ASSERT.throws(function () { - mod_ctype.wuint64(data, 'big', buf, 1); - }, Error, 'write negative number'); - ASSERT.throws(function () { - mod_ctype.wuint64(data, 'little', buf, 1); - }, Error, 'write negative number'); - - data = [ -3, -3 ]; - ASSERT.throws(function () { - mod_ctype.wuint64(data, 'big', buf, 1); - }, Error, 'write negative number'); - ASSERT.throws(function () { - mod_ctype.wuint64(data, 'little', buf, 1); - }, Error, 'write negative number'); - - - /* Write fractional values */ - buf = new Buffer(12); - data = [ 3.33, 0 ]; - ASSERT.throws(function () { - mod_ctype.wuint64(data, 'big', buf, 1); - }, Error, 'write fractions'); - ASSERT.throws(function () { - mod_ctype.wuint64(data, 'little', buf, 1); - }, Error, 'write fractions'); - - data = [ 0, 3.3 ]; - ASSERT.throws(function () { - mod_ctype.wuint64(data, 'big', buf, 1); - }, Error, 'write fractions'); - ASSERT.throws(function () { - mod_ctype.wuint64(data, 'little', buf, 1); - }, Error, 'write fractions'); - - data = [ 3.33, 2.42 ]; - ASSERT.throws(function () { - mod_ctype.wuint64(data, 'big', buf, 1); - }, Error, 'write fractions'); - ASSERT.throws(function () { - mod_ctype.wuint64(data, 'little', buf, 1); - }, Error, 'write fractions'); - - /* Write values that are too large */ - buf = new Buffer(12); - data = [ 0xffffffffff, 23 ]; - ASSERT.throws(function () { - mod_ctype.wuint64(data, 'big', buf, 1); - }, Error, 'write too large'); - ASSERT.throws(function () { - mod_ctype.wuint64(data, 'little', buf, 1); - }, Error, 'write too large'); - - data = [ 0xffffffffff, 0xffffff238 ]; - ASSERT.throws(function () { - mod_ctype.wuint64(data, 'big', buf, 1); - }, Error, 'write too large'); - ASSERT.throws(function () { - mod_ctype.wuint64(data, 'little', buf, 1); - }, Error, 'write too large'); - - data = [ 0x23, 0xffffff238 ]; - ASSERT.throws(function () { - mod_ctype.wuint64(data, 'big', buf, 1); - }, Error, 'write too large'); - ASSERT.throws(function () { - mod_ctype.wuint64(data, 'little', buf, 1); - }, Error, 'write too large'); -} - - -testRead(); -testReadOver(); -testWriteZero(); -testWrite(); -testWriteInvalid(); diff --git a/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/http-signature/node_modules/ctype/tst/ctio/uint/tst.roundtrip.js b/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/http-signature/node_modules/ctype/tst/ctio/uint/tst.roundtrip.js deleted file mode 100644 index 87ae59b..0000000 --- a/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/http-signature/node_modules/ctype/tst/ctio/uint/tst.roundtrip.js +++ /dev/null @@ -1,81 +0,0 @@ -/* - * A battery of tests for sucessful round-trip between writes and reads - */ - -var mod_ctype = require('../../../ctio.js'); -var ASSERT = require('assert'); - - -/* - * What the heck, let's just test every value for 8-bits. - */ - -function test8() { - var data = new Buffer(1); - var i; - for (i = 0; i < 256; i++) { - mod_ctype.wuint8(i, 'big', data, 0); - ASSERT.equal(i, mod_ctype.ruint8(data, 'big', 0)); - mod_ctype.wuint8(i, 'little', data, 0); - ASSERT.equal(i, mod_ctype.ruint8(data, 'little', 0)); - } - ASSERT.ok(true); -} - -/* - * Test a random sample of 256 values in the 16-bit unsigned range - */ - -function test16() { - var data = new Buffer(2); - var i = 0; - for (i = 0; i < 256; i++) { - var value = Math.round(Math.random() * Math.pow(2, 16)); - mod_ctype.wuint16(value, 'big', data, 0); - ASSERT.equal(value, mod_ctype.ruint16(data, 'big', 0)); - mod_ctype.wuint16(value, 'little', data, 0); - ASSERT.equal(value, mod_ctype.ruint16(data, 'little', 0)); - } -} - -/* - * Test a random sample of 256 values in the 32-bit unsigned range - */ - -function test32() { - var data = new Buffer(4); - var i = 0; - for (i = 0; i < 256; i++) { - var value = Math.round(Math.random() * Math.pow(2, 32)); - mod_ctype.wuint32(value, 'big', data, 0); - ASSERT.equal(value, mod_ctype.ruint32(data, 'big', 0)); - mod_ctype.wuint32(value, 'little', data, 0); - ASSERT.equal(value, mod_ctype.ruint32(data, 'little', 0)); - } -} - -/* - * Test a random sample of 256 values in the 64-bit unsigned range - */ - -function test64() { - var data = new Buffer(8); - var i = 0; - for (i = 0; i < 256; i++) { - var low = Math.round(Math.random() * Math.pow(2, 32)); - var high = Math.round(Math.random() * Math.pow(2, 32)); - mod_ctype.wuint64([high, low], 'big', data, 0); - var result = mod_ctype.ruint64(data, 'big', 0); - ASSERT.equal(high, result[0]); - ASSERT.equal(low, result[1]); - mod_ctype.wuint64([high, low], 'little', data, 0); - result = mod_ctype.ruint64(data, 'little', 0); - ASSERT.equal(high, result[0]); - ASSERT.equal(low, result[1]); - } -} - -exports.test8 = test8; -exports.test16 = test16; -exports.test32 = test32; -exports.test64 = test64; diff --git a/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/http-signature/node_modules/ctype/tst/ctio/uint/tst.ruint.js b/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/http-signature/node_modules/ctype/tst/ctio/uint/tst.ruint.js deleted file mode 100644 index b67c077..0000000 --- a/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/http-signature/node_modules/ctype/tst/ctio/uint/tst.ruint.js +++ /dev/null @@ -1,95 +0,0 @@ -/* - * A battery of tests to help us read a series of uints - */ - -var mod_ctype = require('../../../ctio.js'); -var ASSERT = require('assert'); - -/* - * We need to check the following things: - * - We are correctly resolving big endian (doesn't mean anything for 8 bit) - * - Correctly resolving little endian (doesn't mean anything for 8 bit) - * - Correctly using the offsets - * - Correctly interpreting values that are beyond the signed range as unsigned - */ -function test8() -{ - var data = new Buffer(4); - data[0] = 23; - data[1] = 23; - data[2] = 23; - data[3] = 23; - ASSERT.equal(23, mod_ctype.ruint8(data, 'big', 0)); - ASSERT.equal(23, mod_ctype.ruint8(data, 'little', 0)); - ASSERT.equal(23, mod_ctype.ruint8(data, 'big', 1)); - ASSERT.equal(23, mod_ctype.ruint8(data, 'little', 1)); - ASSERT.equal(23, mod_ctype.ruint8(data, 'big', 2)); - ASSERT.equal(23, mod_ctype.ruint8(data, 'little', 2)); - ASSERT.equal(23, mod_ctype.ruint8(data, 'big', 3)); - ASSERT.equal(23, mod_ctype.ruint8(data, 'little', 3)); - data[0] = 255; /* If it became a signed int, would be -1 */ - ASSERT.equal(255, mod_ctype.ruint8(data, 'big', 0)); - ASSERT.equal(255, mod_ctype.ruint8(data, 'little', 0)); -} - -/* - * Test 16 bit unsigned integers. We need to verify the same set as 8 bit, only - * now some of the issues actually matter: - * - We are correctly resolving big endian - * - Correctly resolving little endian - * - Correctly using the offsets - * - Correctly interpreting values that are beyond the signed range as unsigned - */ -function test16() -{ - var data = new Buffer(4); - /* Test signed values first */ - data[0] = 0; - data[1] = 0x23; - data[2] = 0x42; - data[3] = 0x3f; - - ASSERT.equal(0x23, mod_ctype.ruint16(data, 'big', 0)); - ASSERT.equal(0x2342, mod_ctype.ruint16(data, 'big', 1)); - ASSERT.equal(0x423f, mod_ctype.ruint16(data, 'big', 2)); - - ASSERT.equal(0x2300, mod_ctype.ruint16(data, 'little', 0)); - ASSERT.equal(0x4223, mod_ctype.ruint16(data, 'little', 1)); - ASSERT.equal(0x3f42, mod_ctype.ruint16(data, 'little', 2)); - - data[0] = 0xfe; - data[1] = 0xfe; - - ASSERT.equal(0xfefe, mod_ctype.ruint16(data, 'big', 0)); - ASSERT.equal(0xfefe, mod_ctype.ruint16(data, 'little', 0)); -} - -/* - * Test 32 bit unsigned integers. We need to verify the same set as 8 bit, only - * now some of the issues actually matter: - * - We are correctly resolving big endian - * - Correctly using the offsets - * - Correctly interpreting values that are beyond the signed range as unsigned - */ -function test32() -{ - var data = new Buffer(8); - data[0] = 0x32; - data[1] = 0x65; - data[2] = 0x42; - data[3] = 0x56; - data[4] = 0x23; - data[5] = 0xff; - - ASSERT.equal(0x32654256, mod_ctype.ruint32(data, 'big', 0)); - ASSERT.equal(0x65425623, mod_ctype.ruint32(data, 'big', 1)); - ASSERT.equal(0x425623ff, mod_ctype.ruint32(data, 'big', 2)); - - ASSERT.equal(0x56426532, mod_ctype.ruint32(data, 'little', 0)); - ASSERT.equal(0x23564265, mod_ctype.ruint32(data, 'little', 1)); - ASSERT.equal(0xff235642, mod_ctype.ruint32(data, 'little', 2)); -} - -test8(); -test16(); -test32(); diff --git a/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/http-signature/node_modules/ctype/tst/ctio/uint/tst.wuint.js b/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/http-signature/node_modules/ctype/tst/ctio/uint/tst.wuint.js deleted file mode 100644 index d6c4230..0000000 --- a/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/http-signature/node_modules/ctype/tst/ctio/uint/tst.wuint.js +++ /dev/null @@ -1,156 +0,0 @@ -/* - * A battery of tests to help us read a series of uints - */ - -var mod_ctype = require('../../../ctio.js'); -var ASSERT = require('assert'); - -/* - * We need to check the following things: - * - We are correctly resolving big endian (doesn't mean anything for 8 bit) - * - Correctly resolving little endian (doesn't mean anything for 8 bit) - * - Correctly using the offsets - * - Correctly interpreting values that are beyond the signed range as unsigned - */ -function test8() -{ - var data = new Buffer(4); - mod_ctype.wuint8(23, 'big', data, 0); - mod_ctype.wuint8(23, 'big', data, 1); - mod_ctype.wuint8(23, 'big', data, 2); - mod_ctype.wuint8(23, 'big', data, 3); - ASSERT.equal(23, data[0]); - ASSERT.equal(23, data[1]); - ASSERT.equal(23, data[2]); - ASSERT.equal(23, data[3]); - mod_ctype.wuint8(23, 'little', data, 0); - mod_ctype.wuint8(23, 'little', data, 1); - mod_ctype.wuint8(23, 'little', data, 2); - mod_ctype.wuint8(23, 'little', data, 3); - ASSERT.equal(23, data[0]); - ASSERT.equal(23, data[1]); - ASSERT.equal(23, data[2]); - ASSERT.equal(23, data[3]); - mod_ctype.wuint8(255, 'big', data, 0); - ASSERT.equal(255, data[0]); - mod_ctype.wuint8(255, 'little', data, 0); - ASSERT.equal(255, data[0]); -} - -function test16() -{ - var value = 0x2343; - var data = new Buffer(4); - mod_ctype.wuint16(value, 'big', data, 0); - ASSERT.equal(0x23, data[0]); - ASSERT.equal(0x43, data[1]); - mod_ctype.wuint16(value, 'big', data, 1); - ASSERT.equal(0x23, data[1]); - ASSERT.equal(0x43, data[2]); - mod_ctype.wuint16(value, 'big', data, 2); - ASSERT.equal(0x23, data[2]); - ASSERT.equal(0x43, data[3]); - - mod_ctype.wuint16(value, 'little', data, 0); - ASSERT.equal(0x23, data[1]); - ASSERT.equal(0x43, data[0]); - - mod_ctype.wuint16(value, 'little', data, 1); - ASSERT.equal(0x23, data[2]); - ASSERT.equal(0x43, data[1]); - - mod_ctype.wuint16(value, 'little', data, 2); - ASSERT.equal(0x23, data[3]); - ASSERT.equal(0x43, data[2]); - - value = 0xff80; - mod_ctype.wuint16(value, 'little', data, 0); - ASSERT.equal(0xff, data[1]); - ASSERT.equal(0x80, data[0]); - - mod_ctype.wuint16(value, 'big', data, 0); - ASSERT.equal(0xff, data[0]); - ASSERT.equal(0x80, data[1]); -} - -function test32() -{ - var data = new Buffer(6); - var value = 0xe7f90a6d; - - mod_ctype.wuint32(value, 'big', data, 0); - ASSERT.equal(0xe7, data[0]); - ASSERT.equal(0xf9, data[1]); - ASSERT.equal(0x0a, data[2]); - ASSERT.equal(0x6d, data[3]); - - mod_ctype.wuint32(value, 'big', data, 1); - ASSERT.equal(0xe7, data[1]); - ASSERT.equal(0xf9, data[2]); - ASSERT.equal(0x0a, data[3]); - ASSERT.equal(0x6d, data[4]); - - mod_ctype.wuint32(value, 'big', data, 2); - ASSERT.equal(0xe7, data[2]); - ASSERT.equal(0xf9, data[3]); - ASSERT.equal(0x0a, data[4]); - ASSERT.equal(0x6d, data[5]); - - mod_ctype.wuint32(value, 'little', data, 0); - ASSERT.equal(0xe7, data[3]); - ASSERT.equal(0xf9, data[2]); - ASSERT.equal(0x0a, data[1]); - ASSERT.equal(0x6d, data[0]); - - mod_ctype.wuint32(value, 'little', data, 1); - ASSERT.equal(0xe7, data[4]); - ASSERT.equal(0xf9, data[3]); - ASSERT.equal(0x0a, data[2]); - ASSERT.equal(0x6d, data[1]); - - mod_ctype.wuint32(value, 'little', data, 2); - ASSERT.equal(0xe7, data[5]); - ASSERT.equal(0xf9, data[4]); - ASSERT.equal(0x0a, data[3]); - ASSERT.equal(0x6d, data[2]); -} - -function test64() -{ - var data = new Buffer(10); - var value = 0x0007cda8e7f90a6d; - var high = Math.floor(value / Math.pow(2, 32)); - var low = value - (high * Math.pow(2, 32)); - ASSERT.equal(0x0007cda8, high); - ASSERT.equal(0xe7f90a6d, low); - - mod_ctype.wuint64([high, low], 'big', data, 0); - ASSERT.equal(0x00, data[0]); - ASSERT.equal(0x07, data[1]); - ASSERT.equal(0xcd, data[2]); - ASSERT.equal(0xa8, data[3]); - ASSERT.equal(0xe7, data[4]); - ASSERT.equal(0xf9, data[5]); - ASSERT.equal(0x0a, data[6]); - ASSERT.equal(0x6d, data[7]); - - mod_ctype.wuint64([high, low], 'little', data, 0); - ASSERT.equal(0x6d, data[0]); - ASSERT.equal(0x0a, data[1]); - ASSERT.equal(0xf9, data[2]); - ASSERT.equal(0xe7, data[3]); - ASSERT.equal(0xa8, data[4]); - ASSERT.equal(0xcd, data[5]); - ASSERT.equal(0x07, data[6]); - ASSERT.equal(0x00, data[7]); -} - -test8(); -test16(); -test32(); -test64(); - -exports.test8 = test8; -exports.test16 = test16; -exports.test32 = test32; -exports.test64 = test64; diff --git a/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/http-signature/node_modules/ctype/tst/ctype/tst.basicr.js b/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/http-signature/node_modules/ctype/tst/ctype/tst.basicr.js deleted file mode 100644 index e989515..0000000 --- a/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/http-signature/node_modules/ctype/tst/ctype/tst.basicr.js +++ /dev/null @@ -1,50 +0,0 @@ -/* - * Simple does to see if it works at all - */ -var mod_ctype = require('../../ctype'); -var ASSERT = require('assert'); -var mod_sys = require('sys'); - -function test() -{ - var ii, p, result, buffer; - - p = new mod_ctype.Parser({ endian: 'little' }); - buffer = new Buffer(4); - buffer[0] = 23; - buffer[3] = 42; - result = p.readData([ { x: { type: 'uint8_t' }}, - { y: { type: 'uint8_t', offset: 3 }} - ], buffer, 0); - ASSERT.equal(23, result['x']); - ASSERT.equal(42, result['y']); - - buffer = new Buffer(23); - for (ii = 0; ii < 23; ii++) - buffer[ii] = 0; - - buffer.write('Hello, world!'); - result = p.readData([ { x: { type: 'char[20]' }} ], buffer, 0); - - /* - * This is currently broken behvaior, need to redesign check - * ASSERT.equal('Hello, world!', result['x'].toString('utf-8', 0, - * result['x'].length)); - */ - - buffer = new Buffer(4); - buffer[0] = 0x03; - buffer[1] = 0x24; - buffer[2] = 0x25; - buffer[3] = 0x26; - result = p.readData([ { y: { type: 'uint8_t' }}, - { x: { type: 'uint8_t[y]' }}], buffer, 0); - console.log(mod_sys.inspect(result, true)); - - p.typedef('ssize_t', 'int32_t'); - ASSERT.deepEqual({ 'ssize_t': 'int32_t' }, p.lstypes()); - result = p.readData([ { x: { type: 'ssize_t' } } ], buffer, 0); - ASSERT.equal(0x26252403, result['x']); -} - -test(); diff --git a/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/http-signature/node_modules/ctype/tst/ctype/tst.basicw.js b/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/http-signature/node_modules/ctype/tst/ctype/tst.basicw.js deleted file mode 100644 index 89d446f..0000000 --- a/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/http-signature/node_modules/ctype/tst/ctype/tst.basicw.js +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Simple does it fucking work at all test - */ - -var mod_ctype = require('../../ctype'); -var ASSERT = require('assert'); -var mod_sys = require('sys'); - -function test() -{ - var ii, p, buffer, buf2; - - p = new mod_ctype.Parser({ endian: 'big' }); - buffer = new Buffer(4); - p.writeData([ { x: { type: 'uint8_t', value: 23 }}, - { y: { type: 'uint8_t', offset: 3, value: 42 }} - ], buffer, 0); - ASSERT.equal(23, buffer[0]); - ASSERT.equal(42, buffer[3]); - - buffer = new Buffer(20); - for (ii = 0; ii < 20; ii++) - buffer[ii] = 0; - - buffer.write('Hello, world!'); - buf2 = new Buffer(22); - p.writeData([ { x: { type: 'char[20]', value: buffer }} ], buf2, 0); - for (ii = 0; ii < 20; ii++) - ASSERT.equal(buffer[ii], buf2[ii]); - /* - * This is currently broken behvaior, need to redesign check - * ASSERT.equal('Hello, world!', result['x'].toString('utf-8', 0, - * result['x'].length)); - */ - - buffer = new Buffer(4); - p.writeData([ { y: { type: 'uint8_t', value: 3 }}, - { x: { type: 'uint8_t[y]', value: [ 0x24, 0x25, 0x26] }}], - buffer, 0); - console.log(mod_sys.inspect(buffer)); - - p.typedef('ssize_t', 'int32_t'); - ASSERT.deepEqual({ 'ssize_t': 'int32_t' }, p.lstypes()); -} diff --git a/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/http-signature/node_modules/ctype/tst/ctype/tst.char.js b/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/http-signature/node_modules/ctype/tst/ctype/tst.char.js deleted file mode 100644 index 14d9529..0000000 --- a/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/http-signature/node_modules/ctype/tst/ctype/tst.char.js +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Test the different forms of reading characters: - * - * - the default, a single element buffer - * - uint8, values are uint8_ts - * - int8, values are int8_ts - */ -var mod_ctype = require('../../ctype'); -var mod_assert = require('assert'); - -function test() -{ - var p, buf, res; - - buf = new Buffer(1); - buf[0] = 255; - - p = new mod_ctype.Parser({ endian: 'little'}); - res = p.readData([ { c: { type: 'char' }} ], buf, 0); - res = res['c']; - mod_assert.ok(res instanceof Buffer); - mod_assert.equal(255, res[0]); - - p = new mod_ctype.Parser({ endian: 'little', - 'char-type': 'int8' }); - res = p.readData([ { c: { type: 'char' }} ], buf, 0); - res = res['c']; - mod_assert.ok(typeof (res) == 'number', 'got typeof (res): ' + - typeof (res)); - mod_assert.equal(-1, res); - - p = new mod_ctype.Parser({ endian: 'little', - 'char-type': 'uint8' }); - res = p.readData([ { c: { type: 'char' }} ], buf, 0); - res = res['c']; - mod_assert.ok(typeof (res) == 'number', 'got typeof (res): ' + - typeof (res)); - mod_assert.equal(255, res); - -} - -test(); diff --git a/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/http-signature/node_modules/ctype/tst/ctype/tst.endian.js b/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/http-signature/node_modules/ctype/tst/ctype/tst.endian.js deleted file mode 100644 index 11fc2d2..0000000 --- a/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/http-signature/node_modules/ctype/tst/ctype/tst.endian.js +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Simple test to make sure that the endian setting works. - */ - -var mod_ctype = require('../../ctype.js'); -var mod_assert = require('assert'); - -function test() -{ - var parser, buf; - - parser = new mod_ctype.Parser({ - endian: 'little' - }); - - buf = new Buffer(2); - parser.writeData([ { key: { type: 'uint16_t' } } ], buf, 0, [ 0x1234 ]); - mod_assert.equal(buf[0], 0x34); - mod_assert.equal(buf[1], 0x12); - parser.setEndian('big'); - - parser.writeData([ { key: { type: 'uint16_t' } } ], buf, 0, [ 0x1234 ]); - mod_assert.equal(buf[0], 0x12); - mod_assert.equal(buf[1], 0x34); - - parser.setEndian('little'); - parser.writeData([ { key: { type: 'uint16_t' } } ], buf, 0, [ 0x1234 ]); - mod_assert.equal(buf[0], 0x34); - mod_assert.equal(buf[1], 0x12); -} - -function fail() -{ - var parser; - - parser = new mod_ctype.Parser({ - endian: 'little' - }); - mod_assert.throws(function () { - parser.setEndian('littlebigwrong'); - }); -} - -test(); -fail(); diff --git a/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/http-signature/node_modules/ctype/tst/ctype/tst.oldwrite.js b/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/http-signature/node_modules/ctype/tst/ctype/tst.oldwrite.js deleted file mode 100644 index 9491cf6..0000000 --- a/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/http-signature/node_modules/ctype/tst/ctype/tst.oldwrite.js +++ /dev/null @@ -1,28 +0,0 @@ -/* - * A long overdue test to go through and verify that we can read and write - * structures as well as nested structures. - */ - -var mod_ctype = require('../../ctype.js'); -var mod_assert = require('assert'); - -function test() -{ - var parser, buf, data; - parser = new mod_ctype.Parser({ - endian: 'little' - }); - parser.typedef('point_t', [ - { x: { type: 'uint8_t' } }, - { y: { type: 'uint8_t' } } - ]); - buf = new Buffer(2); - data = [ - { point: { type: 'point_t', value: [ 23, 42 ] } } - ]; - parser.writeData(data, buf, 0); - mod_assert.ok(buf[0] == 23); - mod_assert.ok(buf[1] == 42); -} - -test(); diff --git a/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/http-signature/node_modules/ctype/tst/ctype/tst.readSize.js b/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/http-signature/node_modules/ctype/tst/ctype/tst.readSize.js deleted file mode 100644 index 6c490a2..0000000 --- a/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/http-signature/node_modules/ctype/tst/ctype/tst.readSize.js +++ /dev/null @@ -1,128 +0,0 @@ -/* - * Testing to ensure we're reading the expected number bytes - */ -var mod_ctype = require('../../ctype'); -var ASSERT = require('assert'); - -function testUint8() -{ - var parser, result, buffer; - parser = new mod_ctype.Parser({ endian: 'little' }); - buffer = new Buffer('80', 'hex'); - result = parser.readStruct([ { item: { type: 'uint8_t' } } ], buffer, - 0); - ASSERT.equal(result['size'], 1); -} - -function testSint8() -{ - var parser, result, buffer; - parser = new mod_ctype.Parser({ endian: 'little' }); - buffer = new Buffer('80', 'hex'); - result = parser.readStruct([ { item: { type: 'int8_t' } } ], buffer, 0); - ASSERT.equal(result['size'], 1); -} - -function testUint16() -{ - var parser, result, buffer; - parser = new mod_ctype.Parser({ endian: 'little' }); - buffer = new Buffer('8000', 'hex'); - result = parser.readStruct([ { item: { type: 'uint16_t' } } ], buffer, - 0); - ASSERT.equal(result['size'], 2); -} - -function testSint16() -{ - var parser, result, buffer; - parser = new mod_ctype.Parser({ endian: 'little' }); - buffer = new Buffer('8000', 'hex'); - result = parser.readStruct([ { item: { type: 'int16_t' } } ], buffer, - 0); - ASSERT.equal(result['size'], 2); -} - -function testUint32() -{ - var parser, result, buffer; - parser = new mod_ctype.Parser({ endian: 'little' }); - buffer = new Buffer('80000000', 'hex'); - result = parser.readStruct([ { item: { type: 'uint32_t' } } ], buffer, - 0); - ASSERT.equal(result['size'], 4); -} - -function testSint32() -{ - var parser, result, buffer; - parser = new mod_ctype.Parser({ endian: 'little' }); - buffer = new Buffer('80000000', 'hex'); - result = parser.readStruct([ { item: { type: 'int32_t' } } ], buffer, - 0); - ASSERT.equal(result['size'], 4); -} - -function testUint64() -{ - var parser, result, buffer; - parser = new mod_ctype.Parser({ endian: 'little' }); - buffer = new Buffer('8000000000000000', 'hex'); - result = parser.readStruct([ { item: { type: 'uint64_t' } } ], buffer, - 0); - ASSERT.equal(result['size'], 8); -} - -function testSint64() -{ - var parser, result, buffer; - parser = new mod_ctype.Parser({ endian: 'little' }); - buffer = new Buffer('8000000000000000', 'hex'); - result = parser.readStruct([ { item: { type: 'int64_t' } } ], buffer, - 0); - ASSERT.equal(result['size'], 8); -} - -function testFloat() -{ - var parser, result, buffer; - parser = new mod_ctype.Parser({ endian: 'little' }); - buffer = new Buffer('ABAAAA3E', 'hex'); - result = parser.readStruct([ { item: { type: 'float' } } ], buffer, 0); - ASSERT.equal(result['size'], 4); -} - -function testDouble() -{ - var parser, result, buffer; - parser = new mod_ctype.Parser({ endian: 'little' }); - buffer = new Buffer('000000000000F03F', 'hex'); - result = parser.readStruct([ { item: { type: 'double' } } ], buffer, 0); - ASSERT.equal(result['size'], 8); -} - -function testChar() -{ - var parser, result, buffer; - parser = new mod_ctype.Parser({ endian: 'little' }); - buffer = new Buffer('t'); - result = parser.readStruct([ { item: { type: 'char' } } ], buffer, 0); - ASSERT.equal(result['size'], 1); -} - -function test() -{ - testSint8(); - testUint8(); - testSint16(); - testUint16(); - testSint32(); - testUint32(); - testSint64(); - testUint64(); - testFloat(); - testDouble(); - testChar(); -} - -test(); diff --git a/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/http-signature/node_modules/ctype/tst/ctype/tst.structw.js b/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/http-signature/node_modules/ctype/tst/ctype/tst.structw.js deleted file mode 100644 index 09c1a5b..0000000 --- a/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/http-signature/node_modules/ctype/tst/ctype/tst.structw.js +++ /dev/null @@ -1,28 +0,0 @@ -/* - * A long overdue test to go through and verify that we can read and write - * structures as well as nested structures. - */ - -var mod_ctype = require('../../ctype.js'); -var mod_assert = require('assert'); - -function test() -{ - var parser, buf, data; - parser = new mod_ctype.Parser({ - endian: 'little' - }); - parser.typedef('point_t', [ - { x: { type: 'uint8_t' } }, - { y: { type: 'uint8_t' } } - ]); - buf = new Buffer(2); - data = [ - { point: { type: 'point_t' } } - ]; - parser.writeData(data, buf, 0, [ [ 23, 42 ] ]); - mod_assert.ok(buf[0] == 23); - mod_assert.ok(buf[1] == 42); -} - -test(); diff --git a/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/http-signature/node_modules/ctype/tst/ctype/tst.writeStruct.js b/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/http-signature/node_modules/ctype/tst/ctype/tst.writeStruct.js deleted file mode 100644 index 4855666..0000000 --- a/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/http-signature/node_modules/ctype/tst/ctype/tst.writeStruct.js +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Test to verify that the offset is incremented when structures are written to. - * Hopefully we will not regress issue #41 - */ - -var mod_ctype = require('../../ctype.js'); -var mod_assert = require('assert'); - -function test() -{ - var parser, buf, data; - parser = new mod_ctype.Parser({ - endian: 'little' - }); - parser.typedef('point_t', [ - { x: { type: 'uint8_t' } }, - { y: { type: 'uint8_t' } } - ]); - buf = new Buffer(4); - data = [ - { point1: { type: 'point_t' } }, - { point2: { type: 'point_t' } } - ]; - parser.writeData(data, buf, 0, [ [ 23, 42 ], [ 91, 18 ] ]); - mod_assert.ok(buf[0] == 23); - mod_assert.ok(buf[1] == 42); - mod_assert.ok(buf[2] == 91); - mod_assert.ok(buf[3] == 18); -} - -test(); diff --git a/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/http-signature/package.json b/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/http-signature/package.json index 6d646d4..f31e5d7 100644 --- a/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/http-signature/package.json +++ b/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/http-signature/package.json @@ -1,54 +1,72 @@ { + "name": "http-signature", + "description": "Reference implementation of Joyent's HTTP Signature scheme.", + "version": "0.10.1", + "license": "MIT", "author": { "name": "Joyent, Inc" }, - "name": "http-signature", - "description": "Reference implementation of Joyent's HTTP Signature Scheme", - "version": "0.10.0", + "contributors": [ + { + "name": "Mark Cavage", + "email": "mcavage@gmail.com" + }, + { + "name": "David I. Lehn", + "email": "dil@lehn.org" + } + ], "repository": { "type": "git", "url": "git://github.com/joyent/node-http-signature.git" }, + "homepage": "https://github.com/joyent/node-http-signature/", + "bugs": { + "url": "https://github.com/joyent/node-http-signature/issues" + }, + "keywords": [ + "https", + "request" + ], "engines": { "node": ">=0.8" }, "main": "lib/index.js", "scripts": { - "test": "tap tst/*.js" + "test": "tap test/*.js" }, "dependencies": { - "assert-plus": "0.1.2", + "assert-plus": "^0.1.5", "asn1": "0.1.11", - "ctype": "0.5.2" + "ctype": "0.5.3" }, "devDependencies": { - "node-uuid": "1.4.0", + "node-uuid": "^1.4.1", "tap": "0.4.2" }, - "readme": "# node-http-signature\n\nnode-http-signature is a node.js library that has client and server components\nfor Joyent's [HTTP Signature Scheme](http_signing.md).\n\n## Usage\n\nNote the example below signs a request with the same key/cert used to start an\nHTTP server. This is almost certainly not what you actaully want, but is just\nused to illustrate the API calls; you will need to provide your own key\nmanagement in addition to this library.\n\n### Client\n\n var fs = require('fs');\n var https = require('https');\n var httpSignature = require('http-signature');\n\n var key = fs.readFileSync('./key.pem', 'ascii');\n\n var options = {\n host: 'localhost',\n port: 8443,\n path: '/',\n method: 'GET',\n headers: {}\n };\n\n // Adds a 'Date' header in, signs it, and adds the\n // 'Authorization' header in.\n var req = https.request(options, function(res) {\n console.log(res.statusCode);\n });\n\n\n httpSignature.sign(req, {\n key: key,\n keyId: './cert.pem'\n });\n\n req.end();\n\n### Server\n\n var fs = require('fs');\n var https = require('https');\n var httpSignature = require('http-signature');\n\n var options = {\n key: fs.readFileSync('./key.pem'),\n cert: fs.readFileSync('./cert.pem')\n };\n\n https.createServer(options, function (req, res) {\n var rc = 200;\n var parsed = httpSignature.parseRequest(req);\n var pub = fs.readFileSync(parsed.keyId, 'ascii');\n if (!httpSignature.verifySignature(parsed, pub))\n rc = 401;\n\n res.writeHead(rc);\n res.end();\n }).listen(8443);\n\n## Installation\n\n npm install http-signature\n\n## License\n\nMIT.\n\n## Bugs\n\nSee .\n", - "readmeFilename": "README.md", - "_id": "http-signature@0.10.0", - "dist": { - "shasum": "1494e4f5000a83c0f11bcc12d6007c530cb99582", - "tarball": "http://registry.npmjs.org/http-signature/-/http-signature-0.10.0.tgz" - }, + "_id": "http-signature@0.10.1", + "_shasum": "4fbdac132559aa8323121e540779c0a012b27e66", + "_resolved": "https://registry.npmjs.org/http-signature/-/http-signature-0.10.1.tgz", "_from": "http-signature@~0.10.0", - "_npmVersion": "1.2.18", + "_npmVersion": "1.4.28", "_npmUser": { - "name": "mcavage", - "email": "mcavage@gmail.com" + "name": "pfmooney", + "email": "patrick.f.mooney@gmail.com" }, "maintainers": [ { "name": "mcavage", "email": "mcavage@gmail.com" + }, + { + "name": "pfmooney", + "email": "patrick.f.mooney@gmail.com" } ], - "directories": {}, - "_shasum": "1494e4f5000a83c0f11bcc12d6007c530cb99582", - "_resolved": "https://registry.npmjs.org/http-signature/-/http-signature-0.10.0.tgz", - "bugs": { - "url": "https://github.com/joyent/node-http-signature/issues" + "dist": { + "shasum": "4fbdac132559aa8323121e540779c0a012b27e66", + "tarball": "http://registry.npmjs.org/http-signature/-/http-signature-0.10.1.tgz" }, - "homepage": "https://github.com/joyent/node-http-signature" + "directories": {}, + "readme": "ERROR: No README data found!" } diff --git a/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/mime-types/.npmignore b/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/mime-types/.npmignore new file mode 100644 index 0000000..919d51b --- /dev/null +++ b/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/mime-types/.npmignore @@ -0,0 +1,14 @@ +test +build.js + +# OS generated files # +###################### +.DS_Store* +# Icon? +ehthumbs.db +Thumbs.db + +# Node.js # +########### +node_modules +npm-debug.log diff --git a/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/mime-types/.travis.yml b/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/mime-types/.travis.yml new file mode 100644 index 0000000..73c85c6 --- /dev/null +++ b/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/mime-types/.travis.yml @@ -0,0 +1,12 @@ +language: node_js +node_js: + - "0.8" + - "0.10" + - "0.11" +matrix: + allow_failures: + - node_js: "0.11" + fast_finish: true +before_install: + # remove build script deps before install + - node -pe 'f="./package.json";p=require(f);d=p.devDependencies;for(k in d){if("co"===k.substr(0,2))delete d[k]}require("fs").writeFileSync(f,JSON.stringify(p,null,2))' diff --git a/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/mime-types/LICENSE b/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/mime-types/LICENSE new file mode 100644 index 0000000..a7ae8ee --- /dev/null +++ b/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/mime-types/LICENSE @@ -0,0 +1,22 @@ + +The MIT License (MIT) + +Copyright (c) 2014 Jonathan Ong me@jongleberry.com + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/mime-types/Makefile b/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/mime-types/Makefile new file mode 100644 index 0000000..ceaf011 --- /dev/null +++ b/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/mime-types/Makefile @@ -0,0 +1,9 @@ + +build: + node --harmony-generators build.js + +test: + node test/mime.js + mocha --require should --reporter spec test/test.js + +.PHONY: build test diff --git a/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/mime-types/README.md b/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/mime-types/README.md new file mode 100644 index 0000000..8e21ee1 --- /dev/null +++ b/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/mime-types/README.md @@ -0,0 +1,101 @@ +# mime-types +[![NPM version](https://badge.fury.io/js/mime-types.svg)](https://badge.fury.io/js/mime-types) [![Build Status](https://travis-ci.org/expressjs/mime-types.svg?branch=master)](https://travis-ci.org/expressjs/mime-types) + +The ultimate javascript content-type utility. + +### Install + +```sh +$ npm install mime-types +``` + +#### Similar to [node-mime](https://github.com/broofa/node-mime), except: + +- __No fallbacks.__ Instead of naively returning the first available type, `mime-types` simply returns `false`, so do `var type = mime.lookup('unrecognized') || 'application/octet-stream'`. +- No `new Mime()` business, so you could do `var lookup = require('mime-types').lookup`. +- Additional mime types are added such as jade and stylus. Feel free to add more! +- Browser support via Browserify and Component by converting lists to JSON files. + +Otherwise, the API is compatible. + +### Adding Types + +If you'd like to add additional types, +simply create a PR adding the type to `custom.json` and +a reference link to the [sources](SOURCES.md). + +Do __NOT__ edit `mime.json` or `node.json`. +Those are pulled using `build.js`. +You should only touch `custom.json`. + +## API + +```js +var mime = require('mime-types') +``` + +All functions return `false` if input is invalid or not found. + +### mime.lookup(path) + +Lookup the content-type associated with a file. + +```js +mime.lookup('json') // 'application/json' +mime.lookup('.md') // 'text/x-markdown' +mime.lookup('file.html') // 'text/html' +mime.lookup('folder/file.js') // 'application/javascript' + +mime.lookup('cats') // false +``` + +### mime.contentType(type) + +Create a full content-type header given a content-type or extension. + +```js +mime.contentType('markdown') // 'text/x-markdown; charset=utf-8' +mime.contentType('file.json') // 'application/json; charset=utf-8' +``` + +### mime.extension(type) + +Get the default extension for a content-type. + +```js +mime.extension('application/octet-stream') // 'bin' +``` + +### mime.charset(type) + +Lookup the implied default charset of a content-type. + +```js +mime.charset('text/x-markdown') // 'UTF-8' +``` + +### mime.types[extension] = type + +A map of content-types by extension. + +### mime.extensions[type] = [extensions] + +A map of extensions by content-type. + +### mime.define(types) + +Globally add definitions. +`types` must be an object of the form: + +```js +{ + "": [extensions...], + "": [extensions...] +} +``` + +See the `.json` files in `lib/` for examples. + +## License + +[MIT](LICENSE) diff --git a/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/mime-types/SOURCES.md b/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/mime-types/SOURCES.md new file mode 100644 index 0000000..1d65012 --- /dev/null +++ b/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/mime-types/SOURCES.md @@ -0,0 +1,17 @@ + +### Sources for custom types + +This is a list of sources for any custom mime types. +When adding custom mime types, please link to where you found the mime type, +even if it's from an unofficial source. + +- `text/coffeescript` - http://coffeescript.org/#scripts +- `text/x-handlebars-template` - https://handlebarsjs.com/#getting-started +- `text/x-sass` & `text/x-scss` - https://github.com/janlelis/rubybuntu-mime/blob/master/sass.xml +- `text.jsx` - http://facebook.github.io/react/docs/getting-started.html [[2]](https://github.com/facebook/react/blob/f230e0a03154e6f8a616e0da1fb3d97ffa1a6472/vendor/browser-transforms.js#L210) + +[Sources for node.json types](https://github.com/broofa/node-mime/blob/master/types/node.types) + +### Notes on weird types + +- `font/opentype` - This type is technically invalid according to the spec. No valid types begin with `font/`. No-one uses the official type of `application/vnd.ms-opentype` as the community standardized `application/x-font-otf`. However, chrome logs nonsense warnings unless opentype fonts are served with `font/opentype`. [[1]](http://stackoverflow.com/questions/2871655/proper-mime-type-for-fonts) diff --git a/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/mime-types/component.json b/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/mime-types/component.json new file mode 100644 index 0000000..fa67a6d --- /dev/null +++ b/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/mime-types/component.json @@ -0,0 +1,16 @@ +{ + "name": "mime-types", + "description": "The ultimate javascript content-type utility.", + "version": "0.1.0", + "author": { + "name": "Jonathan Ong", + "email": "me@jongleberry.com", + "url": "http://jongleberry.com", + "twitter": "https://twitter.com/jongleberry" + }, + "repository": "expressjs/mime-types", + "license": "MIT", + "main": "lib/index.js", + "scripts": ["lib/index.js"], + "json": ["mime.json", "node.json", "custom.json"] +} diff --git a/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/mime-types/lib/custom.json b/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/mime-types/lib/custom.json new file mode 100644 index 0000000..6137da3 --- /dev/null +++ b/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/mime-types/lib/custom.json @@ -0,0 +1,27 @@ +{ + "text/jade": [ + "jade" + ], + "text/stylus": [ + "stylus", + "styl" + ], + "text/less": [ + "less" + ], + "text/x-sass": [ + "sass" + ], + "text/x-scss": [ + "scss" + ], + "text/coffeescript": [ + "coffee" + ], + "text/x-handlebars-template": [ + "hbs" + ], + "text/jsx": [ + "jsx" + ] +} diff --git a/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/mime-types/lib/index.js b/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/mime-types/lib/index.js new file mode 100644 index 0000000..cc2d155 --- /dev/null +++ b/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/mime-types/lib/index.js @@ -0,0 +1,75 @@ + +// types[extension] = type +exports.types = Object.create(null) +// extensions[type] = [extensions] +exports.extensions = Object.create(null) +// define more mime types +exports.define = define + +// store the json files +exports.json = { + mime: require('./mime.json'), + node: require('./node.json'), + custom: require('./custom.json'), +} + +exports.lookup = function (string) { + if (!string || typeof string !== "string") return false + string = string.replace(/.*[\.\/\\]/, '').toLowerCase() + if (!string) return false + return exports.types[string] || false +} + +exports.extension = function (type) { + if (!type || typeof type !== "string") return false + type = type.match(/^\s*([^;\s]*)(?:;|\s|$)/) + if (!type) return false + var exts = exports.extensions[type[1].toLowerCase()] + if (!exts || !exts.length) return false + return exts[0] +} + +// type has to be an exact mime type +exports.charset = function (type) { + // special cases + switch (type) { + case 'application/json': return 'UTF-8' + case 'application/javascript': return 'UTF-8' + } + + // default text/* to utf-8 + if (/^text\//.test(type)) return 'UTF-8' + + return false +} + +// backwards compatibility +exports.charsets = { + lookup: exports.charset +} + +exports.contentType = function (type) { + if (!type || typeof type !== "string") return false + if (!~type.indexOf('/')) type = exports.lookup(type) + if (!type) return false + if (!~type.indexOf('charset')) { + var charset = exports.charset(type) + if (charset) type += '; charset=' + charset.toLowerCase() + } + return type +} + +define(exports.json.mime) +define(exports.json.node) +define(exports.json.custom) + +function define(json) { + Object.keys(json).forEach(function (type) { + var exts = json[type] || [] + exports.extensions[type] = exports.extensions[type] || [] + exts.forEach(function (ext) { + if (!~exports.extensions[type].indexOf(ext)) exports.extensions[type].push(ext) + exports.types[ext] = type + }) + }) +} diff --git a/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/mime-types/lib/mime.json b/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/mime-types/lib/mime.json new file mode 100644 index 0000000..f445a86 --- /dev/null +++ b/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/mime-types/lib/mime.json @@ -0,0 +1,3317 @@ +{ + "application/1d-interleaved-parityfec": [], + "application/3gpp-ims+xml": [], + "application/activemessage": [], + "application/andrew-inset": [ + "ez" + ], + "application/applefile": [], + "application/applixware": [ + "aw" + ], + "application/atom+xml": [ + "atom" + ], + "application/atomcat+xml": [ + "atomcat" + ], + "application/atomicmail": [], + "application/atomsvc+xml": [ + "atomsvc" + ], + "application/auth-policy+xml": [], + "application/batch-smtp": [], + "application/beep+xml": [], + "application/calendar+xml": [], + "application/cals-1840": [], + "application/ccmp+xml": [], + "application/ccxml+xml": [ + "ccxml" + ], + "application/cdmi-capability": [ + "cdmia" + ], + "application/cdmi-container": [ + "cdmic" + ], + "application/cdmi-domain": [ + "cdmid" + ], + "application/cdmi-object": [ + "cdmio" + ], + "application/cdmi-queue": [ + "cdmiq" + ], + "application/cea-2018+xml": [], + "application/cellml+xml": [], + "application/cfw": [], + "application/cnrp+xml": [], + "application/commonground": [], + "application/conference-info+xml": [], + "application/cpl+xml": [], + "application/csta+xml": [], + "application/cstadata+xml": [], + "application/cu-seeme": [ + "cu" + ], + "application/cybercash": [], + "application/davmount+xml": [ + "davmount" + ], + "application/dca-rft": [], + "application/dec-dx": [], + "application/dialog-info+xml": [], + "application/dicom": [], + "application/dns": [], + "application/docbook+xml": [ + "dbk" + ], + "application/dskpp+xml": [], + "application/dssc+der": [ + "dssc" + ], + "application/dssc+xml": [ + "xdssc" + ], + "application/dvcs": [], + "application/ecmascript": [ + "ecma" + ], + "application/edi-consent": [], + "application/edi-x12": [], + "application/edifact": [], + "application/emma+xml": [ + "emma" + ], + "application/epp+xml": [], + "application/epub+zip": [ + "epub" + ], + "application/eshop": [], + "application/example": [], + "application/exi": [ + "exi" + ], + "application/fastinfoset": [], + "application/fastsoap": [], + "application/fits": [], + "application/font-tdpfr": [ + "pfr" + ], + "application/framework-attributes+xml": [], + "application/gml+xml": [ + "gml" + ], + "application/gpx+xml": [ + "gpx" + ], + "application/gxf": [ + "gxf" + ], + "application/h224": [], + "application/held+xml": [], + "application/http": [], + "application/hyperstudio": [ + "stk" + ], + "application/ibe-key-request+xml": [], + "application/ibe-pkg-reply+xml": [], + "application/ibe-pp-data": [], + "application/iges": [], + "application/im-iscomposing+xml": [], + "application/index": [], + "application/index.cmd": [], + "application/index.obj": [], + "application/index.response": [], + "application/index.vnd": [], + "application/inkml+xml": [ + "ink", + "inkml" + ], + "application/iotp": [], + "application/ipfix": [ + "ipfix" + ], + "application/ipp": [], + "application/isup": [], + "application/java-archive": [ + "jar" + ], + "application/java-serialized-object": [ + "ser" + ], + "application/java-vm": [ + "class" + ], + "application/javascript": [ + "js" + ], + "application/json": [ + "json" + ], + "application/jsonml+json": [ + "jsonml" + ], + "application/kpml-request+xml": [], + "application/kpml-response+xml": [], + "application/lost+xml": [ + "lostxml" + ], + "application/mac-binhex40": [ + "hqx" + ], + "application/mac-compactpro": [ + "cpt" + ], + "application/macwriteii": [], + "application/mads+xml": [ + "mads" + ], + "application/marc": [ + "mrc" + ], + "application/marcxml+xml": [ + "mrcx" + ], + "application/mathematica": [ + "ma", + "nb", + "mb" + ], + "application/mathml-content+xml": [], + "application/mathml-presentation+xml": [], + "application/mathml+xml": [ + "mathml" + ], + "application/mbms-associated-procedure-description+xml": [], + "application/mbms-deregister+xml": [], + "application/mbms-envelope+xml": [], + "application/mbms-msk+xml": [], + "application/mbms-msk-response+xml": [], + "application/mbms-protection-description+xml": [], + "application/mbms-reception-report+xml": [], + "application/mbms-register+xml": [], + "application/mbms-register-response+xml": [], + "application/mbms-user-service-description+xml": [], + "application/mbox": [ + "mbox" + ], + "application/media_control+xml": [], + "application/mediaservercontrol+xml": [ + "mscml" + ], + "application/metalink+xml": [ + "metalink" + ], + "application/metalink4+xml": [ + "meta4" + ], + "application/mets+xml": [ + "mets" + ], + "application/mikey": [], + "application/mods+xml": [ + "mods" + ], + "application/moss-keys": [], + "application/moss-signature": [], + "application/mosskey-data": [], + "application/mosskey-request": [], + "application/mp21": [ + "m21", + "mp21" + ], + "application/mp4": [ + "mp4s" + ], + "application/mpeg4-generic": [], + "application/mpeg4-iod": [], + "application/mpeg4-iod-xmt": [], + "application/msc-ivr+xml": [], + "application/msc-mixer+xml": [], + "application/msword": [ + "doc", + "dot" + ], + "application/mxf": [ + "mxf" + ], + "application/nasdata": [], + "application/news-checkgroups": [], + "application/news-groupinfo": [], + "application/news-transmission": [], + "application/nss": [], + "application/ocsp-request": [], + "application/ocsp-response": [], + "application/octet-stream": [ + "bin", + "dms", + "lrf", + "mar", + "so", + "dist", + "distz", + "pkg", + "bpk", + "dump", + "elc", + "deploy" + ], + "application/oda": [ + "oda" + ], + "application/oebps-package+xml": [ + "opf" + ], + "application/ogg": [ + "ogx" + ], + "application/omdoc+xml": [ + "omdoc" + ], + "application/onenote": [ + "onetoc", + "onetoc2", + "onetmp", + "onepkg" + ], + "application/oxps": [ + "oxps" + ], + "application/parityfec": [], + "application/patch-ops-error+xml": [ + "xer" + ], + "application/pdf": [ + "pdf" + ], + "application/pgp-encrypted": [ + "pgp" + ], + "application/pgp-keys": [], + "application/pgp-signature": [ + "asc", + "sig" + ], + "application/pics-rules": [ + "prf" + ], + "application/pidf+xml": [], + "application/pidf-diff+xml": [], + "application/pkcs10": [ + "p10" + ], + "application/pkcs7-mime": [ + "p7m", + "p7c" + ], + "application/pkcs7-signature": [ + "p7s" + ], + "application/pkcs8": [ + "p8" + ], + "application/pkix-attr-cert": [ + "ac" + ], + "application/pkix-cert": [ + "cer" + ], + "application/pkix-crl": [ + "crl" + ], + "application/pkix-pkipath": [ + "pkipath" + ], + "application/pkixcmp": [ + "pki" + ], + "application/pls+xml": [ + "pls" + ], + "application/poc-settings+xml": [], + "application/postscript": [ + "ai", + "eps", + "ps" + ], + "application/prs.alvestrand.titrax-sheet": [], + "application/prs.cww": [ + "cww" + ], + "application/prs.nprend": [], + "application/prs.plucker": [], + "application/prs.rdf-xml-crypt": [], + "application/prs.xsf+xml": [], + "application/pskc+xml": [ + "pskcxml" + ], + "application/qsig": [], + "application/rdf+xml": [ + "rdf" + ], + "application/reginfo+xml": [ + "rif" + ], + "application/relax-ng-compact-syntax": [ + "rnc" + ], + "application/remote-printing": [], + "application/resource-lists+xml": [ + "rl" + ], + "application/resource-lists-diff+xml": [ + "rld" + ], + "application/riscos": [], + "application/rlmi+xml": [], + "application/rls-services+xml": [ + "rs" + ], + "application/rpki-ghostbusters": [ + "gbr" + ], + "application/rpki-manifest": [ + "mft" + ], + "application/rpki-roa": [ + "roa" + ], + "application/rpki-updown": [], + "application/rsd+xml": [ + "rsd" + ], + "application/rss+xml": [ + "rss" + ], + "application/rtf": [ + "rtf" + ], + "application/rtx": [], + "application/samlassertion+xml": [], + "application/samlmetadata+xml": [], + "application/sbml+xml": [ + "sbml" + ], + "application/scvp-cv-request": [ + "scq" + ], + "application/scvp-cv-response": [ + "scs" + ], + "application/scvp-vp-request": [ + "spq" + ], + "application/scvp-vp-response": [ + "spp" + ], + "application/sdp": [ + "sdp" + ], + "application/set-payment": [], + "application/set-payment-initiation": [ + "setpay" + ], + "application/set-registration": [], + "application/set-registration-initiation": [ + "setreg" + ], + "application/sgml": [], + "application/sgml-open-catalog": [], + "application/shf+xml": [ + "shf" + ], + "application/sieve": [], + "application/simple-filter+xml": [], + "application/simple-message-summary": [], + "application/simplesymbolcontainer": [], + "application/slate": [], + "application/smil": [], + "application/smil+xml": [ + "smi", + "smil" + ], + "application/soap+fastinfoset": [], + "application/soap+xml": [], + "application/sparql-query": [ + "rq" + ], + "application/sparql-results+xml": [ + "srx" + ], + "application/spirits-event+xml": [], + "application/srgs": [ + "gram" + ], + "application/srgs+xml": [ + "grxml" + ], + "application/sru+xml": [ + "sru" + ], + "application/ssdl+xml": [ + "ssdl" + ], + "application/ssml+xml": [ + "ssml" + ], + "application/tamp-apex-update": [], + "application/tamp-apex-update-confirm": [], + "application/tamp-community-update": [], + "application/tamp-community-update-confirm": [], + "application/tamp-error": [], + "application/tamp-sequence-adjust": [], + "application/tamp-sequence-adjust-confirm": [], + "application/tamp-status-query": [], + "application/tamp-status-response": [], + "application/tamp-update": [], + "application/tamp-update-confirm": [], + "application/tei+xml": [ + "tei", + "teicorpus" + ], + "application/thraud+xml": [ + "tfi" + ], + "application/timestamp-query": [], + "application/timestamp-reply": [], + "application/timestamped-data": [ + "tsd" + ], + "application/tve-trigger": [], + "application/ulpfec": [], + "application/vcard+xml": [], + "application/vemmi": [], + "application/vividence.scriptfile": [], + "application/vnd.3gpp.bsf+xml": [], + "application/vnd.3gpp.pic-bw-large": [ + "plb" + ], + "application/vnd.3gpp.pic-bw-small": [ + "psb" + ], + "application/vnd.3gpp.pic-bw-var": [ + "pvb" + ], + "application/vnd.3gpp.sms": [], + "application/vnd.3gpp2.bcmcsinfo+xml": [], + "application/vnd.3gpp2.sms": [], + "application/vnd.3gpp2.tcap": [ + "tcap" + ], + "application/vnd.3m.post-it-notes": [ + "pwn" + ], + "application/vnd.accpac.simply.aso": [ + "aso" + ], + "application/vnd.accpac.simply.imp": [ + "imp" + ], + "application/vnd.acucobol": [ + "acu" + ], + "application/vnd.acucorp": [ + "atc", + "acutc" + ], + "application/vnd.adobe.air-application-installer-package+zip": [ + "air" + ], + "application/vnd.adobe.formscentral.fcdt": [ + "fcdt" + ], + "application/vnd.adobe.fxp": [ + "fxp", + "fxpl" + ], + "application/vnd.adobe.partial-upload": [], + "application/vnd.adobe.xdp+xml": [ + "xdp" + ], + "application/vnd.adobe.xfdf": [ + "xfdf" + ], + "application/vnd.aether.imp": [], + "application/vnd.ah-barcode": [], + "application/vnd.ahead.space": [ + "ahead" + ], + "application/vnd.airzip.filesecure.azf": [ + "azf" + ], + "application/vnd.airzip.filesecure.azs": [ + "azs" + ], + "application/vnd.amazon.ebook": [ + "azw" + ], + "application/vnd.americandynamics.acc": [ + "acc" + ], + "application/vnd.amiga.ami": [ + "ami" + ], + "application/vnd.amundsen.maze+xml": [], + "application/vnd.android.package-archive": [ + "apk" + ], + "application/vnd.anser-web-certificate-issue-initiation": [ + "cii" + ], + "application/vnd.anser-web-funds-transfer-initiation": [ + "fti" + ], + "application/vnd.antix.game-component": [ + "atx" + ], + "application/vnd.apple.installer+xml": [ + "mpkg" + ], + "application/vnd.apple.mpegurl": [ + "m3u8" + ], + "application/vnd.arastra.swi": [], + "application/vnd.aristanetworks.swi": [ + "swi" + ], + "application/vnd.astraea-software.iota": [ + "iota" + ], + "application/vnd.audiograph": [ + "aep" + ], + "application/vnd.autopackage": [], + "application/vnd.avistar+xml": [], + "application/vnd.blueice.multipass": [ + "mpm" + ], + "application/vnd.bluetooth.ep.oob": [], + "application/vnd.bmi": [ + "bmi" + ], + "application/vnd.businessobjects": [ + "rep" + ], + "application/vnd.cab-jscript": [], + "application/vnd.canon-cpdl": [], + "application/vnd.canon-lips": [], + "application/vnd.cendio.thinlinc.clientconf": [], + "application/vnd.chemdraw+xml": [ + "cdxml" + ], + "application/vnd.chipnuts.karaoke-mmd": [ + "mmd" + ], + "application/vnd.cinderella": [ + "cdy" + ], + "application/vnd.cirpack.isdn-ext": [], + "application/vnd.claymore": [ + "cla" + ], + "application/vnd.cloanto.rp9": [ + "rp9" + ], + "application/vnd.clonk.c4group": [ + "c4g", + "c4d", + "c4f", + "c4p", + "c4u" + ], + "application/vnd.cluetrust.cartomobile-config": [ + "c11amc" + ], + "application/vnd.cluetrust.cartomobile-config-pkg": [ + "c11amz" + ], + "application/vnd.collection+json": [], + "application/vnd.commerce-battelle": [], + "application/vnd.commonspace": [ + "csp" + ], + "application/vnd.contact.cmsg": [ + "cdbcmsg" + ], + "application/vnd.cosmocaller": [ + "cmc" + ], + "application/vnd.crick.clicker": [ + "clkx" + ], + "application/vnd.crick.clicker.keyboard": [ + "clkk" + ], + "application/vnd.crick.clicker.palette": [ + "clkp" + ], + "application/vnd.crick.clicker.template": [ + "clkt" + ], + "application/vnd.crick.clicker.wordbank": [ + "clkw" + ], + "application/vnd.criticaltools.wbs+xml": [ + "wbs" + ], + "application/vnd.ctc-posml": [ + "pml" + ], + "application/vnd.ctct.ws+xml": [], + "application/vnd.cups-pdf": [], + "application/vnd.cups-postscript": [], + "application/vnd.cups-ppd": [ + "ppd" + ], + "application/vnd.cups-raster": [], + "application/vnd.cups-raw": [], + "application/vnd.curl": [], + "application/vnd.curl.car": [ + "car" + ], + "application/vnd.curl.pcurl": [ + "pcurl" + ], + "application/vnd.cybank": [], + "application/vnd.dart": [ + "dart" + ], + "application/vnd.data-vision.rdz": [ + "rdz" + ], + "application/vnd.dece.data": [ + "uvf", + "uvvf", + "uvd", + "uvvd" + ], + "application/vnd.dece.ttml+xml": [ + "uvt", + "uvvt" + ], + "application/vnd.dece.unspecified": [ + "uvx", + "uvvx" + ], + "application/vnd.dece.zip": [ + "uvz", + "uvvz" + ], + "application/vnd.denovo.fcselayout-link": [ + "fe_launch" + ], + "application/vnd.dir-bi.plate-dl-nosuffix": [], + "application/vnd.dna": [ + "dna" + ], + "application/vnd.dolby.mlp": [ + "mlp" + ], + "application/vnd.dolby.mobile.1": [], + "application/vnd.dolby.mobile.2": [], + "application/vnd.dpgraph": [ + "dpg" + ], + "application/vnd.dreamfactory": [ + "dfac" + ], + "application/vnd.ds-keypoint": [ + "kpxx" + ], + "application/vnd.dvb.ait": [ + "ait" + ], + "application/vnd.dvb.dvbj": [], + "application/vnd.dvb.esgcontainer": [], + "application/vnd.dvb.ipdcdftnotifaccess": [], + "application/vnd.dvb.ipdcesgaccess": [], + "application/vnd.dvb.ipdcesgaccess2": [], + "application/vnd.dvb.ipdcesgpdd": [], + "application/vnd.dvb.ipdcroaming": [], + "application/vnd.dvb.iptv.alfec-base": [], + "application/vnd.dvb.iptv.alfec-enhancement": [], + "application/vnd.dvb.notif-aggregate-root+xml": [], + "application/vnd.dvb.notif-container+xml": [], + "application/vnd.dvb.notif-generic+xml": [], + "application/vnd.dvb.notif-ia-msglist+xml": [], + "application/vnd.dvb.notif-ia-registration-request+xml": [], + "application/vnd.dvb.notif-ia-registration-response+xml": [], + "application/vnd.dvb.notif-init+xml": [], + "application/vnd.dvb.pfr": [], + "application/vnd.dvb.service": [ + "svc" + ], + "application/vnd.dxr": [], + "application/vnd.dynageo": [ + "geo" + ], + "application/vnd.easykaraoke.cdgdownload": [], + "application/vnd.ecdis-update": [], + "application/vnd.ecowin.chart": [ + "mag" + ], + "application/vnd.ecowin.filerequest": [], + "application/vnd.ecowin.fileupdate": [], + "application/vnd.ecowin.series": [], + "application/vnd.ecowin.seriesrequest": [], + "application/vnd.ecowin.seriesupdate": [], + "application/vnd.emclient.accessrequest+xml": [], + "application/vnd.enliven": [ + "nml" + ], + "application/vnd.eprints.data+xml": [], + "application/vnd.epson.esf": [ + "esf" + ], + "application/vnd.epson.msf": [ + "msf" + ], + "application/vnd.epson.quickanime": [ + "qam" + ], + "application/vnd.epson.salt": [ + "slt" + ], + "application/vnd.epson.ssf": [ + "ssf" + ], + "application/vnd.ericsson.quickcall": [], + "application/vnd.eszigno3+xml": [ + "es3", + "et3" + ], + "application/vnd.etsi.aoc+xml": [], + "application/vnd.etsi.cug+xml": [], + "application/vnd.etsi.iptvcommand+xml": [], + "application/vnd.etsi.iptvdiscovery+xml": [], + "application/vnd.etsi.iptvprofile+xml": [], + "application/vnd.etsi.iptvsad-bc+xml": [], + "application/vnd.etsi.iptvsad-cod+xml": [], + "application/vnd.etsi.iptvsad-npvr+xml": [], + "application/vnd.etsi.iptvservice+xml": [], + "application/vnd.etsi.iptvsync+xml": [], + "application/vnd.etsi.iptvueprofile+xml": [], + "application/vnd.etsi.mcid+xml": [], + "application/vnd.etsi.overload-control-policy-dataset+xml": [], + "application/vnd.etsi.sci+xml": [], + "application/vnd.etsi.simservs+xml": [], + "application/vnd.etsi.tsl+xml": [], + "application/vnd.etsi.tsl.der": [], + "application/vnd.eudora.data": [], + "application/vnd.ezpix-album": [ + "ez2" + ], + "application/vnd.ezpix-package": [ + "ez3" + ], + "application/vnd.f-secure.mobile": [], + "application/vnd.fdf": [ + "fdf" + ], + "application/vnd.fdsn.mseed": [ + "mseed" + ], + "application/vnd.fdsn.seed": [ + "seed", + "dataless" + ], + "application/vnd.ffsns": [], + "application/vnd.fints": [], + "application/vnd.flographit": [ + "gph" + ], + "application/vnd.fluxtime.clip": [ + "ftc" + ], + "application/vnd.font-fontforge-sfd": [], + "application/vnd.framemaker": [ + "fm", + "frame", + "maker", + "book" + ], + "application/vnd.frogans.fnc": [ + "fnc" + ], + "application/vnd.frogans.ltf": [ + "ltf" + ], + "application/vnd.fsc.weblaunch": [ + "fsc" + ], + "application/vnd.fujitsu.oasys": [ + "oas" + ], + "application/vnd.fujitsu.oasys2": [ + "oa2" + ], + "application/vnd.fujitsu.oasys3": [ + "oa3" + ], + "application/vnd.fujitsu.oasysgp": [ + "fg5" + ], + "application/vnd.fujitsu.oasysprs": [ + "bh2" + ], + "application/vnd.fujixerox.art-ex": [], + "application/vnd.fujixerox.art4": [], + "application/vnd.fujixerox.hbpl": [], + "application/vnd.fujixerox.ddd": [ + "ddd" + ], + "application/vnd.fujixerox.docuworks": [ + "xdw" + ], + "application/vnd.fujixerox.docuworks.binder": [ + "xbd" + ], + "application/vnd.fut-misnet": [], + "application/vnd.fuzzysheet": [ + "fzs" + ], + "application/vnd.genomatix.tuxedo": [ + "txd" + ], + "application/vnd.geocube+xml": [], + "application/vnd.geogebra.file": [ + "ggb" + ], + "application/vnd.geogebra.tool": [ + "ggt" + ], + "application/vnd.geometry-explorer": [ + "gex", + "gre" + ], + "application/vnd.geonext": [ + "gxt" + ], + "application/vnd.geoplan": [ + "g2w" + ], + "application/vnd.geospace": [ + "g3w" + ], + "application/vnd.globalplatform.card-content-mgt": [], + "application/vnd.globalplatform.card-content-mgt-response": [], + "application/vnd.gmx": [ + "gmx" + ], + "application/vnd.google-earth.kml+xml": [ + "kml" + ], + "application/vnd.google-earth.kmz": [ + "kmz" + ], + "application/vnd.grafeq": [ + "gqf", + "gqs" + ], + "application/vnd.gridmp": [], + "application/vnd.groove-account": [ + "gac" + ], + "application/vnd.groove-help": [ + "ghf" + ], + "application/vnd.groove-identity-message": [ + "gim" + ], + "application/vnd.groove-injector": [ + "grv" + ], + "application/vnd.groove-tool-message": [ + "gtm" + ], + "application/vnd.groove-tool-template": [ + "tpl" + ], + "application/vnd.groove-vcard": [ + "vcg" + ], + "application/vnd.hal+json": [], + "application/vnd.hal+xml": [ + "hal" + ], + "application/vnd.handheld-entertainment+xml": [ + "zmm" + ], + "application/vnd.hbci": [ + "hbci" + ], + "application/vnd.hcl-bireports": [], + "application/vnd.hhe.lesson-player": [ + "les" + ], + "application/vnd.hp-hpgl": [ + "hpgl" + ], + "application/vnd.hp-hpid": [ + "hpid" + ], + "application/vnd.hp-hps": [ + "hps" + ], + "application/vnd.hp-jlyt": [ + "jlt" + ], + "application/vnd.hp-pcl": [ + "pcl" + ], + "application/vnd.hp-pclxl": [ + "pclxl" + ], + "application/vnd.httphone": [], + "application/vnd.hzn-3d-crossword": [], + "application/vnd.ibm.afplinedata": [], + "application/vnd.ibm.electronic-media": [], + "application/vnd.ibm.minipay": [ + "mpy" + ], + "application/vnd.ibm.modcap": [ + "afp", + "listafp", + "list3820" + ], + "application/vnd.ibm.rights-management": [ + "irm" + ], + "application/vnd.ibm.secure-container": [ + "sc" + ], + "application/vnd.iccprofile": [ + "icc", + "icm" + ], + "application/vnd.igloader": [ + "igl" + ], + "application/vnd.immervision-ivp": [ + "ivp" + ], + "application/vnd.immervision-ivu": [ + "ivu" + ], + "application/vnd.informedcontrol.rms+xml": [], + "application/vnd.informix-visionary": [], + "application/vnd.infotech.project": [], + "application/vnd.infotech.project+xml": [], + "application/vnd.innopath.wamp.notification": [], + "application/vnd.insors.igm": [ + "igm" + ], + "application/vnd.intercon.formnet": [ + "xpw", + "xpx" + ], + "application/vnd.intergeo": [ + "i2g" + ], + "application/vnd.intertrust.digibox": [], + "application/vnd.intertrust.nncp": [], + "application/vnd.intu.qbo": [ + "qbo" + ], + "application/vnd.intu.qfx": [ + "qfx" + ], + "application/vnd.iptc.g2.conceptitem+xml": [], + "application/vnd.iptc.g2.knowledgeitem+xml": [], + "application/vnd.iptc.g2.newsitem+xml": [], + "application/vnd.iptc.g2.newsmessage+xml": [], + "application/vnd.iptc.g2.packageitem+xml": [], + "application/vnd.iptc.g2.planningitem+xml": [], + "application/vnd.ipunplugged.rcprofile": [ + "rcprofile" + ], + "application/vnd.irepository.package+xml": [ + "irp" + ], + "application/vnd.is-xpr": [ + "xpr" + ], + "application/vnd.isac.fcs": [ + "fcs" + ], + "application/vnd.jam": [ + "jam" + ], + "application/vnd.japannet-directory-service": [], + "application/vnd.japannet-jpnstore-wakeup": [], + "application/vnd.japannet-payment-wakeup": [], + "application/vnd.japannet-registration": [], + "application/vnd.japannet-registration-wakeup": [], + "application/vnd.japannet-setstore-wakeup": [], + "application/vnd.japannet-verification": [], + "application/vnd.japannet-verification-wakeup": [], + "application/vnd.jcp.javame.midlet-rms": [ + "rms" + ], + "application/vnd.jisp": [ + "jisp" + ], + "application/vnd.joost.joda-archive": [ + "joda" + ], + "application/vnd.kahootz": [ + "ktz", + "ktr" + ], + "application/vnd.kde.karbon": [ + "karbon" + ], + "application/vnd.kde.kchart": [ + "chrt" + ], + "application/vnd.kde.kformula": [ + "kfo" + ], + "application/vnd.kde.kivio": [ + "flw" + ], + "application/vnd.kde.kontour": [ + "kon" + ], + "application/vnd.kde.kpresenter": [ + "kpr", + "kpt" + ], + "application/vnd.kde.kspread": [ + "ksp" + ], + "application/vnd.kde.kword": [ + "kwd", + "kwt" + ], + "application/vnd.kenameaapp": [ + "htke" + ], + "application/vnd.kidspiration": [ + "kia" + ], + "application/vnd.kinar": [ + "kne", + "knp" + ], + "application/vnd.koan": [ + "skp", + "skd", + "skt", + "skm" + ], + "application/vnd.kodak-descriptor": [ + "sse" + ], + "application/vnd.las.las+xml": [ + "lasxml" + ], + "application/vnd.liberty-request+xml": [], + "application/vnd.llamagraphics.life-balance.desktop": [ + "lbd" + ], + "application/vnd.llamagraphics.life-balance.exchange+xml": [ + "lbe" + ], + "application/vnd.lotus-1-2-3": [ + "123" + ], + "application/vnd.lotus-approach": [ + "apr" + ], + "application/vnd.lotus-freelance": [ + "pre" + ], + "application/vnd.lotus-notes": [ + "nsf" + ], + "application/vnd.lotus-organizer": [ + "org" + ], + "application/vnd.lotus-screencam": [ + "scm" + ], + "application/vnd.lotus-wordpro": [ + "lwp" + ], + "application/vnd.macports.portpkg": [ + "portpkg" + ], + "application/vnd.marlin.drm.actiontoken+xml": [], + "application/vnd.marlin.drm.conftoken+xml": [], + "application/vnd.marlin.drm.license+xml": [], + "application/vnd.marlin.drm.mdcf": [], + "application/vnd.mcd": [ + "mcd" + ], + "application/vnd.medcalcdata": [ + "mc1" + ], + "application/vnd.mediastation.cdkey": [ + "cdkey" + ], + "application/vnd.meridian-slingshot": [], + "application/vnd.mfer": [ + "mwf" + ], + "application/vnd.mfmp": [ + "mfm" + ], + "application/vnd.micrografx.flo": [ + "flo" + ], + "application/vnd.micrografx.igx": [ + "igx" + ], + "application/vnd.mif": [ + "mif" + ], + "application/vnd.minisoft-hp3000-save": [], + "application/vnd.mitsubishi.misty-guard.trustweb": [], + "application/vnd.mobius.daf": [ + "daf" + ], + "application/vnd.mobius.dis": [ + "dis" + ], + "application/vnd.mobius.mbk": [ + "mbk" + ], + "application/vnd.mobius.mqy": [ + "mqy" + ], + "application/vnd.mobius.msl": [ + "msl" + ], + "application/vnd.mobius.plc": [ + "plc" + ], + "application/vnd.mobius.txf": [ + "txf" + ], + "application/vnd.mophun.application": [ + "mpn" + ], + "application/vnd.mophun.certificate": [ + "mpc" + ], + "application/vnd.motorola.flexsuite": [], + "application/vnd.motorola.flexsuite.adsi": [], + "application/vnd.motorola.flexsuite.fis": [], + "application/vnd.motorola.flexsuite.gotap": [], + "application/vnd.motorola.flexsuite.kmr": [], + "application/vnd.motorola.flexsuite.ttc": [], + "application/vnd.motorola.flexsuite.wem": [], + "application/vnd.motorola.iprm": [], + "application/vnd.mozilla.xul+xml": [ + "xul" + ], + "application/vnd.ms-artgalry": [ + "cil" + ], + "application/vnd.ms-asf": [], + "application/vnd.ms-cab-compressed": [ + "cab" + ], + "application/vnd.ms-color.iccprofile": [], + "application/vnd.ms-excel": [ + "xls", + "xlm", + "xla", + "xlc", + "xlt", + "xlw" + ], + "application/vnd.ms-excel.addin.macroenabled.12": [ + "xlam" + ], + "application/vnd.ms-excel.sheet.binary.macroenabled.12": [ + "xlsb" + ], + "application/vnd.ms-excel.sheet.macroenabled.12": [ + "xlsm" + ], + "application/vnd.ms-excel.template.macroenabled.12": [ + "xltm" + ], + "application/vnd.ms-fontobject": [ + "eot" + ], + "application/vnd.ms-htmlhelp": [ + "chm" + ], + "application/vnd.ms-ims": [ + "ims" + ], + "application/vnd.ms-lrm": [ + "lrm" + ], + "application/vnd.ms-office.activex+xml": [], + "application/vnd.ms-officetheme": [ + "thmx" + ], + "application/vnd.ms-opentype": [], + "application/vnd.ms-package.obfuscated-opentype": [], + "application/vnd.ms-pki.seccat": [ + "cat" + ], + "application/vnd.ms-pki.stl": [ + "stl" + ], + "application/vnd.ms-playready.initiator+xml": [], + "application/vnd.ms-powerpoint": [ + "ppt", + "pps", + "pot" + ], + "application/vnd.ms-powerpoint.addin.macroenabled.12": [ + "ppam" + ], + "application/vnd.ms-powerpoint.presentation.macroenabled.12": [ + "pptm" + ], + "application/vnd.ms-powerpoint.slide.macroenabled.12": [ + "sldm" + ], + "application/vnd.ms-powerpoint.slideshow.macroenabled.12": [ + "ppsm" + ], + "application/vnd.ms-powerpoint.template.macroenabled.12": [ + "potm" + ], + "application/vnd.ms-printing.printticket+xml": [], + "application/vnd.ms-project": [ + "mpp", + "mpt" + ], + "application/vnd.ms-tnef": [], + "application/vnd.ms-wmdrm.lic-chlg-req": [], + "application/vnd.ms-wmdrm.lic-resp": [], + "application/vnd.ms-wmdrm.meter-chlg-req": [], + "application/vnd.ms-wmdrm.meter-resp": [], + "application/vnd.ms-word.document.macroenabled.12": [ + "docm" + ], + "application/vnd.ms-word.template.macroenabled.12": [ + "dotm" + ], + "application/vnd.ms-works": [ + "wps", + "wks", + "wcm", + "wdb" + ], + "application/vnd.ms-wpl": [ + "wpl" + ], + "application/vnd.ms-xpsdocument": [ + "xps" + ], + "application/vnd.mseq": [ + "mseq" + ], + "application/vnd.msign": [], + "application/vnd.multiad.creator": [], + "application/vnd.multiad.creator.cif": [], + "application/vnd.music-niff": [], + "application/vnd.musician": [ + "mus" + ], + "application/vnd.muvee.style": [ + "msty" + ], + "application/vnd.mynfc": [ + "taglet" + ], + "application/vnd.ncd.control": [], + "application/vnd.ncd.reference": [], + "application/vnd.nervana": [], + "application/vnd.netfpx": [], + "application/vnd.neurolanguage.nlu": [ + "nlu" + ], + "application/vnd.nitf": [ + "ntf", + "nitf" + ], + "application/vnd.noblenet-directory": [ + "nnd" + ], + "application/vnd.noblenet-sealer": [ + "nns" + ], + "application/vnd.noblenet-web": [ + "nnw" + ], + "application/vnd.nokia.catalogs": [], + "application/vnd.nokia.conml+wbxml": [], + "application/vnd.nokia.conml+xml": [], + "application/vnd.nokia.isds-radio-presets": [], + "application/vnd.nokia.iptv.config+xml": [], + "application/vnd.nokia.landmark+wbxml": [], + "application/vnd.nokia.landmark+xml": [], + "application/vnd.nokia.landmarkcollection+xml": [], + "application/vnd.nokia.n-gage.ac+xml": [], + "application/vnd.nokia.n-gage.data": [ + "ngdat" + ], + "application/vnd.nokia.ncd": [], + "application/vnd.nokia.pcd+wbxml": [], + "application/vnd.nokia.pcd+xml": [], + "application/vnd.nokia.radio-preset": [ + "rpst" + ], + "application/vnd.nokia.radio-presets": [ + "rpss" + ], + "application/vnd.novadigm.edm": [ + "edm" + ], + "application/vnd.novadigm.edx": [ + "edx" + ], + "application/vnd.novadigm.ext": [ + "ext" + ], + "application/vnd.ntt-local.file-transfer": [], + "application/vnd.ntt-local.sip-ta_remote": [], + "application/vnd.ntt-local.sip-ta_tcp_stream": [], + "application/vnd.oasis.opendocument.chart": [ + "odc" + ], + "application/vnd.oasis.opendocument.chart-template": [ + "otc" + ], + "application/vnd.oasis.opendocument.database": [ + "odb" + ], + "application/vnd.oasis.opendocument.formula": [ + "odf" + ], + "application/vnd.oasis.opendocument.formula-template": [ + "odft" + ], + "application/vnd.oasis.opendocument.graphics": [ + "odg" + ], + "application/vnd.oasis.opendocument.graphics-template": [ + "otg" + ], + "application/vnd.oasis.opendocument.image": [ + "odi" + ], + "application/vnd.oasis.opendocument.image-template": [ + "oti" + ], + "application/vnd.oasis.opendocument.presentation": [ + "odp" + ], + "application/vnd.oasis.opendocument.presentation-template": [ + "otp" + ], + "application/vnd.oasis.opendocument.spreadsheet": [ + "ods" + ], + "application/vnd.oasis.opendocument.spreadsheet-template": [ + "ots" + ], + "application/vnd.oasis.opendocument.text": [ + "odt" + ], + "application/vnd.oasis.opendocument.text-master": [ + "odm" + ], + "application/vnd.oasis.opendocument.text-template": [ + "ott" + ], + "application/vnd.oasis.opendocument.text-web": [ + "oth" + ], + "application/vnd.obn": [], + "application/vnd.oftn.l10n+json": [], + "application/vnd.oipf.contentaccessdownload+xml": [], + "application/vnd.oipf.contentaccessstreaming+xml": [], + "application/vnd.oipf.cspg-hexbinary": [], + "application/vnd.oipf.dae.svg+xml": [], + "application/vnd.oipf.dae.xhtml+xml": [], + "application/vnd.oipf.mippvcontrolmessage+xml": [], + "application/vnd.oipf.pae.gem": [], + "application/vnd.oipf.spdiscovery+xml": [], + "application/vnd.oipf.spdlist+xml": [], + "application/vnd.oipf.ueprofile+xml": [], + "application/vnd.oipf.userprofile+xml": [], + "application/vnd.olpc-sugar": [ + "xo" + ], + "application/vnd.oma-scws-config": [], + "application/vnd.oma-scws-http-request": [], + "application/vnd.oma-scws-http-response": [], + "application/vnd.oma.bcast.associated-procedure-parameter+xml": [], + "application/vnd.oma.bcast.drm-trigger+xml": [], + "application/vnd.oma.bcast.imd+xml": [], + "application/vnd.oma.bcast.ltkm": [], + "application/vnd.oma.bcast.notification+xml": [], + "application/vnd.oma.bcast.provisioningtrigger": [], + "application/vnd.oma.bcast.sgboot": [], + "application/vnd.oma.bcast.sgdd+xml": [], + "application/vnd.oma.bcast.sgdu": [], + "application/vnd.oma.bcast.simple-symbol-container": [], + "application/vnd.oma.bcast.smartcard-trigger+xml": [], + "application/vnd.oma.bcast.sprov+xml": [], + "application/vnd.oma.bcast.stkm": [], + "application/vnd.oma.cab-address-book+xml": [], + "application/vnd.oma.cab-feature-handler+xml": [], + "application/vnd.oma.cab-pcc+xml": [], + "application/vnd.oma.cab-user-prefs+xml": [], + "application/vnd.oma.dcd": [], + "application/vnd.oma.dcdc": [], + "application/vnd.oma.dd2+xml": [ + "dd2" + ], + "application/vnd.oma.drm.risd+xml": [], + "application/vnd.oma.group-usage-list+xml": [], + "application/vnd.oma.pal+xml": [], + "application/vnd.oma.poc.detailed-progress-report+xml": [], + "application/vnd.oma.poc.final-report+xml": [], + "application/vnd.oma.poc.groups+xml": [], + "application/vnd.oma.poc.invocation-descriptor+xml": [], + "application/vnd.oma.poc.optimized-progress-report+xml": [], + "application/vnd.oma.push": [], + "application/vnd.oma.scidm.messages+xml": [], + "application/vnd.oma.xcap-directory+xml": [], + "application/vnd.omads-email+xml": [], + "application/vnd.omads-file+xml": [], + "application/vnd.omads-folder+xml": [], + "application/vnd.omaloc-supl-init": [], + "application/vnd.openofficeorg.extension": [ + "oxt" + ], + "application/vnd.openxmlformats-officedocument.custom-properties+xml": [], + "application/vnd.openxmlformats-officedocument.customxmlproperties+xml": [], + "application/vnd.openxmlformats-officedocument.drawing+xml": [], + "application/vnd.openxmlformats-officedocument.drawingml.chart+xml": [], + "application/vnd.openxmlformats-officedocument.drawingml.chartshapes+xml": [], + "application/vnd.openxmlformats-officedocument.drawingml.diagramcolors+xml": [], + "application/vnd.openxmlformats-officedocument.drawingml.diagramdata+xml": [], + "application/vnd.openxmlformats-officedocument.drawingml.diagramlayout+xml": [], + "application/vnd.openxmlformats-officedocument.drawingml.diagramstyle+xml": [], + "application/vnd.openxmlformats-officedocument.extended-properties+xml": [], + "application/vnd.openxmlformats-officedocument.presentationml.commentauthors+xml": [], + "application/vnd.openxmlformats-officedocument.presentationml.comments+xml": [], + "application/vnd.openxmlformats-officedocument.presentationml.handoutmaster+xml": [], + "application/vnd.openxmlformats-officedocument.presentationml.notesmaster+xml": [], + "application/vnd.openxmlformats-officedocument.presentationml.notesslide+xml": [], + "application/vnd.openxmlformats-officedocument.presentationml.presentation": [ + "pptx" + ], + "application/vnd.openxmlformats-officedocument.presentationml.presentation.main+xml": [], + "application/vnd.openxmlformats-officedocument.presentationml.presprops+xml": [], + "application/vnd.openxmlformats-officedocument.presentationml.slide": [ + "sldx" + ], + "application/vnd.openxmlformats-officedocument.presentationml.slide+xml": [], + "application/vnd.openxmlformats-officedocument.presentationml.slidelayout+xml": [], + "application/vnd.openxmlformats-officedocument.presentationml.slidemaster+xml": [], + "application/vnd.openxmlformats-officedocument.presentationml.slideshow": [ + "ppsx" + ], + "application/vnd.openxmlformats-officedocument.presentationml.slideshow.main+xml": [], + "application/vnd.openxmlformats-officedocument.presentationml.slideupdateinfo+xml": [], + "application/vnd.openxmlformats-officedocument.presentationml.tablestyles+xml": [], + "application/vnd.openxmlformats-officedocument.presentationml.tags+xml": [], + "application/vnd.openxmlformats-officedocument.presentationml.template": [ + "potx" + ], + "application/vnd.openxmlformats-officedocument.presentationml.template.main+xml": [], + "application/vnd.openxmlformats-officedocument.presentationml.viewprops+xml": [], + "application/vnd.openxmlformats-officedocument.spreadsheetml.calcchain+xml": [], + "application/vnd.openxmlformats-officedocument.spreadsheetml.chartsheet+xml": [], + "application/vnd.openxmlformats-officedocument.spreadsheetml.comments+xml": [], + "application/vnd.openxmlformats-officedocument.spreadsheetml.connections+xml": [], + "application/vnd.openxmlformats-officedocument.spreadsheetml.dialogsheet+xml": [], + "application/vnd.openxmlformats-officedocument.spreadsheetml.externallink+xml": [], + "application/vnd.openxmlformats-officedocument.spreadsheetml.pivotcachedefinition+xml": [], + "application/vnd.openxmlformats-officedocument.spreadsheetml.pivotcacherecords+xml": [], + "application/vnd.openxmlformats-officedocument.spreadsheetml.pivottable+xml": [], + "application/vnd.openxmlformats-officedocument.spreadsheetml.querytable+xml": [], + "application/vnd.openxmlformats-officedocument.spreadsheetml.revisionheaders+xml": [], + "application/vnd.openxmlformats-officedocument.spreadsheetml.revisionlog+xml": [], + "application/vnd.openxmlformats-officedocument.spreadsheetml.sharedstrings+xml": [], + "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet": [ + "xlsx" + ], + "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml": [], + "application/vnd.openxmlformats-officedocument.spreadsheetml.sheetmetadata+xml": [], + "application/vnd.openxmlformats-officedocument.spreadsheetml.styles+xml": [], + "application/vnd.openxmlformats-officedocument.spreadsheetml.table+xml": [], + "application/vnd.openxmlformats-officedocument.spreadsheetml.tablesinglecells+xml": [], + "application/vnd.openxmlformats-officedocument.spreadsheetml.template": [ + "xltx" + ], + "application/vnd.openxmlformats-officedocument.spreadsheetml.template.main+xml": [], + "application/vnd.openxmlformats-officedocument.spreadsheetml.usernames+xml": [], + "application/vnd.openxmlformats-officedocument.spreadsheetml.volatiledependencies+xml": [], + "application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml": [], + "application/vnd.openxmlformats-officedocument.theme+xml": [], + "application/vnd.openxmlformats-officedocument.themeoverride+xml": [], + "application/vnd.openxmlformats-officedocument.vmldrawing": [], + "application/vnd.openxmlformats-officedocument.wordprocessingml.comments+xml": [], + "application/vnd.openxmlformats-officedocument.wordprocessingml.document": [ + "docx" + ], + "application/vnd.openxmlformats-officedocument.wordprocessingml.document.glossary+xml": [], + "application/vnd.openxmlformats-officedocument.wordprocessingml.document.main+xml": [], + "application/vnd.openxmlformats-officedocument.wordprocessingml.endnotes+xml": [], + "application/vnd.openxmlformats-officedocument.wordprocessingml.fonttable+xml": [], + "application/vnd.openxmlformats-officedocument.wordprocessingml.footer+xml": [], + "application/vnd.openxmlformats-officedocument.wordprocessingml.footnotes+xml": [], + "application/vnd.openxmlformats-officedocument.wordprocessingml.numbering+xml": [], + "application/vnd.openxmlformats-officedocument.wordprocessingml.settings+xml": [], + "application/vnd.openxmlformats-officedocument.wordprocessingml.styles+xml": [], + "application/vnd.openxmlformats-officedocument.wordprocessingml.template": [ + "dotx" + ], + "application/vnd.openxmlformats-officedocument.wordprocessingml.template.main+xml": [], + "application/vnd.openxmlformats-officedocument.wordprocessingml.websettings+xml": [], + "application/vnd.openxmlformats-package.core-properties+xml": [], + "application/vnd.openxmlformats-package.digital-signature-xmlsignature+xml": [], + "application/vnd.openxmlformats-package.relationships+xml": [], + "application/vnd.quobject-quoxdocument": [], + "application/vnd.osa.netdeploy": [], + "application/vnd.osgeo.mapguide.package": [ + "mgp" + ], + "application/vnd.osgi.bundle": [], + "application/vnd.osgi.dp": [ + "dp" + ], + "application/vnd.osgi.subsystem": [ + "esa" + ], + "application/vnd.otps.ct-kip+xml": [], + "application/vnd.palm": [ + "pdb", + "pqa", + "oprc" + ], + "application/vnd.paos.xml": [], + "application/vnd.pawaafile": [ + "paw" + ], + "application/vnd.pg.format": [ + "str" + ], + "application/vnd.pg.osasli": [ + "ei6" + ], + "application/vnd.piaccess.application-licence": [], + "application/vnd.picsel": [ + "efif" + ], + "application/vnd.pmi.widget": [ + "wg" + ], + "application/vnd.poc.group-advertisement+xml": [], + "application/vnd.pocketlearn": [ + "plf" + ], + "application/vnd.powerbuilder6": [ + "pbd" + ], + "application/vnd.powerbuilder6-s": [], + "application/vnd.powerbuilder7": [], + "application/vnd.powerbuilder7-s": [], + "application/vnd.powerbuilder75": [], + "application/vnd.powerbuilder75-s": [], + "application/vnd.preminet": [], + "application/vnd.previewsystems.box": [ + "box" + ], + "application/vnd.proteus.magazine": [ + "mgz" + ], + "application/vnd.publishare-delta-tree": [ + "qps" + ], + "application/vnd.pvi.ptid1": [ + "ptid" + ], + "application/vnd.pwg-multiplexed": [], + "application/vnd.pwg-xhtml-print+xml": [], + "application/vnd.qualcomm.brew-app-res": [], + "application/vnd.quark.quarkxpress": [ + "qxd", + "qxt", + "qwd", + "qwt", + "qxl", + "qxb" + ], + "application/vnd.radisys.moml+xml": [], + "application/vnd.radisys.msml+xml": [], + "application/vnd.radisys.msml-audit+xml": [], + "application/vnd.radisys.msml-audit-conf+xml": [], + "application/vnd.radisys.msml-audit-conn+xml": [], + "application/vnd.radisys.msml-audit-dialog+xml": [], + "application/vnd.radisys.msml-audit-stream+xml": [], + "application/vnd.radisys.msml-conf+xml": [], + "application/vnd.radisys.msml-dialog+xml": [], + "application/vnd.radisys.msml-dialog-base+xml": [], + "application/vnd.radisys.msml-dialog-fax-detect+xml": [], + "application/vnd.radisys.msml-dialog-fax-sendrecv+xml": [], + "application/vnd.radisys.msml-dialog-group+xml": [], + "application/vnd.radisys.msml-dialog-speech+xml": [], + "application/vnd.radisys.msml-dialog-transform+xml": [], + "application/vnd.rainstor.data": [], + "application/vnd.rapid": [], + "application/vnd.realvnc.bed": [ + "bed" + ], + "application/vnd.recordare.musicxml": [ + "mxl" + ], + "application/vnd.recordare.musicxml+xml": [ + "musicxml" + ], + "application/vnd.renlearn.rlprint": [], + "application/vnd.rig.cryptonote": [ + "cryptonote" + ], + "application/vnd.rim.cod": [ + "cod" + ], + "application/vnd.rn-realmedia": [ + "rm" + ], + "application/vnd.rn-realmedia-vbr": [ + "rmvb" + ], + "application/vnd.route66.link66+xml": [ + "link66" + ], + "application/vnd.rs-274x": [], + "application/vnd.ruckus.download": [], + "application/vnd.s3sms": [], + "application/vnd.sailingtracker.track": [ + "st" + ], + "application/vnd.sbm.cid": [], + "application/vnd.sbm.mid2": [], + "application/vnd.scribus": [], + "application/vnd.sealed.3df": [], + "application/vnd.sealed.csf": [], + "application/vnd.sealed.doc": [], + "application/vnd.sealed.eml": [], + "application/vnd.sealed.mht": [], + "application/vnd.sealed.net": [], + "application/vnd.sealed.ppt": [], + "application/vnd.sealed.tiff": [], + "application/vnd.sealed.xls": [], + "application/vnd.sealedmedia.softseal.html": [], + "application/vnd.sealedmedia.softseal.pdf": [], + "application/vnd.seemail": [ + "see" + ], + "application/vnd.sema": [ + "sema" + ], + "application/vnd.semd": [ + "semd" + ], + "application/vnd.semf": [ + "semf" + ], + "application/vnd.shana.informed.formdata": [ + "ifm" + ], + "application/vnd.shana.informed.formtemplate": [ + "itp" + ], + "application/vnd.shana.informed.interchange": [ + "iif" + ], + "application/vnd.shana.informed.package": [ + "ipk" + ], + "application/vnd.simtech-mindmapper": [ + "twd", + "twds" + ], + "application/vnd.smaf": [ + "mmf" + ], + "application/vnd.smart.notebook": [], + "application/vnd.smart.teacher": [ + "teacher" + ], + "application/vnd.software602.filler.form+xml": [], + "application/vnd.software602.filler.form-xml-zip": [], + "application/vnd.solent.sdkm+xml": [ + "sdkm", + "sdkd" + ], + "application/vnd.spotfire.dxp": [ + "dxp" + ], + "application/vnd.spotfire.sfs": [ + "sfs" + ], + "application/vnd.sss-cod": [], + "application/vnd.sss-dtf": [], + "application/vnd.sss-ntf": [], + "application/vnd.stardivision.calc": [ + "sdc" + ], + "application/vnd.stardivision.draw": [ + "sda" + ], + "application/vnd.stardivision.impress": [ + "sdd" + ], + "application/vnd.stardivision.math": [ + "smf" + ], + "application/vnd.stardivision.writer": [ + "sdw", + "vor" + ], + "application/vnd.stardivision.writer-global": [ + "sgl" + ], + "application/vnd.stepmania.package": [ + "smzip" + ], + "application/vnd.stepmania.stepchart": [ + "sm" + ], + "application/vnd.street-stream": [], + "application/vnd.sun.xml.calc": [ + "sxc" + ], + "application/vnd.sun.xml.calc.template": [ + "stc" + ], + "application/vnd.sun.xml.draw": [ + "sxd" + ], + "application/vnd.sun.xml.draw.template": [ + "std" + ], + "application/vnd.sun.xml.impress": [ + "sxi" + ], + "application/vnd.sun.xml.impress.template": [ + "sti" + ], + "application/vnd.sun.xml.math": [ + "sxm" + ], + "application/vnd.sun.xml.writer": [ + "sxw" + ], + "application/vnd.sun.xml.writer.global": [ + "sxg" + ], + "application/vnd.sun.xml.writer.template": [ + "stw" + ], + "application/vnd.sun.wadl+xml": [], + "application/vnd.sus-calendar": [ + "sus", + "susp" + ], + "application/vnd.svd": [ + "svd" + ], + "application/vnd.swiftview-ics": [], + "application/vnd.symbian.install": [ + "sis", + "sisx" + ], + "application/vnd.syncml+xml": [ + "xsm" + ], + "application/vnd.syncml.dm+wbxml": [ + "bdm" + ], + "application/vnd.syncml.dm+xml": [ + "xdm" + ], + "application/vnd.syncml.dm.notification": [], + "application/vnd.syncml.ds.notification": [], + "application/vnd.tao.intent-module-archive": [ + "tao" + ], + "application/vnd.tcpdump.pcap": [ + "pcap", + "cap", + "dmp" + ], + "application/vnd.tmobile-livetv": [ + "tmo" + ], + "application/vnd.trid.tpt": [ + "tpt" + ], + "application/vnd.triscape.mxs": [ + "mxs" + ], + "application/vnd.trueapp": [ + "tra" + ], + "application/vnd.truedoc": [], + "application/vnd.ubisoft.webplayer": [], + "application/vnd.ufdl": [ + "ufd", + "ufdl" + ], + "application/vnd.uiq.theme": [ + "utz" + ], + "application/vnd.umajin": [ + "umj" + ], + "application/vnd.unity": [ + "unityweb" + ], + "application/vnd.uoml+xml": [ + "uoml" + ], + "application/vnd.uplanet.alert": [], + "application/vnd.uplanet.alert-wbxml": [], + "application/vnd.uplanet.bearer-choice": [], + "application/vnd.uplanet.bearer-choice-wbxml": [], + "application/vnd.uplanet.cacheop": [], + "application/vnd.uplanet.cacheop-wbxml": [], + "application/vnd.uplanet.channel": [], + "application/vnd.uplanet.channel-wbxml": [], + "application/vnd.uplanet.list": [], + "application/vnd.uplanet.list-wbxml": [], + "application/vnd.uplanet.listcmd": [], + "application/vnd.uplanet.listcmd-wbxml": [], + "application/vnd.uplanet.signal": [], + "application/vnd.vcx": [ + "vcx" + ], + "application/vnd.vd-study": [], + "application/vnd.vectorworks": [], + "application/vnd.verimatrix.vcas": [], + "application/vnd.vidsoft.vidconference": [], + "application/vnd.visio": [ + "vsd", + "vst", + "vss", + "vsw" + ], + "application/vnd.visionary": [ + "vis" + ], + "application/vnd.vividence.scriptfile": [], + "application/vnd.vsf": [ + "vsf" + ], + "application/vnd.wap.sic": [], + "application/vnd.wap.slc": [], + "application/vnd.wap.wbxml": [ + "wbxml" + ], + "application/vnd.wap.wmlc": [ + "wmlc" + ], + "application/vnd.wap.wmlscriptc": [ + "wmlsc" + ], + "application/vnd.webturbo": [ + "wtb" + ], + "application/vnd.wfa.wsc": [], + "application/vnd.wmc": [], + "application/vnd.wmf.bootstrap": [], + "application/vnd.wolfram.mathematica": [], + "application/vnd.wolfram.mathematica.package": [], + "application/vnd.wolfram.player": [ + "nbp" + ], + "application/vnd.wordperfect": [ + "wpd" + ], + "application/vnd.wqd": [ + "wqd" + ], + "application/vnd.wrq-hp3000-labelled": [], + "application/vnd.wt.stf": [ + "stf" + ], + "application/vnd.wv.csp+wbxml": [], + "application/vnd.wv.csp+xml": [], + "application/vnd.wv.ssp+xml": [], + "application/vnd.xara": [ + "xar" + ], + "application/vnd.xfdl": [ + "xfdl" + ], + "application/vnd.xfdl.webform": [], + "application/vnd.xmi+xml": [], + "application/vnd.xmpie.cpkg": [], + "application/vnd.xmpie.dpkg": [], + "application/vnd.xmpie.plan": [], + "application/vnd.xmpie.ppkg": [], + "application/vnd.xmpie.xlim": [], + "application/vnd.yamaha.hv-dic": [ + "hvd" + ], + "application/vnd.yamaha.hv-script": [ + "hvs" + ], + "application/vnd.yamaha.hv-voice": [ + "hvp" + ], + "application/vnd.yamaha.openscoreformat": [ + "osf" + ], + "application/vnd.yamaha.openscoreformat.osfpvg+xml": [ + "osfpvg" + ], + "application/vnd.yamaha.remote-setup": [], + "application/vnd.yamaha.smaf-audio": [ + "saf" + ], + "application/vnd.yamaha.smaf-phrase": [ + "spf" + ], + "application/vnd.yamaha.through-ngn": [], + "application/vnd.yamaha.tunnel-udpencap": [], + "application/vnd.yellowriver-custom-menu": [ + "cmp" + ], + "application/vnd.zul": [ + "zir", + "zirz" + ], + "application/vnd.zzazz.deck+xml": [ + "zaz" + ], + "application/voicexml+xml": [ + "vxml" + ], + "application/vq-rtcpxr": [], + "application/watcherinfo+xml": [], + "application/whoispp-query": [], + "application/whoispp-response": [], + "application/widget": [ + "wgt" + ], + "application/winhlp": [ + "hlp" + ], + "application/wita": [], + "application/wordperfect5.1": [], + "application/wsdl+xml": [ + "wsdl" + ], + "application/wspolicy+xml": [ + "wspolicy" + ], + "application/x-7z-compressed": [ + "7z" + ], + "application/x-abiword": [ + "abw" + ], + "application/x-ace-compressed": [ + "ace" + ], + "application/x-amf": [], + "application/x-apple-diskimage": [ + "dmg" + ], + "application/x-authorware-bin": [ + "aab", + "x32", + "u32", + "vox" + ], + "application/x-authorware-map": [ + "aam" + ], + "application/x-authorware-seg": [ + "aas" + ], + "application/x-bcpio": [ + "bcpio" + ], + "application/x-bittorrent": [ + "torrent" + ], + "application/x-blorb": [ + "blb", + "blorb" + ], + "application/x-bzip": [ + "bz" + ], + "application/x-bzip2": [ + "bz2", + "boz" + ], + "application/x-cbr": [ + "cbr", + "cba", + "cbt", + "cbz", + "cb7" + ], + "application/x-cdlink": [ + "vcd" + ], + "application/x-cfs-compressed": [ + "cfs" + ], + "application/x-chat": [ + "chat" + ], + "application/x-chess-pgn": [ + "pgn" + ], + "application/x-conference": [ + "nsc" + ], + "application/x-compress": [], + "application/x-cpio": [ + "cpio" + ], + "application/x-csh": [ + "csh" + ], + "application/x-debian-package": [ + "deb", + "udeb" + ], + "application/x-dgc-compressed": [ + "dgc" + ], + "application/x-director": [ + "dir", + "dcr", + "dxr", + "cst", + "cct", + "cxt", + "w3d", + "fgd", + "swa" + ], + "application/x-doom": [ + "wad" + ], + "application/x-dtbncx+xml": [ + "ncx" + ], + "application/x-dtbook+xml": [ + "dtb" + ], + "application/x-dtbresource+xml": [ + "res" + ], + "application/x-dvi": [ + "dvi" + ], + "application/x-envoy": [ + "evy" + ], + "application/x-eva": [ + "eva" + ], + "application/x-font-bdf": [ + "bdf" + ], + "application/x-font-dos": [], + "application/x-font-framemaker": [], + "application/x-font-ghostscript": [ + "gsf" + ], + "application/x-font-libgrx": [], + "application/x-font-linux-psf": [ + "psf" + ], + "application/x-font-otf": [ + "otf" + ], + "application/x-font-pcf": [ + "pcf" + ], + "application/x-font-snf": [ + "snf" + ], + "application/x-font-speedo": [], + "application/x-font-sunos-news": [], + "application/x-font-ttf": [ + "ttf", + "ttc" + ], + "application/x-font-type1": [ + "pfa", + "pfb", + "pfm", + "afm" + ], + "application/font-woff": [ + "woff" + ], + "application/x-font-vfont": [], + "application/x-freearc": [ + "arc" + ], + "application/x-futuresplash": [ + "spl" + ], + "application/x-gca-compressed": [ + "gca" + ], + "application/x-glulx": [ + "ulx" + ], + "application/x-gnumeric": [ + "gnumeric" + ], + "application/x-gramps-xml": [ + "gramps" + ], + "application/x-gtar": [ + "gtar" + ], + "application/x-gzip": [], + "application/x-hdf": [ + "hdf" + ], + "application/x-install-instructions": [ + "install" + ], + "application/x-iso9660-image": [ + "iso" + ], + "application/x-java-jnlp-file": [ + "jnlp" + ], + "application/x-latex": [ + "latex" + ], + "application/x-lzh-compressed": [ + "lzh", + "lha" + ], + "application/x-mie": [ + "mie" + ], + "application/x-mobipocket-ebook": [ + "prc", + "mobi" + ], + "application/x-ms-application": [ + "application" + ], + "application/x-ms-shortcut": [ + "lnk" + ], + "application/x-ms-wmd": [ + "wmd" + ], + "application/x-ms-wmz": [ + "wmz" + ], + "application/x-ms-xbap": [ + "xbap" + ], + "application/x-msaccess": [ + "mdb" + ], + "application/x-msbinder": [ + "obd" + ], + "application/x-mscardfile": [ + "crd" + ], + "application/x-msclip": [ + "clp" + ], + "application/x-msdownload": [ + "exe", + "dll", + "com", + "bat", + "msi" + ], + "application/x-msmediaview": [ + "mvb", + "m13", + "m14" + ], + "application/x-msmetafile": [ + "wmf", + "wmz", + "emf", + "emz" + ], + "application/x-msmoney": [ + "mny" + ], + "application/x-mspublisher": [ + "pub" + ], + "application/x-msschedule": [ + "scd" + ], + "application/x-msterminal": [ + "trm" + ], + "application/x-mswrite": [ + "wri" + ], + "application/x-netcdf": [ + "nc", + "cdf" + ], + "application/x-nzb": [ + "nzb" + ], + "application/x-pkcs12": [ + "p12", + "pfx" + ], + "application/x-pkcs7-certificates": [ + "p7b", + "spc" + ], + "application/x-pkcs7-certreqresp": [ + "p7r" + ], + "application/x-rar-compressed": [ + "rar" + ], + "application/x-research-info-systems": [ + "ris" + ], + "application/x-sh": [ + "sh" + ], + "application/x-shar": [ + "shar" + ], + "application/x-shockwave-flash": [ + "swf" + ], + "application/x-silverlight-app": [ + "xap" + ], + "application/x-sql": [ + "sql" + ], + "application/x-stuffit": [ + "sit" + ], + "application/x-stuffitx": [ + "sitx" + ], + "application/x-subrip": [ + "srt" + ], + "application/x-sv4cpio": [ + "sv4cpio" + ], + "application/x-sv4crc": [ + "sv4crc" + ], + "application/x-t3vm-image": [ + "t3" + ], + "application/x-tads": [ + "gam" + ], + "application/x-tar": [ + "tar" + ], + "application/x-tcl": [ + "tcl" + ], + "application/x-tex": [ + "tex" + ], + "application/x-tex-tfm": [ + "tfm" + ], + "application/x-texinfo": [ + "texinfo", + "texi" + ], + "application/x-tgif": [ + "obj" + ], + "application/x-ustar": [ + "ustar" + ], + "application/x-wais-source": [ + "src" + ], + "application/x-x509-ca-cert": [ + "der", + "crt" + ], + "application/x-xfig": [ + "fig" + ], + "application/x-xliff+xml": [ + "xlf" + ], + "application/x-xpinstall": [ + "xpi" + ], + "application/x-xz": [ + "xz" + ], + "application/x-zmachine": [ + "z1", + "z2", + "z3", + "z4", + "z5", + "z6", + "z7", + "z8" + ], + "application/x400-bp": [], + "application/xaml+xml": [ + "xaml" + ], + "application/xcap-att+xml": [], + "application/xcap-caps+xml": [], + "application/xcap-diff+xml": [ + "xdf" + ], + "application/xcap-el+xml": [], + "application/xcap-error+xml": [], + "application/xcap-ns+xml": [], + "application/xcon-conference-info-diff+xml": [], + "application/xcon-conference-info+xml": [], + "application/xenc+xml": [ + "xenc" + ], + "application/xhtml+xml": [ + "xhtml", + "xht" + ], + "application/xhtml-voice+xml": [], + "application/xml": [ + "xml", + "xsl" + ], + "application/xml-dtd": [ + "dtd" + ], + "application/xml-external-parsed-entity": [], + "application/xmpp+xml": [], + "application/xop+xml": [ + "xop" + ], + "application/xproc+xml": [ + "xpl" + ], + "application/xslt+xml": [ + "xslt" + ], + "application/xspf+xml": [ + "xspf" + ], + "application/xv+xml": [ + "mxml", + "xhvml", + "xvml", + "xvm" + ], + "application/yang": [ + "yang" + ], + "application/yin+xml": [ + "yin" + ], + "application/zip": [ + "zip" + ], + "audio/1d-interleaved-parityfec": [], + "audio/32kadpcm": [], + "audio/3gpp": [], + "audio/3gpp2": [], + "audio/ac3": [], + "audio/adpcm": [ + "adp" + ], + "audio/amr": [], + "audio/amr-wb": [], + "audio/amr-wb+": [], + "audio/asc": [], + "audio/atrac-advanced-lossless": [], + "audio/atrac-x": [], + "audio/atrac3": [], + "audio/basic": [ + "au", + "snd" + ], + "audio/bv16": [], + "audio/bv32": [], + "audio/clearmode": [], + "audio/cn": [], + "audio/dat12": [], + "audio/dls": [], + "audio/dsr-es201108": [], + "audio/dsr-es202050": [], + "audio/dsr-es202211": [], + "audio/dsr-es202212": [], + "audio/dv": [], + "audio/dvi4": [], + "audio/eac3": [], + "audio/evrc": [], + "audio/evrc-qcp": [], + "audio/evrc0": [], + "audio/evrc1": [], + "audio/evrcb": [], + "audio/evrcb0": [], + "audio/evrcb1": [], + "audio/evrcwb": [], + "audio/evrcwb0": [], + "audio/evrcwb1": [], + "audio/example": [], + "audio/fwdred": [], + "audio/g719": [], + "audio/g722": [], + "audio/g7221": [], + "audio/g723": [], + "audio/g726-16": [], + "audio/g726-24": [], + "audio/g726-32": [], + "audio/g726-40": [], + "audio/g728": [], + "audio/g729": [], + "audio/g7291": [], + "audio/g729d": [], + "audio/g729e": [], + "audio/gsm": [], + "audio/gsm-efr": [], + "audio/gsm-hr-08": [], + "audio/ilbc": [], + "audio/ip-mr_v2.5": [], + "audio/isac": [], + "audio/l16": [], + "audio/l20": [], + "audio/l24": [], + "audio/l8": [], + "audio/lpc": [], + "audio/midi": [ + "mid", + "midi", + "kar", + "rmi" + ], + "audio/mobile-xmf": [], + "audio/mp4": [ + "mp4a" + ], + "audio/mp4a-latm": [], + "audio/mpa": [], + "audio/mpa-robust": [], + "audio/mpeg": [ + "mpga", + "mp2", + "mp2a", + "mp3", + "m2a", + "m3a" + ], + "audio/mpeg4-generic": [], + "audio/musepack": [], + "audio/ogg": [ + "oga", + "ogg", + "spx" + ], + "audio/opus": [], + "audio/parityfec": [], + "audio/pcma": [], + "audio/pcma-wb": [], + "audio/pcmu-wb": [], + "audio/pcmu": [], + "audio/prs.sid": [], + "audio/qcelp": [], + "audio/red": [], + "audio/rtp-enc-aescm128": [], + "audio/rtp-midi": [], + "audio/rtx": [], + "audio/s3m": [ + "s3m" + ], + "audio/silk": [ + "sil" + ], + "audio/smv": [], + "audio/smv0": [], + "audio/smv-qcp": [], + "audio/sp-midi": [], + "audio/speex": [], + "audio/t140c": [], + "audio/t38": [], + "audio/telephone-event": [], + "audio/tone": [], + "audio/uemclip": [], + "audio/ulpfec": [], + "audio/vdvi": [], + "audio/vmr-wb": [], + "audio/vnd.3gpp.iufp": [], + "audio/vnd.4sb": [], + "audio/vnd.audiokoz": [], + "audio/vnd.celp": [], + "audio/vnd.cisco.nse": [], + "audio/vnd.cmles.radio-events": [], + "audio/vnd.cns.anp1": [], + "audio/vnd.cns.inf1": [], + "audio/vnd.dece.audio": [ + "uva", + "uvva" + ], + "audio/vnd.digital-winds": [ + "eol" + ], + "audio/vnd.dlna.adts": [], + "audio/vnd.dolby.heaac.1": [], + "audio/vnd.dolby.heaac.2": [], + "audio/vnd.dolby.mlp": [], + "audio/vnd.dolby.mps": [], + "audio/vnd.dolby.pl2": [], + "audio/vnd.dolby.pl2x": [], + "audio/vnd.dolby.pl2z": [], + "audio/vnd.dolby.pulse.1": [], + "audio/vnd.dra": [ + "dra" + ], + "audio/vnd.dts": [ + "dts" + ], + "audio/vnd.dts.hd": [ + "dtshd" + ], + "audio/vnd.dvb.file": [], + "audio/vnd.everad.plj": [], + "audio/vnd.hns.audio": [], + "audio/vnd.lucent.voice": [ + "lvp" + ], + "audio/vnd.ms-playready.media.pya": [ + "pya" + ], + "audio/vnd.nokia.mobile-xmf": [], + "audio/vnd.nortel.vbk": [], + "audio/vnd.nuera.ecelp4800": [ + "ecelp4800" + ], + "audio/vnd.nuera.ecelp7470": [ + "ecelp7470" + ], + "audio/vnd.nuera.ecelp9600": [ + "ecelp9600" + ], + "audio/vnd.octel.sbc": [], + "audio/vnd.qcelp": [], + "audio/vnd.rhetorex.32kadpcm": [], + "audio/vnd.rip": [ + "rip" + ], + "audio/vnd.sealedmedia.softseal.mpeg": [], + "audio/vnd.vmx.cvsd": [], + "audio/vorbis": [], + "audio/vorbis-config": [], + "audio/webm": [ + "weba" + ], + "audio/x-aac": [ + "aac" + ], + "audio/x-aiff": [ + "aif", + "aiff", + "aifc" + ], + "audio/x-caf": [ + "caf" + ], + "audio/x-flac": [ + "flac" + ], + "audio/x-matroska": [ + "mka" + ], + "audio/x-mpegurl": [ + "m3u" + ], + "audio/x-ms-wax": [ + "wax" + ], + "audio/x-ms-wma": [ + "wma" + ], + "audio/x-pn-realaudio": [ + "ram", + "ra" + ], + "audio/x-pn-realaudio-plugin": [ + "rmp" + ], + "audio/x-tta": [], + "audio/x-wav": [ + "wav" + ], + "audio/xm": [ + "xm" + ], + "chemical/x-cdx": [ + "cdx" + ], + "chemical/x-cif": [ + "cif" + ], + "chemical/x-cmdf": [ + "cmdf" + ], + "chemical/x-cml": [ + "cml" + ], + "chemical/x-csml": [ + "csml" + ], + "chemical/x-pdb": [], + "chemical/x-xyz": [ + "xyz" + ], + "image/bmp": [ + "bmp" + ], + "image/cgm": [ + "cgm" + ], + "image/example": [], + "image/fits": [], + "image/g3fax": [ + "g3" + ], + "image/gif": [ + "gif" + ], + "image/ief": [ + "ief" + ], + "image/jp2": [], + "image/jpeg": [ + "jpeg", + "jpg", + "jpe" + ], + "image/jpm": [], + "image/jpx": [], + "image/ktx": [ + "ktx" + ], + "image/naplps": [], + "image/png": [ + "png" + ], + "image/prs.btif": [ + "btif" + ], + "image/prs.pti": [], + "image/sgi": [ + "sgi" + ], + "image/svg+xml": [ + "svg", + "svgz" + ], + "image/t38": [], + "image/tiff": [ + "tiff", + "tif" + ], + "image/tiff-fx": [], + "image/vnd.adobe.photoshop": [ + "psd" + ], + "image/vnd.cns.inf2": [], + "image/vnd.dece.graphic": [ + "uvi", + "uvvi", + "uvg", + "uvvg" + ], + "image/vnd.dvb.subtitle": [ + "sub" + ], + "image/vnd.djvu": [ + "djvu", + "djv" + ], + "image/vnd.dwg": [ + "dwg" + ], + "image/vnd.dxf": [ + "dxf" + ], + "image/vnd.fastbidsheet": [ + "fbs" + ], + "image/vnd.fpx": [ + "fpx" + ], + "image/vnd.fst": [ + "fst" + ], + "image/vnd.fujixerox.edmics-mmr": [ + "mmr" + ], + "image/vnd.fujixerox.edmics-rlc": [ + "rlc" + ], + "image/vnd.globalgraphics.pgb": [], + "image/vnd.microsoft.icon": [], + "image/vnd.mix": [], + "image/vnd.ms-modi": [ + "mdi" + ], + "image/vnd.ms-photo": [ + "wdp" + ], + "image/vnd.net-fpx": [ + "npx" + ], + "image/vnd.radiance": [], + "image/vnd.sealed.png": [], + "image/vnd.sealedmedia.softseal.gif": [], + "image/vnd.sealedmedia.softseal.jpg": [], + "image/vnd.svf": [], + "image/vnd.wap.wbmp": [ + "wbmp" + ], + "image/vnd.xiff": [ + "xif" + ], + "image/webp": [ + "webp" + ], + "image/x-3ds": [ + "3ds" + ], + "image/x-cmu-raster": [ + "ras" + ], + "image/x-cmx": [ + "cmx" + ], + "image/x-freehand": [ + "fh", + "fhc", + "fh4", + "fh5", + "fh7" + ], + "image/x-icon": [ + "ico" + ], + "image/x-mrsid-image": [ + "sid" + ], + "image/x-pcx": [ + "pcx" + ], + "image/x-pict": [ + "pic", + "pct" + ], + "image/x-portable-anymap": [ + "pnm" + ], + "image/x-portable-bitmap": [ + "pbm" + ], + "image/x-portable-graymap": [ + "pgm" + ], + "image/x-portable-pixmap": [ + "ppm" + ], + "image/x-rgb": [ + "rgb" + ], + "image/x-tga": [ + "tga" + ], + "image/x-xbitmap": [ + "xbm" + ], + "image/x-xpixmap": [ + "xpm" + ], + "image/x-xwindowdump": [ + "xwd" + ], + "message/cpim": [], + "message/delivery-status": [], + "message/disposition-notification": [], + "message/example": [], + "message/external-body": [], + "message/feedback-report": [], + "message/global": [], + "message/global-delivery-status": [], + "message/global-disposition-notification": [], + "message/global-headers": [], + "message/http": [], + "message/imdn+xml": [], + "message/news": [], + "message/partial": [], + "message/rfc822": [ + "eml", + "mime" + ], + "message/s-http": [], + "message/sip": [], + "message/sipfrag": [], + "message/tracking-status": [], + "message/vnd.si.simp": [], + "model/example": [], + "model/iges": [ + "igs", + "iges" + ], + "model/mesh": [ + "msh", + "mesh", + "silo" + ], + "model/vnd.collada+xml": [ + "dae" + ], + "model/vnd.dwf": [ + "dwf" + ], + "model/vnd.flatland.3dml": [], + "model/vnd.gdl": [ + "gdl" + ], + "model/vnd.gs-gdl": [], + "model/vnd.gs.gdl": [], + "model/vnd.gtw": [ + "gtw" + ], + "model/vnd.moml+xml": [], + "model/vnd.mts": [ + "mts" + ], + "model/vnd.parasolid.transmit.binary": [], + "model/vnd.parasolid.transmit.text": [], + "model/vnd.vtu": [ + "vtu" + ], + "model/vrml": [ + "wrl", + "vrml" + ], + "model/x3d+binary": [ + "x3db", + "x3dbz" + ], + "model/x3d+vrml": [ + "x3dv", + "x3dvz" + ], + "model/x3d+xml": [ + "x3d", + "x3dz" + ], + "multipart/alternative": [], + "multipart/appledouble": [], + "multipart/byteranges": [], + "multipart/digest": [], + "multipart/encrypted": [], + "multipart/example": [], + "multipart/form-data": [], + "multipart/header-set": [], + "multipart/mixed": [], + "multipart/parallel": [], + "multipart/related": [], + "multipart/report": [], + "multipart/signed": [], + "multipart/voice-message": [], + "text/1d-interleaved-parityfec": [], + "text/cache-manifest": [ + "appcache" + ], + "text/calendar": [ + "ics", + "ifb" + ], + "text/css": [ + "css" + ], + "text/csv": [ + "csv" + ], + "text/directory": [], + "text/dns": [], + "text/ecmascript": [], + "text/enriched": [], + "text/example": [], + "text/fwdred": [], + "text/html": [ + "html", + "htm" + ], + "text/javascript": [], + "text/n3": [ + "n3" + ], + "text/parityfec": [], + "text/plain": [ + "txt", + "text", + "conf", + "def", + "list", + "log", + "in" + ], + "text/prs.fallenstein.rst": [], + "text/prs.lines.tag": [ + "dsc" + ], + "text/vnd.radisys.msml-basic-layout": [], + "text/red": [], + "text/rfc822-headers": [], + "text/richtext": [ + "rtx" + ], + "text/rtf": [], + "text/rtp-enc-aescm128": [], + "text/rtx": [], + "text/sgml": [ + "sgml", + "sgm" + ], + "text/t140": [], + "text/tab-separated-values": [ + "tsv" + ], + "text/troff": [ + "t", + "tr", + "roff", + "man", + "me", + "ms" + ], + "text/turtle": [ + "ttl" + ], + "text/ulpfec": [], + "text/uri-list": [ + "uri", + "uris", + "urls" + ], + "text/vcard": [ + "vcard" + ], + "text/vnd.abc": [], + "text/vnd.curl": [ + "curl" + ], + "text/vnd.curl.dcurl": [ + "dcurl" + ], + "text/vnd.curl.scurl": [ + "scurl" + ], + "text/vnd.curl.mcurl": [ + "mcurl" + ], + "text/vnd.dmclientscript": [], + "text/vnd.dvb.subtitle": [ + "sub" + ], + "text/vnd.esmertec.theme-descriptor": [], + "text/vnd.fly": [ + "fly" + ], + "text/vnd.fmi.flexstor": [ + "flx" + ], + "text/vnd.graphviz": [ + "gv" + ], + "text/vnd.in3d.3dml": [ + "3dml" + ], + "text/vnd.in3d.spot": [ + "spot" + ], + "text/vnd.iptc.newsml": [], + "text/vnd.iptc.nitf": [], + "text/vnd.latex-z": [], + "text/vnd.motorola.reflex": [], + "text/vnd.ms-mediapackage": [], + "text/vnd.net2phone.commcenter.command": [], + "text/vnd.si.uricatalogue": [], + "text/vnd.sun.j2me.app-descriptor": [ + "jad" + ], + "text/vnd.trolltech.linguist": [], + "text/vnd.wap.si": [], + "text/vnd.wap.sl": [], + "text/vnd.wap.wml": [ + "wml" + ], + "text/vnd.wap.wmlscript": [ + "wmls" + ], + "text/x-asm": [ + "s", + "asm" + ], + "text/x-c": [ + "c", + "cc", + "cxx", + "cpp", + "h", + "hh", + "dic" + ], + "text/x-fortran": [ + "f", + "for", + "f77", + "f90" + ], + "text/x-java-source": [ + "java" + ], + "text/x-opml": [ + "opml" + ], + "text/x-pascal": [ + "p", + "pas" + ], + "text/x-nfo": [ + "nfo" + ], + "text/x-setext": [ + "etx" + ], + "text/x-sfv": [ + "sfv" + ], + "text/x-uuencode": [ + "uu" + ], + "text/x-vcalendar": [ + "vcs" + ], + "text/x-vcard": [ + "vcf" + ], + "text/xml": [], + "text/xml-external-parsed-entity": [], + "video/1d-interleaved-parityfec": [], + "video/3gpp": [ + "3gp" + ], + "video/3gpp-tt": [], + "video/3gpp2": [ + "3g2" + ], + "video/bmpeg": [], + "video/bt656": [], + "video/celb": [], + "video/dv": [], + "video/example": [], + "video/h261": [ + "h261" + ], + "video/h263": [ + "h263" + ], + "video/h263-1998": [], + "video/h263-2000": [], + "video/h264": [ + "h264" + ], + "video/h264-rcdo": [], + "video/h264-svc": [], + "video/jpeg": [ + "jpgv" + ], + "video/jpeg2000": [], + "video/jpm": [ + "jpm", + "jpgm" + ], + "video/mj2": [ + "mj2", + "mjp2" + ], + "video/mp1s": [], + "video/mp2p": [], + "video/mp2t": [], + "video/mp4": [ + "mp4", + "mp4v", + "mpg4" + ], + "video/mp4v-es": [], + "video/mpeg": [ + "mpeg", + "mpg", + "mpe", + "m1v", + "m2v" + ], + "video/mpeg4-generic": [], + "video/mpv": [], + "video/nv": [], + "video/ogg": [ + "ogv" + ], + "video/parityfec": [], + "video/pointer": [], + "video/quicktime": [ + "qt", + "mov" + ], + "video/raw": [], + "video/rtp-enc-aescm128": [], + "video/rtx": [], + "video/smpte292m": [], + "video/ulpfec": [], + "video/vc1": [], + "video/vnd.cctv": [], + "video/vnd.dece.hd": [ + "uvh", + "uvvh" + ], + "video/vnd.dece.mobile": [ + "uvm", + "uvvm" + ], + "video/vnd.dece.mp4": [], + "video/vnd.dece.pd": [ + "uvp", + "uvvp" + ], + "video/vnd.dece.sd": [ + "uvs", + "uvvs" + ], + "video/vnd.dece.video": [ + "uvv", + "uvvv" + ], + "video/vnd.directv.mpeg": [], + "video/vnd.directv.mpeg-tts": [], + "video/vnd.dlna.mpeg-tts": [], + "video/vnd.dvb.file": [ + "dvb" + ], + "video/vnd.fvt": [ + "fvt" + ], + "video/vnd.hns.video": [], + "video/vnd.iptvforum.1dparityfec-1010": [], + "video/vnd.iptvforum.1dparityfec-2005": [], + "video/vnd.iptvforum.2dparityfec-1010": [], + "video/vnd.iptvforum.2dparityfec-2005": [], + "video/vnd.iptvforum.ttsavc": [], + "video/vnd.iptvforum.ttsmpeg2": [], + "video/vnd.motorola.video": [], + "video/vnd.motorola.videop": [], + "video/vnd.mpegurl": [ + "mxu", + "m4u" + ], + "video/vnd.ms-playready.media.pyv": [ + "pyv" + ], + "video/vnd.nokia.interleaved-multimedia": [], + "video/vnd.nokia.videovoip": [], + "video/vnd.objectvideo": [], + "video/vnd.sealed.mpeg1": [], + "video/vnd.sealed.mpeg4": [], + "video/vnd.sealed.swf": [], + "video/vnd.sealedmedia.softseal.mov": [], + "video/vnd.uvvu.mp4": [ + "uvu", + "uvvu" + ], + "video/vnd.vivo": [ + "viv" + ], + "video/webm": [ + "webm" + ], + "video/x-f4v": [ + "f4v" + ], + "video/x-fli": [ + "fli" + ], + "video/x-flv": [ + "flv" + ], + "video/x-m4v": [ + "m4v" + ], + "video/x-matroska": [ + "mkv", + "mk3d", + "mks" + ], + "video/x-mng": [ + "mng" + ], + "video/x-ms-asf": [ + "asf", + "asx" + ], + "video/x-ms-vob": [ + "vob" + ], + "video/x-ms-wm": [ + "wm" + ], + "video/x-ms-wmv": [ + "wmv" + ], + "video/x-ms-wmx": [ + "wmx" + ], + "video/x-ms-wvx": [ + "wvx" + ], + "video/x-msvideo": [ + "avi" + ], + "video/x-sgi-movie": [ + "movie" + ], + "video/x-smv": [ + "smv" + ], + "x-conference/x-cooltalk": [ + "ice" + ] +} diff --git a/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/mime-types/lib/node.json b/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/mime-types/lib/node.json new file mode 100644 index 0000000..ad50d61 --- /dev/null +++ b/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/mime-types/lib/node.json @@ -0,0 +1,55 @@ +{ + "text/vtt": [ + "vtt" + ], + "application/x-chrome-extension": [ + "crx" + ], + "text/x-component": [ + "htc" + ], + "text/cache-manifest": [ + "manifest" + ], + "application/octet-stream": [ + "buffer" + ], + "application/mp4": [ + "m4p" + ], + "audio/mp4": [ + "m4a" + ], + "video/MP2T": [ + "ts" + ], + "application/x-web-app-manifest+json": [ + "webapp" + ], + "text/x-lua": [ + "lua" + ], + "application/x-lua-bytecode": [ + "luac" + ], + "text/x-markdown": [ + "markdown", + "md", + "mkd" + ], + "text/plain": [ + "ini" + ], + "application/dash+xml": [ + "mdp" + ], + "font/opentype": [ + "otf" + ], + "application/json": [ + "map" + ], + "application/xml": [ + "xsd" + ] +} diff --git a/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/mime-types/package.json b/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/mime-types/package.json new file mode 100644 index 0000000..baa79a9 --- /dev/null +++ b/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/mime-types/package.json @@ -0,0 +1,69 @@ +{ + "name": "mime-types", + "description": "The ultimate javascript content-type utility.", + "version": "1.0.2", + "author": { + "name": "Jonathan Ong", + "email": "me@jongleberry.com", + "url": "http://jongleberry.com" + }, + "contributors": [ + { + "name": "Jeremiah Senkpiel", + "email": "fishrock123@rocketmail.com", + "url": "https://searchbeam.jit.su" + } + ], + "repository": { + "type": "git", + "url": "https://github.com/expressjs/mime-types" + }, + "license": "MIT", + "main": "lib", + "devDependencies": { + "co": "3", + "cogent": "0", + "mocha": "1", + "should": "3" + }, + "engines": { + "node": ">= 0.8.0" + }, + "scripts": { + "test": "make test" + }, + "gitHead": "e82b23836eb42003b8346fb31769da2fb7eb54e8", + "bugs": { + "url": "https://github.com/expressjs/mime-types/issues" + }, + "homepage": "https://github.com/expressjs/mime-types", + "_id": "mime-types@1.0.2", + "_shasum": "995ae1392ab8affcbfcb2641dd054e943c0d5dce", + "_from": "mime-types@~1.0.1", + "_npmVersion": "1.4.21", + "_npmUser": { + "name": "dougwilson", + "email": "doug@somethingdoug.com" + }, + "maintainers": [ + { + "name": "jongleberry", + "email": "jonathanrichardong@gmail.com" + }, + { + "name": "fishrock123", + "email": "fishrock123@rocketmail.com" + }, + { + "name": "dougwilson", + "email": "doug@somethingdoug.com" + } + ], + "dist": { + "shasum": "995ae1392ab8affcbfcb2641dd054e943c0d5dce", + "tarball": "http://registry.npmjs.org/mime-types/-/mime-types-1.0.2.tgz" + }, + "directories": {}, + "_resolved": "https://registry.npmjs.org/mime-types/-/mime-types-1.0.2.tgz", + "readme": "ERROR: No README data found!" +} diff --git a/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/mime/README.md b/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/mime/README.md deleted file mode 100644 index 6ca19bd..0000000 --- a/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/mime/README.md +++ /dev/null @@ -1,66 +0,0 @@ -# mime - -Comprehensive MIME type mapping API. Includes all 600+ types and 800+ extensions defined by the Apache project, plus additional types submitted by the node.js community. - -## Install - -Install with [npm](http://github.com/isaacs/npm): - - npm install mime - -## API - Queries - -### mime.lookup(path) -Get the mime type associated with a file, if no mime type is found `application/octet-stream` is returned. Performs a case-insensitive lookup using the extension in `path` (the substring after the last '/' or '.'). E.g. - - var mime = require('mime'); - - mime.lookup('/path/to/file.txt'); // => 'text/plain' - mime.lookup('file.txt'); // => 'text/plain' - mime.lookup('.TXT'); // => 'text/plain' - mime.lookup('htm'); // => 'text/html' - -### mime.default_type -Sets the mime type returned when `mime.lookup` fails to find the extension searched for. (Default is `application/octet-stream`.) - -### mime.extension(type) -Get the default extension for `type` - - mime.extension('text/html'); // => 'html' - mime.extension('application/octet-stream'); // => 'bin' - -### mime.charsets.lookup() - -Map mime-type to charset - - mime.charsets.lookup('text/plain'); // => 'UTF-8' - -(The logic for charset lookups is pretty rudimentary. Feel free to suggest improvements.) - -## API - Defining Custom Types - -The following APIs allow you to add your own type mappings within your project. If you feel a type should be included as part of node-mime, see [requesting new types](https://github.com/broofa/node-mime/wiki/Requesting-New-Types). - -### mime.define() - -Add custom mime/extension mappings - - mime.define({ - 'text/x-some-format': ['x-sf', 'x-sft', 'x-sfml'], - 'application/x-my-type': ['x-mt', 'x-mtt'], - // etc ... - }); - - mime.lookup('x-sft'); // => 'text/x-some-format' - -The first entry in the extensions array is returned by `mime.extension()`. E.g. - - mime.extension('text/x-some-format'); // => 'x-sf' - -### mime.load(filepath) - -Load mappings from an Apache ".types" format file - - mime.load('./my_project.types'); - -The .types file format is simple - See the `types` dir for examples. diff --git a/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/mime/mime.js b/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/mime/mime.js deleted file mode 100644 index 48be0c5..0000000 --- a/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/mime/mime.js +++ /dev/null @@ -1,114 +0,0 @@ -var path = require('path'); -var fs = require('fs'); - -function Mime() { - // Map of extension -> mime type - this.types = Object.create(null); - - // Map of mime type -> extension - this.extensions = Object.create(null); -} - -/** - * Define mimetype -> extension mappings. Each key is a mime-type that maps - * to an array of extensions associated with the type. The first extension is - * used as the default extension for the type. - * - * e.g. mime.define({'audio/ogg', ['oga', 'ogg', 'spx']}); - * - * @param map (Object) type definitions - */ -Mime.prototype.define = function (map) { - for (var type in map) { - var exts = map[type]; - - for (var i = 0; i < exts.length; i++) { - if (process.env.DEBUG_MIME && this.types[exts]) { - console.warn(this._loading.replace(/.*\//, ''), 'changes "' + exts[i] + '" extension type from ' + - this.types[exts] + ' to ' + type); - } - - this.types[exts[i]] = type; - } - - // Default extension is the first one we encounter - if (!this.extensions[type]) { - this.extensions[type] = exts[0]; - } - } -}; - -/** - * Load an Apache2-style ".types" file - * - * This may be called multiple times (it's expected). Where files declare - * overlapping types/extensions, the last file wins. - * - * @param file (String) path of file to load. - */ -Mime.prototype.load = function(file) { - - this._loading = file; - // Read file and split into lines - var map = {}, - content = fs.readFileSync(file, 'ascii'), - lines = content.split(/[\r\n]+/); - - lines.forEach(function(line) { - // Clean up whitespace/comments, and split into fields - var fields = line.replace(/\s*#.*|^\s*|\s*$/g, '').split(/\s+/); - map[fields.shift()] = fields; - }); - - this.define(map); - - this._loading = null; -}; - -/** - * Lookup a mime type based on extension - */ -Mime.prototype.lookup = function(path, fallback) { - var ext = path.replace(/.*[\.\/\\]/, '').toLowerCase(); - - return this.types[ext] || fallback || this.default_type; -}; - -/** - * Return file extension associated with a mime type - */ -Mime.prototype.extension = function(mimeType) { - var type = mimeType.match(/^\s*([^;\s]*)(?:;|\s|$)/)[1].toLowerCase(); - return this.extensions[type]; -}; - -// Default instance -var mime = new Mime(); - -// Load local copy of -// http://svn.apache.org/repos/asf/httpd/httpd/trunk/docs/conf/mime.types -mime.load(path.join(__dirname, 'types/mime.types')); - -// Load additional types from node.js community -mime.load(path.join(__dirname, 'types/node.types')); - -// Default type -mime.default_type = mime.lookup('bin'); - -// -// Additional API specific to the default instance -// - -mime.Mime = Mime; - -/** - * Lookup a charset based on mime type. - */ -mime.charsets = { - lookup: function(mimeType, fallback) { - // Assume text types are utf8 - return (/^text\//).test(mimeType) ? 'UTF-8' : fallback; - } -}; - -module.exports = mime; diff --git a/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/mime/package.json b/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/mime/package.json deleted file mode 100644 index e031ac7..0000000 --- a/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/mime/package.json +++ /dev/null @@ -1,59 +0,0 @@ -{ - "author": { - "name": "Robert Kieffer", - "email": "robert@broofa.com", - "url": "http://github.com/broofa" - }, - "contributors": [ - { - "name": "Benjamin Thomas", - "email": "benjamin@benjaminthomas.org", - "url": "http://github.com/bentomas" - } - ], - "dependencies": {}, - "description": "A comprehensive library for mime-type mapping", - "devDependencies": {}, - "keywords": [ - "util", - "mime" - ], - "main": "mime.js", - "name": "mime", - "repository": { - "url": "https://github.com/broofa/node-mime", - "type": "git" - }, - "version": "1.2.11", - "readme": "# mime\n\nComprehensive MIME type mapping API. Includes all 600+ types and 800+ extensions defined by the Apache project, plus additional types submitted by the node.js community.\n\n## Install\n\nInstall with [npm](http://github.com/isaacs/npm):\n\n npm install mime\n\n## API - Queries\n\n### mime.lookup(path)\nGet the mime type associated with a file, if no mime type is found `application/octet-stream` is returned. Performs a case-insensitive lookup using the extension in `path` (the substring after the last '/' or '.'). E.g.\n\n var mime = require('mime');\n\n mime.lookup('/path/to/file.txt'); // => 'text/plain'\n mime.lookup('file.txt'); // => 'text/plain'\n mime.lookup('.TXT'); // => 'text/plain'\n mime.lookup('htm'); // => 'text/html'\n\n### mime.default_type\nSets the mime type returned when `mime.lookup` fails to find the extension searched for. (Default is `application/octet-stream`.)\n\n### mime.extension(type)\nGet the default extension for `type`\n\n mime.extension('text/html'); // => 'html'\n mime.extension('application/octet-stream'); // => 'bin'\n\n### mime.charsets.lookup()\n\nMap mime-type to charset\n\n mime.charsets.lookup('text/plain'); // => 'UTF-8'\n\n(The logic for charset lookups is pretty rudimentary. Feel free to suggest improvements.)\n\n## API - Defining Custom Types\n\nThe following APIs allow you to add your own type mappings within your project. If you feel a type should be included as part of node-mime, see [requesting new types](https://github.com/broofa/node-mime/wiki/Requesting-New-Types).\n\n### mime.define()\n\nAdd custom mime/extension mappings\n\n mime.define({\n 'text/x-some-format': ['x-sf', 'x-sft', 'x-sfml'],\n 'application/x-my-type': ['x-mt', 'x-mtt'],\n // etc ...\n });\n\n mime.lookup('x-sft'); // => 'text/x-some-format'\n\nThe first entry in the extensions array is returned by `mime.extension()`. E.g.\n\n mime.extension('text/x-some-format'); // => 'x-sf'\n\n### mime.load(filepath)\n\nLoad mappings from an Apache \".types\" format file\n\n mime.load('./my_project.types');\n\nThe .types file format is simple - See the `types` dir for examples.\n", - "readmeFilename": "README.md", - "bugs": { - "url": "https://github.com/broofa/node-mime/issues" - }, - "_id": "mime@1.2.11", - "dist": { - "shasum": "58203eed86e3a5ef17aed2b7d9ebd47f0a60dd10", - "tarball": "http://registry.npmjs.org/mime/-/mime-1.2.11.tgz" - }, - "_from": "mime@~1.2.9", - "_npmVersion": "1.3.6", - "_npmUser": { - "name": "broofa", - "email": "robert@broofa.com" - }, - "maintainers": [ - { - "name": "broofa", - "email": "robert@broofa.com" - }, - { - "name": "bentomas", - "email": "benjamin@benjaminthomas.org" - } - ], - "directories": {}, - "_shasum": "58203eed86e3a5ef17aed2b7d9ebd47f0a60dd10", - "_resolved": "https://registry.npmjs.org/mime/-/mime-1.2.11.tgz", - "homepage": "https://github.com/broofa/node-mime", - "scripts": {} -} diff --git a/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/mime/test.js b/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/mime/test.js deleted file mode 100644 index 2cda1c7..0000000 --- a/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/mime/test.js +++ /dev/null @@ -1,84 +0,0 @@ -/** - * Usage: node test.js - */ - -var mime = require('./mime'); -var assert = require('assert'); -var path = require('path'); - -function eq(a, b) { - console.log('Test: ' + a + ' === ' + b); - assert.strictEqual.apply(null, arguments); -} - -console.log(Object.keys(mime.extensions).length + ' types'); -console.log(Object.keys(mime.types).length + ' extensions\n'); - -// -// Test mime lookups -// - -eq('text/plain', mime.lookup('text.txt')); // normal file -eq('text/plain', mime.lookup('TEXT.TXT')); // uppercase -eq('text/plain', mime.lookup('dir/text.txt')); // dir + file -eq('text/plain', mime.lookup('.text.txt')); // hidden file -eq('text/plain', mime.lookup('.txt')); // nameless -eq('text/plain', mime.lookup('txt')); // extension-only -eq('text/plain', mime.lookup('/txt')); // extension-less () -eq('text/plain', mime.lookup('\\txt')); // Windows, extension-less -eq('application/octet-stream', mime.lookup('text.nope')); // unrecognized -eq('fallback', mime.lookup('text.fallback', 'fallback')); // alternate default - -// -// Test extensions -// - -eq('txt', mime.extension(mime.types.text)); -eq('html', mime.extension(mime.types.htm)); -eq('bin', mime.extension('application/octet-stream')); -eq('bin', mime.extension('application/octet-stream ')); -eq('html', mime.extension(' text/html; charset=UTF-8')); -eq('html', mime.extension('text/html; charset=UTF-8 ')); -eq('html', mime.extension('text/html; charset=UTF-8')); -eq('html', mime.extension('text/html ; charset=UTF-8')); -eq('html', mime.extension('text/html;charset=UTF-8')); -eq('html', mime.extension('text/Html;charset=UTF-8')); -eq(undefined, mime.extension('unrecognized')); - -// -// Test node.types lookups -// - -eq('application/font-woff', mime.lookup('file.woff')); -eq('application/octet-stream', mime.lookup('file.buffer')); -eq('audio/mp4', mime.lookup('file.m4a')); -eq('font/opentype', mime.lookup('file.otf')); - -// -// Test charsets -// - -eq('UTF-8', mime.charsets.lookup('text/plain')); -eq(undefined, mime.charsets.lookup(mime.types.js)); -eq('fallback', mime.charsets.lookup('application/octet-stream', 'fallback')); - -// -// Test for overlaps between mime.types and node.types -// - -var apacheTypes = new mime.Mime(), nodeTypes = new mime.Mime(); -apacheTypes.load(path.join(__dirname, 'types/mime.types')); -nodeTypes.load(path.join(__dirname, 'types/node.types')); - -var keys = [].concat(Object.keys(apacheTypes.types)) - .concat(Object.keys(nodeTypes.types)); -keys.sort(); -for (var i = 1; i < keys.length; i++) { - if (keys[i] == keys[i-1]) { - console.warn('Warning: ' + - 'node.types defines ' + keys[i] + '->' + nodeTypes.types[keys[i]] + - ', mime.types defines ' + keys[i] + '->' + apacheTypes.types[keys[i]]); - } -} - -console.log('\nOK'); diff --git a/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/mime/types/mime.types b/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/mime/types/mime.types deleted file mode 100644 index da8cd69..0000000 --- a/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/mime/types/mime.types +++ /dev/null @@ -1,1588 +0,0 @@ -# This file maps Internet media types to unique file extension(s). -# Although created for httpd, this file is used by many software systems -# and has been placed in the public domain for unlimited redisribution. -# -# The table below contains both registered and (common) unregistered types. -# A type that has no unique extension can be ignored -- they are listed -# here to guide configurations toward known types and to make it easier to -# identify "new" types. File extensions are also commonly used to indicate -# content languages and encodings, so choose them carefully. -# -# Internet media types should be registered as described in RFC 4288. -# The registry is at . -# -# MIME type (lowercased) Extensions -# ============================================ ========== -# application/1d-interleaved-parityfec -# application/3gpp-ims+xml -# application/activemessage -application/andrew-inset ez -# application/applefile -application/applixware aw -application/atom+xml atom -application/atomcat+xml atomcat -# application/atomicmail -application/atomsvc+xml atomsvc -# application/auth-policy+xml -# application/batch-smtp -# application/beep+xml -# application/calendar+xml -# application/cals-1840 -# application/ccmp+xml -application/ccxml+xml ccxml -application/cdmi-capability cdmia -application/cdmi-container cdmic -application/cdmi-domain cdmid -application/cdmi-object cdmio -application/cdmi-queue cdmiq -# application/cea-2018+xml -# application/cellml+xml -# application/cfw -# application/cnrp+xml -# application/commonground -# application/conference-info+xml -# application/cpl+xml -# application/csta+xml -# application/cstadata+xml -application/cu-seeme cu -# application/cybercash -application/davmount+xml davmount -# application/dca-rft -# application/dec-dx -# application/dialog-info+xml -# application/dicom -# application/dns -application/docbook+xml dbk -# application/dskpp+xml -application/dssc+der dssc -application/dssc+xml xdssc -# application/dvcs -application/ecmascript ecma -# application/edi-consent -# application/edi-x12 -# application/edifact -application/emma+xml emma -# application/epp+xml -application/epub+zip epub -# application/eshop -# application/example -application/exi exi -# application/fastinfoset -# application/fastsoap -# application/fits -application/font-tdpfr pfr -# application/framework-attributes+xml -application/gml+xml gml -application/gpx+xml gpx -application/gxf gxf -# application/h224 -# application/held+xml -# application/http -application/hyperstudio stk -# application/ibe-key-request+xml -# application/ibe-pkg-reply+xml -# application/ibe-pp-data -# application/iges -# application/im-iscomposing+xml -# application/index -# application/index.cmd -# application/index.obj -# application/index.response -# application/index.vnd -application/inkml+xml ink inkml -# application/iotp -application/ipfix ipfix -# application/ipp -# application/isup -application/java-archive jar -application/java-serialized-object ser -application/java-vm class -application/javascript js -application/json json -application/jsonml+json jsonml -# application/kpml-request+xml -# application/kpml-response+xml -application/lost+xml lostxml -application/mac-binhex40 hqx -application/mac-compactpro cpt -# application/macwriteii -application/mads+xml mads -application/marc mrc -application/marcxml+xml mrcx -application/mathematica ma nb mb -# application/mathml-content+xml -# application/mathml-presentation+xml -application/mathml+xml mathml -# application/mbms-associated-procedure-description+xml -# application/mbms-deregister+xml -# application/mbms-envelope+xml -# application/mbms-msk+xml -# application/mbms-msk-response+xml -# application/mbms-protection-description+xml -# application/mbms-reception-report+xml -# application/mbms-register+xml -# application/mbms-register-response+xml -# application/mbms-user-service-description+xml -application/mbox mbox -# application/media_control+xml -application/mediaservercontrol+xml mscml -application/metalink+xml metalink -application/metalink4+xml meta4 -application/mets+xml mets -# application/mikey -application/mods+xml mods -# application/moss-keys -# application/moss-signature -# application/mosskey-data -# application/mosskey-request -application/mp21 m21 mp21 -application/mp4 mp4s -# application/mpeg4-generic -# application/mpeg4-iod -# application/mpeg4-iod-xmt -# application/msc-ivr+xml -# application/msc-mixer+xml -application/msword doc dot -application/mxf mxf -# application/nasdata -# application/news-checkgroups -# application/news-groupinfo -# application/news-transmission -# application/nss -# application/ocsp-request -# application/ocsp-response -application/octet-stream bin dms lrf mar so dist distz pkg bpk dump elc deploy -application/oda oda -application/oebps-package+xml opf -application/ogg ogx -application/omdoc+xml omdoc -application/onenote onetoc onetoc2 onetmp onepkg -application/oxps oxps -# application/parityfec -application/patch-ops-error+xml xer -application/pdf pdf -application/pgp-encrypted pgp -# application/pgp-keys -application/pgp-signature asc sig -application/pics-rules prf -# application/pidf+xml -# application/pidf-diff+xml -application/pkcs10 p10 -application/pkcs7-mime p7m p7c -application/pkcs7-signature p7s -application/pkcs8 p8 -application/pkix-attr-cert ac -application/pkix-cert cer -application/pkix-crl crl -application/pkix-pkipath pkipath -application/pkixcmp pki -application/pls+xml pls -# application/poc-settings+xml -application/postscript ai eps ps -# application/prs.alvestrand.titrax-sheet -application/prs.cww cww -# application/prs.nprend -# application/prs.plucker -# application/prs.rdf-xml-crypt -# application/prs.xsf+xml -application/pskc+xml pskcxml -# application/qsig -application/rdf+xml rdf -application/reginfo+xml rif -application/relax-ng-compact-syntax rnc -# application/remote-printing -application/resource-lists+xml rl -application/resource-lists-diff+xml rld -# application/riscos -# application/rlmi+xml -application/rls-services+xml rs -application/rpki-ghostbusters gbr -application/rpki-manifest mft -application/rpki-roa roa -# application/rpki-updown -application/rsd+xml rsd -application/rss+xml rss -application/rtf rtf -# application/rtx -# application/samlassertion+xml -# application/samlmetadata+xml -application/sbml+xml sbml -application/scvp-cv-request scq -application/scvp-cv-response scs -application/scvp-vp-request spq -application/scvp-vp-response spp -application/sdp sdp -# application/set-payment -application/set-payment-initiation setpay -# application/set-registration -application/set-registration-initiation setreg -# application/sgml -# application/sgml-open-catalog -application/shf+xml shf -# application/sieve -# application/simple-filter+xml -# application/simple-message-summary -# application/simplesymbolcontainer -# application/slate -# application/smil -application/smil+xml smi smil -# application/soap+fastinfoset -# application/soap+xml -application/sparql-query rq -application/sparql-results+xml srx -# application/spirits-event+xml -application/srgs gram -application/srgs+xml grxml -application/sru+xml sru -application/ssdl+xml ssdl -application/ssml+xml ssml -# application/tamp-apex-update -# application/tamp-apex-update-confirm -# application/tamp-community-update -# application/tamp-community-update-confirm -# application/tamp-error -# application/tamp-sequence-adjust -# application/tamp-sequence-adjust-confirm -# application/tamp-status-query -# application/tamp-status-response -# application/tamp-update -# application/tamp-update-confirm -application/tei+xml tei teicorpus -application/thraud+xml tfi -# application/timestamp-query -# application/timestamp-reply -application/timestamped-data tsd -# application/tve-trigger -# application/ulpfec -# application/vcard+xml -# application/vemmi -# application/vividence.scriptfile -# application/vnd.3gpp.bsf+xml -application/vnd.3gpp.pic-bw-large plb -application/vnd.3gpp.pic-bw-small psb -application/vnd.3gpp.pic-bw-var pvb -# application/vnd.3gpp.sms -# application/vnd.3gpp2.bcmcsinfo+xml -# application/vnd.3gpp2.sms -application/vnd.3gpp2.tcap tcap -application/vnd.3m.post-it-notes pwn -application/vnd.accpac.simply.aso aso -application/vnd.accpac.simply.imp imp -application/vnd.acucobol acu -application/vnd.acucorp atc acutc -application/vnd.adobe.air-application-installer-package+zip air -application/vnd.adobe.formscentral.fcdt fcdt -application/vnd.adobe.fxp fxp fxpl -# application/vnd.adobe.partial-upload -application/vnd.adobe.xdp+xml xdp -application/vnd.adobe.xfdf xfdf -# application/vnd.aether.imp -# application/vnd.ah-barcode -application/vnd.ahead.space ahead -application/vnd.airzip.filesecure.azf azf -application/vnd.airzip.filesecure.azs azs -application/vnd.amazon.ebook azw -application/vnd.americandynamics.acc acc -application/vnd.amiga.ami ami -# application/vnd.amundsen.maze+xml -application/vnd.android.package-archive apk -application/vnd.anser-web-certificate-issue-initiation cii -application/vnd.anser-web-funds-transfer-initiation fti -application/vnd.antix.game-component atx -application/vnd.apple.installer+xml mpkg -application/vnd.apple.mpegurl m3u8 -# application/vnd.arastra.swi -application/vnd.aristanetworks.swi swi -application/vnd.astraea-software.iota iota -application/vnd.audiograph aep -# application/vnd.autopackage -# application/vnd.avistar+xml -application/vnd.blueice.multipass mpm -# application/vnd.bluetooth.ep.oob -application/vnd.bmi bmi -application/vnd.businessobjects rep -# application/vnd.cab-jscript -# application/vnd.canon-cpdl -# application/vnd.canon-lips -# application/vnd.cendio.thinlinc.clientconf -application/vnd.chemdraw+xml cdxml -application/vnd.chipnuts.karaoke-mmd mmd -application/vnd.cinderella cdy -# application/vnd.cirpack.isdn-ext -application/vnd.claymore cla -application/vnd.cloanto.rp9 rp9 -application/vnd.clonk.c4group c4g c4d c4f c4p c4u -application/vnd.cluetrust.cartomobile-config c11amc -application/vnd.cluetrust.cartomobile-config-pkg c11amz -# application/vnd.collection+json -# application/vnd.commerce-battelle -application/vnd.commonspace csp -application/vnd.contact.cmsg cdbcmsg -application/vnd.cosmocaller cmc -application/vnd.crick.clicker clkx -application/vnd.crick.clicker.keyboard clkk -application/vnd.crick.clicker.palette clkp -application/vnd.crick.clicker.template clkt -application/vnd.crick.clicker.wordbank clkw -application/vnd.criticaltools.wbs+xml wbs -application/vnd.ctc-posml pml -# application/vnd.ctct.ws+xml -# application/vnd.cups-pdf -# application/vnd.cups-postscript -application/vnd.cups-ppd ppd -# application/vnd.cups-raster -# application/vnd.cups-raw -# application/vnd.curl -application/vnd.curl.car car -application/vnd.curl.pcurl pcurl -# application/vnd.cybank -application/vnd.dart dart -application/vnd.data-vision.rdz rdz -application/vnd.dece.data uvf uvvf uvd uvvd -application/vnd.dece.ttml+xml uvt uvvt -application/vnd.dece.unspecified uvx uvvx -application/vnd.dece.zip uvz uvvz -application/vnd.denovo.fcselayout-link fe_launch -# application/vnd.dir-bi.plate-dl-nosuffix -application/vnd.dna dna -application/vnd.dolby.mlp mlp -# application/vnd.dolby.mobile.1 -# application/vnd.dolby.mobile.2 -application/vnd.dpgraph dpg -application/vnd.dreamfactory dfac -application/vnd.ds-keypoint kpxx -application/vnd.dvb.ait ait -# application/vnd.dvb.dvbj -# application/vnd.dvb.esgcontainer -# application/vnd.dvb.ipdcdftnotifaccess -# application/vnd.dvb.ipdcesgaccess -# application/vnd.dvb.ipdcesgaccess2 -# application/vnd.dvb.ipdcesgpdd -# application/vnd.dvb.ipdcroaming -# application/vnd.dvb.iptv.alfec-base -# application/vnd.dvb.iptv.alfec-enhancement -# application/vnd.dvb.notif-aggregate-root+xml -# application/vnd.dvb.notif-container+xml -# application/vnd.dvb.notif-generic+xml -# application/vnd.dvb.notif-ia-msglist+xml -# application/vnd.dvb.notif-ia-registration-request+xml -# application/vnd.dvb.notif-ia-registration-response+xml -# application/vnd.dvb.notif-init+xml -# application/vnd.dvb.pfr -application/vnd.dvb.service svc -# application/vnd.dxr -application/vnd.dynageo geo -# application/vnd.easykaraoke.cdgdownload -# application/vnd.ecdis-update -application/vnd.ecowin.chart mag -# application/vnd.ecowin.filerequest -# application/vnd.ecowin.fileupdate -# application/vnd.ecowin.series -# application/vnd.ecowin.seriesrequest -# application/vnd.ecowin.seriesupdate -# application/vnd.emclient.accessrequest+xml -application/vnd.enliven nml -# application/vnd.eprints.data+xml -application/vnd.epson.esf esf -application/vnd.epson.msf msf -application/vnd.epson.quickanime qam -application/vnd.epson.salt slt -application/vnd.epson.ssf ssf -# application/vnd.ericsson.quickcall -application/vnd.eszigno3+xml es3 et3 -# application/vnd.etsi.aoc+xml -# application/vnd.etsi.cug+xml -# application/vnd.etsi.iptvcommand+xml -# application/vnd.etsi.iptvdiscovery+xml -# application/vnd.etsi.iptvprofile+xml -# application/vnd.etsi.iptvsad-bc+xml -# application/vnd.etsi.iptvsad-cod+xml -# application/vnd.etsi.iptvsad-npvr+xml -# application/vnd.etsi.iptvservice+xml -# application/vnd.etsi.iptvsync+xml -# application/vnd.etsi.iptvueprofile+xml -# application/vnd.etsi.mcid+xml -# application/vnd.etsi.overload-control-policy-dataset+xml -# application/vnd.etsi.sci+xml -# application/vnd.etsi.simservs+xml -# application/vnd.etsi.tsl+xml -# application/vnd.etsi.tsl.der -# application/vnd.eudora.data -application/vnd.ezpix-album ez2 -application/vnd.ezpix-package ez3 -# application/vnd.f-secure.mobile -application/vnd.fdf fdf -application/vnd.fdsn.mseed mseed -application/vnd.fdsn.seed seed dataless -# application/vnd.ffsns -# application/vnd.fints -application/vnd.flographit gph -application/vnd.fluxtime.clip ftc -# application/vnd.font-fontforge-sfd -application/vnd.framemaker fm frame maker book -application/vnd.frogans.fnc fnc -application/vnd.frogans.ltf ltf -application/vnd.fsc.weblaunch fsc -application/vnd.fujitsu.oasys oas -application/vnd.fujitsu.oasys2 oa2 -application/vnd.fujitsu.oasys3 oa3 -application/vnd.fujitsu.oasysgp fg5 -application/vnd.fujitsu.oasysprs bh2 -# application/vnd.fujixerox.art-ex -# application/vnd.fujixerox.art4 -# application/vnd.fujixerox.hbpl -application/vnd.fujixerox.ddd ddd -application/vnd.fujixerox.docuworks xdw -application/vnd.fujixerox.docuworks.binder xbd -# application/vnd.fut-misnet -application/vnd.fuzzysheet fzs -application/vnd.genomatix.tuxedo txd -# application/vnd.geocube+xml -application/vnd.geogebra.file ggb -application/vnd.geogebra.tool ggt -application/vnd.geometry-explorer gex gre -application/vnd.geonext gxt -application/vnd.geoplan g2w -application/vnd.geospace g3w -# application/vnd.globalplatform.card-content-mgt -# application/vnd.globalplatform.card-content-mgt-response -application/vnd.gmx gmx -application/vnd.google-earth.kml+xml kml -application/vnd.google-earth.kmz kmz -application/vnd.grafeq gqf gqs -# application/vnd.gridmp -application/vnd.groove-account gac -application/vnd.groove-help ghf -application/vnd.groove-identity-message gim -application/vnd.groove-injector grv -application/vnd.groove-tool-message gtm -application/vnd.groove-tool-template tpl -application/vnd.groove-vcard vcg -# application/vnd.hal+json -application/vnd.hal+xml hal -application/vnd.handheld-entertainment+xml zmm -application/vnd.hbci hbci -# application/vnd.hcl-bireports -application/vnd.hhe.lesson-player les -application/vnd.hp-hpgl hpgl -application/vnd.hp-hpid hpid -application/vnd.hp-hps hps -application/vnd.hp-jlyt jlt -application/vnd.hp-pcl pcl -application/vnd.hp-pclxl pclxl -# application/vnd.httphone -application/vnd.hydrostatix.sof-data sfd-hdstx -# application/vnd.hzn-3d-crossword -# application/vnd.ibm.afplinedata -# application/vnd.ibm.electronic-media -application/vnd.ibm.minipay mpy -application/vnd.ibm.modcap afp listafp list3820 -application/vnd.ibm.rights-management irm -application/vnd.ibm.secure-container sc -application/vnd.iccprofile icc icm -application/vnd.igloader igl -application/vnd.immervision-ivp ivp -application/vnd.immervision-ivu ivu -# application/vnd.informedcontrol.rms+xml -# application/vnd.informix-visionary -# application/vnd.infotech.project -# application/vnd.infotech.project+xml -# application/vnd.innopath.wamp.notification -application/vnd.insors.igm igm -application/vnd.intercon.formnet xpw xpx -application/vnd.intergeo i2g -# application/vnd.intertrust.digibox -# application/vnd.intertrust.nncp -application/vnd.intu.qbo qbo -application/vnd.intu.qfx qfx -# application/vnd.iptc.g2.conceptitem+xml -# application/vnd.iptc.g2.knowledgeitem+xml -# application/vnd.iptc.g2.newsitem+xml -# application/vnd.iptc.g2.newsmessage+xml -# application/vnd.iptc.g2.packageitem+xml -# application/vnd.iptc.g2.planningitem+xml -application/vnd.ipunplugged.rcprofile rcprofile -application/vnd.irepository.package+xml irp -application/vnd.is-xpr xpr -application/vnd.isac.fcs fcs -application/vnd.jam jam -# application/vnd.japannet-directory-service -# application/vnd.japannet-jpnstore-wakeup -# application/vnd.japannet-payment-wakeup -# application/vnd.japannet-registration -# application/vnd.japannet-registration-wakeup -# application/vnd.japannet-setstore-wakeup -# application/vnd.japannet-verification -# application/vnd.japannet-verification-wakeup -application/vnd.jcp.javame.midlet-rms rms -application/vnd.jisp jisp -application/vnd.joost.joda-archive joda -application/vnd.kahootz ktz ktr -application/vnd.kde.karbon karbon -application/vnd.kde.kchart chrt -application/vnd.kde.kformula kfo -application/vnd.kde.kivio flw -application/vnd.kde.kontour kon -application/vnd.kde.kpresenter kpr kpt -application/vnd.kde.kspread ksp -application/vnd.kde.kword kwd kwt -application/vnd.kenameaapp htke -application/vnd.kidspiration kia -application/vnd.kinar kne knp -application/vnd.koan skp skd skt skm -application/vnd.kodak-descriptor sse -application/vnd.las.las+xml lasxml -# application/vnd.liberty-request+xml -application/vnd.llamagraphics.life-balance.desktop lbd -application/vnd.llamagraphics.life-balance.exchange+xml lbe -application/vnd.lotus-1-2-3 123 -application/vnd.lotus-approach apr -application/vnd.lotus-freelance pre -application/vnd.lotus-notes nsf -application/vnd.lotus-organizer org -application/vnd.lotus-screencam scm -application/vnd.lotus-wordpro lwp -application/vnd.macports.portpkg portpkg -# application/vnd.marlin.drm.actiontoken+xml -# application/vnd.marlin.drm.conftoken+xml -# application/vnd.marlin.drm.license+xml -# application/vnd.marlin.drm.mdcf -application/vnd.mcd mcd -application/vnd.medcalcdata mc1 -application/vnd.mediastation.cdkey cdkey -# application/vnd.meridian-slingshot -application/vnd.mfer mwf -application/vnd.mfmp mfm -application/vnd.micrografx.flo flo -application/vnd.micrografx.igx igx -application/vnd.mif mif -# application/vnd.minisoft-hp3000-save -# application/vnd.mitsubishi.misty-guard.trustweb -application/vnd.mobius.daf daf -application/vnd.mobius.dis dis -application/vnd.mobius.mbk mbk -application/vnd.mobius.mqy mqy -application/vnd.mobius.msl msl -application/vnd.mobius.plc plc -application/vnd.mobius.txf txf -application/vnd.mophun.application mpn -application/vnd.mophun.certificate mpc -# application/vnd.motorola.flexsuite -# application/vnd.motorola.flexsuite.adsi -# application/vnd.motorola.flexsuite.fis -# application/vnd.motorola.flexsuite.gotap -# application/vnd.motorola.flexsuite.kmr -# application/vnd.motorola.flexsuite.ttc -# application/vnd.motorola.flexsuite.wem -# application/vnd.motorola.iprm -application/vnd.mozilla.xul+xml xul -application/vnd.ms-artgalry cil -# application/vnd.ms-asf -application/vnd.ms-cab-compressed cab -# application/vnd.ms-color.iccprofile -application/vnd.ms-excel xls xlm xla xlc xlt xlw -application/vnd.ms-excel.addin.macroenabled.12 xlam -application/vnd.ms-excel.sheet.binary.macroenabled.12 xlsb -application/vnd.ms-excel.sheet.macroenabled.12 xlsm -application/vnd.ms-excel.template.macroenabled.12 xltm -application/vnd.ms-fontobject eot -application/vnd.ms-htmlhelp chm -application/vnd.ms-ims ims -application/vnd.ms-lrm lrm -# application/vnd.ms-office.activex+xml -application/vnd.ms-officetheme thmx -# application/vnd.ms-opentype -# application/vnd.ms-package.obfuscated-opentype -application/vnd.ms-pki.seccat cat -application/vnd.ms-pki.stl stl -# application/vnd.ms-playready.initiator+xml -application/vnd.ms-powerpoint ppt pps pot -application/vnd.ms-powerpoint.addin.macroenabled.12 ppam -application/vnd.ms-powerpoint.presentation.macroenabled.12 pptm -application/vnd.ms-powerpoint.slide.macroenabled.12 sldm -application/vnd.ms-powerpoint.slideshow.macroenabled.12 ppsm -application/vnd.ms-powerpoint.template.macroenabled.12 potm -# application/vnd.ms-printing.printticket+xml -application/vnd.ms-project mpp mpt -# application/vnd.ms-tnef -# application/vnd.ms-wmdrm.lic-chlg-req -# application/vnd.ms-wmdrm.lic-resp -# application/vnd.ms-wmdrm.meter-chlg-req -# application/vnd.ms-wmdrm.meter-resp -application/vnd.ms-word.document.macroenabled.12 docm -application/vnd.ms-word.template.macroenabled.12 dotm -application/vnd.ms-works wps wks wcm wdb -application/vnd.ms-wpl wpl -application/vnd.ms-xpsdocument xps -application/vnd.mseq mseq -# application/vnd.msign -# application/vnd.multiad.creator -# application/vnd.multiad.creator.cif -# application/vnd.music-niff -application/vnd.musician mus -application/vnd.muvee.style msty -application/vnd.mynfc taglet -# application/vnd.ncd.control -# application/vnd.ncd.reference -# application/vnd.nervana -# application/vnd.netfpx -application/vnd.neurolanguage.nlu nlu -application/vnd.nitf ntf nitf -application/vnd.noblenet-directory nnd -application/vnd.noblenet-sealer nns -application/vnd.noblenet-web nnw -# application/vnd.nokia.catalogs -# application/vnd.nokia.conml+wbxml -# application/vnd.nokia.conml+xml -# application/vnd.nokia.isds-radio-presets -# application/vnd.nokia.iptv.config+xml -# application/vnd.nokia.landmark+wbxml -# application/vnd.nokia.landmark+xml -# application/vnd.nokia.landmarkcollection+xml -# application/vnd.nokia.n-gage.ac+xml -application/vnd.nokia.n-gage.data ngdat -application/vnd.nokia.n-gage.symbian.install n-gage -# application/vnd.nokia.ncd -# application/vnd.nokia.pcd+wbxml -# application/vnd.nokia.pcd+xml -application/vnd.nokia.radio-preset rpst -application/vnd.nokia.radio-presets rpss -application/vnd.novadigm.edm edm -application/vnd.novadigm.edx edx -application/vnd.novadigm.ext ext -# application/vnd.ntt-local.file-transfer -# application/vnd.ntt-local.sip-ta_remote -# application/vnd.ntt-local.sip-ta_tcp_stream -application/vnd.oasis.opendocument.chart odc -application/vnd.oasis.opendocument.chart-template otc -application/vnd.oasis.opendocument.database odb -application/vnd.oasis.opendocument.formula odf -application/vnd.oasis.opendocument.formula-template odft -application/vnd.oasis.opendocument.graphics odg -application/vnd.oasis.opendocument.graphics-template otg -application/vnd.oasis.opendocument.image odi -application/vnd.oasis.opendocument.image-template oti -application/vnd.oasis.opendocument.presentation odp -application/vnd.oasis.opendocument.presentation-template otp -application/vnd.oasis.opendocument.spreadsheet ods -application/vnd.oasis.opendocument.spreadsheet-template ots -application/vnd.oasis.opendocument.text odt -application/vnd.oasis.opendocument.text-master odm -application/vnd.oasis.opendocument.text-template ott -application/vnd.oasis.opendocument.text-web oth -# application/vnd.obn -# application/vnd.oftn.l10n+json -# application/vnd.oipf.contentaccessdownload+xml -# application/vnd.oipf.contentaccessstreaming+xml -# application/vnd.oipf.cspg-hexbinary -# application/vnd.oipf.dae.svg+xml -# application/vnd.oipf.dae.xhtml+xml -# application/vnd.oipf.mippvcontrolmessage+xml -# application/vnd.oipf.pae.gem -# application/vnd.oipf.spdiscovery+xml -# application/vnd.oipf.spdlist+xml -# application/vnd.oipf.ueprofile+xml -# application/vnd.oipf.userprofile+xml -application/vnd.olpc-sugar xo -# application/vnd.oma-scws-config -# application/vnd.oma-scws-http-request -# application/vnd.oma-scws-http-response -# application/vnd.oma.bcast.associated-procedure-parameter+xml -# application/vnd.oma.bcast.drm-trigger+xml -# application/vnd.oma.bcast.imd+xml -# application/vnd.oma.bcast.ltkm -# application/vnd.oma.bcast.notification+xml -# application/vnd.oma.bcast.provisioningtrigger -# application/vnd.oma.bcast.sgboot -# application/vnd.oma.bcast.sgdd+xml -# application/vnd.oma.bcast.sgdu -# application/vnd.oma.bcast.simple-symbol-container -# application/vnd.oma.bcast.smartcard-trigger+xml -# application/vnd.oma.bcast.sprov+xml -# application/vnd.oma.bcast.stkm -# application/vnd.oma.cab-address-book+xml -# application/vnd.oma.cab-feature-handler+xml -# application/vnd.oma.cab-pcc+xml -# application/vnd.oma.cab-user-prefs+xml -# application/vnd.oma.dcd -# application/vnd.oma.dcdc -application/vnd.oma.dd2+xml dd2 -# application/vnd.oma.drm.risd+xml -# application/vnd.oma.group-usage-list+xml -# application/vnd.oma.pal+xml -# application/vnd.oma.poc.detailed-progress-report+xml -# application/vnd.oma.poc.final-report+xml -# application/vnd.oma.poc.groups+xml -# application/vnd.oma.poc.invocation-descriptor+xml -# application/vnd.oma.poc.optimized-progress-report+xml -# application/vnd.oma.push -# application/vnd.oma.scidm.messages+xml -# application/vnd.oma.xcap-directory+xml -# application/vnd.omads-email+xml -# application/vnd.omads-file+xml -# application/vnd.omads-folder+xml -# application/vnd.omaloc-supl-init -application/vnd.openofficeorg.extension oxt -# application/vnd.openxmlformats-officedocument.custom-properties+xml -# application/vnd.openxmlformats-officedocument.customxmlproperties+xml -# application/vnd.openxmlformats-officedocument.drawing+xml -# application/vnd.openxmlformats-officedocument.drawingml.chart+xml -# application/vnd.openxmlformats-officedocument.drawingml.chartshapes+xml -# application/vnd.openxmlformats-officedocument.drawingml.diagramcolors+xml -# application/vnd.openxmlformats-officedocument.drawingml.diagramdata+xml -# application/vnd.openxmlformats-officedocument.drawingml.diagramlayout+xml -# application/vnd.openxmlformats-officedocument.drawingml.diagramstyle+xml -# application/vnd.openxmlformats-officedocument.extended-properties+xml -# application/vnd.openxmlformats-officedocument.presentationml.commentauthors+xml -# application/vnd.openxmlformats-officedocument.presentationml.comments+xml -# application/vnd.openxmlformats-officedocument.presentationml.handoutmaster+xml -# application/vnd.openxmlformats-officedocument.presentationml.notesmaster+xml -# application/vnd.openxmlformats-officedocument.presentationml.notesslide+xml -application/vnd.openxmlformats-officedocument.presentationml.presentation pptx -# application/vnd.openxmlformats-officedocument.presentationml.presentation.main+xml -# application/vnd.openxmlformats-officedocument.presentationml.presprops+xml -application/vnd.openxmlformats-officedocument.presentationml.slide sldx -# application/vnd.openxmlformats-officedocument.presentationml.slide+xml -# application/vnd.openxmlformats-officedocument.presentationml.slidelayout+xml -# application/vnd.openxmlformats-officedocument.presentationml.slidemaster+xml -application/vnd.openxmlformats-officedocument.presentationml.slideshow ppsx -# application/vnd.openxmlformats-officedocument.presentationml.slideshow.main+xml -# application/vnd.openxmlformats-officedocument.presentationml.slideupdateinfo+xml -# application/vnd.openxmlformats-officedocument.presentationml.tablestyles+xml -# application/vnd.openxmlformats-officedocument.presentationml.tags+xml -application/vnd.openxmlformats-officedocument.presentationml.template potx -# application/vnd.openxmlformats-officedocument.presentationml.template.main+xml -# application/vnd.openxmlformats-officedocument.presentationml.viewprops+xml -# application/vnd.openxmlformats-officedocument.spreadsheetml.calcchain+xml -# application/vnd.openxmlformats-officedocument.spreadsheetml.chartsheet+xml -# application/vnd.openxmlformats-officedocument.spreadsheetml.comments+xml -# application/vnd.openxmlformats-officedocument.spreadsheetml.connections+xml -# application/vnd.openxmlformats-officedocument.spreadsheetml.dialogsheet+xml -# application/vnd.openxmlformats-officedocument.spreadsheetml.externallink+xml -# application/vnd.openxmlformats-officedocument.spreadsheetml.pivotcachedefinition+xml -# application/vnd.openxmlformats-officedocument.spreadsheetml.pivotcacherecords+xml -# application/vnd.openxmlformats-officedocument.spreadsheetml.pivottable+xml -# application/vnd.openxmlformats-officedocument.spreadsheetml.querytable+xml -# application/vnd.openxmlformats-officedocument.spreadsheetml.revisionheaders+xml -# application/vnd.openxmlformats-officedocument.spreadsheetml.revisionlog+xml -# application/vnd.openxmlformats-officedocument.spreadsheetml.sharedstrings+xml -application/vnd.openxmlformats-officedocument.spreadsheetml.sheet xlsx -# application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml -# application/vnd.openxmlformats-officedocument.spreadsheetml.sheetmetadata+xml -# application/vnd.openxmlformats-officedocument.spreadsheetml.styles+xml -# application/vnd.openxmlformats-officedocument.spreadsheetml.table+xml -# application/vnd.openxmlformats-officedocument.spreadsheetml.tablesinglecells+xml -application/vnd.openxmlformats-officedocument.spreadsheetml.template xltx -# application/vnd.openxmlformats-officedocument.spreadsheetml.template.main+xml -# application/vnd.openxmlformats-officedocument.spreadsheetml.usernames+xml -# application/vnd.openxmlformats-officedocument.spreadsheetml.volatiledependencies+xml -# application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml -# application/vnd.openxmlformats-officedocument.theme+xml -# application/vnd.openxmlformats-officedocument.themeoverride+xml -# application/vnd.openxmlformats-officedocument.vmldrawing -# application/vnd.openxmlformats-officedocument.wordprocessingml.comments+xml -application/vnd.openxmlformats-officedocument.wordprocessingml.document docx -# application/vnd.openxmlformats-officedocument.wordprocessingml.document.glossary+xml -# application/vnd.openxmlformats-officedocument.wordprocessingml.document.main+xml -# application/vnd.openxmlformats-officedocument.wordprocessingml.endnotes+xml -# application/vnd.openxmlformats-officedocument.wordprocessingml.fonttable+xml -# application/vnd.openxmlformats-officedocument.wordprocessingml.footer+xml -# application/vnd.openxmlformats-officedocument.wordprocessingml.footnotes+xml -# application/vnd.openxmlformats-officedocument.wordprocessingml.numbering+xml -# application/vnd.openxmlformats-officedocument.wordprocessingml.settings+xml -# application/vnd.openxmlformats-officedocument.wordprocessingml.styles+xml -application/vnd.openxmlformats-officedocument.wordprocessingml.template dotx -# application/vnd.openxmlformats-officedocument.wordprocessingml.template.main+xml -# application/vnd.openxmlformats-officedocument.wordprocessingml.websettings+xml -# application/vnd.openxmlformats-package.core-properties+xml -# application/vnd.openxmlformats-package.digital-signature-xmlsignature+xml -# application/vnd.openxmlformats-package.relationships+xml -# application/vnd.quobject-quoxdocument -# application/vnd.osa.netdeploy -application/vnd.osgeo.mapguide.package mgp -# application/vnd.osgi.bundle -application/vnd.osgi.dp dp -application/vnd.osgi.subsystem esa -# application/vnd.otps.ct-kip+xml -application/vnd.palm pdb pqa oprc -# application/vnd.paos.xml -application/vnd.pawaafile paw -application/vnd.pg.format str -application/vnd.pg.osasli ei6 -# application/vnd.piaccess.application-licence -application/vnd.picsel efif -application/vnd.pmi.widget wg -# application/vnd.poc.group-advertisement+xml -application/vnd.pocketlearn plf -application/vnd.powerbuilder6 pbd -# application/vnd.powerbuilder6-s -# application/vnd.powerbuilder7 -# application/vnd.powerbuilder7-s -# application/vnd.powerbuilder75 -# application/vnd.powerbuilder75-s -# application/vnd.preminet -application/vnd.previewsystems.box box -application/vnd.proteus.magazine mgz -application/vnd.publishare-delta-tree qps -application/vnd.pvi.ptid1 ptid -# application/vnd.pwg-multiplexed -# application/vnd.pwg-xhtml-print+xml -# application/vnd.qualcomm.brew-app-res -application/vnd.quark.quarkxpress qxd qxt qwd qwt qxl qxb -# application/vnd.radisys.moml+xml -# application/vnd.radisys.msml+xml -# application/vnd.radisys.msml-audit+xml -# application/vnd.radisys.msml-audit-conf+xml -# application/vnd.radisys.msml-audit-conn+xml -# application/vnd.radisys.msml-audit-dialog+xml -# application/vnd.radisys.msml-audit-stream+xml -# application/vnd.radisys.msml-conf+xml -# application/vnd.radisys.msml-dialog+xml -# application/vnd.radisys.msml-dialog-base+xml -# application/vnd.radisys.msml-dialog-fax-detect+xml -# application/vnd.radisys.msml-dialog-fax-sendrecv+xml -# application/vnd.radisys.msml-dialog-group+xml -# application/vnd.radisys.msml-dialog-speech+xml -# application/vnd.radisys.msml-dialog-transform+xml -# application/vnd.rainstor.data -# application/vnd.rapid -application/vnd.realvnc.bed bed -application/vnd.recordare.musicxml mxl -application/vnd.recordare.musicxml+xml musicxml -# application/vnd.renlearn.rlprint -application/vnd.rig.cryptonote cryptonote -application/vnd.rim.cod cod -application/vnd.rn-realmedia rm -application/vnd.rn-realmedia-vbr rmvb -application/vnd.route66.link66+xml link66 -# application/vnd.rs-274x -# application/vnd.ruckus.download -# application/vnd.s3sms -application/vnd.sailingtracker.track st -# application/vnd.sbm.cid -# application/vnd.sbm.mid2 -# application/vnd.scribus -# application/vnd.sealed.3df -# application/vnd.sealed.csf -# application/vnd.sealed.doc -# application/vnd.sealed.eml -# application/vnd.sealed.mht -# application/vnd.sealed.net -# application/vnd.sealed.ppt -# application/vnd.sealed.tiff -# application/vnd.sealed.xls -# application/vnd.sealedmedia.softseal.html -# application/vnd.sealedmedia.softseal.pdf -application/vnd.seemail see -application/vnd.sema sema -application/vnd.semd semd -application/vnd.semf semf -application/vnd.shana.informed.formdata ifm -application/vnd.shana.informed.formtemplate itp -application/vnd.shana.informed.interchange iif -application/vnd.shana.informed.package ipk -application/vnd.simtech-mindmapper twd twds -application/vnd.smaf mmf -# application/vnd.smart.notebook -application/vnd.smart.teacher teacher -# application/vnd.software602.filler.form+xml -# application/vnd.software602.filler.form-xml-zip -application/vnd.solent.sdkm+xml sdkm sdkd -application/vnd.spotfire.dxp dxp -application/vnd.spotfire.sfs sfs -# application/vnd.sss-cod -# application/vnd.sss-dtf -# application/vnd.sss-ntf -application/vnd.stardivision.calc sdc -application/vnd.stardivision.draw sda -application/vnd.stardivision.impress sdd -application/vnd.stardivision.math smf -application/vnd.stardivision.writer sdw vor -application/vnd.stardivision.writer-global sgl -application/vnd.stepmania.package smzip -application/vnd.stepmania.stepchart sm -# application/vnd.street-stream -application/vnd.sun.xml.calc sxc -application/vnd.sun.xml.calc.template stc -application/vnd.sun.xml.draw sxd -application/vnd.sun.xml.draw.template std -application/vnd.sun.xml.impress sxi -application/vnd.sun.xml.impress.template sti -application/vnd.sun.xml.math sxm -application/vnd.sun.xml.writer sxw -application/vnd.sun.xml.writer.global sxg -application/vnd.sun.xml.writer.template stw -# application/vnd.sun.wadl+xml -application/vnd.sus-calendar sus susp -application/vnd.svd svd -# application/vnd.swiftview-ics -application/vnd.symbian.install sis sisx -application/vnd.syncml+xml xsm -application/vnd.syncml.dm+wbxml bdm -application/vnd.syncml.dm+xml xdm -# application/vnd.syncml.dm.notification -# application/vnd.syncml.ds.notification -application/vnd.tao.intent-module-archive tao -application/vnd.tcpdump.pcap pcap cap dmp -application/vnd.tmobile-livetv tmo -application/vnd.trid.tpt tpt -application/vnd.triscape.mxs mxs -application/vnd.trueapp tra -# application/vnd.truedoc -# application/vnd.ubisoft.webplayer -application/vnd.ufdl ufd ufdl -application/vnd.uiq.theme utz -application/vnd.umajin umj -application/vnd.unity unityweb -application/vnd.uoml+xml uoml -# application/vnd.uplanet.alert -# application/vnd.uplanet.alert-wbxml -# application/vnd.uplanet.bearer-choice -# application/vnd.uplanet.bearer-choice-wbxml -# application/vnd.uplanet.cacheop -# application/vnd.uplanet.cacheop-wbxml -# application/vnd.uplanet.channel -# application/vnd.uplanet.channel-wbxml -# application/vnd.uplanet.list -# application/vnd.uplanet.list-wbxml -# application/vnd.uplanet.listcmd -# application/vnd.uplanet.listcmd-wbxml -# application/vnd.uplanet.signal -application/vnd.vcx vcx -# application/vnd.vd-study -# application/vnd.vectorworks -# application/vnd.verimatrix.vcas -# application/vnd.vidsoft.vidconference -application/vnd.visio vsd vst vss vsw -application/vnd.visionary vis -# application/vnd.vividence.scriptfile -application/vnd.vsf vsf -# application/vnd.wap.sic -# application/vnd.wap.slc -application/vnd.wap.wbxml wbxml -application/vnd.wap.wmlc wmlc -application/vnd.wap.wmlscriptc wmlsc -application/vnd.webturbo wtb -# application/vnd.wfa.wsc -# application/vnd.wmc -# application/vnd.wmf.bootstrap -# application/vnd.wolfram.mathematica -# application/vnd.wolfram.mathematica.package -application/vnd.wolfram.player nbp -application/vnd.wordperfect wpd -application/vnd.wqd wqd -# application/vnd.wrq-hp3000-labelled -application/vnd.wt.stf stf -# application/vnd.wv.csp+wbxml -# application/vnd.wv.csp+xml -# application/vnd.wv.ssp+xml -application/vnd.xara xar -application/vnd.xfdl xfdl -# application/vnd.xfdl.webform -# application/vnd.xmi+xml -# application/vnd.xmpie.cpkg -# application/vnd.xmpie.dpkg -# application/vnd.xmpie.plan -# application/vnd.xmpie.ppkg -# application/vnd.xmpie.xlim -application/vnd.yamaha.hv-dic hvd -application/vnd.yamaha.hv-script hvs -application/vnd.yamaha.hv-voice hvp -application/vnd.yamaha.openscoreformat osf -application/vnd.yamaha.openscoreformat.osfpvg+xml osfpvg -# application/vnd.yamaha.remote-setup -application/vnd.yamaha.smaf-audio saf -application/vnd.yamaha.smaf-phrase spf -# application/vnd.yamaha.through-ngn -# application/vnd.yamaha.tunnel-udpencap -application/vnd.yellowriver-custom-menu cmp -application/vnd.zul zir zirz -application/vnd.zzazz.deck+xml zaz -application/voicexml+xml vxml -# application/vq-rtcpxr -# application/watcherinfo+xml -# application/whoispp-query -# application/whoispp-response -application/widget wgt -application/winhlp hlp -# application/wita -# application/wordperfect5.1 -application/wsdl+xml wsdl -application/wspolicy+xml wspolicy -application/x-7z-compressed 7z -application/x-abiword abw -application/x-ace-compressed ace -# application/x-amf -application/x-apple-diskimage dmg -application/x-authorware-bin aab x32 u32 vox -application/x-authorware-map aam -application/x-authorware-seg aas -application/x-bcpio bcpio -application/x-bittorrent torrent -application/x-blorb blb blorb -application/x-bzip bz -application/x-bzip2 bz2 boz -application/x-cbr cbr cba cbt cbz cb7 -application/x-cdlink vcd -application/x-cfs-compressed cfs -application/x-chat chat -application/x-chess-pgn pgn -application/x-conference nsc -# application/x-compress -application/x-cpio cpio -application/x-csh csh -application/x-debian-package deb udeb -application/x-dgc-compressed dgc -application/x-director dir dcr dxr cst cct cxt w3d fgd swa -application/x-doom wad -application/x-dtbncx+xml ncx -application/x-dtbook+xml dtb -application/x-dtbresource+xml res -application/x-dvi dvi -application/x-envoy evy -application/x-eva eva -application/x-font-bdf bdf -# application/x-font-dos -# application/x-font-framemaker -application/x-font-ghostscript gsf -# application/x-font-libgrx -application/x-font-linux-psf psf -application/x-font-otf otf -application/x-font-pcf pcf -application/x-font-snf snf -# application/x-font-speedo -# application/x-font-sunos-news -application/x-font-ttf ttf ttc -application/x-font-type1 pfa pfb pfm afm -application/font-woff woff -# application/x-font-vfont -application/x-freearc arc -application/x-futuresplash spl -application/x-gca-compressed gca -application/x-glulx ulx -application/x-gnumeric gnumeric -application/x-gramps-xml gramps -application/x-gtar gtar -# application/x-gzip -application/x-hdf hdf -application/x-install-instructions install -application/x-iso9660-image iso -application/x-java-jnlp-file jnlp -application/x-latex latex -application/x-lzh-compressed lzh lha -application/x-mie mie -application/x-mobipocket-ebook prc mobi -application/x-ms-application application -application/x-ms-shortcut lnk -application/x-ms-wmd wmd -application/x-ms-wmz wmz -application/x-ms-xbap xbap -application/x-msaccess mdb -application/x-msbinder obd -application/x-mscardfile crd -application/x-msclip clp -application/x-msdownload exe dll com bat msi -application/x-msmediaview mvb m13 m14 -application/x-msmetafile wmf wmz emf emz -application/x-msmoney mny -application/x-mspublisher pub -application/x-msschedule scd -application/x-msterminal trm -application/x-mswrite wri -application/x-netcdf nc cdf -application/x-nzb nzb -application/x-pkcs12 p12 pfx -application/x-pkcs7-certificates p7b spc -application/x-pkcs7-certreqresp p7r -application/x-rar-compressed rar -application/x-research-info-systems ris -application/x-sh sh -application/x-shar shar -application/x-shockwave-flash swf -application/x-silverlight-app xap -application/x-sql sql -application/x-stuffit sit -application/x-stuffitx sitx -application/x-subrip srt -application/x-sv4cpio sv4cpio -application/x-sv4crc sv4crc -application/x-t3vm-image t3 -application/x-tads gam -application/x-tar tar -application/x-tcl tcl -application/x-tex tex -application/x-tex-tfm tfm -application/x-texinfo texinfo texi -application/x-tgif obj -application/x-ustar ustar -application/x-wais-source src -application/x-x509-ca-cert der crt -application/x-xfig fig -application/x-xliff+xml xlf -application/x-xpinstall xpi -application/x-xz xz -application/x-zmachine z1 z2 z3 z4 z5 z6 z7 z8 -# application/x400-bp -application/xaml+xml xaml -# application/xcap-att+xml -# application/xcap-caps+xml -application/xcap-diff+xml xdf -# application/xcap-el+xml -# application/xcap-error+xml -# application/xcap-ns+xml -# application/xcon-conference-info-diff+xml -# application/xcon-conference-info+xml -application/xenc+xml xenc -application/xhtml+xml xhtml xht -# application/xhtml-voice+xml -application/xml xml xsl -application/xml-dtd dtd -# application/xml-external-parsed-entity -# application/xmpp+xml -application/xop+xml xop -application/xproc+xml xpl -application/xslt+xml xslt -application/xspf+xml xspf -application/xv+xml mxml xhvml xvml xvm -application/yang yang -application/yin+xml yin -application/zip zip -# audio/1d-interleaved-parityfec -# audio/32kadpcm -# audio/3gpp -# audio/3gpp2 -# audio/ac3 -audio/adpcm adp -# audio/amr -# audio/amr-wb -# audio/amr-wb+ -# audio/asc -# audio/atrac-advanced-lossless -# audio/atrac-x -# audio/atrac3 -audio/basic au snd -# audio/bv16 -# audio/bv32 -# audio/clearmode -# audio/cn -# audio/dat12 -# audio/dls -# audio/dsr-es201108 -# audio/dsr-es202050 -# audio/dsr-es202211 -# audio/dsr-es202212 -# audio/dv -# audio/dvi4 -# audio/eac3 -# audio/evrc -# audio/evrc-qcp -# audio/evrc0 -# audio/evrc1 -# audio/evrcb -# audio/evrcb0 -# audio/evrcb1 -# audio/evrcwb -# audio/evrcwb0 -# audio/evrcwb1 -# audio/example -# audio/fwdred -# audio/g719 -# audio/g722 -# audio/g7221 -# audio/g723 -# audio/g726-16 -# audio/g726-24 -# audio/g726-32 -# audio/g726-40 -# audio/g728 -# audio/g729 -# audio/g7291 -# audio/g729d -# audio/g729e -# audio/gsm -# audio/gsm-efr -# audio/gsm-hr-08 -# audio/ilbc -# audio/ip-mr_v2.5 -# audio/isac -# audio/l16 -# audio/l20 -# audio/l24 -# audio/l8 -# audio/lpc -audio/midi mid midi kar rmi -# audio/mobile-xmf -audio/mp4 mp4a -# audio/mp4a-latm -# audio/mpa -# audio/mpa-robust -audio/mpeg mpga mp2 mp2a mp3 m2a m3a -# audio/mpeg4-generic -# audio/musepack -audio/ogg oga ogg spx -# audio/opus -# audio/parityfec -# audio/pcma -# audio/pcma-wb -# audio/pcmu-wb -# audio/pcmu -# audio/prs.sid -# audio/qcelp -# audio/red -# audio/rtp-enc-aescm128 -# audio/rtp-midi -# audio/rtx -audio/s3m s3m -audio/silk sil -# audio/smv -# audio/smv0 -# audio/smv-qcp -# audio/sp-midi -# audio/speex -# audio/t140c -# audio/t38 -# audio/telephone-event -# audio/tone -# audio/uemclip -# audio/ulpfec -# audio/vdvi -# audio/vmr-wb -# audio/vnd.3gpp.iufp -# audio/vnd.4sb -# audio/vnd.audiokoz -# audio/vnd.celp -# audio/vnd.cisco.nse -# audio/vnd.cmles.radio-events -# audio/vnd.cns.anp1 -# audio/vnd.cns.inf1 -audio/vnd.dece.audio uva uvva -audio/vnd.digital-winds eol -# audio/vnd.dlna.adts -# audio/vnd.dolby.heaac.1 -# audio/vnd.dolby.heaac.2 -# audio/vnd.dolby.mlp -# audio/vnd.dolby.mps -# audio/vnd.dolby.pl2 -# audio/vnd.dolby.pl2x -# audio/vnd.dolby.pl2z -# audio/vnd.dolby.pulse.1 -audio/vnd.dra dra -audio/vnd.dts dts -audio/vnd.dts.hd dtshd -# audio/vnd.dvb.file -# audio/vnd.everad.plj -# audio/vnd.hns.audio -audio/vnd.lucent.voice lvp -audio/vnd.ms-playready.media.pya pya -# audio/vnd.nokia.mobile-xmf -# audio/vnd.nortel.vbk -audio/vnd.nuera.ecelp4800 ecelp4800 -audio/vnd.nuera.ecelp7470 ecelp7470 -audio/vnd.nuera.ecelp9600 ecelp9600 -# audio/vnd.octel.sbc -# audio/vnd.qcelp -# audio/vnd.rhetorex.32kadpcm -audio/vnd.rip rip -# audio/vnd.sealedmedia.softseal.mpeg -# audio/vnd.vmx.cvsd -# audio/vorbis -# audio/vorbis-config -audio/webm weba -audio/x-aac aac -audio/x-aiff aif aiff aifc -audio/x-caf caf -audio/x-flac flac -audio/x-matroska mka -audio/x-mpegurl m3u -audio/x-ms-wax wax -audio/x-ms-wma wma -audio/x-pn-realaudio ram ra -audio/x-pn-realaudio-plugin rmp -# audio/x-tta -audio/x-wav wav -audio/xm xm -chemical/x-cdx cdx -chemical/x-cif cif -chemical/x-cmdf cmdf -chemical/x-cml cml -chemical/x-csml csml -# chemical/x-pdb -chemical/x-xyz xyz -image/bmp bmp -image/cgm cgm -# image/example -# image/fits -image/g3fax g3 -image/gif gif -image/ief ief -# image/jp2 -image/jpeg jpeg jpg jpe -# image/jpm -# image/jpx -image/ktx ktx -# image/naplps -image/png png -image/prs.btif btif -# image/prs.pti -image/sgi sgi -image/svg+xml svg svgz -# image/t38 -image/tiff tiff tif -# image/tiff-fx -image/vnd.adobe.photoshop psd -# image/vnd.cns.inf2 -image/vnd.dece.graphic uvi uvvi uvg uvvg -image/vnd.dvb.subtitle sub -image/vnd.djvu djvu djv -image/vnd.dwg dwg -image/vnd.dxf dxf -image/vnd.fastbidsheet fbs -image/vnd.fpx fpx -image/vnd.fst fst -image/vnd.fujixerox.edmics-mmr mmr -image/vnd.fujixerox.edmics-rlc rlc -# image/vnd.globalgraphics.pgb -# image/vnd.microsoft.icon -# image/vnd.mix -image/vnd.ms-modi mdi -image/vnd.ms-photo wdp -image/vnd.net-fpx npx -# image/vnd.radiance -# image/vnd.sealed.png -# image/vnd.sealedmedia.softseal.gif -# image/vnd.sealedmedia.softseal.jpg -# image/vnd.svf -image/vnd.wap.wbmp wbmp -image/vnd.xiff xif -image/webp webp -image/x-3ds 3ds -image/x-cmu-raster ras -image/x-cmx cmx -image/x-freehand fh fhc fh4 fh5 fh7 -image/x-icon ico -image/x-mrsid-image sid -image/x-pcx pcx -image/x-pict pic pct -image/x-portable-anymap pnm -image/x-portable-bitmap pbm -image/x-portable-graymap pgm -image/x-portable-pixmap ppm -image/x-rgb rgb -image/x-tga tga -image/x-xbitmap xbm -image/x-xpixmap xpm -image/x-xwindowdump xwd -# message/cpim -# message/delivery-status -# message/disposition-notification -# message/example -# message/external-body -# message/feedback-report -# message/global -# message/global-delivery-status -# message/global-disposition-notification -# message/global-headers -# message/http -# message/imdn+xml -# message/news -# message/partial -message/rfc822 eml mime -# message/s-http -# message/sip -# message/sipfrag -# message/tracking-status -# message/vnd.si.simp -# model/example -model/iges igs iges -model/mesh msh mesh silo -model/vnd.collada+xml dae -model/vnd.dwf dwf -# model/vnd.flatland.3dml -model/vnd.gdl gdl -# model/vnd.gs-gdl -# model/vnd.gs.gdl -model/vnd.gtw gtw -# model/vnd.moml+xml -model/vnd.mts mts -# model/vnd.parasolid.transmit.binary -# model/vnd.parasolid.transmit.text -model/vnd.vtu vtu -model/vrml wrl vrml -model/x3d+binary x3db x3dbz -model/x3d+vrml x3dv x3dvz -model/x3d+xml x3d x3dz -# multipart/alternative -# multipart/appledouble -# multipart/byteranges -# multipart/digest -# multipart/encrypted -# multipart/example -# multipart/form-data -# multipart/header-set -# multipart/mixed -# multipart/parallel -# multipart/related -# multipart/report -# multipart/signed -# multipart/voice-message -# text/1d-interleaved-parityfec -text/cache-manifest appcache -text/calendar ics ifb -text/css css -text/csv csv -# text/directory -# text/dns -# text/ecmascript -# text/enriched -# text/example -# text/fwdred -text/html html htm -# text/javascript -text/n3 n3 -# text/parityfec -text/plain txt text conf def list log in -# text/prs.fallenstein.rst -text/prs.lines.tag dsc -# text/vnd.radisys.msml-basic-layout -# text/red -# text/rfc822-headers -text/richtext rtx -# text/rtf -# text/rtp-enc-aescm128 -# text/rtx -text/sgml sgml sgm -# text/t140 -text/tab-separated-values tsv -text/troff t tr roff man me ms -text/turtle ttl -# text/ulpfec -text/uri-list uri uris urls -text/vcard vcard -# text/vnd.abc -text/vnd.curl curl -text/vnd.curl.dcurl dcurl -text/vnd.curl.scurl scurl -text/vnd.curl.mcurl mcurl -# text/vnd.dmclientscript -text/vnd.dvb.subtitle sub -# text/vnd.esmertec.theme-descriptor -text/vnd.fly fly -text/vnd.fmi.flexstor flx -text/vnd.graphviz gv -text/vnd.in3d.3dml 3dml -text/vnd.in3d.spot spot -# text/vnd.iptc.newsml -# text/vnd.iptc.nitf -# text/vnd.latex-z -# text/vnd.motorola.reflex -# text/vnd.ms-mediapackage -# text/vnd.net2phone.commcenter.command -# text/vnd.si.uricatalogue -text/vnd.sun.j2me.app-descriptor jad -# text/vnd.trolltech.linguist -# text/vnd.wap.si -# text/vnd.wap.sl -text/vnd.wap.wml wml -text/vnd.wap.wmlscript wmls -text/x-asm s asm -text/x-c c cc cxx cpp h hh dic -text/x-fortran f for f77 f90 -text/x-java-source java -text/x-opml opml -text/x-pascal p pas -text/x-nfo nfo -text/x-setext etx -text/x-sfv sfv -text/x-uuencode uu -text/x-vcalendar vcs -text/x-vcard vcf -# text/xml -# text/xml-external-parsed-entity -# video/1d-interleaved-parityfec -video/3gpp 3gp -# video/3gpp-tt -video/3gpp2 3g2 -# video/bmpeg -# video/bt656 -# video/celb -# video/dv -# video/example -video/h261 h261 -video/h263 h263 -# video/h263-1998 -# video/h263-2000 -video/h264 h264 -# video/h264-rcdo -# video/h264-svc -video/jpeg jpgv -# video/jpeg2000 -video/jpm jpm jpgm -video/mj2 mj2 mjp2 -# video/mp1s -# video/mp2p -# video/mp2t -video/mp4 mp4 mp4v mpg4 -# video/mp4v-es -video/mpeg mpeg mpg mpe m1v m2v -# video/mpeg4-generic -# video/mpv -# video/nv -video/ogg ogv -# video/parityfec -# video/pointer -video/quicktime qt mov -# video/raw -# video/rtp-enc-aescm128 -# video/rtx -# video/smpte292m -# video/ulpfec -# video/vc1 -# video/vnd.cctv -video/vnd.dece.hd uvh uvvh -video/vnd.dece.mobile uvm uvvm -# video/vnd.dece.mp4 -video/vnd.dece.pd uvp uvvp -video/vnd.dece.sd uvs uvvs -video/vnd.dece.video uvv uvvv -# video/vnd.directv.mpeg -# video/vnd.directv.mpeg-tts -# video/vnd.dlna.mpeg-tts -video/vnd.dvb.file dvb -video/vnd.fvt fvt -# video/vnd.hns.video -# video/vnd.iptvforum.1dparityfec-1010 -# video/vnd.iptvforum.1dparityfec-2005 -# video/vnd.iptvforum.2dparityfec-1010 -# video/vnd.iptvforum.2dparityfec-2005 -# video/vnd.iptvforum.ttsavc -# video/vnd.iptvforum.ttsmpeg2 -# video/vnd.motorola.video -# video/vnd.motorola.videop -video/vnd.mpegurl mxu m4u -video/vnd.ms-playready.media.pyv pyv -# video/vnd.nokia.interleaved-multimedia -# video/vnd.nokia.videovoip -# video/vnd.objectvideo -# video/vnd.sealed.mpeg1 -# video/vnd.sealed.mpeg4 -# video/vnd.sealed.swf -# video/vnd.sealedmedia.softseal.mov -video/vnd.uvvu.mp4 uvu uvvu -video/vnd.vivo viv -video/webm webm -video/x-f4v f4v -video/x-fli fli -video/x-flv flv -video/x-m4v m4v -video/x-matroska mkv mk3d mks -video/x-mng mng -video/x-ms-asf asf asx -video/x-ms-vob vob -video/x-ms-wm wm -video/x-ms-wmv wmv -video/x-ms-wmx wmx -video/x-ms-wvx wvx -video/x-msvideo avi -video/x-sgi-movie movie -video/x-smv smv -x-conference/x-cooltalk ice diff --git a/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/mime/types/node.types b/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/mime/types/node.types deleted file mode 100644 index 55b2cf7..0000000 --- a/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/mime/types/node.types +++ /dev/null @@ -1,77 +0,0 @@ -# What: WebVTT -# Why: To allow formats intended for marking up external text track resources. -# http://dev.w3.org/html5/webvtt/ -# Added by: niftylettuce -text/vtt vtt - -# What: Google Chrome Extension -# Why: To allow apps to (work) be served with the right content type header. -# http://codereview.chromium.org/2830017 -# Added by: niftylettuce -application/x-chrome-extension crx - -# What: HTC support -# Why: To properly render .htc files such as CSS3PIE -# Added by: niftylettuce -text/x-component htc - -# What: HTML5 application cache manifes ('.manifest' extension) -# Why: De-facto standard. Required by Mozilla browser when serving HTML5 apps -# per https://developer.mozilla.org/en/offline_resources_in_firefox -# Added by: louisremi -text/cache-manifest manifest - -# What: node binary buffer format -# Why: semi-standard extension w/in the node community -# Added by: tootallnate -application/octet-stream buffer - -# What: The "protected" MP-4 formats used by iTunes. -# Why: Required for streaming music to browsers (?) -# Added by: broofa -application/mp4 m4p -audio/mp4 m4a - -# What: Video format, Part of RFC1890 -# Why: See https://github.com/bentomas/node-mime/pull/6 -# Added by: mjrusso -video/MP2T ts - -# What: EventSource mime type -# Why: mime type of Server-Sent Events stream -# http://www.w3.org/TR/eventsource/#text-event-stream -# Added by: francois2metz -text/event-stream event-stream - -# What: Mozilla App manifest mime type -# Why: https://developer.mozilla.org/en/Apps/Manifest#Serving_manifests -# Added by: ednapiranha -application/x-web-app-manifest+json webapp - -# What: Lua file types -# Why: Googling around shows de-facto consensus on these -# Added by: creationix (Issue #45) -text/x-lua lua -application/x-lua-bytecode luac - -# What: Markdown files, as per http://daringfireball.net/projects/markdown/syntax -# Why: http://stackoverflow.com/questions/10701983/what-is-the-mime-type-for-markdown -# Added by: avoidwork -text/x-markdown markdown md mkd - -# What: ini files -# Why: because they're just text files -# Added by: Matthew Kastor -text/plain ini - -# What: DASH Adaptive Streaming manifest -# Why: https://developer.mozilla.org/en-US/docs/DASH_Adaptive_Streaming_for_HTML_5_Video -# Added by: eelcocramer -application/dash+xml mdp - -# What: OpenType font files - http://www.microsoft.com/typography/otspec/ -# Why: Browsers usually ignore the font MIME types and sniff the content, -# but Chrome, shows a warning if OpenType fonts aren't served with -# the `font/opentype` MIME type: http://i.imgur.com/8c5RN8M.png. -# Added by: alrra -font/opentype otf diff --git a/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/node-uuid/LICENSE.md b/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/node-uuid/LICENSE.md index f039427..652609b 100644 --- a/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/node-uuid/LICENSE.md +++ b/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/node-uuid/LICENSE.md @@ -1,2 +1,21 @@ -Copyright (c) 2010-2012 Robert Kieffer -MIT License - http://opensource.org/licenses/mit-license.php +The MIT License (MIT) + +Copyright (c) 2010-2012 Robert Kieffer + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/node-uuid/README.md b/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/node-uuid/README.md index e436a89..b7d04c9 100644 --- a/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/node-uuid/README.md +++ b/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/node-uuid/README.md @@ -10,6 +10,7 @@ Features: * Cryptographically strong random # generation on supporting platforms * 1.1K minified and gzip'ed (Want something smaller? Check this [crazy shit](https://gist.github.com/982883) out! ) * [Annotated source code](http://broofa.github.com/node-uuid/docs/uuid.html) +* Comes with a Command Line Interface for generating uuids on the command line ## Getting Started @@ -160,13 +161,48 @@ uuid() has become uuid.v4(), and the `format` argument is now implicit in the `b The class of container created when generating binary uuid data if no buffer argument is specified. This is expected to go away, with no replacement API. +## Command Line Interface + +To use the executable, it's probably best to install this library globally. + +`npm install -g node-uuid` + +Usage: + +``` +USAGE: uuid [version] [options] + + +options: + +--help Display this message and exit +``` + +`version` must be an RFC4122 version that is supported by this library, which is currently version 1 and version 4 (denoted by "v1" and "v4", respectively). `version` defaults to version 4 when not supplied. + +### Examples + +``` +> uuid +3a91f950-dec8-4688-ba14-5b7bbfc7a563 +``` + +``` +> uuid v1 +9d0b43e0-7696-11e3-964b-250efa37a98e +``` + +``` +> uuid v4 +6790ac7c-24ac-4f98-8464-42f6d98a53ae +``` + ## Testing In node.js ``` -> cd test -> node test.js +npm test ``` In Browser diff --git a/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/node-uuid/bin/uuid b/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/node-uuid/bin/uuid new file mode 100755 index 0000000..f732e99 --- /dev/null +++ b/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/node-uuid/bin/uuid @@ -0,0 +1,26 @@ +#!/usr/bin/env node + +var path = require('path'); +var uuid = require(path.join(__dirname, '..')); + +var arg = process.argv[2]; + +if ('--help' === arg) { + console.log('\n USAGE: uuid [version] [options]\n\n'); + console.log(' options:\n'); + console.log(' --help Display this message and exit\n'); + process.exit(0); +} + +if (null == arg) { + console.log(uuid()); + process.exit(0); +} + +if ('v1' !== arg && 'v4' !== arg) { + console.error('Version must be RFC4122 version 1 or version 4, denoted as "v1" or "v4"'); + process.exit(1); +} + +console.log(uuid[arg]()); +process.exit(0); diff --git a/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/node-uuid/bower.json b/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/node-uuid/bower.json new file mode 100644 index 0000000..1656dc8 --- /dev/null +++ b/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/node-uuid/bower.json @@ -0,0 +1,23 @@ +{ + "name": "node-uuid", + "version": "1.4.3", + "homepage": "https://github.com/broofa/node-uuid", + "authors": [ + "Robert Kieffer " + ], + "description": "Rigorous implementation of RFC4122 (v1 and v4) UUIDs.", + "main": "uuid.js", + "keywords": [ + "uuid", + "gid", + "rfc4122" + ], + "license": "MIT", + "ignore": [ + "**/.*", + "node_modules", + "bower_components", + "test", + "tests" + ] +} diff --git a/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/node-uuid/component.json b/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/node-uuid/component.json index ace2134..149f84b 100644 --- a/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/node-uuid/component.json +++ b/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/node-uuid/component.json @@ -2,7 +2,7 @@ "name": "node-uuid", "repo": "broofa/node-uuid", "description": "Rigorous implementation of RFC4122 (v1 and v4) UUIDs.", - "version": "1.4.0", + "version": "1.4.3", "author": "Robert Kieffer ", "contributors": [ {"name": "Christoph Tavan ", "github": "https://github.com/ctavan"} @@ -15,4 +15,4 @@ "uuid.js" ], "license": "MIT" -} \ No newline at end of file +} diff --git a/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/node-uuid/package.json b/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/node-uuid/package.json index b6473e9..a35d253 100644 --- a/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/node-uuid/package.json +++ b/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/node-uuid/package.json @@ -17,25 +17,34 @@ "email": "dev@tavan.de" } ], + "bin": { + "uuid": "./bin/uuid" + }, + "scripts": { + "test": "node test/test.js" + }, "lib": ".", "main": "./uuid.js", "repository": { "type": "git", "url": "https://github.com/broofa/node-uuid.git" }, - "version": "1.4.1", - "readme": "# node-uuid\n\nSimple, fast generation of [RFC4122](http://www.ietf.org/rfc/rfc4122.txt) UUIDS.\n\nFeatures:\n\n* Generate RFC4122 version 1 or version 4 UUIDs\n* Runs in node.js and all browsers.\n* Registered as a [ComponentJS](https://github.com/component/component) [component](https://github.com/component/component/wiki/Components) ('broofa/node-uuid').\n* Cryptographically strong random # generation on supporting platforms\n* 1.1K minified and gzip'ed (Want something smaller? Check this [crazy shit](https://gist.github.com/982883) out! )\n* [Annotated source code](http://broofa.github.com/node-uuid/docs/uuid.html)\n\n## Getting Started\n\nInstall it in your browser:\n\n```html\n\n```\n\nOr in node.js:\n\n```\nnpm install node-uuid\n```\n\n```javascript\nvar uuid = require('node-uuid');\n```\n\nThen create some ids ...\n\n```javascript\n// Generate a v1 (time-based) id\nuuid.v1(); // -> '6c84fb90-12c4-11e1-840d-7b25c5ee775a'\n\n// Generate a v4 (random) id\nuuid.v4(); // -> '110ec58a-a0f2-4ac4-8393-c866d813b8d1'\n```\n\n## API\n\n### uuid.v1([`options` [, `buffer` [, `offset`]]])\n\nGenerate and return a RFC4122 v1 (timestamp-based) UUID.\n\n* `options` - (Object) Optional uuid state to apply. Properties may include:\n\n * `node` - (Array) Node id as Array of 6 bytes (per 4.1.6). Default: Randomly generated ID. See note 1.\n * `clockseq` - (Number between 0 - 0x3fff) RFC clock sequence. Default: An internally maintained clockseq is used.\n * `msecs` - (Number | Date) Time in milliseconds since unix Epoch. Default: The current time is used.\n * `nsecs` - (Number between 0-9999) additional time, in 100-nanosecond units. Ignored if `msecs` is unspecified. Default: internal uuid counter is used, as per 4.2.1.2.\n\n* `buffer` - (Array | Buffer) Array or buffer where UUID bytes are to be written.\n* `offset` - (Number) Starting index in `buffer` at which to begin writing.\n\nReturns `buffer`, if specified, otherwise the string form of the UUID\n\nNotes:\n\n1. The randomly generated node id is only guaranteed to stay constant for the lifetime of the current JS runtime. (Future versions of this module may use persistent storage mechanisms to extend this guarantee.)\n\nExample: Generate string UUID with fully-specified options\n\n```javascript\nuuid.v1({\n node: [0x01, 0x23, 0x45, 0x67, 0x89, 0xab],\n clockseq: 0x1234,\n msecs: new Date('2011-11-01').getTime(),\n nsecs: 5678\n}); // -> \"710b962e-041c-11e1-9234-0123456789ab\"\n```\n\nExample: In-place generation of two binary IDs\n\n```javascript\n// Generate two ids in an array\nvar arr = new Array(32); // -> []\nuuid.v1(null, arr, 0); // -> [02 a2 ce 90 14 32 11 e1 85 58 0b 48 8e 4f c1 15]\nuuid.v1(null, arr, 16); // -> [02 a2 ce 90 14 32 11 e1 85 58 0b 48 8e 4f c1 15 02 a3 1c b0 14 32 11 e1 85 58 0b 48 8e 4f c1 15]\n\n// Optionally use uuid.unparse() to get stringify the ids\nuuid.unparse(buffer); // -> '02a2ce90-1432-11e1-8558-0b488e4fc115'\nuuid.unparse(buffer, 16) // -> '02a31cb0-1432-11e1-8558-0b488e4fc115'\n```\n\n### uuid.v4([`options` [, `buffer` [, `offset`]]])\n\nGenerate and return a RFC4122 v4 UUID.\n\n* `options` - (Object) Optional uuid state to apply. Properties may include:\n\n * `random` - (Number[16]) Array of 16 numbers (0-255) to use in place of randomly generated values\n * `rng` - (Function) Random # generator to use. Set to one of the built-in generators - `uuid.mathRNG` (all platforms), `uuid.nodeRNG` (node.js only), `uuid.whatwgRNG` (WebKit only) - or a custom function that returns an array[16] of byte values.\n\n* `buffer` - (Array | Buffer) Array or buffer where UUID bytes are to be written.\n* `offset` - (Number) Starting index in `buffer` at which to begin writing.\n\nReturns `buffer`, if specified, otherwise the string form of the UUID\n\nExample: Generate string UUID with fully-specified options\n\n```javascript\nuuid.v4({\n random: [\n 0x10, 0x91, 0x56, 0xbe, 0xc4, 0xfb, 0xc1, 0xea,\n 0x71, 0xb4, 0xef, 0xe1, 0x67, 0x1c, 0x58, 0x36\n ]\n});\n// -> \"109156be-c4fb-41ea-b1b4-efe1671c5836\"\n```\n\nExample: Generate two IDs in a single buffer\n\n```javascript\nvar buffer = new Array(32); // (or 'new Buffer' in node.js)\nuuid.v4(null, buffer, 0);\nuuid.v4(null, buffer, 16);\n```\n\n### uuid.parse(id[, buffer[, offset]])\n### uuid.unparse(buffer[, offset])\n\nParse and unparse UUIDs\n\n * `id` - (String) UUID(-like) string\n * `buffer` - (Array | Buffer) Array or buffer where UUID bytes are to be written. Default: A new Array or Buffer is used\n * `offset` - (Number) Starting index in `buffer` at which to begin writing. Default: 0\n\nExample parsing and unparsing a UUID string\n\n```javascript\nvar bytes = uuid.parse('797ff043-11eb-11e1-80d6-510998755d10'); // -> \nvar string = uuid.unparse(bytes); // -> '797ff043-11eb-11e1-80d6-510998755d10'\n```\n\n### uuid.noConflict()\n\n(Browsers only) Set `uuid` property back to it's previous value.\n\nReturns the node-uuid object.\n\nExample:\n\n```javascript\nvar myUuid = uuid.noConflict();\nmyUuid.v1(); // -> '6c84fb90-12c4-11e1-840d-7b25c5ee775a'\n```\n\n## Deprecated APIs\n\nSupport for the following v1.2 APIs is available in v1.3, but is deprecated and will be removed in the next major version.\n\n### uuid([format [, buffer [, offset]]])\n\nuuid() has become uuid.v4(), and the `format` argument is now implicit in the `buffer` argument. (i.e. if you specify a buffer, the format is assumed to be binary).\n\n### uuid.BufferClass\n\nThe class of container created when generating binary uuid data if no buffer argument is specified. This is expected to go away, with no replacement API.\n\n## Testing\n\nIn node.js\n\n```\n> cd test\n> node test.js\n```\n\nIn Browser\n\n```\nopen test/test.html\n```\n\n### Benchmarking\n\nRequires node.js\n\n```\nnpm install uuid uuid-js\nnode benchmark/benchmark.js\n```\n\nFor a more complete discussion of node-uuid performance, please see the `benchmark/README.md` file, and the [benchmark wiki](https://github.com/broofa/node-uuid/wiki/Benchmark)\n\nFor browser performance [checkout the JSPerf tests](http://jsperf.com/node-uuid-performance).\n\n## Release notes\n\n### 1.4.0\n\n* Improved module context detection\n* Removed public RNG functions\n\n### 1.3.2\n\n* Improve tests and handling of v1() options (Issue #24)\n* Expose RNG option to allow for perf testing with different generators\n\n### 1.3.0\n\n* Support for version 1 ids, thanks to [@ctavan](https://github.com/ctavan)!\n* Support for node.js crypto API\n* De-emphasizing performance in favor of a) cryptographic quality PRNGs where available and b) more manageable code\n", - "readmeFilename": "README.md", + "version": "1.4.3", + "licenses": [ + { + "type": "MIT", + "url": "https://raw.github.com/broofa/node-uuid/master/LICENSE.md" + } + ], + "gitHead": "886463c660a095dfebfa69603921a8d156fdb12c", "bugs": { "url": "https://github.com/broofa/node-uuid/issues" }, - "_id": "node-uuid@1.4.1", - "dist": { - "shasum": "39aef510e5889a3dca9c895b506c73aae1bac048", - "tarball": "http://registry.npmjs.org/node-uuid/-/node-uuid-1.4.1.tgz" - }, + "homepage": "https://github.com/broofa/node-uuid", + "_id": "node-uuid@1.4.3", + "_shasum": "319bb7a56e7cb63f00b5c0cd7851cd4b4ddf1df9", "_from": "node-uuid@~1.4.0", - "_npmVersion": "1.3.6", + "_npmVersion": "1.4.28", "_npmUser": { "name": "broofa", "email": "robert@broofa.com" @@ -46,9 +55,11 @@ "email": "robert@broofa.com" } ], + "dist": { + "shasum": "319bb7a56e7cb63f00b5c0cd7851cd4b4ddf1df9", + "tarball": "http://registry.npmjs.org/node-uuid/-/node-uuid-1.4.3.tgz" + }, "directories": {}, - "_shasum": "39aef510e5889a3dca9c895b506c73aae1bac048", - "_resolved": "https://registry.npmjs.org/node-uuid/-/node-uuid-1.4.1.tgz", - "homepage": "https://github.com/broofa/node-uuid", - "scripts": {} + "_resolved": "https://registry.npmjs.org/node-uuid/-/node-uuid-1.4.3.tgz", + "readme": "ERROR: No README data found!" } diff --git a/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/node-uuid/uuid.js b/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/node-uuid/uuid.js index 2fac6dc..0a61769 100644 --- a/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/node-uuid/uuid.js +++ b/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/node-uuid/uuid.js @@ -14,9 +14,9 @@ // Node.js crypto-based RNG - http://nodejs.org/docs/v0.6.2/api/crypto.html // // Moderately fast, high quality - if (typeof(require) == 'function') { + if (typeof(_global.require) == 'function') { try { - var _rb = require('crypto').randomBytes; + var _rb = _global.require('crypto').randomBytes; _rng = _rb && function() {return _rb(16);}; } catch(e) {} } @@ -49,7 +49,7 @@ } // Buffer class to use - var BufferClass = typeof(Buffer) == 'function' ? Buffer : Array; + var BufferClass = typeof(_global.Buffer) == 'function' ? _global.Buffer : Array; // Maps for number <-> hex string conversion var _byteToHex = []; @@ -224,12 +224,14 @@ uuid.unparse = unparse; uuid.BufferClass = BufferClass; - if (typeof define === 'function' && define.amd) { - // Publish as AMD module - define(function() {return uuid;}); - } else if (typeof(module) != 'undefined' && module.exports) { + if (typeof(module) != 'undefined' && module.exports) { // Publish as node.js module module.exports = uuid; + } else if (typeof define === 'function' && define.amd) { + // Publish as AMD module + define(function() {return uuid;}); + + } else { // Publish as global (in browsers) var _previousRoot = _global.uuid; diff --git a/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/oauth-sign/index.js b/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/oauth-sign/index.js index e35bfa6..bdfd14e 100644 --- a/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/oauth-sign/index.js +++ b/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/oauth-sign/index.js @@ -6,6 +6,10 @@ function sha1 (key, body) { return crypto.createHmac('sha1', key).update(body).digest('base64') } +function rsa (key, body) { + return crypto.createSign("RSA-SHA1").update(body).sign(key, 'base64'); +} + function rfc3986 (str) { return encodeURIComponent(str) .replace(/!/g,'%21') @@ -16,28 +20,97 @@ function rfc3986 (str) { ; } -function hmacsign (httpMethod, base_uri, params, consumer_secret, token_secret) { +// Maps object to bi-dimensional array +// Converts { foo: 'A', bar: [ 'b', 'B' ]} to +// [ ['foo', 'A'], ['bar', 'b'], ['bar', 'B'] ] +function map (obj) { + var key, val, arr = [] + for (key in obj) { + val = obj[key] + if (Array.isArray(val)) + for (var i = 0; i < val.length; i++) + arr.push([key, val[i]]) + else + arr.push([key, val]) + } + return arr +} + +// Compare function for sort +function compare (a, b) { + return a > b ? 1 : a < b ? -1 : 0 +} + +function generateBase (httpMethod, base_uri, params) { // adapted from https://dev.twitter.com/docs/auth/oauth and // https://dev.twitter.com/docs/auth/creating-signature - var querystring = Object.keys(params).sort().map(function(key){ - // big WTF here with the escape + encoding but it's what twitter wants - return escape(rfc3986(key)) + "%3D" + escape(rfc3986(params[key])) - }).join('%26') + // Parameter normalization + // http://tools.ietf.org/html/rfc5849#section-3.4.1.3.2 + var normalized = map(params) + // 1. First, the name and value of each parameter are encoded + .map(function (p) { + return [ rfc3986(p[0]), rfc3986(p[1] || '') ] + }) + // 2. The parameters are sorted by name, using ascending byte value + // ordering. If two or more parameters share the same name, they + // are sorted by their value. + .sort(function (a, b) { + return compare(a[0], b[0]) || compare(a[1], b[1]) + }) + // 3. The name of each parameter is concatenated to its corresponding + // value using an "=" character (ASCII code 61) as a separator, even + // if the value is empty. + .map(function (p) { return p.join('=') }) + // 4. The sorted name/value pairs are concatenated together into a + // single string by using an "&" character (ASCII code 38) as + // separator. + .join('&') var base = [ - httpMethod ? httpMethod.toUpperCase() : 'GET', + rfc3986(httpMethod ? httpMethod.toUpperCase() : 'GET'), rfc3986(base_uri), - querystring + rfc3986(normalized) ].join('&') + return base +} + +function hmacsign (httpMethod, base_uri, params, consumer_secret, token_secret) { + var base = generateBase(httpMethod, base_uri, params) var key = [ - consumer_secret, + consumer_secret || '', token_secret || '' ].map(rfc3986).join('&') return sha1(key, base) } +function rsasign (httpMethod, base_uri, params, private_key, token_secret) { + var base = generateBase(httpMethod, base_uri, params) + var key = private_key || '' + + return rsa(key, base) +} + +function sign (signMethod, httpMethod, base_uri, params, consumer_secret, token_secret) { + var method + + switch (signMethod) { + case 'RSA-SHA1': + method = rsasign + break + case 'HMAC-SHA1': + method = hmacsign + break + default: + throw new Error("Signature method not supported: " + signMethod) + } + + return method.apply(null, [].slice.call(arguments, 1)) +} + exports.hmacsign = hmacsign +exports.rsasign = rsasign +exports.sign = sign exports.rfc3986 = rfc3986 diff --git a/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/oauth-sign/package.json b/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/oauth-sign/package.json index 8cbd8ed..ff23ee4 100644 --- a/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/oauth-sign/package.json +++ b/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/oauth-sign/package.json @@ -6,7 +6,7 @@ }, "name": "oauth-sign", "description": "OAuth 1 signing. Formerly a vendor lib in mikeal/request, now a standalone module.", - "version": "0.3.0", + "version": "0.5.0", "repository": { "url": "https://github.com/mikeal/oauth-sign" }, @@ -20,15 +20,15 @@ "scripts": { "test": "node test.js" }, - "readme": "oauth-sign\n==========\n\nOAuth 1 signing. Formerly a vendor lib in mikeal/request, now a standalone module. \n", - "readmeFilename": "README.md", - "_id": "oauth-sign@0.3.0", - "dist": { - "shasum": "cb540f93bb2b22a7d5941691a288d60e8ea9386e", - "tarball": "http://registry.npmjs.org/oauth-sign/-/oauth-sign-0.3.0.tgz" + "gitHead": "6fea86c2d4a38e1b3780ad0cc56f00196e5213c1", + "bugs": { + "url": "https://github.com/mikeal/oauth-sign/issues" }, - "_from": "oauth-sign@~0.3.0", - "_npmVersion": "1.2.14", + "homepage": "https://github.com/mikeal/oauth-sign", + "_id": "oauth-sign@0.5.0", + "_shasum": "d767f5169325620eab2e087ef0c472e773db6461", + "_from": "oauth-sign@~0.5.0", + "_npmVersion": "2.0.0", "_npmUser": { "name": "mikeal", "email": "mikeal.rogers@gmail.com" @@ -39,11 +39,10 @@ "email": "mikeal.rogers@gmail.com" } ], - "directories": {}, - "_shasum": "cb540f93bb2b22a7d5941691a288d60e8ea9386e", - "_resolved": "https://registry.npmjs.org/oauth-sign/-/oauth-sign-0.3.0.tgz", - "bugs": { - "url": "https://github.com/mikeal/oauth-sign/issues" + "dist": { + "shasum": "d767f5169325620eab2e087ef0c472e773db6461", + "tarball": "http://registry.npmjs.org/oauth-sign/-/oauth-sign-0.5.0.tgz" }, - "homepage": "https://github.com/mikeal/oauth-sign" + "directories": {}, + "_resolved": "https://registry.npmjs.org/oauth-sign/-/oauth-sign-0.5.0.tgz" } diff --git a/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/oauth-sign/test.js b/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/oauth-sign/test.js index 46955ff..b7a4c80 100644 --- a/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/oauth-sign/test.js +++ b/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/oauth-sign/test.js @@ -46,4 +46,18 @@ console.log(upsign) console.log('yOahq5m0YjDDjfjxHaXEsW9D+X0=') assert.equal(upsign, 'yOahq5m0YjDDjfjxHaXEsW9D+X0=') +// example in rfc5849 +var params = qs.parse('b5=%3D%253D&a3=a&c%40=&a2=r%20b' + '&' + 'c2&a3=2+q') +params.oauth_consumer_key = '9djdj82h48djs9d2' +params.oauth_token = 'kkk9d7dh3k39sjv7' +params.oauth_nonce = '7d8f3e4a' +params.oauth_signature_method = 'HMAC-SHA1' +params.oauth_timestamp = '137131201' + +var rfc5849sign = hmacsign('POST', 'http://example.com/request', + params, "j49sk3j29djd", "dh893hdasih9") + +console.log(rfc5849sign) +console.log('r6/TJjbCOr97/+UU0NsvSne7s5g=') +assert.equal(rfc5849sign, 'r6/TJjbCOr97/+UU0NsvSne7s5g=') diff --git a/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/qs/.gitmodules b/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/qs/.gitmodules deleted file mode 100644 index 49e31da..0000000 --- a/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/qs/.gitmodules +++ /dev/null @@ -1,6 +0,0 @@ -[submodule "support/expresso"] - path = support/expresso - url = git://github.com/visionmedia/expresso.git -[submodule "support/should"] - path = support/should - url = git://github.com/visionmedia/should.js.git diff --git a/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/qs/.jshintignore b/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/qs/.jshintignore new file mode 100644 index 0000000..3c3629e --- /dev/null +++ b/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/qs/.jshintignore @@ -0,0 +1 @@ +node_modules diff --git a/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/qs/.jshintrc b/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/qs/.jshintrc new file mode 100644 index 0000000..997b3f7 --- /dev/null +++ b/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/qs/.jshintrc @@ -0,0 +1,10 @@ +{ + "node": true, + + "curly": true, + "latedef": true, + "quotmark": true, + "undef": true, + "unused": true, + "trailing": true +} diff --git a/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/qs/.npmignore b/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/qs/.npmignore index e85ce2a..7e1574d 100644 --- a/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/qs/.npmignore +++ b/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/qs/.npmignore @@ -1,7 +1,18 @@ -test -.travis.yml -benchmark.js -component.json -examples.js -History.md -Makefile +.idea +*.iml +npm-debug.log +dump.rdb +node_modules +results.tap +results.xml +npm-shrinkwrap.json +config.json +.DS_Store +*/.DS_Store +*/*/.DS_Store +._* +*/._* +*/*/._* +coverage.* +lib-cov +complexity.md diff --git a/node_modules/cookie-session/node_modules/cookies/.travis.yml b/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/qs/.travis.yml similarity index 61% rename from node_modules/cookie-session/node_modules/cookies/.travis.yml rename to node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/qs/.travis.yml index 61fec9a..c891dd0 100644 --- a/node_modules/cookie-session/node_modules/cookies/.travis.yml +++ b/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/qs/.travis.yml @@ -1,4 +1,4 @@ language: node_js + node_js: - - 0.10 - - 0.8 + - 0.10 \ No newline at end of file diff --git a/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/qs/CHANGELOG.md b/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/qs/CHANGELOG.md new file mode 100644 index 0000000..f5ee8b4 --- /dev/null +++ b/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/qs/CHANGELOG.md @@ -0,0 +1,68 @@ + +## [**2.3.3**](https://github.com/hapijs/qs/issues?milestone=18&state=open) +- [**#59**](https://github.com/hapijs/qs/issues/59) make sure array indexes are >= 0, closes #57 +- [**#58**](https://github.com/hapijs/qs/issues/58) make qs usable for browser loader + +## [**2.3.2**](https://github.com/hapijs/qs/issues?milestone=17&state=closed) +- [**#55**](https://github.com/hapijs/qs/issues/55) allow merging a string into an object + +## [**2.3.1**](https://github.com/hapijs/qs/issues?milestone=16&state=closed) +- [**#52**](https://github.com/hapijs/qs/issues/52) Return "undefined" and "false" instead of throwing "TypeError". + +## [**2.3.0**](https://github.com/hapijs/qs/issues?milestone=15&state=closed) +- [**#50**](https://github.com/hapijs/qs/issues/50) add option to omit array indices, closes #46 + +## [**2.2.5**](https://github.com/hapijs/qs/issues?milestone=14&state=closed) +- [**#39**](https://github.com/hapijs/qs/issues/39) Is there an alternative to Buffer.isBuffer? +- [**#49**](https://github.com/hapijs/qs/issues/49) refactor utils.merge, fixes #45 +- [**#41**](https://github.com/hapijs/qs/issues/41) avoid browserifying Buffer, for #39 + +## [**2.2.4**](https://github.com/hapijs/qs/issues?milestone=13&state=closed) +- [**#38**](https://github.com/hapijs/qs/issues/38) how to handle object keys beginning with a number + +## [**2.2.3**](https://github.com/hapijs/qs/issues?milestone=12&state=closed) +- [**#37**](https://github.com/hapijs/qs/issues/37) parser discards first empty value in array +- [**#36**](https://github.com/hapijs/qs/issues/36) Update to lab 4.x + +## [**2.2.2**](https://github.com/hapijs/qs/issues?milestone=11&state=closed) +- [**#33**](https://github.com/hapijs/qs/issues/33) Error when plain object in a value +- [**#34**](https://github.com/hapijs/qs/issues/34) use Object.prototype.hasOwnProperty.call instead of obj.hasOwnProperty +- [**#24**](https://github.com/hapijs/qs/issues/24) Changelog? Semver? + +## [**2.2.1**](https://github.com/hapijs/qs/issues?milestone=10&state=closed) +- [**#32**](https://github.com/hapijs/qs/issues/32) account for circular references properly, closes #31 +- [**#31**](https://github.com/hapijs/qs/issues/31) qs.parse stackoverflow on circular objects + +## [**2.2.0**](https://github.com/hapijs/qs/issues?milestone=9&state=closed) +- [**#26**](https://github.com/hapijs/qs/issues/26) Don't use Buffer global if it's not present +- [**#30**](https://github.com/hapijs/qs/issues/30) Bug when merging non-object values into arrays +- [**#29**](https://github.com/hapijs/qs/issues/29) Don't call Utils.clone at the top of Utils.merge +- [**#23**](https://github.com/hapijs/qs/issues/23) Ability to not limit parameters? + +## [**2.1.0**](https://github.com/hapijs/qs/issues?milestone=8&state=closed) +- [**#22**](https://github.com/hapijs/qs/issues/22) Enable using a RegExp as delimiter + +## [**2.0.0**](https://github.com/hapijs/qs/issues?milestone=7&state=closed) +- [**#18**](https://github.com/hapijs/qs/issues/18) Why is there arrayLimit? +- [**#20**](https://github.com/hapijs/qs/issues/20) Configurable parametersLimit +- [**#21**](https://github.com/hapijs/qs/issues/21) make all limits optional, for #18, for #20 + +## [**1.2.2**](https://github.com/hapijs/qs/issues?milestone=6&state=closed) +- [**#19**](https://github.com/hapijs/qs/issues/19) Don't overwrite null values + +## [**1.2.1**](https://github.com/hapijs/qs/issues?milestone=5&state=closed) +- [**#16**](https://github.com/hapijs/qs/issues/16) ignore non-string delimiters +- [**#15**](https://github.com/hapijs/qs/issues/15) Close code block + +## [**1.2.0**](https://github.com/hapijs/qs/issues?milestone=4&state=closed) +- [**#12**](https://github.com/hapijs/qs/issues/12) Add optional delim argument +- [**#13**](https://github.com/hapijs/qs/issues/13) fix #11: flattened keys in array are now correctly parsed + +## [**1.1.0**](https://github.com/hapijs/qs/issues?milestone=3&state=closed) +- [**#7**](https://github.com/hapijs/qs/issues/7) Empty values of a POST array disappear after being submitted +- [**#9**](https://github.com/hapijs/qs/issues/9) Should not omit equals signs (=) when value is null +- [**#6**](https://github.com/hapijs/qs/issues/6) Minor grammar fix in README + +## [**1.0.2**](https://github.com/hapijs/qs/issues?milestone=2&state=closed) +- [**#5**](https://github.com/hapijs/qs/issues/5) array holes incorrectly copied into object on large index + diff --git a/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/qs/CONTRIBUTING.md b/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/qs/CONTRIBUTING.md new file mode 100644 index 0000000..8928361 --- /dev/null +++ b/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/qs/CONTRIBUTING.md @@ -0,0 +1 @@ +Please view our [hapijs contributing guide](https://github.com/hapijs/hapi/blob/master/CONTRIBUTING.md). diff --git a/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/qs/LICENSE b/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/qs/LICENSE new file mode 100755 index 0000000..d456948 --- /dev/null +++ b/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/qs/LICENSE @@ -0,0 +1,28 @@ +Copyright (c) 2014 Nathan LaFreniere and other contributors. +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * The names of any contributors may not 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 HOLDERS AND 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 complete list of contributors can be found at: https://github.com/hapijs/qs/graphs/contributors diff --git a/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/qs/Makefile b/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/qs/Makefile new file mode 100644 index 0000000..31cc899 --- /dev/null +++ b/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/qs/Makefile @@ -0,0 +1,8 @@ +test: + @node node_modules/lab/bin/lab -a code -L +test-cov: + @node node_modules/lab/bin/lab -a code -t 100 -L +test-cov-html: + @node node_modules/lab/bin/lab -a code -L -r html -o coverage.html + +.PHONY: test test-cov test-cov-html diff --git a/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/qs/Readme.md b/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/qs/Readme.md old mode 100644 new mode 100755 index 27e54a4..21bf3fa --- a/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/qs/Readme.md +++ b/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/qs/Readme.md @@ -1,58 +1,222 @@ -# node-querystring +# qs - query string parser for node and the browser supporting nesting, as it was removed from `0.3.x`, so this library provides the previous and commonly desired behaviour (and twice as fast). Used by [express](http://expressjs.com), [connect](http://senchalabs.github.com/connect) and others. +A querystring parsing and stringifying library with some added security. -## Installation +[![Build Status](https://secure.travis-ci.org/hapijs/qs.svg)](http://travis-ci.org/hapijs/qs) - $ npm install qs +Lead Maintainer: [Nathan LaFreniere](https://github.com/nlf) -## Examples +The **qs** module was originally created and maintained by [TJ Holowaychuk](https://github.com/visionmedia/node-querystring). -```js -var qs = require('qs'); +## Usage -qs.parse('user[name][first]=Tobi&user[email]=tobi@learnboost.com'); -// => { user: { name: { first: 'Tobi' }, email: 'tobi@learnboost.com' } } +```javascript +var Qs = require('qs'); -qs.stringify({ user: { name: 'Tobi', email: 'tobi@learnboost.com' }}) -// => user[name]=Tobi&user[email]=tobi%40learnboost.com +var obj = Qs.parse('a=c'); // { a: 'c' } +var str = Qs.stringify(obj); // 'a=c' ``` -## Testing +### Parsing Objects -Install dev dependencies: +```javascript +Qs.parse(string, [options]); +``` + +**qs** allows you to create nested objects within your query strings, by surrounding the name of sub-keys with square brackets `[]`. +For example, the string `'foo[bar]=baz'` converts to: + +```javascript +{ + foo: { + bar: 'baz' + } +} +``` + +URI encoded strings work too: + +```javascript +Qs.parse('a%5Bb%5D=c'); +// { a: { b: 'c' } } +``` + +You can also nest your objects, like `'foo[bar][baz]=foobarbaz'`: + +```javascript +{ + foo: { + bar: { + baz: 'foobarbaz' + } + } +} +``` + +By default, when nesting objects **qs** will only parse up to 5 children deep. This means if you attempt to parse a string like +`'a[b][c][d][e][f][g][h][i]=j'` your resulting object will be: + +```javascript +{ + a: { + b: { + c: { + d: { + e: { + f: { + '[g][h][i]': 'j' + } + } + } + } + } + } +} +``` + +This depth can be overridden by passing a `depth` option to `Qs.parse(string, [options])`: + +```javascript +Qs.parse('a[b][c][d][e][f][g][h][i]=j', { depth: 1 }); +// { a: { b: { '[c][d][e][f][g][h][i]': 'j' } } } +``` + +The depth limit helps mitigate abuse when **qs** is used to parse user input, and it is recommended to keep it a reasonably small number. + +For similar reasons, by default **qs** will only parse up to 1000 parameters. This can be overridden by passing a `parameterLimit` option: + +```javascript +Qs.parse('a=b&c=d', { parameterLimit: 1 }); +// { a: 'b' } +``` + +An optional delimiter can also be passed: + +```javascript +Qs.parse('a=b;c=d', { delimiter: ';' }); +// { a: 'b', c: 'd' } +``` + +Delimiters can be a regular expression too: + +```javascript +Qs.parse('a=b;c=d,e=f', { delimiter: /[;,]/ }); +// { a: 'b', c: 'd', e: 'f' } +``` + +### Parsing Arrays + +**qs** can also parse arrays using a similar `[]` notation: + +```javascript +Qs.parse('a[]=b&a[]=c'); +// { a: ['b', 'c'] } +``` + +You may specify an index as well: + +```javascript +Qs.parse('a[1]=c&a[0]=b'); +// { a: ['b', 'c'] } +``` + +Note that the only difference between an index in an array and a key in an object is that the value between the brackets must be a number +to create an array. When creating arrays with specific indices, **qs** will compact a sparse array to only the existing values preserving +their order: + +```javascript +Qs.parse('a[1]=b&a[15]=c'); +// { a: ['b', 'c'] } +``` + +Note that an empty string is also a value, and will be preserved: + +```javascript +Qs.parse('a[]=&a[]=b'); +// { a: ['', 'b'] } +Qs.parse('a[0]=b&a[1]=&a[2]=c'); +// { a: ['b', '', 'c'] } +``` + +**qs** will also limit specifying indices in an array to a maximum index of `20`. Any array members with an index of greater than `20` will +instead be converted to an object with the index as the key: - $ npm install -d +```javascript +Qs.parse('a[100]=b'); +// { a: { '100': 'b' } } +``` + +This limit can be overridden by passing an `arrayLimit` option: + +```javascript +Qs.parse('a[1]=b', { arrayLimit: 0 }); +// { a: { '1': 'b' } } +``` -and execute: +To disable array parsing entirely, set `arrayLimit` to `-1`. - $ make test +If you mix notations, **qs** will merge the two items into an object: -browser: +```javascript +Qs.parse('a[0]=b&a[b]=c'); +// { a: { '0': 'b', b: 'c' } } +``` - $ open test/browser/index.html +You can also create arrays of objects: -## License +```javascript +Qs.parse('a[][b]=c'); +// { a: [{ b: 'c' }] } +``` -(The MIT License) +### Stringifying -Copyright (c) 2010 TJ Holowaychuk <tj@vision-media.ca> +```javascript +Qs.stringify(object, [options]); +``` -Permission is hereby granted, free of charge, to any person obtaining -a copy of this software and associated documentation files (the -'Software'), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: +When stringifying, **qs** always URI encodes output. Objects are stringified as you would expect: -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. +```javascript +Qs.stringify({ a: 'b' }); +// 'a=b' +Qs.stringify({ a: { b: 'c' } }); +// 'a%5Bb%5D=c' +``` -THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \ No newline at end of file +Examples beyond this point will be shown as though the output is not URI encoded for clarity. Please note that the return values in these cases *will* be URI encoded during real usage. + +When arrays are stringified, by default they are given explicit indices: + +```javascript +Qs.stringify({ a: ['b', 'c', 'd'] }); +// 'a[0]=b&a[1]=c&a[2]=d' +``` + +You may override this by setting the `indices` option to `false`: + +```javascript +Qs.stringify({ a: ['b', 'c', 'd'] }, { indices: false }); +// 'a=b&a=c&a=d' +``` + +Empty strings and null values will omit the value, but the equals sign (=) remains in place: + +```javascript +Qs.stringify({ a: '' }); +// 'a=' +``` + +Properties that are set to `undefined` will be omitted entirely: + +```javascript +Qs.stringify({ a: null, b: undefined }); +// 'a=' +``` + +The delimiter may be overridden with stringify as well: + +```javascript +Qs.stringify({ a: 'b', c: 'd' }, { delimiter: ';' }); +// 'a=b;c=d' +``` diff --git a/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/qs/index.js b/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/qs/index.js index b05938a..2291cd8 100644 --- a/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/qs/index.js +++ b/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/qs/index.js @@ -1,366 +1 @@ -/** - * Object#toString() ref for stringify(). - */ - -var toString = Object.prototype.toString; - -/** - * Object#hasOwnProperty ref - */ - -var hasOwnProperty = Object.prototype.hasOwnProperty; - -/** - * Array#indexOf shim. - */ - -var indexOf = typeof Array.prototype.indexOf === 'function' - ? function(arr, el) { return arr.indexOf(el); } - : function(arr, el) { - for (var i = 0; i < arr.length; i++) { - if (arr[i] === el) return i; - } - return -1; - }; - -/** - * Array.isArray shim. - */ - -var isArray = Array.isArray || function(arr) { - return toString.call(arr) == '[object Array]'; -}; - -/** - * Object.keys shim. - */ - -var objectKeys = Object.keys || function(obj) { - var ret = []; - for (var key in obj) { - if (obj.hasOwnProperty(key)) { - ret.push(key); - } - } - return ret; -}; - -/** - * Array#forEach shim. - */ - -var forEach = typeof Array.prototype.forEach === 'function' - ? function(arr, fn) { return arr.forEach(fn); } - : function(arr, fn) { - for (var i = 0; i < arr.length; i++) fn(arr[i]); - }; - -/** - * Array#reduce shim. - */ - -var reduce = function(arr, fn, initial) { - if (typeof arr.reduce === 'function') return arr.reduce(fn, initial); - var res = initial; - for (var i = 0; i < arr.length; i++) res = fn(res, arr[i]); - return res; -}; - -/** - * Cache non-integer test regexp. - */ - -var isint = /^[0-9]+$/; - -function promote(parent, key) { - if (parent[key].length == 0) return parent[key] = {} - var t = {}; - for (var i in parent[key]) { - if (hasOwnProperty.call(parent[key], i)) { - t[i] = parent[key][i]; - } - } - parent[key] = t; - return t; -} - -function parse(parts, parent, key, val) { - var part = parts.shift(); - - // illegal - if (Object.getOwnPropertyDescriptor(Object.prototype, key)) return; - - // end - if (!part) { - if (isArray(parent[key])) { - parent[key].push(val); - } else if ('object' == typeof parent[key]) { - parent[key] = val; - } else if ('undefined' == typeof parent[key]) { - parent[key] = val; - } else { - parent[key] = [parent[key], val]; - } - // array - } else { - var obj = parent[key] = parent[key] || []; - if (']' == part) { - if (isArray(obj)) { - if ('' != val) obj.push(val); - } else if ('object' == typeof obj) { - obj[objectKeys(obj).length] = val; - } else { - obj = parent[key] = [parent[key], val]; - } - // prop - } else if (~indexOf(part, ']')) { - part = part.substr(0, part.length - 1); - if (!isint.test(part) && isArray(obj)) obj = promote(parent, key); - parse(parts, obj, part, val); - // key - } else { - if (!isint.test(part) && isArray(obj)) obj = promote(parent, key); - parse(parts, obj, part, val); - } - } -} - -/** - * Merge parent key/val pair. - */ - -function merge(parent, key, val){ - if (~indexOf(key, ']')) { - var parts = key.split('[') - , len = parts.length - , last = len - 1; - parse(parts, parent, 'base', val); - // optimize - } else { - if (!isint.test(key) && isArray(parent.base)) { - var t = {}; - for (var k in parent.base) t[k] = parent.base[k]; - parent.base = t; - } - set(parent.base, key, val); - } - - return parent; -} - -/** - * Compact sparse arrays. - */ - -function compact(obj) { - if ('object' != typeof obj) return obj; - - if (isArray(obj)) { - var ret = []; - - for (var i in obj) { - if (hasOwnProperty.call(obj, i)) { - ret.push(obj[i]); - } - } - - return ret; - } - - for (var key in obj) { - obj[key] = compact(obj[key]); - } - - return obj; -} - -/** - * Parse the given obj. - */ - -function parseObject(obj){ - var ret = { base: {} }; - - forEach(objectKeys(obj), function(name){ - merge(ret, name, obj[name]); - }); - - return compact(ret.base); -} - -/** - * Parse the given str. - */ - -function parseString(str){ - var ret = reduce(String(str).split('&'), function(ret, pair){ - var eql = indexOf(pair, '=') - , brace = lastBraceInKey(pair) - , key = pair.substr(0, brace || eql) - , val = pair.substr(brace || eql, pair.length) - , val = val.substr(indexOf(val, '=') + 1, val.length); - - // ?foo - if ('' == key) key = pair, val = ''; - if ('' == key) return ret; - - return merge(ret, decode(key), decode(val)); - }, { base: {} }).base; - - return compact(ret); -} - -/** - * Parse the given query `str` or `obj`, returning an object. - * - * @param {String} str | {Object} obj - * @return {Object} - * @api public - */ - -exports.parse = function(str){ - if (null == str || '' == str) return {}; - return 'object' == typeof str - ? parseObject(str) - : parseString(str); -}; - -/** - * Turn the given `obj` into a query string - * - * @param {Object} obj - * @return {String} - * @api public - */ - -var stringify = exports.stringify = function(obj, prefix) { - if (isArray(obj)) { - return stringifyArray(obj, prefix); - } else if ('[object Object]' == toString.call(obj)) { - return stringifyObject(obj, prefix); - } else if ('string' == typeof obj) { - return stringifyString(obj, prefix); - } else { - return prefix + '=' + encodeURIComponent(String(obj)); - } -}; - -/** - * Stringify the given `str`. - * - * @param {String} str - * @param {String} prefix - * @return {String} - * @api private - */ - -function stringifyString(str, prefix) { - if (!prefix) throw new TypeError('stringify expects an object'); - return prefix + '=' + encodeURIComponent(str); -} - -/** - * Stringify the given `arr`. - * - * @param {Array} arr - * @param {String} prefix - * @return {String} - * @api private - */ - -function stringifyArray(arr, prefix) { - var ret = []; - if (!prefix) throw new TypeError('stringify expects an object'); - for (var i = 0; i < arr.length; i++) { - ret.push(stringify(arr[i], prefix + '[' + i + ']')); - } - return ret.join('&'); -} - -/** - * Stringify the given `obj`. - * - * @param {Object} obj - * @param {String} prefix - * @return {String} - * @api private - */ - -function stringifyObject(obj, prefix) { - var ret = [] - , keys = objectKeys(obj) - , key; - - for (var i = 0, len = keys.length; i < len; ++i) { - key = keys[i]; - if ('' == key) continue; - if (null == obj[key]) { - ret.push(encodeURIComponent(key) + '='); - } else { - ret.push(stringify(obj[key], prefix - ? prefix + '[' + encodeURIComponent(key) + ']' - : encodeURIComponent(key))); - } - } - - return ret.join('&'); -} - -/** - * Set `obj`'s `key` to `val` respecting - * the weird and wonderful syntax of a qs, - * where "foo=bar&foo=baz" becomes an array. - * - * @param {Object} obj - * @param {String} key - * @param {String} val - * @api private - */ - -function set(obj, key, val) { - var v = obj[key]; - if (Object.getOwnPropertyDescriptor(Object.prototype, key)) return; - if (undefined === v) { - obj[key] = val; - } else if (isArray(v)) { - v.push(val); - } else { - obj[key] = [v, val]; - } -} - -/** - * Locate last brace in `str` within the key. - * - * @param {String} str - * @return {Number} - * @api private - */ - -function lastBraceInKey(str) { - var len = str.length - , brace - , c; - for (var i = 0; i < len; ++i) { - c = str[i]; - if (']' == c) brace = false; - if ('[' == c) brace = true; - if ('=' == c && !brace) return i; - } -} - -/** - * Decode `str`. - * - * @param {String} str - * @return {String} - * @api private - */ - -function decode(str) { - try { - return decodeURIComponent(str.replace(/\+/g, ' ')); - } catch (err) { - return str; - } -} +module.exports = require('./lib/'); diff --git a/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/qs/lib/index.js b/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/qs/lib/index.js new file mode 100755 index 0000000..0e09493 --- /dev/null +++ b/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/qs/lib/index.js @@ -0,0 +1,15 @@ +// Load modules + +var Stringify = require('./stringify'); +var Parse = require('./parse'); + + +// Declare internals + +var internals = {}; + + +module.exports = { + stringify: Stringify, + parse: Parse +}; diff --git a/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/qs/lib/parse.js b/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/qs/lib/parse.js new file mode 100755 index 0000000..4e7d02a --- /dev/null +++ b/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/qs/lib/parse.js @@ -0,0 +1,157 @@ +// Load modules + +var Utils = require('./utils'); + + +// Declare internals + +var internals = { + delimiter: '&', + depth: 5, + arrayLimit: 20, + parameterLimit: 1000 +}; + + +internals.parseValues = function (str, options) { + + var obj = {}; + var parts = str.split(options.delimiter, options.parameterLimit === Infinity ? undefined : options.parameterLimit); + + for (var i = 0, il = parts.length; i < il; ++i) { + var part = parts[i]; + var pos = part.indexOf(']=') === -1 ? part.indexOf('=') : part.indexOf(']=') + 1; + + if (pos === -1) { + obj[Utils.decode(part)] = ''; + } + else { + var key = Utils.decode(part.slice(0, pos)); + var val = Utils.decode(part.slice(pos + 1)); + + if (!obj.hasOwnProperty(key)) { + obj[key] = val; + } + else { + obj[key] = [].concat(obj[key]).concat(val); + } + } + } + + return obj; +}; + + +internals.parseObject = function (chain, val, options) { + + if (!chain.length) { + return val; + } + + var root = chain.shift(); + + var obj = {}; + if (root === '[]') { + obj = []; + obj = obj.concat(internals.parseObject(chain, val, options)); + } + else { + var cleanRoot = root[0] === '[' && root[root.length - 1] === ']' ? root.slice(1, root.length - 1) : root; + var index = parseInt(cleanRoot, 10); + var indexString = '' + index; + if (!isNaN(index) && + root !== cleanRoot && + indexString === cleanRoot && + index >= 0 && + index <= options.arrayLimit) { + + obj = []; + obj[index] = internals.parseObject(chain, val, options); + } + else { + obj[cleanRoot] = internals.parseObject(chain, val, options); + } + } + + return obj; +}; + + +internals.parseKeys = function (key, val, options) { + + if (!key) { + return; + } + + // The regex chunks + + var parent = /^([^\[\]]*)/; + var child = /(\[[^\[\]]*\])/g; + + // Get the parent + + var segment = parent.exec(key); + + // Don't allow them to overwrite object prototype properties + + if (Object.prototype.hasOwnProperty(segment[1])) { + return; + } + + // Stash the parent if it exists + + var keys = []; + if (segment[1]) { + keys.push(segment[1]); + } + + // Loop through children appending to the array until we hit depth + + var i = 0; + while ((segment = child.exec(key)) !== null && i < options.depth) { + + ++i; + if (!Object.prototype.hasOwnProperty(segment[1].replace(/\[|\]/g, ''))) { + keys.push(segment[1]); + } + } + + // If there's a remainder, just add whatever is left + + if (segment) { + keys.push('[' + key.slice(segment.index) + ']'); + } + + return internals.parseObject(keys, val, options); +}; + + +module.exports = function (str, options) { + + if (str === '' || + str === null || + typeof str === 'undefined') { + + return {}; + } + + options = options || {}; + options.delimiter = typeof options.delimiter === 'string' || Utils.isRegExp(options.delimiter) ? options.delimiter : internals.delimiter; + options.depth = typeof options.depth === 'number' ? options.depth : internals.depth; + options.arrayLimit = typeof options.arrayLimit === 'number' ? options.arrayLimit : internals.arrayLimit; + options.parameterLimit = typeof options.parameterLimit === 'number' ? options.parameterLimit : internals.parameterLimit; + + var tempObj = typeof str === 'string' ? internals.parseValues(str, options) : str; + var obj = {}; + + // Iterate over the keys and setup the new object + + var keys = Object.keys(tempObj); + for (var i = 0, il = keys.length; i < il; ++i) { + var key = keys[i]; + var newObj = internals.parseKeys(key, tempObj[key], options); + obj = Utils.merge(obj, newObj); + } + + return Utils.compact(obj); +}; diff --git a/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/qs/lib/stringify.js b/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/qs/lib/stringify.js new file mode 100755 index 0000000..b441104 --- /dev/null +++ b/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/qs/lib/stringify.js @@ -0,0 +1,77 @@ +// Load modules + +var Utils = require('./utils'); + + +// Declare internals + +var internals = { + delimiter: '&', + indices: true +}; + + +internals.stringify = function (obj, prefix, options) { + + if (Utils.isBuffer(obj)) { + obj = obj.toString(); + } + else if (obj instanceof Date) { + obj = obj.toISOString(); + } + else if (obj === null) { + obj = ''; + } + + if (typeof obj === 'string' || + typeof obj === 'number' || + typeof obj === 'boolean') { + + return [encodeURIComponent(prefix) + '=' + encodeURIComponent(obj)]; + } + + var values = []; + + if (typeof obj === 'undefined') { + return values; + } + + var objKeys = Object.keys(obj); + for (var i = 0, il = objKeys.length; i < il; ++i) { + var key = objKeys[i]; + if (!options.indices && + Array.isArray(obj)) { + + values = values.concat(internals.stringify(obj[key], prefix, options)); + } + else { + values = values.concat(internals.stringify(obj[key], prefix + '[' + key + ']', options)); + } + } + + return values; +}; + + +module.exports = function (obj, options) { + + options = options || {}; + var delimiter = typeof options.delimiter === 'undefined' ? internals.delimiter : options.delimiter; + options.indices = typeof options.indices === 'boolean' ? options.indices : internals.indices; + + var keys = []; + + if (typeof obj !== 'object' || + obj === null) { + + return ''; + } + + var objKeys = Object.keys(obj); + for (var i = 0, il = objKeys.length; i < il; ++i) { + var key = objKeys[i]; + keys = keys.concat(internals.stringify(obj[key], key, options)); + } + + return keys.join(delimiter); +}; diff --git a/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/qs/lib/utils.js b/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/qs/lib/utils.js new file mode 100755 index 0000000..5240bd5 --- /dev/null +++ b/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/qs/lib/utils.js @@ -0,0 +1,132 @@ +// Load modules + + +// Declare internals + +var internals = {}; + + +exports.arrayToObject = function (source) { + + var obj = {}; + for (var i = 0, il = source.length; i < il; ++i) { + if (typeof source[i] !== 'undefined') { + + obj[i] = source[i]; + } + } + + return obj; +}; + + +exports.merge = function (target, source) { + + if (!source) { + return target; + } + + if (typeof source !== 'object') { + if (Array.isArray(target)) { + target.push(source); + } + else { + target[source] = true; + } + + return target; + } + + if (typeof target !== 'object') { + target = [target].concat(source); + return target; + } + + if (Array.isArray(target) && + !Array.isArray(source)) { + + target = exports.arrayToObject(target); + } + + var keys = Object.keys(source); + for (var k = 0, kl = keys.length; k < kl; ++k) { + var key = keys[k]; + var value = source[key]; + + if (!target[key]) { + target[key] = value; + } + else { + target[key] = exports.merge(target[key], value); + } + } + + return target; +}; + + +exports.decode = function (str) { + + try { + return decodeURIComponent(str.replace(/\+/g, ' ')); + } catch (e) { + return str; + } +}; + + +exports.compact = function (obj, refs) { + + if (typeof obj !== 'object' || + obj === null) { + + return obj; + } + + refs = refs || []; + var lookup = refs.indexOf(obj); + if (lookup !== -1) { + return refs[lookup]; + } + + refs.push(obj); + + if (Array.isArray(obj)) { + var compacted = []; + + for (var i = 0, il = obj.length; i < il; ++i) { + if (typeof obj[i] !== 'undefined') { + compacted.push(obj[i]); + } + } + + return compacted; + } + + var keys = Object.keys(obj); + for (i = 0, il = keys.length; i < il; ++i) { + var key = keys[i]; + obj[key] = exports.compact(obj[key], refs); + } + + return obj; +}; + + +exports.isRegExp = function (obj) { + return Object.prototype.toString.call(obj) === '[object RegExp]'; +}; + + +exports.isBuffer = function (obj) { + + if (obj === null || + typeof obj === 'undefined') { + + return false; + } + + return !!(obj.constructor && + obj.constructor.isBuffer && + obj.constructor.isBuffer(obj)); +}; diff --git a/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/qs/package.json b/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/qs/package.json index 3fa54b6..689b7f5 100644 --- a/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/qs/package.json +++ b/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/qs/package.json @@ -1,55 +1,38 @@ { "name": "qs", - "description": "querystring parser", - "version": "0.6.6", - "keywords": [ - "query string", - "parser", - "component" - ], - "repository": { - "type": "git", - "url": "git://github.com/visionmedia/node-querystring.git" - }, + "version": "2.3.3", + "description": "A querystring parser that supports nesting and arrays, with a depth limit", + "homepage": "https://github.com/hapijs/qs", + "main": "index.js", + "dependencies": {}, "devDependencies": { - "mocha": "*", - "expect.js": "*" + "code": "1.x.x", + "lab": "5.x.x" }, "scripts": { - "test": "make test" - }, - "author": { - "name": "TJ Holowaychuk", - "email": "tj@vision-media.ca", - "url": "http://tjholowaychuk.com" - }, - "main": "index", - "engines": { - "node": "*" - }, - "bugs": { - "url": "https://github.com/visionmedia/node-querystring/issues" - }, - "_id": "qs@0.6.6", - "dist": { - "shasum": "6e015098ff51968b8a3c819001d5f2c89bc4b107", - "tarball": "http://registry.npmjs.org/qs/-/qs-0.6.6.tgz" + "test": "make test-cov" }, - "_from": "qs@~0.6.0", - "_npmVersion": "1.2.30", - "_npmUser": { - "name": "tjholowaychuk", - "email": "tj@vision-media.ca" + "repository": { + "type": "git", + "url": "https://github.com/hapijs/qs.git" }, - "maintainers": [ + "keywords": [ + "querystring", + "qs" + ], + "licenses": [ { - "name": "tjholowaychuk", - "email": "tj@vision-media.ca" + "type": "BSD", + "url": "http://github.com/hapijs/qs/raw/master/LICENSE" } ], - "directories": {}, - "_shasum": "6e015098ff51968b8a3c819001d5f2c89bc4b107", - "_resolved": "https://registry.npmjs.org/qs/-/qs-0.6.6.tgz", - "readme": "ERROR: No README data found!", - "homepage": "https://github.com/visionmedia/node-querystring" + "readme": "# qs\n\nA querystring parsing and stringifying library with some added security.\n\n[![Build Status](https://secure.travis-ci.org/hapijs/qs.svg)](http://travis-ci.org/hapijs/qs)\n\nLead Maintainer: [Nathan LaFreniere](https://github.com/nlf)\n\nThe **qs** module was originally created and maintained by [TJ Holowaychuk](https://github.com/visionmedia/node-querystring).\n\n## Usage\n\n```javascript\nvar Qs = require('qs');\n\nvar obj = Qs.parse('a=c'); // { a: 'c' }\nvar str = Qs.stringify(obj); // 'a=c'\n```\n\n### Parsing Objects\n\n```javascript\nQs.parse(string, [options]);\n```\n\n**qs** allows you to create nested objects within your query strings, by surrounding the name of sub-keys with square brackets `[]`.\nFor example, the string `'foo[bar]=baz'` converts to:\n\n```javascript\n{\n foo: {\n bar: 'baz'\n }\n}\n```\n\nURI encoded strings work too:\n\n```javascript\nQs.parse('a%5Bb%5D=c');\n// { a: { b: 'c' } }\n```\n\nYou can also nest your objects, like `'foo[bar][baz]=foobarbaz'`:\n\n```javascript\n{\n foo: {\n bar: {\n baz: 'foobarbaz'\n }\n }\n}\n```\n\nBy default, when nesting objects **qs** will only parse up to 5 children deep. This means if you attempt to parse a string like\n`'a[b][c][d][e][f][g][h][i]=j'` your resulting object will be:\n\n```javascript\n{\n a: {\n b: {\n c: {\n d: {\n e: {\n f: {\n '[g][h][i]': 'j'\n }\n }\n }\n }\n }\n }\n}\n```\n\nThis depth can be overridden by passing a `depth` option to `Qs.parse(string, [options])`:\n\n```javascript\nQs.parse('a[b][c][d][e][f][g][h][i]=j', { depth: 1 });\n// { a: { b: { '[c][d][e][f][g][h][i]': 'j' } } }\n```\n\nThe depth limit helps mitigate abuse when **qs** is used to parse user input, and it is recommended to keep it a reasonably small number.\n\nFor similar reasons, by default **qs** will only parse up to 1000 parameters. This can be overridden by passing a `parameterLimit` option:\n\n```javascript\nQs.parse('a=b&c=d', { parameterLimit: 1 });\n// { a: 'b' }\n```\n\nAn optional delimiter can also be passed:\n\n```javascript\nQs.parse('a=b;c=d', { delimiter: ';' });\n// { a: 'b', c: 'd' }\n```\n\nDelimiters can be a regular expression too:\n\n```javascript\nQs.parse('a=b;c=d,e=f', { delimiter: /[;,]/ });\n// { a: 'b', c: 'd', e: 'f' }\n```\n\n### Parsing Arrays\n\n**qs** can also parse arrays using a similar `[]` notation:\n\n```javascript\nQs.parse('a[]=b&a[]=c');\n// { a: ['b', 'c'] }\n```\n\nYou may specify an index as well:\n\n```javascript\nQs.parse('a[1]=c&a[0]=b');\n// { a: ['b', 'c'] }\n```\n\nNote that the only difference between an index in an array and a key in an object is that the value between the brackets must be a number\nto create an array. When creating arrays with specific indices, **qs** will compact a sparse array to only the existing values preserving\ntheir order:\n\n```javascript\nQs.parse('a[1]=b&a[15]=c');\n// { a: ['b', 'c'] }\n```\n\nNote that an empty string is also a value, and will be preserved:\n\n```javascript\nQs.parse('a[]=&a[]=b');\n// { a: ['', 'b'] }\nQs.parse('a[0]=b&a[1]=&a[2]=c');\n// { a: ['b', '', 'c'] }\n```\n\n**qs** will also limit specifying indices in an array to a maximum index of `20`. Any array members with an index of greater than `20` will\ninstead be converted to an object with the index as the key:\n\n```javascript\nQs.parse('a[100]=b');\n// { a: { '100': 'b' } }\n```\n\nThis limit can be overridden by passing an `arrayLimit` option:\n\n```javascript\nQs.parse('a[1]=b', { arrayLimit: 0 });\n// { a: { '1': 'b' } }\n```\n\nTo disable array parsing entirely, set `arrayLimit` to `-1`.\n\nIf you mix notations, **qs** will merge the two items into an object:\n\n```javascript\nQs.parse('a[0]=b&a[b]=c');\n// { a: { '0': 'b', b: 'c' } }\n```\n\nYou can also create arrays of objects:\n\n```javascript\nQs.parse('a[][b]=c');\n// { a: [{ b: 'c' }] }\n```\n\n### Stringifying\n\n```javascript\nQs.stringify(object, [options]);\n```\n\nWhen stringifying, **qs** always URI encodes output. Objects are stringified as you would expect:\n\n```javascript\nQs.stringify({ a: 'b' });\n// 'a=b'\nQs.stringify({ a: { b: 'c' } });\n// 'a%5Bb%5D=c'\n```\n\nExamples beyond this point will be shown as though the output is not URI encoded for clarity. Please note that the return values in these cases *will* be URI encoded during real usage.\n\nWhen arrays are stringified, by default they are given explicit indices:\n\n```javascript\nQs.stringify({ a: ['b', 'c', 'd'] });\n// 'a[0]=b&a[1]=c&a[2]=d'\n```\n\nYou may override this by setting the `indices` option to `false`:\n\n```javascript\nQs.stringify({ a: ['b', 'c', 'd'] }, { indices: false });\n// 'a=b&a=c&a=d'\n```\n\nEmpty strings and null values will omit the value, but the equals sign (=) remains in place:\n\n```javascript\nQs.stringify({ a: '' });\n// 'a='\n```\n\nProperties that are set to `undefined` will be omitted entirely:\n\n```javascript\nQs.stringify({ a: null, b: undefined });\n// 'a='\n```\n\nThe delimiter may be overridden with stringify as well:\n\n```javascript\nQs.stringify({ a: 'b', c: 'd' }, { delimiter: ';' });\n// 'a=b;c=d'\n```\n", + "readmeFilename": "README.md", + "bugs": { + "url": "https://github.com/hapijs/qs/issues" + }, + "_id": "qs@2.3.3", + "_shasum": "e9e85adbe75da0bbe4c8e0476a086290f863b404", + "_from": "qs@~2.3.1", + "_resolved": "https://registry.npmjs.org/qs/-/qs-2.3.3.tgz" } diff --git a/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/qs/test/parse.js b/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/qs/test/parse.js new file mode 100755 index 0000000..6c20cc1 --- /dev/null +++ b/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/qs/test/parse.js @@ -0,0 +1,413 @@ +/* eslint no-extend-native:0 */ +// Load modules + +var Code = require('code'); +var Lab = require('lab'); +var Qs = require('../'); + + +// Declare internals + +var internals = {}; + + +// Test shortcuts + +var lab = exports.lab = Lab.script(); +var expect = Code.expect; +var describe = lab.experiment; +var it = lab.test; + + +describe('parse()', function () { + + it('parses a simple string', function (done) { + + expect(Qs.parse('0=foo')).to.deep.equal({ '0': 'foo' }); + expect(Qs.parse('foo=c++')).to.deep.equal({ foo: 'c ' }); + expect(Qs.parse('a[>=]=23')).to.deep.equal({ a: { '>=': '23' } }); + expect(Qs.parse('a[<=>]==23')).to.deep.equal({ a: { '<=>': '=23' } }); + expect(Qs.parse('a[==]=23')).to.deep.equal({ a: { '==': '23' } }); + expect(Qs.parse('foo')).to.deep.equal({ foo: '' }); + expect(Qs.parse('foo=bar')).to.deep.equal({ foo: 'bar' }); + expect(Qs.parse(' foo = bar = baz ')).to.deep.equal({ ' foo ': ' bar = baz ' }); + expect(Qs.parse('foo=bar=baz')).to.deep.equal({ foo: 'bar=baz' }); + expect(Qs.parse('foo=bar&bar=baz')).to.deep.equal({ foo: 'bar', bar: 'baz' }); + expect(Qs.parse('foo=bar&baz')).to.deep.equal({ foo: 'bar', baz: '' }); + expect(Qs.parse('cht=p3&chd=t:60,40&chs=250x100&chl=Hello|World')).to.deep.equal({ + cht: 'p3', + chd: 't:60,40', + chs: '250x100', + chl: 'Hello|World' + }); + done(); + }); + + it('parses a single nested string', function (done) { + + expect(Qs.parse('a[b]=c')).to.deep.equal({ a: { b: 'c' } }); + done(); + }); + + it('parses a double nested string', function (done) { + + expect(Qs.parse('a[b][c]=d')).to.deep.equal({ a: { b: { c: 'd' } } }); + done(); + }); + + it('defaults to a depth of 5', function (done) { + + expect(Qs.parse('a[b][c][d][e][f][g][h]=i')).to.deep.equal({ a: { b: { c: { d: { e: { f: { '[g][h]': 'i' } } } } } } }); + done(); + }); + + it('only parses one level when depth = 1', function (done) { + + expect(Qs.parse('a[b][c]=d', { depth: 1 })).to.deep.equal({ a: { b: { '[c]': 'd' } } }); + expect(Qs.parse('a[b][c][d]=e', { depth: 1 })).to.deep.equal({ a: { b: { '[c][d]': 'e' } } }); + done(); + }); + + it('parses a simple array', function (done) { + + expect(Qs.parse('a=b&a=c')).to.deep.equal({ a: ['b', 'c'] }); + done(); + }); + + it('parses an explicit array', function (done) { + + expect(Qs.parse('a[]=b')).to.deep.equal({ a: ['b'] }); + expect(Qs.parse('a[]=b&a[]=c')).to.deep.equal({ a: ['b', 'c'] }); + expect(Qs.parse('a[]=b&a[]=c&a[]=d')).to.deep.equal({ a: ['b', 'c', 'd'] }); + done(); + }); + + it('parses a mix of simple and explicit arrays', function (done) { + + expect(Qs.parse('a=b&a[]=c')).to.deep.equal({ a: ['b', 'c'] }); + expect(Qs.parse('a[]=b&a=c')).to.deep.equal({ a: ['b', 'c'] }); + expect(Qs.parse('a[0]=b&a=c')).to.deep.equal({ a: ['b', 'c'] }); + expect(Qs.parse('a=b&a[0]=c')).to.deep.equal({ a: ['b', 'c'] }); + expect(Qs.parse('a[1]=b&a=c')).to.deep.equal({ a: ['b', 'c'] }); + expect(Qs.parse('a=b&a[1]=c')).to.deep.equal({ a: ['b', 'c'] }); + done(); + }); + + it('parses a nested array', function (done) { + + expect(Qs.parse('a[b][]=c&a[b][]=d')).to.deep.equal({ a: { b: ['c', 'd'] } }); + expect(Qs.parse('a[>=]=25')).to.deep.equal({ a: { '>=': '25' } }); + done(); + }); + + it('allows to specify array indices', function (done) { + + expect(Qs.parse('a[1]=c&a[0]=b&a[2]=d')).to.deep.equal({ a: ['b', 'c', 'd'] }); + expect(Qs.parse('a[1]=c&a[0]=b')).to.deep.equal({ a: ['b', 'c'] }); + expect(Qs.parse('a[1]=c')).to.deep.equal({ a: ['c'] }); + done(); + }); + + it('limits specific array indices to 20', function (done) { + + expect(Qs.parse('a[20]=a')).to.deep.equal({ a: ['a'] }); + expect(Qs.parse('a[21]=a')).to.deep.equal({ a: { '21': 'a' } }); + done(); + }); + + it('supports keys that begin with a number', function (done) { + + expect(Qs.parse('a[12b]=c')).to.deep.equal({ a: { '12b': 'c' } }); + done(); + }); + + it('supports encoded = signs', function (done) { + + expect(Qs.parse('he%3Dllo=th%3Dere')).to.deep.equal({ 'he=llo': 'th=ere' }); + done(); + }); + + it('is ok with url encoded strings', function (done) { + + expect(Qs.parse('a[b%20c]=d')).to.deep.equal({ a: { 'b c': 'd' } }); + expect(Qs.parse('a[b]=c%20d')).to.deep.equal({ a: { b: 'c d' } }); + done(); + }); + + it('allows brackets in the value', function (done) { + + expect(Qs.parse('pets=["tobi"]')).to.deep.equal({ pets: '["tobi"]' }); + expect(Qs.parse('operators=[">=", "<="]')).to.deep.equal({ operators: '[">=", "<="]' }); + done(); + }); + + it('allows empty values', function (done) { + + expect(Qs.parse('')).to.deep.equal({}); + expect(Qs.parse(null)).to.deep.equal({}); + expect(Qs.parse(undefined)).to.deep.equal({}); + done(); + }); + + it('transforms arrays to objects', function (done) { + + expect(Qs.parse('foo[0]=bar&foo[bad]=baz')).to.deep.equal({ foo: { '0': 'bar', bad: 'baz' } }); + expect(Qs.parse('foo[bad]=baz&foo[0]=bar')).to.deep.equal({ foo: { bad: 'baz', '0': 'bar' } }); + expect(Qs.parse('foo[bad]=baz&foo[]=bar')).to.deep.equal({ foo: { bad: 'baz', '0': 'bar' } }); + expect(Qs.parse('foo[]=bar&foo[bad]=baz')).to.deep.equal({ foo: { '0': 'bar', bad: 'baz' } }); + expect(Qs.parse('foo[bad]=baz&foo[]=bar&foo[]=foo')).to.deep.equal({ foo: { bad: 'baz', '0': 'bar', '1': 'foo' } }); + expect(Qs.parse('foo[0][a]=a&foo[0][b]=b&foo[1][a]=aa&foo[1][b]=bb')).to.deep.equal({foo: [ {a: 'a', b: 'b'}, {a: 'aa', b: 'bb'} ]}); + done(); + }); + + it('can add keys to objects', function (done) { + + expect(Qs.parse('a[b]=c&a=d')).to.deep.equal({ a: { b: 'c', d: true } }); + done(); + }); + + it('correctly prunes undefined values when converting an array to an object', function (done) { + + expect(Qs.parse('a[2]=b&a[99999999]=c')).to.deep.equal({ a: { '2': 'b', '99999999': 'c' } }); + done(); + }); + + it('supports malformed uri characters', function (done) { + + expect(Qs.parse('{%:%}')).to.deep.equal({ '{%:%}': '' }); + expect(Qs.parse('foo=%:%}')).to.deep.equal({ foo: '%:%}' }); + done(); + }); + + it('doesn\'t produce empty keys', function (done) { + + expect(Qs.parse('_r=1&')).to.deep.equal({ '_r': '1' }); + done(); + }); + + it('cannot override prototypes', function (done) { + + var obj = Qs.parse('toString=bad&bad[toString]=bad&constructor=bad'); + expect(typeof obj.toString).to.equal('function'); + expect(typeof obj.bad.toString).to.equal('function'); + expect(typeof obj.constructor).to.equal('function'); + done(); + }); + + it('cannot access Object prototype', function (done) { + + Qs.parse('constructor[prototype][bad]=bad'); + Qs.parse('bad[constructor][prototype][bad]=bad'); + expect(typeof Object.prototype.bad).to.equal('undefined'); + done(); + }); + + it('parses arrays of objects', function (done) { + + expect(Qs.parse('a[][b]=c')).to.deep.equal({ a: [{ b: 'c' }] }); + expect(Qs.parse('a[0][b]=c')).to.deep.equal({ a: [{ b: 'c' }] }); + done(); + }); + + it('allows for empty strings in arrays', function (done) { + + expect(Qs.parse('a[]=b&a[]=&a[]=c')).to.deep.equal({ a: ['b', '', 'c'] }); + expect(Qs.parse('a[0]=b&a[1]=&a[2]=c&a[19]=')).to.deep.equal({ a: ['b', '', 'c', ''] }); + expect(Qs.parse('a[]=&a[]=b&a[]=c')).to.deep.equal({ a: ['', 'b', 'c'] }); + done(); + }); + + it('compacts sparse arrays', function (done) { + + expect(Qs.parse('a[10]=1&a[2]=2')).to.deep.equal({ a: ['2', '1'] }); + done(); + }); + + it('parses semi-parsed strings', function (done) { + + expect(Qs.parse({ 'a[b]': 'c' })).to.deep.equal({ a: { b: 'c' } }); + expect(Qs.parse({ 'a[b]': 'c', 'a[d]': 'e' })).to.deep.equal({ a: { b: 'c', d: 'e' } }); + done(); + }); + + it('parses buffers correctly', function (done) { + + var b = new Buffer('test'); + expect(Qs.parse({ a: b })).to.deep.equal({ a: b }); + done(); + }); + + it('continues parsing when no parent is found', function (done) { + + expect(Qs.parse('[]&a=b')).to.deep.equal({ '0': '', a: 'b' }); + expect(Qs.parse('[foo]=bar')).to.deep.equal({ foo: 'bar' }); + done(); + }); + + it('does not error when parsing a very long array', function (done) { + + var str = 'a[]=a'; + while (Buffer.byteLength(str) < 128 * 1024) { + str += '&' + str; + } + + expect(function () { + + Qs.parse(str); + }).to.not.throw(); + + done(); + }); + + it('should not throw when a native prototype has an enumerable property', { parallel: false }, function (done) { + + Object.prototype.crash = ''; + Array.prototype.crash = ''; + expect(Qs.parse.bind(null, 'a=b')).to.not.throw(); + expect(Qs.parse('a=b')).to.deep.equal({ a: 'b' }); + expect(Qs.parse.bind(null, 'a[][b]=c')).to.not.throw(); + expect(Qs.parse('a[][b]=c')).to.deep.equal({ a: [{ b: 'c' }] }); + delete Object.prototype.crash; + delete Array.prototype.crash; + done(); + }); + + it('parses a string with an alternative string delimiter', function (done) { + + expect(Qs.parse('a=b;c=d', { delimiter: ';' })).to.deep.equal({ a: 'b', c: 'd' }); + done(); + }); + + it('parses a string with an alternative RegExp delimiter', function (done) { + + expect(Qs.parse('a=b; c=d', { delimiter: /[;,] */ })).to.deep.equal({ a: 'b', c: 'd' }); + done(); + }); + + it('does not use non-splittable objects as delimiters', function (done) { + + expect(Qs.parse('a=b&c=d', { delimiter: true })).to.deep.equal({ a: 'b', c: 'd' }); + done(); + }); + + it('allows overriding parameter limit', function (done) { + + expect(Qs.parse('a=b&c=d', { parameterLimit: 1 })).to.deep.equal({ a: 'b' }); + done(); + }); + + it('allows setting the parameter limit to Infinity', function (done) { + + expect(Qs.parse('a=b&c=d', { parameterLimit: Infinity })).to.deep.equal({ a: 'b', c: 'd' }); + done(); + }); + + it('allows overriding array limit', function (done) { + + expect(Qs.parse('a[0]=b', { arrayLimit: -1 })).to.deep.equal({ a: { '0': 'b' } }); + expect(Qs.parse('a[-1]=b', { arrayLimit: -1 })).to.deep.equal({ a: { '-1': 'b' } }); + expect(Qs.parse('a[0]=b&a[1]=c', { arrayLimit: 0 })).to.deep.equal({ a: { '0': 'b', '1': 'c' } }); + done(); + }); + + it('parses an object', function (done) { + + var input = { + 'user[name]': {'pop[bob]': 3}, + 'user[email]': null + }; + + var expected = { + 'user': { + 'name': {'pop[bob]': 3}, + 'email': null + } + }; + + var result = Qs.parse(input); + + expect(result).to.deep.equal(expected); + done(); + }); + + it('parses an object and not child values', function (done) { + + var input = { + 'user[name]': {'pop[bob]': { 'test': 3 }}, + 'user[email]': null + }; + + var expected = { + 'user': { + 'name': {'pop[bob]': { 'test': 3 }}, + 'email': null + } + }; + + var result = Qs.parse(input); + + expect(result).to.deep.equal(expected); + done(); + }); + + it('does not blow up when Buffer global is missing', function (done) { + + var tempBuffer = global.Buffer; + delete global.Buffer; + var result = Qs.parse('a=b&c=d'); + global.Buffer = tempBuffer; + expect(result).to.deep.equal({ a: 'b', c: 'd' }); + done(); + }); + + it('does not crash when using invalid dot notation', function (done) { + + expect(Qs.parse('roomInfoList[0].childrenAges[0]=15&roomInfoList[0].numberOfAdults=2')).to.deep.equal({ roomInfoList: [['15', '2']] }); + done(); + }); + + it('does not crash when parsing circular references', function (done) { + + var a = {}; + a.b = a; + + var parsed; + + expect(function () { + + parsed = Qs.parse({ 'foo[bar]': 'baz', 'foo[baz]': a }); + }).to.not.throw(); + + expect(parsed).to.contain('foo'); + expect(parsed.foo).to.contain('bar', 'baz'); + expect(parsed.foo.bar).to.equal('baz'); + expect(parsed.foo.baz).to.deep.equal(a); + done(); + }); + + it('parses plain objects correctly', function (done) { + + var a = Object.create(null); + a.b = 'c'; + + expect(Qs.parse(a)).to.deep.equal({ b: 'c' }); + var result = Qs.parse({ a: a }); + expect(result).to.contain('a'); + expect(result.a).to.deep.equal(a); + done(); + }); + + it('parses dates correctly', function (done) { + + var now = new Date(); + expect(Qs.parse({ a: now })).to.deep.equal({ a: now }); + done(); + }); + + it('parses regular expressions correctly', function (done) { + + var re = /^test$/; + expect(Qs.parse({ a: re })).to.deep.equal({ a: re }); + done(); + }); +}); diff --git a/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/qs/test/stringify.js b/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/qs/test/stringify.js new file mode 100755 index 0000000..75e397a --- /dev/null +++ b/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/qs/test/stringify.js @@ -0,0 +1,179 @@ +/* eslint no-extend-native:0 */ +// Load modules + +var Code = require('code'); +var Lab = require('lab'); +var Qs = require('../'); + + +// Declare internals + +var internals = {}; + + +// Test shortcuts + +var lab = exports.lab = Lab.script(); +var expect = Code.expect; +var describe = lab.experiment; +var it = lab.test; + + +describe('stringify()', function () { + + it('stringifies a querystring object', function (done) { + + expect(Qs.stringify({ a: 'b' })).to.equal('a=b'); + expect(Qs.stringify({ a: 1 })).to.equal('a=1'); + expect(Qs.stringify({ a: 1, b: 2 })).to.equal('a=1&b=2'); + done(); + }); + + it('stringifies a nested object', function (done) { + + expect(Qs.stringify({ a: { b: 'c' } })).to.equal('a%5Bb%5D=c'); + expect(Qs.stringify({ a: { b: { c: { d: 'e' } } } })).to.equal('a%5Bb%5D%5Bc%5D%5Bd%5D=e'); + done(); + }); + + it('stringifies an array value', function (done) { + + expect(Qs.stringify({ a: ['b', 'c', 'd'] })).to.equal('a%5B0%5D=b&a%5B1%5D=c&a%5B2%5D=d'); + done(); + }); + + it('omits array indices when asked', function (done) { + + expect(Qs.stringify({ a: ['b', 'c', 'd'] }, { indices: false })).to.equal('a=b&a=c&a=d'); + done(); + }); + + it('stringifies a nested array value', function (done) { + + expect(Qs.stringify({ a: { b: ['c', 'd'] } })).to.equal('a%5Bb%5D%5B0%5D=c&a%5Bb%5D%5B1%5D=d'); + done(); + }); + + it('stringifies an object inside an array', function (done) { + + expect(Qs.stringify({ a: [{ b: 'c' }] })).to.equal('a%5B0%5D%5Bb%5D=c'); + expect(Qs.stringify({ a: [{ b: { c: [1] } }] })).to.equal('a%5B0%5D%5Bb%5D%5Bc%5D%5B0%5D=1'); + done(); + }); + + it('does not omit object keys when indices = false', function (done) { + + expect(Qs.stringify({ a: [{ b: 'c' }] }, { indices: false })).to.equal('a%5Bb%5D=c'); + done(); + }); + + it('stringifies a complicated object', function (done) { + + expect(Qs.stringify({ a: { b: 'c', d: 'e' } })).to.equal('a%5Bb%5D=c&a%5Bd%5D=e'); + done(); + }); + + it('stringifies an empty value', function (done) { + + expect(Qs.stringify({ a: '' })).to.equal('a='); + expect(Qs.stringify({ a: '', b: '' })).to.equal('a=&b='); + expect(Qs.stringify({ a: null })).to.equal('a='); + expect(Qs.stringify({ a: { b: null } })).to.equal('a%5Bb%5D='); + done(); + }); + + it('stringifies an empty object', function (done) { + + var obj = Object.create(null); + obj.a = 'b'; + expect(Qs.stringify(obj)).to.equal('a=b'); + done(); + }); + + it('returns an empty string for invalid input', function (done) { + + expect(Qs.stringify(undefined)).to.equal(''); + expect(Qs.stringify(false)).to.equal(''); + expect(Qs.stringify(null)).to.equal(''); + expect(Qs.stringify('')).to.equal(''); + done(); + }); + + it('stringifies an object with an empty object as a child', function (done) { + + var obj = { + a: Object.create(null) + }; + + obj.a.b = 'c'; + expect(Qs.stringify(obj)).to.equal('a%5Bb%5D=c'); + done(); + }); + + it('drops keys with a value of undefined', function (done) { + + expect(Qs.stringify({ a: undefined })).to.equal(''); + expect(Qs.stringify({ a: { b: undefined, c: null } })).to.equal('a%5Bc%5D='); + done(); + }); + + it('url encodes values', function (done) { + + expect(Qs.stringify({ a: 'b c' })).to.equal('a=b%20c'); + done(); + }); + + it('stringifies a date', function (done) { + + var now = new Date(); + var str = 'a=' + encodeURIComponent(now.toISOString()); + expect(Qs.stringify({ a: now })).to.equal(str); + done(); + }); + + it('stringifies the weird object from qs', function (done) { + + expect(Qs.stringify({ 'my weird field': 'q1!2"\'w$5&7/z8)?' })).to.equal('my%20weird%20field=q1!2%22\'w%245%267%2Fz8)%3F'); + done(); + }); + + it('skips properties that are part of the object prototype', function (done) { + + Object.prototype.crash = 'test'; + expect(Qs.stringify({ a: 'b'})).to.equal('a=b'); + expect(Qs.stringify({ a: { b: 'c' } })).to.equal('a%5Bb%5D=c'); + delete Object.prototype.crash; + done(); + }); + + it('stringifies boolean values', function (done) { + + expect(Qs.stringify({ a: true })).to.equal('a=true'); + expect(Qs.stringify({ a: { b: true } })).to.equal('a%5Bb%5D=true'); + expect(Qs.stringify({ b: false })).to.equal('b=false'); + expect(Qs.stringify({ b: { c: false } })).to.equal('b%5Bc%5D=false'); + done(); + }); + + it('stringifies buffer values', function (done) { + + expect(Qs.stringify({ a: new Buffer('test') })).to.equal('a=test'); + expect(Qs.stringify({ a: { b: new Buffer('test') } })).to.equal('a%5Bb%5D=test'); + done(); + }); + + it('stringifies an object using an alternative delimiter', function (done) { + + expect(Qs.stringify({ a: 'b', c: 'd' }, { delimiter: ';' })).to.equal('a=b;c=d'); + done(); + }); + + it('doesn\'t blow up when Buffer global is missing', function (done) { + + var tempBuffer = global.Buffer; + delete global.Buffer; + expect(Qs.stringify({ a: 'b', c: 'd' })).to.equal('a=b&c=d'); + global.Buffer = tempBuffer; + done(); + }); +}); diff --git a/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/stringstream/.npmignore b/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/stringstream/.npmignore new file mode 100644 index 0000000..7dccd97 --- /dev/null +++ b/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/stringstream/.npmignore @@ -0,0 +1,15 @@ +lib-cov +*.seed +*.log +*.csv +*.dat +*.out +*.pid +*.gz + +pids +logs +results + +node_modules +npm-debug.log \ No newline at end of file diff --git a/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/stringstream/.travis.yml b/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/stringstream/.travis.yml new file mode 100644 index 0000000..f1d0f13 --- /dev/null +++ b/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/stringstream/.travis.yml @@ -0,0 +1,4 @@ +language: node_js +node_js: + - 0.4 + - 0.6 diff --git a/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/stringstream/LICENSE.txt b/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/stringstream/LICENSE.txt new file mode 100644 index 0000000..eac1881 --- /dev/null +++ b/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/stringstream/LICENSE.txt @@ -0,0 +1,4 @@ +Copyright 2012 Michael Hart (michael.hart.au@gmail.com) + +This project is free software released under the MIT license: +http://www.opensource.org/licenses/mit-license.php diff --git a/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/stringstream/README.md b/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/stringstream/README.md new file mode 100644 index 0000000..32fc982 --- /dev/null +++ b/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/stringstream/README.md @@ -0,0 +1,38 @@ +# Decode streams into strings The Right Way(tm) + +```javascript +var fs = require('fs') +var zlib = require('zlib') +var strs = require('stringstream') + +var utf8Stream = fs.createReadStream('massiveLogFile.gz') + .pipe(zlib.createGunzip()) + .pipe(strs('utf8')) +``` + +No need to deal with `setEncoding()` weirdness, just compose streams +like they were supposed to be! + +Handles input and output encoding: + +```javascript +// Stream from utf8 to hex to base64... Why not, ay. +var hex64Stream = fs.createReadStream('myFile') + .pipe(strs('utf8', 'hex')) + .pipe(strs('hex', 'base64')) +``` + +Also deals with `base64` output correctly by aligning each emitted data +chunk so that there are no dangling `=` characters: + +```javascript +var stream = fs.createReadStream('myFile').pipe(strs('base64')) + +var base64Str = '' + +stream.on('data', function(data) { base64Str += data }) +stream.on('end', function() { + console.log('My base64 encoded file is: ' + base64Str) // Wouldn't work with setEncoding() + console.log('Original file is: ' + new Buffer(base64Str, 'base64')) +}) +``` diff --git a/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/stringstream/example.js b/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/stringstream/example.js new file mode 100644 index 0000000..f82b85e --- /dev/null +++ b/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/stringstream/example.js @@ -0,0 +1,27 @@ +var fs = require('fs') +var zlib = require('zlib') +var strs = require('stringstream') + +var utf8Stream = fs.createReadStream('massiveLogFile.gz') + .pipe(zlib.createGunzip()) + .pipe(strs('utf8')) + +utf8Stream.pipe(process.stdout) + +// Stream from utf8 to hex to base64... Why not, ay. +var hex64Stream = fs.createReadStream('myFile') + .pipe(strs('utf8', 'hex')) + .pipe(strs('hex', 'base64')) + +hex64Stream.pipe(process.stdout) + +// Deals with base64 correctly by aligning chunks +var stream = fs.createReadStream('myFile').pipe(strs('base64')) + +var base64Str = '' + +stream.on('data', function(data) { base64Str += data }) +stream.on('end', function() { + console.log('My base64 encoded file is: ' + base64Str) // Wouldn't work with setEncoding() + console.log('Original file is: ' + new Buffer(base64Str, 'base64')) +}) diff --git a/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/stringstream/package.json b/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/stringstream/package.json new file mode 100644 index 0000000..3afb144 --- /dev/null +++ b/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/stringstream/package.json @@ -0,0 +1,49 @@ +{ + "name": "stringstream", + "version": "0.0.4", + "description": "Encode and decode streams into string streams", + "author": { + "name": "Michael Hart", + "email": "michael.hart.au@gmail.com", + "url": "http://github.com/mhart" + }, + "main": "stringstream.js", + "keywords": [ + "string", + "stream", + "base64", + "gzip" + ], + "repository": { + "type": "git", + "url": "https://github.com/mhart/StringStream.git" + }, + "license": "MIT", + "readme": "# Decode streams into strings The Right Way(tm)\n\n```javascript\nvar fs = require('fs')\nvar zlib = require('zlib')\nvar strs = require('stringstream')\n\nvar utf8Stream = fs.createReadStream('massiveLogFile.gz')\n .pipe(zlib.createGunzip())\n .pipe(strs('utf8'))\n```\n\nNo need to deal with `setEncoding()` weirdness, just compose streams\nlike they were supposed to be!\n\nHandles input and output encoding:\n\n```javascript\n// Stream from utf8 to hex to base64... Why not, ay.\nvar hex64Stream = fs.createReadStream('myFile')\n .pipe(strs('utf8', 'hex'))\n .pipe(strs('hex', 'base64'))\n```\n\nAlso deals with `base64` output correctly by aligning each emitted data\nchunk so that there are no dangling `=` characters:\n\n```javascript\nvar stream = fs.createReadStream('myFile').pipe(strs('base64'))\n\nvar base64Str = ''\n\nstream.on('data', function(data) { base64Str += data })\nstream.on('end', function() {\n console.log('My base64 encoded file is: ' + base64Str) // Wouldn't work with setEncoding()\n console.log('Original file is: ' + new Buffer(base64Str, 'base64'))\n})\n```\n", + "readmeFilename": "README.md", + "_id": "stringstream@0.0.4", + "dist": { + "shasum": "0f0e3423f942960b5692ac324a57dd093bc41a92", + "tarball": "http://registry.npmjs.org/stringstream/-/stringstream-0.0.4.tgz" + }, + "_npmVersion": "1.2.0", + "_npmUser": { + "name": "hichaelmart", + "email": "michael.hart.au@gmail.com" + }, + "maintainers": [ + { + "name": "hichaelmart", + "email": "michael.hart.au@gmail.com" + } + ], + "directories": {}, + "_shasum": "0f0e3423f942960b5692ac324a57dd093bc41a92", + "_from": "stringstream@~0.0.4", + "_resolved": "https://registry.npmjs.org/stringstream/-/stringstream-0.0.4.tgz", + "bugs": { + "url": "https://github.com/mhart/StringStream/issues" + }, + "homepage": "https://github.com/mhart/StringStream", + "scripts": {} +} diff --git a/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/stringstream/stringstream.js b/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/stringstream/stringstream.js new file mode 100644 index 0000000..4ece127 --- /dev/null +++ b/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/stringstream/stringstream.js @@ -0,0 +1,102 @@ +var util = require('util') +var Stream = require('stream') +var StringDecoder = require('string_decoder').StringDecoder + +module.exports = StringStream +module.exports.AlignedStringDecoder = AlignedStringDecoder + +function StringStream(from, to) { + if (!(this instanceof StringStream)) return new StringStream(from, to) + + Stream.call(this) + + if (from == null) from = 'utf8' + + this.readable = this.writable = true + this.paused = false + this.toEncoding = (to == null ? from : to) + this.fromEncoding = (to == null ? '' : from) + this.decoder = new AlignedStringDecoder(this.toEncoding) +} +util.inherits(StringStream, Stream) + +StringStream.prototype.write = function(data) { + if (!this.writable) { + var err = new Error('stream not writable') + err.code = 'EPIPE' + this.emit('error', err) + return false + } + if (this.fromEncoding) { + if (Buffer.isBuffer(data)) data = data.toString() + data = new Buffer(data, this.fromEncoding) + } + var string = this.decoder.write(data) + if (string.length) this.emit('data', string) + return !this.paused +} + +StringStream.prototype.flush = function() { + if (this.decoder.flush) { + var string = this.decoder.flush() + if (string.length) this.emit('data', string) + } +} + +StringStream.prototype.end = function() { + if (!this.writable && !this.readable) return + this.flush() + this.emit('end') + this.writable = this.readable = false + this.destroy() +} + +StringStream.prototype.destroy = function() { + this.decoder = null + this.writable = this.readable = false + this.emit('close') +} + +StringStream.prototype.pause = function() { + this.paused = true +} + +StringStream.prototype.resume = function () { + if (this.paused) this.emit('drain') + this.paused = false +} + +function AlignedStringDecoder(encoding) { + StringDecoder.call(this, encoding) + + switch (this.encoding) { + case 'base64': + this.write = alignedWrite + this.alignedBuffer = new Buffer(3) + this.alignedBytes = 0 + break + } +} +util.inherits(AlignedStringDecoder, StringDecoder) + +AlignedStringDecoder.prototype.flush = function() { + if (!this.alignedBuffer || !this.alignedBytes) return '' + var leftover = this.alignedBuffer.toString(this.encoding, 0, this.alignedBytes) + this.alignedBytes = 0 + return leftover +} + +function alignedWrite(buffer) { + var rem = (this.alignedBytes + buffer.length) % this.alignedBuffer.length + if (!rem && !this.alignedBytes) return buffer.toString(this.encoding) + + var returnBuffer = new Buffer(this.alignedBytes + buffer.length - rem) + + this.alignedBuffer.copy(returnBuffer, 0, 0, this.alignedBytes) + buffer.copy(returnBuffer, this.alignedBytes, 0, buffer.length - rem) + + buffer.copy(this.alignedBuffer, 0, buffer.length - rem, buffer.length) + this.alignedBytes = rem + + return returnBuffer.toString(this.encoding) +} diff --git a/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/tough-cookie/.jshintrc b/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/tough-cookie/.jshintrc new file mode 100644 index 0000000..fb11913 --- /dev/null +++ b/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/tough-cookie/.jshintrc @@ -0,0 +1,70 @@ +{ + "passfail" : false, + "maxerr" : 100, + + "browser" : false, + "node" : true, + "rhino" : false, + "couch" : false, + "wsh" : false, + + "jquery" : false, + "prototypejs" : false, + "mootools" : false, + "dojo" : false, + + "debug" : false, + "devel" : false, + + "esnext" : true, + "strict" : true, + "globalstrict" : true, + + "asi" : false, + "laxbreak" : false, + "bitwise" : true, + "boss" : false, + "curly" : true, + "eqeqeq" : false, + "eqnull" : true, + "evil" : false, + "expr" : false, + "forin" : false, + "immed" : true, + "lastsemic" : true, + "latedef" : false, + "loopfunc" : false, + "noarg" : true, + "regexp" : false, + "regexdash" : false, + "scripturl" : false, + "shadow" : false, + "supernew" : false, + "undef" : true, + "unused" : true, + + "newcap" : true, + "noempty" : true, + "nonew" : true, + "nomen" : false, + "onevar" : false, + "onecase" : true, + "plusplus" : false, + "proto" : false, + "sub" : true, + "trailing" : true, + "white" : false, + + "predef": [ + "describe", + "it", + "before", + "beforeEach", + "after", + "afterEach", + "expect", + "setTimeout", + "clearTimeout" + ], + "maxlen": 0 +} diff --git a/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/tough-cookie/.npmignore b/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/tough-cookie/.npmignore new file mode 100644 index 0000000..54efff9 --- /dev/null +++ b/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/tough-cookie/.npmignore @@ -0,0 +1,3 @@ +node_modules/ +.*.sw[nmop] +npm-debug.log diff --git a/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/tough-cookie/.travis.yml b/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/tough-cookie/.travis.yml new file mode 100644 index 0000000..5d89265 --- /dev/null +++ b/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/tough-cookie/.travis.yml @@ -0,0 +1,8 @@ +language: node_js +node_js: +- "0.10" +- "0.11" +matrix: + fast_finish: true + allow_failures: + - node_js: 0.11 diff --git a/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/tough-cookie/LICENSE b/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/tough-cookie/LICENSE new file mode 100644 index 0000000..3fac4c8 --- /dev/null +++ b/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/tough-cookie/LICENSE @@ -0,0 +1,78 @@ +Copyright GoInstant, Inc. and other 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. + +The following exceptions apply: + +=== + +`pubSufTest()` of generate-pubsuffix.js is in the public domain. + + // Any copyright is dedicated to the Public Domain. + // http://creativecommons.org/publicdomain/zero/1.0/ + +=== + +`public-suffix.txt` was obtained from + +via . + +That file contains the usual Mozilla triple-license, for which this project uses it +under the terms of the MPL 1.1: + + // ***** BEGIN LICENSE BLOCK ***** + // Version: MPL 1.1/GPL 2.0/LGPL 2.1 + // + // The contents of this file are subject to the Mozilla Public License Version + // 1.1 (the "License"); you may not use this file except in compliance with + // the License. You may obtain a copy of the License at + // http://www.mozilla.org/MPL/ + // + // Software distributed under the License is distributed on an "AS IS" basis, + // WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + // for the specific language governing rights and limitations under the + // License. + // + // The Original Code is the Public Suffix List. + // + // The Initial Developer of the Original Code is + // Jo Hermans . + // Portions created by the Initial Developer are Copyright (C) 2007 + // the Initial Developer. All Rights Reserved. + // + // Contributor(s): + // Ruben Arakelyan + // Gervase Markham + // Pamela Greene + // David Triendl + // Jothan Frakes + // The kind representatives of many TLD registries + // + // Alternatively, the contents of this file may be used under the terms of + // either the GNU General Public License Version 2 or later (the "GPL"), or + // the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), + // in which case the provisions of the GPL or the LGPL are applicable instead + // of those above. If you wish to allow use of your version of this file only + // under the terms of either the GPL or the LGPL, and not to allow others to + // use your version of this file under the terms of the MPL, indicate your + // decision by deleting the provisions above and replace them with the notice + // and other provisions required by the GPL or the LGPL. If you do not delete + // the provisions above, a recipient may use your version of this file under + // the terms of any one of the MPL, the GPL or the LGPL. + // + // ***** END LICENSE BLOCK ***** diff --git a/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/tough-cookie/README.md b/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/tough-cookie/README.md new file mode 100644 index 0000000..9e6caee --- /dev/null +++ b/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/tough-cookie/README.md @@ -0,0 +1,412 @@ +[RFC6265](http://tools.ietf.org/html/rfc6265) Cookies and CookieJar for Node.js + +![Tough Cookie](http://www.goinstant.com.s3.amazonaws.com/tough-cookie.jpg) + +[![Build Status](https://travis-ci.org/goinstant/node-cookie.png?branch=master)](https://travis-ci.org/goinstant/node-cookie) + +[![NPM Stats](https://nodei.co/npm/tough-cookie.png?downloads=true&stars=true)](https://npmjs.org/package/tough-cookie) +![NPM Downloads](https://nodei.co/npm-dl/tough-cookie.png?months=9) + +# Synopsis + +``` javascript +var tough = require('tough-cookie'); // note: not 'cookie', 'cookies' or 'node-cookie' +var Cookie = tough.Cookie; +var cookie = Cookie.parse(header); +cookie.value = 'somethingdifferent'; +header = cookie.toString(); + +var cookiejar = new tough.CookieJar(); +cookiejar.setCookie(cookie, 'http://currentdomain.example.com/path', cb); +// ... +cookiejar.getCookies('http://example.com/otherpath',function(err,cookies) { + res.headers['cookie'] = cookies.join('; '); +}); +``` + +# Installation + +It's _so_ easy! + +`npm install tough-cookie` + +Requires `punycode`, which should get installed automatically for you. Note that node.js v0.6.2+ bundles punycode by default. + +Why the name? NPM modules `cookie`, `cookies` and `cookiejar` were already taken. + +# API + +tough +===== + +Functions on the module you get from `require('tough-cookie')`. All can be used as pure functions and don't need to be "bound". + +parseDate(string[,strict]) +----------------- + +Parse a cookie date string into a `Date`. Parses according to RFC6265 Section 5.1.1, not `Date.parse()`. If strict is set to true then leading/trailing non-seperator characters around the time part will cause the parsing to fail (e.g. "Thu, 01 Jan 1970 00:00:010 GMT" has an extra trailing zero but Chrome, an assumedly RFC-compliant browser, treats this as valid). + +formatDate(date) +---------------- + +Format a Date into a RFC1123 string (the RFC6265-recommended format). + +canonicalDomain(str) +-------------------- + +Transforms a domain-name into a canonical domain-name. The canonical domain-name is a trimmed, lowercased, stripped-of-leading-dot and optionally punycode-encoded domain-name (Section 5.1.2 of RFC6265). For the most part, this function is idempotent (can be run again on its output without ill effects). + +domainMatch(str,domStr[,canonicalize=true]) +------------------------------------------- + +Answers "does this real domain match the domain in a cookie?". The `str` is the "current" domain-name and the `domStr` is the "cookie" domain-name. Matches according to RFC6265 Section 5.1.3, but it helps to think of it as a "suffix match". + +The `canonicalize` parameter will run the other two paramters through `canonicalDomain` or not. + +defaultPath(path) +----------------- + +Given a current request/response path, gives the Path apropriate for storing in a cookie. This is basically the "directory" of a "file" in the path, but is specified by Section 5.1.4 of the RFC. + +The `path` parameter MUST be _only_ the pathname part of a URI (i.e. excludes the hostname, query, fragment, etc.). This is the `.pathname` property of node's `uri.parse()` output. + +pathMatch(reqPath,cookiePath) +----------------------------- + +Answers "does the request-path path-match a given cookie-path?" as per RFC6265 Section 5.1.4. Returns a boolean. + +This is essentially a prefix-match where `cookiePath` is a prefix of `reqPath`. + +parse(header[,strict=false]) +---------------------------- + +alias for `Cookie.parse(header[,strict])` + +fromJSON(string) +---------------- + +alias for `Cookie.fromJSON(string)` + +getPublicSuffix(hostname) +------------------------- + +Returns the public suffix of this hostname. The public suffix is the shortest domain-name upon which a cookie can be set. Returns `null` if the hostname cannot have cookies set for it. + +For example: `www.example.com` and `www.subdomain.example.com` both have public suffix `example.com`. + +For further information, see http://publicsuffix.org/. This module derives its list from that site. + +cookieCompare(a,b) +------------------ + +For use with `.sort()`, sorts a list of cookies into the recommended order given in the RFC (Section 5.4 step 2). Longest `.path`s go first, then sorted oldest to youngest. + +``` javascript +var cookies = [ /* unsorted array of Cookie objects */ ]; +cookies = cookies.sort(cookieCompare); +``` + +permuteDomain(domain) +--------------------- + +Generates a list of all possible domains that `domainMatch()` the parameter. May be handy for implementing cookie stores. + + +permutePath(path) +----------------- + +Generates a list of all possible paths that `pathMatch()` the parameter. May be handy for implementing cookie stores. + +Cookie +====== + +Cookie.parse(header[,strict=false]) +----------------------------------- + +Parses a single Cookie or Set-Cookie HTTP header into a `Cookie` object. Returns `undefined` if the string can't be parsed. If in strict mode, returns `undefined` if the cookie doesn't follow the guidelines in section 4 of RFC6265. Generally speaking, strict mode can be used to validate your own generated Set-Cookie headers, but acting as a client you want to be lenient and leave strict mode off. + +Here's how to process the Set-Cookie header(s) on a node HTTP/HTTPS response: + +``` javascript +if (res.headers['set-cookie'] instanceof Array) + cookies = res.headers['set-cookie'].map(function (c) { return (Cookie.parse(c)); }); +else + cookies = [Cookie.parse(res.headers['set-cookie'])]; +``` + +Cookie.fromJSON(string) +----------------------- + +Convert a JSON string to a `Cookie` object. Does a `JSON.parse()` and converts the `.created`, `.lastAccessed` and `.expires` properties into `Date` objects. + +Properties +========== + + * _key_ - string - the name or key of the cookie (default "") + * _value_ - string - the value of the cookie (default "") + * _expires_ - `Date` - if set, the `Expires=` attribute of the cookie (defaults to the string `"Infinity"`). See `setExpires()` + * _maxAge_ - seconds - if set, the `Max-Age=` attribute _in seconds_ of the cookie. May also be set to strings `"Infinity"` and `"-Infinity"` for non-expiry and immediate-expiry, respectively. See `setMaxAge()` + * _domain_ - string - the `Domain=` attribute of the cookie + * _path_ - string - the `Path=` of the cookie + * _secure_ - boolean - the `Secure` cookie flag + * _httpOnly_ - boolean - the `HttpOnly` cookie flag + * _extensions_ - `Array` - any unrecognized cookie attributes as strings (even if equal-signs inside) + +After a cookie has been passed through `CookieJar.setCookie()` it will have the following additional attributes: + + * _hostOnly_ - boolean - is this a host-only cookie (i.e. no Domain field was set, but was instead implied) + * _pathIsDefault_ - boolean - if true, there was no Path field on the cookie and `defaultPath()` was used to derive one. + * _created_ - `Date` - when this cookie was added to the jar + * _lastAccessed_ - `Date` - last time the cookie got accessed. Will affect cookie cleaning once implemented. Using `cookiejar.getCookies(...)` will update this attribute. + +Construction([{options}]) +------------ + +Receives an options object that can contain any Cookie properties, uses the default for unspecified properties. + +.toString() +----------- + +encode to a Set-Cookie header value. The Expires cookie field is set using `formatDate()`, but is omitted entirely if `.expires` is `Infinity`. + +.cookieString() +--------------- + +encode to a Cookie header value (i.e. the `.key` and `.value` properties joined with '='). + +.setExpires(String) +------------------- + +sets the expiry based on a date-string passed through `parseDate()`. If parseDate returns `null` (i.e. can't parse this date string), `.expires` is set to `"Infinity"` (a string) is set. + +.setMaxAge(number) +------------------- + +sets the maxAge in seconds. Coerces `-Infinity` to `"-Infinity"` and `Infinity` to `"Infinity"` so it JSON serializes correctly. + +.expiryTime([now=Date.now()]) +----------------------------- + +.expiryDate([now=Date.now()]) +----------------------------- + +expiryTime() Computes the absolute unix-epoch milliseconds that this cookie expires. expiryDate() works similarly, except it returns a `Date` object. Note that in both cases the `now` parameter should be milliseconds. + +Max-Age takes precedence over Expires (as per the RFC). The `.created` attribute -- or, by default, the `now` paramter -- is used to offset the `.maxAge` attribute. + +If Expires (`.expires`) is set, that's returned. + +Otherwise, `expiryTime()` returns `Infinity` and `expiryDate()` returns a `Date` object for "Tue, 19 Jan 2038 03:14:07 GMT" (latest date that can be expressed by a 32-bit `time_t`; the common limit for most user-agents). + +.TTL([now=Date.now()]) +--------- + +compute the TTL relative to `now` (milliseconds). The same precedence rules as for `expiryTime`/`expiryDate` apply. + +The "number" `Infinity` is returned for cookies without an explicit expiry and `0` is returned if the cookie is expired. Otherwise a time-to-live in milliseconds is returned. + +.canonicalizedDoman() +--------------------- + +.cdomain() +---------- + +return the canonicalized `.domain` field. This is lower-cased and punycode (RFC3490) encoded if the domain has any non-ASCII characters. + +.validate() +----------- + +Status: *IN PROGRESS*. Works for a few things, but is by no means comprehensive. + +validates cookie attributes for semantic correctness. Useful for "lint" checking any Set-Cookie headers you generate. For now, it returns a boolean, but eventually could return a reason string -- you can future-proof with this construct: + +``` javascript +if (cookie.validate() === true) { + // it's tasty +} else { + // yuck! +} +``` + +CookieJar +========= + +Construction([store = new MemoryCookieStore()][, rejectPublicSuffixes]) +------------ + +Simply use `new CookieJar()`. If you'd like to use a custom store, pass that to the constructor otherwise a `MemoryCookieStore` will be created and used. + + +Attributes +---------- + + * _rejectPublicSuffixes_ - boolean - reject cookies with domains like "com" and "co.uk" (default: `true`) + +Since eventually this module would like to support database/remote/etc. CookieJars, continuation passing style is used for CookieJar methods. + +.setCookie(cookieOrString, currentUrl, [{options},] cb(err,cookie)) +------------------------------------------------------------------- + +Attempt to set the cookie in the cookie jar. If the operation fails, an error will be given to the callback `cb`, otherwise the cookie is passed through. The cookie will have updated `.created`, `.lastAccessed` and `.hostOnly` properties. + +The `options` object can be omitted and can have the following properties: + + * _http_ - boolean - default `true` - indicates if this is an HTTP or non-HTTP API. Affects HttpOnly cookies. + * _secure_ - boolean - autodetect from url - indicates if this is a "Secure" API. If the currentUrl starts with `https:` or `wss:` then this is defaulted to `true`, otherwise `false`. + * _now_ - Date - default `new Date()` - what to use for the creation/access time of cookies + * _strict_ - boolean - default `false` - perform extra checks + * _ignoreError_ - boolean - default `false` - silently ignore things like parse errors and invalid domains. CookieStore errors aren't ignored by this option. + +As per the RFC, the `.hostOnly` property is set if there was no "Domain=" parameter in the cookie string (or `.domain` was null on the Cookie object). The `.domain` property is set to the fully-qualified hostname of `currentUrl` in this case. Matching this cookie requires an exact hostname match (not a `domainMatch` as per usual). + +.setCookieSync(cookieOrString, currentUrl, [{options}]) +------------------------------------------------------- + +Synchronous version of `setCookie`; only works with synchronous stores (e.g. the default `MemoryCookieStore`). + +.storeCookie(cookie, [{options},] cb(err,cookie)) +------------------------------------------------- + +__REMOVED__ removed in lieu of the CookieStore API below + +.getCookies(currentUrl, [{options},] cb(err,cookies)) +----------------------------------------------------- + +Retrieve the list of cookies that can be sent in a Cookie header for the current url. + +If an error is encountered, that's passed as `err` to the callback, otherwise an `Array` of `Cookie` objects is passed. The array is sorted with `cookieCompare()` unless the `{sort:false}` option is given. + +The `options` object can be omitted and can have the following properties: + + * _http_ - boolean - default `true` - indicates if this is an HTTP or non-HTTP API. Affects HttpOnly cookies. + * _secure_ - boolean - autodetect from url - indicates if this is a "Secure" API. If the currentUrl starts with `https:` or `wss:` then this is defaulted to `true`, otherwise `false`. + * _now_ - Date - default `new Date()` - what to use for the creation/access time of cookies + * _expire_ - boolean - default `true` - perform expiry-time checking of cookies and asynchronously remove expired cookies from the store. Using `false` will return expired cookies and **not** remove them from the store (which is useful for replaying Set-Cookie headers, potentially). + * _allPaths_ - boolean - default `false` - if `true`, do not scope cookies by path. The default uses RFC-compliant path scoping. **Note**: may not be supported by the CookieStore `fetchCookies` function (the default MemoryCookieStore supports it). + +The `.lastAccessed` property of the returned cookies will have been updated. + +.getCookiesSync(currentUrl, [{options}]) +---------------------------------------- + +Synchronous version of `getCookies`; only works with synchronous stores (e.g. the default `MemoryCookieStore`). + +.getCookieString(...) +--------------------- + +Accepts the same options as `.getCookies()` but passes a string suitable for a Cookie header rather than an array to the callback. Simply maps the `Cookie` array via `.cookieString()`. + +.getCookieStringSync(...) +------------------------- + +Synchronous version of `getCookieString`; only works with synchronous stores (e.g. the default `MemoryCookieStore`). + +.getSetCookieStrings(...) +------------------------- + +Returns an array of strings suitable for **Set-Cookie** headers. Accepts the same options as `.getCookies()`. Simply maps the cookie array via `.toString()`. + +.getSetCookieStringsSync(...) +----------------------------- + +Synchronous version of `getSetCookieStrings`; only works with synchronous stores (e.g. the default `MemoryCookieStore`). + +Store +===== + +Base class for CookieJar stores. + +# CookieStore API + +The storage model for each `CookieJar` instance can be replaced with a custom implementation. The default is `MemoryCookieStore` which can be found in the `lib/memstore.js` file. The API uses continuation-passing-style to allow for asynchronous stores. + +Stores should inherit from the base `Store` class, which is available as `require('tough-cookie').Store`. Stores are asynchronous by default, but if `store.synchronous` is set, then the `*Sync` methods on the CookieJar can be used. + +All `domain` parameters will have been normalized before calling. + +The Cookie store must have all of the following methods. + +store.findCookie(domain, path, key, cb(err,cookie)) +--------------------------------------------------- + +Retrieve a cookie with the given domain, path and key (a.k.a. name). The RFC maintains that exactly one of these cookies should exist in a store. If the store is using versioning, this means that the latest/newest such cookie should be returned. + +Callback takes an error and the resulting `Cookie` object. If no cookie is found then `null` MUST be passed instead (i.e. not an error). + +store.findCookies(domain, path, cb(err,cookies)) +------------------------------------------------ + +Locates cookies matching the given domain and path. This is most often called in the context of `cookiejar.getCookies()` above. + +If no cookies are found, the callback MUST be passed an empty array. + +The resulting list will be checked for applicability to the current request according to the RFC (domain-match, path-match, http-only-flag, secure-flag, expiry, etc.), so it's OK to use an optimistic search algorithm when implementing this method. However, the search algorithm used SHOULD try to find cookies that `domainMatch()` the domain and `pathMatch()` the path in order to limit the amount of checking that needs to be done. + +As of version 0.9.12, the `allPaths` option to `cookiejar.getCookies()` above will cause the path here to be `null`. If the path is `null`, path-matching MUST NOT be performed (i.e. domain-matching only). + +store.putCookie(cookie, cb(err)) +-------------------------------- + +Adds a new cookie to the store. The implementation SHOULD replace any existing cookie with the same `.domain`, `.path`, and `.key` properties -- depending on the nature of the implementation, it's possible that between the call to `fetchCookie` and `putCookie` that a duplicate `putCookie` can occur. + +The `cookie` object MUST NOT be modified; the caller will have already updated the `.creation` and `.lastAccessed` properties. + +Pass an error if the cookie cannot be stored. + +store.updateCookie(oldCookie, newCookie, cb(err)) +------------------------------------------------- + +Update an existing cookie. The implementation MUST update the `.value` for a cookie with the same `domain`, `.path` and `.key`. The implementation SHOULD check that the old value in the store is equivalent to `oldCookie` - how the conflict is resolved is up to the store. + +The `.lastAccessed` property will always be different between the two objects and `.created` will always be the same. Stores MAY ignore or defer the `.lastAccessed` change at the cost of affecting how cookies are sorted (or selected for deletion). + +Stores may wish to optimize changing the `.value` of the cookie in the store versus storing a new cookie. If the implementation doesn't define this method a stub that calls `putCookie(newCookie,cb)` will be added to the store object. + +The `newCookie` and `oldCookie` objects MUST NOT be modified. + +Pass an error if the newCookie cannot be stored. + +store.removeCookie(domain, path, key, cb(err)) +---------------------------------------------- + +Remove a cookie from the store (see notes on `findCookie` about the uniqueness constraint). + +The implementation MUST NOT pass an error if the cookie doesn't exist; only pass an error due to the failure to remove an existing cookie. + +store.removeCookies(domain, path, cb(err)) +------------------------------------------ + +Removes matching cookies from the store. The `path` paramter is optional, and if missing means all paths in a domain should be removed. + +Pass an error ONLY if removing any existing cookies failed. + +# TODO + + * _full_ RFC5890/RFC5891 canonicalization for domains in `cdomain()` + * the optional `punycode` requirement implements RFC3492, but RFC6265 requires RFC5891 + * better tests for `validate()`? + +# Copyright and License + +(tl;dr: MIT with some MPL/1.1) + +Copyright 2012- GoInstant, Inc. and other 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. + +Portions may be licensed under different licenses (in particular public-suffix.txt is MPL/1.1); please read the LICENSE file for full details. diff --git a/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/tough-cookie/generate-pubsuffix.js b/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/tough-cookie/generate-pubsuffix.js new file mode 100644 index 0000000..74d76aa --- /dev/null +++ b/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/tough-cookie/generate-pubsuffix.js @@ -0,0 +1,239 @@ +/* + * Copyright GoInstant, Inc. and other 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. + */ +'use strict'; +var fs = require('fs'); +var assert = require('assert'); +var punycode = require('punycode'); + +fs.readFile('./public-suffix.txt', 'utf8', function(err,string) { + if (err) { + throw err; + } + var lines = string.split("\n"); + process.nextTick(function() { + processList(lines); + }); +}); + +var index = {}; + +var COMMENT = new RegExp('//.+'); +function processList(lines) { + while (lines.length) { + var line = lines.shift(); + line = line.replace(COMMENT,'').trim(); + if (!line) { + continue; + } + addToIndex(index,line); + } + + pubSufTest(); + + var w = fs.createWriteStream('./lib/pubsuffix.js',{ + flags: 'w', + encoding: 'utf8', + mode: parseInt('644',8) + }); + w.on('end', process.exit); + w.write("/****************************************************\n"); + w.write(" * AUTOMATICALLY GENERATED by generate-pubsuffix.js *\n"); + w.write(" * DO NOT EDIT! *\n"); + w.write(" ****************************************************/\n\n"); + + w.write("module.exports.getPublicSuffix = "); + w.write(getPublicSuffix.toString()); + w.write(";\n\n"); + + w.write("// The following generated structure is used under the MPL version 1.1\n"); + w.write("// See public-suffix.txt for more information\n\n"); + w.write("var index = module.exports.index = Object.freeze(\n"); + w.write(JSON.stringify(index)); + w.write(");\n\n"); + w.write("// END of automatically generated file\n"); + + w.end(); +} + +function addToIndex(index,line) { + var prefix = ''; + if (line.replace(/^(!|\*\.)/)) { + prefix = RegExp.$1; + line = line.slice(prefix.length); + } + line = prefix + punycode.toASCII(line); + + if (line.substr(0,1) == '!') { + index[line.substr(1)] = false; + } else { + index[line] = true; + } +} + +// include the licence in the function since it gets written to pubsuffix.js +function getPublicSuffix(domain) { + /* + * Copyright GoInstant, Inc. and other 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. + */ + if (!domain) { + return null; + } + if (domain.match(/^\./)) { + return null; + } + + domain = domain.toLowerCase(); + var parts = domain.split('.').reverse(); + + var suffix = ''; + var suffixLen = 0; + for (var i=0; i suffixLen) { + return parts.slice(0,suffixLen+1).reverse().join('.'); + } + + return null; +} + +function checkPublicSuffix(give,get) { + var got = getPublicSuffix(give); + assert.equal(got, get, give+' should be '+(get==null?'NULL':get)+' but got '+got); +} + +// pubSufTest() was converted to JavaScript from http://publicsuffix.org/list/test.txt +function pubSufTest() { + // For this function-scope and this function-scope ONLY: + // Any copyright is dedicated to the Public Domain. + // http://creativecommons.org/publicdomain/zero/1.0/ + + // NULL input. + checkPublicSuffix(null, null); + // Mixed case. + checkPublicSuffix('COM', null); + checkPublicSuffix('example.COM', 'example.com'); + checkPublicSuffix('WwW.example.COM', 'example.com'); + // Leading dot. + checkPublicSuffix('.com', null); + checkPublicSuffix('.example', null); + checkPublicSuffix('.example.com', null); + checkPublicSuffix('.example.example', null); + // Unlisted TLD. + checkPublicSuffix('example', null); + checkPublicSuffix('example.example', null); + checkPublicSuffix('b.example.example', null); + checkPublicSuffix('a.b.example.example', null); + // Listed, but non-Internet, TLD. + checkPublicSuffix('local', null); + checkPublicSuffix('example.local', null); + checkPublicSuffix('b.example.local', null); + checkPublicSuffix('a.b.example.local', null); + // TLD with only 1 rule. + checkPublicSuffix('biz', null); + checkPublicSuffix('domain.biz', 'domain.biz'); + checkPublicSuffix('b.domain.biz', 'domain.biz'); + checkPublicSuffix('a.b.domain.biz', 'domain.biz'); + // TLD with some 2-level rules. + checkPublicSuffix('com', null); + checkPublicSuffix('example.com', 'example.com'); + checkPublicSuffix('b.example.com', 'example.com'); + checkPublicSuffix('a.b.example.com', 'example.com'); + checkPublicSuffix('uk.com', null); + checkPublicSuffix('example.uk.com', 'example.uk.com'); + checkPublicSuffix('b.example.uk.com', 'example.uk.com'); + checkPublicSuffix('a.b.example.uk.com', 'example.uk.com'); + checkPublicSuffix('test.ac', 'test.ac'); + // TLD with only 1 (wildcard) rule. + checkPublicSuffix('cy', null); + checkPublicSuffix('c.cy', null); + checkPublicSuffix('b.c.cy', 'b.c.cy'); + checkPublicSuffix('a.b.c.cy', 'b.c.cy'); + // More complex TLD. + checkPublicSuffix('jp', null); + checkPublicSuffix('test.jp', 'test.jp'); + checkPublicSuffix('www.test.jp', 'test.jp'); + checkPublicSuffix('ac.jp', null); + checkPublicSuffix('test.ac.jp', 'test.ac.jp'); + checkPublicSuffix('www.test.ac.jp', 'test.ac.jp'); + checkPublicSuffix('kyoto.jp', null); + checkPublicSuffix('c.kyoto.jp', null); + checkPublicSuffix('b.c.kyoto.jp', 'b.c.kyoto.jp'); + checkPublicSuffix('a.b.c.kyoto.jp', 'b.c.kyoto.jp'); + checkPublicSuffix('pref.kyoto.jp', 'pref.kyoto.jp'); // Exception rule. + checkPublicSuffix('www.pref.kyoto.jp', 'pref.kyoto.jp'); // Exception rule. + checkPublicSuffix('city.kyoto.jp', 'city.kyoto.jp'); // Exception rule. + checkPublicSuffix('www.city.kyoto.jp', 'city.kyoto.jp'); // Exception rule. + // TLD with a wildcard rule and exceptions. + checkPublicSuffix('om', null); + checkPublicSuffix('test.om', null); + checkPublicSuffix('b.test.om', 'b.test.om'); + checkPublicSuffix('a.b.test.om', 'b.test.om'); + checkPublicSuffix('songfest.om', 'songfest.om'); + checkPublicSuffix('www.songfest.om', 'songfest.om'); + // US K12. + checkPublicSuffix('us', null); + checkPublicSuffix('test.us', 'test.us'); + checkPublicSuffix('www.test.us', 'test.us'); + checkPublicSuffix('ak.us', null); + checkPublicSuffix('test.ak.us', 'test.ak.us'); + checkPublicSuffix('www.test.ak.us', 'test.ak.us'); + checkPublicSuffix('k12.ak.us', null); + checkPublicSuffix('test.k12.ak.us', 'test.k12.ak.us'); + checkPublicSuffix('www.test.k12.ak.us', 'test.k12.ak.us'); + + +} diff --git a/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/tough-cookie/lib/cookie.js b/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/tough-cookie/lib/cookie.js new file mode 100644 index 0000000..c93e927 --- /dev/null +++ b/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/tough-cookie/lib/cookie.js @@ -0,0 +1,1107 @@ +/* + * Copyright GoInstant, Inc. and other 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. + */ + +'use strict'; +var net = require('net'); +var urlParse = require('url').parse; +var pubsuffix = require('./pubsuffix'); +var Store = require('./store').Store; + +var punycode; +try { + punycode = require('punycode'); +} catch(e) { + console.warn("cookie: can't load punycode; won't use punycode for domain normalization"); +} + +var DATE_DELIM = /[\x09\x20-\x2F\x3B-\x40\x5B-\x60\x7B-\x7E]/; + +// From RFC2616 S2.2: +var TOKEN = /[\x21\x23-\x26\x2A\x2B\x2D\x2E\x30-\x39\x41-\x5A\x5E-\x7A\x7C\x7E]/; + +// From RFC6265 S4.1.1 +// note that it excludes \x3B ";" +var COOKIE_OCTET = /[\x21\x23-\x2B\x2D-\x3A\x3C-\x5B\x5D-\x7E]/; +var COOKIE_OCTETS = new RegExp('^'+COOKIE_OCTET.source+'$'); + +// The name/key cannot be empty but the value can (S5.2): +var COOKIE_PAIR_STRICT = new RegExp('^('+TOKEN.source+'+)=("?)('+COOKIE_OCTET.source+'*)\\2$'); +var COOKIE_PAIR = /^([^=\s]+)\s*=\s*("?)\s*(.*)\s*\2\s*$/; + +// RFC6265 S4.1.1 defines extension-av as 'any CHAR except CTLs or ";"' +// Note ';' is \x3B +var NON_CTL_SEMICOLON = /[\x20-\x3A\x3C-\x7E]+/; +var EXTENSION_AV = NON_CTL_SEMICOLON; +var PATH_VALUE = NON_CTL_SEMICOLON; + +// Used for checking whether or not there is a trailing semi-colon +var TRAILING_SEMICOLON = /;+$/; + +/* RFC6265 S5.1.1.5: + * [fail if] the day-of-month-value is less than 1 or greater than 31 + */ +var DAY_OF_MONTH = /^(0?[1-9]|[12][0-9]|3[01])$/; + +/* RFC6265 S5.1.1.5: + * [fail if] + * * the hour-value is greater than 23, + * * the minute-value is greater than 59, or + * * the second-value is greater than 59. + */ +var TIME = /(0?[0-9]|1[0-9]|2[0-3]):([0-5][0-9]):([0-5][0-9])/; +var STRICT_TIME = /^(0?[0-9]|1[0-9]|2[0-3]):([0-5][0-9]):([0-5][0-9])$/; + +var MONTH = /^(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)$/i; +var MONTH_TO_NUM = { + jan:0, feb:1, mar:2, apr:3, may:4, jun:5, + jul:6, aug:7, sep:8, oct:9, nov:10, dec:11 +}; +var NUM_TO_MONTH = [ + 'Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec' +]; +var NUM_TO_DAY = [ + 'Sun','Mon','Tue','Wed','Thu','Fri','Sat' +]; + +var YEAR = /^([1-9][0-9]{1,3})$/; // 2 to 4 digits + +var MAX_TIME = 2147483647000; // 31-bit max +var MIN_TIME = 0; // 31-bit min + + +// RFC6265 S5.1.1 date parser: +function parseDate(str,strict) { + if (!str) { + return; + } + var found_time, found_dom, found_month, found_year; + + /* RFC6265 S5.1.1: + * 2. Process each date-token sequentially in the order the date-tokens + * appear in the cookie-date + */ + var tokens = str.split(DATE_DELIM); + if (!tokens) { + return; + } + + var date = new Date(); + date.setMilliseconds(0); + + for (var i=0; i= 10 ? d : '0'+d; + var h = date.getUTCHours(); h = h >= 10 ? h : '0'+h; + var m = date.getUTCMinutes(); m = m >= 10 ? m : '0'+m; + var s = date.getUTCSeconds(); s = s >= 10 ? s : '0'+s; + return NUM_TO_DAY[date.getUTCDay()] + ', ' + + d+' '+ NUM_TO_MONTH[date.getUTCMonth()] +' '+ date.getUTCFullYear() +' '+ + h+':'+m+':'+s+' GMT'; +} + +// S5.1.2 Canonicalized Host Names +function canonicalDomain(str) { + if (str == null) { + return null; + } + str = str.trim().replace(/^\./,''); // S4.1.2.3 & S5.2.3: ignore leading . + + // convert to IDN if any non-ASCII characters + if (punycode && /[^\u0001-\u007f]/.test(str)) { + str = punycode.toASCII(str); + } + + return str.toLowerCase(); +} + +// S5.1.3 Domain Matching +function domainMatch(str, domStr, canonicalize) { + if (str == null || domStr == null) { + return null; + } + if (canonicalize !== false) { + str = canonicalDomain(str); + domStr = canonicalDomain(domStr); + } + + /* + * "The domain string and the string are identical. (Note that both the + * domain string and the string will have been canonicalized to lower case at + * this point)" + */ + if (str == domStr) { + return true; + } + + /* "All of the following [three] conditions hold:" (order adjusted from the RFC) */ + + /* "* The string is a host name (i.e., not an IP address)." */ + if (net.isIP(str)) { + return false; + } + + /* "* The domain string is a suffix of the string" */ + var idx = str.indexOf(domStr); + if (idx <= 0) { + return false; // it's a non-match (-1) or prefix (0) + } + + // e.g "a.b.c".indexOf("b.c") === 2 + // 5 === 3+2 + if (str.length !== domStr.length + idx) { // it's not a suffix + return false; + } + + /* "* The last character of the string that is not included in the domain + * string is a %x2E (".") character." */ + if (str.substr(idx-1,1) !== '.') { + return false; + } + + return true; +} + + +// RFC6265 S5.1.4 Paths and Path-Match + +/* + * "The user agent MUST use an algorithm equivalent to the following algorithm + * to compute the default-path of a cookie:" + * + * Assumption: the path (and not query part or absolute uri) is passed in. + */ +function defaultPath(path) { + // "2. If the uri-path is empty or if the first character of the uri-path is not + // a %x2F ("/") character, output %x2F ("/") and skip the remaining steps. + if (!path || path.substr(0,1) !== "/") { + return "/"; + } + + // "3. If the uri-path contains no more than one %x2F ("/") character, output + // %x2F ("/") and skip the remaining step." + if (path === "/") { + return path; + } + + var rightSlash = path.lastIndexOf("/"); + if (rightSlash === 0) { + return "/"; + } + + // "4. Output the characters of the uri-path from the first character up to, + // but not including, the right-most %x2F ("/")." + return path.slice(0, rightSlash); +} + +/* + * "A request-path path-matches a given cookie-path if at least one of the + * following conditions holds:" + */ +function pathMatch(reqPath,cookiePath) { + // "o The cookie-path and the request-path are identical." + if (cookiePath === reqPath) { + return true; + } + + var idx = reqPath.indexOf(cookiePath); + if (idx === 0) { + // "o The cookie-path is a prefix of the request-path, and the last + // character of the cookie-path is %x2F ("/")." + if (cookiePath.substr(-1) === "/") { + return true; + } + + // " o The cookie-path is a prefix of the request-path, and the first + // character of the request-path that is not included in the cookie- path + // is a %x2F ("/") character." + if (reqPath.substr(cookiePath.length,1) === "/") { + return true; + } + } + + return false; +} + +function parse(str, strict) { + str = str.trim(); + + // S4.1.1 Trailing semi-colons are not part of the specification. + // If we are not in strict mode we remove the trailing semi-colons. + var semiColonCheck = TRAILING_SEMICOLON.exec(str); + if (semiColonCheck) { + if (strict) { + return; + } + str = str.slice(0, semiColonCheck.index); + } + + // We use a regex to parse the "name-value-pair" part of S5.2 + var firstSemi = str.indexOf(';'); // S5.2 step 1 + var pairRx = strict ? COOKIE_PAIR_STRICT : COOKIE_PAIR; + var result = pairRx.exec(firstSemi === -1 ? str : str.substr(0,firstSemi)); + + // Rx satisfies the "the name string is empty" and "lacks a %x3D ("=")" + // constraints as well as trimming any whitespace. + if (!result) { + return; + } + + var c = new Cookie(); + c.key = result[1]; // the regexp should trim() already + c.value = result[3]; // [2] is quotes or empty-string + + if (firstSemi === -1) { + return c; + } + + // S5.2.3 "unparsed-attributes consist of the remainder of the set-cookie-string + // (including the %x3B (";") in question)." plus later on in the same section + // "discard the first ";" and trim". + var unparsed = str.slice(firstSemi).replace(/^\s*;\s*/,'').trim(); + + // "If the unparsed-attributes string is empty, skip the rest of these + // steps." + if (unparsed.length === 0) { + return c; + } + + /* + * S5.2 says that when looping over the items "[p]rocess the attribute-name + * and attribute-value according to the requirements in the following + * subsections" for every item. Plus, for many of the individual attributes + * in S5.3 it says to use the "attribute-value of the last attribute in the + * cookie-attribute-list". Therefore, in this implementation, we overwrite + * the previous value. + */ + var cookie_avs = unparsed.split(/\s*;\s*/); + while (cookie_avs.length) { + var av = cookie_avs.shift(); + + if (strict && !EXTENSION_AV.test(av)) { + return; + } + + var av_sep = av.indexOf('='); + var av_key, av_value; + if (av_sep === -1) { + av_key = av; + av_value = null; + } else { + av_key = av.substr(0,av_sep); + av_value = av.substr(av_sep+1); + } + + av_key = av_key.trim().toLowerCase(); + if (av_value) { + av_value = av_value.trim(); + } + + switch(av_key) { + case 'expires': // S5.2.1 + if (!av_value) {if(strict){return;}else{break;} } + var exp = parseDate(av_value,strict); + // "If the attribute-value failed to parse as a cookie date, ignore the + // cookie-av." + if (exp == null) { if(strict){return;}else{break;} } + c.expires = exp; + // over and underflow not realistically a concern: V8's getTime() seems to + // store something larger than a 32-bit time_t (even with 32-bit node) + break; + + case 'max-age': // S5.2.2 + if (!av_value) { if(strict){return;}else{break;} } + // "If the first character of the attribute-value is not a DIGIT or a "-" + // character ...[or]... If the remainder of attribute-value contains a + // non-DIGIT character, ignore the cookie-av." + if (!/^-?[0-9]+$/.test(av_value)) { if(strict){return;}else{break;} } + var delta = parseInt(av_value,10); + if (strict && delta <= 0) { + return; // S4.1.1 + } + // "If delta-seconds is less than or equal to zero (0), let expiry-time + // be the earliest representable date and time." + c.setMaxAge(delta); + break; + + case 'domain': // S5.2.3 + // "If the attribute-value is empty, the behavior is undefined. However, + // the user agent SHOULD ignore the cookie-av entirely." + if (!av_value) { if(strict){return;}else{break;} } + // S5.2.3 "Let cookie-domain be the attribute-value without the leading %x2E + // (".") character." + var domain = av_value.trim().replace(/^\./,''); + if (!domain) { if(strict){return;}else{break;} } // see "is empty" above + // "Convert the cookie-domain to lower case." + c.domain = domain.toLowerCase(); + break; + + case 'path': // S5.2.4 + /* + * "If the attribute-value is empty or if the first character of the + * attribute-value is not %x2F ("/"): + * Let cookie-path be the default-path. + * Otherwise: + * Let cookie-path be the attribute-value." + * + * We'll represent the default-path as null since it depends on the + * context of the parsing. + */ + if (!av_value || av_value.substr(0,1) != "/") { + if(strict){return;}else{break;} + } + c.path = av_value; + break; + + case 'secure': // S5.2.5 + /* + * "If the attribute-name case-insensitively matches the string "Secure", + * the user agent MUST append an attribute to the cookie-attribute-list + * with an attribute-name of Secure and an empty attribute-value." + */ + if (av_value != null) { if(strict){return;} } + c.secure = true; + break; + + case 'httponly': // S5.2.6 -- effectively the same as 'secure' + if (av_value != null) { if(strict){return;} } + c.httpOnly = true; + break; + + default: + c.extensions = c.extensions || []; + c.extensions.push(av); + break; + } + } + + // ensure a default date for sorting: + c.creation = new Date(); + return c; +} + +function fromJSON(str) { + if (!str) { + return null; + } + + var obj; + try { + obj = JSON.parse(str); + } catch (e) { + return null; + } + + var c = new Cookie(); + for (var i=0; i 1) { + var lindex = path.lastIndexOf('/'); + if (lindex === 0) { + break; + } + path = path.substr(0,lindex); + permutations.push(path); + } + permutations.push('/'); + return permutations; +} + + +function Cookie (opts) { + if (typeof opts !== "object") { + return; + } + Object.keys(opts).forEach(function (key) { + if (Cookie.prototype.hasOwnProperty(key)) { + this[key] = opts[key] || Cookie.prototype[key]; + } + }.bind(this)); +} + +Cookie.parse = parse; +Cookie.fromJSON = fromJSON; + +Cookie.prototype.key = ""; +Cookie.prototype.value = ""; + +// the order in which the RFC has them: +Cookie.prototype.expires = "Infinity"; // coerces to literal Infinity +Cookie.prototype.maxAge = null; // takes precedence over expires for TTL +Cookie.prototype.domain = null; +Cookie.prototype.path = null; +Cookie.prototype.secure = false; +Cookie.prototype.httpOnly = false; +Cookie.prototype.extensions = null; + +// set by the CookieJar: +Cookie.prototype.hostOnly = null; // boolean when set +Cookie.prototype.pathIsDefault = null; // boolean when set +Cookie.prototype.creation = null; // Date when set; defaulted by Cookie.parse +Cookie.prototype.lastAccessed = null; // Date when set + +var cookieProperties = Object.freeze(Object.keys(Cookie.prototype).map(function(p) { + if (p instanceof Function) { + return; + } + return p; +})); +var numCookieProperties = cookieProperties.length; + +Cookie.prototype.inspect = function inspect() { + var now = Date.now(); + return 'Cookie="'+this.toString() + + '; hostOnly='+(this.hostOnly != null ? this.hostOnly : '?') + + '; aAge='+(this.lastAccessed ? (now-this.lastAccessed.getTime())+'ms' : '?') + + '; cAge='+(this.creation ? (now-this.creation.getTime())+'ms' : '?') + + '"'; +}; + +Cookie.prototype.validate = function validate() { + if (!COOKIE_OCTETS.test(this.value)) { + return false; + } + if (this.expires != Infinity && !(this.expires instanceof Date) && !parseDate(this.expires,true)) { + return false; + } + if (this.maxAge != null && this.maxAge <= 0) { + return false; // "Max-Age=" non-zero-digit *DIGIT + } + if (this.path != null && !PATH_VALUE.test(this.path)) { + return false; + } + + var cdomain = this.cdomain(); + if (cdomain) { + if (cdomain.match(/\.$/)) { + return false; // S4.1.2.3 suggests that this is bad. domainMatch() tests confirm this + } + var suffix = pubsuffix.getPublicSuffix(cdomain); + if (suffix == null) { // it's a public suffix + return false; + } + } + return true; +}; + +Cookie.prototype.setExpires = function setExpires(exp) { + if (exp instanceof Date) { + this.expires = exp; + } else { + this.expires = parseDate(exp) || "Infinity"; + } +}; + +Cookie.prototype.setMaxAge = function setMaxAge(age) { + if (age === Infinity || age === -Infinity) { + this.maxAge = age.toString(); // so JSON.stringify() works + } else { + this.maxAge = age; + } +}; + +// gives Cookie header format +Cookie.prototype.cookieString = function cookieString() { + var val = this.value; + if (val == null) { + val = ''; + } + return this.key+'='+val; +}; + +// gives Set-Cookie header format +Cookie.prototype.toString = function toString() { + var str = this.cookieString(); + + if (this.expires != Infinity) { + if (this.expires instanceof Date) { + str += '; Expires='+formatDate(this.expires); + } else { + str += '; Expires='+this.expires; + } + } + + if (this.maxAge != null && this.maxAge != Infinity) { + str += '; Max-Age='+this.maxAge; + } + + if (this.domain && !this.hostOnly) { + str += '; Domain='+this.domain; + } + if (this.path) { + str += '; Path='+this.path; + } + + if (this.secure) { + str += '; Secure'; + } + if (this.httpOnly) { + str += '; HttpOnly'; + } + if (this.extensions) { + this.extensions.forEach(function(ext) { + str += '; '+ext; + }); + } + + return str; +}; + +// TTL() partially replaces the "expiry-time" parts of S5.3 step 3 (setCookie() +// elsewhere) +// S5.3 says to give the "latest representable date" for which we use Infinity +// For "expired" we use 0 +Cookie.prototype.TTL = function TTL(now) { + /* RFC6265 S4.1.2.2 If a cookie has both the Max-Age and the Expires + * attribute, the Max-Age attribute has precedence and controls the + * expiration date of the cookie. + * (Concurs with S5.3 step 3) + */ + if (this.maxAge != null) { + return this.maxAge<=0 ? 0 : this.maxAge*1000; + } + + var expires = this.expires; + if (expires != Infinity) { + if (!(expires instanceof Date)) { + expires = parseDate(expires) || Infinity; + } + + if (expires == Infinity) { + return Infinity; + } + + return expires.getTime() - (now || Date.now()); + } + + return Infinity; +}; + +// expiryTime() replaces the "expiry-time" parts of S5.3 step 3 (setCookie() +// elsewhere) +Cookie.prototype.expiryTime = function expiryTime(now) { + if (this.maxAge != null) { + var relativeTo = this.creation || now || new Date(); + var age = (this.maxAge <= 0) ? -Infinity : this.maxAge*1000; + return relativeTo.getTime() + age; + } + + if (this.expires == Infinity) { + return Infinity; + } + return this.expires.getTime(); +}; + +// expiryDate() replaces the "expiry-time" parts of S5.3 step 3 (setCookie() +// elsewhere), except it returns a Date +Cookie.prototype.expiryDate = function expiryDate(now) { + var millisec = this.expiryTime(now); + if (millisec == Infinity) { + return new Date(MAX_TIME); + } else if (millisec == -Infinity) { + return new Date(MIN_TIME); + } else { + return new Date(millisec); + } +}; + +// This replaces the "persistent-flag" parts of S5.3 step 3 +Cookie.prototype.isPersistent = function isPersistent() { + return (this.maxAge != null || this.expires != Infinity); +}; + +// Mostly S5.1.2 and S5.2.3: +Cookie.prototype.cdomain = +Cookie.prototype.canonicalizedDomain = function canonicalizedDomain() { + if (this.domain == null) { + return null; + } + return canonicalDomain(this.domain); +}; + + +var memstore; +function CookieJar(store, rejectPublicSuffixes) { + if (rejectPublicSuffixes != null) { + this.rejectPublicSuffixes = rejectPublicSuffixes; + } + + if (!store) { + memstore = memstore || require('./memstore'); + store = new memstore.MemoryCookieStore(); + } + this.store = store; +} +CookieJar.prototype.store = null; +CookieJar.prototype.rejectPublicSuffixes = true; +var CAN_BE_SYNC = []; + +CAN_BE_SYNC.push('setCookie'); +CookieJar.prototype.setCookie = function(cookie, url, options, cb) { + var err; + var context = (url instanceof Object) ? url : urlParse(url); + if (options instanceof Function) { + cb = options; + options = {}; + } + + var host = canonicalDomain(context.hostname); + + // S5.3 step 1 + if (!(cookie instanceof Cookie)) { + cookie = Cookie.parse(cookie, options.strict === true); + } + if (!cookie) { + err = new Error("Cookie failed to parse"); + return cb(options.ignoreError ? null : err); + } + + // S5.3 step 2 + var now = options.now || new Date(); // will assign later to save effort in the face of errors + + // S5.3 step 3: NOOP; persistent-flag and expiry-time is handled by getCookie() + + // S5.3 step 4: NOOP; domain is null by default + + // S5.3 step 5: public suffixes + if (this.rejectPublicSuffixes && cookie.domain) { + var suffix = pubsuffix.getPublicSuffix(cookie.cdomain()); + if (suffix == null) { // e.g. "com" + err = new Error("Cookie has domain set to a public suffix"); + return cb(options.ignoreError ? null : err); + } + } + + // S5.3 step 6: + if (cookie.domain) { + if (!domainMatch(host, cookie.cdomain(), false)) { + err = new Error("Cookie not in this host's domain. Cookie:"+cookie.cdomain()+" Request:"+host); + return cb(options.ignoreError ? null : err); + } + + if (cookie.hostOnly == null) { // don't reset if already set + cookie.hostOnly = false; + } + + } else { + cookie.hostOnly = true; + cookie.domain = host; + } + + // S5.3 step 7: "Otherwise, set the cookie's path to the default-path of the + // request-uri" + if (!cookie.path) { + cookie.path = defaultPath(context.pathname); + cookie.pathIsDefault = true; + } else { + if (cookie.path.length > 1 && cookie.path.substr(-1) == '/') { + cookie.path = cookie.path.slice(0,-1); + } + } + + // S5.3 step 8: NOOP; secure attribute + // S5.3 step 9: NOOP; httpOnly attribute + + // S5.3 step 10 + if (options.http === false && cookie.httpOnly) { + err = new Error("Cookie is HttpOnly and this isn't an HTTP API"); + return cb(options.ignoreError ? null : err); + } + + var store = this.store; + + if (!store.updateCookie) { + store.updateCookie = function(oldCookie, newCookie, cb) { + this.putCookie(newCookie, cb); + }; + } + + function withCookie(err, oldCookie) { + if (err) { + return cb(err); + } + + var next = function(err) { + if (err) { + return cb(err); + } else { + cb(null, cookie); + } + }; + + if (oldCookie) { + // S5.3 step 11 - "If the cookie store contains a cookie with the same name, + // domain, and path as the newly created cookie:" + if (options.http === false && oldCookie.httpOnly) { // step 11.2 + err = new Error("old Cookie is HttpOnly and this isn't an HTTP API"); + return cb(options.ignoreError ? null : err); + } + cookie.creation = oldCookie.creation; // step 11.3 + cookie.lastAccessed = now; + // Step 11.4 (delete cookie) is implied by just setting the new one: + store.updateCookie(oldCookie, cookie, next); // step 12 + + } else { + cookie.creation = cookie.lastAccessed = now; + store.putCookie(cookie, next); // step 12 + } + } + + store.findCookie(cookie.domain, cookie.path, cookie.key, withCookie); +}; + +// RFC6365 S5.4 +CAN_BE_SYNC.push('getCookies'); +CookieJar.prototype.getCookies = function(url, options, cb) { + var context = (url instanceof Object) ? url : urlParse(url); + if (options instanceof Function) { + cb = options; + options = {}; + } + + var host = canonicalDomain(context.hostname); + var path = context.pathname || '/'; + + var secure = options.secure; + if (secure == null && context.protocol && + (context.protocol == 'https:' || context.protocol == 'wss:')) + { + secure = true; + } + + var http = options.http; + if (http == null) { + http = true; + } + + var now = options.now || Date.now(); + var expireCheck = options.expire !== false; + var allPaths = !!options.allPaths; + var store = this.store; + + function matchingCookie(c) { + // "Either: + // The cookie's host-only-flag is true and the canonicalized + // request-host is identical to the cookie's domain. + // Or: + // The cookie's host-only-flag is false and the canonicalized + // request-host domain-matches the cookie's domain." + if (c.hostOnly) { + if (c.domain != host) { + return false; + } + } else { + if (!domainMatch(host, c.domain, false)) { + return false; + } + } + + // "The request-uri's path path-matches the cookie's path." + if (!allPaths && !pathMatch(path, c.path)) { + return false; + } + + // "If the cookie's secure-only-flag is true, then the request-uri's + // scheme must denote a "secure" protocol" + if (c.secure && !secure) { + return false; + } + + // "If the cookie's http-only-flag is true, then exclude the cookie if the + // cookie-string is being generated for a "non-HTTP" API" + if (c.httpOnly && !http) { + return false; + } + + // deferred from S5.3 + // non-RFC: allow retention of expired cookies by choice + if (expireCheck && c.expiryTime() <= now) { + store.removeCookie(c.domain, c.path, c.key, function(){}); // result ignored + return false; + } + + return true; + } + + store.findCookies(host, allPaths ? null : path, function(err,cookies) { + if (err) { + return cb(err); + } + + cookies = cookies.filter(matchingCookie); + + // sorting of S5.4 part 2 + if (options.sort !== false) { + cookies = cookies.sort(cookieCompare); + } + + // S5.4 part 3 + var now = new Date(); + cookies.forEach(function(c) { + c.lastAccessed = now; + }); + // TODO persist lastAccessed + + cb(null,cookies); + }); +}; + +CAN_BE_SYNC.push('getCookieString'); +CookieJar.prototype.getCookieString = function(/*..., cb*/) { + var args = Array.prototype.slice.call(arguments,0); + var cb = args.pop(); + var next = function(err,cookies) { + if (err) { + cb(err); + } else { + cb(null, cookies.map(function(c){ + return c.cookieString(); + }).join('; ')); + } + }; + args.push(next); + this.getCookies.apply(this,args); +}; + +CAN_BE_SYNC.push('getSetCookieStrings'); +CookieJar.prototype.getSetCookieStrings = function(/*..., cb*/) { + var args = Array.prototype.slice.call(arguments,0); + var cb = args.pop(); + var next = function(err,cookies) { + if (err) { + cb(err); + } else { + cb(null, cookies.map(function(c){ + return c.toString(); + })); + } + }; + args.push(next); + this.getCookies.apply(this,args); +}; + +// Use a closure to provide a true imperative API for synchronous stores. +function syncWrap(method) { + return function() { + if (!this.store.synchronous) { + throw new Error('CookieJar store is not synchronous; use async API instead.'); + } + + var args = Array.prototype.slice.call(arguments); + var syncErr, syncResult; + args.push(function syncCb(err, result) { + syncErr = err; + syncResult = result; + }); + this[method].apply(this, args); + + if (syncErr) { + throw syncErr; + } + return syncResult; + }; +} + +// wrap all declared CAN_BE_SYNC methods in the sync wrapper +CAN_BE_SYNC.forEach(function(method) { + CookieJar.prototype[method+'Sync'] = syncWrap(method); +}); + +module.exports = { + CookieJar: CookieJar, + Cookie: Cookie, + Store: Store, + parseDate: parseDate, + formatDate: formatDate, + parse: parse, + fromJSON: fromJSON, + domainMatch: domainMatch, + defaultPath: defaultPath, + pathMatch: pathMatch, + getPublicSuffix: pubsuffix.getPublicSuffix, + cookieCompare: cookieCompare, + permuteDomain: permuteDomain, + permutePath: permutePath, + canonicalDomain: canonicalDomain, +}; diff --git a/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/tough-cookie/lib/memstore.js b/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/tough-cookie/lib/memstore.js new file mode 100644 index 0000000..fc5774c --- /dev/null +++ b/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/tough-cookie/lib/memstore.js @@ -0,0 +1,123 @@ +'use strict'; +var tough = require('./cookie'); +var Store = require('./store').Store; +var permuteDomain = tough.permuteDomain; +var permutePath = tough.permutePath; +var util = require('util'); + +function MemoryCookieStore() { + Store.call(this); + this.idx = {}; +} +util.inherits(MemoryCookieStore, Store); +exports.MemoryCookieStore = MemoryCookieStore; +MemoryCookieStore.prototype.idx = null; +MemoryCookieStore.prototype.synchronous = true; + +// force a default depth: +MemoryCookieStore.prototype.inspect = function() { + return "{ idx: "+util.inspect(this.idx, false, 2)+' }'; +}; + +MemoryCookieStore.prototype.findCookie = function(domain, path, key, cb) { + if (!this.idx[domain]) { + return cb(null,undefined); + } + if (!this.idx[domain][path]) { + return cb(null,undefined); + } + return cb(null,this.idx[domain][path][key]||null); +}; + +MemoryCookieStore.prototype.findCookies = function(domain, path, cb) { + var results = []; + if (!domain) { + return cb(null,[]); + } + + var pathMatcher; + if (!path) { + // null or '/' means "all paths" + pathMatcher = function matchAll(domainIndex) { + for (var curPath in domainIndex) { + var pathIndex = domainIndex[curPath]; + for (var key in pathIndex) { + results.push(pathIndex[key]); + } + } + }; + + } else if (path === '/') { + pathMatcher = function matchSlash(domainIndex) { + var pathIndex = domainIndex['/']; + if (!pathIndex) { + return; + } + for (var key in pathIndex) { + results.push(pathIndex[key]); + } + }; + + } else { + var paths = permutePath(path) || [path]; + pathMatcher = function matchRFC(domainIndex) { + paths.forEach(function(curPath) { + var pathIndex = domainIndex[curPath]; + if (!pathIndex) { + return; + } + for (var key in pathIndex) { + results.push(pathIndex[key]); + } + }); + }; + } + + var domains = permuteDomain(domain) || [domain]; + var idx = this.idx; + domains.forEach(function(curDomain) { + var domainIndex = idx[curDomain]; + if (!domainIndex) { + return; + } + pathMatcher(domainIndex); + }); + + cb(null,results); +}; + +MemoryCookieStore.prototype.putCookie = function(cookie, cb) { + if (!this.idx[cookie.domain]) { + this.idx[cookie.domain] = {}; + } + if (!this.idx[cookie.domain][cookie.path]) { + this.idx[cookie.domain][cookie.path] = {}; + } + this.idx[cookie.domain][cookie.path][cookie.key] = cookie; + cb(null); +}; + +MemoryCookieStore.prototype.updateCookie = function updateCookie(oldCookie, newCookie, cb) { + // updateCookie() may avoid updating cookies that are identical. For example, + // lastAccessed may not be important to some stores and an equality + // comparison could exclude that field. + this.putCookie(newCookie,cb); +}; + +MemoryCookieStore.prototype.removeCookie = function removeCookie(domain, path, key, cb) { + if (this.idx[domain] && this.idx[domain][path] && this.idx[domain][path][key]) { + delete this.idx[domain][path][key]; + } + cb(null); +}; + +MemoryCookieStore.prototype.removeCookies = function removeCookies(domain, path, cb) { + if (this.idx[domain]) { + if (path) { + delete this.idx[domain][path]; + } else { + delete this.idx[domain]; + } + } + return cb(null); +}; diff --git a/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/tough-cookie/lib/pubsuffix.js b/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/tough-cookie/lib/pubsuffix.js new file mode 100644 index 0000000..a703147 --- /dev/null +++ b/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/tough-cookie/lib/pubsuffix.js @@ -0,0 +1,69 @@ +/**************************************************** + * AUTOMATICALLY GENERATED by generate-pubsuffix.js * + * DO NOT EDIT! * + ****************************************************/ + +module.exports.getPublicSuffix = function getPublicSuffix(domain) { + /* + * Copyright GoInstant, Inc. and other 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. + */ + if (!domain) return null; + if (domain.match(/^\./)) return null; + + domain = domain.toLowerCase(); + var parts = domain.split('.').reverse(); + + var suffix = ''; + var suffixLen = 0; + for (var i=0; i suffixLen) { + return parts.slice(0,suffixLen+1).reverse().join('.'); + } + + return null; +}; + +// The following generated structure is used under the MPL version 1.1 +// See public-suffix.txt for more information + +var index = module.exports.index = Object.freeze( +{"ac":true,"com.ac":true,"edu.ac":true,"gov.ac":true,"net.ac":true,"mil.ac":true,"org.ac":true,"ad":true,"nom.ad":true,"ae":true,"co.ae":true,"net.ae":true,"org.ae":true,"sch.ae":true,"ac.ae":true,"gov.ae":true,"mil.ae":true,"aero":true,"accident-investigation.aero":true,"accident-prevention.aero":true,"aerobatic.aero":true,"aeroclub.aero":true,"aerodrome.aero":true,"agents.aero":true,"aircraft.aero":true,"airline.aero":true,"airport.aero":true,"air-surveillance.aero":true,"airtraffic.aero":true,"air-traffic-control.aero":true,"ambulance.aero":true,"amusement.aero":true,"association.aero":true,"author.aero":true,"ballooning.aero":true,"broker.aero":true,"caa.aero":true,"cargo.aero":true,"catering.aero":true,"certification.aero":true,"championship.aero":true,"charter.aero":true,"civilaviation.aero":true,"club.aero":true,"conference.aero":true,"consultant.aero":true,"consulting.aero":true,"control.aero":true,"council.aero":true,"crew.aero":true,"design.aero":true,"dgca.aero":true,"educator.aero":true,"emergency.aero":true,"engine.aero":true,"engineer.aero":true,"entertainment.aero":true,"equipment.aero":true,"exchange.aero":true,"express.aero":true,"federation.aero":true,"flight.aero":true,"freight.aero":true,"fuel.aero":true,"gliding.aero":true,"government.aero":true,"groundhandling.aero":true,"group.aero":true,"hanggliding.aero":true,"homebuilt.aero":true,"insurance.aero":true,"journal.aero":true,"journalist.aero":true,"leasing.aero":true,"logistics.aero":true,"magazine.aero":true,"maintenance.aero":true,"marketplace.aero":true,"media.aero":true,"microlight.aero":true,"modelling.aero":true,"navigation.aero":true,"parachuting.aero":true,"paragliding.aero":true,"passenger-association.aero":true,"pilot.aero":true,"press.aero":true,"production.aero":true,"recreation.aero":true,"repbody.aero":true,"res.aero":true,"research.aero":true,"rotorcraft.aero":true,"safety.aero":true,"scientist.aero":true,"services.aero":true,"show.aero":true,"skydiving.aero":true,"software.aero":true,"student.aero":true,"taxi.aero":true,"trader.aero":true,"trading.aero":true,"trainer.aero":true,"union.aero":true,"workinggroup.aero":true,"works.aero":true,"af":true,"gov.af":true,"com.af":true,"org.af":true,"net.af":true,"edu.af":true,"ag":true,"com.ag":true,"org.ag":true,"net.ag":true,"co.ag":true,"nom.ag":true,"ai":true,"off.ai":true,"com.ai":true,"net.ai":true,"org.ai":true,"al":true,"com.al":true,"edu.al":true,"gov.al":true,"mil.al":true,"net.al":true,"org.al":true,"am":true,"an":true,"com.an":true,"net.an":true,"org.an":true,"edu.an":true,"ao":true,"ed.ao":true,"gv.ao":true,"og.ao":true,"co.ao":true,"pb.ao":true,"it.ao":true,"aq":true,"*.ar":true,"congresodelalengua3.ar":false,"educ.ar":false,"gobiernoelectronico.ar":false,"mecon.ar":false,"nacion.ar":false,"nic.ar":false,"promocion.ar":false,"retina.ar":false,"uba.ar":false,"e164.arpa":true,"in-addr.arpa":true,"ip6.arpa":true,"iris.arpa":true,"uri.arpa":true,"urn.arpa":true,"as":true,"gov.as":true,"asia":true,"at":true,"ac.at":true,"co.at":true,"gv.at":true,"or.at":true,"com.au":true,"net.au":true,"org.au":true,"edu.au":true,"gov.au":true,"csiro.au":true,"asn.au":true,"id.au":true,"info.au":true,"conf.au":true,"oz.au":true,"act.au":true,"nsw.au":true,"nt.au":true,"qld.au":true,"sa.au":true,"tas.au":true,"vic.au":true,"wa.au":true,"act.edu.au":true,"nsw.edu.au":true,"nt.edu.au":true,"qld.edu.au":true,"sa.edu.au":true,"tas.edu.au":true,"vic.edu.au":true,"wa.edu.au":true,"act.gov.au":true,"nt.gov.au":true,"qld.gov.au":true,"sa.gov.au":true,"tas.gov.au":true,"vic.gov.au":true,"wa.gov.au":true,"aw":true,"com.aw":true,"ax":true,"az":true,"com.az":true,"net.az":true,"int.az":true,"gov.az":true,"org.az":true,"edu.az":true,"info.az":true,"pp.az":true,"mil.az":true,"name.az":true,"pro.az":true,"biz.az":true,"ba":true,"org.ba":true,"net.ba":true,"edu.ba":true,"gov.ba":true,"mil.ba":true,"unsa.ba":true,"unbi.ba":true,"co.ba":true,"com.ba":true,"rs.ba":true,"bb":true,"biz.bb":true,"com.bb":true,"edu.bb":true,"gov.bb":true,"info.bb":true,"net.bb":true,"org.bb":true,"store.bb":true,"*.bd":true,"be":true,"ac.be":true,"bf":true,"gov.bf":true,"bg":true,"a.bg":true,"b.bg":true,"c.bg":true,"d.bg":true,"e.bg":true,"f.bg":true,"g.bg":true,"h.bg":true,"i.bg":true,"j.bg":true,"k.bg":true,"l.bg":true,"m.bg":true,"n.bg":true,"o.bg":true,"p.bg":true,"q.bg":true,"r.bg":true,"s.bg":true,"t.bg":true,"u.bg":true,"v.bg":true,"w.bg":true,"x.bg":true,"y.bg":true,"z.bg":true,"0.bg":true,"1.bg":true,"2.bg":true,"3.bg":true,"4.bg":true,"5.bg":true,"6.bg":true,"7.bg":true,"8.bg":true,"9.bg":true,"bh":true,"com.bh":true,"edu.bh":true,"net.bh":true,"org.bh":true,"gov.bh":true,"bi":true,"co.bi":true,"com.bi":true,"edu.bi":true,"or.bi":true,"org.bi":true,"biz":true,"bj":true,"asso.bj":true,"barreau.bj":true,"gouv.bj":true,"bm":true,"com.bm":true,"edu.bm":true,"gov.bm":true,"net.bm":true,"org.bm":true,"*.bn":true,"bo":true,"com.bo":true,"edu.bo":true,"gov.bo":true,"gob.bo":true,"int.bo":true,"org.bo":true,"net.bo":true,"mil.bo":true,"tv.bo":true,"br":true,"adm.br":true,"adv.br":true,"agr.br":true,"am.br":true,"arq.br":true,"art.br":true,"ato.br":true,"b.br":true,"bio.br":true,"blog.br":true,"bmd.br":true,"can.br":true,"cim.br":true,"cng.br":true,"cnt.br":true,"com.br":true,"coop.br":true,"ecn.br":true,"edu.br":true,"emp.br":true,"eng.br":true,"esp.br":true,"etc.br":true,"eti.br":true,"far.br":true,"flog.br":true,"fm.br":true,"fnd.br":true,"fot.br":true,"fst.br":true,"g12.br":true,"ggf.br":true,"gov.br":true,"imb.br":true,"ind.br":true,"inf.br":true,"jor.br":true,"jus.br":true,"lel.br":true,"mat.br":true,"med.br":true,"mil.br":true,"mus.br":true,"net.br":true,"nom.br":true,"not.br":true,"ntr.br":true,"odo.br":true,"org.br":true,"ppg.br":true,"pro.br":true,"psc.br":true,"psi.br":true,"qsl.br":true,"radio.br":true,"rec.br":true,"slg.br":true,"srv.br":true,"taxi.br":true,"teo.br":true,"tmp.br":true,"trd.br":true,"tur.br":true,"tv.br":true,"vet.br":true,"vlog.br":true,"wiki.br":true,"zlg.br":true,"bs":true,"com.bs":true,"net.bs":true,"org.bs":true,"edu.bs":true,"gov.bs":true,"bt":true,"com.bt":true,"edu.bt":true,"gov.bt":true,"net.bt":true,"org.bt":true,"bw":true,"co.bw":true,"org.bw":true,"by":true,"gov.by":true,"mil.by":true,"com.by":true,"of.by":true,"bz":true,"com.bz":true,"net.bz":true,"org.bz":true,"edu.bz":true,"gov.bz":true,"ca":true,"ab.ca":true,"bc.ca":true,"mb.ca":true,"nb.ca":true,"nf.ca":true,"nl.ca":true,"ns.ca":true,"nt.ca":true,"nu.ca":true,"on.ca":true,"pe.ca":true,"qc.ca":true,"sk.ca":true,"yk.ca":true,"gc.ca":true,"cat":true,"cc":true,"cd":true,"gov.cd":true,"cf":true,"cg":true,"ch":true,"ci":true,"org.ci":true,"or.ci":true,"com.ci":true,"co.ci":true,"edu.ci":true,"ed.ci":true,"ac.ci":true,"net.ci":true,"go.ci":true,"asso.ci":true,"xn--aroport-bya.ci":true,"int.ci":true,"presse.ci":true,"md.ci":true,"gouv.ci":true,"*.ck":true,"www.ck":false,"cl":true,"gov.cl":true,"gob.cl":true,"co.cl":true,"mil.cl":true,"cm":true,"gov.cm":true,"cn":true,"ac.cn":true,"com.cn":true,"edu.cn":true,"gov.cn":true,"net.cn":true,"org.cn":true,"mil.cn":true,"xn--55qx5d.cn":true,"xn--io0a7i.cn":true,"xn--od0alg.cn":true,"ah.cn":true,"bj.cn":true,"cq.cn":true,"fj.cn":true,"gd.cn":true,"gs.cn":true,"gz.cn":true,"gx.cn":true,"ha.cn":true,"hb.cn":true,"he.cn":true,"hi.cn":true,"hl.cn":true,"hn.cn":true,"jl.cn":true,"js.cn":true,"jx.cn":true,"ln.cn":true,"nm.cn":true,"nx.cn":true,"qh.cn":true,"sc.cn":true,"sd.cn":true,"sh.cn":true,"sn.cn":true,"sx.cn":true,"tj.cn":true,"xj.cn":true,"xz.cn":true,"yn.cn":true,"zj.cn":true,"hk.cn":true,"mo.cn":true,"tw.cn":true,"co":true,"arts.co":true,"com.co":true,"edu.co":true,"firm.co":true,"gov.co":true,"info.co":true,"int.co":true,"mil.co":true,"net.co":true,"nom.co":true,"org.co":true,"rec.co":true,"web.co":true,"com":true,"coop":true,"cr":true,"ac.cr":true,"co.cr":true,"ed.cr":true,"fi.cr":true,"go.cr":true,"or.cr":true,"sa.cr":true,"cu":true,"com.cu":true,"edu.cu":true,"org.cu":true,"net.cu":true,"gov.cu":true,"inf.cu":true,"cv":true,"cx":true,"gov.cx":true,"*.cy":true,"cz":true,"de":true,"dj":true,"dk":true,"dm":true,"com.dm":true,"net.dm":true,"org.dm":true,"edu.dm":true,"gov.dm":true,"do":true,"art.do":true,"com.do":true,"edu.do":true,"gob.do":true,"gov.do":true,"mil.do":true,"net.do":true,"org.do":true,"sld.do":true,"web.do":true,"dz":true,"com.dz":true,"org.dz":true,"net.dz":true,"gov.dz":true,"edu.dz":true,"asso.dz":true,"pol.dz":true,"art.dz":true,"ec":true,"com.ec":true,"info.ec":true,"net.ec":true,"fin.ec":true,"k12.ec":true,"med.ec":true,"pro.ec":true,"org.ec":true,"edu.ec":true,"gov.ec":true,"gob.ec":true,"mil.ec":true,"edu":true,"ee":true,"edu.ee":true,"gov.ee":true,"riik.ee":true,"lib.ee":true,"med.ee":true,"com.ee":true,"pri.ee":true,"aip.ee":true,"org.ee":true,"fie.ee":true,"eg":true,"com.eg":true,"edu.eg":true,"eun.eg":true,"gov.eg":true,"mil.eg":true,"name.eg":true,"net.eg":true,"org.eg":true,"sci.eg":true,"*.er":true,"es":true,"com.es":true,"nom.es":true,"org.es":true,"gob.es":true,"edu.es":true,"*.et":true,"eu":true,"fi":true,"aland.fi":true,"*.fj":true,"*.fk":true,"fm":true,"fo":true,"fr":true,"com.fr":true,"asso.fr":true,"nom.fr":true,"prd.fr":true,"presse.fr":true,"tm.fr":true,"aeroport.fr":true,"assedic.fr":true,"avocat.fr":true,"avoues.fr":true,"cci.fr":true,"chambagri.fr":true,"chirurgiens-dentistes.fr":true,"experts-comptables.fr":true,"geometre-expert.fr":true,"gouv.fr":true,"greta.fr":true,"huissier-justice.fr":true,"medecin.fr":true,"notaires.fr":true,"pharmacien.fr":true,"port.fr":true,"veterinaire.fr":true,"ga":true,"gd":true,"ge":true,"com.ge":true,"edu.ge":true,"gov.ge":true,"org.ge":true,"mil.ge":true,"net.ge":true,"pvt.ge":true,"gf":true,"gg":true,"co.gg":true,"org.gg":true,"net.gg":true,"sch.gg":true,"gov.gg":true,"gh":true,"com.gh":true,"edu.gh":true,"gov.gh":true,"org.gh":true,"mil.gh":true,"gi":true,"com.gi":true,"ltd.gi":true,"gov.gi":true,"mod.gi":true,"edu.gi":true,"org.gi":true,"gl":true,"gm":true,"ac.gn":true,"com.gn":true,"edu.gn":true,"gov.gn":true,"org.gn":true,"net.gn":true,"gov":true,"gp":true,"com.gp":true,"net.gp":true,"mobi.gp":true,"edu.gp":true,"org.gp":true,"asso.gp":true,"gq":true,"gr":true,"com.gr":true,"edu.gr":true,"net.gr":true,"org.gr":true,"gov.gr":true,"gs":true,"*.gt":true,"www.gt":false,"*.gu":true,"gw":true,"gy":true,"co.gy":true,"com.gy":true,"net.gy":true,"hk":true,"com.hk":true,"edu.hk":true,"gov.hk":true,"idv.hk":true,"net.hk":true,"org.hk":true,"xn--55qx5d.hk":true,"xn--wcvs22d.hk":true,"xn--lcvr32d.hk":true,"xn--mxtq1m.hk":true,"xn--gmqw5a.hk":true,"xn--ciqpn.hk":true,"xn--gmq050i.hk":true,"xn--zf0avx.hk":true,"xn--io0a7i.hk":true,"xn--mk0axi.hk":true,"xn--od0alg.hk":true,"xn--od0aq3b.hk":true,"xn--tn0ag.hk":true,"xn--uc0atv.hk":true,"xn--uc0ay4a.hk":true,"hm":true,"hn":true,"com.hn":true,"edu.hn":true,"org.hn":true,"net.hn":true,"mil.hn":true,"gob.hn":true,"hr":true,"iz.hr":true,"from.hr":true,"name.hr":true,"com.hr":true,"ht":true,"com.ht":true,"shop.ht":true,"firm.ht":true,"info.ht":true,"adult.ht":true,"net.ht":true,"pro.ht":true,"org.ht":true,"med.ht":true,"art.ht":true,"coop.ht":true,"pol.ht":true,"asso.ht":true,"edu.ht":true,"rel.ht":true,"gouv.ht":true,"perso.ht":true,"hu":true,"co.hu":true,"info.hu":true,"org.hu":true,"priv.hu":true,"sport.hu":true,"tm.hu":true,"2000.hu":true,"agrar.hu":true,"bolt.hu":true,"casino.hu":true,"city.hu":true,"erotica.hu":true,"erotika.hu":true,"film.hu":true,"forum.hu":true,"games.hu":true,"hotel.hu":true,"ingatlan.hu":true,"jogasz.hu":true,"konyvelo.hu":true,"lakas.hu":true,"media.hu":true,"news.hu":true,"reklam.hu":true,"sex.hu":true,"shop.hu":true,"suli.hu":true,"szex.hu":true,"tozsde.hu":true,"utazas.hu":true,"video.hu":true,"id":true,"ac.id":true,"co.id":true,"go.id":true,"mil.id":true,"net.id":true,"or.id":true,"sch.id":true,"web.id":true,"ie":true,"gov.ie":true,"*.il":true,"im":true,"co.im":true,"ltd.co.im":true,"plc.co.im":true,"net.im":true,"gov.im":true,"org.im":true,"nic.im":true,"ac.im":true,"in":true,"co.in":true,"firm.in":true,"net.in":true,"org.in":true,"gen.in":true,"ind.in":true,"nic.in":true,"ac.in":true,"edu.in":true,"res.in":true,"gov.in":true,"mil.in":true,"info":true,"int":true,"eu.int":true,"io":true,"com.io":true,"iq":true,"gov.iq":true,"edu.iq":true,"mil.iq":true,"com.iq":true,"org.iq":true,"net.iq":true,"ir":true,"ac.ir":true,"co.ir":true,"gov.ir":true,"id.ir":true,"net.ir":true,"org.ir":true,"sch.ir":true,"xn--mgba3a4f16a.ir":true,"xn--mgba3a4fra.ir":true,"is":true,"net.is":true,"com.is":true,"edu.is":true,"gov.is":true,"org.is":true,"int.is":true,"it":true,"gov.it":true,"edu.it":true,"agrigento.it":true,"ag.it":true,"alessandria.it":true,"al.it":true,"ancona.it":true,"an.it":true,"aosta.it":true,"aoste.it":true,"ao.it":true,"arezzo.it":true,"ar.it":true,"ascoli-piceno.it":true,"ascolipiceno.it":true,"ap.it":true,"asti.it":true,"at.it":true,"avellino.it":true,"av.it":true,"bari.it":true,"ba.it":true,"andria-barletta-trani.it":true,"andriabarlettatrani.it":true,"trani-barletta-andria.it":true,"tranibarlettaandria.it":true,"barletta-trani-andria.it":true,"barlettatraniandria.it":true,"andria-trani-barletta.it":true,"andriatranibarletta.it":true,"trani-andria-barletta.it":true,"traniandriabarletta.it":true,"bt.it":true,"belluno.it":true,"bl.it":true,"benevento.it":true,"bn.it":true,"bergamo.it":true,"bg.it":true,"biella.it":true,"bi.it":true,"bologna.it":true,"bo.it":true,"bolzano.it":true,"bozen.it":true,"balsan.it":true,"alto-adige.it":true,"altoadige.it":true,"suedtirol.it":true,"bz.it":true,"brescia.it":true,"bs.it":true,"brindisi.it":true,"br.it":true,"cagliari.it":true,"ca.it":true,"caltanissetta.it":true,"cl.it":true,"campobasso.it":true,"cb.it":true,"carboniaiglesias.it":true,"carbonia-iglesias.it":true,"iglesias-carbonia.it":true,"iglesiascarbonia.it":true,"ci.it":true,"caserta.it":true,"ce.it":true,"catania.it":true,"ct.it":true,"catanzaro.it":true,"cz.it":true,"chieti.it":true,"ch.it":true,"como.it":true,"co.it":true,"cosenza.it":true,"cs.it":true,"cremona.it":true,"cr.it":true,"crotone.it":true,"kr.it":true,"cuneo.it":true,"cn.it":true,"dell-ogliastra.it":true,"dellogliastra.it":true,"ogliastra.it":true,"og.it":true,"enna.it":true,"en.it":true,"ferrara.it":true,"fe.it":true,"fermo.it":true,"fm.it":true,"firenze.it":true,"florence.it":true,"fi.it":true,"foggia.it":true,"fg.it":true,"forli-cesena.it":true,"forlicesena.it":true,"cesena-forli.it":true,"cesenaforli.it":true,"fc.it":true,"frosinone.it":true,"fr.it":true,"genova.it":true,"genoa.it":true,"ge.it":true,"gorizia.it":true,"go.it":true,"grosseto.it":true,"gr.it":true,"imperia.it":true,"im.it":true,"isernia.it":true,"is.it":true,"laquila.it":true,"aquila.it":true,"aq.it":true,"la-spezia.it":true,"laspezia.it":true,"sp.it":true,"latina.it":true,"lt.it":true,"lecce.it":true,"le.it":true,"lecco.it":true,"lc.it":true,"livorno.it":true,"li.it":true,"lodi.it":true,"lo.it":true,"lucca.it":true,"lu.it":true,"macerata.it":true,"mc.it":true,"mantova.it":true,"mn.it":true,"massa-carrara.it":true,"massacarrara.it":true,"carrara-massa.it":true,"carraramassa.it":true,"ms.it":true,"matera.it":true,"mt.it":true,"medio-campidano.it":true,"mediocampidano.it":true,"campidano-medio.it":true,"campidanomedio.it":true,"vs.it":true,"messina.it":true,"me.it":true,"milano.it":true,"milan.it":true,"mi.it":true,"modena.it":true,"mo.it":true,"monza.it":true,"monza-brianza.it":true,"monzabrianza.it":true,"monzaebrianza.it":true,"monzaedellabrianza.it":true,"monza-e-della-brianza.it":true,"mb.it":true,"napoli.it":true,"naples.it":true,"na.it":true,"novara.it":true,"no.it":true,"nuoro.it":true,"nu.it":true,"oristano.it":true,"or.it":true,"padova.it":true,"padua.it":true,"pd.it":true,"palermo.it":true,"pa.it":true,"parma.it":true,"pr.it":true,"pavia.it":true,"pv.it":true,"perugia.it":true,"pg.it":true,"pescara.it":true,"pe.it":true,"pesaro-urbino.it":true,"pesarourbino.it":true,"urbino-pesaro.it":true,"urbinopesaro.it":true,"pu.it":true,"piacenza.it":true,"pc.it":true,"pisa.it":true,"pi.it":true,"pistoia.it":true,"pt.it":true,"pordenone.it":true,"pn.it":true,"potenza.it":true,"pz.it":true,"prato.it":true,"po.it":true,"ragusa.it":true,"rg.it":true,"ravenna.it":true,"ra.it":true,"reggio-calabria.it":true,"reggiocalabria.it":true,"rc.it":true,"reggio-emilia.it":true,"reggioemilia.it":true,"re.it":true,"rieti.it":true,"ri.it":true,"rimini.it":true,"rn.it":true,"roma.it":true,"rome.it":true,"rm.it":true,"rovigo.it":true,"ro.it":true,"salerno.it":true,"sa.it":true,"sassari.it":true,"ss.it":true,"savona.it":true,"sv.it":true,"siena.it":true,"si.it":true,"siracusa.it":true,"sr.it":true,"sondrio.it":true,"so.it":true,"taranto.it":true,"ta.it":true,"tempio-olbia.it":true,"tempioolbia.it":true,"olbia-tempio.it":true,"olbiatempio.it":true,"ot.it":true,"teramo.it":true,"te.it":true,"terni.it":true,"tr.it":true,"torino.it":true,"turin.it":true,"to.it":true,"trapani.it":true,"tp.it":true,"trento.it":true,"trentino.it":true,"tn.it":true,"treviso.it":true,"tv.it":true,"trieste.it":true,"ts.it":true,"udine.it":true,"ud.it":true,"varese.it":true,"va.it":true,"venezia.it":true,"venice.it":true,"ve.it":true,"verbania.it":true,"vb.it":true,"vercelli.it":true,"vc.it":true,"verona.it":true,"vr.it":true,"vibo-valentia.it":true,"vibovalentia.it":true,"vv.it":true,"vicenza.it":true,"vi.it":true,"viterbo.it":true,"vt.it":true,"je":true,"co.je":true,"org.je":true,"net.je":true,"sch.je":true,"gov.je":true,"*.jm":true,"jo":true,"com.jo":true,"org.jo":true,"net.jo":true,"edu.jo":true,"sch.jo":true,"gov.jo":true,"mil.jo":true,"name.jo":true,"jobs":true,"jp":true,"ac.jp":true,"ad.jp":true,"co.jp":true,"ed.jp":true,"go.jp":true,"gr.jp":true,"lg.jp":true,"ne.jp":true,"or.jp":true,"*.aichi.jp":true,"*.akita.jp":true,"*.aomori.jp":true,"*.chiba.jp":true,"*.ehime.jp":true,"*.fukui.jp":true,"*.fukuoka.jp":true,"*.fukushima.jp":true,"*.gifu.jp":true,"*.gunma.jp":true,"*.hiroshima.jp":true,"*.hokkaido.jp":true,"*.hyogo.jp":true,"*.ibaraki.jp":true,"*.ishikawa.jp":true,"*.iwate.jp":true,"*.kagawa.jp":true,"*.kagoshima.jp":true,"*.kanagawa.jp":true,"*.kawasaki.jp":true,"*.kitakyushu.jp":true,"*.kobe.jp":true,"*.kochi.jp":true,"*.kumamoto.jp":true,"*.kyoto.jp":true,"*.mie.jp":true,"*.miyagi.jp":true,"*.miyazaki.jp":true,"*.nagano.jp":true,"*.nagasaki.jp":true,"*.nagoya.jp":true,"*.nara.jp":true,"*.niigata.jp":true,"*.oita.jp":true,"*.okayama.jp":true,"*.okinawa.jp":true,"*.osaka.jp":true,"*.saga.jp":true,"*.saitama.jp":true,"*.sapporo.jp":true,"*.sendai.jp":true,"*.shiga.jp":true,"*.shimane.jp":true,"*.shizuoka.jp":true,"*.tochigi.jp":true,"*.tokushima.jp":true,"*.tokyo.jp":true,"*.tottori.jp":true,"*.toyama.jp":true,"*.wakayama.jp":true,"*.yamagata.jp":true,"*.yamaguchi.jp":true,"*.yamanashi.jp":true,"*.yokohama.jp":true,"metro.tokyo.jp":false,"pref.aichi.jp":false,"pref.akita.jp":false,"pref.aomori.jp":false,"pref.chiba.jp":false,"pref.ehime.jp":false,"pref.fukui.jp":false,"pref.fukuoka.jp":false,"pref.fukushima.jp":false,"pref.gifu.jp":false,"pref.gunma.jp":false,"pref.hiroshima.jp":false,"pref.hokkaido.jp":false,"pref.hyogo.jp":false,"pref.ibaraki.jp":false,"pref.ishikawa.jp":false,"pref.iwate.jp":false,"pref.kagawa.jp":false,"pref.kagoshima.jp":false,"pref.kanagawa.jp":false,"pref.kochi.jp":false,"pref.kumamoto.jp":false,"pref.kyoto.jp":false,"pref.mie.jp":false,"pref.miyagi.jp":false,"pref.miyazaki.jp":false,"pref.nagano.jp":false,"pref.nagasaki.jp":false,"pref.nara.jp":false,"pref.niigata.jp":false,"pref.oita.jp":false,"pref.okayama.jp":false,"pref.okinawa.jp":false,"pref.osaka.jp":false,"pref.saga.jp":false,"pref.saitama.jp":false,"pref.shiga.jp":false,"pref.shimane.jp":false,"pref.shizuoka.jp":false,"pref.tochigi.jp":false,"pref.tokushima.jp":false,"pref.tottori.jp":false,"pref.toyama.jp":false,"pref.wakayama.jp":false,"pref.yamagata.jp":false,"pref.yamaguchi.jp":false,"pref.yamanashi.jp":false,"city.chiba.jp":false,"city.fukuoka.jp":false,"city.hiroshima.jp":false,"city.kawasaki.jp":false,"city.kitakyushu.jp":false,"city.kobe.jp":false,"city.kyoto.jp":false,"city.nagoya.jp":false,"city.niigata.jp":false,"city.okayama.jp":false,"city.osaka.jp":false,"city.saitama.jp":false,"city.sapporo.jp":false,"city.sendai.jp":false,"city.shizuoka.jp":false,"city.yokohama.jp":false,"*.ke":true,"kg":true,"org.kg":true,"net.kg":true,"com.kg":true,"edu.kg":true,"gov.kg":true,"mil.kg":true,"*.kh":true,"ki":true,"edu.ki":true,"biz.ki":true,"net.ki":true,"org.ki":true,"gov.ki":true,"info.ki":true,"com.ki":true,"km":true,"org.km":true,"nom.km":true,"gov.km":true,"prd.km":true,"tm.km":true,"edu.km":true,"mil.km":true,"ass.km":true,"com.km":true,"coop.km":true,"asso.km":true,"presse.km":true,"medecin.km":true,"notaires.km":true,"pharmaciens.km":true,"veterinaire.km":true,"gouv.km":true,"kn":true,"net.kn":true,"org.kn":true,"edu.kn":true,"gov.kn":true,"com.kp":true,"edu.kp":true,"gov.kp":true,"org.kp":true,"rep.kp":true,"tra.kp":true,"kr":true,"ac.kr":true,"co.kr":true,"es.kr":true,"go.kr":true,"hs.kr":true,"kg.kr":true,"mil.kr":true,"ms.kr":true,"ne.kr":true,"or.kr":true,"pe.kr":true,"re.kr":true,"sc.kr":true,"busan.kr":true,"chungbuk.kr":true,"chungnam.kr":true,"daegu.kr":true,"daejeon.kr":true,"gangwon.kr":true,"gwangju.kr":true,"gyeongbuk.kr":true,"gyeonggi.kr":true,"gyeongnam.kr":true,"incheon.kr":true,"jeju.kr":true,"jeonbuk.kr":true,"jeonnam.kr":true,"seoul.kr":true,"ulsan.kr":true,"*.kw":true,"ky":true,"edu.ky":true,"gov.ky":true,"com.ky":true,"org.ky":true,"net.ky":true,"kz":true,"org.kz":true,"edu.kz":true,"net.kz":true,"gov.kz":true,"mil.kz":true,"com.kz":true,"la":true,"int.la":true,"net.la":true,"info.la":true,"edu.la":true,"gov.la":true,"per.la":true,"com.la":true,"org.la":true,"com.lb":true,"edu.lb":true,"gov.lb":true,"net.lb":true,"org.lb":true,"lc":true,"com.lc":true,"net.lc":true,"co.lc":true,"org.lc":true,"edu.lc":true,"gov.lc":true,"li":true,"lk":true,"gov.lk":true,"sch.lk":true,"net.lk":true,"int.lk":true,"com.lk":true,"org.lk":true,"edu.lk":true,"ngo.lk":true,"soc.lk":true,"web.lk":true,"ltd.lk":true,"assn.lk":true,"grp.lk":true,"hotel.lk":true,"com.lr":true,"edu.lr":true,"gov.lr":true,"org.lr":true,"net.lr":true,"ls":true,"co.ls":true,"org.ls":true,"lt":true,"gov.lt":true,"lu":true,"lv":true,"com.lv":true,"edu.lv":true,"gov.lv":true,"org.lv":true,"mil.lv":true,"id.lv":true,"net.lv":true,"asn.lv":true,"conf.lv":true,"ly":true,"com.ly":true,"net.ly":true,"gov.ly":true,"plc.ly":true,"edu.ly":true,"sch.ly":true,"med.ly":true,"org.ly":true,"id.ly":true,"ma":true,"co.ma":true,"net.ma":true,"gov.ma":true,"org.ma":true,"ac.ma":true,"press.ma":true,"mc":true,"tm.mc":true,"asso.mc":true,"md":true,"me":true,"co.me":true,"net.me":true,"org.me":true,"edu.me":true,"ac.me":true,"gov.me":true,"its.me":true,"priv.me":true,"mg":true,"org.mg":true,"nom.mg":true,"gov.mg":true,"prd.mg":true,"tm.mg":true,"edu.mg":true,"mil.mg":true,"com.mg":true,"mh":true,"mil":true,"mk":true,"com.mk":true,"org.mk":true,"net.mk":true,"edu.mk":true,"gov.mk":true,"inf.mk":true,"name.mk":true,"ml":true,"com.ml":true,"edu.ml":true,"gouv.ml":true,"gov.ml":true,"net.ml":true,"org.ml":true,"presse.ml":true,"*.mm":true,"mn":true,"gov.mn":true,"edu.mn":true,"org.mn":true,"mo":true,"com.mo":true,"net.mo":true,"org.mo":true,"edu.mo":true,"gov.mo":true,"mobi":true,"mp":true,"mq":true,"mr":true,"gov.mr":true,"ms":true,"*.mt":true,"mu":true,"com.mu":true,"net.mu":true,"org.mu":true,"gov.mu":true,"ac.mu":true,"co.mu":true,"or.mu":true,"museum":true,"academy.museum":true,"agriculture.museum":true,"air.museum":true,"airguard.museum":true,"alabama.museum":true,"alaska.museum":true,"amber.museum":true,"ambulance.museum":true,"american.museum":true,"americana.museum":true,"americanantiques.museum":true,"americanart.museum":true,"amsterdam.museum":true,"and.museum":true,"annefrank.museum":true,"anthro.museum":true,"anthropology.museum":true,"antiques.museum":true,"aquarium.museum":true,"arboretum.museum":true,"archaeological.museum":true,"archaeology.museum":true,"architecture.museum":true,"art.museum":true,"artanddesign.museum":true,"artcenter.museum":true,"artdeco.museum":true,"arteducation.museum":true,"artgallery.museum":true,"arts.museum":true,"artsandcrafts.museum":true,"asmatart.museum":true,"assassination.museum":true,"assisi.museum":true,"association.museum":true,"astronomy.museum":true,"atlanta.museum":true,"austin.museum":true,"australia.museum":true,"automotive.museum":true,"aviation.museum":true,"axis.museum":true,"badajoz.museum":true,"baghdad.museum":true,"bahn.museum":true,"bale.museum":true,"baltimore.museum":true,"barcelona.museum":true,"baseball.museum":true,"basel.museum":true,"baths.museum":true,"bauern.museum":true,"beauxarts.museum":true,"beeldengeluid.museum":true,"bellevue.museum":true,"bergbau.museum":true,"berkeley.museum":true,"berlin.museum":true,"bern.museum":true,"bible.museum":true,"bilbao.museum":true,"bill.museum":true,"birdart.museum":true,"birthplace.museum":true,"bonn.museum":true,"boston.museum":true,"botanical.museum":true,"botanicalgarden.museum":true,"botanicgarden.museum":true,"botany.museum":true,"brandywinevalley.museum":true,"brasil.museum":true,"bristol.museum":true,"british.museum":true,"britishcolumbia.museum":true,"broadcast.museum":true,"brunel.museum":true,"brussel.museum":true,"brussels.museum":true,"bruxelles.museum":true,"building.museum":true,"burghof.museum":true,"bus.museum":true,"bushey.museum":true,"cadaques.museum":true,"california.museum":true,"cambridge.museum":true,"can.museum":true,"canada.museum":true,"capebreton.museum":true,"carrier.museum":true,"cartoonart.museum":true,"casadelamoneda.museum":true,"castle.museum":true,"castres.museum":true,"celtic.museum":true,"center.museum":true,"chattanooga.museum":true,"cheltenham.museum":true,"chesapeakebay.museum":true,"chicago.museum":true,"children.museum":true,"childrens.museum":true,"childrensgarden.museum":true,"chiropractic.museum":true,"chocolate.museum":true,"christiansburg.museum":true,"cincinnati.museum":true,"cinema.museum":true,"circus.museum":true,"civilisation.museum":true,"civilization.museum":true,"civilwar.museum":true,"clinton.museum":true,"clock.museum":true,"coal.museum":true,"coastaldefence.museum":true,"cody.museum":true,"coldwar.museum":true,"collection.museum":true,"colonialwilliamsburg.museum":true,"coloradoplateau.museum":true,"columbia.museum":true,"columbus.museum":true,"communication.museum":true,"communications.museum":true,"community.museum":true,"computer.museum":true,"computerhistory.museum":true,"xn--comunicaes-v6a2o.museum":true,"contemporary.museum":true,"contemporaryart.museum":true,"convent.museum":true,"copenhagen.museum":true,"corporation.museum":true,"xn--correios-e-telecomunicaes-ghc29a.museum":true,"corvette.museum":true,"costume.museum":true,"countryestate.museum":true,"county.museum":true,"crafts.museum":true,"cranbrook.museum":true,"creation.museum":true,"cultural.museum":true,"culturalcenter.museum":true,"culture.museum":true,"cyber.museum":true,"cymru.museum":true,"dali.museum":true,"dallas.museum":true,"database.museum":true,"ddr.museum":true,"decorativearts.museum":true,"delaware.museum":true,"delmenhorst.museum":true,"denmark.museum":true,"depot.museum":true,"design.museum":true,"detroit.museum":true,"dinosaur.museum":true,"discovery.museum":true,"dolls.museum":true,"donostia.museum":true,"durham.museum":true,"eastafrica.museum":true,"eastcoast.museum":true,"education.museum":true,"educational.museum":true,"egyptian.museum":true,"eisenbahn.museum":true,"elburg.museum":true,"elvendrell.museum":true,"embroidery.museum":true,"encyclopedic.museum":true,"england.museum":true,"entomology.museum":true,"environment.museum":true,"environmentalconservation.museum":true,"epilepsy.museum":true,"essex.museum":true,"estate.museum":true,"ethnology.museum":true,"exeter.museum":true,"exhibition.museum":true,"family.museum":true,"farm.museum":true,"farmequipment.museum":true,"farmers.museum":true,"farmstead.museum":true,"field.museum":true,"figueres.museum":true,"filatelia.museum":true,"film.museum":true,"fineart.museum":true,"finearts.museum":true,"finland.museum":true,"flanders.museum":true,"florida.museum":true,"force.museum":true,"fortmissoula.museum":true,"fortworth.museum":true,"foundation.museum":true,"francaise.museum":true,"frankfurt.museum":true,"franziskaner.museum":true,"freemasonry.museum":true,"freiburg.museum":true,"fribourg.museum":true,"frog.museum":true,"fundacio.museum":true,"furniture.museum":true,"gallery.museum":true,"garden.museum":true,"gateway.museum":true,"geelvinck.museum":true,"gemological.museum":true,"geology.museum":true,"georgia.museum":true,"giessen.museum":true,"glas.museum":true,"glass.museum":true,"gorge.museum":true,"grandrapids.museum":true,"graz.museum":true,"guernsey.museum":true,"halloffame.museum":true,"hamburg.museum":true,"handson.museum":true,"harvestcelebration.museum":true,"hawaii.museum":true,"health.museum":true,"heimatunduhren.museum":true,"hellas.museum":true,"helsinki.museum":true,"hembygdsforbund.museum":true,"heritage.museum":true,"histoire.museum":true,"historical.museum":true,"historicalsociety.museum":true,"historichouses.museum":true,"historisch.museum":true,"historisches.museum":true,"history.museum":true,"historyofscience.museum":true,"horology.museum":true,"house.museum":true,"humanities.museum":true,"illustration.museum":true,"imageandsound.museum":true,"indian.museum":true,"indiana.museum":true,"indianapolis.museum":true,"indianmarket.museum":true,"intelligence.museum":true,"interactive.museum":true,"iraq.museum":true,"iron.museum":true,"isleofman.museum":true,"jamison.museum":true,"jefferson.museum":true,"jerusalem.museum":true,"jewelry.museum":true,"jewish.museum":true,"jewishart.museum":true,"jfk.museum":true,"journalism.museum":true,"judaica.museum":true,"judygarland.museum":true,"juedisches.museum":true,"juif.museum":true,"karate.museum":true,"karikatur.museum":true,"kids.museum":true,"koebenhavn.museum":true,"koeln.museum":true,"kunst.museum":true,"kunstsammlung.museum":true,"kunstunddesign.museum":true,"labor.museum":true,"labour.museum":true,"lajolla.museum":true,"lancashire.museum":true,"landes.museum":true,"lans.museum":true,"xn--lns-qla.museum":true,"larsson.museum":true,"lewismiller.museum":true,"lincoln.museum":true,"linz.museum":true,"living.museum":true,"livinghistory.museum":true,"localhistory.museum":true,"london.museum":true,"losangeles.museum":true,"louvre.museum":true,"loyalist.museum":true,"lucerne.museum":true,"luxembourg.museum":true,"luzern.museum":true,"mad.museum":true,"madrid.museum":true,"mallorca.museum":true,"manchester.museum":true,"mansion.museum":true,"mansions.museum":true,"manx.museum":true,"marburg.museum":true,"maritime.museum":true,"maritimo.museum":true,"maryland.museum":true,"marylhurst.museum":true,"media.museum":true,"medical.museum":true,"medizinhistorisches.museum":true,"meeres.museum":true,"memorial.museum":true,"mesaverde.museum":true,"michigan.museum":true,"midatlantic.museum":true,"military.museum":true,"mill.museum":true,"miners.museum":true,"mining.museum":true,"minnesota.museum":true,"missile.museum":true,"missoula.museum":true,"modern.museum":true,"moma.museum":true,"money.museum":true,"monmouth.museum":true,"monticello.museum":true,"montreal.museum":true,"moscow.museum":true,"motorcycle.museum":true,"muenchen.museum":true,"muenster.museum":true,"mulhouse.museum":true,"muncie.museum":true,"museet.museum":true,"museumcenter.museum":true,"museumvereniging.museum":true,"music.museum":true,"national.museum":true,"nationalfirearms.museum":true,"nationalheritage.museum":true,"nativeamerican.museum":true,"naturalhistory.museum":true,"naturalhistorymuseum.museum":true,"naturalsciences.museum":true,"nature.museum":true,"naturhistorisches.museum":true,"natuurwetenschappen.museum":true,"naumburg.museum":true,"naval.museum":true,"nebraska.museum":true,"neues.museum":true,"newhampshire.museum":true,"newjersey.museum":true,"newmexico.museum":true,"newport.museum":true,"newspaper.museum":true,"newyork.museum":true,"niepce.museum":true,"norfolk.museum":true,"north.museum":true,"nrw.museum":true,"nuernberg.museum":true,"nuremberg.museum":true,"nyc.museum":true,"nyny.museum":true,"oceanographic.museum":true,"oceanographique.museum":true,"omaha.museum":true,"online.museum":true,"ontario.museum":true,"openair.museum":true,"oregon.museum":true,"oregontrail.museum":true,"otago.museum":true,"oxford.museum":true,"pacific.museum":true,"paderborn.museum":true,"palace.museum":true,"paleo.museum":true,"palmsprings.museum":true,"panama.museum":true,"paris.museum":true,"pasadena.museum":true,"pharmacy.museum":true,"philadelphia.museum":true,"philadelphiaarea.museum":true,"philately.museum":true,"phoenix.museum":true,"photography.museum":true,"pilots.museum":true,"pittsburgh.museum":true,"planetarium.museum":true,"plantation.museum":true,"plants.museum":true,"plaza.museum":true,"portal.museum":true,"portland.museum":true,"portlligat.museum":true,"posts-and-telecommunications.museum":true,"preservation.museum":true,"presidio.museum":true,"press.museum":true,"project.museum":true,"public.museum":true,"pubol.museum":true,"quebec.museum":true,"railroad.museum":true,"railway.museum":true,"research.museum":true,"resistance.museum":true,"riodejaneiro.museum":true,"rochester.museum":true,"rockart.museum":true,"roma.museum":true,"russia.museum":true,"saintlouis.museum":true,"salem.museum":true,"salvadordali.museum":true,"salzburg.museum":true,"sandiego.museum":true,"sanfrancisco.museum":true,"santabarbara.museum":true,"santacruz.museum":true,"santafe.museum":true,"saskatchewan.museum":true,"satx.museum":true,"savannahga.museum":true,"schlesisches.museum":true,"schoenbrunn.museum":true,"schokoladen.museum":true,"school.museum":true,"schweiz.museum":true,"science.museum":true,"scienceandhistory.museum":true,"scienceandindustry.museum":true,"sciencecenter.museum":true,"sciencecenters.museum":true,"science-fiction.museum":true,"sciencehistory.museum":true,"sciences.museum":true,"sciencesnaturelles.museum":true,"scotland.museum":true,"seaport.museum":true,"settlement.museum":true,"settlers.museum":true,"shell.museum":true,"sherbrooke.museum":true,"sibenik.museum":true,"silk.museum":true,"ski.museum":true,"skole.museum":true,"society.museum":true,"sologne.museum":true,"soundandvision.museum":true,"southcarolina.museum":true,"southwest.museum":true,"space.museum":true,"spy.museum":true,"square.museum":true,"stadt.museum":true,"stalbans.museum":true,"starnberg.museum":true,"state.museum":true,"stateofdelaware.museum":true,"station.museum":true,"steam.museum":true,"steiermark.museum":true,"stjohn.museum":true,"stockholm.museum":true,"stpetersburg.museum":true,"stuttgart.museum":true,"suisse.museum":true,"surgeonshall.museum":true,"surrey.museum":true,"svizzera.museum":true,"sweden.museum":true,"sydney.museum":true,"tank.museum":true,"tcm.museum":true,"technology.museum":true,"telekommunikation.museum":true,"television.museum":true,"texas.museum":true,"textile.museum":true,"theater.museum":true,"time.museum":true,"timekeeping.museum":true,"topology.museum":true,"torino.museum":true,"touch.museum":true,"town.museum":true,"transport.museum":true,"tree.museum":true,"trolley.museum":true,"trust.museum":true,"trustee.museum":true,"uhren.museum":true,"ulm.museum":true,"undersea.museum":true,"university.museum":true,"usa.museum":true,"usantiques.museum":true,"usarts.museum":true,"uscountryestate.museum":true,"usculture.museum":true,"usdecorativearts.museum":true,"usgarden.museum":true,"ushistory.museum":true,"ushuaia.museum":true,"uslivinghistory.museum":true,"utah.museum":true,"uvic.museum":true,"valley.museum":true,"vantaa.museum":true,"versailles.museum":true,"viking.museum":true,"village.museum":true,"virginia.museum":true,"virtual.museum":true,"virtuel.museum":true,"vlaanderen.museum":true,"volkenkunde.museum":true,"wales.museum":true,"wallonie.museum":true,"war.museum":true,"washingtondc.museum":true,"watchandclock.museum":true,"watch-and-clock.museum":true,"western.museum":true,"westfalen.museum":true,"whaling.museum":true,"wildlife.museum":true,"williamsburg.museum":true,"windmill.museum":true,"workshop.museum":true,"york.museum":true,"yorkshire.museum":true,"yosemite.museum":true,"youth.museum":true,"zoological.museum":true,"zoology.museum":true,"xn--9dbhblg6di.museum":true,"xn--h1aegh.museum":true,"mv":true,"aero.mv":true,"biz.mv":true,"com.mv":true,"coop.mv":true,"edu.mv":true,"gov.mv":true,"info.mv":true,"int.mv":true,"mil.mv":true,"museum.mv":true,"name.mv":true,"net.mv":true,"org.mv":true,"pro.mv":true,"mw":true,"ac.mw":true,"biz.mw":true,"co.mw":true,"com.mw":true,"coop.mw":true,"edu.mw":true,"gov.mw":true,"int.mw":true,"museum.mw":true,"net.mw":true,"org.mw":true,"mx":true,"com.mx":true,"org.mx":true,"gob.mx":true,"edu.mx":true,"net.mx":true,"my":true,"com.my":true,"net.my":true,"org.my":true,"gov.my":true,"edu.my":true,"mil.my":true,"name.my":true,"*.mz":true,"na":true,"info.na":true,"pro.na":true,"name.na":true,"school.na":true,"or.na":true,"dr.na":true,"us.na":true,"mx.na":true,"ca.na":true,"in.na":true,"cc.na":true,"tv.na":true,"ws.na":true,"mobi.na":true,"co.na":true,"com.na":true,"org.na":true,"name":true,"nc":true,"asso.nc":true,"ne":true,"net":true,"nf":true,"com.nf":true,"net.nf":true,"per.nf":true,"rec.nf":true,"web.nf":true,"arts.nf":true,"firm.nf":true,"info.nf":true,"other.nf":true,"store.nf":true,"ac.ng":true,"com.ng":true,"edu.ng":true,"gov.ng":true,"net.ng":true,"org.ng":true,"*.ni":true,"nl":true,"bv.nl":true,"no":true,"fhs.no":true,"vgs.no":true,"fylkesbibl.no":true,"folkebibl.no":true,"museum.no":true,"idrett.no":true,"priv.no":true,"mil.no":true,"stat.no":true,"dep.no":true,"kommune.no":true,"herad.no":true,"aa.no":true,"ah.no":true,"bu.no":true,"fm.no":true,"hl.no":true,"hm.no":true,"jan-mayen.no":true,"mr.no":true,"nl.no":true,"nt.no":true,"of.no":true,"ol.no":true,"oslo.no":true,"rl.no":true,"sf.no":true,"st.no":true,"svalbard.no":true,"tm.no":true,"tr.no":true,"va.no":true,"vf.no":true,"gs.aa.no":true,"gs.ah.no":true,"gs.bu.no":true,"gs.fm.no":true,"gs.hl.no":true,"gs.hm.no":true,"gs.jan-mayen.no":true,"gs.mr.no":true,"gs.nl.no":true,"gs.nt.no":true,"gs.of.no":true,"gs.ol.no":true,"gs.oslo.no":true,"gs.rl.no":true,"gs.sf.no":true,"gs.st.no":true,"gs.svalbard.no":true,"gs.tm.no":true,"gs.tr.no":true,"gs.va.no":true,"gs.vf.no":true,"akrehamn.no":true,"xn--krehamn-dxa.no":true,"algard.no":true,"xn--lgrd-poac.no":true,"arna.no":true,"brumunddal.no":true,"bryne.no":true,"bronnoysund.no":true,"xn--brnnysund-m8ac.no":true,"drobak.no":true,"xn--drbak-wua.no":true,"egersund.no":true,"fetsund.no":true,"floro.no":true,"xn--flor-jra.no":true,"fredrikstad.no":true,"hokksund.no":true,"honefoss.no":true,"xn--hnefoss-q1a.no":true,"jessheim.no":true,"jorpeland.no":true,"xn--jrpeland-54a.no":true,"kirkenes.no":true,"kopervik.no":true,"krokstadelva.no":true,"langevag.no":true,"xn--langevg-jxa.no":true,"leirvik.no":true,"mjondalen.no":true,"xn--mjndalen-64a.no":true,"mo-i-rana.no":true,"mosjoen.no":true,"xn--mosjen-eya.no":true,"nesoddtangen.no":true,"orkanger.no":true,"osoyro.no":true,"xn--osyro-wua.no":true,"raholt.no":true,"xn--rholt-mra.no":true,"sandnessjoen.no":true,"xn--sandnessjen-ogb.no":true,"skedsmokorset.no":true,"slattum.no":true,"spjelkavik.no":true,"stathelle.no":true,"stavern.no":true,"stjordalshalsen.no":true,"xn--stjrdalshalsen-sqb.no":true,"tananger.no":true,"tranby.no":true,"vossevangen.no":true,"afjord.no":true,"xn--fjord-lra.no":true,"agdenes.no":true,"al.no":true,"xn--l-1fa.no":true,"alesund.no":true,"xn--lesund-hua.no":true,"alstahaug.no":true,"alta.no":true,"xn--lt-liac.no":true,"alaheadju.no":true,"xn--laheadju-7ya.no":true,"alvdal.no":true,"amli.no":true,"xn--mli-tla.no":true,"amot.no":true,"xn--mot-tla.no":true,"andebu.no":true,"andoy.no":true,"xn--andy-ira.no":true,"andasuolo.no":true,"ardal.no":true,"xn--rdal-poa.no":true,"aremark.no":true,"arendal.no":true,"xn--s-1fa.no":true,"aseral.no":true,"xn--seral-lra.no":true,"asker.no":true,"askim.no":true,"askvoll.no":true,"askoy.no":true,"xn--asky-ira.no":true,"asnes.no":true,"xn--snes-poa.no":true,"audnedaln.no":true,"aukra.no":true,"aure.no":true,"aurland.no":true,"aurskog-holand.no":true,"xn--aurskog-hland-jnb.no":true,"austevoll.no":true,"austrheim.no":true,"averoy.no":true,"xn--avery-yua.no":true,"balestrand.no":true,"ballangen.no":true,"balat.no":true,"xn--blt-elab.no":true,"balsfjord.no":true,"bahccavuotna.no":true,"xn--bhccavuotna-k7a.no":true,"bamble.no":true,"bardu.no":true,"beardu.no":true,"beiarn.no":true,"bajddar.no":true,"xn--bjddar-pta.no":true,"baidar.no":true,"xn--bidr-5nac.no":true,"berg.no":true,"bergen.no":true,"berlevag.no":true,"xn--berlevg-jxa.no":true,"bearalvahki.no":true,"xn--bearalvhki-y4a.no":true,"bindal.no":true,"birkenes.no":true,"bjarkoy.no":true,"xn--bjarky-fya.no":true,"bjerkreim.no":true,"bjugn.no":true,"bodo.no":true,"xn--bod-2na.no":true,"badaddja.no":true,"xn--bdddj-mrabd.no":true,"budejju.no":true,"bokn.no":true,"bremanger.no":true,"bronnoy.no":true,"xn--brnny-wuac.no":true,"bygland.no":true,"bykle.no":true,"barum.no":true,"xn--brum-voa.no":true,"bo.telemark.no":true,"xn--b-5ga.telemark.no":true,"bo.nordland.no":true,"xn--b-5ga.nordland.no":true,"bievat.no":true,"xn--bievt-0qa.no":true,"bomlo.no":true,"xn--bmlo-gra.no":true,"batsfjord.no":true,"xn--btsfjord-9za.no":true,"bahcavuotna.no":true,"xn--bhcavuotna-s4a.no":true,"dovre.no":true,"drammen.no":true,"drangedal.no":true,"dyroy.no":true,"xn--dyry-ira.no":true,"donna.no":true,"xn--dnna-gra.no":true,"eid.no":true,"eidfjord.no":true,"eidsberg.no":true,"eidskog.no":true,"eidsvoll.no":true,"eigersund.no":true,"elverum.no":true,"enebakk.no":true,"engerdal.no":true,"etne.no":true,"etnedal.no":true,"evenes.no":true,"evenassi.no":true,"xn--eveni-0qa01ga.no":true,"evje-og-hornnes.no":true,"farsund.no":true,"fauske.no":true,"fuossko.no":true,"fuoisku.no":true,"fedje.no":true,"fet.no":true,"finnoy.no":true,"xn--finny-yua.no":true,"fitjar.no":true,"fjaler.no":true,"fjell.no":true,"flakstad.no":true,"flatanger.no":true,"flekkefjord.no":true,"flesberg.no":true,"flora.no":true,"fla.no":true,"xn--fl-zia.no":true,"folldal.no":true,"forsand.no":true,"fosnes.no":true,"frei.no":true,"frogn.no":true,"froland.no":true,"frosta.no":true,"frana.no":true,"xn--frna-woa.no":true,"froya.no":true,"xn--frya-hra.no":true,"fusa.no":true,"fyresdal.no":true,"forde.no":true,"xn--frde-gra.no":true,"gamvik.no":true,"gangaviika.no":true,"xn--ggaviika-8ya47h.no":true,"gaular.no":true,"gausdal.no":true,"gildeskal.no":true,"xn--gildeskl-g0a.no":true,"giske.no":true,"gjemnes.no":true,"gjerdrum.no":true,"gjerstad.no":true,"gjesdal.no":true,"gjovik.no":true,"xn--gjvik-wua.no":true,"gloppen.no":true,"gol.no":true,"gran.no":true,"grane.no":true,"granvin.no":true,"gratangen.no":true,"grimstad.no":true,"grong.no":true,"kraanghke.no":true,"xn--kranghke-b0a.no":true,"grue.no":true,"gulen.no":true,"hadsel.no":true,"halden.no":true,"halsa.no":true,"hamar.no":true,"hamaroy.no":true,"habmer.no":true,"xn--hbmer-xqa.no":true,"hapmir.no":true,"xn--hpmir-xqa.no":true,"hammerfest.no":true,"hammarfeasta.no":true,"xn--hmmrfeasta-s4ac.no":true,"haram.no":true,"hareid.no":true,"harstad.no":true,"hasvik.no":true,"aknoluokta.no":true,"xn--koluokta-7ya57h.no":true,"hattfjelldal.no":true,"aarborte.no":true,"haugesund.no":true,"hemne.no":true,"hemnes.no":true,"hemsedal.no":true,"heroy.more-og-romsdal.no":true,"xn--hery-ira.xn--mre-og-romsdal-qqb.no":true,"heroy.nordland.no":true,"xn--hery-ira.nordland.no":true,"hitra.no":true,"hjartdal.no":true,"hjelmeland.no":true,"hobol.no":true,"xn--hobl-ira.no":true,"hof.no":true,"hol.no":true,"hole.no":true,"holmestrand.no":true,"holtalen.no":true,"xn--holtlen-hxa.no":true,"hornindal.no":true,"horten.no":true,"hurdal.no":true,"hurum.no":true,"hvaler.no":true,"hyllestad.no":true,"hagebostad.no":true,"xn--hgebostad-g3a.no":true,"hoyanger.no":true,"xn--hyanger-q1a.no":true,"hoylandet.no":true,"xn--hylandet-54a.no":true,"ha.no":true,"xn--h-2fa.no":true,"ibestad.no":true,"inderoy.no":true,"xn--indery-fya.no":true,"iveland.no":true,"jevnaker.no":true,"jondal.no":true,"jolster.no":true,"xn--jlster-bya.no":true,"karasjok.no":true,"karasjohka.no":true,"xn--krjohka-hwab49j.no":true,"karlsoy.no":true,"galsa.no":true,"xn--gls-elac.no":true,"karmoy.no":true,"xn--karmy-yua.no":true,"kautokeino.no":true,"guovdageaidnu.no":true,"klepp.no":true,"klabu.no":true,"xn--klbu-woa.no":true,"kongsberg.no":true,"kongsvinger.no":true,"kragero.no":true,"xn--krager-gya.no":true,"kristiansand.no":true,"kristiansund.no":true,"krodsherad.no":true,"xn--krdsherad-m8a.no":true,"kvalsund.no":true,"rahkkeravju.no":true,"xn--rhkkervju-01af.no":true,"kvam.no":true,"kvinesdal.no":true,"kvinnherad.no":true,"kviteseid.no":true,"kvitsoy.no":true,"xn--kvitsy-fya.no":true,"kvafjord.no":true,"xn--kvfjord-nxa.no":true,"giehtavuoatna.no":true,"kvanangen.no":true,"xn--kvnangen-k0a.no":true,"navuotna.no":true,"xn--nvuotna-hwa.no":true,"kafjord.no":true,"xn--kfjord-iua.no":true,"gaivuotna.no":true,"xn--givuotna-8ya.no":true,"larvik.no":true,"lavangen.no":true,"lavagis.no":true,"loabat.no":true,"xn--loabt-0qa.no":true,"lebesby.no":true,"davvesiida.no":true,"leikanger.no":true,"leirfjord.no":true,"leka.no":true,"leksvik.no":true,"lenvik.no":true,"leangaviika.no":true,"xn--leagaviika-52b.no":true,"lesja.no":true,"levanger.no":true,"lier.no":true,"lierne.no":true,"lillehammer.no":true,"lillesand.no":true,"lindesnes.no":true,"lindas.no":true,"xn--linds-pra.no":true,"lom.no":true,"loppa.no":true,"lahppi.no":true,"xn--lhppi-xqa.no":true,"lund.no":true,"lunner.no":true,"luroy.no":true,"xn--lury-ira.no":true,"luster.no":true,"lyngdal.no":true,"lyngen.no":true,"ivgu.no":true,"lardal.no":true,"lerdal.no":true,"xn--lrdal-sra.no":true,"lodingen.no":true,"xn--ldingen-q1a.no":true,"lorenskog.no":true,"xn--lrenskog-54a.no":true,"loten.no":true,"xn--lten-gra.no":true,"malvik.no":true,"masoy.no":true,"xn--msy-ula0h.no":true,"muosat.no":true,"xn--muost-0qa.no":true,"mandal.no":true,"marker.no":true,"marnardal.no":true,"masfjorden.no":true,"meland.no":true,"meldal.no":true,"melhus.no":true,"meloy.no":true,"xn--mely-ira.no":true,"meraker.no":true,"xn--merker-kua.no":true,"moareke.no":true,"xn--moreke-jua.no":true,"midsund.no":true,"midtre-gauldal.no":true,"modalen.no":true,"modum.no":true,"molde.no":true,"moskenes.no":true,"moss.no":true,"mosvik.no":true,"malselv.no":true,"xn--mlselv-iua.no":true,"malatvuopmi.no":true,"xn--mlatvuopmi-s4a.no":true,"namdalseid.no":true,"aejrie.no":true,"namsos.no":true,"namsskogan.no":true,"naamesjevuemie.no":true,"xn--nmesjevuemie-tcba.no":true,"laakesvuemie.no":true,"nannestad.no":true,"narvik.no":true,"narviika.no":true,"naustdal.no":true,"nedre-eiker.no":true,"nes.akershus.no":true,"nes.buskerud.no":true,"nesna.no":true,"nesodden.no":true,"nesseby.no":true,"unjarga.no":true,"xn--unjrga-rta.no":true,"nesset.no":true,"nissedal.no":true,"nittedal.no":true,"nord-aurdal.no":true,"nord-fron.no":true,"nord-odal.no":true,"norddal.no":true,"nordkapp.no":true,"davvenjarga.no":true,"xn--davvenjrga-y4a.no":true,"nordre-land.no":true,"nordreisa.no":true,"raisa.no":true,"xn--risa-5na.no":true,"nore-og-uvdal.no":true,"notodden.no":true,"naroy.no":true,"xn--nry-yla5g.no":true,"notteroy.no":true,"xn--nttery-byae.no":true,"odda.no":true,"oksnes.no":true,"xn--ksnes-uua.no":true,"oppdal.no":true,"oppegard.no":true,"xn--oppegrd-ixa.no":true,"orkdal.no":true,"orland.no":true,"xn--rland-uua.no":true,"orskog.no":true,"xn--rskog-uua.no":true,"orsta.no":true,"xn--rsta-fra.no":true,"os.hedmark.no":true,"os.hordaland.no":true,"osen.no":true,"osteroy.no":true,"xn--ostery-fya.no":true,"ostre-toten.no":true,"xn--stre-toten-zcb.no":true,"overhalla.no":true,"ovre-eiker.no":true,"xn--vre-eiker-k8a.no":true,"oyer.no":true,"xn--yer-zna.no":true,"oygarden.no":true,"xn--ygarden-p1a.no":true,"oystre-slidre.no":true,"xn--ystre-slidre-ujb.no":true,"porsanger.no":true,"porsangu.no":true,"xn--porsgu-sta26f.no":true,"porsgrunn.no":true,"radoy.no":true,"xn--rady-ira.no":true,"rakkestad.no":true,"rana.no":true,"ruovat.no":true,"randaberg.no":true,"rauma.no":true,"rendalen.no":true,"rennebu.no":true,"rennesoy.no":true,"xn--rennesy-v1a.no":true,"rindal.no":true,"ringebu.no":true,"ringerike.no":true,"ringsaker.no":true,"rissa.no":true,"risor.no":true,"xn--risr-ira.no":true,"roan.no":true,"rollag.no":true,"rygge.no":true,"ralingen.no":true,"xn--rlingen-mxa.no":true,"rodoy.no":true,"xn--rdy-0nab.no":true,"romskog.no":true,"xn--rmskog-bya.no":true,"roros.no":true,"xn--rros-gra.no":true,"rost.no":true,"xn--rst-0na.no":true,"royken.no":true,"xn--ryken-vua.no":true,"royrvik.no":true,"xn--ryrvik-bya.no":true,"rade.no":true,"xn--rde-ula.no":true,"salangen.no":true,"siellak.no":true,"saltdal.no":true,"salat.no":true,"xn--slt-elab.no":true,"xn--slat-5na.no":true,"samnanger.no":true,"sande.more-og-romsdal.no":true,"sande.xn--mre-og-romsdal-qqb.no":true,"sande.vestfold.no":true,"sandefjord.no":true,"sandnes.no":true,"sandoy.no":true,"xn--sandy-yua.no":true,"sarpsborg.no":true,"sauda.no":true,"sauherad.no":true,"sel.no":true,"selbu.no":true,"selje.no":true,"seljord.no":true,"sigdal.no":true,"siljan.no":true,"sirdal.no":true,"skaun.no":true,"skedsmo.no":true,"ski.no":true,"skien.no":true,"skiptvet.no":true,"skjervoy.no":true,"xn--skjervy-v1a.no":true,"skierva.no":true,"xn--skierv-uta.no":true,"skjak.no":true,"xn--skjk-soa.no":true,"skodje.no":true,"skanland.no":true,"xn--sknland-fxa.no":true,"skanit.no":true,"xn--sknit-yqa.no":true,"smola.no":true,"xn--smla-hra.no":true,"snillfjord.no":true,"snasa.no":true,"xn--snsa-roa.no":true,"snoasa.no":true,"snaase.no":true,"xn--snase-nra.no":true,"sogndal.no":true,"sokndal.no":true,"sola.no":true,"solund.no":true,"songdalen.no":true,"sortland.no":true,"spydeberg.no":true,"stange.no":true,"stavanger.no":true,"steigen.no":true,"steinkjer.no":true,"stjordal.no":true,"xn--stjrdal-s1a.no":true,"stokke.no":true,"stor-elvdal.no":true,"stord.no":true,"stordal.no":true,"storfjord.no":true,"omasvuotna.no":true,"strand.no":true,"stranda.no":true,"stryn.no":true,"sula.no":true,"suldal.no":true,"sund.no":true,"sunndal.no":true,"surnadal.no":true,"sveio.no":true,"svelvik.no":true,"sykkylven.no":true,"sogne.no":true,"xn--sgne-gra.no":true,"somna.no":true,"xn--smna-gra.no":true,"sondre-land.no":true,"xn--sndre-land-0cb.no":true,"sor-aurdal.no":true,"xn--sr-aurdal-l8a.no":true,"sor-fron.no":true,"xn--sr-fron-q1a.no":true,"sor-odal.no":true,"xn--sr-odal-q1a.no":true,"sor-varanger.no":true,"xn--sr-varanger-ggb.no":true,"matta-varjjat.no":true,"xn--mtta-vrjjat-k7af.no":true,"sorfold.no":true,"xn--srfold-bya.no":true,"sorreisa.no":true,"xn--srreisa-q1a.no":true,"sorum.no":true,"xn--srum-gra.no":true,"tana.no":true,"deatnu.no":true,"time.no":true,"tingvoll.no":true,"tinn.no":true,"tjeldsund.no":true,"dielddanuorri.no":true,"tjome.no":true,"xn--tjme-hra.no":true,"tokke.no":true,"tolga.no":true,"torsken.no":true,"tranoy.no":true,"xn--trany-yua.no":true,"tromso.no":true,"xn--troms-zua.no":true,"tromsa.no":true,"romsa.no":true,"trondheim.no":true,"troandin.no":true,"trysil.no":true,"trana.no":true,"xn--trna-woa.no":true,"trogstad.no":true,"xn--trgstad-r1a.no":true,"tvedestrand.no":true,"tydal.no":true,"tynset.no":true,"tysfjord.no":true,"divtasvuodna.no":true,"divttasvuotna.no":true,"tysnes.no":true,"tysvar.no":true,"xn--tysvr-vra.no":true,"tonsberg.no":true,"xn--tnsberg-q1a.no":true,"ullensaker.no":true,"ullensvang.no":true,"ulvik.no":true,"utsira.no":true,"vadso.no":true,"xn--vads-jra.no":true,"cahcesuolo.no":true,"xn--hcesuolo-7ya35b.no":true,"vaksdal.no":true,"valle.no":true,"vang.no":true,"vanylven.no":true,"vardo.no":true,"xn--vard-jra.no":true,"varggat.no":true,"xn--vrggt-xqad.no":true,"vefsn.no":true,"vaapste.no":true,"vega.no":true,"vegarshei.no":true,"xn--vegrshei-c0a.no":true,"vennesla.no":true,"verdal.no":true,"verran.no":true,"vestby.no":true,"vestnes.no":true,"vestre-slidre.no":true,"vestre-toten.no":true,"vestvagoy.no":true,"xn--vestvgy-ixa6o.no":true,"vevelstad.no":true,"vik.no":true,"vikna.no":true,"vindafjord.no":true,"volda.no":true,"voss.no":true,"varoy.no":true,"xn--vry-yla5g.no":true,"vagan.no":true,"xn--vgan-qoa.no":true,"voagat.no":true,"vagsoy.no":true,"xn--vgsy-qoa0j.no":true,"vaga.no":true,"xn--vg-yiab.no":true,"valer.ostfold.no":true,"xn--vler-qoa.xn--stfold-9xa.no":true,"valer.hedmark.no":true,"xn--vler-qoa.hedmark.no":true,"*.np":true,"nr":true,"biz.nr":true,"info.nr":true,"gov.nr":true,"edu.nr":true,"org.nr":true,"net.nr":true,"com.nr":true,"nu":true,"*.nz":true,"*.om":true,"mediaphone.om":false,"nawrastelecom.om":false,"nawras.om":false,"omanmobile.om":false,"omanpost.om":false,"omantel.om":false,"rakpetroleum.om":false,"siemens.om":false,"songfest.om":false,"statecouncil.om":false,"org":true,"pa":true,"ac.pa":true,"gob.pa":true,"com.pa":true,"org.pa":true,"sld.pa":true,"edu.pa":true,"net.pa":true,"ing.pa":true,"abo.pa":true,"med.pa":true,"nom.pa":true,"pe":true,"edu.pe":true,"gob.pe":true,"nom.pe":true,"mil.pe":true,"org.pe":true,"com.pe":true,"net.pe":true,"pf":true,"com.pf":true,"org.pf":true,"edu.pf":true,"*.pg":true,"ph":true,"com.ph":true,"net.ph":true,"org.ph":true,"gov.ph":true,"edu.ph":true,"ngo.ph":true,"mil.ph":true,"i.ph":true,"pk":true,"com.pk":true,"net.pk":true,"edu.pk":true,"org.pk":true,"fam.pk":true,"biz.pk":true,"web.pk":true,"gov.pk":true,"gob.pk":true,"gok.pk":true,"gon.pk":true,"gop.pk":true,"gos.pk":true,"info.pk":true,"pl":true,"aid.pl":true,"agro.pl":true,"atm.pl":true,"auto.pl":true,"biz.pl":true,"com.pl":true,"edu.pl":true,"gmina.pl":true,"gsm.pl":true,"info.pl":true,"mail.pl":true,"miasta.pl":true,"media.pl":true,"mil.pl":true,"net.pl":true,"nieruchomosci.pl":true,"nom.pl":true,"org.pl":true,"pc.pl":true,"powiat.pl":true,"priv.pl":true,"realestate.pl":true,"rel.pl":true,"sex.pl":true,"shop.pl":true,"sklep.pl":true,"sos.pl":true,"szkola.pl":true,"targi.pl":true,"tm.pl":true,"tourism.pl":true,"travel.pl":true,"turystyka.pl":true,"6bone.pl":true,"art.pl":true,"mbone.pl":true,"gov.pl":true,"uw.gov.pl":true,"um.gov.pl":true,"ug.gov.pl":true,"upow.gov.pl":true,"starostwo.gov.pl":true,"so.gov.pl":true,"sr.gov.pl":true,"po.gov.pl":true,"pa.gov.pl":true,"ngo.pl":true,"irc.pl":true,"usenet.pl":true,"augustow.pl":true,"babia-gora.pl":true,"bedzin.pl":true,"beskidy.pl":true,"bialowieza.pl":true,"bialystok.pl":true,"bielawa.pl":true,"bieszczady.pl":true,"boleslawiec.pl":true,"bydgoszcz.pl":true,"bytom.pl":true,"cieszyn.pl":true,"czeladz.pl":true,"czest.pl":true,"dlugoleka.pl":true,"elblag.pl":true,"elk.pl":true,"glogow.pl":true,"gniezno.pl":true,"gorlice.pl":true,"grajewo.pl":true,"ilawa.pl":true,"jaworzno.pl":true,"jelenia-gora.pl":true,"jgora.pl":true,"kalisz.pl":true,"kazimierz-dolny.pl":true,"karpacz.pl":true,"kartuzy.pl":true,"kaszuby.pl":true,"katowice.pl":true,"kepno.pl":true,"ketrzyn.pl":true,"klodzko.pl":true,"kobierzyce.pl":true,"kolobrzeg.pl":true,"konin.pl":true,"konskowola.pl":true,"kutno.pl":true,"lapy.pl":true,"lebork.pl":true,"legnica.pl":true,"lezajsk.pl":true,"limanowa.pl":true,"lomza.pl":true,"lowicz.pl":true,"lubin.pl":true,"lukow.pl":true,"malbork.pl":true,"malopolska.pl":true,"mazowsze.pl":true,"mazury.pl":true,"mielec.pl":true,"mielno.pl":true,"mragowo.pl":true,"naklo.pl":true,"nowaruda.pl":true,"nysa.pl":true,"olawa.pl":true,"olecko.pl":true,"olkusz.pl":true,"olsztyn.pl":true,"opoczno.pl":true,"opole.pl":true,"ostroda.pl":true,"ostroleka.pl":true,"ostrowiec.pl":true,"ostrowwlkp.pl":true,"pila.pl":true,"pisz.pl":true,"podhale.pl":true,"podlasie.pl":true,"polkowice.pl":true,"pomorze.pl":true,"pomorskie.pl":true,"prochowice.pl":true,"pruszkow.pl":true,"przeworsk.pl":true,"pulawy.pl":true,"radom.pl":true,"rawa-maz.pl":true,"rybnik.pl":true,"rzeszow.pl":true,"sanok.pl":true,"sejny.pl":true,"siedlce.pl":true,"slask.pl":true,"slupsk.pl":true,"sosnowiec.pl":true,"stalowa-wola.pl":true,"skoczow.pl":true,"starachowice.pl":true,"stargard.pl":true,"suwalki.pl":true,"swidnica.pl":true,"swiebodzin.pl":true,"swinoujscie.pl":true,"szczecin.pl":true,"szczytno.pl":true,"tarnobrzeg.pl":true,"tgory.pl":true,"turek.pl":true,"tychy.pl":true,"ustka.pl":true,"walbrzych.pl":true,"warmia.pl":true,"warszawa.pl":true,"waw.pl":true,"wegrow.pl":true,"wielun.pl":true,"wlocl.pl":true,"wloclawek.pl":true,"wodzislaw.pl":true,"wolomin.pl":true,"wroclaw.pl":true,"zachpomor.pl":true,"zagan.pl":true,"zarow.pl":true,"zgora.pl":true,"zgorzelec.pl":true,"gda.pl":true,"gdansk.pl":true,"gdynia.pl":true,"med.pl":true,"sopot.pl":true,"gliwice.pl":true,"krakow.pl":true,"poznan.pl":true,"wroc.pl":true,"zakopane.pl":true,"pm":true,"pn":true,"gov.pn":true,"co.pn":true,"org.pn":true,"edu.pn":true,"net.pn":true,"pr":true,"com.pr":true,"net.pr":true,"org.pr":true,"gov.pr":true,"edu.pr":true,"isla.pr":true,"pro.pr":true,"biz.pr":true,"info.pr":true,"name.pr":true,"est.pr":true,"prof.pr":true,"ac.pr":true,"pro":true,"aca.pro":true,"bar.pro":true,"cpa.pro":true,"jur.pro":true,"law.pro":true,"med.pro":true,"eng.pro":true,"ps":true,"edu.ps":true,"gov.ps":true,"sec.ps":true,"plo.ps":true,"com.ps":true,"org.ps":true,"net.ps":true,"pt":true,"net.pt":true,"gov.pt":true,"org.pt":true,"edu.pt":true,"int.pt":true,"publ.pt":true,"com.pt":true,"nome.pt":true,"pw":true,"co.pw":true,"ne.pw":true,"or.pw":true,"ed.pw":true,"go.pw":true,"belau.pw":true,"*.py":true,"qa":true,"com.qa":true,"edu.qa":true,"gov.qa":true,"mil.qa":true,"name.qa":true,"net.qa":true,"org.qa":true,"sch.qa":true,"re":true,"com.re":true,"asso.re":true,"nom.re":true,"ro":true,"com.ro":true,"org.ro":true,"tm.ro":true,"nt.ro":true,"nom.ro":true,"info.ro":true,"rec.ro":true,"arts.ro":true,"firm.ro":true,"store.ro":true,"www.ro":true,"rs":true,"co.rs":true,"org.rs":true,"edu.rs":true,"ac.rs":true,"gov.rs":true,"in.rs":true,"ru":true,"ac.ru":true,"com.ru":true,"edu.ru":true,"int.ru":true,"net.ru":true,"org.ru":true,"pp.ru":true,"adygeya.ru":true,"altai.ru":true,"amur.ru":true,"arkhangelsk.ru":true,"astrakhan.ru":true,"bashkiria.ru":true,"belgorod.ru":true,"bir.ru":true,"bryansk.ru":true,"buryatia.ru":true,"cbg.ru":true,"chel.ru":true,"chelyabinsk.ru":true,"chita.ru":true,"chukotka.ru":true,"chuvashia.ru":true,"dagestan.ru":true,"dudinka.ru":true,"e-burg.ru":true,"grozny.ru":true,"irkutsk.ru":true,"ivanovo.ru":true,"izhevsk.ru":true,"jar.ru":true,"joshkar-ola.ru":true,"kalmykia.ru":true,"kaluga.ru":true,"kamchatka.ru":true,"karelia.ru":true,"kazan.ru":true,"kchr.ru":true,"kemerovo.ru":true,"khabarovsk.ru":true,"khakassia.ru":true,"khv.ru":true,"kirov.ru":true,"koenig.ru":true,"komi.ru":true,"kostroma.ru":true,"krasnoyarsk.ru":true,"kuban.ru":true,"kurgan.ru":true,"kursk.ru":true,"lipetsk.ru":true,"magadan.ru":true,"mari.ru":true,"mari-el.ru":true,"marine.ru":true,"mordovia.ru":true,"mosreg.ru":true,"msk.ru":true,"murmansk.ru":true,"nalchik.ru":true,"nnov.ru":true,"nov.ru":true,"novosibirsk.ru":true,"nsk.ru":true,"omsk.ru":true,"orenburg.ru":true,"oryol.ru":true,"palana.ru":true,"penza.ru":true,"perm.ru":true,"pskov.ru":true,"ptz.ru":true,"rnd.ru":true,"ryazan.ru":true,"sakhalin.ru":true,"samara.ru":true,"saratov.ru":true,"simbirsk.ru":true,"smolensk.ru":true,"spb.ru":true,"stavropol.ru":true,"stv.ru":true,"surgut.ru":true,"tambov.ru":true,"tatarstan.ru":true,"tom.ru":true,"tomsk.ru":true,"tsaritsyn.ru":true,"tsk.ru":true,"tula.ru":true,"tuva.ru":true,"tver.ru":true,"tyumen.ru":true,"udm.ru":true,"udmurtia.ru":true,"ulan-ude.ru":true,"vladikavkaz.ru":true,"vladimir.ru":true,"vladivostok.ru":true,"volgograd.ru":true,"vologda.ru":true,"voronezh.ru":true,"vrn.ru":true,"vyatka.ru":true,"yakutia.ru":true,"yamal.ru":true,"yaroslavl.ru":true,"yekaterinburg.ru":true,"yuzhno-sakhalinsk.ru":true,"amursk.ru":true,"baikal.ru":true,"cmw.ru":true,"fareast.ru":true,"jamal.ru":true,"kms.ru":true,"k-uralsk.ru":true,"kustanai.ru":true,"kuzbass.ru":true,"magnitka.ru":true,"mytis.ru":true,"nakhodka.ru":true,"nkz.ru":true,"norilsk.ru":true,"oskol.ru":true,"pyatigorsk.ru":true,"rubtsovsk.ru":true,"snz.ru":true,"syzran.ru":true,"vdonsk.ru":true,"zgrad.ru":true,"gov.ru":true,"mil.ru":true,"test.ru":true,"rw":true,"gov.rw":true,"net.rw":true,"edu.rw":true,"ac.rw":true,"com.rw":true,"co.rw":true,"int.rw":true,"mil.rw":true,"gouv.rw":true,"sa":true,"com.sa":true,"net.sa":true,"org.sa":true,"gov.sa":true,"med.sa":true,"pub.sa":true,"edu.sa":true,"sch.sa":true,"sb":true,"com.sb":true,"edu.sb":true,"gov.sb":true,"net.sb":true,"org.sb":true,"sc":true,"com.sc":true,"gov.sc":true,"net.sc":true,"org.sc":true,"edu.sc":true,"sd":true,"com.sd":true,"net.sd":true,"org.sd":true,"edu.sd":true,"med.sd":true,"gov.sd":true,"info.sd":true,"se":true,"a.se":true,"ac.se":true,"b.se":true,"bd.se":true,"brand.se":true,"c.se":true,"d.se":true,"e.se":true,"f.se":true,"fh.se":true,"fhsk.se":true,"fhv.se":true,"g.se":true,"h.se":true,"i.se":true,"k.se":true,"komforb.se":true,"kommunalforbund.se":true,"komvux.se":true,"l.se":true,"lanbib.se":true,"m.se":true,"n.se":true,"naturbruksgymn.se":true,"o.se":true,"org.se":true,"p.se":true,"parti.se":true,"pp.se":true,"press.se":true,"r.se":true,"s.se":true,"sshn.se":true,"t.se":true,"tm.se":true,"u.se":true,"w.se":true,"x.se":true,"y.se":true,"z.se":true,"sg":true,"com.sg":true,"net.sg":true,"org.sg":true,"gov.sg":true,"edu.sg":true,"per.sg":true,"sh":true,"si":true,"sk":true,"sl":true,"com.sl":true,"net.sl":true,"edu.sl":true,"gov.sl":true,"org.sl":true,"sm":true,"sn":true,"art.sn":true,"com.sn":true,"edu.sn":true,"gouv.sn":true,"org.sn":true,"perso.sn":true,"univ.sn":true,"so":true,"com.so":true,"net.so":true,"org.so":true,"sr":true,"st":true,"co.st":true,"com.st":true,"consulado.st":true,"edu.st":true,"embaixada.st":true,"gov.st":true,"mil.st":true,"net.st":true,"org.st":true,"principe.st":true,"saotome.st":true,"store.st":true,"su":true,"*.sv":true,"sy":true,"edu.sy":true,"gov.sy":true,"net.sy":true,"mil.sy":true,"com.sy":true,"org.sy":true,"sz":true,"co.sz":true,"ac.sz":true,"org.sz":true,"tc":true,"td":true,"tel":true,"tf":true,"tg":true,"th":true,"ac.th":true,"co.th":true,"go.th":true,"in.th":true,"mi.th":true,"net.th":true,"or.th":true,"tj":true,"ac.tj":true,"biz.tj":true,"co.tj":true,"com.tj":true,"edu.tj":true,"go.tj":true,"gov.tj":true,"int.tj":true,"mil.tj":true,"name.tj":true,"net.tj":true,"nic.tj":true,"org.tj":true,"test.tj":true,"web.tj":true,"tk":true,"tl":true,"gov.tl":true,"tm":true,"tn":true,"com.tn":true,"ens.tn":true,"fin.tn":true,"gov.tn":true,"ind.tn":true,"intl.tn":true,"nat.tn":true,"net.tn":true,"org.tn":true,"info.tn":true,"perso.tn":true,"tourism.tn":true,"edunet.tn":true,"rnrt.tn":true,"rns.tn":true,"rnu.tn":true,"mincom.tn":true,"agrinet.tn":true,"defense.tn":true,"turen.tn":true,"to":true,"com.to":true,"gov.to":true,"net.to":true,"org.to":true,"edu.to":true,"mil.to":true,"*.tr":true,"nic.tr":false,"gov.nc.tr":true,"travel":true,"tt":true,"co.tt":true,"com.tt":true,"org.tt":true,"net.tt":true,"biz.tt":true,"info.tt":true,"pro.tt":true,"int.tt":true,"coop.tt":true,"jobs.tt":true,"mobi.tt":true,"travel.tt":true,"museum.tt":true,"aero.tt":true,"name.tt":true,"gov.tt":true,"edu.tt":true,"tv":true,"tw":true,"edu.tw":true,"gov.tw":true,"mil.tw":true,"com.tw":true,"net.tw":true,"org.tw":true,"idv.tw":true,"game.tw":true,"ebiz.tw":true,"club.tw":true,"xn--zf0ao64a.tw":true,"xn--uc0atv.tw":true,"xn--czrw28b.tw":true,"ac.tz":true,"co.tz":true,"go.tz":true,"mil.tz":true,"ne.tz":true,"or.tz":true,"sc.tz":true,"ua":true,"com.ua":true,"edu.ua":true,"gov.ua":true,"in.ua":true,"net.ua":true,"org.ua":true,"cherkassy.ua":true,"chernigov.ua":true,"chernovtsy.ua":true,"ck.ua":true,"cn.ua":true,"crimea.ua":true,"cv.ua":true,"dn.ua":true,"dnepropetrovsk.ua":true,"donetsk.ua":true,"dp.ua":true,"if.ua":true,"ivano-frankivsk.ua":true,"kh.ua":true,"kharkov.ua":true,"kherson.ua":true,"khmelnitskiy.ua":true,"kiev.ua":true,"kirovograd.ua":true,"km.ua":true,"kr.ua":true,"ks.ua":true,"kv.ua":true,"lg.ua":true,"lugansk.ua":true,"lutsk.ua":true,"lviv.ua":true,"mk.ua":true,"nikolaev.ua":true,"od.ua":true,"odessa.ua":true,"pl.ua":true,"poltava.ua":true,"rovno.ua":true,"rv.ua":true,"sebastopol.ua":true,"sumy.ua":true,"te.ua":true,"ternopil.ua":true,"uzhgorod.ua":true,"vinnica.ua":true,"vn.ua":true,"zaporizhzhe.ua":true,"zp.ua":true,"zhitomir.ua":true,"zt.ua":true,"co.ua":true,"pp.ua":true,"ug":true,"co.ug":true,"ac.ug":true,"sc.ug":true,"go.ug":true,"ne.ug":true,"or.ug":true,"*.uk":true,"*.sch.uk":true,"bl.uk":false,"british-library.uk":false,"icnet.uk":false,"jet.uk":false,"mod.uk":false,"nel.uk":false,"nhs.uk":false,"nic.uk":false,"nls.uk":false,"national-library-scotland.uk":false,"parliament.uk":false,"police.uk":false,"us":true,"dni.us":true,"fed.us":true,"isa.us":true,"kids.us":true,"nsn.us":true,"ak.us":true,"al.us":true,"ar.us":true,"as.us":true,"az.us":true,"ca.us":true,"co.us":true,"ct.us":true,"dc.us":true,"de.us":true,"fl.us":true,"ga.us":true,"gu.us":true,"hi.us":true,"ia.us":true,"id.us":true,"il.us":true,"in.us":true,"ks.us":true,"ky.us":true,"la.us":true,"ma.us":true,"md.us":true,"me.us":true,"mi.us":true,"mn.us":true,"mo.us":true,"ms.us":true,"mt.us":true,"nc.us":true,"nd.us":true,"ne.us":true,"nh.us":true,"nj.us":true,"nm.us":true,"nv.us":true,"ny.us":true,"oh.us":true,"ok.us":true,"or.us":true,"pa.us":true,"pr.us":true,"ri.us":true,"sc.us":true,"sd.us":true,"tn.us":true,"tx.us":true,"ut.us":true,"vi.us":true,"vt.us":true,"va.us":true,"wa.us":true,"wi.us":true,"wv.us":true,"wy.us":true,"k12.ak.us":true,"k12.al.us":true,"k12.ar.us":true,"k12.as.us":true,"k12.az.us":true,"k12.ca.us":true,"k12.co.us":true,"k12.ct.us":true,"k12.dc.us":true,"k12.de.us":true,"k12.fl.us":true,"k12.ga.us":true,"k12.gu.us":true,"k12.ia.us":true,"k12.id.us":true,"k12.il.us":true,"k12.in.us":true,"k12.ks.us":true,"k12.ky.us":true,"k12.la.us":true,"k12.ma.us":true,"k12.md.us":true,"k12.me.us":true,"k12.mi.us":true,"k12.mn.us":true,"k12.mo.us":true,"k12.ms.us":true,"k12.mt.us":true,"k12.nc.us":true,"k12.nd.us":true,"k12.ne.us":true,"k12.nh.us":true,"k12.nj.us":true,"k12.nm.us":true,"k12.nv.us":true,"k12.ny.us":true,"k12.oh.us":true,"k12.ok.us":true,"k12.or.us":true,"k12.pa.us":true,"k12.pr.us":true,"k12.ri.us":true,"k12.sc.us":true,"k12.sd.us":true,"k12.tn.us":true,"k12.tx.us":true,"k12.ut.us":true,"k12.vi.us":true,"k12.vt.us":true,"k12.va.us":true,"k12.wa.us":true,"k12.wi.us":true,"k12.wv.us":true,"k12.wy.us":true,"cc.ak.us":true,"cc.al.us":true,"cc.ar.us":true,"cc.as.us":true,"cc.az.us":true,"cc.ca.us":true,"cc.co.us":true,"cc.ct.us":true,"cc.dc.us":true,"cc.de.us":true,"cc.fl.us":true,"cc.ga.us":true,"cc.gu.us":true,"cc.hi.us":true,"cc.ia.us":true,"cc.id.us":true,"cc.il.us":true,"cc.in.us":true,"cc.ks.us":true,"cc.ky.us":true,"cc.la.us":true,"cc.ma.us":true,"cc.md.us":true,"cc.me.us":true,"cc.mi.us":true,"cc.mn.us":true,"cc.mo.us":true,"cc.ms.us":true,"cc.mt.us":true,"cc.nc.us":true,"cc.nd.us":true,"cc.ne.us":true,"cc.nh.us":true,"cc.nj.us":true,"cc.nm.us":true,"cc.nv.us":true,"cc.ny.us":true,"cc.oh.us":true,"cc.ok.us":true,"cc.or.us":true,"cc.pa.us":true,"cc.pr.us":true,"cc.ri.us":true,"cc.sc.us":true,"cc.sd.us":true,"cc.tn.us":true,"cc.tx.us":true,"cc.ut.us":true,"cc.vi.us":true,"cc.vt.us":true,"cc.va.us":true,"cc.wa.us":true,"cc.wi.us":true,"cc.wv.us":true,"cc.wy.us":true,"lib.ak.us":true,"lib.al.us":true,"lib.ar.us":true,"lib.as.us":true,"lib.az.us":true,"lib.ca.us":true,"lib.co.us":true,"lib.ct.us":true,"lib.dc.us":true,"lib.de.us":true,"lib.fl.us":true,"lib.ga.us":true,"lib.gu.us":true,"lib.hi.us":true,"lib.ia.us":true,"lib.id.us":true,"lib.il.us":true,"lib.in.us":true,"lib.ks.us":true,"lib.ky.us":true,"lib.la.us":true,"lib.ma.us":true,"lib.md.us":true,"lib.me.us":true,"lib.mi.us":true,"lib.mn.us":true,"lib.mo.us":true,"lib.ms.us":true,"lib.mt.us":true,"lib.nc.us":true,"lib.nd.us":true,"lib.ne.us":true,"lib.nh.us":true,"lib.nj.us":true,"lib.nm.us":true,"lib.nv.us":true,"lib.ny.us":true,"lib.oh.us":true,"lib.ok.us":true,"lib.or.us":true,"lib.pa.us":true,"lib.pr.us":true,"lib.ri.us":true,"lib.sc.us":true,"lib.sd.us":true,"lib.tn.us":true,"lib.tx.us":true,"lib.ut.us":true,"lib.vi.us":true,"lib.vt.us":true,"lib.va.us":true,"lib.wa.us":true,"lib.wi.us":true,"lib.wv.us":true,"lib.wy.us":true,"pvt.k12.ma.us":true,"chtr.k12.ma.us":true,"paroch.k12.ma.us":true,"*.uy":true,"uz":true,"com.uz":true,"co.uz":true,"va":true,"vc":true,"com.vc":true,"net.vc":true,"org.vc":true,"gov.vc":true,"mil.vc":true,"edu.vc":true,"*.ve":true,"vg":true,"vi":true,"co.vi":true,"com.vi":true,"k12.vi":true,"net.vi":true,"org.vi":true,"vn":true,"com.vn":true,"net.vn":true,"org.vn":true,"edu.vn":true,"gov.vn":true,"int.vn":true,"ac.vn":true,"biz.vn":true,"info.vn":true,"name.vn":true,"pro.vn":true,"health.vn":true,"vu":true,"wf":true,"ws":true,"com.ws":true,"net.ws":true,"org.ws":true,"gov.ws":true,"edu.ws":true,"yt":true,"xn--mgbaam7a8h":true,"xn--54b7fta0cc":true,"xn--fiqs8s":true,"xn--fiqz9s":true,"xn--lgbbat1ad8j":true,"xn--wgbh1c":true,"xn--node":true,"xn--j6w193g":true,"xn--h2brj9c":true,"xn--mgbbh1a71e":true,"xn--fpcrj9c3d":true,"xn--gecrj9c":true,"xn--s9brj9c":true,"xn--45brj9c":true,"xn--xkc2dl3a5ee0h":true,"xn--mgba3a4f16a":true,"xn--mgba3a4fra":true,"xn--mgbayh7gpa":true,"xn--3e0b707e":true,"xn--fzc2c9e2c":true,"xn--xkc2al3hye2a":true,"xn--mgbc0a9azcg":true,"xn--mgb9awbf":true,"xn--ygbi2ammx":true,"xn--90a3ac":true,"xn--p1ai":true,"xn--wgbl6a":true,"xn--mgberp4a5d4ar":true,"xn--mgberp4a5d4a87g":true,"xn--mgbqly7c0a67fbc":true,"xn--mgbqly7cvafr":true,"xn--ogbpf8fl":true,"xn--mgbtf8fl":true,"xn--yfro4i67o":true,"xn--clchc0ea0b2g2a9gcd":true,"xn--o3cw4h":true,"xn--pgbs0dh":true,"xn--kpry57d":true,"xn--kprw13d":true,"xn--nnx388a":true,"xn--j1amh":true,"xn--mgb2ddes":true,"xxx":true,"*.ye":true,"*.za":true,"*.zm":true,"*.zw":true,"biz.at":true,"info.at":true,"priv.at":true,"co.ca":true,"ar.com":true,"br.com":true,"cn.com":true,"de.com":true,"eu.com":true,"gb.com":true,"gr.com":true,"hu.com":true,"jpn.com":true,"kr.com":true,"no.com":true,"qc.com":true,"ru.com":true,"sa.com":true,"se.com":true,"uk.com":true,"us.com":true,"uy.com":true,"za.com":true,"gb.net":true,"jp.net":true,"se.net":true,"uk.net":true,"ae.org":true,"us.org":true,"com.de":true,"operaunite.com":true,"appspot.com":true,"iki.fi":true,"c.la":true,"za.net":true,"za.org":true,"co.nl":true,"co.no":true,"co.pl":true,"dyndns-at-home.com":true,"dyndns-at-work.com":true,"dyndns-blog.com":true,"dyndns-free.com":true,"dyndns-home.com":true,"dyndns-ip.com":true,"dyndns-mail.com":true,"dyndns-office.com":true,"dyndns-pics.com":true,"dyndns-remote.com":true,"dyndns-server.com":true,"dyndns-web.com":true,"dyndns-wiki.com":true,"dyndns-work.com":true,"dyndns.biz":true,"dyndns.info":true,"dyndns.org":true,"dyndns.tv":true,"at-band-camp.net":true,"ath.cx":true,"barrel-of-knowledge.info":true,"barrell-of-knowledge.info":true,"better-than.tv":true,"blogdns.com":true,"blogdns.net":true,"blogdns.org":true,"blogsite.org":true,"boldlygoingnowhere.org":true,"broke-it.net":true,"buyshouses.net":true,"cechire.com":true,"dnsalias.com":true,"dnsalias.net":true,"dnsalias.org":true,"dnsdojo.com":true,"dnsdojo.net":true,"dnsdojo.org":true,"does-it.net":true,"doesntexist.com":true,"doesntexist.org":true,"dontexist.com":true,"dontexist.net":true,"dontexist.org":true,"doomdns.com":true,"doomdns.org":true,"dvrdns.org":true,"dyn-o-saur.com":true,"dynalias.com":true,"dynalias.net":true,"dynalias.org":true,"dynathome.net":true,"dyndns.ws":true,"endofinternet.net":true,"endofinternet.org":true,"endoftheinternet.org":true,"est-a-la-maison.com":true,"est-a-la-masion.com":true,"est-le-patron.com":true,"est-mon-blogueur.com":true,"for-better.biz":true,"for-more.biz":true,"for-our.info":true,"for-some.biz":true,"for-the.biz":true,"forgot.her.name":true,"forgot.his.name":true,"from-ak.com":true,"from-al.com":true,"from-ar.com":true,"from-az.net":true,"from-ca.com":true,"from-co.net":true,"from-ct.com":true,"from-dc.com":true,"from-de.com":true,"from-fl.com":true,"from-ga.com":true,"from-hi.com":true,"from-ia.com":true,"from-id.com":true,"from-il.com":true,"from-in.com":true,"from-ks.com":true,"from-ky.com":true,"from-la.net":true,"from-ma.com":true,"from-md.com":true,"from-me.org":true,"from-mi.com":true,"from-mn.com":true,"from-mo.com":true,"from-ms.com":true,"from-mt.com":true,"from-nc.com":true,"from-nd.com":true,"from-ne.com":true,"from-nh.com":true,"from-nj.com":true,"from-nm.com":true,"from-nv.com":true,"from-ny.net":true,"from-oh.com":true,"from-ok.com":true,"from-or.com":true,"from-pa.com":true,"from-pr.com":true,"from-ri.com":true,"from-sc.com":true,"from-sd.com":true,"from-tn.com":true,"from-tx.com":true,"from-ut.com":true,"from-va.com":true,"from-vt.com":true,"from-wa.com":true,"from-wi.com":true,"from-wv.com":true,"from-wy.com":true,"ftpaccess.cc":true,"fuettertdasnetz.de":true,"game-host.org":true,"game-server.cc":true,"getmyip.com":true,"gets-it.net":true,"go.dyndns.org":true,"gotdns.com":true,"gotdns.org":true,"groks-the.info":true,"groks-this.info":true,"ham-radio-op.net":true,"here-for-more.info":true,"hobby-site.com":true,"hobby-site.org":true,"home.dyndns.org":true,"homedns.org":true,"homeftp.net":true,"homeftp.org":true,"homeip.net":true,"homelinux.com":true,"homelinux.net":true,"homelinux.org":true,"homeunix.com":true,"homeunix.net":true,"homeunix.org":true,"iamallama.com":true,"in-the-band.net":true,"is-a-anarchist.com":true,"is-a-blogger.com":true,"is-a-bookkeeper.com":true,"is-a-bruinsfan.org":true,"is-a-bulls-fan.com":true,"is-a-candidate.org":true,"is-a-caterer.com":true,"is-a-celticsfan.org":true,"is-a-chef.com":true,"is-a-chef.net":true,"is-a-chef.org":true,"is-a-conservative.com":true,"is-a-cpa.com":true,"is-a-cubicle-slave.com":true,"is-a-democrat.com":true,"is-a-designer.com":true,"is-a-doctor.com":true,"is-a-financialadvisor.com":true,"is-a-geek.com":true,"is-a-geek.net":true,"is-a-geek.org":true,"is-a-green.com":true,"is-a-guru.com":true,"is-a-hard-worker.com":true,"is-a-hunter.com":true,"is-a-knight.org":true,"is-a-landscaper.com":true,"is-a-lawyer.com":true,"is-a-liberal.com":true,"is-a-libertarian.com":true,"is-a-linux-user.org":true,"is-a-llama.com":true,"is-a-musician.com":true,"is-a-nascarfan.com":true,"is-a-nurse.com":true,"is-a-painter.com":true,"is-a-patsfan.org":true,"is-a-personaltrainer.com":true,"is-a-photographer.com":true,"is-a-player.com":true,"is-a-republican.com":true,"is-a-rockstar.com":true,"is-a-socialist.com":true,"is-a-soxfan.org":true,"is-a-student.com":true,"is-a-teacher.com":true,"is-a-techie.com":true,"is-a-therapist.com":true,"is-an-accountant.com":true,"is-an-actor.com":true,"is-an-actress.com":true,"is-an-anarchist.com":true,"is-an-artist.com":true,"is-an-engineer.com":true,"is-an-entertainer.com":true,"is-by.us":true,"is-certified.com":true,"is-found.org":true,"is-gone.com":true,"is-into-anime.com":true,"is-into-cars.com":true,"is-into-cartoons.com":true,"is-into-games.com":true,"is-leet.com":true,"is-lost.org":true,"is-not-certified.com":true,"is-saved.org":true,"is-slick.com":true,"is-uberleet.com":true,"is-very-bad.org":true,"is-very-evil.org":true,"is-very-good.org":true,"is-very-nice.org":true,"is-very-sweet.org":true,"is-with-theband.com":true,"isa-geek.com":true,"isa-geek.net":true,"isa-geek.org":true,"isa-hockeynut.com":true,"issmarterthanyou.com":true,"isteingeek.de":true,"istmein.de":true,"kicks-ass.net":true,"kicks-ass.org":true,"knowsitall.info":true,"land-4-sale.us":true,"lebtimnetz.de":true,"leitungsen.de":true,"likes-pie.com":true,"likescandy.com":true,"merseine.nu":true,"mine.nu":true,"misconfused.org":true,"mypets.ws":true,"myphotos.cc":true,"neat-url.com":true,"office-on-the.net":true,"on-the-web.tv":true,"podzone.net":true,"podzone.org":true,"readmyblog.org":true,"saves-the-whales.com":true,"scrapper-site.net":true,"scrapping.cc":true,"selfip.biz":true,"selfip.com":true,"selfip.info":true,"selfip.net":true,"selfip.org":true,"sells-for-less.com":true,"sells-for-u.com":true,"sells-it.net":true,"sellsyourhome.org":true,"servebbs.com":true,"servebbs.net":true,"servebbs.org":true,"serveftp.net":true,"serveftp.org":true,"servegame.org":true,"shacknet.nu":true,"simple-url.com":true,"space-to-rent.com":true,"stuff-4-sale.org":true,"stuff-4-sale.us":true,"teaches-yoga.com":true,"thruhere.net":true,"traeumtgerade.de":true,"webhop.biz":true,"webhop.info":true,"webhop.net":true,"webhop.org":true,"worse-than.tv":true,"writesthisblog.com":true}); + +// END of automatically generated file diff --git a/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/tough-cookie/lib/store.js b/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/tough-cookie/lib/store.js new file mode 100644 index 0000000..f8433df --- /dev/null +++ b/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/tough-cookie/lib/store.js @@ -0,0 +1,37 @@ +'use strict'; +/*jshint unused:false */ + +function Store() { +} +exports.Store = Store; + +// Stores may be synchronous, but are still required to use a +// Continuation-Passing Style API. The CookieJar itself will expose a "*Sync" +// API that converts from synchronous-callbacks to imperative style. +Store.prototype.synchronous = false; + +Store.prototype.findCookie = function(domain, path, key, cb) { + throw new Error('findCookie is not implemented'); +}; + +Store.prototype.findCookies = function(domain, path, cb) { + throw new Error('findCookies is not implemented'); +}; + +Store.prototype.putCookie = function(cookie, cb) { + throw new Error('putCookie is not implemented'); +}; + +Store.prototype.updateCookie = function(oldCookie, newCookie, cb) { + // recommended default implementation: + // return this.putCookie(newCookie, cb); + throw new Error('updateCookie is not implemented'); +}; + +Store.prototype.removeCookie = function(domain, path, key, cb) { + throw new Error('removeCookie is not implemented'); +}; + +Store.prototype.removeCookies = function removeCookies(domain, path, cb) { + throw new Error('removeCookies is not implemented'); +}; diff --git a/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/tough-cookie/node_modules/punycode/LICENSE-MIT.txt b/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/tough-cookie/node_modules/punycode/LICENSE-MIT.txt new file mode 100644 index 0000000..a41e0a7 --- /dev/null +++ b/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/tough-cookie/node_modules/punycode/LICENSE-MIT.txt @@ -0,0 +1,20 @@ +Copyright Mathias Bynens + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/tough-cookie/node_modules/punycode/README.md b/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/tough-cookie/node_modules/punycode/README.md new file mode 100644 index 0000000..831e637 --- /dev/null +++ b/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/tough-cookie/node_modules/punycode/README.md @@ -0,0 +1,176 @@ +# Punycode.js [![Build status](https://travis-ci.org/bestiejs/punycode.js.svg?branch=master)](https://travis-ci.org/bestiejs/punycode.js) [![Code coverage status](http://img.shields.io/coveralls/bestiejs/punycode.js/master.svg)](https://coveralls.io/r/bestiejs/punycode.js) [![Dependency status](https://gemnasium.com/bestiejs/punycode.js.svg)](https://gemnasium.com/bestiejs/punycode.js) + +A robust Punycode converter that fully complies to [RFC 3492](http://tools.ietf.org/html/rfc3492) and [RFC 5891](http://tools.ietf.org/html/rfc5891), and works on nearly all JavaScript platforms. + +This JavaScript library is the result of comparing, optimizing and documenting different open-source implementations of the Punycode algorithm: + +* [The C example code from RFC 3492](http://tools.ietf.org/html/rfc3492#appendix-C) +* [`punycode.c` by _Markus W. Scherer_ (IBM)](http://opensource.apple.com/source/ICU/ICU-400.42/icuSources/common/punycode.c) +* [`punycode.c` by _Ben Noordhuis_](https://github.com/bnoordhuis/punycode/blob/master/punycode.c) +* [JavaScript implementation by _some_](http://stackoverflow.com/questions/183485/can-anyone-recommend-a-good-free-javascript-for-punycode-to-unicode-conversion/301287#301287) +* [`punycode.js` by _Ben Noordhuis_](https://github.com/joyent/node/blob/426298c8c1c0d5b5224ac3658c41e7c2a3fe9377/lib/punycode.js) (note: [not fully compliant](https://github.com/joyent/node/issues/2072)) + +This project is [bundled](https://github.com/joyent/node/blob/master/lib/punycode.js) with [Node.js v0.6.2+](https://github.com/joyent/node/compare/975f1930b1...61e796decc). + +## Installation + +Via [npm](http://npmjs.org/) (only required for Node.js releases older than v0.6.2): + +```bash +npm install punycode +``` + +Via [Bower](http://bower.io/): + +```bash +bower install punycode +``` + +Via [Component](https://github.com/component/component): + +```bash +component install bestiejs/punycode.js +``` + +In a browser: + +```html + +``` + +In [Narwhal](http://narwhaljs.org/), [Node.js](http://nodejs.org/), and [RingoJS](http://ringojs.org/): + +```js +var punycode = require('punycode'); +``` + +In [Rhino](http://www.mozilla.org/rhino/): + +```js +load('punycode.js'); +``` + +Using an AMD loader like [RequireJS](http://requirejs.org/): + +```js +require( + { + 'paths': { + 'punycode': 'path/to/punycode' + } + }, + ['punycode'], + function(punycode) { + console.log(punycode); + } +); +``` + +## API + +### `punycode.decode(string)` + +Converts a Punycode string of ASCII symbols to a string of Unicode symbols. + +```js +// decode domain name parts +punycode.decode('maana-pta'); // 'mañana' +punycode.decode('--dqo34k'); // '☃-⌘' +``` + +### `punycode.encode(string)` + +Converts a string of Unicode symbols to a Punycode string of ASCII symbols. + +```js +// encode domain name parts +punycode.encode('mañana'); // 'maana-pta' +punycode.encode('☃-⌘'); // '--dqo34k' +``` + +### `punycode.toUnicode(input)` + +Converts a Punycode string representing a domain name or an email address to Unicode. Only the Punycoded parts of the input will be converted, i.e. it doesn’t matter if you call it on a string that has already been converted to Unicode. + +```js +// decode domain names +punycode.toUnicode('xn--maana-pta.com'); +// → 'mañana.com' +punycode.toUnicode('xn----dqo34k.com'); +// → '☃-⌘.com' + +// decode email addresses +punycode.toUnicode('джумла@xn--p-8sbkgc5ag7bhce.xn--ba-lmcq'); +// → 'джумла@джpумлатест.bрфa' +``` + +### `punycode.toASCII(input)` + +Converts a Unicode string representing a domain name or an email address to Punycode. Only the non-ASCII parts of the input will be converted, i.e. it doesn’t matter if you call it with a domain that's already in ASCII. + +```js +// encode domain names +punycode.toASCII('mañana.com'); +// → 'xn--maana-pta.com' +punycode.toASCII('☃-⌘.com'); +// → 'xn----dqo34k.com' + +// encode email addresses +punycode.toASCII('джумла@джpумлатест.bрфa'); +// → 'джумла@xn--p-8sbkgc5ag7bhce.xn--ba-lmcq' +``` + +### `punycode.ucs2` + +#### `punycode.ucs2.decode(string)` + +Creates an array containing the numeric code point values of each Unicode symbol in the string. While [JavaScript uses UCS-2 internally](https://mathiasbynens.be/notes/javascript-encoding), this function will convert a pair of surrogate halves (each of which UCS-2 exposes as separate characters) into a single code point, matching UTF-16. + +```js +punycode.ucs2.decode('abc'); +// → [0x61, 0x62, 0x63] +// surrogate pair for U+1D306 TETRAGRAM FOR CENTRE: +punycode.ucs2.decode('\uD834\uDF06'); +// → [0x1D306] +``` + +#### `punycode.ucs2.encode(codePoints)` + +Creates a string based on an array of numeric code point values. + +```js +punycode.ucs2.encode([0x61, 0x62, 0x63]); +// → 'abc' +punycode.ucs2.encode([0x1D306]); +// → '\uD834\uDF06' +``` + +### `punycode.version` + +A string representing the current Punycode.js version number. + +## Unit tests & code coverage + +After cloning this repository, run `npm install --dev` to install the dependencies needed for Punycode.js development and testing. You may want to install Istanbul _globally_ using `npm install istanbul -g`. + +Once that’s done, you can run the unit tests in Node using `npm test` or `node tests/tests.js`. To run the tests in Rhino, Ringo, Narwhal, PhantomJS, and web browsers as well, use `grunt test`. + +To generate the code coverage report, use `grunt cover`. + +Feel free to fork if you see possible improvements! + +## Author + +| [![twitter/mathias](https://gravatar.com/avatar/24e08a9ea84deb17ae121074d0f17125?s=70)](https://twitter.com/mathias "Follow @mathias on Twitter") | +|---| +| [Mathias Bynens](https://mathiasbynens.be/) | + +## Contributors + +| [![twitter/jdalton](https://gravatar.com/avatar/299a3d891ff1920b69c364d061007043?s=70)](https://twitter.com/jdalton "Follow @jdalton on Twitter") | +|---| +| [John-David Dalton](http://allyoucanleet.com/) | + +## License + +Punycode.js is available under the [MIT](https://mths.be/mit) license. diff --git a/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/tough-cookie/node_modules/punycode/package.json b/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/tough-cookie/node_modules/punycode/package.json new file mode 100644 index 0000000..4f62713 --- /dev/null +++ b/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/tough-cookie/node_modules/punycode/package.json @@ -0,0 +1,81 @@ +{ + "name": "punycode", + "version": "1.3.2", + "description": "A robust Punycode converter that fully complies to RFC 3492 and RFC 5891, and works on nearly all JavaScript platforms.", + "homepage": "https://mths.be/punycode", + "main": "punycode.js", + "keywords": [ + "punycode", + "unicode", + "idn", + "idna", + "dns", + "url", + "domain" + ], + "license": "MIT", + "author": { + "name": "Mathias Bynens", + "url": "https://mathiasbynens.be/" + }, + "contributors": [ + { + "name": "Mathias Bynens", + "url": "https://mathiasbynens.be/" + }, + { + "name": "John-David Dalton", + "url": "http://allyoucanleet.com/" + } + ], + "repository": { + "type": "git", + "url": "https://github.com/bestiejs/punycode.js.git" + }, + "bugs": { + "url": "https://github.com/bestiejs/punycode.js/issues" + }, + "files": [ + "LICENSE-MIT.txt", + "punycode.js" + ], + "scripts": { + "test": "node tests/tests.js" + }, + "devDependencies": { + "coveralls": "^2.10.1", + "grunt": "^0.4.5", + "grunt-contrib-uglify": "^0.5.0", + "grunt-shell": "^0.7.0", + "istanbul": "^0.2.13", + "qunit-extras": "^1.2.0", + "qunitjs": "~1.11.0", + "requirejs": "^2.1.14" + }, + "gitHead": "38c8d3131a82567bfef18da09f7f4db68c84f8a3", + "_id": "punycode@1.3.2", + "_shasum": "9653a036fb7c1ee42342f2325cceefea3926c48d", + "_from": "punycode@>=0.2.0", + "_npmVersion": "1.4.28", + "_npmUser": { + "name": "mathias", + "email": "mathias@qiwi.be" + }, + "maintainers": [ + { + "name": "mathias", + "email": "mathias@qiwi.be" + }, + { + "name": "reconbot", + "email": "wizard@roborooter.com" + } + ], + "dist": { + "shasum": "9653a036fb7c1ee42342f2325cceefea3926c48d", + "tarball": "http://registry.npmjs.org/punycode/-/punycode-1.3.2.tgz" + }, + "directories": {}, + "_resolved": "https://registry.npmjs.org/punycode/-/punycode-1.3.2.tgz", + "readme": "ERROR: No README data found!" +} diff --git a/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/tough-cookie/node_modules/punycode/punycode.js b/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/tough-cookie/node_modules/punycode/punycode.js new file mode 100644 index 0000000..ac68597 --- /dev/null +++ b/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/tough-cookie/node_modules/punycode/punycode.js @@ -0,0 +1,530 @@ +/*! https://mths.be/punycode v1.3.2 by @mathias */ +;(function(root) { + + /** Detect free variables */ + var freeExports = typeof exports == 'object' && exports && + !exports.nodeType && exports; + var freeModule = typeof module == 'object' && module && + !module.nodeType && module; + var freeGlobal = typeof global == 'object' && global; + if ( + freeGlobal.global === freeGlobal || + freeGlobal.window === freeGlobal || + freeGlobal.self === freeGlobal + ) { + root = freeGlobal; + } + + /** + * The `punycode` object. + * @name punycode + * @type Object + */ + var punycode, + + /** Highest positive signed 32-bit float value */ + maxInt = 2147483647, // aka. 0x7FFFFFFF or 2^31-1 + + /** Bootstring parameters */ + base = 36, + tMin = 1, + tMax = 26, + skew = 38, + damp = 700, + initialBias = 72, + initialN = 128, // 0x80 + delimiter = '-', // '\x2D' + + /** Regular expressions */ + regexPunycode = /^xn--/, + regexNonASCII = /[^\x20-\x7E]/, // unprintable ASCII chars + non-ASCII chars + regexSeparators = /[\x2E\u3002\uFF0E\uFF61]/g, // RFC 3490 separators + + /** Error messages */ + errors = { + 'overflow': 'Overflow: input needs wider integers to process', + 'not-basic': 'Illegal input >= 0x80 (not a basic code point)', + 'invalid-input': 'Invalid input' + }, + + /** Convenience shortcuts */ + baseMinusTMin = base - tMin, + floor = Math.floor, + stringFromCharCode = String.fromCharCode, + + /** Temporary variable */ + key; + + /*--------------------------------------------------------------------------*/ + + /** + * A generic error utility function. + * @private + * @param {String} type The error type. + * @returns {Error} Throws a `RangeError` with the applicable error message. + */ + function error(type) { + throw RangeError(errors[type]); + } + + /** + * A generic `Array#map` utility function. + * @private + * @param {Array} array The array to iterate over. + * @param {Function} callback The function that gets called for every array + * item. + * @returns {Array} A new array of values returned by the callback function. + */ + function map(array, fn) { + var length = array.length; + var result = []; + while (length--) { + result[length] = fn(array[length]); + } + return result; + } + + /** + * A simple `Array#map`-like wrapper to work with domain name strings or email + * addresses. + * @private + * @param {String} domain The domain name or email address. + * @param {Function} callback The function that gets called for every + * character. + * @returns {Array} A new string of characters returned by the callback + * function. + */ + function mapDomain(string, fn) { + var parts = string.split('@'); + var result = ''; + if (parts.length > 1) { + // In email addresses, only the domain name should be punycoded. Leave + // the local part (i.e. everything up to `@`) intact. + result = parts[0] + '@'; + string = parts[1]; + } + // Avoid `split(regex)` for IE8 compatibility. See #17. + string = string.replace(regexSeparators, '\x2E'); + var labels = string.split('.'); + var encoded = map(labels, fn).join('.'); + return result + encoded; + } + + /** + * Creates an array containing the numeric code points of each Unicode + * character in the string. While JavaScript uses UCS-2 internally, + * this function will convert a pair of surrogate halves (each of which + * UCS-2 exposes as separate characters) into a single code point, + * matching UTF-16. + * @see `punycode.ucs2.encode` + * @see + * @memberOf punycode.ucs2 + * @name decode + * @param {String} string The Unicode input string (UCS-2). + * @returns {Array} The new array of code points. + */ + function ucs2decode(string) { + var output = [], + counter = 0, + length = string.length, + value, + extra; + while (counter < length) { + value = string.charCodeAt(counter++); + if (value >= 0xD800 && value <= 0xDBFF && counter < length) { + // high surrogate, and there is a next character + extra = string.charCodeAt(counter++); + if ((extra & 0xFC00) == 0xDC00) { // low surrogate + output.push(((value & 0x3FF) << 10) + (extra & 0x3FF) + 0x10000); + } else { + // unmatched surrogate; only append this code unit, in case the next + // code unit is the high surrogate of a surrogate pair + output.push(value); + counter--; + } + } else { + output.push(value); + } + } + return output; + } + + /** + * Creates a string based on an array of numeric code points. + * @see `punycode.ucs2.decode` + * @memberOf punycode.ucs2 + * @name encode + * @param {Array} codePoints The array of numeric code points. + * @returns {String} The new Unicode string (UCS-2). + */ + function ucs2encode(array) { + return map(array, function(value) { + var output = ''; + if (value > 0xFFFF) { + value -= 0x10000; + output += stringFromCharCode(value >>> 10 & 0x3FF | 0xD800); + value = 0xDC00 | value & 0x3FF; + } + output += stringFromCharCode(value); + return output; + }).join(''); + } + + /** + * Converts a basic code point into a digit/integer. + * @see `digitToBasic()` + * @private + * @param {Number} codePoint The basic numeric code point value. + * @returns {Number} The numeric value of a basic code point (for use in + * representing integers) in the range `0` to `base - 1`, or `base` if + * the code point does not represent a value. + */ + function basicToDigit(codePoint) { + if (codePoint - 48 < 10) { + return codePoint - 22; + } + if (codePoint - 65 < 26) { + return codePoint - 65; + } + if (codePoint - 97 < 26) { + return codePoint - 97; + } + return base; + } + + /** + * Converts a digit/integer into a basic code point. + * @see `basicToDigit()` + * @private + * @param {Number} digit The numeric value of a basic code point. + * @returns {Number} The basic code point whose value (when used for + * representing integers) is `digit`, which needs to be in the range + * `0` to `base - 1`. If `flag` is non-zero, the uppercase form is + * used; else, the lowercase form is used. The behavior is undefined + * if `flag` is non-zero and `digit` has no uppercase form. + */ + function digitToBasic(digit, flag) { + // 0..25 map to ASCII a..z or A..Z + // 26..35 map to ASCII 0..9 + return digit + 22 + 75 * (digit < 26) - ((flag != 0) << 5); + } + + /** + * Bias adaptation function as per section 3.4 of RFC 3492. + * http://tools.ietf.org/html/rfc3492#section-3.4 + * @private + */ + function adapt(delta, numPoints, firstTime) { + var k = 0; + delta = firstTime ? floor(delta / damp) : delta >> 1; + delta += floor(delta / numPoints); + for (/* no initialization */; delta > baseMinusTMin * tMax >> 1; k += base) { + delta = floor(delta / baseMinusTMin); + } + return floor(k + (baseMinusTMin + 1) * delta / (delta + skew)); + } + + /** + * Converts a Punycode string of ASCII-only symbols to a string of Unicode + * symbols. + * @memberOf punycode + * @param {String} input The Punycode string of ASCII-only symbols. + * @returns {String} The resulting string of Unicode symbols. + */ + function decode(input) { + // Don't use UCS-2 + var output = [], + inputLength = input.length, + out, + i = 0, + n = initialN, + bias = initialBias, + basic, + j, + index, + oldi, + w, + k, + digit, + t, + /** Cached calculation results */ + baseMinusT; + + // Handle the basic code points: let `basic` be the number of input code + // points before the last delimiter, or `0` if there is none, then copy + // the first basic code points to the output. + + basic = input.lastIndexOf(delimiter); + if (basic < 0) { + basic = 0; + } + + for (j = 0; j < basic; ++j) { + // if it's not a basic code point + if (input.charCodeAt(j) >= 0x80) { + error('not-basic'); + } + output.push(input.charCodeAt(j)); + } + + // Main decoding loop: start just after the last delimiter if any basic code + // points were copied; start at the beginning otherwise. + + for (index = basic > 0 ? basic + 1 : 0; index < inputLength; /* no final expression */) { + + // `index` is the index of the next character to be consumed. + // Decode a generalized variable-length integer into `delta`, + // which gets added to `i`. The overflow checking is easier + // if we increase `i` as we go, then subtract off its starting + // value at the end to obtain `delta`. + for (oldi = i, w = 1, k = base; /* no condition */; k += base) { + + if (index >= inputLength) { + error('invalid-input'); + } + + digit = basicToDigit(input.charCodeAt(index++)); + + if (digit >= base || digit > floor((maxInt - i) / w)) { + error('overflow'); + } + + i += digit * w; + t = k <= bias ? tMin : (k >= bias + tMax ? tMax : k - bias); + + if (digit < t) { + break; + } + + baseMinusT = base - t; + if (w > floor(maxInt / baseMinusT)) { + error('overflow'); + } + + w *= baseMinusT; + + } + + out = output.length + 1; + bias = adapt(i - oldi, out, oldi == 0); + + // `i` was supposed to wrap around from `out` to `0`, + // incrementing `n` each time, so we'll fix that now: + if (floor(i / out) > maxInt - n) { + error('overflow'); + } + + n += floor(i / out); + i %= out; + + // Insert `n` at position `i` of the output + output.splice(i++, 0, n); + + } + + return ucs2encode(output); + } + + /** + * Converts a string of Unicode symbols (e.g. a domain name label) to a + * Punycode string of ASCII-only symbols. + * @memberOf punycode + * @param {String} input The string of Unicode symbols. + * @returns {String} The resulting Punycode string of ASCII-only symbols. + */ + function encode(input) { + var n, + delta, + handledCPCount, + basicLength, + bias, + j, + m, + q, + k, + t, + currentValue, + output = [], + /** `inputLength` will hold the number of code points in `input`. */ + inputLength, + /** Cached calculation results */ + handledCPCountPlusOne, + baseMinusT, + qMinusT; + + // Convert the input in UCS-2 to Unicode + input = ucs2decode(input); + + // Cache the length + inputLength = input.length; + + // Initialize the state + n = initialN; + delta = 0; + bias = initialBias; + + // Handle the basic code points + for (j = 0; j < inputLength; ++j) { + currentValue = input[j]; + if (currentValue < 0x80) { + output.push(stringFromCharCode(currentValue)); + } + } + + handledCPCount = basicLength = output.length; + + // `handledCPCount` is the number of code points that have been handled; + // `basicLength` is the number of basic code points. + + // Finish the basic string - if it is not empty - with a delimiter + if (basicLength) { + output.push(delimiter); + } + + // Main encoding loop: + while (handledCPCount < inputLength) { + + // All non-basic code points < n have been handled already. Find the next + // larger one: + for (m = maxInt, j = 0; j < inputLength; ++j) { + currentValue = input[j]; + if (currentValue >= n && currentValue < m) { + m = currentValue; + } + } + + // Increase `delta` enough to advance the decoder's state to , + // but guard against overflow + handledCPCountPlusOne = handledCPCount + 1; + if (m - n > floor((maxInt - delta) / handledCPCountPlusOne)) { + error('overflow'); + } + + delta += (m - n) * handledCPCountPlusOne; + n = m; + + for (j = 0; j < inputLength; ++j) { + currentValue = input[j]; + + if (currentValue < n && ++delta > maxInt) { + error('overflow'); + } + + if (currentValue == n) { + // Represent delta as a generalized variable-length integer + for (q = delta, k = base; /* no condition */; k += base) { + t = k <= bias ? tMin : (k >= bias + tMax ? tMax : k - bias); + if (q < t) { + break; + } + qMinusT = q - t; + baseMinusT = base - t; + output.push( + stringFromCharCode(digitToBasic(t + qMinusT % baseMinusT, 0)) + ); + q = floor(qMinusT / baseMinusT); + } + + output.push(stringFromCharCode(digitToBasic(q, 0))); + bias = adapt(delta, handledCPCountPlusOne, handledCPCount == basicLength); + delta = 0; + ++handledCPCount; + } + } + + ++delta; + ++n; + + } + return output.join(''); + } + + /** + * Converts a Punycode string representing a domain name or an email address + * to Unicode. Only the Punycoded parts of the input will be converted, i.e. + * it doesn't matter if you call it on a string that has already been + * converted to Unicode. + * @memberOf punycode + * @param {String} input The Punycoded domain name or email address to + * convert to Unicode. + * @returns {String} The Unicode representation of the given Punycode + * string. + */ + function toUnicode(input) { + return mapDomain(input, function(string) { + return regexPunycode.test(string) + ? decode(string.slice(4).toLowerCase()) + : string; + }); + } + + /** + * Converts a Unicode string representing a domain name or an email address to + * Punycode. Only the non-ASCII parts of the domain name will be converted, + * i.e. it doesn't matter if you call it with a domain that's already in + * ASCII. + * @memberOf punycode + * @param {String} input The domain name or email address to convert, as a + * Unicode string. + * @returns {String} The Punycode representation of the given domain name or + * email address. + */ + function toASCII(input) { + return mapDomain(input, function(string) { + return regexNonASCII.test(string) + ? 'xn--' + encode(string) + : string; + }); + } + + /*--------------------------------------------------------------------------*/ + + /** Define the public API */ + punycode = { + /** + * A string representing the current Punycode.js version number. + * @memberOf punycode + * @type String + */ + 'version': '1.3.2', + /** + * An object of methods to convert from JavaScript's internal character + * representation (UCS-2) to Unicode code points, and back. + * @see + * @memberOf punycode + * @type Object + */ + 'ucs2': { + 'decode': ucs2decode, + 'encode': ucs2encode + }, + 'decode': decode, + 'encode': encode, + 'toASCII': toASCII, + 'toUnicode': toUnicode + }; + + /** Expose `punycode` */ + // Some AMD build optimizers, like r.js, check for specific condition patterns + // like the following: + if ( + typeof define == 'function' && + typeof define.amd == 'object' && + define.amd + ) { + define('punycode', function() { + return punycode; + }); + } else if (freeExports && freeModule) { + if (module.exports == freeExports) { // in Node.js or RingoJS v0.8.0+ + freeModule.exports = punycode; + } else { // in Narwhal or RingoJS v0.7.0- + for (key in punycode) { + punycode.hasOwnProperty(key) && (freeExports[key] = punycode[key]); + } + } + } else { // in Rhino or a web browser + root.punycode = punycode; + } + +}(this)); diff --git a/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/tough-cookie/package.json b/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/tough-cookie/package.json new file mode 100644 index 0000000..f4ede66 --- /dev/null +++ b/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/tough-cookie/package.json @@ -0,0 +1,67 @@ +{ + "author": { + "name": "GoInstant Inc., a salesforce.com company" + }, + "license": "MIT", + "name": "tough-cookie", + "description": "RFC6265 Cookies and Cookie Jar for node.js", + "keywords": [ + "HTTP", + "cookie", + "cookies", + "set-cookie", + "cookiejar", + "jar", + "RFC6265", + "RFC2965" + ], + "version": "0.12.1", + "homepage": "https://github.com/goinstant/tough-cookie", + "repository": { + "type": "git", + "url": "git://github.com/goinstant/tough-cookie.git" + }, + "bugs": { + "url": "https://github.com/goinstant/tough-cookie/issues" + }, + "main": "./lib/cookie", + "scripts": { + "test": "vows test.js" + }, + "engines": { + "node": ">=0.4.12" + }, + "dependencies": { + "punycode": ">=0.2.0" + }, + "devDependencies": { + "vows": "0.7.0", + "async": ">=0.1.12" + }, + "readme": "[RFC6265](http://tools.ietf.org/html/rfc6265) Cookies and CookieJar for Node.js\n\n![Tough Cookie](http://www.goinstant.com.s3.amazonaws.com/tough-cookie.jpg)\n\n[![Build Status](https://travis-ci.org/goinstant/node-cookie.png?branch=master)](https://travis-ci.org/goinstant/node-cookie)\n\n[![NPM Stats](https://nodei.co/npm/tough-cookie.png?downloads=true&stars=true)](https://npmjs.org/package/tough-cookie)\n![NPM Downloads](https://nodei.co/npm-dl/tough-cookie.png?months=9)\n\n# Synopsis\n\n``` javascript\nvar tough = require('tough-cookie'); // note: not 'cookie', 'cookies' or 'node-cookie'\nvar Cookie = tough.Cookie;\nvar cookie = Cookie.parse(header);\ncookie.value = 'somethingdifferent';\nheader = cookie.toString();\n\nvar cookiejar = new tough.CookieJar();\ncookiejar.setCookie(cookie, 'http://currentdomain.example.com/path', cb);\n// ...\ncookiejar.getCookies('http://example.com/otherpath',function(err,cookies) {\n res.headers['cookie'] = cookies.join('; ');\n});\n```\n\n# Installation\n\nIt's _so_ easy!\n\n`npm install tough-cookie`\n\nRequires `punycode`, which should get installed automatically for you. Note that node.js v0.6.2+ bundles punycode by default.\n\nWhy the name? NPM modules `cookie`, `cookies` and `cookiejar` were already taken.\n\n# API\n\ntough\n=====\n\nFunctions on the module you get from `require('tough-cookie')`. All can be used as pure functions and don't need to be \"bound\".\n\nparseDate(string[,strict])\n-----------------\n\nParse a cookie date string into a `Date`. Parses according to RFC6265 Section 5.1.1, not `Date.parse()`. If strict is set to true then leading/trailing non-seperator characters around the time part will cause the parsing to fail (e.g. \"Thu, 01 Jan 1970 00:00:010 GMT\" has an extra trailing zero but Chrome, an assumedly RFC-compliant browser, treats this as valid).\n\nformatDate(date)\n----------------\n\nFormat a Date into a RFC1123 string (the RFC6265-recommended format).\n\ncanonicalDomain(str)\n--------------------\n\nTransforms a domain-name into a canonical domain-name. The canonical domain-name is a trimmed, lowercased, stripped-of-leading-dot and optionally punycode-encoded domain-name (Section 5.1.2 of RFC6265). For the most part, this function is idempotent (can be run again on its output without ill effects).\n\ndomainMatch(str,domStr[,canonicalize=true])\n-------------------------------------------\n\nAnswers \"does this real domain match the domain in a cookie?\". The `str` is the \"current\" domain-name and the `domStr` is the \"cookie\" domain-name. Matches according to RFC6265 Section 5.1.3, but it helps to think of it as a \"suffix match\".\n\nThe `canonicalize` parameter will run the other two paramters through `canonicalDomain` or not.\n\ndefaultPath(path)\n-----------------\n\nGiven a current request/response path, gives the Path apropriate for storing in a cookie. This is basically the \"directory\" of a \"file\" in the path, but is specified by Section 5.1.4 of the RFC.\n\nThe `path` parameter MUST be _only_ the pathname part of a URI (i.e. excludes the hostname, query, fragment, etc.). This is the `.pathname` property of node's `uri.parse()` output.\n\npathMatch(reqPath,cookiePath)\n-----------------------------\n\nAnswers \"does the request-path path-match a given cookie-path?\" as per RFC6265 Section 5.1.4. Returns a boolean.\n\nThis is essentially a prefix-match where `cookiePath` is a prefix of `reqPath`.\n\nparse(header[,strict=false])\n----------------------------\n\nalias for `Cookie.parse(header[,strict])`\n\nfromJSON(string)\n----------------\n\nalias for `Cookie.fromJSON(string)`\n\ngetPublicSuffix(hostname)\n-------------------------\n\nReturns the public suffix of this hostname. The public suffix is the shortest domain-name upon which a cookie can be set. Returns `null` if the hostname cannot have cookies set for it.\n\nFor example: `www.example.com` and `www.subdomain.example.com` both have public suffix `example.com`.\n\nFor further information, see http://publicsuffix.org/. This module derives its list from that site.\n\ncookieCompare(a,b)\n------------------\n\nFor use with `.sort()`, sorts a list of cookies into the recommended order given in the RFC (Section 5.4 step 2). Longest `.path`s go first, then sorted oldest to youngest.\n\n``` javascript\nvar cookies = [ /* unsorted array of Cookie objects */ ];\ncookies = cookies.sort(cookieCompare);\n```\n\npermuteDomain(domain)\n---------------------\n\nGenerates a list of all possible domains that `domainMatch()` the parameter. May be handy for implementing cookie stores.\n\n\npermutePath(path)\n-----------------\n\nGenerates a list of all possible paths that `pathMatch()` the parameter. May be handy for implementing cookie stores.\n\nCookie\n======\n\nCookie.parse(header[,strict=false])\n-----------------------------------\n\nParses a single Cookie or Set-Cookie HTTP header into a `Cookie` object. Returns `undefined` if the string can't be parsed. If in strict mode, returns `undefined` if the cookie doesn't follow the guidelines in section 4 of RFC6265. Generally speaking, strict mode can be used to validate your own generated Set-Cookie headers, but acting as a client you want to be lenient and leave strict mode off.\n\nHere's how to process the Set-Cookie header(s) on a node HTTP/HTTPS response:\n\n``` javascript\nif (res.headers['set-cookie'] instanceof Array)\n cookies = res.headers['set-cookie'].map(function (c) { return (Cookie.parse(c)); });\nelse\n cookies = [Cookie.parse(res.headers['set-cookie'])];\n```\n\nCookie.fromJSON(string)\n-----------------------\n\nConvert a JSON string to a `Cookie` object. Does a `JSON.parse()` and converts the `.created`, `.lastAccessed` and `.expires` properties into `Date` objects.\n\nProperties\n==========\n\n * _key_ - string - the name or key of the cookie (default \"\")\n * _value_ - string - the value of the cookie (default \"\")\n * _expires_ - `Date` - if set, the `Expires=` attribute of the cookie (defaults to the string `\"Infinity\"`). See `setExpires()`\n * _maxAge_ - seconds - if set, the `Max-Age=` attribute _in seconds_ of the cookie. May also be set to strings `\"Infinity\"` and `\"-Infinity\"` for non-expiry and immediate-expiry, respectively. See `setMaxAge()`\n * _domain_ - string - the `Domain=` attribute of the cookie\n * _path_ - string - the `Path=` of the cookie\n * _secure_ - boolean - the `Secure` cookie flag\n * _httpOnly_ - boolean - the `HttpOnly` cookie flag\n * _extensions_ - `Array` - any unrecognized cookie attributes as strings (even if equal-signs inside)\n\nAfter a cookie has been passed through `CookieJar.setCookie()` it will have the following additional attributes:\n\n * _hostOnly_ - boolean - is this a host-only cookie (i.e. no Domain field was set, but was instead implied)\n * _pathIsDefault_ - boolean - if true, there was no Path field on the cookie and `defaultPath()` was used to derive one.\n * _created_ - `Date` - when this cookie was added to the jar\n * _lastAccessed_ - `Date` - last time the cookie got accessed. Will affect cookie cleaning once implemented. Using `cookiejar.getCookies(...)` will update this attribute.\n\nConstruction([{options}])\n------------\n\nReceives an options object that can contain any Cookie properties, uses the default for unspecified properties.\n\n.toString()\n-----------\n\nencode to a Set-Cookie header value. The Expires cookie field is set using `formatDate()`, but is omitted entirely if `.expires` is `Infinity`.\n\n.cookieString()\n---------------\n\nencode to a Cookie header value (i.e. the `.key` and `.value` properties joined with '=').\n\n.setExpires(String)\n-------------------\n\nsets the expiry based on a date-string passed through `parseDate()`. If parseDate returns `null` (i.e. can't parse this date string), `.expires` is set to `\"Infinity\"` (a string) is set.\n\n.setMaxAge(number)\n-------------------\n\nsets the maxAge in seconds. Coerces `-Infinity` to `\"-Infinity\"` and `Infinity` to `\"Infinity\"` so it JSON serializes correctly.\n\n.expiryTime([now=Date.now()])\n-----------------------------\n\n.expiryDate([now=Date.now()])\n-----------------------------\n\nexpiryTime() Computes the absolute unix-epoch milliseconds that this cookie expires. expiryDate() works similarly, except it returns a `Date` object. Note that in both cases the `now` parameter should be milliseconds.\n\nMax-Age takes precedence over Expires (as per the RFC). The `.created` attribute -- or, by default, the `now` paramter -- is used to offset the `.maxAge` attribute.\n\nIf Expires (`.expires`) is set, that's returned.\n\nOtherwise, `expiryTime()` returns `Infinity` and `expiryDate()` returns a `Date` object for \"Tue, 19 Jan 2038 03:14:07 GMT\" (latest date that can be expressed by a 32-bit `time_t`; the common limit for most user-agents).\n\n.TTL([now=Date.now()])\n---------\n\ncompute the TTL relative to `now` (milliseconds). The same precedence rules as for `expiryTime`/`expiryDate` apply.\n\nThe \"number\" `Infinity` is returned for cookies without an explicit expiry and `0` is returned if the cookie is expired. Otherwise a time-to-live in milliseconds is returned.\n\n.canonicalizedDoman()\n---------------------\n\n.cdomain()\n----------\n\nreturn the canonicalized `.domain` field. This is lower-cased and punycode (RFC3490) encoded if the domain has any non-ASCII characters.\n\n.validate()\n-----------\n\nStatus: *IN PROGRESS*. Works for a few things, but is by no means comprehensive.\n\nvalidates cookie attributes for semantic correctness. Useful for \"lint\" checking any Set-Cookie headers you generate. For now, it returns a boolean, but eventually could return a reason string -- you can future-proof with this construct:\n\n``` javascript\nif (cookie.validate() === true) {\n // it's tasty\n} else {\n // yuck!\n}\n```\n\nCookieJar\n=========\n\nConstruction([store = new MemoryCookieStore()][, rejectPublicSuffixes])\n------------\n\nSimply use `new CookieJar()`. If you'd like to use a custom store, pass that to the constructor otherwise a `MemoryCookieStore` will be created and used.\n\n\nAttributes\n----------\n\n * _rejectPublicSuffixes_ - boolean - reject cookies with domains like \"com\" and \"co.uk\" (default: `true`)\n\nSince eventually this module would like to support database/remote/etc. CookieJars, continuation passing style is used for CookieJar methods.\n\n.setCookie(cookieOrString, currentUrl, [{options},] cb(err,cookie))\n-------------------------------------------------------------------\n\nAttempt to set the cookie in the cookie jar. If the operation fails, an error will be given to the callback `cb`, otherwise the cookie is passed through. The cookie will have updated `.created`, `.lastAccessed` and `.hostOnly` properties.\n\nThe `options` object can be omitted and can have the following properties:\n\n * _http_ - boolean - default `true` - indicates if this is an HTTP or non-HTTP API. Affects HttpOnly cookies.\n * _secure_ - boolean - autodetect from url - indicates if this is a \"Secure\" API. If the currentUrl starts with `https:` or `wss:` then this is defaulted to `true`, otherwise `false`.\n * _now_ - Date - default `new Date()` - what to use for the creation/access time of cookies\n * _strict_ - boolean - default `false` - perform extra checks\n * _ignoreError_ - boolean - default `false` - silently ignore things like parse errors and invalid domains. CookieStore errors aren't ignored by this option.\n\nAs per the RFC, the `.hostOnly` property is set if there was no \"Domain=\" parameter in the cookie string (or `.domain` was null on the Cookie object). The `.domain` property is set to the fully-qualified hostname of `currentUrl` in this case. Matching this cookie requires an exact hostname match (not a `domainMatch` as per usual).\n\n.setCookieSync(cookieOrString, currentUrl, [{options}])\n-------------------------------------------------------\n\nSynchronous version of `setCookie`; only works with synchronous stores (e.g. the default `MemoryCookieStore`).\n\n.storeCookie(cookie, [{options},] cb(err,cookie))\n-------------------------------------------------\n\n__REMOVED__ removed in lieu of the CookieStore API below\n\n.getCookies(currentUrl, [{options},] cb(err,cookies))\n-----------------------------------------------------\n\nRetrieve the list of cookies that can be sent in a Cookie header for the current url.\n\nIf an error is encountered, that's passed as `err` to the callback, otherwise an `Array` of `Cookie` objects is passed. The array is sorted with `cookieCompare()` unless the `{sort:false}` option is given.\n\nThe `options` object can be omitted and can have the following properties:\n\n * _http_ - boolean - default `true` - indicates if this is an HTTP or non-HTTP API. Affects HttpOnly cookies.\n * _secure_ - boolean - autodetect from url - indicates if this is a \"Secure\" API. If the currentUrl starts with `https:` or `wss:` then this is defaulted to `true`, otherwise `false`.\n * _now_ - Date - default `new Date()` - what to use for the creation/access time of cookies\n * _expire_ - boolean - default `true` - perform expiry-time checking of cookies and asynchronously remove expired cookies from the store. Using `false` will return expired cookies and **not** remove them from the store (which is useful for replaying Set-Cookie headers, potentially).\n * _allPaths_ - boolean - default `false` - if `true`, do not scope cookies by path. The default uses RFC-compliant path scoping. **Note**: may not be supported by the CookieStore `fetchCookies` function (the default MemoryCookieStore supports it).\n\nThe `.lastAccessed` property of the returned cookies will have been updated.\n\n.getCookiesSync(currentUrl, [{options}])\n----------------------------------------\n\nSynchronous version of `getCookies`; only works with synchronous stores (e.g. the default `MemoryCookieStore`).\n\n.getCookieString(...)\n---------------------\n\nAccepts the same options as `.getCookies()` but passes a string suitable for a Cookie header rather than an array to the callback. Simply maps the `Cookie` array via `.cookieString()`.\n\n.getCookieStringSync(...)\n-------------------------\n\nSynchronous version of `getCookieString`; only works with synchronous stores (e.g. the default `MemoryCookieStore`).\n\n.getSetCookieStrings(...)\n-------------------------\n\nReturns an array of strings suitable for **Set-Cookie** headers. Accepts the same options as `.getCookies()`. Simply maps the cookie array via `.toString()`.\n\n.getSetCookieStringsSync(...)\n-----------------------------\n\nSynchronous version of `getSetCookieStrings`; only works with synchronous stores (e.g. the default `MemoryCookieStore`).\n\nStore\n=====\n\nBase class for CookieJar stores.\n\n# CookieStore API\n\nThe storage model for each `CookieJar` instance can be replaced with a custom implementation. The default is `MemoryCookieStore` which can be found in the `lib/memstore.js` file. The API uses continuation-passing-style to allow for asynchronous stores.\n\nStores should inherit from the base `Store` class, which is available as `require('tough-cookie').Store`. Stores are asynchronous by default, but if `store.synchronous` is set, then the `*Sync` methods on the CookieJar can be used.\n\nAll `domain` parameters will have been normalized before calling.\n\nThe Cookie store must have all of the following methods.\n\nstore.findCookie(domain, path, key, cb(err,cookie))\n---------------------------------------------------\n\nRetrieve a cookie with the given domain, path and key (a.k.a. name). The RFC maintains that exactly one of these cookies should exist in a store. If the store is using versioning, this means that the latest/newest such cookie should be returned.\n\nCallback takes an error and the resulting `Cookie` object. If no cookie is found then `null` MUST be passed instead (i.e. not an error).\n\nstore.findCookies(domain, path, cb(err,cookies))\n------------------------------------------------\n\nLocates cookies matching the given domain and path. This is most often called in the context of `cookiejar.getCookies()` above.\n\nIf no cookies are found, the callback MUST be passed an empty array.\n\nThe resulting list will be checked for applicability to the current request according to the RFC (domain-match, path-match, http-only-flag, secure-flag, expiry, etc.), so it's OK to use an optimistic search algorithm when implementing this method. However, the search algorithm used SHOULD try to find cookies that `domainMatch()` the domain and `pathMatch()` the path in order to limit the amount of checking that needs to be done.\n\nAs of version 0.9.12, the `allPaths` option to `cookiejar.getCookies()` above will cause the path here to be `null`. If the path is `null`, path-matching MUST NOT be performed (i.e. domain-matching only).\n\nstore.putCookie(cookie, cb(err))\n--------------------------------\n\nAdds a new cookie to the store. The implementation SHOULD replace any existing cookie with the same `.domain`, `.path`, and `.key` properties -- depending on the nature of the implementation, it's possible that between the call to `fetchCookie` and `putCookie` that a duplicate `putCookie` can occur.\n\nThe `cookie` object MUST NOT be modified; the caller will have already updated the `.creation` and `.lastAccessed` properties.\n\nPass an error if the cookie cannot be stored.\n\nstore.updateCookie(oldCookie, newCookie, cb(err))\n-------------------------------------------------\n\nUpdate an existing cookie. The implementation MUST update the `.value` for a cookie with the same `domain`, `.path` and `.key`. The implementation SHOULD check that the old value in the store is equivalent to `oldCookie` - how the conflict is resolved is up to the store.\n\nThe `.lastAccessed` property will always be different between the two objects and `.created` will always be the same. Stores MAY ignore or defer the `.lastAccessed` change at the cost of affecting how cookies are sorted (or selected for deletion).\n\nStores may wish to optimize changing the `.value` of the cookie in the store versus storing a new cookie. If the implementation doesn't define this method a stub that calls `putCookie(newCookie,cb)` will be added to the store object.\n\nThe `newCookie` and `oldCookie` objects MUST NOT be modified.\n\nPass an error if the newCookie cannot be stored.\n\nstore.removeCookie(domain, path, key, cb(err))\n----------------------------------------------\n\nRemove a cookie from the store (see notes on `findCookie` about the uniqueness constraint).\n\nThe implementation MUST NOT pass an error if the cookie doesn't exist; only pass an error due to the failure to remove an existing cookie.\n\nstore.removeCookies(domain, path, cb(err))\n------------------------------------------\n\nRemoves matching cookies from the store. The `path` paramter is optional, and if missing means all paths in a domain should be removed.\n\nPass an error ONLY if removing any existing cookies failed.\n\n# TODO\n\n * _full_ RFC5890/RFC5891 canonicalization for domains in `cdomain()`\n * the optional `punycode` requirement implements RFC3492, but RFC6265 requires RFC5891\n * better tests for `validate()`?\n\n# Copyright and License\n\n(tl;dr: MIT with some MPL/1.1)\n\nCopyright 2012- GoInstant, Inc. and other contributors. All rights reserved.\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to\ndeal in the Software without restriction, including without limitation the\nrights to use, copy, modify, merge, publish, distribute, sublicense, and/or\nsell copies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\nFROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\nIN THE SOFTWARE.\n\nPortions may be licensed under different licenses (in particular public-suffix.txt is MPL/1.1); please read the LICENSE file for full details.\n", + "readmeFilename": "README.md", + "_id": "tough-cookie@0.12.1", + "dist": { + "shasum": "8220c7e21abd5b13d96804254bd5a81ebf2c7d62", + "tarball": "http://registry.npmjs.org/tough-cookie/-/tough-cookie-0.12.1.tgz" + }, + "_from": "tough-cookie@>=0.12.0", + "_npmVersion": "1.3.11", + "_npmUser": { + "name": "goinstant", + "email": "support@goinstant.com" + }, + "maintainers": [ + { + "name": "jstash", + "email": "jeremy@goinstant.com" + }, + { + "name": "goinstant", + "email": "services@goinstant.com" + } + ], + "directories": {}, + "_shasum": "8220c7e21abd5b13d96804254bd5a81ebf2c7d62", + "_resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-0.12.1.tgz" +} diff --git a/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/tough-cookie/public-suffix.txt b/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/tough-cookie/public-suffix.txt new file mode 100644 index 0000000..2c20131 --- /dev/null +++ b/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/tough-cookie/public-suffix.txt @@ -0,0 +1,5229 @@ +// ***** BEGIN LICENSE BLOCK ***** +// Version: MPL 1.1/GPL 2.0/LGPL 2.1 +// +// The contents of this file are subject to the Mozilla Public License Version +// 1.1 (the "License"); you may not use this file except in compliance with +// the License. You may obtain a copy of the License at +// http://www.mozilla.org/MPL/ +// +// Software distributed under the License is distributed on an "AS IS" basis, +// WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License +// for the specific language governing rights and limitations under the +// License. +// +// The Original Code is the Public Suffix List. +// +// The Initial Developer of the Original Code is +// Jo Hermans . +// Portions created by the Initial Developer are Copyright (C) 2007 +// the Initial Developer. All Rights Reserved. +// +// Contributor(s): +// Ruben Arakelyan +// Gervase Markham +// Pamela Greene +// David Triendl +// Jothan Frakes +// The kind representatives of many TLD registries +// +// Alternatively, the contents of this file may be used under the terms of +// either the GNU General Public License Version 2 or later (the "GPL"), or +// the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), +// in which case the provisions of the GPL or the LGPL are applicable instead +// of those above. If you wish to allow use of your version of this file only +// under the terms of either the GPL or the LGPL, and not to allow others to +// use your version of this file under the terms of the MPL, indicate your +// decision by deleting the provisions above and replace them with the notice +// and other provisions required by the GPL or the LGPL. If you do not delete +// the provisions above, a recipient may use your version of this file under +// the terms of any one of the MPL, the GPL or the LGPL. +// +// ***** END LICENSE BLOCK ***** + +// ===BEGIN ICANN DOMAINS=== + +// ac : http://en.wikipedia.org/wiki/.ac +ac +com.ac +edu.ac +gov.ac +net.ac +mil.ac +org.ac + +// ad : http://en.wikipedia.org/wiki/.ad +ad +nom.ad + +// ae : http://en.wikipedia.org/wiki/.ae +// see also: "Domain Name Eligibility Policy" at http://www.aeda.ae/eng/aepolicy.php +ae +co.ae +net.ae +org.ae +sch.ae +ac.ae +gov.ae +mil.ae + +// aero : see http://www.information.aero/index.php?id=66 +aero +accident-investigation.aero +accident-prevention.aero +aerobatic.aero +aeroclub.aero +aerodrome.aero +agents.aero +aircraft.aero +airline.aero +airport.aero +air-surveillance.aero +airtraffic.aero +air-traffic-control.aero +ambulance.aero +amusement.aero +association.aero +author.aero +ballooning.aero +broker.aero +caa.aero +cargo.aero +catering.aero +certification.aero +championship.aero +charter.aero +civilaviation.aero +club.aero +conference.aero +consultant.aero +consulting.aero +control.aero +council.aero +crew.aero +design.aero +dgca.aero +educator.aero +emergency.aero +engine.aero +engineer.aero +entertainment.aero +equipment.aero +exchange.aero +express.aero +federation.aero +flight.aero +freight.aero +fuel.aero +gliding.aero +government.aero +groundhandling.aero +group.aero +hanggliding.aero +homebuilt.aero +insurance.aero +journal.aero +journalist.aero +leasing.aero +logistics.aero +magazine.aero +maintenance.aero +marketplace.aero +media.aero +microlight.aero +modelling.aero +navigation.aero +parachuting.aero +paragliding.aero +passenger-association.aero +pilot.aero +press.aero +production.aero +recreation.aero +repbody.aero +res.aero +research.aero +rotorcraft.aero +safety.aero +scientist.aero +services.aero +show.aero +skydiving.aero +software.aero +student.aero +taxi.aero +trader.aero +trading.aero +trainer.aero +union.aero +workinggroup.aero +works.aero + +// af : http://www.nic.af/help.jsp +af +gov.af +com.af +org.af +net.af +edu.af + +// ag : http://www.nic.ag/prices.htm +ag +com.ag +org.ag +net.ag +co.ag +nom.ag + +// ai : http://nic.com.ai/ +ai +off.ai +com.ai +net.ai +org.ai + +// al : http://www.ert.gov.al/ert_alb/faq_det.html?Id=31 +al +com.al +edu.al +gov.al +mil.al +net.al +org.al + +// am : http://en.wikipedia.org/wiki/.am +am + +// an : http://www.una.an/an_domreg/default.asp +an +com.an +net.an +org.an +edu.an + +// ao : http://en.wikipedia.org/wiki/.ao +// http://www.dns.ao/REGISTR.DOC +ao +ed.ao +gv.ao +og.ao +co.ao +pb.ao +it.ao + +// aq : http://en.wikipedia.org/wiki/.aq +aq + +// ar : http://en.wikipedia.org/wiki/.ar +*.ar +!congresodelalengua3.ar +!educ.ar +!gobiernoelectronico.ar +!mecon.ar +!nacion.ar +!nic.ar +!promocion.ar +!retina.ar +!uba.ar + +// arpa : http://en.wikipedia.org/wiki/.arpa +// Confirmed by registry 2008-06-18 +e164.arpa +in-addr.arpa +ip6.arpa +iris.arpa +uri.arpa +urn.arpa + +// as : http://en.wikipedia.org/wiki/.as +as +gov.as + +// asia : http://en.wikipedia.org/wiki/.asia +asia + +// at : http://en.wikipedia.org/wiki/.at +// Confirmed by registry 2008-06-17 +at +ac.at +co.at +gv.at +or.at + +// au : http://en.wikipedia.org/wiki/.au +// http://www.auda.org.au/ +// 2LDs +com.au +net.au +org.au +edu.au +gov.au +csiro.au +asn.au +id.au +// Historic 2LDs (closed to new registration, but sites still exist) +info.au +conf.au +oz.au +// CGDNs - http://www.cgdn.org.au/ +act.au +nsw.au +nt.au +qld.au +sa.au +tas.au +vic.au +wa.au +// 3LDs +act.edu.au +nsw.edu.au +nt.edu.au +qld.edu.au +sa.edu.au +tas.edu.au +vic.edu.au +wa.edu.au +act.gov.au +// Removed at request of Shae.Donelan@services.nsw.gov.au, 2010-03-04 +// nsw.gov.au +nt.gov.au +qld.gov.au +sa.gov.au +tas.gov.au +vic.gov.au +wa.gov.au + +// aw : http://en.wikipedia.org/wiki/.aw +aw +com.aw + +// ax : http://en.wikipedia.org/wiki/.ax +ax + +// az : http://en.wikipedia.org/wiki/.az +az +com.az +net.az +int.az +gov.az +org.az +edu.az +info.az +pp.az +mil.az +name.az +pro.az +biz.az + +// ba : http://en.wikipedia.org/wiki/.ba +ba +org.ba +net.ba +edu.ba +gov.ba +mil.ba +unsa.ba +unbi.ba +co.ba +com.ba +rs.ba + +// bb : http://en.wikipedia.org/wiki/.bb +bb +biz.bb +com.bb +edu.bb +gov.bb +info.bb +net.bb +org.bb +store.bb + +// bd : http://en.wikipedia.org/wiki/.bd +*.bd + +// be : http://en.wikipedia.org/wiki/.be +// Confirmed by registry 2008-06-08 +be +ac.be + +// bf : http://en.wikipedia.org/wiki/.bf +bf +gov.bf + +// bg : http://en.wikipedia.org/wiki/.bg +// https://www.register.bg/user/static/rules/en/index.html +bg +a.bg +b.bg +c.bg +d.bg +e.bg +f.bg +g.bg +h.bg +i.bg +j.bg +k.bg +l.bg +m.bg +n.bg +o.bg +p.bg +q.bg +r.bg +s.bg +t.bg +u.bg +v.bg +w.bg +x.bg +y.bg +z.bg +0.bg +1.bg +2.bg +3.bg +4.bg +5.bg +6.bg +7.bg +8.bg +9.bg + +// bh : http://en.wikipedia.org/wiki/.bh +bh +com.bh +edu.bh +net.bh +org.bh +gov.bh + +// bi : http://en.wikipedia.org/wiki/.bi +// http://whois.nic.bi/ +bi +co.bi +com.bi +edu.bi +or.bi +org.bi + +// biz : http://en.wikipedia.org/wiki/.biz +biz + +// bj : http://en.wikipedia.org/wiki/.bj +bj +asso.bj +barreau.bj +gouv.bj + +// bm : http://www.bermudanic.bm/dnr-text.txt +bm +com.bm +edu.bm +gov.bm +net.bm +org.bm + +// bn : http://en.wikipedia.org/wiki/.bn +*.bn + +// bo : http://www.nic.bo/ +bo +com.bo +edu.bo +gov.bo +gob.bo +int.bo +org.bo +net.bo +mil.bo +tv.bo + +// br : http://registro.br/dominio/dpn.html +// Updated by registry 2011-03-01 +br +adm.br +adv.br +agr.br +am.br +arq.br +art.br +ato.br +b.br +bio.br +blog.br +bmd.br +can.br +cim.br +cng.br +cnt.br +com.br +coop.br +ecn.br +edu.br +emp.br +eng.br +esp.br +etc.br +eti.br +far.br +flog.br +fm.br +fnd.br +fot.br +fst.br +g12.br +ggf.br +gov.br +imb.br +ind.br +inf.br +jor.br +jus.br +lel.br +mat.br +med.br +mil.br +mus.br +net.br +nom.br +not.br +ntr.br +odo.br +org.br +ppg.br +pro.br +psc.br +psi.br +qsl.br +radio.br +rec.br +slg.br +srv.br +taxi.br +teo.br +tmp.br +trd.br +tur.br +tv.br +vet.br +vlog.br +wiki.br +zlg.br + +// bs : http://www.nic.bs/rules.html +bs +com.bs +net.bs +org.bs +edu.bs +gov.bs + +// bt : http://en.wikipedia.org/wiki/.bt +bt +com.bt +edu.bt +gov.bt +net.bt +org.bt + +// bv : No registrations at this time. +// Submitted by registry 2006-06-16 + +// bw : http://en.wikipedia.org/wiki/.bw +// http://www.gobin.info/domainname/bw.doc +// list of other 2nd level tlds ? +bw +co.bw +org.bw + +// by : http://en.wikipedia.org/wiki/.by +// http://tld.by/rules_2006_en.html +// list of other 2nd level tlds ? +by +gov.by +mil.by +// Official information does not indicate that com.by is a reserved +// second-level domain, but it's being used as one (see www.google.com.by and +// www.yahoo.com.by, for example), so we list it here for safety's sake. +com.by + +// http://hoster.by/ +of.by + +// bz : http://en.wikipedia.org/wiki/.bz +// http://www.belizenic.bz/ +bz +com.bz +net.bz +org.bz +edu.bz +gov.bz + +// ca : http://en.wikipedia.org/wiki/.ca +ca +// ca geographical names +ab.ca +bc.ca +mb.ca +nb.ca +nf.ca +nl.ca +ns.ca +nt.ca +nu.ca +on.ca +pe.ca +qc.ca +sk.ca +yk.ca +// gc.ca: http://en.wikipedia.org/wiki/.gc.ca +// see also: http://registry.gc.ca/en/SubdomainFAQ +gc.ca + +// cat : http://en.wikipedia.org/wiki/.cat +cat + +// cc : http://en.wikipedia.org/wiki/.cc +cc + +// cd : http://en.wikipedia.org/wiki/.cd +// see also: https://www.nic.cd/domain/insertDomain_2.jsp?act=1 +cd +gov.cd + +// cf : http://en.wikipedia.org/wiki/.cf +cf + +// cg : http://en.wikipedia.org/wiki/.cg +cg + +// ch : http://en.wikipedia.org/wiki/.ch +ch + +// ci : http://en.wikipedia.org/wiki/.ci +// http://www.nic.ci/index.php?page=charte +ci +org.ci +or.ci +com.ci +co.ci +edu.ci +ed.ci +ac.ci +net.ci +go.ci +asso.ci +aéroport.ci +int.ci +presse.ci +md.ci +gouv.ci + +// ck : http://en.wikipedia.org/wiki/.ck +*.ck +!www.ck + +// cl : http://en.wikipedia.org/wiki/.cl +cl +gov.cl +gob.cl +co.cl +mil.cl + +// cm : http://en.wikipedia.org/wiki/.cm +cm +gov.cm + +// cn : http://en.wikipedia.org/wiki/.cn +// Submitted by registry 2008-06-11 +cn +ac.cn +com.cn +edu.cn +gov.cn +net.cn +org.cn +mil.cn +公司.cn +网络.cn +網絡.cn +// cn geographic names +ah.cn +bj.cn +cq.cn +fj.cn +gd.cn +gs.cn +gz.cn +gx.cn +ha.cn +hb.cn +he.cn +hi.cn +hl.cn +hn.cn +jl.cn +js.cn +jx.cn +ln.cn +nm.cn +nx.cn +qh.cn +sc.cn +sd.cn +sh.cn +sn.cn +sx.cn +tj.cn +xj.cn +xz.cn +yn.cn +zj.cn +hk.cn +mo.cn +tw.cn + +// co : http://en.wikipedia.org/wiki/.co +// Submitted by registry 2008-06-11 +co +arts.co +com.co +edu.co +firm.co +gov.co +info.co +int.co +mil.co +net.co +nom.co +org.co +rec.co +web.co + +// com : http://en.wikipedia.org/wiki/.com +com + +// coop : http://en.wikipedia.org/wiki/.coop +coop + +// cr : http://www.nic.cr/niccr_publico/showRegistroDominiosScreen.do +cr +ac.cr +co.cr +ed.cr +fi.cr +go.cr +or.cr +sa.cr + +// cu : http://en.wikipedia.org/wiki/.cu +cu +com.cu +edu.cu +org.cu +net.cu +gov.cu +inf.cu + +// cv : http://en.wikipedia.org/wiki/.cv +cv + +// cx : http://en.wikipedia.org/wiki/.cx +// list of other 2nd level tlds ? +cx +gov.cx + +// cy : http://en.wikipedia.org/wiki/.cy +*.cy + +// cz : http://en.wikipedia.org/wiki/.cz +cz + +// de : http://en.wikipedia.org/wiki/.de +// Confirmed by registry (with technical +// reservations) 2008-07-01 +de + +// dj : http://en.wikipedia.org/wiki/.dj +dj + +// dk : http://en.wikipedia.org/wiki/.dk +// Confirmed by registry 2008-06-17 +dk + +// dm : http://en.wikipedia.org/wiki/.dm +dm +com.dm +net.dm +org.dm +edu.dm +gov.dm + +// do : http://en.wikipedia.org/wiki/.do +do +art.do +com.do +edu.do +gob.do +gov.do +mil.do +net.do +org.do +sld.do +web.do + +// dz : http://en.wikipedia.org/wiki/.dz +dz +com.dz +org.dz +net.dz +gov.dz +edu.dz +asso.dz +pol.dz +art.dz + +// ec : http://www.nic.ec/reg/paso1.asp +// Submitted by registry 2008-07-04 +ec +com.ec +info.ec +net.ec +fin.ec +k12.ec +med.ec +pro.ec +org.ec +edu.ec +gov.ec +gob.ec +mil.ec + +// edu : http://en.wikipedia.org/wiki/.edu +edu + +// ee : http://www.eenet.ee/EENet/dom_reeglid.html#lisa_B +ee +edu.ee +gov.ee +riik.ee +lib.ee +med.ee +com.ee +pri.ee +aip.ee +org.ee +fie.ee + +// eg : http://en.wikipedia.org/wiki/.eg +eg +com.eg +edu.eg +eun.eg +gov.eg +mil.eg +name.eg +net.eg +org.eg +sci.eg + +// er : http://en.wikipedia.org/wiki/.er +*.er + +// es : https://www.nic.es/site_ingles/ingles/dominios/index.html +es +com.es +nom.es +org.es +gob.es +edu.es + +// et : http://en.wikipedia.org/wiki/.et +*.et + +// eu : http://en.wikipedia.org/wiki/.eu +eu + +// fi : http://en.wikipedia.org/wiki/.fi +fi +// aland.fi : http://en.wikipedia.org/wiki/.ax +// This domain is being phased out in favor of .ax. As there are still many +// domains under aland.fi, we still keep it on the list until aland.fi is +// completely removed. +// TODO: Check for updates (expected to be phased out around Q1/2009) +aland.fi + +// fj : http://en.wikipedia.org/wiki/.fj +*.fj + +// fk : http://en.wikipedia.org/wiki/.fk +*.fk + +// fm : http://en.wikipedia.org/wiki/.fm +fm + +// fo : http://en.wikipedia.org/wiki/.fo +fo + +// fr : http://www.afnic.fr/ +// domaines descriptifs : http://www.afnic.fr/obtenir/chartes/nommage-fr/annexe-descriptifs +fr +com.fr +asso.fr +nom.fr +prd.fr +presse.fr +tm.fr +// domaines sectoriels : http://www.afnic.fr/obtenir/chartes/nommage-fr/annexe-sectoriels +aeroport.fr +assedic.fr +avocat.fr +avoues.fr +cci.fr +chambagri.fr +chirurgiens-dentistes.fr +experts-comptables.fr +geometre-expert.fr +gouv.fr +greta.fr +huissier-justice.fr +medecin.fr +notaires.fr +pharmacien.fr +port.fr +veterinaire.fr + +// ga : http://en.wikipedia.org/wiki/.ga +ga + +// gb : This registry is effectively dormant +// Submitted by registry 2008-06-12 + +// gd : http://en.wikipedia.org/wiki/.gd +gd + +// ge : http://www.nic.net.ge/policy_en.pdf +ge +com.ge +edu.ge +gov.ge +org.ge +mil.ge +net.ge +pvt.ge + +// gf : http://en.wikipedia.org/wiki/.gf +gf + +// gg : http://www.channelisles.net/applic/avextn.shtml +gg +co.gg +org.gg +net.gg +sch.gg +gov.gg + +// gh : http://en.wikipedia.org/wiki/.gh +// see also: http://www.nic.gh/reg_now.php +// Although domains directly at second level are not possible at the moment, +// they have been possible for some time and may come back. +gh +com.gh +edu.gh +gov.gh +org.gh +mil.gh + +// gi : http://www.nic.gi/rules.html +gi +com.gi +ltd.gi +gov.gi +mod.gi +edu.gi +org.gi + +// gl : http://en.wikipedia.org/wiki/.gl +// http://nic.gl +gl + +// gm : http://www.nic.gm/htmlpages%5Cgm-policy.htm +gm + +// gn : http://psg.com/dns/gn/gn.txt +// Submitted by registry 2008-06-17 +ac.gn +com.gn +edu.gn +gov.gn +org.gn +net.gn + +// gov : http://en.wikipedia.org/wiki/.gov +gov + +// gp : http://www.nic.gp/index.php?lang=en +gp +com.gp +net.gp +mobi.gp +edu.gp +org.gp +asso.gp + +// gq : http://en.wikipedia.org/wiki/.gq +gq + +// gr : https://grweb.ics.forth.gr/english/1617-B-2005.html +// Submitted by registry 2008-06-09 +gr +com.gr +edu.gr +net.gr +org.gr +gov.gr + +// gs : http://en.wikipedia.org/wiki/.gs +gs + +// gt : http://www.gt/politicas.html +*.gt +!www.gt + +// gu : http://gadao.gov.gu/registration.txt +*.gu + +// gw : http://en.wikipedia.org/wiki/.gw +gw + +// gy : http://en.wikipedia.org/wiki/.gy +// http://registry.gy/ +gy +co.gy +com.gy +net.gy + +// hk : https://www.hkdnr.hk +// Submitted by registry 2008-06-11 +hk +com.hk +edu.hk +gov.hk +idv.hk +net.hk +org.hk +公司.hk +教育.hk +敎育.hk +政府.hk +個人.hk +个人.hk +箇人.hk +網络.hk +网络.hk +组織.hk +網絡.hk +网絡.hk +组织.hk +組織.hk +組织.hk + +// hm : http://en.wikipedia.org/wiki/.hm +hm + +// hn : http://www.nic.hn/politicas/ps02,,05.html +hn +com.hn +edu.hn +org.hn +net.hn +mil.hn +gob.hn + +// hr : http://www.dns.hr/documents/pdf/HRTLD-regulations.pdf +hr +iz.hr +from.hr +name.hr +com.hr + +// ht : http://www.nic.ht/info/charte.cfm +ht +com.ht +shop.ht +firm.ht +info.ht +adult.ht +net.ht +pro.ht +org.ht +med.ht +art.ht +coop.ht +pol.ht +asso.ht +edu.ht +rel.ht +gouv.ht +perso.ht + +// hu : http://www.domain.hu/domain/English/sld.html +// Confirmed by registry 2008-06-12 +hu +co.hu +info.hu +org.hu +priv.hu +sport.hu +tm.hu +2000.hu +agrar.hu +bolt.hu +casino.hu +city.hu +erotica.hu +erotika.hu +film.hu +forum.hu +games.hu +hotel.hu +ingatlan.hu +jogasz.hu +konyvelo.hu +lakas.hu +media.hu +news.hu +reklam.hu +sex.hu +shop.hu +suli.hu +szex.hu +tozsde.hu +utazas.hu +video.hu + +// id : http://en.wikipedia.org/wiki/.id +// see also: https://register.pandi.or.id/ +id +ac.id +co.id +go.id +mil.id +net.id +or.id +sch.id +web.id + +// ie : http://en.wikipedia.org/wiki/.ie +ie +gov.ie + +// il : http://en.wikipedia.org/wiki/.il +*.il + +// im : https://www.nic.im/pdfs/imfaqs.pdf +im +co.im +ltd.co.im +plc.co.im +net.im +gov.im +org.im +nic.im +ac.im + +// in : http://en.wikipedia.org/wiki/.in +// see also: http://www.inregistry.in/policies/ +// Please note, that nic.in is not an offical eTLD, but used by most +// government institutions. +in +co.in +firm.in +net.in +org.in +gen.in +ind.in +nic.in +ac.in +edu.in +res.in +gov.in +mil.in + +// info : http://en.wikipedia.org/wiki/.info +info + +// int : http://en.wikipedia.org/wiki/.int +// Confirmed by registry 2008-06-18 +int +eu.int + +// io : http://www.nic.io/rules.html +// list of other 2nd level tlds ? +io +com.io + +// iq : http://www.cmc.iq/english/iq/iqregister1.htm +iq +gov.iq +edu.iq +mil.iq +com.iq +org.iq +net.iq + +// ir : http://www.nic.ir/Terms_and_Conditions_ir,_Appendix_1_Domain_Rules +// Also see http://www.nic.ir/Internationalized_Domain_Names +// Two .ir entries added at request of , 2010-04-16 +ir +ac.ir +co.ir +gov.ir +id.ir +net.ir +org.ir +sch.ir +// xn--mgba3a4f16a.ir (.ir, Persian YEH) +ایران.ir +// xn--mgba3a4fra.ir (.ir, Arabic YEH) +ايران.ir + +// is : http://www.isnic.is/domain/rules.php +// Confirmed by registry 2008-12-06 +is +net.is +com.is +edu.is +gov.is +org.is +int.is + +// it : http://en.wikipedia.org/wiki/.it +it +gov.it +edu.it +// list of reserved geo-names : +// http://www.nic.it/documenti/regolamenti-e-linee-guida/regolamento-assegnazione-versione-6.0.pdf +// (There is also a list of reserved geo-names corresponding to Italian +// municipalities : http://www.nic.it/documenti/appendice-c.pdf , but it is +// not included here.) +agrigento.it +ag.it +alessandria.it +al.it +ancona.it +an.it +aosta.it +aoste.it +ao.it +arezzo.it +ar.it +ascoli-piceno.it +ascolipiceno.it +ap.it +asti.it +at.it +avellino.it +av.it +bari.it +ba.it +andria-barletta-trani.it +andriabarlettatrani.it +trani-barletta-andria.it +tranibarlettaandria.it +barletta-trani-andria.it +barlettatraniandria.it +andria-trani-barletta.it +andriatranibarletta.it +trani-andria-barletta.it +traniandriabarletta.it +bt.it +belluno.it +bl.it +benevento.it +bn.it +bergamo.it +bg.it +biella.it +bi.it +bologna.it +bo.it +bolzano.it +bozen.it +balsan.it +alto-adige.it +altoadige.it +suedtirol.it +bz.it +brescia.it +bs.it +brindisi.it +br.it +cagliari.it +ca.it +caltanissetta.it +cl.it +campobasso.it +cb.it +carboniaiglesias.it +carbonia-iglesias.it +iglesias-carbonia.it +iglesiascarbonia.it +ci.it +caserta.it +ce.it +catania.it +ct.it +catanzaro.it +cz.it +chieti.it +ch.it +como.it +co.it +cosenza.it +cs.it +cremona.it +cr.it +crotone.it +kr.it +cuneo.it +cn.it +dell-ogliastra.it +dellogliastra.it +ogliastra.it +og.it +enna.it +en.it +ferrara.it +fe.it +fermo.it +fm.it +firenze.it +florence.it +fi.it +foggia.it +fg.it +forli-cesena.it +forlicesena.it +cesena-forli.it +cesenaforli.it +fc.it +frosinone.it +fr.it +genova.it +genoa.it +ge.it +gorizia.it +go.it +grosseto.it +gr.it +imperia.it +im.it +isernia.it +is.it +laquila.it +aquila.it +aq.it +la-spezia.it +laspezia.it +sp.it +latina.it +lt.it +lecce.it +le.it +lecco.it +lc.it +livorno.it +li.it +lodi.it +lo.it +lucca.it +lu.it +macerata.it +mc.it +mantova.it +mn.it +massa-carrara.it +massacarrara.it +carrara-massa.it +carraramassa.it +ms.it +matera.it +mt.it +medio-campidano.it +mediocampidano.it +campidano-medio.it +campidanomedio.it +vs.it +messina.it +me.it +milano.it +milan.it +mi.it +modena.it +mo.it +monza.it +monza-brianza.it +monzabrianza.it +monzaebrianza.it +monzaedellabrianza.it +monza-e-della-brianza.it +mb.it +napoli.it +naples.it +na.it +novara.it +no.it +nuoro.it +nu.it +oristano.it +or.it +padova.it +padua.it +pd.it +palermo.it +pa.it +parma.it +pr.it +pavia.it +pv.it +perugia.it +pg.it +pescara.it +pe.it +pesaro-urbino.it +pesarourbino.it +urbino-pesaro.it +urbinopesaro.it +pu.it +piacenza.it +pc.it +pisa.it +pi.it +pistoia.it +pt.it +pordenone.it +pn.it +potenza.it +pz.it +prato.it +po.it +ragusa.it +rg.it +ravenna.it +ra.it +reggio-calabria.it +reggiocalabria.it +rc.it +reggio-emilia.it +reggioemilia.it +re.it +rieti.it +ri.it +rimini.it +rn.it +roma.it +rome.it +rm.it +rovigo.it +ro.it +salerno.it +sa.it +sassari.it +ss.it +savona.it +sv.it +siena.it +si.it +siracusa.it +sr.it +sondrio.it +so.it +taranto.it +ta.it +tempio-olbia.it +tempioolbia.it +olbia-tempio.it +olbiatempio.it +ot.it +teramo.it +te.it +terni.it +tr.it +torino.it +turin.it +to.it +trapani.it +tp.it +trento.it +trentino.it +tn.it +treviso.it +tv.it +trieste.it +ts.it +udine.it +ud.it +varese.it +va.it +venezia.it +venice.it +ve.it +verbania.it +vb.it +vercelli.it +vc.it +verona.it +vr.it +vibo-valentia.it +vibovalentia.it +vv.it +vicenza.it +vi.it +viterbo.it +vt.it + +// je : http://www.channelisles.net/applic/avextn.shtml +je +co.je +org.je +net.je +sch.je +gov.je + +// jm : http://www.com.jm/register.html +*.jm + +// jo : http://www.dns.jo/Registration_policy.aspx +jo +com.jo +org.jo +net.jo +edu.jo +sch.jo +gov.jo +mil.jo +name.jo + +// jobs : http://en.wikipedia.org/wiki/.jobs +jobs + +// jp : http://en.wikipedia.org/wiki/.jp +// http://jprs.co.jp/en/jpdomain.html +// Submitted by registry 2008-06-11 +// Updated by registry 2008-12-04 +jp +// jp organizational type names +ac.jp +ad.jp +co.jp +ed.jp +go.jp +gr.jp +lg.jp +ne.jp +or.jp +// jp geographic type names +// http://jprs.jp/doc/rule/saisoku-1.html +*.aichi.jp +*.akita.jp +*.aomori.jp +*.chiba.jp +*.ehime.jp +*.fukui.jp +*.fukuoka.jp +*.fukushima.jp +*.gifu.jp +*.gunma.jp +*.hiroshima.jp +*.hokkaido.jp +*.hyogo.jp +*.ibaraki.jp +*.ishikawa.jp +*.iwate.jp +*.kagawa.jp +*.kagoshima.jp +*.kanagawa.jp +*.kawasaki.jp +*.kitakyushu.jp +*.kobe.jp +*.kochi.jp +*.kumamoto.jp +*.kyoto.jp +*.mie.jp +*.miyagi.jp +*.miyazaki.jp +*.nagano.jp +*.nagasaki.jp +*.nagoya.jp +*.nara.jp +*.niigata.jp +*.oita.jp +*.okayama.jp +*.okinawa.jp +*.osaka.jp +*.saga.jp +*.saitama.jp +*.sapporo.jp +*.sendai.jp +*.shiga.jp +*.shimane.jp +*.shizuoka.jp +*.tochigi.jp +*.tokushima.jp +*.tokyo.jp +*.tottori.jp +*.toyama.jp +*.wakayama.jp +*.yamagata.jp +*.yamaguchi.jp +*.yamanashi.jp +*.yokohama.jp +!metro.tokyo.jp +!pref.aichi.jp +!pref.akita.jp +!pref.aomori.jp +!pref.chiba.jp +!pref.ehime.jp +!pref.fukui.jp +!pref.fukuoka.jp +!pref.fukushima.jp +!pref.gifu.jp +!pref.gunma.jp +!pref.hiroshima.jp +!pref.hokkaido.jp +!pref.hyogo.jp +!pref.ibaraki.jp +!pref.ishikawa.jp +!pref.iwate.jp +!pref.kagawa.jp +!pref.kagoshima.jp +!pref.kanagawa.jp +!pref.kochi.jp +!pref.kumamoto.jp +!pref.kyoto.jp +!pref.mie.jp +!pref.miyagi.jp +!pref.miyazaki.jp +!pref.nagano.jp +!pref.nagasaki.jp +!pref.nara.jp +!pref.niigata.jp +!pref.oita.jp +!pref.okayama.jp +!pref.okinawa.jp +!pref.osaka.jp +!pref.saga.jp +!pref.saitama.jp +!pref.shiga.jp +!pref.shimane.jp +!pref.shizuoka.jp +!pref.tochigi.jp +!pref.tokushima.jp +!pref.tottori.jp +!pref.toyama.jp +!pref.wakayama.jp +!pref.yamagata.jp +!pref.yamaguchi.jp +!pref.yamanashi.jp +!city.chiba.jp +!city.fukuoka.jp +!city.hiroshima.jp +!city.kawasaki.jp +!city.kitakyushu.jp +!city.kobe.jp +!city.kyoto.jp +!city.nagoya.jp +!city.niigata.jp +!city.okayama.jp +!city.osaka.jp +!city.saitama.jp +!city.sapporo.jp +!city.sendai.jp +!city.shizuoka.jp +!city.yokohama.jp + +// ke : http://www.kenic.or.ke/index.php?option=com_content&task=view&id=117&Itemid=145 +*.ke + +// kg : http://www.domain.kg/dmn_n.html +kg +org.kg +net.kg +com.kg +edu.kg +gov.kg +mil.kg + +// kh : http://www.mptc.gov.kh/dns_registration.htm +*.kh + +// ki : http://www.ki/dns/index.html +ki +edu.ki +biz.ki +net.ki +org.ki +gov.ki +info.ki +com.ki + +// km : http://en.wikipedia.org/wiki/.km +// http://www.domaine.km/documents/charte.doc +km +org.km +nom.km +gov.km +prd.km +tm.km +edu.km +mil.km +ass.km +com.km +// These are only mentioned as proposed suggestions at domaine.km, but +// http://en.wikipedia.org/wiki/.km says they're available for registration: +coop.km +asso.km +presse.km +medecin.km +notaires.km +pharmaciens.km +veterinaire.km +gouv.km + +// kn : http://en.wikipedia.org/wiki/.kn +// http://www.dot.kn/domainRules.html +kn +net.kn +org.kn +edu.kn +gov.kn + +// kp : http://www.kcce.kp/en_index.php +com.kp +edu.kp +gov.kp +org.kp +rep.kp +tra.kp + +// kr : http://en.wikipedia.org/wiki/.kr +// see also: http://domain.nida.or.kr/eng/registration.jsp +kr +ac.kr +co.kr +es.kr +go.kr +hs.kr +kg.kr +mil.kr +ms.kr +ne.kr +or.kr +pe.kr +re.kr +sc.kr +// kr geographical names +busan.kr +chungbuk.kr +chungnam.kr +daegu.kr +daejeon.kr +gangwon.kr +gwangju.kr +gyeongbuk.kr +gyeonggi.kr +gyeongnam.kr +incheon.kr +jeju.kr +jeonbuk.kr +jeonnam.kr +seoul.kr +ulsan.kr + +// kw : http://en.wikipedia.org/wiki/.kw +*.kw + +// ky : http://www.icta.ky/da_ky_reg_dom.php +// Confirmed by registry 2008-06-17 +ky +edu.ky +gov.ky +com.ky +org.ky +net.ky + +// kz : http://en.wikipedia.org/wiki/.kz +// see also: http://www.nic.kz/rules/index.jsp +kz +org.kz +edu.kz +net.kz +gov.kz +mil.kz +com.kz + +// la : http://en.wikipedia.org/wiki/.la +// Submitted by registry 2008-06-10 +la +int.la +net.la +info.la +edu.la +gov.la +per.la +com.la +org.la + +// lb : http://en.wikipedia.org/wiki/.lb +// Submitted by registry 2008-06-17 +com.lb +edu.lb +gov.lb +net.lb +org.lb + +// lc : http://en.wikipedia.org/wiki/.lc +// see also: http://www.nic.lc/rules.htm +lc +com.lc +net.lc +co.lc +org.lc +edu.lc +gov.lc + +// li : http://en.wikipedia.org/wiki/.li +li + +// lk : http://www.nic.lk/seclevpr.html +lk +gov.lk +sch.lk +net.lk +int.lk +com.lk +org.lk +edu.lk +ngo.lk +soc.lk +web.lk +ltd.lk +assn.lk +grp.lk +hotel.lk + +// lr : http://psg.com/dns/lr/lr.txt +// Submitted by registry 2008-06-17 +com.lr +edu.lr +gov.lr +org.lr +net.lr + +// ls : http://en.wikipedia.org/wiki/.ls +ls +co.ls +org.ls + +// lt : http://en.wikipedia.org/wiki/.lt +lt +// gov.lt : http://www.gov.lt/index_en.php +gov.lt + +// lu : http://www.dns.lu/en/ +lu + +// lv : http://www.nic.lv/DNS/En/generic.php +lv +com.lv +edu.lv +gov.lv +org.lv +mil.lv +id.lv +net.lv +asn.lv +conf.lv + +// ly : http://www.nic.ly/regulations.php +ly +com.ly +net.ly +gov.ly +plc.ly +edu.ly +sch.ly +med.ly +org.ly +id.ly + +// ma : http://en.wikipedia.org/wiki/.ma +// http://www.anrt.ma/fr/admin/download/upload/file_fr782.pdf +ma +co.ma +net.ma +gov.ma +org.ma +ac.ma +press.ma + +// mc : http://www.nic.mc/ +mc +tm.mc +asso.mc + +// md : http://en.wikipedia.org/wiki/.md +md + +// me : http://en.wikipedia.org/wiki/.me +me +co.me +net.me +org.me +edu.me +ac.me +gov.me +its.me +priv.me + +// mg : http://www.nic.mg/tarif.htm +mg +org.mg +nom.mg +gov.mg +prd.mg +tm.mg +edu.mg +mil.mg +com.mg + +// mh : http://en.wikipedia.org/wiki/.mh +mh + +// mil : http://en.wikipedia.org/wiki/.mil +mil + +// mk : http://en.wikipedia.org/wiki/.mk +// see also: http://dns.marnet.net.mk/postapka.php +mk +com.mk +org.mk +net.mk +edu.mk +gov.mk +inf.mk +name.mk + +// ml : http://www.gobin.info/domainname/ml-template.doc +// see also: http://en.wikipedia.org/wiki/.ml +ml +com.ml +edu.ml +gouv.ml +gov.ml +net.ml +org.ml +presse.ml + +// mm : http://en.wikipedia.org/wiki/.mm +*.mm + +// mn : http://en.wikipedia.org/wiki/.mn +mn +gov.mn +edu.mn +org.mn + +// mo : http://www.monic.net.mo/ +mo +com.mo +net.mo +org.mo +edu.mo +gov.mo + +// mobi : http://en.wikipedia.org/wiki/.mobi +mobi + +// mp : http://www.dot.mp/ +// Confirmed by registry 2008-06-17 +mp + +// mq : http://en.wikipedia.org/wiki/.mq +mq + +// mr : http://en.wikipedia.org/wiki/.mr +mr +gov.mr + +// ms : http://en.wikipedia.org/wiki/.ms +ms + +// mt : https://www.nic.org.mt/dotmt/ +*.mt + +// mu : http://en.wikipedia.org/wiki/.mu +mu +com.mu +net.mu +org.mu +gov.mu +ac.mu +co.mu +or.mu + +// museum : http://about.museum/naming/ +// http://index.museum/ +museum +academy.museum +agriculture.museum +air.museum +airguard.museum +alabama.museum +alaska.museum +amber.museum +ambulance.museum +american.museum +americana.museum +americanantiques.museum +americanart.museum +amsterdam.museum +and.museum +annefrank.museum +anthro.museum +anthropology.museum +antiques.museum +aquarium.museum +arboretum.museum +archaeological.museum +archaeology.museum +architecture.museum +art.museum +artanddesign.museum +artcenter.museum +artdeco.museum +arteducation.museum +artgallery.museum +arts.museum +artsandcrafts.museum +asmatart.museum +assassination.museum +assisi.museum +association.museum +astronomy.museum +atlanta.museum +austin.museum +australia.museum +automotive.museum +aviation.museum +axis.museum +badajoz.museum +baghdad.museum +bahn.museum +bale.museum +baltimore.museum +barcelona.museum +baseball.museum +basel.museum +baths.museum +bauern.museum +beauxarts.museum +beeldengeluid.museum +bellevue.museum +bergbau.museum +berkeley.museum +berlin.museum +bern.museum +bible.museum +bilbao.museum +bill.museum +birdart.museum +birthplace.museum +bonn.museum +boston.museum +botanical.museum +botanicalgarden.museum +botanicgarden.museum +botany.museum +brandywinevalley.museum +brasil.museum +bristol.museum +british.museum +britishcolumbia.museum +broadcast.museum +brunel.museum +brussel.museum +brussels.museum +bruxelles.museum +building.museum +burghof.museum +bus.museum +bushey.museum +cadaques.museum +california.museum +cambridge.museum +can.museum +canada.museum +capebreton.museum +carrier.museum +cartoonart.museum +casadelamoneda.museum +castle.museum +castres.museum +celtic.museum +center.museum +chattanooga.museum +cheltenham.museum +chesapeakebay.museum +chicago.museum +children.museum +childrens.museum +childrensgarden.museum +chiropractic.museum +chocolate.museum +christiansburg.museum +cincinnati.museum +cinema.museum +circus.museum +civilisation.museum +civilization.museum +civilwar.museum +clinton.museum +clock.museum +coal.museum +coastaldefence.museum +cody.museum +coldwar.museum +collection.museum +colonialwilliamsburg.museum +coloradoplateau.museum +columbia.museum +columbus.museum +communication.museum +communications.museum +community.museum +computer.museum +computerhistory.museum +comunicações.museum +contemporary.museum +contemporaryart.museum +convent.museum +copenhagen.museum +corporation.museum +correios-e-telecomunicações.museum +corvette.museum +costume.museum +countryestate.museum +county.museum +crafts.museum +cranbrook.museum +creation.museum +cultural.museum +culturalcenter.museum +culture.museum +cyber.museum +cymru.museum +dali.museum +dallas.museum +database.museum +ddr.museum +decorativearts.museum +delaware.museum +delmenhorst.museum +denmark.museum +depot.museum +design.museum +detroit.museum +dinosaur.museum +discovery.museum +dolls.museum +donostia.museum +durham.museum +eastafrica.museum +eastcoast.museum +education.museum +educational.museum +egyptian.museum +eisenbahn.museum +elburg.museum +elvendrell.museum +embroidery.museum +encyclopedic.museum +england.museum +entomology.museum +environment.museum +environmentalconservation.museum +epilepsy.museum +essex.museum +estate.museum +ethnology.museum +exeter.museum +exhibition.museum +family.museum +farm.museum +farmequipment.museum +farmers.museum +farmstead.museum +field.museum +figueres.museum +filatelia.museum +film.museum +fineart.museum +finearts.museum +finland.museum +flanders.museum +florida.museum +force.museum +fortmissoula.museum +fortworth.museum +foundation.museum +francaise.museum +frankfurt.museum +franziskaner.museum +freemasonry.museum +freiburg.museum +fribourg.museum +frog.museum +fundacio.museum +furniture.museum +gallery.museum +garden.museum +gateway.museum +geelvinck.museum +gemological.museum +geology.museum +georgia.museum +giessen.museum +glas.museum +glass.museum +gorge.museum +grandrapids.museum +graz.museum +guernsey.museum +halloffame.museum +hamburg.museum +handson.museum +harvestcelebration.museum +hawaii.museum +health.museum +heimatunduhren.museum +hellas.museum +helsinki.museum +hembygdsforbund.museum +heritage.museum +histoire.museum +historical.museum +historicalsociety.museum +historichouses.museum +historisch.museum +historisches.museum +history.museum +historyofscience.museum +horology.museum +house.museum +humanities.museum +illustration.museum +imageandsound.museum +indian.museum +indiana.museum +indianapolis.museum +indianmarket.museum +intelligence.museum +interactive.museum +iraq.museum +iron.museum +isleofman.museum +jamison.museum +jefferson.museum +jerusalem.museum +jewelry.museum +jewish.museum +jewishart.museum +jfk.museum +journalism.museum +judaica.museum +judygarland.museum +juedisches.museum +juif.museum +karate.museum +karikatur.museum +kids.museum +koebenhavn.museum +koeln.museum +kunst.museum +kunstsammlung.museum +kunstunddesign.museum +labor.museum +labour.museum +lajolla.museum +lancashire.museum +landes.museum +lans.museum +läns.museum +larsson.museum +lewismiller.museum +lincoln.museum +linz.museum +living.museum +livinghistory.museum +localhistory.museum +london.museum +losangeles.museum +louvre.museum +loyalist.museum +lucerne.museum +luxembourg.museum +luzern.museum +mad.museum +madrid.museum +mallorca.museum +manchester.museum +mansion.museum +mansions.museum +manx.museum +marburg.museum +maritime.museum +maritimo.museum +maryland.museum +marylhurst.museum +media.museum +medical.museum +medizinhistorisches.museum +meeres.museum +memorial.museum +mesaverde.museum +michigan.museum +midatlantic.museum +military.museum +mill.museum +miners.museum +mining.museum +minnesota.museum +missile.museum +missoula.museum +modern.museum +moma.museum +money.museum +monmouth.museum +monticello.museum +montreal.museum +moscow.museum +motorcycle.museum +muenchen.museum +muenster.museum +mulhouse.museum +muncie.museum +museet.museum +museumcenter.museum +museumvereniging.museum +music.museum +national.museum +nationalfirearms.museum +nationalheritage.museum +nativeamerican.museum +naturalhistory.museum +naturalhistorymuseum.museum +naturalsciences.museum +nature.museum +naturhistorisches.museum +natuurwetenschappen.museum +naumburg.museum +naval.museum +nebraska.museum +neues.museum +newhampshire.museum +newjersey.museum +newmexico.museum +newport.museum +newspaper.museum +newyork.museum +niepce.museum +norfolk.museum +north.museum +nrw.museum +nuernberg.museum +nuremberg.museum +nyc.museum +nyny.museum +oceanographic.museum +oceanographique.museum +omaha.museum +online.museum +ontario.museum +openair.museum +oregon.museum +oregontrail.museum +otago.museum +oxford.museum +pacific.museum +paderborn.museum +palace.museum +paleo.museum +palmsprings.museum +panama.museum +paris.museum +pasadena.museum +pharmacy.museum +philadelphia.museum +philadelphiaarea.museum +philately.museum +phoenix.museum +photography.museum +pilots.museum +pittsburgh.museum +planetarium.museum +plantation.museum +plants.museum +plaza.museum +portal.museum +portland.museum +portlligat.museum +posts-and-telecommunications.museum +preservation.museum +presidio.museum +press.museum +project.museum +public.museum +pubol.museum +quebec.museum +railroad.museum +railway.museum +research.museum +resistance.museum +riodejaneiro.museum +rochester.museum +rockart.museum +roma.museum +russia.museum +saintlouis.museum +salem.museum +salvadordali.museum +salzburg.museum +sandiego.museum +sanfrancisco.museum +santabarbara.museum +santacruz.museum +santafe.museum +saskatchewan.museum +satx.museum +savannahga.museum +schlesisches.museum +schoenbrunn.museum +schokoladen.museum +school.museum +schweiz.museum +science.museum +scienceandhistory.museum +scienceandindustry.museum +sciencecenter.museum +sciencecenters.museum +science-fiction.museum +sciencehistory.museum +sciences.museum +sciencesnaturelles.museum +scotland.museum +seaport.museum +settlement.museum +settlers.museum +shell.museum +sherbrooke.museum +sibenik.museum +silk.museum +ski.museum +skole.museum +society.museum +sologne.museum +soundandvision.museum +southcarolina.museum +southwest.museum +space.museum +spy.museum +square.museum +stadt.museum +stalbans.museum +starnberg.museum +state.museum +stateofdelaware.museum +station.museum +steam.museum +steiermark.museum +stjohn.museum +stockholm.museum +stpetersburg.museum +stuttgart.museum +suisse.museum +surgeonshall.museum +surrey.museum +svizzera.museum +sweden.museum +sydney.museum +tank.museum +tcm.museum +technology.museum +telekommunikation.museum +television.museum +texas.museum +textile.museum +theater.museum +time.museum +timekeeping.museum +topology.museum +torino.museum +touch.museum +town.museum +transport.museum +tree.museum +trolley.museum +trust.museum +trustee.museum +uhren.museum +ulm.museum +undersea.museum +university.museum +usa.museum +usantiques.museum +usarts.museum +uscountryestate.museum +usculture.museum +usdecorativearts.museum +usgarden.museum +ushistory.museum +ushuaia.museum +uslivinghistory.museum +utah.museum +uvic.museum +valley.museum +vantaa.museum +versailles.museum +viking.museum +village.museum +virginia.museum +virtual.museum +virtuel.museum +vlaanderen.museum +volkenkunde.museum +wales.museum +wallonie.museum +war.museum +washingtondc.museum +watchandclock.museum +watch-and-clock.museum +western.museum +westfalen.museum +whaling.museum +wildlife.museum +williamsburg.museum +windmill.museum +workshop.museum +york.museum +yorkshire.museum +yosemite.museum +youth.museum +zoological.museum +zoology.museum +ירושלים.museum +иком.museum + +// mv : http://en.wikipedia.org/wiki/.mv +// "mv" included because, contra Wikipedia, google.mv exists. +mv +aero.mv +biz.mv +com.mv +coop.mv +edu.mv +gov.mv +info.mv +int.mv +mil.mv +museum.mv +name.mv +net.mv +org.mv +pro.mv + +// mw : http://www.registrar.mw/ +mw +ac.mw +biz.mw +co.mw +com.mw +coop.mw +edu.mw +gov.mw +int.mw +museum.mw +net.mw +org.mw + +// mx : http://www.nic.mx/ +// Submitted by registry 2008-06-19 +mx +com.mx +org.mx +gob.mx +edu.mx +net.mx + +// my : http://www.mynic.net.my/ +my +com.my +net.my +org.my +gov.my +edu.my +mil.my +name.my + +// mz : http://www.gobin.info/domainname/mz-template.doc +*.mz + +// na : http://www.na-nic.com.na/ +// http://www.info.na/domain/ +na +info.na +pro.na +name.na +school.na +or.na +dr.na +us.na +mx.na +ca.na +in.na +cc.na +tv.na +ws.na +mobi.na +co.na +com.na +org.na + +// name : has 2nd-level tlds, but there's no list of them +name + +// nc : http://www.cctld.nc/ +nc +asso.nc + +// ne : http://en.wikipedia.org/wiki/.ne +ne + +// net : http://en.wikipedia.org/wiki/.net +net + +// nf : http://en.wikipedia.org/wiki/.nf +nf +com.nf +net.nf +per.nf +rec.nf +web.nf +arts.nf +firm.nf +info.nf +other.nf +store.nf + +// ng : http://psg.com/dns/ng/ +// Submitted by registry 2008-06-17 +ac.ng +com.ng +edu.ng +gov.ng +net.ng +org.ng + +// ni : http://www.nic.ni/dominios.htm +*.ni + +// nl : http://www.domain-registry.nl/ace.php/c,728,122,,,,Home.html +// Confirmed by registry (with technical +// reservations) 2008-06-08 +nl + +// BV.nl will be a registry for dutch BV's (besloten vennootschap) +bv.nl + +// no : http://www.norid.no/regelverk/index.en.html +// The Norwegian registry has declined to notify us of updates. The web pages +// referenced below are the official source of the data. There is also an +// announce mailing list: +// https://postlister.uninett.no/sympa/info/norid-diskusjon +no +// Norid generic domains : http://www.norid.no/regelverk/vedlegg-c.en.html +fhs.no +vgs.no +fylkesbibl.no +folkebibl.no +museum.no +idrett.no +priv.no +// Non-Norid generic domains : http://www.norid.no/regelverk/vedlegg-d.en.html +mil.no +stat.no +dep.no +kommune.no +herad.no +// no geographical names : http://www.norid.no/regelverk/vedlegg-b.en.html +// counties +aa.no +ah.no +bu.no +fm.no +hl.no +hm.no +jan-mayen.no +mr.no +nl.no +nt.no +of.no +ol.no +oslo.no +rl.no +sf.no +st.no +svalbard.no +tm.no +tr.no +va.no +vf.no +// primary and lower secondary schools per county +gs.aa.no +gs.ah.no +gs.bu.no +gs.fm.no +gs.hl.no +gs.hm.no +gs.jan-mayen.no +gs.mr.no +gs.nl.no +gs.nt.no +gs.of.no +gs.ol.no +gs.oslo.no +gs.rl.no +gs.sf.no +gs.st.no +gs.svalbard.no +gs.tm.no +gs.tr.no +gs.va.no +gs.vf.no +// cities +akrehamn.no +åkrehamn.no +algard.no +ålgård.no +arna.no +brumunddal.no +bryne.no +bronnoysund.no +brønnøysund.no +drobak.no +drøbak.no +egersund.no +fetsund.no +floro.no +florø.no +fredrikstad.no +hokksund.no +honefoss.no +hønefoss.no +jessheim.no +jorpeland.no +jørpeland.no +kirkenes.no +kopervik.no +krokstadelva.no +langevag.no +langevåg.no +leirvik.no +mjondalen.no +mjøndalen.no +mo-i-rana.no +mosjoen.no +mosjøen.no +nesoddtangen.no +orkanger.no +osoyro.no +osøyro.no +raholt.no +råholt.no +sandnessjoen.no +sandnessjøen.no +skedsmokorset.no +slattum.no +spjelkavik.no +stathelle.no +stavern.no +stjordalshalsen.no +stjørdalshalsen.no +tananger.no +tranby.no +vossevangen.no +// communities +afjord.no +åfjord.no +agdenes.no +al.no +ål.no +alesund.no +ålesund.no +alstahaug.no +alta.no +áltá.no +alaheadju.no +álaheadju.no +alvdal.no +amli.no +åmli.no +amot.no +åmot.no +andebu.no +andoy.no +andøy.no +andasuolo.no +ardal.no +årdal.no +aremark.no +arendal.no +ås.no +aseral.no +åseral.no +asker.no +askim.no +askvoll.no +askoy.no +askøy.no +asnes.no +åsnes.no +audnedaln.no +aukra.no +aure.no +aurland.no +aurskog-holand.no +aurskog-høland.no +austevoll.no +austrheim.no +averoy.no +averøy.no +balestrand.no +ballangen.no +balat.no +bálát.no +balsfjord.no +bahccavuotna.no +báhccavuotna.no +bamble.no +bardu.no +beardu.no +beiarn.no +bajddar.no +bájddar.no +baidar.no +báidár.no +berg.no +bergen.no +berlevag.no +berlevåg.no +bearalvahki.no +bearalváhki.no +bindal.no +birkenes.no +bjarkoy.no +bjarkøy.no +bjerkreim.no +bjugn.no +bodo.no +bodø.no +badaddja.no +bådåddjå.no +budejju.no +bokn.no +bremanger.no +bronnoy.no +brønnøy.no +bygland.no +bykle.no +barum.no +bærum.no +bo.telemark.no +bø.telemark.no +bo.nordland.no +bø.nordland.no +bievat.no +bievát.no +bomlo.no +bømlo.no +batsfjord.no +båtsfjord.no +bahcavuotna.no +báhcavuotna.no +dovre.no +drammen.no +drangedal.no +dyroy.no +dyrøy.no +donna.no +dønna.no +eid.no +eidfjord.no +eidsberg.no +eidskog.no +eidsvoll.no +eigersund.no +elverum.no +enebakk.no +engerdal.no +etne.no +etnedal.no +evenes.no +evenassi.no +evenášši.no +evje-og-hornnes.no +farsund.no +fauske.no +fuossko.no +fuoisku.no +fedje.no +fet.no +finnoy.no +finnøy.no +fitjar.no +fjaler.no +fjell.no +flakstad.no +flatanger.no +flekkefjord.no +flesberg.no +flora.no +fla.no +flå.no +folldal.no +forsand.no +fosnes.no +frei.no +frogn.no +froland.no +frosta.no +frana.no +fræna.no +froya.no +frøya.no +fusa.no +fyresdal.no +forde.no +førde.no +gamvik.no +gangaviika.no +gáŋgaviika.no +gaular.no +gausdal.no +gildeskal.no +gildeskål.no +giske.no +gjemnes.no +gjerdrum.no +gjerstad.no +gjesdal.no +gjovik.no +gjøvik.no +gloppen.no +gol.no +gran.no +grane.no +granvin.no +gratangen.no +grimstad.no +grong.no +kraanghke.no +kråanghke.no +grue.no +gulen.no +hadsel.no +halden.no +halsa.no +hamar.no +hamaroy.no +habmer.no +hábmer.no +hapmir.no +hápmir.no +hammerfest.no +hammarfeasta.no +hámmárfeasta.no +haram.no +hareid.no +harstad.no +hasvik.no +aknoluokta.no +ákŋoluokta.no +hattfjelldal.no +aarborte.no +haugesund.no +hemne.no +hemnes.no +hemsedal.no +heroy.more-og-romsdal.no +herøy.møre-og-romsdal.no +heroy.nordland.no +herøy.nordland.no +hitra.no +hjartdal.no +hjelmeland.no +hobol.no +hobøl.no +hof.no +hol.no +hole.no +holmestrand.no +holtalen.no +holtålen.no +hornindal.no +horten.no +hurdal.no +hurum.no +hvaler.no +hyllestad.no +hagebostad.no +hægebostad.no +hoyanger.no +høyanger.no +hoylandet.no +høylandet.no +ha.no +hå.no +ibestad.no +inderoy.no +inderøy.no +iveland.no +jevnaker.no +jondal.no +jolster.no +jølster.no +karasjok.no +karasjohka.no +kárášjohka.no +karlsoy.no +galsa.no +gálsá.no +karmoy.no +karmøy.no +kautokeino.no +guovdageaidnu.no +klepp.no +klabu.no +klæbu.no +kongsberg.no +kongsvinger.no +kragero.no +kragerø.no +kristiansand.no +kristiansund.no +krodsherad.no +krødsherad.no +kvalsund.no +rahkkeravju.no +ráhkkerávju.no +kvam.no +kvinesdal.no +kvinnherad.no +kviteseid.no +kvitsoy.no +kvitsøy.no +kvafjord.no +kvæfjord.no +giehtavuoatna.no +kvanangen.no +kvænangen.no +navuotna.no +návuotna.no +kafjord.no +kåfjord.no +gaivuotna.no +gáivuotna.no +larvik.no +lavangen.no +lavagis.no +loabat.no +loabát.no +lebesby.no +davvesiida.no +leikanger.no +leirfjord.no +leka.no +leksvik.no +lenvik.no +leangaviika.no +leaŋgaviika.no +lesja.no +levanger.no +lier.no +lierne.no +lillehammer.no +lillesand.no +lindesnes.no +lindas.no +lindås.no +lom.no +loppa.no +lahppi.no +láhppi.no +lund.no +lunner.no +luroy.no +lurøy.no +luster.no +lyngdal.no +lyngen.no +ivgu.no +lardal.no +lerdal.no +lærdal.no +lodingen.no +lødingen.no +lorenskog.no +lørenskog.no +loten.no +løten.no +malvik.no +masoy.no +måsøy.no +muosat.no +muosát.no +mandal.no +marker.no +marnardal.no +masfjorden.no +meland.no +meldal.no +melhus.no +meloy.no +meløy.no +meraker.no +meråker.no +moareke.no +moåreke.no +midsund.no +midtre-gauldal.no +modalen.no +modum.no +molde.no +moskenes.no +moss.no +mosvik.no +malselv.no +målselv.no +malatvuopmi.no +málatvuopmi.no +namdalseid.no +aejrie.no +namsos.no +namsskogan.no +naamesjevuemie.no +nååmesjevuemie.no +laakesvuemie.no +nannestad.no +narvik.no +narviika.no +naustdal.no +nedre-eiker.no +nes.akershus.no +nes.buskerud.no +nesna.no +nesodden.no +nesseby.no +unjarga.no +unjárga.no +nesset.no +nissedal.no +nittedal.no +nord-aurdal.no +nord-fron.no +nord-odal.no +norddal.no +nordkapp.no +davvenjarga.no +davvenjárga.no +nordre-land.no +nordreisa.no +raisa.no +ráisa.no +nore-og-uvdal.no +notodden.no +naroy.no +nærøy.no +notteroy.no +nøtterøy.no +odda.no +oksnes.no +øksnes.no +oppdal.no +oppegard.no +oppegård.no +orkdal.no +orland.no +ørland.no +orskog.no +ørskog.no +orsta.no +ørsta.no +os.hedmark.no +os.hordaland.no +osen.no +osteroy.no +osterøy.no +ostre-toten.no +østre-toten.no +overhalla.no +ovre-eiker.no +øvre-eiker.no +oyer.no +øyer.no +oygarden.no +øygarden.no +oystre-slidre.no +øystre-slidre.no +porsanger.no +porsangu.no +porsáŋgu.no +porsgrunn.no +radoy.no +radøy.no +rakkestad.no +rana.no +ruovat.no +randaberg.no +rauma.no +rendalen.no +rennebu.no +rennesoy.no +rennesøy.no +rindal.no +ringebu.no +ringerike.no +ringsaker.no +rissa.no +risor.no +risør.no +roan.no +rollag.no +rygge.no +ralingen.no +rælingen.no +rodoy.no +rødøy.no +romskog.no +rømskog.no +roros.no +røros.no +rost.no +røst.no +royken.no +røyken.no +royrvik.no +røyrvik.no +rade.no +råde.no +salangen.no +siellak.no +saltdal.no +salat.no +sálát.no +sálat.no +samnanger.no +sande.more-og-romsdal.no +sande.møre-og-romsdal.no +sande.vestfold.no +sandefjord.no +sandnes.no +sandoy.no +sandøy.no +sarpsborg.no +sauda.no +sauherad.no +sel.no +selbu.no +selje.no +seljord.no +sigdal.no +siljan.no +sirdal.no +skaun.no +skedsmo.no +ski.no +skien.no +skiptvet.no +skjervoy.no +skjervøy.no +skierva.no +skiervá.no +skjak.no +skjåk.no +skodje.no +skanland.no +skånland.no +skanit.no +skánit.no +smola.no +smøla.no +snillfjord.no +snasa.no +snåsa.no +snoasa.no +snaase.no +snåase.no +sogndal.no +sokndal.no +sola.no +solund.no +songdalen.no +sortland.no +spydeberg.no +stange.no +stavanger.no +steigen.no +steinkjer.no +stjordal.no +stjørdal.no +stokke.no +stor-elvdal.no +stord.no +stordal.no +storfjord.no +omasvuotna.no +strand.no +stranda.no +stryn.no +sula.no +suldal.no +sund.no +sunndal.no +surnadal.no +sveio.no +svelvik.no +sykkylven.no +sogne.no +søgne.no +somna.no +sømna.no +sondre-land.no +søndre-land.no +sor-aurdal.no +sør-aurdal.no +sor-fron.no +sør-fron.no +sor-odal.no +sør-odal.no +sor-varanger.no +sør-varanger.no +matta-varjjat.no +mátta-várjjat.no +sorfold.no +sørfold.no +sorreisa.no +sørreisa.no +sorum.no +sørum.no +tana.no +deatnu.no +time.no +tingvoll.no +tinn.no +tjeldsund.no +dielddanuorri.no +tjome.no +tjøme.no +tokke.no +tolga.no +torsken.no +tranoy.no +tranøy.no +tromso.no +tromsø.no +tromsa.no +romsa.no +trondheim.no +troandin.no +trysil.no +trana.no +træna.no +trogstad.no +trøgstad.no +tvedestrand.no +tydal.no +tynset.no +tysfjord.no +divtasvuodna.no +divttasvuotna.no +tysnes.no +tysvar.no +tysvær.no +tonsberg.no +tønsberg.no +ullensaker.no +ullensvang.no +ulvik.no +utsira.no +vadso.no +vadsø.no +cahcesuolo.no +čáhcesuolo.no +vaksdal.no +valle.no +vang.no +vanylven.no +vardo.no +vardø.no +varggat.no +várggát.no +vefsn.no +vaapste.no +vega.no +vegarshei.no +vegårshei.no +vennesla.no +verdal.no +verran.no +vestby.no +vestnes.no +vestre-slidre.no +vestre-toten.no +vestvagoy.no +vestvågøy.no +vevelstad.no +vik.no +vikna.no +vindafjord.no +volda.no +voss.no +varoy.no +værøy.no +vagan.no +vågan.no +voagat.no +vagsoy.no +vågsøy.no +vaga.no +vågå.no +valer.ostfold.no +våler.østfold.no +valer.hedmark.no +våler.hedmark.no + +// np : http://www.mos.com.np/register.html +*.np + +// nr : http://cenpac.net.nr/dns/index.html +// Confirmed by registry 2008-06-17 +nr +biz.nr +info.nr +gov.nr +edu.nr +org.nr +net.nr +com.nr + +// nu : http://en.wikipedia.org/wiki/.nu +nu + +// nz : http://en.wikipedia.org/wiki/.nz +*.nz + +// om : http://en.wikipedia.org/wiki/.om +*.om +!mediaphone.om +!nawrastelecom.om +!nawras.om +!omanmobile.om +!omanpost.om +!omantel.om +!rakpetroleum.om +!siemens.om +!songfest.om +!statecouncil.om + +// org : http://en.wikipedia.org/wiki/.org +org + +// pa : http://www.nic.pa/ +// Some additional second level "domains" resolve directly as hostnames, such as +// pannet.pa, so we add a rule for "pa". +pa +ac.pa +gob.pa +com.pa +org.pa +sld.pa +edu.pa +net.pa +ing.pa +abo.pa +med.pa +nom.pa + +// pe : https://www.nic.pe/InformeFinalComision.pdf +pe +edu.pe +gob.pe +nom.pe +mil.pe +org.pe +com.pe +net.pe + +// pf : http://www.gobin.info/domainname/formulaire-pf.pdf +pf +com.pf +org.pf +edu.pf + +// pg : http://en.wikipedia.org/wiki/.pg +*.pg + +// ph : http://www.domains.ph/FAQ2.asp +// Submitted by registry 2008-06-13 +ph +com.ph +net.ph +org.ph +gov.ph +edu.ph +ngo.ph +mil.ph +i.ph + +// pk : http://pk5.pknic.net.pk/pk5/msgNamepk.PK +pk +com.pk +net.pk +edu.pk +org.pk +fam.pk +biz.pk +web.pk +gov.pk +gob.pk +gok.pk +gon.pk +gop.pk +gos.pk +info.pk + +// pl : http://www.dns.pl/english/ +pl +// NASK functional domains (nask.pl / dns.pl) : http://www.dns.pl/english/dns-funk.html +aid.pl +agro.pl +atm.pl +auto.pl +biz.pl +com.pl +edu.pl +gmina.pl +gsm.pl +info.pl +mail.pl +miasta.pl +media.pl +mil.pl +net.pl +nieruchomosci.pl +nom.pl +org.pl +pc.pl +powiat.pl +priv.pl +realestate.pl +rel.pl +sex.pl +shop.pl +sklep.pl +sos.pl +szkola.pl +targi.pl +tm.pl +tourism.pl +travel.pl +turystyka.pl +// ICM functional domains (icm.edu.pl) +6bone.pl +art.pl +mbone.pl +// Government domains (administred by ippt.gov.pl) +gov.pl +uw.gov.pl +um.gov.pl +ug.gov.pl +upow.gov.pl +starostwo.gov.pl +so.gov.pl +sr.gov.pl +po.gov.pl +pa.gov.pl +// other functional domains +ngo.pl +irc.pl +usenet.pl +// NASK geographical domains : http://www.dns.pl/english/dns-regiony.html +augustow.pl +babia-gora.pl +bedzin.pl +beskidy.pl +bialowieza.pl +bialystok.pl +bielawa.pl +bieszczady.pl +boleslawiec.pl +bydgoszcz.pl +bytom.pl +cieszyn.pl +czeladz.pl +czest.pl +dlugoleka.pl +elblag.pl +elk.pl +glogow.pl +gniezno.pl +gorlice.pl +grajewo.pl +ilawa.pl +jaworzno.pl +jelenia-gora.pl +jgora.pl +kalisz.pl +kazimierz-dolny.pl +karpacz.pl +kartuzy.pl +kaszuby.pl +katowice.pl +kepno.pl +ketrzyn.pl +klodzko.pl +kobierzyce.pl +kolobrzeg.pl +konin.pl +konskowola.pl +kutno.pl +lapy.pl +lebork.pl +legnica.pl +lezajsk.pl +limanowa.pl +lomza.pl +lowicz.pl +lubin.pl +lukow.pl +malbork.pl +malopolska.pl +mazowsze.pl +mazury.pl +mielec.pl +mielno.pl +mragowo.pl +naklo.pl +nowaruda.pl +nysa.pl +olawa.pl +olecko.pl +olkusz.pl +olsztyn.pl +opoczno.pl +opole.pl +ostroda.pl +ostroleka.pl +ostrowiec.pl +ostrowwlkp.pl +pila.pl +pisz.pl +podhale.pl +podlasie.pl +polkowice.pl +pomorze.pl +pomorskie.pl +prochowice.pl +pruszkow.pl +przeworsk.pl +pulawy.pl +radom.pl +rawa-maz.pl +rybnik.pl +rzeszow.pl +sanok.pl +sejny.pl +siedlce.pl +slask.pl +slupsk.pl +sosnowiec.pl +stalowa-wola.pl +skoczow.pl +starachowice.pl +stargard.pl +suwalki.pl +swidnica.pl +swiebodzin.pl +swinoujscie.pl +szczecin.pl +szczytno.pl +tarnobrzeg.pl +tgory.pl +turek.pl +tychy.pl +ustka.pl +walbrzych.pl +warmia.pl +warszawa.pl +waw.pl +wegrow.pl +wielun.pl +wlocl.pl +wloclawek.pl +wodzislaw.pl +wolomin.pl +wroclaw.pl +zachpomor.pl +zagan.pl +zarow.pl +zgora.pl +zgorzelec.pl +// TASK geographical domains (www.task.gda.pl/uslugi/dns) +gda.pl +gdansk.pl +gdynia.pl +med.pl +sopot.pl +// other geographical domains +gliwice.pl +krakow.pl +poznan.pl +wroc.pl +zakopane.pl + +// pm : http://www.afnic.fr/medias/documents/AFNIC-naming-policy2012.pdf +pm + +// pn : http://www.government.pn/PnRegistry/policies.htm +pn +gov.pn +co.pn +org.pn +edu.pn +net.pn + +// pr : http://www.nic.pr/index.asp?f=1 +pr +com.pr +net.pr +org.pr +gov.pr +edu.pr +isla.pr +pro.pr +biz.pr +info.pr +name.pr +// these aren't mentioned on nic.pr, but on http://en.wikipedia.org/wiki/.pr +est.pr +prof.pr +ac.pr + +// pro : http://www.nic.pro/support_faq.htm +pro +aca.pro +bar.pro +cpa.pro +jur.pro +law.pro +med.pro +eng.pro + +// ps : http://en.wikipedia.org/wiki/.ps +// http://www.nic.ps/registration/policy.html#reg +ps +edu.ps +gov.ps +sec.ps +plo.ps +com.ps +org.ps +net.ps + +// pt : http://online.dns.pt/dns/start_dns +pt +net.pt +gov.pt +org.pt +edu.pt +int.pt +publ.pt +com.pt +nome.pt + +// pw : http://en.wikipedia.org/wiki/.pw +pw +co.pw +ne.pw +or.pw +ed.pw +go.pw +belau.pw + +// py : http://www.nic.py/faq_a.html#faq_b +*.py + +// qa : http://domains.qa/en/ +qa +com.qa +edu.qa +gov.qa +mil.qa +name.qa +net.qa +org.qa +sch.qa + +// re : http://www.afnic.re/obtenir/chartes/nommage-re/annexe-descriptifs +re +com.re +asso.re +nom.re + +// ro : http://www.rotld.ro/ +ro +com.ro +org.ro +tm.ro +nt.ro +nom.ro +info.ro +rec.ro +arts.ro +firm.ro +store.ro +www.ro + +// rs : http://en.wikipedia.org/wiki/.rs +rs +co.rs +org.rs +edu.rs +ac.rs +gov.rs +in.rs + +// ru : http://www.cctld.ru/ru/docs/aktiv_8.php +// Industry domains +ru +ac.ru +com.ru +edu.ru +int.ru +net.ru +org.ru +pp.ru +// Geographical domains +adygeya.ru +altai.ru +amur.ru +arkhangelsk.ru +astrakhan.ru +bashkiria.ru +belgorod.ru +bir.ru +bryansk.ru +buryatia.ru +cbg.ru +chel.ru +chelyabinsk.ru +chita.ru +chukotka.ru +chuvashia.ru +dagestan.ru +dudinka.ru +e-burg.ru +grozny.ru +irkutsk.ru +ivanovo.ru +izhevsk.ru +jar.ru +joshkar-ola.ru +kalmykia.ru +kaluga.ru +kamchatka.ru +karelia.ru +kazan.ru +kchr.ru +kemerovo.ru +khabarovsk.ru +khakassia.ru +khv.ru +kirov.ru +koenig.ru +komi.ru +kostroma.ru +krasnoyarsk.ru +kuban.ru +kurgan.ru +kursk.ru +lipetsk.ru +magadan.ru +mari.ru +mari-el.ru +marine.ru +mordovia.ru +mosreg.ru +msk.ru +murmansk.ru +nalchik.ru +nnov.ru +nov.ru +novosibirsk.ru +nsk.ru +omsk.ru +orenburg.ru +oryol.ru +palana.ru +penza.ru +perm.ru +pskov.ru +ptz.ru +rnd.ru +ryazan.ru +sakhalin.ru +samara.ru +saratov.ru +simbirsk.ru +smolensk.ru +spb.ru +stavropol.ru +stv.ru +surgut.ru +tambov.ru +tatarstan.ru +tom.ru +tomsk.ru +tsaritsyn.ru +tsk.ru +tula.ru +tuva.ru +tver.ru +tyumen.ru +udm.ru +udmurtia.ru +ulan-ude.ru +vladikavkaz.ru +vladimir.ru +vladivostok.ru +volgograd.ru +vologda.ru +voronezh.ru +vrn.ru +vyatka.ru +yakutia.ru +yamal.ru +yaroslavl.ru +yekaterinburg.ru +yuzhno-sakhalinsk.ru +// More geographical domains +amursk.ru +baikal.ru +cmw.ru +fareast.ru +jamal.ru +kms.ru +k-uralsk.ru +kustanai.ru +kuzbass.ru +magnitka.ru +mytis.ru +nakhodka.ru +nkz.ru +norilsk.ru +oskol.ru +pyatigorsk.ru +rubtsovsk.ru +snz.ru +syzran.ru +vdonsk.ru +zgrad.ru +// State domains +gov.ru +mil.ru +// Technical domains +test.ru + +// rw : http://www.nic.rw/cgi-bin/policy.pl +rw +gov.rw +net.rw +edu.rw +ac.rw +com.rw +co.rw +int.rw +mil.rw +gouv.rw + +// sa : http://www.nic.net.sa/ +sa +com.sa +net.sa +org.sa +gov.sa +med.sa +pub.sa +edu.sa +sch.sa + +// sb : http://www.sbnic.net.sb/ +// Submitted by registry 2008-06-08 +sb +com.sb +edu.sb +gov.sb +net.sb +org.sb + +// sc : http://www.nic.sc/ +sc +com.sc +gov.sc +net.sc +org.sc +edu.sc + +// sd : http://www.isoc.sd/sudanic.isoc.sd/billing_pricing.htm +// Submitted by registry 2008-06-17 +sd +com.sd +net.sd +org.sd +edu.sd +med.sd +gov.sd +info.sd + +// se : http://en.wikipedia.org/wiki/.se +// Submitted by registry 2008-06-24 +se +a.se +ac.se +b.se +bd.se +brand.se +c.se +d.se +e.se +f.se +fh.se +fhsk.se +fhv.se +g.se +h.se +i.se +k.se +komforb.se +kommunalforbund.se +komvux.se +l.se +lanbib.se +m.se +n.se +naturbruksgymn.se +o.se +org.se +p.se +parti.se +pp.se +press.se +r.se +s.se +sshn.se +t.se +tm.se +u.se +w.se +x.se +y.se +z.se + +// sg : http://www.nic.net.sg/sub_policies_agreement/2ld.html +sg +com.sg +net.sg +org.sg +gov.sg +edu.sg +per.sg + +// sh : http://www.nic.sh/rules.html +// list of 2nd level domains ? +sh + +// si : http://en.wikipedia.org/wiki/.si +si + +// sj : No registrations at this time. +// Submitted by registry 2008-06-16 + +// sk : http://en.wikipedia.org/wiki/.sk +// list of 2nd level domains ? +sk + +// sl : http://www.nic.sl +// Submitted by registry 2008-06-12 +sl +com.sl +net.sl +edu.sl +gov.sl +org.sl + +// sm : http://en.wikipedia.org/wiki/.sm +sm + +// sn : http://en.wikipedia.org/wiki/.sn +sn +art.sn +com.sn +edu.sn +gouv.sn +org.sn +perso.sn +univ.sn + +// so : http://www.soregistry.com/ +so +com.so +net.so +org.so + +// sr : http://en.wikipedia.org/wiki/.sr +sr + +// st : http://www.nic.st/html/policyrules/ +st +co.st +com.st +consulado.st +edu.st +embaixada.st +gov.st +mil.st +net.st +org.st +principe.st +saotome.st +store.st + +// su : http://en.wikipedia.org/wiki/.su +su + +// sv : http://www.svnet.org.sv/svpolicy.html +*.sv + +// sy : http://en.wikipedia.org/wiki/.sy +// see also: http://www.gobin.info/domainname/sy.doc +sy +edu.sy +gov.sy +net.sy +mil.sy +com.sy +org.sy + +// sz : http://en.wikipedia.org/wiki/.sz +// http://www.sispa.org.sz/ +sz +co.sz +ac.sz +org.sz + +// tc : http://en.wikipedia.org/wiki/.tc +tc + +// td : http://en.wikipedia.org/wiki/.td +td + +// tel: http://en.wikipedia.org/wiki/.tel +// http://www.telnic.org/ +tel + +// tf : http://en.wikipedia.org/wiki/.tf +tf + +// tg : http://en.wikipedia.org/wiki/.tg +// http://www.nic.tg/nictg/index.php implies no reserved 2nd-level domains, +// although this contradicts wikipedia. +tg + +// th : http://en.wikipedia.org/wiki/.th +// Submitted by registry 2008-06-17 +th +ac.th +co.th +go.th +in.th +mi.th +net.th +or.th + +// tj : http://www.nic.tj/policy.htm +tj +ac.tj +biz.tj +co.tj +com.tj +edu.tj +go.tj +gov.tj +int.tj +mil.tj +name.tj +net.tj +nic.tj +org.tj +test.tj +web.tj + +// tk : http://en.wikipedia.org/wiki/.tk +tk + +// tl : http://en.wikipedia.org/wiki/.tl +tl +gov.tl + +// tm : http://www.nic.tm/rules.html +// list of 2nd level tlds ? +tm + +// tn : http://en.wikipedia.org/wiki/.tn +// http://whois.ati.tn/ +tn +com.tn +ens.tn +fin.tn +gov.tn +ind.tn +intl.tn +nat.tn +net.tn +org.tn +info.tn +perso.tn +tourism.tn +edunet.tn +rnrt.tn +rns.tn +rnu.tn +mincom.tn +agrinet.tn +defense.tn +turen.tn + +// to : http://en.wikipedia.org/wiki/.to +// Submitted by registry 2008-06-17 +to +com.to +gov.to +net.to +org.to +edu.to +mil.to + +// tr : http://en.wikipedia.org/wiki/.tr +*.tr +!nic.tr +// Used by government in the TRNC +// http://en.wikipedia.org/wiki/.nc.tr +gov.nc.tr + +// travel : http://en.wikipedia.org/wiki/.travel +travel + +// tt : http://www.nic.tt/ +tt +co.tt +com.tt +org.tt +net.tt +biz.tt +info.tt +pro.tt +int.tt +coop.tt +jobs.tt +mobi.tt +travel.tt +museum.tt +aero.tt +name.tt +gov.tt +edu.tt + +// tv : http://en.wikipedia.org/wiki/.tv +// Not listing any 2LDs as reserved since none seem to exist in practice, +// Wikipedia notwithstanding. +tv + +// tw : http://en.wikipedia.org/wiki/.tw +tw +edu.tw +gov.tw +mil.tw +com.tw +net.tw +org.tw +idv.tw +game.tw +ebiz.tw +club.tw +網路.tw +組織.tw +商業.tw + +// tz : http://en.wikipedia.org/wiki/.tz +// Submitted by registry 2008-06-17 +// Updated from http://www.tznic.or.tz/index.php/domains.html 2010-10-25 +ac.tz +co.tz +go.tz +mil.tz +ne.tz +or.tz +sc.tz + +// ua : http://www.nic.net.ua/ +ua +com.ua +edu.ua +gov.ua +in.ua +net.ua +org.ua +// ua geo-names +cherkassy.ua +chernigov.ua +chernovtsy.ua +ck.ua +cn.ua +crimea.ua +cv.ua +dn.ua +dnepropetrovsk.ua +donetsk.ua +dp.ua +if.ua +ivano-frankivsk.ua +kh.ua +kharkov.ua +kherson.ua +khmelnitskiy.ua +kiev.ua +kirovograd.ua +km.ua +kr.ua +ks.ua +kv.ua +lg.ua +lugansk.ua +lutsk.ua +lviv.ua +mk.ua +nikolaev.ua +od.ua +odessa.ua +pl.ua +poltava.ua +rovno.ua +rv.ua +sebastopol.ua +sumy.ua +te.ua +ternopil.ua +uzhgorod.ua +vinnica.ua +vn.ua +zaporizhzhe.ua +zp.ua +zhitomir.ua +zt.ua + +// Private registries in .ua +co.ua +pp.ua + +// ug : http://www.registry.co.ug/ +ug +co.ug +ac.ug +sc.ug +go.ug +ne.ug +or.ug + +// uk : http://en.wikipedia.org/wiki/.uk +*.uk +*.sch.uk +!bl.uk +!british-library.uk +!icnet.uk +!jet.uk +!mod.uk +!nel.uk +!nhs.uk +!nic.uk +!nls.uk +!national-library-scotland.uk +!parliament.uk +!police.uk + +// us : http://en.wikipedia.org/wiki/.us +us +dni.us +fed.us +isa.us +kids.us +nsn.us +// us geographic names +ak.us +al.us +ar.us +as.us +az.us +ca.us +co.us +ct.us +dc.us +de.us +fl.us +ga.us +gu.us +hi.us +ia.us +id.us +il.us +in.us +ks.us +ky.us +la.us +ma.us +md.us +me.us +mi.us +mn.us +mo.us +ms.us +mt.us +nc.us +nd.us +ne.us +nh.us +nj.us +nm.us +nv.us +ny.us +oh.us +ok.us +or.us +pa.us +pr.us +ri.us +sc.us +sd.us +tn.us +tx.us +ut.us +vi.us +vt.us +va.us +wa.us +wi.us +wv.us +wy.us +// The registrar notes several more specific domains available in each state, +// such as state.*.us, dst.*.us, etc., but resolution of these is somewhat +// haphazard; in some states these domains resolve as addresses, while in others +// only subdomains are available, or even nothing at all. We include the +// most common ones where it's clear that different sites are different +// entities. +k12.ak.us +k12.al.us +k12.ar.us +k12.as.us +k12.az.us +k12.ca.us +k12.co.us +k12.ct.us +k12.dc.us +k12.de.us +k12.fl.us +k12.ga.us +k12.gu.us +// k12.hi.us Hawaii has a state-wide DOE login: bug 614565 +k12.ia.us +k12.id.us +k12.il.us +k12.in.us +k12.ks.us +k12.ky.us +k12.la.us +k12.ma.us +k12.md.us +k12.me.us +k12.mi.us +k12.mn.us +k12.mo.us +k12.ms.us +k12.mt.us +k12.nc.us +k12.nd.us +k12.ne.us +k12.nh.us +k12.nj.us +k12.nm.us +k12.nv.us +k12.ny.us +k12.oh.us +k12.ok.us +k12.or.us +k12.pa.us +k12.pr.us +k12.ri.us +k12.sc.us +k12.sd.us +k12.tn.us +k12.tx.us +k12.ut.us +k12.vi.us +k12.vt.us +k12.va.us +k12.wa.us +k12.wi.us +k12.wv.us +k12.wy.us + +cc.ak.us +cc.al.us +cc.ar.us +cc.as.us +cc.az.us +cc.ca.us +cc.co.us +cc.ct.us +cc.dc.us +cc.de.us +cc.fl.us +cc.ga.us +cc.gu.us +cc.hi.us +cc.ia.us +cc.id.us +cc.il.us +cc.in.us +cc.ks.us +cc.ky.us +cc.la.us +cc.ma.us +cc.md.us +cc.me.us +cc.mi.us +cc.mn.us +cc.mo.us +cc.ms.us +cc.mt.us +cc.nc.us +cc.nd.us +cc.ne.us +cc.nh.us +cc.nj.us +cc.nm.us +cc.nv.us +cc.ny.us +cc.oh.us +cc.ok.us +cc.or.us +cc.pa.us +cc.pr.us +cc.ri.us +cc.sc.us +cc.sd.us +cc.tn.us +cc.tx.us +cc.ut.us +cc.vi.us +cc.vt.us +cc.va.us +cc.wa.us +cc.wi.us +cc.wv.us +cc.wy.us + +lib.ak.us +lib.al.us +lib.ar.us +lib.as.us +lib.az.us +lib.ca.us +lib.co.us +lib.ct.us +lib.dc.us +lib.de.us +lib.fl.us +lib.ga.us +lib.gu.us +lib.hi.us +lib.ia.us +lib.id.us +lib.il.us +lib.in.us +lib.ks.us +lib.ky.us +lib.la.us +lib.ma.us +lib.md.us +lib.me.us +lib.mi.us +lib.mn.us +lib.mo.us +lib.ms.us +lib.mt.us +lib.nc.us +lib.nd.us +lib.ne.us +lib.nh.us +lib.nj.us +lib.nm.us +lib.nv.us +lib.ny.us +lib.oh.us +lib.ok.us +lib.or.us +lib.pa.us +lib.pr.us +lib.ri.us +lib.sc.us +lib.sd.us +lib.tn.us +lib.tx.us +lib.ut.us +lib.vi.us +lib.vt.us +lib.va.us +lib.wa.us +lib.wi.us +lib.wv.us +lib.wy.us + +// k12.ma.us contains school districts in Massachusetts. The 4LDs are +// managed indepedently except for private (PVT), charter (CHTR) and +// parochial (PAROCH) schools. Those are delegated dorectly to the +// 5LD operators. +pvt.k12.ma.us +chtr.k12.ma.us +paroch.k12.ma.us + +// uy : http://www.antel.com.uy/ +*.uy + +// uz : http://www.reg.uz/registerr.html +// are there other 2nd level tlds ? +uz +com.uz +co.uz + +// va : http://en.wikipedia.org/wiki/.va +va + +// vc : http://en.wikipedia.org/wiki/.vc +// Submitted by registry 2008-06-13 +vc +com.vc +net.vc +org.vc +gov.vc +mil.vc +edu.vc + +// ve : http://registro.nic.ve/nicve/registro/index.html +*.ve + +// vg : http://en.wikipedia.org/wiki/.vg +vg + +// vi : http://www.nic.vi/newdomainform.htm +// http://www.nic.vi/Domain_Rules/body_domain_rules.html indicates some other +// TLDs are "reserved", such as edu.vi and gov.vi, but doesn't actually say they +// are available for registration (which they do not seem to be). +vi +co.vi +com.vi +k12.vi +net.vi +org.vi + +// vn : https://www.dot.vn/vnnic/vnnic/domainregistration.jsp +vn +com.vn +net.vn +org.vn +edu.vn +gov.vn +int.vn +ac.vn +biz.vn +info.vn +name.vn +pro.vn +health.vn + +// vu : http://en.wikipedia.org/wiki/.vu +// list of 2nd level tlds ? +vu + +// wf : http://www.afnic.fr/medias/documents/AFNIC-naming-policy2012.pdf +wf + +// ws : http://en.wikipedia.org/wiki/.ws +// http://samoanic.ws/index.dhtml +ws +com.ws +net.ws +org.ws +gov.ws +edu.ws + +// yt : http://www.afnic.fr/medias/documents/AFNIC-naming-policy2012.pdf +yt + +// IDN ccTLDs +// Please sort by ISO 3166 ccTLD, then punicode string +// when submitting patches and follow this format: +// ("" ) : +// [optional sponsoring org] +// + +// xn--mgbaam7a8h ("Emerat" Arabic) : AE +//http://nic.ae/english/arabicdomain/rules.jsp +امارات + +// xn--54b7fta0cc ("Bangla" Bangla) : BD +বাংলা + +// xn--fiqs8s ("China" Chinese-Han-Simplified <.Zhonggou>) : CN +// CNNIC +// http://cnnic.cn/html/Dir/2005/10/11/3218.htm +中国 + +// xn--fiqz9s ("China" Chinese-Han-Traditional <.Zhonggou>) : CN +// CNNIC +// http://cnnic.cn/html/Dir/2005/10/11/3218.htm +中國 + +// xn--lgbbat1ad8j ("Algeria / Al Jazair" Arabic) : DZ +الجزائر + +// xn--wgbh1c ("Egypt" Arabic .masr) : EG +// http://www.dotmasr.eg/ +مصر + +// xn--node ("ge" Georgian (Mkhedruli)) : GE +გე + +// xn--j6w193g ("Hong Kong" Chinese-Han) : HK +// https://www2.hkirc.hk/register/rules.jsp +香港 + +// xn--h2brj9c ("Bharat" Devanagari) : IN +// India +भारत + +// xn--mgbbh1a71e ("Bharat" Arabic) : IN +// India +بھارت + +// xn--fpcrj9c3d ("Bharat" Telugu) : IN +// India +భారత్ + +// xn--gecrj9c ("Bharat" Gujarati) : IN +// India +ભારત + +// xn--s9brj9c ("Bharat" Gurmukhi) : IN +// India +ਭਾਰਤ + +// xn--45brj9c ("Bharat" Bengali) : IN +// India +ভারত + +// xn--xkc2dl3a5ee0h ("India" Tamil) : IN +// India +இந்தியா + +// xn--mgba3a4f16a ("Iran" Persian) : IR +ایران + +// xn--mgba3a4fra ("Iran" Arabic) : IR +ايران + +//xn--mgbayh7gpa ("al-Ordon" Arabic) JO +//National Information Technology Center (NITC) +//Royal Scientific Society, Al-Jubeiha +الاردن + +// xn--3e0b707e ("Republic of Korea" Hangul) : KR +한국 + +// xn--fzc2c9e2c ("Lanka" Sinhalese-Sinhala) : LK +// http://nic.lk +ලංකා + +// xn--xkc2al3hye2a ("Ilangai" Tamil) : LK +// http://nic.lk +இலங்கை + +// xn--mgbc0a9azcg ("Morocco / al-Maghrib" Arabic) : MA +المغرب + +// xn--mgb9awbf ("Oman" Arabic) : OM +عمان + +// xn--ygbi2ammx ("Falasteen" Arabic) : PS +// The Palestinian National Internet Naming Authority (PNINA) +// http://www.pnina.ps +فلسطين + +// xn--90a3ac ("srb" Cyrillic) : RS +срб + +// xn--p1ai ("rf" Russian-Cyrillic) : RU +// http://www.cctld.ru/en/docs/rulesrf.php +рф + +// xn--wgbl6a ("Qatar" Arabic) : QA +// http://www.ict.gov.qa/ +قطر + +// xn--mgberp4a5d4ar ("AlSaudiah" Arabic) : SA +// http://www.nic.net.sa/ +السعودية + +// xn--mgberp4a5d4a87g ("AlSaudiah" Arabic) variant : SA +السعودیة + +// xn--mgbqly7c0a67fbc ("AlSaudiah" Arabic) variant : SA +السعودیۃ + +// xn--mgbqly7cvafr ("AlSaudiah" Arabic) variant : SA +السعوديه + +// xn--ogbpf8fl ("Syria" Arabic) : SY +سورية + +// xn--mgbtf8fl ("Syria" Arabic) variant : SY +سوريا + +// xn--yfro4i67o Singapore ("Singapore" Chinese-Han) : SG +新加坡 + +// xn--clchc0ea0b2g2a9gcd ("Singapore" Tamil) : SG +சிங்கப்பூர் + +// xn--o3cw4h ("Thai" Thai) : TH +// http://www.thnic.co.th +ไทย + +// xn--pgbs0dh ("Tunis") : TN +// http://nic.tn +تونس + +// xn--kpry57d ("Taiwan" Chinese-Han-Traditional) : TW +// http://www.twnic.net/english/dn/dn_07a.htm +台灣 + +// xn--kprw13d ("Taiwan" Chinese-Han-Simplified) : TW +// http://www.twnic.net/english/dn/dn_07a.htm +台湾 + +// xn--nnx388a ("Taiwan") variant : TW +臺灣 + +// xn--j1amh ("ukr" Cyrillic) : UA +укр + +// xn--mgb2ddes ("AlYemen" Arabic) : YE +اليمن + +// xxx : http://icmregistry.com +xxx + +// ye : http://www.y.net.ye/services/domain_name.htm +*.ye + +// za : http://www.zadna.org.za/slds.html +*.za + +// zm : http://en.wikipedia.org/wiki/.zm +*.zm + +// zw : http://en.wikipedia.org/wiki/.zw +*.zw + +// ===END ICANN DOMAINS=== +// ===BEGIN PRIVATE DOMAINS=== + +// info.at : http://www.info.at/ +biz.at +info.at + +// priv.at : http://www.nic.priv.at/ +// Submitted by registry 2008-06-09 +priv.at + +// co.ca : http://registry.co.ca +co.ca + +// CentralNic : http://www.centralnic.com/names/domains +// Confirmed by registry 2008-06-09 +ar.com +br.com +cn.com +de.com +eu.com +gb.com +gr.com +hu.com +jpn.com +kr.com +no.com +qc.com +ru.com +sa.com +se.com +uk.com +us.com +uy.com +za.com +gb.net +jp.net +se.net +uk.net +ae.org +us.org +com.de + +// Opera Software, A.S.A. +// Requested by Yngve Pettersen 2009-11-26 +operaunite.com + +// Google, Inc. +// Requested by Eduardo Vela 2010-09-06 +appspot.com + +// iki.fi : Submitted by Hannu Aronsson 2009-11-05 +iki.fi + +// c.la : http://www.c.la/ +c.la + +// ZaNiC : http://www.za.net/ +// Confirmed by registry 2009-10-03 +za.net +za.org + +// CoDNS B.V. +// Added 2010-05-23. +co.nl +co.no + +// Mainseek Sp. z o.o. : http://www.co.pl/ +co.pl + +// DynDNS.com : http://www.dyndns.com/services/dns/dyndns/ +dyndns-at-home.com +dyndns-at-work.com +dyndns-blog.com +dyndns-free.com +dyndns-home.com +dyndns-ip.com +dyndns-mail.com +dyndns-office.com +dyndns-pics.com +dyndns-remote.com +dyndns-server.com +dyndns-web.com +dyndns-wiki.com +dyndns-work.com +dyndns.biz +dyndns.info +dyndns.org +dyndns.tv +at-band-camp.net +ath.cx +barrel-of-knowledge.info +barrell-of-knowledge.info +better-than.tv +blogdns.com +blogdns.net +blogdns.org +blogsite.org +boldlygoingnowhere.org +broke-it.net +buyshouses.net +cechire.com +dnsalias.com +dnsalias.net +dnsalias.org +dnsdojo.com +dnsdojo.net +dnsdojo.org +does-it.net +doesntexist.com +doesntexist.org +dontexist.com +dontexist.net +dontexist.org +doomdns.com +doomdns.org +dvrdns.org +dyn-o-saur.com +dynalias.com +dynalias.net +dynalias.org +dynathome.net +dyndns.ws +endofinternet.net +endofinternet.org +endoftheinternet.org +est-a-la-maison.com +est-a-la-masion.com +est-le-patron.com +est-mon-blogueur.com +for-better.biz +for-more.biz +for-our.info +for-some.biz +for-the.biz +forgot.her.name +forgot.his.name +from-ak.com +from-al.com +from-ar.com +from-az.net +from-ca.com +from-co.net +from-ct.com +from-dc.com +from-de.com +from-fl.com +from-ga.com +from-hi.com +from-ia.com +from-id.com +from-il.com +from-in.com +from-ks.com +from-ky.com +from-la.net +from-ma.com +from-md.com +from-me.org +from-mi.com +from-mn.com +from-mo.com +from-ms.com +from-mt.com +from-nc.com +from-nd.com +from-ne.com +from-nh.com +from-nj.com +from-nm.com +from-nv.com +from-ny.net +from-oh.com +from-ok.com +from-or.com +from-pa.com +from-pr.com +from-ri.com +from-sc.com +from-sd.com +from-tn.com +from-tx.com +from-ut.com +from-va.com +from-vt.com +from-wa.com +from-wi.com +from-wv.com +from-wy.com +ftpaccess.cc +fuettertdasnetz.de +game-host.org +game-server.cc +getmyip.com +gets-it.net +go.dyndns.org +gotdns.com +gotdns.org +groks-the.info +groks-this.info +ham-radio-op.net +here-for-more.info +hobby-site.com +hobby-site.org +home.dyndns.org +homedns.org +homeftp.net +homeftp.org +homeip.net +homelinux.com +homelinux.net +homelinux.org +homeunix.com +homeunix.net +homeunix.org +iamallama.com +in-the-band.net +is-a-anarchist.com +is-a-blogger.com +is-a-bookkeeper.com +is-a-bruinsfan.org +is-a-bulls-fan.com +is-a-candidate.org +is-a-caterer.com +is-a-celticsfan.org +is-a-chef.com +is-a-chef.net +is-a-chef.org +is-a-conservative.com +is-a-cpa.com +is-a-cubicle-slave.com +is-a-democrat.com +is-a-designer.com +is-a-doctor.com +is-a-financialadvisor.com +is-a-geek.com +is-a-geek.net +is-a-geek.org +is-a-green.com +is-a-guru.com +is-a-hard-worker.com +is-a-hunter.com +is-a-knight.org +is-a-landscaper.com +is-a-lawyer.com +is-a-liberal.com +is-a-libertarian.com +is-a-linux-user.org +is-a-llama.com +is-a-musician.com +is-a-nascarfan.com +is-a-nurse.com +is-a-painter.com +is-a-patsfan.org +is-a-personaltrainer.com +is-a-photographer.com +is-a-player.com +is-a-republican.com +is-a-rockstar.com +is-a-socialist.com +is-a-soxfan.org +is-a-student.com +is-a-teacher.com +is-a-techie.com +is-a-therapist.com +is-an-accountant.com +is-an-actor.com +is-an-actress.com +is-an-anarchist.com +is-an-artist.com +is-an-engineer.com +is-an-entertainer.com +is-by.us +is-certified.com +is-found.org +is-gone.com +is-into-anime.com +is-into-cars.com +is-into-cartoons.com +is-into-games.com +is-leet.com +is-lost.org +is-not-certified.com +is-saved.org +is-slick.com +is-uberleet.com +is-very-bad.org +is-very-evil.org +is-very-good.org +is-very-nice.org +is-very-sweet.org +is-with-theband.com +isa-geek.com +isa-geek.net +isa-geek.org +isa-hockeynut.com +issmarterthanyou.com +isteingeek.de +istmein.de +kicks-ass.net +kicks-ass.org +knowsitall.info +land-4-sale.us +lebtimnetz.de +leitungsen.de +likes-pie.com +likescandy.com +merseine.nu +mine.nu +misconfused.org +mypets.ws +myphotos.cc +neat-url.com +office-on-the.net +on-the-web.tv +podzone.net +podzone.org +readmyblog.org +saves-the-whales.com +scrapper-site.net +scrapping.cc +selfip.biz +selfip.com +selfip.info +selfip.net +selfip.org +sells-for-less.com +sells-for-u.com +sells-it.net +sellsyourhome.org +servebbs.com +servebbs.net +servebbs.org +serveftp.net +serveftp.org +servegame.org +shacknet.nu +simple-url.com +space-to-rent.com +stuff-4-sale.org +stuff-4-sale.us +teaches-yoga.com +thruhere.net +traeumtgerade.de +webhop.biz +webhop.info +webhop.net +webhop.org +worse-than.tv +writesthisblog.com + +// ===END PRIVATE DOMAINS=== diff --git a/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/tough-cookie/test.js b/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/tough-cookie/test.js new file mode 100644 index 0000000..5cbf536 --- /dev/null +++ b/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/tough-cookie/test.js @@ -0,0 +1,1625 @@ +/* + * Copyright GoInstant, Inc. and other 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. + */ +'use strict'; +var vows = require('vows'); +var assert = require('assert'); +var async = require('async'); + +// NOTE use require("tough-cookie") in your own code: +var tough = require('./lib/cookie'); +var Cookie = tough.Cookie; +var CookieJar = tough.CookieJar; + + +function dateVows(table) { + var theVows = { }; + Object.keys(table).forEach(function(date) { + var expect = table[date]; + theVows[date] = function() { + var got = tough.parseDate(date) ? 'valid' : 'invalid'; + assert.equal(got, expect ? 'valid' : 'invalid'); + }; + }); + return { "date parsing": theVows }; +} + +function matchVows(func,table) { + var theVows = {}; + table.forEach(function(item) { + var str = item[0]; + var dom = item[1]; + var expect = item[2]; + var label = str+(expect?" matches ":" doesn't match ")+dom; + theVows[label] = function() { + assert.equal(func(str,dom),expect); + }; + }); + return theVows; +} + +function defaultPathVows(table) { + var theVows = {}; + table.forEach(function(item) { + var str = item[0]; + var expect = item[1]; + var label = str+" gives "+expect; + theVows[label] = function() { + assert.equal(tough.defaultPath(str),expect); + }; + }); + return theVows; +} + +var atNow = Date.now(); +function at(offset) { return {now: new Date(atNow+offset)}; } + +vows.describe('Cookie Jar') +.addBatch({ + "all defined": function() { + assert.ok(Cookie); + assert.ok(CookieJar); + }, +}) +.addBatch( + dateVows({ + "Wed, 09 Jun 2021 10:18:14 GMT": true, + "Wed, 09 Jun 2021 22:18:14 GMT": true, + "Tue, 18 Oct 2011 07:42:42.123 GMT": true, + "18 Oct 2011 07:42:42 GMT": true, + "8 Oct 2011 7:42:42 GMT": true, + "8 Oct 2011 7:2:42 GMT": false, + "Oct 18 2011 07:42:42 GMT": true, + "Tue Oct 18 2011 07:05:03 GMT+0000 (GMT)": true, + "09 Jun 2021 10:18:14 GMT": true, + "99 Jix 3038 48:86:72 ZMT": false, + '01 Jan 1970 00:00:00 GMT': true, + '01 Jan 1600 00:00:00 GMT': false, // before 1601 + '01 Jan 1601 00:00:00 GMT': true, + '10 Feb 81 13:00:00 GMT': true, // implicit year + 'Thu, 01 Jan 1970 00:00:010 GMT': true, // strange time, non-strict OK + 'Thu, 17-Apr-2014 02:12:29 GMT': true, // dashes + 'Thu, 17-Apr-2014 02:12:29 UTC': true, // dashes and UTC + }) +) +.addBatch({ + "strict date parse of Thu, 01 Jan 1970 00:00:010 GMT": { + topic: function() { + return tough.parseDate('Thu, 01 Jan 1970 00:00:010 GMT', true) ? true : false; + }, + "invalid": function(date) { + assert.equal(date,false); + }, + } +}) +.addBatch({ + "formatting": { + "a simple cookie": { + topic: function() { + var c = new Cookie(); + c.key = 'a'; + c.value = 'b'; + return c; + }, + "validates": function(c) { + assert.ok(c.validate()); + }, + "to string": function(c) { + assert.equal(c.toString(), 'a=b'); + }, + }, + "a cookie with spaces in the value": { + topic: function() { + var c = new Cookie(); + c.key = 'a'; + c.value = 'beta gamma'; + return c; + }, + "doesn't validate": function(c) { + assert.ok(!c.validate()); + }, + "'garbage in, garbage out'": function(c) { + assert.equal(c.toString(), 'a=beta gamma'); + }, + }, + "with an empty value and HttpOnly": { + topic: function() { + var c = new Cookie(); + c.key = 'a'; + c.httpOnly = true; + return c; + }, + "to string": function(c) { + assert.equal(c.toString(), 'a=; HttpOnly'); + } + }, + "with an expiry": { + topic: function() { + var c = new Cookie(); + c.key = 'a'; + c.value = 'b'; + c.setExpires("Oct 18 2011 07:05:03 GMT"); + return c; + }, + "validates": function(c) { + assert.ok(c.validate()); + }, + "to string": function(c) { + assert.equal(c.toString(), 'a=b; Expires=Tue, 18 Oct 2011 07:05:03 GMT'); + }, + "to short string": function(c) { + assert.equal(c.cookieString(), 'a=b'); + }, + }, + "with a max-age": { + topic: function() { + var c = new Cookie(); + c.key = 'a'; + c.value = 'b'; + c.setExpires("Oct 18 2011 07:05:03 GMT"); + c.maxAge = 12345; + return c; + }, + "validates": function(c) { + assert.ok(c.validate()); // mabe this one *shouldn't*? + }, + "to string": function(c) { + assert.equal(c.toString(), 'a=b; Expires=Tue, 18 Oct 2011 07:05:03 GMT; Max-Age=12345'); + }, + }, + "with a bunch of things": function() { + var c = new Cookie(); + c.key = 'a'; + c.value = 'b'; + c.setExpires("Oct 18 2011 07:05:03 GMT"); + c.maxAge = 12345; + c.domain = 'example.com'; + c.path = '/foo'; + c.secure = true; + c.httpOnly = true; + c.extensions = ['MyExtension']; + assert.equal(c.toString(), 'a=b; Expires=Tue, 18 Oct 2011 07:05:03 GMT; Max-Age=12345; Domain=example.com; Path=/foo; Secure; HttpOnly; MyExtension'); + }, + "a host-only cookie": { + topic: function() { + var c = new Cookie(); + c.key = 'a'; + c.value = 'b'; + c.hostOnly = true; + c.domain = 'shouldnt-stringify.example.com'; + c.path = '/should-stringify'; + return c; + }, + "validates": function(c) { + assert.ok(c.validate()); + }, + "to string": function(c) { + assert.equal(c.toString(), 'a=b; Path=/should-stringify'); + }, + }, + "minutes are '10'": { + topic: function() { + var c = new Cookie(); + c.key = 'a'; + c.value = 'b'; + c.expires = new Date(1284113410000); + return c; + }, + "validates": function(c) { + assert.ok(c.validate()); + }, + "to string": function(c) { + var str = c.toString(); + assert.notEqual(str, 'a=b; Expires=Fri, 010 Sep 2010 010:010:010 GMT'); + assert.equal(str, 'a=b; Expires=Fri, 10 Sep 2010 10:10:10 GMT'); + }, + } + } +}) +.addBatch({ + "TTL with max-age": function() { + var c = new Cookie(); + c.maxAge = 123; + assert.equal(c.TTL(), 123000); + assert.equal(c.expiryTime(new Date(9000000)), 9123000); + }, + "TTL with zero max-age": function() { + var c = new Cookie(); + c.key = 'a'; c.value = 'b'; + c.maxAge = 0; // should be treated as "earliest representable" + assert.equal(c.TTL(), 0); + assert.equal(c.expiryTime(new Date(9000000)), -Infinity); + assert.ok(!c.validate()); // not valid, really: non-zero-digit *DIGIT + }, + "TTL with negative max-age": function() { + var c = new Cookie(); + c.key = 'a'; c.value = 'b'; + c.maxAge = -1; // should be treated as "earliest representable" + assert.equal(c.TTL(), 0); + assert.equal(c.expiryTime(new Date(9000000)), -Infinity); + assert.ok(!c.validate()); // not valid, really: non-zero-digit *DIGIT + }, + "TTL with max-age and expires": function() { + var c = new Cookie(); + c.maxAge = 123; + c.expires = new Date(Date.now()+9000); + assert.equal(c.TTL(), 123000); + assert.ok(c.isPersistent()); + }, + "TTL with expires": function() { + var c = new Cookie(); + var now = Date.now(); + c.expires = new Date(now+9000); + assert.equal(c.TTL(now), 9000); + assert.equal(c.expiryTime(), c.expires.getTime()); + }, + "TTL with old expires": function() { + var c = new Cookie(); + c.setExpires('17 Oct 2010 00:00:00 GMT'); + assert.ok(c.TTL() < 0); + assert.ok(c.isPersistent()); + }, + "default TTL": { + topic: function() { return new Cookie(); }, + "is Infinite-future": function(c) { assert.equal(c.TTL(), Infinity) }, + "is a 'session' cookie": function(c) { assert.ok(!c.isPersistent()) }, + }, +}).addBatch({ + "Parsing": { + "simple": { + topic: function() { + return Cookie.parse('a=bcd',true) || null; + }, + "parsed": function(c) { assert.ok(c) }, + "key": function(c) { assert.equal(c.key, 'a') }, + "value": function(c) { assert.equal(c.value, 'bcd') }, + "no path": function(c) { assert.equal(c.path, null) }, + "no domain": function(c) { assert.equal(c.domain, null) }, + "no extensions": function(c) { assert.ok(!c.extensions) }, + }, + "with expiry": { + topic: function() { + return Cookie.parse('a=bcd; Expires=Tue, 18 Oct 2011 07:05:03 GMT',true) || null; + }, + "parsed": function(c) { assert.ok(c) }, + "key": function(c) { assert.equal(c.key, 'a') }, + "value": function(c) { assert.equal(c.value, 'bcd') }, + "has expires": function(c) { + assert.ok(c.expires !== Infinity, 'expiry is infinite when it shouldn\'t be'); + assert.equal(c.expires.getTime(), 1318921503000); + }, + }, + "with expiry and path": { + topic: function() { + return Cookie.parse('abc="xyzzy!"; Expires=Tue, 18 Oct 2011 07:05:03 GMT; Path=/aBc',true) || null; + }, + "parsed": function(c) { assert.ok(c) }, + "key": function(c) { assert.equal(c.key, 'abc') }, + "value": function(c) { assert.equal(c.value, 'xyzzy!') }, + "has expires": function(c) { + assert.ok(c.expires !== Infinity, 'expiry is infinite when it shouldn\'t be'); + assert.equal(c.expires.getTime(), 1318921503000); + }, + "has path": function(c) { assert.equal(c.path, '/aBc'); }, + "no httponly or secure": function(c) { + assert.ok(!c.httpOnly); + assert.ok(!c.secure); + }, + }, + "with everything": { + topic: function() { + return Cookie.parse('abc="xyzzy!"; Expires=Tue, 18 Oct 2011 07:05:03 GMT; Path=/aBc; Domain=example.com; Secure; HTTPOnly; Max-Age=1234; Foo=Bar; Baz', true) || null; + }, + "parsed": function(c) { assert.ok(c) }, + "key": function(c) { assert.equal(c.key, 'abc') }, + "value": function(c) { assert.equal(c.value, 'xyzzy!') }, + "has expires": function(c) { + assert.ok(c.expires !== Infinity, 'expiry is infinite when it shouldn\'t be'); + assert.equal(c.expires.getTime(), 1318921503000); + }, + "has path": function(c) { assert.equal(c.path, '/aBc'); }, + "has domain": function(c) { assert.equal(c.domain, 'example.com'); }, + "has httponly": function(c) { assert.equal(c.httpOnly, true); }, + "has secure": function(c) { assert.equal(c.secure, true); }, + "has max-age": function(c) { assert.equal(c.maxAge, 1234); }, + "has extensions": function(c) { + assert.ok(c.extensions); + assert.equal(c.extensions[0], 'Foo=Bar'); + assert.equal(c.extensions[1], 'Baz'); + }, + }, + "invalid expires": { + "strict": function() { assert.ok(!Cookie.parse("a=b; Expires=xyzzy", true)) }, + "non-strict": function() { + var c = Cookie.parse("a=b; Expires=xyzzy"); + assert.ok(c); + assert.equal(c.expires, Infinity); + }, + }, + "zero max-age": { + "strict": function() { assert.ok(!Cookie.parse("a=b; Max-Age=0", true)) }, + "non-strict": function() { + var c = Cookie.parse("a=b; Max-Age=0"); + assert.ok(c); + assert.equal(c.maxAge, 0); + }, + }, + "negative max-age": { + "strict": function() { assert.ok(!Cookie.parse("a=b; Max-Age=-1", true)) }, + "non-strict": function() { + var c = Cookie.parse("a=b; Max-Age=-1"); + assert.ok(c); + assert.equal(c.maxAge, -1); + }, + }, + "empty domain": { + "strict": function() { assert.ok(!Cookie.parse("a=b; domain=", true)) }, + "non-strict": function() { + var c = Cookie.parse("a=b; domain="); + assert.ok(c); + assert.equal(c.domain, null); + }, + }, + "dot domain": { + "strict": function() { assert.ok(!Cookie.parse("a=b; domain=.", true)) }, + "non-strict": function() { + var c = Cookie.parse("a=b; domain=."); + assert.ok(c); + assert.equal(c.domain, null); + }, + }, + "uppercase domain": { + "strict lowercases": function() { + var c = Cookie.parse("a=b; domain=EXAMPLE.COM"); + assert.ok(c); + assert.equal(c.domain, 'example.com'); + }, + "non-strict lowercases": function() { + var c = Cookie.parse("a=b; domain=EXAMPLE.COM"); + assert.ok(c); + assert.equal(c.domain, 'example.com'); + }, + }, + "trailing dot in domain": { + topic: function() { + return Cookie.parse("a=b; Domain=example.com.", true) || null; + }, + "has the domain": function(c) { assert.equal(c.domain,"example.com.") }, + "but doesn't validate": function(c) { assert.equal(c.validate(),false) }, + }, + "empty path": { + "strict": function() { assert.ok(!Cookie.parse("a=b; path=", true)) }, + "non-strict": function() { + var c = Cookie.parse("a=b; path="); + assert.ok(c); + assert.equal(c.path, null); + }, + }, + "no-slash path": { + "strict": function() { assert.ok(!Cookie.parse("a=b; path=xyzzy", true)) }, + "non-strict": function() { + var c = Cookie.parse("a=b; path=xyzzy"); + assert.ok(c); + assert.equal(c.path, null); + }, + }, + "trailing semi-colons after path": { + topic: function () { + return [ + "a=b; path=/;", + "c=d;;;;" + ]; + }, + "strict": function (t) { + assert.ok(!Cookie.parse(t[0], true)); + assert.ok(!Cookie.parse(t[1], true)); + }, + "non-strict": function (t) { + var c1 = Cookie.parse(t[0]); + var c2 = Cookie.parse(t[1]); + assert.ok(c1); + assert.ok(c2); + assert.equal(c1.path, '/'); + } + }, + "secure-with-value": { + "strict": function() { assert.ok(!Cookie.parse("a=b; Secure=xyzzy", true)) }, + "non-strict": function() { + var c = Cookie.parse("a=b; Secure=xyzzy"); + assert.ok(c); + assert.equal(c.secure, true); + }, + }, + "httponly-with-value": { + "strict": function() { assert.ok(!Cookie.parse("a=b; HttpOnly=xyzzy", true)) }, + "non-strict": function() { + var c = Cookie.parse("a=b; HttpOnly=xyzzy"); + assert.ok(c); + assert.equal(c.httpOnly, true); + }, + }, + "garbage": { + topic: function() { + return Cookie.parse("\x08", true) || null; + }, + "doesn't parse": function(c) { assert.equal(c,null) }, + }, + "public suffix domain": { + topic: function() { + return Cookie.parse("a=b; domain=kyoto.jp", true) || null; + }, + "parses fine": function(c) { + assert.ok(c); + assert.equal(c.domain, 'kyoto.jp'); + }, + "but fails validation": function(c) { + assert.ok(c); + assert.ok(!c.validate()); + }, + }, + "Ironically, Google 'GAPS' cookie has very little whitespace": { + topic: function() { + return Cookie.parse("GAPS=1:A1aaaaAaAAa1aaAaAaaAAAaaa1a11a:aaaAaAaAa-aaaA1-;Path=/;Expires=Thu, 17-Apr-2014 02:12:29 GMT;Secure;HttpOnly"); + }, + "parsed": function(c) { assert.ok(c) }, + "key": function(c) { assert.equal(c.key, 'GAPS') }, + "value": function(c) { assert.equal(c.value, '1:A1aaaaAaAAa1aaAaAaaAAAaaa1a11a:aaaAaAaAa-aaaA1-') }, + "path": function(c) { + assert.notEqual(c.path, '/;Expires'); // BUG + assert.equal(c.path, '/'); + }, + "expires": function(c) { + assert.notEqual(c.expires, Infinity); + assert.equal(c.expires.getTime(), 1397700749000); + }, + "secure": function(c) { assert.ok(c.secure) }, + "httponly": function(c) { assert.ok(c.httpOnly) }, + }, + "lots of equal signs": { + topic: function() { + return Cookie.parse("queryPref=b=c&d=e; Path=/f=g; Expires=Thu, 17 Apr 2014 02:12:29 GMT; HttpOnly"); + }, + "parsed": function(c) { assert.ok(c) }, + "key": function(c) { assert.equal(c.key, 'queryPref') }, + "value": function(c) { assert.equal(c.value, 'b=c&d=e') }, + "path": function(c) { + assert.equal(c.path, '/f=g'); + }, + "expires": function(c) { + assert.notEqual(c.expires, Infinity); + assert.equal(c.expires.getTime(), 1397700749000); + }, + "httponly": function(c) { assert.ok(c.httpOnly) }, + }, + "spaces in value": { + "strict": { + topic: function() { + return Cookie.parse('a=one two three',true) || null; + }, + "did not parse": function(c) { assert.isNull(c) }, + }, + "non-strict": { + topic: function() { + return Cookie.parse('a=one two three',false) || null; + }, + "parsed": function(c) { assert.ok(c) }, + "key": function(c) { assert.equal(c.key, 'a') }, + "value": function(c) { assert.equal(c.value, 'one two three') }, + "no path": function(c) { assert.equal(c.path, null) }, + "no domain": function(c) { assert.equal(c.domain, null) }, + "no extensions": function(c) { assert.ok(!c.extensions) }, + }, + }, + "quoted spaces in value": { + "strict": { + topic: function() { + return Cookie.parse('a="one two three"',true) || null; + }, + "did not parse": function(c) { assert.isNull(c) }, + }, + "non-strict": { + topic: function() { + return Cookie.parse('a="one two three"',false) || null; + }, + "parsed": function(c) { assert.ok(c) }, + "key": function(c) { assert.equal(c.key, 'a') }, + "value": function(c) { assert.equal(c.value, 'one two three') }, + "no path": function(c) { assert.equal(c.path, null) }, + "no domain": function(c) { assert.equal(c.domain, null) }, + "no extensions": function(c) { assert.ok(!c.extensions) }, + } + }, + "non-ASCII in value": { + "strict": { + topic: function() { + return Cookie.parse('farbe=weiß',true) || null; + }, + "did not parse": function(c) { assert.isNull(c) }, + }, + "non-strict": { + topic: function() { + return Cookie.parse('farbe=weiß',false) || null; + }, + "parsed": function(c) { assert.ok(c) }, + "key": function(c) { assert.equal(c.key, 'farbe') }, + "value": function(c) { assert.equal(c.value, 'weiß') }, + "no path": function(c) { assert.equal(c.path, null) }, + "no domain": function(c) { assert.equal(c.domain, null) }, + "no extensions": function(c) { assert.ok(!c.extensions) }, + }, + }, + } +}) +.addBatch({ + "domain normalization": { + "simple": function() { + var c = new Cookie(); + c.domain = "EXAMPLE.com"; + assert.equal(c.canonicalizedDomain(), "example.com"); + }, + "extra dots": function() { + var c = new Cookie(); + c.domain = ".EXAMPLE.com"; + assert.equal(c.cdomain(), "example.com"); + }, + "weird trailing dot": function() { + var c = new Cookie(); + c.domain = "EXAMPLE.ca."; + assert.equal(c.canonicalizedDomain(), "example.ca."); + }, + "weird internal dots": function() { + var c = new Cookie(); + c.domain = "EXAMPLE...ca."; + assert.equal(c.canonicalizedDomain(), "example...ca."); + }, + "IDN": function() { + var c = new Cookie(); + c.domain = "δοκιμή.δοκιμή"; // "test.test" in greek + assert.equal(c.canonicalizedDomain(), "xn--jxalpdlp.xn--jxalpdlp"); + } + } +}) +.addBatch({ + "Domain Match":matchVows(tough.domainMatch, [ + // str, dom, expect + ["example.com", "example.com", true], + ["eXaMpLe.cOm", "ExAmPlE.CoM", true], + ["no.ca", "yes.ca", false], + ["wwwexample.com", "example.com", false], + ["www.example.com", "example.com", true], + ["example.com", "www.example.com", false], + ["www.subdom.example.com", "example.com", true], + ["www.subdom.example.com", "subdom.example.com", true], + ["example.com", "example.com.", false], // RFC6265 S4.1.2.3 + ["192.168.0.1", "168.0.1", false], // S5.1.3 "The string is a host name" + [null, "example.com", null], + ["example.com", null, null], + [null, null, null], + [undefined, undefined, null], + ]) +}) +.addBatch({ + "default-path": defaultPathVows([ + [null,"/"], + ["/","/"], + ["/file","/"], + ["/dir/file","/dir"], + ["noslash","/"], + ]) +}) +.addBatch({ + "Path-Match": matchVows(tough.pathMatch, [ + // request, cookie, match + ["/","/",true], + ["/dir","/",true], + ["/","/dir",false], + ["/dir/","/dir/", true], + ["/dir/file","/dir/",true], + ["/dir/file","/dir",true], + ["/directory","/dir",false], + ]) +}) +.addBatch({ + "Cookie Sorting": { + topic: function() { + var cookies = []; + var now = Date.now(); + cookies.push(Cookie.parse("a=0; Domain=example.com")); + cookies.push(Cookie.parse("b=1; Domain=www.example.com")); + cookies.push(Cookie.parse("c=2; Domain=example.com; Path=/pathA")); + cookies.push(Cookie.parse("d=3; Domain=www.example.com; Path=/pathA")); + cookies.push(Cookie.parse("e=4; Domain=example.com; Path=/pathA/pathB")); + cookies.push(Cookie.parse("f=5; Domain=www.example.com; Path=/pathA/pathB")); + + // force a stable creation time consistent with the order above since + // some may have been created at now + 1ms. + var i = cookies.length; + cookies.forEach(function(cookie) { + cookie.creation = new Date(now - 100*(i--)); + }); + + // weak shuffle: + cookies = cookies.sort(function(){return Math.random()-0.5}); + + cookies = cookies.sort(tough.cookieCompare); + return cookies; + }, + "got": function(cookies) { + assert.lengthOf(cookies, 6); + var names = cookies.map(function(c) {return c.key}); + assert.deepEqual(names, ['e','f','c','d','a','b']); + }, + } +}) +.addBatch({ + "CookieJar": { + "Setting a basic cookie": { + topic: function() { + var cj = new CookieJar(); + var c = Cookie.parse("a=b; Domain=example.com; Path=/"); + assert.strictEqual(c.hostOnly, null); + assert.instanceOf(c.creation, Date); + assert.strictEqual(c.lastAccessed, null); + c.creation = new Date(Date.now()-10000); + cj.setCookie(c, 'http://example.com/index.html', this.callback); + }, + "works": function(c) { assert.instanceOf(c,Cookie) }, // C is for Cookie, good enough for me + "gets timestamped": function(c) { + assert.ok(c.creation); + assert.ok(Date.now() - c.creation.getTime() < 5000); // recently stamped + assert.ok(c.lastAccessed); + assert.equal(c.creation, c.lastAccessed); + assert.equal(c.TTL(), Infinity); + assert.ok(!c.isPersistent()); + }, + }, + "Setting a no-path cookie": { + topic: function() { + var cj = new CookieJar(); + var c = Cookie.parse("a=b; Domain=example.com"); + assert.strictEqual(c.hostOnly, null); + assert.instanceOf(c.creation, Date); + assert.strictEqual(c.lastAccessed, null); + c.creation = new Date(Date.now()-10000); + cj.setCookie(c, 'http://example.com/index.html', this.callback); + }, + "domain": function(c) { assert.equal(c.domain, 'example.com') }, + "path is /": function(c) { assert.equal(c.path, '/') }, + "path was derived": function(c) { assert.strictEqual(c.pathIsDefault, true) }, + }, + "Setting a cookie already marked as host-only": { + topic: function() { + var cj = new CookieJar(); + var c = Cookie.parse("a=b; Domain=example.com"); + assert.strictEqual(c.hostOnly, null); + assert.instanceOf(c.creation, Date); + assert.strictEqual(c.lastAccessed, null); + c.creation = new Date(Date.now()-10000); + c.hostOnly = true; + cj.setCookie(c, 'http://example.com/index.html', this.callback); + }, + "domain": function(c) { assert.equal(c.domain, 'example.com') }, + "still hostOnly": function(c) { assert.strictEqual(c.hostOnly, true) }, + }, + "Setting a session cookie": { + topic: function() { + var cj = new CookieJar(); + var c = Cookie.parse("a=b"); + assert.strictEqual(c.path, null); + cj.setCookie(c, 'http://www.example.com/dir/index.html', this.callback); + }, + "works": function(c) { assert.instanceOf(c,Cookie) }, + "gets the domain": function(c) { assert.equal(c.domain, 'www.example.com') }, + "gets the default path": function(c) { assert.equal(c.path, '/dir') }, + "is 'hostOnly'": function(c) { assert.ok(c.hostOnly) }, + }, + "Setting wrong domain cookie": { + topic: function() { + var cj = new CookieJar(); + var c = Cookie.parse("a=b; Domain=fooxample.com; Path=/"); + cj.setCookie(c, 'http://example.com/index.html', this.callback); + }, + "fails": function(err,c) { + assert.ok(err.message.match(/domain/i)); + assert.ok(!c); + }, + }, + "Setting sub-domain cookie": { + topic: function() { + var cj = new CookieJar(); + var c = Cookie.parse("a=b; Domain=www.example.com; Path=/"); + cj.setCookie(c, 'http://example.com/index.html', this.callback); + }, + "fails": function(err,c) { + assert.ok(err.message.match(/domain/i)); + assert.ok(!c); + }, + }, + "Setting super-domain cookie": { + topic: function() { + var cj = new CookieJar(); + var c = Cookie.parse("a=b; Domain=example.com; Path=/"); + cj.setCookie(c, 'http://www.app.example.com/index.html', this.callback); + }, + "success": function(err,c) { + assert.ok(!err); + assert.equal(c.domain, 'example.com'); + }, + }, + "Setting a sub-path cookie on a super-domain": { + topic: function() { + var cj = new CookieJar(); + var c = Cookie.parse("a=b; Domain=example.com; Path=/subpath"); + assert.strictEqual(c.hostOnly, null); + assert.instanceOf(c.creation, Date); + assert.strictEqual(c.lastAccessed, null); + c.creation = new Date(Date.now()-10000); + cj.setCookie(c, 'http://www.example.com/index.html', this.callback); + }, + "domain is super-domain": function(c) { assert.equal(c.domain, 'example.com') }, + "path is /subpath": function(c) { assert.equal(c.path, '/subpath') }, + "path was NOT derived": function(c) { assert.strictEqual(c.pathIsDefault, null) }, + }, + "Setting HttpOnly cookie over non-HTTP API": { + topic: function() { + var cj = new CookieJar(); + var c = Cookie.parse("a=b; Domain=example.com; Path=/; HttpOnly"); + cj.setCookie(c, 'http://example.com/index.html', {http:false}, this.callback); + }, + "fails": function(err,c) { + assert.match(err.message, /HttpOnly/i); + assert.ok(!c); + }, + }, + }, + "Cookie Jar store eight cookies": { + topic: function() { + var cj = new CookieJar(); + var ex = 'http://example.com/index.html'; + var tasks = []; + tasks.push(function(next) { + cj.setCookie('a=1; Domain=example.com; Path=/',ex,at(0),next); + }); + tasks.push(function(next) { + cj.setCookie('b=2; Domain=example.com; Path=/; HttpOnly',ex,at(1000),next); + }); + tasks.push(function(next) { + cj.setCookie('c=3; Domain=example.com; Path=/; Secure',ex,at(2000),next); + }); + tasks.push(function(next) { // path + cj.setCookie('d=4; Domain=example.com; Path=/foo',ex,at(3000),next); + }); + tasks.push(function(next) { // host only + cj.setCookie('e=5',ex,at(4000),next); + }); + tasks.push(function(next) { // other domain + cj.setCookie('f=6; Domain=nodejs.org; Path=/','http://nodejs.org',at(5000),next); + }); + tasks.push(function(next) { // expired + cj.setCookie('g=7; Domain=example.com; Path=/; Expires=Tue, 18 Oct 2011 00:00:00 GMT',ex,at(6000),next); + }); + tasks.push(function(next) { // expired via Max-Age + cj.setCookie('h=8; Domain=example.com; Path=/; Max-Age=1',ex,next); + }); + var cb = this.callback; + async.parallel(tasks, function(err,results){ + setTimeout(function() { + cb(err,cj,results); + }, 2000); // so that 'h=8' expires + }); + }, + "setup ok": function(err,cj,results) { + assert.ok(!err); + assert.ok(cj); + assert.ok(results); + }, + "then retrieving for http://nodejs.org": { + topic: function(cj,oldResults) { + assert.ok(oldResults); + cj.getCookies('http://nodejs.org',this.callback); + }, + "get a nodejs cookie": function(cookies) { + assert.lengthOf(cookies, 1); + var cookie = cookies[0]; + assert.equal(cookie.domain, 'nodejs.org'); + }, + }, + "then retrieving for https://example.com": { + topic: function(cj,oldResults) { + assert.ok(oldResults); + cj.getCookies('https://example.com',{secure:true},this.callback); + }, + "get a secure example cookie with others": function(cookies) { + var names = cookies.map(function(c) {return c.key}); + assert.deepEqual(names, ['a','b','c','e']); + }, + }, + "then retrieving for https://example.com (missing options)": { + topic: function(cj,oldResults) { + assert.ok(oldResults); + cj.getCookies('https://example.com',this.callback); + }, + "get a secure example cookie with others": function(cookies) { + var names = cookies.map(function(c) {return c.key}); + assert.deepEqual(names, ['a','b','c','e']); + }, + }, + "then retrieving for http://example.com": { + topic: function(cj,oldResults) { + assert.ok(oldResults); + cj.getCookies('http://example.com',this.callback); + }, + "get a bunch of cookies": function(cookies) { + var names = cookies.map(function(c) {return c.key}); + assert.deepEqual(names, ['a','b','e']); + }, + }, + "then retrieving for http://EXAMPlE.com": { + topic: function(cj,oldResults) { + assert.ok(oldResults); + cj.getCookies('http://EXAMPlE.com',this.callback); + }, + "get a bunch of cookies": function(cookies) { + var names = cookies.map(function(c) {return c.key}); + assert.deepEqual(names, ['a','b','e']); + }, + }, + "then retrieving for http://example.com, non-HTTP": { + topic: function(cj,oldResults) { + assert.ok(oldResults); + cj.getCookies('http://example.com',{http:false},this.callback); + }, + "get a bunch of cookies": function(cookies) { + var names = cookies.map(function(c) {return c.key}); + assert.deepEqual(names, ['a','e']); + }, + }, + "then retrieving for http://example.com/foo/bar": { + topic: function(cj,oldResults) { + assert.ok(oldResults); + cj.getCookies('http://example.com/foo/bar',this.callback); + }, + "get a bunch of cookies": function(cookies) { + var names = cookies.map(function(c) {return c.key}); + assert.deepEqual(names, ['d','a','b','e']); + }, + }, + "then retrieving for http://example.com as a string": { + topic: function(cj,oldResults) { + assert.ok(oldResults); + cj.getCookieString('http://example.com',this.callback); + }, + "get a single string": function(cookieHeader) { + assert.equal(cookieHeader, "a=1; b=2; e=5"); + }, + }, + "then retrieving for http://example.com as a set-cookie header": { + topic: function(cj,oldResults) { + assert.ok(oldResults); + cj.getSetCookieStrings('http://example.com',this.callback); + }, + "get a single string": function(cookieHeaders) { + assert.lengthOf(cookieHeaders, 3); + assert.equal(cookieHeaders[0], "a=1; Domain=example.com; Path=/"); + assert.equal(cookieHeaders[1], "b=2; Domain=example.com; Path=/; HttpOnly"); + assert.equal(cookieHeaders[2], "e=5; Path=/"); + }, + }, + "then retrieving for http://www.example.com/": { + topic: function(cj,oldResults) { + assert.ok(oldResults); + cj.getCookies('http://www.example.com/foo/bar',this.callback); + }, + "get a bunch of cookies": function(cookies) { + var names = cookies.map(function(c) {return c.key}); + assert.deepEqual(names, ['d','a','b']); // note lack of 'e' + }, + }, + }, + "Repeated names": { + topic: function() { + var cb = this.callback; + var cj = new CookieJar(); + var ex = 'http://www.example.com/'; + var sc = cj.setCookie; + var tasks = []; + var now = Date.now(); + tasks.push(sc.bind(cj,'aaaa=xxxx',ex,at(0))); + tasks.push(sc.bind(cj,'aaaa=1111; Domain=www.example.com',ex,at(1000))); + tasks.push(sc.bind(cj,'aaaa=2222; Domain=example.com',ex,at(2000))); + tasks.push(sc.bind(cj,'aaaa=3333; Domain=www.example.com; Path=/pathA',ex,at(3000))); + async.series(tasks,function(err,results) { + results = results.filter(function(e) {return e !== undefined}); + cb(err,{cj:cj, cookies:results, now:now}); + }); + }, + "all got set": function(err,t) { + assert.lengthOf(t.cookies,4); + }, + "then getting 'em back": { + topic: function(t) { + var cj = t.cj; + cj.getCookies('http://www.example.com/pathA',this.callback); + }, + "there's just three": function (err,cookies) { + var vals = cookies.map(function(c) {return c.value}); + // may break with sorting; sorting should put 3333 first due to longest path: + assert.deepEqual(vals, ['3333','1111','2222']); + } + }, + }, + "CookieJar setCookie errors": { + "public-suffix domain": { + topic: function() { + var cj = new CookieJar(); + cj.setCookie('i=9; Domain=kyoto.jp; Path=/','kyoto.jp',this.callback); + }, + "errors": function(err,cookie) { + assert.ok(err); + assert.ok(!cookie); + assert.match(err.message, /public suffix/i); + }, + }, + "wrong domain": { + topic: function() { + var cj = new CookieJar(); + cj.setCookie('j=10; Domain=google.com; Path=/','google.ca',this.callback); + }, + "errors": function(err,cookie) { + assert.ok(err); + assert.ok(!cookie); + assert.match(err.message, /not in this host's domain/i); + }, + }, + "old cookie is HttpOnly": { + topic: function() { + var cb = this.callback; + var next = function (err,c) { + c = null; + return cb(err,cj); + }; + var cj = new CookieJar(); + cj.setCookie('k=11; Domain=example.ca; Path=/; HttpOnly','http://example.ca',{http:true},next); + }, + "initial cookie is set": function(err,cj) { + assert.ok(!err); + assert.ok(cj); + }, + "but when trying to overwrite": { + topic: function(cj) { + var cb = this.callback; + var next = function(err,c) { + c = null; + cb(null,err); + }; + cj.setCookie('k=12; Domain=example.ca; Path=/','http://example.ca',{http:false},next); + }, + "it's an error": function(err) { + assert.ok(err); + }, + "then, checking the original": { + topic: function(ignored,cj) { + assert.ok(cj instanceof CookieJar); + cj.getCookies('http://example.ca',{http:true},this.callback); + }, + "cookie has original value": function(err,cookies) { + assert.equal(err,null); + assert.lengthOf(cookies, 1); + assert.equal(cookies[0].value,11); + }, + }, + }, + }, + }, +}) +.addBatch({ + "JSON": { + "serialization": { + topic: function() { + var c = Cookie.parse('alpha=beta; Domain=example.com; Path=/foo; Expires=Tue, 19 Jan 2038 03:14:07 GMT; HttpOnly'); + return JSON.stringify(c); + }, + "gives a string": function(str) { + assert.equal(typeof str, "string"); + }, + "date is in ISO format": function(str) { + assert.match(str, /"expires":"2038-01-19T03:14:07\.000Z"/, 'expires is in ISO format'); + }, + }, + "deserialization": { + topic: function() { + var json = '{"key":"alpha","value":"beta","domain":"example.com","path":"/foo","expires":"2038-01-19T03:14:07.000Z","httpOnly":true,"lastAccessed":2000000000123}'; + return Cookie.fromJSON(json); + }, + "works": function(c) { + assert.ok(c); + }, + "key": function(c) { assert.equal(c.key, "alpha") }, + "value": function(c) { assert.equal(c.value, "beta") }, + "domain": function(c) { assert.equal(c.domain, "example.com") }, + "path": function(c) { assert.equal(c.path, "/foo") }, + "httpOnly": function(c) { assert.strictEqual(c.httpOnly, true) }, + "secure": function(c) { assert.strictEqual(c.secure, false) }, + "hostOnly": function(c) { assert.strictEqual(c.hostOnly, null) }, + "expires is a date object": function(c) { + assert.equal(c.expires.getTime(), 2147483647000); + }, + "lastAccessed is a date object": function(c) { + assert.equal(c.lastAccessed.getTime(), 2000000000123); + }, + "creation defaulted": function(c) { + assert.ok(c.creation.getTime()); + } + }, + "null deserialization": { + topic: function() { + return Cookie.fromJSON(null); + }, + "is null": function(cookie) { + assert.equal(cookie,null); + }, + }, + }, + "expiry deserialization": { + "Infinity": { + topic: Cookie.fromJSON.bind(null, '{"expires":"Infinity"}'), + "is infinite": function(c) { + assert.strictEqual(c.expires, "Infinity"); + assert.equal(c.expires, Infinity); + }, + }, + }, + "maxAge serialization": { + topic: function() { + return function(toSet) { + var c = new Cookie(); + c.key = 'foo'; c.value = 'bar'; + c.setMaxAge(toSet); + return JSON.stringify(c); + }; + }, + "zero": { + topic: function(f) { return f(0) }, + "looks good": function(str) { + assert.match(str, /"maxAge":0/); + }, + }, + "Infinity": { + topic: function(f) { return f(Infinity) }, + "looks good": function(str) { + assert.match(str, /"maxAge":"Infinity"/); + }, + }, + "-Infinity": { + topic: function(f) { return f(-Infinity) }, + "looks good": function(str) { + assert.match(str, /"maxAge":"-Infinity"/); + }, + }, + "null": { + topic: function(f) { return f(null) }, + "looks good": function(str) { + assert.match(str, /"maxAge":null/); + }, + }, + }, + "maxAge deserialization": { + "number": { + topic: Cookie.fromJSON.bind(null,'{"key":"foo","value":"bar","maxAge":123}'), + "is the number": function(c) { + assert.strictEqual(c.maxAge, 123); + }, + }, + "null": { + topic: Cookie.fromJSON.bind(null,'{"key":"foo","value":"bar","maxAge":null}'), + "is null": function(c) { + assert.strictEqual(c.maxAge, null); + }, + }, + "less than zero": { + topic: Cookie.fromJSON.bind(null,'{"key":"foo","value":"bar","maxAge":-123}'), + "is -123": function(c) { + assert.strictEqual(c.maxAge, -123); + }, + }, + "Infinity": { + topic: Cookie.fromJSON.bind(null,'{"key":"foo","value":"bar","maxAge":"Infinity"}'), + "is inf-as-string": function(c) { + assert.strictEqual(c.maxAge, "Infinity"); + }, + }, + "-Infinity": { + topic: Cookie.fromJSON.bind(null,'{"key":"foo","value":"bar","maxAge":"-Infinity"}'), + "is inf-as-string": function(c) { + assert.strictEqual(c.maxAge, "-Infinity"); + }, + }, + } +}) +.addBatch({ + "permuteDomain": { + "base case": { + topic: tough.permuteDomain.bind(null,'example.com'), + "got the domain": function(list) { + assert.deepEqual(list, ['example.com']); + }, + }, + "two levels": { + topic: tough.permuteDomain.bind(null,'foo.bar.example.com'), + "got three things": function(list) { + assert.deepEqual(list, ['example.com','bar.example.com','foo.bar.example.com']); + }, + }, + "invalid domain": { + topic: tough.permuteDomain.bind(null,'foo.bar.example.localduhmain'), + "got three things": function(list) { + assert.equal(list, null); + }, + }, + }, + "permutePath": { + "base case": { + topic: tough.permutePath.bind(null,'/'), + "just slash": function(list) { + assert.deepEqual(list,['/']); + }, + }, + "single case": { + topic: tough.permutePath.bind(null,'/foo'), + "two things": function(list) { + assert.deepEqual(list,['/foo','/']); + }, + "path matching": function(list) { + list.forEach(function(e) { + assert.ok(tough.pathMatch('/foo',e)); + }); + }, + }, + "double case": { + topic: tough.permutePath.bind(null,'/foo/bar'), + "four things": function(list) { + assert.deepEqual(list,['/foo/bar','/foo','/']); + }, + "path matching": function(list) { + list.forEach(function(e) { + assert.ok(tough.pathMatch('/foo/bar',e)); + }); + }, + }, + "trailing slash": { + topic: tough.permutePath.bind(null,'/foo/bar/'), + "three things": function(list) { + assert.deepEqual(list,['/foo/bar','/foo','/']); + }, + "path matching": function(list) { + list.forEach(function(e) { + assert.ok(tough.pathMatch('/foo/bar/',e)); + }); + }, + }, + } +}) +.addBatch({ + "Issue 1": { + topic: function() { + var cj = new CookieJar(); + cj.setCookie('hello=world; path=/some/path/', 'http://domain/some/path/file', function(err,cookie) { + this.callback(err,{cj:cj, cookie:cookie}); + }.bind(this)); + }, + "stored a cookie": function(t) { + assert.ok(t.cookie); + }, + "cookie's path was modified to remove unnecessary slash": function(t) { + assert.equal(t.cookie.path, '/some/path'); + }, + "getting it back": { + topic: function(t) { + t.cj.getCookies('http://domain/some/path/file', function(err,cookies) { + this.callback(err, {cj:t.cj, cookies:cookies||[]}); + }.bind(this)); + }, + "got one cookie": function(t) { + assert.lengthOf(t.cookies, 1); + }, + "it's the right one": function(t) { + var c = t.cookies[0]; + assert.equal(c.key, 'hello'); + assert.equal(c.value, 'world'); + }, + } + } +}) +.addBatch({ + "expiry option": { + topic: function() { + var cb = this.callback; + var cj = new CookieJar(); + cj.setCookie('near=expiry; Domain=example.com; Path=/; Max-Age=1','http://www.example.com',at(-1), function(err,cookie) { + + cb(err, {cj:cj, cookie:cookie}); + }); + }, + "set the cookie": function(t) { + assert.ok(t.cookie, "didn't set?!"); + assert.equal(t.cookie.key, 'near'); + }, + "then, retrieving": { + topic: function(t) { + var cb = this.callback; + setTimeout(function() { + t.cj.getCookies('http://www.example.com', {http:true, expire:false}, function(err,cookies) { + t.cookies = cookies; + cb(err,t); + }); + },2000); + }, + "got the cookie": function(t) { + assert.lengthOf(t.cookies, 1); + assert.equal(t.cookies[0].key, 'near'); + }, + } + } +}) +.addBatch({ + "trailing semi-colon set into cj": { + topic: function () { + var cb = this.callback; + var cj = new CookieJar(); + var ex = 'http://www.example.com'; + var tasks = []; + tasks.push(function(next) { + cj.setCookie('broken_path=testme; path=/;',ex,at(-1),next); + }); + tasks.push(function(next) { + cj.setCookie('b=2; Path=/;;;;',ex,at(-1),next); + }); + async.parallel(tasks, function (err, cookies) { + cb(null, { + cj: cj, + cookies: cookies + }); + }); + }, + "check number of cookies": function (t) { + assert.lengthOf(t.cookies, 2, "didn't set"); + }, + "check *broken_path* was set properly": function (t) { + assert.equal(t.cookies[0].key, "broken_path"); + assert.equal(t.cookies[0].value, "testme"); + assert.equal(t.cookies[0].path, "/"); + }, + "check *b* was set properly": function (t) { + assert.equal(t.cookies[1].key, "b"); + assert.equal(t.cookies[1].value, "2"); + assert.equal(t.cookies[1].path, "/"); + }, + "retrieve the cookie": { + topic: function (t) { + var cb = this.callback; + t.cj.getCookies('http://www.example.com', {}, function (err, cookies) { + t.cookies = cookies; + cb(err, t); + }); + }, + "get the cookie": function(t) { + assert.lengthOf(t.cookies, 2); + assert.equal(t.cookies[0].key, 'broken_path'); + assert.equal(t.cookies[0].value, 'testme'); + assert.equal(t.cookies[1].key, "b"); + assert.equal(t.cookies[1].value, "2"); + assert.equal(t.cookies[1].path, "/"); + }, + }, + } +}) +.addBatch({ + "Constructor":{ + topic: function () { + return new Cookie({ + key: 'test', + value: 'b', + maxAge: 60 + }); + }, + 'check for key property': function (c) { + assert.ok(c); + assert.equal(c.key, 'test'); + }, + 'check for value property': function (c) { + assert.equal(c.value, 'b'); + }, + 'check for maxAge': function (c) { + assert.equal(c.maxAge, 60); + }, + 'check for default values for unspecified properties': function (c) { + assert.equal(c.expires, "Infinity"); + assert.equal(c.secure, false); + assert.equal(c.httpOnly, false); + } + } +}) +.addBatch({ + "allPaths option": { + topic: function() { + var cj = new CookieJar(); + var tasks = []; + tasks.push(cj.setCookie.bind(cj, 'nopath_dom=qq; Path=/; Domain=example.com', 'http://example.com', {})); + tasks.push(cj.setCookie.bind(cj, 'path_dom=qq; Path=/foo; Domain=example.com', 'http://example.com', {})); + tasks.push(cj.setCookie.bind(cj, 'nopath_host=qq; Path=/', 'http://www.example.com', {})); + tasks.push(cj.setCookie.bind(cj, 'path_host=qq; Path=/foo', 'http://www.example.com', {})); + tasks.push(cj.setCookie.bind(cj, 'other=qq; Path=/', 'http://other.example.com/', {})); + tasks.push(cj.setCookie.bind(cj, 'other2=qq; Path=/foo', 'http://other.example.com/foo', {})); + var cb = this.callback; + async.parallel(tasks, function(err,results) { + cb(err, {cj:cj, cookies: results}); + }); + }, + "all set": function(t) { + assert.equal(t.cookies.length, 6); + assert.ok(t.cookies.every(function(c) { return !!c })); + }, + "getting without allPaths": { + topic: function(t) { + var cb = this.callback; + var cj = t.cj; + cj.getCookies('http://www.example.com/', {}, function(err,cookies) { + cb(err, {cj:cj, cookies:cookies}); + }); + }, + "found just two cookies": function(t) { + assert.equal(t.cookies.length, 2); + }, + "all are path=/": function(t) { + assert.ok(t.cookies.every(function(c) { return c.path === '/' })); + }, + "no 'other' cookies": function(t) { + assert.ok(!t.cookies.some(function(c) { return (/^other/).test(c.name) })); + }, + }, + "getting without allPaths for /foo": { + topic: function(t) { + var cb = this.callback; + var cj = t.cj; + cj.getCookies('http://www.example.com/foo', {}, function(err,cookies) { + cb(err, {cj:cj, cookies:cookies}); + }); + }, + "found four cookies": function(t) { + assert.equal(t.cookies.length, 4); + }, + "no 'other' cookies": function(t) { + assert.ok(!t.cookies.some(function(c) { return (/^other/).test(c.name) })); + }, + }, + "getting with allPaths:true": { + topic: function(t) { + var cb = this.callback; + var cj = t.cj; + cj.getCookies('http://www.example.com/', {allPaths:true}, function(err,cookies) { + cb(err, {cj:cj, cookies:cookies}); + }); + }, + "found four cookies": function(t) { + assert.equal(t.cookies.length, 4); + }, + "no 'other' cookies": function(t) { + assert.ok(!t.cookies.some(function(c) { return (/^other/).test(c.name) })); + }, + }, + } +}) +.addBatch({ + "remove cookies": { + topic: function() { + var jar = new CookieJar(); + var cookie = Cookie.parse("a=b; Domain=example.com; Path=/"); + var cookie2 = Cookie.parse("a=b; Domain=foo.com; Path=/"); + var cookie3 = Cookie.parse("foo=bar; Domain=foo.com; Path=/"); + jar.setCookie(cookie, 'http://example.com/index.html', function(){}); + jar.setCookie(cookie2, 'http://foo.com/index.html', function(){}); + jar.setCookie(cookie3, 'http://foo.com/index.html', function(){}); + return jar; + }, + "all from matching domain": function(jar){ + jar.store.removeCookies('example.com',null, function(err) { + assert(err == null); + + jar.store.findCookies('example.com', null, function(err, cookies){ + assert(err == null); + assert(cookies != null); + assert(cookies.length === 0, 'cookie was not removed'); + }); + + jar.store.findCookies('foo.com', null, function(err, cookies){ + assert(err == null); + assert(cookies != null); + assert(cookies.length === 2, 'cookies should not have been removed'); + }); + }); + }, + "from cookie store matching domain and key": function(jar){ + jar.store.removeCookie('foo.com', '/', 'foo', function(err) { + assert(err == null); + + jar.store.findCookies('foo.com', null, function(err, cookies){ + assert(err == null); + assert(cookies != null); + assert(cookies.length === 1, 'cookie was not removed correctly'); + assert(cookies[0].key === 'a', 'wrong cookie was removed'); + }); + }); + } + } +}) +.addBatch({ + "Synchronous CookieJar": { + "setCookieSync": { + topic: function() { + var jar = new CookieJar(); + var cookie = Cookie.parse("a=b; Domain=example.com; Path=/"); + cookie = jar.setCookieSync(cookie, 'http://example.com/index.html'); + return cookie; + }, + "returns a copy of the cookie": function(cookie) { + assert.instanceOf(cookie, Cookie); + } + }, + + "setCookieSync strict parse error": { + topic: function() { + var jar = new CookieJar(); + var opts = { strict: true }; + try { + jar.setCookieSync("farbe=weiß", 'http://example.com/index.html', opts); + return false; + } catch (e) { + return e; + } + }, + "throws the error": function(err) { + assert.instanceOf(err, Error); + assert.equal(err.message, "Cookie failed to parse"); + } + }, + + "getCookiesSync": { + topic: function() { + var jar = new CookieJar(); + var url = 'http://example.com/index.html'; + jar.setCookieSync("a=b; Domain=example.com; Path=/", url); + jar.setCookieSync("c=d; Domain=example.com; Path=/", url); + return jar.getCookiesSync(url); + }, + "returns the cookie array": function(err, cookies) { + assert.ok(!err); + assert.ok(Array.isArray(cookies)); + assert.lengthOf(cookies, 2); + cookies.forEach(function(cookie) { + assert.instanceOf(cookie, Cookie); + }); + } + }, + + "getCookieStringSync": { + topic: function() { + var jar = new CookieJar(); + var url = 'http://example.com/index.html'; + jar.setCookieSync("a=b; Domain=example.com; Path=/", url); + jar.setCookieSync("c=d; Domain=example.com; Path=/", url); + return jar.getCookieStringSync(url); + }, + "returns the cookie header string": function(err, str) { + assert.ok(!err); + assert.typeOf(str, 'string'); + } + }, + + "getSetCookieStringsSync": { + topic: function() { + var jar = new CookieJar(); + var url = 'http://example.com/index.html'; + jar.setCookieSync("a=b; Domain=example.com; Path=/", url); + jar.setCookieSync("c=d; Domain=example.com; Path=/", url); + return jar.getSetCookieStringsSync(url); + }, + "returns the cookie header string": function(err, headers) { + assert.ok(!err); + assert.ok(Array.isArray(headers)); + assert.lengthOf(headers, 2); + headers.forEach(function(header) { + assert.typeOf(header, 'string'); + }); + } + }, + } +}) +.addBatch({ + "Synchronous API on async CookieJar": { + topic: function() { + return new tough.Store(); + }, + "setCookieSync": { + topic: function(store) { + var jar = new CookieJar(store); + try { + jar.setCookieSync("a=b", 'http://example.com/index.html'); + return false; + } catch(e) { + return e; + } + }, + "fails": function(err) { + assert.instanceOf(err, Error); + assert.equal(err.message, + 'CookieJar store is not synchronous; use async API instead.'); + } + }, + "getCookiesSync": { + topic: function(store) { + var jar = new CookieJar(store); + try { + jar.getCookiesSync('http://example.com/index.html'); + return false; + } catch(e) { + return e; + } + }, + "fails": function(err) { + assert.instanceOf(err, Error); + assert.equal(err.message, + 'CookieJar store is not synchronous; use async API instead.'); + } + }, + "getCookieStringSync": { + topic: function(store) { + var jar = new CookieJar(store); + try { + jar.getCookieStringSync('http://example.com/index.html'); + return false; + } catch(e) { + return e; + } + }, + "fails": function(err) { + assert.instanceOf(err, Error); + assert.equal(err.message, + 'CookieJar store is not synchronous; use async API instead.'); + } + }, + "getSetCookieStringsSync": { + topic: function(store) { + var jar = new CookieJar(store); + try { + jar.getSetCookieStringsSync('http://example.com/index.html'); + return false; + } catch(e) { + return e; + } + }, + "fails": function(err) { + assert.instanceOf(err, Error); + assert.equal(err.message, + 'CookieJar store is not synchronous; use async API instead.'); + } + }, + } +}) +.export(module); diff --git a/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/tunnel-agent/.jshintrc b/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/tunnel-agent/.jshintrc new file mode 100644 index 0000000..4c1c8d4 --- /dev/null +++ b/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/tunnel-agent/.jshintrc @@ -0,0 +1,5 @@ +{ + "node": true, + "asi": true, + "laxcomma": true +} diff --git a/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/tunnel-agent/index.js b/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/tunnel-agent/index.js index 3f7bbb9..13c0427 100644 --- a/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/tunnel-agent/index.js +++ b/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/tunnel-agent/index.js @@ -67,9 +67,18 @@ function TunnelingAgent(options) { } util.inherits(TunnelingAgent, events.EventEmitter) -TunnelingAgent.prototype.addRequest = function addRequest(req, host, port) { +TunnelingAgent.prototype.addRequest = function addRequest(req, options) { var self = this + // Legacy API: addRequest(req, host, port, path) + if (typeof options === 'string') { + options = { + host: options, + port: arguments[2], + path: arguments[3] + }; + } + if (self.sockets.length >= this.maxSockets) { // We are over limit so we'll add it to the queue. self.requests.push({host: host, port: port, request: req}) @@ -77,14 +86,14 @@ TunnelingAgent.prototype.addRequest = function addRequest(req, host, port) { } // If we are under maxSockets create a new one. - self.createSocket({host: host, port: port, request: req}, function(socket) { + self.createSocket({host: options.host, port: options.port, request: req}, function(socket) { socket.on('free', onFree) socket.on('close', onCloseOrRemove) socket.on('agentRemove', onCloseOrRemove) req.onSocket(socket) function onFree() { - self.emit('free', socket, host, port) + self.emit('free', socket, options.host, options.port) } function onCloseOrRemove(err) { diff --git a/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/tunnel-agent/package.json b/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/tunnel-agent/package.json index 0b41be9..0b00d7e 100644 --- a/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/tunnel-agent/package.json +++ b/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/tunnel-agent/package.json @@ -6,7 +6,7 @@ }, "name": "tunnel-agent", "description": "HTTP proxy tunneling agent. Formerly part of mikeal/request, now a standalone module.", - "version": "0.3.0", + "version": "0.4.0", "repository": { "url": "https://github.com/mikeal/tunnel-agent" }, @@ -17,13 +17,17 @@ "engines": { "node": "*" }, - "_id": "tunnel-agent@0.3.0", + "bugs": { + "url": "https://github.com/mikeal/tunnel-agent/issues" + }, + "homepage": "https://github.com/mikeal/tunnel-agent", + "_id": "tunnel-agent@0.4.0", "dist": { - "shasum": "ad681b68f5321ad2827c4cfb1b7d5df2cfe942ee", - "tarball": "http://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.3.0.tgz" + "shasum": "b1184e312ffbcf70b3b4c78e8c219de7ebb1c550", + "tarball": "http://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.4.0.tgz" }, - "_from": "tunnel-agent@~0.3.0", - "_npmVersion": "1.2.14", + "_from": "tunnel-agent@~0.4.0", + "_npmVersion": "1.3.21", "_npmUser": { "name": "mikeal", "email": "mikeal.rogers@gmail.com" @@ -35,12 +39,8 @@ } ], "directories": {}, - "_shasum": "ad681b68f5321ad2827c4cfb1b7d5df2cfe942ee", - "_resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.3.0.tgz", - "bugs": { - "url": "https://github.com/mikeal/tunnel-agent/issues" - }, + "_shasum": "b1184e312ffbcf70b3b4c78e8c219de7ebb1c550", + "_resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.4.0.tgz", "readme": "ERROR: No README data found!", - "homepage": "https://github.com/mikeal/tunnel-agent", "scripts": {} } diff --git a/node_modules/bower/node_modules/bower-registry-client/node_modules/request/package.json b/node_modules/bower/node_modules/bower-registry-client/node_modules/request/package.json old mode 100755 new mode 100644 index c222bf3..b809400 --- a/node_modules/bower/node_modules/bower-registry-client/node_modules/request/package.json +++ b/node_modules/bower/node_modules/bower-registry-client/node_modules/request/package.json @@ -7,59 +7,88 @@ "util", "utility" ], - "version": "2.27.0", + "version": "2.51.0", "author": { "name": "Mikeal Rogers", "email": "mikeal.rogers@gmail.com" }, "repository": { "type": "git", - "url": "http://github.com/mikeal/request.git" + "url": "https://github.com/request/request.git" }, "bugs": { - "url": "http://github.com/mikeal/request/issues" + "url": "http://github.com/request/request/issues" + }, + "license": "Apache-2.0", + "engines": { + "node": ">=0.8.0" }, - "engines": [ - "node >= 0.8.0" - ], "main": "index.js", "dependencies": { - "qs": "~0.6.0", - "json-stringify-safe": "~5.0.0", + "bl": "~0.9.0", + "caseless": "~0.8.0", "forever-agent": "~0.5.0", - "tunnel-agent": "~0.3.0", - "http-signature": "~0.10.0", - "hawk": "~1.0.0", - "aws-sign": "~0.3.0", - "oauth-sign": "~0.3.0", - "cookie-jar": "~0.3.0", + "form-data": "~0.2.0", + "json-stringify-safe": "~5.0.0", + "mime-types": "~1.0.1", "node-uuid": "~1.4.0", - "mime": "~1.2.9", - "form-data": "~0.1.0" + "qs": "~2.3.1", + "tunnel-agent": "~0.4.0", + "tough-cookie": ">=0.12.0", + "http-signature": "~0.10.0", + "oauth-sign": "~0.5.0", + "hawk": "1.1.1", + "aws-sign2": "~0.5.0", + "stringstream": "~0.0.4", + "combined-stream": "~0.0.5" }, "scripts": { - "test": "node tests/run.js" + "test": "npm run lint && node node_modules/.bin/taper tests/test-*.js && npm run test-browser", + "test-browser": "browserify tests/browser/test.js -o tests/browser/test-browser.js && karma start tests/browser/karma.conf.js", + "lint": "node node_modules/.bin/eslint lib/ *.js tests/ && echo Lint passed." }, - "_id": "request@2.27.0", - "dist": { - "shasum": "dfb1a224dd3a5a9bade4337012503d710e538668", - "tarball": "http://registry.npmjs.org/request/-/request-2.27.0.tgz" + "devDependencies": { + "browserify": "~5.9.1", + "coveralls": "~2.11.2", + "eslint": "0.5.1", + "function-bind": "~1.0.0", + "istanbul": "~0.3.2", + "karma": "~0.12.21", + "karma-cli": "0.0.4", + "karma-phantomjs-launcher": "~0.1.4", + "karma-tap": "~1.0.1", + "rimraf": "~2.2.8", + "tape": "~3.0.0", + "taper": "~0.3.0" }, - "_from": "request@~2.27.0", - "_npmVersion": "1.3.2", + "gitHead": "1c8aca6a9205df58660c676005fb8ec4603d5265", + "homepage": "https://github.com/request/request", + "_id": "request@2.51.0", + "_shasum": "35d00bbecc012e55f907b1bd9e0dbd577bfef26e", + "_from": "request@~2.51.0", + "_npmVersion": "1.4.14", "_npmUser": { - "name": "mikeal", - "email": "mikeal.rogers@gmail.com" + "name": "nylen", + "email": "jnylen@gmail.com" }, "maintainers": [ { "name": "mikeal", "email": "mikeal.rogers@gmail.com" + }, + { + "name": "nylen", + "email": "jnylen@gmail.com" + }, + { + "name": "fredkschott", + "email": "fkschott@gmail.com" } ], + "dist": { + "shasum": "35d00bbecc012e55f907b1bd9e0dbd577bfef26e", + "tarball": "http://registry.npmjs.org/request/-/request-2.51.0.tgz" + }, "directories": {}, - "_shasum": "dfb1a224dd3a5a9bade4337012503d710e538668", - "_resolved": "https://registry.npmjs.org/request/-/request-2.27.0.tgz", - "readme": "ERROR: No README data found!", - "homepage": "https://github.com/mikeal/request" + "_resolved": "https://registry.npmjs.org/request/-/request-2.51.0.tgz" } diff --git a/node_modules/bower/node_modules/bower-registry-client/node_modules/request/release.sh b/node_modules/bower/node_modules/bower-registry-client/node_modules/request/release.sh new file mode 100755 index 0000000..7678bf8 --- /dev/null +++ b/node_modules/bower/node_modules/bower-registry-client/node_modules/request/release.sh @@ -0,0 +1,45 @@ +#!/bin/sh + +if [ -z "`which github-changes`" ]; then + # specify version because github-changes "is under heavy development. Things + # may break between releases" until 0.1.0 + echo "First, do: [sudo] npm install -g github-changes@0.0.14" + exit 1 +fi + +if [ -d .git/refs/remotes/upstream ]; then + remote=upstream +else + remote=origin +fi + +# Increment v2.x.y -> v2.x+1.0 +npm version minor || exit 1 + +# Generate changelog from pull requests +github-changes -o request -r request \ + --auth --verbose \ + --file CHANGELOG.md \ + --only-pulls --use-commit-body \ + --date-format '(YYYY/MM/DD)' \ + || exit 1 + +# Since the tag for the new version hasn't been pushed yet, any changes in it +# will be marked as "upcoming" +version="$(grep '"version"' package.json | cut -d'"' -f4)" +sed -i -e "s/^### upcoming/### v$version/" CHANGELOG.md + +# This may fail if no changelog updates +# TODO: would this ever actually happen? handle it better? +git add CHANGELOG.md; git commit -m 'Update changelog' + +# Publish the new version to npm +npm publish || exit 1 + +# Increment v2.x.0 -> v2.x.1 +# For rationale, see: +# https://github.com/request/oauth-sign/issues/10#issuecomment-58917018 +npm version patch || exit 1 + +# Push back to the main repo +git push $remote master --tags || exit 1 diff --git a/node_modules/bower/node_modules/bower-registry-client/node_modules/request/request.js b/node_modules/bower/node_modules/bower-registry-client/node_modules/request/request.js index 0311f74..90220d2 100644 --- a/node_modules/bower/node_modules/bower-registry-client/node_modules/request/request.js +++ b/node_modules/bower/node_modules/bower-registry-client/node_modules/request/request.js @@ -1,122 +1,364 @@ +'use strict' + var http = require('http') - , https = false - , tls = false + , https = require('https') , url = require('url') , util = require('util') , stream = require('stream') , qs = require('qs') , querystring = require('querystring') - , crypto = require('crypto') - + , zlib = require('zlib') + , helpers = require('./lib/helpers') + , bl = require('bl') , oauth = require('oauth-sign') , hawk = require('hawk') - , aws = require('aws-sign') + , aws = require('aws-sign2') , httpSignature = require('http-signature') , uuid = require('node-uuid') - , mime = require('mime') + , mime = require('mime-types') , tunnel = require('tunnel-agent') - , _safeStringify = require('json-stringify-safe') - + , stringstream = require('stringstream') + , caseless = require('caseless') , ForeverAgent = require('forever-agent') , FormData = require('form-data') - - , Cookie = require('cookie-jar') - , CookieJar = Cookie.Jar - , cookieJar = new CookieJar - + , cookies = require('./lib/cookies') , copy = require('./lib/copy') , debug = require('./lib/debug') - , getSafe = require('./lib/getSafe') - ; - -function safeStringify (obj) { - var ret - try { ret = JSON.stringify(obj) } - catch (e) { ret = _safeStringify(obj) } - return ret -} + , net = require('net') + , CombinedStream = require('combined-stream') + +var safeStringify = helpers.safeStringify + , md5 = helpers.md5 + , isReadStream = helpers.isReadStream + , toBase64 = helpers.toBase64 + , defer = helpers.defer + , globalCookieJar = cookies.jar() + var globalPool = {} -var isUrl = /^https?:/i + , isUrl = /^https?:/ + +var defaultProxyHeaderWhiteList = [ + 'accept', + 'accept-charset', + 'accept-encoding', + 'accept-language', + 'accept-ranges', + 'cache-control', + 'content-encoding', + 'content-language', + 'content-length', + 'content-location', + 'content-md5', + 'content-range', + 'content-type', + 'connection', + 'date', + 'expect', + 'max-forwards', + 'pragma', + 'referer', + 'te', + 'transfer-encoding', + 'user-agent', + 'via' +] + +var defaultProxyHeaderExclusiveList = [ + 'proxy-authorization' +] + +function filterForNonReserved(reserved, options) { + // Filter out properties that are not reserved. + // Reserved values are passed in at call site. + + var object = {} + for (var i in options) { + var notReserved = (reserved.indexOf(i) === -1) + if (notReserved) { + object[i] = options[i] + } + } + return object +} -try { - https = require('https') -} catch (e) {} +function filterOutReservedFunctions(reserved, options) { + // Filter out properties that are functions and are reserved. + // Reserved values are passed in at call site. -try { - tls = require('tls') -} catch (e) {} + var object = {} + for (var i in options) { + var isReserved = !(reserved.indexOf(i) === -1) + var isFunction = (typeof options[i] === 'function') + if (!(isReserved && isFunction)) { + object[i] = options[i] + } + } + return object +} +function constructProxyHost(uriObject) { + var port = uriObject.portA + , protocol = uriObject.protocol + , proxyHost = uriObject.hostname + ':' -// Hacky fix for pre-0.4.4 https -if (https && !https.Agent) { - https.Agent = function (options) { - http.Agent.call(this, options) + if (port) { + proxyHost += port + } else if (protocol === 'https:') { + proxyHost += '443' + } else { + proxyHost += '80' } - util.inherits(https.Agent, http.Agent) - https.Agent.prototype._getConnection = function (host, port, cb) { - var s = tls.connect(port, host, this.options, function () { - // do other checks here? - if (cb) cb() + + return proxyHost +} + +function constructProxyHeaderWhiteList(headers, proxyHeaderWhiteList) { + var whiteList = proxyHeaderWhiteList + .reduce(function (set, header) { + set[header.toLowerCase()] = true + return set + }, {}) + + return Object.keys(headers) + .filter(function (header) { + return whiteList[header.toLowerCase()] }) - return s - } + .reduce(function (set, header) { + set[header] = headers[header] + return set + }, {}) } -function isReadStream (rs) { - if (rs.readable && rs.path && rs.mode) { - return true +function construcTunnelOptions(request) { + var proxy = request.proxy + + var tunnelOptions = { + proxy: { + host: proxy.hostname, + port: +proxy.port, + proxyAuth: proxy.auth, + headers: request.proxyHeaders + }, + rejectUnauthorized: request.rejectUnauthorized, + headers: request.headers, + ca: request.ca, + cert: request.cert, + key: request.key } + + return tunnelOptions } -function toBase64 (str) { - return (new Buffer(str || "", "ascii")).toString("base64") +function constructTunnelFnName(uri, proxy) { + var uriProtocol = (uri.protocol === 'https:' ? 'https' : 'http') + var proxyProtocol = (proxy.protocol === 'https:' ? 'Https' : 'Http') + return [uriProtocol, proxyProtocol].join('Over') } -function md5 (str) { - return crypto.createHash('md5').update(str).digest('hex') +function getTunnelFn(request) { + var uri = request.uri + var proxy = request.proxy + var tunnelFnName = constructTunnelFnName(uri, proxy) + return tunnel[tunnelFnName] } -function Request (options) { - stream.Stream.call(this) - this.readable = true - this.writable = true +// Decide the proper request proxy to use based on the request URI object and the +// environmental variables (NO_PROXY, HTTP_PROXY, etc.) +function getProxyFromURI(uri) { + // respect NO_PROXY environment variables (see: http://lynx.isc.org/current/breakout/lynx_help/keystrokes/environments.html) + var noProxy = process.env.NO_PROXY || process.env.no_proxy || null - if (typeof options === 'string') { - options = {uri:options} + // easy case first - if NO_PROXY is '*' + if (noProxy === '*') { + return null } - var reserved = Object.keys(Request.prototype) - for (var i in options) { - if (reserved.indexOf(i) === -1) { - this[i] = options[i] - } else { - if (typeof options[i] === 'function') { - delete options[i] + // otherwise, parse the noProxy value to see if it applies to the URL + if (noProxy !== null) { + var noProxyItem, hostname, port, noProxyItemParts, noProxyHost, noProxyPort, noProxyList + + // canonicalize the hostname, so that 'oogle.com' won't match 'google.com' + hostname = uri.hostname.replace(/^\.*/, '.').toLowerCase() + noProxyList = noProxy.split(',') + + for (var i = 0, len = noProxyList.length; i < len; i++) { + noProxyItem = noProxyList[i].trim().toLowerCase() + + // no_proxy can be granular at the port level, which complicates things a bit. + if (noProxyItem.indexOf(':') > -1) { + noProxyItemParts = noProxyItem.split(':', 2) + noProxyHost = noProxyItemParts[0].replace(/^\.*/, '.') + noProxyPort = noProxyItemParts[1] + port = uri.port || (uri.protocol === 'https:' ? '443' : '80') + + // we've found a match - ports are same and host ends with no_proxy entry. + if (port === noProxyPort && hostname.indexOf(noProxyHost) === hostname.length - noProxyHost.length) { + return null + } + } else { + noProxyItem = noProxyItem.replace(/^\.*/, '.') + var isMatchedAt = hostname.indexOf(noProxyItem) + if (isMatchedAt > -1 && isMatchedAt === hostname.length - noProxyItem.length) { + return null + } } } } - if (options.method) { - this.explicitMethod = true + // check for HTTP(S)_PROXY environment variables + if (uri.protocol === 'http:') { + return process.env.HTTP_PROXY || process.env.http_proxy || null + } else if (uri.protocol === 'https:') { + return process.env.HTTPS_PROXY || process.env.https_proxy || process.env.HTTP_PROXY || process.env.http_proxy || null } - this.init(options) + // return null if all else fails (What uri protocol are you using then?) + return null } + +// Function for properly handling a connection error +function connectionErrorHandler(error) { + var socket = this + if (socket.res) { + if (socket.res.request) { + socket.res.request.emit('error', error) + } else { + socket.res.emit('error', error) + } + } else { + socket._httpMessage.emit('error', error) + } +} + +// Return a simpler request object to allow serialization +function requestToJSON() { + var self = this + return { + uri: self.uri, + method: self.method, + headers: self.headers + } +} + +// Return a simpler response object to allow serialization +function responseToJSON() { + var self = this + return { + statusCode: self.statusCode, + body: self.body, + headers: self.headers, + request: requestToJSON.call(self.request) + } +} + +function Request (options) { + // if tunnel property of options was not given default to false + // if given the method property in options, set property explicitMethod to true + + // extend the Request instance with any non-reserved properties + // remove any reserved functions from the options object + // set Request instance to be readable and writable + // call init + + var self = this + stream.Stream.call(self) + var reserved = Object.keys(Request.prototype) + var nonReserved = filterForNonReserved(reserved, options) + + stream.Stream.call(self) + util._extend(self, nonReserved) + options = filterOutReservedFunctions(reserved, options) + + self.readable = true + self.writable = true + if (typeof options.tunnel === 'undefined') { + options.tunnel = false + } + if (options.method) { + self.explicitMethod = true + } + self.canTunnel = options.tunnel !== false && tunnel + self.init(options) +} + util.inherits(Request, stream.Stream) + +Request.prototype.setupTunnel = function () { + // Set up the tunneling agent if necessary + // Only send the proxy whitelisted header names. + // Turn on tunneling for the rest of request. + + var self = this + + if (typeof self.proxy === 'string') { + self.proxy = url.parse(self.proxy) + } + + if (!self.proxy) { + return false + } + + if (!self.tunnel && self.uri.protocol !== 'https:') { + return false + } + + // Always include `defaultProxyHeaderExclusiveList` + + if (!self.proxyHeaderExclusiveList) { + self.proxyHeaderExclusiveList = [] + } + + var proxyHeaderExclusiveList = self.proxyHeaderExclusiveList.concat(defaultProxyHeaderExclusiveList) + + // Treat `proxyHeaderExclusiveList` as part of `proxyHeaderWhiteList` + + if (!self.proxyHeaderWhiteList) { + self.proxyHeaderWhiteList = defaultProxyHeaderWhiteList + } + + var proxyHeaderWhiteList = self.proxyHeaderWhiteList.concat(proxyHeaderExclusiveList) + + var proxyHost = constructProxyHost(self.uri) + self.proxyHeaders = constructProxyHeaderWhiteList(self.headers, proxyHeaderWhiteList) + self.proxyHeaders.host = proxyHost + + proxyHeaderExclusiveList.forEach(self.removeHeader, self) + + var tunnelFn = getTunnelFn(self) + var tunnelOptions = construcTunnelOptions(self) + + self.agent = tunnelFn(tunnelOptions) + self.tunnel = true + return true +} + Request.prototype.init = function (options) { // init() contains all the code to setup the request object. // the actual outgoing request is not started until start() is called // this function is called from both the constructor and on redirect. var self = this - if (!options) options = {} + if (!options) { + options = {} + } + self.headers = self.headers ? copy(self.headers) : {} + + caseless.httpify(self, self.headers) - if (!self.method) self.method = options.method || 'GET' + if (!self.method) { + self.method = options.method || 'GET' + } self.localAddress = options.localAddress + if (!self.qsLib) { + self.qsLib = (options.useQuerystring ? querystring : qs) + } + debug(options) - if (!self.pool && self.pool !== false) self.pool = globalPool + if (!self.pool && self.pool !== false) { + self.pool = globalPool + } self.dests = self.dests || [] self.__isRequestRequest = true @@ -124,7 +366,9 @@ Request.prototype.init = function (options) { if (!self._callback && self.callback) { self._callback = self.callback self.callback = function () { - if (self._callbackCalled) return // Print a warning maybe? + if (self._callbackCalled) { + return // Print a warning maybe? + } self._callbackCalled = true self._callback.apply(self, arguments) } @@ -132,77 +376,93 @@ Request.prototype.init = function (options) { self.on('complete', self.callback.bind(self, null)) } - if (self.url && !self.uri) { - // People use this property instead all the time so why not just support it. + // People use this property instead all the time, so support it + if (!self.uri && self.url) { self.uri = self.url delete self.url } + // A URI is needed by this point, throw if we haven't been able to get one if (!self.uri) { - // this will throw if unhandled but is handleable when in a redirect - return self.emit('error', new Error("options.uri is a required argument")) - } else { - if (typeof self.uri == "string") self.uri = url.parse(self.uri) + return self.emit('error', new Error('options.uri is a required argument')) + } + + // If a string URI/URL was given, parse it into a URL object + if(typeof self.uri === 'string') { + self.uri = url.parse(self.uri) + } + + // DEPRECATED: Warning for users of the old Unix Sockets URL Scheme + if (self.uri.protocol === 'unix:') { + return self.emit('error', new Error('`unix://` URL scheme is no longer supported. Please use the format `http://unix:SOCKET:PATH`')) + } + + // Support Unix Sockets + if(self.uri.host === 'unix') { + // Get the socket & request paths from the URL + var unixParts = self.uri.path.split(':') + , host = unixParts[0] + , path = unixParts[1] + // Apply unix properties to request + self.socketPath = host + self.uri.pathname = path + self.uri.path = path + self.uri.host = host + self.uri.hostname = host + self.uri.isUnix = true } if (self.strictSSL === false) { self.rejectUnauthorized = false } + if(!self.hasOwnProperty('proxy')) { + self.proxy = getProxyFromURI(self.uri) + } + + // Pass in `tunnel:true` to *always* tunnel through proxies + self.tunnel = !!options.tunnel if (self.proxy) { - if (typeof self.proxy == 'string') self.proxy = url.parse(self.proxy) - - // do the HTTP CONNECT dance using koichik/node-tunnel - if (http.globalAgent && self.uri.protocol === "https:") { - var tunnelFn = self.proxy.protocol === "http:" - ? tunnel.httpsOverHttp : tunnel.httpsOverHttps - - var tunnelOptions = { proxy: { host: self.proxy.hostname - , port: +self.proxy.port - , proxyAuth: self.proxy.auth - , headers: { Host: self.uri.hostname + ':' + - (self.uri.port || self.uri.protocol === 'https:' ? 443 : 80) }} - , rejectUnauthorized: self.rejectUnauthorized - , ca: this.ca } - - self.agent = tunnelFn(tunnelOptions) - self.tunnel = true - } + self.setupTunnel() } if (!self.uri.pathname) {self.uri.pathname = '/'} - if (!self.uri.host) { - // Invalid URI: it may generate lot of bad errors, like "TypeError: Cannot call method 'indexOf' of undefined" in CookieJar + if (!(self.uri.host || (self.uri.hostname && self.uri.port)) && !self.uri.isUnix) { + // Invalid URI: it may generate lot of bad errors, like 'TypeError: Cannot call method `indexOf` of undefined' in CookieJar // Detect and reject it as soon as possible var faultyUri = url.format(self.uri) var message = 'Invalid URI "' + faultyUri + '"' if (Object.keys(options).length === 0) { // No option ? This can be the sign of a redirect - // As this is a case where the user cannot do anything (he didn't call request directly with this URL) - // he should be warned that it can be caused by a redirection (can save some hair) + // As this is a case where the user cannot do anything (they didn't call request directly with this URL) + // they should be warned that it can be caused by a redirection (can save some hair) message += '. This can be caused by a crappy redirection.' } - self.emit('error', new Error(message)) - return // This error was fatal + // This error was fatal + return self.emit('error', new Error(message)) } self._redirectsFollowed = self._redirectsFollowed || 0 self.maxRedirects = (self.maxRedirects !== undefined) ? self.maxRedirects : 10 - self.followRedirect = (self.followRedirect !== undefined) ? self.followRedirect : true + self.allowRedirect = (typeof self.followRedirect === 'function') ? self.followRedirect : function(response) { + return true + } + self.followRedirects = (self.followRedirect !== undefined) ? !!self.followRedirect : true self.followAllRedirects = (self.followAllRedirects !== undefined) ? self.followAllRedirects : false - if (self.followRedirect || self.followAllRedirects) + if (self.followRedirects || self.followAllRedirects) { self.redirects = self.redirects || [] - - self.headers = self.headers ? copy(self.headers) : {} + } self.setHost = false if (!self.hasHeader('host')) { - self.setHeader('host', self.uri.hostname) + var hostHeaderName = self.originalHostHeaderName || 'host' + self.setHeader(hostHeaderName, self.uri.hostname) if (self.uri.port) { if ( !(self.uri.port === 80 && self.uri.protocol === 'http:') && - !(self.uri.port === 443 && self.uri.protocol === 'https:') ) - self.setHeader('host', self.getHeader('host') + (':'+self.uri.port) ) + !(self.uri.port === 443 && self.uri.protocol === 'https:') ) { + self.setHeader(hostHeaderName, self.getHeader('host') + (':' + self.uri.port) ) + } } self.setHost = true } @@ -210,8 +470,8 @@ Request.prototype.init = function (options) { self.jar(self._jar || options.jar) if (!self.uri.port) { - if (self.uri.protocol == 'http:') {self.uri.port = 80} - else if (self.uri.protocol == 'https:') {self.uri.port = 443} + if (self.uri.protocol === 'http:') {self.uri.port = 80} + else if (self.uri.protocol === 'https:') {self.uri.port = 443} } if (self.proxy && !self.tunnel) { @@ -222,49 +482,47 @@ Request.prototype.init = function (options) { self.host = self.uri.hostname } - self.clientErrorHandler = function (error) { - if (self._aborted) return - - if (self.req && self.req._reusedSocket && error.code === 'ECONNRESET' - && self.agent.addRequestNoreuse) { - self.agent = { addRequest: self.agent.addRequestNoreuse.bind(self.agent) } - self.start() - self.req.end() - return - } - if (self.timeout && self.timeoutTimer) { - clearTimeout(self.timeoutTimer) - self.timeoutTimer = null - } - self.emit('error', error) + if (options.form) { + self.form(options.form) } - self._parserErrorHandler = function (error) { - if (this.res) { - if (this.res.request) { - this.res.request.emit('error', error) + if (options.formData) { + var formData = options.formData + var requestForm = self.form() + var appendFormValue = function (key, value) { + if (value.hasOwnProperty('value') && value.hasOwnProperty('options')) { + requestForm.append(key, value.value, value.options) } else { - this.res.emit('error', error) + requestForm.append(key, value) + } + } + for (var formKey in formData) { + if (formData.hasOwnProperty(formKey)) { + var formValue = formData[formKey] + if (formValue instanceof Array) { + for (var j = 0; j < formValue.length; j++) { + appendFormValue(formKey, formValue[j]) + } + } else { + appendFormValue(formKey, formValue) + } } - } else { - this._httpMessage.emit('error', error) } } - if (options.form) { - self.form(options.form) + if (options.qs) { + self.qs(options.qs) } - if (options.qs) self.qs(options.qs) - if (self.uri.path) { self.path = self.uri.path } else { - self.path = self.uri.pathname + (self.uri.search || "") + self.path = self.uri.pathname + (self.uri.search || '') } - if (self.path.length === 0) self.path = '/' - + if (self.path.length === 0) { + self.path = '/' + } // Auth must happen last in case signing is dependent on other headers if (options.oauth) { @@ -284,26 +542,46 @@ Request.prototype.init = function (options) { } if (options.auth) { + if (Object.prototype.hasOwnProperty.call(options.auth, 'username')) { + options.auth.user = options.auth.username + } + if (Object.prototype.hasOwnProperty.call(options.auth, 'password')) { + options.auth.pass = options.auth.password + } + self.auth( - (options.auth.user==="") ? options.auth.user : (options.auth.user || options.auth.username ), - options.auth.pass || options.auth.password, - options.auth.sendImmediately) + options.auth.user, + options.auth.pass, + options.auth.sendImmediately, + options.auth.bearer + ) } - if (self.uri.auth && !self.hasHeader('authorization')) { - var authPieces = self.uri.auth.split(':').map(function(item){ return querystring.unescape(item) }) - self.auth(authPieces[0], authPieces.slice(1).join(':'), true) + if (self.gzip && !self.hasHeader('accept-encoding')) { + self.setHeader('accept-encoding', 'gzip') } - if (self.proxy && self.proxy.auth && !self.hasHeader('proxy-authorization') && !self.tunnel) { - self.setHeader('proxy-authorization', "Basic " + toBase64(self.proxy.auth.split(':').map(function(item){ return querystring.unescape(item)}).join(':'))) + + if (self.uri.auth && !self.hasHeader('authorization')) { + var uriAuthPieces = self.uri.auth.split(':').map(function(item){ return querystring.unescape(item) }) + self.auth(uriAuthPieces[0], uriAuthPieces.slice(1).join(':'), true) } + if (!self.tunnel && self.proxy && self.proxy.auth && !self.hasHeader('proxy-authorization')) { + var proxyAuthPieces = self.proxy.auth.split(':').map(function(item){ + return querystring.unescape(item) + }) + var authHeader = 'Basic ' + toBase64(proxyAuthPieces.join(':')) + self.setHeader('proxy-authorization', authHeader) + } - if (self.proxy && !self.tunnel) self.path = (self.uri.protocol + '//' + self.uri.host + self.path) + if (self.proxy && !self.tunnel) { + self.path = (self.uri.protocol + '//' + self.uri.host + self.path) + } if (options.json) { self.json(options.json) - } else if (options.multipart) { + } + if (options.multipart) { self.boundary = uuid() self.multipart(options.multipart) } @@ -323,7 +601,9 @@ Request.prototype.init = function (options) { length = self.body.length } if (length) { - if (!self.hasHeader('content-length')) self.setHeader('content-length', length) + if (!self.hasHeader('content-length')) { + self.setHeader('content-length', length) + } } else { throw new Error('Argument error, options.body.') } @@ -332,15 +612,21 @@ Request.prototype.init = function (options) { var protocol = self.proxy && !self.tunnel ? self.proxy.protocol : self.uri.protocol , defaultModules = {'http:':http, 'https:':https} , httpModules = self.httpModules || {} - ; + self.httpModule = httpModules[protocol] || defaultModules[protocol] - if (!self.httpModule) return this.emit('error', new Error("Invalid protocol")) + if (!self.httpModule) { + return self.emit('error', new Error('Invalid protocol: ' + protocol)) + } - if (options.ca) self.ca = options.ca + if (options.ca) { + self.ca = options.ca + } if (!self.agent) { - if (options.agentOptions) self.agentOptions = options.agentOptions + if (options.agentOptions) { + self.agentOptions = options.agentOptions + } if (options.agentClass) { self.agentClass = options.agentClass @@ -354,22 +640,18 @@ Request.prototype.init = function (options) { if (self.pool === false) { self.agent = false } else { - self.agent = self.agent || self.getAgent() - if (self.maxSockets) { - // Don't use our pooling if node has the refactored client - self.agent.maxSockets = self.maxSockets - } - if (self.pool.maxSockets) { - // Don't use our pooling if node has the refactored client - self.agent.maxSockets = self.pool.maxSockets - } + self.agent = self.agent || self.getNewAgent() } self.on('pipe', function (src) { - if (self.ntick && self._started) throw new Error("You cannot pipe to this stream after the outbound request has started.") + if (self.ntick && self._started) { + throw new Error('You cannot pipe to this stream after the outbound request has started.') + } self.src = src if (isReadStream(src)) { - if (!self.hasHeader('content-type')) self.setHeader('content-type', mime.lookup(src.path)) + if (!self.hasHeader('content-type')) { + self.setHeader('content-type', mime.lookup(src.path)) + } } else { if (src.headers) { for (var i in src.headers) { @@ -378,45 +660,67 @@ Request.prototype.init = function (options) { } } } - if (self._json && !self.hasHeader('content-type')) + if (self._json && !self.hasHeader('content-type')) { self.setHeader('content-type', 'application/json') + } if (src.method && !self.explicitMethod) { self.method = src.method } } // self.on('pipe', function () { - // console.error("You have already piped to this stream. Pipeing twice is likely to break the request.") + // console.error('You have already piped to this stream. Pipeing twice is likely to break the request.') // }) }) - process.nextTick(function () { - if (self._aborted) return - - if (self._form) { - self.setHeaders(self._form.getHeaders()) - self._form.pipe(self) + defer(function () { + if (self._aborted) { + return } - if (self.body) { - if (Array.isArray(self.body)) { - self.body.forEach(function (part) { - self.write(part) - }) - } else { - self.write(self.body) + + var end = function () { + if (self._form) { + self._form.pipe(self) } - self.end() - } else if (self.requestBodyStream) { - console.warn("options.requestBodyStream is deprecated, please pass the request object to stream.pipe.") - self.requestBodyStream.pipe(self) - } else if (!self.src) { - if (self.method !== 'GET' && typeof self.method !== 'undefined') { - self.setHeader('content-length', 0) + if (self._multipart) { + self._multipart.pipe(self) } - self.end() + if (self.body) { + if (Array.isArray(self.body)) { + self.body.forEach(function (part) { + self.write(part) + }) + } else { + self.write(self.body) + } + self.end() + } else if (self.requestBodyStream) { + console.warn('options.requestBodyStream is deprecated, please pass the request object to stream.pipe.') + self.requestBodyStream.pipe(self) + } else if (!self.src) { + if (self.method !== 'GET' && typeof self.method !== 'undefined') { + self.setHeader('content-length', 0) + } + self.end() + } + } + + if (self._form && !self.hasHeader('content-length')) { + // Before ending the request, we had to compute the length of the whole form, asyncly + self.setHeader(self._form.getHeaders()) + self._form.getLength(function (err, length) { + if (!err) { + self.setHeader('content-length', length) + } + end() + }) + } else { + end() } + self.ntick = true }) + } // Must call this when following a redirect from https to http or vice versa @@ -426,20 +730,13 @@ Request.prototype._updateProtocol = function () { var self = this var protocol = self.uri.protocol - if (protocol === 'https:') { + if (protocol === 'https:' || self.tunnel) { // previously was doing http, now doing https // if it's https, then we might need to tunnel now. if (self.proxy) { - self.tunnel = true - var tunnelFn = self.proxy.protocol === 'http:' - ? tunnel.httpsOverHttp : tunnel.httpsOverHttps - var tunnelOptions = { proxy: { host: self.proxy.hostname - , port: +self.proxy.port - , proxyAuth: self.proxy.auth } - , rejectUnauthorized: self.rejectUnauthorized - , ca: self.ca } - self.agent = tunnelFn(tunnelOptions) - return + if (self.setupTunnel()) { + return + } } self.httpModule = https @@ -456,12 +753,12 @@ Request.prototype._updateProtocol = function () { } // if there's an agent, we need to get a new one. - if (self.agent) self.agent = self.getAgent() + if (self.agent) { + self.agent = self.getNewAgent() + } } else { // previously was doing https, now doing http - // stop any tunneling. - if (self.tunnel) self.tunnel = false self.httpModule = http switch (self.agentClass) { case ForeverAgent.SSL: @@ -478,83 +775,114 @@ Request.prototype._updateProtocol = function () { // if there's an agent, then get a new one. if (self.agent) { self.agent = null - self.agent = self.getAgent() + self.agent = self.getNewAgent() } } } -Request.prototype.getAgent = function () { - var Agent = this.agentClass +Request.prototype.getNewAgent = function () { + var self = this + var Agent = self.agentClass var options = {} - if (this.agentOptions) { - for (var i in this.agentOptions) { - options[i] = this.agentOptions[i] + if (self.agentOptions) { + for (var i in self.agentOptions) { + options[i] = self.agentOptions[i] } } - if (this.ca) options.ca = this.ca - if (typeof this.rejectUnauthorized !== 'undefined') options.rejectUnauthorized = this.rejectUnauthorized + if (self.ca) { + options.ca = self.ca + } + if (self.ciphers) { + options.ciphers = self.ciphers + } + if (self.secureProtocol) { + options.secureProtocol = self.secureProtocol + } + if (self.secureOptions) { + options.secureOptions = self.secureOptions + } + if (typeof self.rejectUnauthorized !== 'undefined') { + options.rejectUnauthorized = self.rejectUnauthorized + } - if (this.cert && this.key) { - options.key = this.key - options.cert = this.cert + if (self.cert && self.key) { + options.key = self.key + options.cert = self.cert } var poolKey = '' // different types of agents are in different pools - if (Agent !== this.httpModule.Agent) { + if (Agent !== self.httpModule.Agent) { poolKey += Agent.name } - if (!this.httpModule.globalAgent) { - // node 0.4.x - options.host = this.host - options.port = this.port - if (poolKey) poolKey += ':' - poolKey += this.host + ':' + this.port - } - // ca option is only relevant if proxy or destination are https - var proxy = this.proxy - if (typeof proxy === 'string') proxy = url.parse(proxy) + var proxy = self.proxy + if (typeof proxy === 'string') { + proxy = url.parse(proxy) + } var isHttps = (proxy && proxy.protocol === 'https:') || this.uri.protocol === 'https:' + if (isHttps) { if (options.ca) { - if (poolKey) poolKey += ':' + if (poolKey) { + poolKey += ':' + } poolKey += options.ca } if (typeof options.rejectUnauthorized !== 'undefined') { - if (poolKey) poolKey += ':' + if (poolKey) { + poolKey += ':' + } poolKey += options.rejectUnauthorized } - if (options.cert) + if (options.cert) { poolKey += options.cert.toString('ascii') + options.key.toString('ascii') + } if (options.ciphers) { - if (poolKey) poolKey += ':' + if (poolKey) { + poolKey += ':' + } poolKey += options.ciphers } + if (options.secureProtocol) { + if (poolKey) { + poolKey += ':' + } + poolKey += options.secureProtocol + } + if (options.secureOptions) { - if (poolKey) poolKey += ':' + if (poolKey) { + poolKey += ':' + } poolKey += options.secureOptions } } - if (this.pool === globalPool && !poolKey && Object.keys(options).length === 0 && this.httpModule.globalAgent) { + if (self.pool === globalPool && !poolKey && Object.keys(options).length === 0 && self.httpModule.globalAgent) { // not doing anything special. Use the globalAgent - return this.httpModule.globalAgent + return self.httpModule.globalAgent } // we're using a stored agent. Make sure it's protocol-specific - poolKey = this.uri.protocol + poolKey + poolKey = self.uri.protocol + poolKey - // already generated an agent for this setting - if (this.pool[poolKey]) return this.pool[poolKey] + // generate a new agent for this setting if none yet exists + if (!self.pool[poolKey]) { + self.pool[poolKey] = new Agent(options) + // properly set maxSockets on new agents + if (self.pool.maxSockets) { + self.pool[poolKey].maxSockets = self.pool.maxSockets + } + } - return this.pool[poolKey] = new Agent(options) + return self.pool[poolKey] } Request.prototype.start = function () { @@ -562,7 +890,9 @@ Request.prototype.start = function () { // this is usually called on the first write(), end() or on nextTick() var self = this - if (self._aborted) return + if (self._aborted) { + return + } self._started = true self.method = self.method || 'GET' @@ -581,14 +911,14 @@ Request.prototype.start = function () { delete reqOptions.auth debug('make request', self.uri.href) - self.req = self.httpModule.request(reqOptions, self.onResponse.bind(self)) + self.req = self.httpModule.request(reqOptions) if (self.timeout && !self.timeoutTimer) { self.timeoutTimer = setTimeout(function () { - self.req.abort() - var e = new Error("ETIMEDOUT") - e.code = "ETIMEDOUT" - self.emit("error", e) + self.abort() + var e = new Error('ETIMEDOUT') + e.code = 'ETIMEDOUT' + self.emit('error', e) }, self.timeout) // Set additional timeout on socket - in case if remote @@ -597,85 +927,133 @@ Request.prototype.start = function () { self.req.setTimeout(self.timeout, function () { if (self.req) { self.req.abort() - var e = new Error("ESOCKETTIMEDOUT") - e.code = "ESOCKETTIMEDOUT" - self.emit("error", e) + var e = new Error('ESOCKETTIMEDOUT') + e.code = 'ESOCKETTIMEDOUT' + self.emit('error', e) } }) } } - self.req.on('error', self.clientErrorHandler) + self.req.on('response', self.onRequestResponse.bind(self)) + self.req.on('error', self.onRequestError.bind(self)) self.req.on('drain', function() { self.emit('drain') }) + self.req.on('socket', function(socket) { + self.emit('socket', socket) + }) + self.on('end', function() { - if ( self.req.connection ) self.req.connection.removeListener('error', self._parserErrorHandler) + if ( self.req.connection ) { + self.req.connection.removeListener('error', connectionErrorHandler) + } }) self.emit('request', self.req) } -Request.prototype.onResponse = function (response) { + +Request.prototype.onRequestError = function (error) { + var self = this + if (self._aborted) { + return + } + if (self.req && self.req._reusedSocket && error.code === 'ECONNRESET' + && self.agent.addRequestNoreuse) { + self.agent = { addRequest: self.agent.addRequestNoreuse.bind(self.agent) } + self.start() + self.req.end() + return + } + if (self.timeout && self.timeoutTimer) { + clearTimeout(self.timeoutTimer) + self.timeoutTimer = null + } + self.emit('error', error) +} + +Request.prototype.onRequestResponse = function (response) { var self = this - debug('onResponse', self.uri.href, response.statusCode, response.headers) + debug('onRequestResponse', self.uri.href, response.statusCode, response.headers) response.on('end', function() { debug('response end', self.uri.href, response.statusCode, response.headers) - }); + }) - if (response.connection.listeners('error').indexOf(self._parserErrorHandler) === -1) { - response.connection.once('error', self._parserErrorHandler) + // The check on response.connection is a workaround for browserify. + if (response.connection && response.connection.listeners('error').indexOf(connectionErrorHandler) === -1) { + response.connection.setMaxListeners(0) + response.connection.once('error', connectionErrorHandler) } if (self._aborted) { debug('aborted', self.uri.href) response.resume() return } - if (self._paused) response.pause() - else response.resume() + if (self._paused) { + response.pause() + } else if (response.resume) { + // response.resume should be defined, but check anyway before calling. Workaround for browserify. + response.resume() + } self.response = response response.request = self - response.toJSON = toJSON + response.toJSON = responseToJSON // XXX This is different on 0.10, because SSL is strict by default if (self.httpModule === https && - self.strictSSL && - !response.client.authorized) { + self.strictSSL && (!response.hasOwnProperty('client') || + !response.client.authorized)) { debug('strict ssl error', self.uri.href) - var sslErr = response.client.authorizationError - self.emit('error', new Error('SSL Error: '+ sslErr)) + var sslErr = response.hasOwnProperty('client') ? response.client.authorizationError : self.uri.href + ' does not support SSL' + self.emit('error', new Error('SSL Error: ' + sslErr)) return } - if (self.setHost && self.hasHeader('host')) delete self.headers[self.hasHeader('host')] + // Save the original host before any redirect (if it changes, we need to + // remove any authorization headers). Also remember the case of the header + // name because lots of broken servers expect Host instead of host and we + // want the caller to be able to specify this. + self.originalHost = self.getHeader('host') + if (!self.originalHostHeaderName) { + self.originalHostHeaderName = self.hasHeader('host') + } + if (self.setHost) { + self.removeHeader('host') + } if (self.timeout && self.timeoutTimer) { clearTimeout(self.timeoutTimer) self.timeoutTimer = null } + var targetCookieJar = (self._jar && self._jar.setCookie) ? self._jar : globalCookieJar var addCookie = function (cookie) { - if (self._jar){ - if(self._jar.add){ - self._jar.add(new Cookie(cookie)) - } - else cookieJar.add(new Cookie(cookie)) + //set the cookie if it's domain in the href's domain. + try { + targetCookieJar.setCookie(cookie, self.uri.href, {ignoreError: true}) + } catch (e) { + self.emit('error', e) } - } - if (hasHeader('set-cookie', response.headers) && (!self._disableCookies)) { - var headerName = hasHeader('set-cookie', response.headers) - if (Array.isArray(response.headers[headerName])) response.headers[headerName].forEach(addCookie) - else addCookie(response.headers[headerName]) + response.caseless = caseless(response.headers) + + if (response.caseless.has('set-cookie') && (!self._disableCookies)) { + var headerName = response.caseless.has('set-cookie') + if (Array.isArray(response.headers[headerName])) { + response.headers[headerName].forEach(addCookie) + } else { + addCookie(response.headers[headerName]) + } } var redirectTo = null - if (response.statusCode >= 300 && response.statusCode < 400 && hasHeader('location', response.headers)) { - var location = response.headers[hasHeader('location', response.headers)] + if (response.statusCode >= 300 && response.statusCode < 400 && response.caseless.has('location')) { + var location = response.caseless.get('location') debug('redirect', location) if (self.followAllRedirects) { redirectTo = location - } else if (self.followRedirect) { + } else if (self.followRedirects) { switch (self.method) { case 'PATCH': case 'PUT': @@ -688,49 +1066,73 @@ Request.prototype.onResponse = function (response) { break } } - } else if (response.statusCode == 401 && self._hasAuth && !self._sentAuth) { - var authHeader = response.headers[hasHeader('www-authenticate', response.headers)] - var authVerb = authHeader && authHeader.split(' ')[0] + } else if (response.statusCode === 401 && self._hasAuth && !self._sentAuth) { + var authHeader = response.caseless.get('www-authenticate') + var authVerb = authHeader && authHeader.split(' ')[0].toLowerCase() debug('reauth', authVerb) switch (authVerb) { - case 'Basic': + case 'basic': self.auth(self._user, self._pass, true) redirectTo = self.uri break - case 'Digest': - // TODO: More complete implementation of RFC 2617. For reference: + case 'bearer': + self.auth(null, null, true, self._bearer) + redirectTo = self.uri + break + + case 'digest': + // TODO: More complete implementation of RFC 2617. + // - check challenge.algorithm + // - support algorithm="MD5-sess" + // - handle challenge.domain + // - support qop="auth-int" only + // - handle Authentication-Info (not necessarily?) + // - check challenge.stale (not necessarily?) + // - increase nc (not necessarily?) + // For reference: // http://tools.ietf.org/html/rfc2617#section-3 // https://github.com/bagder/curl/blob/master/lib/http_digest.c - var matches = authHeader.match(/([a-z0-9_-]+)="([^"]+)"/gi) var challenge = {} - - for (var i = 0; i < matches.length; i++) { - var eqPos = matches[i].indexOf('=') - var key = matches[i].substring(0, eqPos) - var quotedValue = matches[i].substring(eqPos + 1) - challenge[key] = quotedValue.substring(1, quotedValue.length - 1) + var re = /([a-z0-9_-]+)=(?:"([^"]+)"|([a-z0-9_-]+))/gi + for (;;) { + var match = re.exec(authHeader) + if (!match) { + break + } + challenge[match[1]] = match[2] || match[3] } var ha1 = md5(self._user + ':' + challenge.realm + ':' + self._pass) var ha2 = md5(self.method + ':' + self.uri.path) - var digestResponse = md5(ha1 + ':' + challenge.nonce + ':1::auth:' + ha2) + var qop = /(^|,)\s*auth\s*($|,)/.test(challenge.qop) && 'auth' + var nc = qop && '00000001' + var cnonce = qop && uuid().replace(/-/g, '') + var digestResponse = qop ? md5(ha1 + ':' + challenge.nonce + ':' + nc + ':' + cnonce + ':' + qop + ':' + ha2) : md5(ha1 + ':' + challenge.nonce + ':' + ha2) var authValues = { username: self._user, realm: challenge.realm, nonce: challenge.nonce, uri: self.uri.path, - qop: challenge.qop, + qop: qop, response: digestResponse, - nc: 1, - cnonce: '' + nc: nc, + cnonce: cnonce, + algorithm: challenge.algorithm, + opaque: challenge.opaque } authHeader = [] for (var k in authValues) { - authHeader.push(k + '="' + authValues[k] + '"') + if (authValues[k]) { + if (k === 'qop' || k === 'nc' || k === 'algorithm') { + authHeader.push(k + '=' + authValues[k]) + } else { + authHeader.push(k + '="' + authValues[k] + '"') + } + } } authHeader = 'Digest ' + authHeader.join(', ') self.setHeader('authorization', authHeader) @@ -741,15 +1143,17 @@ Request.prototype.onResponse = function (response) { } } - if (redirectTo) { + if (redirectTo && self.allowRedirect.call(self, response)) { debug('redirect to', redirectTo) // ignore any potential response body. it cannot possibly be useful // to us at this point. - if (self._paused) response.resume() + if (self._paused) { + response.resume() + } if (self._redirectsFollowed >= self.maxRedirects) { - self.emit('error', new Error("Exceeded maxRedirects. Probably stuck in a redirect loop "+self.uri.href)) + self.emit('error', new Error('Exceeded maxRedirects. Probably stuck in a redirect loop ' + self.uri.href)) return } self._redirectsFollowed += 1 @@ -771,25 +1175,33 @@ Request.prototype.onResponse = function (response) { , redirectUri: redirectTo } ) - if (self.followAllRedirects && response.statusCode != 401) self.method = 'GET' + if (self.followAllRedirects && response.statusCode !== 401 && response.statusCode !== 307) { + self.method = 'GET' + } // self.method = 'GET' // Force all redirects to use GET || commented out fixes #215 delete self.src delete self.req delete self.agent delete self._started - if (response.statusCode != 401) { + if (response.statusCode !== 401 && response.statusCode !== 307) { // Remove parameters from the previous response, unless this is the second request // for a server that requires digest authentication. delete self.body delete self._form if (self.headers) { - if (self.hasHeader('host')) delete self.headers[self.hasHeader('host')] - if (self.hasHeader('content-type')) delete self.headers[self.hasHeader('content-type')] - if (self.hasHeader('content-length')) delete self.headers[self.hasHeader('content-length')] + self.removeHeader('host') + self.removeHeader('content-type') + self.removeHeader('content-length') + if (self.uri.hostname !== self.originalHost.split(':')[0]) { + // Remove authorization if changing hostnames (but not if just + // changing ports or protocols). This matches the behavior of curl: + // https://github.com/bagder/curl/blob/6beb0eee/lib/http.c#L710 + self.removeHeader('authorization') + } } } - self.emit('redirect'); + self.emit('redirect') self.init() return // Ignore the rest of the response @@ -798,14 +1210,45 @@ Request.prototype.onResponse = function (response) { // Be a good stream and emit end when the response is finished. // Hack to emit end on close because of a core bug that never fires end response.on('close', function () { - if (!self._ended) self.response.emit('end') + if (!self._ended) { + self.response.emit('end') + } }) + response.on('end', function () { + self._ended = true + }) + + var dataStream + if (self.gzip) { + var contentEncoding = response.headers['content-encoding'] || 'identity' + contentEncoding = contentEncoding.trim().toLowerCase() + + if (contentEncoding === 'gzip') { + dataStream = zlib.createGunzip() + response.pipe(dataStream) + } else { + // Since previous versions didn't check for Content-Encoding header, + // ignore any invalid values to preserve backwards-compatibility + if (contentEncoding !== 'identity') { + debug('ignoring unrecognized Content-Encoding ' + contentEncoding) + } + dataStream = response + } + } else { + dataStream = response + } + if (self.encoding) { if (self.dests.length !== 0) { - console.error("Ignoring encoding parameter as this stream is being piped to another stream which makes the encoding option invalid.") + console.error('Ignoring encoding parameter as this stream is being piped to another stream which makes the encoding option invalid.') + } else if (dataStream.setEncoding) { + dataStream.setEncoding(self.encoding) } else { - response.setEncoding(self.encoding) + // Should only occur on node pre-v0.9.4 (joyent/node@9b5abe5) with + // zlib streams. + // If/When support for 0.9.4 is dropped, this should be unnecessary. + dataStream = dataStream.pipe(stringstream(self.encoding)) } } @@ -815,421 +1258,513 @@ Request.prototype.onResponse = function (response) { self.pipeDest(dest) }) - response.on("data", function (chunk) { + dataStream.on('data', function (chunk) { self._destdata = true - self.emit("data", chunk) + self.emit('data', chunk) }) - response.on("end", function (chunk) { - self._ended = true - self.emit("end", chunk) + dataStream.on('end', function (chunk) { + self.emit('end', chunk) }) - response.on("close", function () {self.emit("close")}) + dataStream.on('error', function (error) { + self.emit('error', error) + }) + dataStream.on('close', function () {self.emit('close')}) if (self.callback) { - var buffer = [] - var bodyLen = 0 - self.on("data", function (chunk) { - buffer.push(chunk) - bodyLen += chunk.length + var buffer = bl() + , strings = [] + + self.on('data', function (chunk) { + if (Buffer.isBuffer(chunk)) { + buffer.append(chunk) + } else { + strings.push(chunk) + } }) - self.on("end", function () { + self.on('end', function () { debug('end event', self.uri.href) if (self._aborted) { debug('aborted', self.uri.href) return } - if (buffer.length && Buffer.isBuffer(buffer[0])) { - debug('has body', self.uri.href, bodyLen) - var body = new Buffer(bodyLen) - var i = 0 - buffer.forEach(function (chunk) { - chunk.copy(body, i, 0, chunk.length) - i += chunk.length - }) + if (buffer.length) { + debug('has body', self.uri.href, buffer.length) if (self.encoding === null) { - response.body = body + // response.body = buffer + // can't move to this until https://github.com/rvagg/bl/issues/13 + response.body = buffer.slice() } else { - response.body = body.toString(self.encoding) + response.body = buffer.toString(self.encoding) } - } else if (buffer.length) { + } else if (strings.length) { // The UTF8 BOM [0xEF,0xBB,0xBF] is converted to [0xFE,0xFF] in the JS UTC16/UCS2 representation. // Strip this value out when the encoding is set to 'utf8', as upstream consumers won't expect it and it breaks JSON.parse(). - if (self.encoding === 'utf8' && buffer[0].length > 0 && buffer[0][0] === "\uFEFF") { - buffer[0] = buffer[0].substring(1) + if (self.encoding === 'utf8' && strings[0].length > 0 && strings[0][0] === '\uFEFF') { + strings[0] = strings[0].substring(1) } - response.body = buffer.join('') + response.body = strings.join('') } if (self._json) { try { - response.body = JSON.parse(response.body) + response.body = JSON.parse(response.body, self._jsonReviver) } catch (e) {} } debug('emitting complete', self.uri.href) - if(response.body == undefined && !self._json) { - response.body = ""; + if(typeof response.body === 'undefined' && !self._json) { + response.body = '' } self.emit('complete', response, response.body) }) } //if no callback else{ - self.on("end", function () { + self.on('end', function () { if (self._aborted) { debug('aborted', self.uri.href) return } - self.emit('complete', response); - }); + self.emit('complete', response) + }) } } debug('finish init function', self.uri.href) } Request.prototype.abort = function () { - this._aborted = true + var self = this + self._aborted = true - if (this.req) { - this.req.abort() + if (self.req) { + self.req.abort() } - else if (this.response) { - this.response.abort() + else if (self.response) { + self.response.abort() } - this.emit("abort") + self.emit('abort') } Request.prototype.pipeDest = function (dest) { - var response = this.response + var self = this + var response = self.response // Called after the response is received if (dest.headers && !dest.headersSent) { - if (hasHeader('content-type', response.headers)) { - var ctname = hasHeader('content-type', response.headers) - if (dest.setHeader) dest.setHeader(ctname, response.headers[ctname]) - else dest.headers[ctname] = response.headers[ctname] + if (response.caseless.has('content-type')) { + var ctname = response.caseless.has('content-type') + if (dest.setHeader) { + dest.setHeader(ctname, response.headers[ctname]) + } + else { + dest.headers[ctname] = response.headers[ctname] + } } - if (hasHeader('content-length', response.headers)) { - var clname = hasHeader('content-length', response.headers) - if (dest.setHeader) dest.setHeader(clname, response.headers[clname]) - else dest.headers[clname] = response.headers[clname] + if (response.caseless.has('content-length')) { + var clname = response.caseless.has('content-length') + if (dest.setHeader) { + dest.setHeader(clname, response.headers[clname]) + } else { + dest.headers[clname] = response.headers[clname] + } } } if (dest.setHeader && !dest.headersSent) { for (var i in response.headers) { - dest.setHeader(i, response.headers[i]) + // If the response content is being decoded, the Content-Encoding header + // of the response doesn't represent the piped content, so don't pass it. + if (!self.gzip || i !== 'content-encoding') { + dest.setHeader(i, response.headers[i]) + } } dest.statusCode = response.statusCode } - if (this.pipefilter) this.pipefilter(response, dest) -} - -// Composable API -Request.prototype.setHeader = function (name, value, clobber) { - if (clobber === undefined) clobber = true - if (clobber || !this.hasHeader(name)) this.headers[name] = value - else this.headers[this.hasHeader(name)] += ',' + value - return this -} -Request.prototype.setHeaders = function (headers) { - for (var i in headers) {this.setHeader(i, headers[i])} - return this -} -Request.prototype.hasHeader = function (header, headers) { - var headers = Object.keys(headers || this.headers) - , lheaders = headers.map(function (h) {return h.toLowerCase()}) - ; - header = header.toLowerCase() - for (var i=0;iTv*DX4@1RI>-?lQRh;O>J3cXtmG2<{Nv-Gaj)!C~;=9^56kgvjIf-COs* z`_+3@uipNr&#CTO-Bo9w?%r#!{crW(20#V?_y67C|Fq9LQ8BOoHd!M}SOAc+G2 zAj7>)0*`=qJHYpaOC6sL}92G*SfIn&^bI(&p}TJYgwBS{5F}^fKY8 z#Su*dEpG_q|A9vN-}rCSz`_3q0Tlu5ty>NVc!P&WKte=DMMOe+8~2|TAtC{hsc}J4 zD0rIY?ljzCDX93;#Z3bQv~TF)sdIEZo+X5qyVo}|+NI5dpVI!V12Eo}1`k940we%G z_hnUqcD*yl3?kMW4bGdQ<%S+Nq>-S=Nrt}4WwkjGq>OTY%!B=CJ8w#IenptLVpc_V z1`f4~Xi@?&sD@*|R)6y)`SB0wheqC}eNj-v9bcmL2^X6*MoZm{esqIwe2z;JRYD?H zR`$jhNv|+C@Vp5MD0Bx=i}7t@UfDUk|38gA#%a#oGvFUC_!A^7VE7@Eu7 zDy*la? z46rH)2FlGnV3n*)<-E8exU`^3QBJh~j)^!{)iNuDXE4+=EIIn_*NRI0z|;&@DLxnl z+|_CRDWB5}X@042CH!UDJgH(rDj%2suACjAniipk{VR5Fexn+!oRl=fVu^c_Azb}S zY-3Y2cN{j_9osMJo&bB|j}L0aTK@pGdMANi7YzZUb3A&(6vt*lb5pCgKK}rqxhS|J zW74A%DRgbR8s)MaSXBY`$gbvx%2lLRaLE$BRFaVZVXwhVdE=WLTFYKD0v z6H}C{+FOqTAxB%WH&WLLnM1E(u6{)FtCn!}PHo&@GgY~}a`OuO`478g$0?$syQKc> z!-o)$Frmd$X?=!eNdhD~lM*D8krn&Frxa>@pj|~|=4d}0k@iCz$_s0Nx5}?G;u*TS zn9Au(${5pdW|Ij4$}m$M(-t>T0iQMZKR^?D`9IN~SQW7inU>KGmi~WM5S|H8< zvb8MtTf*rP;8O8{brk?qSwOV{zcUKHDSg*6^5w*~+0q5BZ_DHzWQn-IJq6cyir2e7 zqDr&0bMC%os)oDb!n|(BdmbU?Y7UXrk)s48QFNLB0<5hCU0IA;c||y|tcph{Q2IWv zf_Z2l){Fw+5BTwm)xfB2BHU?X|X$n zGKNfNQ$PxO2~BlQT*J38kd!2+LK3`i+ctZA?^?sMJw2$oA;&=ZGk*;6kvo=A{4u#d zQ$#rWAuYQl*;<>CszpQ=)q9Y)SD^4{hDCU0Qf5R4e?2hg4i6YZ)3Mi7Z`6_ER1)*e zW%D$9K(RkJKWKb8IM<;ULBRWCiKRW+F~3mGBQ!N?-zU^>bQqUxIVF$N;{A^Cic`4@ z8|=wo{ebS1>de%@?*Jqx-JID82IjKpP=**KeX7C^l}M)ad@+DlG{AkdPDeObbAv7_ z(5I*&To3RbBAU=o77DkzOBQ;V&=h%4nTfmIQs{vrB&wa`ux82QE4LQ%Q5%Z`2hmb2byW*cHDV{3L|IuNBax7f<}C%C2A z++doKajscVL@P-+A)(a|hqBjfZ3kr2RV2eO?yE*x60JbO;~fj2DMlyDdp91?wXNpJ zE>N4zyY6zd-bp(~y1H`BH|92Y%!?)J0{IEo9SWPO6<=2S@BcVMbgjgq0Flc_)+y&v zA{5I2IlZExjVpfR&pI$)WP*Tq7%3#!I3~RxZp)Omv>`;my-Cj)QnCaWX1?tS)lnII zJQi79FVvRf4fxTYZdka(C+qbZFCwnk={4r;y`vz)T$atsSAs*v8w-qF0Re;iZ9MAVRF!!uD=}9I6_tQT>jE4JE*?3Yjx!#~Z z;r-NcBqJT1M&76pBK77!K!m0>J*!rgP)rIO1WG1EbI)`2`j+-U-7#YqOCi8p z5GTcNIs_oaTuob(XDs;gE7}`lr{`lvy<=^+?tG5qxVpBM1BWW*!O&-%Ac~8qmhY)Q zw;)I@s>WC5&D`Qwd4DRM3#F$1QaIE#GgdSB!G7jdDn9xRwpt^`uY(DM&>qr`PkGi> z6dnjnQBoeqi!`n&LcAw)`Z_MneS#X-%AC8RZ?CRT-H)kBDR(g;hkf!!%rdG9Jku*8 z0y}drhjJU@POVJg%c4ms^jOmpd(e~?L*pV?pF3C8pIy=~g-wz|`#XH4tel3K{{ULM znm+Y4)$RvYDF?r~^^^(d$$2DWbNG4vc(KO=bn~a=AzF%UX$Mu8kSFvRFoB@mW4WsD<#ELzQS}8d|&1PYl*$16$cgbqPc3aqRam=hCrW_9XUE9)bhfw0em!RReZ{byNW7oqK zf4e3w-+yksWY}RBKGPz<9W&>v9Tm6~lkbHE*6in+) z&8f5m+b=V1q+=T2L61xlBhCEic@OA@Xl#U)RFvL zwqbEdo(=FQllnsIUxs_P=uJxqGA7|276dIIR3Q9bKiQ)H>ebL*{%fY7t64uOKp+se z@mW~Fd>fegjN2F&S@CU+5y@J}?qs)Hy_hs4M46>$(UNm<(uBeh`mFk`o5v^>|8u0m zjDy&4U?eW^W=mB7-r{b*3IT$-yiLBo=GHd##Lp7_frR}CVcjU@h$p#fCwuX3NJQ*W zP%sEfU!pBP`f8uZioRCUTd#dRmvJ!PmueJpJ_YHD{z@5yE)1js-a;z%Bdl%xwjLd1VOn^jkZVUX&hzb z{FAvog1FV`J06+{vj69GPbz=wXJ%hpmi_#Y`9)vh)pZk&+K;6sKCh(Rvs>Tl$JPt8 zNqS?GIz63H-^sZ9oC=@I@#n z1N?q(tE;x)2Fqm6adD05u zai3KTqYoYB3%Ah zR^A((Hqaaim)wd`NNH<|*OE3(wd{C}G?UaX6%8DmIikM*cCY4?*3#m~;`=={`RJ|* zawd~VO-*)7lVc-pRhSg=xtu?yVc+PG4Y$l2L}HdnA@`r=)wxj=z2!@8DuWJ(0!UL8 zR{=s9Jj5>)%b>EJJb(b*3y1Gh=~)ZAi!Ugif4C-jsfh@P2eCROCq;_HYM9JyZB2)- zM#9*YI(@1^=`k+U0!s=CLE~B})>v4+wb;#j5LaCr{z_E;7#$rPwSQS?caM4GWAa(P z8Axuu)T4C=yr&%53xZ-nb$R1IIgtfUg1hXykv|D-N@RcW9`p8AVS$?HW`Z(3cD19U z0p4VLq5y2+BlIsidW*!xj%8K;Gsp+O{#w=jT(b;%kJ8V!jk>+h6CaoLOJsKI*DD@5 z=MPAQnLmlFmVt)u6d7|OITKT{EP8DU9A&{anM3uu=3-NO#o69*;U9kT&o?5suG3mw zwL(Db7z2ic0D%NK`933!a7McQvi%1-1&Xh{<>~;nt(!; zHqNGpi4~zph8XDwMI;P&kz%{;?+=W#EP3u~e@V#nk2Y`Ty&$;D1#Hs8bzVAVH`L6U z7rB)ib>!6jX&no*r=tz}ESfr_i#$OIiv|D&0nEYIz{cc;)!RJsW-eHPBxs1(SIZtB zOklO4+Lt0#{RKWu#RH@f33uRk&g8IVUyVPnsK^>hW-8i}lR7Yy z*sE>nLFWl;XuZ7}n6$=|?&}{Rc3SyHPN_W0f28W<|l-9cwM6@Ee}uj*@FX zShe9KE;dV3TtEU~&G}l}43uJzbjztA;VF<5`U!zl2SVj%g~xUlEx!C_BsCtr+`raU ztt4aLd&-oMZaUgDyZO57!~B9gR}&tuaOjU%IL2futWLx~KFIBae~NveGjem#m3!{x zT;=TjOu4)f-Edu&KvoYl2h^0tjvKDv=cxCSKnR!8nEQU2v+?VE>hp{MnNdvnON7oc(YoxL=9-!7EbAG#xv&LM zKSqF69nF4agI?#F8^dEg@$i#sWT7kP4T&{kCcDo%sLT5xnNmD=moFh=x?zM1l*T@Va z?gkn;5$N?Uv=%lRSkyG*UZxpn(~k1}wB%~>BC7zDSbKH7b2CFi&AJ=obNEm;T`*+w z;K$ph3a0WA8DgbnoZ^Xm^?uA-*nVp(juoi1Yg^&s|^-NARSuD<=HsIXfZra>-MGsvSY?U&as?ypvgq?8tRO*KqdUOd( zmcl{|2RdU~E4+oHu|&{xxu-F1lO>8-5(i3PdjPMj!u;~w&0G(hWgZk(&f22TZVl|#VKGS$DgL=eS5?IckjxRuTRLzekUuyzFMMl@7|!2AoT5rE%*{gG*vcgIFGwTOm9& z65k3madQ=caR{FYcqP%|W<0($0|;6HjivBJ`k#Y77m7xo>u)L>X=;*+&9L_p6$r2d zI90L=4w1%=>B&I32~I1m$~RCMK$@ZizM-@?t2nQTEfix9f%mR< z?eEgcc8jahwbj3kGQ;c{pD70zZ%fX0j%lp8V~NXDB0)2rS?JO@MGT;LOH};ww?hhe z4fnMMoi%T3^NJSZ5WRiR8K0GKwna{}bAy_N_zQ{cI(vjTD>UI7|5%f1jo`Wc;xCh# zQXYPl!cOlp%ltJ9qK`nrKST}NDbn&C!gMCMveh(oIuM5M?b;?0M*yp)?TI;>SQ5>#&% z*i#GzcYDy?^Crhk~OuVx+7ZlzF66#3M^XLn*R7Z zgih#LC|x=e<`l&guJ}(3`r6&+wpd~TR-UHu@zAQveXz~48D)w|8`@-Eo31g&Yn zb1pOl9ll%%A|85;1gH6o&Ya#y;Rjf3^sx@k=;u-VLFb!?ZTFHHcE>ut(k+Ah#02_n zdCLllxj)m$09i~c* z4sAJZ)n%}7vat9x0u_k~vzO)Ng>CuMZrIVHFDh+Zc48ip;0uZAa@23)pEOOsw!DcQ zb6ra5{{dQmTmF*syrDKOAlUdpxiRf;_=B!oP8ZU{%`(xe-1F$-K7kf)56#I9Dve<# zP$0WcKl52QqXLLA`Kzyn;L`y{n&b#y#}|w=_lCK140M_!he?)s<`@+u&;Vk(SBb^pd?eF7 zO)|N5Qh2(&-fRB)nsr&Q_xd-M0J%G_L`;%vk|T9VZgt7n^4r3O<$cF7a8FU;-6sPE84hmky?+vZush7ePKO; zYvai{KCHy^XM7O31ZbY^Did@amD45?6hkUuHQp+u?e^(Yk|lqugNZ~4Nz2wwm9Jjg zetbaV?*88Q*uhXh5famXrJzs%015yAp&x+!HM-C1Keq|f_`EVFRurukTs8}f)e>K9 ztFo;Qvw>W%p|pn6{c>EFEnJlGL^Gz4uIuXRiqa^hoUSOa+Q1jFD@;fE7|&=xK)R;5 z<3}U@u%J56ts%=X4o!`57A`HUi%V^th~gYnjM@{0K(aC`x2!=8y0qmc6k1&<)2$lf z!5gS?OcA)VKkheW{C-8CG)z4IW7oc|ga48tcMPxJ zj$svSf;-viK=!i>T6D?IXO%%s=8Y;%<_QPKH~iW;e}KiH3t9pxcdB$h1d_j6t+(s9UY1q`VVl4l_>gA1JiwE zMn#<;`5)j#t3GvF28{@D5rj_-(AFp&fVm)Ufhm(g_*|$V5w&DJQl+1E`;WybpO1?C zInqxaHWF`c{&MH^8SVT7Tu++~yT|{`N`23F=9AZvGBC7i^hr;tJ^#tRg4RM|{=R>- zC@y9suSStk&P)d6{m|W#ApZ|QXy?rN(S2%Ro~P#@KsO@%!&BP?i|5FaBaSl_?XF`o z2!qAlZeS@JJTx}eS})yU7lBBL z*u0j%H6;>@ZZYQhyl(RoM!1WGm@N21y*=4HWBh)#tnp##(3ablu0nYLM&$x5?ZQ-M z2ID}b_uUEX7_BL~iv5fq5sZU>h+6R$MD|mV-O-X=W4CH3^H_U1&jQBD-6timY8rcO zeP{mxA~E|~#&oJb+GgLKj4z*$+CUZQ4N7^y+*_9iCj$N@M^fvWbs0N|WIf!~N!srF zh?gRo-^R^SQ&XikA`RFOJsrh2K8FqL+TRF~Mg}aj!Z$;kCpHIwh|hT6Lu?nw^_jD< z2&U&p2ms;ZsY=eKXEQ5Y8H6W=VFzliG;~za(J09~2tOMnGjUcAvMJm(m4OtJORJ8eGNPs{TL2_mkza35ndG* z0|1LHdFwE$`c^p%XS-j3G832EYA^Dbo!UVKY%!i5^<(op?r^LfgC<{vF*Wf090#K0 zq!J4>)ac8OWDMC6Ha(X2rTaHX#bY)nfz&G|nQUQrcKST8TdJVm>sVGT>($`VRyJAq>z+f7O6o;h67POr@jS>mmIia~30sds1&w%gNiXYr&KN`|bK^9h z0GkkPl@EG6MomWb_uMak2febsYoi|YF{TQzZC_!Kd_or`GGuVoU?q!~WU#bP z_yrV82Dg+O5K$fZ<`SAKT+x3XI_lRysI424x->6<6N?i#{+7H;8m=>}ICZb3TU>_y z1JLXzC2w3A^_MZDBT_3#;|nq?0kqO3B;U>^{7B?uUOeHMI`}jsY|3e*s zFa2Zrrl}ov9du;U*O1%so0&+issgH&+PR(~t1`paBvY-E#ScU>?SzjpDx&np$i|Ly z_@k*>&aPgcl7DD9ivhAlRs>Co5pVlnoosW%afq<3p-=_HDNP<=9DZTH+~Rnc&^^20 ziMn*q<#!++b(-KuJ9KX!WkACI@37TP;uYIbgX+oxcUe9(4D!g>-qTHNsDqJ z-S1~SFzk)z%466Jo{D5k(10Lr(#N zERQ%(nAA8IHAU?77Ma)t6?2(Il~xwIMQ#Kjs_ij1r+K!ziY`{aT|nvmW4PN93IAO3z!mo|T}s0lE3eg*`-I?^r^5ZO6K zP9)a@=~h;Ry;&iK0mqr#c}ssU z@Rm7+v~3-UlRjc-n+luwe4o07;>yxd6|h;*txerkSh4z_c;;=7X&j=!0I~UF0Mj2G z9C4Qg4oa(4uD+CC4Jc&5GNA-Gwq`Z}I5x{m3Ajs&xxItp$i)_0_8$T+H@TloT76>G z47;3a96LO=ye4X}NE=e(Q(<)}p~FJ5N*2+m*zeEu#8N@cayuuRaEN5#SUchTREc0I z|2A%R?9M-fnvaul*0EpXQFlvFt#Quj4U%kyV|LwLb26(Mt@+k2w346Q_D`>3TOjE?+yt93paKVB=o z)V^yLNc-x%EVPlfQ>T&>#ac0!iUT%yf5@84jiw#Q$c6>+jkRc#tWJ;3ecygk-Eb=t zuyV`Yb>5P#-nYcu6*UH=Zx;3NYIYY)X-5XCWf`Ed95~uJ+_R}*i11FNDO4FOySvwG zaUQC+5Hb}lAx=KRCj#@I-EF=S_&P!7V$#KrK92eOWRx~SQu-%&q-Bv zEI3e=bk6fX@i=$rm{Oc;9Q@zY}3Z#!+!vK{AMY2ySI@E#Ks)DoniDXr_rv z=`vsZs*x=0kLN+*J$?V6yM#X<<(rDS0VBehJN+JjbnramIj2N|Ip#7LVX8D9%6;(4 z!^=#jv_jEv)&E0IFkDk4OK;{wcI;P@WZA7qEuA=`emCl)af?f}yUL%~r2=PXhQ8gH zo;Dv5Oy-(Fzg2b_&D@)gJ2-s?GQ-g(P7oFryq}Kk;9#!mWiMol3c+Ibv^2T1C5ar~MMNhBKRVa2b%n3x7>$5ccX&x6rCbBB zgxczdgO?R|L0IIs`@>3Ki1qmDGh<4aGI$!dvR6H{vO`>*i9?iW1$`7zeB^abhVp;M zV4x$W=b6#rG70u38RL%ySfXw1$VX4PZoQhlF7MS2S zt8&vx)1{#1*e6$45)usZ&3kX@>_&}0f>8De2ZJ=2;6>#tCDGE z`G7kUOWIvcXKHp{J&Ujz%8z63V39~;18P5n$39pz`Twrqx;gN!7E#@4-4YR9dfEMz zv6Zaw@jxH6_;WVd-Lj`CvIftY=#Yp)jRJucGyqA%gcc*%AYQ8r)qn<7n+l&`HIoj zZyQ#-%YubZA7~A-_z(O~>}f_R?5ab9L&+7`B+kDU7lONQxaT%u4((HP*K#Ym_LU;~wNQOqu(WyMglj_J!^t z?F}{gj*c$oqxcXX-B;_qK1?wh>6&>=-*Q89SuB@SAzn-A&Y(D%+u#8t z9==OWaOSXV%_}ynd2N|J(FNZoDIeGe{{}EiO z0yXsr_?^RKJM%ll4D>YP;Rk66kJ8eX>ZJuu z8#*Kcit?@T?x2$MIv2I-8FFbFxO!6G`da7!Vn$jvC7G(F;-AdppEsh*wqOi5rAOKR z@5ia`dpcEvR~+NG$eMW?K!t}t8zk6na*VVDdRN&fR3510_!)5cvpaq_{h`QhZPtV6 zrjI011_4<95E*LD-9R<;#`_lXg4L_{ougt8^P??gM$6S1izZ@D{$pryu72KlvOld4 zrex4?!Ob=-vY?*On1njvKojp@B`it`WUwC>064EC#x%pZzS)Bsv{+ZHeAjNWZcLvmI>ZL2-|NGe+4}i_6HD4)Ri#gsS!aYrwEL#b;u#0^eg2@#VnLTg z%isQ;GMr659zW!rb=G7Dq_~_(2nU+Y2eh1~OYCV1X%B|RG^c1RQKO^JE9{w0?U?t< zN-C{%n&SED;p!1!NMEfpAqPP%3MQ?XS{TegIXX|uxxKtyj0i-(Egdhi8WdD*J^*0Jv>B;uI1@pK5Ck}nvLd(LH z*qT3q@fEyvb+t2iQx&;m7B#_GR9ZNZa6sUjbaoL96KRHu7juGx=#OzrWSSo&cGA0M zoS8Mg34h42U7)U_dSX7H5C24N$V#E~yL4BZLe`8zaop0SmV=DvI;J~T<0TfkdVNh3 zKRbrwZl$jz+&=&h<(=ufmf46;UYZ9*dOt3FSW@!1kh#%lbYn}9eAe`iG-;!8`lzf1 z%&^`#1dy!%j;tWLSxycM%M4oJ5s_sOj{83Vn19R~%3D5Ya*32l?gfYB8-9Y?3kfqDsikK7hyY$*5JKgascgi%%P>sx83v3_?Vx z`zF!5)a3|?tzxy~Wgi)-6kievyA=uR`y3u4v}SQFp8L8mGLt}09qr)}-F^x0LbAX> zA*hQVQ6@Il4%S%`kdmnzy*0-QN}{dWs()Xj#8Ll=@{Bp%!gmcL+@tbFpa;HcIJSkt9|aY3C* zd@9}(%~#zIK8Pz~Kxs2Bg(-7WOyEOm!7ZQH#_S7Z>OAV5WID zfpM$0)WF~_7(1DXwis9;=?;Xa(m{K~3hZdC*E|1FSlc|yNdWGh#u(p*rqM@?VX%A3 zNBGIhvK+MaEE0xIiFlPBO*UZk80D)({6tW;X+LxWm@G}_X)poZ!$jH{QGyCrz{@ff=H-G$kQE4N|+y~aL3f~`1K@* zX4ECaZgN_DNhwF6R@SIC&HGK`VOk`Dwz>jJ97>`H#8MsG&eztPA2X5H2XjsF$Q_By zO|wh5gZsT(Yy~zC4K_cq`=>1(`n1HeuZ-Jb&Vv@T3@h!d(bFjnP}KXr#GAA1!UGrj|&4=YpZJY%KGW@DS73UnbVXD$;uf1 znyh75n3wv+U%lA8&<)DOeJ6&-=o0zulmyXSVNX%$s4H_-{B>zF(AvF0%W49Fw_h&% zr+<#*1kEe)Y_Y(6Q+&L{i_-!Sq;``ctNlhiP~ah?aO_=tY!~F)H?it*ldmpGiYC06 zh{E>2ptQa`dckvrM2>y3@U|e6WSZLo z@fs^)E3&r4RxmwPntpgzmt7T8sjV}iFby-4&n#(GAtWU2{s92Me!msKsHfqW&uq1n z3A0K}Y^UHF+fVo;*mU88hS+xL>A^1uJL)l=A0sS?6JORTH-7y4J-Our&ZUj$0Tt|P zrkDaN|9mxQq33XJdKj2=6Z!)2NuinVr`zIx10y5jC^3CVDP5%JT!?D^w zKe>em+QP1$kVJcJDdn47sqjG68Pk#V8KvR15Vcw|GhkLzPX;{ARu&4DlnlP#6`#yO!Z6eXVo|U*2~nNO}A1I@+w^K2>WGTPVqgH6D|`@TC4P4ELU~!Lq%yx zUR%zjo9mD|CNEpq2nXn0=@T6W`>zUnn-#`IQt;%9(8>;{;);S!zax14LYD&KP|H;I zJCZK&*Y??U6^N)182j3J? z>mQqgN$grSE+5*3l_pk8FoWi0=a0LyeO~&)3MQjgP_iNT^=fF931?Z(ZZas?QlvzHruiw8Lps>x~ z15l*Ef{AAOLQ*m^!s3(jqV)PWcKf)w&Kly^dgSCJ|p85328siUTF8=sarbP%I za9OLh90KpanASg5?XFyH&&@focl_vZ$mXT&$MDp}ak=4Odh1oYQ6&ba$GDQ%%@@Fw z6Mu@&)4^LNOTurP0Ebea9ciH3^7!**(lYC}Q)6$-8msuvJ|6c0noZC;SS^BTWV}MS zu2c_wv4CqnOJyX1Dn1MztRk%5x+Oz)+oCQ*sKV)#6cRFLziUS!wZ=GxFk-zP5ZzP( zy?P3>qkwD{M)wA1A|M6Z(Zm;B!h0%jffl}CRN{7a-uw49G zOPG8aN`i&fnr){sO-aYXQ^u`rSSgtrl~q_OoZvRe1hl;=S^D%iEeiRLQIMi@;*4?r zCu$;+WrFQj%}x)MbFS9w4z$aebRvcoAA$1S^%NoI*H(_1fMQ&RrN^Q`BK?*y$f^L0@=-J`bZPO6zqkQ~`ZHVkX8jSW91#*lXW-dbWLPZ7 z5BItgcrXv5m`s&MGBQ(-z;Vz1In#UP41){O9f+bW{IefMrHpAHY{!jYRIgYoHR{bB z=Pvcu1d@8|f?V|<5Oya^j+kjLkL$nRt-{KuZ#+HVR+BXqdcYsa3KLnrSnrYPTU(dT zL}oT#Y`L<0LG^W^=Fk<0^-3r3HE10ZH7o8H))8?Bg`{BGGPR4pi4YQVt47v1d3S3W z*hh(~rabAr5R2LPzf6DV_WDtDQiB`(Ns4w6EW14^u=`ewkuKI8n~qokQZrUJT>JX| zv-;9n-3o)2s^*2bJPIz2_^Z)SlKs%yOz`|}6IFQqx_k*1AX@6{&m)!b4lqoMWWldR zO2!R|3h})D`?rEA21OE*!~>O@Ehe_9?G5Vv^{MKl zrq=%=zn)HF@(%zr7MEmVwppvSQD9igwR+DlTO@1L4(7#Ch{OWKl%yzRqr+VT0Pklk z{wIMHj~O8e2!Lw@S9GwuG+X|G+P)t0tq~iY3aYbg)Fh?b#oh8W>z$-6aH-9V3_5fK z$lb=L3YHbCfC0iP@bJ`MWg&?iS?P`YY~B)rP!rV|O%@(Jtk`hp*dr~qK8i;vk9LJJ zMW~)n(-a~ToZ{?TMO+D6sz)!JZK6B2bwqUIaE}VCJ1#H5nw{(v?=y{ zfs}Poo`64kF<=Om!K-;7>hXT@>F-c0{mD2xAL)sMns24=JI_5!H&1a)%m*+b|JLbv zr)tiXa9=V=4_s*_YAtHb0!7OErGC~jQYLD`=*U*5MHw>&Qv!E69DR`o_VRRZ~NuJ^YdrfzbAQVgMvB7yrG6N(0E|Drdk{a@Mr(Yzp37w-_nG;5ArDUPJh=jwI2K1O zHKxjgZRL%3N7)|>o5S}Qel;9^_N6p+|6|H*i*`uV?(g))>I*m4#h2_{e@aG9YQg(x zs_X^Tp77{ar)<=<8cHcNSl-xZ-FvmUO7=FrGt_Yc>{P{q3!+K7PhX(N0Pi750Iw5@ z=s>?9jz2-aJ*YMhv+MWi=W?SsTi&>X1zZNvv^1V{%`SNr(cpJ&msuqgh$w~MIwxDZ zz0zH(D%>9TGA_h(3$MyU(@16BghxiKN~5^!bI52l(t+Nc2T=en{Gr@3ygh2?|ykB_Mujh2w71x*fO9jiONQd4wfpu)3RexAE{@h^QfCAuE9|%d?yUT z!(VW(eVDaNKAm^gYe4&&NP6rejZO30)Blz2xf=nHIGGr~)pxmVdn(U*$UbguAC;K; z;U9q7(lV=RX&#B-P&QZJ&cplJEA3PRfUtpj9}0**S6)10S9E_o=On-qI#{{x_yxdJ zse%*W;rXfMm7lqpwg9C{ReHy$CiP7?3WVdnNwTDiz&fk=az#`n5Bu|=tNg*V{|UV# zp<~b7H|vK0!r>Bp8+n$?Sg;_R!K8}mOY@-MqfqlP2TP}+`R%Q|B5tfT*oM%bbPB^! zQc{SqjmMUX3PAN`rs?(AaXoQqca(ZFKMb1r*+#MVESgWkf#ZkVKk3dZ}FE!6Gkr%}QFX9qd5*K~g+st62AJ>m7e? z*W4K9#Drx+c|3+w>n#d#89S+O*mO#>pwlhFZ0j)#deso+FxH3xVOO;_hgF}Q;og?A z%M@sk5w!g})f?y*<_|=kUR!XSJByLofBtCvLwK!X`$GWRJ_CiKOJ1RU-a%Vh zrjdA+{J5eg-!$)pd~A(0_f+QbmQc5Y%>ubo-XUwkW=Zl8CNB1^NmqadqkltMq=_X% z1aH2U70N41wffkDMT?rrAtO-VQ{xreT)(pZKX+ z+9tbG+^*-StumcpTE+hZ00lN@BKD_#i{gu|?aL9=_Rvi=k9X*8v9#%t5#V5*e_Cgy z2|@JRsUhL6KzPy^!T#1N_VA{Ut&F#loe>C9Lpi>NIEv-rEqQ^$lY)v56^xVEjnjN% z>e#ZRi>+c66&b$c-dvK8z7g?DMNDV(EvbqGIx8BX;ZgFHbr@9dr@A?cdrkw}vo0~# zkG`nHW*6retXo~J?^pzuIeHwmMGm~seu~P!Yi`^wulQO~-x9OFeuey2w=o8!_>ReF zp$19}d}a*-TjkN^oG^h?Alxje)md0MF?mH6WKo<{7Fne*RL2uhtr1bpX^gP%y+y4N z$x@p*0pWxNp2lNB4a9DO)c$-Y<%aU^B=wm;Zj2K(K0>lO=_c0VPA|`sS=!|c<&>EZ zS!~#12rGSmW05Es&$$(0!&{|t0Yam(qMMvZ^VlG^OjpZaX!Xs}j5n5D8!TAz_Vr!z zL_5n~;dd`u#F!bv$AK;M`;5&FbEhc?WEE1?Smp>>Bk;_eB}~U%Y-83#2E!jLyC#jk znf0vFfWDEG_j&n%(q1U$Su63&?iTxXto0f|4o9XCi~FpUDMI+HO5DUc;i&6#F?_Yk z&%IC`l~uE(WUsF?f=P0q;#vQbUX3TpWT~$39TDn%ba33(ks_SRr9!7Z8s@K z@6lD&qsrRbd)?FU8eVgBJR!+&zadAjMXnYx}=7|kJf=}m| z_X#eyjulMk311Eyrnufe+QUKFTK~*3{NmbZ`aL7I{ zk-_zIC(KheVXM;(?otS0eX?ms_s3^lrLpMq>eXMiP8S#ycugB_KBvvy=*b z41Xv3d+??2ruwzH__Oqc5XRfj6u{IM;-JZKl(K*zzvb;>KDCk(Z$}wN43)PyO5&3{ zc0_ZN{U-~1S$U8<1*OX66K8Kt+rfVo26K@0+Ag#$1*@Z*Sf~1oicZE-w?>Lhf?q%4m+PiO6~W{7IJ|4*e?kJl&NeKsWq@~LmMm0H8ZVk&s7Lsg55h})Fs3Ho1yJr&lBC)J|1qu}) z2$&*3s8)cefOLXI2xeU=fj|HN2p%~8nj*{eM9~vOO%X=S=Z%y`I>nf=)>V8+z^3aHxMOi*>QCT&Jqek90{{VT+ z7{0Z8vuv|+(E%<=GNo#u!qe{9uIS1#S@c^g<}H(#xKnbJ-Z;CnW=U8lQq?F|uA?0y zptj)UImo1mH(ifVKo^~*ZXU70K*|zhYD=eK-ohJqn)N$hRwIkZuI99s=_JE0;UlW z9&7SXA`t-*^Ut(lp)Gw&PF0r0D-lhYi&XQ01au% z>x&)*Q5+Fx{{V5@1CG2SF2`ORBH#|@wB3P838}XZ>=ru&tGRjUiAN75Wo70i9GT>l zl#|sJ6FGYI+M=SW7{VeVZE<{ckEpDks-mIJk>t6~Cvr~Yl6NHTrBT98H0>Ss*N79G z#_0q5voj%tPsXjMw^9qh?7 zOs*|!T6b)CJG|pRWFBI^N`S^StvP-^O7cB5@Rn-YvRKzK*5E98s{-zG4$>v^Az@!f zJIGj{Dyq%1sX2!ba*_<4Txt&_y~z%Z}H#xoJO>uY}8F*}j7M>BBS3EvG7awR9&`M@2gi%+aLIQ+MVy3AM ziphzJ2Lh^?@O0ECJQ$B2Tsz087b? zTUE5YfQKNNIQwhp(<@t{yCa6SJ*S4;($Dp#1B3qnl0onau7;oMRh0Do9O0i%zjEZ> z!lKe{PT|UmIdI|f?iXEA>rr1H7Lax!$82@VwO{6aJ+igYk|bX==6AOeF~+1zwS#D_>0*Ft(`017Daq=sAg!aB?V5|6M**m#K!`U0%7BwcGi^A zmc1KomeFS87V}Xgt!s}L2Y5j&X~s)I_js~E*pr2*t`+m#r)@<}4BP>vjkArie9v5L zvj6}9000004gdf+008&^0QdmbN&o-=HdHJ3QAG`Ry*XM_6vSgS<8C&5o0TsWMwmLA zj$GDS-Q{wYJDXvaYnC>TE{&g4;j1|D?IAh2xe0U^jc*>%>76GFE`wFbp;xB%-g8v! zrH6BQt3AnB;wCfZ;BOR+T|$w0`@M!A8tiY3s#SrP!*dYmDtwTjS zBIqz(U}n2QE1%I6OUulaeY!oQ9pXK3u|&>tjn1c(3u-kYGBPDW0r~;bQ4$g$kdL3@ z8;`!V?xLuTn)9>DY0e^eu5&ZU%Gg=}{vgLlN5x*KnoXkg_Ity+2lz|Qei;p0+aqHN zMp%Ig)%GE2m~yxWX}51PI|RBe%9+wl(|HQ?oK%ZtD^q{Eng%e|}~5({{-ow9S4=J^j6;9+m=xBk#h=je*XvCQ$+EcH||5bKdUHq`sD zvI7ZByLo6P>BYKo0mvKON2+l#coP8m)eWWv5aTHzBgyZ zHawS0yFc|E+dlK#Cc_+BMhhUO(9YlE8*!UP+Q^bb>vG~8rCCN+MlHYuPNOvrbjTe_ zrkHDXX>EUE)g)8G_fy?5lMJ{HJ|&I>wm?609(G|PuG-WPU?$B_-RYXiJ-8XQFOkpufQwW%BSIs$U)G!Dx zFq4i>X~T!1-{e6GLmNxmCOxs&^7L9m3Hp9))*0m;#R8^ z1S~8|*YZhLo1nrT1|{Q$D47sdyCOVP4cqRB97<~zpX}#L>B`U2G<1%V;xoe}r;W_d zJ^_H%k~ZQE;>Ov=RO+6$f4rROgRWGKsZ}hJSh{3u1gb`+w@_T^ z^Ywa&Su1nThDL|CK6oQ43tDIK&WU3A`3<L2qPRp6}Mr}SG|^H)R>g_Is9=T`6P^1ISRPt zf+bZ>1GD(NBD2uo0AcWRteHeS`17l+2W`3zt^L(qY_xKYee`5EKgP~B{7DF`KBTgIj8ZZG z0R2ftu6Ia`%Z;+`ExmRcM#o@Z1m)CVtI-VH$jeVmtB>pijE0MkW>dR;BPjI5K?G6( zQB@QvN&;aGT+wG3q_4?~v9TpsyNi@92Ao+a*XXF-^mFppV}aurjn)1t4%#>aCZP@W z6y*>fA)+k8Mou;%qL1aI7{#$fIa%b3v>7x=I1%MX4pd1L!+`sUYr>|gnvNILR#e9o zJ9)Y84QTaqhy&(|BIJ$rU z>qToHq=#m@P)!9b#n(%dcJAo_djartY&}a zO024Bo2&Z^ziUlXqFbo-wQO@$)l@ve!4o14fw*AVfMmKsA<4n0Q zUgbqSfH?3T06YK(+eA$fG)3{=SF7?5*-AfyhkYj+v0O(;yo_Y!`v(OmkgKwIvIlV0 zVvxcBWXw|l4;<)=k>A<_jVU*=w;2?ZC@lW~4MH?Bg(v~l2AK~ab%Bf?OjMG4$o_$@ zV(r|9+-XKR+uTpWLxmBthgApWX4L`-fTl?#L+78Pj!18}Jpv*F{R3QAcZ5h>aga$+ zJl64pv6d-fKLt8aF9uLLymXj25`cZg!O27QAN1B0Jt2^ovF#NF(kG@>y}i$E9{rl4 zvql*b;}qQDU@&y0_*>OLq8>Q+FOSd91J1sT{T868rR=ek)g0MzsSO?tC64@DR8>rV z(ABN$iH)se&vL3T=(WkW*QgW#P;n%Y>b2On3xUi8>tfa0!lpb4zr+{==Tmm~Un3i* zZSD6R-pEFIk-*WnkS_GeP%D@lO@*Um)+z*D-(&!tN~)*vRWN}Hnk~@jIgE7-1pw;g zN5>k_v^0--X?YFLfaE+$DjrJ*iD&p^nor#_Wa4$o$3UbbMyF|7D!^{Y0nVC&_H>FE zrV$g0ZH_#BN^{e3sCk|TMI5dapl6xPnCJW~_+`VuD1{v|8gfcRzFp8RtCvz`@2a`X zqUIIbfT$}daS<}7GJhQYn#-+55j;$00~*bM*lc#fk6f(76h@WA6>>R~G5lqe8ZAZ8 z2T+`rsYmnWMBpCXX1AFDV4bGzZ5pFplbv4 zK+>udpqb7<{{Ri(2Z8{H0CfKTKR^At=Y4IcUs&-;3%|pIzn}g79;#A$F4J}h^|Q^S z;pCct6)4D=h<<<{37R&`GT)#B`9P&8a35gfUqO2dxVq=rR*{}Z@kq#D89(XD_7AuO zQp#psgakaa^s41+7YQ2rUP;Ng0=Hor)mM)fHzEPjlXOgB@*f)84|`){3(!->w;nzNq&3#PzR&e7 z8D+LZv~t(P&*hFe90$#<`7DP_MkKq#o`99hf@y)&4oV(W>L~pD7~Vts01mlaY}L8I z*eSh@GQ%uqi0U(O(k+n45ZP|4FHUM>kX?e+iDOQ@dMSQzk1HVt%Nz2T9dvo>5Y;UO zbzP$C`cj4XsivAantyq`Bm?A2NIqFqHI(eBE`m{*WR1-}hj08YwlOYBfy@}#UexuaZJ8klX*{7(CI~`i? zPGR$7fob$wLb{S#3c2Yf9@`y{QPBKG>tUSaNQYHZku=jGj-rP!5QHHBOmm#(5GhDf zhaw~316Q?3q2;4b69=0$71^R;;iDI zdBhm`v~o8)W88aefn145y0A=4Pb}rC4%$49RV0d$6@}Dlb;=!9w@9bMv#-?Z5K&dC z)D(FPn;3W~Mkq$bMzkT!bAk++HX>!}F^nKyL_~QV5o9_d(;32*H)^Y~n5P{yulW99 z3#}+r00iGj#H&TKBZAGjY^b2og1lKPp`)vFD%-_FGYoPM-FMm^Z8&iBS%x^cseYwETNZK#yiFy*i8@5!nZ!6yoESU~ubMvnQ>k>_s`FcFnufY) z{{UG8tu1tNG?u(!z!KgdOB_eE+!af4q-7Os^wCr{Sekv8G=c~_gST8A$3nT;{iR*J zx4Ga9Ke!my37T^l-JMV;-KK~Og(_JQnViQ9m4G_^v}Lxw-86&Xr;#}S05+^0q1y#b z9UXgH`pBMGPwu~Q@^JqEagZ+!x#w z=@=FEs|i3AFWZ1H2PNQiJ;IgbI!M|Kpl&wyhli-?^6I@<;NhI?tVa;hETazFBIAoB zwR<4a7DB}g_8w8gM@lIkm^}v(a*WkY%Naz|FIozur%HkyCj8unvAEv9M_eh}mobII zh3zG;jo|FyMhL;@j1kkpdjq=aYtuj07QdHSz~L>>SQ)_O4jac+GGvgojf1^`fQdDZ zvaCQsoHeLKK%{aYn^*jYS8adux+6e#xYu_!J!w)IQ^ms-S-@nS8rjall5`RrG5vU5 z?@U7I6a)kSKtMo11Ox|=5Fa2QA@T#Rg9H!=J18&R5i~^66eZmysXLBK+pg1L#k=WT zy>e43Wab7>+yqYEunXv0ZK?c`6I2Y{ozEt_sntqFNF;dPW#LQ6BA}FtwLMtCoH>rSvf9`r zY}fGHWw^Kp%~0kspna|u@fXVMd#z(mPB#N}SI>}FcX#!w*zN?ZMAKS}vcq*c#NO%o$)#C#F( zv7xQ@4Xj>s|Jzq-2Ii z>RV$EaVFI)9J9zw2cIY7nZvo~K2Cpj;9c$$@;})AKB|H+rb2@!W;#JM(p@6}0T$po zPEp{&!NjBU^T>aFa+amEReMuHNn!Bn7q^#HW_Z^uG=?*Cu^(*YohD7g6N49N003|) zx@;wKAJe4#Yfx6vT&X2BG?jA0F#Ak*ihXM{0UX&4I}i0TAV;Xe zc&MXt%Qsug(@Ea$_Payn4h9vh78yxG6hM4-l60!A(I|d|DL^%V-ESI;P|9V!UaG5J zdd(x``<&tjz#`Uj7qMLV)I4 zV?$Q!8|}MJ+2K9p&m2!9XyXUlmEH|#{-E+jxvorYMh= zl9F>-txTxRgAlutpYDrRdypA5WMVOzaM4*9(z5d6U$VR1|^L%@agT5i~^67ag9j`A)l;_tgI+Bz@PU~j2SQ-?;z<1#Sa2Y62hMgDAIeiofF@!#N58?j+LkCcN>)z94Wn<%zv)a!80GIdl*+Y`*%h66c zNe@r_aXBP`kQ<%5CE8eZfq?79IJwEh$2cCZlBnJwIs`lk00-}{pxuqze@19KbY*~d zlFKKqUPgc0^1>y%ok9iD&mu52Z46<=dMd1UHwE7>IdM~yiBc)qK6r$8 z(gXZPCm*> zCaP=|QF0=4cF2llJc?-vyz(V(Ch$Ga%dBc@ySA}`?J&DJz`<|>K0fI`)#=Q=(!r=N z*byecn{axGlK?1ibBlmEOg=v-m;iYlNa~Oxl$Yh)2R|fHn>am2Ix<Y_q` zan|v|F36er51!co>VH52exa<#O~&b_r+)k;fcya;^dB`4q<+?EMf^CEYqk{>cOVHx z5aG$rR&82W^!nMuM6FQx*!&=O{`H7L=d+>cQqDr?q%VZ;C z8Z##Y+ep2^50O)V9+2_yCNOK9>)!f_;7sPw2xro3hGi$i2JW|veC2TC$O0ld+uF|JExK~&Hx?v&JGT12Z^I|xyrw?OSUI?X z{r=!r3b>u9MpmK`0N_#*fw&F?M1%znBk}yk{{ZV;AAWy*Svm6m0HXI&!YR-J1b{!~ zDCoicj-gip{{T=C*1o8VaPJU53@Bkq&r6&}zIyd7#_!#>JDTnXVPwnmXA*(YMcsWQ zA!(_YL_nleZWHX>6Ye0`+1MpQ(YScY3sNv;FRA_$cyS2YSQBIDfZl zo21BNBEuo0-!KOyA)QyIlSiz6-9}76Kd!c4(k?gu0K?jDa6eYdjt}!gCO-v`>34A5 zV)F%Z_=-YPCMFLhBHV}lLG*xsPbb$e=h-9CZehtu{0$c$J7bBj$u(@~u2%(`qUki% zOyk>3uMh&N1_ACQLYt4jNa~1ABB+!faz^lK!qpC7H%)u1 zg^k!NTdCz68yyWE$|fE?lvGq}R2aubMzukVdj?IDDovU)WYsjAHEP`=fk>KVDF{#i z007Y!yP_tDnj&b4qA10@+yvKj8(qyI!W@UbQmO(^kqj?inbj&ReL8Dkv#|)hiKIKoj(Vx;%&nk>^(H z4Kgm!wyKf1t7Cy6eXtHrI&pY-tGiC?<*#O&jhPs7LCLE94#LS9qAISMsH!3@Uq`!b z)`INafORCHOeHtR$Os3UXesJxjQ#TrF32F`;@33tBas9zT<^N*V_=@KnRjo@>p0JG zkycBdF*->$f{>p@c9z&Ex$ zDNHE3uShC{kQp&INS!h$iHGu>!NBXLG}maFJ61%;+Aolrlg=3kigq5M(LWE!<&XGj^_wDSi(B4on41`t=2OU$v|37x;Y|qY_hwoa8Tde?=+d8nl6CK8`-UF;MRGDC zhAEdGqNXPvbwP2uTWs{tth!f4PfFfyk-?+TWQ?C7l6nMO`g(zS=tWhk)6~70xMb$U za;nYdZ?;67@bIMMptwn?&UI(lT0`b=`7cg`H011<&*zJmY{8rF5UJA|=E6qQbM8gtNO_?!Wp zbV9m>^m@SIhIXQ*fzvN(Et)U39FA}~dRHxc2-3AxNWdj2fx5AfV(}mzewVz5gKOvy zVD`Cadq1GAsgH)Hx$cMmX>`bAxv z`1h$92Q6GAZw5_Njv@9C`2hg{9d0S1ilQkXnSs$f5JBWY<`f*z=9ai+rE$CJY3SvA z!n5;JjqvI-Z8NW_~@sGhrzBbIkJD4TOzFEc=j_G?3=3*cO?l4+#EEfoa9gBIl?2=mB+ z)DtLf)6p6OPv|-aQraLcs*n!$ci_t@9w(Dp4tQAHGyD7a39 z*-2}*Mz=sxs?15ry5(#y(qMwFL_f-FAJlc+s9^%8*&`@n04R>OHjlAXSJYEMO%`UE z;jJIM< z+a(@MTI^DfCgoo{P)w*wPCQZcl!JiqRc7TKx;fNPL#ZyYS7wGCA)WNK3qP@~R zv9xa11N}raet#tp7p{{C=H-1V{{Wzj;Fvj-aATMVUZfKeHYZU1AS${!N*~ixR8-1D zH1QwS%<#eJPD%JQ6Y79x;G!h<)%Pp7RIIk_XNGU`xaI@#3q`voxq){Lj%#sbiD>px zMg7)nk=4~blR)TAx(ll1V-vQLW;pcgdg+U8T{Ws}lj&deI3Oj@BMl8F^2|NA6_|WdwQs01Lo>K-RmfYk()=^4S+iK9h-UXq$NAJ?RbAi9=0S~smihUVqq@(P@10!+X*3R+i>^DC)l@&{$w1>E`nYQ5F zr9nRGMjM0JW)#5e{zAI%p^euR5L1MB*-vCk9YW5FfG+JHviDSgIPT^rc`%&ZqJe>0HTm=Pa zo6y8Ab7tIfEiy5D~+b5w6_Xro^Z}AA0T$m!~a5n5r2w z5XBN0f@L`|OhW(|rznR41LOoa*9k)M=*D^f0B;q&V>yk7$!t25v)c5WEZk|uC$TS@ zKWbnR4pnTrX963Kk}3rfm_FqZ)xL4WUOK6q(BN8m6}@RJvZc!DJ%5RrLQZ$_q^&V8 z8!mXMhR1HH7LH0a9?&yQ#5lGhL`)Pf`9bm{=2INlrnu46cXjbNA7qeOBMw0arrUmk1TrhLUgR#o#>uQ^WjNB$MVLGXjXLx}kFu4K;fJtcS^b-`+dXr(`>Bh`< zjItbu&^>7n)S0#4J(z3iU3;ftt8<#$)Bs0SA1)a&?}7UgV7a~-t@)|$q{gC)wHpQ?ZPgZ5l`JJ9v; zJM~sN_#ICut%!RcXnuZ&@%3Dr$VaOf^;XLeN*!k4c=+-@OaB1xT6V6T(LLE6Ree0o zm5p#KX49{7G3mCBcmXEGq4{pnbxxY76izA|@b`u4Ri|*n$dl?w#`z$Qv0H_wM3>wN@DzokU9NzkY248flc*^=~+`S>fCMo!Ax<_ znzSIy8@|MqCf4dU<1G@A48=60*|nCOig^x0n5nmPEK!v*E+fow0*T0OQV|ZK@#HZ3 zW%8n$uj-UnJDm)lXS=JIG~=KgSO?1(Di{TPH$J7?<#OEZRNN);5*VEw)^qa7tO3A> zAg{aY0Uy_$W+PN<4jv!)-tbxAYF+q^{`EHsh2k?)b;H@U~;qp;|_I4P|@#R~4nc%dh9 zJc6p85jz)ruuPCeQzU|=iZ^Ko=Wrwy1j1DS2qgd#ay-y#IqGO8Wi7tr+_|IL;Kvyx zZ?1P z(~$u)mjxe!m_qxY^i5X0)btiOn&CynA5ii3AZZ+DJsj_GpSET4Sg=Arh<;13QAamDWYRo#*Kqo z&;wcrfB*oC=xf;*;fhm~#5q94FbPak02rnzgMlf4c>w_d@)~p4@Dpse4GL9{{)!*)HtA&l!J=e^dBE5P+Q8~JdqU?^ThvfReubrCdE9{S`mVm)n z?s7nTvVV!VEO)7CK57A>yn?NW4?!KcTbUzg##^GeP19aGlWf837}|xpJyoIQ9z#kr zZ9NSk9L>V9lF`exTna%H*F@wn0g50P1y^9Ux!zqCqNrnh<71D{E&LQ#)P(d4+xsJ+ zGWowW$f834tlBsCN*N_f&muw!(30w+1OEVVhf=}xey}uyReh_I#|?>}{$2T^oR}}u z8)vu%QLTcvjty?JF)$sChb71j(d#9;M84&l7md(@Z0I@Us*#u|nY@t2)@xzxn?z~( z*;fUxzpHP$`OkVC|E08*5o08*3#fGI#c004XjwnzW~ z0NEGrh?*kxp0y+9ZrLcJ=_c{A?Nn8&$~JPD93*s%qjw1jRc^Toen@hN7>3|O$Z8H~ zb6nC+2*NI5k@Z~8ewjH%?#_3ciY)nllaEBv_@h2T%ALMNzhZRVD4jCbU~OY^;u7^P zlsOY?BH@?k%2ivxsmx2Ro+g zcv!z^&uS%NV`Kb5oo*7{qM0^xY-!ZE!B|Vll2%mKdjpabh8_gOW~Vwc^)G6gs`$w%sbv&2PTLU^#z*f;aP9v9a5Q-36=_Ax zBB|Cmu62yMr&(3ps%4z0vd0ssyM>h#D7uRr!X`O{M8ZBtpChKKqLI!oc_rtWJ$!yY z`BBMPdJe>#3M1Ad;7S5Ke!K_t0RI3`)v@t|o*YcK7 z3{;vfHF?h9b@S zOhp<%EX}1!nTWA^$YMwLNIwVG&aie#qBQ*Q)<!b}PjNZl1N*2fqQPftTdm5>t|bCAO<+r&08A(&&{7A-gQz@z zVbv^F=hs!z(y)6^BR*N&pOO>5lIg?J?Gj^OPJBOcyRZ03C2Kcqy<~Xwy?|{MWwY5W zjozvXbnuu~m2PtWrQ?sbzMA%7M;(*1%M)ZA5w-_NbJ4DIoDcNisU&-1jq*JEEd-xH zxNqH7;2-X@cDc_wyjfLQTJ6tU)>2hNC=4m^$^>0;nms~pgp!PCn1Bb5sDG}s4zjww z>2j&8asL1^LO}2XW{-eUQ#H+qIpg(?_K&IG9|3{zUV2G{gVH_>B8kWQ^rSq0@GiAQ z%x7`Sf6Y`Y2-$Ae?whU6wVZWbZ1t^ivdpFOHL(OtX0;k?DFXzHr57K*Y2sLv|5yZIfuxxj&fZDoF=X%p!A`M8**?i0kMD4Gk@}ik9C+2#%5% z+Qu|;4QRk0F1>k`1(Is56$ko}`gp!sdCkILXhmNYRTr1ZIO-{|s_7*}PT}>&rp*$G z+#+)cl#pPVMC1__&;c)Sh2}ohJ1Bf|)#{xwPF)+xeMLJ);GNwpKywG2k&VI2o3=pM z+Fw&QhC5}(OcAtiJiMCY{{Ynd4@FAx+z2+~;J}|B>YxYz09xg_w&VD%hPTEbx=2!G zkbKMv;Q&*I43!ZC*GvwvPEas;NkJ%hFnkXl2Ug07q=G>-M}DKDhTQ)EBhh)u8)a_` zzwo3UABs`6>r|MFfZ7sw8kKiHI0A zkm)^5cGH*2d;XcNjw;rSOB95LOw8oQ=8t$BWD)H(*l@vC+l9WGwusVJ#$3*h9NKyj z;C|!Cu7R+Q>2c0vaJ6IJB~r=JiKa6+@^R8BN|=X4tCCW<;6*en@Gg=!T5cP49EI?* zX&c77vqJWnVAj;p#}uNP_#67lXSi{L)W&uav%$^W4|%OCQ{8M;mbVv{@zI`A0k@;S zWceR~Dog8QD@1t%10BdjOvj!H8 zn#enGUCW6RxoF+Qt)~#CvZ8;&ZfQ3nj-S;V^#K~r6rxfT3P-)QI#yp!YP~5f2z^~E z3+R4jo=*MW2YmcZoYToiA#{0lIs3hTzs+;_l1nyJIRg(*z?aX`K0w6~9t1e@0vP-%$+$QOay~#ne#Qw8vhN+x7T?EUn> z!P_#t9O;|DeJ4LriO(JcJ_I#lo|%r~93VXWGwbK)^HMpa478Oep>HxS;}nZLg3HFc zZlhNXyQV5@w^V>d5Ll%jxd)FQKkckuqSHF>&e>s0;;Nxf}o(qsR{nf`Cy0 z_#d{dZ=SV|-e-?PkHZVtI5~Y{sEK$?qEZ1s3Q*&ufB+r}QQ!-}2fzlYNO8-t%|&hO zIf}2@!uxWbr?!fuCnR- zwxzk#+3eJgnz~nD4vigN_i}3+&CWXyGk}Y*{g~|rp|nhA`?DJ18x8KpX3}{Q?d`h< zoRvi*6})s}N9tLXY7nZOHfR_`#uFW7KZvP-JL|KK&u!hGS$?Ghgttks>WQ&}_YO^O zQ5!Nt8|GYhaZpnWTMZLLO%Z9$#AL-V#stk7X$Ff(JI46B^>vSpZiDua?M9QwY&OS#(TjNAc5i~^66GTlBMZMST-vIAN9-kfOYGM#BL8zLM~A^J^Mdd;Vtv*$lkvvGx=p&%e(nV}yO4-p#OHjE>qn6@Hq+OufcB9Me3K&2>aq2Y!qc%y;{ z!y#isTF@{68vqAD0)qQ`^hD7YiDi*&imn_gk`2&FMVDP=3X&+IkwogMs;3f>G?O7j zOkofJ0OWNCIjw1Phz$cIo;k?eA!oG~P`~71TY$FvU3k01nLqcN;&B zp}ItShe;6XD~XZ_7pwSe%qB1{9O2qWYfOAqHccs1d!d%iRKxHwzTA0Pq2>M7&hE$CI%+I2{K; z^Xtr$le!hXjQU#M1%qG1t1vZ)WIjYaKO`k=!qlfq)OQ696B603L->&ffL$LH0Am??K3X zPCfvxFfsgNgQwX+x~?3$=}iO?OzN)XQym~GNFtaSRg^zh08)U6kH)#0=I2Q(19Eb3 zG1s3Us=~bulzL9?hjA}r=dAVFJS&Ws22LE@uaK^z7oK{POKD3!khU_}XoH2E z-t)WUb}_{Fbv^@N(X&7b3PNinM9~vORjs+7O*~PXBwt-9PKk;#6U7eg`th;kbx^Ur zF@;mOnSe<~#$x%(pXNGbbi~8S)Jap1I?~$bv0E0Yl6#G+U#MOmlH%6pDI9vfF^(4= zu3;JGTH>2@Qg?~ax4oy zqty0lz%f=Mf9${6`~B1NTB%C)f)VOX<>02GT@Y45cG7Wg**aNRa7%YD^B6;a|rl20RAHjLv!?>K0Wc|Z=r*kZb-5BTX zRhBHHLbWlB(5##_I5|ko%yAUNf(9o(IM4nRZZc?^DJVvpGW&&TKcP9`>w(HMt>z?7~1o`xCD}Ql(7wN z@dg|!^Y9x5UJCewaSyEQ6`a&cIGl&SEH$`=sCN( znh2_Z>RQIh+`Nz2_6g<079U$lq^2db7bzl_rxRZ2^X5q69=rM}ll$u%`<46i_-&W) z{{X_j6#O6ea##1Oo;rUG{oD5c0EzxB?mvau==}bAx<0LLuhW#@p#K0*eO9aL{nsCN z+{xen00(o!$KGez;m1C_JFI8wulm>3JIMI>vBktVJ$SQ>V|@O5EW=loOqwESiJ~as zxU8dcszI~I_-3(Nzvt|blbGy%QMa!33N%b=O0{if$vIKXSrn0DjHwJ>g09m?q13~} zwu)$Cx_X(@5C|ZRkydu-y#+RJxQR!%Dv>5O^N?kK#LK(IY~zC;Ny;oDtJmsdX<%7| zXgF|jFee)Afj|f9>M)6i1H5*9X1YE}soeTm-MQewVLl~?Z|N;wecO3~g-W?|_HK7| zPCKXgcP3&Cy1_FXTSZ8^na37&(g6V>0U1V<6~I*C@FtW@pkVzqudBN)zD6DOTBs*) zLAxFDAh-R>JS25c;=$<~>Q6xA(%V_L%_31Td$g+!7VHNC59TXs-KG2R1AK?@b%j^< zd#fPH{R<<#SO*O6u*M=Q|wQx5q~p5iNqz4aSTTCEDl-V~idx2oqiOUXF+$5@U$b4o#Ioy!*_|Pa!%E8 zhvkw6?J5G=^OG*SA1E6J?kE!mT#dxm{TZZUN2Aj*dH#suE=HikpiB#K1oY5ci0PI( z&!mZ*0qwlAu~3wexMliuc9$6&_lNs;SH2w_MUPq>5I@p}r2iC9;i%|mToQEE)}LL> z{gSbg#k=OvSSe#}l(?c2O1bg+X}E_%%>{3DgO5|wd5l@wDJem9C-W z%u0@AoNtiQg-`wN`-btohdFOu2#Fd6Yph>3*Irik{H%D)|6>6Dqc+hAFM~xjopiZ~ z6Zuy#hC5Rw=cx@69rFmer6zuf166sAfZc^dmwFe0T(pnfZvYxUtl#z+JgoO%_4Tei zPBcIkZX!5DZU=x1Uxxp`MSj<{j6H$^g2cc^1TcFmL0SvW5F+07Vc$1I|EX1M<5I~c zOKkwxlLE8apYf3|n-uFe$l)VEGgBGbl=?u%8CM|y=;d`O<6wEw0ZaRW632UFRE5Qk zStHVBl!{E|g){fO^Jp1~h1D<+#)Zv*3)MRri5MznVw6s2-B49KR(5(R_uR*=nd)Z` zCVIO~O{%=;syM|g(W)+V##-E-PjD{t=w$ZUnVvopnsrQPcr@7h@H}#m7zvPqLHUq_ ziszhgN;X)*^rlpvFkcTez0|$^Vdk?ffrJ6(RPX>yZ!H;;SS>pfn5MtCx#fsarNG1buKAud6v|cKXW-?sRiPvCW;UbGPQxNe$P49>0Pn%qM6mOxk z=jiuQ@K?Y9eMx^IGb2sF-JYriZO_GKTkX;t(n>L+qv%)n7*t!}j+hBH={d72QyL8V z{5&Ydxth{&tRv@!Cv|TUkYFdzbJypLHcH1CJ7`>rFXlU^HPgH3Y%uz@)VmK0XhuZx z<*u``+22x|;FbH?`-V0?7%7g&a1&|tf^pm`SO7poeV`puMqdnh`N3`Qh;LD<8u#AA zKJ~}@gt@~bPtk)cO^KfLL`mGJ0&CG`^MGE>*TchWIZSMcwYKOKFl7uK&T@*iWM$7> z|JBwa+cTwzXyyKJ6*>H1FP9D}`PC@)X%S&eA-7!v^6fWZ>ekJ(WbbO3y}B@Y<=5=} zd;55EeHeP7KG8^c$N}T{N#Ki*(4P@*kXF{fHH)5|vMgN5gt-+w;iZt0t4Z50hN{_n z*601lNN5@Tn_5KFGRKndR6tUf#)K4dBG{xMkDa#&*F^~KI>y!?S886h$Fy@F1)||M zkDy}ioyx{}s(NLfHDv;#lOwc;&<5o|ij}f70EHE)M9IYs9w^;mOij4wsa-0e0(dOu>!FIli#Y!1 z@BtdqFp9`M_87wkju5u@11fNiSg1NO4Fk3PuT2LM2X$8Hgz}0?gP6Lgp)F(prg>xI zxhZ1l)=gH^E0B#B)sC?ua$T^Zu;?0~LkiI8xy7n>3hh@xhmKi-yuYzn#-<|V5Av!M z_cWR_@@G=i9UoZz6OddsDqZTBB-r=~^6DuvTUMVMj&n*N>jDa~=y&nuU7;f8ScNH!SmyER%8-{JBT*!p|pTzs`{QGiX zMG_gtq~+H<4>Ha@_pC}Lgw6dDcN6_?nl!A*e4@8JguC4fZ3DB^A2jXDNh99z@PH1V z9^0KRTDNK>64Onfh^tqb?>~>L>e9wPkB&;Pzce{XV88cwnY~OLxj4HEs6Y}{(k@Xf zNEyJTwv6ubvrEuf*gu7?nIx;xU`Cr;?vk(h-;ay~$)9Q2wji&+qRuP(mG-RX4S5h_ z^w9*m<)rF!_}$0DoiFu4Qu5R!?TD5KGsCdXan&GS<(egnOCB&JL$_1kWWh0R@P_DX zDGP1w&QDydpZw~AxCZ(L<$T{Z>@Ww46hLq-*S2=2-F^3*@Vj4@h7`2e>C&x17Fz*I z2mw~O>y2%~y}gf%iqPK1JOnpU3eIWor)Gk;e;#lNxD%dfXy*H6^@8YlW)JnAFh+N5(#|3=hNrH74MbL&Aeib49i;M9sr12*wrU@&+0&T-_T!-pX z%fw1?=n8|JD6S+FY;yo8hOoSH*jX*1Y$317AlRo<$jzt=^~ci5z8$xe_IjXg@_k8e z!tpg7Xl5N}@FTTfqP>q_gbJTrRX~>gX;0~p*#kX!^=C9W=eFUHGIuy*@vIU)vtf;) zq}Z1j#G=nAI9vPL=EFIpRe0VM^53KtPf_{Jpp9mUrZKbHFJ|jiOcop-IkM8kqRDC9 z9`LDf;r*(QTG`C2l^-&<$YY^~4uOEkOu6bdz3G!{@DjCZ4_6+iTX^HKNE9HzX3~&` zji*m0M38&rt=rNMi4)$#qE!*8CN;{H=&&_GDl-d0DIqc~d^vHSc74cgPB%HbZgK0# zd;vWj6r66N>ur^-Q?$hN2k)wTZUu~-EJp90z})czoR8cGv%*@l#t>!7jzmYU^NB~1 z4=JiPhIsXyTTeYp;yY7XWyS)1g-!tqww$J7{bgpjpcDw*FPdw7oIx0nu$4pom zaRsk%=|FM+aWja1l%BAGmU3{MilbO zErTICYvcPN3a~+cqmOveU!>}y;;9qW8ww&kccS~U%(vM5NBJi~*|*czGgG&?%p(*l z9YnHW#_9>BMcK=U3S7Vt7t0LKYd6A2;$5OMgYWgPumJ@rZ*qvO>iy0;OV$7gHH!G;0 zVQM&&ve-CMV2GobJhL2ZM@DvfDe<+JjF0)w^)tPTDTFJ!J#q(;W>}Vh73luKo3|2? z9;pWS_|=Xv_ju;j0`D}U;WywBq#`+fd6*vai9%$Gl8TNy6T`Q?NA@JM;KB6n+B${V zR84cNf@_2>S9Ry&ByCX=gj#e^vV|PWT|hxpdL40X(s<+IH^BC;nrhCDH!Q5+Wn1vl zKmd^x)sEsHth2BvX!6${arulb=^-y6k6mpHxyXFplY;bHqGDL-;=AL@3vl=3)HB|W z8<)!<2<0(dJ?P~MCkgZ-5^tqWvSiun?PO08IK3)r+1oQJyiLZu=u$I$EL_0FQz!u7 z`|RrS^{P8oHz>7)NJ%#Ynps&iH1xfTc76kD+qBce@7?dsy8ncRKl!ZG$Z)r0+4nbq z=sR>S;d8Gb_q2}g{SgW1F8AqWF|wjhxUs|`5yoXz3M4PSfMF~&-;7*gRZ(rtmyh<& zsscE0=sIP9Drc>P6?CIxnpC^@!xUI-4;~BpeETx+UG$qut`Isu#qNt@*^buT4YADo zQuV&u@{>4`mSPumlJ?XmGR%v)gbdF;INL6B*bb(*%s@N=+5lF7`Wq1z=lHFyH%zb| zEIFj)c2g}^;pun>up=iDdPlTIK?^RVaY1>eAq!94{7aNew4B#s$$Z=Y@IW~EdK$edc&)T>ostG++D)Zz z_`CqzDLAG`&e&DPJD@W)%y~6@R%wrBvijj^+)+!b*0bI#2CcB!)lwXEWLuX*i};30 zN%Llk4ffQn-9U;l@|uUoyt8%i_Qt5;7Su((Hdf)x_J?z5zy5;JHcC?khCPF@%bhEj zLLt-@-j}G-E@G7H*TYQ+*(DuvTYH@fZO?Ri2B5KYBBAwCiSF{r=aXw+lg*vPi{sB> zUf08ki?;$9NPPt*)?=F-TkU4qc&@~Hq=ZAwc!L8fJgOsQm9Jz=PSU@VI1EMh-TVa8VS_{$IUS8&F)atk`^n3!-`R*%ac z>LIL(qT*`{AX1?dhL1{sj;u0{lF6iR2%7KYD{Cj0CztmJS)>|mXJf}*S-1gLFJa=- z<n`K7Bm>;=~qxqH5ANGM_`Li*J{i_gQ?z+;6$!h;qu1E~UcnU%o!IDw-0i6koN( zj`A;Rt1{dTG!fJ6&O9?^`KY3f*%06Np0=E4pL}S_4!z!b_X2N`Z;q)RvO@73{aLO5 o*^l@KiLVu39we%YkU9jx8~%ww|L*+%f9}89cYmM6li!Q~0sWHz(EtDd diff --git a/node_modules/bower/node_modules/bower-registry-client/node_modules/request/tests/run.js b/node_modules/bower/node_modules/bower-registry-client/node_modules/request/tests/run.js deleted file mode 100644 index e717f02..0000000 --- a/node_modules/bower/node_modules/bower-registry-client/node_modules/request/tests/run.js +++ /dev/null @@ -1,40 +0,0 @@ -var spawn = require('child_process').spawn - , exitCode = 0 - , timeout = 10000 - , fs = require('fs') - ; - -fs.readdir(__dirname, function (e, files) { - if (e) throw e - - var tests = files.filter(function (f) {return f.slice(0, 'test-'.length) === 'test-'}) - - var next = function () { - if (tests.length === 0) process.exit(exitCode); - - var file = tests.shift() - console.log(file) - var proc = spawn('node', [ 'tests/' + file ]) - - var killed = false - var t = setTimeout(function () { - proc.kill() - exitCode += 1 - console.error(file + ' timeout') - killed = true - }, timeout) - - proc.stdout.pipe(process.stdout) - proc.stderr.pipe(process.stderr) - proc.on('exit', function (code) { - if (code && !killed) console.error(file + ' failed') - exitCode += code || 0 - clearTimeout(t) - next() - }) - } - next() - -}) - - diff --git a/node_modules/bower/node_modules/bower-registry-client/node_modules/request/tests/server.js b/node_modules/bower/node_modules/bower-registry-client/node_modules/request/tests/server.js deleted file mode 100644 index b6eacba..0000000 --- a/node_modules/bower/node_modules/bower-registry-client/node_modules/request/tests/server.js +++ /dev/null @@ -1,90 +0,0 @@ -var fs = require('fs') - , http = require('http') - , path = require('path') - , https = require('https') - , events = require('events') - , stream = require('stream') - , assert = require('assert') - ; - -exports.createServer = function (port) { - port = port || 6767 - var s = http.createServer(function (req, resp) { - s.emit(req.url, req, resp); - }) - s.port = port - s.url = 'http://localhost:'+port - return s; -} - -exports.createSSLServer = function(port, opts) { - port = port || 16767 - - var options = { 'key' : path.join(__dirname, 'ssl', 'test.key') - , 'cert': path.join(__dirname, 'ssl', 'test.crt') - } - if (opts) { - for (var i in opts) options[i] = opts[i] - } - - for (var i in options) { - options[i] = fs.readFileSync(options[i]) - } - - var s = https.createServer(options, function (req, resp) { - s.emit(req.url, req, resp); - }) - s.port = port - s.url = 'https://localhost:'+port - return s; -} - -exports.createPostStream = function (text) { - var postStream = new stream.Stream(); - postStream.writeable = true; - postStream.readable = true; - setTimeout(function () {postStream.emit('data', new Buffer(text)); postStream.emit('end')}, 0); - return postStream; -} -exports.createPostValidator = function (text, reqContentType) { - var l = function (req, resp) { - var r = ''; - req.on('data', function (chunk) {r += chunk}) - req.on('end', function () { - if (req.headers['content-type'] && req.headers['content-type'].indexOf('boundary=') >= 0) { - var boundary = req.headers['content-type'].split('boundary=')[1]; - text = text.replace(/__BOUNDARY__/g, boundary); - } - if (r !== text) console.log(r, text); - assert.equal(r, text) - if (reqContentType) { - assert.ok(req.headers['content-type']) - assert.ok(~req.headers['content-type'].indexOf(reqContentType)) - } - resp.writeHead(200, {'content-type':'text/plain'}) - resp.write('OK') - resp.end() - }) - } - return l; -} -exports.createGetResponse = function (text, contentType) { - var l = function (req, resp) { - contentType = contentType || 'text/plain' - resp.writeHead(200, {'content-type':contentType}) - resp.write(text) - resp.end() - } - return l; -} -exports.createChunkResponse = function (chunks, contentType) { - var l = function (req, resp) { - contentType = contentType || 'text/plain' - resp.writeHead(200, {'content-type':contentType}) - chunks.forEach(function (chunk) { - resp.write(chunk) - }) - resp.end() - } - return l; -} diff --git a/node_modules/bower/node_modules/bower-registry-client/node_modules/request/tests/squid.conf b/node_modules/bower/node_modules/bower-registry-client/node_modules/request/tests/squid.conf deleted file mode 100644 index 0d4a3b6..0000000 --- a/node_modules/bower/node_modules/bower-registry-client/node_modules/request/tests/squid.conf +++ /dev/null @@ -1,77 +0,0 @@ -# -# Recommended minimum configuration: -# -acl manager proto cache_object -acl localhost src 127.0.0.1/32 ::1 -acl to_localhost dst 127.0.0.0/8 0.0.0.0/32 ::1 - -# Example rule allowing access from your local networks. -# Adapt to list your (internal) IP networks from where browsing -# should be allowed -acl localnet src 10.0.0.0/8 # RFC1918 possible internal network -acl localnet src 172.16.0.0/12 # RFC1918 possible internal network -acl localnet src 192.168.0.0/16 # RFC1918 possible internal network -acl localnet src fc00::/7 # RFC 4193 local private network range -acl localnet src fe80::/10 # RFC 4291 link-local (directly plugged) machines - -acl SSL_ports port 443 -acl Safe_ports port 80 # http -acl Safe_ports port 21 # ftp -acl Safe_ports port 443 # https -acl Safe_ports port 70 # gopher -acl Safe_ports port 210 # wais -acl Safe_ports port 1025-65535 # unregistered ports -acl Safe_ports port 280 # http-mgmt -acl Safe_ports port 488 # gss-http -acl Safe_ports port 591 # filemaker -acl Safe_ports port 777 # multiling http -acl CONNECT method CONNECT - -# -# Recommended minimum Access Permission configuration: -# -# Only allow cachemgr access from localhost -http_access allow manager localhost -http_access deny manager - -# Deny requests to certain unsafe ports -http_access deny !Safe_ports - -# Deny CONNECT to other than secure SSL ports -#http_access deny CONNECT !SSL_ports - -# We strongly recommend the following be uncommented to protect innocent -# web applications running on the proxy server who think the only -# one who can access services on "localhost" is a local user -#http_access deny to_localhost - -# -# INSERT YOUR OWN RULE(S) HERE TO ALLOW ACCESS FROM YOUR CLIENTS -# - -# Example rule allowing access from your local networks. -# Adapt localnet in the ACL section to list your (internal) IP networks -# from where browsing should be allowed -http_access allow localnet -http_access allow localhost - -# And finally deny all other access to this proxy -http_access deny all - -# Squid normally listens to port 3128 -http_port 3128 - -# We recommend you to use at least the following line. -hierarchy_stoplist cgi-bin ? - -# Uncomment and adjust the following to add a disk cache directory. -#cache_dir ufs /usr/local/var/cache 100 16 256 - -# Leave coredumps in the first cache dir -coredump_dir /usr/local/var/cache - -# Add any of your own refresh_pattern entries above these. -refresh_pattern ^ftp: 1440 20% 10080 -refresh_pattern ^gopher: 1440 0% 1440 -refresh_pattern -i (/cgi-bin/|\?) 0 0% 0 -refresh_pattern . 0 20% 4320 diff --git a/node_modules/bower/node_modules/bower-registry-client/node_modules/request/tests/ssl/ca/ca.cnf b/node_modules/bower/node_modules/bower-registry-client/node_modules/request/tests/ssl/ca/ca.cnf deleted file mode 100644 index 425a889..0000000 --- a/node_modules/bower/node_modules/bower-registry-client/node_modules/request/tests/ssl/ca/ca.cnf +++ /dev/null @@ -1,20 +0,0 @@ -[ req ] -default_bits = 1024 -days = 3650 -distinguished_name = req_distinguished_name -attributes = req_attributes -prompt = no -output_password = password - -[ req_distinguished_name ] -C = US -ST = CA -L = Oakland -O = request -OU = request Certificate Authority -CN = requestCA -emailAddress = mikeal@mikealrogers.com - -[ req_attributes ] -challengePassword = password challenge - diff --git a/node_modules/bower/node_modules/bower-registry-client/node_modules/request/tests/ssl/ca/ca.crl b/node_modules/bower/node_modules/bower-registry-client/node_modules/request/tests/ssl/ca/ca.crl deleted file mode 100644 index e69de29..0000000 diff --git a/node_modules/bower/node_modules/bower-registry-client/node_modules/request/tests/ssl/ca/ca.crt b/node_modules/bower/node_modules/bower-registry-client/node_modules/request/tests/ssl/ca/ca.crt deleted file mode 100644 index b4524e4..0000000 --- a/node_modules/bower/node_modules/bower-registry-client/node_modules/request/tests/ssl/ca/ca.crt +++ /dev/null @@ -1,17 +0,0 @@ ------BEGIN CERTIFICATE----- -MIICvTCCAiYCCQDn+P/MSbDsWjANBgkqhkiG9w0BAQUFADCBojELMAkGA1UEBhMC -VVMxCzAJBgNVBAgTAkNBMRAwDgYDVQQHEwdPYWtsYW5kMRAwDgYDVQQKEwdyZXF1 -ZXN0MSYwJAYDVQQLEx1yZXF1ZXN0IENlcnRpZmljYXRlIEF1dGhvcml0eTESMBAG -A1UEAxMJcmVxdWVzdENBMSYwJAYJKoZIhvcNAQkBFhdtaWtlYWxAbWlrZWFscm9n -ZXJzLmNvbTAeFw0xMjAzMDEyMjUwNTZaFw0yMjAyMjcyMjUwNTZaMIGiMQswCQYD -VQQGEwJVUzELMAkGA1UECBMCQ0ExEDAOBgNVBAcTB09ha2xhbmQxEDAOBgNVBAoT -B3JlcXVlc3QxJjAkBgNVBAsTHXJlcXVlc3QgQ2VydGlmaWNhdGUgQXV0aG9yaXR5 -MRIwEAYDVQQDEwlyZXF1ZXN0Q0ExJjAkBgkqhkiG9w0BCQEWF21pa2VhbEBtaWtl -YWxyb2dlcnMuY29tMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQC7t9pQUAK4 -5XJYTI6NrF0n3G2HZsfN+rPYSVzzL8SuVyb1tHXos+vbPm3NKI4E8X1yVAXU8CjJ -5SqXnp4DAypAhaseho81cbhk7LXUhFz78OvAa+OD+xTAEAnNQ8tGUr4VGyplEjfD -xsBVuqV2j8GPNTftr+drOCFlqfAgMrBn4wIDAQABMA0GCSqGSIb3DQEBBQUAA4GB -ADVdTlVAL45R+PACNS7Gs4o81CwSclukBu4FJbxrkd4xGQmurgfRrYYKjtqiopQm -D7ysRamS3HMN9/VKq2T7r3z1PMHPAy7zM4uoXbbaTKwlnX4j/8pGPn8Ca3qHXYlo -88L/OOPc6Di7i7qckS3HFbXQCTiULtxWmy97oEuTwrAj ------END CERTIFICATE----- diff --git a/node_modules/bower/node_modules/bower-registry-client/node_modules/request/tests/ssl/ca/ca.csr b/node_modules/bower/node_modules/bower-registry-client/node_modules/request/tests/ssl/ca/ca.csr deleted file mode 100644 index e48c56e..0000000 --- a/node_modules/bower/node_modules/bower-registry-client/node_modules/request/tests/ssl/ca/ca.csr +++ /dev/null @@ -1,13 +0,0 @@ ------BEGIN CERTIFICATE REQUEST----- -MIICBjCCAW8CAQAwgaIxCzAJBgNVBAYTAlVTMQswCQYDVQQIEwJDQTEQMA4GA1UE -BxMHT2FrbGFuZDEQMA4GA1UEChMHcmVxdWVzdDEmMCQGA1UECxMdcmVxdWVzdCBD -ZXJ0aWZpY2F0ZSBBdXRob3JpdHkxEjAQBgNVBAMTCXJlcXVlc3RDQTEmMCQGCSqG -SIb3DQEJARYXbWlrZWFsQG1pa2VhbHJvZ2Vycy5jb20wgZ8wDQYJKoZIhvcNAQEB -BQADgY0AMIGJAoGBALu32lBQArjlclhMjo2sXSfcbYdmx836s9hJXPMvxK5XJvW0 -deiz69s+bc0ojgTxfXJUBdTwKMnlKpeengMDKkCFqx6GjzVxuGTstdSEXPvw68Br -44P7FMAQCc1Dy0ZSvhUbKmUSN8PGwFW6pXaPwY81N+2v52s4IWWp8CAysGfjAgMB -AAGgIzAhBgkqhkiG9w0BCQcxFBMScGFzc3dvcmQgY2hhbGxlbmdlMA0GCSqGSIb3 -DQEBBQUAA4GBAGJO7grHeVHXetjHEK8urIxdnvfB2qeZeObz4GPKIkqUurjr0rfj -bA3EK1kDMR5aeQWR8RunixdM16Q6Ry0lEdLVWkdSwRN9dmirIHT9cypqnD/FYOia -SdezZ0lUzXgmJIwRYRwB1KSMMocIf52ll/xC2bEGg7/ZAEuAyAgcZV3X ------END CERTIFICATE REQUEST----- diff --git a/node_modules/bower/node_modules/bower-registry-client/node_modules/request/tests/ssl/ca/ca.key b/node_modules/bower/node_modules/bower-registry-client/node_modules/request/tests/ssl/ca/ca.key deleted file mode 100644 index a53e7f7..0000000 --- a/node_modules/bower/node_modules/bower-registry-client/node_modules/request/tests/ssl/ca/ca.key +++ /dev/null @@ -1,18 +0,0 @@ ------BEGIN RSA PRIVATE KEY----- -Proc-Type: 4,ENCRYPTED -DEK-Info: DES-EDE3-CBC,C8B5887048377F02 - -nyD5ZH0Wup2uWsDvurq5mKDaDrf8lvNn9w0SH/ZkVnfR1/bkwqrFriqJWvZNUG+q -nS0iBYczsWLJnbub9a1zLOTENWUKVD5uqbC3aGHhnoUTNSa27DONgP8gHOn6JgR+ -GAKo01HCSTiVT4LjkwN337QKHnMP2fTzg+IoC/CigvMcq09hRLwU1/guq0GJKGwH -gTxYNuYmQC4Tjh8vdS4liF+Ve/P3qPR2CehZrIOkDT8PHJBGQJRo4xGUIB7Tpk38 -VCk+UZ0JCS2coY8VkY/9tqFJp/ZnnQQVmaNbdRqg7ECKL+bXnNo7yjzmazPZmPe3 -/ShbE0+CTt7LrjCaQAxWbeDzqfo1lQfgN1LulTm8MCXpQaJpv7v1VhIhQ7afjMYb -4thW/ypHPiYS2YJCAkAVlua9Oxzzh1qJoh8Df19iHtpd79Q77X/qf+1JvITlMu0U -gi7yEatmQcmYNws1mtTC1q2DXrO90c+NZ0LK/Alse6NRL/xiUdjug2iHeTf/idOR -Gg/5dSZbnnlj1E5zjSMDkzg6EHAFmHV4jYGSAFLEQgp4V3ZhMVoWZrvvSHgKV/Qh -FqrAK4INr1G2+/QTd09AIRzfy3/j6yD4A9iNaOsEf9Ua7Qh6RcALRCAZTWR5QtEf -dX+iSNJ4E85qXs0PqwkMDkoaxIJ+tmIRJY7y8oeylV8cfGAi8Soubt/i3SlR8IHC -uDMas/2OnwafK3N7ODeE1i7r7wkzQkSHaEz0TrF8XRnP25jAICCSLiMdAAjKfxVb -EvzsFSuAy3Jt6bU3hSLY9o4YVYKE+68ITMv9yNjvTsEiW+T+IbN34w== ------END RSA PRIVATE KEY----- diff --git a/node_modules/bower/node_modules/bower-registry-client/node_modules/request/tests/ssl/ca/ca.srl b/node_modules/bower/node_modules/bower-registry-client/node_modules/request/tests/ssl/ca/ca.srl deleted file mode 100644 index 17128db..0000000 --- a/node_modules/bower/node_modules/bower-registry-client/node_modules/request/tests/ssl/ca/ca.srl +++ /dev/null @@ -1 +0,0 @@ -ADF62016AA40C9C3 diff --git a/node_modules/bower/node_modules/bower-registry-client/node_modules/request/tests/ssl/ca/server.cnf b/node_modules/bower/node_modules/bower-registry-client/node_modules/request/tests/ssl/ca/server.cnf deleted file mode 100644 index cd1fd1e..0000000 --- a/node_modules/bower/node_modules/bower-registry-client/node_modules/request/tests/ssl/ca/server.cnf +++ /dev/null @@ -1,19 +0,0 @@ -[ req ] -default_bits = 1024 -days = 3650 -distinguished_name = req_distinguished_name -attributes = req_attributes -prompt = no - -[ req_distinguished_name ] -C = US -ST = CA -L = Oakland -O = request -OU = testing -CN = testing.request.mikealrogers.com -emailAddress = mikeal@mikealrogers.com - -[ req_attributes ] -challengePassword = password challenge - diff --git a/node_modules/bower/node_modules/bower-registry-client/node_modules/request/tests/ssl/ca/server.crt b/node_modules/bower/node_modules/bower-registry-client/node_modules/request/tests/ssl/ca/server.crt deleted file mode 100644 index efe96ce..0000000 --- a/node_modules/bower/node_modules/bower-registry-client/node_modules/request/tests/ssl/ca/server.crt +++ /dev/null @@ -1,16 +0,0 @@ ------BEGIN CERTIFICATE----- -MIICejCCAeMCCQCt9iAWqkDJwzANBgkqhkiG9w0BAQUFADCBojELMAkGA1UEBhMC -VVMxCzAJBgNVBAgTAkNBMRAwDgYDVQQHEwdPYWtsYW5kMRAwDgYDVQQKEwdyZXF1 -ZXN0MSYwJAYDVQQLEx1yZXF1ZXN0IENlcnRpZmljYXRlIEF1dGhvcml0eTESMBAG -A1UEAxMJcmVxdWVzdENBMSYwJAYJKoZIhvcNAQkBFhdtaWtlYWxAbWlrZWFscm9n -ZXJzLmNvbTAeFw0xMjAzMDEyMjUwNTZaFw0yMjAyMjcyMjUwNTZaMIGjMQswCQYD -VQQGEwJVUzELMAkGA1UECBMCQ0ExEDAOBgNVBAcTB09ha2xhbmQxEDAOBgNVBAoT -B3JlcXVlc3QxEDAOBgNVBAsTB3Rlc3RpbmcxKTAnBgNVBAMTIHRlc3RpbmcucmVx -dWVzdC5taWtlYWxyb2dlcnMuY29tMSYwJAYJKoZIhvcNAQkBFhdtaWtlYWxAbWlr -ZWFscm9nZXJzLmNvbTBcMA0GCSqGSIb3DQEBAQUAA0sAMEgCQQDgVl0jMumvOpmM -20W5v9yhGgZj8hPhEQF/N7yCBVBn/rWGYm70IHC8T/pR5c0LkWc5gdnCJEvKWQjh -DBKxZD8FAgMBAAEwDQYJKoZIhvcNAQEFBQADgYEABShRkNgFbgs4vUWW9R9deNJj -7HJoiTmvkmoOC7QzcYkjdgHbOxsSq3rBnwxsVjY9PAtPwBn0GRspOeG7KzKRgySB -kb22LyrCFKbEOfKO/+CJc80ioK9zEPVjGsFMyAB+ftYRqM+s/4cQlTg/m89l01wC -yapjN3RxZbInGhWR+jA= ------END CERTIFICATE----- diff --git a/node_modules/bower/node_modules/bower-registry-client/node_modules/request/tests/ssl/ca/server.csr b/node_modules/bower/node_modules/bower-registry-client/node_modules/request/tests/ssl/ca/server.csr deleted file mode 100644 index a8e7595..0000000 --- a/node_modules/bower/node_modules/bower-registry-client/node_modules/request/tests/ssl/ca/server.csr +++ /dev/null @@ -1,11 +0,0 @@ ------BEGIN CERTIFICATE REQUEST----- -MIIBgjCCASwCAQAwgaMxCzAJBgNVBAYTAlVTMQswCQYDVQQIEwJDQTEQMA4GA1UE -BxMHT2FrbGFuZDEQMA4GA1UEChMHcmVxdWVzdDEQMA4GA1UECxMHdGVzdGluZzEp -MCcGA1UEAxMgdGVzdGluZy5yZXF1ZXN0Lm1pa2VhbHJvZ2Vycy5jb20xJjAkBgkq -hkiG9w0BCQEWF21pa2VhbEBtaWtlYWxyb2dlcnMuY29tMFwwDQYJKoZIhvcNAQEB -BQADSwAwSAJBAOBWXSMy6a86mYzbRbm/3KEaBmPyE+ERAX83vIIFUGf+tYZibvQg -cLxP+lHlzQuRZzmB2cIkS8pZCOEMErFkPwUCAwEAAaAjMCEGCSqGSIb3DQEJBzEU -ExJwYXNzd29yZCBjaGFsbGVuZ2UwDQYJKoZIhvcNAQEFBQADQQBD3E5WekQzCEJw -7yOcqvtPYIxGaX8gRKkYfLPoj3pm3GF5SGqtJKhylKfi89szHXgktnQgzff9FN+A -HidVJ/3u ------END CERTIFICATE REQUEST----- diff --git a/node_modules/bower/node_modules/bower-registry-client/node_modules/request/tests/ssl/ca/server.js b/node_modules/bower/node_modules/bower-registry-client/node_modules/request/tests/ssl/ca/server.js deleted file mode 100644 index 05e21c1..0000000 --- a/node_modules/bower/node_modules/bower-registry-client/node_modules/request/tests/ssl/ca/server.js +++ /dev/null @@ -1,28 +0,0 @@ -var fs = require("fs") -var https = require("https") -var options = { key: fs.readFileSync("./server.key") - , cert: fs.readFileSync("./server.crt") } - -var server = https.createServer(options, function (req, res) { - res.writeHead(200) - res.end() - server.close() -}) -server.listen(1337) - -var ca = fs.readFileSync("./ca.crt") -var agent = new https.Agent({ host: "localhost", port: 1337, ca: ca }) - -https.request({ host: "localhost" - , method: "HEAD" - , port: 1337 - , headers: { host: "testing.request.mikealrogers.com" } - , agent: agent - , ca: [ ca ] - , path: "/" }, function (res) { - if (res.client.authorized) { - console.log("node test: OK") - } else { - throw new Error(res.client.authorizationError) - } -}).end() diff --git a/node_modules/bower/node_modules/bower-registry-client/node_modules/request/tests/ssl/ca/server.key b/node_modules/bower/node_modules/bower-registry-client/node_modules/request/tests/ssl/ca/server.key deleted file mode 100644 index 72d8698..0000000 --- a/node_modules/bower/node_modules/bower-registry-client/node_modules/request/tests/ssl/ca/server.key +++ /dev/null @@ -1,9 +0,0 @@ ------BEGIN RSA PRIVATE KEY----- -MIIBOwIBAAJBAOBWXSMy6a86mYzbRbm/3KEaBmPyE+ERAX83vIIFUGf+tYZibvQg -cLxP+lHlzQuRZzmB2cIkS8pZCOEMErFkPwUCAwEAAQJAK+r8ZM2sze8s7FRo/ApB -iRBtO9fCaIdJwbwJnXKo4RKwZDt1l2mm+fzZ+/QaQNjY1oTROkIIXmnwRvZWfYlW -gQIhAPKYsG+YSBN9o8Sdp1DMyZ/rUifKX3OE6q9tINkgajDVAiEA7Ltqh01+cnt0 -JEnud/8HHcuehUBLMofeg0G+gCnSbXECIQCqDvkXsWNNLnS/3lgsnvH0Baz4sbeJ -rjIpuVEeg8eM5QIgbu0+9JmOV6ybdmmiMV4yAncoF35R/iKGVHDZCAsQzDECIQDZ -0jGz22tlo5YMcYSqrdD3U4sds1pwiAaWFRbCunoUJw== ------END RSA PRIVATE KEY----- diff --git a/node_modules/bower/node_modules/bower-registry-client/node_modules/request/tests/ssl/npm-ca.crt b/node_modules/bower/node_modules/bower-registry-client/node_modules/request/tests/ssl/npm-ca.crt deleted file mode 100644 index fde2fe9..0000000 --- a/node_modules/bower/node_modules/bower-registry-client/node_modules/request/tests/ssl/npm-ca.crt +++ /dev/null @@ -1,16 +0,0 @@ ------BEGIN CERTIFICATE----- -MIIChzCCAfACCQDauvz/KHp8ejANBgkqhkiG9w0BAQUFADCBhzELMAkGA1UEBhMC -VVMxCzAJBgNVBAgTAkNBMRAwDgYDVQQHEwdPYWtsYW5kMQwwCgYDVQQKEwNucG0x -IjAgBgNVBAsTGW5wbSBDZXJ0aWZpY2F0ZSBBdXRob3JpdHkxDjAMBgNVBAMTBW5w -bUNBMRcwFQYJKoZIhvcNAQkBFghpQGl6cy5tZTAeFw0xMTA5MDUwMTQ3MTdaFw0y -MTA5MDIwMTQ3MTdaMIGHMQswCQYDVQQGEwJVUzELMAkGA1UECBMCQ0ExEDAOBgNV -BAcTB09ha2xhbmQxDDAKBgNVBAoTA25wbTEiMCAGA1UECxMZbnBtIENlcnRpZmlj -YXRlIEF1dGhvcml0eTEOMAwGA1UEAxMFbnBtQ0ExFzAVBgkqhkiG9w0BCQEWCGlA -aXpzLm1lMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDLI4tIqPpRW+ACw9GE -OgBlJZwK5f8nnKCLK629Pv5yJpQKs3DENExAyOgDcyaF0HD0zk8zTp+ZsLaNdKOz -Gn2U181KGprGKAXP6DU6ByOJDWmTlY6+Ad1laYT0m64fERSpHw/hjD3D+iX4aMOl -y0HdbT5m1ZGh6SJz3ZqxavhHLQIDAQABMA0GCSqGSIb3DQEBBQUAA4GBAC4ySDbC -l7W1WpLmtLGEQ/yuMLUf6Jy/vr+CRp4h+UzL+IQpCv8FfxsYE7dhf/bmWTEupBkv -yNL18lipt2jSvR3v6oAHAReotvdjqhxddpe5Holns6EQd1/xEZ7sB1YhQKJtvUrl -ZNufy1Jf1r0ldEGeA+0ISck7s+xSh9rQD2Op ------END CERTIFICATE----- diff --git a/node_modules/bower/node_modules/bower-registry-client/node_modules/request/tests/ssl/test.crt b/node_modules/bower/node_modules/bower-registry-client/node_modules/request/tests/ssl/test.crt deleted file mode 100644 index b357f86..0000000 --- a/node_modules/bower/node_modules/bower-registry-client/node_modules/request/tests/ssl/test.crt +++ /dev/null @@ -1,15 +0,0 @@ ------BEGIN CERTIFICATE----- -MIICQzCCAawCCQCO/XWtRFck1jANBgkqhkiG9w0BAQUFADBmMQswCQYDVQQGEwJU -SDEQMA4GA1UECBMHQmFuZ2tvazEOMAwGA1UEBxMFU2lsb20xGzAZBgNVBAoTElRo -ZSBSZXF1ZXN0IE1vZHVsZTEYMBYGA1UEAxMPcmVxdWVzdC5leGFtcGxlMB4XDTEx -MTIwMzAyMjkyM1oXDTIxMTEzMDAyMjkyM1owZjELMAkGA1UEBhMCVEgxEDAOBgNV -BAgTB0Jhbmdrb2sxDjAMBgNVBAcTBVNpbG9tMRswGQYDVQQKExJUaGUgUmVxdWVz -dCBNb2R1bGUxGDAWBgNVBAMTD3JlcXVlc3QuZXhhbXBsZTCBnzANBgkqhkiG9w0B -AQEFAAOBjQAwgYkCgYEAwmctddZqlA48+NXs0yOy92DijcQV1jf87zMiYAIlNUto -wghVbTWgJU5r0pdKrD16AptnWJTzKanhItEX8XCCPgsNkq1afgTtJP7rNkwu3xcj -eIMkhJg/ay4ZnkbnhYdsii5VTU5prix6AqWRAhbkBgoA+iVyHyof8wvZyKBoFTMC -AwEAATANBgkqhkiG9w0BAQUFAAOBgQB6BybMJbpeiABgihDfEVBcAjDoQ8gUMgwV -l4NulugfKTDmArqnR9aPd4ET5jX5dkMP4bwCHYsvrcYDeWEQy7x5WWuylOdKhua4 -L4cEi2uDCjqEErIG3cc1MCOk6Cl6Ld6tkIzQSf953qfdEACRytOeUqLNQcrXrqeE -c7U8F6MWLQ== ------END CERTIFICATE----- diff --git a/node_modules/bower/node_modules/bower-registry-client/node_modules/request/tests/ssl/test.key b/node_modules/bower/node_modules/bower-registry-client/node_modules/request/tests/ssl/test.key deleted file mode 100644 index b85810d..0000000 --- a/node_modules/bower/node_modules/bower-registry-client/node_modules/request/tests/ssl/test.key +++ /dev/null @@ -1,15 +0,0 @@ ------BEGIN RSA PRIVATE KEY----- -MIICXgIBAAKBgQDCZy111mqUDjz41ezTI7L3YOKNxBXWN/zvMyJgAiU1S2jCCFVt -NaAlTmvSl0qsPXoCm2dYlPMpqeEi0RfxcII+Cw2SrVp+BO0k/us2TC7fFyN4gySE -mD9rLhmeRueFh2yKLlVNTmmuLHoCpZECFuQGCgD6JXIfKh/zC9nIoGgVMwIDAQAB -AoGBALXFwfUf8vHTSmGlrdZS2AGFPvEtuvldyoxi9K5u8xmdFCvxnOcLsF2RsTHt -Mu5QYWhUpNJoG+IGLTPf7RJdj/kNtEs7xXqWy4jR36kt5z5MJzqiK+QIgiO9UFWZ -fjUb6oeDnTIJA9YFBdYi97MDuL89iU/UK3LkJN3hd4rciSbpAkEA+MCkowF5kSFb -rkOTBYBXZfiAG78itDXN6DXmqb9XYY+YBh3BiQM28oxCeQYyFy6pk/nstnd4TXk6 -V/ryA2g5NwJBAMgRKTY9KvxJWbESeMEFe2iBIV0c26/72Amgi7ZKUCLukLfD4tLF -+WSZdmTbbqI1079YtwaiOVfiLm45Q/3B0eUCQAaQ/0eWSGE+Yi8tdXoVszjr4GXb -G81qBi91DMu6U1It+jNfIba+MPsiHLcZJMVb4/oWBNukN7bD1nhwFWdlnu0CQQCf -Is9WHkdvz2RxbZDxb8verz/7kXXJQJhx5+rZf7jIYFxqX3yvTNv3wf2jcctJaWlZ -fVZwB193YSivcgt778xlAkEAprYUz3jczjF5r2hrgbizPzPDR94tM5BTO3ki2v3w -kbf+j2g7FNAx6kZiVN8XwfLc8xEeUGiPKwtq3ddPDFh17w== ------END RSA PRIVATE KEY----- diff --git a/node_modules/bower/node_modules/bower-registry-client/node_modules/request/tests/test-agentOptions.js b/node_modules/bower/node_modules/bower-registry-client/node_modules/request/tests/test-agentOptions.js deleted file mode 100644 index 47fe3aa..0000000 --- a/node_modules/bower/node_modules/bower-registry-client/node_modules/request/tests/test-agentOptions.js +++ /dev/null @@ -1,23 +0,0 @@ -var request = require('../index') - , http = require('http') - , server = require('./server') - , assert = require('assert') - ; - -var s = http.createServer(function (req, resp) { - resp.statusCode = 200 - resp.end('') -}).listen(6767, function () { - // requests without agentOptions should use global agent - var r = request('http://localhost:6767', function (e, resp, body) { - assert.deepEqual(r.agent, http.globalAgent); - assert.equal(Object.keys(r.pool).length, 0); - - // requests with agentOptions should apply agentOptions to new agent in pool - var r2 = request('http://localhost:6767', { agentOptions: { foo: 'bar' } }, function (e, resp, body) { - assert.deepEqual(r2.agent.options, { foo: 'bar' }); - assert.equal(Object.keys(r2.pool).length, 1); - s.close() - }); - }) -}) diff --git a/node_modules/bower/node_modules/bower-registry-client/node_modules/request/tests/test-basic-auth.js b/node_modules/bower/node_modules/bower-registry-client/node_modules/request/tests/test-basic-auth.js deleted file mode 100644 index 7cf1d6d..0000000 --- a/node_modules/bower/node_modules/bower-registry-client/node_modules/request/tests/test-basic-auth.js +++ /dev/null @@ -1,163 +0,0 @@ -var assert = require('assert') - , http = require('http') - , request = require('../index') - ; - -var numBasicRequests = 0; - -var basicServer = http.createServer(function (req, res) { - console.error('Basic auth server: ', req.method, req.url); - numBasicRequests++; - - var ok; - - if (req.headers.authorization) { - if (req.headers.authorization == 'Basic ' + new Buffer('test:testing2').toString('base64')) { - ok = true; - } else if ( req.headers.authorization == 'Basic ' + new Buffer(':apassword').toString('base64')) { - ok = true; - } else if ( req.headers.authorization == 'Basic ' + new Buffer('justauser').toString('base64')) { - ok = true; - } else { - // Bad auth header, don't send back WWW-Authenticate header - ok = false; - } - } else { - // No auth header, send back WWW-Authenticate header - ok = false; - res.setHeader('www-authenticate', 'Basic realm="Private"'); - } - - if (req.url == '/post/') { - var expectedContent = 'data_key=data_value'; - req.on('data', function(data) { - assert.equal(data, expectedContent); - console.log('received request data: ' + data); - }); - assert.equal(req.method, 'POST'); - assert.equal(req.headers['content-length'], '' + expectedContent.length); - assert.equal(req.headers['content-type'], 'application/x-www-form-urlencoded; charset=utf-8'); - } - - if (ok) { - console.log('request ok'); - res.end('ok'); - } else { - console.log('status=401'); - res.statusCode = 401; - res.end('401'); - } -}); - -basicServer.listen(6767); - -var tests = [ - function(next) { - request({ - 'method': 'GET', - 'uri': 'http://localhost:6767/test/', - 'auth': { - 'user': 'test', - 'pass': 'testing2', - 'sendImmediately': false - } - }, function(error, res, body) { - assert.equal(res.statusCode, 200); - assert.equal(numBasicRequests, 2); - next(); - }); - }, - - function(next) { - // If we don't set sendImmediately = false, request will send basic auth - request({ - 'method': 'GET', - 'uri': 'http://localhost:6767/test2/', - 'auth': { - 'user': 'test', - 'pass': 'testing2' - } - }, function(error, res, body) { - assert.equal(res.statusCode, 200); - assert.equal(numBasicRequests, 3); - next(); - }); - }, - - function(next) { - request({ - 'method': 'GET', - 'uri': 'http://test:testing2@localhost:6767/test2/' - }, function(error, res, body) { - assert.equal(res.statusCode, 200); - assert.equal(numBasicRequests, 4); - next(); - }); - }, - - function(next) { - request({ - 'method': 'POST', - 'form': { 'data_key': 'data_value' }, - 'uri': 'http://localhost:6767/post/', - 'auth': { - 'user': 'test', - 'pass': 'testing2', - 'sendImmediately': false - } - }, function(error, res, body) { - assert.equal(res.statusCode, 200); - assert.equal(numBasicRequests, 6); - next(); - }); - }, - - function(next) { - assert.doesNotThrow( function() { - request({ - 'method': 'GET', - 'uri': 'http://localhost:6767/allow_empty_user/', - 'auth': { - 'user': '', - 'pass': 'apassword', - 'sendImmediately': false - } - }, function(error, res, body ) { - assert.equal(res.statusCode, 200); - assert.equal(numBasicRequests, 8); - next(); - }); - }) - }, - - function(next) { - assert.doesNotThrow( function() { - request({ - 'method': 'GET', - 'uri': 'http://localhost:6767/allow_undefined_password/', - 'auth': { - 'user': 'justauser', - 'pass': undefined, - 'sendImmediately': false - } - }, function(error, res, body ) { - assert.equal(res.statusCode, 200); - assert.equal(numBasicRequests, 10); - next(); - }); - }) - } -]; - -function runTest(i) { - if (i < tests.length) { - tests[i](function() { - runTest(i + 1); - }); - } else { - console.log('All tests passed'); - basicServer.close(); - } -} - -runTest(0); diff --git a/node_modules/bower/node_modules/bower-registry-client/node_modules/request/tests/test-body.js b/node_modules/bower/node_modules/bower-registry-client/node_modules/request/tests/test-body.js deleted file mode 100644 index 186de12..0000000 --- a/node_modules/bower/node_modules/bower-registry-client/node_modules/request/tests/test-body.js +++ /dev/null @@ -1,122 +0,0 @@ -var server = require('./server') - , events = require('events') - , stream = require('stream') - , assert = require('assert') - , request = require('../index') - ; - -var s = server.createServer(); - -var tests = - { testGet : - { resp : server.createGetResponse("TESTING!") - , expectBody: "TESTING!" - } - , testGetChunkBreak : - { resp : server.createChunkResponse( - [ new Buffer([239]) - , new Buffer([163]) - , new Buffer([191]) - , new Buffer([206]) - , new Buffer([169]) - , new Buffer([226]) - , new Buffer([152]) - , new Buffer([131]) - ]) - , expectBody: "Ω☃" - } - , testGetBuffer : - { resp : server.createGetResponse(new Buffer("TESTING!")) - , encoding: null - , expectBody: new Buffer("TESTING!") - } - , testGetEncoding : - { resp : server.createGetResponse(new Buffer('efa3bfcea9e29883', 'hex')) - , encoding: 'hex' - , expectBody: "efa3bfcea9e29883" - } - , testGetUTF8: - { resp: server.createGetResponse(new Buffer([0xEF, 0xBB, 0xBF, 226, 152, 131])) - , encoding: "utf8" - , expectBody: "☃" - } - , testGetJSON : - { resp : server.createGetResponse('{"test":true}', 'application/json') - , json : true - , expectBody: {"test":true} - } - , testPutString : - { resp : server.createPostValidator("PUTTINGDATA") - , method : "PUT" - , body : "PUTTINGDATA" - } - , testPutBuffer : - { resp : server.createPostValidator("PUTTINGDATA") - , method : "PUT" - , body : new Buffer("PUTTINGDATA") - } - , testPutJSON : - { resp : server.createPostValidator(JSON.stringify({foo: 'bar'})) - , method: "PUT" - , json: {foo: 'bar'} - } - , testPutMultipart : - { resp: server.createPostValidator( - '--__BOUNDARY__\r\n' + - 'content-type: text/html\r\n' + - '\r\n' + - 'Oh hi.' + - '\r\n--__BOUNDARY__\r\n\r\n' + - 'Oh hi.' + - '\r\n--__BOUNDARY__--' - ) - , method: "PUT" - , multipart: - [ {'content-type': 'text/html', 'body': 'Oh hi.'} - , {'body': 'Oh hi.'} - ] - } - , testPutMultipartPreambleCRLF : - { resp: server.createPostValidator( - '\r\n--__BOUNDARY__\r\n' + - 'content-type: text/html\r\n' + - '\r\n' + - 'Oh hi.' + - '\r\n--__BOUNDARY__\r\n\r\n' + - 'Oh hi.' + - '\r\n--__BOUNDARY__--' - ) - , method: "PUT" - , preambleCRLF: true - , multipart: - [ {'content-type': 'text/html', 'body': 'Oh hi.'} - , {'body': 'Oh hi.'} - ] - } - } - -s.listen(s.port, function () { - - var counter = 0 - - for (i in tests) { - (function () { - var test = tests[i] - s.on('/'+i, test.resp) - test.uri = s.url + '/' + i - request(test, function (err, resp, body) { - if (err) throw err - if (test.expectBody) { - assert.deepEqual(test.expectBody, body) - } - counter = counter - 1; - if (counter === 0) { - console.log(Object.keys(tests).length+" tests passed.") - s.close() - } - }) - counter++ - })() - } -}) - diff --git a/node_modules/bower/node_modules/bower-registry-client/node_modules/request/tests/test-defaults.js b/node_modules/bower/node_modules/bower-registry-client/node_modules/request/tests/test-defaults.js deleted file mode 100644 index f6c4024..0000000 --- a/node_modules/bower/node_modules/bower-registry-client/node_modules/request/tests/test-defaults.js +++ /dev/null @@ -1,129 +0,0 @@ -var server = require('./server') - , assert = require('assert') - , request = require('../index') - ; - -var s = server.createServer(); - -s.listen(s.port, function () { - var counter = 0; - s.on('/get', function (req, resp) { - assert.equal(req.headers.foo, 'bar'); - assert.equal(req.method, 'GET') - resp.writeHead(200, {'Content-Type': 'text/plain'}); - resp.end('TESTING!'); - }); - - // test get(string, function) - request.defaults({headers:{foo:"bar"}})(s.url + '/get', function (e, r, b){ - if (e) throw e; - assert.deepEqual("TESTING!", b); - counter += 1; - }); - - s.on('/post', function (req, resp) { - assert.equal(req.headers.foo, 'bar'); - assert.equal(req.headers['content-type'], null); - assert.equal(req.method, 'POST') - resp.writeHead(200, {'Content-Type': 'application/json'}); - resp.end(JSON.stringify({foo:'bar'})); - }); - - // test post(string, object, function) - request.defaults({headers:{foo:"bar"}}).post(s.url + '/post', {json: true}, function (e, r, b){ - if (e) throw e; - assert.deepEqual('bar', b.foo); - counter += 1; - }); - - s.on('/patch', function (req, resp) { - assert.equal(req.headers.foo, 'bar'); - assert.equal(req.headers['content-type'], null); - assert.equal(req.method, 'PATCH') - resp.writeHead(200, {'Content-Type': 'application/json'}); - resp.end(JSON.stringify({foo:'bar'})); - }); - - // test post(string, object, function) - request.defaults({headers:{foo:"bar"}}).patch(s.url + '/patch', {json: true}, function (e, r, b){ - if (e) throw e; - assert.deepEqual('bar', b.foo); - counter += 1; - }); - - s.on('/post-body', function (req, resp) { - assert.equal(req.headers.foo, 'bar'); - assert.equal(req.headers['content-type'], 'application/json'); - assert.equal(req.method, 'POST') - resp.writeHead(200, {'Content-Type': 'application/json'}); - resp.end(JSON.stringify({foo:'bar'})); - }); - - // test post(string, object, function) with body - request.defaults({headers:{foo:"bar"}}).post(s.url + '/post-body', {json: true, body:{bar:"baz"}}, function (e, r, b){ - if (e) throw e; - assert.deepEqual('bar', b.foo); - counter += 1; - }); - - s.on('/del', function (req, resp) { - assert.equal(req.headers.foo, 'bar'); - assert.equal(req.method, 'DELETE') - resp.writeHead(200, {'Content-Type': 'application/json'}); - resp.end(JSON.stringify({foo:'bar'})); - }); - - // test .del(string, function) - request.defaults({headers:{foo:"bar"}, json:true}).del(s.url + '/del', function (e, r, b){ - if (e) throw e; - assert.deepEqual('bar', b.foo); - counter += 1; - }); - - s.on('/head', function (req, resp) { - assert.equal(req.headers.foo, 'bar'); - assert.equal(req.method, 'HEAD') - resp.writeHead(200, {'Content-Type': 'text/plain'}); - resp.end(); - }); - - // test head.(object, function) - request.defaults({headers:{foo:"bar"}}).head({uri: s.url + '/head'}, function (e, r, b){ - if (e) throw e; - counter += 1; - }); - - s.on('/get_custom', function(req, resp) { - assert.equal(req.headers.foo, 'bar'); - assert.equal(req.headers.x, 'y'); - resp.writeHead(200, {'Content-Type': 'text/plain'}); - resp.end(); - }); - - // test custom request handler function - var defaultRequest = request.defaults({ - headers:{foo:"bar"} - , body: 'TESTING!' - }, function(uri, options, callback) { - var params = request.initParams(uri, options, callback); - options = params.options; - options.headers.x = 'y'; - - return request(params.uri, params.options, params.callback); - }); - - var msg = 'defaults test failed. head request should throw earlier'; - assert.throws(function() { - defaultRequest.head(s.url + '/get_custom', function(e, r, b) { - throw new Error(msg); - }); - counter+=1; - }, msg); - - defaultRequest.get(s.url + '/get_custom', function(e, r, b) { - if(e) throw e; - counter += 1; - console.log(counter.toString() + " tests passed."); - s.close(); - }); -}) diff --git a/node_modules/bower/node_modules/bower-registry-client/node_modules/request/tests/test-digest-auth.js b/node_modules/bower/node_modules/bower-registry-client/node_modules/request/tests/test-digest-auth.js deleted file mode 100644 index 5f2d6eb..0000000 --- a/node_modules/bower/node_modules/bower-registry-client/node_modules/request/tests/test-digest-auth.js +++ /dev/null @@ -1,69 +0,0 @@ -var assert = require('assert') - , http = require('http') - , request = require('../index') - ; - -// Test digest auth -// Using header values captured from interaction with Apache - -var numDigestRequests = 0; - -var digestServer = http.createServer(function (req, res) { - console.error('Digest auth server: ', req.method, req.url); - numDigestRequests++; - - var ok; - - if (req.headers.authorization) { - if (req.headers.authorization == 'Digest username="test", realm="Private", nonce="WpcHS2/TBAA=dffcc0dbd5f96d49a5477166649b7c0ae3866a93", uri="/test/", qop="auth", response="54753ce37c10cb20b09b769f0bed730e", nc="1", cnonce=""') { - ok = true; - } else { - // Bad auth header, don't send back WWW-Authenticate header - ok = false; - } - } else { - // No auth header, send back WWW-Authenticate header - ok = false; - res.setHeader('www-authenticate', 'Digest realm="Private", nonce="WpcHS2/TBAA=dffcc0dbd5f96d49a5477166649b7c0ae3866a93", algorithm=MD5, qop="auth"'); - } - - if (ok) { - console.log('request ok'); - res.end('ok'); - } else { - console.log('status=401'); - res.statusCode = 401; - res.end('401'); - } -}); - -digestServer.listen(6767); - -request({ - 'method': 'GET', - 'uri': 'http://localhost:6767/test/', - 'auth': { - 'user': 'test', - 'pass': 'testing', - 'sendImmediately': false - } -}, function(error, response, body) { - assert.equal(response.statusCode, 200); - assert.equal(numDigestRequests, 2); - - // If we don't set sendImmediately = false, request will send basic auth - request({ - 'method': 'GET', - 'uri': 'http://localhost:6767/test/', - 'auth': { - 'user': 'test', - 'pass': 'testing' - } - }, function(error, response, body) { - assert.equal(response.statusCode, 401); - assert.equal(numDigestRequests, 3); - - console.log('All tests passed'); - digestServer.close(); - }); -}); diff --git a/node_modules/bower/node_modules/bower-registry-client/node_modules/request/tests/test-emptyBody.js b/node_modules/bower/node_modules/bower-registry-client/node_modules/request/tests/test-emptyBody.js deleted file mode 100644 index 338c92e..0000000 --- a/node_modules/bower/node_modules/bower-registry-client/node_modules/request/tests/test-emptyBody.js +++ /dev/null @@ -1,20 +0,0 @@ -var request = require('../index') - , http = require('http') - , assert = require('assert') - ; - -var s = http.createServer(function (req, resp) { - resp.statusCode = 200 - resp.end('') -}).listen(8080, function () { - var r = request('http://localhost:8080', function (e, resp, body) { - assert.equal(resp.statusCode, 200) - assert.equal(body, "") - - var r2 = request({ url: 'http://localhost:8080', json: {} }, function (e, resp, body) { - assert.equal(resp.statusCode, 200) - assert.equal(body, undefined) - s.close() - }); - }) -}) diff --git a/node_modules/bower/node_modules/bower-registry-client/node_modules/request/tests/test-errors.js b/node_modules/bower/node_modules/bower-registry-client/node_modules/request/tests/test-errors.js deleted file mode 100644 index 4df1302..0000000 --- a/node_modules/bower/node_modules/bower-registry-client/node_modules/request/tests/test-errors.js +++ /dev/null @@ -1,37 +0,0 @@ -var server = require('./server') - , events = require('events') - , assert = require('assert') - , request = require('../index') - ; - -var local = 'http://localhost:8888/asdf' - -try { - request({uri:local, body:{}}) - assert.fail("Should have throw") -} catch(e) { - assert.equal(e.message, 'Argument error, options.body.') -} - -try { - request({uri:local, multipart: 'foo'}) - assert.fail("Should have throw") -} catch(e) { - assert.equal(e.message, 'Argument error, options.multipart.') -} - -try { - request({uri:local, multipart: [{}]}) - assert.fail("Should have throw") -} catch(e) { - assert.equal(e.message, 'Body attribute missing in multipart.') -} - -try { - request(local, {multipart: [{}]}) - assert.fail("Should have throw") -} catch(e) { - assert.equal(e.message, 'Body attribute missing in multipart.') -} - -console.log("All tests passed.") diff --git a/node_modules/bower/node_modules/bower-registry-client/node_modules/request/tests/test-follow-all-303.js b/node_modules/bower/node_modules/bower-registry-client/node_modules/request/tests/test-follow-all-303.js deleted file mode 100644 index 956e386..0000000 --- a/node_modules/bower/node_modules/bower-registry-client/node_modules/request/tests/test-follow-all-303.js +++ /dev/null @@ -1,30 +0,0 @@ -var request = require('../index'); -var http = require('http'); -var requests = 0; -var assert = require('assert'); - -var server = http.createServer(function (req, res) { - console.error(req.method, req.url); - requests ++; - - if (req.method === 'POST') { - console.error('send 303'); - res.setHeader('location', req.url); - res.statusCode = 303; - res.end('try again, i guess\n'); - } else { - console.error('send 200') - res.end('ok: ' + requests); - } -}); -server.listen(6767); - -request.post({ url: 'http://localhost:6767/foo', - followAllRedirects: true, - form: { foo: 'bar' } }, function (er, req, body) { - if (er) throw er; - assert.equal(body, 'ok: 2'); - assert.equal(requests, 2); - console.error('ok - ' + process.version); - server.close(); -}); diff --git a/node_modules/bower/node_modules/bower-registry-client/node_modules/request/tests/test-follow-all.js b/node_modules/bower/node_modules/bower-registry-client/node_modules/request/tests/test-follow-all.js deleted file mode 100644 index f2e51ff..0000000 --- a/node_modules/bower/node_modules/bower-registry-client/node_modules/request/tests/test-follow-all.js +++ /dev/null @@ -1,36 +0,0 @@ -var request = require('../index'); -var http = require('http'); -var requests = 0; -var assert = require('assert'); - -var server = http.createServer(function (req, res) { - requests ++; - - // redirect everything 3 times, no matter what. - var c = req.headers.cookie; - - if (!c) c = 0; - else c = +c.split('=')[1] || 0; - - if (c > 3) { - res.end('ok: '+requests); - return; - } - - res.setHeader('set-cookie', 'c=' + (c + 1)); - res.setHeader('location', req.url); - res.statusCode = 302; - res.end('try again, i guess\n'); -}); -server.listen(6767); - -request.post({ url: 'http://localhost:6767/foo', - followAllRedirects: true, - jar: true, - form: { foo: 'bar' } }, function (er, req, body) { - if (er) throw er; - assert.equal(body, 'ok: 5'); - assert.equal(requests, 5); - console.error('ok - ' + process.version); - server.close(); -}); diff --git a/node_modules/bower/node_modules/bower-registry-client/node_modules/request/tests/test-form.js b/node_modules/bower/node_modules/bower-registry-client/node_modules/request/tests/test-form.js deleted file mode 100644 index 91b9230..0000000 --- a/node_modules/bower/node_modules/bower-registry-client/node_modules/request/tests/test-form.js +++ /dev/null @@ -1,79 +0,0 @@ -var assert = require('assert') -var http = require('http'); -var path = require('path'); -var mime = require('mime'); -var request = require('../index'); -var fs = require('fs'); - -var remoteFile = 'http://nodejs.org/images/logo.png'; - -var FIELDS = [ - {name: 'my_field', value: 'my_value'}, - {name: 'my_buffer', value: new Buffer([1, 2, 3])}, - {name: 'my_file', value: fs.createReadStream(__dirname + '/unicycle.jpg')}, - {name: 'remote_file', value: request(remoteFile) } -]; - -var server = http.createServer(function(req, res) { - - // temp workaround - var data = ''; - req.setEncoding('utf8'); - - req.on('data', function(d) { - data += d; - }); - - req.on('end', function() { - // check for the fields' traces - - // 1st field : my_field - var field = FIELDS.shift(); - assert.ok( data.indexOf('form-data; name="'+field.name+'"') != -1 ); - assert.ok( data.indexOf(field.value) != -1 ); - - // 2nd field : my_buffer - var field = FIELDS.shift(); - assert.ok( data.indexOf('form-data; name="'+field.name+'"') != -1 ); - assert.ok( data.indexOf(field.value) != -1 ); - - // 3rd field : my_file - var field = FIELDS.shift(); - assert.ok( data.indexOf('form-data; name="'+field.name+'"') != -1 ); - assert.ok( data.indexOf('; filename="'+path.basename(field.value.path)+'"') != -1 ); - // check for unicycle.jpg traces - assert.ok( data.indexOf('2005:06:21 01:44:12') != -1 ); - assert.ok( data.indexOf('Content-Type: '+mime.lookup(field.value.path) ) != -1 ); - - // 4th field : remote_file - var field = FIELDS.shift(); - assert.ok( data.indexOf('form-data; name="'+field.name+'"') != -1 ); - assert.ok( data.indexOf('; filename="'+path.basename(field.value.path)+'"') != -1 ); - // check for http://nodejs.org/images/logo.png traces - assert.ok( data.indexOf('ImageReady') != -1 ); - assert.ok( data.indexOf('Content-Type: '+mime.lookup(remoteFile) ) != -1 ); - - res.writeHead(200); - res.end('done'); - - }); - - -}); - -server.listen(8080, function() { - - var req = request.post('http://localhost:8080/upload', function () { - server.close(); - }) - var form = req.form() - - FIELDS.forEach(function(field) { - form.append(field.name, field.value); - }); - -}); - -process.on('exit', function() { - assert.strictEqual(FIELDS.length, 0); -}); diff --git a/node_modules/bower/node_modules/bower-registry-client/node_modules/request/tests/test-hawk.js b/node_modules/bower/node_modules/bower-registry-client/node_modules/request/tests/test-hawk.js deleted file mode 100755 index 8454625..0000000 --- a/node_modules/bower/node_modules/bower-registry-client/node_modules/request/tests/test-hawk.js +++ /dev/null @@ -1,33 +0,0 @@ -var createServer = require('http').createServer - , request = require('../index') - , hawk = require('hawk') - , assert = require('assert') - ; - -var server = createServer(function (req, resp) { - - var getCred = function (id, callback) { - assert.equal(id, 'dh37fgj492je') - var credentials = - { key: 'werxhqb98rpaxn39848xrunpaw3489ruxnpa98w4rxn' - , algorithm: 'sha256' - , user: 'Steve' - } - return callback(null, credentials) - } - - hawk.server.authenticate(req, getCred, {}, function (err, credentials, attributes) { - resp.writeHead(!err ? 200 : 401, { 'Content-Type': 'text/plain' }) - resp.end(!err ? 'Hello ' + credentials.user : 'Shoosh!') - }) - -}) - -server.listen(8080, function () { - var creds = {key: 'werxhqb98rpaxn39848xrunpaw3489ruxnpa98w4rxn', algorithm: 'sha256', id:'dh37fgj492je'} - request('http://localhost:8080', {hawk:{credentials:creds}}, function (e, r, b) { - assert.equal(200, r.statusCode) - assert.equal(b, 'Hello Steve') - server.close() - }) -}) \ No newline at end of file diff --git a/node_modules/bower/node_modules/bower-registry-client/node_modules/request/tests/test-headers.js b/node_modules/bower/node_modules/bower-registry-client/node_modules/request/tests/test-headers.js deleted file mode 100644 index 3982b9b..0000000 --- a/node_modules/bower/node_modules/bower-registry-client/node_modules/request/tests/test-headers.js +++ /dev/null @@ -1,52 +0,0 @@ -var server = require('./server') - , assert = require('assert') - , request = require('../index') - , Cookie = require('cookie-jar') - , Jar = Cookie.Jar - , s = server.createServer() - -s.listen(s.port, function () { - var serverUri = 'http://localhost:' + s.port - , numTests = 0 - , numOutstandingTests = 0 - - function createTest(requestObj, serverAssertFn) { - var testNumber = numTests; - numTests += 1; - numOutstandingTests += 1; - s.on('/' + testNumber, function (req, res) { - serverAssertFn(req, res); - res.writeHead(200); - res.end(); - }); - requestObj.url = serverUri + '/' + testNumber - request(requestObj, function (err, res, body) { - assert.ok(!err) - assert.equal(res.statusCode, 200) - numOutstandingTests -= 1 - if (numOutstandingTests === 0) { - console.log(numTests + ' tests passed.') - s.close() - } - }) - } - - // Issue #125: headers.cookie shouldn't be replaced when a cookie jar isn't specified - createTest({headers: {cookie: 'foo=bar'}}, function (req, res) { - assert.ok(req.headers.cookie) - assert.equal(req.headers.cookie, 'foo=bar') - }) - - // Issue #125: headers.cookie + cookie jar - var jar = new Jar() - jar.add(new Cookie('quux=baz')); - createTest({jar: jar, headers: {cookie: 'foo=bar'}}, function (req, res) { - assert.ok(req.headers.cookie) - assert.equal(req.headers.cookie, 'foo=bar; quux=baz') - }) - - // There should be no cookie header when neither headers.cookie nor a cookie jar is specified - createTest({}, function (req, res) { - assert.ok(!req.headers.cookie) - }) -}) diff --git a/node_modules/bower/node_modules/bower-registry-client/node_modules/request/tests/test-http-signature.js b/node_modules/bower/node_modules/bower-registry-client/node_modules/request/tests/test-http-signature.js deleted file mode 100755 index 9300473..0000000 --- a/node_modules/bower/node_modules/bower-registry-client/node_modules/request/tests/test-http-signature.js +++ /dev/null @@ -1,106 +0,0 @@ -var createServer = require('http').createServer - , request = require('../index') - , httpSignature = require('http-signature') - , assert = require('assert') - ; - -var privateKeyPEMs = {} - -privateKeyPEMs['key-1'] = - '-----BEGIN RSA PRIVATE KEY-----\n' + - 'MIIEpAIBAAKCAQEAzWSJl+Z9Bqv00FVL5N3+JCUoqmQPjIlya1BbeqQroNQ5yG1i\n' + - 'VbYTTnMRa1zQtR6r2fNvWeg94DvxivxIG9diDMnrzijAnYlTLOl84CK2vOxkj5b6\n' + - '8zrLH9b/Gd6NOHsywo8IjvXvCeTfca5WUHcuVi2lT9VjygFs1ILG4RyeX1BXUumu\n' + - 'Y8fzmposxLYdMxCqUTzAn0u9Saq2H2OVj5u114wS7OQPigu6G99dpn/iPHa3zBm8\n' + - '7baBWDbqZWRW0BP3K6eqq8sut1+NLhNW8ADPTdnO/SO+kvXy7fqd8atSn+HlQcx6\n' + - 'tW42dhXf3E9uE7K78eZtW0KvfyNGAjsI1Fft2QIDAQABAoIBAG1exe3/LEBrPLfb\n' + - 'U8iRdY0lxFvHYIhDgIwohC3wUdMYb5SMurpNdEZn+7Sh/fkUVgp/GKJViu1mvh52\n' + - 'bKd2r52DwG9NQBQjVgkqY/auRYSglIPpr8PpYNSZlcneunCDGeqEY9hMmXc5Ssqs\n' + - 'PQYoEKKPN+IlDTg6PguDgAfLR4IUvt9KXVvmB/SSgV9tSeTy35LECt1Lq3ozbUgu\n' + - '30HZI3U6/7H+X22Pxxf8vzBtzkg5rRCLgv+OeNPo16xMnqbutt4TeqEkxRv5rtOo\n' + - '/A1i9khBeki0OJAFJsE82qnaSZodaRsxic59VnN8sWBwEKAt87tEu5A3K3j4XSDU\n' + - '/avZxAECgYEA+pS3DvpiQLtHlaO3nAH6MxHRrREOARXWRDe5nUQuUNpS1xq9wte6\n' + - 'DkFtba0UCvDLic08xvReTCbo9kH0y6zEy3zMpZuJlKbcWCkZf4S5miYPI0RTZtF8\n' + - 'yps6hWqzYFSiO9hMYws9k4OJLxX0x3sLK7iNZ32ujcSrkPBSiBr0gxkCgYEA0dWl\n' + - '637K41AJ/zy0FP0syq+r4eIkfqv+/t6y2aQVUBvxJYrj9ci6XHBqoxpDV8lufVYj\n' + - 'fUAfeI9/MZaWvQJRbnYLre0I6PJfLuCBIL5eflO77BGso165AF7QJZ+fwtgKv3zv\n' + - 'ZX75eudCSS/cFo0po9hlbcLMT4B82zEkgT8E2MECgYEAnz+3/wrdOmpLGiyL2dff\n' + - '3GjsqmJ2VfY8z+niSrI0BSpbD11tT9Ct67VlCBjA7hsOH6uRfpd6/kaUMzzDiFVq\n' + - 'VDAiFvV8QD6zNkwYalQ9aFvbrvwTTPrBpjl0vamMCiJ/YC0cjq1sGr2zh3sar1Ph\n' + - 'S43kP+s97dcZeelhaiJHVrECgYEAsx61q/loJ/LDFeYzs1cLTVn4V7I7hQY9fkOM\n' + - 'WM0AhInVqD6PqdfXfeFYpjJdGisQ7l0BnoGGW9vir+nkcyPvb2PFRIr6+B8tsU5j\n' + - '7BeVgjDoUfQkcrEBK5fEBtnj/ud9BUkY8oMZZBjVNLRuI7IMwZiPvMp0rcj4zAN/\n' + - 'LfUlpgECgYArBvFcBxSkNAzR3Rtteud1YDboSKluRM37Ey5plrn4BS0DD0jm++aD\n' + - '0pG2Hsik000hibw92lCkzvvBVAqF8BuAcnPlAeYfsOaa97PGEjSKEN5bJVWZ9/om\n' + - '9FV1axotRN2XWlwrhixZLEaagkREXhgQc540FS5O8IaI2Vpa80Atzg==\n' + - '-----END RSA PRIVATE KEY-----' - -var publicKeyPEMs = {} - -publicKeyPEMs['key-1'] = - '-----BEGIN PUBLIC KEY-----\n' + - 'MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAzWSJl+Z9Bqv00FVL5N3+\n' + - 'JCUoqmQPjIlya1BbeqQroNQ5yG1iVbYTTnMRa1zQtR6r2fNvWeg94DvxivxIG9di\n' + - 'DMnrzijAnYlTLOl84CK2vOxkj5b68zrLH9b/Gd6NOHsywo8IjvXvCeTfca5WUHcu\n' + - 'Vi2lT9VjygFs1ILG4RyeX1BXUumuY8fzmposxLYdMxCqUTzAn0u9Saq2H2OVj5u1\n' + - '14wS7OQPigu6G99dpn/iPHa3zBm87baBWDbqZWRW0BP3K6eqq8sut1+NLhNW8ADP\n' + - 'TdnO/SO+kvXy7fqd8atSn+HlQcx6tW42dhXf3E9uE7K78eZtW0KvfyNGAjsI1Fft\n' + - '2QIDAQAB\n' + - '-----END PUBLIC KEY-----' - -publicKeyPEMs['key-2'] = - '-----BEGIN PUBLIC KEY-----\n' + - 'MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAqp04VVr9OThli9b35Omz\n' + - 'VqSfWbsoQuRrgyWsrNRn3XkFmbWw4FzZwQ42OgGMzQ84Ta4d9zGKKQyFriTiPjPf\n' + - 'xhhrsaJnDuybcpVhcr7UNKjSZ0S59tU3hpRiEz6hO+Nc/OSSLkvalG0VKrxOln7J\n' + - 'LK/h3rNS/l6wDZ5S/KqsI6CYtV2ZLpn3ahLrizvEYNY038Qcm38qMWx+VJAvZ4di\n' + - 'qqmW7RLIsLT59SWmpXdhFKnkYYGhxrk1Mwl22dBTJNY5SbriU5G3gWgzYkm8pgHr\n' + - '6CtrXch9ciJAcDJehPrKXNvNDOdUh8EW3fekNJerF1lWcwQg44/12v8sDPyfbaKB\n' + - 'dQIDAQAB\n' + - '-----END PUBLIC KEY-----' - -var server = createServer(function (req, res) { - var parsed = httpSignature.parseRequest(req) - var publicKeyPEM = publicKeyPEMs[parsed.keyId] - var verified = httpSignature.verifySignature(parsed, publicKeyPEM) - res.writeHead(verified ? 200 : 400) - res.end() -}) - -server.listen(8080, function () { - function correctKeyTest(callback) { - var options = { - httpSignature: { - keyId: 'key-1', - key: privateKeyPEMs['key-1'] - } - } - request('http://localhost:8080', options, function (e, r, b) { - assert.equal(200, r.statusCode) - callback() - }) - } - - function incorrectKeyTest(callback) { - var options = { - httpSignature: { - keyId: 'key-2', - key: privateKeyPEMs['key-1'] - } - } - request('http://localhost:8080', options, function (e, r, b) { - assert.equal(400, r.statusCode) - callback() - }) - } - - var tests = [correctKeyTest, incorrectKeyTest] - var todo = tests.length; - for(var i = 0; i < tests.length; ++i) { - tests[i](function() { - if(!--todo) { - server.close() - } - }) - } -}) diff --git a/node_modules/bower/node_modules/bower-registry-client/node_modules/request/tests/test-httpModule.js b/node_modules/bower/node_modules/bower-registry-client/node_modules/request/tests/test-httpModule.js deleted file mode 100644 index 2c19615..0000000 --- a/node_modules/bower/node_modules/bower-registry-client/node_modules/request/tests/test-httpModule.js +++ /dev/null @@ -1,94 +0,0 @@ -var http = require('http') - , https = require('https') - , server = require('./server') - , assert = require('assert') - , request = require('../index') - - -var faux_requests_made = {'http':0, 'https':0} -function wrap_request(name, module) { - // Just like the http or https module, but note when a request is made. - var wrapped = {} - Object.keys(module).forEach(function(key) { - var value = module[key]; - - if(key != 'request') - wrapped[key] = value; - else - wrapped[key] = function(options, callback) { - faux_requests_made[name] += 1 - return value.apply(this, arguments) - } - }) - - return wrapped; -} - - -var faux_http = wrap_request('http', http) - , faux_https = wrap_request('https', https) - , plain_server = server.createServer() - , https_server = server.createSSLServer() - - -plain_server.listen(plain_server.port, function() { - plain_server.on('/plain', function (req, res) { - res.writeHead(200) - res.end('plain') - }) - plain_server.on('/to_https', function (req, res) { - res.writeHead(301, {'location':'https://localhost:'+https_server.port + '/https'}) - res.end() - }) - - https_server.listen(https_server.port, function() { - https_server.on('/https', function (req, res) { - res.writeHead(200) - res.end('https') - }) - https_server.on('/to_plain', function (req, res) { - res.writeHead(302, {'location':'http://localhost:'+plain_server.port + '/plain'}) - res.end() - }) - - run_tests() - run_tests({}) - run_tests({'http:':faux_http}) - run_tests({'https:':faux_https}) - run_tests({'http:':faux_http, 'https:':faux_https}) - }) -}) - -function run_tests(httpModules) { - var to_https = 'http://localhost:'+plain_server.port+'/to_https' - var to_plain = 'https://localhost:'+https_server.port+'/to_plain' - - request(to_https, {'httpModules':httpModules, strictSSL:false}, function (er, res, body) { - if (er) throw er - assert.equal(body, 'https', 'Received HTTPS server body') - done() - }) - - request(to_plain, {'httpModules':httpModules, strictSSL:false}, function (er, res, body) { - if (er) throw er - assert.equal(body, 'plain', 'Received HTTPS server body') - done() - }) -} - - -var passed = 0; -function done() { - passed += 1 - var expected = 10 - - if(passed == expected) { - plain_server.close() - https_server.close() - - assert.equal(faux_requests_made.http, 4, 'Wrapped http module called appropriately') - assert.equal(faux_requests_made.https, 4, 'Wrapped https module called appropriately') - - console.log((expected+2) + ' tests passed.') - } -} diff --git a/node_modules/bower/node_modules/bower-registry-client/node_modules/request/tests/test-https-strict.js b/node_modules/bower/node_modules/bower-registry-client/node_modules/request/tests/test-https-strict.js deleted file mode 100644 index d49a9af..0000000 --- a/node_modules/bower/node_modules/bower-registry-client/node_modules/request/tests/test-https-strict.js +++ /dev/null @@ -1,97 +0,0 @@ -// a test where we validate the siguature of the keys -// otherwise exactly the same as the ssl test - -var server = require('./server') - , assert = require('assert') - , request = require('../index') - , fs = require('fs') - , path = require('path') - , opts = { key: path.resolve(__dirname, 'ssl/ca/server.key') - , cert: path.resolve(__dirname, 'ssl/ca/server.crt') } - , s = server.createSSLServer(null, opts) - , caFile = path.resolve(__dirname, 'ssl/ca/ca.crt') - , ca = fs.readFileSync(caFile) - -var tests = - { testGet : - { resp : server.createGetResponse("TESTING!") - , expectBody: "TESTING!" - } - , testGetChunkBreak : - { resp : server.createChunkResponse( - [ new Buffer([239]) - , new Buffer([163]) - , new Buffer([191]) - , new Buffer([206]) - , new Buffer([169]) - , new Buffer([226]) - , new Buffer([152]) - , new Buffer([131]) - ]) - , expectBody: "Ω☃" - } - , testGetJSON : - { resp : server.createGetResponse('{"test":true}', 'application/json') - , json : true - , expectBody: {"test":true} - } - , testPutString : - { resp : server.createPostValidator("PUTTINGDATA") - , method : "PUT" - , body : "PUTTINGDATA" - } - , testPutBuffer : - { resp : server.createPostValidator("PUTTINGDATA") - , method : "PUT" - , body : new Buffer("PUTTINGDATA") - } - , testPutJSON : - { resp : server.createPostValidator(JSON.stringify({foo: 'bar'})) - , method: "PUT" - , json: {foo: 'bar'} - } - , testPutMultipart : - { resp: server.createPostValidator( - '--__BOUNDARY__\r\n' + - 'content-type: text/html\r\n' + - '\r\n' + - 'Oh hi.' + - '\r\n--__BOUNDARY__\r\n\r\n' + - 'Oh hi.' + - '\r\n--__BOUNDARY__--' - ) - , method: "PUT" - , multipart: - [ {'content-type': 'text/html', 'body': 'Oh hi.'} - , {'body': 'Oh hi.'} - ] - } - } - -s.listen(s.port, function () { - - var counter = 0 - - for (i in tests) { - (function () { - var test = tests[i] - s.on('/'+i, test.resp) - test.uri = s.url + '/' + i - test.strictSSL = true - test.ca = ca - test.headers = { host: 'testing.request.mikealrogers.com' } - request(test, function (err, resp, body) { - if (err) throw err - if (test.expectBody) { - assert.deepEqual(test.expectBody, body) - } - counter = counter - 1; - if (counter === 0) { - console.log(Object.keys(tests).length+" tests passed.") - s.close() - } - }) - counter++ - })() - } -}) diff --git a/node_modules/bower/node_modules/bower-registry-client/node_modules/request/tests/test-https.js b/node_modules/bower/node_modules/bower-registry-client/node_modules/request/tests/test-https.js deleted file mode 100644 index b6858d4..0000000 --- a/node_modules/bower/node_modules/bower-registry-client/node_modules/request/tests/test-https.js +++ /dev/null @@ -1,87 +0,0 @@ -var server = require('./server') - , assert = require('assert') - , request = require('../index') - -var s = server.createSSLServer(); - -var tests = - { testGet : - { resp : server.createGetResponse("TESTING!") - , expectBody: "TESTING!" - } - , testGetChunkBreak : - { resp : server.createChunkResponse( - [ new Buffer([239]) - , new Buffer([163]) - , new Buffer([191]) - , new Buffer([206]) - , new Buffer([169]) - , new Buffer([226]) - , new Buffer([152]) - , new Buffer([131]) - ]) - , expectBody: "Ω☃" - } - , testGetJSON : - { resp : server.createGetResponse('{"test":true}', 'application/json') - , json : true - , expectBody: {"test":true} - } - , testPutString : - { resp : server.createPostValidator("PUTTINGDATA") - , method : "PUT" - , body : "PUTTINGDATA" - } - , testPutBuffer : - { resp : server.createPostValidator("PUTTINGDATA") - , method : "PUT" - , body : new Buffer("PUTTINGDATA") - } - , testPutJSON : - { resp : server.createPostValidator(JSON.stringify({foo: 'bar'})) - , method: "PUT" - , json: {foo: 'bar'} - } - , testPutMultipart : - { resp: server.createPostValidator( - '--__BOUNDARY__\r\n' + - 'content-type: text/html\r\n' + - '\r\n' + - 'Oh hi.' + - '\r\n--__BOUNDARY__\r\n\r\n' + - 'Oh hi.' + - '\r\n--__BOUNDARY__--' - ) - , method: "PUT" - , multipart: - [ {'content-type': 'text/html', 'body': 'Oh hi.'} - , {'body': 'Oh hi.'} - ] - } - } - -s.listen(s.port, function () { - - var counter = 0 - - for (i in tests) { - (function () { - var test = tests[i] - s.on('/'+i, test.resp) - test.uri = s.url + '/' + i - test.rejectUnauthorized = false - request(test, function (err, resp, body) { - if (err) throw err - if (test.expectBody) { - assert.deepEqual(test.expectBody, body) - } - counter = counter - 1; - if (counter === 0) { - console.log(Object.keys(tests).length+" tests passed.") - s.close() - } - }) - counter++ - })() - } -}) diff --git a/node_modules/bower/node_modules/bower-registry-client/node_modules/request/tests/test-isUrl.js b/node_modules/bower/node_modules/bower-registry-client/node_modules/request/tests/test-isUrl.js deleted file mode 100644 index 4a51ad0..0000000 --- a/node_modules/bower/node_modules/bower-registry-client/node_modules/request/tests/test-isUrl.js +++ /dev/null @@ -1,28 +0,0 @@ -var assert = require('assert') - , request = require('../index') - , http = require('http') - ; - -var s = http.createServer(function(req, res) { - res.statusCode = 200; - res.end(''); -}).listen(6767, function () { - - // Test lowercase - request('http://localhost:6767', function (err, resp, body) { - // just need to get here without throwing an error - assert.equal(true, true); - }) - - // Test uppercase - request('HTTP://localhost:6767', function (err, resp, body) { - assert.equal(true, true); - }) - - // Test mixedcase - request('HtTp://localhost:6767', function (err, resp, body) { - assert.equal(true, true); - // clean up - s.close(); - }) -}) \ No newline at end of file diff --git a/node_modules/bower/node_modules/bower-registry-client/node_modules/request/tests/test-localAddress.js b/node_modules/bower/node_modules/bower-registry-client/node_modules/request/tests/test-localAddress.js deleted file mode 100644 index 11a1bd1..0000000 --- a/node_modules/bower/node_modules/bower-registry-client/node_modules/request/tests/test-localAddress.js +++ /dev/null @@ -1,15 +0,0 @@ -var request = require('../index') - , assert = require('assert') - ; - -request.get({ - uri: 'http://www.google.com', localAddress: '1.2.3.4' // some invalid address -}, function(err, res) { - assert(!res) // asserting that no response received -}) - -request.get({ - uri: 'http://www.google.com', localAddress: '127.0.0.1' -}, function(err, res) { - assert(!res) // asserting that no response received -}) diff --git a/node_modules/bower/node_modules/bower-registry-client/node_modules/request/tests/test-oauth.js b/node_modules/bower/node_modules/bower-registry-client/node_modules/request/tests/test-oauth.js deleted file mode 100644 index 3269483..0000000 --- a/node_modules/bower/node_modules/bower-registry-client/node_modules/request/tests/test-oauth.js +++ /dev/null @@ -1,117 +0,0 @@ -var hmacsign = require('oauth-sign').hmacsign - , assert = require('assert') - , qs = require('querystring') - , request = require('../index') - ; - -function getsignature (r) { - var sign - r.headers.Authorization.slice('OAuth '.length).replace(/,\ /g, ',').split(',').forEach(function (v) { - if (v.slice(0, 'oauth_signature="'.length) === 'oauth_signature="') sign = v.slice('oauth_signature="'.length, -1) - }) - return decodeURIComponent(sign) -} - -// Tests from Twitter documentation https://dev.twitter.com/docs/auth/oauth - -var reqsign = hmacsign('POST', 'https://api.twitter.com/oauth/request_token', - { oauth_callback: 'http://localhost:3005/the_dance/process_callback?service_provider_id=11' - , oauth_consumer_key: 'GDdmIQH6jhtmLUypg82g' - , oauth_nonce: 'QP70eNmVz8jvdPevU3oJD2AfF7R7odC2XJcn4XlZJqk' - , oauth_signature_method: 'HMAC-SHA1' - , oauth_timestamp: '1272323042' - , oauth_version: '1.0' - }, "MCD8BKwGdgPHvAuvgvz4EQpqDAtx89grbuNMRd7Eh98") - -console.log(reqsign) -console.log('8wUi7m5HFQy76nowoCThusfgB+Q=') -assert.equal(reqsign, '8wUi7m5HFQy76nowoCThusfgB+Q=') - -var accsign = hmacsign('POST', 'https://api.twitter.com/oauth/access_token', - { oauth_consumer_key: 'GDdmIQH6jhtmLUypg82g' - , oauth_nonce: '9zWH6qe0qG7Lc1telCn7FhUbLyVdjEaL3MO5uHxn8' - , oauth_signature_method: 'HMAC-SHA1' - , oauth_token: '8ldIZyxQeVrFZXFOZH5tAwj6vzJYuLQpl0WUEYtWc' - , oauth_timestamp: '1272323047' - , oauth_verifier: 'pDNg57prOHapMbhv25RNf75lVRd6JDsni1AJJIDYoTY' - , oauth_version: '1.0' - }, "MCD8BKwGdgPHvAuvgvz4EQpqDAtx89grbuNMRd7Eh98", "x6qpRnlEmW9JbQn4PQVVeVG8ZLPEx6A0TOebgwcuA") - -console.log(accsign) -console.log('PUw/dHA4fnlJYM6RhXk5IU/0fCc=') -assert.equal(accsign, 'PUw/dHA4fnlJYM6RhXk5IU/0fCc=') - -var upsign = hmacsign('POST', 'http://api.twitter.com/1/statuses/update.json', - { oauth_consumer_key: "GDdmIQH6jhtmLUypg82g" - , oauth_nonce: "oElnnMTQIZvqvlfXM56aBLAf5noGD0AQR3Fmi7Q6Y" - , oauth_signature_method: "HMAC-SHA1" - , oauth_token: "819797-Jxq8aYUDRmykzVKrgoLhXSq67TEa5ruc4GJC2rWimw" - , oauth_timestamp: "1272325550" - , oauth_version: "1.0" - , status: 'setting up my twitter 私のさえずりを設定する' - }, "MCD8BKwGdgPHvAuvgvz4EQpqDAtx89grbuNMRd7Eh98", "J6zix3FfA9LofH0awS24M3HcBYXO5nI1iYe8EfBA") - -console.log(upsign) -console.log('yOahq5m0YjDDjfjxHaXEsW9D+X0=') -assert.equal(upsign, 'yOahq5m0YjDDjfjxHaXEsW9D+X0=') - - -var rsign = request.post( - { url: 'https://api.twitter.com/oauth/request_token' - , oauth: - { callback: 'http://localhost:3005/the_dance/process_callback?service_provider_id=11' - , consumer_key: 'GDdmIQH6jhtmLUypg82g' - , nonce: 'QP70eNmVz8jvdPevU3oJD2AfF7R7odC2XJcn4XlZJqk' - , timestamp: '1272323042' - , version: '1.0' - , consumer_secret: "MCD8BKwGdgPHvAuvgvz4EQpqDAtx89grbuNMRd7Eh98" - } - }) - -setTimeout(function () { - console.log(getsignature(rsign)) - assert.equal(reqsign, getsignature(rsign)) -}) - -var raccsign = request.post( - { url: 'https://api.twitter.com/oauth/access_token' - , oauth: - { consumer_key: 'GDdmIQH6jhtmLUypg82g' - , nonce: '9zWH6qe0qG7Lc1telCn7FhUbLyVdjEaL3MO5uHxn8' - , signature_method: 'HMAC-SHA1' - , token: '8ldIZyxQeVrFZXFOZH5tAwj6vzJYuLQpl0WUEYtWc' - , timestamp: '1272323047' - , verifier: 'pDNg57prOHapMbhv25RNf75lVRd6JDsni1AJJIDYoTY' - , version: '1.0' - , consumer_secret: "MCD8BKwGdgPHvAuvgvz4EQpqDAtx89grbuNMRd7Eh98" - , token_secret: "x6qpRnlEmW9JbQn4PQVVeVG8ZLPEx6A0TOebgwcuA" - } - }) - -setTimeout(function () { - console.log(getsignature(raccsign)) - assert.equal(accsign, getsignature(raccsign)) -}, 1) - -var rupsign = request.post( - { url: 'http://api.twitter.com/1/statuses/update.json' - , oauth: - { consumer_key: "GDdmIQH6jhtmLUypg82g" - , nonce: "oElnnMTQIZvqvlfXM56aBLAf5noGD0AQR3Fmi7Q6Y" - , signature_method: "HMAC-SHA1" - , token: "819797-Jxq8aYUDRmykzVKrgoLhXSq67TEa5ruc4GJC2rWimw" - , timestamp: "1272325550" - , version: "1.0" - , consumer_secret: "MCD8BKwGdgPHvAuvgvz4EQpqDAtx89grbuNMRd7Eh98" - , token_secret: "J6zix3FfA9LofH0awS24M3HcBYXO5nI1iYe8EfBA" - } - , form: {status: 'setting up my twitter 私のさえずりを設定する'} - }) -setTimeout(function () { - console.log(getsignature(rupsign)) - assert.equal(upsign, getsignature(rupsign)) -}, 1) - - - - diff --git a/node_modules/bower/node_modules/bower-registry-client/node_modules/request/tests/test-onelineproxy.js b/node_modules/bower/node_modules/bower-registry-client/node_modules/request/tests/test-onelineproxy.js deleted file mode 100644 index c239f89..0000000 --- a/node_modules/bower/node_modules/bower-registry-client/node_modules/request/tests/test-onelineproxy.js +++ /dev/null @@ -1,46 +0,0 @@ -var http = require('http') - , assert = require('assert') - , request = require('../index') - ; - -var server = http.createServer(function (req, resp) { - resp.statusCode = 200 - if (req.url === '/get') { - assert.equal(req.method, 'GET') - resp.write('content') - resp.end() - return - } - if (req.url === '/put') { - var x = '' - assert.equal(req.method, 'PUT') - req.on('data', function (chunk) { - x += chunk - }) - req.on('end', function () { - assert.equal(x, 'content') - resp.write('success') - resp.end() - }) - return - } - if (req.url === '/proxy') { - assert.equal(req.method, 'PUT') - return req.pipe(request('http://localhost:8080/put')).pipe(resp) - } - - if (req.url === '/test') { - return request('http://localhost:8080/get').pipe(request.put('http://localhost:8080/proxy')).pipe(resp) - } - throw new Error('Unknown url', req.url) -}).listen(8080, function () { - request('http://localhost:8080/test', function (e, resp, body) { - if (e) throw e - if (resp.statusCode !== 200) throw new Error('statusCode not 200 ' + resp.statusCode) - assert.equal(body, 'success') - server.close() - }) -}) - - - diff --git a/node_modules/bower/node_modules/bower-registry-client/node_modules/request/tests/test-params.js b/node_modules/bower/node_modules/bower-registry-client/node_modules/request/tests/test-params.js deleted file mode 100644 index a5831a1..0000000 --- a/node_modules/bower/node_modules/bower-registry-client/node_modules/request/tests/test-params.js +++ /dev/null @@ -1,93 +0,0 @@ -var server = require('./server') - , assert = require('assert') - , request = require('../index') - ; - -var s = server.createServer(); - -var tests = - { testGet : - { resp : server.createGetResponse("TESTING!") - , expectBody: "TESTING!" - } - , testGetChunkBreak : - { resp : server.createChunkResponse( - [ new Buffer([239]) - , new Buffer([163]) - , new Buffer([191]) - , new Buffer([206]) - , new Buffer([169]) - , new Buffer([226]) - , new Buffer([152]) - , new Buffer([131]) - ]) - , expectBody: "Ω☃" - } - , testGetBuffer : - { resp : server.createGetResponse(new Buffer("TESTING!")) - , encoding: null - , expectBody: new Buffer("TESTING!") - } - , testGetJSON : - { resp : server.createGetResponse('{"test":true}', 'application/json') - , json : true - , expectBody: {"test":true} - } - , testPutString : - { resp : server.createPostValidator("PUTTINGDATA") - , method : "PUT" - , body : "PUTTINGDATA" - } - , testPutBuffer : - { resp : server.createPostValidator("PUTTINGDATA") - , method : "PUT" - , body : new Buffer("PUTTINGDATA") - } - , testPutJSON : - { resp : server.createPostValidator(JSON.stringify({foo: 'bar'})) - , method: "PUT" - , json: {foo: 'bar'} - } - , testPutMultipart : - { resp: server.createPostValidator( - '--__BOUNDARY__\r\n' + - 'content-type: text/html\r\n' + - '\r\n' + - 'Oh hi.' + - '\r\n--__BOUNDARY__\r\n\r\n' + - 'Oh hi.' + - '\r\n--__BOUNDARY__--' - ) - , method: "PUT" - , multipart: - [ {'content-type': 'text/html', 'body': 'Oh hi.'} - , {'body': 'Oh hi.'} - ] - } - } - -s.listen(s.port, function () { - - var counter = 0 - - for (i in tests) { - (function () { - var test = tests[i] - s.on('/'+i, test.resp) - //test.uri = s.url + '/' + i - request(s.url + '/' + i, test, function (err, resp, body) { - if (err) throw err - if (test.expectBody) { - assert.deepEqual(test.expectBody, body) - } - counter = counter - 1; - if (counter === 0) { - assert.notEqual(typeof test.callback, 'function') - console.log(1 + Object.keys(tests).length+" tests passed.") - s.close() - } - }) - counter++ - })() - } -}) diff --git a/node_modules/bower/node_modules/bower-registry-client/node_modules/request/tests/test-piped-redirect.js b/node_modules/bower/node_modules/bower-registry-client/node_modules/request/tests/test-piped-redirect.js deleted file mode 100644 index e295ec7..0000000 --- a/node_modules/bower/node_modules/bower-registry-client/node_modules/request/tests/test-piped-redirect.js +++ /dev/null @@ -1,42 +0,0 @@ -var http = require('http') - , assert = require('assert') - , request = require('../index') - ; - -var portOne = 8968 - , portTwo = 8969 - ; - - -// server one -var s1 = http.createServer(function (req, resp) { - if (req.url == '/original') { - resp.writeHeader(302, {'location': '/redirected'}) - resp.end() - } else if (req.url == '/redirected') { - resp.writeHeader(200, {'content-type': 'text/plain'}) - resp.write('OK') - resp.end() - } - -}).listen(portOne); - - -// server two -var s2 = http.createServer(function (req, resp) { - var x = request('http://localhost:'+portOne+'/original') - req.pipe(x) - x.pipe(resp) - -}).listen(portTwo, function () { - var r = request('http://localhost:'+portTwo+'/original', function (err, res, body) { - assert.equal(body, 'OK') - - s1.close() - s2.close() - }); - - // it hangs, so wait a second :) - r.timeout = 1000; - -}) diff --git a/node_modules/bower/node_modules/bower-registry-client/node_modules/request/tests/test-pipes.js b/node_modules/bower/node_modules/bower-registry-client/node_modules/request/tests/test-pipes.js deleted file mode 100644 index 52a15cc..0000000 --- a/node_modules/bower/node_modules/bower-registry-client/node_modules/request/tests/test-pipes.js +++ /dev/null @@ -1,216 +0,0 @@ -var server = require('./server') - , events = require('events') - , stream = require('stream') - , assert = require('assert') - , fs = require('fs') - , request = require('../index') - , path = require('path') - , util = require('util') - ; - -var s = server.createServer(3453); - -function ValidationStream(str) { - this.str = str - this.buf = '' - this.on('data', function (data) { - this.buf += data - }) - this.on('end', function () { - assert.equal(this.str, this.buf) - }) - this.writable = true -} -util.inherits(ValidationStream, stream.Stream) -ValidationStream.prototype.write = function (chunk) { - this.emit('data', chunk) -} -ValidationStream.prototype.end = function (chunk) { - if (chunk) emit('data', chunk) - this.emit('end') -} - -s.listen(s.port, function () { - counter = 0; - - var check = function () { - counter = counter - 1 - if (counter === 0) { - console.log('All tests passed.') - setTimeout(function () { - process.exit(); - }, 500) - } - } - - // Test pipeing to a request object - s.once('/push', server.createPostValidator("mydata")); - - var mydata = new stream.Stream(); - mydata.readable = true - - counter++ - var r1 = request.put({url:'http://localhost:3453/push'}, function () { - check(); - }) - mydata.pipe(r1) - - mydata.emit('data', 'mydata'); - mydata.emit('end'); - - // Test pipeing to a request object with a json body - s.once('/push-json', server.createPostValidator("{\"foo\":\"bar\"}", "application/json")); - - var mybodydata = new stream.Stream(); - mybodydata.readable = true - - counter++ - var r2 = request.put({url:'http://localhost:3453/push-json',json:true}, function () { - check(); - }) - mybodydata.pipe(r2) - - mybodydata.emit('data', JSON.stringify({foo:"bar"})); - mybodydata.emit('end'); - - // Test pipeing from a request object. - s.once('/pull', server.createGetResponse("mypulldata")); - - var mypulldata = new stream.Stream(); - mypulldata.writable = true - - counter++ - request({url:'http://localhost:3453/pull'}).pipe(mypulldata) - - var d = ''; - - mypulldata.write = function (chunk) { - d += chunk; - } - mypulldata.end = function () { - assert.equal(d, 'mypulldata'); - check(); - }; - - - s.on('/cat', function (req, resp) { - if (req.method === "GET") { - resp.writeHead(200, {'content-type':'text/plain-test', 'content-length':4}); - resp.end('asdf') - } else if (req.method === "PUT") { - assert.equal(req.headers['content-type'], 'text/plain-test'); - assert.equal(req.headers['content-length'], 4) - var validate = ''; - - req.on('data', function (chunk) {validate += chunk}) - req.on('end', function () { - resp.writeHead(201); - resp.end(); - assert.equal(validate, 'asdf'); - check(); - }) - } - }) - s.on('/pushjs', function (req, resp) { - if (req.method === "PUT") { - assert.equal(req.headers['content-type'], 'application/javascript'); - check(); - } - }) - s.on('/catresp', function (req, resp) { - request.get('http://localhost:3453/cat').pipe(resp) - }) - s.on('/doodle', function (req, resp) { - if (req.headers['x-oneline-proxy']) { - resp.setHeader('x-oneline-proxy', 'yup') - } - resp.writeHead('200', {'content-type':'image/jpeg'}) - fs.createReadStream(path.join(__dirname, 'googledoodle.jpg')).pipe(resp) - }) - s.on('/onelineproxy', function (req, resp) { - var x = request('http://localhost:3453/doodle') - req.pipe(x) - x.pipe(resp) - }) - - counter++ - fs.createReadStream(__filename).pipe(request.put('http://localhost:3453/pushjs')) - - counter++ - request.get('http://localhost:3453/cat').pipe(request.put('http://localhost:3453/cat')) - - counter++ - request.get('http://localhost:3453/catresp', function (e, resp, body) { - assert.equal(resp.headers['content-type'], 'text/plain-test'); - assert.equal(resp.headers['content-length'], 4) - check(); - }) - - var doodleWrite = fs.createWriteStream(path.join(__dirname, 'test.jpg')) - - counter++ - request.get('http://localhost:3453/doodle').pipe(doodleWrite) - - doodleWrite.on('close', function () { - assert.deepEqual(fs.readFileSync(path.join(__dirname, 'googledoodle.jpg')), fs.readFileSync(path.join(__dirname, 'test.jpg'))) - check() - }) - - process.on('exit', function () { - fs.unlinkSync(path.join(__dirname, 'test.jpg')) - }) - - counter++ - request.get({uri:'http://localhost:3453/onelineproxy', headers:{'x-oneline-proxy':'nope'}}, function (err, resp, body) { - assert.equal(resp.headers['x-oneline-proxy'], 'yup') - check() - }) - - s.on('/afterresponse', function (req, resp) { - resp.write('d') - resp.end() - }) - - counter++ - var afterresp = request.post('http://localhost:3453/afterresponse').on('response', function () { - var v = new ValidationStream('d') - afterresp.pipe(v) - v.on('end', check) - }) - - s.on('/forward1', function (req, resp) { - resp.writeHead(302, {location:'/forward2'}) - resp.end() - }) - s.on('/forward2', function (req, resp) { - resp.writeHead('200', {'content-type':'image/png'}) - resp.write('d') - resp.end() - }) - - counter++ - var validateForward = new ValidationStream('d') - validateForward.on('end', check) - request.get('http://localhost:3453/forward1').pipe(validateForward) - - // Test pipe options - s.once('/opts', server.createGetResponse('opts response')); - - var optsStream = new stream.Stream(); - optsStream.writable = true - - var optsData = ''; - optsStream.write = function (buf) { - optsData += buf; - if (optsData === 'opts response') { - setTimeout(check, 10); - } - } - - optsStream.end = function () { - assert.fail('end called') - }; - - counter++ - request({url:'http://localhost:3453/opts'}).pipe(optsStream, { end : false }) -}) diff --git a/node_modules/bower/node_modules/bower-registry-client/node_modules/request/tests/test-pool.js b/node_modules/bower/node_modules/bower-registry-client/node_modules/request/tests/test-pool.js deleted file mode 100644 index 791ee8b..0000000 --- a/node_modules/bower/node_modules/bower-registry-client/node_modules/request/tests/test-pool.js +++ /dev/null @@ -1,16 +0,0 @@ -var request = require('../index') - , http = require('http') - , assert = require('assert') - ; - -var s = http.createServer(function (req, resp) { - resp.statusCode = 200; - resp.end('asdf'); -}).listen(8080, function () { - request({'url': 'http://localhost:8080', 'pool': false}, function (e, resp) { - var agent = resp.request.agent; - assert.strictEqual(typeof agent, 'boolean'); - assert.strictEqual(agent, false); - s.close(); - }); -}); \ No newline at end of file diff --git a/node_modules/bower/node_modules/bower-registry-client/node_modules/request/tests/test-protocol-changing-redirect.js b/node_modules/bower/node_modules/bower-registry-client/node_modules/request/tests/test-protocol-changing-redirect.js deleted file mode 100644 index 7e83a41..0000000 --- a/node_modules/bower/node_modules/bower-registry-client/node_modules/request/tests/test-protocol-changing-redirect.js +++ /dev/null @@ -1,61 +0,0 @@ -var server = require('./server') - , assert = require('assert') - , request = require('../index') - - -var s = server.createServer() -var ss = server.createSSLServer() -var sUrl = 'http://localhost:' + s.port -var ssUrl = 'https://localhost:' + ss.port - -s.listen(s.port, bouncy(s, ssUrl)) -ss.listen(ss.port, bouncy(ss, sUrl)) - -var hits = {} -var expect = {} -var pending = 0 -function bouncy (s, server) { return function () { - - var redirs = { a: 'b' - , b: 'c' - , c: 'd' - , d: 'e' - , e: 'f' - , f: 'g' - , g: 'h' - , h: 'end' } - - var perm = true - Object.keys(redirs).forEach(function (p) { - var t = redirs[p] - - // switch type each time - var type = perm ? 301 : 302 - perm = !perm - s.on('/' + p, function (req, res) { - res.writeHead(type, { location: server + '/' + t }) - res.end() - }) - }) - - s.on('/end', function (req, res) { - var h = req.headers['x-test-key'] - hits[h] = true - pending -- - if (pending === 0) done() - }) -}} - -for (var i = 0; i < 5; i ++) { - pending ++ - var val = 'test_' + i - expect[val] = true - request({ url: (i % 2 ? sUrl : ssUrl) + '/a' - , headers: { 'x-test-key': val } - , rejectUnauthorized: false }) -} - -function done () { - assert.deepEqual(hits, expect) - process.exit(0) -} diff --git a/node_modules/bower/node_modules/bower-registry-client/node_modules/request/tests/test-proxy.js b/node_modules/bower/node_modules/bower-registry-client/node_modules/request/tests/test-proxy.js deleted file mode 100644 index e183d68..0000000 --- a/node_modules/bower/node_modules/bower-registry-client/node_modules/request/tests/test-proxy.js +++ /dev/null @@ -1,39 +0,0 @@ -var server = require('./server') - , events = require('events') - , stream = require('stream') - , assert = require('assert') - , fs = require('fs') - , request = require('../index') - , path = require('path') - , util = require('util') - ; - -var port = 6768 - , called = false - , proxiedHost = 'google.com' - ; - -var s = server.createServer(port) -s.listen(port, function () { - s.on('http://google.com/', function (req, res) { - called = true - assert.equal(req.headers.host, proxiedHost) - res.writeHeader(200) - res.end() - }) - request ({ - url: 'http://'+proxiedHost, - proxy: 'http://localhost:'+port - /* - //should behave as if these arguments where passed: - url: 'http://localhost:'+port, - headers: {host: proxiedHost} - //*/ - }, function (err, res, body) { - s.close() - }) -}) - -process.on('exit', function () { - assert.ok(called, 'the request must be made to the proxy server') -}) diff --git a/node_modules/bower/node_modules/bower-registry-client/node_modules/request/tests/test-qs.js b/node_modules/bower/node_modules/bower-registry-client/node_modules/request/tests/test-qs.js deleted file mode 100644 index 65958e6..0000000 --- a/node_modules/bower/node_modules/bower-registry-client/node_modules/request/tests/test-qs.js +++ /dev/null @@ -1,42 +0,0 @@ -var request = request = require('../index') - , assert = require('assert') - ; - - -// Test adding a querystring -var req1 = request.get({ uri: 'http://www.google.com', qs: { q : 'search' }}) -setTimeout(function() { - assert.equal('/?q=search', req1.path) -}, 1) - -// Test replacing a querystring value -var req2 = request.get({ uri: 'http://www.google.com?q=abc', qs: { q : 'search' }}) -setTimeout(function() { - assert.equal('/?q=search', req2.path) -}, 1) - -// Test appending a querystring value to the ones present in the uri -var req3 = request.get({ uri: 'http://www.google.com?x=y', qs: { q : 'search' }}) -setTimeout(function() { - assert.equal('/?x=y&q=search', req3.path) -}, 1) - -// Test leaving a querystring alone -var req4 = request.get({ uri: 'http://www.google.com?x=y'}) -setTimeout(function() { - assert.equal('/?x=y', req4.path) -}, 1) - -// Test giving empty qs property -var req5 = request.get({ uri: 'http://www.google.com', qs: {}}) -setTimeout(function(){ - assert.equal('/', req5.path) -}, 1) - - -// Test modifying the qs after creating the request -var req6 = request.get({ uri: 'http://www.google.com', qs: {}}); -req6.qs({ q: "test" }); -process.nextTick(function() { - assert.equal('/?q=test', req6.path); -}); diff --git a/node_modules/bower/node_modules/bower-registry-client/node_modules/request/tests/test-redirect.js b/node_modules/bower/node_modules/bower-registry-client/node_modules/request/tests/test-redirect.js deleted file mode 100644 index cdd4606..0000000 --- a/node_modules/bower/node_modules/bower-registry-client/node_modules/request/tests/test-redirect.js +++ /dev/null @@ -1,155 +0,0 @@ -var server = require('./server') - , assert = require('assert') - , request = require('../index') - , Cookie = require('cookie-jar') - , Jar = Cookie.Jar - ; - -var s = server.createServer() - -s.listen(s.port, function () { - var server = 'http://localhost:' + s.port; - var hits = {} - var passed = 0; - - bouncer(301, 'temp') - bouncer(302, 'perm') - bouncer(302, 'nope') - - function bouncer(code, label) { - var landing = label+'_landing'; - - s.on('/'+label, function (req, res) { - hits[label] = true; - res.writeHead(code, { - 'location':server + '/'+landing, - 'set-cookie': 'ham=eggs' - }) - res.end() - }) - - s.on('/'+landing, function (req, res) { - if (req.method !== 'GET') { // We should only accept GET redirects - console.error("Got a non-GET request to the redirect destination URL"); - res.writeHead(400); - res.end(); - return; - } - // Make sure the cookie doesn't get included twice, see #139: - // Make sure cookies are set properly after redirect - assert.equal(req.headers.cookie, 'foo=bar; quux=baz; ham=eggs'); - hits[landing] = true; - res.writeHead(200) - res.end(landing) - }) - } - - // Permanent bounce - var jar = new Jar() - jar.add(new Cookie('quux=baz')) - request({uri: server+'/perm', jar: jar, headers: {cookie: 'foo=bar'}}, function (er, res, body) { - if (er) throw er - if (res.statusCode !== 200) throw new Error('Status is not 200: '+res.statusCode) - assert.ok(hits.perm, 'Original request is to /perm') - assert.ok(hits.perm_landing, 'Forward to permanent landing URL') - assert.equal(body, 'perm_landing', 'Got permanent landing content') - passed += 1 - done() - }) - - // Temporary bounce - request({uri: server+'/temp', jar: jar, headers: {cookie: 'foo=bar'}}, function (er, res, body) { - if (er) throw er - if (res.statusCode !== 200) throw new Error('Status is not 200: '+res.statusCode) - assert.ok(hits.temp, 'Original request is to /temp') - assert.ok(hits.temp_landing, 'Forward to temporary landing URL') - assert.equal(body, 'temp_landing', 'Got temporary landing content') - passed += 1 - done() - }) - - // Prevent bouncing. - request({uri:server+'/nope', jar: jar, headers: {cookie: 'foo=bar'}, followRedirect:false}, function (er, res, body) { - if (er) throw er - if (res.statusCode !== 302) throw new Error('Status is not 302: '+res.statusCode) - assert.ok(hits.nope, 'Original request to /nope') - assert.ok(!hits.nope_landing, 'No chasing the redirect') - assert.equal(res.statusCode, 302, 'Response is the bounce itself') - passed += 1 - done() - }) - - // Should not follow post redirects by default - request.post(server+'/temp', { jar: jar, headers: {cookie: 'foo=bar'}}, function (er, res, body) { - if (er) throw er - if (res.statusCode !== 301) throw new Error('Status is not 301: '+res.statusCode) - assert.ok(hits.temp, 'Original request is to /temp') - assert.ok(!hits.temp_landing, 'No chasing the redirect when post') - assert.equal(res.statusCode, 301, 'Response is the bounce itself') - passed += 1 - done() - }) - - // Should follow post redirects when followAllRedirects true - request.post({uri:server+'/temp', followAllRedirects:true, jar: jar, headers: {cookie: 'foo=bar'}}, function (er, res, body) { - if (er) throw er - if (res.statusCode !== 200) throw new Error('Status is not 200: '+res.statusCode) - assert.ok(hits.temp, 'Original request is to /temp') - assert.ok(hits.temp_landing, 'Forward to temporary landing URL') - assert.equal(body, 'temp_landing', 'Got temporary landing content') - passed += 1 - done() - }) - - request.post({uri:server+'/temp', followAllRedirects:false, jar: jar, headers: {cookie: 'foo=bar'}}, function (er, res, body) { - if (er) throw er - if (res.statusCode !== 301) throw new Error('Status is not 301: '+res.statusCode) - assert.ok(hits.temp, 'Original request is to /temp') - assert.ok(!hits.temp_landing, 'No chasing the redirect') - assert.equal(res.statusCode, 301, 'Response is the bounce itself') - passed += 1 - done() - }) - - // Should not follow delete redirects by default - request.del(server+'/temp', { jar: jar, headers: {cookie: 'foo=bar'}}, function (er, res, body) { - if (er) throw er - if (res.statusCode < 301) throw new Error('Status is not a redirect.') - assert.ok(hits.temp, 'Original request is to /temp') - assert.ok(!hits.temp_landing, 'No chasing the redirect when delete') - assert.equal(res.statusCode, 301, 'Response is the bounce itself') - passed += 1 - done() - }) - - // Should not follow delete redirects even if followRedirect is set to true - request.del(server+'/temp', { followRedirect: true, jar: jar, headers: {cookie: 'foo=bar'}}, function (er, res, body) { - if (er) throw er - if (res.statusCode !== 301) throw new Error('Status is not 301: '+res.statusCode) - assert.ok(hits.temp, 'Original request is to /temp') - assert.ok(!hits.temp_landing, 'No chasing the redirect when delete') - assert.equal(res.statusCode, 301, 'Response is the bounce itself') - passed += 1 - done() - }) - - // Should follow delete redirects when followAllRedirects true - request.del(server+'/temp', {followAllRedirects:true, jar: jar, headers: {cookie: 'foo=bar'}}, function (er, res, body) { - if (er) throw er - if (res.statusCode !== 200) throw new Error('Status is not 200: '+res.statusCode) - assert.ok(hits.temp, 'Original request is to /temp') - assert.ok(hits.temp_landing, 'Forward to temporary landing URL') - assert.equal(body, 'temp_landing', 'Got temporary landing content') - passed += 1 - done() - }) - - var reqs_done = 0; - function done() { - reqs_done += 1; - if(reqs_done == 9) { - console.log(passed + ' tests passed.') - s.close() - } - } -}) diff --git a/node_modules/bower/node_modules/bower-registry-client/node_modules/request/tests/test-s3.js b/node_modules/bower/node_modules/bower-registry-client/node_modules/request/tests/test-s3.js deleted file mode 100644 index 0f6a832..0000000 --- a/node_modules/bower/node_modules/bower-registry-client/node_modules/request/tests/test-s3.js +++ /dev/null @@ -1,13 +0,0 @@ -var request = require('../index') - -var r = request.get('https://log.curlybracecast.com.s3.amazonaws.com/', - { aws: - { key: 'AKIAI6KIQRRVMGK3WK5Q' - , secret: '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' - , bucket: 'log.curlybracecast.com' - } - }, function (e, resp, body) { - console.log(r.headers) - console.log(body) - } -) \ No newline at end of file diff --git a/node_modules/bower/node_modules/bower-registry-client/node_modules/request/tests/test-timeout.js b/node_modules/bower/node_modules/bower-registry-client/node_modules/request/tests/test-timeout.js deleted file mode 100644 index 7036367..0000000 --- a/node_modules/bower/node_modules/bower-registry-client/node_modules/request/tests/test-timeout.js +++ /dev/null @@ -1,87 +0,0 @@ -var server = require('./server') - , events = require('events') - , stream = require('stream') - , assert = require('assert') - , request = require('../index') - ; - -var s = server.createServer(); -var expectedBody = "waited"; -var remainingTests = 5; - -s.listen(s.port, function () { - // Request that waits for 200ms - s.on('/timeout', function (req, resp) { - setTimeout(function(){ - resp.writeHead(200, {'content-type':'text/plain'}) - resp.write(expectedBody) - resp.end() - }, 200); - }); - - // Scenario that should timeout - var shouldTimeout = { - url: s.url + "/timeout", - timeout:100 - } - - - request(shouldTimeout, function (err, resp, body) { - assert.equal(err.code, "ETIMEDOUT"); - checkDone(); - }) - - - // Scenario that shouldn't timeout - var shouldntTimeout = { - url: s.url + "/timeout", - timeout:300 - } - - request(shouldntTimeout, function (err, resp, body) { - assert.equal(err, null); - assert.equal(expectedBody, body) - checkDone(); - }) - - // Scenario with no timeout set, so shouldn't timeout - var noTimeout = { - url: s.url + "/timeout" - } - - request(noTimeout, function (err, resp, body) { - assert.equal(err); - assert.equal(expectedBody, body) - checkDone(); - }) - - // Scenario with a negative timeout value, should be treated a zero or the minimum delay - var negativeTimeout = { - url: s.url + "/timeout", - timeout:-1000 - } - - request(negativeTimeout, function (err, resp, body) { - assert.equal(err.code, "ETIMEDOUT"); - checkDone(); - }) - - // Scenario with a float timeout value, should be rounded by setTimeout anyway - var floatTimeout = { - url: s.url + "/timeout", - timeout: 100.76 - } - - request(floatTimeout, function (err, resp, body) { - assert.equal(err.code, "ETIMEDOUT"); - checkDone(); - }) - - function checkDone() { - if(--remainingTests == 0) { - s.close(); - console.log("All tests passed."); - } - } -}) - diff --git a/node_modules/bower/node_modules/bower-registry-client/node_modules/request/tests/test-toJSON.js b/node_modules/bower/node_modules/bower-registry-client/node_modules/request/tests/test-toJSON.js deleted file mode 100644 index 6d5f92a..0000000 --- a/node_modules/bower/node_modules/bower-registry-client/node_modules/request/tests/test-toJSON.js +++ /dev/null @@ -1,14 +0,0 @@ -var request = require('../index') - , http = require('http') - , assert = require('assert') - ; - -var s = http.createServer(function (req, resp) { - resp.statusCode = 200 - resp.end('asdf') -}).listen(8080, function () { - var r = request('http://localhost:8080', function (e, resp) { - assert.equal(JSON.parse(JSON.stringify(r)).response.statusCode, 200) - s.close() - }) -}) \ No newline at end of file diff --git a/node_modules/bower/node_modules/bower-registry-client/node_modules/request/tests/test-tunnel.js b/node_modules/bower/node_modules/bower-registry-client/node_modules/request/tests/test-tunnel.js deleted file mode 100644 index 2ee3f39..0000000 --- a/node_modules/bower/node_modules/bower-registry-client/node_modules/request/tests/test-tunnel.js +++ /dev/null @@ -1,75 +0,0 @@ -// test that we can tunnel a https request over an http proxy -// keeping all the CA and whatnot intact. -// -// Note: this requires that squid is installed. -// If the proxy fails to start, we'll just log a warning and assume success. - -var server = require('./server') - , assert = require('assert') - , request = require('../index') - , fs = require('fs') - , path = require('path') - , caFile = path.resolve(__dirname, 'ssl/npm-ca.crt') - , ca = fs.readFileSync(caFile) - , child_process = require('child_process') - , sqConf = path.resolve(__dirname, 'squid.conf') - , sqArgs = ['-f', sqConf, '-N', '-d', '5'] - , proxy = 'http://localhost:3128' - , hadError = null - -var squid = child_process.spawn('squid', sqArgs); -var ready = false - -squid.stderr.on('data', function (c) { - console.error('SQUIDERR ' + c.toString().trim().split('\n') - .join('\nSQUIDERR ')) - ready = c.toString().match(/ready to serve requests|Accepting HTTP Socket connections/i) -}) - -squid.stdout.on('data', function (c) { - console.error('SQUIDOUT ' + c.toString().trim().split('\n') - .join('\nSQUIDOUT ')) -}) - -squid.on('error', function (c) { - console.error('squid: error '+c) - if (c && !ready) { - notInstalled() - return - } -}) - -squid.on('exit', function (c) { - console.error('squid: exit '+c) - if (c && !ready) { - notInstalled() - return - } - - if (c) { - hadError = hadError || new Error('Squid exited with '+c) - } - if (hadError) throw hadError -}) - -setTimeout(function F () { - if (!ready) return setTimeout(F, 100) - request({ uri: 'https://registry.npmjs.org/' - , proxy: 'http://localhost:3128' - , strictSSL: true - , ca: ca - , json: true }, function (er, body) { - hadError = er - console.log(er || typeof body) - if (!er) console.log("ok") - squid.kill('SIGKILL') - }) -}, 100) - -function notInstalled() { - console.error('squid must be installed to run this test.') - console.error('skipping this test. please install squid and run again if you need to test tunneling.') - c = null - hadError = null - process.exit(0) -} diff --git a/node_modules/bower/node_modules/bower-registry-client/node_modules/request/tests/unicycle.jpg b/node_modules/bower/node_modules/bower-registry-client/node_modules/request/tests/unicycle.jpg deleted file mode 100644 index 7cea4dd71dc41cd51c84bfcec6b3e65c15a58507..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 19806 zcmbTc1z40%^fvq;-Jx_#Nh95;NK1E1=hCsXfTT16N{WCqh_G}>mxMG+w{*i&%eVge z{eSO!eKC8@&i%}sIp;oS=E<4+nfqmcKv7mf7C=Hm0^|`t;C>bLiGsAWshWnWtimf9 zL<0bzl9{=+8}k70-O<9+&Fc?Y1ephX0PrW@KWZLIn}Mv{%;ualph#^3Ms7GLF z6$B=y;}i_IW0Ga(VK3cCEmw%3d&g(|=n-+)V8(M&geEwLdugw)b1_pVsIQ zEX@93Mh8d(D+r!{9{tV5;XmB}=4H|Ktj|d%yh)ndH`9(Sa~3_#lN=xYxh5r|J7iHu>1EY{~2{1#MsjTf7*4V zBS&a+`D+ZU{_yzsys-Vt7T{q8_CU-dK-$^G$IZ^h)`O0hhlh{uIpWe}MJMeHa`E)A za-&mlvf$#NGjnvL`$NW^&dti*%FWBllIwTh`;`abGGIGv08m!`V+LaYm`M1*14I*I z-U7Zz1b^V)*Q_KYA^;gtBKFFPR5%U}73Jp_eTuj+QHG@d&FukANY+1?Ir8yeJkbFl0dc`X z=tkk;<$aof{5Q`BTnQ-u;1`Jx{^_fegaTmw$>)Jd66!zo)=B7p=|n^(3F9w}jlh_H zVMIieu>O&E`t-Nmr#w8Lkp7ZEc=_qUKk+I1g!~Ua%KuviVLboAU-G{(^1praQU1~I zm5=&YJqtnx?JtZNm;AqZ{_guX&)@iOp1(2Hzxok}ztivde?nwDL`MDJMf-nOhmeg! zboEA*zte9Wf6gHQ_&uk7AOB8B_j8Ez<-zZS^vC~$2gt~1D9DI}j*5zchJlWO@jGK; z;bLQA;$UH5VB=%s;Nl??CN=>fJ|5w3{9DQI?ucG!C@5%nm>8J9CH}vq`|kiD25 z0f=@0g%Fj9{^@hHhw5hNk6j<}1}ElXFubU0C)W6R#K>pv7J`XILP|zX!Nkn+gq4k7 zKu}0nL{$2vjI5lzf}*CDwvI01rfXqoWo=_?XYcOe>E#Xf@eO?&79J596`hp)J|#8n z!^iZ`dHDrj3X6(MzE#&iYU}D78aq0>x_f&2`Ul3wCnl$+XJ(-*t842Un_IuOcaBd^ z&(1F{VOQ6`{X)#CKi&Grv;W~2A;PZ*C@9D%=)e6!df<)7$b=}U^iR=qmT%UlW$mDv_^09WR>EfUw5|pXx$ELf1=1HCf-G}A$ifkAKY0k)f)&f^@I?lrTv+^y1zFzo@Bs#(74 zB2%!Tp?dq>Xz#9(^6?KK}b*#0Z z0naJ~K@1vW6wNNAG0(cE1;5XE&$kx_;^9f5{tP!OlX{QxY)3IqGi_^m!*% zqGbX~y;f_LM7#uY3ED1`3q2>3JU?3s3*_9^-NtQ;9K$79>C3!$r? zs<;Pgmg_{_xArvHi0Rf})2dIWXQ_TE%vvdUv@khRU0GvDtwOjZEB+mCn%beqUwT<# zpJ-JkhHO#8`$^wxRa$9dxz3Syi+Hd%I^&8HB-F;5?t1h7Nj%j0=*Relis$EXB6ZS_ zIT9Naw8NjTeo@!ZvF)TxU8(x&9y;B2m6K({c{FbgmykS|+}E0~sT!n3ddGz!nfb=u z2$IrL8@w`;m-GypP|x(ylHNjdyclkDYEoE+j|FZQS17SlEn5)G@Oqh`>NeVs)^8x9 zCaYpdiKz>Oh^3zn$*K5(0zJbGl}gcL_2gWc_1}kJFrHxiQdLzvE_tCezujW}+ip;7WR(VE~@-+rRFC>i4hbzy~@~ zUQnPdV@fc0^&UWm#T!pKHe0M9H^`2_g zX$x=V3ao;>sZvcJGI>~?9CRFrpJ#;y@NZ^FVCx+^NfPNfOey;v9d<*#>S%5%1a2MrAxn6$_)gMRowj__?aX7ws!ir=dEUa)5r_vSmOyW3B8Yvi-;Q{8VBrlCk}{kCy9<*{i)~?x{K|Wg*cO?v%yD8H*lqY z^SC52ENN{pyHgDoP}Yy}0rK^f6N5p7&g$9iqiOb_qc*LYcl)BA`#F*PrvvkPJdE+i z4e*zftlhyIdq$lswBLhL0^@#RSR4t)#Aae+e3e>$&?*l6l~m}1uc!T7ds!FQ=T#UM!O{$Jb-RJT$OI>%E!T9cmnqf zqo@`V-d!52J)bpqCbPHS^`w~jMCu5d@v(BxmIvUTn-ppB9y1ltIaTCA)$=sI?7NQO z>0M*6IO;2vD*HuiZ3i~Lye9UBDD~i(i748G9^cRrYKP8>z{hr)H9upWs11%{ytrO~1zKYAG&$&-?EYxkz zi)SHy65)htG4h}}vlE+&Lu7;fZ1kKL`mkH)!gYM&YOZUMJA79&yQh8G0p(+Yk2HP5 zy3I}REqkA5{l=8%rcT_fS*#F7a#kLd<@Js3>^(s2k7QAjXAHJcuBozW(ypz2%SOkw zQSk9A-|53)pVe0HWA098LOUS^-VdJ4PDTa^!2z=Prsd$XDju7br~&&iFM~Yn_CRJ; z%v-(DTRGfzeUJW>&;B+jtVTkY@57~10;~N+jxRFSa?tF2-;xUEsi#Yf8|1x?%X2|5 z$x%0rfyTuKpw%Dsqm=Ryo)C+y(ZVYv9L|!ziwcE%n9ihi=#pN0ZWKoC+r(yT*VXHv zZaq-!YhyG^SffUBu#YwT(24zF5M@cUaVO59TN3$Q7X{~Glm|7KX}LMwJ5D$xa*V~w zb|y~${lVo$We$2|Dz;J+cwaedhGT@YxG%@G!(x1zYJIwD_gXb-?N}RLylgCF&=R`; z*)S4|OlKiWIx6eiqpe&hrU+wbfs|F|m+$o6l%PK^Eb$4o)tjKToIBsE+f10ys#X^E4u+J- z%=BnbbzA?D#i~*qK9rvJ3PX3KH2G+^w~+GPP8HHU5MePiMKD}f$r2T|Xq)Z#%J`{e*LqB`Dj0(O-x*?b&E=q~=$#drA8|(& z!tByTiQ7 zcSj;?uXPehBbsRodqE%+NiB_%H{EiD5ckQ7yf1raUq5Q)HH!h@5*1+&hnhC zIkx=;SYQF{w{rI-?O05?rul>Mf!C>4403R$tKM^+qREB0?TPPZQ;EuVTcApC2d-)R zb=a43kA#4Vg~Xp|B4$f8=T}w5u+LM%2jxT_e8oJqmb4vRPj`3N&)uYuY;nu@BVL6u zkhhzg1}*#PrurLIAECbq#57&J2Rb-cK0-q8wB7UsHYfmO30B9;X-2yK4gt{r)-in9w&cN{X;Tk@GBi5-JT#+oi$-lYD#GP>*l!b!urHV$DQ zq!q@8VA}~sPy^RDF|@uH_rUC$a?ZMijFlPxx8#1YqY})^t&>VzD@Dv!5PqP) zw1^A~b%1KkzCU-q{&qR~>{^o!=*RfyDwaB@ltbNYx}Q!`Hr)7NC#WqAxDZ0|*2Fp0 z?5ck^#wz}oLgf=WN3tH*Ox+PU-!vrhR@%qGf`6#>SrxRS8){OTi5KSjefO-wU#o!3 zKtlCHw>gu?VtID^D(;KR_Uy+~`yM$DJ7mhLs_ibnl??LM08Yym*jaBbm(MHX0v|i1 zr@a$bwh8j)tRX5$e!)dStWGEWUSr{?&`BPx<&p7%y>CTf>29Z5Q?etYw1>9N$^(!( zOF#*DO+s{<#01HoDOsid2L~00+(9044`m@ac_pugi?@>WaOULMQ-AI+84YR56ILL4 z`k2ziZe(%Zl9(#`c%x-Y-|4~`Fn_z*hB4F!kLt<>M|=WKN)2W}(WR;*5o&~IIe>~( zarjziIT@o?29i%cXTFZtG=}ulmCJejoU`}l`D}*cHB3nAJOK1>ZD0>s?K>^0?*90o z+P5c(bejXf8HH5O`Xb;j434sR$(+OqSHTrj-8j&7tUWvo8na3;j6yJQ*p$$4>RLQ# zsh~1@I{s}dt4OhJ)$!d9O54t`u9e%U}%#ia4y$(L2@z*wiZL zV};hKScgp?F0VL4YDvhJ&bPjMfTWeOYfmwjl~MfMJU+=Gy9yOfXcCj$*3Hm%$0zVE z-W{6lba>EpE}^M2!R;je+|I|7f4^}19mFU`offIB{d4_N7hUq!&0m`5J7nN3gS-hzO~rWnWUoN6zX~yeT|d-FlDDD zH9`P%rGj_n+`>1)kN5qyiaoaU>_Nl6*>MogtlD^&CQEF-N4Ki~o-?^1w4Z?LgBkXf zdwNGEd&oC(YJ%gO6`H)U7OZ587*&}dsyTfy+lbOQXT|GOC~>r4vI8pv$`*Q|i9CJ{=*d*qaXBshdt8%6Bm| zG%#&vv7u%N8BRcB+>K&7RamYnT}7_40C~5RMXvB}QKubGHW( zb8(EF-=gAPmoFo! zB-I?`vDs3$(7%#bTD6}-e)-mkiSgj~I0G^GX)j~$fprmfY{jh=(fC7f5nQTKpxXLU zZmlplWLBhB6pQ3TA6n;zLc0lMXuD3g_8vgpKVTZiJ6>%jYd+ubZ+03{?Z|Ckx;`-F zl{kDcI@c9Mett*hk`}(ms+#YY&~W=mK&snYuAovcrXHsmfO@O3U9^2|)NZm4oYYg)|xC&5~V`sk3 zQU4VR3J>|@F$$8pu>VnG9w;;uGl1kHYe6pMJyuhrfZUtgn4k+Mym^uD>pz)dC9Zz! zP-|y#O6t)H6Q-JwRt(dcLA=`9Iuq>p2Bx8w`Bu-_xiUajYosl4d&c%dzY>p#W5En0 zBoDjC=T&oIsl8e=fwtvb1Xa!|A#IA1jJJYgxB6BBw~0FxGA9hgQ;trHB(rgZ6Cp`O z5=iLOrE5V1{z#4E%?b`d0q%HpWU{Y27R;JoBXwY!u~&VQm8a$vot{z*XM1EpRxVcV zeG^Ba7sHqAWN_gd^zqawHy50&((DYG*_q;?3{T>mz14l(u$wFH$dt;`ky-u7_Viq8 zbQ-d2fZwHL%!SJ$Cz|yuO53tN{Hh|~j@L~Jj7R!uE1Uh}SD5NCzR}eFoY4mZXf8gx z$woDMdCIMz-ks;S;;Qxn)ARsamLX^yx; zSK5e2K;A)x3%iY$j^RHo=Q}x561ZJ!g0ttN_bOXwZE#b*yW`Z^k31@wVJmTwXUMZD z0PFX#cKBz-SFFV3?YhNtoy_%fm0f3aOfhuA3CEY8_7k6Betd65*0AH+`@%K-ObnlJ zm&C0s%Im;2gym`?zBe52Lw`Q7xbgT0?i zV)AP(#B>D>qO^ptcPnq5R~=?U9HTc0zUWQk#NbOwAL??7qY{j-;bioYacFI{jI;z8 zy5@F2b?m`kQC7w4h^l$s^ou>kY|QszKk+E6=>kk7cf;!cN-nFAy(|nzz6a%LoJ1TS zY&w`e2&Nv$cn>Hv+ye=>U^99Y*HMZ~=h>mt8%BRwsdEyeEqJ}0sZ=kW6q5fdRc8XZ z_?yiZ=6e7PH_d%@R%&|1osG`Pm>-WX%VQ}l)sUPdHce0TQW9yV^s20|do7usMGU>g zlVlz~x`-uy5A@aMTr(?f-Aa9#-!;V+7s#D`;%+{c7x876o zEiB%~A{Rb%ogK*#C4d`HFfBkNY^`Atg4=u7MVsQopD>q0zT?KP)ZmZPpCrP*;c>0q zM!lU5Z4N9S0)l{W2enk4-kqvxbzL~;n5X>@TNiGh^R6L4j z8^FNrI%rPps07Z-D{+!tixnPeemq#Sky$!5!|bCA%<|KjT#RzCa&`Az&adF(A8PVD zo=@%$%rZV5=D}WJ*7LigyRs!E)F#y2Gbk@YkD? zIrcXPcm0mb+$|`P{o+LDRY^9SvS;T#{IszvBIzwHzX9ku8C1eXI3O?ua(* zR-)8Cous_nF3>_R(qp&XnUQNY(Uc_|-Oh++U1uw-g0fpuxOPG%hY6DPbv|y^xa$pH zs21YtT$<5hx-4{|of_waGzp?Ia@yqPQod=CbR@n9f_2eoxkEbwuk5`ihj-0RSq!n+ zJsM99vgPu3uQ|6OuLDTJWcWyIO{T54G^xkNv3jD~oU zGfak z0fw_jcllyUTh+2IUcBqbdx2TSF|xkP<^?sW9#Ly-mG)Zu3p8Xo{*%1R_du*4C?_h^ zf2b!A@=&&*erxX0-FK=r^raSgv7`JuQH^@ymu$Sxhjj(6fO%nnNw9p`0?4;%)MF|;=*qR9IXg*Pb{zW zFZOlr0m}qm*CDT*2Sm`3m7d}?u^YQQRjd)8B5CTOYPrYrH8d}S7~Xt`A2;bPjFi|L zRDP!=R5nl74l&v#QgRt@u+#M@aw$O*mgxV*z8M5fH&*SuKKS<86LVE;_mNGQc-7;s zsD{?C_fzkyOr}^1+IA~<+?9pzPRh{pG@u7~fu_-a^9h)lgjm(}dwyKRu3 zxdkVZA}maCdjZ4DBo2!UaucR0-=8YlackVkAqh@bBccrW)X;Gv>Z{Ye@SR3r>gD(= zIvR`xI$5!*jhMv4m}!k_(`hsQfY47;{dsY6x03e_1wwim@m)>)iWa&{W|n5f*^%GVS|{q- zI^s!2M7OQnM4nTVC;2$1?l3*jR^WLial8Po9Q~?1J($N;<#pvDX-G({ME>L~wQwkh zM*K-OBg|*@JTawW<7YwKY*mvP@&*v#a9Y`(ZoU&lzya0wpVM1pPC`Xh0^Ee~GTpCq zcQ5KzcCi;8Z_36wd=Yyek&qxO-%fm`z50X!=6R#ClNx4#Vcvqmh1sP+unb3yUw8OX ziBa;^ZLav&$_AIhlY_uwFn&jRKwWrw1!$k1i2qq>V*QEeW^>(IPliWZbx>T062Gd0 zwX+#d5qG4X{CAs}gcKb^~1e`34Ucy#*(Yl%pDU#R6Tvg7FM}|9%Sv5>Ek&hEF=7lN?O(xF| z_bymep`D#G4J`>nc_yTCAHG>~7?tES^*R?Hnldh_u1Gx8IK~gJG_P)$0-cMMDmmoT zntdYd>wELX$E>b+$6+UDc0}JW9-7?gYd2cKzdil3xjt_H6u~45gRyx;NW@5MP30m2=f9cghAFSTju%eUwTr9V}ajHxI>vVyCpDcCq*78${l>*nS&1w+%EX}g(C1Bac|gq zicED1Z@}soCt2wbfTm@jG}{Sox^8q-UD7gSdW-z45+=8&+3uSsE%C$F>6KtPO(CRD zN6qc?)3(qzdhu$gV4;15N`b8y4*vYp?uvLHD;rF&g(kv{IKLCu>~)ISaX6>HdCPHk zeAr>l9UC>R+Rr)t>GibEu}(Hckpwx`fU4U$DerJPn`}2pujAgB^TWtMiVTy<{m~KH zsK<~xB_(o(F2c~SU)QVsyQ+`yYguK)KC_zHV2YIot-QM=5kfrJNOIYEF(Z4sQh$5N zk~|pmls$GRH25&|tRmd_!KLQ(dFi0CVaM^T!iw(L=hQ9Dlc+`vQdC8o!I5M5`w?8I zcv}r=yi6Anwqdd3l;CS^s~*0Z%U+0ke1m_$>O0>I+Q-CLfhSTZ=F263@dk*0?dY-@SHfR{p$6O#>a1i8H?knqvg_T>G{{ z^?$;8+e_DO0!(il_7i3II-YP8csa(nJnM0A=rpkYP@Ydb&Vdw!r$5lUH+U+t&=60p z>aMRVTAP!5Yy35JTfEdlJkr0&y^i%4s#^(+NmEgEiyMY2O7;bkGaoy3y!p|+l(N); zmV5!&Sd%}CdQkzU`nqj=`PN_GCSc9hG26Myz9<95?Y8yxu>4k=1ba@)u}XrcPX$`p zjqaThBf-dl+*wJZBgx{EW8Nf=9;5?hdj+Fc^`;#N~oBT|l3Lqx`ow7l=n`~zQTgJ~r@VlC)b)KK8(*6~-&EDOy zVJAgl{HOj;+iJ5u7l|9Sz2QJ`%R8jLwSs`45^%_-GuB=DY)22;qqxGwHfA{O z(k$3w_3*8Ll9*jt_Q{?>A2y%hEJ0Qo=2`;ZS>?~L)&^zXMUm$BcIK!qWSKPgfMSfK z&@O*KVc+hLlj03n+6%wKmdjIdzg5T9C*O{GDoeo>15oxkL+i$DlxNV0vA7MijgZ*)jHUamDxtO6*HSJI(yc zaS|hi5dRy-Dw!Jx7_XB1#_VAJ{CiJE*DADmI7;B7<8PWBin^0}%bjv*56R~IatfsN ztH)I~-vE`8DwgO6(yx6Nl~aFy5{3emNlrF3K~RehIO#YD zv|s+IK`En>)wNY7b}r|OPHS;&tNMtGDBSkUI8-w^4cAZTvEGcF$gzM{ zD~TM^&!!req6M1Xy~s}yLVb480qQ%a-X3jzd+n9WIawJcH?u^fgu956>G^D-p~Cq& zFJf)TX;JH`5p@K{7BCGeSTL=~DdC`Ds;bIjyc?<>0BWfGV^0zfhkd8h)ZJ$ratbYf zzO~T2^q$;3k#6P_Oc9FZXU|Zg4Ab-rOFF((e3S=(*St+Tid9Q@47@4>P_x>DaVI{0 z-%2g!*RP0(;cwvP{ycFYb2#FTj7*uJ`ho`^7us;=<)GKB6tMM;PRL0=>&*<(aA3;5 zhUrnFI`@`o;!#7EPW^Bw^o$7+4`%!RRb0?~Svq8i^^N$6Fm>bEMd>w7sVix$qjh~l zy35>qH1l3YziE_4NJ4!~aZKN%rpFJudhb>Y(@}4QuHiAruM!p9C|JcmA*o@uk1$+K zC(81=>qulCkEI$LE9WP z`0D-=p+P2AEGrQOu}c_u{R(=rb_}ym)S4Lgp5>q2hVviGw4Ar>Y?GWq?M{L!-8Ky~ z^6mj;MhVip#9-5G+DGTu4s9eOSun=Wq>NyczHrYYs_g_uzFrH9X~`{wJHV+RDM^i$EAKj&ZU-g!tE zW$<;Xzh7hWQRI{}bXXeh)eSOpUqLKJ9t>N&GDokozwN#etnnA%#Q-U1M$Y}?R3>Nq3r z0egx0wLRK4Na-O`7FXQnPXcM-;3-IkX17A3=o~VXq72Z8dda;!Z}O-|3e3Tam~!7+ zG=#BxrXLG$m@V?Ixm>P^>*mG`E+`Vc^$yzf(GO(f>0(vYwrR_&TMcmdv}+Jh_m2Mq z^kQTvz+`bjdsAD|f%jW+|8fE^AGCG-*rcVUNB7Sad(UP%c|zG8=+5+@hja5r3pB*$s1bzk}SE&hI!X zy{&7?r1?%FpL}L;Ln9(wnIMV(i-zgwFctzb>{_IqsCk>z!|taIW#J6Bc6;U1tG(Kq zK*KuzIPxk&LqnM1M%3{h_$9C*LqT;`=1B`pALfykv$EB1LF&B+Y)r;+LI=$kX4cZL zraM~c#xoF~U85lx+gy$e+#80F{rs;{k6v$hb29*L>=S7{f#f&hdea>EefUdKD>_+W z7RS36w$MNte~q^^pBLiqj^not;2dOcEAX-VyWJ7{m5{@K!dcpLGWK*vLJ@nFXvZ2& zN!{Yauuk}-R{i7W{P|7yJcGKg8Tvf(9)L?^v)1Lkvbsg##FKhVP1_W+rudY*pe6A^ z_V6Y$sv{nJCkghnF>|}-*JcU~Q6H%I)@-jg8)Lb8#@L6ftd3uf&daWR31)DouB3Wh z{LA;OLQ-eBoH8dMZ6c{yOw8dLGnXG!x=q-Q{Oc>{;xET_H@(*7dZq>u;$c`B8+da& zsG8nyGX2%S46U8fJy2q?=R@;RVDy*QAzt0*d!R6$pnkGFK+b{Ae~k^Pf3@1*!r9aB znCoPiu*9^Zjz}KFv7as*Q%CcftpO#blDRbkC;wz1O3uXUiZ*>Kg|5C7TVznxiaYI> zYhqKG;GFmeLd>TP>s|N2f@FzQf#)K2ef_(hMv+iWC34h3{)ho0cK*CjGAhQon~w5RYrwlus~s&GCbb?uVxH`ai6qIT=*cGK(qw z`@dlT=K#eV+hCQ_L&dVyHDbm&U)%IUi})y58oN&*1HMX0mck2l1;1$!e{JKACOJL20>U6=Vow!*rn1lgS z?PtENh%kN2=`Z#R->X!_SA-rh$+qa5k@aR0RYS~3l`l!L2jvy%QjOP{jZis7`Hg5?hzWTY!#L~^j$Uus;X0EEX^U-wMl(>seJ;s7`Cty(lZGC;J zP$yloeC1t}60Z5ea`>ji5$Stj30`CzOPsh*gz3BGCeDyK!{NRV;Ys>L0st5$u9~>X zR(7XhZc8(a?+mhvHWS~A*vd%djM-lpef==rzRt$|A_JLF(z5pCJ*BD$Iys8Xb$~&K>YszRMT zLta5CZG7GE;qsx%pb6N?BD*t#Mr&iz@jWov|2BaYJ?y*F?65+mGtBj9aFsTi>%ijZ zEk#90;vCDZvQ2&J82Px*-Ix;X55qU|+vCZm-Y}&VmQKv_a)CR__H0@R?*sEBG0-=; zktglp(s*xa6)z3NP-|-C&9PAwc}nsMz~otatJ9oi@t+1=iFvdwbOhaAowS9vQour2 zaJja{4a?>n_>2tOsT`Qrt1-mCKBv!^X81%c(qH*$KR;{Y>CID?#^m6uY0;`rfsF6# z0%eS26ldl*f_>9ZR^F=XG}Q7@i!1AEr|Sl!B#sKq!~kQ`%@@F=Z0iT92a^#N4H0KW zNe?Ibe%Oyf99@Ere@xyya(AD+rR*mS{kiVVA<=dbHIBZA}pHgO;w;Dcuo5!DDHZt%3w5TAg(rNcZe7ZwO z&?|^!-^mlhWOIl-rmCplEc%*OVai{`=ZiyMBW;+|9%4=Jvvh!MrNlHXuRK_s2A!VRWNB3~^@b(->>a5^$pcw*6y2)iV}Vz-5!G6G{O6Y`x1mx; zI}rrt8!8qdis_6qm5cu+`&@_|`8hp1w?XCRnzS*-ITjV}Z8 zuW{fhQL7%~$*azh+*^<|_0*x}evWpsEUcqE7V_aBtZRER|Chf8nhm~`2rz+&bS}#p znJOaIuQs`n~afgF;r0%;HE+kkzHL4Ai zrSdQBotO|3o$##-WsZXyzuZ~19o1K&Q+jfGs>IHAa?o{D7~H-*oe`7!wg6KUlBF>F zs|h-HCDo#L@vT|MLL*)p@z6eF8G11khQdIyy^3{s3e&cW9HK?zQuXD3niuJ zH`|u1Nx`&s3pEczLxW9o`EDN^vqanqa78RrJ7|vIO7O{lwY?ne2J>$Omf{ZbF!QMB z{=j*5ZT=Op%bpg^VG$F?esmA?1QNF~a$v@M=a!A0K@yTB720f; zzfBPl1qmSWlb``9Ec5+%(NI6HJ=!Jv48_Ie`F=0U_Tg;Yn&MPmBc!zk65pdUy)RJv zIn?n|a6EDAVT@CX9x-5pp*z)*u{If=M!T1>TEE^Hqd15=1Sv~K`iPRl(A$)X?u0>g zswext@<-fteNp|B`rR*WgM4?IiFKUdFn>e@lzZKV;xc5M&D$>kh=2I-5(hC^odsewswdnq%Hd;51)?)bq^9 zJszQo>6m7BrLsq?TxYBU_vOO&q2uV_(>U>i`LcGop%~hc@__LhG1$(C;Wt=(DL5S7 zF?_w-Wp12UiZ~PEKaqbQmXl1GQ^ML%(Pn_r7#o>#>Wv5ZWj8EKp&EcmJBjQB2|8`8 z82356s^m|Jtv9kZ5>k_7#jCRmPb;oK1+Kk=Fpq*zqodni9{Y5o(7T3?oN3~6=b%C* z=9!AJti}~CwVW;elL^Hs>**LsBb%IcCu)Y&5yeC_j(a$R_`24rpU#Fp=EdV|?#Ei~ z91+vW{gC3C(UemK)>dcpT-j`6_DOrY7N;8Li=z1=x#O~b^W}b+CpweD8J)Yy_*xNY z1y)>sm(;PO{4F!8e1HGVNg`H^WAF0>6-mgtBuZV#<;CYCfv`P7WBr9)*LHDUoU+J) zD-E%jVACR9)9QPmQ>mIAu`}0E0o@}tELZrtxWb-HWU8~mB0j6CJGwfJo zIaWXB4C}tzEN~?rN{9B8O&znnWt$ZdKTYfo5PZnd#etJ2S#D@}DaEo%!`HFu{=uB* zxQ;E!TgP`!*Wqrf--HH+dCcDRwrN}4RwtQY?hsEe=sP-WdeQ{*?qjo1{t)g(i*-8u zOBwBt2BXilPg7JvS~DQWTW^dXeXMkR|5Y2`+BK(W$ivHo4;H`A^*idQ$irVv`heqW~U_;8N}xo+QR*DW7qkaZ!vk!LXe5~(5@ zteE7bbS7R>U*e+sK0e?4TNrRRvoKA(nnM!!*q^252(4{}me~Gir&GN;X=+z#Tn@^@ zwjAem6fvI|4Ri02qLzFNyVy|@%d%F&CdVUH`WcGYrSep>85m!V#A#1Ep>= z{4Cd7KQ!udU$R}ME%)U=xmJfWv?akSd{U}e2jIhkr#7f7O}qC1KJ4udlw*2ys8G38 z|I^$>#%tcH`Jx^SwrBnikZp=eXqcxBHKP@r#9w&cG`OEOk8mUwi+!M;ryDtn@m$uO zZ~0<`9`xN%Rb^W5@f`-0d?P?$4LnnNk7G~YcXS)QYsyh0*Au-G(?t=fM8(22gQvYI{0-bjD5)7hdkEP1hVq=3)wtt0z1xn zIF(kcv)x3ey|v?_3m(7R8~bG+LH*?JMOjZDvlRpd!1nBw6AXlWl_*6bP}M?#jFlU8hXNS_vTiRIfLE^2;EvU-WxzE6zum^TVOU8iI^A4g z`TdVMt)tM-JEjMq6 zRB*a_t{=;gpDpqG(ORCHH=eIoMHK%p8#|#+XZGYqEDa+fPpG7SXoPqDwyE zXRy#_`SA1fYi9%m2HXQb&K#!Q-jX_}IiHAZdr)E<>K{xEPud`R9TSCb)jli9Ev)0I zdDv{L(Dzye3B9mVVA6=8A5afY4o5kTL#)Va8VXN_@`k(2YThjZC0P{y-!^n?wRTnb zbiEtWjt*Bve~SjJ~7j3588QqyjWm`ZK7;Z2lQH|MFAdU~|r;yY6}hdOoL&Vrz6Cew2xR4nItvR*j)}Vc*jOAAk?6BlqHAA`7Fq zjx}$!)8c!8A#)%vseP1G%*~UxF-UZ=^-R7+{ol*O#$Ma)8^0r6@Y&##M8;jVdUK&Z z0-NTf(h>B~+HhDp8owP*pKxI(SVOtexb;Nrdzc>Y@pa!0*#-4Q^b;jlGqRGC)3i=h z!RnOKg>6Fi-g+(~_sA~GjYqHWJ1{*onyVRk@(xR7FP!elkYS^IUdWDvC2DT{$%4Y} zsEeOx<>z*&$3%8o8{!Khj{gN~y_RdVGJ7D4Cwin~)`z>s{zoyvP03diKX;DjA7P5) zQpViIk4#*{iMIqV1TPH|%tu(C5{!&;7xhkk3SeZ3^q8`XaV_o3c(CO%mpJ0|7OtJ2 zrOfTmDL)DE5m;!Cjs>AY*RMI0XcAj8)X3DK!1 zpFQMrHn7$~=ps_(@}LUB8R;M&iY;M0Rpu;lYJG^02QzrU70S|#eYJK|hnGi<)a_4v zOe6&>5s0}vgov=fQ5+7?a->+bkp+%zx{5Bqow~@vd{tY!rubdz&2)FFi_NUX@Nr`w z?jKjqnvD*$L{h?MT^CbnAXSbeEh&F1}THYDxyq zH2;+uMC>d1(P1lac$%*)mZ}QaeoVz9(u)ppTNlWD*w|?B5tgQuolmM8G`3Bjmb?c?)>X^iRmwQCF>L03uQEmi7zo`?_3Iy&Ll>Rj!iLbO*oE; z!wbC&=3o&zb-YdiA4p`w!fV3{a*pW2R`_}3*STWU+nHm?`3P#LSmz9CsMI2oQim0Ed7F z8TF$quNXH|nYh~4ZRzIkrQeWdF`ZPYxTP!J=_T^hqCTcC^5;1<8k4zlYr>-V<>6bO z4%+Fq-)ghfhRCiiu5H?1Cyca=tM`fY_pYDA{{RuZKYy=9Z++rT9W9#Kq%tbBZXb3P z2xE^^UcEeJ8A{3Sc~vk~Vw-&rQ{99l@^evc&*fZw&x`Ej)+L8Whx=;ECRpT}-sUjI zLNkDb@D&7#NwPyjJb znHEcOjnS6}>0HIPigZiKZPGjV(n&}WM=CUK#GDKU0Q1_qN!-8?+_uO#H}xfQ*%QOhKVr5V_<=e;9Y!q)P|$XOgSka;9ypRW~TBRM~f zDQ@6bMLaZP3ok#!&UK{ad;b7PuMA5Iy8x?_eo#I0RUKt*W*JzWishFF{fuD#wRy?F zJ*yj0)%49V;~Itay^(g>o^$O4p4p{{q?IV9?W!FKPE{q!uG;8r#>9d>4N0C!&w9?a zxr%vYSmlY_07zE_fITuhRq?>@UGU|59J9LJ9=?1%IS#REP|iU9G%7*-E8{ChVcsIoLF(H4#Qz{g7Y^Txjjul!HrE6q&nD{7Z7xz(ZG!+62<6 z9`UWDI<~|Z6DcP zqcA8x!qEedY>Mc0tHD|lX?Zi^ydmtR%vdGxO4@8Q0Z`qWySvd;#i z3x|&8Mqx4$(++v|sQgXgTfY_fcp>L`}4(N>0p_(@S@-V>%`PTSM&b=AMB^L*} zcTIXdQ(tk(jLW^Zy=I@0#L1#Z1fowSYiGuHZD{`hUMg&AQR$LdL#t|0TRIeIg~M$i z_QiS+hU`39;lBr+4(+4yHk21+DX6hBM4dKo!7M(!k6QD%{43(m4}3#9zK5qR_lM;< zxY2cK%;=z=RyjWM^U9N)bm@$GG&A`*PBWu!%}H7QO?>q8JlW+lR%(BGfACEf*8Eld zv!~tMYd059X&`u>NYuKJ2pr>)&2_Eg?PFD+Oga zbTU{=xXQhLP4Eo3JzZ*Ug$e)rW|6 zX>4?YFK^>Q(%OXEGJtS$jf279j-sw#Xy(#Tx7JcxGkxDWJ)4iVde^ZWYI0DF(|xb2 z{LVK)B;4TF$okt(@kfU5d@FURHos;b-ZLc81;9)$?W%gW)}^(M(_GawU-(EgIU%=6 z)^N8C9Ey#Pmyk#;`Pat3*|x?vP@EitgTbo|+K1T9y6T#khk_#)Pl1k@=Zsa=e%hb2 zsJWNs{{YBT`DxFd4$t)RK7sJ(i0^eD8hFpfclNMBV?F$lLm(q5Z3}sEr~{MGoDOo; z>5Hhq=opz4p2j8z`B%hxZO*x6=0gszc8MLz%NnV`1z0lvM1D2sQ2bN)f{+Co#81h| fYj98Vt#BBK!Y<0!*KWN`v2;1-d*0f7x*z}9I;jH( diff --git a/node_modules/bower/node_modules/bower-registry-client/package.json b/node_modules/bower/node_modules/bower-registry-client/package.json index 7aa42ce..add7c3b 100644 --- a/node_modules/bower/node_modules/bower-registry-client/package.json +++ b/node_modules/bower/node_modules/bower-registry-client/package.json @@ -1,7 +1,7 @@ { "name": "bower-registry-client", - "version": "0.2.1", - "description": "Provides easy interaction with the Bower registry.", + "version": "0.2.4", + "description": "Provides easy interaction with the Bower registry", "author": { "name": "Twitter" }, @@ -13,18 +13,18 @@ ], "repository": { "type": "git", - "url": "git://github.com/bower/registry-client.git" + "url": "https://github.com/bower/registry-client" }, "main": "Client", "engines": { - "node": ">=0.8.0" + "node": ">=0.10.0" }, "dependencies": { "async": "~0.2.8", "bower-config": "~0.5.0", "graceful-fs": "~2.0.0", "lru-cache": "~2.3.0", - "request": "~2.27.0", + "request": "~2.51.0", "request-replay": "~0.2.0", "rimraf": "~2.2.0", "mkdirp": "~0.3.5" @@ -32,8 +32,9 @@ "devDependencies": { "expect.js": "~0.2.0", "grunt": "~0.4.1", - "grunt-contrib-watch": "~0.5.0", + "grunt-cli": "^0.1.13", "grunt-contrib-jshint": "~0.6.0", + "grunt-contrib-watch": "~0.5.0", "grunt-simple-mocha": "~0.4.0", "mocha": "~1.12.0", "nock": "~0.22.0" @@ -41,17 +42,16 @@ "scripts": { "test": "grunt test" }, + "gitHead": "3befb11a12d234707084fc10d397a26263b2db22", "bugs": { "url": "https://github.com/bower/registry-client/issues" }, "homepage": "https://github.com/bower/registry-client", - "_id": "bower-registry-client@0.2.1", - "dist": { - "shasum": "06fbff982f82a4a4045dc53ac9dcb1c43d9cd591", - "tarball": "http://registry.npmjs.org/bower-registry-client/-/bower-registry-client-0.2.1.tgz" - }, - "_from": "bower-registry-client@~0.2.0", - "_npmVersion": "1.3.24", + "_id": "bower-registry-client@0.2.4", + "_shasum": "269fc7e898b627fb939d1144a593254d7fbbeebc", + "_from": "bower-registry-client@0.2.4", + "_npmVersion": "2.1.18", + "_nodeVersion": "0.10.35", "_npmUser": { "name": "sheerun", "email": "sheerun@sher.pl" @@ -72,10 +72,20 @@ { "name": "sheerun", "email": "sheerun@sher.pl" + }, + { + "name": "paulirish", + "email": "paul.irish@gmail.com" + }, + { + "name": "sindresorhus", + "email": "sindresorhus@gmail.com" } ], + "dist": { + "shasum": "269fc7e898b627fb939d1144a593254d7fbbeebc", + "tarball": "http://registry.npmjs.org/bower-registry-client/-/bower-registry-client-0.2.4.tgz" + }, "directories": {}, - "_shasum": "06fbff982f82a4a4045dc53ac9dcb1c43d9cd591", - "_resolved": "https://registry.npmjs.org/bower-registry-client/-/bower-registry-client-0.2.1.tgz", - "readme": "ERROR: No README data found!" + "_resolved": "https://registry.npmjs.org/bower-registry-client/-/bower-registry-client-0.2.4.tgz" } diff --git a/node_modules/bower/node_modules/bower-registry-client/test/Client.js b/node_modules/bower/node_modules/bower-registry-client/test/Client.js index 63ce875..ed3b318 100644 --- a/node_modules/bower/node_modules/bower-registry-client/test/Client.js +++ b/node_modules/bower/node_modules/bower-registry-client/test/Client.js @@ -197,6 +197,7 @@ describe('RegistryClient', function () { describe('calling the lookup instance method without argument', function () { it('should return no result', function (next) { + this.timeout(10000); this.registry.lookup('', function (err, entry) { expect(err).to.not.be.ok(); expect(entry).to.not.be.ok(); diff --git a/node_modules/bower/node_modules/cardinal/package.json b/node_modules/bower/node_modules/cardinal/package.json index bfa0ed3..76262f2 100644 --- a/node_modules/bower/node_modules/cardinal/package.json +++ b/node_modules/bower/node_modules/cardinal/package.json @@ -61,5 +61,6 @@ ], "directories": {}, "_shasum": "7d10aafb20837bde043c45e43a0c8c28cdaae45e", - "_resolved": "https://registry.npmjs.org/cardinal/-/cardinal-0.4.0.tgz" + "_resolved": "https://registry.npmjs.org/cardinal/-/cardinal-0.4.0.tgz", + "homepage": "https://github.com/thlorenz/cardinal" } diff --git a/node_modules/bower/node_modules/chalk/node_modules/escape-string-regexp/license b/node_modules/bower/node_modules/chalk/node_modules/escape-string-regexp/license new file mode 100644 index 0000000..654d0bf --- /dev/null +++ b/node_modules/bower/node_modules/chalk/node_modules/escape-string-regexp/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/node_modules/bower/node_modules/chalk/node_modules/escape-string-regexp/package.json b/node_modules/bower/node_modules/chalk/node_modules/escape-string-regexp/package.json index 82ccd8e..159c316 100644 --- a/node_modules/bower/node_modules/chalk/node_modules/escape-string-regexp/package.json +++ b/node_modules/bower/node_modules/chalk/node_modules/escape-string-regexp/package.json @@ -1,6 +1,6 @@ { "name": "escape-string-regexp", - "version": "1.0.2", + "version": "1.0.3", "description": "Escape RegExp special characters", "license": "MIT", "repository": { @@ -12,6 +12,16 @@ "email": "sindresorhus@gmail.com", "url": "http://sindresorhus.com" }, + "maintainers": [ + { + "name": "sindresorhus", + "email": "sindresorhus@gmail.com" + }, + { + "name": "jbnicolai", + "email": "jappelman@xebia.com" + } + ], "engines": { "node": ">=0.8.0" }, @@ -36,34 +46,24 @@ "devDependencies": { "mocha": "*" }, - "gitHead": "0587ee0ee03ea3fcbfa3c15cf67b47f214e20987", + "gitHead": "1e446e6b4449b5f1f8868cd31bf8fd25ee37fb4b", "bugs": { "url": "https://github.com/sindresorhus/escape-string-regexp/issues" }, "homepage": "https://github.com/sindresorhus/escape-string-regexp", - "_id": "escape-string-regexp@1.0.2", - "_shasum": "4dbc2fe674e71949caf3fb2695ce7f2dc1d9a8d1", + "_id": "escape-string-regexp@1.0.3", + "_shasum": "9e2d8b25bc2555c3336723750e03f099c2735bb5", "_from": "escape-string-regexp@^1.0.0", - "_npmVersion": "1.4.23", + "_npmVersion": "2.1.16", + "_nodeVersion": "0.10.35", "_npmUser": { "name": "jbnicolai", "email": "jappelman@xebia.com" }, - "maintainers": [ - { - "name": "sindresorhus", - "email": "sindresorhus@gmail.com" - }, - { - "name": "jbnicolai", - "email": "jappelman@xebia.com" - } - ], "dist": { - "shasum": "4dbc2fe674e71949caf3fb2695ce7f2dc1d9a8d1", - "tarball": "http://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.2.tgz" + "shasum": "9e2d8b25bc2555c3336723750e03f099c2735bb5", + "tarball": "http://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.3.tgz" }, "directories": {}, - "_resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.2.tgz", - "readme": "ERROR: No README data found!" + "_resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.3.tgz" } diff --git a/node_modules/bower/node_modules/chalk/package.json b/node_modules/bower/node_modules/chalk/package.json index 6c3cb36..1427789 100644 --- a/node_modules/bower/node_modules/chalk/package.json +++ b/node_modules/bower/node_modules/chalk/package.json @@ -72,5 +72,6 @@ "tarball": "http://registry.npmjs.org/chalk/-/chalk-0.5.0.tgz" }, "directories": {}, - "_resolved": "https://registry.npmjs.org/chalk/-/chalk-0.5.0.tgz" + "_resolved": "https://registry.npmjs.org/chalk/-/chalk-0.5.0.tgz", + "readme": "ERROR: No README data found!" } diff --git a/node_modules/bower/node_modules/decompress-zip/node_modules/readable-stream/node_modules/isarray/package.json b/node_modules/bower/node_modules/decompress-zip/node_modules/readable-stream/node_modules/isarray/package.json index 04d6a3f..85aec01 100644 --- a/node_modules/bower/node_modules/decompress-zip/node_modules/readable-stream/node_modules/isarray/package.json +++ b/node_modules/bower/node_modules/decompress-zip/node_modules/readable-stream/node_modules/isarray/package.json @@ -26,8 +26,6 @@ "url": "http://juliangruber.com" }, "license": "MIT", - "readme": "\n# isarray\n\n`Array#isArray` for older browsers.\n\n## Usage\n\n```js\nvar isArray = require('isarray');\n\nconsole.log(isArray([])); // => true\nconsole.log(isArray({})); // => false\n```\n\n## Installation\n\nWith [npm](http://npmjs.org) do\n\n```bash\n$ npm install isarray\n```\n\nThen bundle for the browser with\n[browserify](https://github.com/substack/browserify).\n\nWith [component](http://component.io) do\n\n```bash\n$ component install juliangruber/isarray\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", "_id": "isarray@0.0.1", "dist": { "shasum": "8a18acfca9a8f4177e09abfc6038939b05d1eedf", diff --git a/node_modules/bower/node_modules/decompress-zip/node_modules/readable-stream/node_modules/string_decoder/package.json b/node_modules/bower/node_modules/decompress-zip/node_modules/readable-stream/node_modules/string_decoder/package.json index 379f735..a8c586b 100644 --- a/node_modules/bower/node_modules/decompress-zip/node_modules/readable-stream/node_modules/string_decoder/package.json +++ b/node_modules/bower/node_modules/decompress-zip/node_modules/readable-stream/node_modules/string_decoder/package.json @@ -49,5 +49,6 @@ "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" + "_resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz", + "readme": "ERROR: No README data found!" } diff --git a/node_modules/bower/node_modules/decompress-zip/node_modules/readable-stream/package.json b/node_modules/bower/node_modules/decompress-zip/node_modules/readable-stream/package.json index 98169d6..4a65f0f 100644 --- a/node_modules/bower/node_modules/decompress-zip/node_modules/readable-stream/package.json +++ b/node_modules/bower/node_modules/decompress-zip/node_modules/readable-stream/package.json @@ -65,5 +65,6 @@ "tarball": "http://registry.npmjs.org/readable-stream/-/readable-stream-1.1.13.tgz" }, "directories": {}, - "_resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.1.13.tgz" + "_resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.1.13.tgz", + "readme": "ERROR: No README data found!" } diff --git a/node_modules/bower/node_modules/decompress-zip/package.json b/node_modules/bower/node_modules/decompress-zip/package.json index ef6ed4e..9d2f9e4 100644 --- a/node_modules/bower/node_modules/decompress-zip/package.json +++ b/node_modules/bower/node_modules/decompress-zip/package.json @@ -81,5 +81,6 @@ "tarball": "http://registry.npmjs.org/decompress-zip/-/decompress-zip-0.0.8.tgz" }, "directories": {}, - "_resolved": "https://registry.npmjs.org/decompress-zip/-/decompress-zip-0.0.8.tgz" + "_resolved": "https://registry.npmjs.org/decompress-zip/-/decompress-zip-0.0.8.tgz", + "readme": "ERROR: No README data found!" } diff --git a/node_modules/bower/node_modules/fstream-ignore/node_modules/minimatch/.npmignore b/node_modules/bower/node_modules/fstream-ignore/node_modules/minimatch/.npmignore index 3c3629e..b2a4ba5 100644 --- a/node_modules/bower/node_modules/fstream-ignore/node_modules/minimatch/.npmignore +++ b/node_modules/bower/node_modules/fstream-ignore/node_modules/minimatch/.npmignore @@ -1 +1 @@ -node_modules +# nothing here diff --git a/node_modules/bower/node_modules/fstream-ignore/node_modules/minimatch/README.md b/node_modules/bower/node_modules/fstream-ignore/node_modules/minimatch/README.md index 5b3967e..d458bc2 100644 --- a/node_modules/bower/node_modules/fstream-ignore/node_modules/minimatch/README.md +++ b/node_modules/bower/node_modules/fstream-ignore/node_modules/minimatch/README.md @@ -7,8 +7,6 @@ A minimal matching utility. This is the matching library used internally by npm. -Eventually, it will replace the C binding in node-glob. - It works by converting glob expressions into JavaScript `RegExp` objects. diff --git a/node_modules/bower/node_modules/fstream-ignore/node_modules/minimatch/benchmark.js b/node_modules/bower/node_modules/fstream-ignore/node_modules/minimatch/benchmark.js new file mode 100644 index 0000000..e7deca3 --- /dev/null +++ b/node_modules/bower/node_modules/fstream-ignore/node_modules/minimatch/benchmark.js @@ -0,0 +1,15 @@ +var m = require('./minimatch.js') +var pattern = "**/*.js" +var expand = require('brace-expansion') +var files = expand('x/y/z/{1..1000}.js') +var start = process.hrtime() + +for (var i = 0; i < 1000; i++) { + for (var f = 0; f < files.length; f++) { + var res = m(pattern, files[f]) + } + if (!(i%10)) process.stdout.write('.') +} +console.log('done') +var dur = process.hrtime(start) +console.log('%s ms', dur[0]*1e3 + dur[1]/1e6) diff --git a/node_modules/bower/node_modules/fstream-ignore/node_modules/minimatch/browser.js b/node_modules/bower/node_modules/fstream-ignore/node_modules/minimatch/browser.js new file mode 100644 index 0000000..2b86fae --- /dev/null +++ b/node_modules/bower/node_modules/fstream-ignore/node_modules/minimatch/browser.js @@ -0,0 +1,1181 @@ +(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o any number of characters + , star = qmark + "*?" + + // ** when dots are allowed. Anything goes, except .. and . + // not (^ or / followed by one or two dots followed by $ or /), + // followed by anything, any number of times. + , twoStarDot = "(?:(?!(?:\\\/|^)(?:\\.{1,2})($|\\\/)).)*?" + + // not a ^ or / followed by a dot, + // followed by anything, any number of times. + , twoStarNoDot = "(?:(?!(?:\\\/|^)\\.).)*?" + + // characters that need to be escaped in RegExp. + , reSpecials = charSet("().*{}+?[]^$\\!") + +// "abc" -> { a:true, b:true, c:true } +function charSet (s) { + return s.split("").reduce(function (set, c) { + set[c] = true + return set + }, {}) +} + +// normalizes slashes. +var slashSplit = /\/+/ + +minimatch.filter = filter +function filter (pattern, options) { + options = options || {} + return function (p, i, list) { + return minimatch(p, pattern, options) + } +} + +function ext (a, b) { + a = a || {} + b = b || {} + var t = {} + Object.keys(b).forEach(function (k) { + t[k] = b[k] + }) + Object.keys(a).forEach(function (k) { + t[k] = a[k] + }) + return t +} + +minimatch.defaults = function (def) { + if (!def || !Object.keys(def).length) return minimatch + + var orig = minimatch + + var m = function minimatch (p, pattern, options) { + return orig.minimatch(p, pattern, ext(def, options)) + } + + m.Minimatch = function Minimatch (pattern, options) { + return new orig.Minimatch(pattern, ext(def, options)) + } + + return m +} + +Minimatch.defaults = function (def) { + if (!def || !Object.keys(def).length) return Minimatch + return minimatch.defaults(def).Minimatch +} + + +function minimatch (p, pattern, options) { + if (typeof pattern !== "string") { + throw new TypeError("glob pattern string required") + } + + if (!options) options = {} + + // shortcut: comments match nothing. + if (!options.nocomment && pattern.charAt(0) === "#") { + return false + } + + // "" only matches "" + if (pattern.trim() === "") return p === "" + + return new Minimatch(pattern, options).match(p) +} + +function Minimatch (pattern, options) { + if (!(this instanceof Minimatch)) { + return new Minimatch(pattern, options) + } + + if (typeof pattern !== "string") { + throw new TypeError("glob pattern string required") + } + + if (!options) options = {} + pattern = pattern.trim() + + // windows support: need to use /, not \ + if (isWindows) + pattern = pattern.split("\\").join("/") + + this.options = options + this.set = [] + this.pattern = pattern + this.regexp = null + this.negate = false + this.comment = false + this.empty = false + + // make the set of regexps etc. + this.make() +} + +Minimatch.prototype.debug = function() {} + +Minimatch.prototype.make = make +function make () { + // don't do it more than once. + if (this._made) return + + var pattern = this.pattern + var options = this.options + + // empty patterns and comments match nothing. + if (!options.nocomment && pattern.charAt(0) === "#") { + this.comment = true + return + } + if (!pattern) { + this.empty = true + return + } + + // step 1: figure out negation, etc. + this.parseNegate() + + // step 2: expand braces + var set = this.globSet = this.braceExpand() + + if (options.debug) this.debug = console.error + + this.debug(this.pattern, set) + + // step 3: now we have a set, so turn each one into a series of path-portion + // matching patterns. + // These will be regexps, except in the case of "**", which is + // set to the GLOBSTAR object for globstar behavior, + // and will not contain any / characters + set = this.globParts = set.map(function (s) { + return s.split(slashSplit) + }) + + this.debug(this.pattern, set) + + // glob --> regexps + set = set.map(function (s, si, set) { + return s.map(this.parse, this) + }, this) + + this.debug(this.pattern, set) + + // filter out everything that didn't compile properly. + set = set.filter(function (s) { + return -1 === s.indexOf(false) + }) + + this.debug(this.pattern, set) + + this.set = set +} + +Minimatch.prototype.parseNegate = parseNegate +function parseNegate () { + var pattern = this.pattern + , negate = false + , options = this.options + , negateOffset = 0 + + if (options.nonegate) return + + for ( var i = 0, l = pattern.length + ; i < l && pattern.charAt(i) === "!" + ; i ++) { + negate = !negate + negateOffset ++ + } + + if (negateOffset) this.pattern = pattern.substr(negateOffset) + this.negate = negate +} + +// Brace expansion: +// a{b,c}d -> abd acd +// a{b,}c -> abc ac +// a{0..3}d -> a0d a1d a2d a3d +// a{b,c{d,e}f}g -> abg acdfg acefg +// a{b,c}d{e,f}g -> abdeg acdeg abdeg abdfg +// +// Invalid sets are not expanded. +// a{2..}b -> a{2..}b +// a{b}c -> a{b}c +minimatch.braceExpand = function (pattern, options) { + return braceExpand(pattern, options) +} + +Minimatch.prototype.braceExpand = braceExpand + +function braceExpand (pattern, options) { + if (!options) { + if (this instanceof Minimatch) + options = this.options + else + options = {} + } + + pattern = typeof pattern === "undefined" + ? this.pattern : pattern + + if (typeof pattern === "undefined") { + throw new Error("undefined pattern") + } + + if (options.nobrace || + !pattern.match(/\{.*\}/)) { + // shortcut. no need to expand. + return [pattern] + } + + return expand(pattern) +} + +// parse a component of the expanded set. +// At this point, no pattern may contain "/" in it +// so we're going to return a 2d array, where each entry is the full +// pattern, split on '/', and then turned into a regular expression. +// A regexp is made at the end which joins each array with an +// escaped /, and another full one which joins each regexp with |. +// +// Following the lead of Bash 4.1, note that "**" only has special meaning +// when it is the *only* thing in a path portion. Otherwise, any series +// of * is equivalent to a single *. Globstar behavior is enabled by +// default, and can be disabled by setting options.noglobstar. +Minimatch.prototype.parse = parse +var SUBPARSE = {} +function parse (pattern, isSub) { + var options = this.options + + // shortcuts + if (!options.noglobstar && pattern === "**") return GLOBSTAR + if (pattern === "") return "" + + var re = "" + , hasMagic = !!options.nocase + , escaping = false + // ? => one single character + , patternListStack = [] + , plType + , stateChar + , inClass = false + , reClassStart = -1 + , classStart = -1 + // . and .. never match anything that doesn't start with ., + // even when options.dot is set. + , patternStart = pattern.charAt(0) === "." ? "" // anything + // not (start or / followed by . or .. followed by / or end) + : options.dot ? "(?!(?:^|\\\/)\\.{1,2}(?:$|\\\/))" + : "(?!\\.)" + , self = this + + function clearStateChar () { + if (stateChar) { + // we had some state-tracking character + // that wasn't consumed by this pass. + switch (stateChar) { + case "*": + re += star + hasMagic = true + break + case "?": + re += qmark + hasMagic = true + break + default: + re += "\\"+stateChar + break + } + self.debug('clearStateChar %j %j', stateChar, re) + stateChar = false + } + } + + for ( var i = 0, len = pattern.length, c + ; (i < len) && (c = pattern.charAt(i)) + ; i ++ ) { + + this.debug("%s\t%s %s %j", pattern, i, re, c) + + // skip over any that are escaped. + if (escaping && reSpecials[c]) { + re += "\\" + c + escaping = false + continue + } + + SWITCH: switch (c) { + case "/": + // completely not allowed, even escaped. + // Should already be path-split by now. + return false + + case "\\": + clearStateChar() + escaping = true + continue + + // the various stateChar values + // for the "extglob" stuff. + case "?": + case "*": + case "+": + case "@": + case "!": + this.debug("%s\t%s %s %j <-- stateChar", pattern, i, re, c) + + // all of those are literals inside a class, except that + // the glob [!a] means [^a] in regexp + if (inClass) { + this.debug(' in class') + if (c === "!" && i === classStart + 1) c = "^" + re += c + continue + } + + // if we already have a stateChar, then it means + // that there was something like ** or +? in there. + // Handle the stateChar, then proceed with this one. + self.debug('call clearStateChar %j', stateChar) + clearStateChar() + stateChar = c + // if extglob is disabled, then +(asdf|foo) isn't a thing. + // just clear the statechar *now*, rather than even diving into + // the patternList stuff. + if (options.noext) clearStateChar() + continue + + case "(": + if (inClass) { + re += "(" + continue + } + + if (!stateChar) { + re += "\\(" + continue + } + + plType = stateChar + patternListStack.push({ type: plType + , start: i - 1 + , reStart: re.length }) + // negation is (?:(?!js)[^/]*) + re += stateChar === "!" ? "(?:(?!" : "(?:" + this.debug('plType %j %j', stateChar, re) + stateChar = false + continue + + case ")": + if (inClass || !patternListStack.length) { + re += "\\)" + continue + } + + clearStateChar() + hasMagic = true + re += ")" + plType = patternListStack.pop().type + // negation is (?:(?!js)[^/]*) + // The others are (?:) + switch (plType) { + case "!": + re += "[^/]*?)" + break + case "?": + case "+": + case "*": re += plType + case "@": break // the default anyway + } + continue + + case "|": + if (inClass || !patternListStack.length || escaping) { + re += "\\|" + escaping = false + continue + } + + clearStateChar() + re += "|" + continue + + // these are mostly the same in regexp and glob + case "[": + // swallow any state-tracking char before the [ + clearStateChar() + + if (inClass) { + re += "\\" + c + continue + } + + inClass = true + classStart = i + reClassStart = re.length + re += c + continue + + case "]": + // a right bracket shall lose its special + // meaning and represent itself in + // a bracket expression if it occurs + // first in the list. -- POSIX.2 2.8.3.2 + if (i === classStart + 1 || !inClass) { + re += "\\" + c + escaping = false + continue + } + + // finish up the class. + hasMagic = true + inClass = false + re += c + continue + + default: + // swallow any state char that wasn't consumed + clearStateChar() + + if (escaping) { + // no need + escaping = false + } else if (reSpecials[c] + && !(c === "^" && inClass)) { + re += "\\" + } + + re += c + + } // switch + } // for + + + // handle the case where we left a class open. + // "[abc" is valid, equivalent to "\[abc" + if (inClass) { + // split where the last [ was, and escape it + // this is a huge pita. We now have to re-walk + // the contents of the would-be class to re-translate + // any characters that were passed through as-is + var cs = pattern.substr(classStart + 1) + , sp = this.parse(cs, SUBPARSE) + re = re.substr(0, reClassStart) + "\\[" + sp[0] + hasMagic = hasMagic || sp[1] + } + + // handle the case where we had a +( thing at the *end* + // of the pattern. + // each pattern list stack adds 3 chars, and we need to go through + // and escape any | chars that were passed through as-is for the regexp. + // Go through and escape them, taking care not to double-escape any + // | chars that were already escaped. + var pl + while (pl = patternListStack.pop()) { + var tail = re.slice(pl.reStart + 3) + // maybe some even number of \, then maybe 1 \, followed by a | + tail = tail.replace(/((?:\\{2})*)(\\?)\|/g, function (_, $1, $2) { + if (!$2) { + // the | isn't already escaped, so escape it. + $2 = "\\" + } + + // need to escape all those slashes *again*, without escaping the + // one that we need for escaping the | character. As it works out, + // escaping an even number of slashes can be done by simply repeating + // it exactly after itself. That's why this trick works. + // + // I am sorry that you have to see this. + return $1 + $1 + $2 + "|" + }) + + this.debug("tail=%j\n %s", tail, tail) + var t = pl.type === "*" ? star + : pl.type === "?" ? qmark + : "\\" + pl.type + + hasMagic = true + re = re.slice(0, pl.reStart) + + t + "\\(" + + tail + } + + // handle trailing things that only matter at the very end. + clearStateChar() + if (escaping) { + // trailing \\ + re += "\\\\" + } + + // only need to apply the nodot start if the re starts with + // something that could conceivably capture a dot + var addPatternStart = false + switch (re.charAt(0)) { + case ".": + case "[": + case "(": addPatternStart = true + } + + // if the re is not "" at this point, then we need to make sure + // it doesn't match against an empty path part. + // Otherwise a/* will match a/, which it should not. + if (re !== "" && hasMagic) re = "(?=.)" + re + + if (addPatternStart) re = patternStart + re + + // parsing just a piece of a larger pattern. + if (isSub === SUBPARSE) { + return [ re, hasMagic ] + } + + // skip the regexp for non-magical patterns + // unescape anything in it, though, so that it'll be + // an exact match against a file etc. + if (!hasMagic) { + return globUnescape(pattern) + } + + var flags = options.nocase ? "i" : "" + , regExp = new RegExp("^" + re + "$", flags) + + regExp._glob = pattern + regExp._src = re + + return regExp +} + +minimatch.makeRe = function (pattern, options) { + return new Minimatch(pattern, options || {}).makeRe() +} + +Minimatch.prototype.makeRe = makeRe +function makeRe () { + if (this.regexp || this.regexp === false) return this.regexp + + // at this point, this.set is a 2d array of partial + // pattern strings, or "**". + // + // It's better to use .match(). This function shouldn't + // be used, really, but it's pretty convenient sometimes, + // when you just want to work with a regex. + var set = this.set + + if (!set.length) return this.regexp = false + var options = this.options + + var twoStar = options.noglobstar ? star + : options.dot ? twoStarDot + : twoStarNoDot + , flags = options.nocase ? "i" : "" + + var re = set.map(function (pattern) { + return pattern.map(function (p) { + return (p === GLOBSTAR) ? twoStar + : (typeof p === "string") ? regExpEscape(p) + : p._src + }).join("\\\/") + }).join("|") + + // must match entire pattern + // ending in a * or ** will make it less strict. + re = "^(?:" + re + ")$" + + // can match anything, as long as it's not this. + if (this.negate) re = "^(?!" + re + ").*$" + + try { + return this.regexp = new RegExp(re, flags) + } catch (ex) { + return this.regexp = false + } +} + +minimatch.match = function (list, pattern, options) { + options = options || {} + var mm = new Minimatch(pattern, options) + list = list.filter(function (f) { + return mm.match(f) + }) + if (mm.options.nonull && !list.length) { + list.push(pattern) + } + return list +} + +Minimatch.prototype.match = match +function match (f, partial) { + this.debug("match", f, this.pattern) + // short-circuit in the case of busted things. + // comments, etc. + if (this.comment) return false + if (this.empty) return f === "" + + if (f === "/" && partial) return true + + var options = this.options + + // windows: need to use /, not \ + if (isWindows) + f = f.split("\\").join("/") + + // treat the test path as a set of pathparts. + f = f.split(slashSplit) + this.debug(this.pattern, "split", f) + + // just ONE of the pattern sets in this.set needs to match + // in order for it to be valid. If negating, then just one + // match means that we have failed. + // Either way, return on the first hit. + + var set = this.set + this.debug(this.pattern, "set", set) + + // Find the basename of the path by looking for the last non-empty segment + var filename; + for (var i = f.length - 1; i >= 0; i--) { + filename = f[i] + if (filename) break + } + + for (var i = 0, l = set.length; i < l; i ++) { + var pattern = set[i], file = f + if (options.matchBase && pattern.length === 1) { + file = [filename] + } + var hit = this.matchOne(file, pattern, partial) + if (hit) { + if (options.flipNegate) return true + return !this.negate + } + } + + // didn't get any hits. this is success if it's a negative + // pattern, failure otherwise. + if (options.flipNegate) return false + return this.negate +} + +// set partial to true to test if, for example, +// "/a/b" matches the start of "/*/b/*/d" +// Partial means, if you run out of file before you run +// out of pattern, then that's fine, as long as all +// the parts match. +Minimatch.prototype.matchOne = function (file, pattern, partial) { + var options = this.options + + this.debug("matchOne", + { "this": this + , file: file + , pattern: pattern }) + + this.debug("matchOne", file.length, pattern.length) + + for ( var fi = 0 + , pi = 0 + , fl = file.length + , pl = pattern.length + ; (fi < fl) && (pi < pl) + ; fi ++, pi ++ ) { + + this.debug("matchOne loop") + var p = pattern[pi] + , f = file[fi] + + this.debug(pattern, p, f) + + // should be impossible. + // some invalid regexp stuff in the set. + if (p === false) return false + + if (p === GLOBSTAR) { + this.debug('GLOBSTAR', [pattern, p, f]) + + // "**" + // a/**/b/**/c would match the following: + // a/b/x/y/z/c + // a/x/y/z/b/c + // a/b/x/b/x/c + // a/b/c + // To do this, take the rest of the pattern after + // the **, and see if it would match the file remainder. + // If so, return success. + // If not, the ** "swallows" a segment, and try again. + // This is recursively awful. + // + // a/**/b/**/c matching a/b/x/y/z/c + // - a matches a + // - doublestar + // - matchOne(b/x/y/z/c, b/**/c) + // - b matches b + // - doublestar + // - matchOne(x/y/z/c, c) -> no + // - matchOne(y/z/c, c) -> no + // - matchOne(z/c, c) -> no + // - matchOne(c, c) yes, hit + var fr = fi + , pr = pi + 1 + if (pr === pl) { + this.debug('** at the end') + // a ** at the end will just swallow the rest. + // We have found a match. + // however, it will not swallow /.x, unless + // options.dot is set. + // . and .. are *never* matched by **, for explosively + // exponential reasons. + for ( ; fi < fl; fi ++) { + if (file[fi] === "." || file[fi] === ".." || + (!options.dot && file[fi].charAt(0) === ".")) return false + } + return true + } + + // ok, let's see if we can swallow whatever we can. + WHILE: while (fr < fl) { + var swallowee = file[fr] + + this.debug('\nglobstar while', + file, fr, pattern, pr, swallowee) + + // XXX remove this slice. Just pass the start index. + if (this.matchOne(file.slice(fr), pattern.slice(pr), partial)) { + this.debug('globstar found match!', fr, fl, swallowee) + // found a match. + return true + } else { + // can't swallow "." or ".." ever. + // can only swallow ".foo" when explicitly asked. + if (swallowee === "." || swallowee === ".." || + (!options.dot && swallowee.charAt(0) === ".")) { + this.debug("dot detected!", file, fr, pattern, pr) + break WHILE + } + + // ** swallows a segment, and continue. + this.debug('globstar swallow a segment, and continue') + fr ++ + } + } + // no match was found. + // However, in partial mode, we can't say this is necessarily over. + // If there's more *pattern* left, then + if (partial) { + // ran out of file + this.debug("\n>>> no match, partial?", file, fr, pattern, pr) + if (fr === fl) return true + } + return false + } + + // something other than ** + // non-magic patterns just have to match exactly + // patterns with magic have been turned into regexps. + var hit + if (typeof p === "string") { + if (options.nocase) { + hit = f.toLowerCase() === p.toLowerCase() + } else { + hit = f === p + } + this.debug("string match", p, f, hit) + } else { + hit = f.match(p) + this.debug("pattern match", p, f, hit) + } + + if (!hit) return false + } + + // Note: ending in / means that we'll get a final "" + // at the end of the pattern. This can only match a + // corresponding "" at the end of the file. + // If the file ends in /, then it can only match a + // a pattern that ends in /, unless the pattern just + // doesn't have any more for it. But, a/b/ should *not* + // match "a/b/*", even though "" matches against the + // [^/]*? pattern, except in partial mode, where it might + // simply not be reached yet. + // However, a/b/ should still satisfy a/* + + // now either we fell off the end of the pattern, or we're done. + if (fi === fl && pi === pl) { + // ran out of pattern and filename at the same time. + // an exact hit! + return true + } else if (fi === fl) { + // ran out of file, but still had pattern left. + // this is ok if we're doing the match as part of + // a glob fs traversal. + return partial + } else if (pi === pl) { + // ran out of pattern, still have file left. + // this is only acceptable if we're on the very last + // empty segment of a file with a trailing slash. + // a/* should match a/b/ + var emptyFileEnd = (fi === fl - 1) && (file[fi] === "") + return emptyFileEnd + } + + // should be unreachable. + throw new Error("wtf?") +} + + +// replace stuff like \* with * +function globUnescape (s) { + return s.replace(/\\(.)/g, "$1") +} + + +function regExpEscape (s) { + return s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&") +} + +}).call(this,require('_process')) +},{"_process":5,"brace-expansion":2}],2:[function(require,module,exports){ +var concatMap = require('concat-map'); +var balanced = require('balanced-match'); + +module.exports = expandTop; + +var escSlash = '\0SLASH'+Math.random()+'\0'; +var escOpen = '\0OPEN'+Math.random()+'\0'; +var escClose = '\0CLOSE'+Math.random()+'\0'; +var escComma = '\0COMMA'+Math.random()+'\0'; +var escPeriod = '\0PERIOD'+Math.random()+'\0'; + +function numeric(str) { + return parseInt(str, 10) == str + ? parseInt(str, 10) + : str.charCodeAt(0); +} + +function escapeBraces(str) { + return str.split('\\\\').join(escSlash) + .split('\\{').join(escOpen) + .split('\\}').join(escClose) + .split('\\,').join(escComma) + .split('\\.').join(escPeriod); +} + +function unescapeBraces(str) { + return str.split(escSlash).join('\\') + .split(escOpen).join('{') + .split(escClose).join('}') + .split(escComma).join(',') + .split(escPeriod).join('.'); +} + + +// Basically just str.split(","), but handling cases +// where we have nested braced sections, which should be +// treated as individual members, like {a,{b,c},d} +function parseCommaParts(str) { + if (!str) + return ['']; + + var parts = []; + var m = balanced('{', '}', str); + + if (!m) + return str.split(','); + + var pre = m.pre; + var body = m.body; + var post = m.post; + var p = pre.split(','); + + p[p.length-1] += '{' + body + '}'; + var postParts = parseCommaParts(post); + if (post.length) { + p[p.length-1] += postParts.shift(); + p.push.apply(p, postParts); + } + + parts.push.apply(parts, p); + + return parts; +} + +function expandTop(str) { + if (!str) + return []; + + var expansions = expand(escapeBraces(str)); + return expansions.filter(identity).map(unescapeBraces); +} + +function identity(e) { + return e; +} + +function embrace(str) { + return '{' + str + '}'; +} +function isPadded(el) { + return /^-?0\d/.test(el); +} + +function lte(i, y) { + return i <= y; +} +function gte(i, y) { + return i >= y; +} + +function expand(str) { + var expansions = []; + + var m = balanced('{', '}', str); + if (!m || /\$$/.test(m.pre)) return [str]; + + var isNumericSequence = /^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(m.body); + var isAlphaSequence = /^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(m.body); + var isSequence = isNumericSequence || isAlphaSequence; + var isOptions = /^(.*,)+(.+)?$/.test(m.body); + if (!isSequence && !isOptions) { + // {a},b} + if (m.post.match(/,.*}/)) { + str = m.pre + '{' + m.body + escClose + m.post; + return expand(str); + } + return [str]; + } + + var n; + if (isSequence) { + n = m.body.split(/\.\./); + } else { + n = parseCommaParts(m.body); + if (n.length === 1) { + // x{{a,b}}y ==> x{a}y x{b}y + n = expand(n[0]).map(embrace); + if (n.length === 1) { + var post = m.post.length + ? expand(m.post) + : ['']; + return post.map(function(p) { + return m.pre + n[0] + p; + }); + } + } + } + + // at this point, n is the parts, and we know it's not a comma set + // with a single entry. + + // no need to expand pre, since it is guaranteed to be free of brace-sets + var pre = m.pre; + var post = m.post.length + ? expand(m.post) + : ['']; + + var N; + + if (isSequence) { + var x = numeric(n[0]); + var y = numeric(n[1]); + var width = Math.max(n[0].length, n[1].length) + var incr = n.length == 3 + ? Math.abs(numeric(n[2])) + : 1; + var test = lte; + var reverse = y < x; + if (reverse) { + incr *= -1; + test = gte; + } + var pad = n.some(isPadded); + + N = []; + + for (var i = x; test(i, y); i += incr) { + var c; + if (isAlphaSequence) { + c = String.fromCharCode(i); + if (c === '\\') + c = ''; + } else { + c = String(i); + if (pad) { + var need = width - c.length; + if (need > 0) { + var z = new Array(need + 1).join('0'); + if (i < 0) + c = '-' + z + c.slice(1); + else + c = z + c; + } + } + } + N.push(c); + } + } else { + N = concatMap(n, function(el) { return expand(el) }); + } + + for (var j = 0; j < N.length; j++) { + for (var k = 0; k < post.length; k++) { + expansions.push([pre, N[j], post[k]].join('')) + } + } + + return expansions; +} + + +},{"balanced-match":3,"concat-map":4}],3:[function(require,module,exports){ +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; + } + } + } + + // 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; + } + return m; + } +} + +},{}],4:[function(require,module,exports){ +module.exports = function (xs, fn) { + var res = []; + for (var i = 0; i < xs.length; i++) { + var x = fn(xs[i], i); + if (Array.isArray(x)) res.push.apply(res, x); + else res.push(x); + } + return res; +}; + +},{}],5:[function(require,module,exports){ +// shim for using process in browser + +var process = module.exports = {}; + +process.nextTick = (function () { + var canSetImmediate = typeof window !== 'undefined' + && window.setImmediate; + var canMutationObserver = typeof window !== 'undefined' + && window.MutationObserver; + var canPost = typeof window !== 'undefined' + && window.postMessage && window.addEventListener + ; + + if (canSetImmediate) { + return function (f) { return window.setImmediate(f) }; + } + + var queue = []; + + if (canMutationObserver) { + var hiddenDiv = document.createElement("div"); + var observer = new MutationObserver(function () { + var queueList = queue.slice(); + queue.length = 0; + queueList.forEach(function (fn) { + fn(); + }); + }); + + observer.observe(hiddenDiv, { attributes: true }); + + return function nextTick(fn) { + if (!queue.length) { + hiddenDiv.setAttribute('yes', 'no'); + } + queue.push(fn); + }; + } + + if (canPost) { + window.addEventListener('message', function (ev) { + var source = ev.source; + if ((source === window || source === null) && ev.data === 'process-tick') { + ev.stopPropagation(); + if (queue.length > 0) { + var fn = queue.shift(); + fn(); + } + } + }, true); + + return function nextTick(fn) { + queue.push(fn); + window.postMessage('process-tick', '*'); + }; + } + + return function nextTick(fn) { + setTimeout(fn, 0); + }; +})(); + +process.title = 'browser'; +process.browser = true; +process.env = {}; +process.argv = []; + +function noop() {} + +process.on = noop; +process.addListener = noop; +process.once = noop; +process.off = noop; +process.removeListener = noop; +process.removeAllListeners = noop; +process.emit = noop; + +process.binding = function (name) { + throw new Error('process.binding is not supported'); +}; + +// TODO(shtylman) +process.cwd = function () { return '/' }; +process.chdir = function (dir) { + throw new Error('process.chdir is not supported'); +}; + +},{}]},{},[1]); diff --git a/node_modules/bower/node_modules/fstream-ignore/node_modules/minimatch/minimatch.js b/node_modules/bower/node_modules/fstream-ignore/node_modules/minimatch/minimatch.js index 4761786..6958cdc 100644 --- a/node_modules/bower/node_modules/fstream-ignore/node_modules/minimatch/minimatch.js +++ b/node_modules/bower/node_modules/fstream-ignore/node_modules/minimatch/minimatch.js @@ -1,43 +1,13 @@ -;(function (require, exports, module, platform) { - -if (module) module.exports = minimatch -else exports.minimatch = minimatch - -if (!require) { - require = function (id) { - switch (id) { - case "sigmund": return function sigmund (obj) { - return JSON.stringify(obj) - } - case "path": return { basename: function (f) { - f = f.split(/[\/\\]/) - var e = f.pop() - if (!e) e = f.pop() - return e - }} - case "lru-cache": return function LRUCache () { - // not quite an LRU, but still space-limited. - var cache = {} - var cnt = 0 - this.set = function (k, v) { - cnt ++ - if (cnt >= 100) cache = {} - cache[k] = v - } - this.get = function (k) { return cache[k] } - } - } - } -} - +module.exports = minimatch minimatch.Minimatch = Minimatch -var LRU = require("lru-cache") - , cache = minimatch.cache = new LRU({max: 100}) - , GLOBSTAR = minimatch.GLOBSTAR = Minimatch.GLOBSTAR = {} - , sigmund = require("sigmund") +var isWindows = false +if (typeof process !== 'undefined' && process.platform === 'win32') + isWindows = true + +var GLOBSTAR = minimatch.GLOBSTAR = Minimatch.GLOBSTAR = {} + , expand = require("brace-expansion") -var path = require("path") // any single thing other than / // don't need to escape / when using new RegExp() , qmark = "[^/]" @@ -131,7 +101,7 @@ function minimatch (p, pattern, options) { function Minimatch (pattern, options) { if (!(this instanceof Minimatch)) { - return new Minimatch(pattern, options, cache) + return new Minimatch(pattern, options) } if (typeof pattern !== "string") { @@ -141,19 +111,9 @@ function Minimatch (pattern, options) { if (!options) options = {} pattern = pattern.trim() - // windows: need to use /, not \ - // On other platforms, \ is a valid (albeit bad) filename char. - if (platform === "win32") { + // windows support: need to use /, not \ + if (isWindows) pattern = pattern.split("\\").join("/") - } - - // lru storage. - // these things aren't particularly big, but walking down the string - // and turning it into a regexp can get pretty costly. - var cacheKey = pattern + "\n" + sigmund(options) - var cached = minimatch.cache.get(cacheKey) - if (cached) return cached - minimatch.cache.set(cacheKey, this) this.options = options this.set = [] @@ -256,19 +216,19 @@ function parseNegate () { // a{2..}b -> a{2..}b // a{b}c -> a{b}c minimatch.braceExpand = function (pattern, options) { - return new Minimatch(pattern, options).braceExpand() + return braceExpand(pattern, options) } Minimatch.prototype.braceExpand = braceExpand -function pad(n, width, z) { - z = z || '0'; - n = n + ''; - return n.length >= width ? n : new Array(width - n.length + 1).join(z) + n; -} - function braceExpand (pattern, options) { - options = options || this.options + if (!options) { + if (this instanceof Minimatch) + options = this.options + else + options = {} + } + pattern = typeof pattern === "undefined" ? this.pattern : pattern @@ -282,187 +242,7 @@ function braceExpand (pattern, options) { return [pattern] } - var escaping = false - - // examples and comments refer to this crazy pattern: - // a{b,c{d,e},{f,g}h}x{y,z} - // expected: - // abxy - // abxz - // acdxy - // acdxz - // acexy - // acexz - // afhxy - // afhxz - // aghxy - // aghxz - - // everything before the first \{ is just a prefix. - // So, we pluck that off, and work with the rest, - // and then prepend it to everything we find. - if (pattern.charAt(0) !== "{") { - this.debug(pattern) - var prefix = null - for (var i = 0, l = pattern.length; i < l; i ++) { - var c = pattern.charAt(i) - this.debug(i, c) - if (c === "\\") { - escaping = !escaping - } else if (c === "{" && !escaping) { - prefix = pattern.substr(0, i) - break - } - } - - // actually no sets, all { were escaped. - if (prefix === null) { - this.debug("no sets") - return [pattern] - } - - var tail = braceExpand.call(this, pattern.substr(i), options) - return tail.map(function (t) { - return prefix + t - }) - } - - // now we have something like: - // {b,c{d,e},{f,g}h}x{y,z} - // walk through the set, expanding each part, until - // the set ends. then, we'll expand the suffix. - // If the set only has a single member, then'll put the {} back - - // first, handle numeric sets, since they're easier - var numset = pattern.match(/^\{(-?[0-9]+)\.\.(-?[0-9]+)\}/) - if (numset) { - this.debug("numset", numset[1], numset[2]) - var suf = braceExpand.call(this, pattern.substr(numset[0].length), options) - , start = +numset[1] - , needPadding = numset[1][0] === '0' - , startWidth = numset[1].length - , padded - , end = +numset[2] - , inc = start > end ? -1 : 1 - , set = [] - - for (var i = start; i != (end + inc); i += inc) { - padded = needPadding ? pad(i, startWidth) : i + '' - // append all the suffixes - for (var ii = 0, ll = suf.length; ii < ll; ii ++) { - set.push(padded + suf[ii]) - } - } - return set - } - - // ok, walk through the set - // We hope, somewhat optimistically, that there - // will be a } at the end. - // If the closing brace isn't found, then the pattern is - // interpreted as braceExpand("\\" + pattern) so that - // the leading \{ will be interpreted literally. - var i = 1 // skip the \{ - , depth = 1 - , set = [] - , member = "" - , sawEnd = false - , escaping = false - - function addMember () { - set.push(member) - member = "" - } - - this.debug("Entering for") - FOR: for (i = 1, l = pattern.length; i < l; i ++) { - var c = pattern.charAt(i) - this.debug("", i, c) - - if (escaping) { - escaping = false - member += "\\" + c - } else { - switch (c) { - case "\\": - escaping = true - continue - - case "{": - depth ++ - member += "{" - continue - - case "}": - depth -- - // if this closes the actual set, then we're done - if (depth === 0) { - addMember() - // pluck off the close-brace - i ++ - break FOR - } else { - member += c - continue - } - - case ",": - if (depth === 1) { - addMember() - } else { - member += c - } - continue - - default: - member += c - continue - } // switch - } // else - } // for - - // now we've either finished the set, and the suffix is - // pattern.substr(i), or we have *not* closed the set, - // and need to escape the leading brace - if (depth !== 0) { - this.debug("didn't close", pattern) - return braceExpand.call(this, "\\" + pattern, options) - } - - // x{y,z} -> ["xy", "xz"] - this.debug("set", set) - this.debug("suffix", pattern.substr(i)) - var suf = braceExpand.call(this, pattern.substr(i), options) - // ["b", "c{d,e}","{f,g}h"] -> - // [["b"], ["cd", "ce"], ["fh", "gh"]] - var addBraces = set.length === 1 - this.debug("set pre-expanded", set) - set = set.map(function (p) { - return braceExpand.call(this, p, options) - }, this) - this.debug("set expanded", set) - - - // [["b"], ["cd", "ce"], ["fh", "gh"]] -> - // ["b", "cd", "ce", "fh", "gh"] - set = set.reduce(function (l, r) { - return l.concat(r) - }) - - if (addBraces) { - set = set.map(function (s) { - return "{" + s + "}" - }) - } - - // now attach the suffixes. - var ret = [] - for (var i = 0, l = set.length; i < l; i ++) { - for (var ii = 0, ll = suf.length; ii < ll; ii ++) { - ret.push(set[i] + suf[ii]) - } - } - return ret + return expand(pattern) } // parse a component of the expanded set. @@ -849,10 +629,8 @@ function match (f, partial) { var options = this.options // windows: need to use /, not \ - // On other platforms, \ is a valid (albeit bad) filename char. - if (platform === "win32") { + if (isWindows) f = f.split("\\").join("/") - } // treat the test path as a set of pathparts. f = f.split(slashSplit) @@ -1065,9 +843,3 @@ function globUnescape (s) { function regExpEscape (s) { return s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&") } - -})( typeof require === "function" ? require : null, - this, - typeof module === "object" ? module : null, - typeof process === "object" ? process.platform : "win32" - ) diff --git a/node_modules/csurf/node_modules/csrf/node_modules/rndm/.npmignore b/node_modules/bower/node_modules/fstream-ignore/node_modules/minimatch/node_modules/brace-expansion/.npmignore similarity index 54% rename from node_modules/csurf/node_modules/csrf/node_modules/rndm/.npmignore rename to node_modules/bower/node_modules/fstream-ignore/node_modules/minimatch/node_modules/brace-expansion/.npmignore index 72921ab..249bc20 100644 --- a/node_modules/csurf/node_modules/csrf/node_modules/rndm/.npmignore +++ b/node_modules/bower/node_modules/fstream-ignore/node_modules/minimatch/node_modules/brace-expansion/.npmignore @@ -1,2 +1,2 @@ -.DS_Store* node_modules +*.sw* diff --git a/node_modules/bower/node_modules/fstream-ignore/node_modules/minimatch/node_modules/brace-expansion/.travis.yml b/node_modules/bower/node_modules/fstream-ignore/node_modules/minimatch/node_modules/brace-expansion/.travis.yml new file mode 100644 index 0000000..6e5919d --- /dev/null +++ b/node_modules/bower/node_modules/fstream-ignore/node_modules/minimatch/node_modules/brace-expansion/.travis.yml @@ -0,0 +1,3 @@ +language: node_js +node_js: + - "0.10" diff --git a/node_modules/bower/node_modules/fstream-ignore/node_modules/minimatch/node_modules/brace-expansion/README.md b/node_modules/bower/node_modules/fstream-ignore/node_modules/minimatch/node_modules/brace-expansion/README.md new file mode 100644 index 0000000..62bc7ba --- /dev/null +++ b/node_modules/bower/node_modules/fstream-ignore/node_modules/minimatch/node_modules/brace-expansion/README.md @@ -0,0 +1,121 @@ +# brace-expansion + +[Brace expansion](https://www.gnu.org/software/bash/manual/html_node/Brace-Expansion.html), +as known from sh/bash, in JavaScript. + +[![build status](https://secure.travis-ci.org/juliangruber/brace-expansion.svg)](http://travis-ci.org/juliangruber/brace-expansion) + +[![testling badge](https://ci.testling.com/juliangruber/brace-expansion.png)](https://ci.testling.com/juliangruber/brace-expansion) + +## Example + +```js +var expand = require('brace-expansion'); + +expand('file-{a,b,c}.jpg') +// => ['file-a.jpg', 'file-b.jpg', 'file-c.jpg'] + +expand('-v{,,}') +// => ['-v', '-v', '-v'] + +expand('file{0..2}.jpg') +// => ['file0.jpg', 'file1.jpg', 'file2.jpg'] + +expand('file-{a..c}.jpg') +// => ['file-a.jpg', 'file-b.jpg', 'file-c.jpg'] + +expand('file{2..0}.jpg') +// => ['file2.jpg', 'file1.jpg', 'file0.jpg'] + +expand('file{0..4..2}.jpg') +// => ['file0.jpg', 'file2.jpg', 'file4.jpg'] + +expand('file-{a..e..2}.jpg') +// => ['file-a.jpg', 'file-c.jpg', 'file-e.jpg'] + +expand('file{00..10..5}.jpg') +// => ['file00.jpg', 'file05.jpg', 'file10.jpg'] + +expand('{{A..C},{a..c}}') +// => ['A', 'B', 'C', 'a', 'b', 'c'] + +expand('ppp{,config,oe{,conf}}') +// => ['ppp', 'pppconfig', 'pppoe', 'pppoeconf'] +``` + +## API + +```js +var expand = require('brace-expansion'); +``` + +### var expanded = expand(str) + +Return an array of all possible and valid expansions of `str`. If none are +found, `[str]` is returned. + +Valid expansions are: + +```js +/^(.*,)+(.+)?$/ +// {a,b,...} +``` + +A comma seperated list of options, like `{a,b}` or `{a,{b,c}}` or `{,a,}`. + +```js +/^-?\d+\.\.-?\d+(\.\.-?\d+)?$/ +// {x..y[..incr]} +``` + +A numeric sequence from `x` to `y` inclusive, with optional increment. +If `x` or `y` start with a leading `0`, all the numbers will be padded +to have equal length. Negative numbers and backwards iteration work too. + +```js +/^-?\d+\.\.-?\d+(\.\.-?\d+)?$/ +// {x..y[..incr]} +``` + +An alphabetic sequence from `x` to `y` inclusive, with optional increment. +`x` and `y` must be exactly one character, and if given, `incr` must be a +number. + +For compatibility reasons, the string `${` is not eligible for brace expansion. + +## Installation + +With [npm](https://npmjs.org) do: + +```bash +npm install brace-expansion +``` + +## Contributors + +- [Julian Gruber](https://github.com/juliangruber) +- [Isaac Z. Schlueter](https://github.com/isaacs) + +## License + +(MIT) + +Copyright (c) 2013 Julian Gruber <julian@juliangruber.com> + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies +of the Software, and to permit persons to whom the Software is furnished to do +so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/node_modules/bower/node_modules/fstream-ignore/node_modules/minimatch/node_modules/brace-expansion/example.js b/node_modules/bower/node_modules/fstream-ignore/node_modules/minimatch/node_modules/brace-expansion/example.js new file mode 100644 index 0000000..60ecfc7 --- /dev/null +++ b/node_modules/bower/node_modules/fstream-ignore/node_modules/minimatch/node_modules/brace-expansion/example.js @@ -0,0 +1,8 @@ +var expand = require('./'); + +console.log(expand('http://any.org/archive{1996..1999}/vol{1..4}/part{a,b,c}.html')); +console.log(expand('http://www.numericals.com/file{1..100..10}.txt')); +console.log(expand('http://www.letters.com/file{a..z..2}.txt')); +console.log(expand('mkdir /usr/local/src/bash/{old,new,dist,bugs}')); +console.log(expand('chown root /usr/{ucb/{ex,edit},lib/{ex?.?*,how_ex}}')); + diff --git a/node_modules/bower/node_modules/fstream-ignore/node_modules/minimatch/node_modules/brace-expansion/index.js b/node_modules/bower/node_modules/fstream-ignore/node_modules/minimatch/node_modules/brace-expansion/index.js new file mode 100644 index 0000000..a23104e --- /dev/null +++ b/node_modules/bower/node_modules/fstream-ignore/node_modules/minimatch/node_modules/brace-expansion/index.js @@ -0,0 +1,191 @@ +var concatMap = require('concat-map'); +var balanced = require('balanced-match'); + +module.exports = expandTop; + +var escSlash = '\0SLASH'+Math.random()+'\0'; +var escOpen = '\0OPEN'+Math.random()+'\0'; +var escClose = '\0CLOSE'+Math.random()+'\0'; +var escComma = '\0COMMA'+Math.random()+'\0'; +var escPeriod = '\0PERIOD'+Math.random()+'\0'; + +function numeric(str) { + return parseInt(str, 10) == str + ? parseInt(str, 10) + : str.charCodeAt(0); +} + +function escapeBraces(str) { + return str.split('\\\\').join(escSlash) + .split('\\{').join(escOpen) + .split('\\}').join(escClose) + .split('\\,').join(escComma) + .split('\\.').join(escPeriod); +} + +function unescapeBraces(str) { + return str.split(escSlash).join('\\') + .split(escOpen).join('{') + .split(escClose).join('}') + .split(escComma).join(',') + .split(escPeriod).join('.'); +} + + +// Basically just str.split(","), but handling cases +// where we have nested braced sections, which should be +// treated as individual members, like {a,{b,c},d} +function parseCommaParts(str) { + if (!str) + return ['']; + + var parts = []; + var m = balanced('{', '}', str); + + if (!m) + return str.split(','); + + var pre = m.pre; + var body = m.body; + var post = m.post; + var p = pre.split(','); + + p[p.length-1] += '{' + body + '}'; + var postParts = parseCommaParts(post); + if (post.length) { + p[p.length-1] += postParts.shift(); + p.push.apply(p, postParts); + } + + parts.push.apply(parts, p); + + return parts; +} + +function expandTop(str) { + if (!str) + return []; + + return expand(escapeBraces(str), true).map(unescapeBraces); +} + +function identity(e) { + return e; +} + +function embrace(str) { + return '{' + str + '}'; +} +function isPadded(el) { + return /^-?0\d/.test(el); +} + +function lte(i, y) { + return i <= y; +} +function gte(i, y) { + return i >= y; +} + +function expand(str, isTop) { + var expansions = []; + + var m = balanced('{', '}', str); + if (!m || /\$$/.test(m.pre)) return [str]; + + var isNumericSequence = /^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(m.body); + var isAlphaSequence = /^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(m.body); + var isSequence = isNumericSequence || isAlphaSequence; + var isOptions = /^(.*,)+(.+)?$/.test(m.body); + if (!isSequence && !isOptions) { + // {a},b} + if (m.post.match(/,.*}/)) { + str = m.pre + '{' + m.body + escClose + m.post; + return expand(str); + } + return [str]; + } + + var n; + if (isSequence) { + n = m.body.split(/\.\./); + } else { + n = parseCommaParts(m.body); + if (n.length === 1) { + // x{{a,b}}y ==> x{a}y x{b}y + n = expand(n[0], false).map(embrace); + if (n.length === 1) { + var post = m.post.length + ? expand(m.post, false) + : ['']; + return post.map(function(p) { + return m.pre + n[0] + p; + }); + } + } + } + + // at this point, n is the parts, and we know it's not a comma set + // with a single entry. + + // no need to expand pre, since it is guaranteed to be free of brace-sets + var pre = m.pre; + var post = m.post.length + ? expand(m.post, false) + : ['']; + + var N; + + if (isSequence) { + var x = numeric(n[0]); + var y = numeric(n[1]); + var width = Math.max(n[0].length, n[1].length) + var incr = n.length == 3 + ? Math.abs(numeric(n[2])) + : 1; + var test = lte; + var reverse = y < x; + if (reverse) { + incr *= -1; + test = gte; + } + var pad = n.some(isPadded); + + N = []; + + for (var i = x; test(i, y); i += incr) { + var c; + if (isAlphaSequence) { + c = String.fromCharCode(i); + if (c === '\\') + c = ''; + } else { + c = String(i); + if (pad) { + var need = width - c.length; + if (need > 0) { + var z = new Array(need + 1).join('0'); + if (i < 0) + c = '-' + z + c.slice(1); + else + c = z + c; + } + } + } + N.push(c); + } + } else { + N = concatMap(n, function(el) { return expand(el, false) }); + } + + for (var j = 0; j < N.length; j++) { + for (var k = 0; k < post.length; k++) { + var expansion = pre + N[j] + post[k]; + if (!isTop || isSequence || expansion) + expansions.push(expansion); + } + } + + return expansions; +} + diff --git a/node_modules/csurf/node_modules/csrf/node_modules/uid-safe/.npmignore b/node_modules/bower/node_modules/fstream-ignore/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/.npmignore similarity index 54% rename from node_modules/csurf/node_modules/csrf/node_modules/uid-safe/.npmignore rename to node_modules/bower/node_modules/fstream-ignore/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/.npmignore index 72921ab..fd4f2b0 100644 --- a/node_modules/csurf/node_modules/csrf/node_modules/uid-safe/.npmignore +++ b/node_modules/bower/node_modules/fstream-ignore/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/.npmignore @@ -1,2 +1,2 @@ -.DS_Store* node_modules +.DS_Store diff --git a/node_modules/bower/node_modules/insight/node_modules/os-name/node_modules/minimist/.travis.yml b/node_modules/bower/node_modules/fstream-ignore/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/.travis.yml similarity index 100% rename from node_modules/bower/node_modules/insight/node_modules/os-name/node_modules/minimist/.travis.yml rename to node_modules/bower/node_modules/fstream-ignore/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/.travis.yml diff --git a/node_modules/bower/node_modules/fstream-ignore/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/Makefile b/node_modules/bower/node_modules/fstream-ignore/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/Makefile new file mode 100644 index 0000000..fa5da71 --- /dev/null +++ b/node_modules/bower/node_modules/fstream-ignore/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/Makefile @@ -0,0 +1,6 @@ + +test: + @node_modules/.bin/tape test/*.js + +.PHONY: test + diff --git a/node_modules/bower/node_modules/fstream-ignore/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/README.md b/node_modules/bower/node_modules/fstream-ignore/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/README.md new file mode 100644 index 0000000..2aff0eb --- /dev/null +++ b/node_modules/bower/node_modules/fstream-ignore/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/README.md @@ -0,0 +1,80 @@ +# balanced-match + +Match balanced string pairs, like `{` and `}` or `` and ``. + +[![build status](https://secure.travis-ci.org/juliangruber/balanced-match.svg)](http://travis-ci.org/juliangruber/balanced-match) +[![downloads](https://img.shields.io/npm/dm/balanced-match.svg)](https://www.npmjs.org/package/balanced-match) + +[![testling badge](https://ci.testling.com/juliangruber/balanced-match.png)](https://ci.testling.com/juliangruber/balanced-match) + +## Example + +Get the first matching pair of braces: + +```js +var balanced = require('balanced-match'); + +console.log(balanced('{', '}', 'pre{in{nested}}post')); +console.log(balanced('{', '}', 'pre{first}between{second}post')); +``` + +The matches are: + +```bash +$ node example.js +{ start: 3, end: 14, pre: 'pre', body: 'in{nested}', post: 'post' } +{ start: 3, + end: 9, + pre: 'pre', + body: 'first', + post: 'between{second}post' } +``` + +## API + +### var m = balanced(a, b, str) + +For the first non-nested matching pair of `a` and `b` in `str`, return an +object with those keys: + +* **start** the index of the first match of `a` +* **end** the index of the matching `b` +* **pre** the preamble, `a` and `b` not included +* **body** the match, `a` and `b` not included +* **post** the postscript, `a` and `b` not included + +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', '']`. + +## Installation + +With [npm](https://npmjs.org) do: + +```bash +npm install balanced-match +``` + +## License + +(MIT) + +Copyright (c) 2013 Julian Gruber <julian@juliangruber.com> + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies +of the Software, and to permit persons to whom the Software is furnished to do +so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/node_modules/bower/node_modules/fstream-ignore/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/example.js b/node_modules/bower/node_modules/fstream-ignore/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/example.js new file mode 100644 index 0000000..c02ad34 --- /dev/null +++ b/node_modules/bower/node_modules/fstream-ignore/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/example.js @@ -0,0 +1,5 @@ +var balanced = require('./'); + +console.log(balanced('{', '}', 'pre{in{nested}}post')); +console.log(balanced('{', '}', 'pre{first}between{second}post')); + diff --git a/node_modules/bower/node_modules/fstream-ignore/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/index.js b/node_modules/bower/node_modules/fstream-ignore/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/index.js new file mode 100644 index 0000000..d165ae8 --- /dev/null +++ b/node_modules/bower/node_modules/fstream-ignore/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/index.js @@ -0,0 +1,38 @@ +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; + } + } + } + + // 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; + } + return m; + } +} diff --git a/node_modules/bower/node_modules/fstream-ignore/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/package.json b/node_modules/bower/node_modules/fstream-ignore/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/package.json new file mode 100644 index 0000000..7fd7f83 --- /dev/null +++ b/node_modules/bower/node_modules/fstream-ignore/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/package.json @@ -0,0 +1,72 @@ +{ + "name": "balanced-match", + "description": "Match balanced character pairs, like \"{\" and \"}\"", + "version": "0.2.0", + "repository": { + "type": "git", + "url": "git://github.com/juliangruber/balanced-match.git" + }, + "homepage": "https://github.com/juliangruber/balanced-match", + "main": "index.js", + "scripts": { + "test": "make test" + }, + "dependencies": {}, + "devDependencies": { + "tape": "~1.1.1" + }, + "keywords": [ + "match", + "regexp", + "test", + "balanced", + "parse" + ], + "author": { + "name": "Julian Gruber", + "email": "mail@juliangruber.com", + "url": "http://juliangruber.com" + }, + "license": "MIT", + "testling": { + "files": "test/*.js", + "browsers": [ + "ie/8..latest", + "firefox/20..latest", + "firefox/nightly", + "chrome/25..latest", + "chrome/canary", + "opera/12..latest", + "opera/next", + "safari/5.1..latest", + "ipad/6.0..latest", + "iphone/6.0..latest", + "android-browser/4.2..latest" + ] + }, + "gitHead": "ba40ed78e7114a4a67c51da768a100184dead39c", + "bugs": { + "url": "https://github.com/juliangruber/balanced-match/issues" + }, + "_id": "balanced-match@0.2.0", + "_shasum": "38f6730c03aab6d5edbb52bd934885e756d71674", + "_from": "balanced-match@^0.2.0", + "_npmVersion": "2.1.8", + "_nodeVersion": "0.10.32", + "_npmUser": { + "name": "juliangruber", + "email": "julian@juliangruber.com" + }, + "maintainers": [ + { + "name": "juliangruber", + "email": "julian@juliangruber.com" + } + ], + "dist": { + "shasum": "38f6730c03aab6d5edbb52bd934885e756d71674", + "tarball": "http://registry.npmjs.org/balanced-match/-/balanced-match-0.2.0.tgz" + }, + "directories": {}, + "_resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-0.2.0.tgz" +} diff --git a/node_modules/bower/node_modules/fstream-ignore/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/test/balanced.js b/node_modules/bower/node_modules/fstream-ignore/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/test/balanced.js new file mode 100644 index 0000000..36bfd39 --- /dev/null +++ b/node_modules/bower/node_modules/fstream-ignore/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/test/balanced.js @@ -0,0 +1,56 @@ +var test = require('tape'); +var balanced = require('..'); + +test('balanced', function(t) { + t.deepEqual(balanced('{', '}', 'pre{in{nest}}post'), { + start: 3, + end: 12, + pre: 'pre', + body: 'in{nest}', + post: 'post' + }); + t.deepEqual(balanced('{', '}', '{{{{{{{{{in}post'), { + start: 8, + end: 11, + pre: '{{{{{{{{', + body: 'in', + post: 'post' + }); + t.deepEqual(balanced('{', '}', 'pre{body{in}post'), { + start: 8, + end: 11, + pre: 'pre{body', + body: 'in', + post: 'post' + }); + t.deepEqual(balanced('{', '}', 'pre}{in{nest}}post'), { + start: 4, + end: 13, + pre: 'pre}', + body: 'in{nest}', + post: 'post' + }); + t.deepEqual(balanced('{', '}', 'pre{body}between{body2}post'), { + start: 3, + end: 8, + pre: 'pre', + body: 'body', + post: 'between{body2}post' + }); + t.notOk(balanced('{', '}', 'nope'), 'should be notOk'); + t.deepEqual(balanced('', '', 'preinnestpost'), { + start: 3, + end: 19, + pre: 'pre', + body: 'innest', + post: 'post' + }); + t.deepEqual(balanced('', '', 'preinnestpost'), { + start: 7, + end: 23, + pre: 'pre', + body: 'innest', + post: 'post' + }); + t.end(); +}); diff --git a/node_modules/bower/node_modules/fstream-ignore/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/.travis.yml b/node_modules/bower/node_modules/fstream-ignore/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/.travis.yml new file mode 100644 index 0000000..f1d0f13 --- /dev/null +++ b/node_modules/bower/node_modules/fstream-ignore/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/.travis.yml @@ -0,0 +1,4 @@ +language: node_js +node_js: + - 0.4 + - 0.6 diff --git a/node_modules/bower/node_modules/insight/node_modules/os-name/node_modules/minimist/LICENSE b/node_modules/bower/node_modules/fstream-ignore/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/LICENSE similarity index 100% rename from node_modules/bower/node_modules/insight/node_modules/os-name/node_modules/minimist/LICENSE rename to node_modules/bower/node_modules/fstream-ignore/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/LICENSE diff --git a/node_modules/bower/node_modules/fstream-ignore/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/README.markdown b/node_modules/bower/node_modules/fstream-ignore/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/README.markdown new file mode 100644 index 0000000..408f70a --- /dev/null +++ b/node_modules/bower/node_modules/fstream-ignore/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/README.markdown @@ -0,0 +1,62 @@ +concat-map +========== + +Concatenative mapdashery. + +[![browser support](http://ci.testling.com/substack/node-concat-map.png)](http://ci.testling.com/substack/node-concat-map) + +[![build status](https://secure.travis-ci.org/substack/node-concat-map.png)](http://travis-ci.org/substack/node-concat-map) + +example +======= + +``` js +var concatMap = require('concat-map'); +var xs = [ 1, 2, 3, 4, 5, 6 ]; +var ys = concatMap(xs, function (x) { + return x % 2 ? [ x - 0.1, x, x + 0.1 ] : []; +}); +console.dir(ys); +``` + +*** + +``` +[ 0.9, 1, 1.1, 2.9, 3, 3.1, 4.9, 5, 5.1 ] +``` + +methods +======= + +``` js +var concatMap = require('concat-map') +``` + +concatMap(xs, fn) +----------------- + +Return an array of concatenated elements by calling `fn(x, i)` for each element +`x` and each index `i` in the array `xs`. + +When `fn(x, i)` returns an array, its result will be concatenated with the +result array. If `fn(x, i)` returns anything else, that value will be pushed +onto the end of the result array. + +install +======= + +With [npm](http://npmjs.org) do: + +``` +npm install concat-map +``` + +license +======= + +MIT + +notes +===== + +This module was written while sitting high above the ground in a tree. diff --git a/node_modules/bower/node_modules/fstream-ignore/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/example/map.js b/node_modules/bower/node_modules/fstream-ignore/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/example/map.js new file mode 100644 index 0000000..3365621 --- /dev/null +++ b/node_modules/bower/node_modules/fstream-ignore/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/example/map.js @@ -0,0 +1,6 @@ +var concatMap = require('../'); +var xs = [ 1, 2, 3, 4, 5, 6 ]; +var ys = concatMap(xs, function (x) { + return x % 2 ? [ x - 0.1, x, x + 0.1 ] : []; +}); +console.dir(ys); diff --git a/node_modules/bower/node_modules/fstream-ignore/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/index.js b/node_modules/bower/node_modules/fstream-ignore/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/index.js new file mode 100644 index 0000000..b29a781 --- /dev/null +++ b/node_modules/bower/node_modules/fstream-ignore/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/index.js @@ -0,0 +1,13 @@ +module.exports = function (xs, fn) { + var res = []; + for (var i = 0; i < xs.length; i++) { + var x = fn(xs[i], i); + if (isArray(x)) res.push.apply(res, x); + else res.push(x); + } + return res; +}; + +var isArray = Array.isArray || function (xs) { + return Object.prototype.toString.call(xs) === '[object Array]'; +}; diff --git a/node_modules/bower/node_modules/fstream-ignore/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/package.json b/node_modules/bower/node_modules/fstream-ignore/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/package.json new file mode 100644 index 0000000..386ed51 --- /dev/null +++ b/node_modules/bower/node_modules/fstream-ignore/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/package.json @@ -0,0 +1,82 @@ +{ + "name": "concat-map", + "description": "concatenative mapdashery", + "version": "0.0.1", + "repository": { + "type": "git", + "url": "git://github.com/substack/node-concat-map.git" + }, + "main": "index.js", + "keywords": [ + "concat", + "concatMap", + "map", + "functional", + "higher-order" + ], + "directories": { + "example": "example", + "test": "test" + }, + "scripts": { + "test": "tape test/*.js" + }, + "devDependencies": { + "tape": "~2.4.0" + }, + "license": "MIT", + "author": { + "name": "James Halliday", + "email": "mail@substack.net", + "url": "http://substack.net" + }, + "testling": { + "files": "test/*.js", + "browsers": { + "ie": [ + 6, + 7, + 8, + 9 + ], + "ff": [ + 3.5, + 10, + 15 + ], + "chrome": [ + 10, + 22 + ], + "safari": [ + 5.1 + ], + "opera": [ + 12 + ] + } + }, + "bugs": { + "url": "https://github.com/substack/node-concat-map/issues" + }, + "homepage": "https://github.com/substack/node-concat-map", + "_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" +} diff --git a/node_modules/bower/node_modules/fstream-ignore/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/test/map.js b/node_modules/bower/node_modules/fstream-ignore/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/test/map.js new file mode 100644 index 0000000..fdbd702 --- /dev/null +++ b/node_modules/bower/node_modules/fstream-ignore/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/test/map.js @@ -0,0 +1,39 @@ +var concatMap = require('../'); +var test = require('tape'); + +test('empty or not', function (t) { + var xs = [ 1, 2, 3, 4, 5, 6 ]; + var ixes = []; + var ys = concatMap(xs, function (x, ix) { + ixes.push(ix); + return x % 2 ? [ x - 0.1, x, x + 0.1 ] : []; + }); + t.same(ys, [ 0.9, 1, 1.1, 2.9, 3, 3.1, 4.9, 5, 5.1 ]); + t.same(ixes, [ 0, 1, 2, 3, 4, 5 ]); + t.end(); +}); + +test('always something', function (t) { + var xs = [ 'a', 'b', 'c', 'd' ]; + var ys = concatMap(xs, function (x) { + return x === 'b' ? [ 'B', 'B', 'B' ] : [ x ]; + }); + t.same(ys, [ 'a', 'B', 'B', 'B', 'c', 'd' ]); + t.end(); +}); + +test('scalars', function (t) { + var xs = [ 'a', 'b', 'c', 'd' ]; + var ys = concatMap(xs, function (x) { + return x === 'b' ? [ 'B', 'B', 'B' ] : x; + }); + t.same(ys, [ 'a', 'B', 'B', 'B', 'c', 'd' ]); + t.end(); +}); + +test('undefs', function (t) { + var xs = [ 'a', 'b', 'c', 'd' ]; + var ys = concatMap(xs, function () {}); + t.same(ys, [ undefined, undefined, undefined, undefined ]); + t.end(); +}); diff --git a/node_modules/bower/node_modules/fstream-ignore/node_modules/minimatch/node_modules/brace-expansion/package.json b/node_modules/bower/node_modules/fstream-ignore/node_modules/minimatch/node_modules/brace-expansion/package.json new file mode 100644 index 0000000..c525394 --- /dev/null +++ b/node_modules/bower/node_modules/fstream-ignore/node_modules/minimatch/node_modules/brace-expansion/package.json @@ -0,0 +1,74 @@ +{ + "name": "brace-expansion", + "description": "Brace expansion as known from sh/bash", + "version": "1.1.0", + "repository": { + "type": "git", + "url": "git://github.com/juliangruber/brace-expansion.git" + }, + "homepage": "https://github.com/juliangruber/brace-expansion", + "main": "index.js", + "scripts": { + "test": "tape test/*.js", + "gentest": "bash test/generate.sh" + }, + "dependencies": { + "balanced-match": "^0.2.0", + "concat-map": "0.0.1" + }, + "devDependencies": { + "tape": "^3.0.3" + }, + "keywords": [], + "author": { + "name": "Julian Gruber", + "email": "mail@juliangruber.com", + "url": "http://juliangruber.com" + }, + "license": "MIT", + "testling": { + "files": "test/*.js", + "browsers": [ + "ie/8..latest", + "firefox/20..latest", + "firefox/nightly", + "chrome/25..latest", + "chrome/canary", + "opera/12..latest", + "opera/next", + "safari/5.1..latest", + "ipad/6.0..latest", + "iphone/6.0..latest", + "android-browser/4.2..latest" + ] + }, + "gitHead": "b5fa3b1c74e5e2dba2d0efa19b28335641bc1164", + "bugs": { + "url": "https://github.com/juliangruber/brace-expansion/issues" + }, + "_id": "brace-expansion@1.1.0", + "_shasum": "c9b7d03c03f37bc704be100e522b40db8f6cfcd9", + "_from": "brace-expansion@^1.0.0", + "_npmVersion": "2.1.10", + "_nodeVersion": "0.10.32", + "_npmUser": { + "name": "juliangruber", + "email": "julian@juliangruber.com" + }, + "maintainers": [ + { + "name": "juliangruber", + "email": "julian@juliangruber.com" + }, + { + "name": "isaacs", + "email": "isaacs@npmjs.com" + } + ], + "dist": { + "shasum": "c9b7d03c03f37bc704be100e522b40db8f6cfcd9", + "tarball": "http://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.0.tgz" + }, + "directories": {}, + "_resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.0.tgz" +} diff --git a/node_modules/bower/node_modules/fstream-ignore/node_modules/minimatch/node_modules/brace-expansion/test/bash-comparison.js b/node_modules/bower/node_modules/fstream-ignore/node_modules/minimatch/node_modules/brace-expansion/test/bash-comparison.js new file mode 100644 index 0000000..5fe2b8a --- /dev/null +++ b/node_modules/bower/node_modules/fstream-ignore/node_modules/minimatch/node_modules/brace-expansion/test/bash-comparison.js @@ -0,0 +1,32 @@ +var test = require('tape'); +var expand = require('..'); +var fs = require('fs'); +var resfile = __dirname + '/bash-results.txt'; +var cases = fs.readFileSync(resfile, 'utf8').split('><><><><'); + +// throw away the EOF marker +cases.pop() + +test('matches bash expansions', function(t) { + cases.forEach(function(testcase) { + var set = testcase.split('\n'); + var pattern = set.shift(); + var actual = expand(pattern); + + // If it expands to the empty string, then it's actually + // just nothing, but Bash is a singly typed language, so + // "nothing" is the same as "". + if (set.length === 1 && set[0] === '') { + set = [] + } else { + // otherwise, strip off the [] that were added so that + // "" expansions would be preserved properly. + set = set.map(function (s) { + return s.replace(/^\[|\]$/g, '') + }) + } + + t.same(actual, set, pattern); + }); + t.end(); +}) diff --git a/node_modules/bower/node_modules/fstream-ignore/node_modules/minimatch/node_modules/brace-expansion/test/bash-results.txt b/node_modules/bower/node_modules/fstream-ignore/node_modules/minimatch/node_modules/brace-expansion/test/bash-results.txt new file mode 100644 index 0000000..958148d --- /dev/null +++ b/node_modules/bower/node_modules/fstream-ignore/node_modules/minimatch/node_modules/brace-expansion/test/bash-results.txt @@ -0,0 +1,1075 @@ +A{b,{d,e},{f,g}}Z +[AbZ] +[AdZ] +[AeZ] +[AfZ] +[AgZ]><><><><><><><\{a,b}{{a,b},a,b} +[{a,b}a] +[{a,b}b] +[{a,b}a] +[{a,b}b]><><><><{{a,b} +[{a] +[{b]><><><><{a,b}} +[a}] +[b}]><><><><{,} +><><><><><><><{,}b +[b] +[b]><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><{-01..5} +[-01] +[000] +[001] +[002] +[003] +[004] +[005]><><><><{-05..100..5} +[-05] +[000] +[005] +[010] +[015] +[020] +[025] +[030] +[035] +[040] +[045] +[050] +[055] +[060] +[065] +[070] +[075] +[080] +[085] +[090] +[095] +[100]><><><><{-05..100} +[-05] +[-04] +[-03] +[-02] +[-01] +[000] +[001] +[002] +[003] +[004] +[005] +[006] +[007] +[008] +[009] +[010] +[011] +[012] +[013] +[014] +[015] +[016] +[017] +[018] +[019] +[020] +[021] +[022] +[023] +[024] +[025] +[026] +[027] +[028] +[029] +[030] +[031] +[032] +[033] +[034] +[035] +[036] +[037] +[038] +[039] +[040] +[041] +[042] +[043] +[044] +[045] +[046] +[047] +[048] +[049] +[050] +[051] +[052] +[053] +[054] +[055] +[056] +[057] +[058] +[059] +[060] +[061] +[062] +[063] +[064] +[065] +[066] +[067] +[068] +[069] +[070] +[071] +[072] +[073] +[074] +[075] +[076] +[077] +[078] +[079] +[080] +[081] +[082] +[083] +[084] +[085] +[086] +[087] +[088] +[089] +[090] +[091] +[092] +[093] +[094] +[095] +[096] +[097] +[098] +[099] +[100]><><><><{0..5..2} +[0] +[2] +[4]><><><><{0001..05..2} +[0001] +[0003] +[0005]><><><><{0001..-5..2} +[0001] +[-001] +[-003] +[-005]><><><><{0001..-5..-2} +[0001] +[-001] +[-003] +[-005]><><><><{0001..5..-2} +[0001] +[0003] +[0005]><><><><{01..5} +[01] +[02] +[03] +[04] +[05]><><><><{1..05} +[01] +[02] +[03] +[04] +[05]><><><><{1..05..3} +[01] +[04]><><><><{05..100} +[005] +[006] +[007] +[008] +[009] +[010] +[011] +[012] +[013] +[014] +[015] +[016] +[017] +[018] +[019] +[020] +[021] +[022] +[023] +[024] +[025] +[026] +[027] +[028] +[029] +[030] +[031] +[032] +[033] +[034] +[035] +[036] +[037] +[038] +[039] +[040] +[041] +[042] +[043] +[044] +[045] +[046] +[047] +[048] +[049] +[050] +[051] +[052] +[053] +[054] +[055] +[056] +[057] +[058] +[059] +[060] +[061] +[062] +[063] +[064] +[065] +[066] +[067] +[068] +[069] +[070] +[071] +[072] +[073] +[074] +[075] +[076] +[077] +[078] +[079] +[080] +[081] +[082] +[083] +[084] +[085] +[086] +[087] +[088] +[089] +[090] +[091] +[092] +[093] +[094] +[095] +[096] +[097] +[098] +[099] +[100]><><><><{0a..0z} +[{0a..0z}]><><><><{a,b\}c,d} +[a] +[b}c] +[d]><><><><{a,b{c,d} +[{a,bc] +[{a,bd]><><><><{a,b}c,d} +[ac,d}] +[bc,d}]><><><><{a..F} +[a] +[`] +[_] +[^] +[]] +[] +[[] +[Z] +[Y] +[X] +[W] +[V] +[U] +[T] +[S] +[R] +[Q] +[P] +[O] +[N] +[M] +[L] +[K] +[J] +[I] +[H] +[G] +[F]><><><><{A..f} +[A] +[B] +[C] +[D] +[E] +[F] +[G] +[H] +[I] +[J] +[K] +[L] +[M] +[N] +[O] +[P] +[Q] +[R] +[S] +[T] +[U] +[V] +[W] +[X] +[Y] +[Z] +[[] +[] +[]] +[^] +[_] +[`] +[a] +[b] +[c] +[d] +[e] +[f]><><><><{a..Z} +[a] +[`] +[_] +[^] +[]] +[] +[[] +[Z]><><><><{A..z} +[A] +[B] +[C] +[D] +[E] +[F] +[G] +[H] +[I] +[J] +[K] +[L] +[M] +[N] +[O] +[P] +[Q] +[R] +[S] +[T] +[U] +[V] +[W] +[X] +[Y] +[Z] +[[] +[] +[]] +[^] +[_] +[`] +[a] +[b] +[c] +[d] +[e] +[f] +[g] +[h] +[i] +[j] +[k] +[l] +[m] +[n] +[o] +[p] +[q] +[r] +[s] +[t] +[u] +[v] +[w] +[x] +[y] +[z]><><><><{z..A} +[z] +[y] +[x] +[w] +[v] +[u] +[t] +[s] +[r] +[q] +[p] +[o] +[n] +[m] +[l] +[k] +[j] +[i] +[h] +[g] +[f] +[e] +[d] +[c] +[b] +[a] +[`] +[_] +[^] +[]] +[] +[[] +[Z] +[Y] +[X] +[W] +[V] +[U] +[T] +[S] +[R] +[Q] +[P] +[O] +[N] +[M] +[L] +[K] +[J] +[I] +[H] +[G] +[F] +[E] +[D] +[C] +[B] +[A]><><><><{Z..a} +[Z] +[[] +[] +[]] +[^] +[_] +[`] +[a]><><><><{a..F..2} +[a] +[_] +[]] +[[] +[Y] +[W] +[U] +[S] +[Q] +[O] +[M] +[K] +[I] +[G]><><><><{A..f..02} +[A] +[C] +[E] +[G] +[I] +[K] +[M] +[O] +[Q] +[S] +[U] +[W] +[Y] +[[] +[]] +[_] +[a] +[c] +[e]><><><><{a..Z..5} +[a] +[]><><><><><><><{A..z..10} +[A] +[K] +[U] +[_] +[i] +[s]><><><><{z..A..-2} +[z] +[x] +[v] +[t] +[r] +[p] +[n] +[l] +[j] +[h] +[f] +[d] +[b] +[`] +[^] +[] +[Z] +[X] +[V] +[T] +[R] +[P] +[N] +[L] +[J] +[H] +[F] +[D] +[B]><><><><{Z..a..20} +[Z]><><><><{a{,b} +[{a] +[{ab]><><><><{a},b} +[a}] +[b]><><><><{x,y{,}g} +[x] +[yg] +[yg]><><><><{x,y{}g} +[x] +[y{}g]><><><><{{a,b} +[{a] +[{b]><><><><{{a,b},c} +[a] +[b] +[c]><><><><{{a,b}c} +[{ac}] +[{bc}]><><><><{{a,b},} +[a] +[b]><><><><><><><{{a,b},}c +[ac] +[bc] +[c]><><><><{{a,b}.} +[{a.}] +[{b.}]><><><><{{a,b}} +[{a}] +[{b}]><><><><><><>< +><><><><{-10..00} +[-10] +[-09] +[-08] +[-07] +[-06] +[-05] +[-04] +[-03] +[-02] +[-01] +[000]><><><><{a,\\{a,b}c} +[a] +[\ac] +[\bc]><><><><{a,\{a,b}c} +[ac}] +[{ac}] +[bc}]><><><><><><><{-10.\.00} +[{-10..00}]><><><><><><><><><><{l,n,m}xyz +[lxyz] +[nxyz] +[mxyz]><><><><{abc\,def} +[{abc,def}]><><><><{abc} +[{abc}]><><><><{x\,y,\{abc\},trie} +[x,y] +[{abc}] +[trie]><><><><{} +[{}]><><><><} +[}]><><><><{ +[{]><><><><><><><{1..10} +[1] +[2] +[3] +[4] +[5] +[6] +[7] +[8] +[9] +[10]><><><><{0..10,braces} +[0..10] +[braces]><><><><{{0..10},braces} +[0] +[1] +[2] +[3] +[4] +[5] +[6] +[7] +[8] +[9] +[10] +[braces]><><><><><><><{3..3} +[3]><><><><><><><{10..1} +[10] +[9] +[8] +[7] +[6] +[5] +[4] +[3] +[2] +[1]><><><><{10..1}y +[10y] +[9y] +[8y] +[7y] +[6y] +[5y] +[4y] +[3y] +[2y] +[1y]><><><><><><><{a..f} +[a] +[b] +[c] +[d] +[e] +[f]><><><><{f..a} +[f] +[e] +[d] +[c] +[b] +[a]><><><><{a..A} +[a] +[`] +[_] +[^] +[]] +[] +[[] +[Z] +[Y] +[X] +[W] +[V] +[U] +[T] +[S] +[R] +[Q] +[P] +[O] +[N] +[M] +[L] +[K] +[J] +[I] +[H] +[G] +[F] +[E] +[D] +[C] +[B] +[A]><><><><{A..a} +[A] +[B] +[C] +[D] +[E] +[F] +[G] +[H] +[I] +[J] +[K] +[L] +[M] +[N] +[O] +[P] +[Q] +[R] +[S] +[T] +[U] +[V] +[W] +[X] +[Y] +[Z] +[[] +[] +[]] +[^] +[_] +[`] +[a]><><><><{f..f} +[f]><><><><{1..f} +[{1..f}]><><><><{f..1} +[{f..1}]><><><><{-1..-10} +[-1] +[-2] +[-3] +[-4] +[-5] +[-6] +[-7] +[-8] +[-9] +[-10]><><><><{-20..0} +[-20] +[-19] +[-18] +[-17] +[-16] +[-15] +[-14] +[-13] +[-12] +[-11] +[-10] +[-9] +[-8] +[-7] +[-6] +[-5] +[-4] +[-3] +[-2] +[-1] +[0]><><><><><><><><><><{klklkl}{1,2,3} +[{klklkl}1] +[{klklkl}2] +[{klklkl}3]><><><><{1..10..2} +[1] +[3] +[5] +[7] +[9]><><><><{-1..-10..2} +[-1] +[-3] +[-5] +[-7] +[-9]><><><><{-1..-10..-2} +[-1] +[-3] +[-5] +[-7] +[-9]><><><><{10..1..-2} +[10] +[8] +[6] +[4] +[2]><><><><{10..1..2} +[10] +[8] +[6] +[4] +[2]><><><><{1..20..2} +[1] +[3] +[5] +[7] +[9] +[11] +[13] +[15] +[17] +[19]><><><><{1..20..20} +[1]><><><><{100..0..5} +[100] +[95] +[90] +[85] +[80] +[75] +[70] +[65] +[60] +[55] +[50] +[45] +[40] +[35] +[30] +[25] +[20] +[15] +[10] +[5] +[0]><><><><{100..0..-5} +[100] +[95] +[90] +[85] +[80] +[75] +[70] +[65] +[60] +[55] +[50] +[45] +[40] +[35] +[30] +[25] +[20] +[15] +[10] +[5] +[0]><><><><{a..z} +[a] +[b] +[c] +[d] +[e] +[f] +[g] +[h] +[i] +[j] +[k] +[l] +[m] +[n] +[o] +[p] +[q] +[r] +[s] +[t] +[u] +[v] +[w] +[x] +[y] +[z]><><><><{a..z..2} +[a] +[c] +[e] +[g] +[i] +[k] +[m] +[o] +[q] +[s] +[u] +[w] +[y]><><><><{z..a..-2} +[z] +[x] +[v] +[t] +[r] +[p] +[n] +[l] +[j] +[h] +[f] +[d] +[b]><><><><{2147483645..2147483649} +[2147483645] +[2147483646] +[2147483647] +[2147483648] +[2147483649]><><><><{10..0..2} +[10] +[8] +[6] +[4] +[2] +[0]><><><><{10..0..-2} +[10] +[8] +[6] +[4] +[2] +[0]><><><><{-50..-0..5} +[-50] +[-45] +[-40] +[-35] +[-30] +[-25] +[-20] +[-15] +[-10] +[-5] +[0]><><><><{1..10.f} +[{1..10.f}]><><><><{1..ff} +[{1..ff}]><><><><{1..10..ff} +[{1..10..ff}]><><><><{1.20..2} +[{1.20..2}]><><><><{1..20..f2} +[{1..20..f2}]><><><><{1..20..2f} +[{1..20..2f}]><><><><{1..2f..2} +[{1..2f..2}]><><><><{1..ff..2} +[{1..ff..2}]><><><><{1..ff} +[{1..ff}]><><><><{1..f} +[{1..f}]><><><><{1..0f} +[{1..0f}]><><><><{1..10f} +[{1..10f}]><><><><{1..10.f} +[{1..10.f}]><><><><{1..10.f} +[{1..10.f}]><><><>< \ No newline at end of file diff --git a/node_modules/bower/node_modules/fstream-ignore/node_modules/minimatch/node_modules/brace-expansion/test/cases.txt b/node_modules/bower/node_modules/fstream-ignore/node_modules/minimatch/node_modules/brace-expansion/test/cases.txt new file mode 100644 index 0000000..e5161c3 --- /dev/null +++ b/node_modules/bower/node_modules/fstream-ignore/node_modules/minimatch/node_modules/brace-expansion/test/cases.txt @@ -0,0 +1,182 @@ +# skip quotes for now +# "{x,x}" +# {"x,x"} +# {x","x} +# '{a,b}{{a,b},a,b}' +A{b,{d,e},{f,g}}Z +PRE-{a,b}{{a,b},a,b}-POST +\\{a,b}{{a,b},a,b} +{{a,b} +{a,b}} +{,} +a{,} +{,}b +a{,}b +a{b}c +a{1..5}b +a{01..5}b +a{-01..5}b +a{-01..5..3}b +a{001..9}b +a{b,c{d,e},{f,g}h}x{y,z +a{b,c{d,e},{f,g}h}x{y,z\\} +a{b,c{d,e},{f,g}h}x{y,z} +a{b{c{d,e}f{x,y{{g}h +a{b{c{d,e}f{x,y{}g}h +a{b{c{d,e}f{x,y}}g}h +a{b{c{d,e}f}g}h +a{{x,y},z}b +f{x,y{g,z}}h +f{x,y{{g,z}}h +f{x,y{{g,z}}h} +f{x,y{{g}h +f{x,y{{g}}h +f{x,y{}g}h +z{a,b{,c}d +z{a,b},c}d +{-01..5} +{-05..100..5} +{-05..100} +{0..5..2} +{0001..05..2} +{0001..-5..2} +{0001..-5..-2} +{0001..5..-2} +{01..5} +{1..05} +{1..05..3} +{05..100} +{0a..0z} +{a,b\\}c,d} +{a,b{c,d} +{a,b}c,d} +{a..F} +{A..f} +{a..Z} +{A..z} +{z..A} +{Z..a} +{a..F..2} +{A..f..02} +{a..Z..5} +d{a..Z..5}b +{A..z..10} +{z..A..-2} +{Z..a..20} +{a{,b} +{a},b} +{x,y{,}g} +{x,y{}g} +{{a,b} +{{a,b},c} +{{a,b}c} +{{a,b},} +X{{a,b},}X +{{a,b},}c +{{a,b}.} +{{a,b}} +X{a..#}X +# this next one is an empty string + +{-10..00} +# Need to escape slashes in here for reasons i guess. +{a,\\\\{a,b}c} +{a,\\{a,b}c} +a,\\{b,c} +{-10.\\.00} +#### bash tests/braces.tests +# Note that some tests are edited out because some features of +# bash are intentionally not supported in this brace expander. +ff{c,b,a} +f{d,e,f}g +{l,n,m}xyz +{abc\\,def} +{abc} +{x\\,y,\\{abc\\},trie} +# not impementing back-ticks obviously +# XXXX\\{`echo a b c | tr ' ' ','`\\} +{} +# We only ever have to worry about parsing a single argument, +# not a command line, so spaces have a different meaning than bash. +# { } +} +{ +abcd{efgh +# spaces +# foo {1,2} bar +# not impementing back-ticks obviously +# `zecho foo {1,2} bar` +# $(zecho foo {1,2} bar) +# ${var} is not a variable here, like it is in bash. omit. +# foo{bar,${var}.} +# foo{bar,${var}} +# isaacs: skip quotes for now +# "${var}"{x,y} +# $var{x,y} +# ${var}{x,y} +# new sequence brace operators +{1..10} +# this doesn't work yet +{0..10,braces} +# but this does +{{0..10},braces} +x{{0..10},braces}y +{3..3} +x{3..3}y +{10..1} +{10..1}y +x{10..1}y +{a..f} +{f..a} +{a..A} +{A..a} +{f..f} +# mixes are incorrectly-formed brace expansions +{1..f} +{f..1} +# spaces +# 0{1..9} {10..20} +# do negative numbers work? +{-1..-10} +{-20..0} +# weirdly-formed brace expansions -- fixed in post-bash-3.1 +a-{b{d,e}}-c +a-{bdef-{g,i}-c +# isaacs: skip quotes for now +# {"klklkl"}{1,2,3} +# isaacs: this is a valid test, though +{klklkl}{1,2,3} +# {"x,x"} +{1..10..2} +{-1..-10..2} +{-1..-10..-2} +{10..1..-2} +{10..1..2} +{1..20..2} +{1..20..20} +{100..0..5} +{100..0..-5} +{a..z} +{a..z..2} +{z..a..-2} +# make sure brace expansion handles ints > 2**31 - 1 using intmax_t +{2147483645..2147483649} +# unwanted zero-padding -- fixed post-bash-4.0 +{10..0..2} +{10..0..-2} +{-50..-0..5} +# bad +{1..10.f} +{1..ff} +{1..10..ff} +{1.20..2} +{1..20..f2} +{1..20..2f} +{1..2f..2} +{1..ff..2} +{1..ff} +{1..f} +{1..0f} +{1..10f} +{1..10.f} +{1..10.f} diff --git a/node_modules/bower/node_modules/fstream-ignore/node_modules/minimatch/node_modules/brace-expansion/test/dollar.js b/node_modules/bower/node_modules/fstream-ignore/node_modules/minimatch/node_modules/brace-expansion/test/dollar.js new file mode 100644 index 0000000..3fcc185 --- /dev/null +++ b/node_modules/bower/node_modules/fstream-ignore/node_modules/minimatch/node_modules/brace-expansion/test/dollar.js @@ -0,0 +1,9 @@ +var test = require('tape'); +var expand = require('..'); + +test('ignores ${', function(t) { + t.deepEqual(expand('${1..3}'), ['${1..3}']); + t.deepEqual(expand('${a,b}${c,d}'), ['${a,b}${c,d}']); + t.deepEqual(expand('x${a,b}x${c,d}x'), ['x${a,b}x${c,d}x']); + t.end(); +}); diff --git a/node_modules/bower/node_modules/fstream-ignore/node_modules/minimatch/node_modules/brace-expansion/test/empty-option.js b/node_modules/bower/node_modules/fstream-ignore/node_modules/minimatch/node_modules/brace-expansion/test/empty-option.js new file mode 100644 index 0000000..e429121 --- /dev/null +++ b/node_modules/bower/node_modules/fstream-ignore/node_modules/minimatch/node_modules/brace-expansion/test/empty-option.js @@ -0,0 +1,10 @@ +var test = require('tape'); +var expand = require('..'); + +test('empty option', function(t) { + t.deepEqual(expand('-v{,,,,}'), [ + '-v', '-v', '-v', '-v', '-v' + ]); + t.end(); +}); + diff --git a/node_modules/bower/node_modules/fstream-ignore/node_modules/minimatch/node_modules/brace-expansion/test/generate.sh b/node_modules/bower/node_modules/fstream-ignore/node_modules/minimatch/node_modules/brace-expansion/test/generate.sh new file mode 100644 index 0000000..e040e66 --- /dev/null +++ b/node_modules/bower/node_modules/fstream-ignore/node_modules/minimatch/node_modules/brace-expansion/test/generate.sh @@ -0,0 +1,24 @@ +#!/usr/bin/env bash + +set -e + +# Bash 4.3 because of arbitrary need to pick a single standard. + +if [ "${BASH_VERSINFO[0]}" != "4" ] || [ "${BASH_VERSINFO[1]}" != "3" ]; then + echo "this script requires bash 4.3" >&2 + exit 1 +fi + +CDPATH= cd "$(dirname "$0")" + +js='require("./")(process.argv[1]).join(" ")' + +cat cases.txt | \ + while read case; do + if [ "${case:0:1}" = "#" ]; then + continue; + fi; + b="$($BASH -c 'for c in '"$case"'; do echo ["$c"]; done')" + echo "$case" + echo -n "$b><><><><"; + done > bash-results.txt diff --git a/node_modules/bower/node_modules/fstream-ignore/node_modules/minimatch/node_modules/brace-expansion/test/negative-increment.js b/node_modules/bower/node_modules/fstream-ignore/node_modules/minimatch/node_modules/brace-expansion/test/negative-increment.js new file mode 100644 index 0000000..8d434c2 --- /dev/null +++ b/node_modules/bower/node_modules/fstream-ignore/node_modules/minimatch/node_modules/brace-expansion/test/negative-increment.js @@ -0,0 +1,15 @@ +var test = require('tape'); +var expand = require('..'); + +test('negative increment', function(t) { + t.deepEqual(expand('{3..1}'), ['3', '2', '1']); + t.deepEqual(expand('{10..8}'), ['10', '9', '8']); + t.deepEqual(expand('{10..08}'), ['10', '09', '08']); + t.deepEqual(expand('{c..a}'), ['c', 'b', 'a']); + + t.deepEqual(expand('{4..0..2}'), ['4', '2', '0']); + t.deepEqual(expand('{4..0..-2}'), ['4', '2', '0']); + t.deepEqual(expand('{e..a..2}'), ['e', 'c', 'a']); + + t.end(); +}); diff --git a/node_modules/bower/node_modules/fstream-ignore/node_modules/minimatch/node_modules/brace-expansion/test/nested.js b/node_modules/bower/node_modules/fstream-ignore/node_modules/minimatch/node_modules/brace-expansion/test/nested.js new file mode 100644 index 0000000..0862dc5 --- /dev/null +++ b/node_modules/bower/node_modules/fstream-ignore/node_modules/minimatch/node_modules/brace-expansion/test/nested.js @@ -0,0 +1,16 @@ +var test = require('tape'); +var expand = require('..'); + +test('nested', function(t) { + t.deepEqual(expand('{a,b{1..3},c}'), [ + 'a', 'b1', 'b2', 'b3', 'c' + ]); + t.deepEqual(expand('{{A..Z},{a..z}}'), + 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz'.split('') + ); + t.deepEqual(expand('ppp{,config,oe{,conf}}'), [ + 'ppp', 'pppconfig', 'pppoe', 'pppoeconf' + ]); + t.end(); +}); + diff --git a/node_modules/bower/node_modules/fstream-ignore/node_modules/minimatch/node_modules/brace-expansion/test/order.js b/node_modules/bower/node_modules/fstream-ignore/node_modules/minimatch/node_modules/brace-expansion/test/order.js new file mode 100644 index 0000000..c00ad15 --- /dev/null +++ b/node_modules/bower/node_modules/fstream-ignore/node_modules/minimatch/node_modules/brace-expansion/test/order.js @@ -0,0 +1,10 @@ +var test = require('tape'); +var expand = require('..'); + +test('order', function(t) { + t.deepEqual(expand('a{d,c,b}e'), [ + 'ade', 'ace', 'abe' + ]); + t.end(); +}); + diff --git a/node_modules/bower/node_modules/fstream-ignore/node_modules/minimatch/node_modules/brace-expansion/test/pad.js b/node_modules/bower/node_modules/fstream-ignore/node_modules/minimatch/node_modules/brace-expansion/test/pad.js new file mode 100644 index 0000000..e415877 --- /dev/null +++ b/node_modules/bower/node_modules/fstream-ignore/node_modules/minimatch/node_modules/brace-expansion/test/pad.js @@ -0,0 +1,13 @@ +var test = require('tape'); +var expand = require('..'); + +test('pad', function(t) { + t.deepEqual(expand('{9..11}'), [ + '9', '10', '11' + ]); + t.deepEqual(expand('{09..11}'), [ + '09', '10', '11' + ]); + t.end(); +}); + diff --git a/node_modules/bower/node_modules/fstream-ignore/node_modules/minimatch/node_modules/brace-expansion/test/same-type.js b/node_modules/bower/node_modules/fstream-ignore/node_modules/minimatch/node_modules/brace-expansion/test/same-type.js new file mode 100644 index 0000000..3038fba --- /dev/null +++ b/node_modules/bower/node_modules/fstream-ignore/node_modules/minimatch/node_modules/brace-expansion/test/same-type.js @@ -0,0 +1,7 @@ +var test = require('tape'); +var expand = require('..'); + +test('x and y of same type', function(t) { + t.deepEqual(expand('{a..9}'), ['{a..9}']); + t.end(); +}); diff --git a/node_modules/bower/node_modules/fstream-ignore/node_modules/minimatch/node_modules/brace-expansion/test/sequence.js b/node_modules/bower/node_modules/fstream-ignore/node_modules/minimatch/node_modules/brace-expansion/test/sequence.js new file mode 100644 index 0000000..f73a957 --- /dev/null +++ b/node_modules/bower/node_modules/fstream-ignore/node_modules/minimatch/node_modules/brace-expansion/test/sequence.js @@ -0,0 +1,50 @@ +var test = require('tape'); +var expand = require('..'); + +test('numeric sequences', function(t) { + t.deepEqual(expand('a{1..2}b{2..3}c'), [ + 'a1b2c', 'a1b3c', 'a2b2c', 'a2b3c' + ]); + t.deepEqual(expand('{1..2}{2..3}'), [ + '12', '13', '22', '23' + ]); + t.end(); +}); + +test('numeric sequences with step count', function(t) { + t.deepEqual(expand('{0..8..2}'), [ + '0', '2', '4', '6', '8' + ]); + t.deepEqual(expand('{1..8..2}'), [ + '1', '3', '5', '7' + ]); + t.end(); +}); + +test('numeric sequence with negative x / y', function(t) { + t.deepEqual(expand('{3..-2}'), [ + '3', '2', '1', '0', '-1', '-2' + ]); + t.end(); +}); + +test('alphabetic sequences', function(t) { + t.deepEqual(expand('1{a..b}2{b..c}3'), [ + '1a2b3', '1a2c3', '1b2b3', '1b2c3' + ]); + t.deepEqual(expand('{a..b}{b..c}'), [ + 'ab', 'ac', 'bb', 'bc' + ]); + t.end(); +}); + +test('alphabetic sequences with step count', function(t) { + t.deepEqual(expand('{a..k..2}'), [ + 'a', 'c', 'e', 'g', 'i', 'k' + ]); + t.deepEqual(expand('{b..k..2}'), [ + 'b', 'd', 'f', 'h', 'j' + ]); + t.end(); +}); + diff --git a/node_modules/bower/node_modules/fstream-ignore/node_modules/minimatch/node_modules/sigmund/LICENSE b/node_modules/bower/node_modules/fstream-ignore/node_modules/minimatch/node_modules/sigmund/LICENSE deleted file mode 100644 index 0c44ae7..0000000 --- a/node_modules/bower/node_modules/fstream-ignore/node_modules/minimatch/node_modules/sigmund/LICENSE +++ /dev/null @@ -1,27 +0,0 @@ -Copyright (c) Isaac Z. Schlueter ("Author") -All rights reserved. - -The BSD License - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: - -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS -BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR -BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, -WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE -OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN -IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/node_modules/bower/node_modules/fstream-ignore/node_modules/minimatch/node_modules/sigmund/README.md b/node_modules/bower/node_modules/fstream-ignore/node_modules/minimatch/node_modules/sigmund/README.md deleted file mode 100644 index 7e36512..0000000 --- a/node_modules/bower/node_modules/fstream-ignore/node_modules/minimatch/node_modules/sigmund/README.md +++ /dev/null @@ -1,53 +0,0 @@ -# sigmund - -Quick and dirty signatures for Objects. - -This is like a much faster `deepEquals` comparison, which returns a -string key suitable for caches and the like. - -## Usage - -```javascript -function doSomething (someObj) { - var key = sigmund(someObj, maxDepth) // max depth defaults to 10 - var cached = cache.get(key) - if (cached) return cached) - - var result = expensiveCalculation(someObj) - cache.set(key, result) - return result -} -``` - -The resulting key will be as unique and reproducible as calling -`JSON.stringify` or `util.inspect` on the object, but is much faster. -In order to achieve this speed, some differences are glossed over. -For example, the object `{0:'foo'}` will be treated identically to the -array `['foo']`. - -Also, just as there is no way to summon the soul from the scribblings -of a cocain-addled psychoanalyst, there is no way to revive the object -from the signature string that sigmund gives you. In fact, it's -barely even readable. - -As with `sys.inspect` and `JSON.stringify`, larger objects will -produce larger signature strings. - -Because sigmund is a bit less strict than the more thorough -alternatives, the strings will be shorter, and also there is a -slightly higher chance for collisions. For example, these objects -have the same signature: - - var obj1 = {a:'b',c:/def/,g:['h','i',{j:'',k:'l'}]} - var obj2 = {a:'b',c:'/def/',g:['h','i','{jkl']} - -Like a good Freudian, sigmund is most effective when you already have -some understanding of what you're looking for. It can help you help -yourself, but you must be willing to do some work as well. - -Cycles are handled, and cyclical objects are silently omitted (though -the key is included in the signature output.) - -The second argument is the maximum depth, which defaults to 10, -because that is the maximum object traversal depth covered by most -insurance carriers. diff --git a/node_modules/bower/node_modules/fstream-ignore/node_modules/minimatch/node_modules/sigmund/bench.js b/node_modules/bower/node_modules/fstream-ignore/node_modules/minimatch/node_modules/sigmund/bench.js deleted file mode 100644 index 5acfd6d..0000000 --- a/node_modules/bower/node_modules/fstream-ignore/node_modules/minimatch/node_modules/sigmund/bench.js +++ /dev/null @@ -1,283 +0,0 @@ -// different ways to id objects -// use a req/res pair, since it's crazy deep and cyclical - -// sparseFE10 and sigmund are usually pretty close, which is to be expected, -// since they are essentially the same algorithm, except that sigmund handles -// regular expression objects properly. - - -var http = require('http') -var util = require('util') -var sigmund = require('./sigmund.js') -var sreq, sres, creq, cres, test - -http.createServer(function (q, s) { - sreq = q - sres = s - sres.end('ok') - this.close(function () { setTimeout(function () { - start() - }, 200) }) -}).listen(1337, function () { - creq = http.get({ port: 1337 }) - creq.on('response', function (s) { cres = s }) -}) - -function start () { - test = [sreq, sres, creq, cres] - // test = sreq - // sreq.sres = sres - // sreq.creq = creq - // sreq.cres = cres - - for (var i in exports.compare) { - console.log(i) - var hash = exports.compare[i]() - console.log(hash) - console.log(hash.length) - console.log('') - } - - require('bench').runMain() -} - -function customWs (obj, md, d) { - d = d || 0 - var to = typeof obj - if (to === 'undefined' || to === 'function' || to === null) return '' - if (d > md || !obj || to !== 'object') return ('' + obj).replace(/[\n ]+/g, '') - - if (Array.isArray(obj)) { - return obj.map(function (i, _, __) { - return customWs(i, md, d + 1) - }).reduce(function (a, b) { return a + b }, '') - } - - var keys = Object.keys(obj) - return keys.map(function (k, _, __) { - return k + ':' + customWs(obj[k], md, d + 1) - }).reduce(function (a, b) { return a + b }, '') -} - -function custom (obj, md, d) { - d = d || 0 - var to = typeof obj - if (to === 'undefined' || to === 'function' || to === null) return '' - if (d > md || !obj || to !== 'object') return '' + obj - - if (Array.isArray(obj)) { - return obj.map(function (i, _, __) { - return custom(i, md, d + 1) - }).reduce(function (a, b) { return a + b }, '') - } - - var keys = Object.keys(obj) - return keys.map(function (k, _, __) { - return k + ':' + custom(obj[k], md, d + 1) - }).reduce(function (a, b) { return a + b }, '') -} - -function sparseFE2 (obj, maxDepth) { - var seen = [] - var soFar = '' - function ch (v, depth) { - if (depth > maxDepth) return - if (typeof v === 'function' || typeof v === 'undefined') return - if (typeof v !== 'object' || !v) { - soFar += v - return - } - if (seen.indexOf(v) !== -1 || depth === maxDepth) return - seen.push(v) - soFar += '{' - Object.keys(v).forEach(function (k, _, __) { - // pseudo-private values. skip those. - if (k.charAt(0) === '_') return - var to = typeof v[k] - if (to === 'function' || to === 'undefined') return - soFar += k + ':' - ch(v[k], depth + 1) - }) - soFar += '}' - } - ch(obj, 0) - return soFar -} - -function sparseFE (obj, maxDepth) { - var seen = [] - var soFar = '' - function ch (v, depth) { - if (depth > maxDepth) return - if (typeof v === 'function' || typeof v === 'undefined') return - if (typeof v !== 'object' || !v) { - soFar += v - return - } - if (seen.indexOf(v) !== -1 || depth === maxDepth) return - seen.push(v) - soFar += '{' - Object.keys(v).forEach(function (k, _, __) { - // pseudo-private values. skip those. - if (k.charAt(0) === '_') return - var to = typeof v[k] - if (to === 'function' || to === 'undefined') return - soFar += k - ch(v[k], depth + 1) - }) - } - ch(obj, 0) - return soFar -} - -function sparse (obj, maxDepth) { - var seen = [] - var soFar = '' - function ch (v, depth) { - if (depth > maxDepth) return - if (typeof v === 'function' || typeof v === 'undefined') return - if (typeof v !== 'object' || !v) { - soFar += v - return - } - if (seen.indexOf(v) !== -1 || depth === maxDepth) return - seen.push(v) - soFar += '{' - for (var k in v) { - // pseudo-private values. skip those. - if (k.charAt(0) === '_') continue - var to = typeof v[k] - if (to === 'function' || to === 'undefined') continue - soFar += k - ch(v[k], depth + 1) - } - } - ch(obj, 0) - return soFar -} - -function noCommas (obj, maxDepth) { - var seen = [] - var soFar = '' - function ch (v, depth) { - if (depth > maxDepth) return - if (typeof v === 'function' || typeof v === 'undefined') return - if (typeof v !== 'object' || !v) { - soFar += v - return - } - if (seen.indexOf(v) !== -1 || depth === maxDepth) return - seen.push(v) - soFar += '{' - for (var k in v) { - // pseudo-private values. skip those. - if (k.charAt(0) === '_') continue - var to = typeof v[k] - if (to === 'function' || to === 'undefined') continue - soFar += k + ':' - ch(v[k], depth + 1) - } - soFar += '}' - } - ch(obj, 0) - return soFar -} - - -function flatten (obj, maxDepth) { - var seen = [] - var soFar = '' - function ch (v, depth) { - if (depth > maxDepth) return - if (typeof v === 'function' || typeof v === 'undefined') return - if (typeof v !== 'object' || !v) { - soFar += v - return - } - if (seen.indexOf(v) !== -1 || depth === maxDepth) return - seen.push(v) - soFar += '{' - for (var k in v) { - // pseudo-private values. skip those. - if (k.charAt(0) === '_') continue - var to = typeof v[k] - if (to === 'function' || to === 'undefined') continue - soFar += k + ':' - ch(v[k], depth + 1) - soFar += ',' - } - soFar += '}' - } - ch(obj, 0) - return soFar -} - -exports.compare = -{ - // 'custom 2': function () { - // return custom(test, 2, 0) - // }, - // 'customWs 2': function () { - // return customWs(test, 2, 0) - // }, - 'JSON.stringify (guarded)': function () { - var seen = [] - return JSON.stringify(test, function (k, v) { - if (typeof v !== 'object' || !v) return v - if (seen.indexOf(v) !== -1) return undefined - seen.push(v) - return v - }) - }, - - 'flatten 10': function () { - return flatten(test, 10) - }, - - // 'flattenFE 10': function () { - // return flattenFE(test, 10) - // }, - - 'noCommas 10': function () { - return noCommas(test, 10) - }, - - 'sparse 10': function () { - return sparse(test, 10) - }, - - 'sparseFE 10': function () { - return sparseFE(test, 10) - }, - - 'sparseFE2 10': function () { - return sparseFE2(test, 10) - }, - - sigmund: function() { - return sigmund(test, 10) - }, - - - // 'util.inspect 1': function () { - // return util.inspect(test, false, 1, false) - // }, - // 'util.inspect undefined': function () { - // util.inspect(test) - // }, - // 'util.inspect 2': function () { - // util.inspect(test, false, 2, false) - // }, - // 'util.inspect 3': function () { - // util.inspect(test, false, 3, false) - // }, - // 'util.inspect 4': function () { - // util.inspect(test, false, 4, false) - // }, - // 'util.inspect Infinity': function () { - // util.inspect(test, false, Infinity, false) - // } -} - -/** results -**/ diff --git a/node_modules/bower/node_modules/fstream-ignore/node_modules/minimatch/node_modules/sigmund/package.json b/node_modules/bower/node_modules/fstream-ignore/node_modules/minimatch/node_modules/sigmund/package.json deleted file mode 100644 index a1f755a..0000000 --- a/node_modules/bower/node_modules/fstream-ignore/node_modules/minimatch/node_modules/sigmund/package.json +++ /dev/null @@ -1,58 +0,0 @@ -{ - "name": "sigmund", - "version": "1.0.0", - "description": "Quick and dirty signatures for Objects.", - "main": "sigmund.js", - "directories": { - "test": "test" - }, - "dependencies": {}, - "devDependencies": { - "tap": "~0.3.0" - }, - "scripts": { - "test": "tap test/*.js", - "bench": "node bench.js" - }, - "repository": { - "type": "git", - "url": "git://github.com/isaacs/sigmund" - }, - "keywords": [ - "object", - "signature", - "key", - "data", - "psychoanalysis" - ], - "author": { - "name": "Isaac Z. Schlueter", - "email": "i@izs.me", - "url": "http://blog.izs.me/" - }, - "license": "BSD", - "readme": "# sigmund\n\nQuick and dirty signatures for Objects.\n\nThis is like a much faster `deepEquals` comparison, which returns a\nstring key suitable for caches and the like.\n\n## Usage\n\n```javascript\nfunction doSomething (someObj) {\n var key = sigmund(someObj, maxDepth) // max depth defaults to 10\n var cached = cache.get(key)\n if (cached) return cached)\n\n var result = expensiveCalculation(someObj)\n cache.set(key, result)\n return result\n}\n```\n\nThe resulting key will be as unique and reproducible as calling\n`JSON.stringify` or `util.inspect` on the object, but is much faster.\nIn order to achieve this speed, some differences are glossed over.\nFor example, the object `{0:'foo'}` will be treated identically to the\narray `['foo']`.\n\nAlso, just as there is no way to summon the soul from the scribblings\nof a cocain-addled psychoanalyst, there is no way to revive the object\nfrom the signature string that sigmund gives you. In fact, it's\nbarely even readable.\n\nAs with `sys.inspect` and `JSON.stringify`, larger objects will\nproduce larger signature strings.\n\nBecause sigmund is a bit less strict than the more thorough\nalternatives, the strings will be shorter, and also there is a\nslightly higher chance for collisions. For example, these objects\nhave the same signature:\n\n var obj1 = {a:'b',c:/def/,g:['h','i',{j:'',k:'l'}]}\n var obj2 = {a:'b',c:'/def/',g:['h','i','{jkl']}\n\nLike a good Freudian, sigmund is most effective when you already have\nsome understanding of what you're looking for. It can help you help\nyourself, but you must be willing to do some work as well.\n\nCycles are handled, and cyclical objects are silently omitted (though\nthe key is included in the signature output.)\n\nThe second argument is the maximum depth, which defaults to 10,\nbecause that is the maximum object traversal depth covered by most\ninsurance carriers.\n", - "_id": "sigmund@1.0.0", - "dist": { - "shasum": "66a2b3a749ae8b5fb89efd4fcc01dc94fbe02296", - "tarball": "http://registry.npmjs.org/sigmund/-/sigmund-1.0.0.tgz" - }, - "_npmVersion": "1.1.48", - "_npmUser": { - "name": "isaacs", - "email": "i@izs.me" - }, - "maintainers": [ - { - "name": "isaacs", - "email": "i@izs.me" - } - ], - "_shasum": "66a2b3a749ae8b5fb89efd4fcc01dc94fbe02296", - "_from": "sigmund@~1.0.0", - "_resolved": "https://registry.npmjs.org/sigmund/-/sigmund-1.0.0.tgz", - "bugs": { - "url": "https://github.com/isaacs/sigmund/issues" - }, - "homepage": "https://github.com/isaacs/sigmund" -} diff --git a/node_modules/bower/node_modules/fstream-ignore/node_modules/minimatch/node_modules/sigmund/sigmund.js b/node_modules/bower/node_modules/fstream-ignore/node_modules/minimatch/node_modules/sigmund/sigmund.js deleted file mode 100644 index 82c7ab8..0000000 --- a/node_modules/bower/node_modules/fstream-ignore/node_modules/minimatch/node_modules/sigmund/sigmund.js +++ /dev/null @@ -1,39 +0,0 @@ -module.exports = sigmund -function sigmund (subject, maxSessions) { - maxSessions = maxSessions || 10; - var notes = []; - var analysis = ''; - var RE = RegExp; - - function psychoAnalyze (subject, session) { - if (session > maxSessions) return; - - if (typeof subject === 'function' || - typeof subject === 'undefined') { - return; - } - - if (typeof subject !== 'object' || !subject || - (subject instanceof RE)) { - analysis += subject; - return; - } - - if (notes.indexOf(subject) !== -1 || session === maxSessions) return; - - notes.push(subject); - analysis += '{'; - Object.keys(subject).forEach(function (issue, _, __) { - // pseudo-private values. skip those. - if (issue.charAt(0) === '_') return; - var to = typeof subject[issue]; - if (to === 'function' || to === 'undefined') return; - analysis += issue; - psychoAnalyze(subject[issue], session + 1); - }); - } - psychoAnalyze(subject, 0); - return analysis; -} - -// vim: set softtabstop=4 shiftwidth=4: diff --git a/node_modules/bower/node_modules/fstream-ignore/node_modules/minimatch/node_modules/sigmund/test/basic.js b/node_modules/bower/node_modules/fstream-ignore/node_modules/minimatch/node_modules/sigmund/test/basic.js deleted file mode 100644 index 50c53a1..0000000 --- a/node_modules/bower/node_modules/fstream-ignore/node_modules/minimatch/node_modules/sigmund/test/basic.js +++ /dev/null @@ -1,24 +0,0 @@ -var test = require('tap').test -var sigmund = require('../sigmund.js') - - -// occasionally there are duplicates -// that's an acceptable edge-case. JSON.stringify and util.inspect -// have some collision potential as well, though less, and collision -// detection is expensive. -var hash = '{abc/def/g{0h1i2{jkl' -var obj1 = {a:'b',c:/def/,g:['h','i',{j:'',k:'l'}]} -var obj2 = {a:'b',c:'/def/',g:['h','i','{jkl']} - -var obj3 = JSON.parse(JSON.stringify(obj1)) -obj3.c = /def/ -obj3.g[2].cycle = obj3 -var cycleHash = '{abc/def/g{0h1i2{jklcycle' - -test('basic', function (t) { - t.equal(sigmund(obj1), hash) - t.equal(sigmund(obj2), hash) - t.equal(sigmund(obj3), cycleHash) - t.end() -}) - diff --git a/node_modules/bower/node_modules/fstream-ignore/node_modules/minimatch/package.json b/node_modules/bower/node_modules/fstream-ignore/node_modules/minimatch/package.json index 156c5c3..91f372c 100644 --- a/node_modules/bower/node_modules/fstream-ignore/node_modules/minimatch/package.json +++ b/node_modules/bower/node_modules/fstream-ignore/node_modules/minimatch/package.json @@ -6,38 +6,40 @@ }, "name": "minimatch", "description": "a glob matcher in javascript", - "version": "1.0.0", + "version": "2.0.1", "repository": { "type": "git", "url": "git://github.com/isaacs/minimatch.git" }, "main": "minimatch.js", "scripts": { - "test": "tap test/*.js" + "test": "tap test/*.js", + "prepublish": "browserify -o browser.js -e minimatch.js" }, "engines": { "node": "*" }, "dependencies": { - "lru-cache": "2", - "sigmund": "~1.0.0" + "brace-expansion": "^1.0.0" }, "devDependencies": { + "browserify": "^6.3.3", "tap": "" }, "license": { "type": "MIT", "url": "http://github.com/isaacs/minimatch/raw/master/LICENSE" }, - "gitHead": "b374a643976eb55cdc19c60b6dd51ebe9bcc607a", + "gitHead": "eac219d8f665c8043fda9a1cd34eab9b006fae01", "bugs": { "url": "https://github.com/isaacs/minimatch/issues" }, "homepage": "https://github.com/isaacs/minimatch", - "_id": "minimatch@1.0.0", - "_shasum": "e0dd2120b49e1b724ce8d714c520822a9438576d", - "_from": "minimatch@^1.0.0", - "_npmVersion": "1.4.21", + "_id": "minimatch@2.0.1", + "_shasum": "6c3760b45f66ed1cd5803143ee8d372488f02c37", + "_from": "minimatch@^2.0.1", + "_npmVersion": "2.1.11", + "_nodeVersion": "0.10.16", "_npmUser": { "name": "isaacs", "email": "i@izs.me" @@ -49,10 +51,9 @@ } ], "dist": { - "shasum": "e0dd2120b49e1b724ce8d714c520822a9438576d", - "tarball": "http://registry.npmjs.org/minimatch/-/minimatch-1.0.0.tgz" + "shasum": "6c3760b45f66ed1cd5803143ee8d372488f02c37", + "tarball": "http://registry.npmjs.org/minimatch/-/minimatch-2.0.1.tgz" }, "directories": {}, - "_resolved": "https://registry.npmjs.org/minimatch/-/minimatch-1.0.0.tgz", - "readme": "ERROR: No README data found!" + "_resolved": "https://registry.npmjs.org/minimatch/-/minimatch-2.0.1.tgz" } diff --git a/node_modules/bower/node_modules/fstream-ignore/node_modules/minimatch/test/basic.js b/node_modules/bower/node_modules/fstream-ignore/node_modules/minimatch/test/basic.js index ae7ac73..b72edf8 100644 --- a/node_modules/bower/node_modules/fstream-ignore/node_modules/minimatch/test/basic.js +++ b/node_modules/bower/node_modules/fstream-ignore/node_modules/minimatch/test/basic.js @@ -381,7 +381,7 @@ tap.test("basic tests", function (t) { , JSON.stringify(pattern) + " " + JSON.stringify(expect) , tapOpts ) - t.equal(tapOpts.re, expectRe, tapOpts) + t.equal(tapOpts.re, expectRe, null, tapOpts) }) t.comment("time=" + (Date.now() - start) + "ms") diff --git a/node_modules/bower/node_modules/fstream-ignore/node_modules/minimatch/test/brace-expand.js b/node_modules/bower/node_modules/fstream-ignore/node_modules/minimatch/test/brace-expand.js index e63d3f6..67bc913 100644 --- a/node_modules/bower/node_modules/fstream-ignore/node_modules/minimatch/test/brace-expand.js +++ b/node_modules/bower/node_modules/fstream-ignore/node_modules/minimatch/test/brace-expand.js @@ -22,12 +22,17 @@ tap.test("brace expansion", function (t) { , "a5b" ] ] , [ "a{b}c", ["a{b}c"] ] , [ "a{00..05}b" - , ["a00b" - ,"a01b" - ,"a02b" - ,"a03b" - ,"a04b" - ,"a05b" ] ] + , [ "a00b" + , "a01b" + , "a02b" + , "a03b" + , "a04b" + , "a05b" ] ] + , [ "z{a,b},c}d", ["za,c}d", "zb,c}d"] ] + , [ "z{a,b{,c}d", ["z{a,bd", "z{a,bcd"] ] + , [ "a{b{c{d,e}f}g}h", ["a{b{cdf}g}h", "a{b{cef}g}h"] ] + , [ "a{b{c{d,e}f{x,y}}g}h", ["a{b{cdfx}g}h", "a{b{cdfy}g}h", "a{b{cefx}g}h", "a{b{cefy}g}h"] ] + , [ "a{b{c{d,e}f{x,y{}g}h", ["a{b{cdfxh", "a{b{cdfy{}gh", "a{b{cefxh", "a{b{cefy{}gh"] ] ].forEach(function (tc) { var p = tc[0] , expect = tc[1] diff --git a/node_modules/bower/node_modules/fstream-ignore/node_modules/minimatch/test/caching.js b/node_modules/bower/node_modules/fstream-ignore/node_modules/minimatch/test/caching.js deleted file mode 100644 index 0fec4b0..0000000 --- a/node_modules/bower/node_modules/fstream-ignore/node_modules/minimatch/test/caching.js +++ /dev/null @@ -1,14 +0,0 @@ -var Minimatch = require("../minimatch.js").Minimatch -var tap = require("tap") -tap.test("cache test", function (t) { - var mm1 = new Minimatch("a?b") - var mm2 = new Minimatch("a?b") - t.equal(mm1, mm2, "should get the same object") - // the lru should drop it after 100 entries - for (var i = 0; i < 100; i ++) { - new Minimatch("a"+i) - } - mm2 = new Minimatch("a?b") - t.notEqual(mm1, mm2, "cache should have dropped") - t.end() -}) diff --git a/node_modules/bower/node_modules/fstream-ignore/package.json b/node_modules/bower/node_modules/fstream-ignore/package.json index c5f621e..1dc6d95 100644 --- a/node_modules/bower/node_modules/fstream-ignore/package.json +++ b/node_modules/bower/node_modules/fstream-ignore/package.json @@ -6,7 +6,7 @@ }, "name": "fstream-ignore", "description": "A thing for ignoring files based on globs", - "version": "1.0.1", + "version": "1.0.2", "repository": { "type": "git", "url": "git://github.com/isaacs/fstream-ignore.git" @@ -18,7 +18,7 @@ "dependencies": { "fstream": "^1.0.0", "inherits": "2", - "minimatch": "^1.0.0" + "minimatch": "^2.0.1" }, "devDependencies": { "tap": "", @@ -26,15 +26,16 @@ "mkdirp": "" }, "license": "ISC", - "gitHead": "290f2b621fa4f8fe3eec97307d22527fa2065375", + "gitHead": "20363d39660671c0de746bd07a0d07de7090d085", "bugs": { "url": "https://github.com/isaacs/fstream-ignore/issues" }, "homepage": "https://github.com/isaacs/fstream-ignore", - "_id": "fstream-ignore@1.0.1", - "_shasum": "153df36c4fa2cb006fb915dc71ac9d75f6a17c82", - "_from": "fstream-ignore@~1.0.1", - "_npmVersion": "1.4.22", + "_id": "fstream-ignore@1.0.2", + "_shasum": "18c891db01b782a74a7bff936a0f24997741c7ab", + "_from": "fstream-ignore@1.0.2", + "_npmVersion": "2.1.11", + "_nodeVersion": "0.10.16", "_npmUser": { "name": "isaacs", "email": "i@izs.me" @@ -46,9 +47,9 @@ } ], "dist": { - "shasum": "153df36c4fa2cb006fb915dc71ac9d75f6a17c82", - "tarball": "http://registry.npmjs.org/fstream-ignore/-/fstream-ignore-1.0.1.tgz" + "shasum": "18c891db01b782a74a7bff936a0f24997741c7ab", + "tarball": "http://registry.npmjs.org/fstream-ignore/-/fstream-ignore-1.0.2.tgz" }, "directories": {}, - "_resolved": "https://registry.npmjs.org/fstream-ignore/-/fstream-ignore-1.0.1.tgz" + "_resolved": "https://registry.npmjs.org/fstream-ignore/-/fstream-ignore-1.0.2.tgz" } diff --git a/node_modules/bower/node_modules/fstream/examples/filter-pipe.js b/node_modules/bower/node_modules/fstream/examples/filter-pipe.js index c6b55b3..983649b 100644 --- a/node_modules/bower/node_modules/fstream/examples/filter-pipe.js +++ b/node_modules/bower/node_modules/fstream/examples/filter-pipe.js @@ -4,8 +4,8 @@ var path = require("path") var r = fstream.Reader({ path: path.dirname(__dirname) , filter: function () { return !this.basename.match(/^\./) && - !this.basename.match(/^node_modules$/) - !this.basename.match(/^deep-copy$/) + !this.basename.match(/^node_modules$/) && + !this.basename.match(/^deep-copy$/) && !this.basename.match(/^filter-copy$/) } }) diff --git a/node_modules/bower/node_modules/fstream/examples/pipe.js b/node_modules/bower/node_modules/fstream/examples/pipe.js index 648ec84..0bad122 100644 --- a/node_modules/bower/node_modules/fstream/examples/pipe.js +++ b/node_modules/bower/node_modules/fstream/examples/pipe.js @@ -4,7 +4,7 @@ var path = require("path") var r = fstream.Reader({ path: path.dirname(__dirname) , filter: function () { return !this.basename.match(/^\./) && - !this.basename.match(/^node_modules$/) + !this.basename.match(/^node_modules$/) && !this.basename.match(/^deep-copy$/) } }) diff --git a/node_modules/bower/node_modules/fstream/examples/reader.js b/node_modules/bower/node_modules/fstream/examples/reader.js index 9aa1a95..3787ae3 100644 --- a/node_modules/bower/node_modules/fstream/examples/reader.js +++ b/node_modules/bower/node_modules/fstream/examples/reader.js @@ -2,13 +2,12 @@ var fstream = require("../fstream.js") var tap = require("tap") var fs = require("fs") var path = require("path") -var children = -1 var dir = path.dirname(__dirname) -var gotReady = false -var ended = false - tap.test("reader test", function (t) { + var children = -1 + var gotReady = false + var ended = false var r = fstream.Reader({ path: dir , filter: function () { @@ -52,3 +51,18 @@ tap.test("reader test", function (t) { }) }) + +tap.test("reader error test", function (t) { + // assumes non-root on a *nix system + var r = fstream.Reader({ path: '/etc/shadow' }) + + r.once("error", function (er) { + t.ok(true); + t.end() + }) + + r.on("end", function () { + t.fail("reader ended without error"); + t.end() + }) +}) diff --git a/node_modules/bower/node_modules/fstream/lib/file-reader.js b/node_modules/bower/node_modules/fstream/lib/file-reader.js index b1f9861..4720cd8 100644 --- a/node_modules/bower/node_modules/fstream/lib/file-reader.js +++ b/node_modules/bower/node_modules/fstream/lib/file-reader.js @@ -80,6 +80,10 @@ FileReader.prototype._getStream = function () { } }) + stream.on("error", function (e) { + me.emit("error", e); + }); + me._read() } diff --git a/node_modules/bower/node_modules/fstream/lib/writer.js b/node_modules/bower/node_modules/fstream/lib/writer.js index 8b1bbf9..0700813 100644 --- a/node_modules/bower/node_modules/fstream/lib/writer.js +++ b/node_modules/bower/node_modules/fstream/lib/writer.js @@ -195,7 +195,7 @@ function endChmod (me, want, current, path, cb) { function endChown (me, want, current, path, cb) { // Don't even try it unless root. Too easy to EPERM. if (process.platform === "win32") return cb() - if (!process.getuid || !process.getuid() === 0) return cb() + if (!process.getuid || process.getuid() !== 0) return cb() if (typeof want.uid !== "number" && typeof want.gid !== "number" ) return cb() diff --git a/node_modules/bower/node_modules/fstream/package.json b/node_modules/bower/node_modules/fstream/package.json index 3c5aeca..fdd8b69 100644 --- a/node_modules/bower/node_modules/fstream/package.json +++ b/node_modules/bower/node_modules/fstream/package.json @@ -6,7 +6,7 @@ }, "name": "fstream", "description": "Advanced file system stream things", - "version": "1.0.2", + "version": "1.0.4", "repository": { "type": "git", "url": "git://github.com/isaacs/fstream.git" @@ -28,29 +28,34 @@ "test": "tap examples/*.js" }, "license": "BSD", - "gitHead": "b3b74e92ef4a91ae206fab90b7998c7cd2e4290d", + "gitHead": "0bdcf1db6f9b04755b644f8268fc3726875367a6", "bugs": { "url": "https://github.com/isaacs/fstream/issues" }, "homepage": "https://github.com/isaacs/fstream", - "_id": "fstream@1.0.2", - "_shasum": "56930ff1b4d4d7b1a689c8656b3a11e744ab92c6", - "_from": "fstream@~1.0.2", - "_npmVersion": "1.4.23", + "_id": "fstream@1.0.4", + "_shasum": "6c52298473fd6351fd22fc4bf9254fcfebe80f2b", + "_from": "fstream@1.0.4", + "_npmVersion": "2.4.1", + "_nodeVersion": "0.10.35", "_npmUser": { - "name": "isaacs", - "email": "i@izs.me" + "name": "othiym23", + "email": "ogd@aoaioxxysz.net" }, "maintainers": [ { "name": "isaacs", "email": "i@izs.me" + }, + { + "name": "othiym23", + "email": "ogd@aoaioxxysz.net" } ], "dist": { - "shasum": "56930ff1b4d4d7b1a689c8656b3a11e744ab92c6", - "tarball": "http://registry.npmjs.org/fstream/-/fstream-1.0.2.tgz" + "shasum": "6c52298473fd6351fd22fc4bf9254fcfebe80f2b", + "tarball": "http://registry.npmjs.org/fstream/-/fstream-1.0.4.tgz" }, "directories": {}, - "_resolved": "https://registry.npmjs.org/fstream/-/fstream-1.0.2.tgz" + "_resolved": "https://registry.npmjs.org/fstream/-/fstream-1.0.4.tgz" } diff --git a/node_modules/bower/node_modules/glob/package.json b/node_modules/bower/node_modules/glob/package.json index 7a46b96..352c331 100644 --- a/node_modules/bower/node_modules/glob/package.json +++ b/node_modules/bower/node_modules/glob/package.json @@ -38,7 +38,7 @@ "homepage": "https://github.com/isaacs/node-glob", "_id": "glob@4.0.6", "_shasum": "695c50bdd4e2fb5c5d370b091f388d3707e291a7", - "_from": "glob@~4.0.2", + "_from": "glob@4.0.6", "_npmVersion": "2.0.0", "_nodeVersion": "0.10.31", "_npmUser": { @@ -56,5 +56,6 @@ "tarball": "http://registry.npmjs.org/glob/-/glob-4.0.6.tgz" }, "directories": {}, - "_resolved": "https://registry.npmjs.org/glob/-/glob-4.0.6.tgz" + "_resolved": "https://registry.npmjs.org/glob/-/glob-4.0.6.tgz", + "readme": "ERROR: No README data found!" } diff --git a/node_modules/bower/node_modules/graceful-fs/fs.js b/node_modules/bower/node_modules/graceful-fs/fs.js index ae9fd6f..64ad980 100644 --- a/node_modules/bower/node_modules/graceful-fs/fs.js +++ b/node_modules/bower/node_modules/graceful-fs/fs.js @@ -8,4 +8,4 @@ var post = '});' var src = pre + process.binding('natives').fs + post var vm = require('vm') var fn = vm.runInThisContext(src) -return fn(exports, require, module, __filename, __dirname) +fn(exports, require, module, __filename, __dirname) diff --git a/node_modules/bower/node_modules/graceful-fs/package.json b/node_modules/bower/node_modules/graceful-fs/package.json index 45dab90..5388b84 100644 --- a/node_modules/bower/node_modules/graceful-fs/package.json +++ b/node_modules/bower/node_modules/graceful-fs/package.json @@ -6,7 +6,7 @@ }, "name": "graceful-fs", "description": "A drop-in replacement for fs, making various improvements.", - "version": "3.0.4", + "version": "3.0.5", "repository": { "type": "git", "url": "git://github.com/isaacs/node-graceful-fs.git" @@ -43,15 +43,16 @@ "rimraf": "^2.2.8", "tap": "^0.4.13" }, - "gitHead": "d3fd03247ccc4fa8a3eee399307fd266c70efb06", + "gitHead": "a6cd37cff01ac3af8d0ab2fd180290538fabd326", "bugs": { "url": "https://github.com/isaacs/node-graceful-fs/issues" }, "homepage": "https://github.com/isaacs/node-graceful-fs", - "_id": "graceful-fs@3.0.4", - "_shasum": "a0306d9b0940e0fc512d33b5df1014e88e0637a3", - "_from": "graceful-fs@~3.0.1", - "_npmVersion": "1.4.28", + "_id": "graceful-fs@3.0.5", + "_shasum": "4a880474bdeb716fe3278cf29792dec38dfac418", + "_from": "graceful-fs@3.0.5", + "_npmVersion": "2.1.9", + "_nodeVersion": "0.10.16", "_npmUser": { "name": "isaacs", "email": "i@izs.me" @@ -63,8 +64,8 @@ } ], "dist": { - "shasum": "a0306d9b0940e0fc512d33b5df1014e88e0637a3", - "tarball": "http://registry.npmjs.org/graceful-fs/-/graceful-fs-3.0.4.tgz" + "shasum": "4a880474bdeb716fe3278cf29792dec38dfac418", + "tarball": "http://registry.npmjs.org/graceful-fs/-/graceful-fs-3.0.5.tgz" }, - "_resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-3.0.4.tgz" + "_resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-3.0.5.tgz" } diff --git a/node_modules/bower/node_modules/handlebars/node_modules/uglify-js/node_modules/source-map/CHANGELOG.md b/node_modules/bower/node_modules/handlebars/node_modules/uglify-js/node_modules/source-map/CHANGELOG.md index 518bed4..2e7ca5d 100644 --- a/node_modules/bower/node_modules/handlebars/node_modules/uglify-js/node_modules/source-map/CHANGELOG.md +++ b/node_modules/bower/node_modules/handlebars/node_modules/uglify-js/node_modules/source-map/CHANGELOG.md @@ -1,5 +1,26 @@ # Change Log +## 0.1.43 + +* Performance improvements for `SourceMapGenerator` and `SourceNode`. See issue + #148 for some discussion and issues #150, #151, and #152 for implementations. + +## 0.1.42 + +* Fix an issue where `SourceNode`s from different versions of the source-map + library couldn't be used in conjunction with each other. See issue #142. + +## 0.1.41 + +* Fix a bug with getting the source content of relative sources with a "./" + prefix. See issue #145 and [Bug 1090768](bugzil.la/1090768). + +* Add the `SourceMapConsumer.prototype.computeColumnSpans` method to compute the + column span of each mapping. + +* Add the `SourceMapConsumer.prototype.allGeneratedPositionsFor` method to find + all generated positions associated with a given original source and line. + ## 0.1.40 * Performance improvements for parsing source maps in SourceMapConsumer. diff --git a/node_modules/bower/node_modules/handlebars/node_modules/uglify-js/node_modules/source-map/README.md b/node_modules/bower/node_modules/handlebars/node_modules/uglify-js/node_modules/source-map/README.md index 1a1c7d8..59767aa 100644 --- a/node_modules/bower/node_modules/handlebars/node_modules/uglify-js/node_modules/source-map/README.md +++ b/node_modules/bower/node_modules/handlebars/node_modules/uglify-js/node_modules/source-map/README.md @@ -175,6 +175,11 @@ following attributes: * `file`: Optional. The generated filename this source map is associated with. +#### SourceMapConsumer.prototype.computeColumnSpans() + +Compute the last column for each generated mapping. The last column is +inclusive. + #### SourceMapConsumer.prototype.originalPositionFor(generatedPosition) Returns the original source, line, and column information for the generated @@ -216,6 +221,22 @@ and an object is returned with the following properties: * `column`: The column number in the generated source, or null. +#### SourceMapConsumer.prototype.allGeneratedPositionsFor(originalPosition) + +Returns all generated line and column information for the original source +and line provided. The only argument is an object with the following +properties: + +* `source`: The filename of the original source. + +* `line`: The line number in the original source. + +and an array of objects is returned, each with the following properties: + +* `line`: The line number in the generated source, or null. + +* `column`: The column number in the generated source, or null. + #### SourceMapConsumer.prototype.sourceContentFor(source) Returns the original source content for the source provided. The only @@ -253,6 +274,11 @@ You may pass an object with the following properties: * `sourceRoot`: A root for all relative URLs in this source map. +* `skipValidation`: Optional. When `true`, disables validation of mappings as + they are added. This can improve performance but should be used with + discretion, as a last resort. Even then, one should avoid using this flag when + running tests, if possible. + #### SourceMapGenerator.fromSourceMap(sourceMapConsumer) Creates a new SourceMapGenerator based on a SourceMapConsumer diff --git a/node_modules/bower/node_modules/handlebars/node_modules/uglify-js/node_modules/source-map/lib/source-map/base64-vlq.js b/node_modules/bower/node_modules/handlebars/node_modules/uglify-js/node_modules/source-map/lib/source-map/base64-vlq.js index b4ff136..e22dcae 100644 --- a/node_modules/bower/node_modules/handlebars/node_modules/uglify-js/node_modules/source-map/lib/source-map/base64-vlq.js +++ b/node_modules/bower/node_modules/handlebars/node_modules/uglify-js/node_modules/source-map/lib/source-map/base64-vlq.js @@ -66,7 +66,7 @@ define(function (require, exports, module) { /** * Converts from a two-complement value to a value where the sign bit is - * is placed in the least significant bit. For example, as decimals: + * placed in the least significant bit. For example, as decimals: * 1 becomes 2 (10 binary), -1 becomes 3 (11 binary) * 2 becomes 4 (100 binary), -2 becomes 5 (101 binary) */ @@ -78,7 +78,7 @@ define(function (require, exports, module) { /** * Converts to a two-complement value from a value where the sign bit is - * is placed in the least significant bit. For example, as decimals: + * placed in the least significant bit. For example, as decimals: * 2 (10 binary) becomes 1, 3 (11 binary) becomes -1 * 4 (100 binary) becomes 2, 5 (101 binary) becomes -2 */ diff --git a/node_modules/bower/node_modules/handlebars/node_modules/uglify-js/node_modules/source-map/lib/source-map/binary-search.js b/node_modules/bower/node_modules/handlebars/node_modules/uglify-js/node_modules/source-map/lib/source-map/binary-search.js index ff347c6..e085f81 100644 --- a/node_modules/bower/node_modules/handlebars/node_modules/uglify-js/node_modules/source-map/lib/source-map/binary-search.js +++ b/node_modules/bower/node_modules/handlebars/node_modules/uglify-js/node_modules/source-map/lib/source-map/binary-search.js @@ -23,17 +23,17 @@ define(function (require, exports, module) { // // 1. We find the exact element we are looking for. // - // 2. We did not find the exact element, but we can return the next - // closest element that is less than that element. + // 2. We did not find the exact element, but we can return the index of + // the next closest element that is less than that element. // // 3. We did not find the exact element, and there is no next-closest // element which is less than the one we are searching for, so we - // return null. + // return -1. var mid = Math.floor((aHigh - aLow) / 2) + aLow; var cmp = aCompare(aNeedle, aHaystack[mid], true); if (cmp === 0) { // Found the element we are looking for. - return aHaystack[mid]; + return mid; } else if (cmp > 0) { // aHaystack[mid] is greater than our needle. @@ -43,7 +43,7 @@ define(function (require, exports, module) { } // We did not find an exact match, return the next closest one // (termination case 2). - return aHaystack[mid]; + return mid; } else { // aHaystack[mid] is less than our needle. @@ -53,18 +53,16 @@ define(function (require, exports, module) { } // The exact needle element was not found in this haystack. Determine if // we are in termination case (2) or (3) and return the appropriate thing. - return aLow < 0 - ? null - : aHaystack[aLow]; + return aLow < 0 ? -1 : aLow; } } /** * This is an implementation of binary search which will always try and return - * the next lowest value checked if there is no exact hit. This is because - * mappings between original and generated line/col pairs are single points, - * and there is an implicit region between each of them, so a miss just means - * that you aren't on the very start of a region. + * the index of next lowest value checked if there is no exact hit. This is + * because mappings between original and generated line/col pairs are single + * points, and there is an implicit region between each of them, so a miss + * just means that you aren't on the very start of a region. * * @param aNeedle The element you are looking for. * @param aHaystack The array that is being searched. @@ -73,9 +71,10 @@ define(function (require, exports, module) { * than, equal to, or greater than the element, respectively. */ exports.search = function search(aNeedle, aHaystack, aCompare) { - return aHaystack.length > 0 - ? recursiveSearch(-1, aHaystack.length, aNeedle, aHaystack, aCompare) - : null; + if (aHaystack.length === 0) { + return -1; + } + return recursiveSearch(-1, aHaystack.length, aNeedle, aHaystack, aCompare) }; }); diff --git a/node_modules/bower/node_modules/handlebars/node_modules/uglify-js/node_modules/source-map/lib/source-map/mapping-list.js b/node_modules/bower/node_modules/handlebars/node_modules/uglify-js/node_modules/source-map/lib/source-map/mapping-list.js new file mode 100644 index 0000000..2a4eb61 --- /dev/null +++ b/node_modules/bower/node_modules/handlebars/node_modules/uglify-js/node_modules/source-map/lib/source-map/mapping-list.js @@ -0,0 +1,86 @@ +/* -*- Mode: js; js-indent-level: 2; -*- */ +/* + * Copyright 2014 Mozilla Foundation and contributors + * Licensed under the New BSD license. See LICENSE or: + * http://opensource.org/licenses/BSD-3-Clause + */ +if (typeof define !== 'function') { + var define = require('amdefine')(module, require); +} +define(function (require, exports, module) { + + var util = require('./util'); + + /** + * Determine whether mappingB is after mappingA with respect to generated + * position. + */ + function generatedPositionAfter(mappingA, mappingB) { + // Optimized for most common case + var lineA = mappingA.generatedLine; + var lineB = mappingB.generatedLine; + var columnA = mappingA.generatedColumn; + var columnB = mappingB.generatedColumn; + return lineB > lineA || lineB == lineA && columnB >= columnA || + util.compareByGeneratedPositions(mappingA, mappingB) <= 0; + } + + /** + * A data structure to provide a sorted view of accumulated mappings in a + * performance conscious manner. It trades a neglibable overhead in general + * case for a large speedup in case of mappings being added in order. + */ + function MappingList() { + this._array = []; + this._sorted = true; + // Serves as infimum + this._last = {generatedLine: -1, generatedColumn: 0}; + } + + /** + * Iterate through internal items. This method takes the same arguments that + * `Array.prototype.forEach` takes. + * + * NOTE: The order of the mappings is NOT guaranteed. + */ + MappingList.prototype.unsortedForEach = + function MappingList_forEach(aCallback, aThisArg) { + this._array.forEach(aCallback, aThisArg); + }; + + /** + * Add the given source mapping. + * + * @param Object aMapping + */ + MappingList.prototype.add = function MappingList_add(aMapping) { + var mapping; + if (generatedPositionAfter(this._last, aMapping)) { + this._last = aMapping; + this._array.push(aMapping); + } else { + this._sorted = false; + this._array.push(aMapping); + } + }; + + /** + * Returns the flat, sorted array of mappings. The mappings are sorted by + * generated position. + * + * WARNING: This method returns internal data without copying, for + * performance. The return value must NOT be mutated, and should be treated as + * an immutable borrow. If you want to take ownership, you must make your own + * copy. + */ + MappingList.prototype.toArray = function MappingList_toArray() { + if (!this._sorted) { + this._array.sort(util.compareByGeneratedPositions); + this._sorted = true; + } + return this._array; + }; + + exports.MappingList = MappingList; + +}); diff --git a/node_modules/bower/node_modules/handlebars/node_modules/uglify-js/node_modules/source-map/lib/source-map/source-map-consumer.js b/node_modules/bower/node_modules/handlebars/node_modules/uglify-js/node_modules/source-map/lib/source-map/source-map-consumer.js index ea643bf..cfaa299 100644 --- a/node_modules/bower/node_modules/handlebars/node_modules/uglify-js/node_modules/source-map/lib/source-map/source-map-consumer.js +++ b/node_modules/bower/node_modules/handlebars/node_modules/uglify-js/node_modules/source-map/lib/source-map/source-map-consumer.js @@ -66,6 +66,11 @@ define(function (require, exports, module) { throw new Error('Unsupported version: ' + version); } + // Some source maps produce relative source paths like "./foo.js" instead of + // "foo.js". Normalize these first so that future comparisons will succeed. + // See bugzil.la/1090768. + sources = sources.map(util.normalize); + // Pass `true` below to allow duplicate names and sources. While source maps // are intended to be compressed and deduplicated, the TypeScript compiler // sometimes generates source maps with duplicates in them. See Github issue @@ -97,9 +102,8 @@ define(function (require, exports, module) { smc.sourceRoot); smc.file = aSourceMap._file; - smc.__generatedMappings = aSourceMap._mappings.slice() - .sort(util.compareByGeneratedPositions); - smc.__originalMappings = aSourceMap._mappings.slice() + smc.__generatedMappings = aSourceMap._mappings.toArray().slice(); + smc.__originalMappings = aSourceMap._mappings.toArray().slice() .sort(util.compareByOriginalPositions); return smc; @@ -290,6 +294,33 @@ define(function (require, exports, module) { return binarySearch.search(aNeedle, aMappings, aComparator); }; + /** + * Compute the last column for each generated mapping. The last column is + * inclusive. + */ + SourceMapConsumer.prototype.computeColumnSpans = + function SourceMapConsumer_computeColumnSpans() { + for (var index = 0; index < this._generatedMappings.length; ++index) { + var mapping = this._generatedMappings[index]; + + // Mappings do not contain a field for the last generated columnt. We + // can come up with an optimistic estimate, however, by assuming that + // mappings are contiguous (i.e. given two consecutive mappings, the + // first mapping ends where the second one starts). + if (index + 1 < this._generatedMappings.length) { + var nextMapping = this._generatedMappings[index + 1]; + + if (mapping.generatedLine === nextMapping.generatedLine) { + mapping.lastGeneratedColumn = nextMapping.generatedColumn - 1; + continue; + } + } + + // The last mapping for each line spans the entire line. + mapping.lastGeneratedColumn = Infinity; + } + }; + /** * Returns the original source, line, and column information for the generated * source's line and column positions provided. The only argument is an object @@ -312,23 +343,27 @@ define(function (require, exports, module) { generatedColumn: util.getArg(aArgs, 'column') }; - var mapping = this._findMapping(needle, - this._generatedMappings, - "generatedLine", - "generatedColumn", - util.compareByGeneratedPositions); + var index = this._findMapping(needle, + this._generatedMappings, + "generatedLine", + "generatedColumn", + util.compareByGeneratedPositions); - if (mapping && mapping.generatedLine === needle.generatedLine) { - var source = util.getArg(mapping, 'source', null); - if (source != null && this.sourceRoot != null) { - source = util.join(this.sourceRoot, source); + if (index >= 0) { + var mapping = this._generatedMappings[index]; + + if (mapping.generatedLine === needle.generatedLine) { + var source = util.getArg(mapping, 'source', null); + if (source != null && this.sourceRoot != null) { + source = util.join(this.sourceRoot, source); + } + return { + source: source, + line: util.getArg(mapping, 'originalLine', null), + column: util.getArg(mapping, 'originalColumn', null), + name: util.getArg(mapping, 'name', null) + }; } - return { - source: source, - line: util.getArg(mapping, 'originalLine', null), - column: util.getArg(mapping, 'originalColumn', null), - name: util.getArg(mapping, 'name', null) - }; } return { @@ -406,23 +441,80 @@ define(function (require, exports, module) { needle.source = util.relative(this.sourceRoot, needle.source); } - var mapping = this._findMapping(needle, - this._originalMappings, - "originalLine", - "originalColumn", - util.compareByOriginalPositions); + var index = this._findMapping(needle, + this._originalMappings, + "originalLine", + "originalColumn", + util.compareByOriginalPositions); + + if (index >= 0) { + var mapping = this._originalMappings[index]; - if (mapping) { return { line: util.getArg(mapping, 'generatedLine', null), - column: util.getArg(mapping, 'generatedColumn', null) + column: util.getArg(mapping, 'generatedColumn', null), + lastColumn: util.getArg(mapping, 'lastGeneratedColumn', null) }; } return { line: null, - column: null + column: null, + lastColumn: null + }; + }; + + /** + * Returns all generated line and column information for the original source + * and line provided. The only argument is an object with the following + * properties: + * + * - source: The filename of the original source. + * - line: The line number in the original source. + * + * and an array of objects is returned, each with the following properties: + * + * - line: The line number in the generated source, or null. + * - column: The column number in the generated source, or null. + */ + SourceMapConsumer.prototype.allGeneratedPositionsFor = + function SourceMapConsumer_allGeneratedPositionsFor(aArgs) { + // When there is no exact match, SourceMapConsumer.prototype._findMapping + // returns the index of the closest mapping less than the needle. By + // setting needle.originalColumn to Infinity, we thus find the last + // mapping for the given line, provided such a mapping exists. + var needle = { + source: util.getArg(aArgs, 'source'), + originalLine: util.getArg(aArgs, 'line'), + originalColumn: Infinity }; + + if (this.sourceRoot != null) { + needle.source = util.relative(this.sourceRoot, needle.source); + } + + var mappings = []; + + var index = this._findMapping(needle, + this._originalMappings, + "originalLine", + "originalColumn", + util.compareByOriginalPositions); + if (index >= 0) { + var mapping = this._originalMappings[index]; + + while (mapping && mapping.originalLine === needle.originalLine) { + mappings.push({ + line: util.getArg(mapping, 'generatedLine', null), + column: util.getArg(mapping, 'generatedColumn', null), + lastColumn: util.getArg(mapping, 'lastGeneratedColumn', null) + }); + + mapping = this._originalMappings[--index]; + } + } + + return mappings.reverse(); }; SourceMapConsumer.GENERATED_ORDER = 1; diff --git a/node_modules/bower/node_modules/handlebars/node_modules/uglify-js/node_modules/source-map/lib/source-map/source-map-generator.js b/node_modules/bower/node_modules/handlebars/node_modules/uglify-js/node_modules/source-map/lib/source-map/source-map-generator.js index 5387fa1..1ab7a47 100644 --- a/node_modules/bower/node_modules/handlebars/node_modules/uglify-js/node_modules/source-map/lib/source-map/source-map-generator.js +++ b/node_modules/bower/node_modules/handlebars/node_modules/uglify-js/node_modules/source-map/lib/source-map/source-map-generator.js @@ -12,6 +12,7 @@ define(function (require, exports, module) { var base64VLQ = require('./base64-vlq'); var util = require('./util'); var ArraySet = require('./array-set').ArraySet; + var MappingList = require('./mapping-list').MappingList; /** * An instance of the SourceMapGenerator represents a source map which is @@ -27,9 +28,10 @@ define(function (require, exports, module) { } this._file = util.getArg(aArgs, 'file', null); this._sourceRoot = util.getArg(aArgs, 'sourceRoot', null); + this._skipValidation = util.getArg(aArgs, 'skipValidation', false); this._sources = new ArraySet(); this._names = new ArraySet(); - this._mappings = []; + this._mappings = new MappingList(); this._sourcesContents = null; } @@ -99,7 +101,9 @@ define(function (require, exports, module) { var source = util.getArg(aArgs, 'source', null); var name = util.getArg(aArgs, 'name', null); - this._validateMapping(generated, original, source, name); + if (!this._skipValidation) { + this._validateMapping(generated, original, source, name); + } if (source != null && !this._sources.has(source)) { this._sources.add(source); @@ -109,7 +113,7 @@ define(function (require, exports, module) { this._names.add(name); } - this._mappings.push({ + this._mappings.add({ generatedLine: generated.line, generatedColumn: generated.column, originalLine: original != null && original.line, @@ -186,7 +190,7 @@ define(function (require, exports, module) { var newNames = new ArraySet(); // Find mappings for the "sourceFile" - this._mappings.forEach(function (mapping) { + this._mappings.unsortedForEach(function (mapping) { if (mapping.source === sourceFile && mapping.originalLine != null) { // Check if it can be mapped by the source map, then update the mapping. var original = aSourceMapConsumer.originalPositionFor({ @@ -292,15 +296,10 @@ define(function (require, exports, module) { var result = ''; var mapping; - // The mappings must be guaranteed to be in sorted order before we start - // serializing them or else the generated line numbers (which are defined - // via the ';' separators) will be all messed up. Note: it might be more - // performant to maintain the sorting as we insert them, rather than as we - // serialize them, but the big O is the same either way. - this._mappings.sort(util.compareByGeneratedPositions); + var mappings = this._mappings.toArray(); - for (var i = 0, len = this._mappings.length; i < len; i++) { - mapping = this._mappings[i]; + for (var i = 0, len = mappings.length; i < len; i++) { + mapping = mappings[i]; if (mapping.generatedLine !== previousGeneratedLine) { previousGeneratedColumn = 0; @@ -311,7 +310,7 @@ define(function (require, exports, module) { } else { if (i > 0) { - if (!util.compareByGeneratedPositions(mapping, this._mappings[i - 1])) { + if (!util.compareByGeneratedPositions(mapping, mappings[i - 1])) { continue; } result += ','; diff --git a/node_modules/bower/node_modules/handlebars/node_modules/uglify-js/node_modules/source-map/lib/source-map/source-node.js b/node_modules/bower/node_modules/handlebars/node_modules/uglify-js/node_modules/source-map/lib/source-map/source-node.js index baa5f40..9ee90bd 100644 --- a/node_modules/bower/node_modules/handlebars/node_modules/uglify-js/node_modules/source-map/lib/source-map/source-node.js +++ b/node_modules/bower/node_modules/handlebars/node_modules/uglify-js/node_modules/source-map/lib/source-map/source-node.js @@ -16,8 +16,13 @@ define(function (require, exports, module) { // operating systems these days (capturing the result). var REGEX_NEWLINE = /(\r?\n)/; - // Matches a Windows-style newline, or any character. - var REGEX_CHARACTER = /\r\n|[\s\S]/g; + // Newline character code for charCodeAt() comparisons + var NEWLINE_CODE = 10; + + // Private symbol for identifying `SourceNode`s when multiple versions of + // the source-map library are loaded. This MUST NOT CHANGE across + // versions! + var isSourceNode = "$$$isSourceNode$$$"; /** * SourceNodes provide a way to abstract over interpolating/concatenating @@ -38,6 +43,7 @@ define(function (require, exports, module) { this.column = aColumn == null ? null : aColumn; this.source = aSource == null ? null : aSource; this.name = aName == null ? null : aName; + this[isSourceNode] = true; if (aChunks != null) this.add(aChunks); } @@ -168,7 +174,7 @@ define(function (require, exports, module) { this.add(chunk); }, this); } - else if (aChunk instanceof SourceNode || typeof aChunk === "string") { + else if (aChunk[isSourceNode] || typeof aChunk === "string") { if (aChunk) { this.children.push(aChunk); } @@ -193,7 +199,7 @@ define(function (require, exports, module) { this.prepend(aChunk[i]); } } - else if (aChunk instanceof SourceNode || typeof aChunk === "string") { + else if (aChunk[isSourceNode] || typeof aChunk === "string") { this.children.unshift(aChunk); } else { @@ -215,7 +221,7 @@ define(function (require, exports, module) { var chunk; for (var i = 0, len = this.children.length; i < len; i++) { chunk = this.children[i]; - if (chunk instanceof SourceNode) { + if (chunk[isSourceNode]) { chunk.walk(aFn); } else { @@ -260,7 +266,7 @@ define(function (require, exports, module) { */ SourceNode.prototype.replaceRight = function SourceNode_replaceRight(aPattern, aReplacement) { var lastChild = this.children[this.children.length - 1]; - if (lastChild instanceof SourceNode) { + if (lastChild[isSourceNode]) { lastChild.replaceRight(aPattern, aReplacement); } else if (typeof lastChild === 'string') { @@ -293,7 +299,7 @@ define(function (require, exports, module) { SourceNode.prototype.walkSourceContents = function SourceNode_walkSourceContents(aFn) { for (var i = 0, len = this.children.length; i < len; i++) { - if (this.children[i] instanceof SourceNode) { + if (this.children[i][isSourceNode]) { this.children[i].walkSourceContents(aFn); } } @@ -369,12 +375,12 @@ define(function (require, exports, module) { lastOriginalSource = null; sourceMappingActive = false; } - chunk.match(REGEX_CHARACTER).forEach(function (ch, idx, array) { - if (REGEX_NEWLINE.test(ch)) { + for (var idx = 0, length = chunk.length; idx < length; idx++) { + if (chunk.charCodeAt(idx) === NEWLINE_CODE) { generated.line++; generated.column = 0; // Mappings end at eol - if (idx + 1 === array.length) { + if (idx + 1 === length) { lastOriginalSource = null; sourceMappingActive = false; } else if (sourceMappingActive) { @@ -392,9 +398,9 @@ define(function (require, exports, module) { }); } } else { - generated.column += ch.length; + generated.column++; } - }); + } }); this.walkSourceContents(function (sourceFile, sourceContent) { map.setSourceContent(sourceFile, sourceContent); diff --git a/node_modules/bower/node_modules/handlebars/node_modules/uglify-js/node_modules/source-map/package.json b/node_modules/bower/node_modules/handlebars/node_modules/uglify-js/node_modules/source-map/package.json index 3a450fd..7f05a1e 100644 --- a/node_modules/bower/node_modules/handlebars/node_modules/uglify-js/node_modules/source-map/package.json +++ b/node_modules/bower/node_modules/handlebars/node_modules/uglify-js/node_modules/source-map/package.json @@ -1,7 +1,7 @@ { "name": "source-map", "description": "Generates and consumes source maps", - "version": "0.1.40", + "version": "0.1.43", "homepage": "https://github.com/mozilla/source-map", "author": { "name": "Nick Fitzgerald", @@ -107,6 +107,22 @@ { "name": "Chris Montgomery", "email": "christopher.montgomery@dowjones.com" + }, + { + "name": "J. Ryan Stinnett", + "email": "jryans@gmail.com" + }, + { + "name": "Jack Herrington", + "email": "jherrington@walmartlabs.com" + }, + { + "name": "Chris Truter", + "email": "jeffpalentine@gmail.com" + }, + { + "name": "Daniel Espeset", + "email": "daniel@danielespeset.com" } ], "repository": { @@ -139,8 +155,8 @@ "bugs": { "url": "https://github.com/mozilla/source-map/issues" }, - "_id": "source-map@0.1.40", - "_shasum": "7e0ee49ec0452aa9ac2b93ad5ae54ef33e82b37f", + "_id": "source-map@0.1.43", + "_shasum": "c24bc146ca517c1471f5dacbe2571b2b7f9e3346", "_from": "source-map@~0.1.7", "_npmVersion": "1.4.9", "_npmUser": { @@ -162,8 +178,8 @@ } ], "dist": { - "shasum": "7e0ee49ec0452aa9ac2b93ad5ae54ef33e82b37f", - "tarball": "http://registry.npmjs.org/source-map/-/source-map-0.1.40.tgz" + "shasum": "c24bc146ca517c1471f5dacbe2571b2b7f9e3346", + "tarball": "http://registry.npmjs.org/source-map/-/source-map-0.1.43.tgz" }, - "_resolved": "https://registry.npmjs.org/source-map/-/source-map-0.1.40.tgz" + "_resolved": "https://registry.npmjs.org/source-map/-/source-map-0.1.43.tgz" } diff --git a/node_modules/bower/node_modules/handlebars/node_modules/uglify-js/node_modules/source-map/test/source-map/test-binary-search.js b/node_modules/bower/node_modules/handlebars/node_modules/uglify-js/node_modules/source-map/test/source-map/test-binary-search.js index ee30683..f1c9e0f 100644 --- a/node_modules/bower/node_modules/handlebars/node_modules/uglify-js/node_modules/source-map/test/source-map/test-binary-search.js +++ b/node_modules/bower/node_modules/handlebars/node_modules/uglify-js/node_modules/source-map/test/source-map/test-binary-search.js @@ -23,7 +23,7 @@ define(function (require, exports, module) { binarySearch.search(needle, haystack, numberCompare); }); - assert.equal(binarySearch.search(needle, haystack, numberCompare), 20); + assert.equal(haystack[binarySearch.search(needle, haystack, numberCompare)], 20); }; exports['test too low'] = function (assert, util) { @@ -34,21 +34,21 @@ define(function (require, exports, module) { binarySearch.search(needle, haystack, numberCompare); }); - assert.equal(binarySearch.search(needle, haystack, numberCompare), null); + assert.equal(binarySearch.search(needle, haystack, numberCompare), -1); }; exports['test exact search'] = function (assert, util) { var needle = 4; var haystack = [2,4,6,8,10,12,14,16,18,20]; - assert.equal(binarySearch.search(needle, haystack, numberCompare), 4); + assert.equal(haystack[binarySearch.search(needle, haystack, numberCompare)], 4); }; exports['test fuzzy search'] = function (assert, util) { var needle = 19; var haystack = [2,4,6,8,10,12,14,16,18,20]; - assert.equal(binarySearch.search(needle, haystack, numberCompare), 18); + assert.equal(haystack[binarySearch.search(needle, haystack, numberCompare)], 18); }; }); diff --git a/node_modules/bower/node_modules/handlebars/node_modules/uglify-js/node_modules/source-map/test/source-map/test-source-map-consumer.js b/node_modules/bower/node_modules/handlebars/node_modules/uglify-js/node_modules/source-map/test/source-map/test-source-map-consumer.js index a4c6659..c714943 100644 --- a/node_modules/bower/node_modules/handlebars/node_modules/uglify-js/node_modules/source-map/test/source-map/test-source-map-consumer.js +++ b/node_modules/bower/node_modules/handlebars/node_modules/uglify-js/node_modules/source-map/test/source-map/test-source-map-consumer.js @@ -252,6 +252,25 @@ define(function (require, exports, module) { }, Error); }; + exports['test that we can get the original source content with relative source paths'] = function (assert, util) { + var map = new SourceMapConsumer(util.testMapRelativeSources); + var sources = map.sources; + + assert.equal(map.sourceContentFor(sources[0]), ' ONE.foo = function (bar) {\n return baz(bar);\n };'); + assert.equal(map.sourceContentFor(sources[1]), ' TWO.inc = function (n) {\n return n + 1;\n };'); + assert.equal(map.sourceContentFor("one.js"), ' ONE.foo = function (bar) {\n return baz(bar);\n };'); + assert.equal(map.sourceContentFor("two.js"), ' TWO.inc = function (n) {\n return n + 1;\n };'); + assert.throws(function () { + map.sourceContentFor(""); + }, Error); + assert.throws(function () { + map.sourceContentFor("/the/root/three.js"); + }, Error); + assert.throws(function () { + map.sourceContentFor("three.js"); + }, Error); + }; + exports['test sourceRoot + generatedPositionFor'] = function (assert, util) { var map = new SourceMapGenerator({ sourceRoot: 'foo/bar', @@ -290,6 +309,158 @@ define(function (require, exports, module) { assert.equal(pos.column, 2); }; + exports['test allGeneratedPositionsFor'] = function (assert, util) { + var map = new SourceMapGenerator({ + file: 'generated.js' + }); + map.addMapping({ + original: { line: 1, column: 1 }, + generated: { line: 2, column: 2 }, + source: 'foo.coffee' + }); + map.addMapping({ + original: { line: 1, column: 1 }, + generated: { line: 2, column: 2 }, + source: 'bar.coffee' + }); + map.addMapping({ + original: { line: 2, column: 1 }, + generated: { line: 3, column: 2 }, + source: 'bar.coffee' + }); + map.addMapping({ + original: { line: 2, column: 2 }, + generated: { line: 3, column: 3 }, + source: 'bar.coffee' + }); + map.addMapping({ + original: { line: 3, column: 1 }, + generated: { line: 4, column: 2 }, + source: 'bar.coffee' + }); + map = new SourceMapConsumer(map.toString()); + + var mappings = map.allGeneratedPositionsFor({ + line: 2, + source: 'bar.coffee' + }); + + assert.equal(mappings.length, 2); + assert.equal(mappings[0].line, 3); + assert.equal(mappings[0].column, 2); + assert.equal(mappings[1].line, 3); + assert.equal(mappings[1].column, 3); + }; + + exports['test allGeneratedPositionsFor for line with no mappings'] = function (assert, util) { + var map = new SourceMapGenerator({ + file: 'generated.js' + }); + map.addMapping({ + original: { line: 1, column: 1 }, + generated: { line: 2, column: 2 }, + source: 'foo.coffee' + }); + map.addMapping({ + original: { line: 1, column: 1 }, + generated: { line: 2, column: 2 }, + source: 'bar.coffee' + }); + map.addMapping({ + original: { line: 3, column: 1 }, + generated: { line: 4, column: 2 }, + source: 'bar.coffee' + }); + map = new SourceMapConsumer(map.toString()); + + var mappings = map.allGeneratedPositionsFor({ + line: 2, + source: 'bar.coffee' + }); + + assert.equal(mappings.length, 0); + }; + + exports['test allGeneratedPositionsFor source map with no mappings'] = function (assert, util) { + var map = new SourceMapGenerator({ + file: 'generated.js' + }); + map = new SourceMapConsumer(map.toString()); + + var mappings = map.allGeneratedPositionsFor({ + line: 2, + source: 'bar.coffee' + }); + + assert.equal(mappings.length, 0); + }; + + exports['test computeColumnSpans'] = function (assert, util) { + var map = new SourceMapGenerator({ + file: 'generated.js' + }); + map.addMapping({ + original: { line: 1, column: 1 }, + generated: { line: 1, column: 1 }, + source: 'foo.coffee' + }); + map.addMapping({ + original: { line: 2, column: 1 }, + generated: { line: 2, column: 1 }, + source: 'foo.coffee' + }); + map.addMapping({ + original: { line: 2, column: 2 }, + generated: { line: 2, column: 10 }, + source: 'foo.coffee' + }); + map.addMapping({ + original: { line: 2, column: 3 }, + generated: { line: 2, column: 20 }, + source: 'foo.coffee' + }); + map.addMapping({ + original: { line: 3, column: 1 }, + generated: { line: 3, column: 1 }, + source: 'foo.coffee' + }); + map.addMapping({ + original: { line: 3, column: 2 }, + generated: { line: 3, column: 2 }, + source: 'foo.coffee' + }); + map = new SourceMapConsumer(map.toString()); + + map.computeColumnSpans(); + + var mappings = map.allGeneratedPositionsFor({ + line: 1, + source: 'foo.coffee' + }); + + assert.equal(mappings.length, 1); + assert.equal(mappings[0].lastColumn, Infinity); + + var mappings = map.allGeneratedPositionsFor({ + line: 2, + source: 'foo.coffee' + }); + + assert.equal(mappings.length, 3); + assert.equal(mappings[0].lastColumn, 9); + assert.equal(mappings[1].lastColumn, 19); + assert.equal(mappings[2].lastColumn, Infinity); + + var mappings = map.allGeneratedPositionsFor({ + line: 3, + source: 'foo.coffee' + }); + + assert.equal(mappings.length, 2); + assert.equal(mappings[0].lastColumn, 1); + assert.equal(mappings[1].lastColumn, Infinity); + }; + exports['test sourceRoot + originalPositionFor'] = function (assert, util) { var map = new SourceMapGenerator({ sourceRoot: 'foo/bar', diff --git a/node_modules/bower/node_modules/handlebars/node_modules/uglify-js/node_modules/source-map/test/source-map/test-source-map-generator.js b/node_modules/bower/node_modules/handlebars/node_modules/uglify-js/node_modules/source-map/test/source-map/test-source-map-generator.js index a0d9d00..d748bb1 100644 --- a/node_modules/bower/node_modules/handlebars/node_modules/uglify-js/node_modules/source-map/test/source-map/test-source-map-generator.js +++ b/node_modules/bower/node_modules/handlebars/node_modules/uglify-js/node_modules/source-map/test/source-map/test-source-map-generator.js @@ -98,6 +98,27 @@ define(function (require, exports, module) { }); }; + exports['test adding mappings with skipValidation'] = function (assert, util) { + var map = new SourceMapGenerator({ + file: 'generated-foo.js', + sourceRoot: '.', + skipValidation: true + }); + + // Not enough info, caught by `util.getArgs` + assert.throws(function () { + map.addMapping({}); + }); + + // Original file position, but no source. Not checked. + assert.doesNotThrow(function () { + map.addMapping({ + generated: { line: 1, column: 1 }, + original: { line: 1, column: 1 } + }); + }); + }; + exports['test that the correct mappings are being generated'] = function (assert, util) { var map = new SourceMapGenerator({ file: 'min.js', diff --git a/node_modules/bower/node_modules/handlebars/node_modules/uglify-js/node_modules/source-map/test/source-map/util.js b/node_modules/bower/node_modules/handlebars/node_modules/uglify-js/node_modules/source-map/test/source-map/util.js index fa213ce..56bbe2c 100644 --- a/node_modules/bower/node_modules/handlebars/node_modules/uglify-js/node_modules/source-map/test/source-map/util.js +++ b/node_modules/bower/node_modules/handlebars/node_modules/uglify-js/node_modules/source-map/test/source-map/util.js @@ -71,6 +71,22 @@ define(function (require, exports, module) { sourceRoot: '/the/root', mappings: 'CAAC,IAAI,IAAM,SAAUA,GAClB,OAAOC,IAAID;CCDb,IAAI,IAAM,SAAUE,GAClB,OAAOA' }; + exports.testMapRelativeSources = { + version: 3, + file: 'min.js', + names: ['bar', 'baz', 'n'], + sources: ['./one.js', './two.js'], + sourcesContent: [ + ' ONE.foo = function (bar) {\n' + + ' return baz(bar);\n' + + ' };', + ' TWO.inc = function (n) {\n' + + ' return n + 1;\n' + + ' };' + ], + sourceRoot: '/the/root', + mappings: 'CAAC,IAAI,IAAM,SAAUA,GAClB,OAAOC,IAAID;CCDb,IAAI,IAAM,SAAUE,GAClB,OAAOA' + }; exports.emptyMap = { version: 3, file: 'min.js', diff --git a/node_modules/bower/node_modules/handlebars/package.json b/node_modules/bower/node_modules/handlebars/package.json index eeee8af..7c2964b 100644 --- a/node_modules/bower/node_modules/handlebars/package.json +++ b/node_modules/bower/node_modules/handlebars/package.json @@ -67,7 +67,7 @@ }, "_id": "handlebars@2.0.0", "_shasum": "6e9d7f8514a3467fa5e9f82cc158ecfc1d5ac76f", - "_from": "handlebars@~2.0.0", + "_from": "handlebars@2.0.0", "_npmVersion": "1.4.21", "_npmUser": { "name": "kpdecker", @@ -84,5 +84,6 @@ "tarball": "http://registry.npmjs.org/handlebars/-/handlebars-2.0.0.tgz" }, "directories": {}, - "_resolved": "https://registry.npmjs.org/handlebars/-/handlebars-2.0.0.tgz" + "_resolved": "https://registry.npmjs.org/handlebars/-/handlebars-2.0.0.tgz", + "readme": "ERROR: No README data found!" } diff --git a/node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/.lint b/node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/.lint index 937504b..d1da610 100644 --- a/node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/.lint +++ b/node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/.lint @@ -8,10 +8,16 @@ tabs ass continue +forin nomen plusplus +vars ./global.js +./function/_define-length.js +./function/#/copy.js +./object/unserialize.js +./test/function/valid-function.js evil ./math/_pack-ieee754.js @@ -22,18 +28,11 @@ evil ./string/#/at.js bitwise -./function/_define-length.js -./function/#/copy.js -evil - ./math/fround/shim.js predef+ Float32Array ./object/first-key.js forin -./test/function/valid-function.js -evil - ./test/reg-exp/#/index.js predef+ __dirname diff --git a/node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/.travis.yml b/node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/.travis.yml index 3dcd872..b98b5a8 100644 --- a/node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/.travis.yml +++ b/node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/.travis.yml @@ -10,3 +10,5 @@ before_install: notifications: email: - medikoo+es5-ext@medikoo.com + +script: "npm test && npm run lint" diff --git a/node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/CHANGES b/node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/CHANGES index d21f59a..e72d34a 100644 --- a/node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/CHANGES +++ b/node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/CHANGES @@ -1,3 +1,17 @@ +v0.10.6 -- 2015.02.02 +* Fix handling of infinite values in Math.trunc +* Fix handling of getters in Object.normalizeOptions + +v0.10.5 -- 2015.01.20 +* Add Function#toStringTokens +* Add Object.serialize and Object.unserialize +* Add String.randomUniq +* Fix Strin#camelToHyphen issue with tokens that end with digit +* Optimise Number.isInteger logic +* Improve documentation +* Configure lint scripts +* Fix spelling of LICENSE + v0.10.4 -- 2014.04.30 * Assure maximum spec compliance of Array.of and Array.from (thanks @mathiasbynens) * Improve documentations diff --git a/node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/node_modules/es6-iterator/LICENCE b/node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/LICENSE similarity index 94% rename from node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/node_modules/es6-iterator/LICENCE rename to node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/LICENSE index aaf3528..de39071 100644 --- a/node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/node_modules/es6-iterator/LICENCE +++ b/node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/LICENSE @@ -1,4 +1,4 @@ -Copyright (C) 2013 Mariusz Nowak (www.medikoo.com) +Copyright (C) 2011-2015 Mariusz Nowak (www.medikoo.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 diff --git a/node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/README.md b/node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/README.md index 0341c33..11d8a34 100644 --- a/node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/README.md +++ b/node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/README.md @@ -114,9 +114,12 @@ Object.defineProperty(String.prototype, 'capitalize', { value: require('es5-ext/ configurable: true, enumerable: false, writable: true }); ``` -If you decide not to extend native prototypes, which in most cases is right decision (see -[extending-javascript-natives](http://javascriptweblog.wordpress.com/2011/12/05/extending-javascript-natives/) -for more views on that matter), you can use methods indirectly: +See [es5-extend](https://github.com/wookieb/es5-extend#es5-extend), a great utility that automatically will extend natives for you. + +__Important:__ Remember to __not__ extend natives in scope of generic reusable packages (e.g. ones you intend to publish to npm). Extending natives is fine __only__ if you're the _owner_ of the global scope, so e.g. in final project you lead development of. + +When you're in situation when native extensions are not good idea, then you should use methods indirectly: + ```javascript var flatten = require('es5-ext/array/#/flatten'); @@ -124,7 +127,7 @@ var flatten = require('es5-ext/array/#/flatten'); flatten.call([1, [2, [3, 4]]]); // [1, 2, 3, 4] ``` -or for better convenience turn methods into functions: +for better convenience you can turn methods into functions: ```javascript @@ -506,6 +509,10 @@ Returns a function that applies underlying function with first list argument _f.match()(args) =def f.apply(null, args)_ +#### fn.toStringTokens() _(es5-ext/function/#/to-string-tokens)_ + +Serializes function into two (arguments and body) string tokens. Result is plain object with `args` and `body` properties. + ### Math extensions #### acosh(x) _(es5-ext/math/acosh)_ @@ -754,17 +761,17 @@ Analogous to Array.prototype.map. Creates a new object with properties which val Create new object with same values, but remapped keys -#### mixin(target, source) +#### mixin(target, source) _(es5-ext/object/mixin)_ Extend _target_ by all own properties of other objects. Properties found in both objects will be overwritten (unless they're not configurable and cannot be overwritten). _It was for a moment part of ECMAScript 6 draft._ -#### mixinPrototypes(target, …source]) +#### mixinPrototypes(target, …source]) _(es5-ext/object/mixin-prototypes)_ Extends _target_, with all source and source's prototype properties. Useful as an alternative for `setPrototypeOf` in environments in which it cannot be shimmed (no `__proto__` support). -#### normalizeOptions(options) +#### normalizeOptions(options) _(es5-ext/object/normalize-options)_ Normalizes options object into flat plain object. @@ -774,14 +781,18 @@ Useful for functions in which we either need to keep options object for future r - `options` can be undefined in such case empty plain object is returned. - Copies all enumerable properties found down prototype chain. -#### primitiveSet([…names]) +#### primitiveSet([…names]) _(es5-ext/object/primitive-set)_ Creates `null` prototype based plain object, and sets on it all property names provided in arguments to true. -#### safeTraverse(obj[, …names]) +#### safeTraverse(obj[, …names]) _(es5-ext/object/safe-traverse)_ Safe navigation of object properties. See http://wiki.ecmascript.org/doku.php?id=strawman:existential_operator +#### serialize(value) _(es5-ext/object/serialize)_ + +Serialize value into string. Differs from [JSON.stringify](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/stringify) that it serializes also dates, functions and regular expresssions. + #### setPrototypeOf(object, proto) _(es5-ext/object/set-prototype-of)_ [_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-object.setprototypeof). @@ -798,6 +809,10 @@ Optionally _compareFn_ can be provided which assures that keys are tested in giv Creates an array of results of calling a provided function on every key-value pair in this object. Optionally _compareFn_ can be provided which assures that results are added in given order. If provided _compareFn_ is equal to `true`, then order is alphabetical (by key). +#### unserialize(str) _(es5-ext/object/unserialize)_ + +Userializes value previously serialized with [serialize](#serializevalue-es5-extobjectserialize) + #### validCallable(x) _(es5-ext/object/valid-callable)_ If given object is not callable throw TypeError in other case return it. @@ -878,6 +893,10 @@ Creates format method. It's used e.g. to create `Date.prototype.format` method Whether object is string +#### randomUniq() _(es5-ext/string/random-uniq)_ + +Returns randomly generated id, with guarantee of local uniqueness (no same id will be returned twice) + #### raw(callSite[, …substitutions]) _(es5-ext/string/raw)_ [_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-string.raw) diff --git a/node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/array/#/e-index-of.js b/node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/array/#/e-index-of.js index a7b1dda..80864d0 100644 --- a/node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/array/#/e-index-of.js +++ b/node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/array/#/e-index-of.js @@ -9,7 +9,7 @@ var toPosInt = require('../../number/to-pos-integer') module.exports = function (searchElement/*, fromIndex*/) { var i, l, fromIndex, val; - if (searchElement === searchElement) { //jslint: skip + if (searchElement === searchElement) { //jslint: ignore return indexOf.apply(this, arguments); } @@ -22,7 +22,7 @@ module.exports = function (searchElement/*, fromIndex*/) { for (i = fromIndex; i < l; ++i) { if (hasOwnProperty.call(this, i)) { val = this[i]; - if (val !== val) return i; //jslint: skip + if (val !== val) return i; //jslint: ignore } } return -1; diff --git a/node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/array/#/e-last-index-of.js b/node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/array/#/e-last-index-of.js index dfaf495..4fc536b 100644 --- a/node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/array/#/e-last-index-of.js +++ b/node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/array/#/e-last-index-of.js @@ -9,7 +9,7 @@ var toPosInt = require('../../number/to-pos-integer') module.exports = function (searchElement/*, fromIndex*/) { var i, fromIndex, val; - if (searchElement === searchElement) { //jslint: skip + if (searchElement === searchElement) { //jslint: ignore return lastIndexOf.apply(this, arguments); } @@ -22,7 +22,7 @@ module.exports = function (searchElement/*, fromIndex*/) { for (i = fromIndex; i >= 0; --i) { if (hasOwnProperty.call(this, i)) { val = this[i]; - if (val !== val) return i; //jslint: skip + if (val !== val) return i; //jslint: ignore } } return -1; diff --git a/node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/array/from/shim.js b/node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/array/from/shim.js index 58db5de..a90ba2f 100644 --- a/node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/array/from/shim.js +++ b/node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/array/from/shim.js @@ -14,7 +14,7 @@ var iteratorSymbol = require('es6-symbol').iterator module.exports = function (arrayLike/*, mapFn, thisArg*/) { var mapFn = arguments[1], thisArg = arguments[2], Constructor, i, j, arr, l, code, iterator - , result, getIterator, isPlain, value; + , result, getIterator, value; arrayLike = Object(validValue(arrayLike)); @@ -53,7 +53,7 @@ module.exports = function (arrayLike/*, mapFn, thisArg*/) { while (!result.done) { value = mapFn ? call.call(mapFn, thisArg, result.value, i) : result.value; if (!Constructor) { - arr[i] = value + arr[i] = value; } else { desc.value = value; defineProperty(arr, i, desc); @@ -74,7 +74,7 @@ module.exports = function (arrayLike/*, mapFn, thisArg*/) { } value = mapFn ? call.call(mapFn, thisArg, value, j) : value; if (!Constructor) { - arr[j] = value + arr[j] = value; } else { desc.value = value; defineProperty(arr, j, desc); @@ -91,7 +91,7 @@ module.exports = function (arrayLike/*, mapFn, thisArg*/) { for (i = 0; i < l; ++i) { value = mapFn ? call.call(mapFn, thisArg, arrayLike[i], i) : arrayLike[i]; if (!Constructor) { - arr[i] = value + arr[i] = value; } else { desc.value = value; defineProperty(arr, i, desc); diff --git a/node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/function/#/index.js b/node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/function/#/index.js index cbf383d..8d0da00 100644 --- a/node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/function/#/index.js +++ b/node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/function/#/index.js @@ -1,11 +1,12 @@ 'use strict'; module.exports = { - compose: require('./compose'), - copy: require('./copy'), - curry: require('./curry'), - lock: require('./lock'), - not: require('./not'), - partial: require('./partial'), - spread: require('./spread') + compose: require('./compose'), + copy: require('./copy'), + curry: require('./curry'), + lock: require('./lock'), + not: require('./not'), + partial: require('./partial'), + spread: require('./spread'), + toStringTokens: require('./to-string-tokens') }; diff --git a/node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/function/#/to-string-tokens.js b/node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/function/#/to-string-tokens.js new file mode 100644 index 0000000..67afeae --- /dev/null +++ b/node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/function/#/to-string-tokens.js @@ -0,0 +1,11 @@ +'use strict'; + +var validFunction = require('../valid-function') + + , re = new RegExp('^\\s*function[\\0-\'\\)-\\uffff]*' + + '\\(([\\0-\\(\\*-\\uffff]*)\\)\\s*\\{([\\0-\\uffff]*)\\}\\s*$'); + +module.exports = function () { + var data = String(validFunction(this)).match(re); + return { args: data[1], body: data[2] }; +}; diff --git a/node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/math/trunc/shim.js b/node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/math/trunc/shim.js index 5182428..02e2c2a 100644 --- a/node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/math/trunc/shim.js +++ b/node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/math/trunc/shim.js @@ -6,8 +6,8 @@ module.exports = function (x) { if (isNaN(x)) return NaN; x = Number(x); if (x === 0) return x; - if (x === Infinity) return 1; - if (x === -Infinity) return -1; + if (x === Infinity) return Infinity; + if (x === -Infinity) return -Infinity; if (x > 0) return floor(x); return -floor(-x); }; diff --git a/node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/node_modules/es6-iterator/.travis.yml b/node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/node_modules/es6-iterator/.travis.yml index eab5f5d..02c277c 100644 --- a/node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/node_modules/es6-iterator/.travis.yml +++ b/node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/node_modules/es6-iterator/.travis.yml @@ -7,3 +7,5 @@ node_js: notifications: email: - medikoo+es6-iterator@medikoo.com + +script: "npm test && npm run lint" diff --git a/node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/node_modules/es6-iterator/CHANGES b/node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/node_modules/es6-iterator/CHANGES index 473a66d..a2d1ec7 100644 --- a/node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/node_modules/es6-iterator/CHANGES +++ b/node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/node_modules/es6-iterator/CHANGES @@ -1,4 +1,14 @@ -v0.1.1 -- 2014.04.29 +v0.1.3 -- 2015.02.02 +* Update dependencies +* Fix spelling of LICENSE + +v0.1.2 -- 2014.11.19 +* Optimise internal `_next` to not verify internal's list length at all times + (#2 thanks @RReverser) +* Fix documentation examples +* Configure lint scripts + +v0.1.1 -- 2014.04.29 * Fix es6-symbol dependency version v0.1.0 -- 2014.04.29 diff --git a/node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/node_modules/es6-symbol/LICENCE b/node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/node_modules/es6-iterator/LICENSE similarity index 94% rename from node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/node_modules/es6-symbol/LICENCE rename to node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/node_modules/es6-iterator/LICENSE index aaf3528..04724a3 100644 --- a/node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/node_modules/es6-symbol/LICENCE +++ b/node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/node_modules/es6-iterator/LICENSE @@ -1,4 +1,4 @@ -Copyright (C) 2013 Mariusz Nowak (www.medikoo.com) +Copyright (C) 2013-2015 Mariusz Nowak (www.medikoo.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 diff --git a/node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/node_modules/es6-iterator/README.md b/node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/node_modules/es6-iterator/README.md index f1218a1..288373d 100644 --- a/node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/node_modules/es6-iterator/README.md +++ b/node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/node_modules/es6-iterator/README.md @@ -25,7 +25,7 @@ var iterator = new Iterator([1, 2, 3]); iterator.next(); // { value: 1, done: false } iterator.next(); // { value: 2, done: false } -iterator.next(); // { value: 3, done: true } +iterator.next(); // { value: 3, done: false } iterator.next(); // { value: undefined, done: true } ``` @@ -44,7 +44,7 @@ var iterator = new ArrayIterator([1, 2, 3], 'key+value'); iterator.next(); // { value: [0, 1], done: false } iterator.next(); // { value: [1, 2], done: false } -iterator.next(); // { value: [2, 3], done: true } +iterator.next(); // { value: [2, 3], done: false } iterator.next(); // { value: undefined, done: true } ``` @@ -56,7 +56,7 @@ May also be used for _arguments_ objects: iterator.next(); // { value: 1, done: false } iterator.next(); // { value: 2, done: false } - iterator.next(); // { value: 3, done: true } + iterator.next(); // { value: 3, done: false } iterator.next(); // { value: undefined, done: true } }(1, 2, 3)); ``` @@ -75,7 +75,7 @@ iterator.next(); // { value: '🙈', done: false } iterator.next(); // { value: 'o', done: false } iterator.next(); // { value: '🙉', done: false } iterator.next(); // { value: 'o', done: false } -iterator.next(); // { value: '🙊', done: true } +iterator.next(); // { value: '🙊', done: false } iterator.next(); // { value: undefined, done: true } ``` @@ -115,7 +115,7 @@ var iterator = get([1,2,3]); iterator.next(); // { value: 1, done: false } iterator.next(); // { value: 2, done: false } -iterator.next(); // { value: 3, done: true } +iterator.next(); // { value: 3, done: false } iterator.next(); // { value: undefined, done: true } ``` diff --git a/node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/node_modules/es6-iterator/index.js b/node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/node_modules/es6-iterator/index.js index d33910d..10fd089 100644 --- a/node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/node_modules/es6-iterator/index.js +++ b/node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/node_modules/es6-iterator/index.js @@ -1,7 +1,6 @@ 'use strict'; var clear = require('es5-ext/array/#/clear') - , toPosInt = require('es5-ext/number/to-pos-integer') , assign = require('es5-ext/object/assign') , callable = require('es5-ext/object/valid-callable') , value = require('es5-ext/object/valid-value') @@ -30,14 +29,13 @@ module.exports = Iterator = function (list, context) { defineProperties(Iterator.prototype, assign({ constructor: d(Iterator), _next: d(function () { - var i, l; + var i; if (!this.__list__) return; if (this.__redo__) { i = this.__redo__.shift(); if (i !== undefined) return i; } - l = toPosInt(this.__list__.length); - if (this.__nextIndex__ < l) return this.__nextIndex__++; + if (this.__nextIndex__ < this.__list__.length) return this.__nextIndex__++; this._unBind(); }), next: d(function () { return this._createResult(this._next()); }), diff --git a/node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/node_modules/es6-iterator/package.json b/node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/node_modules/es6-iterator/package.json index e81aedc..eebf8e1 100644 --- a/node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/node_modules/es6-iterator/package.json +++ b/node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/node_modules/es6-iterator/package.json @@ -1,6 +1,6 @@ { "name": "es6-iterator", - "version": "0.1.1", + "version": "0.1.3", "description": "Iterator abstraction based on ES6 specification", "author": { "name": "Mariusz Nowak", @@ -21,28 +21,31 @@ }, "dependencies": { "d": "~0.1.1", - "es5-ext": "~0.10.2", - "es6-symbol": "0.1.x" + "es5-ext": "~0.10.5", + "es6-symbol": "~2.0.1" }, "devDependencies": { - "event-emitter": "~0.3.1", - "tad": "0.2.x" + "event-emitter": "~0.3.3", + "tad": "~0.2.1", + "xlint": "~0.2.2", + "xlint-jslint-medikoo": "~0.1.2" }, "scripts": { + "lint": "node node_modules/xlint/bin/xlint --linter=node_modules/xlint-jslint-medikoo/index.js --no-cache --no-stream", + "lint-console": "node node_modules/xlint/bin/xlint --linter=node_modules/xlint-jslint-medikoo/index.js --watch", "test": "node ./node_modules/tad/bin/tad" }, "license": "MIT", + "gitHead": "2addc362c6f139e4941cf4726eeb59e5960c5cef", "bugs": { "url": "https://github.com/medikoo/es6-iterator/issues" }, "homepage": "https://github.com/medikoo/es6-iterator", - "_id": "es6-iterator@0.1.1", - "dist": { - "shasum": "5e136c899aa1c26296414f90859b73934812d275", - "tarball": "http://registry.npmjs.org/es6-iterator/-/es6-iterator-0.1.1.tgz" - }, - "_from": "es6-iterator@~0.1.1", - "_npmVersion": "1.4.3", + "_id": "es6-iterator@0.1.3", + "_shasum": "d6f58b8c4fc413c249b4baa19768f8e4d7c8944e", + "_from": "es6-iterator@~0.1.3", + "_npmVersion": "2.3.0", + "_nodeVersion": "0.11.16", "_npmUser": { "name": "medikoo", "email": "medikoo+npm@medikoo.com" @@ -53,8 +56,11 @@ "email": "medikoo+npm@medikoo.com" } ], + "dist": { + "shasum": "d6f58b8c4fc413c249b4baa19768f8e4d7c8944e", + "tarball": "http://registry.npmjs.org/es6-iterator/-/es6-iterator-0.1.3.tgz" + }, "directories": {}, - "_shasum": "5e136c899aa1c26296414f90859b73934812d275", - "_resolved": "https://registry.npmjs.org/es6-iterator/-/es6-iterator-0.1.1.tgz", + "_resolved": "https://registry.npmjs.org/es6-iterator/-/es6-iterator-0.1.3.tgz", "readme": "ERROR: No README data found!" } diff --git a/node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/node_modules/es6-iterator/test/array.js b/node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/node_modules/es6-iterator/test/array.js index 21a6751..ae7c219 100644 --- a/node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/node_modules/es6-iterator/test/array.js +++ b/node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/node_modules/es6-iterator/test/array.js @@ -4,7 +4,7 @@ var iteratorSymbol = require('es6-symbol').iterator; module.exports = function (T) { return { - "Values": function (a) { + Values: function (a) { var x = ['raz', 'dwa', 'trzy', 'cztery', 'pięć', 'sześć'], it; it = new T(x); @@ -34,7 +34,7 @@ module.exports = function (T) { a.deep(it.next(), { done: false, value: [5, 'pięć'] }, "#5"); a.deep(it.next(), { done: true, value: undefined }, "End"); }, - "Keys": function (a) { + Keys: function (a) { var x = ['raz', 'dwa', 'trzy', 'cztery', 'pięć', 'sześć'], it; it = new T(x, 'key'); @@ -49,7 +49,7 @@ module.exports = function (T) { a.deep(it.next(), { done: false, value: 5 }, "#5"); a.deep(it.next(), { done: true, value: undefined }, "End"); }, - "Sparse": function (a) { + Sparse: function (a) { var x = new Array(6), it; x[2] = 'raz'; diff --git a/node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/node_modules/es6-iterator/test/index.js b/node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/node_modules/es6-iterator/test/index.js index 1e2d1cf..ea3621a 100644 --- a/node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/node_modules/es6-iterator/test/index.js +++ b/node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/node_modules/es6-iterator/test/index.js @@ -21,7 +21,7 @@ module.exports = function (T) { a.deep(y = it.next(), { done: true, value: undefined }, "End"); a.not(y, it.next(), "Recreate result on dead"); }, - "Emited": function (a) { + Emited: function (a) { var x = ['raz', 'dwa', 'trzy', 'cztery', 'pięć'], y, it; y = ee(); diff --git a/node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/node_modules/es6-symbol/.lint b/node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/node_modules/es6-symbol/.lint index 701a50c..1851752 100644 --- a/node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/node_modules/es6-symbol/.lint +++ b/node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/node_modules/es6-symbol/.lint @@ -4,10 +4,10 @@ module tabs indent 2 -maxlen 80 +maxlen 100 ass nomen plusplus - newcap +vars diff --git a/node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/node_modules/es6-symbol/CHANGES b/node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/node_modules/es6-symbol/CHANGES index ff5e1b4..df8c27e 100644 --- a/node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/node_modules/es6-symbol/CHANGES +++ b/node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/node_modules/es6-symbol/CHANGES @@ -1,3 +1,25 @@ +v2.0.1 -- 2015.01.28 +* Fix Symbol.prototype[Symbol.isPrimitive] implementation +* Improve validation within Symbol.prototype.toString and + Symbol.prototype.valueOf + +v2.0.0 -- 2015.01.28 +* Update up to changes in specification: + * Implement `for` and `keyFor` + * Remove `Symbol.create` and `Symbol.isRegExp` + * Add `Symbol.match`, `Symbol.replace`, `Symbol.search`, `Symbol.species` and + `Symbol.split` +* Rename `validSymbol` to `validateSymbol` +* Improve documentation +* Remove dead test modules + +v1.0.0 -- 2015.01.26 +* Fix enumerability for symbol properties set normally (e.g. obj[symbol] = value) +* Introduce initialization via hidden constructor +* Fix isSymbol handling of polyfill values when native Symbol is present +* Fix spelling of LICENSE +* Configure lint scripts + v0.1.1 -- 2014.10.07 * Fix isImplemented, so it returns true in case of polyfill * Improve documentations diff --git a/node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/LICENCE b/node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/node_modules/es6-symbol/LICENSE similarity index 94% rename from node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/LICENCE rename to node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/node_modules/es6-symbol/LICENSE index 7b61dc1..04724a3 100644 --- a/node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/LICENCE +++ b/node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/node_modules/es6-symbol/LICENSE @@ -1,4 +1,4 @@ -Copyright (C) 2011 Mariusz Nowak (www.medikoo.com) +Copyright (C) 2013-2015 Mariusz Nowak (www.medikoo.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 diff --git a/node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/node_modules/es6-symbol/README.md b/node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/node_modules/es6-symbol/README.md index 978eb59..95d6780 100644 --- a/node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/node_modules/es6-symbol/README.md +++ b/node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/node_modules/es6-symbol/README.md @@ -1,23 +1,27 @@ # es6-symbol -## ECMAScript6 Symbol polyfill +## ECMAScript 6 Symbol polyfill + +For more information about symbols see following links +- [Symbols in ECMAScript 6 by Axel Rauschmayer](http://www.2ality.com/2014/12/es6-symbols.html) +- [MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Symbol) +- [Specification](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-symbol-constructor) ### Limitations -- Underneath it uses real string property names which can easily be retrieved (however accidental collision with other property names is unlikely) -- As it needs custom `toString` behavior to work properly. Original `Symbol.prototype.toString` couldn't be implemented as specified, still it's accessible as `Symbol.prototoype.properToString` +Underneath it uses real string property names which can easily be retrieved, however accidental collision with other property names is unlikely. ### Usage -If you want to make sure your environment implements `Symbol`, do: +If you'd like to use native version when it exists and fallback to polyfill if it doesn't (but without implementing `Symbol` on global scope), do: ```javascript -require('es6-symbol/implement'); +var Symbol = require('es6-symbol'); ``` -If you'd like to use native version when it exists and fallback to polyfill if it doesn't, but without implementing `Symbol` on global scope, do: +If you want to make sure your environment implements `Symbol`, do: ```javascript -var Symbol = require('es6-symbol'); +require('es6-symbol/implement'); ``` If you strictly want to use polyfill even if native `Symbol` exists (hard to find a good reason for that), do: @@ -60,7 +64,7 @@ In your project path: ##### Browser -You can easily bundle _es6-symbol_ for browser with [modules-webmake](https://github.com/medikoo/modules-webmake) +To port it to Browser or any other (non CJS) environment, use your favorite CJS bundler. No favorite yet? Try: [Browserify](http://browserify.org/), [Webmake](https://github.com/medikoo/modules-webmake) or [Webpack](http://webpack.github.io/) ## Tests [![Build Status](https://travis-ci.org/medikoo/es6-symbol.png)](https://travis-ci.org/medikoo/es6-symbol) diff --git a/node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/node_modules/es6-symbol/is-implemented.js b/node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/node_modules/es6-symbol/is-implemented.js index 02a06b5..53759f3 100644 --- a/node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/node_modules/es6-symbol/is-implemented.js +++ b/node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/node_modules/es6-symbol/is-implemented.js @@ -9,7 +9,6 @@ module.exports = function () { // Return 'true' for polyfills if (typeof Symbol.isConcatSpreadable !== 'object') return false; - if (typeof Symbol.isRegExp !== 'object') return false; if (typeof Symbol.iterator !== 'object') return false; if (typeof Symbol.toPrimitive !== 'object') return false; if (typeof Symbol.toStringTag !== 'object') return false; diff --git a/node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/node_modules/es6-symbol/is-symbol.js b/node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/node_modules/es6-symbol/is-symbol.js index dcf72c9..beeba2c 100644 --- a/node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/node_modules/es6-symbol/is-symbol.js +++ b/node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/node_modules/es6-symbol/is-symbol.js @@ -1,12 +1,5 @@ 'use strict'; -var toString = Object.prototype.toString - , toStringTag = require('./').toStringTag - - , id = '[object Symbol]' - , Global = (typeof Symbol === 'undefined') ? null : Symbol; - module.exports = function (x) { - return (x && ((Global && (x instanceof Global)) || - (toString.call(x) === id) || (x[toStringTag] === 'Symbol'))) || false; + return (x && ((typeof x === 'symbol') || (x['@@toStringTag'] === 'Symbol'))) || false; }; diff --git a/node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/node_modules/es6-symbol/package.json b/node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/node_modules/es6-symbol/package.json index c7026c2..aaada6a 100644 --- a/node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/node_modules/es6-symbol/package.json +++ b/node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/node_modules/es6-symbol/package.json @@ -1,6 +1,6 @@ { "name": "es6-symbol", - "version": "0.1.1", + "version": "2.0.1", "description": "ECMAScript6 Symbol polyfill", "author": { "name": "Mariusz Nowak", @@ -21,24 +21,28 @@ }, "dependencies": { "d": "~0.1.1", - "es5-ext": "~0.10.4" + "es5-ext": "~0.10.5" }, "devDependencies": { - "tad": "0.2.x" + "tad": "~0.2.1", + "xlint": "~0.2.2", + "xlint-jslint-medikoo": "~0.1.2" }, "scripts": { + "lint": "node node_modules/xlint/bin/xlint --linter=node_modules/xlint-jslint-medikoo/index.js --no-cache --no-stream", + "lint-console": "node node_modules/xlint/bin/xlint --linter=node_modules/xlint-jslint-medikoo/index.js --watch", "test": "node ./node_modules/tad/bin/tad" }, "license": "MIT", - "gitHead": "2ca76a05feafaa14c838337722562625fb5072b4", + "gitHead": "51f6938d7830269fefa38f02eb912f5472b3ccd7", "bugs": { "url": "https://github.com/medikoo/es6-symbol/issues" }, "homepage": "https://github.com/medikoo/es6-symbol", - "_id": "es6-symbol@0.1.1", - "_shasum": "9cf7fab2edaff1b1da8fe8e68bfe3f5aca6ca218", - "_from": "es6-symbol@0.1.x", - "_npmVersion": "2.0.0", + "_id": "es6-symbol@2.0.1", + "_shasum": "761b5c67cfd4f1d18afb234f691d678682cb3bf3", + "_from": "es6-symbol@~2.0.1", + "_npmVersion": "1.4.28", "_npmUser": { "name": "medikoo", "email": "medikoo+npm@medikoo.com" @@ -50,10 +54,10 @@ } ], "dist": { - "shasum": "9cf7fab2edaff1b1da8fe8e68bfe3f5aca6ca218", - "tarball": "http://registry.npmjs.org/es6-symbol/-/es6-symbol-0.1.1.tgz" + "shasum": "761b5c67cfd4f1d18afb234f691d678682cb3bf3", + "tarball": "http://registry.npmjs.org/es6-symbol/-/es6-symbol-2.0.1.tgz" }, "directories": {}, - "_resolved": "https://registry.npmjs.org/es6-symbol/-/es6-symbol-0.1.1.tgz", + "_resolved": "https://registry.npmjs.org/es6-symbol/-/es6-symbol-2.0.1.tgz", "readme": "ERROR: No README data found!" } diff --git a/node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/node_modules/es6-symbol/polyfill.js b/node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/node_modules/es6-symbol/polyfill.js index f7dfa25..735eb67 100644 --- a/node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/node_modules/es6-symbol/polyfill.js +++ b/node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/node_modules/es6-symbol/polyfill.js @@ -1,53 +1,77 @@ 'use strict'; -var d = require('d') +var d = require('d') + , validateSymbol = require('./validate-symbol') , create = Object.create, defineProperties = Object.defineProperties - , generateName, Symbol; + , defineProperty = Object.defineProperty, objPrototype = Object.prototype + , Symbol, HiddenSymbol, globalSymbols = create(null); -generateName = (function () { +var generateName = (function () { var created = create(null); return function (desc) { - var postfix = 0; + var postfix = 0, name; while (created[desc + (postfix || '')]) ++postfix; desc += (postfix || ''); created[desc] = true; - return '@@' + desc; + name = '@@' + desc; + defineProperty(objPrototype, name, d.gs(null, function (value) { + defineProperty(this, name, d(value)); + })); + return name; }; }()); -module.exports = Symbol = function (description) { +HiddenSymbol = function Symbol(description) { + if (this instanceof HiddenSymbol) throw new TypeError('TypeError: Symbol is not a constructor'); + return Symbol(description); +}; +module.exports = Symbol = function Symbol(description) { var symbol; - if (this instanceof Symbol) { - throw new TypeError('TypeError: Symbol is not a constructor'); - } - symbol = create(Symbol.prototype); + if (this instanceof Symbol) throw new TypeError('TypeError: Symbol is not a constructor'); + symbol = create(HiddenSymbol.prototype); description = (description === undefined ? '' : String(description)); return defineProperties(symbol, { __description__: d('', description), __name__: d('', generateName(description)) }); }; - -Object.defineProperties(Symbol, { - create: d('', Symbol('create')), +defineProperties(Symbol, { + for: d(function (key) { + if (globalSymbols[key]) return globalSymbols[key]; + return (globalSymbols[key] = Symbol(String(key))); + }), + keyFor: d(function (s) { + var key; + validateSymbol(s); + for (key in globalSymbols) if (globalSymbols[key] === s) return key; + }), hasInstance: d('', Symbol('hasInstance')), isConcatSpreadable: d('', Symbol('isConcatSpreadable')), - isRegExp: d('', Symbol('isRegExp')), iterator: d('', Symbol('iterator')), + match: d('', Symbol('match')), + replace: d('', Symbol('replace')), + search: d('', Symbol('search')), + species: d('', Symbol('species')), + split: d('', Symbol('split')), toPrimitive: d('', Symbol('toPrimitive')), toStringTag: d('', Symbol('toStringTag')), unscopables: d('', Symbol('unscopables')) }); +defineProperties(HiddenSymbol.prototype, { + constructor: d(Symbol), + toString: d('', function () { return this.__name__; }) +}); defineProperties(Symbol.prototype, { - properToString: d(function () { - return 'Symbol (' + this.__description__ + ')'; - }), - toString: d('', function () { return this.__name__; }) + toString: d(function () { return 'Symbol (' + validateSymbol(this).__description__ + ')'; }), + valueOf: d(function () { return validateSymbol(this); }) }); -Object.defineProperty(Symbol.prototype, Symbol.toPrimitive, d('', - function (hint) { - throw new TypeError("Conversion of symbol objects is not allowed"); - })); -Object.defineProperty(Symbol.prototype, Symbol.toStringTag, d('c', 'Symbol')); +defineProperty(Symbol.prototype, Symbol.toPrimitive, d('', + function () { return validateSymbol(this); })); +defineProperty(Symbol.prototype, Symbol.toStringTag, d('c', 'Symbol')); + +defineProperty(HiddenSymbol.prototype, Symbol.toPrimitive, + d('c', Symbol.prototype[Symbol.toPrimitive])); +defineProperty(HiddenSymbol.prototype, Symbol.toStringTag, + d('c', Symbol.prototype[Symbol.toStringTag])); diff --git a/node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/node_modules/es6-symbol/test/polyfill.js b/node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/node_modules/es6-symbol/test/polyfill.js index cac9cd5..83fb5e9 100644 --- a/node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/node_modules/es6-symbol/test/polyfill.js +++ b/node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/node_modules/es6-symbol/test/polyfill.js @@ -10,8 +10,18 @@ module.exports = function (T, a) { defineProperty(x, symbol, d('foo')); a(x.test, undefined, "Name"); a(x[symbol], 'foo', "Get"); + a(x instanceof T, false); a(isSymbol(symbol), true, "Symbol"); a(isSymbol(T.iterator), true, "iterator"); a(isSymbol(T.toStringTag), true, "toStringTag"); + + x = {}; + x[symbol] = 'foo'; + a.deep(Object.getOwnPropertyDescriptor(x, symbol), { configurable: true, enumerable: false, + value: 'foo', writable: true }); + symbol = T.for('marko'); + a(isSymbol(symbol), true); + a(T.for('marko'), symbol); + a(T.keyFor(symbol), 'marko'); }; diff --git a/node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/node_modules/es6-symbol/test/valid-iterable.js b/node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/node_modules/es6-symbol/test/valid-iterable.js deleted file mode 100644 index d277bc9..0000000 --- a/node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/node_modules/es6-symbol/test/valid-iterable.js +++ /dev/null @@ -1,14 +0,0 @@ -'use strict'; - -var Iterator = require('../'); - -module.exports = function (t, a) { - var obj; - a.throws(function () { t(); }, TypeError, "Undefined"); - a.throws(function () { t({}); }, TypeError, "Plain object"); - a.throws(function () { t({ length: 0 }); }, TypeError, "Array-like"); - obj = { '@@iterator': function () { return new Iterator([]); } }; - a(t(obj), obj, "Iterator"); - obj = []; - a(t(obj), obj, 'Array'); -}; diff --git a/node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/node_modules/es6-symbol/test/valid-symbol.js b/node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/node_modules/es6-symbol/test/validate-symbol.js similarity index 100% rename from node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/node_modules/es6-symbol/test/valid-symbol.js rename to node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/node_modules/es6-symbol/test/validate-symbol.js diff --git a/node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/node_modules/es6-symbol/valid-symbol.js b/node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/node_modules/es6-symbol/validate-symbol.js similarity index 100% rename from node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/node_modules/es6-symbol/valid-symbol.js rename to node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/node_modules/es6-symbol/validate-symbol.js diff --git a/node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/number/is-integer/shim.js b/node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/number/is-integer/shim.js index dc88cf3..5402939 100644 --- a/node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/number/is-integer/shim.js +++ b/node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/number/is-integer/shim.js @@ -1,9 +1,8 @@ -'use strict'; +// Credit: http://www.2ality.com/2014/05/is-integer.html -var toInteger = require('../to-integer'); +'use strict'; module.exports = function (value) { if (typeof value !== 'number') return false; - if (!isFinite(value)) return false; - return toInteger(value) === value; + return (value % 1 === 0); }; diff --git a/node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/number/is-nan/shim.js b/node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/number/is-nan/shim.js index 74ee96d..070d96c 100644 --- a/node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/number/is-nan/shim.js +++ b/node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/number/is-nan/shim.js @@ -1,3 +1,3 @@ 'use strict'; -module.exports = function (value) { return (value !== value); } //jslint: skip +module.exports = function (value) { return (value !== value); } //jslint: ignore diff --git a/node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/object/compare.js b/node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/object/compare.js index 0101b66..2ab11f1 100644 --- a/node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/object/compare.js +++ b/node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/object/compare.js @@ -8,7 +8,7 @@ var strCompare = require('../string/#/case-insensitive-compare') typeMap = { undefined: 0, object: 1, - 'boolean': 2, + boolean: 2, string: 3, number: 4 }; @@ -31,12 +31,12 @@ module.exports = function (a, b) { a = resolve(a); b = resolve(b); - if (a == b) return typeMap[typeof a] - typeMap[typeof b]; //jslint: skip + if (a == b) return typeMap[typeof a] - typeMap[typeof b]; //jslint: ignore if (a == null) return -1; if (b == null) return 1; if ((typeof a === 'string') || (typeof b === 'string')) { return strCompare.call(a, b); } - if ((a !== a) && (b !== b)) return 0; //jslint: skip + if ((a !== a) && (b !== b)) return 0; //jslint: ignore return Number(a) - Number(b); }; diff --git a/node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/object/eq.js b/node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/object/eq.js index 9b8d6f3..037937e 100644 --- a/node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/object/eq.js +++ b/node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/object/eq.js @@ -1,5 +1,5 @@ 'use strict'; module.exports = function (x, y) { - return ((x === y) || ((x !== x) && (y !== y))); //jslint: skip + return ((x === y) || ((x !== x) && (y !== y))); //jslint: ignore }; diff --git a/node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/object/index.js b/node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/object/index.js index bf7c0ce..0b7b0fe 100644 --- a/node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/object/index.js +++ b/node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/object/index.js @@ -33,9 +33,11 @@ module.exports = { mixinPrototypes: require('./mixin-prototypes'), primitiveSet: require('./primitive-set'), safeTraverse: require('./safe-traverse'), + serialize: require('./serialize'), setPrototypeOf: require('./set-prototype-of'), some: require('./some'), toArray: require('./to-array'), + unserialize: require('./unserialize'), validCallable: require('./valid-callable'), validObject: require('./valid-object'), validValue: require('./valid-value') diff --git a/node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/object/is-empty.js b/node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/object/is-empty.js index 849673b..7b51a87 100644 --- a/node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/object/is-empty.js +++ b/node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/object/is-empty.js @@ -7,7 +7,7 @@ var value = require('./valid-value') module.exports = function (obj) { var i; value(obj); - for (i in obj) { //jslint: skip + for (i in obj) { //jslint: ignore if (propertyIsEnumerable.call(obj, i)) return false; } return true; diff --git a/node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/object/is-object.js b/node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/object/is-object.js index 4133a2b..a86facf 100644 --- a/node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/object/is-object.js +++ b/node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/object/is-object.js @@ -1,6 +1,6 @@ 'use strict'; -var map = { 'function': true, 'object': true }; +var map = { function: true, object: true }; module.exports = function (x) { return ((x != null) && map[typeof x]) || false; diff --git a/node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/object/is-plain-object.js b/node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/object/is-plain-object.js index 3abaf68..9a28231 100644 --- a/node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/object/is-plain-object.js +++ b/node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/object/is-plain-object.js @@ -3,7 +3,7 @@ var getPrototypeOf = Object.getPrototypeOf, prototype = Object.prototype , toString = prototype.toString - , id = {}.toString(); + , id = Object().toString(); module.exports = function (value) { var proto, constructor; diff --git a/node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/object/is.js b/node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/object/is.js index 8c695e4..5778b50 100644 --- a/node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/object/is.js +++ b/node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/object/is.js @@ -6,5 +6,5 @@ module.exports = function (x, y) { return (x === y) ? ((x !== 0) || ((1 / x) === (1 / y))) : - ((x !== x) && (y !== y)); //jslint: skip + ((x !== x) && (y !== y)); //jslint: ignore }; diff --git a/node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/object/normalize-options.js b/node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/object/normalize-options.js index b9cb49f..cf8ed8d 100644 --- a/node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/object/normalize-options.js +++ b/node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/object/normalize-options.js @@ -1,15 +1,10 @@ 'use strict'; -var assign = require('./assign') +var forEach = Array.prototype.forEach, create = Object.create; - , forEach = Array.prototype.forEach - , create = Object.create, getPrototypeOf = Object.getPrototypeOf - - , process; - -process = function (src, obj) { - var proto = getPrototypeOf(src); - return assign(proto ? process(proto, obj) : obj, src); +var process = function (src, obj) { + var key; + for (key in src) obj[key] = src[key]; }; module.exports = function (options/*, …options*/) { diff --git a/node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/object/serialize.js b/node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/object/serialize.js new file mode 100644 index 0000000..8113b68 --- /dev/null +++ b/node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/object/serialize.js @@ -0,0 +1,36 @@ +'use strict'; + +var toArray = require('./to-array') + , isDate = require('../date/is-date') + , isRegExp = require('../reg-exp/is-reg-exp') + + , isArray = Array.isArray, stringify = JSON.stringify + , keyValueToString = function (value, key) { return stringify(key) + ':' + exports(value); }; + +var sparseMap = function (arr) { + var i, l = arr.length, result = new Array(l); + for (i = 0; i < l; ++i) { + if (!arr.hasOwnProperty(i)) continue; + result[i] = exports(arr[i]); + } + return result; +}; + +module.exports = exports = function (obj) { + if (obj == null) return String(obj); + switch (typeof obj) { + case 'string': + return stringify(obj); + case 'number': + case 'boolean': + case 'function': + return String(obj); + case 'object': + if (isArray(obj)) return '[' + sparseMap(obj) + ']'; + if (isRegExp(obj)) return String(obj); + if (isDate(obj)) return 'new Date(' + obj.valueOf() + ')'; + return '{' + toArray(obj, keyValueToString) + '}'; + default: + throw new TypeError("Serialization of " + String(obj) + "is unsupported"); + } +}; diff --git a/node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/object/unserialize.js b/node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/object/unserialize.js new file mode 100644 index 0000000..ce68e40 --- /dev/null +++ b/node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/object/unserialize.js @@ -0,0 +1,7 @@ +'use strict'; + +var value = require('./valid-value'); + +module.exports = exports = function (code) { + return (new Function('return ' + value(code)))(); +}; diff --git a/node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/package.json b/node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/package.json index c2f7774..71f8ae3 100644 --- a/node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/package.json +++ b/node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/package.json @@ -1,6 +1,6 @@ { "name": "es5-ext", - "version": "0.10.4", + "version": "0.10.6", "description": "ECMAScript 5 extensions and ES6 shims", "author": { "name": "Mariusz Nowak", @@ -30,27 +30,30 @@ "url": "git://github.com/medikoo/es5-ext.git" }, "dependencies": { - "es6-iterator": "~0.1.1", - "es6-symbol": "0.1.x" + "es6-iterator": "~0.1.3", + "es6-symbol": "~2.0.1" }, "devDependencies": { - "tad": "0.2.x" + "tad": "~0.2.1", + "xlint": "~0.2.2", + "xlint-jslint-medikoo": "~0.1.2" }, "scripts": { + "lint": "node node_modules/xlint/bin/xlint --linter=node_modules/xlint-jslint-medikoo/index.js --no-cache --no-stream", + "lint-console": "node node_modules/xlint/bin/xlint --linter=node_modules/xlint-jslint-medikoo/index.js --watch", "test": "node ./node_modules/tad/bin/tad" }, - "licence": "MIT", + "license": "MIT", + "gitHead": "fd4ef2f9f4a4bb23e4479a1fb56701f49623d469", "bugs": { "url": "https://github.com/medikoo/es5-ext/issues" }, "homepage": "https://github.com/medikoo/es5-ext", - "_id": "es5-ext@0.10.4", - "dist": { - "shasum": "f4d7d85d45acfbe93379d4c0948fbae6466ec876", - "tarball": "http://registry.npmjs.org/es5-ext/-/es5-ext-0.10.4.tgz" - }, + "_id": "es5-ext@0.10.6", + "_shasum": "e27d5750401a11c08259e3b9b5d3bdd3281df00a", "_from": "es5-ext@~0.10.2", - "_npmVersion": "1.4.3", + "_npmVersion": "2.3.0", + "_nodeVersion": "0.11.16", "_npmUser": { "name": "medikoo", "email": "medikoo+npm@medikoo.com" @@ -61,8 +64,10 @@ "email": "medikoo+npm@medikoo.com" } ], + "dist": { + "shasum": "e27d5750401a11c08259e3b9b5d3bdd3281df00a", + "tarball": "http://registry.npmjs.org/es5-ext/-/es5-ext-0.10.6.tgz" + }, "directories": {}, - "_shasum": "f4d7d85d45acfbe93379d4c0948fbae6466ec876", - "_resolved": "https://registry.npmjs.org/es5-ext/-/es5-ext-0.10.4.tgz", - "readme": "ERROR: No README data found!" + "_resolved": "https://registry.npmjs.org/es5-ext/-/es5-ext-0.10.6.tgz" } diff --git a/node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/string/#/camel-to-hyphen.js b/node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/string/#/camel-to-hyphen.js index b5c9be7..6898097 100644 --- a/node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/string/#/camel-to-hyphen.js +++ b/node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/string/#/camel-to-hyphen.js @@ -1,7 +1,7 @@ 'use strict'; var replace = String.prototype.replace - , re = /([a-z])([A-Z])/g; + , re = /([a-z\d])([A-Z])/g; module.exports = function () { return replace.call(this, re, "$1-$2").toLowerCase(); diff --git a/node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/string/index.js b/node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/string/index.js index 087d85f..dbbcdf6 100644 --- a/node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/string/index.js +++ b/node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/string/index.js @@ -5,5 +5,6 @@ module.exports = { formatMethod: require('./format-method'), fromCodePoint: require('./from-code-point'), isString: require('./is-string'), + randomUniq: require('./random-uniq'), raw: require('./raw') }; diff --git a/node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/string/random-uniq.js b/node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/string/random-uniq.js new file mode 100644 index 0000000..54ae6f8 --- /dev/null +++ b/node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/string/random-uniq.js @@ -0,0 +1,11 @@ +'use strict'; + +var generated = Object.create(null) + + , random = Math.random; + +module.exports = function () { + var str; + do { str = random().toString(36).slice(2); } while (generated[str]); + return str; +}; diff --git a/node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/test/array/from/shim.js b/node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/test/array/from/shim.js index aa4c928..310302a 100644 --- a/node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/test/array/from/shim.js +++ b/node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/test/array/from/shim.js @@ -21,9 +21,9 @@ module.exports = function (t, a) { a.deep(t(3), [], "Primitive"); a(t.length, 1, "Length"); - a.deep(t({ 'length': 0 }), [], "No values Array-like"); - a.deep(t({ 'length': -1 }), [], "Invalid length Array-like"); - a.deep(t({ 'length': -Infinity }), [], "Invalid length Array-like #2"); + a.deep(t({ length: 0 }), [], "No values Array-like"); + a.deep(t({ length: -1 }), [], "Invalid length Array-like"); + a.deep(t({ length: -Infinity }), [], "Invalid length Array-like #2"); a.throws(function () { t(undefined); }, TypeError, "Undefined"); a.throws(function () { t(null); }, TypeError, "Null"); a.deep(t(false), [], "Boolean"); @@ -33,18 +33,18 @@ module.exports = function (t, a) { a.deep(t(1), [], "1"); a.deep(t(+Infinity), [], "+Infinity"); a.deep(t({}), [], "Plain object"); - a.deep(t({ 'length': 1 }), [undefined], "Sparse array-like"); - a.deep(t({ '0': 'a', '1': 'b', 'length': 2 }, function (x) { return x + x; }), ['aa', 'bb'], + a.deep(t({ length: 1 }), [undefined], "Sparse array-like"); + a.deep(t({ '0': 'a', '1': 'b', length: 2 }, function (x) { return x + x; }), ['aa', 'bb'], "Map"); - a.deep(t({ '0': 'a', '1': 'b', 'length': 2 }, function (x) { return String(this); }, undefined), + a.deep(t({ '0': 'a', '1': 'b', length: 2 }, function (x) { return String(this); }, undefined), ['undefined', 'undefined'], "Map context"); - a.deep(t({ '0': 'a', '1': 'b', 'length': 2 }, function (x) { return String(this); }, 'x'), + a.deep(t({ '0': 'a', '1': 'b', length: 2 }, function (x) { return String(this); }, 'x'), ['x', 'x'], "Map primitive context"); a.throws(function () { t({}, 'foo', 'x'); }, TypeError, "Non callable for map"); - a.deep(t.call(null, { 'length': 1, '0': 'a' }), ['a'], "Null context"); + a.deep(t.call(null, { length: 1, '0': 'a' }), ['a'], "Null context"); - a(t({ '__proto__': { '0': 'abc', 'length': 1 } })[0], 'abc', "Values on prototype"); + a(t({ __proto__: { '0': 'abc', length: 1 } })[0], 'abc', "Values on prototype"); a.throws(function () { t.call(function () { return Object.freeze({}); }, {}); }, TypeError, "Contructor producing freezed objects"); @@ -55,6 +55,6 @@ module.exports = function (t, a) { Object.defineProperty(MyType.prototype, '0', { set: function (x) { throw new Error('Setter called: ' + x); } }); - a.deep(t.call(MyType, { '0': 'abc', 'length': 1 }), { '0': 'abc', 'length': 1 }, + a.deep(t.call(MyType, { '0': 'abc', length: 1 }), { '0': 'abc', length: 1 }, "Defined not set"); }; diff --git a/node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/test/array/of/shim.js b/node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/test/array/of/shim.js index 6f1c332..e697442 100644 --- a/node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/test/array/of/shim.js +++ b/node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/test/array/of/shim.js @@ -25,8 +25,8 @@ module.exports = function (t, a) { a.deep(t(1), [1], "1"); a.deep(t(1, 2, 3), [1, 2, 3], "Numeric args"); a.deep(t(+Infinity), [+Infinity], "+Infinity"); - a.deep(t({ '0': 'a', '1': 'b', '2': 'c', 'length': 3 }), - [{ '0': 'a', '1': 'b', '2': 'c', 'length': 3 }], "Array like"); + a.deep(t({ '0': 'a', '1': 'b', '2': 'c', length: 3 }), + [{ '0': 'a', '1': 'b', '2': 'c', length: 3 }], "Array like"); a.deep(t(undefined, null, false, -Infinity, -0, +0, 1, 2, +Infinity), [undefined, null, false, -Infinity, -0, +0, 1, 2, +Infinity], "Falsy arguments"); @@ -41,13 +41,13 @@ module.exports = function (t, a) { a.deep(t.call(null, 1), [1], "1"); a.deep(t.call(null, 1, 2, 3), [1, 2, 3], "Numeric"); a.deep(t.call(null, +Infinity), [+Infinity], "+Infinity"); - a.deep(t.call(null, { '0': 'a', '1': 'b', '2': 'c', 'length': 3 }), - [{ '0': 'a', '1': 'b', '2': 'c', 'length': 3 }], "Array-like"); + a.deep(t.call(null, { '0': 'a', '1': 'b', '2': 'c', length: 3 }), + [{ '0': 'a', '1': 'b', '2': 'c', length: 3 }], "Array-like"); a.deep(t.call(null, undefined, null, false, -Infinity, -0, +0, 1, 2, +Infinity), [undefined, null, false, -Infinity, -0, +0, 1, 2, +Infinity], "Falsy"); a.h1("Other constructor context"); - a.deep(t.call(Object, 1, 2, 3), { '0': 1, '1': 2, '2': 3, 'length': 3 }, "Many arguments"); + a.deep(t.call(Object, 1, 2, 3), { '0': 1, '1': 2, '2': 3, length: 3 }, "Many arguments"); testObject = Object(3); testObject[0] = 1; @@ -64,5 +64,5 @@ module.exports = function (t, a) { defineProperty(MyType.prototype, '0', { set: function (x) { throw new Error('Setter called: ' + x); } }); - a.deep(t.call(MyType, 'abc'), { '0': 'abc', 'length': 1 }, "Define, not set"); + a.deep(t.call(MyType, 'abc'), { '0': 'abc', length: 1 }, "Define, not set"); }; diff --git a/node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/test/function/#/to-string-tokens.js b/node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/test/function/#/to-string-tokens.js new file mode 100644 index 0000000..4c54d30 --- /dev/null +++ b/node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/test/function/#/to-string-tokens.js @@ -0,0 +1,12 @@ +'use strict'; + +module.exports = function (t, a) { + a.deep(t.call(function (a, b) { return this[a] + this[b]; }), + { args: 'a, b', body: ' return this[a] + this[b]; ' }); + a.deep(t.call(function () {}), + { args: '', body: '' }); + a.deep(t.call(function (raz) {}), + { args: 'raz', body: '' }); + a.deep(t.call(function () { Object(); }), + { args: '', body: ' Object(); ' }); +}; diff --git a/node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/test/math/trunc/shim.js b/node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/test/math/trunc/shim.js index 415d30a..9e5eed7 100644 --- a/node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/test/math/trunc/shim.js +++ b/node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/test/math/trunc/shim.js @@ -5,8 +5,8 @@ var is = require('../../../object/is'); module.exports = function (t, a) { a(t({}), NaN, "NaN"); a(t(0), 0, "Zero"); - a(t(Infinity), 1, "Infinity"); - a(t(-Infinity), -1, "-Infinity"); + a(t(Infinity), Infinity, "Infinity"); + a(t(-Infinity), -Infinity, "-Infinity"); a(is(t(0.234), 0), true, "0"); a(is(t(-0.234), -0), true, "-0"); a(t(13.7), 13, "Positive #1"); diff --git a/node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/test/object/is-plain-object.js b/node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/test/object/is-plain-object.js index e0377ba..e988829 100644 --- a/node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/test/object/is-plain-object.js +++ b/node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/test/object/is-plain-object.js @@ -3,7 +3,7 @@ module.exports = function (t, a) { a(t({}), true, "Empty {} is plain object"); a(t({ a: true }), true, "{} with property is plain object"); - a(t({ 'prototype': 1, 'constructor': 2, '__proto__': 3 }), true, + a(t({ prototype: 1, constructor: 2, __proto__: 3 }), true, "{} with any property keys is plain object"); a(t(null), false, "Null is not plain object"); a(t('string'), false, "Primitive is not plain object"); diff --git a/node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/test/object/key-of.js b/node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/test/object/key-of.js index 39d65c5..a9225a0 100644 --- a/node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/test/object/key-of.js +++ b/node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/test/object/key-of.js @@ -2,7 +2,7 @@ module.exports = function (t, a) { var x = {}, y = {} - , o = { 'foo': 'bar', 'raz': x, 'trzy': 'cztery', 'five': '6' }; + , o = { foo: 'bar', raz: x, trzy: 'cztery', five: '6' }; a(t(o, 'bar'), 'foo', "First property"); a(t(o, 6), null, "Primitive that's not there"); diff --git a/node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/test/object/normalize-options.js b/node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/test/object/normalize-options.js index 052babd..0d2d4da 100644 --- a/node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/test/object/normalize-options.js +++ b/node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/test/object/normalize-options.js @@ -1,6 +1,6 @@ 'use strict'; -var create = Object.create; +var create = Object.create, defineProperty = Object.defineProperty; module.exports = function (t, a) { var x = { foo: 'raz', bar: 'dwa' }, y; @@ -9,6 +9,11 @@ module.exports = function (t, a) { a.deep(y, x, "Plain"); x = { raz: 'one', dwa: 'two' }; + defineProperty(x, 'get', { + configurable: true, + enumerable: true, + get: function () { return this.dwa; } + }); x = create(x); x.trzy = 'three'; x.cztery = 'four'; @@ -19,9 +24,9 @@ module.exports = function (t, a) { x.szesc = 'six'; a.deep(t(x), { raz: 'one', dwa: 'two!', trzy: 'three!', cztery: 'four', - piec: 'five', szesc: 'six' }, "Deep object"); + piec: 'five', szesc: 'six', get: 'two!' }, "Deep object"); a.deep(t({ marko: 'raz', raz: 'foo' }, x, { szesc: 'elo', siedem: 'bibg' }), { marko: 'raz', raz: 'one', dwa: 'two!', trzy: 'three!', cztery: 'four', - piec: 'five', szesc: 'elo', siedem: 'bibg' }, "Multiple options"); + piec: 'five', szesc: 'elo', siedem: 'bibg', get: 'two!' }, "Multiple options"); }; diff --git a/node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/test/object/serialize.js b/node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/test/object/serialize.js new file mode 100644 index 0000000..43eed6a --- /dev/null +++ b/node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/test/object/serialize.js @@ -0,0 +1,25 @@ +'use strict'; + +module.exports = function (t, a) { + var fn = function (raz, dwa) { return raz + dwa; }; + a(t(), 'undefined', "Undefined"); + a(t(null), 'null', "Null"); + a(t(null), 'null', "Null"); + a(t('raz'), '"raz"', "String"); + a(t('raz"ddwa\ntrzy'), '"raz\\"ddwa\\ntrzy"', "String with escape"); + a(t(false), 'false', "Booelean"); + a(t(fn), String(fn), "Function"); + + a(t(/raz-dwa/g), '/raz-dwa/g', "RegExp"); + a(t(new Date(1234567)), 'new Date(1234567)', "Date"); + a(t([]), '[]', "Empty array"); + a(t([undefined, false, null, 'raz"ddwa\ntrzy', fn, /raz/g, new Date(1234567), ['foo']]), + '[undefined,false,null,"raz\\"ddwa\\ntrzy",' + String(fn) + + ',/raz/g,new Date(1234567),["foo"]]', "Rich Array"); + a(t({}), '{}', "Empty object"); + a(t({ raz: undefined, dwa: false, trzy: null, cztery: 'raz"ddwa\ntrzy', piec: fn, szesc: /raz/g, + siedem: new Date(1234567), osiem: ['foo', 32], dziewiec: { foo: 'bar', dwa: 343 } }), + '{"raz":undefined,"dwa":false,"trzy":null,"cztery":"raz\\"ddwa\\ntrzy","piec":' + String(fn) + + ',"szesc":/raz/g,"siedem":new Date(1234567),"osiem":["foo",32],' + + '"dziewiec":{"foo":"bar","dwa":343}}', "Rich object"); +}; diff --git a/node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/test/object/unserialize.js b/node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/test/object/unserialize.js new file mode 100644 index 0000000..405eef1 --- /dev/null +++ b/node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/test/object/unserialize.js @@ -0,0 +1,24 @@ +'use strict'; + +module.exports = function (t, a) { + var fn = function (raz, dwa) { return raz + dwa; }; + a(t('undefined'), undefined, "Undefined"); + a(t('null'), null, "Null"); + a(t('"raz"'), 'raz', "String"); + a(t('"raz\\"ddwa\\ntrzy"'), 'raz"ddwa\ntrzy', "String with escape"); + a(t('false'), false, "Booelean"); + a(String(t(String(fn))), String(fn), "Function"); + + a.deep(t('/raz-dwa/g'), /raz-dwa/g, "RegExp"); + a.deep(t('new Date(1234567)'), new Date(1234567), "Date"); + a.deep(t('[]'), [], "Empty array"); + a.deep(t('[undefined,false,null,"raz\\"ddwa\\ntrzy",/raz/g,new Date(1234567),["foo"]]'), + [undefined, false, null, 'raz"ddwa\ntrzy', /raz/g, new Date(1234567), ['foo']], "Rich Array"); + a.deep(t('{}'), {}, "Empty object"); + a.deep(t('{"raz":undefined,"dwa":false,"trzy":null,"cztery":"raz\\"ddwa\\ntrzy",' + + '"szesc":/raz/g,"siedem":new Date(1234567),"osiem":["foo",32],' + + '"dziewiec":{"foo":"bar","dwa":343}}'), + { raz: undefined, dwa: false, trzy: null, cztery: 'raz"ddwa\ntrzy', szesc: /raz/g, + siedem: new Date(1234567), osiem: ['foo', 32], dziewiec: { foo: 'bar', dwa: 343 } }, + "Rich object"); +}; diff --git a/node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/test/object/valid-object.js b/node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/test/object/valid-object.js index dd73246..eaa8e7b 100644 --- a/node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/test/object/valid-object.js +++ b/node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/test/object/valid-object.js @@ -7,7 +7,7 @@ module.exports = function (t, a) { a.throws(function () { t(''); }, TypeError, "''"); a(t(x = {}), x, "Object"); a(t(x = function () {}), x, "Function"); - a(t(x = new String('raz')), x, "String object"); //jslint: skip + a(t(x = new String('raz')), x, "String object"); //jslint: ignore a(t(x = new Date()), x, "Date"); a.throws(function () { t(); }, TypeError, "Undefined"); diff --git a/node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/test/string/#/at.js b/node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/test/string/#/at.js index 487716c..2447a9f 100644 --- a/node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/test/string/#/at.js +++ b/node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/test/string/#/at.js @@ -93,5 +93,5 @@ module.exports = function (t, a) { a.throws(function () { t.call(null, 4); }, TypeError, "Null + argument"); a(t.call(42, 0), '4', "Number #1"); a(t.call(42, 1), '2', "Number #2"); - a(t.call({ 'toString': function () { return 'abc'; } }, 2), 'c', "Object"); + a(t.call({ toString: function () { return 'abc'; } }, 2), 'c', "Object"); }; diff --git a/node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/test/string/#/camel-to-hyphen.js b/node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/test/string/#/camel-to-hyphen.js index f30d423..606c616 100644 --- a/node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/test/string/#/camel-to-hyphen.js +++ b/node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/test/string/#/camel-to-hyphen.js @@ -1,5 +1,5 @@ 'use strict'; module.exports = function (t, a) { - a(t.call('razDwaTRzy4y'), 'raz-dwa-trzy4y'); + a(t.call('razDwaTRzy4yFoo45My'), 'raz-dwa-trzy4y-foo45-my'); }; diff --git a/node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/test/string/#/code-point-at/shim.js b/node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/test/string/#/code-point-at/shim.js index 778b603..0df4751 100644 --- a/node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/test/string/#/code-point-at/shim.js +++ b/node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/test/string/#/code-point-at/shim.js @@ -69,7 +69,7 @@ module.exports = function (t, a) { a.throws(function () { t.call(null, 4); }, TypeError); a(t.call(42, 0), 0x34); a(t.call(42, 1), 0x32); - a(t.call({ 'toString': function () { return 'abc'; } }, 2), 0x63); + a(t.call({ toString: function () { return 'abc'; } }, 2), 0x63); a.throws(function () { t.apply(undefined); }, TypeError); a.throws(function () { t.apply(undefined, [4]); }, TypeError); @@ -77,5 +77,5 @@ module.exports = function (t, a) { a.throws(function () { t.apply(null, [4]); }, TypeError); a(t.apply(42, [0]), 0x34); a(t.apply(42, [1]), 0x32); - a(t.apply({ 'toString': function () { return 'abc'; } }, [2]), 0x63); + a(t.apply({ toString: function () { return 'abc'; } }, [2]), 0x63); }; diff --git a/node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/test/string/#/hyphen-to-camel.js b/node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/test/string/#/hyphen-to-camel.js index a84d988..bd7ded4 100644 --- a/node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/test/string/#/hyphen-to-camel.js +++ b/node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/test/string/#/hyphen-to-camel.js @@ -1,5 +1,5 @@ 'use strict'; module.exports = function (t, a) { - a(t.call('raz-dwa-t-rzy-4y'), 'razDwaTRzy4y'); + a(t.call('raz-dwa-t-rzy-4y-rtr4-tiu-45-pa'), 'razDwaTRzy4yRtr4Tiu45Pa'); }; diff --git a/node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/test/string/#/pad.js b/node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/test/string/#/pad.js index c142267..28c3fca 100644 --- a/node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/test/string/#/pad.js +++ b/node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/test/string/#/pad.js @@ -3,7 +3,7 @@ var partial = require('../../../function/#/partial'); module.exports = { - "Left": function (t, a) { + Left: function (t, a) { t = partial.call(t, 'x', 5); a(t.call('yy'), 'xxxyy'); @@ -12,7 +12,7 @@ module.exports = { a(t.call('yyyyy'), 'yyyyy', 'Equal length'); a(t.call('yyyyyyy'), 'yyyyyyy', 'Longer'); }, - "Right": function (t, a) { + Right: function (t, a) { t = partial.call(t, 'x', -5); a(t.call('yy'), 'yyxxx'); diff --git a/node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/test/string/random-uniq.js b/node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/test/string/random-uniq.js new file mode 100644 index 0000000..6791ac2 --- /dev/null +++ b/node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/test/string/random-uniq.js @@ -0,0 +1,14 @@ +'use strict'; + +var isValidFormat = RegExp.prototype.test.bind(/^[a-z0-9]+$/); + +module.exports = function (t, a) { + a(typeof t(), 'string'); + a.ok(t().length > 7); + a.not(t(), t()); + a.ok(isValidFormat(t())); + a.ok(isValidFormat(t())); + a.ok(isValidFormat(t())); + a.ok(isValidFormat(t())); + a.ok(isValidFormat(t())); +}; diff --git a/node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/memoizee/node_modules/es6-weak-map/node_modules/es6-iterator/.travis.yml b/node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/memoizee/node_modules/es6-weak-map/node_modules/es6-iterator/.travis.yml index eab5f5d..02c277c 100644 --- a/node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/memoizee/node_modules/es6-weak-map/node_modules/es6-iterator/.travis.yml +++ b/node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/memoizee/node_modules/es6-weak-map/node_modules/es6-iterator/.travis.yml @@ -7,3 +7,5 @@ node_js: notifications: email: - medikoo+es6-iterator@medikoo.com + +script: "npm test && npm run lint" diff --git a/node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/memoizee/node_modules/es6-weak-map/node_modules/es6-iterator/CHANGES b/node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/memoizee/node_modules/es6-weak-map/node_modules/es6-iterator/CHANGES index 473a66d..a2d1ec7 100644 --- a/node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/memoizee/node_modules/es6-weak-map/node_modules/es6-iterator/CHANGES +++ b/node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/memoizee/node_modules/es6-weak-map/node_modules/es6-iterator/CHANGES @@ -1,4 +1,14 @@ -v0.1.1 -- 2014.04.29 +v0.1.3 -- 2015.02.02 +* Update dependencies +* Fix spelling of LICENSE + +v0.1.2 -- 2014.11.19 +* Optimise internal `_next` to not verify internal's list length at all times + (#2 thanks @RReverser) +* Fix documentation examples +* Configure lint scripts + +v0.1.1 -- 2014.04.29 * Fix es6-symbol dependency version v0.1.0 -- 2014.04.29 diff --git a/node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/memoizee/node_modules/es6-weak-map/node_modules/es6-iterator/LICENCE b/node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/memoizee/node_modules/es6-weak-map/node_modules/es6-iterator/LICENCE deleted file mode 100644 index aaf3528..0000000 --- a/node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/memoizee/node_modules/es6-weak-map/node_modules/es6-iterator/LICENCE +++ /dev/null @@ -1,19 +0,0 @@ -Copyright (C) 2013 Mariusz Nowak (www.medikoo.com) - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/memoizee/node_modules/es6-weak-map/node_modules/es6-iterator/LICENSE b/node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/memoizee/node_modules/es6-weak-map/node_modules/es6-iterator/LICENSE new file mode 100644 index 0000000..04724a3 --- /dev/null +++ b/node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/memoizee/node_modules/es6-weak-map/node_modules/es6-iterator/LICENSE @@ -0,0 +1,19 @@ +Copyright (C) 2013-2015 Mariusz Nowak (www.medikoo.com) + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/memoizee/node_modules/es6-weak-map/node_modules/es6-iterator/README.md b/node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/memoizee/node_modules/es6-weak-map/node_modules/es6-iterator/README.md index f1218a1..288373d 100644 --- a/node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/memoizee/node_modules/es6-weak-map/node_modules/es6-iterator/README.md +++ b/node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/memoizee/node_modules/es6-weak-map/node_modules/es6-iterator/README.md @@ -25,7 +25,7 @@ var iterator = new Iterator([1, 2, 3]); iterator.next(); // { value: 1, done: false } iterator.next(); // { value: 2, done: false } -iterator.next(); // { value: 3, done: true } +iterator.next(); // { value: 3, done: false } iterator.next(); // { value: undefined, done: true } ``` @@ -44,7 +44,7 @@ var iterator = new ArrayIterator([1, 2, 3], 'key+value'); iterator.next(); // { value: [0, 1], done: false } iterator.next(); // { value: [1, 2], done: false } -iterator.next(); // { value: [2, 3], done: true } +iterator.next(); // { value: [2, 3], done: false } iterator.next(); // { value: undefined, done: true } ``` @@ -56,7 +56,7 @@ May also be used for _arguments_ objects: iterator.next(); // { value: 1, done: false } iterator.next(); // { value: 2, done: false } - iterator.next(); // { value: 3, done: true } + iterator.next(); // { value: 3, done: false } iterator.next(); // { value: undefined, done: true } }(1, 2, 3)); ``` @@ -75,7 +75,7 @@ iterator.next(); // { value: '🙈', done: false } iterator.next(); // { value: 'o', done: false } iterator.next(); // { value: '🙉', done: false } iterator.next(); // { value: 'o', done: false } -iterator.next(); // { value: '🙊', done: true } +iterator.next(); // { value: '🙊', done: false } iterator.next(); // { value: undefined, done: true } ``` @@ -115,7 +115,7 @@ var iterator = get([1,2,3]); iterator.next(); // { value: 1, done: false } iterator.next(); // { value: 2, done: false } -iterator.next(); // { value: 3, done: true } +iterator.next(); // { value: 3, done: false } iterator.next(); // { value: undefined, done: true } ``` diff --git a/node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/memoizee/node_modules/es6-weak-map/node_modules/es6-iterator/index.js b/node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/memoizee/node_modules/es6-weak-map/node_modules/es6-iterator/index.js index d33910d..10fd089 100644 --- a/node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/memoizee/node_modules/es6-weak-map/node_modules/es6-iterator/index.js +++ b/node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/memoizee/node_modules/es6-weak-map/node_modules/es6-iterator/index.js @@ -1,7 +1,6 @@ 'use strict'; var clear = require('es5-ext/array/#/clear') - , toPosInt = require('es5-ext/number/to-pos-integer') , assign = require('es5-ext/object/assign') , callable = require('es5-ext/object/valid-callable') , value = require('es5-ext/object/valid-value') @@ -30,14 +29,13 @@ module.exports = Iterator = function (list, context) { defineProperties(Iterator.prototype, assign({ constructor: d(Iterator), _next: d(function () { - var i, l; + var i; if (!this.__list__) return; if (this.__redo__) { i = this.__redo__.shift(); if (i !== undefined) return i; } - l = toPosInt(this.__list__.length); - if (this.__nextIndex__ < l) return this.__nextIndex__++; + if (this.__nextIndex__ < this.__list__.length) return this.__nextIndex__++; this._unBind(); }), next: d(function () { return this._createResult(this._next()); }), diff --git a/node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/memoizee/node_modules/es6-weak-map/node_modules/es6-iterator/node_modules/es6-symbol/.lint b/node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/memoizee/node_modules/es6-weak-map/node_modules/es6-iterator/node_modules/es6-symbol/.lint new file mode 100644 index 0000000..1851752 --- /dev/null +++ b/node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/memoizee/node_modules/es6-weak-map/node_modules/es6-iterator/node_modules/es6-symbol/.lint @@ -0,0 +1,13 @@ +@root + +module + +tabs +indent 2 +maxlen 100 + +ass +nomen +plusplus +newcap +vars diff --git a/node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/memoizee/node_modules/es6-weak-map/node_modules/es6-iterator/node_modules/es6-symbol/.npmignore b/node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/memoizee/node_modules/es6-weak-map/node_modules/es6-iterator/node_modules/es6-symbol/.npmignore new file mode 100644 index 0000000..155e41f --- /dev/null +++ b/node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/memoizee/node_modules/es6-weak-map/node_modules/es6-iterator/node_modules/es6-symbol/.npmignore @@ -0,0 +1,4 @@ +.DS_Store +/node_modules +/npm-debug.log +/.lintcache diff --git a/node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/memoizee/node_modules/es6-weak-map/node_modules/es6-iterator/node_modules/es6-symbol/.travis.yml b/node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/memoizee/node_modules/es6-weak-map/node_modules/es6-iterator/node_modules/es6-symbol/.travis.yml new file mode 100644 index 0000000..afd3509 --- /dev/null +++ b/node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/memoizee/node_modules/es6-weak-map/node_modules/es6-iterator/node_modules/es6-symbol/.travis.yml @@ -0,0 +1,9 @@ +language: node_js +node_js: + - 0.8 + - 0.10 + - 0.11 + +notifications: + email: + - medikoo+es6-symbol@medikoo.com diff --git a/node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/memoizee/node_modules/es6-weak-map/node_modules/es6-iterator/node_modules/es6-symbol/CHANGES b/node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/memoizee/node_modules/es6-weak-map/node_modules/es6-iterator/node_modules/es6-symbol/CHANGES new file mode 100644 index 0000000..df8c27e --- /dev/null +++ b/node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/memoizee/node_modules/es6-weak-map/node_modules/es6-iterator/node_modules/es6-symbol/CHANGES @@ -0,0 +1,34 @@ +v2.0.1 -- 2015.01.28 +* Fix Symbol.prototype[Symbol.isPrimitive] implementation +* Improve validation within Symbol.prototype.toString and + Symbol.prototype.valueOf + +v2.0.0 -- 2015.01.28 +* Update up to changes in specification: + * Implement `for` and `keyFor` + * Remove `Symbol.create` and `Symbol.isRegExp` + * Add `Symbol.match`, `Symbol.replace`, `Symbol.search`, `Symbol.species` and + `Symbol.split` +* Rename `validSymbol` to `validateSymbol` +* Improve documentation +* Remove dead test modules + +v1.0.0 -- 2015.01.26 +* Fix enumerability for symbol properties set normally (e.g. obj[symbol] = value) +* Introduce initialization via hidden constructor +* Fix isSymbol handling of polyfill values when native Symbol is present +* Fix spelling of LICENSE +* Configure lint scripts + +v0.1.1 -- 2014.10.07 +* Fix isImplemented, so it returns true in case of polyfill +* Improve documentations + +v0.1.0 -- 2014.04.28 +* Assure strictly npm dependencies +* Update to use latest versions of dependencies +* Fix implementation detection so it doesn't crash on `String(symbol)` +* throw on `new Symbol()` (as decided by TC39) + +v0.0.0 -- 2013.11.15 +* Initial (dev) version \ No newline at end of file diff --git a/node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/memoizee/node_modules/es6-weak-map/node_modules/es6-iterator/node_modules/es6-symbol/LICENSE b/node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/memoizee/node_modules/es6-weak-map/node_modules/es6-iterator/node_modules/es6-symbol/LICENSE new file mode 100644 index 0000000..04724a3 --- /dev/null +++ b/node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/memoizee/node_modules/es6-weak-map/node_modules/es6-iterator/node_modules/es6-symbol/LICENSE @@ -0,0 +1,19 @@ +Copyright (C) 2013-2015 Mariusz Nowak (www.medikoo.com) + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/memoizee/node_modules/es6-weak-map/node_modules/es6-iterator/node_modules/es6-symbol/README.md b/node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/memoizee/node_modules/es6-weak-map/node_modules/es6-iterator/node_modules/es6-symbol/README.md new file mode 100644 index 0000000..95d6780 --- /dev/null +++ b/node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/memoizee/node_modules/es6-weak-map/node_modules/es6-iterator/node_modules/es6-symbol/README.md @@ -0,0 +1,71 @@ +# es6-symbol +## ECMAScript 6 Symbol polyfill + +For more information about symbols see following links +- [Symbols in ECMAScript 6 by Axel Rauschmayer](http://www.2ality.com/2014/12/es6-symbols.html) +- [MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Symbol) +- [Specification](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-symbol-constructor) + +### Limitations + +Underneath it uses real string property names which can easily be retrieved, however accidental collision with other property names is unlikely. + +### Usage + +If you'd like to use native version when it exists and fallback to polyfill if it doesn't (but without implementing `Symbol` on global scope), do: + +```javascript +var Symbol = require('es6-symbol'); +``` + +If you want to make sure your environment implements `Symbol`, do: + +```javascript +require('es6-symbol/implement'); +``` + +If you strictly want to use polyfill even if native `Symbol` exists (hard to find a good reason for that), do: + +```javascript +var Symbol = require('es6-symbol/polyfill'); +``` + +#### API + +Best is to refer to [specification](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-symbol-objects). Still if you want quick look, follow examples: + +```javascript +var Symbol = require('es6-symbol'); + +var symbol = Symbol('My custom symbol'); +var x = {}; + +x[symbol] = 'foo'; +console.log(x[symbol]); 'foo' + +// Detect iterable: +var iterator, result; +if (possiblyIterable[Symbol.iterator]) { + iterator = possiblyIterable[Symbol.iterator](); + result = iterator.next(); + while(!result.done) { + console.log(result.value); + result = iterator.next(); + } +} +``` + +### Installation +#### NPM + +In your project path: + + $ npm install es6-symbol + +##### Browser + +To port it to Browser or any other (non CJS) environment, use your favorite CJS bundler. No favorite yet? Try: [Browserify](http://browserify.org/), [Webmake](https://github.com/medikoo/modules-webmake) or [Webpack](http://webpack.github.io/) + +## Tests [![Build Status](https://travis-ci.org/medikoo/es6-symbol.png)](https://travis-ci.org/medikoo/es6-symbol) + + $ npm test diff --git a/node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/memoizee/node_modules/es6-weak-map/node_modules/es6-iterator/node_modules/es6-symbol/implement.js b/node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/memoizee/node_modules/es6-weak-map/node_modules/es6-iterator/node_modules/es6-symbol/implement.js new file mode 100644 index 0000000..153edac --- /dev/null +++ b/node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/memoizee/node_modules/es6-weak-map/node_modules/es6-iterator/node_modules/es6-symbol/implement.js @@ -0,0 +1,7 @@ +'use strict'; + +if (!require('./is-implemented')()) { + Object.defineProperty(require('es5-ext/global'), 'Symbol', + { value: require('./polyfill'), configurable: true, enumerable: false, + writable: true }); +} diff --git a/node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/memoizee/node_modules/es6-weak-map/node_modules/es6-iterator/node_modules/es6-symbol/index.js b/node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/memoizee/node_modules/es6-weak-map/node_modules/es6-iterator/node_modules/es6-symbol/index.js new file mode 100644 index 0000000..609f1fa --- /dev/null +++ b/node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/memoizee/node_modules/es6-weak-map/node_modules/es6-iterator/node_modules/es6-symbol/index.js @@ -0,0 +1,3 @@ +'use strict'; + +module.exports = require('./is-implemented')() ? Symbol : require('./polyfill'); diff --git a/node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/memoizee/node_modules/es6-weak-map/node_modules/es6-iterator/node_modules/es6-symbol/is-implemented.js b/node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/memoizee/node_modules/es6-weak-map/node_modules/es6-iterator/node_modules/es6-symbol/is-implemented.js new file mode 100644 index 0000000..53759f3 --- /dev/null +++ b/node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/memoizee/node_modules/es6-weak-map/node_modules/es6-iterator/node_modules/es6-symbol/is-implemented.js @@ -0,0 +1,18 @@ +'use strict'; + +module.exports = function () { + var symbol; + if (typeof Symbol !== 'function') return false; + symbol = Symbol('test symbol'); + try { String(symbol); } catch (e) { return false; } + if (typeof Symbol.iterator === 'symbol') return true; + + // Return 'true' for polyfills + if (typeof Symbol.isConcatSpreadable !== 'object') return false; + if (typeof Symbol.iterator !== 'object') return false; + if (typeof Symbol.toPrimitive !== 'object') return false; + if (typeof Symbol.toStringTag !== 'object') return false; + if (typeof Symbol.unscopables !== 'object') return false; + + return true; +}; diff --git a/node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/memoizee/node_modules/es6-weak-map/node_modules/es6-iterator/node_modules/es6-symbol/is-native-implemented.js b/node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/memoizee/node_modules/es6-weak-map/node_modules/es6-iterator/node_modules/es6-symbol/is-native-implemented.js new file mode 100644 index 0000000..a8cb8b8 --- /dev/null +++ b/node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/memoizee/node_modules/es6-weak-map/node_modules/es6-iterator/node_modules/es6-symbol/is-native-implemented.js @@ -0,0 +1,8 @@ +// Exports true if environment provides native `Symbol` implementation + +'use strict'; + +module.exports = (function () { + if (typeof Symbol !== 'function') return false; + return (typeof Symbol.iterator === 'symbol'); +}()); diff --git a/node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/memoizee/node_modules/es6-weak-map/node_modules/es6-iterator/node_modules/es6-symbol/is-symbol.js b/node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/memoizee/node_modules/es6-weak-map/node_modules/es6-iterator/node_modules/es6-symbol/is-symbol.js new file mode 100644 index 0000000..beeba2c --- /dev/null +++ b/node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/memoizee/node_modules/es6-weak-map/node_modules/es6-iterator/node_modules/es6-symbol/is-symbol.js @@ -0,0 +1,5 @@ +'use strict'; + +module.exports = function (x) { + return (x && ((typeof x === 'symbol') || (x['@@toStringTag'] === 'Symbol'))) || false; +}; diff --git a/node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/memoizee/node_modules/es6-weak-map/node_modules/es6-iterator/node_modules/es6-symbol/package.json b/node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/memoizee/node_modules/es6-weak-map/node_modules/es6-iterator/node_modules/es6-symbol/package.json new file mode 100644 index 0000000..88d8516 --- /dev/null +++ b/node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/memoizee/node_modules/es6-weak-map/node_modules/es6-iterator/node_modules/es6-symbol/package.json @@ -0,0 +1,62 @@ +{ + "name": "es6-symbol", + "version": "2.0.1", + "description": "ECMAScript6 Symbol polyfill", + "author": { + "name": "Mariusz Nowak", + "email": "medyk@medikoo.com", + "url": "http://www.medikoo.com/" + }, + "keywords": [ + "symbol", + "private", + "property", + "es6", + "ecmascript", + "harmony" + ], + "repository": { + "type": "git", + "url": "git://github.com/medikoo/es6-symbol.git" + }, + "dependencies": { + "d": "~0.1.1", + "es5-ext": "~0.10.5" + }, + "devDependencies": { + "tad": "~0.2.1", + "xlint": "~0.2.2", + "xlint-jslint-medikoo": "~0.1.2" + }, + "scripts": { + "lint": "node node_modules/xlint/bin/xlint --linter=node_modules/xlint-jslint-medikoo/index.js --no-cache --no-stream", + "lint-console": "node node_modules/xlint/bin/xlint --linter=node_modules/xlint-jslint-medikoo/index.js --watch", + "test": "node ./node_modules/tad/bin/tad" + }, + "license": "MIT", + "gitHead": "51f6938d7830269fefa38f02eb912f5472b3ccd7", + "bugs": { + "url": "https://github.com/medikoo/es6-symbol/issues" + }, + "homepage": "https://github.com/medikoo/es6-symbol", + "_id": "es6-symbol@2.0.1", + "_shasum": "761b5c67cfd4f1d18afb234f691d678682cb3bf3", + "_from": "es6-symbol@~2.0.1", + "_npmVersion": "1.4.28", + "_npmUser": { + "name": "medikoo", + "email": "medikoo+npm@medikoo.com" + }, + "maintainers": [ + { + "name": "medikoo", + "email": "medikoo+npm@medikoo.com" + } + ], + "dist": { + "shasum": "761b5c67cfd4f1d18afb234f691d678682cb3bf3", + "tarball": "http://registry.npmjs.org/es6-symbol/-/es6-symbol-2.0.1.tgz" + }, + "directories": {}, + "_resolved": "https://registry.npmjs.org/es6-symbol/-/es6-symbol-2.0.1.tgz" +} diff --git a/node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/memoizee/node_modules/es6-weak-map/node_modules/es6-iterator/node_modules/es6-symbol/polyfill.js b/node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/memoizee/node_modules/es6-weak-map/node_modules/es6-iterator/node_modules/es6-symbol/polyfill.js new file mode 100644 index 0000000..735eb67 --- /dev/null +++ b/node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/memoizee/node_modules/es6-weak-map/node_modules/es6-iterator/node_modules/es6-symbol/polyfill.js @@ -0,0 +1,77 @@ +'use strict'; + +var d = require('d') + , validateSymbol = require('./validate-symbol') + + , create = Object.create, defineProperties = Object.defineProperties + , defineProperty = Object.defineProperty, objPrototype = Object.prototype + , Symbol, HiddenSymbol, globalSymbols = create(null); + +var generateName = (function () { + var created = create(null); + return function (desc) { + var postfix = 0, name; + while (created[desc + (postfix || '')]) ++postfix; + desc += (postfix || ''); + created[desc] = true; + name = '@@' + desc; + defineProperty(objPrototype, name, d.gs(null, function (value) { + defineProperty(this, name, d(value)); + })); + return name; + }; +}()); + +HiddenSymbol = function Symbol(description) { + if (this instanceof HiddenSymbol) throw new TypeError('TypeError: Symbol is not a constructor'); + return Symbol(description); +}; +module.exports = Symbol = function Symbol(description) { + var symbol; + if (this instanceof Symbol) throw new TypeError('TypeError: Symbol is not a constructor'); + symbol = create(HiddenSymbol.prototype); + description = (description === undefined ? '' : String(description)); + return defineProperties(symbol, { + __description__: d('', description), + __name__: d('', generateName(description)) + }); +}; +defineProperties(Symbol, { + for: d(function (key) { + if (globalSymbols[key]) return globalSymbols[key]; + return (globalSymbols[key] = Symbol(String(key))); + }), + keyFor: d(function (s) { + var key; + validateSymbol(s); + for (key in globalSymbols) if (globalSymbols[key] === s) return key; + }), + hasInstance: d('', Symbol('hasInstance')), + isConcatSpreadable: d('', Symbol('isConcatSpreadable')), + iterator: d('', Symbol('iterator')), + match: d('', Symbol('match')), + replace: d('', Symbol('replace')), + search: d('', Symbol('search')), + species: d('', Symbol('species')), + split: d('', Symbol('split')), + toPrimitive: d('', Symbol('toPrimitive')), + toStringTag: d('', Symbol('toStringTag')), + unscopables: d('', Symbol('unscopables')) +}); +defineProperties(HiddenSymbol.prototype, { + constructor: d(Symbol), + toString: d('', function () { return this.__name__; }) +}); + +defineProperties(Symbol.prototype, { + toString: d(function () { return 'Symbol (' + validateSymbol(this).__description__ + ')'; }), + valueOf: d(function () { return validateSymbol(this); }) +}); +defineProperty(Symbol.prototype, Symbol.toPrimitive, d('', + function () { return validateSymbol(this); })); +defineProperty(Symbol.prototype, Symbol.toStringTag, d('c', 'Symbol')); + +defineProperty(HiddenSymbol.prototype, Symbol.toPrimitive, + d('c', Symbol.prototype[Symbol.toPrimitive])); +defineProperty(HiddenSymbol.prototype, Symbol.toStringTag, + d('c', Symbol.prototype[Symbol.toStringTag])); diff --git a/node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/memoizee/node_modules/es6-weak-map/node_modules/es6-iterator/node_modules/es6-symbol/test/implement.js b/node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/memoizee/node_modules/es6-weak-map/node_modules/es6-iterator/node_modules/es6-symbol/test/implement.js new file mode 100644 index 0000000..eb35c30 --- /dev/null +++ b/node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/memoizee/node_modules/es6-weak-map/node_modules/es6-iterator/node_modules/es6-symbol/test/implement.js @@ -0,0 +1,3 @@ +'use strict'; + +module.exports = function (t, a) { a(typeof Symbol, 'function'); }; diff --git a/node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/memoizee/node_modules/es6-weak-map/node_modules/es6-iterator/node_modules/es6-symbol/test/index.js b/node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/memoizee/node_modules/es6-weak-map/node_modules/es6-iterator/node_modules/es6-symbol/test/index.js new file mode 100644 index 0000000..62b3296 --- /dev/null +++ b/node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/memoizee/node_modules/es6-weak-map/node_modules/es6-iterator/node_modules/es6-symbol/test/index.js @@ -0,0 +1,12 @@ +'use strict'; + +var d = require('d') + + , defineProperty = Object.defineProperty; + +module.exports = function (T, a) { + var symbol = T('test'), x = {}; + defineProperty(x, symbol, d('foo')); + a(x.test, undefined, "Name"); + a(x[symbol], 'foo', "Get"); +}; diff --git a/node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/memoizee/node_modules/es6-weak-map/node_modules/es6-iterator/node_modules/es6-symbol/test/is-implemented.js b/node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/memoizee/node_modules/es6-weak-map/node_modules/es6-iterator/node_modules/es6-symbol/test/is-implemented.js new file mode 100644 index 0000000..bb0d645 --- /dev/null +++ b/node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/memoizee/node_modules/es6-weak-map/node_modules/es6-iterator/node_modules/es6-symbol/test/is-implemented.js @@ -0,0 +1,14 @@ +'use strict'; + +var global = require('es5-ext/global') + , polyfill = require('../polyfill'); + +module.exports = function (t, a) { + var cache; + a(typeof t(), 'boolean'); + cache = global.Symbol; + global.Symbol = polyfill; + a(t(), true); + if (cache === undefined) delete global.Symbol; + else global.Symbol = cache; +}; diff --git a/node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/memoizee/node_modules/es6-weak-map/node_modules/es6-iterator/node_modules/es6-symbol/test/is-native-implemented.js b/node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/memoizee/node_modules/es6-weak-map/node_modules/es6-iterator/node_modules/es6-symbol/test/is-native-implemented.js new file mode 100644 index 0000000..df8ba03 --- /dev/null +++ b/node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/memoizee/node_modules/es6-weak-map/node_modules/es6-iterator/node_modules/es6-symbol/test/is-native-implemented.js @@ -0,0 +1,3 @@ +'use strict'; + +module.exports = function (t, a) { a(typeof t, 'boolean'); }; diff --git a/node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/memoizee/node_modules/es6-weak-map/node_modules/es6-iterator/node_modules/es6-symbol/test/is-symbol.js b/node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/memoizee/node_modules/es6-weak-map/node_modules/es6-iterator/node_modules/es6-symbol/test/is-symbol.js new file mode 100644 index 0000000..ac24b9a --- /dev/null +++ b/node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/memoizee/node_modules/es6-weak-map/node_modules/es6-iterator/node_modules/es6-symbol/test/is-symbol.js @@ -0,0 +1,16 @@ +'use strict'; + +var SymbolPoly = require('../polyfill'); + +module.exports = function (t, a) { + a(t(undefined), false, "Undefined"); + a(t(null), false, "Null"); + a(t(true), false, "Primitive"); + a(t('raz'), false, "String"); + a(t({}), false, "Object"); + a(t([]), false, "Array"); + if (typeof Symbol !== 'undefined') { + a(t(Symbol()), true, "Native"); + } + a(t(SymbolPoly()), true, "Polyfill"); +}; diff --git a/node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/memoizee/node_modules/es6-weak-map/node_modules/es6-iterator/node_modules/es6-symbol/test/polyfill.js b/node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/memoizee/node_modules/es6-weak-map/node_modules/es6-iterator/node_modules/es6-symbol/test/polyfill.js new file mode 100644 index 0000000..83fb5e9 --- /dev/null +++ b/node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/memoizee/node_modules/es6-weak-map/node_modules/es6-iterator/node_modules/es6-symbol/test/polyfill.js @@ -0,0 +1,27 @@ +'use strict'; + +var d = require('d') + , isSymbol = require('../is-symbol') + + , defineProperty = Object.defineProperty; + +module.exports = function (T, a) { + var symbol = T('test'), x = {}; + defineProperty(x, symbol, d('foo')); + a(x.test, undefined, "Name"); + a(x[symbol], 'foo', "Get"); + a(x instanceof T, false); + + a(isSymbol(symbol), true, "Symbol"); + a(isSymbol(T.iterator), true, "iterator"); + a(isSymbol(T.toStringTag), true, "toStringTag"); + + x = {}; + x[symbol] = 'foo'; + a.deep(Object.getOwnPropertyDescriptor(x, symbol), { configurable: true, enumerable: false, + value: 'foo', writable: true }); + symbol = T.for('marko'); + a(isSymbol(symbol), true); + a(T.for('marko'), symbol); + a(T.keyFor(symbol), 'marko'); +}; diff --git a/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/node_modules/es6-symbol/test/valid-symbol.js b/node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/memoizee/node_modules/es6-weak-map/node_modules/es6-iterator/node_modules/es6-symbol/test/validate-symbol.js similarity index 100% rename from node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/node_modules/es6-symbol/test/valid-symbol.js rename to node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/memoizee/node_modules/es6-weak-map/node_modules/es6-iterator/node_modules/es6-symbol/test/validate-symbol.js diff --git a/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/node_modules/es6-symbol/valid-symbol.js b/node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/memoizee/node_modules/es6-weak-map/node_modules/es6-iterator/node_modules/es6-symbol/validate-symbol.js similarity index 100% rename from node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/node_modules/es6-symbol/valid-symbol.js rename to node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/memoizee/node_modules/es6-weak-map/node_modules/es6-iterator/node_modules/es6-symbol/validate-symbol.js diff --git a/node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/memoizee/node_modules/es6-weak-map/node_modules/es6-iterator/package.json b/node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/memoizee/node_modules/es6-weak-map/node_modules/es6-iterator/package.json index e81aedc..e2f415d 100644 --- a/node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/memoizee/node_modules/es6-weak-map/node_modules/es6-iterator/package.json +++ b/node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/memoizee/node_modules/es6-weak-map/node_modules/es6-iterator/package.json @@ -1,6 +1,6 @@ { "name": "es6-iterator", - "version": "0.1.1", + "version": "0.1.3", "description": "Iterator abstraction based on ES6 specification", "author": { "name": "Mariusz Nowak", @@ -21,28 +21,31 @@ }, "dependencies": { "d": "~0.1.1", - "es5-ext": "~0.10.2", - "es6-symbol": "0.1.x" + "es5-ext": "~0.10.5", + "es6-symbol": "~2.0.1" }, "devDependencies": { - "event-emitter": "~0.3.1", - "tad": "0.2.x" + "event-emitter": "~0.3.3", + "tad": "~0.2.1", + "xlint": "~0.2.2", + "xlint-jslint-medikoo": "~0.1.2" }, "scripts": { + "lint": "node node_modules/xlint/bin/xlint --linter=node_modules/xlint-jslint-medikoo/index.js --no-cache --no-stream", + "lint-console": "node node_modules/xlint/bin/xlint --linter=node_modules/xlint-jslint-medikoo/index.js --watch", "test": "node ./node_modules/tad/bin/tad" }, "license": "MIT", + "gitHead": "2addc362c6f139e4941cf4726eeb59e5960c5cef", "bugs": { "url": "https://github.com/medikoo/es6-iterator/issues" }, "homepage": "https://github.com/medikoo/es6-iterator", - "_id": "es6-iterator@0.1.1", - "dist": { - "shasum": "5e136c899aa1c26296414f90859b73934812d275", - "tarball": "http://registry.npmjs.org/es6-iterator/-/es6-iterator-0.1.1.tgz" - }, + "_id": "es6-iterator@0.1.3", + "_shasum": "d6f58b8c4fc413c249b4baa19768f8e4d7c8944e", "_from": "es6-iterator@~0.1.1", - "_npmVersion": "1.4.3", + "_npmVersion": "2.3.0", + "_nodeVersion": "0.11.16", "_npmUser": { "name": "medikoo", "email": "medikoo+npm@medikoo.com" @@ -53,8 +56,10 @@ "email": "medikoo+npm@medikoo.com" } ], + "dist": { + "shasum": "d6f58b8c4fc413c249b4baa19768f8e4d7c8944e", + "tarball": "http://registry.npmjs.org/es6-iterator/-/es6-iterator-0.1.3.tgz" + }, "directories": {}, - "_shasum": "5e136c899aa1c26296414f90859b73934812d275", - "_resolved": "https://registry.npmjs.org/es6-iterator/-/es6-iterator-0.1.1.tgz", - "readme": "ERROR: No README data found!" + "_resolved": "https://registry.npmjs.org/es6-iterator/-/es6-iterator-0.1.3.tgz" } diff --git a/node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/memoizee/node_modules/es6-weak-map/node_modules/es6-iterator/test/array.js b/node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/memoizee/node_modules/es6-weak-map/node_modules/es6-iterator/test/array.js index 21a6751..ae7c219 100644 --- a/node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/memoizee/node_modules/es6-weak-map/node_modules/es6-iterator/test/array.js +++ b/node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/memoizee/node_modules/es6-weak-map/node_modules/es6-iterator/test/array.js @@ -4,7 +4,7 @@ var iteratorSymbol = require('es6-symbol').iterator; module.exports = function (T) { return { - "Values": function (a) { + Values: function (a) { var x = ['raz', 'dwa', 'trzy', 'cztery', 'pięć', 'sześć'], it; it = new T(x); @@ -34,7 +34,7 @@ module.exports = function (T) { a.deep(it.next(), { done: false, value: [5, 'pięć'] }, "#5"); a.deep(it.next(), { done: true, value: undefined }, "End"); }, - "Keys": function (a) { + Keys: function (a) { var x = ['raz', 'dwa', 'trzy', 'cztery', 'pięć', 'sześć'], it; it = new T(x, 'key'); @@ -49,7 +49,7 @@ module.exports = function (T) { a.deep(it.next(), { done: false, value: 5 }, "#5"); a.deep(it.next(), { done: true, value: undefined }, "End"); }, - "Sparse": function (a) { + Sparse: function (a) { var x = new Array(6), it; x[2] = 'raz'; diff --git a/node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/memoizee/node_modules/es6-weak-map/node_modules/es6-iterator/test/index.js b/node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/memoizee/node_modules/es6-weak-map/node_modules/es6-iterator/test/index.js index 1e2d1cf..ea3621a 100644 --- a/node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/memoizee/node_modules/es6-weak-map/node_modules/es6-iterator/test/index.js +++ b/node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/memoizee/node_modules/es6-weak-map/node_modules/es6-iterator/test/index.js @@ -21,7 +21,7 @@ module.exports = function (T) { a.deep(y = it.next(), { done: true, value: undefined }, "End"); a.not(y, it.next(), "Recreate result on dead"); }, - "Emited": function (a) { + Emited: function (a) { var x = ['raz', 'dwa', 'trzy', 'cztery', 'pięć'], y, it; y = ee(); diff --git a/node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/memoizee/node_modules/es6-weak-map/node_modules/es6-symbol/package.json b/node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/memoizee/node_modules/es6-weak-map/node_modules/es6-symbol/package.json index fae4fb2..c7026c2 100644 --- a/node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/memoizee/node_modules/es6-weak-map/node_modules/es6-symbol/package.json +++ b/node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/memoizee/node_modules/es6-weak-map/node_modules/es6-symbol/package.json @@ -54,5 +54,6 @@ "tarball": "http://registry.npmjs.org/es6-symbol/-/es6-symbol-0.1.1.tgz" }, "directories": {}, - "_resolved": "https://registry.npmjs.org/es6-symbol/-/es6-symbol-0.1.1.tgz" + "_resolved": "https://registry.npmjs.org/es6-symbol/-/es6-symbol-0.1.1.tgz", + "readme": "ERROR: No README data found!" } diff --git a/node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/memoizee/node_modules/es6-weak-map/package.json b/node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/memoizee/node_modules/es6-weak-map/package.json index bea4097..1af6e66 100644 --- a/node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/memoizee/node_modules/es6-weak-map/package.json +++ b/node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/memoizee/node_modules/es6-weak-map/package.json @@ -58,5 +58,6 @@ "tarball": "http://registry.npmjs.org/es6-weak-map/-/es6-weak-map-0.1.2.tgz" }, "directories": {}, - "_resolved": "https://registry.npmjs.org/es6-weak-map/-/es6-weak-map-0.1.2.tgz" + "_resolved": "https://registry.npmjs.org/es6-weak-map/-/es6-weak-map-0.1.2.tgz", + "readme": "ERROR: No README data found!" } diff --git a/node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/memoizee/node_modules/event-emitter/.travis.yml b/node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/memoizee/node_modules/event-emitter/.travis.yml index 647a081..a6ec240 100644 --- a/node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/memoizee/node_modules/event-emitter/.travis.yml +++ b/node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/memoizee/node_modules/event-emitter/.travis.yml @@ -10,3 +10,5 @@ before_install: notifications: email: - medikoo+event-emitter@medikoo.com + +script: "npm test && npm run lint" diff --git a/node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/memoizee/node_modules/event-emitter/CHANGES b/node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/memoizee/node_modules/event-emitter/CHANGES index 694cf8f..dbc1b17 100644 --- a/node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/memoizee/node_modules/event-emitter/CHANGES +++ b/node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/memoizee/node_modules/event-emitter/CHANGES @@ -1,3 +1,11 @@ +v0.3.3 -- 2015.01.30 +* Fix reference to module in benchmarks + +v0.3.2 -- 2015.01.20 +* Improve documentation +* Configure lint scripts +* Fix spelling of LICENSE + v0.3.1 -- 2014.04.25 * Fix redefinition of emit method in `pipe` * Allow custom emit method name in `pipe` diff --git a/node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/memoizee/node_modules/event-emitter/LICENCE b/node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/memoizee/node_modules/event-emitter/LICENCE deleted file mode 100644 index 4d75961..0000000 --- a/node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/memoizee/node_modules/event-emitter/LICENCE +++ /dev/null @@ -1,19 +0,0 @@ -Copyright (C) 2012 Mariusz Nowak (www.medikoo.com) - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/memoizee/node_modules/event-emitter/LICENSE b/node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/memoizee/node_modules/event-emitter/LICENSE new file mode 100644 index 0000000..ccb76f6 --- /dev/null +++ b/node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/memoizee/node_modules/event-emitter/LICENSE @@ -0,0 +1,19 @@ +Copyright (C) 2012-2015 Mariusz Nowak (www.medikoo.com) + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/memoizee/node_modules/event-emitter/README.md b/node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/memoizee/node_modules/event-emitter/README.md index 8e425e0..17f4524 100644 --- a/node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/memoizee/node_modules/event-emitter/README.md +++ b/node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/memoizee/node_modules/event-emitter/README.md @@ -36,8 +36,8 @@ Removes all listeners from given event emitter object #### hasListeners(obj[, name]) _(event-emitter/has-listeners)_ -Whether there are any listeners attached to the object. -If `name` is provided, it checks whether are there any listeners attached for specific event +Whether object has some listeners attached to the object. +When `name` is provided, it checks listeners for specific event name ```javascript var emitter = ee(); @@ -55,15 +55,15 @@ emitter.off('foo', listener); hasListeners(emitter, 'foo'); // false ``` -#### pipe(source, target/*, emitMethodName*/) _(event-emitter/pipe)_ +#### pipe(source, target[, emitMethodName]) _(event-emitter/pipe)_ Pipes all events from _source_ emitter onto _target_ emitter (all events from _source_ emitter will be emitted also on _target_ emitter, but not other way). Returns _pipe_ object which exposes `pipe.close` function. Invoke it to close configured _pipe_. -It works internally by redefinition of `emit` method, if in your interface this method is referenced differenetly, provide its name (or symbol) with third argument. +It works internally by redefinition of `emit` method, if in your interface this method is referenced differently, provide its name (or symbol) with third argument. #### unify(emitter1, emitter2) _(event-emitter/unify)_ -Unifies event handling for two objects. Events emitted on _emitter1_ would be also emitter on _emitter2_, and other way back, events emitter on _emitter2_ would be emitter on _emitter1_ (both objects share same listeners collection). +Unifies event handling for two objects. Events emitted on _emitter1_ would be also emitter on _emitter2_, and other way back. Non reversible. ```javascript @@ -90,7 +90,6 @@ emitter1.emit('test'); // Invoked listener1, listener2, listener3 and listener4 emitter2.emit('test'); // Invoked listener1, listener2, listener3 and listener4 ``` - -### Tests [![Build Status](https://secure.travis-ci.org/medikoo/event-emitter.png?branch=master)](https://secure.travis-ci.org/medikoo/event-emitter) +### Tests [![Build Status](https://travis-ci.org/medikoo/event-emitter.png)](https://travis-ci.org/medikoo/event-emitter) $ npm test diff --git a/node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/memoizee/node_modules/event-emitter/benchmark/many-on.js b/node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/memoizee/node_modules/event-emitter/benchmark/many-on.js index d79e32e..e09bfde 100644 --- a/node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/memoizee/node_modules/event-emitter/benchmark/many-on.js +++ b/node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/memoizee/node_modules/event-emitter/benchmark/many-on.js @@ -15,7 +15,7 @@ var forEach = require('es5-ext/object/for-each') , ee, native, ee2, signals, a = {}, b = {}; ee = (function () { - var ee = require('../lib/core')(); + var ee = require('../')(); ee.on('test', function () { return arguments; }); ee.on('test', function () { return arguments; }); return ee.on('test', function () { return arguments; }); diff --git a/node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/memoizee/node_modules/event-emitter/benchmark/single-on.js b/node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/memoizee/node_modules/event-emitter/benchmark/single-on.js index 27368d2..99decbd 100644 --- a/node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/memoizee/node_modules/event-emitter/benchmark/single-on.js +++ b/node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/memoizee/node_modules/event-emitter/benchmark/single-on.js @@ -15,7 +15,7 @@ var forEach = require('es5-ext/object/for-each') , ee, native, ee2, signals, a = {}, b = {}; ee = (function () { - var ee = require('../lib/core'); + var ee = require('../'); return ee().on('test', function () { return arguments; }); }()); diff --git a/node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/memoizee/node_modules/event-emitter/package.json b/node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/memoizee/node_modules/event-emitter/package.json index 6247682..dd1c00b 100644 --- a/node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/memoizee/node_modules/event-emitter/package.json +++ b/node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/memoizee/node_modules/event-emitter/package.json @@ -1,6 +1,6 @@ { "name": "event-emitter", - "version": "0.3.1", + "version": "0.3.3", "description": "Environment agnostic event emitter", "author": { "name": "Mariusz Nowak", @@ -21,27 +21,29 @@ "url": "git://github.com/medikoo/event-emitter.git" }, "dependencies": { - "es5-ext": "~0.10.2", + "es5-ext": "~0.10.5", "d": "~0.1.1" }, "devDependencies": { - "tad": "~0.1.21" + "tad": "~0.2.1", + "xlint": "~0.2.2", + "xlint-jslint-medikoo": "~0.1.2" }, "scripts": { + "lint": "node node_modules/xlint/bin/xlint --linter=node_modules/xlint-jslint-medikoo/index.js --no-cache --no-stream", + "lint-console": "node node_modules/xlint/bin/xlint --linter=node_modules/xlint-jslint-medikoo/index.js --watch", "test": "node ./node_modules/tad/bin/tad" }, - "licence": "MIT", + "license": "MIT", + "gitHead": "13f184ab039e3559164691d3a6a3d6b8c84aed3e", "bugs": { "url": "https://github.com/medikoo/event-emitter/issues" }, "homepage": "https://github.com/medikoo/event-emitter", - "_id": "event-emitter@0.3.1", - "dist": { - "shasum": "1425ca9c5649a1a31ba835bd9dba6bfad3880238", - "tarball": "http://registry.npmjs.org/event-emitter/-/event-emitter-0.3.1.tgz" - }, + "_id": "event-emitter@0.3.3", + "_shasum": "df8e806541c68ab8ff20a79a1841b91abaa1bee4", "_from": "event-emitter@~0.3.1", - "_npmVersion": "1.4.3", + "_npmVersion": "1.4.28", "_npmUser": { "name": "medikoo", "email": "medikoo+npm@medikoo.com" @@ -52,8 +54,10 @@ "email": "medikoo+npm@medikoo.com" } ], + "dist": { + "shasum": "df8e806541c68ab8ff20a79a1841b91abaa1bee4", + "tarball": "http://registry.npmjs.org/event-emitter/-/event-emitter-0.3.3.tgz" + }, "directories": {}, - "_shasum": "1425ca9c5649a1a31ba835bd9dba6bfad3880238", - "_resolved": "https://registry.npmjs.org/event-emitter/-/event-emitter-0.3.1.tgz", - "readme": "ERROR: No README data found!" + "_resolved": "https://registry.npmjs.org/event-emitter/-/event-emitter-0.3.3.tgz" } diff --git a/node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/memoizee/node_modules/event-emitter/test/has-listeners.js b/node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/memoizee/node_modules/event-emitter/test/has-listeners.js index aa837c9..875b048 100644 --- a/node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/memoizee/node_modules/event-emitter/test/has-listeners.js +++ b/node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/memoizee/node_modules/event-emitter/test/has-listeners.js @@ -5,7 +5,7 @@ var ee = require('../'); module.exports = function (t) { var x, y; return { - "Any": function (a) { + Any: function (a) { a(t(true), false, "Primitive"); a(t({ events: [] }), false, "Other object"); a(t(x = ee()), false, "Emitter: empty"); @@ -19,7 +19,7 @@ module.exports = function (t) { x.off('test', y); a(t(x), false, "Emitter: empty but touched by once"); }, - "Specific": function (a) { + Specific: function (a) { a(t(true, 'test'), false, "Primitive"); a(t({ events: [] }, 'test'), false, "Other object"); a(t(x = ee(), 'test'), false, "Emitter: empty"); diff --git a/node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/memoizee/node_modules/event-emitter/test/unify.js b/node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/memoizee/node_modules/event-emitter/test/unify.js index 768d2da..69295e0 100644 --- a/node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/memoizee/node_modules/event-emitter/test/unify.js +++ b/node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/memoizee/node_modules/event-emitter/test/unify.js @@ -80,7 +80,7 @@ module.exports = function (t) { a(count2, 3, "Post unify z, y"); a(count3, 1, "Post unify z, z"); }, - "Many": function (a) { + Many: function (a) { var x = {}, y = {}, z = {}, count, count2, count3; ee(x); diff --git a/node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/memoizee/package.json b/node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/memoizee/package.json index 15e569a..0c24e77 100644 --- a/node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/memoizee/package.json +++ b/node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/memoizee/package.json @@ -72,5 +72,6 @@ "tarball": "http://registry.npmjs.org/memoizee/-/memoizee-0.3.8.tgz" }, "directories": {}, - "_resolved": "https://registry.npmjs.org/memoizee/-/memoizee-0.3.8.tgz" + "_resolved": "https://registry.npmjs.org/memoizee/-/memoizee-0.3.8.tgz", + "readme": "ERROR: No README data found!" } diff --git a/node_modules/bower/node_modules/inquirer/node_modules/figures/index.js b/node_modules/bower/node_modules/inquirer/node_modules/figures/index.js index 37f065c..3083de1 100644 --- a/node_modules/bower/node_modules/inquirer/node_modules/figures/index.js +++ b/node_modules/bower/node_modules/inquirer/node_modules/figures/index.js @@ -2,7 +2,7 @@ var platform = process.platform; var main = { - tick: '✔︎', + tick: '✔', cross: '✖', star: '★', square: '▇', @@ -48,14 +48,14 @@ var win = { squareSmall: '[ ]', squareSmallFilled: '[█]', circle: '( )', - circleFilled: '(•)', + circleFilled: '(*)', circleDotted: '( )', circleDouble: '( )', circleCircle: '(○)', circleCross: '(×)', circlePipe: '(│)', circleQuestionMark: '(?)', - bullet: '•', + bullet: '*', dot: '.', line: '─', ellipsis: '...', @@ -70,7 +70,7 @@ var win = { arrowDown: main.arrowDown, arrowLeft: main.arrowLeft, arrowRight: main.arrowRight, - radioOn: '(•)', + radioOn: '(*)', radioOff: '( )', checkboxOn: '[×]', checkboxOff: '[ ]', diff --git a/node_modules/bower/node_modules/inquirer/node_modules/figures/package.json b/node_modules/bower/node_modules/inquirer/node_modules/figures/package.json index 95ee260..2b0ac4a 100644 --- a/node_modules/bower/node_modules/inquirer/node_modules/figures/package.json +++ b/node_modules/bower/node_modules/inquirer/node_modules/figures/package.json @@ -1,6 +1,6 @@ { "name": "figures", - "version": "1.3.3", + "version": "1.3.5", "description": "Unicode symbols with Windows CMD fallbacks", "license": "MIT", "repository": { @@ -35,17 +35,18 @@ "fallback" ], "devDependencies": { - "ava": "0.0.3" + "ava": "0.0.4" }, - "gitHead": "28b3d3981564272502703da48c6a6a6cbb6e771b", + "gitHead": "5dd6a2d3320c904b69e5d59ee9c5099fa1cd6f1e", "bugs": { "url": "https://github.com/sindresorhus/figures/issues" }, "homepage": "https://github.com/sindresorhus/figures", - "_id": "figures@1.3.3", - "_shasum": "a0952f9ba076e6be3dd5e2bad8e6a013c00d3d36", + "_id": "figures@1.3.5", + "_shasum": "d1a31f4e1d2c2938ecde5c06aa16134cf29f4771", "_from": "figures@^1.3.2", - "_npmVersion": "1.4.23", + "_npmVersion": "2.1.5", + "_nodeVersion": "0.10.32", "_npmUser": { "name": "sindresorhus", "email": "sindresorhus@gmail.com" @@ -57,9 +58,9 @@ } ], "dist": { - "shasum": "a0952f9ba076e6be3dd5e2bad8e6a013c00d3d36", - "tarball": "http://registry.npmjs.org/figures/-/figures-1.3.3.tgz" + "shasum": "d1a31f4e1d2c2938ecde5c06aa16134cf29f4771", + "tarball": "http://registry.npmjs.org/figures/-/figures-1.3.5.tgz" }, "directories": {}, - "_resolved": "https://registry.npmjs.org/figures/-/figures-1.3.3.tgz" + "_resolved": "https://registry.npmjs.org/figures/-/figures-1.3.5.tgz" } diff --git a/node_modules/bower/node_modules/inquirer/node_modules/mute-stream/package.json b/node_modules/bower/node_modules/inquirer/node_modules/mute-stream/package.json index 7bca46e..8738ad7 100644 --- a/node_modules/bower/node_modules/inquirer/node_modules/mute-stream/package.json +++ b/node_modules/bower/node_modules/inquirer/node_modules/mute-stream/package.json @@ -37,7 +37,7 @@ "shasum": "a9219960a6d5d5d046597aee51252c6655f7177e", "tarball": "http://registry.npmjs.org/mute-stream/-/mute-stream-0.0.4.tgz" }, - "_from": "mute-stream@0.0.4", + "_from": "mute-stream@~0.0.4", "_npmVersion": "1.3.4", "_npmUser": { "name": "isaacs", diff --git a/node_modules/bower/node_modules/inquirer/node_modules/readline2/.npmignore b/node_modules/bower/node_modules/inquirer/node_modules/readline2/.npmignore deleted file mode 100644 index 218cc52..0000000 --- a/node_modules/bower/node_modules/inquirer/node_modules/readline2/.npmignore +++ /dev/null @@ -1,5 +0,0 @@ -/test/ -.editorconfig -.jshintrc -.travis.yml -*.sublime-* \ No newline at end of file diff --git a/node_modules/bower/node_modules/inquirer/node_modules/readline2/README.md b/node_modules/bower/node_modules/inquirer/node_modules/readline2/README.md index 443650a..a4ae0ba 100644 --- a/node_modules/bower/node_modules/inquirer/node_modules/readline2/README.md +++ b/node_modules/bower/node_modules/inquirer/node_modules/readline2/README.md @@ -1,4 +1,4 @@ -readline2 [![Build Status](https://secure.travis-ci.org/SBoudrias/readline2.png?branch=master)](http://travis-ci.org/SBoudrias/readline2) +readline2 [![Build Status](https://travis-ci.org/SBoudrias/readline2.png?branch=master)](https://travis-ci.org/SBoudrias/readline2) ========= Node.js (v0.8 and v0.10) had some bugs and issues with the default [Readline](http://nodejs.org/api/readline.html) module. @@ -15,7 +15,7 @@ Documentation ### readline2.createInterface( options ); -> {Interface} -Present the same API as [node.js readline.createInterface()](http://nodejs.org/api/readline.html) +Present the same API as [Node.js `readline.createInterface()`](http://nodejs.org/api/readline.html) #### Improvements - Default `options.input` as `process.stdin` diff --git a/node_modules/bower/node_modules/inquirer/node_modules/readline2/index.js b/node_modules/bower/node_modules/inquirer/node_modules/readline2/index.js index 54f6eed..023e7f1 100644 --- a/node_modules/bower/node_modules/inquirer/node_modules/readline2/index.js +++ b/node_modules/bower/node_modules/inquirer/node_modules/readline2/index.js @@ -4,10 +4,9 @@ */ "use strict"; -var _ = require("lodash"); var readline = require("readline"); var MuteStream = require("mute-stream"); -var chalk = require("chalk"); +var stripAnsi = require("strip-ansi"); /** @@ -39,20 +38,22 @@ Interface.createInterface = function( opt ) { var rl = readline.createInterface( filteredOpt ); // Fix bug with refreshLine - rl._refreshLine = _.wrap(rl._refreshLine, function( func ) { - func.call(rl); + var _refreshLine = rl._refreshLine; + rl._refreshLine = function() { + _refreshLine.call(rl); + var line = this._prompt + this.line; var cursorPos = this._getCursorPos(); readline.moveCursor(this.output, -line.length, 0); readline.moveCursor(this.output, cursorPos.cols, 0); - }); + }; // Returns current cursor's position and line rl._getCursorPos = function() { var columns = this.columns; var strBeforeCursor = this._prompt + this.line.substring(0, this.cursor); - var dispPos = this._getDisplayPos(chalk.stripColor(strBeforeCursor)); + var dispPos = this._getDisplayPos(strBeforeCursor); var cols = dispPos.cols; var rows = dispPos.rows; // If the cursor is on a full-width character which steps over the line, @@ -71,7 +72,7 @@ Interface.createInterface = function( opt ) { var offset = 0; var col = this.columns; var code; - str = chalk.stripColor(str); + str = stripAnsi(str); for (var i = 0, len = str.length; i < len; i++) { code = codePointAt(str, i); if (code >= 0x10000) { // surrogates diff --git a/node_modules/bower/node_modules/inquirer/node_modules/readline2/node_modules/chalk/node_modules/.bin/strip-ansi b/node_modules/bower/node_modules/inquirer/node_modules/readline2/node_modules/.bin/strip-ansi similarity index 100% rename from node_modules/bower/node_modules/inquirer/node_modules/readline2/node_modules/chalk/node_modules/.bin/strip-ansi rename to node_modules/bower/node_modules/inquirer/node_modules/readline2/node_modules/.bin/strip-ansi diff --git a/node_modules/bower/node_modules/inquirer/node_modules/readline2/node_modules/chalk/index.js b/node_modules/bower/node_modules/inquirer/node_modules/readline2/node_modules/chalk/index.js deleted file mode 100644 index a21f702..0000000 --- a/node_modules/bower/node_modules/inquirer/node_modules/readline2/node_modules/chalk/index.js +++ /dev/null @@ -1,63 +0,0 @@ -'use strict'; -var ansi = require('ansi-styles'); -var stripAnsi = require('strip-ansi'); -var hasColor = require('has-color'); -var defineProps = Object.defineProperties; -var chalk = module.exports; - -var styles = (function () { - var ret = {}; - - ansi.grey = ansi.gray; - - Object.keys(ansi).forEach(function (key) { - ret[key] = { - get: function () { - this._styles.push(key); - return this; - } - }; - }); - - return ret; -})(); - -function init() { - var ret = {}; - - Object.keys(styles).forEach(function (name) { - ret[name] = { - get: function () { - var obj = defineProps(function self() { - var str = [].slice.call(arguments).join(' '); - - if (!chalk.enabled) { - return str; - } - - return self._styles.reduce(function (str, name) { - var code = ansi[name]; - return str ? code.open + str + code.close : ''; - }, str); - }, styles); - - obj._styles = []; - - return obj[name]; - } - } - }); - - return ret; -} - -defineProps(chalk, init()); - -chalk.styles = ansi; -chalk.stripColor = stripAnsi; -chalk.supportsColor = hasColor; - -// detect mode if not set manually -if (chalk.enabled === undefined) { - chalk.enabled = chalk.supportsColor; -} diff --git a/node_modules/bower/node_modules/inquirer/node_modules/readline2/node_modules/chalk/node_modules/ansi-styles/ansi-styles.js b/node_modules/bower/node_modules/inquirer/node_modules/readline2/node_modules/chalk/node_modules/ansi-styles/ansi-styles.js deleted file mode 100644 index 3da548c..0000000 --- a/node_modules/bower/node_modules/inquirer/node_modules/readline2/node_modules/chalk/node_modules/ansi-styles/ansi-styles.js +++ /dev/null @@ -1,38 +0,0 @@ -'use strict'; -var styles = module.exports; - -var codes = { - reset: [0, 0], - - bold: [1, 22], - italic: [3, 23], - underline: [4, 24], - inverse: [7, 27], - strikethrough: [9, 29], - - 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], - - bgBlack: [40, 49], - bgRed: [41, 49], - bgGreen: [42, 49], - bgYellow: [43, 49], - bgBlue: [44, 49], - bgMagenta: [45, 49], - bgCyan: [46, 49], - bgWhite: [47, 49] -}; - -Object.keys(codes).forEach(function (key) { - var val = codes[key]; - var style = styles[key] = {}; - style.open = '\x1b[' + val[0] + 'm'; - style.close = '\x1b[' + val[1] + 'm'; -}); diff --git a/node_modules/bower/node_modules/inquirer/node_modules/readline2/node_modules/chalk/node_modules/ansi-styles/package.json b/node_modules/bower/node_modules/inquirer/node_modules/readline2/node_modules/chalk/node_modules/ansi-styles/package.json deleted file mode 100644 index 6333ed7..0000000 --- a/node_modules/bower/node_modules/inquirer/node_modules/readline2/node_modules/chalk/node_modules/ansi-styles/package.json +++ /dev/null @@ -1,75 +0,0 @@ -{ - "name": "ansi-styles", - "version": "1.0.0", - "description": "ANSI escape codes for colorizing strings in the terminal", - "keywords": [ - "ansi", - "styles", - "color", - "colour", - "colors", - "terminal", - "console", - "cli", - "string", - "tty", - "escape", - "formatting", - "rgb", - "256", - "shell", - "xterm", - "log", - "logging", - "command-line", - "text" - ], - "homepage": "https://github.com/sindresorhus/ansi-styles", - "bugs": { - "url": "https://github.com/sindresorhus/ansi-styles/issues" - }, - "license": "MIT", - "author": { - "name": "Sindre Sorhus", - "email": "sindresorhus@gmail.com", - "url": "http://sindresorhus.com" - }, - "files": [ - "ansi-styles.js" - ], - "main": "ansi-styles", - "repository": { - "type": "git", - "url": "git://github.com/sindresorhus/ansi-styles.git" - }, - "scripts": { - "test": "mocha" - }, - "devDependencies": { - "mocha": "~1.12.0" - }, - "engines": { - "node": ">=0.8.0" - }, - "_id": "ansi-styles@1.0.0", - "dist": { - "shasum": "cb102df1c56f5123eab8b67cd7b98027a0279178", - "tarball": "http://registry.npmjs.org/ansi-styles/-/ansi-styles-1.0.0.tgz" - }, - "_from": "ansi-styles@~1.0.0", - "_npmVersion": "1.3.15", - "_npmUser": { - "name": "sindresorhus", - "email": "sindresorhus@gmail.com" - }, - "maintainers": [ - { - "name": "sindresorhus", - "email": "sindresorhus@gmail.com" - } - ], - "directories": {}, - "_shasum": "cb102df1c56f5123eab8b67cd7b98027a0279178", - "_resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-1.0.0.tgz", - "readme": "ERROR: No README data found!" -} diff --git a/node_modules/bower/node_modules/inquirer/node_modules/readline2/node_modules/chalk/node_modules/ansi-styles/readme.md b/node_modules/bower/node_modules/inquirer/node_modules/readline2/node_modules/chalk/node_modules/ansi-styles/readme.md deleted file mode 100644 index 4ac8cbd..0000000 --- a/node_modules/bower/node_modules/inquirer/node_modules/readline2/node_modules/chalk/node_modules/ansi-styles/readme.md +++ /dev/null @@ -1,65 +0,0 @@ -# ansi-styles [![Build Status](https://secure.travis-ci.org/sindresorhus/ansi-styles.png?branch=master)](http://travis-ci.org/sindresorhus/ansi-styles) - -> [ANSI escape codes](http://en.wikipedia.org/wiki/ANSI_escape_code#Colors_and_Styles) for colorizing strings in the terminal. - -You probably want the higher-level [chalk](https://github.com/sindresorhus/chalk) module for styling your strings. - -![screenshot](screenshot.png) - - -## Install - -Install with [npm](https://npmjs.org/package/ansi-styles): `npm install --save ansi-styles` - - -## Example - -```js -var ansi = require('ansi-styles'); - -console.log(ansi.green.open + 'Hello world!' + ansi.green.close); -``` - -## API - -Each style has an `open` and `close` property. - - -## Styles - -### General - -- reset -- bold -- italic -- underline -- inverse -- strikethrough - -### Text colors - -- black -- red -- green -- yellow -- blue -- magenta -- cyan -- white -- gray - -### Background colors - -- bgBlack -- bgRed -- bgGreen -- bgYellow -- bgBlue -- bgMagenta -- bgCyan -- bgWhite - - -## License - -MIT © [Sindre Sorhus](http://sindresorhus.com) diff --git a/node_modules/bower/node_modules/inquirer/node_modules/readline2/node_modules/chalk/node_modules/has-color/index.js b/node_modules/bower/node_modules/inquirer/node_modules/readline2/node_modules/chalk/node_modules/has-color/index.js deleted file mode 100644 index 092d0ba..0000000 --- a/node_modules/bower/node_modules/inquirer/node_modules/readline2/node_modules/chalk/node_modules/has-color/index.js +++ /dev/null @@ -1,32 +0,0 @@ -'use strict'; -module.exports = (function () { - if (process.argv.indexOf('--no-color') !== -1) { - return false; - } - - if (process.argv.indexOf('--color') !== -1) { - return true; - } - - if (process.stdout && !process.stdout.isTTY) { - return false; - } - - if (process.platform === 'win32') { - return true; - } - - if ('COLORTERM' in process.env) { - return true; - } - - if (process.env.TERM === 'dumb') { - return false; - } - - if (/^screen|^xterm|^vt100|color|ansi|cygwin|linux/i.test(process.env.TERM)) { - return true; - } - - return false; -})(); diff --git a/node_modules/bower/node_modules/inquirer/node_modules/readline2/node_modules/chalk/node_modules/has-color/package.json b/node_modules/bower/node_modules/inquirer/node_modules/readline2/node_modules/chalk/node_modules/has-color/package.json deleted file mode 100644 index 16fcf24..0000000 --- a/node_modules/bower/node_modules/inquirer/node_modules/readline2/node_modules/chalk/node_modules/has-color/package.json +++ /dev/null @@ -1,71 +0,0 @@ -{ - "name": "has-color", - "version": "0.1.7", - "description": "Detect whether a terminal supports color", - "license": "MIT", - "repository": { - "type": "git", - "url": "git://github.com/sindresorhus/has-color" - }, - "author": { - "name": "Sindre Sorhus", - "email": "sindresorhus@gmail.com", - "url": "http://sindresorhus.com" - }, - "engines": { - "node": ">=0.10.0" - }, - "scripts": { - "test": "mocha" - }, - "files": [ - "index.js" - ], - "keywords": [ - "color", - "colour", - "colors", - "terminal", - "console", - "cli", - "ansi", - "styles", - "tty", - "rgb", - "256", - "shell", - "xterm", - "command-line", - "support", - "capability", - "detect" - ], - "devDependencies": { - "mocha": "*" - }, - "bugs": { - "url": "https://github.com/sindresorhus/has-color/issues" - }, - "homepage": "https://github.com/sindresorhus/has-color", - "_id": "has-color@0.1.7", - "dist": { - "shasum": "67144a5260c34fc3cca677d041daf52fe7b78b2f", - "tarball": "http://registry.npmjs.org/has-color/-/has-color-0.1.7.tgz" - }, - "_from": "has-color@~0.1.0", - "_npmVersion": "1.4.6", - "_npmUser": { - "name": "sindresorhus", - "email": "sindresorhus@gmail.com" - }, - "maintainers": [ - { - "name": "sindresorhus", - "email": "sindresorhus@gmail.com" - } - ], - "directories": {}, - "_shasum": "67144a5260c34fc3cca677d041daf52fe7b78b2f", - "_resolved": "https://registry.npmjs.org/has-color/-/has-color-0.1.7.tgz", - "readme": "ERROR: No README data found!" -} diff --git a/node_modules/bower/node_modules/inquirer/node_modules/readline2/node_modules/chalk/node_modules/has-color/readme.md b/node_modules/bower/node_modules/inquirer/node_modules/readline2/node_modules/chalk/node_modules/has-color/readme.md deleted file mode 100644 index 37bbd89..0000000 --- a/node_modules/bower/node_modules/inquirer/node_modules/readline2/node_modules/chalk/node_modules/has-color/readme.md +++ /dev/null @@ -1,30 +0,0 @@ -# has-color [![Build Status](https://travis-ci.org/sindresorhus/has-color.svg?branch=master)](https://travis-ci.org/sindresorhus/has-color) - -> Detect whether a terminal supports color. - -Used in the terminal color module [chalk](https://github.com/sindresorhus/chalk). - - -## Install - -```bash -$ npm install --save has-color -``` - - -## Usage - -```js -var hasColor = require('has-color'); - -if (hasColor) { - console.log('Terminal supports color.'); -} -``` - -It obeys the `--color` and `--no-color` CLI flags. - - -## License - -[MIT](http://opensource.org/licenses/MIT) © [Sindre Sorhus](http://sindresorhus.com) diff --git a/node_modules/bower/node_modules/inquirer/node_modules/readline2/node_modules/chalk/node_modules/strip-ansi/cli.js b/node_modules/bower/node_modules/inquirer/node_modules/readline2/node_modules/chalk/node_modules/strip-ansi/cli.js deleted file mode 100755 index f8019cd..0000000 --- a/node_modules/bower/node_modules/inquirer/node_modules/readline2/node_modules/chalk/node_modules/strip-ansi/cli.js +++ /dev/null @@ -1,27 +0,0 @@ -#!/usr/bin/env node -'use strict'; -var fs = require('fs'); -var strip = require('./index'); -var input = process.argv[2]; - -if (process.argv.indexOf('-h') !== -1 || process.argv.indexOf('--help') !== -1) { - console.log('strip-ansi > '); - console.log('or'); - console.log('cat | strip-ansi > '); - return; -} - -if (process.argv.indexOf('-v') !== -1 || process.argv.indexOf('--version') !== -1) { - console.log(require('./package').version); - return; -} - -if (input) { - process.stdout.write(strip(fs.readFileSync(input, 'utf8'))); - return; -} - -process.stdin.setEncoding('utf8'); -process.stdin.on('data', function (data) { - process.stdout.write(strip(data)); -}); diff --git a/node_modules/bower/node_modules/inquirer/node_modules/readline2/node_modules/chalk/node_modules/strip-ansi/index.js b/node_modules/bower/node_modules/inquirer/node_modules/readline2/node_modules/chalk/node_modules/strip-ansi/index.js deleted file mode 100644 index 62320c5..0000000 --- a/node_modules/bower/node_modules/inquirer/node_modules/readline2/node_modules/chalk/node_modules/strip-ansi/index.js +++ /dev/null @@ -1,4 +0,0 @@ -'use strict'; -module.exports = function (str) { - return typeof str === 'string' ? str.replace(/\x1B\[([0-9]{1,2}(;[0-9]{1,2})?)?[m|K]/g, '') : str; -}; diff --git a/node_modules/bower/node_modules/inquirer/node_modules/readline2/node_modules/chalk/node_modules/strip-ansi/readme.md b/node_modules/bower/node_modules/inquirer/node_modules/readline2/node_modules/chalk/node_modules/strip-ansi/readme.md deleted file mode 100644 index eb661b3..0000000 --- a/node_modules/bower/node_modules/inquirer/node_modules/readline2/node_modules/chalk/node_modules/strip-ansi/readme.md +++ /dev/null @@ -1,46 +0,0 @@ -# strip-ansi [![Build Status](https://secure.travis-ci.org/sindresorhus/strip-ansi.png?branch=master)](http://travis-ci.org/sindresorhus/strip-ansi) - -> Strip [ANSI escape codes](http://en.wikipedia.org/wiki/ANSI_escape_code#Colors_and_Styles) (used for colorizing strings in the terminal) - -Used in the terminal color module [chalk](https://github.com/sindresorhus/chalk). - - -## Install - -Install locally with [npm](https://npmjs.org/package/strip-ansi): - -``` -npm install --save strip-ansi -``` - -Or globally if you want to use it as a CLI app: - -``` -npm install --global strip-ansi -``` - -You can then use it in your Terminal like: - -``` -strip-ansi file-with-color-codes -``` - -Or pipe something to it: - -``` -ls | strip-ansi -``` - - -## Example - -```js -var stripAnsi = require('strip-ansi'); -stripAnsi('\x1b[4mcake\x1b[0m'); -//=> cake -``` - - -## License - -MIT © [Sindre Sorhus](http://sindresorhus.com) diff --git a/node_modules/bower/node_modules/inquirer/node_modules/readline2/node_modules/chalk/package.json b/node_modules/bower/node_modules/inquirer/node_modules/readline2/node_modules/chalk/package.json deleted file mode 100644 index 37542d2..0000000 --- a/node_modules/bower/node_modules/inquirer/node_modules/readline2/node_modules/chalk/package.json +++ /dev/null @@ -1,78 +0,0 @@ -{ - "name": "chalk", - "version": "0.4.0", - "description": "Terminal string styling done right. Created because the `colors` module does some really horrible things.", - "license": "MIT", - "repository": { - "type": "git", - "url": "git://github.com/sindresorhus/chalk" - }, - "author": { - "name": "Sindre Sorhus", - "email": "sindresorhus@gmail.com", - "url": "http://sindresorhus.com" - }, - "engines": { - "node": ">=0.8.0" - }, - "scripts": { - "test": "mocha" - }, - "files": [ - "index.js" - ], - "keywords": [ - "color", - "colour", - "colors", - "terminal", - "console", - "cli", - "string", - "ansi", - "styles", - "tty", - "formatting", - "rgb", - "256", - "shell", - "xterm", - "log", - "logging", - "command-line", - "text" - ], - "dependencies": { - "has-color": "~0.1.0", - "ansi-styles": "~1.0.0", - "strip-ansi": "~0.1.0" - }, - "devDependencies": { - "mocha": "~1.x" - }, - "bugs": { - "url": "https://github.com/sindresorhus/chalk/issues" - }, - "homepage": "https://github.com/sindresorhus/chalk", - "_id": "chalk@0.4.0", - "dist": { - "shasum": "5199a3ddcd0c1efe23bc08c1b027b06176e0c64f", - "tarball": "http://registry.npmjs.org/chalk/-/chalk-0.4.0.tgz" - }, - "_from": "chalk@~0.4.0", - "_npmVersion": "1.3.17", - "_npmUser": { - "name": "sindresorhus", - "email": "sindresorhus@gmail.com" - }, - "maintainers": [ - { - "name": "sindresorhus", - "email": "sindresorhus@gmail.com" - } - ], - "directories": {}, - "_shasum": "5199a3ddcd0c1efe23bc08c1b027b06176e0c64f", - "_resolved": "https://registry.npmjs.org/chalk/-/chalk-0.4.0.tgz", - "readme": "ERROR: No README data found!" -} diff --git a/node_modules/bower/node_modules/inquirer/node_modules/readline2/node_modules/chalk/readme.md b/node_modules/bower/node_modules/inquirer/node_modules/readline2/node_modules/chalk/readme.md deleted file mode 100644 index 46813ac..0000000 --- a/node_modules/bower/node_modules/inquirer/node_modules/readline2/node_modules/chalk/readme.md +++ /dev/null @@ -1,158 +0,0 @@ -# chalk - -> Terminal string styling done right - -[![Build Status](https://secure.travis-ci.org/sindresorhus/chalk.png?branch=master)](http://travis-ci.org/sindresorhus/chalk) - -[colors.js](https://github.com/Marak/colors.js) is currently the most popular string styling module, but it has serious deficiencies like extending String.prototype which causes all kinds of [problems](https://github.com/yeoman/yo/issues/68). Although there are other ones, they either do too much or not enough. - -**Chalk is a clean and focused alternative.** - -![screenshot](screenshot.png) - - -## Why - -- **Doesn't extend String.prototype** -- Expressive API -- Clean and focused -- Auto-detects color support -- Actively maintained -- [Used by 150+ modules](https://npmjs.org/browse/depended/chalk) - - -## Install - -Install with [npm](https://npmjs.org/package/chalk): `npm install --save chalk` - - -## Example - -Chalk comes with an easy to use composable API where you just chain and nest the styles you want. - -```js -var chalk = require('chalk'); - -// style a string -console.log( chalk.blue('Hello world!') ); - -// combine styled and normal strings -console.log( chalk.blue('Hello'), 'World' + chalk.red('!') ); - -// compose multiple styles using the chainable API -console.log( chalk.blue.bgRed.bold('Hello world!') ); - -// nest styles -console.log( chalk.red('Hello', chalk.underline.bgBlue('world') + '!') ); - -// pass in multiple arguments -console.log( chalk.blue('Hello', 'World!', 'Foo', 'bar', 'biz', 'baz') ); -``` - -You can easily define your own themes. - -```js -var chalk = require('chalk'); -var error = chalk.bold.red; -console.log(error('Error!')); -``` - - -## API - -### chalk.` - - - - - -
- -

- -

- -

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

- -

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

- -

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

- -

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

- -

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

- -

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

- -

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

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

Collection Functions (Arrays or Objects)

- -

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

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

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

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

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

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

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

-
-var list = [[0, 1], [2, 3], [4, 5]];
-var flat = _.reduceRight(list, function(a, b) { return a.concat(b); }, []);
-=> [4, 5, 2, 3, 0, 1]
-
- -

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Array Functions

- -

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

- -

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

-
-_.range(10);
-=> [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
-_.range(1, 11);
-=> [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
-_.range(0, 30, 5);
-=> [0, 5, 10, 15, 20, 25]
-_.range(0, -10, -1);
-=> [0, -1, -2, -3, -4, -5, -6, -7, -8, -9]
-_.range(0);
-=> []
-
- -

Function (uh, ahem) Functions

- -

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

- -

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

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

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

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

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

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

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

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

- compose_.compose(*functions) -
- Returns the composition of a list of functions, where each function - consumes the return value of the function that follows. In math terms, - composing the functions f(), g(), and h() produces - f(g(h())). -

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

Object Functions

- -

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Utility Functions

- -

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Chaining

- -

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

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

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

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

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

- -

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

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

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

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

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

- -

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

- -

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

- -

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

- -

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

- -

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

- -

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

- -

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

- -

- Ruby's Enumerable module. -

- -

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

- -

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

- -

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

- -

- Python's itertools. -

- -

Change Log

- -

- 1.4.4Jan. 30, 2013Diff
-

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

- -

- 1.4.3Dec. 4, 2012Diff
-

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

- -

- 1.4.2Oct. 1, 2012Diff
-

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

- -

- 1.4.1Oct. 1, 2012Diff
-

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

- -

- 1.4.0Sept. 27, 2012Diff
-

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

- -

- 1.3.3April 10, 2012
-

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

- -

- 1.3.1Jan. 23, 2012
-

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

- -

- 1.3.0Jan. 11, 2012
-

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

- -

- 1.2.4Jan. 4, 2012
-

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

- -

- 1.2.3Dec. 7, 2011
-

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

- -

- 1.2.2Nov. 14, 2011
-

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

- -

- 1.2.1Oct. 24, 2011
-

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

- -

- 1.2.0Oct. 5, 2011
-

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

- -

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

- -

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

- -

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

- -

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

- -

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

- -

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

- -

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

- -

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

- -

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

- -

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

- -

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

- -

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

- -

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

- -

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

- -

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

- -

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

- -

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

- -

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

- -

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

- -

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

- -

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

- -

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

- -

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

- -

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

- -

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

- -

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

- -

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

- -

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

- -

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

- -

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

- -

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

- -

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

- -

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

- -

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

- -

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

- -

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

- -

- 0.1.0
- Initial release of Underscore.js. -

- -

- - A DocumentCloud Project - -

- -
- -
- - - - - - diff --git a/node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/underscore/index.js b/node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/underscore/index.js deleted file mode 100644 index 2cf0ca5..0000000 --- a/node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/underscore/index.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('./underscore'); diff --git a/node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/underscore/package.json b/node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/underscore/package.json deleted file mode 100644 index c58f39c..0000000 --- a/node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/underscore/package.json +++ /dev/null @@ -1,52 +0,0 @@ -{ - "name": "underscore", - "description": "JavaScript's functional programming helper library.", - "homepage": "http://underscorejs.org", - "keywords": [ - "util", - "functional", - "server", - "client", - "browser" - ], - "author": { - "name": "Jeremy Ashkenas", - "email": "jeremy@documentcloud.org" - }, - "repository": { - "type": "git", - "url": "git://github.com/documentcloud/underscore.git" - }, - "main": "underscore.js", - "version": "1.4.4", - "devDependencies": { - "phantomjs": "0.2.2" - }, - "scripts": { - "test": "phantomjs test/vendor/runner.js test/index.html?noglobals=true" - }, - "_id": "underscore@1.4.4", - "dist": { - "shasum": "61a6a32010622afa07963bf325203cf12239d604", - "tarball": "http://registry.npmjs.org/underscore/-/underscore-1.4.4.tgz" - }, - "_npmVersion": "1.1.63", - "_npmUser": { - "name": "jashkenas", - "email": "jashkenas@gmail.com" - }, - "maintainers": [ - { - "name": "jashkenas", - "email": "jashkenas@gmail.com" - } - ], - "directories": {}, - "_shasum": "61a6a32010622afa07963bf325203cf12239d604", - "_from": "underscore@~1.4.3", - "_resolved": "https://registry.npmjs.org/underscore/-/underscore-1.4.4.tgz", - "bugs": { - "url": "https://github.com/documentcloud/underscore/issues" - }, - "readme": "ERROR: No README data found!" -} diff --git a/node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/underscore/underscore-min.js b/node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/underscore/underscore-min.js deleted file mode 100644 index c1d9d3a..0000000 --- a/node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/underscore/underscore-min.js +++ /dev/null @@ -1 +0,0 @@ -(function(){var n=this,t=n._,r={},e=Array.prototype,u=Object.prototype,i=Function.prototype,a=e.push,o=e.slice,c=e.concat,l=u.toString,f=u.hasOwnProperty,s=e.forEach,p=e.map,h=e.reduce,v=e.reduceRight,d=e.filter,g=e.every,m=e.some,y=e.indexOf,b=e.lastIndexOf,x=Array.isArray,_=Object.keys,j=i.bind,w=function(n){return n instanceof w?n:this instanceof w?(this._wrapped=n,void 0):new w(n)};"undefined"!=typeof exports?("undefined"!=typeof module&&module.exports&&(exports=module.exports=w),exports._=w):n._=w,w.VERSION="1.4.4";var A=w.each=w.forEach=function(n,t,e){if(null!=n)if(s&&n.forEach===s)n.forEach(t,e);else if(n.length===+n.length){for(var u=0,i=n.length;i>u;u++)if(t.call(e,n[u],u,n)===r)return}else for(var a in n)if(w.has(n,a)&&t.call(e,n[a],a,n)===r)return};w.map=w.collect=function(n,t,r){var e=[];return null==n?e:p&&n.map===p?n.map(t,r):(A(n,function(n,u,i){e[e.length]=t.call(r,n,u,i)}),e)};var O="Reduce of empty array with no initial value";w.reduce=w.foldl=w.inject=function(n,t,r,e){var u=arguments.length>2;if(null==n&&(n=[]),h&&n.reduce===h)return e&&(t=w.bind(t,e)),u?n.reduce(t,r):n.reduce(t);if(A(n,function(n,i,a){u?r=t.call(e,r,n,i,a):(r=n,u=!0)}),!u)throw new TypeError(O);return r},w.reduceRight=w.foldr=function(n,t,r,e){var u=arguments.length>2;if(null==n&&(n=[]),v&&n.reduceRight===v)return e&&(t=w.bind(t,e)),u?n.reduceRight(t,r):n.reduceRight(t);var i=n.length;if(i!==+i){var a=w.keys(n);i=a.length}if(A(n,function(o,c,l){c=a?a[--i]:--i,u?r=t.call(e,r,n[c],c,l):(r=n[c],u=!0)}),!u)throw new TypeError(O);return r},w.find=w.detect=function(n,t,r){var e;return E(n,function(n,u,i){return t.call(r,n,u,i)?(e=n,!0):void 0}),e},w.filter=w.select=function(n,t,r){var e=[];return null==n?e:d&&n.filter===d?n.filter(t,r):(A(n,function(n,u,i){t.call(r,n,u,i)&&(e[e.length]=n)}),e)},w.reject=function(n,t,r){return w.filter(n,function(n,e,u){return!t.call(r,n,e,u)},r)},w.every=w.all=function(n,t,e){t||(t=w.identity);var u=!0;return null==n?u:g&&n.every===g?n.every(t,e):(A(n,function(n,i,a){return(u=u&&t.call(e,n,i,a))?void 0:r}),!!u)};var E=w.some=w.any=function(n,t,e){t||(t=w.identity);var u=!1;return null==n?u:m&&n.some===m?n.some(t,e):(A(n,function(n,i,a){return u||(u=t.call(e,n,i,a))?r:void 0}),!!u)};w.contains=w.include=function(n,t){return null==n?!1:y&&n.indexOf===y?n.indexOf(t)!=-1:E(n,function(n){return n===t})},w.invoke=function(n,t){var r=o.call(arguments,2),e=w.isFunction(t);return w.map(n,function(n){return(e?t:n[t]).apply(n,r)})},w.pluck=function(n,t){return w.map(n,function(n){return n[t]})},w.where=function(n,t,r){return w.isEmpty(t)?r?null:[]:w[r?"find":"filter"](n,function(n){for(var r in t)if(t[r]!==n[r])return!1;return!0})},w.findWhere=function(n,t){return w.where(n,t,!0)},w.max=function(n,t,r){if(!t&&w.isArray(n)&&n[0]===+n[0]&&65535>n.length)return Math.max.apply(Math,n);if(!t&&w.isEmpty(n))return-1/0;var e={computed:-1/0,value:-1/0};return A(n,function(n,u,i){var a=t?t.call(r,n,u,i):n;a>=e.computed&&(e={value:n,computed:a})}),e.value},w.min=function(n,t,r){if(!t&&w.isArray(n)&&n[0]===+n[0]&&65535>n.length)return Math.min.apply(Math,n);if(!t&&w.isEmpty(n))return 1/0;var e={computed:1/0,value:1/0};return A(n,function(n,u,i){var a=t?t.call(r,n,u,i):n;e.computed>a&&(e={value:n,computed:a})}),e.value},w.shuffle=function(n){var t,r=0,e=[];return A(n,function(n){t=w.random(r++),e[r-1]=e[t],e[t]=n}),e};var k=function(n){return w.isFunction(n)?n:function(t){return t[n]}};w.sortBy=function(n,t,r){var e=k(t);return w.pluck(w.map(n,function(n,t,u){return{value:n,index:t,criteria:e.call(r,n,t,u)}}).sort(function(n,t){var r=n.criteria,e=t.criteria;if(r!==e){if(r>e||r===void 0)return 1;if(e>r||e===void 0)return-1}return n.indexi;){var o=i+a>>>1;u>r.call(e,n[o])?i=o+1:a=o}return i},w.toArray=function(n){return n?w.isArray(n)?o.call(n):n.length===+n.length?w.map(n,w.identity):w.values(n):[]},w.size=function(n){return null==n?0:n.length===+n.length?n.length:w.keys(n).length},w.first=w.head=w.take=function(n,t,r){return null==n?void 0:null==t||r?n[0]:o.call(n,0,t)},w.initial=function(n,t,r){return o.call(n,0,n.length-(null==t||r?1:t))},w.last=function(n,t,r){return null==n?void 0:null==t||r?n[n.length-1]:o.call(n,Math.max(n.length-t,0))},w.rest=w.tail=w.drop=function(n,t,r){return o.call(n,null==t||r?1:t)},w.compact=function(n){return w.filter(n,w.identity)};var R=function(n,t,r){return A(n,function(n){w.isArray(n)?t?a.apply(r,n):R(n,t,r):r.push(n)}),r};w.flatten=function(n,t){return R(n,t,[])},w.without=function(n){return w.difference(n,o.call(arguments,1))},w.uniq=w.unique=function(n,t,r,e){w.isFunction(t)&&(e=r,r=t,t=!1);var u=r?w.map(n,r,e):n,i=[],a=[];return A(u,function(r,e){(t?e&&a[a.length-1]===r:w.contains(a,r))||(a.push(r),i.push(n[e]))}),i},w.union=function(){return w.uniq(c.apply(e,arguments))},w.intersection=function(n){var t=o.call(arguments,1);return w.filter(w.uniq(n),function(n){return w.every(t,function(t){return w.indexOf(t,n)>=0})})},w.difference=function(n){var t=c.apply(e,o.call(arguments,1));return w.filter(n,function(n){return!w.contains(t,n)})},w.zip=function(){for(var n=o.call(arguments),t=w.max(w.pluck(n,"length")),r=Array(t),e=0;t>e;e++)r[e]=w.pluck(n,""+e);return r},w.object=function(n,t){if(null==n)return{};for(var r={},e=0,u=n.length;u>e;e++)t?r[n[e]]=t[e]:r[n[e][0]]=n[e][1];return r},w.indexOf=function(n,t,r){if(null==n)return-1;var e=0,u=n.length;if(r){if("number"!=typeof r)return e=w.sortedIndex(n,t),n[e]===t?e:-1;e=0>r?Math.max(0,u+r):r}if(y&&n.indexOf===y)return n.indexOf(t,r);for(;u>e;e++)if(n[e]===t)return e;return-1},w.lastIndexOf=function(n,t,r){if(null==n)return-1;var e=null!=r;if(b&&n.lastIndexOf===b)return e?n.lastIndexOf(t,r):n.lastIndexOf(t);for(var u=e?r:n.length;u--;)if(n[u]===t)return u;return-1},w.range=function(n,t,r){1>=arguments.length&&(t=n||0,n=0),r=arguments[2]||1;for(var e=Math.max(Math.ceil((t-n)/r),0),u=0,i=Array(e);e>u;)i[u++]=n,n+=r;return i},w.bind=function(n,t){if(n.bind===j&&j)return j.apply(n,o.call(arguments,1));var r=o.call(arguments,2);return function(){return n.apply(t,r.concat(o.call(arguments)))}},w.partial=function(n){var t=o.call(arguments,1);return function(){return n.apply(this,t.concat(o.call(arguments)))}},w.bindAll=function(n){var t=o.call(arguments,1);return 0===t.length&&(t=w.functions(n)),A(t,function(t){n[t]=w.bind(n[t],n)}),n},w.memoize=function(n,t){var r={};return t||(t=w.identity),function(){var e=t.apply(this,arguments);return w.has(r,e)?r[e]:r[e]=n.apply(this,arguments)}},w.delay=function(n,t){var r=o.call(arguments,2);return setTimeout(function(){return n.apply(null,r)},t)},w.defer=function(n){return w.delay.apply(w,[n,1].concat(o.call(arguments,1)))},w.throttle=function(n,t){var r,e,u,i,a=0,o=function(){a=new Date,u=null,i=n.apply(r,e)};return function(){var c=new Date,l=t-(c-a);return r=this,e=arguments,0>=l?(clearTimeout(u),u=null,a=c,i=n.apply(r,e)):u||(u=setTimeout(o,l)),i}},w.debounce=function(n,t,r){var e,u;return function(){var i=this,a=arguments,o=function(){e=null,r||(u=n.apply(i,a))},c=r&&!e;return clearTimeout(e),e=setTimeout(o,t),c&&(u=n.apply(i,a)),u}},w.once=function(n){var t,r=!1;return function(){return r?t:(r=!0,t=n.apply(this,arguments),n=null,t)}},w.wrap=function(n,t){return function(){var r=[n];return a.apply(r,arguments),t.apply(this,r)}},w.compose=function(){var n=arguments;return function(){for(var t=arguments,r=n.length-1;r>=0;r--)t=[n[r].apply(this,t)];return t[0]}},w.after=function(n,t){return 0>=n?t():function(){return 1>--n?t.apply(this,arguments):void 0}},w.keys=_||function(n){if(n!==Object(n))throw new TypeError("Invalid object");var t=[];for(var r in n)w.has(n,r)&&(t[t.length]=r);return t},w.values=function(n){var t=[];for(var r in n)w.has(n,r)&&t.push(n[r]);return t},w.pairs=function(n){var t=[];for(var r in n)w.has(n,r)&&t.push([r,n[r]]);return t},w.invert=function(n){var t={};for(var r in n)w.has(n,r)&&(t[n[r]]=r);return t},w.functions=w.methods=function(n){var t=[];for(var r in n)w.isFunction(n[r])&&t.push(r);return t.sort()},w.extend=function(n){return A(o.call(arguments,1),function(t){if(t)for(var r in t)n[r]=t[r]}),n},w.pick=function(n){var t={},r=c.apply(e,o.call(arguments,1));return A(r,function(r){r in n&&(t[r]=n[r])}),t},w.omit=function(n){var t={},r=c.apply(e,o.call(arguments,1));for(var u in n)w.contains(r,u)||(t[u]=n[u]);return t},w.defaults=function(n){return A(o.call(arguments,1),function(t){if(t)for(var r in t)null==n[r]&&(n[r]=t[r])}),n},w.clone=function(n){return w.isObject(n)?w.isArray(n)?n.slice():w.extend({},n):n},w.tap=function(n,t){return t(n),n};var I=function(n,t,r,e){if(n===t)return 0!==n||1/n==1/t;if(null==n||null==t)return n===t;n instanceof w&&(n=n._wrapped),t instanceof w&&(t=t._wrapped);var u=l.call(n);if(u!=l.call(t))return!1;switch(u){case"[object String]":return n==t+"";case"[object Number]":return n!=+n?t!=+t:0==n?1/n==1/t:n==+t;case"[object Date]":case"[object Boolean]":return+n==+t;case"[object RegExp]":return n.source==t.source&&n.global==t.global&&n.multiline==t.multiline&&n.ignoreCase==t.ignoreCase}if("object"!=typeof n||"object"!=typeof t)return!1;for(var i=r.length;i--;)if(r[i]==n)return e[i]==t;r.push(n),e.push(t);var a=0,o=!0;if("[object Array]"==u){if(a=n.length,o=a==t.length)for(;a--&&(o=I(n[a],t[a],r,e)););}else{var c=n.constructor,f=t.constructor;if(c!==f&&!(w.isFunction(c)&&c instanceof c&&w.isFunction(f)&&f instanceof f))return!1;for(var s in n)if(w.has(n,s)&&(a++,!(o=w.has(t,s)&&I(n[s],t[s],r,e))))break;if(o){for(s in t)if(w.has(t,s)&&!a--)break;o=!a}}return r.pop(),e.pop(),o};w.isEqual=function(n,t){return I(n,t,[],[])},w.isEmpty=function(n){if(null==n)return!0;if(w.isArray(n)||w.isString(n))return 0===n.length;for(var t in n)if(w.has(n,t))return!1;return!0},w.isElement=function(n){return!(!n||1!==n.nodeType)},w.isArray=x||function(n){return"[object Array]"==l.call(n)},w.isObject=function(n){return n===Object(n)},A(["Arguments","Function","String","Number","Date","RegExp"],function(n){w["is"+n]=function(t){return l.call(t)=="[object "+n+"]"}}),w.isArguments(arguments)||(w.isArguments=function(n){return!(!n||!w.has(n,"callee"))}),"function"!=typeof/./&&(w.isFunction=function(n){return"function"==typeof n}),w.isFinite=function(n){return isFinite(n)&&!isNaN(parseFloat(n))},w.isNaN=function(n){return w.isNumber(n)&&n!=+n},w.isBoolean=function(n){return n===!0||n===!1||"[object Boolean]"==l.call(n)},w.isNull=function(n){return null===n},w.isUndefined=function(n){return n===void 0},w.has=function(n,t){return f.call(n,t)},w.noConflict=function(){return n._=t,this},w.identity=function(n){return n},w.times=function(n,t,r){for(var e=Array(n),u=0;n>u;u++)e[u]=t.call(r,u);return e},w.random=function(n,t){return null==t&&(t=n,n=0),n+Math.floor(Math.random()*(t-n+1))};var M={escape:{"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"}};M.unescape=w.invert(M.escape);var S={escape:RegExp("["+w.keys(M.escape).join("")+"]","g"),unescape:RegExp("("+w.keys(M.unescape).join("|")+")","g")};w.each(["escape","unescape"],function(n){w[n]=function(t){return null==t?"":(""+t).replace(S[n],function(t){return M[n][t]})}}),w.result=function(n,t){if(null==n)return null;var r=n[t];return w.isFunction(r)?r.call(n):r},w.mixin=function(n){A(w.functions(n),function(t){var r=w[t]=n[t];w.prototype[t]=function(){var n=[this._wrapped];return a.apply(n,arguments),D.call(this,r.apply(w,n))}})};var N=0;w.uniqueId=function(n){var t=++N+"";return n?n+t:t},w.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g};var T=/(.)^/,q={"'":"'","\\":"\\","\r":"r","\n":"n"," ":"t","\u2028":"u2028","\u2029":"u2029"},B=/\\|'|\r|\n|\t|\u2028|\u2029/g;w.template=function(n,t,r){var e;r=w.defaults({},r,w.templateSettings);var u=RegExp([(r.escape||T).source,(r.interpolate||T).source,(r.evaluate||T).source].join("|")+"|$","g"),i=0,a="__p+='";n.replace(u,function(t,r,e,u,o){return a+=n.slice(i,o).replace(B,function(n){return"\\"+q[n]}),r&&(a+="'+\n((__t=("+r+"))==null?'':_.escape(__t))+\n'"),e&&(a+="'+\n((__t=("+e+"))==null?'':__t)+\n'"),u&&(a+="';\n"+u+"\n__p+='"),i=o+t.length,t}),a+="';\n",r.variable||(a="with(obj||{}){\n"+a+"}\n"),a="var __t,__p='',__j=Array.prototype.join,"+"print=function(){__p+=__j.call(arguments,'');};\n"+a+"return __p;\n";try{e=Function(r.variable||"obj","_",a)}catch(o){throw o.source=a,o}if(t)return e(t,w);var c=function(n){return e.call(this,n,w)};return c.source="function("+(r.variable||"obj")+"){\n"+a+"}",c},w.chain=function(n){return w(n).chain()};var D=function(n){return this._chain?w(n).chain():n};w.mixin(w),A(["pop","push","reverse","shift","sort","splice","unshift"],function(n){var t=e[n];w.prototype[n]=function(){var r=this._wrapped;return t.apply(r,arguments),"shift"!=n&&"splice"!=n||0!==r.length||delete r[0],D.call(this,r)}}),A(["concat","join","slice"],function(n){var t=e[n];w.prototype[n]=function(){return D.call(this,t.apply(this._wrapped,arguments))}}),w.extend(w.prototype,{chain:function(){return this._chain=!0,this},value:function(){return this._wrapped}})}).call(this); \ No newline at end of file diff --git a/node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/underscore/underscore.js b/node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/underscore/underscore.js deleted file mode 100644 index a12f0d9..0000000 --- a/node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/underscore/underscore.js +++ /dev/null @@ -1,1226 +0,0 @@ -// Underscore.js 1.4.4 -// http://underscorejs.org -// (c) 2009-2013 Jeremy Ashkenas, DocumentCloud Inc. -// Underscore may be freely distributed under the MIT license. - -(function() { - - // Baseline setup - // -------------- - - // Establish the root object, `window` in the browser, or `global` on the server. - var root = this; - - // Save the previous value of the `_` variable. - var previousUnderscore = root._; - - // Establish the object that gets returned to break out of a loop iteration. - var breaker = {}; - - // Save bytes in the minified (but not gzipped) version: - var ArrayProto = Array.prototype, ObjProto = Object.prototype, FuncProto = Function.prototype; - - // Create quick reference variables for speed access to core prototypes. - var push = ArrayProto.push, - slice = ArrayProto.slice, - concat = ArrayProto.concat, - toString = ObjProto.toString, - hasOwnProperty = ObjProto.hasOwnProperty; - - // All **ECMAScript 5** native function implementations that we hope to use - // are declared here. - var - nativeForEach = ArrayProto.forEach, - nativeMap = ArrayProto.map, - nativeReduce = ArrayProto.reduce, - nativeReduceRight = ArrayProto.reduceRight, - nativeFilter = ArrayProto.filter, - nativeEvery = ArrayProto.every, - nativeSome = ArrayProto.some, - nativeIndexOf = ArrayProto.indexOf, - nativeLastIndexOf = ArrayProto.lastIndexOf, - nativeIsArray = Array.isArray, - nativeKeys = Object.keys, - nativeBind = FuncProto.bind; - - // Create a safe reference to the Underscore object for use below. - var _ = function(obj) { - if (obj instanceof _) return obj; - if (!(this instanceof _)) return new _(obj); - this._wrapped = obj; - }; - - // Export the Underscore object for **Node.js**, with - // backwards-compatibility for the old `require()` API. If we're in - // the browser, add `_` as a global object via a string identifier, - // for Closure Compiler "advanced" mode. - if (typeof exports !== 'undefined') { - if (typeof module !== 'undefined' && module.exports) { - exports = module.exports = _; - } - exports._ = _; - } else { - root._ = _; - } - - // Current version. - _.VERSION = '1.4.4'; - - // Collection Functions - // -------------------- - - // The cornerstone, an `each` implementation, aka `forEach`. - // Handles objects with the built-in `forEach`, arrays, and raw objects. - // Delegates to **ECMAScript 5**'s native `forEach` if available. - var each = _.each = _.forEach = function(obj, iterator, context) { - if (obj == null) return; - if (nativeForEach && obj.forEach === nativeForEach) { - obj.forEach(iterator, context); - } else if (obj.length === +obj.length) { - for (var i = 0, l = obj.length; i < l; i++) { - if (iterator.call(context, obj[i], i, obj) === breaker) return; - } - } else { - for (var key in obj) { - if (_.has(obj, key)) { - if (iterator.call(context, obj[key], key, obj) === breaker) return; - } - } - } - }; - - // Return the results of applying the iterator to each element. - // Delegates to **ECMAScript 5**'s native `map` if available. - _.map = _.collect = function(obj, iterator, context) { - var results = []; - if (obj == null) return results; - if (nativeMap && obj.map === nativeMap) return obj.map(iterator, context); - each(obj, function(value, index, list) { - results[results.length] = iterator.call(context, value, index, list); - }); - return results; - }; - - var reduceError = 'Reduce of empty array with no initial value'; - - // **Reduce** builds up a single result from a list of values, aka `inject`, - // or `foldl`. Delegates to **ECMAScript 5**'s native `reduce` if available. - _.reduce = _.foldl = _.inject = function(obj, iterator, memo, context) { - var initial = arguments.length > 2; - if (obj == null) obj = []; - if (nativeReduce && obj.reduce === nativeReduce) { - if (context) iterator = _.bind(iterator, context); - return initial ? obj.reduce(iterator, memo) : obj.reduce(iterator); - } - each(obj, function(value, index, list) { - if (!initial) { - memo = value; - initial = true; - } else { - memo = iterator.call(context, memo, value, index, list); - } - }); - if (!initial) throw new TypeError(reduceError); - return memo; - }; - - // The right-associative version of reduce, also known as `foldr`. - // Delegates to **ECMAScript 5**'s native `reduceRight` if available. - _.reduceRight = _.foldr = function(obj, iterator, memo, context) { - var initial = arguments.length > 2; - if (obj == null) obj = []; - if (nativeReduceRight && obj.reduceRight === nativeReduceRight) { - if (context) iterator = _.bind(iterator, context); - return initial ? obj.reduceRight(iterator, memo) : obj.reduceRight(iterator); - } - var length = obj.length; - if (length !== +length) { - var keys = _.keys(obj); - length = keys.length; - } - each(obj, function(value, index, list) { - index = keys ? keys[--length] : --length; - if (!initial) { - memo = obj[index]; - initial = true; - } else { - memo = iterator.call(context, memo, obj[index], index, list); - } - }); - if (!initial) throw new TypeError(reduceError); - return memo; - }; - - // Return the first value which passes a truth test. Aliased as `detect`. - _.find = _.detect = function(obj, iterator, context) { - var result; - any(obj, function(value, index, list) { - if (iterator.call(context, value, index, list)) { - result = value; - return true; - } - }); - return result; - }; - - // Return all the elements that pass a truth test. - // Delegates to **ECMAScript 5**'s native `filter` if available. - // Aliased as `select`. - _.filter = _.select = function(obj, iterator, context) { - var results = []; - if (obj == null) return results; - if (nativeFilter && obj.filter === nativeFilter) return obj.filter(iterator, context); - each(obj, function(value, index, list) { - if (iterator.call(context, value, index, list)) results[results.length] = value; - }); - return results; - }; - - // Return all the elements for which a truth test fails. - _.reject = function(obj, iterator, context) { - return _.filter(obj, function(value, index, list) { - return !iterator.call(context, value, index, list); - }, context); - }; - - // Determine whether all of the elements match a truth test. - // Delegates to **ECMAScript 5**'s native `every` if available. - // Aliased as `all`. - _.every = _.all = function(obj, iterator, context) { - iterator || (iterator = _.identity); - var result = true; - if (obj == null) return result; - if (nativeEvery && obj.every === nativeEvery) return obj.every(iterator, context); - each(obj, function(value, index, list) { - if (!(result = result && iterator.call(context, value, index, list))) return breaker; - }); - return !!result; - }; - - // Determine if at least one element in the object matches a truth test. - // Delegates to **ECMAScript 5**'s native `some` if available. - // Aliased as `any`. - var any = _.some = _.any = function(obj, iterator, context) { - iterator || (iterator = _.identity); - var result = false; - if (obj == null) return result; - if (nativeSome && obj.some === nativeSome) return obj.some(iterator, context); - each(obj, function(value, index, list) { - if (result || (result = iterator.call(context, value, index, list))) return breaker; - }); - return !!result; - }; - - // Determine if the array or object contains a given value (using `===`). - // Aliased as `include`. - _.contains = _.include = function(obj, target) { - if (obj == null) return false; - if (nativeIndexOf && obj.indexOf === nativeIndexOf) return obj.indexOf(target) != -1; - return any(obj, function(value) { - return value === target; - }); - }; - - // Invoke a method (with arguments) on every item in a collection. - _.invoke = function(obj, method) { - var args = slice.call(arguments, 2); - var isFunc = _.isFunction(method); - return _.map(obj, function(value) { - return (isFunc ? method : value[method]).apply(value, args); - }); - }; - - // Convenience version of a common use case of `map`: fetching a property. - _.pluck = function(obj, key) { - return _.map(obj, function(value){ return value[key]; }); - }; - - // Convenience version of a common use case of `filter`: selecting only objects - // containing specific `key:value` pairs. - _.where = function(obj, attrs, first) { - if (_.isEmpty(attrs)) return first ? null : []; - return _[first ? 'find' : 'filter'](obj, function(value) { - for (var key in attrs) { - if (attrs[key] !== value[key]) return false; - } - return true; - }); - }; - - // Convenience version of a common use case of `find`: getting the first object - // containing specific `key:value` pairs. - _.findWhere = function(obj, attrs) { - return _.where(obj, attrs, true); - }; - - // Return the maximum element or (element-based computation). - // Can't optimize arrays of integers longer than 65,535 elements. - // See: https://bugs.webkit.org/show_bug.cgi?id=80797 - _.max = function(obj, iterator, context) { - if (!iterator && _.isArray(obj) && obj[0] === +obj[0] && obj.length < 65535) { - return Math.max.apply(Math, obj); - } - if (!iterator && _.isEmpty(obj)) return -Infinity; - var result = {computed : -Infinity, value: -Infinity}; - each(obj, function(value, index, list) { - var computed = iterator ? iterator.call(context, value, index, list) : value; - computed >= result.computed && (result = {value : value, computed : computed}); - }); - return result.value; - }; - - // Return the minimum element (or element-based computation). - _.min = function(obj, iterator, context) { - if (!iterator && _.isArray(obj) && obj[0] === +obj[0] && obj.length < 65535) { - return Math.min.apply(Math, obj); - } - if (!iterator && _.isEmpty(obj)) return Infinity; - var result = {computed : Infinity, value: Infinity}; - each(obj, function(value, index, list) { - var computed = iterator ? iterator.call(context, value, index, list) : value; - computed < result.computed && (result = {value : value, computed : computed}); - }); - return result.value; - }; - - // Shuffle an array. - _.shuffle = function(obj) { - var rand; - var index = 0; - var shuffled = []; - each(obj, function(value) { - rand = _.random(index++); - shuffled[index - 1] = shuffled[rand]; - shuffled[rand] = value; - }); - return shuffled; - }; - - // An internal function to generate lookup iterators. - var lookupIterator = function(value) { - return _.isFunction(value) ? value : function(obj){ return obj[value]; }; - }; - - // Sort the object's values by a criterion produced by an iterator. - _.sortBy = function(obj, value, context) { - var iterator = lookupIterator(value); - return _.pluck(_.map(obj, function(value, index, list) { - return { - value : value, - index : index, - criteria : iterator.call(context, value, index, list) - }; - }).sort(function(left, right) { - var a = left.criteria; - var b = right.criteria; - if (a !== b) { - if (a > b || a === void 0) return 1; - if (a < b || b === void 0) return -1; - } - return left.index < right.index ? -1 : 1; - }), 'value'); - }; - - // An internal function used for aggregate "group by" operations. - var group = function(obj, value, context, behavior) { - var result = {}; - var iterator = lookupIterator(value || _.identity); - each(obj, function(value, index) { - var key = iterator.call(context, value, index, obj); - behavior(result, key, value); - }); - return result; - }; - - // Groups the object's values by a criterion. Pass either a string attribute - // to group by, or a function that returns the criterion. - _.groupBy = function(obj, value, context) { - return group(obj, value, context, function(result, key, value) { - (_.has(result, key) ? result[key] : (result[key] = [])).push(value); - }); - }; - - // Counts instances of an object that group by a certain criterion. Pass - // either a string attribute to count by, or a function that returns the - // criterion. - _.countBy = function(obj, value, context) { - return group(obj, value, context, function(result, key) { - if (!_.has(result, key)) result[key] = 0; - result[key]++; - }); - }; - - // Use a comparator function to figure out the smallest index at which - // an object should be inserted so as to maintain order. Uses binary search. - _.sortedIndex = function(array, obj, iterator, context) { - iterator = iterator == null ? _.identity : lookupIterator(iterator); - var value = iterator.call(context, obj); - var low = 0, high = array.length; - while (low < high) { - var mid = (low + high) >>> 1; - iterator.call(context, array[mid]) < value ? low = mid + 1 : high = mid; - } - return low; - }; - - // Safely convert anything iterable into a real, live array. - _.toArray = function(obj) { - if (!obj) return []; - if (_.isArray(obj)) return slice.call(obj); - if (obj.length === +obj.length) return _.map(obj, _.identity); - return _.values(obj); - }; - - // Return the number of elements in an object. - _.size = function(obj) { - if (obj == null) return 0; - return (obj.length === +obj.length) ? obj.length : _.keys(obj).length; - }; - - // Array Functions - // --------------- - - // Get the first element of an array. Passing **n** will return the first N - // values in the array. Aliased as `head` and `take`. The **guard** check - // allows it to work with `_.map`. - _.first = _.head = _.take = function(array, n, guard) { - if (array == null) return void 0; - return (n != null) && !guard ? slice.call(array, 0, n) : array[0]; - }; - - // Returns everything but the last entry of the array. Especially useful on - // the arguments object. Passing **n** will return all the values in - // the array, excluding the last N. The **guard** check allows it to work with - // `_.map`. - _.initial = function(array, n, guard) { - return slice.call(array, 0, array.length - ((n == null) || guard ? 1 : n)); - }; - - // Get the last element of an array. Passing **n** will return the last N - // values in the array. The **guard** check allows it to work with `_.map`. - _.last = function(array, n, guard) { - if (array == null) return void 0; - if ((n != null) && !guard) { - return slice.call(array, Math.max(array.length - n, 0)); - } else { - return array[array.length - 1]; - } - }; - - // Returns everything but the first entry of the array. Aliased as `tail` and `drop`. - // Especially useful on the arguments object. Passing an **n** will return - // the rest N values in the array. The **guard** - // check allows it to work with `_.map`. - _.rest = _.tail = _.drop = function(array, n, guard) { - return slice.call(array, (n == null) || guard ? 1 : n); - }; - - // Trim out all falsy values from an array. - _.compact = function(array) { - return _.filter(array, _.identity); - }; - - // Internal implementation of a recursive `flatten` function. - var flatten = function(input, shallow, output) { - each(input, function(value) { - if (_.isArray(value)) { - shallow ? push.apply(output, value) : flatten(value, shallow, output); - } else { - output.push(value); - } - }); - return output; - }; - - // Return a completely flattened version of an array. - _.flatten = function(array, shallow) { - return flatten(array, shallow, []); - }; - - // Return a version of the array that does not contain the specified value(s). - _.without = function(array) { - return _.difference(array, slice.call(arguments, 1)); - }; - - // Produce a duplicate-free version of the array. If the array has already - // been sorted, you have the option of using a faster algorithm. - // Aliased as `unique`. - _.uniq = _.unique = function(array, isSorted, iterator, context) { - if (_.isFunction(isSorted)) { - context = iterator; - iterator = isSorted; - isSorted = false; - } - var initial = iterator ? _.map(array, iterator, context) : array; - var results = []; - var seen = []; - each(initial, function(value, index) { - if (isSorted ? (!index || seen[seen.length - 1] !== value) : !_.contains(seen, value)) { - seen.push(value); - results.push(array[index]); - } - }); - return results; - }; - - // Produce an array that contains the union: each distinct element from all of - // the passed-in arrays. - _.union = function() { - return _.uniq(concat.apply(ArrayProto, arguments)); - }; - - // Produce an array that contains every item shared between all the - // passed-in arrays. - _.intersection = function(array) { - var rest = slice.call(arguments, 1); - return _.filter(_.uniq(array), function(item) { - return _.every(rest, function(other) { - return _.indexOf(other, item) >= 0; - }); - }); - }; - - // Take the difference between one array and a number of other arrays. - // Only the elements present in just the first array will remain. - _.difference = function(array) { - var rest = concat.apply(ArrayProto, slice.call(arguments, 1)); - return _.filter(array, function(value){ return !_.contains(rest, value); }); - }; - - // Zip together multiple lists into a single array -- elements that share - // an index go together. - _.zip = function() { - var args = slice.call(arguments); - var length = _.max(_.pluck(args, 'length')); - var results = new Array(length); - for (var i = 0; i < length; i++) { - results[i] = _.pluck(args, "" + i); - } - return results; - }; - - // Converts lists into objects. Pass either a single array of `[key, value]` - // pairs, or two parallel arrays of the same length -- one of keys, and one of - // the corresponding values. - _.object = function(list, values) { - if (list == null) return {}; - var result = {}; - for (var i = 0, l = list.length; i < l; i++) { - if (values) { - result[list[i]] = values[i]; - } else { - result[list[i][0]] = list[i][1]; - } - } - return result; - }; - - // If the browser doesn't supply us with indexOf (I'm looking at you, **MSIE**), - // we need this function. Return the position of the first occurrence of an - // item in an array, or -1 if the item is not included in the array. - // Delegates to **ECMAScript 5**'s native `indexOf` if available. - // If the array is large and already in sort order, pass `true` - // for **isSorted** to use binary search. - _.indexOf = function(array, item, isSorted) { - if (array == null) return -1; - var i = 0, l = array.length; - if (isSorted) { - if (typeof isSorted == 'number') { - i = (isSorted < 0 ? Math.max(0, l + isSorted) : isSorted); - } else { - i = _.sortedIndex(array, item); - return array[i] === item ? i : -1; - } - } - if (nativeIndexOf && array.indexOf === nativeIndexOf) return array.indexOf(item, isSorted); - for (; i < l; i++) if (array[i] === item) return i; - return -1; - }; - - // Delegates to **ECMAScript 5**'s native `lastIndexOf` if available. - _.lastIndexOf = function(array, item, from) { - if (array == null) return -1; - var hasIndex = from != null; - if (nativeLastIndexOf && array.lastIndexOf === nativeLastIndexOf) { - return hasIndex ? array.lastIndexOf(item, from) : array.lastIndexOf(item); - } - var i = (hasIndex ? from : array.length); - while (i--) if (array[i] === item) return i; - return -1; - }; - - // Generate an integer Array containing an arithmetic progression. A port of - // the native Python `range()` function. See - // [the Python documentation](http://docs.python.org/library/functions.html#range). - _.range = function(start, stop, step) { - if (arguments.length <= 1) { - stop = start || 0; - start = 0; - } - step = arguments[2] || 1; - - var len = Math.max(Math.ceil((stop - start) / step), 0); - var idx = 0; - var range = new Array(len); - - while(idx < len) { - range[idx++] = start; - start += step; - } - - return range; - }; - - // Function (ahem) Functions - // ------------------ - - // Create a function bound to a given object (assigning `this`, and arguments, - // optionally). Delegates to **ECMAScript 5**'s native `Function.bind` if - // available. - _.bind = function(func, context) { - if (func.bind === nativeBind && nativeBind) return nativeBind.apply(func, slice.call(arguments, 1)); - var args = slice.call(arguments, 2); - return function() { - return func.apply(context, args.concat(slice.call(arguments))); - }; - }; - - // Partially apply a function by creating a version that has had some of its - // arguments pre-filled, without changing its dynamic `this` context. - _.partial = function(func) { - var args = slice.call(arguments, 1); - return function() { - return func.apply(this, args.concat(slice.call(arguments))); - }; - }; - - // Bind all of an object's methods to that object. Useful for ensuring that - // all callbacks defined on an object belong to it. - _.bindAll = function(obj) { - var funcs = slice.call(arguments, 1); - if (funcs.length === 0) funcs = _.functions(obj); - each(funcs, function(f) { obj[f] = _.bind(obj[f], obj); }); - return obj; - }; - - // Memoize an expensive function by storing its results. - _.memoize = function(func, hasher) { - var memo = {}; - hasher || (hasher = _.identity); - return function() { - var key = hasher.apply(this, arguments); - return _.has(memo, key) ? memo[key] : (memo[key] = func.apply(this, arguments)); - }; - }; - - // Delays a function for the given number of milliseconds, and then calls - // it with the arguments supplied. - _.delay = function(func, wait) { - var args = slice.call(arguments, 2); - return setTimeout(function(){ return func.apply(null, args); }, wait); - }; - - // Defers a function, scheduling it to run after the current call stack has - // cleared. - _.defer = function(func) { - return _.delay.apply(_, [func, 1].concat(slice.call(arguments, 1))); - }; - - // Returns a function, that, when invoked, will only be triggered at most once - // during a given window of time. - _.throttle = function(func, wait) { - var context, args, timeout, result; - var previous = 0; - var later = function() { - previous = new Date; - timeout = null; - result = func.apply(context, args); - }; - return function() { - var now = new Date; - var remaining = wait - (now - previous); - context = this; - args = arguments; - if (remaining <= 0) { - clearTimeout(timeout); - timeout = null; - previous = now; - result = func.apply(context, args); - } else if (!timeout) { - timeout = setTimeout(later, remaining); - } - return result; - }; - }; - - // Returns a function, that, as long as it continues to be invoked, will not - // be triggered. The function will be called after it stops being called for - // N milliseconds. If `immediate` is passed, trigger the function on the - // leading edge, instead of the trailing. - _.debounce = function(func, wait, immediate) { - var timeout, result; - return function() { - var context = this, args = arguments; - var later = function() { - timeout = null; - if (!immediate) result = func.apply(context, args); - }; - var callNow = immediate && !timeout; - clearTimeout(timeout); - timeout = setTimeout(later, wait); - if (callNow) result = func.apply(context, args); - return result; - }; - }; - - // Returns a function that will be executed at most one time, no matter how - // often you call it. Useful for lazy initialization. - _.once = function(func) { - var ran = false, memo; - return function() { - if (ran) return memo; - ran = true; - memo = func.apply(this, arguments); - func = null; - return memo; - }; - }; - - // Returns the first function passed as an argument to the second, - // allowing you to adjust arguments, run code before and after, and - // conditionally execute the original function. - _.wrap = function(func, wrapper) { - return function() { - var args = [func]; - push.apply(args, arguments); - return wrapper.apply(this, args); - }; - }; - - // Returns a function that is the composition of a list of functions, each - // consuming the return value of the function that follows. - _.compose = function() { - var funcs = arguments; - return function() { - var args = arguments; - for (var i = funcs.length - 1; i >= 0; i--) { - args = [funcs[i].apply(this, args)]; - } - return args[0]; - }; - }; - - // Returns a function that will only be executed after being called N times. - _.after = function(times, func) { - if (times <= 0) return func(); - return function() { - if (--times < 1) { - return func.apply(this, arguments); - } - }; - }; - - // Object Functions - // ---------------- - - // Retrieve the names of an object's properties. - // Delegates to **ECMAScript 5**'s native `Object.keys` - _.keys = nativeKeys || function(obj) { - if (obj !== Object(obj)) throw new TypeError('Invalid object'); - var keys = []; - for (var key in obj) if (_.has(obj, key)) keys[keys.length] = key; - return keys; - }; - - // Retrieve the values of an object's properties. - _.values = function(obj) { - var values = []; - for (var key in obj) if (_.has(obj, key)) values.push(obj[key]); - return values; - }; - - // Convert an object into a list of `[key, value]` pairs. - _.pairs = function(obj) { - var pairs = []; - for (var key in obj) if (_.has(obj, key)) pairs.push([key, obj[key]]); - return pairs; - }; - - // Invert the keys and values of an object. The values must be serializable. - _.invert = function(obj) { - var result = {}; - for (var key in obj) if (_.has(obj, key)) result[obj[key]] = key; - return result; - }; - - // Return a sorted list of the function names available on the object. - // Aliased as `methods` - _.functions = _.methods = function(obj) { - var names = []; - for (var key in obj) { - if (_.isFunction(obj[key])) names.push(key); - } - return names.sort(); - }; - - // Extend a given object with all the properties in passed-in object(s). - _.extend = function(obj) { - each(slice.call(arguments, 1), function(source) { - if (source) { - for (var prop in source) { - obj[prop] = source[prop]; - } - } - }); - return obj; - }; - - // Return a copy of the object only containing the whitelisted properties. - _.pick = function(obj) { - var copy = {}; - var keys = concat.apply(ArrayProto, slice.call(arguments, 1)); - each(keys, function(key) { - if (key in obj) copy[key] = obj[key]; - }); - return copy; - }; - - // Return a copy of the object without the blacklisted properties. - _.omit = function(obj) { - var copy = {}; - var keys = concat.apply(ArrayProto, slice.call(arguments, 1)); - for (var key in obj) { - if (!_.contains(keys, key)) copy[key] = obj[key]; - } - return copy; - }; - - // Fill in a given object with default properties. - _.defaults = function(obj) { - each(slice.call(arguments, 1), function(source) { - if (source) { - for (var prop in source) { - if (obj[prop] == null) obj[prop] = source[prop]; - } - } - }); - return obj; - }; - - // Create a (shallow-cloned) duplicate of an object. - _.clone = function(obj) { - if (!_.isObject(obj)) return obj; - return _.isArray(obj) ? obj.slice() : _.extend({}, obj); - }; - - // Invokes interceptor with the obj, and then returns obj. - // The primary purpose of this method is to "tap into" a method chain, in - // order to perform operations on intermediate results within the chain. - _.tap = function(obj, interceptor) { - interceptor(obj); - return obj; - }; - - // Internal recursive comparison function for `isEqual`. - var eq = function(a, b, aStack, bStack) { - // Identical objects are equal. `0 === -0`, but they aren't identical. - // See the Harmony `egal` proposal: http://wiki.ecmascript.org/doku.php?id=harmony:egal. - if (a === b) return a !== 0 || 1 / a == 1 / b; - // A strict comparison is necessary because `null == undefined`. - if (a == null || b == null) return a === b; - // Unwrap any wrapped objects. - if (a instanceof _) a = a._wrapped; - if (b instanceof _) b = b._wrapped; - // Compare `[[Class]]` names. - var className = toString.call(a); - if (className != toString.call(b)) return false; - switch (className) { - // Strings, numbers, dates, and booleans are compared by value. - case '[object String]': - // Primitives and their corresponding object wrappers are equivalent; thus, `"5"` is - // equivalent to `new String("5")`. - return a == String(b); - case '[object Number]': - // `NaN`s are equivalent, but non-reflexive. An `egal` comparison is performed for - // other numeric values. - return a != +a ? b != +b : (a == 0 ? 1 / a == 1 / b : a == +b); - case '[object Date]': - case '[object Boolean]': - // Coerce dates and booleans to numeric primitive values. Dates are compared by their - // millisecond representations. Note that invalid dates with millisecond representations - // of `NaN` are not equivalent. - return +a == +b; - // RegExps are compared by their source patterns and flags. - case '[object RegExp]': - return a.source == b.source && - a.global == b.global && - a.multiline == b.multiline && - a.ignoreCase == b.ignoreCase; - } - if (typeof a != 'object' || typeof b != 'object') return false; - // Assume equality for cyclic structures. The algorithm for detecting cyclic - // structures is adapted from ES 5.1 section 15.12.3, abstract operation `JO`. - var length = aStack.length; - while (length--) { - // Linear search. Performance is inversely proportional to the number of - // unique nested structures. - if (aStack[length] == a) return bStack[length] == b; - } - // Add the first object to the stack of traversed objects. - aStack.push(a); - bStack.push(b); - var size = 0, result = true; - // Recursively compare objects and arrays. - if (className == '[object Array]') { - // Compare array lengths to determine if a deep comparison is necessary. - size = a.length; - result = size == b.length; - if (result) { - // Deep compare the contents, ignoring non-numeric properties. - while (size--) { - if (!(result = eq(a[size], b[size], aStack, bStack))) break; - } - } - } else { - // Objects with different constructors are not equivalent, but `Object`s - // from different frames are. - var aCtor = a.constructor, bCtor = b.constructor; - if (aCtor !== bCtor && !(_.isFunction(aCtor) && (aCtor instanceof aCtor) && - _.isFunction(bCtor) && (bCtor instanceof bCtor))) { - return false; - } - // Deep compare objects. - for (var key in a) { - if (_.has(a, key)) { - // Count the expected number of properties. - size++; - // Deep compare each member. - if (!(result = _.has(b, key) && eq(a[key], b[key], aStack, bStack))) break; - } - } - // Ensure that both objects contain the same number of properties. - if (result) { - for (key in b) { - if (_.has(b, key) && !(size--)) break; - } - result = !size; - } - } - // Remove the first object from the stack of traversed objects. - aStack.pop(); - bStack.pop(); - return result; - }; - - // Perform a deep comparison to check if two objects are equal. - _.isEqual = function(a, b) { - return eq(a, b, [], []); - }; - - // Is a given array, string, or object empty? - // An "empty" object has no enumerable own-properties. - _.isEmpty = function(obj) { - if (obj == null) return true; - if (_.isArray(obj) || _.isString(obj)) return obj.length === 0; - for (var key in obj) if (_.has(obj, key)) return false; - return true; - }; - - // Is a given value a DOM element? - _.isElement = function(obj) { - return !!(obj && obj.nodeType === 1); - }; - - // Is a given value an array? - // Delegates to ECMA5's native Array.isArray - _.isArray = nativeIsArray || function(obj) { - return toString.call(obj) == '[object Array]'; - }; - - // Is a given variable an object? - _.isObject = function(obj) { - return obj === Object(obj); - }; - - // Add some isType methods: isArguments, isFunction, isString, isNumber, isDate, isRegExp. - each(['Arguments', 'Function', 'String', 'Number', 'Date', 'RegExp'], function(name) { - _['is' + name] = function(obj) { - return toString.call(obj) == '[object ' + name + ']'; - }; - }); - - // Define a fallback version of the method in browsers (ahem, IE), where - // there isn't any inspectable "Arguments" type. - if (!_.isArguments(arguments)) { - _.isArguments = function(obj) { - return !!(obj && _.has(obj, 'callee')); - }; - } - - // Optimize `isFunction` if appropriate. - if (typeof (/./) !== 'function') { - _.isFunction = function(obj) { - return typeof obj === 'function'; - }; - } - - // Is a given object a finite number? - _.isFinite = function(obj) { - return isFinite(obj) && !isNaN(parseFloat(obj)); - }; - - // Is the given value `NaN`? (NaN is the only number which does not equal itself). - _.isNaN = function(obj) { - return _.isNumber(obj) && obj != +obj; - }; - - // Is a given value a boolean? - _.isBoolean = function(obj) { - return obj === true || obj === false || toString.call(obj) == '[object Boolean]'; - }; - - // Is a given value equal to null? - _.isNull = function(obj) { - return obj === null; - }; - - // Is a given variable undefined? - _.isUndefined = function(obj) { - return obj === void 0; - }; - - // Shortcut function for checking if an object has a given property directly - // on itself (in other words, not on a prototype). - _.has = function(obj, key) { - return hasOwnProperty.call(obj, key); - }; - - // Utility Functions - // ----------------- - - // Run Underscore.js in *noConflict* mode, returning the `_` variable to its - // previous owner. Returns a reference to the Underscore object. - _.noConflict = function() { - root._ = previousUnderscore; - return this; - }; - - // Keep the identity function around for default iterators. - _.identity = function(value) { - return value; - }; - - // Run a function **n** times. - _.times = function(n, iterator, context) { - var accum = Array(n); - for (var i = 0; i < n; i++) accum[i] = iterator.call(context, i); - return accum; - }; - - // Return a random integer between min and max (inclusive). - _.random = function(min, max) { - if (max == null) { - max = min; - min = 0; - } - return min + Math.floor(Math.random() * (max - min + 1)); - }; - - // List of HTML entities for escaping. - var entityMap = { - escape: { - '&': '&', - '<': '<', - '>': '>', - '"': '"', - "'": ''', - '/': '/' - } - }; - entityMap.unescape = _.invert(entityMap.escape); - - // Regexes containing the keys and values listed immediately above. - var entityRegexes = { - escape: new RegExp('[' + _.keys(entityMap.escape).join('') + ']', 'g'), - unescape: new RegExp('(' + _.keys(entityMap.unescape).join('|') + ')', 'g') - }; - - // Functions for escaping and unescaping strings to/from HTML interpolation. - _.each(['escape', 'unescape'], function(method) { - _[method] = function(string) { - if (string == null) return ''; - return ('' + string).replace(entityRegexes[method], function(match) { - return entityMap[method][match]; - }); - }; - }); - - // If the value of the named property is a function then invoke it; - // otherwise, return it. - _.result = function(object, property) { - if (object == null) return null; - var value = object[property]; - return _.isFunction(value) ? value.call(object) : value; - }; - - // Add your own custom functions to the Underscore object. - _.mixin = function(obj) { - each(_.functions(obj), function(name){ - var func = _[name] = obj[name]; - _.prototype[name] = function() { - var args = [this._wrapped]; - push.apply(args, arguments); - return result.call(this, func.apply(_, args)); - }; - }); - }; - - // Generate a unique integer id (unique within the entire client session). - // Useful for temporary DOM ids. - var idCounter = 0; - _.uniqueId = function(prefix) { - var id = ++idCounter + ''; - return prefix ? prefix + id : id; - }; - - // By default, Underscore uses ERB-style template delimiters, change the - // following template settings to use alternative delimiters. - _.templateSettings = { - evaluate : /<%([\s\S]+?)%>/g, - interpolate : /<%=([\s\S]+?)%>/g, - escape : /<%-([\s\S]+?)%>/g - }; - - // When customizing `templateSettings`, if you don't want to define an - // interpolation, evaluation or escaping regex, we need one that is - // guaranteed not to match. - var noMatch = /(.)^/; - - // Certain characters need to be escaped so that they can be put into a - // string literal. - var escapes = { - "'": "'", - '\\': '\\', - '\r': 'r', - '\n': 'n', - '\t': 't', - '\u2028': 'u2028', - '\u2029': 'u2029' - }; - - var escaper = /\\|'|\r|\n|\t|\u2028|\u2029/g; - - // JavaScript micro-templating, similar to John Resig's implementation. - // Underscore templating handles arbitrary delimiters, preserves whitespace, - // and correctly escapes quotes within interpolated code. - _.template = function(text, data, settings) { - var render; - settings = _.defaults({}, settings, _.templateSettings); - - // Combine delimiters into one regular expression via alternation. - var matcher = new RegExp([ - (settings.escape || noMatch).source, - (settings.interpolate || noMatch).source, - (settings.evaluate || noMatch).source - ].join('|') + '|$', 'g'); - - // Compile the template source, escaping string literals appropriately. - var index = 0; - var source = "__p+='"; - text.replace(matcher, function(match, escape, interpolate, evaluate, offset) { - source += text.slice(index, offset) - .replace(escaper, function(match) { return '\\' + escapes[match]; }); - - if (escape) { - source += "'+\n((__t=(" + escape + "))==null?'':_.escape(__t))+\n'"; - } - if (interpolate) { - source += "'+\n((__t=(" + interpolate + "))==null?'':__t)+\n'"; - } - if (evaluate) { - source += "';\n" + evaluate + "\n__p+='"; - } - index = offset + match.length; - return match; - }); - source += "';\n"; - - // If a variable is not specified, place data values in local scope. - if (!settings.variable) source = 'with(obj||{}){\n' + source + '}\n'; - - source = "var __t,__p='',__j=Array.prototype.join," + - "print=function(){__p+=__j.call(arguments,'');};\n" + - source + "return __p;\n"; - - try { - render = new Function(settings.variable || 'obj', '_', source); - } catch (e) { - e.source = source; - throw e; - } - - if (data) return render(data, _); - var template = function(data) { - return render.call(this, data, _); - }; - - // Provide the compiled function source as a convenience for precompilation. - template.source = 'function(' + (settings.variable || 'obj') + '){\n' + source + '}'; - - return template; - }; - - // Add a "chain" function, which will delegate to the wrapper. - _.chain = function(obj) { - return _(obj).chain(); - }; - - // OOP - // --------------- - // If Underscore is called as a function, it returns a wrapped object that - // can be used OO-style. This wrapper holds altered versions of all the - // underscore functions. Wrapped objects may be chained. - - // Helper function to continue chaining intermediate results. - var result = function(obj) { - return this._chain ? _(obj).chain() : obj; - }; - - // Add all of the Underscore functions to the wrapper object. - _.mixin(_); - - // Add all mutator Array functions to the wrapper. - each(['pop', 'push', 'reverse', 'shift', 'sort', 'splice', 'unshift'], function(name) { - var method = ArrayProto[name]; - _.prototype[name] = function() { - var obj = this._wrapped; - method.apply(obj, arguments); - if ((name == 'shift' || name == 'splice') && obj.length === 0) delete obj[0]; - return result.call(this, obj); - }; - }); - - // Add all accessor Array functions to the wrapper. - each(['concat', 'join', 'slice'], function(name) { - var method = ArrayProto[name]; - _.prototype[name] = function() { - return result.call(this, method.apply(this._wrapped, arguments)); - }; - }); - - _.extend(_.prototype, { - - // Start chaining a wrapped Underscore object. - chain: function() { - this._chain = true; - return this; - }, - - // Extracts the result from a wrapped and chained object. - value: function() { - return this._wrapped; - } - - }); - -}).call(this); diff --git a/node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/package.json b/node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/package.json index 19c13e2..656f6fa 100644 --- a/node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/package.json +++ b/node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/package.json @@ -1,7 +1,7 @@ { "name": "argparse", "description": "Very powerful CLI arguments parser. Native port of argparse - python's options parsing library", - "version": "0.1.15", + "version": "1.0.1", "keywords": [ "cli", "parser", @@ -21,10 +21,7 @@ "bugs": { "url": "https://github.com/nodeca/argparse/issues" }, - "license": { - "type": "MIT", - "url": "https://github.com/nodeca/argparse/blob/master/LICENSE" - }, + "license": "MIT", "repository": { "type": "git", "url": "git://github.com/nodeca/argparse.git" @@ -34,25 +31,17 @@ "test": "make test" }, "dependencies": { - "underscore": "~1.4.3", - "underscore.string": "~2.3.1" + "lodash": "~3.2", + "sprintf-js": "~1.0.2" }, "devDependencies": { "mocha": "*" }, - "engines": { - "node": ">= 0.6.0" - }, - "readme": "argparse\n========\n\n[![Build Status](https://secure.travis-ci.org/nodeca/argparse.png?branch=master)](http://travis-ci.org/nodeca/argparse)\n\nCLI arguments parser for node.js. Javascript port of python's\n[argparse](http://docs.python.org/dev/library/argparse.html) module\n(original version 3.2). That's a full port, except some very rare options,\nrecorded in issue tracker.\n\n**NB.** Method names changed to camelCase. See [generated docs](http://nodeca.github.com/argparse/).\n\n\nExample\n=======\n\ntest.js file:\n\n```javascript\n#!/usr/bin/env node\n'use strict';\n\nvar ArgumentParser = require('../lib/argparse').ArgumentParser;\nvar parser = new ArgumentParser({\n version: '0.0.1',\n addHelp:true,\n description: 'Argparse example'\n});\nparser.addArgument(\n [ '-f', '--foo' ],\n {\n help: 'foo bar'\n }\n);\nparser.addArgument(\n [ '-b', '--bar' ],\n {\n help: 'bar foo'\n }\n);\nvar args = parser.parseArgs();\nconsole.dir(args);\n```\n\nDisplay help:\n\n```\n$ ./test.js -h\nusage: example.js [-h] [-v] [-f FOO] [-b BAR]\n\nArgparse example\n\nOptional arguments:\n -h, --help Show this help message and exit.\n -v, --version Show program's version number and exit.\n -f FOO, --foo FOO foo bar\n -b BAR, --bar BAR bar foo\n```\n\nParse arguments:\n\n```\n$ ./test.js -f=3 --bar=4\n{ foo: '3', bar: '4' }\n```\n\nMore [examples](https://github.com/nodeca/argparse/tree/master/examples).\n\n\nArgumentParser objects\n======================\n\n```\nnew ArgumentParser({paramters hash});\n```\n\nCreates a new ArgumentParser object.\n\n**Supported params:**\n\n- ```description``` - Text to display before the argument help.\n- ```epilog``` - Text to display after the argument help.\n- ```addHelp``` - Add a -h/–help option to the parser. (default: True)\n- ```argumentDefault``` - Set the global default value for arguments. (default: None)\n- ```parents``` - A list of ArgumentParser objects whose arguments should also be included.\n- ```prefixChars``` - The set of characters that prefix optional arguments. (default: ‘-‘)\n- ```formatterClass``` - A class for customizing the help output.\n- ```prog``` - The name of the program (default: sys.argv[0])\n- ```usage``` - The string describing the program usage (default: generated)\n- ```conflictHandler``` - Usually unnecessary, defines strategy for resolving conflicting optionals.\n\n**Not supportied yet**\n\n- ```fromfilePrefixChars``` - The set of characters that prefix files from which additional arguments should be read.\n\n\nDetails in [original ArgumentParser guide](http://docs.python.org/dev/library/argparse.html#argumentparser-objects)\n\n\naddArgument() method\n====================\n\n```\nArgumentParser.addArgument([names or flags], {options})\n```\n\nDefines how a single command-line argument should be parsed.\n\n- ```name or flags``` - Either a name or a list of option strings, e.g. foo or -f, --foo.\n\nOptions:\n\n- ```action``` - The basic type of action to be taken when this argument is encountered at the command line.\n- ```nargs```- The number of command-line arguments that should be consumed.\n- ```constant``` - A constant value required by some action and nargs selections.\n- ```defaultValue``` - The value produced if the argument is absent from the command line.\n- ```type``` - The type to which the command-line argument should be converted.\n- ```choices``` - A container of the allowable values for the argument.\n- ```required``` - Whether or not the command-line option may be omitted (optionals only).\n- ```help``` - A brief description of what the argument does.\n- ```metavar``` - A name for the argument in usage messages.\n- ```dest``` - The name of the attribute to be added to the object returned by parseArgs().\n\nDetails in [original add_argument guide](http://docs.python.org/dev/library/argparse.html#the-add-argument-method)\n\n\nAction (some details)\n================\n\nArgumentParser objects associate command-line arguments with actions.\nThese actions can do just about anything with the command-line arguments associated\nwith them, though most actions simply add an attribute to the object returned by\nparseArgs(). The action keyword argument specifies how the command-line arguments\nshould be handled. The supported actions are:\n\n- ```store``` - Just stores the argument’s value. This is the default action.\n- ```storeConst``` - Stores value, specified by the const keyword argument.\n (Note that the const keyword argument defaults to the rather unhelpful None.)\n The 'storeConst' action is most commonly used with optional arguments, that\n specify some sort of flag.\n- ```storeTrue``` and ```storeFalse``` - Stores values True and False\n respectively. These are special cases of 'storeConst'.\n- ```append``` - Stores a list, and appends each argument value to the list.\n This is useful to allow an option to be specified multiple times.\n- ```appendConst``` - Stores a list, and appends value, specified by the\n const keyword argument to the list. (Note, that the const keyword argument defaults\n is None.) The 'appendConst' action is typically used when multiple arguments need\n to store constants to the same list.\n- ```count``` - Counts the number of times a keyword argument occurs. For example,\n used for increasing verbosity levels.\n- ```help``` - Prints a complete help message for all the options in the current\n parser and then exits. By default a help action is automatically added to the parser.\n See ArgumentParser for details of how the output is created.\n- ```version``` - Prints version information and exit. Expects a `version=`\n keyword argument in the addArgument() call.\n\nDetails in [original action guide](http://docs.python.org/dev/library/argparse.html#action)\n\n\nSub-commands\n============\n\nArgumentParser.addSubparsers()\n\nMany programs split their functionality into a number of sub-commands, for\nexample, the svn program can invoke sub-commands like `svn checkout`, `svn update`,\nand `svn commit`. Splitting up functionality this way can be a particularly good\nidea when a program performs several different functions which require different\nkinds of command-line arguments. `ArgumentParser` supports creation of such\nsub-commands with `addSubparsers()` method. The `addSubparsers()` method is\nnormally called with no arguments and returns an special action object.\nThis object has a single method `addParser()`, which takes a command name and\nany `ArgumentParser` constructor arguments, and returns an `ArgumentParser` object\nthat can be modified as usual.\n\nExample:\n\nsub_commands.js\n```javascript\n#!/usr/bin/env node\n'use strict';\n\nvar ArgumentParser = require('../lib/argparse').ArgumentParser;\nvar parser = new ArgumentParser({\n version: '0.0.1',\n addHelp:true,\n description: 'Argparse examples: sub-commands',\n});\n\nvar subparsers = parser.addSubparsers({\n title:'subcommands',\n dest:\"subcommand_name\"\n});\n\nvar bar = subparsers.addParser('c1', {addHelp:true});\nbar.addArgument(\n [ '-f', '--foo' ],\n {\n action: 'store',\n help: 'foo3 bar3'\n }\n);\nvar bar = subparsers.addParser(\n 'c2',\n {aliases:['co'], addHelp:true}\n);\nbar.addArgument(\n [ '-b', '--bar' ],\n {\n action: 'store',\n type: 'int',\n help: 'foo3 bar3'\n }\n);\n\nvar args = parser.parseArgs();\nconsole.dir(args);\n\n```\n\nDetails in [original sub-commands guide](http://docs.python.org/dev/library/argparse.html#sub-commands)\n\n\nContributors\n============\n\n- [Eugene Shkuropat](https://github.com/shkuropat)\n- [Paul Jacobson](https://github.com/hpaulj)\n\n[others](https://github.com/nodeca/argparse/graphs/contributors)\n\nLicense\n=======\n\nCopyright (c) 2012 [Vitaly Puzrin](https://github.com/puzrin).\nReleased under the MIT license. See\n[LICENSE](https://github.com/nodeca/argparse/blob/master/LICENSE) for details.\n\n\n", - "readmeFilename": "README.md", - "_id": "argparse@0.1.15", - "dist": { - "shasum": "28a1f72c43113e763220e5708414301c8840f0a1", - "tarball": "http://registry.npmjs.org/argparse/-/argparse-0.1.15.tgz" - }, - "_from": "argparse@~ 0.1.11", - "_resolved": "https://registry.npmjs.org/argparse/-/argparse-0.1.15.tgz", - "_npmVersion": "1.2.18", + "gitHead": "84b31478e66f3352fa62f3f884ccdf97352d33b5", + "_id": "argparse@1.0.1", + "_shasum": "cb1010b8559920fc8aee521eb9e80e4851790923", + "_from": "argparse@~ 1.0.0", + "_npmVersion": "1.4.28", "_npmUser": { "name": "vitaly", "email": "vitaly@rcdesign.ru" @@ -63,6 +52,11 @@ "email": "vitaly@rcdesign.ru" } ], + "dist": { + "shasum": "cb1010b8559920fc8aee521eb9e80e4851790923", + "tarball": "http://registry.npmjs.org/argparse/-/argparse-1.0.1.tgz" + }, "directories": {}, - "_shasum": "28a1f72c43113e763220e5708414301c8840f0a1" + "_resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.1.tgz", + "readme": "ERROR: No README data found!" } diff --git a/node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/esprima/README.md b/node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/esprima/README.md index a74bd12..f7a9a21 100644 --- a/node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/esprima/README.md +++ b/node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/esprima/README.md @@ -1,73 +1,24 @@ -**Esprima** ([esprima.org](http://esprima.org)) is a high performance, +**Esprima** ([esprima.org](http://esprima.org), BSD license) is a high performance, standard-compliant [ECMAScript](http://www.ecma-international.org/publications/standards/Ecma-262.htm) parser written in ECMAScript (also popularly known as [JavaScript](http://en.wikipedia.org/wiki/JavaScript>JavaScript)). Esprima is created and maintained by [Ariya Hidayat](http://twitter.com/ariyahidayat), -with the help of [many contributors](https://github.com/ariya/esprima/contributors). - -Esprima runs on web browsers (IE 6+, Firefox 1+, Safari 3+, Chrome 1+, Konqueror 4.6+, Opera 8+) as well as -[Node.js](http://nodejs.org). +with the help of [many contributors](https://github.com/jquery/esprima/contributors). ### Features -- Full support for [ECMAScript 5.1](http://www.ecma-international.org/publications/standards/Ecma-262.htm)(ECMA-262) +- Full support for ECMAScript 5.1 ([ECMA-262](http://www.ecma-international.org/publications/standards/Ecma-262.htm)) - Sensible [syntax tree format](http://esprima.org/doc/index.html#ast) compatible with Mozilla [Parser AST](https://developer.mozilla.org/en/SpiderMonkey/Parser_API) -- Heavily tested (> 550 [unit tests](http://esprima.org/test/) with solid 100% statement coverage) - Optional tracking of syntax node location (index-based and line-column) -- Experimental support for ES6/Harmony (module, class, destructuring, ...) - -Esprima is blazing fast (see the [benchmark suite](http://esprima.org/test/benchmarks.html)). -It is up to 3x faster than UglifyJS v1 and it is still [competitive](http://esprima.org/test/compare.html) -with the new generation of fast parsers. - -### Applications - -Esprima serves as the basis for many popular JavaScript development tools: - -- Code coverage analysis: [node-cover](https://github.com/itay/node-cover), [Istanbul](https://github.com/yahoo/Istanbul) -- Documentation tool: [JFDoc](https://github.com/thejohnfreeman/jfdoc), [JSDuck](https://github.com/senchalabs/jsduck) -- Language extension: [LLJS](http://mbebenita.github.com/LLJS/) (low-level JS), -[Sweet.js](http://sweetjs.org/) (macro) -- ES6/Harmony transpiler: [Six](https://github.com/matthewrobb/six), [Harmonizr](https://github.com/jdiamond/harmonizr) -- Eclipse Orion smart editing ([outline view](https://github.com/aclement/esprima-outline), [content assist](http://contraptionsforprogramming.blogspot.com/2012/02/better-javascript-content-assist-in.html)) -- Source code modification: [Esmorph](https://github.com/ariya/esmorph), [Code Painter](https://github.com/fawek/codepainter), -- Source transformation: [node-falafel](https://github.com/substack/node-falafel), [Esmangle](https://github.com/Constellation/esmangle), [escodegen](https://github.com/Constellation/escodegen) - -### Questions? -- [Documentation](http://esprima.org/doc) -- [Issue tracker](http://issues.esprima.org): [known problems](http://code.google.com/p/esprima/issues/list?q=Defect) -and [future plans](http://code.google.com/p/esprima/issues/list?q=Enhancement) -- [Mailing list](http://groups.google.com/group/esprima) -- [Contribution guide](http://esprima.org/doc/index.html#contribution) - -Follow [@Esprima](http://twitter.com/Esprima) on Twitter to get the -development updates. -Feedback and contribution are welcomed! - -### License - -Copyright (C) 2012, 2011 [Ariya Hidayat](http://ariya.ofilabs.com/about) - and other contributors. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. +- Heavily tested (> 700 [unit tests](http://esprima.org/test/) with [full code coverage](http://esprima.org/test/coverage.html)) +- [Partial support](http://esprima.org/doc/es6.html) for ECMAScript 6 - * 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. +Esprima serves as a **building block** for some JavaScript +language tools, from [code instrumentation](http://esprima.org/demo/functiontrace.html) +to [editor autocompletion](http://esprima.org/demo/autocomplete.html). -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -ARE DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF -THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +Esprima runs on many popular web browsers, as well as other ECMAScript platforms such as +[Rhino](http://www.mozilla.org/rhino), [Nashorn](http://openjdk.java.net/projects/nashorn/), and [Node.js](https://npmjs.org/package/esprima). +For more information, check the web site [esprima.org](http://esprima.org). diff --git a/node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/esprima/bin/esparse.js b/node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/esprima/bin/esparse.js index 3e7bb81..5603666 100755 --- a/node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/esprima/bin/esparse.js +++ b/node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/esprima/bin/esparse.js @@ -107,10 +107,20 @@ if (typeof fname !== 'string') { process.exit(1); } +// Special handling for regular expression literal since we need to +// convert it to a string literal, otherwise it will be decoded +// as object "{}" and the regular expression would be lost. +function adjustRegexLiteral(key, value) { + if (key === 'value' && value instanceof RegExp) { + value = value.toString(); + } + return value; +} + try { content = fs.readFileSync(fname, 'utf-8'); syntax = esprima.parse(content, options); - console.log(JSON.stringify(syntax, null, 4)); + console.log(JSON.stringify(syntax, adjustRegexLiteral, 4)); } catch (e) { console.log('Error: ' + e.message); process.exit(1); diff --git a/node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/esprima/bin/esvalidate.js b/node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/esprima/bin/esvalidate.js index e0af3f7..dddd8a2 100755 --- a/node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/esprima/bin/esvalidate.js +++ b/node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/esprima/bin/esvalidate.js @@ -24,20 +24,38 @@ */ /*jslint sloppy:true plusplus:true node:true rhino:true */ - -var fs, esprima, options, fnames, count; - -if (typeof require === 'function') { - fs = require('fs'); - esprima = require('esprima'); -} else if (typeof load === 'function') { - try { - load('esprima.js'); - } catch (e) { - load('../esprima.js'); +/*global phantom:true */ + +var fs, system, esprima, options, fnames, count; + +if (typeof esprima === 'undefined') { + // PhantomJS can only require() relative files + if (typeof phantom === 'object') { + fs = require('fs'); + system = require('system'); + esprima = require('./esprima'); + } else if (typeof require === 'function') { + fs = require('fs'); + esprima = require('esprima'); + } else if (typeof load === 'function') { + try { + load('esprima.js'); + } catch (e) { + load('../esprima.js'); + } } } +// Shims to Node.js objects when running under PhantomJS 1.7+. +if (typeof phantom === 'object') { + fs.readFileSync = fs.read; + process = { + argv: [].slice.call(system.args), + exit: phantom.exit + }; + process.argv.unshift('phantomjs'); +} + // Shims to Node.js objects when running under Rhino. if (typeof console === 'undefined' && typeof process === 'undefined') { console = { log: print }; @@ -175,3 +193,7 @@ if (options.format === 'junit') { if (count > 0) { process.exit(1); } + +if (count === 0 && typeof phantom === 'object') { + process.exit(0); +} diff --git a/node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/esprima/esprima.js b/node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/esprima/esprima.js index f1320da..a1f80c8 100644 --- a/node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/esprima/esprima.js +++ b/node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/esprima/esprima.js @@ -1,4 +1,7 @@ /* + Copyright (C) 2013 Ariya Hidayat + Copyright (C) 2013 Thaddee Tyl + Copyright (C) 2013 Mathias Bynens Copyright (C) 2012 Ariya Hidayat Copyright (C) 2012 Mathias Bynens Copyright (C) 2012 Joost-Wim Boekesteijn @@ -28,20 +31,13 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -/*jslint bitwise:true plusplus:true */ -/*global esprima:true, define:true, exports:true, window: true, -throwError: true, createLiteral: true, generateStatement: true, -parseAssignmentExpression: true, parseBlock: true, parseExpression: true, -parseFunctionDeclaration: true, parseFunctionExpression: true, -parseFunctionSourceElements: true, parseVariableIdentifier: true, -parseLeftHandSideExpression: true, -parseStatement: true, parseSourceElement: true */ - (function (root, factory) { 'use strict'; // Universal Module Definition (UMD) to support AMD, CommonJS/Node.js, // Rhino, and plain browser loading. + + /* istanbul ignore next */ if (typeof define === 'function' && define.amd) { define(['exports'], factory); } else if (typeof exports !== 'undefined') { @@ -54,7 +50,9 @@ parseStatement: true, parseSourceElement: true */ var Token, TokenName, + FnExprTokens, Syntax, + PlaceHolders, PropertyKind, Messages, Regex, @@ -64,7 +62,7 @@ parseStatement: true, parseSourceElement: true */ lineNumber, lineStart, length, - buffer, + lookahead, state, extra; @@ -76,7 +74,8 @@ parseStatement: true, parseSourceElement: true */ NullLiteral: 5, NumericLiteral: 6, Punctuator: 7, - StringLiteral: 8 + StringLiteral: 8, + RegularExpression: 9 }; TokenName = {}; @@ -88,10 +87,23 @@ parseStatement: true, parseSourceElement: true */ TokenName[Token.NumericLiteral] = 'Numeric'; TokenName[Token.Punctuator] = 'Punctuator'; TokenName[Token.StringLiteral] = 'String'; + TokenName[Token.RegularExpression] = 'RegularExpression'; + + // A function following one of those tokens is an expression. + FnExprTokens = ['(', '{', '[', 'in', 'typeof', 'instanceof', 'new', + 'return', 'case', 'delete', 'throw', 'void', + // assignment operators + '=', '+=', '-=', '*=', '/=', '%=', '<<=', '>>=', '>>>=', + '&=', '|=', '^=', ',', + // binary/unary operators + '+', '-', '*', '/', '%', '++', '--', '<<', '>>', '>>>', '&', + '|', '^', '!', '~', '&&', '||', '?', ':', '===', '==', '>=', + '<=', '<', '>', '!=', '!==']; Syntax = { AssignmentExpression: 'AssignmentExpression', ArrayExpression: 'ArrayExpression', + ArrowFunctionExpression: 'ArrowFunctionExpression', BlockStatement: 'BlockStatement', BinaryExpression: 'BinaryExpression', BreakStatement: 'BreakStatement', @@ -132,6 +144,12 @@ parseStatement: true, parseSourceElement: true */ WithStatement: 'WithStatement' }; + PlaceHolders = { + ArrowParameterPlaceHolder: { + type: 'ArrowParameterPlaceHolder' + } + }; + PropertyKind = { Data: 1, Get: 2, @@ -140,45 +158,45 @@ parseStatement: true, parseSourceElement: true */ // Error messages should be identical to V8. Messages = { - UnexpectedToken: 'Unexpected token %0', - UnexpectedNumber: 'Unexpected number', - UnexpectedString: 'Unexpected string', - UnexpectedIdentifier: 'Unexpected identifier', - UnexpectedReserved: 'Unexpected reserved word', - UnexpectedEOS: 'Unexpected end of input', - NewlineAfterThrow: 'Illegal newline after throw', + UnexpectedToken: 'Unexpected token %0', + UnexpectedNumber: 'Unexpected number', + UnexpectedString: 'Unexpected string', + UnexpectedIdentifier: 'Unexpected identifier', + UnexpectedReserved: 'Unexpected reserved word', + UnexpectedEOS: 'Unexpected end of input', + NewlineAfterThrow: 'Illegal newline after throw', InvalidRegExp: 'Invalid regular expression', - UnterminatedRegExp: 'Invalid regular expression: missing /', - InvalidLHSInAssignment: 'Invalid left-hand side in assignment', - InvalidLHSInForIn: 'Invalid left-hand side in for-in', + UnterminatedRegExp: 'Invalid regular expression: missing /', + InvalidLHSInAssignment: 'Invalid left-hand side in assignment', + InvalidLHSInForIn: 'Invalid left-hand side in for-in', MultipleDefaultsInSwitch: 'More than one default clause in switch statement', - NoCatchOrFinally: 'Missing catch or finally after try', + NoCatchOrFinally: 'Missing catch or finally after try', UnknownLabel: 'Undefined label \'%0\'', Redeclaration: '%0 \'%1\' has already been declared', IllegalContinue: 'Illegal continue statement', IllegalBreak: 'Illegal break statement', IllegalReturn: 'Illegal return statement', - StrictModeWith: 'Strict mode code may not include a with statement', - StrictCatchVariable: 'Catch variable may not be eval or arguments in strict mode', - StrictVarName: 'Variable name may not be eval or arguments in strict mode', - StrictParamName: 'Parameter name eval or arguments is not allowed in strict mode', + StrictModeWith: 'Strict mode code may not include a with statement', + StrictCatchVariable: 'Catch variable may not be eval or arguments in strict mode', + StrictVarName: 'Variable name may not be eval or arguments in strict mode', + StrictParamName: 'Parameter name eval or arguments is not allowed in strict mode', StrictParamDupe: 'Strict mode function may not have duplicate parameter names', - StrictFunctionName: 'Function name may not be eval or arguments in strict mode', - StrictOctalLiteral: 'Octal literals are not allowed in strict mode.', - StrictDelete: 'Delete of an unqualified identifier in strict mode.', - StrictDuplicateProperty: 'Duplicate data property in object literal not allowed in strict mode', - AccessorDataProperty: 'Object literal may not have data and accessor property with the same name', - AccessorGetSet: 'Object literal may not have multiple get/set accessors with the same name', - StrictLHSAssignment: 'Assignment to eval or arguments is not allowed in strict mode', - StrictLHSPostfix: 'Postfix increment/decrement may not have eval or arguments operand in strict mode', - StrictLHSPrefix: 'Prefix increment/decrement may not have eval or arguments operand in strict mode', - StrictReservedWord: 'Use of future reserved word in strict mode' + StrictFunctionName: 'Function name may not be eval or arguments in strict mode', + StrictOctalLiteral: 'Octal literals are not allowed in strict mode.', + StrictDelete: 'Delete of an unqualified identifier in strict mode.', + StrictDuplicateProperty: 'Duplicate data property in object literal not allowed in strict mode', + AccessorDataProperty: 'Object literal may not have data and accessor property with the same name', + AccessorGetSet: 'Object literal may not have multiple get/set accessors with the same name', + StrictLHSAssignment: 'Assignment to eval or arguments is not allowed in strict mode', + StrictLHSPostfix: 'Postfix increment/decrement may not have eval or arguments operand in strict mode', + StrictLHSPrefix: 'Prefix increment/decrement may not have eval or arguments operand in strict mode', + StrictReservedWord: 'Use of future reserved word in strict mode' }; // See also tools/generate-unicode-regex.py. Regex = { - NonAsciiIdentifierStart: new RegExp('[\xaa\xb5\xba\xc0-\xd6\xd8-\xf6\xf8-\u02c1\u02c6-\u02d1\u02e0-\u02e4\u02ec\u02ee\u0370-\u0374\u0376\u0377\u037a-\u037d\u0386\u0388-\u038a\u038c\u038e-\u03a1\u03a3-\u03f5\u03f7-\u0481\u048a-\u0527\u0531-\u0556\u0559\u0561-\u0587\u05d0-\u05ea\u05f0-\u05f2\u0620-\u064a\u066e\u066f\u0671-\u06d3\u06d5\u06e5\u06e6\u06ee\u06ef\u06fa-\u06fc\u06ff\u0710\u0712-\u072f\u074d-\u07a5\u07b1\u07ca-\u07ea\u07f4\u07f5\u07fa\u0800-\u0815\u081a\u0824\u0828\u0840-\u0858\u08a0\u08a2-\u08ac\u0904-\u0939\u093d\u0950\u0958-\u0961\u0971-\u0977\u0979-\u097f\u0985-\u098c\u098f\u0990\u0993-\u09a8\u09aa-\u09b0\u09b2\u09b6-\u09b9\u09bd\u09ce\u09dc\u09dd\u09df-\u09e1\u09f0\u09f1\u0a05-\u0a0a\u0a0f\u0a10\u0a13-\u0a28\u0a2a-\u0a30\u0a32\u0a33\u0a35\u0a36\u0a38\u0a39\u0a59-\u0a5c\u0a5e\u0a72-\u0a74\u0a85-\u0a8d\u0a8f-\u0a91\u0a93-\u0aa8\u0aaa-\u0ab0\u0ab2\u0ab3\u0ab5-\u0ab9\u0abd\u0ad0\u0ae0\u0ae1\u0b05-\u0b0c\u0b0f\u0b10\u0b13-\u0b28\u0b2a-\u0b30\u0b32\u0b33\u0b35-\u0b39\u0b3d\u0b5c\u0b5d\u0b5f-\u0b61\u0b71\u0b83\u0b85-\u0b8a\u0b8e-\u0b90\u0b92-\u0b95\u0b99\u0b9a\u0b9c\u0b9e\u0b9f\u0ba3\u0ba4\u0ba8-\u0baa\u0bae-\u0bb9\u0bd0\u0c05-\u0c0c\u0c0e-\u0c10\u0c12-\u0c28\u0c2a-\u0c33\u0c35-\u0c39\u0c3d\u0c58\u0c59\u0c60\u0c61\u0c85-\u0c8c\u0c8e-\u0c90\u0c92-\u0ca8\u0caa-\u0cb3\u0cb5-\u0cb9\u0cbd\u0cde\u0ce0\u0ce1\u0cf1\u0cf2\u0d05-\u0d0c\u0d0e-\u0d10\u0d12-\u0d3a\u0d3d\u0d4e\u0d60\u0d61\u0d7a-\u0d7f\u0d85-\u0d96\u0d9a-\u0db1\u0db3-\u0dbb\u0dbd\u0dc0-\u0dc6\u0e01-\u0e30\u0e32\u0e33\u0e40-\u0e46\u0e81\u0e82\u0e84\u0e87\u0e88\u0e8a\u0e8d\u0e94-\u0e97\u0e99-\u0e9f\u0ea1-\u0ea3\u0ea5\u0ea7\u0eaa\u0eab\u0ead-\u0eb0\u0eb2\u0eb3\u0ebd\u0ec0-\u0ec4\u0ec6\u0edc-\u0edf\u0f00\u0f40-\u0f47\u0f49-\u0f6c\u0f88-\u0f8c\u1000-\u102a\u103f\u1050-\u1055\u105a-\u105d\u1061\u1065\u1066\u106e-\u1070\u1075-\u1081\u108e\u10a0-\u10c5\u10c7\u10cd\u10d0-\u10fa\u10fc-\u1248\u124a-\u124d\u1250-\u1256\u1258\u125a-\u125d\u1260-\u1288\u128a-\u128d\u1290-\u12b0\u12b2-\u12b5\u12b8-\u12be\u12c0\u12c2-\u12c5\u12c8-\u12d6\u12d8-\u1310\u1312-\u1315\u1318-\u135a\u1380-\u138f\u13a0-\u13f4\u1401-\u166c\u166f-\u167f\u1681-\u169a\u16a0-\u16ea\u16ee-\u16f0\u1700-\u170c\u170e-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176c\u176e-\u1770\u1780-\u17b3\u17d7\u17dc\u1820-\u1877\u1880-\u18a8\u18aa\u18b0-\u18f5\u1900-\u191c\u1950-\u196d\u1970-\u1974\u1980-\u19ab\u19c1-\u19c7\u1a00-\u1a16\u1a20-\u1a54\u1aa7\u1b05-\u1b33\u1b45-\u1b4b\u1b83-\u1ba0\u1bae\u1baf\u1bba-\u1be5\u1c00-\u1c23\u1c4d-\u1c4f\u1c5a-\u1c7d\u1ce9-\u1cec\u1cee-\u1cf1\u1cf5\u1cf6\u1d00-\u1dbf\u1e00-\u1f15\u1f18-\u1f1d\u1f20-\u1f45\u1f48-\u1f4d\u1f50-\u1f57\u1f59\u1f5b\u1f5d\u1f5f-\u1f7d\u1f80-\u1fb4\u1fb6-\u1fbc\u1fbe\u1fc2-\u1fc4\u1fc6-\u1fcc\u1fd0-\u1fd3\u1fd6-\u1fdb\u1fe0-\u1fec\u1ff2-\u1ff4\u1ff6-\u1ffc\u2071\u207f\u2090-\u209c\u2102\u2107\u210a-\u2113\u2115\u2119-\u211d\u2124\u2126\u2128\u212a-\u212d\u212f-\u2139\u213c-\u213f\u2145-\u2149\u214e\u2160-\u2188\u2c00-\u2c2e\u2c30-\u2c5e\u2c60-\u2ce4\u2ceb-\u2cee\u2cf2\u2cf3\u2d00-\u2d25\u2d27\u2d2d\u2d30-\u2d67\u2d6f\u2d80-\u2d96\u2da0-\u2da6\u2da8-\u2dae\u2db0-\u2db6\u2db8-\u2dbe\u2dc0-\u2dc6\u2dc8-\u2dce\u2dd0-\u2dd6\u2dd8-\u2dde\u2e2f\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303c\u3041-\u3096\u309d-\u309f\u30a1-\u30fa\u30fc-\u30ff\u3105-\u312d\u3131-\u318e\u31a0-\u31ba\u31f0-\u31ff\u3400-\u4db5\u4e00-\u9fcc\ua000-\ua48c\ua4d0-\ua4fd\ua500-\ua60c\ua610-\ua61f\ua62a\ua62b\ua640-\ua66e\ua67f-\ua697\ua6a0-\ua6ef\ua717-\ua71f\ua722-\ua788\ua78b-\ua78e\ua790-\ua793\ua7a0-\ua7aa\ua7f8-\ua801\ua803-\ua805\ua807-\ua80a\ua80c-\ua822\ua840-\ua873\ua882-\ua8b3\ua8f2-\ua8f7\ua8fb\ua90a-\ua925\ua930-\ua946\ua960-\ua97c\ua984-\ua9b2\ua9cf\uaa00-\uaa28\uaa40-\uaa42\uaa44-\uaa4b\uaa60-\uaa76\uaa7a\uaa80-\uaaaf\uaab1\uaab5\uaab6\uaab9-\uaabd\uaac0\uaac2\uaadb-\uaadd\uaae0-\uaaea\uaaf2-\uaaf4\uab01-\uab06\uab09-\uab0e\uab11-\uab16\uab20-\uab26\uab28-\uab2e\uabc0-\uabe2\uac00-\ud7a3\ud7b0-\ud7c6\ud7cb-\ud7fb\uf900-\ufa6d\ufa70-\ufad9\ufb00-\ufb06\ufb13-\ufb17\ufb1d\ufb1f-\ufb28\ufb2a-\ufb36\ufb38-\ufb3c\ufb3e\ufb40\ufb41\ufb43\ufb44\ufb46-\ufbb1\ufbd3-\ufd3d\ufd50-\ufd8f\ufd92-\ufdc7\ufdf0-\ufdfb\ufe70-\ufe74\ufe76-\ufefc\uff21-\uff3a\uff41-\uff5a\uff66-\uffbe\uffc2-\uffc7\uffca-\uffcf\uffd2-\uffd7\uffda-\uffdc]'), - NonAsciiIdentifierPart: new RegExp('[\xaa\xb5\xba\xc0-\xd6\xd8-\xf6\xf8-\u02c1\u02c6-\u02d1\u02e0-\u02e4\u02ec\u02ee\u0300-\u0374\u0376\u0377\u037a-\u037d\u0386\u0388-\u038a\u038c\u038e-\u03a1\u03a3-\u03f5\u03f7-\u0481\u0483-\u0487\u048a-\u0527\u0531-\u0556\u0559\u0561-\u0587\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u05d0-\u05ea\u05f0-\u05f2\u0610-\u061a\u0620-\u0669\u066e-\u06d3\u06d5-\u06dc\u06df-\u06e8\u06ea-\u06fc\u06ff\u0710-\u074a\u074d-\u07b1\u07c0-\u07f5\u07fa\u0800-\u082d\u0840-\u085b\u08a0\u08a2-\u08ac\u08e4-\u08fe\u0900-\u0963\u0966-\u096f\u0971-\u0977\u0979-\u097f\u0981-\u0983\u0985-\u098c\u098f\u0990\u0993-\u09a8\u09aa-\u09b0\u09b2\u09b6-\u09b9\u09bc-\u09c4\u09c7\u09c8\u09cb-\u09ce\u09d7\u09dc\u09dd\u09df-\u09e3\u09e6-\u09f1\u0a01-\u0a03\u0a05-\u0a0a\u0a0f\u0a10\u0a13-\u0a28\u0a2a-\u0a30\u0a32\u0a33\u0a35\u0a36\u0a38\u0a39\u0a3c\u0a3e-\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a59-\u0a5c\u0a5e\u0a66-\u0a75\u0a81-\u0a83\u0a85-\u0a8d\u0a8f-\u0a91\u0a93-\u0aa8\u0aaa-\u0ab0\u0ab2\u0ab3\u0ab5-\u0ab9\u0abc-\u0ac5\u0ac7-\u0ac9\u0acb-\u0acd\u0ad0\u0ae0-\u0ae3\u0ae6-\u0aef\u0b01-\u0b03\u0b05-\u0b0c\u0b0f\u0b10\u0b13-\u0b28\u0b2a-\u0b30\u0b32\u0b33\u0b35-\u0b39\u0b3c-\u0b44\u0b47\u0b48\u0b4b-\u0b4d\u0b56\u0b57\u0b5c\u0b5d\u0b5f-\u0b63\u0b66-\u0b6f\u0b71\u0b82\u0b83\u0b85-\u0b8a\u0b8e-\u0b90\u0b92-\u0b95\u0b99\u0b9a\u0b9c\u0b9e\u0b9f\u0ba3\u0ba4\u0ba8-\u0baa\u0bae-\u0bb9\u0bbe-\u0bc2\u0bc6-\u0bc8\u0bca-\u0bcd\u0bd0\u0bd7\u0be6-\u0bef\u0c01-\u0c03\u0c05-\u0c0c\u0c0e-\u0c10\u0c12-\u0c28\u0c2a-\u0c33\u0c35-\u0c39\u0c3d-\u0c44\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c58\u0c59\u0c60-\u0c63\u0c66-\u0c6f\u0c82\u0c83\u0c85-\u0c8c\u0c8e-\u0c90\u0c92-\u0ca8\u0caa-\u0cb3\u0cb5-\u0cb9\u0cbc-\u0cc4\u0cc6-\u0cc8\u0cca-\u0ccd\u0cd5\u0cd6\u0cde\u0ce0-\u0ce3\u0ce6-\u0cef\u0cf1\u0cf2\u0d02\u0d03\u0d05-\u0d0c\u0d0e-\u0d10\u0d12-\u0d3a\u0d3d-\u0d44\u0d46-\u0d48\u0d4a-\u0d4e\u0d57\u0d60-\u0d63\u0d66-\u0d6f\u0d7a-\u0d7f\u0d82\u0d83\u0d85-\u0d96\u0d9a-\u0db1\u0db3-\u0dbb\u0dbd\u0dc0-\u0dc6\u0dca\u0dcf-\u0dd4\u0dd6\u0dd8-\u0ddf\u0df2\u0df3\u0e01-\u0e3a\u0e40-\u0e4e\u0e50-\u0e59\u0e81\u0e82\u0e84\u0e87\u0e88\u0e8a\u0e8d\u0e94-\u0e97\u0e99-\u0e9f\u0ea1-\u0ea3\u0ea5\u0ea7\u0eaa\u0eab\u0ead-\u0eb9\u0ebb-\u0ebd\u0ec0-\u0ec4\u0ec6\u0ec8-\u0ecd\u0ed0-\u0ed9\u0edc-\u0edf\u0f00\u0f18\u0f19\u0f20-\u0f29\u0f35\u0f37\u0f39\u0f3e-\u0f47\u0f49-\u0f6c\u0f71-\u0f84\u0f86-\u0f97\u0f99-\u0fbc\u0fc6\u1000-\u1049\u1050-\u109d\u10a0-\u10c5\u10c7\u10cd\u10d0-\u10fa\u10fc-\u1248\u124a-\u124d\u1250-\u1256\u1258\u125a-\u125d\u1260-\u1288\u128a-\u128d\u1290-\u12b0\u12b2-\u12b5\u12b8-\u12be\u12c0\u12c2-\u12c5\u12c8-\u12d6\u12d8-\u1310\u1312-\u1315\u1318-\u135a\u135d-\u135f\u1380-\u138f\u13a0-\u13f4\u1401-\u166c\u166f-\u167f\u1681-\u169a\u16a0-\u16ea\u16ee-\u16f0\u1700-\u170c\u170e-\u1714\u1720-\u1734\u1740-\u1753\u1760-\u176c\u176e-\u1770\u1772\u1773\u1780-\u17d3\u17d7\u17dc\u17dd\u17e0-\u17e9\u180b-\u180d\u1810-\u1819\u1820-\u1877\u1880-\u18aa\u18b0-\u18f5\u1900-\u191c\u1920-\u192b\u1930-\u193b\u1946-\u196d\u1970-\u1974\u1980-\u19ab\u19b0-\u19c9\u19d0-\u19d9\u1a00-\u1a1b\u1a20-\u1a5e\u1a60-\u1a7c\u1a7f-\u1a89\u1a90-\u1a99\u1aa7\u1b00-\u1b4b\u1b50-\u1b59\u1b6b-\u1b73\u1b80-\u1bf3\u1c00-\u1c37\u1c40-\u1c49\u1c4d-\u1c7d\u1cd0-\u1cd2\u1cd4-\u1cf6\u1d00-\u1de6\u1dfc-\u1f15\u1f18-\u1f1d\u1f20-\u1f45\u1f48-\u1f4d\u1f50-\u1f57\u1f59\u1f5b\u1f5d\u1f5f-\u1f7d\u1f80-\u1fb4\u1fb6-\u1fbc\u1fbe\u1fc2-\u1fc4\u1fc6-\u1fcc\u1fd0-\u1fd3\u1fd6-\u1fdb\u1fe0-\u1fec\u1ff2-\u1ff4\u1ff6-\u1ffc\u200c\u200d\u203f\u2040\u2054\u2071\u207f\u2090-\u209c\u20d0-\u20dc\u20e1\u20e5-\u20f0\u2102\u2107\u210a-\u2113\u2115\u2119-\u211d\u2124\u2126\u2128\u212a-\u212d\u212f-\u2139\u213c-\u213f\u2145-\u2149\u214e\u2160-\u2188\u2c00-\u2c2e\u2c30-\u2c5e\u2c60-\u2ce4\u2ceb-\u2cf3\u2d00-\u2d25\u2d27\u2d2d\u2d30-\u2d67\u2d6f\u2d7f-\u2d96\u2da0-\u2da6\u2da8-\u2dae\u2db0-\u2db6\u2db8-\u2dbe\u2dc0-\u2dc6\u2dc8-\u2dce\u2dd0-\u2dd6\u2dd8-\u2dde\u2de0-\u2dff\u2e2f\u3005-\u3007\u3021-\u302f\u3031-\u3035\u3038-\u303c\u3041-\u3096\u3099\u309a\u309d-\u309f\u30a1-\u30fa\u30fc-\u30ff\u3105-\u312d\u3131-\u318e\u31a0-\u31ba\u31f0-\u31ff\u3400-\u4db5\u4e00-\u9fcc\ua000-\ua48c\ua4d0-\ua4fd\ua500-\ua60c\ua610-\ua62b\ua640-\ua66f\ua674-\ua67d\ua67f-\ua697\ua69f-\ua6f1\ua717-\ua71f\ua722-\ua788\ua78b-\ua78e\ua790-\ua793\ua7a0-\ua7aa\ua7f8-\ua827\ua840-\ua873\ua880-\ua8c4\ua8d0-\ua8d9\ua8e0-\ua8f7\ua8fb\ua900-\ua92d\ua930-\ua953\ua960-\ua97c\ua980-\ua9c0\ua9cf-\ua9d9\uaa00-\uaa36\uaa40-\uaa4d\uaa50-\uaa59\uaa60-\uaa76\uaa7a\uaa7b\uaa80-\uaac2\uaadb-\uaadd\uaae0-\uaaef\uaaf2-\uaaf6\uab01-\uab06\uab09-\uab0e\uab11-\uab16\uab20-\uab26\uab28-\uab2e\uabc0-\uabea\uabec\uabed\uabf0-\uabf9\uac00-\ud7a3\ud7b0-\ud7c6\ud7cb-\ud7fb\uf900-\ufa6d\ufa70-\ufad9\ufb00-\ufb06\ufb13-\ufb17\ufb1d-\ufb28\ufb2a-\ufb36\ufb38-\ufb3c\ufb3e\ufb40\ufb41\ufb43\ufb44\ufb46-\ufbb1\ufbd3-\ufd3d\ufd50-\ufd8f\ufd92-\ufdc7\ufdf0-\ufdfb\ufe00-\ufe0f\ufe20-\ufe26\ufe33\ufe34\ufe4d-\ufe4f\ufe70-\ufe74\ufe76-\ufefc\uff10-\uff19\uff21-\uff3a\uff3f\uff41-\uff5a\uff66-\uffbe\uffc2-\uffc7\uffca-\uffcf\uffd2-\uffd7\uffda-\uffdc]') + NonAsciiIdentifierStart: new RegExp('[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0-\u08B2\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58\u0C59\u0C60\u0C61\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D60\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F4\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19C1-\u19C7\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FCC\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA78E\uA790-\uA7AD\uA7B0\uA7B1\uA7F7-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB5F\uAB64\uAB65\uABC0-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]'), + NonAsciiIdentifierPart: new RegExp('[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0300-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u0483-\u0487\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u05D0-\u05EA\u05F0-\u05F2\u0610-\u061A\u0620-\u0669\u066E-\u06D3\u06D5-\u06DC\u06DF-\u06E8\u06EA-\u06FC\u06FF\u0710-\u074A\u074D-\u07B1\u07C0-\u07F5\u07FA\u0800-\u082D\u0840-\u085B\u08A0-\u08B2\u08E4-\u0963\u0966-\u096F\u0971-\u0983\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BC-\u09C4\u09C7\u09C8\u09CB-\u09CE\u09D7\u09DC\u09DD\u09DF-\u09E3\u09E6-\u09F1\u0A01-\u0A03\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A59-\u0A5C\u0A5E\u0A66-\u0A75\u0A81-\u0A83\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABC-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AD0\u0AE0-\u0AE3\u0AE6-\u0AEF\u0B01-\u0B03\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3C-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B5C\u0B5D\u0B5F-\u0B63\u0B66-\u0B6F\u0B71\u0B82\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD0\u0BD7\u0BE6-\u0BEF\u0C00-\u0C03\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C58\u0C59\u0C60-\u0C63\u0C66-\u0C6F\u0C81-\u0C83\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBC-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CDE\u0CE0-\u0CE3\u0CE6-\u0CEF\u0CF1\u0CF2\u0D01-\u0D03\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D-\u0D44\u0D46-\u0D48\u0D4A-\u0D4E\u0D57\u0D60-\u0D63\u0D66-\u0D6F\u0D7A-\u0D7F\u0D82\u0D83\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2\u0DF3\u0E01-\u0E3A\u0E40-\u0E4E\u0E50-\u0E59\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB9\u0EBB-\u0EBD\u0EC0-\u0EC4\u0EC6\u0EC8-\u0ECD\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00\u0F18\u0F19\u0F20-\u0F29\u0F35\u0F37\u0F39\u0F3E-\u0F47\u0F49-\u0F6C\u0F71-\u0F84\u0F86-\u0F97\u0F99-\u0FBC\u0FC6\u1000-\u1049\u1050-\u109D\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u135D-\u135F\u1380-\u138F\u13A0-\u13F4\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1714\u1720-\u1734\u1740-\u1753\u1760-\u176C\u176E-\u1770\u1772\u1773\u1780-\u17D3\u17D7\u17DC\u17DD\u17E0-\u17E9\u180B-\u180D\u1810-\u1819\u1820-\u1877\u1880-\u18AA\u18B0-\u18F5\u1900-\u191E\u1920-\u192B\u1930-\u193B\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19D9\u1A00-\u1A1B\u1A20-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AA7\u1AB0-\u1ABD\u1B00-\u1B4B\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1BF3\u1C00-\u1C37\u1C40-\u1C49\u1C4D-\u1C7D\u1CD0-\u1CD2\u1CD4-\u1CF6\u1CF8\u1CF9\u1D00-\u1DF5\u1DFC-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u200C\u200D\u203F\u2040\u2054\u2071\u207F\u2090-\u209C\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D7F-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2DE0-\u2DFF\u2E2F\u3005-\u3007\u3021-\u302F\u3031-\u3035\u3038-\u303C\u3041-\u3096\u3099\u309A\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FCC\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66F\uA674-\uA67D\uA67F-\uA69D\uA69F-\uA6F1\uA717-\uA71F\uA722-\uA788\uA78B-\uA78E\uA790-\uA7AD\uA7B0\uA7B1\uA7F7-\uA827\uA840-\uA873\uA880-\uA8C4\uA8D0-\uA8D9\uA8E0-\uA8F7\uA8FB\uA900-\uA92D\uA930-\uA953\uA960-\uA97C\uA980-\uA9C0\uA9CF-\uA9D9\uA9E0-\uA9FE\uAA00-\uAA36\uAA40-\uAA4D\uAA50-\uAA59\uAA60-\uAA76\uAA7A-\uAAC2\uAADB-\uAADD\uAAE0-\uAAEF\uAAF2-\uAAF6\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB5F\uAB64\uAB65\uABC0-\uABEA\uABEC\uABED\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE00-\uFE0F\uFE20-\uFE2D\uFE33\uFE34\uFE4D-\uFE4F\uFE70-\uFE74\uFE76-\uFEFC\uFF10-\uFF19\uFF21-\uFF3A\uFF3F\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]') }; // Ensure the condition is true, otherwise throw an error. @@ -187,23 +205,14 @@ parseStatement: true, parseSourceElement: true */ // Do NOT use this to enforce a certain condition on any user input. function assert(condition, message) { + /* istanbul ignore if */ if (!condition) { throw new Error('ASSERT: ' + message); } } - function sliceSource(from, to) { - return source.slice(from, to); - } - - if (typeof 'esprima'[0] === 'undefined') { - sliceSource = function sliceArraySource(from, to) { - return source.slice(from, to).join(''); - }; - } - function isDecimalDigit(ch) { - return '0123456789'.indexOf(ch) >= 0; + return (ch >= 0x30 && ch <= 0x39); // 0..9 } function isHexDigit(ch) { @@ -218,39 +227,39 @@ parseStatement: true, parseSourceElement: true */ // 7.2 White Space function isWhiteSpace(ch) { - return (ch === ' ') || (ch === '\u0009') || (ch === '\u000B') || - (ch === '\u000C') || (ch === '\u00A0') || - (ch.charCodeAt(0) >= 0x1680 && - '\u1680\u180E\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\uFEFF'.indexOf(ch) >= 0); + return (ch === 0x20) || (ch === 0x09) || (ch === 0x0B) || (ch === 0x0C) || (ch === 0xA0) || + (ch >= 0x1680 && [0x1680, 0x180E, 0x2000, 0x2001, 0x2002, 0x2003, 0x2004, 0x2005, 0x2006, 0x2007, 0x2008, 0x2009, 0x200A, 0x202F, 0x205F, 0x3000, 0xFEFF].indexOf(ch) >= 0); } // 7.3 Line Terminators function isLineTerminator(ch) { - return (ch === '\n' || ch === '\r' || ch === '\u2028' || ch === '\u2029'); + return (ch === 0x0A) || (ch === 0x0D) || (ch === 0x2028) || (ch === 0x2029); } // 7.6 Identifier Names and Identifiers function isIdentifierStart(ch) { - return (ch === '$') || (ch === '_') || (ch === '\\') || - (ch >= 'a' && ch <= 'z') || (ch >= 'A' && ch <= 'Z') || - ((ch.charCodeAt(0) >= 0x80) && Regex.NonAsciiIdentifierStart.test(ch)); + return (ch === 0x24) || (ch === 0x5F) || // $ (dollar) and _ (underscore) + (ch >= 0x41 && ch <= 0x5A) || // A..Z + (ch >= 0x61 && ch <= 0x7A) || // a..z + (ch === 0x5C) || // \ (backslash) + ((ch >= 0x80) && Regex.NonAsciiIdentifierStart.test(String.fromCharCode(ch))); } function isIdentifierPart(ch) { - return (ch === '$') || (ch === '_') || (ch === '\\') || - (ch >= 'a' && ch <= 'z') || (ch >= 'A' && ch <= 'Z') || - ((ch >= '0') && (ch <= '9')) || - ((ch.charCodeAt(0) >= 0x80) && Regex.NonAsciiIdentifierPart.test(ch)); + return (ch === 0x24) || (ch === 0x5F) || // $ (dollar) and _ (underscore) + (ch >= 0x41 && ch <= 0x5A) || // A..Z + (ch >= 0x61 && ch <= 0x7A) || // a..z + (ch >= 0x30 && ch <= 0x39) || // 0..9 + (ch === 0x5C) || // \ (backslash) + ((ch >= 0x80) && Regex.NonAsciiIdentifierPart.test(String.fromCharCode(ch))); } // 7.6.1.2 Future Reserved Words function isFutureReservedWord(id) { switch (id) { - - // Future reserved words. case 'class': case 'enum': case 'export': @@ -258,15 +267,13 @@ parseStatement: true, parseSourceElement: true */ case 'import': case 'super': return true; + default: + return false; } - - return false; } function isStrictModeReservedWord(id) { switch (id) { - - // Strict Mode reserved words. case 'implements': case 'interface': case 'package': @@ -277,9 +284,9 @@ parseStatement: true, parseSourceElement: true */ case 'yield': case 'let': return true; + default: + return false; } - - return false; } function isRestrictedWord(id) { @@ -289,125 +296,215 @@ parseStatement: true, parseSourceElement: true */ // 7.6.1.1 Keywords function isKeyword(id) { - var keyword = false; + if (strict && isStrictModeReservedWord(id)) { + return true; + } + + // 'const' is specialized as Keyword in V8. + // 'yield' and 'let' are for compatibility with SpiderMonkey and ES.next. + // Some others are from future reserved words. + switch (id.length) { case 2: - keyword = (id === 'if') || (id === 'in') || (id === 'do'); - break; + return (id === 'if') || (id === 'in') || (id === 'do'); case 3: - keyword = (id === 'var') || (id === 'for') || (id === 'new') || (id === 'try'); - break; + return (id === 'var') || (id === 'for') || (id === 'new') || + (id === 'try') || (id === 'let'); case 4: - keyword = (id === 'this') || (id === 'else') || (id === 'case') || (id === 'void') || (id === 'with'); - break; + return (id === 'this') || (id === 'else') || (id === 'case') || + (id === 'void') || (id === 'with') || (id === 'enum'); case 5: - keyword = (id === 'while') || (id === 'break') || (id === 'catch') || (id === 'throw'); - break; + return (id === 'while') || (id === 'break') || (id === 'catch') || + (id === 'throw') || (id === 'const') || (id === 'yield') || + (id === 'class') || (id === 'super'); case 6: - keyword = (id === 'return') || (id === 'typeof') || (id === 'delete') || (id === 'switch'); - break; + return (id === 'return') || (id === 'typeof') || (id === 'delete') || + (id === 'switch') || (id === 'export') || (id === 'import'); case 7: - keyword = (id === 'default') || (id === 'finally'); - break; + return (id === 'default') || (id === 'finally') || (id === 'extends'); case 8: - keyword = (id === 'function') || (id === 'continue') || (id === 'debugger'); - break; + return (id === 'function') || (id === 'continue') || (id === 'debugger'); case 10: - keyword = (id === 'instanceof'); - break; + return (id === 'instanceof'); + default: + return false; } + } - if (keyword) { - return true; - } + // 7.4 Comments - switch (id) { - // Future reserved words. - // 'const' is specialized as Keyword in V8. - case 'const': - return true; + function addComment(type, value, start, end, loc) { + var comment; - // For compatiblity to SpiderMonkey and ES.next - case 'yield': - case 'let': - return true; - } + assert(typeof start === 'number', 'Comment must have valid position'); - if (strict && isStrictModeReservedWord(id)) { - return true; + // Because the way the actual token is scanned, often the comments + // (if any) are skipped twice during the lexical analysis. + // Thus, we need to skip adding a comment if the comment array already + // handled it. + if (state.lastCommentStart >= start) { + return; } + state.lastCommentStart = start; - return isFutureReservedWord(id); + comment = { + type: type, + value: value + }; + if (extra.range) { + comment.range = [start, end]; + } + if (extra.loc) { + comment.loc = loc; + } + extra.comments.push(comment); + if (extra.attachComment) { + extra.leadingComments.push(comment); + extra.trailingComments.push(comment); + } } - // 7.4 Comments - - function skipComment() { - var ch, blockComment, lineComment; + function skipSingleLineComment(offset) { + var start, loc, ch, comment; - blockComment = false; - lineComment = false; + start = index - offset; + loc = { + start: { + line: lineNumber, + column: index - lineStart - offset + } + }; while (index < length) { - ch = source[index]; + ch = source.charCodeAt(index); + ++index; + if (isLineTerminator(ch)) { + if (extra.comments) { + comment = source.slice(start + offset, index - 1); + loc.end = { + line: lineNumber, + column: index - lineStart - 1 + }; + addComment('Line', comment, start, index - 1, loc); + } + if (ch === 13 && source.charCodeAt(index) === 10) { + ++index; + } + ++lineNumber; + lineStart = index; + return; + } + } - if (lineComment) { - ch = source[index++]; - if (isLineTerminator(ch)) { - lineComment = false; - if (ch === '\r' && source[index] === '\n') { - ++index; - } - ++lineNumber; - lineStart = index; + if (extra.comments) { + comment = source.slice(start + offset, index); + loc.end = { + line: lineNumber, + column: index - lineStart + }; + addComment('Line', comment, start, index, loc); + } + } + + function skipMultiLineComment() { + var start, loc, ch, comment; + + if (extra.comments) { + start = index - 2; + loc = { + start: { + line: lineNumber, + column: index - lineStart - 2 } - } else if (blockComment) { - if (isLineTerminator(ch)) { - if (ch === '\r' && source[index + 1] === '\n') { - ++index; - } - ++lineNumber; + }; + } + + while (index < length) { + ch = source.charCodeAt(index); + if (isLineTerminator(ch)) { + if (ch === 0x0D && source.charCodeAt(index + 1) === 0x0A) { ++index; - lineStart = index; - if (index >= length) { - throwError({}, Messages.UnexpectedToken, 'ILLEGAL'); - } - } else { - ch = source[index++]; - if (index >= length) { - throwError({}, Messages.UnexpectedToken, 'ILLEGAL'); - } - if (ch === '*') { - ch = source[index]; - if (ch === '/') { - ++index; - blockComment = false; - } - } } - } else if (ch === '/') { - ch = source[index + 1]; - if (ch === '/') { - index += 2; - lineComment = true; - } else if (ch === '*') { - index += 2; - blockComment = true; - if (index >= length) { - throwError({}, Messages.UnexpectedToken, 'ILLEGAL'); + ++lineNumber; + ++index; + lineStart = index; + if (index >= length) { + throwUnexpectedToken(); + } + } else if (ch === 0x2A) { + // Block comment ends with '*/'. + if (source.charCodeAt(index + 1) === 0x2F) { + ++index; + ++index; + if (extra.comments) { + comment = source.slice(start + 2, index - 2); + loc.end = { + line: lineNumber, + column: index - lineStart + }; + addComment('Block', comment, start, index, loc); } - } else { - break; + return; } - } else if (isWhiteSpace(ch)) { + ++index; + } else { + ++index; + } + } + + throwUnexpectedToken(); + } + + function skipComment() { + var ch, start; + + start = (index === 0); + while (index < length) { + ch = source.charCodeAt(index); + + if (isWhiteSpace(ch)) { ++index; } else if (isLineTerminator(ch)) { ++index; - if (ch === '\r' && source[index] === '\n') { + if (ch === 0x0D && source.charCodeAt(index) === 0x0A) { ++index; } ++lineNumber; lineStart = index; + start = true; + } else if (ch === 0x2F) { // U+002F is '/' + ch = source.charCodeAt(index + 1); + if (ch === 0x2F) { + ++index; + ++index; + skipSingleLineComment(2); + start = true; + } else if (ch === 0x2A) { // U+002A is '*' + ++index; + ++index; + skipMultiLineComment(); + } else { + break; + } + } else if (start && ch === 0x2D) { // U+002D is '-' + // U+003E is '>' + if ((source.charCodeAt(index + 1) === 0x2D) && (source.charCodeAt(index + 2) === 0x3E)) { + // '-->' is a single-line comment + index += 3; + skipSingleLineComment(3); + } else { + break; + } + } else if (ch === 0x3C) { // U+003C is '<' + if (source.slice(index + 1, index + 4) === '!--') { + ++index; // `<` + ++index; // `!` + ++index; // `-` + ++index; // `-` + skipSingleLineComment(4); + } else { + break; + } } else { break; } @@ -429,291 +526,418 @@ parseStatement: true, parseSourceElement: true */ return String.fromCharCode(code); } - function scanIdentifier() { - var ch, start, id, restore; + function scanUnicodeCodePointEscape() { + var ch, code, cu1, cu2; ch = source[index]; - if (!isIdentifierStart(ch)) { - return; + code = 0; + + // At least, one hex digit is required. + if (ch === '}') { + throwUnexpectedToken(); } - start = index; - if (ch === '\\') { - ++index; - if (source[index] !== 'u') { - return; + while (index < length) { + ch = source[index++]; + if (!isHexDigit(ch)) { + break; + } + code = code * 16 + '0123456789abcdef'.indexOf(ch.toLowerCase()); + } + + if (code > 0x10FFFF || ch !== '}') { + throwUnexpectedToken(); + } + + // UTF-16 Encoding + if (code <= 0xFFFF) { + return String.fromCharCode(code); + } + cu1 = ((code - 0x10000) >> 10) + 0xD800; + cu2 = ((code - 0x10000) & 1023) + 0xDC00; + return String.fromCharCode(cu1, cu2); + } + + function getEscapedIdentifier() { + var ch, id; + + ch = source.charCodeAt(index++); + id = String.fromCharCode(ch); + + // '\u' (U+005C, U+0075) denotes an escaped character. + if (ch === 0x5C) { + if (source.charCodeAt(index) !== 0x75) { + throwUnexpectedToken(); } ++index; - restore = index; ch = scanHexEscape('u'); - if (ch) { - if (ch === '\\' || !isIdentifierStart(ch)) { - return; - } - id = ch; - } else { - index = restore; - id = 'u'; + if (!ch || ch === '\\' || !isIdentifierStart(ch.charCodeAt(0))) { + throwUnexpectedToken(); } - } else { - id = source[index++]; + id = ch; } while (index < length) { - ch = source[index]; + ch = source.charCodeAt(index); if (!isIdentifierPart(ch)) { break; } - if (ch === '\\') { - ++index; - if (source[index] !== 'u') { - return; + ++index; + id += String.fromCharCode(ch); + + // '\u' (U+005C, U+0075) denotes an escaped character. + if (ch === 0x5C) { + id = id.substr(0, id.length - 1); + if (source.charCodeAt(index) !== 0x75) { + throwUnexpectedToken(); } ++index; - restore = index; ch = scanHexEscape('u'); - if (ch) { - if (ch === '\\' || !isIdentifierPart(ch)) { - return; - } - id += ch; - } else { - index = restore; - id += 'u'; + if (!ch || ch === '\\' || !isIdentifierPart(ch.charCodeAt(0))) { + throwUnexpectedToken(); } - } else { - id += source[index++]; + id += ch; } } - // There is no keyword or literal with only one character. - // Thus, it must be an identifier. - if (id.length === 1) { - return { - type: Token.Identifier, - value: id, - lineNumber: lineNumber, - lineStart: lineStart, - range: [start, index] - }; - } + return id; + } - if (isKeyword(id)) { - return { - type: Token.Keyword, - value: id, - lineNumber: lineNumber, - lineStart: lineStart, - range: [start, index] - }; + function getIdentifier() { + var start, ch; + + start = index++; + while (index < length) { + ch = source.charCodeAt(index); + if (ch === 0x5C) { + // Blackslash (U+005C) marks Unicode escape sequence. + index = start; + return getEscapedIdentifier(); + } + if (isIdentifierPart(ch)) { + ++index; + } else { + break; + } } - // 7.8.1 Null Literals + return source.slice(start, index); + } - if (id === 'null') { - return { - type: Token.NullLiteral, - value: id, - lineNumber: lineNumber, - lineStart: lineStart, - range: [start, index] - }; - } + function scanIdentifier() { + var start, id, type; - // 7.8.2 Boolean Literals + start = index; - if (id === 'true' || id === 'false') { - return { - type: Token.BooleanLiteral, - value: id, - lineNumber: lineNumber, - lineStart: lineStart, - range: [start, index] - }; + // Backslash (U+005C) starts an escaped character. + id = (source.charCodeAt(index) === 0x5C) ? getEscapedIdentifier() : getIdentifier(); + + // There is no keyword or literal with only one character. + // Thus, it must be an identifier. + if (id.length === 1) { + type = Token.Identifier; + } else if (isKeyword(id)) { + type = Token.Keyword; + } else if (id === 'null') { + type = Token.NullLiteral; + } else if (id === 'true' || id === 'false') { + type = Token.BooleanLiteral; + } else { + type = Token.Identifier; } return { - type: Token.Identifier, + type: type, value: id, lineNumber: lineNumber, lineStart: lineStart, - range: [start, index] + start: start, + end: index }; } + // 7.7 Punctuators function scanPunctuator() { var start = index, + code = source.charCodeAt(index), + code2, ch1 = source[index], ch2, ch3, ch4; - // Check for most common single-character punctuators. + switch (code) { - if (ch1 === ';' || ch1 === '{' || ch1 === '}') { + // Check for most common single-character punctuators. + case 0x2E: // . dot + case 0x28: // ( open bracket + case 0x29: // ) close bracket + case 0x3B: // ; semicolon + case 0x2C: // , comma + case 0x7B: // { open curly brace + case 0x7D: // } close curly brace + case 0x5B: // [ + case 0x5D: // ] + case 0x3A: // : + case 0x3F: // ? + case 0x7E: // ~ ++index; + if (extra.tokenize) { + if (code === 0x28) { + extra.openParenToken = extra.tokens.length; + } else if (code === 0x7B) { + extra.openCurlyToken = extra.tokens.length; + } + } return { type: Token.Punctuator, - value: ch1, + value: String.fromCharCode(code), lineNumber: lineNumber, lineStart: lineStart, - range: [start, index] + start: start, + end: index }; + + default: + code2 = source.charCodeAt(index + 1); + + // '=' (U+003D) marks an assignment or comparison operator. + if (code2 === 0x3D) { + switch (code) { + case 0x2B: // + + case 0x2D: // - + case 0x2F: // / + case 0x3C: // < + case 0x3E: // > + case 0x5E: // ^ + case 0x7C: // | + case 0x25: // % + case 0x26: // & + case 0x2A: // * + index += 2; + return { + type: Token.Punctuator, + value: String.fromCharCode(code) + String.fromCharCode(code2), + lineNumber: lineNumber, + lineStart: lineStart, + start: start, + end: index + }; + + case 0x21: // ! + case 0x3D: // = + index += 2; + + // !== and === + if (source.charCodeAt(index) === 0x3D) { + ++index; + } + return { + type: Token.Punctuator, + value: source.slice(start, index), + lineNumber: lineNumber, + lineStart: lineStart, + start: start, + end: index + }; + } + } } - if (ch1 === ',' || ch1 === '(' || ch1 === ')') { - ++index; + // 4-character punctuator: >>>= + + ch4 = source.substr(index, 4); + + if (ch4 === '>>>=') { + index += 4; return { type: Token.Punctuator, - value: ch1, + value: ch4, lineNumber: lineNumber, lineStart: lineStart, - range: [start, index] + start: start, + end: index }; } - // Dot (.) can also start a floating-point number, hence the need - // to check the next character. + // 3-character punctuators: === !== >>> <<= >>= - ch2 = source[index + 1]; - if (ch1 === '.' && !isDecimalDigit(ch2)) { + ch3 = ch4.substr(0, 3); + + if (ch3 === '>>>' || ch3 === '<<=' || ch3 === '>>=') { + index += 3; return { type: Token.Punctuator, - value: source[index++], + value: ch3, lineNumber: lineNumber, lineStart: lineStart, - range: [start, index] + start: start, + end: index }; } - // Peek more characters. + // Other 2-character punctuators: ++ -- << >> && || + ch2 = ch3.substr(0, 2); - ch3 = source[index + 2]; - ch4 = source[index + 3]; - - // 4-character punctuator: >>>= - - if (ch1 === '>' && ch2 === '>' && ch3 === '>') { - if (ch4 === '=') { - index += 4; - return { - type: Token.Punctuator, - value: '>>>=', - lineNumber: lineNumber, - lineStart: lineStart, - range: [start, index] - }; - } - } - - // 3-character punctuators: === !== >>> <<= >>= - - if (ch1 === '=' && ch2 === '=' && ch3 === '=') { - index += 3; + if ((ch1 === ch2[1] && ('+-<>&|'.indexOf(ch1) >= 0)) || ch2 === '=>') { + index += 2; return { type: Token.Punctuator, - value: '===', + value: ch2, lineNumber: lineNumber, lineStart: lineStart, - range: [start, index] + start: start, + end: index }; } - if (ch1 === '!' && ch2 === '=' && ch3 === '=') { - index += 3; + // 1-character punctuators: < > = ! + - * % & | ^ / + + if ('<>=!+-*%&|^/'.indexOf(ch1) >= 0) { + ++index; return { type: Token.Punctuator, - value: '!==', + value: ch1, lineNumber: lineNumber, lineStart: lineStart, - range: [start, index] + start: start, + end: index }; } - if (ch1 === '>' && ch2 === '>' && ch3 === '>') { - index += 3; - return { - type: Token.Punctuator, - value: '>>>', - lineNumber: lineNumber, - lineStart: lineStart, - range: [start, index] - }; + throwUnexpectedToken(); + } + + // 7.8.3 Numeric Literals + + function scanHexLiteral(start) { + var number = ''; + + while (index < length) { + if (!isHexDigit(source[index])) { + break; + } + number += source[index++]; } - if (ch1 === '<' && ch2 === '<' && ch3 === '=') { - index += 3; - return { - type: Token.Punctuator, - value: '<<=', - lineNumber: lineNumber, - lineStart: lineStart, - range: [start, index] - }; + if (number.length === 0) { + throwUnexpectedToken(); } - if (ch1 === '>' && ch2 === '>' && ch3 === '=') { - index += 3; - return { - type: Token.Punctuator, - value: '>>=', - lineNumber: lineNumber, - lineStart: lineStart, - range: [start, index] - }; + if (isIdentifierStart(source.charCodeAt(index))) { + throwUnexpectedToken(); } - // 2-character punctuators: <= >= == != ++ -- << >> && || - // += -= *= %= &= |= ^= /= + return { + type: Token.NumericLiteral, + value: parseInt('0x' + number, 16), + lineNumber: lineNumber, + lineStart: lineStart, + start: start, + end: index + }; + } + + function scanBinaryLiteral(start) { + var ch, number; - if (ch2 === '=') { - if ('<>=!+-*%&|^/'.indexOf(ch1) >= 0) { - index += 2; - return { - type: Token.Punctuator, - value: ch1 + ch2, - lineNumber: lineNumber, - lineStart: lineStart, - range: [start, index] - }; + number = ''; + + while (index < length) { + ch = source[index]; + if (ch !== '0' && ch !== '1') { + break; } + number += source[index++]; } - if (ch1 === ch2 && ('+-<>&|'.indexOf(ch1) >= 0)) { - if ('+-<>&|'.indexOf(ch2) >= 0) { - index += 2; - return { - type: Token.Punctuator, - value: ch1 + ch2, - lineNumber: lineNumber, - lineStart: lineStart, - range: [start, index] - }; + if (number.length === 0) { + // only 0b or 0B + throwUnexpectedToken(); + } + + if (index < length) { + ch = source.charCodeAt(index); + /* istanbul ignore else */ + if (isIdentifierStart(ch) || isDecimalDigit(ch)) { + throwUnexpectedToken(); } } - // The remaining 1-character punctuators. + return { + type: Token.NumericLiteral, + value: parseInt(number, 2), + lineNumber: lineNumber, + lineStart: lineStart, + start: start, + end: index + }; + } - if ('[]<>+-*%&|^!~?:=/'.indexOf(ch1) >= 0) { - return { - type: Token.Punctuator, - value: source[index++], - lineNumber: lineNumber, - lineStart: lineStart, - range: [start, index] - }; + function scanOctalLiteral(prefix, start) { + var number, octal; + + if (isOctalDigit(prefix)) { + octal = true; + number = '0' + source[index++]; + } else { + octal = false; + ++index; + number = ''; + } + + while (index < length) { + if (!isOctalDigit(source[index])) { + break; + } + number += source[index++]; + } + + if (!octal && number.length === 0) { + // only 0o or 0O + throwUnexpectedToken(); + } + + if (isIdentifierStart(source.charCodeAt(index)) || isDecimalDigit(source.charCodeAt(index))) { + throwUnexpectedToken(); } + + return { + type: Token.NumericLiteral, + value: parseInt(number, 8), + octal: octal, + lineNumber: lineNumber, + lineStart: lineStart, + start: start, + end: index + }; } - // 7.8.3 Numeric Literals + function isImplicitOctalLiteral() { + var i, ch; + + // Implicit octal, unless there is a non-octal digit. + // (Annex B.1.1 on Numeric Literals) + for (i = index + 1; i < length; ++i) { + ch = source[i]; + if (ch === '8' || ch === '9') { + return false; + } + if (!isOctalDigit(ch)) { + return true; + } + } + + return true; + } function scanNumericLiteral() { var number, start, ch; ch = source[index]; - assert(isDecimalDigit(ch) || (ch === '.'), + assert(isDecimalDigit(ch.charCodeAt(0)) || (ch === '.'), 'Numeric literal must start with a decimal digit or a decimal point'); start = index; @@ -724,85 +948,40 @@ parseStatement: true, parseSourceElement: true */ // Hex number starts with '0x'. // Octal number starts with '0'. + // Octal number in ES6 starts with '0o'. + // Binary number in ES6 starts with '0b'. if (number === '0') { if (ch === 'x' || ch === 'X') { - number += source[index++]; - while (index < length) { - ch = source[index]; - if (!isHexDigit(ch)) { - break; - } - number += source[index++]; - } - - if (number.length <= 2) { - // only 0x - throwError({}, Messages.UnexpectedToken, 'ILLEGAL'); - } - - if (index < length) { - ch = source[index]; - if (isIdentifierStart(ch)) { - throwError({}, Messages.UnexpectedToken, 'ILLEGAL'); - } - } - return { - type: Token.NumericLiteral, - value: parseInt(number, 16), - lineNumber: lineNumber, - lineStart: lineStart, - range: [start, index] - }; - } else if (isOctalDigit(ch)) { - number += source[index++]; - while (index < length) { - ch = source[index]; - if (!isOctalDigit(ch)) { - break; - } - number += source[index++]; - } - - if (index < length) { - ch = source[index]; - if (isIdentifierStart(ch) || isDecimalDigit(ch)) { - throwError({}, Messages.UnexpectedToken, 'ILLEGAL'); - } - } - return { - type: Token.NumericLiteral, - value: parseInt(number, 8), - octal: true, - lineNumber: lineNumber, - lineStart: lineStart, - range: [start, index] - }; + ++index; + return scanHexLiteral(start); + } + if (ch === 'b' || ch === 'B') { + ++index; + return scanBinaryLiteral(start); + } + if (ch === 'o' || ch === 'O') { + return scanOctalLiteral(ch, start); } - // decimal number starts with '0' such as '09' is illegal. - if (isDecimalDigit(ch)) { - throwError({}, Messages.UnexpectedToken, 'ILLEGAL'); + if (isOctalDigit(ch)) { + if (isImplicitOctalLiteral()) { + return scanOctalLiteral(ch, start); + } } } - while (index < length) { - ch = source[index]; - if (!isDecimalDigit(ch)) { - break; - } + while (isDecimalDigit(source.charCodeAt(index))) { number += source[index++]; } + ch = source[index]; } if (ch === '.') { number += source[index++]; - while (index < length) { - ch = source[index]; - if (!isDecimalDigit(ch)) { - break; - } + while (isDecimalDigit(source.charCodeAt(index))) { number += source[index++]; } + ch = source[index]; } if (ch === 'e' || ch === 'E') { @@ -812,31 +991,17 @@ parseStatement: true, parseSourceElement: true */ if (ch === '+' || ch === '-') { number += source[index++]; } - - ch = source[index]; - if (isDecimalDigit(ch)) { - number += source[index++]; - while (index < length) { - ch = source[index]; - if (!isDecimalDigit(ch)) { - break; - } + if (isDecimalDigit(source.charCodeAt(index))) { + while (isDecimalDigit(source.charCodeAt(index))) { number += source[index++]; } } else { - ch = 'character ' + ch; - if (index >= length) { - ch = ''; - } - throwError({}, Messages.UnexpectedToken, 'ILLEGAL'); + throwUnexpectedToken(); } } - if (index < length) { - ch = source[index]; - if (isIdentifierStart(ch)) { - throwError({}, Messages.UnexpectedToken, 'ILLEGAL'); - } + if (isIdentifierStart(source.charCodeAt(index))) { + throwUnexpectedToken(); } return { @@ -844,14 +1009,17 @@ parseStatement: true, parseSourceElement: true */ value: parseFloat(number), lineNumber: lineNumber, lineStart: lineStart, - range: [start, index] + start: start, + end: index }; } // 7.8.4 String Literals function scanStringLiteral() { - var str = '', quote, start, ch, code, unescaped, restore, octal = false; + var str = '', quote, start, ch, code, unescaped, restore, octal = false, startLineNumber, startLineStart; + startLineNumber = lineNumber; + startLineStart = lineStart; quote = source[index]; assert((quote === '\'' || quote === '"'), @@ -868,8 +1036,24 @@ parseStatement: true, parseSourceElement: true */ break; } else if (ch === '\\') { ch = source[index++]; - if (!isLineTerminator(ch)) { + if (!ch || !isLineTerminator(ch.charCodeAt(0))) { switch (ch) { + case 'u': + case 'x': + if (source[index] === '{') { + ++index; + str += scanUnicodeCodePointEscape(); + } else { + restore = index; + unescaped = scanHexEscape(ch); + if (unescaped) { + str += unescaped; + } else { + index = restore; + str += ch; + } + } + break; case 'n': str += '\n'; break; @@ -879,17 +1063,6 @@ parseStatement: true, parseSourceElement: true */ case 't': str += '\t'; break; - case 'u': - case 'x': - restore = index; - unescaped = scanHexEscape(ch); - if (unescaped) { - str += unescaped; - } else { - index = restore; - str += ch; - } - break; case 'b': str += '\b'; break; @@ -929,11 +1102,12 @@ parseStatement: true, parseSourceElement: true */ } } else { ++lineNumber; - if (ch === '\r' && source[index] === '\n') { + if (ch === '\r' && source[index] === '\n') { ++index; } + lineStart = index; } - } else if (isLineTerminator(ch)) { + } else if (isLineTerminator(ch.charCodeAt(0))) { break; } else { str += ch; @@ -941,40 +1115,83 @@ parseStatement: true, parseSourceElement: true */ } if (quote !== '') { - throwError({}, Messages.UnexpectedToken, 'ILLEGAL'); + throwUnexpectedToken(); } return { type: Token.StringLiteral, value: str, octal: octal, + startLineNumber: startLineNumber, + startLineStart: startLineStart, lineNumber: lineNumber, lineStart: lineStart, - range: [start, index] + start: start, + end: index }; } - function scanRegExp() { - var str, ch, start, pattern, flags, value, classMarker = false, restore, terminated = false; + function testRegExp(pattern, flags) { + var tmp = pattern, + value; + + if (flags.indexOf('u') >= 0) { + // Replace each astral symbol and every Unicode code point + // escape sequence with a single ASCII symbol to avoid throwing on + // regular expressions that are only valid in combination with the + // `/u` flag. + // Note: replacing with the ASCII symbol `x` might cause false + // negatives in unlikely scenarios. For example, `[\u{61}-b]` is a + // perfectly valid pattern that is equivalent to `[a-b]`, but it + // would be replaced by `[x-b]` which throws an error. + tmp = tmp + .replace(/\\u\{([0-9a-fA-F]+)\}/g, function ($0, $1) { + if (parseInt($1, 16) <= 0x10FFFF) { + return 'x'; + } + throwError(Messages.InvalidRegExp); + }) + .replace(/[\uD800-\uDBFF][\uDC00-\uDFFF]/g, 'x'); + } - buffer = null; - skipComment(); + // First, detect invalid regular expressions. + try { + value = new RegExp(tmp); + } catch (e) { + throwError(Messages.InvalidRegExp); + } + + // Return a regular expression object for this pattern-flag pair, or + // `null` in case the current environment doesn't support the flags it + // uses. + try { + return new RegExp(pattern, flags); + } catch (exception) { + return null; + } + } + + function scanRegExpBody() { + var ch, str, classMarker, terminated, body; - start = index; ch = source[index]; assert(ch === '/', 'Regular expression literal must start with a slash'); str = source[index++]; + classMarker = false; + terminated = false; while (index < length) { ch = source[index++]; str += ch; if (ch === '\\') { ch = source[index++]; // ECMA-262 7.8.5 - if (isLineTerminator(ch)) { - throwError({}, Messages.UnterminatedRegExp); + if (isLineTerminator(ch.charCodeAt(0))) { + throwError(Messages.UnterminatedRegExp); } str += ch; + } else if (isLineTerminator(ch.charCodeAt(0))) { + throwError(Messages.UnterminatedRegExp); } else if (classMarker) { if (ch === ']') { classMarker = false; @@ -985,23 +1202,30 @@ parseStatement: true, parseSourceElement: true */ break; } else if (ch === '[') { classMarker = true; - } else if (isLineTerminator(ch)) { - throwError({}, Messages.UnterminatedRegExp); } } } if (!terminated) { - throwError({}, Messages.UnterminatedRegExp); + throwError(Messages.UnterminatedRegExp); } // Exclude leading and trailing slash. - pattern = str.substr(1, str.length - 2); + body = str.substr(1, str.length - 2); + return { + value: body, + literal: str + }; + } + function scanRegExpFlags() { + var ch, str, flags, restore; + + str = ''; flags = ''; while (index < length) { ch = source[index]; - if (!isIdentifierPart(ch)) { + if (!isIdentifierPart(ch.charCodeAt(0))) { break; } @@ -1014,8 +1238,7 @@ parseStatement: true, parseSourceElement: true */ ch = scanHexEscape('u'); if (ch) { flags += ch; - str += '\\u'; - for (; restore < index; ++restore) { + for (str += '\\u'; restore < index; ++restore) { str += source[restore]; } } else { @@ -1023,8 +1246,10 @@ parseStatement: true, parseSourceElement: true */ flags += 'u'; str += '\\u'; } + tolerateUnexpectedToken(); } else { str += '\\'; + tolerateUnexpectedToken(); } } else { flags += ch; @@ -1032,17 +1257,92 @@ parseStatement: true, parseSourceElement: true */ } } - try { - value = new RegExp(pattern, flags); - } catch (e) { - throwError({}, Messages.InvalidRegExp); + return { + value: flags, + literal: str + }; + } + + function scanRegExp() { + var start, body, flags, value; + + lookahead = null; + skipComment(); + start = index; + + body = scanRegExpBody(); + flags = scanRegExpFlags(); + value = testRegExp(body.value, flags.value); + + if (extra.tokenize) { + return { + type: Token.RegularExpression, + value: value, + regex: { + pattern: body.value, + flags: flags.value + }, + lineNumber: lineNumber, + lineStart: lineStart, + start: start, + end: index + }; } return { - literal: str, + literal: body.literal + flags.literal, value: value, - range: [start, index] + regex: { + pattern: body.value, + flags: flags.value + }, + start: start, + end: index + }; + } + + function collectRegex() { + var pos, loc, regex, token; + + skipComment(); + + pos = index; + loc = { + start: { + line: lineNumber, + column: index - lineStart + } + }; + + regex = scanRegExp(); + + loc.end = { + line: lineNumber, + column: index - lineStart }; + + /* istanbul ignore next */ + if (!extra.tokenize) { + // Pop the previous token, which is likely '/' or '/=' + if (extra.tokens.length > 0) { + token = extra.tokens[extra.tokens.length - 1]; + if (token.range[0] === pos && token.type === 'Punctuator') { + if (token.value === '/' || token.value === '/=') { + extra.tokens.pop(); + } + } + } + + extra.tokens.push({ + type: 'RegularExpression', + value: regex.literal, + regex: regex.regex, + range: [pos, index], + loc: loc + }); + } + + return regex; } function isIdentifierName(token) { @@ -1052,8 +1352,71 @@ parseStatement: true, parseSourceElement: true */ token.type === Token.NullLiteral; } + function advanceSlash() { + var prevToken, + checkToken; + // Using the following algorithm: + // https://github.com/mozilla/sweet.js/wiki/design + prevToken = extra.tokens[extra.tokens.length - 1]; + if (!prevToken) { + // Nothing before that: it cannot be a division. + return collectRegex(); + } + if (prevToken.type === 'Punctuator') { + if (prevToken.value === ']') { + return scanPunctuator(); + } + if (prevToken.value === ')') { + checkToken = extra.tokens[extra.openParenToken - 1]; + if (checkToken && + checkToken.type === 'Keyword' && + (checkToken.value === 'if' || + checkToken.value === 'while' || + checkToken.value === 'for' || + checkToken.value === 'with')) { + return collectRegex(); + } + return scanPunctuator(); + } + if (prevToken.value === '}') { + // Dividing a function by anything makes little sense, + // but we have to check for that. + if (extra.tokens[extra.openCurlyToken - 3] && + extra.tokens[extra.openCurlyToken - 3].type === 'Keyword') { + // Anonymous function. + checkToken = extra.tokens[extra.openCurlyToken - 4]; + if (!checkToken) { + return scanPunctuator(); + } + } else if (extra.tokens[extra.openCurlyToken - 4] && + extra.tokens[extra.openCurlyToken - 4].type === 'Keyword') { + // Named function. + checkToken = extra.tokens[extra.openCurlyToken - 5]; + if (!checkToken) { + return collectRegex(); + } + } else { + return scanPunctuator(); + } + // checkToken determines whether the function is + // a declaration or an expression. + if (FnExprTokens.indexOf(checkToken.value) >= 0) { + // It is an expression. + return scanPunctuator(); + } + // It is a declaration. + return collectRegex(); + } + return collectRegex(); + } + if (prevToken.type === 'Keyword' && prevToken.value !== 'this') { + return collectRegex(); + } + return scanPunctuator(); + } + function advance() { - var ch, token; + var ch; skipComment(); @@ -1062,67 +1425,590 @@ parseStatement: true, parseSourceElement: true */ type: Token.EOF, lineNumber: lineNumber, lineStart: lineStart, - range: [index, index] + start: index, + end: index }; } - token = scanPunctuator(); - if (typeof token !== 'undefined') { - return token; + ch = source.charCodeAt(index); + + if (isIdentifierStart(ch)) { + return scanIdentifier(); } - ch = source[index]; + // Very common: ( and ) and ; + if (ch === 0x28 || ch === 0x29 || ch === 0x3B) { + return scanPunctuator(); + } - if (ch === '\'' || ch === '"') { + // String literal starts with single quote (U+0027) or double quote (U+0022). + if (ch === 0x27 || ch === 0x22) { return scanStringLiteral(); } - if (ch === '.' || isDecimalDigit(ch)) { - return scanNumericLiteral(); - } - token = scanIdentifier(); - if (typeof token !== 'undefined') { - return token; + // Dot (.) U+002E can also start a floating-point number, hence the need + // to check the next character. + if (ch === 0x2E) { + if (isDecimalDigit(source.charCodeAt(index + 1))) { + return scanNumericLiteral(); + } + return scanPunctuator(); } - throwError({}, Messages.UnexpectedToken, 'ILLEGAL'); - } - - function lex() { - var token; + if (isDecimalDigit(ch)) { + return scanNumericLiteral(); + } - if (buffer) { - index = buffer.range[1]; - lineNumber = buffer.lineNumber; - lineStart = buffer.lineStart; - token = buffer; - buffer = null; - return token; + // Slash (/) U+002F can also start a regex. + if (extra.tokenize && ch === 0x2F) { + return advanceSlash(); } - buffer = null; - return advance(); + return scanPunctuator(); } - function lookahead() { - var pos, line, start; - - if (buffer !== null) { - return buffer; - } + function collectToken() { + var loc, token, value, entry; - pos = index; - line = lineNumber; + skipComment(); + loc = { + start: { + line: lineNumber, + column: index - lineStart + } + }; + + token = advance(); + loc.end = { + line: lineNumber, + column: index - lineStart + }; + + if (token.type !== Token.EOF) { + value = source.slice(token.start, token.end); + entry = { + type: TokenName[token.type], + value: value, + range: [token.start, token.end], + loc: loc + }; + if (token.regex) { + entry.regex = { + pattern: token.regex.pattern, + flags: token.regex.flags + }; + } + extra.tokens.push(entry); + } + + return token; + } + + function lex() { + var token; + + token = lookahead; + index = token.end; + lineNumber = token.lineNumber; + lineStart = token.lineStart; + + lookahead = (typeof extra.tokens !== 'undefined') ? collectToken() : advance(); + + index = token.end; + lineNumber = token.lineNumber; + lineStart = token.lineStart; + + return token; + } + + function peek() { + var pos, line, start; + + pos = index; + line = lineNumber; start = lineStart; - buffer = advance(); + lookahead = (typeof extra.tokens !== 'undefined') ? collectToken() : advance(); index = pos; lineNumber = line; lineStart = start; + } + + function Position() { + this.line = lineNumber; + this.column = index - lineStart; + } + + function SourceLocation() { + this.start = new Position(); + this.end = null; + } + + function WrappingSourceLocation(startToken) { + if (startToken.type === Token.StringLiteral) { + this.start = { + line: startToken.startLineNumber, + column: startToken.start - startToken.startLineStart + }; + } else { + this.start = { + line: startToken.lineNumber, + column: startToken.start - startToken.lineStart + }; + } + this.end = null; + } + + function Node() { + // Skip comment. + index = lookahead.start; + if (lookahead.type === Token.StringLiteral) { + lineNumber = lookahead.startLineNumber; + lineStart = lookahead.startLineStart; + } else { + lineNumber = lookahead.lineNumber; + lineStart = lookahead.lineStart; + } + if (extra.range) { + this.range = [index, 0]; + } + if (extra.loc) { + this.loc = new SourceLocation(); + } + } - return buffer; + function WrappingNode(startToken) { + if (extra.range) { + this.range = [startToken.start, 0]; + } + if (extra.loc) { + this.loc = new WrappingSourceLocation(startToken); + } } + WrappingNode.prototype = Node.prototype = { + + processComment: function () { + var lastChild, + leadingComments, + trailingComments, + bottomRight = extra.bottomRightStack, + i, + comment, + last = bottomRight[bottomRight.length - 1]; + + if (this.type === Syntax.Program) { + if (this.body.length > 0) { + return; + } + } + + if (extra.trailingComments.length > 0) { + trailingComments = []; + for (i = extra.trailingComments.length - 1; i >= 0; --i) { + comment = extra.trailingComments[i]; + if (comment.range[0] >= this.range[1]) { + trailingComments.unshift(comment); + extra.trailingComments.splice(i, 1); + } + } + extra.trailingComments = []; + } else { + if (last && last.trailingComments && last.trailingComments[0].range[0] >= this.range[1]) { + trailingComments = last.trailingComments; + delete last.trailingComments; + } + } + + // Eating the stack. + if (last) { + while (last && last.range[0] >= this.range[0]) { + lastChild = last; + last = bottomRight.pop(); + } + } + + if (lastChild) { + if (lastChild.leadingComments && lastChild.leadingComments[lastChild.leadingComments.length - 1].range[1] <= this.range[0]) { + this.leadingComments = lastChild.leadingComments; + lastChild.leadingComments = undefined; + } + } else if (extra.leadingComments.length > 0) { + leadingComments = []; + for (i = extra.leadingComments.length - 1; i >= 0; --i) { + comment = extra.leadingComments[i]; + if (comment.range[1] <= this.range[0]) { + leadingComments.unshift(comment); + extra.leadingComments.splice(i, 1); + } + } + } + + + if (leadingComments && leadingComments.length > 0) { + this.leadingComments = leadingComments; + } + if (trailingComments && trailingComments.length > 0) { + this.trailingComments = trailingComments; + } + + bottomRight.push(this); + }, + + finish: function () { + if (extra.range) { + this.range[1] = index; + } + if (extra.loc) { + this.loc.end = new Position(); + if (extra.source) { + this.loc.source = extra.source; + } + } + + if (extra.attachComment) { + this.processComment(); + } + }, + + finishArrayExpression: function (elements) { + this.type = Syntax.ArrayExpression; + this.elements = elements; + this.finish(); + return this; + }, + + finishArrowFunctionExpression: function (params, defaults, body, expression) { + this.type = Syntax.ArrowFunctionExpression; + this.id = null; + this.params = params; + this.defaults = defaults; + this.body = body; + this.rest = null; + this.generator = false; + this.expression = expression; + this.finish(); + return this; + }, + + finishAssignmentExpression: function (operator, left, right) { + this.type = Syntax.AssignmentExpression; + this.operator = operator; + this.left = left; + this.right = right; + this.finish(); + return this; + }, + + finishBinaryExpression: function (operator, left, right) { + this.type = (operator === '||' || operator === '&&') ? Syntax.LogicalExpression : Syntax.BinaryExpression; + this.operator = operator; + this.left = left; + this.right = right; + this.finish(); + return this; + }, + + finishBlockStatement: function (body) { + this.type = Syntax.BlockStatement; + this.body = body; + this.finish(); + return this; + }, + + finishBreakStatement: function (label) { + this.type = Syntax.BreakStatement; + this.label = label; + this.finish(); + return this; + }, + + finishCallExpression: function (callee, args) { + this.type = Syntax.CallExpression; + this.callee = callee; + this.arguments = args; + this.finish(); + return this; + }, + + finishCatchClause: function (param, body) { + this.type = Syntax.CatchClause; + this.param = param; + this.body = body; + this.finish(); + return this; + }, + + finishConditionalExpression: function (test, consequent, alternate) { + this.type = Syntax.ConditionalExpression; + this.test = test; + this.consequent = consequent; + this.alternate = alternate; + this.finish(); + return this; + }, + + finishContinueStatement: function (label) { + this.type = Syntax.ContinueStatement; + this.label = label; + this.finish(); + return this; + }, + + finishDebuggerStatement: function () { + this.type = Syntax.DebuggerStatement; + this.finish(); + return this; + }, + + finishDoWhileStatement: function (body, test) { + this.type = Syntax.DoWhileStatement; + this.body = body; + this.test = test; + this.finish(); + return this; + }, + + finishEmptyStatement: function () { + this.type = Syntax.EmptyStatement; + this.finish(); + return this; + }, + + finishExpressionStatement: function (expression) { + this.type = Syntax.ExpressionStatement; + this.expression = expression; + this.finish(); + return this; + }, + + finishForStatement: function (init, test, update, body) { + this.type = Syntax.ForStatement; + this.init = init; + this.test = test; + this.update = update; + this.body = body; + this.finish(); + return this; + }, + + finishForInStatement: function (left, right, body) { + this.type = Syntax.ForInStatement; + this.left = left; + this.right = right; + this.body = body; + this.each = false; + this.finish(); + return this; + }, + + finishFunctionDeclaration: function (id, params, defaults, body) { + this.type = Syntax.FunctionDeclaration; + this.id = id; + this.params = params; + this.defaults = defaults; + this.body = body; + this.rest = null; + this.generator = false; + this.expression = false; + this.finish(); + return this; + }, + + finishFunctionExpression: function (id, params, defaults, body) { + this.type = Syntax.FunctionExpression; + this.id = id; + this.params = params; + this.defaults = defaults; + this.body = body; + this.rest = null; + this.generator = false; + this.expression = false; + this.finish(); + return this; + }, + + finishIdentifier: function (name) { + this.type = Syntax.Identifier; + this.name = name; + this.finish(); + return this; + }, + + finishIfStatement: function (test, consequent, alternate) { + this.type = Syntax.IfStatement; + this.test = test; + this.consequent = consequent; + this.alternate = alternate; + this.finish(); + return this; + }, + + finishLabeledStatement: function (label, body) { + this.type = Syntax.LabeledStatement; + this.label = label; + this.body = body; + this.finish(); + return this; + }, + + finishLiteral: function (token) { + this.type = Syntax.Literal; + this.value = token.value; + this.raw = source.slice(token.start, token.end); + if (token.regex) { + this.regex = token.regex; + } + this.finish(); + return this; + }, + + finishMemberExpression: function (accessor, object, property) { + this.type = Syntax.MemberExpression; + this.computed = accessor === '['; + this.object = object; + this.property = property; + this.finish(); + return this; + }, + + finishNewExpression: function (callee, args) { + this.type = Syntax.NewExpression; + this.callee = callee; + this.arguments = args; + this.finish(); + return this; + }, + + finishObjectExpression: function (properties) { + this.type = Syntax.ObjectExpression; + this.properties = properties; + this.finish(); + return this; + }, + + finishPostfixExpression: function (operator, argument) { + this.type = Syntax.UpdateExpression; + this.operator = operator; + this.argument = argument; + this.prefix = false; + this.finish(); + return this; + }, + + finishProgram: function (body) { + this.type = Syntax.Program; + this.body = body; + this.finish(); + return this; + }, + + finishProperty: function (kind, key, value, method, shorthand) { + this.type = Syntax.Property; + this.key = key; + this.value = value; + this.kind = kind; + this.method = method; + this.shorthand = shorthand; + this.finish(); + return this; + }, + + finishReturnStatement: function (argument) { + this.type = Syntax.ReturnStatement; + this.argument = argument; + this.finish(); + return this; + }, + + finishSequenceExpression: function (expressions) { + this.type = Syntax.SequenceExpression; + this.expressions = expressions; + this.finish(); + return this; + }, + + finishSwitchCase: function (test, consequent) { + this.type = Syntax.SwitchCase; + this.test = test; + this.consequent = consequent; + this.finish(); + return this; + }, + + finishSwitchStatement: function (discriminant, cases) { + this.type = Syntax.SwitchStatement; + this.discriminant = discriminant; + this.cases = cases; + this.finish(); + return this; + }, + + finishThisExpression: function () { + this.type = Syntax.ThisExpression; + this.finish(); + return this; + }, + + finishThrowStatement: function (argument) { + this.type = Syntax.ThrowStatement; + this.argument = argument; + this.finish(); + return this; + }, + + finishTryStatement: function (block, guardedHandlers, handlers, finalizer) { + this.type = Syntax.TryStatement; + this.block = block; + this.guardedHandlers = guardedHandlers; + this.handlers = handlers; + this.finalizer = finalizer; + this.finish(); + return this; + }, + + finishUnaryExpression: function (operator, argument) { + this.type = (operator === '++' || operator === '--') ? Syntax.UpdateExpression : Syntax.UnaryExpression; + this.operator = operator; + this.argument = argument; + this.prefix = true; + this.finish(); + return this; + }, + + finishVariableDeclaration: function (declarations, kind) { + this.type = Syntax.VariableDeclaration; + this.declarations = declarations; + this.kind = kind; + this.finish(); + return this; + }, + + finishVariableDeclarator: function (id, init) { + this.type = Syntax.VariableDeclarator; + this.id = id; + this.init = init; + this.finish(); + return this; + }, + + finishWhileStatement: function (test, body) { + this.type = Syntax.WhileStatement; + this.test = test; + this.body = body; + this.finish(); + return this; + }, + + finishWithStatement: function (object, body) { + this.type = Syntax.WithStatement; + this.object = object; + this.body = body; + this.finish(); + return this; + } + }; + // Return true if there is a line terminator before the next token. function peekLineTerminator() { @@ -1140,77 +2026,91 @@ parseStatement: true, parseSourceElement: true */ return found; } + function createError(line, pos, description) { + var error = new Error('Line ' + line + ': ' + description); + error.index = pos; + error.lineNumber = line; + error.column = pos - lineStart + 1; + error.description = description; + return error; + } + // Throw an exception - function throwError(token, messageFormat) { - var error, - args = Array.prototype.slice.call(arguments, 2), - msg = messageFormat.replace( - /%(\d)/g, - function (whole, index) { - return args[index] || ''; - } - ); + function throwError(messageFormat) { + var args, msg; - if (typeof token.lineNumber === 'number') { - error = new Error('Line ' + token.lineNumber + ': ' + msg); - error.index = token.range[0]; - error.lineNumber = token.lineNumber; - error.column = token.range[0] - lineStart + 1; - } else { - error = new Error('Line ' + lineNumber + ': ' + msg); - error.index = index; - error.lineNumber = lineNumber; - error.column = index - lineStart + 1; - } + args = Array.prototype.slice.call(arguments, 1); + msg = messageFormat.replace(/%(\d)/g, + function (whole, idx) { + assert(idx < args.length, 'Message reference must be in range'); + return args[idx]; + } + ); - throw error; + throw createError(lineNumber, index, msg); } - function throwErrorTolerant() { - try { - throwError.apply(null, arguments); - } catch (e) { - if (extra.errors) { - extra.errors.push(e); - } else { - throw e; + function tolerateError(messageFormat) { + var args, msg, error; + + args = Array.prototype.slice.call(arguments, 1); + /* istanbul ignore next */ + msg = messageFormat.replace(/%(\d)/g, + function (whole, idx) { + assert(idx < args.length, 'Message reference must be in range'); + return args[idx]; } + ); + + error = createError(lineNumber, index, msg); + if (extra.errors) { + extra.errors.push(error); + } else { + throw error; } } - // Throw an exception because of the token. - function throwUnexpected(token) { - if (token.type === Token.EOF) { - throwError(token, Messages.UnexpectedEOS); + function unexpectedTokenError(token, message) { + var msg = Messages.UnexpectedToken; + + if (token) { + msg = message ? message : + (token.type === Token.EOF) ? Messages.UnexpectedEOS : + (token.type === Token.Identifier) ? Messages.UnexpectedIdentifier : + (token.type === Token.NumericLiteral) ? Messages.UnexpectedNumber : + (token.type === Token.StringLiteral) ? Messages.UnexpectedString : + Messages.UnexpectedToken; + + if (token.type === Token.Keyword) { + if (isFutureReservedWord(token.value)) { + msg = Messages.UnexpectedReserved; + } else if (strict && isStrictModeReservedWord(token.value)) { + msg = Messages.StrictReservedWord; + } + } } - if (token.type === Token.NumericLiteral) { - throwError(token, Messages.UnexpectedNumber); - } + msg = msg.replace('%0', token ? token.value : 'ILLEGAL'); - if (token.type === Token.StringLiteral) { - throwError(token, Messages.UnexpectedString); - } + return (token && typeof token.lineNumber === 'number') ? + createError(token.lineNumber, token.start, msg) : + createError(lineNumber, index, msg); + } - if (token.type === Token.Identifier) { - throwError(token, Messages.UnexpectedIdentifier); - } + function throwUnexpectedToken(token, message) { + throw unexpectedTokenError(token, message); + } - if (token.type === Token.Keyword) { - if (isFutureReservedWord(token.value)) { - throwError(token, Messages.UnexpectedReserved); - } else if (strict && isStrictModeReservedWord(token.value)) { - throwErrorTolerant(token, Messages.StrictReservedWord); - return; - } - throwError(token, Messages.UnexpectedToken, token.value); + function tolerateUnexpectedToken(token, message) { + var error = unexpectedTokenError(token, message); + if (extra.errors) { + extra.errors.push(error); + } else { + throw error; } - - // BooleanLiteral, NullLiteral, or Punctuator. - throwError(token, Messages.UnexpectedToken, token.value); } // Expect the next token to match the specified punctuator. @@ -1219,7 +2119,31 @@ parseStatement: true, parseSourceElement: true */ function expect(value) { var token = lex(); if (token.type !== Token.Punctuator || token.value !== value) { - throwUnexpected(token); + throwUnexpectedToken(token); + } + } + + /** + * @name expectCommaSeparator + * @description Quietly expect a comma when in tolerant mode, otherwise delegates + * to expect(value) + * @since 2.0 + */ + function expectCommaSeparator() { + var token; + + if (extra.errors) { + token = lookahead; + if (token.type === Token.Punctuator && token.value === ',') { + lex(); + } else if (token.type === Token.Punctuator && token.value === ';') { + lex(); + tolerateUnexpectedToken(token); + } else { + tolerateUnexpectedToken(token, Messages.UnexpectedToken); + } + } else { + expect(','); } } @@ -1229,33 +2153,31 @@ parseStatement: true, parseSourceElement: true */ function expectKeyword(keyword) { var token = lex(); if (token.type !== Token.Keyword || token.value !== keyword) { - throwUnexpected(token); + throwUnexpectedToken(token); } } // Return true if the next token matches the specified punctuator. function match(value) { - var token = lookahead(); - return token.type === Token.Punctuator && token.value === value; + return lookahead.type === Token.Punctuator && lookahead.value === value; } // Return true if the next token matches the specified keyword function matchKeyword(keyword) { - var token = lookahead(); - return token.type === Token.Keyword && token.value === keyword; + return lookahead.type === Token.Keyword && lookahead.value === keyword; } // Return true if the next token is an assignment operator function matchAssign() { - var token = lookahead(), - op = token.value; + var op; - if (token.type !== Token.Punctuator) { + if (lookahead.type !== Token.Punctuator) { return false; } + op = lookahead.value; return op === '=' || op === '*=' || op === '/=' || @@ -1271,10 +2193,11 @@ parseStatement: true, parseSourceElement: true */ } function consumeSemicolon() { - var token, line; + var line, oldIndex = index, oldLineNumber = lineNumber, + oldLineStart = lineStart, oldLookahead = lookahead; - // Catch the very common case first. - if (source[index] === ';') { + // Catch the very common case first: immediately a semicolon (U+003B). + if (source.charCodeAt(index) === 0x3B || match(';')) { lex(); return; } @@ -1282,17 +2205,15 @@ parseStatement: true, parseSourceElement: true */ line = lineNumber; skipComment(); if (lineNumber !== line) { + index = oldIndex; + lineNumber = oldLineNumber; + lineStart = oldLineStart; + lookahead = oldLookahead; return; } - if (match(';')) { - lex(); - return; - } - - token = lookahead(); - if (token.type !== Token.EOF && !match('}')) { - throwUnexpected(token); + if (lookahead.type !== Token.EOF && !match('}')) { + throwUnexpectedToken(lookahead); } } @@ -1305,7 +2226,7 @@ parseStatement: true, parseSourceElement: true */ // 11.1.4 Array Initialiser function parseArrayInitialiser() { - var elements = []; + var elements = [], node = new Node(); expect('['); @@ -1322,61 +2243,59 @@ parseStatement: true, parseSourceElement: true */ } } - expect(']'); + lex(); - return { - type: Syntax.ArrayExpression, - elements: elements - }; + return node.finishArrayExpression(elements); } // 11.1.5 Object Initialiser function parsePropertyFunction(param, first) { - var previousStrict, body; + var previousStrict, body, node = new Node(); previousStrict = strict; body = parseFunctionSourceElements(); if (first && strict && isRestrictedWord(param[0].name)) { - throwErrorTolerant(first, Messages.StrictParamName); + tolerateUnexpectedToken(first, Messages.StrictParamName); } strict = previousStrict; + return node.finishFunctionExpression(null, param, [], body); + } - return { - type: Syntax.FunctionExpression, - id: null, - params: param, - defaults: [], - body: body, - rest: null, - generator: false, - expression: false - }; + function parsePropertyMethodFunction() { + var previousStrict, param, method; + + previousStrict = strict; + strict = true; + param = parseParams(); + method = parsePropertyFunction(param.params); + strict = previousStrict; + + return method; } function parseObjectPropertyKey() { - var token = lex(); + var token, node = new Node(); + + token = lex(); // Note: This function is called only from parseObjectProperty(), where // EOF and Punctuator tokens are already filtered out. if (token.type === Token.StringLiteral || token.type === Token.NumericLiteral) { if (strict && token.octal) { - throwErrorTolerant(token, Messages.StrictOctalLiteral); + tolerateUnexpectedToken(token, Messages.StrictOctalLiteral); } - return createLiteral(token); + return node.finishLiteral(token); } - return { - type: Syntax.Identifier, - name: token.value - }; + return node.finishIdentifier(token.value); } function parseObjectProperty() { - var token, key, id, param; + var token, key, id, value, param, node = new Node(); - token = lookahead(); + token = lookahead; if (token.type === Token.Identifier) { @@ -1384,64 +2303,60 @@ parseStatement: true, parseSourceElement: true */ // Property Assignment: Getter and Setter. - if (token.value === 'get' && !match(':')) { + if (token.value === 'get' && !(match(':') || match('('))) { key = parseObjectPropertyKey(); expect('('); expect(')'); - return { - type: Syntax.Property, - key: key, - value: parsePropertyFunction([]), - kind: 'get' - }; - } else if (token.value === 'set' && !match(':')) { + value = parsePropertyFunction([]); + return node.finishProperty('get', key, value, false, false); + } + if (token.value === 'set' && !(match(':') || match('('))) { key = parseObjectPropertyKey(); expect('('); - token = lookahead(); + token = lookahead; if (token.type !== Token.Identifier) { expect(')'); - throwErrorTolerant(token, Messages.UnexpectedToken, token.value); - return { - type: Syntax.Property, - key: key, - value: parsePropertyFunction([]), - kind: 'set' - }; + tolerateUnexpectedToken(token); + value = parsePropertyFunction([]); } else { param = [ parseVariableIdentifier() ]; expect(')'); - return { - type: Syntax.Property, - key: key, - value: parsePropertyFunction(param, token), - kind: 'set' - }; + value = parsePropertyFunction(param, token); } - } else { - expect(':'); - return { - type: Syntax.Property, - key: id, - value: parseAssignmentExpression(), - kind: 'init' - }; + return node.finishProperty('set', key, value, false, false); + } + if (match(':')) { + lex(); + value = parseAssignmentExpression(); + return node.finishProperty('init', id, value, false, false); + } + if (match('(')) { + value = parsePropertyMethodFunction(); + return node.finishProperty('init', id, value, true, false); } - } else if (token.type === Token.EOF || token.type === Token.Punctuator) { - throwUnexpected(token); + + value = id; + return node.finishProperty('init', id, value, false, true); + } + if (token.type === Token.EOF || token.type === Token.Punctuator) { + throwUnexpectedToken(token); } else { key = parseObjectPropertyKey(); - expect(':'); - return { - type: Syntax.Property, - key: key, - value: parseAssignmentExpression(), - kind: 'init' - }; + if (match(':')) { + lex(); + value = parseAssignmentExpression(); + return node.finishProperty('init', key, value, false, false); + } + if (match('(')) { + value = parsePropertyMethodFunction(); + return node.finishProperty('init', key, value, true, false); + } + throwUnexpectedToken(lex()); } } function parseObjectInitialiser() { - var properties = [], property, name, kind, map = {}, toString = String; + var properties = [], property, name, key, kind, map = {}, toString = String, node = new Node(); expect('{'); @@ -1454,38 +2369,37 @@ parseStatement: true, parseSourceElement: true */ name = toString(property.key.value); } kind = (property.kind === 'init') ? PropertyKind.Data : (property.kind === 'get') ? PropertyKind.Get : PropertyKind.Set; - if (Object.prototype.hasOwnProperty.call(map, name)) { - if (map[name] === PropertyKind.Data) { + + key = '$' + name; + if (Object.prototype.hasOwnProperty.call(map, key)) { + if (map[key] === PropertyKind.Data) { if (strict && kind === PropertyKind.Data) { - throwErrorTolerant({}, Messages.StrictDuplicateProperty); + tolerateError(Messages.StrictDuplicateProperty); } else if (kind !== PropertyKind.Data) { - throwErrorTolerant({}, Messages.AccessorDataProperty); + tolerateError(Messages.AccessorDataProperty); } } else { if (kind === PropertyKind.Data) { - throwErrorTolerant({}, Messages.AccessorDataProperty); - } else if (map[name] & kind) { - throwErrorTolerant({}, Messages.AccessorGetSet); + tolerateError(Messages.AccessorDataProperty); + } else if (map[key] & kind) { + tolerateError(Messages.AccessorGetSet); } } - map[name] |= kind; + map[key] |= kind; } else { - map[name] = kind; + map[key] = kind; } properties.push(property); if (!match('}')) { - expect(','); + expectCommaSeparator(); } } expect('}'); - return { - type: Syntax.ObjectExpression, - properties: properties - }; + return node.finishObjectExpression(properties); } // 11.1.6 The Grouping Operator @@ -1495,6 +2409,13 @@ parseStatement: true, parseSourceElement: true */ expect('('); + if (match(')')) { + lex(); + return PlaceHolders.ArrowParameterPlaceHolder; + } + + ++state.parenthesisCount; + expr = parseExpression(); expect(')'); @@ -1506,46 +2427,10 @@ parseStatement: true, parseSourceElement: true */ // 11.1 Primary Expressions function parsePrimaryExpression() { - var token = lookahead(), - type = token.type; - - if (type === Token.Identifier) { - return { - type: Syntax.Identifier, - name: lex().value - }; - } - - if (type === Token.StringLiteral || type === Token.NumericLiteral) { - if (strict && token.octal) { - throwErrorTolerant(token, Messages.StrictOctalLiteral); - } - return createLiteral(lex()); - } - - if (type === Token.Keyword) { - if (matchKeyword('this')) { - lex(); - return { - type: Syntax.ThisExpression - }; - } - - if (matchKeyword('function')) { - return parseFunctionExpression(); - } - } - - if (type === Token.BooleanLiteral) { - lex(); - token.value = (token.value === 'true'); - return createLiteral(token); - } + var type, token, expr, node; - if (type === Token.NullLiteral) { - lex(); - token.value = null; - return createLiteral(token); + if (match('(')) { + return parseGroupExpression(); } if (match('[')) { @@ -1556,15 +2441,46 @@ parseStatement: true, parseSourceElement: true */ return parseObjectInitialiser(); } - if (match('(')) { - return parseGroupExpression(); - } + type = lookahead.type; + node = new Node(); - if (match('/') || match('/=')) { - return createLiteral(scanRegExp()); + if (type === Token.Identifier) { + expr = node.finishIdentifier(lex().value); + } else if (type === Token.StringLiteral || type === Token.NumericLiteral) { + if (strict && lookahead.octal) { + tolerateUnexpectedToken(lookahead, Messages.StrictOctalLiteral); + } + expr = node.finishLiteral(lex()); + } else if (type === Token.Keyword) { + if (matchKeyword('function')) { + return parseFunctionExpression(); + } + if (matchKeyword('this')) { + lex(); + expr = node.finishThisExpression(); + } else { + throwUnexpectedToken(lex()); + } + } else if (type === Token.BooleanLiteral) { + token = lex(); + token.value = (token.value === 'true'); + expr = node.finishLiteral(token); + } else if (type === Token.NullLiteral) { + token = lex(); + token.value = null; + expr = node.finishLiteral(token); + } else if (match('/') || match('/=')) { + if (typeof extra.tokens !== 'undefined') { + expr = node.finishLiteral(collectRegex()); + } else { + expr = node.finishLiteral(scanRegExp()); + } + peek(); + } else { + throwUnexpectedToken(lex()); } - return throwUnexpected(lex()); + return expr; } // 11.2 Left-Hand-Side Expressions @@ -1580,7 +2496,7 @@ parseStatement: true, parseSourceElement: true */ if (match(')')) { break; } - expect(','); + expectCommaSeparator(); } } @@ -1590,16 +2506,15 @@ parseStatement: true, parseSourceElement: true */ } function parseNonComputedProperty() { - var token = lex(); + var token, node = new Node(); + + token = lex(); if (!isIdentifierName(token)) { - throwUnexpected(token); + throwUnexpectedToken(token); } - return { - type: Syntax.Identifier, - name: token.value - }; + return node.finishIdentifier(token.value); } function parseNonComputedMember() { @@ -1621,107 +2536,84 @@ parseStatement: true, parseSourceElement: true */ } function parseNewExpression() { - var expr; + var callee, args, node = new Node(); expectKeyword('new'); + callee = parseLeftHandSideExpression(); + args = match('(') ? parseArguments() : []; - expr = { - type: Syntax.NewExpression, - callee: parseLeftHandSideExpression(), - 'arguments': [] - }; - - if (match('(')) { - expr['arguments'] = parseArguments(); - } - - return expr; + return node.finishNewExpression(callee, args); } function parseLeftHandSideExpressionAllowCall() { - var expr; + var expr, args, property, startToken, previousAllowIn = state.allowIn; + startToken = lookahead; + state.allowIn = true; expr = matchKeyword('new') ? parseNewExpression() : parsePrimaryExpression(); - while (match('.') || match('[') || match('(')) { - if (match('(')) { - expr = { - type: Syntax.CallExpression, - callee: expr, - 'arguments': parseArguments() - }; + for (;;) { + if (match('.')) { + property = parseNonComputedMember(); + expr = new WrappingNode(startToken).finishMemberExpression('.', expr, property); + } else if (match('(')) { + args = parseArguments(); + expr = new WrappingNode(startToken).finishCallExpression(expr, args); } else if (match('[')) { - expr = { - type: Syntax.MemberExpression, - computed: true, - object: expr, - property: parseComputedMember() - }; + property = parseComputedMember(); + expr = new WrappingNode(startToken).finishMemberExpression('[', expr, property); } else { - expr = { - type: Syntax.MemberExpression, - computed: false, - object: expr, - property: parseNonComputedMember() - }; + break; } } + state.allowIn = previousAllowIn; return expr; } - function parseLeftHandSideExpression() { - var expr; + var expr, property, startToken; + assert(state.allowIn, 'callee of new expression always allow in keyword.'); + + startToken = lookahead; expr = matchKeyword('new') ? parseNewExpression() : parsePrimaryExpression(); - while (match('.') || match('[')) { + for (;;) { if (match('[')) { - expr = { - type: Syntax.MemberExpression, - computed: true, - object: expr, - property: parseComputedMember() - }; + property = parseComputedMember(); + expr = new WrappingNode(startToken).finishMemberExpression('[', expr, property); + } else if (match('.')) { + property = parseNonComputedMember(); + expr = new WrappingNode(startToken).finishMemberExpression('.', expr, property); } else { - expr = { - type: Syntax.MemberExpression, - computed: false, - object: expr, - property: parseNonComputedMember() - }; + break; } } - return expr; } // 11.3 Postfix Expressions function parsePostfixExpression() { - var expr = parseLeftHandSideExpressionAllowCall(), token; + var expr, token, startToken = lookahead; - token = lookahead(); - if (token.type !== Token.Punctuator) { - return expr; - } + expr = parseLeftHandSideExpressionAllowCall(); - if ((match('++') || match('--')) && !peekLineTerminator()) { - // 11.3.1, 11.3.2 - if (strict && expr.type === Syntax.Identifier && isRestrictedWord(expr.name)) { - throwErrorTolerant({}, Messages.StrictLHSPostfix); - } - if (!isLeftHandSide(expr)) { - throwErrorTolerant({}, Messages.InvalidLHSInAssignment); - } + if (lookahead.type === Token.Punctuator) { + if ((match('++') || match('--')) && !peekLineTerminator()) { + // 11.3.1, 11.3.2 + if (strict && expr.type === Syntax.Identifier && isRestrictedWord(expr.name)) { + tolerateError(Messages.StrictLHSPostfix); + } - expr = { - type: Syntax.UpdateExpression, - operator: lex().value, - argument: expr, - prefix: false - }; + if (!isLeftHandSide(expr)) { + tolerateError(Messages.InvalidLHSInAssignment); + } + + token = lex(); + expr = new WrappingNode(startToken).finishPostfixExpression(token.value, expr); + } } return expr; @@ -1730,285 +2622,324 @@ parseStatement: true, parseSourceElement: true */ // 11.4 Unary Operators function parseUnaryExpression() { - var token, expr; - - token = lookahead(); - if (token.type !== Token.Punctuator && token.type !== Token.Keyword) { - return parsePostfixExpression(); - } + var token, expr, startToken; - if (match('++') || match('--')) { + if (lookahead.type !== Token.Punctuator && lookahead.type !== Token.Keyword) { + expr = parsePostfixExpression(); + } else if (match('++') || match('--')) { + startToken = lookahead; token = lex(); expr = parseUnaryExpression(); // 11.4.4, 11.4.5 if (strict && expr.type === Syntax.Identifier && isRestrictedWord(expr.name)) { - throwErrorTolerant({}, Messages.StrictLHSPrefix); + tolerateError(Messages.StrictLHSPrefix); } if (!isLeftHandSide(expr)) { - throwErrorTolerant({}, Messages.InvalidLHSInAssignment); + tolerateError(Messages.InvalidLHSInAssignment); } - expr = { - type: Syntax.UpdateExpression, - operator: token.value, - argument: expr, - prefix: true - }; - return expr; - } - - if (match('+') || match('-') || match('~') || match('!')) { - expr = { - type: Syntax.UnaryExpression, - operator: lex().value, - argument: parseUnaryExpression(), - prefix: true - }; - return expr; - } - - if (matchKeyword('delete') || matchKeyword('void') || matchKeyword('typeof')) { - expr = { - type: Syntax.UnaryExpression, - operator: lex().value, - argument: parseUnaryExpression(), - prefix: true - }; + expr = new WrappingNode(startToken).finishUnaryExpression(token.value, expr); + } else if (match('+') || match('-') || match('~') || match('!')) { + startToken = lookahead; + token = lex(); + expr = parseUnaryExpression(); + expr = new WrappingNode(startToken).finishUnaryExpression(token.value, expr); + } else if (matchKeyword('delete') || matchKeyword('void') || matchKeyword('typeof')) { + startToken = lookahead; + token = lex(); + expr = parseUnaryExpression(); + expr = new WrappingNode(startToken).finishUnaryExpression(token.value, expr); if (strict && expr.operator === 'delete' && expr.argument.type === Syntax.Identifier) { - throwErrorTolerant({}, Messages.StrictDelete); + tolerateError(Messages.StrictDelete); } - return expr; + } else { + expr = parsePostfixExpression(); } - return parsePostfixExpression(); + return expr; } - // 11.5 Multiplicative Operators - - function parseMultiplicativeExpression() { - var expr = parseUnaryExpression(); + function binaryPrecedence(token, allowIn) { + var prec = 0; - while (match('*') || match('/') || match('%')) { - expr = { - type: Syntax.BinaryExpression, - operator: lex().value, - left: expr, - right: parseUnaryExpression() - }; + if (token.type !== Token.Punctuator && token.type !== Token.Keyword) { + return 0; } - return expr; - } - - // 11.6 Additive Operators + switch (token.value) { + case '||': + prec = 1; + break; - function parseAdditiveExpression() { - var expr = parseMultiplicativeExpression(); + case '&&': + prec = 2; + break; - while (match('+') || match('-')) { - expr = { - type: Syntax.BinaryExpression, - operator: lex().value, - left: expr, - right: parseMultiplicativeExpression() - }; - } + case '|': + prec = 3; + break; - return expr; - } + case '^': + prec = 4; + break; - // 11.7 Bitwise Shift Operators + case '&': + prec = 5; + break; - function parseShiftExpression() { - var expr = parseAdditiveExpression(); + case '==': + case '!=': + case '===': + case '!==': + prec = 6; + break; - while (match('<<') || match('>>') || match('>>>')) { - expr = { - type: Syntax.BinaryExpression, - operator: lex().value, - left: expr, - right: parseAdditiveExpression() - }; - } + case '<': + case '>': + case '<=': + case '>=': + case 'instanceof': + prec = 7; + break; - return expr; - } - // 11.8 Relational Operators + case 'in': + prec = allowIn ? 7 : 0; + break; - function parseRelationalExpression() { - var expr, previousAllowIn; + case '<<': + case '>>': + case '>>>': + prec = 8; + break; - previousAllowIn = state.allowIn; - state.allowIn = true; + case '+': + case '-': + prec = 9; + break; - expr = parseShiftExpression(); + case '*': + case '/': + case '%': + prec = 11; + break; - while (match('<') || match('>') || match('<=') || match('>=') || (previousAllowIn && matchKeyword('in')) || matchKeyword('instanceof')) { - expr = { - type: Syntax.BinaryExpression, - operator: lex().value, - left: expr, - right: parseShiftExpression() - }; + default: + break; } - state.allowIn = previousAllowIn; - return expr; + return prec; } + // 11.5 Multiplicative Operators + // 11.6 Additive Operators + // 11.7 Bitwise Shift Operators + // 11.8 Relational Operators // 11.9 Equality Operators + // 11.10 Binary Bitwise Operators + // 11.11 Binary Logical Operators - function parseEqualityExpression() { - var expr = parseRelationalExpression(); + function parseBinaryExpression() { + var marker, markers, expr, token, prec, stack, right, operator, left, i; - while (match('==') || match('!=') || match('===') || match('!==')) { - expr = { - type: Syntax.BinaryExpression, - operator: lex().value, - left: expr, - right: parseRelationalExpression() - }; + marker = lookahead; + left = parseUnaryExpression(); + if (left === PlaceHolders.ArrowParameterPlaceHolder) { + return left; } - return expr; - } + token = lookahead; + prec = binaryPrecedence(token, state.allowIn); + if (prec === 0) { + return left; + } + token.prec = prec; + lex(); - // 11.10 Binary Bitwise Operators + markers = [marker, lookahead]; + right = parseUnaryExpression(); - function parseBitwiseANDExpression() { - var expr = parseEqualityExpression(); + stack = [left, token, right]; - while (match('&')) { - lex(); - expr = { - type: Syntax.BinaryExpression, - operator: '&', - left: expr, - right: parseEqualityExpression() - }; + while ((prec = binaryPrecedence(lookahead, state.allowIn)) > 0) { + + // Reduce: make a binary expression from the three topmost entries. + while ((stack.length > 2) && (prec <= stack[stack.length - 2].prec)) { + right = stack.pop(); + operator = stack.pop().value; + left = stack.pop(); + markers.pop(); + expr = new WrappingNode(markers[markers.length - 1]).finishBinaryExpression(operator, left, right); + stack.push(expr); + } + + // Shift. + token = lex(); + token.prec = prec; + stack.push(token); + markers.push(lookahead); + expr = parseUnaryExpression(); + stack.push(expr); + } + + // Final reduce to clean-up the stack. + i = stack.length - 1; + expr = stack[i]; + markers.pop(); + while (i > 1) { + expr = new WrappingNode(markers.pop()).finishBinaryExpression(stack[i - 1].value, stack[i - 2], expr); + i -= 2; } return expr; } - function parseBitwiseXORExpression() { - var expr = parseBitwiseANDExpression(); - while (match('^')) { + // 11.12 Conditional Operator + + function parseConditionalExpression() { + var expr, previousAllowIn, consequent, alternate, startToken; + + startToken = lookahead; + + expr = parseBinaryExpression(); + if (expr === PlaceHolders.ArrowParameterPlaceHolder) { + return expr; + } + if (match('?')) { lex(); - expr = { - type: Syntax.BinaryExpression, - operator: '^', - left: expr, - right: parseBitwiseANDExpression() - }; + previousAllowIn = state.allowIn; + state.allowIn = true; + consequent = parseAssignmentExpression(); + state.allowIn = previousAllowIn; + expect(':'); + alternate = parseAssignmentExpression(); + + expr = new WrappingNode(startToken).finishConditionalExpression(expr, consequent, alternate); } return expr; } - function parseBitwiseORExpression() { - var expr = parseBitwiseXORExpression(); + // [ES6] 14.2 Arrow Function - while (match('|')) { - lex(); - expr = { - type: Syntax.BinaryExpression, - operator: '|', - left: expr, - right: parseBitwiseXORExpression() - }; + function parseConciseBody() { + if (match('{')) { + return parseFunctionSourceElements(); } - - return expr; + return parseAssignmentExpression(); } - // 11.11 Binary Logical Operators + function reinterpretAsCoverFormalsList(expressions) { + var i, len, param, params, defaults, defaultCount, options, rest, token; - function parseLogicalANDExpression() { - var expr = parseBitwiseORExpression(); + params = []; + defaults = []; + defaultCount = 0; + rest = null; + options = { + paramSet: {} + }; - while (match('&&')) { - lex(); - expr = { - type: Syntax.LogicalExpression, - operator: '&&', - left: expr, - right: parseBitwiseORExpression() - }; + for (i = 0, len = expressions.length; i < len; i += 1) { + param = expressions[i]; + if (param.type === Syntax.Identifier) { + params.push(param); + defaults.push(null); + validateParam(options, param, param.name); + } else if (param.type === Syntax.AssignmentExpression) { + params.push(param.left); + defaults.push(param.right); + ++defaultCount; + validateParam(options, param.left, param.left.name); + } else { + return null; + } } - return expr; - } - - function parseLogicalORExpression() { - var expr = parseLogicalANDExpression(); + if (options.message === Messages.StrictParamDupe) { + token = strict ? options.stricted : options.firstRestricted; + throwUnexpectedToken(token, options.message); + } - while (match('||')) { - lex(); - expr = { - type: Syntax.LogicalExpression, - operator: '||', - left: expr, - right: parseLogicalANDExpression() - }; + if (defaultCount === 0) { + defaults = []; } - return expr; + return { + params: params, + defaults: defaults, + rest: rest, + stricted: options.stricted, + firstRestricted: options.firstRestricted, + message: options.message + }; } - // 11.12 Conditional Operator - - function parseConditionalExpression() { - var expr, previousAllowIn, consequent; + function parseArrowFunctionExpression(options, node) { + var previousStrict, body; - expr = parseLogicalORExpression(); + expect('=>'); + previousStrict = strict; - if (match('?')) { - lex(); - previousAllowIn = state.allowIn; - state.allowIn = true; - consequent = parseAssignmentExpression(); - state.allowIn = previousAllowIn; - expect(':'); + body = parseConciseBody(); - expr = { - type: Syntax.ConditionalExpression, - test: expr, - consequent: consequent, - alternate: parseAssignmentExpression() - }; + if (strict && options.firstRestricted) { + throwUnexpectedToken(options.firstRestricted, options.message); + } + if (strict && options.stricted) { + tolerateUnexpectedToken(options.stricted, options.message); } - return expr; + strict = previousStrict; + + return node.finishArrowFunctionExpression(options.params, options.defaults, body, body.type !== Syntax.BlockStatement); } // 11.13 Assignment Operators function parseAssignmentExpression() { - var token, expr; + var oldParenthesisCount, token, expr, right, list, startToken; + + oldParenthesisCount = state.parenthesisCount; + + startToken = lookahead; + token = lookahead; - token = lookahead(); expr = parseConditionalExpression(); + if (expr === PlaceHolders.ArrowParameterPlaceHolder || match('=>')) { + if (state.parenthesisCount === oldParenthesisCount || + state.parenthesisCount === (oldParenthesisCount + 1)) { + if (expr.type === Syntax.Identifier) { + list = reinterpretAsCoverFormalsList([ expr ]); + } else if (expr.type === Syntax.AssignmentExpression) { + list = reinterpretAsCoverFormalsList([ expr ]); + } else if (expr.type === Syntax.SequenceExpression) { + list = reinterpretAsCoverFormalsList(expr.expressions); + } else if (expr === PlaceHolders.ArrowParameterPlaceHolder) { + list = reinterpretAsCoverFormalsList([]); + } + if (list) { + return parseArrowFunctionExpression(list, new WrappingNode(startToken)); + } + } + } + if (matchAssign()) { // LeftHandSideExpression if (!isLeftHandSide(expr)) { - throwErrorTolerant({}, Messages.InvalidLHSInAssignment); + tolerateError(Messages.InvalidLHSInAssignment); } // 11.13.1 if (strict && expr.type === Syntax.Identifier && isRestrictedWord(expr.name)) { - throwErrorTolerant(token, Messages.StrictLHSAssignment); + tolerateUnexpectedToken(token, Messages.StrictLHSAssignment); } - expr = { - type: Syntax.AssignmentExpression, - operator: lex().value, - left: expr, - right: parseAssignmentExpression() - }; + token = lex(); + right = parseAssignmentExpression(); + expr = new WrappingNode(startToken).finishAssignmentExpression(token.value, expr, right); } return expr; @@ -2017,23 +2948,24 @@ parseStatement: true, parseSourceElement: true */ // 11.14 Comma Operator function parseExpression() { - var expr = parseAssignmentExpression(); + var expr, startToken = lookahead, expressions; + + expr = parseAssignmentExpression(); if (match(',')) { - expr = { - type: Syntax.SequenceExpression, - expressions: [ expr ] - }; + expressions = [expr]; while (index < length) { if (!match(',')) { break; } lex(); - expr.expressions.push(parseAssignmentExpression()); + expressions.push(parseAssignmentExpression()); } + expr = new WrappingNode(startToken).finishSequenceExpression(expressions); } + return expr; } @@ -2058,7 +2990,7 @@ parseStatement: true, parseSourceElement: true */ } function parseBlock() { - var block; + var block, node = new Node(); expect('{'); @@ -2066,34 +2998,35 @@ parseStatement: true, parseSourceElement: true */ expect('}'); - return { - type: Syntax.BlockStatement, - body: block - }; + return node.finishBlockStatement(block); } // 12.2 Variable Statement function parseVariableIdentifier() { - var token = lex(); + var token, node = new Node(); + + token = lex(); if (token.type !== Token.Identifier) { - throwUnexpected(token); + if (strict && token.type === Token.Keyword && isStrictModeReservedWord(token.value)) { + tolerateUnexpectedToken(token, Messages.StrictReservedWord); + } else { + throwUnexpectedToken(token); + } } - return { - type: Syntax.Identifier, - name: token.value - }; + return node.finishIdentifier(token.value); } function parseVariableDeclaration(kind) { - var id = parseVariableIdentifier(), - init = null; + var init = null, id, node = new Node(); + + id = parseVariableIdentifier(); // 12.2.1 if (strict && isRestrictedWord(id.name)) { - throwErrorTolerant({}, Messages.StrictVarName); + tolerateError(Messages.StrictVarName); } if (kind === 'const') { @@ -2104,11 +3037,7 @@ parseStatement: true, parseSourceElement: true */ init = parseAssignmentExpression(); } - return { - type: Syntax.VariableDeclarator, - id: id, - init: init - }; + return node.finishVariableDeclarator(id, init); } function parseVariableDeclarationList(kind) { @@ -2125,7 +3054,7 @@ parseStatement: true, parseSourceElement: true */ return list; } - function parseVariableStatement() { + function parseVariableStatement(node) { var declarations; expectKeyword('var'); @@ -2134,11 +3063,7 @@ parseStatement: true, parseSourceElement: true */ consumeSemicolon(); - return { - type: Syntax.VariableDeclaration, - declarations: declarations, - kind: 'var' - }; + return node.finishVariableDeclaration(declarations, 'var'); } // kind may be `const` or `let` @@ -2146,7 +3071,7 @@ parseStatement: true, parseSourceElement: true */ // see http://wiki.ecmascript.org/doku.php?id=harmony:const // and http://wiki.ecmascript.org/doku.php?id=harmony:let function parseConstLetDeclaration(kind) { - var declarations; + var declarations, node = new Node(); expectKeyword(kind); @@ -2154,39 +3079,28 @@ parseStatement: true, parseSourceElement: true */ consumeSemicolon(); - return { - type: Syntax.VariableDeclaration, - declarations: declarations, - kind: kind - }; + return node.finishVariableDeclaration(declarations, kind); } // 12.3 Empty Statement function parseEmptyStatement() { + var node = new Node(); expect(';'); - - return { - type: Syntax.EmptyStatement - }; + return node.finishEmptyStatement(); } // 12.4 Expression Statement - function parseExpressionStatement() { + function parseExpressionStatement(node) { var expr = parseExpression(); - consumeSemicolon(); - - return { - type: Syntax.ExpressionStatement, - expression: expr - }; + return node.finishExpressionStatement(expr); } // 12.5 If statement - function parseIfStatement() { + function parseIfStatement(node) { var test, consequent, alternate; expectKeyword('if'); @@ -2206,17 +3120,12 @@ parseStatement: true, parseSourceElement: true */ alternate = null; } - return { - type: Syntax.IfStatement, - test: test, - consequent: consequent, - alternate: alternate - }; + return node.finishIfStatement(test, consequent, alternate); } // 12.6 Iteration Statements - function parseDoWhileStatement() { + function parseDoWhileStatement(node) { var body, test, oldInIteration; expectKeyword('do'); @@ -2240,14 +3149,10 @@ parseStatement: true, parseSourceElement: true */ lex(); } - return { - type: Syntax.DoWhileStatement, - body: body, - test: test - }; + return node.finishDoWhileStatement(body, test); } - function parseWhileStatement() { + function parseWhileStatement(node) { var test, body, oldInIteration; expectKeyword('while'); @@ -2265,25 +3170,20 @@ parseStatement: true, parseSourceElement: true */ state.inIteration = oldInIteration; - return { - type: Syntax.WhileStatement, - test: test, - body: body - }; + return node.finishWhileStatement(test, body); } function parseForVariableDeclaration() { - var token = lex(); + var token, declarations, node = new Node(); - return { - type: Syntax.VariableDeclaration, - declarations: parseVariableDeclarationList(), - kind: token.value - }; + token = lex(); + declarations = parseVariableDeclarationList(); + + return node.finishVariableDeclaration(declarations, token.value); } - function parseForStatement() { - var init, test, update, left, right, body, oldInIteration; + function parseForStatement(node) { + var init, test, update, left, right, body, oldInIteration, previousAllowIn = state.allowIn; init = test = update = null; @@ -2297,7 +3197,7 @@ parseStatement: true, parseSourceElement: true */ if (matchKeyword('var') || matchKeyword('let')) { state.allowIn = false; init = parseForVariableDeclaration(); - state.allowIn = true; + state.allowIn = previousAllowIn; if (init.declarations.length === 1 && matchKeyword('in')) { lex(); @@ -2308,12 +3208,12 @@ parseStatement: true, parseSourceElement: true */ } else { state.allowIn = false; init = parseExpression(); - state.allowIn = true; + state.allowIn = previousAllowIn; if (matchKeyword('in')) { // LeftHandSideExpression if (!isLeftHandSide(init)) { - throwErrorTolerant({}, Messages.InvalidLHSInForIn); + tolerateError(Messages.InvalidLHSInForIn); } lex(); @@ -2349,183 +3249,143 @@ parseStatement: true, parseSourceElement: true */ state.inIteration = oldInIteration; - if (typeof left === 'undefined') { - return { - type: Syntax.ForStatement, - init: init, - test: test, - update: update, - body: body - }; - } - - return { - type: Syntax.ForInStatement, - left: left, - right: right, - body: body, - each: false - }; + return (typeof left === 'undefined') ? + node.finishForStatement(init, test, update, body) : + node.finishForInStatement(left, right, body); } // 12.7 The continue statement - function parseContinueStatement() { - var token, label = null; + function parseContinueStatement(node) { + var label = null, key; expectKeyword('continue'); // Optimize the most common form: 'continue;'. - if (source[index] === ';') { + if (source.charCodeAt(index) === 0x3B) { lex(); if (!state.inIteration) { - throwError({}, Messages.IllegalContinue); + throwError(Messages.IllegalContinue); } - return { - type: Syntax.ContinueStatement, - label: null - }; + return node.finishContinueStatement(null); } if (peekLineTerminator()) { if (!state.inIteration) { - throwError({}, Messages.IllegalContinue); + throwError(Messages.IllegalContinue); } - return { - type: Syntax.ContinueStatement, - label: null - }; + return node.finishContinueStatement(null); } - token = lookahead(); - if (token.type === Token.Identifier) { + if (lookahead.type === Token.Identifier) { label = parseVariableIdentifier(); - if (!Object.prototype.hasOwnProperty.call(state.labelSet, label.name)) { - throwError({}, Messages.UnknownLabel, label.name); + key = '$' + label.name; + if (!Object.prototype.hasOwnProperty.call(state.labelSet, key)) { + throwError(Messages.UnknownLabel, label.name); } } consumeSemicolon(); if (label === null && !state.inIteration) { - throwError({}, Messages.IllegalContinue); + throwError(Messages.IllegalContinue); } - return { - type: Syntax.ContinueStatement, - label: label - }; + return node.finishContinueStatement(label); } // 12.8 The break statement - function parseBreakStatement() { - var token, label = null; + function parseBreakStatement(node) { + var label = null, key; expectKeyword('break'); - // Optimize the most common form: 'break;'. - if (source[index] === ';') { + // Catch the very common case first: immediately a semicolon (U+003B). + if (source.charCodeAt(index) === 0x3B) { lex(); if (!(state.inIteration || state.inSwitch)) { - throwError({}, Messages.IllegalBreak); + throwError(Messages.IllegalBreak); } - return { - type: Syntax.BreakStatement, - label: null - }; + return node.finishBreakStatement(null); } if (peekLineTerminator()) { if (!(state.inIteration || state.inSwitch)) { - throwError({}, Messages.IllegalBreak); + throwError(Messages.IllegalBreak); } - return { - type: Syntax.BreakStatement, - label: null - }; + return node.finishBreakStatement(null); } - token = lookahead(); - if (token.type === Token.Identifier) { + if (lookahead.type === Token.Identifier) { label = parseVariableIdentifier(); - if (!Object.prototype.hasOwnProperty.call(state.labelSet, label.name)) { - throwError({}, Messages.UnknownLabel, label.name); + key = '$' + label.name; + if (!Object.prototype.hasOwnProperty.call(state.labelSet, key)) { + throwError(Messages.UnknownLabel, label.name); } } consumeSemicolon(); if (label === null && !(state.inIteration || state.inSwitch)) { - throwError({}, Messages.IllegalBreak); + throwError(Messages.IllegalBreak); } - return { - type: Syntax.BreakStatement, - label: label - }; + return node.finishBreakStatement(label); } // 12.9 The return statement - function parseReturnStatement() { - var token, argument = null; + function parseReturnStatement(node) { + var argument = null; expectKeyword('return'); if (!state.inFunctionBody) { - throwErrorTolerant({}, Messages.IllegalReturn); + tolerateError(Messages.IllegalReturn); } // 'return' followed by a space and an identifier is very common. - if (source[index] === ' ') { - if (isIdentifierStart(source[index + 1])) { + if (source.charCodeAt(index) === 0x20) { + if (isIdentifierStart(source.charCodeAt(index + 1))) { argument = parseExpression(); consumeSemicolon(); - return { - type: Syntax.ReturnStatement, - argument: argument - }; + return node.finishReturnStatement(argument); } } if (peekLineTerminator()) { - return { - type: Syntax.ReturnStatement, - argument: null - }; + return node.finishReturnStatement(null); } if (!match(';')) { - token = lookahead(); - if (!match('}') && token.type !== Token.EOF) { + if (!match('}') && lookahead.type !== Token.EOF) { argument = parseExpression(); } } consumeSemicolon(); - return { - type: Syntax.ReturnStatement, - argument: argument - }; + return node.finishReturnStatement(argument); } // 12.10 The with statement - function parseWithStatement() { + function parseWithStatement(node) { var object, body; if (strict) { - throwErrorTolerant({}, Messages.StrictModeWith); + // TODO(ikarienator): Should we update the test cases instead? + skipComment(); + tolerateError(Messages.StrictModeWith); } expectKeyword('with'); @@ -2538,19 +3398,13 @@ parseStatement: true, parseSourceElement: true */ body = parseStatement(); - return { - type: Syntax.WithStatement, - object: object, - body: body - }; + return node.finishWithStatement(object, body); } // 12.10 The swith statement function parseSwitchCase() { - var test, - consequent = [], - statement; + var test, consequent = [], statement, node = new Node(); if (matchKeyword('default')) { lex(); @@ -2566,20 +3420,13 @@ parseStatement: true, parseSourceElement: true */ break; } statement = parseStatement(); - if (typeof statement === 'undefined') { - break; - } consequent.push(statement); } - return { - type: Syntax.SwitchCase, - test: test, - consequent: consequent - }; + return node.finishSwitchCase(test, consequent); } - function parseSwitchStatement() { + function parseSwitchStatement(node) { var discriminant, cases, clause, oldInSwitch, defaultFound; expectKeyword('switch'); @@ -2596,11 +3443,7 @@ parseStatement: true, parseSourceElement: true */ if (match('}')) { lex(); - return { - type: Syntax.SwitchStatement, - discriminant: discriminant, - cases: cases - }; + return node.finishSwitchStatement(discriminant, cases); } oldInSwitch = state.inSwitch; @@ -2614,7 +3457,7 @@ parseStatement: true, parseSourceElement: true */ clause = parseSwitchCase(); if (clause.test === null) { if (defaultFound) { - throwError({}, Messages.MultipleDefaultsInSwitch); + throwError(Messages.MultipleDefaultsInSwitch); } defaultFound = true; } @@ -2625,62 +3468,51 @@ parseStatement: true, parseSourceElement: true */ expect('}'); - return { - type: Syntax.SwitchStatement, - discriminant: discriminant, - cases: cases - }; + return node.finishSwitchStatement(discriminant, cases); } // 12.13 The throw statement - function parseThrowStatement() { + function parseThrowStatement(node) { var argument; expectKeyword('throw'); if (peekLineTerminator()) { - throwError({}, Messages.NewlineAfterThrow); + throwError(Messages.NewlineAfterThrow); } argument = parseExpression(); consumeSemicolon(); - return { - type: Syntax.ThrowStatement, - argument: argument - }; + return node.finishThrowStatement(argument); } // 12.14 The try statement function parseCatchClause() { - var param; + var param, body, node = new Node(); expectKeyword('catch'); expect('('); if (match(')')) { - throwUnexpected(lookahead()); + throwUnexpectedToken(lookahead); } param = parseVariableIdentifier(); // 12.14.1 if (strict && isRestrictedWord(param.name)) { - throwErrorTolerant({}, Messages.StrictCatchVariable); + tolerateError(Messages.StrictCatchVariable); } expect(')'); - - return { - type: Syntax.CatchClause, - param: param, - body: parseBlock() - }; + body = parseBlock(); + return node.finishCatchClause(param, body); } - function parseTryStatement() { + function parseTryStatement(node) { var block, handlers = [], finalizer = null; expectKeyword('try'); @@ -2697,84 +3529,80 @@ parseStatement: true, parseSourceElement: true */ } if (handlers.length === 0 && !finalizer) { - throwError({}, Messages.NoCatchOrFinally); + throwError(Messages.NoCatchOrFinally); } - return { - type: Syntax.TryStatement, - block: block, - guardedHandlers: [], - handlers: handlers, - finalizer: finalizer - }; + return node.finishTryStatement(block, [], handlers, finalizer); } // 12.15 The debugger statement - function parseDebuggerStatement() { + function parseDebuggerStatement(node) { expectKeyword('debugger'); consumeSemicolon(); - return { - type: Syntax.DebuggerStatement - }; + return node.finishDebuggerStatement(); } // 12 Statements function parseStatement() { - var token = lookahead(), + var type = lookahead.type, expr, - labeledBody; + labeledBody, + key, + node; + + if (type === Token.EOF) { + throwUnexpectedToken(lookahead); + } - if (token.type === Token.EOF) { - throwUnexpected(token); + if (type === Token.Punctuator && lookahead.value === '{') { + return parseBlock(); } - if (token.type === Token.Punctuator) { - switch (token.value) { + node = new Node(); + + if (type === Token.Punctuator) { + switch (lookahead.value) { case ';': - return parseEmptyStatement(); - case '{': - return parseBlock(); + return parseEmptyStatement(node); case '(': - return parseExpressionStatement(); + return parseExpressionStatement(node); default: break; } - } - - if (token.type === Token.Keyword) { - switch (token.value) { + } else if (type === Token.Keyword) { + switch (lookahead.value) { case 'break': - return parseBreakStatement(); + return parseBreakStatement(node); case 'continue': - return parseContinueStatement(); + return parseContinueStatement(node); case 'debugger': - return parseDebuggerStatement(); + return parseDebuggerStatement(node); case 'do': - return parseDoWhileStatement(); + return parseDoWhileStatement(node); case 'for': - return parseForStatement(); + return parseForStatement(node); case 'function': - return parseFunctionDeclaration(); + return parseFunctionDeclaration(node); case 'if': - return parseIfStatement(); + return parseIfStatement(node); case 'return': - return parseReturnStatement(); + return parseReturnStatement(node); case 'switch': - return parseSwitchStatement(); + return parseSwitchStatement(node); case 'throw': - return parseThrowStatement(); + return parseThrowStatement(node); case 'try': - return parseTryStatement(); + return parseTryStatement(node); case 'var': - return parseVariableStatement(); + return parseVariableStatement(node); case 'while': - return parseWhileStatement(); + return parseWhileStatement(node); case 'with': - return parseWithStatement(); + return parseWithStatement(node); default: break; } @@ -2786,42 +3614,36 @@ parseStatement: true, parseSourceElement: true */ if ((expr.type === Syntax.Identifier) && match(':')) { lex(); - if (Object.prototype.hasOwnProperty.call(state.labelSet, expr.name)) { - throwError({}, Messages.Redeclaration, 'Label', expr.name); + key = '$' + expr.name; + if (Object.prototype.hasOwnProperty.call(state.labelSet, key)) { + throwError(Messages.Redeclaration, 'Label', expr.name); } - state.labelSet[expr.name] = true; + state.labelSet[key] = true; labeledBody = parseStatement(); - delete state.labelSet[expr.name]; - - return { - type: Syntax.LabeledStatement, - label: expr, - body: labeledBody - }; + delete state.labelSet[key]; + return node.finishLabeledStatement(expr, labeledBody); } consumeSemicolon(); - return { - type: Syntax.ExpressionStatement, - expression: expr - }; + return node.finishExpressionStatement(expr); } // 13 Function Definition function parseFunctionSourceElements() { var sourceElement, sourceElements = [], token, directive, firstRestricted, - oldLabelSet, oldInIteration, oldInSwitch, oldInFunctionBody; + oldLabelSet, oldInIteration, oldInSwitch, oldInFunctionBody, oldParenthesisCount, + node = new Node(); expect('{'); while (index < length) { - token = lookahead(); - if (token.type !== Token.StringLiteral) { + if (lookahead.type !== Token.StringLiteral) { break; } + token = lookahead; sourceElement = parseSourceElement(); sourceElements.push(sourceElement); @@ -2829,11 +3651,11 @@ parseStatement: true, parseSourceElement: true */ // this is not directive break; } - directive = sliceSource(token.range[0] + 1, token.range[1] - 1); + directive = source.slice(token.start + 1, token.end - 1); if (directive === 'use strict') { strict = true; if (firstRestricted) { - throwErrorTolerant(firstRestricted, Messages.StrictOctalLiteral); + tolerateUnexpectedToken(firstRestricted, Messages.StrictOctalLiteral); } } else { if (!firstRestricted && token.octal) { @@ -2846,11 +3668,13 @@ parseStatement: true, parseSourceElement: true */ oldInIteration = state.inIteration; oldInSwitch = state.inSwitch; oldInFunctionBody = state.inFunctionBody; + oldParenthesisCount = state.parenthesizedCount; state.labelSet = {}; state.inIteration = false; state.inSwitch = false; state.inFunctionBody = true; + state.parenthesizedCount = 0; while (index < length) { if (match('}')) { @@ -2869,64 +3693,71 @@ parseStatement: true, parseSourceElement: true */ state.inIteration = oldInIteration; state.inSwitch = oldInSwitch; state.inFunctionBody = oldInFunctionBody; + state.parenthesizedCount = oldParenthesisCount; - return { - type: Syntax.BlockStatement, - body: sourceElements - }; + return node.finishBlockStatement(sourceElements); } - function parseFunctionDeclaration() { - var id, param, params = [], body, token, stricted, firstRestricted, message, previousStrict, paramSet; - - expectKeyword('function'); - token = lookahead(); - id = parseVariableIdentifier(); + function validateParam(options, param, name) { + var key = '$' + name; if (strict) { - if (isRestrictedWord(token.value)) { - throwErrorTolerant(token, Messages.StrictFunctionName); + if (isRestrictedWord(name)) { + options.stricted = param; + options.message = Messages.StrictParamName; } - } else { - if (isRestrictedWord(token.value)) { - firstRestricted = token; - message = Messages.StrictFunctionName; - } else if (isStrictModeReservedWord(token.value)) { - firstRestricted = token; - message = Messages.StrictReservedWord; + if (Object.prototype.hasOwnProperty.call(options.paramSet, key)) { + options.stricted = param; + options.message = Messages.StrictParamDupe; } + } else if (!options.firstRestricted) { + if (isRestrictedWord(name)) { + options.firstRestricted = param; + options.message = Messages.StrictParamName; + } else if (isStrictModeReservedWord(name)) { + options.firstRestricted = param; + options.message = Messages.StrictReservedWord; + } else if (Object.prototype.hasOwnProperty.call(options.paramSet, key)) { + options.firstRestricted = param; + options.message = Messages.StrictParamDupe; + } + } + options.paramSet[key] = true; + } + + function parseParam(options) { + var token, param, def; + + token = lookahead; + param = parseVariableIdentifier(); + validateParam(options, token, token.value); + if (match('=')) { + lex(); + def = parseAssignmentExpression(); + ++options.defaultCount; } + options.params.push(param); + options.defaults.push(def); + + return !match(')'); + } + + function parseParams(firstRestricted) { + var options; + + options = { + params: [], + defaultCount: 0, + defaults: [], + firstRestricted: firstRestricted + }; + expect('('); if (!match(')')) { - paramSet = {}; + options.paramSet = {}; while (index < length) { - token = lookahead(); - param = parseVariableIdentifier(); - if (strict) { - if (isRestrictedWord(token.value)) { - stricted = token; - message = Messages.StrictParamName; - } - if (Object.prototype.hasOwnProperty.call(paramSet, token.value)) { - stricted = token; - message = Messages.StrictParamDupe; - } - } else if (!firstRestricted) { - if (isRestrictedWord(token.value)) { - firstRestricted = token; - message = Messages.StrictParamName; - } else if (isStrictModeReservedWord(token.value)) { - firstRestricted = token; - message = Messages.StrictReservedWord; - } else if (Object.prototype.hasOwnProperty.call(paramSet, token.value)) { - firstRestricted = token; - message = Messages.StrictParamDupe; - } - } - params.push(param); - paramSet[param.name] = true; - if (match(')')) { + if (!parseParam(options)) { break; } expect(','); @@ -2935,39 +3766,73 @@ parseStatement: true, parseSourceElement: true */ expect(')'); + if (options.defaultCount === 0) { + options.defaults = []; + } + + return { + params: options.params, + defaults: options.defaults, + stricted: options.stricted, + firstRestricted: options.firstRestricted, + message: options.message + }; + } + + function parseFunctionDeclaration() { + var id, params = [], defaults = [], body, token, stricted, tmp, firstRestricted, message, previousStrict, node = new Node(); + + expectKeyword('function'); + token = lookahead; + id = parseVariableIdentifier(); + if (strict) { + if (isRestrictedWord(token.value)) { + tolerateUnexpectedToken(token, Messages.StrictFunctionName); + } + } else { + if (isRestrictedWord(token.value)) { + firstRestricted = token; + message = Messages.StrictFunctionName; + } else if (isStrictModeReservedWord(token.value)) { + firstRestricted = token; + message = Messages.StrictReservedWord; + } + } + + tmp = parseParams(firstRestricted); + params = tmp.params; + defaults = tmp.defaults; + stricted = tmp.stricted; + firstRestricted = tmp.firstRestricted; + if (tmp.message) { + message = tmp.message; + } + previousStrict = strict; body = parseFunctionSourceElements(); if (strict && firstRestricted) { - throwError(firstRestricted, message); + throwUnexpectedToken(firstRestricted, message); } if (strict && stricted) { - throwErrorTolerant(stricted, message); + tolerateUnexpectedToken(stricted, message); } strict = previousStrict; - return { - type: Syntax.FunctionDeclaration, - id: id, - params: params, - defaults: [], - body: body, - rest: null, - generator: false, - expression: false - }; + return node.finishFunctionDeclaration(id, params, defaults, body); } function parseFunctionExpression() { - var token, id = null, stricted, firstRestricted, message, param, params = [], body, previousStrict, paramSet; + var token, id = null, stricted, firstRestricted, message, tmp, + params = [], defaults = [], body, previousStrict, node = new Node(); expectKeyword('function'); if (!match('(')) { - token = lookahead(); + token = lookahead; id = parseVariableIdentifier(); if (strict) { if (isRestrictedWord(token.value)) { - throwErrorTolerant(token, Messages.StrictFunctionName); + tolerateUnexpectedToken(token, Messages.StrictFunctionName); } } else { if (isRestrictedWord(token.value)) { @@ -2980,77 +3845,36 @@ parseStatement: true, parseSourceElement: true */ } } - expect('('); - - if (!match(')')) { - paramSet = {}; - while (index < length) { - token = lookahead(); - param = parseVariableIdentifier(); - if (strict) { - if (isRestrictedWord(token.value)) { - stricted = token; - message = Messages.StrictParamName; - } - if (Object.prototype.hasOwnProperty.call(paramSet, token.value)) { - stricted = token; - message = Messages.StrictParamDupe; - } - } else if (!firstRestricted) { - if (isRestrictedWord(token.value)) { - firstRestricted = token; - message = Messages.StrictParamName; - } else if (isStrictModeReservedWord(token.value)) { - firstRestricted = token; - message = Messages.StrictReservedWord; - } else if (Object.prototype.hasOwnProperty.call(paramSet, token.value)) { - firstRestricted = token; - message = Messages.StrictParamDupe; - } - } - params.push(param); - paramSet[param.name] = true; - if (match(')')) { - break; - } - expect(','); - } + tmp = parseParams(firstRestricted); + params = tmp.params; + defaults = tmp.defaults; + stricted = tmp.stricted; + firstRestricted = tmp.firstRestricted; + if (tmp.message) { + message = tmp.message; } - expect(')'); - previousStrict = strict; body = parseFunctionSourceElements(); if (strict && firstRestricted) { - throwError(firstRestricted, message); + throwUnexpectedToken(firstRestricted, message); } if (strict && stricted) { - throwErrorTolerant(stricted, message); + tolerateUnexpectedToken(stricted, message); } strict = previousStrict; - return { - type: Syntax.FunctionExpression, - id: id, - params: params, - defaults: [], - body: body, - rest: null, - generator: false, - expression: false - }; + return node.finishFunctionExpression(id, params, defaults, body); } // 14 Program function parseSourceElement() { - var token = lookahead(); - - if (token.type === Token.Keyword) { - switch (token.value) { + if (lookahead.type === Token.Keyword) { + switch (lookahead.value) { case 'const': case 'let': - return parseConstLetDeclaration(token.value); + return parseConstLetDeclaration(lookahead.value); case 'function': return parseFunctionDeclaration(); default: @@ -3058,7 +3882,7 @@ parseStatement: true, parseSourceElement: true */ } } - if (token.type !== Token.EOF) { + if (lookahead.type !== Token.EOF) { return parseStatement(); } } @@ -3067,7 +3891,7 @@ parseStatement: true, parseSourceElement: true */ var sourceElement, sourceElements = [], token, directive, firstRestricted; while (index < length) { - token = lookahead(); + token = lookahead; if (token.type !== Token.StringLiteral) { break; } @@ -3078,11 +3902,11 @@ parseStatement: true, parseSourceElement: true */ // this is not directive break; } - directive = sliceSource(token.range[0] + 1, token.range[1] - 1); + directive = source.slice(token.start + 1, token.end - 1); if (directive === 'use strict') { strict = true; if (firstRestricted) { - throwErrorTolerant(firstRestricted, Messages.StrictOctalLiteral); + tolerateUnexpectedToken(firstRestricted, Messages.StrictOctalLiteral); } } else { if (!firstRestricted && token.octal) { @@ -3093,6 +3917,7 @@ parseStatement: true, parseSourceElement: true */ while (index < length) { sourceElement = parseSourceElement(); + /* istanbul ignore if */ if (typeof sourceElement === 'undefined') { break; } @@ -3102,251 +3927,15 @@ parseStatement: true, parseSourceElement: true */ } function parseProgram() { - var program; - strict = false; - program = { - type: Syntax.Program, - body: parseSourceElements() - }; - return program; - } - - // The following functions are needed only when the option to preserve - // the comments is active. - - function addComment(type, value, start, end, loc) { - assert(typeof start === 'number', 'Comment must have valid position'); - - // Because the way the actual token is scanned, often the comments - // (if any) are skipped twice during the lexical analysis. - // Thus, we need to skip adding a comment if the comment array already - // handled it. - if (extra.comments.length > 0) { - if (extra.comments[extra.comments.length - 1].range[1] > start) { - return; - } - } - - extra.comments.push({ - type: type, - value: value, - range: [start, end], - loc: loc - }); - } - - function scanComment() { - var comment, ch, loc, start, blockComment, lineComment; - - comment = ''; - blockComment = false; - lineComment = false; - - while (index < length) { - ch = source[index]; - - if (lineComment) { - ch = source[index++]; - if (isLineTerminator(ch)) { - loc.end = { - line: lineNumber, - column: index - lineStart - 1 - }; - lineComment = false; - addComment('Line', comment, start, index - 1, loc); - if (ch === '\r' && source[index] === '\n') { - ++index; - } - ++lineNumber; - lineStart = index; - comment = ''; - } else if (index >= length) { - lineComment = false; - comment += ch; - loc.end = { - line: lineNumber, - column: length - lineStart - }; - addComment('Line', comment, start, length, loc); - } else { - comment += ch; - } - } else if (blockComment) { - if (isLineTerminator(ch)) { - if (ch === '\r' && source[index + 1] === '\n') { - ++index; - comment += '\r\n'; - } else { - comment += ch; - } - ++lineNumber; - ++index; - lineStart = index; - if (index >= length) { - throwError({}, Messages.UnexpectedToken, 'ILLEGAL'); - } - } else { - ch = source[index++]; - if (index >= length) { - throwError({}, Messages.UnexpectedToken, 'ILLEGAL'); - } - comment += ch; - if (ch === '*') { - ch = source[index]; - if (ch === '/') { - comment = comment.substr(0, comment.length - 1); - blockComment = false; - ++index; - loc.end = { - line: lineNumber, - column: index - lineStart - }; - addComment('Block', comment, start, index, loc); - comment = ''; - } - } - } - } else if (ch === '/') { - ch = source[index + 1]; - if (ch === '/') { - loc = { - start: { - line: lineNumber, - column: index - lineStart - } - }; - start = index; - index += 2; - lineComment = true; - if (index >= length) { - loc.end = { - line: lineNumber, - column: index - lineStart - }; - lineComment = false; - addComment('Line', comment, start, index, loc); - } - } else if (ch === '*') { - start = index; - index += 2; - blockComment = true; - loc = { - start: { - line: lineNumber, - column: index - lineStart - 2 - } - }; - if (index >= length) { - throwError({}, Messages.UnexpectedToken, 'ILLEGAL'); - } - } else { - break; - } - } else if (isWhiteSpace(ch)) { - ++index; - } else if (isLineTerminator(ch)) { - ++index; - if (ch === '\r' && source[index] === '\n') { - ++index; - } - ++lineNumber; - lineStart = index; - } else { - break; - } - } - } - - function filterCommentLocation() { - var i, entry, comment, comments = []; - - for (i = 0; i < extra.comments.length; ++i) { - entry = extra.comments[i]; - comment = { - type: entry.type, - value: entry.value - }; - if (extra.range) { - comment.range = entry.range; - } - if (extra.loc) { - comment.loc = entry.loc; - } - comments.push(comment); - } - - extra.comments = comments; - } - - function collectToken() { - var start, loc, token, range, value; + var body, node; skipComment(); - start = index; - loc = { - start: { - line: lineNumber, - column: index - lineStart - } - }; - - token = extra.advance(); - loc.end = { - line: lineNumber, - column: index - lineStart - }; - - if (token.type !== Token.EOF) { - range = [token.range[0], token.range[1]]; - value = sliceSource(token.range[0], token.range[1]); - extra.tokens.push({ - type: TokenName[token.type], - value: value, - range: range, - loc: loc - }); - } - - return token; - } - - function collectRegex() { - var pos, loc, regex, token; - - skipComment(); - - pos = index; - loc = { - start: { - line: lineNumber, - column: index - lineStart - } - }; - - regex = extra.scanRegExp(); - loc.end = { - line: lineNumber, - column: index - lineStart - }; - - // Pop the previous token, which is likely '/' or '/=' - if (extra.tokens.length > 0) { - token = extra.tokens[extra.tokens.length - 1]; - if (token.range[0] === pos && token.type === 'Punctuator') { - if (token.value === '/' || token.value === '/=') { - extra.tokens.pop(); - } - } - } - - extra.tokens.push({ - type: 'RegularExpression', - value: regex.literal, - range: [pos, index], - loc: loc - }); + peek(); + node = new Node(); + strict = false; - return regex; + body = parseSourceElements(); + return node.finishProgram(body); } function filterTokenLocation() { @@ -3358,6 +3947,12 @@ parseStatement: true, parseSourceElement: true */ type: entry.type, value: entry.value }; + if (entry.regex) { + token.regex = { + pattern: entry.regex.pattern, + flags: entry.regex.flags + }; + } if (extra.range) { token.range = entry.range; } @@ -3370,431 +3965,89 @@ parseStatement: true, parseSourceElement: true */ extra.tokens = tokens; } - function createLiteral(token) { - return { - type: Syntax.Literal, - value: token.value - }; - } - - function createRawLiteral(token) { - return { - type: Syntax.Literal, - value: token.value, - raw: sliceSource(token.range[0], token.range[1]) - }; - } - - function createLocationMarker() { - var marker = {}; + function tokenize(code, options) { + var toString, + tokens; - marker.range = [index, index]; - marker.loc = { - start: { - line: lineNumber, - column: index - lineStart - }, - end: { - line: lineNumber, - column: index - lineStart - } - }; - - marker.end = function () { - this.range[1] = index; - this.loc.end.line = lineNumber; - this.loc.end.column = index - lineStart; - }; - - marker.applyGroup = function (node) { - if (extra.range) { - node.groupRange = [this.range[0], this.range[1]]; - } - if (extra.loc) { - node.groupLoc = { - start: { - line: this.loc.start.line, - column: this.loc.start.column - }, - end: { - line: this.loc.end.line, - column: this.loc.end.column - } - }; - } - }; + toString = String; + if (typeof code !== 'string' && !(code instanceof String)) { + code = toString(code); + } - marker.apply = function (node) { - if (extra.range) { - node.range = [this.range[0], this.range[1]]; - } - if (extra.loc) { - node.loc = { - start: { - line: this.loc.start.line, - column: this.loc.start.column - }, - end: { - line: this.loc.end.line, - column: this.loc.end.column - } - }; - } + source = code; + index = 0; + lineNumber = (source.length > 0) ? 1 : 0; + lineStart = 0; + length = source.length; + lookahead = null; + state = { + allowIn: true, + labelSet: {}, + inFunctionBody: false, + inIteration: false, + inSwitch: false, + lastCommentStart: -1 }; - return marker; - } - - function trackGroupExpression() { - var marker, expr; - - skipComment(); - marker = createLocationMarker(); - expect('('); - - expr = parseExpression(); - - expect(')'); - - marker.end(); - marker.applyGroup(expr); - - return expr; - } - - function trackLeftHandSideExpression() { - var marker, expr; - - skipComment(); - marker = createLocationMarker(); - - expr = matchKeyword('new') ? parseNewExpression() : parsePrimaryExpression(); - - while (match('.') || match('[')) { - if (match('[')) { - expr = { - type: Syntax.MemberExpression, - computed: true, - object: expr, - property: parseComputedMember() - }; - marker.end(); - marker.apply(expr); - } else { - expr = { - type: Syntax.MemberExpression, - computed: false, - object: expr, - property: parseNonComputedMember() - }; - marker.end(); - marker.apply(expr); - } - } - - return expr; - } + extra = {}; - function trackLeftHandSideExpressionAllowCall() { - var marker, expr; + // Options matching. + options = options || {}; - skipComment(); - marker = createLocationMarker(); + // Of course we collect tokens here. + options.tokens = true; + extra.tokens = []; + extra.tokenize = true; + // The following two fields are necessary to compute the Regex tokens. + extra.openParenToken = -1; + extra.openCurlyToken = -1; - expr = matchKeyword('new') ? parseNewExpression() : parsePrimaryExpression(); + extra.range = (typeof options.range === 'boolean') && options.range; + extra.loc = (typeof options.loc === 'boolean') && options.loc; - while (match('.') || match('[') || match('(')) { - if (match('(')) { - expr = { - type: Syntax.CallExpression, - callee: expr, - 'arguments': parseArguments() - }; - marker.end(); - marker.apply(expr); - } else if (match('[')) { - expr = { - type: Syntax.MemberExpression, - computed: true, - object: expr, - property: parseComputedMember() - }; - marker.end(); - marker.apply(expr); - } else { - expr = { - type: Syntax.MemberExpression, - computed: false, - object: expr, - property: parseNonComputedMember() - }; - marker.end(); - marker.apply(expr); - } + if (typeof options.comment === 'boolean' && options.comment) { + extra.comments = []; } - - return expr; - } - - function filterGroup(node) { - var n, i, entry; - - n = (Object.prototype.toString.apply(node) === '[object Array]') ? [] : {}; - for (i in node) { - if (node.hasOwnProperty(i) && i !== 'groupRange' && i !== 'groupLoc') { - entry = node[i]; - if (entry === null || typeof entry !== 'object' || entry instanceof RegExp) { - n[i] = entry; - } else { - n[i] = filterGroup(entry); - } - } + if (typeof options.tolerant === 'boolean' && options.tolerant) { + extra.errors = []; } - return n; - } - - function wrapTrackingFunction(range, loc) { - return function (parseFunction) { - - function isBinary(node) { - return node.type === Syntax.LogicalExpression || - node.type === Syntax.BinaryExpression; + try { + peek(); + if (lookahead.type === Token.EOF) { + return extra.tokens; } - function visit(node) { - var start, end; - - if (isBinary(node.left)) { - visit(node.left); - } - if (isBinary(node.right)) { - visit(node.right); - } - - if (range) { - if (node.left.groupRange || node.right.groupRange) { - start = node.left.groupRange ? node.left.groupRange[0] : node.left.range[0]; - end = node.right.groupRange ? node.right.groupRange[1] : node.right.range[1]; - node.range = [start, end]; - } else if (typeof node.range === 'undefined') { - start = node.left.range[0]; - end = node.right.range[1]; - node.range = [start, end]; - } - } - if (loc) { - if (node.left.groupLoc || node.right.groupLoc) { - start = node.left.groupLoc ? node.left.groupLoc.start : node.left.loc.start; - end = node.right.groupLoc ? node.right.groupLoc.end : node.right.loc.end; - node.loc = { - start: start, - end: end - }; - } else if (typeof node.loc === 'undefined') { - node.loc = { - start: node.left.loc.start, - end: node.right.loc.end - }; + lex(); + while (lookahead.type !== Token.EOF) { + try { + lex(); + } catch (lexError) { + if (extra.errors) { + extra.errors.push(lexError); + // We have to break on the first error + // to avoid infinite loops. + break; + } else { + throw lexError; } } } - return function () { - var marker, node; - - skipComment(); - - marker = createLocationMarker(); - node = parseFunction.apply(null, arguments); - marker.end(); - - if (range && typeof node.range === 'undefined') { - marker.apply(node); - } - - if (loc && typeof node.loc === 'undefined') { - marker.apply(node); - } - - if (isBinary(node)) { - visit(node); - } - - return node; - }; - }; - } - - function patch() { - - var wrapTracking; - - if (extra.comments) { - extra.skipComment = skipComment; - skipComment = scanComment; - } - - if (extra.raw) { - extra.createLiteral = createLiteral; - createLiteral = createRawLiteral; - } - - if (extra.range || extra.loc) { - - extra.parseGroupExpression = parseGroupExpression; - extra.parseLeftHandSideExpression = parseLeftHandSideExpression; - extra.parseLeftHandSideExpressionAllowCall = parseLeftHandSideExpressionAllowCall; - parseGroupExpression = trackGroupExpression; - parseLeftHandSideExpression = trackLeftHandSideExpression; - parseLeftHandSideExpressionAllowCall = trackLeftHandSideExpressionAllowCall; - - wrapTracking = wrapTrackingFunction(extra.range, extra.loc); - - extra.parseAdditiveExpression = parseAdditiveExpression; - extra.parseAssignmentExpression = parseAssignmentExpression; - extra.parseBitwiseANDExpression = parseBitwiseANDExpression; - extra.parseBitwiseORExpression = parseBitwiseORExpression; - extra.parseBitwiseXORExpression = parseBitwiseXORExpression; - extra.parseBlock = parseBlock; - extra.parseFunctionSourceElements = parseFunctionSourceElements; - extra.parseCatchClause = parseCatchClause; - extra.parseComputedMember = parseComputedMember; - extra.parseConditionalExpression = parseConditionalExpression; - extra.parseConstLetDeclaration = parseConstLetDeclaration; - extra.parseEqualityExpression = parseEqualityExpression; - extra.parseExpression = parseExpression; - extra.parseForVariableDeclaration = parseForVariableDeclaration; - extra.parseFunctionDeclaration = parseFunctionDeclaration; - extra.parseFunctionExpression = parseFunctionExpression; - extra.parseLogicalANDExpression = parseLogicalANDExpression; - extra.parseLogicalORExpression = parseLogicalORExpression; - extra.parseMultiplicativeExpression = parseMultiplicativeExpression; - extra.parseNewExpression = parseNewExpression; - extra.parseNonComputedProperty = parseNonComputedProperty; - extra.parseObjectProperty = parseObjectProperty; - extra.parseObjectPropertyKey = parseObjectPropertyKey; - extra.parsePostfixExpression = parsePostfixExpression; - extra.parsePrimaryExpression = parsePrimaryExpression; - extra.parseProgram = parseProgram; - extra.parsePropertyFunction = parsePropertyFunction; - extra.parseRelationalExpression = parseRelationalExpression; - extra.parseStatement = parseStatement; - extra.parseShiftExpression = parseShiftExpression; - extra.parseSwitchCase = parseSwitchCase; - extra.parseUnaryExpression = parseUnaryExpression; - extra.parseVariableDeclaration = parseVariableDeclaration; - extra.parseVariableIdentifier = parseVariableIdentifier; - - parseAdditiveExpression = wrapTracking(extra.parseAdditiveExpression); - parseAssignmentExpression = wrapTracking(extra.parseAssignmentExpression); - parseBitwiseANDExpression = wrapTracking(extra.parseBitwiseANDExpression); - parseBitwiseORExpression = wrapTracking(extra.parseBitwiseORExpression); - parseBitwiseXORExpression = wrapTracking(extra.parseBitwiseXORExpression); - parseBlock = wrapTracking(extra.parseBlock); - parseFunctionSourceElements = wrapTracking(extra.parseFunctionSourceElements); - parseCatchClause = wrapTracking(extra.parseCatchClause); - parseComputedMember = wrapTracking(extra.parseComputedMember); - parseConditionalExpression = wrapTracking(extra.parseConditionalExpression); - parseConstLetDeclaration = wrapTracking(extra.parseConstLetDeclaration); - parseEqualityExpression = wrapTracking(extra.parseEqualityExpression); - parseExpression = wrapTracking(extra.parseExpression); - parseForVariableDeclaration = wrapTracking(extra.parseForVariableDeclaration); - parseFunctionDeclaration = wrapTracking(extra.parseFunctionDeclaration); - parseFunctionExpression = wrapTracking(extra.parseFunctionExpression); - parseLeftHandSideExpression = wrapTracking(parseLeftHandSideExpression); - parseLogicalANDExpression = wrapTracking(extra.parseLogicalANDExpression); - parseLogicalORExpression = wrapTracking(extra.parseLogicalORExpression); - parseMultiplicativeExpression = wrapTracking(extra.parseMultiplicativeExpression); - parseNewExpression = wrapTracking(extra.parseNewExpression); - parseNonComputedProperty = wrapTracking(extra.parseNonComputedProperty); - parseObjectProperty = wrapTracking(extra.parseObjectProperty); - parseObjectPropertyKey = wrapTracking(extra.parseObjectPropertyKey); - parsePostfixExpression = wrapTracking(extra.parsePostfixExpression); - parsePrimaryExpression = wrapTracking(extra.parsePrimaryExpression); - parseProgram = wrapTracking(extra.parseProgram); - parsePropertyFunction = wrapTracking(extra.parsePropertyFunction); - parseRelationalExpression = wrapTracking(extra.parseRelationalExpression); - parseStatement = wrapTracking(extra.parseStatement); - parseShiftExpression = wrapTracking(extra.parseShiftExpression); - parseSwitchCase = wrapTracking(extra.parseSwitchCase); - parseUnaryExpression = wrapTracking(extra.parseUnaryExpression); - parseVariableDeclaration = wrapTracking(extra.parseVariableDeclaration); - parseVariableIdentifier = wrapTracking(extra.parseVariableIdentifier); - } - - if (typeof extra.tokens !== 'undefined') { - extra.advance = advance; - extra.scanRegExp = scanRegExp; - - advance = collectToken; - scanRegExp = collectRegex; - } - } - - function unpatch() { - if (typeof extra.skipComment === 'function') { - skipComment = extra.skipComment; - } - - if (extra.raw) { - createLiteral = extra.createLiteral; - } - - if (extra.range || extra.loc) { - parseAdditiveExpression = extra.parseAdditiveExpression; - parseAssignmentExpression = extra.parseAssignmentExpression; - parseBitwiseANDExpression = extra.parseBitwiseANDExpression; - parseBitwiseORExpression = extra.parseBitwiseORExpression; - parseBitwiseXORExpression = extra.parseBitwiseXORExpression; - parseBlock = extra.parseBlock; - parseFunctionSourceElements = extra.parseFunctionSourceElements; - parseCatchClause = extra.parseCatchClause; - parseComputedMember = extra.parseComputedMember; - parseConditionalExpression = extra.parseConditionalExpression; - parseConstLetDeclaration = extra.parseConstLetDeclaration; - parseEqualityExpression = extra.parseEqualityExpression; - parseExpression = extra.parseExpression; - parseForVariableDeclaration = extra.parseForVariableDeclaration; - parseFunctionDeclaration = extra.parseFunctionDeclaration; - parseFunctionExpression = extra.parseFunctionExpression; - parseGroupExpression = extra.parseGroupExpression; - parseLeftHandSideExpression = extra.parseLeftHandSideExpression; - parseLeftHandSideExpressionAllowCall = extra.parseLeftHandSideExpressionAllowCall; - parseLogicalANDExpression = extra.parseLogicalANDExpression; - parseLogicalORExpression = extra.parseLogicalORExpression; - parseMultiplicativeExpression = extra.parseMultiplicativeExpression; - parseNewExpression = extra.parseNewExpression; - parseNonComputedProperty = extra.parseNonComputedProperty; - parseObjectProperty = extra.parseObjectProperty; - parseObjectPropertyKey = extra.parseObjectPropertyKey; - parsePrimaryExpression = extra.parsePrimaryExpression; - parsePostfixExpression = extra.parsePostfixExpression; - parseProgram = extra.parseProgram; - parsePropertyFunction = extra.parsePropertyFunction; - parseRelationalExpression = extra.parseRelationalExpression; - parseStatement = extra.parseStatement; - parseShiftExpression = extra.parseShiftExpression; - parseSwitchCase = extra.parseSwitchCase; - parseUnaryExpression = extra.parseUnaryExpression; - parseVariableDeclaration = extra.parseVariableDeclaration; - parseVariableIdentifier = extra.parseVariableIdentifier; - } - - if (typeof extra.scanRegExp === 'function') { - advance = extra.advance; - scanRegExp = extra.scanRegExp; - } - } - - function stringToArray(str) { - var length = str.length, - result = [], - i; - for (i = 0; i < length; ++i) { - result[i] = str.charAt(i); - } - return result; + filterTokenLocation(); + tokens = extra.tokens; + if (typeof extra.comments !== 'undefined') { + tokens.comments = extra.comments; + } + if (typeof extra.errors !== 'undefined') { + tokens.errors = extra.errors; + } + } catch (e) { + throw e; + } finally { + extra = {}; + } + return tokens; } function parse(code, options) { @@ -3810,20 +4063,27 @@ parseStatement: true, parseSourceElement: true */ lineNumber = (source.length > 0) ? 1 : 0; lineStart = 0; length = source.length; - buffer = null; + lookahead = null; state = { allowIn: true, labelSet: {}, + parenthesisCount: 0, inFunctionBody: false, inIteration: false, - inSwitch: false + inSwitch: false, + lastCommentStart: -1 }; extra = {}; if (typeof options !== 'undefined') { extra.range = (typeof options.range === 'boolean') && options.range; extra.loc = (typeof options.loc === 'boolean') && options.loc; - extra.raw = (typeof options.raw === 'boolean') && options.raw; + extra.attachComment = (typeof options.attachComment === 'boolean') && options.attachComment; + + if (extra.loc && options.source !== null && options.source !== undefined) { + extra.source = toString(options.source); + } + if (typeof options.tokens === 'boolean' && options.tokens) { extra.tokens = []; } @@ -3833,29 +4093,18 @@ parseStatement: true, parseSourceElement: true */ if (typeof options.tolerant === 'boolean' && options.tolerant) { extra.errors = []; } - } - - if (length > 0) { - if (typeof source[0] === 'undefined') { - // Try first to convert to a string. This is good as fast path - // for old IE which understands string indexing for string - // literals only and not for string object. - if (code instanceof String) { - source = code.valueOf(); - } - - // Force accessing the characters via an array. - if (typeof source[0] === 'undefined') { - source = stringToArray(code); - } + if (extra.attachComment) { + extra.range = true; + extra.comments = []; + extra.bottomRightStack = []; + extra.trailingComments = []; + extra.leadingComments = []; } } - patch(); try { program = parseProgram(); if (typeof extra.comments !== 'undefined') { - filterCommentLocation(); program.comments = extra.comments; } if (typeof extra.tokens !== 'undefined') { @@ -3865,25 +4114,24 @@ parseStatement: true, parseSourceElement: true */ if (typeof extra.errors !== 'undefined') { program.errors = extra.errors; } - if (extra.range || extra.loc) { - program.body = filterGroup(program.body); - } } catch (e) { throw e; } finally { - unpatch(); extra = {}; } return program; } - // Sync with package.json. - exports.version = '1.0.4'; + // Sync with *.json manifests. + exports.version = '2.0.0'; + + exports.tokenize = tokenize; exports.parse = parse; // Deep copy. + /* istanbul ignore next */ exports.Syntax = (function () { var name, types = {}; diff --git a/node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/esprima/package.json b/node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/esprima/package.json index 2889ca3..50fe250 100644 --- a/node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/esprima/package.json +++ b/node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/esprima/package.json @@ -7,6 +7,7 @@ "esparse": "./bin/esparse.js", "esvalidate": "./bin/esvalidate.js" }, + "version": "2.0.0", "files": [ "bin", "test/run.js", @@ -16,10 +17,13 @@ "test/reflect.js", "esprima.js" ], - "version": "1.0.4", "engines": { "node": ">=0.4.0" }, + "author": { + "name": "Ariya Hidayat", + "email": "ariya.hidayat@gmail.com" + }, "maintainers": [ { "name": "ariya", @@ -28,14 +32,28 @@ ], "repository": { "type": "git", - "url": "http://github.com/ariya/esprima.git" + "url": "https://github.com/jquery/esprima.git" + }, + "bugs": { + "url": "http://issues.esprima.org" }, "licenses": [ { "type": "BSD", - "url": "http://github.com/ariya/esprima/raw/master/LICENSE.BSD" + "url": "https://github.com/jquery/esprima/raw/master/LICENSE.BSD" } ], + "devDependencies": { + "eslint": "~0.12.0", + "jscs": "~1.10.0", + "istanbul": "~0.2.6", + "escomplex-js": "1.0.0", + "complexity-report": "~1.1.1", + "regenerate": "~0.6.2", + "unicode-7.0.0": "~0.1.5", + "json-diff": "~0.3.1", + "optimist": "~0.6.0" + }, "keywords": [ "ast", "ecmascript", @@ -44,26 +62,32 @@ "syntax" ], "scripts": { - "test": "node test/run.js", + "generate-regex": "node tools/generate-identifier-regex.js", + "test": "node test/run.js && npm run lint && npm run coverage", + "lint": "npm run check-version && npm run eslint && npm run jscs && npm run complexity", + "check-version": "node tools/check-version.js", + "jscs": "jscs esprima.js test/*test.js", + "eslint": "node node_modules/eslint/bin/eslint.js esprima.js", + "complexity": "node tools/list-complexity.js && cr -s -l -w --maxcyc 16 esprima.js", + "coverage": "npm run analyze-coverage && npm run check-coverage", + "analyze-coverage": "node node_modules/istanbul/lib/cli.js cover test/runner.js", + "check-coverage": "node node_modules/istanbul/lib/cli.js check-coverage --statement 100 --branch 100 --function 100", "benchmark": "node test/benchmarks.js", "benchmark-quick": "node test/benchmarks.js quick" }, - "_id": "esprima@1.0.4", + "_id": "esprima@2.0.0", "dist": { - "shasum": "9f557e08fc3b4d26ece9dd34f8fbf476b62585ad", - "tarball": "http://registry.npmjs.org/esprima/-/esprima-1.0.4.tgz" + "shasum": "609ac5c2667eae5433b41eb9ecece2331b41498f", + "tarball": "http://registry.npmjs.org/esprima/-/esprima-2.0.0.tgz" }, - "_npmVersion": "1.1.61", + "_from": "esprima@~ 2.0.0", + "_npmVersion": "1.4.3", "_npmUser": { "name": "ariya", "email": "ariya.hidayat@gmail.com" }, "directories": {}, - "_shasum": "9f557e08fc3b4d26ece9dd34f8fbf476b62585ad", - "_from": "esprima@~ 1.0.2", - "_resolved": "https://registry.npmjs.org/esprima/-/esprima-1.0.4.tgz", - "bugs": { - "url": "https://github.com/ariya/esprima/issues" - }, + "_shasum": "609ac5c2667eae5433b41eb9ecece2331b41498f", + "_resolved": "https://registry.npmjs.org/esprima/-/esprima-2.0.0.tgz", "readme": "ERROR: No README data found!" } diff --git a/node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/esprima/test/compat.js b/node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/esprima/test/compat.js index ee3a629..1f67307 100644 --- a/node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/esprima/test/compat.js +++ b/node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/esprima/test/compat.js @@ -96,6 +96,9 @@ function getContext(esprima, reportCase, reportFailure) { } else if (key === 'raw' && typeof value === "string") { // Ignore Esprima-specific 'raw' property. return undefined; + } else if (key === 'regex' && typeof value === "object") { + // Ignore Esprima-specific 'regex' property. + return undefined; } return value; } @@ -183,13 +186,15 @@ if (typeof window !== 'undefined') { tick = (new Date()) - tick; if (failures > 0) { + document.getElementById('status').className = 'alert-box alert'; setText(document.getElementById('status'), total + ' tests. ' + 'Failures: ' + failures + '. ' + tick + ' ms'); } else { + document.getElementById('status').className = 'alert-box success'; setText(document.getElementById('status'), total + ' tests. ' + 'No failure. ' + tick + ' ms'); } - }, 513); + }, 11); }; } else { (function (global) { diff --git a/node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/esprima/test/reflect.js b/node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/esprima/test/reflect.js index dba1ba8..4941bbb 100644 --- a/node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/esprima/test/reflect.js +++ b/node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/esprima/test/reflect.js @@ -19,12 +19,12 @@ function testReflect(Reflect, Pattern) { -function program(elts) { return Pattern({ type: "Program", body: elts }) } -function exprStmt(expr) { return Pattern({ type: "ExpressionStatement", expression: expr }) } -function throwStmt(expr) { return Pattern({ type: "ThrowStatement", argument: expr }) } -function returnStmt(expr) { return Pattern({ type: "ReturnStatement", argument: expr }) } -function yieldExpr(expr) { return Pattern({ type: "YieldExpression", argument: expr }) } -function lit(val) { return Pattern({ type: "Literal", value: val }) } +function program(elts) { return Pattern({ type: "Program", body: elts }); } +function exprStmt(expr) { return Pattern({ type: "ExpressionStatement", expression: expr }); } +function throwStmt(expr) { return Pattern({ type: "ThrowStatement", argument: expr }); } +function returnStmt(expr) { return Pattern({ type: "ReturnStatement", argument: expr }); } +function yieldExpr(expr) { return Pattern({ type: "YieldExpression", argument: expr }); } +function lit(val) { return Pattern({ type: "Literal", value: val }); } var thisExpr = Pattern({ type: "ThisExpression" }); function funDecl(id, params, body) { return Pattern({ type: "FunctionDeclaration", id: id, @@ -34,7 +34,7 @@ function funDecl(id, params, body) { return Pattern({ type: "FunctionDeclaration rest: null, generator: false, expression: false - }) } + }); } function genFunDecl(id, params, body) { return Pattern({ type: "FunctionDeclaration", id: id, params: params, @@ -43,32 +43,32 @@ function genFunDecl(id, params, body) { return Pattern({ type: "FunctionDeclarat rest: null, generator: false, expression: false - }) } -function declarator(id, init) { return Pattern({ type: "VariableDeclarator", id: id, init: init }) } -function varDecl(decls) { return Pattern({ type: "VariableDeclaration", declarations: decls, kind: "var" }) } -function letDecl(decls) { return Pattern({ type: "VariableDeclaration", declarations: decls, kind: "let" }) } -function constDecl(decls) { return Pattern({ type: "VariableDeclaration", declarations: decls, kind: "const" }) } -function ident(name) { return Pattern({ type: "Identifier", name: name }) } -function dotExpr(obj, id) { return Pattern({ type: "MemberExpression", computed: false, object: obj, property: id }) } -function memExpr(obj, id) { return Pattern({ type: "MemberExpression", computed: true, object: obj, property: id }) } -function forStmt(init, test, update, body) { return Pattern({ type: "ForStatement", init: init, test: test, update: update, body: body }) } -function forInStmt(lhs, rhs, body) { return Pattern({ type: "ForInStatement", left: lhs, right: rhs, body: body, each: false }) } -function forEachInStmt(lhs, rhs, body) { return Pattern({ type: "ForInStatement", left: lhs, right: rhs, body: body, each: true }) } -function breakStmt(lab) { return Pattern({ type: "BreakStatement", label: lab }) } -function continueStmt(lab) { return Pattern({ type: "ContinueStatement", label: lab }) } -function blockStmt(body) { return Pattern({ type: "BlockStatement", body: body }) } + }); } +function declarator(id, init) { return Pattern({ type: "VariableDeclarator", id: id, init: init }); } +function varDecl(decls) { return Pattern({ type: "VariableDeclaration", declarations: decls, kind: "var" }); } +function letDecl(decls) { return Pattern({ type: "VariableDeclaration", declarations: decls, kind: "let" }); } +function constDecl(decls) { return Pattern({ type: "VariableDeclaration", declarations: decls, kind: "const" }); } +function ident(name) { return Pattern({ type: "Identifier", name: name }); } +function dotExpr(obj, id) { return Pattern({ type: "MemberExpression", computed: false, object: obj, property: id }); } +function memExpr(obj, id) { return Pattern({ type: "MemberExpression", computed: true, object: obj, property: id }); } +function forStmt(init, test, update, body) { return Pattern({ type: "ForStatement", init: init, test: test, update: update, body: body }); } +function forInStmt(lhs, rhs, body) { return Pattern({ type: "ForInStatement", left: lhs, right: rhs, body: body, each: false }); } +function forEachInStmt(lhs, rhs, body) { return Pattern({ type: "ForInStatement", left: lhs, right: rhs, body: body, each: true }); } +function breakStmt(lab) { return Pattern({ type: "BreakStatement", label: lab }); } +function continueStmt(lab) { return Pattern({ type: "ContinueStatement", label: lab }); } +function blockStmt(body) { return Pattern({ type: "BlockStatement", body: body }); } var emptyStmt = Pattern({ type: "EmptyStatement" }); -function ifStmt(test, cons, alt) { return Pattern({ type: "IfStatement", test: test, alternate: alt, consequent: cons }) } -function labStmt(lab, stmt) { return Pattern({ type: "LabeledStatement", label: lab, body: stmt }) } -function withStmt(obj, stmt) { return Pattern({ type: "WithStatement", object: obj, body: stmt }) } -function whileStmt(test, stmt) { return Pattern({ type: "WhileStatement", test: test, body: stmt }) } -function doStmt(stmt, test) { return Pattern({ type: "DoWhileStatement", test: test, body: stmt }) } -function switchStmt(disc, cases) { return Pattern({ type: "SwitchStatement", discriminant: disc, cases: cases }) } -function caseClause(test, stmts) { return Pattern({ type: "SwitchCase", test: test, consequent: stmts }) } -function defaultClause(stmts) { return Pattern({ type: "SwitchCase", test: null, consequent: stmts }) } -function catchClause(id, guard, body) { if (guard) { return Pattern({ type: "GuardedCatchClause", param: id, guard: guard, body: body }) } else { return Pattern({ type: "CatchClause", param: id, body: body }) } } -function tryStmt(body, guarded, catches, fin) { return Pattern({ type: "TryStatement", block: body, guardedHandlers: guarded, handlers: catches, finalizer: fin }) } -function letStmt(head, body) { return Pattern({ type: "LetStatement", head: head, body: body }) } +function ifStmt(test, cons, alt) { return Pattern({ type: "IfStatement", test: test, alternate: alt, consequent: cons }); } +function labStmt(lab, stmt) { return Pattern({ type: "LabeledStatement", label: lab, body: stmt }); } +function withStmt(obj, stmt) { return Pattern({ type: "WithStatement", object: obj, body: stmt }); } +function whileStmt(test, stmt) { return Pattern({ type: "WhileStatement", test: test, body: stmt }); } +function doStmt(stmt, test) { return Pattern({ type: "DoWhileStatement", test: test, body: stmt }); } +function switchStmt(disc, cases) { return Pattern({ type: "SwitchStatement", discriminant: disc, cases: cases }); } +function caseClause(test, stmts) { return Pattern({ type: "SwitchCase", test: test, consequent: stmts }); } +function defaultClause(stmts) { return Pattern({ type: "SwitchCase", test: null, consequent: stmts }); } +function catchClause(id, guard, body) { if (guard) { return Pattern({ type: "GuardedCatchClause", param: id, guard: guard, body: body }) } else { return Pattern({ type: "CatchClause", param: id, body: body }); } } +function tryStmt(body, guarded, catches, fin) { return Pattern({ type: "TryStatement", block: body, guardedHandlers: guarded, handlers: catches, finalizer: fin }); } +function letStmt(head, body) { return Pattern({ type: "LetStatement", head: head, body: body }); } function funExpr(id, args, body, gen) { return Pattern({ type: "FunctionExpression", id: id, params: args, @@ -77,7 +77,7 @@ function funExpr(id, args, body, gen) { return Pattern({ type: "FunctionExpressi rest: null, generator: false, expression: false - }) } + }); } function genFunExpr(id, args, body) { return Pattern({ type: "FunctionExpression", id: id, params: args, @@ -86,29 +86,29 @@ function genFunExpr(id, args, body) { return Pattern({ type: "FunctionExpression rest: null, generator: false, expression: false - }) } - -function unExpr(op, arg) { return Pattern({ type: "UnaryExpression", operator: op, argument: arg, prefix: true }) } -function binExpr(op, left, right) { return Pattern({ type: "BinaryExpression", operator: op, left: left, right: right }) } -function aExpr(op, left, right) { return Pattern({ type: "AssignmentExpression", operator: op, left: left, right: right }) } -function updExpr(op, arg, prefix) { return Pattern({ type: "UpdateExpression", operator: op, argument: arg, prefix: prefix }) } -function logExpr(op, left, right) { return Pattern({ type: "LogicalExpression", operator: op, left: left, right: right }) } - -function condExpr(test, cons, alt) { return Pattern({ type: "ConditionalExpression", test: test, consequent: cons, alternate: alt }) } -function seqExpr(exprs) { return Pattern({ type: "SequenceExpression", expressions: exprs }) } -function newExpr(callee, args) { return Pattern({ type: "NewExpression", callee: callee, arguments: args }) } -function callExpr(callee, args) { return Pattern({ type: "CallExpression", callee: callee, arguments: args }) } -function arrExpr(elts) { return Pattern({ type: "ArrayExpression", elements: elts }) } -function objExpr(elts) { return Pattern({ type: "ObjectExpression", properties: elts }) } -function objProp(key, value, kind) { return Pattern({ type: "Property", key: key, value: value, kind: kind }) } - -function arrPatt(elts) { return Pattern({ type: "ArrayPattern", elements: elts }) } -function objPatt(elts) { return Pattern({ type: "ObjectPattern", properties: elts }) } - -function localSrc(src) { return "(function(){ " + src + " })" } -function localPatt(patt) { return program([exprStmt(funExpr(null, [], blockStmt([patt])))]) } -function blockSrc(src) { return "(function(){ { " + src + " } })" } -function blockPatt(patt) { return program([exprStmt(funExpr(null, [], blockStmt([blockStmt([patt])])))]) } + }); } + +function unExpr(op, arg) { return Pattern({ type: "UnaryExpression", operator: op, argument: arg, prefix: true }); } +function binExpr(op, left, right) { return Pattern({ type: "BinaryExpression", operator: op, left: left, right: right }); } +function aExpr(op, left, right) { return Pattern({ type: "AssignmentExpression", operator: op, left: left, right: right }); } +function updExpr(op, arg, prefix) { return Pattern({ type: "UpdateExpression", operator: op, argument: arg, prefix: prefix }); } +function logExpr(op, left, right) { return Pattern({ type: "LogicalExpression", operator: op, left: left, right: right }); } + +function condExpr(test, cons, alt) { return Pattern({ type: "ConditionalExpression", test: test, consequent: cons, alternate: alt }); } +function seqExpr(exprs) { return Pattern({ type: "SequenceExpression", expressions: exprs }); } +function newExpr(callee, args) { return Pattern({ type: "NewExpression", callee: callee, arguments: args }); } +function callExpr(callee, args) { return Pattern({ type: "CallExpression", callee: callee, arguments: args }); } +function arrExpr(elts) { return Pattern({ type: "ArrayExpression", elements: elts }); } +function objExpr(elts) { return Pattern({ type: "ObjectExpression", properties: elts }); } +function objProp(key, value, kind) { return Pattern({ type: "Property", key: key, value: value, kind: kind, method: false, shorthand: false }); } + +function arrPatt(elts) { return Pattern({ type: "ArrayPattern", elements: elts }); } +function objPatt(elts) { return Pattern({ type: "ObjectPattern", properties: elts }); } + +function localSrc(src) { return "(function(){ " + src + " })"; } +function localPatt(patt) { return program([exprStmt(funExpr(null, [], blockStmt([patt])))]); } +function blockSrc(src) { return "(function(){ { " + src + " } })"; } +function blockPatt(patt) { return program([exprStmt(funExpr(null, [], blockStmt([blockStmt([patt])])))]); } function assertBlockStmt(src, patt) { blockPatt(patt).assert(Reflect.parse(blockSrc(src))); @@ -271,10 +271,10 @@ assertExpr("(x ^= y)", aExpr("^=", ident("x"), ident("y"))); assertExpr("(x &= y)", aExpr("&=", ident("x"), ident("y"))); assertExpr("(x || y)", logExpr("||", ident("x"), ident("y"))); assertExpr("(x && y)", logExpr("&&", ident("x"), ident("y"))); -assertExpr("(w || x || y || z)", logExpr("||", logExpr("||", logExpr("||", ident("w"), ident("x")), ident("y")), ident("z"))) +assertExpr("(w || x || y || z)", logExpr("||", logExpr("||", logExpr("||", ident("w"), ident("x")), ident("y")), ident("z"))); assertExpr("(x ? y : z)", condExpr(ident("x"), ident("y"), ident("z"))); -assertExpr("(x,y)", seqExpr([ident("x"),ident("y")])) -assertExpr("(x,y,z)", seqExpr([ident("x"),ident("y"),ident("z")])) +assertExpr("(x,y)", seqExpr([ident("x"),ident("y")])); +assertExpr("(x,y,z)", seqExpr([ident("x"),ident("y"),ident("z")])); assertExpr("(a,b,c,d,e,f,g)", seqExpr([ident("a"),ident("b"),ident("c"),ident("d"),ident("e"),ident("f"),ident("g")])); assertExpr("(new Object)", newExpr(ident("Object"), [])); assertExpr("(new Object())", newExpr(ident("Object"), [])); diff --git a/node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/esprima/test/run.js b/node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/esprima/test/run.js index 32ca3fa..0f08f15 100644 --- a/node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/esprima/test/run.js +++ b/node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/esprima/test/run.js @@ -36,7 +36,8 @@ suites = [ 'runner', - 'compat' + 'compat', + 'parselibs' ]; function nextTest() { diff --git a/node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/esprima/test/runner.js b/node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/esprima/test/runner.js index c1a3fc9..6811f65 100644 --- a/node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/esprima/test/runner.js +++ b/node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/esprima/test/runner.js @@ -33,9 +33,10 @@ var runTests; -// Special handling for regular expression literal since we need to -// convert it to a string literal, otherwise it will be decoded -// as object "{}" and the regular expression would be lost. +// Special handling for regular expression literals: remove their `value` +// property since it may be `null` if it represents a regular expression +// that is not supported in the current environment. The `regex` property +// will be compared instead. function adjustRegexLiteral(key, value) { 'use strict'; if (key === 'value' && value instanceof RegExp) { @@ -71,9 +72,50 @@ function errorToObject(e) { }; } +function sortedObject(o) { + if (o === null) { + return o; + } + if (o instanceof Array) { + return o.map(sortedObject); + } + if (typeof o !== 'object') { + return o; + } + if (o instanceof RegExp) { + return o; + } + var keys = Object.keys(o); + var result = { + range: undefined, + loc: undefined + }; + keys.forEach(function (key) { + if (o.hasOwnProperty(key)){ + result[key] = sortedObject(o[key]); + } + }); + return result; +} + +function hasAttachedComment(syntax) { + var key; + for (key in syntax) { + if (key === 'leadingComments' || key === 'trailingComments') { + return true; + } + if (typeof syntax[key] === 'object' && syntax[key] !== null) { + if (hasAttachedComment(syntax[key])) { + return true; + } + } + } + return false; +} + function testParse(esprima, code, syntax) { 'use strict'; - var expected, tree, actual, options, StringObject, i, len, err; + var expected, tree, actual, options, StringObject, i, len; // alias, so that JSLint does not complain. StringObject = String; @@ -84,9 +126,14 @@ function testParse(esprima, code, syntax) { loc: true, tokens: (typeof syntax.tokens !== 'undefined'), raw: true, - tolerant: (typeof syntax.errors !== 'undefined') + tolerant: (typeof syntax.errors !== 'undefined'), + source: null }; + if (options.comment) { + options.attachComment = hasAttachedComment(syntax); + } + if (typeof syntax.tokens !== 'undefined') { if (syntax.tokens.length > 0) { options.range = (typeof syntax.tokens[0].range !== 'undefined'); @@ -101,8 +148,18 @@ function testParse(esprima, code, syntax) { } } - expected = JSON.stringify(syntax, null, 4); + if (options.loc) { + options.source = syntax.loc.source; + } + + syntax = sortedObject(syntax); + expected = JSON.stringify(syntax, adjustRegexLiteral, 4); try { + // Some variations of the options. + tree = esprima.parse(code, { tolerant: options.tolerant }); + tree = esprima.parse(code, { tolerant: options.tolerant, range: true }); + tree = esprima.parse(code, { tolerant: options.tolerant, loc: true }); + tree = esprima.parse(code, options); tree = (options.comment || options.tokens || options.tolerant) ? tree : tree.body[0]; @@ -111,7 +168,7 @@ function testParse(esprima, code, syntax) { tree.errors[i] = errorToObject(tree.errors[i]); } } - + tree = sortedObject(tree); actual = JSON.stringify(tree, adjustRegexLiteral, 4); // Only to ensure that there is no error when using string object. @@ -139,6 +196,7 @@ function testParse(esprima, code, syntax) { // Check again without any location info. options.range = false; options.loc = false; + syntax = sortedObject(syntax); expected = JSON.stringify(syntax, filter, 4); try { tree = esprima.parse(code, options); @@ -149,7 +207,7 @@ function testParse(esprima, code, syntax) { tree.errors[i] = errorToObject(tree.errors[i]); } } - + tree = sortedObject(tree); actual = JSON.stringify(tree, filter, 4); } catch (e) { throw new NotMatchingError(expected, e.toString()); @@ -159,9 +217,33 @@ function testParse(esprima, code, syntax) { } } +function testTokenize(esprima, code, tokens) { + 'use strict'; + var options, expected, actual, tree; + + options = { + comment: true, + tolerant: true, + loc: true, + range: true + }; + + expected = JSON.stringify(tokens, null, 4); + + try { + tree = esprima.tokenize(code, options); + actual = JSON.stringify(tree, null, 4); + } catch (e) { + throw new NotMatchingError(expected, e.toString()); + } + if (expected !== actual) { + throw new NotMatchingError(expected, actual); + } +} + function testError(esprima, code, exception) { 'use strict'; - var i, options, expected, actual, handleInvalidRegexFlag; + var i, options, expected, actual, err, handleInvalidRegexFlag, tokenize; // Different parsing options should give the same error. options = [ @@ -172,7 +254,7 @@ function testError(esprima, code, exception) { ]; // If handleInvalidRegexFlag is true, an invalid flag in a regular expression - // will throw an exception. In some old version V8, this is not the case + // will throw an exception. In some old version of V8, this is not the case // and hence handleInvalidRegexFlag is false. handleInvalidRegexFlag = false; try { @@ -181,14 +263,26 @@ function testError(esprima, code, exception) { handleInvalidRegexFlag = true; } + exception.description = exception.message.replace(/Error: Line [0-9]+: /, ''); + + if (exception.tokenize) { + tokenize = true; + exception.tokenize = undefined; + } expected = JSON.stringify(exception); for (i = 0; i < options.length; i += 1) { try { - esprima.parse(code, options[i]); + if (tokenize) { + esprima.tokenize(code, options[i]); + } else { + esprima.parse(code, options[i]); + } } catch (e) { - actual = JSON.stringify(errorToObject(e)); + err = errorToObject(e); + err.description = e.description; + actual = JSON.stringify(err); } if (expected !== actual) { @@ -232,6 +326,8 @@ function runTest(esprima, code, result) { testError(esprima, code, result); } else if (result.hasOwnProperty('result')) { testAPI(esprima, code, result); + } else if (result instanceof Array) { + testTokenize(esprima, code, result); } else { testParse(esprima, code, result); } @@ -247,9 +343,7 @@ if (typeof window !== 'undefined') { fixture, source, tick, - expected, - index, - len; + expected; function setText(el, str) { if (typeof el.innerText === 'string') { @@ -334,11 +428,13 @@ if (typeof window !== 'undefined') { tick = (new Date()) - tick; if (failures > 0) { + document.getElementById('status').className = 'alert-box alert'; setText(document.getElementById('status'), total + ' tests. ' + - 'Failures: ' + failures + '. ' + tick + ' ms'); + 'Failures: ' + failures + '. ' + tick + ' ms.'); } else { + document.getElementById('status').className = 'alert-box success'; setText(document.getElementById('status'), total + ' tests. ' + - 'No failure. ' + tick + ' ms'); + 'No failure. ' + tick + ' ms.'); } }; } else { @@ -348,6 +444,7 @@ if (typeof window !== 'undefined') { var esprima = require('../esprima'), vm = require('vm'), fs = require('fs'), + diff = require('json-diff').diffString, total = 0, failures = [], tick = new Date(), @@ -375,9 +472,19 @@ if (typeof window !== 'undefined') { if (failures.length) { console.error(header); failures.forEach(function (failure) { - console.error(failure.source + ': Expected\n ' + - failure.expected.split('\n').join('\n ') + - '\nto match\n ' + failure.actual); + try { + var expectedObject = JSON.parse(failure.expected); + var actualObject = JSON.parse(failure.actual); + + console.error(failure.source + ': Expected\n ' + + failure.expected.split('\n').join('\n ') + + '\nto match\n ' + failure.actual + '\nDiff:\n' + + diff(expectedObject, actualObject)); + } catch (ex) { + console.error(failure.source + ': Expected\n ' + + failure.expected.split('\n').join('\n ') + + '\nto match\n ' + failure.actual); + } }); } else { console.log(header); diff --git a/node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/esprima/test/test.js b/node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/esprima/test/test.js index 8ceee54..20370b7 100644 --- a/node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/esprima/test/test.js +++ b/node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/esprima/test/test.js @@ -1,4 +1,5 @@ /* + Copyright (C) 2013 Mathias Bynens Copyright (C) 2012 Ariya Hidayat Copyright (C) 2012 Joost-Wim Boekesteijn Copyright (C) 2012 Yusuke Suzuki @@ -44,16 +45,16 @@ var testFixture = { end: { line: 1, column: 4 } } }, - range: [0, 5], + range: [0, 4], loc: { start: { line: 1, column: 0 }, - end: { line: 2, column: 0 } + end: { line: 1, column: 4 } } }], - range: [0, 5], + range: [0, 4], loc: { start: { line: 1, column: 0 }, - end: { line: 2, column: 0 } + end: { line: 1, column: 4 } }, tokens: [{ type: 'Keyword', @@ -80,16 +81,16 @@ var testFixture = { end: { line: 1, column: 4 } } }, - range: [0, 5], + range: [0, 4], loc: { start: { line: 1, column: 0 }, - end: { line: 2, column: 0 } + end: { line: 1, column: 4 } } }], - range: [0, 5], + range: [0, 4], loc: { start: { line: 1, column: 0 }, - end: { line: 2, column: 0 } + end: { line: 1, column: 4 } }, tokens: [{ type: 'Null', @@ -116,16 +117,16 @@ var testFixture = { end: { line: 2, column: 6 } } }, - range: [5, 9], + range: [5, 7], loc: { start: { line: 2, column: 4 }, - end: { line: 4, column: 0 } + end: { line: 2, column: 6 } } }], - range: [5, 9], + range: [5, 7], loc: { start: { line: 2, column: 4 }, - end: { line: 4, column: 0 } + end: { line: 2, column: 6 } }, tokens: [{ type: 'Numeric', @@ -1024,6 +1025,8 @@ var testFixture = { } }, kind: 'init', + method: false, + shorthand: false, range: [6, 16], loc: { start: { line: 1, column: 6 }, @@ -1087,6 +1090,8 @@ var testFixture = { } }, kind: 'init', + method: false, + shorthand: false, range: [6, 12], loc: { start: { line: 1, column: 6 }, @@ -1150,6 +1155,8 @@ var testFixture = { } }, kind: 'init', + method: false, + shorthand: false, range: [6, 14], loc: { start: { line: 1, column: 6 }, @@ -1213,6 +1220,8 @@ var testFixture = { } }, kind: 'init', + method: false, + shorthand: false, range: [6, 15], loc: { start: { line: 1, column: 6 }, @@ -1276,6 +1285,8 @@ var testFixture = { } }, kind: 'init', + method: false, + shorthand: false, range: [6, 14], loc: { start: { line: 1, column: 6 }, @@ -1340,6 +1351,8 @@ var testFixture = { } }, kind: 'init', + method: false, + shorthand: false, range: [6, 18], loc: { start: { line: 1, column: 6 }, @@ -1404,6 +1417,8 @@ var testFixture = { } }, kind: 'init', + method: false, + shorthand: false, range: [6, 10], loc: { start: { line: 1, column: 6 }, @@ -1432,6 +1447,8 @@ var testFixture = { } }, kind: 'init', + method: false, + shorthand: false, range: [12, 16], loc: { start: { line: 1, column: 12 }, @@ -1525,6 +1542,8 @@ var testFixture = { } }, kind: 'get', + method: false, + shorthand: false, range: [6, 36], loc: { start: { line: 1, column: 6 }, @@ -1601,6 +1620,8 @@ var testFixture = { } }, kind: 'get', + method: false, + shorthand: false, range: [6, 20], loc: { start: { line: 1, column: 6 }, @@ -1677,6 +1698,8 @@ var testFixture = { } }, kind: 'get', + method: false, + shorthand: false, range: [6, 17], loc: { start: { line: 1, column: 6 }, @@ -1753,6 +1776,8 @@ var testFixture = { } }, kind: 'get', + method: false, + shorthand: false, range: [6, 19], loc: { start: { line: 1, column: 6 }, @@ -1829,6 +1854,8 @@ var testFixture = { } }, kind: 'get', + method: false, + shorthand: false, range: [6, 20], loc: { start: { line: 1, column: 6 }, @@ -1905,6 +1932,8 @@ var testFixture = { } }, kind: 'get', + method: false, + shorthand: false, range: [6, 19], loc: { start: { line: 1, column: 6 }, @@ -1982,6 +2011,8 @@ var testFixture = { } }, kind: 'get', + method: false, + shorthand: false, range: [6, 22], loc: { start: { line: 1, column: 6 }, @@ -2059,6 +2090,8 @@ var testFixture = { } }, kind: 'get', + method: false, + shorthand: false, range: [6, 17], loc: { start: { line: 1, column: 6 }, @@ -2177,6 +2210,8 @@ var testFixture = { } }, kind: 'set', + method: false, + shorthand: false, range: [6, 34], loc: { start: { line: 1, column: 6 }, @@ -2295,6 +2330,8 @@ var testFixture = { } }, kind: 'set', + method: false, + shorthand: false, range: [6, 28], loc: { start: { line: 1, column: 6 }, @@ -2413,6 +2450,8 @@ var testFixture = { } }, kind: 'set', + method: false, + shorthand: false, range: [6, 32], loc: { start: { line: 1, column: 6 }, @@ -2531,6 +2570,8 @@ var testFixture = { } }, kind: 'set', + method: false, + shorthand: false, range: [6, 34], loc: { start: { line: 1, column: 6 }, @@ -2649,6 +2690,8 @@ var testFixture = { } }, kind: 'set', + method: false, + shorthand: false, range: [6, 32], loc: { start: { line: 1, column: 6 }, @@ -2768,6 +2811,8 @@ var testFixture = { } }, kind: 'set', + method: false, + shorthand: false, range: [6, 34], loc: { start: { line: 1, column: 6 }, @@ -2887,6 +2932,8 @@ var testFixture = { } }, kind: 'set', + method: false, + shorthand: false, range: [6, 30], loc: { start: { line: 1, column: 6 }, @@ -2950,6 +2997,8 @@ var testFixture = { } }, kind: 'init', + method: false, + shorthand: false, range: [6, 13], loc: { start: { line: 1, column: 6 }, @@ -3013,6 +3062,8 @@ var testFixture = { } }, kind: 'init', + method: false, + shorthand: false, range: [6, 13], loc: { start: { line: 1, column: 6 }, @@ -3036,43 +3087,124 @@ var testFixture = { start: { line: 1, column: 0 }, end: { line: 1, column: 15 } } - } - - }, - - 'Comments': { + }, - '/* block comment */ 42': { + 'x = { __proto__: 2 }': { type: 'ExpressionStatement', expression: { - type: 'Literal', - value: 42, - raw: '42', - range: [20, 22], + type: 'AssignmentExpression', + operator: '=', + left: { + type: 'Identifier', + name: 'x', + range: [0, 1], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 1 } + } + }, + right: { + type: 'ObjectExpression', + properties: [{ + type: 'Property', + key: { + type: 'Identifier', + name: '__proto__', + range: [6, 15], + loc: { + start: { line: 1, column: 6 }, + end: { line: 1, column: 15 } + } + }, + value: { + type: 'Literal', + value: 2, + raw: '2', + range: [17, 18], + loc: { + start: { line: 1, column: 17 }, + end: { line: 1, column: 18 } + } + }, + kind: 'init', + method: false, + shorthand: false, + range: [6, 18], + loc: { + start: { line: 1, column: 6 }, + end: { line: 1, column: 18 } + } + }], + range: [4, 20], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 20 } + } + }, + range: [0, 20], loc: { - start: { line: 1, column: 20 }, - end: { line: 1, column: 22 } + start: { line: 1, column: 0 }, + end: { line: 1, column: 20 } } }, - range: [20, 22], + range: [0, 20], loc: { - start: { line: 1, column: 20 }, - end: { line: 1, column: 22 } + start: { line: 1, column: 0 }, + end: { line: 1, column: 20 } } }, - '42 /*The*/ /*Answer*/': { - type: 'Program', - body: [{ - type: 'ExpressionStatement', - expression: { - type: 'Literal', - value: 42, - raw: '42', - range: [0, 2], + 'x = {"__proto__": 2 }': { + type: 'ExpressionStatement', + expression: { + type: 'AssignmentExpression', + operator: '=', + left: { + type: 'Identifier', + name: 'x', + range: [0, 1], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 2 } + end: { line: 1, column: 1 } + } + }, + right: { + type: 'ObjectExpression', + properties: [{ + type: 'Property', + key: { + type: 'Literal', + value: '__proto__', + raw: '"__proto__"', + range: [5, 16], + loc: { + start: { line: 1, column: 5 }, + end: { line: 1, column: 16 } + } + }, + value: { + type: 'Literal', + value: 2, + raw: '2', + range: [18, 19], + loc: { + start: { line: 1, column: 18 }, + end: { line: 1, column: 19 } + } + }, + kind: 'init', + method: false, + shorthand: false, + range: [5, 19], + loc: { + start: { line: 1, column: 5 }, + end: { line: 1, column: 19 } + } + }], + range: [4, 21], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 21 } } }, range: [0, 21], @@ -3080,342 +3212,899 @@ var testFixture = { start: { line: 1, column: 0 }, end: { line: 1, column: 21 } } - }], + }, range: [0, 21], loc: { start: { line: 1, column: 0 }, end: { line: 1, column: 21 } - }, - comments: [{ - type: 'Block', - value: 'The', - range: [3, 10], - loc: { - start: { line: 1, column: 3 }, - end: { line: 1, column: 10 } - } - }, { - type: 'Block', - value: 'Answer', - range: [11, 21], - loc: { - start: { line: 1, column: 11 }, - end: { line: 1, column: 21 } - } - }] - }, - - '42 /*the*/ /*answer*/': { - type: 'Program', - body: [{ - type: 'ExpressionStatement', - expression: { - type: 'Literal', - value: 42, - raw: '42', - range: [0, 2] - }, - range: [0, 21] - }], - range: [0, 21], - comments: [{ - type: 'Block', - value: 'the', - range: [3, 10] - }, { - type: 'Block', - value: 'answer', - range: [11, 21] - }] + } }, - '/* multiline\ncomment\nshould\nbe\nignored */ 42': { + 'x = { get width() { return m_width }, set width(width) { m_width = width; } }': { type: 'ExpressionStatement', expression: { - type: 'Literal', - value: 42, - raw: '42', - range: [42, 44], - loc: { - start: { line: 5, column: 11 }, - end: { line: 5, column: 13 } - } - }, - range: [42, 44], - loc: { - start: { line: 5, column: 11 }, - end: { line: 5, column: 13 } - } - }, - - '/*a\r\nb*/ 42': { - type: 'Program', - body: [{ - type: 'ExpressionStatement', - expression: { - type: 'Literal', - value: 42, - raw: '42', - range: [9, 11], - loc: { - start: { line: 2, column: 4 }, - end: { line: 2, column: 6 } - } - }, - range: [9, 11], - loc: { - start: { line: 2, column: 4 }, - end: { line: 2, column: 6 } - } - }], - range: [9, 11], - loc: { - start: { line: 2, column: 4 }, - end: { line: 2, column: 6 } - }, - comments: [{ - type: 'Block', - value: 'a\r\nb', - range: [0, 8], - loc: { - start: { line: 1, column: 0 }, - end: { line: 2, column: 3 } - } - }] - }, - - '/*a\rb*/ 42': { - type: 'Program', - body: [{ - type: 'ExpressionStatement', - expression: { - type: 'Literal', - value: 42, - raw: '42', - range: [8, 10], + type: 'AssignmentExpression', + operator: '=', + left: { + type: 'Identifier', + name: 'x', + range: [0, 1], loc: { - start: { line: 2, column: 4 }, - end: { line: 2, column: 6 } + start: { line: 1, column: 0 }, + end: { line: 1, column: 1 } } }, - range: [8, 10], - loc: { - start: { line: 2, column: 4 }, - end: { line: 2, column: 6 } - } - }], - range: [8, 10], - loc: { - start: { line: 2, column: 4 }, - end: { line: 2, column: 6 } - }, - comments: [{ - type: 'Block', - value: 'a\rb', - range: [0, 7], - loc: { - start: { line: 1, column: 0 }, - end: { line: 2, column: 3 } - } - }] - }, - - '/*a\nb*/ 42': { - type: 'Program', - body: [{ - type: 'ExpressionStatement', - expression: { - type: 'Literal', - value: 42, - raw: '42', - range: [8, 10], + right: { + type: 'ObjectExpression', + properties: [{ + type: 'Property', + key: { + type: 'Identifier', + name: 'width', + range: [10, 15], + loc: { + start: { line: 1, column: 10 }, + end: { line: 1, column: 15 } + } + }, + value: { + type: 'FunctionExpression', + id: null, + params: [], + defaults: [], + body: { + type: 'BlockStatement', + body: [{ + type: 'ReturnStatement', + argument: { + type: 'Identifier', + name: 'm_width', + range: [27, 34], + loc: { + start: { line: 1, column: 27 }, + end: { line: 1, column: 34 } + } + }, + range: [20, 35], + loc: { + start: { line: 1, column: 20 }, + end: { line: 1, column: 35 } + } + }], + range: [18, 36], + loc: { + start: { line: 1, column: 18 }, + end: { line: 1, column: 36 } + } + }, + rest: null, + generator: false, + expression: false, + range: [18, 36], + loc: { + start: { line: 1, column: 18 }, + end: { line: 1, column: 36 } + } + }, + kind: 'get', + method: false, + shorthand: false, + range: [6, 36], + loc: { + start: { line: 1, column: 6 }, + end: { line: 1, column: 36 } + } + }, { + type: 'Property', + key: { + type: 'Identifier', + name: 'width', + range: [42, 47], + loc: { + start: { line: 1, column: 42 }, + end: { line: 1, column: 47 } + } + }, + value: { + type: 'FunctionExpression', + id: null, + params: [{ + type: 'Identifier', + name: 'width', + range: [48, 53], + loc: { + start: { line: 1, column: 48 }, + end: { line: 1, column: 53 } + } + }], + defaults: [], + body: { + type: 'BlockStatement', + body: [{ + type: 'ExpressionStatement', + expression: { + type: 'AssignmentExpression', + operator: '=', + left: { + type: 'Identifier', + name: 'm_width', + range: [57, 64], + loc: { + start: { line: 1, column: 57 }, + end: { line: 1, column: 64 } + } + }, + right: { + type: 'Identifier', + name: 'width', + range: [67, 72], + loc: { + start: { line: 1, column: 67 }, + end: { line: 1, column: 72 } + } + }, + range: [57, 72], + loc: { + start: { line: 1, column: 57 }, + end: { line: 1, column: 72 } + } + }, + range: [57, 73], + loc: { + start: { line: 1, column: 57 }, + end: { line: 1, column: 73 } + } + }], + range: [55, 75], + loc: { + start: { line: 1, column: 55 }, + end: { line: 1, column: 75 } + } + }, + rest: null, + generator: false, + expression: false, + range: [55, 75], + loc: { + start: { line: 1, column: 55 }, + end: { line: 1, column: 75 } + } + }, + kind: 'set', + method: false, + shorthand: false, + range: [38, 75], + loc: { + start: { line: 1, column: 38 }, + end: { line: 1, column: 75 } + } + }], + range: [4, 77], loc: { - start: { line: 2, column: 4 }, - end: { line: 2, column: 6 } + start: { line: 1, column: 4 }, + end: { line: 1, column: 77 } } }, - range: [8, 10], - loc: { - start: { line: 2, column: 4 }, - end: { line: 2, column: 6 } - } - }], - range: [8, 10], - loc: { - start: { line: 2, column: 4 }, - end: { line: 2, column: 6 } - }, - comments: [{ - type: 'Block', - value: 'a\nb', - range: [0, 7], + range: [0, 77], loc: { start: { line: 1, column: 0 }, - end: { line: 2, column: 3 } - } - }] - }, - - '/*a\nc*/ 42': { - type: 'Program', - body: [{ - type: 'ExpressionStatement', - expression: { - type: 'Literal', - value: 42, - raw: '42', - loc: { - start: { line: 2, column: 4 }, - end: { line: 2, column: 6 } - } - }, - loc: { - start: { line: 2, column: 4 }, - end: { line: 2, column: 6 } + end: { line: 1, column: 77 } } - }], - loc: { - start: { line: 2, column: 4 }, - end: { line: 2, column: 6 } }, - comments: [{ - type: 'Block', - value: 'a\nc', - loc: { - start: { line: 1, column: 0 }, - end: { line: 2, column: 3 } - } - }] - }, + range: [0, 77], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 77 } + } + } - '// line comment\n42': { + + }, + + 'Comments': { + + '/* block comment */ 42': { type: 'ExpressionStatement', expression: { type: 'Literal', value: 42, raw: '42', - range: [16, 18], + range: [20, 22], loc: { - start: { line: 2, column: 0 }, - end: { line: 2, column: 2 } + start: { line: 1, column: 20 }, + end: { line: 1, column: 22 } } }, - range: [16, 18], + range: [20, 22], loc: { - start: { line: 2, column: 0 }, - end: { line: 2, column: 2 } + start: { line: 1, column: 20 }, + end: { line: 1, column: 22 } } }, - '42 // line comment': { - type: 'Program', - body: [{ - type: 'ExpressionStatement', - expression: { - type: 'Literal', - value: 42, - raw: '42', - range: [0, 2], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 2 } - } - }, - range: [0, 18], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 18 } - } - }], - range: [0, 18], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 18 } - }, - comments: [{ - type: 'Line', - value: ' line comment', - range: [3, 18], - loc: { - start: { line: 1, column: 3 }, - end: { line: 1, column: 18 } + '42 /* block comment 1 */ /* block comment 2 */': { + "type": "Program", + "body": [ + { + "type": "ExpressionStatement", + "expression": { + "type": "Literal", + "value": 42, + "raw": "42", + "range": [ + 0, + 2 + ], + "trailingComments": [ + { + "type": "Block", + "value": " block comment 1 ", + "range": [ + 3, + 24 + ] + }, + { + "type": "Block", + "value": " block comment 2 ", + "range": [ + 25, + 46 + ] + } + ] + }, + "range": [ + 0, + 46 + ] + } + ], + "range": [ + 0, + 46 + ], + "comments": [ + { + "type": "Block", + "value": " block comment 1 ", + "range": [ + 3, + 24 + ] + }, + { + "type": "Block", + "value": " block comment 2 ", + "range": [ + 25, + 46 + ] + } + ], + "tokens": [ + { + "type": "Numeric", + "range": [ + 0, + 2 + ], + "value": "42" } - }] + ] }, - '// Hello, world!\n42': { - type: 'Program', - body: [{ - type: 'ExpressionStatement', - expression: { - type: 'Literal', - value: 42, - raw: '42', - range: [17, 19], - loc: { - start: { line: 2, column: 0 }, - end: { line: 2, column: 2 } - } + 'var p1;/* block comment 1 */ /* block comment 2 */': { + "range": [ + 0, + 7 + ], + "loc": { + "start": { + "line": 1, + "column": 0 }, - range: [17, 19], - loc: { - start: { line: 2, column: 0 }, - end: { line: 2, column: 2 } + "end": { + "line": 1, + "column": 7 } - }], - range: [17, 19], - loc: { - start: { line: 2, column: 0 }, - end: { line: 2, column: 2 } }, - comments: [{ - type: 'Line', - value: ' Hello, world!', - range: [0, 16], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 16 } + "type": "Program", + "body": [ + { + "range": [ + 0, + 7 + ], + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "type": "VariableDeclaration", + "declarations": [ + { + "range": [ + 4, + 6 + ], + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "type": "VariableDeclarator", + "id": { + "range": [ + 4, + 6 + ], + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "type": "Identifier", + "name": "p1" + }, + "init": null + } + ], + "kind": "var", + "trailingComments": [ + { + "range": [ + 7, + 28 + ], + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 28 + } + }, + "type": "Block", + "value": " block comment 1 " + }, + { + "range": [ + 29, + 50 + ], + "loc": { + "start": { + "line": 1, + "column": 29 + }, + "end": { + "line": 1, + "column": 50 + } + }, + "type": "Block", + "value": " block comment 2 " + } + ] } - }] + ], + "comments": [ + { + "range": [ + 7, + 28 + ], + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 28 + } + }, + "type": "Block", + "value": " block comment 1 " + }, + { + "range": [ + 29, + 50 + ], + "loc": { + "start": { + "line": 1, + "column": 29 + }, + "end": { + "line": 1, + "column": 50 + } + }, + "type": "Block", + "value": " block comment 2 " + } + ], + "tokens": [ + { + "range": [ + 0, + 3 + ], + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 3 + } + }, + "type": "Keyword", + "value": "var" + }, + { + "range": [ + 4, + 6 + ], + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "type": "Identifier", + "value": "p1" + }, + { + "range": [ + 6, + 7 + ], + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "type": "Punctuator", + "value": ";" + } + ] + }, + + '/*42*/': { + "range": [ + 6, + 6 + ], + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "type": "Program", + "body": [], + "leadingComments": [ + { + "range": [ + 0, + 6 + ], + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "type": "Block", + "value": "42" + } + ], + "comments": [ + { + "range": [ + 0, + 6 + ], + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "type": "Block", + "value": "42" + } + ], + "tokens": [] + }, + + '(a + /* assignmenr */b ) * c': { + "type": "Program", + "body": [ + { + "type": "ExpressionStatement", + "expression": { + "type": "BinaryExpression", + "operator": "*", + "left": { + "type": "BinaryExpression", + "operator": "+", + "left": { + "type": "Identifier", + "name": "a", + "range": [ + 1, + 2 + ], + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 2 + } + } + }, + "right": { + "type": "Identifier", + "name": "b", + "range": [ + 21, + 22 + ], + "loc": { + "start": { + "line": 1, + "column": 21 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "leadingComments": [ + { + "type": "Block", + "value": " assignmenr ", + "range": [ + 5, + 21 + ], + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 21 + } + } + } + ] + }, + "range": [ + 1, + 22 + ], + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 22 + } + } + }, + "right": { + "type": "Identifier", + "name": "c", + "range": [ + 27, + 28 + ], + "loc": { + "start": { + "line": 1, + "column": 27 + }, + "end": { + "line": 1, + "column": 28 + } + } + }, + "range": [ + 0, + 28 + ], + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 28 + } + } + }, + "range": [ + 0, + 28 + ], + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 28 + } + } + } + ], + "range": [ + 0, + 28 + ], + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 28 + } + }, + "comments": [ + { + "type": "Block", + "value": " assignmenr ", + "range": [ + 5, + 21 + ], + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 21 + } + } + } + ] + }, + + '/* assignmenr */\n a = b': { + "type": "Program", + "body": [ + { + "type": "ExpressionStatement", + "expression": { + "type": "AssignmentExpression", + "operator": "=", + "left": { + "type": "Identifier", + "name": "a", + "range": [ + 18, + 19 + ], + "loc": { + "start": { + "line": 2, + "column": 1 + }, + "end": { + "line": 2, + "column": 2 + } + } + }, + "right": { + "type": "Identifier", + "name": "b", + "range": [ + 22, + 23 + ], + "loc": { + "start": { + "line": 2, + "column": 5 + }, + "end": { + "line": 2, + "column": 6 + } + } + }, + "range": [ + 18, + 23 + ], + "loc": { + "start": { + "line": 2, + "column": 1 + }, + "end": { + "line": 2, + "column": 6 + } + } + }, + "range": [ + 18, + 23 + ], + "loc": { + "start": { + "line": 2, + "column": 1 + }, + "end": { + "line": 2, + "column": 6 + } + }, + "leadingComments": [ + { + "type": "Block", + "value": " assignmenr ", + "range": [ + 0, + 16 + ], + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 16 + } + } + } + ] + } + ], + "range": [ + 18, + 23 + ], + "loc": { + "start": { + "line": 2, + "column": 1 + }, + "end": { + "line": 2, + "column": 6 + } + }, + "comments": [ + { + "type": "Block", + "value": " assignmenr ", + "range": [ + 0, + 16 + ], + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 16 + } + } + } + ] }, - '// Hello, world!\n': { + '42 /*The*/ /*Answer*/': { type: 'Program', - body: [], - range: [17, 17], - loc: { - start: { line: 2, column: 0 }, - end: { line: 2, column: 0 } - }, - comments: [{ - type: 'Line', - value: ' Hello, world!', - range: [0, 16], + body: [{ + type: 'ExpressionStatement', + expression: { + type: 'Literal', + value: 42, + raw: '42', + range: [0, 2], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 2 } + } + }, + range: [0, 21], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 16 } + end: { line: 1, column: 21 } } - }] - }, - - '// Hallo, world!\n': { - type: 'Program', - body: [], + }], + range: [0, 21], loc: { - start: { line: 2, column: 0 }, - end: { line: 2, column: 0 } + start: { line: 1, column: 0 }, + end: { line: 1, column: 21 } }, comments: [{ - type: 'Line', - value: ' Hallo, world!', + type: 'Block', + value: 'The', + range: [3, 10], loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 16 } + start: { line: 1, column: 3 }, + end: { line: 1, column: 10 } + } + }, { + type: 'Block', + value: 'Answer', + range: [11, 21], + loc: { + start: { line: 1, column: 11 }, + end: { line: 1, column: 21 } } }] }, - '//\n42': { + '42 /*the*/ /*answer*/': { type: 'Program', body: [{ type: 'ExpressionStatement', @@ -3423,65 +4112,42 @@ var testFixture = { type: 'Literal', value: 42, raw: '42', - range: [3, 5], - loc: { - start: { line: 2, column: 0 }, - end: { line: 2, column: 2 } - } + range: [0, 2] }, - range: [3, 5], - loc: { - start: { line: 2, column: 0 }, - end: { line: 2, column: 2 } - } + range: [0, 21] }], - range: [3, 5], - loc: { - start: { line: 2, column: 0 }, - end: { line: 2, column: 2 } - }, + range: [0, 21], comments: [{ - type: 'Line', - value: '', - range: [0, 2], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 2 } - } + type: 'Block', + value: 'the', + range: [3, 10] + }, { + type: 'Block', + value: 'answer', + range: [11, 21] }] }, - '//': { - type: 'Program', - body: [], - range: [2, 2], - loc: { - start: { line: 1, column: 2 }, - end: { line: 1, column: 2 } - }, - comments: [{ - type: 'Line', - value: '', + '42 /* the * answer */': { + type: 'ExpressionStatement', + expression: { + type: 'Literal', + value: 42, + raw: '42', range: [0, 2], loc: { start: { line: 1, column: 0 }, end: { line: 1, column: 2 } } - }] - }, - - '// ': { - type: 'Program', - body: [], - range: [3, 3], - comments: [{ - type: 'Line', - value: ' ', - range: [0, 3] - }] + }, + range: [0, 21], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 21 } + } }, - '/**/42': { + '42 /* The * answer */': { type: 'Program', body: [{ type: 'ExpressionStatement', @@ -3489,35 +4155,54 @@ var testFixture = { type: 'Literal', value: 42, raw: '42', - range: [4, 6], + range: [0, 2], loc: { - start: { line: 1, column: 4 }, - end: { line: 1, column: 6 } + start: { line: 1, column: 0 }, + end: { line: 1, column: 2 } } }, - range: [4, 6], + range: [0, 21], loc: { - start: { line: 1, column: 4 }, - end: { line: 1, column: 6 } + start: { line: 1, column: 0 }, + end: { line: 1, column: 21 } } }], - range: [4, 6], + range: [0, 21], loc: { - start: { line: 1, column: 4 }, - end: { line: 1, column: 6 } + start: { line: 1, column: 0 }, + end: { line: 1, column: 21 } }, comments: [{ type: 'Block', - value: '', - range: [0, 4], + value: ' The * answer ', + range: [3, 21], loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 4 } + start: { line: 1, column: 3 }, + end: { line: 1, column: 21 } } }] }, - '// Hello, world!\n\n// Another hello\n42': { + '/* multiline\ncomment\nshould\nbe\nignored */ 42': { + type: 'ExpressionStatement', + expression: { + type: 'Literal', + value: 42, + raw: '42', + range: [42, 44], + loc: { + start: { line: 5, column: 11 }, + end: { line: 5, column: 13 } + } + }, + range: [42, 44], + loc: { + start: { line: 5, column: 11 }, + end: { line: 5, column: 13 } + } + }, + + '/*a\r\nb*/ 42': { type: 'Program', body: [{ type: 'ExpressionStatement', @@ -3525,2713 +4210,2415 @@ var testFixture = { type: 'Literal', value: 42, raw: '42', - range: [37, 39], + range: [9, 11], loc: { - start: { line: 4, column: 0 }, - end: { line: 4, column: 2 } + start: { line: 2, column: 4 }, + end: { line: 2, column: 6 } } }, - range: [37, 39], + range: [9, 11], loc: { - start: { line: 4, column: 0 }, - end: { line: 4, column: 2 } - } + start: { line: 2, column: 4 }, + end: { line: 2, column: 6 } + }, + leadingComments: [{ + type: 'Block', + value: 'a\r\nb', + range: [0, 8], + loc: { + start: { line: 1, column: 0 }, + end: { line: 2, column: 3 } + } + }] }], - range: [37, 39], + range: [9, 11], loc: { - start: { line: 4, column: 0 }, - end: { line: 4, column: 2 } + start: { line: 2, column: 4 }, + end: { line: 2, column: 6 } }, comments: [{ - type: 'Line', - value: ' Hello, world!', - range: [0, 16], + type: 'Block', + value: 'a\r\nb', + range: [0, 8], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 16 } - } - }, { - type: 'Line', - value: ' Another hello', - range: [18, 36], - loc: { - start: { line: 3, column: 0 }, - end: { line: 3, column: 18 } + end: { line: 2, column: 3 } } }] }, - 'if (x) { // Some comment\ndoThat(); }': { + '/*a\rb*/ 42': { type: 'Program', body: [{ - type: 'IfStatement', - test: { - type: 'Identifier', - name: 'x', - range: [4, 5], - loc: { - start: { line: 1, column: 4 }, - end: { line: 1, column: 5 } - } - }, - consequent: { - type: 'BlockStatement', - body: [{ - type: 'ExpressionStatement', - expression: { - type: 'CallExpression', - callee: { - type: 'Identifier', - name: 'doThat', - range: [25, 31], - loc: { - start: { line: 2, column: 0 }, - end: { line: 2, column: 6 } - } - }, - 'arguments': [], - range: [25, 33], - loc: { - start: { line: 2, column: 0 }, - end: { line: 2, column: 8 } - } - }, - range: [25, 34], - loc: { - start: { line: 2, column: 0 }, - end: { line: 2, column: 9 } - } - }], - range: [7, 36], + type: 'ExpressionStatement', + expression: { + type: 'Literal', + value: 42, + raw: '42', + range: [8, 10], loc: { - start: { line: 1, column: 7 }, - end: { line: 2, column: 11 } + start: { line: 2, column: 4 }, + end: { line: 2, column: 6 } } }, - alternate: null, - range: [0, 36], + range: [8, 10], loc: { - start: { line: 1, column: 0 }, - end: { line: 2, column: 11 } + start: { line: 2, column: 4 }, + end: { line: 2, column: 6 } } }], - range: [0, 36], + range: [8, 10], loc: { - start: { line: 1, column: 0 }, - end: { line: 2, column: 11 } + start: { line: 2, column: 4 }, + end: { line: 2, column: 6 } }, comments: [{ - type: 'Line', - value: ' Some comment', - range: [9, 24], + type: 'Block', + value: 'a\rb', + range: [0, 7], loc: { - start: { line: 1, column: 9 }, - end: { line: 1, column: 24 } + start: { line: 1, column: 0 }, + end: { line: 2, column: 3 } } }] }, - 'switch (answer) { case 42: /* perfect */ bingo() }': { + '/*a\nb*/ 42': { type: 'Program', body: [{ - type: 'SwitchStatement', - discriminant: { - type: 'Identifier', - name: 'answer', - range: [8, 14], + type: 'ExpressionStatement', + expression: { + type: 'Literal', + value: 42, + raw: '42', + range: [8, 10], loc: { - start: { line: 1, column: 8 }, - end: { line: 1, column: 14 } + start: { line: 2, column: 4 }, + end: { line: 2, column: 6 } } }, - cases: [{ - type: 'SwitchCase', - test: { - type: 'Literal', - value: 42, - raw: '42', - range: [23, 25], - loc: { - start: { line: 1, column: 23 }, - end: { line: 1, column: 25 } - } - }, - consequent: [{ - type: 'ExpressionStatement', - expression: { - type: 'CallExpression', - callee: { - type: 'Identifier', - name: 'bingo', - range: [41, 46], - loc: { - start: { line: 1, column: 41 }, - end: { line: 1, column: 46 } - } - }, - 'arguments': [], - range: [41, 48], - loc: { - start: { line: 1, column: 41 }, - end: { line: 1, column: 48 } - } - }, - range: [41, 49], - loc: { - start: { line: 1, column: 41 }, - end: { line: 1, column: 49 } - } - }], - range: [18, 49], + range: [8, 10], + loc: { + start: { line: 2, column: 4 }, + end: { line: 2, column: 6 } + }, + leadingComments: [{ + type: 'Block', + value: 'a\nb', + range: [0, 7], loc: { - start: { line: 1, column: 18 }, - end: { line: 1, column: 49 } + start: { line: 1, column: 0 }, + end: { line: 2, column: 3 } } - }], - range: [0, 50], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 50 } - } + }] }], - range: [0, 50], + range: [8, 10], loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 50 } + start: { line: 2, column: 4 }, + end: { line: 2, column: 6 } }, comments: [{ type: 'Block', - value: ' perfect ', - range: [27, 40], + value: 'a\nb', + range: [0, 7], loc: { - start: { line: 1, column: 27 }, - end: { line: 1, column: 40 } + start: { line: 1, column: 0 }, + end: { line: 2, column: 3 } } }] - } - - }, - - 'Numeric Literals': { + }, - '0': { - type: 'ExpressionStatement', - expression: { - type: 'Literal', - value: 0, - raw: '0', - range: [0, 1], + '/*a\nc*/ 42': { + type: 'Program', + body: [{ + type: 'ExpressionStatement', + expression: { + type: 'Literal', + value: 42, + raw: '42', + range: [8, 10], + loc: { + start: { line: 2, column: 4 }, + end: { line: 2, column: 6 } + } + }, + range: [8, 10], + loc: { + start: { line: 2, column: 4 }, + end: { line: 2, column: 6 } + }, + leadingComments: [{ + type: 'Block', + value: 'a\nc', + range: [0, 7], + loc: { + start: { line: 1, column: 0 }, + end: { line: 2, column: 3 } + } + }] + }], + range: [8, 10], + loc: { + start: { line: 2, column: 4 }, + end: { line: 2, column: 6 } + }, + comments: [{ + type: 'Block', + value: 'a\nc', + range: [0, 7], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 1 } + end: { line: 2, column: 3 } } - }, - range: [0, 1], + }] + }, + + '// one\\n': { + type: 'Program', + body: [], + range: [8, 8], loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 1 } - } + start: { line: 1, column: 8 }, + end: { line: 1, column: 8 } + }, + leadingComments: [{ + type: 'Line', + value: ' one\\n', + range: [0, 8], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 8 } + } + }], + comments: [{ + type: 'Line', + value: ' one\\n', + range: [0, 8], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 8 } + } + }] }, - '42': { + '// line comment\n42': { type: 'ExpressionStatement', expression: { type: 'Literal', value: 42, raw: '42', - range: [0, 2], + range: [16, 18], loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 2 } + start: { line: 2, column: 0 }, + end: { line: 2, column: 2 } } }, - range: [0, 2], + range: [16, 18], loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 2 } + start: { line: 2, column: 0 }, + end: { line: 2, column: 2 } } }, - '3': { + '42 // line comment': { type: 'Program', body: [{ type: 'ExpressionStatement', expression: { type: 'Literal', - value: 3, - raw: '3', - range: [0, 1] + value: 42, + raw: '42', + range: [0, 2], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 2 } + }, + trailingComments: [{ + type: 'Line', + value: ' line comment', + range: [3, 18], + loc: { + start: { line: 1, column: 3 }, + end: { line: 1, column: 18 } + } + }] }, - range: [0, 1] + range: [0, 18], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 18 } + } }], - range: [0, 1], - tokens: [{ - type: 'Numeric', - value: '3', - range: [0, 1] + range: [0, 18], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 18 } + }, + comments: [{ + type: 'Line', + value: ' line comment', + range: [3, 18], + loc: { + start: { line: 1, column: 3 }, + end: { line: 1, column: 18 } + } }] }, - '5': { + '// Hello, world!\n42': { type: 'Program', body: [{ type: 'ExpressionStatement', expression: { type: 'Literal', - value: 5, - raw: '5', + value: 42, + raw: '42', + range: [17, 19], loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 1 } + start: { line: 2, column: 0 }, + end: { line: 2, column: 2 } } }, + range: [17, 19], loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 1 } - } + start: { line: 2, column: 0 }, + end: { line: 2, column: 2 } + }, + leadingComments: [{ + type: 'Line', + value: ' Hello, world!', + range: [0, 16], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 16 } + } + }] }], + range: [17, 19], loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 1 } + start: { line: 2, column: 0 }, + end: { line: 2, column: 2 } }, - tokens: [{ - type: 'Numeric', - value: '5', + comments: [{ + type: 'Line', + value: ' Hello, world!', + range: [0, 16], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 1 } + end: { line: 1, column: 16 } } }] }, - '.14': { - type: 'ExpressionStatement', - expression: { - type: 'Literal', - value: 0.14, - raw: '.14', - range: [0, 3], + '// Hello, world!\n': { + type: 'Program', + body: [], + range: [17, 17], + loc: { + start: { line: 2, column: 0 }, + end: { line: 2, column: 0 } + }, + comments: [{ + type: 'Line', + value: ' Hello, world!', + range: [0, 16], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 3 } + end: { line: 1, column: 16 } } - }, - range: [0, 3], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 3 } - } + }] }, - '3.14159': { - type: 'ExpressionStatement', - expression: { - type: 'Literal', - value: 3.14159, - raw: '3.14159', - range: [0, 7], + '// Hallo, world!\n': { + type: 'Program', + body: [], + loc: { + start: { line: 2, column: 0 }, + end: { line: 2, column: 0 } + }, + comments: [{ + type: 'Line', + value: ' Hallo, world!', loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 7 } + end: { line: 1, column: 16 } } - }, - range: [0, 7], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 7 } - } + }] }, - '6.02214179e+23': { - type: 'ExpressionStatement', - expression: { - type: 'Literal', - value: 6.02214179e+23, - raw: '6.02214179e+23', - range: [0, 14], + '//\n42': { + type: 'Program', + body: [{ + type: 'ExpressionStatement', + expression: { + type: 'Literal', + value: 42, + raw: '42', + range: [3, 5], + loc: { + start: { line: 2, column: 0 }, + end: { line: 2, column: 2 } + } + }, + range: [3, 5], + loc: { + start: { line: 2, column: 0 }, + end: { line: 2, column: 2 } + }, + leadingComments: [{ + type: 'Line', + value: '', + range: [0, 2], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 2 } + } + }] + }], + range: [3, 5], + loc: { + start: { line: 2, column: 0 }, + end: { line: 2, column: 2 } + }, + comments: [{ + type: 'Line', + value: '', + range: [0, 2], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 14 } + end: { line: 1, column: 2 } } - }, - range: [0, 14], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 14 } - } + }] }, - '1.492417830e-10': { - type: 'ExpressionStatement', - expression: { - type: 'Literal', - value: 1.49241783e-10, - raw: '1.492417830e-10', - range: [0, 15], + '//': { + type: 'Program', + body: [], + range: [2, 2], + loc: { + start: { line: 1, column: 2 }, + end: { line: 1, column: 2 } + }, + comments: [{ + type: 'Line', + value: '', + range: [0, 2], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 15 } + end: { line: 1, column: 2 } } - }, - range: [0, 15], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 15 } - } + }] }, - '0x0': { - type: 'ExpressionStatement', - expression: { - type: 'Literal', - value: 0, - raw: '0x0', - range: [0, 3], + '// ': { + type: 'Program', + body: [], + range: [3, 3], + comments: [{ + type: 'Line', + value: ' ', + range: [0, 3] + }] + }, + + '/**/42': { + type: 'Program', + body: [{ + type: 'ExpressionStatement', + expression: { + type: 'Literal', + value: 42, + raw: '42', + range: [4, 6], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 6 } + } + }, + range: [4, 6], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 6 } + }, + leadingComments: [{ + type: 'Block', + value: '', + range: [0, 4], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 4 } + } + }] + }], + range: [4, 6], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 6 } + }, + comments: [{ + type: 'Block', + value: '', + range: [0, 4], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 3 } + end: { line: 1, column: 4 } } - }, - range: [0, 3], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 3 } - } + }] }, - '0e+100': { - type: 'ExpressionStatement', - expression: { - type: 'Literal', - value: 0, - raw: '0e+100', + '42/**/': { + type: 'Program', + body: [{ + type: 'ExpressionStatement', + expression: { + type: 'Literal', + value: 42, + raw: '42', + range: [0, 2], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 2 } + }, + trailingComments: [{ + type: 'Block', + value: '', + range: [2, 6], + loc: { + start: { line: 1, column: 2 }, + end: { line: 1, column: 6 } + } + }] + }, range: [0, 6], loc: { start: { line: 1, column: 0 }, end: { line: 1, column: 6 } } - }, + }], range: [0, 6], loc: { start: { line: 1, column: 0 }, end: { line: 1, column: 6 } - } - }, - - '0xabc': { - type: 'ExpressionStatement', - expression: { - type: 'Literal', - value: 0xabc, - raw: '0xabc', - range: [0, 5], + }, + comments: [{ + type: 'Block', + value: '', + range: [2, 6], loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 5 } + start: { line: 1, column: 2 }, + end: { line: 1, column: 6 } } - }, - range: [0, 5], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 5 } - } + }] }, - '0xdef': { - type: 'ExpressionStatement', - expression: { - type: 'Literal', - value: 0xdef, - raw: '0xdef', - range: [0, 5], + '// Hello, world!\n\n// Another hello\n42': { + type: 'Program', + body: [{ + type: 'ExpressionStatement', + expression: { + type: 'Literal', + value: 42, + raw: '42', + range: [37, 39], + loc: { + start: { line: 4, column: 0 }, + end: { line: 4, column: 2 } + } + }, + range: [37, 39], loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 5 } - } - }, - range: [0, 5], + start: { line: 4, column: 0 }, + end: { line: 4, column: 2 } + }, + leadingComments: [{ + type: 'Line', + value: ' Hello, world!', + range: [0, 16], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 16 } + } + }, { + type: 'Line', + value: ' Another hello', + range: [18, 36], + loc: { + start: { line: 3, column: 0 }, + end: { line: 3, column: 18 } + } + }] + }], + range: [37, 39], loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 5 } - } - }, - - '0X1A': { - type: 'ExpressionStatement', - expression: { - type: 'Literal', - value: 0x1A, - raw: '0X1A', - range: [0, 4], + start: { line: 4, column: 0 }, + end: { line: 4, column: 2 } + }, + comments: [{ + type: 'Line', + value: ' Hello, world!', + range: [0, 16], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 4 } + end: { line: 1, column: 16 } } - }, - range: [0, 4], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 4 } - } - }, - - '0x10': { - type: 'ExpressionStatement', - expression: { - type: 'Literal', - value: 0x10, - raw: '0x10', - range: [0, 4], + }, { + type: 'Line', + value: ' Another hello', + range: [18, 36], loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 4 } + start: { line: 3, column: 0 }, + end: { line: 3, column: 18 } } - }, - range: [0, 4], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 4 } - } + }] }, - '0x100': { - type: 'ExpressionStatement', - expression: { - type: 'Literal', - value: 0x100, - raw: '0x100', - range: [0, 5], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 5 } - } - }, - range: [0, 5], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 5 } - } - }, - - '0X04': { - type: 'ExpressionStatement', - expression: { - type: 'Literal', - value: 0X04, - raw: '0X04', - range: [0, 4], + 'if (x) { doThat() // Some comment\n }': { + type: 'Program', + body: [{ + type: 'IfStatement', + test: { + type: 'Identifier', + name: 'x', + range: [4, 5], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 5 } + } + }, + consequent: { + type: 'BlockStatement', + body: [{ + type: 'ExpressionStatement', + expression: { + type: 'CallExpression', + callee: { + type: 'Identifier', + name: 'doThat', + range: [9, 15], + loc: { + start: { line: 1, column: 9 }, + end: { line: 1, column: 15 } + } + }, + 'arguments': [], + range: [9, 17], + loc: { + start: { line: 1, column: 9 }, + end: { line: 1, column: 17 } + } + }, + range: [9, 17], + loc: { + start: { line: 1, column: 9 }, + end: { line: 1, column: 17 } + }, + trailingComments: [{ + type: 'Line', + value: ' Some comment', + range: [18, 33], + loc: { + start: { line: 1, column: 18 }, + end: { line: 1, column: 33 } + } + }] + }], + range: [7, 36], + loc: { + start: { line: 1, column: 7 }, + end: { line: 2, column: 2 } + } + }, + alternate: null, + range: [0, 36], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 4 } + end: { line: 2, column: 2 } } - }, - range: [0, 4], + }], + range: [0, 36], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 4 } - } - }, - - '02': { - type: 'ExpressionStatement', - expression: { - type: 'Literal', - value: 2, - raw: '02', - range: [0, 2], + end: { line: 2, column: 2 } + }, + comments: [{ + type: 'Line', + value: ' Some comment', + range: [18, 33], loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 2 } + start: { line: 1, column: 18 }, + end: { line: 1, column: 33 } } - }, - range: [0, 2], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 2 } - } + }] }, - '012': { - type: 'ExpressionStatement', - expression: { - type: 'Literal', - value: 10, - raw: '012', - range: [0, 3], + 'if (x) { // Some comment\ndoThat(); }': { + type: 'Program', + body: [{ + type: 'IfStatement', + test: { + type: 'Identifier', + name: 'x', + range: [4, 5], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 5 } + } + }, + consequent: { + type: 'BlockStatement', + body: [{ + type: 'ExpressionStatement', + expression: { + type: 'CallExpression', + callee: { + type: 'Identifier', + name: 'doThat', + range: [25, 31], + loc: { + start: { line: 2, column: 0 }, + end: { line: 2, column: 6 } + } + }, + 'arguments': [], + range: [25, 33], + loc: { + start: { line: 2, column: 0 }, + end: { line: 2, column: 8 } + } + }, + range: [25, 34], + loc: { + start: { line: 2, column: 0 }, + end: { line: 2, column: 9 } + }, + leadingComments: [{ + type: 'Line', + value: ' Some comment', + range: [9, 24], + loc: { + start: { line: 1, column: 9 }, + end: { line: 1, column: 24 } + } + }] + }], + range: [7, 36], + loc: { + start: { line: 1, column: 7 }, + end: { line: 2, column: 11 } + } + }, + alternate: null, + range: [0, 36], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 3 } + end: { line: 2, column: 11 } } - }, - range: [0, 3], + }], + range: [0, 36], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 3 } - } + end: { line: 2, column: 11 } + }, + comments: [{ + type: 'Line', + value: ' Some comment', + range: [9, 24], + loc: { + start: { line: 1, column: 9 }, + end: { line: 1, column: 24 } + } + }] }, - '0012': { - type: 'ExpressionStatement', - expression: { - type: 'Literal', - value: 10, - raw: '0012', - range: [0, 4], + 'if (x) { /* Some comment */ doThat() }': { + type: 'Program', + body: [{ + type: 'IfStatement', + test: { + type: 'Identifier', + name: 'x', + range: [4, 5], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 5 } + } + }, + consequent: { + type: 'BlockStatement', + body: [{ + type: 'ExpressionStatement', + expression: { + type: 'CallExpression', + callee: { + type: 'Identifier', + name: 'doThat', + range: [28, 34], + loc: { + start: { line: 1, column: 28 }, + end: { line: 1, column: 34 } + } + }, + 'arguments': [], + range: [28, 36], + loc: { + start: { line: 1, column: 28 }, + end: { line: 1, column: 36 } + } + }, + range: [28, 37], + loc: { + start: { line: 1, column: 28 }, + end: { line: 1, column: 37 } + }, + leadingComments: [{ + type: 'Block', + value: ' Some comment ', + range: [9, 27], + loc: { + start: { line: 1, column: 9 }, + end: { line: 1, column: 27 } + } + }] + }], + range: [7, 38], + loc: { + start: { line: 1, column: 7 }, + end: { line: 1, column: 38 } + } + }, + alternate: null, + range: [0, 38], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 4 } + end: { line: 1, column: 38 } } - }, - range: [0, 4], + }], + range: [0, 38], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 4 } - } - } - - }, - - 'String Literals': { - - '"Hello"': { - type: 'ExpressionStatement', - expression: { - type: 'Literal', - value: 'Hello', - raw: '"Hello"', - range: [0, 7], + end: { line: 1, column: 38 } + }, + comments: [{ + type: 'Block', + value: ' Some comment ', + range: [9, 27], loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 7 } + start: { line: 1, column: 9 }, + end: { line: 1, column: 27 } } - }, - range: [0, 7], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 7 } - } + }] }, - '"\\n\\r\\t\\v\\b\\f\\\\\\\'\\"\\0"': { - type: 'ExpressionStatement', - expression: { - type: 'Literal', - value: '\n\r\t\x0B\b\f\\\'"\x00', - raw: '"\\n\\r\\t\\v\\b\\f\\\\\\\'\\"\\0"', - range: [0, 22], + 'if (x) { doThat() /* Some comment */ }': { + type: 'Program', + body: [{ + type: 'IfStatement', + test: { + type: 'Identifier', + name: 'x', + range: [4, 5], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 5 } + } + }, + consequent: { + type: 'BlockStatement', + body: [{ + type: 'ExpressionStatement', + expression: { + type: 'CallExpression', + callee: { + type: 'Identifier', + name: 'doThat', + range: [9, 15], + loc: { + start: { line: 1, column: 9 }, + end: { line: 1, column: 15 } + } + }, + 'arguments': [], + range: [9, 17], + loc: { + start: { line: 1, column: 9 }, + end: { line: 1, column: 17 } + }, + trailingComments: [{ + type: 'Block', + value: ' Some comment ', + range: [18, 36], + loc: { + start: { line: 1, column: 18 }, + end: { line: 1, column: 36 } + } + }] + }, + range: [9, 37], + loc: { + start: { line: 1, column: 9 }, + end: { line: 1, column: 37 } + } + }], + range: [7, 38], + loc: { + start: { line: 1, column: 7 }, + end: { line: 1, column: 38 } + } + }, + alternate: null, + range: [0, 38], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 22 } + end: { line: 1, column: 38 } } - }, - range: [0, 22], + }], + range: [0, 38], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 22 } - } - }, - - '"\\u0061"': { - type: 'ExpressionStatement', - expression: { - type: 'Literal', - value: 'a', - raw: '"\\u0061"', - range: [0, 8], + end: { line: 1, column: 38 } + }, + comments: [{ + type: 'Block', + value: ' Some comment ', + range: [18, 36], loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 8 } + start: { line: 1, column: 18 }, + end: { line: 1, column: 36 } } - }, - range: [0, 8], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 8 } - } + }] }, - '"\\x61"': { - type: 'ExpressionStatement', - expression: { - type: 'Literal', - value: 'a', - raw: '"\\x61"', - range: [0, 6], + 'switch (answer) { case 42: /* perfect */ bingo() }': { + type: 'Program', + body: [{ + type: 'SwitchStatement', + discriminant: { + type: 'Identifier', + name: 'answer', + range: [8, 14], + loc: { + start: { line: 1, column: 8 }, + end: { line: 1, column: 14 } + } + }, + cases: [{ + type: 'SwitchCase', + test: { + type: 'Literal', + value: 42, + raw: '42', + range: [23, 25], + loc: { + start: { line: 1, column: 23 }, + end: { line: 1, column: 25 } + } + }, + consequent: [{ + type: 'ExpressionStatement', + expression: { + type: 'CallExpression', + callee: { + type: 'Identifier', + name: 'bingo', + range: [41, 46], + loc: { + start: { line: 1, column: 41 }, + end: { line: 1, column: 46 } + } + }, + 'arguments': [], + range: [41, 48], + loc: { + start: { line: 1, column: 41 }, + end: { line: 1, column: 48 } + } + }, + range: [41, 49], + loc: { + start: { line: 1, column: 41 }, + end: { line: 1, column: 49 } + }, + leadingComments: [{ + type: 'Block', + value: ' perfect ', + range: [27, 40], + loc: { + start: { line: 1, column: 27 }, + end: { line: 1, column: 40 } + } + }] + }], + range: [18, 49], + loc: { + start: { line: 1, column: 18 }, + end: { line: 1, column: 49 } + } + }], + range: [0, 50], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 6 } + end: { line: 1, column: 50 } } - }, - range: [0, 6], + }], + range: [0, 50], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 6 } - } + end: { line: 1, column: 50 } + }, + comments: [{ + type: 'Block', + value: ' perfect ', + range: [27, 40], + loc: { + start: { line: 1, column: 27 }, + end: { line: 1, column: 40 } + } + }] }, - '"\\u00"': { - type: 'ExpressionStatement', - expression: { - type: 'Literal', - value: 'u00', - raw: '"\\u00"', - range: [0, 6], + 'switch (answer) { case 42: bingo() /* perfect */ }': { + type: 'Program', + body: [{ + type: 'SwitchStatement', + discriminant: { + type: 'Identifier', + name: 'answer', + range: [8, 14], + loc: { + start: { line: 1, column: 8 }, + end: { line: 1, column: 14 } + } + }, + cases: [{ + type: 'SwitchCase', + test: { + type: 'Literal', + value: 42, + raw: '42', + range: [23, 25], + loc: { + start: { line: 1, column: 23 }, + end: { line: 1, column: 25 } + } + }, + consequent: [{ + type: 'ExpressionStatement', + expression: { + type: 'CallExpression', + callee: { + type: 'Identifier', + name: 'bingo', + range: [27, 32], + loc: { + start: { line: 1, column: 27 }, + end: { line: 1, column: 32 } + } + }, + 'arguments': [], + range: [27, 34], + loc: { + start: { line: 1, column: 27 }, + end: { line: 1, column: 34 } + }, + trailingComments: [{ + type: 'Block', + value: ' perfect ', + range: [35, 48], + loc: { + start: { line: 1, column: 35 }, + end: { line: 1, column: 48 } + } + }] + }, + range: [27, 49], + loc: { + start: { line: 1, column: 27 }, + end: { line: 1, column: 49 } + } + }], + range: [18, 49], + loc: { + start: { line: 1, column: 18 }, + end: { line: 1, column: 49 } + } + }], + range: [0, 50], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 6 } + end: { line: 1, column: 50 } } - }, - range: [0, 6], + }], + range: [0, 50], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 6 } - } - }, - - '"\\xt"': { - type: 'ExpressionStatement', - expression: { - type: 'Literal', - value: 'xt', - raw: '"\\xt"', - range: [0, 5], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 5 } - } + end: { line: 1, column: 50 } }, - range: [0, 5], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 5 } - } - }, - - '"Hello\\nworld"': { - type: 'ExpressionStatement', - expression: { - type: 'Literal', - value: 'Hello\nworld', - raw: '"Hello\\nworld"', - range: [0, 14], + comments: [{ + type: 'Block', + value: ' perfect ', + range: [35, 48], loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 14 } + start: { line: 1, column: 35 }, + end: { line: 1, column: 48 } } - }, - range: [0, 14], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 14 } - } + }] }, - '"Hello\\\nworld"': { - type: 'ExpressionStatement', - expression: { - type: 'Literal', - value: 'Helloworld', - raw: '"Hello\\\nworld"', - range: [0, 14], + '/* header */ (function(){ var version = 1; }).call(this)': { + type: 'Program', + body: [{ + type: 'ExpressionStatement', + expression: { + type: 'CallExpression', + callee: { + type: 'MemberExpression', + computed: false, + object: { + type: 'FunctionExpression', + id: null, + params: [], + defaults: [], + body: { + type: 'BlockStatement', + body: [{ + type: 'VariableDeclaration', + declarations: [{ + type: 'VariableDeclarator', + id: { + type: 'Identifier', + name: 'version', + range: [30, 37], + loc: { + start: { line: 1, column: 30 }, + end: { line: 1, column: 37 } + } + }, + init: { + type: 'Literal', + value: 1, + raw: '1', + range: [40, 41], + loc: { + start: { line: 1, column: 40 }, + end: { line: 1, column: 41 } + } + }, + range: [30, 41], + loc: { + start: { line: 1, column: 30 }, + end: { line: 1, column: 41 } + } + }], + kind: 'var', + range: [26, 42], + loc: { + start: { line: 1, column: 26 }, + end: { line: 1, column: 42 } + } + }], + range: [24, 44], + loc: { + start: { line: 1, column: 24 }, + end: { line: 1, column: 44 } + } + }, + rest: null, + generator: false, + expression: false, + range: [14, 44], + loc: { + start: { line: 1, column: 14 }, + end: { line: 1, column: 44 } + } + }, + property: { + type: 'Identifier', + name: 'call', + range: [46, 50], + loc: { + start: { line: 1, column: 46 }, + end: { line: 1, column: 50 } + } + }, + range: [13, 50], + loc: { + start: { line: 1, column: 13 }, + end: { line: 1, column: 50 } + } + }, + 'arguments': [{ + type: 'ThisExpression', + range: [51, 55], + loc: { + start: { line: 1, column: 51 }, + end: { line: 1, column: 55 } + } + }], + range: [13, 56], + loc: { + start: { line: 1, column: 13 }, + end: { line: 1, column: 56 } + } + }, + range: [13, 56], loc: { - start: { line: 1, column: 0 }, - end: { line: 2, column: 14 } - } - }, - range: [0, 14], + start: { line: 1, column: 13 }, + end: { line: 1, column: 56 } + }, + leadingComments: [{ + type: 'Block', + value: ' header ', + range: [0, 12], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 12 } + } + }] + }], + range: [13, 56], loc: { - start: { line: 1, column: 0 }, - end: { line: 2, column: 14 } - } - }, - - '"Hello\\02World"': { - type: 'ExpressionStatement', - expression: { - type: 'Literal', - value: 'Hello\u0002World', - raw: '"Hello\\02World"', - range: [0, 15], + start: { line: 1, column: 13 }, + end: { line: 1, column: 56 } + }, + comments: [{ + type: 'Block', + value: ' header ', + range: [0, 12], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 15 } + end: { line: 1, column: 12 } } - }, - range: [0, 15], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 15 } - } + }] }, - '"Hello\\012World"': { - type: 'ExpressionStatement', - expression: { - type: 'Literal', - value: 'Hello\u000AWorld', - raw: '"Hello\\012World"', - range: [0, 16], + '(function(){ var version = 1; /* sync */ }).call(this)': { + type: 'Program', + body: [{ + type: 'ExpressionStatement', + expression: { + type: 'CallExpression', + callee: { + type: 'MemberExpression', + computed: false, + object: { + type: 'FunctionExpression', + id: null, + params: [], + defaults: [], + body: { + type: 'BlockStatement', + body: [{ + type: 'VariableDeclaration', + declarations: [{ + type: 'VariableDeclarator', + id: { + type: 'Identifier', + name: 'version', + range: [17, 24], + loc: { + start: { line: 1, column: 17 }, + end: { line: 1, column: 24 } + } + }, + init: { + type: 'Literal', + value: 1, + raw: '1', + range: [27, 28], + loc: { + start: { line: 1, column: 27 }, + end: { line: 1, column: 28 } + } + }, + range: [17, 28], + loc: { + start: { line: 1, column: 17 }, + end: { line: 1, column: 28 } + } + }], + kind: 'var', + range: [13, 29], + loc: { + start: { line: 1, column: 13 }, + end: { line: 1, column: 29 } + }, + trailingComments: [{ + type: 'Block', + value: ' sync ', + range: [30, 40], + loc: { + start: { line: 1, column: 30 }, + end: { line: 1, column: 40 } + } + }] + }], + range: [11, 42], + loc: { + start: { line: 1, column: 11 }, + end: { line: 1, column: 42 } + } + }, + rest: null, + generator: false, + expression: false, + range: [1, 42], + loc: { + start: { line: 1, column: 1 }, + end: { line: 1, column: 42 } + } + }, + property: { + type: 'Identifier', + name: 'call', + range: [44, 48], + loc: { + start: { line: 1, column: 44 }, + end: { line: 1, column: 48 } + }, + leadingComments: [{ + type: 'Block', + value: ' sync ', + range: [30, 40], + loc: { + start: { line: 1, column: 30 }, + end: { line: 1, column: 40 } + } + }] + }, + range: [0, 48], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 48 } + } + }, + 'arguments': [{ + type: 'ThisExpression', + range: [49, 53], + loc: { + start: { line: 1, column: 49 }, + end: { line: 1, column: 53 } + } + }], + range: [0, 54], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 54 } + } + }, + range: [0, 54], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 16 } + end: { line: 1, column: 54 } } - }, - range: [0, 16], + }], + range: [0, 54], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 16 } - } - }, - - '"Hello\\122World"': { - type: 'ExpressionStatement', - expression: { - type: 'Literal', - value: 'Hello\122World', - raw: '"Hello\\122World"', - range: [0, 16], + end: { line: 1, column: 54 } + }, + comments: [{ + type: 'Block', + value: ' sync ', + range: [30, 40], loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 16 } + start: { line: 1, column: 30 }, + end: { line: 1, column: 40 } } - }, - range: [0, 16], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 16 } - } + }] }, - '"Hello\\0122World"': { - type: 'ExpressionStatement', - expression: { - type: 'Literal', - value: 'Hello\u000A2World', - raw: '"Hello\\0122World"', - range: [0, 17], + 'function f() { /* infinite */ while (true) { } /* bar */ var each; }': { + type: 'Program', + body: [{ + type: 'FunctionDeclaration', + id: { + type: 'Identifier', + name: 'f', + range: [9, 10], + loc: { + start: { line: 1, column: 9 }, + end: { line: 1, column: 10 } + } + }, + params: [], + defaults: [], + body: { + type: 'BlockStatement', + body: [{ + type: 'WhileStatement', + test: { + type: 'Literal', + value: true, + raw: 'true', + range: [37, 41], + loc: { + start: { line: 1, column: 37 }, + end: { line: 1, column: 41 } + } + }, + body: { + type: 'BlockStatement', + body: [], + range: [43, 46], + loc: { + start: { line: 1, column: 43 }, + end: { line: 1, column: 46 } + } + }, + range: [30, 46], + loc: { + start: { line: 1, column: 30 }, + end: { line: 1, column: 46 } + }, + leadingComments: [{ + type: 'Block', + value: ' infinite ', + range: [15, 29], + loc: { + start: { line: 1, column: 15 }, + end: { line: 1, column: 29 } + } + }], + trailingComments: [{ + type: 'Block', + value: ' bar ', + range: [47, 56], + loc: { + start: { line: 1, column: 47 }, + end: { line: 1, column: 56 } + } + }] + }, { + type: 'VariableDeclaration', + declarations: [{ + type: 'VariableDeclarator', + id: { + type: 'Identifier', + name: 'each', + range: [61, 65], + loc: { + start: { line: 1, column: 61 }, + end: { line: 1, column: 65 } + } + }, + init: null, + range: [61, 65], + loc: { + start: { line: 1, column: 61 }, + end: { line: 1, column: 65 } + } + }], + kind: 'var', + range: [57, 66], + loc: { + start: { line: 1, column: 57 }, + end: { line: 1, column: 66 } + }, + leadingComments: [{ + type: 'Block', + value: ' bar ', + range: [47, 56], + loc: { + start: { line: 1, column: 47 }, + end: { line: 1, column: 56 } + } + }] + }], + range: [13, 68], + loc: { + start: { line: 1, column: 13 }, + end: { line: 1, column: 68 } + } + }, + rest: null, + generator: false, + expression: false, + range: [0, 68], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 17 } + end: { line: 1, column: 68 } } - }, - range: [0, 17], + }], + range: [0, 68], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 17 } - } - }, - - '"Hello\\312World"': { - type: 'ExpressionStatement', - expression: { - type: 'Literal', - value: 'Hello\u00CAWorld', - raw: '"Hello\\312World"', - range: [0, 16], + end: { line: 1, column: 68 } + }, + comments: [{ + type: 'Block', + value: ' infinite ', + range: [15, 29], loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 16 } + start: { line: 1, column: 15 }, + end: { line: 1, column: 29 } } - }, - range: [0, 16], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 16 } - } - }, - - '"Hello\\412World"': { - type: 'ExpressionStatement', - expression: { - type: 'Literal', - value: 'Hello\412World', - raw: '"Hello\\412World"', - range: [0, 16], + }, { + type: 'Block', + value: ' bar ', + range: [47, 56], loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 16 } + start: { line: 1, column: 47 }, + end: { line: 1, column: 56 } } - }, - range: [0, 16], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 16 } - } + }] }, - '"Hello\\812World"': { - type: 'ExpressionStatement', - expression: { - type: 'Literal', - value: 'Hello812World', - raw: '"Hello\\812World"', - range: [0, 16], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 16 } - } - }, - range: [0, 16], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 16 } - } + ' comment': { + type: 'Program', + body: [], + range: [11, 11], + loc: { + start: { line: 1, column: 11 }, + end: { line: 1, column: 11 } + }, + comments: [{ + type: 'Line', + value: ' comment', + range: [0, 11], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 14 } + end: { line: 1, column: 11 } } - }, - range: [0, 14], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 14 } - } + }] }, - '"Hello\\\r\nworld"': { - type: 'ExpressionStatement', - expression: { - type: 'Literal', - value: 'Helloworld', - raw: '"Hello\\\r\nworld"', - range: [0, 15], + ' comment': { + type: 'Program', + body: [], + range: [14, 14], + loc: { + start: { line: 1, column: 14 }, + end: { line: 1, column: 14 } + }, + comments: [{ + type: 'Line', + value: ' comment', + range: [3, 14], loc: { - start: { line: 1, column: 0 }, + start: { line: 1, column: 3 }, end: { line: 1, column: 14 } } - }, - range: [0, 14], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 14 } - } - } - }, - - 'Regular Expression Literals': { + }] + }, - 'var x = /[a-z]/i': { + ' \t /* block comment */ --> comment': { type: 'Program', - body: [{ - type: 'VariableDeclaration', - declarations: [{ - type: 'VariableDeclarator', - id: { - type: 'Identifier', - name: 'x', - range: [4, 5], - loc: { - start: { line: 1, column: 4 }, - end: { line: 1, column: 5 } - } - }, - init: { - type: 'Literal', - value: '/[a-z]/i', - raw: '/[a-z]/i', - range: [8, 16], - loc: { - start: { line: 1, column: 8 }, - end: { line: 1, column: 16 } - } - }, - range: [4, 16], - loc: { - start: { line: 1, column: 4 }, - end: { line: 1, column: 16 } - } - }], - kind: 'var', - range: [0, 16], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 16 } - } - }], - range: [0, 16], + body: [], + range: [35, 35], loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 16 } + start: { line: 1, column: 35 }, + end: { line: 1, column: 35 } }, - tokens: [{ - type: 'Keyword', - value: 'var', - range: [0, 3], + comments: [{ + type: 'Block', + value: ' block comment ', + range: [3, 22], loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 3 } + start: { line: 1, column: 3 }, + end: { line: 1, column: 22 } } }, { - type: 'Identifier', - value: 'x', - range: [4, 5], + type: 'Line', + value: ' comment', + range: [24, 35], loc: { - start: { line: 1, column: 4 }, - end: { line: 1, column: 5 } + start: { line: 1, column: 24 }, + end: { line: 1, column: 35 } } - }, { - type: 'Punctuator', - value: '=', - range: [6, 7], + }] + }, + + '/* block comment */--> comment': { + type: 'Program', + body: [], + range: [30, 30], + loc: { + start: { line: 1, column: 30 }, + end: { line: 1, column: 30 } + }, + comments: [{ + type: 'Block', + value: ' block comment ', + range: [0, 19], loc: { - start: { line: 1, column: 6 }, - end: { line: 1, column: 7 } + start: { line: 1, column: 0 }, + end: { line: 1, column: 19 } } }, { - type: 'RegularExpression', - value: '/[a-z]/i', - range: [8, 16], + type: 'Line', + value: ' comment', + range: [19, 30], loc: { - start: { line: 1, column: 8 }, - end: { line: 1, column: 16 } + start: { line: 1, column: 19 }, + end: { line: 1, column: 30 } } }] }, - 'var x = /[x-z]/i': { + '/* not comment*/; i-->0': { type: 'Program', body: [{ - type: 'VariableDeclaration', - declarations: [{ - type: 'VariableDeclarator', - id: { - type: 'Identifier', - name: 'x', - range: [4, 5] - }, - init: { - type: 'Literal', - value: '/[x-z]/i', - raw: '/[x-z]/i', - range: [8, 16] - }, - range: [4, 16] - }], - kind: 'var', - range: [0, 16] - }], - range: [0, 16], - tokens: [{ - type: 'Keyword', - value: 'var', - range: [0, 3] - }, { - type: 'Identifier', - value: 'x', - range: [4, 5] - }, { - type: 'Punctuator', - value: '=', - range: [6, 7] + type: 'EmptyStatement', + range: [16, 17], + loc: { + start: { line: 1, column: 16 }, + end: { line: 1, column: 17 } + } }, { - type: 'RegularExpression', - value: '/[x-z]/i', - range: [8, 16] - }] - }, - - 'var x = /[a-c]/i': { - type: 'Program', - body: [{ - type: 'VariableDeclaration', - declarations: [{ - type: 'VariableDeclarator', - id: { - type: 'Identifier', - name: 'x', + type: 'ExpressionStatement', + expression: { + type: 'BinaryExpression', + operator: '>', + left: { + type: 'UpdateExpression', + operator: '--', + argument: { + type: 'Identifier', + name: 'i', + range: [18, 19], + loc: { + start: { line: 1, column: 18 }, + end: { line: 1, column: 19 } + } + }, + prefix: false, + range: [18, 21], loc: { - start: { line: 1, column: 4 }, - end: { line: 1, column: 5 } + start: { line: 1, column: 18 }, + end: { line: 1, column: 21 } } }, - init: { + right: { type: 'Literal', - value: '/[a-c]/i', - raw: '/[a-c]/i', + value: 0, + raw: '0', + range: [22, 23], loc: { - start: { line: 1, column: 8 }, - end: { line: 1, column: 16 } + start: { line: 1, column: 22 }, + end: { line: 1, column: 23 } } }, + range: [18, 23], loc: { - start: { line: 1, column: 4 }, - end: { line: 1, column: 16 } + start: { line: 1, column: 18 }, + end: { line: 1, column: 23 } } - }], - kind: 'var', + }, + range: [18, 23], loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 16 } + start: { line: 1, column: 18 }, + end: { line: 1, column: 23 } } }], + range: [16, 23], loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 16 } + start: { line: 1, column: 16 }, + end: { line: 1, column: 23 } }, tokens: [{ - type: 'Keyword', - value: 'var', + type: 'Punctuator', + value: ';', + range: [16, 17], loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 3 } + start: { line: 1, column: 16 }, + end: { line: 1, column: 17 } } }, { type: 'Identifier', - value: 'x', + value: 'i', + range: [18, 19], loc: { - start: { line: 1, column: 4 }, - end: { line: 1, column: 5 } + start: { line: 1, column: 18 }, + end: { line: 1, column: 19 } } }, { type: 'Punctuator', - value: '=', + value: '--', + range: [19, 21], loc: { - start: { line: 1, column: 6 }, - end: { line: 1, column: 7 } + start: { line: 1, column: 19 }, + end: { line: 1, column: 21 } } }, { - type: 'RegularExpression', - value: '/[a-c]/i', + type: 'Punctuator', + value: '>', + range: [21, 22], loc: { - start: { line: 1, column: 8 }, - end: { line: 1, column: 16 } + start: { line: 1, column: 21 }, + end: { line: 1, column: 22 } + } + }, { + type: 'Numeric', + value: '0', + range: [22, 23], + loc: { + start: { line: 1, column: 22 }, + end: { line: 1, column: 23 } } }] + }, - 'var x = /[P QR]/i': { - type: 'Program', - body: [{ - type: 'VariableDeclaration', - declarations: [{ - type: 'VariableDeclarator', - id: { + 'while (i-->0) {}': { + type: 'WhileStatement', + test: { + type: 'BinaryExpression', + operator: '>', + left: { + type: 'UpdateExpression', + operator: '--', + argument: { type: 'Identifier', - name: 'x', - range: [4, 5], - loc: { - start: { line: 1, column: 4 }, - end: { line: 1, column: 5 } - } - }, - init: { - type: 'Literal', - value: '/[P QR]/i', - raw: '/[P QR]/i', - range: [8, 17], + name: 'i', + range: [7, 8], loc: { - start: { line: 1, column: 8 }, - end: { line: 1, column: 17 } + start: { line: 1, column: 7 }, + end: { line: 1, column: 8 } } }, - range: [4, 17], + prefix: false, + range: [7, 10], loc: { - start: { line: 1, column: 4 }, - end: { line: 1, column: 17 } + start: { line: 1, column: 7 }, + end: { line: 1, column: 10 } } - }], - kind: 'var', - range: [0, 17], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 17 } - } - }], - range: [0, 17], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 17 } - }, - tokens: [{ - type: 'Keyword', - value: 'var', - range: [0, 3], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 3 } - } - }, { - type: 'Identifier', - value: 'x', - range: [4, 5], - loc: { - start: { line: 1, column: 4 }, - end: { line: 1, column: 5 } - } - }, { - type: 'Punctuator', - value: '=', - range: [6, 7], + }, + right: { + type: 'Literal', + value: 0, + raw: '0', + range: [11, 12], + loc: { + start: { line: 1, column: 11 }, + end: { line: 1, column: 12 } + } + }, + range: [7, 12], loc: { - start: { line: 1, column: 6 }, - end: { line: 1, column: 7 } + start: { line: 1, column: 7 }, + end: { line: 1, column: 12 } } - }, { - type: 'RegularExpression', - value: '/[P QR]/i', - range: [8, 17], + }, + body: { + type: 'BlockStatement', + body: [], + range: [14, 16], loc: { - start: { line: 1, column: 8 }, - end: { line: 1, column: 17 } + start: { line: 1, column: 14 }, + end: { line: 1, column: 16 } } - }] + }, + range: [0, 16], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 16 } + } }, - 'var x = /[\\]/]/': { + '/*Venus*/ debugger; // Mars': { type: 'Program', body: [{ - type: 'VariableDeclaration', - declarations: [{ - type: 'VariableDeclarator', - id: { - type: 'Identifier', - name: 'x', - range: [4, 5], - loc: { - start: { line: 1, column: 4 }, - end: { line: 1, column: 5 } - } - }, - init: { - type: 'Literal', - value: new RegExp('[\\]/]').toString(), - raw: '/[\\]/]/', - range: [8, 15], - loc: { - start: { line: 1, column: 8 }, - end: { line: 1, column: 15 } - } - }, - range: [4, 15], + type: 'DebuggerStatement', + leadingComments: [{ + type: 'Block', + value: 'Venus', + range: [0, 9], loc: { - start: { line: 1, column: 4 }, - end: { line: 1, column: 15 } + start: { line: 1, column: 0 }, + end: { line: 1, column: 9 } } }], - kind: 'var', - range: [0, 15], + trailingComments: [{ + type: 'Line', + value: ' Mars', + range: [20, 27], + loc: { + start: { line: 1, column: 20 }, + end: { line: 1, column: 27 } + } + }], + range: [10, 19], loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 15 } + start: { line: 1, column: 10 }, + end: { line: 1, column: 19 } } }], - range: [0, 15], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 15 } - }, - tokens: [{ - type: 'Keyword', - value: 'var', - range: [0, 3], + comments: [{ + type: 'Block', + value: 'Venus', + range: [0, 9], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 3 } - } - }, { - type: 'Identifier', - value: 'x', - range: [4, 5], - loc: { - start: { line: 1, column: 4 }, - end: { line: 1, column: 5 } - } - }, { - type: 'Punctuator', - value: '=', - range: [6, 7], - loc: { - start: { line: 1, column: 6 }, - end: { line: 1, column: 7 } + end: { line: 1, column: 9 } } }, { - type: 'RegularExpression', - value: '/[\\]/]/', - range: [8, 15], + type: 'Line', + value: ' Mars', + range: [20, 27], loc: { - start: { line: 1, column: 8 }, - end: { line: 1, column: 15 } + start: { line: 1, column: 20 }, + end: { line: 1, column: 27 } } - }] + }], + range: [10, 19], + loc: { + start: { line: 1, column: 10 }, + end: { line: 1, column: 19 } + } }, - 'var x = /foo\\/bar/': { - type: 'Program', - body: [{ - type: 'VariableDeclaration', - declarations: [{ - type: 'VariableDeclarator', - id: { - type: 'Identifier', - name: 'x', - range: [4, 5], - loc: { - start: { line: 1, column: 4 }, - end: { line: 1, column: 5 } - } - }, - init: { - type: 'Literal', - value: '/foo\\/bar/', - raw: '/foo\\/bar/', - range: [8, 18], - loc: { - start: { line: 1, column: 8 }, - end: { line: 1, column: 18 } - } - }, - range: [4, 18], + 'function x(){ /*Jupiter*/ return; /*Saturn*/}': { + type: 'FunctionDeclaration', + id: { + type: 'Identifier', + name: 'x', + range: [9, 10], + loc: { + start: { line: 1, column: 9 }, + end: { line: 1, column: 10 } + } + }, + params: [], + defaults: [], + body: { + type: 'BlockStatement', + body: [{ + type: 'ReturnStatement', + argument: null, + range: [26, 33], loc: { - start: { line: 1, column: 4 }, - end: { line: 1, column: 18 } + start: { line: 1, column: 26 }, + end: { line: 1, column: 33 } } }], - kind: 'var', - range: [0, 18], + range: [12, 45], loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 18 } + start: { line: 1, column: 12 }, + end: { line: 1, column: 45 } } - }], - range: [0, 18], + }, + rest: null, + generator: false, + expression: false, + range: [0, 45], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 18 } - }, - tokens: [{ - type: 'Keyword', - value: 'var', - range: [0, 3], + end: { line: 1, column: 45 } + } + } + + }, + + 'Numeric Literals': { + + '0': { + type: 'ExpressionStatement', + expression: { + type: 'Literal', + value: 0, + raw: '0', + range: [0, 1], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 3 } - } - }, { - type: 'Identifier', - value: 'x', - range: [4, 5], - loc: { - start: { line: 1, column: 4 }, - end: { line: 1, column: 5 } - } - }, { - type: 'Punctuator', - value: '=', - range: [6, 7], - loc: { - start: { line: 1, column: 6 }, - end: { line: 1, column: 7 } - } - }, { - type: 'RegularExpression', - value: '/foo\\/bar/', - range: [8, 18], - loc: { - start: { line: 1, column: 8 }, - end: { line: 1, column: 18 } + end: { line: 1, column: 1 } } - }] + }, + range: [0, 1], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 1 } + } }, - 'var x = /=([^=\\s])+/g': { - type: 'Program', - body: [{ - type: 'VariableDeclaration', - declarations: [{ - type: 'VariableDeclarator', - id: { - type: 'Identifier', - name: 'x', - range: [4, 5], - loc: { - start: { line: 1, column: 4 }, - end: { line: 1, column: 5 } - } - }, - init: { - type: 'Literal', - value: '/=([^=\\s])+/g', - raw: '/=([^=\\s])+/g', - range: [8, 21], - loc: { - start: { line: 1, column: 8 }, - end: { line: 1, column: 21 } - } - }, - range: [4, 21], - loc: { - start: { line: 1, column: 4 }, - end: { line: 1, column: 21 } - } - }], - kind: 'var', - range: [0, 21], + '42': { + type: 'ExpressionStatement', + expression: { + type: 'Literal', + value: 42, + raw: '42', + range: [0, 2], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 21 } + end: { line: 1, column: 2 } } - }], - range: [0, 21], + }, + range: [0, 2], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 21 } - }, - tokens: [{ - type: 'Keyword', - value: 'var', - range: [0, 3], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 3 } - } - }, { - type: 'Identifier', - value: 'x', - range: [4, 5], - loc: { - start: { line: 1, column: 4 }, - end: { line: 1, column: 5 } - } - }, { - type: 'Punctuator', - value: '=', - range: [6, 7], - loc: { - start: { line: 1, column: 6 }, - end: { line: 1, column: 7 } - } - }, { - type: 'RegularExpression', - value: '/=([^=\\s])+/g', - range: [8, 21], - loc: { - start: { line: 1, column: 8 }, - end: { line: 1, column: 21 } - } - }] + end: { line: 1, column: 2 } + } }, - 'var x = /[P QR]/\\u0067': { + '3': { type: 'Program', body: [{ - type: 'VariableDeclaration', - declarations: [{ - type: 'VariableDeclarator', - id: { - type: 'Identifier', - name: 'x', - range: [4, 5], - loc: { - start: { line: 1, column: 4 }, - end: { line: 1, column: 5 } - } - }, - init: { - type: 'Literal', - value: '/[P QR]/g', - raw: '/[P QR]/\\u0067', - range: [8, 22], - loc: { - start: { line: 1, column: 8 }, - end: { line: 1, column: 22 } - } - }, - range: [4, 22], - loc: { - start: { line: 1, column: 4 }, - end: { line: 1, column: 22 } - } - }], - kind: 'var', - range: [0, 22], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 22 } - } + type: 'ExpressionStatement', + expression: { + type: 'Literal', + value: 3, + raw: '3', + range: [0, 1] + }, + range: [0, 1] }], - range: [0, 22], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 22 } - }, + range: [0, 1], tokens: [{ - type: 'Keyword', - value: 'var', - range: [0, 3], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 3 } - } - }, { - type: 'Identifier', - value: 'x', - range: [4, 5], - loc: { - start: { line: 1, column: 4 }, - end: { line: 1, column: 5 } - } - }, { - type: 'Punctuator', - value: '=', - range: [6, 7], - loc: { - start: { line: 1, column: 6 }, - end: { line: 1, column: 7 } - } - }, { - type: 'RegularExpression', - value: '/[P QR]/\\u0067', - range: [8, 22], - loc: { - start: { line: 1, column: 8 }, - end: { line: 1, column: 22 } - } + type: 'Numeric', + value: '3', + range: [0, 1] }] }, - 'var x = /[P QR]/\\g': { + '5': { type: 'Program', body: [{ - type: 'VariableDeclaration', - declarations: [{ - type: 'VariableDeclarator', - id: { - type: 'Identifier', - name: 'x', - range: [4, 5], - loc: { - start: { line: 1, column: 4 }, - end: { line: 1, column: 5 } - } - }, - init: { - type: 'Literal', - value: '/[P QR]/g', - raw: '/[P QR]/\\g', - range: [8, 18], - loc: { - start: { line: 1, column: 8 }, - end: { line: 1, column: 18 } - } - }, - range: [4, 18], + type: 'ExpressionStatement', + expression: { + type: 'Literal', + value: 5, + raw: '5', loc: { - start: { line: 1, column: 4 }, - end: { line: 1, column: 18 } + start: { line: 1, column: 0 }, + end: { line: 1, column: 1 } } - }], - kind: 'var', - range: [0, 18], + }, loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 18 } + end: { line: 1, column: 1 } } }], - range: [0, 18], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 18 } + end: { line: 1, column: 1 } }, tokens: [{ - type: 'Keyword', - value: 'var', - range: [0, 3], + type: 'Numeric', + value: '5', loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 3 } - } - }, { - type: 'Identifier', - value: 'x', - range: [4, 5], - loc: { - start: { line: 1, column: 4 }, - end: { line: 1, column: 5 } - } - }, { - type: 'Punctuator', - value: '=', - range: [6, 7], - loc: { - start: { line: 1, column: 6 }, - end: { line: 1, column: 7 } - } - }, { - type: 'RegularExpression', - value: '/[P QR]/\\g', - range: [8, 18], - loc: { - start: { line: 1, column: 8 }, - end: { line: 1, column: 18 } + end: { line: 1, column: 1 } } }] - } - - }, - - 'Left-Hand-Side Expression': { + }, - 'new Button': { + '.14': { type: 'ExpressionStatement', expression: { - type: 'NewExpression', - callee: { - type: 'Identifier', - name: 'Button', - range: [4, 10], - loc: { - start: { line: 1, column: 4 }, - end: { line: 1, column: 10 } - } - }, - 'arguments': [], - range: [0, 10], + type: 'Literal', + value: 0.14, + raw: '.14', + range: [0, 3], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 10 } + end: { line: 1, column: 3 } } }, - range: [0, 10], + range: [0, 3], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 10 } + end: { line: 1, column: 3 } } }, - 'new Button()': { + '3.14159': { type: 'ExpressionStatement', expression: { - type: 'NewExpression', - callee: { - type: 'Identifier', - name: 'Button', - range: [4, 10], - loc: { - start: { line: 1, column: 4 }, - end: { line: 1, column: 10 } - } - }, - 'arguments': [], - range: [0, 12], + type: 'Literal', + value: 3.14159, + raw: '3.14159', + range: [0, 7], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 12 } + end: { line: 1, column: 7 } } }, - range: [0, 12], + range: [0, 7], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 12 } + end: { line: 1, column: 7 } } }, - 'new new foo': { + '6.02214179e+23': { type: 'ExpressionStatement', expression: { - type: 'NewExpression', - callee: { - type: 'NewExpression', - callee: { - type: 'Identifier', - name: 'foo', - range: [8, 11], - loc: { - start: { line: 1, column: 8 }, - end: { line: 1, column: 11 } - } - }, - 'arguments': [], - range: [4, 11], - loc: { - start: { line: 1, column: 4 }, - end: { line: 1, column: 11 } - } - }, - 'arguments': [], - range: [0, 11], + type: 'Literal', + value: 6.02214179e+23, + raw: '6.02214179e+23', + range: [0, 14], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 11 } + end: { line: 1, column: 14 } } }, - range: [0, 11], + range: [0, 14], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 11 } + end: { line: 1, column: 14 } } }, - 'new new foo()': { + '1.492417830e-10': { type: 'ExpressionStatement', expression: { - type: 'NewExpression', - callee: { - type: 'NewExpression', - callee: { - type: 'Identifier', - name: 'foo', - range: [8, 11], - loc: { - start: { line: 1, column: 8 }, - end: { line: 1, column: 11 } - } - }, - 'arguments': [], - range: [4, 13], - loc: { - start: { line: 1, column: 4 }, - end: { line: 1, column: 13 } - } - }, - 'arguments': [], - range: [0, 13], + type: 'Literal', + value: 1.49241783e-10, + raw: '1.492417830e-10', + range: [0, 15], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 13 } + end: { line: 1, column: 15 } } }, - range: [0, 13], + range: [0, 15], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 13 } + end: { line: 1, column: 15 } } }, - 'new foo().bar()': { + '0x0': { type: 'ExpressionStatement', expression: { - type: 'CallExpression', - callee: { - type: 'MemberExpression', - computed: false, - object: { - type: 'NewExpression', - callee: { - type: 'Identifier', - name: 'foo', - range: [4, 7], - loc: { - start: { line: 1, column: 4 }, - end: { line: 1, column: 7 } - } - }, - 'arguments': [], - range: [0, 9], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 9 } - } - }, - property: { - type: 'Identifier', - name: 'bar', - range: [10, 13], - loc: { - start: { line: 1, column: 10 }, - end: { line: 1, column: 13 } - } - }, - range: [0, 13], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 13 } - } - }, - 'arguments': [], - range: [0, 15], + type: 'Literal', + value: 0, + raw: '0x0', + range: [0, 3], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 15 } + end: { line: 1, column: 3 } } }, - range: [0, 15], + range: [0, 3], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 15 } + end: { line: 1, column: 3 } } }, - 'new foo[bar]': { + '0x0;': { type: 'ExpressionStatement', expression: { - type: 'NewExpression', - callee: { - type: 'MemberExpression', - computed: true, - object: { - type: 'Identifier', - name: 'foo', - range: [4, 7], - loc: { - start: { line: 1, column: 4 }, - end: { line: 1, column: 7 } - } - }, - property: { - type: 'Identifier', - name: 'bar', - range: [8, 11], - loc: { - start: { line: 1, column: 8 }, - end: { line: 1, column: 11 } - } - }, - range: [4, 12], - loc: { - start: { line: 1, column: 4 }, - end: { line: 1, column: 12 } - } - }, - 'arguments': [], - range: [0, 12], + type: 'Literal', + value: 0, + raw: '0x0', + range: [0, 3], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 12 } + end: { line: 1, column: 3 } } }, - range: [0, 12], + range: [0, 4], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 12 } + end: { line: 1, column: 4 } } }, - 'new foo.bar()': { + '0e+100 ': { type: 'ExpressionStatement', expression: { - type: 'NewExpression', - callee: { - type: 'MemberExpression', - computed: false, - object: { - type: 'Identifier', - name: 'foo', - range: [4, 7], - loc: { - start: { line: 1, column: 4 }, - end: { line: 1, column: 7 } - } - }, - property: { - type: 'Identifier', - name: 'bar', - range: [8, 11], - loc: { - start: { line: 1, column: 8 }, - end: { line: 1, column: 11 } - } - }, - range: [4, 11], - loc: { - start: { line: 1, column: 4 }, - end: { line: 1, column: 11 } - } - }, - 'arguments': [], - range: [0, 13], + type: 'Literal', + value: 0, + raw: '0e+100', + range: [0, 6], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 13 } + end: { line: 1, column: 6 } } }, - range: [0, 13], + range: [0, 7], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 13 } + end: { line: 1, column: 7 } } }, - '( new foo).bar()': { + '0e+100': { type: 'ExpressionStatement', expression: { - type: 'CallExpression', - callee: { - type: 'MemberExpression', - computed: false, - object: { - type: 'NewExpression', - callee: { - type: 'Identifier', - name: 'foo', - range: [6, 9], - loc: { - start: { line: 1, column: 6 }, - end: { line: 1, column: 9 } - } - }, - 'arguments': [], - range: [2, 9], - loc: { - start: { line: 1, column: 2 }, - end: { line: 1, column: 9 } - } - }, - property: { - type: 'Identifier', - name: 'bar', - range: [11, 14], - loc: { - start: { line: 1, column: 11 }, - end: { line: 1, column: 14 } - } - }, - range: [0, 14], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 14 } - } - }, - 'arguments': [], - range: [0, 16], + type: 'Literal', + value: 0, + raw: '0e+100', + range: [0, 6], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 16 } + end: { line: 1, column: 6 } } }, - range: [0, 16], + range: [0, 6], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 16 } + end: { line: 1, column: 6 } } }, - 'foo(bar, baz)': { + '0xabc': { type: 'ExpressionStatement', expression: { - type: 'CallExpression', - callee: { - type: 'Identifier', - name: 'foo', - range: [0, 3], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 3 } - } - }, - 'arguments': [{ - type: 'Identifier', - name: 'bar', - range: [4, 7], - loc: { - start: { line: 1, column: 4 }, - end: { line: 1, column: 7 } - } - }, { - type: 'Identifier', - name: 'baz', - range: [9, 12], - loc: { - start: { line: 1, column: 9 }, - end: { line: 1, column: 12 } - } - }], - range: [0, 13], + type: 'Literal', + value: 0xabc, + raw: '0xabc', + range: [0, 5], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 13 } + end: { line: 1, column: 5 } } }, - range: [0, 13], + range: [0, 5], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 13 } + end: { line: 1, column: 5 } } }, - '( foo )()': { + '0xdef': { type: 'ExpressionStatement', expression: { - type: 'CallExpression', - callee: { - type: 'Identifier', - name: 'foo', - range: [5, 8], - loc: { - start: { line: 1, column: 5 }, - end: { line: 1, column: 8 } - } - }, - 'arguments': [], - range: [0, 13], + type: 'Literal', + value: 0xdef, + raw: '0xdef', + range: [0, 5], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 13 } + end: { line: 1, column: 5 } } }, - range: [0, 13], + range: [0, 5], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 13 } + end: { line: 1, column: 5 } } }, - 'universe.milkyway': { + '0X1A': { type: 'ExpressionStatement', expression: { - type: 'MemberExpression', - computed: false, - object: { - type: 'Identifier', - name: 'universe', - range: [0, 8], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 8 } - } - }, - property: { - type: 'Identifier', - name: 'milkyway', - range: [9, 17], - loc: { - start: { line: 1, column: 9 }, - end: { line: 1, column: 17 } - } - }, - range: [0, 17], + type: 'Literal', + value: 0x1A, + raw: '0X1A', + range: [0, 4], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 17 } + end: { line: 1, column: 4 } } }, - range: [0, 17], + range: [0, 4], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 17 } + end: { line: 1, column: 4 } } }, - 'universe.milkyway.solarsystem': { + '0x10': { type: 'ExpressionStatement', expression: { - type: 'MemberExpression', - computed: false, - object: { - type: 'MemberExpression', - computed: false, - object: { - type: 'Identifier', - name: 'universe', - range: [0, 8], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 8 } - } - }, - property: { - type: 'Identifier', - name: 'milkyway', - range: [9, 17], - loc: { - start: { line: 1, column: 9 }, - end: { line: 1, column: 17 } - } - }, - range: [0, 17], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 17 } - } - }, - property: { - type: 'Identifier', - name: 'solarsystem', - range: [18, 29], - loc: { - start: { line: 1, column: 18 }, - end: { line: 1, column: 29 } - } - }, - range: [0, 29], + type: 'Literal', + value: 0x10, + raw: '0x10', + range: [0, 4], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 29 } + end: { line: 1, column: 4 } } }, - range: [0, 29], + range: [0, 4], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 29 } + end: { line: 1, column: 4 } } }, - 'universe.milkyway.solarsystem.Earth': { + '0x100': { type: 'ExpressionStatement', expression: { - type: 'MemberExpression', - computed: false, - object: { - type: 'MemberExpression', - computed: false, - object: { - type: 'MemberExpression', - computed: false, - object: { - type: 'Identifier', - name: 'universe', - range: [0, 8], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 8 } - } - }, - property: { - type: 'Identifier', - name: 'milkyway', - range: [9, 17], - loc: { - start: { line: 1, column: 9 }, - end: { line: 1, column: 17 } - } - }, - range: [0, 17], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 17 } - } - }, - property: { - type: 'Identifier', - name: 'solarsystem', - range: [18, 29], - loc: { - start: { line: 1, column: 18 }, - end: { line: 1, column: 29 } - } - }, - range: [0, 29], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 29 } - } - }, - property: { - type: 'Identifier', - name: 'Earth', - range: [30, 35], - loc: { - start: { line: 1, column: 30 }, - end: { line: 1, column: 35 } - } - }, - range: [0, 35], + type: 'Literal', + value: 0x100, + raw: '0x100', + range: [0, 5], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 35 } + end: { line: 1, column: 5 } } }, - range: [0, 35], + range: [0, 5], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 35 } + end: { line: 1, column: 5 } } }, - 'universe[galaxyName, otherUselessName]': { + '0X04': { type: 'ExpressionStatement', expression: { - type: 'MemberExpression', - computed: true, - object: { - type: 'Identifier', - name: 'universe', - range: [0, 8], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 8 } - } - }, - property: { - type: 'SequenceExpression', - expressions: [{ - type: 'Identifier', - name: 'galaxyName', - range: [9, 19], - loc: { - start: { line: 1, column: 9 }, - end: { line: 1, column: 19 } - } - }, { - type: 'Identifier', - name: 'otherUselessName', - range: [21, 37], - loc: { - start: { line: 1, column: 21 }, - end: { line: 1, column: 37 } - } - }], - range: [9, 37], - loc: { - start: { line: 1, column: 9 }, - end: { line: 1, column: 37 } - } - }, - range: [0, 38], + type: 'Literal', + value: 0X04, + raw: '0X04', + range: [0, 4], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 38 } + end: { line: 1, column: 4 } } }, - range: [0, 38], + range: [0, 4], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 38 } + end: { line: 1, column: 4 } } }, - 'universe[galaxyName]': { + '02': { type: 'ExpressionStatement', expression: { - type: 'MemberExpression', - computed: true, - object: { - type: 'Identifier', - name: 'universe', - range: [0, 8], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 8 } - } - }, - property: { - type: 'Identifier', - name: 'galaxyName', - range: [9, 19], - loc: { - start: { line: 1, column: 9 }, - end: { line: 1, column: 19 } - } - }, - range: [0, 20], + type: 'Literal', + value: 2, + raw: '02', + range: [0, 2], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 20 } + end: { line: 1, column: 2 } } }, - range: [0, 20], + range: [0, 2], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 20 } + end: { line: 1, column: 2 } } }, - 'universe[42].galaxies': { + '012': { type: 'ExpressionStatement', expression: { - type: 'MemberExpression', - computed: false, - object: { - type: 'MemberExpression', - computed: true, - object: { - type: 'Identifier', - name: 'universe', - range: [0, 8], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 8 } - } - }, - property: { - type: 'Literal', - value: 42, - raw: '42', - range: [9, 11], - loc: { - start: { line: 1, column: 9 }, - end: { line: 1, column: 11 } - } - }, - range: [0, 12], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 12 } - } - }, - property: { - type: 'Identifier', - name: 'galaxies', - range: [13, 21], - loc: { - start: { line: 1, column: 13 }, - end: { line: 1, column: 21 } - } - }, - range: [0, 21], + type: 'Literal', + value: 10, + raw: '012', + range: [0, 3], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 21 } + end: { line: 1, column: 3 } } }, - range: [0, 21], + range: [0, 3], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 21 } + end: { line: 1, column: 3 } } }, - 'universe(42).galaxies': { + '0012': { type: 'ExpressionStatement', expression: { - type: 'MemberExpression', - computed: false, - object: { - type: 'CallExpression', - callee: { - type: 'Identifier', - name: 'universe', - range: [0, 8], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 8 } - } - }, - 'arguments': [{ - type: 'Literal', - value: 42, - raw: '42', - range: [9, 11], - loc: { - start: { line: 1, column: 9 }, - end: { line: 1, column: 11 } - } - }], - range: [0, 12], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 12 } - } - }, - property: { - type: 'Identifier', - name: 'galaxies', - range: [13, 21], - loc: { - start: { line: 1, column: 13 }, - end: { line: 1, column: 21 } - } - }, - range: [0, 21], + type: 'Literal', + value: 10, + raw: '0012', + range: [0, 4], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 21 } + end: { line: 1, column: 4 } } }, - range: [0, 21], + range: [0, 4], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 21 } + end: { line: 1, column: 4 } } }, - 'universe(42).galaxies(14, 3, 77).milkyway': { + '08': { type: 'ExpressionStatement', expression: { - type: 'MemberExpression', - computed: false, - object: { - type: 'CallExpression', - callee: { - type: 'MemberExpression', - computed: false, - object: { - type: 'CallExpression', - callee: { - type: 'Identifier', - name: 'universe', - range: [0, 8], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 8 } - } - }, - 'arguments': [{ - type: 'Literal', - value: 42, - raw: '42', - range: [9, 11], - loc: { - start: { line: 1, column: 9 }, - end: { line: 1, column: 11 } - } - }], - range: [0, 12], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 12 } - } - }, - property: { - type: 'Identifier', - name: 'galaxies', - range: [13, 21], - loc: { - start: { line: 1, column: 13 }, - end: { line: 1, column: 21 } - } - }, - range: [0, 21], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 21 } - } - }, - 'arguments': [{ - type: 'Literal', - value: 14, - raw: '14', - range: [22, 24], - loc: { - start: { line: 1, column: 22 }, - end: { line: 1, column: 24 } - } - }, { - type: 'Literal', - value: 3, - raw: '3', - range: [26, 27], - loc: { - start: { line: 1, column: 26 }, - end: { line: 1, column: 27 } - } - }, { - type: 'Literal', - value: 77, - raw: '77', - range: [29, 31], - loc: { - start: { line: 1, column: 29 }, - end: { line: 1, column: 31 } - } - }], - range: [0, 32], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 32 } - } - }, - property: { - type: 'Identifier', - name: 'milkyway', - range: [33, 41], - loc: { - start: { line: 1, column: 33 }, - end: { line: 1, column: 41 } - } - }, - range: [0, 41], + type: 'Literal', + value: 8, + raw: '08', + range: [0, 2], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 41 } + end: { line: 1, column: 2 } } }, - range: [0, 41], + range: [0, 2], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 41 } + end: { line: 1, column: 2 } } }, - 'earth.asia.Indonesia.prepareForElection(2014)': { + '0008': { type: 'ExpressionStatement', expression: { - type: 'CallExpression', - callee: { - type: 'MemberExpression', - computed: false, - object: { - type: 'MemberExpression', - computed: false, - object: { - type: 'MemberExpression', - computed: false, - object: { - type: 'Identifier', - name: 'earth', - range: [0, 5], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 5 } - } - }, - property: { - type: 'Identifier', - name: 'asia', - range: [6, 10], - loc: { - start: { line: 1, column: 6 }, - end: { line: 1, column: 10 } - } - }, - range: [0, 10], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 10 } - } - }, - property: { - type: 'Identifier', - name: 'Indonesia', - range: [11, 20], - loc: { - start: { line: 1, column: 11 }, - end: { line: 1, column: 20 } - } - }, - range: [0, 20], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 20 } - } - }, - property: { - type: 'Identifier', - name: 'prepareForElection', - range: [21, 39], - loc: { - start: { line: 1, column: 21 }, - end: { line: 1, column: 39 } - } - }, - range: [0, 39], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 39 } - } - }, - 'arguments': [{ - type: 'Literal', - value: 2014, - raw: '2014', - range: [40, 44], - loc: { - start: { line: 1, column: 40 }, - end: { line: 1, column: 44 } - } - }], - range: [0, 45], + type: 'Literal', + value: 8, + raw: '0008', + range: [0, 4], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 45 } + end: { line: 1, column: 4 } } }, - range: [0, 45], + range: [0, 4], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 45 } + end: { line: 1, column: 4 } } }, - 'universe.if': { + '09': { type: 'ExpressionStatement', expression: { - type: 'MemberExpression', - computed: false, - object: { - type: 'Identifier', - name: 'universe', - range: [0, 8], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 8 } - } - }, - property: { - type: 'Identifier', - name: 'if', - range: [9, 11], - loc: { - start: { line: 1, column: 9 }, - end: { line: 1, column: 11 } - } - }, - range: [0, 11], + type: 'Literal', + value: 9, + raw: '09', + range: [0, 2], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 11 } + end: { line: 1, column: 2 } } }, - range: [0, 11], + range: [0, 2], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 11 } + end: { line: 1, column: 2 } } }, - 'universe.true': { + '09.5': { type: 'ExpressionStatement', expression: { - type: 'MemberExpression', - computed: false, - object: { - type: 'Identifier', - name: 'universe', - range: [0, 8], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 8 } - } - }, - property: { - type: 'Identifier', - name: 'true', - range: [9, 13], - loc: { - start: { line: 1, column: 9 }, - end: { line: 1, column: 13 } - } - }, - range: [0, 13], + type: 'Literal', + value: 9.5, + raw: '09.5', + range: [0, 4], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 13 } + end: { line: 1, column: 4 } } }, - range: [0, 13], + range: [0, 4], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 13 } + end: { line: 1, column: 4 } } - }, + } - 'universe.false': { + }, + + '[ES6] Binary Integer Literals': { + + '0b0': { type: 'ExpressionStatement', expression: { - type: 'MemberExpression', - computed: false, - object: { - type: 'Identifier', - name: 'universe', - range: [0, 8], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 8 } - } - }, - property: { - type: 'Identifier', - name: 'false', - range: [9, 14], - loc: { - start: { line: 1, column: 9 }, - end: { line: 1, column: 14 } - } - }, - range: [0, 14], + type: 'Literal', + value: 0, + raw: '0b0', + range: [0, 3], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 14 } + end: { line: 1, column: 3 } } }, - range: [0, 14], + range: [0, 3], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 14 } + end: { line: 1, column: 3 } } }, - 'universe.null': { + '0b1': { type: 'ExpressionStatement', expression: { - type: 'MemberExpression', - computed: false, - object: { - type: 'Identifier', - name: 'universe', - range: [0, 8], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 8 } - } - }, - property: { - type: 'Identifier', - name: 'null', - range: [9, 13], - loc: { - start: { line: 1, column: 9 }, - end: { line: 1, column: 13 } - } - }, - range: [0, 13], + type: 'Literal', + value: 1, + raw: '0b1', + range: [0, 3], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 13 } + end: { line: 1, column: 3 } } }, - range: [0, 13], + range: [0, 3], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 13 } + end: { line: 1, column: 3 } } - } - - }, + }, - 'Postfix Expressions': { + '0b10': { + type: 'ExpressionStatement', + expression: { + type: 'Literal', + value: 2, + raw: '0b10', + range: [0, 4], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 4 } + } + }, + range: [0, 4], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 4 } + } + }, - 'x++': { + '0B0': { type: 'ExpressionStatement', expression: { - type: 'UpdateExpression', - operator: '++', - argument: { - type: 'Identifier', - name: 'x', - range: [0, 1], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 1 } - } - }, - prefix: false, + type: 'Literal', + value: 0, + raw: '0B0', range: [0, 3], loc: { start: { line: 1, column: 0 }, @@ -6245,21 +6632,12 @@ var testFixture = { } }, - 'x--': { + '0B1': { type: 'ExpressionStatement', expression: { - type: 'UpdateExpression', - operator: '--', - argument: { - type: 'Identifier', - name: 'x', - range: [0, 1], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 1 } - } - }, - prefix: false, + type: 'Literal', + value: 1, + raw: '0B1', range: [0, 3], loc: { start: { line: 1, column: 0 }, @@ -6273,165 +6651,139 @@ var testFixture = { } }, - 'eval++': { + '0B10': { type: 'ExpressionStatement', expression: { - type: 'UpdateExpression', - operator: '++', - argument: { - type: 'Identifier', - name: 'eval', - range: [0, 4], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 4 } - } - }, - prefix: false, - range: [0, 6], + type: 'Literal', + value: 2, + raw: '0B10', + range: [0, 4], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 6 } + end: { line: 1, column: 4 } } }, - range: [0, 6], + range: [0, 4], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 6 } + end: { line: 1, column: 4 } } - }, + } - 'eval--': { + }, + + '[ES6] Octal Integer Literals': { + + '00': { type: 'ExpressionStatement', expression: { - type: 'UpdateExpression', - operator: '--', - argument: { - type: 'Identifier', - name: 'eval', - range: [0, 4], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 4 } - } - }, - prefix: false, - range: [0, 6], + type: 'Literal', + value: 0, + raw: '00', + range: [0, 2], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 6 } + end: { line: 1, column: 2 } } }, - range: [0, 6], + range: [0, 2], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 6 } + end: { line: 1, column: 2 } } }, - 'arguments++': { + '0o0': { type: 'ExpressionStatement', expression: { - type: 'UpdateExpression', - operator: '++', - argument: { - type: 'Identifier', - name: 'arguments', - range: [0, 9], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 9 } - } - }, - prefix: false, - range: [0, 11], + type: 'Literal', + value: 0, + raw: '0o0', + range: [0, 3], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 11 } + end: { line: 1, column: 3 } } }, - range: [0, 11], + range: [0, 3], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 11 } + end: { line: 1, column: 3 } } }, - 'arguments--': { - type: 'ExpressionStatement', - expression: { - type: 'UpdateExpression', - operator: '--', - argument: { - type: 'Identifier', - name: 'arguments', - range: [0, 9], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 9 } - } - }, - prefix: false, - range: [0, 11], + 'function test() {\'use strict\'; 0o0; }': { + type: 'FunctionDeclaration', + id: { + type: 'Identifier', + name: 'test', + range: [9, 13], loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 11 } + start: { line: 1, column: 9 }, + end: { line: 1, column: 13 } } }, - range: [0, 11], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 11 } - } - } - - }, - - 'Unary Operators': { - - '++x': { - type: 'ExpressionStatement', - expression: { - type: 'UpdateExpression', - operator: '++', - argument: { - type: 'Identifier', - name: 'x', - range: [2, 3], + params: [], + defaults: [], + body: { + type: 'BlockStatement', + body: [{ + type: 'ExpressionStatement', + expression: { + type: 'Literal', + value: 'use strict', + raw: '\'use strict\'', + range: [17, 29], + loc: { + start: { line: 1, column: 17 }, + end: { line: 1, column: 29 } + } + }, + range: [17, 30], loc: { - start: { line: 1, column: 2 }, - end: { line: 1, column: 3 } + start: { line: 1, column: 17 }, + end: { line: 1, column: 30 } } - }, - prefix: true, - range: [0, 3], + }, { + type: 'ExpressionStatement', + expression: { + type: 'Literal', + value: 0, + raw: '0o0', + range: [31, 34], + loc: { + start: { line: 1, column: 31 }, + end: { line: 1, column: 34 } + } + }, + range: [31, 35], + loc: { + start: { line: 1, column: 31 }, + end: { line: 1, column: 35 } + } + }], + range: [16, 37], loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 3 } + start: { line: 1, column: 16 }, + end: { line: 1, column: 37 } } }, - range: [0, 3], + rest: null, + generator: false, + expression: false, + range: [0, 37], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 3 } + end: { line: 1, column: 37 } } }, - '--x': { + '0o2': { type: 'ExpressionStatement', expression: { - type: 'UpdateExpression', - operator: '--', - argument: { - type: 'Identifier', - name: 'x', - range: [2, 3], - loc: { - start: { line: 1, column: 2 }, - end: { line: 1, column: 3 } - } - }, - prefix: true, + type: 'Literal', + value: 2, + raw: '0o2', range: [0, 3], loc: { start: { line: 1, column: 0 }, @@ -6445,245 +6797,196 @@ var testFixture = { } }, - '++eval': { + '0o12': { type: 'ExpressionStatement', expression: { - type: 'UpdateExpression', - operator: '++', - argument: { - type: 'Identifier', - name: 'eval', - range: [2, 6], - loc: { - start: { line: 1, column: 2 }, - end: { line: 1, column: 6 } - } - }, - prefix: true, - range: [0, 6], + type: 'Literal', + value: 10, + raw: '0o12', + range: [0, 4], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 6 } + end: { line: 1, column: 4 } } }, - range: [0, 6], + range: [0, 4], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 6 } + end: { line: 1, column: 4 } } }, - '--eval': { + '0O0': { type: 'ExpressionStatement', expression: { - type: 'UpdateExpression', - operator: '--', - argument: { - type: 'Identifier', - name: 'eval', - range: [2, 6], - loc: { - start: { line: 1, column: 2 }, - end: { line: 1, column: 6 } - } - }, - prefix: true, - range: [0, 6], + type: 'Literal', + value: 0, + raw: '0O0', + range: [0, 3], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 6 } + end: { line: 1, column: 3 } } }, - range: [0, 6], + range: [0, 3], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 6 } + end: { line: 1, column: 3 } } }, - '++arguments': { - type: 'ExpressionStatement', - expression: { - type: 'UpdateExpression', - operator: '++', - argument: { - type: 'Identifier', - name: 'arguments', - range: [2, 11], - loc: { - start: { line: 1, column: 2 }, - end: { line: 1, column: 11 } - } - }, - prefix: true, - range: [0, 11], + 'function test() {\'use strict\'; 0O0; }': { + type: 'FunctionDeclaration', + id: { + type: 'Identifier', + name: 'test', + range: [9, 13], loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 11 } + start: { line: 1, column: 9 }, + end: { line: 1, column: 13 } } }, - range: [0, 11], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 11 } - } - }, - - '--arguments': { - type: 'ExpressionStatement', - expression: { - type: 'UpdateExpression', - operator: '--', - argument: { - type: 'Identifier', - name: 'arguments', - range: [2, 11], + params: [], + defaults: [], + body: { + type: 'BlockStatement', + body: [{ + type: 'ExpressionStatement', + expression: { + type: 'Literal', + value: 'use strict', + raw: '\'use strict\'', + range: [17, 29], + loc: { + start: { line: 1, column: 17 }, + end: { line: 1, column: 29 } + } + }, + range: [17, 30], loc: { - start: { line: 1, column: 2 }, - end: { line: 1, column: 11 } + start: { line: 1, column: 17 }, + end: { line: 1, column: 30 } } - }, - prefix: true, - range: [0, 11], + }, { + type: 'ExpressionStatement', + expression: { + type: 'Literal', + value: 0, + raw: '0O0', + range: [31, 34], + loc: { + start: { line: 1, column: 31 }, + end: { line: 1, column: 34 } + } + }, + range: [31, 35], + loc: { + start: { line: 1, column: 31 }, + end: { line: 1, column: 35 } + } + }], + range: [16, 37], loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 11 } + start: { line: 1, column: 16 }, + end: { line: 1, column: 37 } } }, - range: [0, 11], + rest: null, + generator: false, + expression: false, + range: [0, 37], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 11 } + end: { line: 1, column: 37 } } - }, + } - '+x': { + }, + + 'String Literals': { + + '"Hello"': { type: 'ExpressionStatement', expression: { - type: 'UnaryExpression', - operator: '+', - argument: { - type: 'Identifier', - name: 'x', - range: [1, 2], - loc: { - start: { line: 1, column: 1 }, - end: { line: 1, column: 2 } - } - }, - prefix: true, - range: [0, 2], + type: 'Literal', + value: 'Hello', + raw: '"Hello"', + range: [0, 7], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 2 } + end: { line: 1, column: 7 } } }, - range: [0, 2], + range: [0, 7], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 2 } + end: { line: 1, column: 7 } } }, - '-x': { + '"\\n\\r\\t\\v\\b\\f\\\\\\\'\\"\\0"': { type: 'ExpressionStatement', expression: { - type: 'UnaryExpression', - operator: '-', - argument: { - type: 'Identifier', - name: 'x', - range: [1, 2], - loc: { - start: { line: 1, column: 1 }, - end: { line: 1, column: 2 } - } - }, - prefix: true, - range: [0, 2], + type: 'Literal', + value: '\n\r\t\x0B\b\f\\\'"\x00', + raw: '"\\n\\r\\t\\v\\b\\f\\\\\\\'\\"\\0"', + range: [0, 22], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 2 } + end: { line: 1, column: 22 } } }, - range: [0, 2], + range: [0, 22], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 2 } + end: { line: 1, column: 22 } } }, - '~x': { + '"\\u0061"': { type: 'ExpressionStatement', expression: { - type: 'UnaryExpression', - operator: '~', - argument: { - type: 'Identifier', - name: 'x', - range: [1, 2], - loc: { - start: { line: 1, column: 1 }, - end: { line: 1, column: 2 } - } - }, - prefix: true, - range: [0, 2], + type: 'Literal', + value: 'a', + raw: '"\\u0061"', + range: [0, 8], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 2 } + end: { line: 1, column: 8 } } }, - range: [0, 2], + range: [0, 8], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 2 } + end: { line: 1, column: 8 } } }, - '!x': { + '"\\x61"': { type: 'ExpressionStatement', expression: { - type: 'UnaryExpression', - operator: '!', - argument: { - type: 'Identifier', - name: 'x', - range: [1, 2], - loc: { - start: { line: 1, column: 1 }, - end: { line: 1, column: 2 } - } - }, - prefix: true, - range: [0, 2], + type: 'Literal', + value: 'a', + raw: '"\\x61"', + range: [0, 6], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 2 } + end: { line: 1, column: 6 } } }, - range: [0, 2], + range: [0, 6], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 2 } + end: { line: 1, column: 6 } } }, - 'void x': { + '"\\u00"': { type: 'ExpressionStatement', expression: { - type: 'UnaryExpression', - operator: 'void', - argument: { - type: 'Identifier', - name: 'x', - range: [5, 6], - loc: { - start: { line: 1, column: 5 }, - end: { line: 1, column: 6 } - } - }, - prefix: true, + type: 'Literal', + value: 'u00', + raw: '"\\u00"', range: [0, 6], loc: { start: { line: 1, column: 0 }, @@ -6697,2584 +7000,2446 @@ var testFixture = { } }, - 'delete x': { + '"\\xt"': { type: 'ExpressionStatement', expression: { - type: 'UnaryExpression', - operator: 'delete', - argument: { - type: 'Identifier', - name: 'x', - range: [7, 8], - loc: { - start: { line: 1, column: 7 }, - end: { line: 1, column: 8 } - } - }, - prefix: true, - range: [0, 8], + type: 'Literal', + value: 'xt', + raw: '"\\xt"', + range: [0, 5], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 8 } + end: { line: 1, column: 5 } } }, - range: [0, 8], + range: [0, 5], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 8 } + end: { line: 1, column: 5 } } }, - 'typeof x': { + '"Hello\\nworld"': { type: 'ExpressionStatement', expression: { - type: 'UnaryExpression', - operator: 'typeof', - argument: { - type: 'Identifier', - name: 'x', - range: [7, 8], - loc: { - start: { line: 1, column: 7 }, - end: { line: 1, column: 8 } - } - }, - prefix: true, - range: [0, 8], + type: 'Literal', + value: 'Hello\nworld', + raw: '"Hello\\nworld"', + range: [0, 14], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 8 } + end: { line: 1, column: 14 } } }, - range: [0, 8], + range: [0, 14], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 8 } + end: { line: 1, column: 14 } } - } - - }, - - 'Multiplicative Operators': { + }, - 'x * y': { + '"Hello\\\nworld"': { type: 'ExpressionStatement', expression: { - type: 'BinaryExpression', - operator: '*', - left: { - type: 'Identifier', - name: 'x', - range: [0, 1], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 1 } - } - }, - right: { - type: 'Identifier', - name: 'y', - range: [4, 5], - loc: { - start: { line: 1, column: 4 }, - end: { line: 1, column: 5 } - } - }, - range: [0, 5], + type: 'Literal', + value: 'Helloworld', + raw: '"Hello\\\nworld"', + range: [0, 14], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 5 } + end: { line: 2, column: 6 } } }, - range: [0, 5], + range: [0, 14], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 5 } + end: { line: 2, column: 6 } } }, - 'x / y': { + '"Hello\\02World"': { type: 'ExpressionStatement', expression: { - type: 'BinaryExpression', - operator: '/', - left: { - type: 'Identifier', - name: 'x', - range: [0, 1], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 1 } - } - }, - right: { - type: 'Identifier', - name: 'y', - range: [4, 5], - loc: { - start: { line: 1, column: 4 }, - end: { line: 1, column: 5 } - } - }, - range: [0, 5], + type: 'Literal', + value: 'Hello\u0002World', + raw: '"Hello\\02World"', + range: [0, 15], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 5 } + end: { line: 1, column: 15 } } }, - range: [0, 5], + range: [0, 15], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 5 } + end: { line: 1, column: 15 } } }, - 'x % y': { + '"Hello\\012World"': { type: 'ExpressionStatement', expression: { - type: 'BinaryExpression', - operator: '%', - left: { - type: 'Identifier', - name: 'x', - range: [0, 1], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 1 } - } - }, - right: { - type: 'Identifier', - name: 'y', - range: [4, 5], - loc: { - start: { line: 1, column: 4 }, - end: { line: 1, column: 5 } - } - }, - range: [0, 5], + type: 'Literal', + value: 'Hello\u000AWorld', + raw: '"Hello\\012World"', + range: [0, 16], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 5 } + end: { line: 1, column: 16 } } }, - range: [0, 5], + range: [0, 16], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 5 } + end: { line: 1, column: 16 } } - } - - }, - - 'Additive Operators': { + }, - 'x + y': { + '"Hello\\122World"': { type: 'ExpressionStatement', expression: { - type: 'BinaryExpression', - operator: '+', - left: { - type: 'Identifier', - name: 'x', - range: [0, 1], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 1 } - } - }, - right: { - type: 'Identifier', - name: 'y', - range: [4, 5], - loc: { - start: { line: 1, column: 4 }, - end: { line: 1, column: 5 } - } - }, - range: [0, 5], + type: 'Literal', + value: 'Hello\122World', + raw: '"Hello\\122World"', + range: [0, 16], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 5 } + end: { line: 1, column: 16 } } }, - range: [0, 5], + range: [0, 16], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 5 } + end: { line: 1, column: 16 } } }, - 'x - y': { + '"Hello\\0122World"': { type: 'ExpressionStatement', expression: { - type: 'BinaryExpression', - operator: '-', - left: { - type: 'Identifier', - name: 'x', - range: [0, 1], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 1 } - } - }, - right: { - type: 'Identifier', - name: 'y', - range: [4, 5], - loc: { - start: { line: 1, column: 4 }, - end: { line: 1, column: 5 } - } - }, - range: [0, 5], + type: 'Literal', + value: 'Hello\u000A2World', + raw: '"Hello\\0122World"', + range: [0, 17], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 5 } + end: { line: 1, column: 17 } } }, - range: [0, 5], + range: [0, 17], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 5 } + end: { line: 1, column: 17 } } - } - - }, + }, - 'Bitwise Shift Operator': { + '"Hello\\312World"': { + type: 'ExpressionStatement', + expression: { + type: 'Literal', + value: 'Hello\u00CAWorld', + raw: '"Hello\\312World"', + range: [0, 16], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 16 } + } + }, + range: [0, 16], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 16 } + } + }, - 'x << y': { + '"Hello\\412World"': { type: 'ExpressionStatement', expression: { - type: 'BinaryExpression', - operator: '<<', - left: { - type: 'Identifier', - name: 'x', - range: [0, 1], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 1 } - } - }, - right: { - type: 'Identifier', - name: 'y', - range: [5, 6], - loc: { - start: { line: 1, column: 5 }, - end: { line: 1, column: 6 } - } - }, - range: [0, 6], + type: 'Literal', + value: 'Hello\412World', + raw: '"Hello\\412World"', + range: [0, 16], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 6 } + end: { line: 1, column: 16 } } }, - range: [0, 6], + range: [0, 16], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 6 } + end: { line: 1, column: 16 } } }, - 'x >> y': { + '"Hello\\812World"': { type: 'ExpressionStatement', expression: { - type: 'BinaryExpression', - operator: '>>', - left: { - type: 'Identifier', - name: 'x', - range: [0, 1], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 1 } - } - }, - right: { - type: 'Identifier', - name: 'y', - range: [5, 6], - loc: { - start: { line: 1, column: 5 }, - end: { line: 1, column: 6 } - } - }, - range: [0, 6], + type: 'Literal', + value: 'Hello812World', + raw: '"Hello\\812World"', + range: [0, 16], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 6 } + end: { line: 1, column: 16 } } }, - range: [0, 6], + range: [0, 16], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 6 } + end: { line: 1, column: 16 } } }, - 'x >>> y': { + '"Hello\\712World"': { type: 'ExpressionStatement', expression: { - type: 'BinaryExpression', - operator: '>>>', - left: { - type: 'Identifier', - name: 'x', - range: [0, 1], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 1 } - } - }, - right: { - type: 'Identifier', - name: 'y', - range: [6, 7], - loc: { - start: { line: 1, column: 6 }, - end: { line: 1, column: 7 } - } - }, - range: [0, 7], + type: 'Literal', + value: 'Hello\712World', + raw: '"Hello\\712World"', + range: [0, 16], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 7 } + end: { line: 1, column: 16 } } }, - range: [0, 7], + range: [0, 16], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 7 } + end: { line: 1, column: 16 } } - } - - }, - - 'Relational Operators': { + }, - 'x < y': { + '"Hello\\0World"': { type: 'ExpressionStatement', expression: { - type: 'BinaryExpression', - operator: '<', - left: { - type: 'Identifier', - name: 'x', - range: [0, 1], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 1 } - } - }, - right: { - type: 'Identifier', - name: 'y', - range: [4, 5], - loc: { - start: { line: 1, column: 4 }, - end: { line: 1, column: 5 } - } - }, - range: [0, 5], + type: 'Literal', + value: 'Hello\u0000World', + raw: '"Hello\\0World"', + range: [0, 14], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 5 } + end: { line: 1, column: 14 } } }, - range: [0, 5], + range: [0, 14], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 5 } + end: { line: 1, column: 14 } } }, - 'x > y': { + '"Hello\\\r\nworld"': { type: 'ExpressionStatement', expression: { - type: 'BinaryExpression', - operator: '>', - left: { - type: 'Identifier', - name: 'x', - range: [0, 1], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 1 } - } - }, - right: { - type: 'Identifier', - name: 'y', - range: [4, 5], - loc: { - start: { line: 1, column: 4 }, - end: { line: 1, column: 5 } - } - }, - range: [0, 5], + type: 'Literal', + value: 'Helloworld', + raw: '"Hello\\\r\nworld"', + range: [0, 15], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 5 } + end: { line: 2, column: 6 } } }, - range: [0, 5], + range: [0, 15], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 5 } + end: { line: 2, column: 6 } } }, - 'x <= y': { + '"Hello\\1World"': { type: 'ExpressionStatement', expression: { - type: 'BinaryExpression', - operator: '<=', - left: { - type: 'Identifier', - name: 'x', - range: [0, 1], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 1 } - } - }, - right: { - type: 'Identifier', - name: 'y', - range: [5, 6], - loc: { - start: { line: 1, column: 5 }, - end: { line: 1, column: 6 } - } - }, - range: [0, 6], + type: 'Literal', + value: 'Hello\u0001World', + raw: '"Hello\\1World"', + range: [0, 14], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 6 } + end: { line: 1, column: 14 } } }, - range: [0, 6], + range: [0, 14], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 6 } + end: { line: 1, column: 14 } } - }, + } + }, - 'x >= y': { + '[ES6] Unicode Code Point Escape Sequence': { + + '"\\u{714E}\\u{8336}"': { type: 'ExpressionStatement', expression: { - type: 'BinaryExpression', - operator: '>=', - left: { - type: 'Identifier', - name: 'x', - range: [0, 1], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 1 } - } - }, - right: { - type: 'Identifier', - name: 'y', - range: [5, 6], - loc: { - start: { line: 1, column: 5 }, - end: { line: 1, column: 6 } - } - }, - range: [0, 6], + type: 'Literal', + value: '\u714E\u8336', + raw: '"\\u{714E}\\u{8336}"', + range: [0, 18], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 6 } + end: { line: 1, column: 18 } } }, - range: [0, 6], + range: [0, 18], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 6 } + end: { line: 1, column: 18 } } }, - 'x in y': { + '"\\u{20BB7}\\u{91CE}\\u{5BB6}"': { type: 'ExpressionStatement', expression: { - type: 'BinaryExpression', - operator: 'in', - left: { - type: 'Identifier', - name: 'x', - range: [0, 1], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 1 } - } - }, - right: { - type: 'Identifier', - name: 'y', - range: [5, 6], - loc: { - start: { line: 1, column: 5 }, - end: { line: 1, column: 6 } - } - }, - range: [0, 6], + type: 'Literal', + value: '\ud842\udfb7\u91ce\u5bb6', + raw: '"\\u{20BB7}\\u{91CE}\\u{5BB6}"', + range: [0, 27], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 6 } + end: { line: 1, column: 27 } } }, - range: [0, 6], + range: [0, 27], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 6 } + end: { line: 1, column: 27 } } }, - 'x instanceof y': { + '"\\u{00000000034}"': { type: 'ExpressionStatement', expression: { - type: 'BinaryExpression', - operator: 'instanceof', - left: { - type: 'Identifier', - name: 'x', - range: [0, 1], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 1 } - } + range: [0, 17], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 17 } }, - right: { - type: 'Identifier', - name: 'y', - range: [13, 14], + type: 'Literal', + value: '4', + raw: '"\\u{00000000034}"' + }, + range: [0, 17], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 17 } + } + } + + }, + + 'Regular Expression Literals': { + + '/p/;': { + type: 'Program', + body: [{ + type: 'ExpressionStatement', + expression: { + type: 'Literal', + value: '/p/', + raw: '/p/', + regex: { + pattern: 'p', + flags: '' + }, + range: [0, 3], loc: { - start: { line: 1, column: 13 }, - end: { line: 1, column: 14 } + start: { line: 1, column: 0 }, + end: { line: 1, column: 3 } } }, - range: [0, 14], + range: [0, 4], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 14 } + end: { line: 1, column: 4 } } - }, - range: [0, 14], + }], + range: [0, 4], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 14 } - } - }, - - 'x < y < z': { - type: 'ExpressionStatement', - expression: { - type: 'BinaryExpression', - operator: '<', - left: { - type: 'BinaryExpression', - operator: '<', - left: { - type: 'Identifier', - name: 'x', - range: [0, 1], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 1 } - } - }, - right: { - type: 'Identifier', - name: 'y', - range: [4, 5], + end: { line: 1, column: 4 } + }, + tokens: [{ + type: 'RegularExpression', + value: '/p/', + regex: { + pattern: 'p', + flags: '' + }, + range: [0, 3], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 3 } + } + }, { + type: 'Punctuator', + value: ';', + range: [3, 4], + loc: { + start: { line: 1, column: 3 }, + end: { line: 1, column: 4 } + } + }] + }, + + '[/q/]': { + type: 'Program', + body: [{ + type: 'ExpressionStatement', + expression: { + type: 'ArrayExpression', + elements: [{ + type: 'Literal', + value: '/q/', + raw: '/q/', + regex: { + pattern: 'q', + flags: '' + }, + range: [1, 4], loc: { - start: { line: 1, column: 4 }, - end: { line: 1, column: 5 } + start: { line: 1, column: 1 }, + end: { line: 1, column: 4 } } - }, + }], range: [0, 5], loc: { start: { line: 1, column: 0 }, end: { line: 1, column: 5 } } }, - right: { - type: 'Identifier', - name: 'z', - range: [8, 9], - loc: { - start: { line: 1, column: 8 }, - end: { line: 1, column: 9 } - } - }, - range: [0, 9], + range: [0, 5], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 9 } + end: { line: 1, column: 5 } } - }, - range: [0, 9], + }], + range: [0, 5], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 9 } - } - } - - }, - - 'Equality Operators': { - - 'x == y': { - type: 'ExpressionStatement', - expression: { - type: 'BinaryExpression', - operator: '==', - left: { - type: 'Identifier', - name: 'x', - range: [0, 1], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 1 } - } - }, - right: { - type: 'Identifier', - name: 'y', - range: [5, 6], - loc: { - start: { line: 1, column: 5 }, - end: { line: 1, column: 6 } - } - }, - range: [0, 6], + end: { line: 1, column: 5 } + }, + tokens: [{ + type: 'Punctuator', + value: '[', + range: [0, 1], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 6 } + end: { line: 1, column: 1 } } - }, - range: [0, 6], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 6 } - } - }, - - 'x != y': { - type: 'ExpressionStatement', - expression: { - type: 'BinaryExpression', - operator: '!=', - left: { - type: 'Identifier', - name: 'x', - range: [0, 1], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 1 } - } - }, - right: { - type: 'Identifier', - name: 'y', - range: [5, 6], - loc: { - start: { line: 1, column: 5 }, - end: { line: 1, column: 6 } - } + }, { + type: 'RegularExpression', + value: '/q/', + regex: { + pattern: 'q', + flags: '' }, - range: [0, 6], + range: [1, 4], loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 6 } + start: { line: 1, column: 1 }, + end: { line: 1, column: 4 } } - }, - range: [0, 6], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 6 } - } + }, { + type: 'Punctuator', + value: ']', + range: [4, 5], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 5 } + } + }] }, - 'x === y': { - type: 'ExpressionStatement', - expression: { - type: 'BinaryExpression', - operator: '===', - left: { - type: 'Identifier', - name: 'x', - range: [0, 1], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 1 } - } - }, - right: { - type: 'Identifier', - name: 'y', - range: [6, 7], + 'var x = /[a-z]/i': { + type: 'Program', + body: [{ + type: 'VariableDeclaration', + declarations: [{ + type: 'VariableDeclarator', + id: { + type: 'Identifier', + name: 'x', + range: [4, 5], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 5 } + } + }, + init: { + type: 'Literal', + value: '/[a-z]/i', + raw: '/[a-z]/i', + regex: { + pattern: '[a-z]', + flags: 'i' + }, + range: [8, 16], + loc: { + start: { line: 1, column: 8 }, + end: { line: 1, column: 16 } + } + }, + range: [4, 16], loc: { - start: { line: 1, column: 6 }, - end: { line: 1, column: 7 } + start: { line: 1, column: 4 }, + end: { line: 1, column: 16 } } - }, - range: [0, 7], + }], + kind: 'var', + range: [0, 16], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 7 } + end: { line: 1, column: 16 } } - }, - range: [0, 7], + }], + range: [0, 16], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 7 } - } - }, - - 'x !== y': { - type: 'ExpressionStatement', - expression: { - type: 'BinaryExpression', - operator: '!==', - left: { - type: 'Identifier', - name: 'x', - range: [0, 1], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 1 } - } - }, - right: { - type: 'Identifier', - name: 'y', - range: [6, 7], - loc: { - start: { line: 1, column: 6 }, - end: { line: 1, column: 7 } - } - }, - range: [0, 7], + end: { line: 1, column: 16 } + }, + tokens: [{ + type: 'Keyword', + value: 'var', + range: [0, 3], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 7 } + end: { line: 1, column: 3 } } - }, - range: [0, 7], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 7 } - } - } - - }, - - 'Binary Bitwise Operators': { - - 'x & y': { - type: 'ExpressionStatement', - expression: { - type: 'BinaryExpression', - operator: '&', - left: { - type: 'Identifier', - name: 'x', - range: [0, 1], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 1 } - } - }, - right: { - type: 'Identifier', - name: 'y', - range: [4, 5], - loc: { - start: { line: 1, column: 4 }, - end: { line: 1, column: 5 } - } - }, - range: [0, 5], + }, { + type: 'Identifier', + value: 'x', + range: [4, 5], loc: { - start: { line: 1, column: 0 }, + start: { line: 1, column: 4 }, end: { line: 1, column: 5 } } - }, - range: [0, 5], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 5 } - } - }, - - 'x ^ y': { - type: 'ExpressionStatement', - expression: { - type: 'BinaryExpression', - operator: '^', - left: { - type: 'Identifier', - name: 'x', - range: [0, 1], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 1 } - } - }, - right: { - type: 'Identifier', - name: 'y', - range: [4, 5], - loc: { - start: { line: 1, column: 4 }, - end: { line: 1, column: 5 } - } - }, - range: [0, 5], + }, { + type: 'Punctuator', + value: '=', + range: [6, 7], loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 5 } + start: { line: 1, column: 6 }, + end: { line: 1, column: 7 } } - }, - range: [0, 5], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 5 } - } - }, - - 'x | y': { - type: 'ExpressionStatement', - expression: { - type: 'BinaryExpression', - operator: '|', - left: { - type: 'Identifier', - name: 'x', - range: [0, 1], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 1 } - } - }, - right: { - type: 'Identifier', - name: 'y', - range: [4, 5], - loc: { - start: { line: 1, column: 4 }, - end: { line: 1, column: 5 } - } + }, { + type: 'RegularExpression', + value: '/[a-z]/i', + regex: { + pattern: '[a-z]', + flags: 'i' }, - range: [0, 5], + range: [8, 16], loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 5 } + start: { line: 1, column: 8 }, + end: { line: 1, column: 16 } } - }, - range: [0, 5], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 5 } - } - } - - }, - - 'Binary Expressions': { + }] + }, - 'x + y + z': { - type: 'ExpressionStatement', - expression: { - type: 'BinaryExpression', - operator: '+', - left: { - type: 'BinaryExpression', - operator: '+', - left: { + 'var x = /[a-z]/y': { + type: 'Program', + body: [{ + type: 'VariableDeclaration', + declarations: [{ + type: 'VariableDeclarator', + id: { type: 'Identifier', name: 'x', - range: [0, 1], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 1 } - } - }, - right: { - type: 'Identifier', - name: 'y', range: [4, 5], loc: { start: { line: 1, column: 4 }, end: { line: 1, column: 5 } } }, - range: [0, 5], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 5 } - } - }, - right: { - type: 'Identifier', - name: 'z', - range: [8, 9], + init: { + type: 'Literal', + value: null, + raw: '/[a-z]/y', + regex: { + pattern: '[a-z]', + flags: 'y' + }, + range: [8, 16], + loc: { + start: { line: 1, column: 8 }, + end: { line: 1, column: 16 } + } + }, + range: [4, 16], loc: { - start: { line: 1, column: 8 }, - end: { line: 1, column: 9 } + start: { line: 1, column: 4 }, + end: { line: 1, column: 16 } } - }, - range: [0, 9], + }], + kind: 'var', + range: [0, 16], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 9 } + end: { line: 1, column: 16 } } - }, - range: [0, 9], + }], + range: [0, 16], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 9 } - } + end: { line: 1, column: 16 } + }, + tokens: [{ + type: 'Keyword', + value: 'var', + range: [0, 3], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 3 } + } + }, { + type: 'Identifier', + value: 'x', + range: [4, 5], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 5 } + } + }, { + type: 'Punctuator', + value: '=', + range: [6, 7], + loc: { + start: { line: 1, column: 6 }, + end: { line: 1, column: 7 } + } + }, { + type: 'RegularExpression', + value: '/[a-z]/y', + regex: { + pattern: '[a-z]', + flags: 'y' + }, + range: [8, 16], + loc: { + start: { line: 1, column: 8 }, + end: { line: 1, column: 16 } + } + }] }, - 'x - y + z': { - type: 'ExpressionStatement', - expression: { - type: 'BinaryExpression', - operator: '+', - left: { - type: 'BinaryExpression', - operator: '-', - left: { + 'var x = /[a-z]/u': { + type: 'Program', + body: [{ + type: 'VariableDeclaration', + declarations: [{ + type: 'VariableDeclarator', + id: { type: 'Identifier', name: 'x', - range: [0, 1], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 1 } - } - }, - right: { - type: 'Identifier', - name: 'y', range: [4, 5], loc: { start: { line: 1, column: 4 }, end: { line: 1, column: 5 } } }, - range: [0, 5], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 5 } - } - }, - right: { - type: 'Identifier', - name: 'z', - range: [8, 9], + init: { + type: 'Literal', + value: null, + raw: '/[a-z]/u', + regex: { + pattern: '[a-z]', + flags: 'u' + }, + range: [8, 16], + loc: { + start: { line: 1, column: 8 }, + end: { line: 1, column: 16 } + } + }, + range: [4, 16], loc: { - start: { line: 1, column: 8 }, - end: { line: 1, column: 9 } + start: { line: 1, column: 4 }, + end: { line: 1, column: 16 } } - }, - range: [0, 9], + }], + kind: 'var', + range: [0, 16], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 9 } + end: { line: 1, column: 16 } } - }, - range: [0, 9], + }], + range: [0, 16], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 9 } - } + end: { line: 1, column: 16 } + }, + tokens: [{ + type: 'Keyword', + value: 'var', + range: [0, 3], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 3 } + } + }, { + type: 'Identifier', + value: 'x', + range: [4, 5], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 5 } + } + }, { + type: 'Punctuator', + value: '=', + range: [6, 7], + loc: { + start: { line: 1, column: 6 }, + end: { line: 1, column: 7 } + } + }, { + type: 'RegularExpression', + value: '/[a-z]/u', + regex: { + pattern: '[a-z]', + flags: 'u' + }, + range: [8, 16], + loc: { + start: { line: 1, column: 8 }, + end: { line: 1, column: 16 } + } + }] }, - 'x + y - z': { - type: 'ExpressionStatement', - expression: { - type: 'BinaryExpression', - operator: '-', - left: { - type: 'BinaryExpression', - operator: '+', - left: { + 'var x = /[\\u{0000000000000061}-\\u{7A}]/u': { + type: 'Program', + body: [{ + type: 'VariableDeclaration', + declarations: [{ + type: 'VariableDeclarator', + id: { type: 'Identifier', name: 'x', - range: [0, 1], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 1 } - } - }, - right: { - type: 'Identifier', - name: 'y', range: [4, 5], loc: { start: { line: 1, column: 4 }, end: { line: 1, column: 5 } } }, - range: [0, 5], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 5 } - } - }, - right: { - type: 'Identifier', - name: 'z', - range: [8, 9], + init: { + type: 'Literal', + value: null, + raw: '/[\\u{0000000000000061}-\\u{7A}]/u', + regex: { + pattern: '[\\u{0000000000000061}-\\u{7A}]', + flags: 'u' + }, + range: [8, 40], + loc: { + start: { line: 1, column: 8 }, + end: { line: 1, column: 40 } + } + }, + range: [4, 40], loc: { - start: { line: 1, column: 8 }, - end: { line: 1, column: 9 } + start: { line: 1, column: 4 }, + end: { line: 1, column: 40 } } - }, - range: [0, 9], + }], + kind: 'var', + range: [0, 40], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 9 } + end: { line: 1, column: 40 } } - }, - range: [0, 9], + }], + range: [0, 40], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 9 } - } + end: { line: 1, column: 40 } + }, + tokens: [{ + type: 'Keyword', + value: 'var', + range: [0, 3], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 3 } + } + }, { + type: 'Identifier', + value: 'x', + range: [4, 5], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 5 } + } + }, { + type: 'Punctuator', + value: '=', + range: [6, 7], + loc: { + start: { line: 1, column: 6 }, + end: { line: 1, column: 7 } + } + }, { + type: 'RegularExpression', + value: '/[\\u{0000000000000061}-\\u{7A}]/u', + regex: { + pattern: '[\\u{0000000000000061}-\\u{7A}]', + flags: 'u' + }, + range: [8, 40], + loc: { + start: { line: 1, column: 8 }, + end: { line: 1, column: 40 } + } + }] }, - 'x - y - z': { - type: 'ExpressionStatement', - expression: { - type: 'BinaryExpression', - operator: '-', - left: { - type: 'BinaryExpression', - operator: '-', - left: { + 'var x = /\\u{110000}/u': { + index: 21, + lineNumber: 1, + column: 22, + message: 'Error: Line 1: Invalid regular expression' + }, + + 'var x = /[x-z]/i': { + type: 'Program', + body: [{ + type: 'VariableDeclaration', + declarations: [{ + type: 'VariableDeclarator', + id: { type: 'Identifier', name: 'x', - range: [0, 1], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 1 } - } + range: [4, 5] }, - right: { + init: { + type: 'Literal', + value: '/[x-z]/i', + raw: '/[x-z]/i', + regex: { + pattern: '[x-z]', + flags: 'i' + }, + range: [8, 16] + }, + range: [4, 16] + }], + kind: 'var', + range: [0, 16] + }], + range: [0, 16], + tokens: [{ + type: 'Keyword', + value: 'var', + range: [0, 3] + }, { + type: 'Identifier', + value: 'x', + range: [4, 5] + }, { + type: 'Punctuator', + value: '=', + range: [6, 7] + }, { + type: 'RegularExpression', + value: '/[x-z]/i', + regex: { + pattern: '[x-z]', + flags: 'i' + }, + range: [8, 16] + }] + }, + + 'var x = /[a-c]/i': { + type: 'Program', + body: [{ + type: 'VariableDeclaration', + declarations: [{ + type: 'VariableDeclarator', + id: { type: 'Identifier', - name: 'y', - range: [4, 5], + name: 'x', loc: { start: { line: 1, column: 4 }, end: { line: 1, column: 5 } } }, - range: [0, 5], + init: { + type: 'Literal', + value: '/[a-c]/i', + raw: '/[a-c]/i', + regex: { + pattern: '[a-c]', + flags: 'i' + }, + loc: { + start: { line: 1, column: 8 }, + end: { line: 1, column: 16 } + } + }, loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 5 } + start: { line: 1, column: 4 }, + end: { line: 1, column: 16 } } - }, - right: { - type: 'Identifier', - name: 'z', - range: [8, 9], - loc: { - start: { line: 1, column: 8 }, - end: { line: 1, column: 9 } - } - }, - range: [0, 9], + }], + kind: 'var', loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 9 } + end: { line: 1, column: 16 } } - }, - range: [0, 9], + }], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 9 } - } + end: { line: 1, column: 16 } + }, + tokens: [{ + type: 'Keyword', + value: 'var', + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 3 } + } + }, { + type: 'Identifier', + value: 'x', + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 5 } + } + }, { + type: 'Punctuator', + value: '=', + loc: { + start: { line: 1, column: 6 }, + end: { line: 1, column: 7 } + } + }, { + type: 'RegularExpression', + value: '/[a-c]/i', + regex: { + pattern: '[a-c]', + flags: 'i' + }, + loc: { + start: { line: 1, column: 8 }, + end: { line: 1, column: 16 } + } + }] }, - 'x + y * z': { - type: 'ExpressionStatement', - expression: { - type: 'BinaryExpression', - operator: '+', - left: { - type: 'Identifier', - name: 'x', - range: [0, 1], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 1 } - } - }, - right: { - type: 'BinaryExpression', - operator: '*', - left: { + 'var x = /[P QR]/i': { + type: 'Program', + body: [{ + type: 'VariableDeclaration', + declarations: [{ + type: 'VariableDeclarator', + id: { type: 'Identifier', - name: 'y', + name: 'x', range: [4, 5], loc: { start: { line: 1, column: 4 }, end: { line: 1, column: 5 } } }, - right: { - type: 'Identifier', - name: 'z', - range: [8, 9], + init: { + type: 'Literal', + value: '/[P QR]/i', + raw: '/[P QR]/i', + regex: { + pattern: '[P QR]', + flags: 'i' + }, + range: [8, 17], loc: { start: { line: 1, column: 8 }, - end: { line: 1, column: 9 } + end: { line: 1, column: 17 } } }, - range: [4, 9], + range: [4, 17], loc: { start: { line: 1, column: 4 }, - end: { line: 1, column: 9 } + end: { line: 1, column: 17 } } - }, - range: [0, 9], + }], + kind: 'var', + range: [0, 17], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 9 } + end: { line: 1, column: 17 } } - }, - range: [0, 9], + }], + range: [0, 17], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 9 } - } + end: { line: 1, column: 17 } + }, + tokens: [{ + type: 'Keyword', + value: 'var', + range: [0, 3], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 3 } + } + }, { + type: 'Identifier', + value: 'x', + range: [4, 5], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 5 } + } + }, { + type: 'Punctuator', + value: '=', + range: [6, 7], + loc: { + start: { line: 1, column: 6 }, + end: { line: 1, column: 7 } + } + }, { + type: 'RegularExpression', + value: '/[P QR]/i', + regex: { + pattern: '[P QR]', + flags: 'i' + }, + range: [8, 17], + loc: { + start: { line: 1, column: 8 }, + end: { line: 1, column: 17 } + } + }] }, - 'x + y / z': { - type: 'ExpressionStatement', - expression: { - type: 'BinaryExpression', - operator: '+', - left: { - type: 'Identifier', - name: 'x', - range: [0, 1], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 1 } - } - }, - right: { - type: 'BinaryExpression', - operator: '/', - left: { + 'var x = /[\\]/]/': { + type: 'Program', + body: [{ + type: 'VariableDeclaration', + declarations: [{ + type: 'VariableDeclarator', + id: { type: 'Identifier', - name: 'y', + name: 'x', range: [4, 5], loc: { start: { line: 1, column: 4 }, end: { line: 1, column: 5 } } }, - right: { - type: 'Identifier', - name: 'z', - range: [8, 9], + init: { + type: 'Literal', + value: new RegExp('[\\]/]').toString(), + raw: '/[\\]/]/', + regex: { + pattern: '[\\]/]', + flags: '' + }, + range: [8, 15], loc: { start: { line: 1, column: 8 }, - end: { line: 1, column: 9 } + end: { line: 1, column: 15 } } }, - range: [4, 9], + range: [4, 15], loc: { start: { line: 1, column: 4 }, - end: { line: 1, column: 9 } + end: { line: 1, column: 15 } } - }, - range: [0, 9], + }], + kind: 'var', + range: [0, 15], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 9 } + end: { line: 1, column: 15 } } - }, - range: [0, 9], + }], + range: [0, 15], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 9 } - } + end: { line: 1, column: 15 } + }, + tokens: [{ + type: 'Keyword', + value: 'var', + range: [0, 3], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 3 } + } + }, { + type: 'Identifier', + value: 'x', + range: [4, 5], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 5 } + } + }, { + type: 'Punctuator', + value: '=', + range: [6, 7], + loc: { + start: { line: 1, column: 6 }, + end: { line: 1, column: 7 } + } + }, { + type: 'RegularExpression', + value: '/[\\]/]/', + regex: { + pattern: '[\\]/]', + flags: '' + }, + range: [8, 15], + loc: { + start: { line: 1, column: 8 }, + end: { line: 1, column: 15 } + } + }] }, - 'x - y % z': { - type: 'ExpressionStatement', - expression: { - type: 'BinaryExpression', - operator: '-', - left: { - type: 'Identifier', - name: 'x', - range: [0, 1], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 1 } - } - }, - right: { - type: 'BinaryExpression', - operator: '%', - left: { + 'var x = /foo\\/bar/': { + type: 'Program', + body: [{ + type: 'VariableDeclaration', + declarations: [{ + type: 'VariableDeclarator', + id: { type: 'Identifier', - name: 'y', + name: 'x', range: [4, 5], loc: { start: { line: 1, column: 4 }, end: { line: 1, column: 5 } } }, - right: { - type: 'Identifier', - name: 'z', - range: [8, 9], + init: { + type: 'Literal', + value: '/foo\\/bar/', + raw: '/foo\\/bar/', + regex: { + pattern: 'foo\\/bar', + flags: '' + }, + range: [8, 18], loc: { start: { line: 1, column: 8 }, - end: { line: 1, column: 9 } + end: { line: 1, column: 18 } } }, - range: [4, 9], + range: [4, 18], loc: { start: { line: 1, column: 4 }, - end: { line: 1, column: 9 } + end: { line: 1, column: 18 } } - }, - range: [0, 9], + }], + kind: 'var', + range: [0, 18], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 9 } + end: { line: 1, column: 18 } } - }, - range: [0, 9], + }], + range: [0, 18], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 9 } - } + end: { line: 1, column: 18 } + }, + tokens: [{ + type: 'Keyword', + value: 'var', + range: [0, 3], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 3 } + } + }, { + type: 'Identifier', + value: 'x', + range: [4, 5], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 5 } + } + }, { + type: 'Punctuator', + value: '=', + range: [6, 7], + loc: { + start: { line: 1, column: 6 }, + end: { line: 1, column: 7 } + } + }, { + type: 'RegularExpression', + value: '/foo\\/bar/', + regex: { + pattern: 'foo\\/bar', + flags: '' + }, + range: [8, 18], + loc: { + start: { line: 1, column: 8 }, + end: { line: 1, column: 18 } + } + }] }, - 'x * y * z': { - type: 'ExpressionStatement', - expression: { - type: 'BinaryExpression', - operator: '*', - left: { - type: 'BinaryExpression', - operator: '*', - left: { + 'var x = /=([^=\\s])+/g': { + type: 'Program', + body: [{ + type: 'VariableDeclaration', + declarations: [{ + type: 'VariableDeclarator', + id: { type: 'Identifier', name: 'x', - range: [0, 1], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 1 } - } - }, - right: { - type: 'Identifier', - name: 'y', range: [4, 5], loc: { start: { line: 1, column: 4 }, end: { line: 1, column: 5 } } }, - range: [0, 5], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 5 } - } - }, - right: { - type: 'Identifier', - name: 'z', - range: [8, 9], + init: { + type: 'Literal', + value: '/=([^=\\s])+/g', + raw: '/=([^=\\s])+/g', + regex: { + pattern: '=([^=\\s])+', + flags: 'g' + }, + range: [8, 21], + loc: { + start: { line: 1, column: 8 }, + end: { line: 1, column: 21 } + } + }, + range: [4, 21], loc: { - start: { line: 1, column: 8 }, - end: { line: 1, column: 9 } + start: { line: 1, column: 4 }, + end: { line: 1, column: 21 } } - }, - range: [0, 9], + }], + kind: 'var', + range: [0, 21], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 9 } + end: { line: 1, column: 21 } } - }, - range: [0, 9], + }], + range: [0, 21], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 9 } - } + end: { line: 1, column: 21 } + }, + tokens: [{ + type: 'Keyword', + value: 'var', + range: [0, 3], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 3 } + } + }, { + type: 'Identifier', + value: 'x', + range: [4, 5], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 5 } + } + }, { + type: 'Punctuator', + value: '=', + range: [6, 7], + loc: { + start: { line: 1, column: 6 }, + end: { line: 1, column: 7 } + } + }, { + type: 'RegularExpression', + value: '/=([^=\\s])+/g', + regex: { + pattern: '=([^=\\s])+', + flags: 'g' + }, + range: [8, 21], + loc: { + start: { line: 1, column: 8 }, + end: { line: 1, column: 21 } + } + }] }, - 'x * y / z': { - type: 'ExpressionStatement', - expression: { - type: 'BinaryExpression', - operator: '/', - left: { - type: 'BinaryExpression', - operator: '*', - left: { - type: 'Identifier', - name: 'x', - range: [0, 1], + 'var x = /42/g.test': { + type: 'VariableDeclaration', + declarations: [{ + type: 'VariableDeclarator', + id: { + type: 'Identifier', + name: 'x', + range: [4, 5], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 5 } + } + }, + init: { + type: 'MemberExpression', + computed: false, + object: { + type: 'Literal', + value: '/42/g', + raw: '/42/g', + regex: { + pattern: '42', + flags: 'g' + }, + range: [8, 13], loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 1 } + start: { line: 1, column: 8 }, + end: { line: 1, column: 13 } } }, - right: { + property: { type: 'Identifier', - name: 'y', - range: [4, 5], + name: 'test', + range: [14, 18], loc: { - start: { line: 1, column: 4 }, - end: { line: 1, column: 5 } + start: { line: 1, column: 14 }, + end: { line: 1, column: 18 } } }, - range: [0, 5], + range: [8, 18], loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 5 } + start: { line: 1, column: 8 }, + end: { line: 1, column: 18 } } }, - right: { + range: [4, 18], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 18 } + } + }], + kind: 'var', + range: [0, 18], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 18 } + } + } + + }, + + 'Left-Hand-Side Expression': { + + 'new Button': { + type: 'ExpressionStatement', + expression: { + type: 'NewExpression', + callee: { type: 'Identifier', - name: 'z', - range: [8, 9], + name: 'Button', + range: [4, 10], loc: { - start: { line: 1, column: 8 }, - end: { line: 1, column: 9 } + start: { line: 1, column: 4 }, + end: { line: 1, column: 10 } } }, - range: [0, 9], + 'arguments': [], + range: [0, 10], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 9 } + end: { line: 1, column: 10 } } }, - range: [0, 9], + range: [0, 10], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 9 } + end: { line: 1, column: 10 } } }, - 'x * y % z': { + 'new Button()': { type: 'ExpressionStatement', expression: { - type: 'BinaryExpression', - operator: '%', - left: { - type: 'BinaryExpression', - operator: '*', - left: { - type: 'Identifier', - name: 'x', - range: [0, 1], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 1 } - } - }, - right: { - type: 'Identifier', - name: 'y', - range: [4, 5], - loc: { - start: { line: 1, column: 4 }, - end: { line: 1, column: 5 } - } - }, - range: [0, 5], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 5 } - } - }, - right: { + type: 'NewExpression', + callee: { type: 'Identifier', - name: 'z', - range: [8, 9], + name: 'Button', + range: [4, 10], loc: { - start: { line: 1, column: 8 }, - end: { line: 1, column: 9 } + start: { line: 1, column: 4 }, + end: { line: 1, column: 10 } } }, - range: [0, 9], + 'arguments': [], + range: [0, 12], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 9 } + end: { line: 1, column: 12 } } }, - range: [0, 9], + range: [0, 12], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 9 } + end: { line: 1, column: 12 } } }, - 'x % y * z': { + 'new new foo': { type: 'ExpressionStatement', expression: { - type: 'BinaryExpression', - operator: '*', - left: { - type: 'BinaryExpression', - operator: '%', - left: { - type: 'Identifier', - name: 'x', - range: [0, 1], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 1 } - } - }, - right: { + type: 'NewExpression', + callee: { + type: 'NewExpression', + callee: { type: 'Identifier', - name: 'y', - range: [4, 5], + name: 'foo', + range: [8, 11], loc: { - start: { line: 1, column: 4 }, - end: { line: 1, column: 5 } + start: { line: 1, column: 8 }, + end: { line: 1, column: 11 } } }, - range: [0, 5], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 5 } - } - }, - right: { - type: 'Identifier', - name: 'z', - range: [8, 9], + 'arguments': [], + range: [4, 11], loc: { - start: { line: 1, column: 8 }, - end: { line: 1, column: 9 } + start: { line: 1, column: 4 }, + end: { line: 1, column: 11 } } }, - range: [0, 9], + 'arguments': [], + range: [0, 11], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 9 } + end: { line: 1, column: 11 } } }, - range: [0, 9], + range: [0, 11], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 9 } + end: { line: 1, column: 11 } } }, - 'x << y << z': { + 'new new foo()': { type: 'ExpressionStatement', expression: { - type: 'BinaryExpression', - operator: '<<', - left: { - type: 'BinaryExpression', - operator: '<<', - left: { - type: 'Identifier', - name: 'x', - range: [0, 1], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 1 } - } - }, - right: { + type: 'NewExpression', + callee: { + type: 'NewExpression', + callee: { type: 'Identifier', - name: 'y', - range: [5, 6], + name: 'foo', + range: [8, 11], loc: { - start: { line: 1, column: 5 }, - end: { line: 1, column: 6 } + start: { line: 1, column: 8 }, + end: { line: 1, column: 11 } } }, - range: [0, 6], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 6 } - } - }, - right: { - type: 'Identifier', - name: 'z', - range: [10, 11], + 'arguments': [], + range: [4, 13], loc: { - start: { line: 1, column: 10 }, - end: { line: 1, column: 11 } + start: { line: 1, column: 4 }, + end: { line: 1, column: 13 } } }, - range: [0, 11], + 'arguments': [], + range: [0, 13], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 11 } + end: { line: 1, column: 13 } } }, - range: [0, 11], + range: [0, 13], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 11 } + end: { line: 1, column: 13 } } }, - 'x | y | z': { + 'new foo().bar()': { type: 'ExpressionStatement', expression: { - type: 'BinaryExpression', - operator: '|', - left: { - type: 'BinaryExpression', - operator: '|', - left: { - type: 'Identifier', - name: 'x', - range: [0, 1], + type: 'CallExpression', + callee: { + type: 'MemberExpression', + computed: false, + object: { + type: 'NewExpression', + callee: { + type: 'Identifier', + name: 'foo', + range: [4, 7], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 7 } + } + }, + 'arguments': [], + range: [0, 9], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 1 } + end: { line: 1, column: 9 } } }, - right: { + property: { type: 'Identifier', - name: 'y', - range: [4, 5], + name: 'bar', + range: [10, 13], loc: { - start: { line: 1, column: 4 }, - end: { line: 1, column: 5 } + start: { line: 1, column: 10 }, + end: { line: 1, column: 13 } } }, - range: [0, 5], + range: [0, 13], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 5 } - } - }, - right: { - type: 'Identifier', - name: 'z', - range: [8, 9], - loc: { - start: { line: 1, column: 8 }, - end: { line: 1, column: 9 } + end: { line: 1, column: 13 } } }, - range: [0, 9], + 'arguments': [], + range: [0, 15], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 9 } + end: { line: 1, column: 15 } } }, - range: [0, 9], + range: [0, 15], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 9 } + end: { line: 1, column: 15 } } }, - 'x & y & z': { + 'new foo[bar]': { type: 'ExpressionStatement', expression: { - type: 'BinaryExpression', - operator: '&', - left: { - type: 'BinaryExpression', - operator: '&', - left: { + type: 'NewExpression', + callee: { + type: 'MemberExpression', + computed: true, + object: { type: 'Identifier', - name: 'x', - range: [0, 1], + name: 'foo', + range: [4, 7], loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 1 } + start: { line: 1, column: 4 }, + end: { line: 1, column: 7 } } }, - right: { + property: { type: 'Identifier', - name: 'y', - range: [4, 5], + name: 'bar', + range: [8, 11], loc: { - start: { line: 1, column: 4 }, - end: { line: 1, column: 5 } + start: { line: 1, column: 8 }, + end: { line: 1, column: 11 } } }, - range: [0, 5], + range: [4, 12], loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 5 } + start: { line: 1, column: 4 }, + end: { line: 1, column: 12 } } }, - right: { - type: 'Identifier', - name: 'z', - range: [8, 9], - loc: { - start: { line: 1, column: 8 }, - end: { line: 1, column: 9 } - } - }, - range: [0, 9], + 'arguments': [], + range: [0, 12], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 9 } + end: { line: 1, column: 12 } } }, - range: [0, 9], + range: [0, 12], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 9 } + end: { line: 1, column: 12 } } }, - 'x ^ y ^ z': { + 'new foo.bar()': { type: 'ExpressionStatement', expression: { - type: 'BinaryExpression', - operator: '^', - left: { - type: 'BinaryExpression', - operator: '^', - left: { + type: 'NewExpression', + callee: { + type: 'MemberExpression', + computed: false, + object: { type: 'Identifier', - name: 'x', - range: [0, 1], + name: 'foo', + range: [4, 7], loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 1 } + start: { line: 1, column: 4 }, + end: { line: 1, column: 7 } } }, - right: { + property: { type: 'Identifier', - name: 'y', - range: [4, 5], + name: 'bar', + range: [8, 11], loc: { - start: { line: 1, column: 4 }, - end: { line: 1, column: 5 } + start: { line: 1, column: 8 }, + end: { line: 1, column: 11 } } }, - range: [0, 5], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 5 } - } - }, - right: { - type: 'Identifier', - name: 'z', - range: [8, 9], + range: [4, 11], loc: { - start: { line: 1, column: 8 }, - end: { line: 1, column: 9 } + start: { line: 1, column: 4 }, + end: { line: 1, column: 11 } } }, - range: [0, 9], + 'arguments': [], + range: [0, 13], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 9 } + end: { line: 1, column: 13 } } }, - range: [0, 9], + range: [0, 13], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 9 } + end: { line: 1, column: 13 } } }, - 'x & y | z': { + '( new foo).bar()': { type: 'ExpressionStatement', expression: { - type: 'BinaryExpression', - operator: '|', - left: { - type: 'BinaryExpression', - operator: '&', - left: { - type: 'Identifier', - name: 'x', - range: [0, 1], + type: 'CallExpression', + callee: { + type: 'MemberExpression', + computed: false, + object: { + type: 'NewExpression', + callee: { + type: 'Identifier', + name: 'foo', + range: [6, 9], + loc: { + start: { line: 1, column: 6 }, + end: { line: 1, column: 9 } + } + }, + 'arguments': [], + range: [2, 9], loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 1 } + start: { line: 1, column: 2 }, + end: { line: 1, column: 9 } } }, - right: { + property: { type: 'Identifier', - name: 'y', - range: [4, 5], + name: 'bar', + range: [11, 14], loc: { - start: { line: 1, column: 4 }, - end: { line: 1, column: 5 } + start: { line: 1, column: 11 }, + end: { line: 1, column: 14 } } }, - range: [0, 5], + range: [0, 14], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 5 } - } - }, - right: { - type: 'Identifier', - name: 'z', - range: [8, 9], - loc: { - start: { line: 1, column: 8 }, - end: { line: 1, column: 9 } + end: { line: 1, column: 14 } } }, - range: [0, 9], + 'arguments': [], + range: [0, 16], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 9 } + end: { line: 1, column: 16 } } }, - range: [0, 9], + range: [0, 16], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 9 } + end: { line: 1, column: 16 } } }, - 'x | y ^ z': { + 'foo(bar, baz)': { type: 'ExpressionStatement', expression: { - type: 'BinaryExpression', - operator: '|', - left: { + type: 'CallExpression', + callee: { type: 'Identifier', - name: 'x', - range: [0, 1], + name: 'foo', + range: [0, 3], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 1 } + end: { line: 1, column: 3 } } }, - right: { - type: 'BinaryExpression', - operator: '^', - left: { - type: 'Identifier', - name: 'y', - range: [4, 5], - loc: { - start: { line: 1, column: 4 }, - end: { line: 1, column: 5 } - } - }, - right: { - type: 'Identifier', - name: 'z', - range: [8, 9], - loc: { - start: { line: 1, column: 8 }, - end: { line: 1, column: 9 } - } - }, - range: [4, 9], + 'arguments': [{ + type: 'Identifier', + name: 'bar', + range: [4, 7], loc: { start: { line: 1, column: 4 }, - end: { line: 1, column: 9 } + end: { line: 1, column: 7 } } - }, - range: [0, 9], + }, { + type: 'Identifier', + name: 'baz', + range: [9, 12], + loc: { + start: { line: 1, column: 9 }, + end: { line: 1, column: 12 } + } + }], + range: [0, 13], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 9 } + end: { line: 1, column: 13 } } }, - range: [0, 9], + range: [0, 13], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 9 } + end: { line: 1, column: 13 } } }, - 'x | y & z': { + '( foo )()': { type: 'ExpressionStatement', expression: { - type: 'BinaryExpression', - operator: '|', - left: { + type: 'CallExpression', + callee: { type: 'Identifier', - name: 'x', - range: [0, 1], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 1 } - } - }, - right: { - type: 'BinaryExpression', - operator: '&', - left: { - type: 'Identifier', - name: 'y', - range: [4, 5], - loc: { - start: { line: 1, column: 4 }, - end: { line: 1, column: 5 } - } - }, - right: { - type: 'Identifier', - name: 'z', - range: [8, 9], - loc: { - start: { line: 1, column: 8 }, - end: { line: 1, column: 9 } - } - }, - range: [4, 9], + name: 'foo', + range: [5, 8], loc: { - start: { line: 1, column: 4 }, - end: { line: 1, column: 9 } + start: { line: 1, column: 5 }, + end: { line: 1, column: 8 } } }, - range: [0, 9], + 'arguments': [], + range: [0, 13], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 9 } + end: { line: 1, column: 13 } } }, - range: [0, 9], + range: [0, 13], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 9 } + end: { line: 1, column: 13 } } - } - - }, - - 'Binary Logical Operators': { + }, - 'x || y': { + 'universe.milkyway': { type: 'ExpressionStatement', expression: { - type: 'LogicalExpression', - operator: '||', - left: { - type: 'Identifier', - name: 'x', - range: [0, 1], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 1 } - } - }, - right: { - type: 'Identifier', - name: 'y', - range: [5, 6], - loc: { - start: { line: 1, column: 5 }, - end: { line: 1, column: 6 } - } - }, - range: [0, 6], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 6 } - } - }, - range: [0, 6], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 6 } - } - }, - - 'x && y': { - type: 'ExpressionStatement', - expression: { - type: 'LogicalExpression', - operator: '&&', - left: { + type: 'MemberExpression', + computed: false, + object: { type: 'Identifier', - name: 'x', - range: [0, 1], + name: 'universe', + range: [0, 8], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 1 } + end: { line: 1, column: 8 } } }, - right: { + property: { type: 'Identifier', - name: 'y', - range: [5, 6], + name: 'milkyway', + range: [9, 17], loc: { - start: { line: 1, column: 5 }, - end: { line: 1, column: 6 } + start: { line: 1, column: 9 }, + end: { line: 1, column: 17 } } }, - range: [0, 6], + range: [0, 17], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 6 } + end: { line: 1, column: 17 } } }, - range: [0, 6], + range: [0, 17], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 6 } + end: { line: 1, column: 17 } } }, - 'x || y || z': { + 'universe.milkyway.solarsystem': { type: 'ExpressionStatement', expression: { - type: 'LogicalExpression', - operator: '||', - left: { - type: 'LogicalExpression', - operator: '||', - left: { + type: 'MemberExpression', + computed: false, + object: { + type: 'MemberExpression', + computed: false, + object: { type: 'Identifier', - name: 'x', - range: [0, 1], + name: 'universe', + range: [0, 8], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 1 } + end: { line: 1, column: 8 } } }, - right: { + property: { type: 'Identifier', - name: 'y', - range: [5, 6], + name: 'milkyway', + range: [9, 17], loc: { - start: { line: 1, column: 5 }, - end: { line: 1, column: 6 } + start: { line: 1, column: 9 }, + end: { line: 1, column: 17 } } }, - range: [0, 6], + range: [0, 17], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 6 } + end: { line: 1, column: 17 } } }, - right: { + property: { type: 'Identifier', - name: 'z', - range: [10, 11], + name: 'solarsystem', + range: [18, 29], loc: { - start: { line: 1, column: 10 }, - end: { line: 1, column: 11 } + start: { line: 1, column: 18 }, + end: { line: 1, column: 29 } } }, - range: [0, 11], + range: [0, 29], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 11 } + end: { line: 1, column: 29 } } }, - range: [0, 11], + range: [0, 29], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 11 } + end: { line: 1, column: 29 } } }, - 'x && y && z': { + 'universe.milkyway.solarsystem.Earth': { type: 'ExpressionStatement', expression: { - type: 'LogicalExpression', - operator: '&&', - left: { - type: 'LogicalExpression', - operator: '&&', - left: { - type: 'Identifier', - name: 'x', - range: [0, 1], + type: 'MemberExpression', + computed: false, + object: { + type: 'MemberExpression', + computed: false, + object: { + type: 'MemberExpression', + computed: false, + object: { + type: 'Identifier', + name: 'universe', + range: [0, 8], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 8 } + } + }, + property: { + type: 'Identifier', + name: 'milkyway', + range: [9, 17], + loc: { + start: { line: 1, column: 9 }, + end: { line: 1, column: 17 } + } + }, + range: [0, 17], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 1 } + end: { line: 1, column: 17 } } }, - right: { + property: { type: 'Identifier', - name: 'y', - range: [5, 6], + name: 'solarsystem', + range: [18, 29], loc: { - start: { line: 1, column: 5 }, - end: { line: 1, column: 6 } + start: { line: 1, column: 18 }, + end: { line: 1, column: 29 } } }, - range: [0, 6], + range: [0, 29], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 6 } + end: { line: 1, column: 29 } } }, - right: { + property: { type: 'Identifier', - name: 'z', - range: [10, 11], + name: 'Earth', + range: [30, 35], loc: { - start: { line: 1, column: 10 }, - end: { line: 1, column: 11 } + start: { line: 1, column: 30 }, + end: { line: 1, column: 35 } } }, - range: [0, 11], + range: [0, 35], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 11 } + end: { line: 1, column: 35 } } }, - range: [0, 11], + range: [0, 35], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 11 } + end: { line: 1, column: 35 } } }, - 'x || y && z': { + 'universe[galaxyName, otherUselessName]': { type: 'ExpressionStatement', expression: { - type: 'LogicalExpression', - operator: '||', - left: { + type: 'MemberExpression', + computed: true, + object: { type: 'Identifier', - name: 'x', - range: [0, 1], + name: 'universe', + range: [0, 8], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 1 } + end: { line: 1, column: 8 } } }, - right: { - type: 'LogicalExpression', - operator: '&&', - left: { + property: { + type: 'SequenceExpression', + expressions: [{ type: 'Identifier', - name: 'y', - range: [5, 6], + name: 'galaxyName', + range: [9, 19], loc: { - start: { line: 1, column: 5 }, - end: { line: 1, column: 6 } + start: { line: 1, column: 9 }, + end: { line: 1, column: 19 } } - }, - right: { + }, { type: 'Identifier', - name: 'z', - range: [10, 11], + name: 'otherUselessName', + range: [21, 37], loc: { - start: { line: 1, column: 10 }, - end: { line: 1, column: 11 } + start: { line: 1, column: 21 }, + end: { line: 1, column: 37 } } - }, - range: [5, 11], + }], + range: [9, 37], loc: { - start: { line: 1, column: 5 }, - end: { line: 1, column: 11 } + start: { line: 1, column: 9 }, + end: { line: 1, column: 37 } } }, - range: [0, 11], + range: [0, 38], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 11 } + end: { line: 1, column: 38 } } }, - range: [0, 11], + range: [0, 38], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 11 } + end: { line: 1, column: 38 } } }, - 'x || y ^ z': { + 'universe[galaxyName]': { type: 'ExpressionStatement', expression: { - type: 'LogicalExpression', - operator: '||', - left: { + type: 'MemberExpression', + computed: true, + object: { type: 'Identifier', - name: 'x', - range: [0, 1], + name: 'universe', + range: [0, 8], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 1 } - } - }, - right: { - type: 'BinaryExpression', - operator: '^', - left: { - type: 'Identifier', - name: 'y', - range: [5, 6], - loc: { - start: { line: 1, column: 5 }, - end: { line: 1, column: 6 } - } - }, - right: { - type: 'Identifier', - name: 'z', - range: [9, 10], - loc: { - start: { line: 1, column: 9 }, - end: { line: 1, column: 10 } - } - }, - range: [5, 10], - loc: { - start: { line: 1, column: 5 }, - end: { line: 1, column: 10 } + end: { line: 1, column: 8 } } }, - range: [0, 10], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 10 } - } - }, - range: [0, 10], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 10 } - } - } - - }, - - 'Conditional Operator': { - - 'y ? 1 : 2': { - type: 'ExpressionStatement', - expression: { - type: 'ConditionalExpression', - test: { + property: { type: 'Identifier', - name: 'y', - range: [0, 1], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 1 } - } - }, - consequent: { - type: 'Literal', - value: 1, - raw: '1', - range: [4, 5], - loc: { - start: { line: 1, column: 4 }, - end: { line: 1, column: 5 } - } - }, - alternate: { - type: 'Literal', - value: 2, - raw: '2', - range: [8, 9], + name: 'galaxyName', + range: [9, 19], loc: { - start: { line: 1, column: 8 }, - end: { line: 1, column: 9 } + start: { line: 1, column: 9 }, + end: { line: 1, column: 19 } } }, - range: [0, 9], + range: [0, 20], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 9 } + end: { line: 1, column: 20 } } }, - range: [0, 9], + range: [0, 20], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 9 } + end: { line: 1, column: 20 } } }, - 'x && y ? 1 : 2': { + 'universe[42].galaxies': { type: 'ExpressionStatement', expression: { - type: 'ConditionalExpression', - test: { - type: 'LogicalExpression', - operator: '&&', - left: { + type: 'MemberExpression', + computed: false, + object: { + type: 'MemberExpression', + computed: true, + object: { type: 'Identifier', - name: 'x', - range: [0, 1], + name: 'universe', + range: [0, 8], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 1 } + end: { line: 1, column: 8 } } }, - right: { - type: 'Identifier', - name: 'y', - range: [5, 6], + property: { + type: 'Literal', + value: 42, + raw: '42', + range: [9, 11], loc: { - start: { line: 1, column: 5 }, - end: { line: 1, column: 6 } + start: { line: 1, column: 9 }, + end: { line: 1, column: 11 } } }, - range: [0, 6], + range: [0, 12], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 6 } - } - }, - consequent: { - type: 'Literal', - value: 1, - raw: '1', - range: [9, 10], - loc: { - start: { line: 1, column: 9 }, - end: { line: 1, column: 10 } - } - }, - alternate: { - type: 'Literal', - value: 2, - raw: '2', - range: [13, 14], - loc: { - start: { line: 1, column: 13 }, - end: { line: 1, column: 14 } + end: { line: 1, column: 12 } } }, - range: [0, 14], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 14 } - } - }, - range: [0, 14], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 14 } - } - } - - }, - - 'Assignment Operators': { - - 'x = 42': { - type: 'ExpressionStatement', - expression: { - type: 'AssignmentExpression', - operator: '=', - left: { + property: { type: 'Identifier', - name: 'x', - range: [0, 1], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 1 } - } - }, - right: { - type: 'Literal', - value: 42, - raw: '42', - range: [4, 6], + name: 'galaxies', + range: [13, 21], loc: { - start: { line: 1, column: 4 }, - end: { line: 1, column: 6 } + start: { line: 1, column: 13 }, + end: { line: 1, column: 21 } } }, - range: [0, 6], + range: [0, 21], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 6 } + end: { line: 1, column: 21 } } }, - range: [0, 6], + range: [0, 21], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 6 } + end: { line: 1, column: 21 } } }, - 'eval = 42': { + 'universe(42).galaxies': { type: 'ExpressionStatement', expression: { - type: 'AssignmentExpression', - operator: '=', - left: { - type: 'Identifier', - name: 'eval', - range: [0, 4], + type: 'MemberExpression', + computed: false, + object: { + type: 'CallExpression', + callee: { + type: 'Identifier', + name: 'universe', + range: [0, 8], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 8 } + } + }, + 'arguments': [{ + type: 'Literal', + value: 42, + raw: '42', + range: [9, 11], + loc: { + start: { line: 1, column: 9 }, + end: { line: 1, column: 11 } + } + }], + range: [0, 12], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 4 } + end: { line: 1, column: 12 } } }, - right: { - type: 'Literal', - value: 42, - raw: '42', - range: [7, 9], + property: { + type: 'Identifier', + name: 'galaxies', + range: [13, 21], loc: { - start: { line: 1, column: 7 }, - end: { line: 1, column: 9 } + start: { line: 1, column: 13 }, + end: { line: 1, column: 21 } } }, - range: [0, 9], + range: [0, 21], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 9 } + end: { line: 1, column: 21 } } }, - range: [0, 9], + range: [0, 21], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 9 } + end: { line: 1, column: 21 } } }, - 'arguments = 42': { + 'universe(42).galaxies(14, 3, 77).milkyway': { type: 'ExpressionStatement', expression: { - type: 'AssignmentExpression', - operator: '=', - left: { - type: 'Identifier', - name: 'arguments', - range: [0, 9], + type: 'MemberExpression', + computed: false, + object: { + type: 'CallExpression', + callee: { + type: 'MemberExpression', + computed: false, + object: { + type: 'CallExpression', + callee: { + type: 'Identifier', + name: 'universe', + range: [0, 8], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 8 } + } + }, + 'arguments': [{ + type: 'Literal', + value: 42, + raw: '42', + range: [9, 11], + loc: { + start: { line: 1, column: 9 }, + end: { line: 1, column: 11 } + } + }], + range: [0, 12], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 12 } + } + }, + property: { + type: 'Identifier', + name: 'galaxies', + range: [13, 21], + loc: { + start: { line: 1, column: 13 }, + end: { line: 1, column: 21 } + } + }, + range: [0, 21], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 21 } + } + }, + 'arguments': [{ + type: 'Literal', + value: 14, + raw: '14', + range: [22, 24], + loc: { + start: { line: 1, column: 22 }, + end: { line: 1, column: 24 } + } + }, { + type: 'Literal', + value: 3, + raw: '3', + range: [26, 27], + loc: { + start: { line: 1, column: 26 }, + end: { line: 1, column: 27 } + } + }, { + type: 'Literal', + value: 77, + raw: '77', + range: [29, 31], + loc: { + start: { line: 1, column: 29 }, + end: { line: 1, column: 31 } + } + }], + range: [0, 32], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 9 } + end: { line: 1, column: 32 } } }, - right: { - type: 'Literal', - value: 42, - raw: '42', - range: [12, 14], + property: { + type: 'Identifier', + name: 'milkyway', + range: [33, 41], loc: { - start: { line: 1, column: 12 }, - end: { line: 1, column: 14 } + start: { line: 1, column: 33 }, + end: { line: 1, column: 41 } } }, - range: [0, 14], + range: [0, 41], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 14 } + end: { line: 1, column: 41 } } }, - range: [0, 14], + range: [0, 41], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 14 } + end: { line: 1, column: 41 } } }, - 'x *= 42': { + 'earth.asia.Indonesia.prepareForElection(2014)': { type: 'ExpressionStatement', expression: { - type: 'AssignmentExpression', - operator: '*=', - left: { - type: 'Identifier', - name: 'x', - range: [0, 1], + type: 'CallExpression', + callee: { + type: 'MemberExpression', + computed: false, + object: { + type: 'MemberExpression', + computed: false, + object: { + type: 'MemberExpression', + computed: false, + object: { + type: 'Identifier', + name: 'earth', + range: [0, 5], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 5 } + } + }, + property: { + type: 'Identifier', + name: 'asia', + range: [6, 10], + loc: { + start: { line: 1, column: 6 }, + end: { line: 1, column: 10 } + } + }, + range: [0, 10], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 10 } + } + }, + property: { + type: 'Identifier', + name: 'Indonesia', + range: [11, 20], + loc: { + start: { line: 1, column: 11 }, + end: { line: 1, column: 20 } + } + }, + range: [0, 20], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 20 } + } + }, + property: { + type: 'Identifier', + name: 'prepareForElection', + range: [21, 39], + loc: { + start: { line: 1, column: 21 }, + end: { line: 1, column: 39 } + } + }, + range: [0, 39], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 1 } + end: { line: 1, column: 39 } } }, - right: { + 'arguments': [{ type: 'Literal', - value: 42, - raw: '42', - range: [5, 7], + value: 2014, + raw: '2014', + range: [40, 44], loc: { - start: { line: 1, column: 5 }, - end: { line: 1, column: 7 } + start: { line: 1, column: 40 }, + end: { line: 1, column: 44 } } - }, - range: [0, 7], + }], + range: [0, 45], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 7 } + end: { line: 1, column: 45 } } }, - range: [0, 7], + range: [0, 45], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 7 } + end: { line: 1, column: 45 } } }, - 'x /= 42': { + 'universe.if': { type: 'ExpressionStatement', expression: { - type: 'AssignmentExpression', - operator: '/=', - left: { + type: 'MemberExpression', + computed: false, + object: { type: 'Identifier', - name: 'x', - range: [0, 1], + name: 'universe', + range: [0, 8], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 1 } + end: { line: 1, column: 8 } } }, - right: { - type: 'Literal', - value: 42, - raw: '42', - range: [5, 7], + property: { + type: 'Identifier', + name: 'if', + range: [9, 11], loc: { - start: { line: 1, column: 5 }, - end: { line: 1, column: 7 } + start: { line: 1, column: 9 }, + end: { line: 1, column: 11 } } }, - range: [0, 7], + range: [0, 11], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 7 } + end: { line: 1, column: 11 } } }, - range: [0, 7], + range: [0, 11], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 7 } + end: { line: 1, column: 11 } } }, - 'x %= 42': { + 'universe.true': { type: 'ExpressionStatement', expression: { - type: 'AssignmentExpression', - operator: '%=', - left: { + type: 'MemberExpression', + computed: false, + object: { type: 'Identifier', - name: 'x', - range: [0, 1], + name: 'universe', + range: [0, 8], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 1 } + end: { line: 1, column: 8 } } }, - right: { - type: 'Literal', - value: 42, - raw: '42', - range: [5, 7], + property: { + type: 'Identifier', + name: 'true', + range: [9, 13], loc: { - start: { line: 1, column: 5 }, - end: { line: 1, column: 7 } + start: { line: 1, column: 9 }, + end: { line: 1, column: 13 } } }, - range: [0, 7], + range: [0, 13], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 7 } + end: { line: 1, column: 13 } } }, - range: [0, 7], + range: [0, 13], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 7 } + end: { line: 1, column: 13 } } }, - 'x += 42': { + 'universe.false': { type: 'ExpressionStatement', expression: { - type: 'AssignmentExpression', - operator: '+=', - left: { + type: 'MemberExpression', + computed: false, + object: { type: 'Identifier', - name: 'x', - range: [0, 1], + name: 'universe', + range: [0, 8], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 1 } + end: { line: 1, column: 8 } } }, - right: { - type: 'Literal', - value: 42, - raw: '42', - range: [5, 7], + property: { + type: 'Identifier', + name: 'false', + range: [9, 14], loc: { - start: { line: 1, column: 5 }, - end: { line: 1, column: 7 } + start: { line: 1, column: 9 }, + end: { line: 1, column: 14 } } }, - range: [0, 7], + range: [0, 14], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 7 } + end: { line: 1, column: 14 } } }, - range: [0, 7], + range: [0, 14], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 7 } + end: { line: 1, column: 14 } } }, - 'x -= 42': { + 'universe.null': { type: 'ExpressionStatement', expression: { - type: 'AssignmentExpression', - operator: '-=', - left: { + type: 'MemberExpression', + computed: false, + object: { type: 'Identifier', - name: 'x', - range: [0, 1], + name: 'universe', + range: [0, 8], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 1 } + end: { line: 1, column: 8 } } }, - right: { - type: 'Literal', - value: 42, - raw: '42', - range: [5, 7], + property: { + type: 'Identifier', + name: 'null', + range: [9, 13], loc: { - start: { line: 1, column: 5 }, - end: { line: 1, column: 7 } + start: { line: 1, column: 9 }, + end: { line: 1, column: 13 } } }, - range: [0, 7], + range: [0, 13], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 7 } + end: { line: 1, column: 13 } } }, - range: [0, 7], + range: [0, 13], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 7 } + end: { line: 1, column: 13 } } - }, + } - 'x <<= 42': { + }, + + 'Postfix Expressions': { + + 'x++': { type: 'ExpressionStatement', expression: { - type: 'AssignmentExpression', - operator: '<<=', - left: { + type: 'UpdateExpression', + operator: '++', + argument: { type: 'Identifier', name: 'x', range: [0, 1], @@ -9283,35 +9448,26 @@ var testFixture = { end: { line: 1, column: 1 } } }, - right: { - type: 'Literal', - value: 42, - raw: '42', - range: [6, 8], - loc: { - start: { line: 1, column: 6 }, - end: { line: 1, column: 8 } - } - }, - range: [0, 8], + prefix: false, + range: [0, 3], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 8 } + end: { line: 1, column: 3 } } }, - range: [0, 8], + range: [0, 3], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 8 } + end: { line: 1, column: 3 } } }, - 'x >>= 42': { + 'x--': { type: 'ExpressionStatement', expression: { - type: 'AssignmentExpression', - operator: '>>=', - left: { + type: 'UpdateExpression', + operator: '--', + argument: { type: 'Identifier', name: 'x', range: [0, 1], @@ -9320,709 +9476,645 @@ var testFixture = { end: { line: 1, column: 1 } } }, - right: { - type: 'Literal', - value: 42, - raw: '42', - range: [6, 8], - loc: { - start: { line: 1, column: 6 }, - end: { line: 1, column: 8 } - } - }, - range: [0, 8], + prefix: false, + range: [0, 3], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 8 } + end: { line: 1, column: 3 } } }, - range: [0, 8], + range: [0, 3], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 8 } + end: { line: 1, column: 3 } } }, - 'x >>>= 42': { + 'eval++': { type: 'ExpressionStatement', expression: { - type: 'AssignmentExpression', - operator: '>>>=', - left: { + type: 'UpdateExpression', + operator: '++', + argument: { type: 'Identifier', - name: 'x', - range: [0, 1], + name: 'eval', + range: [0, 4], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 1 } - } - }, - right: { - type: 'Literal', - value: 42, - raw: '42', - range: [7, 9], - loc: { - start: { line: 1, column: 7 }, - end: { line: 1, column: 9 } + end: { line: 1, column: 4 } } }, - range: [0, 9], + prefix: false, + range: [0, 6], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 9 } + end: { line: 1, column: 6 } } }, - range: [0, 9], + range: [0, 6], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 9 } + end: { line: 1, column: 6 } } }, - 'x &= 42': { + 'eval--': { type: 'ExpressionStatement', expression: { - type: 'AssignmentExpression', - operator: '&=', - left: { + type: 'UpdateExpression', + operator: '--', + argument: { type: 'Identifier', - name: 'x', - range: [0, 1], + name: 'eval', + range: [0, 4], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 1 } - } - }, - right: { - type: 'Literal', - value: 42, - raw: '42', - range: [5, 7], - loc: { - start: { line: 1, column: 5 }, - end: { line: 1, column: 7 } + end: { line: 1, column: 4 } } }, - range: [0, 7], + prefix: false, + range: [0, 6], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 7 } + end: { line: 1, column: 6 } } }, - range: [0, 7], + range: [0, 6], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 7 } + end: { line: 1, column: 6 } } }, - 'x ^= 42': { + 'arguments++': { type: 'ExpressionStatement', expression: { - type: 'AssignmentExpression', - operator: '^=', - left: { + type: 'UpdateExpression', + operator: '++', + argument: { type: 'Identifier', - name: 'x', - range: [0, 1], + name: 'arguments', + range: [0, 9], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 1 } - } - }, - right: { - type: 'Literal', - value: 42, - raw: '42', - range: [5, 7], - loc: { - start: { line: 1, column: 5 }, - end: { line: 1, column: 7 } + end: { line: 1, column: 9 } } }, - range: [0, 7], + prefix: false, + range: [0, 11], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 7 } + end: { line: 1, column: 11 } } }, - range: [0, 7], + range: [0, 11], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 7 } + end: { line: 1, column: 11 } } }, - 'x |= 42': { + 'arguments--': { type: 'ExpressionStatement', expression: { - type: 'AssignmentExpression', - operator: '|=', - left: { + type: 'UpdateExpression', + operator: '--', + argument: { type: 'Identifier', - name: 'x', - range: [0, 1], + name: 'arguments', + range: [0, 9], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 1 } + end: { line: 1, column: 9 } } }, - right: { - type: 'Literal', - value: 42, - raw: '42', - range: [5, 7], - loc: { - start: { line: 1, column: 5 }, - end: { line: 1, column: 7 } - } - }, - range: [0, 7], + prefix: false, + range: [0, 11], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 7 } + end: { line: 1, column: 11 } } }, - range: [0, 7], + range: [0, 11], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 7 } + end: { line: 1, column: 11 } } } }, - 'Block': { + 'Unary Operators': { - '{ foo }': { - type: 'BlockStatement', - body: [{ - type: 'ExpressionStatement', - expression: { + '++x': { + type: 'ExpressionStatement', + expression: { + type: 'UpdateExpression', + operator: '++', + argument: { type: 'Identifier', - name: 'foo', - range: [2, 5], + name: 'x', + range: [2, 3], loc: { start: { line: 1, column: 2 }, - end: { line: 1, column: 5 } + end: { line: 1, column: 3 } } }, - range: [2, 6], + prefix: true, + range: [0, 3], loc: { - start: { line: 1, column: 2 }, - end: { line: 1, column: 6 } + start: { line: 1, column: 0 }, + end: { line: 1, column: 3 } } - }], - range: [0, 7], + }, + range: [0, 3], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 7 } + end: { line: 1, column: 3 } } }, - '{ doThis(); doThat(); }': { - type: 'BlockStatement', - body: [{ - type: 'ExpressionStatement', - expression: { - type: 'CallExpression', - callee: { - type: 'Identifier', - name: 'doThis', - range: [2, 8], - loc: { - start: { line: 1, column: 2 }, - end: { line: 1, column: 8 } - } - }, - 'arguments': [], - range: [2, 10], + '--x': { + type: 'ExpressionStatement', + expression: { + type: 'UpdateExpression', + operator: '--', + argument: { + type: 'Identifier', + name: 'x', + range: [2, 3], loc: { start: { line: 1, column: 2 }, - end: { line: 1, column: 10 } + end: { line: 1, column: 3 } } }, - range: [2, 11], + prefix: true, + range: [0, 3], loc: { - start: { line: 1, column: 2 }, - end: { line: 1, column: 11 } + start: { line: 1, column: 0 }, + end: { line: 1, column: 3 } } - }, { - type: 'ExpressionStatement', - expression: { - type: 'CallExpression', - callee: { - type: 'Identifier', - name: 'doThat', - range: [12, 18], - loc: { - start: { line: 1, column: 12 }, - end: { line: 1, column: 18 } - } - }, - 'arguments': [], - range: [12, 20], + }, + range: [0, 3], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 3 } + } + }, + + '++eval': { + type: 'ExpressionStatement', + expression: { + type: 'UpdateExpression', + operator: '++', + argument: { + type: 'Identifier', + name: 'eval', + range: [2, 6], loc: { - start: { line: 1, column: 12 }, - end: { line: 1, column: 20 } + start: { line: 1, column: 2 }, + end: { line: 1, column: 6 } } }, - range: [12, 21], + prefix: true, + range: [0, 6], loc: { - start: { line: 1, column: 12 }, - end: { line: 1, column: 21 } + start: { line: 1, column: 0 }, + end: { line: 1, column: 6 } } - }], - range: [0, 23], + }, + range: [0, 6], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 23 } + end: { line: 1, column: 6 } } }, - '{}': { - type: 'BlockStatement', - body: [], - range: [0, 2], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 2 } - } - } - - }, - - 'Variable Statement': { - - 'var x': { - type: 'VariableDeclaration', - declarations: [{ - type: 'VariableDeclarator', - id: { + '--eval': { + type: 'ExpressionStatement', + expression: { + type: 'UpdateExpression', + operator: '--', + argument: { type: 'Identifier', - name: 'x', - range: [4, 5], + name: 'eval', + range: [2, 6], loc: { - start: { line: 1, column: 4 }, - end: { line: 1, column: 5 } + start: { line: 1, column: 2 }, + end: { line: 1, column: 6 } } }, - init: null, - range: [4, 5], + prefix: true, + range: [0, 6], loc: { - start: { line: 1, column: 4 }, - end: { line: 1, column: 5 } + start: { line: 1, column: 0 }, + end: { line: 1, column: 6 } } - }], - kind: 'var', - range: [0, 5], + }, + range: [0, 6], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 5 } + end: { line: 1, column: 6 } } }, - 'var x, y;': { - type: 'VariableDeclaration', - declarations: [{ - type: 'VariableDeclarator', - id: { + '++arguments': { + type: 'ExpressionStatement', + expression: { + type: 'UpdateExpression', + operator: '++', + argument: { type: 'Identifier', - name: 'x', - range: [4, 5], + name: 'arguments', + range: [2, 11], loc: { - start: { line: 1, column: 4 }, - end: { line: 1, column: 5 } + start: { line: 1, column: 2 }, + end: { line: 1, column: 11 } } }, - init: null, - range: [4, 5], + prefix: true, + range: [0, 11], loc: { - start: { line: 1, column: 4 }, - end: { line: 1, column: 5 } + start: { line: 1, column: 0 }, + end: { line: 1, column: 11 } } - }, { - type: 'VariableDeclarator', - id: { + }, + range: [0, 11], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 11 } + } + }, + + '--arguments': { + type: 'ExpressionStatement', + expression: { + type: 'UpdateExpression', + operator: '--', + argument: { type: 'Identifier', - name: 'y', - range: [7, 8], + name: 'arguments', + range: [2, 11], loc: { - start: { line: 1, column: 7 }, - end: { line: 1, column: 8 } + start: { line: 1, column: 2 }, + end: { line: 1, column: 11 } } }, - init: null, - range: [7, 8], + prefix: true, + range: [0, 11], loc: { - start: { line: 1, column: 7 }, - end: { line: 1, column: 8 } + start: { line: 1, column: 0 }, + end: { line: 1, column: 11 } } - }], - kind: 'var', - range: [0, 9], + }, + range: [0, 11], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 9 } + end: { line: 1, column: 11 } } }, - 'var x = 42': { - type: 'VariableDeclaration', - declarations: [{ - type: 'VariableDeclarator', - id: { + '+x': { + type: 'ExpressionStatement', + expression: { + type: 'UnaryExpression', + operator: '+', + argument: { type: 'Identifier', name: 'x', - range: [4, 5], + range: [1, 2], loc: { - start: { line: 1, column: 4 }, - end: { line: 1, column: 5 } - } - }, - init: { - type: 'Literal', - value: 42, - raw: '42', - range: [8, 10], - loc: { - start: { line: 1, column: 8 }, - end: { line: 1, column: 10 } + start: { line: 1, column: 1 }, + end: { line: 1, column: 2 } } }, - range: [4, 10], + prefix: true, + range: [0, 2], loc: { - start: { line: 1, column: 4 }, - end: { line: 1, column: 10 } + start: { line: 1, column: 0 }, + end: { line: 1, column: 2 } } - }], - kind: 'var', - range: [0, 10], + }, + range: [0, 2], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 10 } + end: { line: 1, column: 2 } } }, - 'var eval = 42, arguments = 42': { - type: 'VariableDeclaration', - declarations: [{ - type: 'VariableDeclarator', - id: { + '-x': { + type: 'ExpressionStatement', + expression: { + type: 'UnaryExpression', + operator: '-', + argument: { type: 'Identifier', - name: 'eval', - range: [4, 8], - loc: { - start: { line: 1, column: 4 }, - end: { line: 1, column: 8 } - } - }, - init: { - type: 'Literal', - value: 42, - raw: '42', - range: [11, 13], + name: 'x', + range: [1, 2], loc: { - start: { line: 1, column: 11 }, - end: { line: 1, column: 13 } + start: { line: 1, column: 1 }, + end: { line: 1, column: 2 } } }, - range: [4, 13], + prefix: true, + range: [0, 2], loc: { - start: { line: 1, column: 4 }, - end: { line: 1, column: 13 } + start: { line: 1, column: 0 }, + end: { line: 1, column: 2 } } - }, { - type: 'VariableDeclarator', - id: { + }, + range: [0, 2], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 2 } + } + }, + + '~x': { + type: 'ExpressionStatement', + expression: { + type: 'UnaryExpression', + operator: '~', + argument: { type: 'Identifier', - name: 'arguments', - range: [15, 24], - loc: { - start: { line: 1, column: 15 }, - end: { line: 1, column: 24 } - } - }, - init: { - type: 'Literal', - value: 42, - raw: '42', - range: [27, 29], + name: 'x', + range: [1, 2], loc: { - start: { line: 1, column: 27 }, - end: { line: 1, column: 29 } + start: { line: 1, column: 1 }, + end: { line: 1, column: 2 } } }, - range: [15, 29], + prefix: true, + range: [0, 2], loc: { - start: { line: 1, column: 15 }, - end: { line: 1, column: 29 } + start: { line: 1, column: 0 }, + end: { line: 1, column: 2 } } - }], - kind: 'var', - range: [0, 29], + }, + range: [0, 2], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 29 } + end: { line: 1, column: 2 } } }, - 'var x = 14, y = 3, z = 1977': { - type: 'VariableDeclaration', - declarations: [{ - type: 'VariableDeclarator', - id: { + '!x': { + type: 'ExpressionStatement', + expression: { + type: 'UnaryExpression', + operator: '!', + argument: { type: 'Identifier', name: 'x', - range: [4, 5], - loc: { - start: { line: 1, column: 4 }, - end: { line: 1, column: 5 } - } - }, - init: { - type: 'Literal', - value: 14, - raw: '14', - range: [8, 10], + range: [1, 2], loc: { - start: { line: 1, column: 8 }, - end: { line: 1, column: 10 } + start: { line: 1, column: 1 }, + end: { line: 1, column: 2 } } }, - range: [4, 10], + prefix: true, + range: [0, 2], loc: { - start: { line: 1, column: 4 }, - end: { line: 1, column: 10 } + start: { line: 1, column: 0 }, + end: { line: 1, column: 2 } } - }, { - type: 'VariableDeclarator', - id: { + }, + range: [0, 2], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 2 } + } + }, + + 'void x': { + type: 'ExpressionStatement', + expression: { + type: 'UnaryExpression', + operator: 'void', + argument: { type: 'Identifier', - name: 'y', - range: [12, 13], - loc: { - start: { line: 1, column: 12 }, - end: { line: 1, column: 13 } - } - }, - init: { - type: 'Literal', - value: 3, - raw: '3', - range: [16, 17], + name: 'x', + range: [5, 6], loc: { - start: { line: 1, column: 16 }, - end: { line: 1, column: 17 } + start: { line: 1, column: 5 }, + end: { line: 1, column: 6 } } }, - range: [12, 17], + prefix: true, + range: [0, 6], loc: { - start: { line: 1, column: 12 }, - end: { line: 1, column: 17 } + start: { line: 1, column: 0 }, + end: { line: 1, column: 6 } } - }, { - type: 'VariableDeclarator', - id: { + }, + range: [0, 6], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 6 } + } + }, + + 'delete x': { + type: 'ExpressionStatement', + expression: { + type: 'UnaryExpression', + operator: 'delete', + argument: { type: 'Identifier', - name: 'z', - range: [19, 20], - loc: { - start: { line: 1, column: 19 }, - end: { line: 1, column: 20 } - } - }, - init: { - type: 'Literal', - value: 1977, - raw: '1977', - range: [23, 27], + name: 'x', + range: [7, 8], loc: { - start: { line: 1, column: 23 }, - end: { line: 1, column: 27 } + start: { line: 1, column: 7 }, + end: { line: 1, column: 8 } } }, - range: [19, 27], + prefix: true, + range: [0, 8], loc: { - start: { line: 1, column: 19 }, - end: { line: 1, column: 27 } + start: { line: 1, column: 0 }, + end: { line: 1, column: 8 } } - }], - kind: 'var', - range: [0, 27], + }, + range: [0, 8], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 27 } + end: { line: 1, column: 8 } } }, - 'var implements, interface, package': { - type: 'VariableDeclaration', - declarations: [{ - type: 'VariableDeclarator', - id: { + 'typeof x': { + type: 'ExpressionStatement', + expression: { + type: 'UnaryExpression', + operator: 'typeof', + argument: { type: 'Identifier', - name: 'implements', - range: [4, 14], + name: 'x', + range: [7, 8], loc: { - start: { line: 1, column: 4 }, - end: { line: 1, column: 14 } - } + start: { line: 1, column: 7 }, + end: { line: 1, column: 8 } + } }, - init: null, - range: [4, 14], + prefix: true, + range: [0, 8], loc: { - start: { line: 1, column: 4 }, - end: { line: 1, column: 14 } + start: { line: 1, column: 0 }, + end: { line: 1, column: 8 } } - }, { - type: 'VariableDeclarator', - id: { + }, + range: [0, 8], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 8 } + } + } + + }, + + 'Multiplicative Operators': { + + 'x * y': { + type: 'ExpressionStatement', + expression: { + type: 'BinaryExpression', + operator: '*', + left: { type: 'Identifier', - name: 'interface', - range: [16, 25], + name: 'x', + range: [0, 1], loc: { - start: { line: 1, column: 16 }, - end: { line: 1, column: 25 } + start: { line: 1, column: 0 }, + end: { line: 1, column: 1 } } }, - init: null, - range: [16, 25], - loc: { - start: { line: 1, column: 16 }, - end: { line: 1, column: 25 } - } - }, { - type: 'VariableDeclarator', - id: { + right: { type: 'Identifier', - name: 'package', - range: [27, 34], + name: 'y', + range: [4, 5], loc: { - start: { line: 1, column: 27 }, - end: { line: 1, column: 34 } + start: { line: 1, column: 4 }, + end: { line: 1, column: 5 } } }, - init: null, - range: [27, 34], + range: [0, 5], loc: { - start: { line: 1, column: 27 }, - end: { line: 1, column: 34 } + start: { line: 1, column: 0 }, + end: { line: 1, column: 5 } } - }], - kind: 'var', - range: [0, 34], + }, + range: [0, 5], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 34 } + end: { line: 1, column: 5 } } }, - 'var private, protected, public, static': { - type: 'VariableDeclaration', - declarations: [{ - type: 'VariableDeclarator', - id: { + 'x / y': { + type: 'ExpressionStatement', + expression: { + type: 'BinaryExpression', + operator: '/', + left: { type: 'Identifier', - name: 'private', - range: [4, 11], + name: 'x', + range: [0, 1], loc: { - start: { line: 1, column: 4 }, - end: { line: 1, column: 11 } + start: { line: 1, column: 0 }, + end: { line: 1, column: 1 } } }, - init: null, - range: [4, 11], - loc: { - start: { line: 1, column: 4 }, - end: { line: 1, column: 11 } - } - }, { - type: 'VariableDeclarator', - id: { + right: { type: 'Identifier', - name: 'protected', - range: [13, 22], + name: 'y', + range: [4, 5], loc: { - start: { line: 1, column: 13 }, - end: { line: 1, column: 22 } + start: { line: 1, column: 4 }, + end: { line: 1, column: 5 } } }, - init: null, - range: [13, 22], + range: [0, 5], loc: { - start: { line: 1, column: 13 }, - end: { line: 1, column: 22 } + start: { line: 1, column: 0 }, + end: { line: 1, column: 5 } } - }, { - type: 'VariableDeclarator', - id: { + }, + range: [0, 5], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 5 } + } + }, + + 'x % y': { + type: 'ExpressionStatement', + expression: { + type: 'BinaryExpression', + operator: '%', + left: { type: 'Identifier', - name: 'public', - range: [24, 30], + name: 'x', + range: [0, 1], loc: { - start: { line: 1, column: 24 }, - end: { line: 1, column: 30 } + start: { line: 1, column: 0 }, + end: { line: 1, column: 1 } } }, - init: null, - range: [24, 30], - loc: { - start: { line: 1, column: 24 }, - end: { line: 1, column: 30 } - } - }, { - type: 'VariableDeclarator', - id: { + right: { type: 'Identifier', - name: 'static', - range: [32, 38], + name: 'y', + range: [4, 5], loc: { - start: { line: 1, column: 32 }, - end: { line: 1, column: 38 } + start: { line: 1, column: 4 }, + end: { line: 1, column: 5 } } }, - init: null, - range: [32, 38], + range: [0, 5], loc: { - start: { line: 1, column: 32 }, - end: { line: 1, column: 38 } + start: { line: 1, column: 0 }, + end: { line: 1, column: 5 } } - }], - kind: 'var', - range: [0, 38], + }, + range: [0, 5], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 38 } + end: { line: 1, column: 5 } } } }, - 'Let Statement': { + 'Additive Operators': { - 'let x': { - type: 'VariableDeclaration', - declarations: [{ - type: 'VariableDeclarator', - id: { + 'x + y': { + type: 'ExpressionStatement', + expression: { + type: 'BinaryExpression', + operator: '+', + left: { type: 'Identifier', name: 'x', + range: [0, 1], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 1 } + } + }, + right: { + type: 'Identifier', + name: 'y', range: [4, 5], loc: { start: { line: 1, column: 4 }, end: { line: 1, column: 5 } } }, - init: null, - range: [4, 5], + range: [0, 5], loc: { - start: { line: 1, column: 4 }, + start: { line: 1, column: 0 }, end: { line: 1, column: 5 } } - }], - kind: 'let', + }, range: [0, 5], loc: { start: { line: 1, column: 0 }, @@ -10030,407 +10122,238 @@ var testFixture = { } }, - '{ let x }': { - type: 'BlockStatement', - body: [{ - type: 'VariableDeclaration', - declarations: [{ - type: 'VariableDeclarator', - id: { - type: 'Identifier', - name: 'x', - range: [6, 7], - loc: { - start: { line: 1, column: 6 }, - end: { line: 1, column: 7 } - } - }, - init: null, - range: [6, 7], + 'x - y': { + type: 'ExpressionStatement', + expression: { + type: 'BinaryExpression', + operator: '-', + left: { + type: 'Identifier', + name: 'x', + range: [0, 1], loc: { - start: { line: 1, column: 6 }, - end: { line: 1, column: 7 } + start: { line: 1, column: 0 }, + end: { line: 1, column: 1 } } - }], - kind: 'let', - range: [2, 8], + }, + right: { + type: 'Identifier', + name: 'y', + range: [4, 5], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 5 } + } + }, + range: [0, 5], loc: { - start: { line: 1, column: 2 }, - end: { line: 1, column: 8 } + start: { line: 1, column: 0 }, + end: { line: 1, column: 5 } } - }], - range: [0, 9], + }, + range: [0, 5], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 9 } + end: { line: 1, column: 5 } } }, - '{ let x = 42 }': { - type: 'BlockStatement', - body: [{ - type: 'VariableDeclaration', - declarations: [{ - type: 'VariableDeclarator', - id: { - type: 'Identifier', - name: 'x', - range: [6, 7], - loc: { - start: { line: 1, column: 6 }, - end: { line: 1, column: 7 } - } - }, - init: { - type: 'Literal', - value: 42, - raw: '42', - range: [10, 12], - loc: { - start: { line: 1, column: 10 }, - end: { line: 1, column: 12 } - } - }, - range: [6, 12], + '"use strict" + 42': { + type: 'ExpressionStatement', + expression: { + type: 'BinaryExpression', + operator: '+', + left: { + type: 'Literal', + value: 'use strict', + raw: '"use strict"', + range: [0, 12], loc: { - start: { line: 1, column: 6 }, + start: { line: 1, column: 0 }, end: { line: 1, column: 12 } } - }], - kind: 'let', - range: [2, 13], + }, + right: { + type: 'Literal', + value: 42, + raw: '42', + range: [15, 17], + loc: { + start: { line: 1, column: 15 }, + end: { line: 1, column: 17 } + } + }, + range: [0, 17], loc: { - start: { line: 1, column: 2 }, - end: { line: 1, column: 13 } + start: { line: 1, column: 0 }, + end: { line: 1, column: 17 } } - }], - range: [0, 14], + }, + range: [0, 17], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 14 } + end: { line: 1, column: 17 } } - }, + } - '{ let x = 14, y = 3, z = 1977 }': { - type: 'BlockStatement', - body: [{ - type: 'VariableDeclaration', - declarations: [{ - type: 'VariableDeclarator', - id: { - type: 'Identifier', - name: 'x', - range: [6, 7], - loc: { - start: { line: 1, column: 6 }, - end: { line: 1, column: 7 } - } - }, - init: { - type: 'Literal', - value: 14, - raw: '14', - range: [10, 12], - loc: { - start: { line: 1, column: 10 }, - end: { line: 1, column: 12 } - } - }, - range: [6, 12], - loc: { - start: { line: 1, column: 6 }, - end: { line: 1, column: 12 } - } - }, { - type: 'VariableDeclarator', - id: { - type: 'Identifier', - name: 'y', - range: [14, 15], - loc: { - start: { line: 1, column: 14 }, - end: { line: 1, column: 15 } - } - }, - init: { - type: 'Literal', - value: 3, - raw: '3', - range: [18, 19], - loc: { - start: { line: 1, column: 18 }, - end: { line: 1, column: 19 } - } - }, - range: [14, 19], + }, + + 'Bitwise Shift Operator': { + + 'x << y': { + type: 'ExpressionStatement', + expression: { + type: 'BinaryExpression', + operator: '<<', + left: { + type: 'Identifier', + name: 'x', + range: [0, 1], loc: { - start: { line: 1, column: 14 }, - end: { line: 1, column: 19 } + start: { line: 1, column: 0 }, + end: { line: 1, column: 1 } } - }, { - type: 'VariableDeclarator', - id: { - type: 'Identifier', - name: 'z', - range: [21, 22], - loc: { - start: { line: 1, column: 21 }, - end: { line: 1, column: 22 } - } - }, - init: { - type: 'Literal', - value: 1977, - raw: '1977', - range: [25, 29], - loc: { - start: { line: 1, column: 25 }, - end: { line: 1, column: 29 } - } - }, - range: [21, 29], + }, + right: { + type: 'Identifier', + name: 'y', + range: [5, 6], loc: { - start: { line: 1, column: 21 }, - end: { line: 1, column: 29 } + start: { line: 1, column: 5 }, + end: { line: 1, column: 6 } } - }], - kind: 'let', - range: [2, 30], + }, + range: [0, 6], loc: { - start: { line: 1, column: 2 }, - end: { line: 1, column: 30 } + start: { line: 1, column: 0 }, + end: { line: 1, column: 6 } } - }], - range: [0, 31], + }, + range: [0, 6], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 31 } + end: { line: 1, column: 6 } } - } - - }, - - 'Const Statement': { + }, - 'const x = 42': { - type: 'VariableDeclaration', - declarations: [{ - type: 'VariableDeclarator', - id: { + 'x >> y': { + type: 'ExpressionStatement', + expression: { + type: 'BinaryExpression', + operator: '>>', + left: { type: 'Identifier', name: 'x', - range: [6, 7], + range: [0, 1], loc: { - start: { line: 1, column: 6 }, - end: { line: 1, column: 7 } + start: { line: 1, column: 0 }, + end: { line: 1, column: 1 } } }, - init: { - type: 'Literal', - value: 42, - raw: '42', - range: [10, 12], + right: { + type: 'Identifier', + name: 'y', + range: [5, 6], loc: { - start: { line: 1, column: 10 }, - end: { line: 1, column: 12 } + start: { line: 1, column: 5 }, + end: { line: 1, column: 6 } } }, - range: [6, 12], + range: [0, 6], loc: { - start: { line: 1, column: 6 }, - end: { line: 1, column: 12 } + start: { line: 1, column: 0 }, + end: { line: 1, column: 6 } } - }], - kind: 'const', - range: [0, 12], + }, + range: [0, 6], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 12 } + end: { line: 1, column: 6 } } }, - '{ const x = 42 }': { - type: 'BlockStatement', - body: [{ - type: 'VariableDeclaration', - declarations: [{ - type: 'VariableDeclarator', - id: { - type: 'Identifier', - name: 'x', - range: [8, 9], - loc: { - start: { line: 1, column: 8 }, - end: { line: 1, column: 9 } - } - }, - init: { - type: 'Literal', - value: 42, - raw: '42', - range: [12, 14], - loc: { - start: { line: 1, column: 12 }, - end: { line: 1, column: 14 } - } - }, - range: [8, 14], - loc: { - start: { line: 1, column: 8 }, - end: { line: 1, column: 14 } - } - }], - kind: 'const', - range: [2, 15], - loc: { - start: { line: 1, column: 2 }, - end: { line: 1, column: 15 } - } - }], - range: [0, 16], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 16 } - } - }, - - '{ const x = 14, y = 3, z = 1977 }': { - type: 'BlockStatement', - body: [{ - type: 'VariableDeclaration', - declarations: [{ - type: 'VariableDeclarator', - id: { - type: 'Identifier', - name: 'x', - range: [8, 9], - loc: { - start: { line: 1, column: 8 }, - end: { line: 1, column: 9 } - } - }, - init: { - type: 'Literal', - value: 14, - raw: '14', - range: [12, 14], - loc: { - start: { line: 1, column: 12 }, - end: { line: 1, column: 14 } - } - }, - range: [8, 14], - loc: { - start: { line: 1, column: 8 }, - end: { line: 1, column: 14 } - } - }, { - type: 'VariableDeclarator', - id: { - type: 'Identifier', - name: 'y', - range: [16, 17], - loc: { - start: { line: 1, column: 16 }, - end: { line: 1, column: 17 } - } - }, - init: { - type: 'Literal', - value: 3, - raw: '3', - range: [20, 21], - loc: { - start: { line: 1, column: 20 }, - end: { line: 1, column: 21 } - } - }, - range: [16, 21], + 'x >>> y': { + type: 'ExpressionStatement', + expression: { + type: 'BinaryExpression', + operator: '>>>', + left: { + type: 'Identifier', + name: 'x', + range: [0, 1], loc: { - start: { line: 1, column: 16 }, - end: { line: 1, column: 21 } + start: { line: 1, column: 0 }, + end: { line: 1, column: 1 } } - }, { - type: 'VariableDeclarator', - id: { - type: 'Identifier', - name: 'z', - range: [23, 24], - loc: { - start: { line: 1, column: 23 }, - end: { line: 1, column: 24 } - } - }, - init: { - type: 'Literal', - value: 1977, - raw: '1977', - range: [27, 31], - loc: { - start: { line: 1, column: 27 }, - end: { line: 1, column: 31 } - } - }, - range: [23, 31], + }, + right: { + type: 'Identifier', + name: 'y', + range: [6, 7], loc: { - start: { line: 1, column: 23 }, - end: { line: 1, column: 31 } + start: { line: 1, column: 6 }, + end: { line: 1, column: 7 } } - }], - kind: 'const', - range: [2, 32], + }, + range: [0, 7], loc: { - start: { line: 1, column: 2 }, - end: { line: 1, column: 32 } + start: { line: 1, column: 0 }, + end: { line: 1, column: 7 } } - }], - range: [0, 33], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 33 } - } - } - - }, - - 'Empty Statement': { - - ';': { - type: 'EmptyStatement', - range: [0, 1], + }, + range: [0, 7], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 1 } + end: { line: 1, column: 7 } } } }, - 'Expression Statement': { + 'Relational Operators': { - 'x': { + 'x < y': { type: 'ExpressionStatement', expression: { - type: 'Identifier', - name: 'x', - range: [0, 1], + type: 'BinaryExpression', + operator: '<', + left: { + type: 'Identifier', + name: 'x', + range: [0, 1], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 1 } + } + }, + right: { + type: 'Identifier', + name: 'y', + range: [4, 5], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 5 } + } + }, + range: [0, 5], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 1 } + end: { line: 1, column: 5 } } }, - range: [0, 1], + range: [0, 5], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 1 } + end: { line: 1, column: 5 } } }, - 'x, y': { + 'x > y': { type: 'ExpressionStatement', expression: { - type: 'SequenceExpression', - expressions: [{ + type: 'BinaryExpression', + operator: '>', + left: { type: 'Identifier', name: 'x', range: [0, 1], @@ -10438,33 +10361,52 @@ var testFixture = { start: { line: 1, column: 0 }, end: { line: 1, column: 1 } } - }, { + }, + right: { type: 'Identifier', name: 'y', - range: [3, 4], + range: [4, 5], loc: { - start: { line: 1, column: 3 }, - end: { line: 1, column: 4 } + start: { line: 1, column: 4 }, + end: { line: 1, column: 5 } } - }], - range: [0, 4], + }, + range: [0, 5], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 4 } + end: { line: 1, column: 5 } } }, - range: [0, 4], + range: [0, 5], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 4 } + end: { line: 1, column: 5 } } }, - '\\u0061': { + 'x <= y': { type: 'ExpressionStatement', expression: { - type: 'Identifier', - name: 'a', + type: 'BinaryExpression', + operator: '<=', + left: { + type: 'Identifier', + name: 'x', + range: [0, 1], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 1 } + } + }, + right: { + type: 'Identifier', + name: 'y', + range: [5, 6], + loc: { + start: { line: 1, column: 5 }, + end: { line: 1, column: 6 } + } + }, range: [0, 6], loc: { start: { line: 1, column: 0 }, @@ -10478,753 +10420,692 @@ var testFixture = { } }, - 'a\\u0061': { + 'x >= y': { type: 'ExpressionStatement', expression: { - type: 'Identifier', - name: 'aa', - range: [0, 7], + type: 'BinaryExpression', + operator: '>=', + left: { + type: 'Identifier', + name: 'x', + range: [0, 1], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 1 } + } + }, + right: { + type: 'Identifier', + name: 'y', + range: [5, 6], + loc: { + start: { line: 1, column: 5 }, + end: { line: 1, column: 6 } + } + }, + range: [0, 6], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 7 } + end: { line: 1, column: 6 } } }, - range: [0, 7], + range: [0, 6], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 7 } + end: { line: 1, column: 6 } } }, - '\\ua': { + 'x in y': { type: 'ExpressionStatement', expression: { - type: 'Identifier', - name: 'ua', - range: [0, 3], + type: 'BinaryExpression', + operator: 'in', + left: { + type: 'Identifier', + name: 'x', + range: [0, 1], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 1 } + } + }, + right: { + type: 'Identifier', + name: 'y', + range: [5, 6], + loc: { + start: { line: 1, column: 5 }, + end: { line: 1, column: 6 } + } + }, + range: [0, 6], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 3 } + end: { line: 1, column: 6 } } }, - range: [0, 3], + range: [0, 6], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 3 } + end: { line: 1, column: 6 } } }, - 'a\\u': { + 'x instanceof y': { type: 'ExpressionStatement', expression: { - type: 'Identifier', - name: 'au', - range: [0, 3], + type: 'BinaryExpression', + operator: 'instanceof', + left: { + type: 'Identifier', + name: 'x', + range: [0, 1], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 1 } + } + }, + right: { + type: 'Identifier', + name: 'y', + range: [13, 14], + loc: { + start: { line: 1, column: 13 }, + end: { line: 1, column: 14 } + } + }, + range: [0, 14], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 3 } + end: { line: 1, column: 14 } } }, - range: [0, 3], + range: [0, 14], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 3 } + end: { line: 1, column: 14 } } - } - - }, - - 'If Statement': { + }, - 'if (morning) goodMorning()': { - type: 'IfStatement', - test: { - type: 'Identifier', - name: 'morning', - range: [4, 11], - loc: { - start: { line: 1, column: 4 }, - end: { line: 1, column: 11 } - } - }, - consequent: { - type: 'ExpressionStatement', - expression: { - type: 'CallExpression', - callee: { + 'x < y < z': { + type: 'ExpressionStatement', + expression: { + type: 'BinaryExpression', + operator: '<', + left: { + type: 'BinaryExpression', + operator: '<', + left: { type: 'Identifier', - name: 'goodMorning', - range: [13, 24], + name: 'x', + range: [0, 1], loc: { - start: { line: 1, column: 13 }, - end: { line: 1, column: 24 } + start: { line: 1, column: 0 }, + end: { line: 1, column: 1 } } }, - 'arguments': [], - range: [13, 26], + right: { + type: 'Identifier', + name: 'y', + range: [4, 5], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 5 } + } + }, + range: [0, 5], loc: { - start: { line: 1, column: 13 }, - end: { line: 1, column: 26 } + start: { line: 1, column: 0 }, + end: { line: 1, column: 5 } } }, - range: [13, 26], + right: { + type: 'Identifier', + name: 'z', + range: [8, 9], + loc: { + start: { line: 1, column: 8 }, + end: { line: 1, column: 9 } + } + }, + range: [0, 9], loc: { - start: { line: 1, column: 13 }, - end: { line: 1, column: 26 } + start: { line: 1, column: 0 }, + end: { line: 1, column: 9 } } }, - alternate: null, - range: [0, 26], + range: [0, 9], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 26 } + end: { line: 1, column: 9 } } - }, + } - 'if (morning) (function(){})': { - type: 'IfStatement', - test: { - type: 'Identifier', - name: 'morning', - range: [4, 11], - loc: { - start: { line: 1, column: 4 }, - end: { line: 1, column: 11 } - } - }, - consequent: { - type: 'ExpressionStatement', - expression: { - type: 'FunctionExpression', - id: null, - params: [], - defaults: [], - body: { - type: 'BlockStatement', - body: [], - range: [24, 26], - loc: { - start: { line: 1, column: 24 }, - end: { line: 1, column: 26 } - } - }, - rest: null, - generator: false, - expression: false, - range: [14, 26], + }, + + 'Equality Operators': { + + 'x == y': { + type: 'ExpressionStatement', + expression: { + type: 'BinaryExpression', + operator: '==', + left: { + type: 'Identifier', + name: 'x', + range: [0, 1], loc: { - start: { line: 1, column: 14 }, - end: { line: 1, column: 26 } + start: { line: 1, column: 0 }, + end: { line: 1, column: 1 } } }, - range: [13, 27], + right: { + type: 'Identifier', + name: 'y', + range: [5, 6], + loc: { + start: { line: 1, column: 5 }, + end: { line: 1, column: 6 } + } + }, + range: [0, 6], loc: { - start: { line: 1, column: 13 }, - end: { line: 1, column: 27 } + start: { line: 1, column: 0 }, + end: { line: 1, column: 6 } } }, - alternate: null, - range: [0, 27], + range: [0, 6], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 27 } + end: { line: 1, column: 6 } } }, - 'if (morning) var x = 0;': { - type: 'IfStatement', - test: { - type: 'Identifier', - name: 'morning', - range: [4, 11], + 'x != y': { + type: 'ExpressionStatement', + expression: { + type: 'BinaryExpression', + operator: '!=', + left: { + type: 'Identifier', + name: 'x', + range: [0, 1], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 1 } + } + }, + right: { + type: 'Identifier', + name: 'y', + range: [5, 6], + loc: { + start: { line: 1, column: 5 }, + end: { line: 1, column: 6 } + } + }, + range: [0, 6], loc: { - start: { line: 1, column: 4 }, - end: { line: 1, column: 11 } + start: { line: 1, column: 0 }, + end: { line: 1, column: 6 } } }, - consequent: { - type: 'VariableDeclaration', - declarations: [{ - type: 'VariableDeclarator', - id: { - type: 'Identifier', - name: 'x', - range: [17, 18], - loc: { - start: { line: 1, column: 17 }, - end: { line: 1, column: 18 } - } - }, - init: { - type: 'Literal', - value: 0, - raw: '0', - range: [21, 22], - loc: { - start: { line: 1, column: 21 }, - end: { line: 1, column: 22 } - } - }, - range: [17, 22], - loc: { - start: { line: 1, column: 17 }, - end: { line: 1, column: 22 } - } - }], - kind: 'var', - range: [13, 23], - loc: { - start: { line: 1, column: 13 }, - end: { line: 1, column: 23 } - } - }, - alternate: null, - range: [0, 23], + range: [0, 6], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 23 } + end: { line: 1, column: 6 } } }, - 'if (morning) function a(){}': { - type: 'IfStatement', - test: { - type: 'Identifier', - name: 'morning', - range: [4, 11], - loc: { - start: { line: 1, column: 4 }, - end: { line: 1, column: 11 } - } - }, - consequent: { - type: 'FunctionDeclaration', - id: { + 'x === y': { + type: 'ExpressionStatement', + expression: { + type: 'BinaryExpression', + operator: '===', + left: { type: 'Identifier', - name: 'a', - range: [22, 23], + name: 'x', + range: [0, 1], loc: { - start: { line: 1, column: 22 }, - end: { line: 1, column: 23 } + start: { line: 1, column: 0 }, + end: { line: 1, column: 1 } } }, - params: [], - defaults: [], - body: { - type: 'BlockStatement', - body: [], - range: [25, 27], + right: { + type: 'Identifier', + name: 'y', + range: [6, 7], loc: { - start: { line: 1, column: 25 }, - end: { line: 1, column: 27 } + start: { line: 1, column: 6 }, + end: { line: 1, column: 7 } } }, - rest: null, - generator: false, - expression: false, - range: [13, 27], + range: [0, 7], loc: { - start: { line: 1, column: 13 }, - end: { line: 1, column: 27 } + start: { line: 1, column: 0 }, + end: { line: 1, column: 7 } } }, - alternate: null, - range: [0, 27], + range: [0, 7], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 27 } + end: { line: 1, column: 7 } } }, - 'if (morning) goodMorning(); else goodDay()': { - type: 'IfStatement', - test: { - type: 'Identifier', - name: 'morning', - range: [4, 11], - loc: { - start: { line: 1, column: 4 }, - end: { line: 1, column: 11 } - } - }, - consequent: { - type: 'ExpressionStatement', - expression: { - type: 'CallExpression', - callee: { - type: 'Identifier', - name: 'goodMorning', - range: [13, 24], - loc: { - start: { line: 1, column: 13 }, - end: { line: 1, column: 24 } - } - }, - 'arguments': [], - range: [13, 26], + 'x !== y': { + type: 'ExpressionStatement', + expression: { + type: 'BinaryExpression', + operator: '!==', + left: { + type: 'Identifier', + name: 'x', + range: [0, 1], loc: { - start: { line: 1, column: 13 }, - end: { line: 1, column: 26 } + start: { line: 1, column: 0 }, + end: { line: 1, column: 1 } } }, - range: [13, 27], - loc: { - start: { line: 1, column: 13 }, - end: { line: 1, column: 27 } - } - }, - alternate: { - type: 'ExpressionStatement', - expression: { - type: 'CallExpression', - callee: { - type: 'Identifier', - name: 'goodDay', - range: [33, 40], - loc: { - start: { line: 1, column: 33 }, - end: { line: 1, column: 40 } - } - }, - 'arguments': [], - range: [33, 42], + right: { + type: 'Identifier', + name: 'y', + range: [6, 7], loc: { - start: { line: 1, column: 33 }, - end: { line: 1, column: 42 } + start: { line: 1, column: 6 }, + end: { line: 1, column: 7 } } }, - range: [33, 42], + range: [0, 7], loc: { - start: { line: 1, column: 33 }, - end: { line: 1, column: 42 } + start: { line: 1, column: 0 }, + end: { line: 1, column: 7 } } }, - range: [0, 42], + range: [0, 7], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 42 } + end: { line: 1, column: 7 } } } }, - 'Iteration Statements': { + 'Binary Bitwise Operators': { - 'do keep(); while (true)': { - type: 'DoWhileStatement', - body: { - type: 'ExpressionStatement', - expression: { - type: 'CallExpression', - callee: { - type: 'Identifier', - name: 'keep', - range: [3, 7], - loc: { - start: { line: 1, column: 3 }, - end: { line: 1, column: 7 } - } - }, - 'arguments': [], - range: [3, 9], + 'x & y': { + type: 'ExpressionStatement', + expression: { + type: 'BinaryExpression', + operator: '&', + left: { + type: 'Identifier', + name: 'x', + range: [0, 1], loc: { - start: { line: 1, column: 3 }, - end: { line: 1, column: 9 } + start: { line: 1, column: 0 }, + end: { line: 1, column: 1 } } }, - range: [3, 10], - loc: { - start: { line: 1, column: 3 }, - end: { line: 1, column: 10 } - } - }, - test: { - type: 'Literal', - value: true, - raw: 'true', - range: [18, 22], + right: { + type: 'Identifier', + name: 'y', + range: [4, 5], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 5 } + } + }, + range: [0, 5], loc: { - start: { line: 1, column: 18 }, - end: { line: 1, column: 22 } + start: { line: 1, column: 0 }, + end: { line: 1, column: 5 } } }, - range: [0, 23], + range: [0, 5], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 23 } + end: { line: 1, column: 5 } } }, - 'do keep(); while (true);': { - type: 'DoWhileStatement', - body: { - type: 'ExpressionStatement', - expression: { - type: 'CallExpression', - callee: { - type: 'Identifier', - name: 'keep', - range: [3, 7], - loc: { - start: { line: 1, column: 3 }, - end: { line: 1, column: 7 } - } - }, - 'arguments': [], - range: [3, 9], + 'x ^ y': { + type: 'ExpressionStatement', + expression: { + type: 'BinaryExpression', + operator: '^', + left: { + type: 'Identifier', + name: 'x', + range: [0, 1], loc: { - start: { line: 1, column: 3 }, - end: { line: 1, column: 9 } + start: { line: 1, column: 0 }, + end: { line: 1, column: 1 } } }, - range: [3, 10], - loc: { - start: { line: 1, column: 3 }, - end: { line: 1, column: 10 } - } - }, - test: { - type: 'Literal', - value: true, - raw: 'true', - range: [18, 22], + right: { + type: 'Identifier', + name: 'y', + range: [4, 5], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 5 } + } + }, + range: [0, 5], loc: { - start: { line: 1, column: 18 }, - end: { line: 1, column: 22 } + start: { line: 1, column: 0 }, + end: { line: 1, column: 5 } } }, - range: [0, 24], + range: [0, 5], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 24 } + end: { line: 1, column: 5 } } }, - 'do { x++; y--; } while (x < 10)': { - type: 'DoWhileStatement', - body: { - type: 'BlockStatement', - body: [{ - type: 'ExpressionStatement', - expression: { - type: 'UpdateExpression', - operator: '++', - argument: { - type: 'Identifier', - name: 'x', - range: [5, 6], - loc: { - start: { line: 1, column: 5 }, - end: { line: 1, column: 6 } - } - }, - prefix: false, - range: [5, 8], - loc: { - start: { line: 1, column: 5 }, - end: { line: 1, column: 8 } - } - }, - range: [5, 9], + 'x | y': { + type: 'ExpressionStatement', + expression: { + type: 'BinaryExpression', + operator: '|', + left: { + type: 'Identifier', + name: 'x', + range: [0, 1], loc: { - start: { line: 1, column: 5 }, - end: { line: 1, column: 9 } + start: { line: 1, column: 0 }, + end: { line: 1, column: 1 } } - }, { - type: 'ExpressionStatement', - expression: { - type: 'UpdateExpression', - operator: '--', - argument: { - type: 'Identifier', - name: 'y', - range: [10, 11], - loc: { - start: { line: 1, column: 10 }, - end: { line: 1, column: 11 } - } - }, - prefix: false, - range: [10, 13], - loc: { - start: { line: 1, column: 10 }, - end: { line: 1, column: 13 } - } - }, - range: [10, 14], + }, + right: { + type: 'Identifier', + name: 'y', + range: [4, 5], loc: { - start: { line: 1, column: 10 }, - end: { line: 1, column: 14 } + start: { line: 1, column: 4 }, + end: { line: 1, column: 5 } } - }], - range: [3, 16], + }, + range: [0, 5], loc: { - start: { line: 1, column: 3 }, - end: { line: 1, column: 16 } + start: { line: 1, column: 0 }, + end: { line: 1, column: 5 } } }, - test: { + range: [0, 5], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 5 } + } + } + + }, + + 'Binary Expressions': { + + 'x + y + z': { + type: 'ExpressionStatement', + expression: { type: 'BinaryExpression', - operator: '<', + operator: '+', left: { - type: 'Identifier', - name: 'x', - range: [24, 25], + type: 'BinaryExpression', + operator: '+', + left: { + type: 'Identifier', + name: 'x', + range: [0, 1], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 1 } + } + }, + right: { + type: 'Identifier', + name: 'y', + range: [4, 5], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 5 } + } + }, + range: [0, 5], loc: { - start: { line: 1, column: 24 }, - end: { line: 1, column: 25 } + start: { line: 1, column: 0 }, + end: { line: 1, column: 5 } } }, right: { - type: 'Literal', - value: 10, - raw: '10', - range: [28, 30], + type: 'Identifier', + name: 'z', + range: [8, 9], loc: { - start: { line: 1, column: 28 }, - end: { line: 1, column: 30 } + start: { line: 1, column: 8 }, + end: { line: 1, column: 9 } } }, - range: [24, 30], + range: [0, 9], loc: { - start: { line: 1, column: 24 }, - end: { line: 1, column: 30 } + start: { line: 1, column: 0 }, + end: { line: 1, column: 9 } } }, - range: [0, 31], + range: [0, 9], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 31 } + end: { line: 1, column: 9 } } }, - '{ do { } while (false) false }': { - type: 'BlockStatement', - body: [{ - type: 'DoWhileStatement', - body: { - type: 'BlockStatement', - body: [], - range: [5, 8], - loc: { - start: { line: 1, column: 5 }, - end: { line: 1, column: 8 } - } - }, - test: { - type: 'Literal', - value: false, - raw: 'false', - range: [16, 21], + 'x - y + z': { + type: 'ExpressionStatement', + expression: { + type: 'BinaryExpression', + operator: '+', + left: { + type: 'BinaryExpression', + operator: '-', + left: { + type: 'Identifier', + name: 'x', + range: [0, 1], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 1 } + } + }, + right: { + type: 'Identifier', + name: 'y', + range: [4, 5], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 5 } + } + }, + range: [0, 5], loc: { - start: { line: 1, column: 16 }, - end: { line: 1, column: 21 } + start: { line: 1, column: 0 }, + end: { line: 1, column: 5 } } }, - range: [2, 22], - loc: { - start: { line: 1, column: 2 }, - end: { line: 1, column: 22 } - } - }, { - type: 'ExpressionStatement', - expression: { - type: 'Literal', - value: false, - raw: 'false', - range: [23, 28], + right: { + type: 'Identifier', + name: 'z', + range: [8, 9], loc: { - start: { line: 1, column: 23 }, - end: { line: 1, column: 28 } + start: { line: 1, column: 8 }, + end: { line: 1, column: 9 } } }, - range: [23, 29], + range: [0, 9], loc: { - start: { line: 1, column: 23 }, - end: { line: 1, column: 29 } + start: { line: 1, column: 0 }, + end: { line: 1, column: 9 } } - }], - range: [0, 30], + }, + range: [0, 9], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 30 } + end: { line: 1, column: 9 } } }, - 'while (true) doSomething()': { - type: 'WhileStatement', - test: { - type: 'Literal', - value: true, - raw: 'true', - range: [7, 11], - loc: { - start: { line: 1, column: 7 }, - end: { line: 1, column: 11 } - } - }, - body: { - type: 'ExpressionStatement', - expression: { - type: 'CallExpression', - callee: { + 'x + y - z': { + type: 'ExpressionStatement', + expression: { + type: 'BinaryExpression', + operator: '-', + left: { + type: 'BinaryExpression', + operator: '+', + left: { type: 'Identifier', - name: 'doSomething', - range: [13, 24], + name: 'x', + range: [0, 1], loc: { - start: { line: 1, column: 13 }, - end: { line: 1, column: 24 } + start: { line: 1, column: 0 }, + end: { line: 1, column: 1 } } }, - 'arguments': [], - range: [13, 26], + right: { + type: 'Identifier', + name: 'y', + range: [4, 5], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 5 } + } + }, + range: [0, 5], loc: { - start: { line: 1, column: 13 }, - end: { line: 1, column: 26 } + start: { line: 1, column: 0 }, + end: { line: 1, column: 5 } } }, - range: [13, 26], + right: { + type: 'Identifier', + name: 'z', + range: [8, 9], + loc: { + start: { line: 1, column: 8 }, + end: { line: 1, column: 9 } + } + }, + range: [0, 9], loc: { - start: { line: 1, column: 13 }, - end: { line: 1, column: 26 } + start: { line: 1, column: 0 }, + end: { line: 1, column: 9 } } }, - range: [0, 26], + range: [0, 9], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 26 } + end: { line: 1, column: 9 } } }, - 'while (x < 10) { x++; y--; }': { - type: 'WhileStatement', - test: { + 'x - y - z': { + type: 'ExpressionStatement', + expression: { type: 'BinaryExpression', - operator: '<', + operator: '-', left: { - type: 'Identifier', - name: 'x', - range: [7, 8], + type: 'BinaryExpression', + operator: '-', + left: { + type: 'Identifier', + name: 'x', + range: [0, 1], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 1 } + } + }, + right: { + type: 'Identifier', + name: 'y', + range: [4, 5], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 5 } + } + }, + range: [0, 5], loc: { - start: { line: 1, column: 7 }, - end: { line: 1, column: 8 } + start: { line: 1, column: 0 }, + end: { line: 1, column: 5 } } }, right: { - type: 'Literal', - value: 10, - raw: '10', - range: [11, 13], + type: 'Identifier', + name: 'z', + range: [8, 9], loc: { - start: { line: 1, column: 11 }, - end: { line: 1, column: 13 } + start: { line: 1, column: 8 }, + end: { line: 1, column: 9 } } }, - range: [7, 13], + range: [0, 9], loc: { - start: { line: 1, column: 7 }, - end: { line: 1, column: 13 } + start: { line: 1, column: 0 }, + end: { line: 1, column: 9 } } }, - body: { - type: 'BlockStatement', - body: [{ - type: 'ExpressionStatement', - expression: { - type: 'UpdateExpression', - operator: '++', - argument: { - type: 'Identifier', - name: 'x', - range: [17, 18], - loc: { - start: { line: 1, column: 17 }, - end: { line: 1, column: 18 } - } - }, - prefix: false, - range: [17, 20], + range: [0, 9], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 9 } + } + }, + + 'x + y * z': { + type: 'ExpressionStatement', + expression: { + type: 'BinaryExpression', + operator: '+', + left: { + type: 'Identifier', + name: 'x', + range: [0, 1], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 1 } + } + }, + right: { + type: 'BinaryExpression', + operator: '*', + left: { + type: 'Identifier', + name: 'y', + range: [4, 5], loc: { - start: { line: 1, column: 17 }, - end: { line: 1, column: 20 } + start: { line: 1, column: 4 }, + end: { line: 1, column: 5 } } }, - range: [17, 21], - loc: { - start: { line: 1, column: 17 }, - end: { line: 1, column: 21 } - } - }, { - type: 'ExpressionStatement', - expression: { - type: 'UpdateExpression', - operator: '--', - argument: { - type: 'Identifier', - name: 'y', - range: [22, 23], - loc: { - start: { line: 1, column: 22 }, - end: { line: 1, column: 23 } - } - }, - prefix: false, - range: [22, 25], + right: { + type: 'Identifier', + name: 'z', + range: [8, 9], loc: { - start: { line: 1, column: 22 }, - end: { line: 1, column: 25 } + start: { line: 1, column: 8 }, + end: { line: 1, column: 9 } } }, - range: [22, 26], + range: [4, 9], loc: { - start: { line: 1, column: 22 }, - end: { line: 1, column: 26 } + start: { line: 1, column: 4 }, + end: { line: 1, column: 9 } } - }], - range: [15, 28], - loc: { - start: { line: 1, column: 15 }, - end: { line: 1, column: 28 } - } - }, - range: [0, 28], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 28 } - } - }, - - 'for(;;);': { - type: 'ForStatement', - init: null, - test: null, - update: null, - body: { - type: 'EmptyStatement', - range: [7, 8], - loc: { - start: { line: 1, column: 7 }, - end: { line: 1, column: 8 } - } - }, - range: [0, 8], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 8 } - } - }, - - 'for(;;){}': { - type: 'ForStatement', - init: null, - test: null, - update: null, - body: { - type: 'BlockStatement', - body: [], - range: [7, 9], + }, + range: [0, 9], loc: { - start: { line: 1, column: 7 }, + start: { line: 1, column: 0 }, end: { line: 1, column: 9 } } }, @@ -11235,3647 +11116,4201 @@ var testFixture = { } }, - 'for(x = 0;;);': { - type: 'ForStatement', - init: { - type: 'AssignmentExpression', - operator: '=', - left: { - type: 'Identifier', + 'x + y / z': { + type: 'ExpressionStatement', + expression: { + type: 'BinaryExpression', + operator: '+', + left: { + type: 'Identifier', name: 'x', - range: [4, 5], + range: [0, 1], loc: { - start: { line: 1, column: 4 }, - end: { line: 1, column: 5 } + start: { line: 1, column: 0 }, + end: { line: 1, column: 1 } } }, right: { - type: 'Literal', - value: 0, - raw: '0', - range: [8, 9], + type: 'BinaryExpression', + operator: '/', + left: { + type: 'Identifier', + name: 'y', + range: [4, 5], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 5 } + } + }, + right: { + type: 'Identifier', + name: 'z', + range: [8, 9], + loc: { + start: { line: 1, column: 8 }, + end: { line: 1, column: 9 } + } + }, + range: [4, 9], loc: { - start: { line: 1, column: 8 }, + start: { line: 1, column: 4 }, end: { line: 1, column: 9 } } }, - range: [4, 9], + range: [0, 9], loc: { - start: { line: 1, column: 4 }, + start: { line: 1, column: 0 }, end: { line: 1, column: 9 } } }, - test: null, - update: null, - body: { - type: 'EmptyStatement', - range: [12, 13], - loc: { - start: { line: 1, column: 12 }, - end: { line: 1, column: 13 } - } - }, - range: [0, 13], + range: [0, 9], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 13 } + end: { line: 1, column: 9 } } }, - 'for(var x = 0;;);': { - type: 'ForStatement', - init: { - type: 'VariableDeclaration', - declarations: [{ - type: 'VariableDeclarator', - id: { + 'x - y % z': { + type: 'ExpressionStatement', + expression: { + type: 'BinaryExpression', + operator: '-', + left: { + type: 'Identifier', + name: 'x', + range: [0, 1], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 1 } + } + }, + right: { + type: 'BinaryExpression', + operator: '%', + left: { type: 'Identifier', - name: 'x', - range: [8, 9], + name: 'y', + range: [4, 5], loc: { - start: { line: 1, column: 8 }, - end: { line: 1, column: 9 } + start: { line: 1, column: 4 }, + end: { line: 1, column: 5 } } }, - init: { - type: 'Literal', - value: 0, - raw: '0', - range: [12, 13], + right: { + type: 'Identifier', + name: 'z', + range: [8, 9], loc: { - start: { line: 1, column: 12 }, - end: { line: 1, column: 13 } + start: { line: 1, column: 8 }, + end: { line: 1, column: 9 } } }, - range: [8, 13], + range: [4, 9], loc: { - start: { line: 1, column: 8 }, - end: { line: 1, column: 13 } + start: { line: 1, column: 4 }, + end: { line: 1, column: 9 } } - }], - kind: 'var', - range: [4, 13], - loc: { - start: { line: 1, column: 4 }, - end: { line: 1, column: 13 } - } - }, - test: null, - update: null, - body: { - type: 'EmptyStatement', - range: [16, 17], + }, + range: [0, 9], loc: { - start: { line: 1, column: 16 }, - end: { line: 1, column: 17 } + start: { line: 1, column: 0 }, + end: { line: 1, column: 9 } } }, - range: [0, 17], + range: [0, 9], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 17 } + end: { line: 1, column: 9 } } }, - 'for(let x = 0;;);': { - type: 'ForStatement', - init: { - type: 'VariableDeclaration', - declarations: [{ - type: 'VariableDeclarator', - id: { + 'x * y * z': { + type: 'ExpressionStatement', + expression: { + type: 'BinaryExpression', + operator: '*', + left: { + type: 'BinaryExpression', + operator: '*', + left: { type: 'Identifier', name: 'x', - range: [8, 9], + range: [0, 1], loc: { - start: { line: 1, column: 8 }, - end: { line: 1, column: 9 } + start: { line: 1, column: 0 }, + end: { line: 1, column: 1 } } }, - init: { - type: 'Literal', - value: 0, - raw: '0', - range: [12, 13], + right: { + type: 'Identifier', + name: 'y', + range: [4, 5], loc: { - start: { line: 1, column: 12 }, - end: { line: 1, column: 13 } + start: { line: 1, column: 4 }, + end: { line: 1, column: 5 } } }, - range: [8, 13], + range: [0, 5], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 5 } + } + }, + right: { + type: 'Identifier', + name: 'z', + range: [8, 9], loc: { start: { line: 1, column: 8 }, - end: { line: 1, column: 13 } + end: { line: 1, column: 9 } } - }], - kind: 'let', - range: [4, 13], - loc: { - start: { line: 1, column: 4 }, - end: { line: 1, column: 13 } - } - }, - test: null, - update: null, - body: { - type: 'EmptyStatement', - range: [16, 17], + }, + range: [0, 9], loc: { - start: { line: 1, column: 16 }, - end: { line: 1, column: 17 } + start: { line: 1, column: 0 }, + end: { line: 1, column: 9 } } }, - range: [0, 17], + range: [0, 9], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 17 } + end: { line: 1, column: 9 } } }, - 'for(var x = 0, y = 1;;);': { - type: 'ForStatement', - init: { - type: 'VariableDeclaration', - declarations: [{ - type: 'VariableDeclarator', - id: { + 'x * y / z': { + type: 'ExpressionStatement', + expression: { + type: 'BinaryExpression', + operator: '/', + left: { + type: 'BinaryExpression', + operator: '*', + left: { type: 'Identifier', name: 'x', - range: [8, 9], + range: [0, 1], loc: { - start: { line: 1, column: 8 }, - end: { line: 1, column: 9 } + start: { line: 1, column: 0 }, + end: { line: 1, column: 1 } } }, - init: { - type: 'Literal', - value: 0, - raw: '0', - range: [12, 13], + right: { + type: 'Identifier', + name: 'y', + range: [4, 5], loc: { - start: { line: 1, column: 12 }, - end: { line: 1, column: 13 } + start: { line: 1, column: 4 }, + end: { line: 1, column: 5 } } }, - range: [8, 13], + range: [0, 5], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 5 } + } + }, + right: { + type: 'Identifier', + name: 'z', + range: [8, 9], loc: { start: { line: 1, column: 8 }, - end: { line: 1, column: 13 } + end: { line: 1, column: 9 } } - }, { - type: 'VariableDeclarator', - id: { - type: 'Identifier', - name: 'y', - range: [15, 16], + }, + range: [0, 9], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 9 } + } + }, + range: [0, 9], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 9 } + } + }, + + 'x * y % z': { + type: 'ExpressionStatement', + expression: { + type: 'BinaryExpression', + operator: '%', + left: { + type: 'BinaryExpression', + operator: '*', + left: { + type: 'Identifier', + name: 'x', + range: [0, 1], loc: { - start: { line: 1, column: 15 }, - end: { line: 1, column: 16 } + start: { line: 1, column: 0 }, + end: { line: 1, column: 1 } } }, - init: { - type: 'Literal', - value: 1, - raw: '1', - range: [19, 20], + right: { + type: 'Identifier', + name: 'y', + range: [4, 5], loc: { - start: { line: 1, column: 19 }, - end: { line: 1, column: 20 } + start: { line: 1, column: 4 }, + end: { line: 1, column: 5 } } }, - range: [15, 20], + range: [0, 5], loc: { - start: { line: 1, column: 15 }, - end: { line: 1, column: 20 } + start: { line: 1, column: 0 }, + end: { line: 1, column: 5 } } - }], - kind: 'var', - range: [4, 20], - loc: { - start: { line: 1, column: 4 }, - end: { line: 1, column: 20 } - } - }, - test: null, - update: null, - body: { - type: 'EmptyStatement', - range: [23, 24], + }, + right: { + type: 'Identifier', + name: 'z', + range: [8, 9], + loc: { + start: { line: 1, column: 8 }, + end: { line: 1, column: 9 } + } + }, + range: [0, 9], loc: { - start: { line: 1, column: 23 }, - end: { line: 1, column: 24 } + start: { line: 1, column: 0 }, + end: { line: 1, column: 9 } } }, - range: [0, 24], + range: [0, 9], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 24 } + end: { line: 1, column: 9 } } }, - 'for(x = 0; x < 42;);': { - type: 'ForStatement', - init: { - type: 'AssignmentExpression', - operator: '=', + 'x % y * z': { + type: 'ExpressionStatement', + expression: { + type: 'BinaryExpression', + operator: '*', left: { - type: 'Identifier', - name: 'x', - range: [4, 5], + type: 'BinaryExpression', + operator: '%', + left: { + type: 'Identifier', + name: 'x', + range: [0, 1], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 1 } + } + }, + right: { + type: 'Identifier', + name: 'y', + range: [4, 5], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 5 } + } + }, + range: [0, 5], loc: { - start: { line: 1, column: 4 }, + start: { line: 1, column: 0 }, end: { line: 1, column: 5 } } }, right: { - type: 'Literal', - value: 0, - raw: '0', + type: 'Identifier', + name: 'z', range: [8, 9], loc: { start: { line: 1, column: 8 }, end: { line: 1, column: 9 } } }, - range: [4, 9], + range: [0, 9], loc: { - start: { line: 1, column: 4 }, + start: { line: 1, column: 0 }, end: { line: 1, column: 9 } } }, - test: { + range: [0, 9], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 9 } + } + }, + + 'x << y << z': { + type: 'ExpressionStatement', + expression: { type: 'BinaryExpression', - operator: '<', + operator: '<<', left: { - type: 'Identifier', - name: 'x', - range: [11, 12], + type: 'BinaryExpression', + operator: '<<', + left: { + type: 'Identifier', + name: 'x', + range: [0, 1], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 1 } + } + }, + right: { + type: 'Identifier', + name: 'y', + range: [5, 6], + loc: { + start: { line: 1, column: 5 }, + end: { line: 1, column: 6 } + } + }, + range: [0, 6], loc: { - start: { line: 1, column: 11 }, - end: { line: 1, column: 12 } + start: { line: 1, column: 0 }, + end: { line: 1, column: 6 } } }, right: { - type: 'Literal', - value: 42, - raw: '42', - range: [15, 17], + type: 'Identifier', + name: 'z', + range: [10, 11], loc: { - start: { line: 1, column: 15 }, - end: { line: 1, column: 17 } + start: { line: 1, column: 10 }, + end: { line: 1, column: 11 } } }, - range: [11, 17], - loc: { - start: { line: 1, column: 11 }, - end: { line: 1, column: 17 } - } - }, - update: null, - body: { - type: 'EmptyStatement', - range: [19, 20], + range: [0, 11], loc: { - start: { line: 1, column: 19 }, - end: { line: 1, column: 20 } + start: { line: 1, column: 0 }, + end: { line: 1, column: 11 } } }, - range: [0, 20], + range: [0, 11], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 20 } + end: { line: 1, column: 11 } } }, - 'for(x = 0; x < 42; x++);': { - type: 'ForStatement', - init: { - type: 'AssignmentExpression', - operator: '=', + 'x | y | z': { + type: 'ExpressionStatement', + expression: { + type: 'BinaryExpression', + operator: '|', left: { - type: 'Identifier', - name: 'x', - range: [4, 5], + type: 'BinaryExpression', + operator: '|', + left: { + type: 'Identifier', + name: 'x', + range: [0, 1], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 1 } + } + }, + right: { + type: 'Identifier', + name: 'y', + range: [4, 5], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 5 } + } + }, + range: [0, 5], loc: { - start: { line: 1, column: 4 }, + start: { line: 1, column: 0 }, end: { line: 1, column: 5 } } }, right: { - type: 'Literal', - value: 0, - raw: '0', + type: 'Identifier', + name: 'z', range: [8, 9], loc: { start: { line: 1, column: 8 }, end: { line: 1, column: 9 } } }, - range: [4, 9], + range: [0, 9], loc: { - start: { line: 1, column: 4 }, + start: { line: 1, column: 0 }, end: { line: 1, column: 9 } } }, - test: { + range: [0, 9], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 9 } + } + }, + + 'x & y & z': { + type: 'ExpressionStatement', + expression: { type: 'BinaryExpression', - operator: '<', + operator: '&', left: { - type: 'Identifier', - name: 'x', - range: [11, 12], + type: 'BinaryExpression', + operator: '&', + left: { + type: 'Identifier', + name: 'x', + range: [0, 1], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 1 } + } + }, + right: { + type: 'Identifier', + name: 'y', + range: [4, 5], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 5 } + } + }, + range: [0, 5], loc: { - start: { line: 1, column: 11 }, - end: { line: 1, column: 12 } + start: { line: 1, column: 0 }, + end: { line: 1, column: 5 } } }, right: { - type: 'Literal', - value: 42, - raw: '42', - range: [15, 17], - loc: { - start: { line: 1, column: 15 }, - end: { line: 1, column: 17 } - } - }, - range: [11, 17], - loc: { - start: { line: 1, column: 11 }, - end: { line: 1, column: 17 } - } - }, - update: { - type: 'UpdateExpression', - operator: '++', - argument: { type: 'Identifier', - name: 'x', - range: [19, 20], + name: 'z', + range: [8, 9], loc: { - start: { line: 1, column: 19 }, - end: { line: 1, column: 20 } + start: { line: 1, column: 8 }, + end: { line: 1, column: 9 } } }, - prefix: false, - range: [19, 22], - loc: { - start: { line: 1, column: 19 }, - end: { line: 1, column: 22 } - } - }, - body: { - type: 'EmptyStatement', - range: [23, 24], + range: [0, 9], loc: { - start: { line: 1, column: 23 }, - end: { line: 1, column: 24 } + start: { line: 1, column: 0 }, + end: { line: 1, column: 9 } } }, - range: [0, 24], + range: [0, 9], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 24 } + end: { line: 1, column: 9 } } }, - 'for(x = 0; x < 42; x++) process(x);': { - type: 'ForStatement', - init: { - type: 'AssignmentExpression', - operator: '=', + 'x ^ y ^ z': { + type: 'ExpressionStatement', + expression: { + type: 'BinaryExpression', + operator: '^', left: { - type: 'Identifier', - name: 'x', - range: [4, 5], + type: 'BinaryExpression', + operator: '^', + left: { + type: 'Identifier', + name: 'x', + range: [0, 1], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 1 } + } + }, + right: { + type: 'Identifier', + name: 'y', + range: [4, 5], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 5 } + } + }, + range: [0, 5], loc: { - start: { line: 1, column: 4 }, + start: { line: 1, column: 0 }, end: { line: 1, column: 5 } } }, right: { - type: 'Literal', - value: 0, - raw: '0', + type: 'Identifier', + name: 'z', range: [8, 9], loc: { start: { line: 1, column: 8 }, end: { line: 1, column: 9 } } }, - range: [4, 9], + range: [0, 9], loc: { - start: { line: 1, column: 4 }, + start: { line: 1, column: 0 }, end: { line: 1, column: 9 } } }, - test: { + range: [0, 9], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 9 } + } + }, + + 'x & y | z': { + type: 'ExpressionStatement', + expression: { type: 'BinaryExpression', - operator: '<', + operator: '|', left: { - type: 'Identifier', - name: 'x', - range: [11, 12], + type: 'BinaryExpression', + operator: '&', + left: { + type: 'Identifier', + name: 'x', + range: [0, 1], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 1 } + } + }, + right: { + type: 'Identifier', + name: 'y', + range: [4, 5], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 5 } + } + }, + range: [0, 5], loc: { - start: { line: 1, column: 11 }, - end: { line: 1, column: 12 } + start: { line: 1, column: 0 }, + end: { line: 1, column: 5 } } }, right: { - type: 'Literal', - value: 42, - raw: '42', - range: [15, 17], + type: 'Identifier', + name: 'z', + range: [8, 9], loc: { - start: { line: 1, column: 15 }, - end: { line: 1, column: 17 } + start: { line: 1, column: 8 }, + end: { line: 1, column: 9 } } }, - range: [11, 17], + range: [0, 9], loc: { - start: { line: 1, column: 11 }, - end: { line: 1, column: 17 } + start: { line: 1, column: 0 }, + end: { line: 1, column: 9 } } }, - update: { - type: 'UpdateExpression', - operator: '++', - argument: { + range: [0, 9], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 9 } + } + }, + + 'x | y ^ z': { + type: 'ExpressionStatement', + expression: { + type: 'BinaryExpression', + operator: '|', + left: { type: 'Identifier', name: 'x', - range: [19, 20], + range: [0, 1], loc: { - start: { line: 1, column: 19 }, - end: { line: 1, column: 20 } + start: { line: 1, column: 0 }, + end: { line: 1, column: 1 } } }, - prefix: false, - range: [19, 22], - loc: { - start: { line: 1, column: 19 }, - end: { line: 1, column: 22 } - } - }, - body: { - type: 'ExpressionStatement', - expression: { - type: 'CallExpression', - callee: { + right: { + type: 'BinaryExpression', + operator: '^', + left: { type: 'Identifier', - name: 'process', - range: [24, 31], + name: 'y', + range: [4, 5], loc: { - start: { line: 1, column: 24 }, - end: { line: 1, column: 31 } + start: { line: 1, column: 4 }, + end: { line: 1, column: 5 } } }, - 'arguments': [{ + right: { type: 'Identifier', - name: 'x', - range: [32, 33], + name: 'z', + range: [8, 9], loc: { - start: { line: 1, column: 32 }, - end: { line: 1, column: 33 } + start: { line: 1, column: 8 }, + end: { line: 1, column: 9 } } - }], - range: [24, 34], + }, + range: [4, 9], loc: { - start: { line: 1, column: 24 }, - end: { line: 1, column: 34 } + start: { line: 1, column: 4 }, + end: { line: 1, column: 9 } } }, - range: [24, 35], + range: [0, 9], loc: { - start: { line: 1, column: 24 }, - end: { line: 1, column: 35 } + start: { line: 1, column: 0 }, + end: { line: 1, column: 9 } } }, - range: [0, 35], + range: [0, 9], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 35 } + end: { line: 1, column: 9 } } }, - 'for(x in list) process(x);': { - type: 'ForInStatement', - left: { - type: 'Identifier', - name: 'x', - range: [4, 5], - loc: { - start: { line: 1, column: 4 }, - end: { line: 1, column: 5 } - } - }, - right: { - type: 'Identifier', - name: 'list', - range: [9, 13], - loc: { - start: { line: 1, column: 9 }, - end: { line: 1, column: 13 } - } - }, - body: { - type: 'ExpressionStatement', - expression: { - type: 'CallExpression', - callee: { + 'x | y & z': { + type: 'ExpressionStatement', + expression: { + type: 'BinaryExpression', + operator: '|', + left: { + type: 'Identifier', + name: 'x', + range: [0, 1], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 1 } + } + }, + right: { + type: 'BinaryExpression', + operator: '&', + left: { type: 'Identifier', - name: 'process', - range: [15, 22], + name: 'y', + range: [4, 5], loc: { - start: { line: 1, column: 15 }, - end: { line: 1, column: 22 } + start: { line: 1, column: 4 }, + end: { line: 1, column: 5 } } }, - 'arguments': [{ + right: { type: 'Identifier', - name: 'x', - range: [23, 24], + name: 'z', + range: [8, 9], loc: { - start: { line: 1, column: 23 }, - end: { line: 1, column: 24 } + start: { line: 1, column: 8 }, + end: { line: 1, column: 9 } } - }], - range: [15, 25], + }, + range: [4, 9], loc: { - start: { line: 1, column: 15 }, - end: { line: 1, column: 25 } + start: { line: 1, column: 4 }, + end: { line: 1, column: 9 } } }, - range: [15, 26], + range: [0, 9], loc: { - start: { line: 1, column: 15 }, - end: { line: 1, column: 26 } + start: { line: 1, column: 0 }, + end: { line: 1, column: 9 } } }, - each: false, - range: [0, 26], + range: [0, 9], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 26 } + end: { line: 1, column: 9 } } - }, + } - 'for (var x in list) process(x);': { - type: 'ForInStatement', - left: { - type: 'VariableDeclaration', - declarations: [{ - type: 'VariableDeclarator', - id: { - type: 'Identifier', - name: 'x', - range: [9, 10], - loc: { - start: { line: 1, column: 9 }, - end: { line: 1, column: 10 } - } - }, - init: null, - range: [9, 10], + }, + + 'Binary Logical Operators': { + + 'x || y': { + type: 'ExpressionStatement', + expression: { + type: 'LogicalExpression', + operator: '||', + left: { + type: 'Identifier', + name: 'x', + range: [0, 1], loc: { - start: { line: 1, column: 9 }, - end: { line: 1, column: 10 } + start: { line: 1, column: 0 }, + end: { line: 1, column: 1 } } - }], - kind: 'var', - range: [5, 10], + }, + right: { + type: 'Identifier', + name: 'y', + range: [5, 6], + loc: { + start: { line: 1, column: 5 }, + end: { line: 1, column: 6 } + } + }, + range: [0, 6], loc: { - start: { line: 1, column: 5 }, - end: { line: 1, column: 10 } + start: { line: 1, column: 0 }, + end: { line: 1, column: 6 } } }, - right: { - type: 'Identifier', - name: 'list', - range: [14, 18], + range: [0, 6], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 6 } + } + }, + + 'x && y': { + type: 'ExpressionStatement', + expression: { + type: 'LogicalExpression', + operator: '&&', + left: { + type: 'Identifier', + name: 'x', + range: [0, 1], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 1 } + } + }, + right: { + type: 'Identifier', + name: 'y', + range: [5, 6], + loc: { + start: { line: 1, column: 5 }, + end: { line: 1, column: 6 } + } + }, + range: [0, 6], loc: { - start: { line: 1, column: 14 }, - end: { line: 1, column: 18 } + start: { line: 1, column: 0 }, + end: { line: 1, column: 6 } } }, - body: { - type: 'ExpressionStatement', - expression: { - type: 'CallExpression', - callee: { + range: [0, 6], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 6 } + } + }, + + 'x || y || z': { + type: 'ExpressionStatement', + expression: { + type: 'LogicalExpression', + operator: '||', + left: { + type: 'LogicalExpression', + operator: '||', + left: { type: 'Identifier', - name: 'process', - range: [20, 27], + name: 'x', + range: [0, 1], loc: { - start: { line: 1, column: 20 }, - end: { line: 1, column: 27 } + start: { line: 1, column: 0 }, + end: { line: 1, column: 1 } } }, - 'arguments': [{ + right: { type: 'Identifier', - name: 'x', - range: [28, 29], + name: 'y', + range: [5, 6], loc: { - start: { line: 1, column: 28 }, - end: { line: 1, column: 29 } + start: { line: 1, column: 5 }, + end: { line: 1, column: 6 } } - }], - range: [20, 30], + }, + range: [0, 6], loc: { - start: { line: 1, column: 20 }, - end: { line: 1, column: 30 } + start: { line: 1, column: 0 }, + end: { line: 1, column: 6 } } }, - range: [20, 31], + right: { + type: 'Identifier', + name: 'z', + range: [10, 11], + loc: { + start: { line: 1, column: 10 }, + end: { line: 1, column: 11 } + } + }, + range: [0, 11], loc: { - start: { line: 1, column: 20 }, - end: { line: 1, column: 31 } + start: { line: 1, column: 0 }, + end: { line: 1, column: 11 } } }, - each: false, - range: [0, 31], + range: [0, 11], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 31 } + end: { line: 1, column: 11 } } }, - 'for (var x = 42 in list) process(x);': { - type: 'ForInStatement', - left: { - type: 'VariableDeclaration', - declarations: [{ - type: 'VariableDeclarator', - id: { + 'x && y && z': { + type: 'ExpressionStatement', + expression: { + type: 'LogicalExpression', + operator: '&&', + left: { + type: 'LogicalExpression', + operator: '&&', + left: { type: 'Identifier', name: 'x', - range: [9, 10], + range: [0, 1], loc: { - start: { line: 1, column: 9 }, - end: { line: 1, column: 10 } + start: { line: 1, column: 0 }, + end: { line: 1, column: 1 } } }, - init: { - type: 'Literal', - value: 42, - raw: '42', - range: [13, 15], + right: { + type: 'Identifier', + name: 'y', + range: [5, 6], loc: { - start: { line: 1, column: 13 }, - end: { line: 1, column: 15 } + start: { line: 1, column: 5 }, + end: { line: 1, column: 6 } } }, - range: [9, 15], + range: [0, 6], loc: { - start: { line: 1, column: 9 }, - end: { line: 1, column: 15 } + start: { line: 1, column: 0 }, + end: { line: 1, column: 6 } } - }], - kind: 'var', - range: [5, 15], - loc: { - start: { line: 1, column: 5 }, - end: { line: 1, column: 15 } - } - }, - right: { - type: 'Identifier', - name: 'list', - range: [19, 23], + }, + right: { + type: 'Identifier', + name: 'z', + range: [10, 11], + loc: { + start: { line: 1, column: 10 }, + end: { line: 1, column: 11 } + } + }, + range: [0, 11], loc: { - start: { line: 1, column: 19 }, - end: { line: 1, column: 23 } + start: { line: 1, column: 0 }, + end: { line: 1, column: 11 } } }, - body: { - type: 'ExpressionStatement', - expression: { - type: 'CallExpression', - callee: { + range: [0, 11], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 11 } + } + }, + + 'x || y && z': { + type: 'ExpressionStatement', + expression: { + type: 'LogicalExpression', + operator: '||', + left: { + type: 'Identifier', + name: 'x', + range: [0, 1], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 1 } + } + }, + right: { + type: 'LogicalExpression', + operator: '&&', + left: { type: 'Identifier', - name: 'process', - range: [25, 32], + name: 'y', + range: [5, 6], loc: { - start: { line: 1, column: 25 }, - end: { line: 1, column: 32 } + start: { line: 1, column: 5 }, + end: { line: 1, column: 6 } } }, - 'arguments': [{ + right: { type: 'Identifier', - name: 'x', - range: [33, 34], + name: 'z', + range: [10, 11], loc: { - start: { line: 1, column: 33 }, - end: { line: 1, column: 34 } + start: { line: 1, column: 10 }, + end: { line: 1, column: 11 } } - }], - range: [25, 35], + }, + range: [5, 11], loc: { - start: { line: 1, column: 25 }, - end: { line: 1, column: 35 } + start: { line: 1, column: 5 }, + end: { line: 1, column: 11 } } }, - range: [25, 36], + range: [0, 11], loc: { - start: { line: 1, column: 25 }, - end: { line: 1, column: 36 } + start: { line: 1, column: 0 }, + end: { line: 1, column: 11 } } }, - each: false, - range: [0, 36], + range: [0, 11], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 36 } + end: { line: 1, column: 11 } } }, - 'for (let x in list) process(x);': { - type: 'ForInStatement', - left: { - type: 'VariableDeclaration', - declarations: [{ - type: 'VariableDeclarator', - id: { + 'x || y ^ z': { + type: 'ExpressionStatement', + expression: { + type: 'LogicalExpression', + operator: '||', + left: { + type: 'Identifier', + name: 'x', + range: [0, 1], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 1 } + } + }, + right: { + type: 'BinaryExpression', + operator: '^', + left: { type: 'Identifier', - name: 'x', + name: 'y', + range: [5, 6], + loc: { + start: { line: 1, column: 5 }, + end: { line: 1, column: 6 } + } + }, + right: { + type: 'Identifier', + name: 'z', range: [9, 10], loc: { start: { line: 1, column: 9 }, end: { line: 1, column: 10 } } }, - init: null, - range: [9, 10], + range: [5, 10], loc: { - start: { line: 1, column: 9 }, + start: { line: 1, column: 5 }, end: { line: 1, column: 10 } } - }], - kind: 'let', - range: [5, 10], + }, + range: [0, 10], loc: { - start: { line: 1, column: 5 }, + start: { line: 1, column: 0 }, end: { line: 1, column: 10 } } }, - right: { - type: 'Identifier', - name: 'list', - range: [14, 18], - loc: { - start: { line: 1, column: 14 }, - end: { line: 1, column: 18 } - } - }, - body: { - type: 'ExpressionStatement', - expression: { - type: 'CallExpression', - callee: { - type: 'Identifier', - name: 'process', - range: [20, 27], - loc: { - start: { line: 1, column: 20 }, - end: { line: 1, column: 27 } - } - }, - 'arguments': [{ - type: 'Identifier', - name: 'x', - range: [28, 29], - loc: { - start: { line: 1, column: 28 }, - end: { line: 1, column: 29 } - } - }], - range: [20, 30], + range: [0, 10], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 10 } + } + } + + }, + + 'Conditional Operator': { + + 'y ? 1 : 2': { + type: 'ExpressionStatement', + expression: { + type: 'ConditionalExpression', + test: { + type: 'Identifier', + name: 'y', + range: [0, 1], loc: { - start: { line: 1, column: 20 }, - end: { line: 1, column: 30 } + start: { line: 1, column: 0 }, + end: { line: 1, column: 1 } } }, - range: [20, 31], + consequent: { + type: 'Literal', + value: 1, + raw: '1', + range: [4, 5], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 5 } + } + }, + alternate: { + type: 'Literal', + value: 2, + raw: '2', + range: [8, 9], + loc: { + start: { line: 1, column: 8 }, + end: { line: 1, column: 9 } + } + }, + range: [0, 9], loc: { - start: { line: 1, column: 20 }, - end: { line: 1, column: 31 } + start: { line: 1, column: 0 }, + end: { line: 1, column: 9 } } }, - each: false, - range: [0, 31], + range: [0, 9], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 31 } + end: { line: 1, column: 9 } } }, - 'for (let x = 42 in list) process(x);': { - type: 'ForInStatement', - left: { - type: 'VariableDeclaration', - declarations: [{ - type: 'VariableDeclarator', - id: { + 'x && y ? 1 : 2': { + type: 'ExpressionStatement', + expression: { + type: 'ConditionalExpression', + test: { + type: 'LogicalExpression', + operator: '&&', + left: { type: 'Identifier', name: 'x', - range: [9, 10], + range: [0, 1], loc: { - start: { line: 1, column: 9 }, - end: { line: 1, column: 10 } + start: { line: 1, column: 0 }, + end: { line: 1, column: 1 } } }, - init: { - type: 'Literal', - value: 42, - raw: '42', - range: [13, 15], + right: { + type: 'Identifier', + name: 'y', + range: [5, 6], loc: { - start: { line: 1, column: 13 }, - end: { line: 1, column: 15 } + start: { line: 1, column: 5 }, + end: { line: 1, column: 6 } } }, - range: [9, 15], + range: [0, 6], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 6 } + } + }, + consequent: { + type: 'Literal', + value: 1, + raw: '1', + range: [9, 10], loc: { start: { line: 1, column: 9 }, - end: { line: 1, column: 15 } + end: { line: 1, column: 10 } } - }], - kind: 'let', - range: [5, 15], - loc: { - start: { line: 1, column: 5 }, - end: { line: 1, column: 15 } - } - }, - right: { - type: 'Identifier', - name: 'list', - range: [19, 23], + }, + alternate: { + type: 'Literal', + value: 2, + raw: '2', + range: [13, 14], + loc: { + start: { line: 1, column: 13 }, + end: { line: 1, column: 14 } + } + }, + range: [0, 14], loc: { - start: { line: 1, column: 19 }, - end: { line: 1, column: 23 } + start: { line: 1, column: 0 }, + end: { line: 1, column: 14 } } }, - body: { - type: 'ExpressionStatement', - expression: { - type: 'CallExpression', - callee: { - type: 'Identifier', - name: 'process', - range: [25, 32], - loc: { - start: { line: 1, column: 25 }, - end: { line: 1, column: 32 } - } + range: [0, 14], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 14 } + } + }, + 'x = (0) ? 1 : 2' : { + type: 'ExpressionStatement', + expression: { + type: 'AssignmentExpression', + operator: '=', + left: { + type: 'Identifier', + name: 'x', + range: [ 0, 1 ], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 1 } + } + }, + right: { + type: 'ConditionalExpression', + test: { + type: 'Literal', + value: 0, + raw: '0', + range: [ 5, 6 ], + loc: { start: { line: 1, column: 5 }, end: { line: 1, column: 6 } } }, - 'arguments': [{ - type: 'Identifier', - name: 'x', - range: [33, 34], - loc: { - start: { line: 1, column: 33 }, - end: { line: 1, column: 34 } - } - }], - range: [25, 35], + consequent: { + type: 'Literal', + value: 1, + raw: '1', + range: [ 10, 11 ], + loc: { start: { line: 1, column: 10 }, end: { line: 1, column: 11 } } + }, + alternate: { + type: 'Literal', + value: 2, + raw: '2', + range: [ 14, 15 ], + loc: { start: { line: 1, column: 14 }, end: { line: 1, column: 15 } } + }, + range: [ 4, 15 ], + loc: { start: { line: 1, column: 4 }, end: { line: 1, column: 15 } } + }, + range: [ 0, 15 ], + loc: { start: { line: 1, column: 0 }, end: { line: 1, column: 15 } } + }, + range: [ 0, 15 ], + loc: { start: { line: 1, column: 0 }, end: { line: 1, column: 15 } } + } + }, + + '[ES6] Arrow Function': { + + '() => "test"': { + type: 'ExpressionStatement', + expression: { + type: 'ArrowFunctionExpression', + id: null, + params: [], + defaults: [], + body: { + type: 'Literal', + value: 'test', + raw: '"test"', + range: [6, 12], loc: { - start: { line: 1, column: 25 }, - end: { line: 1, column: 35 } + start: { line: 1, column: 6 }, + end: { line: 1, column: 12 } } }, - range: [25, 36], + rest: null, + generator: false, + expression: true, + range: [0, 12], loc: { - start: { line: 1, column: 25 }, - end: { line: 1, column: 36 } + start: { line: 1, column: 0 }, + end: { line: 1, column: 12 } } }, - each: false, - range: [0, 36], + range: [0, 12], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 36 } + end: { line: 1, column: 12 } } }, - 'for (var i = function() { return 10 in [] } in list) process(x);': { - type: 'ForInStatement', - left: { - type: 'VariableDeclaration', - declarations: [{ - type: 'VariableDeclarator', - id: { - type: 'Identifier', - name: 'i', - range: [9, 10], - loc: { - start: { line: 1, column: 9 }, - end: { line: 1, column: 10 } - } - }, - init: { - type: 'FunctionExpression', - id: null, - params: [], - defaults: [], - body: { - type: 'BlockStatement', - body: [{ - type: 'ReturnStatement', - argument: { - type: 'BinaryExpression', - operator: 'in', - left: { - type: 'Literal', - value: 10, - raw: '10', - range: [33, 35], - loc: { - start: { line: 1, column: 33 }, - end: { line: 1, column: 35 } - } - }, - right: { - type: 'ArrayExpression', - elements: [], - range: [39, 41], - loc: { - start: { line: 1, column: 39 }, - end: { line: 1, column: 41 } - } - }, - range: [33, 41], - loc: { - start: { line: 1, column: 33 }, - end: { line: 1, column: 41 } - } - }, - range: [26, 42], - loc: { - start: { line: 1, column: 26 }, - end: { line: 1, column: 42 } - } - }], - range: [24, 43], - loc: { - start: { line: 1, column: 24 }, - end: { line: 1, column: 43 } - } - }, - rest: null, - generator: false, - expression: false, - range: [13, 43], - loc: { - start: { line: 1, column: 13 }, - end: { line: 1, column: 43 } - } - }, - range: [9, 43], + 'e => "test"': { + type: 'ExpressionStatement', + expression: { + type: 'ArrowFunctionExpression', + id: null, + params: [{ + type: 'Identifier', + name: 'e', + range: [0, 1], loc: { - start: { line: 1, column: 9 }, - end: { line: 1, column: 43 } + start: { line: 1, column: 0 }, + end: { line: 1, column: 1 } } }], - kind: 'var', - range: [5, 43], + defaults: [], + body: { + type: 'Literal', + value: 'test', + raw: '"test"', + range: [5, 11], + loc: { + start: { line: 1, column: 5 }, + end: { line: 1, column: 11 } + } + }, + rest: null, + generator: false, + expression: true, + range: [0, 11], loc: { - start: { line: 1, column: 5 }, - end: { line: 1, column: 43 } + start: { line: 1, column: 0 }, + end: { line: 1, column: 11 } } }, - right: { - type: 'Identifier', - name: 'list', - range: [47, 51], - loc: { - start: { line: 1, column: 47 }, - end: { line: 1, column: 51 } - } - }, - body: { - type: 'ExpressionStatement', - expression: { - type: 'CallExpression', - callee: { - type: 'Identifier', - name: 'process', - range: [53, 60], - loc: { - start: { line: 1, column: 53 }, - end: { line: 1, column: 60 } - } - }, - 'arguments': [{ - type: 'Identifier', - name: 'x', - range: [61, 62], - loc: { - start: { line: 1, column: 61 }, - end: { line: 1, column: 62 } - } - }], - range: [53, 63], - loc: { - start: { line: 1, column: 53 }, - end: { line: 1, column: 63 } - } - }, - range: [53, 64], - loc: { - start: { line: 1, column: 53 }, - end: { line: 1, column: 64 } - } - }, - each: false, - range: [0, 64], + range: [0, 11], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 64 } + end: { line: 1, column: 11 } } - } - - }, - - 'continue statement': { + }, - 'while (true) { continue; }': { - type: 'WhileStatement', - test: { - type: 'Literal', - value: true, - raw: 'true', - range: [7, 11], - loc: { - start: { line: 1, column: 7 }, - end: { line: 1, column: 11 } - } - }, - body: { - type: 'BlockStatement', - body: [ - { - type: 'ContinueStatement', - label: null, - range: [15, 24], - loc: { - start: { line: 1, column: 15 }, - end: { line: 1, column: 24 } - } + '(e) => "test"': { + type: 'ExpressionStatement', + expression: { + type: 'ArrowFunctionExpression', + id: null, + params: [{ + type: 'Identifier', + name: 'e', + range: [1, 2], + loc: { + start: { line: 1, column: 1 }, + end: { line: 1, column: 2 } } - ], - range: [13, 26], + }], + defaults: [], + body: { + type: 'Literal', + value: 'test', + raw: '"test"', + range: [7, 13], + loc: { + start: { line: 1, column: 7 }, + end: { line: 1, column: 13 } + } + }, + rest: null, + generator: false, + expression: true, + range: [0, 13], loc: { - start: { line: 1, column: 13 }, - end: { line: 1, column: 26 } + start: { line: 1, column: 0 }, + end: { line: 1, column: 13 } } }, - range: [0, 26], + range: [0, 13], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 26 } + end: { line: 1, column: 13 } } }, - 'while (true) { continue }': { - type: 'WhileStatement', - test: { - type: 'Literal', - value: true, - raw: 'true', - range: [7, 11], - loc: { - start: { line: 1, column: 7 }, - end: { line: 1, column: 11 } - } - }, - body: { - type: 'BlockStatement', - body: [ - { - type: 'ContinueStatement', - label: null, - range: [15, 24], - loc: { - start: { line: 1, column: 15 }, - end: { line: 1, column: 24 } - } + '(a, b) => "test"': { + type: 'ExpressionStatement', + expression: { + type: 'ArrowFunctionExpression', + id: null, + params: [{ + type: 'Identifier', + name: 'a', + range: [1, 2], + loc: { + start: { line: 1, column: 1 }, + end: { line: 1, column: 2 } } - ], - range: [13, 25], + }, { + type: 'Identifier', + name: 'b', + range: [4, 5], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 5 } + } + }], + defaults: [], + body: { + type: 'Literal', + value: 'test', + raw: '"test"', + range: [10, 16], + loc: { + start: { line: 1, column: 10 }, + end: { line: 1, column: 16 } + } + }, + rest: null, + generator: false, + expression: true, + range: [0, 16], loc: { - start: { line: 1, column: 13 }, - end: { line: 1, column: 25 } + start: { line: 1, column: 0 }, + end: { line: 1, column: 16 } } }, - range: [0, 25], + range: [0, 16], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 25 } + end: { line: 1, column: 16 } } }, - 'done: while (true) { continue done }': { - type: 'LabeledStatement', - label: { - type: 'Identifier', - name: 'done', - range: [0, 4], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 4 } - } - }, - body: { - type: 'WhileStatement', - test: { - type: 'Literal', - value: true, - raw: 'true', - range: [13, 17], + 'e => { 42; }': { + type: 'ExpressionStatement', + expression: { + type: 'ArrowFunctionExpression', + id: null, + params: [{ + type: 'Identifier', + name: 'e', + range: [0, 1], loc: { - start: { line: 1, column: 13 }, - end: { line: 1, column: 17 } + start: { line: 1, column: 0 }, + end: { line: 1, column: 1 } } - }, + }], + defaults: [], body: { type: 'BlockStatement', - body: [ - { - type: 'ContinueStatement', - label: { - type: 'Identifier', - name: 'done', - range: [30, 34], - loc: { - start: { line: 1, column: 30 }, - end: { line: 1, column: 34 } - } - }, - range: [21, 35], + body: [{ + type: 'ExpressionStatement', + expression: { + type: 'Literal', + value: 42, + raw: '42', + range: [7, 9], loc: { - start: { line: 1, column: 21 }, - end: { line: 1, column: 35 } + start: { line: 1, column: 7 }, + end: { line: 1, column: 9 } } + }, + range: [7, 10], + loc: { + start: { line: 1, column: 7 }, + end: { line: 1, column: 10 } } - ], - range: [19, 36], + }], + range: [5, 12], loc: { - start: { line: 1, column: 19 }, - end: { line: 1, column: 36 } + start: { line: 1, column: 5 }, + end: { line: 1, column: 12 } } }, - range: [6, 36], + rest: null, + generator: false, + expression: false, + range: [0, 12], loc: { - start: { line: 1, column: 6 }, - end: { line: 1, column: 36 } + start: { line: 1, column: 0 }, + end: { line: 1, column: 12 } } }, - range: [0, 36], + range: [0, 12], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 36 } + end: { line: 1, column: 12 } } }, - 'done: while (true) { continue done; }': { - type: 'LabeledStatement', - label: { - type: 'Identifier', - name: 'done', - range: [0, 4], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 4 } - } - }, - body: { - type: 'WhileStatement', - test: { - type: 'Literal', - value: true, - raw: 'true', - range: [13, 17], + 'e => ({ property: 42 })': { + type: 'ExpressionStatement', + expression: { + type: 'ArrowFunctionExpression', + id: null, + params: [{ + type: 'Identifier', + name: 'e', + range: [0, 1], loc: { - start: { line: 1, column: 13 }, - end: { line: 1, column: 17 } + start: { line: 1, column: 0 }, + end: { line: 1, column: 1 } } - }, + }], + defaults: [], body: { - type: 'BlockStatement', - body: [ - { - type: 'ContinueStatement', - label: { - type: 'Identifier', - name: 'done', - range: [30, 34], - loc: { - start: { line: 1, column: 30 }, - end: { line: 1, column: 34 } - } - }, - range: [21, 35], + type: 'ObjectExpression', + properties: [{ + type: 'Property', + key: { + type: 'Identifier', + name: 'property', + range: [8, 16], loc: { - start: { line: 1, column: 21 }, - end: { line: 1, column: 35 } + start: { line: 1, column: 8 }, + end: { line: 1, column: 16 } } + }, + value: { + type: 'Literal', + value: 42, + raw: '42', + range: [18, 20], + loc: { + start: { line: 1, column: 18 }, + end: { line: 1, column: 20 } + } + }, + kind: 'init', + method: false, + shorthand: false, + range: [8, 20], + loc: { + start: { line: 1, column: 8 }, + end: { line: 1, column: 20 } } - ], - range: [19, 37], + }], + range: [6, 22], loc: { - start: { line: 1, column: 19 }, - end: { line: 1, column: 37 } + start: { line: 1, column: 6 }, + end: { line: 1, column: 22 } } }, - range: [6, 37], + rest: null, + generator: false, + expression: true, + range: [0, 23], loc: { - start: { line: 1, column: 6 }, - end: { line: 1, column: 37 } + start: { line: 1, column: 0 }, + end: { line: 1, column: 23 } } }, - range: [0, 37], + range: [0, 23], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 37 } + end: { line: 1, column: 23 } } - } - - }, - - 'break statement': { + }, - 'while (true) { break }': { - type: 'WhileStatement', - test: { - type: 'Literal', - value: true, - raw: 'true', - range: [7, 11], - loc: { - start: { line: 1, column: 7 }, - end: { line: 1, column: 11 } - } - }, - body: { - type: 'BlockStatement', - body: [ - { - type: 'BreakStatement', - label: null, - range: [15, 21], + // Not an object! + 'e => { label: 42 }': { + type: 'ExpressionStatement', + expression: { + type: 'ArrowFunctionExpression', + id: null, + params: [{ + type: 'Identifier', + name: 'e', + range: [0, 1], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 1 } + } + }], + defaults: [], + body: { + type: 'BlockStatement', + body: [{ + type: 'LabeledStatement', + label: { + type: 'Identifier', + name: 'label', + range: [7, 12], + loc: { + start: { line: 1, column: 7 }, + end: { line: 1, column: 12 } + } + }, + body: { + type: 'ExpressionStatement', + expression: { + type: 'Literal', + value: 42, + raw: '42', + range: [14, 16], + loc: { + start: { line: 1, column: 14 }, + end: { line: 1, column: 16 } + } + }, + range: [14, 17], + loc: { + start: { line: 1, column: 14 }, + end: { line: 1, column: 17 } + } + }, + range: [7, 17], loc: { - start: { line: 1, column: 15 }, - end: { line: 1, column: 21 } + start: { line: 1, column: 7 }, + end: { line: 1, column: 17 } } + }], + range: [5, 18], + loc: { + start: { line: 1, column: 5 }, + end: { line: 1, column: 18 } } - ], - range: [13, 22], + }, + rest: null, + generator: false, + expression: false, + range: [0, 18], loc: { - start: { line: 1, column: 13 }, - end: { line: 1, column: 22 } + start: { line: 1, column: 0 }, + end: { line: 1, column: 18 } } }, - range: [0, 22], + range: [0, 18], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 22 } + end: { line: 1, column: 18 } } }, - 'done: while (true) { break done }': { - type: 'LabeledStatement', - label: { - type: 'Identifier', - name: 'done', - range: [0, 4], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 4 } - } - }, - body: { - type: 'WhileStatement', - test: { - type: 'Literal', - value: true, - raw: 'true', - range: [13, 17], + '(a, b) => { 42; }': { + type: 'ExpressionStatement', + expression: { + type: 'ArrowFunctionExpression', + id: null, + params: [{ + type: 'Identifier', + name: 'a', + range: [1, 2], loc: { - start: { line: 1, column: 13 }, - end: { line: 1, column: 17 } + start: { line: 1, column: 1 }, + end: { line: 1, column: 2 } } - }, + }, { + type: 'Identifier', + name: 'b', + range: [4, 5], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 5 } + } + }], + defaults: [], body: { type: 'BlockStatement', - body: [ - { - type: 'BreakStatement', - label: { - type: 'Identifier', - name: 'done', - range: [27, 31], - loc: { - start: { line: 1, column: 27 }, - end: { line: 1, column: 31 } - } - }, - range: [21, 32], + body: [{ + type: 'ExpressionStatement', + expression: { + type: 'Literal', + value: 42, + raw: '42', + range: [12, 14], loc: { - start: { line: 1, column: 21 }, - end: { line: 1, column: 32 } + start: { line: 1, column: 12 }, + end: { line: 1, column: 14 } } + }, + range: [12, 15], + loc: { + start: { line: 1, column: 12 }, + end: { line: 1, column: 15 } } - ], - range: [19, 33], + }], + range: [10, 17], loc: { - start: { line: 1, column: 19 }, - end: { line: 1, column: 33 } + start: { line: 1, column: 10 }, + end: { line: 1, column: 17 } } }, - range: [6, 33], + rest: null, + generator: false, + expression: false, + range: [0, 17], loc: { - start: { line: 1, column: 6 }, - end: { line: 1, column: 33 } + start: { line: 1, column: 0 }, + end: { line: 1, column: 17 } } }, - range: [0, 33], + range: [0, 17], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 33 } + end: { line: 1, column: 17 } } }, - 'done: while (true) { break done; }': { - type: 'LabeledStatement', - label: { - type: 'Identifier', - name: 'done', - range: [0, 4], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 4 } - } - }, - body: { - type: 'WhileStatement', - test: { + '(x=1) => x * x': { + type: 'ExpressionStatement', + expression: { + type: 'ArrowFunctionExpression', + id: null, + params: [{ + type: 'Identifier', + name: 'x', + range: [1, 2], + loc: { + start: { line: 1, column: 1 }, + end: { line: 1, column: 2 } + } + }], + defaults: [{ type: 'Literal', - value: true, - raw: 'true', - range: [13, 17], + value: 1, + raw: '1', + range: [3, 4], loc: { - start: { line: 1, column: 13 }, - end: { line: 1, column: 17 } + start: { line: 1, column: 3 }, + end: { line: 1, column: 4 } } - }, + }], body: { - type: 'BlockStatement', - body: [ - { - type: 'BreakStatement', - label: { - type: 'Identifier', - name: 'done', - range: [27, 31], - loc: { - start: { line: 1, column: 27 }, - end: { line: 1, column: 31 } - } - }, - range: [21, 32], - loc: { - start: { line: 1, column: 21 }, - end: { line: 1, column: 32 } - } + type: 'BinaryExpression', + operator: '*', + left: { + type: 'Identifier', + name: 'x', + range: [9, 10], + loc: { + start: { line: 1, column: 9 }, + end: { line: 1, column: 10 } } - ], - range: [19, 34], + }, + right: { + type: 'Identifier', + name: 'x', + range: [13, 14], + loc: { + start: { line: 1, column: 13 }, + end: { line: 1, column: 14 } + } + }, + range: [9, 14], loc: { - start: { line: 1, column: 19 }, - end: { line: 1, column: 34 } + start: { line: 1, column: 9 }, + end: { line: 1, column: 14 } } }, - range: [6, 34], + rest: null, + generator: false, + expression: true, + range: [0, 14], loc: { - start: { line: 1, column: 6 }, - end: { line: 1, column: 34 } + start: { line: 1, column: 0 }, + end: { line: 1, column: 14 } } }, - range: [0, 34], + range: [0, 14], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 34 } + end: { line: 1, column: 14 } } - } - - }, - - 'return statement': { + }, - '(function(){ return })': { + // not strict mode, using eval + 'eval => 42': { type: 'ExpressionStatement', expression: { - type: 'FunctionExpression', + type: 'ArrowFunctionExpression', id: null, - params: [], + params: [{ + type: 'Identifier', + name: 'eval', + range: [0, 4], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 4 } + } + }], defaults: [], body: { - type: 'BlockStatement', - body: [ - { - type: 'ReturnStatement', - argument: null, - range: [13, 20], - loc: { - start: { line: 1, column: 13 }, - end: { line: 1, column: 20 } - } - } - ], - range: [11, 21], + type: 'Literal', + value: 42, + raw: '42', + range: [8, 10], loc: { - start: { line: 1, column: 11 }, - end: { line: 1, column: 21 } + start: { line: 1, column: 8 }, + end: { line: 1, column: 10 } } }, rest: null, generator: false, - expression: false, - range: [1, 21], + expression: true, + range: [0, 10], loc: { - start: { line: 1, column: 1 }, - end: { line: 1, column: 21 } + start: { line: 1, column: 0 }, + end: { line: 1, column: 10 } } }, - range: [0, 22], + range: [0, 10], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 22 } + end: { line: 1, column: 10 } } }, - '(function(){ return; })': { + // not strict mode, using arguments + 'arguments => 42': { type: 'ExpressionStatement', expression: { - type: 'FunctionExpression', + type: 'ArrowFunctionExpression', id: null, - params: [], + params: [{ + type: 'Identifier', + name: 'arguments', + range: [0, 9], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 9 } + } + }], defaults: [], body: { - type: 'BlockStatement', - body: [ - { - type: 'ReturnStatement', - argument: null, - range: [13, 20], - loc: { - start: { line: 1, column: 13 }, - end: { line: 1, column: 20 } - } - } - ], - range: [11, 22], + type: 'Literal', + value: 42, + raw: '42', + range: [13, 15], loc: { - start: { line: 1, column: 11 }, - end: { line: 1, column: 22 } + start: { line: 1, column: 13 }, + end: { line: 1, column: 15 } } }, rest: null, generator: false, - expression: false, - range: [1, 22], + expression: true, + range: [0, 15], loc: { - start: { line: 1, column: 1 }, - end: { line: 1, column: 22 } + start: { line: 1, column: 0 }, + end: { line: 1, column: 15 } } }, - range: [0, 23], + range: [0, 15], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 23 } + end: { line: 1, column: 15 } } }, - '(function(){ return x; })': { + // not strict mode, using octals + '(a) => 00': { type: 'ExpressionStatement', expression: { - type: 'FunctionExpression', + type: 'ArrowFunctionExpression', id: null, - params: [], + params: [{ + type: 'Identifier', + name: 'a', + range: [1, 2], + loc: { + start: { line: 1, column: 1 }, + end: { line: 1, column: 2 } + } + }], defaults: [], body: { - type: 'BlockStatement', - body: [ - { - type: 'ReturnStatement', - argument: { - type: 'Identifier', - name: 'x', - range: [20, 21], - loc: { - start: { line: 1, column: 20 }, - end: { line: 1, column: 21 } - } - }, - range: [13, 22], - loc: { - start: { line: 1, column: 13 }, - end: { line: 1, column: 22 } - } - } - ], - range: [11, 24], + type: 'Literal', + value: 0, + raw: '00', + range: [7, 9], loc: { - start: { line: 1, column: 11 }, - end: { line: 1, column: 24 } + start: { line: 1, column: 7 }, + end: { line: 1, column: 9 } } }, rest: null, generator: false, - expression: false, - range: [1, 24], + expression: true, + range: [0, 9], loc: { - start: { line: 1, column: 1 }, - end: { line: 1, column: 24 } + start: { line: 1, column: 0 }, + end: { line: 1, column: 9 } } }, - range: [0, 25], + range: [0, 9], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 25 } + end: { line: 1, column: 9 } } }, - '(function(){ return x * y })': { + // not strict mode, using eval, IsSimpleParameterList is true + '(eval, a) => 42': { type: 'ExpressionStatement', expression: { - type: 'FunctionExpression', + type: 'ArrowFunctionExpression', id: null, - params: [], + params: [{ + type: 'Identifier', + name: 'eval', + range: [1, 5], + loc: { + start: { line: 1, column: 1 }, + end: { line: 1, column: 5 } + } + }, { + type: 'Identifier', + name: 'a', + range: [7, 8], + loc: { + start: { line: 1, column: 7 }, + end: { line: 1, column: 8 } + } + }], defaults: [], body: { - type: 'BlockStatement', - body: [ - { - type: 'ReturnStatement', - argument: { - type: 'BinaryExpression', - operator: '*', - left: { - type: 'Identifier', - name: 'x', - range: [20, 21], - loc: { - start: { line: 1, column: 20 }, - end: { line: 1, column: 21 } - } - }, - right: { - type: 'Identifier', - name: 'y', - range: [24, 25], - loc: { - start: { line: 1, column: 24 }, - end: { line: 1, column: 25 } - } - }, - range: [20, 25], - loc: { - start: { line: 1, column: 20 }, - end: { line: 1, column: 25 } - } - }, - range: [13, 26], - loc: { - start: { line: 1, column: 13 }, - end: { line: 1, column: 26 } - } - } - ], - range: [11, 27], + type: 'Literal', + value: 42, + raw: '42', + range: [13, 15], loc: { - start: { line: 1, column: 11 }, - end: { line: 1, column: 27 } + start: { line: 1, column: 13 }, + end: { line: 1, column: 15 } } }, rest: null, generator: false, - expression: false, - range: [1, 27], + expression: true, + range: [0, 15], loc: { - start: { line: 1, column: 1 }, - end: { line: 1, column: 27 } + start: { line: 1, column: 0 }, + end: { line: 1, column: 15 } } }, - range: [0, 28], + range: [0, 15], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 28 } + end: { line: 1, column: 15 } } - } - }, - - 'with statement': { + }, - 'with (x) foo = bar': { - type: 'WithStatement', - object: { - type: 'Identifier', - name: 'x', - range: [6, 7], - loc: { - start: { line: 1, column: 6 }, - end: { line: 1, column: 7 } - } - }, - body: { - type: 'ExpressionStatement', - expression: { - type: 'AssignmentExpression', - operator: '=', - left: { - type: 'Identifier', - name: 'foo', - range: [9, 12], - loc: { - start: { line: 1, column: 9 }, - end: { line: 1, column: 12 } - } - }, - right: { - type: 'Identifier', - name: 'bar', - range: [15, 18], - loc: { - start: { line: 1, column: 15 }, - end: { line: 1, column: 18 } - } - }, - range: [9, 18], + // not strict mode, assigning to eval + '(eval = 10) => 42': { + type: 'ExpressionStatement', + expression: { + type: 'ArrowFunctionExpression', + id: null, + params: [{ + type: 'Identifier', + name: 'eval', + range: [1, 5], loc: { - start: { line: 1, column: 9 }, - end: { line: 1, column: 18 } + start: { line: 1, column: 1 }, + end: { line: 1, column: 5 } + } + }], + defaults: [{ + type: 'Literal', + value: 10, + raw: '10', + range: [8, 10], + loc: { + start: { line: 1, column: 8 }, + end: { line: 1, column: 10 } + } + }], + body: { + type: 'Literal', + value: 42, + raw: '42', + range: [15, 17], + loc: { + start: { line: 1, column: 15 }, + end: { line: 1, column: 17 } } }, - range: [9, 18], + rest: null, + generator: false, + expression: true, + range: [0, 17], loc: { - start: { line: 1, column: 9 }, - end: { line: 1, column: 18 } + start: { line: 1, column: 0 }, + end: { line: 1, column: 17 } } }, - range: [0, 18], + range: [0, 17], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 18 } + end: { line: 1, column: 17 } } }, - 'with (x) foo = bar;': { - type: 'WithStatement', - object: { - type: 'Identifier', - name: 'x', - range: [6, 7], - loc: { - start: { line: 1, column: 6 }, - end: { line: 1, column: 7 } - } - }, - body: { - type: 'ExpressionStatement', - expression: { - type: 'AssignmentExpression', - operator: '=', - left: { - type: 'Identifier', - name: 'foo', - range: [9, 12], - loc: { - start: { line: 1, column: 9 }, - end: { line: 1, column: 12 } - } - }, - right: { - type: 'Identifier', - name: 'bar', - range: [15, 18], - loc: { - start: { line: 1, column: 15 }, - end: { line: 1, column: 18 } - } - }, - range: [9, 18], + // not strict mode, using eval, IsSimpleParameterList is false + '(eval, a = 10) => 42': { + type: 'ExpressionStatement', + expression: { + type: 'ArrowFunctionExpression', + id: null, + params: [{ + type: 'Identifier', + name: 'eval', + range: [1, 5], loc: { - start: { line: 1, column: 9 }, - end: { line: 1, column: 18 } + start: { line: 1, column: 1 }, + end: { line: 1, column: 5 } + } + }, { + type: 'Identifier', + name: 'a', + range: [7, 8], + loc: { + start: { line: 1, column: 7 }, + end: { line: 1, column: 8 } + } + }], + defaults: [null, { + type: 'Literal', + value: 10, + raw: '10', + range: [11, 13], + loc: { + start: { line: 1, column: 11 }, + end: { line: 1, column: 13 } + } + }], + body: { + type: 'Literal', + value: 42, + raw: '42', + range: [18, 20], + loc: { + start: { line: 1, column: 18 }, + end: { line: 1, column: 20 } } }, - range: [9, 19], + rest: null, + generator: false, + expression: true, + range: [0, 20], loc: { - start: { line: 1, column: 9 }, - end: { line: 1, column: 19 } + start: { line: 1, column: 0 }, + end: { line: 1, column: 20 } } }, - range: [0, 19], + range: [0, 20], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 19 } + end: { line: 1, column: 20 } } }, - 'with (x) { foo = bar }': { - type: 'WithStatement', - object: { - type: 'Identifier', - name: 'x', - range: [6, 7], + '(x => x)': { + type: 'ExpressionStatement', + expression: { + type: 'ArrowFunctionExpression', + id: null, + params: [{ + type: 'Identifier', + name: 'x', + range: [1, 2], + loc: { + start: { line: 1, column: 1 }, + end: { line: 1, column: 2 } + } + }], + defaults: [], + body: { + type: 'Identifier', + name: 'x', + range: [6, 7], + loc: { + start: { line: 1, column: 6 }, + end: { line: 1, column: 7 } + } + }, + rest: null, + generator: false, + expression: true, + range: [1, 7], loc: { - start: { line: 1, column: 6 }, + start: { line: 1, column: 1 }, end: { line: 1, column: 7 } } }, - body: { - type: 'BlockStatement', - body: [{ - type: 'ExpressionStatement', - expression: { - type: 'AssignmentExpression', - operator: '=', - left: { - type: 'Identifier', - name: 'foo', - range: [11, 14], - loc: { - start: { line: 1, column: 11 }, - end: { line: 1, column: 14 } - } - }, - right: { - type: 'Identifier', - name: 'bar', - range: [17, 20], - loc: { - start: { line: 1, column: 17 }, - end: { line: 1, column: 20 } - } - }, - range: [11, 20], + range: [0, 8], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 8 } + } + }, + + 'x => y => 42': { + type: 'ExpressionStatement', + expression: { + type: 'ArrowFunctionExpression', + id: null, + params: [{ + type: 'Identifier', + name: 'x', + range: [0, 1], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 1 } + } + }], + defaults: [], + body: { + type: 'ArrowFunctionExpression', + id: null, + params: [{ + type: 'Identifier', + name: 'y', + range: [5, 6], loc: { - start: { line: 1, column: 11 }, - end: { line: 1, column: 20 } + start: { line: 1, column: 5 }, + end: { line: 1, column: 6 } + } + }], + defaults: [], + body: { + type: 'Literal', + value: 42, + raw: '42', + range: [10, 12], + loc: { + start: { line: 1, column: 10 }, + end: { line: 1, column: 12 } } }, - range: [11, 21], + rest: null, + generator: false, + expression: true, + range: [5, 12], loc: { - start: { line: 1, column: 11 }, - end: { line: 1, column: 21 } + start: { line: 1, column: 5 }, + end: { line: 1, column: 12 } } - }], - range: [9, 22], - loc: { - start: { line: 1, column: 9 }, - end: { line: 1, column: 22 } - } - }, - range: [0, 22], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 22 } - } - } - - }, - - 'switch statement': { - - 'switch (x) {}': { - type: 'SwitchStatement', - discriminant: { - type: 'Identifier', - name: 'x', - range: [8, 9], + }, + rest: null, + generator: false, + expression: true, + range: [0, 12], loc: { - start: { line: 1, column: 8 }, - end: { line: 1, column: 9 } + start: { line: 1, column: 0 }, + end: { line: 1, column: 12 } } }, - cases:[], - range: [0, 13], + range: [0, 12], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 13 } + end: { line: 1, column: 12 } } }, - 'switch (answer) { case 42: hi(); break; }': { - type: 'SwitchStatement', - discriminant: { - type: 'Identifier', - name: 'answer', - range: [8, 14], - loc: { - start: { line: 1, column: 8 }, - end: { line: 1, column: 14 } - } - }, - cases: [{ - type: 'SwitchCase', - test: { - type: 'Literal', - value: 42, - raw: '42', - range: [23, 25], + '(x) => ((y, z) => (x, y, z))': { + type: 'ExpressionStatement', + expression: { + type: 'ArrowFunctionExpression', + id: null, + params: [{ + type: 'Identifier', + name: 'x', + range: [1, 2], loc: { - start: { line: 1, column: 23 }, - end: { line: 1, column: 25 } + start: { line: 1, column: 1 }, + end: { line: 1, column: 2 } } - }, - consequent: [{ - type: 'ExpressionStatement', - expression: { - type: 'CallExpression', - callee: { + }], + defaults: [], + body: { + type: 'ArrowFunctionExpression', + id: null, + params: [{ + type: 'Identifier', + name: 'y', + range: [9, 10], + loc: { + start: { line: 1, column: 9 }, + end: { line: 1, column: 10 } + } + }, { + type: 'Identifier', + name: 'z', + range: [12, 13], + loc: { + start: { line: 1, column: 12 }, + end: { line: 1, column: 13 } + } + }], + defaults: [], + body: { + type: 'SequenceExpression', + expressions: [{ type: 'Identifier', - name: 'hi', - range: [27, 29], + name: 'x', + range: [19, 20], loc: { - start: { line: 1, column: 27 }, - end: { line: 1, column: 29 } + start: { line: 1, column: 19 }, + end: { line: 1, column: 20 } } - }, - 'arguments': [], - range: [27, 31], + }, { + type: 'Identifier', + name: 'y', + range: [22, 23], + loc: { + start: { line: 1, column: 22 }, + end: { line: 1, column: 23 } + } + }, { + type: 'Identifier', + name: 'z', + range: [25, 26], + loc: { + start: { line: 1, column: 25 }, + end: { line: 1, column: 26 } + } + }], + range: [19, 26], loc: { - start: { line: 1, column: 27 }, - end: { line: 1, column: 31 } + start: { line: 1, column: 19 }, + end: { line: 1, column: 26 } } }, - range: [27, 32], - loc: { - start: { line: 1, column: 27 }, - end: { line: 1, column: 32 } - } - }, { - type: 'BreakStatement', - label: null, - range: [33, 39], + rest: null, + generator: false, + expression: true, + range: [8, 27], loc: { - start: { line: 1, column: 33 }, - end: { line: 1, column: 39 } + start: { line: 1, column: 8 }, + end: { line: 1, column: 27 } } - }], - range: [18, 39], + }, + rest: null, + generator: false, + expression: true, + range: [0, 28], loc: { - start: { line: 1, column: 18 }, - end: { line: 1, column: 39 } + start: { line: 1, column: 0 }, + end: { line: 1, column: 28 } } - }], - range: [0, 41], + }, + range: [0, 28], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 41 } + end: { line: 1, column: 28 } } }, - 'switch (answer) { case 42: hi(); break; default: break }': { - type: 'SwitchStatement', - discriminant: { - type: 'Identifier', - name: 'answer', - range: [8, 14], - loc: { - start: { line: 1, column: 8 }, - end: { line: 1, column: 14 } - } - }, - cases: [{ - type: 'SwitchCase', - test: { - type: 'Literal', - value: 42, - raw: '42', - range: [23, 25], + 'foo(() => {})': { + type: 'ExpressionStatement', + expression: { + type: 'CallExpression', + callee: { + type: 'Identifier', + name: 'foo', + range: [0, 3], loc: { - start: { line: 1, column: 23 }, - end: { line: 1, column: 25 } + start: { line: 1, column: 0 }, + end: { line: 1, column: 3 } } }, - consequent: [{ - type: 'ExpressionStatement', - expression: { - type: 'CallExpression', - callee: { - type: 'Identifier', - name: 'hi', - range: [27, 29], - loc: { - start: { line: 1, column: 27 }, - end: { line: 1, column: 29 } - } - }, - 'arguments': [], - range: [27, 31], + 'arguments': [{ + type: 'ArrowFunctionExpression', + id: null, + params: [], + defaults: [], + body: { + type: 'BlockStatement', + body: [], + range: [10, 12], loc: { - start: { line: 1, column: 27 }, - end: { line: 1, column: 31 } + start: { line: 1, column: 10 }, + end: { line: 1, column: 12 } } }, - range: [27, 32], - loc: { - start: { line: 1, column: 27 }, - end: { line: 1, column: 32 } - } - }, { - type: 'BreakStatement', - label: null, - range: [33, 39], - loc: { - start: { line: 1, column: 33 }, - end: { line: 1, column: 39 } - } - }], - range: [18, 39], - loc: { - start: { line: 1, column: 18 }, - end: { line: 1, column: 39 } - } - }, { - type: 'SwitchCase', - test: null, - consequent: [{ - type: 'BreakStatement', - label: null, - range: [49, 55], + rest: null, + generator: false, + expression: false, + range: [4, 12], loc: { - start: { line: 1, column: 49 }, - end: { line: 1, column: 55 } + start: { line: 1, column: 4 }, + end: { line: 1, column: 12 } } }], - range: [40, 55], + range: [0, 13], loc: { - start: { line: 1, column: 40 }, - end: { line: 1, column: 55 } + start: { line: 1, column: 0 }, + end: { line: 1, column: 13 } } - }], - range: [0, 56], + }, + range: [0, 13], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 56 } + end: { line: 1, column: 13 } } - } - - }, - - 'Labelled Statements': { + }, - 'start: for (;;) break start': { - type: 'LabeledStatement', - label: { - type: 'Identifier', - name: 'start', - range: [0, 5], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 5 } - } - }, - body: { - type: 'ForStatement', - init: null, - test: null, - update: null, - body: { - type: 'BreakStatement', - label: { + 'foo((x, y) => {})': { + type: 'ExpressionStatement', + expression: { + type: 'CallExpression', + callee: { + type: 'Identifier', + name: 'foo', + range: [0, 3], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 3 } + } + }, + 'arguments': [{ + type: 'ArrowFunctionExpression', + id: null, + params: [{ type: 'Identifier', - name: 'start', - range: [22, 27], + name: 'x', + range: [5, 6], loc: { - start: { line: 1, column: 22 }, - end: { line: 1, column: 27 } + start: { line: 1, column: 5 }, + end: { line: 1, column: 6 } + } + }, { + type: 'Identifier', + name: 'y', + range: [8, 9], + loc: { + start: { line: 1, column: 8 }, + end: { line: 1, column: 9 } + } + }], + defaults: [], + body: { + type: 'BlockStatement', + body: [], + range: [14, 16], + loc: { + start: { line: 1, column: 14 }, + end: { line: 1, column: 16 } } }, - range: [16, 27], + rest: null, + generator: false, + expression: false, + range: [4, 16], loc: { - start: { line: 1, column: 16 }, - end: { line: 1, column: 27 } + start: { line: 1, column: 4 }, + end: { line: 1, column: 16 } } - }, - range: [7, 27], + }], + range: [0, 17], loc: { - start: { line: 1, column: 7 }, - end: { line: 1, column: 27 } + start: { line: 1, column: 0 }, + end: { line: 1, column: 17 } } }, - range: [0, 27], + range: [0, 17], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 27 } + end: { line: 1, column: 17 } } }, - 'start: while (true) break start': { - type: 'LabeledStatement', - label: { - type: 'Identifier', - name: 'start', - range: [0, 5], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 5 } - } - }, - body: { - type: 'WhileStatement', - test: { - type: 'Literal', - value: true, - raw: 'true', - range: [14, 18], - loc: { - start: { line: 1, column: 14 }, - end: { line: 1, column: 18 } - } - }, - body: { - type: 'BreakStatement', - label: { - type: 'Identifier', - name: 'start', - range: [26, 31], + '(sun) => earth': { + type: "Program", + body: [{ + type: "ExpressionStatement", + expression: { + type: "ArrowFunctionExpression", + id: null, + params: [{ + type: "Identifier", + name: "sun", + range: [1, 4], loc: { - start: { line: 1, column: 26 }, - end: { line: 1, column: 31 } + start: { line: 1, column: 1 }, + end: { line: 1, column: 4 } + } + }], + defaults: [], + body: { + type: "Identifier", + name: "earth", + range: [9, 14], + loc: { + start: { line: 1, column: 9 }, + end: { line: 1, column: 14 } } }, - range: [20, 31], + rest: null, + generator: false, + expression: true, + range: [0, 14], loc: { - start: { line: 1, column: 20 }, - end: { line: 1, column: 31 } + start: { line: 1, column: 0 }, + end: { line: 1, column: 14 } } }, - range: [7, 31], + range: [0, 14], loc: { - start: { line: 1, column: 7 }, - end: { line: 1, column: 31 } + start: { line: 1, column: 0 }, + end: { line: 1, column: 14 } } - }, - range: [0, 31], + }], + range: [0, 14], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 31 } - } + end: { line: 1, column: 14 } + }, + tokens: [{ + type: "Punctuator", + value: "(", + range: [0, 1], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 1 } + } + }, { + type: "Identifier", + value: "sun", + range: [1, 4], + loc: { + start: { line: 1, column: 1 }, + end: { line: 1, column: 4 } + } + }, { + type: "Punctuator", + value: ")", + range: [4, 5], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 5 } + } + }, { + type: "Punctuator", + value: "=>", + range: [6, 8], + loc: { + start: { line: 1, column: 6 }, + end: { line: 1, column: 8 } + } + }, { + type: "Identifier", + value: "earth", + range: [9, 14], + loc: { + start: { line: 1, column: 9 }, + end: { line: 1, column: 14 } + } + }] } }, - 'throw statement': { + '[ES6] Method Definition': { - 'throw x;': { - type: 'ThrowStatement', - argument: { - type: 'Identifier', - name: 'x', - range: [6, 7], + 'x = { method() { } }': { + type: 'ExpressionStatement', + expression: { + type: 'AssignmentExpression', + operator: '=', + left: { + type: 'Identifier', + name: 'x', + range: [0, 1], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 1 } + } + }, + right: { + type: 'ObjectExpression', + properties: [{ + type: 'Property', + key: { + type: 'Identifier', + name: 'method', + range: [6, 12], + loc: { + start: { line: 1, column: 6 }, + end: { line: 1, column: 12 } + } + }, + value: { + type: 'FunctionExpression', + id: null, + params: [], + defaults: [], + body: { + type: 'BlockStatement', + body: [], + range: [15, 18], + loc: { + start: { line: 1, column: 15 }, + end: { line: 1, column: 18 } + } + }, + rest: null, + generator: false, + expression: false, + range: [15, 18], + loc: { + start: { line: 1, column: 15 }, + end: { line: 1, column: 18 } + } + }, + kind: 'init', + method: true, + shorthand: false, + range: [6, 18], + loc: { + start: { line: 1, column: 6 }, + end: { line: 1, column: 18 } + } + }], + range: [4, 20], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 20 } + } + }, + range: [0, 20], loc: { - start: { line: 1, column: 6 }, - end: { line: 1, column: 7 } + start: { line: 1, column: 0 }, + end: { line: 1, column: 20 } } }, - range: [0, 8], + range: [0, 20], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 8 } + end: { line: 1, column: 20 } } }, - 'throw x * y': { - type: 'ThrowStatement', - argument: { - type: 'BinaryExpression', - operator: '*', + 'x = { method(test) { } }': { + type: 'ExpressionStatement', + expression: { + type: 'AssignmentExpression', + operator: '=', left: { type: 'Identifier', name: 'x', - range: [6, 7], + range: [0, 1], loc: { - start: { line: 1, column: 6 }, - end: { line: 1, column: 7 } + start: { line: 1, column: 0 }, + end: { line: 1, column: 1 } } }, right: { - type: 'Identifier', - name: 'y', - range: [10, 11], + type: 'ObjectExpression', + properties: [{ + type: 'Property', + key: { + type: 'Identifier', + name: 'method', + range: [6, 12], + loc: { + start: { line: 1, column: 6 }, + end: { line: 1, column: 12 } + } + }, + value: { + type: 'FunctionExpression', + id: null, + params: [{ + type: 'Identifier', + name: 'test', + range: [13, 17], + loc: { + start: { line: 1, column: 13 }, + end: { line: 1, column: 17 } + } + }], + defaults: [], + body: { + type: 'BlockStatement', + body: [], + range: [19, 22], + loc: { + start: { line: 1, column: 19 }, + end: { line: 1, column: 22 } + } + }, + rest: null, + generator: false, + expression: false, + range: [19, 22], + loc: { + start: { line: 1, column: 19 }, + end: { line: 1, column: 22 } + } + }, + kind: 'init', + method: true, + shorthand: false, + range: [6, 22], + loc: { + start: { line: 1, column: 6 }, + end: { line: 1, column: 22 } + } + }], + range: [4, 24], loc: { - start: { line: 1, column: 10 }, - end: { line: 1, column: 11 } + start: { line: 1, column: 4 }, + end: { line: 1, column: 24 } } }, - range: [6, 11], + range: [0, 24], loc: { - start: { line: 1, column: 6 }, - end: { line: 1, column: 11 } + start: { line: 1, column: 0 }, + end: { line: 1, column: 24 } } }, - range: [0, 11], + range: [0, 24], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 11 } + end: { line: 1, column: 24 } } }, - 'throw { message: "Error" }': { - type: 'ThrowStatement', - argument: { - type: 'ObjectExpression', - properties: [{ - type: 'Property', - key: { - type: 'Identifier', - name: 'message', - range: [8, 15], - loc: { - start: { line: 1, column: 8 }, - end: { line: 1, column: 15 } - } - }, - value: { - type: 'Literal', - value: 'Error', - raw: '"Error"', - range: [17, 24], + 'x = { \'method\'() { } }': { + type: 'ExpressionStatement', + expression: { + type: 'AssignmentExpression', + operator: '=', + left: { + type: 'Identifier', + name: 'x', + range: [0, 1], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 1 } + } + }, + right: { + type: 'ObjectExpression', + properties: [{ + type: 'Property', + key: { + type: 'Literal', + value: 'method', + raw: '\'method\'', + range: [6, 14], + loc: { + start: { line: 1, column: 6 }, + end: { line: 1, column: 14 } + } + }, + value: { + type: 'FunctionExpression', + id: null, + params: [], + defaults: [], + body: { + type: 'BlockStatement', + body: [], + range: [17, 20], + loc: { + start: { line: 1, column: 17 }, + end: { line: 1, column: 20 } + } + }, + rest: null, + generator: false, + expression: false, + range: [17, 20], + loc: { + start: { line: 1, column: 17 }, + end: { line: 1, column: 20 } + } + }, + kind: 'init', + method: true, + shorthand: false, + range: [6, 20], loc: { - start: { line: 1, column: 17 }, - end: { line: 1, column: 24 } + start: { line: 1, column: 6 }, + end: { line: 1, column: 20 } } - }, - kind: 'init', - range: [8, 24], + }], + range: [4, 22], loc: { - start: { line: 1, column: 8 }, - end: { line: 1, column: 24 } + start: { line: 1, column: 4 }, + end: { line: 1, column: 22 } } - }], - range: [6, 26], + }, + range: [0, 22], loc: { - start: { line: 1, column: 6 }, - end: { line: 1, column: 26 } + start: { line: 1, column: 0 }, + end: { line: 1, column: 22 } } }, - range: [0, 26], + range: [0, 22], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 26 } + end: { line: 1, column: 22 } } - } - - }, - - 'try statement': { + }, - 'try { } catch (e) { }': { - type: 'TryStatement', - block: { - type: 'BlockStatement', - body: [], - range: [4, 7], - loc: { - start: { line: 1, column: 4 }, - end: { line: 1, column: 7 } - } - }, - guardedHandlers: [], - handlers: [{ - type: 'CatchClause', - param: { + 'x = { get() { } }': { + type: 'ExpressionStatement', + expression: { + type: 'AssignmentExpression', + operator: '=', + left: { type: 'Identifier', - name: 'e', - range: [15, 16], + name: 'x', + range: [0, 1], loc: { - start: { line: 1, column: 15 }, - end: { line: 1, column: 16 } + start: { line: 1, column: 0 }, + end: { line: 1, column: 1 } } }, - body: { - type: 'BlockStatement', - body: [], - range: [18, 21], + right: { + type: 'ObjectExpression', + properties: [{ + type: 'Property', + key: { + type: 'Identifier', + name: 'get', + range: [6, 9], + loc: { + start: { line: 1, column: 6 }, + end: { line: 1, column: 9 } + } + }, + value: { + type: 'FunctionExpression', + id: null, + params: [], + defaults: [], + body: { + type: 'BlockStatement', + body: [], + range: [12, 15], + loc: { + start: { line: 1, column: 12 }, + end: { line: 1, column: 15 } + } + }, + rest: null, + generator: false, + expression: false, + range: [12, 15], + loc: { + start: { line: 1, column: 12 }, + end: { line: 1, column: 15 } + } + }, + kind: 'init', + method: true, + shorthand: false, + range: [6, 15], + loc: { + start: { line: 1, column: 6 }, + end: { line: 1, column: 15 } + } + }], + range: [4, 17], loc: { - start: { line: 1, column: 18 }, - end: { line: 1, column: 21 } + start: { line: 1, column: 4 }, + end: { line: 1, column: 17 } } }, - range: [8, 21], - loc: { - start: { line: 1, column: 8 }, - end: { line: 1, column: 21 } - } - }], - finalizer: null, - range: [0, 21], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 21 } - } - }, - - 'try { } catch (eval) { }': { - type: 'TryStatement', - block: { - type: 'BlockStatement', - body: [], - range: [4, 7], + range: [0, 17], loc: { - start: { line: 1, column: 4 }, - end: { line: 1, column: 7 } + start: { line: 1, column: 0 }, + end: { line: 1, column: 17 } } }, - guardedHandlers: [], - handlers: [{ - type: 'CatchClause', - param: { - type: 'Identifier', - name: 'eval', - range: [15, 19], - loc: { - start: { line: 1, column: 15 }, - end: { line: 1, column: 19 } - } - }, - body: { - type: 'BlockStatement', - body: [], - range: [21, 24], - loc: { - start: { line: 1, column: 21 }, - end: { line: 1, column: 24 } - } - }, - range: [8, 24], - loc: { - start: { line: 1, column: 8 }, - end: { line: 1, column: 24 } - } - }], - finalizer: null, - range: [0, 24], + range: [0, 17], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 24 } + end: { line: 1, column: 17 } } }, - 'try { } catch (arguments) { }': { - type: 'TryStatement', - block: { - type: 'BlockStatement', - body: [], - range: [4, 7], - loc: { - start: { line: 1, column: 4 }, - end: { line: 1, column: 7 } - } - }, - guardedHandlers: [], - handlers: [{ - type: 'CatchClause', - param: { + 'x = { set() { } }': { + type: 'ExpressionStatement', + expression: { + type: 'AssignmentExpression', + operator: '=', + left: { type: 'Identifier', - name: 'arguments', - range: [15, 24], + name: 'x', + range: [0, 1], loc: { - start: { line: 1, column: 15 }, - end: { line: 1, column: 24 } + start: { line: 1, column: 0 }, + end: { line: 1, column: 1 } } }, - body: { - type: 'BlockStatement', - body: [], - range: [26, 29], + right: { + type: 'ObjectExpression', + properties: [{ + type: 'Property', + key: { + type: 'Identifier', + name: 'set', + range: [6, 9], + loc: { + start: { line: 1, column: 6 }, + end: { line: 1, column: 9 } + } + }, + value: { + type: 'FunctionExpression', + id: null, + params: [], + defaults: [], + body: { + type: 'BlockStatement', + body: [], + range: [12, 15], + loc: { + start: { line: 1, column: 12 }, + end: { line: 1, column: 15 } + } + }, + rest: null, + generator: false, + expression: false, + range: [12, 15], + loc: { + start: { line: 1, column: 12 }, + end: { line: 1, column: 15 } + } + }, + kind: 'init', + method: true, + shorthand: false, + range: [6, 15], + loc: { + start: { line: 1, column: 6 }, + end: { line: 1, column: 15 } + } + }], + range: [4, 17], loc: { - start: { line: 1, column: 26 }, - end: { line: 1, column: 29 } + start: { line: 1, column: 4 }, + end: { line: 1, column: 17 } } }, - range: [8, 29], + range: [0, 17], loc: { - start: { line: 1, column: 8 }, - end: { line: 1, column: 29 } + start: { line: 1, column: 0 }, + end: { line: 1, column: 17 } } - }], - finalizer: null, - range: [0, 29], + }, + range: [0, 17], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 29 } + end: { line: 1, column: 17 } } - }, + } - 'try { } catch (e) { say(e) }': { - type: 'TryStatement', - block: { - type: 'BlockStatement', - body: [], - range: [4, 7], - loc: { - start: { line: 1, column: 4 }, - end: { line: 1, column: 7 } - } - }, - guardedHandlers: [], - handlers: [{ - type: 'CatchClause', - param: { + }, + + '[ES6] Object Literal Property Value Shorthand': { + + 'x = { y, z }': { + type: 'ExpressionStatement', + expression: { + type: 'AssignmentExpression', + operator: '=', + left: { type: 'Identifier', - name: 'e', - range: [15, 16], + name: 'x', + range: [0, 1], loc: { - start: { line: 1, column: 15 }, - end: { line: 1, column: 16 } + start: { line: 1, column: 0 }, + end: { line: 1, column: 1 } } }, - body: { - type: 'BlockStatement', - body: [{ - type: 'ExpressionStatement', - expression: { - type: 'CallExpression', - callee: { - type: 'Identifier', - name: 'say', - range: [20, 23], - loc: { - start: { line: 1, column: 20 }, - end: { line: 1, column: 23 } - } - }, - 'arguments': [{ - type: 'Identifier', - name: 'e', - range: [24, 25], - loc: { - start: { line: 1, column: 24 }, - end: { line: 1, column: 25 } - } - }], - range: [20, 26], + right: { + type: 'ObjectExpression', + properties: [{ + type: 'Property', + key: { + type: 'Identifier', + name: 'y', + range: [6, 7], loc: { - start: { line: 1, column: 20 }, - end: { line: 1, column: 26 } + start: { line: 1, column: 6 }, + end: { line: 1, column: 7 } } }, - range: [20, 27], + value: { + type: 'Identifier', + name: 'y', + range: [6, 7], + loc: { + start: { line: 1, column: 6 }, + end: { line: 1, column: 7 } + } + }, + kind: 'init', + method: false, + shorthand: true, + range: [6, 7], loc: { - start: { line: 1, column: 20 }, - end: { line: 1, column: 27 } + start: { line: 1, column: 6 }, + end: { line: 1, column: 7 } } - }], - range: [18, 28], - loc: { - start: { line: 1, column: 18 }, - end: { line: 1, column: 28 } - } - }, - range: [8, 28], - loc: { - start: { line: 1, column: 8 }, - end: { line: 1, column: 28 } - } - }], - finalizer: null, - range: [0, 28], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 28 } - } - }, - - 'try { } finally { cleanup(stuff) }': { - type: 'TryStatement', - block: { - type: 'BlockStatement', - body: [], - range: [4, 7], - loc: { - start: { line: 1, column: 4 }, - end: { line: 1, column: 7 } - } - }, - guardedHandlers: [], - handlers: [], - finalizer: { - type: 'BlockStatement', - body: [{ - type: 'ExpressionStatement', - expression: { - type: 'CallExpression', - callee: { + }, { + type: 'Property', + key: { type: 'Identifier', - name: 'cleanup', - range: [18, 25], + name: 'z', + range: [9, 10], loc: { - start: { line: 1, column: 18 }, - end: { line: 1, column: 25 } + start: { line: 1, column: 9 }, + end: { line: 1, column: 10 } } }, - 'arguments': [{ + value: { type: 'Identifier', - name: 'stuff', - range: [26, 31], + name: 'z', + range: [9, 10], loc: { - start: { line: 1, column: 26 }, - end: { line: 1, column: 31 } + start: { line: 1, column: 9 }, + end: { line: 1, column: 10 } } - }], - range: [18, 32], + }, + kind: 'init', + method: false, + shorthand: true, + range: [9, 10], loc: { - start: { line: 1, column: 18 }, - end: { line: 1, column: 32 } + start: { line: 1, column: 9 }, + end: { line: 1, column: 10 } } - }, - range: [18, 33], + }], + range: [4, 12], loc: { - start: { line: 1, column: 18 }, - end: { line: 1, column: 33 } + start: { line: 1, column: 4 }, + end: { line: 1, column: 12 } } - }], - range: [16, 34], + }, + range: [0, 12], loc: { - start: { line: 1, column: 16 }, - end: { line: 1, column: 34 } + start: { line: 1, column: 0 }, + end: { line: 1, column: 12 } } }, - range: [0, 34], + range: [0, 12], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 34 } + end: { line: 1, column: 12 } } - }, + } + }, - 'try { doThat(); } catch (e) { say(e) }': { - type: 'TryStatement', - block: { - type: 'BlockStatement', - body: [{ - type: 'ExpressionStatement', - expression: { - type: 'CallExpression', - callee: { - type: 'Identifier', - name: 'doThat', - range: [6, 12], - loc: { - start: { line: 1, column: 6 }, - end: { line: 1, column: 12 } - } - }, - 'arguments': [], - range: [6, 14], - loc: { - start: { line: 1, column: 6 }, - end: { line: 1, column: 14 } - } - }, - range: [6, 15], - loc: { - start: { line: 1, column: 6 }, - end: { line: 1, column: 15 } - } - }], - range: [4, 17], - loc: { - start: { line: 1, column: 4 }, - end: { line: 1, column: 17 } - } - }, - guardedHandlers: [], - handlers: [{ - type: 'CatchClause', - param: { + 'Assignment Operators': { + + 'x = 42': { + type: 'ExpressionStatement', + expression: { + type: 'AssignmentExpression', + operator: '=', + left: { type: 'Identifier', - name: 'e', - range: [25, 26], + name: 'x', + range: [0, 1], loc: { - start: { line: 1, column: 25 }, - end: { line: 1, column: 26 } + start: { line: 1, column: 0 }, + end: { line: 1, column: 1 } } }, - body: { - type: 'BlockStatement', - body: [{ - type: 'ExpressionStatement', - expression: { - type: 'CallExpression', - callee: { - type: 'Identifier', - name: 'say', - range: [30, 33], - loc: { - start: { line: 1, column: 30 }, - end: { line: 1, column: 33 } - } - }, - 'arguments': [{ - type: 'Identifier', - name: 'e', - range: [34, 35], - loc: { - start: { line: 1, column: 34 }, - end: { line: 1, column: 35 } - } - }], - range: [30, 36], - loc: { - start: { line: 1, column: 30 }, - end: { line: 1, column: 36 } - } - }, - range: [30, 37], - loc: { - start: { line: 1, column: 30 }, - end: { line: 1, column: 37 } - } - }], - range: [28, 38], + right: { + type: 'Literal', + value: 42, + raw: '42', + range: [4, 6], loc: { - start: { line: 1, column: 28 }, - end: { line: 1, column: 38 } + start: { line: 1, column: 4 }, + end: { line: 1, column: 6 } } }, - range: [18, 38], + range: [0, 6], loc: { - start: { line: 1, column: 18 }, - end: { line: 1, column: 38 } + start: { line: 1, column: 0 }, + end: { line: 1, column: 6 } } - }], - finalizer: null, - range: [0, 38], + }, + range: [0, 6], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 38 } + end: { line: 1, column: 6 } } }, - 'try { doThat(); } catch (e) { say(e) } finally { cleanup(stuff) }': { - type: 'TryStatement', - block: { - type: 'BlockStatement', - body: [{ - type: 'ExpressionStatement', - expression: { - type: 'CallExpression', - callee: { - type: 'Identifier', - name: 'doThat', - range: [6, 12], - loc: { - start: { line: 1, column: 6 }, - end: { line: 1, column: 12 } - } - }, - 'arguments': [], - range: [6, 14], - loc: { - start: { line: 1, column: 6 }, - end: { line: 1, column: 14 } - } - }, - range: [6, 15], + 'eval = 42': { + type: 'ExpressionStatement', + expression: { + type: 'AssignmentExpression', + operator: '=', + left: { + type: 'Identifier', + name: 'eval', + range: [0, 4], loc: { - start: { line: 1, column: 6 }, - end: { line: 1, column: 15 } + start: { line: 1, column: 0 }, + end: { line: 1, column: 4 } } - }], - range: [4, 17], + }, + right: { + type: 'Literal', + value: 42, + raw: '42', + range: [7, 9], + loc: { + start: { line: 1, column: 7 }, + end: { line: 1, column: 9 } + } + }, + range: [0, 9], loc: { - start: { line: 1, column: 4 }, - end: { line: 1, column: 17 } + start: { line: 1, column: 0 }, + end: { line: 1, column: 9 } } }, - guardedHandlers: [], - handlers: [{ - type: 'CatchClause', - param: { + range: [0, 9], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 9 } + } + }, + + 'arguments = 42': { + type: 'ExpressionStatement', + expression: { + type: 'AssignmentExpression', + operator: '=', + left: { type: 'Identifier', - name: 'e', - range: [25, 26], + name: 'arguments', + range: [0, 9], loc: { - start: { line: 1, column: 25 }, - end: { line: 1, column: 26 } + start: { line: 1, column: 0 }, + end: { line: 1, column: 9 } } }, - body: { - type: 'BlockStatement', - body: [{ - type: 'ExpressionStatement', - expression: { - type: 'CallExpression', - callee: { - type: 'Identifier', - name: 'say', - range: [30, 33], - loc: { - start: { line: 1, column: 30 }, - end: { line: 1, column: 33 } - } - }, - 'arguments': [{ - type: 'Identifier', - name: 'e', - range: [34, 35], - loc: { - start: { line: 1, column: 34 }, - end: { line: 1, column: 35 } - } - }], - range: [30, 36], - loc: { - start: { line: 1, column: 30 }, - end: { line: 1, column: 36 } - } - }, - range: [30, 37], - loc: { - start: { line: 1, column: 30 }, - end: { line: 1, column: 37 } - } - }], - range: [28, 38], + right: { + type: 'Literal', + value: 42, + raw: '42', + range: [12, 14], loc: { - start: { line: 1, column: 28 }, - end: { line: 1, column: 38 } + start: { line: 1, column: 12 }, + end: { line: 1, column: 14 } } }, - range: [18, 38], + range: [0, 14], loc: { - start: { line: 1, column: 18 }, - end: { line: 1, column: 38 } + start: { line: 1, column: 0 }, + end: { line: 1, column: 14 } } - }], - finalizer: { - type: 'BlockStatement', - body: [{ - type: 'ExpressionStatement', - expression: { - type: 'CallExpression', - callee: { - type: 'Identifier', - name: 'cleanup', - range: [49, 56], - loc: { - start: { line: 1, column: 49 }, - end: { line: 1, column: 56 } - } - }, - 'arguments': [{ - type: 'Identifier', - name: 'stuff', - range: [57, 62], - loc: { - start: { line: 1, column: 57 }, - end: { line: 1, column: 62 } - } - }], - range: [49, 63], - loc: { - start: { line: 1, column: 49 }, - end: { line: 1, column: 63 } - } - }, - range: [49, 64], + }, + range: [0, 14], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 14 } + } + }, + + 'x *= 42': { + type: 'ExpressionStatement', + expression: { + type: 'AssignmentExpression', + operator: '*=', + left: { + type: 'Identifier', + name: 'x', + range: [0, 1], loc: { - start: { line: 1, column: 49 }, - end: { line: 1, column: 64 } + start: { line: 1, column: 0 }, + end: { line: 1, column: 1 } } - }], - range: [47, 65], + }, + right: { + type: 'Literal', + value: 42, + raw: '42', + range: [5, 7], + loc: { + start: { line: 1, column: 5 }, + end: { line: 1, column: 7 } + } + }, + range: [0, 7], loc: { - start: { line: 1, column: 47 }, - end: { line: 1, column: 65 } + start: { line: 1, column: 0 }, + end: { line: 1, column: 7 } } }, - range: [0, 65], + range: [0, 7], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 65 } + end: { line: 1, column: 7 } } - } - - }, - - 'debugger statement': { + }, - 'debugger;': { - type: 'DebuggerStatement', - range: [0, 9], + 'x /= 42': { + type: 'ExpressionStatement', + expression: { + type: 'AssignmentExpression', + operator: '/=', + left: { + type: 'Identifier', + name: 'x', + range: [0, 1], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 1 } + } + }, + right: { + type: 'Literal', + value: 42, + raw: '42', + range: [5, 7], + loc: { + start: { line: 1, column: 5 }, + end: { line: 1, column: 7 } + } + }, + range: [0, 7], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 7 } + } + }, + range: [0, 7], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 9 } + end: { line: 1, column: 7 } } - } - - }, - - 'Function Definition': { + }, - 'function hello() { sayHi(); }': { - type: 'FunctionDeclaration', - id: { - type: 'Identifier', - name: 'hello', - range: [9, 14], - loc: { - start: { line: 1, column: 9 }, - end: { line: 1, column: 14 } - } - }, - params: [], - defaults: [], - body: { - type: 'BlockStatement', - body: [{ - type: 'ExpressionStatement', - expression: { - type: 'CallExpression', - callee: { - type: 'Identifier', - name: 'sayHi', - range: [19, 24], - loc: { - start: { line: 1, column: 19 }, - end: { line: 1, column: 24 } - } - }, - 'arguments': [], - range: [19, 26], - loc: { - start: { line: 1, column: 19 }, - end: { line: 1, column: 26 } - } - }, - range: [19, 27], + 'x %= 42': { + type: 'ExpressionStatement', + expression: { + type: 'AssignmentExpression', + operator: '%=', + left: { + type: 'Identifier', + name: 'x', + range: [0, 1], loc: { - start: { line: 1, column: 19 }, - end: { line: 1, column: 27 } + start: { line: 1, column: 0 }, + end: { line: 1, column: 1 } } - }], - range: [17, 29], + }, + right: { + type: 'Literal', + value: 42, + raw: '42', + range: [5, 7], + loc: { + start: { line: 1, column: 5 }, + end: { line: 1, column: 7 } + } + }, + range: [0, 7], loc: { - start: { line: 1, column: 17 }, - end: { line: 1, column: 29 } + start: { line: 1, column: 0 }, + end: { line: 1, column: 7 } } }, - rest: null, - generator: false, - expression: false, - range: [0, 29], + range: [0, 7], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 29 } + end: { line: 1, column: 7 } } }, - 'function eval() { }': { - type: 'FunctionDeclaration', - id: { - type: 'Identifier', - name: 'eval', - range: [9, 13], - loc: { - start: { line: 1, column: 9 }, - end: { line: 1, column: 13 } - } - }, - params: [], - defaults: [], - body: { - type: 'BlockStatement', - body: [], - range: [16, 19], + 'x += 42': { + type: 'ExpressionStatement', + expression: { + type: 'AssignmentExpression', + operator: '+=', + left: { + type: 'Identifier', + name: 'x', + range: [0, 1], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 1 } + } + }, + right: { + type: 'Literal', + value: 42, + raw: '42', + range: [5, 7], + loc: { + start: { line: 1, column: 5 }, + end: { line: 1, column: 7 } + } + }, + range: [0, 7], loc: { - start: { line: 1, column: 16 }, - end: { line: 1, column: 19 } + start: { line: 1, column: 0 }, + end: { line: 1, column: 7 } } }, - rest: null, - generator: false, - expression: false, - range: [0, 19], + range: [0, 7], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 19 } + end: { line: 1, column: 7 } } }, - 'function arguments() { }': { - type: 'FunctionDeclaration', - id: { - type: 'Identifier', - name: 'arguments', - range: [9, 18], - loc: { - start: { line: 1, column: 9 }, - end: { line: 1, column: 18 } - } - }, - params: [], - defaults: [], - body: { - type: 'BlockStatement', - body: [], - range: [21, 24], + 'x -= 42': { + type: 'ExpressionStatement', + expression: { + type: 'AssignmentExpression', + operator: '-=', + left: { + type: 'Identifier', + name: 'x', + range: [0, 1], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 1 } + } + }, + right: { + type: 'Literal', + value: 42, + raw: '42', + range: [5, 7], + loc: { + start: { line: 1, column: 5 }, + end: { line: 1, column: 7 } + } + }, + range: [0, 7], loc: { - start: { line: 1, column: 21 }, - end: { line: 1, column: 24 } + start: { line: 1, column: 0 }, + end: { line: 1, column: 7 } } }, - rest: null, - generator: false, - expression: false, - range: [0, 24], + range: [0, 7], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 24 } + end: { line: 1, column: 7 } } }, - 'function test(t, t) { }': { - type: 'FunctionDeclaration', - id: { - type: 'Identifier', - name: 'test', - range: [9, 13], - loc: { - start: { line: 1, column: 9 }, - end: { line: 1, column: 13 } - } - }, - params: [{ - type: 'Identifier', - name: 't', - range: [14, 15], - loc: { - start: { line: 1, column: 14 }, - end: { line: 1, column: 15 } - } - }, { - type: 'Identifier', - name: 't', - range: [17, 18], - loc: { - start: { line: 1, column: 17 }, - end: { line: 1, column: 18 } - } - }], - defaults: [], - body: { - type: 'BlockStatement', - body: [], - range: [20, 23], + 'x <<= 42': { + type: 'ExpressionStatement', + expression: { + type: 'AssignmentExpression', + operator: '<<=', + left: { + type: 'Identifier', + name: 'x', + range: [0, 1], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 1 } + } + }, + right: { + type: 'Literal', + value: 42, + raw: '42', + range: [6, 8], + loc: { + start: { line: 1, column: 6 }, + end: { line: 1, column: 8 } + } + }, + range: [0, 8], loc: { - start: { line: 1, column: 20 }, - end: { line: 1, column: 23 } + start: { line: 1, column: 0 }, + end: { line: 1, column: 8 } } }, - rest: null, - generator: false, - expression: false, - range: [0, 23], + range: [0, 8], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 23 } + end: { line: 1, column: 8 } } }, - '(function test(t, t) { })': { + 'x >>= 42': { type: 'ExpressionStatement', expression: { - type: 'FunctionExpression', - id: { + type: 'AssignmentExpression', + operator: '>>=', + left: { type: 'Identifier', - name: 'test', - range: [10, 14], + name: 'x', + range: [0, 1], loc: { - start: { line: 1, column: 10 }, - end: { line: 1, column: 14 } + start: { line: 1, column: 0 }, + end: { line: 1, column: 1 } } }, - params: [{ - type: 'Identifier', - name: 't', - range: [15, 16], + right: { + type: 'Literal', + value: 42, + raw: '42', + range: [6, 8], loc: { - start: { line: 1, column: 15 }, - end: { line: 1, column: 16 } + start: { line: 1, column: 6 }, + end: { line: 1, column: 8 } } - }, { + }, + range: [0, 8], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 8 } + } + }, + range: [0, 8], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 8 } + } + }, + + 'x >>>= 42': { + type: 'ExpressionStatement', + expression: { + type: 'AssignmentExpression', + operator: '>>>=', + left: { type: 'Identifier', - name: 't', - range: [18, 19], + name: 'x', + range: [0, 1], loc: { - start: { line: 1, column: 18 }, - end: { line: 1, column: 19 } + start: { line: 1, column: 0 }, + end: { line: 1, column: 1 } } - }], - defaults: [], - body: { - type: 'BlockStatement', - body: [], - range: [21, 24], + }, + right: { + type: 'Literal', + value: 42, + raw: '42', + range: [7, 9], loc: { - start: { line: 1, column: 21 }, - end: { line: 1, column: 24 } + start: { line: 1, column: 7 }, + end: { line: 1, column: 9 } } }, - rest: null, - generator: false, - expression: false, - range: [1, 24], + range: [0, 9], loc: { - start: { line: 1, column: 1 }, - end: { line: 1, column: 24 } + start: { line: 1, column: 0 }, + end: { line: 1, column: 9 } } }, - range: [0, 25], + range: [0, 9], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 25 } + end: { line: 1, column: 9 } } }, - 'function eval() { function inner() { "use strict" } }': { - type: 'FunctionDeclaration', - id: { - type: 'Identifier', - name: 'eval', - range: [9, 13], - loc: { - start: { line: 1, column: 9 }, - end: { line: 1, column: 13 } - } - }, - params: [], - defaults: [], - body: { - type: 'BlockStatement', - body: [{ - type: 'FunctionDeclaration', - id: { - type: 'Identifier', - name: 'inner', - range: [27, 32], - loc: { - start: { line: 1, column: 27 }, - end: { line: 1, column: 32 } - } - }, - params: [], - defaults: [], - body: { - type: 'BlockStatement', - body: [{ - type: 'ExpressionStatement', - expression: { - type: 'Literal', - value: 'use strict', - raw: '\"use strict\"', - range: [37, 49], - loc: { - start: { line: 1, column: 37 }, - end: { line: 1, column: 49 } - } - }, - range: [37, 50], - loc: { - start: { line: 1, column: 37 }, - end: { line: 1, column: 50 } - } - }], - range: [35, 51], - loc: { - start: { line: 1, column: 35 }, - end: { line: 1, column: 51 } - } - }, - rest: null, - generator: false, - expression: false, - range: [18, 51], + 'x &= 42': { + type: 'ExpressionStatement', + expression: { + type: 'AssignmentExpression', + operator: '&=', + left: { + type: 'Identifier', + name: 'x', + range: [0, 1], loc: { - start: { line: 1, column: 18 }, - end: { line: 1, column: 51 } + start: { line: 1, column: 0 }, + end: { line: 1, column: 1 } } - }], - range: [16, 53], + }, + right: { + type: 'Literal', + value: 42, + raw: '42', + range: [5, 7], + loc: { + start: { line: 1, column: 5 }, + end: { line: 1, column: 7 } + } + }, + range: [0, 7], loc: { - start: { line: 1, column: 16 }, - end: { line: 1, column: 53 } + start: { line: 1, column: 0 }, + end: { line: 1, column: 7 } } }, - rest: null, - generator: false, - expression: false, - range: [0, 53], + range: [0, 7], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 53 } + end: { line: 1, column: 7 } } }, - 'function hello(a) { sayHi(); }': { - type: 'FunctionDeclaration', - id: { - type: 'Identifier', - name: 'hello', - range: [9, 14], - loc: { - start: { line: 1, column: 9 }, - end: { line: 1, column: 14 } - } - }, - params: [{ - type: 'Identifier', - name: 'a', - range: [15, 16], - loc: { - start: { line: 1, column: 15 }, - end: { line: 1, column: 16 } - } - }], - defaults: [], - body: { - type: 'BlockStatement', - body: [{ - type: 'ExpressionStatement', - expression: { - type: 'CallExpression', - callee: { - type: 'Identifier', - name: 'sayHi', - range: [20, 25], - loc: { - start: { line: 1, column: 20 }, - end: { line: 1, column: 25 } - } - }, - 'arguments': [], - range: [20, 27], - loc: { - start: { line: 1, column: 20 }, - end: { line: 1, column: 27 } - } - }, - range: [20, 28], + 'x ^= 42': { + type: 'ExpressionStatement', + expression: { + type: 'AssignmentExpression', + operator: '^=', + left: { + type: 'Identifier', + name: 'x', + range: [0, 1], loc: { - start: { line: 1, column: 20 }, - end: { line: 1, column: 28 } + start: { line: 1, column: 0 }, + end: { line: 1, column: 1 } } - }], - range: [18, 30], + }, + right: { + type: 'Literal', + value: 42, + raw: '42', + range: [5, 7], + loc: { + start: { line: 1, column: 5 }, + end: { line: 1, column: 7 } + } + }, + range: [0, 7], loc: { - start: { line: 1, column: 18 }, - end: { line: 1, column: 30 } + start: { line: 1, column: 0 }, + end: { line: 1, column: 7 } } }, - rest: null, - generator: false, - expression: false, - range: [0, 30], + range: [0, 7], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 30 } + end: { line: 1, column: 7 } } }, - 'function hello(a, b) { sayHi(); }': { - type: 'FunctionDeclaration', - id: { - type: 'Identifier', - name: 'hello', - range: [9, 14], - loc: { - start: { line: 1, column: 9 }, - end: { line: 1, column: 14 } - } - }, - params: [{ - type: 'Identifier', - name: 'a', - range: [15, 16], - loc: { - start: { line: 1, column: 15 }, - end: { line: 1, column: 16 } - } - }, { - type: 'Identifier', - name: 'b', - range: [18, 19], - loc: { - start: { line: 1, column: 18 }, - end: { line: 1, column: 19 } - } - }], - defaults: [], - body: { - type: 'BlockStatement', - body: [{ - type: 'ExpressionStatement', - expression: { - type: 'CallExpression', - callee: { - type: 'Identifier', - name: 'sayHi', - range: [23, 28], - loc: { - start: { line: 1, column: 23 }, - end: { line: 1, column: 28 } - } - }, - 'arguments': [], - range: [23, 30], - loc: { - start: { line: 1, column: 23 }, - end: { line: 1, column: 30 } - } - }, - range: [23, 31], + 'x |= 42': { + type: 'ExpressionStatement', + expression: { + type: 'AssignmentExpression', + operator: '|=', + left: { + type: 'Identifier', + name: 'x', + range: [0, 1], loc: { - start: { line: 1, column: 23 }, - end: { line: 1, column: 31 } + start: { line: 1, column: 0 }, + end: { line: 1, column: 1 } } - }], - range: [21, 33], + }, + right: { + type: 'Literal', + value: 42, + raw: '42', + range: [5, 7], + loc: { + start: { line: 1, column: 5 }, + end: { line: 1, column: 7 } + } + }, + range: [0, 7], loc: { - start: { line: 1, column: 21 }, - end: { line: 1, column: 33 } + start: { line: 1, column: 0 }, + end: { line: 1, column: 7 } } }, - rest: null, - generator: false, - expression: false, - range: [0, 33], + range: [0, 7], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 33 } + end: { line: 1, column: 7 } } - }, + } - 'var hi = function() { sayHi() };': { - type: 'VariableDeclaration', - declarations: [{ - type: 'VariableDeclarator', - id: { + }, + + 'Complex Expression': { + + 'a || b && c | d ^ e & f == g < h >>> i + j * k': { + type: 'ExpressionStatement', + expression: { + type: 'LogicalExpression', + operator: '||', + left: { type: 'Identifier', - name: 'hi', - range: [4, 6], + name: 'a', + range: [0, 1], loc: { - start: { line: 1, column: 4 }, - end: { line: 1, column: 6 } + start: { line: 1, column: 0 }, + end: { line: 1, column: 1 } } }, - init: { - type: 'FunctionExpression', - id: null, - params: [], - defaults: [], - body: { - type: 'BlockStatement', - body: [{ - type: 'ExpressionStatement', - expression: { - type: 'CallExpression', - callee: { + right: { + type: 'LogicalExpression', + operator: '&&', + left: { + type: 'Identifier', + name: 'b', + range: [5, 6], + loc: { + start: { line: 1, column: 5 }, + end: { line: 1, column: 6 } + } + }, + right: { + type: 'BinaryExpression', + operator: '|', + left: { + type: 'Identifier', + name: 'c', + range: [10, 11], + loc: { + start: { line: 1, column: 10 }, + end: { line: 1, column: 11 } + } + }, + right: { + type: 'BinaryExpression', + operator: '^', + left: { + type: 'Identifier', + name: 'd', + range: [14, 15], + loc: { + start: { line: 1, column: 14 }, + end: { line: 1, column: 15 } + } + }, + right: { + type: 'BinaryExpression', + operator: '&', + left: { type: 'Identifier', - name: 'sayHi', - range: [22, 27], + name: 'e', + range: [18, 19], + loc: { + start: { line: 1, column: 18 }, + end: { line: 1, column: 19 } + } + }, + right: { + type: 'BinaryExpression', + operator: '==', + left: { + type: 'Identifier', + name: 'f', + range: [22, 23], + loc: { + start: { line: 1, column: 22 }, + end: { line: 1, column: 23 } + } + }, + right: { + type: 'BinaryExpression', + operator: '<', + left: { + type: 'Identifier', + name: 'g', + range: [27, 28], + loc: { + start: { line: 1, column: 27 }, + end: { line: 1, column: 28 } + } + }, + right: { + type: 'BinaryExpression', + operator: '>>>', + left: { + type: 'Identifier', + name: 'h', + range: [31, 32], + loc: { + start: { line: 1, column: 31 }, + end: { line: 1, column: 32 } + } + }, + right: { + type: 'BinaryExpression', + operator: '+', + left: { + type: 'Identifier', + name: 'i', + range: [37, 38], + loc: { + start: { line: 1, column: 37 }, + end: { line: 1, column: 38 } + } + }, + right: { + type: 'BinaryExpression', + operator: '*', + left: { + type: 'Identifier', + name: 'j', + range: [41, 42], + loc: { + start: { line: 1, column: 41 }, + end: { line: 1, column: 42 } + } + }, + right: { + type: 'Identifier', + name: 'k', + range: [45, 46], + loc: { + start: { line: 1, column: 45 }, + end: { line: 1, column: 46 } + } + }, + range: [41, 46], + loc: { + start: { line: 1, column: 41 }, + end: { line: 1, column: 46 } + } + }, + range: [37, 46], + loc: { + start: { line: 1, column: 37 }, + end: { line: 1, column: 46 } + } + }, + range: [31, 46], + loc: { + start: { line: 1, column: 31 }, + end: { line: 1, column: 46 } + } + }, + range: [27, 46], + loc: { + start: { line: 1, column: 27 }, + end: { line: 1, column: 46 } + } + }, + range: [22, 46], loc: { start: { line: 1, column: 22 }, - end: { line: 1, column: 27 } + end: { line: 1, column: 46 } } }, - 'arguments': [], - range: [22, 29], + range: [18, 46], loc: { - start: { line: 1, column: 22 }, - end: { line: 1, column: 29 } + start: { line: 1, column: 18 }, + end: { line: 1, column: 46 } } }, - range: [22, 30], + range: [14, 46], loc: { - start: { line: 1, column: 22 }, - end: { line: 1, column: 30 } + start: { line: 1, column: 14 }, + end: { line: 1, column: 46 } } - }], - range: [20, 31], + }, + range: [10, 46], loc: { - start: { line: 1, column: 20 }, - end: { line: 1, column: 31 } + start: { line: 1, column: 10 }, + end: { line: 1, column: 46 } } }, - rest: null, - generator: false, - expression: false, - range: [9, 31], + range: [5, 46], loc: { - start: { line: 1, column: 9 }, - end: { line: 1, column: 31 } + start: { line: 1, column: 5 }, + end: { line: 1, column: 46 } } }, - range: [4, 31], + range: [0, 46], loc: { - start: { line: 1, column: 4 }, - end: { line: 1, column: 31 } + start: { line: 1, column: 0 }, + end: { line: 1, column: 46 } } - }], - kind: 'var', - range: [0, 32], + }, + range: [0, 46], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 32 } + end: { line: 1, column: 46 } } - }, + } - 'var hi = function eval() { };': { - type: 'VariableDeclaration', - declarations: [{ - type: 'VariableDeclarator', - id: { + }, + + 'Block': { + + '{ foo }': { + type: 'BlockStatement', + body: [{ + type: 'ExpressionStatement', + expression: { type: 'Identifier', - name: 'hi', - range: [4, 6], + name: 'foo', + range: [2, 5], loc: { - start: { line: 1, column: 4 }, - end: { line: 1, column: 6 } + start: { line: 1, column: 2 }, + end: { line: 1, column: 5 } } }, - init: { - type: 'FunctionExpression', - id: { - type: 'Identifier', - name: 'eval', - range: [18, 22], - loc: { - start: { line: 1, column: 18 }, - end: { line: 1, column: 22 } - } - }, - params: [], - defaults: [], - body: { - type: 'BlockStatement', - body: [], - range: [25, 28], - loc: { - start: { line: 1, column: 25 }, - end: { line: 1, column: 28 } + range: [2, 6], + loc: { + start: { line: 1, column: 2 }, + end: { line: 1, column: 6 } + } + }], + range: [0, 7], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 7 } + } + }, + + '{ doThis(); doThat(); }': { + type: 'BlockStatement', + body: [{ + type: 'ExpressionStatement', + expression: { + type: 'CallExpression', + callee: { + type: 'Identifier', + name: 'doThis', + range: [2, 8], + loc: { + start: { line: 1, column: 2 }, + end: { line: 1, column: 8 } } }, - rest: null, - generator: false, - expression: false, - range: [9, 28], + 'arguments': [], + range: [2, 10], loc: { - start: { line: 1, column: 9 }, - end: { line: 1, column: 28 } + start: { line: 1, column: 2 }, + end: { line: 1, column: 10 } } }, - range: [4, 28], + range: [2, 11], + loc: { + start: { line: 1, column: 2 }, + end: { line: 1, column: 11 } + } + }, { + type: 'ExpressionStatement', + expression: { + type: 'CallExpression', + callee: { + type: 'Identifier', + name: 'doThat', + range: [12, 18], + loc: { + start: { line: 1, column: 12 }, + end: { line: 1, column: 18 } + } + }, + 'arguments': [], + range: [12, 20], + loc: { + start: { line: 1, column: 12 }, + end: { line: 1, column: 20 } + } + }, + range: [12, 21], + loc: { + start: { line: 1, column: 12 }, + end: { line: 1, column: 21 } + } + }], + range: [0, 23], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 23 } + } + }, + + '{}': { + type: 'BlockStatement', + body: [], + range: [0, 2], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 2 } + } + } + + }, + + 'Variable Statement': { + + 'var x': { + type: 'VariableDeclaration', + declarations: [{ + type: 'VariableDeclarator', + id: { + type: 'Identifier', + name: 'x', + range: [4, 5], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 5 } + } + }, + init: null, + range: [4, 5], loc: { start: { line: 1, column: 4 }, - end: { line: 1, column: 28 } + end: { line: 1, column: 5 } } }], kind: 'var', - range: [0, 29], + range: [0, 5], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 29 } + end: { line: 1, column: 5 } } }, - 'var hi = function arguments() { };': { + 'var x, y;': { type: 'VariableDeclaration', declarations: [{ type: 'VariableDeclarator', id: { type: 'Identifier', - name: 'hi', - range: [4, 6], + name: 'x', + range: [4, 5], loc: { start: { line: 1, column: 4 }, - end: { line: 1, column: 6 } + end: { line: 1, column: 5 } } }, - init: { - type: 'FunctionExpression', - id: { - type: 'Identifier', - name: 'arguments', - range: [18, 27], - loc: { - start: { line: 1, column: 18 }, - end: { line: 1, column: 27 } - } - }, - params: [], - defaults: [], - body: { - type: 'BlockStatement', - body: [], - range: [30, 33], - loc: { - start: { line: 1, column: 30 }, - end: { line: 1, column: 33 } - } - }, - rest: null, - generator: false, - expression: false, - range: [9, 33], + init: null, + range: [4, 5], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 5 } + } + }, { + type: 'VariableDeclarator', + id: { + type: 'Identifier', + name: 'y', + range: [7, 8], loc: { - start: { line: 1, column: 9 }, - end: { line: 1, column: 33 } + start: { line: 1, column: 7 }, + end: { line: 1, column: 8 } } }, - range: [4, 33], + init: null, + range: [7, 8], loc: { - start: { line: 1, column: 4 }, - end: { line: 1, column: 33 } + start: { line: 1, column: 7 }, + end: { line: 1, column: 8 } } }], kind: 'var', - range: [0, 34], + range: [0, 9], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 34 } + end: { line: 1, column: 9 } } }, - 'var hello = function hi() { sayHi() };': { + 'var x = 42': { type: 'VariableDeclaration', declarations: [{ type: 'VariableDeclarator', id: { type: 'Identifier', - name: 'hello', - range: [4, 9], + name: 'x', + range: [4, 5], loc: { start: { line: 1, column: 4 }, - end: { line: 1, column: 9 } + end: { line: 1, column: 5 } } }, init: { - type: 'FunctionExpression', - id: { - type: 'Identifier', - name: 'hi', - range: [21, 23], - loc: { - start: { line: 1, column: 21 }, - end: { line: 1, column: 23 } - } - }, - params: [], - defaults: [], - body: { - type: 'BlockStatement', - body: [{ - type: 'ExpressionStatement', - expression: { - type: 'CallExpression', - callee: { - type: 'Identifier', - name: 'sayHi', - range: [28, 33], - loc: { - start: { line: 1, column: 28 }, - end: { line: 1, column: 33 } - } - }, - 'arguments': [], - range: [28, 35], - loc: { - start: { line: 1, column: 28 }, - end: { line: 1, column: 35 } - } - }, - range: [28, 36], - loc: { - start: { line: 1, column: 28 }, - end: { line: 1, column: 36 } - } - }], - range: [26, 37], - loc: { - start: { line: 1, column: 26 }, - end: { line: 1, column: 37 } - } - }, - rest: null, - generator: false, - expression: false, - range: [12, 37], + type: 'Literal', + value: 42, + raw: '42', + range: [8, 10], loc: { - start: { line: 1, column: 12 }, - end: { line: 1, column: 37 } + start: { line: 1, column: 8 }, + end: { line: 1, column: 10 } } }, - range: [4, 37], + range: [4, 10], loc: { start: { line: 1, column: 4 }, - end: { line: 1, column: 37 } + end: { line: 1, column: 10 } } }], kind: 'var', - range: [0, 38], + range: [0, 10], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 38 } + end: { line: 1, column: 10 } } }, - '(function(){})': { - type: 'ExpressionStatement', - expression: { - type: 'FunctionExpression', - id: null, - params: [], - defaults: [], - body: { - type: 'BlockStatement', - body: [], - range: [11, 13], + 'var eval = 42, arguments = 42': { + type: 'VariableDeclaration', + declarations: [{ + type: 'VariableDeclarator', + id: { + type: 'Identifier', + name: 'eval', + range: [4, 8], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 8 } + } + }, + init: { + type: 'Literal', + value: 42, + raw: '42', + range: [11, 13], loc: { start: { line: 1, column: 11 }, end: { line: 1, column: 13 } } }, - rest: null, - generator: false, - expression: false, - range: [1, 13], + range: [4, 13], loc: { - start: { line: 1, column: 1 }, + start: { line: 1, column: 4 }, end: { line: 1, column: 13 } } - }, - range: [0, 14], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 14 } - } - } - - }, - - 'Automatic semicolon insertion': { - - '{ x\n++y }': { - type: 'BlockStatement', - body: [{ - type: 'ExpressionStatement', - expression: { + }, { + type: 'VariableDeclarator', + id: { type: 'Identifier', - name: 'x', - range: [2, 3], + name: 'arguments', + range: [15, 24], loc: { - start: { line: 1, column: 2 }, - end: { line: 1, column: 3 } + start: { line: 1, column: 15 }, + end: { line: 1, column: 24 } } }, - range: [2, 4], - loc: { - start: { line: 1, column: 2 }, - end: { line: 2, column: 0 } - } - }, { - type: 'ExpressionStatement', - expression: { - type: 'UpdateExpression', - operator: '++', - argument: { - type: 'Identifier', - name: 'y', - range: [6, 7], - loc: { - start: { line: 2, column: 2 }, - end: { line: 2, column: 3 } - } - }, - prefix: true, - range: [4, 7], + init: { + type: 'Literal', + value: 42, + raw: '42', + range: [27, 29], loc: { - start: { line: 2, column: 0 }, - end: { line: 2, column: 3 } + start: { line: 1, column: 27 }, + end: { line: 1, column: 29 } } }, - range: [4, 8], + range: [15, 29], loc: { - start: { line: 2, column: 0 }, - end: { line: 2, column: 4 } + start: { line: 1, column: 15 }, + end: { line: 1, column: 29 } } }], - range: [0, 9], + kind: 'var', + range: [0, 29], loc: { start: { line: 1, column: 0 }, - end: { line: 2, column: 5 } + end: { line: 1, column: 29 } } }, - '{ x\n--y }': { - type: 'BlockStatement', - body: [{ - type: 'ExpressionStatement', - expression: { + 'var x = 14, y = 3, z = 1977': { + type: 'VariableDeclaration', + declarations: [{ + type: 'VariableDeclarator', + id: { type: 'Identifier', name: 'x', - range: [2, 3], + range: [4, 5], loc: { - start: { line: 1, column: 2 }, - end: { line: 1, column: 3 } + start: { line: 1, column: 4 }, + end: { line: 1, column: 5 } + } + }, + init: { + type: 'Literal', + value: 14, + raw: '14', + range: [8, 10], + loc: { + start: { line: 1, column: 8 }, + end: { line: 1, column: 10 } } }, - range: [2, 4], + range: [4, 10], loc: { - start: { line: 1, column: 2 }, - end: { line: 2, column: 0 } + start: { line: 1, column: 4 }, + end: { line: 1, column: 10 } } }, { - type: 'ExpressionStatement', - expression: { - type: 'UpdateExpression', - operator: '--', - argument: { - type: 'Identifier', - name: 'y', - range: [6, 7], - loc: { - start: { line: 2, column: 2 }, - end: { line: 2, column: 3 } - } - }, - prefix: true, - range: [4, 7], + type: 'VariableDeclarator', + id: { + type: 'Identifier', + name: 'y', + range: [12, 13], loc: { - start: { line: 2, column: 0 }, - end: { line: 2, column: 3 } + start: { line: 1, column: 12 }, + end: { line: 1, column: 13 } } }, - range: [4, 8], + init: { + type: 'Literal', + value: 3, + raw: '3', + range: [16, 17], + loc: { + start: { line: 1, column: 16 }, + end: { line: 1, column: 17 } + } + }, + range: [12, 17], loc: { - start: { line: 2, column: 0 }, - end: { line: 2, column: 4 } + start: { line: 1, column: 12 }, + end: { line: 1, column: 17 } + } + }, { + type: 'VariableDeclarator', + id: { + type: 'Identifier', + name: 'z', + range: [19, 20], + loc: { + start: { line: 1, column: 19 }, + end: { line: 1, column: 20 } + } + }, + init: { + type: 'Literal', + value: 1977, + raw: '1977', + range: [23, 27], + loc: { + start: { line: 1, column: 23 }, + end: { line: 1, column: 27 } + } + }, + range: [19, 27], + loc: { + start: { line: 1, column: 19 }, + end: { line: 1, column: 27 } } }], - range: [0, 9], + kind: 'var', + range: [0, 27], loc: { start: { line: 1, column: 0 }, - end: { line: 2, column: 5 } + end: { line: 1, column: 27 } } }, - 'var x /* comment */;': { + 'var implements, interface, package': { type: 'VariableDeclaration', declarations: [{ type: 'VariableDeclarator', id: { type: 'Identifier', - name: 'x', - range: [4, 5], + name: 'implements', + range: [4, 14], loc: { start: { line: 1, column: 4 }, - end: { line: 1, column: 5 } + end: { line: 1, column: 14 } } }, init: null, - range: [4, 5], + range: [4, 14], loc: { start: { line: 1, column: 4 }, - end: { line: 1, column: 5 } + end: { line: 1, column: 14 } + } + }, { + type: 'VariableDeclarator', + id: { + type: 'Identifier', + name: 'interface', + range: [16, 25], + loc: { + start: { line: 1, column: 16 }, + end: { line: 1, column: 25 } + } + }, + init: null, + range: [16, 25], + loc: { + start: { line: 1, column: 16 }, + end: { line: 1, column: 25 } + } + }, { + type: 'VariableDeclarator', + id: { + type: 'Identifier', + name: 'package', + range: [27, 34], + loc: { + start: { line: 1, column: 27 }, + end: { line: 1, column: 34 } + } + }, + init: null, + range: [27, 34], + loc: { + start: { line: 1, column: 27 }, + end: { line: 1, column: 34 } } }], kind: 'var', - range: [0, 20], + range: [0, 34], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 20 } + end: { line: 1, column: 34 } } }, - '{ var x = 14, y = 3\nz; }': { - type: 'BlockStatement', - body: [{ - type: 'VariableDeclaration', - declarations: [{ - type: 'VariableDeclarator', - id: { - type: 'Identifier', - name: 'x', - range: [6, 7], - loc: { - start: { line: 1, column: 6 }, - end: { line: 1, column: 7 } + 'var private, protected, public, static': { + type: 'VariableDeclaration', + declarations: [{ + type: 'VariableDeclarator', + id: { + type: 'Identifier', + name: 'private', + range: [4, 11], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 11 } + } + }, + init: null, + range: [4, 11], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 11 } + } + }, { + type: 'VariableDeclarator', + id: { + type: 'Identifier', + name: 'protected', + range: [13, 22], + loc: { + start: { line: 1, column: 13 }, + end: { line: 1, column: 22 } + } + }, + init: null, + range: [13, 22], + loc: { + start: { line: 1, column: 13 }, + end: { line: 1, column: 22 } + } + }, { + type: 'VariableDeclarator', + id: { + type: 'Identifier', + name: 'public', + range: [24, 30], + loc: { + start: { line: 1, column: 24 }, + end: { line: 1, column: 30 } + } + }, + init: null, + range: [24, 30], + loc: { + start: { line: 1, column: 24 }, + end: { line: 1, column: 30 } + } + }, { + type: 'VariableDeclarator', + id: { + type: 'Identifier', + name: 'static', + range: [32, 38], + loc: { + start: { line: 1, column: 32 }, + end: { line: 1, column: 38 } + } + }, + init: null, + range: [32, 38], + loc: { + start: { line: 1, column: 32 }, + end: { line: 1, column: 38 } + } + }], + kind: 'var', + range: [0, 38], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 38 } + } + } + + }, + + 'Let Statement': { + + 'let x': { + type: 'VariableDeclaration', + declarations: [{ + type: 'VariableDeclarator', + id: { + type: 'Identifier', + name: 'x', + range: [4, 5], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 5 } + } + }, + init: null, + range: [4, 5], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 5 } + } + }], + kind: 'let', + range: [0, 5], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 5 } + } + }, + + '{ let x }': { + type: 'BlockStatement', + body: [{ + type: 'VariableDeclaration', + declarations: [{ + type: 'VariableDeclarator', + id: { + type: 'Identifier', + name: 'x', + range: [6, 7], + loc: { + start: { line: 1, column: 6 }, + end: { line: 1, column: 7 } + } + }, + init: null, + range: [6, 7], + loc: { + start: { line: 1, column: 6 }, + end: { line: 1, column: 7 } + } + }], + kind: 'let', + range: [2, 8], + loc: { + start: { line: 1, column: 2 }, + end: { line: 1, column: 8 } + } + }], + range: [0, 9], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 9 } + } + }, + + '{ let x = 42 }': { + type: 'BlockStatement', + body: [{ + type: 'VariableDeclaration', + declarations: [{ + type: 'VariableDeclarator', + id: { + type: 'Identifier', + name: 'x', + range: [6, 7], + loc: { + start: { line: 1, column: 6 }, + end: { line: 1, column: 7 } + } + }, + init: { + type: 'Literal', + value: 42, + raw: '42', + range: [10, 12], + loc: { + start: { line: 1, column: 10 }, + end: { line: 1, column: 12 } + } + }, + range: [6, 12], + loc: { + start: { line: 1, column: 6 }, + end: { line: 1, column: 12 } + } + }], + kind: 'let', + range: [2, 13], + loc: { + start: { line: 1, column: 2 }, + end: { line: 1, column: 13 } + } + }], + range: [0, 14], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 14 } + } + }, + + '{ let x = 14, y = 3, z = 1977 }': { + type: 'BlockStatement', + body: [{ + type: 'VariableDeclaration', + declarations: [{ + type: 'VariableDeclarator', + id: { + type: 'Identifier', + name: 'x', + range: [6, 7], + loc: { + start: { line: 1, column: 6 }, + end: { line: 1, column: 7 } } }, init: { @@ -14919,841 +15354,7210 @@ var testFixture = { start: { line: 1, column: 14 }, end: { line: 1, column: 19 } } - }], - kind: 'var', - range: [2, 20], - loc: { - start: { line: 1, column: 2 }, - end: { line: 2, column: 0 } - } - }, { - type: 'ExpressionStatement', - expression: { - type: 'Identifier', - name: 'z', - range: [20, 21], + }, { + type: 'VariableDeclarator', + id: { + type: 'Identifier', + name: 'z', + range: [21, 22], + loc: { + start: { line: 1, column: 21 }, + end: { line: 1, column: 22 } + } + }, + init: { + type: 'Literal', + value: 1977, + raw: '1977', + range: [25, 29], + loc: { + start: { line: 1, column: 25 }, + end: { line: 1, column: 29 } + } + }, + range: [21, 29], loc: { - start: { line: 2, column: 0 }, - end: { line: 2, column: 1 } + start: { line: 1, column: 21 }, + end: { line: 1, column: 29 } } - }, - range: [20, 22], + }], + kind: 'let', + range: [2, 30], loc: { - start: { line: 2, column: 0 }, - end: { line: 2, column: 2 } + start: { line: 1, column: 2 }, + end: { line: 1, column: 30 } } }], - range: [0, 24], + range: [0, 31], loc: { start: { line: 1, column: 0 }, - end: { line: 2, column: 4 } + end: { line: 1, column: 31 } } - }, + } - 'while (true) { continue\nthere; }': { - type: 'WhileStatement', - test: { - type: 'Literal', - value: true, - raw: 'true', - range: [7, 11], - loc: { - start: { line: 1, column: 7 }, - end: { line: 1, column: 11 } - } - }, - body: { - type: 'BlockStatement', - body: [{ - type: 'ContinueStatement', - label: null, - range: [15, 23], + }, + + 'Const Statement': { + + 'const x = 42': { + type: 'VariableDeclaration', + declarations: [{ + type: 'VariableDeclarator', + id: { + type: 'Identifier', + name: 'x', + range: [6, 7], loc: { - start: { line: 1, column: 15 }, - end: { line: 1, column: 23 } + start: { line: 1, column: 6 }, + end: { line: 1, column: 7 } } - }, { - type: 'ExpressionStatement', - expression: { - type: 'Identifier', - name: 'there', - range: [24, 29], - loc: { - start: { line: 2, column: 0 }, - end: { line: 2, column: 5 } - } - }, - range: [24, 30], + }, + init: { + type: 'Literal', + value: 42, + raw: '42', + range: [10, 12], loc: { - start: { line: 2, column: 0 }, - end: { line: 2, column: 6 } + start: { line: 1, column: 10 }, + end: { line: 1, column: 12 } } - }], - range: [13, 32], + }, + range: [6, 12], loc: { - start: { line: 1, column: 13 }, - end: { line: 2, column: 8 } + start: { line: 1, column: 6 }, + end: { line: 1, column: 12 } } - }, - range: [0, 32], + }], + kind: 'const', + range: [0, 12], loc: { start: { line: 1, column: 0 }, - end: { line: 2, column: 8 } + end: { line: 1, column: 12 } } }, - 'while (true) { continue // Comment\nthere; }': { - type: 'WhileStatement', - test: { - type: 'Literal', - value: true, - raw: 'true', - range: [7, 11], - loc: { - start: { line: 1, column: 7 }, - end: { line: 1, column: 11 } - } - }, - body: { - type: 'BlockStatement', - body: [{ - type: 'ContinueStatement', - label: null, - range: [15, 23], - loc: { - start: { line: 1, column: 15 }, - end: { line: 1, column: 23 } - } - }, { - type: 'ExpressionStatement', - expression: { + '{ const x = 42 }': { + type: 'BlockStatement', + body: [{ + type: 'VariableDeclaration', + declarations: [{ + type: 'VariableDeclarator', + id: { type: 'Identifier', - name: 'there', - range: [35, 40], + name: 'x', + range: [8, 9], loc: { - start: { line: 2, column: 0 }, - end: { line: 2, column: 5 } + start: { line: 1, column: 8 }, + end: { line: 1, column: 9 } } }, - range: [35, 41], + init: { + type: 'Literal', + value: 42, + raw: '42', + range: [12, 14], + loc: { + start: { line: 1, column: 12 }, + end: { line: 1, column: 14 } + } + }, + range: [8, 14], loc: { - start: { line: 2, column: 0 }, - end: { line: 2, column: 6 } + start: { line: 1, column: 8 }, + end: { line: 1, column: 14 } } }], - range: [13, 43], + kind: 'const', + range: [2, 15], loc: { - start: { line: 1, column: 13 }, - end: { line: 2, column: 8 } + start: { line: 1, column: 2 }, + end: { line: 1, column: 15 } } - }, - range: [0, 43], + }], + range: [0, 16], loc: { start: { line: 1, column: 0 }, - end: { line: 2, column: 8 } + end: { line: 1, column: 16 } } }, - 'while (true) { continue /* Multiline\nComment */there; }': { - type: 'WhileStatement', - test: { - type: 'Literal', - value: true, - raw: 'true', - range: [7, 11], - loc: { - start: { line: 1, column: 7 }, - end: { line: 1, column: 11 } - } - }, - body: { - type: 'BlockStatement', - body: [{ - type: 'ContinueStatement', - label: null, - range: [15, 23], + '{ const x = 14, y = 3, z = 1977 }': { + type: 'BlockStatement', + body: [{ + type: 'VariableDeclaration', + declarations: [{ + type: 'VariableDeclarator', + id: { + type: 'Identifier', + name: 'x', + range: [8, 9], + loc: { + start: { line: 1, column: 8 }, + end: { line: 1, column: 9 } + } + }, + init: { + type: 'Literal', + value: 14, + raw: '14', + range: [12, 14], + loc: { + start: { line: 1, column: 12 }, + end: { line: 1, column: 14 } + } + }, + range: [8, 14], loc: { - start: { line: 1, column: 15 }, - end: { line: 1, column: 23 } + start: { line: 1, column: 8 }, + end: { line: 1, column: 14 } } }, { - type: 'ExpressionStatement', - expression: { + type: 'VariableDeclarator', + id: { type: 'Identifier', - name: 'there', - range: [47, 52], + name: 'y', + range: [16, 17], loc: { - start: { line: 2, column: 10 }, - end: { line: 2, column: 15 } + start: { line: 1, column: 16 }, + end: { line: 1, column: 17 } } }, - range: [47, 53], + init: { + type: 'Literal', + value: 3, + raw: '3', + range: [20, 21], + loc: { + start: { line: 1, column: 20 }, + end: { line: 1, column: 21 } + } + }, + range: [16, 21], loc: { - start: { line: 2, column: 10 }, - end: { line: 2, column: 16 } + start: { line: 1, column: 16 }, + end: { line: 1, column: 21 } + } + }, { + type: 'VariableDeclarator', + id: { + type: 'Identifier', + name: 'z', + range: [23, 24], + loc: { + start: { line: 1, column: 23 }, + end: { line: 1, column: 24 } + } + }, + init: { + type: 'Literal', + value: 1977, + raw: '1977', + range: [27, 31], + loc: { + start: { line: 1, column: 27 }, + end: { line: 1, column: 31 } + } + }, + range: [23, 31], + loc: { + start: { line: 1, column: 23 }, + end: { line: 1, column: 31 } } }], - range: [13, 55], + kind: 'const', + range: [2, 32], loc: { - start: { line: 1, column: 13 }, - end: { line: 2, column: 18 } + start: { line: 1, column: 2 }, + end: { line: 1, column: 32 } } - }, - range: [0, 55], + }], + range: [0, 33], loc: { start: { line: 1, column: 0 }, - end: { line: 2, column: 18 } + end: { line: 1, column: 33 } } - }, + } - 'while (true) { break\nthere; }': { - type: 'WhileStatement', - test: { - type: 'Literal', - value: true, - raw: 'true', - range: [7, 11], + }, + + 'Empty Statement': { + + ';': { + type: 'EmptyStatement', + range: [0, 1], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 1 } + } + } + + }, + + 'Expression Statement': { + + 'x': { + type: 'ExpressionStatement', + expression: { + type: 'Identifier', + name: 'x', + range: [0, 1], loc: { - start: { line: 1, column: 7 }, - end: { line: 1, column: 11 } + start: { line: 1, column: 0 }, + end: { line: 1, column: 1 } } }, - body: { - type: 'BlockStatement', - body: [{ - type: 'BreakStatement', - label: null, - range: [15, 20], + range: [0, 1], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 1 } + } + }, + + 'x, y': { + type: 'ExpressionStatement', + expression: { + type: 'SequenceExpression', + expressions: [{ + type: 'Identifier', + name: 'x', + range: [0, 1], loc: { - start: { line: 1, column: 15 }, - end: { line: 1, column: 20 } + start: { line: 1, column: 0 }, + end: { line: 1, column: 1 } } }, { - type: 'ExpressionStatement', - expression: { - type: 'Identifier', - name: 'there', - range: [21, 26], - loc: { - start: { line: 2, column: 0 }, - end: { line: 2, column: 5 } - } - }, - range: [21, 27], + type: 'Identifier', + name: 'y', + range: [3, 4], loc: { - start: { line: 2, column: 0 }, - end: { line: 2, column: 6 } + start: { line: 1, column: 3 }, + end: { line: 1, column: 4 } } }], - range: [13, 29], + range: [0, 4], loc: { - start: { line: 1, column: 13 }, - end: { line: 2, column: 8 } + start: { line: 1, column: 0 }, + end: { line: 1, column: 4 } } }, - range: [0, 29], + range: [0, 4], loc: { start: { line: 1, column: 0 }, - end: { line: 2, column: 8 } + end: { line: 1, column: 4 } } }, - 'while (true) { break // Comment\nthere; }': { - type: 'WhileStatement', - test: { - type: 'Literal', - value: true, - raw: 'true', - range: [7, 11], + '\\u0061': { + type: 'ExpressionStatement', + expression: { + type: 'Identifier', + name: 'a', + range: [0, 6], loc: { - start: { line: 1, column: 7 }, - end: { line: 1, column: 11 } + start: { line: 1, column: 0 }, + end: { line: 1, column: 6 } } }, - body: { - type: 'BlockStatement', - body: [{ - type: 'BreakStatement', - label: null, - range: [15, 20], - loc: { - start: { line: 1, column: 15 }, - end: { line: 1, column: 20 } - } - }, { - type: 'ExpressionStatement', - expression: { - type: 'Identifier', - name: 'there', - range: [32, 37], - loc: { - start: { line: 2, column: 0 }, - end: { line: 2, column: 5 } - } - }, - range: [32, 38], - loc: { - start: { line: 2, column: 0 }, - end: { line: 2, column: 6 } - } - }], - range: [13, 40], + range: [0, 6], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 6 } + } + }, + + 'a\\u0061': { + type: 'ExpressionStatement', + expression: { + type: 'Identifier', + name: 'aa', + range: [0, 7], loc: { - start: { line: 1, column: 13 }, - end: { line: 2, column: 8 } + start: { line: 1, column: 0 }, + end: { line: 1, column: 7 } } }, - range: [0, 40], + range: [0, 7], loc: { start: { line: 1, column: 0 }, - end: { line: 2, column: 8 } + end: { line: 1, column: 7 } } }, - 'while (true) { break /* Multiline\nComment */there; }': { - type: 'WhileStatement', + '\\u0061a': { + type: 'ExpressionStatement', + expression: { + type: 'Identifier', + name: 'aa', + range: [0, 7], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 7 } + } + }, + range: [0, 7], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 7 } + } + }, + + '\\u0061a ': { + type: 'ExpressionStatement', + expression: { + type: 'Identifier', + name: 'aa', + range: [0, 7], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 7 } + } + }, + range: [0, 8], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 8 } + } + } + }, + + 'If Statement': { + + 'if (morning) goodMorning()': { + type: 'IfStatement', test: { - type: 'Literal', - value: true, - raw: 'true', - range: [7, 11], + type: 'Identifier', + name: 'morning', + range: [4, 11], loc: { - start: { line: 1, column: 7 }, + start: { line: 1, column: 4 }, end: { line: 1, column: 11 } } }, - body: { - type: 'BlockStatement', - body: [{ - type: 'BreakStatement', - label: null, - range: [15, 20], - loc: { - start: { line: 1, column: 15 }, - end: { line: 1, column: 20 } - } - }, { - type: 'ExpressionStatement', - expression: { + consequent: { + type: 'ExpressionStatement', + expression: { + type: 'CallExpression', + callee: { type: 'Identifier', - name: 'there', - range: [44, 49], + name: 'goodMorning', + range: [13, 24], loc: { - start: { line: 2, column: 10 }, - end: { line: 2, column: 15 } + start: { line: 1, column: 13 }, + end: { line: 1, column: 24 } } }, - range: [44, 50], + 'arguments': [], + range: [13, 26], loc: { - start: { line: 2, column: 10 }, - end: { line: 2, column: 16 } + start: { line: 1, column: 13 }, + end: { line: 1, column: 26 } } - }], - range: [13, 52], + }, + range: [13, 26], loc: { start: { line: 1, column: 13 }, - end: { line: 2, column: 18 } + end: { line: 1, column: 26 } } }, - range: [0, 52], + alternate: null, + range: [0, 26], loc: { start: { line: 1, column: 0 }, - end: { line: 2, column: 18 } + end: { line: 1, column: 26 } } }, - '(function(){ return\nx; })': { - type: 'ExpressionStatement', - expression: { - type: 'FunctionExpression', - id: null, - params: [], - defaults: [], - body: { - type: 'BlockStatement', - body: [ - { - type: 'ReturnStatement', - argument: null, - range: [13, 19], - loc: { - start: { line: 1, column: 13 }, - end: { line: 1, column: 19 } - } - }, - { - type: 'ExpressionStatement', - expression: { - type: 'Identifier', - name: 'x', - range: [20, 21], - loc: { - start: { line: 2, column: 0 }, - end: { line: 2, column: 1 } - } - }, - range: [20, 22], - loc: { - start: { line: 2, column: 0 }, - end: { line: 2, column: 2 } - } + 'if (morning) (function(){})': { + type: 'IfStatement', + test: { + type: 'Identifier', + name: 'morning', + range: [4, 11], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 11 } + } + }, + consequent: { + type: 'ExpressionStatement', + expression: { + type: 'FunctionExpression', + id: null, + params: [], + defaults: [], + body: { + type: 'BlockStatement', + body: [], + range: [24, 26], + loc: { + start: { line: 1, column: 24 }, + end: { line: 1, column: 26 } } - ], - range: [11, 24], + }, + rest: null, + generator: false, + expression: false, + range: [14, 26], loc: { - start: { line: 1, column: 11 }, - end: { line: 2, column: 4 } + start: { line: 1, column: 14 }, + end: { line: 1, column: 26 } } }, - rest: null, - generator: false, - expression: false, - range: [1, 24], + range: [13, 27], loc: { - start: { line: 1, column: 1 }, - end: { line: 2, column: 4 } + start: { line: 1, column: 13 }, + end: { line: 1, column: 27 } } }, - range: [0, 25], + alternate: null, + range: [0, 27], loc: { start: { line: 1, column: 0 }, - end: { line: 2, column: 5 } + end: { line: 1, column: 27 } } }, - '(function(){ return // Comment\nx; })': { - type: 'ExpressionStatement', - expression: { - type: 'FunctionExpression', - id: null, - params: [], - defaults: [], - body: { - type: 'BlockStatement', - body: [ - { - type: 'ReturnStatement', - argument: null, - range: [13, 19], - loc: { - start: { line: 1, column: 13 }, - end: { line: 1, column: 19 } - } - }, - { - type: 'ExpressionStatement', - expression: { - type: 'Identifier', - name: 'x', - range: [31, 32], - loc: { - start: { line: 2, column: 0 }, - end: { line: 2, column: 1 } - } - }, - range: [31, 33], - loc: { - start: { line: 2, column: 0 }, - end: { line: 2, column: 2 } - } + 'if (morning) var x = 0;': { + type: 'IfStatement', + test: { + type: 'Identifier', + name: 'morning', + range: [4, 11], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 11 } + } + }, + consequent: { + type: 'VariableDeclaration', + declarations: [{ + type: 'VariableDeclarator', + id: { + type: 'Identifier', + name: 'x', + range: [17, 18], + loc: { + start: { line: 1, column: 17 }, + end: { line: 1, column: 18 } } - ], - range: [11, 35], + }, + init: { + type: 'Literal', + value: 0, + raw: '0', + range: [21, 22], + loc: { + start: { line: 1, column: 21 }, + end: { line: 1, column: 22 } + } + }, + range: [17, 22], loc: { - start: { line: 1, column: 11 }, - end: { line: 2, column: 4 } + start: { line: 1, column: 17 }, + end: { line: 1, column: 22 } } - }, - rest: null, - generator: false, - expression: false, - range: [1, 35], + }], + kind: 'var', + range: [13, 23], loc: { - start: { line: 1, column: 1 }, - end: { line: 2, column: 4 } + start: { line: 1, column: 13 }, + end: { line: 1, column: 23 } } }, - range: [0, 36], + alternate: null, + range: [0, 23], loc: { start: { line: 1, column: 0 }, - end: { line: 2, column: 5 } + end: { line: 1, column: 23 } } }, - '(function(){ return/* Multiline\nComment */x; })': { - type: 'ExpressionStatement', - expression: { - type: 'FunctionExpression', - id: null, + 'if (morning) function a(){}': { + type: 'IfStatement', + test: { + type: 'Identifier', + name: 'morning', + range: [4, 11], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 11 } + } + }, + consequent: { + type: 'FunctionDeclaration', + id: { + type: 'Identifier', + name: 'a', + range: [22, 23], + loc: { + start: { line: 1, column: 22 }, + end: { line: 1, column: 23 } + } + }, params: [], defaults: [], body: { type: 'BlockStatement', - body: [ - { - type: 'ReturnStatement', - argument: null, - range: [13, 19], - loc: { - start: { line: 1, column: 13 }, - end: { line: 1, column: 19 } - } - }, - { - type: 'ExpressionStatement', - expression: { - type: 'Identifier', - name: 'x', - range: [42, 43], - loc: { - start: { line: 2, column: 10 }, - end: { line: 2, column: 11 } - } - }, - range: [42, 44], - loc: { - start: { line: 2, column: 10 }, - end: { line: 2, column: 12 } - } - } - ], - range: [11, 46], + body: [], + range: [25, 27], loc: { - start: { line: 1, column: 11 }, - end: { line: 2, column: 14 } + start: { line: 1, column: 25 }, + end: { line: 1, column: 27 } } }, rest: null, generator: false, expression: false, - range: [1, 46], + range: [13, 27], loc: { - start: { line: 1, column: 1 }, - end: { line: 2, column: 14 } + start: { line: 1, column: 13 }, + end: { line: 1, column: 27 } } }, - range: [0, 47], + alternate: null, + range: [0, 27], loc: { start: { line: 1, column: 0 }, - end: { line: 2, column: 15 } + end: { line: 1, column: 27 } } }, - '{ throw error\nerror; }': { - type: 'BlockStatement', - body: [{ - type: 'ThrowStatement', - argument: { - type: 'Identifier', - name: 'error', - range: [8, 13], - loc: { - start: { line: 1, column: 8 }, - end: { line: 1, column: 13 } - } - }, - range: [2, 14], + 'if (morning) goodMorning(); else goodDay()': { + type: 'IfStatement', + test: { + type: 'Identifier', + name: 'morning', + range: [4, 11], loc: { - start: { line: 1, column: 2 }, - end: { line: 2, column: 0 } + start: { line: 1, column: 4 }, + end: { line: 1, column: 11 } } - }, { + }, + consequent: { type: 'ExpressionStatement', expression: { - type: 'Identifier', - name: 'error', - range: [14, 19], + type: 'CallExpression', + callee: { + type: 'Identifier', + name: 'goodMorning', + range: [13, 24], + loc: { + start: { line: 1, column: 13 }, + end: { line: 1, column: 24 } + } + }, + 'arguments': [], + range: [13, 26], loc: { - start: { line: 2, column: 0 }, - end: { line: 2, column: 5 } + start: { line: 1, column: 13 }, + end: { line: 1, column: 26 } } }, - range: [14, 20], + range: [13, 27], loc: { - start: { line: 2, column: 0 }, - end: { line: 2, column: 6 } + start: { line: 1, column: 13 }, + end: { line: 1, column: 27 } } - }], - range: [0, 22], + }, + alternate: { + type: 'ExpressionStatement', + expression: { + type: 'CallExpression', + callee: { + type: 'Identifier', + name: 'goodDay', + range: [33, 40], + loc: { + start: { line: 1, column: 33 }, + end: { line: 1, column: 40 } + } + }, + 'arguments': [], + range: [33, 42], + loc: { + start: { line: 1, column: 33 }, + end: { line: 1, column: 42 } + } + }, + range: [33, 42], + loc: { + start: { line: 1, column: 33 }, + end: { line: 1, column: 42 } + } + }, + range: [0, 42], loc: { start: { line: 1, column: 0 }, - end: { line: 2, column: 8 } + end: { line: 1, column: 42 } } }, - '{ throw error// Comment\nerror; }': { - type: 'BlockStatement', - body: [{ - type: 'ThrowStatement', - argument: { - type: 'Identifier', - name: 'error', - range: [8, 13], - loc: { - start: { line: 1, column: 8 }, - end: { line: 1, column: 13 } - } - }, - range: [2, 24], + 'if (true) that()\n; else;': { + type: "IfStatement", + test: { + type: "Literal", + value: true, + raw: "true", + range: [4, 8], loc: { - start: { line: 1, column: 2 }, - end: { line: 2, column: 0 } + start: { line: 1, column: 4 }, + end: { line: 1, column: 8 } } - }, { - type: 'ExpressionStatement', + }, + consequent: { + type: "ExpressionStatement", expression: { - type: 'Identifier', - name: 'error', - range: [24, 29], + type: "CallExpression", + callee: { + type: "Identifier", + name: "that", + range: [10, 14], + loc: { + start: { line: 1, column: 10 }, + end: { line: 1, column: 14 } + } + }, + "arguments": [], + range: [10, 16], loc: { - start: { line: 2, column: 0 }, - end: { line: 2, column: 5 } + start: { line: 1, column: 10 }, + end: { line: 1, column: 16 } } }, - range: [24, 30], + range: [10, 18], loc: { - start: { line: 2, column: 0 }, - end: { line: 2, column: 6 } + start: { line: 1, column: 10 }, + end: { line: 2, column: 1 } } - }], - range: [0, 32], + }, + alternate: { + type: "EmptyStatement", + range: [23, 24], + loc: { + start: { line: 2, column: 6 }, + end: { line: 2, column: 7 } + } + }, + range: [0, 24], loc: { start: { line: 1, column: 0 }, - end: { line: 2, column: 8 } + end: { line: 2, column: 7 } } }, - '{ throw error/* Multiline\nComment */error; }': { - type: 'BlockStatement', - body: [{ - type: 'ThrowStatement', - argument: { - type: 'Identifier', - name: 'error', - range: [8, 13], - loc: { - start: { line: 1, column: 8 }, - end: { line: 1, column: 13 } - } - }, - range: [2, 36], + 'if (true) that(); else;': { + type: "IfStatement", + test: { + type: "Literal", + value: true, + raw: "true", + range: [4, 8], loc: { - start: { line: 1, column: 2 }, - end: { line: 2, column: 10 } + start: { line: 1, column: 4 }, + end: { line: 1, column: 8 } } - }, { - type: 'ExpressionStatement', + }, + consequent: { + type: "ExpressionStatement", expression: { - type: 'Identifier', - name: 'error', - range: [36, 41], + type: "CallExpression", + callee: { + type: "Identifier", + name: "that", + range: [10, 14], + loc: { + start: { line: 1, column: 10 }, + end: { line: 1, column: 14 } + } + }, + "arguments": [], + range: [10, 16], loc: { - start: { line: 2, column: 10 }, - end: { line: 2, column: 15 } + start: { line: 1, column: 10 }, + end: { line: 1, column: 16 } } }, - range: [36, 42], + range: [10, 17], loc: { - start: { line: 2, column: 10 }, - end: { line: 2, column: 16 } + start: { line: 1, column: 10 }, + end: { line: 1, column: 17 } } - }], - range: [0, 44], + }, + alternate: { + type: "EmptyStatement", + range: [22, 23], + loc: { + start: { line: 1, column: 22 }, + end: { line: 1, column: 23 } + } + }, + range: [0, 23], loc: { start: { line: 1, column: 0 }, - end: { line: 2, column: 18 } + end: { line: 1, column: 23 } } } }, - 'Source elements': { + 'Iteration Statements': { - '': { - type: 'Program', - body: [], - range: [0, 0], - loc: { - start: { line: 0, column: 0 }, - end: { line: 0, column: 0 } + 'do keep(); while (true)': { + type: 'DoWhileStatement', + body: { + type: 'ExpressionStatement', + expression: { + type: 'CallExpression', + callee: { + type: 'Identifier', + name: 'keep', + range: [3, 7], + loc: { + start: { line: 1, column: 3 }, + end: { line: 1, column: 7 } + } + }, + 'arguments': [], + range: [3, 9], + loc: { + start: { line: 1, column: 3 }, + end: { line: 1, column: 9 } + } + }, + range: [3, 10], + loc: { + start: { line: 1, column: 3 }, + end: { line: 1, column: 10 } + } }, - tokens: [] - } - }, - - 'Invalid syntax': { - - '{': { - index: 1, - lineNumber: 1, - column: 2, - message: 'Error: Line 1: Unexpected end of input' - }, - - '}': { - index: 0, - lineNumber: 1, - column: 1, - message: 'Error: Line 1: Unexpected token }' - }, - - '3ea': { - index: 2, - lineNumber: 1, - column: 3, - message: 'Error: Line 1: Unexpected token ILLEGAL' - }, - - '3in []': { - index: 1, - lineNumber: 1, - column: 2, - message: 'Error: Line 1: Unexpected token ILLEGAL' + test: { + type: 'Literal', + value: true, + raw: 'true', + range: [18, 22], + loc: { + start: { line: 1, column: 18 }, + end: { line: 1, column: 22 } + } + }, + range: [0, 23], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 23 } + } }, - '3e': { - index: 2, - lineNumber: 1, - column: 3, - message: 'Error: Line 1: Unexpected token ILLEGAL' - }, - - '3e+': { - index: 3, - lineNumber: 1, - column: 4, - message: 'Error: Line 1: Unexpected token ILLEGAL' - }, - - '3e-': { - index: 3, - lineNumber: 1, - column: 4, - message: 'Error: Line 1: Unexpected token ILLEGAL' + 'do keep(); while (true);': { + type: 'DoWhileStatement', + body: { + type: 'ExpressionStatement', + expression: { + type: 'CallExpression', + callee: { + type: 'Identifier', + name: 'keep', + range: [3, 7], + loc: { + start: { line: 1, column: 3 }, + end: { line: 1, column: 7 } + } + }, + 'arguments': [], + range: [3, 9], + loc: { + start: { line: 1, column: 3 }, + end: { line: 1, column: 9 } + } + }, + range: [3, 10], + loc: { + start: { line: 1, column: 3 }, + end: { line: 1, column: 10 } + } + }, + test: { + type: 'Literal', + value: true, + raw: 'true', + range: [18, 22], + loc: { + start: { line: 1, column: 18 }, + end: { line: 1, column: 22 } + } + }, + range: [0, 24], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 24 } + } }, - '3x': { - index: 1, - lineNumber: 1, - column: 2, - message: 'Error: Line 1: Unexpected token ILLEGAL' + 'do { x++; y--; } while (x < 10)': { + type: 'DoWhileStatement', + body: { + type: 'BlockStatement', + body: [{ + type: 'ExpressionStatement', + expression: { + type: 'UpdateExpression', + operator: '++', + argument: { + type: 'Identifier', + name: 'x', + range: [5, 6], + loc: { + start: { line: 1, column: 5 }, + end: { line: 1, column: 6 } + } + }, + prefix: false, + range: [5, 8], + loc: { + start: { line: 1, column: 5 }, + end: { line: 1, column: 8 } + } + }, + range: [5, 9], + loc: { + start: { line: 1, column: 5 }, + end: { line: 1, column: 9 } + } + }, { + type: 'ExpressionStatement', + expression: { + type: 'UpdateExpression', + operator: '--', + argument: { + type: 'Identifier', + name: 'y', + range: [10, 11], + loc: { + start: { line: 1, column: 10 }, + end: { line: 1, column: 11 } + } + }, + prefix: false, + range: [10, 13], + loc: { + start: { line: 1, column: 10 }, + end: { line: 1, column: 13 } + } + }, + range: [10, 14], + loc: { + start: { line: 1, column: 10 }, + end: { line: 1, column: 14 } + } + }], + range: [3, 16], + loc: { + start: { line: 1, column: 3 }, + end: { line: 1, column: 16 } + } + }, + test: { + type: 'BinaryExpression', + operator: '<', + left: { + type: 'Identifier', + name: 'x', + range: [24, 25], + loc: { + start: { line: 1, column: 24 }, + end: { line: 1, column: 25 } + } + }, + right: { + type: 'Literal', + value: 10, + raw: '10', + range: [28, 30], + loc: { + start: { line: 1, column: 28 }, + end: { line: 1, column: 30 } + } + }, + range: [24, 30], + loc: { + start: { line: 1, column: 24 }, + end: { line: 1, column: 30 } + } + }, + range: [0, 31], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 31 } + } }, - '3x0': { - index: 1, - lineNumber: 1, - column: 2, - message: 'Error: Line 1: Unexpected token ILLEGAL' + '{ do { } while (false) false }': { + type: 'BlockStatement', + body: [{ + type: 'DoWhileStatement', + body: { + type: 'BlockStatement', + body: [], + range: [5, 8], + loc: { + start: { line: 1, column: 5 }, + end: { line: 1, column: 8 } + } + }, + test: { + type: 'Literal', + value: false, + raw: 'false', + range: [16, 21], + loc: { + start: { line: 1, column: 16 }, + end: { line: 1, column: 21 } + } + }, + range: [2, 22], + loc: { + start: { line: 1, column: 2 }, + end: { line: 1, column: 22 } + } + }, { + type: 'ExpressionStatement', + expression: { + type: 'Literal', + value: false, + raw: 'false', + range: [23, 28], + loc: { + start: { line: 1, column: 23 }, + end: { line: 1, column: 28 } + } + }, + range: [23, 29], + loc: { + start: { line: 1, column: 23 }, + end: { line: 1, column: 29 } + } + }], + range: [0, 30], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 30 } + } }, - '0x': { - index: 2, - lineNumber: 1, - column: 3, - message: 'Error: Line 1: Unexpected token ILLEGAL' + 'do that();while (true)': { + type: "DoWhileStatement", + body: { + type: "ExpressionStatement", + expression: { + type: "CallExpression", + callee: { + type: "Identifier", + name: "that", + range: [3, 7], + loc: { + start: { line: 1, column: 3 }, + end: { line: 1, column: 7 } + } + }, + "arguments": [], + range: [3, 9], + loc: { + start: { line: 1, column: 3 }, + end: { line: 1, column: 9 } + } + }, + range: [3, 10], + loc: { + start: { line: 1, column: 3 }, + end: { line: 1, column: 10 } + } + }, + test: { + type: "Literal", + value: true, + raw: "true", + range: [17, 21], + loc: { + start: { line: 1, column: 17 }, + end: { line: 1, column: 21 } + } + }, + range: [0, 22], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 22 } + } }, - '09': { - index: 1, - lineNumber: 1, - column: 2, - message: 'Error: Line 1: Unexpected token ILLEGAL' - }, - - '018': { - index: 2, - lineNumber: 1, - column: 3, - message: 'Error: Line 1: Unexpected token ILLEGAL' - }, - - '01a': { - index: 2, - lineNumber: 1, - column: 3, - message: 'Error: Line 1: Unexpected token ILLEGAL' - }, - - '3in[]': { - index: 1, - lineNumber: 1, - column: 2, - message: 'Error: Line 1: Unexpected token ILLEGAL' - }, - - '0x3in[]': { - index: 3, - lineNumber: 1, - column: 4, - message: 'Error: Line 1: Unexpected token ILLEGAL' + 'do that()\n;while (true)': { + type: "DoWhileStatement", + body: { + type: "ExpressionStatement", + expression: { + type: "CallExpression", + callee: { + type: "Identifier", + name: "that", + range: [3, 7], + loc: { + start: { line: 1, column: 3 }, + end: { line: 1, column: 7 } + } + }, + "arguments": [], + range: [3, 9], + loc: { + start: { line: 1, column: 3 }, + end: { line: 1, column: 9 } + } + }, + range: [3, 11], + loc: { + start: { line: 1, column: 3 }, + end: { line: 2, column: 1 } + } + }, + test: { + type: "Literal", + value: true, + raw: "true", + range: [18, 22], + loc: { + start: { line: 2, column: 8 }, + end: { line: 2, column: 12 } + } + }, + range: [0, 23], + loc: { + start: { line: 1, column: 0 }, + end: { line: 2, column: 13 } + } }, - '"Hello\nWorld"': { - index: 7, - lineNumber: 1, - column: 8, - message: 'Error: Line 1: Unexpected token ILLEGAL' + 'while (true) doSomething()': { + type: 'WhileStatement', + test: { + type: 'Literal', + value: true, + raw: 'true', + range: [7, 11], + loc: { + start: { line: 1, column: 7 }, + end: { line: 1, column: 11 } + } + }, + body: { + type: 'ExpressionStatement', + expression: { + type: 'CallExpression', + callee: { + type: 'Identifier', + name: 'doSomething', + range: [13, 24], + loc: { + start: { line: 1, column: 13 }, + end: { line: 1, column: 24 } + } + }, + 'arguments': [], + range: [13, 26], + loc: { + start: { line: 1, column: 13 }, + end: { line: 1, column: 26 } + } + }, + range: [13, 26], + loc: { + start: { line: 1, column: 13 }, + end: { line: 1, column: 26 } + } + }, + range: [0, 26], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 26 } + } }, - 'x\\': { - index: 2, - lineNumber: 1, - column: 3, - message: 'Error: Line 1: Unexpected token ILLEGAL' + 'while (x < 10) { x++; y--; }': { + type: 'WhileStatement', + test: { + type: 'BinaryExpression', + operator: '<', + left: { + type: 'Identifier', + name: 'x', + range: [7, 8], + loc: { + start: { line: 1, column: 7 }, + end: { line: 1, column: 8 } + } + }, + right: { + type: 'Literal', + value: 10, + raw: '10', + range: [11, 13], + loc: { + start: { line: 1, column: 11 }, + end: { line: 1, column: 13 } + } + }, + range: [7, 13], + loc: { + start: { line: 1, column: 7 }, + end: { line: 1, column: 13 } + } + }, + body: { + type: 'BlockStatement', + body: [{ + type: 'ExpressionStatement', + expression: { + type: 'UpdateExpression', + operator: '++', + argument: { + type: 'Identifier', + name: 'x', + range: [17, 18], + loc: { + start: { line: 1, column: 17 }, + end: { line: 1, column: 18 } + } + }, + prefix: false, + range: [17, 20], + loc: { + start: { line: 1, column: 17 }, + end: { line: 1, column: 20 } + } + }, + range: [17, 21], + loc: { + start: { line: 1, column: 17 }, + end: { line: 1, column: 21 } + } + }, { + type: 'ExpressionStatement', + expression: { + type: 'UpdateExpression', + operator: '--', + argument: { + type: 'Identifier', + name: 'y', + range: [22, 23], + loc: { + start: { line: 1, column: 22 }, + end: { line: 1, column: 23 } + } + }, + prefix: false, + range: [22, 25], + loc: { + start: { line: 1, column: 22 }, + end: { line: 1, column: 25 } + } + }, + range: [22, 26], + loc: { + start: { line: 1, column: 22 }, + end: { line: 1, column: 26 } + } + }], + range: [15, 28], + loc: { + start: { line: 1, column: 15 }, + end: { line: 1, column: 28 } + } + }, + range: [0, 28], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 28 } + } }, - 'x\\u005c': { - index: 7, - lineNumber: 1, - column: 8, - message: 'Error: Line 1: Unexpected token ILLEGAL' + 'for(;;);': { + type: 'ForStatement', + init: null, + test: null, + update: null, + body: { + type: 'EmptyStatement', + range: [7, 8], + loc: { + start: { line: 1, column: 7 }, + end: { line: 1, column: 8 } + } + }, + range: [0, 8], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 8 } + } }, - 'x\\u002a': { - index: 7, - lineNumber: 1, - column: 8, - message: 'Error: Line 1: Unexpected token ILLEGAL' + 'for(;;){}': { + type: 'ForStatement', + init: null, + test: null, + update: null, + body: { + type: 'BlockStatement', + body: [], + range: [7, 9], + loc: { + start: { line: 1, column: 7 }, + end: { line: 1, column: 9 } + } + }, + range: [0, 9], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 9 } + } }, - 'var x = /(s/g': { - index: 13, - lineNumber: 1, - column: 14, - message: 'Error: Line 1: Invalid regular expression' - }, - - '/': { - index: 1, - lineNumber: 1, - column: 2, - message: 'Error: Line 1: Invalid regular expression: missing /' + 'for(x = 0;;);': { + type: 'ForStatement', + init: { + type: 'AssignmentExpression', + operator: '=', + left: { + type: 'Identifier', + name: 'x', + range: [4, 5], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 5 } + } + }, + right: { + type: 'Literal', + value: 0, + raw: '0', + range: [8, 9], + loc: { + start: { line: 1, column: 8 }, + end: { line: 1, column: 9 } + } + }, + range: [4, 9], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 9 } + } + }, + test: null, + update: null, + body: { + type: 'EmptyStatement', + range: [12, 13], + loc: { + start: { line: 1, column: 12 }, + end: { line: 1, column: 13 } + } + }, + range: [0, 13], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 13 } + } }, - '/test': { - index: 5, - lineNumber: 1, - column: 6, - message: 'Error: Line 1: Invalid regular expression: missing /' + 'for(var x = 0;;);': { + type: 'ForStatement', + init: { + type: 'VariableDeclaration', + declarations: [{ + type: 'VariableDeclarator', + id: { + type: 'Identifier', + name: 'x', + range: [8, 9], + loc: { + start: { line: 1, column: 8 }, + end: { line: 1, column: 9 } + } + }, + init: { + type: 'Literal', + value: 0, + raw: '0', + range: [12, 13], + loc: { + start: { line: 1, column: 12 }, + end: { line: 1, column: 13 } + } + }, + range: [8, 13], + loc: { + start: { line: 1, column: 8 }, + end: { line: 1, column: 13 } + } + }], + kind: 'var', + range: [4, 13], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 13 } + } + }, + test: null, + update: null, + body: { + type: 'EmptyStatement', + range: [16, 17], + loc: { + start: { line: 1, column: 16 }, + end: { line: 1, column: 17 } + } + }, + range: [0, 17], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 17 } + } }, - 'var x = /[a-z]/\\ux': { - index: 18, - lineNumber: 1, - column: 19, - message: 'Error: Line 1: Invalid regular expression' + 'for(let x = 0;;);': { + type: 'ForStatement', + init: { + type: 'VariableDeclaration', + declarations: [{ + type: 'VariableDeclarator', + id: { + type: 'Identifier', + name: 'x', + range: [8, 9], + loc: { + start: { line: 1, column: 8 }, + end: { line: 1, column: 9 } + } + }, + init: { + type: 'Literal', + value: 0, + raw: '0', + range: [12, 13], + loc: { + start: { line: 1, column: 12 }, + end: { line: 1, column: 13 } + } + }, + range: [8, 13], + loc: { + start: { line: 1, column: 8 }, + end: { line: 1, column: 13 } + } + }], + kind: 'let', + range: [4, 13], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 13 } + } + }, + test: null, + update: null, + body: { + type: 'EmptyStatement', + range: [16, 17], + loc: { + start: { line: 1, column: 16 }, + end: { line: 1, column: 17 } + } + }, + range: [0, 17], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 17 } + } }, - '3 = 4': { - index: 1, - lineNumber: 1, - column: 2, - message: 'Error: Line 1: Invalid left-hand side in assignment' + 'for(var x = 0, y = 1;;);': { + type: 'ForStatement', + init: { + type: 'VariableDeclaration', + declarations: [{ + type: 'VariableDeclarator', + id: { + type: 'Identifier', + name: 'x', + range: [8, 9], + loc: { + start: { line: 1, column: 8 }, + end: { line: 1, column: 9 } + } + }, + init: { + type: 'Literal', + value: 0, + raw: '0', + range: [12, 13], + loc: { + start: { line: 1, column: 12 }, + end: { line: 1, column: 13 } + } + }, + range: [8, 13], + loc: { + start: { line: 1, column: 8 }, + end: { line: 1, column: 13 } + } + }, { + type: 'VariableDeclarator', + id: { + type: 'Identifier', + name: 'y', + range: [15, 16], + loc: { + start: { line: 1, column: 15 }, + end: { line: 1, column: 16 } + } + }, + init: { + type: 'Literal', + value: 1, + raw: '1', + range: [19, 20], + loc: { + start: { line: 1, column: 19 }, + end: { line: 1, column: 20 } + } + }, + range: [15, 20], + loc: { + start: { line: 1, column: 15 }, + end: { line: 1, column: 20 } + } + }], + kind: 'var', + range: [4, 20], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 20 } + } + }, + test: null, + update: null, + body: { + type: 'EmptyStatement', + range: [23, 24], + loc: { + start: { line: 1, column: 23 }, + end: { line: 1, column: 24 } + } + }, + range: [0, 24], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 24 } + } }, - 'func() = 4': { - index: 6, - lineNumber: 1, + 'for(x = 0; x < 42;);': { + type: 'ForStatement', + init: { + type: 'AssignmentExpression', + operator: '=', + left: { + type: 'Identifier', + name: 'x', + range: [4, 5], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 5 } + } + }, + right: { + type: 'Literal', + value: 0, + raw: '0', + range: [8, 9], + loc: { + start: { line: 1, column: 8 }, + end: { line: 1, column: 9 } + } + }, + range: [4, 9], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 9 } + } + }, + test: { + type: 'BinaryExpression', + operator: '<', + left: { + type: 'Identifier', + name: 'x', + range: [11, 12], + loc: { + start: { line: 1, column: 11 }, + end: { line: 1, column: 12 } + } + }, + right: { + type: 'Literal', + value: 42, + raw: '42', + range: [15, 17], + loc: { + start: { line: 1, column: 15 }, + end: { line: 1, column: 17 } + } + }, + range: [11, 17], + loc: { + start: { line: 1, column: 11 }, + end: { line: 1, column: 17 } + } + }, + update: null, + body: { + type: 'EmptyStatement', + range: [19, 20], + loc: { + start: { line: 1, column: 19 }, + end: { line: 1, column: 20 } + } + }, + range: [0, 20], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 20 } + } + }, + + 'for(x = 0; x < 42; x++);': { + type: 'ForStatement', + init: { + type: 'AssignmentExpression', + operator: '=', + left: { + type: 'Identifier', + name: 'x', + range: [4, 5], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 5 } + } + }, + right: { + type: 'Literal', + value: 0, + raw: '0', + range: [8, 9], + loc: { + start: { line: 1, column: 8 }, + end: { line: 1, column: 9 } + } + }, + range: [4, 9], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 9 } + } + }, + test: { + type: 'BinaryExpression', + operator: '<', + left: { + type: 'Identifier', + name: 'x', + range: [11, 12], + loc: { + start: { line: 1, column: 11 }, + end: { line: 1, column: 12 } + } + }, + right: { + type: 'Literal', + value: 42, + raw: '42', + range: [15, 17], + loc: { + start: { line: 1, column: 15 }, + end: { line: 1, column: 17 } + } + }, + range: [11, 17], + loc: { + start: { line: 1, column: 11 }, + end: { line: 1, column: 17 } + } + }, + update: { + type: 'UpdateExpression', + operator: '++', + argument: { + type: 'Identifier', + name: 'x', + range: [19, 20], + loc: { + start: { line: 1, column: 19 }, + end: { line: 1, column: 20 } + } + }, + prefix: false, + range: [19, 22], + loc: { + start: { line: 1, column: 19 }, + end: { line: 1, column: 22 } + } + }, + body: { + type: 'EmptyStatement', + range: [23, 24], + loc: { + start: { line: 1, column: 23 }, + end: { line: 1, column: 24 } + } + }, + range: [0, 24], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 24 } + } + }, + + 'for(x = 0; x < 42; x++) process(x);': { + type: 'ForStatement', + init: { + type: 'AssignmentExpression', + operator: '=', + left: { + type: 'Identifier', + name: 'x', + range: [4, 5], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 5 } + } + }, + right: { + type: 'Literal', + value: 0, + raw: '0', + range: [8, 9], + loc: { + start: { line: 1, column: 8 }, + end: { line: 1, column: 9 } + } + }, + range: [4, 9], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 9 } + } + }, + test: { + type: 'BinaryExpression', + operator: '<', + left: { + type: 'Identifier', + name: 'x', + range: [11, 12], + loc: { + start: { line: 1, column: 11 }, + end: { line: 1, column: 12 } + } + }, + right: { + type: 'Literal', + value: 42, + raw: '42', + range: [15, 17], + loc: { + start: { line: 1, column: 15 }, + end: { line: 1, column: 17 } + } + }, + range: [11, 17], + loc: { + start: { line: 1, column: 11 }, + end: { line: 1, column: 17 } + } + }, + update: { + type: 'UpdateExpression', + operator: '++', + argument: { + type: 'Identifier', + name: 'x', + range: [19, 20], + loc: { + start: { line: 1, column: 19 }, + end: { line: 1, column: 20 } + } + }, + prefix: false, + range: [19, 22], + loc: { + start: { line: 1, column: 19 }, + end: { line: 1, column: 22 } + } + }, + body: { + type: 'ExpressionStatement', + expression: { + type: 'CallExpression', + callee: { + type: 'Identifier', + name: 'process', + range: [24, 31], + loc: { + start: { line: 1, column: 24 }, + end: { line: 1, column: 31 } + } + }, + 'arguments': [{ + type: 'Identifier', + name: 'x', + range: [32, 33], + loc: { + start: { line: 1, column: 32 }, + end: { line: 1, column: 33 } + } + }], + range: [24, 34], + loc: { + start: { line: 1, column: 24 }, + end: { line: 1, column: 34 } + } + }, + range: [24, 35], + loc: { + start: { line: 1, column: 24 }, + end: { line: 1, column: 35 } + } + }, + range: [0, 35], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 35 } + } + }, + + 'for(x in list) process(x);': { + type: 'ForInStatement', + left: { + type: 'Identifier', + name: 'x', + range: [4, 5], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 5 } + } + }, + right: { + type: 'Identifier', + name: 'list', + range: [9, 13], + loc: { + start: { line: 1, column: 9 }, + end: { line: 1, column: 13 } + } + }, + body: { + type: 'ExpressionStatement', + expression: { + type: 'CallExpression', + callee: { + type: 'Identifier', + name: 'process', + range: [15, 22], + loc: { + start: { line: 1, column: 15 }, + end: { line: 1, column: 22 } + } + }, + 'arguments': [{ + type: 'Identifier', + name: 'x', + range: [23, 24], + loc: { + start: { line: 1, column: 23 }, + end: { line: 1, column: 24 } + } + }], + range: [15, 25], + loc: { + start: { line: 1, column: 15 }, + end: { line: 1, column: 25 } + } + }, + range: [15, 26], + loc: { + start: { line: 1, column: 15 }, + end: { line: 1, column: 26 } + } + }, + each: false, + range: [0, 26], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 26 } + } + }, + + 'for (var x in list) process(x);': { + type: 'ForInStatement', + left: { + type: 'VariableDeclaration', + declarations: [{ + type: 'VariableDeclarator', + id: { + type: 'Identifier', + name: 'x', + range: [9, 10], + loc: { + start: { line: 1, column: 9 }, + end: { line: 1, column: 10 } + } + }, + init: null, + range: [9, 10], + loc: { + start: { line: 1, column: 9 }, + end: { line: 1, column: 10 } + } + }], + kind: 'var', + range: [5, 10], + loc: { + start: { line: 1, column: 5 }, + end: { line: 1, column: 10 } + } + }, + right: { + type: 'Identifier', + name: 'list', + range: [14, 18], + loc: { + start: { line: 1, column: 14 }, + end: { line: 1, column: 18 } + } + }, + body: { + type: 'ExpressionStatement', + expression: { + type: 'CallExpression', + callee: { + type: 'Identifier', + name: 'process', + range: [20, 27], + loc: { + start: { line: 1, column: 20 }, + end: { line: 1, column: 27 } + } + }, + 'arguments': [{ + type: 'Identifier', + name: 'x', + range: [28, 29], + loc: { + start: { line: 1, column: 28 }, + end: { line: 1, column: 29 } + } + }], + range: [20, 30], + loc: { + start: { line: 1, column: 20 }, + end: { line: 1, column: 30 } + } + }, + range: [20, 31], + loc: { + start: { line: 1, column: 20 }, + end: { line: 1, column: 31 } + } + }, + each: false, + range: [0, 31], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 31 } + } + }, + + 'for (var x = 42 in list) process(x);': { + type: 'ForInStatement', + left: { + type: 'VariableDeclaration', + declarations: [{ + type: 'VariableDeclarator', + id: { + type: 'Identifier', + name: 'x', + range: [9, 10], + loc: { + start: { line: 1, column: 9 }, + end: { line: 1, column: 10 } + } + }, + init: { + type: 'Literal', + value: 42, + raw: '42', + range: [13, 15], + loc: { + start: { line: 1, column: 13 }, + end: { line: 1, column: 15 } + } + }, + range: [9, 15], + loc: { + start: { line: 1, column: 9 }, + end: { line: 1, column: 15 } + } + }], + kind: 'var', + range: [5, 15], + loc: { + start: { line: 1, column: 5 }, + end: { line: 1, column: 15 } + } + }, + right: { + type: 'Identifier', + name: 'list', + range: [19, 23], + loc: { + start: { line: 1, column: 19 }, + end: { line: 1, column: 23 } + } + }, + body: { + type: 'ExpressionStatement', + expression: { + type: 'CallExpression', + callee: { + type: 'Identifier', + name: 'process', + range: [25, 32], + loc: { + start: { line: 1, column: 25 }, + end: { line: 1, column: 32 } + } + }, + 'arguments': [{ + type: 'Identifier', + name: 'x', + range: [33, 34], + loc: { + start: { line: 1, column: 33 }, + end: { line: 1, column: 34 } + } + }], + range: [25, 35], + loc: { + start: { line: 1, column: 25 }, + end: { line: 1, column: 35 } + } + }, + range: [25, 36], + loc: { + start: { line: 1, column: 25 }, + end: { line: 1, column: 36 } + } + }, + each: false, + range: [0, 36], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 36 } + } + }, + + 'for (let x in list) process(x);': { + type: 'ForInStatement', + left: { + type: 'VariableDeclaration', + declarations: [{ + type: 'VariableDeclarator', + id: { + type: 'Identifier', + name: 'x', + range: [9, 10], + loc: { + start: { line: 1, column: 9 }, + end: { line: 1, column: 10 } + } + }, + init: null, + range: [9, 10], + loc: { + start: { line: 1, column: 9 }, + end: { line: 1, column: 10 } + } + }], + kind: 'let', + range: [5, 10], + loc: { + start: { line: 1, column: 5 }, + end: { line: 1, column: 10 } + } + }, + right: { + type: 'Identifier', + name: 'list', + range: [14, 18], + loc: { + start: { line: 1, column: 14 }, + end: { line: 1, column: 18 } + } + }, + body: { + type: 'ExpressionStatement', + expression: { + type: 'CallExpression', + callee: { + type: 'Identifier', + name: 'process', + range: [20, 27], + loc: { + start: { line: 1, column: 20 }, + end: { line: 1, column: 27 } + } + }, + 'arguments': [{ + type: 'Identifier', + name: 'x', + range: [28, 29], + loc: { + start: { line: 1, column: 28 }, + end: { line: 1, column: 29 } + } + }], + range: [20, 30], + loc: { + start: { line: 1, column: 20 }, + end: { line: 1, column: 30 } + } + }, + range: [20, 31], + loc: { + start: { line: 1, column: 20 }, + end: { line: 1, column: 31 } + } + }, + each: false, + range: [0, 31], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 31 } + } + }, + + 'for (var x = y = z in q);': { + type: 'ForInStatement', + left: { + type: 'VariableDeclaration', + declarations: [{ + type: 'VariableDeclarator', + id: { + type: 'Identifier', + name: 'x', + range: [9, 10], + loc: { + start: { line: 1, column: 9 }, + end: { line: 1, column: 10 } + } + }, + init: { + type: 'AssignmentExpression', + operator: '=', + left: { + type: 'Identifier', + name: 'y', + range: [13, 14], + loc: { + start: { line: 1, column: 13 }, + end: { line: 1, column: 14 } + } + }, + right: { + type: 'Identifier', + name: 'z', + range: [17, 18], + loc: { + start: { line: 1, column: 17 }, + end: { line: 1, column: 18 } + } + }, + range: [13, 18], + loc: { + start: { line: 1, column: 13 }, + end: { line: 1, column: 18 } + } + }, + range: [9, 18], + loc: { + start: { line: 1, column: 9 }, + end: { line: 1, column: 18 } + } + }], + kind: 'var', + range: [5, 18], + loc: { + start: { line: 1, column: 5 }, + end: { line: 1, column: 18 } + } + }, + right: { + type: 'Identifier', + name: 'q', + range: [22, 23], + loc: { + start: { line: 1, column: 22 }, + end: { line: 1, column: 23 } + } + }, + body: { + type: 'EmptyStatement', + range: [24, 25], + loc: { + start: { line: 1, column: 24 }, + end: { line: 1, column: 25 } + } + }, + each: false, + range: [0, 25], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 25 } + } + }, + + 'for (var a = b = c = (d in e) in z);': { + type: 'ForInStatement', + left: { + type: 'VariableDeclaration', + declarations: [{ + type: 'VariableDeclarator', + id: { + type: 'Identifier', + name: 'a', + range: [9, 10], + loc: { + start: { line: 1, column: 9 }, + end: { line: 1, column: 10 } + } + }, + init: { + type: 'AssignmentExpression', + operator: '=', + left: { + type: 'Identifier', + name: 'b', + range: [13, 14], + loc: { + start: { line: 1, column: 13 }, + end: { line: 1, column: 14 } + } + }, + right: { + type: 'AssignmentExpression', + operator: '=', + left: { + type: 'Identifier', + name: 'c', + range: [17, 18], + loc: { + start: { line: 1, column: 17 }, + end: { line: 1, column: 18 } + } + }, + right: { + type: 'BinaryExpression', + operator: 'in', + left: { + type: 'Identifier', + name: 'd', + range: [22, 23], + loc: { + start: { line: 1, column: 22 }, + end: { line: 1, column: 23 } + } + }, + right: { + type: 'Identifier', + name: 'e', + range: [27, 28], + loc: { + start: { line: 1, column: 27 }, + end: { line: 1, column: 28 } + } + }, + range: [22, 28], + loc: { + start: { line: 1, column: 22 }, + end: { line: 1, column: 28 } + } + }, + range: [17, 29], + loc: { + start: { line: 1, column: 17 }, + end: { line: 1, column: 29 } + } + }, + range: [13, 29], + loc: { + start: { line: 1, column: 13 }, + end: { line: 1, column: 29 } + } + }, + range: [9, 29], + loc: { + start: { line: 1, column: 9 }, + end: { line: 1, column: 29 } + } + }], + kind: 'var', + range: [5, 29], + loc: { + start: { line: 1, column: 5 }, + end: { line: 1, column: 29 } + } + }, + right: { + type: 'Identifier', + name: 'z', + range: [33, 34], + loc: { + start: { line: 1, column: 33 }, + end: { line: 1, column: 34 } + } + }, + body: { + type: 'EmptyStatement', + range: [35, 36], + loc: { + start: { line: 1, column: 35 }, + end: { line: 1, column: 36 } + } + }, + each: false, + range: [0, 36], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 36 } + } + }, + + 'for (var i = function() { return 10 in [] } in list) process(x);': { + type: 'ForInStatement', + left: { + type: 'VariableDeclaration', + declarations: [{ + type: 'VariableDeclarator', + id: { + type: 'Identifier', + name: 'i', + range: [9, 10], + loc: { + start: { line: 1, column: 9 }, + end: { line: 1, column: 10 } + } + }, + init: { + type: 'FunctionExpression', + id: null, + params: [], + defaults: [], + body: { + type: 'BlockStatement', + body: [{ + type: 'ReturnStatement', + argument: { + type: 'BinaryExpression', + operator: 'in', + left: { + type: 'Literal', + value: 10, + raw: '10', + range: [33, 35], + loc: { + start: { line: 1, column: 33 }, + end: { line: 1, column: 35 } + } + }, + right: { + type: 'ArrayExpression', + elements: [], + range: [39, 41], + loc: { + start: { line: 1, column: 39 }, + end: { line: 1, column: 41 } + } + }, + range: [33, 41], + loc: { + start: { line: 1, column: 33 }, + end: { line: 1, column: 41 } + } + }, + range: [26, 42], + loc: { + start: { line: 1, column: 26 }, + end: { line: 1, column: 42 } + } + }], + range: [24, 43], + loc: { + start: { line: 1, column: 24 }, + end: { line: 1, column: 43 } + } + }, + rest: null, + generator: false, + expression: false, + range: [13, 43], + loc: { + start: { line: 1, column: 13 }, + end: { line: 1, column: 43 } + } + }, + range: [9, 43], + loc: { + start: { line: 1, column: 9 }, + end: { line: 1, column: 43 } + } + }], + kind: 'var', + range: [5, 43], + loc: { + start: { line: 1, column: 5 }, + end: { line: 1, column: 43 } + } + }, + right: { + type: 'Identifier', + name: 'list', + range: [47, 51], + loc: { + start: { line: 1, column: 47 }, + end: { line: 1, column: 51 } + } + }, + body: { + type: 'ExpressionStatement', + expression: { + type: 'CallExpression', + callee: { + type: 'Identifier', + name: 'process', + range: [53, 60], + loc: { + start: { line: 1, column: 53 }, + end: { line: 1, column: 60 } + } + }, + 'arguments': [{ + type: 'Identifier', + name: 'x', + range: [61, 62], + loc: { + start: { line: 1, column: 61 }, + end: { line: 1, column: 62 } + } + }], + range: [53, 63], + loc: { + start: { line: 1, column: 53 }, + end: { line: 1, column: 63 } + } + }, + range: [53, 64], + loc: { + start: { line: 1, column: 53 }, + end: { line: 1, column: 64 } + } + }, + each: false, + range: [0, 64], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 64 } + } + }, + + 'for (a[b in c] in d);': { + type: 'ForInStatement', + left: { + type: 'MemberExpression', + computed: true, + object: { + type: 'Identifier', + name: 'a', + range: [5, 6], + loc: { + start: { line: 1, column: 5 }, + end: { line: 1, column: 6 } + } + }, + property: { + type: 'BinaryExpression', + operator: 'in', + left: { + type: 'Identifier', + name: 'b', + range: [7, 8], + loc: { + start: { line: 1, column: 7 }, + end: { line: 1, column: 8 } + } + }, + right: { + type: 'Identifier', + name: 'c', + range: [12, 13], + loc: { + start: { line: 1, column: 12 }, + end: { line: 1, column: 13 } + } + }, + range: [7, 13], + loc: { + start: { line: 1, column: 7 }, + end: { line: 1, column: 13 } + } + }, + range: [5, 14], + loc: { + start: { line: 1, column: 5 }, + end: { line: 1, column: 14 } + } + }, + right: { + type: 'Identifier', + name: 'd', + range: [18, 19], + loc: { + start: { line: 1, column: 18 }, + end: { line: 1, column: 19 } + } + }, + body: { + type: 'EmptyStatement', + range: [20, 21], + loc: { + start: { line: 1, column: 20 }, + end: { line: 1, column: 21 } + } + }, + each: false, + range: [0, 21], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 21 } + } + }, + + 'for (a(b in c)[0] in d);': { + type: 'ForInStatement', + left: { + type: 'MemberExpression', + computed: true, + object: { + type: 'CallExpression', + callee: { + type: 'Identifier', + name: 'a', + range: [5, 6], + loc: { + start: { line: 1, column: 5 }, + end: { line: 1, column: 6 } + } + }, + arguments: [{ + type: 'BinaryExpression', + operator: 'in', + left: { + type: 'Identifier', + name: 'b', + range: [7, 8], + loc: { + start: { line: 1, column: 7 }, + end: { line: 1, column: 8 } + } + }, + right: { + type: 'Identifier', + name: 'c', + range: [12, 13], + loc: { + start: { line: 1, column: 12 }, + end: { line: 1, column: 13 } + } + }, + range: [7, 13], + loc: { + start: { line: 1, column: 7 }, + end: { line: 1, column: 13 } + } + }], + range: [5, 14], + loc: { + start: { line: 1, column: 5 }, + end: { line: 1, column: 14 } + } + }, + property: { + type: 'Literal', + value: 0, + raw: '0', + range: [15, 16], + loc: { + start: { line: 1, column: 15 }, + end: { line: 1, column: 16 } + } + }, + range: [5, 17], + loc: { + start: { line: 1, column: 5 }, + end: { line: 1, column: 17 } + } + }, + right: { + type: 'Identifier', + name: 'd', + range: [21, 22], + loc: { + start: { line: 1, column: 21 }, + end: { line: 1, column: 22 } + } + }, + body: { + type: 'EmptyStatement', + range: [23, 24], + loc: { + start: { line: 1, column: 23 }, + end: { line: 1, column: 24 } + } + }, + each: false, + range: [0, 24], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 24 } + } + }, + + 'for (a.in in a);': { + type: 'ForInStatement', + left: { + type: 'MemberExpression', + computed: false, + object: { + type: 'Identifier', + name: 'a', + range: [5, 6], + loc: { + start: { line: 1, column: 5 }, + end: { line: 1, column: 6 } + } + }, + property: { + type: 'Identifier', + name: 'in', + range: [7, 9], + loc: { + start: { line: 1, column: 7 }, + end: { line: 1, column: 9 } + } + }, + range: [5, 9], + loc: { + start: { line: 1, column: 5 }, + end: { line: 1, column: 9 } + } + }, + right: { + type: 'Identifier', + name: 'a', + range: [13, 14], + loc: { + start: { line: 1, column: 13 }, + end: { line: 1, column: 14 } + } + }, + body: { + type: 'EmptyStatement', + range: [15, 16], + loc: { + start: { line: 1, column: 15 }, + end: { line: 1, column: 16 } + } + }, + each: false, + range: [0, 16], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 16 } + } + } + }, + + 'continue statement': { + + 'while (true) { continue; }': { + type: 'WhileStatement', + test: { + type: 'Literal', + value: true, + raw: 'true', + range: [7, 11], + loc: { + start: { line: 1, column: 7 }, + end: { line: 1, column: 11 } + } + }, + body: { + type: 'BlockStatement', + body: [ + { + type: 'ContinueStatement', + label: null, + range: [15, 24], + loc: { + start: { line: 1, column: 15 }, + end: { line: 1, column: 24 } + } + } + ], + range: [13, 26], + loc: { + start: { line: 1, column: 13 }, + end: { line: 1, column: 26 } + } + }, + range: [0, 26], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 26 } + } + }, + + 'while (true) { continue }': { + type: 'WhileStatement', + test: { + type: 'Literal', + value: true, + raw: 'true', + range: [7, 11], + loc: { + start: { line: 1, column: 7 }, + end: { line: 1, column: 11 } + } + }, + body: { + type: 'BlockStatement', + body: [ + { + type: 'ContinueStatement', + label: null, + range: [15, 24], + loc: { + start: { line: 1, column: 15 }, + end: { line: 1, column: 24 } + } + } + ], + range: [13, 25], + loc: { + start: { line: 1, column: 13 }, + end: { line: 1, column: 25 } + } + }, + range: [0, 25], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 25 } + } + }, + + 'done: while (true) { continue done }': { + type: 'LabeledStatement', + label: { + type: 'Identifier', + name: 'done', + range: [0, 4], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 4 } + } + }, + body: { + type: 'WhileStatement', + test: { + type: 'Literal', + value: true, + raw: 'true', + range: [13, 17], + loc: { + start: { line: 1, column: 13 }, + end: { line: 1, column: 17 } + } + }, + body: { + type: 'BlockStatement', + body: [ + { + type: 'ContinueStatement', + label: { + type: 'Identifier', + name: 'done', + range: [30, 34], + loc: { + start: { line: 1, column: 30 }, + end: { line: 1, column: 34 } + } + }, + range: [21, 35], + loc: { + start: { line: 1, column: 21 }, + end: { line: 1, column: 35 } + } + } + ], + range: [19, 36], + loc: { + start: { line: 1, column: 19 }, + end: { line: 1, column: 36 } + } + }, + range: [6, 36], + loc: { + start: { line: 1, column: 6 }, + end: { line: 1, column: 36 } + } + }, + range: [0, 36], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 36 } + } + }, + + 'done: while (true) { continue done; }': { + type: 'LabeledStatement', + label: { + type: 'Identifier', + name: 'done', + range: [0, 4], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 4 } + } + }, + body: { + type: 'WhileStatement', + test: { + type: 'Literal', + value: true, + raw: 'true', + range: [13, 17], + loc: { + start: { line: 1, column: 13 }, + end: { line: 1, column: 17 } + } + }, + body: { + type: 'BlockStatement', + body: [ + { + type: 'ContinueStatement', + label: { + type: 'Identifier', + name: 'done', + range: [30, 34], + loc: { + start: { line: 1, column: 30 }, + end: { line: 1, column: 34 } + } + }, + range: [21, 35], + loc: { + start: { line: 1, column: 21 }, + end: { line: 1, column: 35 } + } + } + ], + range: [19, 37], + loc: { + start: { line: 1, column: 19 }, + end: { line: 1, column: 37 } + } + }, + range: [6, 37], + loc: { + start: { line: 1, column: 6 }, + end: { line: 1, column: 37 } + } + }, + range: [0, 37], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 37 } + } + }, + + '__proto__: while (true) { continue __proto__; }': { + type: 'LabeledStatement', + label: { + type: 'Identifier', + name: '__proto__', + range: [0, 9], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 9 } + } + }, + body: { + type: 'WhileStatement', + test: { + type: 'Literal', + value: true, + raw: 'true', + range: [18, 22], + loc: { + start: { line: 1, column: 18 }, + end: { line: 1, column: 22 } + } + }, + body: { + type: 'BlockStatement', + body: [{ + type: 'ContinueStatement', + label: { + type: 'Identifier', + name: '__proto__', + range: [35, 44], + loc: { + start: { line: 1, column: 35 }, + end: { line: 1, column: 44 } + } + }, + range: [26, 45], + loc: { + start: { line: 1, column: 26 }, + end: { line: 1, column: 45 } + } + }], + range: [24, 47], + loc: { + start: { line: 1, column: 24 }, + end: { line: 1, column: 47 } + } + }, + range: [11, 47], + loc: { + start: { line: 1, column: 11 }, + end: { line: 1, column: 47 } + } + }, + range: [0, 47], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 47 } + } + } + + }, + + 'break statement': { + + 'while (true) { break }': { + type: 'WhileStatement', + test: { + type: 'Literal', + value: true, + raw: 'true', + range: [7, 11], + loc: { + start: { line: 1, column: 7 }, + end: { line: 1, column: 11 } + } + }, + body: { + type: 'BlockStatement', + body: [ + { + type: 'BreakStatement', + label: null, + range: [15, 21], + loc: { + start: { line: 1, column: 15 }, + end: { line: 1, column: 21 } + } + } + ], + range: [13, 22], + loc: { + start: { line: 1, column: 13 }, + end: { line: 1, column: 22 } + } + }, + range: [0, 22], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 22 } + } + }, + + 'done: while (true) { break done }': { + type: 'LabeledStatement', + label: { + type: 'Identifier', + name: 'done', + range: [0, 4], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 4 } + } + }, + body: { + type: 'WhileStatement', + test: { + type: 'Literal', + value: true, + raw: 'true', + range: [13, 17], + loc: { + start: { line: 1, column: 13 }, + end: { line: 1, column: 17 } + } + }, + body: { + type: 'BlockStatement', + body: [ + { + type: 'BreakStatement', + label: { + type: 'Identifier', + name: 'done', + range: [27, 31], + loc: { + start: { line: 1, column: 27 }, + end: { line: 1, column: 31 } + } + }, + range: [21, 32], + loc: { + start: { line: 1, column: 21 }, + end: { line: 1, column: 32 } + } + } + ], + range: [19, 33], + loc: { + start: { line: 1, column: 19 }, + end: { line: 1, column: 33 } + } + }, + range: [6, 33], + loc: { + start: { line: 1, column: 6 }, + end: { line: 1, column: 33 } + } + }, + range: [0, 33], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 33 } + } + }, + + 'done: while (true) { break done; }': { + type: 'LabeledStatement', + label: { + type: 'Identifier', + name: 'done', + range: [0, 4], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 4 } + } + }, + body: { + type: 'WhileStatement', + test: { + type: 'Literal', + value: true, + raw: 'true', + range: [13, 17], + loc: { + start: { line: 1, column: 13 }, + end: { line: 1, column: 17 } + } + }, + body: { + type: 'BlockStatement', + body: [ + { + type: 'BreakStatement', + label: { + type: 'Identifier', + name: 'done', + range: [27, 31], + loc: { + start: { line: 1, column: 27 }, + end: { line: 1, column: 31 } + } + }, + range: [21, 32], + loc: { + start: { line: 1, column: 21 }, + end: { line: 1, column: 32 } + } + } + ], + range: [19, 34], + loc: { + start: { line: 1, column: 19 }, + end: { line: 1, column: 34 } + } + }, + range: [6, 34], + loc: { + start: { line: 1, column: 6 }, + end: { line: 1, column: 34 } + } + }, + range: [0, 34], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 34 } + } + }, + + '__proto__: while (true) { break __proto__; }': { + type: 'LabeledStatement', + label: { + type: 'Identifier', + name: '__proto__', + range: [0, 9], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 9 } + } + }, + body: { + type: 'WhileStatement', + test: { + type: 'Literal', + value: true, + raw: 'true', + range: [18, 22], + loc: { + start: { line: 1, column: 18 }, + end: { line: 1, column: 22 } + } + }, + body: { + type: 'BlockStatement', + body: [{ + type: 'BreakStatement', + label: { + type: 'Identifier', + name: '__proto__', + range: [32, 41], + loc: { + start: { line: 1, column: 32 }, + end: { line: 1, column: 41 } + } + }, + range: [26, 42], + loc: { + start: { line: 1, column: 26 }, + end: { line: 1, column: 42 } + } + }], + range: [24, 44], + loc: { + start: { line: 1, column: 24 }, + end: { line: 1, column: 44 } + } + }, + range: [11, 44], + loc: { + start: { line: 1, column: 11 }, + end: { line: 1, column: 44 } + } + }, + range: [0, 44], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 44 } + } + } + + }, + + 'return statement': { + + '(function(){ return })': { + type: 'ExpressionStatement', + expression: { + type: 'FunctionExpression', + id: null, + params: [], + defaults: [], + body: { + type: 'BlockStatement', + body: [ + { + type: 'ReturnStatement', + argument: null, + range: [13, 20], + loc: { + start: { line: 1, column: 13 }, + end: { line: 1, column: 20 } + } + } + ], + range: [11, 21], + loc: { + start: { line: 1, column: 11 }, + end: { line: 1, column: 21 } + } + }, + rest: null, + generator: false, + expression: false, + range: [1, 21], + loc: { + start: { line: 1, column: 1 }, + end: { line: 1, column: 21 } + } + }, + range: [0, 22], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 22 } + } + }, + + '(function(){ return; })': { + type: 'ExpressionStatement', + expression: { + type: 'FunctionExpression', + id: null, + params: [], + defaults: [], + body: { + type: 'BlockStatement', + body: [ + { + type: 'ReturnStatement', + argument: null, + range: [13, 20], + loc: { + start: { line: 1, column: 13 }, + end: { line: 1, column: 20 } + } + } + ], + range: [11, 22], + loc: { + start: { line: 1, column: 11 }, + end: { line: 1, column: 22 } + } + }, + rest: null, + generator: false, + expression: false, + range: [1, 22], + loc: { + start: { line: 1, column: 1 }, + end: { line: 1, column: 22 } + } + }, + range: [0, 23], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 23 } + } + }, + + '(function(){ return x; })': { + type: 'ExpressionStatement', + expression: { + type: 'FunctionExpression', + id: null, + params: [], + defaults: [], + body: { + type: 'BlockStatement', + body: [ + { + type: 'ReturnStatement', + argument: { + type: 'Identifier', + name: 'x', + range: [20, 21], + loc: { + start: { line: 1, column: 20 }, + end: { line: 1, column: 21 } + } + }, + range: [13, 22], + loc: { + start: { line: 1, column: 13 }, + end: { line: 1, column: 22 } + } + } + ], + range: [11, 24], + loc: { + start: { line: 1, column: 11 }, + end: { line: 1, column: 24 } + } + }, + rest: null, + generator: false, + expression: false, + range: [1, 24], + loc: { + start: { line: 1, column: 1 }, + end: { line: 1, column: 24 } + } + }, + range: [0, 25], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 25 } + } + }, + + '(function(){ return x * y })': { + type: 'ExpressionStatement', + expression: { + type: 'FunctionExpression', + id: null, + params: [], + defaults: [], + body: { + type: 'BlockStatement', + body: [ + { + type: 'ReturnStatement', + argument: { + type: 'BinaryExpression', + operator: '*', + left: { + type: 'Identifier', + name: 'x', + range: [20, 21], + loc: { + start: { line: 1, column: 20 }, + end: { line: 1, column: 21 } + } + }, + right: { + type: 'Identifier', + name: 'y', + range: [24, 25], + loc: { + start: { line: 1, column: 24 }, + end: { line: 1, column: 25 } + } + }, + range: [20, 25], + loc: { + start: { line: 1, column: 20 }, + end: { line: 1, column: 25 } + } + }, + range: [13, 26], + loc: { + start: { line: 1, column: 13 }, + end: { line: 1, column: 26 } + } + } + ], + range: [11, 27], + loc: { + start: { line: 1, column: 11 }, + end: { line: 1, column: 27 } + } + }, + rest: null, + generator: false, + expression: false, + range: [1, 27], + loc: { + start: { line: 1, column: 1 }, + end: { line: 1, column: 27 } + } + }, + range: [0, 28], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 28 } + } + } + }, + + 'with statement': { + + 'with (x) foo = bar': { + type: 'WithStatement', + object: { + type: 'Identifier', + name: 'x', + range: [6, 7], + loc: { + start: { line: 1, column: 6 }, + end: { line: 1, column: 7 } + } + }, + body: { + type: 'ExpressionStatement', + expression: { + type: 'AssignmentExpression', + operator: '=', + left: { + type: 'Identifier', + name: 'foo', + range: [9, 12], + loc: { + start: { line: 1, column: 9 }, + end: { line: 1, column: 12 } + } + }, + right: { + type: 'Identifier', + name: 'bar', + range: [15, 18], + loc: { + start: { line: 1, column: 15 }, + end: { line: 1, column: 18 } + } + }, + range: [9, 18], + loc: { + start: { line: 1, column: 9 }, + end: { line: 1, column: 18 } + } + }, + range: [9, 18], + loc: { + start: { line: 1, column: 9 }, + end: { line: 1, column: 18 } + } + }, + range: [0, 18], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 18 } + } + }, + + 'with (x) foo = bar;': { + type: 'WithStatement', + object: { + type: 'Identifier', + name: 'x', + range: [6, 7], + loc: { + start: { line: 1, column: 6 }, + end: { line: 1, column: 7 } + } + }, + body: { + type: 'ExpressionStatement', + expression: { + type: 'AssignmentExpression', + operator: '=', + left: { + type: 'Identifier', + name: 'foo', + range: [9, 12], + loc: { + start: { line: 1, column: 9 }, + end: { line: 1, column: 12 } + } + }, + right: { + type: 'Identifier', + name: 'bar', + range: [15, 18], + loc: { + start: { line: 1, column: 15 }, + end: { line: 1, column: 18 } + } + }, + range: [9, 18], + loc: { + start: { line: 1, column: 9 }, + end: { line: 1, column: 18 } + } + }, + range: [9, 19], + loc: { + start: { line: 1, column: 9 }, + end: { line: 1, column: 19 } + } + }, + range: [0, 19], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 19 } + } + }, + + 'with (x) { foo = bar }': { + type: 'WithStatement', + object: { + type: 'Identifier', + name: 'x', + range: [6, 7], + loc: { + start: { line: 1, column: 6 }, + end: { line: 1, column: 7 } + } + }, + body: { + type: 'BlockStatement', + body: [{ + type: 'ExpressionStatement', + expression: { + type: 'AssignmentExpression', + operator: '=', + left: { + type: 'Identifier', + name: 'foo', + range: [11, 14], + loc: { + start: { line: 1, column: 11 }, + end: { line: 1, column: 14 } + } + }, + right: { + type: 'Identifier', + name: 'bar', + range: [17, 20], + loc: { + start: { line: 1, column: 17 }, + end: { line: 1, column: 20 } + } + }, + range: [11, 20], + loc: { + start: { line: 1, column: 11 }, + end: { line: 1, column: 20 } + } + }, + range: [11, 21], + loc: { + start: { line: 1, column: 11 }, + end: { line: 1, column: 21 } + } + }], + range: [9, 22], + loc: { + start: { line: 1, column: 9 }, + end: { line: 1, column: 22 } + } + }, + range: [0, 22], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 22 } + } + } + + }, + + 'switch statement': { + + 'switch (x) {}': { + type: 'SwitchStatement', + discriminant: { + type: 'Identifier', + name: 'x', + range: [8, 9], + loc: { + start: { line: 1, column: 8 }, + end: { line: 1, column: 9 } + } + }, + cases:[], + range: [0, 13], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 13 } + } + }, + + 'switch (answer) { case 42: hi(); break; }': { + type: 'SwitchStatement', + discriminant: { + type: 'Identifier', + name: 'answer', + range: [8, 14], + loc: { + start: { line: 1, column: 8 }, + end: { line: 1, column: 14 } + } + }, + cases: [{ + type: 'SwitchCase', + test: { + type: 'Literal', + value: 42, + raw: '42', + range: [23, 25], + loc: { + start: { line: 1, column: 23 }, + end: { line: 1, column: 25 } + } + }, + consequent: [{ + type: 'ExpressionStatement', + expression: { + type: 'CallExpression', + callee: { + type: 'Identifier', + name: 'hi', + range: [27, 29], + loc: { + start: { line: 1, column: 27 }, + end: { line: 1, column: 29 } + } + }, + 'arguments': [], + range: [27, 31], + loc: { + start: { line: 1, column: 27 }, + end: { line: 1, column: 31 } + } + }, + range: [27, 32], + loc: { + start: { line: 1, column: 27 }, + end: { line: 1, column: 32 } + } + }, { + type: 'BreakStatement', + label: null, + range: [33, 39], + loc: { + start: { line: 1, column: 33 }, + end: { line: 1, column: 39 } + } + }], + range: [18, 39], + loc: { + start: { line: 1, column: 18 }, + end: { line: 1, column: 39 } + } + }], + range: [0, 41], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 41 } + } + }, + + 'switch (answer) { case 42: hi(); break; default: break }': { + type: 'SwitchStatement', + discriminant: { + type: 'Identifier', + name: 'answer', + range: [8, 14], + loc: { + start: { line: 1, column: 8 }, + end: { line: 1, column: 14 } + } + }, + cases: [{ + type: 'SwitchCase', + test: { + type: 'Literal', + value: 42, + raw: '42', + range: [23, 25], + loc: { + start: { line: 1, column: 23 }, + end: { line: 1, column: 25 } + } + }, + consequent: [{ + type: 'ExpressionStatement', + expression: { + type: 'CallExpression', + callee: { + type: 'Identifier', + name: 'hi', + range: [27, 29], + loc: { + start: { line: 1, column: 27 }, + end: { line: 1, column: 29 } + } + }, + 'arguments': [], + range: [27, 31], + loc: { + start: { line: 1, column: 27 }, + end: { line: 1, column: 31 } + } + }, + range: [27, 32], + loc: { + start: { line: 1, column: 27 }, + end: { line: 1, column: 32 } + } + }, { + type: 'BreakStatement', + label: null, + range: [33, 39], + loc: { + start: { line: 1, column: 33 }, + end: { line: 1, column: 39 } + } + }], + range: [18, 39], + loc: { + start: { line: 1, column: 18 }, + end: { line: 1, column: 39 } + } + }, { + type: 'SwitchCase', + test: null, + consequent: [{ + type: 'BreakStatement', + label: null, + range: [49, 55], + loc: { + start: { line: 1, column: 49 }, + end: { line: 1, column: 55 } + } + }], + range: [40, 55], + loc: { + start: { line: 1, column: 40 }, + end: { line: 1, column: 55 } + } + }], + range: [0, 56], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 56 } + } + } + + }, + + 'Labelled Statements': { + + 'start: for (;;) break start': { + type: 'LabeledStatement', + label: { + type: 'Identifier', + name: 'start', + range: [0, 5], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 5 } + } + }, + body: { + type: 'ForStatement', + init: null, + test: null, + update: null, + body: { + type: 'BreakStatement', + label: { + type: 'Identifier', + name: 'start', + range: [22, 27], + loc: { + start: { line: 1, column: 22 }, + end: { line: 1, column: 27 } + } + }, + range: [16, 27], + loc: { + start: { line: 1, column: 16 }, + end: { line: 1, column: 27 } + } + }, + range: [7, 27], + loc: { + start: { line: 1, column: 7 }, + end: { line: 1, column: 27 } + } + }, + range: [0, 27], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 27 } + } + }, + + 'start: while (true) break start': { + type: 'LabeledStatement', + label: { + type: 'Identifier', + name: 'start', + range: [0, 5], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 5 } + } + }, + body: { + type: 'WhileStatement', + test: { + type: 'Literal', + value: true, + raw: 'true', + range: [14, 18], + loc: { + start: { line: 1, column: 14 }, + end: { line: 1, column: 18 } + } + }, + body: { + type: 'BreakStatement', + label: { + type: 'Identifier', + name: 'start', + range: [26, 31], + loc: { + start: { line: 1, column: 26 }, + end: { line: 1, column: 31 } + } + }, + range: [20, 31], + loc: { + start: { line: 1, column: 20 }, + end: { line: 1, column: 31 } + } + }, + range: [7, 31], + loc: { + start: { line: 1, column: 7 }, + end: { line: 1, column: 31 } + } + }, + range: [0, 31], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 31 } + } + }, + + '__proto__: test': { + type: 'LabeledStatement', + label: { + type: 'Identifier', + name: '__proto__', + range: [0, 9], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 9 } + } + }, + body: { + type: 'ExpressionStatement', + expression: { + type: 'Identifier', + name: 'test', + range: [11, 15], + loc: { + start: { line: 1, column: 11 }, + end: { line: 1, column: 15 } + } + }, + range: [11, 15], + loc: { + start: { line: 1, column: 11 }, + end: { line: 1, column: 15 } + } + }, + range: [0, 15], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 15 } + } + } + + }, + + 'throw statement': { + + 'throw x;': { + type: 'ThrowStatement', + argument: { + type: 'Identifier', + name: 'x', + range: [6, 7], + loc: { + start: { line: 1, column: 6 }, + end: { line: 1, column: 7 } + } + }, + range: [0, 8], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 8 } + } + }, + + 'throw x * y': { + type: 'ThrowStatement', + argument: { + type: 'BinaryExpression', + operator: '*', + left: { + type: 'Identifier', + name: 'x', + range: [6, 7], + loc: { + start: { line: 1, column: 6 }, + end: { line: 1, column: 7 } + } + }, + right: { + type: 'Identifier', + name: 'y', + range: [10, 11], + loc: { + start: { line: 1, column: 10 }, + end: { line: 1, column: 11 } + } + }, + range: [6, 11], + loc: { + start: { line: 1, column: 6 }, + end: { line: 1, column: 11 } + } + }, + range: [0, 11], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 11 } + } + }, + + 'throw { message: "Error" }': { + type: 'ThrowStatement', + argument: { + type: 'ObjectExpression', + properties: [{ + type: 'Property', + key: { + type: 'Identifier', + name: 'message', + range: [8, 15], + loc: { + start: { line: 1, column: 8 }, + end: { line: 1, column: 15 } + } + }, + value: { + type: 'Literal', + value: 'Error', + raw: '"Error"', + range: [17, 24], + loc: { + start: { line: 1, column: 17 }, + end: { line: 1, column: 24 } + } + }, + kind: 'init', + method: false, + shorthand: false, + range: [8, 24], + loc: { + start: { line: 1, column: 8 }, + end: { line: 1, column: 24 } + } + }], + range: [6, 26], + loc: { + start: { line: 1, column: 6 }, + end: { line: 1, column: 26 } + } + }, + range: [0, 26], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 26 } + } + } + + }, + + 'try statement': { + + 'try { } catch (e) { }': { + type: 'TryStatement', + block: { + type: 'BlockStatement', + body: [], + range: [4, 7], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 7 } + } + }, + guardedHandlers: [], + handlers: [{ + type: 'CatchClause', + param: { + type: 'Identifier', + name: 'e', + range: [15, 16], + loc: { + start: { line: 1, column: 15 }, + end: { line: 1, column: 16 } + } + }, + body: { + type: 'BlockStatement', + body: [], + range: [18, 21], + loc: { + start: { line: 1, column: 18 }, + end: { line: 1, column: 21 } + } + }, + range: [8, 21], + loc: { + start: { line: 1, column: 8 }, + end: { line: 1, column: 21 } + } + }], + finalizer: null, + range: [0, 21], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 21 } + } + }, + + 'try { } catch (eval) { }': { + type: 'TryStatement', + block: { + type: 'BlockStatement', + body: [], + range: [4, 7], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 7 } + } + }, + guardedHandlers: [], + handlers: [{ + type: 'CatchClause', + param: { + type: 'Identifier', + name: 'eval', + range: [15, 19], + loc: { + start: { line: 1, column: 15 }, + end: { line: 1, column: 19 } + } + }, + body: { + type: 'BlockStatement', + body: [], + range: [21, 24], + loc: { + start: { line: 1, column: 21 }, + end: { line: 1, column: 24 } + } + }, + range: [8, 24], + loc: { + start: { line: 1, column: 8 }, + end: { line: 1, column: 24 } + } + }], + finalizer: null, + range: [0, 24], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 24 } + } + }, + + 'try { } catch (arguments) { }': { + type: 'TryStatement', + block: { + type: 'BlockStatement', + body: [], + range: [4, 7], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 7 } + } + }, + guardedHandlers: [], + handlers: [{ + type: 'CatchClause', + param: { + type: 'Identifier', + name: 'arguments', + range: [15, 24], + loc: { + start: { line: 1, column: 15 }, + end: { line: 1, column: 24 } + } + }, + body: { + type: 'BlockStatement', + body: [], + range: [26, 29], + loc: { + start: { line: 1, column: 26 }, + end: { line: 1, column: 29 } + } + }, + range: [8, 29], + loc: { + start: { line: 1, column: 8 }, + end: { line: 1, column: 29 } + } + }], + finalizer: null, + range: [0, 29], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 29 } + } + }, + + 'try { } catch (e) { say(e) }': { + type: 'TryStatement', + block: { + type: 'BlockStatement', + body: [], + range: [4, 7], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 7 } + } + }, + guardedHandlers: [], + handlers: [{ + type: 'CatchClause', + param: { + type: 'Identifier', + name: 'e', + range: [15, 16], + loc: { + start: { line: 1, column: 15 }, + end: { line: 1, column: 16 } + } + }, + body: { + type: 'BlockStatement', + body: [{ + type: 'ExpressionStatement', + expression: { + type: 'CallExpression', + callee: { + type: 'Identifier', + name: 'say', + range: [20, 23], + loc: { + start: { line: 1, column: 20 }, + end: { line: 1, column: 23 } + } + }, + 'arguments': [{ + type: 'Identifier', + name: 'e', + range: [24, 25], + loc: { + start: { line: 1, column: 24 }, + end: { line: 1, column: 25 } + } + }], + range: [20, 26], + loc: { + start: { line: 1, column: 20 }, + end: { line: 1, column: 26 } + } + }, + range: [20, 27], + loc: { + start: { line: 1, column: 20 }, + end: { line: 1, column: 27 } + } + }], + range: [18, 28], + loc: { + start: { line: 1, column: 18 }, + end: { line: 1, column: 28 } + } + }, + range: [8, 28], + loc: { + start: { line: 1, column: 8 }, + end: { line: 1, column: 28 } + } + }], + finalizer: null, + range: [0, 28], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 28 } + } + }, + + 'try { } finally { cleanup(stuff) }': { + type: 'TryStatement', + block: { + type: 'BlockStatement', + body: [], + range: [4, 7], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 7 } + } + }, + guardedHandlers: [], + handlers: [], + finalizer: { + type: 'BlockStatement', + body: [{ + type: 'ExpressionStatement', + expression: { + type: 'CallExpression', + callee: { + type: 'Identifier', + name: 'cleanup', + range: [18, 25], + loc: { + start: { line: 1, column: 18 }, + end: { line: 1, column: 25 } + } + }, + 'arguments': [{ + type: 'Identifier', + name: 'stuff', + range: [26, 31], + loc: { + start: { line: 1, column: 26 }, + end: { line: 1, column: 31 } + } + }], + range: [18, 32], + loc: { + start: { line: 1, column: 18 }, + end: { line: 1, column: 32 } + } + }, + range: [18, 33], + loc: { + start: { line: 1, column: 18 }, + end: { line: 1, column: 33 } + } + }], + range: [16, 34], + loc: { + start: { line: 1, column: 16 }, + end: { line: 1, column: 34 } + } + }, + range: [0, 34], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 34 } + } + }, + + 'try { doThat(); } catch (e) { say(e) }': { + type: 'TryStatement', + block: { + type: 'BlockStatement', + body: [{ + type: 'ExpressionStatement', + expression: { + type: 'CallExpression', + callee: { + type: 'Identifier', + name: 'doThat', + range: [6, 12], + loc: { + start: { line: 1, column: 6 }, + end: { line: 1, column: 12 } + } + }, + 'arguments': [], + range: [6, 14], + loc: { + start: { line: 1, column: 6 }, + end: { line: 1, column: 14 } + } + }, + range: [6, 15], + loc: { + start: { line: 1, column: 6 }, + end: { line: 1, column: 15 } + } + }], + range: [4, 17], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 17 } + } + }, + guardedHandlers: [], + handlers: [{ + type: 'CatchClause', + param: { + type: 'Identifier', + name: 'e', + range: [25, 26], + loc: { + start: { line: 1, column: 25 }, + end: { line: 1, column: 26 } + } + }, + body: { + type: 'BlockStatement', + body: [{ + type: 'ExpressionStatement', + expression: { + type: 'CallExpression', + callee: { + type: 'Identifier', + name: 'say', + range: [30, 33], + loc: { + start: { line: 1, column: 30 }, + end: { line: 1, column: 33 } + } + }, + 'arguments': [{ + type: 'Identifier', + name: 'e', + range: [34, 35], + loc: { + start: { line: 1, column: 34 }, + end: { line: 1, column: 35 } + } + }], + range: [30, 36], + loc: { + start: { line: 1, column: 30 }, + end: { line: 1, column: 36 } + } + }, + range: [30, 37], + loc: { + start: { line: 1, column: 30 }, + end: { line: 1, column: 37 } + } + }], + range: [28, 38], + loc: { + start: { line: 1, column: 28 }, + end: { line: 1, column: 38 } + } + }, + range: [18, 38], + loc: { + start: { line: 1, column: 18 }, + end: { line: 1, column: 38 } + } + }], + finalizer: null, + range: [0, 38], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 38 } + } + }, + + 'try { doThat(); } catch (e) { say(e) } finally { cleanup(stuff) }': { + type: 'TryStatement', + block: { + type: 'BlockStatement', + body: [{ + type: 'ExpressionStatement', + expression: { + type: 'CallExpression', + callee: { + type: 'Identifier', + name: 'doThat', + range: [6, 12], + loc: { + start: { line: 1, column: 6 }, + end: { line: 1, column: 12 } + } + }, + 'arguments': [], + range: [6, 14], + loc: { + start: { line: 1, column: 6 }, + end: { line: 1, column: 14 } + } + }, + range: [6, 15], + loc: { + start: { line: 1, column: 6 }, + end: { line: 1, column: 15 } + } + }], + range: [4, 17], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 17 } + } + }, + guardedHandlers: [], + handlers: [{ + type: 'CatchClause', + param: { + type: 'Identifier', + name: 'e', + range: [25, 26], + loc: { + start: { line: 1, column: 25 }, + end: { line: 1, column: 26 } + } + }, + body: { + type: 'BlockStatement', + body: [{ + type: 'ExpressionStatement', + expression: { + type: 'CallExpression', + callee: { + type: 'Identifier', + name: 'say', + range: [30, 33], + loc: { + start: { line: 1, column: 30 }, + end: { line: 1, column: 33 } + } + }, + 'arguments': [{ + type: 'Identifier', + name: 'e', + range: [34, 35], + loc: { + start: { line: 1, column: 34 }, + end: { line: 1, column: 35 } + } + }], + range: [30, 36], + loc: { + start: { line: 1, column: 30 }, + end: { line: 1, column: 36 } + } + }, + range: [30, 37], + loc: { + start: { line: 1, column: 30 }, + end: { line: 1, column: 37 } + } + }], + range: [28, 38], + loc: { + start: { line: 1, column: 28 }, + end: { line: 1, column: 38 } + } + }, + range: [18, 38], + loc: { + start: { line: 1, column: 18 }, + end: { line: 1, column: 38 } + } + }], + finalizer: { + type: 'BlockStatement', + body: [{ + type: 'ExpressionStatement', + expression: { + type: 'CallExpression', + callee: { + type: 'Identifier', + name: 'cleanup', + range: [49, 56], + loc: { + start: { line: 1, column: 49 }, + end: { line: 1, column: 56 } + } + }, + 'arguments': [{ + type: 'Identifier', + name: 'stuff', + range: [57, 62], + loc: { + start: { line: 1, column: 57 }, + end: { line: 1, column: 62 } + } + }], + range: [49, 63], + loc: { + start: { line: 1, column: 49 }, + end: { line: 1, column: 63 } + } + }, + range: [49, 64], + loc: { + start: { line: 1, column: 49 }, + end: { line: 1, column: 64 } + } + }], + range: [47, 65], + loc: { + start: { line: 1, column: 47 }, + end: { line: 1, column: 65 } + } + }, + range: [0, 65], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 65 } + } + } + + }, + + 'debugger statement': { + + 'debugger;': { + type: 'DebuggerStatement', + range: [0, 9], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 9 } + } + } + + }, + + 'Function Definition': { + + 'function hello() { sayHi(); }': { + type: 'FunctionDeclaration', + id: { + type: 'Identifier', + name: 'hello', + range: [9, 14], + loc: { + start: { line: 1, column: 9 }, + end: { line: 1, column: 14 } + } + }, + params: [], + defaults: [], + body: { + type: 'BlockStatement', + body: [{ + type: 'ExpressionStatement', + expression: { + type: 'CallExpression', + callee: { + type: 'Identifier', + name: 'sayHi', + range: [19, 24], + loc: { + start: { line: 1, column: 19 }, + end: { line: 1, column: 24 } + } + }, + 'arguments': [], + range: [19, 26], + loc: { + start: { line: 1, column: 19 }, + end: { line: 1, column: 26 } + } + }, + range: [19, 27], + loc: { + start: { line: 1, column: 19 }, + end: { line: 1, column: 27 } + } + }], + range: [17, 29], + loc: { + start: { line: 1, column: 17 }, + end: { line: 1, column: 29 } + } + }, + rest: null, + generator: false, + expression: false, + range: [0, 29], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 29 } + } + }, + + 'function eval() { }': { + type: 'FunctionDeclaration', + id: { + type: 'Identifier', + name: 'eval', + range: [9, 13], + loc: { + start: { line: 1, column: 9 }, + end: { line: 1, column: 13 } + } + }, + params: [], + defaults: [], + body: { + type: 'BlockStatement', + body: [], + range: [16, 19], + loc: { + start: { line: 1, column: 16 }, + end: { line: 1, column: 19 } + } + }, + rest: null, + generator: false, + expression: false, + range: [0, 19], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 19 } + } + }, + + 'function arguments() { }': { + type: 'FunctionDeclaration', + id: { + type: 'Identifier', + name: 'arguments', + range: [9, 18], + loc: { + start: { line: 1, column: 9 }, + end: { line: 1, column: 18 } + } + }, + params: [], + defaults: [], + body: { + type: 'BlockStatement', + body: [], + range: [21, 24], + loc: { + start: { line: 1, column: 21 }, + end: { line: 1, column: 24 } + } + }, + rest: null, + generator: false, + expression: false, + range: [0, 24], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 24 } + } + }, + + 'function test(t, t) { }': { + type: 'FunctionDeclaration', + id: { + type: 'Identifier', + name: 'test', + range: [9, 13], + loc: { + start: { line: 1, column: 9 }, + end: { line: 1, column: 13 } + } + }, + params: [{ + type: 'Identifier', + name: 't', + range: [14, 15], + loc: { + start: { line: 1, column: 14 }, + end: { line: 1, column: 15 } + } + }, { + type: 'Identifier', + name: 't', + range: [17, 18], + loc: { + start: { line: 1, column: 17 }, + end: { line: 1, column: 18 } + } + }], + defaults: [], + body: { + type: 'BlockStatement', + body: [], + range: [20, 23], + loc: { + start: { line: 1, column: 20 }, + end: { line: 1, column: 23 } + } + }, + rest: null, + generator: false, + expression: false, + range: [0, 23], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 23 } + } + }, + + '(function test(t, t) { })': { + type: 'ExpressionStatement', + expression: { + type: 'FunctionExpression', + id: { + type: 'Identifier', + name: 'test', + range: [10, 14], + loc: { + start: { line: 1, column: 10 }, + end: { line: 1, column: 14 } + } + }, + params: [{ + type: 'Identifier', + name: 't', + range: [15, 16], + loc: { + start: { line: 1, column: 15 }, + end: { line: 1, column: 16 } + } + }, { + type: 'Identifier', + name: 't', + range: [18, 19], + loc: { + start: { line: 1, column: 18 }, + end: { line: 1, column: 19 } + } + }], + defaults: [], + body: { + type: 'BlockStatement', + body: [], + range: [21, 24], + loc: { + start: { line: 1, column: 21 }, + end: { line: 1, column: 24 } + } + }, + rest: null, + generator: false, + expression: false, + range: [1, 24], + loc: { + start: { line: 1, column: 1 }, + end: { line: 1, column: 24 } + } + }, + range: [0, 25], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 25 } + } + }, + + 'function eval() { function inner() { "use strict" } }': { + type: 'FunctionDeclaration', + id: { + type: 'Identifier', + name: 'eval', + range: [9, 13], + loc: { + start: { line: 1, column: 9 }, + end: { line: 1, column: 13 } + } + }, + params: [], + defaults: [], + body: { + type: 'BlockStatement', + body: [{ + type: 'FunctionDeclaration', + id: { + type: 'Identifier', + name: 'inner', + range: [27, 32], + loc: { + start: { line: 1, column: 27 }, + end: { line: 1, column: 32 } + } + }, + params: [], + defaults: [], + body: { + type: 'BlockStatement', + body: [{ + type: 'ExpressionStatement', + expression: { + type: 'Literal', + value: 'use strict', + raw: '\"use strict\"', + range: [37, 49], + loc: { + start: { line: 1, column: 37 }, + end: { line: 1, column: 49 } + } + }, + range: [37, 50], + loc: { + start: { line: 1, column: 37 }, + end: { line: 1, column: 50 } + } + }], + range: [35, 51], + loc: { + start: { line: 1, column: 35 }, + end: { line: 1, column: 51 } + } + }, + rest: null, + generator: false, + expression: false, + range: [18, 51], + loc: { + start: { line: 1, column: 18 }, + end: { line: 1, column: 51 } + } + }], + range: [16, 53], + loc: { + start: { line: 1, column: 16 }, + end: { line: 1, column: 53 } + } + }, + rest: null, + generator: false, + expression: false, + range: [0, 53], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 53 } + } + }, + + 'function hello(a) { sayHi(); }': { + type: 'FunctionDeclaration', + id: { + type: 'Identifier', + name: 'hello', + range: [9, 14], + loc: { + start: { line: 1, column: 9 }, + end: { line: 1, column: 14 } + } + }, + params: [{ + type: 'Identifier', + name: 'a', + range: [15, 16], + loc: { + start: { line: 1, column: 15 }, + end: { line: 1, column: 16 } + } + }], + defaults: [], + body: { + type: 'BlockStatement', + body: [{ + type: 'ExpressionStatement', + expression: { + type: 'CallExpression', + callee: { + type: 'Identifier', + name: 'sayHi', + range: [20, 25], + loc: { + start: { line: 1, column: 20 }, + end: { line: 1, column: 25 } + } + }, + 'arguments': [], + range: [20, 27], + loc: { + start: { line: 1, column: 20 }, + end: { line: 1, column: 27 } + } + }, + range: [20, 28], + loc: { + start: { line: 1, column: 20 }, + end: { line: 1, column: 28 } + } + }], + range: [18, 30], + loc: { + start: { line: 1, column: 18 }, + end: { line: 1, column: 30 } + } + }, + rest: null, + generator: false, + expression: false, + range: [0, 30], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 30 } + } + }, + + 'function hello(a, b) { sayHi(); }': { + type: 'FunctionDeclaration', + id: { + type: 'Identifier', + name: 'hello', + range: [9, 14], + loc: { + start: { line: 1, column: 9 }, + end: { line: 1, column: 14 } + } + }, + params: [{ + type: 'Identifier', + name: 'a', + range: [15, 16], + loc: { + start: { line: 1, column: 15 }, + end: { line: 1, column: 16 } + } + }, { + type: 'Identifier', + name: 'b', + range: [18, 19], + loc: { + start: { line: 1, column: 18 }, + end: { line: 1, column: 19 } + } + }], + defaults: [], + body: { + type: 'BlockStatement', + body: [{ + type: 'ExpressionStatement', + expression: { + type: 'CallExpression', + callee: { + type: 'Identifier', + name: 'sayHi', + range: [23, 28], + loc: { + start: { line: 1, column: 23 }, + end: { line: 1, column: 28 } + } + }, + 'arguments': [], + range: [23, 30], + loc: { + start: { line: 1, column: 23 }, + end: { line: 1, column: 30 } + } + }, + range: [23, 31], + loc: { + start: { line: 1, column: 23 }, + end: { line: 1, column: 31 } + } + }], + range: [21, 33], + loc: { + start: { line: 1, column: 21 }, + end: { line: 1, column: 33 } + } + }, + rest: null, + generator: false, + expression: false, + range: [0, 33], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 33 } + } + }, + + 'var hi = function() { sayHi() };': { + type: 'VariableDeclaration', + declarations: [{ + type: 'VariableDeclarator', + id: { + type: 'Identifier', + name: 'hi', + range: [4, 6], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 6 } + } + }, + init: { + type: 'FunctionExpression', + id: null, + params: [], + defaults: [], + body: { + type: 'BlockStatement', + body: [{ + type: 'ExpressionStatement', + expression: { + type: 'CallExpression', + callee: { + type: 'Identifier', + name: 'sayHi', + range: [22, 27], + loc: { + start: { line: 1, column: 22 }, + end: { line: 1, column: 27 } + } + }, + 'arguments': [], + range: [22, 29], + loc: { + start: { line: 1, column: 22 }, + end: { line: 1, column: 29 } + } + }, + range: [22, 30], + loc: { + start: { line: 1, column: 22 }, + end: { line: 1, column: 30 } + } + }], + range: [20, 31], + loc: { + start: { line: 1, column: 20 }, + end: { line: 1, column: 31 } + } + }, + rest: null, + generator: false, + expression: false, + range: [9, 31], + loc: { + start: { line: 1, column: 9 }, + end: { line: 1, column: 31 } + } + }, + range: [4, 31], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 31 } + } + }], + kind: 'var', + range: [0, 32], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 32 } + } + }, + + 'var hi = function eval() { };': { + type: 'VariableDeclaration', + declarations: [{ + type: 'VariableDeclarator', + id: { + type: 'Identifier', + name: 'hi', + range: [4, 6], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 6 } + } + }, + init: { + type: 'FunctionExpression', + id: { + type: 'Identifier', + name: 'eval', + range: [18, 22], + loc: { + start: { line: 1, column: 18 }, + end: { line: 1, column: 22 } + } + }, + params: [], + defaults: [], + body: { + type: 'BlockStatement', + body: [], + range: [25, 28], + loc: { + start: { line: 1, column: 25 }, + end: { line: 1, column: 28 } + } + }, + rest: null, + generator: false, + expression: false, + range: [9, 28], + loc: { + start: { line: 1, column: 9 }, + end: { line: 1, column: 28 } + } + }, + range: [4, 28], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 28 } + } + }], + kind: 'var', + range: [0, 29], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 29 } + } + }, + + 'var hi = function arguments() { };': { + type: 'VariableDeclaration', + declarations: [{ + type: 'VariableDeclarator', + id: { + type: 'Identifier', + name: 'hi', + range: [4, 6], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 6 } + } + }, + init: { + type: 'FunctionExpression', + id: { + type: 'Identifier', + name: 'arguments', + range: [18, 27], + loc: { + start: { line: 1, column: 18 }, + end: { line: 1, column: 27 } + } + }, + params: [], + defaults: [], + body: { + type: 'BlockStatement', + body: [], + range: [30, 33], + loc: { + start: { line: 1, column: 30 }, + end: { line: 1, column: 33 } + } + }, + rest: null, + generator: false, + expression: false, + range: [9, 33], + loc: { + start: { line: 1, column: 9 }, + end: { line: 1, column: 33 } + } + }, + range: [4, 33], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 33 } + } + }], + kind: 'var', + range: [0, 34], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 34 } + } + }, + + 'var hello = function hi() { sayHi() };': { + type: 'VariableDeclaration', + declarations: [{ + type: 'VariableDeclarator', + id: { + type: 'Identifier', + name: 'hello', + range: [4, 9], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 9 } + } + }, + init: { + type: 'FunctionExpression', + id: { + type: 'Identifier', + name: 'hi', + range: [21, 23], + loc: { + start: { line: 1, column: 21 }, + end: { line: 1, column: 23 } + } + }, + params: [], + defaults: [], + body: { + type: 'BlockStatement', + body: [{ + type: 'ExpressionStatement', + expression: { + type: 'CallExpression', + callee: { + type: 'Identifier', + name: 'sayHi', + range: [28, 33], + loc: { + start: { line: 1, column: 28 }, + end: { line: 1, column: 33 } + } + }, + 'arguments': [], + range: [28, 35], + loc: { + start: { line: 1, column: 28 }, + end: { line: 1, column: 35 } + } + }, + range: [28, 36], + loc: { + start: { line: 1, column: 28 }, + end: { line: 1, column: 36 } + } + }], + range: [26, 37], + loc: { + start: { line: 1, column: 26 }, + end: { line: 1, column: 37 } + } + }, + rest: null, + generator: false, + expression: false, + range: [12, 37], + loc: { + start: { line: 1, column: 12 }, + end: { line: 1, column: 37 } + } + }, + range: [4, 37], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 37 } + } + }], + kind: 'var', + range: [0, 38], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 38 } + } + }, + + '(function(){})': { + type: 'ExpressionStatement', + expression: { + type: 'FunctionExpression', + id: null, + params: [], + defaults: [], + body: { + type: 'BlockStatement', + body: [], + range: [11, 13], + loc: { + start: { line: 1, column: 11 }, + end: { line: 1, column: 13 } + } + }, + rest: null, + generator: false, + expression: false, + range: [1, 13], + loc: { + start: { line: 1, column: 1 }, + end: { line: 1, column: 13 } + } + }, + range: [0, 14], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 14 } + } + }, + + 'function universe(__proto__) { }': { + type: 'FunctionDeclaration', + id: { + type: 'Identifier', + name: 'universe', + range: [9, 17], + loc: { + start: { line: 1, column: 9 }, + end: { line: 1, column: 17 } + } + }, + params: [{ + type: 'Identifier', + name: '__proto__', + range: [18, 27], + loc: { + start: { line: 1, column: 18 }, + end: { line: 1, column: 27 } + } + }], + defaults: [], + body: { + type: 'BlockStatement', + body: [], + range: [29, 32], + loc: { + start: { line: 1, column: 29 }, + end: { line: 1, column: 32 } + } + }, + rest: null, + generator: false, + expression: false, + range: [0, 32], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 32 } + } + }, + + 'function test() { "use strict" + 42; }': { + type: 'FunctionDeclaration', + id: { + type: 'Identifier', + name: 'test', + range: [9, 13], + loc: { + start: { line: 1, column: 9 }, + end: { line: 1, column: 13 } + } + }, + params: [], + defaults: [], + body: { + type: 'BlockStatement', + body: [{ + type: 'ExpressionStatement', + expression: { + type: 'BinaryExpression', + operator: '+', + left: { + type: 'Literal', + value: 'use strict', + raw: '"use strict"', + range: [18, 30], + loc: { + start: { line: 1, column: 18 }, + end: { line: 1, column: 30 } + } + }, + right: { + type: 'Literal', + value: 42, + raw: '42', + range: [33, 35], + loc: { + start: { line: 1, column: 33 }, + end: { line: 1, column: 35 } + } + }, + range: [18, 35], + loc: { + start: { line: 1, column: 18 }, + end: { line: 1, column: 35 } + } + }, + range: [18, 36], + loc: { + start: { line: 1, column: 18 }, + end: { line: 1, column: 36 } + } + }], + range: [16, 38], + loc: { + start: { line: 1, column: 16 }, + end: { line: 1, column: 38 } + } + }, + rest: null, + generator: false, + expression: false, + range: [0, 38], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 38 } + } + } + + }, + + '[ES6] Default Parameter Value': { + + 'x = function(y = 1) {}': { + type: 'ExpressionStatement', + expression: { + type: 'AssignmentExpression', + operator: '=', + left: { + type: 'Identifier', + name: 'x', + range: [0, 1], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 1 } + } + }, + right: { + type: 'FunctionExpression', + id: null, + params: [{ + type: 'Identifier', + name: 'y', + range: [13, 14], + loc: { + start: { line: 1, column: 13 }, + end: { line: 1, column: 14 } + } + }], + defaults: [{ + type: 'Literal', + value: 1, + raw: '1', + range: [17, 18], + loc: { + start: { line: 1, column: 17 }, + end: { line: 1, column: 18 } + } + }], + body: { + type: 'BlockStatement', + body: [], + range: [20, 22], + loc: { + start: { line: 1, column: 20 }, + end: { line: 1, column: 22 } + } + }, + rest: null, + generator: false, + expression: false, + range: [4, 22], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 22 } + } + }, + range: [0, 22], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 22 } + } + }, + range: [0, 22], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 22 } + } + }, + + 'function f(a = 1) {}': { + type: 'FunctionDeclaration', + id: { + type: 'Identifier', + name: 'f', + range: [9, 10], + loc: { + start: { line: 1, column: 9 }, + end: { line: 1, column: 10 } + } + }, + params: [{ + type: 'Identifier', + name: 'a', + range: [11, 12], + loc: { + start: { line: 1, column: 11 }, + end: { line: 1, column: 12 } + } + }], + defaults: [{ + type: 'Literal', + value: 1, + raw: '1', + range: [15, 16], + loc: { + start: { line: 1, column: 15 }, + end: { line: 1, column: 16 } + } + }], + body: { + type: 'BlockStatement', + body: [], + range: [18, 20], + loc: { + start: { line: 1, column: 18 }, + end: { line: 1, column: 20 } + } + }, + rest: null, + generator: false, + expression: false, + range: [0, 20], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 20 } + } + }, + + 'x = { f: function(a=1) {} }': { + type: 'ExpressionStatement', + expression: { + type: 'AssignmentExpression', + operator: '=', + left: { + type: 'Identifier', + name: 'x', + range: [0, 1], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 1 } + } + }, + right: { + type: 'ObjectExpression', + properties: [{ + type: 'Property', + key: { + type: 'Identifier', + name: 'f', + range: [6, 7], + loc: { + start: { line: 1, column: 6 }, + end: { line: 1, column: 7 } + } + }, + value: { + type: 'FunctionExpression', + id: null, + params: [{ + type: 'Identifier', + name: 'a', + range: [18, 19], + loc: { + start: { line: 1, column: 18 }, + end: { line: 1, column: 19 } + } + }], + defaults: [{ + type: 'Literal', + value: 1, + raw: '1', + range: [20, 21], + loc: { + start: { line: 1, column: 20 }, + end: { line: 1, column: 21 } + } + }], + body: { + type: 'BlockStatement', + body: [], + range: [23, 25], + loc: { + start: { line: 1, column: 23 }, + end: { line: 1, column: 25 } + } + }, + rest: null, + generator: false, + expression: false, + range: [9, 25], + loc: { + start: { line: 1, column: 9 }, + end: { line: 1, column: 25 } + } + }, + kind: 'init', + method: false, + shorthand: false, + range: [6, 25], + loc: { + start: { line: 1, column: 6 }, + end: { line: 1, column: 25 } + } + }], + range: [4, 27], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 27 } + } + }, + range: [0, 27], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 27 } + } + }, + range: [0, 27], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 27 } + } + } + + }, + + 'Automatic semicolon insertion': { + + '{ x\n++y }': { + type: 'BlockStatement', + body: [{ + type: 'ExpressionStatement', + expression: { + type: 'Identifier', + name: 'x', + range: [2, 3], + loc: { + start: { line: 1, column: 2 }, + end: { line: 1, column: 3 } + } + }, + range: [2, 3], + loc: { + start: { line: 1, column: 2 }, + end: { line: 1, column: 3 } + } + }, { + type: 'ExpressionStatement', + expression: { + type: 'UpdateExpression', + operator: '++', + argument: { + type: 'Identifier', + name: 'y', + range: [6, 7], + loc: { + start: { line: 2, column: 2 }, + end: { line: 2, column: 3 } + } + }, + prefix: true, + range: [4, 7], + loc: { + start: { line: 2, column: 0 }, + end: { line: 2, column: 3 } + } + }, + range: [4, 8], + loc: { + start: { line: 2, column: 0 }, + end: { line: 2, column: 4 } + } + }], + range: [0, 9], + loc: { + start: { line: 1, column: 0 }, + end: { line: 2, column: 5 } + } + }, + + '{ x\n--y }': { + type: 'BlockStatement', + body: [{ + type: 'ExpressionStatement', + expression: { + type: 'Identifier', + name: 'x', + range: [2, 3], + loc: { + start: { line: 1, column: 2 }, + end: { line: 1, column: 3 } + } + }, + range: [2, 3], + loc: { + start: { line: 1, column: 2 }, + end: { line: 1, column: 3 } + } + }, { + type: 'ExpressionStatement', + expression: { + type: 'UpdateExpression', + operator: '--', + argument: { + type: 'Identifier', + name: 'y', + range: [6, 7], + loc: { + start: { line: 2, column: 2 }, + end: { line: 2, column: 3 } + } + }, + prefix: true, + range: [4, 7], + loc: { + start: { line: 2, column: 0 }, + end: { line: 2, column: 3 } + } + }, + range: [4, 8], + loc: { + start: { line: 2, column: 0 }, + end: { line: 2, column: 4 } + } + }], + range: [0, 9], + loc: { + start: { line: 1, column: 0 }, + end: { line: 2, column: 5 } + } + }, + + 'var x /* comment */;': { + type: 'VariableDeclaration', + declarations: [{ + type: 'VariableDeclarator', + id: { + type: 'Identifier', + name: 'x', + range: [4, 5], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 5 } + } + }, + init: null, + range: [4, 5], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 5 } + } + }], + kind: 'var', + range: [0, 20], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 20 } + } + }, + + '{ var x = 14, y = 3\nz; }': { + type: 'BlockStatement', + body: [{ + type: 'VariableDeclaration', + declarations: [{ + type: 'VariableDeclarator', + id: { + type: 'Identifier', + name: 'x', + range: [6, 7], + loc: { + start: { line: 1, column: 6 }, + end: { line: 1, column: 7 } + } + }, + init: { + type: 'Literal', + value: 14, + raw: '14', + range: [10, 12], + loc: { + start: { line: 1, column: 10 }, + end: { line: 1, column: 12 } + } + }, + range: [6, 12], + loc: { + start: { line: 1, column: 6 }, + end: { line: 1, column: 12 } + } + }, { + type: 'VariableDeclarator', + id: { + type: 'Identifier', + name: 'y', + range: [14, 15], + loc: { + start: { line: 1, column: 14 }, + end: { line: 1, column: 15 } + } + }, + init: { + type: 'Literal', + value: 3, + raw: '3', + range: [18, 19], + loc: { + start: { line: 1, column: 18 }, + end: { line: 1, column: 19 } + } + }, + range: [14, 19], + loc: { + start: { line: 1, column: 14 }, + end: { line: 1, column: 19 } + } + }], + kind: 'var', + range: [2, 19], + loc: { + start: { line: 1, column: 2 }, + end: { line: 1, column: 19 } + } + }, { + type: 'ExpressionStatement', + expression: { + type: 'Identifier', + name: 'z', + range: [20, 21], + loc: { + start: { line: 2, column: 0 }, + end: { line: 2, column: 1 } + } + }, + range: [20, 22], + loc: { + start: { line: 2, column: 0 }, + end: { line: 2, column: 2 } + } + }], + range: [0, 24], + loc: { + start: { line: 1, column: 0 }, + end: { line: 2, column: 4 } + } + }, + + 'while (true) { continue\nthere; }': { + type: 'WhileStatement', + test: { + type: 'Literal', + value: true, + raw: 'true', + range: [7, 11], + loc: { + start: { line: 1, column: 7 }, + end: { line: 1, column: 11 } + } + }, + body: { + type: 'BlockStatement', + body: [{ + type: 'ContinueStatement', + label: null, + range: [15, 23], + loc: { + start: { line: 1, column: 15 }, + end: { line: 1, column: 23 } + } + }, { + type: 'ExpressionStatement', + expression: { + type: 'Identifier', + name: 'there', + range: [24, 29], + loc: { + start: { line: 2, column: 0 }, + end: { line: 2, column: 5 } + } + }, + range: [24, 30], + loc: { + start: { line: 2, column: 0 }, + end: { line: 2, column: 6 } + } + }], + range: [13, 32], + loc: { + start: { line: 1, column: 13 }, + end: { line: 2, column: 8 } + } + }, + range: [0, 32], + loc: { + start: { line: 1, column: 0 }, + end: { line: 2, column: 8 } + } + }, + + 'while (true) { continue // Comment\nthere; }': { + type: 'WhileStatement', + test: { + type: 'Literal', + value: true, + raw: 'true', + range: [7, 11], + loc: { + start: { line: 1, column: 7 }, + end: { line: 1, column: 11 } + } + }, + body: { + type: 'BlockStatement', + body: [{ + type: 'ContinueStatement', + label: null, + range: [15, 23], + loc: { + start: { line: 1, column: 15 }, + end: { line: 1, column: 23 } + } + }, { + type: 'ExpressionStatement', + expression: { + type: 'Identifier', + name: 'there', + range: [35, 40], + loc: { + start: { line: 2, column: 0 }, + end: { line: 2, column: 5 } + } + }, + range: [35, 41], + loc: { + start: { line: 2, column: 0 }, + end: { line: 2, column: 6 } + } + }], + range: [13, 43], + loc: { + start: { line: 1, column: 13 }, + end: { line: 2, column: 8 } + } + }, + range: [0, 43], + loc: { + start: { line: 1, column: 0 }, + end: { line: 2, column: 8 } + } + }, + + 'while (true) { continue /* Multiline\nComment */there; }': { + type: 'WhileStatement', + test: { + type: 'Literal', + value: true, + raw: 'true', + range: [7, 11], + loc: { + start: { line: 1, column: 7 }, + end: { line: 1, column: 11 } + } + }, + body: { + type: 'BlockStatement', + body: [{ + type: 'ContinueStatement', + label: null, + range: [15, 23], + loc: { + start: { line: 1, column: 15 }, + end: { line: 1, column: 23 } + } + }, { + type: 'ExpressionStatement', + expression: { + type: 'Identifier', + name: 'there', + range: [47, 52], + loc: { + start: { line: 2, column: 10 }, + end: { line: 2, column: 15 } + } + }, + range: [47, 53], + loc: { + start: { line: 2, column: 10 }, + end: { line: 2, column: 16 } + } + }], + range: [13, 55], + loc: { + start: { line: 1, column: 13 }, + end: { line: 2, column: 18 } + } + }, + range: [0, 55], + loc: { + start: { line: 1, column: 0 }, + end: { line: 2, column: 18 } + } + }, + + 'while (true) { break\nthere; }': { + type: 'WhileStatement', + test: { + type: 'Literal', + value: true, + raw: 'true', + range: [7, 11], + loc: { + start: { line: 1, column: 7 }, + end: { line: 1, column: 11 } + } + }, + body: { + type: 'BlockStatement', + body: [{ + type: 'BreakStatement', + label: null, + range: [15, 20], + loc: { + start: { line: 1, column: 15 }, + end: { line: 1, column: 20 } + } + }, { + type: 'ExpressionStatement', + expression: { + type: 'Identifier', + name: 'there', + range: [21, 26], + loc: { + start: { line: 2, column: 0 }, + end: { line: 2, column: 5 } + } + }, + range: [21, 27], + loc: { + start: { line: 2, column: 0 }, + end: { line: 2, column: 6 } + } + }], + range: [13, 29], + loc: { + start: { line: 1, column: 13 }, + end: { line: 2, column: 8 } + } + }, + range: [0, 29], + loc: { + start: { line: 1, column: 0 }, + end: { line: 2, column: 8 } + } + }, + + 'while (true) { break // Comment\nthere; }': { + type: 'WhileStatement', + test: { + type: 'Literal', + value: true, + raw: 'true', + range: [7, 11], + loc: { + start: { line: 1, column: 7 }, + end: { line: 1, column: 11 } + } + }, + body: { + type: 'BlockStatement', + body: [{ + type: 'BreakStatement', + label: null, + range: [15, 20], + loc: { + start: { line: 1, column: 15 }, + end: { line: 1, column: 20 } + } + }, { + type: 'ExpressionStatement', + expression: { + type: 'Identifier', + name: 'there', + range: [32, 37], + loc: { + start: { line: 2, column: 0 }, + end: { line: 2, column: 5 } + } + }, + range: [32, 38], + loc: { + start: { line: 2, column: 0 }, + end: { line: 2, column: 6 } + } + }], + range: [13, 40], + loc: { + start: { line: 1, column: 13 }, + end: { line: 2, column: 8 } + } + }, + range: [0, 40], + loc: { + start: { line: 1, column: 0 }, + end: { line: 2, column: 8 } + } + }, + + 'while (true) { break /* Multiline\nComment */there; }': { + type: 'WhileStatement', + test: { + type: 'Literal', + value: true, + raw: 'true', + range: [7, 11], + loc: { + start: { line: 1, column: 7 }, + end: { line: 1, column: 11 } + } + }, + body: { + type: 'BlockStatement', + body: [{ + type: 'BreakStatement', + label: null, + range: [15, 20], + loc: { + start: { line: 1, column: 15 }, + end: { line: 1, column: 20 } + } + }, { + type: 'ExpressionStatement', + expression: { + type: 'Identifier', + name: 'there', + range: [44, 49], + loc: { + start: { line: 2, column: 10 }, + end: { line: 2, column: 15 } + } + }, + range: [44, 50], + loc: { + start: { line: 2, column: 10 }, + end: { line: 2, column: 16 } + } + }], + range: [13, 52], + loc: { + start: { line: 1, column: 13 }, + end: { line: 2, column: 18 } + } + }, + range: [0, 52], + loc: { + start: { line: 1, column: 0 }, + end: { line: 2, column: 18 } + } + }, + + '(function(){ return\nx; })': { + type: 'ExpressionStatement', + expression: { + type: 'FunctionExpression', + id: null, + params: [], + defaults: [], + body: { + type: 'BlockStatement', + body: [ + { + type: 'ReturnStatement', + argument: null, + range: [13, 19], + loc: { + start: { line: 1, column: 13 }, + end: { line: 1, column: 19 } + } + }, + { + type: 'ExpressionStatement', + expression: { + type: 'Identifier', + name: 'x', + range: [20, 21], + loc: { + start: { line: 2, column: 0 }, + end: { line: 2, column: 1 } + } + }, + range: [20, 22], + loc: { + start: { line: 2, column: 0 }, + end: { line: 2, column: 2 } + } + } + ], + range: [11, 24], + loc: { + start: { line: 1, column: 11 }, + end: { line: 2, column: 4 } + } + }, + rest: null, + generator: false, + expression: false, + range: [1, 24], + loc: { + start: { line: 1, column: 1 }, + end: { line: 2, column: 4 } + } + }, + range: [0, 25], + loc: { + start: { line: 1, column: 0 }, + end: { line: 2, column: 5 } + } + }, + + '(function(){ return // Comment\nx; })': { + type: 'ExpressionStatement', + expression: { + type: 'FunctionExpression', + id: null, + params: [], + defaults: [], + body: { + type: 'BlockStatement', + body: [ + { + type: 'ReturnStatement', + argument: null, + range: [13, 19], + loc: { + start: { line: 1, column: 13 }, + end: { line: 1, column: 19 } + } + }, + { + type: 'ExpressionStatement', + expression: { + type: 'Identifier', + name: 'x', + range: [31, 32], + loc: { + start: { line: 2, column: 0 }, + end: { line: 2, column: 1 } + } + }, + range: [31, 33], + loc: { + start: { line: 2, column: 0 }, + end: { line: 2, column: 2 } + } + } + ], + range: [11, 35], + loc: { + start: { line: 1, column: 11 }, + end: { line: 2, column: 4 } + } + }, + rest: null, + generator: false, + expression: false, + range: [1, 35], + loc: { + start: { line: 1, column: 1 }, + end: { line: 2, column: 4 } + } + }, + range: [0, 36], + loc: { + start: { line: 1, column: 0 }, + end: { line: 2, column: 5 } + } + }, + + '(function(){ return/* Multiline\nComment */x; })': { + type: 'ExpressionStatement', + expression: { + type: 'FunctionExpression', + id: null, + params: [], + defaults: [], + body: { + type: 'BlockStatement', + body: [ + { + type: 'ReturnStatement', + argument: null, + range: [13, 19], + loc: { + start: { line: 1, column: 13 }, + end: { line: 1, column: 19 } + } + }, + { + type: 'ExpressionStatement', + expression: { + type: 'Identifier', + name: 'x', + range: [42, 43], + loc: { + start: { line: 2, column: 10 }, + end: { line: 2, column: 11 } + } + }, + range: [42, 44], + loc: { + start: { line: 2, column: 10 }, + end: { line: 2, column: 12 } + } + } + ], + range: [11, 46], + loc: { + start: { line: 1, column: 11 }, + end: { line: 2, column: 14 } + } + }, + rest: null, + generator: false, + expression: false, + range: [1, 46], + loc: { + start: { line: 1, column: 1 }, + end: { line: 2, column: 14 } + } + }, + range: [0, 47], + loc: { + start: { line: 1, column: 0 }, + end: { line: 2, column: 15 } + } + }, + + '{ throw error\nerror; }': { + type: 'BlockStatement', + body: [{ + type: 'ThrowStatement', + argument: { + type: 'Identifier', + name: 'error', + range: [8, 13], + loc: { + start: { line: 1, column: 8 }, + end: { line: 1, column: 13 } + } + }, + range: [2, 13], + loc: { + start: { line: 1, column: 2 }, + end: { line: 1, column: 13 } + } + }, { + type: 'ExpressionStatement', + expression: { + type: 'Identifier', + name: 'error', + range: [14, 19], + loc: { + start: { line: 2, column: 0 }, + end: { line: 2, column: 5 } + } + }, + range: [14, 20], + loc: { + start: { line: 2, column: 0 }, + end: { line: 2, column: 6 } + } + }], + range: [0, 22], + loc: { + start: { line: 1, column: 0 }, + end: { line: 2, column: 8 } + } + }, + + '{ throw error// Comment\nerror; }': { + type: 'BlockStatement', + body: [{ + type: 'ThrowStatement', + argument: { + type: 'Identifier', + name: 'error', + range: [8, 13], + loc: { + start: { line: 1, column: 8 }, + end: { line: 1, column: 13 } + } + }, + range: [2, 13], + loc: { + start: { line: 1, column: 2 }, + end: { line: 1, column: 13 } + } + }, { + type: 'ExpressionStatement', + expression: { + type: 'Identifier', + name: 'error', + range: [24, 29], + loc: { + start: { line: 2, column: 0 }, + end: { line: 2, column: 5 } + } + }, + range: [24, 30], + loc: { + start: { line: 2, column: 0 }, + end: { line: 2, column: 6 } + } + }], + range: [0, 32], + loc: { + start: { line: 1, column: 0 }, + end: { line: 2, column: 8 } + } + }, + + '{ throw error/* Multiline\nComment */error; }': { + type: 'BlockStatement', + body: [{ + type: 'ThrowStatement', + argument: { + type: 'Identifier', + name: 'error', + range: [8, 13], + loc: { + start: { line: 1, column: 8 }, + end: { line: 1, column: 13 } + } + }, + range: [2, 13], + loc: { + start: { line: 1, column: 2 }, + end: { line: 1, column: 13 } + } + }, { + type: 'ExpressionStatement', + expression: { + type: 'Identifier', + name: 'error', + range: [36, 41], + loc: { + start: { line: 2, column: 10 }, + end: { line: 2, column: 15 } + } + }, + range: [36, 42], + loc: { + start: { line: 2, column: 10 }, + end: { line: 2, column: 16 } + } + }], + range: [0, 44], + loc: { + start: { line: 1, column: 0 }, + end: { line: 2, column: 18 } + } + } + + }, + + 'Directive Prolog': { + + '(function () { \'use\\x20strict\'; with (i); }())': { + type: 'ExpressionStatement', + expression: { + type: 'CallExpression', + callee: { + type: 'FunctionExpression', + id: null, + params: [], + defaults: [], + body: { + type: 'BlockStatement', + body: [{ + type: 'ExpressionStatement', + expression: { + type: 'Literal', + value: 'use strict', + raw: '\'use\\x20strict\'', + range: [15, 30], + loc: { + start: { line: 1, column: 15 }, + end: { line: 1, column: 30 } + } + }, + range: [15, 31], + loc: { + start: { line: 1, column: 15 }, + end: { line: 1, column: 31 } + } + }, { + type: 'WithStatement', + object: { + type: 'Identifier', + name: 'i', + range: [38, 39], + loc: { + start: { line: 1, column: 38 }, + end: { line: 1, column: 39 } + } + }, + body: { + type: 'EmptyStatement', + range: [40, 41], + loc: { + start: { line: 1, column: 40 }, + end: { line: 1, column: 41 } + } + }, + range: [32, 41], + loc: { + start: { line: 1, column: 32 }, + end: { line: 1, column: 41 } + } + }], + range: [13, 43], + loc: { + start: { line: 1, column: 13 }, + end: { line: 1, column: 43 } + } + }, + rest: null, + generator: false, + expression: false, + range: [1, 43], + loc: { + start: { line: 1, column: 1 }, + end: { line: 1, column: 43 } + } + }, + 'arguments': [], + range: [1, 45], + loc: { + start: { line: 1, column: 1 }, + end: { line: 1, column: 45 } + } + }, + range: [0, 46], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 46 } + } + }, + + '(function () { \'use\\nstrict\'; with (i); }())': { + type: 'ExpressionStatement', + expression: { + type: 'CallExpression', + callee: { + type: 'FunctionExpression', + id: null, + params: [], + defaults: [], + body: { + type: 'BlockStatement', + body: [{ + type: 'ExpressionStatement', + expression: { + type: 'Literal', + value: 'use\nstrict', + raw: '\'use\\nstrict\'', + range: [15, 28], + loc: { + start: { line: 1, column: 15 }, + end: { line: 1, column: 28 } + } + }, + range: [15, 29], + loc: { + start: { line: 1, column: 15 }, + end: { line: 1, column: 29 } + } + }, { + type: 'WithStatement', + object: { + type: 'Identifier', + name: 'i', + range: [36, 37], + loc: { + start: { line: 1, column: 36 }, + end: { line: 1, column: 37 } + } + }, + body: { + type: 'EmptyStatement', + range: [38, 39], + loc: { + start: { line: 1, column: 38 }, + end: { line: 1, column: 39 } + } + }, + range: [30, 39], + loc: { + start: { line: 1, column: 30 }, + end: { line: 1, column: 39 } + } + }], + range: [13, 41], + loc: { + start: { line: 1, column: 13 }, + end: { line: 1, column: 41 } + } + }, + rest: null, + generator: false, + expression: false, + range: [1, 41], + loc: { + start: { line: 1, column: 1 }, + end: { line: 1, column: 41 } + } + }, + 'arguments': [], + range: [1, 43], + loc: { + start: { line: 1, column: 1 }, + end: { line: 1, column: 43 } + } + }, + range: [0, 44], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 44 } + } + } + + }, + + 'Whitespace': { + + 'new\x20\x09\x0B\x0C\xA0\u1680\u180E\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\uFEFFa': { + type: 'ExpressionStatement', + expression: { + type: 'NewExpression', + callee: { + type: 'Identifier', + name: 'a', + range: [25, 26], + loc: { + start: {line: 1, column: 25}, + end: {line: 1, column: 26} + } + }, + arguments: [], + range: [0, 26], + loc: { + start: {line: 1, column: 0}, + end: {line: 1, column: 26} + } + }, + range: [0, 26], + loc: { + start: {line: 1, column: 0}, + end: {line: 1, column: 26} + } + }, + + '{0\x0A1\x0D2\u20283\u20294}': { + type: 'BlockStatement', + body: [ + { + type: 'ExpressionStatement', + expression: { + type: 'Literal', + value: 0, + raw: '0', + range: [1, 2], + loc: { + start: {line: 1, column: 1}, + end: {line: 1, column: 2} + } + }, + range: [1, 2], + loc: { + start: {line: 1, column: 1}, + end: {line: 1, column: 2} + } + }, + { + type: 'ExpressionStatement', + expression: { + type: 'Literal', + value: 1, + raw: '1', + range: [3, 4], + loc: { + start: {line: 2, column: 0}, + end: {line: 2, column: 1} + } + }, + range: [3, 4], + loc: { + start: {line: 2, column: 0}, + end: {line: 2, column: 1} + } + }, + { + type: 'ExpressionStatement', + expression: { + type: 'Literal', + value: 2, + raw: '2', + range: [5, 6], + loc: { + start: {line: 3, column: 0}, + end: {line: 3, column: 1} + } + }, + range: [5, 6], + loc: { + start: {line: 3, column: 0}, + end: {line: 3, column: 1} + } + }, + { + type: 'ExpressionStatement', + expression: { + type: 'Literal', + value: 3, + raw: '3', + range: [7, 8], + loc: { + start: {line: 4, column: 0}, + end: {line: 4, column: 1} + } + }, + range: [7, 8], + loc: { + start: {line: 4, column: 0}, + end: {line: 4, column: 1} + } + }, + { + type: 'ExpressionStatement', + expression: { + type: 'Literal', + value: 4, + raw: '4', + range: [9, 10], + loc: { + start: {line: 5, column: 0}, + end: {line: 5, column: 1} + } + }, + range: [9, 10], + loc: { + start: {line: 5, column: 0}, + end: {line: 5, column: 1} + } + } + ], + range: [0, 11], + loc: { + start: {line: 1, column: 0}, + end: {line: 5, column: 2} + } + } + + }, + + 'Source elements': { + + '': { + type: 'Program', + body: [], + range: [0, 0], + loc: { + start: { line: 0, column: 0 }, + end: { line: 0, column: 0 } + }, + tokens: [] + } + }, + + 'Source option': { + 'x + y - z': { + type: 'ExpressionStatement', + expression: { + type: 'BinaryExpression', + operator: '-', + left: { + type: 'BinaryExpression', + operator: '+', + left: { + type: 'Identifier', + name: 'x', + range: [0, 1], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 1 }, + source: '42.js' + } + }, + right: { + type: 'Identifier', + name: 'y', + range: [4, 5], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 5 }, + source: '42.js' + } + }, + range: [0, 5], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 5 }, + source: '42.js' + } + }, + right: { + type: 'Identifier', + name: 'z', + range: [8, 9], + loc: { + start: { line: 1, column: 8 }, + end: { line: 1, column: 9 }, + source: '42.js' + } + }, + range: [0, 9], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 9 }, + source: '42.js' + } + }, + range: [0, 9], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 9 }, + source: '42.js' + } + }, + + 'a + (b < (c * d)) + e': { + type: 'ExpressionStatement', + expression: { + type: 'BinaryExpression', + operator: '+', + left: { + type: 'BinaryExpression', + operator: '+', + left: { + type: 'Identifier', + name: 'a', + range: [0, 1], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 1 }, + source: '42.js' + } + }, + right: { + type: 'BinaryExpression', + operator: '<', + left: { + type: 'Identifier', + name: 'b', + range: [5, 6], + loc: { + start: { line: 1, column: 5 }, + end: { line: 1, column: 6 }, + source: '42.js' + } + }, + right: { + type: 'BinaryExpression', + operator: '*', + left: { + type: 'Identifier', + name: 'c', + range: [10, 11], + loc: { + start: { line: 1, column: 10 }, + end: { line: 1, column: 11 }, + source: '42.js' + } + }, + right: { + type: 'Identifier', + name: 'd', + range: [14, 15], + loc: { + start: { line: 1, column: 14 }, + end: { line: 1, column: 15 }, + source: '42.js' + } + }, + range: [10, 15], + loc: { + start: { line: 1, column: 10 }, + end: { line: 1, column: 15 }, + source: '42.js' + } + }, + range: [5, 16], + loc: { + start: { line: 1, column: 5 }, + end: { line: 1, column: 16 }, + source: '42.js' + } + }, + range: [0, 17], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 17 }, + source: '42.js' + } + }, + right: { + type: 'Identifier', + name: 'e', + range: [20, 21], + loc: { + start: { line: 1, column: 20 }, + end: { line: 1, column: 21 }, + source: '42.js' + } + }, + range: [0, 21], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 21 }, + source: '42.js' + } + }, + range: [0, 21], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 21 }, + source: '42.js' + } + } + + }, + + + 'Invalid syntax': { + + '{': { + index: 1, + lineNumber: 1, + column: 2, + message: 'Error: Line 1: Unexpected end of input' + }, + + '}': { + index: 0, + lineNumber: 1, + column: 1, + message: 'Error: Line 1: Unexpected token }' + }, + + '3ea': { + index: 2, + lineNumber: 1, + column: 3, + message: 'Error: Line 1: Unexpected token ILLEGAL' + }, + + '3in []': { + index: 1, + lineNumber: 1, + column: 2, + message: 'Error: Line 1: Unexpected token ILLEGAL' + }, + + '3e': { + index: 2, + lineNumber: 1, + column: 3, + message: 'Error: Line 1: Unexpected token ILLEGAL' + }, + + '3e+': { + index: 3, + lineNumber: 1, + column: 4, + message: 'Error: Line 1: Unexpected token ILLEGAL' + }, + + '3e-': { + index: 3, + lineNumber: 1, + column: 4, + message: 'Error: Line 1: Unexpected token ILLEGAL' + }, + + '3x': { + index: 1, + lineNumber: 1, + column: 2, + message: 'Error: Line 1: Unexpected token ILLEGAL' + }, + + '3x0': { + index: 1, + lineNumber: 1, + column: 2, + message: 'Error: Line 1: Unexpected token ILLEGAL' + }, + + '0x': { + index: 2, + lineNumber: 1, + column: 3, + message: 'Error: Line 1: Unexpected token ILLEGAL' + }, + + '01a': { + index: 2, + lineNumber: 1, + column: 3, + message: 'Error: Line 1: Unexpected token ILLEGAL' + }, + + '0o1a': { + index: 3, + lineNumber: 1, + column: 4, + message: 'Error: Line 1: Unexpected token ILLEGAL' + }, + + '0o': { + index: 2, + lineNumber: 1, + column: 3, + message: 'Error: Line 1: Unexpected token ILLEGAL' + }, + + '0O': { + index: 2, + lineNumber: 1, + column: 3, + message: 'Error: Line 1: Unexpected token ILLEGAL' + }, + + '0o9': { + index: 2, + lineNumber: 1, + column: 3, + message: 'Error: Line 1: Unexpected token ILLEGAL' + }, + + '0o18': { + index: 3, + lineNumber: 1, + column: 4, + message: 'Error: Line 1: Unexpected token ILLEGAL' + }, + + '0O1a': { + index: 3, + lineNumber: 1, + column: 4, + message: 'Error: Line 1: Unexpected token ILLEGAL' + }, + + '0b': { + index: 2, + lineNumber: 1, + column: 3, + message: 'Error: Line 1: Unexpected token ILLEGAL' + }, + + '0b1a': { + index: 3, + lineNumber: 1, + column: 4, + message: 'Error: Line 1: Unexpected token ILLEGAL' + }, + + '0b9': { + index: 2, + lineNumber: 1, + column: 3, + message: 'Error: Line 1: Unexpected token ILLEGAL' + }, + + '0b18': { + index: 3, + lineNumber: 1, + column: 4, + message: 'Error: Line 1: Unexpected token ILLEGAL' + }, + + '0b12': { + index: 3, + lineNumber: 1, + column: 4, + message: 'Error: Line 1: Unexpected token ILLEGAL' + }, + + '0B': { + index: 2, + lineNumber: 1, + column: 3, + message: 'Error: Line 1: Unexpected token ILLEGAL' + }, + + '0B1a': { + index: 3, + lineNumber: 1, + column: 4, + message: 'Error: Line 1: Unexpected token ILLEGAL' + }, + + '0B9': { + index: 2, + lineNumber: 1, + column: 3, + message: 'Error: Line 1: Unexpected token ILLEGAL' + }, + + '0B18': { + index: 3, + lineNumber: 1, + column: 4, + message: 'Error: Line 1: Unexpected token ILLEGAL' + }, + + '0B12': { + index: 3, + lineNumber: 1, + column: 4, + message: 'Error: Line 1: Unexpected token ILLEGAL' + }, + + '0O9': { + index: 2, + lineNumber: 1, + column: 3, + message: 'Error: Line 1: Unexpected token ILLEGAL' + }, + + '0O18': { + index: 3, + lineNumber: 1, + column: 4, + message: 'Error: Line 1: Unexpected token ILLEGAL' + }, + + '3in[]': { + index: 1, + lineNumber: 1, + column: 2, + message: 'Error: Line 1: Unexpected token ILLEGAL' + }, + + '0x3in[]': { + index: 3, + lineNumber: 1, + column: 4, + message: 'Error: Line 1: Unexpected token ILLEGAL' + }, + + '"Hello\nWorld"': { + index: 7, + lineNumber: 1, + column: 8, + message: 'Error: Line 1: Unexpected token ILLEGAL' + }, + + 'x\\': { + index: 2, + lineNumber: 1, + column: 3, + message: 'Error: Line 1: Unexpected token ILLEGAL' + }, + + 'x\\u005c': { + index: 7, + lineNumber: 1, + column: 8, + message: 'Error: Line 1: Unexpected token ILLEGAL' + }, + + 'x\\u002a': { + index: 7, + lineNumber: 1, + column: 8, + message: 'Error: Line 1: Unexpected token ILLEGAL' + }, + + 'var x = /(s/g': { + index: 13, + lineNumber: 1, + column: 14, + message: 'Error: Line 1: Invalid regular expression' + }, + + 'a\\u': { + index: 3, + lineNumber: 1, + column: 4, + message: 'Error: Line 1: Unexpected token ILLEGAL' + }, + + '\\ua': { + index: 3, + lineNumber: 1, + column: 4, + message: 'Error: Line 1: Unexpected token ILLEGAL' + }, + + '/': { + index: 1, + lineNumber: 1, + column: 2, + message: 'Error: Line 1: Invalid regular expression: missing /' + }, + + '/test': { + index: 5, + lineNumber: 1, + column: 6, + message: 'Error: Line 1: Invalid regular expression: missing /' + }, + + '/test\n/': { + index: 6, + lineNumber: 1, + column: 7, + message: 'Error: Line 1: Invalid regular expression: missing /' + }, + + 'var x = /[a-z]/\\ux': { + index: 17, + lineNumber: 1, + column: 18, + message: 'Error: Line 1: Unexpected token ILLEGAL' + }, + + 'var x = /[a-z\n]/\\ux': { + index: 14, + lineNumber: 1, + column: 15, + message: 'Error: Line 1: Invalid regular expression: missing /' + }, + + 'var x = /[a-z]/\\\\ux': { + index: 16, + lineNumber: 1, + column: 17, + message: 'Error: Line 1: Unexpected token ILLEGAL' + }, + + 'var x = /[P QR]/\\\\u0067': { + index: 17, + lineNumber: 1, + column: 18, + message: 'Error: Line 1: Unexpected token ILLEGAL' + }, + + '3 = 4': { + index: 1, + lineNumber: 1, + column: 2, + message: 'Error: Line 1: Invalid left-hand side in assignment' + }, + + 'func() = 4': { + index: 6, + lineNumber: 1, column: 7, message: 'Error: Line 1: Invalid left-hand side in assignment' }, @@ -15765,6 +22569,34 @@ var testFixture = { message: 'Error: Line 1: Invalid left-hand side in assignment' }, + '"\\u{110000}"': { + index: 11, + lineNumber: 1, + column: 12, + message: 'Error: Line 1: Unexpected token ILLEGAL' + }, + + '"\\u{}"': { + index: 4, + lineNumber: 1, + column: 5, + message: 'Error: Line 1: Unexpected token ILLEGAL' + }, + + '"\\u{FFFF"': { + index: 9, + lineNumber: 1, + column: 10, + message: 'Error: Line 1: Unexpected token ILLEGAL' + }, + + '"\\u{FFZ}"': { + index: 7, + lineNumber: 1, + column: 8, + message: 'Error: Line 1: Unexpected token ILLEGAL' + }, + '1++': { index: 1, lineNumber: 1, @@ -15856,6 +22688,13 @@ var testFixture = { message: 'Error: Line 1: Unexpected token if' }, + 'i #= 42': { + index: 2, + lineNumber: 1, + column: 3, + message: 'Error: Line 1: Unexpected token ILLEGAL' + }, + 'i + 2 = 42': { index: 5, lineNumber: 1, @@ -15989,6 +22828,143 @@ var testFixture = { message: 'Error: Line 1: Object literal may not have multiple get/set accessors with the same name' }, + '((a)) => 42': { + index: 6, + lineNumber: 1, + column: 7, + message: 'Error: Line 1: Unexpected token =>' + }, + + '(a, (b)) => 42': { + index: 9, + lineNumber: 1, + column: 10, + message: 'Error: Line 1: Unexpected token =>' + }, + + '"use strict"; (eval = 10) => 42': { + index: 15, + lineNumber: 1, + column: 16, + message: 'Error: Line 1: Assignment to eval or arguments is not allowed in strict mode' + }, + + // strict mode, using eval when IsSimpleParameterList is true + '"use strict"; eval => 42': { + index: 24, + lineNumber: 1, + column: 25, + message: 'Error: Line 1: Parameter name eval or arguments is not allowed in strict mode' + }, + + // strict mode, using arguments when IsSimpleParameterList is true + '"use strict"; arguments => 42': { + index: 29, + lineNumber: 1, + column: 30, + message: 'Error: Line 1: Parameter name eval or arguments is not allowed in strict mode' + }, + + // strict mode, using eval when IsSimpleParameterList is true + '"use strict"; (eval, a) => 42': { + index: 29, + lineNumber: 1, + column: 30, + message: 'Error: Line 1: Parameter name eval or arguments is not allowed in strict mode' + }, + + // strict mode, using arguments when IsSimpleParameterList is true + '"use strict"; (arguments, a) => 42': { + index: 34, + lineNumber: 1, + column: 35, + message: 'Error: Line 1: Parameter name eval or arguments is not allowed in strict mode' + }, + + '(a, a) => 42': { + index: 6, + lineNumber: 1, + column: 7, + message: 'Error: Line 1: Strict mode function may not have duplicate parameter names' + }, + + '"use strict"; (a, a) => 42': { + index: 20, + lineNumber: 1, + column: 21, + message: 'Error: Line 1: Strict mode function may not have duplicate parameter names' + }, + + '"use strict"; (a) => 00': { + index: 21, + lineNumber: 1, + column: 22, + message: 'Error: Line 1: Octal literals are not allowed in strict mode.' + }, + + '() <= 42': { + index: 3, + lineNumber: 1, + column: 4, + message: 'Error: Line 1: Unexpected token <=' + }, + + '() ? 42': { + index: 3, + lineNumber: 1, + column: 4, + message: 'Error: Line 1: Unexpected token ?' + }, + + '() + 42': { + index: 3, + lineNumber: 1, + column: 4, + message: 'Error: Line 1: Unexpected token +' + }, + + '(10) => 00': { + index: 5, + lineNumber: 1, + column: 6, + message: 'Error: Line 1: Unexpected token =>' + }, + + '(10, 20) => 00': { + index: 9, + lineNumber: 1, + column: 10, + message: 'Error: Line 1: Unexpected token =>' + }, + + '"use strict"; (eval) => 42': { + index: 26, + lineNumber: 1, + column: 27, + message: 'Error: Line 1: Parameter name eval or arguments is not allowed in strict mode' + }, + + '(eval) => { "use strict"; 42 }': { + index: 30, + lineNumber: 1, + column: 31, + message: 'Error: Line 1: Parameter name eval or arguments is not allowed in strict mode' + }, + + 'p = { q/ }': { + index: 7, + lineNumber: 1, + column: 8, + message: 'Error: Line 1: Unexpected token /' + }, + + 'p = { "q"/ }': { + index: 9, + lineNumber: 1, + column: 10, + message: 'Error: Line 1: Unexpected token /' + }, + 'function t(if) { }': { index: 11, lineNumber: 1, @@ -16367,7 +23343,7 @@ var testFixture = { column: 5, message: 'Error: Line 1: Invalid regular expression: missing /' }, - + '//\r \n]': { index: 5, lineNumber: 3, @@ -16552,9 +23528,9 @@ var testFixture = { }, '(function () { \'use strict\'; with (i); }())': { - index: 28, + index: 29, lineNumber: 1, - column: 29, + column: 30, message: 'Error: Line 1: Strict mode code may not include a with statement' }, @@ -16845,181 +23821,1605 @@ var testFixture = { message: 'Error: Line 1: Octal literals are not allowed in strict mode.' }, - 'function hello() { "use strict"; var implements; }': { - index: 37, + 'function hello() { "use strict"; var implements; }': { + index: 37, + lineNumber: 1, + column: 38, + message: 'Error: Line 1: Use of future reserved word in strict mode' + }, + + 'function hello() { "use strict"; var interface; }': { + index: 37, + lineNumber: 1, + column: 38, + message: 'Error: Line 1: Use of future reserved word in strict mode' + }, + + 'function hello() { "use strict"; var package; }': { + index: 37, + lineNumber: 1, + column: 38, + message: 'Error: Line 1: Use of future reserved word in strict mode' + }, + + 'function hello() { "use strict"; var private; }': { + index: 37, + lineNumber: 1, + column: 38, + message: 'Error: Line 1: Use of future reserved word in strict mode' + }, + + 'function hello() { "use strict"; var protected; }': { + index: 37, + lineNumber: 1, + column: 38, + message: 'Error: Line 1: Use of future reserved word in strict mode' + }, + + 'function hello() { "use strict"; var public; }': { + index: 37, + lineNumber: 1, + column: 38, + message: 'Error: Line 1: Use of future reserved word in strict mode' + }, + + 'function hello() { "use strict"; var static; }': { + index: 37, + lineNumber: 1, + column: 38, + message: 'Error: Line 1: Use of future reserved word in strict mode' + }, + + 'function hello() { "use strict"; var yield; }': { + index: 37, + lineNumber: 1, + column: 38, + message: 'Error: Line 1: Use of future reserved word in strict mode' + }, + + 'function hello() { "use strict"; var let; }': { + index: 37, + lineNumber: 1, + column: 38, + message: 'Error: Line 1: Use of future reserved word in strict mode' + }, + + 'function hello(static) { "use strict"; }': { + index: 15, + lineNumber: 1, + column: 16, + message: 'Error: Line 1: Use of future reserved word in strict mode' + }, + + 'function static() { "use strict"; }': { + index: 9, + lineNumber: 1, + column: 10, + message: 'Error: Line 1: Use of future reserved word in strict mode' + }, + + 'function eval(a) { "use strict"; }': { + index: 9, + lineNumber: 1, + column: 10, + message: 'Error: Line 1: Function name may not be eval or arguments in strict mode' + }, + + 'function arguments(a) { "use strict"; }': { + index: 9, + lineNumber: 1, + column: 10, + message: 'Error: Line 1: Function name may not be eval or arguments in strict mode' + }, + + 'var yield': { + index: 4, + lineNumber: 1, + column: 5, + message: 'Error: Line 1: Unexpected token yield' + }, + + 'var let': { + index: 4, + lineNumber: 1, + column: 5, + message: 'Error: Line 1: Unexpected token let' + }, + + '"use strict"; function static() { }': { + index: 23, + lineNumber: 1, + column: 24, + message: 'Error: Line 1: Use of future reserved word in strict mode' + }, + + 'function a(t, t) { "use strict"; }': { + index: 14, + lineNumber: 1, + column: 15, + message: 'Error: Line 1: Strict mode function may not have duplicate parameter names' + }, + + 'function a(eval) { "use strict"; }': { + index: 11, + lineNumber: 1, + column: 12, + message: 'Error: Line 1: Parameter name eval or arguments is not allowed in strict mode' + }, + + 'function a(package) { "use strict"; }': { + index: 11, lineNumber: 1, - column: 38, + column: 12, message: 'Error: Line 1: Use of future reserved word in strict mode' }, - 'function hello() { "use strict"; var interface; }': { - index: 37, + 'function a() { "use strict"; function b(t, t) { }; }': { + index: 43, lineNumber: 1, - column: 38, - message: 'Error: Line 1: Use of future reserved word in strict mode' + column: 44, + message: 'Error: Line 1: Strict mode function may not have duplicate parameter names' }, - 'function hello() { "use strict"; var package; }': { - index: 37, + '(function a(t, t) { "use strict"; })': { + index: 15, lineNumber: 1, - column: 38, - message: 'Error: Line 1: Use of future reserved word in strict mode' + column: 16, + message: 'Error: Line 1: Strict mode function may not have duplicate parameter names' }, - 'function hello() { "use strict"; var private; }': { - index: 37, + 'function a() { "use strict"; (function b(t, t) { }); }': { + index: 44, lineNumber: 1, - column: 38, - message: 'Error: Line 1: Use of future reserved word in strict mode' + column: 45, + message: 'Error: Line 1: Strict mode function may not have duplicate parameter names' }, - 'function hello() { "use strict"; var protected; }': { - index: 37, + '(function a(eval) { "use strict"; })': { + index: 12, lineNumber: 1, - column: 38, - message: 'Error: Line 1: Use of future reserved word in strict mode' + column: 13, + message: 'Error: Line 1: Parameter name eval or arguments is not allowed in strict mode' }, - 'function hello() { "use strict"; var public; }': { - index: 37, + '(function a(package) { "use strict"; })': { + index: 12, lineNumber: 1, - column: 38, + column: 13, message: 'Error: Line 1: Use of future reserved word in strict mode' }, - 'function hello() { "use strict"; var static; }': { - index: 37, + '__proto__: __proto__: 42;': { + index: 21, lineNumber: 1, - column: 38, - message: 'Error: Line 1: Use of future reserved word in strict mode' + column: 22, + message: 'Error: Line 1: Label \'__proto__\' has already been declared' }, - 'function hello() { "use strict"; var yield; }': { - index: 37, + '"use strict"; function t(__proto__, __proto__) { }': { + index: 36, lineNumber: 1, - column: 38, - message: 'Error: Line 1: Use of future reserved word in strict mode' + column: 37, + message: 'Error: Line 1: Strict mode function may not have duplicate parameter names' }, - 'function hello() { "use strict"; var let; }': { - index: 37, + '"use strict"; x = { __proto__: 42, __proto__: 43 }': { + index: 48, lineNumber: 1, - column: 38, - message: 'Error: Line 1: Use of future reserved word in strict mode' + column: 49, + message: 'Error: Line 1: Duplicate data property in object literal not allowed in strict mode' }, - 'function hello(static) { "use strict"; }': { - index: 15, + '"use strict"; x = { get __proto__() { }, __proto__: 43 }': { + index: 54, lineNumber: 1, - column: 16, - message: 'Error: Line 1: Use of future reserved word in strict mode' + column: 55, + message: 'Error: Line 1: Object literal may not have data and accessor property with the same name' }, - 'function static() { "use strict"; }': { - index: 9, + 'var': { + index: 3, lineNumber: 1, - column: 10, - message: 'Error: Line 1: Use of future reserved word in strict mode' + column: 4, + message: 'Error: Line 1: Unexpected end of input' }, - 'var yield': { - index: 4, + 'let': { + index: 3, lineNumber: 1, - column: 5, - message: 'Error: Line 1: Unexpected token yield' + column: 4, + message: 'Error: Line 1: Unexpected end of input' }, - 'var let': { - index: 4, + 'const': { + index: 5, lineNumber: 1, - column: 5, - message: 'Error: Line 1: Unexpected token let' + column: 6, + message: 'Error: Line 1: Unexpected end of input' }, - '"use strict"; function static() { }': { - index: 23, + '{ ; ; ': { + index: 8, lineNumber: 1, - column: 24, - message: 'Error: Line 1: Use of future reserved word in strict mode' + column: 9, + message: 'Error: Line 1: Unexpected end of input' }, - 'function a(t, t) { "use strict"; }': { - index: 14, - lineNumber: 1, - column: 15, - message: 'Error: Line 1: Strict mode function may not have duplicate parameter names' - }, + 'function t() { ; ; ': { + index: 21, + lineNumber: 1, + column: 22, + message: 'Error: Line 1: Unexpected end of input' + } + + }, + + 'Tokenize': { + 'tokenize(/42/)': [ + { + "type": "Identifier", + "value": "tokenize", + "range": [ + 0, + 8 + ], + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 8 + } + } + }, + { + "type": "Punctuator", + "value": "(", + "range": [ + 8, + 9 + ], + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 9 + } + } + }, + { + "type": "RegularExpression", + "value": "/42/", + "regex": { + "pattern": "42", + "flags": "" + }, + "range": [ + 9, + 13 + ], + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 13 + } + } + }, + { + "type": "Punctuator", + "value": ")", + "range": [ + 13, + 14 + ], + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 14 + } + } + } + ], + + 'if (false) { /42/ }': [ + { + "type": "Keyword", + "value": "if", + "range": [ + 0, + 2 + ], + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 2 + } + } + }, + { + "type": "Punctuator", + "value": "(", + "range": [ + 3, + 4 + ], + "loc": { + "start": { + "line": 1, + "column": 3 + }, + "end": { + "line": 1, + "column": 4 + } + } + }, + { + "type": "Boolean", + "value": "false", + "range": [ + 4, + 9 + ], + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 9 + } + } + }, + { + "type": "Punctuator", + "value": ")", + "range": [ + 9, + 10 + ], + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 10 + } + } + }, + { + "type": "Punctuator", + "value": "{", + "range": [ + 11, + 12 + ], + "loc": { + "start": { + "line": 1, + "column": 11 + }, + "end": { + "line": 1, + "column": 12 + } + } + }, + { + "type": "RegularExpression", + "value": "/42/", + "regex": { + "pattern": "42", + "flags": "" + }, + "range": [ + 13, + 17 + ], + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 17 + } + } + }, + { + "type": "Punctuator", + "value": "}", + "range": [ + 18, + 19 + ], + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 19 + } + } + } + ], + + 'with (false) /42/': [ + { + "type": "Keyword", + "value": "with", + "range": [ + 0, + 4 + ], + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 4 + } + } + }, + { + "type": "Punctuator", + "value": "(", + "range": [ + 5, + 6 + ], + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 6 + } + } + }, + { + "type": "Boolean", + "value": "false", + "range": [ + 6, + 11 + ], + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 11 + } + } + }, + { + "type": "Punctuator", + "value": ")", + "range": [ + 11, + 12 + ], + "loc": { + "start": { + "line": 1, + "column": 11 + }, + "end": { + "line": 1, + "column": 12 + } + } + }, + { + "type": "RegularExpression", + "value": "/42/", + "regex": { + "pattern": "42", + "flags": "" + }, + "range": [ + 13, + 17 + ], + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 17 + } + } + } + ], + + '(false) /42/': [ + { + "type": "Punctuator", + "value": "(", + "range": [ + 0, + 1 + ], + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + } + } + }, + { + "type": "Boolean", + "value": "false", + "range": [ + 1, + 6 + ], + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 6 + } + } + }, + { + "type": "Punctuator", + "value": ")", + "range": [ + 6, + 7 + ], + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 7 + } + } + }, + { + "type": "Punctuator", + "value": "/", + "range": [ + 8, + 9 + ], + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 9 + } + } + }, + { + "type": "Numeric", + "value": "42", + "range": [ + 9, + 11 + ], + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 11 + } + } + }, + { + "type": "Punctuator", + "value": "/", + "range": [ + 11, + 12 + ], + "loc": { + "start": { + "line": 1, + "column": 11 + }, + "end": { + "line": 1, + "column": 12 + } + } + } + ], + + 'function f(){} /42/': [ + { + "type": "Keyword", + "value": "function", + "range": [ + 0, + 8 + ], + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 8 + } + } + }, + { + "type": "Identifier", + "value": "f", + "range": [ + 9, + 10 + ], + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 10 + } + } + }, + { + "type": "Punctuator", + "value": "(", + "range": [ + 10, + 11 + ], + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 11 + } + } + }, + { + "type": "Punctuator", + "value": ")", + "range": [ + 11, + 12 + ], + "loc": { + "start": { + "line": 1, + "column": 11 + }, + "end": { + "line": 1, + "column": 12 + } + } + }, + { + "type": "Punctuator", + "value": "{", + "range": [ + 12, + 13 + ], + "loc": { + "start": { + "line": 1, + "column": 12 + }, + "end": { + "line": 1, + "column": 13 + } + } + }, + { + "type": "Punctuator", + "value": "}", + "range": [ + 13, + 14 + ], + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 14 + } + } + }, + { + "type": "RegularExpression", + "value": "/42/", + "regex": { + "pattern": "42", + "flags": "" + }, + "range": [ + 15, + 19 + ], + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 19 + } + } + } + ], + + 'function(){} /42': [ + { + "type": "Keyword", + "value": "function", + "range": [ + 0, + 8 + ], + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 8 + } + } + }, + { + "type": "Punctuator", + "value": "(", + "range": [ + 8, + 9 + ], + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 9 + } + } + }, + { + "type": "Punctuator", + "value": ")", + "range": [ + 9, + 10 + ], + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 10 + } + } + }, + { + "type": "Punctuator", + "value": "{", + "range": [ + 10, + 11 + ], + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 11 + } + } + }, + { + "type": "Punctuator", + "value": "}", + "range": [ + 11, + 12 + ], + "loc": { + "start": { + "line": 1, + "column": 11 + }, + "end": { + "line": 1, + "column": 12 + } + } + }, + { + "type": "Punctuator", + "value": "/", + "range": [ + 13, + 14 + ], + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 14 + } + } + }, + { + "type": "Numeric", + "value": "42", + "range": [ + 14, + 16 + ], + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 16 + } + } + } + ], - 'function a(eval) { "use strict"; }': { - index: 11, - lineNumber: 1, - column: 12, - message: 'Error: Line 1: Parameter name eval or arguments is not allowed in strict mode' - }, + '{} /42': [ + { + "type": "Punctuator", + "value": "{", + "range": [ + 0, + 1 + ], + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + } + } + }, + { + "type": "Punctuator", + "value": "}", + "range": [ + 1, + 2 + ], + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 2 + } + } + }, + { + "type": "Punctuator", + "value": "/", + "range": [ + 3, + 4 + ], + "loc": { + "start": { + "line": 1, + "column": 3 + }, + "end": { + "line": 1, + "column": 4 + } + } + }, + { + "type": "Numeric", + "value": "42", + "range": [ + 4, + 6 + ], + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 6 + } + } + } + ], - 'function a(package) { "use strict"; }': { - index: 11, - lineNumber: 1, - column: 12, - message: 'Error: Line 1: Use of future reserved word in strict mode' - }, + '[function(){} /42]': [ + { + "type": "Punctuator", + "value": "[", + "range": [ + 0, + 1 + ], + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + } + } + }, + { + "type": "Keyword", + "value": "function", + "range": [ + 1, + 9 + ], + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 9 + } + } + }, + { + "type": "Punctuator", + "value": "(", + "range": [ + 9, + 10 + ], + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 10 + } + } + }, + { + "type": "Punctuator", + "value": ")", + "range": [ + 10, + 11 + ], + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 11 + } + } + }, + { + "type": "Punctuator", + "value": "{", + "range": [ + 11, + 12 + ], + "loc": { + "start": { + "line": 1, + "column": 11 + }, + "end": { + "line": 1, + "column": 12 + } + } + }, + { + "type": "Punctuator", + "value": "}", + "range": [ + 12, + 13 + ], + "loc": { + "start": { + "line": 1, + "column": 12 + }, + "end": { + "line": 1, + "column": 13 + } + } + }, + { + "type": "Punctuator", + "value": "/", + "range": [ + 14, + 15 + ], + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 15 + } + } + }, + { + "type": "Numeric", + "value": "42", + "range": [ + 15, + 17 + ], + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 17 + } + } + }, + { + "type": "Punctuator", + "value": "]", + "range": [ + 17, + 18 + ], + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 18 + } + } + } + ], - 'function a() { "use strict"; function b(t, t) { }; }': { - index: 43, - lineNumber: 1, - column: 44, - message: 'Error: Line 1: Strict mode function may not have duplicate parameter names' - }, + ';function f(){} /42/': [ + { + "type": "Punctuator", + "value": ";", + "range": [ + 0, + 1 + ], + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + } + } + }, + { + "type": "Keyword", + "value": "function", + "range": [ + 1, + 9 + ], + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 9 + } + } + }, + { + "type": "Identifier", + "value": "f", + "range": [ + 10, + 11 + ], + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 11 + } + } + }, + { + "type": "Punctuator", + "value": "(", + "range": [ + 11, + 12 + ], + "loc": { + "start": { + "line": 1, + "column": 11 + }, + "end": { + "line": 1, + "column": 12 + } + } + }, + { + "type": "Punctuator", + "value": ")", + "range": [ + 12, + 13 + ], + "loc": { + "start": { + "line": 1, + "column": 12 + }, + "end": { + "line": 1, + "column": 13 + } + } + }, + { + "type": "Punctuator", + "value": "{", + "range": [ + 13, + 14 + ], + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 14 + } + } + }, + { + "type": "Punctuator", + "value": "}", + "range": [ + 14, + 15 + ], + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 15 + } + } + }, + { + "type": "RegularExpression", + "value": "/42/", + "regex": { + "pattern": "42", + "flags": "" + }, + "range": [ + 16, + 20 + ], + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 20 + } + } + } + ], - '(function a(t, t) { "use strict"; })': { - index: 15, - lineNumber: 1, - column: 16, - message: 'Error: Line 1: Strict mode function may not have duplicate parameter names' - }, + 'void /42/': [ + { + "type": "Keyword", + "value": "void", + "range": [ + 0, + 4 + ], + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 4 + } + } + }, + { + "type": "RegularExpression", + "value": "/42/", + "regex": { + "pattern": "42", + "flags": "" + }, + "range": [ + 5, + 9 + ], + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 9 + } + } + } + ], - 'function a() { "use strict"; (function b(t, t) { }); }': { - index: 44, - lineNumber: 1, - column: 45, - message: 'Error: Line 1: Strict mode function may not have duplicate parameter names' - }, + '/42/': [ + { + "type": "RegularExpression", + "value": "/42/", + "regex": { + "pattern": "42", + "flags": "" + }, + "range": [ + 0, + 4 + ], + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 4 + } + } + } + ], - '(function a(eval) { "use strict"; })': { - index: 12, - lineNumber: 1, - column: 13, - message: 'Error: Line 1: Parameter name eval or arguments is not allowed in strict mode' - }, + 'foo[/42]': [ + { + "type": "Identifier", + "value": "foo", + "range": [ + 0, + 3 + ], + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 3 + } + } + }, + { + "type": "Punctuator", + "value": "[", + "range": [ + 3, + 4 + ], + "loc": { + "start": { + "line": 1, + "column": 3 + }, + "end": { + "line": 1, + "column": 4 + } + } + } + ], - '(function a(package) { "use strict"; })': { - index: 12, - lineNumber: 1, - column: 13, - message: 'Error: Line 1: Use of future reserved word in strict mode' - }, + '[a] / b': [ + { + "type": "Punctuator", + "value": "[", + "range": [ + 0, + 1 + ], + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + } + } + }, + { + "type": "Identifier", + "value": "a", + "range": [ + 1, + 2 + ], + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 2 + } + } + }, + { + "type": "Punctuator", + "value": "]", + "range": [ + 2, + 3 + ], + "loc": { + "start": { + "line": 1, + "column": 2 + }, + "end": { + "line": 1, + "column": 3 + } + } + }, + { + "type": "Punctuator", + "value": "/", + "range": [ + 4, + 5 + ], + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 5 + } + } + }, + { + "type": "Identifier", + "value": "b", + "range": [ + 6, + 7 + ], + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 7 + } + } + } + ], - 'var': { - index: 3, - lineNumber: 1, - column: 4, - message: 'Error: Line 1: Unexpected end of input' - }, + '': [], - 'let': { + '/42': { + tokenize: true, index: 3, lineNumber: 1, column: 4, - message: 'Error: Line 1: Unexpected end of input' + message: 'Error: Line 1: Invalid regular expression: missing /' }, - 'const': { - index: 5, + 'foo[/42': { + tokenize: true, + index: 7, lineNumber: 1, - column: 6, - message: 'Error: Line 1: Unexpected end of input' - } + column: 8, + message: 'Error: Line 1: Invalid regular expression: missing /' + }, + 'this / 100;': [ + { + "type": "Keyword", + "value": "this", + "range": [ + 0, + 4 + ], + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 4 + } + } + }, + { + "type": "Punctuator", + "value": "/", + "range": [ + 5, + 6 + ], + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 6 + } + } + }, + { + "type": "Numeric", + "value": "100", + "range": [ + 7, + 10 + ], + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 10 + } + } + }, + { + "type": "Punctuator", + "value": ";", + "range": [ + 10, + 11 + ], + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 11 + } + } + } + ] }, 'API': { @@ -17047,151 +25447,1373 @@ var testFixture = { type: 'ExpressionStatement', expression: { type: 'Literal', - value: null + value: null, + raw: 'null' + } + }] + } + }, + + 'parse(42)': { + call: 'parse', + args: [42], + result: { + type: 'Program', + body: [{ + type: 'ExpressionStatement', + expression: { + type: 'Literal', + value: 42, + raw: '42' + } + }] + } + }, + + 'parse(true)': { + call: 'parse', + args: [true], + result: { + type: 'Program', + body: [{ + type: 'ExpressionStatement', + expression: { + type: 'Literal', + value: true, + raw: 'true' + } + }] + } + }, + + 'parse(undefined)': { + call: 'parse', + args: [void 0], + result: { + type: 'Program', + body: [{ + type: 'ExpressionStatement', + expression: { + type: 'Identifier', + name: 'undefined' + } + }] + } + }, + + 'parse(new String("test"))': { + call: 'parse', + args: [new String('test')], + result: { + type: 'Program', + body: [{ + type: 'ExpressionStatement', + expression: { + type: 'Identifier', + name: 'test' + } + }] + } + }, + + 'parse(new Number(42))': { + call: 'parse', + args: [new Number(42)], + result: { + type: 'Program', + body: [{ + type: 'ExpressionStatement', + expression: { + type: 'Literal', + value: 42, + raw: '42' + } + }] + } + }, + + 'parse(new Boolean(true))': { + call: 'parse', + args: [new Boolean(true)], + result: { + type: 'Program', + body: [{ + type: 'ExpressionStatement', + expression: { + type: 'Literal', + value: true, + raw: 'true' } }] } }, - 'parse(42)': { - call: 'parse', - args: [42], - result: { - type: 'Program', - body: [{ - type: 'ExpressionStatement', - expression: { - type: 'Literal', - value: 42 - } - }] - } + 'Syntax': { + property: 'Syntax', + result: { + AssignmentExpression: 'AssignmentExpression', + ArrayExpression: 'ArrayExpression', + ArrowFunctionExpression: 'ArrowFunctionExpression', + BlockStatement: 'BlockStatement', + BinaryExpression: 'BinaryExpression', + BreakStatement: 'BreakStatement', + CallExpression: 'CallExpression', + CatchClause: 'CatchClause', + ConditionalExpression: 'ConditionalExpression', + ContinueStatement: 'ContinueStatement', + DoWhileStatement: 'DoWhileStatement', + DebuggerStatement: 'DebuggerStatement', + EmptyStatement: 'EmptyStatement', + ExpressionStatement: 'ExpressionStatement', + ForStatement: 'ForStatement', + ForInStatement: 'ForInStatement', + FunctionDeclaration: 'FunctionDeclaration', + FunctionExpression: 'FunctionExpression', + Identifier: 'Identifier', + IfStatement: 'IfStatement', + Literal: 'Literal', + LabeledStatement: 'LabeledStatement', + LogicalExpression: 'LogicalExpression', + MemberExpression: 'MemberExpression', + NewExpression: 'NewExpression', + ObjectExpression: 'ObjectExpression', + Program: 'Program', + Property: 'Property', + ReturnStatement: 'ReturnStatement', + SequenceExpression: 'SequenceExpression', + SwitchStatement: 'SwitchStatement', + SwitchCase: 'SwitchCase', + ThisExpression: 'ThisExpression', + ThrowStatement: 'ThrowStatement', + TryStatement: 'TryStatement', + UnaryExpression: 'UnaryExpression', + UpdateExpression: 'UpdateExpression', + VariableDeclaration: 'VariableDeclaration', + VariableDeclarator: 'VariableDeclarator', + WhileStatement: 'WhileStatement', + WithStatement: 'WithStatement' + } + }, + + 'tokenize()': { + call: 'tokenize', + args: [], + result: [{ + type: 'Identifier', + value: 'undefined' + }] + }, + + 'tokenize(null)': { + call: 'tokenize', + args: [null], + result: [{ + type: 'Null', + value: 'null' + }] + }, + + 'tokenize(42)': { + call: 'tokenize', + args: [42], + result: [{ + type: 'Numeric', + value: '42' + }] + }, + + 'tokenize(true)': { + call: 'tokenize', + args: [true], + result: [{ + type: 'Boolean', + value: 'true' + }] + }, + + 'tokenize(undefined)': { + call: 'tokenize', + args: [void 0], + result: [{ + type: 'Identifier', + value: 'undefined' + }] + }, + + 'tokenize(new String("test"))': { + call: 'tokenize', + args: [new String('test')], + result: [{ + type: 'Identifier', + value: 'test' + }] + }, + + 'tokenize(new Number(42))': { + call: 'tokenize', + args: [new Number(42)], + result: [{ + type: 'Numeric', + value: '42' + }] + }, + + 'tokenize(new Boolean(true))': { + call: 'tokenize', + args: [new Boolean(true)], + result: [{ + type: 'Boolean', + value: 'true' + }] + } + }, + + 'Tolerant parse': { + /** argument recovery */ + 'f(a b c);': { + range: [0, 9], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 9 } + }, + type: "Program", + body: [{ + range: [0, 9], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 9 } + }, + type: "ExpressionStatement", + expression: { + range: [0, 8], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 8 } + }, + type: "CallExpression", + callee: { + range: [0, 1], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 1 } + }, + type: "Identifier", + name: "f" + }, + "arguments": [{ + range: [2, 3], + loc: { + start: { line: 1, column: 2 }, + end: { line: 1, column: 3 } + }, + type: "Identifier", + name: "a" + }, { + range: [4, 5], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 5 } + }, + type: "Identifier", + name: "b" + }, { + range: [6, 7], + loc: { + start: { line: 1, column: 6 }, + end: { line: 1, column: 7 } + }, + type: "Identifier", + name: "c" + }] + } + }], + errors: [{ + index: 4, + lineNumber: 1, + column: 5, + message: "Error: Line 1: Unexpected token b" + }, { + index: 6, + lineNumber: 1, + column: 7, + message: "Error: Line 1: Unexpected token c" + }] + }, + + /** argument recovery function */ + 'f(a function(){} c);': { + range: [0, 20], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 20 } + }, + type: "Program", + body: [{ + range: [0, 20], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 20 } + }, + type: "ExpressionStatement", + expression: { + range: [0, 19], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 19 } + }, + type: "CallExpression", + callee: { + range: [0, 1], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 1 } + }, + type: "Identifier", + name: "f" + }, + "arguments": [{ + range: [2, 3], + loc: { + start: { line: 1, column: 2 }, + end: { line: 1, column: 3 } + }, + type: "Identifier", + name: "a" + }, { + range: [4, 16], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 16 } + }, + type: "FunctionExpression", + id: null, + params: [], + defaults: [], + body: { + range: [14, 16], + loc: { + start: { line: 1, column: 14 }, + end: { line: 1, column: 16 } + }, + type: "BlockStatement", + body: [] + }, + rest: null, + generator: false, + expression: false + }, { + range: [17, 18], + loc: { + start: { line: 1, column: 17 }, + end: { line: 1, column: 18 } + }, + type: "Identifier", + name: "c" + }] + } + }], + errors: [{ + index: 4, + lineNumber: 1, + column: 5, + message: "Error: Line 1: Unexpected token function" + }, { + index: 17, + lineNumber: 1, + column: 18, + message: "Error: Line 1: Unexpected token c" + }] + }, + + /** argument recovery object */ + 'f({} b c);': { + range: [0, 10], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 10 } + }, + type: "Program", + body: [{ + range: [0, 10], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 10 } + }, + type: "ExpressionStatement", + expression: { + range: [0, 9], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 9 } + }, + type: "CallExpression", + callee: { + range: [0, 1], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 1 } + }, + type: "Identifier", + name: "f" + }, + "arguments": [{ + range: [2, 4], + loc: { + start: { line: 1, column: 2 }, + end: { line: 1, column: 4 } + }, + type: "ObjectExpression", + properties: [] + }, { + range: [5, 6], + loc: { + start: { line: 1, column: 5 }, + end: { line: 1, column: 6 } + }, + type: "Identifier", + name: "b" + }, { + range: [7, 8], + loc: { + start: { line: 1, column: 7 }, + end: { line: 1, column: 8 } + }, + type: "Identifier", + name: "c" + }] + } + }], + errors: [{ + index: 5, + lineNumber: 1, + column: 6, + message: "Error: Line 1: Unexpected token b" + }, { + index: 7, + lineNumber: 1, + column: 8, + message: "Error: Line 1: Unexpected token c" + }] }, - 'parse(true)': { - call: 'parse', - args: [true], - result: { - type: 'Program', - body: [{ - type: 'ExpressionStatement', - expression: { - type: 'Literal', - value: true + /** single recovery - missing comma*/ + 'var o = {one: function() {} two:2};': { + range: [0, 35], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 35 } + }, + type: "Program", + body: [{ + range: [0, 35], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 35 } + }, + type: "VariableDeclaration", + declarations: [{ + range: [4, 34], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 34 } + }, + type: "VariableDeclarator", + id: { + range: [4, 5], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 5 } + }, + type: "Identifier", + name: "o" + }, + init: { + range: [8, 34], + loc: { + start: { line: 1, column: 8 }, + end: { line: 1, column: 34 } + }, + type: "ObjectExpression", + properties: [{ + range: [9, 27], + loc: { + start: { line: 1, column: 9 }, + end: { line: 1, column: 27 } + }, + type: "Property", + key: { + range: [9, 12], + loc: { + start: { line: 1, column: 9 }, + end: { line: 1, column: 12 } + }, + type: "Identifier", + name: "one" + }, + value: { + range: [14, 27], + loc: { + start: { line: 1, column: 14 }, + end: { line: 1, column: 27 } + }, + type: "FunctionExpression", + id: null, + params: [], + defaults: [], + body: { + range: [25, 27], + loc: { + start: { line: 1, column: 25 }, + end: { line: 1, column: 27 } + }, + type: "BlockStatement", + body: [] + }, + rest: null, + generator: false, + expression: false + }, + kind: "init", + method: false, + shorthand: false + }, { + range: [28, 33], + loc: { + start: { line: 1, column: 28 }, + end: { line: 1, column: 33 } + }, + type: "Property", + key: { + range: [28, 31], + loc: { + start: { line: 1, column: 28 }, + end: { line: 1, column: 31 } + }, + type: "Identifier", + name: "two" + }, + value: { + range: [32, 33], + loc: { + start: { line: 1, column: 32 }, + end: { line: 1, column: 33 } + }, + type: "Literal", + value: 2, + raw: "2" + }, + kind: "init", + method: false, + shorthand: false + }] } - }] - } + }], + kind: "var" + }], + tokens: [{ + type: "Keyword", + value: "var", + range: [0, 3], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 3 } + } + }, { + type: "Identifier", + value: "o", + range: [4, 5], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 5 } + } + }, { + type: "Punctuator", + value: "=", + range: [6, 7], + loc: { + start: { line: 1, column: 6 }, + end: { line: 1, column: 7 } + } + }, { + type: "Punctuator", + value: "{", + range: [8, 9], + loc: { + start: { line: 1, column: 8 }, + end: { line: 1, column: 9 } + } + }, { + type: "Identifier", + value: "one", + range: [9, 12], + loc: { + start: { line: 1, column: 9 }, + end: { line: 1, column: 12 } + } + }, { + type: "Punctuator", + value: ":", + range: [12, 13], + loc: { + start: { line: 1, column: 12 }, + end: { line: 1, column: 13 } + } + }, { + type: "Keyword", + value: "function", + range: [14, 22], + loc: { + start: { line: 1, column: 14 }, + end: { line: 1, column: 22 } + } + }, { + type: "Punctuator", + value: "(", + range: [22, 23], + loc: { + start: { line: 1, column: 22 }, + end: { line: 1, column: 23 } + } + }, { + type: "Punctuator", + value: ")", + range: [23, 24], + loc: { + start: { line: 1, column: 23 }, + end: { line: 1, column: 24 } + } + }, { + type: "Punctuator", + value: "{", + range: [25, 26], + loc: { + start: { line: 1, column: 25 }, + end: { line: 1, column: 26 } + } + }, { + type: "Punctuator", + value: "}", + range: [26, 27], + loc: { + start: { line: 1, column: 26 }, + end: { line: 1, column: 27 } + } + }, { + type: "Identifier", + value: "two", + range: [28, 31], + loc: { + start: { line: 1, column: 28 }, + end: { line: 1, column: 31 } + } + }, { + type: "Punctuator", + value: ":", + range: [31, 32], + loc: { + start: { line: 1, column: 31 }, + end: { line: 1, column: 32 } + } + }, { + type: "Numeric", + value: "2", + range: [32, 33], + loc: { + start: { line: 1, column: 32 }, + end: { line: 1, column: 33 } + } + }, { + type: "Punctuator", + value: "}", + range: [33, 34], + loc: { + start: { line: 1, column: 33 }, + end: { line: 1, column: 34 } + } + }, { + type: "Punctuator", + value: ";", + range: [34, 35], + loc: { + start: { line: 1, column: 34 }, + end: { line: 1, column: 35 } + } + }], + errors: [{ + index: 28, + lineNumber: 1, + column: 29, + message: "Error: Line 1: Unexpected token two" + }] }, - 'parse(undefined)': { - call: 'parse', - args: [void 0], - result: { - type: 'Program', - body: [{ - type: 'ExpressionStatement', - expression: { - type: 'Identifier', - name: 'undefined' + /** successive recovery - missing comma*/ + 'var o = {one: function() {} two:2 three: 3};': { + range: [0, 44], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 44 } + }, + type: "Program", + body: [{ + range: [0, 44], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 44 } + }, + type: "VariableDeclaration", + declarations: [{ + range: [4, 43], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 43 } + }, + type: "VariableDeclarator", + id: { + range: [4, 5], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 5 } + }, + type: "Identifier", + name: "o" + }, + init: { + range: [8, 43], + loc: { + start: { line: 1, column: 8 }, + end: { line: 1, column: 43 } + }, + type: "ObjectExpression", + properties: [{ + range: [9, 27], + loc: { + start: { line: 1, column: 9 }, + end: { line: 1, column: 27 } + }, + type: "Property", + key: { + range: [9, 12], + loc: { + start: { line: 1, column: 9 }, + end: { line: 1, column: 12 } + }, + type: "Identifier", + name: "one" + }, + value: { + range: [14, 27], + loc: { + start: { line: 1, column: 14 }, + end: { line: 1, column: 27 } + }, + type: "FunctionExpression", + id: null, + params: [], + defaults: [], + body: { + range: [25, 27], + loc: { + start: { line: 1, column: 25 }, + end: { line: 1, column: 27 } + }, + type: "BlockStatement", + body: [] + }, + rest: null, + generator: false, + expression: false + }, + kind: "init", + method: false, + shorthand: false + }, { + range: [28, 33], + loc: { + start: { line: 1, column: 28 }, + end: { line: 1, column: 33 } + }, + type: "Property", + key: { + range: [28, 31], + loc: { + start: { line: 1, column: 28 }, + end: { line: 1, column: 31 } + }, + type: "Identifier", + name: "two" + }, + value: { + range: [32, 33], + loc: { + start: { line: 1, column: 32 }, + end: { line: 1, column: 33 } + }, + type: "Literal", + value: 2, + raw: "2" + }, + kind: "init", + method: false, + shorthand: false + }, { + range: [34, 42], + loc: { + start: { line: 1, column: 34 }, + end: { line: 1, column: 42 } + }, + type: "Property", + key: { + range: [34, 39], + loc: { + start: { line: 1, column: 34 }, + end: { line: 1, column: 39 } + }, + type: "Identifier", + name: "three" + }, + value: { + range: [41, 42], + loc: { + start: { line: 1, column: 41 }, + end: { line: 1, column: 42 } + }, + type: "Literal", + value: 3, + raw: "3" + }, + kind: "init", + method: false, + shorthand: false + }] } - }] - } + }], + kind: "var" + }], + errors: [{ + index: 28, + lineNumber: 1, + column: 29, + message: "Error: Line 1: Unexpected token two" + }, { + index: 34, + lineNumber: 1, + column: 35, + message: "Error: Line 1: Unexpected token three" + }] }, - 'parse(new String("test"))': { - call: 'parse', - args: [new String('test')], - result: { - type: 'Program', - body: [{ - type: 'ExpressionStatement', - expression: { - type: 'Identifier', - name: 'test' + /** mixed recovery - missing comma */ + 'var o = {one: function() {} two:2, three: 3 "four":4};': { + range: [0, 54], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 54 } + }, + type: "Program", + body: [{ + range: [0, 54], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 54 } + }, + type: "VariableDeclaration", + declarations: [{ + range: [4, 53], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 53 } + }, + type: "VariableDeclarator", + id: { + range: [4, 5], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 5 } + }, + type: "Identifier", + name: "o" + }, + init: { + range: [8, 53], + loc: { + start: { line: 1, column: 8 }, + end: { line: 1, column: 53 } + }, + type: "ObjectExpression", + properties: [{ + range: [9, 27], + loc: { + start: { line: 1, column: 9 }, + end: { line: 1, column: 27 } + }, + type: "Property", + key: { + range: [9, 12], + loc: { + start: { line: 1, column: 9 }, + end: { line: 1, column: 12 } + }, + type: "Identifier", + name: "one" + }, + value: { + range: [14, 27], + loc: { + start: { line: 1, column: 14 }, + end: { line: 1, column: 27 } + }, + type: "FunctionExpression", + id: null, + params: [], + defaults: [], + body: { + range: [25, 27], + loc: { + start: { line: 1, column: 25 }, + end: { line: 1, column: 27 } + }, + type: "BlockStatement", + body: [] + }, + rest: null, + generator: false, + expression: false + }, + kind: "init", + method: false, + shorthand: false + }, { + range: [28, 33], + loc: { + start: { line: 1, column: 28 }, + end: { line: 1, column: 33 } + }, + type: "Property", + key: { + range: [28, 31], + loc: { + start: { line: 1, column: 28 }, + end: { line: 1, column: 31 } + }, + type: "Identifier", + name: "two" + }, + value: { + range: [32, 33], + loc: { + start: { line: 1, column: 32 }, + end: { line: 1, column: 33 } + }, + type: "Literal", + value: 2, + raw: "2" + }, + kind: "init", + method: false, + shorthand: false + }, { + range: [35, 43], + loc: { + start: { line: 1, column: 35 }, + end: { line: 1, column: 43 } + }, + type: "Property", + key: { + range: [35, 40], + loc: { + start: { line: 1, column: 35 }, + end: { line: 1, column: 40 } + }, + type: "Identifier", + name: "three" + }, + value: { + range: [42, 43], + loc: { + start: { line: 1, column: 42 }, + end: { line: 1, column: 43 } + }, + type: "Literal", + value: 3, + raw: "3" + }, + kind: "init", + method: false, + shorthand: false + }, { + range: [44, 52], + loc: { + start: { line: 1, column: 44 }, + end: { line: 1, column: 52 } + }, + type: "Property", + key: { + range: [44, 50], + loc: { + start: { line: 1, column: 44 }, + end: { line: 1, column: 50 } + }, + type: "Literal", + value: "four", + raw: "\"four\"" + }, + value: { + range: [51, 52], + loc: { + start: { line: 1, column: 51 }, + end: { line: 1, column: 52 } + }, + type: "Literal", + value: 4, + raw: "4" + }, + kind: "init", + method: false, + shorthand: false + }] } - }] - } + }], + kind: "var" + }], + errors: [{ + index: 28, + lineNumber: 1, + column: 29, + message: "Error: Line 1: Unexpected token two" + }, { + index: 44, + lineNumber: 1, + column: 45, + message: "Error: Line 1: Unexpected token four" + }] }, - 'parse(new Number(42))': { - call: 'parse', - args: [new Number(42)], - result: { - type: 'Program', - body: [{ - type: 'ExpressionStatement', - expression: { - type: 'Literal', - value: 42 + /** nested recovery - missing comma */ + 'var o = {one: function() {} two:2, three: {aa: "a" bb: "b"} four: 4};': { + range: [0, 69], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 69 } + }, + type: "Program", + body: [{ + range: [0, 69], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 69 } + }, + type: "VariableDeclaration", + declarations: [{ + range: [4, 68], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 68 } + }, + type: "VariableDeclarator", + id: { + range: [4, 5], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 5 } + }, + type: "Identifier", + name: "o" + }, + init: { + range: [8, 68], + loc: { + start: { line: 1, column: 8 }, + end: { line: 1, column: 68 } + }, + type: "ObjectExpression", + properties: [{ + range: [9, 27], + loc: { + start: { line: 1, column: 9 }, + end: { line: 1, column: 27 } + }, + type: "Property", + key: { + range: [9, 12], + loc: { + start: { line: 1, column: 9 }, + end: { line: 1, column: 12 } + }, + type: "Identifier", + name: "one" + }, + value: { + range: [14, 27], + loc: { + start: { line: 1, column: 14 }, + end: { line: 1, column: 27 } + }, + type: "FunctionExpression", + id: null, + params: [], + defaults: [], + body: { + range: [25, 27], + loc: { + start: { line: 1, column: 25 }, + end: { line: 1, column: 27 } + }, + type: "BlockStatement", + body: [] + }, + rest: null, + generator: false, + expression: false + }, + kind: "init", + method: false, + shorthand: false + }, { + range: [28, 33], + loc: { + start: { line: 1, column: 28 }, + end: { line: 1, column: 33 } + }, + type: "Property", + key: { + range: [28, 31], + loc: { + start: { line: 1, column: 28 }, + end: { line: 1, column: 31 } + }, + type: "Identifier", + name: "two" + }, + value: { + range: [32, 33], + loc: { + start: { line: 1, column: 32 }, + end: { line: 1, column: 33 } + }, + type: "Literal", + value: 2, + raw: "2" + }, + kind: "init", + method: false, + shorthand: false + }, { + range: [35, 59], + loc: { + start: { line: 1, column: 35 }, + end: { line: 1, column: 59 } + }, + type: "Property", + key: { + range: [35, 40], + loc: { + start: { line: 1, column: 35 }, + end: { line: 1, column: 40 } + }, + type: "Identifier", + name: "three" + }, + value: { + range: [42, 59], + loc: { + start: { line: 1, column: 42 }, + end: { line: 1, column: 59 } + }, + type: "ObjectExpression", + properties: [{ + range: [43, 50], + loc: { + start: { line: 1, column: 43 }, + end: { line: 1, column: 50 } + }, + type: "Property", + key: { + range: [43, 45], + loc: { + start: { line: 1, column: 43 }, + end: { line: 1, column: 45 } + }, + type: "Identifier", + name: "aa" + }, + value: { + range: [47, 50], + loc: { + start: { line: 1, column: 47 }, + end: { line: 1, column: 50 } + }, + type: "Literal", + value: "a", + raw: "\"a\"" + }, + kind: "init", + method: false, + shorthand: false + }, { + range: [51, 58], + loc: { + start: { line: 1, column: 51 }, + end: { line: 1, column: 58 } + }, + type: "Property", + key: { + range: [51, 53], + loc: { + start: { line: 1, column: 51 }, + end: { line: 1, column: 53 } + }, + type: "Identifier", + name: "bb" + }, + value: { + range: [55, 58], + loc: { + start: { line: 1, column: 55 }, + end: { line: 1, column: 58 } + }, + type: "Literal", + value: "b", + raw: "\"b\"" + }, + kind: "init", + method: false, + shorthand: false + }] + }, + kind: "init", + method: false, + shorthand: false + }, { + range: [60, 67], + loc: { + start: { line: 1, column: 60 }, + end: { line: 1, column: 67 } + }, + type: "Property", + key: { + range: [60, 64], + loc: { + start: { line: 1, column: 60 }, + end: { line: 1, column: 64 } + }, + type: "Identifier", + name: "four" + }, + value: { + range: [66, 67], + loc: { + start: { line: 1, column: 66 }, + end: { line: 1, column: 67 } + }, + type: "Literal", + value: 4, + raw: "4" + }, + kind: "init", + method: false, + shorthand: false + }] } - }] - } + }], + kind: "var" + }], + errors: [{ + index: 28, + lineNumber: 1, + column: 29, + message: "Error: Line 1: Unexpected token two" + }, { + index: 51, + lineNumber: 1, + column: 52, + message: "Error: Line 1: Unexpected token bb" + }, { + index: 60, + lineNumber: 1, + column: 61, + message: "Error: Line 1: Unexpected token four" + }] }, - 'parse(new Boolean(true))': { - call: 'parse', - args: [new Boolean(true)], - result: { - type: 'Program', - body: [{ - type: 'ExpressionStatement', - expression: { - type: 'Literal', - value: true + 'x = { y: z; }': { + range: [0, 13], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 13 } + }, + type: "Program", + body: [{ + range: [0, 13], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 13 } + }, + type: "ExpressionStatement", + expression: { + range: [0, 13], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 13 } + }, + type: "AssignmentExpression", + operator: "=", + left: { + range: [0, 1], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 1 } + }, + type: "Identifier", + name: "x" + }, + right: { + range: [4, 13], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 13 } + }, + type: "ObjectExpression", + properties: [{ + range: [6, 10], + loc: { + start: { line: 1, column: 6 }, + end: { line: 1, column: 10 } + }, + type: "Property", + key: { + range: [6, 7], + loc: { + start: { line: 1, column: 6 }, + end: { line: 1, column: 7 } + }, + type: "Identifier", + name: "y" + }, + value: { + range: [9, 10], + loc: { + start: { line: 1, column: 9 }, + end: { line: 1, column: 10 } + }, + type: "Identifier", + name: "z" + }, + kind: "init", + method: false, + shorthand: false + }] } - }] - } + } + }], + errors: [{ + index: 10, + lineNumber: 1, + column: 11, + message: "Error: Line 1: Unexpected token ;" + }] }, - 'Syntax': { - property: 'Syntax', - result: { - AssignmentExpression: 'AssignmentExpression', - ArrayExpression: 'ArrayExpression', - BlockStatement: 'BlockStatement', - BinaryExpression: 'BinaryExpression', - BreakStatement: 'BreakStatement', - CallExpression: 'CallExpression', - CatchClause: 'CatchClause', - ConditionalExpression: 'ConditionalExpression', - ContinueStatement: 'ContinueStatement', - DoWhileStatement: 'DoWhileStatement', - DebuggerStatement: 'DebuggerStatement', - EmptyStatement: 'EmptyStatement', - ExpressionStatement: 'ExpressionStatement', - ForStatement: 'ForStatement', - ForInStatement: 'ForInStatement', - FunctionDeclaration: 'FunctionDeclaration', - FunctionExpression: 'FunctionExpression', - Identifier: 'Identifier', - IfStatement: 'IfStatement', - Literal: 'Literal', - LabeledStatement: 'LabeledStatement', - LogicalExpression: 'LogicalExpression', - MemberExpression: 'MemberExpression', - NewExpression: 'NewExpression', - ObjectExpression: 'ObjectExpression', - Program: 'Program', - Property: 'Property', - ReturnStatement: 'ReturnStatement', - SequenceExpression: 'SequenceExpression', - SwitchStatement: 'SwitchStatement', - SwitchCase: 'SwitchCase', - ThisExpression: 'ThisExpression', - ThrowStatement: 'ThrowStatement', - TryStatement: 'TryStatement', - UnaryExpression: 'UnaryExpression', - UpdateExpression: 'UpdateExpression', - VariableDeclaration: 'VariableDeclaration', - VariableDeclarator: 'VariableDeclarator', - WhileStatement: 'WhileStatement', - WithStatement: 'WithStatement' - } - } - - }, - - 'Tolerant parse': { 'return': { type: 'Program', body: [{ @@ -18162,6 +27784,8 @@ var testFixture = { } }, kind: 'init', + method: false, + shorthand: false, range: [16, 19], loc: { start: { line: 1, column: 16 }, @@ -18189,6 +27813,8 @@ var testFixture = { } }, kind: 'init', + method: false, + shorthand: false, range: [20, 23], loc: { start: { line: 1, column: 20 }, @@ -19215,6 +28841,8 @@ var testFixture = { } }, kind: 'set', + method: false, + shorthand: false, range: [20, 34], loc: { start: { line: 1, column: 20 }, @@ -19439,6 +29067,8 @@ var testFixture = { } }, kind: 'init', + method: false, + shorthand: false, range: [24, 30], loc: { start: { line: 1, column: 24 }, @@ -19546,6 +29176,8 @@ var testFixture = { } }, kind: 'get', + method: false, + shorthand: false, range: [24, 34], loc: { start: { line: 1, column: 24 }, @@ -19586,6 +29218,8 @@ var testFixture = { } }, kind: 'get', + method: false, + shorthand: false, range: [36, 46], loc: { start: { line: 1, column: 36 }, @@ -19680,6 +29314,8 @@ var testFixture = { } }, kind: 'init', + method: false, + shorthand: false, range: [24, 29], loc: { start: { line: 1, column: 24 }, @@ -19720,6 +29356,8 @@ var testFixture = { } }, kind: 'get', + method: false, + shorthand: false, range: [31, 41], loc: { start: { line: 1, column: 31 }, @@ -19835,6 +29473,8 @@ var testFixture = { } }, kind: 'set', + method: false, + shorthand: false, range: [24, 35], loc: { start: { line: 1, column: 24 }, @@ -19862,6 +29502,8 @@ var testFixture = { } }, kind: 'init', + method: false, + shorthand: false, range: [37, 42], loc: { start: { line: 1, column: 37 }, @@ -19943,6 +29585,8 @@ var testFixture = { } }, kind: 'set', + method: false, + shorthand: false, range: [3, 14], loc: { start: { line: 1, column: 3 }, @@ -20230,9 +29874,122 @@ var testFixture = { column: 7, message: 'Error: Line 1: Invalid left-hand side in for-in' }] - } + }, + + 'var x = /[P QR]/\\g': { + type: "Program", + body: [{ + type: "VariableDeclaration", + declarations: [{ + type: "VariableDeclarator", + id: { + type: "Identifier", + name: "x", + range: [4, 5], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 5 } + } + }, + init: { + type: "Literal", + value: "/[P QR]/g", + raw: "/[P QR]/\\g", + regex: { + pattern: "[P QR]", + flags: "g" + }, + range: [8, 18], + loc: { + start: { line: 1, column: 8 }, + end: { line: 1, column: 18 } + } + }, + range: [4, 18], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 18 } + } + }], + kind: "var", + range: [0, 18], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 18 } + } + }], + range: [0, 18], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 18 } + }, + errors: [{ + index: 17, + lineNumber: 1, + column: 18, + message: "Error: Line 1: Unexpected token ILLEGAL" + }] + }, + 'var x = /[P QR]/\\\\u0067': { + type: "Program", + body: [{ + type: "VariableDeclaration", + declarations: [{ + type: "VariableDeclarator", + id: { + type: "Identifier", + name: "x", + range: [4, 5], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 5 } + } + }, + init: { + type: "Literal", + value: "/[P QR]/g", + raw: "/[P QR]/\\\\u0067", + regex: { + pattern: "[P QR]", + flags: "g" + }, + range: [8, 23], + loc: { + start: { line: 1, column: 8 }, + end: { line: 1, column: 23 } + } + }, + range: [4, 23], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 23 } + } + }], + kind: "var", + range: [0, 23], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 23 } + } + }], + range: [0, 23], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 23 } + }, + errors: [{ + index: 17, + lineNumber: 1, + column: 18, + message: "Error: Line 1: Unexpected token ILLEGAL" + }, { + index: 23, + lineNumber: 1, + column: 24, + message: "Error: Line 1: Unexpected token ILLEGAL" + }] + } } }; - diff --git a/node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/package.json b/node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/package.json index 227052c..58d859e 100644 --- a/node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/package.json +++ b/node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/package.json @@ -1,6 +1,6 @@ { "name": "js-yaml", - "version": "3.0.2", + "version": "3.2.7", "description": "YAML 1.2 parser and serializer", "keywords": [ "yaml", @@ -46,25 +46,23 @@ "js-yaml": "bin/js-yaml.js" }, "dependencies": { - "argparse": "~ 0.1.11", - "esprima": "~ 1.0.2" + "argparse": "~ 1.0.0", + "esprima": "~ 2.0.0" }, "devDependencies": { + "ansi": "*", + "benchmark": "*", "mocha": "*" }, "browser": { - "./index.js": "./index_browser.js", "buffer": false }, - "_id": "js-yaml@3.0.2", - "dist": { - "shasum": "9937865f8e897a5e894e73c2c5cf2e89b32eb771", - "tarball": "http://registry.npmjs.org/js-yaml/-/js-yaml-3.0.2.tgz" - }, - "_from": "js-yaml@~3.0.1", - "_resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.0.2.tgz", + "gitHead": "2321c0b9d1e25f9b8e6202744bc601a4998fe27f", + "_id": "js-yaml@3.2.7", "scripts": {}, - "_npmVersion": "1.4.3", + "_shasum": "102790f265d986fe95a4d0f2a792e7a7bd886eec", + "_from": "js-yaml@^3.1.0", + "_npmVersion": "1.4.28", "_npmUser": { "name": "vitaly", "email": "vitaly@rcdesign.ru" @@ -75,7 +73,10 @@ "email": "vitaly@rcdesign.ru" } ], + "dist": { + "shasum": "102790f265d986fe95a4d0f2a792e7a7bd886eec", + "tarball": "http://registry.npmjs.org/js-yaml/-/js-yaml-3.2.7.tgz" + }, "directories": {}, - "_shasum": "9937865f8e897a5e894e73c2c5cf2e89b32eb771", - "readme": "ERROR: No README data found!" + "_resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.2.7.tgz" } diff --git a/node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/object-assign/index.js b/node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/object-assign/index.js new file mode 100644 index 0000000..438b80a --- /dev/null +++ b/node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/object-assign/index.js @@ -0,0 +1,26 @@ +'use strict'; + +function ToObject(val) { + if (val == null) { + throw new TypeError('Object.assign cannot be called with null or undefined'); + } + + return Object(val); +} + +module.exports = Object.assign || function (target, source) { + var from; + var keys; + var to = ToObject(target); + + for (var s = 1; s < arguments.length; s++) { + from = arguments[s]; + keys = Object.keys(Object(from)); + + for (var i = 0; i < keys.length; i++) { + to[keys[i]] = from[keys[i]]; + } + } + + return to; +}; diff --git a/node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/object-assign/object-assign.js b/node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/object-assign/object-assign.js deleted file mode 100644 index ee5c228..0000000 --- a/node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/object-assign/object-assign.js +++ /dev/null @@ -1,52 +0,0 @@ -/*! - object-assign - ES6 Object.assign() ponyfill - https://github.com/sindresorhus/object-assign - by Sindre Sorhus - MIT License -*/ -(function () { - 'use strict'; - - var ToObject = function (val) { - if (val == null) { - throw new TypeError('Object.assign cannot be called with null or undefined'); - } - - return Object(val); - } - - var objectAssign = Object.assign || function (target, source) { - var pendingException; - var from; - var keys; - var to = ToObject(target); - - for (var s = 1; s < arguments.length; s++) { - from = ToObject(arguments[s]); - keys = Object.keys(from) - - for (var i = 0; i < keys.length; i++) { - try { - to[keys[i]] = from[keys[i]]; - } catch (err) { - if (pendingException === undefined) { - pendingException = err; - } - } - } - } - - if (pendingException) { - throw pendingException; - } - - return to; - }; - - if (typeof module !== 'undefined' && module.exports) { - module.exports = objectAssign; - } else { - window.objectAssign = objectAssign; - } -})(); diff --git a/node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/object-assign/package.json b/node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/object-assign/package.json index d6bc8f0..1f6420f 100644 --- a/node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/object-assign/package.json +++ b/node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/object-assign/package.json @@ -1,12 +1,11 @@ { "name": "object-assign", - "version": "0.3.1", + "version": "2.0.0", "description": "ES6 Object.assign() ponyfill", "license": "MIT", - "main": "object-assign.js", "repository": { "type": "git", - "url": "git://github.com/sindresorhus/object-assign" + "url": "https://github.com/sindresorhus/object-assign" }, "author": { "name": "Sindre Sorhus", @@ -20,7 +19,7 @@ "test": "mocha" }, "files": [ - "object-assign.js" + "index.js" ], "keywords": [ "object", @@ -39,17 +38,16 @@ "devDependencies": { "mocha": "*" }, + "gitHead": "4cd0365f5a78dd369473ca0bbd31f7b234148c42", "bugs": { "url": "https://github.com/sindresorhus/object-assign/issues" }, "homepage": "https://github.com/sindresorhus/object-assign", - "_id": "object-assign@0.3.1", - "dist": { - "shasum": "060e2a2a27d7c0d77ec77b78f11aa47fd88008d2", - "tarball": "http://registry.npmjs.org/object-assign/-/object-assign-0.3.1.tgz" - }, - "_from": "object-assign@~0.3.1", - "_npmVersion": "1.4.6", + "_id": "object-assign@2.0.0", + "_shasum": "f8309b09083b01261ece3ef7373f2b57b8dd7042", + "_from": "object-assign@^2.0.0", + "_npmVersion": "2.1.5", + "_nodeVersion": "0.10.32", "_npmUser": { "name": "sindresorhus", "email": "sindresorhus@gmail.com" @@ -60,8 +58,11 @@ "email": "sindresorhus@gmail.com" } ], + "dist": { + "shasum": "f8309b09083b01261ece3ef7373f2b57b8dd7042", + "tarball": "http://registry.npmjs.org/object-assign/-/object-assign-2.0.0.tgz" + }, "directories": {}, - "_shasum": "060e2a2a27d7c0d77ec77b78f11aa47fd88008d2", - "_resolved": "https://registry.npmjs.org/object-assign/-/object-assign-0.3.1.tgz", + "_resolved": "https://registry.npmjs.org/object-assign/-/object-assign-2.0.0.tgz", "readme": "ERROR: No README data found!" } diff --git a/node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/object-assign/readme.md b/node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/object-assign/readme.md index a8b470b..aee51c1 100644 --- a/node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/object-assign/readme.md +++ b/node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/object-assign/readme.md @@ -11,24 +11,26 @@ $ npm install --save object-assign ``` -```sh -$ bower install --save object-assign -``` - -```sh -$ component install sindresorhus/object-assign -``` - ## Usage ```js +var objectAssign = require('object-assign'); + objectAssign({foo: 0}, {bar: 1}); //=> {foo: 0, bar: 1} // multiple sources -objectAssign({foo: 0}, {bar: 1}, {baz: 3}); +objectAssign({foo: 0}, {bar: 1}, {baz: 2}); //=> {foo: 0, bar: 1, baz: 2} + +// overwrites equal keys +objectAssign({foo: 0}, {foo: 1}, {foo: 2}); +//=> {foo: 2} + +// ignores null and undefined sources +objectAssign({foo: 0}, null, {bar: 1}, undefined); +//=> {foo: 0, bar: 1} ``` @@ -46,4 +48,4 @@ Assigns enumerable own properties of `source` objects to the `target` object and ## License -[MIT](http://opensource.org/licenses/MIT) © [Sindre Sorhus](http://sindresorhus.com) +MIT © [Sindre Sorhus](http://sindresorhus.com) diff --git a/node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/user-home/cli.js b/node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/user-home/cli.js new file mode 100755 index 0000000..bacbd22 --- /dev/null +++ b/node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/user-home/cli.js @@ -0,0 +1,26 @@ +#!/usr/bin/env node +'use strict'; +var pkg = require('./package.json'); +var userHome = require('./'); + +function help() { + console.log([ + pkg.description, + '', + 'Example', + ' $ user-home', + ' /Users/sindresorhus' + ].join('\n')); +} + +if (process.argv.indexOf('--help') !== -1) { + help(); + return; +} + +if (process.argv.indexOf('--version') !== -1) { + console.log(pkg.version); + return; +} + +process.stdout.write(userHome); diff --git a/node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/user-home/index.js b/node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/user-home/index.js new file mode 100644 index 0000000..d53b793 --- /dev/null +++ b/node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/user-home/index.js @@ -0,0 +1,15 @@ +'use strict'; +var env = process.env; +var home = env.HOME; +var user = env.LOGNAME || env.USER || env.LNAME || env.USERNAME; + +if (process.platform === 'win32') { + module.exports = env.USERPROFILE || env.HOMEDRIVE + env.HOMEPATH || home || null; +} else if (process.platform === 'darwin') { + module.exports = home || (user ? '/Users/' + user : null) || null; +} else if (process.platform === 'linux') { + module.exports = home || + (user ? (process.getuid() === 0 ? '/root' : '/home/' + user) : null) || null; +} else { + module.exports = home || null; +} diff --git a/node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/user-home/license b/node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/user-home/license new file mode 100644 index 0000000..654d0bf --- /dev/null +++ b/node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/user-home/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/node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/user-home/package.json b/node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/user-home/package.json new file mode 100644 index 0000000..27df42d --- /dev/null +++ b/node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/user-home/package.json @@ -0,0 +1,68 @@ +{ + "name": "user-home", + "version": "1.1.1", + "description": "Get the path to the user home directory", + "license": "MIT", + "repository": { + "type": "git", + "url": "https://github.com/sindresorhus/user-home" + }, + "bin": { + "user-home": "cli.js" + }, + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "http://sindresorhus.com" + }, + "engines": { + "node": ">=0.10.0" + }, + "scripts": { + "test": "node test.js" + }, + "files": [ + "index.js", + "cli.js" + ], + "keywords": [ + "cli", + "bin", + "user", + "home", + "homedir", + "dir", + "directory", + "folder", + "path" + ], + "devDependencies": { + "ava": "0.0.3" + }, + "gitHead": "cf6ba885d3e6bf625fb3c15ad0334fa623968481", + "bugs": { + "url": "https://github.com/sindresorhus/user-home/issues" + }, + "homepage": "https://github.com/sindresorhus/user-home", + "_id": "user-home@1.1.1", + "_shasum": "2b5be23a32b63a7c9deb8d0f28d485724a3df190", + "_from": "user-home@^1.0.0", + "_npmVersion": "2.1.16", + "_nodeVersion": "0.10.32", + "_npmUser": { + "name": "sindresorhus", + "email": "sindresorhus@gmail.com" + }, + "maintainers": [ + { + "name": "sindresorhus", + "email": "sindresorhus@gmail.com" + } + ], + "dist": { + "shasum": "2b5be23a32b63a7c9deb8d0f28d485724a3df190", + "tarball": "http://registry.npmjs.org/user-home/-/user-home-1.1.1.tgz" + }, + "directories": {}, + "_resolved": "https://registry.npmjs.org/user-home/-/user-home-1.1.1.tgz" +} diff --git a/node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/user-home/readme.md b/node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/user-home/readme.md new file mode 100644 index 0000000..5307a07 --- /dev/null +++ b/node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/user-home/readme.md @@ -0,0 +1,42 @@ +# user-home [![Build Status](https://travis-ci.org/sindresorhus/user-home.svg?branch=master)](https://travis-ci.org/sindresorhus/user-home) + +> Get the path to the user home directory + + +## Install + +```sh +$ npm install --save user-home +``` + + +## Usage + +```js +var userHome = require('user-home'); + +console.log(userHome); +//=> /Users/sindresorhus +``` + +Returns `null` in the unlikely scenario that the home directory can't be found. + + +## CLI + +```sh +$ npm install --global user-home +``` + +```sh +$ user-home --help + +Example + $ user-home + /Users/sindresorhus +``` + + +## License + +MIT © [Sindre Sorhus](http://sindresorhus.com) diff --git a/node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/uuid/benchmark/package.json b/node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/uuid/benchmark/package.json index aa1a421..94e0b59 100644 --- a/node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/uuid/benchmark/package.json +++ b/node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/uuid/benchmark/package.json @@ -3,7 +3,7 @@ "private": true, "description": "Benchmarks for node-uuid", "dependencies": { - "uuid": "^1.4.1", - "uuid-js": "^0.7.4" + "uuid": "1.4.1", + "uuid-js": "0.7.4" } } diff --git a/node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/uuid/buffer-browser.js b/node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/uuid/buffer-browser.js deleted file mode 100644 index f5a9358..0000000 --- a/node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/uuid/buffer-browser.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = Array; diff --git a/node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/uuid/buffer.js b/node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/uuid/buffer.js deleted file mode 100644 index 66c989c..0000000 --- a/node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/uuid/buffer.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = Buffer; diff --git a/node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/uuid/package.json b/node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/uuid/package.json index 58c1d74..1487ff7 100644 --- a/node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/uuid/package.json +++ b/node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/uuid/package.json @@ -1,6 +1,6 @@ { "name": "uuid", - "version": "1.4.2", + "version": "2.0.1", "description": "Rigorous implementation of RFC4122 (v1 and v4) UUIDs.", "keywords": [ "uuid", @@ -29,8 +29,7 @@ "test": "mocha test/test.js" }, "browser": { - "./rng.js": "./rng-browser.js", - "./buffer.js": "./buffer-browser.js" + "./rng.js": "./rng-browser.js" }, "repository": { "type": "git", @@ -46,14 +45,14 @@ "harness": "mocha-tdd", "files": "test/*.js" }, - "gitHead": "688730efe3ec3ab7c12c6b92db2aa2826a50ed14", + "gitHead": "ddaf90942095f26ee8c1961b4346f093b3e7eb5b", "bugs": { "url": "https://github.com/shtylman/node-uuid/issues" }, "homepage": "https://github.com/shtylman/node-uuid", - "_id": "uuid@1.4.2", - "_shasum": "453019f686966a6df83cdc5244e7c990ecc332fc", - "_from": "uuid@~1.4.1", + "_id": "uuid@2.0.1", + "_shasum": "c2a30dedb3e535d72ccf82e343941a50ba8533ac", + "_from": "uuid@^2.0.1", "_npmVersion": "2.0.0", "_npmUser": { "name": "vvo", @@ -78,9 +77,9 @@ } ], "dist": { - "shasum": "453019f686966a6df83cdc5244e7c990ecc332fc", - "tarball": "http://registry.npmjs.org/uuid/-/uuid-1.4.2.tgz" + "shasum": "c2a30dedb3e535d72ccf82e343941a50ba8533ac", + "tarball": "http://registry.npmjs.org/uuid/-/uuid-2.0.1.tgz" }, "directories": {}, - "_resolved": "https://registry.npmjs.org/uuid/-/uuid-1.4.2.tgz" + "_resolved": "https://registry.npmjs.org/uuid/-/uuid-2.0.1.tgz" } diff --git a/node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/uuid/uuid.js b/node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/uuid/uuid.js index f037bd4..be5bfed 100644 --- a/node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/uuid/uuid.js +++ b/node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/uuid/uuid.js @@ -8,11 +8,6 @@ // returns 128-bits of randomness, since that's what's usually required var _rng = require('./rng'); -// Buffer class to use, -// we can't use `Buffer || Array` otherwise Buffer would be -// shimmed by browserify and added to the browser build -var BufferClass = require('./buffer'); - // Maps for number <-> hex string conversion var _byteToHex = []; var _hexToByte = {}; @@ -157,7 +152,7 @@ function v4(options, buf, offset) { var i = buf && offset || 0; if (typeof(options) == 'string') { - buf = options == 'binary' ? new BufferClass(16) : null; + buf = options == 'binary' ? new Array(16) : null; options = null; } options = options || {}; @@ -184,6 +179,5 @@ uuid.v1 = v1; uuid.v4 = v4; uuid.parse = parse; uuid.unparse = unparse; -uuid.BufferClass = BufferClass; module.exports = uuid; diff --git a/node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/xdg-basedir/index.js b/node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/xdg-basedir/index.js new file mode 100644 index 0000000..cb06b28 --- /dev/null +++ b/node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/xdg-basedir/index.js @@ -0,0 +1,26 @@ +'use strict'; +var path = require('path'); +var userHome = require('user-home'); +var env = process.env; + +exports.data = env.XDG_DATA_HOME || + (userHome ? path.join(userHome, '.local', 'share') : null); + +exports.config = env.XDG_CONFIG_HOME || + (userHome ? path.join(userHome, '.config') : null); + +exports.cache = env.XDG_CONFIG_HOME || (userHome ? path.join(userHome, '.cache') : null); + +exports.runtime = env.XDG_RUNTIME_DIR || null; + +exports.dataDirs = (env.XDG_DATA_DIRS || '/usr/local/share/:/usr/share/').split(':'); + +if (exports.data) { + exports.dataDirs.unshift(exports.data); +} + +exports.configDirs = (env.XDG_CONFIG_DIRS || '/etc/xdg').split(':'); + +if (exports.config) { + exports.configDirs.unshift(exports.config); +} diff --git a/node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/xdg-basedir/license b/node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/xdg-basedir/license new file mode 100644 index 0000000..654d0bf --- /dev/null +++ b/node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/xdg-basedir/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/node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/xdg-basedir/package.json b/node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/xdg-basedir/package.json new file mode 100644 index 0000000..78be3d1 --- /dev/null +++ b/node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/xdg-basedir/package.json @@ -0,0 +1,68 @@ +{ + "name": "xdg-basedir", + "version": "1.0.1", + "description": "Get XDG Base Directory paths", + "license": "MIT", + "repository": { + "type": "git", + "url": "https://github.com/sindresorhus/xdg-basedir" + }, + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "http://sindresorhus.com" + }, + "engines": { + "node": ">=0.10.0" + }, + "scripts": { + "test": "node test.js" + }, + "files": [ + "index.js" + ], + "keywords": [ + "xdg", + "base", + "directory", + "dir", + "basedir", + "path", + "data", + "config", + "cache" + ], + "dependencies": { + "user-home": "^1.0.0" + }, + "devDependencies": { + "ava": "0.0.4", + "require-uncached": "^1.0.2" + }, + "gitHead": "2eaf176e5d0c9c1bd64e6fc8a60a3a8e3dba4e79", + "bugs": { + "url": "https://github.com/sindresorhus/xdg-basedir/issues" + }, + "homepage": "https://github.com/sindresorhus/xdg-basedir", + "_id": "xdg-basedir@1.0.1", + "_shasum": "14ff8f63a4fdbcb05d5b6eea22b36f3033b9f04e", + "_from": "xdg-basedir@^1.0.0", + "_npmVersion": "2.1.16", + "_nodeVersion": "0.10.32", + "_npmUser": { + "name": "sindresorhus", + "email": "sindresorhus@gmail.com" + }, + "maintainers": [ + { + "name": "sindresorhus", + "email": "sindresorhus@gmail.com" + } + ], + "dist": { + "shasum": "14ff8f63a4fdbcb05d5b6eea22b36f3033b9f04e", + "tarball": "http://registry.npmjs.org/xdg-basedir/-/xdg-basedir-1.0.1.tgz" + }, + "directories": {}, + "_resolved": "https://registry.npmjs.org/xdg-basedir/-/xdg-basedir-1.0.1.tgz" +} diff --git a/node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/xdg-basedir/readme.md b/node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/xdg-basedir/readme.md new file mode 100644 index 0000000..af3a8ba --- /dev/null +++ b/node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/xdg-basedir/readme.md @@ -0,0 +1,60 @@ +# xdg-basedir [![Build Status](https://travis-ci.org/sindresorhus/xdg-basedir.svg?branch=master)](https://travis-ci.org/sindresorhus/xdg-basedir) + +> Get [XDG Base Directory](http://standards.freedesktop.org/basedir-spec/basedir-spec-latest.html) paths + + +## Install + +```sh +$ npm install --save xdg-basedir +``` + + +## Usage + +```js +var xdgBasedir = require('xdg-basedir'); + +xdgBasedir.data; +//=> /home/sindresorhus/.local/share + +xdgBasedir.config; +//=> /home/sindresorhus/.config + +xdgBasedir.dataDirs +//=> ['/home/sindresorhus/.local/share', '/usr/local/share/', '/usr/share/'] +``` + + +## API + +The properties `.data`, `.config`, `.cache`, `.runtime` will return `null` in the uncommon case that both the XDG environment variable is not set and the users home directory can't be found. You need to handle this case. A common solution is to [fall back to a temp directory](https://github.com/yeoman/configstore/blob/b82690fc401318ad18dcd7d151a0003a4898a314/index.js#L15). + +### .data + +Directory for user specific data files. + +### .config + +Directory for user specific configuration files. + +### .cache + +Directory for user specific non-essential data files. + +### .runtime + +Directory for user-specific non-essential runtime files and other file objects (such as sockets, named pipes, etc). + +### .dataDirs + +Preference-ordered array of base directories to search for data files in addition to `.data`. + +### .configDirs + +Preference-ordered array of base directories to search for configuration files in addition to `.config`. + + +## License + +MIT © [Sindre Sorhus](http://sindresorhus.com) diff --git a/node_modules/bower/node_modules/insight/node_modules/configstore/package.json b/node_modules/bower/node_modules/insight/node_modules/configstore/package.json index 24ff9d0..3a6eda3 100644 --- a/node_modules/bower/node_modules/insight/node_modules/configstore/package.json +++ b/node_modules/bower/node_modules/insight/node_modules/configstore/package.json @@ -1,6 +1,6 @@ { "name": "configstore", - "version": "0.3.1", + "version": "0.3.2", "description": "Easily load and save config without having to think about where and how", "keywords": [ "conf", @@ -17,10 +17,9 @@ "email": "sindresorhus@gmail.com", "url": "http://sindresorhus.com" }, - "main": "configstore.js", "repository": { "type": "git", - "url": "git://github.com/yeoman/configstore" + "url": "https://github.com/yeoman/configstore" }, "scripts": { "test": "mocha" @@ -30,30 +29,33 @@ }, "license": "BSD", "dependencies": { - "graceful-fs": "~3.0.1", - "js-yaml": "~3.0.1", - "mkdirp": "~0.5.0", - "object-assign": "~0.3.1", - "osenv": "~0.1.0", - "uuid": "~1.4.1" + "graceful-fs": "^3.0.1", + "js-yaml": "^3.1.0", + "mkdirp": "^0.5.0", + "object-assign": "^2.0.0", + "osenv": "^0.1.0", + "user-home": "^1.0.0", + "uuid": "^2.0.1", + "xdg-basedir": "^1.0.0" }, "devDependencies": { "mocha": "*" }, "files": [ - "configstore.js" + "index.js" ], + "gitHead": "b82690fc401318ad18dcd7d151a0003a4898a314", "bugs": { "url": "https://github.com/yeoman/configstore/issues" }, "homepage": "https://github.com/yeoman/configstore", - "_id": "configstore@0.3.1", - "_shasum": "e1b4715994fe5f8e22e69b21d54c7a448339314d", - "_from": "configstore@^0.3.1", - "_npmVersion": "1.4.9", + "_id": "configstore@0.3.2", + "_shasum": "25e4c16c3768abf75c5a65bc61761f495055b459", + "_from": "configstore@^0.3.0", + "_npmVersion": "1.4.23", "_npmUser": { - "name": "sindresorhus", - "email": "sindresorhus@gmail.com" + "name": "addyosmani", + "email": "addyosmani@gmail.com" }, "maintainers": [ { @@ -82,10 +84,9 @@ } ], "dist": { - "shasum": "e1b4715994fe5f8e22e69b21d54c7a448339314d", - "tarball": "http://registry.npmjs.org/configstore/-/configstore-0.3.1.tgz" + "shasum": "25e4c16c3768abf75c5a65bc61761f495055b459", + "tarball": "http://registry.npmjs.org/configstore/-/configstore-0.3.2.tgz" }, "directories": {}, - "_resolved": "https://registry.npmjs.org/configstore/-/configstore-0.3.1.tgz", - "readme": "ERROR: No README data found!" + "_resolved": "https://registry.npmjs.org/configstore/-/configstore-0.3.2.tgz" } diff --git a/node_modules/bower/node_modules/insight/node_modules/configstore/readme.md b/node_modules/bower/node_modules/insight/node_modules/configstore/readme.md index 1d94848..28005b7 100644 --- a/node_modules/bower/node_modules/insight/node_modules/configstore/readme.md +++ b/node_modules/bower/node_modules/insight/node_modules/configstore/readme.md @@ -1,11 +1,11 @@ # configstore [![Build Status](https://secure.travis-ci.org/yeoman/configstore.svg?branch=master)](http://travis-ci.org/yeoman/configstore) -Easily load and persist config without having to think about where and how. +> Easily load and persist config without having to think about where and how. Config is stored in a YAML file to make it simple for users to edit the config directly themselves. The file is located in `$XDG_CONFIG_HOME` or `~/.config`. Eg: `~/.config/configstore/id-of-your-choosing.yml` -## Example usage +## Usage ```js var Configstore = require('configstore'); diff --git a/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/.lint b/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/.lint index 937504b..d1da610 100644 --- a/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/.lint +++ b/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/.lint @@ -8,10 +8,16 @@ tabs ass continue +forin nomen plusplus +vars ./global.js +./function/_define-length.js +./function/#/copy.js +./object/unserialize.js +./test/function/valid-function.js evil ./math/_pack-ieee754.js @@ -22,18 +28,11 @@ evil ./string/#/at.js bitwise -./function/_define-length.js -./function/#/copy.js -evil - ./math/fround/shim.js predef+ Float32Array ./object/first-key.js forin -./test/function/valid-function.js -evil - ./test/reg-exp/#/index.js predef+ __dirname diff --git a/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/.travis.yml b/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/.travis.yml index 3dcd872..b98b5a8 100644 --- a/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/.travis.yml +++ b/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/.travis.yml @@ -10,3 +10,5 @@ before_install: notifications: email: - medikoo+es5-ext@medikoo.com + +script: "npm test && npm run lint" diff --git a/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/CHANGES b/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/CHANGES index d21f59a..e72d34a 100644 --- a/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/CHANGES +++ b/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/CHANGES @@ -1,3 +1,17 @@ +v0.10.6 -- 2015.02.02 +* Fix handling of infinite values in Math.trunc +* Fix handling of getters in Object.normalizeOptions + +v0.10.5 -- 2015.01.20 +* Add Function#toStringTokens +* Add Object.serialize and Object.unserialize +* Add String.randomUniq +* Fix Strin#camelToHyphen issue with tokens that end with digit +* Optimise Number.isInteger logic +* Improve documentation +* Configure lint scripts +* Fix spelling of LICENSE + v0.10.4 -- 2014.04.30 * Assure maximum spec compliance of Array.of and Array.from (thanks @mathiasbynens) * Improve documentations diff --git a/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/LICENCE b/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/LICENCE deleted file mode 100644 index 7b61dc1..0000000 --- a/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/LICENCE +++ /dev/null @@ -1,19 +0,0 @@ -Copyright (C) 2011 Mariusz Nowak (www.medikoo.com) - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/LICENSE b/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/LICENSE new file mode 100644 index 0000000..de39071 --- /dev/null +++ b/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/LICENSE @@ -0,0 +1,19 @@ +Copyright (C) 2011-2015 Mariusz Nowak (www.medikoo.com) + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/README.md b/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/README.md index 0341c33..11d8a34 100644 --- a/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/README.md +++ b/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/README.md @@ -114,9 +114,12 @@ Object.defineProperty(String.prototype, 'capitalize', { value: require('es5-ext/ configurable: true, enumerable: false, writable: true }); ``` -If you decide not to extend native prototypes, which in most cases is right decision (see -[extending-javascript-natives](http://javascriptweblog.wordpress.com/2011/12/05/extending-javascript-natives/) -for more views on that matter), you can use methods indirectly: +See [es5-extend](https://github.com/wookieb/es5-extend#es5-extend), a great utility that automatically will extend natives for you. + +__Important:__ Remember to __not__ extend natives in scope of generic reusable packages (e.g. ones you intend to publish to npm). Extending natives is fine __only__ if you're the _owner_ of the global scope, so e.g. in final project you lead development of. + +When you're in situation when native extensions are not good idea, then you should use methods indirectly: + ```javascript var flatten = require('es5-ext/array/#/flatten'); @@ -124,7 +127,7 @@ var flatten = require('es5-ext/array/#/flatten'); flatten.call([1, [2, [3, 4]]]); // [1, 2, 3, 4] ``` -or for better convenience turn methods into functions: +for better convenience you can turn methods into functions: ```javascript @@ -506,6 +509,10 @@ Returns a function that applies underlying function with first list argument _f.match()(args) =def f.apply(null, args)_ +#### fn.toStringTokens() _(es5-ext/function/#/to-string-tokens)_ + +Serializes function into two (arguments and body) string tokens. Result is plain object with `args` and `body` properties. + ### Math extensions #### acosh(x) _(es5-ext/math/acosh)_ @@ -754,17 +761,17 @@ Analogous to Array.prototype.map. Creates a new object with properties which val Create new object with same values, but remapped keys -#### mixin(target, source) +#### mixin(target, source) _(es5-ext/object/mixin)_ Extend _target_ by all own properties of other objects. Properties found in both objects will be overwritten (unless they're not configurable and cannot be overwritten). _It was for a moment part of ECMAScript 6 draft._ -#### mixinPrototypes(target, …source]) +#### mixinPrototypes(target, …source]) _(es5-ext/object/mixin-prototypes)_ Extends _target_, with all source and source's prototype properties. Useful as an alternative for `setPrototypeOf` in environments in which it cannot be shimmed (no `__proto__` support). -#### normalizeOptions(options) +#### normalizeOptions(options) _(es5-ext/object/normalize-options)_ Normalizes options object into flat plain object. @@ -774,14 +781,18 @@ Useful for functions in which we either need to keep options object for future r - `options` can be undefined in such case empty plain object is returned. - Copies all enumerable properties found down prototype chain. -#### primitiveSet([…names]) +#### primitiveSet([…names]) _(es5-ext/object/primitive-set)_ Creates `null` prototype based plain object, and sets on it all property names provided in arguments to true. -#### safeTraverse(obj[, …names]) +#### safeTraverse(obj[, …names]) _(es5-ext/object/safe-traverse)_ Safe navigation of object properties. See http://wiki.ecmascript.org/doku.php?id=strawman:existential_operator +#### serialize(value) _(es5-ext/object/serialize)_ + +Serialize value into string. Differs from [JSON.stringify](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/stringify) that it serializes also dates, functions and regular expresssions. + #### setPrototypeOf(object, proto) _(es5-ext/object/set-prototype-of)_ [_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-object.setprototypeof). @@ -798,6 +809,10 @@ Optionally _compareFn_ can be provided which assures that keys are tested in giv Creates an array of results of calling a provided function on every key-value pair in this object. Optionally _compareFn_ can be provided which assures that results are added in given order. If provided _compareFn_ is equal to `true`, then order is alphabetical (by key). +#### unserialize(str) _(es5-ext/object/unserialize)_ + +Userializes value previously serialized with [serialize](#serializevalue-es5-extobjectserialize) + #### validCallable(x) _(es5-ext/object/valid-callable)_ If given object is not callable throw TypeError in other case return it. @@ -878,6 +893,10 @@ Creates format method. It's used e.g. to create `Date.prototype.format` method Whether object is string +#### randomUniq() _(es5-ext/string/random-uniq)_ + +Returns randomly generated id, with guarantee of local uniqueness (no same id will be returned twice) + #### raw(callSite[, …substitutions]) _(es5-ext/string/raw)_ [_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-string.raw) diff --git a/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/array/#/e-index-of.js b/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/array/#/e-index-of.js index a7b1dda..80864d0 100644 --- a/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/array/#/e-index-of.js +++ b/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/array/#/e-index-of.js @@ -9,7 +9,7 @@ var toPosInt = require('../../number/to-pos-integer') module.exports = function (searchElement/*, fromIndex*/) { var i, l, fromIndex, val; - if (searchElement === searchElement) { //jslint: skip + if (searchElement === searchElement) { //jslint: ignore return indexOf.apply(this, arguments); } @@ -22,7 +22,7 @@ module.exports = function (searchElement/*, fromIndex*/) { for (i = fromIndex; i < l; ++i) { if (hasOwnProperty.call(this, i)) { val = this[i]; - if (val !== val) return i; //jslint: skip + if (val !== val) return i; //jslint: ignore } } return -1; diff --git a/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/array/#/e-last-index-of.js b/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/array/#/e-last-index-of.js index dfaf495..4fc536b 100644 --- a/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/array/#/e-last-index-of.js +++ b/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/array/#/e-last-index-of.js @@ -9,7 +9,7 @@ var toPosInt = require('../../number/to-pos-integer') module.exports = function (searchElement/*, fromIndex*/) { var i, fromIndex, val; - if (searchElement === searchElement) { //jslint: skip + if (searchElement === searchElement) { //jslint: ignore return lastIndexOf.apply(this, arguments); } @@ -22,7 +22,7 @@ module.exports = function (searchElement/*, fromIndex*/) { for (i = fromIndex; i >= 0; --i) { if (hasOwnProperty.call(this, i)) { val = this[i]; - if (val !== val) return i; //jslint: skip + if (val !== val) return i; //jslint: ignore } } return -1; diff --git a/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/array/from/shim.js b/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/array/from/shim.js index 58db5de..a90ba2f 100644 --- a/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/array/from/shim.js +++ b/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/array/from/shim.js @@ -14,7 +14,7 @@ var iteratorSymbol = require('es6-symbol').iterator module.exports = function (arrayLike/*, mapFn, thisArg*/) { var mapFn = arguments[1], thisArg = arguments[2], Constructor, i, j, arr, l, code, iterator - , result, getIterator, isPlain, value; + , result, getIterator, value; arrayLike = Object(validValue(arrayLike)); @@ -53,7 +53,7 @@ module.exports = function (arrayLike/*, mapFn, thisArg*/) { while (!result.done) { value = mapFn ? call.call(mapFn, thisArg, result.value, i) : result.value; if (!Constructor) { - arr[i] = value + arr[i] = value; } else { desc.value = value; defineProperty(arr, i, desc); @@ -74,7 +74,7 @@ module.exports = function (arrayLike/*, mapFn, thisArg*/) { } value = mapFn ? call.call(mapFn, thisArg, value, j) : value; if (!Constructor) { - arr[j] = value + arr[j] = value; } else { desc.value = value; defineProperty(arr, j, desc); @@ -91,7 +91,7 @@ module.exports = function (arrayLike/*, mapFn, thisArg*/) { for (i = 0; i < l; ++i) { value = mapFn ? call.call(mapFn, thisArg, arrayLike[i], i) : arrayLike[i]; if (!Constructor) { - arr[i] = value + arr[i] = value; } else { desc.value = value; defineProperty(arr, i, desc); diff --git a/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/function/#/index.js b/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/function/#/index.js index cbf383d..8d0da00 100644 --- a/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/function/#/index.js +++ b/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/function/#/index.js @@ -1,11 +1,12 @@ 'use strict'; module.exports = { - compose: require('./compose'), - copy: require('./copy'), - curry: require('./curry'), - lock: require('./lock'), - not: require('./not'), - partial: require('./partial'), - spread: require('./spread') + compose: require('./compose'), + copy: require('./copy'), + curry: require('./curry'), + lock: require('./lock'), + not: require('./not'), + partial: require('./partial'), + spread: require('./spread'), + toStringTokens: require('./to-string-tokens') }; diff --git a/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/function/#/to-string-tokens.js b/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/function/#/to-string-tokens.js new file mode 100644 index 0000000..67afeae --- /dev/null +++ b/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/function/#/to-string-tokens.js @@ -0,0 +1,11 @@ +'use strict'; + +var validFunction = require('../valid-function') + + , re = new RegExp('^\\s*function[\\0-\'\\)-\\uffff]*' + + '\\(([\\0-\\(\\*-\\uffff]*)\\)\\s*\\{([\\0-\\uffff]*)\\}\\s*$'); + +module.exports = function () { + var data = String(validFunction(this)).match(re); + return { args: data[1], body: data[2] }; +}; diff --git a/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/math/trunc/shim.js b/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/math/trunc/shim.js index 5182428..02e2c2a 100644 --- a/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/math/trunc/shim.js +++ b/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/math/trunc/shim.js @@ -6,8 +6,8 @@ module.exports = function (x) { if (isNaN(x)) return NaN; x = Number(x); if (x === 0) return x; - if (x === Infinity) return 1; - if (x === -Infinity) return -1; + if (x === Infinity) return Infinity; + if (x === -Infinity) return -Infinity; if (x > 0) return floor(x); return -floor(-x); }; diff --git a/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/node_modules/es6-iterator/.travis.yml b/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/node_modules/es6-iterator/.travis.yml index eab5f5d..02c277c 100644 --- a/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/node_modules/es6-iterator/.travis.yml +++ b/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/node_modules/es6-iterator/.travis.yml @@ -7,3 +7,5 @@ node_js: notifications: email: - medikoo+es6-iterator@medikoo.com + +script: "npm test && npm run lint" diff --git a/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/node_modules/es6-iterator/CHANGES b/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/node_modules/es6-iterator/CHANGES index 473a66d..a2d1ec7 100644 --- a/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/node_modules/es6-iterator/CHANGES +++ b/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/node_modules/es6-iterator/CHANGES @@ -1,4 +1,14 @@ -v0.1.1 -- 2014.04.29 +v0.1.3 -- 2015.02.02 +* Update dependencies +* Fix spelling of LICENSE + +v0.1.2 -- 2014.11.19 +* Optimise internal `_next` to not verify internal's list length at all times + (#2 thanks @RReverser) +* Fix documentation examples +* Configure lint scripts + +v0.1.1 -- 2014.04.29 * Fix es6-symbol dependency version v0.1.0 -- 2014.04.29 diff --git a/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/node_modules/es6-iterator/LICENCE b/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/node_modules/es6-iterator/LICENCE deleted file mode 100644 index aaf3528..0000000 --- a/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/node_modules/es6-iterator/LICENCE +++ /dev/null @@ -1,19 +0,0 @@ -Copyright (C) 2013 Mariusz Nowak (www.medikoo.com) - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/node_modules/es6-iterator/LICENSE b/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/node_modules/es6-iterator/LICENSE new file mode 100644 index 0000000..04724a3 --- /dev/null +++ b/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/node_modules/es6-iterator/LICENSE @@ -0,0 +1,19 @@ +Copyright (C) 2013-2015 Mariusz Nowak (www.medikoo.com) + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/node_modules/es6-iterator/README.md b/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/node_modules/es6-iterator/README.md index f1218a1..288373d 100644 --- a/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/node_modules/es6-iterator/README.md +++ b/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/node_modules/es6-iterator/README.md @@ -25,7 +25,7 @@ var iterator = new Iterator([1, 2, 3]); iterator.next(); // { value: 1, done: false } iterator.next(); // { value: 2, done: false } -iterator.next(); // { value: 3, done: true } +iterator.next(); // { value: 3, done: false } iterator.next(); // { value: undefined, done: true } ``` @@ -44,7 +44,7 @@ var iterator = new ArrayIterator([1, 2, 3], 'key+value'); iterator.next(); // { value: [0, 1], done: false } iterator.next(); // { value: [1, 2], done: false } -iterator.next(); // { value: [2, 3], done: true } +iterator.next(); // { value: [2, 3], done: false } iterator.next(); // { value: undefined, done: true } ``` @@ -56,7 +56,7 @@ May also be used for _arguments_ objects: iterator.next(); // { value: 1, done: false } iterator.next(); // { value: 2, done: false } - iterator.next(); // { value: 3, done: true } + iterator.next(); // { value: 3, done: false } iterator.next(); // { value: undefined, done: true } }(1, 2, 3)); ``` @@ -75,7 +75,7 @@ iterator.next(); // { value: '🙈', done: false } iterator.next(); // { value: 'o', done: false } iterator.next(); // { value: '🙉', done: false } iterator.next(); // { value: 'o', done: false } -iterator.next(); // { value: '🙊', done: true } +iterator.next(); // { value: '🙊', done: false } iterator.next(); // { value: undefined, done: true } ``` @@ -115,7 +115,7 @@ var iterator = get([1,2,3]); iterator.next(); // { value: 1, done: false } iterator.next(); // { value: 2, done: false } -iterator.next(); // { value: 3, done: true } +iterator.next(); // { value: 3, done: false } iterator.next(); // { value: undefined, done: true } ``` diff --git a/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/node_modules/es6-iterator/index.js b/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/node_modules/es6-iterator/index.js index d33910d..10fd089 100644 --- a/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/node_modules/es6-iterator/index.js +++ b/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/node_modules/es6-iterator/index.js @@ -1,7 +1,6 @@ 'use strict'; var clear = require('es5-ext/array/#/clear') - , toPosInt = require('es5-ext/number/to-pos-integer') , assign = require('es5-ext/object/assign') , callable = require('es5-ext/object/valid-callable') , value = require('es5-ext/object/valid-value') @@ -30,14 +29,13 @@ module.exports = Iterator = function (list, context) { defineProperties(Iterator.prototype, assign({ constructor: d(Iterator), _next: d(function () { - var i, l; + var i; if (!this.__list__) return; if (this.__redo__) { i = this.__redo__.shift(); if (i !== undefined) return i; } - l = toPosInt(this.__list__.length); - if (this.__nextIndex__ < l) return this.__nextIndex__++; + if (this.__nextIndex__ < this.__list__.length) return this.__nextIndex__++; this._unBind(); }), next: d(function () { return this._createResult(this._next()); }), diff --git a/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/node_modules/es6-iterator/package.json b/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/node_modules/es6-iterator/package.json index e81aedc..eebf8e1 100644 --- a/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/node_modules/es6-iterator/package.json +++ b/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/node_modules/es6-iterator/package.json @@ -1,6 +1,6 @@ { "name": "es6-iterator", - "version": "0.1.1", + "version": "0.1.3", "description": "Iterator abstraction based on ES6 specification", "author": { "name": "Mariusz Nowak", @@ -21,28 +21,31 @@ }, "dependencies": { "d": "~0.1.1", - "es5-ext": "~0.10.2", - "es6-symbol": "0.1.x" + "es5-ext": "~0.10.5", + "es6-symbol": "~2.0.1" }, "devDependencies": { - "event-emitter": "~0.3.1", - "tad": "0.2.x" + "event-emitter": "~0.3.3", + "tad": "~0.2.1", + "xlint": "~0.2.2", + "xlint-jslint-medikoo": "~0.1.2" }, "scripts": { + "lint": "node node_modules/xlint/bin/xlint --linter=node_modules/xlint-jslint-medikoo/index.js --no-cache --no-stream", + "lint-console": "node node_modules/xlint/bin/xlint --linter=node_modules/xlint-jslint-medikoo/index.js --watch", "test": "node ./node_modules/tad/bin/tad" }, "license": "MIT", + "gitHead": "2addc362c6f139e4941cf4726eeb59e5960c5cef", "bugs": { "url": "https://github.com/medikoo/es6-iterator/issues" }, "homepage": "https://github.com/medikoo/es6-iterator", - "_id": "es6-iterator@0.1.1", - "dist": { - "shasum": "5e136c899aa1c26296414f90859b73934812d275", - "tarball": "http://registry.npmjs.org/es6-iterator/-/es6-iterator-0.1.1.tgz" - }, - "_from": "es6-iterator@~0.1.1", - "_npmVersion": "1.4.3", + "_id": "es6-iterator@0.1.3", + "_shasum": "d6f58b8c4fc413c249b4baa19768f8e4d7c8944e", + "_from": "es6-iterator@~0.1.3", + "_npmVersion": "2.3.0", + "_nodeVersion": "0.11.16", "_npmUser": { "name": "medikoo", "email": "medikoo+npm@medikoo.com" @@ -53,8 +56,11 @@ "email": "medikoo+npm@medikoo.com" } ], + "dist": { + "shasum": "d6f58b8c4fc413c249b4baa19768f8e4d7c8944e", + "tarball": "http://registry.npmjs.org/es6-iterator/-/es6-iterator-0.1.3.tgz" + }, "directories": {}, - "_shasum": "5e136c899aa1c26296414f90859b73934812d275", - "_resolved": "https://registry.npmjs.org/es6-iterator/-/es6-iterator-0.1.1.tgz", + "_resolved": "https://registry.npmjs.org/es6-iterator/-/es6-iterator-0.1.3.tgz", "readme": "ERROR: No README data found!" } diff --git a/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/node_modules/es6-iterator/test/array.js b/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/node_modules/es6-iterator/test/array.js index 21a6751..ae7c219 100644 --- a/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/node_modules/es6-iterator/test/array.js +++ b/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/node_modules/es6-iterator/test/array.js @@ -4,7 +4,7 @@ var iteratorSymbol = require('es6-symbol').iterator; module.exports = function (T) { return { - "Values": function (a) { + Values: function (a) { var x = ['raz', 'dwa', 'trzy', 'cztery', 'pięć', 'sześć'], it; it = new T(x); @@ -34,7 +34,7 @@ module.exports = function (T) { a.deep(it.next(), { done: false, value: [5, 'pięć'] }, "#5"); a.deep(it.next(), { done: true, value: undefined }, "End"); }, - "Keys": function (a) { + Keys: function (a) { var x = ['raz', 'dwa', 'trzy', 'cztery', 'pięć', 'sześć'], it; it = new T(x, 'key'); @@ -49,7 +49,7 @@ module.exports = function (T) { a.deep(it.next(), { done: false, value: 5 }, "#5"); a.deep(it.next(), { done: true, value: undefined }, "End"); }, - "Sparse": function (a) { + Sparse: function (a) { var x = new Array(6), it; x[2] = 'raz'; diff --git a/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/node_modules/es6-iterator/test/index.js b/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/node_modules/es6-iterator/test/index.js index 1e2d1cf..ea3621a 100644 --- a/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/node_modules/es6-iterator/test/index.js +++ b/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/node_modules/es6-iterator/test/index.js @@ -21,7 +21,7 @@ module.exports = function (T) { a.deep(y = it.next(), { done: true, value: undefined }, "End"); a.not(y, it.next(), "Recreate result on dead"); }, - "Emited": function (a) { + Emited: function (a) { var x = ['raz', 'dwa', 'trzy', 'cztery', 'pięć'], y, it; y = ee(); diff --git a/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/node_modules/es6-symbol/.lint b/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/node_modules/es6-symbol/.lint index 701a50c..1851752 100644 --- a/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/node_modules/es6-symbol/.lint +++ b/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/node_modules/es6-symbol/.lint @@ -4,10 +4,10 @@ module tabs indent 2 -maxlen 80 +maxlen 100 ass nomen plusplus - newcap +vars diff --git a/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/node_modules/es6-symbol/CHANGES b/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/node_modules/es6-symbol/CHANGES index ff5e1b4..df8c27e 100644 --- a/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/node_modules/es6-symbol/CHANGES +++ b/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/node_modules/es6-symbol/CHANGES @@ -1,3 +1,25 @@ +v2.0.1 -- 2015.01.28 +* Fix Symbol.prototype[Symbol.isPrimitive] implementation +* Improve validation within Symbol.prototype.toString and + Symbol.prototype.valueOf + +v2.0.0 -- 2015.01.28 +* Update up to changes in specification: + * Implement `for` and `keyFor` + * Remove `Symbol.create` and `Symbol.isRegExp` + * Add `Symbol.match`, `Symbol.replace`, `Symbol.search`, `Symbol.species` and + `Symbol.split` +* Rename `validSymbol` to `validateSymbol` +* Improve documentation +* Remove dead test modules + +v1.0.0 -- 2015.01.26 +* Fix enumerability for symbol properties set normally (e.g. obj[symbol] = value) +* Introduce initialization via hidden constructor +* Fix isSymbol handling of polyfill values when native Symbol is present +* Fix spelling of LICENSE +* Configure lint scripts + v0.1.1 -- 2014.10.07 * Fix isImplemented, so it returns true in case of polyfill * Improve documentations diff --git a/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/node_modules/es6-symbol/LICENCE b/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/node_modules/es6-symbol/LICENCE deleted file mode 100644 index aaf3528..0000000 --- a/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/node_modules/es6-symbol/LICENCE +++ /dev/null @@ -1,19 +0,0 @@ -Copyright (C) 2013 Mariusz Nowak (www.medikoo.com) - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/node_modules/es6-symbol/LICENSE b/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/node_modules/es6-symbol/LICENSE new file mode 100644 index 0000000..04724a3 --- /dev/null +++ b/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/node_modules/es6-symbol/LICENSE @@ -0,0 +1,19 @@ +Copyright (C) 2013-2015 Mariusz Nowak (www.medikoo.com) + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/node_modules/es6-symbol/README.md b/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/node_modules/es6-symbol/README.md index 978eb59..95d6780 100644 --- a/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/node_modules/es6-symbol/README.md +++ b/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/node_modules/es6-symbol/README.md @@ -1,23 +1,27 @@ # es6-symbol -## ECMAScript6 Symbol polyfill +## ECMAScript 6 Symbol polyfill + +For more information about symbols see following links +- [Symbols in ECMAScript 6 by Axel Rauschmayer](http://www.2ality.com/2014/12/es6-symbols.html) +- [MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Symbol) +- [Specification](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-symbol-constructor) ### Limitations -- Underneath it uses real string property names which can easily be retrieved (however accidental collision with other property names is unlikely) -- As it needs custom `toString` behavior to work properly. Original `Symbol.prototype.toString` couldn't be implemented as specified, still it's accessible as `Symbol.prototoype.properToString` +Underneath it uses real string property names which can easily be retrieved, however accidental collision with other property names is unlikely. ### Usage -If you want to make sure your environment implements `Symbol`, do: +If you'd like to use native version when it exists and fallback to polyfill if it doesn't (but without implementing `Symbol` on global scope), do: ```javascript -require('es6-symbol/implement'); +var Symbol = require('es6-symbol'); ``` -If you'd like to use native version when it exists and fallback to polyfill if it doesn't, but without implementing `Symbol` on global scope, do: +If you want to make sure your environment implements `Symbol`, do: ```javascript -var Symbol = require('es6-symbol'); +require('es6-symbol/implement'); ``` If you strictly want to use polyfill even if native `Symbol` exists (hard to find a good reason for that), do: @@ -60,7 +64,7 @@ In your project path: ##### Browser -You can easily bundle _es6-symbol_ for browser with [modules-webmake](https://github.com/medikoo/modules-webmake) +To port it to Browser or any other (non CJS) environment, use your favorite CJS bundler. No favorite yet? Try: [Browserify](http://browserify.org/), [Webmake](https://github.com/medikoo/modules-webmake) or [Webpack](http://webpack.github.io/) ## Tests [![Build Status](https://travis-ci.org/medikoo/es6-symbol.png)](https://travis-ci.org/medikoo/es6-symbol) diff --git a/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/node_modules/es6-symbol/is-implemented.js b/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/node_modules/es6-symbol/is-implemented.js index 02a06b5..53759f3 100644 --- a/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/node_modules/es6-symbol/is-implemented.js +++ b/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/node_modules/es6-symbol/is-implemented.js @@ -9,7 +9,6 @@ module.exports = function () { // Return 'true' for polyfills if (typeof Symbol.isConcatSpreadable !== 'object') return false; - if (typeof Symbol.isRegExp !== 'object') return false; if (typeof Symbol.iterator !== 'object') return false; if (typeof Symbol.toPrimitive !== 'object') return false; if (typeof Symbol.toStringTag !== 'object') return false; diff --git a/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/node_modules/es6-symbol/is-symbol.js b/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/node_modules/es6-symbol/is-symbol.js index dcf72c9..beeba2c 100644 --- a/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/node_modules/es6-symbol/is-symbol.js +++ b/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/node_modules/es6-symbol/is-symbol.js @@ -1,12 +1,5 @@ 'use strict'; -var toString = Object.prototype.toString - , toStringTag = require('./').toStringTag - - , id = '[object Symbol]' - , Global = (typeof Symbol === 'undefined') ? null : Symbol; - module.exports = function (x) { - return (x && ((Global && (x instanceof Global)) || - (toString.call(x) === id) || (x[toStringTag] === 'Symbol'))) || false; + return (x && ((typeof x === 'symbol') || (x['@@toStringTag'] === 'Symbol'))) || false; }; diff --git a/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/node_modules/es6-symbol/package.json b/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/node_modules/es6-symbol/package.json index c7026c2..aaada6a 100644 --- a/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/node_modules/es6-symbol/package.json +++ b/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/node_modules/es6-symbol/package.json @@ -1,6 +1,6 @@ { "name": "es6-symbol", - "version": "0.1.1", + "version": "2.0.1", "description": "ECMAScript6 Symbol polyfill", "author": { "name": "Mariusz Nowak", @@ -21,24 +21,28 @@ }, "dependencies": { "d": "~0.1.1", - "es5-ext": "~0.10.4" + "es5-ext": "~0.10.5" }, "devDependencies": { - "tad": "0.2.x" + "tad": "~0.2.1", + "xlint": "~0.2.2", + "xlint-jslint-medikoo": "~0.1.2" }, "scripts": { + "lint": "node node_modules/xlint/bin/xlint --linter=node_modules/xlint-jslint-medikoo/index.js --no-cache --no-stream", + "lint-console": "node node_modules/xlint/bin/xlint --linter=node_modules/xlint-jslint-medikoo/index.js --watch", "test": "node ./node_modules/tad/bin/tad" }, "license": "MIT", - "gitHead": "2ca76a05feafaa14c838337722562625fb5072b4", + "gitHead": "51f6938d7830269fefa38f02eb912f5472b3ccd7", "bugs": { "url": "https://github.com/medikoo/es6-symbol/issues" }, "homepage": "https://github.com/medikoo/es6-symbol", - "_id": "es6-symbol@0.1.1", - "_shasum": "9cf7fab2edaff1b1da8fe8e68bfe3f5aca6ca218", - "_from": "es6-symbol@0.1.x", - "_npmVersion": "2.0.0", + "_id": "es6-symbol@2.0.1", + "_shasum": "761b5c67cfd4f1d18afb234f691d678682cb3bf3", + "_from": "es6-symbol@~2.0.1", + "_npmVersion": "1.4.28", "_npmUser": { "name": "medikoo", "email": "medikoo+npm@medikoo.com" @@ -50,10 +54,10 @@ } ], "dist": { - "shasum": "9cf7fab2edaff1b1da8fe8e68bfe3f5aca6ca218", - "tarball": "http://registry.npmjs.org/es6-symbol/-/es6-symbol-0.1.1.tgz" + "shasum": "761b5c67cfd4f1d18afb234f691d678682cb3bf3", + "tarball": "http://registry.npmjs.org/es6-symbol/-/es6-symbol-2.0.1.tgz" }, "directories": {}, - "_resolved": "https://registry.npmjs.org/es6-symbol/-/es6-symbol-0.1.1.tgz", + "_resolved": "https://registry.npmjs.org/es6-symbol/-/es6-symbol-2.0.1.tgz", "readme": "ERROR: No README data found!" } diff --git a/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/node_modules/es6-symbol/polyfill.js b/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/node_modules/es6-symbol/polyfill.js index f7dfa25..735eb67 100644 --- a/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/node_modules/es6-symbol/polyfill.js +++ b/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/node_modules/es6-symbol/polyfill.js @@ -1,53 +1,77 @@ 'use strict'; -var d = require('d') +var d = require('d') + , validateSymbol = require('./validate-symbol') , create = Object.create, defineProperties = Object.defineProperties - , generateName, Symbol; + , defineProperty = Object.defineProperty, objPrototype = Object.prototype + , Symbol, HiddenSymbol, globalSymbols = create(null); -generateName = (function () { +var generateName = (function () { var created = create(null); return function (desc) { - var postfix = 0; + var postfix = 0, name; while (created[desc + (postfix || '')]) ++postfix; desc += (postfix || ''); created[desc] = true; - return '@@' + desc; + name = '@@' + desc; + defineProperty(objPrototype, name, d.gs(null, function (value) { + defineProperty(this, name, d(value)); + })); + return name; }; }()); -module.exports = Symbol = function (description) { +HiddenSymbol = function Symbol(description) { + if (this instanceof HiddenSymbol) throw new TypeError('TypeError: Symbol is not a constructor'); + return Symbol(description); +}; +module.exports = Symbol = function Symbol(description) { var symbol; - if (this instanceof Symbol) { - throw new TypeError('TypeError: Symbol is not a constructor'); - } - symbol = create(Symbol.prototype); + if (this instanceof Symbol) throw new TypeError('TypeError: Symbol is not a constructor'); + symbol = create(HiddenSymbol.prototype); description = (description === undefined ? '' : String(description)); return defineProperties(symbol, { __description__: d('', description), __name__: d('', generateName(description)) }); }; - -Object.defineProperties(Symbol, { - create: d('', Symbol('create')), +defineProperties(Symbol, { + for: d(function (key) { + if (globalSymbols[key]) return globalSymbols[key]; + return (globalSymbols[key] = Symbol(String(key))); + }), + keyFor: d(function (s) { + var key; + validateSymbol(s); + for (key in globalSymbols) if (globalSymbols[key] === s) return key; + }), hasInstance: d('', Symbol('hasInstance')), isConcatSpreadable: d('', Symbol('isConcatSpreadable')), - isRegExp: d('', Symbol('isRegExp')), iterator: d('', Symbol('iterator')), + match: d('', Symbol('match')), + replace: d('', Symbol('replace')), + search: d('', Symbol('search')), + species: d('', Symbol('species')), + split: d('', Symbol('split')), toPrimitive: d('', Symbol('toPrimitive')), toStringTag: d('', Symbol('toStringTag')), unscopables: d('', Symbol('unscopables')) }); +defineProperties(HiddenSymbol.prototype, { + constructor: d(Symbol), + toString: d('', function () { return this.__name__; }) +}); defineProperties(Symbol.prototype, { - properToString: d(function () { - return 'Symbol (' + this.__description__ + ')'; - }), - toString: d('', function () { return this.__name__; }) + toString: d(function () { return 'Symbol (' + validateSymbol(this).__description__ + ')'; }), + valueOf: d(function () { return validateSymbol(this); }) }); -Object.defineProperty(Symbol.prototype, Symbol.toPrimitive, d('', - function (hint) { - throw new TypeError("Conversion of symbol objects is not allowed"); - })); -Object.defineProperty(Symbol.prototype, Symbol.toStringTag, d('c', 'Symbol')); +defineProperty(Symbol.prototype, Symbol.toPrimitive, d('', + function () { return validateSymbol(this); })); +defineProperty(Symbol.prototype, Symbol.toStringTag, d('c', 'Symbol')); + +defineProperty(HiddenSymbol.prototype, Symbol.toPrimitive, + d('c', Symbol.prototype[Symbol.toPrimitive])); +defineProperty(HiddenSymbol.prototype, Symbol.toStringTag, + d('c', Symbol.prototype[Symbol.toStringTag])); diff --git a/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/node_modules/es6-symbol/test/polyfill.js b/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/node_modules/es6-symbol/test/polyfill.js index cac9cd5..83fb5e9 100644 --- a/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/node_modules/es6-symbol/test/polyfill.js +++ b/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/node_modules/es6-symbol/test/polyfill.js @@ -10,8 +10,18 @@ module.exports = function (T, a) { defineProperty(x, symbol, d('foo')); a(x.test, undefined, "Name"); a(x[symbol], 'foo', "Get"); + a(x instanceof T, false); a(isSymbol(symbol), true, "Symbol"); a(isSymbol(T.iterator), true, "iterator"); a(isSymbol(T.toStringTag), true, "toStringTag"); + + x = {}; + x[symbol] = 'foo'; + a.deep(Object.getOwnPropertyDescriptor(x, symbol), { configurable: true, enumerable: false, + value: 'foo', writable: true }); + symbol = T.for('marko'); + a(isSymbol(symbol), true); + a(T.for('marko'), symbol); + a(T.keyFor(symbol), 'marko'); }; diff --git a/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/node_modules/es6-symbol/test/valid-iterable.js b/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/node_modules/es6-symbol/test/valid-iterable.js deleted file mode 100644 index d277bc9..0000000 --- a/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/node_modules/es6-symbol/test/valid-iterable.js +++ /dev/null @@ -1,14 +0,0 @@ -'use strict'; - -var Iterator = require('../'); - -module.exports = function (t, a) { - var obj; - a.throws(function () { t(); }, TypeError, "Undefined"); - a.throws(function () { t({}); }, TypeError, "Plain object"); - a.throws(function () { t({ length: 0 }); }, TypeError, "Array-like"); - obj = { '@@iterator': function () { return new Iterator([]); } }; - a(t(obj), obj, "Iterator"); - obj = []; - a(t(obj), obj, 'Array'); -}; diff --git a/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/node_modules/es6-symbol/test/validate-symbol.js b/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/node_modules/es6-symbol/test/validate-symbol.js new file mode 100644 index 0000000..2c8f84c --- /dev/null +++ b/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/node_modules/es6-symbol/test/validate-symbol.js @@ -0,0 +1,19 @@ +'use strict'; + +var SymbolPoly = require('../polyfill'); + +module.exports = function (t, a) { + var symbol; + a.throws(function () { t(undefined); }, TypeError, "Undefined"); + a.throws(function () { t(null); }, TypeError, "Null"); + a.throws(function () { t(true); }, TypeError, "Primitive"); + a.throws(function () { t('raz'); }, TypeError, "String"); + a.throws(function () { t({}); }, TypeError, "Object"); + a.throws(function () { t([]); }, TypeError, "Array"); + if (typeof Symbol !== 'undefined') { + symbol = Symbol(); + a(t(symbol), symbol, "Native"); + } + symbol = SymbolPoly(); + a(t(symbol), symbol, "Polyfill"); +}; diff --git a/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/node_modules/es6-symbol/validate-symbol.js b/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/node_modules/es6-symbol/validate-symbol.js new file mode 100644 index 0000000..4275004 --- /dev/null +++ b/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/node_modules/es6-symbol/validate-symbol.js @@ -0,0 +1,8 @@ +'use strict'; + +var isSymbol = require('./is-symbol'); + +module.exports = function (value) { + if (!isSymbol(value)) throw new TypeError(value + " is not a symbol"); + return value; +}; diff --git a/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/number/is-integer/shim.js b/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/number/is-integer/shim.js index dc88cf3..5402939 100644 --- a/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/number/is-integer/shim.js +++ b/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/number/is-integer/shim.js @@ -1,9 +1,8 @@ -'use strict'; +// Credit: http://www.2ality.com/2014/05/is-integer.html -var toInteger = require('../to-integer'); +'use strict'; module.exports = function (value) { if (typeof value !== 'number') return false; - if (!isFinite(value)) return false; - return toInteger(value) === value; + return (value % 1 === 0); }; diff --git a/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/number/is-nan/shim.js b/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/number/is-nan/shim.js index 74ee96d..070d96c 100644 --- a/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/number/is-nan/shim.js +++ b/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/number/is-nan/shim.js @@ -1,3 +1,3 @@ 'use strict'; -module.exports = function (value) { return (value !== value); } //jslint: skip +module.exports = function (value) { return (value !== value); } //jslint: ignore diff --git a/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/object/compare.js b/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/object/compare.js index 0101b66..2ab11f1 100644 --- a/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/object/compare.js +++ b/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/object/compare.js @@ -8,7 +8,7 @@ var strCompare = require('../string/#/case-insensitive-compare') typeMap = { undefined: 0, object: 1, - 'boolean': 2, + boolean: 2, string: 3, number: 4 }; @@ -31,12 +31,12 @@ module.exports = function (a, b) { a = resolve(a); b = resolve(b); - if (a == b) return typeMap[typeof a] - typeMap[typeof b]; //jslint: skip + if (a == b) return typeMap[typeof a] - typeMap[typeof b]; //jslint: ignore if (a == null) return -1; if (b == null) return 1; if ((typeof a === 'string') || (typeof b === 'string')) { return strCompare.call(a, b); } - if ((a !== a) && (b !== b)) return 0; //jslint: skip + if ((a !== a) && (b !== b)) return 0; //jslint: ignore return Number(a) - Number(b); }; diff --git a/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/object/eq.js b/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/object/eq.js index 9b8d6f3..037937e 100644 --- a/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/object/eq.js +++ b/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/object/eq.js @@ -1,5 +1,5 @@ 'use strict'; module.exports = function (x, y) { - return ((x === y) || ((x !== x) && (y !== y))); //jslint: skip + return ((x === y) || ((x !== x) && (y !== y))); //jslint: ignore }; diff --git a/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/object/index.js b/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/object/index.js index bf7c0ce..0b7b0fe 100644 --- a/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/object/index.js +++ b/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/object/index.js @@ -33,9 +33,11 @@ module.exports = { mixinPrototypes: require('./mixin-prototypes'), primitiveSet: require('./primitive-set'), safeTraverse: require('./safe-traverse'), + serialize: require('./serialize'), setPrototypeOf: require('./set-prototype-of'), some: require('./some'), toArray: require('./to-array'), + unserialize: require('./unserialize'), validCallable: require('./valid-callable'), validObject: require('./valid-object'), validValue: require('./valid-value') diff --git a/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/object/is-empty.js b/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/object/is-empty.js index 849673b..7b51a87 100644 --- a/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/object/is-empty.js +++ b/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/object/is-empty.js @@ -7,7 +7,7 @@ var value = require('./valid-value') module.exports = function (obj) { var i; value(obj); - for (i in obj) { //jslint: skip + for (i in obj) { //jslint: ignore if (propertyIsEnumerable.call(obj, i)) return false; } return true; diff --git a/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/object/is-object.js b/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/object/is-object.js index 4133a2b..a86facf 100644 --- a/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/object/is-object.js +++ b/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/object/is-object.js @@ -1,6 +1,6 @@ 'use strict'; -var map = { 'function': true, 'object': true }; +var map = { function: true, object: true }; module.exports = function (x) { return ((x != null) && map[typeof x]) || false; diff --git a/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/object/is-plain-object.js b/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/object/is-plain-object.js index 3abaf68..9a28231 100644 --- a/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/object/is-plain-object.js +++ b/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/object/is-plain-object.js @@ -3,7 +3,7 @@ var getPrototypeOf = Object.getPrototypeOf, prototype = Object.prototype , toString = prototype.toString - , id = {}.toString(); + , id = Object().toString(); module.exports = function (value) { var proto, constructor; diff --git a/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/object/is.js b/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/object/is.js index 8c695e4..5778b50 100644 --- a/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/object/is.js +++ b/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/object/is.js @@ -6,5 +6,5 @@ module.exports = function (x, y) { return (x === y) ? ((x !== 0) || ((1 / x) === (1 / y))) : - ((x !== x) && (y !== y)); //jslint: skip + ((x !== x) && (y !== y)); //jslint: ignore }; diff --git a/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/object/normalize-options.js b/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/object/normalize-options.js index b9cb49f..cf8ed8d 100644 --- a/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/object/normalize-options.js +++ b/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/object/normalize-options.js @@ -1,15 +1,10 @@ 'use strict'; -var assign = require('./assign') +var forEach = Array.prototype.forEach, create = Object.create; - , forEach = Array.prototype.forEach - , create = Object.create, getPrototypeOf = Object.getPrototypeOf - - , process; - -process = function (src, obj) { - var proto = getPrototypeOf(src); - return assign(proto ? process(proto, obj) : obj, src); +var process = function (src, obj) { + var key; + for (key in src) obj[key] = src[key]; }; module.exports = function (options/*, …options*/) { diff --git a/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/object/serialize.js b/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/object/serialize.js new file mode 100644 index 0000000..8113b68 --- /dev/null +++ b/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/object/serialize.js @@ -0,0 +1,36 @@ +'use strict'; + +var toArray = require('./to-array') + , isDate = require('../date/is-date') + , isRegExp = require('../reg-exp/is-reg-exp') + + , isArray = Array.isArray, stringify = JSON.stringify + , keyValueToString = function (value, key) { return stringify(key) + ':' + exports(value); }; + +var sparseMap = function (arr) { + var i, l = arr.length, result = new Array(l); + for (i = 0; i < l; ++i) { + if (!arr.hasOwnProperty(i)) continue; + result[i] = exports(arr[i]); + } + return result; +}; + +module.exports = exports = function (obj) { + if (obj == null) return String(obj); + switch (typeof obj) { + case 'string': + return stringify(obj); + case 'number': + case 'boolean': + case 'function': + return String(obj); + case 'object': + if (isArray(obj)) return '[' + sparseMap(obj) + ']'; + if (isRegExp(obj)) return String(obj); + if (isDate(obj)) return 'new Date(' + obj.valueOf() + ')'; + return '{' + toArray(obj, keyValueToString) + '}'; + default: + throw new TypeError("Serialization of " + String(obj) + "is unsupported"); + } +}; diff --git a/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/object/unserialize.js b/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/object/unserialize.js new file mode 100644 index 0000000..ce68e40 --- /dev/null +++ b/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/object/unserialize.js @@ -0,0 +1,7 @@ +'use strict'; + +var value = require('./valid-value'); + +module.exports = exports = function (code) { + return (new Function('return ' + value(code)))(); +}; diff --git a/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/package.json b/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/package.json index c2f7774..cc383f2 100644 --- a/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/package.json +++ b/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/package.json @@ -1,6 +1,6 @@ { "name": "es5-ext", - "version": "0.10.4", + "version": "0.10.6", "description": "ECMAScript 5 extensions and ES6 shims", "author": { "name": "Mariusz Nowak", @@ -30,27 +30,30 @@ "url": "git://github.com/medikoo/es5-ext.git" }, "dependencies": { - "es6-iterator": "~0.1.1", - "es6-symbol": "0.1.x" + "es6-iterator": "~0.1.3", + "es6-symbol": "~2.0.1" }, "devDependencies": { - "tad": "0.2.x" + "tad": "~0.2.1", + "xlint": "~0.2.2", + "xlint-jslint-medikoo": "~0.1.2" }, "scripts": { + "lint": "node node_modules/xlint/bin/xlint --linter=node_modules/xlint-jslint-medikoo/index.js --no-cache --no-stream", + "lint-console": "node node_modules/xlint/bin/xlint --linter=node_modules/xlint-jslint-medikoo/index.js --watch", "test": "node ./node_modules/tad/bin/tad" }, - "licence": "MIT", + "license": "MIT", + "gitHead": "fd4ef2f9f4a4bb23e4479a1fb56701f49623d469", "bugs": { "url": "https://github.com/medikoo/es5-ext/issues" }, "homepage": "https://github.com/medikoo/es5-ext", - "_id": "es5-ext@0.10.4", - "dist": { - "shasum": "f4d7d85d45acfbe93379d4c0948fbae6466ec876", - "tarball": "http://registry.npmjs.org/es5-ext/-/es5-ext-0.10.4.tgz" - }, + "_id": "es5-ext@0.10.6", + "_shasum": "e27d5750401a11c08259e3b9b5d3bdd3281df00a", "_from": "es5-ext@~0.10.2", - "_npmVersion": "1.4.3", + "_npmVersion": "2.3.0", + "_nodeVersion": "0.11.16", "_npmUser": { "name": "medikoo", "email": "medikoo+npm@medikoo.com" @@ -61,8 +64,11 @@ "email": "medikoo+npm@medikoo.com" } ], + "dist": { + "shasum": "e27d5750401a11c08259e3b9b5d3bdd3281df00a", + "tarball": "http://registry.npmjs.org/es5-ext/-/es5-ext-0.10.6.tgz" + }, "directories": {}, - "_shasum": "f4d7d85d45acfbe93379d4c0948fbae6466ec876", - "_resolved": "https://registry.npmjs.org/es5-ext/-/es5-ext-0.10.4.tgz", + "_resolved": "https://registry.npmjs.org/es5-ext/-/es5-ext-0.10.6.tgz", "readme": "ERROR: No README data found!" } diff --git a/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/string/#/camel-to-hyphen.js b/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/string/#/camel-to-hyphen.js index b5c9be7..6898097 100644 --- a/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/string/#/camel-to-hyphen.js +++ b/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/string/#/camel-to-hyphen.js @@ -1,7 +1,7 @@ 'use strict'; var replace = String.prototype.replace - , re = /([a-z])([A-Z])/g; + , re = /([a-z\d])([A-Z])/g; module.exports = function () { return replace.call(this, re, "$1-$2").toLowerCase(); diff --git a/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/string/index.js b/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/string/index.js index 087d85f..dbbcdf6 100644 --- a/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/string/index.js +++ b/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/string/index.js @@ -5,5 +5,6 @@ module.exports = { formatMethod: require('./format-method'), fromCodePoint: require('./from-code-point'), isString: require('./is-string'), + randomUniq: require('./random-uniq'), raw: require('./raw') }; diff --git a/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/string/random-uniq.js b/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/string/random-uniq.js new file mode 100644 index 0000000..54ae6f8 --- /dev/null +++ b/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/string/random-uniq.js @@ -0,0 +1,11 @@ +'use strict'; + +var generated = Object.create(null) + + , random = Math.random; + +module.exports = function () { + var str; + do { str = random().toString(36).slice(2); } while (generated[str]); + return str; +}; diff --git a/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/test/array/from/shim.js b/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/test/array/from/shim.js index aa4c928..310302a 100644 --- a/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/test/array/from/shim.js +++ b/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/test/array/from/shim.js @@ -21,9 +21,9 @@ module.exports = function (t, a) { a.deep(t(3), [], "Primitive"); a(t.length, 1, "Length"); - a.deep(t({ 'length': 0 }), [], "No values Array-like"); - a.deep(t({ 'length': -1 }), [], "Invalid length Array-like"); - a.deep(t({ 'length': -Infinity }), [], "Invalid length Array-like #2"); + a.deep(t({ length: 0 }), [], "No values Array-like"); + a.deep(t({ length: -1 }), [], "Invalid length Array-like"); + a.deep(t({ length: -Infinity }), [], "Invalid length Array-like #2"); a.throws(function () { t(undefined); }, TypeError, "Undefined"); a.throws(function () { t(null); }, TypeError, "Null"); a.deep(t(false), [], "Boolean"); @@ -33,18 +33,18 @@ module.exports = function (t, a) { a.deep(t(1), [], "1"); a.deep(t(+Infinity), [], "+Infinity"); a.deep(t({}), [], "Plain object"); - a.deep(t({ 'length': 1 }), [undefined], "Sparse array-like"); - a.deep(t({ '0': 'a', '1': 'b', 'length': 2 }, function (x) { return x + x; }), ['aa', 'bb'], + a.deep(t({ length: 1 }), [undefined], "Sparse array-like"); + a.deep(t({ '0': 'a', '1': 'b', length: 2 }, function (x) { return x + x; }), ['aa', 'bb'], "Map"); - a.deep(t({ '0': 'a', '1': 'b', 'length': 2 }, function (x) { return String(this); }, undefined), + a.deep(t({ '0': 'a', '1': 'b', length: 2 }, function (x) { return String(this); }, undefined), ['undefined', 'undefined'], "Map context"); - a.deep(t({ '0': 'a', '1': 'b', 'length': 2 }, function (x) { return String(this); }, 'x'), + a.deep(t({ '0': 'a', '1': 'b', length: 2 }, function (x) { return String(this); }, 'x'), ['x', 'x'], "Map primitive context"); a.throws(function () { t({}, 'foo', 'x'); }, TypeError, "Non callable for map"); - a.deep(t.call(null, { 'length': 1, '0': 'a' }), ['a'], "Null context"); + a.deep(t.call(null, { length: 1, '0': 'a' }), ['a'], "Null context"); - a(t({ '__proto__': { '0': 'abc', 'length': 1 } })[0], 'abc', "Values on prototype"); + a(t({ __proto__: { '0': 'abc', length: 1 } })[0], 'abc', "Values on prototype"); a.throws(function () { t.call(function () { return Object.freeze({}); }, {}); }, TypeError, "Contructor producing freezed objects"); @@ -55,6 +55,6 @@ module.exports = function (t, a) { Object.defineProperty(MyType.prototype, '0', { set: function (x) { throw new Error('Setter called: ' + x); } }); - a.deep(t.call(MyType, { '0': 'abc', 'length': 1 }), { '0': 'abc', 'length': 1 }, + a.deep(t.call(MyType, { '0': 'abc', length: 1 }), { '0': 'abc', length: 1 }, "Defined not set"); }; diff --git a/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/test/array/of/shim.js b/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/test/array/of/shim.js index 6f1c332..e697442 100644 --- a/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/test/array/of/shim.js +++ b/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/test/array/of/shim.js @@ -25,8 +25,8 @@ module.exports = function (t, a) { a.deep(t(1), [1], "1"); a.deep(t(1, 2, 3), [1, 2, 3], "Numeric args"); a.deep(t(+Infinity), [+Infinity], "+Infinity"); - a.deep(t({ '0': 'a', '1': 'b', '2': 'c', 'length': 3 }), - [{ '0': 'a', '1': 'b', '2': 'c', 'length': 3 }], "Array like"); + a.deep(t({ '0': 'a', '1': 'b', '2': 'c', length: 3 }), + [{ '0': 'a', '1': 'b', '2': 'c', length: 3 }], "Array like"); a.deep(t(undefined, null, false, -Infinity, -0, +0, 1, 2, +Infinity), [undefined, null, false, -Infinity, -0, +0, 1, 2, +Infinity], "Falsy arguments"); @@ -41,13 +41,13 @@ module.exports = function (t, a) { a.deep(t.call(null, 1), [1], "1"); a.deep(t.call(null, 1, 2, 3), [1, 2, 3], "Numeric"); a.deep(t.call(null, +Infinity), [+Infinity], "+Infinity"); - a.deep(t.call(null, { '0': 'a', '1': 'b', '2': 'c', 'length': 3 }), - [{ '0': 'a', '1': 'b', '2': 'c', 'length': 3 }], "Array-like"); + a.deep(t.call(null, { '0': 'a', '1': 'b', '2': 'c', length: 3 }), + [{ '0': 'a', '1': 'b', '2': 'c', length: 3 }], "Array-like"); a.deep(t.call(null, undefined, null, false, -Infinity, -0, +0, 1, 2, +Infinity), [undefined, null, false, -Infinity, -0, +0, 1, 2, +Infinity], "Falsy"); a.h1("Other constructor context"); - a.deep(t.call(Object, 1, 2, 3), { '0': 1, '1': 2, '2': 3, 'length': 3 }, "Many arguments"); + a.deep(t.call(Object, 1, 2, 3), { '0': 1, '1': 2, '2': 3, length: 3 }, "Many arguments"); testObject = Object(3); testObject[0] = 1; @@ -64,5 +64,5 @@ module.exports = function (t, a) { defineProperty(MyType.prototype, '0', { set: function (x) { throw new Error('Setter called: ' + x); } }); - a.deep(t.call(MyType, 'abc'), { '0': 'abc', 'length': 1 }, "Define, not set"); + a.deep(t.call(MyType, 'abc'), { '0': 'abc', length: 1 }, "Define, not set"); }; diff --git a/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/test/function/#/to-string-tokens.js b/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/test/function/#/to-string-tokens.js new file mode 100644 index 0000000..4c54d30 --- /dev/null +++ b/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/test/function/#/to-string-tokens.js @@ -0,0 +1,12 @@ +'use strict'; + +module.exports = function (t, a) { + a.deep(t.call(function (a, b) { return this[a] + this[b]; }), + { args: 'a, b', body: ' return this[a] + this[b]; ' }); + a.deep(t.call(function () {}), + { args: '', body: '' }); + a.deep(t.call(function (raz) {}), + { args: 'raz', body: '' }); + a.deep(t.call(function () { Object(); }), + { args: '', body: ' Object(); ' }); +}; diff --git a/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/test/math/trunc/shim.js b/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/test/math/trunc/shim.js index 415d30a..9e5eed7 100644 --- a/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/test/math/trunc/shim.js +++ b/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/test/math/trunc/shim.js @@ -5,8 +5,8 @@ var is = require('../../../object/is'); module.exports = function (t, a) { a(t({}), NaN, "NaN"); a(t(0), 0, "Zero"); - a(t(Infinity), 1, "Infinity"); - a(t(-Infinity), -1, "-Infinity"); + a(t(Infinity), Infinity, "Infinity"); + a(t(-Infinity), -Infinity, "-Infinity"); a(is(t(0.234), 0), true, "0"); a(is(t(-0.234), -0), true, "-0"); a(t(13.7), 13, "Positive #1"); diff --git a/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/test/object/is-plain-object.js b/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/test/object/is-plain-object.js index e0377ba..e988829 100644 --- a/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/test/object/is-plain-object.js +++ b/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/test/object/is-plain-object.js @@ -3,7 +3,7 @@ module.exports = function (t, a) { a(t({}), true, "Empty {} is plain object"); a(t({ a: true }), true, "{} with property is plain object"); - a(t({ 'prototype': 1, 'constructor': 2, '__proto__': 3 }), true, + a(t({ prototype: 1, constructor: 2, __proto__: 3 }), true, "{} with any property keys is plain object"); a(t(null), false, "Null is not plain object"); a(t('string'), false, "Primitive is not plain object"); diff --git a/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/test/object/key-of.js b/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/test/object/key-of.js index 39d65c5..a9225a0 100644 --- a/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/test/object/key-of.js +++ b/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/test/object/key-of.js @@ -2,7 +2,7 @@ module.exports = function (t, a) { var x = {}, y = {} - , o = { 'foo': 'bar', 'raz': x, 'trzy': 'cztery', 'five': '6' }; + , o = { foo: 'bar', raz: x, trzy: 'cztery', five: '6' }; a(t(o, 'bar'), 'foo', "First property"); a(t(o, 6), null, "Primitive that's not there"); diff --git a/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/test/object/normalize-options.js b/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/test/object/normalize-options.js index 052babd..0d2d4da 100644 --- a/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/test/object/normalize-options.js +++ b/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/test/object/normalize-options.js @@ -1,6 +1,6 @@ 'use strict'; -var create = Object.create; +var create = Object.create, defineProperty = Object.defineProperty; module.exports = function (t, a) { var x = { foo: 'raz', bar: 'dwa' }, y; @@ -9,6 +9,11 @@ module.exports = function (t, a) { a.deep(y, x, "Plain"); x = { raz: 'one', dwa: 'two' }; + defineProperty(x, 'get', { + configurable: true, + enumerable: true, + get: function () { return this.dwa; } + }); x = create(x); x.trzy = 'three'; x.cztery = 'four'; @@ -19,9 +24,9 @@ module.exports = function (t, a) { x.szesc = 'six'; a.deep(t(x), { raz: 'one', dwa: 'two!', trzy: 'three!', cztery: 'four', - piec: 'five', szesc: 'six' }, "Deep object"); + piec: 'five', szesc: 'six', get: 'two!' }, "Deep object"); a.deep(t({ marko: 'raz', raz: 'foo' }, x, { szesc: 'elo', siedem: 'bibg' }), { marko: 'raz', raz: 'one', dwa: 'two!', trzy: 'three!', cztery: 'four', - piec: 'five', szesc: 'elo', siedem: 'bibg' }, "Multiple options"); + piec: 'five', szesc: 'elo', siedem: 'bibg', get: 'two!' }, "Multiple options"); }; diff --git a/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/test/object/serialize.js b/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/test/object/serialize.js new file mode 100644 index 0000000..43eed6a --- /dev/null +++ b/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/test/object/serialize.js @@ -0,0 +1,25 @@ +'use strict'; + +module.exports = function (t, a) { + var fn = function (raz, dwa) { return raz + dwa; }; + a(t(), 'undefined', "Undefined"); + a(t(null), 'null', "Null"); + a(t(null), 'null', "Null"); + a(t('raz'), '"raz"', "String"); + a(t('raz"ddwa\ntrzy'), '"raz\\"ddwa\\ntrzy"', "String with escape"); + a(t(false), 'false', "Booelean"); + a(t(fn), String(fn), "Function"); + + a(t(/raz-dwa/g), '/raz-dwa/g', "RegExp"); + a(t(new Date(1234567)), 'new Date(1234567)', "Date"); + a(t([]), '[]', "Empty array"); + a(t([undefined, false, null, 'raz"ddwa\ntrzy', fn, /raz/g, new Date(1234567), ['foo']]), + '[undefined,false,null,"raz\\"ddwa\\ntrzy",' + String(fn) + + ',/raz/g,new Date(1234567),["foo"]]', "Rich Array"); + a(t({}), '{}', "Empty object"); + a(t({ raz: undefined, dwa: false, trzy: null, cztery: 'raz"ddwa\ntrzy', piec: fn, szesc: /raz/g, + siedem: new Date(1234567), osiem: ['foo', 32], dziewiec: { foo: 'bar', dwa: 343 } }), + '{"raz":undefined,"dwa":false,"trzy":null,"cztery":"raz\\"ddwa\\ntrzy","piec":' + String(fn) + + ',"szesc":/raz/g,"siedem":new Date(1234567),"osiem":["foo",32],' + + '"dziewiec":{"foo":"bar","dwa":343}}', "Rich object"); +}; diff --git a/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/test/object/unserialize.js b/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/test/object/unserialize.js new file mode 100644 index 0000000..405eef1 --- /dev/null +++ b/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/test/object/unserialize.js @@ -0,0 +1,24 @@ +'use strict'; + +module.exports = function (t, a) { + var fn = function (raz, dwa) { return raz + dwa; }; + a(t('undefined'), undefined, "Undefined"); + a(t('null'), null, "Null"); + a(t('"raz"'), 'raz', "String"); + a(t('"raz\\"ddwa\\ntrzy"'), 'raz"ddwa\ntrzy', "String with escape"); + a(t('false'), false, "Booelean"); + a(String(t(String(fn))), String(fn), "Function"); + + a.deep(t('/raz-dwa/g'), /raz-dwa/g, "RegExp"); + a.deep(t('new Date(1234567)'), new Date(1234567), "Date"); + a.deep(t('[]'), [], "Empty array"); + a.deep(t('[undefined,false,null,"raz\\"ddwa\\ntrzy",/raz/g,new Date(1234567),["foo"]]'), + [undefined, false, null, 'raz"ddwa\ntrzy', /raz/g, new Date(1234567), ['foo']], "Rich Array"); + a.deep(t('{}'), {}, "Empty object"); + a.deep(t('{"raz":undefined,"dwa":false,"trzy":null,"cztery":"raz\\"ddwa\\ntrzy",' + + '"szesc":/raz/g,"siedem":new Date(1234567),"osiem":["foo",32],' + + '"dziewiec":{"foo":"bar","dwa":343}}'), + { raz: undefined, dwa: false, trzy: null, cztery: 'raz"ddwa\ntrzy', szesc: /raz/g, + siedem: new Date(1234567), osiem: ['foo', 32], dziewiec: { foo: 'bar', dwa: 343 } }, + "Rich object"); +}; diff --git a/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/test/object/valid-object.js b/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/test/object/valid-object.js index dd73246..eaa8e7b 100644 --- a/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/test/object/valid-object.js +++ b/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/test/object/valid-object.js @@ -7,7 +7,7 @@ module.exports = function (t, a) { a.throws(function () { t(''); }, TypeError, "''"); a(t(x = {}), x, "Object"); a(t(x = function () {}), x, "Function"); - a(t(x = new String('raz')), x, "String object"); //jslint: skip + a(t(x = new String('raz')), x, "String object"); //jslint: ignore a(t(x = new Date()), x, "Date"); a.throws(function () { t(); }, TypeError, "Undefined"); diff --git a/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/test/string/#/at.js b/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/test/string/#/at.js index 487716c..2447a9f 100644 --- a/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/test/string/#/at.js +++ b/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/test/string/#/at.js @@ -93,5 +93,5 @@ module.exports = function (t, a) { a.throws(function () { t.call(null, 4); }, TypeError, "Null + argument"); a(t.call(42, 0), '4', "Number #1"); a(t.call(42, 1), '2', "Number #2"); - a(t.call({ 'toString': function () { return 'abc'; } }, 2), 'c', "Object"); + a(t.call({ toString: function () { return 'abc'; } }, 2), 'c', "Object"); }; diff --git a/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/test/string/#/camel-to-hyphen.js b/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/test/string/#/camel-to-hyphen.js index f30d423..606c616 100644 --- a/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/test/string/#/camel-to-hyphen.js +++ b/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/test/string/#/camel-to-hyphen.js @@ -1,5 +1,5 @@ 'use strict'; module.exports = function (t, a) { - a(t.call('razDwaTRzy4y'), 'raz-dwa-trzy4y'); + a(t.call('razDwaTRzy4yFoo45My'), 'raz-dwa-trzy4y-foo45-my'); }; diff --git a/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/test/string/#/code-point-at/shim.js b/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/test/string/#/code-point-at/shim.js index 778b603..0df4751 100644 --- a/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/test/string/#/code-point-at/shim.js +++ b/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/test/string/#/code-point-at/shim.js @@ -69,7 +69,7 @@ module.exports = function (t, a) { a.throws(function () { t.call(null, 4); }, TypeError); a(t.call(42, 0), 0x34); a(t.call(42, 1), 0x32); - a(t.call({ 'toString': function () { return 'abc'; } }, 2), 0x63); + a(t.call({ toString: function () { return 'abc'; } }, 2), 0x63); a.throws(function () { t.apply(undefined); }, TypeError); a.throws(function () { t.apply(undefined, [4]); }, TypeError); @@ -77,5 +77,5 @@ module.exports = function (t, a) { a.throws(function () { t.apply(null, [4]); }, TypeError); a(t.apply(42, [0]), 0x34); a(t.apply(42, [1]), 0x32); - a(t.apply({ 'toString': function () { return 'abc'; } }, [2]), 0x63); + a(t.apply({ toString: function () { return 'abc'; } }, [2]), 0x63); }; diff --git a/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/test/string/#/hyphen-to-camel.js b/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/test/string/#/hyphen-to-camel.js index a84d988..bd7ded4 100644 --- a/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/test/string/#/hyphen-to-camel.js +++ b/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/test/string/#/hyphen-to-camel.js @@ -1,5 +1,5 @@ 'use strict'; module.exports = function (t, a) { - a(t.call('raz-dwa-t-rzy-4y'), 'razDwaTRzy4y'); + a(t.call('raz-dwa-t-rzy-4y-rtr4-tiu-45-pa'), 'razDwaTRzy4yRtr4Tiu45Pa'); }; diff --git a/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/test/string/#/pad.js b/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/test/string/#/pad.js index c142267..28c3fca 100644 --- a/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/test/string/#/pad.js +++ b/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/test/string/#/pad.js @@ -3,7 +3,7 @@ var partial = require('../../../function/#/partial'); module.exports = { - "Left": function (t, a) { + Left: function (t, a) { t = partial.call(t, 'x', 5); a(t.call('yy'), 'xxxyy'); @@ -12,7 +12,7 @@ module.exports = { a(t.call('yyyyy'), 'yyyyy', 'Equal length'); a(t.call('yyyyyyy'), 'yyyyyyy', 'Longer'); }, - "Right": function (t, a) { + Right: function (t, a) { t = partial.call(t, 'x', -5); a(t.call('yy'), 'yyxxx'); diff --git a/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/test/string/random-uniq.js b/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/test/string/random-uniq.js new file mode 100644 index 0000000..6791ac2 --- /dev/null +++ b/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/es5-ext/test/string/random-uniq.js @@ -0,0 +1,14 @@ +'use strict'; + +var isValidFormat = RegExp.prototype.test.bind(/^[a-z0-9]+$/); + +module.exports = function (t, a) { + a(typeof t(), 'string'); + a.ok(t().length > 7); + a.not(t(), t()); + a.ok(isValidFormat(t())); + a.ok(isValidFormat(t())); + a.ok(isValidFormat(t())); + a.ok(isValidFormat(t())); + a.ok(isValidFormat(t())); +}; diff --git a/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/memoizee/node_modules/es6-weak-map/node_modules/es6-iterator/.travis.yml b/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/memoizee/node_modules/es6-weak-map/node_modules/es6-iterator/.travis.yml index eab5f5d..02c277c 100644 --- a/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/memoizee/node_modules/es6-weak-map/node_modules/es6-iterator/.travis.yml +++ b/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/memoizee/node_modules/es6-weak-map/node_modules/es6-iterator/.travis.yml @@ -7,3 +7,5 @@ node_js: notifications: email: - medikoo+es6-iterator@medikoo.com + +script: "npm test && npm run lint" diff --git a/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/memoizee/node_modules/es6-weak-map/node_modules/es6-iterator/CHANGES b/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/memoizee/node_modules/es6-weak-map/node_modules/es6-iterator/CHANGES index 473a66d..a2d1ec7 100644 --- a/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/memoizee/node_modules/es6-weak-map/node_modules/es6-iterator/CHANGES +++ b/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/memoizee/node_modules/es6-weak-map/node_modules/es6-iterator/CHANGES @@ -1,4 +1,14 @@ -v0.1.1 -- 2014.04.29 +v0.1.3 -- 2015.02.02 +* Update dependencies +* Fix spelling of LICENSE + +v0.1.2 -- 2014.11.19 +* Optimise internal `_next` to not verify internal's list length at all times + (#2 thanks @RReverser) +* Fix documentation examples +* Configure lint scripts + +v0.1.1 -- 2014.04.29 * Fix es6-symbol dependency version v0.1.0 -- 2014.04.29 diff --git a/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/memoizee/node_modules/es6-weak-map/node_modules/es6-iterator/LICENCE b/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/memoizee/node_modules/es6-weak-map/node_modules/es6-iterator/LICENCE deleted file mode 100644 index aaf3528..0000000 --- a/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/memoizee/node_modules/es6-weak-map/node_modules/es6-iterator/LICENCE +++ /dev/null @@ -1,19 +0,0 @@ -Copyright (C) 2013 Mariusz Nowak (www.medikoo.com) - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/memoizee/node_modules/es6-weak-map/node_modules/es6-iterator/LICENSE b/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/memoizee/node_modules/es6-weak-map/node_modules/es6-iterator/LICENSE new file mode 100644 index 0000000..04724a3 --- /dev/null +++ b/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/memoizee/node_modules/es6-weak-map/node_modules/es6-iterator/LICENSE @@ -0,0 +1,19 @@ +Copyright (C) 2013-2015 Mariusz Nowak (www.medikoo.com) + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/memoizee/node_modules/es6-weak-map/node_modules/es6-iterator/README.md b/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/memoizee/node_modules/es6-weak-map/node_modules/es6-iterator/README.md index f1218a1..288373d 100644 --- a/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/memoizee/node_modules/es6-weak-map/node_modules/es6-iterator/README.md +++ b/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/memoizee/node_modules/es6-weak-map/node_modules/es6-iterator/README.md @@ -25,7 +25,7 @@ var iterator = new Iterator([1, 2, 3]); iterator.next(); // { value: 1, done: false } iterator.next(); // { value: 2, done: false } -iterator.next(); // { value: 3, done: true } +iterator.next(); // { value: 3, done: false } iterator.next(); // { value: undefined, done: true } ``` @@ -44,7 +44,7 @@ var iterator = new ArrayIterator([1, 2, 3], 'key+value'); iterator.next(); // { value: [0, 1], done: false } iterator.next(); // { value: [1, 2], done: false } -iterator.next(); // { value: [2, 3], done: true } +iterator.next(); // { value: [2, 3], done: false } iterator.next(); // { value: undefined, done: true } ``` @@ -56,7 +56,7 @@ May also be used for _arguments_ objects: iterator.next(); // { value: 1, done: false } iterator.next(); // { value: 2, done: false } - iterator.next(); // { value: 3, done: true } + iterator.next(); // { value: 3, done: false } iterator.next(); // { value: undefined, done: true } }(1, 2, 3)); ``` @@ -75,7 +75,7 @@ iterator.next(); // { value: '🙈', done: false } iterator.next(); // { value: 'o', done: false } iterator.next(); // { value: '🙉', done: false } iterator.next(); // { value: 'o', done: false } -iterator.next(); // { value: '🙊', done: true } +iterator.next(); // { value: '🙊', done: false } iterator.next(); // { value: undefined, done: true } ``` @@ -115,7 +115,7 @@ var iterator = get([1,2,3]); iterator.next(); // { value: 1, done: false } iterator.next(); // { value: 2, done: false } -iterator.next(); // { value: 3, done: true } +iterator.next(); // { value: 3, done: false } iterator.next(); // { value: undefined, done: true } ``` diff --git a/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/memoizee/node_modules/es6-weak-map/node_modules/es6-iterator/index.js b/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/memoizee/node_modules/es6-weak-map/node_modules/es6-iterator/index.js index d33910d..10fd089 100644 --- a/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/memoizee/node_modules/es6-weak-map/node_modules/es6-iterator/index.js +++ b/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/memoizee/node_modules/es6-weak-map/node_modules/es6-iterator/index.js @@ -1,7 +1,6 @@ 'use strict'; var clear = require('es5-ext/array/#/clear') - , toPosInt = require('es5-ext/number/to-pos-integer') , assign = require('es5-ext/object/assign') , callable = require('es5-ext/object/valid-callable') , value = require('es5-ext/object/valid-value') @@ -30,14 +29,13 @@ module.exports = Iterator = function (list, context) { defineProperties(Iterator.prototype, assign({ constructor: d(Iterator), _next: d(function () { - var i, l; + var i; if (!this.__list__) return; if (this.__redo__) { i = this.__redo__.shift(); if (i !== undefined) return i; } - l = toPosInt(this.__list__.length); - if (this.__nextIndex__ < l) return this.__nextIndex__++; + if (this.__nextIndex__ < this.__list__.length) return this.__nextIndex__++; this._unBind(); }), next: d(function () { return this._createResult(this._next()); }), diff --git a/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/memoizee/node_modules/es6-weak-map/node_modules/es6-iterator/node_modules/es6-symbol/.lint b/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/memoizee/node_modules/es6-weak-map/node_modules/es6-iterator/node_modules/es6-symbol/.lint new file mode 100644 index 0000000..1851752 --- /dev/null +++ b/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/memoizee/node_modules/es6-weak-map/node_modules/es6-iterator/node_modules/es6-symbol/.lint @@ -0,0 +1,13 @@ +@root + +module + +tabs +indent 2 +maxlen 100 + +ass +nomen +plusplus +newcap +vars diff --git a/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/memoizee/node_modules/es6-weak-map/node_modules/es6-iterator/node_modules/es6-symbol/.npmignore b/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/memoizee/node_modules/es6-weak-map/node_modules/es6-iterator/node_modules/es6-symbol/.npmignore new file mode 100644 index 0000000..155e41f --- /dev/null +++ b/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/memoizee/node_modules/es6-weak-map/node_modules/es6-iterator/node_modules/es6-symbol/.npmignore @@ -0,0 +1,4 @@ +.DS_Store +/node_modules +/npm-debug.log +/.lintcache diff --git a/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/memoizee/node_modules/es6-weak-map/node_modules/es6-iterator/node_modules/es6-symbol/.travis.yml b/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/memoizee/node_modules/es6-weak-map/node_modules/es6-iterator/node_modules/es6-symbol/.travis.yml new file mode 100644 index 0000000..afd3509 --- /dev/null +++ b/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/memoizee/node_modules/es6-weak-map/node_modules/es6-iterator/node_modules/es6-symbol/.travis.yml @@ -0,0 +1,9 @@ +language: node_js +node_js: + - 0.8 + - 0.10 + - 0.11 + +notifications: + email: + - medikoo+es6-symbol@medikoo.com diff --git a/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/memoizee/node_modules/es6-weak-map/node_modules/es6-iterator/node_modules/es6-symbol/CHANGES b/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/memoizee/node_modules/es6-weak-map/node_modules/es6-iterator/node_modules/es6-symbol/CHANGES new file mode 100644 index 0000000..df8c27e --- /dev/null +++ b/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/memoizee/node_modules/es6-weak-map/node_modules/es6-iterator/node_modules/es6-symbol/CHANGES @@ -0,0 +1,34 @@ +v2.0.1 -- 2015.01.28 +* Fix Symbol.prototype[Symbol.isPrimitive] implementation +* Improve validation within Symbol.prototype.toString and + Symbol.prototype.valueOf + +v2.0.0 -- 2015.01.28 +* Update up to changes in specification: + * Implement `for` and `keyFor` + * Remove `Symbol.create` and `Symbol.isRegExp` + * Add `Symbol.match`, `Symbol.replace`, `Symbol.search`, `Symbol.species` and + `Symbol.split` +* Rename `validSymbol` to `validateSymbol` +* Improve documentation +* Remove dead test modules + +v1.0.0 -- 2015.01.26 +* Fix enumerability for symbol properties set normally (e.g. obj[symbol] = value) +* Introduce initialization via hidden constructor +* Fix isSymbol handling of polyfill values when native Symbol is present +* Fix spelling of LICENSE +* Configure lint scripts + +v0.1.1 -- 2014.10.07 +* Fix isImplemented, so it returns true in case of polyfill +* Improve documentations + +v0.1.0 -- 2014.04.28 +* Assure strictly npm dependencies +* Update to use latest versions of dependencies +* Fix implementation detection so it doesn't crash on `String(symbol)` +* throw on `new Symbol()` (as decided by TC39) + +v0.0.0 -- 2013.11.15 +* Initial (dev) version \ No newline at end of file diff --git a/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/memoizee/node_modules/es6-weak-map/node_modules/es6-iterator/node_modules/es6-symbol/LICENSE b/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/memoizee/node_modules/es6-weak-map/node_modules/es6-iterator/node_modules/es6-symbol/LICENSE new file mode 100644 index 0000000..04724a3 --- /dev/null +++ b/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/memoizee/node_modules/es6-weak-map/node_modules/es6-iterator/node_modules/es6-symbol/LICENSE @@ -0,0 +1,19 @@ +Copyright (C) 2013-2015 Mariusz Nowak (www.medikoo.com) + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/memoizee/node_modules/es6-weak-map/node_modules/es6-iterator/node_modules/es6-symbol/README.md b/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/memoizee/node_modules/es6-weak-map/node_modules/es6-iterator/node_modules/es6-symbol/README.md new file mode 100644 index 0000000..95d6780 --- /dev/null +++ b/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/memoizee/node_modules/es6-weak-map/node_modules/es6-iterator/node_modules/es6-symbol/README.md @@ -0,0 +1,71 @@ +# es6-symbol +## ECMAScript 6 Symbol polyfill + +For more information about symbols see following links +- [Symbols in ECMAScript 6 by Axel Rauschmayer](http://www.2ality.com/2014/12/es6-symbols.html) +- [MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Symbol) +- [Specification](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-symbol-constructor) + +### Limitations + +Underneath it uses real string property names which can easily be retrieved, however accidental collision with other property names is unlikely. + +### Usage + +If you'd like to use native version when it exists and fallback to polyfill if it doesn't (but without implementing `Symbol` on global scope), do: + +```javascript +var Symbol = require('es6-symbol'); +``` + +If you want to make sure your environment implements `Symbol`, do: + +```javascript +require('es6-symbol/implement'); +``` + +If you strictly want to use polyfill even if native `Symbol` exists (hard to find a good reason for that), do: + +```javascript +var Symbol = require('es6-symbol/polyfill'); +``` + +#### API + +Best is to refer to [specification](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-symbol-objects). Still if you want quick look, follow examples: + +```javascript +var Symbol = require('es6-symbol'); + +var symbol = Symbol('My custom symbol'); +var x = {}; + +x[symbol] = 'foo'; +console.log(x[symbol]); 'foo' + +// Detect iterable: +var iterator, result; +if (possiblyIterable[Symbol.iterator]) { + iterator = possiblyIterable[Symbol.iterator](); + result = iterator.next(); + while(!result.done) { + console.log(result.value); + result = iterator.next(); + } +} +``` + +### Installation +#### NPM + +In your project path: + + $ npm install es6-symbol + +##### Browser + +To port it to Browser or any other (non CJS) environment, use your favorite CJS bundler. No favorite yet? Try: [Browserify](http://browserify.org/), [Webmake](https://github.com/medikoo/modules-webmake) or [Webpack](http://webpack.github.io/) + +## Tests [![Build Status](https://travis-ci.org/medikoo/es6-symbol.png)](https://travis-ci.org/medikoo/es6-symbol) + + $ npm test diff --git a/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/memoizee/node_modules/es6-weak-map/node_modules/es6-iterator/node_modules/es6-symbol/implement.js b/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/memoizee/node_modules/es6-weak-map/node_modules/es6-iterator/node_modules/es6-symbol/implement.js new file mode 100644 index 0000000..153edac --- /dev/null +++ b/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/memoizee/node_modules/es6-weak-map/node_modules/es6-iterator/node_modules/es6-symbol/implement.js @@ -0,0 +1,7 @@ +'use strict'; + +if (!require('./is-implemented')()) { + Object.defineProperty(require('es5-ext/global'), 'Symbol', + { value: require('./polyfill'), configurable: true, enumerable: false, + writable: true }); +} diff --git a/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/memoizee/node_modules/es6-weak-map/node_modules/es6-iterator/node_modules/es6-symbol/index.js b/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/memoizee/node_modules/es6-weak-map/node_modules/es6-iterator/node_modules/es6-symbol/index.js new file mode 100644 index 0000000..609f1fa --- /dev/null +++ b/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/memoizee/node_modules/es6-weak-map/node_modules/es6-iterator/node_modules/es6-symbol/index.js @@ -0,0 +1,3 @@ +'use strict'; + +module.exports = require('./is-implemented')() ? Symbol : require('./polyfill'); diff --git a/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/memoizee/node_modules/es6-weak-map/node_modules/es6-iterator/node_modules/es6-symbol/is-implemented.js b/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/memoizee/node_modules/es6-weak-map/node_modules/es6-iterator/node_modules/es6-symbol/is-implemented.js new file mode 100644 index 0000000..53759f3 --- /dev/null +++ b/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/memoizee/node_modules/es6-weak-map/node_modules/es6-iterator/node_modules/es6-symbol/is-implemented.js @@ -0,0 +1,18 @@ +'use strict'; + +module.exports = function () { + var symbol; + if (typeof Symbol !== 'function') return false; + symbol = Symbol('test symbol'); + try { String(symbol); } catch (e) { return false; } + if (typeof Symbol.iterator === 'symbol') return true; + + // Return 'true' for polyfills + if (typeof Symbol.isConcatSpreadable !== 'object') return false; + if (typeof Symbol.iterator !== 'object') return false; + if (typeof Symbol.toPrimitive !== 'object') return false; + if (typeof Symbol.toStringTag !== 'object') return false; + if (typeof Symbol.unscopables !== 'object') return false; + + return true; +}; diff --git a/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/memoizee/node_modules/es6-weak-map/node_modules/es6-iterator/node_modules/es6-symbol/is-native-implemented.js b/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/memoizee/node_modules/es6-weak-map/node_modules/es6-iterator/node_modules/es6-symbol/is-native-implemented.js new file mode 100644 index 0000000..a8cb8b8 --- /dev/null +++ b/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/memoizee/node_modules/es6-weak-map/node_modules/es6-iterator/node_modules/es6-symbol/is-native-implemented.js @@ -0,0 +1,8 @@ +// Exports true if environment provides native `Symbol` implementation + +'use strict'; + +module.exports = (function () { + if (typeof Symbol !== 'function') return false; + return (typeof Symbol.iterator === 'symbol'); +}()); diff --git a/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/memoizee/node_modules/es6-weak-map/node_modules/es6-iterator/node_modules/es6-symbol/is-symbol.js b/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/memoizee/node_modules/es6-weak-map/node_modules/es6-iterator/node_modules/es6-symbol/is-symbol.js new file mode 100644 index 0000000..beeba2c --- /dev/null +++ b/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/memoizee/node_modules/es6-weak-map/node_modules/es6-iterator/node_modules/es6-symbol/is-symbol.js @@ -0,0 +1,5 @@ +'use strict'; + +module.exports = function (x) { + return (x && ((typeof x === 'symbol') || (x['@@toStringTag'] === 'Symbol'))) || false; +}; diff --git a/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/memoizee/node_modules/es6-weak-map/node_modules/es6-iterator/node_modules/es6-symbol/package.json b/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/memoizee/node_modules/es6-weak-map/node_modules/es6-iterator/node_modules/es6-symbol/package.json new file mode 100644 index 0000000..aaada6a --- /dev/null +++ b/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/memoizee/node_modules/es6-weak-map/node_modules/es6-iterator/node_modules/es6-symbol/package.json @@ -0,0 +1,63 @@ +{ + "name": "es6-symbol", + "version": "2.0.1", + "description": "ECMAScript6 Symbol polyfill", + "author": { + "name": "Mariusz Nowak", + "email": "medyk@medikoo.com", + "url": "http://www.medikoo.com/" + }, + "keywords": [ + "symbol", + "private", + "property", + "es6", + "ecmascript", + "harmony" + ], + "repository": { + "type": "git", + "url": "git://github.com/medikoo/es6-symbol.git" + }, + "dependencies": { + "d": "~0.1.1", + "es5-ext": "~0.10.5" + }, + "devDependencies": { + "tad": "~0.2.1", + "xlint": "~0.2.2", + "xlint-jslint-medikoo": "~0.1.2" + }, + "scripts": { + "lint": "node node_modules/xlint/bin/xlint --linter=node_modules/xlint-jslint-medikoo/index.js --no-cache --no-stream", + "lint-console": "node node_modules/xlint/bin/xlint --linter=node_modules/xlint-jslint-medikoo/index.js --watch", + "test": "node ./node_modules/tad/bin/tad" + }, + "license": "MIT", + "gitHead": "51f6938d7830269fefa38f02eb912f5472b3ccd7", + "bugs": { + "url": "https://github.com/medikoo/es6-symbol/issues" + }, + "homepage": "https://github.com/medikoo/es6-symbol", + "_id": "es6-symbol@2.0.1", + "_shasum": "761b5c67cfd4f1d18afb234f691d678682cb3bf3", + "_from": "es6-symbol@~2.0.1", + "_npmVersion": "1.4.28", + "_npmUser": { + "name": "medikoo", + "email": "medikoo+npm@medikoo.com" + }, + "maintainers": [ + { + "name": "medikoo", + "email": "medikoo+npm@medikoo.com" + } + ], + "dist": { + "shasum": "761b5c67cfd4f1d18afb234f691d678682cb3bf3", + "tarball": "http://registry.npmjs.org/es6-symbol/-/es6-symbol-2.0.1.tgz" + }, + "directories": {}, + "_resolved": "https://registry.npmjs.org/es6-symbol/-/es6-symbol-2.0.1.tgz", + "readme": "ERROR: No README data found!" +} diff --git a/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/memoizee/node_modules/es6-weak-map/node_modules/es6-iterator/node_modules/es6-symbol/polyfill.js b/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/memoizee/node_modules/es6-weak-map/node_modules/es6-iterator/node_modules/es6-symbol/polyfill.js new file mode 100644 index 0000000..735eb67 --- /dev/null +++ b/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/memoizee/node_modules/es6-weak-map/node_modules/es6-iterator/node_modules/es6-symbol/polyfill.js @@ -0,0 +1,77 @@ +'use strict'; + +var d = require('d') + , validateSymbol = require('./validate-symbol') + + , create = Object.create, defineProperties = Object.defineProperties + , defineProperty = Object.defineProperty, objPrototype = Object.prototype + , Symbol, HiddenSymbol, globalSymbols = create(null); + +var generateName = (function () { + var created = create(null); + return function (desc) { + var postfix = 0, name; + while (created[desc + (postfix || '')]) ++postfix; + desc += (postfix || ''); + created[desc] = true; + name = '@@' + desc; + defineProperty(objPrototype, name, d.gs(null, function (value) { + defineProperty(this, name, d(value)); + })); + return name; + }; +}()); + +HiddenSymbol = function Symbol(description) { + if (this instanceof HiddenSymbol) throw new TypeError('TypeError: Symbol is not a constructor'); + return Symbol(description); +}; +module.exports = Symbol = function Symbol(description) { + var symbol; + if (this instanceof Symbol) throw new TypeError('TypeError: Symbol is not a constructor'); + symbol = create(HiddenSymbol.prototype); + description = (description === undefined ? '' : String(description)); + return defineProperties(symbol, { + __description__: d('', description), + __name__: d('', generateName(description)) + }); +}; +defineProperties(Symbol, { + for: d(function (key) { + if (globalSymbols[key]) return globalSymbols[key]; + return (globalSymbols[key] = Symbol(String(key))); + }), + keyFor: d(function (s) { + var key; + validateSymbol(s); + for (key in globalSymbols) if (globalSymbols[key] === s) return key; + }), + hasInstance: d('', Symbol('hasInstance')), + isConcatSpreadable: d('', Symbol('isConcatSpreadable')), + iterator: d('', Symbol('iterator')), + match: d('', Symbol('match')), + replace: d('', Symbol('replace')), + search: d('', Symbol('search')), + species: d('', Symbol('species')), + split: d('', Symbol('split')), + toPrimitive: d('', Symbol('toPrimitive')), + toStringTag: d('', Symbol('toStringTag')), + unscopables: d('', Symbol('unscopables')) +}); +defineProperties(HiddenSymbol.prototype, { + constructor: d(Symbol), + toString: d('', function () { return this.__name__; }) +}); + +defineProperties(Symbol.prototype, { + toString: d(function () { return 'Symbol (' + validateSymbol(this).__description__ + ')'; }), + valueOf: d(function () { return validateSymbol(this); }) +}); +defineProperty(Symbol.prototype, Symbol.toPrimitive, d('', + function () { return validateSymbol(this); })); +defineProperty(Symbol.prototype, Symbol.toStringTag, d('c', 'Symbol')); + +defineProperty(HiddenSymbol.prototype, Symbol.toPrimitive, + d('c', Symbol.prototype[Symbol.toPrimitive])); +defineProperty(HiddenSymbol.prototype, Symbol.toStringTag, + d('c', Symbol.prototype[Symbol.toStringTag])); diff --git a/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/memoizee/node_modules/es6-weak-map/node_modules/es6-iterator/node_modules/es6-symbol/test/implement.js b/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/memoizee/node_modules/es6-weak-map/node_modules/es6-iterator/node_modules/es6-symbol/test/implement.js new file mode 100644 index 0000000..eb35c30 --- /dev/null +++ b/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/memoizee/node_modules/es6-weak-map/node_modules/es6-iterator/node_modules/es6-symbol/test/implement.js @@ -0,0 +1,3 @@ +'use strict'; + +module.exports = function (t, a) { a(typeof Symbol, 'function'); }; diff --git a/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/memoizee/node_modules/es6-weak-map/node_modules/es6-iterator/node_modules/es6-symbol/test/index.js b/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/memoizee/node_modules/es6-weak-map/node_modules/es6-iterator/node_modules/es6-symbol/test/index.js new file mode 100644 index 0000000..62b3296 --- /dev/null +++ b/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/memoizee/node_modules/es6-weak-map/node_modules/es6-iterator/node_modules/es6-symbol/test/index.js @@ -0,0 +1,12 @@ +'use strict'; + +var d = require('d') + + , defineProperty = Object.defineProperty; + +module.exports = function (T, a) { + var symbol = T('test'), x = {}; + defineProperty(x, symbol, d('foo')); + a(x.test, undefined, "Name"); + a(x[symbol], 'foo', "Get"); +}; diff --git a/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/memoizee/node_modules/es6-weak-map/node_modules/es6-iterator/node_modules/es6-symbol/test/is-implemented.js b/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/memoizee/node_modules/es6-weak-map/node_modules/es6-iterator/node_modules/es6-symbol/test/is-implemented.js new file mode 100644 index 0000000..bb0d645 --- /dev/null +++ b/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/memoizee/node_modules/es6-weak-map/node_modules/es6-iterator/node_modules/es6-symbol/test/is-implemented.js @@ -0,0 +1,14 @@ +'use strict'; + +var global = require('es5-ext/global') + , polyfill = require('../polyfill'); + +module.exports = function (t, a) { + var cache; + a(typeof t(), 'boolean'); + cache = global.Symbol; + global.Symbol = polyfill; + a(t(), true); + if (cache === undefined) delete global.Symbol; + else global.Symbol = cache; +}; diff --git a/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/memoizee/node_modules/es6-weak-map/node_modules/es6-iterator/node_modules/es6-symbol/test/is-native-implemented.js b/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/memoizee/node_modules/es6-weak-map/node_modules/es6-iterator/node_modules/es6-symbol/test/is-native-implemented.js new file mode 100644 index 0000000..df8ba03 --- /dev/null +++ b/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/memoizee/node_modules/es6-weak-map/node_modules/es6-iterator/node_modules/es6-symbol/test/is-native-implemented.js @@ -0,0 +1,3 @@ +'use strict'; + +module.exports = function (t, a) { a(typeof t, 'boolean'); }; diff --git a/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/memoizee/node_modules/es6-weak-map/node_modules/es6-iterator/node_modules/es6-symbol/test/is-symbol.js b/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/memoizee/node_modules/es6-weak-map/node_modules/es6-iterator/node_modules/es6-symbol/test/is-symbol.js new file mode 100644 index 0000000..ac24b9a --- /dev/null +++ b/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/memoizee/node_modules/es6-weak-map/node_modules/es6-iterator/node_modules/es6-symbol/test/is-symbol.js @@ -0,0 +1,16 @@ +'use strict'; + +var SymbolPoly = require('../polyfill'); + +module.exports = function (t, a) { + a(t(undefined), false, "Undefined"); + a(t(null), false, "Null"); + a(t(true), false, "Primitive"); + a(t('raz'), false, "String"); + a(t({}), false, "Object"); + a(t([]), false, "Array"); + if (typeof Symbol !== 'undefined') { + a(t(Symbol()), true, "Native"); + } + a(t(SymbolPoly()), true, "Polyfill"); +}; diff --git a/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/memoizee/node_modules/es6-weak-map/node_modules/es6-iterator/node_modules/es6-symbol/test/polyfill.js b/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/memoizee/node_modules/es6-weak-map/node_modules/es6-iterator/node_modules/es6-symbol/test/polyfill.js new file mode 100644 index 0000000..83fb5e9 --- /dev/null +++ b/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/memoizee/node_modules/es6-weak-map/node_modules/es6-iterator/node_modules/es6-symbol/test/polyfill.js @@ -0,0 +1,27 @@ +'use strict'; + +var d = require('d') + , isSymbol = require('../is-symbol') + + , defineProperty = Object.defineProperty; + +module.exports = function (T, a) { + var symbol = T('test'), x = {}; + defineProperty(x, symbol, d('foo')); + a(x.test, undefined, "Name"); + a(x[symbol], 'foo', "Get"); + a(x instanceof T, false); + + a(isSymbol(symbol), true, "Symbol"); + a(isSymbol(T.iterator), true, "iterator"); + a(isSymbol(T.toStringTag), true, "toStringTag"); + + x = {}; + x[symbol] = 'foo'; + a.deep(Object.getOwnPropertyDescriptor(x, symbol), { configurable: true, enumerable: false, + value: 'foo', writable: true }); + symbol = T.for('marko'); + a(isSymbol(symbol), true); + a(T.for('marko'), symbol); + a(T.keyFor(symbol), 'marko'); +}; diff --git a/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/memoizee/node_modules/es6-weak-map/node_modules/es6-iterator/node_modules/es6-symbol/test/validate-symbol.js b/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/memoizee/node_modules/es6-weak-map/node_modules/es6-iterator/node_modules/es6-symbol/test/validate-symbol.js new file mode 100644 index 0000000..2c8f84c --- /dev/null +++ b/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/memoizee/node_modules/es6-weak-map/node_modules/es6-iterator/node_modules/es6-symbol/test/validate-symbol.js @@ -0,0 +1,19 @@ +'use strict'; + +var SymbolPoly = require('../polyfill'); + +module.exports = function (t, a) { + var symbol; + a.throws(function () { t(undefined); }, TypeError, "Undefined"); + a.throws(function () { t(null); }, TypeError, "Null"); + a.throws(function () { t(true); }, TypeError, "Primitive"); + a.throws(function () { t('raz'); }, TypeError, "String"); + a.throws(function () { t({}); }, TypeError, "Object"); + a.throws(function () { t([]); }, TypeError, "Array"); + if (typeof Symbol !== 'undefined') { + symbol = Symbol(); + a(t(symbol), symbol, "Native"); + } + symbol = SymbolPoly(); + a(t(symbol), symbol, "Polyfill"); +}; diff --git a/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/memoizee/node_modules/es6-weak-map/node_modules/es6-iterator/node_modules/es6-symbol/validate-symbol.js b/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/memoizee/node_modules/es6-weak-map/node_modules/es6-iterator/node_modules/es6-symbol/validate-symbol.js new file mode 100644 index 0000000..4275004 --- /dev/null +++ b/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/memoizee/node_modules/es6-weak-map/node_modules/es6-iterator/node_modules/es6-symbol/validate-symbol.js @@ -0,0 +1,8 @@ +'use strict'; + +var isSymbol = require('./is-symbol'); + +module.exports = function (value) { + if (!isSymbol(value)) throw new TypeError(value + " is not a symbol"); + return value; +}; diff --git a/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/memoizee/node_modules/es6-weak-map/node_modules/es6-iterator/package.json b/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/memoizee/node_modules/es6-weak-map/node_modules/es6-iterator/package.json index e81aedc..79fe19f 100644 --- a/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/memoizee/node_modules/es6-weak-map/node_modules/es6-iterator/package.json +++ b/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/memoizee/node_modules/es6-weak-map/node_modules/es6-iterator/package.json @@ -1,6 +1,6 @@ { "name": "es6-iterator", - "version": "0.1.1", + "version": "0.1.3", "description": "Iterator abstraction based on ES6 specification", "author": { "name": "Mariusz Nowak", @@ -21,28 +21,31 @@ }, "dependencies": { "d": "~0.1.1", - "es5-ext": "~0.10.2", - "es6-symbol": "0.1.x" + "es5-ext": "~0.10.5", + "es6-symbol": "~2.0.1" }, "devDependencies": { - "event-emitter": "~0.3.1", - "tad": "0.2.x" + "event-emitter": "~0.3.3", + "tad": "~0.2.1", + "xlint": "~0.2.2", + "xlint-jslint-medikoo": "~0.1.2" }, "scripts": { + "lint": "node node_modules/xlint/bin/xlint --linter=node_modules/xlint-jslint-medikoo/index.js --no-cache --no-stream", + "lint-console": "node node_modules/xlint/bin/xlint --linter=node_modules/xlint-jslint-medikoo/index.js --watch", "test": "node ./node_modules/tad/bin/tad" }, "license": "MIT", + "gitHead": "2addc362c6f139e4941cf4726eeb59e5960c5cef", "bugs": { "url": "https://github.com/medikoo/es6-iterator/issues" }, "homepage": "https://github.com/medikoo/es6-iterator", - "_id": "es6-iterator@0.1.1", - "dist": { - "shasum": "5e136c899aa1c26296414f90859b73934812d275", - "tarball": "http://registry.npmjs.org/es6-iterator/-/es6-iterator-0.1.1.tgz" - }, + "_id": "es6-iterator@0.1.3", + "_shasum": "d6f58b8c4fc413c249b4baa19768f8e4d7c8944e", "_from": "es6-iterator@~0.1.1", - "_npmVersion": "1.4.3", + "_npmVersion": "2.3.0", + "_nodeVersion": "0.11.16", "_npmUser": { "name": "medikoo", "email": "medikoo+npm@medikoo.com" @@ -53,8 +56,11 @@ "email": "medikoo+npm@medikoo.com" } ], + "dist": { + "shasum": "d6f58b8c4fc413c249b4baa19768f8e4d7c8944e", + "tarball": "http://registry.npmjs.org/es6-iterator/-/es6-iterator-0.1.3.tgz" + }, "directories": {}, - "_shasum": "5e136c899aa1c26296414f90859b73934812d275", - "_resolved": "https://registry.npmjs.org/es6-iterator/-/es6-iterator-0.1.1.tgz", + "_resolved": "https://registry.npmjs.org/es6-iterator/-/es6-iterator-0.1.3.tgz", "readme": "ERROR: No README data found!" } diff --git a/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/memoizee/node_modules/es6-weak-map/node_modules/es6-iterator/test/array.js b/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/memoizee/node_modules/es6-weak-map/node_modules/es6-iterator/test/array.js index 21a6751..ae7c219 100644 --- a/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/memoizee/node_modules/es6-weak-map/node_modules/es6-iterator/test/array.js +++ b/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/memoizee/node_modules/es6-weak-map/node_modules/es6-iterator/test/array.js @@ -4,7 +4,7 @@ var iteratorSymbol = require('es6-symbol').iterator; module.exports = function (T) { return { - "Values": function (a) { + Values: function (a) { var x = ['raz', 'dwa', 'trzy', 'cztery', 'pięć', 'sześć'], it; it = new T(x); @@ -34,7 +34,7 @@ module.exports = function (T) { a.deep(it.next(), { done: false, value: [5, 'pięć'] }, "#5"); a.deep(it.next(), { done: true, value: undefined }, "End"); }, - "Keys": function (a) { + Keys: function (a) { var x = ['raz', 'dwa', 'trzy', 'cztery', 'pięć', 'sześć'], it; it = new T(x, 'key'); @@ -49,7 +49,7 @@ module.exports = function (T) { a.deep(it.next(), { done: false, value: 5 }, "#5"); a.deep(it.next(), { done: true, value: undefined }, "End"); }, - "Sparse": function (a) { + Sparse: function (a) { var x = new Array(6), it; x[2] = 'raz'; diff --git a/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/memoizee/node_modules/es6-weak-map/node_modules/es6-iterator/test/index.js b/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/memoizee/node_modules/es6-weak-map/node_modules/es6-iterator/test/index.js index 1e2d1cf..ea3621a 100644 --- a/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/memoizee/node_modules/es6-weak-map/node_modules/es6-iterator/test/index.js +++ b/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/memoizee/node_modules/es6-weak-map/node_modules/es6-iterator/test/index.js @@ -21,7 +21,7 @@ module.exports = function (T) { a.deep(y = it.next(), { done: true, value: undefined }, "End"); a.not(y, it.next(), "Recreate result on dead"); }, - "Emited": function (a) { + Emited: function (a) { var x = ['raz', 'dwa', 'trzy', 'cztery', 'pięć'], y, it; y = ee(); diff --git a/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/memoizee/node_modules/event-emitter/.travis.yml b/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/memoizee/node_modules/event-emitter/.travis.yml index 647a081..a6ec240 100644 --- a/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/memoizee/node_modules/event-emitter/.travis.yml +++ b/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/memoizee/node_modules/event-emitter/.travis.yml @@ -10,3 +10,5 @@ before_install: notifications: email: - medikoo+event-emitter@medikoo.com + +script: "npm test && npm run lint" diff --git a/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/memoizee/node_modules/event-emitter/CHANGES b/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/memoizee/node_modules/event-emitter/CHANGES index 694cf8f..dbc1b17 100644 --- a/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/memoizee/node_modules/event-emitter/CHANGES +++ b/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/memoizee/node_modules/event-emitter/CHANGES @@ -1,3 +1,11 @@ +v0.3.3 -- 2015.01.30 +* Fix reference to module in benchmarks + +v0.3.2 -- 2015.01.20 +* Improve documentation +* Configure lint scripts +* Fix spelling of LICENSE + v0.3.1 -- 2014.04.25 * Fix redefinition of emit method in `pipe` * Allow custom emit method name in `pipe` diff --git a/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/memoizee/node_modules/event-emitter/LICENCE b/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/memoizee/node_modules/event-emitter/LICENCE deleted file mode 100644 index 4d75961..0000000 --- a/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/memoizee/node_modules/event-emitter/LICENCE +++ /dev/null @@ -1,19 +0,0 @@ -Copyright (C) 2012 Mariusz Nowak (www.medikoo.com) - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/memoizee/node_modules/event-emitter/LICENSE b/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/memoizee/node_modules/event-emitter/LICENSE new file mode 100644 index 0000000..ccb76f6 --- /dev/null +++ b/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/memoizee/node_modules/event-emitter/LICENSE @@ -0,0 +1,19 @@ +Copyright (C) 2012-2015 Mariusz Nowak (www.medikoo.com) + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/memoizee/node_modules/event-emitter/README.md b/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/memoizee/node_modules/event-emitter/README.md index 8e425e0..17f4524 100644 --- a/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/memoizee/node_modules/event-emitter/README.md +++ b/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/memoizee/node_modules/event-emitter/README.md @@ -36,8 +36,8 @@ Removes all listeners from given event emitter object #### hasListeners(obj[, name]) _(event-emitter/has-listeners)_ -Whether there are any listeners attached to the object. -If `name` is provided, it checks whether are there any listeners attached for specific event +Whether object has some listeners attached to the object. +When `name` is provided, it checks listeners for specific event name ```javascript var emitter = ee(); @@ -55,15 +55,15 @@ emitter.off('foo', listener); hasListeners(emitter, 'foo'); // false ``` -#### pipe(source, target/*, emitMethodName*/) _(event-emitter/pipe)_ +#### pipe(source, target[, emitMethodName]) _(event-emitter/pipe)_ Pipes all events from _source_ emitter onto _target_ emitter (all events from _source_ emitter will be emitted also on _target_ emitter, but not other way). Returns _pipe_ object which exposes `pipe.close` function. Invoke it to close configured _pipe_. -It works internally by redefinition of `emit` method, if in your interface this method is referenced differenetly, provide its name (or symbol) with third argument. +It works internally by redefinition of `emit` method, if in your interface this method is referenced differently, provide its name (or symbol) with third argument. #### unify(emitter1, emitter2) _(event-emitter/unify)_ -Unifies event handling for two objects. Events emitted on _emitter1_ would be also emitter on _emitter2_, and other way back, events emitter on _emitter2_ would be emitter on _emitter1_ (both objects share same listeners collection). +Unifies event handling for two objects. Events emitted on _emitter1_ would be also emitter on _emitter2_, and other way back. Non reversible. ```javascript @@ -90,7 +90,6 @@ emitter1.emit('test'); // Invoked listener1, listener2, listener3 and listener4 emitter2.emit('test'); // Invoked listener1, listener2, listener3 and listener4 ``` - -### Tests [![Build Status](https://secure.travis-ci.org/medikoo/event-emitter.png?branch=master)](https://secure.travis-ci.org/medikoo/event-emitter) +### Tests [![Build Status](https://travis-ci.org/medikoo/event-emitter.png)](https://travis-ci.org/medikoo/event-emitter) $ npm test diff --git a/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/memoizee/node_modules/event-emitter/benchmark/many-on.js b/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/memoizee/node_modules/event-emitter/benchmark/many-on.js index d79e32e..e09bfde 100644 --- a/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/memoizee/node_modules/event-emitter/benchmark/many-on.js +++ b/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/memoizee/node_modules/event-emitter/benchmark/many-on.js @@ -15,7 +15,7 @@ var forEach = require('es5-ext/object/for-each') , ee, native, ee2, signals, a = {}, b = {}; ee = (function () { - var ee = require('../lib/core')(); + var ee = require('../')(); ee.on('test', function () { return arguments; }); ee.on('test', function () { return arguments; }); return ee.on('test', function () { return arguments; }); diff --git a/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/memoizee/node_modules/event-emitter/benchmark/single-on.js b/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/memoizee/node_modules/event-emitter/benchmark/single-on.js index 27368d2..99decbd 100644 --- a/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/memoizee/node_modules/event-emitter/benchmark/single-on.js +++ b/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/memoizee/node_modules/event-emitter/benchmark/single-on.js @@ -15,7 +15,7 @@ var forEach = require('es5-ext/object/for-each') , ee, native, ee2, signals, a = {}, b = {}; ee = (function () { - var ee = require('../lib/core'); + var ee = require('../'); return ee().on('test', function () { return arguments; }); }()); diff --git a/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/memoizee/node_modules/event-emitter/package.json b/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/memoizee/node_modules/event-emitter/package.json index 6247682..06b2014 100644 --- a/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/memoizee/node_modules/event-emitter/package.json +++ b/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/memoizee/node_modules/event-emitter/package.json @@ -1,6 +1,6 @@ { "name": "event-emitter", - "version": "0.3.1", + "version": "0.3.3", "description": "Environment agnostic event emitter", "author": { "name": "Mariusz Nowak", @@ -21,27 +21,29 @@ "url": "git://github.com/medikoo/event-emitter.git" }, "dependencies": { - "es5-ext": "~0.10.2", + "es5-ext": "~0.10.5", "d": "~0.1.1" }, "devDependencies": { - "tad": "~0.1.21" + "tad": "~0.2.1", + "xlint": "~0.2.2", + "xlint-jslint-medikoo": "~0.1.2" }, "scripts": { + "lint": "node node_modules/xlint/bin/xlint --linter=node_modules/xlint-jslint-medikoo/index.js --no-cache --no-stream", + "lint-console": "node node_modules/xlint/bin/xlint --linter=node_modules/xlint-jslint-medikoo/index.js --watch", "test": "node ./node_modules/tad/bin/tad" }, - "licence": "MIT", + "license": "MIT", + "gitHead": "13f184ab039e3559164691d3a6a3d6b8c84aed3e", "bugs": { "url": "https://github.com/medikoo/event-emitter/issues" }, "homepage": "https://github.com/medikoo/event-emitter", - "_id": "event-emitter@0.3.1", - "dist": { - "shasum": "1425ca9c5649a1a31ba835bd9dba6bfad3880238", - "tarball": "http://registry.npmjs.org/event-emitter/-/event-emitter-0.3.1.tgz" - }, + "_id": "event-emitter@0.3.3", + "_shasum": "df8e806541c68ab8ff20a79a1841b91abaa1bee4", "_from": "event-emitter@~0.3.1", - "_npmVersion": "1.4.3", + "_npmVersion": "1.4.28", "_npmUser": { "name": "medikoo", "email": "medikoo+npm@medikoo.com" @@ -52,8 +54,11 @@ "email": "medikoo+npm@medikoo.com" } ], + "dist": { + "shasum": "df8e806541c68ab8ff20a79a1841b91abaa1bee4", + "tarball": "http://registry.npmjs.org/event-emitter/-/event-emitter-0.3.3.tgz" + }, "directories": {}, - "_shasum": "1425ca9c5649a1a31ba835bd9dba6bfad3880238", - "_resolved": "https://registry.npmjs.org/event-emitter/-/event-emitter-0.3.1.tgz", + "_resolved": "https://registry.npmjs.org/event-emitter/-/event-emitter-0.3.3.tgz", "readme": "ERROR: No README data found!" } diff --git a/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/memoizee/node_modules/event-emitter/test/has-listeners.js b/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/memoizee/node_modules/event-emitter/test/has-listeners.js index aa837c9..875b048 100644 --- a/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/memoizee/node_modules/event-emitter/test/has-listeners.js +++ b/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/memoizee/node_modules/event-emitter/test/has-listeners.js @@ -5,7 +5,7 @@ var ee = require('../'); module.exports = function (t) { var x, y; return { - "Any": function (a) { + Any: function (a) { a(t(true), false, "Primitive"); a(t({ events: [] }), false, "Other object"); a(t(x = ee()), false, "Emitter: empty"); @@ -19,7 +19,7 @@ module.exports = function (t) { x.off('test', y); a(t(x), false, "Emitter: empty but touched by once"); }, - "Specific": function (a) { + Specific: function (a) { a(t(true, 'test'), false, "Primitive"); a(t({ events: [] }, 'test'), false, "Other object"); a(t(x = ee(), 'test'), false, "Emitter: empty"); diff --git a/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/memoizee/node_modules/event-emitter/test/unify.js b/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/memoizee/node_modules/event-emitter/test/unify.js index 768d2da..69295e0 100644 --- a/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/memoizee/node_modules/event-emitter/test/unify.js +++ b/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/cli-color/node_modules/memoizee/node_modules/event-emitter/test/unify.js @@ -80,7 +80,7 @@ module.exports = function (t) { a(count2, 3, "Post unify z, y"); a(count3, 1, "Post unify z, z"); }, - "Many": function (a) { + Many: function (a) { var x = {}, y = {}, z = {}, count, count2, count3; ee(x); diff --git a/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/mute-stream/package.json b/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/mute-stream/package.json index e2fdab7..8738ad7 100644 --- a/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/mute-stream/package.json +++ b/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/mute-stream/package.json @@ -37,7 +37,7 @@ "shasum": "a9219960a6d5d5d046597aee51252c6655f7177e", "tarball": "http://registry.npmjs.org/mute-stream/-/mute-stream-0.0.4.tgz" }, - "_from": "mute-stream@0.0.4", + "_from": "mute-stream@~0.0.4", "_npmVersion": "1.3.4", "_npmUser": { "name": "isaacs", @@ -50,6 +50,5 @@ } ], "_shasum": "a9219960a6d5d5d046597aee51252c6655f7177e", - "_resolved": "https://registry.npmjs.org/mute-stream/-/mute-stream-0.0.4.tgz", - "homepage": "https://github.com/isaacs/mute-stream" + "_resolved": "https://registry.npmjs.org/mute-stream/-/mute-stream-0.0.4.tgz" } diff --git a/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/readline2/.npmignore b/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/readline2/.npmignore deleted file mode 100644 index 218cc52..0000000 --- a/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/readline2/.npmignore +++ /dev/null @@ -1,5 +0,0 @@ -/test/ -.editorconfig -.jshintrc -.travis.yml -*.sublime-* \ No newline at end of file diff --git a/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/readline2/README.md b/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/readline2/README.md index 443650a..a4ae0ba 100644 --- a/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/readline2/README.md +++ b/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/readline2/README.md @@ -1,4 +1,4 @@ -readline2 [![Build Status](https://secure.travis-ci.org/SBoudrias/readline2.png?branch=master)](http://travis-ci.org/SBoudrias/readline2) +readline2 [![Build Status](https://travis-ci.org/SBoudrias/readline2.png?branch=master)](https://travis-ci.org/SBoudrias/readline2) ========= Node.js (v0.8 and v0.10) had some bugs and issues with the default [Readline](http://nodejs.org/api/readline.html) module. @@ -15,7 +15,7 @@ Documentation ### readline2.createInterface( options ); -> {Interface} -Present the same API as [node.js readline.createInterface()](http://nodejs.org/api/readline.html) +Present the same API as [Node.js `readline.createInterface()`](http://nodejs.org/api/readline.html) #### Improvements - Default `options.input` as `process.stdin` diff --git a/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/readline2/index.js b/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/readline2/index.js index 54f6eed..023e7f1 100644 --- a/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/readline2/index.js +++ b/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/readline2/index.js @@ -4,10 +4,9 @@ */ "use strict"; -var _ = require("lodash"); var readline = require("readline"); var MuteStream = require("mute-stream"); -var chalk = require("chalk"); +var stripAnsi = require("strip-ansi"); /** @@ -39,20 +38,22 @@ Interface.createInterface = function( opt ) { var rl = readline.createInterface( filteredOpt ); // Fix bug with refreshLine - rl._refreshLine = _.wrap(rl._refreshLine, function( func ) { - func.call(rl); + var _refreshLine = rl._refreshLine; + rl._refreshLine = function() { + _refreshLine.call(rl); + var line = this._prompt + this.line; var cursorPos = this._getCursorPos(); readline.moveCursor(this.output, -line.length, 0); readline.moveCursor(this.output, cursorPos.cols, 0); - }); + }; // Returns current cursor's position and line rl._getCursorPos = function() { var columns = this.columns; var strBeforeCursor = this._prompt + this.line.substring(0, this.cursor); - var dispPos = this._getDisplayPos(chalk.stripColor(strBeforeCursor)); + var dispPos = this._getDisplayPos(strBeforeCursor); var cols = dispPos.cols; var rows = dispPos.rows; // If the cursor is on a full-width character which steps over the line, @@ -71,7 +72,7 @@ Interface.createInterface = function( opt ) { var offset = 0; var col = this.columns; var code; - str = chalk.stripColor(str); + str = stripAnsi(str); for (var i = 0, len = str.length; i < len; i++) { code = codePointAt(str, i); if (code >= 0x10000) { // surrogates diff --git a/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/readline2/node_modules/chalk/node_modules/.bin/strip-ansi b/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/readline2/node_modules/.bin/strip-ansi similarity index 100% rename from node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/readline2/node_modules/chalk/node_modules/.bin/strip-ansi rename to node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/readline2/node_modules/.bin/strip-ansi diff --git a/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/readline2/node_modules/chalk/index.js b/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/readline2/node_modules/chalk/index.js deleted file mode 100644 index a21f702..0000000 --- a/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/readline2/node_modules/chalk/index.js +++ /dev/null @@ -1,63 +0,0 @@ -'use strict'; -var ansi = require('ansi-styles'); -var stripAnsi = require('strip-ansi'); -var hasColor = require('has-color'); -var defineProps = Object.defineProperties; -var chalk = module.exports; - -var styles = (function () { - var ret = {}; - - ansi.grey = ansi.gray; - - Object.keys(ansi).forEach(function (key) { - ret[key] = { - get: function () { - this._styles.push(key); - return this; - } - }; - }); - - return ret; -})(); - -function init() { - var ret = {}; - - Object.keys(styles).forEach(function (name) { - ret[name] = { - get: function () { - var obj = defineProps(function self() { - var str = [].slice.call(arguments).join(' '); - - if (!chalk.enabled) { - return str; - } - - return self._styles.reduce(function (str, name) { - var code = ansi[name]; - return str ? code.open + str + code.close : ''; - }, str); - }, styles); - - obj._styles = []; - - return obj[name]; - } - } - }); - - return ret; -} - -defineProps(chalk, init()); - -chalk.styles = ansi; -chalk.stripColor = stripAnsi; -chalk.supportsColor = hasColor; - -// detect mode if not set manually -if (chalk.enabled === undefined) { - chalk.enabled = chalk.supportsColor; -} diff --git a/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/readline2/node_modules/chalk/node_modules/ansi-styles/ansi-styles.js b/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/readline2/node_modules/chalk/node_modules/ansi-styles/ansi-styles.js deleted file mode 100644 index 3da548c..0000000 --- a/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/readline2/node_modules/chalk/node_modules/ansi-styles/ansi-styles.js +++ /dev/null @@ -1,38 +0,0 @@ -'use strict'; -var styles = module.exports; - -var codes = { - reset: [0, 0], - - bold: [1, 22], - italic: [3, 23], - underline: [4, 24], - inverse: [7, 27], - strikethrough: [9, 29], - - 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], - - bgBlack: [40, 49], - bgRed: [41, 49], - bgGreen: [42, 49], - bgYellow: [43, 49], - bgBlue: [44, 49], - bgMagenta: [45, 49], - bgCyan: [46, 49], - bgWhite: [47, 49] -}; - -Object.keys(codes).forEach(function (key) { - var val = codes[key]; - var style = styles[key] = {}; - style.open = '\x1b[' + val[0] + 'm'; - style.close = '\x1b[' + val[1] + 'm'; -}); diff --git a/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/readline2/node_modules/chalk/node_modules/ansi-styles/package.json b/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/readline2/node_modules/chalk/node_modules/ansi-styles/package.json deleted file mode 100644 index 6333ed7..0000000 --- a/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/readline2/node_modules/chalk/node_modules/ansi-styles/package.json +++ /dev/null @@ -1,75 +0,0 @@ -{ - "name": "ansi-styles", - "version": "1.0.0", - "description": "ANSI escape codes for colorizing strings in the terminal", - "keywords": [ - "ansi", - "styles", - "color", - "colour", - "colors", - "terminal", - "console", - "cli", - "string", - "tty", - "escape", - "formatting", - "rgb", - "256", - "shell", - "xterm", - "log", - "logging", - "command-line", - "text" - ], - "homepage": "https://github.com/sindresorhus/ansi-styles", - "bugs": { - "url": "https://github.com/sindresorhus/ansi-styles/issues" - }, - "license": "MIT", - "author": { - "name": "Sindre Sorhus", - "email": "sindresorhus@gmail.com", - "url": "http://sindresorhus.com" - }, - "files": [ - "ansi-styles.js" - ], - "main": "ansi-styles", - "repository": { - "type": "git", - "url": "git://github.com/sindresorhus/ansi-styles.git" - }, - "scripts": { - "test": "mocha" - }, - "devDependencies": { - "mocha": "~1.12.0" - }, - "engines": { - "node": ">=0.8.0" - }, - "_id": "ansi-styles@1.0.0", - "dist": { - "shasum": "cb102df1c56f5123eab8b67cd7b98027a0279178", - "tarball": "http://registry.npmjs.org/ansi-styles/-/ansi-styles-1.0.0.tgz" - }, - "_from": "ansi-styles@~1.0.0", - "_npmVersion": "1.3.15", - "_npmUser": { - "name": "sindresorhus", - "email": "sindresorhus@gmail.com" - }, - "maintainers": [ - { - "name": "sindresorhus", - "email": "sindresorhus@gmail.com" - } - ], - "directories": {}, - "_shasum": "cb102df1c56f5123eab8b67cd7b98027a0279178", - "_resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-1.0.0.tgz", - "readme": "ERROR: No README data found!" -} diff --git a/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/readline2/node_modules/chalk/node_modules/ansi-styles/readme.md b/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/readline2/node_modules/chalk/node_modules/ansi-styles/readme.md deleted file mode 100644 index 4ac8cbd..0000000 --- a/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/readline2/node_modules/chalk/node_modules/ansi-styles/readme.md +++ /dev/null @@ -1,65 +0,0 @@ -# ansi-styles [![Build Status](https://secure.travis-ci.org/sindresorhus/ansi-styles.png?branch=master)](http://travis-ci.org/sindresorhus/ansi-styles) - -> [ANSI escape codes](http://en.wikipedia.org/wiki/ANSI_escape_code#Colors_and_Styles) for colorizing strings in the terminal. - -You probably want the higher-level [chalk](https://github.com/sindresorhus/chalk) module for styling your strings. - -![screenshot](screenshot.png) - - -## Install - -Install with [npm](https://npmjs.org/package/ansi-styles): `npm install --save ansi-styles` - - -## Example - -```js -var ansi = require('ansi-styles'); - -console.log(ansi.green.open + 'Hello world!' + ansi.green.close); -``` - -## API - -Each style has an `open` and `close` property. - - -## Styles - -### General - -- reset -- bold -- italic -- underline -- inverse -- strikethrough - -### Text colors - -- black -- red -- green -- yellow -- blue -- magenta -- cyan -- white -- gray - -### Background colors - -- bgBlack -- bgRed -- bgGreen -- bgYellow -- bgBlue -- bgMagenta -- bgCyan -- bgWhite - - -## License - -MIT © [Sindre Sorhus](http://sindresorhus.com) diff --git a/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/readline2/node_modules/chalk/node_modules/has-color/index.js b/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/readline2/node_modules/chalk/node_modules/has-color/index.js deleted file mode 100644 index 092d0ba..0000000 --- a/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/readline2/node_modules/chalk/node_modules/has-color/index.js +++ /dev/null @@ -1,32 +0,0 @@ -'use strict'; -module.exports = (function () { - if (process.argv.indexOf('--no-color') !== -1) { - return false; - } - - if (process.argv.indexOf('--color') !== -1) { - return true; - } - - if (process.stdout && !process.stdout.isTTY) { - return false; - } - - if (process.platform === 'win32') { - return true; - } - - if ('COLORTERM' in process.env) { - return true; - } - - if (process.env.TERM === 'dumb') { - return false; - } - - if (/^screen|^xterm|^vt100|color|ansi|cygwin|linux/i.test(process.env.TERM)) { - return true; - } - - return false; -})(); diff --git a/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/readline2/node_modules/chalk/node_modules/has-color/package.json b/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/readline2/node_modules/chalk/node_modules/has-color/package.json deleted file mode 100644 index 16fcf24..0000000 --- a/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/readline2/node_modules/chalk/node_modules/has-color/package.json +++ /dev/null @@ -1,71 +0,0 @@ -{ - "name": "has-color", - "version": "0.1.7", - "description": "Detect whether a terminal supports color", - "license": "MIT", - "repository": { - "type": "git", - "url": "git://github.com/sindresorhus/has-color" - }, - "author": { - "name": "Sindre Sorhus", - "email": "sindresorhus@gmail.com", - "url": "http://sindresorhus.com" - }, - "engines": { - "node": ">=0.10.0" - }, - "scripts": { - "test": "mocha" - }, - "files": [ - "index.js" - ], - "keywords": [ - "color", - "colour", - "colors", - "terminal", - "console", - "cli", - "ansi", - "styles", - "tty", - "rgb", - "256", - "shell", - "xterm", - "command-line", - "support", - "capability", - "detect" - ], - "devDependencies": { - "mocha": "*" - }, - "bugs": { - "url": "https://github.com/sindresorhus/has-color/issues" - }, - "homepage": "https://github.com/sindresorhus/has-color", - "_id": "has-color@0.1.7", - "dist": { - "shasum": "67144a5260c34fc3cca677d041daf52fe7b78b2f", - "tarball": "http://registry.npmjs.org/has-color/-/has-color-0.1.7.tgz" - }, - "_from": "has-color@~0.1.0", - "_npmVersion": "1.4.6", - "_npmUser": { - "name": "sindresorhus", - "email": "sindresorhus@gmail.com" - }, - "maintainers": [ - { - "name": "sindresorhus", - "email": "sindresorhus@gmail.com" - } - ], - "directories": {}, - "_shasum": "67144a5260c34fc3cca677d041daf52fe7b78b2f", - "_resolved": "https://registry.npmjs.org/has-color/-/has-color-0.1.7.tgz", - "readme": "ERROR: No README data found!" -} diff --git a/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/readline2/node_modules/chalk/node_modules/has-color/readme.md b/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/readline2/node_modules/chalk/node_modules/has-color/readme.md deleted file mode 100644 index 37bbd89..0000000 --- a/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/readline2/node_modules/chalk/node_modules/has-color/readme.md +++ /dev/null @@ -1,30 +0,0 @@ -# has-color [![Build Status](https://travis-ci.org/sindresorhus/has-color.svg?branch=master)](https://travis-ci.org/sindresorhus/has-color) - -> Detect whether a terminal supports color. - -Used in the terminal color module [chalk](https://github.com/sindresorhus/chalk). - - -## Install - -```bash -$ npm install --save has-color -``` - - -## Usage - -```js -var hasColor = require('has-color'); - -if (hasColor) { - console.log('Terminal supports color.'); -} -``` - -It obeys the `--color` and `--no-color` CLI flags. - - -## License - -[MIT](http://opensource.org/licenses/MIT) © [Sindre Sorhus](http://sindresorhus.com) diff --git a/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/readline2/node_modules/chalk/node_modules/strip-ansi/cli.js b/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/readline2/node_modules/chalk/node_modules/strip-ansi/cli.js deleted file mode 100755 index f8019cd..0000000 --- a/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/readline2/node_modules/chalk/node_modules/strip-ansi/cli.js +++ /dev/null @@ -1,27 +0,0 @@ -#!/usr/bin/env node -'use strict'; -var fs = require('fs'); -var strip = require('./index'); -var input = process.argv[2]; - -if (process.argv.indexOf('-h') !== -1 || process.argv.indexOf('--help') !== -1) { - console.log('strip-ansi > '); - console.log('or'); - console.log('cat | strip-ansi > '); - return; -} - -if (process.argv.indexOf('-v') !== -1 || process.argv.indexOf('--version') !== -1) { - console.log(require('./package').version); - return; -} - -if (input) { - process.stdout.write(strip(fs.readFileSync(input, 'utf8'))); - return; -} - -process.stdin.setEncoding('utf8'); -process.stdin.on('data', function (data) { - process.stdout.write(strip(data)); -}); diff --git a/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/readline2/node_modules/chalk/node_modules/strip-ansi/index.js b/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/readline2/node_modules/chalk/node_modules/strip-ansi/index.js deleted file mode 100644 index 62320c5..0000000 --- a/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/readline2/node_modules/chalk/node_modules/strip-ansi/index.js +++ /dev/null @@ -1,4 +0,0 @@ -'use strict'; -module.exports = function (str) { - return typeof str === 'string' ? str.replace(/\x1B\[([0-9]{1,2}(;[0-9]{1,2})?)?[m|K]/g, '') : str; -}; diff --git a/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/readline2/node_modules/chalk/node_modules/strip-ansi/readme.md b/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/readline2/node_modules/chalk/node_modules/strip-ansi/readme.md deleted file mode 100644 index eb661b3..0000000 --- a/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/readline2/node_modules/chalk/node_modules/strip-ansi/readme.md +++ /dev/null @@ -1,46 +0,0 @@ -# strip-ansi [![Build Status](https://secure.travis-ci.org/sindresorhus/strip-ansi.png?branch=master)](http://travis-ci.org/sindresorhus/strip-ansi) - -> Strip [ANSI escape codes](http://en.wikipedia.org/wiki/ANSI_escape_code#Colors_and_Styles) (used for colorizing strings in the terminal) - -Used in the terminal color module [chalk](https://github.com/sindresorhus/chalk). - - -## Install - -Install locally with [npm](https://npmjs.org/package/strip-ansi): - -``` -npm install --save strip-ansi -``` - -Or globally if you want to use it as a CLI app: - -``` -npm install --global strip-ansi -``` - -You can then use it in your Terminal like: - -``` -strip-ansi file-with-color-codes -``` - -Or pipe something to it: - -``` -ls | strip-ansi -``` - - -## Example - -```js -var stripAnsi = require('strip-ansi'); -stripAnsi('\x1b[4mcake\x1b[0m'); -//=> cake -``` - - -## License - -MIT © [Sindre Sorhus](http://sindresorhus.com) diff --git a/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/readline2/node_modules/chalk/package.json b/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/readline2/node_modules/chalk/package.json deleted file mode 100644 index 37542d2..0000000 --- a/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/readline2/node_modules/chalk/package.json +++ /dev/null @@ -1,78 +0,0 @@ -{ - "name": "chalk", - "version": "0.4.0", - "description": "Terminal string styling done right. Created because the `colors` module does some really horrible things.", - "license": "MIT", - "repository": { - "type": "git", - "url": "git://github.com/sindresorhus/chalk" - }, - "author": { - "name": "Sindre Sorhus", - "email": "sindresorhus@gmail.com", - "url": "http://sindresorhus.com" - }, - "engines": { - "node": ">=0.8.0" - }, - "scripts": { - "test": "mocha" - }, - "files": [ - "index.js" - ], - "keywords": [ - "color", - "colour", - "colors", - "terminal", - "console", - "cli", - "string", - "ansi", - "styles", - "tty", - "formatting", - "rgb", - "256", - "shell", - "xterm", - "log", - "logging", - "command-line", - "text" - ], - "dependencies": { - "has-color": "~0.1.0", - "ansi-styles": "~1.0.0", - "strip-ansi": "~0.1.0" - }, - "devDependencies": { - "mocha": "~1.x" - }, - "bugs": { - "url": "https://github.com/sindresorhus/chalk/issues" - }, - "homepage": "https://github.com/sindresorhus/chalk", - "_id": "chalk@0.4.0", - "dist": { - "shasum": "5199a3ddcd0c1efe23bc08c1b027b06176e0c64f", - "tarball": "http://registry.npmjs.org/chalk/-/chalk-0.4.0.tgz" - }, - "_from": "chalk@~0.4.0", - "_npmVersion": "1.3.17", - "_npmUser": { - "name": "sindresorhus", - "email": "sindresorhus@gmail.com" - }, - "maintainers": [ - { - "name": "sindresorhus", - "email": "sindresorhus@gmail.com" - } - ], - "directories": {}, - "_shasum": "5199a3ddcd0c1efe23bc08c1b027b06176e0c64f", - "_resolved": "https://registry.npmjs.org/chalk/-/chalk-0.4.0.tgz", - "readme": "ERROR: No README data found!" -} diff --git a/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/readline2/node_modules/chalk/readme.md b/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/readline2/node_modules/chalk/readme.md deleted file mode 100644 index 46813ac..0000000 --- a/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/readline2/node_modules/chalk/readme.md +++ /dev/null @@ -1,158 +0,0 @@ -# chalk - -> Terminal string styling done right - -[![Build Status](https://secure.travis-ci.org/sindresorhus/chalk.png?branch=master)](http://travis-ci.org/sindresorhus/chalk) - -[colors.js](https://github.com/Marak/colors.js) is currently the most popular string styling module, but it has serious deficiencies like extending String.prototype which causes all kinds of [problems](https://github.com/yeoman/yo/issues/68). Although there are other ones, they either do too much or not enough. - -**Chalk is a clean and focused alternative.** - -![screenshot](screenshot.png) - - -## Why - -- **Doesn't extend String.prototype** -- Expressive API -- Clean and focused -- Auto-detects color support -- Actively maintained -- [Used by 150+ modules](https://npmjs.org/browse/depended/chalk) - - -## Install - -Install with [npm](https://npmjs.org/package/chalk): `npm install --save chalk` - - -## Example - -Chalk comes with an easy to use composable API where you just chain and nest the styles you want. - -```js -var chalk = require('chalk'); - -// style a string -console.log( chalk.blue('Hello world!') ); - -// combine styled and normal strings -console.log( chalk.blue('Hello'), 'World' + chalk.red('!') ); - -// compose multiple styles using the chainable API -console.log( chalk.blue.bgRed.bold('Hello world!') ); - -// nest styles -console.log( chalk.red('Hello', chalk.underline.bgBlue('world') + '!') ); - -// pass in multiple arguments -console.log( chalk.blue('Hello', 'World!', 'Foo', 'bar', 'biz', 'baz') ); -``` - -You can easily define your own themes. - -```js -var chalk = require('chalk'); -var error = chalk.bold.red; -console.log(error('Error!')); -``` - - -## API - -### chalk.`'; - - // HTML markup for the UI - var MARKUP = '
\ - \ - \ -
\ -
\ - Normalize results \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ -
' + platform + '
TestOps/sec
\ -
\ - \ - Powered by JSLitmus \ -
'; - - /** - * The public API for creating and running tests - */ - window.JSLitmus = { - /** The list of all tests that have been registered with JSLitmus.test */ - _tests: [], - /** The queue of tests that need to be run */ - _queue: [], - - /** - * The parsed query parameters the current page URL. This is provided as a - * convenience for test functions - it's not used by JSLitmus proper - */ - params: {}, - - /** - * Initialize - */ - _init: function() { - // Parse query params into JSLitmus.params[] hash - var match = (location + '').match(/([^?#]*)(#.*)?$/); - if (match) { - var pairs = match[1].split('&'); - for (var i = 0; i < pairs.length; i++) { - var pair = pairs[i].split('='); - if (pair.length > 1) { - var key = pair.shift(); - var value = pair.length > 1 ? pair.join('=') : pair[0]; - this.params[key] = value; - } - } - } - - // Write out the stylesheet. We have to do this here because IE - // doesn't honor sheets written after the document has loaded. - document.write(STYLESHEET); - - // Setup the rest of the UI once the document is loaded - if (window.addEventListener) { - window.addEventListener('load', this._setup, false); - } else if (document.addEventListener) { - document.addEventListener('load', this._setup, false); - } else if (window.attachEvent) { - window.attachEvent('onload', this._setup); - } - - return this; - }, - - /** - * Set up the UI - */ - _setup: function() { - var el = jsl.$('jslitmus_container'); - if (!el) document.body.appendChild(el = document.createElement('div')); - - el.innerHTML = MARKUP; - - // Render the UI for all our tests - for (var i=0; i < JSLitmus._tests.length; i++) - JSLitmus.renderTest(JSLitmus._tests[i]); - }, - - /** - * (Re)render all the test results - */ - renderAll: function() { - for (var i = 0; i < JSLitmus._tests.length; i++) - JSLitmus.renderTest(JSLitmus._tests[i]); - JSLitmus.renderChart(); - }, - - /** - * (Re)render the chart graphics - */ - renderChart: function() { - var url = JSLitmus.chartUrl(); - jsl.$('chart_link').href = url; - jsl.$('chart_image').src = url; - jsl.$('chart').style.display = ''; - - // Update the tiny URL - jsl.$('tiny_url').src = 'http://tinyurl.com/api-create.php?url='+escape(url); - }, - - /** - * (Re)render the results for a specific test - */ - renderTest: function(test) { - // Make a new row if needed - if (!test._row) { - var trow = jsl.$('test_row_template'); - if (!trow) return; - - test._row = trow.cloneNode(true); - test._row.style.display = ''; - test._row.id = ''; - test._row.onclick = function() {JSLitmus._queueTest(test);}; - test._row.title = 'Run ' + test.name + ' test'; - trow.parentNode.appendChild(test._row); - test._row.cells[0].innerHTML = test.name; - } - - var cell = test._row.cells[1]; - var cns = [test.loopArg ? 'test_looping' : 'test_nonlooping']; - - if (test.error) { - cns.push('test_error'); - cell.innerHTML = - '
' + test.error + '
' + - '
  • ' + - jsl.join(test.error, ': ', '
  • ') + - '
'; - } else { - if (test.running) { - cns.push('test_running'); - cell.innerHTML = 'running'; - } else if (jsl.indexOf(JSLitmus._queue, test) >= 0) { - cns.push('test_pending'); - cell.innerHTML = 'pending'; - } else if (test.count) { - cns.push('test_done'); - var hz = test.getHz(jsl.$('test_normalize').checked); - cell.innerHTML = hz != Infinity ? hz : '∞'; - } else { - cell.innerHTML = 'ready'; - } - } - cell.className = cns.join(' '); - }, - - /** - * Create a new test - */ - test: function(name, f) { - // Create the Test object - var test = new Test(name, f); - JSLitmus._tests.push(test); - - // Re-render if the test state changes - test.onChange = JSLitmus.renderTest; - - // Run the next test if this one finished - test.onStop = function(test) { - if (JSLitmus.onTestFinish) JSLitmus.onTestFinish(test); - JSLitmus.currentTest = null; - JSLitmus._nextTest(); - }; - - // Render the new test - this.renderTest(test); - }, - - /** - * Add all tests to the run queue - */ - runAll: function(e) { - e = e || window.event; - var reverse = e && e.shiftKey, len = JSLitmus._tests.length; - for (var i = 0; i < len; i++) { - JSLitmus._queueTest(JSLitmus._tests[!reverse ? i : (len - i - 1)]); - } - }, - - /** - * Remove all tests from the run queue. The current test has to finish on - * it's own though - */ - stop: function() { - while (JSLitmus._queue.length) { - var test = JSLitmus._queue.shift(); - JSLitmus.renderTest(test); - } - }, - - /** - * Run the next test in the run queue - */ - _nextTest: function() { - if (!JSLitmus.currentTest) { - var test = JSLitmus._queue.shift(); - if (test) { - jsl.$('stop_button').disabled = false; - JSLitmus.currentTest = test; - test.run(); - JSLitmus.renderTest(test); - if (JSLitmus.onTestStart) JSLitmus.onTestStart(test); - } else { - jsl.$('stop_button').disabled = true; - JSLitmus.renderChart(); - } - } - }, - - /** - * Add a test to the run queue - */ - _queueTest: function(test) { - if (jsl.indexOf(JSLitmus._queue, test) >= 0) return; - JSLitmus._queue.push(test); - JSLitmus.renderTest(test); - JSLitmus._nextTest(); - }, - - /** - * Generate a Google Chart URL that shows the data for all tests - */ - chartUrl: function() { - var n = JSLitmus._tests.length, markers = [], data = []; - var d, min = 0, max = -1e10; - var normalize = jsl.$('test_normalize').checked; - - // Gather test data - for (var i=0; i < JSLitmus._tests.length; i++) { - var test = JSLitmus._tests[i]; - if (test.count) { - var hz = test.getHz(normalize); - var v = hz != Infinity ? hz : 0; - data.push(v); - markers.push('t' + jsl.escape(test.name + '(' + jsl.toLabel(hz)+ ')') + ',000000,0,' + - markers.length + ',10'); - max = Math.max(v, max); - } - } - if (markers.length <= 0) return null; - - // Build chart title - var title = document.getElementsByTagName('title'); - title = (title && title.length) ? title[0].innerHTML : null; - var chart_title = []; - if (title) chart_title.push(title); - chart_title.push('Ops/sec (' + platform + ')'); - - // Build labels - var labels = [jsl.toLabel(min), jsl.toLabel(max)]; - - var w = 250, bw = 15; - var bs = 5; - var h = markers.length*(bw + bs) + 30 + chart_title.length*20; - - var params = { - chtt: escape(chart_title.join('|')), - chts: '000000,10', - cht: 'bhg', // chart type - chd: 't:' + data.join(','), // data set - chds: min + ',' + max, // max/min of data - chxt: 'x', // label axes - chxl: '0:|' + labels.join('|'), // labels - chsp: '0,1', - chm: markers.join('|'), // test names - chbh: [bw, 0, bs].join(','), // bar widths - // chf: 'bg,lg,0,eeeeee,0,eeeeee,.5,ffffff,1', // gradient - chs: w + 'x' + h - }; - return 'http://chart.apis.google.com/chart?' + jsl.join(params, '=', '&'); - } - }; - - JSLitmus._init(); -})(); \ No newline at end of file diff --git a/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/test/test_underscore/vendor/qunit.css b/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/test/test_underscore/vendor/qunit.css deleted file mode 100644 index 55970e0..0000000 --- a/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/test/test_underscore/vendor/qunit.css +++ /dev/null @@ -1,235 +0,0 @@ -/** - * QUnit v1.10.0 - A JavaScript Unit Testing Framework - * - * http://qunitjs.com - * - * Copyright 2012 jQuery Foundation and other contributors - * Released under the MIT license. - * http://jquery.org/license - */ - -/** Font Family and Sizes */ - -#qunit-tests, #qunit-header, #qunit-banner, #qunit-testrunner-toolbar, #qunit-userAgent, #qunit-testresult { - font-family: "Helvetica Neue Light", "HelveticaNeue-Light", "Helvetica Neue", Calibri, Helvetica, Arial, sans-serif; -} - -#qunit-testrunner-toolbar, #qunit-userAgent, #qunit-testresult, #qunit-tests li { font-size: small; } -#qunit-tests { font-size: smaller; } - - -/** Resets */ - -#qunit-tests, #qunit-tests ol, #qunit-header, #qunit-banner, #qunit-userAgent, #qunit-testresult, #qunit-modulefilter { - margin: 0; - padding: 0; -} - - -/** Header */ - -#qunit-header { - padding: 0.5em 0 0.5em 1em; - - color: #8699a4; - background-color: #0d3349; - - font-size: 1.5em; - line-height: 1em; - font-weight: normal; - - border-radius: 5px 5px 0 0; - -moz-border-radius: 5px 5px 0 0; - -webkit-border-top-right-radius: 5px; - -webkit-border-top-left-radius: 5px; -} - -#qunit-header a { - text-decoration: none; - color: #c2ccd1; -} - -#qunit-header a:hover, -#qunit-header a:focus { - color: #fff; -} - -#qunit-testrunner-toolbar label { - display: inline-block; - padding: 0 .5em 0 .1em; -} - -#qunit-banner { - height: 5px; -} - -#qunit-testrunner-toolbar { - padding: 0.5em 0 0.5em 2em; - color: #5E740B; - background-color: #eee; - overflow: hidden; -} - -#qunit-userAgent { - padding: 0.5em 0 0.5em 2.5em; - background-color: #2b81af; - color: #fff; - text-shadow: rgba(0, 0, 0, 0.5) 2px 2px 1px; -} - -#qunit-modulefilter-container { - float: right; -} - -/** Tests: Pass/Fail */ - -#qunit-tests { - list-style-position: inside; -} - -#qunit-tests li { - padding: 0.4em 0.5em 0.4em 2.5em; - border-bottom: 1px solid #fff; - list-style-position: inside; -} - -#qunit-tests.hidepass li.pass, #qunit-tests.hidepass li.running { - display: none; -} - -#qunit-tests li strong { - cursor: pointer; -} - -#qunit-tests li a { - padding: 0.5em; - color: #c2ccd1; - text-decoration: none; -} -#qunit-tests li a:hover, -#qunit-tests li a:focus { - color: #000; -} - -#qunit-tests ol { - margin-top: 0.5em; - padding: 0.5em; - - background-color: #fff; - - border-radius: 5px; - -moz-border-radius: 5px; - -webkit-border-radius: 5px; -} - -#qunit-tests table { - border-collapse: collapse; - margin-top: .2em; -} - -#qunit-tests th { - text-align: right; - vertical-align: top; - padding: 0 .5em 0 0; -} - -#qunit-tests td { - vertical-align: top; -} - -#qunit-tests pre { - margin: 0; - white-space: pre-wrap; - word-wrap: break-word; -} - -#qunit-tests del { - background-color: #e0f2be; - color: #374e0c; - text-decoration: none; -} - -#qunit-tests ins { - background-color: #ffcaca; - color: #500; - text-decoration: none; -} - -/*** Test Counts */ - -#qunit-tests b.counts { color: black; } -#qunit-tests b.passed { color: #5E740B; } -#qunit-tests b.failed { color: #710909; } - -#qunit-tests li li { - padding: 5px; - background-color: #fff; - border-bottom: none; - list-style-position: inside; -} - -/*** Passing Styles */ - -#qunit-tests li li.pass { - color: #3c510c; - background-color: #fff; - border-left: 10px solid #C6E746; -} - -#qunit-tests .pass { color: #528CE0; background-color: #D2E0E6; } -#qunit-tests .pass .test-name { color: #366097; } - -#qunit-tests .pass .test-actual, -#qunit-tests .pass .test-expected { color: #999999; } - -#qunit-banner.qunit-pass { background-color: #C6E746; } - -/*** Failing Styles */ - -#qunit-tests li li.fail { - color: #710909; - background-color: #fff; - border-left: 10px solid #EE5757; - white-space: pre; -} - -#qunit-tests > li:last-child { - border-radius: 0 0 5px 5px; - -moz-border-radius: 0 0 5px 5px; - -webkit-border-bottom-right-radius: 5px; - -webkit-border-bottom-left-radius: 5px; -} - -#qunit-tests .fail { color: #000000; background-color: #EE5757; } -#qunit-tests .fail .test-name, -#qunit-tests .fail .module-name { color: #000000; } - -#qunit-tests .fail .test-actual { color: #EE5757; } -#qunit-tests .fail .test-expected { color: green; } - -#qunit-banner.qunit-fail { background-color: #EE5757; } - - -/** Result */ - -#qunit-testresult { - padding: 0.5em 0.5em 0.5em 2.5em; - - color: #2b81af; - background-color: #D2E0E6; - - border-bottom: 1px solid white; -} -#qunit-testresult .module-name { - font-weight: bold; -} - -/** Fixture */ - -#qunit-fixture { - position: absolute; - top: -10000px; - left: -10000px; - width: 1000px; - height: 1000px; -} diff --git a/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/test/test_underscore/vendor/qunit.js b/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/test/test_underscore/vendor/qunit.js deleted file mode 100644 index d4f17b5..0000000 --- a/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/test/test_underscore/vendor/qunit.js +++ /dev/null @@ -1,1977 +0,0 @@ -/** - * QUnit v1.10.0 - A JavaScript Unit Testing Framework - * - * http://qunitjs.com - * - * Copyright 2012 jQuery Foundation and other contributors - * Released under the MIT license. - * http://jquery.org/license - */ - -(function( window ) { - -var QUnit, - config, - onErrorFnPrev, - testId = 0, - fileName = (sourceFromStacktrace( 0 ) || "" ).replace(/(:\d+)+\)?/, "").replace(/.+\//, ""), - toString = Object.prototype.toString, - hasOwn = Object.prototype.hasOwnProperty, - // Keep a local reference to Date (GH-283) - Date = window.Date, - defined = { - setTimeout: typeof window.setTimeout !== "undefined", - sessionStorage: (function() { - var x = "qunit-test-string"; - try { - sessionStorage.setItem( x, x ); - sessionStorage.removeItem( x ); - return true; - } catch( e ) { - return false; - } - }()) -}; - -function Test( settings ) { - extend( this, settings ); - this.assertions = []; - this.testNumber = ++Test.count; -} - -Test.count = 0; - -Test.prototype = { - init: function() { - var a, b, li, - tests = id( "qunit-tests" ); - - if ( tests ) { - b = document.createElement( "strong" ); - b.innerHTML = this.name; - - // `a` initialized at top of scope - a = document.createElement( "a" ); - a.innerHTML = "Rerun"; - a.href = QUnit.url({ testNumber: this.testNumber }); - - li = document.createElement( "li" ); - li.appendChild( b ); - li.appendChild( a ); - li.className = "running"; - li.id = this.id = "qunit-test-output" + testId++; - - tests.appendChild( li ); - } - }, - setup: function() { - if ( this.module !== config.previousModule ) { - if ( config.previousModule ) { - runLoggingCallbacks( "moduleDone", QUnit, { - name: config.previousModule, - failed: config.moduleStats.bad, - passed: config.moduleStats.all - config.moduleStats.bad, - total: config.moduleStats.all - }); - } - config.previousModule = this.module; - config.moduleStats = { all: 0, bad: 0 }; - runLoggingCallbacks( "moduleStart", QUnit, { - name: this.module - }); - } else if ( config.autorun ) { - runLoggingCallbacks( "moduleStart", QUnit, { - name: this.module - }); - } - - config.current = this; - - this.testEnvironment = extend({ - setup: function() {}, - teardown: function() {} - }, this.moduleTestEnvironment ); - - runLoggingCallbacks( "testStart", QUnit, { - name: this.testName, - module: this.module - }); - - // allow utility functions to access the current test environment - // TODO why?? - QUnit.current_testEnvironment = this.testEnvironment; - - if ( !config.pollution ) { - saveGlobal(); - } - if ( config.notrycatch ) { - this.testEnvironment.setup.call( this.testEnvironment ); - return; - } - try { - this.testEnvironment.setup.call( this.testEnvironment ); - } catch( e ) { - QUnit.pushFailure( "Setup failed on " + this.testName + ": " + e.message, extractStacktrace( e, 1 ) ); - } - }, - run: function() { - config.current = this; - - var running = id( "qunit-testresult" ); - - if ( running ) { - running.innerHTML = "Running:
" + this.name; - } - - if ( this.async ) { - QUnit.stop(); - } - - if ( config.notrycatch ) { - this.callback.call( this.testEnvironment, QUnit.assert ); - return; - } - - try { - this.callback.call( this.testEnvironment, QUnit.assert ); - } catch( e ) { - QUnit.pushFailure( "Died on test #" + (this.assertions.length + 1) + " " + this.stack + ": " + e.message, extractStacktrace( e, 0 ) ); - // else next test will carry the responsibility - saveGlobal(); - - // Restart the tests if they're blocking - if ( config.blocking ) { - QUnit.start(); - } - } - }, - teardown: function() { - config.current = this; - if ( config.notrycatch ) { - this.testEnvironment.teardown.call( this.testEnvironment ); - return; - } else { - try { - this.testEnvironment.teardown.call( this.testEnvironment ); - } catch( e ) { - QUnit.pushFailure( "Teardown failed on " + this.testName + ": " + e.message, extractStacktrace( e, 1 ) ); - } - } - checkPollution(); - }, - finish: function() { - config.current = this; - if ( config.requireExpects && this.expected == null ) { - QUnit.pushFailure( "Expected number of assertions to be defined, but expect() was not called.", this.stack ); - } else if ( this.expected != null && this.expected != this.assertions.length ) { - QUnit.pushFailure( "Expected " + this.expected + " assertions, but " + this.assertions.length + " were run", this.stack ); - } else if ( this.expected == null && !this.assertions.length ) { - QUnit.pushFailure( "Expected at least one assertion, but none were run - call expect(0) to accept zero assertions.", this.stack ); - } - - var assertion, a, b, i, li, ol, - test = this, - good = 0, - bad = 0, - tests = id( "qunit-tests" ); - - config.stats.all += this.assertions.length; - config.moduleStats.all += this.assertions.length; - - if ( tests ) { - ol = document.createElement( "ol" ); - - for ( i = 0; i < this.assertions.length; i++ ) { - assertion = this.assertions[i]; - - li = document.createElement( "li" ); - li.className = assertion.result ? "pass" : "fail"; - li.innerHTML = assertion.message || ( assertion.result ? "okay" : "failed" ); - ol.appendChild( li ); - - if ( assertion.result ) { - good++; - } else { - bad++; - config.stats.bad++; - config.moduleStats.bad++; - } - } - - // store result when possible - if ( QUnit.config.reorder && defined.sessionStorage ) { - if ( bad ) { - sessionStorage.setItem( "qunit-test-" + this.module + "-" + this.testName, bad ); - } else { - sessionStorage.removeItem( "qunit-test-" + this.module + "-" + this.testName ); - } - } - - if ( bad === 0 ) { - ol.style.display = "none"; - } - - // `b` initialized at top of scope - b = document.createElement( "strong" ); - b.innerHTML = this.name + " (" + bad + ", " + good + ", " + this.assertions.length + ")"; - - addEvent(b, "click", function() { - var next = b.nextSibling.nextSibling, - display = next.style.display; - next.style.display = display === "none" ? "block" : "none"; - }); - - addEvent(b, "dblclick", function( e ) { - var target = e && e.target ? e.target : window.event.srcElement; - if ( target.nodeName.toLowerCase() == "span" || target.nodeName.toLowerCase() == "b" ) { - target = target.parentNode; - } - if ( window.location && target.nodeName.toLowerCase() === "strong" ) { - window.location = QUnit.url({ testNumber: test.testNumber }); - } - }); - - // `li` initialized at top of scope - li = id( this.id ); - li.className = bad ? "fail" : "pass"; - li.removeChild( li.firstChild ); - a = li.firstChild; - li.appendChild( b ); - li.appendChild ( a ); - li.appendChild( ol ); - - } else { - for ( i = 0; i < this.assertions.length; i++ ) { - if ( !this.assertions[i].result ) { - bad++; - config.stats.bad++; - config.moduleStats.bad++; - } - } - } - - runLoggingCallbacks( "testDone", QUnit, { - name: this.testName, - module: this.module, - failed: bad, - passed: this.assertions.length - bad, - total: this.assertions.length - }); - - QUnit.reset(); - - config.current = undefined; - }, - - queue: function() { - var bad, - test = this; - - synchronize(function() { - test.init(); - }); - function run() { - // each of these can by async - synchronize(function() { - test.setup(); - }); - synchronize(function() { - test.run(); - }); - synchronize(function() { - test.teardown(); - }); - synchronize(function() { - test.finish(); - }); - } - - // `bad` initialized at top of scope - // defer when previous test run passed, if storage is available - bad = QUnit.config.reorder && defined.sessionStorage && - +sessionStorage.getItem( "qunit-test-" + this.module + "-" + this.testName ); - - if ( bad ) { - run(); - } else { - synchronize( run, true ); - } - } -}; - -// Root QUnit object. -// `QUnit` initialized at top of scope -QUnit = { - - // call on start of module test to prepend name to all tests - module: function( name, testEnvironment ) { - config.currentModule = name; - config.currentModuleTestEnvironment = testEnvironment; - config.modules[name] = true; - }, - - asyncTest: function( testName, expected, callback ) { - if ( arguments.length === 2 ) { - callback = expected; - expected = null; - } - - QUnit.test( testName, expected, callback, true ); - }, - - test: function( testName, expected, callback, async ) { - var test, - name = "" + escapeInnerText( testName ) + ""; - - if ( arguments.length === 2 ) { - callback = expected; - expected = null; - } - - if ( config.currentModule ) { - name = "" + config.currentModule + ": " + name; - } - - test = new Test({ - name: name, - testName: testName, - expected: expected, - async: async, - callback: callback, - module: config.currentModule, - moduleTestEnvironment: config.currentModuleTestEnvironment, - stack: sourceFromStacktrace( 2 ) - }); - - if ( !validTest( test ) ) { - return; - } - - test.queue(); - }, - - // Specify the number of expected assertions to gurantee that failed test (no assertions are run at all) don't slip through. - expect: function( asserts ) { - if (arguments.length === 1) { - config.current.expected = asserts; - } else { - return config.current.expected; - } - }, - - start: function( count ) { - config.semaphore -= count || 1; - // don't start until equal number of stop-calls - if ( config.semaphore > 0 ) { - return; - } - // ignore if start is called more often then stop - if ( config.semaphore < 0 ) { - config.semaphore = 0; - } - // A slight delay, to avoid any current callbacks - if ( defined.setTimeout ) { - window.setTimeout(function() { - if ( config.semaphore > 0 ) { - return; - } - if ( config.timeout ) { - clearTimeout( config.timeout ); - } - - config.blocking = false; - process( true ); - }, 13); - } else { - config.blocking = false; - process( true ); - } - }, - - stop: function( count ) { - config.semaphore += count || 1; - config.blocking = true; - - if ( config.testTimeout && defined.setTimeout ) { - clearTimeout( config.timeout ); - config.timeout = window.setTimeout(function() { - QUnit.ok( false, "Test timed out" ); - config.semaphore = 1; - QUnit.start(); - }, config.testTimeout ); - } - } -}; - -// Asssert helpers -// All of these must call either QUnit.push() or manually do: -// - runLoggingCallbacks( "log", .. ); -// - config.current.assertions.push({ .. }); -QUnit.assert = { - /** - * Asserts rough true-ish result. - * @name ok - * @function - * @example ok( "asdfasdf".length > 5, "There must be at least 5 chars" ); - */ - ok: function( result, msg ) { - if ( !config.current ) { - throw new Error( "ok() assertion outside test context, was " + sourceFromStacktrace(2) ); - } - result = !!result; - - var source, - details = { - module: config.current.module, - name: config.current.testName, - result: result, - message: msg - }; - - msg = escapeInnerText( msg || (result ? "okay" : "failed" ) ); - msg = "" + msg + ""; - - if ( !result ) { - source = sourceFromStacktrace( 2 ); - if ( source ) { - details.source = source; - msg += "
Source:
" + escapeInnerText( source ) + "
"; - } - } - runLoggingCallbacks( "log", QUnit, details ); - config.current.assertions.push({ - result: result, - message: msg - }); - }, - - /** - * Assert that the first two arguments are equal, with an optional message. - * Prints out both actual and expected values. - * @name equal - * @function - * @example equal( format( "Received {0} bytes.", 2), "Received 2 bytes.", "format() replaces {0} with next argument" ); - */ - equal: function( actual, expected, message ) { - QUnit.push( expected == actual, actual, expected, message ); - }, - - /** - * @name notEqual - * @function - */ - notEqual: function( actual, expected, message ) { - QUnit.push( expected != actual, actual, expected, message ); - }, - - /** - * @name deepEqual - * @function - */ - deepEqual: function( actual, expected, message ) { - QUnit.push( QUnit.equiv(actual, expected), actual, expected, message ); - }, - - /** - * @name notDeepEqual - * @function - */ - notDeepEqual: function( actual, expected, message ) { - QUnit.push( !QUnit.equiv(actual, expected), actual, expected, message ); - }, - - /** - * @name strictEqual - * @function - */ - strictEqual: function( actual, expected, message ) { - QUnit.push( expected === actual, actual, expected, message ); - }, - - /** - * @name notStrictEqual - * @function - */ - notStrictEqual: function( actual, expected, message ) { - QUnit.push( expected !== actual, actual, expected, message ); - }, - - throws: function( block, expected, message ) { - var actual, - ok = false; - - // 'expected' is optional - if ( typeof expected === "string" ) { - message = expected; - expected = null; - } - - config.current.ignoreGlobalErrors = true; - try { - block.call( config.current.testEnvironment ); - } catch (e) { - actual = e; - } - config.current.ignoreGlobalErrors = false; - - if ( actual ) { - // we don't want to validate thrown error - if ( !expected ) { - ok = true; - // expected is a regexp - } else if ( QUnit.objectType( expected ) === "regexp" ) { - ok = expected.test( actual ); - // expected is a constructor - } else if ( actual instanceof expected ) { - ok = true; - // expected is a validation function which returns true is validation passed - } else if ( expected.call( {}, actual ) === true ) { - ok = true; - } - - QUnit.push( ok, actual, null, message ); - } else { - QUnit.pushFailure( message, null, 'No exception was thrown.' ); - } - } -}; - -/** - * @deprecate since 1.8.0 - * Kept assertion helpers in root for backwards compatibility - */ -extend( QUnit, QUnit.assert ); - -/** - * @deprecated since 1.9.0 - * Kept global "raises()" for backwards compatibility - */ -QUnit.raises = QUnit.assert.throws; - -/** - * @deprecated since 1.0.0, replaced with error pushes since 1.3.0 - * Kept to avoid TypeErrors for undefined methods. - */ -QUnit.equals = function() { - QUnit.push( false, false, false, "QUnit.equals has been deprecated since 2009 (e88049a0), use QUnit.equal instead" ); -}; -QUnit.same = function() { - QUnit.push( false, false, false, "QUnit.same has been deprecated since 2009 (e88049a0), use QUnit.deepEqual instead" ); -}; - -// We want access to the constructor's prototype -(function() { - function F() {} - F.prototype = QUnit; - QUnit = new F(); - // Make F QUnit's constructor so that we can add to the prototype later - QUnit.constructor = F; -}()); - -/** - * Config object: Maintain internal state - * Later exposed as QUnit.config - * `config` initialized at top of scope - */ -config = { - // The queue of tests to run - queue: [], - - // block until document ready - blocking: true, - - // when enabled, show only failing tests - // gets persisted through sessionStorage and can be changed in UI via checkbox - hidepassed: false, - - // by default, run previously failed tests first - // very useful in combination with "Hide passed tests" checked - reorder: true, - - // by default, modify document.title when suite is done - altertitle: true, - - // when enabled, all tests must call expect() - requireExpects: false, - - // add checkboxes that are persisted in the query-string - // when enabled, the id is set to `true` as a `QUnit.config` property - urlConfig: [ - { - id: "noglobals", - label: "Check for Globals", - tooltip: "Enabling this will test if any test introduces new properties on the `window` object. Stored as query-strings." - }, - { - id: "notrycatch", - label: "No try-catch", - tooltip: "Enabling this will run tests outside of a try-catch block. Makes debugging exceptions in IE reasonable. Stored as query-strings." - } - ], - - // Set of all modules. - modules: {}, - - // logging callback queues - begin: [], - done: [], - log: [], - testStart: [], - testDone: [], - moduleStart: [], - moduleDone: [] -}; - -// Initialize more QUnit.config and QUnit.urlParams -(function() { - var i, - location = window.location || { search: "", protocol: "file:" }, - params = location.search.slice( 1 ).split( "&" ), - length = params.length, - urlParams = {}, - current; - - if ( params[ 0 ] ) { - for ( i = 0; i < length; i++ ) { - current = params[ i ].split( "=" ); - current[ 0 ] = decodeURIComponent( current[ 0 ] ); - // allow just a key to turn on a flag, e.g., test.html?noglobals - current[ 1 ] = current[ 1 ] ? decodeURIComponent( current[ 1 ] ) : true; - urlParams[ current[ 0 ] ] = current[ 1 ]; - } - } - - QUnit.urlParams = urlParams; - - // String search anywhere in moduleName+testName - config.filter = urlParams.filter; - - // Exact match of the module name - config.module = urlParams.module; - - config.testNumber = parseInt( urlParams.testNumber, 10 ) || null; - - // Figure out if we're running the tests from a server or not - QUnit.isLocal = location.protocol === "file:"; -}()); - -// Export global variables, unless an 'exports' object exists, -// in that case we assume we're in CommonJS (dealt with on the bottom of the script) -if ( typeof exports === "undefined" ) { - extend( window, QUnit ); - - // Expose QUnit object - window.QUnit = QUnit; -} - -// Extend QUnit object, -// these after set here because they should not be exposed as global functions -extend( QUnit, { - config: config, - - // Initialize the configuration options - init: function() { - extend( config, { - stats: { all: 0, bad: 0 }, - moduleStats: { all: 0, bad: 0 }, - started: +new Date(), - updateRate: 1000, - blocking: false, - autostart: true, - autorun: false, - filter: "", - queue: [], - semaphore: 0 - }); - - var tests, banner, result, - qunit = id( "qunit" ); - - if ( qunit ) { - qunit.innerHTML = - "

" + escapeInnerText( document.title ) + "

" + - "

" + - "
" + - "

" + - "
    "; - } - - tests = id( "qunit-tests" ); - banner = id( "qunit-banner" ); - result = id( "qunit-testresult" ); - - if ( tests ) { - tests.innerHTML = ""; - } - - if ( banner ) { - banner.className = ""; - } - - if ( result ) { - result.parentNode.removeChild( result ); - } - - if ( tests ) { - result = document.createElement( "p" ); - result.id = "qunit-testresult"; - result.className = "result"; - tests.parentNode.insertBefore( result, tests ); - result.innerHTML = "Running...
     "; - } - }, - - // Resets the test setup. Useful for tests that modify the DOM. - reset: function() { - var fixture = id( "qunit-fixture" ); - if ( fixture ) { - fixture.innerHTML = config.fixture; - } - }, - - // Trigger an event on an element. - // @example triggerEvent( document.body, "click" ); - triggerEvent: function( elem, type, event ) { - if ( document.createEvent ) { - event = document.createEvent( "MouseEvents" ); - event.initMouseEvent(type, true, true, elem.ownerDocument.defaultView, - 0, 0, 0, 0, 0, false, false, false, false, 0, null); - - elem.dispatchEvent( event ); - } else if ( elem.fireEvent ) { - elem.fireEvent( "on" + type ); - } - }, - - // Safe object type checking - is: function( type, obj ) { - return QUnit.objectType( obj ) == type; - }, - - objectType: function( obj ) { - if ( typeof obj === "undefined" ) { - return "undefined"; - // consider: typeof null === object - } - if ( obj === null ) { - return "null"; - } - - var type = toString.call( obj ).match(/^\[object\s(.*)\]$/)[1] || ""; - - switch ( type ) { - case "Number": - if ( isNaN(obj) ) { - return "nan"; - } - return "number"; - case "String": - case "Boolean": - case "Array": - case "Date": - case "RegExp": - case "Function": - return type.toLowerCase(); - } - if ( typeof obj === "object" ) { - return "object"; - } - return undefined; - }, - - push: function( result, actual, expected, message ) { - if ( !config.current ) { - throw new Error( "assertion outside test context, was " + sourceFromStacktrace() ); - } - - var output, source, - details = { - module: config.current.module, - name: config.current.testName, - result: result, - message: message, - actual: actual, - expected: expected - }; - - message = escapeInnerText( message ) || ( result ? "okay" : "failed" ); - message = "" + message + ""; - output = message; - - if ( !result ) { - expected = escapeInnerText( QUnit.jsDump.parse(expected) ); - actual = escapeInnerText( QUnit.jsDump.parse(actual) ); - output += ""; - - if ( actual != expected ) { - output += ""; - output += ""; - } - - source = sourceFromStacktrace(); - - if ( source ) { - details.source = source; - output += ""; - } - - output += "
    Expected:
    " + expected + "
    Result:
    " + actual + "
    Diff:
    " + QUnit.diff( expected, actual ) + "
    Source:
    " + escapeInnerText( source ) + "
    "; - } - - runLoggingCallbacks( "log", QUnit, details ); - - config.current.assertions.push({ - result: !!result, - message: output - }); - }, - - pushFailure: function( message, source, actual ) { - if ( !config.current ) { - throw new Error( "pushFailure() assertion outside test context, was " + sourceFromStacktrace(2) ); - } - - var output, - details = { - module: config.current.module, - name: config.current.testName, - result: false, - message: message - }; - - message = escapeInnerText( message ) || "error"; - message = "" + message + ""; - output = message; - - output += ""; - - if ( actual ) { - output += ""; - } - - if ( source ) { - details.source = source; - output += ""; - } - - output += "
    Result:
    " + escapeInnerText( actual ) + "
    Source:
    " + escapeInnerText( source ) + "
    "; - - runLoggingCallbacks( "log", QUnit, details ); - - config.current.assertions.push({ - result: false, - message: output - }); - }, - - url: function( params ) { - params = extend( extend( {}, QUnit.urlParams ), params ); - var key, - querystring = "?"; - - for ( key in params ) { - if ( !hasOwn.call( params, key ) ) { - continue; - } - querystring += encodeURIComponent( key ) + "=" + - encodeURIComponent( params[ key ] ) + "&"; - } - return window.location.pathname + querystring.slice( 0, -1 ); - }, - - extend: extend, - id: id, - addEvent: addEvent - // load, equiv, jsDump, diff: Attached later -}); - -/** - * @deprecated: Created for backwards compatibility with test runner that set the hook function - * into QUnit.{hook}, instead of invoking it and passing the hook function. - * QUnit.constructor is set to the empty F() above so that we can add to it's prototype here. - * Doing this allows us to tell if the following methods have been overwritten on the actual - * QUnit object. - */ -extend( QUnit.constructor.prototype, { - - // Logging callbacks; all receive a single argument with the listed properties - // run test/logs.html for any related changes - begin: registerLoggingCallback( "begin" ), - - // done: { failed, passed, total, runtime } - done: registerLoggingCallback( "done" ), - - // log: { result, actual, expected, message } - log: registerLoggingCallback( "log" ), - - // testStart: { name } - testStart: registerLoggingCallback( "testStart" ), - - // testDone: { name, failed, passed, total } - testDone: registerLoggingCallback( "testDone" ), - - // moduleStart: { name } - moduleStart: registerLoggingCallback( "moduleStart" ), - - // moduleDone: { name, failed, passed, total } - moduleDone: registerLoggingCallback( "moduleDone" ) -}); - -if ( typeof document === "undefined" || document.readyState === "complete" ) { - config.autorun = true; -} - -QUnit.load = function() { - runLoggingCallbacks( "begin", QUnit, {} ); - - // Initialize the config, saving the execution queue - var banner, filter, i, label, len, main, ol, toolbar, userAgent, val, urlConfigCheckboxes, moduleFilter, - numModules = 0, - moduleFilterHtml = "", - urlConfigHtml = "", - oldconfig = extend( {}, config ); - - QUnit.init(); - extend(config, oldconfig); - - config.blocking = false; - - len = config.urlConfig.length; - - for ( i = 0; i < len; i++ ) { - val = config.urlConfig[i]; - if ( typeof val === "string" ) { - val = { - id: val, - label: val, - tooltip: "[no tooltip available]" - }; - } - config[ val.id ] = QUnit.urlParams[ val.id ]; - urlConfigHtml += ""; - } - - moduleFilterHtml += ""; - - // `userAgent` initialized at top of scope - userAgent = id( "qunit-userAgent" ); - if ( userAgent ) { - userAgent.innerHTML = navigator.userAgent; - } - - // `banner` initialized at top of scope - banner = id( "qunit-header" ); - if ( banner ) { - banner.innerHTML = "" + banner.innerHTML + " "; - } - - // `toolbar` initialized at top of scope - toolbar = id( "qunit-testrunner-toolbar" ); - if ( toolbar ) { - // `filter` initialized at top of scope - filter = document.createElement( "input" ); - filter.type = "checkbox"; - filter.id = "qunit-filter-pass"; - - addEvent( filter, "click", function() { - var tmp, - ol = document.getElementById( "qunit-tests" ); - - if ( filter.checked ) { - ol.className = ol.className + " hidepass"; - } else { - tmp = " " + ol.className.replace( /[\n\t\r]/g, " " ) + " "; - ol.className = tmp.replace( / hidepass /, " " ); - } - if ( defined.sessionStorage ) { - if (filter.checked) { - sessionStorage.setItem( "qunit-filter-passed-tests", "true" ); - } else { - sessionStorage.removeItem( "qunit-filter-passed-tests" ); - } - } - }); - - if ( config.hidepassed || defined.sessionStorage && sessionStorage.getItem( "qunit-filter-passed-tests" ) ) { - filter.checked = true; - // `ol` initialized at top of scope - ol = document.getElementById( "qunit-tests" ); - ol.className = ol.className + " hidepass"; - } - toolbar.appendChild( filter ); - - // `label` initialized at top of scope - label = document.createElement( "label" ); - label.setAttribute( "for", "qunit-filter-pass" ); - label.setAttribute( "title", "Only show tests and assertons that fail. Stored in sessionStorage." ); - label.innerHTML = "Hide passed tests"; - toolbar.appendChild( label ); - - urlConfigCheckboxes = document.createElement( 'span' ); - urlConfigCheckboxes.innerHTML = urlConfigHtml; - addEvent( urlConfigCheckboxes, "change", function( event ) { - var params = {}; - params[ event.target.name ] = event.target.checked ? true : undefined; - window.location = QUnit.url( params ); - }); - toolbar.appendChild( urlConfigCheckboxes ); - - if (numModules > 1) { - moduleFilter = document.createElement( 'span' ); - moduleFilter.setAttribute( 'id', 'qunit-modulefilter-container' ); - moduleFilter.innerHTML = moduleFilterHtml; - addEvent( moduleFilter, "change", function() { - var selectBox = moduleFilter.getElementsByTagName("select")[0], - selectedModule = decodeURIComponent(selectBox.options[selectBox.selectedIndex].value); - - window.location = QUnit.url( { module: ( selectedModule === "" ) ? undefined : selectedModule } ); - }); - toolbar.appendChild(moduleFilter); - } - } - - // `main` initialized at top of scope - main = id( "qunit-fixture" ); - if ( main ) { - config.fixture = main.innerHTML; - } - - if ( config.autostart ) { - QUnit.start(); - } -}; - -addEvent( window, "load", QUnit.load ); - -// `onErrorFnPrev` initialized at top of scope -// Preserve other handlers -onErrorFnPrev = window.onerror; - -// Cover uncaught exceptions -// Returning true will surpress the default browser handler, -// returning false will let it run. -window.onerror = function ( error, filePath, linerNr ) { - var ret = false; - if ( onErrorFnPrev ) { - ret = onErrorFnPrev( error, filePath, linerNr ); - } - - // Treat return value as window.onerror itself does, - // Only do our handling if not surpressed. - if ( ret !== true ) { - if ( QUnit.config.current ) { - if ( QUnit.config.current.ignoreGlobalErrors ) { - return true; - } - QUnit.pushFailure( error, filePath + ":" + linerNr ); - } else { - QUnit.test( "global failure", extend( function() { - QUnit.pushFailure( error, filePath + ":" + linerNr ); - }, { validTest: validTest } ) ); - } - return false; - } - - return ret; -}; - -function done() { - config.autorun = true; - - // Log the last module results - if ( config.currentModule ) { - runLoggingCallbacks( "moduleDone", QUnit, { - name: config.currentModule, - failed: config.moduleStats.bad, - passed: config.moduleStats.all - config.moduleStats.bad, - total: config.moduleStats.all - }); - } - - var i, key, - banner = id( "qunit-banner" ), - tests = id( "qunit-tests" ), - runtime = +new Date() - config.started, - passed = config.stats.all - config.stats.bad, - html = [ - "Tests completed in ", - runtime, - " milliseconds.
    ", - "", - passed, - " tests of ", - config.stats.all, - " passed, ", - config.stats.bad, - " failed." - ].join( "" ); - - if ( banner ) { - banner.className = ( config.stats.bad ? "qunit-fail" : "qunit-pass" ); - } - - if ( tests ) { - id( "qunit-testresult" ).innerHTML = html; - } - - if ( config.altertitle && typeof document !== "undefined" && document.title ) { - // show ✖ for good, ✔ for bad suite result in title - // use escape sequences in case file gets loaded with non-utf-8-charset - document.title = [ - ( config.stats.bad ? "\u2716" : "\u2714" ), - document.title.replace( /^[\u2714\u2716] /i, "" ) - ].join( " " ); - } - - // clear own sessionStorage items if all tests passed - if ( config.reorder && defined.sessionStorage && config.stats.bad === 0 ) { - // `key` & `i` initialized at top of scope - for ( i = 0; i < sessionStorage.length; i++ ) { - key = sessionStorage.key( i++ ); - if ( key.indexOf( "qunit-test-" ) === 0 ) { - sessionStorage.removeItem( key ); - } - } - } - - // scroll back to top to show results - if ( window.scrollTo ) { - window.scrollTo(0, 0); - } - - runLoggingCallbacks( "done", QUnit, { - failed: config.stats.bad, - passed: passed, - total: config.stats.all, - runtime: runtime - }); -} - -/** @return Boolean: true if this test should be ran */ -function validTest( test ) { - var include, - filter = config.filter && config.filter.toLowerCase(), - module = config.module && config.module.toLowerCase(), - fullName = (test.module + ": " + test.testName).toLowerCase(); - - // Internally-generated tests are always valid - if ( test.callback && test.callback.validTest === validTest ) { - delete test.callback.validTest; - return true; - } - - if ( config.testNumber ) { - return test.testNumber === config.testNumber; - } - - if ( module && ( !test.module || test.module.toLowerCase() !== module ) ) { - return false; - } - - if ( !filter ) { - return true; - } - - include = filter.charAt( 0 ) !== "!"; - if ( !include ) { - filter = filter.slice( 1 ); - } - - // If the filter matches, we need to honour include - if ( fullName.indexOf( filter ) !== -1 ) { - return include; - } - - // Otherwise, do the opposite - return !include; -} - -// so far supports only Firefox, Chrome and Opera (buggy), Safari (for real exceptions) -// Later Safari and IE10 are supposed to support error.stack as well -// See also https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Error/Stack -function extractStacktrace( e, offset ) { - offset = offset === undefined ? 3 : offset; - - var stack, include, i, regex; - - if ( e.stacktrace ) { - // Opera - return e.stacktrace.split( "\n" )[ offset + 3 ]; - } else if ( e.stack ) { - // Firefox, Chrome - stack = e.stack.split( "\n" ); - if (/^error$/i.test( stack[0] ) ) { - stack.shift(); - } - if ( fileName ) { - include = []; - for ( i = offset; i < stack.length; i++ ) { - if ( stack[ i ].indexOf( fileName ) != -1 ) { - break; - } - include.push( stack[ i ] ); - } - if ( include.length ) { - return include.join( "\n" ); - } - } - return stack[ offset ]; - } else if ( e.sourceURL ) { - // Safari, PhantomJS - // hopefully one day Safari provides actual stacktraces - // exclude useless self-reference for generated Error objects - if ( /qunit.js$/.test( e.sourceURL ) ) { - return; - } - // for actual exceptions, this is useful - return e.sourceURL + ":" + e.line; - } -} -function sourceFromStacktrace( offset ) { - try { - throw new Error(); - } catch ( e ) { - return extractStacktrace( e, offset ); - } -} - -function escapeInnerText( s ) { - if ( !s ) { - return ""; - } - s = s + ""; - return s.replace( /[\&<>]/g, function( s ) { - switch( s ) { - case "&": return "&"; - case "<": return "<"; - case ">": return ">"; - default: return s; - } - }); -} - -function synchronize( callback, last ) { - config.queue.push( callback ); - - if ( config.autorun && !config.blocking ) { - process( last ); - } -} - -function process( last ) { - function next() { - process( last ); - } - var start = new Date().getTime(); - config.depth = config.depth ? config.depth + 1 : 1; - - while ( config.queue.length && !config.blocking ) { - if ( !defined.setTimeout || config.updateRate <= 0 || ( ( new Date().getTime() - start ) < config.updateRate ) ) { - config.queue.shift()(); - } else { - window.setTimeout( next, 13 ); - break; - } - } - config.depth--; - if ( last && !config.blocking && !config.queue.length && config.depth === 0 ) { - done(); - } -} - -function saveGlobal() { - config.pollution = []; - - if ( config.noglobals ) { - for ( var key in window ) { - // in Opera sometimes DOM element ids show up here, ignore them - if ( !hasOwn.call( window, key ) || /^qunit-test-output/.test( key ) ) { - continue; - } - config.pollution.push( key ); - } - } -} - -function checkPollution( name ) { - var newGlobals, - deletedGlobals, - old = config.pollution; - - saveGlobal(); - - newGlobals = diff( config.pollution, old ); - if ( newGlobals.length > 0 ) { - QUnit.pushFailure( "Introduced global variable(s): " + newGlobals.join(", ") ); - } - - deletedGlobals = diff( old, config.pollution ); - if ( deletedGlobals.length > 0 ) { - QUnit.pushFailure( "Deleted global variable(s): " + deletedGlobals.join(", ") ); - } -} - -// returns a new Array with the elements that are in a but not in b -function diff( a, b ) { - var i, j, - result = a.slice(); - - for ( i = 0; i < result.length; i++ ) { - for ( j = 0; j < b.length; j++ ) { - if ( result[i] === b[j] ) { - result.splice( i, 1 ); - i--; - break; - } - } - } - return result; -} - -function extend( a, b ) { - for ( var prop in b ) { - if ( b[ prop ] === undefined ) { - delete a[ prop ]; - - // Avoid "Member not found" error in IE8 caused by setting window.constructor - } else if ( prop !== "constructor" || a !== window ) { - a[ prop ] = b[ prop ]; - } - } - - return a; -} - -function addEvent( elem, type, fn ) { - if ( elem.addEventListener ) { - elem.addEventListener( type, fn, false ); - } else if ( elem.attachEvent ) { - elem.attachEvent( "on" + type, fn ); - } else { - fn(); - } -} - -function id( name ) { - return !!( typeof document !== "undefined" && document && document.getElementById ) && - document.getElementById( name ); -} - -function registerLoggingCallback( key ) { - return function( callback ) { - config[key].push( callback ); - }; -} - -// Supports deprecated method of completely overwriting logging callbacks -function runLoggingCallbacks( key, scope, args ) { - //debugger; - var i, callbacks; - if ( QUnit.hasOwnProperty( key ) ) { - QUnit[ key ].call(scope, args ); - } else { - callbacks = config[ key ]; - for ( i = 0; i < callbacks.length; i++ ) { - callbacks[ i ].call( scope, args ); - } - } -} - -// Test for equality any JavaScript type. -// Author: Philippe Rathé -QUnit.equiv = (function() { - - // Call the o related callback with the given arguments. - function bindCallbacks( o, callbacks, args ) { - var prop = QUnit.objectType( o ); - if ( prop ) { - if ( QUnit.objectType( callbacks[ prop ] ) === "function" ) { - return callbacks[ prop ].apply( callbacks, args ); - } else { - return callbacks[ prop ]; // or undefined - } - } - } - - // the real equiv function - var innerEquiv, - // stack to decide between skip/abort functions - callers = [], - // stack to avoiding loops from circular referencing - parents = [], - - getProto = Object.getPrototypeOf || function ( obj ) { - return obj.__proto__; - }, - callbacks = (function () { - - // for string, boolean, number and null - function useStrictEquality( b, a ) { - if ( b instanceof a.constructor || a instanceof b.constructor ) { - // to catch short annotaion VS 'new' annotation of a - // declaration - // e.g. var i = 1; - // var j = new Number(1); - return a == b; - } else { - return a === b; - } - } - - return { - "string": useStrictEquality, - "boolean": useStrictEquality, - "number": useStrictEquality, - "null": useStrictEquality, - "undefined": useStrictEquality, - - "nan": function( b ) { - return isNaN( b ); - }, - - "date": function( b, a ) { - return QUnit.objectType( b ) === "date" && a.valueOf() === b.valueOf(); - }, - - "regexp": function( b, a ) { - return QUnit.objectType( b ) === "regexp" && - // the regex itself - a.source === b.source && - // and its modifers - a.global === b.global && - // (gmi) ... - a.ignoreCase === b.ignoreCase && - a.multiline === b.multiline && - a.sticky === b.sticky; - }, - - // - skip when the property is a method of an instance (OOP) - // - abort otherwise, - // initial === would have catch identical references anyway - "function": function() { - var caller = callers[callers.length - 1]; - return caller !== Object && typeof caller !== "undefined"; - }, - - "array": function( b, a ) { - var i, j, len, loop; - - // b could be an object literal here - if ( QUnit.objectType( b ) !== "array" ) { - return false; - } - - len = a.length; - if ( len !== b.length ) { - // safe and faster - return false; - } - - // track reference to avoid circular references - parents.push( a ); - for ( i = 0; i < len; i++ ) { - loop = false; - for ( j = 0; j < parents.length; j++ ) { - if ( parents[j] === a[i] ) { - loop = true;// dont rewalk array - } - } - if ( !loop && !innerEquiv(a[i], b[i]) ) { - parents.pop(); - return false; - } - } - parents.pop(); - return true; - }, - - "object": function( b, a ) { - var i, j, loop, - // Default to true - eq = true, - aProperties = [], - bProperties = []; - - // comparing constructors is more strict than using - // instanceof - if ( a.constructor !== b.constructor ) { - // Allow objects with no prototype to be equivalent to - // objects with Object as their constructor. - if ( !(( getProto(a) === null && getProto(b) === Object.prototype ) || - ( getProto(b) === null && getProto(a) === Object.prototype ) ) ) { - return false; - } - } - - // stack constructor before traversing properties - callers.push( a.constructor ); - // track reference to avoid circular references - parents.push( a ); - - for ( i in a ) { // be strict: don't ensures hasOwnProperty - // and go deep - loop = false; - for ( j = 0; j < parents.length; j++ ) { - if ( parents[j] === a[i] ) { - // don't go down the same path twice - loop = true; - } - } - aProperties.push(i); // collect a's properties - - if (!loop && !innerEquiv( a[i], b[i] ) ) { - eq = false; - break; - } - } - - callers.pop(); // unstack, we are done - parents.pop(); - - for ( i in b ) { - bProperties.push( i ); // collect b's properties - } - - // Ensures identical properties name - return eq && innerEquiv( aProperties.sort(), bProperties.sort() ); - } - }; - }()); - - innerEquiv = function() { // can take multiple arguments - var args = [].slice.apply( arguments ); - if ( args.length < 2 ) { - return true; // end transition - } - - return (function( a, b ) { - if ( a === b ) { - return true; // catch the most you can - } else if ( a === null || b === null || typeof a === "undefined" || - typeof b === "undefined" || - QUnit.objectType(a) !== QUnit.objectType(b) ) { - return false; // don't lose time with error prone cases - } else { - return bindCallbacks(a, callbacks, [ b, a ]); - } - - // apply transition with (1..n) arguments - }( args[0], args[1] ) && arguments.callee.apply( this, args.splice(1, args.length - 1 )) ); - }; - - return innerEquiv; -}()); - -/** - * jsDump Copyright (c) 2008 Ariel Flesler - aflesler(at)gmail(dot)com | - * http://flesler.blogspot.com Licensed under BSD - * (http://www.opensource.org/licenses/bsd-license.php) Date: 5/15/2008 - * - * @projectDescription Advanced and extensible data dumping for Javascript. - * @version 1.0.0 - * @author Ariel Flesler - * @link {http://flesler.blogspot.com/2008/05/jsdump-pretty-dump-of-any-javascript.html} - */ -QUnit.jsDump = (function() { - function quote( str ) { - return '"' + str.toString().replace( /"/g, '\\"' ) + '"'; - } - function literal( o ) { - return o + ""; - } - function join( pre, arr, post ) { - var s = jsDump.separator(), - base = jsDump.indent(), - inner = jsDump.indent(1); - if ( arr.join ) { - arr = arr.join( "," + s + inner ); - } - if ( !arr ) { - return pre + post; - } - return [ pre, inner + arr, base + post ].join(s); - } - function array( arr, stack ) { - var i = arr.length, ret = new Array(i); - this.up(); - while ( i-- ) { - ret[i] = this.parse( arr[i] , undefined , stack); - } - this.down(); - return join( "[", ret, "]" ); - } - - var reName = /^function (\w+)/, - jsDump = { - parse: function( obj, type, stack ) { //type is used mostly internally, you can fix a (custom)type in advance - stack = stack || [ ]; - var inStack, res, - parser = this.parsers[ type || this.typeOf(obj) ]; - - type = typeof parser; - inStack = inArray( obj, stack ); - - if ( inStack != -1 ) { - return "recursion(" + (inStack - stack.length) + ")"; - } - //else - if ( type == "function" ) { - stack.push( obj ); - res = parser.call( this, obj, stack ); - stack.pop(); - return res; - } - // else - return ( type == "string" ) ? parser : this.parsers.error; - }, - typeOf: function( obj ) { - var type; - if ( obj === null ) { - type = "null"; - } else if ( typeof obj === "undefined" ) { - type = "undefined"; - } else if ( QUnit.is( "regexp", obj) ) { - type = "regexp"; - } else if ( QUnit.is( "date", obj) ) { - type = "date"; - } else if ( QUnit.is( "function", obj) ) { - type = "function"; - } else if ( typeof obj.setInterval !== undefined && typeof obj.document !== "undefined" && typeof obj.nodeType === "undefined" ) { - type = "window"; - } else if ( obj.nodeType === 9 ) { - type = "document"; - } else if ( obj.nodeType ) { - type = "node"; - } else if ( - // native arrays - toString.call( obj ) === "[object Array]" || - // NodeList objects - ( typeof obj.length === "number" && typeof obj.item !== "undefined" && ( obj.length ? obj.item(0) === obj[0] : ( obj.item( 0 ) === null && typeof obj[0] === "undefined" ) ) ) - ) { - type = "array"; - } else { - type = typeof obj; - } - return type; - }, - separator: function() { - return this.multiline ? this.HTML ? "
    " : "\n" : this.HTML ? " " : " "; - }, - indent: function( extra ) {// extra can be a number, shortcut for increasing-calling-decreasing - if ( !this.multiline ) { - return ""; - } - var chr = this.indentChar; - if ( this.HTML ) { - chr = chr.replace( /\t/g, " " ).replace( / /g, " " ); - } - return new Array( this._depth_ + (extra||0) ).join(chr); - }, - up: function( a ) { - this._depth_ += a || 1; - }, - down: function( a ) { - this._depth_ -= a || 1; - }, - setParser: function( name, parser ) { - this.parsers[name] = parser; - }, - // The next 3 are exposed so you can use them - quote: quote, - literal: literal, - join: join, - // - _depth_: 1, - // This is the list of parsers, to modify them, use jsDump.setParser - parsers: { - window: "[Window]", - document: "[Document]", - error: "[ERROR]", //when no parser is found, shouldn"t happen - unknown: "[Unknown]", - "null": "null", - "undefined": "undefined", - "function": function( fn ) { - var ret = "function", - name = "name" in fn ? fn.name : (reName.exec(fn) || [])[1];//functions never have name in IE - - if ( name ) { - ret += " " + name; - } - ret += "( "; - - ret = [ ret, QUnit.jsDump.parse( fn, "functionArgs" ), "){" ].join( "" ); - return join( ret, QUnit.jsDump.parse(fn,"functionCode" ), "}" ); - }, - array: array, - nodelist: array, - "arguments": array, - object: function( map, stack ) { - var ret = [ ], keys, key, val, i; - QUnit.jsDump.up(); - if ( Object.keys ) { - keys = Object.keys( map ); - } else { - keys = []; - for ( key in map ) { - keys.push( key ); - } - } - keys.sort(); - for ( i = 0; i < keys.length; i++ ) { - key = keys[ i ]; - val = map[ key ]; - ret.push( QUnit.jsDump.parse( key, "key" ) + ": " + QUnit.jsDump.parse( val, undefined, stack ) ); - } - QUnit.jsDump.down(); - return join( "{", ret, "}" ); - }, - node: function( node ) { - var a, val, - open = QUnit.jsDump.HTML ? "<" : "<", - close = QUnit.jsDump.HTML ? ">" : ">", - tag = node.nodeName.toLowerCase(), - ret = open + tag; - - for ( a in QUnit.jsDump.DOMAttrs ) { - val = node[ QUnit.jsDump.DOMAttrs[a] ]; - if ( val ) { - ret += " " + a + "=" + QUnit.jsDump.parse( val, "attribute" ); - } - } - return ret + close + open + "/" + tag + close; - }, - functionArgs: function( fn ) {//function calls it internally, it's the arguments part of the function - var args, - l = fn.length; - - if ( !l ) { - return ""; - } - - args = new Array(l); - while ( l-- ) { - args[l] = String.fromCharCode(97+l);//97 is 'a' - } - return " " + args.join( ", " ) + " "; - }, - key: quote, //object calls it internally, the key part of an item in a map - functionCode: "[code]", //function calls it internally, it's the content of the function - attribute: quote, //node calls it internally, it's an html attribute value - string: quote, - date: quote, - regexp: literal, //regex - number: literal, - "boolean": literal - }, - DOMAttrs: { - //attributes to dump from nodes, name=>realName - id: "id", - name: "name", - "class": "className" - }, - HTML: false,//if true, entities are escaped ( <, >, \t, space and \n ) - indentChar: " ",//indentation unit - multiline: true //if true, items in a collection, are separated by a \n, else just a space. - }; - - return jsDump; -}()); - -// from Sizzle.js -function getText( elems ) { - var i, elem, - ret = ""; - - for ( i = 0; elems[i]; i++ ) { - elem = elems[i]; - - // Get the text from text nodes and CDATA nodes - if ( elem.nodeType === 3 || elem.nodeType === 4 ) { - ret += elem.nodeValue; - - // Traverse everything else, except comment nodes - } else if ( elem.nodeType !== 8 ) { - ret += getText( elem.childNodes ); - } - } - - return ret; -} - -// from jquery.js -function inArray( elem, array ) { - if ( array.indexOf ) { - return array.indexOf( elem ); - } - - for ( var i = 0, length = array.length; i < length; i++ ) { - if ( array[ i ] === elem ) { - return i; - } - } - - return -1; -} - -/* - * Javascript Diff Algorithm - * By John Resig (http://ejohn.org/) - * Modified by Chu Alan "sprite" - * - * Released under the MIT license. - * - * More Info: - * http://ejohn.org/projects/javascript-diff-algorithm/ - * - * Usage: QUnit.diff(expected, actual) - * - * QUnit.diff( "the quick brown fox jumped over", "the quick fox jumps over" ) == "the quick brown fox jumped jumps over" - */ -QUnit.diff = (function() { - function diff( o, n ) { - var i, - ns = {}, - os = {}; - - for ( i = 0; i < n.length; i++ ) { - if ( ns[ n[i] ] == null ) { - ns[ n[i] ] = { - rows: [], - o: null - }; - } - ns[ n[i] ].rows.push( i ); - } - - for ( i = 0; i < o.length; i++ ) { - if ( os[ o[i] ] == null ) { - os[ o[i] ] = { - rows: [], - n: null - }; - } - os[ o[i] ].rows.push( i ); - } - - for ( i in ns ) { - if ( !hasOwn.call( ns, i ) ) { - continue; - } - if ( ns[i].rows.length == 1 && typeof os[i] != "undefined" && os[i].rows.length == 1 ) { - n[ ns[i].rows[0] ] = { - text: n[ ns[i].rows[0] ], - row: os[i].rows[0] - }; - o[ os[i].rows[0] ] = { - text: o[ os[i].rows[0] ], - row: ns[i].rows[0] - }; - } - } - - for ( i = 0; i < n.length - 1; i++ ) { - if ( n[i].text != null && n[ i + 1 ].text == null && n[i].row + 1 < o.length && o[ n[i].row + 1 ].text == null && - n[ i + 1 ] == o[ n[i].row + 1 ] ) { - - n[ i + 1 ] = { - text: n[ i + 1 ], - row: n[i].row + 1 - }; - o[ n[i].row + 1 ] = { - text: o[ n[i].row + 1 ], - row: i + 1 - }; - } - } - - for ( i = n.length - 1; i > 0; i-- ) { - if ( n[i].text != null && n[ i - 1 ].text == null && n[i].row > 0 && o[ n[i].row - 1 ].text == null && - n[ i - 1 ] == o[ n[i].row - 1 ]) { - - n[ i - 1 ] = { - text: n[ i - 1 ], - row: n[i].row - 1 - }; - o[ n[i].row - 1 ] = { - text: o[ n[i].row - 1 ], - row: i - 1 - }; - } - } - - return { - o: o, - n: n - }; - } - - return function( o, n ) { - o = o.replace( /\s+$/, "" ); - n = n.replace( /\s+$/, "" ); - - var i, pre, - str = "", - out = diff( o === "" ? [] : o.split(/\s+/), n === "" ? [] : n.split(/\s+/) ), - oSpace = o.match(/\s+/g), - nSpace = n.match(/\s+/g); - - if ( oSpace == null ) { - oSpace = [ " " ]; - } - else { - oSpace.push( " " ); - } - - if ( nSpace == null ) { - nSpace = [ " " ]; - } - else { - nSpace.push( " " ); - } - - if ( out.n.length === 0 ) { - for ( i = 0; i < out.o.length; i++ ) { - str += "" + out.o[i] + oSpace[i] + ""; - } - } - else { - if ( out.n[0].text == null ) { - for ( n = 0; n < out.o.length && out.o[n].text == null; n++ ) { - str += "" + out.o[n] + oSpace[n] + ""; - } - } - - for ( i = 0; i < out.n.length; i++ ) { - if (out.n[i].text == null) { - str += "" + out.n[i] + nSpace[i] + ""; - } - else { - // `pre` initialized at top of scope - pre = ""; - - for ( n = out.n[i].row + 1; n < out.o.length && out.o[n].text == null; n++ ) { - pre += "" + out.o[n] + oSpace[n] + ""; - } - str += " " + out.n[i].text + nSpace[i] + pre; - } - } - } - - return str; - }; -}()); - -// for CommonJS enviroments, export everything -if ( typeof exports !== "undefined" ) { - extend(exports, QUnit); -} - -// get at whatever the global object is, like window in browsers -}( (function() {return this;}.call()) )); diff --git a/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/test/underscore.js b/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/test/underscore.js deleted file mode 100644 index 65b59c0..0000000 --- a/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/test/underscore.js +++ /dev/null @@ -1,1201 +0,0 @@ -// Underscore.js 1.4.2 -// http://underscorejs.org -// (c) 2009-2012 Jeremy Ashkenas, DocumentCloud Inc. -// Underscore may be freely distributed under the MIT license. - -(function() { - - // Baseline setup - // -------------- - - // Establish the root object, `window` in the browser, or `global` on the server. - var root = this; - - // Save the previous value of the `_` variable. - var previousUnderscore = root._; - - // Establish the object that gets returned to break out of a loop iteration. - var breaker = {}; - - // Save bytes in the minified (but not gzipped) version: - var ArrayProto = Array.prototype, ObjProto = Object.prototype, FuncProto = Function.prototype; - - // Create quick reference variables for speed access to core prototypes. - var push = ArrayProto.push, - slice = ArrayProto.slice, - concat = ArrayProto.concat, - unshift = ArrayProto.unshift, - toString = ObjProto.toString, - hasOwnProperty = ObjProto.hasOwnProperty; - - // All **ECMAScript 5** native function implementations that we hope to use - // are declared here. - var - nativeForEach = ArrayProto.forEach, - nativeMap = ArrayProto.map, - nativeReduce = ArrayProto.reduce, - nativeReduceRight = ArrayProto.reduceRight, - nativeFilter = ArrayProto.filter, - nativeEvery = ArrayProto.every, - nativeSome = ArrayProto.some, - nativeIndexOf = ArrayProto.indexOf, - nativeLastIndexOf = ArrayProto.lastIndexOf, - nativeIsArray = Array.isArray, - nativeKeys = Object.keys, - nativeBind = FuncProto.bind; - - // Create a safe reference to the Underscore object for use below. - var _ = function(obj) { - if (obj instanceof _) return obj; - if (!(this instanceof _)) return new _(obj); - this._wrapped = obj; - }; - - // Export the Underscore object for **Node.js**, with - // backwards-compatibility for the old `require()` API. If we're in - // the browser, add `_` as a global object via a string identifier, - // for Closure Compiler "advanced" mode. - if (typeof exports !== 'undefined') { - if (typeof module !== 'undefined' && module.exports) { - exports = module.exports = _; - } - exports._ = _; - } else { - root['_'] = _; - } - - // Current version. - _.VERSION = '1.4.2'; - - // Collection Functions - // -------------------- - - // The cornerstone, an `each` implementation, aka `forEach`. - // Handles objects with the built-in `forEach`, arrays, and raw objects. - // Delegates to **ECMAScript 5**'s native `forEach` if available. - var each = _.each = _.forEach = function(obj, iterator, context) { - if (obj == null) return; - if (nativeForEach && obj.forEach === nativeForEach) { - obj.forEach(iterator, context); - } else if (obj.length === +obj.length) { - for (var i = 0, l = obj.length; i < l; i++) { - if (iterator.call(context, obj[i], i, obj) === breaker) return; - } - } else { - for (var key in obj) { - if (_.has(obj, key)) { - if (iterator.call(context, obj[key], key, obj) === breaker) return; - } - } - } - }; - - // Return the results of applying the iterator to each element. - // Delegates to **ECMAScript 5**'s native `map` if available. - _.map = _.collect = function(obj, iterator, context) { - var results = []; - if (obj == null) return results; - if (nativeMap && obj.map === nativeMap) return obj.map(iterator, context); - each(obj, function(value, index, list) { - results[results.length] = iterator.call(context, value, index, list); - }); - return results; - }; - - // **Reduce** builds up a single result from a list of values, aka `inject`, - // or `foldl`. Delegates to **ECMAScript 5**'s native `reduce` if available. - _.reduce = _.foldl = _.inject = function(obj, iterator, memo, context) { - var initial = arguments.length > 2; - if (obj == null) obj = []; - if (nativeReduce && obj.reduce === nativeReduce) { - if (context) iterator = _.bind(iterator, context); - return initial ? obj.reduce(iterator, memo) : obj.reduce(iterator); - } - each(obj, function(value, index, list) { - if (!initial) { - memo = value; - initial = true; - } else { - memo = iterator.call(context, memo, value, index, list); - } - }); - if (!initial) throw new TypeError('Reduce of empty array with no initial value'); - return memo; - }; - - // The right-associative version of reduce, also known as `foldr`. - // Delegates to **ECMAScript 5**'s native `reduceRight` if available. - _.reduceRight = _.foldr = function(obj, iterator, memo, context) { - var initial = arguments.length > 2; - if (obj == null) obj = []; - if (nativeReduceRight && obj.reduceRight === nativeReduceRight) { - if (context) iterator = _.bind(iterator, context); - return arguments.length > 2 ? obj.reduceRight(iterator, memo) : obj.reduceRight(iterator); - } - var length = obj.length; - if (length !== +length) { - var keys = _.keys(obj); - length = keys.length; - } - each(obj, function(value, index, list) { - index = keys ? keys[--length] : --length; - if (!initial) { - memo = obj[index]; - initial = true; - } else { - memo = iterator.call(context, memo, obj[index], index, list); - } - }); - if (!initial) throw new TypeError('Reduce of empty array with no initial value'); - return memo; - }; - - // Return the first value which passes a truth test. Aliased as `detect`. - _.find = _.detect = function(obj, iterator, context) { - var result; - any(obj, function(value, index, list) { - if (iterator.call(context, value, index, list)) { - result = value; - return true; - } - }); - return result; - }; - - // Return all the elements that pass a truth test. - // Delegates to **ECMAScript 5**'s native `filter` if available. - // Aliased as `select`. - _.filter = _.select = function(obj, iterator, context) { - var results = []; - if (obj == null) return results; - if (nativeFilter && obj.filter === nativeFilter) return obj.filter(iterator, context); - each(obj, function(value, index, list) { - if (iterator.call(context, value, index, list)) results[results.length] = value; - }); - return results; - }; - - // Return all the elements for which a truth test fails. - _.reject = function(obj, iterator, context) { - return _.filter(obj, function(value, index, list) { - return !iterator.call(context, value, index, list); - }, context); - }; - - // Determine whether all of the elements match a truth test. - // Delegates to **ECMAScript 5**'s native `every` if available. - // Aliased as `all`. - _.every = _.all = function(obj, iterator, context) { - iterator || (iterator = _.identity); - var result = true; - if (obj == null) return result; - if (nativeEvery && obj.every === nativeEvery) return obj.every(iterator, context); - each(obj, function(value, index, list) { - if (!(result = result && iterator.call(context, value, index, list))) return breaker; - }); - return !!result; - }; - - // Determine if at least one element in the object matches a truth test. - // Delegates to **ECMAScript 5**'s native `some` if available. - // Aliased as `any`. - var any = _.some = _.any = function(obj, iterator, context) { - iterator || (iterator = _.identity); - var result = false; - if (obj == null) return result; - if (nativeSome && obj.some === nativeSome) return obj.some(iterator, context); - each(obj, function(value, index, list) { - if (result || (result = iterator.call(context, value, index, list))) return breaker; - }); - return !!result; - }; - - // Determine if the array or object contains a given value (using `===`). - // Aliased as `include`. - _.contains = _.include = function(obj, target) { - var found = false; - if (obj == null) return found; - if (nativeIndexOf && obj.indexOf === nativeIndexOf) return obj.indexOf(target) != -1; - found = any(obj, function(value) { - return value === target; - }); - return found; - }; - - // Invoke a method (with arguments) on every item in a collection. - _.invoke = function(obj, method) { - var args = slice.call(arguments, 2); - return _.map(obj, function(value) { - return (_.isFunction(method) ? method : value[method]).apply(value, args); - }); - }; - - // Convenience version of a common use case of `map`: fetching a property. - _.pluck = function(obj, key) { - return _.map(obj, function(value){ return value[key]; }); - }; - - // Convenience version of a common use case of `filter`: selecting only objects - // with specific `key:value` pairs. - _.where = function(obj, attrs) { - if (_.isEmpty(attrs)) return []; - return _.filter(obj, function(value) { - for (var key in attrs) { - if (attrs[key] !== value[key]) return false; - } - return true; - }); - }; - - // Return the maximum element or (element-based computation). - // Can't optimize arrays of integers longer than 65,535 elements. - // See: https://bugs.webkit.org/show_bug.cgi?id=80797 - _.max = function(obj, iterator, context) { - if (!iterator && _.isArray(obj) && obj[0] === +obj[0] && obj.length < 65535) { - return Math.max.apply(Math, obj); - } - if (!iterator && _.isEmpty(obj)) return -Infinity; - var result = {computed : -Infinity}; - each(obj, function(value, index, list) { - var computed = iterator ? iterator.call(context, value, index, list) : value; - computed >= result.computed && (result = {value : value, computed : computed}); - }); - return result.value; - }; - - // Return the minimum element (or element-based computation). - _.min = function(obj, iterator, context) { - if (!iterator && _.isArray(obj) && obj[0] === +obj[0] && obj.length < 65535) { - return Math.min.apply(Math, obj); - } - if (!iterator && _.isEmpty(obj)) return Infinity; - var result = {computed : Infinity}; - each(obj, function(value, index, list) { - var computed = iterator ? iterator.call(context, value, index, list) : value; - computed < result.computed && (result = {value : value, computed : computed}); - }); - return result.value; - }; - - // Shuffle an array. - _.shuffle = function(obj) { - var rand; - var index = 0; - var shuffled = []; - each(obj, function(value) { - rand = _.random(index++); - shuffled[index - 1] = shuffled[rand]; - shuffled[rand] = value; - }); - return shuffled; - }; - - // An internal function to generate lookup iterators. - var lookupIterator = function(value) { - return _.isFunction(value) ? value : function(obj){ return obj[value]; }; - }; - - // Sort the object's values by a criterion produced by an iterator. - _.sortBy = function(obj, value, context) { - var iterator = lookupIterator(value); - return _.pluck(_.map(obj, function(value, index, list) { - return { - value : value, - index : index, - criteria : iterator.call(context, value, index, list) - }; - }).sort(function(left, right) { - var a = left.criteria; - var b = right.criteria; - if (a !== b) { - if (a > b || a === void 0) return 1; - if (a < b || b === void 0) return -1; - } - return left.index < right.index ? -1 : 1; - }), 'value'); - }; - - // An internal function used for aggregate "group by" operations. - var group = function(obj, value, context, behavior) { - var result = {}; - var iterator = lookupIterator(value); - each(obj, function(value, index) { - var key = iterator.call(context, value, index, obj); - behavior(result, key, value); - }); - return result; - }; - - // Groups the object's values by a criterion. Pass either a string attribute - // to group by, or a function that returns the criterion. - _.groupBy = function(obj, value, context) { - return group(obj, value, context, function(result, key, value) { - (_.has(result, key) ? result[key] : (result[key] = [])).push(value); - }); - }; - - // Counts instances of an object that group by a certain criterion. Pass - // either a string attribute to count by, or a function that returns the - // criterion. - _.countBy = function(obj, value, context) { - return group(obj, value, context, function(result, key, value) { - if (!_.has(result, key)) result[key] = 0; - result[key]++; - }); - }; - - // Use a comparator function to figure out the smallest index at which - // an object should be inserted so as to maintain order. Uses binary search. - _.sortedIndex = function(array, obj, iterator, context) { - iterator = iterator == null ? _.identity : lookupIterator(iterator); - var value = iterator.call(context, obj); - var low = 0, high = array.length; - while (low < high) { - var mid = (low + high) >>> 1; - iterator.call(context, array[mid]) < value ? low = mid + 1 : high = mid; - } - return low; - }; - - // Safely convert anything iterable into a real, live array. - _.toArray = function(obj) { - if (!obj) return []; - if (obj.length === +obj.length) return slice.call(obj); - return _.values(obj); - }; - - // Return the number of elements in an object. - _.size = function(obj) { - if (obj == null) return 0; - return (obj.length === +obj.length) ? obj.length : _.keys(obj).length; - }; - - // Array Functions - // --------------- - - // Get the first element of an array. Passing **n** will return the first N - // values in the array. Aliased as `head` and `take`. The **guard** check - // allows it to work with `_.map`. - _.first = _.head = _.take = function(array, n, guard) { - if (array == null) return void 0; - return (n != null) && !guard ? slice.call(array, 0, n) : array[0]; - }; - - // Returns everything but the last entry of the array. Especially useful on - // the arguments object. Passing **n** will return all the values in - // the array, excluding the last N. The **guard** check allows it to work with - // `_.map`. - _.initial = function(array, n, guard) { - return slice.call(array, 0, array.length - ((n == null) || guard ? 1 : n)); - }; - - // Get the last element of an array. Passing **n** will return the last N - // values in the array. The **guard** check allows it to work with `_.map`. - _.last = function(array, n, guard) { - if (array == null) return void 0; - if ((n != null) && !guard) { - return slice.call(array, Math.max(array.length - n, 0)); - } else { - return array[array.length - 1]; - } - }; - - // Returns everything but the first entry of the array. Aliased as `tail` and `drop`. - // Especially useful on the arguments object. Passing an **n** will return - // the rest N values in the array. The **guard** - // check allows it to work with `_.map`. - _.rest = _.tail = _.drop = function(array, n, guard) { - return slice.call(array, (n == null) || guard ? 1 : n); - }; - - // Trim out all falsy values from an array. - _.compact = function(array) { - return _.filter(array, function(value){ return !!value; }); - }; - - // Internal implementation of a recursive `flatten` function. - var flatten = function(input, shallow, output) { - each(input, function(value) { - if (_.isArray(value)) { - shallow ? push.apply(output, value) : flatten(value, shallow, output); - } else { - output.push(value); - } - }); - return output; - }; - - // Return a completely flattened version of an array. - _.flatten = function(array, shallow) { - return flatten(array, shallow, []); - }; - - // Return a version of the array that does not contain the specified value(s). - _.without = function(array) { - return _.difference(array, slice.call(arguments, 1)); - }; - - // Produce a duplicate-free version of the array. If the array has already - // been sorted, you have the option of using a faster algorithm. - // Aliased as `unique`. - _.uniq = _.unique = function(array, isSorted, iterator, context) { - var initial = iterator ? _.map(array, iterator, context) : array; - var results = []; - var seen = []; - each(initial, function(value, index) { - if (isSorted ? (!index || seen[seen.length - 1] !== value) : !_.contains(seen, value)) { - seen.push(value); - results.push(array[index]); - } - }); - return results; - }; - - // Produce an array that contains the union: each distinct element from all of - // the passed-in arrays. - _.union = function() { - return _.uniq(concat.apply(ArrayProto, arguments)); - }; - - // Produce an array that contains every item shared between all the - // passed-in arrays. - _.intersection = function(array) { - var rest = slice.call(arguments, 1); - return _.filter(_.uniq(array), function(item) { - return _.every(rest, function(other) { - return _.indexOf(other, item) >= 0; - }); - }); - }; - - // Take the difference between one array and a number of other arrays. - // Only the elements present in just the first array will remain. - _.difference = function(array) { - var rest = concat.apply(ArrayProto, slice.call(arguments, 1)); - return _.filter(array, function(value){ return !_.contains(rest, value); }); - }; - - // Zip together multiple lists into a single array -- elements that share - // an index go together. - _.zip = function() { - var args = slice.call(arguments); - var length = _.max(_.pluck(args, 'length')); - var results = new Array(length); - for (var i = 0; i < length; i++) { - results[i] = _.pluck(args, "" + i); - } - return results; - }; - - // Converts lists into objects. Pass either a single array of `[key, value]` - // pairs, or two parallel arrays of the same length -- one of keys, and one of - // the corresponding values. - _.object = function(list, values) { - if (list == null) return {}; - var result = {}; - for (var i = 0, l = list.length; i < l; i++) { - if (values) { - result[list[i]] = values[i]; - } else { - result[list[i][0]] = list[i][1]; - } - } - return result; - }; - - // If the browser doesn't supply us with indexOf (I'm looking at you, **MSIE**), - // we need this function. Return the position of the first occurrence of an - // item in an array, or -1 if the item is not included in the array. - // Delegates to **ECMAScript 5**'s native `indexOf` if available. - // If the array is large and already in sort order, pass `true` - // for **isSorted** to use binary search. - _.indexOf = function(array, item, isSorted) { - if (array == null) return -1; - var i = 0, l = array.length; - if (isSorted) { - if (typeof isSorted == 'number') { - i = (isSorted < 0 ? Math.max(0, l + isSorted) : isSorted); - } else { - i = _.sortedIndex(array, item); - return array[i] === item ? i : -1; - } - } - if (nativeIndexOf && array.indexOf === nativeIndexOf) return array.indexOf(item, isSorted); - for (; i < l; i++) if (array[i] === item) return i; - return -1; - }; - - // Delegates to **ECMAScript 5**'s native `lastIndexOf` if available. - _.lastIndexOf = function(array, item, from) { - if (array == null) return -1; - var hasIndex = from != null; - if (nativeLastIndexOf && array.lastIndexOf === nativeLastIndexOf) { - return hasIndex ? array.lastIndexOf(item, from) : array.lastIndexOf(item); - } - var i = (hasIndex ? from : array.length); - while (i--) if (array[i] === item) return i; - return -1; - }; - - // Generate an integer Array containing an arithmetic progression. A port of - // the native Python `range()` function. See - // [the Python documentation](http://docs.python.org/library/functions.html#range). - _.range = function(start, stop, step) { - if (arguments.length <= 1) { - stop = start || 0; - start = 0; - } - step = arguments[2] || 1; - - var len = Math.max(Math.ceil((stop - start) / step), 0); - var idx = 0; - var range = new Array(len); - - while(idx < len) { - range[idx++] = start; - start += step; - } - - return range; - }; - - // Function (ahem) Functions - // ------------------ - - // Reusable constructor function for prototype setting. - var ctor = function(){}; - - // Create a function bound to a given object (assigning `this`, and arguments, - // optionally). Binding with arguments is also known as `curry`. - // Delegates to **ECMAScript 5**'s native `Function.bind` if available. - // We check for `func.bind` first, to fail fast when `func` is undefined. - _.bind = function bind(func, context) { - var bound, args; - if (func.bind === nativeBind && nativeBind) return nativeBind.apply(func, slice.call(arguments, 1)); - if (!_.isFunction(func)) throw new TypeError; - args = slice.call(arguments, 2); - return bound = function() { - if (!(this instanceof bound)) return func.apply(context, args.concat(slice.call(arguments))); - ctor.prototype = func.prototype; - var self = new ctor; - var result = func.apply(self, args.concat(slice.call(arguments))); - if (Object(result) === result) return result; - return self; - }; - }; - - // Bind all of an object's methods to that object. Useful for ensuring that - // all callbacks defined on an object belong to it. - _.bindAll = function(obj) { - var funcs = slice.call(arguments, 1); - if (funcs.length == 0) funcs = _.functions(obj); - each(funcs, function(f) { obj[f] = _.bind(obj[f], obj); }); - return obj; - }; - - // Memoize an expensive function by storing its results. - _.memoize = function(func, hasher) { - var memo = {}; - hasher || (hasher = _.identity); - return function() { - var key = hasher.apply(this, arguments); - return _.has(memo, key) ? memo[key] : (memo[key] = func.apply(this, arguments)); - }; - }; - - // Delays a function for the given number of milliseconds, and then calls - // it with the arguments supplied. - _.delay = function(func, wait) { - var args = slice.call(arguments, 2); - return setTimeout(function(){ return func.apply(null, args); }, wait); - }; - - // Defers a function, scheduling it to run after the current call stack has - // cleared. - _.defer = function(func) { - return _.delay.apply(_, [func, 1].concat(slice.call(arguments, 1))); - }; - - // Returns a function, that, when invoked, will only be triggered at most once - // during a given window of time. - _.throttle = function(func, wait) { - var context, args, timeout, result; - var previous = 0; - var later = function() { - previous = new Date; - timeout = null; - result = func.apply(context, args); - }; - return function() { - var now = new Date; - var remaining = wait - (now - previous); - context = this; - args = arguments; - if (remaining <= 0) { - clearTimeout(timeout); - previous = now; - result = func.apply(context, args); - } else if (!timeout) { - timeout = setTimeout(later, remaining); - } - return result; - }; - }; - - // Returns a function, that, as long as it continues to be invoked, will not - // be triggered. The function will be called after it stops being called for - // N milliseconds. If `immediate` is passed, trigger the function on the - // leading edge, instead of the trailing. - _.debounce = function(func, wait, immediate) { - var timeout, result; - return function() { - var context = this, args = arguments; - var later = function() { - timeout = null; - if (!immediate) result = func.apply(context, args); - }; - var callNow = immediate && !timeout; - clearTimeout(timeout); - timeout = setTimeout(later, wait); - if (callNow) result = func.apply(context, args); - return result; - }; - }; - - // Returns a function that will be executed at most one time, no matter how - // often you call it. Useful for lazy initialization. - _.once = function(func) { - var ran = false, memo; - return function() { - if (ran) return memo; - ran = true; - memo = func.apply(this, arguments); - func = null; - return memo; - }; - }; - - // Returns the first function passed as an argument to the second, - // allowing you to adjust arguments, run code before and after, and - // conditionally execute the original function. - _.wrap = function(func, wrapper) { - return function() { - var args = [func]; - push.apply(args, arguments); - return wrapper.apply(this, args); - }; - }; - - // Returns a function that is the composition of a list of functions, each - // consuming the return value of the function that follows. - _.compose = function() { - var funcs = arguments; - return function() { - var args = arguments; - for (var i = funcs.length - 1; i >= 0; i--) { - args = [funcs[i].apply(this, args)]; - } - return args[0]; - }; - }; - - // Returns a function that will only be executed after being called N times. - _.after = function(times, func) { - if (times <= 0) return func(); - return function() { - if (--times < 1) { - return func.apply(this, arguments); - } - }; - }; - - // Object Functions - // ---------------- - - // Retrieve the names of an object's properties. - // Delegates to **ECMAScript 5**'s native `Object.keys` - _.keys = nativeKeys || function(obj) { - if (obj !== Object(obj)) throw new TypeError('Invalid object'); - var keys = []; - for (var key in obj) if (_.has(obj, key)) keys[keys.length] = key; - return keys; - }; - - // Retrieve the values of an object's properties. - _.values = function(obj) { - var values = []; - for (var key in obj) if (_.has(obj, key)) values.push(obj[key]); - return values; - }; - - // Convert an object into a list of `[key, value]` pairs. - _.pairs = function(obj) { - var pairs = []; - for (var key in obj) if (_.has(obj, key)) pairs.push([key, obj[key]]); - return pairs; - }; - - // Invert the keys and values of an object. The values must be serializable. - _.invert = function(obj) { - var result = {}; - for (var key in obj) if (_.has(obj, key)) result[obj[key]] = key; - return result; - }; - - // Return a sorted list of the function names available on the object. - // Aliased as `methods` - _.functions = _.methods = function(obj) { - var names = []; - for (var key in obj) { - if (_.isFunction(obj[key])) names.push(key); - } - return names.sort(); - }; - - // Extend a given object with all the properties in passed-in object(s). - _.extend = function(obj) { - each(slice.call(arguments, 1), function(source) { - for (var prop in source) { - obj[prop] = source[prop]; - } - }); - return obj; - }; - - // Return a copy of the object only containing the whitelisted properties. - _.pick = function(obj) { - var copy = {}; - var keys = concat.apply(ArrayProto, slice.call(arguments, 1)); - each(keys, function(key) { - if (key in obj) copy[key] = obj[key]; - }); - return copy; - }; - - // Return a copy of the object without the blacklisted properties. - _.omit = function(obj) { - var copy = {}; - var keys = concat.apply(ArrayProto, slice.call(arguments, 1)); - for (var key in obj) { - if (!_.contains(keys, key)) copy[key] = obj[key]; - } - return copy; - }; - - // Fill in a given object with default properties. - _.defaults = function(obj) { - each(slice.call(arguments, 1), function(source) { - for (var prop in source) { - if (obj[prop] == null) obj[prop] = source[prop]; - } - }); - return obj; - }; - - // Create a (shallow-cloned) duplicate of an object. - _.clone = function(obj) { - if (!_.isObject(obj)) return obj; - return _.isArray(obj) ? obj.slice() : _.extend({}, obj); - }; - - // Invokes interceptor with the obj, and then returns obj. - // The primary purpose of this method is to "tap into" a method chain, in - // order to perform operations on intermediate results within the chain. - _.tap = function(obj, interceptor) { - interceptor(obj); - return obj; - }; - - // Internal recursive comparison function for `isEqual`. - var eq = function(a, b, aStack, bStack) { - // Identical objects are equal. `0 === -0`, but they aren't identical. - // See the Harmony `egal` proposal: http://wiki.ecmascript.org/doku.php?id=harmony:egal. - if (a === b) return a !== 0 || 1 / a == 1 / b; - // A strict comparison is necessary because `null == undefined`. - if (a == null || b == null) return a === b; - // Unwrap any wrapped objects. - if (a instanceof _) a = a._wrapped; - if (b instanceof _) b = b._wrapped; - // Compare `[[Class]]` names. - var className = toString.call(a); - if (className != toString.call(b)) return false; - switch (className) { - // Strings, numbers, dates, and booleans are compared by value. - case '[object String]': - // Primitives and their corresponding object wrappers are equivalent; thus, `"5"` is - // equivalent to `new String("5")`. - return a == String(b); - case '[object Number]': - // `NaN`s are equivalent, but non-reflexive. An `egal` comparison is performed for - // other numeric values. - return a != +a ? b != +b : (a == 0 ? 1 / a == 1 / b : a == +b); - case '[object Date]': - case '[object Boolean]': - // Coerce dates and booleans to numeric primitive values. Dates are compared by their - // millisecond representations. Note that invalid dates with millisecond representations - // of `NaN` are not equivalent. - return +a == +b; - // RegExps are compared by their source patterns and flags. - case '[object RegExp]': - return a.source == b.source && - a.global == b.global && - a.multiline == b.multiline && - a.ignoreCase == b.ignoreCase; - } - if (typeof a != 'object' || typeof b != 'object') return false; - // Assume equality for cyclic structures. The algorithm for detecting cyclic - // structures is adapted from ES 5.1 section 15.12.3, abstract operation `JO`. - var length = aStack.length; - while (length--) { - // Linear search. Performance is inversely proportional to the number of - // unique nested structures. - if (aStack[length] == a) return bStack[length] == b; - } - // Add the first object to the stack of traversed objects. - aStack.push(a); - bStack.push(b); - var size = 0, result = true; - // Recursively compare objects and arrays. - if (className == '[object Array]') { - // Compare array lengths to determine if a deep comparison is necessary. - size = a.length; - result = size == b.length; - if (result) { - // Deep compare the contents, ignoring non-numeric properties. - while (size--) { - if (!(result = eq(a[size], b[size], aStack, bStack))) break; - } - } - } else { - // Objects with different constructors are not equivalent, but `Object`s - // from different frames are. - var aCtor = a.constructor, bCtor = b.constructor; - if (aCtor !== bCtor && !(_.isFunction(aCtor) && (aCtor instanceof aCtor) && - _.isFunction(bCtor) && (bCtor instanceof bCtor))) { - return false; - } - // Deep compare objects. - for (var key in a) { - if (_.has(a, key)) { - // Count the expected number of properties. - size++; - // Deep compare each member. - if (!(result = _.has(b, key) && eq(a[key], b[key], aStack, bStack))) break; - } - } - // Ensure that both objects contain the same number of properties. - if (result) { - for (key in b) { - if (_.has(b, key) && !(size--)) break; - } - result = !size; - } - } - // Remove the first object from the stack of traversed objects. - aStack.pop(); - bStack.pop(); - return result; - }; - - // Perform a deep comparison to check if two objects are equal. - _.isEqual = function(a, b) { - return eq(a, b, [], []); - }; - - // Is a given array, string, or object empty? - // An "empty" object has no enumerable own-properties. - _.isEmpty = function(obj) { - if (obj == null) return true; - if (_.isArray(obj) || _.isString(obj)) return obj.length === 0; - for (var key in obj) if (_.has(obj, key)) return false; - return true; - }; - - // Is a given value a DOM element? - _.isElement = function(obj) { - return !!(obj && obj.nodeType === 1); - }; - - // Is a given value an array? - // Delegates to ECMA5's native Array.isArray - _.isArray = nativeIsArray || function(obj) { - return toString.call(obj) == '[object Array]'; - }; - - // Is a given variable an object? - _.isObject = function(obj) { - return obj === Object(obj); - }; - - // Add some isType methods: isArguments, isFunction, isString, isNumber, isDate, isRegExp. - each(['Arguments', 'Function', 'String', 'Number', 'Date', 'RegExp'], function(name) { - _['is' + name] = function(obj) { - return toString.call(obj) == '[object ' + name + ']'; - }; - }); - - // Define a fallback version of the method in browsers (ahem, IE), where - // there isn't any inspectable "Arguments" type. - if (!_.isArguments(arguments)) { - _.isArguments = function(obj) { - return !!(obj && _.has(obj, 'callee')); - }; - } - - // Optimize `isFunction` if appropriate. - if (typeof (/./) !== 'function') { - _.isFunction = function(obj) { - return typeof obj === 'function'; - }; - } - - // Is a given object a finite number? - _.isFinite = function(obj) { - return _.isNumber(obj) && isFinite(obj); - }; - - // Is the given value `NaN`? (NaN is the only number which does not equal itself). - _.isNaN = function(obj) { - return _.isNumber(obj) && obj != +obj; - }; - - // Is a given value a boolean? - _.isBoolean = function(obj) { - return obj === true || obj === false || toString.call(obj) == '[object Boolean]'; - }; - - // Is a given value equal to null? - _.isNull = function(obj) { - return obj === null; - }; - - // Is a given variable undefined? - _.isUndefined = function(obj) { - return obj === void 0; - }; - - // Shortcut function for checking if an object has a given property directly - // on itself (in other words, not on a prototype). - _.has = function(obj, key) { - return hasOwnProperty.call(obj, key); - }; - - // Utility Functions - // ----------------- - - // Run Underscore.js in *noConflict* mode, returning the `_` variable to its - // previous owner. Returns a reference to the Underscore object. - _.noConflict = function() { - root._ = previousUnderscore; - return this; - }; - - // Keep the identity function around for default iterators. - _.identity = function(value) { - return value; - }; - - // Run a function **n** times. - _.times = function(n, iterator, context) { - for (var i = 0; i < n; i++) iterator.call(context, i); - }; - - // Return a random integer between min and max (inclusive). - _.random = function(min, max) { - if (max == null) { - max = min; - min = 0; - } - return min + (0 | Math.random() * (max - min + 1)); - }; - - // List of HTML entities for escaping. - var entityMap = { - escape: { - '&': '&', - '<': '<', - '>': '>', - '"': '"', - "'": ''', - '/': '/' - } - }; - entityMap.unescape = _.invert(entityMap.escape); - - // Regexes containing the keys and values listed immediately above. - var entityRegexes = { - escape: new RegExp('[' + _.keys(entityMap.escape).join('') + ']', 'g'), - unescape: new RegExp('(' + _.keys(entityMap.unescape).join('|') + ')', 'g') - }; - - // Functions for escaping and unescaping strings to/from HTML interpolation. - _.each(['escape', 'unescape'], function(method) { - _[method] = function(string) { - if (string == null) return ''; - return ('' + string).replace(entityRegexes[method], function(match) { - return entityMap[method][match]; - }); - }; - }); - - // If the value of the named property is a function then invoke it; - // otherwise, return it. - _.result = function(object, property) { - if (object == null) return null; - var value = object[property]; - return _.isFunction(value) ? value.call(object) : value; - }; - - // Add your own custom functions to the Underscore object. - _.mixin = function(obj) { - each(_.functions(obj), function(name){ - var func = _[name] = obj[name]; - _.prototype[name] = function() { - var args = [this._wrapped]; - push.apply(args, arguments); - return result.call(this, func.apply(_, args)); - }; - }); - }; - - // Generate a unique integer id (unique within the entire client session). - // Useful for temporary DOM ids. - var idCounter = 0; - _.uniqueId = function(prefix) { - var id = idCounter++; - return prefix ? prefix + id : id; - }; - - // By default, Underscore uses ERB-style template delimiters, change the - // following template settings to use alternative delimiters. - _.templateSettings = { - evaluate : /<%([\s\S]+?)%>/g, - interpolate : /<%=([\s\S]+?)%>/g, - escape : /<%-([\s\S]+?)%>/g - }; - - // When customizing `templateSettings`, if you don't want to define an - // interpolation, evaluation or escaping regex, we need one that is - // guaranteed not to match. - var noMatch = /(.)^/; - - // Certain characters need to be escaped so that they can be put into a - // string literal. - var escapes = { - "'": "'", - '\\': '\\', - '\r': 'r', - '\n': 'n', - '\t': 't', - '\u2028': 'u2028', - '\u2029': 'u2029' - }; - - var escaper = /\\|'|\r|\n|\t|\u2028|\u2029/g; - - // JavaScript micro-templating, similar to John Resig's implementation. - // Underscore templating handles arbitrary delimiters, preserves whitespace, - // and correctly escapes quotes within interpolated code. - _.template = function(text, data, settings) { - settings = _.defaults({}, settings, _.templateSettings); - - // Combine delimiters into one regular expression via alternation. - var matcher = new RegExp([ - (settings.escape || noMatch).source, - (settings.interpolate || noMatch).source, - (settings.evaluate || noMatch).source - ].join('|') + '|$', 'g'); - - // Compile the template source, escaping string literals appropriately. - var index = 0; - var source = "__p+='"; - text.replace(matcher, function(match, escape, interpolate, evaluate, offset) { - source += text.slice(index, offset) - .replace(escaper, function(match) { return '\\' + escapes[match]; }); - source += - escape ? "'+\n((__t=(" + escape + "))==null?'':_.escape(__t))+\n'" : - interpolate ? "'+\n((__t=(" + interpolate + "))==null?'':__t)+\n'" : - evaluate ? "';\n" + evaluate + "\n__p+='" : ''; - index = offset + match.length; - }); - source += "';\n"; - - // If a variable is not specified, place data values in local scope. - if (!settings.variable) source = 'with(obj||{}){\n' + source + '}\n'; - - source = "var __t,__p='',__j=Array.prototype.join," + - "print=function(){__p+=__j.call(arguments,'');};\n" + - source + "return __p;\n"; - - try { - var render = new Function(settings.variable || 'obj', '_', source); - } catch (e) { - e.source = source; - throw e; - } - - if (data) return render(data, _); - var template = function(data) { - return render.call(this, data, _); - }; - - // Provide the compiled function source as a convenience for precompilation. - template.source = 'function(' + (settings.variable || 'obj') + '){\n' + source + '}'; - - return template; - }; - - // Add a "chain" function, which will delegate to the wrapper. - _.chain = function(obj) { - return _(obj).chain(); - }; - - // OOP - // --------------- - // If Underscore is called as a function, it returns a wrapped object that - // can be used OO-style. This wrapper holds altered versions of all the - // underscore functions. Wrapped objects may be chained. - - // Helper function to continue chaining intermediate results. - var result = function(obj) { - return this._chain ? _(obj).chain() : obj; - }; - - // Add all of the Underscore functions to the wrapper object. - _.mixin(_); - - // Add all mutator Array functions to the wrapper. - each(['pop', 'push', 'reverse', 'shift', 'sort', 'splice', 'unshift'], function(name) { - var method = ArrayProto[name]; - _.prototype[name] = function() { - var obj = this._wrapped; - method.apply(obj, arguments); - if ((name == 'shift' || name == 'splice') && obj.length === 0) delete obj[0]; - return result.call(this, obj); - }; - }); - - // Add all accessor Array functions to the wrapper. - each(['concat', 'join', 'slice'], function(name) { - var method = ArrayProto[name]; - _.prototype[name] = function() { - return result.call(this, method.apply(this._wrapped, arguments)); - }; - }); - - _.extend(_.prototype, { - - // Start chaining a wrapped Underscore object. - chain: function() { - this._chain = true; - return this; - }, - - // Extracts the result from a wrapped and chained object. - value: function() { - return this._wrapped; - } - - }); - -}).call(this); diff --git a/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/underscore/.npmignore b/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/underscore/.npmignore deleted file mode 100644 index 4e5886d..0000000 --- a/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/underscore/.npmignore +++ /dev/null @@ -1,4 +0,0 @@ -test/ -Rakefile -docs/ -raw/ diff --git a/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/underscore/.travis.yml b/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/underscore/.travis.yml deleted file mode 100644 index 99dc771..0000000 --- a/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/underscore/.travis.yml +++ /dev/null @@ -1,5 +0,0 @@ -language: node_js -node_js: - - 0.8 -notifications: - email: false diff --git a/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/underscore/CNAME b/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/underscore/CNAME deleted file mode 100644 index a007e65..0000000 --- a/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/underscore/CNAME +++ /dev/null @@ -1 +0,0 @@ -underscorejs.org diff --git a/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/underscore/CONTRIBUTING.md b/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/underscore/CONTRIBUTING.md deleted file mode 100644 index de5d562..0000000 --- a/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/underscore/CONTRIBUTING.md +++ /dev/null @@ -1,9 +0,0 @@ -## How to contribute to Underscore.js - -* Before you open a ticket or send a pull request, [search](https://github.com/documentcloud/underscore/issues) for previous discussions about the same feature or issue. Add to the earlier ticket if you find one. - -* Before sending a pull request for a feature, be sure to have [tests](http://underscorejs.org/test/). - -* Use the same coding style as the rest of the [codebase](https://github.com/documentcloud/underscore/blob/master/underscore.js). - -* In your pull request, do not add documentation or re-build the minified `underscore-min.js` file. We'll do those things before cutting a new release. diff --git a/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/underscore/LICENSE b/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/underscore/LICENSE deleted file mode 100644 index 0d8dbe4..0000000 --- a/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/underscore/LICENSE +++ /dev/null @@ -1,22 +0,0 @@ -Copyright (c) 2009-2013 Jeremy Ashkenas, DocumentCloud - -Permission is hereby granted, free of charge, to any person -obtaining a copy of this software and associated documentation -files (the "Software"), to deal in the Software without -restriction, including without limitation the rights to use, -copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the -Software is furnished to do so, subject to the following -conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES -OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT -HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, -WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/underscore/README.md b/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/underscore/README.md deleted file mode 100644 index b1f3e50..0000000 --- a/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/underscore/README.md +++ /dev/null @@ -1,19 +0,0 @@ - __ - /\ \ __ - __ __ ___ \_\ \ __ _ __ ____ ___ ___ _ __ __ /\_\ ____ - /\ \/\ \ /' _ `\ /'_ \ /'__`\/\ __\/ ,__\ / ___\ / __`\/\ __\/'__`\ \/\ \ /',__\ - \ \ \_\ \/\ \/\ \/\ \ \ \/\ __/\ \ \//\__, `\/\ \__//\ \ \ \ \ \//\ __/ __ \ \ \/\__, `\ - \ \____/\ \_\ \_\ \___,_\ \____\\ \_\\/\____/\ \____\ \____/\ \_\\ \____\/\_\ _\ \ \/\____/ - \/___/ \/_/\/_/\/__,_ /\/____/ \/_/ \/___/ \/____/\/___/ \/_/ \/____/\/_//\ \_\ \/___/ - \ \____/ - \/___/ - -Underscore.js is a utility-belt library for JavaScript that provides -support for the usual functional suspects (each, map, reduce, filter...) -without extending any core JavaScript objects. - -For Docs, License, Tests, and pre-packed downloads, see: -http://underscorejs.org - -Many thanks to our contributors: -https://github.com/documentcloud/underscore/contributors diff --git a/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/underscore/favicon.ico b/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/underscore/favicon.ico deleted file mode 100644 index 03049683875ee7207b4ee62241fc6977956723c7..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1406 zcmZQzU<5(|0R|w+!H~hqz#zuJz@P!dKp_SNAO?x!16vCj7#y|msTh?T4S~@R7;Yi( a|NnmmMkru{0(Aax^D{300E2>o91H*{%ptM> diff --git a/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/underscore/index.html b/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/underscore/index.html deleted file mode 100644 index 8c5793a..0000000 --- a/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/underscore/index.html +++ /dev/null @@ -1,2467 +0,0 @@ - - - - - - - - - Underscore.js - - - - - - -
    - -

    - -

    - -

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

    - -

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

    - -

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

    - -

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

    - -

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

    - -

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

    - -

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

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

    Collection Functions (Arrays or Objects)

    - -

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

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

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

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

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

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

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

    -
    -var list = [[0, 1], [2, 3], [4, 5]];
    -var flat = _.reduceRight(list, function(a, b) { return a.concat(b); }, []);
    -=> [4, 5, 2, 3, 0, 1]
    -
    - -

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    Array Functions

    - -

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

    - -

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    -
    -_.range(10);
    -=> [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
    -_.range(1, 11);
    -=> [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
    -_.range(0, 30, 5);
    -=> [0, 5, 10, 15, 20, 25]
    -_.range(0, -10, -1);
    -=> [0, -1, -2, -3, -4, -5, -6, -7, -8, -9]
    -_.range(0);
    -=> []
    -
    - -

    Function (uh, ahem) Functions

    - -

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    - -

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

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

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

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

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

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

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

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

    - compose_.compose(*functions) -
    - Returns the composition of a list of functions, where each function - consumes the return value of the function that follows. In math terms, - composing the functions f(), g(), and h() produces - f(g(h())). -

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

    Object Functions

    - -

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    Utility Functions

    - -

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    Chaining

    - -

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

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

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

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

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

    - -

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

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

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

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

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

    - -

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

    - -

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

    - -

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

    - -

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

    - -

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

    - -

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

    - -

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

    - -

    - Ruby's Enumerable module. -

    - -

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

    - -

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

    - -

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

    - -

    - Python's itertools. -

    - -

    Change Log

    - -

    - 1.4.4Jan. 30, 2013Diff
    -

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

    - -

    - 1.4.3Dec. 4, 2012Diff
    -

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

    - -

    - 1.4.2Oct. 1, 2012Diff
    -

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

    - -

    - 1.4.1Oct. 1, 2012Diff
    -

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

    - -

    - 1.4.0Sept. 27, 2012Diff
    -

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

    - -

    - 1.3.3April 10, 2012
    -

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

    - -

    - 1.3.1Jan. 23, 2012
    -

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

    - -

    - 1.3.0Jan. 11, 2012
    -

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

    - -

    - 1.2.4Jan. 4, 2012
    -

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

    - -

    - 1.2.3Dec. 7, 2011
    -

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

    - -

    - 1.2.2Nov. 14, 2011
    -

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

    - -

    - 1.2.1Oct. 24, 2011
    -

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

    - -

    - 1.2.0Oct. 5, 2011
    -

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

    - -

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

    - -

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

    - -

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

    - -

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

    - -

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

    - -

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

    - -

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

    - -

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

    - -

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

    - -

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

    - -

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

    - -

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

    - -

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

    - -

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

    - -

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

    - -

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

    - -

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

    - -

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

    - -

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

    - -

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

    - -

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

    - -

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

    - -

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

    - -

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

    - -

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

    - -

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

    - -

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

    - -

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

    - -

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

    - -

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

    - -

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

    - -

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

    - -

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

    - -

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

    - -

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

    - -

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

    - -

    - 0.1.0
    - Initial release of Underscore.js. -

    - -

    - - A DocumentCloud Project - -

    - -
    - -
    - - - - - - diff --git a/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/underscore/index.js b/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/underscore/index.js deleted file mode 100644 index 2cf0ca5..0000000 --- a/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/underscore/index.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('./underscore'); diff --git a/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/underscore/package.json b/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/underscore/package.json deleted file mode 100644 index c58f39c..0000000 --- a/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/underscore/package.json +++ /dev/null @@ -1,52 +0,0 @@ -{ - "name": "underscore", - "description": "JavaScript's functional programming helper library.", - "homepage": "http://underscorejs.org", - "keywords": [ - "util", - "functional", - "server", - "client", - "browser" - ], - "author": { - "name": "Jeremy Ashkenas", - "email": "jeremy@documentcloud.org" - }, - "repository": { - "type": "git", - "url": "git://github.com/documentcloud/underscore.git" - }, - "main": "underscore.js", - "version": "1.4.4", - "devDependencies": { - "phantomjs": "0.2.2" - }, - "scripts": { - "test": "phantomjs test/vendor/runner.js test/index.html?noglobals=true" - }, - "_id": "underscore@1.4.4", - "dist": { - "shasum": "61a6a32010622afa07963bf325203cf12239d604", - "tarball": "http://registry.npmjs.org/underscore/-/underscore-1.4.4.tgz" - }, - "_npmVersion": "1.1.63", - "_npmUser": { - "name": "jashkenas", - "email": "jashkenas@gmail.com" - }, - "maintainers": [ - { - "name": "jashkenas", - "email": "jashkenas@gmail.com" - } - ], - "directories": {}, - "_shasum": "61a6a32010622afa07963bf325203cf12239d604", - "_from": "underscore@~1.4.3", - "_resolved": "https://registry.npmjs.org/underscore/-/underscore-1.4.4.tgz", - "bugs": { - "url": "https://github.com/documentcloud/underscore/issues" - }, - "readme": "ERROR: No README data found!" -} diff --git a/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/underscore/underscore-min.js b/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/underscore/underscore-min.js deleted file mode 100644 index c1d9d3a..0000000 --- a/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/underscore/underscore-min.js +++ /dev/null @@ -1 +0,0 @@ -(function(){var n=this,t=n._,r={},e=Array.prototype,u=Object.prototype,i=Function.prototype,a=e.push,o=e.slice,c=e.concat,l=u.toString,f=u.hasOwnProperty,s=e.forEach,p=e.map,h=e.reduce,v=e.reduceRight,d=e.filter,g=e.every,m=e.some,y=e.indexOf,b=e.lastIndexOf,x=Array.isArray,_=Object.keys,j=i.bind,w=function(n){return n instanceof w?n:this instanceof w?(this._wrapped=n,void 0):new w(n)};"undefined"!=typeof exports?("undefined"!=typeof module&&module.exports&&(exports=module.exports=w),exports._=w):n._=w,w.VERSION="1.4.4";var A=w.each=w.forEach=function(n,t,e){if(null!=n)if(s&&n.forEach===s)n.forEach(t,e);else if(n.length===+n.length){for(var u=0,i=n.length;i>u;u++)if(t.call(e,n[u],u,n)===r)return}else for(var a in n)if(w.has(n,a)&&t.call(e,n[a],a,n)===r)return};w.map=w.collect=function(n,t,r){var e=[];return null==n?e:p&&n.map===p?n.map(t,r):(A(n,function(n,u,i){e[e.length]=t.call(r,n,u,i)}),e)};var O="Reduce of empty array with no initial value";w.reduce=w.foldl=w.inject=function(n,t,r,e){var u=arguments.length>2;if(null==n&&(n=[]),h&&n.reduce===h)return e&&(t=w.bind(t,e)),u?n.reduce(t,r):n.reduce(t);if(A(n,function(n,i,a){u?r=t.call(e,r,n,i,a):(r=n,u=!0)}),!u)throw new TypeError(O);return r},w.reduceRight=w.foldr=function(n,t,r,e){var u=arguments.length>2;if(null==n&&(n=[]),v&&n.reduceRight===v)return e&&(t=w.bind(t,e)),u?n.reduceRight(t,r):n.reduceRight(t);var i=n.length;if(i!==+i){var a=w.keys(n);i=a.length}if(A(n,function(o,c,l){c=a?a[--i]:--i,u?r=t.call(e,r,n[c],c,l):(r=n[c],u=!0)}),!u)throw new TypeError(O);return r},w.find=w.detect=function(n,t,r){var e;return E(n,function(n,u,i){return t.call(r,n,u,i)?(e=n,!0):void 0}),e},w.filter=w.select=function(n,t,r){var e=[];return null==n?e:d&&n.filter===d?n.filter(t,r):(A(n,function(n,u,i){t.call(r,n,u,i)&&(e[e.length]=n)}),e)},w.reject=function(n,t,r){return w.filter(n,function(n,e,u){return!t.call(r,n,e,u)},r)},w.every=w.all=function(n,t,e){t||(t=w.identity);var u=!0;return null==n?u:g&&n.every===g?n.every(t,e):(A(n,function(n,i,a){return(u=u&&t.call(e,n,i,a))?void 0:r}),!!u)};var E=w.some=w.any=function(n,t,e){t||(t=w.identity);var u=!1;return null==n?u:m&&n.some===m?n.some(t,e):(A(n,function(n,i,a){return u||(u=t.call(e,n,i,a))?r:void 0}),!!u)};w.contains=w.include=function(n,t){return null==n?!1:y&&n.indexOf===y?n.indexOf(t)!=-1:E(n,function(n){return n===t})},w.invoke=function(n,t){var r=o.call(arguments,2),e=w.isFunction(t);return w.map(n,function(n){return(e?t:n[t]).apply(n,r)})},w.pluck=function(n,t){return w.map(n,function(n){return n[t]})},w.where=function(n,t,r){return w.isEmpty(t)?r?null:[]:w[r?"find":"filter"](n,function(n){for(var r in t)if(t[r]!==n[r])return!1;return!0})},w.findWhere=function(n,t){return w.where(n,t,!0)},w.max=function(n,t,r){if(!t&&w.isArray(n)&&n[0]===+n[0]&&65535>n.length)return Math.max.apply(Math,n);if(!t&&w.isEmpty(n))return-1/0;var e={computed:-1/0,value:-1/0};return A(n,function(n,u,i){var a=t?t.call(r,n,u,i):n;a>=e.computed&&(e={value:n,computed:a})}),e.value},w.min=function(n,t,r){if(!t&&w.isArray(n)&&n[0]===+n[0]&&65535>n.length)return Math.min.apply(Math,n);if(!t&&w.isEmpty(n))return 1/0;var e={computed:1/0,value:1/0};return A(n,function(n,u,i){var a=t?t.call(r,n,u,i):n;e.computed>a&&(e={value:n,computed:a})}),e.value},w.shuffle=function(n){var t,r=0,e=[];return A(n,function(n){t=w.random(r++),e[r-1]=e[t],e[t]=n}),e};var k=function(n){return w.isFunction(n)?n:function(t){return t[n]}};w.sortBy=function(n,t,r){var e=k(t);return w.pluck(w.map(n,function(n,t,u){return{value:n,index:t,criteria:e.call(r,n,t,u)}}).sort(function(n,t){var r=n.criteria,e=t.criteria;if(r!==e){if(r>e||r===void 0)return 1;if(e>r||e===void 0)return-1}return n.indexi;){var o=i+a>>>1;u>r.call(e,n[o])?i=o+1:a=o}return i},w.toArray=function(n){return n?w.isArray(n)?o.call(n):n.length===+n.length?w.map(n,w.identity):w.values(n):[]},w.size=function(n){return null==n?0:n.length===+n.length?n.length:w.keys(n).length},w.first=w.head=w.take=function(n,t,r){return null==n?void 0:null==t||r?n[0]:o.call(n,0,t)},w.initial=function(n,t,r){return o.call(n,0,n.length-(null==t||r?1:t))},w.last=function(n,t,r){return null==n?void 0:null==t||r?n[n.length-1]:o.call(n,Math.max(n.length-t,0))},w.rest=w.tail=w.drop=function(n,t,r){return o.call(n,null==t||r?1:t)},w.compact=function(n){return w.filter(n,w.identity)};var R=function(n,t,r){return A(n,function(n){w.isArray(n)?t?a.apply(r,n):R(n,t,r):r.push(n)}),r};w.flatten=function(n,t){return R(n,t,[])},w.without=function(n){return w.difference(n,o.call(arguments,1))},w.uniq=w.unique=function(n,t,r,e){w.isFunction(t)&&(e=r,r=t,t=!1);var u=r?w.map(n,r,e):n,i=[],a=[];return A(u,function(r,e){(t?e&&a[a.length-1]===r:w.contains(a,r))||(a.push(r),i.push(n[e]))}),i},w.union=function(){return w.uniq(c.apply(e,arguments))},w.intersection=function(n){var t=o.call(arguments,1);return w.filter(w.uniq(n),function(n){return w.every(t,function(t){return w.indexOf(t,n)>=0})})},w.difference=function(n){var t=c.apply(e,o.call(arguments,1));return w.filter(n,function(n){return!w.contains(t,n)})},w.zip=function(){for(var n=o.call(arguments),t=w.max(w.pluck(n,"length")),r=Array(t),e=0;t>e;e++)r[e]=w.pluck(n,""+e);return r},w.object=function(n,t){if(null==n)return{};for(var r={},e=0,u=n.length;u>e;e++)t?r[n[e]]=t[e]:r[n[e][0]]=n[e][1];return r},w.indexOf=function(n,t,r){if(null==n)return-1;var e=0,u=n.length;if(r){if("number"!=typeof r)return e=w.sortedIndex(n,t),n[e]===t?e:-1;e=0>r?Math.max(0,u+r):r}if(y&&n.indexOf===y)return n.indexOf(t,r);for(;u>e;e++)if(n[e]===t)return e;return-1},w.lastIndexOf=function(n,t,r){if(null==n)return-1;var e=null!=r;if(b&&n.lastIndexOf===b)return e?n.lastIndexOf(t,r):n.lastIndexOf(t);for(var u=e?r:n.length;u--;)if(n[u]===t)return u;return-1},w.range=function(n,t,r){1>=arguments.length&&(t=n||0,n=0),r=arguments[2]||1;for(var e=Math.max(Math.ceil((t-n)/r),0),u=0,i=Array(e);e>u;)i[u++]=n,n+=r;return i},w.bind=function(n,t){if(n.bind===j&&j)return j.apply(n,o.call(arguments,1));var r=o.call(arguments,2);return function(){return n.apply(t,r.concat(o.call(arguments)))}},w.partial=function(n){var t=o.call(arguments,1);return function(){return n.apply(this,t.concat(o.call(arguments)))}},w.bindAll=function(n){var t=o.call(arguments,1);return 0===t.length&&(t=w.functions(n)),A(t,function(t){n[t]=w.bind(n[t],n)}),n},w.memoize=function(n,t){var r={};return t||(t=w.identity),function(){var e=t.apply(this,arguments);return w.has(r,e)?r[e]:r[e]=n.apply(this,arguments)}},w.delay=function(n,t){var r=o.call(arguments,2);return setTimeout(function(){return n.apply(null,r)},t)},w.defer=function(n){return w.delay.apply(w,[n,1].concat(o.call(arguments,1)))},w.throttle=function(n,t){var r,e,u,i,a=0,o=function(){a=new Date,u=null,i=n.apply(r,e)};return function(){var c=new Date,l=t-(c-a);return r=this,e=arguments,0>=l?(clearTimeout(u),u=null,a=c,i=n.apply(r,e)):u||(u=setTimeout(o,l)),i}},w.debounce=function(n,t,r){var e,u;return function(){var i=this,a=arguments,o=function(){e=null,r||(u=n.apply(i,a))},c=r&&!e;return clearTimeout(e),e=setTimeout(o,t),c&&(u=n.apply(i,a)),u}},w.once=function(n){var t,r=!1;return function(){return r?t:(r=!0,t=n.apply(this,arguments),n=null,t)}},w.wrap=function(n,t){return function(){var r=[n];return a.apply(r,arguments),t.apply(this,r)}},w.compose=function(){var n=arguments;return function(){for(var t=arguments,r=n.length-1;r>=0;r--)t=[n[r].apply(this,t)];return t[0]}},w.after=function(n,t){return 0>=n?t():function(){return 1>--n?t.apply(this,arguments):void 0}},w.keys=_||function(n){if(n!==Object(n))throw new TypeError("Invalid object");var t=[];for(var r in n)w.has(n,r)&&(t[t.length]=r);return t},w.values=function(n){var t=[];for(var r in n)w.has(n,r)&&t.push(n[r]);return t},w.pairs=function(n){var t=[];for(var r in n)w.has(n,r)&&t.push([r,n[r]]);return t},w.invert=function(n){var t={};for(var r in n)w.has(n,r)&&(t[n[r]]=r);return t},w.functions=w.methods=function(n){var t=[];for(var r in n)w.isFunction(n[r])&&t.push(r);return t.sort()},w.extend=function(n){return A(o.call(arguments,1),function(t){if(t)for(var r in t)n[r]=t[r]}),n},w.pick=function(n){var t={},r=c.apply(e,o.call(arguments,1));return A(r,function(r){r in n&&(t[r]=n[r])}),t},w.omit=function(n){var t={},r=c.apply(e,o.call(arguments,1));for(var u in n)w.contains(r,u)||(t[u]=n[u]);return t},w.defaults=function(n){return A(o.call(arguments,1),function(t){if(t)for(var r in t)null==n[r]&&(n[r]=t[r])}),n},w.clone=function(n){return w.isObject(n)?w.isArray(n)?n.slice():w.extend({},n):n},w.tap=function(n,t){return t(n),n};var I=function(n,t,r,e){if(n===t)return 0!==n||1/n==1/t;if(null==n||null==t)return n===t;n instanceof w&&(n=n._wrapped),t instanceof w&&(t=t._wrapped);var u=l.call(n);if(u!=l.call(t))return!1;switch(u){case"[object String]":return n==t+"";case"[object Number]":return n!=+n?t!=+t:0==n?1/n==1/t:n==+t;case"[object Date]":case"[object Boolean]":return+n==+t;case"[object RegExp]":return n.source==t.source&&n.global==t.global&&n.multiline==t.multiline&&n.ignoreCase==t.ignoreCase}if("object"!=typeof n||"object"!=typeof t)return!1;for(var i=r.length;i--;)if(r[i]==n)return e[i]==t;r.push(n),e.push(t);var a=0,o=!0;if("[object Array]"==u){if(a=n.length,o=a==t.length)for(;a--&&(o=I(n[a],t[a],r,e)););}else{var c=n.constructor,f=t.constructor;if(c!==f&&!(w.isFunction(c)&&c instanceof c&&w.isFunction(f)&&f instanceof f))return!1;for(var s in n)if(w.has(n,s)&&(a++,!(o=w.has(t,s)&&I(n[s],t[s],r,e))))break;if(o){for(s in t)if(w.has(t,s)&&!a--)break;o=!a}}return r.pop(),e.pop(),o};w.isEqual=function(n,t){return I(n,t,[],[])},w.isEmpty=function(n){if(null==n)return!0;if(w.isArray(n)||w.isString(n))return 0===n.length;for(var t in n)if(w.has(n,t))return!1;return!0},w.isElement=function(n){return!(!n||1!==n.nodeType)},w.isArray=x||function(n){return"[object Array]"==l.call(n)},w.isObject=function(n){return n===Object(n)},A(["Arguments","Function","String","Number","Date","RegExp"],function(n){w["is"+n]=function(t){return l.call(t)=="[object "+n+"]"}}),w.isArguments(arguments)||(w.isArguments=function(n){return!(!n||!w.has(n,"callee"))}),"function"!=typeof/./&&(w.isFunction=function(n){return"function"==typeof n}),w.isFinite=function(n){return isFinite(n)&&!isNaN(parseFloat(n))},w.isNaN=function(n){return w.isNumber(n)&&n!=+n},w.isBoolean=function(n){return n===!0||n===!1||"[object Boolean]"==l.call(n)},w.isNull=function(n){return null===n},w.isUndefined=function(n){return n===void 0},w.has=function(n,t){return f.call(n,t)},w.noConflict=function(){return n._=t,this},w.identity=function(n){return n},w.times=function(n,t,r){for(var e=Array(n),u=0;n>u;u++)e[u]=t.call(r,u);return e},w.random=function(n,t){return null==t&&(t=n,n=0),n+Math.floor(Math.random()*(t-n+1))};var M={escape:{"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"}};M.unescape=w.invert(M.escape);var S={escape:RegExp("["+w.keys(M.escape).join("")+"]","g"),unescape:RegExp("("+w.keys(M.unescape).join("|")+")","g")};w.each(["escape","unescape"],function(n){w[n]=function(t){return null==t?"":(""+t).replace(S[n],function(t){return M[n][t]})}}),w.result=function(n,t){if(null==n)return null;var r=n[t];return w.isFunction(r)?r.call(n):r},w.mixin=function(n){A(w.functions(n),function(t){var r=w[t]=n[t];w.prototype[t]=function(){var n=[this._wrapped];return a.apply(n,arguments),D.call(this,r.apply(w,n))}})};var N=0;w.uniqueId=function(n){var t=++N+"";return n?n+t:t},w.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g};var T=/(.)^/,q={"'":"'","\\":"\\","\r":"r","\n":"n"," ":"t","\u2028":"u2028","\u2029":"u2029"},B=/\\|'|\r|\n|\t|\u2028|\u2029/g;w.template=function(n,t,r){var e;r=w.defaults({},r,w.templateSettings);var u=RegExp([(r.escape||T).source,(r.interpolate||T).source,(r.evaluate||T).source].join("|")+"|$","g"),i=0,a="__p+='";n.replace(u,function(t,r,e,u,o){return a+=n.slice(i,o).replace(B,function(n){return"\\"+q[n]}),r&&(a+="'+\n((__t=("+r+"))==null?'':_.escape(__t))+\n'"),e&&(a+="'+\n((__t=("+e+"))==null?'':__t)+\n'"),u&&(a+="';\n"+u+"\n__p+='"),i=o+t.length,t}),a+="';\n",r.variable||(a="with(obj||{}){\n"+a+"}\n"),a="var __t,__p='',__j=Array.prototype.join,"+"print=function(){__p+=__j.call(arguments,'');};\n"+a+"return __p;\n";try{e=Function(r.variable||"obj","_",a)}catch(o){throw o.source=a,o}if(t)return e(t,w);var c=function(n){return e.call(this,n,w)};return c.source="function("+(r.variable||"obj")+"){\n"+a+"}",c},w.chain=function(n){return w(n).chain()};var D=function(n){return this._chain?w(n).chain():n};w.mixin(w),A(["pop","push","reverse","shift","sort","splice","unshift"],function(n){var t=e[n];w.prototype[n]=function(){var r=this._wrapped;return t.apply(r,arguments),"shift"!=n&&"splice"!=n||0!==r.length||delete r[0],D.call(this,r)}}),A(["concat","join","slice"],function(n){var t=e[n];w.prototype[n]=function(){return D.call(this,t.apply(this._wrapped,arguments))}}),w.extend(w.prototype,{chain:function(){return this._chain=!0,this},value:function(){return this._wrapped}})}).call(this); \ No newline at end of file diff --git a/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/underscore/underscore.js b/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/underscore/underscore.js deleted file mode 100644 index a12f0d9..0000000 --- a/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/underscore/underscore.js +++ /dev/null @@ -1,1226 +0,0 @@ -// Underscore.js 1.4.4 -// http://underscorejs.org -// (c) 2009-2013 Jeremy Ashkenas, DocumentCloud Inc. -// Underscore may be freely distributed under the MIT license. - -(function() { - - // Baseline setup - // -------------- - - // Establish the root object, `window` in the browser, or `global` on the server. - var root = this; - - // Save the previous value of the `_` variable. - var previousUnderscore = root._; - - // Establish the object that gets returned to break out of a loop iteration. - var breaker = {}; - - // Save bytes in the minified (but not gzipped) version: - var ArrayProto = Array.prototype, ObjProto = Object.prototype, FuncProto = Function.prototype; - - // Create quick reference variables for speed access to core prototypes. - var push = ArrayProto.push, - slice = ArrayProto.slice, - concat = ArrayProto.concat, - toString = ObjProto.toString, - hasOwnProperty = ObjProto.hasOwnProperty; - - // All **ECMAScript 5** native function implementations that we hope to use - // are declared here. - var - nativeForEach = ArrayProto.forEach, - nativeMap = ArrayProto.map, - nativeReduce = ArrayProto.reduce, - nativeReduceRight = ArrayProto.reduceRight, - nativeFilter = ArrayProto.filter, - nativeEvery = ArrayProto.every, - nativeSome = ArrayProto.some, - nativeIndexOf = ArrayProto.indexOf, - nativeLastIndexOf = ArrayProto.lastIndexOf, - nativeIsArray = Array.isArray, - nativeKeys = Object.keys, - nativeBind = FuncProto.bind; - - // Create a safe reference to the Underscore object for use below. - var _ = function(obj) { - if (obj instanceof _) return obj; - if (!(this instanceof _)) return new _(obj); - this._wrapped = obj; - }; - - // Export the Underscore object for **Node.js**, with - // backwards-compatibility for the old `require()` API. If we're in - // the browser, add `_` as a global object via a string identifier, - // for Closure Compiler "advanced" mode. - if (typeof exports !== 'undefined') { - if (typeof module !== 'undefined' && module.exports) { - exports = module.exports = _; - } - exports._ = _; - } else { - root._ = _; - } - - // Current version. - _.VERSION = '1.4.4'; - - // Collection Functions - // -------------------- - - // The cornerstone, an `each` implementation, aka `forEach`. - // Handles objects with the built-in `forEach`, arrays, and raw objects. - // Delegates to **ECMAScript 5**'s native `forEach` if available. - var each = _.each = _.forEach = function(obj, iterator, context) { - if (obj == null) return; - if (nativeForEach && obj.forEach === nativeForEach) { - obj.forEach(iterator, context); - } else if (obj.length === +obj.length) { - for (var i = 0, l = obj.length; i < l; i++) { - if (iterator.call(context, obj[i], i, obj) === breaker) return; - } - } else { - for (var key in obj) { - if (_.has(obj, key)) { - if (iterator.call(context, obj[key], key, obj) === breaker) return; - } - } - } - }; - - // Return the results of applying the iterator to each element. - // Delegates to **ECMAScript 5**'s native `map` if available. - _.map = _.collect = function(obj, iterator, context) { - var results = []; - if (obj == null) return results; - if (nativeMap && obj.map === nativeMap) return obj.map(iterator, context); - each(obj, function(value, index, list) { - results[results.length] = iterator.call(context, value, index, list); - }); - return results; - }; - - var reduceError = 'Reduce of empty array with no initial value'; - - // **Reduce** builds up a single result from a list of values, aka `inject`, - // or `foldl`. Delegates to **ECMAScript 5**'s native `reduce` if available. - _.reduce = _.foldl = _.inject = function(obj, iterator, memo, context) { - var initial = arguments.length > 2; - if (obj == null) obj = []; - if (nativeReduce && obj.reduce === nativeReduce) { - if (context) iterator = _.bind(iterator, context); - return initial ? obj.reduce(iterator, memo) : obj.reduce(iterator); - } - each(obj, function(value, index, list) { - if (!initial) { - memo = value; - initial = true; - } else { - memo = iterator.call(context, memo, value, index, list); - } - }); - if (!initial) throw new TypeError(reduceError); - return memo; - }; - - // The right-associative version of reduce, also known as `foldr`. - // Delegates to **ECMAScript 5**'s native `reduceRight` if available. - _.reduceRight = _.foldr = function(obj, iterator, memo, context) { - var initial = arguments.length > 2; - if (obj == null) obj = []; - if (nativeReduceRight && obj.reduceRight === nativeReduceRight) { - if (context) iterator = _.bind(iterator, context); - return initial ? obj.reduceRight(iterator, memo) : obj.reduceRight(iterator); - } - var length = obj.length; - if (length !== +length) { - var keys = _.keys(obj); - length = keys.length; - } - each(obj, function(value, index, list) { - index = keys ? keys[--length] : --length; - if (!initial) { - memo = obj[index]; - initial = true; - } else { - memo = iterator.call(context, memo, obj[index], index, list); - } - }); - if (!initial) throw new TypeError(reduceError); - return memo; - }; - - // Return the first value which passes a truth test. Aliased as `detect`. - _.find = _.detect = function(obj, iterator, context) { - var result; - any(obj, function(value, index, list) { - if (iterator.call(context, value, index, list)) { - result = value; - return true; - } - }); - return result; - }; - - // Return all the elements that pass a truth test. - // Delegates to **ECMAScript 5**'s native `filter` if available. - // Aliased as `select`. - _.filter = _.select = function(obj, iterator, context) { - var results = []; - if (obj == null) return results; - if (nativeFilter && obj.filter === nativeFilter) return obj.filter(iterator, context); - each(obj, function(value, index, list) { - if (iterator.call(context, value, index, list)) results[results.length] = value; - }); - return results; - }; - - // Return all the elements for which a truth test fails. - _.reject = function(obj, iterator, context) { - return _.filter(obj, function(value, index, list) { - return !iterator.call(context, value, index, list); - }, context); - }; - - // Determine whether all of the elements match a truth test. - // Delegates to **ECMAScript 5**'s native `every` if available. - // Aliased as `all`. - _.every = _.all = function(obj, iterator, context) { - iterator || (iterator = _.identity); - var result = true; - if (obj == null) return result; - if (nativeEvery && obj.every === nativeEvery) return obj.every(iterator, context); - each(obj, function(value, index, list) { - if (!(result = result && iterator.call(context, value, index, list))) return breaker; - }); - return !!result; - }; - - // Determine if at least one element in the object matches a truth test. - // Delegates to **ECMAScript 5**'s native `some` if available. - // Aliased as `any`. - var any = _.some = _.any = function(obj, iterator, context) { - iterator || (iterator = _.identity); - var result = false; - if (obj == null) return result; - if (nativeSome && obj.some === nativeSome) return obj.some(iterator, context); - each(obj, function(value, index, list) { - if (result || (result = iterator.call(context, value, index, list))) return breaker; - }); - return !!result; - }; - - // Determine if the array or object contains a given value (using `===`). - // Aliased as `include`. - _.contains = _.include = function(obj, target) { - if (obj == null) return false; - if (nativeIndexOf && obj.indexOf === nativeIndexOf) return obj.indexOf(target) != -1; - return any(obj, function(value) { - return value === target; - }); - }; - - // Invoke a method (with arguments) on every item in a collection. - _.invoke = function(obj, method) { - var args = slice.call(arguments, 2); - var isFunc = _.isFunction(method); - return _.map(obj, function(value) { - return (isFunc ? method : value[method]).apply(value, args); - }); - }; - - // Convenience version of a common use case of `map`: fetching a property. - _.pluck = function(obj, key) { - return _.map(obj, function(value){ return value[key]; }); - }; - - // Convenience version of a common use case of `filter`: selecting only objects - // containing specific `key:value` pairs. - _.where = function(obj, attrs, first) { - if (_.isEmpty(attrs)) return first ? null : []; - return _[first ? 'find' : 'filter'](obj, function(value) { - for (var key in attrs) { - if (attrs[key] !== value[key]) return false; - } - return true; - }); - }; - - // Convenience version of a common use case of `find`: getting the first object - // containing specific `key:value` pairs. - _.findWhere = function(obj, attrs) { - return _.where(obj, attrs, true); - }; - - // Return the maximum element or (element-based computation). - // Can't optimize arrays of integers longer than 65,535 elements. - // See: https://bugs.webkit.org/show_bug.cgi?id=80797 - _.max = function(obj, iterator, context) { - if (!iterator && _.isArray(obj) && obj[0] === +obj[0] && obj.length < 65535) { - return Math.max.apply(Math, obj); - } - if (!iterator && _.isEmpty(obj)) return -Infinity; - var result = {computed : -Infinity, value: -Infinity}; - each(obj, function(value, index, list) { - var computed = iterator ? iterator.call(context, value, index, list) : value; - computed >= result.computed && (result = {value : value, computed : computed}); - }); - return result.value; - }; - - // Return the minimum element (or element-based computation). - _.min = function(obj, iterator, context) { - if (!iterator && _.isArray(obj) && obj[0] === +obj[0] && obj.length < 65535) { - return Math.min.apply(Math, obj); - } - if (!iterator && _.isEmpty(obj)) return Infinity; - var result = {computed : Infinity, value: Infinity}; - each(obj, function(value, index, list) { - var computed = iterator ? iterator.call(context, value, index, list) : value; - computed < result.computed && (result = {value : value, computed : computed}); - }); - return result.value; - }; - - // Shuffle an array. - _.shuffle = function(obj) { - var rand; - var index = 0; - var shuffled = []; - each(obj, function(value) { - rand = _.random(index++); - shuffled[index - 1] = shuffled[rand]; - shuffled[rand] = value; - }); - return shuffled; - }; - - // An internal function to generate lookup iterators. - var lookupIterator = function(value) { - return _.isFunction(value) ? value : function(obj){ return obj[value]; }; - }; - - // Sort the object's values by a criterion produced by an iterator. - _.sortBy = function(obj, value, context) { - var iterator = lookupIterator(value); - return _.pluck(_.map(obj, function(value, index, list) { - return { - value : value, - index : index, - criteria : iterator.call(context, value, index, list) - }; - }).sort(function(left, right) { - var a = left.criteria; - var b = right.criteria; - if (a !== b) { - if (a > b || a === void 0) return 1; - if (a < b || b === void 0) return -1; - } - return left.index < right.index ? -1 : 1; - }), 'value'); - }; - - // An internal function used for aggregate "group by" operations. - var group = function(obj, value, context, behavior) { - var result = {}; - var iterator = lookupIterator(value || _.identity); - each(obj, function(value, index) { - var key = iterator.call(context, value, index, obj); - behavior(result, key, value); - }); - return result; - }; - - // Groups the object's values by a criterion. Pass either a string attribute - // to group by, or a function that returns the criterion. - _.groupBy = function(obj, value, context) { - return group(obj, value, context, function(result, key, value) { - (_.has(result, key) ? result[key] : (result[key] = [])).push(value); - }); - }; - - // Counts instances of an object that group by a certain criterion. Pass - // either a string attribute to count by, or a function that returns the - // criterion. - _.countBy = function(obj, value, context) { - return group(obj, value, context, function(result, key) { - if (!_.has(result, key)) result[key] = 0; - result[key]++; - }); - }; - - // Use a comparator function to figure out the smallest index at which - // an object should be inserted so as to maintain order. Uses binary search. - _.sortedIndex = function(array, obj, iterator, context) { - iterator = iterator == null ? _.identity : lookupIterator(iterator); - var value = iterator.call(context, obj); - var low = 0, high = array.length; - while (low < high) { - var mid = (low + high) >>> 1; - iterator.call(context, array[mid]) < value ? low = mid + 1 : high = mid; - } - return low; - }; - - // Safely convert anything iterable into a real, live array. - _.toArray = function(obj) { - if (!obj) return []; - if (_.isArray(obj)) return slice.call(obj); - if (obj.length === +obj.length) return _.map(obj, _.identity); - return _.values(obj); - }; - - // Return the number of elements in an object. - _.size = function(obj) { - if (obj == null) return 0; - return (obj.length === +obj.length) ? obj.length : _.keys(obj).length; - }; - - // Array Functions - // --------------- - - // Get the first element of an array. Passing **n** will return the first N - // values in the array. Aliased as `head` and `take`. The **guard** check - // allows it to work with `_.map`. - _.first = _.head = _.take = function(array, n, guard) { - if (array == null) return void 0; - return (n != null) && !guard ? slice.call(array, 0, n) : array[0]; - }; - - // Returns everything but the last entry of the array. Especially useful on - // the arguments object. Passing **n** will return all the values in - // the array, excluding the last N. The **guard** check allows it to work with - // `_.map`. - _.initial = function(array, n, guard) { - return slice.call(array, 0, array.length - ((n == null) || guard ? 1 : n)); - }; - - // Get the last element of an array. Passing **n** will return the last N - // values in the array. The **guard** check allows it to work with `_.map`. - _.last = function(array, n, guard) { - if (array == null) return void 0; - if ((n != null) && !guard) { - return slice.call(array, Math.max(array.length - n, 0)); - } else { - return array[array.length - 1]; - } - }; - - // Returns everything but the first entry of the array. Aliased as `tail` and `drop`. - // Especially useful on the arguments object. Passing an **n** will return - // the rest N values in the array. The **guard** - // check allows it to work with `_.map`. - _.rest = _.tail = _.drop = function(array, n, guard) { - return slice.call(array, (n == null) || guard ? 1 : n); - }; - - // Trim out all falsy values from an array. - _.compact = function(array) { - return _.filter(array, _.identity); - }; - - // Internal implementation of a recursive `flatten` function. - var flatten = function(input, shallow, output) { - each(input, function(value) { - if (_.isArray(value)) { - shallow ? push.apply(output, value) : flatten(value, shallow, output); - } else { - output.push(value); - } - }); - return output; - }; - - // Return a completely flattened version of an array. - _.flatten = function(array, shallow) { - return flatten(array, shallow, []); - }; - - // Return a version of the array that does not contain the specified value(s). - _.without = function(array) { - return _.difference(array, slice.call(arguments, 1)); - }; - - // Produce a duplicate-free version of the array. If the array has already - // been sorted, you have the option of using a faster algorithm. - // Aliased as `unique`. - _.uniq = _.unique = function(array, isSorted, iterator, context) { - if (_.isFunction(isSorted)) { - context = iterator; - iterator = isSorted; - isSorted = false; - } - var initial = iterator ? _.map(array, iterator, context) : array; - var results = []; - var seen = []; - each(initial, function(value, index) { - if (isSorted ? (!index || seen[seen.length - 1] !== value) : !_.contains(seen, value)) { - seen.push(value); - results.push(array[index]); - } - }); - return results; - }; - - // Produce an array that contains the union: each distinct element from all of - // the passed-in arrays. - _.union = function() { - return _.uniq(concat.apply(ArrayProto, arguments)); - }; - - // Produce an array that contains every item shared between all the - // passed-in arrays. - _.intersection = function(array) { - var rest = slice.call(arguments, 1); - return _.filter(_.uniq(array), function(item) { - return _.every(rest, function(other) { - return _.indexOf(other, item) >= 0; - }); - }); - }; - - // Take the difference between one array and a number of other arrays. - // Only the elements present in just the first array will remain. - _.difference = function(array) { - var rest = concat.apply(ArrayProto, slice.call(arguments, 1)); - return _.filter(array, function(value){ return !_.contains(rest, value); }); - }; - - // Zip together multiple lists into a single array -- elements that share - // an index go together. - _.zip = function() { - var args = slice.call(arguments); - var length = _.max(_.pluck(args, 'length')); - var results = new Array(length); - for (var i = 0; i < length; i++) { - results[i] = _.pluck(args, "" + i); - } - return results; - }; - - // Converts lists into objects. Pass either a single array of `[key, value]` - // pairs, or two parallel arrays of the same length -- one of keys, and one of - // the corresponding values. - _.object = function(list, values) { - if (list == null) return {}; - var result = {}; - for (var i = 0, l = list.length; i < l; i++) { - if (values) { - result[list[i]] = values[i]; - } else { - result[list[i][0]] = list[i][1]; - } - } - return result; - }; - - // If the browser doesn't supply us with indexOf (I'm looking at you, **MSIE**), - // we need this function. Return the position of the first occurrence of an - // item in an array, or -1 if the item is not included in the array. - // Delegates to **ECMAScript 5**'s native `indexOf` if available. - // If the array is large and already in sort order, pass `true` - // for **isSorted** to use binary search. - _.indexOf = function(array, item, isSorted) { - if (array == null) return -1; - var i = 0, l = array.length; - if (isSorted) { - if (typeof isSorted == 'number') { - i = (isSorted < 0 ? Math.max(0, l + isSorted) : isSorted); - } else { - i = _.sortedIndex(array, item); - return array[i] === item ? i : -1; - } - } - if (nativeIndexOf && array.indexOf === nativeIndexOf) return array.indexOf(item, isSorted); - for (; i < l; i++) if (array[i] === item) return i; - return -1; - }; - - // Delegates to **ECMAScript 5**'s native `lastIndexOf` if available. - _.lastIndexOf = function(array, item, from) { - if (array == null) return -1; - var hasIndex = from != null; - if (nativeLastIndexOf && array.lastIndexOf === nativeLastIndexOf) { - return hasIndex ? array.lastIndexOf(item, from) : array.lastIndexOf(item); - } - var i = (hasIndex ? from : array.length); - while (i--) if (array[i] === item) return i; - return -1; - }; - - // Generate an integer Array containing an arithmetic progression. A port of - // the native Python `range()` function. See - // [the Python documentation](http://docs.python.org/library/functions.html#range). - _.range = function(start, stop, step) { - if (arguments.length <= 1) { - stop = start || 0; - start = 0; - } - step = arguments[2] || 1; - - var len = Math.max(Math.ceil((stop - start) / step), 0); - var idx = 0; - var range = new Array(len); - - while(idx < len) { - range[idx++] = start; - start += step; - } - - return range; - }; - - // Function (ahem) Functions - // ------------------ - - // Create a function bound to a given object (assigning `this`, and arguments, - // optionally). Delegates to **ECMAScript 5**'s native `Function.bind` if - // available. - _.bind = function(func, context) { - if (func.bind === nativeBind && nativeBind) return nativeBind.apply(func, slice.call(arguments, 1)); - var args = slice.call(arguments, 2); - return function() { - return func.apply(context, args.concat(slice.call(arguments))); - }; - }; - - // Partially apply a function by creating a version that has had some of its - // arguments pre-filled, without changing its dynamic `this` context. - _.partial = function(func) { - var args = slice.call(arguments, 1); - return function() { - return func.apply(this, args.concat(slice.call(arguments))); - }; - }; - - // Bind all of an object's methods to that object. Useful for ensuring that - // all callbacks defined on an object belong to it. - _.bindAll = function(obj) { - var funcs = slice.call(arguments, 1); - if (funcs.length === 0) funcs = _.functions(obj); - each(funcs, function(f) { obj[f] = _.bind(obj[f], obj); }); - return obj; - }; - - // Memoize an expensive function by storing its results. - _.memoize = function(func, hasher) { - var memo = {}; - hasher || (hasher = _.identity); - return function() { - var key = hasher.apply(this, arguments); - return _.has(memo, key) ? memo[key] : (memo[key] = func.apply(this, arguments)); - }; - }; - - // Delays a function for the given number of milliseconds, and then calls - // it with the arguments supplied. - _.delay = function(func, wait) { - var args = slice.call(arguments, 2); - return setTimeout(function(){ return func.apply(null, args); }, wait); - }; - - // Defers a function, scheduling it to run after the current call stack has - // cleared. - _.defer = function(func) { - return _.delay.apply(_, [func, 1].concat(slice.call(arguments, 1))); - }; - - // Returns a function, that, when invoked, will only be triggered at most once - // during a given window of time. - _.throttle = function(func, wait) { - var context, args, timeout, result; - var previous = 0; - var later = function() { - previous = new Date; - timeout = null; - result = func.apply(context, args); - }; - return function() { - var now = new Date; - var remaining = wait - (now - previous); - context = this; - args = arguments; - if (remaining <= 0) { - clearTimeout(timeout); - timeout = null; - previous = now; - result = func.apply(context, args); - } else if (!timeout) { - timeout = setTimeout(later, remaining); - } - return result; - }; - }; - - // Returns a function, that, as long as it continues to be invoked, will not - // be triggered. The function will be called after it stops being called for - // N milliseconds. If `immediate` is passed, trigger the function on the - // leading edge, instead of the trailing. - _.debounce = function(func, wait, immediate) { - var timeout, result; - return function() { - var context = this, args = arguments; - var later = function() { - timeout = null; - if (!immediate) result = func.apply(context, args); - }; - var callNow = immediate && !timeout; - clearTimeout(timeout); - timeout = setTimeout(later, wait); - if (callNow) result = func.apply(context, args); - return result; - }; - }; - - // Returns a function that will be executed at most one time, no matter how - // often you call it. Useful for lazy initialization. - _.once = function(func) { - var ran = false, memo; - return function() { - if (ran) return memo; - ran = true; - memo = func.apply(this, arguments); - func = null; - return memo; - }; - }; - - // Returns the first function passed as an argument to the second, - // allowing you to adjust arguments, run code before and after, and - // conditionally execute the original function. - _.wrap = function(func, wrapper) { - return function() { - var args = [func]; - push.apply(args, arguments); - return wrapper.apply(this, args); - }; - }; - - // Returns a function that is the composition of a list of functions, each - // consuming the return value of the function that follows. - _.compose = function() { - var funcs = arguments; - return function() { - var args = arguments; - for (var i = funcs.length - 1; i >= 0; i--) { - args = [funcs[i].apply(this, args)]; - } - return args[0]; - }; - }; - - // Returns a function that will only be executed after being called N times. - _.after = function(times, func) { - if (times <= 0) return func(); - return function() { - if (--times < 1) { - return func.apply(this, arguments); - } - }; - }; - - // Object Functions - // ---------------- - - // Retrieve the names of an object's properties. - // Delegates to **ECMAScript 5**'s native `Object.keys` - _.keys = nativeKeys || function(obj) { - if (obj !== Object(obj)) throw new TypeError('Invalid object'); - var keys = []; - for (var key in obj) if (_.has(obj, key)) keys[keys.length] = key; - return keys; - }; - - // Retrieve the values of an object's properties. - _.values = function(obj) { - var values = []; - for (var key in obj) if (_.has(obj, key)) values.push(obj[key]); - return values; - }; - - // Convert an object into a list of `[key, value]` pairs. - _.pairs = function(obj) { - var pairs = []; - for (var key in obj) if (_.has(obj, key)) pairs.push([key, obj[key]]); - return pairs; - }; - - // Invert the keys and values of an object. The values must be serializable. - _.invert = function(obj) { - var result = {}; - for (var key in obj) if (_.has(obj, key)) result[obj[key]] = key; - return result; - }; - - // Return a sorted list of the function names available on the object. - // Aliased as `methods` - _.functions = _.methods = function(obj) { - var names = []; - for (var key in obj) { - if (_.isFunction(obj[key])) names.push(key); - } - return names.sort(); - }; - - // Extend a given object with all the properties in passed-in object(s). - _.extend = function(obj) { - each(slice.call(arguments, 1), function(source) { - if (source) { - for (var prop in source) { - obj[prop] = source[prop]; - } - } - }); - return obj; - }; - - // Return a copy of the object only containing the whitelisted properties. - _.pick = function(obj) { - var copy = {}; - var keys = concat.apply(ArrayProto, slice.call(arguments, 1)); - each(keys, function(key) { - if (key in obj) copy[key] = obj[key]; - }); - return copy; - }; - - // Return a copy of the object without the blacklisted properties. - _.omit = function(obj) { - var copy = {}; - var keys = concat.apply(ArrayProto, slice.call(arguments, 1)); - for (var key in obj) { - if (!_.contains(keys, key)) copy[key] = obj[key]; - } - return copy; - }; - - // Fill in a given object with default properties. - _.defaults = function(obj) { - each(slice.call(arguments, 1), function(source) { - if (source) { - for (var prop in source) { - if (obj[prop] == null) obj[prop] = source[prop]; - } - } - }); - return obj; - }; - - // Create a (shallow-cloned) duplicate of an object. - _.clone = function(obj) { - if (!_.isObject(obj)) return obj; - return _.isArray(obj) ? obj.slice() : _.extend({}, obj); - }; - - // Invokes interceptor with the obj, and then returns obj. - // The primary purpose of this method is to "tap into" a method chain, in - // order to perform operations on intermediate results within the chain. - _.tap = function(obj, interceptor) { - interceptor(obj); - return obj; - }; - - // Internal recursive comparison function for `isEqual`. - var eq = function(a, b, aStack, bStack) { - // Identical objects are equal. `0 === -0`, but they aren't identical. - // See the Harmony `egal` proposal: http://wiki.ecmascript.org/doku.php?id=harmony:egal. - if (a === b) return a !== 0 || 1 / a == 1 / b; - // A strict comparison is necessary because `null == undefined`. - if (a == null || b == null) return a === b; - // Unwrap any wrapped objects. - if (a instanceof _) a = a._wrapped; - if (b instanceof _) b = b._wrapped; - // Compare `[[Class]]` names. - var className = toString.call(a); - if (className != toString.call(b)) return false; - switch (className) { - // Strings, numbers, dates, and booleans are compared by value. - case '[object String]': - // Primitives and their corresponding object wrappers are equivalent; thus, `"5"` is - // equivalent to `new String("5")`. - return a == String(b); - case '[object Number]': - // `NaN`s are equivalent, but non-reflexive. An `egal` comparison is performed for - // other numeric values. - return a != +a ? b != +b : (a == 0 ? 1 / a == 1 / b : a == +b); - case '[object Date]': - case '[object Boolean]': - // Coerce dates and booleans to numeric primitive values. Dates are compared by their - // millisecond representations. Note that invalid dates with millisecond representations - // of `NaN` are not equivalent. - return +a == +b; - // RegExps are compared by their source patterns and flags. - case '[object RegExp]': - return a.source == b.source && - a.global == b.global && - a.multiline == b.multiline && - a.ignoreCase == b.ignoreCase; - } - if (typeof a != 'object' || typeof b != 'object') return false; - // Assume equality for cyclic structures. The algorithm for detecting cyclic - // structures is adapted from ES 5.1 section 15.12.3, abstract operation `JO`. - var length = aStack.length; - while (length--) { - // Linear search. Performance is inversely proportional to the number of - // unique nested structures. - if (aStack[length] == a) return bStack[length] == b; - } - // Add the first object to the stack of traversed objects. - aStack.push(a); - bStack.push(b); - var size = 0, result = true; - // Recursively compare objects and arrays. - if (className == '[object Array]') { - // Compare array lengths to determine if a deep comparison is necessary. - size = a.length; - result = size == b.length; - if (result) { - // Deep compare the contents, ignoring non-numeric properties. - while (size--) { - if (!(result = eq(a[size], b[size], aStack, bStack))) break; - } - } - } else { - // Objects with different constructors are not equivalent, but `Object`s - // from different frames are. - var aCtor = a.constructor, bCtor = b.constructor; - if (aCtor !== bCtor && !(_.isFunction(aCtor) && (aCtor instanceof aCtor) && - _.isFunction(bCtor) && (bCtor instanceof bCtor))) { - return false; - } - // Deep compare objects. - for (var key in a) { - if (_.has(a, key)) { - // Count the expected number of properties. - size++; - // Deep compare each member. - if (!(result = _.has(b, key) && eq(a[key], b[key], aStack, bStack))) break; - } - } - // Ensure that both objects contain the same number of properties. - if (result) { - for (key in b) { - if (_.has(b, key) && !(size--)) break; - } - result = !size; - } - } - // Remove the first object from the stack of traversed objects. - aStack.pop(); - bStack.pop(); - return result; - }; - - // Perform a deep comparison to check if two objects are equal. - _.isEqual = function(a, b) { - return eq(a, b, [], []); - }; - - // Is a given array, string, or object empty? - // An "empty" object has no enumerable own-properties. - _.isEmpty = function(obj) { - if (obj == null) return true; - if (_.isArray(obj) || _.isString(obj)) return obj.length === 0; - for (var key in obj) if (_.has(obj, key)) return false; - return true; - }; - - // Is a given value a DOM element? - _.isElement = function(obj) { - return !!(obj && obj.nodeType === 1); - }; - - // Is a given value an array? - // Delegates to ECMA5's native Array.isArray - _.isArray = nativeIsArray || function(obj) { - return toString.call(obj) == '[object Array]'; - }; - - // Is a given variable an object? - _.isObject = function(obj) { - return obj === Object(obj); - }; - - // Add some isType methods: isArguments, isFunction, isString, isNumber, isDate, isRegExp. - each(['Arguments', 'Function', 'String', 'Number', 'Date', 'RegExp'], function(name) { - _['is' + name] = function(obj) { - return toString.call(obj) == '[object ' + name + ']'; - }; - }); - - // Define a fallback version of the method in browsers (ahem, IE), where - // there isn't any inspectable "Arguments" type. - if (!_.isArguments(arguments)) { - _.isArguments = function(obj) { - return !!(obj && _.has(obj, 'callee')); - }; - } - - // Optimize `isFunction` if appropriate. - if (typeof (/./) !== 'function') { - _.isFunction = function(obj) { - return typeof obj === 'function'; - }; - } - - // Is a given object a finite number? - _.isFinite = function(obj) { - return isFinite(obj) && !isNaN(parseFloat(obj)); - }; - - // Is the given value `NaN`? (NaN is the only number which does not equal itself). - _.isNaN = function(obj) { - return _.isNumber(obj) && obj != +obj; - }; - - // Is a given value a boolean? - _.isBoolean = function(obj) { - return obj === true || obj === false || toString.call(obj) == '[object Boolean]'; - }; - - // Is a given value equal to null? - _.isNull = function(obj) { - return obj === null; - }; - - // Is a given variable undefined? - _.isUndefined = function(obj) { - return obj === void 0; - }; - - // Shortcut function for checking if an object has a given property directly - // on itself (in other words, not on a prototype). - _.has = function(obj, key) { - return hasOwnProperty.call(obj, key); - }; - - // Utility Functions - // ----------------- - - // Run Underscore.js in *noConflict* mode, returning the `_` variable to its - // previous owner. Returns a reference to the Underscore object. - _.noConflict = function() { - root._ = previousUnderscore; - return this; - }; - - // Keep the identity function around for default iterators. - _.identity = function(value) { - return value; - }; - - // Run a function **n** times. - _.times = function(n, iterator, context) { - var accum = Array(n); - for (var i = 0; i < n; i++) accum[i] = iterator.call(context, i); - return accum; - }; - - // Return a random integer between min and max (inclusive). - _.random = function(min, max) { - if (max == null) { - max = min; - min = 0; - } - return min + Math.floor(Math.random() * (max - min + 1)); - }; - - // List of HTML entities for escaping. - var entityMap = { - escape: { - '&': '&', - '<': '<', - '>': '>', - '"': '"', - "'": ''', - '/': '/' - } - }; - entityMap.unescape = _.invert(entityMap.escape); - - // Regexes containing the keys and values listed immediately above. - var entityRegexes = { - escape: new RegExp('[' + _.keys(entityMap.escape).join('') + ']', 'g'), - unescape: new RegExp('(' + _.keys(entityMap.unescape).join('|') + ')', 'g') - }; - - // Functions for escaping and unescaping strings to/from HTML interpolation. - _.each(['escape', 'unescape'], function(method) { - _[method] = function(string) { - if (string == null) return ''; - return ('' + string).replace(entityRegexes[method], function(match) { - return entityMap[method][match]; - }); - }; - }); - - // If the value of the named property is a function then invoke it; - // otherwise, return it. - _.result = function(object, property) { - if (object == null) return null; - var value = object[property]; - return _.isFunction(value) ? value.call(object) : value; - }; - - // Add your own custom functions to the Underscore object. - _.mixin = function(obj) { - each(_.functions(obj), function(name){ - var func = _[name] = obj[name]; - _.prototype[name] = function() { - var args = [this._wrapped]; - push.apply(args, arguments); - return result.call(this, func.apply(_, args)); - }; - }); - }; - - // Generate a unique integer id (unique within the entire client session). - // Useful for temporary DOM ids. - var idCounter = 0; - _.uniqueId = function(prefix) { - var id = ++idCounter + ''; - return prefix ? prefix + id : id; - }; - - // By default, Underscore uses ERB-style template delimiters, change the - // following template settings to use alternative delimiters. - _.templateSettings = { - evaluate : /<%([\s\S]+?)%>/g, - interpolate : /<%=([\s\S]+?)%>/g, - escape : /<%-([\s\S]+?)%>/g - }; - - // When customizing `templateSettings`, if you don't want to define an - // interpolation, evaluation or escaping regex, we need one that is - // guaranteed not to match. - var noMatch = /(.)^/; - - // Certain characters need to be escaped so that they can be put into a - // string literal. - var escapes = { - "'": "'", - '\\': '\\', - '\r': 'r', - '\n': 'n', - '\t': 't', - '\u2028': 'u2028', - '\u2029': 'u2029' - }; - - var escaper = /\\|'|\r|\n|\t|\u2028|\u2029/g; - - // JavaScript micro-templating, similar to John Resig's implementation. - // Underscore templating handles arbitrary delimiters, preserves whitespace, - // and correctly escapes quotes within interpolated code. - _.template = function(text, data, settings) { - var render; - settings = _.defaults({}, settings, _.templateSettings); - - // Combine delimiters into one regular expression via alternation. - var matcher = new RegExp([ - (settings.escape || noMatch).source, - (settings.interpolate || noMatch).source, - (settings.evaluate || noMatch).source - ].join('|') + '|$', 'g'); - - // Compile the template source, escaping string literals appropriately. - var index = 0; - var source = "__p+='"; - text.replace(matcher, function(match, escape, interpolate, evaluate, offset) { - source += text.slice(index, offset) - .replace(escaper, function(match) { return '\\' + escapes[match]; }); - - if (escape) { - source += "'+\n((__t=(" + escape + "))==null?'':_.escape(__t))+\n'"; - } - if (interpolate) { - source += "'+\n((__t=(" + interpolate + "))==null?'':__t)+\n'"; - } - if (evaluate) { - source += "';\n" + evaluate + "\n__p+='"; - } - index = offset + match.length; - return match; - }); - source += "';\n"; - - // If a variable is not specified, place data values in local scope. - if (!settings.variable) source = 'with(obj||{}){\n' + source + '}\n'; - - source = "var __t,__p='',__j=Array.prototype.join," + - "print=function(){__p+=__j.call(arguments,'');};\n" + - source + "return __p;\n"; - - try { - render = new Function(settings.variable || 'obj', '_', source); - } catch (e) { - e.source = source; - throw e; - } - - if (data) return render(data, _); - var template = function(data) { - return render.call(this, data, _); - }; - - // Provide the compiled function source as a convenience for precompilation. - template.source = 'function(' + (settings.variable || 'obj') + '){\n' + source + '}'; - - return template; - }; - - // Add a "chain" function, which will delegate to the wrapper. - _.chain = function(obj) { - return _(obj).chain(); - }; - - // OOP - // --------------- - // If Underscore is called as a function, it returns a wrapped object that - // can be used OO-style. This wrapper holds altered versions of all the - // underscore functions. Wrapped objects may be chained. - - // Helper function to continue chaining intermediate results. - var result = function(obj) { - return this._chain ? _(obj).chain() : obj; - }; - - // Add all of the Underscore functions to the wrapper object. - _.mixin(_); - - // Add all mutator Array functions to the wrapper. - each(['pop', 'push', 'reverse', 'shift', 'sort', 'splice', 'unshift'], function(name) { - var method = ArrayProto[name]; - _.prototype[name] = function() { - var obj = this._wrapped; - method.apply(obj, arguments); - if ((name == 'shift' || name == 'splice') && obj.length === 0) delete obj[0]; - return result.call(this, obj); - }; - }); - - // Add all accessor Array functions to the wrapper. - each(['concat', 'join', 'slice'], function(name) { - var method = ArrayProto[name]; - _.prototype[name] = function() { - return result.call(this, method.apply(this._wrapped, arguments)); - }; - }); - - _.extend(_.prototype, { - - // Start chaining a wrapped Underscore object. - chain: function() { - this._chain = true; - return this; - }, - - // Extracts the result from a wrapped and chained object. - value: function() { - return this._wrapped; - } - - }); - -}).call(this); diff --git a/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/package.json b/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/package.json index 19c13e2..fbeed32 100644 --- a/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/package.json +++ b/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/package.json @@ -1,7 +1,7 @@ { "name": "argparse", "description": "Very powerful CLI arguments parser. Native port of argparse - python's options parsing library", - "version": "0.1.15", + "version": "1.0.1", "keywords": [ "cli", "parser", @@ -21,10 +21,7 @@ "bugs": { "url": "https://github.com/nodeca/argparse/issues" }, - "license": { - "type": "MIT", - "url": "https://github.com/nodeca/argparse/blob/master/LICENSE" - }, + "license": "MIT", "repository": { "type": "git", "url": "git://github.com/nodeca/argparse.git" @@ -34,25 +31,17 @@ "test": "make test" }, "dependencies": { - "underscore": "~1.4.3", - "underscore.string": "~2.3.1" + "lodash": "~3.2", + "sprintf-js": "~1.0.2" }, "devDependencies": { "mocha": "*" }, - "engines": { - "node": ">= 0.6.0" - }, - "readme": "argparse\n========\n\n[![Build Status](https://secure.travis-ci.org/nodeca/argparse.png?branch=master)](http://travis-ci.org/nodeca/argparse)\n\nCLI arguments parser for node.js. Javascript port of python's\n[argparse](http://docs.python.org/dev/library/argparse.html) module\n(original version 3.2). That's a full port, except some very rare options,\nrecorded in issue tracker.\n\n**NB.** Method names changed to camelCase. See [generated docs](http://nodeca.github.com/argparse/).\n\n\nExample\n=======\n\ntest.js file:\n\n```javascript\n#!/usr/bin/env node\n'use strict';\n\nvar ArgumentParser = require('../lib/argparse').ArgumentParser;\nvar parser = new ArgumentParser({\n version: '0.0.1',\n addHelp:true,\n description: 'Argparse example'\n});\nparser.addArgument(\n [ '-f', '--foo' ],\n {\n help: 'foo bar'\n }\n);\nparser.addArgument(\n [ '-b', '--bar' ],\n {\n help: 'bar foo'\n }\n);\nvar args = parser.parseArgs();\nconsole.dir(args);\n```\n\nDisplay help:\n\n```\n$ ./test.js -h\nusage: example.js [-h] [-v] [-f FOO] [-b BAR]\n\nArgparse example\n\nOptional arguments:\n -h, --help Show this help message and exit.\n -v, --version Show program's version number and exit.\n -f FOO, --foo FOO foo bar\n -b BAR, --bar BAR bar foo\n```\n\nParse arguments:\n\n```\n$ ./test.js -f=3 --bar=4\n{ foo: '3', bar: '4' }\n```\n\nMore [examples](https://github.com/nodeca/argparse/tree/master/examples).\n\n\nArgumentParser objects\n======================\n\n```\nnew ArgumentParser({paramters hash});\n```\n\nCreates a new ArgumentParser object.\n\n**Supported params:**\n\n- ```description``` - Text to display before the argument help.\n- ```epilog``` - Text to display after the argument help.\n- ```addHelp``` - Add a -h/–help option to the parser. (default: True)\n- ```argumentDefault``` - Set the global default value for arguments. (default: None)\n- ```parents``` - A list of ArgumentParser objects whose arguments should also be included.\n- ```prefixChars``` - The set of characters that prefix optional arguments. (default: ‘-‘)\n- ```formatterClass``` - A class for customizing the help output.\n- ```prog``` - The name of the program (default: sys.argv[0])\n- ```usage``` - The string describing the program usage (default: generated)\n- ```conflictHandler``` - Usually unnecessary, defines strategy for resolving conflicting optionals.\n\n**Not supportied yet**\n\n- ```fromfilePrefixChars``` - The set of characters that prefix files from which additional arguments should be read.\n\n\nDetails in [original ArgumentParser guide](http://docs.python.org/dev/library/argparse.html#argumentparser-objects)\n\n\naddArgument() method\n====================\n\n```\nArgumentParser.addArgument([names or flags], {options})\n```\n\nDefines how a single command-line argument should be parsed.\n\n- ```name or flags``` - Either a name or a list of option strings, e.g. foo or -f, --foo.\n\nOptions:\n\n- ```action``` - The basic type of action to be taken when this argument is encountered at the command line.\n- ```nargs```- The number of command-line arguments that should be consumed.\n- ```constant``` - A constant value required by some action and nargs selections.\n- ```defaultValue``` - The value produced if the argument is absent from the command line.\n- ```type``` - The type to which the command-line argument should be converted.\n- ```choices``` - A container of the allowable values for the argument.\n- ```required``` - Whether or not the command-line option may be omitted (optionals only).\n- ```help``` - A brief description of what the argument does.\n- ```metavar``` - A name for the argument in usage messages.\n- ```dest``` - The name of the attribute to be added to the object returned by parseArgs().\n\nDetails in [original add_argument guide](http://docs.python.org/dev/library/argparse.html#the-add-argument-method)\n\n\nAction (some details)\n================\n\nArgumentParser objects associate command-line arguments with actions.\nThese actions can do just about anything with the command-line arguments associated\nwith them, though most actions simply add an attribute to the object returned by\nparseArgs(). The action keyword argument specifies how the command-line arguments\nshould be handled. The supported actions are:\n\n- ```store``` - Just stores the argument’s value. This is the default action.\n- ```storeConst``` - Stores value, specified by the const keyword argument.\n (Note that the const keyword argument defaults to the rather unhelpful None.)\n The 'storeConst' action is most commonly used with optional arguments, that\n specify some sort of flag.\n- ```storeTrue``` and ```storeFalse``` - Stores values True and False\n respectively. These are special cases of 'storeConst'.\n- ```append``` - Stores a list, and appends each argument value to the list.\n This is useful to allow an option to be specified multiple times.\n- ```appendConst``` - Stores a list, and appends value, specified by the\n const keyword argument to the list. (Note, that the const keyword argument defaults\n is None.) The 'appendConst' action is typically used when multiple arguments need\n to store constants to the same list.\n- ```count``` - Counts the number of times a keyword argument occurs. For example,\n used for increasing verbosity levels.\n- ```help``` - Prints a complete help message for all the options in the current\n parser and then exits. By default a help action is automatically added to the parser.\n See ArgumentParser for details of how the output is created.\n- ```version``` - Prints version information and exit. Expects a `version=`\n keyword argument in the addArgument() call.\n\nDetails in [original action guide](http://docs.python.org/dev/library/argparse.html#action)\n\n\nSub-commands\n============\n\nArgumentParser.addSubparsers()\n\nMany programs split their functionality into a number of sub-commands, for\nexample, the svn program can invoke sub-commands like `svn checkout`, `svn update`,\nand `svn commit`. Splitting up functionality this way can be a particularly good\nidea when a program performs several different functions which require different\nkinds of command-line arguments. `ArgumentParser` supports creation of such\nsub-commands with `addSubparsers()` method. The `addSubparsers()` method is\nnormally called with no arguments and returns an special action object.\nThis object has a single method `addParser()`, which takes a command name and\nany `ArgumentParser` constructor arguments, and returns an `ArgumentParser` object\nthat can be modified as usual.\n\nExample:\n\nsub_commands.js\n```javascript\n#!/usr/bin/env node\n'use strict';\n\nvar ArgumentParser = require('../lib/argparse').ArgumentParser;\nvar parser = new ArgumentParser({\n version: '0.0.1',\n addHelp:true,\n description: 'Argparse examples: sub-commands',\n});\n\nvar subparsers = parser.addSubparsers({\n title:'subcommands',\n dest:\"subcommand_name\"\n});\n\nvar bar = subparsers.addParser('c1', {addHelp:true});\nbar.addArgument(\n [ '-f', '--foo' ],\n {\n action: 'store',\n help: 'foo3 bar3'\n }\n);\nvar bar = subparsers.addParser(\n 'c2',\n {aliases:['co'], addHelp:true}\n);\nbar.addArgument(\n [ '-b', '--bar' ],\n {\n action: 'store',\n type: 'int',\n help: 'foo3 bar3'\n }\n);\n\nvar args = parser.parseArgs();\nconsole.dir(args);\n\n```\n\nDetails in [original sub-commands guide](http://docs.python.org/dev/library/argparse.html#sub-commands)\n\n\nContributors\n============\n\n- [Eugene Shkuropat](https://github.com/shkuropat)\n- [Paul Jacobson](https://github.com/hpaulj)\n\n[others](https://github.com/nodeca/argparse/graphs/contributors)\n\nLicense\n=======\n\nCopyright (c) 2012 [Vitaly Puzrin](https://github.com/puzrin).\nReleased under the MIT license. See\n[LICENSE](https://github.com/nodeca/argparse/blob/master/LICENSE) for details.\n\n\n", - "readmeFilename": "README.md", - "_id": "argparse@0.1.15", - "dist": { - "shasum": "28a1f72c43113e763220e5708414301c8840f0a1", - "tarball": "http://registry.npmjs.org/argparse/-/argparse-0.1.15.tgz" - }, - "_from": "argparse@~ 0.1.11", - "_resolved": "https://registry.npmjs.org/argparse/-/argparse-0.1.15.tgz", - "_npmVersion": "1.2.18", + "gitHead": "84b31478e66f3352fa62f3f884ccdf97352d33b5", + "_id": "argparse@1.0.1", + "_shasum": "cb1010b8559920fc8aee521eb9e80e4851790923", + "_from": "argparse@~ 1.0.0", + "_npmVersion": "1.4.28", "_npmUser": { "name": "vitaly", "email": "vitaly@rcdesign.ru" @@ -63,6 +52,10 @@ "email": "vitaly@rcdesign.ru" } ], + "dist": { + "shasum": "cb1010b8559920fc8aee521eb9e80e4851790923", + "tarball": "http://registry.npmjs.org/argparse/-/argparse-1.0.1.tgz" + }, "directories": {}, - "_shasum": "28a1f72c43113e763220e5708414301c8840f0a1" + "_resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.1.tgz" } diff --git a/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/esprima/README.md b/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/esprima/README.md index a74bd12..f7a9a21 100644 --- a/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/esprima/README.md +++ b/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/esprima/README.md @@ -1,73 +1,24 @@ -**Esprima** ([esprima.org](http://esprima.org)) is a high performance, +**Esprima** ([esprima.org](http://esprima.org), BSD license) is a high performance, standard-compliant [ECMAScript](http://www.ecma-international.org/publications/standards/Ecma-262.htm) parser written in ECMAScript (also popularly known as [JavaScript](http://en.wikipedia.org/wiki/JavaScript>JavaScript)). Esprima is created and maintained by [Ariya Hidayat](http://twitter.com/ariyahidayat), -with the help of [many contributors](https://github.com/ariya/esprima/contributors). - -Esprima runs on web browsers (IE 6+, Firefox 1+, Safari 3+, Chrome 1+, Konqueror 4.6+, Opera 8+) as well as -[Node.js](http://nodejs.org). +with the help of [many contributors](https://github.com/jquery/esprima/contributors). ### Features -- Full support for [ECMAScript 5.1](http://www.ecma-international.org/publications/standards/Ecma-262.htm)(ECMA-262) +- Full support for ECMAScript 5.1 ([ECMA-262](http://www.ecma-international.org/publications/standards/Ecma-262.htm)) - Sensible [syntax tree format](http://esprima.org/doc/index.html#ast) compatible with Mozilla [Parser AST](https://developer.mozilla.org/en/SpiderMonkey/Parser_API) -- Heavily tested (> 550 [unit tests](http://esprima.org/test/) with solid 100% statement coverage) - Optional tracking of syntax node location (index-based and line-column) -- Experimental support for ES6/Harmony (module, class, destructuring, ...) - -Esprima is blazing fast (see the [benchmark suite](http://esprima.org/test/benchmarks.html)). -It is up to 3x faster than UglifyJS v1 and it is still [competitive](http://esprima.org/test/compare.html) -with the new generation of fast parsers. - -### Applications - -Esprima serves as the basis for many popular JavaScript development tools: - -- Code coverage analysis: [node-cover](https://github.com/itay/node-cover), [Istanbul](https://github.com/yahoo/Istanbul) -- Documentation tool: [JFDoc](https://github.com/thejohnfreeman/jfdoc), [JSDuck](https://github.com/senchalabs/jsduck) -- Language extension: [LLJS](http://mbebenita.github.com/LLJS/) (low-level JS), -[Sweet.js](http://sweetjs.org/) (macro) -- ES6/Harmony transpiler: [Six](https://github.com/matthewrobb/six), [Harmonizr](https://github.com/jdiamond/harmonizr) -- Eclipse Orion smart editing ([outline view](https://github.com/aclement/esprima-outline), [content assist](http://contraptionsforprogramming.blogspot.com/2012/02/better-javascript-content-assist-in.html)) -- Source code modification: [Esmorph](https://github.com/ariya/esmorph), [Code Painter](https://github.com/fawek/codepainter), -- Source transformation: [node-falafel](https://github.com/substack/node-falafel), [Esmangle](https://github.com/Constellation/esmangle), [escodegen](https://github.com/Constellation/escodegen) - -### Questions? -- [Documentation](http://esprima.org/doc) -- [Issue tracker](http://issues.esprima.org): [known problems](http://code.google.com/p/esprima/issues/list?q=Defect) -and [future plans](http://code.google.com/p/esprima/issues/list?q=Enhancement) -- [Mailing list](http://groups.google.com/group/esprima) -- [Contribution guide](http://esprima.org/doc/index.html#contribution) - -Follow [@Esprima](http://twitter.com/Esprima) on Twitter to get the -development updates. -Feedback and contribution are welcomed! - -### License - -Copyright (C) 2012, 2011 [Ariya Hidayat](http://ariya.ofilabs.com/about) - and other contributors. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. +- Heavily tested (> 700 [unit tests](http://esprima.org/test/) with [full code coverage](http://esprima.org/test/coverage.html)) +- [Partial support](http://esprima.org/doc/es6.html) for ECMAScript 6 - * 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. +Esprima serves as a **building block** for some JavaScript +language tools, from [code instrumentation](http://esprima.org/demo/functiontrace.html) +to [editor autocompletion](http://esprima.org/demo/autocomplete.html). -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -ARE DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF -THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +Esprima runs on many popular web browsers, as well as other ECMAScript platforms such as +[Rhino](http://www.mozilla.org/rhino), [Nashorn](http://openjdk.java.net/projects/nashorn/), and [Node.js](https://npmjs.org/package/esprima). +For more information, check the web site [esprima.org](http://esprima.org). diff --git a/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/esprima/bin/esparse.js b/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/esprima/bin/esparse.js index 3e7bb81..5603666 100755 --- a/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/esprima/bin/esparse.js +++ b/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/esprima/bin/esparse.js @@ -107,10 +107,20 @@ if (typeof fname !== 'string') { process.exit(1); } +// Special handling for regular expression literal since we need to +// convert it to a string literal, otherwise it will be decoded +// as object "{}" and the regular expression would be lost. +function adjustRegexLiteral(key, value) { + if (key === 'value' && value instanceof RegExp) { + value = value.toString(); + } + return value; +} + try { content = fs.readFileSync(fname, 'utf-8'); syntax = esprima.parse(content, options); - console.log(JSON.stringify(syntax, null, 4)); + console.log(JSON.stringify(syntax, adjustRegexLiteral, 4)); } catch (e) { console.log('Error: ' + e.message); process.exit(1); diff --git a/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/esprima/bin/esvalidate.js b/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/esprima/bin/esvalidate.js index e0af3f7..dddd8a2 100755 --- a/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/esprima/bin/esvalidate.js +++ b/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/esprima/bin/esvalidate.js @@ -24,20 +24,38 @@ */ /*jslint sloppy:true plusplus:true node:true rhino:true */ - -var fs, esprima, options, fnames, count; - -if (typeof require === 'function') { - fs = require('fs'); - esprima = require('esprima'); -} else if (typeof load === 'function') { - try { - load('esprima.js'); - } catch (e) { - load('../esprima.js'); +/*global phantom:true */ + +var fs, system, esprima, options, fnames, count; + +if (typeof esprima === 'undefined') { + // PhantomJS can only require() relative files + if (typeof phantom === 'object') { + fs = require('fs'); + system = require('system'); + esprima = require('./esprima'); + } else if (typeof require === 'function') { + fs = require('fs'); + esprima = require('esprima'); + } else if (typeof load === 'function') { + try { + load('esprima.js'); + } catch (e) { + load('../esprima.js'); + } } } +// Shims to Node.js objects when running under PhantomJS 1.7+. +if (typeof phantom === 'object') { + fs.readFileSync = fs.read; + process = { + argv: [].slice.call(system.args), + exit: phantom.exit + }; + process.argv.unshift('phantomjs'); +} + // Shims to Node.js objects when running under Rhino. if (typeof console === 'undefined' && typeof process === 'undefined') { console = { log: print }; @@ -175,3 +193,7 @@ if (options.format === 'junit') { if (count > 0) { process.exit(1); } + +if (count === 0 && typeof phantom === 'object') { + process.exit(0); +} diff --git a/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/esprima/esprima.js b/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/esprima/esprima.js index f1320da..a1f80c8 100644 --- a/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/esprima/esprima.js +++ b/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/esprima/esprima.js @@ -1,4 +1,7 @@ /* + Copyright (C) 2013 Ariya Hidayat + Copyright (C) 2013 Thaddee Tyl + Copyright (C) 2013 Mathias Bynens Copyright (C) 2012 Ariya Hidayat Copyright (C) 2012 Mathias Bynens Copyright (C) 2012 Joost-Wim Boekesteijn @@ -28,20 +31,13 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -/*jslint bitwise:true plusplus:true */ -/*global esprima:true, define:true, exports:true, window: true, -throwError: true, createLiteral: true, generateStatement: true, -parseAssignmentExpression: true, parseBlock: true, parseExpression: true, -parseFunctionDeclaration: true, parseFunctionExpression: true, -parseFunctionSourceElements: true, parseVariableIdentifier: true, -parseLeftHandSideExpression: true, -parseStatement: true, parseSourceElement: true */ - (function (root, factory) { 'use strict'; // Universal Module Definition (UMD) to support AMD, CommonJS/Node.js, // Rhino, and plain browser loading. + + /* istanbul ignore next */ if (typeof define === 'function' && define.amd) { define(['exports'], factory); } else if (typeof exports !== 'undefined') { @@ -54,7 +50,9 @@ parseStatement: true, parseSourceElement: true */ var Token, TokenName, + FnExprTokens, Syntax, + PlaceHolders, PropertyKind, Messages, Regex, @@ -64,7 +62,7 @@ parseStatement: true, parseSourceElement: true */ lineNumber, lineStart, length, - buffer, + lookahead, state, extra; @@ -76,7 +74,8 @@ parseStatement: true, parseSourceElement: true */ NullLiteral: 5, NumericLiteral: 6, Punctuator: 7, - StringLiteral: 8 + StringLiteral: 8, + RegularExpression: 9 }; TokenName = {}; @@ -88,10 +87,23 @@ parseStatement: true, parseSourceElement: true */ TokenName[Token.NumericLiteral] = 'Numeric'; TokenName[Token.Punctuator] = 'Punctuator'; TokenName[Token.StringLiteral] = 'String'; + TokenName[Token.RegularExpression] = 'RegularExpression'; + + // A function following one of those tokens is an expression. + FnExprTokens = ['(', '{', '[', 'in', 'typeof', 'instanceof', 'new', + 'return', 'case', 'delete', 'throw', 'void', + // assignment operators + '=', '+=', '-=', '*=', '/=', '%=', '<<=', '>>=', '>>>=', + '&=', '|=', '^=', ',', + // binary/unary operators + '+', '-', '*', '/', '%', '++', '--', '<<', '>>', '>>>', '&', + '|', '^', '!', '~', '&&', '||', '?', ':', '===', '==', '>=', + '<=', '<', '>', '!=', '!==']; Syntax = { AssignmentExpression: 'AssignmentExpression', ArrayExpression: 'ArrayExpression', + ArrowFunctionExpression: 'ArrowFunctionExpression', BlockStatement: 'BlockStatement', BinaryExpression: 'BinaryExpression', BreakStatement: 'BreakStatement', @@ -132,6 +144,12 @@ parseStatement: true, parseSourceElement: true */ WithStatement: 'WithStatement' }; + PlaceHolders = { + ArrowParameterPlaceHolder: { + type: 'ArrowParameterPlaceHolder' + } + }; + PropertyKind = { Data: 1, Get: 2, @@ -140,45 +158,45 @@ parseStatement: true, parseSourceElement: true */ // Error messages should be identical to V8. Messages = { - UnexpectedToken: 'Unexpected token %0', - UnexpectedNumber: 'Unexpected number', - UnexpectedString: 'Unexpected string', - UnexpectedIdentifier: 'Unexpected identifier', - UnexpectedReserved: 'Unexpected reserved word', - UnexpectedEOS: 'Unexpected end of input', - NewlineAfterThrow: 'Illegal newline after throw', + UnexpectedToken: 'Unexpected token %0', + UnexpectedNumber: 'Unexpected number', + UnexpectedString: 'Unexpected string', + UnexpectedIdentifier: 'Unexpected identifier', + UnexpectedReserved: 'Unexpected reserved word', + UnexpectedEOS: 'Unexpected end of input', + NewlineAfterThrow: 'Illegal newline after throw', InvalidRegExp: 'Invalid regular expression', - UnterminatedRegExp: 'Invalid regular expression: missing /', - InvalidLHSInAssignment: 'Invalid left-hand side in assignment', - InvalidLHSInForIn: 'Invalid left-hand side in for-in', + UnterminatedRegExp: 'Invalid regular expression: missing /', + InvalidLHSInAssignment: 'Invalid left-hand side in assignment', + InvalidLHSInForIn: 'Invalid left-hand side in for-in', MultipleDefaultsInSwitch: 'More than one default clause in switch statement', - NoCatchOrFinally: 'Missing catch or finally after try', + NoCatchOrFinally: 'Missing catch or finally after try', UnknownLabel: 'Undefined label \'%0\'', Redeclaration: '%0 \'%1\' has already been declared', IllegalContinue: 'Illegal continue statement', IllegalBreak: 'Illegal break statement', IllegalReturn: 'Illegal return statement', - StrictModeWith: 'Strict mode code may not include a with statement', - StrictCatchVariable: 'Catch variable may not be eval or arguments in strict mode', - StrictVarName: 'Variable name may not be eval or arguments in strict mode', - StrictParamName: 'Parameter name eval or arguments is not allowed in strict mode', + StrictModeWith: 'Strict mode code may not include a with statement', + StrictCatchVariable: 'Catch variable may not be eval or arguments in strict mode', + StrictVarName: 'Variable name may not be eval or arguments in strict mode', + StrictParamName: 'Parameter name eval or arguments is not allowed in strict mode', StrictParamDupe: 'Strict mode function may not have duplicate parameter names', - StrictFunctionName: 'Function name may not be eval or arguments in strict mode', - StrictOctalLiteral: 'Octal literals are not allowed in strict mode.', - StrictDelete: 'Delete of an unqualified identifier in strict mode.', - StrictDuplicateProperty: 'Duplicate data property in object literal not allowed in strict mode', - AccessorDataProperty: 'Object literal may not have data and accessor property with the same name', - AccessorGetSet: 'Object literal may not have multiple get/set accessors with the same name', - StrictLHSAssignment: 'Assignment to eval or arguments is not allowed in strict mode', - StrictLHSPostfix: 'Postfix increment/decrement may not have eval or arguments operand in strict mode', - StrictLHSPrefix: 'Prefix increment/decrement may not have eval or arguments operand in strict mode', - StrictReservedWord: 'Use of future reserved word in strict mode' + StrictFunctionName: 'Function name may not be eval or arguments in strict mode', + StrictOctalLiteral: 'Octal literals are not allowed in strict mode.', + StrictDelete: 'Delete of an unqualified identifier in strict mode.', + StrictDuplicateProperty: 'Duplicate data property in object literal not allowed in strict mode', + AccessorDataProperty: 'Object literal may not have data and accessor property with the same name', + AccessorGetSet: 'Object literal may not have multiple get/set accessors with the same name', + StrictLHSAssignment: 'Assignment to eval or arguments is not allowed in strict mode', + StrictLHSPostfix: 'Postfix increment/decrement may not have eval or arguments operand in strict mode', + StrictLHSPrefix: 'Prefix increment/decrement may not have eval or arguments operand in strict mode', + StrictReservedWord: 'Use of future reserved word in strict mode' }; // See also tools/generate-unicode-regex.py. Regex = { - NonAsciiIdentifierStart: new RegExp('[\xaa\xb5\xba\xc0-\xd6\xd8-\xf6\xf8-\u02c1\u02c6-\u02d1\u02e0-\u02e4\u02ec\u02ee\u0370-\u0374\u0376\u0377\u037a-\u037d\u0386\u0388-\u038a\u038c\u038e-\u03a1\u03a3-\u03f5\u03f7-\u0481\u048a-\u0527\u0531-\u0556\u0559\u0561-\u0587\u05d0-\u05ea\u05f0-\u05f2\u0620-\u064a\u066e\u066f\u0671-\u06d3\u06d5\u06e5\u06e6\u06ee\u06ef\u06fa-\u06fc\u06ff\u0710\u0712-\u072f\u074d-\u07a5\u07b1\u07ca-\u07ea\u07f4\u07f5\u07fa\u0800-\u0815\u081a\u0824\u0828\u0840-\u0858\u08a0\u08a2-\u08ac\u0904-\u0939\u093d\u0950\u0958-\u0961\u0971-\u0977\u0979-\u097f\u0985-\u098c\u098f\u0990\u0993-\u09a8\u09aa-\u09b0\u09b2\u09b6-\u09b9\u09bd\u09ce\u09dc\u09dd\u09df-\u09e1\u09f0\u09f1\u0a05-\u0a0a\u0a0f\u0a10\u0a13-\u0a28\u0a2a-\u0a30\u0a32\u0a33\u0a35\u0a36\u0a38\u0a39\u0a59-\u0a5c\u0a5e\u0a72-\u0a74\u0a85-\u0a8d\u0a8f-\u0a91\u0a93-\u0aa8\u0aaa-\u0ab0\u0ab2\u0ab3\u0ab5-\u0ab9\u0abd\u0ad0\u0ae0\u0ae1\u0b05-\u0b0c\u0b0f\u0b10\u0b13-\u0b28\u0b2a-\u0b30\u0b32\u0b33\u0b35-\u0b39\u0b3d\u0b5c\u0b5d\u0b5f-\u0b61\u0b71\u0b83\u0b85-\u0b8a\u0b8e-\u0b90\u0b92-\u0b95\u0b99\u0b9a\u0b9c\u0b9e\u0b9f\u0ba3\u0ba4\u0ba8-\u0baa\u0bae-\u0bb9\u0bd0\u0c05-\u0c0c\u0c0e-\u0c10\u0c12-\u0c28\u0c2a-\u0c33\u0c35-\u0c39\u0c3d\u0c58\u0c59\u0c60\u0c61\u0c85-\u0c8c\u0c8e-\u0c90\u0c92-\u0ca8\u0caa-\u0cb3\u0cb5-\u0cb9\u0cbd\u0cde\u0ce0\u0ce1\u0cf1\u0cf2\u0d05-\u0d0c\u0d0e-\u0d10\u0d12-\u0d3a\u0d3d\u0d4e\u0d60\u0d61\u0d7a-\u0d7f\u0d85-\u0d96\u0d9a-\u0db1\u0db3-\u0dbb\u0dbd\u0dc0-\u0dc6\u0e01-\u0e30\u0e32\u0e33\u0e40-\u0e46\u0e81\u0e82\u0e84\u0e87\u0e88\u0e8a\u0e8d\u0e94-\u0e97\u0e99-\u0e9f\u0ea1-\u0ea3\u0ea5\u0ea7\u0eaa\u0eab\u0ead-\u0eb0\u0eb2\u0eb3\u0ebd\u0ec0-\u0ec4\u0ec6\u0edc-\u0edf\u0f00\u0f40-\u0f47\u0f49-\u0f6c\u0f88-\u0f8c\u1000-\u102a\u103f\u1050-\u1055\u105a-\u105d\u1061\u1065\u1066\u106e-\u1070\u1075-\u1081\u108e\u10a0-\u10c5\u10c7\u10cd\u10d0-\u10fa\u10fc-\u1248\u124a-\u124d\u1250-\u1256\u1258\u125a-\u125d\u1260-\u1288\u128a-\u128d\u1290-\u12b0\u12b2-\u12b5\u12b8-\u12be\u12c0\u12c2-\u12c5\u12c8-\u12d6\u12d8-\u1310\u1312-\u1315\u1318-\u135a\u1380-\u138f\u13a0-\u13f4\u1401-\u166c\u166f-\u167f\u1681-\u169a\u16a0-\u16ea\u16ee-\u16f0\u1700-\u170c\u170e-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176c\u176e-\u1770\u1780-\u17b3\u17d7\u17dc\u1820-\u1877\u1880-\u18a8\u18aa\u18b0-\u18f5\u1900-\u191c\u1950-\u196d\u1970-\u1974\u1980-\u19ab\u19c1-\u19c7\u1a00-\u1a16\u1a20-\u1a54\u1aa7\u1b05-\u1b33\u1b45-\u1b4b\u1b83-\u1ba0\u1bae\u1baf\u1bba-\u1be5\u1c00-\u1c23\u1c4d-\u1c4f\u1c5a-\u1c7d\u1ce9-\u1cec\u1cee-\u1cf1\u1cf5\u1cf6\u1d00-\u1dbf\u1e00-\u1f15\u1f18-\u1f1d\u1f20-\u1f45\u1f48-\u1f4d\u1f50-\u1f57\u1f59\u1f5b\u1f5d\u1f5f-\u1f7d\u1f80-\u1fb4\u1fb6-\u1fbc\u1fbe\u1fc2-\u1fc4\u1fc6-\u1fcc\u1fd0-\u1fd3\u1fd6-\u1fdb\u1fe0-\u1fec\u1ff2-\u1ff4\u1ff6-\u1ffc\u2071\u207f\u2090-\u209c\u2102\u2107\u210a-\u2113\u2115\u2119-\u211d\u2124\u2126\u2128\u212a-\u212d\u212f-\u2139\u213c-\u213f\u2145-\u2149\u214e\u2160-\u2188\u2c00-\u2c2e\u2c30-\u2c5e\u2c60-\u2ce4\u2ceb-\u2cee\u2cf2\u2cf3\u2d00-\u2d25\u2d27\u2d2d\u2d30-\u2d67\u2d6f\u2d80-\u2d96\u2da0-\u2da6\u2da8-\u2dae\u2db0-\u2db6\u2db8-\u2dbe\u2dc0-\u2dc6\u2dc8-\u2dce\u2dd0-\u2dd6\u2dd8-\u2dde\u2e2f\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303c\u3041-\u3096\u309d-\u309f\u30a1-\u30fa\u30fc-\u30ff\u3105-\u312d\u3131-\u318e\u31a0-\u31ba\u31f0-\u31ff\u3400-\u4db5\u4e00-\u9fcc\ua000-\ua48c\ua4d0-\ua4fd\ua500-\ua60c\ua610-\ua61f\ua62a\ua62b\ua640-\ua66e\ua67f-\ua697\ua6a0-\ua6ef\ua717-\ua71f\ua722-\ua788\ua78b-\ua78e\ua790-\ua793\ua7a0-\ua7aa\ua7f8-\ua801\ua803-\ua805\ua807-\ua80a\ua80c-\ua822\ua840-\ua873\ua882-\ua8b3\ua8f2-\ua8f7\ua8fb\ua90a-\ua925\ua930-\ua946\ua960-\ua97c\ua984-\ua9b2\ua9cf\uaa00-\uaa28\uaa40-\uaa42\uaa44-\uaa4b\uaa60-\uaa76\uaa7a\uaa80-\uaaaf\uaab1\uaab5\uaab6\uaab9-\uaabd\uaac0\uaac2\uaadb-\uaadd\uaae0-\uaaea\uaaf2-\uaaf4\uab01-\uab06\uab09-\uab0e\uab11-\uab16\uab20-\uab26\uab28-\uab2e\uabc0-\uabe2\uac00-\ud7a3\ud7b0-\ud7c6\ud7cb-\ud7fb\uf900-\ufa6d\ufa70-\ufad9\ufb00-\ufb06\ufb13-\ufb17\ufb1d\ufb1f-\ufb28\ufb2a-\ufb36\ufb38-\ufb3c\ufb3e\ufb40\ufb41\ufb43\ufb44\ufb46-\ufbb1\ufbd3-\ufd3d\ufd50-\ufd8f\ufd92-\ufdc7\ufdf0-\ufdfb\ufe70-\ufe74\ufe76-\ufefc\uff21-\uff3a\uff41-\uff5a\uff66-\uffbe\uffc2-\uffc7\uffca-\uffcf\uffd2-\uffd7\uffda-\uffdc]'), - NonAsciiIdentifierPart: new RegExp('[\xaa\xb5\xba\xc0-\xd6\xd8-\xf6\xf8-\u02c1\u02c6-\u02d1\u02e0-\u02e4\u02ec\u02ee\u0300-\u0374\u0376\u0377\u037a-\u037d\u0386\u0388-\u038a\u038c\u038e-\u03a1\u03a3-\u03f5\u03f7-\u0481\u0483-\u0487\u048a-\u0527\u0531-\u0556\u0559\u0561-\u0587\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u05d0-\u05ea\u05f0-\u05f2\u0610-\u061a\u0620-\u0669\u066e-\u06d3\u06d5-\u06dc\u06df-\u06e8\u06ea-\u06fc\u06ff\u0710-\u074a\u074d-\u07b1\u07c0-\u07f5\u07fa\u0800-\u082d\u0840-\u085b\u08a0\u08a2-\u08ac\u08e4-\u08fe\u0900-\u0963\u0966-\u096f\u0971-\u0977\u0979-\u097f\u0981-\u0983\u0985-\u098c\u098f\u0990\u0993-\u09a8\u09aa-\u09b0\u09b2\u09b6-\u09b9\u09bc-\u09c4\u09c7\u09c8\u09cb-\u09ce\u09d7\u09dc\u09dd\u09df-\u09e3\u09e6-\u09f1\u0a01-\u0a03\u0a05-\u0a0a\u0a0f\u0a10\u0a13-\u0a28\u0a2a-\u0a30\u0a32\u0a33\u0a35\u0a36\u0a38\u0a39\u0a3c\u0a3e-\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a59-\u0a5c\u0a5e\u0a66-\u0a75\u0a81-\u0a83\u0a85-\u0a8d\u0a8f-\u0a91\u0a93-\u0aa8\u0aaa-\u0ab0\u0ab2\u0ab3\u0ab5-\u0ab9\u0abc-\u0ac5\u0ac7-\u0ac9\u0acb-\u0acd\u0ad0\u0ae0-\u0ae3\u0ae6-\u0aef\u0b01-\u0b03\u0b05-\u0b0c\u0b0f\u0b10\u0b13-\u0b28\u0b2a-\u0b30\u0b32\u0b33\u0b35-\u0b39\u0b3c-\u0b44\u0b47\u0b48\u0b4b-\u0b4d\u0b56\u0b57\u0b5c\u0b5d\u0b5f-\u0b63\u0b66-\u0b6f\u0b71\u0b82\u0b83\u0b85-\u0b8a\u0b8e-\u0b90\u0b92-\u0b95\u0b99\u0b9a\u0b9c\u0b9e\u0b9f\u0ba3\u0ba4\u0ba8-\u0baa\u0bae-\u0bb9\u0bbe-\u0bc2\u0bc6-\u0bc8\u0bca-\u0bcd\u0bd0\u0bd7\u0be6-\u0bef\u0c01-\u0c03\u0c05-\u0c0c\u0c0e-\u0c10\u0c12-\u0c28\u0c2a-\u0c33\u0c35-\u0c39\u0c3d-\u0c44\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c58\u0c59\u0c60-\u0c63\u0c66-\u0c6f\u0c82\u0c83\u0c85-\u0c8c\u0c8e-\u0c90\u0c92-\u0ca8\u0caa-\u0cb3\u0cb5-\u0cb9\u0cbc-\u0cc4\u0cc6-\u0cc8\u0cca-\u0ccd\u0cd5\u0cd6\u0cde\u0ce0-\u0ce3\u0ce6-\u0cef\u0cf1\u0cf2\u0d02\u0d03\u0d05-\u0d0c\u0d0e-\u0d10\u0d12-\u0d3a\u0d3d-\u0d44\u0d46-\u0d48\u0d4a-\u0d4e\u0d57\u0d60-\u0d63\u0d66-\u0d6f\u0d7a-\u0d7f\u0d82\u0d83\u0d85-\u0d96\u0d9a-\u0db1\u0db3-\u0dbb\u0dbd\u0dc0-\u0dc6\u0dca\u0dcf-\u0dd4\u0dd6\u0dd8-\u0ddf\u0df2\u0df3\u0e01-\u0e3a\u0e40-\u0e4e\u0e50-\u0e59\u0e81\u0e82\u0e84\u0e87\u0e88\u0e8a\u0e8d\u0e94-\u0e97\u0e99-\u0e9f\u0ea1-\u0ea3\u0ea5\u0ea7\u0eaa\u0eab\u0ead-\u0eb9\u0ebb-\u0ebd\u0ec0-\u0ec4\u0ec6\u0ec8-\u0ecd\u0ed0-\u0ed9\u0edc-\u0edf\u0f00\u0f18\u0f19\u0f20-\u0f29\u0f35\u0f37\u0f39\u0f3e-\u0f47\u0f49-\u0f6c\u0f71-\u0f84\u0f86-\u0f97\u0f99-\u0fbc\u0fc6\u1000-\u1049\u1050-\u109d\u10a0-\u10c5\u10c7\u10cd\u10d0-\u10fa\u10fc-\u1248\u124a-\u124d\u1250-\u1256\u1258\u125a-\u125d\u1260-\u1288\u128a-\u128d\u1290-\u12b0\u12b2-\u12b5\u12b8-\u12be\u12c0\u12c2-\u12c5\u12c8-\u12d6\u12d8-\u1310\u1312-\u1315\u1318-\u135a\u135d-\u135f\u1380-\u138f\u13a0-\u13f4\u1401-\u166c\u166f-\u167f\u1681-\u169a\u16a0-\u16ea\u16ee-\u16f0\u1700-\u170c\u170e-\u1714\u1720-\u1734\u1740-\u1753\u1760-\u176c\u176e-\u1770\u1772\u1773\u1780-\u17d3\u17d7\u17dc\u17dd\u17e0-\u17e9\u180b-\u180d\u1810-\u1819\u1820-\u1877\u1880-\u18aa\u18b0-\u18f5\u1900-\u191c\u1920-\u192b\u1930-\u193b\u1946-\u196d\u1970-\u1974\u1980-\u19ab\u19b0-\u19c9\u19d0-\u19d9\u1a00-\u1a1b\u1a20-\u1a5e\u1a60-\u1a7c\u1a7f-\u1a89\u1a90-\u1a99\u1aa7\u1b00-\u1b4b\u1b50-\u1b59\u1b6b-\u1b73\u1b80-\u1bf3\u1c00-\u1c37\u1c40-\u1c49\u1c4d-\u1c7d\u1cd0-\u1cd2\u1cd4-\u1cf6\u1d00-\u1de6\u1dfc-\u1f15\u1f18-\u1f1d\u1f20-\u1f45\u1f48-\u1f4d\u1f50-\u1f57\u1f59\u1f5b\u1f5d\u1f5f-\u1f7d\u1f80-\u1fb4\u1fb6-\u1fbc\u1fbe\u1fc2-\u1fc4\u1fc6-\u1fcc\u1fd0-\u1fd3\u1fd6-\u1fdb\u1fe0-\u1fec\u1ff2-\u1ff4\u1ff6-\u1ffc\u200c\u200d\u203f\u2040\u2054\u2071\u207f\u2090-\u209c\u20d0-\u20dc\u20e1\u20e5-\u20f0\u2102\u2107\u210a-\u2113\u2115\u2119-\u211d\u2124\u2126\u2128\u212a-\u212d\u212f-\u2139\u213c-\u213f\u2145-\u2149\u214e\u2160-\u2188\u2c00-\u2c2e\u2c30-\u2c5e\u2c60-\u2ce4\u2ceb-\u2cf3\u2d00-\u2d25\u2d27\u2d2d\u2d30-\u2d67\u2d6f\u2d7f-\u2d96\u2da0-\u2da6\u2da8-\u2dae\u2db0-\u2db6\u2db8-\u2dbe\u2dc0-\u2dc6\u2dc8-\u2dce\u2dd0-\u2dd6\u2dd8-\u2dde\u2de0-\u2dff\u2e2f\u3005-\u3007\u3021-\u302f\u3031-\u3035\u3038-\u303c\u3041-\u3096\u3099\u309a\u309d-\u309f\u30a1-\u30fa\u30fc-\u30ff\u3105-\u312d\u3131-\u318e\u31a0-\u31ba\u31f0-\u31ff\u3400-\u4db5\u4e00-\u9fcc\ua000-\ua48c\ua4d0-\ua4fd\ua500-\ua60c\ua610-\ua62b\ua640-\ua66f\ua674-\ua67d\ua67f-\ua697\ua69f-\ua6f1\ua717-\ua71f\ua722-\ua788\ua78b-\ua78e\ua790-\ua793\ua7a0-\ua7aa\ua7f8-\ua827\ua840-\ua873\ua880-\ua8c4\ua8d0-\ua8d9\ua8e0-\ua8f7\ua8fb\ua900-\ua92d\ua930-\ua953\ua960-\ua97c\ua980-\ua9c0\ua9cf-\ua9d9\uaa00-\uaa36\uaa40-\uaa4d\uaa50-\uaa59\uaa60-\uaa76\uaa7a\uaa7b\uaa80-\uaac2\uaadb-\uaadd\uaae0-\uaaef\uaaf2-\uaaf6\uab01-\uab06\uab09-\uab0e\uab11-\uab16\uab20-\uab26\uab28-\uab2e\uabc0-\uabea\uabec\uabed\uabf0-\uabf9\uac00-\ud7a3\ud7b0-\ud7c6\ud7cb-\ud7fb\uf900-\ufa6d\ufa70-\ufad9\ufb00-\ufb06\ufb13-\ufb17\ufb1d-\ufb28\ufb2a-\ufb36\ufb38-\ufb3c\ufb3e\ufb40\ufb41\ufb43\ufb44\ufb46-\ufbb1\ufbd3-\ufd3d\ufd50-\ufd8f\ufd92-\ufdc7\ufdf0-\ufdfb\ufe00-\ufe0f\ufe20-\ufe26\ufe33\ufe34\ufe4d-\ufe4f\ufe70-\ufe74\ufe76-\ufefc\uff10-\uff19\uff21-\uff3a\uff3f\uff41-\uff5a\uff66-\uffbe\uffc2-\uffc7\uffca-\uffcf\uffd2-\uffd7\uffda-\uffdc]') + NonAsciiIdentifierStart: new RegExp('[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0-\u08B2\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58\u0C59\u0C60\u0C61\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D60\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F4\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19C1-\u19C7\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FCC\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA78E\uA790-\uA7AD\uA7B0\uA7B1\uA7F7-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB5F\uAB64\uAB65\uABC0-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]'), + NonAsciiIdentifierPart: new RegExp('[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0300-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u0483-\u0487\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u05D0-\u05EA\u05F0-\u05F2\u0610-\u061A\u0620-\u0669\u066E-\u06D3\u06D5-\u06DC\u06DF-\u06E8\u06EA-\u06FC\u06FF\u0710-\u074A\u074D-\u07B1\u07C0-\u07F5\u07FA\u0800-\u082D\u0840-\u085B\u08A0-\u08B2\u08E4-\u0963\u0966-\u096F\u0971-\u0983\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BC-\u09C4\u09C7\u09C8\u09CB-\u09CE\u09D7\u09DC\u09DD\u09DF-\u09E3\u09E6-\u09F1\u0A01-\u0A03\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A59-\u0A5C\u0A5E\u0A66-\u0A75\u0A81-\u0A83\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABC-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AD0\u0AE0-\u0AE3\u0AE6-\u0AEF\u0B01-\u0B03\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3C-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B5C\u0B5D\u0B5F-\u0B63\u0B66-\u0B6F\u0B71\u0B82\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD0\u0BD7\u0BE6-\u0BEF\u0C00-\u0C03\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C58\u0C59\u0C60-\u0C63\u0C66-\u0C6F\u0C81-\u0C83\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBC-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CDE\u0CE0-\u0CE3\u0CE6-\u0CEF\u0CF1\u0CF2\u0D01-\u0D03\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D-\u0D44\u0D46-\u0D48\u0D4A-\u0D4E\u0D57\u0D60-\u0D63\u0D66-\u0D6F\u0D7A-\u0D7F\u0D82\u0D83\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2\u0DF3\u0E01-\u0E3A\u0E40-\u0E4E\u0E50-\u0E59\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB9\u0EBB-\u0EBD\u0EC0-\u0EC4\u0EC6\u0EC8-\u0ECD\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00\u0F18\u0F19\u0F20-\u0F29\u0F35\u0F37\u0F39\u0F3E-\u0F47\u0F49-\u0F6C\u0F71-\u0F84\u0F86-\u0F97\u0F99-\u0FBC\u0FC6\u1000-\u1049\u1050-\u109D\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u135D-\u135F\u1380-\u138F\u13A0-\u13F4\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1714\u1720-\u1734\u1740-\u1753\u1760-\u176C\u176E-\u1770\u1772\u1773\u1780-\u17D3\u17D7\u17DC\u17DD\u17E0-\u17E9\u180B-\u180D\u1810-\u1819\u1820-\u1877\u1880-\u18AA\u18B0-\u18F5\u1900-\u191E\u1920-\u192B\u1930-\u193B\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19D9\u1A00-\u1A1B\u1A20-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AA7\u1AB0-\u1ABD\u1B00-\u1B4B\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1BF3\u1C00-\u1C37\u1C40-\u1C49\u1C4D-\u1C7D\u1CD0-\u1CD2\u1CD4-\u1CF6\u1CF8\u1CF9\u1D00-\u1DF5\u1DFC-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u200C\u200D\u203F\u2040\u2054\u2071\u207F\u2090-\u209C\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D7F-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2DE0-\u2DFF\u2E2F\u3005-\u3007\u3021-\u302F\u3031-\u3035\u3038-\u303C\u3041-\u3096\u3099\u309A\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FCC\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66F\uA674-\uA67D\uA67F-\uA69D\uA69F-\uA6F1\uA717-\uA71F\uA722-\uA788\uA78B-\uA78E\uA790-\uA7AD\uA7B0\uA7B1\uA7F7-\uA827\uA840-\uA873\uA880-\uA8C4\uA8D0-\uA8D9\uA8E0-\uA8F7\uA8FB\uA900-\uA92D\uA930-\uA953\uA960-\uA97C\uA980-\uA9C0\uA9CF-\uA9D9\uA9E0-\uA9FE\uAA00-\uAA36\uAA40-\uAA4D\uAA50-\uAA59\uAA60-\uAA76\uAA7A-\uAAC2\uAADB-\uAADD\uAAE0-\uAAEF\uAAF2-\uAAF6\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB5F\uAB64\uAB65\uABC0-\uABEA\uABEC\uABED\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE00-\uFE0F\uFE20-\uFE2D\uFE33\uFE34\uFE4D-\uFE4F\uFE70-\uFE74\uFE76-\uFEFC\uFF10-\uFF19\uFF21-\uFF3A\uFF3F\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]') }; // Ensure the condition is true, otherwise throw an error. @@ -187,23 +205,14 @@ parseStatement: true, parseSourceElement: true */ // Do NOT use this to enforce a certain condition on any user input. function assert(condition, message) { + /* istanbul ignore if */ if (!condition) { throw new Error('ASSERT: ' + message); } } - function sliceSource(from, to) { - return source.slice(from, to); - } - - if (typeof 'esprima'[0] === 'undefined') { - sliceSource = function sliceArraySource(from, to) { - return source.slice(from, to).join(''); - }; - } - function isDecimalDigit(ch) { - return '0123456789'.indexOf(ch) >= 0; + return (ch >= 0x30 && ch <= 0x39); // 0..9 } function isHexDigit(ch) { @@ -218,39 +227,39 @@ parseStatement: true, parseSourceElement: true */ // 7.2 White Space function isWhiteSpace(ch) { - return (ch === ' ') || (ch === '\u0009') || (ch === '\u000B') || - (ch === '\u000C') || (ch === '\u00A0') || - (ch.charCodeAt(0) >= 0x1680 && - '\u1680\u180E\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\uFEFF'.indexOf(ch) >= 0); + return (ch === 0x20) || (ch === 0x09) || (ch === 0x0B) || (ch === 0x0C) || (ch === 0xA0) || + (ch >= 0x1680 && [0x1680, 0x180E, 0x2000, 0x2001, 0x2002, 0x2003, 0x2004, 0x2005, 0x2006, 0x2007, 0x2008, 0x2009, 0x200A, 0x202F, 0x205F, 0x3000, 0xFEFF].indexOf(ch) >= 0); } // 7.3 Line Terminators function isLineTerminator(ch) { - return (ch === '\n' || ch === '\r' || ch === '\u2028' || ch === '\u2029'); + return (ch === 0x0A) || (ch === 0x0D) || (ch === 0x2028) || (ch === 0x2029); } // 7.6 Identifier Names and Identifiers function isIdentifierStart(ch) { - return (ch === '$') || (ch === '_') || (ch === '\\') || - (ch >= 'a' && ch <= 'z') || (ch >= 'A' && ch <= 'Z') || - ((ch.charCodeAt(0) >= 0x80) && Regex.NonAsciiIdentifierStart.test(ch)); + return (ch === 0x24) || (ch === 0x5F) || // $ (dollar) and _ (underscore) + (ch >= 0x41 && ch <= 0x5A) || // A..Z + (ch >= 0x61 && ch <= 0x7A) || // a..z + (ch === 0x5C) || // \ (backslash) + ((ch >= 0x80) && Regex.NonAsciiIdentifierStart.test(String.fromCharCode(ch))); } function isIdentifierPart(ch) { - return (ch === '$') || (ch === '_') || (ch === '\\') || - (ch >= 'a' && ch <= 'z') || (ch >= 'A' && ch <= 'Z') || - ((ch >= '0') && (ch <= '9')) || - ((ch.charCodeAt(0) >= 0x80) && Regex.NonAsciiIdentifierPart.test(ch)); + return (ch === 0x24) || (ch === 0x5F) || // $ (dollar) and _ (underscore) + (ch >= 0x41 && ch <= 0x5A) || // A..Z + (ch >= 0x61 && ch <= 0x7A) || // a..z + (ch >= 0x30 && ch <= 0x39) || // 0..9 + (ch === 0x5C) || // \ (backslash) + ((ch >= 0x80) && Regex.NonAsciiIdentifierPart.test(String.fromCharCode(ch))); } // 7.6.1.2 Future Reserved Words function isFutureReservedWord(id) { switch (id) { - - // Future reserved words. case 'class': case 'enum': case 'export': @@ -258,15 +267,13 @@ parseStatement: true, parseSourceElement: true */ case 'import': case 'super': return true; + default: + return false; } - - return false; } function isStrictModeReservedWord(id) { switch (id) { - - // Strict Mode reserved words. case 'implements': case 'interface': case 'package': @@ -277,9 +284,9 @@ parseStatement: true, parseSourceElement: true */ case 'yield': case 'let': return true; + default: + return false; } - - return false; } function isRestrictedWord(id) { @@ -289,125 +296,215 @@ parseStatement: true, parseSourceElement: true */ // 7.6.1.1 Keywords function isKeyword(id) { - var keyword = false; + if (strict && isStrictModeReservedWord(id)) { + return true; + } + + // 'const' is specialized as Keyword in V8. + // 'yield' and 'let' are for compatibility with SpiderMonkey and ES.next. + // Some others are from future reserved words. + switch (id.length) { case 2: - keyword = (id === 'if') || (id === 'in') || (id === 'do'); - break; + return (id === 'if') || (id === 'in') || (id === 'do'); case 3: - keyword = (id === 'var') || (id === 'for') || (id === 'new') || (id === 'try'); - break; + return (id === 'var') || (id === 'for') || (id === 'new') || + (id === 'try') || (id === 'let'); case 4: - keyword = (id === 'this') || (id === 'else') || (id === 'case') || (id === 'void') || (id === 'with'); - break; + return (id === 'this') || (id === 'else') || (id === 'case') || + (id === 'void') || (id === 'with') || (id === 'enum'); case 5: - keyword = (id === 'while') || (id === 'break') || (id === 'catch') || (id === 'throw'); - break; + return (id === 'while') || (id === 'break') || (id === 'catch') || + (id === 'throw') || (id === 'const') || (id === 'yield') || + (id === 'class') || (id === 'super'); case 6: - keyword = (id === 'return') || (id === 'typeof') || (id === 'delete') || (id === 'switch'); - break; + return (id === 'return') || (id === 'typeof') || (id === 'delete') || + (id === 'switch') || (id === 'export') || (id === 'import'); case 7: - keyword = (id === 'default') || (id === 'finally'); - break; + return (id === 'default') || (id === 'finally') || (id === 'extends'); case 8: - keyword = (id === 'function') || (id === 'continue') || (id === 'debugger'); - break; + return (id === 'function') || (id === 'continue') || (id === 'debugger'); case 10: - keyword = (id === 'instanceof'); - break; + return (id === 'instanceof'); + default: + return false; } + } - if (keyword) { - return true; - } + // 7.4 Comments - switch (id) { - // Future reserved words. - // 'const' is specialized as Keyword in V8. - case 'const': - return true; + function addComment(type, value, start, end, loc) { + var comment; - // For compatiblity to SpiderMonkey and ES.next - case 'yield': - case 'let': - return true; - } + assert(typeof start === 'number', 'Comment must have valid position'); - if (strict && isStrictModeReservedWord(id)) { - return true; + // Because the way the actual token is scanned, often the comments + // (if any) are skipped twice during the lexical analysis. + // Thus, we need to skip adding a comment if the comment array already + // handled it. + if (state.lastCommentStart >= start) { + return; } + state.lastCommentStart = start; - return isFutureReservedWord(id); + comment = { + type: type, + value: value + }; + if (extra.range) { + comment.range = [start, end]; + } + if (extra.loc) { + comment.loc = loc; + } + extra.comments.push(comment); + if (extra.attachComment) { + extra.leadingComments.push(comment); + extra.trailingComments.push(comment); + } } - // 7.4 Comments - - function skipComment() { - var ch, blockComment, lineComment; + function skipSingleLineComment(offset) { + var start, loc, ch, comment; - blockComment = false; - lineComment = false; + start = index - offset; + loc = { + start: { + line: lineNumber, + column: index - lineStart - offset + } + }; while (index < length) { - ch = source[index]; + ch = source.charCodeAt(index); + ++index; + if (isLineTerminator(ch)) { + if (extra.comments) { + comment = source.slice(start + offset, index - 1); + loc.end = { + line: lineNumber, + column: index - lineStart - 1 + }; + addComment('Line', comment, start, index - 1, loc); + } + if (ch === 13 && source.charCodeAt(index) === 10) { + ++index; + } + ++lineNumber; + lineStart = index; + return; + } + } - if (lineComment) { - ch = source[index++]; - if (isLineTerminator(ch)) { - lineComment = false; - if (ch === '\r' && source[index] === '\n') { - ++index; - } - ++lineNumber; - lineStart = index; + if (extra.comments) { + comment = source.slice(start + offset, index); + loc.end = { + line: lineNumber, + column: index - lineStart + }; + addComment('Line', comment, start, index, loc); + } + } + + function skipMultiLineComment() { + var start, loc, ch, comment; + + if (extra.comments) { + start = index - 2; + loc = { + start: { + line: lineNumber, + column: index - lineStart - 2 } - } else if (blockComment) { - if (isLineTerminator(ch)) { - if (ch === '\r' && source[index + 1] === '\n') { - ++index; - } - ++lineNumber; + }; + } + + while (index < length) { + ch = source.charCodeAt(index); + if (isLineTerminator(ch)) { + if (ch === 0x0D && source.charCodeAt(index + 1) === 0x0A) { ++index; - lineStart = index; - if (index >= length) { - throwError({}, Messages.UnexpectedToken, 'ILLEGAL'); - } - } else { - ch = source[index++]; - if (index >= length) { - throwError({}, Messages.UnexpectedToken, 'ILLEGAL'); - } - if (ch === '*') { - ch = source[index]; - if (ch === '/') { - ++index; - blockComment = false; - } - } } - } else if (ch === '/') { - ch = source[index + 1]; - if (ch === '/') { - index += 2; - lineComment = true; - } else if (ch === '*') { - index += 2; - blockComment = true; - if (index >= length) { - throwError({}, Messages.UnexpectedToken, 'ILLEGAL'); + ++lineNumber; + ++index; + lineStart = index; + if (index >= length) { + throwUnexpectedToken(); + } + } else if (ch === 0x2A) { + // Block comment ends with '*/'. + if (source.charCodeAt(index + 1) === 0x2F) { + ++index; + ++index; + if (extra.comments) { + comment = source.slice(start + 2, index - 2); + loc.end = { + line: lineNumber, + column: index - lineStart + }; + addComment('Block', comment, start, index, loc); } - } else { - break; + return; } - } else if (isWhiteSpace(ch)) { + ++index; + } else { + ++index; + } + } + + throwUnexpectedToken(); + } + + function skipComment() { + var ch, start; + + start = (index === 0); + while (index < length) { + ch = source.charCodeAt(index); + + if (isWhiteSpace(ch)) { ++index; } else if (isLineTerminator(ch)) { ++index; - if (ch === '\r' && source[index] === '\n') { + if (ch === 0x0D && source.charCodeAt(index) === 0x0A) { ++index; } ++lineNumber; lineStart = index; + start = true; + } else if (ch === 0x2F) { // U+002F is '/' + ch = source.charCodeAt(index + 1); + if (ch === 0x2F) { + ++index; + ++index; + skipSingleLineComment(2); + start = true; + } else if (ch === 0x2A) { // U+002A is '*' + ++index; + ++index; + skipMultiLineComment(); + } else { + break; + } + } else if (start && ch === 0x2D) { // U+002D is '-' + // U+003E is '>' + if ((source.charCodeAt(index + 1) === 0x2D) && (source.charCodeAt(index + 2) === 0x3E)) { + // '-->' is a single-line comment + index += 3; + skipSingleLineComment(3); + } else { + break; + } + } else if (ch === 0x3C) { // U+003C is '<' + if (source.slice(index + 1, index + 4) === '!--') { + ++index; // `<` + ++index; // `!` + ++index; // `-` + ++index; // `-` + skipSingleLineComment(4); + } else { + break; + } } else { break; } @@ -429,291 +526,418 @@ parseStatement: true, parseSourceElement: true */ return String.fromCharCode(code); } - function scanIdentifier() { - var ch, start, id, restore; + function scanUnicodeCodePointEscape() { + var ch, code, cu1, cu2; ch = source[index]; - if (!isIdentifierStart(ch)) { - return; + code = 0; + + // At least, one hex digit is required. + if (ch === '}') { + throwUnexpectedToken(); } - start = index; - if (ch === '\\') { - ++index; - if (source[index] !== 'u') { - return; + while (index < length) { + ch = source[index++]; + if (!isHexDigit(ch)) { + break; + } + code = code * 16 + '0123456789abcdef'.indexOf(ch.toLowerCase()); + } + + if (code > 0x10FFFF || ch !== '}') { + throwUnexpectedToken(); + } + + // UTF-16 Encoding + if (code <= 0xFFFF) { + return String.fromCharCode(code); + } + cu1 = ((code - 0x10000) >> 10) + 0xD800; + cu2 = ((code - 0x10000) & 1023) + 0xDC00; + return String.fromCharCode(cu1, cu2); + } + + function getEscapedIdentifier() { + var ch, id; + + ch = source.charCodeAt(index++); + id = String.fromCharCode(ch); + + // '\u' (U+005C, U+0075) denotes an escaped character. + if (ch === 0x5C) { + if (source.charCodeAt(index) !== 0x75) { + throwUnexpectedToken(); } ++index; - restore = index; ch = scanHexEscape('u'); - if (ch) { - if (ch === '\\' || !isIdentifierStart(ch)) { - return; - } - id = ch; - } else { - index = restore; - id = 'u'; + if (!ch || ch === '\\' || !isIdentifierStart(ch.charCodeAt(0))) { + throwUnexpectedToken(); } - } else { - id = source[index++]; + id = ch; } while (index < length) { - ch = source[index]; + ch = source.charCodeAt(index); if (!isIdentifierPart(ch)) { break; } - if (ch === '\\') { - ++index; - if (source[index] !== 'u') { - return; + ++index; + id += String.fromCharCode(ch); + + // '\u' (U+005C, U+0075) denotes an escaped character. + if (ch === 0x5C) { + id = id.substr(0, id.length - 1); + if (source.charCodeAt(index) !== 0x75) { + throwUnexpectedToken(); } ++index; - restore = index; ch = scanHexEscape('u'); - if (ch) { - if (ch === '\\' || !isIdentifierPart(ch)) { - return; - } - id += ch; - } else { - index = restore; - id += 'u'; + if (!ch || ch === '\\' || !isIdentifierPart(ch.charCodeAt(0))) { + throwUnexpectedToken(); } - } else { - id += source[index++]; + id += ch; } } - // There is no keyword or literal with only one character. - // Thus, it must be an identifier. - if (id.length === 1) { - return { - type: Token.Identifier, - value: id, - lineNumber: lineNumber, - lineStart: lineStart, - range: [start, index] - }; - } + return id; + } - if (isKeyword(id)) { - return { - type: Token.Keyword, - value: id, - lineNumber: lineNumber, - lineStart: lineStart, - range: [start, index] - }; + function getIdentifier() { + var start, ch; + + start = index++; + while (index < length) { + ch = source.charCodeAt(index); + if (ch === 0x5C) { + // Blackslash (U+005C) marks Unicode escape sequence. + index = start; + return getEscapedIdentifier(); + } + if (isIdentifierPart(ch)) { + ++index; + } else { + break; + } } - // 7.8.1 Null Literals + return source.slice(start, index); + } - if (id === 'null') { - return { - type: Token.NullLiteral, - value: id, - lineNumber: lineNumber, - lineStart: lineStart, - range: [start, index] - }; - } + function scanIdentifier() { + var start, id, type; - // 7.8.2 Boolean Literals + start = index; - if (id === 'true' || id === 'false') { - return { - type: Token.BooleanLiteral, - value: id, - lineNumber: lineNumber, - lineStart: lineStart, - range: [start, index] - }; + // Backslash (U+005C) starts an escaped character. + id = (source.charCodeAt(index) === 0x5C) ? getEscapedIdentifier() : getIdentifier(); + + // There is no keyword or literal with only one character. + // Thus, it must be an identifier. + if (id.length === 1) { + type = Token.Identifier; + } else if (isKeyword(id)) { + type = Token.Keyword; + } else if (id === 'null') { + type = Token.NullLiteral; + } else if (id === 'true' || id === 'false') { + type = Token.BooleanLiteral; + } else { + type = Token.Identifier; } return { - type: Token.Identifier, + type: type, value: id, lineNumber: lineNumber, lineStart: lineStart, - range: [start, index] + start: start, + end: index }; } + // 7.7 Punctuators function scanPunctuator() { var start = index, + code = source.charCodeAt(index), + code2, ch1 = source[index], ch2, ch3, ch4; - // Check for most common single-character punctuators. + switch (code) { - if (ch1 === ';' || ch1 === '{' || ch1 === '}') { + // Check for most common single-character punctuators. + case 0x2E: // . dot + case 0x28: // ( open bracket + case 0x29: // ) close bracket + case 0x3B: // ; semicolon + case 0x2C: // , comma + case 0x7B: // { open curly brace + case 0x7D: // } close curly brace + case 0x5B: // [ + case 0x5D: // ] + case 0x3A: // : + case 0x3F: // ? + case 0x7E: // ~ ++index; + if (extra.tokenize) { + if (code === 0x28) { + extra.openParenToken = extra.tokens.length; + } else if (code === 0x7B) { + extra.openCurlyToken = extra.tokens.length; + } + } return { type: Token.Punctuator, - value: ch1, + value: String.fromCharCode(code), lineNumber: lineNumber, lineStart: lineStart, - range: [start, index] + start: start, + end: index }; + + default: + code2 = source.charCodeAt(index + 1); + + // '=' (U+003D) marks an assignment or comparison operator. + if (code2 === 0x3D) { + switch (code) { + case 0x2B: // + + case 0x2D: // - + case 0x2F: // / + case 0x3C: // < + case 0x3E: // > + case 0x5E: // ^ + case 0x7C: // | + case 0x25: // % + case 0x26: // & + case 0x2A: // * + index += 2; + return { + type: Token.Punctuator, + value: String.fromCharCode(code) + String.fromCharCode(code2), + lineNumber: lineNumber, + lineStart: lineStart, + start: start, + end: index + }; + + case 0x21: // ! + case 0x3D: // = + index += 2; + + // !== and === + if (source.charCodeAt(index) === 0x3D) { + ++index; + } + return { + type: Token.Punctuator, + value: source.slice(start, index), + lineNumber: lineNumber, + lineStart: lineStart, + start: start, + end: index + }; + } + } } - if (ch1 === ',' || ch1 === '(' || ch1 === ')') { - ++index; + // 4-character punctuator: >>>= + + ch4 = source.substr(index, 4); + + if (ch4 === '>>>=') { + index += 4; return { type: Token.Punctuator, - value: ch1, + value: ch4, lineNumber: lineNumber, lineStart: lineStart, - range: [start, index] + start: start, + end: index }; } - // Dot (.) can also start a floating-point number, hence the need - // to check the next character. + // 3-character punctuators: === !== >>> <<= >>= - ch2 = source[index + 1]; - if (ch1 === '.' && !isDecimalDigit(ch2)) { + ch3 = ch4.substr(0, 3); + + if (ch3 === '>>>' || ch3 === '<<=' || ch3 === '>>=') { + index += 3; return { type: Token.Punctuator, - value: source[index++], + value: ch3, lineNumber: lineNumber, lineStart: lineStart, - range: [start, index] + start: start, + end: index }; } - // Peek more characters. + // Other 2-character punctuators: ++ -- << >> && || + ch2 = ch3.substr(0, 2); - ch3 = source[index + 2]; - ch4 = source[index + 3]; - - // 4-character punctuator: >>>= - - if (ch1 === '>' && ch2 === '>' && ch3 === '>') { - if (ch4 === '=') { - index += 4; - return { - type: Token.Punctuator, - value: '>>>=', - lineNumber: lineNumber, - lineStart: lineStart, - range: [start, index] - }; - } - } - - // 3-character punctuators: === !== >>> <<= >>= - - if (ch1 === '=' && ch2 === '=' && ch3 === '=') { - index += 3; + if ((ch1 === ch2[1] && ('+-<>&|'.indexOf(ch1) >= 0)) || ch2 === '=>') { + index += 2; return { type: Token.Punctuator, - value: '===', + value: ch2, lineNumber: lineNumber, lineStart: lineStart, - range: [start, index] + start: start, + end: index }; } - if (ch1 === '!' && ch2 === '=' && ch3 === '=') { - index += 3; + // 1-character punctuators: < > = ! + - * % & | ^ / + + if ('<>=!+-*%&|^/'.indexOf(ch1) >= 0) { + ++index; return { type: Token.Punctuator, - value: '!==', + value: ch1, lineNumber: lineNumber, lineStart: lineStart, - range: [start, index] + start: start, + end: index }; } - if (ch1 === '>' && ch2 === '>' && ch3 === '>') { - index += 3; - return { - type: Token.Punctuator, - value: '>>>', - lineNumber: lineNumber, - lineStart: lineStart, - range: [start, index] - }; + throwUnexpectedToken(); + } + + // 7.8.3 Numeric Literals + + function scanHexLiteral(start) { + var number = ''; + + while (index < length) { + if (!isHexDigit(source[index])) { + break; + } + number += source[index++]; } - if (ch1 === '<' && ch2 === '<' && ch3 === '=') { - index += 3; - return { - type: Token.Punctuator, - value: '<<=', - lineNumber: lineNumber, - lineStart: lineStart, - range: [start, index] - }; + if (number.length === 0) { + throwUnexpectedToken(); } - if (ch1 === '>' && ch2 === '>' && ch3 === '=') { - index += 3; - return { - type: Token.Punctuator, - value: '>>=', - lineNumber: lineNumber, - lineStart: lineStart, - range: [start, index] - }; + if (isIdentifierStart(source.charCodeAt(index))) { + throwUnexpectedToken(); } - // 2-character punctuators: <= >= == != ++ -- << >> && || - // += -= *= %= &= |= ^= /= + return { + type: Token.NumericLiteral, + value: parseInt('0x' + number, 16), + lineNumber: lineNumber, + lineStart: lineStart, + start: start, + end: index + }; + } + + function scanBinaryLiteral(start) { + var ch, number; - if (ch2 === '=') { - if ('<>=!+-*%&|^/'.indexOf(ch1) >= 0) { - index += 2; - return { - type: Token.Punctuator, - value: ch1 + ch2, - lineNumber: lineNumber, - lineStart: lineStart, - range: [start, index] - }; + number = ''; + + while (index < length) { + ch = source[index]; + if (ch !== '0' && ch !== '1') { + break; } + number += source[index++]; } - if (ch1 === ch2 && ('+-<>&|'.indexOf(ch1) >= 0)) { - if ('+-<>&|'.indexOf(ch2) >= 0) { - index += 2; - return { - type: Token.Punctuator, - value: ch1 + ch2, - lineNumber: lineNumber, - lineStart: lineStart, - range: [start, index] - }; + if (number.length === 0) { + // only 0b or 0B + throwUnexpectedToken(); + } + + if (index < length) { + ch = source.charCodeAt(index); + /* istanbul ignore else */ + if (isIdentifierStart(ch) || isDecimalDigit(ch)) { + throwUnexpectedToken(); } } - // The remaining 1-character punctuators. + return { + type: Token.NumericLiteral, + value: parseInt(number, 2), + lineNumber: lineNumber, + lineStart: lineStart, + start: start, + end: index + }; + } - if ('[]<>+-*%&|^!~?:=/'.indexOf(ch1) >= 0) { - return { - type: Token.Punctuator, - value: source[index++], - lineNumber: lineNumber, - lineStart: lineStart, - range: [start, index] - }; + function scanOctalLiteral(prefix, start) { + var number, octal; + + if (isOctalDigit(prefix)) { + octal = true; + number = '0' + source[index++]; + } else { + octal = false; + ++index; + number = ''; + } + + while (index < length) { + if (!isOctalDigit(source[index])) { + break; + } + number += source[index++]; + } + + if (!octal && number.length === 0) { + // only 0o or 0O + throwUnexpectedToken(); + } + + if (isIdentifierStart(source.charCodeAt(index)) || isDecimalDigit(source.charCodeAt(index))) { + throwUnexpectedToken(); } + + return { + type: Token.NumericLiteral, + value: parseInt(number, 8), + octal: octal, + lineNumber: lineNumber, + lineStart: lineStart, + start: start, + end: index + }; } - // 7.8.3 Numeric Literals + function isImplicitOctalLiteral() { + var i, ch; + + // Implicit octal, unless there is a non-octal digit. + // (Annex B.1.1 on Numeric Literals) + for (i = index + 1; i < length; ++i) { + ch = source[i]; + if (ch === '8' || ch === '9') { + return false; + } + if (!isOctalDigit(ch)) { + return true; + } + } + + return true; + } function scanNumericLiteral() { var number, start, ch; ch = source[index]; - assert(isDecimalDigit(ch) || (ch === '.'), + assert(isDecimalDigit(ch.charCodeAt(0)) || (ch === '.'), 'Numeric literal must start with a decimal digit or a decimal point'); start = index; @@ -724,85 +948,40 @@ parseStatement: true, parseSourceElement: true */ // Hex number starts with '0x'. // Octal number starts with '0'. + // Octal number in ES6 starts with '0o'. + // Binary number in ES6 starts with '0b'. if (number === '0') { if (ch === 'x' || ch === 'X') { - number += source[index++]; - while (index < length) { - ch = source[index]; - if (!isHexDigit(ch)) { - break; - } - number += source[index++]; - } - - if (number.length <= 2) { - // only 0x - throwError({}, Messages.UnexpectedToken, 'ILLEGAL'); - } - - if (index < length) { - ch = source[index]; - if (isIdentifierStart(ch)) { - throwError({}, Messages.UnexpectedToken, 'ILLEGAL'); - } - } - return { - type: Token.NumericLiteral, - value: parseInt(number, 16), - lineNumber: lineNumber, - lineStart: lineStart, - range: [start, index] - }; - } else if (isOctalDigit(ch)) { - number += source[index++]; - while (index < length) { - ch = source[index]; - if (!isOctalDigit(ch)) { - break; - } - number += source[index++]; - } - - if (index < length) { - ch = source[index]; - if (isIdentifierStart(ch) || isDecimalDigit(ch)) { - throwError({}, Messages.UnexpectedToken, 'ILLEGAL'); - } - } - return { - type: Token.NumericLiteral, - value: parseInt(number, 8), - octal: true, - lineNumber: lineNumber, - lineStart: lineStart, - range: [start, index] - }; + ++index; + return scanHexLiteral(start); + } + if (ch === 'b' || ch === 'B') { + ++index; + return scanBinaryLiteral(start); + } + if (ch === 'o' || ch === 'O') { + return scanOctalLiteral(ch, start); } - // decimal number starts with '0' such as '09' is illegal. - if (isDecimalDigit(ch)) { - throwError({}, Messages.UnexpectedToken, 'ILLEGAL'); + if (isOctalDigit(ch)) { + if (isImplicitOctalLiteral()) { + return scanOctalLiteral(ch, start); + } } } - while (index < length) { - ch = source[index]; - if (!isDecimalDigit(ch)) { - break; - } + while (isDecimalDigit(source.charCodeAt(index))) { number += source[index++]; } + ch = source[index]; } if (ch === '.') { number += source[index++]; - while (index < length) { - ch = source[index]; - if (!isDecimalDigit(ch)) { - break; - } + while (isDecimalDigit(source.charCodeAt(index))) { number += source[index++]; } + ch = source[index]; } if (ch === 'e' || ch === 'E') { @@ -812,31 +991,17 @@ parseStatement: true, parseSourceElement: true */ if (ch === '+' || ch === '-') { number += source[index++]; } - - ch = source[index]; - if (isDecimalDigit(ch)) { - number += source[index++]; - while (index < length) { - ch = source[index]; - if (!isDecimalDigit(ch)) { - break; - } + if (isDecimalDigit(source.charCodeAt(index))) { + while (isDecimalDigit(source.charCodeAt(index))) { number += source[index++]; } } else { - ch = 'character ' + ch; - if (index >= length) { - ch = ''; - } - throwError({}, Messages.UnexpectedToken, 'ILLEGAL'); + throwUnexpectedToken(); } } - if (index < length) { - ch = source[index]; - if (isIdentifierStart(ch)) { - throwError({}, Messages.UnexpectedToken, 'ILLEGAL'); - } + if (isIdentifierStart(source.charCodeAt(index))) { + throwUnexpectedToken(); } return { @@ -844,14 +1009,17 @@ parseStatement: true, parseSourceElement: true */ value: parseFloat(number), lineNumber: lineNumber, lineStart: lineStart, - range: [start, index] + start: start, + end: index }; } // 7.8.4 String Literals function scanStringLiteral() { - var str = '', quote, start, ch, code, unescaped, restore, octal = false; + var str = '', quote, start, ch, code, unescaped, restore, octal = false, startLineNumber, startLineStart; + startLineNumber = lineNumber; + startLineStart = lineStart; quote = source[index]; assert((quote === '\'' || quote === '"'), @@ -868,8 +1036,24 @@ parseStatement: true, parseSourceElement: true */ break; } else if (ch === '\\') { ch = source[index++]; - if (!isLineTerminator(ch)) { + if (!ch || !isLineTerminator(ch.charCodeAt(0))) { switch (ch) { + case 'u': + case 'x': + if (source[index] === '{') { + ++index; + str += scanUnicodeCodePointEscape(); + } else { + restore = index; + unescaped = scanHexEscape(ch); + if (unescaped) { + str += unescaped; + } else { + index = restore; + str += ch; + } + } + break; case 'n': str += '\n'; break; @@ -879,17 +1063,6 @@ parseStatement: true, parseSourceElement: true */ case 't': str += '\t'; break; - case 'u': - case 'x': - restore = index; - unescaped = scanHexEscape(ch); - if (unescaped) { - str += unescaped; - } else { - index = restore; - str += ch; - } - break; case 'b': str += '\b'; break; @@ -929,11 +1102,12 @@ parseStatement: true, parseSourceElement: true */ } } else { ++lineNumber; - if (ch === '\r' && source[index] === '\n') { + if (ch === '\r' && source[index] === '\n') { ++index; } + lineStart = index; } - } else if (isLineTerminator(ch)) { + } else if (isLineTerminator(ch.charCodeAt(0))) { break; } else { str += ch; @@ -941,40 +1115,83 @@ parseStatement: true, parseSourceElement: true */ } if (quote !== '') { - throwError({}, Messages.UnexpectedToken, 'ILLEGAL'); + throwUnexpectedToken(); } return { type: Token.StringLiteral, value: str, octal: octal, + startLineNumber: startLineNumber, + startLineStart: startLineStart, lineNumber: lineNumber, lineStart: lineStart, - range: [start, index] + start: start, + end: index }; } - function scanRegExp() { - var str, ch, start, pattern, flags, value, classMarker = false, restore, terminated = false; + function testRegExp(pattern, flags) { + var tmp = pattern, + value; + + if (flags.indexOf('u') >= 0) { + // Replace each astral symbol and every Unicode code point + // escape sequence with a single ASCII symbol to avoid throwing on + // regular expressions that are only valid in combination with the + // `/u` flag. + // Note: replacing with the ASCII symbol `x` might cause false + // negatives in unlikely scenarios. For example, `[\u{61}-b]` is a + // perfectly valid pattern that is equivalent to `[a-b]`, but it + // would be replaced by `[x-b]` which throws an error. + tmp = tmp + .replace(/\\u\{([0-9a-fA-F]+)\}/g, function ($0, $1) { + if (parseInt($1, 16) <= 0x10FFFF) { + return 'x'; + } + throwError(Messages.InvalidRegExp); + }) + .replace(/[\uD800-\uDBFF][\uDC00-\uDFFF]/g, 'x'); + } - buffer = null; - skipComment(); + // First, detect invalid regular expressions. + try { + value = new RegExp(tmp); + } catch (e) { + throwError(Messages.InvalidRegExp); + } + + // Return a regular expression object for this pattern-flag pair, or + // `null` in case the current environment doesn't support the flags it + // uses. + try { + return new RegExp(pattern, flags); + } catch (exception) { + return null; + } + } + + function scanRegExpBody() { + var ch, str, classMarker, terminated, body; - start = index; ch = source[index]; assert(ch === '/', 'Regular expression literal must start with a slash'); str = source[index++]; + classMarker = false; + terminated = false; while (index < length) { ch = source[index++]; str += ch; if (ch === '\\') { ch = source[index++]; // ECMA-262 7.8.5 - if (isLineTerminator(ch)) { - throwError({}, Messages.UnterminatedRegExp); + if (isLineTerminator(ch.charCodeAt(0))) { + throwError(Messages.UnterminatedRegExp); } str += ch; + } else if (isLineTerminator(ch.charCodeAt(0))) { + throwError(Messages.UnterminatedRegExp); } else if (classMarker) { if (ch === ']') { classMarker = false; @@ -985,23 +1202,30 @@ parseStatement: true, parseSourceElement: true */ break; } else if (ch === '[') { classMarker = true; - } else if (isLineTerminator(ch)) { - throwError({}, Messages.UnterminatedRegExp); } } } if (!terminated) { - throwError({}, Messages.UnterminatedRegExp); + throwError(Messages.UnterminatedRegExp); } // Exclude leading and trailing slash. - pattern = str.substr(1, str.length - 2); + body = str.substr(1, str.length - 2); + return { + value: body, + literal: str + }; + } + function scanRegExpFlags() { + var ch, str, flags, restore; + + str = ''; flags = ''; while (index < length) { ch = source[index]; - if (!isIdentifierPart(ch)) { + if (!isIdentifierPart(ch.charCodeAt(0))) { break; } @@ -1014,8 +1238,7 @@ parseStatement: true, parseSourceElement: true */ ch = scanHexEscape('u'); if (ch) { flags += ch; - str += '\\u'; - for (; restore < index; ++restore) { + for (str += '\\u'; restore < index; ++restore) { str += source[restore]; } } else { @@ -1023,8 +1246,10 @@ parseStatement: true, parseSourceElement: true */ flags += 'u'; str += '\\u'; } + tolerateUnexpectedToken(); } else { str += '\\'; + tolerateUnexpectedToken(); } } else { flags += ch; @@ -1032,17 +1257,92 @@ parseStatement: true, parseSourceElement: true */ } } - try { - value = new RegExp(pattern, flags); - } catch (e) { - throwError({}, Messages.InvalidRegExp); + return { + value: flags, + literal: str + }; + } + + function scanRegExp() { + var start, body, flags, value; + + lookahead = null; + skipComment(); + start = index; + + body = scanRegExpBody(); + flags = scanRegExpFlags(); + value = testRegExp(body.value, flags.value); + + if (extra.tokenize) { + return { + type: Token.RegularExpression, + value: value, + regex: { + pattern: body.value, + flags: flags.value + }, + lineNumber: lineNumber, + lineStart: lineStart, + start: start, + end: index + }; } return { - literal: str, + literal: body.literal + flags.literal, value: value, - range: [start, index] + regex: { + pattern: body.value, + flags: flags.value + }, + start: start, + end: index + }; + } + + function collectRegex() { + var pos, loc, regex, token; + + skipComment(); + + pos = index; + loc = { + start: { + line: lineNumber, + column: index - lineStart + } + }; + + regex = scanRegExp(); + + loc.end = { + line: lineNumber, + column: index - lineStart }; + + /* istanbul ignore next */ + if (!extra.tokenize) { + // Pop the previous token, which is likely '/' or '/=' + if (extra.tokens.length > 0) { + token = extra.tokens[extra.tokens.length - 1]; + if (token.range[0] === pos && token.type === 'Punctuator') { + if (token.value === '/' || token.value === '/=') { + extra.tokens.pop(); + } + } + } + + extra.tokens.push({ + type: 'RegularExpression', + value: regex.literal, + regex: regex.regex, + range: [pos, index], + loc: loc + }); + } + + return regex; } function isIdentifierName(token) { @@ -1052,8 +1352,71 @@ parseStatement: true, parseSourceElement: true */ token.type === Token.NullLiteral; } + function advanceSlash() { + var prevToken, + checkToken; + // Using the following algorithm: + // https://github.com/mozilla/sweet.js/wiki/design + prevToken = extra.tokens[extra.tokens.length - 1]; + if (!prevToken) { + // Nothing before that: it cannot be a division. + return collectRegex(); + } + if (prevToken.type === 'Punctuator') { + if (prevToken.value === ']') { + return scanPunctuator(); + } + if (prevToken.value === ')') { + checkToken = extra.tokens[extra.openParenToken - 1]; + if (checkToken && + checkToken.type === 'Keyword' && + (checkToken.value === 'if' || + checkToken.value === 'while' || + checkToken.value === 'for' || + checkToken.value === 'with')) { + return collectRegex(); + } + return scanPunctuator(); + } + if (prevToken.value === '}') { + // Dividing a function by anything makes little sense, + // but we have to check for that. + if (extra.tokens[extra.openCurlyToken - 3] && + extra.tokens[extra.openCurlyToken - 3].type === 'Keyword') { + // Anonymous function. + checkToken = extra.tokens[extra.openCurlyToken - 4]; + if (!checkToken) { + return scanPunctuator(); + } + } else if (extra.tokens[extra.openCurlyToken - 4] && + extra.tokens[extra.openCurlyToken - 4].type === 'Keyword') { + // Named function. + checkToken = extra.tokens[extra.openCurlyToken - 5]; + if (!checkToken) { + return collectRegex(); + } + } else { + return scanPunctuator(); + } + // checkToken determines whether the function is + // a declaration or an expression. + if (FnExprTokens.indexOf(checkToken.value) >= 0) { + // It is an expression. + return scanPunctuator(); + } + // It is a declaration. + return collectRegex(); + } + return collectRegex(); + } + if (prevToken.type === 'Keyword' && prevToken.value !== 'this') { + return collectRegex(); + } + return scanPunctuator(); + } + function advance() { - var ch, token; + var ch; skipComment(); @@ -1062,67 +1425,590 @@ parseStatement: true, parseSourceElement: true */ type: Token.EOF, lineNumber: lineNumber, lineStart: lineStart, - range: [index, index] + start: index, + end: index }; } - token = scanPunctuator(); - if (typeof token !== 'undefined') { - return token; + ch = source.charCodeAt(index); + + if (isIdentifierStart(ch)) { + return scanIdentifier(); } - ch = source[index]; + // Very common: ( and ) and ; + if (ch === 0x28 || ch === 0x29 || ch === 0x3B) { + return scanPunctuator(); + } - if (ch === '\'' || ch === '"') { + // String literal starts with single quote (U+0027) or double quote (U+0022). + if (ch === 0x27 || ch === 0x22) { return scanStringLiteral(); } - if (ch === '.' || isDecimalDigit(ch)) { - return scanNumericLiteral(); - } - token = scanIdentifier(); - if (typeof token !== 'undefined') { - return token; + // Dot (.) U+002E can also start a floating-point number, hence the need + // to check the next character. + if (ch === 0x2E) { + if (isDecimalDigit(source.charCodeAt(index + 1))) { + return scanNumericLiteral(); + } + return scanPunctuator(); } - throwError({}, Messages.UnexpectedToken, 'ILLEGAL'); - } - - function lex() { - var token; + if (isDecimalDigit(ch)) { + return scanNumericLiteral(); + } - if (buffer) { - index = buffer.range[1]; - lineNumber = buffer.lineNumber; - lineStart = buffer.lineStart; - token = buffer; - buffer = null; - return token; + // Slash (/) U+002F can also start a regex. + if (extra.tokenize && ch === 0x2F) { + return advanceSlash(); } - buffer = null; - return advance(); + return scanPunctuator(); } - function lookahead() { - var pos, line, start; - - if (buffer !== null) { - return buffer; - } + function collectToken() { + var loc, token, value, entry; - pos = index; - line = lineNumber; + skipComment(); + loc = { + start: { + line: lineNumber, + column: index - lineStart + } + }; + + token = advance(); + loc.end = { + line: lineNumber, + column: index - lineStart + }; + + if (token.type !== Token.EOF) { + value = source.slice(token.start, token.end); + entry = { + type: TokenName[token.type], + value: value, + range: [token.start, token.end], + loc: loc + }; + if (token.regex) { + entry.regex = { + pattern: token.regex.pattern, + flags: token.regex.flags + }; + } + extra.tokens.push(entry); + } + + return token; + } + + function lex() { + var token; + + token = lookahead; + index = token.end; + lineNumber = token.lineNumber; + lineStart = token.lineStart; + + lookahead = (typeof extra.tokens !== 'undefined') ? collectToken() : advance(); + + index = token.end; + lineNumber = token.lineNumber; + lineStart = token.lineStart; + + return token; + } + + function peek() { + var pos, line, start; + + pos = index; + line = lineNumber; start = lineStart; - buffer = advance(); + lookahead = (typeof extra.tokens !== 'undefined') ? collectToken() : advance(); index = pos; lineNumber = line; lineStart = start; + } + + function Position() { + this.line = lineNumber; + this.column = index - lineStart; + } + + function SourceLocation() { + this.start = new Position(); + this.end = null; + } + + function WrappingSourceLocation(startToken) { + if (startToken.type === Token.StringLiteral) { + this.start = { + line: startToken.startLineNumber, + column: startToken.start - startToken.startLineStart + }; + } else { + this.start = { + line: startToken.lineNumber, + column: startToken.start - startToken.lineStart + }; + } + this.end = null; + } + + function Node() { + // Skip comment. + index = lookahead.start; + if (lookahead.type === Token.StringLiteral) { + lineNumber = lookahead.startLineNumber; + lineStart = lookahead.startLineStart; + } else { + lineNumber = lookahead.lineNumber; + lineStart = lookahead.lineStart; + } + if (extra.range) { + this.range = [index, 0]; + } + if (extra.loc) { + this.loc = new SourceLocation(); + } + } - return buffer; + function WrappingNode(startToken) { + if (extra.range) { + this.range = [startToken.start, 0]; + } + if (extra.loc) { + this.loc = new WrappingSourceLocation(startToken); + } } + WrappingNode.prototype = Node.prototype = { + + processComment: function () { + var lastChild, + leadingComments, + trailingComments, + bottomRight = extra.bottomRightStack, + i, + comment, + last = bottomRight[bottomRight.length - 1]; + + if (this.type === Syntax.Program) { + if (this.body.length > 0) { + return; + } + } + + if (extra.trailingComments.length > 0) { + trailingComments = []; + for (i = extra.trailingComments.length - 1; i >= 0; --i) { + comment = extra.trailingComments[i]; + if (comment.range[0] >= this.range[1]) { + trailingComments.unshift(comment); + extra.trailingComments.splice(i, 1); + } + } + extra.trailingComments = []; + } else { + if (last && last.trailingComments && last.trailingComments[0].range[0] >= this.range[1]) { + trailingComments = last.trailingComments; + delete last.trailingComments; + } + } + + // Eating the stack. + if (last) { + while (last && last.range[0] >= this.range[0]) { + lastChild = last; + last = bottomRight.pop(); + } + } + + if (lastChild) { + if (lastChild.leadingComments && lastChild.leadingComments[lastChild.leadingComments.length - 1].range[1] <= this.range[0]) { + this.leadingComments = lastChild.leadingComments; + lastChild.leadingComments = undefined; + } + } else if (extra.leadingComments.length > 0) { + leadingComments = []; + for (i = extra.leadingComments.length - 1; i >= 0; --i) { + comment = extra.leadingComments[i]; + if (comment.range[1] <= this.range[0]) { + leadingComments.unshift(comment); + extra.leadingComments.splice(i, 1); + } + } + } + + + if (leadingComments && leadingComments.length > 0) { + this.leadingComments = leadingComments; + } + if (trailingComments && trailingComments.length > 0) { + this.trailingComments = trailingComments; + } + + bottomRight.push(this); + }, + + finish: function () { + if (extra.range) { + this.range[1] = index; + } + if (extra.loc) { + this.loc.end = new Position(); + if (extra.source) { + this.loc.source = extra.source; + } + } + + if (extra.attachComment) { + this.processComment(); + } + }, + + finishArrayExpression: function (elements) { + this.type = Syntax.ArrayExpression; + this.elements = elements; + this.finish(); + return this; + }, + + finishArrowFunctionExpression: function (params, defaults, body, expression) { + this.type = Syntax.ArrowFunctionExpression; + this.id = null; + this.params = params; + this.defaults = defaults; + this.body = body; + this.rest = null; + this.generator = false; + this.expression = expression; + this.finish(); + return this; + }, + + finishAssignmentExpression: function (operator, left, right) { + this.type = Syntax.AssignmentExpression; + this.operator = operator; + this.left = left; + this.right = right; + this.finish(); + return this; + }, + + finishBinaryExpression: function (operator, left, right) { + this.type = (operator === '||' || operator === '&&') ? Syntax.LogicalExpression : Syntax.BinaryExpression; + this.operator = operator; + this.left = left; + this.right = right; + this.finish(); + return this; + }, + + finishBlockStatement: function (body) { + this.type = Syntax.BlockStatement; + this.body = body; + this.finish(); + return this; + }, + + finishBreakStatement: function (label) { + this.type = Syntax.BreakStatement; + this.label = label; + this.finish(); + return this; + }, + + finishCallExpression: function (callee, args) { + this.type = Syntax.CallExpression; + this.callee = callee; + this.arguments = args; + this.finish(); + return this; + }, + + finishCatchClause: function (param, body) { + this.type = Syntax.CatchClause; + this.param = param; + this.body = body; + this.finish(); + return this; + }, + + finishConditionalExpression: function (test, consequent, alternate) { + this.type = Syntax.ConditionalExpression; + this.test = test; + this.consequent = consequent; + this.alternate = alternate; + this.finish(); + return this; + }, + + finishContinueStatement: function (label) { + this.type = Syntax.ContinueStatement; + this.label = label; + this.finish(); + return this; + }, + + finishDebuggerStatement: function () { + this.type = Syntax.DebuggerStatement; + this.finish(); + return this; + }, + + finishDoWhileStatement: function (body, test) { + this.type = Syntax.DoWhileStatement; + this.body = body; + this.test = test; + this.finish(); + return this; + }, + + finishEmptyStatement: function () { + this.type = Syntax.EmptyStatement; + this.finish(); + return this; + }, + + finishExpressionStatement: function (expression) { + this.type = Syntax.ExpressionStatement; + this.expression = expression; + this.finish(); + return this; + }, + + finishForStatement: function (init, test, update, body) { + this.type = Syntax.ForStatement; + this.init = init; + this.test = test; + this.update = update; + this.body = body; + this.finish(); + return this; + }, + + finishForInStatement: function (left, right, body) { + this.type = Syntax.ForInStatement; + this.left = left; + this.right = right; + this.body = body; + this.each = false; + this.finish(); + return this; + }, + + finishFunctionDeclaration: function (id, params, defaults, body) { + this.type = Syntax.FunctionDeclaration; + this.id = id; + this.params = params; + this.defaults = defaults; + this.body = body; + this.rest = null; + this.generator = false; + this.expression = false; + this.finish(); + return this; + }, + + finishFunctionExpression: function (id, params, defaults, body) { + this.type = Syntax.FunctionExpression; + this.id = id; + this.params = params; + this.defaults = defaults; + this.body = body; + this.rest = null; + this.generator = false; + this.expression = false; + this.finish(); + return this; + }, + + finishIdentifier: function (name) { + this.type = Syntax.Identifier; + this.name = name; + this.finish(); + return this; + }, + + finishIfStatement: function (test, consequent, alternate) { + this.type = Syntax.IfStatement; + this.test = test; + this.consequent = consequent; + this.alternate = alternate; + this.finish(); + return this; + }, + + finishLabeledStatement: function (label, body) { + this.type = Syntax.LabeledStatement; + this.label = label; + this.body = body; + this.finish(); + return this; + }, + + finishLiteral: function (token) { + this.type = Syntax.Literal; + this.value = token.value; + this.raw = source.slice(token.start, token.end); + if (token.regex) { + this.regex = token.regex; + } + this.finish(); + return this; + }, + + finishMemberExpression: function (accessor, object, property) { + this.type = Syntax.MemberExpression; + this.computed = accessor === '['; + this.object = object; + this.property = property; + this.finish(); + return this; + }, + + finishNewExpression: function (callee, args) { + this.type = Syntax.NewExpression; + this.callee = callee; + this.arguments = args; + this.finish(); + return this; + }, + + finishObjectExpression: function (properties) { + this.type = Syntax.ObjectExpression; + this.properties = properties; + this.finish(); + return this; + }, + + finishPostfixExpression: function (operator, argument) { + this.type = Syntax.UpdateExpression; + this.operator = operator; + this.argument = argument; + this.prefix = false; + this.finish(); + return this; + }, + + finishProgram: function (body) { + this.type = Syntax.Program; + this.body = body; + this.finish(); + return this; + }, + + finishProperty: function (kind, key, value, method, shorthand) { + this.type = Syntax.Property; + this.key = key; + this.value = value; + this.kind = kind; + this.method = method; + this.shorthand = shorthand; + this.finish(); + return this; + }, + + finishReturnStatement: function (argument) { + this.type = Syntax.ReturnStatement; + this.argument = argument; + this.finish(); + return this; + }, + + finishSequenceExpression: function (expressions) { + this.type = Syntax.SequenceExpression; + this.expressions = expressions; + this.finish(); + return this; + }, + + finishSwitchCase: function (test, consequent) { + this.type = Syntax.SwitchCase; + this.test = test; + this.consequent = consequent; + this.finish(); + return this; + }, + + finishSwitchStatement: function (discriminant, cases) { + this.type = Syntax.SwitchStatement; + this.discriminant = discriminant; + this.cases = cases; + this.finish(); + return this; + }, + + finishThisExpression: function () { + this.type = Syntax.ThisExpression; + this.finish(); + return this; + }, + + finishThrowStatement: function (argument) { + this.type = Syntax.ThrowStatement; + this.argument = argument; + this.finish(); + return this; + }, + + finishTryStatement: function (block, guardedHandlers, handlers, finalizer) { + this.type = Syntax.TryStatement; + this.block = block; + this.guardedHandlers = guardedHandlers; + this.handlers = handlers; + this.finalizer = finalizer; + this.finish(); + return this; + }, + + finishUnaryExpression: function (operator, argument) { + this.type = (operator === '++' || operator === '--') ? Syntax.UpdateExpression : Syntax.UnaryExpression; + this.operator = operator; + this.argument = argument; + this.prefix = true; + this.finish(); + return this; + }, + + finishVariableDeclaration: function (declarations, kind) { + this.type = Syntax.VariableDeclaration; + this.declarations = declarations; + this.kind = kind; + this.finish(); + return this; + }, + + finishVariableDeclarator: function (id, init) { + this.type = Syntax.VariableDeclarator; + this.id = id; + this.init = init; + this.finish(); + return this; + }, + + finishWhileStatement: function (test, body) { + this.type = Syntax.WhileStatement; + this.test = test; + this.body = body; + this.finish(); + return this; + }, + + finishWithStatement: function (object, body) { + this.type = Syntax.WithStatement; + this.object = object; + this.body = body; + this.finish(); + return this; + } + }; + // Return true if there is a line terminator before the next token. function peekLineTerminator() { @@ -1140,77 +2026,91 @@ parseStatement: true, parseSourceElement: true */ return found; } + function createError(line, pos, description) { + var error = new Error('Line ' + line + ': ' + description); + error.index = pos; + error.lineNumber = line; + error.column = pos - lineStart + 1; + error.description = description; + return error; + } + // Throw an exception - function throwError(token, messageFormat) { - var error, - args = Array.prototype.slice.call(arguments, 2), - msg = messageFormat.replace( - /%(\d)/g, - function (whole, index) { - return args[index] || ''; - } - ); + function throwError(messageFormat) { + var args, msg; - if (typeof token.lineNumber === 'number') { - error = new Error('Line ' + token.lineNumber + ': ' + msg); - error.index = token.range[0]; - error.lineNumber = token.lineNumber; - error.column = token.range[0] - lineStart + 1; - } else { - error = new Error('Line ' + lineNumber + ': ' + msg); - error.index = index; - error.lineNumber = lineNumber; - error.column = index - lineStart + 1; - } + args = Array.prototype.slice.call(arguments, 1); + msg = messageFormat.replace(/%(\d)/g, + function (whole, idx) { + assert(idx < args.length, 'Message reference must be in range'); + return args[idx]; + } + ); - throw error; + throw createError(lineNumber, index, msg); } - function throwErrorTolerant() { - try { - throwError.apply(null, arguments); - } catch (e) { - if (extra.errors) { - extra.errors.push(e); - } else { - throw e; + function tolerateError(messageFormat) { + var args, msg, error; + + args = Array.prototype.slice.call(arguments, 1); + /* istanbul ignore next */ + msg = messageFormat.replace(/%(\d)/g, + function (whole, idx) { + assert(idx < args.length, 'Message reference must be in range'); + return args[idx]; } + ); + + error = createError(lineNumber, index, msg); + if (extra.errors) { + extra.errors.push(error); + } else { + throw error; } } - // Throw an exception because of the token. - function throwUnexpected(token) { - if (token.type === Token.EOF) { - throwError(token, Messages.UnexpectedEOS); + function unexpectedTokenError(token, message) { + var msg = Messages.UnexpectedToken; + + if (token) { + msg = message ? message : + (token.type === Token.EOF) ? Messages.UnexpectedEOS : + (token.type === Token.Identifier) ? Messages.UnexpectedIdentifier : + (token.type === Token.NumericLiteral) ? Messages.UnexpectedNumber : + (token.type === Token.StringLiteral) ? Messages.UnexpectedString : + Messages.UnexpectedToken; + + if (token.type === Token.Keyword) { + if (isFutureReservedWord(token.value)) { + msg = Messages.UnexpectedReserved; + } else if (strict && isStrictModeReservedWord(token.value)) { + msg = Messages.StrictReservedWord; + } + } } - if (token.type === Token.NumericLiteral) { - throwError(token, Messages.UnexpectedNumber); - } + msg = msg.replace('%0', token ? token.value : 'ILLEGAL'); - if (token.type === Token.StringLiteral) { - throwError(token, Messages.UnexpectedString); - } + return (token && typeof token.lineNumber === 'number') ? + createError(token.lineNumber, token.start, msg) : + createError(lineNumber, index, msg); + } - if (token.type === Token.Identifier) { - throwError(token, Messages.UnexpectedIdentifier); - } + function throwUnexpectedToken(token, message) { + throw unexpectedTokenError(token, message); + } - if (token.type === Token.Keyword) { - if (isFutureReservedWord(token.value)) { - throwError(token, Messages.UnexpectedReserved); - } else if (strict && isStrictModeReservedWord(token.value)) { - throwErrorTolerant(token, Messages.StrictReservedWord); - return; - } - throwError(token, Messages.UnexpectedToken, token.value); + function tolerateUnexpectedToken(token, message) { + var error = unexpectedTokenError(token, message); + if (extra.errors) { + extra.errors.push(error); + } else { + throw error; } - - // BooleanLiteral, NullLiteral, or Punctuator. - throwError(token, Messages.UnexpectedToken, token.value); } // Expect the next token to match the specified punctuator. @@ -1219,7 +2119,31 @@ parseStatement: true, parseSourceElement: true */ function expect(value) { var token = lex(); if (token.type !== Token.Punctuator || token.value !== value) { - throwUnexpected(token); + throwUnexpectedToken(token); + } + } + + /** + * @name expectCommaSeparator + * @description Quietly expect a comma when in tolerant mode, otherwise delegates + * to expect(value) + * @since 2.0 + */ + function expectCommaSeparator() { + var token; + + if (extra.errors) { + token = lookahead; + if (token.type === Token.Punctuator && token.value === ',') { + lex(); + } else if (token.type === Token.Punctuator && token.value === ';') { + lex(); + tolerateUnexpectedToken(token); + } else { + tolerateUnexpectedToken(token, Messages.UnexpectedToken); + } + } else { + expect(','); } } @@ -1229,33 +2153,31 @@ parseStatement: true, parseSourceElement: true */ function expectKeyword(keyword) { var token = lex(); if (token.type !== Token.Keyword || token.value !== keyword) { - throwUnexpected(token); + throwUnexpectedToken(token); } } // Return true if the next token matches the specified punctuator. function match(value) { - var token = lookahead(); - return token.type === Token.Punctuator && token.value === value; + return lookahead.type === Token.Punctuator && lookahead.value === value; } // Return true if the next token matches the specified keyword function matchKeyword(keyword) { - var token = lookahead(); - return token.type === Token.Keyword && token.value === keyword; + return lookahead.type === Token.Keyword && lookahead.value === keyword; } // Return true if the next token is an assignment operator function matchAssign() { - var token = lookahead(), - op = token.value; + var op; - if (token.type !== Token.Punctuator) { + if (lookahead.type !== Token.Punctuator) { return false; } + op = lookahead.value; return op === '=' || op === '*=' || op === '/=' || @@ -1271,10 +2193,11 @@ parseStatement: true, parseSourceElement: true */ } function consumeSemicolon() { - var token, line; + var line, oldIndex = index, oldLineNumber = lineNumber, + oldLineStart = lineStart, oldLookahead = lookahead; - // Catch the very common case first. - if (source[index] === ';') { + // Catch the very common case first: immediately a semicolon (U+003B). + if (source.charCodeAt(index) === 0x3B || match(';')) { lex(); return; } @@ -1282,17 +2205,15 @@ parseStatement: true, parseSourceElement: true */ line = lineNumber; skipComment(); if (lineNumber !== line) { + index = oldIndex; + lineNumber = oldLineNumber; + lineStart = oldLineStart; + lookahead = oldLookahead; return; } - if (match(';')) { - lex(); - return; - } - - token = lookahead(); - if (token.type !== Token.EOF && !match('}')) { - throwUnexpected(token); + if (lookahead.type !== Token.EOF && !match('}')) { + throwUnexpectedToken(lookahead); } } @@ -1305,7 +2226,7 @@ parseStatement: true, parseSourceElement: true */ // 11.1.4 Array Initialiser function parseArrayInitialiser() { - var elements = []; + var elements = [], node = new Node(); expect('['); @@ -1322,61 +2243,59 @@ parseStatement: true, parseSourceElement: true */ } } - expect(']'); + lex(); - return { - type: Syntax.ArrayExpression, - elements: elements - }; + return node.finishArrayExpression(elements); } // 11.1.5 Object Initialiser function parsePropertyFunction(param, first) { - var previousStrict, body; + var previousStrict, body, node = new Node(); previousStrict = strict; body = parseFunctionSourceElements(); if (first && strict && isRestrictedWord(param[0].name)) { - throwErrorTolerant(first, Messages.StrictParamName); + tolerateUnexpectedToken(first, Messages.StrictParamName); } strict = previousStrict; + return node.finishFunctionExpression(null, param, [], body); + } - return { - type: Syntax.FunctionExpression, - id: null, - params: param, - defaults: [], - body: body, - rest: null, - generator: false, - expression: false - }; + function parsePropertyMethodFunction() { + var previousStrict, param, method; + + previousStrict = strict; + strict = true; + param = parseParams(); + method = parsePropertyFunction(param.params); + strict = previousStrict; + + return method; } function parseObjectPropertyKey() { - var token = lex(); + var token, node = new Node(); + + token = lex(); // Note: This function is called only from parseObjectProperty(), where // EOF and Punctuator tokens are already filtered out. if (token.type === Token.StringLiteral || token.type === Token.NumericLiteral) { if (strict && token.octal) { - throwErrorTolerant(token, Messages.StrictOctalLiteral); + tolerateUnexpectedToken(token, Messages.StrictOctalLiteral); } - return createLiteral(token); + return node.finishLiteral(token); } - return { - type: Syntax.Identifier, - name: token.value - }; + return node.finishIdentifier(token.value); } function parseObjectProperty() { - var token, key, id, param; + var token, key, id, value, param, node = new Node(); - token = lookahead(); + token = lookahead; if (token.type === Token.Identifier) { @@ -1384,64 +2303,60 @@ parseStatement: true, parseSourceElement: true */ // Property Assignment: Getter and Setter. - if (token.value === 'get' && !match(':')) { + if (token.value === 'get' && !(match(':') || match('('))) { key = parseObjectPropertyKey(); expect('('); expect(')'); - return { - type: Syntax.Property, - key: key, - value: parsePropertyFunction([]), - kind: 'get' - }; - } else if (token.value === 'set' && !match(':')) { + value = parsePropertyFunction([]); + return node.finishProperty('get', key, value, false, false); + } + if (token.value === 'set' && !(match(':') || match('('))) { key = parseObjectPropertyKey(); expect('('); - token = lookahead(); + token = lookahead; if (token.type !== Token.Identifier) { expect(')'); - throwErrorTolerant(token, Messages.UnexpectedToken, token.value); - return { - type: Syntax.Property, - key: key, - value: parsePropertyFunction([]), - kind: 'set' - }; + tolerateUnexpectedToken(token); + value = parsePropertyFunction([]); } else { param = [ parseVariableIdentifier() ]; expect(')'); - return { - type: Syntax.Property, - key: key, - value: parsePropertyFunction(param, token), - kind: 'set' - }; + value = parsePropertyFunction(param, token); } - } else { - expect(':'); - return { - type: Syntax.Property, - key: id, - value: parseAssignmentExpression(), - kind: 'init' - }; + return node.finishProperty('set', key, value, false, false); + } + if (match(':')) { + lex(); + value = parseAssignmentExpression(); + return node.finishProperty('init', id, value, false, false); + } + if (match('(')) { + value = parsePropertyMethodFunction(); + return node.finishProperty('init', id, value, true, false); } - } else if (token.type === Token.EOF || token.type === Token.Punctuator) { - throwUnexpected(token); + + value = id; + return node.finishProperty('init', id, value, false, true); + } + if (token.type === Token.EOF || token.type === Token.Punctuator) { + throwUnexpectedToken(token); } else { key = parseObjectPropertyKey(); - expect(':'); - return { - type: Syntax.Property, - key: key, - value: parseAssignmentExpression(), - kind: 'init' - }; + if (match(':')) { + lex(); + value = parseAssignmentExpression(); + return node.finishProperty('init', key, value, false, false); + } + if (match('(')) { + value = parsePropertyMethodFunction(); + return node.finishProperty('init', key, value, true, false); + } + throwUnexpectedToken(lex()); } } function parseObjectInitialiser() { - var properties = [], property, name, kind, map = {}, toString = String; + var properties = [], property, name, key, kind, map = {}, toString = String, node = new Node(); expect('{'); @@ -1454,38 +2369,37 @@ parseStatement: true, parseSourceElement: true */ name = toString(property.key.value); } kind = (property.kind === 'init') ? PropertyKind.Data : (property.kind === 'get') ? PropertyKind.Get : PropertyKind.Set; - if (Object.prototype.hasOwnProperty.call(map, name)) { - if (map[name] === PropertyKind.Data) { + + key = '$' + name; + if (Object.prototype.hasOwnProperty.call(map, key)) { + if (map[key] === PropertyKind.Data) { if (strict && kind === PropertyKind.Data) { - throwErrorTolerant({}, Messages.StrictDuplicateProperty); + tolerateError(Messages.StrictDuplicateProperty); } else if (kind !== PropertyKind.Data) { - throwErrorTolerant({}, Messages.AccessorDataProperty); + tolerateError(Messages.AccessorDataProperty); } } else { if (kind === PropertyKind.Data) { - throwErrorTolerant({}, Messages.AccessorDataProperty); - } else if (map[name] & kind) { - throwErrorTolerant({}, Messages.AccessorGetSet); + tolerateError(Messages.AccessorDataProperty); + } else if (map[key] & kind) { + tolerateError(Messages.AccessorGetSet); } } - map[name] |= kind; + map[key] |= kind; } else { - map[name] = kind; + map[key] = kind; } properties.push(property); if (!match('}')) { - expect(','); + expectCommaSeparator(); } } expect('}'); - return { - type: Syntax.ObjectExpression, - properties: properties - }; + return node.finishObjectExpression(properties); } // 11.1.6 The Grouping Operator @@ -1495,6 +2409,13 @@ parseStatement: true, parseSourceElement: true */ expect('('); + if (match(')')) { + lex(); + return PlaceHolders.ArrowParameterPlaceHolder; + } + + ++state.parenthesisCount; + expr = parseExpression(); expect(')'); @@ -1506,46 +2427,10 @@ parseStatement: true, parseSourceElement: true */ // 11.1 Primary Expressions function parsePrimaryExpression() { - var token = lookahead(), - type = token.type; - - if (type === Token.Identifier) { - return { - type: Syntax.Identifier, - name: lex().value - }; - } - - if (type === Token.StringLiteral || type === Token.NumericLiteral) { - if (strict && token.octal) { - throwErrorTolerant(token, Messages.StrictOctalLiteral); - } - return createLiteral(lex()); - } - - if (type === Token.Keyword) { - if (matchKeyword('this')) { - lex(); - return { - type: Syntax.ThisExpression - }; - } - - if (matchKeyword('function')) { - return parseFunctionExpression(); - } - } - - if (type === Token.BooleanLiteral) { - lex(); - token.value = (token.value === 'true'); - return createLiteral(token); - } + var type, token, expr, node; - if (type === Token.NullLiteral) { - lex(); - token.value = null; - return createLiteral(token); + if (match('(')) { + return parseGroupExpression(); } if (match('[')) { @@ -1556,15 +2441,46 @@ parseStatement: true, parseSourceElement: true */ return parseObjectInitialiser(); } - if (match('(')) { - return parseGroupExpression(); - } + type = lookahead.type; + node = new Node(); - if (match('/') || match('/=')) { - return createLiteral(scanRegExp()); + if (type === Token.Identifier) { + expr = node.finishIdentifier(lex().value); + } else if (type === Token.StringLiteral || type === Token.NumericLiteral) { + if (strict && lookahead.octal) { + tolerateUnexpectedToken(lookahead, Messages.StrictOctalLiteral); + } + expr = node.finishLiteral(lex()); + } else if (type === Token.Keyword) { + if (matchKeyword('function')) { + return parseFunctionExpression(); + } + if (matchKeyword('this')) { + lex(); + expr = node.finishThisExpression(); + } else { + throwUnexpectedToken(lex()); + } + } else if (type === Token.BooleanLiteral) { + token = lex(); + token.value = (token.value === 'true'); + expr = node.finishLiteral(token); + } else if (type === Token.NullLiteral) { + token = lex(); + token.value = null; + expr = node.finishLiteral(token); + } else if (match('/') || match('/=')) { + if (typeof extra.tokens !== 'undefined') { + expr = node.finishLiteral(collectRegex()); + } else { + expr = node.finishLiteral(scanRegExp()); + } + peek(); + } else { + throwUnexpectedToken(lex()); } - return throwUnexpected(lex()); + return expr; } // 11.2 Left-Hand-Side Expressions @@ -1580,7 +2496,7 @@ parseStatement: true, parseSourceElement: true */ if (match(')')) { break; } - expect(','); + expectCommaSeparator(); } } @@ -1590,16 +2506,15 @@ parseStatement: true, parseSourceElement: true */ } function parseNonComputedProperty() { - var token = lex(); + var token, node = new Node(); + + token = lex(); if (!isIdentifierName(token)) { - throwUnexpected(token); + throwUnexpectedToken(token); } - return { - type: Syntax.Identifier, - name: token.value - }; + return node.finishIdentifier(token.value); } function parseNonComputedMember() { @@ -1621,107 +2536,84 @@ parseStatement: true, parseSourceElement: true */ } function parseNewExpression() { - var expr; + var callee, args, node = new Node(); expectKeyword('new'); + callee = parseLeftHandSideExpression(); + args = match('(') ? parseArguments() : []; - expr = { - type: Syntax.NewExpression, - callee: parseLeftHandSideExpression(), - 'arguments': [] - }; - - if (match('(')) { - expr['arguments'] = parseArguments(); - } - - return expr; + return node.finishNewExpression(callee, args); } function parseLeftHandSideExpressionAllowCall() { - var expr; + var expr, args, property, startToken, previousAllowIn = state.allowIn; + startToken = lookahead; + state.allowIn = true; expr = matchKeyword('new') ? parseNewExpression() : parsePrimaryExpression(); - while (match('.') || match('[') || match('(')) { - if (match('(')) { - expr = { - type: Syntax.CallExpression, - callee: expr, - 'arguments': parseArguments() - }; + for (;;) { + if (match('.')) { + property = parseNonComputedMember(); + expr = new WrappingNode(startToken).finishMemberExpression('.', expr, property); + } else if (match('(')) { + args = parseArguments(); + expr = new WrappingNode(startToken).finishCallExpression(expr, args); } else if (match('[')) { - expr = { - type: Syntax.MemberExpression, - computed: true, - object: expr, - property: parseComputedMember() - }; + property = parseComputedMember(); + expr = new WrappingNode(startToken).finishMemberExpression('[', expr, property); } else { - expr = { - type: Syntax.MemberExpression, - computed: false, - object: expr, - property: parseNonComputedMember() - }; + break; } } + state.allowIn = previousAllowIn; return expr; } - function parseLeftHandSideExpression() { - var expr; + var expr, property, startToken; + assert(state.allowIn, 'callee of new expression always allow in keyword.'); + + startToken = lookahead; expr = matchKeyword('new') ? parseNewExpression() : parsePrimaryExpression(); - while (match('.') || match('[')) { + for (;;) { if (match('[')) { - expr = { - type: Syntax.MemberExpression, - computed: true, - object: expr, - property: parseComputedMember() - }; + property = parseComputedMember(); + expr = new WrappingNode(startToken).finishMemberExpression('[', expr, property); + } else if (match('.')) { + property = parseNonComputedMember(); + expr = new WrappingNode(startToken).finishMemberExpression('.', expr, property); } else { - expr = { - type: Syntax.MemberExpression, - computed: false, - object: expr, - property: parseNonComputedMember() - }; + break; } } - return expr; } // 11.3 Postfix Expressions function parsePostfixExpression() { - var expr = parseLeftHandSideExpressionAllowCall(), token; + var expr, token, startToken = lookahead; - token = lookahead(); - if (token.type !== Token.Punctuator) { - return expr; - } + expr = parseLeftHandSideExpressionAllowCall(); - if ((match('++') || match('--')) && !peekLineTerminator()) { - // 11.3.1, 11.3.2 - if (strict && expr.type === Syntax.Identifier && isRestrictedWord(expr.name)) { - throwErrorTolerant({}, Messages.StrictLHSPostfix); - } - if (!isLeftHandSide(expr)) { - throwErrorTolerant({}, Messages.InvalidLHSInAssignment); - } + if (lookahead.type === Token.Punctuator) { + if ((match('++') || match('--')) && !peekLineTerminator()) { + // 11.3.1, 11.3.2 + if (strict && expr.type === Syntax.Identifier && isRestrictedWord(expr.name)) { + tolerateError(Messages.StrictLHSPostfix); + } - expr = { - type: Syntax.UpdateExpression, - operator: lex().value, - argument: expr, - prefix: false - }; + if (!isLeftHandSide(expr)) { + tolerateError(Messages.InvalidLHSInAssignment); + } + + token = lex(); + expr = new WrappingNode(startToken).finishPostfixExpression(token.value, expr); + } } return expr; @@ -1730,285 +2622,324 @@ parseStatement: true, parseSourceElement: true */ // 11.4 Unary Operators function parseUnaryExpression() { - var token, expr; - - token = lookahead(); - if (token.type !== Token.Punctuator && token.type !== Token.Keyword) { - return parsePostfixExpression(); - } + var token, expr, startToken; - if (match('++') || match('--')) { + if (lookahead.type !== Token.Punctuator && lookahead.type !== Token.Keyword) { + expr = parsePostfixExpression(); + } else if (match('++') || match('--')) { + startToken = lookahead; token = lex(); expr = parseUnaryExpression(); // 11.4.4, 11.4.5 if (strict && expr.type === Syntax.Identifier && isRestrictedWord(expr.name)) { - throwErrorTolerant({}, Messages.StrictLHSPrefix); + tolerateError(Messages.StrictLHSPrefix); } if (!isLeftHandSide(expr)) { - throwErrorTolerant({}, Messages.InvalidLHSInAssignment); + tolerateError(Messages.InvalidLHSInAssignment); } - expr = { - type: Syntax.UpdateExpression, - operator: token.value, - argument: expr, - prefix: true - }; - return expr; - } - - if (match('+') || match('-') || match('~') || match('!')) { - expr = { - type: Syntax.UnaryExpression, - operator: lex().value, - argument: parseUnaryExpression(), - prefix: true - }; - return expr; - } - - if (matchKeyword('delete') || matchKeyword('void') || matchKeyword('typeof')) { - expr = { - type: Syntax.UnaryExpression, - operator: lex().value, - argument: parseUnaryExpression(), - prefix: true - }; + expr = new WrappingNode(startToken).finishUnaryExpression(token.value, expr); + } else if (match('+') || match('-') || match('~') || match('!')) { + startToken = lookahead; + token = lex(); + expr = parseUnaryExpression(); + expr = new WrappingNode(startToken).finishUnaryExpression(token.value, expr); + } else if (matchKeyword('delete') || matchKeyword('void') || matchKeyword('typeof')) { + startToken = lookahead; + token = lex(); + expr = parseUnaryExpression(); + expr = new WrappingNode(startToken).finishUnaryExpression(token.value, expr); if (strict && expr.operator === 'delete' && expr.argument.type === Syntax.Identifier) { - throwErrorTolerant({}, Messages.StrictDelete); + tolerateError(Messages.StrictDelete); } - return expr; + } else { + expr = parsePostfixExpression(); } - return parsePostfixExpression(); + return expr; } - // 11.5 Multiplicative Operators - - function parseMultiplicativeExpression() { - var expr = parseUnaryExpression(); + function binaryPrecedence(token, allowIn) { + var prec = 0; - while (match('*') || match('/') || match('%')) { - expr = { - type: Syntax.BinaryExpression, - operator: lex().value, - left: expr, - right: parseUnaryExpression() - }; + if (token.type !== Token.Punctuator && token.type !== Token.Keyword) { + return 0; } - return expr; - } - - // 11.6 Additive Operators + switch (token.value) { + case '||': + prec = 1; + break; - function parseAdditiveExpression() { - var expr = parseMultiplicativeExpression(); + case '&&': + prec = 2; + break; - while (match('+') || match('-')) { - expr = { - type: Syntax.BinaryExpression, - operator: lex().value, - left: expr, - right: parseMultiplicativeExpression() - }; - } + case '|': + prec = 3; + break; - return expr; - } + case '^': + prec = 4; + break; - // 11.7 Bitwise Shift Operators + case '&': + prec = 5; + break; - function parseShiftExpression() { - var expr = parseAdditiveExpression(); + case '==': + case '!=': + case '===': + case '!==': + prec = 6; + break; - while (match('<<') || match('>>') || match('>>>')) { - expr = { - type: Syntax.BinaryExpression, - operator: lex().value, - left: expr, - right: parseAdditiveExpression() - }; - } + case '<': + case '>': + case '<=': + case '>=': + case 'instanceof': + prec = 7; + break; - return expr; - } - // 11.8 Relational Operators + case 'in': + prec = allowIn ? 7 : 0; + break; - function parseRelationalExpression() { - var expr, previousAllowIn; + case '<<': + case '>>': + case '>>>': + prec = 8; + break; - previousAllowIn = state.allowIn; - state.allowIn = true; + case '+': + case '-': + prec = 9; + break; - expr = parseShiftExpression(); + case '*': + case '/': + case '%': + prec = 11; + break; - while (match('<') || match('>') || match('<=') || match('>=') || (previousAllowIn && matchKeyword('in')) || matchKeyword('instanceof')) { - expr = { - type: Syntax.BinaryExpression, - operator: lex().value, - left: expr, - right: parseShiftExpression() - }; + default: + break; } - state.allowIn = previousAllowIn; - return expr; + return prec; } + // 11.5 Multiplicative Operators + // 11.6 Additive Operators + // 11.7 Bitwise Shift Operators + // 11.8 Relational Operators // 11.9 Equality Operators + // 11.10 Binary Bitwise Operators + // 11.11 Binary Logical Operators - function parseEqualityExpression() { - var expr = parseRelationalExpression(); + function parseBinaryExpression() { + var marker, markers, expr, token, prec, stack, right, operator, left, i; - while (match('==') || match('!=') || match('===') || match('!==')) { - expr = { - type: Syntax.BinaryExpression, - operator: lex().value, - left: expr, - right: parseRelationalExpression() - }; + marker = lookahead; + left = parseUnaryExpression(); + if (left === PlaceHolders.ArrowParameterPlaceHolder) { + return left; } - return expr; - } + token = lookahead; + prec = binaryPrecedence(token, state.allowIn); + if (prec === 0) { + return left; + } + token.prec = prec; + lex(); - // 11.10 Binary Bitwise Operators + markers = [marker, lookahead]; + right = parseUnaryExpression(); - function parseBitwiseANDExpression() { - var expr = parseEqualityExpression(); + stack = [left, token, right]; - while (match('&')) { - lex(); - expr = { - type: Syntax.BinaryExpression, - operator: '&', - left: expr, - right: parseEqualityExpression() - }; + while ((prec = binaryPrecedence(lookahead, state.allowIn)) > 0) { + + // Reduce: make a binary expression from the three topmost entries. + while ((stack.length > 2) && (prec <= stack[stack.length - 2].prec)) { + right = stack.pop(); + operator = stack.pop().value; + left = stack.pop(); + markers.pop(); + expr = new WrappingNode(markers[markers.length - 1]).finishBinaryExpression(operator, left, right); + stack.push(expr); + } + + // Shift. + token = lex(); + token.prec = prec; + stack.push(token); + markers.push(lookahead); + expr = parseUnaryExpression(); + stack.push(expr); + } + + // Final reduce to clean-up the stack. + i = stack.length - 1; + expr = stack[i]; + markers.pop(); + while (i > 1) { + expr = new WrappingNode(markers.pop()).finishBinaryExpression(stack[i - 1].value, stack[i - 2], expr); + i -= 2; } return expr; } - function parseBitwiseXORExpression() { - var expr = parseBitwiseANDExpression(); - while (match('^')) { + // 11.12 Conditional Operator + + function parseConditionalExpression() { + var expr, previousAllowIn, consequent, alternate, startToken; + + startToken = lookahead; + + expr = parseBinaryExpression(); + if (expr === PlaceHolders.ArrowParameterPlaceHolder) { + return expr; + } + if (match('?')) { lex(); - expr = { - type: Syntax.BinaryExpression, - operator: '^', - left: expr, - right: parseBitwiseANDExpression() - }; + previousAllowIn = state.allowIn; + state.allowIn = true; + consequent = parseAssignmentExpression(); + state.allowIn = previousAllowIn; + expect(':'); + alternate = parseAssignmentExpression(); + + expr = new WrappingNode(startToken).finishConditionalExpression(expr, consequent, alternate); } return expr; } - function parseBitwiseORExpression() { - var expr = parseBitwiseXORExpression(); + // [ES6] 14.2 Arrow Function - while (match('|')) { - lex(); - expr = { - type: Syntax.BinaryExpression, - operator: '|', - left: expr, - right: parseBitwiseXORExpression() - }; + function parseConciseBody() { + if (match('{')) { + return parseFunctionSourceElements(); } - - return expr; + return parseAssignmentExpression(); } - // 11.11 Binary Logical Operators + function reinterpretAsCoverFormalsList(expressions) { + var i, len, param, params, defaults, defaultCount, options, rest, token; - function parseLogicalANDExpression() { - var expr = parseBitwiseORExpression(); + params = []; + defaults = []; + defaultCount = 0; + rest = null; + options = { + paramSet: {} + }; - while (match('&&')) { - lex(); - expr = { - type: Syntax.LogicalExpression, - operator: '&&', - left: expr, - right: parseBitwiseORExpression() - }; + for (i = 0, len = expressions.length; i < len; i += 1) { + param = expressions[i]; + if (param.type === Syntax.Identifier) { + params.push(param); + defaults.push(null); + validateParam(options, param, param.name); + } else if (param.type === Syntax.AssignmentExpression) { + params.push(param.left); + defaults.push(param.right); + ++defaultCount; + validateParam(options, param.left, param.left.name); + } else { + return null; + } } - return expr; - } - - function parseLogicalORExpression() { - var expr = parseLogicalANDExpression(); + if (options.message === Messages.StrictParamDupe) { + token = strict ? options.stricted : options.firstRestricted; + throwUnexpectedToken(token, options.message); + } - while (match('||')) { - lex(); - expr = { - type: Syntax.LogicalExpression, - operator: '||', - left: expr, - right: parseLogicalANDExpression() - }; + if (defaultCount === 0) { + defaults = []; } - return expr; + return { + params: params, + defaults: defaults, + rest: rest, + stricted: options.stricted, + firstRestricted: options.firstRestricted, + message: options.message + }; } - // 11.12 Conditional Operator - - function parseConditionalExpression() { - var expr, previousAllowIn, consequent; + function parseArrowFunctionExpression(options, node) { + var previousStrict, body; - expr = parseLogicalORExpression(); + expect('=>'); + previousStrict = strict; - if (match('?')) { - lex(); - previousAllowIn = state.allowIn; - state.allowIn = true; - consequent = parseAssignmentExpression(); - state.allowIn = previousAllowIn; - expect(':'); + body = parseConciseBody(); - expr = { - type: Syntax.ConditionalExpression, - test: expr, - consequent: consequent, - alternate: parseAssignmentExpression() - }; + if (strict && options.firstRestricted) { + throwUnexpectedToken(options.firstRestricted, options.message); + } + if (strict && options.stricted) { + tolerateUnexpectedToken(options.stricted, options.message); } - return expr; + strict = previousStrict; + + return node.finishArrowFunctionExpression(options.params, options.defaults, body, body.type !== Syntax.BlockStatement); } // 11.13 Assignment Operators function parseAssignmentExpression() { - var token, expr; + var oldParenthesisCount, token, expr, right, list, startToken; + + oldParenthesisCount = state.parenthesisCount; + + startToken = lookahead; + token = lookahead; - token = lookahead(); expr = parseConditionalExpression(); + if (expr === PlaceHolders.ArrowParameterPlaceHolder || match('=>')) { + if (state.parenthesisCount === oldParenthesisCount || + state.parenthesisCount === (oldParenthesisCount + 1)) { + if (expr.type === Syntax.Identifier) { + list = reinterpretAsCoverFormalsList([ expr ]); + } else if (expr.type === Syntax.AssignmentExpression) { + list = reinterpretAsCoverFormalsList([ expr ]); + } else if (expr.type === Syntax.SequenceExpression) { + list = reinterpretAsCoverFormalsList(expr.expressions); + } else if (expr === PlaceHolders.ArrowParameterPlaceHolder) { + list = reinterpretAsCoverFormalsList([]); + } + if (list) { + return parseArrowFunctionExpression(list, new WrappingNode(startToken)); + } + } + } + if (matchAssign()) { // LeftHandSideExpression if (!isLeftHandSide(expr)) { - throwErrorTolerant({}, Messages.InvalidLHSInAssignment); + tolerateError(Messages.InvalidLHSInAssignment); } // 11.13.1 if (strict && expr.type === Syntax.Identifier && isRestrictedWord(expr.name)) { - throwErrorTolerant(token, Messages.StrictLHSAssignment); + tolerateUnexpectedToken(token, Messages.StrictLHSAssignment); } - expr = { - type: Syntax.AssignmentExpression, - operator: lex().value, - left: expr, - right: parseAssignmentExpression() - }; + token = lex(); + right = parseAssignmentExpression(); + expr = new WrappingNode(startToken).finishAssignmentExpression(token.value, expr, right); } return expr; @@ -2017,23 +2948,24 @@ parseStatement: true, parseSourceElement: true */ // 11.14 Comma Operator function parseExpression() { - var expr = parseAssignmentExpression(); + var expr, startToken = lookahead, expressions; + + expr = parseAssignmentExpression(); if (match(',')) { - expr = { - type: Syntax.SequenceExpression, - expressions: [ expr ] - }; + expressions = [expr]; while (index < length) { if (!match(',')) { break; } lex(); - expr.expressions.push(parseAssignmentExpression()); + expressions.push(parseAssignmentExpression()); } + expr = new WrappingNode(startToken).finishSequenceExpression(expressions); } + return expr; } @@ -2058,7 +2990,7 @@ parseStatement: true, parseSourceElement: true */ } function parseBlock() { - var block; + var block, node = new Node(); expect('{'); @@ -2066,34 +2998,35 @@ parseStatement: true, parseSourceElement: true */ expect('}'); - return { - type: Syntax.BlockStatement, - body: block - }; + return node.finishBlockStatement(block); } // 12.2 Variable Statement function parseVariableIdentifier() { - var token = lex(); + var token, node = new Node(); + + token = lex(); if (token.type !== Token.Identifier) { - throwUnexpected(token); + if (strict && token.type === Token.Keyword && isStrictModeReservedWord(token.value)) { + tolerateUnexpectedToken(token, Messages.StrictReservedWord); + } else { + throwUnexpectedToken(token); + } } - return { - type: Syntax.Identifier, - name: token.value - }; + return node.finishIdentifier(token.value); } function parseVariableDeclaration(kind) { - var id = parseVariableIdentifier(), - init = null; + var init = null, id, node = new Node(); + + id = parseVariableIdentifier(); // 12.2.1 if (strict && isRestrictedWord(id.name)) { - throwErrorTolerant({}, Messages.StrictVarName); + tolerateError(Messages.StrictVarName); } if (kind === 'const') { @@ -2104,11 +3037,7 @@ parseStatement: true, parseSourceElement: true */ init = parseAssignmentExpression(); } - return { - type: Syntax.VariableDeclarator, - id: id, - init: init - }; + return node.finishVariableDeclarator(id, init); } function parseVariableDeclarationList(kind) { @@ -2125,7 +3054,7 @@ parseStatement: true, parseSourceElement: true */ return list; } - function parseVariableStatement() { + function parseVariableStatement(node) { var declarations; expectKeyword('var'); @@ -2134,11 +3063,7 @@ parseStatement: true, parseSourceElement: true */ consumeSemicolon(); - return { - type: Syntax.VariableDeclaration, - declarations: declarations, - kind: 'var' - }; + return node.finishVariableDeclaration(declarations, 'var'); } // kind may be `const` or `let` @@ -2146,7 +3071,7 @@ parseStatement: true, parseSourceElement: true */ // see http://wiki.ecmascript.org/doku.php?id=harmony:const // and http://wiki.ecmascript.org/doku.php?id=harmony:let function parseConstLetDeclaration(kind) { - var declarations; + var declarations, node = new Node(); expectKeyword(kind); @@ -2154,39 +3079,28 @@ parseStatement: true, parseSourceElement: true */ consumeSemicolon(); - return { - type: Syntax.VariableDeclaration, - declarations: declarations, - kind: kind - }; + return node.finishVariableDeclaration(declarations, kind); } // 12.3 Empty Statement function parseEmptyStatement() { + var node = new Node(); expect(';'); - - return { - type: Syntax.EmptyStatement - }; + return node.finishEmptyStatement(); } // 12.4 Expression Statement - function parseExpressionStatement() { + function parseExpressionStatement(node) { var expr = parseExpression(); - consumeSemicolon(); - - return { - type: Syntax.ExpressionStatement, - expression: expr - }; + return node.finishExpressionStatement(expr); } // 12.5 If statement - function parseIfStatement() { + function parseIfStatement(node) { var test, consequent, alternate; expectKeyword('if'); @@ -2206,17 +3120,12 @@ parseStatement: true, parseSourceElement: true */ alternate = null; } - return { - type: Syntax.IfStatement, - test: test, - consequent: consequent, - alternate: alternate - }; + return node.finishIfStatement(test, consequent, alternate); } // 12.6 Iteration Statements - function parseDoWhileStatement() { + function parseDoWhileStatement(node) { var body, test, oldInIteration; expectKeyword('do'); @@ -2240,14 +3149,10 @@ parseStatement: true, parseSourceElement: true */ lex(); } - return { - type: Syntax.DoWhileStatement, - body: body, - test: test - }; + return node.finishDoWhileStatement(body, test); } - function parseWhileStatement() { + function parseWhileStatement(node) { var test, body, oldInIteration; expectKeyword('while'); @@ -2265,25 +3170,20 @@ parseStatement: true, parseSourceElement: true */ state.inIteration = oldInIteration; - return { - type: Syntax.WhileStatement, - test: test, - body: body - }; + return node.finishWhileStatement(test, body); } function parseForVariableDeclaration() { - var token = lex(); + var token, declarations, node = new Node(); - return { - type: Syntax.VariableDeclaration, - declarations: parseVariableDeclarationList(), - kind: token.value - }; + token = lex(); + declarations = parseVariableDeclarationList(); + + return node.finishVariableDeclaration(declarations, token.value); } - function parseForStatement() { - var init, test, update, left, right, body, oldInIteration; + function parseForStatement(node) { + var init, test, update, left, right, body, oldInIteration, previousAllowIn = state.allowIn; init = test = update = null; @@ -2297,7 +3197,7 @@ parseStatement: true, parseSourceElement: true */ if (matchKeyword('var') || matchKeyword('let')) { state.allowIn = false; init = parseForVariableDeclaration(); - state.allowIn = true; + state.allowIn = previousAllowIn; if (init.declarations.length === 1 && matchKeyword('in')) { lex(); @@ -2308,12 +3208,12 @@ parseStatement: true, parseSourceElement: true */ } else { state.allowIn = false; init = parseExpression(); - state.allowIn = true; + state.allowIn = previousAllowIn; if (matchKeyword('in')) { // LeftHandSideExpression if (!isLeftHandSide(init)) { - throwErrorTolerant({}, Messages.InvalidLHSInForIn); + tolerateError(Messages.InvalidLHSInForIn); } lex(); @@ -2349,183 +3249,143 @@ parseStatement: true, parseSourceElement: true */ state.inIteration = oldInIteration; - if (typeof left === 'undefined') { - return { - type: Syntax.ForStatement, - init: init, - test: test, - update: update, - body: body - }; - } - - return { - type: Syntax.ForInStatement, - left: left, - right: right, - body: body, - each: false - }; + return (typeof left === 'undefined') ? + node.finishForStatement(init, test, update, body) : + node.finishForInStatement(left, right, body); } // 12.7 The continue statement - function parseContinueStatement() { - var token, label = null; + function parseContinueStatement(node) { + var label = null, key; expectKeyword('continue'); // Optimize the most common form: 'continue;'. - if (source[index] === ';') { + if (source.charCodeAt(index) === 0x3B) { lex(); if (!state.inIteration) { - throwError({}, Messages.IllegalContinue); + throwError(Messages.IllegalContinue); } - return { - type: Syntax.ContinueStatement, - label: null - }; + return node.finishContinueStatement(null); } if (peekLineTerminator()) { if (!state.inIteration) { - throwError({}, Messages.IllegalContinue); + throwError(Messages.IllegalContinue); } - return { - type: Syntax.ContinueStatement, - label: null - }; + return node.finishContinueStatement(null); } - token = lookahead(); - if (token.type === Token.Identifier) { + if (lookahead.type === Token.Identifier) { label = parseVariableIdentifier(); - if (!Object.prototype.hasOwnProperty.call(state.labelSet, label.name)) { - throwError({}, Messages.UnknownLabel, label.name); + key = '$' + label.name; + if (!Object.prototype.hasOwnProperty.call(state.labelSet, key)) { + throwError(Messages.UnknownLabel, label.name); } } consumeSemicolon(); if (label === null && !state.inIteration) { - throwError({}, Messages.IllegalContinue); + throwError(Messages.IllegalContinue); } - return { - type: Syntax.ContinueStatement, - label: label - }; + return node.finishContinueStatement(label); } // 12.8 The break statement - function parseBreakStatement() { - var token, label = null; + function parseBreakStatement(node) { + var label = null, key; expectKeyword('break'); - // Optimize the most common form: 'break;'. - if (source[index] === ';') { + // Catch the very common case first: immediately a semicolon (U+003B). + if (source.charCodeAt(index) === 0x3B) { lex(); if (!(state.inIteration || state.inSwitch)) { - throwError({}, Messages.IllegalBreak); + throwError(Messages.IllegalBreak); } - return { - type: Syntax.BreakStatement, - label: null - }; + return node.finishBreakStatement(null); } if (peekLineTerminator()) { if (!(state.inIteration || state.inSwitch)) { - throwError({}, Messages.IllegalBreak); + throwError(Messages.IllegalBreak); } - return { - type: Syntax.BreakStatement, - label: null - }; + return node.finishBreakStatement(null); } - token = lookahead(); - if (token.type === Token.Identifier) { + if (lookahead.type === Token.Identifier) { label = parseVariableIdentifier(); - if (!Object.prototype.hasOwnProperty.call(state.labelSet, label.name)) { - throwError({}, Messages.UnknownLabel, label.name); + key = '$' + label.name; + if (!Object.prototype.hasOwnProperty.call(state.labelSet, key)) { + throwError(Messages.UnknownLabel, label.name); } } consumeSemicolon(); if (label === null && !(state.inIteration || state.inSwitch)) { - throwError({}, Messages.IllegalBreak); + throwError(Messages.IllegalBreak); } - return { - type: Syntax.BreakStatement, - label: label - }; + return node.finishBreakStatement(label); } // 12.9 The return statement - function parseReturnStatement() { - var token, argument = null; + function parseReturnStatement(node) { + var argument = null; expectKeyword('return'); if (!state.inFunctionBody) { - throwErrorTolerant({}, Messages.IllegalReturn); + tolerateError(Messages.IllegalReturn); } // 'return' followed by a space and an identifier is very common. - if (source[index] === ' ') { - if (isIdentifierStart(source[index + 1])) { + if (source.charCodeAt(index) === 0x20) { + if (isIdentifierStart(source.charCodeAt(index + 1))) { argument = parseExpression(); consumeSemicolon(); - return { - type: Syntax.ReturnStatement, - argument: argument - }; + return node.finishReturnStatement(argument); } } if (peekLineTerminator()) { - return { - type: Syntax.ReturnStatement, - argument: null - }; + return node.finishReturnStatement(null); } if (!match(';')) { - token = lookahead(); - if (!match('}') && token.type !== Token.EOF) { + if (!match('}') && lookahead.type !== Token.EOF) { argument = parseExpression(); } } consumeSemicolon(); - return { - type: Syntax.ReturnStatement, - argument: argument - }; + return node.finishReturnStatement(argument); } // 12.10 The with statement - function parseWithStatement() { + function parseWithStatement(node) { var object, body; if (strict) { - throwErrorTolerant({}, Messages.StrictModeWith); + // TODO(ikarienator): Should we update the test cases instead? + skipComment(); + tolerateError(Messages.StrictModeWith); } expectKeyword('with'); @@ -2538,19 +3398,13 @@ parseStatement: true, parseSourceElement: true */ body = parseStatement(); - return { - type: Syntax.WithStatement, - object: object, - body: body - }; + return node.finishWithStatement(object, body); } // 12.10 The swith statement function parseSwitchCase() { - var test, - consequent = [], - statement; + var test, consequent = [], statement, node = new Node(); if (matchKeyword('default')) { lex(); @@ -2566,20 +3420,13 @@ parseStatement: true, parseSourceElement: true */ break; } statement = parseStatement(); - if (typeof statement === 'undefined') { - break; - } consequent.push(statement); } - return { - type: Syntax.SwitchCase, - test: test, - consequent: consequent - }; + return node.finishSwitchCase(test, consequent); } - function parseSwitchStatement() { + function parseSwitchStatement(node) { var discriminant, cases, clause, oldInSwitch, defaultFound; expectKeyword('switch'); @@ -2596,11 +3443,7 @@ parseStatement: true, parseSourceElement: true */ if (match('}')) { lex(); - return { - type: Syntax.SwitchStatement, - discriminant: discriminant, - cases: cases - }; + return node.finishSwitchStatement(discriminant, cases); } oldInSwitch = state.inSwitch; @@ -2614,7 +3457,7 @@ parseStatement: true, parseSourceElement: true */ clause = parseSwitchCase(); if (clause.test === null) { if (defaultFound) { - throwError({}, Messages.MultipleDefaultsInSwitch); + throwError(Messages.MultipleDefaultsInSwitch); } defaultFound = true; } @@ -2625,62 +3468,51 @@ parseStatement: true, parseSourceElement: true */ expect('}'); - return { - type: Syntax.SwitchStatement, - discriminant: discriminant, - cases: cases - }; + return node.finishSwitchStatement(discriminant, cases); } // 12.13 The throw statement - function parseThrowStatement() { + function parseThrowStatement(node) { var argument; expectKeyword('throw'); if (peekLineTerminator()) { - throwError({}, Messages.NewlineAfterThrow); + throwError(Messages.NewlineAfterThrow); } argument = parseExpression(); consumeSemicolon(); - return { - type: Syntax.ThrowStatement, - argument: argument - }; + return node.finishThrowStatement(argument); } // 12.14 The try statement function parseCatchClause() { - var param; + var param, body, node = new Node(); expectKeyword('catch'); expect('('); if (match(')')) { - throwUnexpected(lookahead()); + throwUnexpectedToken(lookahead); } param = parseVariableIdentifier(); // 12.14.1 if (strict && isRestrictedWord(param.name)) { - throwErrorTolerant({}, Messages.StrictCatchVariable); + tolerateError(Messages.StrictCatchVariable); } expect(')'); - - return { - type: Syntax.CatchClause, - param: param, - body: parseBlock() - }; + body = parseBlock(); + return node.finishCatchClause(param, body); } - function parseTryStatement() { + function parseTryStatement(node) { var block, handlers = [], finalizer = null; expectKeyword('try'); @@ -2697,84 +3529,80 @@ parseStatement: true, parseSourceElement: true */ } if (handlers.length === 0 && !finalizer) { - throwError({}, Messages.NoCatchOrFinally); + throwError(Messages.NoCatchOrFinally); } - return { - type: Syntax.TryStatement, - block: block, - guardedHandlers: [], - handlers: handlers, - finalizer: finalizer - }; + return node.finishTryStatement(block, [], handlers, finalizer); } // 12.15 The debugger statement - function parseDebuggerStatement() { + function parseDebuggerStatement(node) { expectKeyword('debugger'); consumeSemicolon(); - return { - type: Syntax.DebuggerStatement - }; + return node.finishDebuggerStatement(); } // 12 Statements function parseStatement() { - var token = lookahead(), + var type = lookahead.type, expr, - labeledBody; + labeledBody, + key, + node; + + if (type === Token.EOF) { + throwUnexpectedToken(lookahead); + } - if (token.type === Token.EOF) { - throwUnexpected(token); + if (type === Token.Punctuator && lookahead.value === '{') { + return parseBlock(); } - if (token.type === Token.Punctuator) { - switch (token.value) { + node = new Node(); + + if (type === Token.Punctuator) { + switch (lookahead.value) { case ';': - return parseEmptyStatement(); - case '{': - return parseBlock(); + return parseEmptyStatement(node); case '(': - return parseExpressionStatement(); + return parseExpressionStatement(node); default: break; } - } - - if (token.type === Token.Keyword) { - switch (token.value) { + } else if (type === Token.Keyword) { + switch (lookahead.value) { case 'break': - return parseBreakStatement(); + return parseBreakStatement(node); case 'continue': - return parseContinueStatement(); + return parseContinueStatement(node); case 'debugger': - return parseDebuggerStatement(); + return parseDebuggerStatement(node); case 'do': - return parseDoWhileStatement(); + return parseDoWhileStatement(node); case 'for': - return parseForStatement(); + return parseForStatement(node); case 'function': - return parseFunctionDeclaration(); + return parseFunctionDeclaration(node); case 'if': - return parseIfStatement(); + return parseIfStatement(node); case 'return': - return parseReturnStatement(); + return parseReturnStatement(node); case 'switch': - return parseSwitchStatement(); + return parseSwitchStatement(node); case 'throw': - return parseThrowStatement(); + return parseThrowStatement(node); case 'try': - return parseTryStatement(); + return parseTryStatement(node); case 'var': - return parseVariableStatement(); + return parseVariableStatement(node); case 'while': - return parseWhileStatement(); + return parseWhileStatement(node); case 'with': - return parseWithStatement(); + return parseWithStatement(node); default: break; } @@ -2786,42 +3614,36 @@ parseStatement: true, parseSourceElement: true */ if ((expr.type === Syntax.Identifier) && match(':')) { lex(); - if (Object.prototype.hasOwnProperty.call(state.labelSet, expr.name)) { - throwError({}, Messages.Redeclaration, 'Label', expr.name); + key = '$' + expr.name; + if (Object.prototype.hasOwnProperty.call(state.labelSet, key)) { + throwError(Messages.Redeclaration, 'Label', expr.name); } - state.labelSet[expr.name] = true; + state.labelSet[key] = true; labeledBody = parseStatement(); - delete state.labelSet[expr.name]; - - return { - type: Syntax.LabeledStatement, - label: expr, - body: labeledBody - }; + delete state.labelSet[key]; + return node.finishLabeledStatement(expr, labeledBody); } consumeSemicolon(); - return { - type: Syntax.ExpressionStatement, - expression: expr - }; + return node.finishExpressionStatement(expr); } // 13 Function Definition function parseFunctionSourceElements() { var sourceElement, sourceElements = [], token, directive, firstRestricted, - oldLabelSet, oldInIteration, oldInSwitch, oldInFunctionBody; + oldLabelSet, oldInIteration, oldInSwitch, oldInFunctionBody, oldParenthesisCount, + node = new Node(); expect('{'); while (index < length) { - token = lookahead(); - if (token.type !== Token.StringLiteral) { + if (lookahead.type !== Token.StringLiteral) { break; } + token = lookahead; sourceElement = parseSourceElement(); sourceElements.push(sourceElement); @@ -2829,11 +3651,11 @@ parseStatement: true, parseSourceElement: true */ // this is not directive break; } - directive = sliceSource(token.range[0] + 1, token.range[1] - 1); + directive = source.slice(token.start + 1, token.end - 1); if (directive === 'use strict') { strict = true; if (firstRestricted) { - throwErrorTolerant(firstRestricted, Messages.StrictOctalLiteral); + tolerateUnexpectedToken(firstRestricted, Messages.StrictOctalLiteral); } } else { if (!firstRestricted && token.octal) { @@ -2846,11 +3668,13 @@ parseStatement: true, parseSourceElement: true */ oldInIteration = state.inIteration; oldInSwitch = state.inSwitch; oldInFunctionBody = state.inFunctionBody; + oldParenthesisCount = state.parenthesizedCount; state.labelSet = {}; state.inIteration = false; state.inSwitch = false; state.inFunctionBody = true; + state.parenthesizedCount = 0; while (index < length) { if (match('}')) { @@ -2869,64 +3693,71 @@ parseStatement: true, parseSourceElement: true */ state.inIteration = oldInIteration; state.inSwitch = oldInSwitch; state.inFunctionBody = oldInFunctionBody; + state.parenthesizedCount = oldParenthesisCount; - return { - type: Syntax.BlockStatement, - body: sourceElements - }; + return node.finishBlockStatement(sourceElements); } - function parseFunctionDeclaration() { - var id, param, params = [], body, token, stricted, firstRestricted, message, previousStrict, paramSet; - - expectKeyword('function'); - token = lookahead(); - id = parseVariableIdentifier(); + function validateParam(options, param, name) { + var key = '$' + name; if (strict) { - if (isRestrictedWord(token.value)) { - throwErrorTolerant(token, Messages.StrictFunctionName); + if (isRestrictedWord(name)) { + options.stricted = param; + options.message = Messages.StrictParamName; } - } else { - if (isRestrictedWord(token.value)) { - firstRestricted = token; - message = Messages.StrictFunctionName; - } else if (isStrictModeReservedWord(token.value)) { - firstRestricted = token; - message = Messages.StrictReservedWord; + if (Object.prototype.hasOwnProperty.call(options.paramSet, key)) { + options.stricted = param; + options.message = Messages.StrictParamDupe; } + } else if (!options.firstRestricted) { + if (isRestrictedWord(name)) { + options.firstRestricted = param; + options.message = Messages.StrictParamName; + } else if (isStrictModeReservedWord(name)) { + options.firstRestricted = param; + options.message = Messages.StrictReservedWord; + } else if (Object.prototype.hasOwnProperty.call(options.paramSet, key)) { + options.firstRestricted = param; + options.message = Messages.StrictParamDupe; + } + } + options.paramSet[key] = true; + } + + function parseParam(options) { + var token, param, def; + + token = lookahead; + param = parseVariableIdentifier(); + validateParam(options, token, token.value); + if (match('=')) { + lex(); + def = parseAssignmentExpression(); + ++options.defaultCount; } + options.params.push(param); + options.defaults.push(def); + + return !match(')'); + } + + function parseParams(firstRestricted) { + var options; + + options = { + params: [], + defaultCount: 0, + defaults: [], + firstRestricted: firstRestricted + }; + expect('('); if (!match(')')) { - paramSet = {}; + options.paramSet = {}; while (index < length) { - token = lookahead(); - param = parseVariableIdentifier(); - if (strict) { - if (isRestrictedWord(token.value)) { - stricted = token; - message = Messages.StrictParamName; - } - if (Object.prototype.hasOwnProperty.call(paramSet, token.value)) { - stricted = token; - message = Messages.StrictParamDupe; - } - } else if (!firstRestricted) { - if (isRestrictedWord(token.value)) { - firstRestricted = token; - message = Messages.StrictParamName; - } else if (isStrictModeReservedWord(token.value)) { - firstRestricted = token; - message = Messages.StrictReservedWord; - } else if (Object.prototype.hasOwnProperty.call(paramSet, token.value)) { - firstRestricted = token; - message = Messages.StrictParamDupe; - } - } - params.push(param); - paramSet[param.name] = true; - if (match(')')) { + if (!parseParam(options)) { break; } expect(','); @@ -2935,39 +3766,73 @@ parseStatement: true, parseSourceElement: true */ expect(')'); + if (options.defaultCount === 0) { + options.defaults = []; + } + + return { + params: options.params, + defaults: options.defaults, + stricted: options.stricted, + firstRestricted: options.firstRestricted, + message: options.message + }; + } + + function parseFunctionDeclaration() { + var id, params = [], defaults = [], body, token, stricted, tmp, firstRestricted, message, previousStrict, node = new Node(); + + expectKeyword('function'); + token = lookahead; + id = parseVariableIdentifier(); + if (strict) { + if (isRestrictedWord(token.value)) { + tolerateUnexpectedToken(token, Messages.StrictFunctionName); + } + } else { + if (isRestrictedWord(token.value)) { + firstRestricted = token; + message = Messages.StrictFunctionName; + } else if (isStrictModeReservedWord(token.value)) { + firstRestricted = token; + message = Messages.StrictReservedWord; + } + } + + tmp = parseParams(firstRestricted); + params = tmp.params; + defaults = tmp.defaults; + stricted = tmp.stricted; + firstRestricted = tmp.firstRestricted; + if (tmp.message) { + message = tmp.message; + } + previousStrict = strict; body = parseFunctionSourceElements(); if (strict && firstRestricted) { - throwError(firstRestricted, message); + throwUnexpectedToken(firstRestricted, message); } if (strict && stricted) { - throwErrorTolerant(stricted, message); + tolerateUnexpectedToken(stricted, message); } strict = previousStrict; - return { - type: Syntax.FunctionDeclaration, - id: id, - params: params, - defaults: [], - body: body, - rest: null, - generator: false, - expression: false - }; + return node.finishFunctionDeclaration(id, params, defaults, body); } function parseFunctionExpression() { - var token, id = null, stricted, firstRestricted, message, param, params = [], body, previousStrict, paramSet; + var token, id = null, stricted, firstRestricted, message, tmp, + params = [], defaults = [], body, previousStrict, node = new Node(); expectKeyword('function'); if (!match('(')) { - token = lookahead(); + token = lookahead; id = parseVariableIdentifier(); if (strict) { if (isRestrictedWord(token.value)) { - throwErrorTolerant(token, Messages.StrictFunctionName); + tolerateUnexpectedToken(token, Messages.StrictFunctionName); } } else { if (isRestrictedWord(token.value)) { @@ -2980,77 +3845,36 @@ parseStatement: true, parseSourceElement: true */ } } - expect('('); - - if (!match(')')) { - paramSet = {}; - while (index < length) { - token = lookahead(); - param = parseVariableIdentifier(); - if (strict) { - if (isRestrictedWord(token.value)) { - stricted = token; - message = Messages.StrictParamName; - } - if (Object.prototype.hasOwnProperty.call(paramSet, token.value)) { - stricted = token; - message = Messages.StrictParamDupe; - } - } else if (!firstRestricted) { - if (isRestrictedWord(token.value)) { - firstRestricted = token; - message = Messages.StrictParamName; - } else if (isStrictModeReservedWord(token.value)) { - firstRestricted = token; - message = Messages.StrictReservedWord; - } else if (Object.prototype.hasOwnProperty.call(paramSet, token.value)) { - firstRestricted = token; - message = Messages.StrictParamDupe; - } - } - params.push(param); - paramSet[param.name] = true; - if (match(')')) { - break; - } - expect(','); - } + tmp = parseParams(firstRestricted); + params = tmp.params; + defaults = tmp.defaults; + stricted = tmp.stricted; + firstRestricted = tmp.firstRestricted; + if (tmp.message) { + message = tmp.message; } - expect(')'); - previousStrict = strict; body = parseFunctionSourceElements(); if (strict && firstRestricted) { - throwError(firstRestricted, message); + throwUnexpectedToken(firstRestricted, message); } if (strict && stricted) { - throwErrorTolerant(stricted, message); + tolerateUnexpectedToken(stricted, message); } strict = previousStrict; - return { - type: Syntax.FunctionExpression, - id: id, - params: params, - defaults: [], - body: body, - rest: null, - generator: false, - expression: false - }; + return node.finishFunctionExpression(id, params, defaults, body); } // 14 Program function parseSourceElement() { - var token = lookahead(); - - if (token.type === Token.Keyword) { - switch (token.value) { + if (lookahead.type === Token.Keyword) { + switch (lookahead.value) { case 'const': case 'let': - return parseConstLetDeclaration(token.value); + return parseConstLetDeclaration(lookahead.value); case 'function': return parseFunctionDeclaration(); default: @@ -3058,7 +3882,7 @@ parseStatement: true, parseSourceElement: true */ } } - if (token.type !== Token.EOF) { + if (lookahead.type !== Token.EOF) { return parseStatement(); } } @@ -3067,7 +3891,7 @@ parseStatement: true, parseSourceElement: true */ var sourceElement, sourceElements = [], token, directive, firstRestricted; while (index < length) { - token = lookahead(); + token = lookahead; if (token.type !== Token.StringLiteral) { break; } @@ -3078,11 +3902,11 @@ parseStatement: true, parseSourceElement: true */ // this is not directive break; } - directive = sliceSource(token.range[0] + 1, token.range[1] - 1); + directive = source.slice(token.start + 1, token.end - 1); if (directive === 'use strict') { strict = true; if (firstRestricted) { - throwErrorTolerant(firstRestricted, Messages.StrictOctalLiteral); + tolerateUnexpectedToken(firstRestricted, Messages.StrictOctalLiteral); } } else { if (!firstRestricted && token.octal) { @@ -3093,6 +3917,7 @@ parseStatement: true, parseSourceElement: true */ while (index < length) { sourceElement = parseSourceElement(); + /* istanbul ignore if */ if (typeof sourceElement === 'undefined') { break; } @@ -3102,251 +3927,15 @@ parseStatement: true, parseSourceElement: true */ } function parseProgram() { - var program; - strict = false; - program = { - type: Syntax.Program, - body: parseSourceElements() - }; - return program; - } - - // The following functions are needed only when the option to preserve - // the comments is active. - - function addComment(type, value, start, end, loc) { - assert(typeof start === 'number', 'Comment must have valid position'); - - // Because the way the actual token is scanned, often the comments - // (if any) are skipped twice during the lexical analysis. - // Thus, we need to skip adding a comment if the comment array already - // handled it. - if (extra.comments.length > 0) { - if (extra.comments[extra.comments.length - 1].range[1] > start) { - return; - } - } - - extra.comments.push({ - type: type, - value: value, - range: [start, end], - loc: loc - }); - } - - function scanComment() { - var comment, ch, loc, start, blockComment, lineComment; - - comment = ''; - blockComment = false; - lineComment = false; - - while (index < length) { - ch = source[index]; - - if (lineComment) { - ch = source[index++]; - if (isLineTerminator(ch)) { - loc.end = { - line: lineNumber, - column: index - lineStart - 1 - }; - lineComment = false; - addComment('Line', comment, start, index - 1, loc); - if (ch === '\r' && source[index] === '\n') { - ++index; - } - ++lineNumber; - lineStart = index; - comment = ''; - } else if (index >= length) { - lineComment = false; - comment += ch; - loc.end = { - line: lineNumber, - column: length - lineStart - }; - addComment('Line', comment, start, length, loc); - } else { - comment += ch; - } - } else if (blockComment) { - if (isLineTerminator(ch)) { - if (ch === '\r' && source[index + 1] === '\n') { - ++index; - comment += '\r\n'; - } else { - comment += ch; - } - ++lineNumber; - ++index; - lineStart = index; - if (index >= length) { - throwError({}, Messages.UnexpectedToken, 'ILLEGAL'); - } - } else { - ch = source[index++]; - if (index >= length) { - throwError({}, Messages.UnexpectedToken, 'ILLEGAL'); - } - comment += ch; - if (ch === '*') { - ch = source[index]; - if (ch === '/') { - comment = comment.substr(0, comment.length - 1); - blockComment = false; - ++index; - loc.end = { - line: lineNumber, - column: index - lineStart - }; - addComment('Block', comment, start, index, loc); - comment = ''; - } - } - } - } else if (ch === '/') { - ch = source[index + 1]; - if (ch === '/') { - loc = { - start: { - line: lineNumber, - column: index - lineStart - } - }; - start = index; - index += 2; - lineComment = true; - if (index >= length) { - loc.end = { - line: lineNumber, - column: index - lineStart - }; - lineComment = false; - addComment('Line', comment, start, index, loc); - } - } else if (ch === '*') { - start = index; - index += 2; - blockComment = true; - loc = { - start: { - line: lineNumber, - column: index - lineStart - 2 - } - }; - if (index >= length) { - throwError({}, Messages.UnexpectedToken, 'ILLEGAL'); - } - } else { - break; - } - } else if (isWhiteSpace(ch)) { - ++index; - } else if (isLineTerminator(ch)) { - ++index; - if (ch === '\r' && source[index] === '\n') { - ++index; - } - ++lineNumber; - lineStart = index; - } else { - break; - } - } - } - - function filterCommentLocation() { - var i, entry, comment, comments = []; - - for (i = 0; i < extra.comments.length; ++i) { - entry = extra.comments[i]; - comment = { - type: entry.type, - value: entry.value - }; - if (extra.range) { - comment.range = entry.range; - } - if (extra.loc) { - comment.loc = entry.loc; - } - comments.push(comment); - } - - extra.comments = comments; - } - - function collectToken() { - var start, loc, token, range, value; + var body, node; skipComment(); - start = index; - loc = { - start: { - line: lineNumber, - column: index - lineStart - } - }; - - token = extra.advance(); - loc.end = { - line: lineNumber, - column: index - lineStart - }; - - if (token.type !== Token.EOF) { - range = [token.range[0], token.range[1]]; - value = sliceSource(token.range[0], token.range[1]); - extra.tokens.push({ - type: TokenName[token.type], - value: value, - range: range, - loc: loc - }); - } - - return token; - } - - function collectRegex() { - var pos, loc, regex, token; - - skipComment(); - - pos = index; - loc = { - start: { - line: lineNumber, - column: index - lineStart - } - }; - - regex = extra.scanRegExp(); - loc.end = { - line: lineNumber, - column: index - lineStart - }; - - // Pop the previous token, which is likely '/' or '/=' - if (extra.tokens.length > 0) { - token = extra.tokens[extra.tokens.length - 1]; - if (token.range[0] === pos && token.type === 'Punctuator') { - if (token.value === '/' || token.value === '/=') { - extra.tokens.pop(); - } - } - } - - extra.tokens.push({ - type: 'RegularExpression', - value: regex.literal, - range: [pos, index], - loc: loc - }); + peek(); + node = new Node(); + strict = false; - return regex; + body = parseSourceElements(); + return node.finishProgram(body); } function filterTokenLocation() { @@ -3358,6 +3947,12 @@ parseStatement: true, parseSourceElement: true */ type: entry.type, value: entry.value }; + if (entry.regex) { + token.regex = { + pattern: entry.regex.pattern, + flags: entry.regex.flags + }; + } if (extra.range) { token.range = entry.range; } @@ -3370,431 +3965,89 @@ parseStatement: true, parseSourceElement: true */ extra.tokens = tokens; } - function createLiteral(token) { - return { - type: Syntax.Literal, - value: token.value - }; - } - - function createRawLiteral(token) { - return { - type: Syntax.Literal, - value: token.value, - raw: sliceSource(token.range[0], token.range[1]) - }; - } - - function createLocationMarker() { - var marker = {}; + function tokenize(code, options) { + var toString, + tokens; - marker.range = [index, index]; - marker.loc = { - start: { - line: lineNumber, - column: index - lineStart - }, - end: { - line: lineNumber, - column: index - lineStart - } - }; - - marker.end = function () { - this.range[1] = index; - this.loc.end.line = lineNumber; - this.loc.end.column = index - lineStart; - }; - - marker.applyGroup = function (node) { - if (extra.range) { - node.groupRange = [this.range[0], this.range[1]]; - } - if (extra.loc) { - node.groupLoc = { - start: { - line: this.loc.start.line, - column: this.loc.start.column - }, - end: { - line: this.loc.end.line, - column: this.loc.end.column - } - }; - } - }; + toString = String; + if (typeof code !== 'string' && !(code instanceof String)) { + code = toString(code); + } - marker.apply = function (node) { - if (extra.range) { - node.range = [this.range[0], this.range[1]]; - } - if (extra.loc) { - node.loc = { - start: { - line: this.loc.start.line, - column: this.loc.start.column - }, - end: { - line: this.loc.end.line, - column: this.loc.end.column - } - }; - } + source = code; + index = 0; + lineNumber = (source.length > 0) ? 1 : 0; + lineStart = 0; + length = source.length; + lookahead = null; + state = { + allowIn: true, + labelSet: {}, + inFunctionBody: false, + inIteration: false, + inSwitch: false, + lastCommentStart: -1 }; - return marker; - } - - function trackGroupExpression() { - var marker, expr; - - skipComment(); - marker = createLocationMarker(); - expect('('); - - expr = parseExpression(); - - expect(')'); - - marker.end(); - marker.applyGroup(expr); - - return expr; - } - - function trackLeftHandSideExpression() { - var marker, expr; - - skipComment(); - marker = createLocationMarker(); - - expr = matchKeyword('new') ? parseNewExpression() : parsePrimaryExpression(); - - while (match('.') || match('[')) { - if (match('[')) { - expr = { - type: Syntax.MemberExpression, - computed: true, - object: expr, - property: parseComputedMember() - }; - marker.end(); - marker.apply(expr); - } else { - expr = { - type: Syntax.MemberExpression, - computed: false, - object: expr, - property: parseNonComputedMember() - }; - marker.end(); - marker.apply(expr); - } - } - - return expr; - } + extra = {}; - function trackLeftHandSideExpressionAllowCall() { - var marker, expr; + // Options matching. + options = options || {}; - skipComment(); - marker = createLocationMarker(); + // Of course we collect tokens here. + options.tokens = true; + extra.tokens = []; + extra.tokenize = true; + // The following two fields are necessary to compute the Regex tokens. + extra.openParenToken = -1; + extra.openCurlyToken = -1; - expr = matchKeyword('new') ? parseNewExpression() : parsePrimaryExpression(); + extra.range = (typeof options.range === 'boolean') && options.range; + extra.loc = (typeof options.loc === 'boolean') && options.loc; - while (match('.') || match('[') || match('(')) { - if (match('(')) { - expr = { - type: Syntax.CallExpression, - callee: expr, - 'arguments': parseArguments() - }; - marker.end(); - marker.apply(expr); - } else if (match('[')) { - expr = { - type: Syntax.MemberExpression, - computed: true, - object: expr, - property: parseComputedMember() - }; - marker.end(); - marker.apply(expr); - } else { - expr = { - type: Syntax.MemberExpression, - computed: false, - object: expr, - property: parseNonComputedMember() - }; - marker.end(); - marker.apply(expr); - } + if (typeof options.comment === 'boolean' && options.comment) { + extra.comments = []; } - - return expr; - } - - function filterGroup(node) { - var n, i, entry; - - n = (Object.prototype.toString.apply(node) === '[object Array]') ? [] : {}; - for (i in node) { - if (node.hasOwnProperty(i) && i !== 'groupRange' && i !== 'groupLoc') { - entry = node[i]; - if (entry === null || typeof entry !== 'object' || entry instanceof RegExp) { - n[i] = entry; - } else { - n[i] = filterGroup(entry); - } - } + if (typeof options.tolerant === 'boolean' && options.tolerant) { + extra.errors = []; } - return n; - } - - function wrapTrackingFunction(range, loc) { - return function (parseFunction) { - - function isBinary(node) { - return node.type === Syntax.LogicalExpression || - node.type === Syntax.BinaryExpression; + try { + peek(); + if (lookahead.type === Token.EOF) { + return extra.tokens; } - function visit(node) { - var start, end; - - if (isBinary(node.left)) { - visit(node.left); - } - if (isBinary(node.right)) { - visit(node.right); - } - - if (range) { - if (node.left.groupRange || node.right.groupRange) { - start = node.left.groupRange ? node.left.groupRange[0] : node.left.range[0]; - end = node.right.groupRange ? node.right.groupRange[1] : node.right.range[1]; - node.range = [start, end]; - } else if (typeof node.range === 'undefined') { - start = node.left.range[0]; - end = node.right.range[1]; - node.range = [start, end]; - } - } - if (loc) { - if (node.left.groupLoc || node.right.groupLoc) { - start = node.left.groupLoc ? node.left.groupLoc.start : node.left.loc.start; - end = node.right.groupLoc ? node.right.groupLoc.end : node.right.loc.end; - node.loc = { - start: start, - end: end - }; - } else if (typeof node.loc === 'undefined') { - node.loc = { - start: node.left.loc.start, - end: node.right.loc.end - }; + lex(); + while (lookahead.type !== Token.EOF) { + try { + lex(); + } catch (lexError) { + if (extra.errors) { + extra.errors.push(lexError); + // We have to break on the first error + // to avoid infinite loops. + break; + } else { + throw lexError; } } } - return function () { - var marker, node; - - skipComment(); - - marker = createLocationMarker(); - node = parseFunction.apply(null, arguments); - marker.end(); - - if (range && typeof node.range === 'undefined') { - marker.apply(node); - } - - if (loc && typeof node.loc === 'undefined') { - marker.apply(node); - } - - if (isBinary(node)) { - visit(node); - } - - return node; - }; - }; - } - - function patch() { - - var wrapTracking; - - if (extra.comments) { - extra.skipComment = skipComment; - skipComment = scanComment; - } - - if (extra.raw) { - extra.createLiteral = createLiteral; - createLiteral = createRawLiteral; - } - - if (extra.range || extra.loc) { - - extra.parseGroupExpression = parseGroupExpression; - extra.parseLeftHandSideExpression = parseLeftHandSideExpression; - extra.parseLeftHandSideExpressionAllowCall = parseLeftHandSideExpressionAllowCall; - parseGroupExpression = trackGroupExpression; - parseLeftHandSideExpression = trackLeftHandSideExpression; - parseLeftHandSideExpressionAllowCall = trackLeftHandSideExpressionAllowCall; - - wrapTracking = wrapTrackingFunction(extra.range, extra.loc); - - extra.parseAdditiveExpression = parseAdditiveExpression; - extra.parseAssignmentExpression = parseAssignmentExpression; - extra.parseBitwiseANDExpression = parseBitwiseANDExpression; - extra.parseBitwiseORExpression = parseBitwiseORExpression; - extra.parseBitwiseXORExpression = parseBitwiseXORExpression; - extra.parseBlock = parseBlock; - extra.parseFunctionSourceElements = parseFunctionSourceElements; - extra.parseCatchClause = parseCatchClause; - extra.parseComputedMember = parseComputedMember; - extra.parseConditionalExpression = parseConditionalExpression; - extra.parseConstLetDeclaration = parseConstLetDeclaration; - extra.parseEqualityExpression = parseEqualityExpression; - extra.parseExpression = parseExpression; - extra.parseForVariableDeclaration = parseForVariableDeclaration; - extra.parseFunctionDeclaration = parseFunctionDeclaration; - extra.parseFunctionExpression = parseFunctionExpression; - extra.parseLogicalANDExpression = parseLogicalANDExpression; - extra.parseLogicalORExpression = parseLogicalORExpression; - extra.parseMultiplicativeExpression = parseMultiplicativeExpression; - extra.parseNewExpression = parseNewExpression; - extra.parseNonComputedProperty = parseNonComputedProperty; - extra.parseObjectProperty = parseObjectProperty; - extra.parseObjectPropertyKey = parseObjectPropertyKey; - extra.parsePostfixExpression = parsePostfixExpression; - extra.parsePrimaryExpression = parsePrimaryExpression; - extra.parseProgram = parseProgram; - extra.parsePropertyFunction = parsePropertyFunction; - extra.parseRelationalExpression = parseRelationalExpression; - extra.parseStatement = parseStatement; - extra.parseShiftExpression = parseShiftExpression; - extra.parseSwitchCase = parseSwitchCase; - extra.parseUnaryExpression = parseUnaryExpression; - extra.parseVariableDeclaration = parseVariableDeclaration; - extra.parseVariableIdentifier = parseVariableIdentifier; - - parseAdditiveExpression = wrapTracking(extra.parseAdditiveExpression); - parseAssignmentExpression = wrapTracking(extra.parseAssignmentExpression); - parseBitwiseANDExpression = wrapTracking(extra.parseBitwiseANDExpression); - parseBitwiseORExpression = wrapTracking(extra.parseBitwiseORExpression); - parseBitwiseXORExpression = wrapTracking(extra.parseBitwiseXORExpression); - parseBlock = wrapTracking(extra.parseBlock); - parseFunctionSourceElements = wrapTracking(extra.parseFunctionSourceElements); - parseCatchClause = wrapTracking(extra.parseCatchClause); - parseComputedMember = wrapTracking(extra.parseComputedMember); - parseConditionalExpression = wrapTracking(extra.parseConditionalExpression); - parseConstLetDeclaration = wrapTracking(extra.parseConstLetDeclaration); - parseEqualityExpression = wrapTracking(extra.parseEqualityExpression); - parseExpression = wrapTracking(extra.parseExpression); - parseForVariableDeclaration = wrapTracking(extra.parseForVariableDeclaration); - parseFunctionDeclaration = wrapTracking(extra.parseFunctionDeclaration); - parseFunctionExpression = wrapTracking(extra.parseFunctionExpression); - parseLeftHandSideExpression = wrapTracking(parseLeftHandSideExpression); - parseLogicalANDExpression = wrapTracking(extra.parseLogicalANDExpression); - parseLogicalORExpression = wrapTracking(extra.parseLogicalORExpression); - parseMultiplicativeExpression = wrapTracking(extra.parseMultiplicativeExpression); - parseNewExpression = wrapTracking(extra.parseNewExpression); - parseNonComputedProperty = wrapTracking(extra.parseNonComputedProperty); - parseObjectProperty = wrapTracking(extra.parseObjectProperty); - parseObjectPropertyKey = wrapTracking(extra.parseObjectPropertyKey); - parsePostfixExpression = wrapTracking(extra.parsePostfixExpression); - parsePrimaryExpression = wrapTracking(extra.parsePrimaryExpression); - parseProgram = wrapTracking(extra.parseProgram); - parsePropertyFunction = wrapTracking(extra.parsePropertyFunction); - parseRelationalExpression = wrapTracking(extra.parseRelationalExpression); - parseStatement = wrapTracking(extra.parseStatement); - parseShiftExpression = wrapTracking(extra.parseShiftExpression); - parseSwitchCase = wrapTracking(extra.parseSwitchCase); - parseUnaryExpression = wrapTracking(extra.parseUnaryExpression); - parseVariableDeclaration = wrapTracking(extra.parseVariableDeclaration); - parseVariableIdentifier = wrapTracking(extra.parseVariableIdentifier); - } - - if (typeof extra.tokens !== 'undefined') { - extra.advance = advance; - extra.scanRegExp = scanRegExp; - - advance = collectToken; - scanRegExp = collectRegex; - } - } - - function unpatch() { - if (typeof extra.skipComment === 'function') { - skipComment = extra.skipComment; - } - - if (extra.raw) { - createLiteral = extra.createLiteral; - } - - if (extra.range || extra.loc) { - parseAdditiveExpression = extra.parseAdditiveExpression; - parseAssignmentExpression = extra.parseAssignmentExpression; - parseBitwiseANDExpression = extra.parseBitwiseANDExpression; - parseBitwiseORExpression = extra.parseBitwiseORExpression; - parseBitwiseXORExpression = extra.parseBitwiseXORExpression; - parseBlock = extra.parseBlock; - parseFunctionSourceElements = extra.parseFunctionSourceElements; - parseCatchClause = extra.parseCatchClause; - parseComputedMember = extra.parseComputedMember; - parseConditionalExpression = extra.parseConditionalExpression; - parseConstLetDeclaration = extra.parseConstLetDeclaration; - parseEqualityExpression = extra.parseEqualityExpression; - parseExpression = extra.parseExpression; - parseForVariableDeclaration = extra.parseForVariableDeclaration; - parseFunctionDeclaration = extra.parseFunctionDeclaration; - parseFunctionExpression = extra.parseFunctionExpression; - parseGroupExpression = extra.parseGroupExpression; - parseLeftHandSideExpression = extra.parseLeftHandSideExpression; - parseLeftHandSideExpressionAllowCall = extra.parseLeftHandSideExpressionAllowCall; - parseLogicalANDExpression = extra.parseLogicalANDExpression; - parseLogicalORExpression = extra.parseLogicalORExpression; - parseMultiplicativeExpression = extra.parseMultiplicativeExpression; - parseNewExpression = extra.parseNewExpression; - parseNonComputedProperty = extra.parseNonComputedProperty; - parseObjectProperty = extra.parseObjectProperty; - parseObjectPropertyKey = extra.parseObjectPropertyKey; - parsePrimaryExpression = extra.parsePrimaryExpression; - parsePostfixExpression = extra.parsePostfixExpression; - parseProgram = extra.parseProgram; - parsePropertyFunction = extra.parsePropertyFunction; - parseRelationalExpression = extra.parseRelationalExpression; - parseStatement = extra.parseStatement; - parseShiftExpression = extra.parseShiftExpression; - parseSwitchCase = extra.parseSwitchCase; - parseUnaryExpression = extra.parseUnaryExpression; - parseVariableDeclaration = extra.parseVariableDeclaration; - parseVariableIdentifier = extra.parseVariableIdentifier; - } - - if (typeof extra.scanRegExp === 'function') { - advance = extra.advance; - scanRegExp = extra.scanRegExp; - } - } - - function stringToArray(str) { - var length = str.length, - result = [], - i; - for (i = 0; i < length; ++i) { - result[i] = str.charAt(i); - } - return result; + filterTokenLocation(); + tokens = extra.tokens; + if (typeof extra.comments !== 'undefined') { + tokens.comments = extra.comments; + } + if (typeof extra.errors !== 'undefined') { + tokens.errors = extra.errors; + } + } catch (e) { + throw e; + } finally { + extra = {}; + } + return tokens; } function parse(code, options) { @@ -3810,20 +4063,27 @@ parseStatement: true, parseSourceElement: true */ lineNumber = (source.length > 0) ? 1 : 0; lineStart = 0; length = source.length; - buffer = null; + lookahead = null; state = { allowIn: true, labelSet: {}, + parenthesisCount: 0, inFunctionBody: false, inIteration: false, - inSwitch: false + inSwitch: false, + lastCommentStart: -1 }; extra = {}; if (typeof options !== 'undefined') { extra.range = (typeof options.range === 'boolean') && options.range; extra.loc = (typeof options.loc === 'boolean') && options.loc; - extra.raw = (typeof options.raw === 'boolean') && options.raw; + extra.attachComment = (typeof options.attachComment === 'boolean') && options.attachComment; + + if (extra.loc && options.source !== null && options.source !== undefined) { + extra.source = toString(options.source); + } + if (typeof options.tokens === 'boolean' && options.tokens) { extra.tokens = []; } @@ -3833,29 +4093,18 @@ parseStatement: true, parseSourceElement: true */ if (typeof options.tolerant === 'boolean' && options.tolerant) { extra.errors = []; } - } - - if (length > 0) { - if (typeof source[0] === 'undefined') { - // Try first to convert to a string. This is good as fast path - // for old IE which understands string indexing for string - // literals only and not for string object. - if (code instanceof String) { - source = code.valueOf(); - } - - // Force accessing the characters via an array. - if (typeof source[0] === 'undefined') { - source = stringToArray(code); - } + if (extra.attachComment) { + extra.range = true; + extra.comments = []; + extra.bottomRightStack = []; + extra.trailingComments = []; + extra.leadingComments = []; } } - patch(); try { program = parseProgram(); if (typeof extra.comments !== 'undefined') { - filterCommentLocation(); program.comments = extra.comments; } if (typeof extra.tokens !== 'undefined') { @@ -3865,25 +4114,24 @@ parseStatement: true, parseSourceElement: true */ if (typeof extra.errors !== 'undefined') { program.errors = extra.errors; } - if (extra.range || extra.loc) { - program.body = filterGroup(program.body); - } } catch (e) { throw e; } finally { - unpatch(); extra = {}; } return program; } - // Sync with package.json. - exports.version = '1.0.4'; + // Sync with *.json manifests. + exports.version = '2.0.0'; + + exports.tokenize = tokenize; exports.parse = parse; // Deep copy. + /* istanbul ignore next */ exports.Syntax = (function () { var name, types = {}; diff --git a/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/esprima/package.json b/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/esprima/package.json index 2889ca3..77d6cab 100644 --- a/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/esprima/package.json +++ b/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/esprima/package.json @@ -7,6 +7,7 @@ "esparse": "./bin/esparse.js", "esvalidate": "./bin/esvalidate.js" }, + "version": "2.0.0", "files": [ "bin", "test/run.js", @@ -16,10 +17,13 @@ "test/reflect.js", "esprima.js" ], - "version": "1.0.4", "engines": { "node": ">=0.4.0" }, + "author": { + "name": "Ariya Hidayat", + "email": "ariya.hidayat@gmail.com" + }, "maintainers": [ { "name": "ariya", @@ -28,14 +32,28 @@ ], "repository": { "type": "git", - "url": "http://github.com/ariya/esprima.git" + "url": "https://github.com/jquery/esprima.git" + }, + "bugs": { + "url": "http://issues.esprima.org" }, "licenses": [ { "type": "BSD", - "url": "http://github.com/ariya/esprima/raw/master/LICENSE.BSD" + "url": "https://github.com/jquery/esprima/raw/master/LICENSE.BSD" } ], + "devDependencies": { + "eslint": "~0.12.0", + "jscs": "~1.10.0", + "istanbul": "~0.2.6", + "escomplex-js": "1.0.0", + "complexity-report": "~1.1.1", + "regenerate": "~0.6.2", + "unicode-7.0.0": "~0.1.5", + "json-diff": "~0.3.1", + "optimist": "~0.6.0" + }, "keywords": [ "ast", "ecmascript", @@ -44,26 +62,31 @@ "syntax" ], "scripts": { - "test": "node test/run.js", + "generate-regex": "node tools/generate-identifier-regex.js", + "test": "node test/run.js && npm run lint && npm run coverage", + "lint": "npm run check-version && npm run eslint && npm run jscs && npm run complexity", + "check-version": "node tools/check-version.js", + "jscs": "jscs esprima.js test/*test.js", + "eslint": "node node_modules/eslint/bin/eslint.js esprima.js", + "complexity": "node tools/list-complexity.js && cr -s -l -w --maxcyc 16 esprima.js", + "coverage": "npm run analyze-coverage && npm run check-coverage", + "analyze-coverage": "node node_modules/istanbul/lib/cli.js cover test/runner.js", + "check-coverage": "node node_modules/istanbul/lib/cli.js check-coverage --statement 100 --branch 100 --function 100", "benchmark": "node test/benchmarks.js", "benchmark-quick": "node test/benchmarks.js quick" }, - "_id": "esprima@1.0.4", + "_id": "esprima@2.0.0", "dist": { - "shasum": "9f557e08fc3b4d26ece9dd34f8fbf476b62585ad", - "tarball": "http://registry.npmjs.org/esprima/-/esprima-1.0.4.tgz" + "shasum": "609ac5c2667eae5433b41eb9ecece2331b41498f", + "tarball": "http://registry.npmjs.org/esprima/-/esprima-2.0.0.tgz" }, - "_npmVersion": "1.1.61", + "_from": "esprima@~ 2.0.0", + "_npmVersion": "1.4.3", "_npmUser": { "name": "ariya", "email": "ariya.hidayat@gmail.com" }, "directories": {}, - "_shasum": "9f557e08fc3b4d26ece9dd34f8fbf476b62585ad", - "_from": "esprima@~ 1.0.2", - "_resolved": "https://registry.npmjs.org/esprima/-/esprima-1.0.4.tgz", - "bugs": { - "url": "https://github.com/ariya/esprima/issues" - }, - "readme": "ERROR: No README data found!" + "_shasum": "609ac5c2667eae5433b41eb9ecece2331b41498f", + "_resolved": "https://registry.npmjs.org/esprima/-/esprima-2.0.0.tgz" } diff --git a/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/esprima/test/compat.js b/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/esprima/test/compat.js index ee3a629..1f67307 100644 --- a/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/esprima/test/compat.js +++ b/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/esprima/test/compat.js @@ -96,6 +96,9 @@ function getContext(esprima, reportCase, reportFailure) { } else if (key === 'raw' && typeof value === "string") { // Ignore Esprima-specific 'raw' property. return undefined; + } else if (key === 'regex' && typeof value === "object") { + // Ignore Esprima-specific 'regex' property. + return undefined; } return value; } @@ -183,13 +186,15 @@ if (typeof window !== 'undefined') { tick = (new Date()) - tick; if (failures > 0) { + document.getElementById('status').className = 'alert-box alert'; setText(document.getElementById('status'), total + ' tests. ' + 'Failures: ' + failures + '. ' + tick + ' ms'); } else { + document.getElementById('status').className = 'alert-box success'; setText(document.getElementById('status'), total + ' tests. ' + 'No failure. ' + tick + ' ms'); } - }, 513); + }, 11); }; } else { (function (global) { diff --git a/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/esprima/test/reflect.js b/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/esprima/test/reflect.js index dba1ba8..4941bbb 100644 --- a/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/esprima/test/reflect.js +++ b/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/esprima/test/reflect.js @@ -19,12 +19,12 @@ function testReflect(Reflect, Pattern) { -function program(elts) { return Pattern({ type: "Program", body: elts }) } -function exprStmt(expr) { return Pattern({ type: "ExpressionStatement", expression: expr }) } -function throwStmt(expr) { return Pattern({ type: "ThrowStatement", argument: expr }) } -function returnStmt(expr) { return Pattern({ type: "ReturnStatement", argument: expr }) } -function yieldExpr(expr) { return Pattern({ type: "YieldExpression", argument: expr }) } -function lit(val) { return Pattern({ type: "Literal", value: val }) } +function program(elts) { return Pattern({ type: "Program", body: elts }); } +function exprStmt(expr) { return Pattern({ type: "ExpressionStatement", expression: expr }); } +function throwStmt(expr) { return Pattern({ type: "ThrowStatement", argument: expr }); } +function returnStmt(expr) { return Pattern({ type: "ReturnStatement", argument: expr }); } +function yieldExpr(expr) { return Pattern({ type: "YieldExpression", argument: expr }); } +function lit(val) { return Pattern({ type: "Literal", value: val }); } var thisExpr = Pattern({ type: "ThisExpression" }); function funDecl(id, params, body) { return Pattern({ type: "FunctionDeclaration", id: id, @@ -34,7 +34,7 @@ function funDecl(id, params, body) { return Pattern({ type: "FunctionDeclaration rest: null, generator: false, expression: false - }) } + }); } function genFunDecl(id, params, body) { return Pattern({ type: "FunctionDeclaration", id: id, params: params, @@ -43,32 +43,32 @@ function genFunDecl(id, params, body) { return Pattern({ type: "FunctionDeclarat rest: null, generator: false, expression: false - }) } -function declarator(id, init) { return Pattern({ type: "VariableDeclarator", id: id, init: init }) } -function varDecl(decls) { return Pattern({ type: "VariableDeclaration", declarations: decls, kind: "var" }) } -function letDecl(decls) { return Pattern({ type: "VariableDeclaration", declarations: decls, kind: "let" }) } -function constDecl(decls) { return Pattern({ type: "VariableDeclaration", declarations: decls, kind: "const" }) } -function ident(name) { return Pattern({ type: "Identifier", name: name }) } -function dotExpr(obj, id) { return Pattern({ type: "MemberExpression", computed: false, object: obj, property: id }) } -function memExpr(obj, id) { return Pattern({ type: "MemberExpression", computed: true, object: obj, property: id }) } -function forStmt(init, test, update, body) { return Pattern({ type: "ForStatement", init: init, test: test, update: update, body: body }) } -function forInStmt(lhs, rhs, body) { return Pattern({ type: "ForInStatement", left: lhs, right: rhs, body: body, each: false }) } -function forEachInStmt(lhs, rhs, body) { return Pattern({ type: "ForInStatement", left: lhs, right: rhs, body: body, each: true }) } -function breakStmt(lab) { return Pattern({ type: "BreakStatement", label: lab }) } -function continueStmt(lab) { return Pattern({ type: "ContinueStatement", label: lab }) } -function blockStmt(body) { return Pattern({ type: "BlockStatement", body: body }) } + }); } +function declarator(id, init) { return Pattern({ type: "VariableDeclarator", id: id, init: init }); } +function varDecl(decls) { return Pattern({ type: "VariableDeclaration", declarations: decls, kind: "var" }); } +function letDecl(decls) { return Pattern({ type: "VariableDeclaration", declarations: decls, kind: "let" }); } +function constDecl(decls) { return Pattern({ type: "VariableDeclaration", declarations: decls, kind: "const" }); } +function ident(name) { return Pattern({ type: "Identifier", name: name }); } +function dotExpr(obj, id) { return Pattern({ type: "MemberExpression", computed: false, object: obj, property: id }); } +function memExpr(obj, id) { return Pattern({ type: "MemberExpression", computed: true, object: obj, property: id }); } +function forStmt(init, test, update, body) { return Pattern({ type: "ForStatement", init: init, test: test, update: update, body: body }); } +function forInStmt(lhs, rhs, body) { return Pattern({ type: "ForInStatement", left: lhs, right: rhs, body: body, each: false }); } +function forEachInStmt(lhs, rhs, body) { return Pattern({ type: "ForInStatement", left: lhs, right: rhs, body: body, each: true }); } +function breakStmt(lab) { return Pattern({ type: "BreakStatement", label: lab }); } +function continueStmt(lab) { return Pattern({ type: "ContinueStatement", label: lab }); } +function blockStmt(body) { return Pattern({ type: "BlockStatement", body: body }); } var emptyStmt = Pattern({ type: "EmptyStatement" }); -function ifStmt(test, cons, alt) { return Pattern({ type: "IfStatement", test: test, alternate: alt, consequent: cons }) } -function labStmt(lab, stmt) { return Pattern({ type: "LabeledStatement", label: lab, body: stmt }) } -function withStmt(obj, stmt) { return Pattern({ type: "WithStatement", object: obj, body: stmt }) } -function whileStmt(test, stmt) { return Pattern({ type: "WhileStatement", test: test, body: stmt }) } -function doStmt(stmt, test) { return Pattern({ type: "DoWhileStatement", test: test, body: stmt }) } -function switchStmt(disc, cases) { return Pattern({ type: "SwitchStatement", discriminant: disc, cases: cases }) } -function caseClause(test, stmts) { return Pattern({ type: "SwitchCase", test: test, consequent: stmts }) } -function defaultClause(stmts) { return Pattern({ type: "SwitchCase", test: null, consequent: stmts }) } -function catchClause(id, guard, body) { if (guard) { return Pattern({ type: "GuardedCatchClause", param: id, guard: guard, body: body }) } else { return Pattern({ type: "CatchClause", param: id, body: body }) } } -function tryStmt(body, guarded, catches, fin) { return Pattern({ type: "TryStatement", block: body, guardedHandlers: guarded, handlers: catches, finalizer: fin }) } -function letStmt(head, body) { return Pattern({ type: "LetStatement", head: head, body: body }) } +function ifStmt(test, cons, alt) { return Pattern({ type: "IfStatement", test: test, alternate: alt, consequent: cons }); } +function labStmt(lab, stmt) { return Pattern({ type: "LabeledStatement", label: lab, body: stmt }); } +function withStmt(obj, stmt) { return Pattern({ type: "WithStatement", object: obj, body: stmt }); } +function whileStmt(test, stmt) { return Pattern({ type: "WhileStatement", test: test, body: stmt }); } +function doStmt(stmt, test) { return Pattern({ type: "DoWhileStatement", test: test, body: stmt }); } +function switchStmt(disc, cases) { return Pattern({ type: "SwitchStatement", discriminant: disc, cases: cases }); } +function caseClause(test, stmts) { return Pattern({ type: "SwitchCase", test: test, consequent: stmts }); } +function defaultClause(stmts) { return Pattern({ type: "SwitchCase", test: null, consequent: stmts }); } +function catchClause(id, guard, body) { if (guard) { return Pattern({ type: "GuardedCatchClause", param: id, guard: guard, body: body }) } else { return Pattern({ type: "CatchClause", param: id, body: body }); } } +function tryStmt(body, guarded, catches, fin) { return Pattern({ type: "TryStatement", block: body, guardedHandlers: guarded, handlers: catches, finalizer: fin }); } +function letStmt(head, body) { return Pattern({ type: "LetStatement", head: head, body: body }); } function funExpr(id, args, body, gen) { return Pattern({ type: "FunctionExpression", id: id, params: args, @@ -77,7 +77,7 @@ function funExpr(id, args, body, gen) { return Pattern({ type: "FunctionExpressi rest: null, generator: false, expression: false - }) } + }); } function genFunExpr(id, args, body) { return Pattern({ type: "FunctionExpression", id: id, params: args, @@ -86,29 +86,29 @@ function genFunExpr(id, args, body) { return Pattern({ type: "FunctionExpression rest: null, generator: false, expression: false - }) } - -function unExpr(op, arg) { return Pattern({ type: "UnaryExpression", operator: op, argument: arg, prefix: true }) } -function binExpr(op, left, right) { return Pattern({ type: "BinaryExpression", operator: op, left: left, right: right }) } -function aExpr(op, left, right) { return Pattern({ type: "AssignmentExpression", operator: op, left: left, right: right }) } -function updExpr(op, arg, prefix) { return Pattern({ type: "UpdateExpression", operator: op, argument: arg, prefix: prefix }) } -function logExpr(op, left, right) { return Pattern({ type: "LogicalExpression", operator: op, left: left, right: right }) } - -function condExpr(test, cons, alt) { return Pattern({ type: "ConditionalExpression", test: test, consequent: cons, alternate: alt }) } -function seqExpr(exprs) { return Pattern({ type: "SequenceExpression", expressions: exprs }) } -function newExpr(callee, args) { return Pattern({ type: "NewExpression", callee: callee, arguments: args }) } -function callExpr(callee, args) { return Pattern({ type: "CallExpression", callee: callee, arguments: args }) } -function arrExpr(elts) { return Pattern({ type: "ArrayExpression", elements: elts }) } -function objExpr(elts) { return Pattern({ type: "ObjectExpression", properties: elts }) } -function objProp(key, value, kind) { return Pattern({ type: "Property", key: key, value: value, kind: kind }) } - -function arrPatt(elts) { return Pattern({ type: "ArrayPattern", elements: elts }) } -function objPatt(elts) { return Pattern({ type: "ObjectPattern", properties: elts }) } - -function localSrc(src) { return "(function(){ " + src + " })" } -function localPatt(patt) { return program([exprStmt(funExpr(null, [], blockStmt([patt])))]) } -function blockSrc(src) { return "(function(){ { " + src + " } })" } -function blockPatt(patt) { return program([exprStmt(funExpr(null, [], blockStmt([blockStmt([patt])])))]) } + }); } + +function unExpr(op, arg) { return Pattern({ type: "UnaryExpression", operator: op, argument: arg, prefix: true }); } +function binExpr(op, left, right) { return Pattern({ type: "BinaryExpression", operator: op, left: left, right: right }); } +function aExpr(op, left, right) { return Pattern({ type: "AssignmentExpression", operator: op, left: left, right: right }); } +function updExpr(op, arg, prefix) { return Pattern({ type: "UpdateExpression", operator: op, argument: arg, prefix: prefix }); } +function logExpr(op, left, right) { return Pattern({ type: "LogicalExpression", operator: op, left: left, right: right }); } + +function condExpr(test, cons, alt) { return Pattern({ type: "ConditionalExpression", test: test, consequent: cons, alternate: alt }); } +function seqExpr(exprs) { return Pattern({ type: "SequenceExpression", expressions: exprs }); } +function newExpr(callee, args) { return Pattern({ type: "NewExpression", callee: callee, arguments: args }); } +function callExpr(callee, args) { return Pattern({ type: "CallExpression", callee: callee, arguments: args }); } +function arrExpr(elts) { return Pattern({ type: "ArrayExpression", elements: elts }); } +function objExpr(elts) { return Pattern({ type: "ObjectExpression", properties: elts }); } +function objProp(key, value, kind) { return Pattern({ type: "Property", key: key, value: value, kind: kind, method: false, shorthand: false }); } + +function arrPatt(elts) { return Pattern({ type: "ArrayPattern", elements: elts }); } +function objPatt(elts) { return Pattern({ type: "ObjectPattern", properties: elts }); } + +function localSrc(src) { return "(function(){ " + src + " })"; } +function localPatt(patt) { return program([exprStmt(funExpr(null, [], blockStmt([patt])))]); } +function blockSrc(src) { return "(function(){ { " + src + " } })"; } +function blockPatt(patt) { return program([exprStmt(funExpr(null, [], blockStmt([blockStmt([patt])])))]); } function assertBlockStmt(src, patt) { blockPatt(patt).assert(Reflect.parse(blockSrc(src))); @@ -271,10 +271,10 @@ assertExpr("(x ^= y)", aExpr("^=", ident("x"), ident("y"))); assertExpr("(x &= y)", aExpr("&=", ident("x"), ident("y"))); assertExpr("(x || y)", logExpr("||", ident("x"), ident("y"))); assertExpr("(x && y)", logExpr("&&", ident("x"), ident("y"))); -assertExpr("(w || x || y || z)", logExpr("||", logExpr("||", logExpr("||", ident("w"), ident("x")), ident("y")), ident("z"))) +assertExpr("(w || x || y || z)", logExpr("||", logExpr("||", logExpr("||", ident("w"), ident("x")), ident("y")), ident("z"))); assertExpr("(x ? y : z)", condExpr(ident("x"), ident("y"), ident("z"))); -assertExpr("(x,y)", seqExpr([ident("x"),ident("y")])) -assertExpr("(x,y,z)", seqExpr([ident("x"),ident("y"),ident("z")])) +assertExpr("(x,y)", seqExpr([ident("x"),ident("y")])); +assertExpr("(x,y,z)", seqExpr([ident("x"),ident("y"),ident("z")])); assertExpr("(a,b,c,d,e,f,g)", seqExpr([ident("a"),ident("b"),ident("c"),ident("d"),ident("e"),ident("f"),ident("g")])); assertExpr("(new Object)", newExpr(ident("Object"), [])); assertExpr("(new Object())", newExpr(ident("Object"), [])); diff --git a/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/esprima/test/run.js b/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/esprima/test/run.js index 32ca3fa..0f08f15 100644 --- a/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/esprima/test/run.js +++ b/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/esprima/test/run.js @@ -36,7 +36,8 @@ suites = [ 'runner', - 'compat' + 'compat', + 'parselibs' ]; function nextTest() { diff --git a/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/esprima/test/runner.js b/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/esprima/test/runner.js index c1a3fc9..6811f65 100644 --- a/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/esprima/test/runner.js +++ b/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/esprima/test/runner.js @@ -33,9 +33,10 @@ var runTests; -// Special handling for regular expression literal since we need to -// convert it to a string literal, otherwise it will be decoded -// as object "{}" and the regular expression would be lost. +// Special handling for regular expression literals: remove their `value` +// property since it may be `null` if it represents a regular expression +// that is not supported in the current environment. The `regex` property +// will be compared instead. function adjustRegexLiteral(key, value) { 'use strict'; if (key === 'value' && value instanceof RegExp) { @@ -71,9 +72,50 @@ function errorToObject(e) { }; } +function sortedObject(o) { + if (o === null) { + return o; + } + if (o instanceof Array) { + return o.map(sortedObject); + } + if (typeof o !== 'object') { + return o; + } + if (o instanceof RegExp) { + return o; + } + var keys = Object.keys(o); + var result = { + range: undefined, + loc: undefined + }; + keys.forEach(function (key) { + if (o.hasOwnProperty(key)){ + result[key] = sortedObject(o[key]); + } + }); + return result; +} + +function hasAttachedComment(syntax) { + var key; + for (key in syntax) { + if (key === 'leadingComments' || key === 'trailingComments') { + return true; + } + if (typeof syntax[key] === 'object' && syntax[key] !== null) { + if (hasAttachedComment(syntax[key])) { + return true; + } + } + } + return false; +} + function testParse(esprima, code, syntax) { 'use strict'; - var expected, tree, actual, options, StringObject, i, len, err; + var expected, tree, actual, options, StringObject, i, len; // alias, so that JSLint does not complain. StringObject = String; @@ -84,9 +126,14 @@ function testParse(esprima, code, syntax) { loc: true, tokens: (typeof syntax.tokens !== 'undefined'), raw: true, - tolerant: (typeof syntax.errors !== 'undefined') + tolerant: (typeof syntax.errors !== 'undefined'), + source: null }; + if (options.comment) { + options.attachComment = hasAttachedComment(syntax); + } + if (typeof syntax.tokens !== 'undefined') { if (syntax.tokens.length > 0) { options.range = (typeof syntax.tokens[0].range !== 'undefined'); @@ -101,8 +148,18 @@ function testParse(esprima, code, syntax) { } } - expected = JSON.stringify(syntax, null, 4); + if (options.loc) { + options.source = syntax.loc.source; + } + + syntax = sortedObject(syntax); + expected = JSON.stringify(syntax, adjustRegexLiteral, 4); try { + // Some variations of the options. + tree = esprima.parse(code, { tolerant: options.tolerant }); + tree = esprima.parse(code, { tolerant: options.tolerant, range: true }); + tree = esprima.parse(code, { tolerant: options.tolerant, loc: true }); + tree = esprima.parse(code, options); tree = (options.comment || options.tokens || options.tolerant) ? tree : tree.body[0]; @@ -111,7 +168,7 @@ function testParse(esprima, code, syntax) { tree.errors[i] = errorToObject(tree.errors[i]); } } - + tree = sortedObject(tree); actual = JSON.stringify(tree, adjustRegexLiteral, 4); // Only to ensure that there is no error when using string object. @@ -139,6 +196,7 @@ function testParse(esprima, code, syntax) { // Check again without any location info. options.range = false; options.loc = false; + syntax = sortedObject(syntax); expected = JSON.stringify(syntax, filter, 4); try { tree = esprima.parse(code, options); @@ -149,7 +207,7 @@ function testParse(esprima, code, syntax) { tree.errors[i] = errorToObject(tree.errors[i]); } } - + tree = sortedObject(tree); actual = JSON.stringify(tree, filter, 4); } catch (e) { throw new NotMatchingError(expected, e.toString()); @@ -159,9 +217,33 @@ function testParse(esprima, code, syntax) { } } +function testTokenize(esprima, code, tokens) { + 'use strict'; + var options, expected, actual, tree; + + options = { + comment: true, + tolerant: true, + loc: true, + range: true + }; + + expected = JSON.stringify(tokens, null, 4); + + try { + tree = esprima.tokenize(code, options); + actual = JSON.stringify(tree, null, 4); + } catch (e) { + throw new NotMatchingError(expected, e.toString()); + } + if (expected !== actual) { + throw new NotMatchingError(expected, actual); + } +} + function testError(esprima, code, exception) { 'use strict'; - var i, options, expected, actual, handleInvalidRegexFlag; + var i, options, expected, actual, err, handleInvalidRegexFlag, tokenize; // Different parsing options should give the same error. options = [ @@ -172,7 +254,7 @@ function testError(esprima, code, exception) { ]; // If handleInvalidRegexFlag is true, an invalid flag in a regular expression - // will throw an exception. In some old version V8, this is not the case + // will throw an exception. In some old version of V8, this is not the case // and hence handleInvalidRegexFlag is false. handleInvalidRegexFlag = false; try { @@ -181,14 +263,26 @@ function testError(esprima, code, exception) { handleInvalidRegexFlag = true; } + exception.description = exception.message.replace(/Error: Line [0-9]+: /, ''); + + if (exception.tokenize) { + tokenize = true; + exception.tokenize = undefined; + } expected = JSON.stringify(exception); for (i = 0; i < options.length; i += 1) { try { - esprima.parse(code, options[i]); + if (tokenize) { + esprima.tokenize(code, options[i]); + } else { + esprima.parse(code, options[i]); + } } catch (e) { - actual = JSON.stringify(errorToObject(e)); + err = errorToObject(e); + err.description = e.description; + actual = JSON.stringify(err); } if (expected !== actual) { @@ -232,6 +326,8 @@ function runTest(esprima, code, result) { testError(esprima, code, result); } else if (result.hasOwnProperty('result')) { testAPI(esprima, code, result); + } else if (result instanceof Array) { + testTokenize(esprima, code, result); } else { testParse(esprima, code, result); } @@ -247,9 +343,7 @@ if (typeof window !== 'undefined') { fixture, source, tick, - expected, - index, - len; + expected; function setText(el, str) { if (typeof el.innerText === 'string') { @@ -334,11 +428,13 @@ if (typeof window !== 'undefined') { tick = (new Date()) - tick; if (failures > 0) { + document.getElementById('status').className = 'alert-box alert'; setText(document.getElementById('status'), total + ' tests. ' + - 'Failures: ' + failures + '. ' + tick + ' ms'); + 'Failures: ' + failures + '. ' + tick + ' ms.'); } else { + document.getElementById('status').className = 'alert-box success'; setText(document.getElementById('status'), total + ' tests. ' + - 'No failure. ' + tick + ' ms'); + 'No failure. ' + tick + ' ms.'); } }; } else { @@ -348,6 +444,7 @@ if (typeof window !== 'undefined') { var esprima = require('../esprima'), vm = require('vm'), fs = require('fs'), + diff = require('json-diff').diffString, total = 0, failures = [], tick = new Date(), @@ -375,9 +472,19 @@ if (typeof window !== 'undefined') { if (failures.length) { console.error(header); failures.forEach(function (failure) { - console.error(failure.source + ': Expected\n ' + - failure.expected.split('\n').join('\n ') + - '\nto match\n ' + failure.actual); + try { + var expectedObject = JSON.parse(failure.expected); + var actualObject = JSON.parse(failure.actual); + + console.error(failure.source + ': Expected\n ' + + failure.expected.split('\n').join('\n ') + + '\nto match\n ' + failure.actual + '\nDiff:\n' + + diff(expectedObject, actualObject)); + } catch (ex) { + console.error(failure.source + ': Expected\n ' + + failure.expected.split('\n').join('\n ') + + '\nto match\n ' + failure.actual); + } }); } else { console.log(header); diff --git a/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/esprima/test/test.js b/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/esprima/test/test.js index 8ceee54..20370b7 100644 --- a/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/esprima/test/test.js +++ b/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/node_modules/esprima/test/test.js @@ -1,4 +1,5 @@ /* + Copyright (C) 2013 Mathias Bynens Copyright (C) 2012 Ariya Hidayat Copyright (C) 2012 Joost-Wim Boekesteijn Copyright (C) 2012 Yusuke Suzuki @@ -44,16 +45,16 @@ var testFixture = { end: { line: 1, column: 4 } } }, - range: [0, 5], + range: [0, 4], loc: { start: { line: 1, column: 0 }, - end: { line: 2, column: 0 } + end: { line: 1, column: 4 } } }], - range: [0, 5], + range: [0, 4], loc: { start: { line: 1, column: 0 }, - end: { line: 2, column: 0 } + end: { line: 1, column: 4 } }, tokens: [{ type: 'Keyword', @@ -80,16 +81,16 @@ var testFixture = { end: { line: 1, column: 4 } } }, - range: [0, 5], + range: [0, 4], loc: { start: { line: 1, column: 0 }, - end: { line: 2, column: 0 } + end: { line: 1, column: 4 } } }], - range: [0, 5], + range: [0, 4], loc: { start: { line: 1, column: 0 }, - end: { line: 2, column: 0 } + end: { line: 1, column: 4 } }, tokens: [{ type: 'Null', @@ -116,16 +117,16 @@ var testFixture = { end: { line: 2, column: 6 } } }, - range: [5, 9], + range: [5, 7], loc: { start: { line: 2, column: 4 }, - end: { line: 4, column: 0 } + end: { line: 2, column: 6 } } }], - range: [5, 9], + range: [5, 7], loc: { start: { line: 2, column: 4 }, - end: { line: 4, column: 0 } + end: { line: 2, column: 6 } }, tokens: [{ type: 'Numeric', @@ -1024,6 +1025,8 @@ var testFixture = { } }, kind: 'init', + method: false, + shorthand: false, range: [6, 16], loc: { start: { line: 1, column: 6 }, @@ -1087,6 +1090,8 @@ var testFixture = { } }, kind: 'init', + method: false, + shorthand: false, range: [6, 12], loc: { start: { line: 1, column: 6 }, @@ -1150,6 +1155,8 @@ var testFixture = { } }, kind: 'init', + method: false, + shorthand: false, range: [6, 14], loc: { start: { line: 1, column: 6 }, @@ -1213,6 +1220,8 @@ var testFixture = { } }, kind: 'init', + method: false, + shorthand: false, range: [6, 15], loc: { start: { line: 1, column: 6 }, @@ -1276,6 +1285,8 @@ var testFixture = { } }, kind: 'init', + method: false, + shorthand: false, range: [6, 14], loc: { start: { line: 1, column: 6 }, @@ -1340,6 +1351,8 @@ var testFixture = { } }, kind: 'init', + method: false, + shorthand: false, range: [6, 18], loc: { start: { line: 1, column: 6 }, @@ -1404,6 +1417,8 @@ var testFixture = { } }, kind: 'init', + method: false, + shorthand: false, range: [6, 10], loc: { start: { line: 1, column: 6 }, @@ -1432,6 +1447,8 @@ var testFixture = { } }, kind: 'init', + method: false, + shorthand: false, range: [12, 16], loc: { start: { line: 1, column: 12 }, @@ -1525,6 +1542,8 @@ var testFixture = { } }, kind: 'get', + method: false, + shorthand: false, range: [6, 36], loc: { start: { line: 1, column: 6 }, @@ -1601,6 +1620,8 @@ var testFixture = { } }, kind: 'get', + method: false, + shorthand: false, range: [6, 20], loc: { start: { line: 1, column: 6 }, @@ -1677,6 +1698,8 @@ var testFixture = { } }, kind: 'get', + method: false, + shorthand: false, range: [6, 17], loc: { start: { line: 1, column: 6 }, @@ -1753,6 +1776,8 @@ var testFixture = { } }, kind: 'get', + method: false, + shorthand: false, range: [6, 19], loc: { start: { line: 1, column: 6 }, @@ -1829,6 +1854,8 @@ var testFixture = { } }, kind: 'get', + method: false, + shorthand: false, range: [6, 20], loc: { start: { line: 1, column: 6 }, @@ -1905,6 +1932,8 @@ var testFixture = { } }, kind: 'get', + method: false, + shorthand: false, range: [6, 19], loc: { start: { line: 1, column: 6 }, @@ -1982,6 +2011,8 @@ var testFixture = { } }, kind: 'get', + method: false, + shorthand: false, range: [6, 22], loc: { start: { line: 1, column: 6 }, @@ -2059,6 +2090,8 @@ var testFixture = { } }, kind: 'get', + method: false, + shorthand: false, range: [6, 17], loc: { start: { line: 1, column: 6 }, @@ -2177,6 +2210,8 @@ var testFixture = { } }, kind: 'set', + method: false, + shorthand: false, range: [6, 34], loc: { start: { line: 1, column: 6 }, @@ -2295,6 +2330,8 @@ var testFixture = { } }, kind: 'set', + method: false, + shorthand: false, range: [6, 28], loc: { start: { line: 1, column: 6 }, @@ -2413,6 +2450,8 @@ var testFixture = { } }, kind: 'set', + method: false, + shorthand: false, range: [6, 32], loc: { start: { line: 1, column: 6 }, @@ -2531,6 +2570,8 @@ var testFixture = { } }, kind: 'set', + method: false, + shorthand: false, range: [6, 34], loc: { start: { line: 1, column: 6 }, @@ -2649,6 +2690,8 @@ var testFixture = { } }, kind: 'set', + method: false, + shorthand: false, range: [6, 32], loc: { start: { line: 1, column: 6 }, @@ -2768,6 +2811,8 @@ var testFixture = { } }, kind: 'set', + method: false, + shorthand: false, range: [6, 34], loc: { start: { line: 1, column: 6 }, @@ -2887,6 +2932,8 @@ var testFixture = { } }, kind: 'set', + method: false, + shorthand: false, range: [6, 30], loc: { start: { line: 1, column: 6 }, @@ -2950,6 +2997,8 @@ var testFixture = { } }, kind: 'init', + method: false, + shorthand: false, range: [6, 13], loc: { start: { line: 1, column: 6 }, @@ -3013,6 +3062,8 @@ var testFixture = { } }, kind: 'init', + method: false, + shorthand: false, range: [6, 13], loc: { start: { line: 1, column: 6 }, @@ -3036,43 +3087,124 @@ var testFixture = { start: { line: 1, column: 0 }, end: { line: 1, column: 15 } } - } - - }, - - 'Comments': { + }, - '/* block comment */ 42': { + 'x = { __proto__: 2 }': { type: 'ExpressionStatement', expression: { - type: 'Literal', - value: 42, - raw: '42', - range: [20, 22], + type: 'AssignmentExpression', + operator: '=', + left: { + type: 'Identifier', + name: 'x', + range: [0, 1], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 1 } + } + }, + right: { + type: 'ObjectExpression', + properties: [{ + type: 'Property', + key: { + type: 'Identifier', + name: '__proto__', + range: [6, 15], + loc: { + start: { line: 1, column: 6 }, + end: { line: 1, column: 15 } + } + }, + value: { + type: 'Literal', + value: 2, + raw: '2', + range: [17, 18], + loc: { + start: { line: 1, column: 17 }, + end: { line: 1, column: 18 } + } + }, + kind: 'init', + method: false, + shorthand: false, + range: [6, 18], + loc: { + start: { line: 1, column: 6 }, + end: { line: 1, column: 18 } + } + }], + range: [4, 20], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 20 } + } + }, + range: [0, 20], loc: { - start: { line: 1, column: 20 }, - end: { line: 1, column: 22 } + start: { line: 1, column: 0 }, + end: { line: 1, column: 20 } } }, - range: [20, 22], + range: [0, 20], loc: { - start: { line: 1, column: 20 }, - end: { line: 1, column: 22 } + start: { line: 1, column: 0 }, + end: { line: 1, column: 20 } } }, - '42 /*The*/ /*Answer*/': { - type: 'Program', - body: [{ - type: 'ExpressionStatement', - expression: { - type: 'Literal', - value: 42, - raw: '42', - range: [0, 2], + 'x = {"__proto__": 2 }': { + type: 'ExpressionStatement', + expression: { + type: 'AssignmentExpression', + operator: '=', + left: { + type: 'Identifier', + name: 'x', + range: [0, 1], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 2 } + end: { line: 1, column: 1 } + } + }, + right: { + type: 'ObjectExpression', + properties: [{ + type: 'Property', + key: { + type: 'Literal', + value: '__proto__', + raw: '"__proto__"', + range: [5, 16], + loc: { + start: { line: 1, column: 5 }, + end: { line: 1, column: 16 } + } + }, + value: { + type: 'Literal', + value: 2, + raw: '2', + range: [18, 19], + loc: { + start: { line: 1, column: 18 }, + end: { line: 1, column: 19 } + } + }, + kind: 'init', + method: false, + shorthand: false, + range: [5, 19], + loc: { + start: { line: 1, column: 5 }, + end: { line: 1, column: 19 } + } + }], + range: [4, 21], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 21 } } }, range: [0, 21], @@ -3080,342 +3212,899 @@ var testFixture = { start: { line: 1, column: 0 }, end: { line: 1, column: 21 } } - }], + }, range: [0, 21], loc: { start: { line: 1, column: 0 }, end: { line: 1, column: 21 } - }, - comments: [{ - type: 'Block', - value: 'The', - range: [3, 10], - loc: { - start: { line: 1, column: 3 }, - end: { line: 1, column: 10 } - } - }, { - type: 'Block', - value: 'Answer', - range: [11, 21], - loc: { - start: { line: 1, column: 11 }, - end: { line: 1, column: 21 } - } - }] - }, - - '42 /*the*/ /*answer*/': { - type: 'Program', - body: [{ - type: 'ExpressionStatement', - expression: { - type: 'Literal', - value: 42, - raw: '42', - range: [0, 2] - }, - range: [0, 21] - }], - range: [0, 21], - comments: [{ - type: 'Block', - value: 'the', - range: [3, 10] - }, { - type: 'Block', - value: 'answer', - range: [11, 21] - }] + } }, - '/* multiline\ncomment\nshould\nbe\nignored */ 42': { + 'x = { get width() { return m_width }, set width(width) { m_width = width; } }': { type: 'ExpressionStatement', expression: { - type: 'Literal', - value: 42, - raw: '42', - range: [42, 44], - loc: { - start: { line: 5, column: 11 }, - end: { line: 5, column: 13 } - } - }, - range: [42, 44], - loc: { - start: { line: 5, column: 11 }, - end: { line: 5, column: 13 } - } - }, - - '/*a\r\nb*/ 42': { - type: 'Program', - body: [{ - type: 'ExpressionStatement', - expression: { - type: 'Literal', - value: 42, - raw: '42', - range: [9, 11], - loc: { - start: { line: 2, column: 4 }, - end: { line: 2, column: 6 } - } - }, - range: [9, 11], - loc: { - start: { line: 2, column: 4 }, - end: { line: 2, column: 6 } - } - }], - range: [9, 11], - loc: { - start: { line: 2, column: 4 }, - end: { line: 2, column: 6 } - }, - comments: [{ - type: 'Block', - value: 'a\r\nb', - range: [0, 8], - loc: { - start: { line: 1, column: 0 }, - end: { line: 2, column: 3 } - } - }] - }, - - '/*a\rb*/ 42': { - type: 'Program', - body: [{ - type: 'ExpressionStatement', - expression: { - type: 'Literal', - value: 42, - raw: '42', - range: [8, 10], + type: 'AssignmentExpression', + operator: '=', + left: { + type: 'Identifier', + name: 'x', + range: [0, 1], loc: { - start: { line: 2, column: 4 }, - end: { line: 2, column: 6 } + start: { line: 1, column: 0 }, + end: { line: 1, column: 1 } } }, - range: [8, 10], - loc: { - start: { line: 2, column: 4 }, - end: { line: 2, column: 6 } - } - }], - range: [8, 10], - loc: { - start: { line: 2, column: 4 }, - end: { line: 2, column: 6 } - }, - comments: [{ - type: 'Block', - value: 'a\rb', - range: [0, 7], - loc: { - start: { line: 1, column: 0 }, - end: { line: 2, column: 3 } - } - }] - }, - - '/*a\nb*/ 42': { - type: 'Program', - body: [{ - type: 'ExpressionStatement', - expression: { - type: 'Literal', - value: 42, - raw: '42', - range: [8, 10], + right: { + type: 'ObjectExpression', + properties: [{ + type: 'Property', + key: { + type: 'Identifier', + name: 'width', + range: [10, 15], + loc: { + start: { line: 1, column: 10 }, + end: { line: 1, column: 15 } + } + }, + value: { + type: 'FunctionExpression', + id: null, + params: [], + defaults: [], + body: { + type: 'BlockStatement', + body: [{ + type: 'ReturnStatement', + argument: { + type: 'Identifier', + name: 'm_width', + range: [27, 34], + loc: { + start: { line: 1, column: 27 }, + end: { line: 1, column: 34 } + } + }, + range: [20, 35], + loc: { + start: { line: 1, column: 20 }, + end: { line: 1, column: 35 } + } + }], + range: [18, 36], + loc: { + start: { line: 1, column: 18 }, + end: { line: 1, column: 36 } + } + }, + rest: null, + generator: false, + expression: false, + range: [18, 36], + loc: { + start: { line: 1, column: 18 }, + end: { line: 1, column: 36 } + } + }, + kind: 'get', + method: false, + shorthand: false, + range: [6, 36], + loc: { + start: { line: 1, column: 6 }, + end: { line: 1, column: 36 } + } + }, { + type: 'Property', + key: { + type: 'Identifier', + name: 'width', + range: [42, 47], + loc: { + start: { line: 1, column: 42 }, + end: { line: 1, column: 47 } + } + }, + value: { + type: 'FunctionExpression', + id: null, + params: [{ + type: 'Identifier', + name: 'width', + range: [48, 53], + loc: { + start: { line: 1, column: 48 }, + end: { line: 1, column: 53 } + } + }], + defaults: [], + body: { + type: 'BlockStatement', + body: [{ + type: 'ExpressionStatement', + expression: { + type: 'AssignmentExpression', + operator: '=', + left: { + type: 'Identifier', + name: 'm_width', + range: [57, 64], + loc: { + start: { line: 1, column: 57 }, + end: { line: 1, column: 64 } + } + }, + right: { + type: 'Identifier', + name: 'width', + range: [67, 72], + loc: { + start: { line: 1, column: 67 }, + end: { line: 1, column: 72 } + } + }, + range: [57, 72], + loc: { + start: { line: 1, column: 57 }, + end: { line: 1, column: 72 } + } + }, + range: [57, 73], + loc: { + start: { line: 1, column: 57 }, + end: { line: 1, column: 73 } + } + }], + range: [55, 75], + loc: { + start: { line: 1, column: 55 }, + end: { line: 1, column: 75 } + } + }, + rest: null, + generator: false, + expression: false, + range: [55, 75], + loc: { + start: { line: 1, column: 55 }, + end: { line: 1, column: 75 } + } + }, + kind: 'set', + method: false, + shorthand: false, + range: [38, 75], + loc: { + start: { line: 1, column: 38 }, + end: { line: 1, column: 75 } + } + }], + range: [4, 77], loc: { - start: { line: 2, column: 4 }, - end: { line: 2, column: 6 } + start: { line: 1, column: 4 }, + end: { line: 1, column: 77 } } }, - range: [8, 10], - loc: { - start: { line: 2, column: 4 }, - end: { line: 2, column: 6 } - } - }], - range: [8, 10], - loc: { - start: { line: 2, column: 4 }, - end: { line: 2, column: 6 } - }, - comments: [{ - type: 'Block', - value: 'a\nb', - range: [0, 7], + range: [0, 77], loc: { start: { line: 1, column: 0 }, - end: { line: 2, column: 3 } - } - }] - }, - - '/*a\nc*/ 42': { - type: 'Program', - body: [{ - type: 'ExpressionStatement', - expression: { - type: 'Literal', - value: 42, - raw: '42', - loc: { - start: { line: 2, column: 4 }, - end: { line: 2, column: 6 } - } - }, - loc: { - start: { line: 2, column: 4 }, - end: { line: 2, column: 6 } + end: { line: 1, column: 77 } } - }], - loc: { - start: { line: 2, column: 4 }, - end: { line: 2, column: 6 } }, - comments: [{ - type: 'Block', - value: 'a\nc', - loc: { - start: { line: 1, column: 0 }, - end: { line: 2, column: 3 } - } - }] - }, + range: [0, 77], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 77 } + } + } - '// line comment\n42': { + + }, + + 'Comments': { + + '/* block comment */ 42': { type: 'ExpressionStatement', expression: { type: 'Literal', value: 42, raw: '42', - range: [16, 18], + range: [20, 22], loc: { - start: { line: 2, column: 0 }, - end: { line: 2, column: 2 } + start: { line: 1, column: 20 }, + end: { line: 1, column: 22 } } }, - range: [16, 18], + range: [20, 22], loc: { - start: { line: 2, column: 0 }, - end: { line: 2, column: 2 } + start: { line: 1, column: 20 }, + end: { line: 1, column: 22 } } }, - '42 // line comment': { - type: 'Program', - body: [{ - type: 'ExpressionStatement', - expression: { - type: 'Literal', - value: 42, - raw: '42', - range: [0, 2], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 2 } - } - }, - range: [0, 18], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 18 } - } - }], - range: [0, 18], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 18 } - }, - comments: [{ - type: 'Line', - value: ' line comment', - range: [3, 18], - loc: { - start: { line: 1, column: 3 }, - end: { line: 1, column: 18 } + '42 /* block comment 1 */ /* block comment 2 */': { + "type": "Program", + "body": [ + { + "type": "ExpressionStatement", + "expression": { + "type": "Literal", + "value": 42, + "raw": "42", + "range": [ + 0, + 2 + ], + "trailingComments": [ + { + "type": "Block", + "value": " block comment 1 ", + "range": [ + 3, + 24 + ] + }, + { + "type": "Block", + "value": " block comment 2 ", + "range": [ + 25, + 46 + ] + } + ] + }, + "range": [ + 0, + 46 + ] + } + ], + "range": [ + 0, + 46 + ], + "comments": [ + { + "type": "Block", + "value": " block comment 1 ", + "range": [ + 3, + 24 + ] + }, + { + "type": "Block", + "value": " block comment 2 ", + "range": [ + 25, + 46 + ] + } + ], + "tokens": [ + { + "type": "Numeric", + "range": [ + 0, + 2 + ], + "value": "42" } - }] + ] }, - '// Hello, world!\n42': { - type: 'Program', - body: [{ - type: 'ExpressionStatement', - expression: { - type: 'Literal', - value: 42, - raw: '42', - range: [17, 19], - loc: { - start: { line: 2, column: 0 }, - end: { line: 2, column: 2 } - } + 'var p1;/* block comment 1 */ /* block comment 2 */': { + "range": [ + 0, + 7 + ], + "loc": { + "start": { + "line": 1, + "column": 0 }, - range: [17, 19], - loc: { - start: { line: 2, column: 0 }, - end: { line: 2, column: 2 } + "end": { + "line": 1, + "column": 7 } - }], - range: [17, 19], - loc: { - start: { line: 2, column: 0 }, - end: { line: 2, column: 2 } }, - comments: [{ - type: 'Line', - value: ' Hello, world!', - range: [0, 16], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 16 } + "type": "Program", + "body": [ + { + "range": [ + 0, + 7 + ], + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "type": "VariableDeclaration", + "declarations": [ + { + "range": [ + 4, + 6 + ], + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "type": "VariableDeclarator", + "id": { + "range": [ + 4, + 6 + ], + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "type": "Identifier", + "name": "p1" + }, + "init": null + } + ], + "kind": "var", + "trailingComments": [ + { + "range": [ + 7, + 28 + ], + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 28 + } + }, + "type": "Block", + "value": " block comment 1 " + }, + { + "range": [ + 29, + 50 + ], + "loc": { + "start": { + "line": 1, + "column": 29 + }, + "end": { + "line": 1, + "column": 50 + } + }, + "type": "Block", + "value": " block comment 2 " + } + ] } - }] + ], + "comments": [ + { + "range": [ + 7, + 28 + ], + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 28 + } + }, + "type": "Block", + "value": " block comment 1 " + }, + { + "range": [ + 29, + 50 + ], + "loc": { + "start": { + "line": 1, + "column": 29 + }, + "end": { + "line": 1, + "column": 50 + } + }, + "type": "Block", + "value": " block comment 2 " + } + ], + "tokens": [ + { + "range": [ + 0, + 3 + ], + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 3 + } + }, + "type": "Keyword", + "value": "var" + }, + { + "range": [ + 4, + 6 + ], + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "type": "Identifier", + "value": "p1" + }, + { + "range": [ + 6, + 7 + ], + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "type": "Punctuator", + "value": ";" + } + ] + }, + + '/*42*/': { + "range": [ + 6, + 6 + ], + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "type": "Program", + "body": [], + "leadingComments": [ + { + "range": [ + 0, + 6 + ], + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "type": "Block", + "value": "42" + } + ], + "comments": [ + { + "range": [ + 0, + 6 + ], + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "type": "Block", + "value": "42" + } + ], + "tokens": [] + }, + + '(a + /* assignmenr */b ) * c': { + "type": "Program", + "body": [ + { + "type": "ExpressionStatement", + "expression": { + "type": "BinaryExpression", + "operator": "*", + "left": { + "type": "BinaryExpression", + "operator": "+", + "left": { + "type": "Identifier", + "name": "a", + "range": [ + 1, + 2 + ], + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 2 + } + } + }, + "right": { + "type": "Identifier", + "name": "b", + "range": [ + 21, + 22 + ], + "loc": { + "start": { + "line": 1, + "column": 21 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "leadingComments": [ + { + "type": "Block", + "value": " assignmenr ", + "range": [ + 5, + 21 + ], + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 21 + } + } + } + ] + }, + "range": [ + 1, + 22 + ], + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 22 + } + } + }, + "right": { + "type": "Identifier", + "name": "c", + "range": [ + 27, + 28 + ], + "loc": { + "start": { + "line": 1, + "column": 27 + }, + "end": { + "line": 1, + "column": 28 + } + } + }, + "range": [ + 0, + 28 + ], + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 28 + } + } + }, + "range": [ + 0, + 28 + ], + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 28 + } + } + } + ], + "range": [ + 0, + 28 + ], + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 28 + } + }, + "comments": [ + { + "type": "Block", + "value": " assignmenr ", + "range": [ + 5, + 21 + ], + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 21 + } + } + } + ] + }, + + '/* assignmenr */\n a = b': { + "type": "Program", + "body": [ + { + "type": "ExpressionStatement", + "expression": { + "type": "AssignmentExpression", + "operator": "=", + "left": { + "type": "Identifier", + "name": "a", + "range": [ + 18, + 19 + ], + "loc": { + "start": { + "line": 2, + "column": 1 + }, + "end": { + "line": 2, + "column": 2 + } + } + }, + "right": { + "type": "Identifier", + "name": "b", + "range": [ + 22, + 23 + ], + "loc": { + "start": { + "line": 2, + "column": 5 + }, + "end": { + "line": 2, + "column": 6 + } + } + }, + "range": [ + 18, + 23 + ], + "loc": { + "start": { + "line": 2, + "column": 1 + }, + "end": { + "line": 2, + "column": 6 + } + } + }, + "range": [ + 18, + 23 + ], + "loc": { + "start": { + "line": 2, + "column": 1 + }, + "end": { + "line": 2, + "column": 6 + } + }, + "leadingComments": [ + { + "type": "Block", + "value": " assignmenr ", + "range": [ + 0, + 16 + ], + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 16 + } + } + } + ] + } + ], + "range": [ + 18, + 23 + ], + "loc": { + "start": { + "line": 2, + "column": 1 + }, + "end": { + "line": 2, + "column": 6 + } + }, + "comments": [ + { + "type": "Block", + "value": " assignmenr ", + "range": [ + 0, + 16 + ], + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 16 + } + } + } + ] }, - '// Hello, world!\n': { + '42 /*The*/ /*Answer*/': { type: 'Program', - body: [], - range: [17, 17], - loc: { - start: { line: 2, column: 0 }, - end: { line: 2, column: 0 } - }, - comments: [{ - type: 'Line', - value: ' Hello, world!', - range: [0, 16], + body: [{ + type: 'ExpressionStatement', + expression: { + type: 'Literal', + value: 42, + raw: '42', + range: [0, 2], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 2 } + } + }, + range: [0, 21], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 16 } + end: { line: 1, column: 21 } } - }] - }, - - '// Hallo, world!\n': { - type: 'Program', - body: [], + }], + range: [0, 21], loc: { - start: { line: 2, column: 0 }, - end: { line: 2, column: 0 } + start: { line: 1, column: 0 }, + end: { line: 1, column: 21 } }, comments: [{ - type: 'Line', - value: ' Hallo, world!', + type: 'Block', + value: 'The', + range: [3, 10], loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 16 } + start: { line: 1, column: 3 }, + end: { line: 1, column: 10 } + } + }, { + type: 'Block', + value: 'Answer', + range: [11, 21], + loc: { + start: { line: 1, column: 11 }, + end: { line: 1, column: 21 } } }] }, - '//\n42': { + '42 /*the*/ /*answer*/': { type: 'Program', body: [{ type: 'ExpressionStatement', @@ -3423,65 +4112,42 @@ var testFixture = { type: 'Literal', value: 42, raw: '42', - range: [3, 5], - loc: { - start: { line: 2, column: 0 }, - end: { line: 2, column: 2 } - } + range: [0, 2] }, - range: [3, 5], - loc: { - start: { line: 2, column: 0 }, - end: { line: 2, column: 2 } - } + range: [0, 21] }], - range: [3, 5], - loc: { - start: { line: 2, column: 0 }, - end: { line: 2, column: 2 } - }, + range: [0, 21], comments: [{ - type: 'Line', - value: '', - range: [0, 2], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 2 } - } + type: 'Block', + value: 'the', + range: [3, 10] + }, { + type: 'Block', + value: 'answer', + range: [11, 21] }] }, - '//': { - type: 'Program', - body: [], - range: [2, 2], - loc: { - start: { line: 1, column: 2 }, - end: { line: 1, column: 2 } - }, - comments: [{ - type: 'Line', - value: '', + '42 /* the * answer */': { + type: 'ExpressionStatement', + expression: { + type: 'Literal', + value: 42, + raw: '42', range: [0, 2], loc: { start: { line: 1, column: 0 }, end: { line: 1, column: 2 } } - }] - }, - - '// ': { - type: 'Program', - body: [], - range: [3, 3], - comments: [{ - type: 'Line', - value: ' ', - range: [0, 3] - }] + }, + range: [0, 21], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 21 } + } }, - '/**/42': { + '42 /* The * answer */': { type: 'Program', body: [{ type: 'ExpressionStatement', @@ -3489,35 +4155,54 @@ var testFixture = { type: 'Literal', value: 42, raw: '42', - range: [4, 6], + range: [0, 2], loc: { - start: { line: 1, column: 4 }, - end: { line: 1, column: 6 } + start: { line: 1, column: 0 }, + end: { line: 1, column: 2 } } }, - range: [4, 6], + range: [0, 21], loc: { - start: { line: 1, column: 4 }, - end: { line: 1, column: 6 } + start: { line: 1, column: 0 }, + end: { line: 1, column: 21 } } }], - range: [4, 6], + range: [0, 21], loc: { - start: { line: 1, column: 4 }, - end: { line: 1, column: 6 } + start: { line: 1, column: 0 }, + end: { line: 1, column: 21 } }, comments: [{ type: 'Block', - value: '', - range: [0, 4], + value: ' The * answer ', + range: [3, 21], loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 4 } + start: { line: 1, column: 3 }, + end: { line: 1, column: 21 } } }] }, - '// Hello, world!\n\n// Another hello\n42': { + '/* multiline\ncomment\nshould\nbe\nignored */ 42': { + type: 'ExpressionStatement', + expression: { + type: 'Literal', + value: 42, + raw: '42', + range: [42, 44], + loc: { + start: { line: 5, column: 11 }, + end: { line: 5, column: 13 } + } + }, + range: [42, 44], + loc: { + start: { line: 5, column: 11 }, + end: { line: 5, column: 13 } + } + }, + + '/*a\r\nb*/ 42': { type: 'Program', body: [{ type: 'ExpressionStatement', @@ -3525,2713 +4210,2415 @@ var testFixture = { type: 'Literal', value: 42, raw: '42', - range: [37, 39], + range: [9, 11], loc: { - start: { line: 4, column: 0 }, - end: { line: 4, column: 2 } + start: { line: 2, column: 4 }, + end: { line: 2, column: 6 } } }, - range: [37, 39], + range: [9, 11], loc: { - start: { line: 4, column: 0 }, - end: { line: 4, column: 2 } - } + start: { line: 2, column: 4 }, + end: { line: 2, column: 6 } + }, + leadingComments: [{ + type: 'Block', + value: 'a\r\nb', + range: [0, 8], + loc: { + start: { line: 1, column: 0 }, + end: { line: 2, column: 3 } + } + }] }], - range: [37, 39], + range: [9, 11], loc: { - start: { line: 4, column: 0 }, - end: { line: 4, column: 2 } + start: { line: 2, column: 4 }, + end: { line: 2, column: 6 } }, comments: [{ - type: 'Line', - value: ' Hello, world!', - range: [0, 16], + type: 'Block', + value: 'a\r\nb', + range: [0, 8], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 16 } - } - }, { - type: 'Line', - value: ' Another hello', - range: [18, 36], - loc: { - start: { line: 3, column: 0 }, - end: { line: 3, column: 18 } + end: { line: 2, column: 3 } } }] }, - 'if (x) { // Some comment\ndoThat(); }': { + '/*a\rb*/ 42': { type: 'Program', body: [{ - type: 'IfStatement', - test: { - type: 'Identifier', - name: 'x', - range: [4, 5], - loc: { - start: { line: 1, column: 4 }, - end: { line: 1, column: 5 } - } - }, - consequent: { - type: 'BlockStatement', - body: [{ - type: 'ExpressionStatement', - expression: { - type: 'CallExpression', - callee: { - type: 'Identifier', - name: 'doThat', - range: [25, 31], - loc: { - start: { line: 2, column: 0 }, - end: { line: 2, column: 6 } - } - }, - 'arguments': [], - range: [25, 33], - loc: { - start: { line: 2, column: 0 }, - end: { line: 2, column: 8 } - } - }, - range: [25, 34], - loc: { - start: { line: 2, column: 0 }, - end: { line: 2, column: 9 } - } - }], - range: [7, 36], + type: 'ExpressionStatement', + expression: { + type: 'Literal', + value: 42, + raw: '42', + range: [8, 10], loc: { - start: { line: 1, column: 7 }, - end: { line: 2, column: 11 } + start: { line: 2, column: 4 }, + end: { line: 2, column: 6 } } }, - alternate: null, - range: [0, 36], + range: [8, 10], loc: { - start: { line: 1, column: 0 }, - end: { line: 2, column: 11 } + start: { line: 2, column: 4 }, + end: { line: 2, column: 6 } } }], - range: [0, 36], + range: [8, 10], loc: { - start: { line: 1, column: 0 }, - end: { line: 2, column: 11 } + start: { line: 2, column: 4 }, + end: { line: 2, column: 6 } }, comments: [{ - type: 'Line', - value: ' Some comment', - range: [9, 24], + type: 'Block', + value: 'a\rb', + range: [0, 7], loc: { - start: { line: 1, column: 9 }, - end: { line: 1, column: 24 } + start: { line: 1, column: 0 }, + end: { line: 2, column: 3 } } }] }, - 'switch (answer) { case 42: /* perfect */ bingo() }': { + '/*a\nb*/ 42': { type: 'Program', body: [{ - type: 'SwitchStatement', - discriminant: { - type: 'Identifier', - name: 'answer', - range: [8, 14], + type: 'ExpressionStatement', + expression: { + type: 'Literal', + value: 42, + raw: '42', + range: [8, 10], loc: { - start: { line: 1, column: 8 }, - end: { line: 1, column: 14 } + start: { line: 2, column: 4 }, + end: { line: 2, column: 6 } } }, - cases: [{ - type: 'SwitchCase', - test: { - type: 'Literal', - value: 42, - raw: '42', - range: [23, 25], - loc: { - start: { line: 1, column: 23 }, - end: { line: 1, column: 25 } - } - }, - consequent: [{ - type: 'ExpressionStatement', - expression: { - type: 'CallExpression', - callee: { - type: 'Identifier', - name: 'bingo', - range: [41, 46], - loc: { - start: { line: 1, column: 41 }, - end: { line: 1, column: 46 } - } - }, - 'arguments': [], - range: [41, 48], - loc: { - start: { line: 1, column: 41 }, - end: { line: 1, column: 48 } - } - }, - range: [41, 49], - loc: { - start: { line: 1, column: 41 }, - end: { line: 1, column: 49 } - } - }], - range: [18, 49], + range: [8, 10], + loc: { + start: { line: 2, column: 4 }, + end: { line: 2, column: 6 } + }, + leadingComments: [{ + type: 'Block', + value: 'a\nb', + range: [0, 7], loc: { - start: { line: 1, column: 18 }, - end: { line: 1, column: 49 } + start: { line: 1, column: 0 }, + end: { line: 2, column: 3 } } - }], - range: [0, 50], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 50 } - } + }] }], - range: [0, 50], + range: [8, 10], loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 50 } + start: { line: 2, column: 4 }, + end: { line: 2, column: 6 } }, comments: [{ type: 'Block', - value: ' perfect ', - range: [27, 40], + value: 'a\nb', + range: [0, 7], loc: { - start: { line: 1, column: 27 }, - end: { line: 1, column: 40 } + start: { line: 1, column: 0 }, + end: { line: 2, column: 3 } } }] - } - - }, - - 'Numeric Literals': { + }, - '0': { - type: 'ExpressionStatement', - expression: { - type: 'Literal', - value: 0, - raw: '0', - range: [0, 1], + '/*a\nc*/ 42': { + type: 'Program', + body: [{ + type: 'ExpressionStatement', + expression: { + type: 'Literal', + value: 42, + raw: '42', + range: [8, 10], + loc: { + start: { line: 2, column: 4 }, + end: { line: 2, column: 6 } + } + }, + range: [8, 10], + loc: { + start: { line: 2, column: 4 }, + end: { line: 2, column: 6 } + }, + leadingComments: [{ + type: 'Block', + value: 'a\nc', + range: [0, 7], + loc: { + start: { line: 1, column: 0 }, + end: { line: 2, column: 3 } + } + }] + }], + range: [8, 10], + loc: { + start: { line: 2, column: 4 }, + end: { line: 2, column: 6 } + }, + comments: [{ + type: 'Block', + value: 'a\nc', + range: [0, 7], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 1 } + end: { line: 2, column: 3 } } - }, - range: [0, 1], + }] + }, + + '// one\\n': { + type: 'Program', + body: [], + range: [8, 8], loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 1 } - } + start: { line: 1, column: 8 }, + end: { line: 1, column: 8 } + }, + leadingComments: [{ + type: 'Line', + value: ' one\\n', + range: [0, 8], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 8 } + } + }], + comments: [{ + type: 'Line', + value: ' one\\n', + range: [0, 8], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 8 } + } + }] }, - '42': { + '// line comment\n42': { type: 'ExpressionStatement', expression: { type: 'Literal', value: 42, raw: '42', - range: [0, 2], + range: [16, 18], loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 2 } + start: { line: 2, column: 0 }, + end: { line: 2, column: 2 } } }, - range: [0, 2], + range: [16, 18], loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 2 } + start: { line: 2, column: 0 }, + end: { line: 2, column: 2 } } }, - '3': { + '42 // line comment': { type: 'Program', body: [{ type: 'ExpressionStatement', expression: { type: 'Literal', - value: 3, - raw: '3', - range: [0, 1] + value: 42, + raw: '42', + range: [0, 2], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 2 } + }, + trailingComments: [{ + type: 'Line', + value: ' line comment', + range: [3, 18], + loc: { + start: { line: 1, column: 3 }, + end: { line: 1, column: 18 } + } + }] }, - range: [0, 1] + range: [0, 18], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 18 } + } }], - range: [0, 1], - tokens: [{ - type: 'Numeric', - value: '3', - range: [0, 1] + range: [0, 18], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 18 } + }, + comments: [{ + type: 'Line', + value: ' line comment', + range: [3, 18], + loc: { + start: { line: 1, column: 3 }, + end: { line: 1, column: 18 } + } }] }, - '5': { + '// Hello, world!\n42': { type: 'Program', body: [{ type: 'ExpressionStatement', expression: { type: 'Literal', - value: 5, - raw: '5', + value: 42, + raw: '42', + range: [17, 19], loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 1 } + start: { line: 2, column: 0 }, + end: { line: 2, column: 2 } } }, + range: [17, 19], loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 1 } - } + start: { line: 2, column: 0 }, + end: { line: 2, column: 2 } + }, + leadingComments: [{ + type: 'Line', + value: ' Hello, world!', + range: [0, 16], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 16 } + } + }] }], + range: [17, 19], loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 1 } + start: { line: 2, column: 0 }, + end: { line: 2, column: 2 } }, - tokens: [{ - type: 'Numeric', - value: '5', + comments: [{ + type: 'Line', + value: ' Hello, world!', + range: [0, 16], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 1 } + end: { line: 1, column: 16 } } }] }, - '.14': { - type: 'ExpressionStatement', - expression: { - type: 'Literal', - value: 0.14, - raw: '.14', - range: [0, 3], + '// Hello, world!\n': { + type: 'Program', + body: [], + range: [17, 17], + loc: { + start: { line: 2, column: 0 }, + end: { line: 2, column: 0 } + }, + comments: [{ + type: 'Line', + value: ' Hello, world!', + range: [0, 16], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 3 } + end: { line: 1, column: 16 } } - }, - range: [0, 3], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 3 } - } + }] }, - '3.14159': { - type: 'ExpressionStatement', - expression: { - type: 'Literal', - value: 3.14159, - raw: '3.14159', - range: [0, 7], + '// Hallo, world!\n': { + type: 'Program', + body: [], + loc: { + start: { line: 2, column: 0 }, + end: { line: 2, column: 0 } + }, + comments: [{ + type: 'Line', + value: ' Hallo, world!', loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 7 } + end: { line: 1, column: 16 } } - }, - range: [0, 7], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 7 } - } + }] }, - '6.02214179e+23': { - type: 'ExpressionStatement', - expression: { - type: 'Literal', - value: 6.02214179e+23, - raw: '6.02214179e+23', - range: [0, 14], + '//\n42': { + type: 'Program', + body: [{ + type: 'ExpressionStatement', + expression: { + type: 'Literal', + value: 42, + raw: '42', + range: [3, 5], + loc: { + start: { line: 2, column: 0 }, + end: { line: 2, column: 2 } + } + }, + range: [3, 5], + loc: { + start: { line: 2, column: 0 }, + end: { line: 2, column: 2 } + }, + leadingComments: [{ + type: 'Line', + value: '', + range: [0, 2], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 2 } + } + }] + }], + range: [3, 5], + loc: { + start: { line: 2, column: 0 }, + end: { line: 2, column: 2 } + }, + comments: [{ + type: 'Line', + value: '', + range: [0, 2], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 14 } + end: { line: 1, column: 2 } } - }, - range: [0, 14], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 14 } - } + }] }, - '1.492417830e-10': { - type: 'ExpressionStatement', - expression: { - type: 'Literal', - value: 1.49241783e-10, - raw: '1.492417830e-10', - range: [0, 15], + '//': { + type: 'Program', + body: [], + range: [2, 2], + loc: { + start: { line: 1, column: 2 }, + end: { line: 1, column: 2 } + }, + comments: [{ + type: 'Line', + value: '', + range: [0, 2], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 15 } + end: { line: 1, column: 2 } } - }, - range: [0, 15], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 15 } - } + }] }, - '0x0': { - type: 'ExpressionStatement', - expression: { - type: 'Literal', - value: 0, - raw: '0x0', - range: [0, 3], + '// ': { + type: 'Program', + body: [], + range: [3, 3], + comments: [{ + type: 'Line', + value: ' ', + range: [0, 3] + }] + }, + + '/**/42': { + type: 'Program', + body: [{ + type: 'ExpressionStatement', + expression: { + type: 'Literal', + value: 42, + raw: '42', + range: [4, 6], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 6 } + } + }, + range: [4, 6], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 6 } + }, + leadingComments: [{ + type: 'Block', + value: '', + range: [0, 4], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 4 } + } + }] + }], + range: [4, 6], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 6 } + }, + comments: [{ + type: 'Block', + value: '', + range: [0, 4], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 3 } + end: { line: 1, column: 4 } } - }, - range: [0, 3], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 3 } - } + }] }, - '0e+100': { - type: 'ExpressionStatement', - expression: { - type: 'Literal', - value: 0, - raw: '0e+100', + '42/**/': { + type: 'Program', + body: [{ + type: 'ExpressionStatement', + expression: { + type: 'Literal', + value: 42, + raw: '42', + range: [0, 2], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 2 } + }, + trailingComments: [{ + type: 'Block', + value: '', + range: [2, 6], + loc: { + start: { line: 1, column: 2 }, + end: { line: 1, column: 6 } + } + }] + }, range: [0, 6], loc: { start: { line: 1, column: 0 }, end: { line: 1, column: 6 } } - }, + }], range: [0, 6], loc: { start: { line: 1, column: 0 }, end: { line: 1, column: 6 } - } - }, - - '0xabc': { - type: 'ExpressionStatement', - expression: { - type: 'Literal', - value: 0xabc, - raw: '0xabc', - range: [0, 5], + }, + comments: [{ + type: 'Block', + value: '', + range: [2, 6], loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 5 } + start: { line: 1, column: 2 }, + end: { line: 1, column: 6 } } - }, - range: [0, 5], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 5 } - } + }] }, - '0xdef': { - type: 'ExpressionStatement', - expression: { - type: 'Literal', - value: 0xdef, - raw: '0xdef', - range: [0, 5], + '// Hello, world!\n\n// Another hello\n42': { + type: 'Program', + body: [{ + type: 'ExpressionStatement', + expression: { + type: 'Literal', + value: 42, + raw: '42', + range: [37, 39], + loc: { + start: { line: 4, column: 0 }, + end: { line: 4, column: 2 } + } + }, + range: [37, 39], loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 5 } - } - }, - range: [0, 5], + start: { line: 4, column: 0 }, + end: { line: 4, column: 2 } + }, + leadingComments: [{ + type: 'Line', + value: ' Hello, world!', + range: [0, 16], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 16 } + } + }, { + type: 'Line', + value: ' Another hello', + range: [18, 36], + loc: { + start: { line: 3, column: 0 }, + end: { line: 3, column: 18 } + } + }] + }], + range: [37, 39], loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 5 } - } - }, - - '0X1A': { - type: 'ExpressionStatement', - expression: { - type: 'Literal', - value: 0x1A, - raw: '0X1A', - range: [0, 4], + start: { line: 4, column: 0 }, + end: { line: 4, column: 2 } + }, + comments: [{ + type: 'Line', + value: ' Hello, world!', + range: [0, 16], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 4 } + end: { line: 1, column: 16 } } - }, - range: [0, 4], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 4 } - } - }, - - '0x10': { - type: 'ExpressionStatement', - expression: { - type: 'Literal', - value: 0x10, - raw: '0x10', - range: [0, 4], + }, { + type: 'Line', + value: ' Another hello', + range: [18, 36], loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 4 } + start: { line: 3, column: 0 }, + end: { line: 3, column: 18 } } - }, - range: [0, 4], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 4 } - } + }] }, - '0x100': { - type: 'ExpressionStatement', - expression: { - type: 'Literal', - value: 0x100, - raw: '0x100', - range: [0, 5], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 5 } - } - }, - range: [0, 5], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 5 } - } - }, - - '0X04': { - type: 'ExpressionStatement', - expression: { - type: 'Literal', - value: 0X04, - raw: '0X04', - range: [0, 4], + 'if (x) { doThat() // Some comment\n }': { + type: 'Program', + body: [{ + type: 'IfStatement', + test: { + type: 'Identifier', + name: 'x', + range: [4, 5], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 5 } + } + }, + consequent: { + type: 'BlockStatement', + body: [{ + type: 'ExpressionStatement', + expression: { + type: 'CallExpression', + callee: { + type: 'Identifier', + name: 'doThat', + range: [9, 15], + loc: { + start: { line: 1, column: 9 }, + end: { line: 1, column: 15 } + } + }, + 'arguments': [], + range: [9, 17], + loc: { + start: { line: 1, column: 9 }, + end: { line: 1, column: 17 } + } + }, + range: [9, 17], + loc: { + start: { line: 1, column: 9 }, + end: { line: 1, column: 17 } + }, + trailingComments: [{ + type: 'Line', + value: ' Some comment', + range: [18, 33], + loc: { + start: { line: 1, column: 18 }, + end: { line: 1, column: 33 } + } + }] + }], + range: [7, 36], + loc: { + start: { line: 1, column: 7 }, + end: { line: 2, column: 2 } + } + }, + alternate: null, + range: [0, 36], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 4 } + end: { line: 2, column: 2 } } - }, - range: [0, 4], + }], + range: [0, 36], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 4 } - } - }, - - '02': { - type: 'ExpressionStatement', - expression: { - type: 'Literal', - value: 2, - raw: '02', - range: [0, 2], + end: { line: 2, column: 2 } + }, + comments: [{ + type: 'Line', + value: ' Some comment', + range: [18, 33], loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 2 } + start: { line: 1, column: 18 }, + end: { line: 1, column: 33 } } - }, - range: [0, 2], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 2 } - } + }] }, - '012': { - type: 'ExpressionStatement', - expression: { - type: 'Literal', - value: 10, - raw: '012', - range: [0, 3], + 'if (x) { // Some comment\ndoThat(); }': { + type: 'Program', + body: [{ + type: 'IfStatement', + test: { + type: 'Identifier', + name: 'x', + range: [4, 5], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 5 } + } + }, + consequent: { + type: 'BlockStatement', + body: [{ + type: 'ExpressionStatement', + expression: { + type: 'CallExpression', + callee: { + type: 'Identifier', + name: 'doThat', + range: [25, 31], + loc: { + start: { line: 2, column: 0 }, + end: { line: 2, column: 6 } + } + }, + 'arguments': [], + range: [25, 33], + loc: { + start: { line: 2, column: 0 }, + end: { line: 2, column: 8 } + } + }, + range: [25, 34], + loc: { + start: { line: 2, column: 0 }, + end: { line: 2, column: 9 } + }, + leadingComments: [{ + type: 'Line', + value: ' Some comment', + range: [9, 24], + loc: { + start: { line: 1, column: 9 }, + end: { line: 1, column: 24 } + } + }] + }], + range: [7, 36], + loc: { + start: { line: 1, column: 7 }, + end: { line: 2, column: 11 } + } + }, + alternate: null, + range: [0, 36], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 3 } + end: { line: 2, column: 11 } } - }, - range: [0, 3], + }], + range: [0, 36], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 3 } - } + end: { line: 2, column: 11 } + }, + comments: [{ + type: 'Line', + value: ' Some comment', + range: [9, 24], + loc: { + start: { line: 1, column: 9 }, + end: { line: 1, column: 24 } + } + }] }, - '0012': { - type: 'ExpressionStatement', - expression: { - type: 'Literal', - value: 10, - raw: '0012', - range: [0, 4], + 'if (x) { /* Some comment */ doThat() }': { + type: 'Program', + body: [{ + type: 'IfStatement', + test: { + type: 'Identifier', + name: 'x', + range: [4, 5], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 5 } + } + }, + consequent: { + type: 'BlockStatement', + body: [{ + type: 'ExpressionStatement', + expression: { + type: 'CallExpression', + callee: { + type: 'Identifier', + name: 'doThat', + range: [28, 34], + loc: { + start: { line: 1, column: 28 }, + end: { line: 1, column: 34 } + } + }, + 'arguments': [], + range: [28, 36], + loc: { + start: { line: 1, column: 28 }, + end: { line: 1, column: 36 } + } + }, + range: [28, 37], + loc: { + start: { line: 1, column: 28 }, + end: { line: 1, column: 37 } + }, + leadingComments: [{ + type: 'Block', + value: ' Some comment ', + range: [9, 27], + loc: { + start: { line: 1, column: 9 }, + end: { line: 1, column: 27 } + } + }] + }], + range: [7, 38], + loc: { + start: { line: 1, column: 7 }, + end: { line: 1, column: 38 } + } + }, + alternate: null, + range: [0, 38], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 4 } + end: { line: 1, column: 38 } } - }, - range: [0, 4], + }], + range: [0, 38], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 4 } - } - } - - }, - - 'String Literals': { - - '"Hello"': { - type: 'ExpressionStatement', - expression: { - type: 'Literal', - value: 'Hello', - raw: '"Hello"', - range: [0, 7], + end: { line: 1, column: 38 } + }, + comments: [{ + type: 'Block', + value: ' Some comment ', + range: [9, 27], loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 7 } + start: { line: 1, column: 9 }, + end: { line: 1, column: 27 } } - }, - range: [0, 7], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 7 } - } + }] }, - '"\\n\\r\\t\\v\\b\\f\\\\\\\'\\"\\0"': { - type: 'ExpressionStatement', - expression: { - type: 'Literal', - value: '\n\r\t\x0B\b\f\\\'"\x00', - raw: '"\\n\\r\\t\\v\\b\\f\\\\\\\'\\"\\0"', - range: [0, 22], + 'if (x) { doThat() /* Some comment */ }': { + type: 'Program', + body: [{ + type: 'IfStatement', + test: { + type: 'Identifier', + name: 'x', + range: [4, 5], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 5 } + } + }, + consequent: { + type: 'BlockStatement', + body: [{ + type: 'ExpressionStatement', + expression: { + type: 'CallExpression', + callee: { + type: 'Identifier', + name: 'doThat', + range: [9, 15], + loc: { + start: { line: 1, column: 9 }, + end: { line: 1, column: 15 } + } + }, + 'arguments': [], + range: [9, 17], + loc: { + start: { line: 1, column: 9 }, + end: { line: 1, column: 17 } + }, + trailingComments: [{ + type: 'Block', + value: ' Some comment ', + range: [18, 36], + loc: { + start: { line: 1, column: 18 }, + end: { line: 1, column: 36 } + } + }] + }, + range: [9, 37], + loc: { + start: { line: 1, column: 9 }, + end: { line: 1, column: 37 } + } + }], + range: [7, 38], + loc: { + start: { line: 1, column: 7 }, + end: { line: 1, column: 38 } + } + }, + alternate: null, + range: [0, 38], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 22 } + end: { line: 1, column: 38 } } - }, - range: [0, 22], + }], + range: [0, 38], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 22 } - } - }, - - '"\\u0061"': { - type: 'ExpressionStatement', - expression: { - type: 'Literal', - value: 'a', - raw: '"\\u0061"', - range: [0, 8], + end: { line: 1, column: 38 } + }, + comments: [{ + type: 'Block', + value: ' Some comment ', + range: [18, 36], loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 8 } + start: { line: 1, column: 18 }, + end: { line: 1, column: 36 } } - }, - range: [0, 8], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 8 } - } + }] }, - '"\\x61"': { - type: 'ExpressionStatement', - expression: { - type: 'Literal', - value: 'a', - raw: '"\\x61"', - range: [0, 6], + 'switch (answer) { case 42: /* perfect */ bingo() }': { + type: 'Program', + body: [{ + type: 'SwitchStatement', + discriminant: { + type: 'Identifier', + name: 'answer', + range: [8, 14], + loc: { + start: { line: 1, column: 8 }, + end: { line: 1, column: 14 } + } + }, + cases: [{ + type: 'SwitchCase', + test: { + type: 'Literal', + value: 42, + raw: '42', + range: [23, 25], + loc: { + start: { line: 1, column: 23 }, + end: { line: 1, column: 25 } + } + }, + consequent: [{ + type: 'ExpressionStatement', + expression: { + type: 'CallExpression', + callee: { + type: 'Identifier', + name: 'bingo', + range: [41, 46], + loc: { + start: { line: 1, column: 41 }, + end: { line: 1, column: 46 } + } + }, + 'arguments': [], + range: [41, 48], + loc: { + start: { line: 1, column: 41 }, + end: { line: 1, column: 48 } + } + }, + range: [41, 49], + loc: { + start: { line: 1, column: 41 }, + end: { line: 1, column: 49 } + }, + leadingComments: [{ + type: 'Block', + value: ' perfect ', + range: [27, 40], + loc: { + start: { line: 1, column: 27 }, + end: { line: 1, column: 40 } + } + }] + }], + range: [18, 49], + loc: { + start: { line: 1, column: 18 }, + end: { line: 1, column: 49 } + } + }], + range: [0, 50], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 6 } + end: { line: 1, column: 50 } } - }, - range: [0, 6], + }], + range: [0, 50], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 6 } - } + end: { line: 1, column: 50 } + }, + comments: [{ + type: 'Block', + value: ' perfect ', + range: [27, 40], + loc: { + start: { line: 1, column: 27 }, + end: { line: 1, column: 40 } + } + }] }, - '"\\u00"': { - type: 'ExpressionStatement', - expression: { - type: 'Literal', - value: 'u00', - raw: '"\\u00"', - range: [0, 6], + 'switch (answer) { case 42: bingo() /* perfect */ }': { + type: 'Program', + body: [{ + type: 'SwitchStatement', + discriminant: { + type: 'Identifier', + name: 'answer', + range: [8, 14], + loc: { + start: { line: 1, column: 8 }, + end: { line: 1, column: 14 } + } + }, + cases: [{ + type: 'SwitchCase', + test: { + type: 'Literal', + value: 42, + raw: '42', + range: [23, 25], + loc: { + start: { line: 1, column: 23 }, + end: { line: 1, column: 25 } + } + }, + consequent: [{ + type: 'ExpressionStatement', + expression: { + type: 'CallExpression', + callee: { + type: 'Identifier', + name: 'bingo', + range: [27, 32], + loc: { + start: { line: 1, column: 27 }, + end: { line: 1, column: 32 } + } + }, + 'arguments': [], + range: [27, 34], + loc: { + start: { line: 1, column: 27 }, + end: { line: 1, column: 34 } + }, + trailingComments: [{ + type: 'Block', + value: ' perfect ', + range: [35, 48], + loc: { + start: { line: 1, column: 35 }, + end: { line: 1, column: 48 } + } + }] + }, + range: [27, 49], + loc: { + start: { line: 1, column: 27 }, + end: { line: 1, column: 49 } + } + }], + range: [18, 49], + loc: { + start: { line: 1, column: 18 }, + end: { line: 1, column: 49 } + } + }], + range: [0, 50], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 6 } + end: { line: 1, column: 50 } } - }, - range: [0, 6], + }], + range: [0, 50], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 6 } - } - }, - - '"\\xt"': { - type: 'ExpressionStatement', - expression: { - type: 'Literal', - value: 'xt', - raw: '"\\xt"', - range: [0, 5], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 5 } - } + end: { line: 1, column: 50 } }, - range: [0, 5], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 5 } - } - }, - - '"Hello\\nworld"': { - type: 'ExpressionStatement', - expression: { - type: 'Literal', - value: 'Hello\nworld', - raw: '"Hello\\nworld"', - range: [0, 14], + comments: [{ + type: 'Block', + value: ' perfect ', + range: [35, 48], loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 14 } + start: { line: 1, column: 35 }, + end: { line: 1, column: 48 } } - }, - range: [0, 14], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 14 } - } + }] }, - '"Hello\\\nworld"': { - type: 'ExpressionStatement', - expression: { - type: 'Literal', - value: 'Helloworld', - raw: '"Hello\\\nworld"', - range: [0, 14], + '/* header */ (function(){ var version = 1; }).call(this)': { + type: 'Program', + body: [{ + type: 'ExpressionStatement', + expression: { + type: 'CallExpression', + callee: { + type: 'MemberExpression', + computed: false, + object: { + type: 'FunctionExpression', + id: null, + params: [], + defaults: [], + body: { + type: 'BlockStatement', + body: [{ + type: 'VariableDeclaration', + declarations: [{ + type: 'VariableDeclarator', + id: { + type: 'Identifier', + name: 'version', + range: [30, 37], + loc: { + start: { line: 1, column: 30 }, + end: { line: 1, column: 37 } + } + }, + init: { + type: 'Literal', + value: 1, + raw: '1', + range: [40, 41], + loc: { + start: { line: 1, column: 40 }, + end: { line: 1, column: 41 } + } + }, + range: [30, 41], + loc: { + start: { line: 1, column: 30 }, + end: { line: 1, column: 41 } + } + }], + kind: 'var', + range: [26, 42], + loc: { + start: { line: 1, column: 26 }, + end: { line: 1, column: 42 } + } + }], + range: [24, 44], + loc: { + start: { line: 1, column: 24 }, + end: { line: 1, column: 44 } + } + }, + rest: null, + generator: false, + expression: false, + range: [14, 44], + loc: { + start: { line: 1, column: 14 }, + end: { line: 1, column: 44 } + } + }, + property: { + type: 'Identifier', + name: 'call', + range: [46, 50], + loc: { + start: { line: 1, column: 46 }, + end: { line: 1, column: 50 } + } + }, + range: [13, 50], + loc: { + start: { line: 1, column: 13 }, + end: { line: 1, column: 50 } + } + }, + 'arguments': [{ + type: 'ThisExpression', + range: [51, 55], + loc: { + start: { line: 1, column: 51 }, + end: { line: 1, column: 55 } + } + }], + range: [13, 56], + loc: { + start: { line: 1, column: 13 }, + end: { line: 1, column: 56 } + } + }, + range: [13, 56], loc: { - start: { line: 1, column: 0 }, - end: { line: 2, column: 14 } - } - }, - range: [0, 14], + start: { line: 1, column: 13 }, + end: { line: 1, column: 56 } + }, + leadingComments: [{ + type: 'Block', + value: ' header ', + range: [0, 12], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 12 } + } + }] + }], + range: [13, 56], loc: { - start: { line: 1, column: 0 }, - end: { line: 2, column: 14 } - } - }, - - '"Hello\\02World"': { - type: 'ExpressionStatement', - expression: { - type: 'Literal', - value: 'Hello\u0002World', - raw: '"Hello\\02World"', - range: [0, 15], + start: { line: 1, column: 13 }, + end: { line: 1, column: 56 } + }, + comments: [{ + type: 'Block', + value: ' header ', + range: [0, 12], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 15 } + end: { line: 1, column: 12 } } - }, - range: [0, 15], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 15 } - } + }] }, - '"Hello\\012World"': { - type: 'ExpressionStatement', - expression: { - type: 'Literal', - value: 'Hello\u000AWorld', - raw: '"Hello\\012World"', - range: [0, 16], + '(function(){ var version = 1; /* sync */ }).call(this)': { + type: 'Program', + body: [{ + type: 'ExpressionStatement', + expression: { + type: 'CallExpression', + callee: { + type: 'MemberExpression', + computed: false, + object: { + type: 'FunctionExpression', + id: null, + params: [], + defaults: [], + body: { + type: 'BlockStatement', + body: [{ + type: 'VariableDeclaration', + declarations: [{ + type: 'VariableDeclarator', + id: { + type: 'Identifier', + name: 'version', + range: [17, 24], + loc: { + start: { line: 1, column: 17 }, + end: { line: 1, column: 24 } + } + }, + init: { + type: 'Literal', + value: 1, + raw: '1', + range: [27, 28], + loc: { + start: { line: 1, column: 27 }, + end: { line: 1, column: 28 } + } + }, + range: [17, 28], + loc: { + start: { line: 1, column: 17 }, + end: { line: 1, column: 28 } + } + }], + kind: 'var', + range: [13, 29], + loc: { + start: { line: 1, column: 13 }, + end: { line: 1, column: 29 } + }, + trailingComments: [{ + type: 'Block', + value: ' sync ', + range: [30, 40], + loc: { + start: { line: 1, column: 30 }, + end: { line: 1, column: 40 } + } + }] + }], + range: [11, 42], + loc: { + start: { line: 1, column: 11 }, + end: { line: 1, column: 42 } + } + }, + rest: null, + generator: false, + expression: false, + range: [1, 42], + loc: { + start: { line: 1, column: 1 }, + end: { line: 1, column: 42 } + } + }, + property: { + type: 'Identifier', + name: 'call', + range: [44, 48], + loc: { + start: { line: 1, column: 44 }, + end: { line: 1, column: 48 } + }, + leadingComments: [{ + type: 'Block', + value: ' sync ', + range: [30, 40], + loc: { + start: { line: 1, column: 30 }, + end: { line: 1, column: 40 } + } + }] + }, + range: [0, 48], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 48 } + } + }, + 'arguments': [{ + type: 'ThisExpression', + range: [49, 53], + loc: { + start: { line: 1, column: 49 }, + end: { line: 1, column: 53 } + } + }], + range: [0, 54], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 54 } + } + }, + range: [0, 54], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 16 } + end: { line: 1, column: 54 } } - }, - range: [0, 16], + }], + range: [0, 54], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 16 } - } - }, - - '"Hello\\122World"': { - type: 'ExpressionStatement', - expression: { - type: 'Literal', - value: 'Hello\122World', - raw: '"Hello\\122World"', - range: [0, 16], + end: { line: 1, column: 54 } + }, + comments: [{ + type: 'Block', + value: ' sync ', + range: [30, 40], loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 16 } + start: { line: 1, column: 30 }, + end: { line: 1, column: 40 } } - }, - range: [0, 16], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 16 } - } + }] }, - '"Hello\\0122World"': { - type: 'ExpressionStatement', - expression: { - type: 'Literal', - value: 'Hello\u000A2World', - raw: '"Hello\\0122World"', - range: [0, 17], + 'function f() { /* infinite */ while (true) { } /* bar */ var each; }': { + type: 'Program', + body: [{ + type: 'FunctionDeclaration', + id: { + type: 'Identifier', + name: 'f', + range: [9, 10], + loc: { + start: { line: 1, column: 9 }, + end: { line: 1, column: 10 } + } + }, + params: [], + defaults: [], + body: { + type: 'BlockStatement', + body: [{ + type: 'WhileStatement', + test: { + type: 'Literal', + value: true, + raw: 'true', + range: [37, 41], + loc: { + start: { line: 1, column: 37 }, + end: { line: 1, column: 41 } + } + }, + body: { + type: 'BlockStatement', + body: [], + range: [43, 46], + loc: { + start: { line: 1, column: 43 }, + end: { line: 1, column: 46 } + } + }, + range: [30, 46], + loc: { + start: { line: 1, column: 30 }, + end: { line: 1, column: 46 } + }, + leadingComments: [{ + type: 'Block', + value: ' infinite ', + range: [15, 29], + loc: { + start: { line: 1, column: 15 }, + end: { line: 1, column: 29 } + } + }], + trailingComments: [{ + type: 'Block', + value: ' bar ', + range: [47, 56], + loc: { + start: { line: 1, column: 47 }, + end: { line: 1, column: 56 } + } + }] + }, { + type: 'VariableDeclaration', + declarations: [{ + type: 'VariableDeclarator', + id: { + type: 'Identifier', + name: 'each', + range: [61, 65], + loc: { + start: { line: 1, column: 61 }, + end: { line: 1, column: 65 } + } + }, + init: null, + range: [61, 65], + loc: { + start: { line: 1, column: 61 }, + end: { line: 1, column: 65 } + } + }], + kind: 'var', + range: [57, 66], + loc: { + start: { line: 1, column: 57 }, + end: { line: 1, column: 66 } + }, + leadingComments: [{ + type: 'Block', + value: ' bar ', + range: [47, 56], + loc: { + start: { line: 1, column: 47 }, + end: { line: 1, column: 56 } + } + }] + }], + range: [13, 68], + loc: { + start: { line: 1, column: 13 }, + end: { line: 1, column: 68 } + } + }, + rest: null, + generator: false, + expression: false, + range: [0, 68], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 17 } + end: { line: 1, column: 68 } } - }, - range: [0, 17], + }], + range: [0, 68], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 17 } - } - }, - - '"Hello\\312World"': { - type: 'ExpressionStatement', - expression: { - type: 'Literal', - value: 'Hello\u00CAWorld', - raw: '"Hello\\312World"', - range: [0, 16], + end: { line: 1, column: 68 } + }, + comments: [{ + type: 'Block', + value: ' infinite ', + range: [15, 29], loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 16 } + start: { line: 1, column: 15 }, + end: { line: 1, column: 29 } } - }, - range: [0, 16], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 16 } - } - }, - - '"Hello\\412World"': { - type: 'ExpressionStatement', - expression: { - type: 'Literal', - value: 'Hello\412World', - raw: '"Hello\\412World"', - range: [0, 16], + }, { + type: 'Block', + value: ' bar ', + range: [47, 56], loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 16 } + start: { line: 1, column: 47 }, + end: { line: 1, column: 56 } } - }, - range: [0, 16], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 16 } - } + }] }, - '"Hello\\812World"': { - type: 'ExpressionStatement', - expression: { - type: 'Literal', - value: 'Hello812World', - raw: '"Hello\\812World"', - range: [0, 16], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 16 } - } - }, - range: [0, 16], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 16 } - } + ' comment': { + type: 'Program', + body: [], + range: [11, 11], + loc: { + start: { line: 1, column: 11 }, + end: { line: 1, column: 11 } + }, + comments: [{ + type: 'Line', + value: ' comment', + range: [0, 11], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 14 } + end: { line: 1, column: 11 } } - }, - range: [0, 14], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 14 } - } + }] }, - '"Hello\\\r\nworld"': { - type: 'ExpressionStatement', - expression: { - type: 'Literal', - value: 'Helloworld', - raw: '"Hello\\\r\nworld"', - range: [0, 15], + ' comment': { + type: 'Program', + body: [], + range: [14, 14], + loc: { + start: { line: 1, column: 14 }, + end: { line: 1, column: 14 } + }, + comments: [{ + type: 'Line', + value: ' comment', + range: [3, 14], loc: { - start: { line: 1, column: 0 }, + start: { line: 1, column: 3 }, end: { line: 1, column: 14 } } - }, - range: [0, 14], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 14 } - } - } - }, - - 'Regular Expression Literals': { + }] + }, - 'var x = /[a-z]/i': { + ' \t /* block comment */ --> comment': { type: 'Program', - body: [{ - type: 'VariableDeclaration', - declarations: [{ - type: 'VariableDeclarator', - id: { - type: 'Identifier', - name: 'x', - range: [4, 5], - loc: { - start: { line: 1, column: 4 }, - end: { line: 1, column: 5 } - } - }, - init: { - type: 'Literal', - value: '/[a-z]/i', - raw: '/[a-z]/i', - range: [8, 16], - loc: { - start: { line: 1, column: 8 }, - end: { line: 1, column: 16 } - } - }, - range: [4, 16], - loc: { - start: { line: 1, column: 4 }, - end: { line: 1, column: 16 } - } - }], - kind: 'var', - range: [0, 16], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 16 } - } - }], - range: [0, 16], + body: [], + range: [35, 35], loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 16 } + start: { line: 1, column: 35 }, + end: { line: 1, column: 35 } }, - tokens: [{ - type: 'Keyword', - value: 'var', - range: [0, 3], + comments: [{ + type: 'Block', + value: ' block comment ', + range: [3, 22], loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 3 } + start: { line: 1, column: 3 }, + end: { line: 1, column: 22 } } }, { - type: 'Identifier', - value: 'x', - range: [4, 5], + type: 'Line', + value: ' comment', + range: [24, 35], loc: { - start: { line: 1, column: 4 }, - end: { line: 1, column: 5 } + start: { line: 1, column: 24 }, + end: { line: 1, column: 35 } } - }, { - type: 'Punctuator', - value: '=', - range: [6, 7], + }] + }, + + '/* block comment */--> comment': { + type: 'Program', + body: [], + range: [30, 30], + loc: { + start: { line: 1, column: 30 }, + end: { line: 1, column: 30 } + }, + comments: [{ + type: 'Block', + value: ' block comment ', + range: [0, 19], loc: { - start: { line: 1, column: 6 }, - end: { line: 1, column: 7 } + start: { line: 1, column: 0 }, + end: { line: 1, column: 19 } } }, { - type: 'RegularExpression', - value: '/[a-z]/i', - range: [8, 16], + type: 'Line', + value: ' comment', + range: [19, 30], loc: { - start: { line: 1, column: 8 }, - end: { line: 1, column: 16 } + start: { line: 1, column: 19 }, + end: { line: 1, column: 30 } } }] }, - 'var x = /[x-z]/i': { + '/* not comment*/; i-->0': { type: 'Program', body: [{ - type: 'VariableDeclaration', - declarations: [{ - type: 'VariableDeclarator', - id: { - type: 'Identifier', - name: 'x', - range: [4, 5] - }, - init: { - type: 'Literal', - value: '/[x-z]/i', - raw: '/[x-z]/i', - range: [8, 16] - }, - range: [4, 16] - }], - kind: 'var', - range: [0, 16] - }], - range: [0, 16], - tokens: [{ - type: 'Keyword', - value: 'var', - range: [0, 3] - }, { - type: 'Identifier', - value: 'x', - range: [4, 5] - }, { - type: 'Punctuator', - value: '=', - range: [6, 7] + type: 'EmptyStatement', + range: [16, 17], + loc: { + start: { line: 1, column: 16 }, + end: { line: 1, column: 17 } + } }, { - type: 'RegularExpression', - value: '/[x-z]/i', - range: [8, 16] - }] - }, - - 'var x = /[a-c]/i': { - type: 'Program', - body: [{ - type: 'VariableDeclaration', - declarations: [{ - type: 'VariableDeclarator', - id: { - type: 'Identifier', - name: 'x', + type: 'ExpressionStatement', + expression: { + type: 'BinaryExpression', + operator: '>', + left: { + type: 'UpdateExpression', + operator: '--', + argument: { + type: 'Identifier', + name: 'i', + range: [18, 19], + loc: { + start: { line: 1, column: 18 }, + end: { line: 1, column: 19 } + } + }, + prefix: false, + range: [18, 21], loc: { - start: { line: 1, column: 4 }, - end: { line: 1, column: 5 } + start: { line: 1, column: 18 }, + end: { line: 1, column: 21 } } }, - init: { + right: { type: 'Literal', - value: '/[a-c]/i', - raw: '/[a-c]/i', + value: 0, + raw: '0', + range: [22, 23], loc: { - start: { line: 1, column: 8 }, - end: { line: 1, column: 16 } + start: { line: 1, column: 22 }, + end: { line: 1, column: 23 } } }, + range: [18, 23], loc: { - start: { line: 1, column: 4 }, - end: { line: 1, column: 16 } + start: { line: 1, column: 18 }, + end: { line: 1, column: 23 } } - }], - kind: 'var', + }, + range: [18, 23], loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 16 } + start: { line: 1, column: 18 }, + end: { line: 1, column: 23 } } }], + range: [16, 23], loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 16 } + start: { line: 1, column: 16 }, + end: { line: 1, column: 23 } }, tokens: [{ - type: 'Keyword', - value: 'var', + type: 'Punctuator', + value: ';', + range: [16, 17], loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 3 } + start: { line: 1, column: 16 }, + end: { line: 1, column: 17 } } }, { type: 'Identifier', - value: 'x', + value: 'i', + range: [18, 19], loc: { - start: { line: 1, column: 4 }, - end: { line: 1, column: 5 } + start: { line: 1, column: 18 }, + end: { line: 1, column: 19 } } }, { type: 'Punctuator', - value: '=', + value: '--', + range: [19, 21], loc: { - start: { line: 1, column: 6 }, - end: { line: 1, column: 7 } + start: { line: 1, column: 19 }, + end: { line: 1, column: 21 } } }, { - type: 'RegularExpression', - value: '/[a-c]/i', + type: 'Punctuator', + value: '>', + range: [21, 22], loc: { - start: { line: 1, column: 8 }, - end: { line: 1, column: 16 } + start: { line: 1, column: 21 }, + end: { line: 1, column: 22 } + } + }, { + type: 'Numeric', + value: '0', + range: [22, 23], + loc: { + start: { line: 1, column: 22 }, + end: { line: 1, column: 23 } } }] + }, - 'var x = /[P QR]/i': { - type: 'Program', - body: [{ - type: 'VariableDeclaration', - declarations: [{ - type: 'VariableDeclarator', - id: { + 'while (i-->0) {}': { + type: 'WhileStatement', + test: { + type: 'BinaryExpression', + operator: '>', + left: { + type: 'UpdateExpression', + operator: '--', + argument: { type: 'Identifier', - name: 'x', - range: [4, 5], - loc: { - start: { line: 1, column: 4 }, - end: { line: 1, column: 5 } - } - }, - init: { - type: 'Literal', - value: '/[P QR]/i', - raw: '/[P QR]/i', - range: [8, 17], + name: 'i', + range: [7, 8], loc: { - start: { line: 1, column: 8 }, - end: { line: 1, column: 17 } + start: { line: 1, column: 7 }, + end: { line: 1, column: 8 } } }, - range: [4, 17], + prefix: false, + range: [7, 10], loc: { - start: { line: 1, column: 4 }, - end: { line: 1, column: 17 } + start: { line: 1, column: 7 }, + end: { line: 1, column: 10 } } - }], - kind: 'var', - range: [0, 17], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 17 } - } - }], - range: [0, 17], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 17 } - }, - tokens: [{ - type: 'Keyword', - value: 'var', - range: [0, 3], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 3 } - } - }, { - type: 'Identifier', - value: 'x', - range: [4, 5], - loc: { - start: { line: 1, column: 4 }, - end: { line: 1, column: 5 } - } - }, { - type: 'Punctuator', - value: '=', - range: [6, 7], + }, + right: { + type: 'Literal', + value: 0, + raw: '0', + range: [11, 12], + loc: { + start: { line: 1, column: 11 }, + end: { line: 1, column: 12 } + } + }, + range: [7, 12], loc: { - start: { line: 1, column: 6 }, - end: { line: 1, column: 7 } + start: { line: 1, column: 7 }, + end: { line: 1, column: 12 } } - }, { - type: 'RegularExpression', - value: '/[P QR]/i', - range: [8, 17], + }, + body: { + type: 'BlockStatement', + body: [], + range: [14, 16], loc: { - start: { line: 1, column: 8 }, - end: { line: 1, column: 17 } + start: { line: 1, column: 14 }, + end: { line: 1, column: 16 } } - }] + }, + range: [0, 16], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 16 } + } }, - 'var x = /[\\]/]/': { + '/*Venus*/ debugger; // Mars': { type: 'Program', body: [{ - type: 'VariableDeclaration', - declarations: [{ - type: 'VariableDeclarator', - id: { - type: 'Identifier', - name: 'x', - range: [4, 5], - loc: { - start: { line: 1, column: 4 }, - end: { line: 1, column: 5 } - } - }, - init: { - type: 'Literal', - value: new RegExp('[\\]/]').toString(), - raw: '/[\\]/]/', - range: [8, 15], - loc: { - start: { line: 1, column: 8 }, - end: { line: 1, column: 15 } - } - }, - range: [4, 15], + type: 'DebuggerStatement', + leadingComments: [{ + type: 'Block', + value: 'Venus', + range: [0, 9], loc: { - start: { line: 1, column: 4 }, - end: { line: 1, column: 15 } + start: { line: 1, column: 0 }, + end: { line: 1, column: 9 } } }], - kind: 'var', - range: [0, 15], + trailingComments: [{ + type: 'Line', + value: ' Mars', + range: [20, 27], + loc: { + start: { line: 1, column: 20 }, + end: { line: 1, column: 27 } + } + }], + range: [10, 19], loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 15 } + start: { line: 1, column: 10 }, + end: { line: 1, column: 19 } } }], - range: [0, 15], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 15 } - }, - tokens: [{ - type: 'Keyword', - value: 'var', - range: [0, 3], + comments: [{ + type: 'Block', + value: 'Venus', + range: [0, 9], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 3 } - } - }, { - type: 'Identifier', - value: 'x', - range: [4, 5], - loc: { - start: { line: 1, column: 4 }, - end: { line: 1, column: 5 } - } - }, { - type: 'Punctuator', - value: '=', - range: [6, 7], - loc: { - start: { line: 1, column: 6 }, - end: { line: 1, column: 7 } + end: { line: 1, column: 9 } } }, { - type: 'RegularExpression', - value: '/[\\]/]/', - range: [8, 15], + type: 'Line', + value: ' Mars', + range: [20, 27], loc: { - start: { line: 1, column: 8 }, - end: { line: 1, column: 15 } + start: { line: 1, column: 20 }, + end: { line: 1, column: 27 } } - }] + }], + range: [10, 19], + loc: { + start: { line: 1, column: 10 }, + end: { line: 1, column: 19 } + } }, - 'var x = /foo\\/bar/': { - type: 'Program', - body: [{ - type: 'VariableDeclaration', - declarations: [{ - type: 'VariableDeclarator', - id: { - type: 'Identifier', - name: 'x', - range: [4, 5], - loc: { - start: { line: 1, column: 4 }, - end: { line: 1, column: 5 } - } - }, - init: { - type: 'Literal', - value: '/foo\\/bar/', - raw: '/foo\\/bar/', - range: [8, 18], - loc: { - start: { line: 1, column: 8 }, - end: { line: 1, column: 18 } - } - }, - range: [4, 18], + 'function x(){ /*Jupiter*/ return; /*Saturn*/}': { + type: 'FunctionDeclaration', + id: { + type: 'Identifier', + name: 'x', + range: [9, 10], + loc: { + start: { line: 1, column: 9 }, + end: { line: 1, column: 10 } + } + }, + params: [], + defaults: [], + body: { + type: 'BlockStatement', + body: [{ + type: 'ReturnStatement', + argument: null, + range: [26, 33], loc: { - start: { line: 1, column: 4 }, - end: { line: 1, column: 18 } + start: { line: 1, column: 26 }, + end: { line: 1, column: 33 } } }], - kind: 'var', - range: [0, 18], + range: [12, 45], loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 18 } + start: { line: 1, column: 12 }, + end: { line: 1, column: 45 } } - }], - range: [0, 18], + }, + rest: null, + generator: false, + expression: false, + range: [0, 45], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 18 } - }, - tokens: [{ - type: 'Keyword', - value: 'var', - range: [0, 3], + end: { line: 1, column: 45 } + } + } + + }, + + 'Numeric Literals': { + + '0': { + type: 'ExpressionStatement', + expression: { + type: 'Literal', + value: 0, + raw: '0', + range: [0, 1], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 3 } - } - }, { - type: 'Identifier', - value: 'x', - range: [4, 5], - loc: { - start: { line: 1, column: 4 }, - end: { line: 1, column: 5 } - } - }, { - type: 'Punctuator', - value: '=', - range: [6, 7], - loc: { - start: { line: 1, column: 6 }, - end: { line: 1, column: 7 } - } - }, { - type: 'RegularExpression', - value: '/foo\\/bar/', - range: [8, 18], - loc: { - start: { line: 1, column: 8 }, - end: { line: 1, column: 18 } + end: { line: 1, column: 1 } } - }] + }, + range: [0, 1], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 1 } + } }, - 'var x = /=([^=\\s])+/g': { - type: 'Program', - body: [{ - type: 'VariableDeclaration', - declarations: [{ - type: 'VariableDeclarator', - id: { - type: 'Identifier', - name: 'x', - range: [4, 5], - loc: { - start: { line: 1, column: 4 }, - end: { line: 1, column: 5 } - } - }, - init: { - type: 'Literal', - value: '/=([^=\\s])+/g', - raw: '/=([^=\\s])+/g', - range: [8, 21], - loc: { - start: { line: 1, column: 8 }, - end: { line: 1, column: 21 } - } - }, - range: [4, 21], - loc: { - start: { line: 1, column: 4 }, - end: { line: 1, column: 21 } - } - }], - kind: 'var', - range: [0, 21], + '42': { + type: 'ExpressionStatement', + expression: { + type: 'Literal', + value: 42, + raw: '42', + range: [0, 2], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 21 } + end: { line: 1, column: 2 } } - }], - range: [0, 21], + }, + range: [0, 2], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 21 } - }, - tokens: [{ - type: 'Keyword', - value: 'var', - range: [0, 3], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 3 } - } - }, { - type: 'Identifier', - value: 'x', - range: [4, 5], - loc: { - start: { line: 1, column: 4 }, - end: { line: 1, column: 5 } - } - }, { - type: 'Punctuator', - value: '=', - range: [6, 7], - loc: { - start: { line: 1, column: 6 }, - end: { line: 1, column: 7 } - } - }, { - type: 'RegularExpression', - value: '/=([^=\\s])+/g', - range: [8, 21], - loc: { - start: { line: 1, column: 8 }, - end: { line: 1, column: 21 } - } - }] + end: { line: 1, column: 2 } + } }, - 'var x = /[P QR]/\\u0067': { + '3': { type: 'Program', body: [{ - type: 'VariableDeclaration', - declarations: [{ - type: 'VariableDeclarator', - id: { - type: 'Identifier', - name: 'x', - range: [4, 5], - loc: { - start: { line: 1, column: 4 }, - end: { line: 1, column: 5 } - } - }, - init: { - type: 'Literal', - value: '/[P QR]/g', - raw: '/[P QR]/\\u0067', - range: [8, 22], - loc: { - start: { line: 1, column: 8 }, - end: { line: 1, column: 22 } - } - }, - range: [4, 22], - loc: { - start: { line: 1, column: 4 }, - end: { line: 1, column: 22 } - } - }], - kind: 'var', - range: [0, 22], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 22 } - } + type: 'ExpressionStatement', + expression: { + type: 'Literal', + value: 3, + raw: '3', + range: [0, 1] + }, + range: [0, 1] }], - range: [0, 22], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 22 } - }, + range: [0, 1], tokens: [{ - type: 'Keyword', - value: 'var', - range: [0, 3], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 3 } - } - }, { - type: 'Identifier', - value: 'x', - range: [4, 5], - loc: { - start: { line: 1, column: 4 }, - end: { line: 1, column: 5 } - } - }, { - type: 'Punctuator', - value: '=', - range: [6, 7], - loc: { - start: { line: 1, column: 6 }, - end: { line: 1, column: 7 } - } - }, { - type: 'RegularExpression', - value: '/[P QR]/\\u0067', - range: [8, 22], - loc: { - start: { line: 1, column: 8 }, - end: { line: 1, column: 22 } - } + type: 'Numeric', + value: '3', + range: [0, 1] }] }, - 'var x = /[P QR]/\\g': { + '5': { type: 'Program', body: [{ - type: 'VariableDeclaration', - declarations: [{ - type: 'VariableDeclarator', - id: { - type: 'Identifier', - name: 'x', - range: [4, 5], - loc: { - start: { line: 1, column: 4 }, - end: { line: 1, column: 5 } - } - }, - init: { - type: 'Literal', - value: '/[P QR]/g', - raw: '/[P QR]/\\g', - range: [8, 18], - loc: { - start: { line: 1, column: 8 }, - end: { line: 1, column: 18 } - } - }, - range: [4, 18], + type: 'ExpressionStatement', + expression: { + type: 'Literal', + value: 5, + raw: '5', loc: { - start: { line: 1, column: 4 }, - end: { line: 1, column: 18 } + start: { line: 1, column: 0 }, + end: { line: 1, column: 1 } } - }], - kind: 'var', - range: [0, 18], + }, loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 18 } + end: { line: 1, column: 1 } } }], - range: [0, 18], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 18 } + end: { line: 1, column: 1 } }, tokens: [{ - type: 'Keyword', - value: 'var', - range: [0, 3], + type: 'Numeric', + value: '5', loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 3 } - } - }, { - type: 'Identifier', - value: 'x', - range: [4, 5], - loc: { - start: { line: 1, column: 4 }, - end: { line: 1, column: 5 } - } - }, { - type: 'Punctuator', - value: '=', - range: [6, 7], - loc: { - start: { line: 1, column: 6 }, - end: { line: 1, column: 7 } - } - }, { - type: 'RegularExpression', - value: '/[P QR]/\\g', - range: [8, 18], - loc: { - start: { line: 1, column: 8 }, - end: { line: 1, column: 18 } + end: { line: 1, column: 1 } } }] - } - - }, - - 'Left-Hand-Side Expression': { + }, - 'new Button': { + '.14': { type: 'ExpressionStatement', expression: { - type: 'NewExpression', - callee: { - type: 'Identifier', - name: 'Button', - range: [4, 10], - loc: { - start: { line: 1, column: 4 }, - end: { line: 1, column: 10 } - } - }, - 'arguments': [], - range: [0, 10], + type: 'Literal', + value: 0.14, + raw: '.14', + range: [0, 3], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 10 } + end: { line: 1, column: 3 } } }, - range: [0, 10], + range: [0, 3], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 10 } + end: { line: 1, column: 3 } } }, - 'new Button()': { + '3.14159': { type: 'ExpressionStatement', expression: { - type: 'NewExpression', - callee: { - type: 'Identifier', - name: 'Button', - range: [4, 10], - loc: { - start: { line: 1, column: 4 }, - end: { line: 1, column: 10 } - } - }, - 'arguments': [], - range: [0, 12], + type: 'Literal', + value: 3.14159, + raw: '3.14159', + range: [0, 7], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 12 } + end: { line: 1, column: 7 } } }, - range: [0, 12], + range: [0, 7], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 12 } + end: { line: 1, column: 7 } } }, - 'new new foo': { + '6.02214179e+23': { type: 'ExpressionStatement', expression: { - type: 'NewExpression', - callee: { - type: 'NewExpression', - callee: { - type: 'Identifier', - name: 'foo', - range: [8, 11], - loc: { - start: { line: 1, column: 8 }, - end: { line: 1, column: 11 } - } - }, - 'arguments': [], - range: [4, 11], - loc: { - start: { line: 1, column: 4 }, - end: { line: 1, column: 11 } - } - }, - 'arguments': [], - range: [0, 11], + type: 'Literal', + value: 6.02214179e+23, + raw: '6.02214179e+23', + range: [0, 14], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 11 } + end: { line: 1, column: 14 } } }, - range: [0, 11], + range: [0, 14], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 11 } + end: { line: 1, column: 14 } } }, - 'new new foo()': { + '1.492417830e-10': { type: 'ExpressionStatement', expression: { - type: 'NewExpression', - callee: { - type: 'NewExpression', - callee: { - type: 'Identifier', - name: 'foo', - range: [8, 11], - loc: { - start: { line: 1, column: 8 }, - end: { line: 1, column: 11 } - } - }, - 'arguments': [], - range: [4, 13], - loc: { - start: { line: 1, column: 4 }, - end: { line: 1, column: 13 } - } - }, - 'arguments': [], - range: [0, 13], + type: 'Literal', + value: 1.49241783e-10, + raw: '1.492417830e-10', + range: [0, 15], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 13 } + end: { line: 1, column: 15 } } }, - range: [0, 13], + range: [0, 15], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 13 } + end: { line: 1, column: 15 } } }, - 'new foo().bar()': { + '0x0': { type: 'ExpressionStatement', expression: { - type: 'CallExpression', - callee: { - type: 'MemberExpression', - computed: false, - object: { - type: 'NewExpression', - callee: { - type: 'Identifier', - name: 'foo', - range: [4, 7], - loc: { - start: { line: 1, column: 4 }, - end: { line: 1, column: 7 } - } - }, - 'arguments': [], - range: [0, 9], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 9 } - } - }, - property: { - type: 'Identifier', - name: 'bar', - range: [10, 13], - loc: { - start: { line: 1, column: 10 }, - end: { line: 1, column: 13 } - } - }, - range: [0, 13], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 13 } - } - }, - 'arguments': [], - range: [0, 15], + type: 'Literal', + value: 0, + raw: '0x0', + range: [0, 3], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 15 } + end: { line: 1, column: 3 } } }, - range: [0, 15], + range: [0, 3], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 15 } + end: { line: 1, column: 3 } } }, - 'new foo[bar]': { + '0x0;': { type: 'ExpressionStatement', expression: { - type: 'NewExpression', - callee: { - type: 'MemberExpression', - computed: true, - object: { - type: 'Identifier', - name: 'foo', - range: [4, 7], - loc: { - start: { line: 1, column: 4 }, - end: { line: 1, column: 7 } - } - }, - property: { - type: 'Identifier', - name: 'bar', - range: [8, 11], - loc: { - start: { line: 1, column: 8 }, - end: { line: 1, column: 11 } - } - }, - range: [4, 12], - loc: { - start: { line: 1, column: 4 }, - end: { line: 1, column: 12 } - } - }, - 'arguments': [], - range: [0, 12], + type: 'Literal', + value: 0, + raw: '0x0', + range: [0, 3], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 12 } + end: { line: 1, column: 3 } } }, - range: [0, 12], + range: [0, 4], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 12 } + end: { line: 1, column: 4 } } }, - 'new foo.bar()': { + '0e+100 ': { type: 'ExpressionStatement', expression: { - type: 'NewExpression', - callee: { - type: 'MemberExpression', - computed: false, - object: { - type: 'Identifier', - name: 'foo', - range: [4, 7], - loc: { - start: { line: 1, column: 4 }, - end: { line: 1, column: 7 } - } - }, - property: { - type: 'Identifier', - name: 'bar', - range: [8, 11], - loc: { - start: { line: 1, column: 8 }, - end: { line: 1, column: 11 } - } - }, - range: [4, 11], - loc: { - start: { line: 1, column: 4 }, - end: { line: 1, column: 11 } - } - }, - 'arguments': [], - range: [0, 13], + type: 'Literal', + value: 0, + raw: '0e+100', + range: [0, 6], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 13 } + end: { line: 1, column: 6 } } }, - range: [0, 13], + range: [0, 7], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 13 } + end: { line: 1, column: 7 } } }, - '( new foo).bar()': { + '0e+100': { type: 'ExpressionStatement', expression: { - type: 'CallExpression', - callee: { - type: 'MemberExpression', - computed: false, - object: { - type: 'NewExpression', - callee: { - type: 'Identifier', - name: 'foo', - range: [6, 9], - loc: { - start: { line: 1, column: 6 }, - end: { line: 1, column: 9 } - } - }, - 'arguments': [], - range: [2, 9], - loc: { - start: { line: 1, column: 2 }, - end: { line: 1, column: 9 } - } - }, - property: { - type: 'Identifier', - name: 'bar', - range: [11, 14], - loc: { - start: { line: 1, column: 11 }, - end: { line: 1, column: 14 } - } - }, - range: [0, 14], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 14 } - } - }, - 'arguments': [], - range: [0, 16], + type: 'Literal', + value: 0, + raw: '0e+100', + range: [0, 6], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 16 } + end: { line: 1, column: 6 } } }, - range: [0, 16], + range: [0, 6], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 16 } + end: { line: 1, column: 6 } } }, - 'foo(bar, baz)': { + '0xabc': { type: 'ExpressionStatement', expression: { - type: 'CallExpression', - callee: { - type: 'Identifier', - name: 'foo', - range: [0, 3], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 3 } - } - }, - 'arguments': [{ - type: 'Identifier', - name: 'bar', - range: [4, 7], - loc: { - start: { line: 1, column: 4 }, - end: { line: 1, column: 7 } - } - }, { - type: 'Identifier', - name: 'baz', - range: [9, 12], - loc: { - start: { line: 1, column: 9 }, - end: { line: 1, column: 12 } - } - }], - range: [0, 13], + type: 'Literal', + value: 0xabc, + raw: '0xabc', + range: [0, 5], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 13 } + end: { line: 1, column: 5 } } }, - range: [0, 13], + range: [0, 5], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 13 } + end: { line: 1, column: 5 } } }, - '( foo )()': { + '0xdef': { type: 'ExpressionStatement', expression: { - type: 'CallExpression', - callee: { - type: 'Identifier', - name: 'foo', - range: [5, 8], - loc: { - start: { line: 1, column: 5 }, - end: { line: 1, column: 8 } - } - }, - 'arguments': [], - range: [0, 13], + type: 'Literal', + value: 0xdef, + raw: '0xdef', + range: [0, 5], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 13 } + end: { line: 1, column: 5 } } }, - range: [0, 13], + range: [0, 5], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 13 } + end: { line: 1, column: 5 } } }, - 'universe.milkyway': { + '0X1A': { type: 'ExpressionStatement', expression: { - type: 'MemberExpression', - computed: false, - object: { - type: 'Identifier', - name: 'universe', - range: [0, 8], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 8 } - } - }, - property: { - type: 'Identifier', - name: 'milkyway', - range: [9, 17], - loc: { - start: { line: 1, column: 9 }, - end: { line: 1, column: 17 } - } - }, - range: [0, 17], + type: 'Literal', + value: 0x1A, + raw: '0X1A', + range: [0, 4], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 17 } + end: { line: 1, column: 4 } } }, - range: [0, 17], + range: [0, 4], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 17 } + end: { line: 1, column: 4 } } }, - 'universe.milkyway.solarsystem': { + '0x10': { type: 'ExpressionStatement', expression: { - type: 'MemberExpression', - computed: false, - object: { - type: 'MemberExpression', - computed: false, - object: { - type: 'Identifier', - name: 'universe', - range: [0, 8], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 8 } - } - }, - property: { - type: 'Identifier', - name: 'milkyway', - range: [9, 17], - loc: { - start: { line: 1, column: 9 }, - end: { line: 1, column: 17 } - } - }, - range: [0, 17], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 17 } - } - }, - property: { - type: 'Identifier', - name: 'solarsystem', - range: [18, 29], - loc: { - start: { line: 1, column: 18 }, - end: { line: 1, column: 29 } - } - }, - range: [0, 29], + type: 'Literal', + value: 0x10, + raw: '0x10', + range: [0, 4], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 29 } + end: { line: 1, column: 4 } } }, - range: [0, 29], + range: [0, 4], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 29 } + end: { line: 1, column: 4 } } }, - 'universe.milkyway.solarsystem.Earth': { + '0x100': { type: 'ExpressionStatement', expression: { - type: 'MemberExpression', - computed: false, - object: { - type: 'MemberExpression', - computed: false, - object: { - type: 'MemberExpression', - computed: false, - object: { - type: 'Identifier', - name: 'universe', - range: [0, 8], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 8 } - } - }, - property: { - type: 'Identifier', - name: 'milkyway', - range: [9, 17], - loc: { - start: { line: 1, column: 9 }, - end: { line: 1, column: 17 } - } - }, - range: [0, 17], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 17 } - } - }, - property: { - type: 'Identifier', - name: 'solarsystem', - range: [18, 29], - loc: { - start: { line: 1, column: 18 }, - end: { line: 1, column: 29 } - } - }, - range: [0, 29], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 29 } - } - }, - property: { - type: 'Identifier', - name: 'Earth', - range: [30, 35], - loc: { - start: { line: 1, column: 30 }, - end: { line: 1, column: 35 } - } - }, - range: [0, 35], + type: 'Literal', + value: 0x100, + raw: '0x100', + range: [0, 5], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 35 } + end: { line: 1, column: 5 } } }, - range: [0, 35], + range: [0, 5], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 35 } + end: { line: 1, column: 5 } } }, - 'universe[galaxyName, otherUselessName]': { + '0X04': { type: 'ExpressionStatement', expression: { - type: 'MemberExpression', - computed: true, - object: { - type: 'Identifier', - name: 'universe', - range: [0, 8], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 8 } - } - }, - property: { - type: 'SequenceExpression', - expressions: [{ - type: 'Identifier', - name: 'galaxyName', - range: [9, 19], - loc: { - start: { line: 1, column: 9 }, - end: { line: 1, column: 19 } - } - }, { - type: 'Identifier', - name: 'otherUselessName', - range: [21, 37], - loc: { - start: { line: 1, column: 21 }, - end: { line: 1, column: 37 } - } - }], - range: [9, 37], - loc: { - start: { line: 1, column: 9 }, - end: { line: 1, column: 37 } - } - }, - range: [0, 38], + type: 'Literal', + value: 0X04, + raw: '0X04', + range: [0, 4], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 38 } + end: { line: 1, column: 4 } } }, - range: [0, 38], + range: [0, 4], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 38 } + end: { line: 1, column: 4 } } }, - 'universe[galaxyName]': { + '02': { type: 'ExpressionStatement', expression: { - type: 'MemberExpression', - computed: true, - object: { - type: 'Identifier', - name: 'universe', - range: [0, 8], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 8 } - } - }, - property: { - type: 'Identifier', - name: 'galaxyName', - range: [9, 19], - loc: { - start: { line: 1, column: 9 }, - end: { line: 1, column: 19 } - } - }, - range: [0, 20], + type: 'Literal', + value: 2, + raw: '02', + range: [0, 2], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 20 } + end: { line: 1, column: 2 } } }, - range: [0, 20], + range: [0, 2], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 20 } + end: { line: 1, column: 2 } } }, - 'universe[42].galaxies': { + '012': { type: 'ExpressionStatement', expression: { - type: 'MemberExpression', - computed: false, - object: { - type: 'MemberExpression', - computed: true, - object: { - type: 'Identifier', - name: 'universe', - range: [0, 8], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 8 } - } - }, - property: { - type: 'Literal', - value: 42, - raw: '42', - range: [9, 11], - loc: { - start: { line: 1, column: 9 }, - end: { line: 1, column: 11 } - } - }, - range: [0, 12], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 12 } - } - }, - property: { - type: 'Identifier', - name: 'galaxies', - range: [13, 21], - loc: { - start: { line: 1, column: 13 }, - end: { line: 1, column: 21 } - } - }, - range: [0, 21], + type: 'Literal', + value: 10, + raw: '012', + range: [0, 3], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 21 } + end: { line: 1, column: 3 } } }, - range: [0, 21], + range: [0, 3], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 21 } + end: { line: 1, column: 3 } } }, - 'universe(42).galaxies': { + '0012': { type: 'ExpressionStatement', expression: { - type: 'MemberExpression', - computed: false, - object: { - type: 'CallExpression', - callee: { - type: 'Identifier', - name: 'universe', - range: [0, 8], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 8 } - } - }, - 'arguments': [{ - type: 'Literal', - value: 42, - raw: '42', - range: [9, 11], - loc: { - start: { line: 1, column: 9 }, - end: { line: 1, column: 11 } - } - }], - range: [0, 12], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 12 } - } - }, - property: { - type: 'Identifier', - name: 'galaxies', - range: [13, 21], - loc: { - start: { line: 1, column: 13 }, - end: { line: 1, column: 21 } - } - }, - range: [0, 21], + type: 'Literal', + value: 10, + raw: '0012', + range: [0, 4], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 21 } + end: { line: 1, column: 4 } } }, - range: [0, 21], + range: [0, 4], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 21 } + end: { line: 1, column: 4 } } }, - 'universe(42).galaxies(14, 3, 77).milkyway': { + '08': { type: 'ExpressionStatement', expression: { - type: 'MemberExpression', - computed: false, - object: { - type: 'CallExpression', - callee: { - type: 'MemberExpression', - computed: false, - object: { - type: 'CallExpression', - callee: { - type: 'Identifier', - name: 'universe', - range: [0, 8], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 8 } - } - }, - 'arguments': [{ - type: 'Literal', - value: 42, - raw: '42', - range: [9, 11], - loc: { - start: { line: 1, column: 9 }, - end: { line: 1, column: 11 } - } - }], - range: [0, 12], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 12 } - } - }, - property: { - type: 'Identifier', - name: 'galaxies', - range: [13, 21], - loc: { - start: { line: 1, column: 13 }, - end: { line: 1, column: 21 } - } - }, - range: [0, 21], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 21 } - } - }, - 'arguments': [{ - type: 'Literal', - value: 14, - raw: '14', - range: [22, 24], - loc: { - start: { line: 1, column: 22 }, - end: { line: 1, column: 24 } - } - }, { - type: 'Literal', - value: 3, - raw: '3', - range: [26, 27], - loc: { - start: { line: 1, column: 26 }, - end: { line: 1, column: 27 } - } - }, { - type: 'Literal', - value: 77, - raw: '77', - range: [29, 31], - loc: { - start: { line: 1, column: 29 }, - end: { line: 1, column: 31 } - } - }], - range: [0, 32], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 32 } - } - }, - property: { - type: 'Identifier', - name: 'milkyway', - range: [33, 41], - loc: { - start: { line: 1, column: 33 }, - end: { line: 1, column: 41 } - } - }, - range: [0, 41], + type: 'Literal', + value: 8, + raw: '08', + range: [0, 2], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 41 } + end: { line: 1, column: 2 } } }, - range: [0, 41], + range: [0, 2], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 41 } + end: { line: 1, column: 2 } } }, - 'earth.asia.Indonesia.prepareForElection(2014)': { + '0008': { type: 'ExpressionStatement', expression: { - type: 'CallExpression', - callee: { - type: 'MemberExpression', - computed: false, - object: { - type: 'MemberExpression', - computed: false, - object: { - type: 'MemberExpression', - computed: false, - object: { - type: 'Identifier', - name: 'earth', - range: [0, 5], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 5 } - } - }, - property: { - type: 'Identifier', - name: 'asia', - range: [6, 10], - loc: { - start: { line: 1, column: 6 }, - end: { line: 1, column: 10 } - } - }, - range: [0, 10], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 10 } - } - }, - property: { - type: 'Identifier', - name: 'Indonesia', - range: [11, 20], - loc: { - start: { line: 1, column: 11 }, - end: { line: 1, column: 20 } - } - }, - range: [0, 20], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 20 } - } - }, - property: { - type: 'Identifier', - name: 'prepareForElection', - range: [21, 39], - loc: { - start: { line: 1, column: 21 }, - end: { line: 1, column: 39 } - } - }, - range: [0, 39], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 39 } - } - }, - 'arguments': [{ - type: 'Literal', - value: 2014, - raw: '2014', - range: [40, 44], - loc: { - start: { line: 1, column: 40 }, - end: { line: 1, column: 44 } - } - }], - range: [0, 45], + type: 'Literal', + value: 8, + raw: '0008', + range: [0, 4], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 45 } + end: { line: 1, column: 4 } } }, - range: [0, 45], + range: [0, 4], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 45 } + end: { line: 1, column: 4 } } }, - 'universe.if': { + '09': { type: 'ExpressionStatement', expression: { - type: 'MemberExpression', - computed: false, - object: { - type: 'Identifier', - name: 'universe', - range: [0, 8], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 8 } - } - }, - property: { - type: 'Identifier', - name: 'if', - range: [9, 11], - loc: { - start: { line: 1, column: 9 }, - end: { line: 1, column: 11 } - } - }, - range: [0, 11], + type: 'Literal', + value: 9, + raw: '09', + range: [0, 2], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 11 } + end: { line: 1, column: 2 } } }, - range: [0, 11], + range: [0, 2], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 11 } + end: { line: 1, column: 2 } } }, - 'universe.true': { + '09.5': { type: 'ExpressionStatement', expression: { - type: 'MemberExpression', - computed: false, - object: { - type: 'Identifier', - name: 'universe', - range: [0, 8], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 8 } - } - }, - property: { - type: 'Identifier', - name: 'true', - range: [9, 13], - loc: { - start: { line: 1, column: 9 }, - end: { line: 1, column: 13 } - } - }, - range: [0, 13], + type: 'Literal', + value: 9.5, + raw: '09.5', + range: [0, 4], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 13 } + end: { line: 1, column: 4 } } }, - range: [0, 13], + range: [0, 4], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 13 } + end: { line: 1, column: 4 } } - }, + } - 'universe.false': { + }, + + '[ES6] Binary Integer Literals': { + + '0b0': { type: 'ExpressionStatement', expression: { - type: 'MemberExpression', - computed: false, - object: { - type: 'Identifier', - name: 'universe', - range: [0, 8], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 8 } - } - }, - property: { - type: 'Identifier', - name: 'false', - range: [9, 14], - loc: { - start: { line: 1, column: 9 }, - end: { line: 1, column: 14 } - } - }, - range: [0, 14], + type: 'Literal', + value: 0, + raw: '0b0', + range: [0, 3], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 14 } + end: { line: 1, column: 3 } } }, - range: [0, 14], + range: [0, 3], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 14 } + end: { line: 1, column: 3 } } }, - 'universe.null': { + '0b1': { type: 'ExpressionStatement', expression: { - type: 'MemberExpression', - computed: false, - object: { - type: 'Identifier', - name: 'universe', - range: [0, 8], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 8 } - } - }, - property: { - type: 'Identifier', - name: 'null', - range: [9, 13], - loc: { - start: { line: 1, column: 9 }, - end: { line: 1, column: 13 } - } - }, - range: [0, 13], + type: 'Literal', + value: 1, + raw: '0b1', + range: [0, 3], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 13 } + end: { line: 1, column: 3 } } }, - range: [0, 13], + range: [0, 3], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 13 } + end: { line: 1, column: 3 } } - } - - }, + }, - 'Postfix Expressions': { + '0b10': { + type: 'ExpressionStatement', + expression: { + type: 'Literal', + value: 2, + raw: '0b10', + range: [0, 4], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 4 } + } + }, + range: [0, 4], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 4 } + } + }, - 'x++': { + '0B0': { type: 'ExpressionStatement', expression: { - type: 'UpdateExpression', - operator: '++', - argument: { - type: 'Identifier', - name: 'x', - range: [0, 1], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 1 } - } - }, - prefix: false, + type: 'Literal', + value: 0, + raw: '0B0', range: [0, 3], loc: { start: { line: 1, column: 0 }, @@ -6245,21 +6632,12 @@ var testFixture = { } }, - 'x--': { + '0B1': { type: 'ExpressionStatement', expression: { - type: 'UpdateExpression', - operator: '--', - argument: { - type: 'Identifier', - name: 'x', - range: [0, 1], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 1 } - } - }, - prefix: false, + type: 'Literal', + value: 1, + raw: '0B1', range: [0, 3], loc: { start: { line: 1, column: 0 }, @@ -6273,165 +6651,139 @@ var testFixture = { } }, - 'eval++': { + '0B10': { type: 'ExpressionStatement', expression: { - type: 'UpdateExpression', - operator: '++', - argument: { - type: 'Identifier', - name: 'eval', - range: [0, 4], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 4 } - } - }, - prefix: false, - range: [0, 6], + type: 'Literal', + value: 2, + raw: '0B10', + range: [0, 4], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 6 } + end: { line: 1, column: 4 } } }, - range: [0, 6], + range: [0, 4], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 6 } + end: { line: 1, column: 4 } } - }, + } - 'eval--': { + }, + + '[ES6] Octal Integer Literals': { + + '00': { type: 'ExpressionStatement', expression: { - type: 'UpdateExpression', - operator: '--', - argument: { - type: 'Identifier', - name: 'eval', - range: [0, 4], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 4 } - } - }, - prefix: false, - range: [0, 6], + type: 'Literal', + value: 0, + raw: '00', + range: [0, 2], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 6 } + end: { line: 1, column: 2 } } }, - range: [0, 6], + range: [0, 2], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 6 } + end: { line: 1, column: 2 } } }, - 'arguments++': { + '0o0': { type: 'ExpressionStatement', expression: { - type: 'UpdateExpression', - operator: '++', - argument: { - type: 'Identifier', - name: 'arguments', - range: [0, 9], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 9 } - } - }, - prefix: false, - range: [0, 11], + type: 'Literal', + value: 0, + raw: '0o0', + range: [0, 3], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 11 } + end: { line: 1, column: 3 } } }, - range: [0, 11], + range: [0, 3], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 11 } + end: { line: 1, column: 3 } } }, - 'arguments--': { - type: 'ExpressionStatement', - expression: { - type: 'UpdateExpression', - operator: '--', - argument: { - type: 'Identifier', - name: 'arguments', - range: [0, 9], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 9 } - } - }, - prefix: false, - range: [0, 11], + 'function test() {\'use strict\'; 0o0; }': { + type: 'FunctionDeclaration', + id: { + type: 'Identifier', + name: 'test', + range: [9, 13], loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 11 } + start: { line: 1, column: 9 }, + end: { line: 1, column: 13 } } }, - range: [0, 11], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 11 } - } - } - - }, - - 'Unary Operators': { - - '++x': { - type: 'ExpressionStatement', - expression: { - type: 'UpdateExpression', - operator: '++', - argument: { - type: 'Identifier', - name: 'x', - range: [2, 3], + params: [], + defaults: [], + body: { + type: 'BlockStatement', + body: [{ + type: 'ExpressionStatement', + expression: { + type: 'Literal', + value: 'use strict', + raw: '\'use strict\'', + range: [17, 29], + loc: { + start: { line: 1, column: 17 }, + end: { line: 1, column: 29 } + } + }, + range: [17, 30], loc: { - start: { line: 1, column: 2 }, - end: { line: 1, column: 3 } + start: { line: 1, column: 17 }, + end: { line: 1, column: 30 } } - }, - prefix: true, - range: [0, 3], + }, { + type: 'ExpressionStatement', + expression: { + type: 'Literal', + value: 0, + raw: '0o0', + range: [31, 34], + loc: { + start: { line: 1, column: 31 }, + end: { line: 1, column: 34 } + } + }, + range: [31, 35], + loc: { + start: { line: 1, column: 31 }, + end: { line: 1, column: 35 } + } + }], + range: [16, 37], loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 3 } + start: { line: 1, column: 16 }, + end: { line: 1, column: 37 } } }, - range: [0, 3], + rest: null, + generator: false, + expression: false, + range: [0, 37], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 3 } + end: { line: 1, column: 37 } } }, - '--x': { + '0o2': { type: 'ExpressionStatement', expression: { - type: 'UpdateExpression', - operator: '--', - argument: { - type: 'Identifier', - name: 'x', - range: [2, 3], - loc: { - start: { line: 1, column: 2 }, - end: { line: 1, column: 3 } - } - }, - prefix: true, + type: 'Literal', + value: 2, + raw: '0o2', range: [0, 3], loc: { start: { line: 1, column: 0 }, @@ -6445,245 +6797,196 @@ var testFixture = { } }, - '++eval': { + '0o12': { type: 'ExpressionStatement', expression: { - type: 'UpdateExpression', - operator: '++', - argument: { - type: 'Identifier', - name: 'eval', - range: [2, 6], - loc: { - start: { line: 1, column: 2 }, - end: { line: 1, column: 6 } - } - }, - prefix: true, - range: [0, 6], + type: 'Literal', + value: 10, + raw: '0o12', + range: [0, 4], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 6 } + end: { line: 1, column: 4 } } }, - range: [0, 6], + range: [0, 4], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 6 } + end: { line: 1, column: 4 } } }, - '--eval': { + '0O0': { type: 'ExpressionStatement', expression: { - type: 'UpdateExpression', - operator: '--', - argument: { - type: 'Identifier', - name: 'eval', - range: [2, 6], - loc: { - start: { line: 1, column: 2 }, - end: { line: 1, column: 6 } - } - }, - prefix: true, - range: [0, 6], + type: 'Literal', + value: 0, + raw: '0O0', + range: [0, 3], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 6 } + end: { line: 1, column: 3 } } }, - range: [0, 6], + range: [0, 3], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 6 } + end: { line: 1, column: 3 } } }, - '++arguments': { - type: 'ExpressionStatement', - expression: { - type: 'UpdateExpression', - operator: '++', - argument: { - type: 'Identifier', - name: 'arguments', - range: [2, 11], - loc: { - start: { line: 1, column: 2 }, - end: { line: 1, column: 11 } - } - }, - prefix: true, - range: [0, 11], + 'function test() {\'use strict\'; 0O0; }': { + type: 'FunctionDeclaration', + id: { + type: 'Identifier', + name: 'test', + range: [9, 13], loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 11 } + start: { line: 1, column: 9 }, + end: { line: 1, column: 13 } } }, - range: [0, 11], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 11 } - } - }, - - '--arguments': { - type: 'ExpressionStatement', - expression: { - type: 'UpdateExpression', - operator: '--', - argument: { - type: 'Identifier', - name: 'arguments', - range: [2, 11], + params: [], + defaults: [], + body: { + type: 'BlockStatement', + body: [{ + type: 'ExpressionStatement', + expression: { + type: 'Literal', + value: 'use strict', + raw: '\'use strict\'', + range: [17, 29], + loc: { + start: { line: 1, column: 17 }, + end: { line: 1, column: 29 } + } + }, + range: [17, 30], loc: { - start: { line: 1, column: 2 }, - end: { line: 1, column: 11 } + start: { line: 1, column: 17 }, + end: { line: 1, column: 30 } } - }, - prefix: true, - range: [0, 11], + }, { + type: 'ExpressionStatement', + expression: { + type: 'Literal', + value: 0, + raw: '0O0', + range: [31, 34], + loc: { + start: { line: 1, column: 31 }, + end: { line: 1, column: 34 } + } + }, + range: [31, 35], + loc: { + start: { line: 1, column: 31 }, + end: { line: 1, column: 35 } + } + }], + range: [16, 37], loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 11 } + start: { line: 1, column: 16 }, + end: { line: 1, column: 37 } } }, - range: [0, 11], + rest: null, + generator: false, + expression: false, + range: [0, 37], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 11 } + end: { line: 1, column: 37 } } - }, + } - '+x': { + }, + + 'String Literals': { + + '"Hello"': { type: 'ExpressionStatement', expression: { - type: 'UnaryExpression', - operator: '+', - argument: { - type: 'Identifier', - name: 'x', - range: [1, 2], - loc: { - start: { line: 1, column: 1 }, - end: { line: 1, column: 2 } - } - }, - prefix: true, - range: [0, 2], + type: 'Literal', + value: 'Hello', + raw: '"Hello"', + range: [0, 7], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 2 } + end: { line: 1, column: 7 } } }, - range: [0, 2], + range: [0, 7], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 2 } + end: { line: 1, column: 7 } } }, - '-x': { + '"\\n\\r\\t\\v\\b\\f\\\\\\\'\\"\\0"': { type: 'ExpressionStatement', expression: { - type: 'UnaryExpression', - operator: '-', - argument: { - type: 'Identifier', - name: 'x', - range: [1, 2], - loc: { - start: { line: 1, column: 1 }, - end: { line: 1, column: 2 } - } - }, - prefix: true, - range: [0, 2], + type: 'Literal', + value: '\n\r\t\x0B\b\f\\\'"\x00', + raw: '"\\n\\r\\t\\v\\b\\f\\\\\\\'\\"\\0"', + range: [0, 22], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 2 } + end: { line: 1, column: 22 } } }, - range: [0, 2], + range: [0, 22], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 2 } + end: { line: 1, column: 22 } } }, - '~x': { + '"\\u0061"': { type: 'ExpressionStatement', expression: { - type: 'UnaryExpression', - operator: '~', - argument: { - type: 'Identifier', - name: 'x', - range: [1, 2], - loc: { - start: { line: 1, column: 1 }, - end: { line: 1, column: 2 } - } - }, - prefix: true, - range: [0, 2], + type: 'Literal', + value: 'a', + raw: '"\\u0061"', + range: [0, 8], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 2 } + end: { line: 1, column: 8 } } }, - range: [0, 2], + range: [0, 8], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 2 } + end: { line: 1, column: 8 } } }, - '!x': { + '"\\x61"': { type: 'ExpressionStatement', expression: { - type: 'UnaryExpression', - operator: '!', - argument: { - type: 'Identifier', - name: 'x', - range: [1, 2], - loc: { - start: { line: 1, column: 1 }, - end: { line: 1, column: 2 } - } - }, - prefix: true, - range: [0, 2], + type: 'Literal', + value: 'a', + raw: '"\\x61"', + range: [0, 6], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 2 } + end: { line: 1, column: 6 } } }, - range: [0, 2], + range: [0, 6], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 2 } + end: { line: 1, column: 6 } } }, - 'void x': { + '"\\u00"': { type: 'ExpressionStatement', expression: { - type: 'UnaryExpression', - operator: 'void', - argument: { - type: 'Identifier', - name: 'x', - range: [5, 6], - loc: { - start: { line: 1, column: 5 }, - end: { line: 1, column: 6 } - } - }, - prefix: true, + type: 'Literal', + value: 'u00', + raw: '"\\u00"', range: [0, 6], loc: { start: { line: 1, column: 0 }, @@ -6697,2584 +7000,2446 @@ var testFixture = { } }, - 'delete x': { + '"\\xt"': { type: 'ExpressionStatement', expression: { - type: 'UnaryExpression', - operator: 'delete', - argument: { - type: 'Identifier', - name: 'x', - range: [7, 8], - loc: { - start: { line: 1, column: 7 }, - end: { line: 1, column: 8 } - } - }, - prefix: true, - range: [0, 8], + type: 'Literal', + value: 'xt', + raw: '"\\xt"', + range: [0, 5], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 8 } + end: { line: 1, column: 5 } } }, - range: [0, 8], + range: [0, 5], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 8 } + end: { line: 1, column: 5 } } }, - 'typeof x': { + '"Hello\\nworld"': { type: 'ExpressionStatement', expression: { - type: 'UnaryExpression', - operator: 'typeof', - argument: { - type: 'Identifier', - name: 'x', - range: [7, 8], - loc: { - start: { line: 1, column: 7 }, - end: { line: 1, column: 8 } - } - }, - prefix: true, - range: [0, 8], + type: 'Literal', + value: 'Hello\nworld', + raw: '"Hello\\nworld"', + range: [0, 14], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 8 } + end: { line: 1, column: 14 } } }, - range: [0, 8], + range: [0, 14], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 8 } + end: { line: 1, column: 14 } } - } - - }, - - 'Multiplicative Operators': { + }, - 'x * y': { + '"Hello\\\nworld"': { type: 'ExpressionStatement', expression: { - type: 'BinaryExpression', - operator: '*', - left: { - type: 'Identifier', - name: 'x', - range: [0, 1], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 1 } - } - }, - right: { - type: 'Identifier', - name: 'y', - range: [4, 5], - loc: { - start: { line: 1, column: 4 }, - end: { line: 1, column: 5 } - } - }, - range: [0, 5], + type: 'Literal', + value: 'Helloworld', + raw: '"Hello\\\nworld"', + range: [0, 14], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 5 } + end: { line: 2, column: 6 } } }, - range: [0, 5], + range: [0, 14], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 5 } + end: { line: 2, column: 6 } } }, - 'x / y': { + '"Hello\\02World"': { type: 'ExpressionStatement', expression: { - type: 'BinaryExpression', - operator: '/', - left: { - type: 'Identifier', - name: 'x', - range: [0, 1], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 1 } - } - }, - right: { - type: 'Identifier', - name: 'y', - range: [4, 5], - loc: { - start: { line: 1, column: 4 }, - end: { line: 1, column: 5 } - } - }, - range: [0, 5], + type: 'Literal', + value: 'Hello\u0002World', + raw: '"Hello\\02World"', + range: [0, 15], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 5 } + end: { line: 1, column: 15 } } }, - range: [0, 5], + range: [0, 15], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 5 } + end: { line: 1, column: 15 } } }, - 'x % y': { + '"Hello\\012World"': { type: 'ExpressionStatement', expression: { - type: 'BinaryExpression', - operator: '%', - left: { - type: 'Identifier', - name: 'x', - range: [0, 1], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 1 } - } - }, - right: { - type: 'Identifier', - name: 'y', - range: [4, 5], - loc: { - start: { line: 1, column: 4 }, - end: { line: 1, column: 5 } - } - }, - range: [0, 5], + type: 'Literal', + value: 'Hello\u000AWorld', + raw: '"Hello\\012World"', + range: [0, 16], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 5 } + end: { line: 1, column: 16 } } }, - range: [0, 5], + range: [0, 16], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 5 } + end: { line: 1, column: 16 } } - } - - }, - - 'Additive Operators': { + }, - 'x + y': { + '"Hello\\122World"': { type: 'ExpressionStatement', expression: { - type: 'BinaryExpression', - operator: '+', - left: { - type: 'Identifier', - name: 'x', - range: [0, 1], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 1 } - } - }, - right: { - type: 'Identifier', - name: 'y', - range: [4, 5], - loc: { - start: { line: 1, column: 4 }, - end: { line: 1, column: 5 } - } - }, - range: [0, 5], + type: 'Literal', + value: 'Hello\122World', + raw: '"Hello\\122World"', + range: [0, 16], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 5 } + end: { line: 1, column: 16 } } }, - range: [0, 5], + range: [0, 16], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 5 } + end: { line: 1, column: 16 } } }, - 'x - y': { + '"Hello\\0122World"': { type: 'ExpressionStatement', expression: { - type: 'BinaryExpression', - operator: '-', - left: { - type: 'Identifier', - name: 'x', - range: [0, 1], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 1 } - } - }, - right: { - type: 'Identifier', - name: 'y', - range: [4, 5], - loc: { - start: { line: 1, column: 4 }, - end: { line: 1, column: 5 } - } - }, - range: [0, 5], + type: 'Literal', + value: 'Hello\u000A2World', + raw: '"Hello\\0122World"', + range: [0, 17], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 5 } + end: { line: 1, column: 17 } } }, - range: [0, 5], + range: [0, 17], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 5 } + end: { line: 1, column: 17 } } - } - - }, + }, - 'Bitwise Shift Operator': { + '"Hello\\312World"': { + type: 'ExpressionStatement', + expression: { + type: 'Literal', + value: 'Hello\u00CAWorld', + raw: '"Hello\\312World"', + range: [0, 16], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 16 } + } + }, + range: [0, 16], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 16 } + } + }, - 'x << y': { + '"Hello\\412World"': { type: 'ExpressionStatement', expression: { - type: 'BinaryExpression', - operator: '<<', - left: { - type: 'Identifier', - name: 'x', - range: [0, 1], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 1 } - } - }, - right: { - type: 'Identifier', - name: 'y', - range: [5, 6], - loc: { - start: { line: 1, column: 5 }, - end: { line: 1, column: 6 } - } - }, - range: [0, 6], + type: 'Literal', + value: 'Hello\412World', + raw: '"Hello\\412World"', + range: [0, 16], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 6 } + end: { line: 1, column: 16 } } }, - range: [0, 6], + range: [0, 16], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 6 } + end: { line: 1, column: 16 } } }, - 'x >> y': { + '"Hello\\812World"': { type: 'ExpressionStatement', expression: { - type: 'BinaryExpression', - operator: '>>', - left: { - type: 'Identifier', - name: 'x', - range: [0, 1], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 1 } - } - }, - right: { - type: 'Identifier', - name: 'y', - range: [5, 6], - loc: { - start: { line: 1, column: 5 }, - end: { line: 1, column: 6 } - } - }, - range: [0, 6], + type: 'Literal', + value: 'Hello812World', + raw: '"Hello\\812World"', + range: [0, 16], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 6 } + end: { line: 1, column: 16 } } }, - range: [0, 6], + range: [0, 16], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 6 } + end: { line: 1, column: 16 } } }, - 'x >>> y': { + '"Hello\\712World"': { type: 'ExpressionStatement', expression: { - type: 'BinaryExpression', - operator: '>>>', - left: { - type: 'Identifier', - name: 'x', - range: [0, 1], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 1 } - } - }, - right: { - type: 'Identifier', - name: 'y', - range: [6, 7], - loc: { - start: { line: 1, column: 6 }, - end: { line: 1, column: 7 } - } - }, - range: [0, 7], + type: 'Literal', + value: 'Hello\712World', + raw: '"Hello\\712World"', + range: [0, 16], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 7 } + end: { line: 1, column: 16 } } }, - range: [0, 7], + range: [0, 16], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 7 } + end: { line: 1, column: 16 } } - } - - }, - - 'Relational Operators': { + }, - 'x < y': { + '"Hello\\0World"': { type: 'ExpressionStatement', expression: { - type: 'BinaryExpression', - operator: '<', - left: { - type: 'Identifier', - name: 'x', - range: [0, 1], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 1 } - } - }, - right: { - type: 'Identifier', - name: 'y', - range: [4, 5], - loc: { - start: { line: 1, column: 4 }, - end: { line: 1, column: 5 } - } - }, - range: [0, 5], + type: 'Literal', + value: 'Hello\u0000World', + raw: '"Hello\\0World"', + range: [0, 14], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 5 } + end: { line: 1, column: 14 } } }, - range: [0, 5], + range: [0, 14], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 5 } + end: { line: 1, column: 14 } } }, - 'x > y': { + '"Hello\\\r\nworld"': { type: 'ExpressionStatement', expression: { - type: 'BinaryExpression', - operator: '>', - left: { - type: 'Identifier', - name: 'x', - range: [0, 1], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 1 } - } - }, - right: { - type: 'Identifier', - name: 'y', - range: [4, 5], - loc: { - start: { line: 1, column: 4 }, - end: { line: 1, column: 5 } - } - }, - range: [0, 5], + type: 'Literal', + value: 'Helloworld', + raw: '"Hello\\\r\nworld"', + range: [0, 15], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 5 } + end: { line: 2, column: 6 } } }, - range: [0, 5], + range: [0, 15], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 5 } + end: { line: 2, column: 6 } } }, - 'x <= y': { + '"Hello\\1World"': { type: 'ExpressionStatement', expression: { - type: 'BinaryExpression', - operator: '<=', - left: { - type: 'Identifier', - name: 'x', - range: [0, 1], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 1 } - } - }, - right: { - type: 'Identifier', - name: 'y', - range: [5, 6], - loc: { - start: { line: 1, column: 5 }, - end: { line: 1, column: 6 } - } - }, - range: [0, 6], + type: 'Literal', + value: 'Hello\u0001World', + raw: '"Hello\\1World"', + range: [0, 14], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 6 } + end: { line: 1, column: 14 } } }, - range: [0, 6], + range: [0, 14], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 6 } + end: { line: 1, column: 14 } } - }, + } + }, - 'x >= y': { + '[ES6] Unicode Code Point Escape Sequence': { + + '"\\u{714E}\\u{8336}"': { type: 'ExpressionStatement', expression: { - type: 'BinaryExpression', - operator: '>=', - left: { - type: 'Identifier', - name: 'x', - range: [0, 1], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 1 } - } - }, - right: { - type: 'Identifier', - name: 'y', - range: [5, 6], - loc: { - start: { line: 1, column: 5 }, - end: { line: 1, column: 6 } - } - }, - range: [0, 6], + type: 'Literal', + value: '\u714E\u8336', + raw: '"\\u{714E}\\u{8336}"', + range: [0, 18], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 6 } + end: { line: 1, column: 18 } } }, - range: [0, 6], + range: [0, 18], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 6 } + end: { line: 1, column: 18 } } }, - 'x in y': { + '"\\u{20BB7}\\u{91CE}\\u{5BB6}"': { type: 'ExpressionStatement', expression: { - type: 'BinaryExpression', - operator: 'in', - left: { - type: 'Identifier', - name: 'x', - range: [0, 1], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 1 } - } - }, - right: { - type: 'Identifier', - name: 'y', - range: [5, 6], - loc: { - start: { line: 1, column: 5 }, - end: { line: 1, column: 6 } - } - }, - range: [0, 6], + type: 'Literal', + value: '\ud842\udfb7\u91ce\u5bb6', + raw: '"\\u{20BB7}\\u{91CE}\\u{5BB6}"', + range: [0, 27], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 6 } + end: { line: 1, column: 27 } } }, - range: [0, 6], + range: [0, 27], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 6 } + end: { line: 1, column: 27 } } }, - 'x instanceof y': { + '"\\u{00000000034}"': { type: 'ExpressionStatement', expression: { - type: 'BinaryExpression', - operator: 'instanceof', - left: { - type: 'Identifier', - name: 'x', - range: [0, 1], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 1 } - } + range: [0, 17], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 17 } }, - right: { - type: 'Identifier', - name: 'y', - range: [13, 14], + type: 'Literal', + value: '4', + raw: '"\\u{00000000034}"' + }, + range: [0, 17], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 17 } + } + } + + }, + + 'Regular Expression Literals': { + + '/p/;': { + type: 'Program', + body: [{ + type: 'ExpressionStatement', + expression: { + type: 'Literal', + value: '/p/', + raw: '/p/', + regex: { + pattern: 'p', + flags: '' + }, + range: [0, 3], loc: { - start: { line: 1, column: 13 }, - end: { line: 1, column: 14 } + start: { line: 1, column: 0 }, + end: { line: 1, column: 3 } } }, - range: [0, 14], + range: [0, 4], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 14 } + end: { line: 1, column: 4 } } - }, - range: [0, 14], + }], + range: [0, 4], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 14 } - } - }, - - 'x < y < z': { - type: 'ExpressionStatement', - expression: { - type: 'BinaryExpression', - operator: '<', - left: { - type: 'BinaryExpression', - operator: '<', - left: { - type: 'Identifier', - name: 'x', - range: [0, 1], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 1 } - } - }, - right: { - type: 'Identifier', - name: 'y', - range: [4, 5], + end: { line: 1, column: 4 } + }, + tokens: [{ + type: 'RegularExpression', + value: '/p/', + regex: { + pattern: 'p', + flags: '' + }, + range: [0, 3], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 3 } + } + }, { + type: 'Punctuator', + value: ';', + range: [3, 4], + loc: { + start: { line: 1, column: 3 }, + end: { line: 1, column: 4 } + } + }] + }, + + '[/q/]': { + type: 'Program', + body: [{ + type: 'ExpressionStatement', + expression: { + type: 'ArrayExpression', + elements: [{ + type: 'Literal', + value: '/q/', + raw: '/q/', + regex: { + pattern: 'q', + flags: '' + }, + range: [1, 4], loc: { - start: { line: 1, column: 4 }, - end: { line: 1, column: 5 } + start: { line: 1, column: 1 }, + end: { line: 1, column: 4 } } - }, + }], range: [0, 5], loc: { start: { line: 1, column: 0 }, end: { line: 1, column: 5 } } }, - right: { - type: 'Identifier', - name: 'z', - range: [8, 9], - loc: { - start: { line: 1, column: 8 }, - end: { line: 1, column: 9 } - } - }, - range: [0, 9], + range: [0, 5], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 9 } + end: { line: 1, column: 5 } } - }, - range: [0, 9], + }], + range: [0, 5], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 9 } - } - } - - }, - - 'Equality Operators': { - - 'x == y': { - type: 'ExpressionStatement', - expression: { - type: 'BinaryExpression', - operator: '==', - left: { - type: 'Identifier', - name: 'x', - range: [0, 1], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 1 } - } - }, - right: { - type: 'Identifier', - name: 'y', - range: [5, 6], - loc: { - start: { line: 1, column: 5 }, - end: { line: 1, column: 6 } - } - }, - range: [0, 6], + end: { line: 1, column: 5 } + }, + tokens: [{ + type: 'Punctuator', + value: '[', + range: [0, 1], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 6 } + end: { line: 1, column: 1 } } - }, - range: [0, 6], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 6 } - } - }, - - 'x != y': { - type: 'ExpressionStatement', - expression: { - type: 'BinaryExpression', - operator: '!=', - left: { - type: 'Identifier', - name: 'x', - range: [0, 1], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 1 } - } - }, - right: { - type: 'Identifier', - name: 'y', - range: [5, 6], - loc: { - start: { line: 1, column: 5 }, - end: { line: 1, column: 6 } - } + }, { + type: 'RegularExpression', + value: '/q/', + regex: { + pattern: 'q', + flags: '' }, - range: [0, 6], + range: [1, 4], loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 6 } + start: { line: 1, column: 1 }, + end: { line: 1, column: 4 } } - }, - range: [0, 6], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 6 } - } + }, { + type: 'Punctuator', + value: ']', + range: [4, 5], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 5 } + } + }] }, - 'x === y': { - type: 'ExpressionStatement', - expression: { - type: 'BinaryExpression', - operator: '===', - left: { - type: 'Identifier', - name: 'x', - range: [0, 1], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 1 } - } - }, - right: { - type: 'Identifier', - name: 'y', - range: [6, 7], + 'var x = /[a-z]/i': { + type: 'Program', + body: [{ + type: 'VariableDeclaration', + declarations: [{ + type: 'VariableDeclarator', + id: { + type: 'Identifier', + name: 'x', + range: [4, 5], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 5 } + } + }, + init: { + type: 'Literal', + value: '/[a-z]/i', + raw: '/[a-z]/i', + regex: { + pattern: '[a-z]', + flags: 'i' + }, + range: [8, 16], + loc: { + start: { line: 1, column: 8 }, + end: { line: 1, column: 16 } + } + }, + range: [4, 16], loc: { - start: { line: 1, column: 6 }, - end: { line: 1, column: 7 } + start: { line: 1, column: 4 }, + end: { line: 1, column: 16 } } - }, - range: [0, 7], + }], + kind: 'var', + range: [0, 16], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 7 } + end: { line: 1, column: 16 } } - }, - range: [0, 7], + }], + range: [0, 16], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 7 } - } - }, - - 'x !== y': { - type: 'ExpressionStatement', - expression: { - type: 'BinaryExpression', - operator: '!==', - left: { - type: 'Identifier', - name: 'x', - range: [0, 1], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 1 } - } - }, - right: { - type: 'Identifier', - name: 'y', - range: [6, 7], - loc: { - start: { line: 1, column: 6 }, - end: { line: 1, column: 7 } - } - }, - range: [0, 7], + end: { line: 1, column: 16 } + }, + tokens: [{ + type: 'Keyword', + value: 'var', + range: [0, 3], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 7 } + end: { line: 1, column: 3 } } - }, - range: [0, 7], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 7 } - } - } - - }, - - 'Binary Bitwise Operators': { - - 'x & y': { - type: 'ExpressionStatement', - expression: { - type: 'BinaryExpression', - operator: '&', - left: { - type: 'Identifier', - name: 'x', - range: [0, 1], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 1 } - } - }, - right: { - type: 'Identifier', - name: 'y', - range: [4, 5], - loc: { - start: { line: 1, column: 4 }, - end: { line: 1, column: 5 } - } - }, - range: [0, 5], + }, { + type: 'Identifier', + value: 'x', + range: [4, 5], loc: { - start: { line: 1, column: 0 }, + start: { line: 1, column: 4 }, end: { line: 1, column: 5 } } - }, - range: [0, 5], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 5 } - } - }, - - 'x ^ y': { - type: 'ExpressionStatement', - expression: { - type: 'BinaryExpression', - operator: '^', - left: { - type: 'Identifier', - name: 'x', - range: [0, 1], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 1 } - } - }, - right: { - type: 'Identifier', - name: 'y', - range: [4, 5], - loc: { - start: { line: 1, column: 4 }, - end: { line: 1, column: 5 } - } - }, - range: [0, 5], + }, { + type: 'Punctuator', + value: '=', + range: [6, 7], loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 5 } + start: { line: 1, column: 6 }, + end: { line: 1, column: 7 } } - }, - range: [0, 5], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 5 } - } - }, - - 'x | y': { - type: 'ExpressionStatement', - expression: { - type: 'BinaryExpression', - operator: '|', - left: { - type: 'Identifier', - name: 'x', - range: [0, 1], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 1 } - } - }, - right: { - type: 'Identifier', - name: 'y', - range: [4, 5], - loc: { - start: { line: 1, column: 4 }, - end: { line: 1, column: 5 } - } + }, { + type: 'RegularExpression', + value: '/[a-z]/i', + regex: { + pattern: '[a-z]', + flags: 'i' }, - range: [0, 5], + range: [8, 16], loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 5 } + start: { line: 1, column: 8 }, + end: { line: 1, column: 16 } } - }, - range: [0, 5], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 5 } - } - } - - }, - - 'Binary Expressions': { + }] + }, - 'x + y + z': { - type: 'ExpressionStatement', - expression: { - type: 'BinaryExpression', - operator: '+', - left: { - type: 'BinaryExpression', - operator: '+', - left: { + 'var x = /[a-z]/y': { + type: 'Program', + body: [{ + type: 'VariableDeclaration', + declarations: [{ + type: 'VariableDeclarator', + id: { type: 'Identifier', name: 'x', - range: [0, 1], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 1 } - } - }, - right: { - type: 'Identifier', - name: 'y', range: [4, 5], loc: { start: { line: 1, column: 4 }, end: { line: 1, column: 5 } } }, - range: [0, 5], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 5 } - } - }, - right: { - type: 'Identifier', - name: 'z', - range: [8, 9], + init: { + type: 'Literal', + value: null, + raw: '/[a-z]/y', + regex: { + pattern: '[a-z]', + flags: 'y' + }, + range: [8, 16], + loc: { + start: { line: 1, column: 8 }, + end: { line: 1, column: 16 } + } + }, + range: [4, 16], loc: { - start: { line: 1, column: 8 }, - end: { line: 1, column: 9 } + start: { line: 1, column: 4 }, + end: { line: 1, column: 16 } } - }, - range: [0, 9], + }], + kind: 'var', + range: [0, 16], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 9 } + end: { line: 1, column: 16 } } - }, - range: [0, 9], + }], + range: [0, 16], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 9 } - } + end: { line: 1, column: 16 } + }, + tokens: [{ + type: 'Keyword', + value: 'var', + range: [0, 3], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 3 } + } + }, { + type: 'Identifier', + value: 'x', + range: [4, 5], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 5 } + } + }, { + type: 'Punctuator', + value: '=', + range: [6, 7], + loc: { + start: { line: 1, column: 6 }, + end: { line: 1, column: 7 } + } + }, { + type: 'RegularExpression', + value: '/[a-z]/y', + regex: { + pattern: '[a-z]', + flags: 'y' + }, + range: [8, 16], + loc: { + start: { line: 1, column: 8 }, + end: { line: 1, column: 16 } + } + }] }, - 'x - y + z': { - type: 'ExpressionStatement', - expression: { - type: 'BinaryExpression', - operator: '+', - left: { - type: 'BinaryExpression', - operator: '-', - left: { + 'var x = /[a-z]/u': { + type: 'Program', + body: [{ + type: 'VariableDeclaration', + declarations: [{ + type: 'VariableDeclarator', + id: { type: 'Identifier', name: 'x', - range: [0, 1], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 1 } - } - }, - right: { - type: 'Identifier', - name: 'y', range: [4, 5], loc: { start: { line: 1, column: 4 }, end: { line: 1, column: 5 } } }, - range: [0, 5], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 5 } - } - }, - right: { - type: 'Identifier', - name: 'z', - range: [8, 9], + init: { + type: 'Literal', + value: null, + raw: '/[a-z]/u', + regex: { + pattern: '[a-z]', + flags: 'u' + }, + range: [8, 16], + loc: { + start: { line: 1, column: 8 }, + end: { line: 1, column: 16 } + } + }, + range: [4, 16], loc: { - start: { line: 1, column: 8 }, - end: { line: 1, column: 9 } + start: { line: 1, column: 4 }, + end: { line: 1, column: 16 } } - }, - range: [0, 9], + }], + kind: 'var', + range: [0, 16], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 9 } + end: { line: 1, column: 16 } } - }, - range: [0, 9], + }], + range: [0, 16], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 9 } - } + end: { line: 1, column: 16 } + }, + tokens: [{ + type: 'Keyword', + value: 'var', + range: [0, 3], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 3 } + } + }, { + type: 'Identifier', + value: 'x', + range: [4, 5], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 5 } + } + }, { + type: 'Punctuator', + value: '=', + range: [6, 7], + loc: { + start: { line: 1, column: 6 }, + end: { line: 1, column: 7 } + } + }, { + type: 'RegularExpression', + value: '/[a-z]/u', + regex: { + pattern: '[a-z]', + flags: 'u' + }, + range: [8, 16], + loc: { + start: { line: 1, column: 8 }, + end: { line: 1, column: 16 } + } + }] }, - 'x + y - z': { - type: 'ExpressionStatement', - expression: { - type: 'BinaryExpression', - operator: '-', - left: { - type: 'BinaryExpression', - operator: '+', - left: { + 'var x = /[\\u{0000000000000061}-\\u{7A}]/u': { + type: 'Program', + body: [{ + type: 'VariableDeclaration', + declarations: [{ + type: 'VariableDeclarator', + id: { type: 'Identifier', name: 'x', - range: [0, 1], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 1 } - } - }, - right: { - type: 'Identifier', - name: 'y', range: [4, 5], loc: { start: { line: 1, column: 4 }, end: { line: 1, column: 5 } } }, - range: [0, 5], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 5 } - } - }, - right: { - type: 'Identifier', - name: 'z', - range: [8, 9], + init: { + type: 'Literal', + value: null, + raw: '/[\\u{0000000000000061}-\\u{7A}]/u', + regex: { + pattern: '[\\u{0000000000000061}-\\u{7A}]', + flags: 'u' + }, + range: [8, 40], + loc: { + start: { line: 1, column: 8 }, + end: { line: 1, column: 40 } + } + }, + range: [4, 40], loc: { - start: { line: 1, column: 8 }, - end: { line: 1, column: 9 } + start: { line: 1, column: 4 }, + end: { line: 1, column: 40 } } - }, - range: [0, 9], + }], + kind: 'var', + range: [0, 40], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 9 } + end: { line: 1, column: 40 } } - }, - range: [0, 9], + }], + range: [0, 40], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 9 } - } + end: { line: 1, column: 40 } + }, + tokens: [{ + type: 'Keyword', + value: 'var', + range: [0, 3], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 3 } + } + }, { + type: 'Identifier', + value: 'x', + range: [4, 5], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 5 } + } + }, { + type: 'Punctuator', + value: '=', + range: [6, 7], + loc: { + start: { line: 1, column: 6 }, + end: { line: 1, column: 7 } + } + }, { + type: 'RegularExpression', + value: '/[\\u{0000000000000061}-\\u{7A}]/u', + regex: { + pattern: '[\\u{0000000000000061}-\\u{7A}]', + flags: 'u' + }, + range: [8, 40], + loc: { + start: { line: 1, column: 8 }, + end: { line: 1, column: 40 } + } + }] }, - 'x - y - z': { - type: 'ExpressionStatement', - expression: { - type: 'BinaryExpression', - operator: '-', - left: { - type: 'BinaryExpression', - operator: '-', - left: { + 'var x = /\\u{110000}/u': { + index: 21, + lineNumber: 1, + column: 22, + message: 'Error: Line 1: Invalid regular expression' + }, + + 'var x = /[x-z]/i': { + type: 'Program', + body: [{ + type: 'VariableDeclaration', + declarations: [{ + type: 'VariableDeclarator', + id: { type: 'Identifier', name: 'x', - range: [0, 1], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 1 } - } + range: [4, 5] }, - right: { + init: { + type: 'Literal', + value: '/[x-z]/i', + raw: '/[x-z]/i', + regex: { + pattern: '[x-z]', + flags: 'i' + }, + range: [8, 16] + }, + range: [4, 16] + }], + kind: 'var', + range: [0, 16] + }], + range: [0, 16], + tokens: [{ + type: 'Keyword', + value: 'var', + range: [0, 3] + }, { + type: 'Identifier', + value: 'x', + range: [4, 5] + }, { + type: 'Punctuator', + value: '=', + range: [6, 7] + }, { + type: 'RegularExpression', + value: '/[x-z]/i', + regex: { + pattern: '[x-z]', + flags: 'i' + }, + range: [8, 16] + }] + }, + + 'var x = /[a-c]/i': { + type: 'Program', + body: [{ + type: 'VariableDeclaration', + declarations: [{ + type: 'VariableDeclarator', + id: { type: 'Identifier', - name: 'y', - range: [4, 5], + name: 'x', loc: { start: { line: 1, column: 4 }, end: { line: 1, column: 5 } } }, - range: [0, 5], + init: { + type: 'Literal', + value: '/[a-c]/i', + raw: '/[a-c]/i', + regex: { + pattern: '[a-c]', + flags: 'i' + }, + loc: { + start: { line: 1, column: 8 }, + end: { line: 1, column: 16 } + } + }, loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 5 } + start: { line: 1, column: 4 }, + end: { line: 1, column: 16 } } - }, - right: { - type: 'Identifier', - name: 'z', - range: [8, 9], - loc: { - start: { line: 1, column: 8 }, - end: { line: 1, column: 9 } - } - }, - range: [0, 9], + }], + kind: 'var', loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 9 } + end: { line: 1, column: 16 } } - }, - range: [0, 9], + }], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 9 } - } + end: { line: 1, column: 16 } + }, + tokens: [{ + type: 'Keyword', + value: 'var', + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 3 } + } + }, { + type: 'Identifier', + value: 'x', + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 5 } + } + }, { + type: 'Punctuator', + value: '=', + loc: { + start: { line: 1, column: 6 }, + end: { line: 1, column: 7 } + } + }, { + type: 'RegularExpression', + value: '/[a-c]/i', + regex: { + pattern: '[a-c]', + flags: 'i' + }, + loc: { + start: { line: 1, column: 8 }, + end: { line: 1, column: 16 } + } + }] }, - 'x + y * z': { - type: 'ExpressionStatement', - expression: { - type: 'BinaryExpression', - operator: '+', - left: { - type: 'Identifier', - name: 'x', - range: [0, 1], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 1 } - } - }, - right: { - type: 'BinaryExpression', - operator: '*', - left: { + 'var x = /[P QR]/i': { + type: 'Program', + body: [{ + type: 'VariableDeclaration', + declarations: [{ + type: 'VariableDeclarator', + id: { type: 'Identifier', - name: 'y', + name: 'x', range: [4, 5], loc: { start: { line: 1, column: 4 }, end: { line: 1, column: 5 } } }, - right: { - type: 'Identifier', - name: 'z', - range: [8, 9], + init: { + type: 'Literal', + value: '/[P QR]/i', + raw: '/[P QR]/i', + regex: { + pattern: '[P QR]', + flags: 'i' + }, + range: [8, 17], loc: { start: { line: 1, column: 8 }, - end: { line: 1, column: 9 } + end: { line: 1, column: 17 } } }, - range: [4, 9], + range: [4, 17], loc: { start: { line: 1, column: 4 }, - end: { line: 1, column: 9 } + end: { line: 1, column: 17 } } - }, - range: [0, 9], + }], + kind: 'var', + range: [0, 17], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 9 } + end: { line: 1, column: 17 } } - }, - range: [0, 9], + }], + range: [0, 17], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 9 } - } + end: { line: 1, column: 17 } + }, + tokens: [{ + type: 'Keyword', + value: 'var', + range: [0, 3], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 3 } + } + }, { + type: 'Identifier', + value: 'x', + range: [4, 5], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 5 } + } + }, { + type: 'Punctuator', + value: '=', + range: [6, 7], + loc: { + start: { line: 1, column: 6 }, + end: { line: 1, column: 7 } + } + }, { + type: 'RegularExpression', + value: '/[P QR]/i', + regex: { + pattern: '[P QR]', + flags: 'i' + }, + range: [8, 17], + loc: { + start: { line: 1, column: 8 }, + end: { line: 1, column: 17 } + } + }] }, - 'x + y / z': { - type: 'ExpressionStatement', - expression: { - type: 'BinaryExpression', - operator: '+', - left: { - type: 'Identifier', - name: 'x', - range: [0, 1], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 1 } - } - }, - right: { - type: 'BinaryExpression', - operator: '/', - left: { + 'var x = /[\\]/]/': { + type: 'Program', + body: [{ + type: 'VariableDeclaration', + declarations: [{ + type: 'VariableDeclarator', + id: { type: 'Identifier', - name: 'y', + name: 'x', range: [4, 5], loc: { start: { line: 1, column: 4 }, end: { line: 1, column: 5 } } }, - right: { - type: 'Identifier', - name: 'z', - range: [8, 9], + init: { + type: 'Literal', + value: new RegExp('[\\]/]').toString(), + raw: '/[\\]/]/', + regex: { + pattern: '[\\]/]', + flags: '' + }, + range: [8, 15], loc: { start: { line: 1, column: 8 }, - end: { line: 1, column: 9 } + end: { line: 1, column: 15 } } }, - range: [4, 9], + range: [4, 15], loc: { start: { line: 1, column: 4 }, - end: { line: 1, column: 9 } + end: { line: 1, column: 15 } } - }, - range: [0, 9], + }], + kind: 'var', + range: [0, 15], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 9 } + end: { line: 1, column: 15 } } - }, - range: [0, 9], + }], + range: [0, 15], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 9 } - } + end: { line: 1, column: 15 } + }, + tokens: [{ + type: 'Keyword', + value: 'var', + range: [0, 3], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 3 } + } + }, { + type: 'Identifier', + value: 'x', + range: [4, 5], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 5 } + } + }, { + type: 'Punctuator', + value: '=', + range: [6, 7], + loc: { + start: { line: 1, column: 6 }, + end: { line: 1, column: 7 } + } + }, { + type: 'RegularExpression', + value: '/[\\]/]/', + regex: { + pattern: '[\\]/]', + flags: '' + }, + range: [8, 15], + loc: { + start: { line: 1, column: 8 }, + end: { line: 1, column: 15 } + } + }] }, - 'x - y % z': { - type: 'ExpressionStatement', - expression: { - type: 'BinaryExpression', - operator: '-', - left: { - type: 'Identifier', - name: 'x', - range: [0, 1], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 1 } - } - }, - right: { - type: 'BinaryExpression', - operator: '%', - left: { + 'var x = /foo\\/bar/': { + type: 'Program', + body: [{ + type: 'VariableDeclaration', + declarations: [{ + type: 'VariableDeclarator', + id: { type: 'Identifier', - name: 'y', + name: 'x', range: [4, 5], loc: { start: { line: 1, column: 4 }, end: { line: 1, column: 5 } } }, - right: { - type: 'Identifier', - name: 'z', - range: [8, 9], + init: { + type: 'Literal', + value: '/foo\\/bar/', + raw: '/foo\\/bar/', + regex: { + pattern: 'foo\\/bar', + flags: '' + }, + range: [8, 18], loc: { start: { line: 1, column: 8 }, - end: { line: 1, column: 9 } + end: { line: 1, column: 18 } } }, - range: [4, 9], + range: [4, 18], loc: { start: { line: 1, column: 4 }, - end: { line: 1, column: 9 } + end: { line: 1, column: 18 } } - }, - range: [0, 9], + }], + kind: 'var', + range: [0, 18], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 9 } + end: { line: 1, column: 18 } } - }, - range: [0, 9], + }], + range: [0, 18], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 9 } - } + end: { line: 1, column: 18 } + }, + tokens: [{ + type: 'Keyword', + value: 'var', + range: [0, 3], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 3 } + } + }, { + type: 'Identifier', + value: 'x', + range: [4, 5], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 5 } + } + }, { + type: 'Punctuator', + value: '=', + range: [6, 7], + loc: { + start: { line: 1, column: 6 }, + end: { line: 1, column: 7 } + } + }, { + type: 'RegularExpression', + value: '/foo\\/bar/', + regex: { + pattern: 'foo\\/bar', + flags: '' + }, + range: [8, 18], + loc: { + start: { line: 1, column: 8 }, + end: { line: 1, column: 18 } + } + }] }, - 'x * y * z': { - type: 'ExpressionStatement', - expression: { - type: 'BinaryExpression', - operator: '*', - left: { - type: 'BinaryExpression', - operator: '*', - left: { + 'var x = /=([^=\\s])+/g': { + type: 'Program', + body: [{ + type: 'VariableDeclaration', + declarations: [{ + type: 'VariableDeclarator', + id: { type: 'Identifier', name: 'x', - range: [0, 1], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 1 } - } - }, - right: { - type: 'Identifier', - name: 'y', range: [4, 5], loc: { start: { line: 1, column: 4 }, end: { line: 1, column: 5 } } }, - range: [0, 5], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 5 } - } - }, - right: { - type: 'Identifier', - name: 'z', - range: [8, 9], + init: { + type: 'Literal', + value: '/=([^=\\s])+/g', + raw: '/=([^=\\s])+/g', + regex: { + pattern: '=([^=\\s])+', + flags: 'g' + }, + range: [8, 21], + loc: { + start: { line: 1, column: 8 }, + end: { line: 1, column: 21 } + } + }, + range: [4, 21], loc: { - start: { line: 1, column: 8 }, - end: { line: 1, column: 9 } + start: { line: 1, column: 4 }, + end: { line: 1, column: 21 } } - }, - range: [0, 9], + }], + kind: 'var', + range: [0, 21], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 9 } + end: { line: 1, column: 21 } } - }, - range: [0, 9], + }], + range: [0, 21], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 9 } - } + end: { line: 1, column: 21 } + }, + tokens: [{ + type: 'Keyword', + value: 'var', + range: [0, 3], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 3 } + } + }, { + type: 'Identifier', + value: 'x', + range: [4, 5], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 5 } + } + }, { + type: 'Punctuator', + value: '=', + range: [6, 7], + loc: { + start: { line: 1, column: 6 }, + end: { line: 1, column: 7 } + } + }, { + type: 'RegularExpression', + value: '/=([^=\\s])+/g', + regex: { + pattern: '=([^=\\s])+', + flags: 'g' + }, + range: [8, 21], + loc: { + start: { line: 1, column: 8 }, + end: { line: 1, column: 21 } + } + }] }, - 'x * y / z': { - type: 'ExpressionStatement', - expression: { - type: 'BinaryExpression', - operator: '/', - left: { - type: 'BinaryExpression', - operator: '*', - left: { - type: 'Identifier', - name: 'x', - range: [0, 1], + 'var x = /42/g.test': { + type: 'VariableDeclaration', + declarations: [{ + type: 'VariableDeclarator', + id: { + type: 'Identifier', + name: 'x', + range: [4, 5], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 5 } + } + }, + init: { + type: 'MemberExpression', + computed: false, + object: { + type: 'Literal', + value: '/42/g', + raw: '/42/g', + regex: { + pattern: '42', + flags: 'g' + }, + range: [8, 13], loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 1 } + start: { line: 1, column: 8 }, + end: { line: 1, column: 13 } } }, - right: { + property: { type: 'Identifier', - name: 'y', - range: [4, 5], + name: 'test', + range: [14, 18], loc: { - start: { line: 1, column: 4 }, - end: { line: 1, column: 5 } + start: { line: 1, column: 14 }, + end: { line: 1, column: 18 } } }, - range: [0, 5], + range: [8, 18], loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 5 } + start: { line: 1, column: 8 }, + end: { line: 1, column: 18 } } }, - right: { + range: [4, 18], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 18 } + } + }], + kind: 'var', + range: [0, 18], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 18 } + } + } + + }, + + 'Left-Hand-Side Expression': { + + 'new Button': { + type: 'ExpressionStatement', + expression: { + type: 'NewExpression', + callee: { type: 'Identifier', - name: 'z', - range: [8, 9], + name: 'Button', + range: [4, 10], loc: { - start: { line: 1, column: 8 }, - end: { line: 1, column: 9 } + start: { line: 1, column: 4 }, + end: { line: 1, column: 10 } } }, - range: [0, 9], + 'arguments': [], + range: [0, 10], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 9 } + end: { line: 1, column: 10 } } }, - range: [0, 9], + range: [0, 10], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 9 } + end: { line: 1, column: 10 } } }, - 'x * y % z': { + 'new Button()': { type: 'ExpressionStatement', expression: { - type: 'BinaryExpression', - operator: '%', - left: { - type: 'BinaryExpression', - operator: '*', - left: { - type: 'Identifier', - name: 'x', - range: [0, 1], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 1 } - } - }, - right: { - type: 'Identifier', - name: 'y', - range: [4, 5], - loc: { - start: { line: 1, column: 4 }, - end: { line: 1, column: 5 } - } - }, - range: [0, 5], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 5 } - } - }, - right: { + type: 'NewExpression', + callee: { type: 'Identifier', - name: 'z', - range: [8, 9], + name: 'Button', + range: [4, 10], loc: { - start: { line: 1, column: 8 }, - end: { line: 1, column: 9 } + start: { line: 1, column: 4 }, + end: { line: 1, column: 10 } } }, - range: [0, 9], + 'arguments': [], + range: [0, 12], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 9 } + end: { line: 1, column: 12 } } }, - range: [0, 9], + range: [0, 12], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 9 } + end: { line: 1, column: 12 } } }, - 'x % y * z': { + 'new new foo': { type: 'ExpressionStatement', expression: { - type: 'BinaryExpression', - operator: '*', - left: { - type: 'BinaryExpression', - operator: '%', - left: { - type: 'Identifier', - name: 'x', - range: [0, 1], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 1 } - } - }, - right: { + type: 'NewExpression', + callee: { + type: 'NewExpression', + callee: { type: 'Identifier', - name: 'y', - range: [4, 5], + name: 'foo', + range: [8, 11], loc: { - start: { line: 1, column: 4 }, - end: { line: 1, column: 5 } + start: { line: 1, column: 8 }, + end: { line: 1, column: 11 } } }, - range: [0, 5], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 5 } - } - }, - right: { - type: 'Identifier', - name: 'z', - range: [8, 9], + 'arguments': [], + range: [4, 11], loc: { - start: { line: 1, column: 8 }, - end: { line: 1, column: 9 } + start: { line: 1, column: 4 }, + end: { line: 1, column: 11 } } }, - range: [0, 9], + 'arguments': [], + range: [0, 11], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 9 } + end: { line: 1, column: 11 } } }, - range: [0, 9], + range: [0, 11], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 9 } + end: { line: 1, column: 11 } } }, - 'x << y << z': { + 'new new foo()': { type: 'ExpressionStatement', expression: { - type: 'BinaryExpression', - operator: '<<', - left: { - type: 'BinaryExpression', - operator: '<<', - left: { - type: 'Identifier', - name: 'x', - range: [0, 1], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 1 } - } - }, - right: { + type: 'NewExpression', + callee: { + type: 'NewExpression', + callee: { type: 'Identifier', - name: 'y', - range: [5, 6], + name: 'foo', + range: [8, 11], loc: { - start: { line: 1, column: 5 }, - end: { line: 1, column: 6 } + start: { line: 1, column: 8 }, + end: { line: 1, column: 11 } } }, - range: [0, 6], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 6 } - } - }, - right: { - type: 'Identifier', - name: 'z', - range: [10, 11], + 'arguments': [], + range: [4, 13], loc: { - start: { line: 1, column: 10 }, - end: { line: 1, column: 11 } + start: { line: 1, column: 4 }, + end: { line: 1, column: 13 } } }, - range: [0, 11], + 'arguments': [], + range: [0, 13], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 11 } + end: { line: 1, column: 13 } } }, - range: [0, 11], + range: [0, 13], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 11 } + end: { line: 1, column: 13 } } }, - 'x | y | z': { + 'new foo().bar()': { type: 'ExpressionStatement', expression: { - type: 'BinaryExpression', - operator: '|', - left: { - type: 'BinaryExpression', - operator: '|', - left: { - type: 'Identifier', - name: 'x', - range: [0, 1], + type: 'CallExpression', + callee: { + type: 'MemberExpression', + computed: false, + object: { + type: 'NewExpression', + callee: { + type: 'Identifier', + name: 'foo', + range: [4, 7], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 7 } + } + }, + 'arguments': [], + range: [0, 9], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 1 } + end: { line: 1, column: 9 } } }, - right: { + property: { type: 'Identifier', - name: 'y', - range: [4, 5], + name: 'bar', + range: [10, 13], loc: { - start: { line: 1, column: 4 }, - end: { line: 1, column: 5 } + start: { line: 1, column: 10 }, + end: { line: 1, column: 13 } } }, - range: [0, 5], + range: [0, 13], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 5 } - } - }, - right: { - type: 'Identifier', - name: 'z', - range: [8, 9], - loc: { - start: { line: 1, column: 8 }, - end: { line: 1, column: 9 } + end: { line: 1, column: 13 } } }, - range: [0, 9], + 'arguments': [], + range: [0, 15], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 9 } + end: { line: 1, column: 15 } } }, - range: [0, 9], + range: [0, 15], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 9 } + end: { line: 1, column: 15 } } }, - 'x & y & z': { + 'new foo[bar]': { type: 'ExpressionStatement', expression: { - type: 'BinaryExpression', - operator: '&', - left: { - type: 'BinaryExpression', - operator: '&', - left: { + type: 'NewExpression', + callee: { + type: 'MemberExpression', + computed: true, + object: { type: 'Identifier', - name: 'x', - range: [0, 1], + name: 'foo', + range: [4, 7], loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 1 } + start: { line: 1, column: 4 }, + end: { line: 1, column: 7 } } }, - right: { + property: { type: 'Identifier', - name: 'y', - range: [4, 5], + name: 'bar', + range: [8, 11], loc: { - start: { line: 1, column: 4 }, - end: { line: 1, column: 5 } + start: { line: 1, column: 8 }, + end: { line: 1, column: 11 } } }, - range: [0, 5], + range: [4, 12], loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 5 } + start: { line: 1, column: 4 }, + end: { line: 1, column: 12 } } }, - right: { - type: 'Identifier', - name: 'z', - range: [8, 9], - loc: { - start: { line: 1, column: 8 }, - end: { line: 1, column: 9 } - } - }, - range: [0, 9], + 'arguments': [], + range: [0, 12], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 9 } + end: { line: 1, column: 12 } } }, - range: [0, 9], + range: [0, 12], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 9 } + end: { line: 1, column: 12 } } }, - 'x ^ y ^ z': { + 'new foo.bar()': { type: 'ExpressionStatement', expression: { - type: 'BinaryExpression', - operator: '^', - left: { - type: 'BinaryExpression', - operator: '^', - left: { + type: 'NewExpression', + callee: { + type: 'MemberExpression', + computed: false, + object: { type: 'Identifier', - name: 'x', - range: [0, 1], + name: 'foo', + range: [4, 7], loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 1 } + start: { line: 1, column: 4 }, + end: { line: 1, column: 7 } } }, - right: { + property: { type: 'Identifier', - name: 'y', - range: [4, 5], + name: 'bar', + range: [8, 11], loc: { - start: { line: 1, column: 4 }, - end: { line: 1, column: 5 } + start: { line: 1, column: 8 }, + end: { line: 1, column: 11 } } }, - range: [0, 5], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 5 } - } - }, - right: { - type: 'Identifier', - name: 'z', - range: [8, 9], + range: [4, 11], loc: { - start: { line: 1, column: 8 }, - end: { line: 1, column: 9 } + start: { line: 1, column: 4 }, + end: { line: 1, column: 11 } } }, - range: [0, 9], + 'arguments': [], + range: [0, 13], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 9 } + end: { line: 1, column: 13 } } }, - range: [0, 9], + range: [0, 13], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 9 } + end: { line: 1, column: 13 } } }, - 'x & y | z': { + '( new foo).bar()': { type: 'ExpressionStatement', expression: { - type: 'BinaryExpression', - operator: '|', - left: { - type: 'BinaryExpression', - operator: '&', - left: { - type: 'Identifier', - name: 'x', - range: [0, 1], + type: 'CallExpression', + callee: { + type: 'MemberExpression', + computed: false, + object: { + type: 'NewExpression', + callee: { + type: 'Identifier', + name: 'foo', + range: [6, 9], + loc: { + start: { line: 1, column: 6 }, + end: { line: 1, column: 9 } + } + }, + 'arguments': [], + range: [2, 9], loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 1 } + start: { line: 1, column: 2 }, + end: { line: 1, column: 9 } } }, - right: { + property: { type: 'Identifier', - name: 'y', - range: [4, 5], + name: 'bar', + range: [11, 14], loc: { - start: { line: 1, column: 4 }, - end: { line: 1, column: 5 } + start: { line: 1, column: 11 }, + end: { line: 1, column: 14 } } }, - range: [0, 5], + range: [0, 14], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 5 } - } - }, - right: { - type: 'Identifier', - name: 'z', - range: [8, 9], - loc: { - start: { line: 1, column: 8 }, - end: { line: 1, column: 9 } + end: { line: 1, column: 14 } } }, - range: [0, 9], + 'arguments': [], + range: [0, 16], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 9 } + end: { line: 1, column: 16 } } }, - range: [0, 9], + range: [0, 16], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 9 } + end: { line: 1, column: 16 } } }, - 'x | y ^ z': { + 'foo(bar, baz)': { type: 'ExpressionStatement', expression: { - type: 'BinaryExpression', - operator: '|', - left: { + type: 'CallExpression', + callee: { type: 'Identifier', - name: 'x', - range: [0, 1], + name: 'foo', + range: [0, 3], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 1 } + end: { line: 1, column: 3 } } }, - right: { - type: 'BinaryExpression', - operator: '^', - left: { - type: 'Identifier', - name: 'y', - range: [4, 5], - loc: { - start: { line: 1, column: 4 }, - end: { line: 1, column: 5 } - } - }, - right: { - type: 'Identifier', - name: 'z', - range: [8, 9], - loc: { - start: { line: 1, column: 8 }, - end: { line: 1, column: 9 } - } - }, - range: [4, 9], + 'arguments': [{ + type: 'Identifier', + name: 'bar', + range: [4, 7], loc: { start: { line: 1, column: 4 }, - end: { line: 1, column: 9 } + end: { line: 1, column: 7 } } - }, - range: [0, 9], + }, { + type: 'Identifier', + name: 'baz', + range: [9, 12], + loc: { + start: { line: 1, column: 9 }, + end: { line: 1, column: 12 } + } + }], + range: [0, 13], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 9 } + end: { line: 1, column: 13 } } }, - range: [0, 9], + range: [0, 13], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 9 } + end: { line: 1, column: 13 } } }, - 'x | y & z': { + '( foo )()': { type: 'ExpressionStatement', expression: { - type: 'BinaryExpression', - operator: '|', - left: { + type: 'CallExpression', + callee: { type: 'Identifier', - name: 'x', - range: [0, 1], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 1 } - } - }, - right: { - type: 'BinaryExpression', - operator: '&', - left: { - type: 'Identifier', - name: 'y', - range: [4, 5], - loc: { - start: { line: 1, column: 4 }, - end: { line: 1, column: 5 } - } - }, - right: { - type: 'Identifier', - name: 'z', - range: [8, 9], - loc: { - start: { line: 1, column: 8 }, - end: { line: 1, column: 9 } - } - }, - range: [4, 9], + name: 'foo', + range: [5, 8], loc: { - start: { line: 1, column: 4 }, - end: { line: 1, column: 9 } + start: { line: 1, column: 5 }, + end: { line: 1, column: 8 } } }, - range: [0, 9], + 'arguments': [], + range: [0, 13], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 9 } + end: { line: 1, column: 13 } } }, - range: [0, 9], + range: [0, 13], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 9 } + end: { line: 1, column: 13 } } - } - - }, - - 'Binary Logical Operators': { + }, - 'x || y': { + 'universe.milkyway': { type: 'ExpressionStatement', expression: { - type: 'LogicalExpression', - operator: '||', - left: { - type: 'Identifier', - name: 'x', - range: [0, 1], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 1 } - } - }, - right: { - type: 'Identifier', - name: 'y', - range: [5, 6], - loc: { - start: { line: 1, column: 5 }, - end: { line: 1, column: 6 } - } - }, - range: [0, 6], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 6 } - } - }, - range: [0, 6], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 6 } - } - }, - - 'x && y': { - type: 'ExpressionStatement', - expression: { - type: 'LogicalExpression', - operator: '&&', - left: { + type: 'MemberExpression', + computed: false, + object: { type: 'Identifier', - name: 'x', - range: [0, 1], + name: 'universe', + range: [0, 8], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 1 } + end: { line: 1, column: 8 } } }, - right: { + property: { type: 'Identifier', - name: 'y', - range: [5, 6], + name: 'milkyway', + range: [9, 17], loc: { - start: { line: 1, column: 5 }, - end: { line: 1, column: 6 } + start: { line: 1, column: 9 }, + end: { line: 1, column: 17 } } }, - range: [0, 6], + range: [0, 17], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 6 } + end: { line: 1, column: 17 } } }, - range: [0, 6], + range: [0, 17], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 6 } + end: { line: 1, column: 17 } } }, - 'x || y || z': { + 'universe.milkyway.solarsystem': { type: 'ExpressionStatement', expression: { - type: 'LogicalExpression', - operator: '||', - left: { - type: 'LogicalExpression', - operator: '||', - left: { + type: 'MemberExpression', + computed: false, + object: { + type: 'MemberExpression', + computed: false, + object: { type: 'Identifier', - name: 'x', - range: [0, 1], + name: 'universe', + range: [0, 8], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 1 } + end: { line: 1, column: 8 } } }, - right: { + property: { type: 'Identifier', - name: 'y', - range: [5, 6], + name: 'milkyway', + range: [9, 17], loc: { - start: { line: 1, column: 5 }, - end: { line: 1, column: 6 } + start: { line: 1, column: 9 }, + end: { line: 1, column: 17 } } }, - range: [0, 6], + range: [0, 17], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 6 } + end: { line: 1, column: 17 } } }, - right: { + property: { type: 'Identifier', - name: 'z', - range: [10, 11], + name: 'solarsystem', + range: [18, 29], loc: { - start: { line: 1, column: 10 }, - end: { line: 1, column: 11 } + start: { line: 1, column: 18 }, + end: { line: 1, column: 29 } } }, - range: [0, 11], + range: [0, 29], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 11 } + end: { line: 1, column: 29 } } }, - range: [0, 11], + range: [0, 29], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 11 } + end: { line: 1, column: 29 } } }, - 'x && y && z': { + 'universe.milkyway.solarsystem.Earth': { type: 'ExpressionStatement', expression: { - type: 'LogicalExpression', - operator: '&&', - left: { - type: 'LogicalExpression', - operator: '&&', - left: { - type: 'Identifier', - name: 'x', - range: [0, 1], + type: 'MemberExpression', + computed: false, + object: { + type: 'MemberExpression', + computed: false, + object: { + type: 'MemberExpression', + computed: false, + object: { + type: 'Identifier', + name: 'universe', + range: [0, 8], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 8 } + } + }, + property: { + type: 'Identifier', + name: 'milkyway', + range: [9, 17], + loc: { + start: { line: 1, column: 9 }, + end: { line: 1, column: 17 } + } + }, + range: [0, 17], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 1 } + end: { line: 1, column: 17 } } }, - right: { + property: { type: 'Identifier', - name: 'y', - range: [5, 6], + name: 'solarsystem', + range: [18, 29], loc: { - start: { line: 1, column: 5 }, - end: { line: 1, column: 6 } + start: { line: 1, column: 18 }, + end: { line: 1, column: 29 } } }, - range: [0, 6], + range: [0, 29], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 6 } + end: { line: 1, column: 29 } } }, - right: { + property: { type: 'Identifier', - name: 'z', - range: [10, 11], + name: 'Earth', + range: [30, 35], loc: { - start: { line: 1, column: 10 }, - end: { line: 1, column: 11 } + start: { line: 1, column: 30 }, + end: { line: 1, column: 35 } } }, - range: [0, 11], + range: [0, 35], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 11 } + end: { line: 1, column: 35 } } }, - range: [0, 11], + range: [0, 35], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 11 } + end: { line: 1, column: 35 } } }, - 'x || y && z': { + 'universe[galaxyName, otherUselessName]': { type: 'ExpressionStatement', expression: { - type: 'LogicalExpression', - operator: '||', - left: { + type: 'MemberExpression', + computed: true, + object: { type: 'Identifier', - name: 'x', - range: [0, 1], + name: 'universe', + range: [0, 8], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 1 } + end: { line: 1, column: 8 } } }, - right: { - type: 'LogicalExpression', - operator: '&&', - left: { + property: { + type: 'SequenceExpression', + expressions: [{ type: 'Identifier', - name: 'y', - range: [5, 6], + name: 'galaxyName', + range: [9, 19], loc: { - start: { line: 1, column: 5 }, - end: { line: 1, column: 6 } + start: { line: 1, column: 9 }, + end: { line: 1, column: 19 } } - }, - right: { + }, { type: 'Identifier', - name: 'z', - range: [10, 11], + name: 'otherUselessName', + range: [21, 37], loc: { - start: { line: 1, column: 10 }, - end: { line: 1, column: 11 } + start: { line: 1, column: 21 }, + end: { line: 1, column: 37 } } - }, - range: [5, 11], + }], + range: [9, 37], loc: { - start: { line: 1, column: 5 }, - end: { line: 1, column: 11 } + start: { line: 1, column: 9 }, + end: { line: 1, column: 37 } } }, - range: [0, 11], + range: [0, 38], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 11 } + end: { line: 1, column: 38 } } }, - range: [0, 11], + range: [0, 38], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 11 } + end: { line: 1, column: 38 } } }, - 'x || y ^ z': { + 'universe[galaxyName]': { type: 'ExpressionStatement', expression: { - type: 'LogicalExpression', - operator: '||', - left: { + type: 'MemberExpression', + computed: true, + object: { type: 'Identifier', - name: 'x', - range: [0, 1], + name: 'universe', + range: [0, 8], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 1 } - } - }, - right: { - type: 'BinaryExpression', - operator: '^', - left: { - type: 'Identifier', - name: 'y', - range: [5, 6], - loc: { - start: { line: 1, column: 5 }, - end: { line: 1, column: 6 } - } - }, - right: { - type: 'Identifier', - name: 'z', - range: [9, 10], - loc: { - start: { line: 1, column: 9 }, - end: { line: 1, column: 10 } - } - }, - range: [5, 10], - loc: { - start: { line: 1, column: 5 }, - end: { line: 1, column: 10 } + end: { line: 1, column: 8 } } }, - range: [0, 10], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 10 } - } - }, - range: [0, 10], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 10 } - } - } - - }, - - 'Conditional Operator': { - - 'y ? 1 : 2': { - type: 'ExpressionStatement', - expression: { - type: 'ConditionalExpression', - test: { + property: { type: 'Identifier', - name: 'y', - range: [0, 1], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 1 } - } - }, - consequent: { - type: 'Literal', - value: 1, - raw: '1', - range: [4, 5], - loc: { - start: { line: 1, column: 4 }, - end: { line: 1, column: 5 } - } - }, - alternate: { - type: 'Literal', - value: 2, - raw: '2', - range: [8, 9], + name: 'galaxyName', + range: [9, 19], loc: { - start: { line: 1, column: 8 }, - end: { line: 1, column: 9 } + start: { line: 1, column: 9 }, + end: { line: 1, column: 19 } } }, - range: [0, 9], + range: [0, 20], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 9 } + end: { line: 1, column: 20 } } }, - range: [0, 9], + range: [0, 20], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 9 } + end: { line: 1, column: 20 } } }, - 'x && y ? 1 : 2': { + 'universe[42].galaxies': { type: 'ExpressionStatement', expression: { - type: 'ConditionalExpression', - test: { - type: 'LogicalExpression', - operator: '&&', - left: { + type: 'MemberExpression', + computed: false, + object: { + type: 'MemberExpression', + computed: true, + object: { type: 'Identifier', - name: 'x', - range: [0, 1], + name: 'universe', + range: [0, 8], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 1 } + end: { line: 1, column: 8 } } }, - right: { - type: 'Identifier', - name: 'y', - range: [5, 6], + property: { + type: 'Literal', + value: 42, + raw: '42', + range: [9, 11], loc: { - start: { line: 1, column: 5 }, - end: { line: 1, column: 6 } + start: { line: 1, column: 9 }, + end: { line: 1, column: 11 } } }, - range: [0, 6], + range: [0, 12], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 6 } - } - }, - consequent: { - type: 'Literal', - value: 1, - raw: '1', - range: [9, 10], - loc: { - start: { line: 1, column: 9 }, - end: { line: 1, column: 10 } - } - }, - alternate: { - type: 'Literal', - value: 2, - raw: '2', - range: [13, 14], - loc: { - start: { line: 1, column: 13 }, - end: { line: 1, column: 14 } + end: { line: 1, column: 12 } } }, - range: [0, 14], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 14 } - } - }, - range: [0, 14], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 14 } - } - } - - }, - - 'Assignment Operators': { - - 'x = 42': { - type: 'ExpressionStatement', - expression: { - type: 'AssignmentExpression', - operator: '=', - left: { + property: { type: 'Identifier', - name: 'x', - range: [0, 1], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 1 } - } - }, - right: { - type: 'Literal', - value: 42, - raw: '42', - range: [4, 6], + name: 'galaxies', + range: [13, 21], loc: { - start: { line: 1, column: 4 }, - end: { line: 1, column: 6 } + start: { line: 1, column: 13 }, + end: { line: 1, column: 21 } } }, - range: [0, 6], + range: [0, 21], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 6 } + end: { line: 1, column: 21 } } }, - range: [0, 6], + range: [0, 21], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 6 } + end: { line: 1, column: 21 } } }, - 'eval = 42': { + 'universe(42).galaxies': { type: 'ExpressionStatement', expression: { - type: 'AssignmentExpression', - operator: '=', - left: { - type: 'Identifier', - name: 'eval', - range: [0, 4], + type: 'MemberExpression', + computed: false, + object: { + type: 'CallExpression', + callee: { + type: 'Identifier', + name: 'universe', + range: [0, 8], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 8 } + } + }, + 'arguments': [{ + type: 'Literal', + value: 42, + raw: '42', + range: [9, 11], + loc: { + start: { line: 1, column: 9 }, + end: { line: 1, column: 11 } + } + }], + range: [0, 12], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 4 } + end: { line: 1, column: 12 } } }, - right: { - type: 'Literal', - value: 42, - raw: '42', - range: [7, 9], + property: { + type: 'Identifier', + name: 'galaxies', + range: [13, 21], loc: { - start: { line: 1, column: 7 }, - end: { line: 1, column: 9 } + start: { line: 1, column: 13 }, + end: { line: 1, column: 21 } } }, - range: [0, 9], + range: [0, 21], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 9 } + end: { line: 1, column: 21 } } }, - range: [0, 9], + range: [0, 21], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 9 } + end: { line: 1, column: 21 } } }, - 'arguments = 42': { + 'universe(42).galaxies(14, 3, 77).milkyway': { type: 'ExpressionStatement', expression: { - type: 'AssignmentExpression', - operator: '=', - left: { - type: 'Identifier', - name: 'arguments', - range: [0, 9], + type: 'MemberExpression', + computed: false, + object: { + type: 'CallExpression', + callee: { + type: 'MemberExpression', + computed: false, + object: { + type: 'CallExpression', + callee: { + type: 'Identifier', + name: 'universe', + range: [0, 8], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 8 } + } + }, + 'arguments': [{ + type: 'Literal', + value: 42, + raw: '42', + range: [9, 11], + loc: { + start: { line: 1, column: 9 }, + end: { line: 1, column: 11 } + } + }], + range: [0, 12], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 12 } + } + }, + property: { + type: 'Identifier', + name: 'galaxies', + range: [13, 21], + loc: { + start: { line: 1, column: 13 }, + end: { line: 1, column: 21 } + } + }, + range: [0, 21], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 21 } + } + }, + 'arguments': [{ + type: 'Literal', + value: 14, + raw: '14', + range: [22, 24], + loc: { + start: { line: 1, column: 22 }, + end: { line: 1, column: 24 } + } + }, { + type: 'Literal', + value: 3, + raw: '3', + range: [26, 27], + loc: { + start: { line: 1, column: 26 }, + end: { line: 1, column: 27 } + } + }, { + type: 'Literal', + value: 77, + raw: '77', + range: [29, 31], + loc: { + start: { line: 1, column: 29 }, + end: { line: 1, column: 31 } + } + }], + range: [0, 32], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 9 } + end: { line: 1, column: 32 } } }, - right: { - type: 'Literal', - value: 42, - raw: '42', - range: [12, 14], + property: { + type: 'Identifier', + name: 'milkyway', + range: [33, 41], loc: { - start: { line: 1, column: 12 }, - end: { line: 1, column: 14 } + start: { line: 1, column: 33 }, + end: { line: 1, column: 41 } } }, - range: [0, 14], + range: [0, 41], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 14 } + end: { line: 1, column: 41 } } }, - range: [0, 14], + range: [0, 41], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 14 } + end: { line: 1, column: 41 } } }, - 'x *= 42': { + 'earth.asia.Indonesia.prepareForElection(2014)': { type: 'ExpressionStatement', expression: { - type: 'AssignmentExpression', - operator: '*=', - left: { - type: 'Identifier', - name: 'x', - range: [0, 1], + type: 'CallExpression', + callee: { + type: 'MemberExpression', + computed: false, + object: { + type: 'MemberExpression', + computed: false, + object: { + type: 'MemberExpression', + computed: false, + object: { + type: 'Identifier', + name: 'earth', + range: [0, 5], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 5 } + } + }, + property: { + type: 'Identifier', + name: 'asia', + range: [6, 10], + loc: { + start: { line: 1, column: 6 }, + end: { line: 1, column: 10 } + } + }, + range: [0, 10], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 10 } + } + }, + property: { + type: 'Identifier', + name: 'Indonesia', + range: [11, 20], + loc: { + start: { line: 1, column: 11 }, + end: { line: 1, column: 20 } + } + }, + range: [0, 20], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 20 } + } + }, + property: { + type: 'Identifier', + name: 'prepareForElection', + range: [21, 39], + loc: { + start: { line: 1, column: 21 }, + end: { line: 1, column: 39 } + } + }, + range: [0, 39], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 1 } + end: { line: 1, column: 39 } } }, - right: { + 'arguments': [{ type: 'Literal', - value: 42, - raw: '42', - range: [5, 7], + value: 2014, + raw: '2014', + range: [40, 44], loc: { - start: { line: 1, column: 5 }, - end: { line: 1, column: 7 } + start: { line: 1, column: 40 }, + end: { line: 1, column: 44 } } - }, - range: [0, 7], + }], + range: [0, 45], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 7 } + end: { line: 1, column: 45 } } }, - range: [0, 7], + range: [0, 45], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 7 } + end: { line: 1, column: 45 } } }, - 'x /= 42': { + 'universe.if': { type: 'ExpressionStatement', expression: { - type: 'AssignmentExpression', - operator: '/=', - left: { + type: 'MemberExpression', + computed: false, + object: { type: 'Identifier', - name: 'x', - range: [0, 1], + name: 'universe', + range: [0, 8], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 1 } + end: { line: 1, column: 8 } } }, - right: { - type: 'Literal', - value: 42, - raw: '42', - range: [5, 7], + property: { + type: 'Identifier', + name: 'if', + range: [9, 11], loc: { - start: { line: 1, column: 5 }, - end: { line: 1, column: 7 } + start: { line: 1, column: 9 }, + end: { line: 1, column: 11 } } }, - range: [0, 7], + range: [0, 11], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 7 } + end: { line: 1, column: 11 } } }, - range: [0, 7], + range: [0, 11], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 7 } + end: { line: 1, column: 11 } } }, - 'x %= 42': { + 'universe.true': { type: 'ExpressionStatement', expression: { - type: 'AssignmentExpression', - operator: '%=', - left: { + type: 'MemberExpression', + computed: false, + object: { type: 'Identifier', - name: 'x', - range: [0, 1], + name: 'universe', + range: [0, 8], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 1 } + end: { line: 1, column: 8 } } }, - right: { - type: 'Literal', - value: 42, - raw: '42', - range: [5, 7], + property: { + type: 'Identifier', + name: 'true', + range: [9, 13], loc: { - start: { line: 1, column: 5 }, - end: { line: 1, column: 7 } + start: { line: 1, column: 9 }, + end: { line: 1, column: 13 } } }, - range: [0, 7], + range: [0, 13], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 7 } + end: { line: 1, column: 13 } } }, - range: [0, 7], + range: [0, 13], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 7 } + end: { line: 1, column: 13 } } }, - 'x += 42': { + 'universe.false': { type: 'ExpressionStatement', expression: { - type: 'AssignmentExpression', - operator: '+=', - left: { + type: 'MemberExpression', + computed: false, + object: { type: 'Identifier', - name: 'x', - range: [0, 1], + name: 'universe', + range: [0, 8], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 1 } + end: { line: 1, column: 8 } } }, - right: { - type: 'Literal', - value: 42, - raw: '42', - range: [5, 7], + property: { + type: 'Identifier', + name: 'false', + range: [9, 14], loc: { - start: { line: 1, column: 5 }, - end: { line: 1, column: 7 } + start: { line: 1, column: 9 }, + end: { line: 1, column: 14 } } }, - range: [0, 7], + range: [0, 14], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 7 } + end: { line: 1, column: 14 } } }, - range: [0, 7], + range: [0, 14], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 7 } + end: { line: 1, column: 14 } } }, - 'x -= 42': { + 'universe.null': { type: 'ExpressionStatement', expression: { - type: 'AssignmentExpression', - operator: '-=', - left: { + type: 'MemberExpression', + computed: false, + object: { type: 'Identifier', - name: 'x', - range: [0, 1], + name: 'universe', + range: [0, 8], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 1 } + end: { line: 1, column: 8 } } }, - right: { - type: 'Literal', - value: 42, - raw: '42', - range: [5, 7], + property: { + type: 'Identifier', + name: 'null', + range: [9, 13], loc: { - start: { line: 1, column: 5 }, - end: { line: 1, column: 7 } + start: { line: 1, column: 9 }, + end: { line: 1, column: 13 } } }, - range: [0, 7], + range: [0, 13], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 7 } + end: { line: 1, column: 13 } } }, - range: [0, 7], + range: [0, 13], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 7 } + end: { line: 1, column: 13 } } - }, + } - 'x <<= 42': { + }, + + 'Postfix Expressions': { + + 'x++': { type: 'ExpressionStatement', expression: { - type: 'AssignmentExpression', - operator: '<<=', - left: { + type: 'UpdateExpression', + operator: '++', + argument: { type: 'Identifier', name: 'x', range: [0, 1], @@ -9283,35 +9448,26 @@ var testFixture = { end: { line: 1, column: 1 } } }, - right: { - type: 'Literal', - value: 42, - raw: '42', - range: [6, 8], - loc: { - start: { line: 1, column: 6 }, - end: { line: 1, column: 8 } - } - }, - range: [0, 8], + prefix: false, + range: [0, 3], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 8 } + end: { line: 1, column: 3 } } }, - range: [0, 8], + range: [0, 3], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 8 } + end: { line: 1, column: 3 } } }, - 'x >>= 42': { + 'x--': { type: 'ExpressionStatement', expression: { - type: 'AssignmentExpression', - operator: '>>=', - left: { + type: 'UpdateExpression', + operator: '--', + argument: { type: 'Identifier', name: 'x', range: [0, 1], @@ -9320,709 +9476,645 @@ var testFixture = { end: { line: 1, column: 1 } } }, - right: { - type: 'Literal', - value: 42, - raw: '42', - range: [6, 8], - loc: { - start: { line: 1, column: 6 }, - end: { line: 1, column: 8 } - } - }, - range: [0, 8], + prefix: false, + range: [0, 3], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 8 } + end: { line: 1, column: 3 } } }, - range: [0, 8], + range: [0, 3], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 8 } + end: { line: 1, column: 3 } } }, - 'x >>>= 42': { + 'eval++': { type: 'ExpressionStatement', expression: { - type: 'AssignmentExpression', - operator: '>>>=', - left: { + type: 'UpdateExpression', + operator: '++', + argument: { type: 'Identifier', - name: 'x', - range: [0, 1], + name: 'eval', + range: [0, 4], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 1 } - } - }, - right: { - type: 'Literal', - value: 42, - raw: '42', - range: [7, 9], - loc: { - start: { line: 1, column: 7 }, - end: { line: 1, column: 9 } + end: { line: 1, column: 4 } } }, - range: [0, 9], + prefix: false, + range: [0, 6], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 9 } + end: { line: 1, column: 6 } } }, - range: [0, 9], + range: [0, 6], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 9 } + end: { line: 1, column: 6 } } }, - 'x &= 42': { + 'eval--': { type: 'ExpressionStatement', expression: { - type: 'AssignmentExpression', - operator: '&=', - left: { + type: 'UpdateExpression', + operator: '--', + argument: { type: 'Identifier', - name: 'x', - range: [0, 1], + name: 'eval', + range: [0, 4], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 1 } - } - }, - right: { - type: 'Literal', - value: 42, - raw: '42', - range: [5, 7], - loc: { - start: { line: 1, column: 5 }, - end: { line: 1, column: 7 } + end: { line: 1, column: 4 } } }, - range: [0, 7], + prefix: false, + range: [0, 6], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 7 } + end: { line: 1, column: 6 } } }, - range: [0, 7], + range: [0, 6], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 7 } + end: { line: 1, column: 6 } } }, - 'x ^= 42': { + 'arguments++': { type: 'ExpressionStatement', expression: { - type: 'AssignmentExpression', - operator: '^=', - left: { + type: 'UpdateExpression', + operator: '++', + argument: { type: 'Identifier', - name: 'x', - range: [0, 1], + name: 'arguments', + range: [0, 9], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 1 } - } - }, - right: { - type: 'Literal', - value: 42, - raw: '42', - range: [5, 7], - loc: { - start: { line: 1, column: 5 }, - end: { line: 1, column: 7 } + end: { line: 1, column: 9 } } }, - range: [0, 7], + prefix: false, + range: [0, 11], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 7 } + end: { line: 1, column: 11 } } }, - range: [0, 7], + range: [0, 11], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 7 } + end: { line: 1, column: 11 } } }, - 'x |= 42': { + 'arguments--': { type: 'ExpressionStatement', expression: { - type: 'AssignmentExpression', - operator: '|=', - left: { + type: 'UpdateExpression', + operator: '--', + argument: { type: 'Identifier', - name: 'x', - range: [0, 1], + name: 'arguments', + range: [0, 9], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 1 } + end: { line: 1, column: 9 } } }, - right: { - type: 'Literal', - value: 42, - raw: '42', - range: [5, 7], - loc: { - start: { line: 1, column: 5 }, - end: { line: 1, column: 7 } - } - }, - range: [0, 7], + prefix: false, + range: [0, 11], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 7 } + end: { line: 1, column: 11 } } }, - range: [0, 7], + range: [0, 11], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 7 } + end: { line: 1, column: 11 } } } }, - 'Block': { + 'Unary Operators': { - '{ foo }': { - type: 'BlockStatement', - body: [{ - type: 'ExpressionStatement', - expression: { + '++x': { + type: 'ExpressionStatement', + expression: { + type: 'UpdateExpression', + operator: '++', + argument: { type: 'Identifier', - name: 'foo', - range: [2, 5], + name: 'x', + range: [2, 3], loc: { start: { line: 1, column: 2 }, - end: { line: 1, column: 5 } + end: { line: 1, column: 3 } } }, - range: [2, 6], + prefix: true, + range: [0, 3], loc: { - start: { line: 1, column: 2 }, - end: { line: 1, column: 6 } + start: { line: 1, column: 0 }, + end: { line: 1, column: 3 } } - }], - range: [0, 7], + }, + range: [0, 3], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 7 } + end: { line: 1, column: 3 } } }, - '{ doThis(); doThat(); }': { - type: 'BlockStatement', - body: [{ - type: 'ExpressionStatement', - expression: { - type: 'CallExpression', - callee: { - type: 'Identifier', - name: 'doThis', - range: [2, 8], - loc: { - start: { line: 1, column: 2 }, - end: { line: 1, column: 8 } - } - }, - 'arguments': [], - range: [2, 10], + '--x': { + type: 'ExpressionStatement', + expression: { + type: 'UpdateExpression', + operator: '--', + argument: { + type: 'Identifier', + name: 'x', + range: [2, 3], loc: { start: { line: 1, column: 2 }, - end: { line: 1, column: 10 } + end: { line: 1, column: 3 } } }, - range: [2, 11], + prefix: true, + range: [0, 3], loc: { - start: { line: 1, column: 2 }, - end: { line: 1, column: 11 } + start: { line: 1, column: 0 }, + end: { line: 1, column: 3 } } - }, { - type: 'ExpressionStatement', - expression: { - type: 'CallExpression', - callee: { - type: 'Identifier', - name: 'doThat', - range: [12, 18], - loc: { - start: { line: 1, column: 12 }, - end: { line: 1, column: 18 } - } - }, - 'arguments': [], - range: [12, 20], + }, + range: [0, 3], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 3 } + } + }, + + '++eval': { + type: 'ExpressionStatement', + expression: { + type: 'UpdateExpression', + operator: '++', + argument: { + type: 'Identifier', + name: 'eval', + range: [2, 6], loc: { - start: { line: 1, column: 12 }, - end: { line: 1, column: 20 } + start: { line: 1, column: 2 }, + end: { line: 1, column: 6 } } }, - range: [12, 21], + prefix: true, + range: [0, 6], loc: { - start: { line: 1, column: 12 }, - end: { line: 1, column: 21 } + start: { line: 1, column: 0 }, + end: { line: 1, column: 6 } } - }], - range: [0, 23], + }, + range: [0, 6], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 23 } + end: { line: 1, column: 6 } } }, - '{}': { - type: 'BlockStatement', - body: [], - range: [0, 2], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 2 } - } - } - - }, - - 'Variable Statement': { - - 'var x': { - type: 'VariableDeclaration', - declarations: [{ - type: 'VariableDeclarator', - id: { + '--eval': { + type: 'ExpressionStatement', + expression: { + type: 'UpdateExpression', + operator: '--', + argument: { type: 'Identifier', - name: 'x', - range: [4, 5], + name: 'eval', + range: [2, 6], loc: { - start: { line: 1, column: 4 }, - end: { line: 1, column: 5 } + start: { line: 1, column: 2 }, + end: { line: 1, column: 6 } } }, - init: null, - range: [4, 5], + prefix: true, + range: [0, 6], loc: { - start: { line: 1, column: 4 }, - end: { line: 1, column: 5 } + start: { line: 1, column: 0 }, + end: { line: 1, column: 6 } } - }], - kind: 'var', - range: [0, 5], + }, + range: [0, 6], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 5 } + end: { line: 1, column: 6 } } }, - 'var x, y;': { - type: 'VariableDeclaration', - declarations: [{ - type: 'VariableDeclarator', - id: { + '++arguments': { + type: 'ExpressionStatement', + expression: { + type: 'UpdateExpression', + operator: '++', + argument: { type: 'Identifier', - name: 'x', - range: [4, 5], + name: 'arguments', + range: [2, 11], loc: { - start: { line: 1, column: 4 }, - end: { line: 1, column: 5 } + start: { line: 1, column: 2 }, + end: { line: 1, column: 11 } } }, - init: null, - range: [4, 5], + prefix: true, + range: [0, 11], loc: { - start: { line: 1, column: 4 }, - end: { line: 1, column: 5 } + start: { line: 1, column: 0 }, + end: { line: 1, column: 11 } } - }, { - type: 'VariableDeclarator', - id: { + }, + range: [0, 11], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 11 } + } + }, + + '--arguments': { + type: 'ExpressionStatement', + expression: { + type: 'UpdateExpression', + operator: '--', + argument: { type: 'Identifier', - name: 'y', - range: [7, 8], + name: 'arguments', + range: [2, 11], loc: { - start: { line: 1, column: 7 }, - end: { line: 1, column: 8 } + start: { line: 1, column: 2 }, + end: { line: 1, column: 11 } } }, - init: null, - range: [7, 8], + prefix: true, + range: [0, 11], loc: { - start: { line: 1, column: 7 }, - end: { line: 1, column: 8 } + start: { line: 1, column: 0 }, + end: { line: 1, column: 11 } } - }], - kind: 'var', - range: [0, 9], + }, + range: [0, 11], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 9 } + end: { line: 1, column: 11 } } }, - 'var x = 42': { - type: 'VariableDeclaration', - declarations: [{ - type: 'VariableDeclarator', - id: { + '+x': { + type: 'ExpressionStatement', + expression: { + type: 'UnaryExpression', + operator: '+', + argument: { type: 'Identifier', name: 'x', - range: [4, 5], + range: [1, 2], loc: { - start: { line: 1, column: 4 }, - end: { line: 1, column: 5 } - } - }, - init: { - type: 'Literal', - value: 42, - raw: '42', - range: [8, 10], - loc: { - start: { line: 1, column: 8 }, - end: { line: 1, column: 10 } + start: { line: 1, column: 1 }, + end: { line: 1, column: 2 } } }, - range: [4, 10], + prefix: true, + range: [0, 2], loc: { - start: { line: 1, column: 4 }, - end: { line: 1, column: 10 } + start: { line: 1, column: 0 }, + end: { line: 1, column: 2 } } - }], - kind: 'var', - range: [0, 10], + }, + range: [0, 2], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 10 } + end: { line: 1, column: 2 } } }, - 'var eval = 42, arguments = 42': { - type: 'VariableDeclaration', - declarations: [{ - type: 'VariableDeclarator', - id: { + '-x': { + type: 'ExpressionStatement', + expression: { + type: 'UnaryExpression', + operator: '-', + argument: { type: 'Identifier', - name: 'eval', - range: [4, 8], - loc: { - start: { line: 1, column: 4 }, - end: { line: 1, column: 8 } - } - }, - init: { - type: 'Literal', - value: 42, - raw: '42', - range: [11, 13], + name: 'x', + range: [1, 2], loc: { - start: { line: 1, column: 11 }, - end: { line: 1, column: 13 } + start: { line: 1, column: 1 }, + end: { line: 1, column: 2 } } }, - range: [4, 13], + prefix: true, + range: [0, 2], loc: { - start: { line: 1, column: 4 }, - end: { line: 1, column: 13 } + start: { line: 1, column: 0 }, + end: { line: 1, column: 2 } } - }, { - type: 'VariableDeclarator', - id: { + }, + range: [0, 2], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 2 } + } + }, + + '~x': { + type: 'ExpressionStatement', + expression: { + type: 'UnaryExpression', + operator: '~', + argument: { type: 'Identifier', - name: 'arguments', - range: [15, 24], - loc: { - start: { line: 1, column: 15 }, - end: { line: 1, column: 24 } - } - }, - init: { - type: 'Literal', - value: 42, - raw: '42', - range: [27, 29], + name: 'x', + range: [1, 2], loc: { - start: { line: 1, column: 27 }, - end: { line: 1, column: 29 } + start: { line: 1, column: 1 }, + end: { line: 1, column: 2 } } }, - range: [15, 29], + prefix: true, + range: [0, 2], loc: { - start: { line: 1, column: 15 }, - end: { line: 1, column: 29 } + start: { line: 1, column: 0 }, + end: { line: 1, column: 2 } } - }], - kind: 'var', - range: [0, 29], + }, + range: [0, 2], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 29 } + end: { line: 1, column: 2 } } }, - 'var x = 14, y = 3, z = 1977': { - type: 'VariableDeclaration', - declarations: [{ - type: 'VariableDeclarator', - id: { + '!x': { + type: 'ExpressionStatement', + expression: { + type: 'UnaryExpression', + operator: '!', + argument: { type: 'Identifier', name: 'x', - range: [4, 5], - loc: { - start: { line: 1, column: 4 }, - end: { line: 1, column: 5 } - } - }, - init: { - type: 'Literal', - value: 14, - raw: '14', - range: [8, 10], + range: [1, 2], loc: { - start: { line: 1, column: 8 }, - end: { line: 1, column: 10 } + start: { line: 1, column: 1 }, + end: { line: 1, column: 2 } } }, - range: [4, 10], + prefix: true, + range: [0, 2], loc: { - start: { line: 1, column: 4 }, - end: { line: 1, column: 10 } + start: { line: 1, column: 0 }, + end: { line: 1, column: 2 } } - }, { - type: 'VariableDeclarator', - id: { + }, + range: [0, 2], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 2 } + } + }, + + 'void x': { + type: 'ExpressionStatement', + expression: { + type: 'UnaryExpression', + operator: 'void', + argument: { type: 'Identifier', - name: 'y', - range: [12, 13], - loc: { - start: { line: 1, column: 12 }, - end: { line: 1, column: 13 } - } - }, - init: { - type: 'Literal', - value: 3, - raw: '3', - range: [16, 17], + name: 'x', + range: [5, 6], loc: { - start: { line: 1, column: 16 }, - end: { line: 1, column: 17 } + start: { line: 1, column: 5 }, + end: { line: 1, column: 6 } } }, - range: [12, 17], + prefix: true, + range: [0, 6], loc: { - start: { line: 1, column: 12 }, - end: { line: 1, column: 17 } + start: { line: 1, column: 0 }, + end: { line: 1, column: 6 } } - }, { - type: 'VariableDeclarator', - id: { + }, + range: [0, 6], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 6 } + } + }, + + 'delete x': { + type: 'ExpressionStatement', + expression: { + type: 'UnaryExpression', + operator: 'delete', + argument: { type: 'Identifier', - name: 'z', - range: [19, 20], - loc: { - start: { line: 1, column: 19 }, - end: { line: 1, column: 20 } - } - }, - init: { - type: 'Literal', - value: 1977, - raw: '1977', - range: [23, 27], + name: 'x', + range: [7, 8], loc: { - start: { line: 1, column: 23 }, - end: { line: 1, column: 27 } + start: { line: 1, column: 7 }, + end: { line: 1, column: 8 } } }, - range: [19, 27], + prefix: true, + range: [0, 8], loc: { - start: { line: 1, column: 19 }, - end: { line: 1, column: 27 } + start: { line: 1, column: 0 }, + end: { line: 1, column: 8 } } - }], - kind: 'var', - range: [0, 27], + }, + range: [0, 8], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 27 } + end: { line: 1, column: 8 } } }, - 'var implements, interface, package': { - type: 'VariableDeclaration', - declarations: [{ - type: 'VariableDeclarator', - id: { + 'typeof x': { + type: 'ExpressionStatement', + expression: { + type: 'UnaryExpression', + operator: 'typeof', + argument: { type: 'Identifier', - name: 'implements', - range: [4, 14], + name: 'x', + range: [7, 8], loc: { - start: { line: 1, column: 4 }, - end: { line: 1, column: 14 } - } + start: { line: 1, column: 7 }, + end: { line: 1, column: 8 } + } }, - init: null, - range: [4, 14], + prefix: true, + range: [0, 8], loc: { - start: { line: 1, column: 4 }, - end: { line: 1, column: 14 } + start: { line: 1, column: 0 }, + end: { line: 1, column: 8 } } - }, { - type: 'VariableDeclarator', - id: { + }, + range: [0, 8], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 8 } + } + } + + }, + + 'Multiplicative Operators': { + + 'x * y': { + type: 'ExpressionStatement', + expression: { + type: 'BinaryExpression', + operator: '*', + left: { type: 'Identifier', - name: 'interface', - range: [16, 25], + name: 'x', + range: [0, 1], loc: { - start: { line: 1, column: 16 }, - end: { line: 1, column: 25 } + start: { line: 1, column: 0 }, + end: { line: 1, column: 1 } } }, - init: null, - range: [16, 25], - loc: { - start: { line: 1, column: 16 }, - end: { line: 1, column: 25 } - } - }, { - type: 'VariableDeclarator', - id: { + right: { type: 'Identifier', - name: 'package', - range: [27, 34], + name: 'y', + range: [4, 5], loc: { - start: { line: 1, column: 27 }, - end: { line: 1, column: 34 } + start: { line: 1, column: 4 }, + end: { line: 1, column: 5 } } }, - init: null, - range: [27, 34], + range: [0, 5], loc: { - start: { line: 1, column: 27 }, - end: { line: 1, column: 34 } + start: { line: 1, column: 0 }, + end: { line: 1, column: 5 } } - }], - kind: 'var', - range: [0, 34], + }, + range: [0, 5], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 34 } + end: { line: 1, column: 5 } } }, - 'var private, protected, public, static': { - type: 'VariableDeclaration', - declarations: [{ - type: 'VariableDeclarator', - id: { + 'x / y': { + type: 'ExpressionStatement', + expression: { + type: 'BinaryExpression', + operator: '/', + left: { type: 'Identifier', - name: 'private', - range: [4, 11], + name: 'x', + range: [0, 1], loc: { - start: { line: 1, column: 4 }, - end: { line: 1, column: 11 } + start: { line: 1, column: 0 }, + end: { line: 1, column: 1 } } }, - init: null, - range: [4, 11], - loc: { - start: { line: 1, column: 4 }, - end: { line: 1, column: 11 } - } - }, { - type: 'VariableDeclarator', - id: { + right: { type: 'Identifier', - name: 'protected', - range: [13, 22], + name: 'y', + range: [4, 5], loc: { - start: { line: 1, column: 13 }, - end: { line: 1, column: 22 } + start: { line: 1, column: 4 }, + end: { line: 1, column: 5 } } }, - init: null, - range: [13, 22], + range: [0, 5], loc: { - start: { line: 1, column: 13 }, - end: { line: 1, column: 22 } + start: { line: 1, column: 0 }, + end: { line: 1, column: 5 } } - }, { - type: 'VariableDeclarator', - id: { + }, + range: [0, 5], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 5 } + } + }, + + 'x % y': { + type: 'ExpressionStatement', + expression: { + type: 'BinaryExpression', + operator: '%', + left: { type: 'Identifier', - name: 'public', - range: [24, 30], + name: 'x', + range: [0, 1], loc: { - start: { line: 1, column: 24 }, - end: { line: 1, column: 30 } + start: { line: 1, column: 0 }, + end: { line: 1, column: 1 } } }, - init: null, - range: [24, 30], - loc: { - start: { line: 1, column: 24 }, - end: { line: 1, column: 30 } - } - }, { - type: 'VariableDeclarator', - id: { + right: { type: 'Identifier', - name: 'static', - range: [32, 38], + name: 'y', + range: [4, 5], loc: { - start: { line: 1, column: 32 }, - end: { line: 1, column: 38 } + start: { line: 1, column: 4 }, + end: { line: 1, column: 5 } } }, - init: null, - range: [32, 38], + range: [0, 5], loc: { - start: { line: 1, column: 32 }, - end: { line: 1, column: 38 } + start: { line: 1, column: 0 }, + end: { line: 1, column: 5 } } - }], - kind: 'var', - range: [0, 38], + }, + range: [0, 5], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 38 } + end: { line: 1, column: 5 } } } }, - 'Let Statement': { + 'Additive Operators': { - 'let x': { - type: 'VariableDeclaration', - declarations: [{ - type: 'VariableDeclarator', - id: { + 'x + y': { + type: 'ExpressionStatement', + expression: { + type: 'BinaryExpression', + operator: '+', + left: { type: 'Identifier', name: 'x', + range: [0, 1], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 1 } + } + }, + right: { + type: 'Identifier', + name: 'y', range: [4, 5], loc: { start: { line: 1, column: 4 }, end: { line: 1, column: 5 } } }, - init: null, - range: [4, 5], + range: [0, 5], loc: { - start: { line: 1, column: 4 }, + start: { line: 1, column: 0 }, end: { line: 1, column: 5 } } - }], - kind: 'let', + }, range: [0, 5], loc: { start: { line: 1, column: 0 }, @@ -10030,407 +10122,238 @@ var testFixture = { } }, - '{ let x }': { - type: 'BlockStatement', - body: [{ - type: 'VariableDeclaration', - declarations: [{ - type: 'VariableDeclarator', - id: { - type: 'Identifier', - name: 'x', - range: [6, 7], - loc: { - start: { line: 1, column: 6 }, - end: { line: 1, column: 7 } - } - }, - init: null, - range: [6, 7], + 'x - y': { + type: 'ExpressionStatement', + expression: { + type: 'BinaryExpression', + operator: '-', + left: { + type: 'Identifier', + name: 'x', + range: [0, 1], loc: { - start: { line: 1, column: 6 }, - end: { line: 1, column: 7 } + start: { line: 1, column: 0 }, + end: { line: 1, column: 1 } } - }], - kind: 'let', - range: [2, 8], + }, + right: { + type: 'Identifier', + name: 'y', + range: [4, 5], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 5 } + } + }, + range: [0, 5], loc: { - start: { line: 1, column: 2 }, - end: { line: 1, column: 8 } + start: { line: 1, column: 0 }, + end: { line: 1, column: 5 } } - }], - range: [0, 9], + }, + range: [0, 5], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 9 } + end: { line: 1, column: 5 } } }, - '{ let x = 42 }': { - type: 'BlockStatement', - body: [{ - type: 'VariableDeclaration', - declarations: [{ - type: 'VariableDeclarator', - id: { - type: 'Identifier', - name: 'x', - range: [6, 7], - loc: { - start: { line: 1, column: 6 }, - end: { line: 1, column: 7 } - } - }, - init: { - type: 'Literal', - value: 42, - raw: '42', - range: [10, 12], - loc: { - start: { line: 1, column: 10 }, - end: { line: 1, column: 12 } - } - }, - range: [6, 12], + '"use strict" + 42': { + type: 'ExpressionStatement', + expression: { + type: 'BinaryExpression', + operator: '+', + left: { + type: 'Literal', + value: 'use strict', + raw: '"use strict"', + range: [0, 12], loc: { - start: { line: 1, column: 6 }, + start: { line: 1, column: 0 }, end: { line: 1, column: 12 } } - }], - kind: 'let', - range: [2, 13], + }, + right: { + type: 'Literal', + value: 42, + raw: '42', + range: [15, 17], + loc: { + start: { line: 1, column: 15 }, + end: { line: 1, column: 17 } + } + }, + range: [0, 17], loc: { - start: { line: 1, column: 2 }, - end: { line: 1, column: 13 } + start: { line: 1, column: 0 }, + end: { line: 1, column: 17 } } - }], - range: [0, 14], + }, + range: [0, 17], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 14 } + end: { line: 1, column: 17 } } - }, + } - '{ let x = 14, y = 3, z = 1977 }': { - type: 'BlockStatement', - body: [{ - type: 'VariableDeclaration', - declarations: [{ - type: 'VariableDeclarator', - id: { - type: 'Identifier', - name: 'x', - range: [6, 7], - loc: { - start: { line: 1, column: 6 }, - end: { line: 1, column: 7 } - } - }, - init: { - type: 'Literal', - value: 14, - raw: '14', - range: [10, 12], - loc: { - start: { line: 1, column: 10 }, - end: { line: 1, column: 12 } - } - }, - range: [6, 12], - loc: { - start: { line: 1, column: 6 }, - end: { line: 1, column: 12 } - } - }, { - type: 'VariableDeclarator', - id: { - type: 'Identifier', - name: 'y', - range: [14, 15], - loc: { - start: { line: 1, column: 14 }, - end: { line: 1, column: 15 } - } - }, - init: { - type: 'Literal', - value: 3, - raw: '3', - range: [18, 19], - loc: { - start: { line: 1, column: 18 }, - end: { line: 1, column: 19 } - } - }, - range: [14, 19], + }, + + 'Bitwise Shift Operator': { + + 'x << y': { + type: 'ExpressionStatement', + expression: { + type: 'BinaryExpression', + operator: '<<', + left: { + type: 'Identifier', + name: 'x', + range: [0, 1], loc: { - start: { line: 1, column: 14 }, - end: { line: 1, column: 19 } + start: { line: 1, column: 0 }, + end: { line: 1, column: 1 } } - }, { - type: 'VariableDeclarator', - id: { - type: 'Identifier', - name: 'z', - range: [21, 22], - loc: { - start: { line: 1, column: 21 }, - end: { line: 1, column: 22 } - } - }, - init: { - type: 'Literal', - value: 1977, - raw: '1977', - range: [25, 29], - loc: { - start: { line: 1, column: 25 }, - end: { line: 1, column: 29 } - } - }, - range: [21, 29], + }, + right: { + type: 'Identifier', + name: 'y', + range: [5, 6], loc: { - start: { line: 1, column: 21 }, - end: { line: 1, column: 29 } + start: { line: 1, column: 5 }, + end: { line: 1, column: 6 } } - }], - kind: 'let', - range: [2, 30], + }, + range: [0, 6], loc: { - start: { line: 1, column: 2 }, - end: { line: 1, column: 30 } + start: { line: 1, column: 0 }, + end: { line: 1, column: 6 } } - }], - range: [0, 31], + }, + range: [0, 6], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 31 } + end: { line: 1, column: 6 } } - } - - }, - - 'Const Statement': { + }, - 'const x = 42': { - type: 'VariableDeclaration', - declarations: [{ - type: 'VariableDeclarator', - id: { + 'x >> y': { + type: 'ExpressionStatement', + expression: { + type: 'BinaryExpression', + operator: '>>', + left: { type: 'Identifier', name: 'x', - range: [6, 7], + range: [0, 1], loc: { - start: { line: 1, column: 6 }, - end: { line: 1, column: 7 } + start: { line: 1, column: 0 }, + end: { line: 1, column: 1 } } }, - init: { - type: 'Literal', - value: 42, - raw: '42', - range: [10, 12], + right: { + type: 'Identifier', + name: 'y', + range: [5, 6], loc: { - start: { line: 1, column: 10 }, - end: { line: 1, column: 12 } + start: { line: 1, column: 5 }, + end: { line: 1, column: 6 } } }, - range: [6, 12], + range: [0, 6], loc: { - start: { line: 1, column: 6 }, - end: { line: 1, column: 12 } + start: { line: 1, column: 0 }, + end: { line: 1, column: 6 } } - }], - kind: 'const', - range: [0, 12], + }, + range: [0, 6], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 12 } + end: { line: 1, column: 6 } } }, - '{ const x = 42 }': { - type: 'BlockStatement', - body: [{ - type: 'VariableDeclaration', - declarations: [{ - type: 'VariableDeclarator', - id: { - type: 'Identifier', - name: 'x', - range: [8, 9], - loc: { - start: { line: 1, column: 8 }, - end: { line: 1, column: 9 } - } - }, - init: { - type: 'Literal', - value: 42, - raw: '42', - range: [12, 14], - loc: { - start: { line: 1, column: 12 }, - end: { line: 1, column: 14 } - } - }, - range: [8, 14], - loc: { - start: { line: 1, column: 8 }, - end: { line: 1, column: 14 } - } - }], - kind: 'const', - range: [2, 15], - loc: { - start: { line: 1, column: 2 }, - end: { line: 1, column: 15 } - } - }], - range: [0, 16], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 16 } - } - }, - - '{ const x = 14, y = 3, z = 1977 }': { - type: 'BlockStatement', - body: [{ - type: 'VariableDeclaration', - declarations: [{ - type: 'VariableDeclarator', - id: { - type: 'Identifier', - name: 'x', - range: [8, 9], - loc: { - start: { line: 1, column: 8 }, - end: { line: 1, column: 9 } - } - }, - init: { - type: 'Literal', - value: 14, - raw: '14', - range: [12, 14], - loc: { - start: { line: 1, column: 12 }, - end: { line: 1, column: 14 } - } - }, - range: [8, 14], - loc: { - start: { line: 1, column: 8 }, - end: { line: 1, column: 14 } - } - }, { - type: 'VariableDeclarator', - id: { - type: 'Identifier', - name: 'y', - range: [16, 17], - loc: { - start: { line: 1, column: 16 }, - end: { line: 1, column: 17 } - } - }, - init: { - type: 'Literal', - value: 3, - raw: '3', - range: [20, 21], - loc: { - start: { line: 1, column: 20 }, - end: { line: 1, column: 21 } - } - }, - range: [16, 21], + 'x >>> y': { + type: 'ExpressionStatement', + expression: { + type: 'BinaryExpression', + operator: '>>>', + left: { + type: 'Identifier', + name: 'x', + range: [0, 1], loc: { - start: { line: 1, column: 16 }, - end: { line: 1, column: 21 } + start: { line: 1, column: 0 }, + end: { line: 1, column: 1 } } - }, { - type: 'VariableDeclarator', - id: { - type: 'Identifier', - name: 'z', - range: [23, 24], - loc: { - start: { line: 1, column: 23 }, - end: { line: 1, column: 24 } - } - }, - init: { - type: 'Literal', - value: 1977, - raw: '1977', - range: [27, 31], - loc: { - start: { line: 1, column: 27 }, - end: { line: 1, column: 31 } - } - }, - range: [23, 31], + }, + right: { + type: 'Identifier', + name: 'y', + range: [6, 7], loc: { - start: { line: 1, column: 23 }, - end: { line: 1, column: 31 } + start: { line: 1, column: 6 }, + end: { line: 1, column: 7 } } - }], - kind: 'const', - range: [2, 32], + }, + range: [0, 7], loc: { - start: { line: 1, column: 2 }, - end: { line: 1, column: 32 } + start: { line: 1, column: 0 }, + end: { line: 1, column: 7 } } - }], - range: [0, 33], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 33 } - } - } - - }, - - 'Empty Statement': { - - ';': { - type: 'EmptyStatement', - range: [0, 1], + }, + range: [0, 7], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 1 } + end: { line: 1, column: 7 } } } }, - 'Expression Statement': { + 'Relational Operators': { - 'x': { + 'x < y': { type: 'ExpressionStatement', expression: { - type: 'Identifier', - name: 'x', - range: [0, 1], + type: 'BinaryExpression', + operator: '<', + left: { + type: 'Identifier', + name: 'x', + range: [0, 1], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 1 } + } + }, + right: { + type: 'Identifier', + name: 'y', + range: [4, 5], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 5 } + } + }, + range: [0, 5], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 1 } + end: { line: 1, column: 5 } } }, - range: [0, 1], + range: [0, 5], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 1 } + end: { line: 1, column: 5 } } }, - 'x, y': { + 'x > y': { type: 'ExpressionStatement', expression: { - type: 'SequenceExpression', - expressions: [{ + type: 'BinaryExpression', + operator: '>', + left: { type: 'Identifier', name: 'x', range: [0, 1], @@ -10438,33 +10361,52 @@ var testFixture = { start: { line: 1, column: 0 }, end: { line: 1, column: 1 } } - }, { + }, + right: { type: 'Identifier', name: 'y', - range: [3, 4], + range: [4, 5], loc: { - start: { line: 1, column: 3 }, - end: { line: 1, column: 4 } + start: { line: 1, column: 4 }, + end: { line: 1, column: 5 } } - }], - range: [0, 4], + }, + range: [0, 5], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 4 } + end: { line: 1, column: 5 } } }, - range: [0, 4], + range: [0, 5], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 4 } + end: { line: 1, column: 5 } } }, - '\\u0061': { + 'x <= y': { type: 'ExpressionStatement', expression: { - type: 'Identifier', - name: 'a', + type: 'BinaryExpression', + operator: '<=', + left: { + type: 'Identifier', + name: 'x', + range: [0, 1], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 1 } + } + }, + right: { + type: 'Identifier', + name: 'y', + range: [5, 6], + loc: { + start: { line: 1, column: 5 }, + end: { line: 1, column: 6 } + } + }, range: [0, 6], loc: { start: { line: 1, column: 0 }, @@ -10478,753 +10420,692 @@ var testFixture = { } }, - 'a\\u0061': { + 'x >= y': { type: 'ExpressionStatement', expression: { - type: 'Identifier', - name: 'aa', - range: [0, 7], + type: 'BinaryExpression', + operator: '>=', + left: { + type: 'Identifier', + name: 'x', + range: [0, 1], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 1 } + } + }, + right: { + type: 'Identifier', + name: 'y', + range: [5, 6], + loc: { + start: { line: 1, column: 5 }, + end: { line: 1, column: 6 } + } + }, + range: [0, 6], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 7 } + end: { line: 1, column: 6 } } }, - range: [0, 7], + range: [0, 6], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 7 } + end: { line: 1, column: 6 } } }, - '\\ua': { + 'x in y': { type: 'ExpressionStatement', expression: { - type: 'Identifier', - name: 'ua', - range: [0, 3], + type: 'BinaryExpression', + operator: 'in', + left: { + type: 'Identifier', + name: 'x', + range: [0, 1], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 1 } + } + }, + right: { + type: 'Identifier', + name: 'y', + range: [5, 6], + loc: { + start: { line: 1, column: 5 }, + end: { line: 1, column: 6 } + } + }, + range: [0, 6], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 3 } + end: { line: 1, column: 6 } } }, - range: [0, 3], + range: [0, 6], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 3 } + end: { line: 1, column: 6 } } }, - 'a\\u': { + 'x instanceof y': { type: 'ExpressionStatement', expression: { - type: 'Identifier', - name: 'au', - range: [0, 3], + type: 'BinaryExpression', + operator: 'instanceof', + left: { + type: 'Identifier', + name: 'x', + range: [0, 1], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 1 } + } + }, + right: { + type: 'Identifier', + name: 'y', + range: [13, 14], + loc: { + start: { line: 1, column: 13 }, + end: { line: 1, column: 14 } + } + }, + range: [0, 14], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 3 } + end: { line: 1, column: 14 } } }, - range: [0, 3], + range: [0, 14], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 3 } + end: { line: 1, column: 14 } } - } - - }, - - 'If Statement': { + }, - 'if (morning) goodMorning()': { - type: 'IfStatement', - test: { - type: 'Identifier', - name: 'morning', - range: [4, 11], - loc: { - start: { line: 1, column: 4 }, - end: { line: 1, column: 11 } - } - }, - consequent: { - type: 'ExpressionStatement', - expression: { - type: 'CallExpression', - callee: { + 'x < y < z': { + type: 'ExpressionStatement', + expression: { + type: 'BinaryExpression', + operator: '<', + left: { + type: 'BinaryExpression', + operator: '<', + left: { type: 'Identifier', - name: 'goodMorning', - range: [13, 24], + name: 'x', + range: [0, 1], loc: { - start: { line: 1, column: 13 }, - end: { line: 1, column: 24 } + start: { line: 1, column: 0 }, + end: { line: 1, column: 1 } } }, - 'arguments': [], - range: [13, 26], + right: { + type: 'Identifier', + name: 'y', + range: [4, 5], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 5 } + } + }, + range: [0, 5], loc: { - start: { line: 1, column: 13 }, - end: { line: 1, column: 26 } + start: { line: 1, column: 0 }, + end: { line: 1, column: 5 } } }, - range: [13, 26], + right: { + type: 'Identifier', + name: 'z', + range: [8, 9], + loc: { + start: { line: 1, column: 8 }, + end: { line: 1, column: 9 } + } + }, + range: [0, 9], loc: { - start: { line: 1, column: 13 }, - end: { line: 1, column: 26 } + start: { line: 1, column: 0 }, + end: { line: 1, column: 9 } } }, - alternate: null, - range: [0, 26], + range: [0, 9], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 26 } + end: { line: 1, column: 9 } } - }, + } - 'if (morning) (function(){})': { - type: 'IfStatement', - test: { - type: 'Identifier', - name: 'morning', - range: [4, 11], - loc: { - start: { line: 1, column: 4 }, - end: { line: 1, column: 11 } - } - }, - consequent: { - type: 'ExpressionStatement', - expression: { - type: 'FunctionExpression', - id: null, - params: [], - defaults: [], - body: { - type: 'BlockStatement', - body: [], - range: [24, 26], - loc: { - start: { line: 1, column: 24 }, - end: { line: 1, column: 26 } - } - }, - rest: null, - generator: false, - expression: false, - range: [14, 26], + }, + + 'Equality Operators': { + + 'x == y': { + type: 'ExpressionStatement', + expression: { + type: 'BinaryExpression', + operator: '==', + left: { + type: 'Identifier', + name: 'x', + range: [0, 1], loc: { - start: { line: 1, column: 14 }, - end: { line: 1, column: 26 } + start: { line: 1, column: 0 }, + end: { line: 1, column: 1 } } }, - range: [13, 27], + right: { + type: 'Identifier', + name: 'y', + range: [5, 6], + loc: { + start: { line: 1, column: 5 }, + end: { line: 1, column: 6 } + } + }, + range: [0, 6], loc: { - start: { line: 1, column: 13 }, - end: { line: 1, column: 27 } + start: { line: 1, column: 0 }, + end: { line: 1, column: 6 } } }, - alternate: null, - range: [0, 27], + range: [0, 6], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 27 } + end: { line: 1, column: 6 } } }, - 'if (morning) var x = 0;': { - type: 'IfStatement', - test: { - type: 'Identifier', - name: 'morning', - range: [4, 11], + 'x != y': { + type: 'ExpressionStatement', + expression: { + type: 'BinaryExpression', + operator: '!=', + left: { + type: 'Identifier', + name: 'x', + range: [0, 1], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 1 } + } + }, + right: { + type: 'Identifier', + name: 'y', + range: [5, 6], + loc: { + start: { line: 1, column: 5 }, + end: { line: 1, column: 6 } + } + }, + range: [0, 6], loc: { - start: { line: 1, column: 4 }, - end: { line: 1, column: 11 } + start: { line: 1, column: 0 }, + end: { line: 1, column: 6 } } }, - consequent: { - type: 'VariableDeclaration', - declarations: [{ - type: 'VariableDeclarator', - id: { - type: 'Identifier', - name: 'x', - range: [17, 18], - loc: { - start: { line: 1, column: 17 }, - end: { line: 1, column: 18 } - } - }, - init: { - type: 'Literal', - value: 0, - raw: '0', - range: [21, 22], - loc: { - start: { line: 1, column: 21 }, - end: { line: 1, column: 22 } - } - }, - range: [17, 22], - loc: { - start: { line: 1, column: 17 }, - end: { line: 1, column: 22 } - } - }], - kind: 'var', - range: [13, 23], - loc: { - start: { line: 1, column: 13 }, - end: { line: 1, column: 23 } - } - }, - alternate: null, - range: [0, 23], + range: [0, 6], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 23 } + end: { line: 1, column: 6 } } }, - 'if (morning) function a(){}': { - type: 'IfStatement', - test: { - type: 'Identifier', - name: 'morning', - range: [4, 11], - loc: { - start: { line: 1, column: 4 }, - end: { line: 1, column: 11 } - } - }, - consequent: { - type: 'FunctionDeclaration', - id: { + 'x === y': { + type: 'ExpressionStatement', + expression: { + type: 'BinaryExpression', + operator: '===', + left: { type: 'Identifier', - name: 'a', - range: [22, 23], + name: 'x', + range: [0, 1], loc: { - start: { line: 1, column: 22 }, - end: { line: 1, column: 23 } + start: { line: 1, column: 0 }, + end: { line: 1, column: 1 } } }, - params: [], - defaults: [], - body: { - type: 'BlockStatement', - body: [], - range: [25, 27], + right: { + type: 'Identifier', + name: 'y', + range: [6, 7], loc: { - start: { line: 1, column: 25 }, - end: { line: 1, column: 27 } + start: { line: 1, column: 6 }, + end: { line: 1, column: 7 } } }, - rest: null, - generator: false, - expression: false, - range: [13, 27], + range: [0, 7], loc: { - start: { line: 1, column: 13 }, - end: { line: 1, column: 27 } + start: { line: 1, column: 0 }, + end: { line: 1, column: 7 } } }, - alternate: null, - range: [0, 27], + range: [0, 7], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 27 } + end: { line: 1, column: 7 } } }, - 'if (morning) goodMorning(); else goodDay()': { - type: 'IfStatement', - test: { - type: 'Identifier', - name: 'morning', - range: [4, 11], - loc: { - start: { line: 1, column: 4 }, - end: { line: 1, column: 11 } - } - }, - consequent: { - type: 'ExpressionStatement', - expression: { - type: 'CallExpression', - callee: { - type: 'Identifier', - name: 'goodMorning', - range: [13, 24], - loc: { - start: { line: 1, column: 13 }, - end: { line: 1, column: 24 } - } - }, - 'arguments': [], - range: [13, 26], + 'x !== y': { + type: 'ExpressionStatement', + expression: { + type: 'BinaryExpression', + operator: '!==', + left: { + type: 'Identifier', + name: 'x', + range: [0, 1], loc: { - start: { line: 1, column: 13 }, - end: { line: 1, column: 26 } + start: { line: 1, column: 0 }, + end: { line: 1, column: 1 } } }, - range: [13, 27], - loc: { - start: { line: 1, column: 13 }, - end: { line: 1, column: 27 } - } - }, - alternate: { - type: 'ExpressionStatement', - expression: { - type: 'CallExpression', - callee: { - type: 'Identifier', - name: 'goodDay', - range: [33, 40], - loc: { - start: { line: 1, column: 33 }, - end: { line: 1, column: 40 } - } - }, - 'arguments': [], - range: [33, 42], + right: { + type: 'Identifier', + name: 'y', + range: [6, 7], loc: { - start: { line: 1, column: 33 }, - end: { line: 1, column: 42 } + start: { line: 1, column: 6 }, + end: { line: 1, column: 7 } } }, - range: [33, 42], + range: [0, 7], loc: { - start: { line: 1, column: 33 }, - end: { line: 1, column: 42 } + start: { line: 1, column: 0 }, + end: { line: 1, column: 7 } } }, - range: [0, 42], + range: [0, 7], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 42 } + end: { line: 1, column: 7 } } } }, - 'Iteration Statements': { + 'Binary Bitwise Operators': { - 'do keep(); while (true)': { - type: 'DoWhileStatement', - body: { - type: 'ExpressionStatement', - expression: { - type: 'CallExpression', - callee: { - type: 'Identifier', - name: 'keep', - range: [3, 7], - loc: { - start: { line: 1, column: 3 }, - end: { line: 1, column: 7 } - } - }, - 'arguments': [], - range: [3, 9], + 'x & y': { + type: 'ExpressionStatement', + expression: { + type: 'BinaryExpression', + operator: '&', + left: { + type: 'Identifier', + name: 'x', + range: [0, 1], loc: { - start: { line: 1, column: 3 }, - end: { line: 1, column: 9 } + start: { line: 1, column: 0 }, + end: { line: 1, column: 1 } } }, - range: [3, 10], - loc: { - start: { line: 1, column: 3 }, - end: { line: 1, column: 10 } - } - }, - test: { - type: 'Literal', - value: true, - raw: 'true', - range: [18, 22], + right: { + type: 'Identifier', + name: 'y', + range: [4, 5], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 5 } + } + }, + range: [0, 5], loc: { - start: { line: 1, column: 18 }, - end: { line: 1, column: 22 } + start: { line: 1, column: 0 }, + end: { line: 1, column: 5 } } }, - range: [0, 23], + range: [0, 5], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 23 } + end: { line: 1, column: 5 } } }, - 'do keep(); while (true);': { - type: 'DoWhileStatement', - body: { - type: 'ExpressionStatement', - expression: { - type: 'CallExpression', - callee: { - type: 'Identifier', - name: 'keep', - range: [3, 7], - loc: { - start: { line: 1, column: 3 }, - end: { line: 1, column: 7 } - } - }, - 'arguments': [], - range: [3, 9], + 'x ^ y': { + type: 'ExpressionStatement', + expression: { + type: 'BinaryExpression', + operator: '^', + left: { + type: 'Identifier', + name: 'x', + range: [0, 1], loc: { - start: { line: 1, column: 3 }, - end: { line: 1, column: 9 } + start: { line: 1, column: 0 }, + end: { line: 1, column: 1 } } }, - range: [3, 10], - loc: { - start: { line: 1, column: 3 }, - end: { line: 1, column: 10 } - } - }, - test: { - type: 'Literal', - value: true, - raw: 'true', - range: [18, 22], + right: { + type: 'Identifier', + name: 'y', + range: [4, 5], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 5 } + } + }, + range: [0, 5], loc: { - start: { line: 1, column: 18 }, - end: { line: 1, column: 22 } + start: { line: 1, column: 0 }, + end: { line: 1, column: 5 } } }, - range: [0, 24], + range: [0, 5], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 24 } + end: { line: 1, column: 5 } } }, - 'do { x++; y--; } while (x < 10)': { - type: 'DoWhileStatement', - body: { - type: 'BlockStatement', - body: [{ - type: 'ExpressionStatement', - expression: { - type: 'UpdateExpression', - operator: '++', - argument: { - type: 'Identifier', - name: 'x', - range: [5, 6], - loc: { - start: { line: 1, column: 5 }, - end: { line: 1, column: 6 } - } - }, - prefix: false, - range: [5, 8], - loc: { - start: { line: 1, column: 5 }, - end: { line: 1, column: 8 } - } - }, - range: [5, 9], + 'x | y': { + type: 'ExpressionStatement', + expression: { + type: 'BinaryExpression', + operator: '|', + left: { + type: 'Identifier', + name: 'x', + range: [0, 1], loc: { - start: { line: 1, column: 5 }, - end: { line: 1, column: 9 } + start: { line: 1, column: 0 }, + end: { line: 1, column: 1 } } - }, { - type: 'ExpressionStatement', - expression: { - type: 'UpdateExpression', - operator: '--', - argument: { - type: 'Identifier', - name: 'y', - range: [10, 11], - loc: { - start: { line: 1, column: 10 }, - end: { line: 1, column: 11 } - } - }, - prefix: false, - range: [10, 13], - loc: { - start: { line: 1, column: 10 }, - end: { line: 1, column: 13 } - } - }, - range: [10, 14], + }, + right: { + type: 'Identifier', + name: 'y', + range: [4, 5], loc: { - start: { line: 1, column: 10 }, - end: { line: 1, column: 14 } + start: { line: 1, column: 4 }, + end: { line: 1, column: 5 } } - }], - range: [3, 16], + }, + range: [0, 5], loc: { - start: { line: 1, column: 3 }, - end: { line: 1, column: 16 } + start: { line: 1, column: 0 }, + end: { line: 1, column: 5 } } }, - test: { + range: [0, 5], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 5 } + } + } + + }, + + 'Binary Expressions': { + + 'x + y + z': { + type: 'ExpressionStatement', + expression: { type: 'BinaryExpression', - operator: '<', + operator: '+', left: { - type: 'Identifier', - name: 'x', - range: [24, 25], + type: 'BinaryExpression', + operator: '+', + left: { + type: 'Identifier', + name: 'x', + range: [0, 1], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 1 } + } + }, + right: { + type: 'Identifier', + name: 'y', + range: [4, 5], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 5 } + } + }, + range: [0, 5], loc: { - start: { line: 1, column: 24 }, - end: { line: 1, column: 25 } + start: { line: 1, column: 0 }, + end: { line: 1, column: 5 } } }, right: { - type: 'Literal', - value: 10, - raw: '10', - range: [28, 30], + type: 'Identifier', + name: 'z', + range: [8, 9], loc: { - start: { line: 1, column: 28 }, - end: { line: 1, column: 30 } + start: { line: 1, column: 8 }, + end: { line: 1, column: 9 } } }, - range: [24, 30], + range: [0, 9], loc: { - start: { line: 1, column: 24 }, - end: { line: 1, column: 30 } + start: { line: 1, column: 0 }, + end: { line: 1, column: 9 } } }, - range: [0, 31], + range: [0, 9], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 31 } + end: { line: 1, column: 9 } } }, - '{ do { } while (false) false }': { - type: 'BlockStatement', - body: [{ - type: 'DoWhileStatement', - body: { - type: 'BlockStatement', - body: [], - range: [5, 8], - loc: { - start: { line: 1, column: 5 }, - end: { line: 1, column: 8 } - } - }, - test: { - type: 'Literal', - value: false, - raw: 'false', - range: [16, 21], + 'x - y + z': { + type: 'ExpressionStatement', + expression: { + type: 'BinaryExpression', + operator: '+', + left: { + type: 'BinaryExpression', + operator: '-', + left: { + type: 'Identifier', + name: 'x', + range: [0, 1], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 1 } + } + }, + right: { + type: 'Identifier', + name: 'y', + range: [4, 5], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 5 } + } + }, + range: [0, 5], loc: { - start: { line: 1, column: 16 }, - end: { line: 1, column: 21 } + start: { line: 1, column: 0 }, + end: { line: 1, column: 5 } } }, - range: [2, 22], - loc: { - start: { line: 1, column: 2 }, - end: { line: 1, column: 22 } - } - }, { - type: 'ExpressionStatement', - expression: { - type: 'Literal', - value: false, - raw: 'false', - range: [23, 28], + right: { + type: 'Identifier', + name: 'z', + range: [8, 9], loc: { - start: { line: 1, column: 23 }, - end: { line: 1, column: 28 } + start: { line: 1, column: 8 }, + end: { line: 1, column: 9 } } }, - range: [23, 29], + range: [0, 9], loc: { - start: { line: 1, column: 23 }, - end: { line: 1, column: 29 } + start: { line: 1, column: 0 }, + end: { line: 1, column: 9 } } - }], - range: [0, 30], + }, + range: [0, 9], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 30 } + end: { line: 1, column: 9 } } }, - 'while (true) doSomething()': { - type: 'WhileStatement', - test: { - type: 'Literal', - value: true, - raw: 'true', - range: [7, 11], - loc: { - start: { line: 1, column: 7 }, - end: { line: 1, column: 11 } - } - }, - body: { - type: 'ExpressionStatement', - expression: { - type: 'CallExpression', - callee: { + 'x + y - z': { + type: 'ExpressionStatement', + expression: { + type: 'BinaryExpression', + operator: '-', + left: { + type: 'BinaryExpression', + operator: '+', + left: { type: 'Identifier', - name: 'doSomething', - range: [13, 24], + name: 'x', + range: [0, 1], loc: { - start: { line: 1, column: 13 }, - end: { line: 1, column: 24 } + start: { line: 1, column: 0 }, + end: { line: 1, column: 1 } } }, - 'arguments': [], - range: [13, 26], + right: { + type: 'Identifier', + name: 'y', + range: [4, 5], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 5 } + } + }, + range: [0, 5], loc: { - start: { line: 1, column: 13 }, - end: { line: 1, column: 26 } + start: { line: 1, column: 0 }, + end: { line: 1, column: 5 } } }, - range: [13, 26], + right: { + type: 'Identifier', + name: 'z', + range: [8, 9], + loc: { + start: { line: 1, column: 8 }, + end: { line: 1, column: 9 } + } + }, + range: [0, 9], loc: { - start: { line: 1, column: 13 }, - end: { line: 1, column: 26 } + start: { line: 1, column: 0 }, + end: { line: 1, column: 9 } } }, - range: [0, 26], + range: [0, 9], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 26 } + end: { line: 1, column: 9 } } }, - 'while (x < 10) { x++; y--; }': { - type: 'WhileStatement', - test: { + 'x - y - z': { + type: 'ExpressionStatement', + expression: { type: 'BinaryExpression', - operator: '<', + operator: '-', left: { - type: 'Identifier', - name: 'x', - range: [7, 8], + type: 'BinaryExpression', + operator: '-', + left: { + type: 'Identifier', + name: 'x', + range: [0, 1], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 1 } + } + }, + right: { + type: 'Identifier', + name: 'y', + range: [4, 5], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 5 } + } + }, + range: [0, 5], loc: { - start: { line: 1, column: 7 }, - end: { line: 1, column: 8 } + start: { line: 1, column: 0 }, + end: { line: 1, column: 5 } } }, right: { - type: 'Literal', - value: 10, - raw: '10', - range: [11, 13], + type: 'Identifier', + name: 'z', + range: [8, 9], loc: { - start: { line: 1, column: 11 }, - end: { line: 1, column: 13 } + start: { line: 1, column: 8 }, + end: { line: 1, column: 9 } } }, - range: [7, 13], + range: [0, 9], loc: { - start: { line: 1, column: 7 }, - end: { line: 1, column: 13 } + start: { line: 1, column: 0 }, + end: { line: 1, column: 9 } } }, - body: { - type: 'BlockStatement', - body: [{ - type: 'ExpressionStatement', - expression: { - type: 'UpdateExpression', - operator: '++', - argument: { - type: 'Identifier', - name: 'x', - range: [17, 18], - loc: { - start: { line: 1, column: 17 }, - end: { line: 1, column: 18 } - } - }, - prefix: false, - range: [17, 20], + range: [0, 9], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 9 } + } + }, + + 'x + y * z': { + type: 'ExpressionStatement', + expression: { + type: 'BinaryExpression', + operator: '+', + left: { + type: 'Identifier', + name: 'x', + range: [0, 1], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 1 } + } + }, + right: { + type: 'BinaryExpression', + operator: '*', + left: { + type: 'Identifier', + name: 'y', + range: [4, 5], loc: { - start: { line: 1, column: 17 }, - end: { line: 1, column: 20 } + start: { line: 1, column: 4 }, + end: { line: 1, column: 5 } } }, - range: [17, 21], - loc: { - start: { line: 1, column: 17 }, - end: { line: 1, column: 21 } - } - }, { - type: 'ExpressionStatement', - expression: { - type: 'UpdateExpression', - operator: '--', - argument: { - type: 'Identifier', - name: 'y', - range: [22, 23], - loc: { - start: { line: 1, column: 22 }, - end: { line: 1, column: 23 } - } - }, - prefix: false, - range: [22, 25], + right: { + type: 'Identifier', + name: 'z', + range: [8, 9], loc: { - start: { line: 1, column: 22 }, - end: { line: 1, column: 25 } + start: { line: 1, column: 8 }, + end: { line: 1, column: 9 } } }, - range: [22, 26], + range: [4, 9], loc: { - start: { line: 1, column: 22 }, - end: { line: 1, column: 26 } + start: { line: 1, column: 4 }, + end: { line: 1, column: 9 } } - }], - range: [15, 28], - loc: { - start: { line: 1, column: 15 }, - end: { line: 1, column: 28 } - } - }, - range: [0, 28], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 28 } - } - }, - - 'for(;;);': { - type: 'ForStatement', - init: null, - test: null, - update: null, - body: { - type: 'EmptyStatement', - range: [7, 8], - loc: { - start: { line: 1, column: 7 }, - end: { line: 1, column: 8 } - } - }, - range: [0, 8], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 8 } - } - }, - - 'for(;;){}': { - type: 'ForStatement', - init: null, - test: null, - update: null, - body: { - type: 'BlockStatement', - body: [], - range: [7, 9], + }, + range: [0, 9], loc: { - start: { line: 1, column: 7 }, + start: { line: 1, column: 0 }, end: { line: 1, column: 9 } } }, @@ -11235,3647 +11116,4201 @@ var testFixture = { } }, - 'for(x = 0;;);': { - type: 'ForStatement', - init: { - type: 'AssignmentExpression', - operator: '=', - left: { - type: 'Identifier', + 'x + y / z': { + type: 'ExpressionStatement', + expression: { + type: 'BinaryExpression', + operator: '+', + left: { + type: 'Identifier', name: 'x', - range: [4, 5], + range: [0, 1], loc: { - start: { line: 1, column: 4 }, - end: { line: 1, column: 5 } + start: { line: 1, column: 0 }, + end: { line: 1, column: 1 } } }, right: { - type: 'Literal', - value: 0, - raw: '0', - range: [8, 9], + type: 'BinaryExpression', + operator: '/', + left: { + type: 'Identifier', + name: 'y', + range: [4, 5], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 5 } + } + }, + right: { + type: 'Identifier', + name: 'z', + range: [8, 9], + loc: { + start: { line: 1, column: 8 }, + end: { line: 1, column: 9 } + } + }, + range: [4, 9], loc: { - start: { line: 1, column: 8 }, + start: { line: 1, column: 4 }, end: { line: 1, column: 9 } } }, - range: [4, 9], + range: [0, 9], loc: { - start: { line: 1, column: 4 }, + start: { line: 1, column: 0 }, end: { line: 1, column: 9 } } }, - test: null, - update: null, - body: { - type: 'EmptyStatement', - range: [12, 13], - loc: { - start: { line: 1, column: 12 }, - end: { line: 1, column: 13 } - } - }, - range: [0, 13], + range: [0, 9], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 13 } + end: { line: 1, column: 9 } } }, - 'for(var x = 0;;);': { - type: 'ForStatement', - init: { - type: 'VariableDeclaration', - declarations: [{ - type: 'VariableDeclarator', - id: { + 'x - y % z': { + type: 'ExpressionStatement', + expression: { + type: 'BinaryExpression', + operator: '-', + left: { + type: 'Identifier', + name: 'x', + range: [0, 1], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 1 } + } + }, + right: { + type: 'BinaryExpression', + operator: '%', + left: { type: 'Identifier', - name: 'x', - range: [8, 9], + name: 'y', + range: [4, 5], loc: { - start: { line: 1, column: 8 }, - end: { line: 1, column: 9 } + start: { line: 1, column: 4 }, + end: { line: 1, column: 5 } } }, - init: { - type: 'Literal', - value: 0, - raw: '0', - range: [12, 13], + right: { + type: 'Identifier', + name: 'z', + range: [8, 9], loc: { - start: { line: 1, column: 12 }, - end: { line: 1, column: 13 } + start: { line: 1, column: 8 }, + end: { line: 1, column: 9 } } }, - range: [8, 13], + range: [4, 9], loc: { - start: { line: 1, column: 8 }, - end: { line: 1, column: 13 } + start: { line: 1, column: 4 }, + end: { line: 1, column: 9 } } - }], - kind: 'var', - range: [4, 13], - loc: { - start: { line: 1, column: 4 }, - end: { line: 1, column: 13 } - } - }, - test: null, - update: null, - body: { - type: 'EmptyStatement', - range: [16, 17], + }, + range: [0, 9], loc: { - start: { line: 1, column: 16 }, - end: { line: 1, column: 17 } + start: { line: 1, column: 0 }, + end: { line: 1, column: 9 } } }, - range: [0, 17], + range: [0, 9], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 17 } + end: { line: 1, column: 9 } } }, - 'for(let x = 0;;);': { - type: 'ForStatement', - init: { - type: 'VariableDeclaration', - declarations: [{ - type: 'VariableDeclarator', - id: { + 'x * y * z': { + type: 'ExpressionStatement', + expression: { + type: 'BinaryExpression', + operator: '*', + left: { + type: 'BinaryExpression', + operator: '*', + left: { type: 'Identifier', name: 'x', - range: [8, 9], + range: [0, 1], loc: { - start: { line: 1, column: 8 }, - end: { line: 1, column: 9 } + start: { line: 1, column: 0 }, + end: { line: 1, column: 1 } } }, - init: { - type: 'Literal', - value: 0, - raw: '0', - range: [12, 13], + right: { + type: 'Identifier', + name: 'y', + range: [4, 5], loc: { - start: { line: 1, column: 12 }, - end: { line: 1, column: 13 } + start: { line: 1, column: 4 }, + end: { line: 1, column: 5 } } }, - range: [8, 13], + range: [0, 5], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 5 } + } + }, + right: { + type: 'Identifier', + name: 'z', + range: [8, 9], loc: { start: { line: 1, column: 8 }, - end: { line: 1, column: 13 } + end: { line: 1, column: 9 } } - }], - kind: 'let', - range: [4, 13], - loc: { - start: { line: 1, column: 4 }, - end: { line: 1, column: 13 } - } - }, - test: null, - update: null, - body: { - type: 'EmptyStatement', - range: [16, 17], + }, + range: [0, 9], loc: { - start: { line: 1, column: 16 }, - end: { line: 1, column: 17 } + start: { line: 1, column: 0 }, + end: { line: 1, column: 9 } } }, - range: [0, 17], + range: [0, 9], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 17 } + end: { line: 1, column: 9 } } }, - 'for(var x = 0, y = 1;;);': { - type: 'ForStatement', - init: { - type: 'VariableDeclaration', - declarations: [{ - type: 'VariableDeclarator', - id: { + 'x * y / z': { + type: 'ExpressionStatement', + expression: { + type: 'BinaryExpression', + operator: '/', + left: { + type: 'BinaryExpression', + operator: '*', + left: { type: 'Identifier', name: 'x', - range: [8, 9], + range: [0, 1], loc: { - start: { line: 1, column: 8 }, - end: { line: 1, column: 9 } + start: { line: 1, column: 0 }, + end: { line: 1, column: 1 } } }, - init: { - type: 'Literal', - value: 0, - raw: '0', - range: [12, 13], + right: { + type: 'Identifier', + name: 'y', + range: [4, 5], loc: { - start: { line: 1, column: 12 }, - end: { line: 1, column: 13 } + start: { line: 1, column: 4 }, + end: { line: 1, column: 5 } } }, - range: [8, 13], + range: [0, 5], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 5 } + } + }, + right: { + type: 'Identifier', + name: 'z', + range: [8, 9], loc: { start: { line: 1, column: 8 }, - end: { line: 1, column: 13 } + end: { line: 1, column: 9 } } - }, { - type: 'VariableDeclarator', - id: { - type: 'Identifier', - name: 'y', - range: [15, 16], + }, + range: [0, 9], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 9 } + } + }, + range: [0, 9], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 9 } + } + }, + + 'x * y % z': { + type: 'ExpressionStatement', + expression: { + type: 'BinaryExpression', + operator: '%', + left: { + type: 'BinaryExpression', + operator: '*', + left: { + type: 'Identifier', + name: 'x', + range: [0, 1], loc: { - start: { line: 1, column: 15 }, - end: { line: 1, column: 16 } + start: { line: 1, column: 0 }, + end: { line: 1, column: 1 } } }, - init: { - type: 'Literal', - value: 1, - raw: '1', - range: [19, 20], + right: { + type: 'Identifier', + name: 'y', + range: [4, 5], loc: { - start: { line: 1, column: 19 }, - end: { line: 1, column: 20 } + start: { line: 1, column: 4 }, + end: { line: 1, column: 5 } } }, - range: [15, 20], + range: [0, 5], loc: { - start: { line: 1, column: 15 }, - end: { line: 1, column: 20 } + start: { line: 1, column: 0 }, + end: { line: 1, column: 5 } } - }], - kind: 'var', - range: [4, 20], - loc: { - start: { line: 1, column: 4 }, - end: { line: 1, column: 20 } - } - }, - test: null, - update: null, - body: { - type: 'EmptyStatement', - range: [23, 24], + }, + right: { + type: 'Identifier', + name: 'z', + range: [8, 9], + loc: { + start: { line: 1, column: 8 }, + end: { line: 1, column: 9 } + } + }, + range: [0, 9], loc: { - start: { line: 1, column: 23 }, - end: { line: 1, column: 24 } + start: { line: 1, column: 0 }, + end: { line: 1, column: 9 } } }, - range: [0, 24], + range: [0, 9], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 24 } + end: { line: 1, column: 9 } } }, - 'for(x = 0; x < 42;);': { - type: 'ForStatement', - init: { - type: 'AssignmentExpression', - operator: '=', + 'x % y * z': { + type: 'ExpressionStatement', + expression: { + type: 'BinaryExpression', + operator: '*', left: { - type: 'Identifier', - name: 'x', - range: [4, 5], + type: 'BinaryExpression', + operator: '%', + left: { + type: 'Identifier', + name: 'x', + range: [0, 1], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 1 } + } + }, + right: { + type: 'Identifier', + name: 'y', + range: [4, 5], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 5 } + } + }, + range: [0, 5], loc: { - start: { line: 1, column: 4 }, + start: { line: 1, column: 0 }, end: { line: 1, column: 5 } } }, right: { - type: 'Literal', - value: 0, - raw: '0', + type: 'Identifier', + name: 'z', range: [8, 9], loc: { start: { line: 1, column: 8 }, end: { line: 1, column: 9 } } }, - range: [4, 9], + range: [0, 9], loc: { - start: { line: 1, column: 4 }, + start: { line: 1, column: 0 }, end: { line: 1, column: 9 } } }, - test: { + range: [0, 9], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 9 } + } + }, + + 'x << y << z': { + type: 'ExpressionStatement', + expression: { type: 'BinaryExpression', - operator: '<', + operator: '<<', left: { - type: 'Identifier', - name: 'x', - range: [11, 12], + type: 'BinaryExpression', + operator: '<<', + left: { + type: 'Identifier', + name: 'x', + range: [0, 1], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 1 } + } + }, + right: { + type: 'Identifier', + name: 'y', + range: [5, 6], + loc: { + start: { line: 1, column: 5 }, + end: { line: 1, column: 6 } + } + }, + range: [0, 6], loc: { - start: { line: 1, column: 11 }, - end: { line: 1, column: 12 } + start: { line: 1, column: 0 }, + end: { line: 1, column: 6 } } }, right: { - type: 'Literal', - value: 42, - raw: '42', - range: [15, 17], + type: 'Identifier', + name: 'z', + range: [10, 11], loc: { - start: { line: 1, column: 15 }, - end: { line: 1, column: 17 } + start: { line: 1, column: 10 }, + end: { line: 1, column: 11 } } }, - range: [11, 17], - loc: { - start: { line: 1, column: 11 }, - end: { line: 1, column: 17 } - } - }, - update: null, - body: { - type: 'EmptyStatement', - range: [19, 20], + range: [0, 11], loc: { - start: { line: 1, column: 19 }, - end: { line: 1, column: 20 } + start: { line: 1, column: 0 }, + end: { line: 1, column: 11 } } }, - range: [0, 20], + range: [0, 11], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 20 } + end: { line: 1, column: 11 } } }, - 'for(x = 0; x < 42; x++);': { - type: 'ForStatement', - init: { - type: 'AssignmentExpression', - operator: '=', + 'x | y | z': { + type: 'ExpressionStatement', + expression: { + type: 'BinaryExpression', + operator: '|', left: { - type: 'Identifier', - name: 'x', - range: [4, 5], + type: 'BinaryExpression', + operator: '|', + left: { + type: 'Identifier', + name: 'x', + range: [0, 1], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 1 } + } + }, + right: { + type: 'Identifier', + name: 'y', + range: [4, 5], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 5 } + } + }, + range: [0, 5], loc: { - start: { line: 1, column: 4 }, + start: { line: 1, column: 0 }, end: { line: 1, column: 5 } } }, right: { - type: 'Literal', - value: 0, - raw: '0', + type: 'Identifier', + name: 'z', range: [8, 9], loc: { start: { line: 1, column: 8 }, end: { line: 1, column: 9 } } }, - range: [4, 9], + range: [0, 9], loc: { - start: { line: 1, column: 4 }, + start: { line: 1, column: 0 }, end: { line: 1, column: 9 } } }, - test: { + range: [0, 9], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 9 } + } + }, + + 'x & y & z': { + type: 'ExpressionStatement', + expression: { type: 'BinaryExpression', - operator: '<', + operator: '&', left: { - type: 'Identifier', - name: 'x', - range: [11, 12], + type: 'BinaryExpression', + operator: '&', + left: { + type: 'Identifier', + name: 'x', + range: [0, 1], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 1 } + } + }, + right: { + type: 'Identifier', + name: 'y', + range: [4, 5], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 5 } + } + }, + range: [0, 5], loc: { - start: { line: 1, column: 11 }, - end: { line: 1, column: 12 } + start: { line: 1, column: 0 }, + end: { line: 1, column: 5 } } }, right: { - type: 'Literal', - value: 42, - raw: '42', - range: [15, 17], - loc: { - start: { line: 1, column: 15 }, - end: { line: 1, column: 17 } - } - }, - range: [11, 17], - loc: { - start: { line: 1, column: 11 }, - end: { line: 1, column: 17 } - } - }, - update: { - type: 'UpdateExpression', - operator: '++', - argument: { type: 'Identifier', - name: 'x', - range: [19, 20], + name: 'z', + range: [8, 9], loc: { - start: { line: 1, column: 19 }, - end: { line: 1, column: 20 } + start: { line: 1, column: 8 }, + end: { line: 1, column: 9 } } }, - prefix: false, - range: [19, 22], - loc: { - start: { line: 1, column: 19 }, - end: { line: 1, column: 22 } - } - }, - body: { - type: 'EmptyStatement', - range: [23, 24], + range: [0, 9], loc: { - start: { line: 1, column: 23 }, - end: { line: 1, column: 24 } + start: { line: 1, column: 0 }, + end: { line: 1, column: 9 } } }, - range: [0, 24], + range: [0, 9], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 24 } + end: { line: 1, column: 9 } } }, - 'for(x = 0; x < 42; x++) process(x);': { - type: 'ForStatement', - init: { - type: 'AssignmentExpression', - operator: '=', + 'x ^ y ^ z': { + type: 'ExpressionStatement', + expression: { + type: 'BinaryExpression', + operator: '^', left: { - type: 'Identifier', - name: 'x', - range: [4, 5], + type: 'BinaryExpression', + operator: '^', + left: { + type: 'Identifier', + name: 'x', + range: [0, 1], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 1 } + } + }, + right: { + type: 'Identifier', + name: 'y', + range: [4, 5], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 5 } + } + }, + range: [0, 5], loc: { - start: { line: 1, column: 4 }, + start: { line: 1, column: 0 }, end: { line: 1, column: 5 } } }, right: { - type: 'Literal', - value: 0, - raw: '0', + type: 'Identifier', + name: 'z', range: [8, 9], loc: { start: { line: 1, column: 8 }, end: { line: 1, column: 9 } } }, - range: [4, 9], + range: [0, 9], loc: { - start: { line: 1, column: 4 }, + start: { line: 1, column: 0 }, end: { line: 1, column: 9 } } }, - test: { + range: [0, 9], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 9 } + } + }, + + 'x & y | z': { + type: 'ExpressionStatement', + expression: { type: 'BinaryExpression', - operator: '<', + operator: '|', left: { - type: 'Identifier', - name: 'x', - range: [11, 12], + type: 'BinaryExpression', + operator: '&', + left: { + type: 'Identifier', + name: 'x', + range: [0, 1], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 1 } + } + }, + right: { + type: 'Identifier', + name: 'y', + range: [4, 5], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 5 } + } + }, + range: [0, 5], loc: { - start: { line: 1, column: 11 }, - end: { line: 1, column: 12 } + start: { line: 1, column: 0 }, + end: { line: 1, column: 5 } } }, right: { - type: 'Literal', - value: 42, - raw: '42', - range: [15, 17], + type: 'Identifier', + name: 'z', + range: [8, 9], loc: { - start: { line: 1, column: 15 }, - end: { line: 1, column: 17 } + start: { line: 1, column: 8 }, + end: { line: 1, column: 9 } } }, - range: [11, 17], + range: [0, 9], loc: { - start: { line: 1, column: 11 }, - end: { line: 1, column: 17 } + start: { line: 1, column: 0 }, + end: { line: 1, column: 9 } } }, - update: { - type: 'UpdateExpression', - operator: '++', - argument: { + range: [0, 9], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 9 } + } + }, + + 'x | y ^ z': { + type: 'ExpressionStatement', + expression: { + type: 'BinaryExpression', + operator: '|', + left: { type: 'Identifier', name: 'x', - range: [19, 20], + range: [0, 1], loc: { - start: { line: 1, column: 19 }, - end: { line: 1, column: 20 } + start: { line: 1, column: 0 }, + end: { line: 1, column: 1 } } }, - prefix: false, - range: [19, 22], - loc: { - start: { line: 1, column: 19 }, - end: { line: 1, column: 22 } - } - }, - body: { - type: 'ExpressionStatement', - expression: { - type: 'CallExpression', - callee: { + right: { + type: 'BinaryExpression', + operator: '^', + left: { type: 'Identifier', - name: 'process', - range: [24, 31], + name: 'y', + range: [4, 5], loc: { - start: { line: 1, column: 24 }, - end: { line: 1, column: 31 } + start: { line: 1, column: 4 }, + end: { line: 1, column: 5 } } }, - 'arguments': [{ + right: { type: 'Identifier', - name: 'x', - range: [32, 33], + name: 'z', + range: [8, 9], loc: { - start: { line: 1, column: 32 }, - end: { line: 1, column: 33 } + start: { line: 1, column: 8 }, + end: { line: 1, column: 9 } } - }], - range: [24, 34], + }, + range: [4, 9], loc: { - start: { line: 1, column: 24 }, - end: { line: 1, column: 34 } + start: { line: 1, column: 4 }, + end: { line: 1, column: 9 } } }, - range: [24, 35], + range: [0, 9], loc: { - start: { line: 1, column: 24 }, - end: { line: 1, column: 35 } + start: { line: 1, column: 0 }, + end: { line: 1, column: 9 } } }, - range: [0, 35], + range: [0, 9], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 35 } + end: { line: 1, column: 9 } } }, - 'for(x in list) process(x);': { - type: 'ForInStatement', - left: { - type: 'Identifier', - name: 'x', - range: [4, 5], - loc: { - start: { line: 1, column: 4 }, - end: { line: 1, column: 5 } - } - }, - right: { - type: 'Identifier', - name: 'list', - range: [9, 13], - loc: { - start: { line: 1, column: 9 }, - end: { line: 1, column: 13 } - } - }, - body: { - type: 'ExpressionStatement', - expression: { - type: 'CallExpression', - callee: { + 'x | y & z': { + type: 'ExpressionStatement', + expression: { + type: 'BinaryExpression', + operator: '|', + left: { + type: 'Identifier', + name: 'x', + range: [0, 1], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 1 } + } + }, + right: { + type: 'BinaryExpression', + operator: '&', + left: { type: 'Identifier', - name: 'process', - range: [15, 22], + name: 'y', + range: [4, 5], loc: { - start: { line: 1, column: 15 }, - end: { line: 1, column: 22 } + start: { line: 1, column: 4 }, + end: { line: 1, column: 5 } } }, - 'arguments': [{ + right: { type: 'Identifier', - name: 'x', - range: [23, 24], + name: 'z', + range: [8, 9], loc: { - start: { line: 1, column: 23 }, - end: { line: 1, column: 24 } + start: { line: 1, column: 8 }, + end: { line: 1, column: 9 } } - }], - range: [15, 25], + }, + range: [4, 9], loc: { - start: { line: 1, column: 15 }, - end: { line: 1, column: 25 } + start: { line: 1, column: 4 }, + end: { line: 1, column: 9 } } }, - range: [15, 26], + range: [0, 9], loc: { - start: { line: 1, column: 15 }, - end: { line: 1, column: 26 } + start: { line: 1, column: 0 }, + end: { line: 1, column: 9 } } }, - each: false, - range: [0, 26], + range: [0, 9], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 26 } + end: { line: 1, column: 9 } } - }, + } - 'for (var x in list) process(x);': { - type: 'ForInStatement', - left: { - type: 'VariableDeclaration', - declarations: [{ - type: 'VariableDeclarator', - id: { - type: 'Identifier', - name: 'x', - range: [9, 10], - loc: { - start: { line: 1, column: 9 }, - end: { line: 1, column: 10 } - } - }, - init: null, - range: [9, 10], + }, + + 'Binary Logical Operators': { + + 'x || y': { + type: 'ExpressionStatement', + expression: { + type: 'LogicalExpression', + operator: '||', + left: { + type: 'Identifier', + name: 'x', + range: [0, 1], loc: { - start: { line: 1, column: 9 }, - end: { line: 1, column: 10 } + start: { line: 1, column: 0 }, + end: { line: 1, column: 1 } } - }], - kind: 'var', - range: [5, 10], + }, + right: { + type: 'Identifier', + name: 'y', + range: [5, 6], + loc: { + start: { line: 1, column: 5 }, + end: { line: 1, column: 6 } + } + }, + range: [0, 6], loc: { - start: { line: 1, column: 5 }, - end: { line: 1, column: 10 } + start: { line: 1, column: 0 }, + end: { line: 1, column: 6 } } }, - right: { - type: 'Identifier', - name: 'list', - range: [14, 18], + range: [0, 6], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 6 } + } + }, + + 'x && y': { + type: 'ExpressionStatement', + expression: { + type: 'LogicalExpression', + operator: '&&', + left: { + type: 'Identifier', + name: 'x', + range: [0, 1], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 1 } + } + }, + right: { + type: 'Identifier', + name: 'y', + range: [5, 6], + loc: { + start: { line: 1, column: 5 }, + end: { line: 1, column: 6 } + } + }, + range: [0, 6], loc: { - start: { line: 1, column: 14 }, - end: { line: 1, column: 18 } + start: { line: 1, column: 0 }, + end: { line: 1, column: 6 } } }, - body: { - type: 'ExpressionStatement', - expression: { - type: 'CallExpression', - callee: { + range: [0, 6], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 6 } + } + }, + + 'x || y || z': { + type: 'ExpressionStatement', + expression: { + type: 'LogicalExpression', + operator: '||', + left: { + type: 'LogicalExpression', + operator: '||', + left: { type: 'Identifier', - name: 'process', - range: [20, 27], + name: 'x', + range: [0, 1], loc: { - start: { line: 1, column: 20 }, - end: { line: 1, column: 27 } + start: { line: 1, column: 0 }, + end: { line: 1, column: 1 } } }, - 'arguments': [{ + right: { type: 'Identifier', - name: 'x', - range: [28, 29], + name: 'y', + range: [5, 6], loc: { - start: { line: 1, column: 28 }, - end: { line: 1, column: 29 } + start: { line: 1, column: 5 }, + end: { line: 1, column: 6 } } - }], - range: [20, 30], + }, + range: [0, 6], loc: { - start: { line: 1, column: 20 }, - end: { line: 1, column: 30 } + start: { line: 1, column: 0 }, + end: { line: 1, column: 6 } } }, - range: [20, 31], + right: { + type: 'Identifier', + name: 'z', + range: [10, 11], + loc: { + start: { line: 1, column: 10 }, + end: { line: 1, column: 11 } + } + }, + range: [0, 11], loc: { - start: { line: 1, column: 20 }, - end: { line: 1, column: 31 } + start: { line: 1, column: 0 }, + end: { line: 1, column: 11 } } }, - each: false, - range: [0, 31], + range: [0, 11], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 31 } + end: { line: 1, column: 11 } } }, - 'for (var x = 42 in list) process(x);': { - type: 'ForInStatement', - left: { - type: 'VariableDeclaration', - declarations: [{ - type: 'VariableDeclarator', - id: { + 'x && y && z': { + type: 'ExpressionStatement', + expression: { + type: 'LogicalExpression', + operator: '&&', + left: { + type: 'LogicalExpression', + operator: '&&', + left: { type: 'Identifier', name: 'x', - range: [9, 10], + range: [0, 1], loc: { - start: { line: 1, column: 9 }, - end: { line: 1, column: 10 } + start: { line: 1, column: 0 }, + end: { line: 1, column: 1 } } }, - init: { - type: 'Literal', - value: 42, - raw: '42', - range: [13, 15], + right: { + type: 'Identifier', + name: 'y', + range: [5, 6], loc: { - start: { line: 1, column: 13 }, - end: { line: 1, column: 15 } + start: { line: 1, column: 5 }, + end: { line: 1, column: 6 } } }, - range: [9, 15], + range: [0, 6], loc: { - start: { line: 1, column: 9 }, - end: { line: 1, column: 15 } + start: { line: 1, column: 0 }, + end: { line: 1, column: 6 } } - }], - kind: 'var', - range: [5, 15], - loc: { - start: { line: 1, column: 5 }, - end: { line: 1, column: 15 } - } - }, - right: { - type: 'Identifier', - name: 'list', - range: [19, 23], + }, + right: { + type: 'Identifier', + name: 'z', + range: [10, 11], + loc: { + start: { line: 1, column: 10 }, + end: { line: 1, column: 11 } + } + }, + range: [0, 11], loc: { - start: { line: 1, column: 19 }, - end: { line: 1, column: 23 } + start: { line: 1, column: 0 }, + end: { line: 1, column: 11 } } }, - body: { - type: 'ExpressionStatement', - expression: { - type: 'CallExpression', - callee: { + range: [0, 11], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 11 } + } + }, + + 'x || y && z': { + type: 'ExpressionStatement', + expression: { + type: 'LogicalExpression', + operator: '||', + left: { + type: 'Identifier', + name: 'x', + range: [0, 1], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 1 } + } + }, + right: { + type: 'LogicalExpression', + operator: '&&', + left: { type: 'Identifier', - name: 'process', - range: [25, 32], + name: 'y', + range: [5, 6], loc: { - start: { line: 1, column: 25 }, - end: { line: 1, column: 32 } + start: { line: 1, column: 5 }, + end: { line: 1, column: 6 } } }, - 'arguments': [{ + right: { type: 'Identifier', - name: 'x', - range: [33, 34], + name: 'z', + range: [10, 11], loc: { - start: { line: 1, column: 33 }, - end: { line: 1, column: 34 } + start: { line: 1, column: 10 }, + end: { line: 1, column: 11 } } - }], - range: [25, 35], + }, + range: [5, 11], loc: { - start: { line: 1, column: 25 }, - end: { line: 1, column: 35 } + start: { line: 1, column: 5 }, + end: { line: 1, column: 11 } } }, - range: [25, 36], + range: [0, 11], loc: { - start: { line: 1, column: 25 }, - end: { line: 1, column: 36 } + start: { line: 1, column: 0 }, + end: { line: 1, column: 11 } } }, - each: false, - range: [0, 36], + range: [0, 11], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 36 } + end: { line: 1, column: 11 } } }, - 'for (let x in list) process(x);': { - type: 'ForInStatement', - left: { - type: 'VariableDeclaration', - declarations: [{ - type: 'VariableDeclarator', - id: { + 'x || y ^ z': { + type: 'ExpressionStatement', + expression: { + type: 'LogicalExpression', + operator: '||', + left: { + type: 'Identifier', + name: 'x', + range: [0, 1], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 1 } + } + }, + right: { + type: 'BinaryExpression', + operator: '^', + left: { type: 'Identifier', - name: 'x', + name: 'y', + range: [5, 6], + loc: { + start: { line: 1, column: 5 }, + end: { line: 1, column: 6 } + } + }, + right: { + type: 'Identifier', + name: 'z', range: [9, 10], loc: { start: { line: 1, column: 9 }, end: { line: 1, column: 10 } } }, - init: null, - range: [9, 10], + range: [5, 10], loc: { - start: { line: 1, column: 9 }, + start: { line: 1, column: 5 }, end: { line: 1, column: 10 } } - }], - kind: 'let', - range: [5, 10], + }, + range: [0, 10], loc: { - start: { line: 1, column: 5 }, + start: { line: 1, column: 0 }, end: { line: 1, column: 10 } } }, - right: { - type: 'Identifier', - name: 'list', - range: [14, 18], - loc: { - start: { line: 1, column: 14 }, - end: { line: 1, column: 18 } - } - }, - body: { - type: 'ExpressionStatement', - expression: { - type: 'CallExpression', - callee: { - type: 'Identifier', - name: 'process', - range: [20, 27], - loc: { - start: { line: 1, column: 20 }, - end: { line: 1, column: 27 } - } - }, - 'arguments': [{ - type: 'Identifier', - name: 'x', - range: [28, 29], - loc: { - start: { line: 1, column: 28 }, - end: { line: 1, column: 29 } - } - }], - range: [20, 30], + range: [0, 10], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 10 } + } + } + + }, + + 'Conditional Operator': { + + 'y ? 1 : 2': { + type: 'ExpressionStatement', + expression: { + type: 'ConditionalExpression', + test: { + type: 'Identifier', + name: 'y', + range: [0, 1], loc: { - start: { line: 1, column: 20 }, - end: { line: 1, column: 30 } + start: { line: 1, column: 0 }, + end: { line: 1, column: 1 } } }, - range: [20, 31], + consequent: { + type: 'Literal', + value: 1, + raw: '1', + range: [4, 5], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 5 } + } + }, + alternate: { + type: 'Literal', + value: 2, + raw: '2', + range: [8, 9], + loc: { + start: { line: 1, column: 8 }, + end: { line: 1, column: 9 } + } + }, + range: [0, 9], loc: { - start: { line: 1, column: 20 }, - end: { line: 1, column: 31 } + start: { line: 1, column: 0 }, + end: { line: 1, column: 9 } } }, - each: false, - range: [0, 31], + range: [0, 9], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 31 } + end: { line: 1, column: 9 } } }, - 'for (let x = 42 in list) process(x);': { - type: 'ForInStatement', - left: { - type: 'VariableDeclaration', - declarations: [{ - type: 'VariableDeclarator', - id: { + 'x && y ? 1 : 2': { + type: 'ExpressionStatement', + expression: { + type: 'ConditionalExpression', + test: { + type: 'LogicalExpression', + operator: '&&', + left: { type: 'Identifier', name: 'x', - range: [9, 10], + range: [0, 1], loc: { - start: { line: 1, column: 9 }, - end: { line: 1, column: 10 } + start: { line: 1, column: 0 }, + end: { line: 1, column: 1 } } }, - init: { - type: 'Literal', - value: 42, - raw: '42', - range: [13, 15], + right: { + type: 'Identifier', + name: 'y', + range: [5, 6], loc: { - start: { line: 1, column: 13 }, - end: { line: 1, column: 15 } + start: { line: 1, column: 5 }, + end: { line: 1, column: 6 } } }, - range: [9, 15], + range: [0, 6], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 6 } + } + }, + consequent: { + type: 'Literal', + value: 1, + raw: '1', + range: [9, 10], loc: { start: { line: 1, column: 9 }, - end: { line: 1, column: 15 } + end: { line: 1, column: 10 } } - }], - kind: 'let', - range: [5, 15], - loc: { - start: { line: 1, column: 5 }, - end: { line: 1, column: 15 } - } - }, - right: { - type: 'Identifier', - name: 'list', - range: [19, 23], + }, + alternate: { + type: 'Literal', + value: 2, + raw: '2', + range: [13, 14], + loc: { + start: { line: 1, column: 13 }, + end: { line: 1, column: 14 } + } + }, + range: [0, 14], loc: { - start: { line: 1, column: 19 }, - end: { line: 1, column: 23 } + start: { line: 1, column: 0 }, + end: { line: 1, column: 14 } } }, - body: { - type: 'ExpressionStatement', - expression: { - type: 'CallExpression', - callee: { - type: 'Identifier', - name: 'process', - range: [25, 32], - loc: { - start: { line: 1, column: 25 }, - end: { line: 1, column: 32 } - } + range: [0, 14], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 14 } + } + }, + 'x = (0) ? 1 : 2' : { + type: 'ExpressionStatement', + expression: { + type: 'AssignmentExpression', + operator: '=', + left: { + type: 'Identifier', + name: 'x', + range: [ 0, 1 ], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 1 } + } + }, + right: { + type: 'ConditionalExpression', + test: { + type: 'Literal', + value: 0, + raw: '0', + range: [ 5, 6 ], + loc: { start: { line: 1, column: 5 }, end: { line: 1, column: 6 } } }, - 'arguments': [{ - type: 'Identifier', - name: 'x', - range: [33, 34], - loc: { - start: { line: 1, column: 33 }, - end: { line: 1, column: 34 } - } - }], - range: [25, 35], + consequent: { + type: 'Literal', + value: 1, + raw: '1', + range: [ 10, 11 ], + loc: { start: { line: 1, column: 10 }, end: { line: 1, column: 11 } } + }, + alternate: { + type: 'Literal', + value: 2, + raw: '2', + range: [ 14, 15 ], + loc: { start: { line: 1, column: 14 }, end: { line: 1, column: 15 } } + }, + range: [ 4, 15 ], + loc: { start: { line: 1, column: 4 }, end: { line: 1, column: 15 } } + }, + range: [ 0, 15 ], + loc: { start: { line: 1, column: 0 }, end: { line: 1, column: 15 } } + }, + range: [ 0, 15 ], + loc: { start: { line: 1, column: 0 }, end: { line: 1, column: 15 } } + } + }, + + '[ES6] Arrow Function': { + + '() => "test"': { + type: 'ExpressionStatement', + expression: { + type: 'ArrowFunctionExpression', + id: null, + params: [], + defaults: [], + body: { + type: 'Literal', + value: 'test', + raw: '"test"', + range: [6, 12], loc: { - start: { line: 1, column: 25 }, - end: { line: 1, column: 35 } + start: { line: 1, column: 6 }, + end: { line: 1, column: 12 } } }, - range: [25, 36], + rest: null, + generator: false, + expression: true, + range: [0, 12], loc: { - start: { line: 1, column: 25 }, - end: { line: 1, column: 36 } + start: { line: 1, column: 0 }, + end: { line: 1, column: 12 } } }, - each: false, - range: [0, 36], + range: [0, 12], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 36 } + end: { line: 1, column: 12 } } }, - 'for (var i = function() { return 10 in [] } in list) process(x);': { - type: 'ForInStatement', - left: { - type: 'VariableDeclaration', - declarations: [{ - type: 'VariableDeclarator', - id: { - type: 'Identifier', - name: 'i', - range: [9, 10], - loc: { - start: { line: 1, column: 9 }, - end: { line: 1, column: 10 } - } - }, - init: { - type: 'FunctionExpression', - id: null, - params: [], - defaults: [], - body: { - type: 'BlockStatement', - body: [{ - type: 'ReturnStatement', - argument: { - type: 'BinaryExpression', - operator: 'in', - left: { - type: 'Literal', - value: 10, - raw: '10', - range: [33, 35], - loc: { - start: { line: 1, column: 33 }, - end: { line: 1, column: 35 } - } - }, - right: { - type: 'ArrayExpression', - elements: [], - range: [39, 41], - loc: { - start: { line: 1, column: 39 }, - end: { line: 1, column: 41 } - } - }, - range: [33, 41], - loc: { - start: { line: 1, column: 33 }, - end: { line: 1, column: 41 } - } - }, - range: [26, 42], - loc: { - start: { line: 1, column: 26 }, - end: { line: 1, column: 42 } - } - }], - range: [24, 43], - loc: { - start: { line: 1, column: 24 }, - end: { line: 1, column: 43 } - } - }, - rest: null, - generator: false, - expression: false, - range: [13, 43], - loc: { - start: { line: 1, column: 13 }, - end: { line: 1, column: 43 } - } - }, - range: [9, 43], + 'e => "test"': { + type: 'ExpressionStatement', + expression: { + type: 'ArrowFunctionExpression', + id: null, + params: [{ + type: 'Identifier', + name: 'e', + range: [0, 1], loc: { - start: { line: 1, column: 9 }, - end: { line: 1, column: 43 } + start: { line: 1, column: 0 }, + end: { line: 1, column: 1 } } }], - kind: 'var', - range: [5, 43], + defaults: [], + body: { + type: 'Literal', + value: 'test', + raw: '"test"', + range: [5, 11], + loc: { + start: { line: 1, column: 5 }, + end: { line: 1, column: 11 } + } + }, + rest: null, + generator: false, + expression: true, + range: [0, 11], loc: { - start: { line: 1, column: 5 }, - end: { line: 1, column: 43 } + start: { line: 1, column: 0 }, + end: { line: 1, column: 11 } } }, - right: { - type: 'Identifier', - name: 'list', - range: [47, 51], - loc: { - start: { line: 1, column: 47 }, - end: { line: 1, column: 51 } - } - }, - body: { - type: 'ExpressionStatement', - expression: { - type: 'CallExpression', - callee: { - type: 'Identifier', - name: 'process', - range: [53, 60], - loc: { - start: { line: 1, column: 53 }, - end: { line: 1, column: 60 } - } - }, - 'arguments': [{ - type: 'Identifier', - name: 'x', - range: [61, 62], - loc: { - start: { line: 1, column: 61 }, - end: { line: 1, column: 62 } - } - }], - range: [53, 63], - loc: { - start: { line: 1, column: 53 }, - end: { line: 1, column: 63 } - } - }, - range: [53, 64], - loc: { - start: { line: 1, column: 53 }, - end: { line: 1, column: 64 } - } - }, - each: false, - range: [0, 64], + range: [0, 11], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 64 } + end: { line: 1, column: 11 } } - } - - }, - - 'continue statement': { + }, - 'while (true) { continue; }': { - type: 'WhileStatement', - test: { - type: 'Literal', - value: true, - raw: 'true', - range: [7, 11], - loc: { - start: { line: 1, column: 7 }, - end: { line: 1, column: 11 } - } - }, - body: { - type: 'BlockStatement', - body: [ - { - type: 'ContinueStatement', - label: null, - range: [15, 24], - loc: { - start: { line: 1, column: 15 }, - end: { line: 1, column: 24 } - } + '(e) => "test"': { + type: 'ExpressionStatement', + expression: { + type: 'ArrowFunctionExpression', + id: null, + params: [{ + type: 'Identifier', + name: 'e', + range: [1, 2], + loc: { + start: { line: 1, column: 1 }, + end: { line: 1, column: 2 } } - ], - range: [13, 26], + }], + defaults: [], + body: { + type: 'Literal', + value: 'test', + raw: '"test"', + range: [7, 13], + loc: { + start: { line: 1, column: 7 }, + end: { line: 1, column: 13 } + } + }, + rest: null, + generator: false, + expression: true, + range: [0, 13], loc: { - start: { line: 1, column: 13 }, - end: { line: 1, column: 26 } + start: { line: 1, column: 0 }, + end: { line: 1, column: 13 } } }, - range: [0, 26], + range: [0, 13], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 26 } + end: { line: 1, column: 13 } } }, - 'while (true) { continue }': { - type: 'WhileStatement', - test: { - type: 'Literal', - value: true, - raw: 'true', - range: [7, 11], - loc: { - start: { line: 1, column: 7 }, - end: { line: 1, column: 11 } - } - }, - body: { - type: 'BlockStatement', - body: [ - { - type: 'ContinueStatement', - label: null, - range: [15, 24], - loc: { - start: { line: 1, column: 15 }, - end: { line: 1, column: 24 } - } + '(a, b) => "test"': { + type: 'ExpressionStatement', + expression: { + type: 'ArrowFunctionExpression', + id: null, + params: [{ + type: 'Identifier', + name: 'a', + range: [1, 2], + loc: { + start: { line: 1, column: 1 }, + end: { line: 1, column: 2 } } - ], - range: [13, 25], + }, { + type: 'Identifier', + name: 'b', + range: [4, 5], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 5 } + } + }], + defaults: [], + body: { + type: 'Literal', + value: 'test', + raw: '"test"', + range: [10, 16], + loc: { + start: { line: 1, column: 10 }, + end: { line: 1, column: 16 } + } + }, + rest: null, + generator: false, + expression: true, + range: [0, 16], loc: { - start: { line: 1, column: 13 }, - end: { line: 1, column: 25 } + start: { line: 1, column: 0 }, + end: { line: 1, column: 16 } } }, - range: [0, 25], + range: [0, 16], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 25 } + end: { line: 1, column: 16 } } }, - 'done: while (true) { continue done }': { - type: 'LabeledStatement', - label: { - type: 'Identifier', - name: 'done', - range: [0, 4], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 4 } - } - }, - body: { - type: 'WhileStatement', - test: { - type: 'Literal', - value: true, - raw: 'true', - range: [13, 17], + 'e => { 42; }': { + type: 'ExpressionStatement', + expression: { + type: 'ArrowFunctionExpression', + id: null, + params: [{ + type: 'Identifier', + name: 'e', + range: [0, 1], loc: { - start: { line: 1, column: 13 }, - end: { line: 1, column: 17 } + start: { line: 1, column: 0 }, + end: { line: 1, column: 1 } } - }, + }], + defaults: [], body: { type: 'BlockStatement', - body: [ - { - type: 'ContinueStatement', - label: { - type: 'Identifier', - name: 'done', - range: [30, 34], - loc: { - start: { line: 1, column: 30 }, - end: { line: 1, column: 34 } - } - }, - range: [21, 35], + body: [{ + type: 'ExpressionStatement', + expression: { + type: 'Literal', + value: 42, + raw: '42', + range: [7, 9], loc: { - start: { line: 1, column: 21 }, - end: { line: 1, column: 35 } + start: { line: 1, column: 7 }, + end: { line: 1, column: 9 } } + }, + range: [7, 10], + loc: { + start: { line: 1, column: 7 }, + end: { line: 1, column: 10 } } - ], - range: [19, 36], + }], + range: [5, 12], loc: { - start: { line: 1, column: 19 }, - end: { line: 1, column: 36 } + start: { line: 1, column: 5 }, + end: { line: 1, column: 12 } } }, - range: [6, 36], + rest: null, + generator: false, + expression: false, + range: [0, 12], loc: { - start: { line: 1, column: 6 }, - end: { line: 1, column: 36 } + start: { line: 1, column: 0 }, + end: { line: 1, column: 12 } } }, - range: [0, 36], + range: [0, 12], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 36 } + end: { line: 1, column: 12 } } }, - 'done: while (true) { continue done; }': { - type: 'LabeledStatement', - label: { - type: 'Identifier', - name: 'done', - range: [0, 4], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 4 } - } - }, - body: { - type: 'WhileStatement', - test: { - type: 'Literal', - value: true, - raw: 'true', - range: [13, 17], + 'e => ({ property: 42 })': { + type: 'ExpressionStatement', + expression: { + type: 'ArrowFunctionExpression', + id: null, + params: [{ + type: 'Identifier', + name: 'e', + range: [0, 1], loc: { - start: { line: 1, column: 13 }, - end: { line: 1, column: 17 } + start: { line: 1, column: 0 }, + end: { line: 1, column: 1 } } - }, + }], + defaults: [], body: { - type: 'BlockStatement', - body: [ - { - type: 'ContinueStatement', - label: { - type: 'Identifier', - name: 'done', - range: [30, 34], - loc: { - start: { line: 1, column: 30 }, - end: { line: 1, column: 34 } - } - }, - range: [21, 35], + type: 'ObjectExpression', + properties: [{ + type: 'Property', + key: { + type: 'Identifier', + name: 'property', + range: [8, 16], loc: { - start: { line: 1, column: 21 }, - end: { line: 1, column: 35 } + start: { line: 1, column: 8 }, + end: { line: 1, column: 16 } } + }, + value: { + type: 'Literal', + value: 42, + raw: '42', + range: [18, 20], + loc: { + start: { line: 1, column: 18 }, + end: { line: 1, column: 20 } + } + }, + kind: 'init', + method: false, + shorthand: false, + range: [8, 20], + loc: { + start: { line: 1, column: 8 }, + end: { line: 1, column: 20 } } - ], - range: [19, 37], + }], + range: [6, 22], loc: { - start: { line: 1, column: 19 }, - end: { line: 1, column: 37 } + start: { line: 1, column: 6 }, + end: { line: 1, column: 22 } } }, - range: [6, 37], + rest: null, + generator: false, + expression: true, + range: [0, 23], loc: { - start: { line: 1, column: 6 }, - end: { line: 1, column: 37 } + start: { line: 1, column: 0 }, + end: { line: 1, column: 23 } } }, - range: [0, 37], + range: [0, 23], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 37 } + end: { line: 1, column: 23 } } - } - - }, - - 'break statement': { + }, - 'while (true) { break }': { - type: 'WhileStatement', - test: { - type: 'Literal', - value: true, - raw: 'true', - range: [7, 11], - loc: { - start: { line: 1, column: 7 }, - end: { line: 1, column: 11 } - } - }, - body: { - type: 'BlockStatement', - body: [ - { - type: 'BreakStatement', - label: null, - range: [15, 21], + // Not an object! + 'e => { label: 42 }': { + type: 'ExpressionStatement', + expression: { + type: 'ArrowFunctionExpression', + id: null, + params: [{ + type: 'Identifier', + name: 'e', + range: [0, 1], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 1 } + } + }], + defaults: [], + body: { + type: 'BlockStatement', + body: [{ + type: 'LabeledStatement', + label: { + type: 'Identifier', + name: 'label', + range: [7, 12], + loc: { + start: { line: 1, column: 7 }, + end: { line: 1, column: 12 } + } + }, + body: { + type: 'ExpressionStatement', + expression: { + type: 'Literal', + value: 42, + raw: '42', + range: [14, 16], + loc: { + start: { line: 1, column: 14 }, + end: { line: 1, column: 16 } + } + }, + range: [14, 17], + loc: { + start: { line: 1, column: 14 }, + end: { line: 1, column: 17 } + } + }, + range: [7, 17], loc: { - start: { line: 1, column: 15 }, - end: { line: 1, column: 21 } + start: { line: 1, column: 7 }, + end: { line: 1, column: 17 } } + }], + range: [5, 18], + loc: { + start: { line: 1, column: 5 }, + end: { line: 1, column: 18 } } - ], - range: [13, 22], + }, + rest: null, + generator: false, + expression: false, + range: [0, 18], loc: { - start: { line: 1, column: 13 }, - end: { line: 1, column: 22 } + start: { line: 1, column: 0 }, + end: { line: 1, column: 18 } } }, - range: [0, 22], + range: [0, 18], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 22 } + end: { line: 1, column: 18 } } }, - 'done: while (true) { break done }': { - type: 'LabeledStatement', - label: { - type: 'Identifier', - name: 'done', - range: [0, 4], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 4 } - } - }, - body: { - type: 'WhileStatement', - test: { - type: 'Literal', - value: true, - raw: 'true', - range: [13, 17], + '(a, b) => { 42; }': { + type: 'ExpressionStatement', + expression: { + type: 'ArrowFunctionExpression', + id: null, + params: [{ + type: 'Identifier', + name: 'a', + range: [1, 2], loc: { - start: { line: 1, column: 13 }, - end: { line: 1, column: 17 } + start: { line: 1, column: 1 }, + end: { line: 1, column: 2 } } - }, + }, { + type: 'Identifier', + name: 'b', + range: [4, 5], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 5 } + } + }], + defaults: [], body: { type: 'BlockStatement', - body: [ - { - type: 'BreakStatement', - label: { - type: 'Identifier', - name: 'done', - range: [27, 31], - loc: { - start: { line: 1, column: 27 }, - end: { line: 1, column: 31 } - } - }, - range: [21, 32], + body: [{ + type: 'ExpressionStatement', + expression: { + type: 'Literal', + value: 42, + raw: '42', + range: [12, 14], loc: { - start: { line: 1, column: 21 }, - end: { line: 1, column: 32 } + start: { line: 1, column: 12 }, + end: { line: 1, column: 14 } } + }, + range: [12, 15], + loc: { + start: { line: 1, column: 12 }, + end: { line: 1, column: 15 } } - ], - range: [19, 33], + }], + range: [10, 17], loc: { - start: { line: 1, column: 19 }, - end: { line: 1, column: 33 } + start: { line: 1, column: 10 }, + end: { line: 1, column: 17 } } }, - range: [6, 33], + rest: null, + generator: false, + expression: false, + range: [0, 17], loc: { - start: { line: 1, column: 6 }, - end: { line: 1, column: 33 } + start: { line: 1, column: 0 }, + end: { line: 1, column: 17 } } }, - range: [0, 33], + range: [0, 17], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 33 } + end: { line: 1, column: 17 } } }, - 'done: while (true) { break done; }': { - type: 'LabeledStatement', - label: { - type: 'Identifier', - name: 'done', - range: [0, 4], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 4 } - } - }, - body: { - type: 'WhileStatement', - test: { + '(x=1) => x * x': { + type: 'ExpressionStatement', + expression: { + type: 'ArrowFunctionExpression', + id: null, + params: [{ + type: 'Identifier', + name: 'x', + range: [1, 2], + loc: { + start: { line: 1, column: 1 }, + end: { line: 1, column: 2 } + } + }], + defaults: [{ type: 'Literal', - value: true, - raw: 'true', - range: [13, 17], + value: 1, + raw: '1', + range: [3, 4], loc: { - start: { line: 1, column: 13 }, - end: { line: 1, column: 17 } + start: { line: 1, column: 3 }, + end: { line: 1, column: 4 } } - }, + }], body: { - type: 'BlockStatement', - body: [ - { - type: 'BreakStatement', - label: { - type: 'Identifier', - name: 'done', - range: [27, 31], - loc: { - start: { line: 1, column: 27 }, - end: { line: 1, column: 31 } - } - }, - range: [21, 32], - loc: { - start: { line: 1, column: 21 }, - end: { line: 1, column: 32 } - } + type: 'BinaryExpression', + operator: '*', + left: { + type: 'Identifier', + name: 'x', + range: [9, 10], + loc: { + start: { line: 1, column: 9 }, + end: { line: 1, column: 10 } } - ], - range: [19, 34], + }, + right: { + type: 'Identifier', + name: 'x', + range: [13, 14], + loc: { + start: { line: 1, column: 13 }, + end: { line: 1, column: 14 } + } + }, + range: [9, 14], loc: { - start: { line: 1, column: 19 }, - end: { line: 1, column: 34 } + start: { line: 1, column: 9 }, + end: { line: 1, column: 14 } } }, - range: [6, 34], + rest: null, + generator: false, + expression: true, + range: [0, 14], loc: { - start: { line: 1, column: 6 }, - end: { line: 1, column: 34 } + start: { line: 1, column: 0 }, + end: { line: 1, column: 14 } } }, - range: [0, 34], + range: [0, 14], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 34 } + end: { line: 1, column: 14 } } - } - - }, - - 'return statement': { + }, - '(function(){ return })': { + // not strict mode, using eval + 'eval => 42': { type: 'ExpressionStatement', expression: { - type: 'FunctionExpression', + type: 'ArrowFunctionExpression', id: null, - params: [], + params: [{ + type: 'Identifier', + name: 'eval', + range: [0, 4], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 4 } + } + }], defaults: [], body: { - type: 'BlockStatement', - body: [ - { - type: 'ReturnStatement', - argument: null, - range: [13, 20], - loc: { - start: { line: 1, column: 13 }, - end: { line: 1, column: 20 } - } - } - ], - range: [11, 21], + type: 'Literal', + value: 42, + raw: '42', + range: [8, 10], loc: { - start: { line: 1, column: 11 }, - end: { line: 1, column: 21 } + start: { line: 1, column: 8 }, + end: { line: 1, column: 10 } } }, rest: null, generator: false, - expression: false, - range: [1, 21], + expression: true, + range: [0, 10], loc: { - start: { line: 1, column: 1 }, - end: { line: 1, column: 21 } + start: { line: 1, column: 0 }, + end: { line: 1, column: 10 } } }, - range: [0, 22], + range: [0, 10], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 22 } + end: { line: 1, column: 10 } } }, - '(function(){ return; })': { + // not strict mode, using arguments + 'arguments => 42': { type: 'ExpressionStatement', expression: { - type: 'FunctionExpression', + type: 'ArrowFunctionExpression', id: null, - params: [], + params: [{ + type: 'Identifier', + name: 'arguments', + range: [0, 9], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 9 } + } + }], defaults: [], body: { - type: 'BlockStatement', - body: [ - { - type: 'ReturnStatement', - argument: null, - range: [13, 20], - loc: { - start: { line: 1, column: 13 }, - end: { line: 1, column: 20 } - } - } - ], - range: [11, 22], + type: 'Literal', + value: 42, + raw: '42', + range: [13, 15], loc: { - start: { line: 1, column: 11 }, - end: { line: 1, column: 22 } + start: { line: 1, column: 13 }, + end: { line: 1, column: 15 } } }, rest: null, generator: false, - expression: false, - range: [1, 22], + expression: true, + range: [0, 15], loc: { - start: { line: 1, column: 1 }, - end: { line: 1, column: 22 } + start: { line: 1, column: 0 }, + end: { line: 1, column: 15 } } }, - range: [0, 23], + range: [0, 15], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 23 } + end: { line: 1, column: 15 } } }, - '(function(){ return x; })': { + // not strict mode, using octals + '(a) => 00': { type: 'ExpressionStatement', expression: { - type: 'FunctionExpression', + type: 'ArrowFunctionExpression', id: null, - params: [], + params: [{ + type: 'Identifier', + name: 'a', + range: [1, 2], + loc: { + start: { line: 1, column: 1 }, + end: { line: 1, column: 2 } + } + }], defaults: [], body: { - type: 'BlockStatement', - body: [ - { - type: 'ReturnStatement', - argument: { - type: 'Identifier', - name: 'x', - range: [20, 21], - loc: { - start: { line: 1, column: 20 }, - end: { line: 1, column: 21 } - } - }, - range: [13, 22], - loc: { - start: { line: 1, column: 13 }, - end: { line: 1, column: 22 } - } - } - ], - range: [11, 24], + type: 'Literal', + value: 0, + raw: '00', + range: [7, 9], loc: { - start: { line: 1, column: 11 }, - end: { line: 1, column: 24 } + start: { line: 1, column: 7 }, + end: { line: 1, column: 9 } } }, rest: null, generator: false, - expression: false, - range: [1, 24], + expression: true, + range: [0, 9], loc: { - start: { line: 1, column: 1 }, - end: { line: 1, column: 24 } + start: { line: 1, column: 0 }, + end: { line: 1, column: 9 } } }, - range: [0, 25], + range: [0, 9], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 25 } + end: { line: 1, column: 9 } } }, - '(function(){ return x * y })': { + // not strict mode, using eval, IsSimpleParameterList is true + '(eval, a) => 42': { type: 'ExpressionStatement', expression: { - type: 'FunctionExpression', + type: 'ArrowFunctionExpression', id: null, - params: [], + params: [{ + type: 'Identifier', + name: 'eval', + range: [1, 5], + loc: { + start: { line: 1, column: 1 }, + end: { line: 1, column: 5 } + } + }, { + type: 'Identifier', + name: 'a', + range: [7, 8], + loc: { + start: { line: 1, column: 7 }, + end: { line: 1, column: 8 } + } + }], defaults: [], body: { - type: 'BlockStatement', - body: [ - { - type: 'ReturnStatement', - argument: { - type: 'BinaryExpression', - operator: '*', - left: { - type: 'Identifier', - name: 'x', - range: [20, 21], - loc: { - start: { line: 1, column: 20 }, - end: { line: 1, column: 21 } - } - }, - right: { - type: 'Identifier', - name: 'y', - range: [24, 25], - loc: { - start: { line: 1, column: 24 }, - end: { line: 1, column: 25 } - } - }, - range: [20, 25], - loc: { - start: { line: 1, column: 20 }, - end: { line: 1, column: 25 } - } - }, - range: [13, 26], - loc: { - start: { line: 1, column: 13 }, - end: { line: 1, column: 26 } - } - } - ], - range: [11, 27], + type: 'Literal', + value: 42, + raw: '42', + range: [13, 15], loc: { - start: { line: 1, column: 11 }, - end: { line: 1, column: 27 } + start: { line: 1, column: 13 }, + end: { line: 1, column: 15 } } }, rest: null, generator: false, - expression: false, - range: [1, 27], + expression: true, + range: [0, 15], loc: { - start: { line: 1, column: 1 }, - end: { line: 1, column: 27 } + start: { line: 1, column: 0 }, + end: { line: 1, column: 15 } } }, - range: [0, 28], + range: [0, 15], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 28 } + end: { line: 1, column: 15 } } - } - }, - - 'with statement': { + }, - 'with (x) foo = bar': { - type: 'WithStatement', - object: { - type: 'Identifier', - name: 'x', - range: [6, 7], - loc: { - start: { line: 1, column: 6 }, - end: { line: 1, column: 7 } - } - }, - body: { - type: 'ExpressionStatement', - expression: { - type: 'AssignmentExpression', - operator: '=', - left: { - type: 'Identifier', - name: 'foo', - range: [9, 12], - loc: { - start: { line: 1, column: 9 }, - end: { line: 1, column: 12 } - } - }, - right: { - type: 'Identifier', - name: 'bar', - range: [15, 18], - loc: { - start: { line: 1, column: 15 }, - end: { line: 1, column: 18 } - } - }, - range: [9, 18], + // not strict mode, assigning to eval + '(eval = 10) => 42': { + type: 'ExpressionStatement', + expression: { + type: 'ArrowFunctionExpression', + id: null, + params: [{ + type: 'Identifier', + name: 'eval', + range: [1, 5], loc: { - start: { line: 1, column: 9 }, - end: { line: 1, column: 18 } + start: { line: 1, column: 1 }, + end: { line: 1, column: 5 } + } + }], + defaults: [{ + type: 'Literal', + value: 10, + raw: '10', + range: [8, 10], + loc: { + start: { line: 1, column: 8 }, + end: { line: 1, column: 10 } + } + }], + body: { + type: 'Literal', + value: 42, + raw: '42', + range: [15, 17], + loc: { + start: { line: 1, column: 15 }, + end: { line: 1, column: 17 } } }, - range: [9, 18], + rest: null, + generator: false, + expression: true, + range: [0, 17], loc: { - start: { line: 1, column: 9 }, - end: { line: 1, column: 18 } + start: { line: 1, column: 0 }, + end: { line: 1, column: 17 } } }, - range: [0, 18], + range: [0, 17], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 18 } + end: { line: 1, column: 17 } } }, - 'with (x) foo = bar;': { - type: 'WithStatement', - object: { - type: 'Identifier', - name: 'x', - range: [6, 7], - loc: { - start: { line: 1, column: 6 }, - end: { line: 1, column: 7 } - } - }, - body: { - type: 'ExpressionStatement', - expression: { - type: 'AssignmentExpression', - operator: '=', - left: { - type: 'Identifier', - name: 'foo', - range: [9, 12], - loc: { - start: { line: 1, column: 9 }, - end: { line: 1, column: 12 } - } - }, - right: { - type: 'Identifier', - name: 'bar', - range: [15, 18], - loc: { - start: { line: 1, column: 15 }, - end: { line: 1, column: 18 } - } - }, - range: [9, 18], + // not strict mode, using eval, IsSimpleParameterList is false + '(eval, a = 10) => 42': { + type: 'ExpressionStatement', + expression: { + type: 'ArrowFunctionExpression', + id: null, + params: [{ + type: 'Identifier', + name: 'eval', + range: [1, 5], loc: { - start: { line: 1, column: 9 }, - end: { line: 1, column: 18 } + start: { line: 1, column: 1 }, + end: { line: 1, column: 5 } + } + }, { + type: 'Identifier', + name: 'a', + range: [7, 8], + loc: { + start: { line: 1, column: 7 }, + end: { line: 1, column: 8 } + } + }], + defaults: [null, { + type: 'Literal', + value: 10, + raw: '10', + range: [11, 13], + loc: { + start: { line: 1, column: 11 }, + end: { line: 1, column: 13 } + } + }], + body: { + type: 'Literal', + value: 42, + raw: '42', + range: [18, 20], + loc: { + start: { line: 1, column: 18 }, + end: { line: 1, column: 20 } } }, - range: [9, 19], + rest: null, + generator: false, + expression: true, + range: [0, 20], loc: { - start: { line: 1, column: 9 }, - end: { line: 1, column: 19 } + start: { line: 1, column: 0 }, + end: { line: 1, column: 20 } } }, - range: [0, 19], + range: [0, 20], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 19 } + end: { line: 1, column: 20 } } }, - 'with (x) { foo = bar }': { - type: 'WithStatement', - object: { - type: 'Identifier', - name: 'x', - range: [6, 7], + '(x => x)': { + type: 'ExpressionStatement', + expression: { + type: 'ArrowFunctionExpression', + id: null, + params: [{ + type: 'Identifier', + name: 'x', + range: [1, 2], + loc: { + start: { line: 1, column: 1 }, + end: { line: 1, column: 2 } + } + }], + defaults: [], + body: { + type: 'Identifier', + name: 'x', + range: [6, 7], + loc: { + start: { line: 1, column: 6 }, + end: { line: 1, column: 7 } + } + }, + rest: null, + generator: false, + expression: true, + range: [1, 7], loc: { - start: { line: 1, column: 6 }, + start: { line: 1, column: 1 }, end: { line: 1, column: 7 } } }, - body: { - type: 'BlockStatement', - body: [{ - type: 'ExpressionStatement', - expression: { - type: 'AssignmentExpression', - operator: '=', - left: { - type: 'Identifier', - name: 'foo', - range: [11, 14], - loc: { - start: { line: 1, column: 11 }, - end: { line: 1, column: 14 } - } - }, - right: { - type: 'Identifier', - name: 'bar', - range: [17, 20], - loc: { - start: { line: 1, column: 17 }, - end: { line: 1, column: 20 } - } - }, - range: [11, 20], + range: [0, 8], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 8 } + } + }, + + 'x => y => 42': { + type: 'ExpressionStatement', + expression: { + type: 'ArrowFunctionExpression', + id: null, + params: [{ + type: 'Identifier', + name: 'x', + range: [0, 1], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 1 } + } + }], + defaults: [], + body: { + type: 'ArrowFunctionExpression', + id: null, + params: [{ + type: 'Identifier', + name: 'y', + range: [5, 6], loc: { - start: { line: 1, column: 11 }, - end: { line: 1, column: 20 } + start: { line: 1, column: 5 }, + end: { line: 1, column: 6 } + } + }], + defaults: [], + body: { + type: 'Literal', + value: 42, + raw: '42', + range: [10, 12], + loc: { + start: { line: 1, column: 10 }, + end: { line: 1, column: 12 } } }, - range: [11, 21], + rest: null, + generator: false, + expression: true, + range: [5, 12], loc: { - start: { line: 1, column: 11 }, - end: { line: 1, column: 21 } + start: { line: 1, column: 5 }, + end: { line: 1, column: 12 } } - }], - range: [9, 22], - loc: { - start: { line: 1, column: 9 }, - end: { line: 1, column: 22 } - } - }, - range: [0, 22], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 22 } - } - } - - }, - - 'switch statement': { - - 'switch (x) {}': { - type: 'SwitchStatement', - discriminant: { - type: 'Identifier', - name: 'x', - range: [8, 9], + }, + rest: null, + generator: false, + expression: true, + range: [0, 12], loc: { - start: { line: 1, column: 8 }, - end: { line: 1, column: 9 } + start: { line: 1, column: 0 }, + end: { line: 1, column: 12 } } }, - cases:[], - range: [0, 13], + range: [0, 12], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 13 } + end: { line: 1, column: 12 } } }, - 'switch (answer) { case 42: hi(); break; }': { - type: 'SwitchStatement', - discriminant: { - type: 'Identifier', - name: 'answer', - range: [8, 14], - loc: { - start: { line: 1, column: 8 }, - end: { line: 1, column: 14 } - } - }, - cases: [{ - type: 'SwitchCase', - test: { - type: 'Literal', - value: 42, - raw: '42', - range: [23, 25], + '(x) => ((y, z) => (x, y, z))': { + type: 'ExpressionStatement', + expression: { + type: 'ArrowFunctionExpression', + id: null, + params: [{ + type: 'Identifier', + name: 'x', + range: [1, 2], loc: { - start: { line: 1, column: 23 }, - end: { line: 1, column: 25 } + start: { line: 1, column: 1 }, + end: { line: 1, column: 2 } } - }, - consequent: [{ - type: 'ExpressionStatement', - expression: { - type: 'CallExpression', - callee: { + }], + defaults: [], + body: { + type: 'ArrowFunctionExpression', + id: null, + params: [{ + type: 'Identifier', + name: 'y', + range: [9, 10], + loc: { + start: { line: 1, column: 9 }, + end: { line: 1, column: 10 } + } + }, { + type: 'Identifier', + name: 'z', + range: [12, 13], + loc: { + start: { line: 1, column: 12 }, + end: { line: 1, column: 13 } + } + }], + defaults: [], + body: { + type: 'SequenceExpression', + expressions: [{ type: 'Identifier', - name: 'hi', - range: [27, 29], + name: 'x', + range: [19, 20], loc: { - start: { line: 1, column: 27 }, - end: { line: 1, column: 29 } + start: { line: 1, column: 19 }, + end: { line: 1, column: 20 } } - }, - 'arguments': [], - range: [27, 31], + }, { + type: 'Identifier', + name: 'y', + range: [22, 23], + loc: { + start: { line: 1, column: 22 }, + end: { line: 1, column: 23 } + } + }, { + type: 'Identifier', + name: 'z', + range: [25, 26], + loc: { + start: { line: 1, column: 25 }, + end: { line: 1, column: 26 } + } + }], + range: [19, 26], loc: { - start: { line: 1, column: 27 }, - end: { line: 1, column: 31 } + start: { line: 1, column: 19 }, + end: { line: 1, column: 26 } } }, - range: [27, 32], - loc: { - start: { line: 1, column: 27 }, - end: { line: 1, column: 32 } - } - }, { - type: 'BreakStatement', - label: null, - range: [33, 39], + rest: null, + generator: false, + expression: true, + range: [8, 27], loc: { - start: { line: 1, column: 33 }, - end: { line: 1, column: 39 } + start: { line: 1, column: 8 }, + end: { line: 1, column: 27 } } - }], - range: [18, 39], + }, + rest: null, + generator: false, + expression: true, + range: [0, 28], loc: { - start: { line: 1, column: 18 }, - end: { line: 1, column: 39 } + start: { line: 1, column: 0 }, + end: { line: 1, column: 28 } } - }], - range: [0, 41], + }, + range: [0, 28], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 41 } + end: { line: 1, column: 28 } } }, - 'switch (answer) { case 42: hi(); break; default: break }': { - type: 'SwitchStatement', - discriminant: { - type: 'Identifier', - name: 'answer', - range: [8, 14], - loc: { - start: { line: 1, column: 8 }, - end: { line: 1, column: 14 } - } - }, - cases: [{ - type: 'SwitchCase', - test: { - type: 'Literal', - value: 42, - raw: '42', - range: [23, 25], + 'foo(() => {})': { + type: 'ExpressionStatement', + expression: { + type: 'CallExpression', + callee: { + type: 'Identifier', + name: 'foo', + range: [0, 3], loc: { - start: { line: 1, column: 23 }, - end: { line: 1, column: 25 } + start: { line: 1, column: 0 }, + end: { line: 1, column: 3 } } }, - consequent: [{ - type: 'ExpressionStatement', - expression: { - type: 'CallExpression', - callee: { - type: 'Identifier', - name: 'hi', - range: [27, 29], - loc: { - start: { line: 1, column: 27 }, - end: { line: 1, column: 29 } - } - }, - 'arguments': [], - range: [27, 31], + 'arguments': [{ + type: 'ArrowFunctionExpression', + id: null, + params: [], + defaults: [], + body: { + type: 'BlockStatement', + body: [], + range: [10, 12], loc: { - start: { line: 1, column: 27 }, - end: { line: 1, column: 31 } + start: { line: 1, column: 10 }, + end: { line: 1, column: 12 } } }, - range: [27, 32], - loc: { - start: { line: 1, column: 27 }, - end: { line: 1, column: 32 } - } - }, { - type: 'BreakStatement', - label: null, - range: [33, 39], - loc: { - start: { line: 1, column: 33 }, - end: { line: 1, column: 39 } - } - }], - range: [18, 39], - loc: { - start: { line: 1, column: 18 }, - end: { line: 1, column: 39 } - } - }, { - type: 'SwitchCase', - test: null, - consequent: [{ - type: 'BreakStatement', - label: null, - range: [49, 55], + rest: null, + generator: false, + expression: false, + range: [4, 12], loc: { - start: { line: 1, column: 49 }, - end: { line: 1, column: 55 } + start: { line: 1, column: 4 }, + end: { line: 1, column: 12 } } }], - range: [40, 55], + range: [0, 13], loc: { - start: { line: 1, column: 40 }, - end: { line: 1, column: 55 } + start: { line: 1, column: 0 }, + end: { line: 1, column: 13 } } - }], - range: [0, 56], + }, + range: [0, 13], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 56 } + end: { line: 1, column: 13 } } - } - - }, - - 'Labelled Statements': { + }, - 'start: for (;;) break start': { - type: 'LabeledStatement', - label: { - type: 'Identifier', - name: 'start', - range: [0, 5], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 5 } - } - }, - body: { - type: 'ForStatement', - init: null, - test: null, - update: null, - body: { - type: 'BreakStatement', - label: { + 'foo((x, y) => {})': { + type: 'ExpressionStatement', + expression: { + type: 'CallExpression', + callee: { + type: 'Identifier', + name: 'foo', + range: [0, 3], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 3 } + } + }, + 'arguments': [{ + type: 'ArrowFunctionExpression', + id: null, + params: [{ type: 'Identifier', - name: 'start', - range: [22, 27], + name: 'x', + range: [5, 6], loc: { - start: { line: 1, column: 22 }, - end: { line: 1, column: 27 } + start: { line: 1, column: 5 }, + end: { line: 1, column: 6 } + } + }, { + type: 'Identifier', + name: 'y', + range: [8, 9], + loc: { + start: { line: 1, column: 8 }, + end: { line: 1, column: 9 } + } + }], + defaults: [], + body: { + type: 'BlockStatement', + body: [], + range: [14, 16], + loc: { + start: { line: 1, column: 14 }, + end: { line: 1, column: 16 } } }, - range: [16, 27], + rest: null, + generator: false, + expression: false, + range: [4, 16], loc: { - start: { line: 1, column: 16 }, - end: { line: 1, column: 27 } + start: { line: 1, column: 4 }, + end: { line: 1, column: 16 } } - }, - range: [7, 27], + }], + range: [0, 17], loc: { - start: { line: 1, column: 7 }, - end: { line: 1, column: 27 } + start: { line: 1, column: 0 }, + end: { line: 1, column: 17 } } }, - range: [0, 27], + range: [0, 17], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 27 } + end: { line: 1, column: 17 } } }, - 'start: while (true) break start': { - type: 'LabeledStatement', - label: { - type: 'Identifier', - name: 'start', - range: [0, 5], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 5 } - } - }, - body: { - type: 'WhileStatement', - test: { - type: 'Literal', - value: true, - raw: 'true', - range: [14, 18], - loc: { - start: { line: 1, column: 14 }, - end: { line: 1, column: 18 } - } - }, - body: { - type: 'BreakStatement', - label: { - type: 'Identifier', - name: 'start', - range: [26, 31], + '(sun) => earth': { + type: "Program", + body: [{ + type: "ExpressionStatement", + expression: { + type: "ArrowFunctionExpression", + id: null, + params: [{ + type: "Identifier", + name: "sun", + range: [1, 4], loc: { - start: { line: 1, column: 26 }, - end: { line: 1, column: 31 } + start: { line: 1, column: 1 }, + end: { line: 1, column: 4 } + } + }], + defaults: [], + body: { + type: "Identifier", + name: "earth", + range: [9, 14], + loc: { + start: { line: 1, column: 9 }, + end: { line: 1, column: 14 } } }, - range: [20, 31], + rest: null, + generator: false, + expression: true, + range: [0, 14], loc: { - start: { line: 1, column: 20 }, - end: { line: 1, column: 31 } + start: { line: 1, column: 0 }, + end: { line: 1, column: 14 } } }, - range: [7, 31], + range: [0, 14], loc: { - start: { line: 1, column: 7 }, - end: { line: 1, column: 31 } + start: { line: 1, column: 0 }, + end: { line: 1, column: 14 } } - }, - range: [0, 31], + }], + range: [0, 14], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 31 } - } + end: { line: 1, column: 14 } + }, + tokens: [{ + type: "Punctuator", + value: "(", + range: [0, 1], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 1 } + } + }, { + type: "Identifier", + value: "sun", + range: [1, 4], + loc: { + start: { line: 1, column: 1 }, + end: { line: 1, column: 4 } + } + }, { + type: "Punctuator", + value: ")", + range: [4, 5], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 5 } + } + }, { + type: "Punctuator", + value: "=>", + range: [6, 8], + loc: { + start: { line: 1, column: 6 }, + end: { line: 1, column: 8 } + } + }, { + type: "Identifier", + value: "earth", + range: [9, 14], + loc: { + start: { line: 1, column: 9 }, + end: { line: 1, column: 14 } + } + }] } }, - 'throw statement': { + '[ES6] Method Definition': { - 'throw x;': { - type: 'ThrowStatement', - argument: { - type: 'Identifier', - name: 'x', - range: [6, 7], + 'x = { method() { } }': { + type: 'ExpressionStatement', + expression: { + type: 'AssignmentExpression', + operator: '=', + left: { + type: 'Identifier', + name: 'x', + range: [0, 1], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 1 } + } + }, + right: { + type: 'ObjectExpression', + properties: [{ + type: 'Property', + key: { + type: 'Identifier', + name: 'method', + range: [6, 12], + loc: { + start: { line: 1, column: 6 }, + end: { line: 1, column: 12 } + } + }, + value: { + type: 'FunctionExpression', + id: null, + params: [], + defaults: [], + body: { + type: 'BlockStatement', + body: [], + range: [15, 18], + loc: { + start: { line: 1, column: 15 }, + end: { line: 1, column: 18 } + } + }, + rest: null, + generator: false, + expression: false, + range: [15, 18], + loc: { + start: { line: 1, column: 15 }, + end: { line: 1, column: 18 } + } + }, + kind: 'init', + method: true, + shorthand: false, + range: [6, 18], + loc: { + start: { line: 1, column: 6 }, + end: { line: 1, column: 18 } + } + }], + range: [4, 20], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 20 } + } + }, + range: [0, 20], loc: { - start: { line: 1, column: 6 }, - end: { line: 1, column: 7 } + start: { line: 1, column: 0 }, + end: { line: 1, column: 20 } } }, - range: [0, 8], + range: [0, 20], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 8 } + end: { line: 1, column: 20 } } }, - 'throw x * y': { - type: 'ThrowStatement', - argument: { - type: 'BinaryExpression', - operator: '*', + 'x = { method(test) { } }': { + type: 'ExpressionStatement', + expression: { + type: 'AssignmentExpression', + operator: '=', left: { type: 'Identifier', name: 'x', - range: [6, 7], + range: [0, 1], loc: { - start: { line: 1, column: 6 }, - end: { line: 1, column: 7 } + start: { line: 1, column: 0 }, + end: { line: 1, column: 1 } } }, right: { - type: 'Identifier', - name: 'y', - range: [10, 11], + type: 'ObjectExpression', + properties: [{ + type: 'Property', + key: { + type: 'Identifier', + name: 'method', + range: [6, 12], + loc: { + start: { line: 1, column: 6 }, + end: { line: 1, column: 12 } + } + }, + value: { + type: 'FunctionExpression', + id: null, + params: [{ + type: 'Identifier', + name: 'test', + range: [13, 17], + loc: { + start: { line: 1, column: 13 }, + end: { line: 1, column: 17 } + } + }], + defaults: [], + body: { + type: 'BlockStatement', + body: [], + range: [19, 22], + loc: { + start: { line: 1, column: 19 }, + end: { line: 1, column: 22 } + } + }, + rest: null, + generator: false, + expression: false, + range: [19, 22], + loc: { + start: { line: 1, column: 19 }, + end: { line: 1, column: 22 } + } + }, + kind: 'init', + method: true, + shorthand: false, + range: [6, 22], + loc: { + start: { line: 1, column: 6 }, + end: { line: 1, column: 22 } + } + }], + range: [4, 24], loc: { - start: { line: 1, column: 10 }, - end: { line: 1, column: 11 } + start: { line: 1, column: 4 }, + end: { line: 1, column: 24 } } }, - range: [6, 11], + range: [0, 24], loc: { - start: { line: 1, column: 6 }, - end: { line: 1, column: 11 } + start: { line: 1, column: 0 }, + end: { line: 1, column: 24 } } }, - range: [0, 11], + range: [0, 24], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 11 } + end: { line: 1, column: 24 } } }, - 'throw { message: "Error" }': { - type: 'ThrowStatement', - argument: { - type: 'ObjectExpression', - properties: [{ - type: 'Property', - key: { - type: 'Identifier', - name: 'message', - range: [8, 15], - loc: { - start: { line: 1, column: 8 }, - end: { line: 1, column: 15 } - } - }, - value: { - type: 'Literal', - value: 'Error', - raw: '"Error"', - range: [17, 24], + 'x = { \'method\'() { } }': { + type: 'ExpressionStatement', + expression: { + type: 'AssignmentExpression', + operator: '=', + left: { + type: 'Identifier', + name: 'x', + range: [0, 1], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 1 } + } + }, + right: { + type: 'ObjectExpression', + properties: [{ + type: 'Property', + key: { + type: 'Literal', + value: 'method', + raw: '\'method\'', + range: [6, 14], + loc: { + start: { line: 1, column: 6 }, + end: { line: 1, column: 14 } + } + }, + value: { + type: 'FunctionExpression', + id: null, + params: [], + defaults: [], + body: { + type: 'BlockStatement', + body: [], + range: [17, 20], + loc: { + start: { line: 1, column: 17 }, + end: { line: 1, column: 20 } + } + }, + rest: null, + generator: false, + expression: false, + range: [17, 20], + loc: { + start: { line: 1, column: 17 }, + end: { line: 1, column: 20 } + } + }, + kind: 'init', + method: true, + shorthand: false, + range: [6, 20], loc: { - start: { line: 1, column: 17 }, - end: { line: 1, column: 24 } + start: { line: 1, column: 6 }, + end: { line: 1, column: 20 } } - }, - kind: 'init', - range: [8, 24], + }], + range: [4, 22], loc: { - start: { line: 1, column: 8 }, - end: { line: 1, column: 24 } + start: { line: 1, column: 4 }, + end: { line: 1, column: 22 } } - }], - range: [6, 26], + }, + range: [0, 22], loc: { - start: { line: 1, column: 6 }, - end: { line: 1, column: 26 } + start: { line: 1, column: 0 }, + end: { line: 1, column: 22 } } }, - range: [0, 26], + range: [0, 22], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 26 } + end: { line: 1, column: 22 } } - } - - }, - - 'try statement': { + }, - 'try { } catch (e) { }': { - type: 'TryStatement', - block: { - type: 'BlockStatement', - body: [], - range: [4, 7], - loc: { - start: { line: 1, column: 4 }, - end: { line: 1, column: 7 } - } - }, - guardedHandlers: [], - handlers: [{ - type: 'CatchClause', - param: { + 'x = { get() { } }': { + type: 'ExpressionStatement', + expression: { + type: 'AssignmentExpression', + operator: '=', + left: { type: 'Identifier', - name: 'e', - range: [15, 16], + name: 'x', + range: [0, 1], loc: { - start: { line: 1, column: 15 }, - end: { line: 1, column: 16 } + start: { line: 1, column: 0 }, + end: { line: 1, column: 1 } } }, - body: { - type: 'BlockStatement', - body: [], - range: [18, 21], + right: { + type: 'ObjectExpression', + properties: [{ + type: 'Property', + key: { + type: 'Identifier', + name: 'get', + range: [6, 9], + loc: { + start: { line: 1, column: 6 }, + end: { line: 1, column: 9 } + } + }, + value: { + type: 'FunctionExpression', + id: null, + params: [], + defaults: [], + body: { + type: 'BlockStatement', + body: [], + range: [12, 15], + loc: { + start: { line: 1, column: 12 }, + end: { line: 1, column: 15 } + } + }, + rest: null, + generator: false, + expression: false, + range: [12, 15], + loc: { + start: { line: 1, column: 12 }, + end: { line: 1, column: 15 } + } + }, + kind: 'init', + method: true, + shorthand: false, + range: [6, 15], + loc: { + start: { line: 1, column: 6 }, + end: { line: 1, column: 15 } + } + }], + range: [4, 17], loc: { - start: { line: 1, column: 18 }, - end: { line: 1, column: 21 } + start: { line: 1, column: 4 }, + end: { line: 1, column: 17 } } }, - range: [8, 21], - loc: { - start: { line: 1, column: 8 }, - end: { line: 1, column: 21 } - } - }], - finalizer: null, - range: [0, 21], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 21 } - } - }, - - 'try { } catch (eval) { }': { - type: 'TryStatement', - block: { - type: 'BlockStatement', - body: [], - range: [4, 7], + range: [0, 17], loc: { - start: { line: 1, column: 4 }, - end: { line: 1, column: 7 } + start: { line: 1, column: 0 }, + end: { line: 1, column: 17 } } }, - guardedHandlers: [], - handlers: [{ - type: 'CatchClause', - param: { - type: 'Identifier', - name: 'eval', - range: [15, 19], - loc: { - start: { line: 1, column: 15 }, - end: { line: 1, column: 19 } - } - }, - body: { - type: 'BlockStatement', - body: [], - range: [21, 24], - loc: { - start: { line: 1, column: 21 }, - end: { line: 1, column: 24 } - } - }, - range: [8, 24], - loc: { - start: { line: 1, column: 8 }, - end: { line: 1, column: 24 } - } - }], - finalizer: null, - range: [0, 24], + range: [0, 17], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 24 } + end: { line: 1, column: 17 } } }, - 'try { } catch (arguments) { }': { - type: 'TryStatement', - block: { - type: 'BlockStatement', - body: [], - range: [4, 7], - loc: { - start: { line: 1, column: 4 }, - end: { line: 1, column: 7 } - } - }, - guardedHandlers: [], - handlers: [{ - type: 'CatchClause', - param: { + 'x = { set() { } }': { + type: 'ExpressionStatement', + expression: { + type: 'AssignmentExpression', + operator: '=', + left: { type: 'Identifier', - name: 'arguments', - range: [15, 24], + name: 'x', + range: [0, 1], loc: { - start: { line: 1, column: 15 }, - end: { line: 1, column: 24 } + start: { line: 1, column: 0 }, + end: { line: 1, column: 1 } } }, - body: { - type: 'BlockStatement', - body: [], - range: [26, 29], + right: { + type: 'ObjectExpression', + properties: [{ + type: 'Property', + key: { + type: 'Identifier', + name: 'set', + range: [6, 9], + loc: { + start: { line: 1, column: 6 }, + end: { line: 1, column: 9 } + } + }, + value: { + type: 'FunctionExpression', + id: null, + params: [], + defaults: [], + body: { + type: 'BlockStatement', + body: [], + range: [12, 15], + loc: { + start: { line: 1, column: 12 }, + end: { line: 1, column: 15 } + } + }, + rest: null, + generator: false, + expression: false, + range: [12, 15], + loc: { + start: { line: 1, column: 12 }, + end: { line: 1, column: 15 } + } + }, + kind: 'init', + method: true, + shorthand: false, + range: [6, 15], + loc: { + start: { line: 1, column: 6 }, + end: { line: 1, column: 15 } + } + }], + range: [4, 17], loc: { - start: { line: 1, column: 26 }, - end: { line: 1, column: 29 } + start: { line: 1, column: 4 }, + end: { line: 1, column: 17 } } }, - range: [8, 29], + range: [0, 17], loc: { - start: { line: 1, column: 8 }, - end: { line: 1, column: 29 } + start: { line: 1, column: 0 }, + end: { line: 1, column: 17 } } - }], - finalizer: null, - range: [0, 29], + }, + range: [0, 17], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 29 } + end: { line: 1, column: 17 } } - }, + } - 'try { } catch (e) { say(e) }': { - type: 'TryStatement', - block: { - type: 'BlockStatement', - body: [], - range: [4, 7], - loc: { - start: { line: 1, column: 4 }, - end: { line: 1, column: 7 } - } - }, - guardedHandlers: [], - handlers: [{ - type: 'CatchClause', - param: { + }, + + '[ES6] Object Literal Property Value Shorthand': { + + 'x = { y, z }': { + type: 'ExpressionStatement', + expression: { + type: 'AssignmentExpression', + operator: '=', + left: { type: 'Identifier', - name: 'e', - range: [15, 16], + name: 'x', + range: [0, 1], loc: { - start: { line: 1, column: 15 }, - end: { line: 1, column: 16 } + start: { line: 1, column: 0 }, + end: { line: 1, column: 1 } } }, - body: { - type: 'BlockStatement', - body: [{ - type: 'ExpressionStatement', - expression: { - type: 'CallExpression', - callee: { - type: 'Identifier', - name: 'say', - range: [20, 23], - loc: { - start: { line: 1, column: 20 }, - end: { line: 1, column: 23 } - } - }, - 'arguments': [{ - type: 'Identifier', - name: 'e', - range: [24, 25], - loc: { - start: { line: 1, column: 24 }, - end: { line: 1, column: 25 } - } - }], - range: [20, 26], + right: { + type: 'ObjectExpression', + properties: [{ + type: 'Property', + key: { + type: 'Identifier', + name: 'y', + range: [6, 7], loc: { - start: { line: 1, column: 20 }, - end: { line: 1, column: 26 } + start: { line: 1, column: 6 }, + end: { line: 1, column: 7 } } }, - range: [20, 27], + value: { + type: 'Identifier', + name: 'y', + range: [6, 7], + loc: { + start: { line: 1, column: 6 }, + end: { line: 1, column: 7 } + } + }, + kind: 'init', + method: false, + shorthand: true, + range: [6, 7], loc: { - start: { line: 1, column: 20 }, - end: { line: 1, column: 27 } + start: { line: 1, column: 6 }, + end: { line: 1, column: 7 } } - }], - range: [18, 28], - loc: { - start: { line: 1, column: 18 }, - end: { line: 1, column: 28 } - } - }, - range: [8, 28], - loc: { - start: { line: 1, column: 8 }, - end: { line: 1, column: 28 } - } - }], - finalizer: null, - range: [0, 28], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 28 } - } - }, - - 'try { } finally { cleanup(stuff) }': { - type: 'TryStatement', - block: { - type: 'BlockStatement', - body: [], - range: [4, 7], - loc: { - start: { line: 1, column: 4 }, - end: { line: 1, column: 7 } - } - }, - guardedHandlers: [], - handlers: [], - finalizer: { - type: 'BlockStatement', - body: [{ - type: 'ExpressionStatement', - expression: { - type: 'CallExpression', - callee: { + }, { + type: 'Property', + key: { type: 'Identifier', - name: 'cleanup', - range: [18, 25], + name: 'z', + range: [9, 10], loc: { - start: { line: 1, column: 18 }, - end: { line: 1, column: 25 } + start: { line: 1, column: 9 }, + end: { line: 1, column: 10 } } }, - 'arguments': [{ + value: { type: 'Identifier', - name: 'stuff', - range: [26, 31], + name: 'z', + range: [9, 10], loc: { - start: { line: 1, column: 26 }, - end: { line: 1, column: 31 } + start: { line: 1, column: 9 }, + end: { line: 1, column: 10 } } - }], - range: [18, 32], + }, + kind: 'init', + method: false, + shorthand: true, + range: [9, 10], loc: { - start: { line: 1, column: 18 }, - end: { line: 1, column: 32 } + start: { line: 1, column: 9 }, + end: { line: 1, column: 10 } } - }, - range: [18, 33], + }], + range: [4, 12], loc: { - start: { line: 1, column: 18 }, - end: { line: 1, column: 33 } + start: { line: 1, column: 4 }, + end: { line: 1, column: 12 } } - }], - range: [16, 34], + }, + range: [0, 12], loc: { - start: { line: 1, column: 16 }, - end: { line: 1, column: 34 } + start: { line: 1, column: 0 }, + end: { line: 1, column: 12 } } }, - range: [0, 34], + range: [0, 12], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 34 } + end: { line: 1, column: 12 } } - }, + } + }, - 'try { doThat(); } catch (e) { say(e) }': { - type: 'TryStatement', - block: { - type: 'BlockStatement', - body: [{ - type: 'ExpressionStatement', - expression: { - type: 'CallExpression', - callee: { - type: 'Identifier', - name: 'doThat', - range: [6, 12], - loc: { - start: { line: 1, column: 6 }, - end: { line: 1, column: 12 } - } - }, - 'arguments': [], - range: [6, 14], - loc: { - start: { line: 1, column: 6 }, - end: { line: 1, column: 14 } - } - }, - range: [6, 15], - loc: { - start: { line: 1, column: 6 }, - end: { line: 1, column: 15 } - } - }], - range: [4, 17], - loc: { - start: { line: 1, column: 4 }, - end: { line: 1, column: 17 } - } - }, - guardedHandlers: [], - handlers: [{ - type: 'CatchClause', - param: { + 'Assignment Operators': { + + 'x = 42': { + type: 'ExpressionStatement', + expression: { + type: 'AssignmentExpression', + operator: '=', + left: { type: 'Identifier', - name: 'e', - range: [25, 26], + name: 'x', + range: [0, 1], loc: { - start: { line: 1, column: 25 }, - end: { line: 1, column: 26 } + start: { line: 1, column: 0 }, + end: { line: 1, column: 1 } } }, - body: { - type: 'BlockStatement', - body: [{ - type: 'ExpressionStatement', - expression: { - type: 'CallExpression', - callee: { - type: 'Identifier', - name: 'say', - range: [30, 33], - loc: { - start: { line: 1, column: 30 }, - end: { line: 1, column: 33 } - } - }, - 'arguments': [{ - type: 'Identifier', - name: 'e', - range: [34, 35], - loc: { - start: { line: 1, column: 34 }, - end: { line: 1, column: 35 } - } - }], - range: [30, 36], - loc: { - start: { line: 1, column: 30 }, - end: { line: 1, column: 36 } - } - }, - range: [30, 37], - loc: { - start: { line: 1, column: 30 }, - end: { line: 1, column: 37 } - } - }], - range: [28, 38], + right: { + type: 'Literal', + value: 42, + raw: '42', + range: [4, 6], loc: { - start: { line: 1, column: 28 }, - end: { line: 1, column: 38 } + start: { line: 1, column: 4 }, + end: { line: 1, column: 6 } } }, - range: [18, 38], + range: [0, 6], loc: { - start: { line: 1, column: 18 }, - end: { line: 1, column: 38 } + start: { line: 1, column: 0 }, + end: { line: 1, column: 6 } } - }], - finalizer: null, - range: [0, 38], + }, + range: [0, 6], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 38 } + end: { line: 1, column: 6 } } }, - 'try { doThat(); } catch (e) { say(e) } finally { cleanup(stuff) }': { - type: 'TryStatement', - block: { - type: 'BlockStatement', - body: [{ - type: 'ExpressionStatement', - expression: { - type: 'CallExpression', - callee: { - type: 'Identifier', - name: 'doThat', - range: [6, 12], - loc: { - start: { line: 1, column: 6 }, - end: { line: 1, column: 12 } - } - }, - 'arguments': [], - range: [6, 14], - loc: { - start: { line: 1, column: 6 }, - end: { line: 1, column: 14 } - } - }, - range: [6, 15], + 'eval = 42': { + type: 'ExpressionStatement', + expression: { + type: 'AssignmentExpression', + operator: '=', + left: { + type: 'Identifier', + name: 'eval', + range: [0, 4], loc: { - start: { line: 1, column: 6 }, - end: { line: 1, column: 15 } + start: { line: 1, column: 0 }, + end: { line: 1, column: 4 } } - }], - range: [4, 17], + }, + right: { + type: 'Literal', + value: 42, + raw: '42', + range: [7, 9], + loc: { + start: { line: 1, column: 7 }, + end: { line: 1, column: 9 } + } + }, + range: [0, 9], loc: { - start: { line: 1, column: 4 }, - end: { line: 1, column: 17 } + start: { line: 1, column: 0 }, + end: { line: 1, column: 9 } } }, - guardedHandlers: [], - handlers: [{ - type: 'CatchClause', - param: { + range: [0, 9], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 9 } + } + }, + + 'arguments = 42': { + type: 'ExpressionStatement', + expression: { + type: 'AssignmentExpression', + operator: '=', + left: { type: 'Identifier', - name: 'e', - range: [25, 26], + name: 'arguments', + range: [0, 9], loc: { - start: { line: 1, column: 25 }, - end: { line: 1, column: 26 } + start: { line: 1, column: 0 }, + end: { line: 1, column: 9 } } }, - body: { - type: 'BlockStatement', - body: [{ - type: 'ExpressionStatement', - expression: { - type: 'CallExpression', - callee: { - type: 'Identifier', - name: 'say', - range: [30, 33], - loc: { - start: { line: 1, column: 30 }, - end: { line: 1, column: 33 } - } - }, - 'arguments': [{ - type: 'Identifier', - name: 'e', - range: [34, 35], - loc: { - start: { line: 1, column: 34 }, - end: { line: 1, column: 35 } - } - }], - range: [30, 36], - loc: { - start: { line: 1, column: 30 }, - end: { line: 1, column: 36 } - } - }, - range: [30, 37], - loc: { - start: { line: 1, column: 30 }, - end: { line: 1, column: 37 } - } - }], - range: [28, 38], + right: { + type: 'Literal', + value: 42, + raw: '42', + range: [12, 14], loc: { - start: { line: 1, column: 28 }, - end: { line: 1, column: 38 } + start: { line: 1, column: 12 }, + end: { line: 1, column: 14 } } }, - range: [18, 38], + range: [0, 14], loc: { - start: { line: 1, column: 18 }, - end: { line: 1, column: 38 } + start: { line: 1, column: 0 }, + end: { line: 1, column: 14 } } - }], - finalizer: { - type: 'BlockStatement', - body: [{ - type: 'ExpressionStatement', - expression: { - type: 'CallExpression', - callee: { - type: 'Identifier', - name: 'cleanup', - range: [49, 56], - loc: { - start: { line: 1, column: 49 }, - end: { line: 1, column: 56 } - } - }, - 'arguments': [{ - type: 'Identifier', - name: 'stuff', - range: [57, 62], - loc: { - start: { line: 1, column: 57 }, - end: { line: 1, column: 62 } - } - }], - range: [49, 63], - loc: { - start: { line: 1, column: 49 }, - end: { line: 1, column: 63 } - } - }, - range: [49, 64], + }, + range: [0, 14], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 14 } + } + }, + + 'x *= 42': { + type: 'ExpressionStatement', + expression: { + type: 'AssignmentExpression', + operator: '*=', + left: { + type: 'Identifier', + name: 'x', + range: [0, 1], loc: { - start: { line: 1, column: 49 }, - end: { line: 1, column: 64 } + start: { line: 1, column: 0 }, + end: { line: 1, column: 1 } } - }], - range: [47, 65], + }, + right: { + type: 'Literal', + value: 42, + raw: '42', + range: [5, 7], + loc: { + start: { line: 1, column: 5 }, + end: { line: 1, column: 7 } + } + }, + range: [0, 7], loc: { - start: { line: 1, column: 47 }, - end: { line: 1, column: 65 } + start: { line: 1, column: 0 }, + end: { line: 1, column: 7 } } }, - range: [0, 65], + range: [0, 7], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 65 } + end: { line: 1, column: 7 } } - } - - }, - - 'debugger statement': { + }, - 'debugger;': { - type: 'DebuggerStatement', - range: [0, 9], + 'x /= 42': { + type: 'ExpressionStatement', + expression: { + type: 'AssignmentExpression', + operator: '/=', + left: { + type: 'Identifier', + name: 'x', + range: [0, 1], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 1 } + } + }, + right: { + type: 'Literal', + value: 42, + raw: '42', + range: [5, 7], + loc: { + start: { line: 1, column: 5 }, + end: { line: 1, column: 7 } + } + }, + range: [0, 7], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 7 } + } + }, + range: [0, 7], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 9 } + end: { line: 1, column: 7 } } - } - - }, - - 'Function Definition': { + }, - 'function hello() { sayHi(); }': { - type: 'FunctionDeclaration', - id: { - type: 'Identifier', - name: 'hello', - range: [9, 14], - loc: { - start: { line: 1, column: 9 }, - end: { line: 1, column: 14 } - } - }, - params: [], - defaults: [], - body: { - type: 'BlockStatement', - body: [{ - type: 'ExpressionStatement', - expression: { - type: 'CallExpression', - callee: { - type: 'Identifier', - name: 'sayHi', - range: [19, 24], - loc: { - start: { line: 1, column: 19 }, - end: { line: 1, column: 24 } - } - }, - 'arguments': [], - range: [19, 26], - loc: { - start: { line: 1, column: 19 }, - end: { line: 1, column: 26 } - } - }, - range: [19, 27], + 'x %= 42': { + type: 'ExpressionStatement', + expression: { + type: 'AssignmentExpression', + operator: '%=', + left: { + type: 'Identifier', + name: 'x', + range: [0, 1], loc: { - start: { line: 1, column: 19 }, - end: { line: 1, column: 27 } + start: { line: 1, column: 0 }, + end: { line: 1, column: 1 } } - }], - range: [17, 29], + }, + right: { + type: 'Literal', + value: 42, + raw: '42', + range: [5, 7], + loc: { + start: { line: 1, column: 5 }, + end: { line: 1, column: 7 } + } + }, + range: [0, 7], loc: { - start: { line: 1, column: 17 }, - end: { line: 1, column: 29 } + start: { line: 1, column: 0 }, + end: { line: 1, column: 7 } } }, - rest: null, - generator: false, - expression: false, - range: [0, 29], + range: [0, 7], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 29 } + end: { line: 1, column: 7 } } }, - 'function eval() { }': { - type: 'FunctionDeclaration', - id: { - type: 'Identifier', - name: 'eval', - range: [9, 13], - loc: { - start: { line: 1, column: 9 }, - end: { line: 1, column: 13 } - } - }, - params: [], - defaults: [], - body: { - type: 'BlockStatement', - body: [], - range: [16, 19], + 'x += 42': { + type: 'ExpressionStatement', + expression: { + type: 'AssignmentExpression', + operator: '+=', + left: { + type: 'Identifier', + name: 'x', + range: [0, 1], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 1 } + } + }, + right: { + type: 'Literal', + value: 42, + raw: '42', + range: [5, 7], + loc: { + start: { line: 1, column: 5 }, + end: { line: 1, column: 7 } + } + }, + range: [0, 7], loc: { - start: { line: 1, column: 16 }, - end: { line: 1, column: 19 } + start: { line: 1, column: 0 }, + end: { line: 1, column: 7 } } }, - rest: null, - generator: false, - expression: false, - range: [0, 19], + range: [0, 7], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 19 } + end: { line: 1, column: 7 } } }, - 'function arguments() { }': { - type: 'FunctionDeclaration', - id: { - type: 'Identifier', - name: 'arguments', - range: [9, 18], - loc: { - start: { line: 1, column: 9 }, - end: { line: 1, column: 18 } - } - }, - params: [], - defaults: [], - body: { - type: 'BlockStatement', - body: [], - range: [21, 24], + 'x -= 42': { + type: 'ExpressionStatement', + expression: { + type: 'AssignmentExpression', + operator: '-=', + left: { + type: 'Identifier', + name: 'x', + range: [0, 1], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 1 } + } + }, + right: { + type: 'Literal', + value: 42, + raw: '42', + range: [5, 7], + loc: { + start: { line: 1, column: 5 }, + end: { line: 1, column: 7 } + } + }, + range: [0, 7], loc: { - start: { line: 1, column: 21 }, - end: { line: 1, column: 24 } + start: { line: 1, column: 0 }, + end: { line: 1, column: 7 } } }, - rest: null, - generator: false, - expression: false, - range: [0, 24], + range: [0, 7], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 24 } + end: { line: 1, column: 7 } } }, - 'function test(t, t) { }': { - type: 'FunctionDeclaration', - id: { - type: 'Identifier', - name: 'test', - range: [9, 13], - loc: { - start: { line: 1, column: 9 }, - end: { line: 1, column: 13 } - } - }, - params: [{ - type: 'Identifier', - name: 't', - range: [14, 15], - loc: { - start: { line: 1, column: 14 }, - end: { line: 1, column: 15 } - } - }, { - type: 'Identifier', - name: 't', - range: [17, 18], - loc: { - start: { line: 1, column: 17 }, - end: { line: 1, column: 18 } - } - }], - defaults: [], - body: { - type: 'BlockStatement', - body: [], - range: [20, 23], + 'x <<= 42': { + type: 'ExpressionStatement', + expression: { + type: 'AssignmentExpression', + operator: '<<=', + left: { + type: 'Identifier', + name: 'x', + range: [0, 1], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 1 } + } + }, + right: { + type: 'Literal', + value: 42, + raw: '42', + range: [6, 8], + loc: { + start: { line: 1, column: 6 }, + end: { line: 1, column: 8 } + } + }, + range: [0, 8], loc: { - start: { line: 1, column: 20 }, - end: { line: 1, column: 23 } + start: { line: 1, column: 0 }, + end: { line: 1, column: 8 } } }, - rest: null, - generator: false, - expression: false, - range: [0, 23], + range: [0, 8], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 23 } + end: { line: 1, column: 8 } } }, - '(function test(t, t) { })': { + 'x >>= 42': { type: 'ExpressionStatement', expression: { - type: 'FunctionExpression', - id: { + type: 'AssignmentExpression', + operator: '>>=', + left: { type: 'Identifier', - name: 'test', - range: [10, 14], + name: 'x', + range: [0, 1], loc: { - start: { line: 1, column: 10 }, - end: { line: 1, column: 14 } + start: { line: 1, column: 0 }, + end: { line: 1, column: 1 } } }, - params: [{ - type: 'Identifier', - name: 't', - range: [15, 16], + right: { + type: 'Literal', + value: 42, + raw: '42', + range: [6, 8], loc: { - start: { line: 1, column: 15 }, - end: { line: 1, column: 16 } + start: { line: 1, column: 6 }, + end: { line: 1, column: 8 } } - }, { + }, + range: [0, 8], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 8 } + } + }, + range: [0, 8], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 8 } + } + }, + + 'x >>>= 42': { + type: 'ExpressionStatement', + expression: { + type: 'AssignmentExpression', + operator: '>>>=', + left: { type: 'Identifier', - name: 't', - range: [18, 19], + name: 'x', + range: [0, 1], loc: { - start: { line: 1, column: 18 }, - end: { line: 1, column: 19 } + start: { line: 1, column: 0 }, + end: { line: 1, column: 1 } } - }], - defaults: [], - body: { - type: 'BlockStatement', - body: [], - range: [21, 24], + }, + right: { + type: 'Literal', + value: 42, + raw: '42', + range: [7, 9], loc: { - start: { line: 1, column: 21 }, - end: { line: 1, column: 24 } + start: { line: 1, column: 7 }, + end: { line: 1, column: 9 } } }, - rest: null, - generator: false, - expression: false, - range: [1, 24], + range: [0, 9], loc: { - start: { line: 1, column: 1 }, - end: { line: 1, column: 24 } + start: { line: 1, column: 0 }, + end: { line: 1, column: 9 } } }, - range: [0, 25], + range: [0, 9], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 25 } + end: { line: 1, column: 9 } } }, - 'function eval() { function inner() { "use strict" } }': { - type: 'FunctionDeclaration', - id: { - type: 'Identifier', - name: 'eval', - range: [9, 13], - loc: { - start: { line: 1, column: 9 }, - end: { line: 1, column: 13 } - } - }, - params: [], - defaults: [], - body: { - type: 'BlockStatement', - body: [{ - type: 'FunctionDeclaration', - id: { - type: 'Identifier', - name: 'inner', - range: [27, 32], - loc: { - start: { line: 1, column: 27 }, - end: { line: 1, column: 32 } - } - }, - params: [], - defaults: [], - body: { - type: 'BlockStatement', - body: [{ - type: 'ExpressionStatement', - expression: { - type: 'Literal', - value: 'use strict', - raw: '\"use strict\"', - range: [37, 49], - loc: { - start: { line: 1, column: 37 }, - end: { line: 1, column: 49 } - } - }, - range: [37, 50], - loc: { - start: { line: 1, column: 37 }, - end: { line: 1, column: 50 } - } - }], - range: [35, 51], - loc: { - start: { line: 1, column: 35 }, - end: { line: 1, column: 51 } - } - }, - rest: null, - generator: false, - expression: false, - range: [18, 51], + 'x &= 42': { + type: 'ExpressionStatement', + expression: { + type: 'AssignmentExpression', + operator: '&=', + left: { + type: 'Identifier', + name: 'x', + range: [0, 1], loc: { - start: { line: 1, column: 18 }, - end: { line: 1, column: 51 } + start: { line: 1, column: 0 }, + end: { line: 1, column: 1 } } - }], - range: [16, 53], + }, + right: { + type: 'Literal', + value: 42, + raw: '42', + range: [5, 7], + loc: { + start: { line: 1, column: 5 }, + end: { line: 1, column: 7 } + } + }, + range: [0, 7], loc: { - start: { line: 1, column: 16 }, - end: { line: 1, column: 53 } + start: { line: 1, column: 0 }, + end: { line: 1, column: 7 } } }, - rest: null, - generator: false, - expression: false, - range: [0, 53], + range: [0, 7], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 53 } + end: { line: 1, column: 7 } } }, - 'function hello(a) { sayHi(); }': { - type: 'FunctionDeclaration', - id: { - type: 'Identifier', - name: 'hello', - range: [9, 14], - loc: { - start: { line: 1, column: 9 }, - end: { line: 1, column: 14 } - } - }, - params: [{ - type: 'Identifier', - name: 'a', - range: [15, 16], - loc: { - start: { line: 1, column: 15 }, - end: { line: 1, column: 16 } - } - }], - defaults: [], - body: { - type: 'BlockStatement', - body: [{ - type: 'ExpressionStatement', - expression: { - type: 'CallExpression', - callee: { - type: 'Identifier', - name: 'sayHi', - range: [20, 25], - loc: { - start: { line: 1, column: 20 }, - end: { line: 1, column: 25 } - } - }, - 'arguments': [], - range: [20, 27], - loc: { - start: { line: 1, column: 20 }, - end: { line: 1, column: 27 } - } - }, - range: [20, 28], + 'x ^= 42': { + type: 'ExpressionStatement', + expression: { + type: 'AssignmentExpression', + operator: '^=', + left: { + type: 'Identifier', + name: 'x', + range: [0, 1], loc: { - start: { line: 1, column: 20 }, - end: { line: 1, column: 28 } + start: { line: 1, column: 0 }, + end: { line: 1, column: 1 } } - }], - range: [18, 30], + }, + right: { + type: 'Literal', + value: 42, + raw: '42', + range: [5, 7], + loc: { + start: { line: 1, column: 5 }, + end: { line: 1, column: 7 } + } + }, + range: [0, 7], loc: { - start: { line: 1, column: 18 }, - end: { line: 1, column: 30 } + start: { line: 1, column: 0 }, + end: { line: 1, column: 7 } } }, - rest: null, - generator: false, - expression: false, - range: [0, 30], + range: [0, 7], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 30 } + end: { line: 1, column: 7 } } }, - 'function hello(a, b) { sayHi(); }': { - type: 'FunctionDeclaration', - id: { - type: 'Identifier', - name: 'hello', - range: [9, 14], - loc: { - start: { line: 1, column: 9 }, - end: { line: 1, column: 14 } - } - }, - params: [{ - type: 'Identifier', - name: 'a', - range: [15, 16], - loc: { - start: { line: 1, column: 15 }, - end: { line: 1, column: 16 } - } - }, { - type: 'Identifier', - name: 'b', - range: [18, 19], - loc: { - start: { line: 1, column: 18 }, - end: { line: 1, column: 19 } - } - }], - defaults: [], - body: { - type: 'BlockStatement', - body: [{ - type: 'ExpressionStatement', - expression: { - type: 'CallExpression', - callee: { - type: 'Identifier', - name: 'sayHi', - range: [23, 28], - loc: { - start: { line: 1, column: 23 }, - end: { line: 1, column: 28 } - } - }, - 'arguments': [], - range: [23, 30], - loc: { - start: { line: 1, column: 23 }, - end: { line: 1, column: 30 } - } - }, - range: [23, 31], + 'x |= 42': { + type: 'ExpressionStatement', + expression: { + type: 'AssignmentExpression', + operator: '|=', + left: { + type: 'Identifier', + name: 'x', + range: [0, 1], loc: { - start: { line: 1, column: 23 }, - end: { line: 1, column: 31 } + start: { line: 1, column: 0 }, + end: { line: 1, column: 1 } } - }], - range: [21, 33], + }, + right: { + type: 'Literal', + value: 42, + raw: '42', + range: [5, 7], + loc: { + start: { line: 1, column: 5 }, + end: { line: 1, column: 7 } + } + }, + range: [0, 7], loc: { - start: { line: 1, column: 21 }, - end: { line: 1, column: 33 } + start: { line: 1, column: 0 }, + end: { line: 1, column: 7 } } }, - rest: null, - generator: false, - expression: false, - range: [0, 33], + range: [0, 7], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 33 } + end: { line: 1, column: 7 } } - }, + } - 'var hi = function() { sayHi() };': { - type: 'VariableDeclaration', - declarations: [{ - type: 'VariableDeclarator', - id: { + }, + + 'Complex Expression': { + + 'a || b && c | d ^ e & f == g < h >>> i + j * k': { + type: 'ExpressionStatement', + expression: { + type: 'LogicalExpression', + operator: '||', + left: { type: 'Identifier', - name: 'hi', - range: [4, 6], + name: 'a', + range: [0, 1], loc: { - start: { line: 1, column: 4 }, - end: { line: 1, column: 6 } + start: { line: 1, column: 0 }, + end: { line: 1, column: 1 } } }, - init: { - type: 'FunctionExpression', - id: null, - params: [], - defaults: [], - body: { - type: 'BlockStatement', - body: [{ - type: 'ExpressionStatement', - expression: { - type: 'CallExpression', - callee: { + right: { + type: 'LogicalExpression', + operator: '&&', + left: { + type: 'Identifier', + name: 'b', + range: [5, 6], + loc: { + start: { line: 1, column: 5 }, + end: { line: 1, column: 6 } + } + }, + right: { + type: 'BinaryExpression', + operator: '|', + left: { + type: 'Identifier', + name: 'c', + range: [10, 11], + loc: { + start: { line: 1, column: 10 }, + end: { line: 1, column: 11 } + } + }, + right: { + type: 'BinaryExpression', + operator: '^', + left: { + type: 'Identifier', + name: 'd', + range: [14, 15], + loc: { + start: { line: 1, column: 14 }, + end: { line: 1, column: 15 } + } + }, + right: { + type: 'BinaryExpression', + operator: '&', + left: { type: 'Identifier', - name: 'sayHi', - range: [22, 27], + name: 'e', + range: [18, 19], + loc: { + start: { line: 1, column: 18 }, + end: { line: 1, column: 19 } + } + }, + right: { + type: 'BinaryExpression', + operator: '==', + left: { + type: 'Identifier', + name: 'f', + range: [22, 23], + loc: { + start: { line: 1, column: 22 }, + end: { line: 1, column: 23 } + } + }, + right: { + type: 'BinaryExpression', + operator: '<', + left: { + type: 'Identifier', + name: 'g', + range: [27, 28], + loc: { + start: { line: 1, column: 27 }, + end: { line: 1, column: 28 } + } + }, + right: { + type: 'BinaryExpression', + operator: '>>>', + left: { + type: 'Identifier', + name: 'h', + range: [31, 32], + loc: { + start: { line: 1, column: 31 }, + end: { line: 1, column: 32 } + } + }, + right: { + type: 'BinaryExpression', + operator: '+', + left: { + type: 'Identifier', + name: 'i', + range: [37, 38], + loc: { + start: { line: 1, column: 37 }, + end: { line: 1, column: 38 } + } + }, + right: { + type: 'BinaryExpression', + operator: '*', + left: { + type: 'Identifier', + name: 'j', + range: [41, 42], + loc: { + start: { line: 1, column: 41 }, + end: { line: 1, column: 42 } + } + }, + right: { + type: 'Identifier', + name: 'k', + range: [45, 46], + loc: { + start: { line: 1, column: 45 }, + end: { line: 1, column: 46 } + } + }, + range: [41, 46], + loc: { + start: { line: 1, column: 41 }, + end: { line: 1, column: 46 } + } + }, + range: [37, 46], + loc: { + start: { line: 1, column: 37 }, + end: { line: 1, column: 46 } + } + }, + range: [31, 46], + loc: { + start: { line: 1, column: 31 }, + end: { line: 1, column: 46 } + } + }, + range: [27, 46], + loc: { + start: { line: 1, column: 27 }, + end: { line: 1, column: 46 } + } + }, + range: [22, 46], loc: { start: { line: 1, column: 22 }, - end: { line: 1, column: 27 } + end: { line: 1, column: 46 } } }, - 'arguments': [], - range: [22, 29], + range: [18, 46], loc: { - start: { line: 1, column: 22 }, - end: { line: 1, column: 29 } + start: { line: 1, column: 18 }, + end: { line: 1, column: 46 } } }, - range: [22, 30], + range: [14, 46], loc: { - start: { line: 1, column: 22 }, - end: { line: 1, column: 30 } + start: { line: 1, column: 14 }, + end: { line: 1, column: 46 } } - }], - range: [20, 31], + }, + range: [10, 46], loc: { - start: { line: 1, column: 20 }, - end: { line: 1, column: 31 } + start: { line: 1, column: 10 }, + end: { line: 1, column: 46 } } }, - rest: null, - generator: false, - expression: false, - range: [9, 31], + range: [5, 46], loc: { - start: { line: 1, column: 9 }, - end: { line: 1, column: 31 } + start: { line: 1, column: 5 }, + end: { line: 1, column: 46 } } }, - range: [4, 31], + range: [0, 46], loc: { - start: { line: 1, column: 4 }, - end: { line: 1, column: 31 } + start: { line: 1, column: 0 }, + end: { line: 1, column: 46 } } - }], - kind: 'var', - range: [0, 32], + }, + range: [0, 46], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 32 } + end: { line: 1, column: 46 } } - }, + } - 'var hi = function eval() { };': { - type: 'VariableDeclaration', - declarations: [{ - type: 'VariableDeclarator', - id: { + }, + + 'Block': { + + '{ foo }': { + type: 'BlockStatement', + body: [{ + type: 'ExpressionStatement', + expression: { type: 'Identifier', - name: 'hi', - range: [4, 6], + name: 'foo', + range: [2, 5], loc: { - start: { line: 1, column: 4 }, - end: { line: 1, column: 6 } + start: { line: 1, column: 2 }, + end: { line: 1, column: 5 } } }, - init: { - type: 'FunctionExpression', - id: { - type: 'Identifier', - name: 'eval', - range: [18, 22], - loc: { - start: { line: 1, column: 18 }, - end: { line: 1, column: 22 } - } - }, - params: [], - defaults: [], - body: { - type: 'BlockStatement', - body: [], - range: [25, 28], - loc: { - start: { line: 1, column: 25 }, - end: { line: 1, column: 28 } + range: [2, 6], + loc: { + start: { line: 1, column: 2 }, + end: { line: 1, column: 6 } + } + }], + range: [0, 7], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 7 } + } + }, + + '{ doThis(); doThat(); }': { + type: 'BlockStatement', + body: [{ + type: 'ExpressionStatement', + expression: { + type: 'CallExpression', + callee: { + type: 'Identifier', + name: 'doThis', + range: [2, 8], + loc: { + start: { line: 1, column: 2 }, + end: { line: 1, column: 8 } } }, - rest: null, - generator: false, - expression: false, - range: [9, 28], + 'arguments': [], + range: [2, 10], loc: { - start: { line: 1, column: 9 }, - end: { line: 1, column: 28 } + start: { line: 1, column: 2 }, + end: { line: 1, column: 10 } } }, - range: [4, 28], + range: [2, 11], + loc: { + start: { line: 1, column: 2 }, + end: { line: 1, column: 11 } + } + }, { + type: 'ExpressionStatement', + expression: { + type: 'CallExpression', + callee: { + type: 'Identifier', + name: 'doThat', + range: [12, 18], + loc: { + start: { line: 1, column: 12 }, + end: { line: 1, column: 18 } + } + }, + 'arguments': [], + range: [12, 20], + loc: { + start: { line: 1, column: 12 }, + end: { line: 1, column: 20 } + } + }, + range: [12, 21], + loc: { + start: { line: 1, column: 12 }, + end: { line: 1, column: 21 } + } + }], + range: [0, 23], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 23 } + } + }, + + '{}': { + type: 'BlockStatement', + body: [], + range: [0, 2], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 2 } + } + } + + }, + + 'Variable Statement': { + + 'var x': { + type: 'VariableDeclaration', + declarations: [{ + type: 'VariableDeclarator', + id: { + type: 'Identifier', + name: 'x', + range: [4, 5], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 5 } + } + }, + init: null, + range: [4, 5], loc: { start: { line: 1, column: 4 }, - end: { line: 1, column: 28 } + end: { line: 1, column: 5 } } }], kind: 'var', - range: [0, 29], + range: [0, 5], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 29 } + end: { line: 1, column: 5 } } }, - 'var hi = function arguments() { };': { + 'var x, y;': { type: 'VariableDeclaration', declarations: [{ type: 'VariableDeclarator', id: { type: 'Identifier', - name: 'hi', - range: [4, 6], + name: 'x', + range: [4, 5], loc: { start: { line: 1, column: 4 }, - end: { line: 1, column: 6 } + end: { line: 1, column: 5 } } }, - init: { - type: 'FunctionExpression', - id: { - type: 'Identifier', - name: 'arguments', - range: [18, 27], - loc: { - start: { line: 1, column: 18 }, - end: { line: 1, column: 27 } - } - }, - params: [], - defaults: [], - body: { - type: 'BlockStatement', - body: [], - range: [30, 33], - loc: { - start: { line: 1, column: 30 }, - end: { line: 1, column: 33 } - } - }, - rest: null, - generator: false, - expression: false, - range: [9, 33], + init: null, + range: [4, 5], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 5 } + } + }, { + type: 'VariableDeclarator', + id: { + type: 'Identifier', + name: 'y', + range: [7, 8], loc: { - start: { line: 1, column: 9 }, - end: { line: 1, column: 33 } + start: { line: 1, column: 7 }, + end: { line: 1, column: 8 } } }, - range: [4, 33], + init: null, + range: [7, 8], loc: { - start: { line: 1, column: 4 }, - end: { line: 1, column: 33 } + start: { line: 1, column: 7 }, + end: { line: 1, column: 8 } } }], kind: 'var', - range: [0, 34], + range: [0, 9], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 34 } + end: { line: 1, column: 9 } } }, - 'var hello = function hi() { sayHi() };': { + 'var x = 42': { type: 'VariableDeclaration', declarations: [{ type: 'VariableDeclarator', id: { type: 'Identifier', - name: 'hello', - range: [4, 9], + name: 'x', + range: [4, 5], loc: { start: { line: 1, column: 4 }, - end: { line: 1, column: 9 } + end: { line: 1, column: 5 } } }, init: { - type: 'FunctionExpression', - id: { - type: 'Identifier', - name: 'hi', - range: [21, 23], - loc: { - start: { line: 1, column: 21 }, - end: { line: 1, column: 23 } - } - }, - params: [], - defaults: [], - body: { - type: 'BlockStatement', - body: [{ - type: 'ExpressionStatement', - expression: { - type: 'CallExpression', - callee: { - type: 'Identifier', - name: 'sayHi', - range: [28, 33], - loc: { - start: { line: 1, column: 28 }, - end: { line: 1, column: 33 } - } - }, - 'arguments': [], - range: [28, 35], - loc: { - start: { line: 1, column: 28 }, - end: { line: 1, column: 35 } - } - }, - range: [28, 36], - loc: { - start: { line: 1, column: 28 }, - end: { line: 1, column: 36 } - } - }], - range: [26, 37], - loc: { - start: { line: 1, column: 26 }, - end: { line: 1, column: 37 } - } - }, - rest: null, - generator: false, - expression: false, - range: [12, 37], + type: 'Literal', + value: 42, + raw: '42', + range: [8, 10], loc: { - start: { line: 1, column: 12 }, - end: { line: 1, column: 37 } + start: { line: 1, column: 8 }, + end: { line: 1, column: 10 } } }, - range: [4, 37], + range: [4, 10], loc: { start: { line: 1, column: 4 }, - end: { line: 1, column: 37 } + end: { line: 1, column: 10 } } }], kind: 'var', - range: [0, 38], + range: [0, 10], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 38 } + end: { line: 1, column: 10 } } }, - '(function(){})': { - type: 'ExpressionStatement', - expression: { - type: 'FunctionExpression', - id: null, - params: [], - defaults: [], - body: { - type: 'BlockStatement', - body: [], - range: [11, 13], + 'var eval = 42, arguments = 42': { + type: 'VariableDeclaration', + declarations: [{ + type: 'VariableDeclarator', + id: { + type: 'Identifier', + name: 'eval', + range: [4, 8], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 8 } + } + }, + init: { + type: 'Literal', + value: 42, + raw: '42', + range: [11, 13], loc: { start: { line: 1, column: 11 }, end: { line: 1, column: 13 } } }, - rest: null, - generator: false, - expression: false, - range: [1, 13], + range: [4, 13], loc: { - start: { line: 1, column: 1 }, + start: { line: 1, column: 4 }, end: { line: 1, column: 13 } } - }, - range: [0, 14], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 14 } - } - } - - }, - - 'Automatic semicolon insertion': { - - '{ x\n++y }': { - type: 'BlockStatement', - body: [{ - type: 'ExpressionStatement', - expression: { + }, { + type: 'VariableDeclarator', + id: { type: 'Identifier', - name: 'x', - range: [2, 3], + name: 'arguments', + range: [15, 24], loc: { - start: { line: 1, column: 2 }, - end: { line: 1, column: 3 } + start: { line: 1, column: 15 }, + end: { line: 1, column: 24 } } }, - range: [2, 4], - loc: { - start: { line: 1, column: 2 }, - end: { line: 2, column: 0 } - } - }, { - type: 'ExpressionStatement', - expression: { - type: 'UpdateExpression', - operator: '++', - argument: { - type: 'Identifier', - name: 'y', - range: [6, 7], - loc: { - start: { line: 2, column: 2 }, - end: { line: 2, column: 3 } - } - }, - prefix: true, - range: [4, 7], + init: { + type: 'Literal', + value: 42, + raw: '42', + range: [27, 29], loc: { - start: { line: 2, column: 0 }, - end: { line: 2, column: 3 } + start: { line: 1, column: 27 }, + end: { line: 1, column: 29 } } }, - range: [4, 8], + range: [15, 29], loc: { - start: { line: 2, column: 0 }, - end: { line: 2, column: 4 } + start: { line: 1, column: 15 }, + end: { line: 1, column: 29 } } }], - range: [0, 9], + kind: 'var', + range: [0, 29], loc: { start: { line: 1, column: 0 }, - end: { line: 2, column: 5 } + end: { line: 1, column: 29 } } }, - '{ x\n--y }': { - type: 'BlockStatement', - body: [{ - type: 'ExpressionStatement', - expression: { + 'var x = 14, y = 3, z = 1977': { + type: 'VariableDeclaration', + declarations: [{ + type: 'VariableDeclarator', + id: { type: 'Identifier', name: 'x', - range: [2, 3], + range: [4, 5], loc: { - start: { line: 1, column: 2 }, - end: { line: 1, column: 3 } + start: { line: 1, column: 4 }, + end: { line: 1, column: 5 } + } + }, + init: { + type: 'Literal', + value: 14, + raw: '14', + range: [8, 10], + loc: { + start: { line: 1, column: 8 }, + end: { line: 1, column: 10 } } }, - range: [2, 4], + range: [4, 10], loc: { - start: { line: 1, column: 2 }, - end: { line: 2, column: 0 } + start: { line: 1, column: 4 }, + end: { line: 1, column: 10 } } }, { - type: 'ExpressionStatement', - expression: { - type: 'UpdateExpression', - operator: '--', - argument: { - type: 'Identifier', - name: 'y', - range: [6, 7], - loc: { - start: { line: 2, column: 2 }, - end: { line: 2, column: 3 } - } - }, - prefix: true, - range: [4, 7], + type: 'VariableDeclarator', + id: { + type: 'Identifier', + name: 'y', + range: [12, 13], loc: { - start: { line: 2, column: 0 }, - end: { line: 2, column: 3 } + start: { line: 1, column: 12 }, + end: { line: 1, column: 13 } } }, - range: [4, 8], + init: { + type: 'Literal', + value: 3, + raw: '3', + range: [16, 17], + loc: { + start: { line: 1, column: 16 }, + end: { line: 1, column: 17 } + } + }, + range: [12, 17], loc: { - start: { line: 2, column: 0 }, - end: { line: 2, column: 4 } + start: { line: 1, column: 12 }, + end: { line: 1, column: 17 } + } + }, { + type: 'VariableDeclarator', + id: { + type: 'Identifier', + name: 'z', + range: [19, 20], + loc: { + start: { line: 1, column: 19 }, + end: { line: 1, column: 20 } + } + }, + init: { + type: 'Literal', + value: 1977, + raw: '1977', + range: [23, 27], + loc: { + start: { line: 1, column: 23 }, + end: { line: 1, column: 27 } + } + }, + range: [19, 27], + loc: { + start: { line: 1, column: 19 }, + end: { line: 1, column: 27 } } }], - range: [0, 9], + kind: 'var', + range: [0, 27], loc: { start: { line: 1, column: 0 }, - end: { line: 2, column: 5 } + end: { line: 1, column: 27 } } }, - 'var x /* comment */;': { + 'var implements, interface, package': { type: 'VariableDeclaration', declarations: [{ type: 'VariableDeclarator', id: { type: 'Identifier', - name: 'x', - range: [4, 5], + name: 'implements', + range: [4, 14], loc: { start: { line: 1, column: 4 }, - end: { line: 1, column: 5 } + end: { line: 1, column: 14 } } }, init: null, - range: [4, 5], + range: [4, 14], loc: { start: { line: 1, column: 4 }, - end: { line: 1, column: 5 } + end: { line: 1, column: 14 } + } + }, { + type: 'VariableDeclarator', + id: { + type: 'Identifier', + name: 'interface', + range: [16, 25], + loc: { + start: { line: 1, column: 16 }, + end: { line: 1, column: 25 } + } + }, + init: null, + range: [16, 25], + loc: { + start: { line: 1, column: 16 }, + end: { line: 1, column: 25 } + } + }, { + type: 'VariableDeclarator', + id: { + type: 'Identifier', + name: 'package', + range: [27, 34], + loc: { + start: { line: 1, column: 27 }, + end: { line: 1, column: 34 } + } + }, + init: null, + range: [27, 34], + loc: { + start: { line: 1, column: 27 }, + end: { line: 1, column: 34 } } }], kind: 'var', - range: [0, 20], + range: [0, 34], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 20 } + end: { line: 1, column: 34 } } }, - '{ var x = 14, y = 3\nz; }': { - type: 'BlockStatement', - body: [{ - type: 'VariableDeclaration', - declarations: [{ - type: 'VariableDeclarator', - id: { - type: 'Identifier', - name: 'x', - range: [6, 7], - loc: { - start: { line: 1, column: 6 }, - end: { line: 1, column: 7 } + 'var private, protected, public, static': { + type: 'VariableDeclaration', + declarations: [{ + type: 'VariableDeclarator', + id: { + type: 'Identifier', + name: 'private', + range: [4, 11], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 11 } + } + }, + init: null, + range: [4, 11], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 11 } + } + }, { + type: 'VariableDeclarator', + id: { + type: 'Identifier', + name: 'protected', + range: [13, 22], + loc: { + start: { line: 1, column: 13 }, + end: { line: 1, column: 22 } + } + }, + init: null, + range: [13, 22], + loc: { + start: { line: 1, column: 13 }, + end: { line: 1, column: 22 } + } + }, { + type: 'VariableDeclarator', + id: { + type: 'Identifier', + name: 'public', + range: [24, 30], + loc: { + start: { line: 1, column: 24 }, + end: { line: 1, column: 30 } + } + }, + init: null, + range: [24, 30], + loc: { + start: { line: 1, column: 24 }, + end: { line: 1, column: 30 } + } + }, { + type: 'VariableDeclarator', + id: { + type: 'Identifier', + name: 'static', + range: [32, 38], + loc: { + start: { line: 1, column: 32 }, + end: { line: 1, column: 38 } + } + }, + init: null, + range: [32, 38], + loc: { + start: { line: 1, column: 32 }, + end: { line: 1, column: 38 } + } + }], + kind: 'var', + range: [0, 38], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 38 } + } + } + + }, + + 'Let Statement': { + + 'let x': { + type: 'VariableDeclaration', + declarations: [{ + type: 'VariableDeclarator', + id: { + type: 'Identifier', + name: 'x', + range: [4, 5], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 5 } + } + }, + init: null, + range: [4, 5], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 5 } + } + }], + kind: 'let', + range: [0, 5], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 5 } + } + }, + + '{ let x }': { + type: 'BlockStatement', + body: [{ + type: 'VariableDeclaration', + declarations: [{ + type: 'VariableDeclarator', + id: { + type: 'Identifier', + name: 'x', + range: [6, 7], + loc: { + start: { line: 1, column: 6 }, + end: { line: 1, column: 7 } + } + }, + init: null, + range: [6, 7], + loc: { + start: { line: 1, column: 6 }, + end: { line: 1, column: 7 } + } + }], + kind: 'let', + range: [2, 8], + loc: { + start: { line: 1, column: 2 }, + end: { line: 1, column: 8 } + } + }], + range: [0, 9], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 9 } + } + }, + + '{ let x = 42 }': { + type: 'BlockStatement', + body: [{ + type: 'VariableDeclaration', + declarations: [{ + type: 'VariableDeclarator', + id: { + type: 'Identifier', + name: 'x', + range: [6, 7], + loc: { + start: { line: 1, column: 6 }, + end: { line: 1, column: 7 } + } + }, + init: { + type: 'Literal', + value: 42, + raw: '42', + range: [10, 12], + loc: { + start: { line: 1, column: 10 }, + end: { line: 1, column: 12 } + } + }, + range: [6, 12], + loc: { + start: { line: 1, column: 6 }, + end: { line: 1, column: 12 } + } + }], + kind: 'let', + range: [2, 13], + loc: { + start: { line: 1, column: 2 }, + end: { line: 1, column: 13 } + } + }], + range: [0, 14], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 14 } + } + }, + + '{ let x = 14, y = 3, z = 1977 }': { + type: 'BlockStatement', + body: [{ + type: 'VariableDeclaration', + declarations: [{ + type: 'VariableDeclarator', + id: { + type: 'Identifier', + name: 'x', + range: [6, 7], + loc: { + start: { line: 1, column: 6 }, + end: { line: 1, column: 7 } } }, init: { @@ -14919,841 +15354,7210 @@ var testFixture = { start: { line: 1, column: 14 }, end: { line: 1, column: 19 } } - }], - kind: 'var', - range: [2, 20], - loc: { - start: { line: 1, column: 2 }, - end: { line: 2, column: 0 } - } - }, { - type: 'ExpressionStatement', - expression: { - type: 'Identifier', - name: 'z', - range: [20, 21], + }, { + type: 'VariableDeclarator', + id: { + type: 'Identifier', + name: 'z', + range: [21, 22], + loc: { + start: { line: 1, column: 21 }, + end: { line: 1, column: 22 } + } + }, + init: { + type: 'Literal', + value: 1977, + raw: '1977', + range: [25, 29], + loc: { + start: { line: 1, column: 25 }, + end: { line: 1, column: 29 } + } + }, + range: [21, 29], loc: { - start: { line: 2, column: 0 }, - end: { line: 2, column: 1 } + start: { line: 1, column: 21 }, + end: { line: 1, column: 29 } } - }, - range: [20, 22], + }], + kind: 'let', + range: [2, 30], loc: { - start: { line: 2, column: 0 }, - end: { line: 2, column: 2 } + start: { line: 1, column: 2 }, + end: { line: 1, column: 30 } } }], - range: [0, 24], + range: [0, 31], loc: { start: { line: 1, column: 0 }, - end: { line: 2, column: 4 } + end: { line: 1, column: 31 } } - }, + } - 'while (true) { continue\nthere; }': { - type: 'WhileStatement', - test: { - type: 'Literal', - value: true, - raw: 'true', - range: [7, 11], - loc: { - start: { line: 1, column: 7 }, - end: { line: 1, column: 11 } - } - }, - body: { - type: 'BlockStatement', - body: [{ - type: 'ContinueStatement', - label: null, - range: [15, 23], + }, + + 'Const Statement': { + + 'const x = 42': { + type: 'VariableDeclaration', + declarations: [{ + type: 'VariableDeclarator', + id: { + type: 'Identifier', + name: 'x', + range: [6, 7], loc: { - start: { line: 1, column: 15 }, - end: { line: 1, column: 23 } + start: { line: 1, column: 6 }, + end: { line: 1, column: 7 } } - }, { - type: 'ExpressionStatement', - expression: { - type: 'Identifier', - name: 'there', - range: [24, 29], - loc: { - start: { line: 2, column: 0 }, - end: { line: 2, column: 5 } - } - }, - range: [24, 30], + }, + init: { + type: 'Literal', + value: 42, + raw: '42', + range: [10, 12], loc: { - start: { line: 2, column: 0 }, - end: { line: 2, column: 6 } + start: { line: 1, column: 10 }, + end: { line: 1, column: 12 } } - }], - range: [13, 32], + }, + range: [6, 12], loc: { - start: { line: 1, column: 13 }, - end: { line: 2, column: 8 } + start: { line: 1, column: 6 }, + end: { line: 1, column: 12 } } - }, - range: [0, 32], + }], + kind: 'const', + range: [0, 12], loc: { start: { line: 1, column: 0 }, - end: { line: 2, column: 8 } + end: { line: 1, column: 12 } } }, - 'while (true) { continue // Comment\nthere; }': { - type: 'WhileStatement', - test: { - type: 'Literal', - value: true, - raw: 'true', - range: [7, 11], - loc: { - start: { line: 1, column: 7 }, - end: { line: 1, column: 11 } - } - }, - body: { - type: 'BlockStatement', - body: [{ - type: 'ContinueStatement', - label: null, - range: [15, 23], - loc: { - start: { line: 1, column: 15 }, - end: { line: 1, column: 23 } - } - }, { - type: 'ExpressionStatement', - expression: { + '{ const x = 42 }': { + type: 'BlockStatement', + body: [{ + type: 'VariableDeclaration', + declarations: [{ + type: 'VariableDeclarator', + id: { type: 'Identifier', - name: 'there', - range: [35, 40], + name: 'x', + range: [8, 9], loc: { - start: { line: 2, column: 0 }, - end: { line: 2, column: 5 } + start: { line: 1, column: 8 }, + end: { line: 1, column: 9 } } }, - range: [35, 41], + init: { + type: 'Literal', + value: 42, + raw: '42', + range: [12, 14], + loc: { + start: { line: 1, column: 12 }, + end: { line: 1, column: 14 } + } + }, + range: [8, 14], loc: { - start: { line: 2, column: 0 }, - end: { line: 2, column: 6 } + start: { line: 1, column: 8 }, + end: { line: 1, column: 14 } } }], - range: [13, 43], + kind: 'const', + range: [2, 15], loc: { - start: { line: 1, column: 13 }, - end: { line: 2, column: 8 } + start: { line: 1, column: 2 }, + end: { line: 1, column: 15 } } - }, - range: [0, 43], + }], + range: [0, 16], loc: { start: { line: 1, column: 0 }, - end: { line: 2, column: 8 } + end: { line: 1, column: 16 } } }, - 'while (true) { continue /* Multiline\nComment */there; }': { - type: 'WhileStatement', - test: { - type: 'Literal', - value: true, - raw: 'true', - range: [7, 11], - loc: { - start: { line: 1, column: 7 }, - end: { line: 1, column: 11 } - } - }, - body: { - type: 'BlockStatement', - body: [{ - type: 'ContinueStatement', - label: null, - range: [15, 23], + '{ const x = 14, y = 3, z = 1977 }': { + type: 'BlockStatement', + body: [{ + type: 'VariableDeclaration', + declarations: [{ + type: 'VariableDeclarator', + id: { + type: 'Identifier', + name: 'x', + range: [8, 9], + loc: { + start: { line: 1, column: 8 }, + end: { line: 1, column: 9 } + } + }, + init: { + type: 'Literal', + value: 14, + raw: '14', + range: [12, 14], + loc: { + start: { line: 1, column: 12 }, + end: { line: 1, column: 14 } + } + }, + range: [8, 14], loc: { - start: { line: 1, column: 15 }, - end: { line: 1, column: 23 } + start: { line: 1, column: 8 }, + end: { line: 1, column: 14 } } }, { - type: 'ExpressionStatement', - expression: { + type: 'VariableDeclarator', + id: { type: 'Identifier', - name: 'there', - range: [47, 52], + name: 'y', + range: [16, 17], loc: { - start: { line: 2, column: 10 }, - end: { line: 2, column: 15 } + start: { line: 1, column: 16 }, + end: { line: 1, column: 17 } } }, - range: [47, 53], + init: { + type: 'Literal', + value: 3, + raw: '3', + range: [20, 21], + loc: { + start: { line: 1, column: 20 }, + end: { line: 1, column: 21 } + } + }, + range: [16, 21], loc: { - start: { line: 2, column: 10 }, - end: { line: 2, column: 16 } + start: { line: 1, column: 16 }, + end: { line: 1, column: 21 } + } + }, { + type: 'VariableDeclarator', + id: { + type: 'Identifier', + name: 'z', + range: [23, 24], + loc: { + start: { line: 1, column: 23 }, + end: { line: 1, column: 24 } + } + }, + init: { + type: 'Literal', + value: 1977, + raw: '1977', + range: [27, 31], + loc: { + start: { line: 1, column: 27 }, + end: { line: 1, column: 31 } + } + }, + range: [23, 31], + loc: { + start: { line: 1, column: 23 }, + end: { line: 1, column: 31 } } }], - range: [13, 55], + kind: 'const', + range: [2, 32], loc: { - start: { line: 1, column: 13 }, - end: { line: 2, column: 18 } + start: { line: 1, column: 2 }, + end: { line: 1, column: 32 } } - }, - range: [0, 55], + }], + range: [0, 33], loc: { start: { line: 1, column: 0 }, - end: { line: 2, column: 18 } + end: { line: 1, column: 33 } } - }, + } - 'while (true) { break\nthere; }': { - type: 'WhileStatement', - test: { - type: 'Literal', - value: true, - raw: 'true', - range: [7, 11], + }, + + 'Empty Statement': { + + ';': { + type: 'EmptyStatement', + range: [0, 1], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 1 } + } + } + + }, + + 'Expression Statement': { + + 'x': { + type: 'ExpressionStatement', + expression: { + type: 'Identifier', + name: 'x', + range: [0, 1], loc: { - start: { line: 1, column: 7 }, - end: { line: 1, column: 11 } + start: { line: 1, column: 0 }, + end: { line: 1, column: 1 } } }, - body: { - type: 'BlockStatement', - body: [{ - type: 'BreakStatement', - label: null, - range: [15, 20], + range: [0, 1], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 1 } + } + }, + + 'x, y': { + type: 'ExpressionStatement', + expression: { + type: 'SequenceExpression', + expressions: [{ + type: 'Identifier', + name: 'x', + range: [0, 1], loc: { - start: { line: 1, column: 15 }, - end: { line: 1, column: 20 } + start: { line: 1, column: 0 }, + end: { line: 1, column: 1 } } }, { - type: 'ExpressionStatement', - expression: { - type: 'Identifier', - name: 'there', - range: [21, 26], - loc: { - start: { line: 2, column: 0 }, - end: { line: 2, column: 5 } - } - }, - range: [21, 27], + type: 'Identifier', + name: 'y', + range: [3, 4], loc: { - start: { line: 2, column: 0 }, - end: { line: 2, column: 6 } + start: { line: 1, column: 3 }, + end: { line: 1, column: 4 } } }], - range: [13, 29], + range: [0, 4], loc: { - start: { line: 1, column: 13 }, - end: { line: 2, column: 8 } + start: { line: 1, column: 0 }, + end: { line: 1, column: 4 } } }, - range: [0, 29], + range: [0, 4], loc: { start: { line: 1, column: 0 }, - end: { line: 2, column: 8 } + end: { line: 1, column: 4 } } }, - 'while (true) { break // Comment\nthere; }': { - type: 'WhileStatement', - test: { - type: 'Literal', - value: true, - raw: 'true', - range: [7, 11], + '\\u0061': { + type: 'ExpressionStatement', + expression: { + type: 'Identifier', + name: 'a', + range: [0, 6], loc: { - start: { line: 1, column: 7 }, - end: { line: 1, column: 11 } + start: { line: 1, column: 0 }, + end: { line: 1, column: 6 } } }, - body: { - type: 'BlockStatement', - body: [{ - type: 'BreakStatement', - label: null, - range: [15, 20], - loc: { - start: { line: 1, column: 15 }, - end: { line: 1, column: 20 } - } - }, { - type: 'ExpressionStatement', - expression: { - type: 'Identifier', - name: 'there', - range: [32, 37], - loc: { - start: { line: 2, column: 0 }, - end: { line: 2, column: 5 } - } - }, - range: [32, 38], - loc: { - start: { line: 2, column: 0 }, - end: { line: 2, column: 6 } - } - }], - range: [13, 40], + range: [0, 6], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 6 } + } + }, + + 'a\\u0061': { + type: 'ExpressionStatement', + expression: { + type: 'Identifier', + name: 'aa', + range: [0, 7], loc: { - start: { line: 1, column: 13 }, - end: { line: 2, column: 8 } + start: { line: 1, column: 0 }, + end: { line: 1, column: 7 } } }, - range: [0, 40], + range: [0, 7], loc: { start: { line: 1, column: 0 }, - end: { line: 2, column: 8 } + end: { line: 1, column: 7 } } }, - 'while (true) { break /* Multiline\nComment */there; }': { - type: 'WhileStatement', + '\\u0061a': { + type: 'ExpressionStatement', + expression: { + type: 'Identifier', + name: 'aa', + range: [0, 7], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 7 } + } + }, + range: [0, 7], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 7 } + } + }, + + '\\u0061a ': { + type: 'ExpressionStatement', + expression: { + type: 'Identifier', + name: 'aa', + range: [0, 7], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 7 } + } + }, + range: [0, 8], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 8 } + } + } + }, + + 'If Statement': { + + 'if (morning) goodMorning()': { + type: 'IfStatement', test: { - type: 'Literal', - value: true, - raw: 'true', - range: [7, 11], + type: 'Identifier', + name: 'morning', + range: [4, 11], loc: { - start: { line: 1, column: 7 }, + start: { line: 1, column: 4 }, end: { line: 1, column: 11 } } }, - body: { - type: 'BlockStatement', - body: [{ - type: 'BreakStatement', - label: null, - range: [15, 20], - loc: { - start: { line: 1, column: 15 }, - end: { line: 1, column: 20 } - } - }, { - type: 'ExpressionStatement', - expression: { + consequent: { + type: 'ExpressionStatement', + expression: { + type: 'CallExpression', + callee: { type: 'Identifier', - name: 'there', - range: [44, 49], + name: 'goodMorning', + range: [13, 24], loc: { - start: { line: 2, column: 10 }, - end: { line: 2, column: 15 } + start: { line: 1, column: 13 }, + end: { line: 1, column: 24 } } }, - range: [44, 50], + 'arguments': [], + range: [13, 26], loc: { - start: { line: 2, column: 10 }, - end: { line: 2, column: 16 } + start: { line: 1, column: 13 }, + end: { line: 1, column: 26 } } - }], - range: [13, 52], + }, + range: [13, 26], loc: { start: { line: 1, column: 13 }, - end: { line: 2, column: 18 } + end: { line: 1, column: 26 } } }, - range: [0, 52], + alternate: null, + range: [0, 26], loc: { start: { line: 1, column: 0 }, - end: { line: 2, column: 18 } + end: { line: 1, column: 26 } } }, - '(function(){ return\nx; })': { - type: 'ExpressionStatement', - expression: { - type: 'FunctionExpression', - id: null, - params: [], - defaults: [], - body: { - type: 'BlockStatement', - body: [ - { - type: 'ReturnStatement', - argument: null, - range: [13, 19], - loc: { - start: { line: 1, column: 13 }, - end: { line: 1, column: 19 } - } - }, - { - type: 'ExpressionStatement', - expression: { - type: 'Identifier', - name: 'x', - range: [20, 21], - loc: { - start: { line: 2, column: 0 }, - end: { line: 2, column: 1 } - } - }, - range: [20, 22], - loc: { - start: { line: 2, column: 0 }, - end: { line: 2, column: 2 } - } + 'if (morning) (function(){})': { + type: 'IfStatement', + test: { + type: 'Identifier', + name: 'morning', + range: [4, 11], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 11 } + } + }, + consequent: { + type: 'ExpressionStatement', + expression: { + type: 'FunctionExpression', + id: null, + params: [], + defaults: [], + body: { + type: 'BlockStatement', + body: [], + range: [24, 26], + loc: { + start: { line: 1, column: 24 }, + end: { line: 1, column: 26 } } - ], - range: [11, 24], + }, + rest: null, + generator: false, + expression: false, + range: [14, 26], loc: { - start: { line: 1, column: 11 }, - end: { line: 2, column: 4 } + start: { line: 1, column: 14 }, + end: { line: 1, column: 26 } } }, - rest: null, - generator: false, - expression: false, - range: [1, 24], + range: [13, 27], loc: { - start: { line: 1, column: 1 }, - end: { line: 2, column: 4 } + start: { line: 1, column: 13 }, + end: { line: 1, column: 27 } } }, - range: [0, 25], + alternate: null, + range: [0, 27], loc: { start: { line: 1, column: 0 }, - end: { line: 2, column: 5 } + end: { line: 1, column: 27 } } }, - '(function(){ return // Comment\nx; })': { - type: 'ExpressionStatement', - expression: { - type: 'FunctionExpression', - id: null, - params: [], - defaults: [], - body: { - type: 'BlockStatement', - body: [ - { - type: 'ReturnStatement', - argument: null, - range: [13, 19], - loc: { - start: { line: 1, column: 13 }, - end: { line: 1, column: 19 } - } - }, - { - type: 'ExpressionStatement', - expression: { - type: 'Identifier', - name: 'x', - range: [31, 32], - loc: { - start: { line: 2, column: 0 }, - end: { line: 2, column: 1 } - } - }, - range: [31, 33], - loc: { - start: { line: 2, column: 0 }, - end: { line: 2, column: 2 } - } + 'if (morning) var x = 0;': { + type: 'IfStatement', + test: { + type: 'Identifier', + name: 'morning', + range: [4, 11], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 11 } + } + }, + consequent: { + type: 'VariableDeclaration', + declarations: [{ + type: 'VariableDeclarator', + id: { + type: 'Identifier', + name: 'x', + range: [17, 18], + loc: { + start: { line: 1, column: 17 }, + end: { line: 1, column: 18 } } - ], - range: [11, 35], + }, + init: { + type: 'Literal', + value: 0, + raw: '0', + range: [21, 22], + loc: { + start: { line: 1, column: 21 }, + end: { line: 1, column: 22 } + } + }, + range: [17, 22], loc: { - start: { line: 1, column: 11 }, - end: { line: 2, column: 4 } + start: { line: 1, column: 17 }, + end: { line: 1, column: 22 } } - }, - rest: null, - generator: false, - expression: false, - range: [1, 35], + }], + kind: 'var', + range: [13, 23], loc: { - start: { line: 1, column: 1 }, - end: { line: 2, column: 4 } + start: { line: 1, column: 13 }, + end: { line: 1, column: 23 } } }, - range: [0, 36], + alternate: null, + range: [0, 23], loc: { start: { line: 1, column: 0 }, - end: { line: 2, column: 5 } + end: { line: 1, column: 23 } } }, - '(function(){ return/* Multiline\nComment */x; })': { - type: 'ExpressionStatement', - expression: { - type: 'FunctionExpression', - id: null, + 'if (morning) function a(){}': { + type: 'IfStatement', + test: { + type: 'Identifier', + name: 'morning', + range: [4, 11], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 11 } + } + }, + consequent: { + type: 'FunctionDeclaration', + id: { + type: 'Identifier', + name: 'a', + range: [22, 23], + loc: { + start: { line: 1, column: 22 }, + end: { line: 1, column: 23 } + } + }, params: [], defaults: [], body: { type: 'BlockStatement', - body: [ - { - type: 'ReturnStatement', - argument: null, - range: [13, 19], - loc: { - start: { line: 1, column: 13 }, - end: { line: 1, column: 19 } - } - }, - { - type: 'ExpressionStatement', - expression: { - type: 'Identifier', - name: 'x', - range: [42, 43], - loc: { - start: { line: 2, column: 10 }, - end: { line: 2, column: 11 } - } - }, - range: [42, 44], - loc: { - start: { line: 2, column: 10 }, - end: { line: 2, column: 12 } - } - } - ], - range: [11, 46], + body: [], + range: [25, 27], loc: { - start: { line: 1, column: 11 }, - end: { line: 2, column: 14 } + start: { line: 1, column: 25 }, + end: { line: 1, column: 27 } } }, rest: null, generator: false, expression: false, - range: [1, 46], + range: [13, 27], loc: { - start: { line: 1, column: 1 }, - end: { line: 2, column: 14 } + start: { line: 1, column: 13 }, + end: { line: 1, column: 27 } } }, - range: [0, 47], + alternate: null, + range: [0, 27], loc: { start: { line: 1, column: 0 }, - end: { line: 2, column: 15 } + end: { line: 1, column: 27 } } }, - '{ throw error\nerror; }': { - type: 'BlockStatement', - body: [{ - type: 'ThrowStatement', - argument: { - type: 'Identifier', - name: 'error', - range: [8, 13], - loc: { - start: { line: 1, column: 8 }, - end: { line: 1, column: 13 } - } - }, - range: [2, 14], + 'if (morning) goodMorning(); else goodDay()': { + type: 'IfStatement', + test: { + type: 'Identifier', + name: 'morning', + range: [4, 11], loc: { - start: { line: 1, column: 2 }, - end: { line: 2, column: 0 } + start: { line: 1, column: 4 }, + end: { line: 1, column: 11 } } - }, { + }, + consequent: { type: 'ExpressionStatement', expression: { - type: 'Identifier', - name: 'error', - range: [14, 19], + type: 'CallExpression', + callee: { + type: 'Identifier', + name: 'goodMorning', + range: [13, 24], + loc: { + start: { line: 1, column: 13 }, + end: { line: 1, column: 24 } + } + }, + 'arguments': [], + range: [13, 26], loc: { - start: { line: 2, column: 0 }, - end: { line: 2, column: 5 } + start: { line: 1, column: 13 }, + end: { line: 1, column: 26 } } }, - range: [14, 20], + range: [13, 27], loc: { - start: { line: 2, column: 0 }, - end: { line: 2, column: 6 } + start: { line: 1, column: 13 }, + end: { line: 1, column: 27 } } - }], - range: [0, 22], + }, + alternate: { + type: 'ExpressionStatement', + expression: { + type: 'CallExpression', + callee: { + type: 'Identifier', + name: 'goodDay', + range: [33, 40], + loc: { + start: { line: 1, column: 33 }, + end: { line: 1, column: 40 } + } + }, + 'arguments': [], + range: [33, 42], + loc: { + start: { line: 1, column: 33 }, + end: { line: 1, column: 42 } + } + }, + range: [33, 42], + loc: { + start: { line: 1, column: 33 }, + end: { line: 1, column: 42 } + } + }, + range: [0, 42], loc: { start: { line: 1, column: 0 }, - end: { line: 2, column: 8 } + end: { line: 1, column: 42 } } }, - '{ throw error// Comment\nerror; }': { - type: 'BlockStatement', - body: [{ - type: 'ThrowStatement', - argument: { - type: 'Identifier', - name: 'error', - range: [8, 13], - loc: { - start: { line: 1, column: 8 }, - end: { line: 1, column: 13 } - } - }, - range: [2, 24], + 'if (true) that()\n; else;': { + type: "IfStatement", + test: { + type: "Literal", + value: true, + raw: "true", + range: [4, 8], loc: { - start: { line: 1, column: 2 }, - end: { line: 2, column: 0 } + start: { line: 1, column: 4 }, + end: { line: 1, column: 8 } } - }, { - type: 'ExpressionStatement', + }, + consequent: { + type: "ExpressionStatement", expression: { - type: 'Identifier', - name: 'error', - range: [24, 29], + type: "CallExpression", + callee: { + type: "Identifier", + name: "that", + range: [10, 14], + loc: { + start: { line: 1, column: 10 }, + end: { line: 1, column: 14 } + } + }, + "arguments": [], + range: [10, 16], loc: { - start: { line: 2, column: 0 }, - end: { line: 2, column: 5 } + start: { line: 1, column: 10 }, + end: { line: 1, column: 16 } } }, - range: [24, 30], + range: [10, 18], loc: { - start: { line: 2, column: 0 }, - end: { line: 2, column: 6 } + start: { line: 1, column: 10 }, + end: { line: 2, column: 1 } } - }], - range: [0, 32], + }, + alternate: { + type: "EmptyStatement", + range: [23, 24], + loc: { + start: { line: 2, column: 6 }, + end: { line: 2, column: 7 } + } + }, + range: [0, 24], loc: { start: { line: 1, column: 0 }, - end: { line: 2, column: 8 } + end: { line: 2, column: 7 } } }, - '{ throw error/* Multiline\nComment */error; }': { - type: 'BlockStatement', - body: [{ - type: 'ThrowStatement', - argument: { - type: 'Identifier', - name: 'error', - range: [8, 13], - loc: { - start: { line: 1, column: 8 }, - end: { line: 1, column: 13 } - } - }, - range: [2, 36], + 'if (true) that(); else;': { + type: "IfStatement", + test: { + type: "Literal", + value: true, + raw: "true", + range: [4, 8], loc: { - start: { line: 1, column: 2 }, - end: { line: 2, column: 10 } + start: { line: 1, column: 4 }, + end: { line: 1, column: 8 } } - }, { - type: 'ExpressionStatement', + }, + consequent: { + type: "ExpressionStatement", expression: { - type: 'Identifier', - name: 'error', - range: [36, 41], + type: "CallExpression", + callee: { + type: "Identifier", + name: "that", + range: [10, 14], + loc: { + start: { line: 1, column: 10 }, + end: { line: 1, column: 14 } + } + }, + "arguments": [], + range: [10, 16], loc: { - start: { line: 2, column: 10 }, - end: { line: 2, column: 15 } + start: { line: 1, column: 10 }, + end: { line: 1, column: 16 } } }, - range: [36, 42], + range: [10, 17], loc: { - start: { line: 2, column: 10 }, - end: { line: 2, column: 16 } + start: { line: 1, column: 10 }, + end: { line: 1, column: 17 } } - }], - range: [0, 44], + }, + alternate: { + type: "EmptyStatement", + range: [22, 23], + loc: { + start: { line: 1, column: 22 }, + end: { line: 1, column: 23 } + } + }, + range: [0, 23], loc: { start: { line: 1, column: 0 }, - end: { line: 2, column: 18 } + end: { line: 1, column: 23 } } } }, - 'Source elements': { + 'Iteration Statements': { - '': { - type: 'Program', - body: [], - range: [0, 0], - loc: { - start: { line: 0, column: 0 }, - end: { line: 0, column: 0 } + 'do keep(); while (true)': { + type: 'DoWhileStatement', + body: { + type: 'ExpressionStatement', + expression: { + type: 'CallExpression', + callee: { + type: 'Identifier', + name: 'keep', + range: [3, 7], + loc: { + start: { line: 1, column: 3 }, + end: { line: 1, column: 7 } + } + }, + 'arguments': [], + range: [3, 9], + loc: { + start: { line: 1, column: 3 }, + end: { line: 1, column: 9 } + } + }, + range: [3, 10], + loc: { + start: { line: 1, column: 3 }, + end: { line: 1, column: 10 } + } }, - tokens: [] - } - }, - - 'Invalid syntax': { - - '{': { - index: 1, - lineNumber: 1, - column: 2, - message: 'Error: Line 1: Unexpected end of input' - }, - - '}': { - index: 0, - lineNumber: 1, - column: 1, - message: 'Error: Line 1: Unexpected token }' - }, - - '3ea': { - index: 2, - lineNumber: 1, - column: 3, - message: 'Error: Line 1: Unexpected token ILLEGAL' - }, - - '3in []': { - index: 1, - lineNumber: 1, - column: 2, - message: 'Error: Line 1: Unexpected token ILLEGAL' + test: { + type: 'Literal', + value: true, + raw: 'true', + range: [18, 22], + loc: { + start: { line: 1, column: 18 }, + end: { line: 1, column: 22 } + } + }, + range: [0, 23], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 23 } + } }, - '3e': { - index: 2, - lineNumber: 1, - column: 3, - message: 'Error: Line 1: Unexpected token ILLEGAL' - }, - - '3e+': { - index: 3, - lineNumber: 1, - column: 4, - message: 'Error: Line 1: Unexpected token ILLEGAL' - }, - - '3e-': { - index: 3, - lineNumber: 1, - column: 4, - message: 'Error: Line 1: Unexpected token ILLEGAL' + 'do keep(); while (true);': { + type: 'DoWhileStatement', + body: { + type: 'ExpressionStatement', + expression: { + type: 'CallExpression', + callee: { + type: 'Identifier', + name: 'keep', + range: [3, 7], + loc: { + start: { line: 1, column: 3 }, + end: { line: 1, column: 7 } + } + }, + 'arguments': [], + range: [3, 9], + loc: { + start: { line: 1, column: 3 }, + end: { line: 1, column: 9 } + } + }, + range: [3, 10], + loc: { + start: { line: 1, column: 3 }, + end: { line: 1, column: 10 } + } + }, + test: { + type: 'Literal', + value: true, + raw: 'true', + range: [18, 22], + loc: { + start: { line: 1, column: 18 }, + end: { line: 1, column: 22 } + } + }, + range: [0, 24], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 24 } + } }, - '3x': { - index: 1, - lineNumber: 1, - column: 2, - message: 'Error: Line 1: Unexpected token ILLEGAL' + 'do { x++; y--; } while (x < 10)': { + type: 'DoWhileStatement', + body: { + type: 'BlockStatement', + body: [{ + type: 'ExpressionStatement', + expression: { + type: 'UpdateExpression', + operator: '++', + argument: { + type: 'Identifier', + name: 'x', + range: [5, 6], + loc: { + start: { line: 1, column: 5 }, + end: { line: 1, column: 6 } + } + }, + prefix: false, + range: [5, 8], + loc: { + start: { line: 1, column: 5 }, + end: { line: 1, column: 8 } + } + }, + range: [5, 9], + loc: { + start: { line: 1, column: 5 }, + end: { line: 1, column: 9 } + } + }, { + type: 'ExpressionStatement', + expression: { + type: 'UpdateExpression', + operator: '--', + argument: { + type: 'Identifier', + name: 'y', + range: [10, 11], + loc: { + start: { line: 1, column: 10 }, + end: { line: 1, column: 11 } + } + }, + prefix: false, + range: [10, 13], + loc: { + start: { line: 1, column: 10 }, + end: { line: 1, column: 13 } + } + }, + range: [10, 14], + loc: { + start: { line: 1, column: 10 }, + end: { line: 1, column: 14 } + } + }], + range: [3, 16], + loc: { + start: { line: 1, column: 3 }, + end: { line: 1, column: 16 } + } + }, + test: { + type: 'BinaryExpression', + operator: '<', + left: { + type: 'Identifier', + name: 'x', + range: [24, 25], + loc: { + start: { line: 1, column: 24 }, + end: { line: 1, column: 25 } + } + }, + right: { + type: 'Literal', + value: 10, + raw: '10', + range: [28, 30], + loc: { + start: { line: 1, column: 28 }, + end: { line: 1, column: 30 } + } + }, + range: [24, 30], + loc: { + start: { line: 1, column: 24 }, + end: { line: 1, column: 30 } + } + }, + range: [0, 31], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 31 } + } }, - '3x0': { - index: 1, - lineNumber: 1, - column: 2, - message: 'Error: Line 1: Unexpected token ILLEGAL' + '{ do { } while (false) false }': { + type: 'BlockStatement', + body: [{ + type: 'DoWhileStatement', + body: { + type: 'BlockStatement', + body: [], + range: [5, 8], + loc: { + start: { line: 1, column: 5 }, + end: { line: 1, column: 8 } + } + }, + test: { + type: 'Literal', + value: false, + raw: 'false', + range: [16, 21], + loc: { + start: { line: 1, column: 16 }, + end: { line: 1, column: 21 } + } + }, + range: [2, 22], + loc: { + start: { line: 1, column: 2 }, + end: { line: 1, column: 22 } + } + }, { + type: 'ExpressionStatement', + expression: { + type: 'Literal', + value: false, + raw: 'false', + range: [23, 28], + loc: { + start: { line: 1, column: 23 }, + end: { line: 1, column: 28 } + } + }, + range: [23, 29], + loc: { + start: { line: 1, column: 23 }, + end: { line: 1, column: 29 } + } + }], + range: [0, 30], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 30 } + } }, - '0x': { - index: 2, - lineNumber: 1, - column: 3, - message: 'Error: Line 1: Unexpected token ILLEGAL' + 'do that();while (true)': { + type: "DoWhileStatement", + body: { + type: "ExpressionStatement", + expression: { + type: "CallExpression", + callee: { + type: "Identifier", + name: "that", + range: [3, 7], + loc: { + start: { line: 1, column: 3 }, + end: { line: 1, column: 7 } + } + }, + "arguments": [], + range: [3, 9], + loc: { + start: { line: 1, column: 3 }, + end: { line: 1, column: 9 } + } + }, + range: [3, 10], + loc: { + start: { line: 1, column: 3 }, + end: { line: 1, column: 10 } + } + }, + test: { + type: "Literal", + value: true, + raw: "true", + range: [17, 21], + loc: { + start: { line: 1, column: 17 }, + end: { line: 1, column: 21 } + } + }, + range: [0, 22], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 22 } + } }, - '09': { - index: 1, - lineNumber: 1, - column: 2, - message: 'Error: Line 1: Unexpected token ILLEGAL' - }, - - '018': { - index: 2, - lineNumber: 1, - column: 3, - message: 'Error: Line 1: Unexpected token ILLEGAL' - }, - - '01a': { - index: 2, - lineNumber: 1, - column: 3, - message: 'Error: Line 1: Unexpected token ILLEGAL' - }, - - '3in[]': { - index: 1, - lineNumber: 1, - column: 2, - message: 'Error: Line 1: Unexpected token ILLEGAL' - }, - - '0x3in[]': { - index: 3, - lineNumber: 1, - column: 4, - message: 'Error: Line 1: Unexpected token ILLEGAL' + 'do that()\n;while (true)': { + type: "DoWhileStatement", + body: { + type: "ExpressionStatement", + expression: { + type: "CallExpression", + callee: { + type: "Identifier", + name: "that", + range: [3, 7], + loc: { + start: { line: 1, column: 3 }, + end: { line: 1, column: 7 } + } + }, + "arguments": [], + range: [3, 9], + loc: { + start: { line: 1, column: 3 }, + end: { line: 1, column: 9 } + } + }, + range: [3, 11], + loc: { + start: { line: 1, column: 3 }, + end: { line: 2, column: 1 } + } + }, + test: { + type: "Literal", + value: true, + raw: "true", + range: [18, 22], + loc: { + start: { line: 2, column: 8 }, + end: { line: 2, column: 12 } + } + }, + range: [0, 23], + loc: { + start: { line: 1, column: 0 }, + end: { line: 2, column: 13 } + } }, - '"Hello\nWorld"': { - index: 7, - lineNumber: 1, - column: 8, - message: 'Error: Line 1: Unexpected token ILLEGAL' + 'while (true) doSomething()': { + type: 'WhileStatement', + test: { + type: 'Literal', + value: true, + raw: 'true', + range: [7, 11], + loc: { + start: { line: 1, column: 7 }, + end: { line: 1, column: 11 } + } + }, + body: { + type: 'ExpressionStatement', + expression: { + type: 'CallExpression', + callee: { + type: 'Identifier', + name: 'doSomething', + range: [13, 24], + loc: { + start: { line: 1, column: 13 }, + end: { line: 1, column: 24 } + } + }, + 'arguments': [], + range: [13, 26], + loc: { + start: { line: 1, column: 13 }, + end: { line: 1, column: 26 } + } + }, + range: [13, 26], + loc: { + start: { line: 1, column: 13 }, + end: { line: 1, column: 26 } + } + }, + range: [0, 26], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 26 } + } }, - 'x\\': { - index: 2, - lineNumber: 1, - column: 3, - message: 'Error: Line 1: Unexpected token ILLEGAL' + 'while (x < 10) { x++; y--; }': { + type: 'WhileStatement', + test: { + type: 'BinaryExpression', + operator: '<', + left: { + type: 'Identifier', + name: 'x', + range: [7, 8], + loc: { + start: { line: 1, column: 7 }, + end: { line: 1, column: 8 } + } + }, + right: { + type: 'Literal', + value: 10, + raw: '10', + range: [11, 13], + loc: { + start: { line: 1, column: 11 }, + end: { line: 1, column: 13 } + } + }, + range: [7, 13], + loc: { + start: { line: 1, column: 7 }, + end: { line: 1, column: 13 } + } + }, + body: { + type: 'BlockStatement', + body: [{ + type: 'ExpressionStatement', + expression: { + type: 'UpdateExpression', + operator: '++', + argument: { + type: 'Identifier', + name: 'x', + range: [17, 18], + loc: { + start: { line: 1, column: 17 }, + end: { line: 1, column: 18 } + } + }, + prefix: false, + range: [17, 20], + loc: { + start: { line: 1, column: 17 }, + end: { line: 1, column: 20 } + } + }, + range: [17, 21], + loc: { + start: { line: 1, column: 17 }, + end: { line: 1, column: 21 } + } + }, { + type: 'ExpressionStatement', + expression: { + type: 'UpdateExpression', + operator: '--', + argument: { + type: 'Identifier', + name: 'y', + range: [22, 23], + loc: { + start: { line: 1, column: 22 }, + end: { line: 1, column: 23 } + } + }, + prefix: false, + range: [22, 25], + loc: { + start: { line: 1, column: 22 }, + end: { line: 1, column: 25 } + } + }, + range: [22, 26], + loc: { + start: { line: 1, column: 22 }, + end: { line: 1, column: 26 } + } + }], + range: [15, 28], + loc: { + start: { line: 1, column: 15 }, + end: { line: 1, column: 28 } + } + }, + range: [0, 28], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 28 } + } }, - 'x\\u005c': { - index: 7, - lineNumber: 1, - column: 8, - message: 'Error: Line 1: Unexpected token ILLEGAL' + 'for(;;);': { + type: 'ForStatement', + init: null, + test: null, + update: null, + body: { + type: 'EmptyStatement', + range: [7, 8], + loc: { + start: { line: 1, column: 7 }, + end: { line: 1, column: 8 } + } + }, + range: [0, 8], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 8 } + } }, - 'x\\u002a': { - index: 7, - lineNumber: 1, - column: 8, - message: 'Error: Line 1: Unexpected token ILLEGAL' + 'for(;;){}': { + type: 'ForStatement', + init: null, + test: null, + update: null, + body: { + type: 'BlockStatement', + body: [], + range: [7, 9], + loc: { + start: { line: 1, column: 7 }, + end: { line: 1, column: 9 } + } + }, + range: [0, 9], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 9 } + } }, - 'var x = /(s/g': { - index: 13, - lineNumber: 1, - column: 14, - message: 'Error: Line 1: Invalid regular expression' - }, - - '/': { - index: 1, - lineNumber: 1, - column: 2, - message: 'Error: Line 1: Invalid regular expression: missing /' + 'for(x = 0;;);': { + type: 'ForStatement', + init: { + type: 'AssignmentExpression', + operator: '=', + left: { + type: 'Identifier', + name: 'x', + range: [4, 5], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 5 } + } + }, + right: { + type: 'Literal', + value: 0, + raw: '0', + range: [8, 9], + loc: { + start: { line: 1, column: 8 }, + end: { line: 1, column: 9 } + } + }, + range: [4, 9], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 9 } + } + }, + test: null, + update: null, + body: { + type: 'EmptyStatement', + range: [12, 13], + loc: { + start: { line: 1, column: 12 }, + end: { line: 1, column: 13 } + } + }, + range: [0, 13], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 13 } + } }, - '/test': { - index: 5, - lineNumber: 1, - column: 6, - message: 'Error: Line 1: Invalid regular expression: missing /' + 'for(var x = 0;;);': { + type: 'ForStatement', + init: { + type: 'VariableDeclaration', + declarations: [{ + type: 'VariableDeclarator', + id: { + type: 'Identifier', + name: 'x', + range: [8, 9], + loc: { + start: { line: 1, column: 8 }, + end: { line: 1, column: 9 } + } + }, + init: { + type: 'Literal', + value: 0, + raw: '0', + range: [12, 13], + loc: { + start: { line: 1, column: 12 }, + end: { line: 1, column: 13 } + } + }, + range: [8, 13], + loc: { + start: { line: 1, column: 8 }, + end: { line: 1, column: 13 } + } + }], + kind: 'var', + range: [4, 13], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 13 } + } + }, + test: null, + update: null, + body: { + type: 'EmptyStatement', + range: [16, 17], + loc: { + start: { line: 1, column: 16 }, + end: { line: 1, column: 17 } + } + }, + range: [0, 17], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 17 } + } }, - 'var x = /[a-z]/\\ux': { - index: 18, - lineNumber: 1, - column: 19, - message: 'Error: Line 1: Invalid regular expression' + 'for(let x = 0;;);': { + type: 'ForStatement', + init: { + type: 'VariableDeclaration', + declarations: [{ + type: 'VariableDeclarator', + id: { + type: 'Identifier', + name: 'x', + range: [8, 9], + loc: { + start: { line: 1, column: 8 }, + end: { line: 1, column: 9 } + } + }, + init: { + type: 'Literal', + value: 0, + raw: '0', + range: [12, 13], + loc: { + start: { line: 1, column: 12 }, + end: { line: 1, column: 13 } + } + }, + range: [8, 13], + loc: { + start: { line: 1, column: 8 }, + end: { line: 1, column: 13 } + } + }], + kind: 'let', + range: [4, 13], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 13 } + } + }, + test: null, + update: null, + body: { + type: 'EmptyStatement', + range: [16, 17], + loc: { + start: { line: 1, column: 16 }, + end: { line: 1, column: 17 } + } + }, + range: [0, 17], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 17 } + } }, - '3 = 4': { - index: 1, - lineNumber: 1, - column: 2, - message: 'Error: Line 1: Invalid left-hand side in assignment' + 'for(var x = 0, y = 1;;);': { + type: 'ForStatement', + init: { + type: 'VariableDeclaration', + declarations: [{ + type: 'VariableDeclarator', + id: { + type: 'Identifier', + name: 'x', + range: [8, 9], + loc: { + start: { line: 1, column: 8 }, + end: { line: 1, column: 9 } + } + }, + init: { + type: 'Literal', + value: 0, + raw: '0', + range: [12, 13], + loc: { + start: { line: 1, column: 12 }, + end: { line: 1, column: 13 } + } + }, + range: [8, 13], + loc: { + start: { line: 1, column: 8 }, + end: { line: 1, column: 13 } + } + }, { + type: 'VariableDeclarator', + id: { + type: 'Identifier', + name: 'y', + range: [15, 16], + loc: { + start: { line: 1, column: 15 }, + end: { line: 1, column: 16 } + } + }, + init: { + type: 'Literal', + value: 1, + raw: '1', + range: [19, 20], + loc: { + start: { line: 1, column: 19 }, + end: { line: 1, column: 20 } + } + }, + range: [15, 20], + loc: { + start: { line: 1, column: 15 }, + end: { line: 1, column: 20 } + } + }], + kind: 'var', + range: [4, 20], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 20 } + } + }, + test: null, + update: null, + body: { + type: 'EmptyStatement', + range: [23, 24], + loc: { + start: { line: 1, column: 23 }, + end: { line: 1, column: 24 } + } + }, + range: [0, 24], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 24 } + } }, - 'func() = 4': { - index: 6, - lineNumber: 1, + 'for(x = 0; x < 42;);': { + type: 'ForStatement', + init: { + type: 'AssignmentExpression', + operator: '=', + left: { + type: 'Identifier', + name: 'x', + range: [4, 5], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 5 } + } + }, + right: { + type: 'Literal', + value: 0, + raw: '0', + range: [8, 9], + loc: { + start: { line: 1, column: 8 }, + end: { line: 1, column: 9 } + } + }, + range: [4, 9], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 9 } + } + }, + test: { + type: 'BinaryExpression', + operator: '<', + left: { + type: 'Identifier', + name: 'x', + range: [11, 12], + loc: { + start: { line: 1, column: 11 }, + end: { line: 1, column: 12 } + } + }, + right: { + type: 'Literal', + value: 42, + raw: '42', + range: [15, 17], + loc: { + start: { line: 1, column: 15 }, + end: { line: 1, column: 17 } + } + }, + range: [11, 17], + loc: { + start: { line: 1, column: 11 }, + end: { line: 1, column: 17 } + } + }, + update: null, + body: { + type: 'EmptyStatement', + range: [19, 20], + loc: { + start: { line: 1, column: 19 }, + end: { line: 1, column: 20 } + } + }, + range: [0, 20], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 20 } + } + }, + + 'for(x = 0; x < 42; x++);': { + type: 'ForStatement', + init: { + type: 'AssignmentExpression', + operator: '=', + left: { + type: 'Identifier', + name: 'x', + range: [4, 5], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 5 } + } + }, + right: { + type: 'Literal', + value: 0, + raw: '0', + range: [8, 9], + loc: { + start: { line: 1, column: 8 }, + end: { line: 1, column: 9 } + } + }, + range: [4, 9], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 9 } + } + }, + test: { + type: 'BinaryExpression', + operator: '<', + left: { + type: 'Identifier', + name: 'x', + range: [11, 12], + loc: { + start: { line: 1, column: 11 }, + end: { line: 1, column: 12 } + } + }, + right: { + type: 'Literal', + value: 42, + raw: '42', + range: [15, 17], + loc: { + start: { line: 1, column: 15 }, + end: { line: 1, column: 17 } + } + }, + range: [11, 17], + loc: { + start: { line: 1, column: 11 }, + end: { line: 1, column: 17 } + } + }, + update: { + type: 'UpdateExpression', + operator: '++', + argument: { + type: 'Identifier', + name: 'x', + range: [19, 20], + loc: { + start: { line: 1, column: 19 }, + end: { line: 1, column: 20 } + } + }, + prefix: false, + range: [19, 22], + loc: { + start: { line: 1, column: 19 }, + end: { line: 1, column: 22 } + } + }, + body: { + type: 'EmptyStatement', + range: [23, 24], + loc: { + start: { line: 1, column: 23 }, + end: { line: 1, column: 24 } + } + }, + range: [0, 24], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 24 } + } + }, + + 'for(x = 0; x < 42; x++) process(x);': { + type: 'ForStatement', + init: { + type: 'AssignmentExpression', + operator: '=', + left: { + type: 'Identifier', + name: 'x', + range: [4, 5], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 5 } + } + }, + right: { + type: 'Literal', + value: 0, + raw: '0', + range: [8, 9], + loc: { + start: { line: 1, column: 8 }, + end: { line: 1, column: 9 } + } + }, + range: [4, 9], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 9 } + } + }, + test: { + type: 'BinaryExpression', + operator: '<', + left: { + type: 'Identifier', + name: 'x', + range: [11, 12], + loc: { + start: { line: 1, column: 11 }, + end: { line: 1, column: 12 } + } + }, + right: { + type: 'Literal', + value: 42, + raw: '42', + range: [15, 17], + loc: { + start: { line: 1, column: 15 }, + end: { line: 1, column: 17 } + } + }, + range: [11, 17], + loc: { + start: { line: 1, column: 11 }, + end: { line: 1, column: 17 } + } + }, + update: { + type: 'UpdateExpression', + operator: '++', + argument: { + type: 'Identifier', + name: 'x', + range: [19, 20], + loc: { + start: { line: 1, column: 19 }, + end: { line: 1, column: 20 } + } + }, + prefix: false, + range: [19, 22], + loc: { + start: { line: 1, column: 19 }, + end: { line: 1, column: 22 } + } + }, + body: { + type: 'ExpressionStatement', + expression: { + type: 'CallExpression', + callee: { + type: 'Identifier', + name: 'process', + range: [24, 31], + loc: { + start: { line: 1, column: 24 }, + end: { line: 1, column: 31 } + } + }, + 'arguments': [{ + type: 'Identifier', + name: 'x', + range: [32, 33], + loc: { + start: { line: 1, column: 32 }, + end: { line: 1, column: 33 } + } + }], + range: [24, 34], + loc: { + start: { line: 1, column: 24 }, + end: { line: 1, column: 34 } + } + }, + range: [24, 35], + loc: { + start: { line: 1, column: 24 }, + end: { line: 1, column: 35 } + } + }, + range: [0, 35], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 35 } + } + }, + + 'for(x in list) process(x);': { + type: 'ForInStatement', + left: { + type: 'Identifier', + name: 'x', + range: [4, 5], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 5 } + } + }, + right: { + type: 'Identifier', + name: 'list', + range: [9, 13], + loc: { + start: { line: 1, column: 9 }, + end: { line: 1, column: 13 } + } + }, + body: { + type: 'ExpressionStatement', + expression: { + type: 'CallExpression', + callee: { + type: 'Identifier', + name: 'process', + range: [15, 22], + loc: { + start: { line: 1, column: 15 }, + end: { line: 1, column: 22 } + } + }, + 'arguments': [{ + type: 'Identifier', + name: 'x', + range: [23, 24], + loc: { + start: { line: 1, column: 23 }, + end: { line: 1, column: 24 } + } + }], + range: [15, 25], + loc: { + start: { line: 1, column: 15 }, + end: { line: 1, column: 25 } + } + }, + range: [15, 26], + loc: { + start: { line: 1, column: 15 }, + end: { line: 1, column: 26 } + } + }, + each: false, + range: [0, 26], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 26 } + } + }, + + 'for (var x in list) process(x);': { + type: 'ForInStatement', + left: { + type: 'VariableDeclaration', + declarations: [{ + type: 'VariableDeclarator', + id: { + type: 'Identifier', + name: 'x', + range: [9, 10], + loc: { + start: { line: 1, column: 9 }, + end: { line: 1, column: 10 } + } + }, + init: null, + range: [9, 10], + loc: { + start: { line: 1, column: 9 }, + end: { line: 1, column: 10 } + } + }], + kind: 'var', + range: [5, 10], + loc: { + start: { line: 1, column: 5 }, + end: { line: 1, column: 10 } + } + }, + right: { + type: 'Identifier', + name: 'list', + range: [14, 18], + loc: { + start: { line: 1, column: 14 }, + end: { line: 1, column: 18 } + } + }, + body: { + type: 'ExpressionStatement', + expression: { + type: 'CallExpression', + callee: { + type: 'Identifier', + name: 'process', + range: [20, 27], + loc: { + start: { line: 1, column: 20 }, + end: { line: 1, column: 27 } + } + }, + 'arguments': [{ + type: 'Identifier', + name: 'x', + range: [28, 29], + loc: { + start: { line: 1, column: 28 }, + end: { line: 1, column: 29 } + } + }], + range: [20, 30], + loc: { + start: { line: 1, column: 20 }, + end: { line: 1, column: 30 } + } + }, + range: [20, 31], + loc: { + start: { line: 1, column: 20 }, + end: { line: 1, column: 31 } + } + }, + each: false, + range: [0, 31], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 31 } + } + }, + + 'for (var x = 42 in list) process(x);': { + type: 'ForInStatement', + left: { + type: 'VariableDeclaration', + declarations: [{ + type: 'VariableDeclarator', + id: { + type: 'Identifier', + name: 'x', + range: [9, 10], + loc: { + start: { line: 1, column: 9 }, + end: { line: 1, column: 10 } + } + }, + init: { + type: 'Literal', + value: 42, + raw: '42', + range: [13, 15], + loc: { + start: { line: 1, column: 13 }, + end: { line: 1, column: 15 } + } + }, + range: [9, 15], + loc: { + start: { line: 1, column: 9 }, + end: { line: 1, column: 15 } + } + }], + kind: 'var', + range: [5, 15], + loc: { + start: { line: 1, column: 5 }, + end: { line: 1, column: 15 } + } + }, + right: { + type: 'Identifier', + name: 'list', + range: [19, 23], + loc: { + start: { line: 1, column: 19 }, + end: { line: 1, column: 23 } + } + }, + body: { + type: 'ExpressionStatement', + expression: { + type: 'CallExpression', + callee: { + type: 'Identifier', + name: 'process', + range: [25, 32], + loc: { + start: { line: 1, column: 25 }, + end: { line: 1, column: 32 } + } + }, + 'arguments': [{ + type: 'Identifier', + name: 'x', + range: [33, 34], + loc: { + start: { line: 1, column: 33 }, + end: { line: 1, column: 34 } + } + }], + range: [25, 35], + loc: { + start: { line: 1, column: 25 }, + end: { line: 1, column: 35 } + } + }, + range: [25, 36], + loc: { + start: { line: 1, column: 25 }, + end: { line: 1, column: 36 } + } + }, + each: false, + range: [0, 36], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 36 } + } + }, + + 'for (let x in list) process(x);': { + type: 'ForInStatement', + left: { + type: 'VariableDeclaration', + declarations: [{ + type: 'VariableDeclarator', + id: { + type: 'Identifier', + name: 'x', + range: [9, 10], + loc: { + start: { line: 1, column: 9 }, + end: { line: 1, column: 10 } + } + }, + init: null, + range: [9, 10], + loc: { + start: { line: 1, column: 9 }, + end: { line: 1, column: 10 } + } + }], + kind: 'let', + range: [5, 10], + loc: { + start: { line: 1, column: 5 }, + end: { line: 1, column: 10 } + } + }, + right: { + type: 'Identifier', + name: 'list', + range: [14, 18], + loc: { + start: { line: 1, column: 14 }, + end: { line: 1, column: 18 } + } + }, + body: { + type: 'ExpressionStatement', + expression: { + type: 'CallExpression', + callee: { + type: 'Identifier', + name: 'process', + range: [20, 27], + loc: { + start: { line: 1, column: 20 }, + end: { line: 1, column: 27 } + } + }, + 'arguments': [{ + type: 'Identifier', + name: 'x', + range: [28, 29], + loc: { + start: { line: 1, column: 28 }, + end: { line: 1, column: 29 } + } + }], + range: [20, 30], + loc: { + start: { line: 1, column: 20 }, + end: { line: 1, column: 30 } + } + }, + range: [20, 31], + loc: { + start: { line: 1, column: 20 }, + end: { line: 1, column: 31 } + } + }, + each: false, + range: [0, 31], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 31 } + } + }, + + 'for (var x = y = z in q);': { + type: 'ForInStatement', + left: { + type: 'VariableDeclaration', + declarations: [{ + type: 'VariableDeclarator', + id: { + type: 'Identifier', + name: 'x', + range: [9, 10], + loc: { + start: { line: 1, column: 9 }, + end: { line: 1, column: 10 } + } + }, + init: { + type: 'AssignmentExpression', + operator: '=', + left: { + type: 'Identifier', + name: 'y', + range: [13, 14], + loc: { + start: { line: 1, column: 13 }, + end: { line: 1, column: 14 } + } + }, + right: { + type: 'Identifier', + name: 'z', + range: [17, 18], + loc: { + start: { line: 1, column: 17 }, + end: { line: 1, column: 18 } + } + }, + range: [13, 18], + loc: { + start: { line: 1, column: 13 }, + end: { line: 1, column: 18 } + } + }, + range: [9, 18], + loc: { + start: { line: 1, column: 9 }, + end: { line: 1, column: 18 } + } + }], + kind: 'var', + range: [5, 18], + loc: { + start: { line: 1, column: 5 }, + end: { line: 1, column: 18 } + } + }, + right: { + type: 'Identifier', + name: 'q', + range: [22, 23], + loc: { + start: { line: 1, column: 22 }, + end: { line: 1, column: 23 } + } + }, + body: { + type: 'EmptyStatement', + range: [24, 25], + loc: { + start: { line: 1, column: 24 }, + end: { line: 1, column: 25 } + } + }, + each: false, + range: [0, 25], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 25 } + } + }, + + 'for (var a = b = c = (d in e) in z);': { + type: 'ForInStatement', + left: { + type: 'VariableDeclaration', + declarations: [{ + type: 'VariableDeclarator', + id: { + type: 'Identifier', + name: 'a', + range: [9, 10], + loc: { + start: { line: 1, column: 9 }, + end: { line: 1, column: 10 } + } + }, + init: { + type: 'AssignmentExpression', + operator: '=', + left: { + type: 'Identifier', + name: 'b', + range: [13, 14], + loc: { + start: { line: 1, column: 13 }, + end: { line: 1, column: 14 } + } + }, + right: { + type: 'AssignmentExpression', + operator: '=', + left: { + type: 'Identifier', + name: 'c', + range: [17, 18], + loc: { + start: { line: 1, column: 17 }, + end: { line: 1, column: 18 } + } + }, + right: { + type: 'BinaryExpression', + operator: 'in', + left: { + type: 'Identifier', + name: 'd', + range: [22, 23], + loc: { + start: { line: 1, column: 22 }, + end: { line: 1, column: 23 } + } + }, + right: { + type: 'Identifier', + name: 'e', + range: [27, 28], + loc: { + start: { line: 1, column: 27 }, + end: { line: 1, column: 28 } + } + }, + range: [22, 28], + loc: { + start: { line: 1, column: 22 }, + end: { line: 1, column: 28 } + } + }, + range: [17, 29], + loc: { + start: { line: 1, column: 17 }, + end: { line: 1, column: 29 } + } + }, + range: [13, 29], + loc: { + start: { line: 1, column: 13 }, + end: { line: 1, column: 29 } + } + }, + range: [9, 29], + loc: { + start: { line: 1, column: 9 }, + end: { line: 1, column: 29 } + } + }], + kind: 'var', + range: [5, 29], + loc: { + start: { line: 1, column: 5 }, + end: { line: 1, column: 29 } + } + }, + right: { + type: 'Identifier', + name: 'z', + range: [33, 34], + loc: { + start: { line: 1, column: 33 }, + end: { line: 1, column: 34 } + } + }, + body: { + type: 'EmptyStatement', + range: [35, 36], + loc: { + start: { line: 1, column: 35 }, + end: { line: 1, column: 36 } + } + }, + each: false, + range: [0, 36], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 36 } + } + }, + + 'for (var i = function() { return 10 in [] } in list) process(x);': { + type: 'ForInStatement', + left: { + type: 'VariableDeclaration', + declarations: [{ + type: 'VariableDeclarator', + id: { + type: 'Identifier', + name: 'i', + range: [9, 10], + loc: { + start: { line: 1, column: 9 }, + end: { line: 1, column: 10 } + } + }, + init: { + type: 'FunctionExpression', + id: null, + params: [], + defaults: [], + body: { + type: 'BlockStatement', + body: [{ + type: 'ReturnStatement', + argument: { + type: 'BinaryExpression', + operator: 'in', + left: { + type: 'Literal', + value: 10, + raw: '10', + range: [33, 35], + loc: { + start: { line: 1, column: 33 }, + end: { line: 1, column: 35 } + } + }, + right: { + type: 'ArrayExpression', + elements: [], + range: [39, 41], + loc: { + start: { line: 1, column: 39 }, + end: { line: 1, column: 41 } + } + }, + range: [33, 41], + loc: { + start: { line: 1, column: 33 }, + end: { line: 1, column: 41 } + } + }, + range: [26, 42], + loc: { + start: { line: 1, column: 26 }, + end: { line: 1, column: 42 } + } + }], + range: [24, 43], + loc: { + start: { line: 1, column: 24 }, + end: { line: 1, column: 43 } + } + }, + rest: null, + generator: false, + expression: false, + range: [13, 43], + loc: { + start: { line: 1, column: 13 }, + end: { line: 1, column: 43 } + } + }, + range: [9, 43], + loc: { + start: { line: 1, column: 9 }, + end: { line: 1, column: 43 } + } + }], + kind: 'var', + range: [5, 43], + loc: { + start: { line: 1, column: 5 }, + end: { line: 1, column: 43 } + } + }, + right: { + type: 'Identifier', + name: 'list', + range: [47, 51], + loc: { + start: { line: 1, column: 47 }, + end: { line: 1, column: 51 } + } + }, + body: { + type: 'ExpressionStatement', + expression: { + type: 'CallExpression', + callee: { + type: 'Identifier', + name: 'process', + range: [53, 60], + loc: { + start: { line: 1, column: 53 }, + end: { line: 1, column: 60 } + } + }, + 'arguments': [{ + type: 'Identifier', + name: 'x', + range: [61, 62], + loc: { + start: { line: 1, column: 61 }, + end: { line: 1, column: 62 } + } + }], + range: [53, 63], + loc: { + start: { line: 1, column: 53 }, + end: { line: 1, column: 63 } + } + }, + range: [53, 64], + loc: { + start: { line: 1, column: 53 }, + end: { line: 1, column: 64 } + } + }, + each: false, + range: [0, 64], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 64 } + } + }, + + 'for (a[b in c] in d);': { + type: 'ForInStatement', + left: { + type: 'MemberExpression', + computed: true, + object: { + type: 'Identifier', + name: 'a', + range: [5, 6], + loc: { + start: { line: 1, column: 5 }, + end: { line: 1, column: 6 } + } + }, + property: { + type: 'BinaryExpression', + operator: 'in', + left: { + type: 'Identifier', + name: 'b', + range: [7, 8], + loc: { + start: { line: 1, column: 7 }, + end: { line: 1, column: 8 } + } + }, + right: { + type: 'Identifier', + name: 'c', + range: [12, 13], + loc: { + start: { line: 1, column: 12 }, + end: { line: 1, column: 13 } + } + }, + range: [7, 13], + loc: { + start: { line: 1, column: 7 }, + end: { line: 1, column: 13 } + } + }, + range: [5, 14], + loc: { + start: { line: 1, column: 5 }, + end: { line: 1, column: 14 } + } + }, + right: { + type: 'Identifier', + name: 'd', + range: [18, 19], + loc: { + start: { line: 1, column: 18 }, + end: { line: 1, column: 19 } + } + }, + body: { + type: 'EmptyStatement', + range: [20, 21], + loc: { + start: { line: 1, column: 20 }, + end: { line: 1, column: 21 } + } + }, + each: false, + range: [0, 21], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 21 } + } + }, + + 'for (a(b in c)[0] in d);': { + type: 'ForInStatement', + left: { + type: 'MemberExpression', + computed: true, + object: { + type: 'CallExpression', + callee: { + type: 'Identifier', + name: 'a', + range: [5, 6], + loc: { + start: { line: 1, column: 5 }, + end: { line: 1, column: 6 } + } + }, + arguments: [{ + type: 'BinaryExpression', + operator: 'in', + left: { + type: 'Identifier', + name: 'b', + range: [7, 8], + loc: { + start: { line: 1, column: 7 }, + end: { line: 1, column: 8 } + } + }, + right: { + type: 'Identifier', + name: 'c', + range: [12, 13], + loc: { + start: { line: 1, column: 12 }, + end: { line: 1, column: 13 } + } + }, + range: [7, 13], + loc: { + start: { line: 1, column: 7 }, + end: { line: 1, column: 13 } + } + }], + range: [5, 14], + loc: { + start: { line: 1, column: 5 }, + end: { line: 1, column: 14 } + } + }, + property: { + type: 'Literal', + value: 0, + raw: '0', + range: [15, 16], + loc: { + start: { line: 1, column: 15 }, + end: { line: 1, column: 16 } + } + }, + range: [5, 17], + loc: { + start: { line: 1, column: 5 }, + end: { line: 1, column: 17 } + } + }, + right: { + type: 'Identifier', + name: 'd', + range: [21, 22], + loc: { + start: { line: 1, column: 21 }, + end: { line: 1, column: 22 } + } + }, + body: { + type: 'EmptyStatement', + range: [23, 24], + loc: { + start: { line: 1, column: 23 }, + end: { line: 1, column: 24 } + } + }, + each: false, + range: [0, 24], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 24 } + } + }, + + 'for (a.in in a);': { + type: 'ForInStatement', + left: { + type: 'MemberExpression', + computed: false, + object: { + type: 'Identifier', + name: 'a', + range: [5, 6], + loc: { + start: { line: 1, column: 5 }, + end: { line: 1, column: 6 } + } + }, + property: { + type: 'Identifier', + name: 'in', + range: [7, 9], + loc: { + start: { line: 1, column: 7 }, + end: { line: 1, column: 9 } + } + }, + range: [5, 9], + loc: { + start: { line: 1, column: 5 }, + end: { line: 1, column: 9 } + } + }, + right: { + type: 'Identifier', + name: 'a', + range: [13, 14], + loc: { + start: { line: 1, column: 13 }, + end: { line: 1, column: 14 } + } + }, + body: { + type: 'EmptyStatement', + range: [15, 16], + loc: { + start: { line: 1, column: 15 }, + end: { line: 1, column: 16 } + } + }, + each: false, + range: [0, 16], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 16 } + } + } + }, + + 'continue statement': { + + 'while (true) { continue; }': { + type: 'WhileStatement', + test: { + type: 'Literal', + value: true, + raw: 'true', + range: [7, 11], + loc: { + start: { line: 1, column: 7 }, + end: { line: 1, column: 11 } + } + }, + body: { + type: 'BlockStatement', + body: [ + { + type: 'ContinueStatement', + label: null, + range: [15, 24], + loc: { + start: { line: 1, column: 15 }, + end: { line: 1, column: 24 } + } + } + ], + range: [13, 26], + loc: { + start: { line: 1, column: 13 }, + end: { line: 1, column: 26 } + } + }, + range: [0, 26], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 26 } + } + }, + + 'while (true) { continue }': { + type: 'WhileStatement', + test: { + type: 'Literal', + value: true, + raw: 'true', + range: [7, 11], + loc: { + start: { line: 1, column: 7 }, + end: { line: 1, column: 11 } + } + }, + body: { + type: 'BlockStatement', + body: [ + { + type: 'ContinueStatement', + label: null, + range: [15, 24], + loc: { + start: { line: 1, column: 15 }, + end: { line: 1, column: 24 } + } + } + ], + range: [13, 25], + loc: { + start: { line: 1, column: 13 }, + end: { line: 1, column: 25 } + } + }, + range: [0, 25], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 25 } + } + }, + + 'done: while (true) { continue done }': { + type: 'LabeledStatement', + label: { + type: 'Identifier', + name: 'done', + range: [0, 4], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 4 } + } + }, + body: { + type: 'WhileStatement', + test: { + type: 'Literal', + value: true, + raw: 'true', + range: [13, 17], + loc: { + start: { line: 1, column: 13 }, + end: { line: 1, column: 17 } + } + }, + body: { + type: 'BlockStatement', + body: [ + { + type: 'ContinueStatement', + label: { + type: 'Identifier', + name: 'done', + range: [30, 34], + loc: { + start: { line: 1, column: 30 }, + end: { line: 1, column: 34 } + } + }, + range: [21, 35], + loc: { + start: { line: 1, column: 21 }, + end: { line: 1, column: 35 } + } + } + ], + range: [19, 36], + loc: { + start: { line: 1, column: 19 }, + end: { line: 1, column: 36 } + } + }, + range: [6, 36], + loc: { + start: { line: 1, column: 6 }, + end: { line: 1, column: 36 } + } + }, + range: [0, 36], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 36 } + } + }, + + 'done: while (true) { continue done; }': { + type: 'LabeledStatement', + label: { + type: 'Identifier', + name: 'done', + range: [0, 4], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 4 } + } + }, + body: { + type: 'WhileStatement', + test: { + type: 'Literal', + value: true, + raw: 'true', + range: [13, 17], + loc: { + start: { line: 1, column: 13 }, + end: { line: 1, column: 17 } + } + }, + body: { + type: 'BlockStatement', + body: [ + { + type: 'ContinueStatement', + label: { + type: 'Identifier', + name: 'done', + range: [30, 34], + loc: { + start: { line: 1, column: 30 }, + end: { line: 1, column: 34 } + } + }, + range: [21, 35], + loc: { + start: { line: 1, column: 21 }, + end: { line: 1, column: 35 } + } + } + ], + range: [19, 37], + loc: { + start: { line: 1, column: 19 }, + end: { line: 1, column: 37 } + } + }, + range: [6, 37], + loc: { + start: { line: 1, column: 6 }, + end: { line: 1, column: 37 } + } + }, + range: [0, 37], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 37 } + } + }, + + '__proto__: while (true) { continue __proto__; }': { + type: 'LabeledStatement', + label: { + type: 'Identifier', + name: '__proto__', + range: [0, 9], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 9 } + } + }, + body: { + type: 'WhileStatement', + test: { + type: 'Literal', + value: true, + raw: 'true', + range: [18, 22], + loc: { + start: { line: 1, column: 18 }, + end: { line: 1, column: 22 } + } + }, + body: { + type: 'BlockStatement', + body: [{ + type: 'ContinueStatement', + label: { + type: 'Identifier', + name: '__proto__', + range: [35, 44], + loc: { + start: { line: 1, column: 35 }, + end: { line: 1, column: 44 } + } + }, + range: [26, 45], + loc: { + start: { line: 1, column: 26 }, + end: { line: 1, column: 45 } + } + }], + range: [24, 47], + loc: { + start: { line: 1, column: 24 }, + end: { line: 1, column: 47 } + } + }, + range: [11, 47], + loc: { + start: { line: 1, column: 11 }, + end: { line: 1, column: 47 } + } + }, + range: [0, 47], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 47 } + } + } + + }, + + 'break statement': { + + 'while (true) { break }': { + type: 'WhileStatement', + test: { + type: 'Literal', + value: true, + raw: 'true', + range: [7, 11], + loc: { + start: { line: 1, column: 7 }, + end: { line: 1, column: 11 } + } + }, + body: { + type: 'BlockStatement', + body: [ + { + type: 'BreakStatement', + label: null, + range: [15, 21], + loc: { + start: { line: 1, column: 15 }, + end: { line: 1, column: 21 } + } + } + ], + range: [13, 22], + loc: { + start: { line: 1, column: 13 }, + end: { line: 1, column: 22 } + } + }, + range: [0, 22], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 22 } + } + }, + + 'done: while (true) { break done }': { + type: 'LabeledStatement', + label: { + type: 'Identifier', + name: 'done', + range: [0, 4], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 4 } + } + }, + body: { + type: 'WhileStatement', + test: { + type: 'Literal', + value: true, + raw: 'true', + range: [13, 17], + loc: { + start: { line: 1, column: 13 }, + end: { line: 1, column: 17 } + } + }, + body: { + type: 'BlockStatement', + body: [ + { + type: 'BreakStatement', + label: { + type: 'Identifier', + name: 'done', + range: [27, 31], + loc: { + start: { line: 1, column: 27 }, + end: { line: 1, column: 31 } + } + }, + range: [21, 32], + loc: { + start: { line: 1, column: 21 }, + end: { line: 1, column: 32 } + } + } + ], + range: [19, 33], + loc: { + start: { line: 1, column: 19 }, + end: { line: 1, column: 33 } + } + }, + range: [6, 33], + loc: { + start: { line: 1, column: 6 }, + end: { line: 1, column: 33 } + } + }, + range: [0, 33], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 33 } + } + }, + + 'done: while (true) { break done; }': { + type: 'LabeledStatement', + label: { + type: 'Identifier', + name: 'done', + range: [0, 4], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 4 } + } + }, + body: { + type: 'WhileStatement', + test: { + type: 'Literal', + value: true, + raw: 'true', + range: [13, 17], + loc: { + start: { line: 1, column: 13 }, + end: { line: 1, column: 17 } + } + }, + body: { + type: 'BlockStatement', + body: [ + { + type: 'BreakStatement', + label: { + type: 'Identifier', + name: 'done', + range: [27, 31], + loc: { + start: { line: 1, column: 27 }, + end: { line: 1, column: 31 } + } + }, + range: [21, 32], + loc: { + start: { line: 1, column: 21 }, + end: { line: 1, column: 32 } + } + } + ], + range: [19, 34], + loc: { + start: { line: 1, column: 19 }, + end: { line: 1, column: 34 } + } + }, + range: [6, 34], + loc: { + start: { line: 1, column: 6 }, + end: { line: 1, column: 34 } + } + }, + range: [0, 34], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 34 } + } + }, + + '__proto__: while (true) { break __proto__; }': { + type: 'LabeledStatement', + label: { + type: 'Identifier', + name: '__proto__', + range: [0, 9], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 9 } + } + }, + body: { + type: 'WhileStatement', + test: { + type: 'Literal', + value: true, + raw: 'true', + range: [18, 22], + loc: { + start: { line: 1, column: 18 }, + end: { line: 1, column: 22 } + } + }, + body: { + type: 'BlockStatement', + body: [{ + type: 'BreakStatement', + label: { + type: 'Identifier', + name: '__proto__', + range: [32, 41], + loc: { + start: { line: 1, column: 32 }, + end: { line: 1, column: 41 } + } + }, + range: [26, 42], + loc: { + start: { line: 1, column: 26 }, + end: { line: 1, column: 42 } + } + }], + range: [24, 44], + loc: { + start: { line: 1, column: 24 }, + end: { line: 1, column: 44 } + } + }, + range: [11, 44], + loc: { + start: { line: 1, column: 11 }, + end: { line: 1, column: 44 } + } + }, + range: [0, 44], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 44 } + } + } + + }, + + 'return statement': { + + '(function(){ return })': { + type: 'ExpressionStatement', + expression: { + type: 'FunctionExpression', + id: null, + params: [], + defaults: [], + body: { + type: 'BlockStatement', + body: [ + { + type: 'ReturnStatement', + argument: null, + range: [13, 20], + loc: { + start: { line: 1, column: 13 }, + end: { line: 1, column: 20 } + } + } + ], + range: [11, 21], + loc: { + start: { line: 1, column: 11 }, + end: { line: 1, column: 21 } + } + }, + rest: null, + generator: false, + expression: false, + range: [1, 21], + loc: { + start: { line: 1, column: 1 }, + end: { line: 1, column: 21 } + } + }, + range: [0, 22], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 22 } + } + }, + + '(function(){ return; })': { + type: 'ExpressionStatement', + expression: { + type: 'FunctionExpression', + id: null, + params: [], + defaults: [], + body: { + type: 'BlockStatement', + body: [ + { + type: 'ReturnStatement', + argument: null, + range: [13, 20], + loc: { + start: { line: 1, column: 13 }, + end: { line: 1, column: 20 } + } + } + ], + range: [11, 22], + loc: { + start: { line: 1, column: 11 }, + end: { line: 1, column: 22 } + } + }, + rest: null, + generator: false, + expression: false, + range: [1, 22], + loc: { + start: { line: 1, column: 1 }, + end: { line: 1, column: 22 } + } + }, + range: [0, 23], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 23 } + } + }, + + '(function(){ return x; })': { + type: 'ExpressionStatement', + expression: { + type: 'FunctionExpression', + id: null, + params: [], + defaults: [], + body: { + type: 'BlockStatement', + body: [ + { + type: 'ReturnStatement', + argument: { + type: 'Identifier', + name: 'x', + range: [20, 21], + loc: { + start: { line: 1, column: 20 }, + end: { line: 1, column: 21 } + } + }, + range: [13, 22], + loc: { + start: { line: 1, column: 13 }, + end: { line: 1, column: 22 } + } + } + ], + range: [11, 24], + loc: { + start: { line: 1, column: 11 }, + end: { line: 1, column: 24 } + } + }, + rest: null, + generator: false, + expression: false, + range: [1, 24], + loc: { + start: { line: 1, column: 1 }, + end: { line: 1, column: 24 } + } + }, + range: [0, 25], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 25 } + } + }, + + '(function(){ return x * y })': { + type: 'ExpressionStatement', + expression: { + type: 'FunctionExpression', + id: null, + params: [], + defaults: [], + body: { + type: 'BlockStatement', + body: [ + { + type: 'ReturnStatement', + argument: { + type: 'BinaryExpression', + operator: '*', + left: { + type: 'Identifier', + name: 'x', + range: [20, 21], + loc: { + start: { line: 1, column: 20 }, + end: { line: 1, column: 21 } + } + }, + right: { + type: 'Identifier', + name: 'y', + range: [24, 25], + loc: { + start: { line: 1, column: 24 }, + end: { line: 1, column: 25 } + } + }, + range: [20, 25], + loc: { + start: { line: 1, column: 20 }, + end: { line: 1, column: 25 } + } + }, + range: [13, 26], + loc: { + start: { line: 1, column: 13 }, + end: { line: 1, column: 26 } + } + } + ], + range: [11, 27], + loc: { + start: { line: 1, column: 11 }, + end: { line: 1, column: 27 } + } + }, + rest: null, + generator: false, + expression: false, + range: [1, 27], + loc: { + start: { line: 1, column: 1 }, + end: { line: 1, column: 27 } + } + }, + range: [0, 28], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 28 } + } + } + }, + + 'with statement': { + + 'with (x) foo = bar': { + type: 'WithStatement', + object: { + type: 'Identifier', + name: 'x', + range: [6, 7], + loc: { + start: { line: 1, column: 6 }, + end: { line: 1, column: 7 } + } + }, + body: { + type: 'ExpressionStatement', + expression: { + type: 'AssignmentExpression', + operator: '=', + left: { + type: 'Identifier', + name: 'foo', + range: [9, 12], + loc: { + start: { line: 1, column: 9 }, + end: { line: 1, column: 12 } + } + }, + right: { + type: 'Identifier', + name: 'bar', + range: [15, 18], + loc: { + start: { line: 1, column: 15 }, + end: { line: 1, column: 18 } + } + }, + range: [9, 18], + loc: { + start: { line: 1, column: 9 }, + end: { line: 1, column: 18 } + } + }, + range: [9, 18], + loc: { + start: { line: 1, column: 9 }, + end: { line: 1, column: 18 } + } + }, + range: [0, 18], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 18 } + } + }, + + 'with (x) foo = bar;': { + type: 'WithStatement', + object: { + type: 'Identifier', + name: 'x', + range: [6, 7], + loc: { + start: { line: 1, column: 6 }, + end: { line: 1, column: 7 } + } + }, + body: { + type: 'ExpressionStatement', + expression: { + type: 'AssignmentExpression', + operator: '=', + left: { + type: 'Identifier', + name: 'foo', + range: [9, 12], + loc: { + start: { line: 1, column: 9 }, + end: { line: 1, column: 12 } + } + }, + right: { + type: 'Identifier', + name: 'bar', + range: [15, 18], + loc: { + start: { line: 1, column: 15 }, + end: { line: 1, column: 18 } + } + }, + range: [9, 18], + loc: { + start: { line: 1, column: 9 }, + end: { line: 1, column: 18 } + } + }, + range: [9, 19], + loc: { + start: { line: 1, column: 9 }, + end: { line: 1, column: 19 } + } + }, + range: [0, 19], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 19 } + } + }, + + 'with (x) { foo = bar }': { + type: 'WithStatement', + object: { + type: 'Identifier', + name: 'x', + range: [6, 7], + loc: { + start: { line: 1, column: 6 }, + end: { line: 1, column: 7 } + } + }, + body: { + type: 'BlockStatement', + body: [{ + type: 'ExpressionStatement', + expression: { + type: 'AssignmentExpression', + operator: '=', + left: { + type: 'Identifier', + name: 'foo', + range: [11, 14], + loc: { + start: { line: 1, column: 11 }, + end: { line: 1, column: 14 } + } + }, + right: { + type: 'Identifier', + name: 'bar', + range: [17, 20], + loc: { + start: { line: 1, column: 17 }, + end: { line: 1, column: 20 } + } + }, + range: [11, 20], + loc: { + start: { line: 1, column: 11 }, + end: { line: 1, column: 20 } + } + }, + range: [11, 21], + loc: { + start: { line: 1, column: 11 }, + end: { line: 1, column: 21 } + } + }], + range: [9, 22], + loc: { + start: { line: 1, column: 9 }, + end: { line: 1, column: 22 } + } + }, + range: [0, 22], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 22 } + } + } + + }, + + 'switch statement': { + + 'switch (x) {}': { + type: 'SwitchStatement', + discriminant: { + type: 'Identifier', + name: 'x', + range: [8, 9], + loc: { + start: { line: 1, column: 8 }, + end: { line: 1, column: 9 } + } + }, + cases:[], + range: [0, 13], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 13 } + } + }, + + 'switch (answer) { case 42: hi(); break; }': { + type: 'SwitchStatement', + discriminant: { + type: 'Identifier', + name: 'answer', + range: [8, 14], + loc: { + start: { line: 1, column: 8 }, + end: { line: 1, column: 14 } + } + }, + cases: [{ + type: 'SwitchCase', + test: { + type: 'Literal', + value: 42, + raw: '42', + range: [23, 25], + loc: { + start: { line: 1, column: 23 }, + end: { line: 1, column: 25 } + } + }, + consequent: [{ + type: 'ExpressionStatement', + expression: { + type: 'CallExpression', + callee: { + type: 'Identifier', + name: 'hi', + range: [27, 29], + loc: { + start: { line: 1, column: 27 }, + end: { line: 1, column: 29 } + } + }, + 'arguments': [], + range: [27, 31], + loc: { + start: { line: 1, column: 27 }, + end: { line: 1, column: 31 } + } + }, + range: [27, 32], + loc: { + start: { line: 1, column: 27 }, + end: { line: 1, column: 32 } + } + }, { + type: 'BreakStatement', + label: null, + range: [33, 39], + loc: { + start: { line: 1, column: 33 }, + end: { line: 1, column: 39 } + } + }], + range: [18, 39], + loc: { + start: { line: 1, column: 18 }, + end: { line: 1, column: 39 } + } + }], + range: [0, 41], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 41 } + } + }, + + 'switch (answer) { case 42: hi(); break; default: break }': { + type: 'SwitchStatement', + discriminant: { + type: 'Identifier', + name: 'answer', + range: [8, 14], + loc: { + start: { line: 1, column: 8 }, + end: { line: 1, column: 14 } + } + }, + cases: [{ + type: 'SwitchCase', + test: { + type: 'Literal', + value: 42, + raw: '42', + range: [23, 25], + loc: { + start: { line: 1, column: 23 }, + end: { line: 1, column: 25 } + } + }, + consequent: [{ + type: 'ExpressionStatement', + expression: { + type: 'CallExpression', + callee: { + type: 'Identifier', + name: 'hi', + range: [27, 29], + loc: { + start: { line: 1, column: 27 }, + end: { line: 1, column: 29 } + } + }, + 'arguments': [], + range: [27, 31], + loc: { + start: { line: 1, column: 27 }, + end: { line: 1, column: 31 } + } + }, + range: [27, 32], + loc: { + start: { line: 1, column: 27 }, + end: { line: 1, column: 32 } + } + }, { + type: 'BreakStatement', + label: null, + range: [33, 39], + loc: { + start: { line: 1, column: 33 }, + end: { line: 1, column: 39 } + } + }], + range: [18, 39], + loc: { + start: { line: 1, column: 18 }, + end: { line: 1, column: 39 } + } + }, { + type: 'SwitchCase', + test: null, + consequent: [{ + type: 'BreakStatement', + label: null, + range: [49, 55], + loc: { + start: { line: 1, column: 49 }, + end: { line: 1, column: 55 } + } + }], + range: [40, 55], + loc: { + start: { line: 1, column: 40 }, + end: { line: 1, column: 55 } + } + }], + range: [0, 56], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 56 } + } + } + + }, + + 'Labelled Statements': { + + 'start: for (;;) break start': { + type: 'LabeledStatement', + label: { + type: 'Identifier', + name: 'start', + range: [0, 5], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 5 } + } + }, + body: { + type: 'ForStatement', + init: null, + test: null, + update: null, + body: { + type: 'BreakStatement', + label: { + type: 'Identifier', + name: 'start', + range: [22, 27], + loc: { + start: { line: 1, column: 22 }, + end: { line: 1, column: 27 } + } + }, + range: [16, 27], + loc: { + start: { line: 1, column: 16 }, + end: { line: 1, column: 27 } + } + }, + range: [7, 27], + loc: { + start: { line: 1, column: 7 }, + end: { line: 1, column: 27 } + } + }, + range: [0, 27], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 27 } + } + }, + + 'start: while (true) break start': { + type: 'LabeledStatement', + label: { + type: 'Identifier', + name: 'start', + range: [0, 5], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 5 } + } + }, + body: { + type: 'WhileStatement', + test: { + type: 'Literal', + value: true, + raw: 'true', + range: [14, 18], + loc: { + start: { line: 1, column: 14 }, + end: { line: 1, column: 18 } + } + }, + body: { + type: 'BreakStatement', + label: { + type: 'Identifier', + name: 'start', + range: [26, 31], + loc: { + start: { line: 1, column: 26 }, + end: { line: 1, column: 31 } + } + }, + range: [20, 31], + loc: { + start: { line: 1, column: 20 }, + end: { line: 1, column: 31 } + } + }, + range: [7, 31], + loc: { + start: { line: 1, column: 7 }, + end: { line: 1, column: 31 } + } + }, + range: [0, 31], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 31 } + } + }, + + '__proto__: test': { + type: 'LabeledStatement', + label: { + type: 'Identifier', + name: '__proto__', + range: [0, 9], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 9 } + } + }, + body: { + type: 'ExpressionStatement', + expression: { + type: 'Identifier', + name: 'test', + range: [11, 15], + loc: { + start: { line: 1, column: 11 }, + end: { line: 1, column: 15 } + } + }, + range: [11, 15], + loc: { + start: { line: 1, column: 11 }, + end: { line: 1, column: 15 } + } + }, + range: [0, 15], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 15 } + } + } + + }, + + 'throw statement': { + + 'throw x;': { + type: 'ThrowStatement', + argument: { + type: 'Identifier', + name: 'x', + range: [6, 7], + loc: { + start: { line: 1, column: 6 }, + end: { line: 1, column: 7 } + } + }, + range: [0, 8], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 8 } + } + }, + + 'throw x * y': { + type: 'ThrowStatement', + argument: { + type: 'BinaryExpression', + operator: '*', + left: { + type: 'Identifier', + name: 'x', + range: [6, 7], + loc: { + start: { line: 1, column: 6 }, + end: { line: 1, column: 7 } + } + }, + right: { + type: 'Identifier', + name: 'y', + range: [10, 11], + loc: { + start: { line: 1, column: 10 }, + end: { line: 1, column: 11 } + } + }, + range: [6, 11], + loc: { + start: { line: 1, column: 6 }, + end: { line: 1, column: 11 } + } + }, + range: [0, 11], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 11 } + } + }, + + 'throw { message: "Error" }': { + type: 'ThrowStatement', + argument: { + type: 'ObjectExpression', + properties: [{ + type: 'Property', + key: { + type: 'Identifier', + name: 'message', + range: [8, 15], + loc: { + start: { line: 1, column: 8 }, + end: { line: 1, column: 15 } + } + }, + value: { + type: 'Literal', + value: 'Error', + raw: '"Error"', + range: [17, 24], + loc: { + start: { line: 1, column: 17 }, + end: { line: 1, column: 24 } + } + }, + kind: 'init', + method: false, + shorthand: false, + range: [8, 24], + loc: { + start: { line: 1, column: 8 }, + end: { line: 1, column: 24 } + } + }], + range: [6, 26], + loc: { + start: { line: 1, column: 6 }, + end: { line: 1, column: 26 } + } + }, + range: [0, 26], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 26 } + } + } + + }, + + 'try statement': { + + 'try { } catch (e) { }': { + type: 'TryStatement', + block: { + type: 'BlockStatement', + body: [], + range: [4, 7], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 7 } + } + }, + guardedHandlers: [], + handlers: [{ + type: 'CatchClause', + param: { + type: 'Identifier', + name: 'e', + range: [15, 16], + loc: { + start: { line: 1, column: 15 }, + end: { line: 1, column: 16 } + } + }, + body: { + type: 'BlockStatement', + body: [], + range: [18, 21], + loc: { + start: { line: 1, column: 18 }, + end: { line: 1, column: 21 } + } + }, + range: [8, 21], + loc: { + start: { line: 1, column: 8 }, + end: { line: 1, column: 21 } + } + }], + finalizer: null, + range: [0, 21], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 21 } + } + }, + + 'try { } catch (eval) { }': { + type: 'TryStatement', + block: { + type: 'BlockStatement', + body: [], + range: [4, 7], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 7 } + } + }, + guardedHandlers: [], + handlers: [{ + type: 'CatchClause', + param: { + type: 'Identifier', + name: 'eval', + range: [15, 19], + loc: { + start: { line: 1, column: 15 }, + end: { line: 1, column: 19 } + } + }, + body: { + type: 'BlockStatement', + body: [], + range: [21, 24], + loc: { + start: { line: 1, column: 21 }, + end: { line: 1, column: 24 } + } + }, + range: [8, 24], + loc: { + start: { line: 1, column: 8 }, + end: { line: 1, column: 24 } + } + }], + finalizer: null, + range: [0, 24], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 24 } + } + }, + + 'try { } catch (arguments) { }': { + type: 'TryStatement', + block: { + type: 'BlockStatement', + body: [], + range: [4, 7], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 7 } + } + }, + guardedHandlers: [], + handlers: [{ + type: 'CatchClause', + param: { + type: 'Identifier', + name: 'arguments', + range: [15, 24], + loc: { + start: { line: 1, column: 15 }, + end: { line: 1, column: 24 } + } + }, + body: { + type: 'BlockStatement', + body: [], + range: [26, 29], + loc: { + start: { line: 1, column: 26 }, + end: { line: 1, column: 29 } + } + }, + range: [8, 29], + loc: { + start: { line: 1, column: 8 }, + end: { line: 1, column: 29 } + } + }], + finalizer: null, + range: [0, 29], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 29 } + } + }, + + 'try { } catch (e) { say(e) }': { + type: 'TryStatement', + block: { + type: 'BlockStatement', + body: [], + range: [4, 7], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 7 } + } + }, + guardedHandlers: [], + handlers: [{ + type: 'CatchClause', + param: { + type: 'Identifier', + name: 'e', + range: [15, 16], + loc: { + start: { line: 1, column: 15 }, + end: { line: 1, column: 16 } + } + }, + body: { + type: 'BlockStatement', + body: [{ + type: 'ExpressionStatement', + expression: { + type: 'CallExpression', + callee: { + type: 'Identifier', + name: 'say', + range: [20, 23], + loc: { + start: { line: 1, column: 20 }, + end: { line: 1, column: 23 } + } + }, + 'arguments': [{ + type: 'Identifier', + name: 'e', + range: [24, 25], + loc: { + start: { line: 1, column: 24 }, + end: { line: 1, column: 25 } + } + }], + range: [20, 26], + loc: { + start: { line: 1, column: 20 }, + end: { line: 1, column: 26 } + } + }, + range: [20, 27], + loc: { + start: { line: 1, column: 20 }, + end: { line: 1, column: 27 } + } + }], + range: [18, 28], + loc: { + start: { line: 1, column: 18 }, + end: { line: 1, column: 28 } + } + }, + range: [8, 28], + loc: { + start: { line: 1, column: 8 }, + end: { line: 1, column: 28 } + } + }], + finalizer: null, + range: [0, 28], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 28 } + } + }, + + 'try { } finally { cleanup(stuff) }': { + type: 'TryStatement', + block: { + type: 'BlockStatement', + body: [], + range: [4, 7], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 7 } + } + }, + guardedHandlers: [], + handlers: [], + finalizer: { + type: 'BlockStatement', + body: [{ + type: 'ExpressionStatement', + expression: { + type: 'CallExpression', + callee: { + type: 'Identifier', + name: 'cleanup', + range: [18, 25], + loc: { + start: { line: 1, column: 18 }, + end: { line: 1, column: 25 } + } + }, + 'arguments': [{ + type: 'Identifier', + name: 'stuff', + range: [26, 31], + loc: { + start: { line: 1, column: 26 }, + end: { line: 1, column: 31 } + } + }], + range: [18, 32], + loc: { + start: { line: 1, column: 18 }, + end: { line: 1, column: 32 } + } + }, + range: [18, 33], + loc: { + start: { line: 1, column: 18 }, + end: { line: 1, column: 33 } + } + }], + range: [16, 34], + loc: { + start: { line: 1, column: 16 }, + end: { line: 1, column: 34 } + } + }, + range: [0, 34], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 34 } + } + }, + + 'try { doThat(); } catch (e) { say(e) }': { + type: 'TryStatement', + block: { + type: 'BlockStatement', + body: [{ + type: 'ExpressionStatement', + expression: { + type: 'CallExpression', + callee: { + type: 'Identifier', + name: 'doThat', + range: [6, 12], + loc: { + start: { line: 1, column: 6 }, + end: { line: 1, column: 12 } + } + }, + 'arguments': [], + range: [6, 14], + loc: { + start: { line: 1, column: 6 }, + end: { line: 1, column: 14 } + } + }, + range: [6, 15], + loc: { + start: { line: 1, column: 6 }, + end: { line: 1, column: 15 } + } + }], + range: [4, 17], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 17 } + } + }, + guardedHandlers: [], + handlers: [{ + type: 'CatchClause', + param: { + type: 'Identifier', + name: 'e', + range: [25, 26], + loc: { + start: { line: 1, column: 25 }, + end: { line: 1, column: 26 } + } + }, + body: { + type: 'BlockStatement', + body: [{ + type: 'ExpressionStatement', + expression: { + type: 'CallExpression', + callee: { + type: 'Identifier', + name: 'say', + range: [30, 33], + loc: { + start: { line: 1, column: 30 }, + end: { line: 1, column: 33 } + } + }, + 'arguments': [{ + type: 'Identifier', + name: 'e', + range: [34, 35], + loc: { + start: { line: 1, column: 34 }, + end: { line: 1, column: 35 } + } + }], + range: [30, 36], + loc: { + start: { line: 1, column: 30 }, + end: { line: 1, column: 36 } + } + }, + range: [30, 37], + loc: { + start: { line: 1, column: 30 }, + end: { line: 1, column: 37 } + } + }], + range: [28, 38], + loc: { + start: { line: 1, column: 28 }, + end: { line: 1, column: 38 } + } + }, + range: [18, 38], + loc: { + start: { line: 1, column: 18 }, + end: { line: 1, column: 38 } + } + }], + finalizer: null, + range: [0, 38], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 38 } + } + }, + + 'try { doThat(); } catch (e) { say(e) } finally { cleanup(stuff) }': { + type: 'TryStatement', + block: { + type: 'BlockStatement', + body: [{ + type: 'ExpressionStatement', + expression: { + type: 'CallExpression', + callee: { + type: 'Identifier', + name: 'doThat', + range: [6, 12], + loc: { + start: { line: 1, column: 6 }, + end: { line: 1, column: 12 } + } + }, + 'arguments': [], + range: [6, 14], + loc: { + start: { line: 1, column: 6 }, + end: { line: 1, column: 14 } + } + }, + range: [6, 15], + loc: { + start: { line: 1, column: 6 }, + end: { line: 1, column: 15 } + } + }], + range: [4, 17], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 17 } + } + }, + guardedHandlers: [], + handlers: [{ + type: 'CatchClause', + param: { + type: 'Identifier', + name: 'e', + range: [25, 26], + loc: { + start: { line: 1, column: 25 }, + end: { line: 1, column: 26 } + } + }, + body: { + type: 'BlockStatement', + body: [{ + type: 'ExpressionStatement', + expression: { + type: 'CallExpression', + callee: { + type: 'Identifier', + name: 'say', + range: [30, 33], + loc: { + start: { line: 1, column: 30 }, + end: { line: 1, column: 33 } + } + }, + 'arguments': [{ + type: 'Identifier', + name: 'e', + range: [34, 35], + loc: { + start: { line: 1, column: 34 }, + end: { line: 1, column: 35 } + } + }], + range: [30, 36], + loc: { + start: { line: 1, column: 30 }, + end: { line: 1, column: 36 } + } + }, + range: [30, 37], + loc: { + start: { line: 1, column: 30 }, + end: { line: 1, column: 37 } + } + }], + range: [28, 38], + loc: { + start: { line: 1, column: 28 }, + end: { line: 1, column: 38 } + } + }, + range: [18, 38], + loc: { + start: { line: 1, column: 18 }, + end: { line: 1, column: 38 } + } + }], + finalizer: { + type: 'BlockStatement', + body: [{ + type: 'ExpressionStatement', + expression: { + type: 'CallExpression', + callee: { + type: 'Identifier', + name: 'cleanup', + range: [49, 56], + loc: { + start: { line: 1, column: 49 }, + end: { line: 1, column: 56 } + } + }, + 'arguments': [{ + type: 'Identifier', + name: 'stuff', + range: [57, 62], + loc: { + start: { line: 1, column: 57 }, + end: { line: 1, column: 62 } + } + }], + range: [49, 63], + loc: { + start: { line: 1, column: 49 }, + end: { line: 1, column: 63 } + } + }, + range: [49, 64], + loc: { + start: { line: 1, column: 49 }, + end: { line: 1, column: 64 } + } + }], + range: [47, 65], + loc: { + start: { line: 1, column: 47 }, + end: { line: 1, column: 65 } + } + }, + range: [0, 65], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 65 } + } + } + + }, + + 'debugger statement': { + + 'debugger;': { + type: 'DebuggerStatement', + range: [0, 9], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 9 } + } + } + + }, + + 'Function Definition': { + + 'function hello() { sayHi(); }': { + type: 'FunctionDeclaration', + id: { + type: 'Identifier', + name: 'hello', + range: [9, 14], + loc: { + start: { line: 1, column: 9 }, + end: { line: 1, column: 14 } + } + }, + params: [], + defaults: [], + body: { + type: 'BlockStatement', + body: [{ + type: 'ExpressionStatement', + expression: { + type: 'CallExpression', + callee: { + type: 'Identifier', + name: 'sayHi', + range: [19, 24], + loc: { + start: { line: 1, column: 19 }, + end: { line: 1, column: 24 } + } + }, + 'arguments': [], + range: [19, 26], + loc: { + start: { line: 1, column: 19 }, + end: { line: 1, column: 26 } + } + }, + range: [19, 27], + loc: { + start: { line: 1, column: 19 }, + end: { line: 1, column: 27 } + } + }], + range: [17, 29], + loc: { + start: { line: 1, column: 17 }, + end: { line: 1, column: 29 } + } + }, + rest: null, + generator: false, + expression: false, + range: [0, 29], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 29 } + } + }, + + 'function eval() { }': { + type: 'FunctionDeclaration', + id: { + type: 'Identifier', + name: 'eval', + range: [9, 13], + loc: { + start: { line: 1, column: 9 }, + end: { line: 1, column: 13 } + } + }, + params: [], + defaults: [], + body: { + type: 'BlockStatement', + body: [], + range: [16, 19], + loc: { + start: { line: 1, column: 16 }, + end: { line: 1, column: 19 } + } + }, + rest: null, + generator: false, + expression: false, + range: [0, 19], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 19 } + } + }, + + 'function arguments() { }': { + type: 'FunctionDeclaration', + id: { + type: 'Identifier', + name: 'arguments', + range: [9, 18], + loc: { + start: { line: 1, column: 9 }, + end: { line: 1, column: 18 } + } + }, + params: [], + defaults: [], + body: { + type: 'BlockStatement', + body: [], + range: [21, 24], + loc: { + start: { line: 1, column: 21 }, + end: { line: 1, column: 24 } + } + }, + rest: null, + generator: false, + expression: false, + range: [0, 24], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 24 } + } + }, + + 'function test(t, t) { }': { + type: 'FunctionDeclaration', + id: { + type: 'Identifier', + name: 'test', + range: [9, 13], + loc: { + start: { line: 1, column: 9 }, + end: { line: 1, column: 13 } + } + }, + params: [{ + type: 'Identifier', + name: 't', + range: [14, 15], + loc: { + start: { line: 1, column: 14 }, + end: { line: 1, column: 15 } + } + }, { + type: 'Identifier', + name: 't', + range: [17, 18], + loc: { + start: { line: 1, column: 17 }, + end: { line: 1, column: 18 } + } + }], + defaults: [], + body: { + type: 'BlockStatement', + body: [], + range: [20, 23], + loc: { + start: { line: 1, column: 20 }, + end: { line: 1, column: 23 } + } + }, + rest: null, + generator: false, + expression: false, + range: [0, 23], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 23 } + } + }, + + '(function test(t, t) { })': { + type: 'ExpressionStatement', + expression: { + type: 'FunctionExpression', + id: { + type: 'Identifier', + name: 'test', + range: [10, 14], + loc: { + start: { line: 1, column: 10 }, + end: { line: 1, column: 14 } + } + }, + params: [{ + type: 'Identifier', + name: 't', + range: [15, 16], + loc: { + start: { line: 1, column: 15 }, + end: { line: 1, column: 16 } + } + }, { + type: 'Identifier', + name: 't', + range: [18, 19], + loc: { + start: { line: 1, column: 18 }, + end: { line: 1, column: 19 } + } + }], + defaults: [], + body: { + type: 'BlockStatement', + body: [], + range: [21, 24], + loc: { + start: { line: 1, column: 21 }, + end: { line: 1, column: 24 } + } + }, + rest: null, + generator: false, + expression: false, + range: [1, 24], + loc: { + start: { line: 1, column: 1 }, + end: { line: 1, column: 24 } + } + }, + range: [0, 25], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 25 } + } + }, + + 'function eval() { function inner() { "use strict" } }': { + type: 'FunctionDeclaration', + id: { + type: 'Identifier', + name: 'eval', + range: [9, 13], + loc: { + start: { line: 1, column: 9 }, + end: { line: 1, column: 13 } + } + }, + params: [], + defaults: [], + body: { + type: 'BlockStatement', + body: [{ + type: 'FunctionDeclaration', + id: { + type: 'Identifier', + name: 'inner', + range: [27, 32], + loc: { + start: { line: 1, column: 27 }, + end: { line: 1, column: 32 } + } + }, + params: [], + defaults: [], + body: { + type: 'BlockStatement', + body: [{ + type: 'ExpressionStatement', + expression: { + type: 'Literal', + value: 'use strict', + raw: '\"use strict\"', + range: [37, 49], + loc: { + start: { line: 1, column: 37 }, + end: { line: 1, column: 49 } + } + }, + range: [37, 50], + loc: { + start: { line: 1, column: 37 }, + end: { line: 1, column: 50 } + } + }], + range: [35, 51], + loc: { + start: { line: 1, column: 35 }, + end: { line: 1, column: 51 } + } + }, + rest: null, + generator: false, + expression: false, + range: [18, 51], + loc: { + start: { line: 1, column: 18 }, + end: { line: 1, column: 51 } + } + }], + range: [16, 53], + loc: { + start: { line: 1, column: 16 }, + end: { line: 1, column: 53 } + } + }, + rest: null, + generator: false, + expression: false, + range: [0, 53], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 53 } + } + }, + + 'function hello(a) { sayHi(); }': { + type: 'FunctionDeclaration', + id: { + type: 'Identifier', + name: 'hello', + range: [9, 14], + loc: { + start: { line: 1, column: 9 }, + end: { line: 1, column: 14 } + } + }, + params: [{ + type: 'Identifier', + name: 'a', + range: [15, 16], + loc: { + start: { line: 1, column: 15 }, + end: { line: 1, column: 16 } + } + }], + defaults: [], + body: { + type: 'BlockStatement', + body: [{ + type: 'ExpressionStatement', + expression: { + type: 'CallExpression', + callee: { + type: 'Identifier', + name: 'sayHi', + range: [20, 25], + loc: { + start: { line: 1, column: 20 }, + end: { line: 1, column: 25 } + } + }, + 'arguments': [], + range: [20, 27], + loc: { + start: { line: 1, column: 20 }, + end: { line: 1, column: 27 } + } + }, + range: [20, 28], + loc: { + start: { line: 1, column: 20 }, + end: { line: 1, column: 28 } + } + }], + range: [18, 30], + loc: { + start: { line: 1, column: 18 }, + end: { line: 1, column: 30 } + } + }, + rest: null, + generator: false, + expression: false, + range: [0, 30], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 30 } + } + }, + + 'function hello(a, b) { sayHi(); }': { + type: 'FunctionDeclaration', + id: { + type: 'Identifier', + name: 'hello', + range: [9, 14], + loc: { + start: { line: 1, column: 9 }, + end: { line: 1, column: 14 } + } + }, + params: [{ + type: 'Identifier', + name: 'a', + range: [15, 16], + loc: { + start: { line: 1, column: 15 }, + end: { line: 1, column: 16 } + } + }, { + type: 'Identifier', + name: 'b', + range: [18, 19], + loc: { + start: { line: 1, column: 18 }, + end: { line: 1, column: 19 } + } + }], + defaults: [], + body: { + type: 'BlockStatement', + body: [{ + type: 'ExpressionStatement', + expression: { + type: 'CallExpression', + callee: { + type: 'Identifier', + name: 'sayHi', + range: [23, 28], + loc: { + start: { line: 1, column: 23 }, + end: { line: 1, column: 28 } + } + }, + 'arguments': [], + range: [23, 30], + loc: { + start: { line: 1, column: 23 }, + end: { line: 1, column: 30 } + } + }, + range: [23, 31], + loc: { + start: { line: 1, column: 23 }, + end: { line: 1, column: 31 } + } + }], + range: [21, 33], + loc: { + start: { line: 1, column: 21 }, + end: { line: 1, column: 33 } + } + }, + rest: null, + generator: false, + expression: false, + range: [0, 33], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 33 } + } + }, + + 'var hi = function() { sayHi() };': { + type: 'VariableDeclaration', + declarations: [{ + type: 'VariableDeclarator', + id: { + type: 'Identifier', + name: 'hi', + range: [4, 6], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 6 } + } + }, + init: { + type: 'FunctionExpression', + id: null, + params: [], + defaults: [], + body: { + type: 'BlockStatement', + body: [{ + type: 'ExpressionStatement', + expression: { + type: 'CallExpression', + callee: { + type: 'Identifier', + name: 'sayHi', + range: [22, 27], + loc: { + start: { line: 1, column: 22 }, + end: { line: 1, column: 27 } + } + }, + 'arguments': [], + range: [22, 29], + loc: { + start: { line: 1, column: 22 }, + end: { line: 1, column: 29 } + } + }, + range: [22, 30], + loc: { + start: { line: 1, column: 22 }, + end: { line: 1, column: 30 } + } + }], + range: [20, 31], + loc: { + start: { line: 1, column: 20 }, + end: { line: 1, column: 31 } + } + }, + rest: null, + generator: false, + expression: false, + range: [9, 31], + loc: { + start: { line: 1, column: 9 }, + end: { line: 1, column: 31 } + } + }, + range: [4, 31], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 31 } + } + }], + kind: 'var', + range: [0, 32], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 32 } + } + }, + + 'var hi = function eval() { };': { + type: 'VariableDeclaration', + declarations: [{ + type: 'VariableDeclarator', + id: { + type: 'Identifier', + name: 'hi', + range: [4, 6], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 6 } + } + }, + init: { + type: 'FunctionExpression', + id: { + type: 'Identifier', + name: 'eval', + range: [18, 22], + loc: { + start: { line: 1, column: 18 }, + end: { line: 1, column: 22 } + } + }, + params: [], + defaults: [], + body: { + type: 'BlockStatement', + body: [], + range: [25, 28], + loc: { + start: { line: 1, column: 25 }, + end: { line: 1, column: 28 } + } + }, + rest: null, + generator: false, + expression: false, + range: [9, 28], + loc: { + start: { line: 1, column: 9 }, + end: { line: 1, column: 28 } + } + }, + range: [4, 28], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 28 } + } + }], + kind: 'var', + range: [0, 29], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 29 } + } + }, + + 'var hi = function arguments() { };': { + type: 'VariableDeclaration', + declarations: [{ + type: 'VariableDeclarator', + id: { + type: 'Identifier', + name: 'hi', + range: [4, 6], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 6 } + } + }, + init: { + type: 'FunctionExpression', + id: { + type: 'Identifier', + name: 'arguments', + range: [18, 27], + loc: { + start: { line: 1, column: 18 }, + end: { line: 1, column: 27 } + } + }, + params: [], + defaults: [], + body: { + type: 'BlockStatement', + body: [], + range: [30, 33], + loc: { + start: { line: 1, column: 30 }, + end: { line: 1, column: 33 } + } + }, + rest: null, + generator: false, + expression: false, + range: [9, 33], + loc: { + start: { line: 1, column: 9 }, + end: { line: 1, column: 33 } + } + }, + range: [4, 33], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 33 } + } + }], + kind: 'var', + range: [0, 34], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 34 } + } + }, + + 'var hello = function hi() { sayHi() };': { + type: 'VariableDeclaration', + declarations: [{ + type: 'VariableDeclarator', + id: { + type: 'Identifier', + name: 'hello', + range: [4, 9], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 9 } + } + }, + init: { + type: 'FunctionExpression', + id: { + type: 'Identifier', + name: 'hi', + range: [21, 23], + loc: { + start: { line: 1, column: 21 }, + end: { line: 1, column: 23 } + } + }, + params: [], + defaults: [], + body: { + type: 'BlockStatement', + body: [{ + type: 'ExpressionStatement', + expression: { + type: 'CallExpression', + callee: { + type: 'Identifier', + name: 'sayHi', + range: [28, 33], + loc: { + start: { line: 1, column: 28 }, + end: { line: 1, column: 33 } + } + }, + 'arguments': [], + range: [28, 35], + loc: { + start: { line: 1, column: 28 }, + end: { line: 1, column: 35 } + } + }, + range: [28, 36], + loc: { + start: { line: 1, column: 28 }, + end: { line: 1, column: 36 } + } + }], + range: [26, 37], + loc: { + start: { line: 1, column: 26 }, + end: { line: 1, column: 37 } + } + }, + rest: null, + generator: false, + expression: false, + range: [12, 37], + loc: { + start: { line: 1, column: 12 }, + end: { line: 1, column: 37 } + } + }, + range: [4, 37], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 37 } + } + }], + kind: 'var', + range: [0, 38], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 38 } + } + }, + + '(function(){})': { + type: 'ExpressionStatement', + expression: { + type: 'FunctionExpression', + id: null, + params: [], + defaults: [], + body: { + type: 'BlockStatement', + body: [], + range: [11, 13], + loc: { + start: { line: 1, column: 11 }, + end: { line: 1, column: 13 } + } + }, + rest: null, + generator: false, + expression: false, + range: [1, 13], + loc: { + start: { line: 1, column: 1 }, + end: { line: 1, column: 13 } + } + }, + range: [0, 14], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 14 } + } + }, + + 'function universe(__proto__) { }': { + type: 'FunctionDeclaration', + id: { + type: 'Identifier', + name: 'universe', + range: [9, 17], + loc: { + start: { line: 1, column: 9 }, + end: { line: 1, column: 17 } + } + }, + params: [{ + type: 'Identifier', + name: '__proto__', + range: [18, 27], + loc: { + start: { line: 1, column: 18 }, + end: { line: 1, column: 27 } + } + }], + defaults: [], + body: { + type: 'BlockStatement', + body: [], + range: [29, 32], + loc: { + start: { line: 1, column: 29 }, + end: { line: 1, column: 32 } + } + }, + rest: null, + generator: false, + expression: false, + range: [0, 32], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 32 } + } + }, + + 'function test() { "use strict" + 42; }': { + type: 'FunctionDeclaration', + id: { + type: 'Identifier', + name: 'test', + range: [9, 13], + loc: { + start: { line: 1, column: 9 }, + end: { line: 1, column: 13 } + } + }, + params: [], + defaults: [], + body: { + type: 'BlockStatement', + body: [{ + type: 'ExpressionStatement', + expression: { + type: 'BinaryExpression', + operator: '+', + left: { + type: 'Literal', + value: 'use strict', + raw: '"use strict"', + range: [18, 30], + loc: { + start: { line: 1, column: 18 }, + end: { line: 1, column: 30 } + } + }, + right: { + type: 'Literal', + value: 42, + raw: '42', + range: [33, 35], + loc: { + start: { line: 1, column: 33 }, + end: { line: 1, column: 35 } + } + }, + range: [18, 35], + loc: { + start: { line: 1, column: 18 }, + end: { line: 1, column: 35 } + } + }, + range: [18, 36], + loc: { + start: { line: 1, column: 18 }, + end: { line: 1, column: 36 } + } + }], + range: [16, 38], + loc: { + start: { line: 1, column: 16 }, + end: { line: 1, column: 38 } + } + }, + rest: null, + generator: false, + expression: false, + range: [0, 38], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 38 } + } + } + + }, + + '[ES6] Default Parameter Value': { + + 'x = function(y = 1) {}': { + type: 'ExpressionStatement', + expression: { + type: 'AssignmentExpression', + operator: '=', + left: { + type: 'Identifier', + name: 'x', + range: [0, 1], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 1 } + } + }, + right: { + type: 'FunctionExpression', + id: null, + params: [{ + type: 'Identifier', + name: 'y', + range: [13, 14], + loc: { + start: { line: 1, column: 13 }, + end: { line: 1, column: 14 } + } + }], + defaults: [{ + type: 'Literal', + value: 1, + raw: '1', + range: [17, 18], + loc: { + start: { line: 1, column: 17 }, + end: { line: 1, column: 18 } + } + }], + body: { + type: 'BlockStatement', + body: [], + range: [20, 22], + loc: { + start: { line: 1, column: 20 }, + end: { line: 1, column: 22 } + } + }, + rest: null, + generator: false, + expression: false, + range: [4, 22], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 22 } + } + }, + range: [0, 22], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 22 } + } + }, + range: [0, 22], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 22 } + } + }, + + 'function f(a = 1) {}': { + type: 'FunctionDeclaration', + id: { + type: 'Identifier', + name: 'f', + range: [9, 10], + loc: { + start: { line: 1, column: 9 }, + end: { line: 1, column: 10 } + } + }, + params: [{ + type: 'Identifier', + name: 'a', + range: [11, 12], + loc: { + start: { line: 1, column: 11 }, + end: { line: 1, column: 12 } + } + }], + defaults: [{ + type: 'Literal', + value: 1, + raw: '1', + range: [15, 16], + loc: { + start: { line: 1, column: 15 }, + end: { line: 1, column: 16 } + } + }], + body: { + type: 'BlockStatement', + body: [], + range: [18, 20], + loc: { + start: { line: 1, column: 18 }, + end: { line: 1, column: 20 } + } + }, + rest: null, + generator: false, + expression: false, + range: [0, 20], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 20 } + } + }, + + 'x = { f: function(a=1) {} }': { + type: 'ExpressionStatement', + expression: { + type: 'AssignmentExpression', + operator: '=', + left: { + type: 'Identifier', + name: 'x', + range: [0, 1], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 1 } + } + }, + right: { + type: 'ObjectExpression', + properties: [{ + type: 'Property', + key: { + type: 'Identifier', + name: 'f', + range: [6, 7], + loc: { + start: { line: 1, column: 6 }, + end: { line: 1, column: 7 } + } + }, + value: { + type: 'FunctionExpression', + id: null, + params: [{ + type: 'Identifier', + name: 'a', + range: [18, 19], + loc: { + start: { line: 1, column: 18 }, + end: { line: 1, column: 19 } + } + }], + defaults: [{ + type: 'Literal', + value: 1, + raw: '1', + range: [20, 21], + loc: { + start: { line: 1, column: 20 }, + end: { line: 1, column: 21 } + } + }], + body: { + type: 'BlockStatement', + body: [], + range: [23, 25], + loc: { + start: { line: 1, column: 23 }, + end: { line: 1, column: 25 } + } + }, + rest: null, + generator: false, + expression: false, + range: [9, 25], + loc: { + start: { line: 1, column: 9 }, + end: { line: 1, column: 25 } + } + }, + kind: 'init', + method: false, + shorthand: false, + range: [6, 25], + loc: { + start: { line: 1, column: 6 }, + end: { line: 1, column: 25 } + } + }], + range: [4, 27], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 27 } + } + }, + range: [0, 27], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 27 } + } + }, + range: [0, 27], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 27 } + } + } + + }, + + 'Automatic semicolon insertion': { + + '{ x\n++y }': { + type: 'BlockStatement', + body: [{ + type: 'ExpressionStatement', + expression: { + type: 'Identifier', + name: 'x', + range: [2, 3], + loc: { + start: { line: 1, column: 2 }, + end: { line: 1, column: 3 } + } + }, + range: [2, 3], + loc: { + start: { line: 1, column: 2 }, + end: { line: 1, column: 3 } + } + }, { + type: 'ExpressionStatement', + expression: { + type: 'UpdateExpression', + operator: '++', + argument: { + type: 'Identifier', + name: 'y', + range: [6, 7], + loc: { + start: { line: 2, column: 2 }, + end: { line: 2, column: 3 } + } + }, + prefix: true, + range: [4, 7], + loc: { + start: { line: 2, column: 0 }, + end: { line: 2, column: 3 } + } + }, + range: [4, 8], + loc: { + start: { line: 2, column: 0 }, + end: { line: 2, column: 4 } + } + }], + range: [0, 9], + loc: { + start: { line: 1, column: 0 }, + end: { line: 2, column: 5 } + } + }, + + '{ x\n--y }': { + type: 'BlockStatement', + body: [{ + type: 'ExpressionStatement', + expression: { + type: 'Identifier', + name: 'x', + range: [2, 3], + loc: { + start: { line: 1, column: 2 }, + end: { line: 1, column: 3 } + } + }, + range: [2, 3], + loc: { + start: { line: 1, column: 2 }, + end: { line: 1, column: 3 } + } + }, { + type: 'ExpressionStatement', + expression: { + type: 'UpdateExpression', + operator: '--', + argument: { + type: 'Identifier', + name: 'y', + range: [6, 7], + loc: { + start: { line: 2, column: 2 }, + end: { line: 2, column: 3 } + } + }, + prefix: true, + range: [4, 7], + loc: { + start: { line: 2, column: 0 }, + end: { line: 2, column: 3 } + } + }, + range: [4, 8], + loc: { + start: { line: 2, column: 0 }, + end: { line: 2, column: 4 } + } + }], + range: [0, 9], + loc: { + start: { line: 1, column: 0 }, + end: { line: 2, column: 5 } + } + }, + + 'var x /* comment */;': { + type: 'VariableDeclaration', + declarations: [{ + type: 'VariableDeclarator', + id: { + type: 'Identifier', + name: 'x', + range: [4, 5], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 5 } + } + }, + init: null, + range: [4, 5], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 5 } + } + }], + kind: 'var', + range: [0, 20], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 20 } + } + }, + + '{ var x = 14, y = 3\nz; }': { + type: 'BlockStatement', + body: [{ + type: 'VariableDeclaration', + declarations: [{ + type: 'VariableDeclarator', + id: { + type: 'Identifier', + name: 'x', + range: [6, 7], + loc: { + start: { line: 1, column: 6 }, + end: { line: 1, column: 7 } + } + }, + init: { + type: 'Literal', + value: 14, + raw: '14', + range: [10, 12], + loc: { + start: { line: 1, column: 10 }, + end: { line: 1, column: 12 } + } + }, + range: [6, 12], + loc: { + start: { line: 1, column: 6 }, + end: { line: 1, column: 12 } + } + }, { + type: 'VariableDeclarator', + id: { + type: 'Identifier', + name: 'y', + range: [14, 15], + loc: { + start: { line: 1, column: 14 }, + end: { line: 1, column: 15 } + } + }, + init: { + type: 'Literal', + value: 3, + raw: '3', + range: [18, 19], + loc: { + start: { line: 1, column: 18 }, + end: { line: 1, column: 19 } + } + }, + range: [14, 19], + loc: { + start: { line: 1, column: 14 }, + end: { line: 1, column: 19 } + } + }], + kind: 'var', + range: [2, 19], + loc: { + start: { line: 1, column: 2 }, + end: { line: 1, column: 19 } + } + }, { + type: 'ExpressionStatement', + expression: { + type: 'Identifier', + name: 'z', + range: [20, 21], + loc: { + start: { line: 2, column: 0 }, + end: { line: 2, column: 1 } + } + }, + range: [20, 22], + loc: { + start: { line: 2, column: 0 }, + end: { line: 2, column: 2 } + } + }], + range: [0, 24], + loc: { + start: { line: 1, column: 0 }, + end: { line: 2, column: 4 } + } + }, + + 'while (true) { continue\nthere; }': { + type: 'WhileStatement', + test: { + type: 'Literal', + value: true, + raw: 'true', + range: [7, 11], + loc: { + start: { line: 1, column: 7 }, + end: { line: 1, column: 11 } + } + }, + body: { + type: 'BlockStatement', + body: [{ + type: 'ContinueStatement', + label: null, + range: [15, 23], + loc: { + start: { line: 1, column: 15 }, + end: { line: 1, column: 23 } + } + }, { + type: 'ExpressionStatement', + expression: { + type: 'Identifier', + name: 'there', + range: [24, 29], + loc: { + start: { line: 2, column: 0 }, + end: { line: 2, column: 5 } + } + }, + range: [24, 30], + loc: { + start: { line: 2, column: 0 }, + end: { line: 2, column: 6 } + } + }], + range: [13, 32], + loc: { + start: { line: 1, column: 13 }, + end: { line: 2, column: 8 } + } + }, + range: [0, 32], + loc: { + start: { line: 1, column: 0 }, + end: { line: 2, column: 8 } + } + }, + + 'while (true) { continue // Comment\nthere; }': { + type: 'WhileStatement', + test: { + type: 'Literal', + value: true, + raw: 'true', + range: [7, 11], + loc: { + start: { line: 1, column: 7 }, + end: { line: 1, column: 11 } + } + }, + body: { + type: 'BlockStatement', + body: [{ + type: 'ContinueStatement', + label: null, + range: [15, 23], + loc: { + start: { line: 1, column: 15 }, + end: { line: 1, column: 23 } + } + }, { + type: 'ExpressionStatement', + expression: { + type: 'Identifier', + name: 'there', + range: [35, 40], + loc: { + start: { line: 2, column: 0 }, + end: { line: 2, column: 5 } + } + }, + range: [35, 41], + loc: { + start: { line: 2, column: 0 }, + end: { line: 2, column: 6 } + } + }], + range: [13, 43], + loc: { + start: { line: 1, column: 13 }, + end: { line: 2, column: 8 } + } + }, + range: [0, 43], + loc: { + start: { line: 1, column: 0 }, + end: { line: 2, column: 8 } + } + }, + + 'while (true) { continue /* Multiline\nComment */there; }': { + type: 'WhileStatement', + test: { + type: 'Literal', + value: true, + raw: 'true', + range: [7, 11], + loc: { + start: { line: 1, column: 7 }, + end: { line: 1, column: 11 } + } + }, + body: { + type: 'BlockStatement', + body: [{ + type: 'ContinueStatement', + label: null, + range: [15, 23], + loc: { + start: { line: 1, column: 15 }, + end: { line: 1, column: 23 } + } + }, { + type: 'ExpressionStatement', + expression: { + type: 'Identifier', + name: 'there', + range: [47, 52], + loc: { + start: { line: 2, column: 10 }, + end: { line: 2, column: 15 } + } + }, + range: [47, 53], + loc: { + start: { line: 2, column: 10 }, + end: { line: 2, column: 16 } + } + }], + range: [13, 55], + loc: { + start: { line: 1, column: 13 }, + end: { line: 2, column: 18 } + } + }, + range: [0, 55], + loc: { + start: { line: 1, column: 0 }, + end: { line: 2, column: 18 } + } + }, + + 'while (true) { break\nthere; }': { + type: 'WhileStatement', + test: { + type: 'Literal', + value: true, + raw: 'true', + range: [7, 11], + loc: { + start: { line: 1, column: 7 }, + end: { line: 1, column: 11 } + } + }, + body: { + type: 'BlockStatement', + body: [{ + type: 'BreakStatement', + label: null, + range: [15, 20], + loc: { + start: { line: 1, column: 15 }, + end: { line: 1, column: 20 } + } + }, { + type: 'ExpressionStatement', + expression: { + type: 'Identifier', + name: 'there', + range: [21, 26], + loc: { + start: { line: 2, column: 0 }, + end: { line: 2, column: 5 } + } + }, + range: [21, 27], + loc: { + start: { line: 2, column: 0 }, + end: { line: 2, column: 6 } + } + }], + range: [13, 29], + loc: { + start: { line: 1, column: 13 }, + end: { line: 2, column: 8 } + } + }, + range: [0, 29], + loc: { + start: { line: 1, column: 0 }, + end: { line: 2, column: 8 } + } + }, + + 'while (true) { break // Comment\nthere; }': { + type: 'WhileStatement', + test: { + type: 'Literal', + value: true, + raw: 'true', + range: [7, 11], + loc: { + start: { line: 1, column: 7 }, + end: { line: 1, column: 11 } + } + }, + body: { + type: 'BlockStatement', + body: [{ + type: 'BreakStatement', + label: null, + range: [15, 20], + loc: { + start: { line: 1, column: 15 }, + end: { line: 1, column: 20 } + } + }, { + type: 'ExpressionStatement', + expression: { + type: 'Identifier', + name: 'there', + range: [32, 37], + loc: { + start: { line: 2, column: 0 }, + end: { line: 2, column: 5 } + } + }, + range: [32, 38], + loc: { + start: { line: 2, column: 0 }, + end: { line: 2, column: 6 } + } + }], + range: [13, 40], + loc: { + start: { line: 1, column: 13 }, + end: { line: 2, column: 8 } + } + }, + range: [0, 40], + loc: { + start: { line: 1, column: 0 }, + end: { line: 2, column: 8 } + } + }, + + 'while (true) { break /* Multiline\nComment */there; }': { + type: 'WhileStatement', + test: { + type: 'Literal', + value: true, + raw: 'true', + range: [7, 11], + loc: { + start: { line: 1, column: 7 }, + end: { line: 1, column: 11 } + } + }, + body: { + type: 'BlockStatement', + body: [{ + type: 'BreakStatement', + label: null, + range: [15, 20], + loc: { + start: { line: 1, column: 15 }, + end: { line: 1, column: 20 } + } + }, { + type: 'ExpressionStatement', + expression: { + type: 'Identifier', + name: 'there', + range: [44, 49], + loc: { + start: { line: 2, column: 10 }, + end: { line: 2, column: 15 } + } + }, + range: [44, 50], + loc: { + start: { line: 2, column: 10 }, + end: { line: 2, column: 16 } + } + }], + range: [13, 52], + loc: { + start: { line: 1, column: 13 }, + end: { line: 2, column: 18 } + } + }, + range: [0, 52], + loc: { + start: { line: 1, column: 0 }, + end: { line: 2, column: 18 } + } + }, + + '(function(){ return\nx; })': { + type: 'ExpressionStatement', + expression: { + type: 'FunctionExpression', + id: null, + params: [], + defaults: [], + body: { + type: 'BlockStatement', + body: [ + { + type: 'ReturnStatement', + argument: null, + range: [13, 19], + loc: { + start: { line: 1, column: 13 }, + end: { line: 1, column: 19 } + } + }, + { + type: 'ExpressionStatement', + expression: { + type: 'Identifier', + name: 'x', + range: [20, 21], + loc: { + start: { line: 2, column: 0 }, + end: { line: 2, column: 1 } + } + }, + range: [20, 22], + loc: { + start: { line: 2, column: 0 }, + end: { line: 2, column: 2 } + } + } + ], + range: [11, 24], + loc: { + start: { line: 1, column: 11 }, + end: { line: 2, column: 4 } + } + }, + rest: null, + generator: false, + expression: false, + range: [1, 24], + loc: { + start: { line: 1, column: 1 }, + end: { line: 2, column: 4 } + } + }, + range: [0, 25], + loc: { + start: { line: 1, column: 0 }, + end: { line: 2, column: 5 } + } + }, + + '(function(){ return // Comment\nx; })': { + type: 'ExpressionStatement', + expression: { + type: 'FunctionExpression', + id: null, + params: [], + defaults: [], + body: { + type: 'BlockStatement', + body: [ + { + type: 'ReturnStatement', + argument: null, + range: [13, 19], + loc: { + start: { line: 1, column: 13 }, + end: { line: 1, column: 19 } + } + }, + { + type: 'ExpressionStatement', + expression: { + type: 'Identifier', + name: 'x', + range: [31, 32], + loc: { + start: { line: 2, column: 0 }, + end: { line: 2, column: 1 } + } + }, + range: [31, 33], + loc: { + start: { line: 2, column: 0 }, + end: { line: 2, column: 2 } + } + } + ], + range: [11, 35], + loc: { + start: { line: 1, column: 11 }, + end: { line: 2, column: 4 } + } + }, + rest: null, + generator: false, + expression: false, + range: [1, 35], + loc: { + start: { line: 1, column: 1 }, + end: { line: 2, column: 4 } + } + }, + range: [0, 36], + loc: { + start: { line: 1, column: 0 }, + end: { line: 2, column: 5 } + } + }, + + '(function(){ return/* Multiline\nComment */x; })': { + type: 'ExpressionStatement', + expression: { + type: 'FunctionExpression', + id: null, + params: [], + defaults: [], + body: { + type: 'BlockStatement', + body: [ + { + type: 'ReturnStatement', + argument: null, + range: [13, 19], + loc: { + start: { line: 1, column: 13 }, + end: { line: 1, column: 19 } + } + }, + { + type: 'ExpressionStatement', + expression: { + type: 'Identifier', + name: 'x', + range: [42, 43], + loc: { + start: { line: 2, column: 10 }, + end: { line: 2, column: 11 } + } + }, + range: [42, 44], + loc: { + start: { line: 2, column: 10 }, + end: { line: 2, column: 12 } + } + } + ], + range: [11, 46], + loc: { + start: { line: 1, column: 11 }, + end: { line: 2, column: 14 } + } + }, + rest: null, + generator: false, + expression: false, + range: [1, 46], + loc: { + start: { line: 1, column: 1 }, + end: { line: 2, column: 14 } + } + }, + range: [0, 47], + loc: { + start: { line: 1, column: 0 }, + end: { line: 2, column: 15 } + } + }, + + '{ throw error\nerror; }': { + type: 'BlockStatement', + body: [{ + type: 'ThrowStatement', + argument: { + type: 'Identifier', + name: 'error', + range: [8, 13], + loc: { + start: { line: 1, column: 8 }, + end: { line: 1, column: 13 } + } + }, + range: [2, 13], + loc: { + start: { line: 1, column: 2 }, + end: { line: 1, column: 13 } + } + }, { + type: 'ExpressionStatement', + expression: { + type: 'Identifier', + name: 'error', + range: [14, 19], + loc: { + start: { line: 2, column: 0 }, + end: { line: 2, column: 5 } + } + }, + range: [14, 20], + loc: { + start: { line: 2, column: 0 }, + end: { line: 2, column: 6 } + } + }], + range: [0, 22], + loc: { + start: { line: 1, column: 0 }, + end: { line: 2, column: 8 } + } + }, + + '{ throw error// Comment\nerror; }': { + type: 'BlockStatement', + body: [{ + type: 'ThrowStatement', + argument: { + type: 'Identifier', + name: 'error', + range: [8, 13], + loc: { + start: { line: 1, column: 8 }, + end: { line: 1, column: 13 } + } + }, + range: [2, 13], + loc: { + start: { line: 1, column: 2 }, + end: { line: 1, column: 13 } + } + }, { + type: 'ExpressionStatement', + expression: { + type: 'Identifier', + name: 'error', + range: [24, 29], + loc: { + start: { line: 2, column: 0 }, + end: { line: 2, column: 5 } + } + }, + range: [24, 30], + loc: { + start: { line: 2, column: 0 }, + end: { line: 2, column: 6 } + } + }], + range: [0, 32], + loc: { + start: { line: 1, column: 0 }, + end: { line: 2, column: 8 } + } + }, + + '{ throw error/* Multiline\nComment */error; }': { + type: 'BlockStatement', + body: [{ + type: 'ThrowStatement', + argument: { + type: 'Identifier', + name: 'error', + range: [8, 13], + loc: { + start: { line: 1, column: 8 }, + end: { line: 1, column: 13 } + } + }, + range: [2, 13], + loc: { + start: { line: 1, column: 2 }, + end: { line: 1, column: 13 } + } + }, { + type: 'ExpressionStatement', + expression: { + type: 'Identifier', + name: 'error', + range: [36, 41], + loc: { + start: { line: 2, column: 10 }, + end: { line: 2, column: 15 } + } + }, + range: [36, 42], + loc: { + start: { line: 2, column: 10 }, + end: { line: 2, column: 16 } + } + }], + range: [0, 44], + loc: { + start: { line: 1, column: 0 }, + end: { line: 2, column: 18 } + } + } + + }, + + 'Directive Prolog': { + + '(function () { \'use\\x20strict\'; with (i); }())': { + type: 'ExpressionStatement', + expression: { + type: 'CallExpression', + callee: { + type: 'FunctionExpression', + id: null, + params: [], + defaults: [], + body: { + type: 'BlockStatement', + body: [{ + type: 'ExpressionStatement', + expression: { + type: 'Literal', + value: 'use strict', + raw: '\'use\\x20strict\'', + range: [15, 30], + loc: { + start: { line: 1, column: 15 }, + end: { line: 1, column: 30 } + } + }, + range: [15, 31], + loc: { + start: { line: 1, column: 15 }, + end: { line: 1, column: 31 } + } + }, { + type: 'WithStatement', + object: { + type: 'Identifier', + name: 'i', + range: [38, 39], + loc: { + start: { line: 1, column: 38 }, + end: { line: 1, column: 39 } + } + }, + body: { + type: 'EmptyStatement', + range: [40, 41], + loc: { + start: { line: 1, column: 40 }, + end: { line: 1, column: 41 } + } + }, + range: [32, 41], + loc: { + start: { line: 1, column: 32 }, + end: { line: 1, column: 41 } + } + }], + range: [13, 43], + loc: { + start: { line: 1, column: 13 }, + end: { line: 1, column: 43 } + } + }, + rest: null, + generator: false, + expression: false, + range: [1, 43], + loc: { + start: { line: 1, column: 1 }, + end: { line: 1, column: 43 } + } + }, + 'arguments': [], + range: [1, 45], + loc: { + start: { line: 1, column: 1 }, + end: { line: 1, column: 45 } + } + }, + range: [0, 46], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 46 } + } + }, + + '(function () { \'use\\nstrict\'; with (i); }())': { + type: 'ExpressionStatement', + expression: { + type: 'CallExpression', + callee: { + type: 'FunctionExpression', + id: null, + params: [], + defaults: [], + body: { + type: 'BlockStatement', + body: [{ + type: 'ExpressionStatement', + expression: { + type: 'Literal', + value: 'use\nstrict', + raw: '\'use\\nstrict\'', + range: [15, 28], + loc: { + start: { line: 1, column: 15 }, + end: { line: 1, column: 28 } + } + }, + range: [15, 29], + loc: { + start: { line: 1, column: 15 }, + end: { line: 1, column: 29 } + } + }, { + type: 'WithStatement', + object: { + type: 'Identifier', + name: 'i', + range: [36, 37], + loc: { + start: { line: 1, column: 36 }, + end: { line: 1, column: 37 } + } + }, + body: { + type: 'EmptyStatement', + range: [38, 39], + loc: { + start: { line: 1, column: 38 }, + end: { line: 1, column: 39 } + } + }, + range: [30, 39], + loc: { + start: { line: 1, column: 30 }, + end: { line: 1, column: 39 } + } + }], + range: [13, 41], + loc: { + start: { line: 1, column: 13 }, + end: { line: 1, column: 41 } + } + }, + rest: null, + generator: false, + expression: false, + range: [1, 41], + loc: { + start: { line: 1, column: 1 }, + end: { line: 1, column: 41 } + } + }, + 'arguments': [], + range: [1, 43], + loc: { + start: { line: 1, column: 1 }, + end: { line: 1, column: 43 } + } + }, + range: [0, 44], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 44 } + } + } + + }, + + 'Whitespace': { + + 'new\x20\x09\x0B\x0C\xA0\u1680\u180E\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\uFEFFa': { + type: 'ExpressionStatement', + expression: { + type: 'NewExpression', + callee: { + type: 'Identifier', + name: 'a', + range: [25, 26], + loc: { + start: {line: 1, column: 25}, + end: {line: 1, column: 26} + } + }, + arguments: [], + range: [0, 26], + loc: { + start: {line: 1, column: 0}, + end: {line: 1, column: 26} + } + }, + range: [0, 26], + loc: { + start: {line: 1, column: 0}, + end: {line: 1, column: 26} + } + }, + + '{0\x0A1\x0D2\u20283\u20294}': { + type: 'BlockStatement', + body: [ + { + type: 'ExpressionStatement', + expression: { + type: 'Literal', + value: 0, + raw: '0', + range: [1, 2], + loc: { + start: {line: 1, column: 1}, + end: {line: 1, column: 2} + } + }, + range: [1, 2], + loc: { + start: {line: 1, column: 1}, + end: {line: 1, column: 2} + } + }, + { + type: 'ExpressionStatement', + expression: { + type: 'Literal', + value: 1, + raw: '1', + range: [3, 4], + loc: { + start: {line: 2, column: 0}, + end: {line: 2, column: 1} + } + }, + range: [3, 4], + loc: { + start: {line: 2, column: 0}, + end: {line: 2, column: 1} + } + }, + { + type: 'ExpressionStatement', + expression: { + type: 'Literal', + value: 2, + raw: '2', + range: [5, 6], + loc: { + start: {line: 3, column: 0}, + end: {line: 3, column: 1} + } + }, + range: [5, 6], + loc: { + start: {line: 3, column: 0}, + end: {line: 3, column: 1} + } + }, + { + type: 'ExpressionStatement', + expression: { + type: 'Literal', + value: 3, + raw: '3', + range: [7, 8], + loc: { + start: {line: 4, column: 0}, + end: {line: 4, column: 1} + } + }, + range: [7, 8], + loc: { + start: {line: 4, column: 0}, + end: {line: 4, column: 1} + } + }, + { + type: 'ExpressionStatement', + expression: { + type: 'Literal', + value: 4, + raw: '4', + range: [9, 10], + loc: { + start: {line: 5, column: 0}, + end: {line: 5, column: 1} + } + }, + range: [9, 10], + loc: { + start: {line: 5, column: 0}, + end: {line: 5, column: 1} + } + } + ], + range: [0, 11], + loc: { + start: {line: 1, column: 0}, + end: {line: 5, column: 2} + } + } + + }, + + 'Source elements': { + + '': { + type: 'Program', + body: [], + range: [0, 0], + loc: { + start: { line: 0, column: 0 }, + end: { line: 0, column: 0 } + }, + tokens: [] + } + }, + + 'Source option': { + 'x + y - z': { + type: 'ExpressionStatement', + expression: { + type: 'BinaryExpression', + operator: '-', + left: { + type: 'BinaryExpression', + operator: '+', + left: { + type: 'Identifier', + name: 'x', + range: [0, 1], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 1 }, + source: '42.js' + } + }, + right: { + type: 'Identifier', + name: 'y', + range: [4, 5], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 5 }, + source: '42.js' + } + }, + range: [0, 5], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 5 }, + source: '42.js' + } + }, + right: { + type: 'Identifier', + name: 'z', + range: [8, 9], + loc: { + start: { line: 1, column: 8 }, + end: { line: 1, column: 9 }, + source: '42.js' + } + }, + range: [0, 9], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 9 }, + source: '42.js' + } + }, + range: [0, 9], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 9 }, + source: '42.js' + } + }, + + 'a + (b < (c * d)) + e': { + type: 'ExpressionStatement', + expression: { + type: 'BinaryExpression', + operator: '+', + left: { + type: 'BinaryExpression', + operator: '+', + left: { + type: 'Identifier', + name: 'a', + range: [0, 1], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 1 }, + source: '42.js' + } + }, + right: { + type: 'BinaryExpression', + operator: '<', + left: { + type: 'Identifier', + name: 'b', + range: [5, 6], + loc: { + start: { line: 1, column: 5 }, + end: { line: 1, column: 6 }, + source: '42.js' + } + }, + right: { + type: 'BinaryExpression', + operator: '*', + left: { + type: 'Identifier', + name: 'c', + range: [10, 11], + loc: { + start: { line: 1, column: 10 }, + end: { line: 1, column: 11 }, + source: '42.js' + } + }, + right: { + type: 'Identifier', + name: 'd', + range: [14, 15], + loc: { + start: { line: 1, column: 14 }, + end: { line: 1, column: 15 }, + source: '42.js' + } + }, + range: [10, 15], + loc: { + start: { line: 1, column: 10 }, + end: { line: 1, column: 15 }, + source: '42.js' + } + }, + range: [5, 16], + loc: { + start: { line: 1, column: 5 }, + end: { line: 1, column: 16 }, + source: '42.js' + } + }, + range: [0, 17], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 17 }, + source: '42.js' + } + }, + right: { + type: 'Identifier', + name: 'e', + range: [20, 21], + loc: { + start: { line: 1, column: 20 }, + end: { line: 1, column: 21 }, + source: '42.js' + } + }, + range: [0, 21], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 21 }, + source: '42.js' + } + }, + range: [0, 21], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 21 }, + source: '42.js' + } + } + + }, + + + 'Invalid syntax': { + + '{': { + index: 1, + lineNumber: 1, + column: 2, + message: 'Error: Line 1: Unexpected end of input' + }, + + '}': { + index: 0, + lineNumber: 1, + column: 1, + message: 'Error: Line 1: Unexpected token }' + }, + + '3ea': { + index: 2, + lineNumber: 1, + column: 3, + message: 'Error: Line 1: Unexpected token ILLEGAL' + }, + + '3in []': { + index: 1, + lineNumber: 1, + column: 2, + message: 'Error: Line 1: Unexpected token ILLEGAL' + }, + + '3e': { + index: 2, + lineNumber: 1, + column: 3, + message: 'Error: Line 1: Unexpected token ILLEGAL' + }, + + '3e+': { + index: 3, + lineNumber: 1, + column: 4, + message: 'Error: Line 1: Unexpected token ILLEGAL' + }, + + '3e-': { + index: 3, + lineNumber: 1, + column: 4, + message: 'Error: Line 1: Unexpected token ILLEGAL' + }, + + '3x': { + index: 1, + lineNumber: 1, + column: 2, + message: 'Error: Line 1: Unexpected token ILLEGAL' + }, + + '3x0': { + index: 1, + lineNumber: 1, + column: 2, + message: 'Error: Line 1: Unexpected token ILLEGAL' + }, + + '0x': { + index: 2, + lineNumber: 1, + column: 3, + message: 'Error: Line 1: Unexpected token ILLEGAL' + }, + + '01a': { + index: 2, + lineNumber: 1, + column: 3, + message: 'Error: Line 1: Unexpected token ILLEGAL' + }, + + '0o1a': { + index: 3, + lineNumber: 1, + column: 4, + message: 'Error: Line 1: Unexpected token ILLEGAL' + }, + + '0o': { + index: 2, + lineNumber: 1, + column: 3, + message: 'Error: Line 1: Unexpected token ILLEGAL' + }, + + '0O': { + index: 2, + lineNumber: 1, + column: 3, + message: 'Error: Line 1: Unexpected token ILLEGAL' + }, + + '0o9': { + index: 2, + lineNumber: 1, + column: 3, + message: 'Error: Line 1: Unexpected token ILLEGAL' + }, + + '0o18': { + index: 3, + lineNumber: 1, + column: 4, + message: 'Error: Line 1: Unexpected token ILLEGAL' + }, + + '0O1a': { + index: 3, + lineNumber: 1, + column: 4, + message: 'Error: Line 1: Unexpected token ILLEGAL' + }, + + '0b': { + index: 2, + lineNumber: 1, + column: 3, + message: 'Error: Line 1: Unexpected token ILLEGAL' + }, + + '0b1a': { + index: 3, + lineNumber: 1, + column: 4, + message: 'Error: Line 1: Unexpected token ILLEGAL' + }, + + '0b9': { + index: 2, + lineNumber: 1, + column: 3, + message: 'Error: Line 1: Unexpected token ILLEGAL' + }, + + '0b18': { + index: 3, + lineNumber: 1, + column: 4, + message: 'Error: Line 1: Unexpected token ILLEGAL' + }, + + '0b12': { + index: 3, + lineNumber: 1, + column: 4, + message: 'Error: Line 1: Unexpected token ILLEGAL' + }, + + '0B': { + index: 2, + lineNumber: 1, + column: 3, + message: 'Error: Line 1: Unexpected token ILLEGAL' + }, + + '0B1a': { + index: 3, + lineNumber: 1, + column: 4, + message: 'Error: Line 1: Unexpected token ILLEGAL' + }, + + '0B9': { + index: 2, + lineNumber: 1, + column: 3, + message: 'Error: Line 1: Unexpected token ILLEGAL' + }, + + '0B18': { + index: 3, + lineNumber: 1, + column: 4, + message: 'Error: Line 1: Unexpected token ILLEGAL' + }, + + '0B12': { + index: 3, + lineNumber: 1, + column: 4, + message: 'Error: Line 1: Unexpected token ILLEGAL' + }, + + '0O9': { + index: 2, + lineNumber: 1, + column: 3, + message: 'Error: Line 1: Unexpected token ILLEGAL' + }, + + '0O18': { + index: 3, + lineNumber: 1, + column: 4, + message: 'Error: Line 1: Unexpected token ILLEGAL' + }, + + '3in[]': { + index: 1, + lineNumber: 1, + column: 2, + message: 'Error: Line 1: Unexpected token ILLEGAL' + }, + + '0x3in[]': { + index: 3, + lineNumber: 1, + column: 4, + message: 'Error: Line 1: Unexpected token ILLEGAL' + }, + + '"Hello\nWorld"': { + index: 7, + lineNumber: 1, + column: 8, + message: 'Error: Line 1: Unexpected token ILLEGAL' + }, + + 'x\\': { + index: 2, + lineNumber: 1, + column: 3, + message: 'Error: Line 1: Unexpected token ILLEGAL' + }, + + 'x\\u005c': { + index: 7, + lineNumber: 1, + column: 8, + message: 'Error: Line 1: Unexpected token ILLEGAL' + }, + + 'x\\u002a': { + index: 7, + lineNumber: 1, + column: 8, + message: 'Error: Line 1: Unexpected token ILLEGAL' + }, + + 'var x = /(s/g': { + index: 13, + lineNumber: 1, + column: 14, + message: 'Error: Line 1: Invalid regular expression' + }, + + 'a\\u': { + index: 3, + lineNumber: 1, + column: 4, + message: 'Error: Line 1: Unexpected token ILLEGAL' + }, + + '\\ua': { + index: 3, + lineNumber: 1, + column: 4, + message: 'Error: Line 1: Unexpected token ILLEGAL' + }, + + '/': { + index: 1, + lineNumber: 1, + column: 2, + message: 'Error: Line 1: Invalid regular expression: missing /' + }, + + '/test': { + index: 5, + lineNumber: 1, + column: 6, + message: 'Error: Line 1: Invalid regular expression: missing /' + }, + + '/test\n/': { + index: 6, + lineNumber: 1, + column: 7, + message: 'Error: Line 1: Invalid regular expression: missing /' + }, + + 'var x = /[a-z]/\\ux': { + index: 17, + lineNumber: 1, + column: 18, + message: 'Error: Line 1: Unexpected token ILLEGAL' + }, + + 'var x = /[a-z\n]/\\ux': { + index: 14, + lineNumber: 1, + column: 15, + message: 'Error: Line 1: Invalid regular expression: missing /' + }, + + 'var x = /[a-z]/\\\\ux': { + index: 16, + lineNumber: 1, + column: 17, + message: 'Error: Line 1: Unexpected token ILLEGAL' + }, + + 'var x = /[P QR]/\\\\u0067': { + index: 17, + lineNumber: 1, + column: 18, + message: 'Error: Line 1: Unexpected token ILLEGAL' + }, + + '3 = 4': { + index: 1, + lineNumber: 1, + column: 2, + message: 'Error: Line 1: Invalid left-hand side in assignment' + }, + + 'func() = 4': { + index: 6, + lineNumber: 1, column: 7, message: 'Error: Line 1: Invalid left-hand side in assignment' }, @@ -15765,6 +22569,34 @@ var testFixture = { message: 'Error: Line 1: Invalid left-hand side in assignment' }, + '"\\u{110000}"': { + index: 11, + lineNumber: 1, + column: 12, + message: 'Error: Line 1: Unexpected token ILLEGAL' + }, + + '"\\u{}"': { + index: 4, + lineNumber: 1, + column: 5, + message: 'Error: Line 1: Unexpected token ILLEGAL' + }, + + '"\\u{FFFF"': { + index: 9, + lineNumber: 1, + column: 10, + message: 'Error: Line 1: Unexpected token ILLEGAL' + }, + + '"\\u{FFZ}"': { + index: 7, + lineNumber: 1, + column: 8, + message: 'Error: Line 1: Unexpected token ILLEGAL' + }, + '1++': { index: 1, lineNumber: 1, @@ -15856,6 +22688,13 @@ var testFixture = { message: 'Error: Line 1: Unexpected token if' }, + 'i #= 42': { + index: 2, + lineNumber: 1, + column: 3, + message: 'Error: Line 1: Unexpected token ILLEGAL' + }, + 'i + 2 = 42': { index: 5, lineNumber: 1, @@ -15989,6 +22828,143 @@ var testFixture = { message: 'Error: Line 1: Object literal may not have multiple get/set accessors with the same name' }, + '((a)) => 42': { + index: 6, + lineNumber: 1, + column: 7, + message: 'Error: Line 1: Unexpected token =>' + }, + + '(a, (b)) => 42': { + index: 9, + lineNumber: 1, + column: 10, + message: 'Error: Line 1: Unexpected token =>' + }, + + '"use strict"; (eval = 10) => 42': { + index: 15, + lineNumber: 1, + column: 16, + message: 'Error: Line 1: Assignment to eval or arguments is not allowed in strict mode' + }, + + // strict mode, using eval when IsSimpleParameterList is true + '"use strict"; eval => 42': { + index: 24, + lineNumber: 1, + column: 25, + message: 'Error: Line 1: Parameter name eval or arguments is not allowed in strict mode' + }, + + // strict mode, using arguments when IsSimpleParameterList is true + '"use strict"; arguments => 42': { + index: 29, + lineNumber: 1, + column: 30, + message: 'Error: Line 1: Parameter name eval or arguments is not allowed in strict mode' + }, + + // strict mode, using eval when IsSimpleParameterList is true + '"use strict"; (eval, a) => 42': { + index: 29, + lineNumber: 1, + column: 30, + message: 'Error: Line 1: Parameter name eval or arguments is not allowed in strict mode' + }, + + // strict mode, using arguments when IsSimpleParameterList is true + '"use strict"; (arguments, a) => 42': { + index: 34, + lineNumber: 1, + column: 35, + message: 'Error: Line 1: Parameter name eval or arguments is not allowed in strict mode' + }, + + '(a, a) => 42': { + index: 6, + lineNumber: 1, + column: 7, + message: 'Error: Line 1: Strict mode function may not have duplicate parameter names' + }, + + '"use strict"; (a, a) => 42': { + index: 20, + lineNumber: 1, + column: 21, + message: 'Error: Line 1: Strict mode function may not have duplicate parameter names' + }, + + '"use strict"; (a) => 00': { + index: 21, + lineNumber: 1, + column: 22, + message: 'Error: Line 1: Octal literals are not allowed in strict mode.' + }, + + '() <= 42': { + index: 3, + lineNumber: 1, + column: 4, + message: 'Error: Line 1: Unexpected token <=' + }, + + '() ? 42': { + index: 3, + lineNumber: 1, + column: 4, + message: 'Error: Line 1: Unexpected token ?' + }, + + '() + 42': { + index: 3, + lineNumber: 1, + column: 4, + message: 'Error: Line 1: Unexpected token +' + }, + + '(10) => 00': { + index: 5, + lineNumber: 1, + column: 6, + message: 'Error: Line 1: Unexpected token =>' + }, + + '(10, 20) => 00': { + index: 9, + lineNumber: 1, + column: 10, + message: 'Error: Line 1: Unexpected token =>' + }, + + '"use strict"; (eval) => 42': { + index: 26, + lineNumber: 1, + column: 27, + message: 'Error: Line 1: Parameter name eval or arguments is not allowed in strict mode' + }, + + '(eval) => { "use strict"; 42 }': { + index: 30, + lineNumber: 1, + column: 31, + message: 'Error: Line 1: Parameter name eval or arguments is not allowed in strict mode' + }, + + 'p = { q/ }': { + index: 7, + lineNumber: 1, + column: 8, + message: 'Error: Line 1: Unexpected token /' + }, + + 'p = { "q"/ }': { + index: 9, + lineNumber: 1, + column: 10, + message: 'Error: Line 1: Unexpected token /' + }, + 'function t(if) { }': { index: 11, lineNumber: 1, @@ -16367,7 +23343,7 @@ var testFixture = { column: 5, message: 'Error: Line 1: Invalid regular expression: missing /' }, - + '//\r \n]': { index: 5, lineNumber: 3, @@ -16552,9 +23528,9 @@ var testFixture = { }, '(function () { \'use strict\'; with (i); }())': { - index: 28, + index: 29, lineNumber: 1, - column: 29, + column: 30, message: 'Error: Line 1: Strict mode code may not include a with statement' }, @@ -16845,181 +23821,1605 @@ var testFixture = { message: 'Error: Line 1: Octal literals are not allowed in strict mode.' }, - 'function hello() { "use strict"; var implements; }': { - index: 37, + 'function hello() { "use strict"; var implements; }': { + index: 37, + lineNumber: 1, + column: 38, + message: 'Error: Line 1: Use of future reserved word in strict mode' + }, + + 'function hello() { "use strict"; var interface; }': { + index: 37, + lineNumber: 1, + column: 38, + message: 'Error: Line 1: Use of future reserved word in strict mode' + }, + + 'function hello() { "use strict"; var package; }': { + index: 37, + lineNumber: 1, + column: 38, + message: 'Error: Line 1: Use of future reserved word in strict mode' + }, + + 'function hello() { "use strict"; var private; }': { + index: 37, + lineNumber: 1, + column: 38, + message: 'Error: Line 1: Use of future reserved word in strict mode' + }, + + 'function hello() { "use strict"; var protected; }': { + index: 37, + lineNumber: 1, + column: 38, + message: 'Error: Line 1: Use of future reserved word in strict mode' + }, + + 'function hello() { "use strict"; var public; }': { + index: 37, + lineNumber: 1, + column: 38, + message: 'Error: Line 1: Use of future reserved word in strict mode' + }, + + 'function hello() { "use strict"; var static; }': { + index: 37, + lineNumber: 1, + column: 38, + message: 'Error: Line 1: Use of future reserved word in strict mode' + }, + + 'function hello() { "use strict"; var yield; }': { + index: 37, + lineNumber: 1, + column: 38, + message: 'Error: Line 1: Use of future reserved word in strict mode' + }, + + 'function hello() { "use strict"; var let; }': { + index: 37, + lineNumber: 1, + column: 38, + message: 'Error: Line 1: Use of future reserved word in strict mode' + }, + + 'function hello(static) { "use strict"; }': { + index: 15, + lineNumber: 1, + column: 16, + message: 'Error: Line 1: Use of future reserved word in strict mode' + }, + + 'function static() { "use strict"; }': { + index: 9, + lineNumber: 1, + column: 10, + message: 'Error: Line 1: Use of future reserved word in strict mode' + }, + + 'function eval(a) { "use strict"; }': { + index: 9, + lineNumber: 1, + column: 10, + message: 'Error: Line 1: Function name may not be eval or arguments in strict mode' + }, + + 'function arguments(a) { "use strict"; }': { + index: 9, + lineNumber: 1, + column: 10, + message: 'Error: Line 1: Function name may not be eval or arguments in strict mode' + }, + + 'var yield': { + index: 4, + lineNumber: 1, + column: 5, + message: 'Error: Line 1: Unexpected token yield' + }, + + 'var let': { + index: 4, + lineNumber: 1, + column: 5, + message: 'Error: Line 1: Unexpected token let' + }, + + '"use strict"; function static() { }': { + index: 23, + lineNumber: 1, + column: 24, + message: 'Error: Line 1: Use of future reserved word in strict mode' + }, + + 'function a(t, t) { "use strict"; }': { + index: 14, + lineNumber: 1, + column: 15, + message: 'Error: Line 1: Strict mode function may not have duplicate parameter names' + }, + + 'function a(eval) { "use strict"; }': { + index: 11, + lineNumber: 1, + column: 12, + message: 'Error: Line 1: Parameter name eval or arguments is not allowed in strict mode' + }, + + 'function a(package) { "use strict"; }': { + index: 11, lineNumber: 1, - column: 38, + column: 12, message: 'Error: Line 1: Use of future reserved word in strict mode' }, - 'function hello() { "use strict"; var interface; }': { - index: 37, + 'function a() { "use strict"; function b(t, t) { }; }': { + index: 43, lineNumber: 1, - column: 38, - message: 'Error: Line 1: Use of future reserved word in strict mode' + column: 44, + message: 'Error: Line 1: Strict mode function may not have duplicate parameter names' }, - 'function hello() { "use strict"; var package; }': { - index: 37, + '(function a(t, t) { "use strict"; })': { + index: 15, lineNumber: 1, - column: 38, - message: 'Error: Line 1: Use of future reserved word in strict mode' + column: 16, + message: 'Error: Line 1: Strict mode function may not have duplicate parameter names' }, - 'function hello() { "use strict"; var private; }': { - index: 37, + 'function a() { "use strict"; (function b(t, t) { }); }': { + index: 44, lineNumber: 1, - column: 38, - message: 'Error: Line 1: Use of future reserved word in strict mode' + column: 45, + message: 'Error: Line 1: Strict mode function may not have duplicate parameter names' }, - 'function hello() { "use strict"; var protected; }': { - index: 37, + '(function a(eval) { "use strict"; })': { + index: 12, lineNumber: 1, - column: 38, - message: 'Error: Line 1: Use of future reserved word in strict mode' + column: 13, + message: 'Error: Line 1: Parameter name eval or arguments is not allowed in strict mode' }, - 'function hello() { "use strict"; var public; }': { - index: 37, + '(function a(package) { "use strict"; })': { + index: 12, lineNumber: 1, - column: 38, + column: 13, message: 'Error: Line 1: Use of future reserved word in strict mode' }, - 'function hello() { "use strict"; var static; }': { - index: 37, + '__proto__: __proto__: 42;': { + index: 21, lineNumber: 1, - column: 38, - message: 'Error: Line 1: Use of future reserved word in strict mode' + column: 22, + message: 'Error: Line 1: Label \'__proto__\' has already been declared' }, - 'function hello() { "use strict"; var yield; }': { - index: 37, + '"use strict"; function t(__proto__, __proto__) { }': { + index: 36, lineNumber: 1, - column: 38, - message: 'Error: Line 1: Use of future reserved word in strict mode' + column: 37, + message: 'Error: Line 1: Strict mode function may not have duplicate parameter names' }, - 'function hello() { "use strict"; var let; }': { - index: 37, + '"use strict"; x = { __proto__: 42, __proto__: 43 }': { + index: 48, lineNumber: 1, - column: 38, - message: 'Error: Line 1: Use of future reserved word in strict mode' + column: 49, + message: 'Error: Line 1: Duplicate data property in object literal not allowed in strict mode' }, - 'function hello(static) { "use strict"; }': { - index: 15, + '"use strict"; x = { get __proto__() { }, __proto__: 43 }': { + index: 54, lineNumber: 1, - column: 16, - message: 'Error: Line 1: Use of future reserved word in strict mode' + column: 55, + message: 'Error: Line 1: Object literal may not have data and accessor property with the same name' }, - 'function static() { "use strict"; }': { - index: 9, + 'var': { + index: 3, lineNumber: 1, - column: 10, - message: 'Error: Line 1: Use of future reserved word in strict mode' + column: 4, + message: 'Error: Line 1: Unexpected end of input' }, - 'var yield': { - index: 4, + 'let': { + index: 3, lineNumber: 1, - column: 5, - message: 'Error: Line 1: Unexpected token yield' + column: 4, + message: 'Error: Line 1: Unexpected end of input' }, - 'var let': { - index: 4, + 'const': { + index: 5, lineNumber: 1, - column: 5, - message: 'Error: Line 1: Unexpected token let' + column: 6, + message: 'Error: Line 1: Unexpected end of input' }, - '"use strict"; function static() { }': { - index: 23, + '{ ; ; ': { + index: 8, lineNumber: 1, - column: 24, - message: 'Error: Line 1: Use of future reserved word in strict mode' + column: 9, + message: 'Error: Line 1: Unexpected end of input' }, - 'function a(t, t) { "use strict"; }': { - index: 14, - lineNumber: 1, - column: 15, - message: 'Error: Line 1: Strict mode function may not have duplicate parameter names' - }, + 'function t() { ; ; ': { + index: 21, + lineNumber: 1, + column: 22, + message: 'Error: Line 1: Unexpected end of input' + } + + }, + + 'Tokenize': { + 'tokenize(/42/)': [ + { + "type": "Identifier", + "value": "tokenize", + "range": [ + 0, + 8 + ], + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 8 + } + } + }, + { + "type": "Punctuator", + "value": "(", + "range": [ + 8, + 9 + ], + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 9 + } + } + }, + { + "type": "RegularExpression", + "value": "/42/", + "regex": { + "pattern": "42", + "flags": "" + }, + "range": [ + 9, + 13 + ], + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 13 + } + } + }, + { + "type": "Punctuator", + "value": ")", + "range": [ + 13, + 14 + ], + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 14 + } + } + } + ], + + 'if (false) { /42/ }': [ + { + "type": "Keyword", + "value": "if", + "range": [ + 0, + 2 + ], + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 2 + } + } + }, + { + "type": "Punctuator", + "value": "(", + "range": [ + 3, + 4 + ], + "loc": { + "start": { + "line": 1, + "column": 3 + }, + "end": { + "line": 1, + "column": 4 + } + } + }, + { + "type": "Boolean", + "value": "false", + "range": [ + 4, + 9 + ], + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 9 + } + } + }, + { + "type": "Punctuator", + "value": ")", + "range": [ + 9, + 10 + ], + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 10 + } + } + }, + { + "type": "Punctuator", + "value": "{", + "range": [ + 11, + 12 + ], + "loc": { + "start": { + "line": 1, + "column": 11 + }, + "end": { + "line": 1, + "column": 12 + } + } + }, + { + "type": "RegularExpression", + "value": "/42/", + "regex": { + "pattern": "42", + "flags": "" + }, + "range": [ + 13, + 17 + ], + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 17 + } + } + }, + { + "type": "Punctuator", + "value": "}", + "range": [ + 18, + 19 + ], + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 19 + } + } + } + ], + + 'with (false) /42/': [ + { + "type": "Keyword", + "value": "with", + "range": [ + 0, + 4 + ], + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 4 + } + } + }, + { + "type": "Punctuator", + "value": "(", + "range": [ + 5, + 6 + ], + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 6 + } + } + }, + { + "type": "Boolean", + "value": "false", + "range": [ + 6, + 11 + ], + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 11 + } + } + }, + { + "type": "Punctuator", + "value": ")", + "range": [ + 11, + 12 + ], + "loc": { + "start": { + "line": 1, + "column": 11 + }, + "end": { + "line": 1, + "column": 12 + } + } + }, + { + "type": "RegularExpression", + "value": "/42/", + "regex": { + "pattern": "42", + "flags": "" + }, + "range": [ + 13, + 17 + ], + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 17 + } + } + } + ], + + '(false) /42/': [ + { + "type": "Punctuator", + "value": "(", + "range": [ + 0, + 1 + ], + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + } + } + }, + { + "type": "Boolean", + "value": "false", + "range": [ + 1, + 6 + ], + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 6 + } + } + }, + { + "type": "Punctuator", + "value": ")", + "range": [ + 6, + 7 + ], + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 7 + } + } + }, + { + "type": "Punctuator", + "value": "/", + "range": [ + 8, + 9 + ], + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 9 + } + } + }, + { + "type": "Numeric", + "value": "42", + "range": [ + 9, + 11 + ], + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 11 + } + } + }, + { + "type": "Punctuator", + "value": "/", + "range": [ + 11, + 12 + ], + "loc": { + "start": { + "line": 1, + "column": 11 + }, + "end": { + "line": 1, + "column": 12 + } + } + } + ], + + 'function f(){} /42/': [ + { + "type": "Keyword", + "value": "function", + "range": [ + 0, + 8 + ], + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 8 + } + } + }, + { + "type": "Identifier", + "value": "f", + "range": [ + 9, + 10 + ], + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 10 + } + } + }, + { + "type": "Punctuator", + "value": "(", + "range": [ + 10, + 11 + ], + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 11 + } + } + }, + { + "type": "Punctuator", + "value": ")", + "range": [ + 11, + 12 + ], + "loc": { + "start": { + "line": 1, + "column": 11 + }, + "end": { + "line": 1, + "column": 12 + } + } + }, + { + "type": "Punctuator", + "value": "{", + "range": [ + 12, + 13 + ], + "loc": { + "start": { + "line": 1, + "column": 12 + }, + "end": { + "line": 1, + "column": 13 + } + } + }, + { + "type": "Punctuator", + "value": "}", + "range": [ + 13, + 14 + ], + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 14 + } + } + }, + { + "type": "RegularExpression", + "value": "/42/", + "regex": { + "pattern": "42", + "flags": "" + }, + "range": [ + 15, + 19 + ], + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 19 + } + } + } + ], + + 'function(){} /42': [ + { + "type": "Keyword", + "value": "function", + "range": [ + 0, + 8 + ], + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 8 + } + } + }, + { + "type": "Punctuator", + "value": "(", + "range": [ + 8, + 9 + ], + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 9 + } + } + }, + { + "type": "Punctuator", + "value": ")", + "range": [ + 9, + 10 + ], + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 10 + } + } + }, + { + "type": "Punctuator", + "value": "{", + "range": [ + 10, + 11 + ], + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 11 + } + } + }, + { + "type": "Punctuator", + "value": "}", + "range": [ + 11, + 12 + ], + "loc": { + "start": { + "line": 1, + "column": 11 + }, + "end": { + "line": 1, + "column": 12 + } + } + }, + { + "type": "Punctuator", + "value": "/", + "range": [ + 13, + 14 + ], + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 14 + } + } + }, + { + "type": "Numeric", + "value": "42", + "range": [ + 14, + 16 + ], + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 16 + } + } + } + ], - 'function a(eval) { "use strict"; }': { - index: 11, - lineNumber: 1, - column: 12, - message: 'Error: Line 1: Parameter name eval or arguments is not allowed in strict mode' - }, + '{} /42': [ + { + "type": "Punctuator", + "value": "{", + "range": [ + 0, + 1 + ], + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + } + } + }, + { + "type": "Punctuator", + "value": "}", + "range": [ + 1, + 2 + ], + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 2 + } + } + }, + { + "type": "Punctuator", + "value": "/", + "range": [ + 3, + 4 + ], + "loc": { + "start": { + "line": 1, + "column": 3 + }, + "end": { + "line": 1, + "column": 4 + } + } + }, + { + "type": "Numeric", + "value": "42", + "range": [ + 4, + 6 + ], + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 6 + } + } + } + ], - 'function a(package) { "use strict"; }': { - index: 11, - lineNumber: 1, - column: 12, - message: 'Error: Line 1: Use of future reserved word in strict mode' - }, + '[function(){} /42]': [ + { + "type": "Punctuator", + "value": "[", + "range": [ + 0, + 1 + ], + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + } + } + }, + { + "type": "Keyword", + "value": "function", + "range": [ + 1, + 9 + ], + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 9 + } + } + }, + { + "type": "Punctuator", + "value": "(", + "range": [ + 9, + 10 + ], + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 10 + } + } + }, + { + "type": "Punctuator", + "value": ")", + "range": [ + 10, + 11 + ], + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 11 + } + } + }, + { + "type": "Punctuator", + "value": "{", + "range": [ + 11, + 12 + ], + "loc": { + "start": { + "line": 1, + "column": 11 + }, + "end": { + "line": 1, + "column": 12 + } + } + }, + { + "type": "Punctuator", + "value": "}", + "range": [ + 12, + 13 + ], + "loc": { + "start": { + "line": 1, + "column": 12 + }, + "end": { + "line": 1, + "column": 13 + } + } + }, + { + "type": "Punctuator", + "value": "/", + "range": [ + 14, + 15 + ], + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 15 + } + } + }, + { + "type": "Numeric", + "value": "42", + "range": [ + 15, + 17 + ], + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 17 + } + } + }, + { + "type": "Punctuator", + "value": "]", + "range": [ + 17, + 18 + ], + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 18 + } + } + } + ], - 'function a() { "use strict"; function b(t, t) { }; }': { - index: 43, - lineNumber: 1, - column: 44, - message: 'Error: Line 1: Strict mode function may not have duplicate parameter names' - }, + ';function f(){} /42/': [ + { + "type": "Punctuator", + "value": ";", + "range": [ + 0, + 1 + ], + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + } + } + }, + { + "type": "Keyword", + "value": "function", + "range": [ + 1, + 9 + ], + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 9 + } + } + }, + { + "type": "Identifier", + "value": "f", + "range": [ + 10, + 11 + ], + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 11 + } + } + }, + { + "type": "Punctuator", + "value": "(", + "range": [ + 11, + 12 + ], + "loc": { + "start": { + "line": 1, + "column": 11 + }, + "end": { + "line": 1, + "column": 12 + } + } + }, + { + "type": "Punctuator", + "value": ")", + "range": [ + 12, + 13 + ], + "loc": { + "start": { + "line": 1, + "column": 12 + }, + "end": { + "line": 1, + "column": 13 + } + } + }, + { + "type": "Punctuator", + "value": "{", + "range": [ + 13, + 14 + ], + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 14 + } + } + }, + { + "type": "Punctuator", + "value": "}", + "range": [ + 14, + 15 + ], + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 15 + } + } + }, + { + "type": "RegularExpression", + "value": "/42/", + "regex": { + "pattern": "42", + "flags": "" + }, + "range": [ + 16, + 20 + ], + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 20 + } + } + } + ], - '(function a(t, t) { "use strict"; })': { - index: 15, - lineNumber: 1, - column: 16, - message: 'Error: Line 1: Strict mode function may not have duplicate parameter names' - }, + 'void /42/': [ + { + "type": "Keyword", + "value": "void", + "range": [ + 0, + 4 + ], + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 4 + } + } + }, + { + "type": "RegularExpression", + "value": "/42/", + "regex": { + "pattern": "42", + "flags": "" + }, + "range": [ + 5, + 9 + ], + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 9 + } + } + } + ], - 'function a() { "use strict"; (function b(t, t) { }); }': { - index: 44, - lineNumber: 1, - column: 45, - message: 'Error: Line 1: Strict mode function may not have duplicate parameter names' - }, + '/42/': [ + { + "type": "RegularExpression", + "value": "/42/", + "regex": { + "pattern": "42", + "flags": "" + }, + "range": [ + 0, + 4 + ], + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 4 + } + } + } + ], - '(function a(eval) { "use strict"; })': { - index: 12, - lineNumber: 1, - column: 13, - message: 'Error: Line 1: Parameter name eval or arguments is not allowed in strict mode' - }, + 'foo[/42]': [ + { + "type": "Identifier", + "value": "foo", + "range": [ + 0, + 3 + ], + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 3 + } + } + }, + { + "type": "Punctuator", + "value": "[", + "range": [ + 3, + 4 + ], + "loc": { + "start": { + "line": 1, + "column": 3 + }, + "end": { + "line": 1, + "column": 4 + } + } + } + ], - '(function a(package) { "use strict"; })': { - index: 12, - lineNumber: 1, - column: 13, - message: 'Error: Line 1: Use of future reserved word in strict mode' - }, + '[a] / b': [ + { + "type": "Punctuator", + "value": "[", + "range": [ + 0, + 1 + ], + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + } + } + }, + { + "type": "Identifier", + "value": "a", + "range": [ + 1, + 2 + ], + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 2 + } + } + }, + { + "type": "Punctuator", + "value": "]", + "range": [ + 2, + 3 + ], + "loc": { + "start": { + "line": 1, + "column": 2 + }, + "end": { + "line": 1, + "column": 3 + } + } + }, + { + "type": "Punctuator", + "value": "/", + "range": [ + 4, + 5 + ], + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 5 + } + } + }, + { + "type": "Identifier", + "value": "b", + "range": [ + 6, + 7 + ], + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 7 + } + } + } + ], - 'var': { - index: 3, - lineNumber: 1, - column: 4, - message: 'Error: Line 1: Unexpected end of input' - }, + '': [], - 'let': { + '/42': { + tokenize: true, index: 3, lineNumber: 1, column: 4, - message: 'Error: Line 1: Unexpected end of input' + message: 'Error: Line 1: Invalid regular expression: missing /' }, - 'const': { - index: 5, + 'foo[/42': { + tokenize: true, + index: 7, lineNumber: 1, - column: 6, - message: 'Error: Line 1: Unexpected end of input' - } + column: 8, + message: 'Error: Line 1: Invalid regular expression: missing /' + }, + 'this / 100;': [ + { + "type": "Keyword", + "value": "this", + "range": [ + 0, + 4 + ], + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 4 + } + } + }, + { + "type": "Punctuator", + "value": "/", + "range": [ + 5, + 6 + ], + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 6 + } + } + }, + { + "type": "Numeric", + "value": "100", + "range": [ + 7, + 10 + ], + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 10 + } + } + }, + { + "type": "Punctuator", + "value": ";", + "range": [ + 10, + 11 + ], + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 11 + } + } + } + ] }, 'API': { @@ -17047,151 +25447,1373 @@ var testFixture = { type: 'ExpressionStatement', expression: { type: 'Literal', - value: null + value: null, + raw: 'null' + } + }] + } + }, + + 'parse(42)': { + call: 'parse', + args: [42], + result: { + type: 'Program', + body: [{ + type: 'ExpressionStatement', + expression: { + type: 'Literal', + value: 42, + raw: '42' + } + }] + } + }, + + 'parse(true)': { + call: 'parse', + args: [true], + result: { + type: 'Program', + body: [{ + type: 'ExpressionStatement', + expression: { + type: 'Literal', + value: true, + raw: 'true' + } + }] + } + }, + + 'parse(undefined)': { + call: 'parse', + args: [void 0], + result: { + type: 'Program', + body: [{ + type: 'ExpressionStatement', + expression: { + type: 'Identifier', + name: 'undefined' + } + }] + } + }, + + 'parse(new String("test"))': { + call: 'parse', + args: [new String('test')], + result: { + type: 'Program', + body: [{ + type: 'ExpressionStatement', + expression: { + type: 'Identifier', + name: 'test' + } + }] + } + }, + + 'parse(new Number(42))': { + call: 'parse', + args: [new Number(42)], + result: { + type: 'Program', + body: [{ + type: 'ExpressionStatement', + expression: { + type: 'Literal', + value: 42, + raw: '42' + } + }] + } + }, + + 'parse(new Boolean(true))': { + call: 'parse', + args: [new Boolean(true)], + result: { + type: 'Program', + body: [{ + type: 'ExpressionStatement', + expression: { + type: 'Literal', + value: true, + raw: 'true' } }] } }, - 'parse(42)': { - call: 'parse', - args: [42], - result: { - type: 'Program', - body: [{ - type: 'ExpressionStatement', - expression: { - type: 'Literal', - value: 42 - } - }] - } + 'Syntax': { + property: 'Syntax', + result: { + AssignmentExpression: 'AssignmentExpression', + ArrayExpression: 'ArrayExpression', + ArrowFunctionExpression: 'ArrowFunctionExpression', + BlockStatement: 'BlockStatement', + BinaryExpression: 'BinaryExpression', + BreakStatement: 'BreakStatement', + CallExpression: 'CallExpression', + CatchClause: 'CatchClause', + ConditionalExpression: 'ConditionalExpression', + ContinueStatement: 'ContinueStatement', + DoWhileStatement: 'DoWhileStatement', + DebuggerStatement: 'DebuggerStatement', + EmptyStatement: 'EmptyStatement', + ExpressionStatement: 'ExpressionStatement', + ForStatement: 'ForStatement', + ForInStatement: 'ForInStatement', + FunctionDeclaration: 'FunctionDeclaration', + FunctionExpression: 'FunctionExpression', + Identifier: 'Identifier', + IfStatement: 'IfStatement', + Literal: 'Literal', + LabeledStatement: 'LabeledStatement', + LogicalExpression: 'LogicalExpression', + MemberExpression: 'MemberExpression', + NewExpression: 'NewExpression', + ObjectExpression: 'ObjectExpression', + Program: 'Program', + Property: 'Property', + ReturnStatement: 'ReturnStatement', + SequenceExpression: 'SequenceExpression', + SwitchStatement: 'SwitchStatement', + SwitchCase: 'SwitchCase', + ThisExpression: 'ThisExpression', + ThrowStatement: 'ThrowStatement', + TryStatement: 'TryStatement', + UnaryExpression: 'UnaryExpression', + UpdateExpression: 'UpdateExpression', + VariableDeclaration: 'VariableDeclaration', + VariableDeclarator: 'VariableDeclarator', + WhileStatement: 'WhileStatement', + WithStatement: 'WithStatement' + } + }, + + 'tokenize()': { + call: 'tokenize', + args: [], + result: [{ + type: 'Identifier', + value: 'undefined' + }] + }, + + 'tokenize(null)': { + call: 'tokenize', + args: [null], + result: [{ + type: 'Null', + value: 'null' + }] + }, + + 'tokenize(42)': { + call: 'tokenize', + args: [42], + result: [{ + type: 'Numeric', + value: '42' + }] + }, + + 'tokenize(true)': { + call: 'tokenize', + args: [true], + result: [{ + type: 'Boolean', + value: 'true' + }] + }, + + 'tokenize(undefined)': { + call: 'tokenize', + args: [void 0], + result: [{ + type: 'Identifier', + value: 'undefined' + }] + }, + + 'tokenize(new String("test"))': { + call: 'tokenize', + args: [new String('test')], + result: [{ + type: 'Identifier', + value: 'test' + }] + }, + + 'tokenize(new Number(42))': { + call: 'tokenize', + args: [new Number(42)], + result: [{ + type: 'Numeric', + value: '42' + }] + }, + + 'tokenize(new Boolean(true))': { + call: 'tokenize', + args: [new Boolean(true)], + result: [{ + type: 'Boolean', + value: 'true' + }] + } + }, + + 'Tolerant parse': { + /** argument recovery */ + 'f(a b c);': { + range: [0, 9], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 9 } + }, + type: "Program", + body: [{ + range: [0, 9], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 9 } + }, + type: "ExpressionStatement", + expression: { + range: [0, 8], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 8 } + }, + type: "CallExpression", + callee: { + range: [0, 1], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 1 } + }, + type: "Identifier", + name: "f" + }, + "arguments": [{ + range: [2, 3], + loc: { + start: { line: 1, column: 2 }, + end: { line: 1, column: 3 } + }, + type: "Identifier", + name: "a" + }, { + range: [4, 5], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 5 } + }, + type: "Identifier", + name: "b" + }, { + range: [6, 7], + loc: { + start: { line: 1, column: 6 }, + end: { line: 1, column: 7 } + }, + type: "Identifier", + name: "c" + }] + } + }], + errors: [{ + index: 4, + lineNumber: 1, + column: 5, + message: "Error: Line 1: Unexpected token b" + }, { + index: 6, + lineNumber: 1, + column: 7, + message: "Error: Line 1: Unexpected token c" + }] + }, + + /** argument recovery function */ + 'f(a function(){} c);': { + range: [0, 20], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 20 } + }, + type: "Program", + body: [{ + range: [0, 20], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 20 } + }, + type: "ExpressionStatement", + expression: { + range: [0, 19], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 19 } + }, + type: "CallExpression", + callee: { + range: [0, 1], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 1 } + }, + type: "Identifier", + name: "f" + }, + "arguments": [{ + range: [2, 3], + loc: { + start: { line: 1, column: 2 }, + end: { line: 1, column: 3 } + }, + type: "Identifier", + name: "a" + }, { + range: [4, 16], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 16 } + }, + type: "FunctionExpression", + id: null, + params: [], + defaults: [], + body: { + range: [14, 16], + loc: { + start: { line: 1, column: 14 }, + end: { line: 1, column: 16 } + }, + type: "BlockStatement", + body: [] + }, + rest: null, + generator: false, + expression: false + }, { + range: [17, 18], + loc: { + start: { line: 1, column: 17 }, + end: { line: 1, column: 18 } + }, + type: "Identifier", + name: "c" + }] + } + }], + errors: [{ + index: 4, + lineNumber: 1, + column: 5, + message: "Error: Line 1: Unexpected token function" + }, { + index: 17, + lineNumber: 1, + column: 18, + message: "Error: Line 1: Unexpected token c" + }] + }, + + /** argument recovery object */ + 'f({} b c);': { + range: [0, 10], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 10 } + }, + type: "Program", + body: [{ + range: [0, 10], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 10 } + }, + type: "ExpressionStatement", + expression: { + range: [0, 9], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 9 } + }, + type: "CallExpression", + callee: { + range: [0, 1], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 1 } + }, + type: "Identifier", + name: "f" + }, + "arguments": [{ + range: [2, 4], + loc: { + start: { line: 1, column: 2 }, + end: { line: 1, column: 4 } + }, + type: "ObjectExpression", + properties: [] + }, { + range: [5, 6], + loc: { + start: { line: 1, column: 5 }, + end: { line: 1, column: 6 } + }, + type: "Identifier", + name: "b" + }, { + range: [7, 8], + loc: { + start: { line: 1, column: 7 }, + end: { line: 1, column: 8 } + }, + type: "Identifier", + name: "c" + }] + } + }], + errors: [{ + index: 5, + lineNumber: 1, + column: 6, + message: "Error: Line 1: Unexpected token b" + }, { + index: 7, + lineNumber: 1, + column: 8, + message: "Error: Line 1: Unexpected token c" + }] }, - 'parse(true)': { - call: 'parse', - args: [true], - result: { - type: 'Program', - body: [{ - type: 'ExpressionStatement', - expression: { - type: 'Literal', - value: true + /** single recovery - missing comma*/ + 'var o = {one: function() {} two:2};': { + range: [0, 35], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 35 } + }, + type: "Program", + body: [{ + range: [0, 35], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 35 } + }, + type: "VariableDeclaration", + declarations: [{ + range: [4, 34], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 34 } + }, + type: "VariableDeclarator", + id: { + range: [4, 5], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 5 } + }, + type: "Identifier", + name: "o" + }, + init: { + range: [8, 34], + loc: { + start: { line: 1, column: 8 }, + end: { line: 1, column: 34 } + }, + type: "ObjectExpression", + properties: [{ + range: [9, 27], + loc: { + start: { line: 1, column: 9 }, + end: { line: 1, column: 27 } + }, + type: "Property", + key: { + range: [9, 12], + loc: { + start: { line: 1, column: 9 }, + end: { line: 1, column: 12 } + }, + type: "Identifier", + name: "one" + }, + value: { + range: [14, 27], + loc: { + start: { line: 1, column: 14 }, + end: { line: 1, column: 27 } + }, + type: "FunctionExpression", + id: null, + params: [], + defaults: [], + body: { + range: [25, 27], + loc: { + start: { line: 1, column: 25 }, + end: { line: 1, column: 27 } + }, + type: "BlockStatement", + body: [] + }, + rest: null, + generator: false, + expression: false + }, + kind: "init", + method: false, + shorthand: false + }, { + range: [28, 33], + loc: { + start: { line: 1, column: 28 }, + end: { line: 1, column: 33 } + }, + type: "Property", + key: { + range: [28, 31], + loc: { + start: { line: 1, column: 28 }, + end: { line: 1, column: 31 } + }, + type: "Identifier", + name: "two" + }, + value: { + range: [32, 33], + loc: { + start: { line: 1, column: 32 }, + end: { line: 1, column: 33 } + }, + type: "Literal", + value: 2, + raw: "2" + }, + kind: "init", + method: false, + shorthand: false + }] } - }] - } + }], + kind: "var" + }], + tokens: [{ + type: "Keyword", + value: "var", + range: [0, 3], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 3 } + } + }, { + type: "Identifier", + value: "o", + range: [4, 5], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 5 } + } + }, { + type: "Punctuator", + value: "=", + range: [6, 7], + loc: { + start: { line: 1, column: 6 }, + end: { line: 1, column: 7 } + } + }, { + type: "Punctuator", + value: "{", + range: [8, 9], + loc: { + start: { line: 1, column: 8 }, + end: { line: 1, column: 9 } + } + }, { + type: "Identifier", + value: "one", + range: [9, 12], + loc: { + start: { line: 1, column: 9 }, + end: { line: 1, column: 12 } + } + }, { + type: "Punctuator", + value: ":", + range: [12, 13], + loc: { + start: { line: 1, column: 12 }, + end: { line: 1, column: 13 } + } + }, { + type: "Keyword", + value: "function", + range: [14, 22], + loc: { + start: { line: 1, column: 14 }, + end: { line: 1, column: 22 } + } + }, { + type: "Punctuator", + value: "(", + range: [22, 23], + loc: { + start: { line: 1, column: 22 }, + end: { line: 1, column: 23 } + } + }, { + type: "Punctuator", + value: ")", + range: [23, 24], + loc: { + start: { line: 1, column: 23 }, + end: { line: 1, column: 24 } + } + }, { + type: "Punctuator", + value: "{", + range: [25, 26], + loc: { + start: { line: 1, column: 25 }, + end: { line: 1, column: 26 } + } + }, { + type: "Punctuator", + value: "}", + range: [26, 27], + loc: { + start: { line: 1, column: 26 }, + end: { line: 1, column: 27 } + } + }, { + type: "Identifier", + value: "two", + range: [28, 31], + loc: { + start: { line: 1, column: 28 }, + end: { line: 1, column: 31 } + } + }, { + type: "Punctuator", + value: ":", + range: [31, 32], + loc: { + start: { line: 1, column: 31 }, + end: { line: 1, column: 32 } + } + }, { + type: "Numeric", + value: "2", + range: [32, 33], + loc: { + start: { line: 1, column: 32 }, + end: { line: 1, column: 33 } + } + }, { + type: "Punctuator", + value: "}", + range: [33, 34], + loc: { + start: { line: 1, column: 33 }, + end: { line: 1, column: 34 } + } + }, { + type: "Punctuator", + value: ";", + range: [34, 35], + loc: { + start: { line: 1, column: 34 }, + end: { line: 1, column: 35 } + } + }], + errors: [{ + index: 28, + lineNumber: 1, + column: 29, + message: "Error: Line 1: Unexpected token two" + }] }, - 'parse(undefined)': { - call: 'parse', - args: [void 0], - result: { - type: 'Program', - body: [{ - type: 'ExpressionStatement', - expression: { - type: 'Identifier', - name: 'undefined' + /** successive recovery - missing comma*/ + 'var o = {one: function() {} two:2 three: 3};': { + range: [0, 44], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 44 } + }, + type: "Program", + body: [{ + range: [0, 44], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 44 } + }, + type: "VariableDeclaration", + declarations: [{ + range: [4, 43], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 43 } + }, + type: "VariableDeclarator", + id: { + range: [4, 5], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 5 } + }, + type: "Identifier", + name: "o" + }, + init: { + range: [8, 43], + loc: { + start: { line: 1, column: 8 }, + end: { line: 1, column: 43 } + }, + type: "ObjectExpression", + properties: [{ + range: [9, 27], + loc: { + start: { line: 1, column: 9 }, + end: { line: 1, column: 27 } + }, + type: "Property", + key: { + range: [9, 12], + loc: { + start: { line: 1, column: 9 }, + end: { line: 1, column: 12 } + }, + type: "Identifier", + name: "one" + }, + value: { + range: [14, 27], + loc: { + start: { line: 1, column: 14 }, + end: { line: 1, column: 27 } + }, + type: "FunctionExpression", + id: null, + params: [], + defaults: [], + body: { + range: [25, 27], + loc: { + start: { line: 1, column: 25 }, + end: { line: 1, column: 27 } + }, + type: "BlockStatement", + body: [] + }, + rest: null, + generator: false, + expression: false + }, + kind: "init", + method: false, + shorthand: false + }, { + range: [28, 33], + loc: { + start: { line: 1, column: 28 }, + end: { line: 1, column: 33 } + }, + type: "Property", + key: { + range: [28, 31], + loc: { + start: { line: 1, column: 28 }, + end: { line: 1, column: 31 } + }, + type: "Identifier", + name: "two" + }, + value: { + range: [32, 33], + loc: { + start: { line: 1, column: 32 }, + end: { line: 1, column: 33 } + }, + type: "Literal", + value: 2, + raw: "2" + }, + kind: "init", + method: false, + shorthand: false + }, { + range: [34, 42], + loc: { + start: { line: 1, column: 34 }, + end: { line: 1, column: 42 } + }, + type: "Property", + key: { + range: [34, 39], + loc: { + start: { line: 1, column: 34 }, + end: { line: 1, column: 39 } + }, + type: "Identifier", + name: "three" + }, + value: { + range: [41, 42], + loc: { + start: { line: 1, column: 41 }, + end: { line: 1, column: 42 } + }, + type: "Literal", + value: 3, + raw: "3" + }, + kind: "init", + method: false, + shorthand: false + }] } - }] - } + }], + kind: "var" + }], + errors: [{ + index: 28, + lineNumber: 1, + column: 29, + message: "Error: Line 1: Unexpected token two" + }, { + index: 34, + lineNumber: 1, + column: 35, + message: "Error: Line 1: Unexpected token three" + }] }, - 'parse(new String("test"))': { - call: 'parse', - args: [new String('test')], - result: { - type: 'Program', - body: [{ - type: 'ExpressionStatement', - expression: { - type: 'Identifier', - name: 'test' + /** mixed recovery - missing comma */ + 'var o = {one: function() {} two:2, three: 3 "four":4};': { + range: [0, 54], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 54 } + }, + type: "Program", + body: [{ + range: [0, 54], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 54 } + }, + type: "VariableDeclaration", + declarations: [{ + range: [4, 53], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 53 } + }, + type: "VariableDeclarator", + id: { + range: [4, 5], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 5 } + }, + type: "Identifier", + name: "o" + }, + init: { + range: [8, 53], + loc: { + start: { line: 1, column: 8 }, + end: { line: 1, column: 53 } + }, + type: "ObjectExpression", + properties: [{ + range: [9, 27], + loc: { + start: { line: 1, column: 9 }, + end: { line: 1, column: 27 } + }, + type: "Property", + key: { + range: [9, 12], + loc: { + start: { line: 1, column: 9 }, + end: { line: 1, column: 12 } + }, + type: "Identifier", + name: "one" + }, + value: { + range: [14, 27], + loc: { + start: { line: 1, column: 14 }, + end: { line: 1, column: 27 } + }, + type: "FunctionExpression", + id: null, + params: [], + defaults: [], + body: { + range: [25, 27], + loc: { + start: { line: 1, column: 25 }, + end: { line: 1, column: 27 } + }, + type: "BlockStatement", + body: [] + }, + rest: null, + generator: false, + expression: false + }, + kind: "init", + method: false, + shorthand: false + }, { + range: [28, 33], + loc: { + start: { line: 1, column: 28 }, + end: { line: 1, column: 33 } + }, + type: "Property", + key: { + range: [28, 31], + loc: { + start: { line: 1, column: 28 }, + end: { line: 1, column: 31 } + }, + type: "Identifier", + name: "two" + }, + value: { + range: [32, 33], + loc: { + start: { line: 1, column: 32 }, + end: { line: 1, column: 33 } + }, + type: "Literal", + value: 2, + raw: "2" + }, + kind: "init", + method: false, + shorthand: false + }, { + range: [35, 43], + loc: { + start: { line: 1, column: 35 }, + end: { line: 1, column: 43 } + }, + type: "Property", + key: { + range: [35, 40], + loc: { + start: { line: 1, column: 35 }, + end: { line: 1, column: 40 } + }, + type: "Identifier", + name: "three" + }, + value: { + range: [42, 43], + loc: { + start: { line: 1, column: 42 }, + end: { line: 1, column: 43 } + }, + type: "Literal", + value: 3, + raw: "3" + }, + kind: "init", + method: false, + shorthand: false + }, { + range: [44, 52], + loc: { + start: { line: 1, column: 44 }, + end: { line: 1, column: 52 } + }, + type: "Property", + key: { + range: [44, 50], + loc: { + start: { line: 1, column: 44 }, + end: { line: 1, column: 50 } + }, + type: "Literal", + value: "four", + raw: "\"four\"" + }, + value: { + range: [51, 52], + loc: { + start: { line: 1, column: 51 }, + end: { line: 1, column: 52 } + }, + type: "Literal", + value: 4, + raw: "4" + }, + kind: "init", + method: false, + shorthand: false + }] } - }] - } + }], + kind: "var" + }], + errors: [{ + index: 28, + lineNumber: 1, + column: 29, + message: "Error: Line 1: Unexpected token two" + }, { + index: 44, + lineNumber: 1, + column: 45, + message: "Error: Line 1: Unexpected token four" + }] }, - 'parse(new Number(42))': { - call: 'parse', - args: [new Number(42)], - result: { - type: 'Program', - body: [{ - type: 'ExpressionStatement', - expression: { - type: 'Literal', - value: 42 + /** nested recovery - missing comma */ + 'var o = {one: function() {} two:2, three: {aa: "a" bb: "b"} four: 4};': { + range: [0, 69], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 69 } + }, + type: "Program", + body: [{ + range: [0, 69], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 69 } + }, + type: "VariableDeclaration", + declarations: [{ + range: [4, 68], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 68 } + }, + type: "VariableDeclarator", + id: { + range: [4, 5], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 5 } + }, + type: "Identifier", + name: "o" + }, + init: { + range: [8, 68], + loc: { + start: { line: 1, column: 8 }, + end: { line: 1, column: 68 } + }, + type: "ObjectExpression", + properties: [{ + range: [9, 27], + loc: { + start: { line: 1, column: 9 }, + end: { line: 1, column: 27 } + }, + type: "Property", + key: { + range: [9, 12], + loc: { + start: { line: 1, column: 9 }, + end: { line: 1, column: 12 } + }, + type: "Identifier", + name: "one" + }, + value: { + range: [14, 27], + loc: { + start: { line: 1, column: 14 }, + end: { line: 1, column: 27 } + }, + type: "FunctionExpression", + id: null, + params: [], + defaults: [], + body: { + range: [25, 27], + loc: { + start: { line: 1, column: 25 }, + end: { line: 1, column: 27 } + }, + type: "BlockStatement", + body: [] + }, + rest: null, + generator: false, + expression: false + }, + kind: "init", + method: false, + shorthand: false + }, { + range: [28, 33], + loc: { + start: { line: 1, column: 28 }, + end: { line: 1, column: 33 } + }, + type: "Property", + key: { + range: [28, 31], + loc: { + start: { line: 1, column: 28 }, + end: { line: 1, column: 31 } + }, + type: "Identifier", + name: "two" + }, + value: { + range: [32, 33], + loc: { + start: { line: 1, column: 32 }, + end: { line: 1, column: 33 } + }, + type: "Literal", + value: 2, + raw: "2" + }, + kind: "init", + method: false, + shorthand: false + }, { + range: [35, 59], + loc: { + start: { line: 1, column: 35 }, + end: { line: 1, column: 59 } + }, + type: "Property", + key: { + range: [35, 40], + loc: { + start: { line: 1, column: 35 }, + end: { line: 1, column: 40 } + }, + type: "Identifier", + name: "three" + }, + value: { + range: [42, 59], + loc: { + start: { line: 1, column: 42 }, + end: { line: 1, column: 59 } + }, + type: "ObjectExpression", + properties: [{ + range: [43, 50], + loc: { + start: { line: 1, column: 43 }, + end: { line: 1, column: 50 } + }, + type: "Property", + key: { + range: [43, 45], + loc: { + start: { line: 1, column: 43 }, + end: { line: 1, column: 45 } + }, + type: "Identifier", + name: "aa" + }, + value: { + range: [47, 50], + loc: { + start: { line: 1, column: 47 }, + end: { line: 1, column: 50 } + }, + type: "Literal", + value: "a", + raw: "\"a\"" + }, + kind: "init", + method: false, + shorthand: false + }, { + range: [51, 58], + loc: { + start: { line: 1, column: 51 }, + end: { line: 1, column: 58 } + }, + type: "Property", + key: { + range: [51, 53], + loc: { + start: { line: 1, column: 51 }, + end: { line: 1, column: 53 } + }, + type: "Identifier", + name: "bb" + }, + value: { + range: [55, 58], + loc: { + start: { line: 1, column: 55 }, + end: { line: 1, column: 58 } + }, + type: "Literal", + value: "b", + raw: "\"b\"" + }, + kind: "init", + method: false, + shorthand: false + }] + }, + kind: "init", + method: false, + shorthand: false + }, { + range: [60, 67], + loc: { + start: { line: 1, column: 60 }, + end: { line: 1, column: 67 } + }, + type: "Property", + key: { + range: [60, 64], + loc: { + start: { line: 1, column: 60 }, + end: { line: 1, column: 64 } + }, + type: "Identifier", + name: "four" + }, + value: { + range: [66, 67], + loc: { + start: { line: 1, column: 66 }, + end: { line: 1, column: 67 } + }, + type: "Literal", + value: 4, + raw: "4" + }, + kind: "init", + method: false, + shorthand: false + }] } - }] - } + }], + kind: "var" + }], + errors: [{ + index: 28, + lineNumber: 1, + column: 29, + message: "Error: Line 1: Unexpected token two" + }, { + index: 51, + lineNumber: 1, + column: 52, + message: "Error: Line 1: Unexpected token bb" + }, { + index: 60, + lineNumber: 1, + column: 61, + message: "Error: Line 1: Unexpected token four" + }] }, - 'parse(new Boolean(true))': { - call: 'parse', - args: [new Boolean(true)], - result: { - type: 'Program', - body: [{ - type: 'ExpressionStatement', - expression: { - type: 'Literal', - value: true + 'x = { y: z; }': { + range: [0, 13], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 13 } + }, + type: "Program", + body: [{ + range: [0, 13], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 13 } + }, + type: "ExpressionStatement", + expression: { + range: [0, 13], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 13 } + }, + type: "AssignmentExpression", + operator: "=", + left: { + range: [0, 1], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 1 } + }, + type: "Identifier", + name: "x" + }, + right: { + range: [4, 13], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 13 } + }, + type: "ObjectExpression", + properties: [{ + range: [6, 10], + loc: { + start: { line: 1, column: 6 }, + end: { line: 1, column: 10 } + }, + type: "Property", + key: { + range: [6, 7], + loc: { + start: { line: 1, column: 6 }, + end: { line: 1, column: 7 } + }, + type: "Identifier", + name: "y" + }, + value: { + range: [9, 10], + loc: { + start: { line: 1, column: 9 }, + end: { line: 1, column: 10 } + }, + type: "Identifier", + name: "z" + }, + kind: "init", + method: false, + shorthand: false + }] } - }] - } + } + }], + errors: [{ + index: 10, + lineNumber: 1, + column: 11, + message: "Error: Line 1: Unexpected token ;" + }] }, - 'Syntax': { - property: 'Syntax', - result: { - AssignmentExpression: 'AssignmentExpression', - ArrayExpression: 'ArrayExpression', - BlockStatement: 'BlockStatement', - BinaryExpression: 'BinaryExpression', - BreakStatement: 'BreakStatement', - CallExpression: 'CallExpression', - CatchClause: 'CatchClause', - ConditionalExpression: 'ConditionalExpression', - ContinueStatement: 'ContinueStatement', - DoWhileStatement: 'DoWhileStatement', - DebuggerStatement: 'DebuggerStatement', - EmptyStatement: 'EmptyStatement', - ExpressionStatement: 'ExpressionStatement', - ForStatement: 'ForStatement', - ForInStatement: 'ForInStatement', - FunctionDeclaration: 'FunctionDeclaration', - FunctionExpression: 'FunctionExpression', - Identifier: 'Identifier', - IfStatement: 'IfStatement', - Literal: 'Literal', - LabeledStatement: 'LabeledStatement', - LogicalExpression: 'LogicalExpression', - MemberExpression: 'MemberExpression', - NewExpression: 'NewExpression', - ObjectExpression: 'ObjectExpression', - Program: 'Program', - Property: 'Property', - ReturnStatement: 'ReturnStatement', - SequenceExpression: 'SequenceExpression', - SwitchStatement: 'SwitchStatement', - SwitchCase: 'SwitchCase', - ThisExpression: 'ThisExpression', - ThrowStatement: 'ThrowStatement', - TryStatement: 'TryStatement', - UnaryExpression: 'UnaryExpression', - UpdateExpression: 'UpdateExpression', - VariableDeclaration: 'VariableDeclaration', - VariableDeclarator: 'VariableDeclarator', - WhileStatement: 'WhileStatement', - WithStatement: 'WithStatement' - } - } - - }, - - 'Tolerant parse': { 'return': { type: 'Program', body: [{ @@ -18162,6 +27784,8 @@ var testFixture = { } }, kind: 'init', + method: false, + shorthand: false, range: [16, 19], loc: { start: { line: 1, column: 16 }, @@ -18189,6 +27813,8 @@ var testFixture = { } }, kind: 'init', + method: false, + shorthand: false, range: [20, 23], loc: { start: { line: 1, column: 20 }, @@ -19215,6 +28841,8 @@ var testFixture = { } }, kind: 'set', + method: false, + shorthand: false, range: [20, 34], loc: { start: { line: 1, column: 20 }, @@ -19439,6 +29067,8 @@ var testFixture = { } }, kind: 'init', + method: false, + shorthand: false, range: [24, 30], loc: { start: { line: 1, column: 24 }, @@ -19546,6 +29176,8 @@ var testFixture = { } }, kind: 'get', + method: false, + shorthand: false, range: [24, 34], loc: { start: { line: 1, column: 24 }, @@ -19586,6 +29218,8 @@ var testFixture = { } }, kind: 'get', + method: false, + shorthand: false, range: [36, 46], loc: { start: { line: 1, column: 36 }, @@ -19680,6 +29314,8 @@ var testFixture = { } }, kind: 'init', + method: false, + shorthand: false, range: [24, 29], loc: { start: { line: 1, column: 24 }, @@ -19720,6 +29356,8 @@ var testFixture = { } }, kind: 'get', + method: false, + shorthand: false, range: [31, 41], loc: { start: { line: 1, column: 31 }, @@ -19835,6 +29473,8 @@ var testFixture = { } }, kind: 'set', + method: false, + shorthand: false, range: [24, 35], loc: { start: { line: 1, column: 24 }, @@ -19862,6 +29502,8 @@ var testFixture = { } }, kind: 'init', + method: false, + shorthand: false, range: [37, 42], loc: { start: { line: 1, column: 37 }, @@ -19943,6 +29585,8 @@ var testFixture = { } }, kind: 'set', + method: false, + shorthand: false, range: [3, 14], loc: { start: { line: 1, column: 3 }, @@ -20230,9 +29874,122 @@ var testFixture = { column: 7, message: 'Error: Line 1: Invalid left-hand side in for-in' }] - } + }, + + 'var x = /[P QR]/\\g': { + type: "Program", + body: [{ + type: "VariableDeclaration", + declarations: [{ + type: "VariableDeclarator", + id: { + type: "Identifier", + name: "x", + range: [4, 5], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 5 } + } + }, + init: { + type: "Literal", + value: "/[P QR]/g", + raw: "/[P QR]/\\g", + regex: { + pattern: "[P QR]", + flags: "g" + }, + range: [8, 18], + loc: { + start: { line: 1, column: 8 }, + end: { line: 1, column: 18 } + } + }, + range: [4, 18], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 18 } + } + }], + kind: "var", + range: [0, 18], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 18 } + } + }], + range: [0, 18], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 18 } + }, + errors: [{ + index: 17, + lineNumber: 1, + column: 18, + message: "Error: Line 1: Unexpected token ILLEGAL" + }] + }, + 'var x = /[P QR]/\\\\u0067': { + type: "Program", + body: [{ + type: "VariableDeclaration", + declarations: [{ + type: "VariableDeclarator", + id: { + type: "Identifier", + name: "x", + range: [4, 5], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 5 } + } + }, + init: { + type: "Literal", + value: "/[P QR]/g", + raw: "/[P QR]/\\\\u0067", + regex: { + pattern: "[P QR]", + flags: "g" + }, + range: [8, 23], + loc: { + start: { line: 1, column: 8 }, + end: { line: 1, column: 23 } + } + }, + range: [4, 23], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 23 } + } + }], + kind: "var", + range: [0, 23], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 23 } + } + }], + range: [0, 23], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 23 } + }, + errors: [{ + index: 17, + lineNumber: 1, + column: 18, + message: "Error: Line 1: Unexpected token ILLEGAL" + }, { + index: 23, + lineNumber: 1, + column: 24, + message: "Error: Line 1: Unexpected token ILLEGAL" + }] + } } }; - diff --git a/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/package.json b/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/package.json index 227052c..58d859e 100644 --- a/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/package.json +++ b/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/package.json @@ -1,6 +1,6 @@ { "name": "js-yaml", - "version": "3.0.2", + "version": "3.2.7", "description": "YAML 1.2 parser and serializer", "keywords": [ "yaml", @@ -46,25 +46,23 @@ "js-yaml": "bin/js-yaml.js" }, "dependencies": { - "argparse": "~ 0.1.11", - "esprima": "~ 1.0.2" + "argparse": "~ 1.0.0", + "esprima": "~ 2.0.0" }, "devDependencies": { + "ansi": "*", + "benchmark": "*", "mocha": "*" }, "browser": { - "./index.js": "./index_browser.js", "buffer": false }, - "_id": "js-yaml@3.0.2", - "dist": { - "shasum": "9937865f8e897a5e894e73c2c5cf2e89b32eb771", - "tarball": "http://registry.npmjs.org/js-yaml/-/js-yaml-3.0.2.tgz" - }, - "_from": "js-yaml@~3.0.1", - "_resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.0.2.tgz", + "gitHead": "2321c0b9d1e25f9b8e6202744bc601a4998fe27f", + "_id": "js-yaml@3.2.7", "scripts": {}, - "_npmVersion": "1.4.3", + "_shasum": "102790f265d986fe95a4d0f2a792e7a7bd886eec", + "_from": "js-yaml@^3.1.0", + "_npmVersion": "1.4.28", "_npmUser": { "name": "vitaly", "email": "vitaly@rcdesign.ru" @@ -75,7 +73,10 @@ "email": "vitaly@rcdesign.ru" } ], + "dist": { + "shasum": "102790f265d986fe95a4d0f2a792e7a7bd886eec", + "tarball": "http://registry.npmjs.org/js-yaml/-/js-yaml-3.2.7.tgz" + }, "directories": {}, - "_shasum": "9937865f8e897a5e894e73c2c5cf2e89b32eb771", - "readme": "ERROR: No README data found!" + "_resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.2.7.tgz" } diff --git a/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/object-assign/index.js b/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/object-assign/index.js new file mode 100644 index 0000000..438b80a --- /dev/null +++ b/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/object-assign/index.js @@ -0,0 +1,26 @@ +'use strict'; + +function ToObject(val) { + if (val == null) { + throw new TypeError('Object.assign cannot be called with null or undefined'); + } + + return Object(val); +} + +module.exports = Object.assign || function (target, source) { + var from; + var keys; + var to = ToObject(target); + + for (var s = 1; s < arguments.length; s++) { + from = arguments[s]; + keys = Object.keys(Object(from)); + + for (var i = 0; i < keys.length; i++) { + to[keys[i]] = from[keys[i]]; + } + } + + return to; +}; diff --git a/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/object-assign/object-assign.js b/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/object-assign/object-assign.js deleted file mode 100644 index ee5c228..0000000 --- a/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/object-assign/object-assign.js +++ /dev/null @@ -1,52 +0,0 @@ -/*! - object-assign - ES6 Object.assign() ponyfill - https://github.com/sindresorhus/object-assign - by Sindre Sorhus - MIT License -*/ -(function () { - 'use strict'; - - var ToObject = function (val) { - if (val == null) { - throw new TypeError('Object.assign cannot be called with null or undefined'); - } - - return Object(val); - } - - var objectAssign = Object.assign || function (target, source) { - var pendingException; - var from; - var keys; - var to = ToObject(target); - - for (var s = 1; s < arguments.length; s++) { - from = ToObject(arguments[s]); - keys = Object.keys(from) - - for (var i = 0; i < keys.length; i++) { - try { - to[keys[i]] = from[keys[i]]; - } catch (err) { - if (pendingException === undefined) { - pendingException = err; - } - } - } - } - - if (pendingException) { - throw pendingException; - } - - return to; - }; - - if (typeof module !== 'undefined' && module.exports) { - module.exports = objectAssign; - } else { - window.objectAssign = objectAssign; - } -})(); diff --git a/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/object-assign/package.json b/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/object-assign/package.json index d6bc8f0..1e7d44c 100644 --- a/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/object-assign/package.json +++ b/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/object-assign/package.json @@ -1,12 +1,11 @@ { "name": "object-assign", - "version": "0.3.1", + "version": "2.0.0", "description": "ES6 Object.assign() ponyfill", "license": "MIT", - "main": "object-assign.js", "repository": { "type": "git", - "url": "git://github.com/sindresorhus/object-assign" + "url": "https://github.com/sindresorhus/object-assign" }, "author": { "name": "Sindre Sorhus", @@ -20,7 +19,7 @@ "test": "mocha" }, "files": [ - "object-assign.js" + "index.js" ], "keywords": [ "object", @@ -39,17 +38,16 @@ "devDependencies": { "mocha": "*" }, + "gitHead": "4cd0365f5a78dd369473ca0bbd31f7b234148c42", "bugs": { "url": "https://github.com/sindresorhus/object-assign/issues" }, "homepage": "https://github.com/sindresorhus/object-assign", - "_id": "object-assign@0.3.1", - "dist": { - "shasum": "060e2a2a27d7c0d77ec77b78f11aa47fd88008d2", - "tarball": "http://registry.npmjs.org/object-assign/-/object-assign-0.3.1.tgz" - }, - "_from": "object-assign@~0.3.1", - "_npmVersion": "1.4.6", + "_id": "object-assign@2.0.0", + "_shasum": "f8309b09083b01261ece3ef7373f2b57b8dd7042", + "_from": "object-assign@^2.0.0", + "_npmVersion": "2.1.5", + "_nodeVersion": "0.10.32", "_npmUser": { "name": "sindresorhus", "email": "sindresorhus@gmail.com" @@ -60,8 +58,10 @@ "email": "sindresorhus@gmail.com" } ], + "dist": { + "shasum": "f8309b09083b01261ece3ef7373f2b57b8dd7042", + "tarball": "http://registry.npmjs.org/object-assign/-/object-assign-2.0.0.tgz" + }, "directories": {}, - "_shasum": "060e2a2a27d7c0d77ec77b78f11aa47fd88008d2", - "_resolved": "https://registry.npmjs.org/object-assign/-/object-assign-0.3.1.tgz", - "readme": "ERROR: No README data found!" + "_resolved": "https://registry.npmjs.org/object-assign/-/object-assign-2.0.0.tgz" } diff --git a/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/object-assign/readme.md b/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/object-assign/readme.md index a8b470b..aee51c1 100644 --- a/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/object-assign/readme.md +++ b/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/object-assign/readme.md @@ -11,24 +11,26 @@ $ npm install --save object-assign ``` -```sh -$ bower install --save object-assign -``` - -```sh -$ component install sindresorhus/object-assign -``` - ## Usage ```js +var objectAssign = require('object-assign'); + objectAssign({foo: 0}, {bar: 1}); //=> {foo: 0, bar: 1} // multiple sources -objectAssign({foo: 0}, {bar: 1}, {baz: 3}); +objectAssign({foo: 0}, {bar: 1}, {baz: 2}); //=> {foo: 0, bar: 1, baz: 2} + +// overwrites equal keys +objectAssign({foo: 0}, {foo: 1}, {foo: 2}); +//=> {foo: 2} + +// ignores null and undefined sources +objectAssign({foo: 0}, null, {bar: 1}, undefined); +//=> {foo: 0, bar: 1} ``` @@ -46,4 +48,4 @@ Assigns enumerable own properties of `source` objects to the `target` object and ## License -[MIT](http://opensource.org/licenses/MIT) © [Sindre Sorhus](http://sindresorhus.com) +MIT © [Sindre Sorhus](http://sindresorhus.com) diff --git a/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/user-home/cli.js b/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/user-home/cli.js new file mode 100755 index 0000000..bacbd22 --- /dev/null +++ b/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/user-home/cli.js @@ -0,0 +1,26 @@ +#!/usr/bin/env node +'use strict'; +var pkg = require('./package.json'); +var userHome = require('./'); + +function help() { + console.log([ + pkg.description, + '', + 'Example', + ' $ user-home', + ' /Users/sindresorhus' + ].join('\n')); +} + +if (process.argv.indexOf('--help') !== -1) { + help(); + return; +} + +if (process.argv.indexOf('--version') !== -1) { + console.log(pkg.version); + return; +} + +process.stdout.write(userHome); diff --git a/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/user-home/index.js b/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/user-home/index.js new file mode 100644 index 0000000..d53b793 --- /dev/null +++ b/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/user-home/index.js @@ -0,0 +1,15 @@ +'use strict'; +var env = process.env; +var home = env.HOME; +var user = env.LOGNAME || env.USER || env.LNAME || env.USERNAME; + +if (process.platform === 'win32') { + module.exports = env.USERPROFILE || env.HOMEDRIVE + env.HOMEPATH || home || null; +} else if (process.platform === 'darwin') { + module.exports = home || (user ? '/Users/' + user : null) || null; +} else if (process.platform === 'linux') { + module.exports = home || + (user ? (process.getuid() === 0 ? '/root' : '/home/' + user) : null) || null; +} else { + module.exports = home || null; +} diff --git a/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/user-home/license b/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/user-home/license new file mode 100644 index 0000000..654d0bf --- /dev/null +++ b/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/user-home/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/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/user-home/package.json b/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/user-home/package.json new file mode 100644 index 0000000..27df42d --- /dev/null +++ b/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/user-home/package.json @@ -0,0 +1,68 @@ +{ + "name": "user-home", + "version": "1.1.1", + "description": "Get the path to the user home directory", + "license": "MIT", + "repository": { + "type": "git", + "url": "https://github.com/sindresorhus/user-home" + }, + "bin": { + "user-home": "cli.js" + }, + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "http://sindresorhus.com" + }, + "engines": { + "node": ">=0.10.0" + }, + "scripts": { + "test": "node test.js" + }, + "files": [ + "index.js", + "cli.js" + ], + "keywords": [ + "cli", + "bin", + "user", + "home", + "homedir", + "dir", + "directory", + "folder", + "path" + ], + "devDependencies": { + "ava": "0.0.3" + }, + "gitHead": "cf6ba885d3e6bf625fb3c15ad0334fa623968481", + "bugs": { + "url": "https://github.com/sindresorhus/user-home/issues" + }, + "homepage": "https://github.com/sindresorhus/user-home", + "_id": "user-home@1.1.1", + "_shasum": "2b5be23a32b63a7c9deb8d0f28d485724a3df190", + "_from": "user-home@^1.0.0", + "_npmVersion": "2.1.16", + "_nodeVersion": "0.10.32", + "_npmUser": { + "name": "sindresorhus", + "email": "sindresorhus@gmail.com" + }, + "maintainers": [ + { + "name": "sindresorhus", + "email": "sindresorhus@gmail.com" + } + ], + "dist": { + "shasum": "2b5be23a32b63a7c9deb8d0f28d485724a3df190", + "tarball": "http://registry.npmjs.org/user-home/-/user-home-1.1.1.tgz" + }, + "directories": {}, + "_resolved": "https://registry.npmjs.org/user-home/-/user-home-1.1.1.tgz" +} diff --git a/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/user-home/readme.md b/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/user-home/readme.md new file mode 100644 index 0000000..5307a07 --- /dev/null +++ b/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/user-home/readme.md @@ -0,0 +1,42 @@ +# user-home [![Build Status](https://travis-ci.org/sindresorhus/user-home.svg?branch=master)](https://travis-ci.org/sindresorhus/user-home) + +> Get the path to the user home directory + + +## Install + +```sh +$ npm install --save user-home +``` + + +## Usage + +```js +var userHome = require('user-home'); + +console.log(userHome); +//=> /Users/sindresorhus +``` + +Returns `null` in the unlikely scenario that the home directory can't be found. + + +## CLI + +```sh +$ npm install --global user-home +``` + +```sh +$ user-home --help + +Example + $ user-home + /Users/sindresorhus +``` + + +## License + +MIT © [Sindre Sorhus](http://sindresorhus.com) diff --git a/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/uuid/benchmark/package.json b/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/uuid/benchmark/package.json index aa1a421..94e0b59 100644 --- a/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/uuid/benchmark/package.json +++ b/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/uuid/benchmark/package.json @@ -3,7 +3,7 @@ "private": true, "description": "Benchmarks for node-uuid", "dependencies": { - "uuid": "^1.4.1", - "uuid-js": "^0.7.4" + "uuid": "1.4.1", + "uuid-js": "0.7.4" } } diff --git a/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/uuid/buffer-browser.js b/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/uuid/buffer-browser.js deleted file mode 100644 index f5a9358..0000000 --- a/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/uuid/buffer-browser.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = Array; diff --git a/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/uuid/buffer.js b/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/uuid/buffer.js deleted file mode 100644 index 66c989c..0000000 --- a/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/uuid/buffer.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = Buffer; diff --git a/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/uuid/package.json b/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/uuid/package.json index 58c1d74..1487ff7 100644 --- a/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/uuid/package.json +++ b/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/uuid/package.json @@ -1,6 +1,6 @@ { "name": "uuid", - "version": "1.4.2", + "version": "2.0.1", "description": "Rigorous implementation of RFC4122 (v1 and v4) UUIDs.", "keywords": [ "uuid", @@ -29,8 +29,7 @@ "test": "mocha test/test.js" }, "browser": { - "./rng.js": "./rng-browser.js", - "./buffer.js": "./buffer-browser.js" + "./rng.js": "./rng-browser.js" }, "repository": { "type": "git", @@ -46,14 +45,14 @@ "harness": "mocha-tdd", "files": "test/*.js" }, - "gitHead": "688730efe3ec3ab7c12c6b92db2aa2826a50ed14", + "gitHead": "ddaf90942095f26ee8c1961b4346f093b3e7eb5b", "bugs": { "url": "https://github.com/shtylman/node-uuid/issues" }, "homepage": "https://github.com/shtylman/node-uuid", - "_id": "uuid@1.4.2", - "_shasum": "453019f686966a6df83cdc5244e7c990ecc332fc", - "_from": "uuid@~1.4.1", + "_id": "uuid@2.0.1", + "_shasum": "c2a30dedb3e535d72ccf82e343941a50ba8533ac", + "_from": "uuid@^2.0.1", "_npmVersion": "2.0.0", "_npmUser": { "name": "vvo", @@ -78,9 +77,9 @@ } ], "dist": { - "shasum": "453019f686966a6df83cdc5244e7c990ecc332fc", - "tarball": "http://registry.npmjs.org/uuid/-/uuid-1.4.2.tgz" + "shasum": "c2a30dedb3e535d72ccf82e343941a50ba8533ac", + "tarball": "http://registry.npmjs.org/uuid/-/uuid-2.0.1.tgz" }, "directories": {}, - "_resolved": "https://registry.npmjs.org/uuid/-/uuid-1.4.2.tgz" + "_resolved": "https://registry.npmjs.org/uuid/-/uuid-2.0.1.tgz" } diff --git a/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/uuid/uuid.js b/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/uuid/uuid.js index f037bd4..be5bfed 100644 --- a/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/uuid/uuid.js +++ b/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/uuid/uuid.js @@ -8,11 +8,6 @@ // returns 128-bits of randomness, since that's what's usually required var _rng = require('./rng'); -// Buffer class to use, -// we can't use `Buffer || Array` otherwise Buffer would be -// shimmed by browserify and added to the browser build -var BufferClass = require('./buffer'); - // Maps for number <-> hex string conversion var _byteToHex = []; var _hexToByte = {}; @@ -157,7 +152,7 @@ function v4(options, buf, offset) { var i = buf && offset || 0; if (typeof(options) == 'string') { - buf = options == 'binary' ? new BufferClass(16) : null; + buf = options == 'binary' ? new Array(16) : null; options = null; } options = options || {}; @@ -184,6 +179,5 @@ uuid.v1 = v1; uuid.v4 = v4; uuid.parse = parse; uuid.unparse = unparse; -uuid.BufferClass = BufferClass; module.exports = uuid; diff --git a/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/xdg-basedir/index.js b/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/xdg-basedir/index.js new file mode 100644 index 0000000..cb06b28 --- /dev/null +++ b/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/xdg-basedir/index.js @@ -0,0 +1,26 @@ +'use strict'; +var path = require('path'); +var userHome = require('user-home'); +var env = process.env; + +exports.data = env.XDG_DATA_HOME || + (userHome ? path.join(userHome, '.local', 'share') : null); + +exports.config = env.XDG_CONFIG_HOME || + (userHome ? path.join(userHome, '.config') : null); + +exports.cache = env.XDG_CONFIG_HOME || (userHome ? path.join(userHome, '.cache') : null); + +exports.runtime = env.XDG_RUNTIME_DIR || null; + +exports.dataDirs = (env.XDG_DATA_DIRS || '/usr/local/share/:/usr/share/').split(':'); + +if (exports.data) { + exports.dataDirs.unshift(exports.data); +} + +exports.configDirs = (env.XDG_CONFIG_DIRS || '/etc/xdg').split(':'); + +if (exports.config) { + exports.configDirs.unshift(exports.config); +} diff --git a/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/xdg-basedir/license b/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/xdg-basedir/license new file mode 100644 index 0000000..654d0bf --- /dev/null +++ b/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/xdg-basedir/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/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/xdg-basedir/package.json b/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/xdg-basedir/package.json new file mode 100644 index 0000000..78be3d1 --- /dev/null +++ b/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/xdg-basedir/package.json @@ -0,0 +1,68 @@ +{ + "name": "xdg-basedir", + "version": "1.0.1", + "description": "Get XDG Base Directory paths", + "license": "MIT", + "repository": { + "type": "git", + "url": "https://github.com/sindresorhus/xdg-basedir" + }, + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "http://sindresorhus.com" + }, + "engines": { + "node": ">=0.10.0" + }, + "scripts": { + "test": "node test.js" + }, + "files": [ + "index.js" + ], + "keywords": [ + "xdg", + "base", + "directory", + "dir", + "basedir", + "path", + "data", + "config", + "cache" + ], + "dependencies": { + "user-home": "^1.0.0" + }, + "devDependencies": { + "ava": "0.0.4", + "require-uncached": "^1.0.2" + }, + "gitHead": "2eaf176e5d0c9c1bd64e6fc8a60a3a8e3dba4e79", + "bugs": { + "url": "https://github.com/sindresorhus/xdg-basedir/issues" + }, + "homepage": "https://github.com/sindresorhus/xdg-basedir", + "_id": "xdg-basedir@1.0.1", + "_shasum": "14ff8f63a4fdbcb05d5b6eea22b36f3033b9f04e", + "_from": "xdg-basedir@^1.0.0", + "_npmVersion": "2.1.16", + "_nodeVersion": "0.10.32", + "_npmUser": { + "name": "sindresorhus", + "email": "sindresorhus@gmail.com" + }, + "maintainers": [ + { + "name": "sindresorhus", + "email": "sindresorhus@gmail.com" + } + ], + "dist": { + "shasum": "14ff8f63a4fdbcb05d5b6eea22b36f3033b9f04e", + "tarball": "http://registry.npmjs.org/xdg-basedir/-/xdg-basedir-1.0.1.tgz" + }, + "directories": {}, + "_resolved": "https://registry.npmjs.org/xdg-basedir/-/xdg-basedir-1.0.1.tgz" +} diff --git a/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/xdg-basedir/readme.md b/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/xdg-basedir/readme.md new file mode 100644 index 0000000..af3a8ba --- /dev/null +++ b/node_modules/bower/node_modules/update-notifier/node_modules/configstore/node_modules/xdg-basedir/readme.md @@ -0,0 +1,60 @@ +# xdg-basedir [![Build Status](https://travis-ci.org/sindresorhus/xdg-basedir.svg?branch=master)](https://travis-ci.org/sindresorhus/xdg-basedir) + +> Get [XDG Base Directory](http://standards.freedesktop.org/basedir-spec/basedir-spec-latest.html) paths + + +## Install + +```sh +$ npm install --save xdg-basedir +``` + + +## Usage + +```js +var xdgBasedir = require('xdg-basedir'); + +xdgBasedir.data; +//=> /home/sindresorhus/.local/share + +xdgBasedir.config; +//=> /home/sindresorhus/.config + +xdgBasedir.dataDirs +//=> ['/home/sindresorhus/.local/share', '/usr/local/share/', '/usr/share/'] +``` + + +## API + +The properties `.data`, `.config`, `.cache`, `.runtime` will return `null` in the uncommon case that both the XDG environment variable is not set and the users home directory can't be found. You need to handle this case. A common solution is to [fall back to a temp directory](https://github.com/yeoman/configstore/blob/b82690fc401318ad18dcd7d151a0003a4898a314/index.js#L15). + +### .data + +Directory for user specific data files. + +### .config + +Directory for user specific configuration files. + +### .cache + +Directory for user specific non-essential data files. + +### .runtime + +Directory for user-specific non-essential runtime files and other file objects (such as sockets, named pipes, etc). + +### .dataDirs + +Preference-ordered array of base directories to search for data files in addition to `.data`. + +### .configDirs + +Preference-ordered array of base directories to search for configuration files in addition to `.config`. + + +## License + +MIT © [Sindre Sorhus](http://sindresorhus.com) diff --git a/node_modules/bower/node_modules/update-notifier/node_modules/configstore/package.json b/node_modules/bower/node_modules/update-notifier/node_modules/configstore/package.json index 24ff9d0..3a6eda3 100644 --- a/node_modules/bower/node_modules/update-notifier/node_modules/configstore/package.json +++ b/node_modules/bower/node_modules/update-notifier/node_modules/configstore/package.json @@ -1,6 +1,6 @@ { "name": "configstore", - "version": "0.3.1", + "version": "0.3.2", "description": "Easily load and save config without having to think about where and how", "keywords": [ "conf", @@ -17,10 +17,9 @@ "email": "sindresorhus@gmail.com", "url": "http://sindresorhus.com" }, - "main": "configstore.js", "repository": { "type": "git", - "url": "git://github.com/yeoman/configstore" + "url": "https://github.com/yeoman/configstore" }, "scripts": { "test": "mocha" @@ -30,30 +29,33 @@ }, "license": "BSD", "dependencies": { - "graceful-fs": "~3.0.1", - "js-yaml": "~3.0.1", - "mkdirp": "~0.5.0", - "object-assign": "~0.3.1", - "osenv": "~0.1.0", - "uuid": "~1.4.1" + "graceful-fs": "^3.0.1", + "js-yaml": "^3.1.0", + "mkdirp": "^0.5.0", + "object-assign": "^2.0.0", + "osenv": "^0.1.0", + "user-home": "^1.0.0", + "uuid": "^2.0.1", + "xdg-basedir": "^1.0.0" }, "devDependencies": { "mocha": "*" }, "files": [ - "configstore.js" + "index.js" ], + "gitHead": "b82690fc401318ad18dcd7d151a0003a4898a314", "bugs": { "url": "https://github.com/yeoman/configstore/issues" }, "homepage": "https://github.com/yeoman/configstore", - "_id": "configstore@0.3.1", - "_shasum": "e1b4715994fe5f8e22e69b21d54c7a448339314d", - "_from": "configstore@^0.3.1", - "_npmVersion": "1.4.9", + "_id": "configstore@0.3.2", + "_shasum": "25e4c16c3768abf75c5a65bc61761f495055b459", + "_from": "configstore@^0.3.0", + "_npmVersion": "1.4.23", "_npmUser": { - "name": "sindresorhus", - "email": "sindresorhus@gmail.com" + "name": "addyosmani", + "email": "addyosmani@gmail.com" }, "maintainers": [ { @@ -82,10 +84,9 @@ } ], "dist": { - "shasum": "e1b4715994fe5f8e22e69b21d54c7a448339314d", - "tarball": "http://registry.npmjs.org/configstore/-/configstore-0.3.1.tgz" + "shasum": "25e4c16c3768abf75c5a65bc61761f495055b459", + "tarball": "http://registry.npmjs.org/configstore/-/configstore-0.3.2.tgz" }, "directories": {}, - "_resolved": "https://registry.npmjs.org/configstore/-/configstore-0.3.1.tgz", - "readme": "ERROR: No README data found!" + "_resolved": "https://registry.npmjs.org/configstore/-/configstore-0.3.2.tgz" } diff --git a/node_modules/bower/node_modules/update-notifier/node_modules/configstore/readme.md b/node_modules/bower/node_modules/update-notifier/node_modules/configstore/readme.md index 1d94848..28005b7 100644 --- a/node_modules/bower/node_modules/update-notifier/node_modules/configstore/readme.md +++ b/node_modules/bower/node_modules/update-notifier/node_modules/configstore/readme.md @@ -1,11 +1,11 @@ # configstore [![Build Status](https://secure.travis-ci.org/yeoman/configstore.svg?branch=master)](http://travis-ci.org/yeoman/configstore) -Easily load and persist config without having to think about where and how. +> Easily load and persist config without having to think about where and how. Config is stored in a YAML file to make it simple for users to edit the config directly themselves. The file is located in `$XDG_CONFIG_HOME` or `~/.config`. Eg: `~/.config/configstore/id-of-your-choosing.yml` -## Example usage +## Usage ```js var Configstore = require('configstore'); diff --git a/node_modules/bower/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json/node_modules/registry-url/node_modules/npmconf/node_modules/inherits/package.json b/node_modules/bower/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json/node_modules/registry-url/node_modules/npmconf/node_modules/inherits/package.json index 837558d..3d69f4f 100644 --- a/node_modules/bower/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json/node_modules/registry-url/node_modules/npmconf/node_modules/inherits/package.json +++ b/node_modules/bower/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json/node_modules/registry-url/node_modules/npmconf/node_modules/inherits/package.json @@ -32,7 +32,7 @@ "shasum": "b17d08d326b4423e568eff719f91b0b1cbdf69f1", "tarball": "http://registry.npmjs.org/inherits/-/inherits-2.0.1.tgz" }, - "_from": "inherits@~2.0.0", + "_from": "inherits@~2.0.1", "_npmVersion": "1.3.8", "_npmUser": { "name": "isaacs", diff --git a/node_modules/bower/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json/node_modules/registry-url/node_modules/npmconf/node_modules/ini/LICENSE b/node_modules/bower/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json/node_modules/registry-url/node_modules/npmconf/node_modules/ini/LICENSE index 05a4010..19129e3 100644 --- a/node_modules/bower/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json/node_modules/registry-url/node_modules/npmconf/node_modules/ini/LICENSE +++ b/node_modules/bower/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json/node_modules/registry-url/node_modules/npmconf/node_modules/ini/LICENSE @@ -1,23 +1,15 @@ -Copyright 2009, 2010, 2011 Isaac Z. Schlueter. -All rights reserved. +The ISC License -Permission is hereby granted, free of charge, to any person -obtaining a copy of this software and associated documentation -files (the "Software"), to deal in the Software without -restriction, including without limitation the rights to use, -copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the -Software is furnished to do so, subject to the following -conditions: +Copyright (c) Isaac Z. Schlueter and Contributors -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. +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", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES -OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT -HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, -WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -OTHER DEALINGS IN THE SOFTWARE. +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR +IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/node_modules/bower/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json/node_modules/registry-url/node_modules/npmconf/node_modules/ini/ini.js b/node_modules/bower/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json/node_modules/registry-url/node_modules/npmconf/node_modules/ini/ini.js index 1e232e7..ddf5bd9 100644 --- a/node_modules/bower/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json/node_modules/registry-url/node_modules/npmconf/node_modules/ini/ini.js +++ b/node_modules/bower/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json/node_modules/registry-url/node_modules/npmconf/node_modules/ini/ini.js @@ -145,7 +145,7 @@ function isQuoted (val) { function safe (val) { return ( typeof val !== "string" - || val.match(/[\r\n]/) + || val.match(/[=\r\n]/) || val.match(/^\[/) || (val.length > 1 && isQuoted(val)) diff --git a/node_modules/bower/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json/node_modules/registry-url/node_modules/npmconf/node_modules/ini/package.json b/node_modules/bower/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json/node_modules/registry-url/node_modules/npmconf/node_modules/ini/package.json index c3c27a4..8117f28 100644 --- a/node_modules/bower/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json/node_modules/registry-url/node_modules/npmconf/node_modules/ini/package.json +++ b/node_modules/bower/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json/node_modules/registry-url/node_modules/npmconf/node_modules/ini/package.json @@ -6,7 +6,7 @@ }, "name": "ini", "description": "An ini encoder/decoder for node", - "version": "1.3.0", + "version": "1.3.3", "repository": { "type": "git", "url": "git://github.com/isaacs/ini.git" @@ -22,15 +22,17 @@ "devDependencies": { "tap": "~0.4.0" }, - "gitHead": "6c314944d0201f3199e1189aeb5687d0aaf1c575", + "license": "ISC", + "gitHead": "566268f1fb8dd3c0f7d968091de7b7fb2b97b483", "bugs": { "url": "https://github.com/isaacs/ini/issues" }, "homepage": "https://github.com/isaacs/ini", - "_id": "ini@1.3.0", - "_shasum": "625483e56c643a7721014c76604d3353f44bd429", + "_id": "ini@1.3.3", + "_shasum": "c07e34aef1de06aff21d413b458e52b21533a11e", "_from": "ini@^1.2.0", - "_npmVersion": "2.0.0", + "_npmVersion": "2.5.1", + "_nodeVersion": "1.1.0", "_npmUser": { "name": "isaacs", "email": "i@izs.me" @@ -42,9 +44,9 @@ } ], "dist": { - "shasum": "625483e56c643a7721014c76604d3353f44bd429", - "tarball": "http://registry.npmjs.org/ini/-/ini-1.3.0.tgz" + "shasum": "c07e34aef1de06aff21d413b458e52b21533a11e", + "tarball": "http://registry.npmjs.org/ini/-/ini-1.3.3.tgz" }, "directories": {}, - "_resolved": "https://registry.npmjs.org/ini/-/ini-1.3.0.tgz" + "_resolved": "https://registry.npmjs.org/ini/-/ini-1.3.3.tgz" } diff --git a/node_modules/bower/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json/node_modules/registry-url/node_modules/npmconf/node_modules/ini/test/fixtures/foo.ini b/node_modules/bower/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json/node_modules/registry-url/node_modules/npmconf/node_modules/ini/test/fixtures/foo.ini index 27555e9..fc2080f 100644 --- a/node_modules/bower/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json/node_modules/registry-url/node_modules/npmconf/node_modules/ini/test/fixtures/foo.ini +++ b/node_modules/bower/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json/node_modules/registry-url/node_modules/npmconf/node_modules/ini/test/fixtures/foo.ini @@ -29,6 +29,8 @@ ar = this is included br = cold br = warm +eq = "eq=eq" + ; a section [a] av = a val diff --git a/node_modules/bower/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json/node_modules/registry-url/node_modules/npmconf/node_modules/ini/test/foo.js b/node_modules/bower/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json/node_modules/registry-url/node_modules/npmconf/node_modules/ini/test/foo.js index 9d34aa6..58102d1 100644 --- a/node_modules/bower/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json/node_modules/registry-url/node_modules/npmconf/node_modules/ini/test/foo.js +++ b/node_modules/bower/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json/node_modules/registry-url/node_modules/npmconf/node_modules/ini/test/foo.js @@ -18,6 +18,7 @@ var i = require("../") + 'ar[]=three\n' + 'ar[]=this is included\n' + 'br=warm\n' + + 'eq=\"eq=eq\"\n' + '\n' + '[a]\n' + 'av=a val\n' @@ -43,6 +44,7 @@ var i = require("../") 'zr': ['deedee'], 'ar': ['one', 'three', 'this is included'], 'br': 'warm', + 'eq': 'eq=eq', a: { av: 'a val', e: '{ o: p, a: { av: a val, b: { c: { e: "this [value]" } } } }', diff --git a/node_modules/bower/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json/node_modules/registry-url/node_modules/npmconf/package.json b/node_modules/bower/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json/node_modules/registry-url/node_modules/npmconf/package.json index f523126..b513cce 100644 --- a/node_modules/bower/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json/node_modules/registry-url/node_modules/npmconf/package.json +++ b/node_modules/bower/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json/node_modules/registry-url/node_modules/npmconf/package.json @@ -68,5 +68,6 @@ "shasum": "a266c7e5c56695eb7f55caf3a5a7328f24510dae", "tarball": "http://registry.npmjs.org/npmconf/-/npmconf-2.1.1.tgz" }, - "_resolved": "https://registry.npmjs.org/npmconf/-/npmconf-2.1.1.tgz" + "_resolved": "https://registry.npmjs.org/npmconf/-/npmconf-2.1.1.tgz", + "readme": "ERROR: No README data found!" } diff --git a/node_modules/bower/node_modules/update-notifier/package.json b/node_modules/bower/node_modules/update-notifier/package.json index 577daa6..82da51b 100644 --- a/node_modules/bower/node_modules/update-notifier/package.json +++ b/node_modules/bower/node_modules/update-notifier/package.json @@ -88,5 +88,6 @@ "tarball": "http://registry.npmjs.org/update-notifier/-/update-notifier-0.2.0.tgz" }, "directories": {}, - "_resolved": "https://registry.npmjs.org/update-notifier/-/update-notifier-0.2.0.tgz" + "_resolved": "https://registry.npmjs.org/update-notifier/-/update-notifier-0.2.0.tgz", + "readme": "ERROR: No README data found!" } diff --git a/node_modules/bower/node_modules/which/LICENSE b/node_modules/bower/node_modules/which/LICENSE index 05a4010..19129e3 100644 --- a/node_modules/bower/node_modules/which/LICENSE +++ b/node_modules/bower/node_modules/which/LICENSE @@ -1,23 +1,15 @@ -Copyright 2009, 2010, 2011 Isaac Z. Schlueter. -All rights reserved. +The ISC License -Permission is hereby granted, free of charge, to any person -obtaining a copy of this software and associated documentation -files (the "Software"), to deal in the Software without -restriction, including without limitation the rights to use, -copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the -Software is furnished to do so, subject to the following -conditions: +Copyright (c) Isaac Z. Schlueter and Contributors -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. +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", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES -OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT -HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, -WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -OTHER DEALINGS IN THE SOFTWARE. +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR +IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/node_modules/bower/node_modules/which/package.json b/node_modules/bower/node_modules/which/package.json index 4e0981a..40b3178 100644 --- a/node_modules/bower/node_modules/which/package.json +++ b/node_modules/bower/node_modules/which/package.json @@ -6,7 +6,7 @@ }, "name": "which", "description": "Like which(1) unix command. Find the first instance of an executable in the PATH.", - "version": "1.0.5", + "version": "1.0.9", "repository": { "type": "git", "url": "git://github.com/isaacs/node-which.git" @@ -15,39 +15,32 @@ "bin": { "which": "./bin/which" }, - "engines": { - "node": "*" + "license": "ISC", + "gitHead": "df3d52a0ecd5f366d550e0f14d67ca4d5e621bad", + "bugs": { + "url": "https://github.com/isaacs/node-which/issues" }, - "dependencies": {}, - "devDependencies": {}, + "homepage": "https://github.com/isaacs/node-which", + "_id": "which@1.0.9", + "scripts": {}, + "_shasum": "460c1da0f810103d0321a9b633af9e575e64486f", + "_from": "which@1.0.9", + "_npmVersion": "2.6.0", + "_nodeVersion": "1.1.0", "_npmUser": { "name": "isaacs", "email": "i@izs.me" }, - "_id": "which@1.0.5", - "optionalDependencies": {}, - "_engineSupported": true, - "_npmVersion": "1.1.2", - "_nodeVersion": "v0.7.6-pre", - "_defaultsLoaded": true, - "dist": { - "shasum": "5630d6819dda692f1464462e7956cb42c0842739", - "tarball": "http://registry.npmjs.org/which/-/which-1.0.5.tgz" - }, - "readme": "The \"which\" util from npm's guts.\n\nFinds the first instance of a specified executable in the PATH\nenvironment variable. Does not cache the results, so `hash -r` is not\nneeded when the PATH changes.\n", "maintainers": [ { "name": "isaacs", "email": "i@izs.me" } ], - "directories": {}, - "_shasum": "5630d6819dda692f1464462e7956cb42c0842739", - "_from": "which@~1.0.5", - "_resolved": "https://registry.npmjs.org/which/-/which-1.0.5.tgz", - "bugs": { - "url": "https://github.com/isaacs/node-which/issues" + "dist": { + "shasum": "460c1da0f810103d0321a9b633af9e575e64486f", + "tarball": "http://registry.npmjs.org/which/-/which-1.0.9.tgz" }, - "homepage": "https://github.com/isaacs/node-which", - "scripts": {} + "directories": {}, + "_resolved": "https://registry.npmjs.org/which/-/which-1.0.9.tgz" } diff --git a/node_modules/bower/node_modules/which/which.js b/node_modules/bower/node_modules/which/which.js index db7e8f7..2a45417 100644 --- a/node_modules/bower/node_modules/which/which.js +++ b/node_modules/bower/node_modules/which/which.js @@ -5,12 +5,7 @@ var path = require("path") , fs , COLON = process.platform === "win32" ? ";" : ":" , isExe - -try { - fs = require("graceful-fs") -} catch (ex) { - fs = require("fs") -} + , fs = require("fs") if (process.platform == "win32") { // On windows, there is no good way to check that a file is executable @@ -21,7 +16,9 @@ if (process.platform == "win32") { //console.error("isExe?", (mod & 0111).toString(8)) var ret = (mod & 0001) || (mod & 0010) && process.getgid && gid === process.getgid() + || (mod & 0010) && process.getuid && 0 === process.getuid() || (mod & 0100) && process.getuid && uid === process.getuid() + || (mod & 0100) && process.getuid && 0 === process.getuid() //console.error("isExe?", ret) return ret } diff --git a/node_modules/cookie-parser/HISTORY.md b/node_modules/cookie-parser/HISTORY.md index 9b42e8d..36472cd 100644 --- a/node_modules/cookie-parser/HISTORY.md +++ b/node_modules/cookie-parser/HISTORY.md @@ -1,3 +1,8 @@ +1.3.4 / 2015-02-15 +================== + + * deps: cookie-signature@1.0.6 + 1.3.3 / 2014-09-05 ================== diff --git a/node_modules/cookie-parser/README.md b/node_modules/cookie-parser/README.md index 53c483f..4ba9885 100644 --- a/node_modules/cookie-parser/README.md +++ b/node_modules/cookie-parser/README.md @@ -68,11 +68,11 @@ app.listen(8080) ### [MIT Licensed](LICENSE) -[npm-image]: https://img.shields.io/npm/v/cookie-parser.svg?style=flat +[npm-image]: https://img.shields.io/npm/v/cookie-parser.svg [npm-url]: https://npmjs.org/package/cookie-parser -[travis-image]: https://img.shields.io/travis/expressjs/cookie-parser.svg?style=flat +[travis-image]: https://img.shields.io/travis/expressjs/cookie-parser/master.svg [travis-url]: https://travis-ci.org/expressjs/cookie-parser -[coveralls-image]: https://img.shields.io/coveralls/expressjs/cookie-parser.svg?style=flat +[coveralls-image]: https://img.shields.io/coveralls/expressjs/cookie-parser/master.svg [coveralls-url]: https://coveralls.io/r/expressjs/cookie-parser?branch=master -[downloads-image]: https://img.shields.io/npm/dm/cookie-parser.svg?style=flat +[downloads-image]: https://img.shields.io/npm/dm/cookie-parser.svg [downloads-url]: https://npmjs.org/package/cookie-parser diff --git a/node_modules/cookie-parser/node_modules/cookie-signature/History.md b/node_modules/cookie-parser/node_modules/cookie-signature/History.md index 2bbc4b3..78513cc 100644 --- a/node_modules/cookie-parser/node_modules/cookie-signature/History.md +++ b/node_modules/cookie-parser/node_modules/cookie-signature/History.md @@ -1,9 +1,20 @@ +1.0.6 / 2015-02-03 +================== + +* use `npm test` instead of `make test` to run tests +* clearer assertion messages when checking input + + +1.0.5 / 2014-09-05 +================== + +* add license to package.json + 1.0.4 / 2014-06-25 ================== * corrected avoidance of timing attacks (thanks @tenbits!) - 1.0.3 / 2014-01-28 ================== diff --git a/node_modules/cookie-parser/node_modules/cookie-signature/Makefile b/node_modules/cookie-parser/node_modules/cookie-signature/Makefile deleted file mode 100644 index 4e9c8d3..0000000 --- a/node_modules/cookie-parser/node_modules/cookie-signature/Makefile +++ /dev/null @@ -1,7 +0,0 @@ - -test: - @./node_modules/.bin/mocha \ - --require should \ - --reporter spec - -.PHONY: test \ No newline at end of file diff --git a/node_modules/cookie-parser/node_modules/cookie-signature/index.js b/node_modules/cookie-parser/node_modules/cookie-signature/index.js index b63bf84..b8c9463 100644 --- a/node_modules/cookie-parser/node_modules/cookie-signature/index.js +++ b/node_modules/cookie-parser/node_modules/cookie-signature/index.js @@ -14,8 +14,8 @@ var crypto = require('crypto'); */ exports.sign = function(val, secret){ - if ('string' != typeof val) throw new TypeError('cookie required'); - if ('string' != typeof secret) throw new TypeError('secret required'); + if ('string' != typeof val) throw new TypeError("Cookie value must be provided as a string."); + if ('string' != typeof secret) throw new TypeError("Secret string must be provided."); return val + '.' + crypto .createHmac('sha256', secret) .update(val) @@ -34,8 +34,8 @@ exports.sign = function(val, secret){ */ exports.unsign = function(val, secret){ - if ('string' != typeof val) throw new TypeError('cookie required'); - if ('string' != typeof secret) throw new TypeError('secret required'); + if ('string' != typeof val) throw new TypeError("Signed cookie string must be provided."); + if ('string' != typeof secret) throw new TypeError("Secret string must be provided."); var str = val.slice(0, val.lastIndexOf('.')) , mac = exports.sign(str, secret); diff --git a/node_modules/cookie-parser/node_modules/cookie-signature/package.json b/node_modules/cookie-parser/node_modules/cookie-signature/package.json index ac74d61..313f3e7 100644 --- a/node_modules/cookie-parser/node_modules/cookie-signature/package.json +++ b/node_modules/cookie-parser/node_modules/cookie-signature/package.json @@ -1,6 +1,6 @@ { "name": "cookie-signature", - "version": "1.0.5", + "version": "1.0.6", "description": "Sign and unsign cookies", "keywords": [ "cookie", @@ -21,17 +21,20 @@ "mocha": "*", "should": "*" }, + "scripts": { + "test": "mocha --require should --reporter spec" + }, "main": "index", - "gitHead": "73ed69b511b3ef47555d71b4ed1deea9e5ed6e1f", + "gitHead": "391b56cf44d88c493491b7e3fc53208cfb976d2a", "bugs": { "url": "https://github.com/visionmedia/node-cookie-signature/issues" }, "homepage": "https://github.com/visionmedia/node-cookie-signature", - "_id": "cookie-signature@1.0.5", - "scripts": {}, - "_shasum": "a122e3f1503eca0f5355795b0711bb2368d450f9", - "_from": "cookie-signature@1.0.5", - "_npmVersion": "1.4.20", + "_id": "cookie-signature@1.0.6", + "_shasum": "e303a882b342cc3ee8ca513a79999734dab3ae2c", + "_from": "cookie-signature@1.0.6", + "_npmVersion": "2.3.0", + "_nodeVersion": "0.10.36", "_npmUser": { "name": "natevw", "email": "natevw@yahoo.com" @@ -47,9 +50,9 @@ } ], "dist": { - "shasum": "a122e3f1503eca0f5355795b0711bb2368d450f9", - "tarball": "http://registry.npmjs.org/cookie-signature/-/cookie-signature-1.0.5.tgz" + "shasum": "e303a882b342cc3ee8ca513a79999734dab3ae2c", + "tarball": "http://registry.npmjs.org/cookie-signature/-/cookie-signature-1.0.6.tgz" }, "directories": {}, - "_resolved": "https://registry.npmjs.org/cookie-signature/-/cookie-signature-1.0.5.tgz" + "_resolved": "https://registry.npmjs.org/cookie-signature/-/cookie-signature-1.0.6.tgz" } diff --git a/node_modules/cookie-parser/package.json b/node_modules/cookie-parser/package.json index 590635b..105c01d 100644 --- a/node_modules/cookie-parser/package.json +++ b/node_modules/cookie-parser/package.json @@ -1,7 +1,7 @@ { "name": "cookie-parser", "description": "cookie parsing with signatures", - "version": "1.3.3", + "version": "1.3.4", "author": { "name": "TJ Holowaychuk", "email": "tj@vision-media.ca", @@ -18,12 +18,12 @@ ], "dependencies": { "cookie": "0.1.2", - "cookie-signature": "1.0.5" + "cookie-signature": "1.0.6" }, "devDependencies": { - "istanbul": "0.3.2", - "mocha": "~1.21.4", - "supertest": "~0.13.0" + "istanbul": "0.3.5", + "mocha": "~2.1.0", + "supertest": "0.15.0" }, "files": [ "lib/", @@ -39,15 +39,15 @@ "test-cov": "istanbul cover node_modules/mocha/bin/_mocha -- --reporter dot --check-leaks test/", "test-travis": "istanbul cover node_modules/mocha/bin/_mocha --report lcovonly -- --reporter spec --check-leaks test/" }, - "gitHead": "893bf91a8a4e49c63b6e32065991b13a7d27ed4c", + "gitHead": "94764a584c70f26049b14c6ad845c8b0ed0e478b", "bugs": { "url": "https://github.com/expressjs/cookie-parser/issues" }, "homepage": "https://github.com/expressjs/cookie-parser", - "_id": "cookie-parser@1.3.3", - "_shasum": "7e3a2c745f4b460d5a340e578a0baa5d7725fe37", - "_from": "cookie-parser@^1.3.2", - "_npmVersion": "1.4.21", + "_id": "cookie-parser@1.3.4", + "_shasum": "193035a5be97117a21709b3aa737f6132717bda6", + "_from": "cookie-parser@1.3.4", + "_npmVersion": "1.4.28", "_npmUser": { "name": "dougwilson", "email": "doug@somethingdoug.com" @@ -63,9 +63,9 @@ } ], "dist": { - "shasum": "7e3a2c745f4b460d5a340e578a0baa5d7725fe37", - "tarball": "http://registry.npmjs.org/cookie-parser/-/cookie-parser-1.3.3.tgz" + "shasum": "193035a5be97117a21709b3aa737f6132717bda6", + "tarball": "http://registry.npmjs.org/cookie-parser/-/cookie-parser-1.3.4.tgz" }, "directories": {}, - "_resolved": "https://registry.npmjs.org/cookie-parser/-/cookie-parser-1.3.3.tgz" + "_resolved": "https://registry.npmjs.org/cookie-parser/-/cookie-parser-1.3.4.tgz" } diff --git a/node_modules/cookie-session/HISTORY.md b/node_modules/cookie-session/HISTORY.md new file mode 100644 index 0000000..be89d03 --- /dev/null +++ b/node_modules/cookie-session/HISTORY.md @@ -0,0 +1,22 @@ +1.1.0 / 2014-11-09 +================== + + * Fix errors setting cookies to be non-fatal + * Use `on-headers` instead of `writeHead` patching + * deps: cookies@0.5.0 + * deps: debug@~2.1.0 + +1.0.2 / 2014-05-07 +================== + + * Add `name` option + +1.0.1 / 2014-02-24 +================== + + * Fix duplicate `dependencies` in `package.json` + +1.0.0 / 2014-02-23 +================== + + * Initial release diff --git a/node_modules/cookie-session/LICENSE b/node_modules/cookie-session/LICENSE new file mode 100644 index 0000000..a53a533 --- /dev/null +++ b/node_modules/cookie-session/LICENSE @@ -0,0 +1,22 @@ +(The MIT License) + +Copyright (c) 2013 Jonathan Ong + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +'Software'), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/cookie-session/Readme.md b/node_modules/cookie-session/Readme.md index fdeb1e6..2ec3c2a 100644 --- a/node_modules/cookie-session/Readme.md +++ b/node_modules/cookie-session/Readme.md @@ -1,4 +1,10 @@ -# cookie-session [![Build Status](https://travis-ci.org/expressjs/cookie-session.svg)](https://travis-ci.org/expressjs/cookie-session) [![NPM version](https://badge.fury.io/js/cookie-session.svg)](http://badge.fury.io/js/cookie-session) +# cookie-session + +[![NPM Version][npm-image]][npm-url] +[![NPM Downloads][downloads-image]][downloads-url] +[![Build Status][travis-image]][travis-url] +[![Test Coverage][coveralls-image]][coveralls-url] +[![Gratipay][gratipay-image]][gratipay-url] Simple cookie-based session middleware. @@ -8,6 +14,12 @@ authenticated or not. If a session is _new_ a `Set-Cookie` will be produced regardless of populating the session. +## Install + +```bash +$ npm install cookie-session +``` + ## API View counter example: @@ -18,9 +30,10 @@ var session = require('cookie-session') var app = express() +app.set('trust proxy', 1) // trust first proxy + app.use(session({ - keys: ['key1', 'key2'], - secureProxy: true // if you do SSL outside of node + keys: ['key1', 'key2'] })) app.use(function (req, res, next) { @@ -44,17 +57,17 @@ app.listen(3000) #### Cookie Options - - `maxage` - a number representing the milliseconds from `Date.now()` for expiry. - - `expires` - a `Date` object indicating the cookie's expiration date (expires at the end of session by default). - - `path` - a string indicating the path of the cookie (`/` by default). - - `domain` - a string indicating the domain of the cookie (no default). - - `secure` - a boolean indicating whether the cookie is only to be sent over HTTPS (`false` by default for HTTP, `true` by default for HTTPS). - - `secureProxy` - a boolean indicating whether the cookie is only to be sent over HTTPS (use this if you handle SSL outside your node process). - - `httpOnly` - a boolean indicating whether the cookie is only to be sent over HTTP(S), and not made available to client JavaScript (`true` by default). - - `signed` - a boolean indicating whether the cookie is to be signed (`true` by default). If this is true, another cookie of the same name with the `.sig` suffix appended will also be sent, with a 27-byte url-safe base64 SHA1 value representing the hash of _cookie-name_=_cookie-value_ against the first [Keygrip](https://github.com/jed/keygrip) key. This signature key is used to detect tampering the next time a cookie is received. - - `overwrite` - a boolean indicating whether to overwrite previously set cookies of the same name (`true` by default). If this is true, all cookies set during the same request with the same name (regardless of path or domain) are filtered out of the Set-Cookie header when setting this cookie. +The options can also contain any of the follow (for the full list, see [cookies module documentation](https://www.npmjs.org/package/cookies#readme): - Read more here: https://github.com/jed/cookies + - `maxAge`: a number representing the milliseconds from `Date.now()` for expiry + - `expires`: a `Date` object indicating the cookie's expiration date (expires at the end of session by default). + - `path`: a string indicating the path of the cookie (`/` by default). + - `domain`: a string indicating the domain of the cookie (no default). + - `secure`: a boolean indicating whether the cookie is only to be sent over HTTPS (`false` by default for HTTP, `true` by default for HTTPS). + - `secureProxy`: a boolean indicating whether the cookie is only to be sent over HTTPS (use this if you handle SSL not in your node process). + - `httpOnly`: a boolean indicating whether the cookie is only to be sent over HTTP(S), and not made available to client JavaScript (`true` by default). + - `signed`: a boolean indicating whether the cookie is to be signed (`false` by default). If this is true, another cookie of the same name with the `.sig` suffix appended will also be sent, with a 27-byte url-safe base64 SHA1 value representing the hash of _cookie-name_=_cookie-value_ against the first [Keygrip](https://github.com/expressjs/keygrip) key. This signature key is used to detect tampering the next time a cookie is received. + - `overwrite`: a boolean indicating whether to overwrite previously set cookies of the same name (`false` by default). If this is true, all cookies set during the same request with the same name (regardless of path or domain) are filtered out of the Set-Cookie header when setting this cookie. ### Session.isNew @@ -70,24 +83,15 @@ req.session = null ## License -The MIT License (MIT) - -Copyright (c) 2013 Jonathan Ong me@jongleberry.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. +[MIT](LICENSE) + +[npm-image]: https://img.shields.io/npm/v/cookie-session.svg?style=flat +[npm-url]: https://npmjs.org/package/cookie-session +[travis-image]: https://img.shields.io/travis/expressjs/cookie-session.svg?style=flat +[travis-url]: https://travis-ci.org/expressjs/cookie-session +[coveralls-image]: https://img.shields.io/coveralls/expressjs/cookie-session.svg?style=flat +[coveralls-url]: https://coveralls.io/r/expressjs/cookie-session?branch=master +[downloads-image]: https://img.shields.io/npm/dm/cookie-session.svg?style=flat +[downloads-url]: https://npmjs.org/package/cookie-session +[gratipay-image]: https://img.shields.io/gratipay/dougwilson.svg?style=flat +[gratipay-url]: https://www.gratipay.com/dougwilson/ diff --git a/node_modules/cookie-session/index.js b/node_modules/cookie-session/index.js index 14731e3..6218fa7 100644 --- a/node_modules/cookie-session/index.js +++ b/node_modules/cookie-session/index.js @@ -1,18 +1,25 @@ + /** * Module dependencies. + * @private */ var debug = require('debug')('cookie-session'); var Cookies = require('cookies'); +var onHeaders = require('on-headers'); /** - * Initialize session middleware with options. - * - * See README.md for documentation of options. + * Create a new cookie session middleware. * - * @param {Object} [opts] - * @return {Function} middleware - * @api public + * @param {object} [opts] + * @param {boolean} [opts.httpOnly] + * @param {array} [opts.keys] + * @param {string} [opts.name=express:sess] Name of the cookie to use + * @param {boolean} [opts.overwrite] + * @param {string} [opts.secret] + * @param {boolean} [opts.signed] + * @return {function} middleware + * @public */ module.exports = function(opts){ @@ -78,21 +85,26 @@ module.exports = function(opts){ throw new Error('req.session can only be set as null or an object.'); }); - var writeHead = res.writeHead; - res.writeHead = function () { - if (undefined === sess) { + onHeaders(res, function setHeaders() { + if (sess === undefined) { // not accessed - } else if (false === sess) { - // remove - cookies.set(name, '', opts); - } else if (!json && !sess.length) { - // do nothing if new and not populated - } else if (sess.changed(json)) { - // save - sess.save(); + return; } - writeHead.apply(res, arguments); - } + + try { + if (sess === false) { + // remove + cookies.set(name, '', opts); + } else if (!json && !sess.length) { + // do nothing if new and not populated + } else if (sess.changed(json)) { + // save + sess.save(); + } + } catch (e) { + debug('error saving session %s', e.message); + } + }); next(); } @@ -139,7 +151,7 @@ Session.prototype.toJSON = function(){ * * @param {String} [prev] * @return {Boolean} - * @api private + * @private */ Session.prototype.changed = function(prev){ @@ -153,7 +165,7 @@ Session.prototype.changed = function(prev){ * Used to see if it's "populated". * * @return {Number} - * @api public + * @public */ Session.prototype.__defineGetter__('length', function(){ @@ -164,7 +176,7 @@ Session.prototype.__defineGetter__('length', function(){ * populated flag, which is just a boolean alias of .length. * * @return {Boolean} - * @api public + * @public */ Session.prototype.__defineGetter__('populated', function(){ @@ -172,10 +184,9 @@ Session.prototype.__defineGetter__('populated', function(){ }); /** - * Save session changes by - * performing a Set-Cookie. + * Save session changes by performing a Set-Cookie. * - * @api private + * @private */ Session.prototype.save = function(){ @@ -193,7 +204,7 @@ Session.prototype.save = function(){ * * @param {String} string * @return {Object} - * @api private + * @private */ function decode(string) { @@ -206,7 +217,7 @@ function decode(string) { * * @param {Object} body * @return {String} - * @api private + * @private */ function encode(body) { diff --git a/node_modules/cookie-session/node_modules/cookies/.npmignore b/node_modules/cookie-session/node_modules/cookies/.npmignore index 3c3629e..ac0bfb9 100644 --- a/node_modules/cookie-session/node_modules/cookies/.npmignore +++ b/node_modules/cookie-session/node_modules/cookies/.npmignore @@ -1 +1,2 @@ -node_modules +test/ +.travis.yml diff --git a/node_modules/cookie-session/node_modules/cookies/History.md b/node_modules/cookie-session/node_modules/cookies/History.md index 4663729..9fbdaac 100644 --- a/node_modules/cookie-session/node_modules/cookies/History.md +++ b/node_modules/cookie-session/node_modules/cookies/History.md @@ -1,5 +1,56 @@ +0.5.0 / 2014-07-27 +================== + + * Integrate with `req.protocol` for secure cookies + * Support `maxAge` as well as `maxage` + +0.4.1 / 2014-05-07 +================== + + * Update package for repo move 0.4.0 / 2014-01-31 ================== - * added: allow passing an array of strings as keys + * Allow passing an array of strings as keys + +0.3.8-0.2.0 +=========== + + * TODO: write down history for these releases + +0.1.6 / 2011-03-01 +================== + + * SSL cookies secure by default + * Use httpOnly by default unless explicitly false + +0.1.5 / 2011-02-26 +================== + + * Delete sig cookie if signed cookie is deleted + +0.1.4 / 2011-02-26 +================== + + * Always set path + +0.1.3 / 2011-02-26 +================== + + * Add sensible defaults for path + +0.1.2 / 2011-02-26 +================== + + * Inherit cookie properties to signature cookie + +0.1.1 / 2011-02-25 +================== + + * Readme updates + +0.1.0 / 2011-02-25 +================== + + * Initial release diff --git a/node_modules/cookie-session/node_modules/cookies/README.md b/node_modules/cookie-session/node_modules/cookies/README.md index 32311f7..951a377 100644 --- a/node_modules/cookie-session/node_modules/cookies/README.md +++ b/node_modules/cookie-session/node_modules/cookies/README.md @@ -1,7 +1,8 @@ Cookies ======= -[![Build Status](https://secure.travis-ci.org/expressjs/cookies.png)](http://travis-ci.org/expressjs/cookies) +[![NPM Version](https://badge.fury.io/js/cookies.svg)](https://badge.fury.io/js/cookies) +[![Build Status](https://travis-ci.org/expressjs/cookies.svg?branch=master)](https://travis-ci.org/expressjs/cookies) Cookies is a [node.js](http://nodejs.org/) module for getting and setting HTTP(S) cookies. Cookies can be signed to prevent tampering, using [Keygrip](https://github.com/expressjs/keygrip). It can be used with the built-in node.js HTTP library, or as Connect/Express middleware. @@ -55,7 +56,7 @@ If the _value_ is omitted, an outbound header with an expired date is used to de If the _options_ object is provided, it will be used to generate the outbound cookie header as follows: -* `maxage`: a number representing the milliseconds from `Date.now()` for expiry +* `maxAge`: a number representing the milliseconds from `Date.now()` for expiry * `expires`: a `Date` object indicating the cookie's expiration date (expires at the end of session by default). * `path`: a string indicating the path of the cookie (`/` by default). * `domain`: a string indicating the domain of the cookie (no default). diff --git a/node_modules/cookie-session/node_modules/cookies/lib/cookies.js b/node_modules/cookie-session/node_modules/cookies/lib/cookies.js index c1b615b..6f67a36 100644 --- a/node_modules/cookie-session/node_modules/cookies/lib/cookies.js +++ b/node_modules/cookie-session/node_modules/cookies/lib/cookies.js @@ -51,13 +51,15 @@ Cookies.prototype = { var res = this.response , req = this.request , headers = res.getHeader("Set-Cookie") || [] - , secure = req.connection.encrypted + , secure = req.protocol === 'https' || req.connection.encrypted , cookie = new Cookie(name, value, opts) , signed = opts && opts.signed !== undefined ? opts.signed : !!this.keys if (typeof headers == "string") headers = [headers] - if (!secure && opts && opts.secure) throw new Error("Cannot send secure cookie over unencrypted socket") + if (!secure && opts && opts.secure) { + throw new Error('Cannot send secure cookie over unencrypted connection') + } cookie.secure = secure if (opts && "secure" in opts) cookie.secure = opts.secure @@ -101,7 +103,7 @@ Cookie.prototype = { toHeader: function() { var header = this.toString() - if (this.maxage) this.expires = new Date(Date.now() + this.maxage); + if (this.maxAge) this.expires = new Date(Date.now() + this.maxAge); if (this.path ) header += "; path=" + this.path if (this.expires ) header += "; expires=" + this.expires.toUTCString() @@ -113,6 +115,14 @@ Cookie.prototype = { } } +// back-compat so maxage mirrors maxAge +Object.defineProperty(Cookie.prototype, 'maxage', { + configurable: true, + enumerable: true, + get: function () { return this.maxAge }, + set: function (val) { return this.maxAge = val } +}); + function getPattern(name) { if (cache[name]) return cache[name] diff --git a/node_modules/cookie-session/node_modules/cookies/package.json b/node_modules/cookie-session/node_modules/cookies/package.json index 4e65626..34c692c 100644 --- a/node_modules/cookie-session/node_modules/cookies/package.json +++ b/node_modules/cookie-session/node_modules/cookies/package.json @@ -1,6 +1,6 @@ { "name": "cookies", - "version": "0.4.1", + "version": "0.5.0", "description": "Cookies, optionally signed using Keygrip.", "main": "./lib/cookies", "dependencies": { @@ -8,44 +8,40 @@ }, "devDependencies": { "express": "*", - "restify": "*" + "restify": "*", + "supertest": "0", + "mocha": "1" }, - "licenses": [ - { - "type": "MIT", - "url": "https://raw.github.com/expressjs/cookies/master/LICENSE.txt" - } - ], "engines": { - "node": ">= 0.6.0" + "node": ">= 0.8.0" }, + "license": "MIT", "author": { "name": "Jed Schmidt", "email": "tr@nslator.jp", "url": "http://jed.is" }, - "homepage": "https://github.com/expressjs/cookies", "repository": { "type": "git", - "url": "git://github.com/expressjs/cookies.git" + "url": "git://github.com/expressjs/cookies" }, "scripts": { - "test": "node ./test/http.js && node ./test/express.js && node ./test/restify.js" + "test": "mocha --reporter spec" }, - "optionalDependencies": {}, "bugs": { "url": "https://github.com/expressjs/cookies/issues" }, - "_id": "cookies@0.4.1", + "homepage": "https://github.com/expressjs/cookies", + "_id": "cookies@0.5.0", "dist": { - "shasum": "7d43bd00583c985acc032258b97988b7d03b629e", - "tarball": "http://registry.npmjs.org/cookies/-/cookies-0.4.1.tgz" + "shasum": "164cac46a1d3ca3b3b87427414c24931d8381025", + "tarball": "http://registry.npmjs.org/cookies/-/cookies-0.5.0.tgz" }, - "_from": "cookies@~0.4.0", + "_from": "cookies@0.5.0", "_npmVersion": "1.4.3", "_npmUser": { - "name": "jed", - "email": "where@jed.is" + "name": "dougwilson", + "email": "doug@somethingdoug.com" }, "maintainers": [ { @@ -70,7 +66,6 @@ } ], "directories": {}, - "_shasum": "7d43bd00583c985acc032258b97988b7d03b629e", - "_resolved": "https://registry.npmjs.org/cookies/-/cookies-0.4.1.tgz", - "readme": "ERROR: No README data found!" + "_shasum": "164cac46a1d3ca3b3b87427414c24931d8381025", + "_resolved": "https://registry.npmjs.org/cookies/-/cookies-0.5.0.tgz" } diff --git a/node_modules/cookie-session/node_modules/cookies/test/express.js b/node_modules/cookie-session/node_modules/cookies/test/express.js deleted file mode 100644 index af00870..0000000 --- a/node_modules/cookie-session/node_modules/cookies/test/express.js +++ /dev/null @@ -1,80 +0,0 @@ -#!/usr/bin/env node - -var assert = require( "assert" ) - , express = require( "express" ) - , http = require( "http" ) - , keys = require( "keygrip" )(['a', 'b']) - , cookies = require( "../" ).express - , options = { host: "localhost", port: 8000, path: "/set" } - , app = express.createServer() - -app.use( cookies( keys ) ) - -app.get( "/set", function(req, res) { - res.cookies - // set a regular cookie - .set( "unsigned", "foo", { signed:false, httpOnly: false } ) - - // set a signed cookie - .set( "signed", "bar", { signed: true } ) - - // mimic a signed cookie, but with a bogus signature - .set( "tampered", "baz" ) - .set( "tampered.sig", "bogus" ) - - // set a cookie that will be overwritten - .set( "overwrite", "old-value", { signed: true } ) - .set( "overwrite", "new-value", { overwrite: true, signed: true } ) - - res.writeHead(302, {Location: "/"}) - res.end() -}) - -app.get("/", function(req, res) { - var unsigned = req.cookies.get( "unsigned" ) - , signed = req.cookies.get( "signed", { signed: true } ) - , tampered = req.cookies.get( "tampered", { signed: true } ) - , overwrite = req.cookies.get( "overwrite", { signed: true } ) - - assert.equal( unsigned, "foo" ) - assert.equal( req.cookies.get( "unsigned.sig", { signed:false } ), undefined) - assert.equal( signed, "bar" ) - assert.equal( req.cookies.get( "signed.sig", { signed: false } ), keys.sign('signed=bar') ) - assert.notEqual( tampered, "baz" ) - assert.equal( tampered, undefined ) - assert.equal( overwrite, "new-value" ) - assert.equal( req.cookies.get( "overwrite.sig", { signed:false } ), keys.sign('overwrite=new-value') ) - - assert.equal(res.getHeader('Set-Cookie'), 'tampered.sig=; path=/; expires=Thu, 01 Jan 1970 00:00:00 GMT; httponly') - - res.send( - "unsigned expected: foo\n" + - "unsigned actual: " + unsigned + "\n\n" + - "signed expected: bar\n" + - "signed actual: " + signed + "\n\n" + - "tampered expected: undefined\n"+ - "tampered: " + tampered + "\n" - ) -}) - -var server = require('http').createServer(app); - -server.listen( 8000 ) - -http.get( options, function( res ) { - var header = res.headers[ "set-cookie" ] - , body = "" - - console.log( "\ncookies set:", header ) - console.log( "\n============\n" ) - assert.equal(header.length, 7) - - options.path = res.headers[ "Location" ] - options.headers = { "Cookie": header.join(";") } - - http.get( options, function( res ) { - res.on( "data", function( chunk ){ body += chunk } ) - res.on( "end", function(){ console.log( body ) }) - server.close() - }) -}) diff --git a/node_modules/cookie-session/node_modules/cookies/test/http.js b/node_modules/cookie-session/node_modules/cookies/test/http.js deleted file mode 100644 index 5d1f4f3..0000000 --- a/node_modules/cookie-session/node_modules/cookies/test/http.js +++ /dev/null @@ -1,79 +0,0 @@ -#!/usr/bin/env node - -var assert = require( "assert" ) - , http = require( "http" ) - , keys = require( "keygrip" )(['a', 'b']) - , Cookies = require( "../" ) - , options = { host: "localhost", port: 8000, path: "/set" } - , server - -server = http.createServer( function( req, res ) { - var cookies = new Cookies( req, res, keys ) - , unsigned, signed, tampered, overwrite - - if ( req.url == "/set" ) { - cookies - // set a regular cookie - .set( "unsigned", "foo", { signed:false, httpOnly: false } ) - - // set a signed cookie - .set( "signed", "bar", { signed: true } ) - - // mimic a signed cookie, but with a bogus signature - .set( "tampered", "baz" ) - .set( "tampered.sig", "bogus" ) - - // set a cookie that will be overwritten - .set( "overwrite", "old-value", { signed: true } ) - .set( "overwrite", "new-value", { overwrite: true, signed: true } ) - - res.writeHead( 302, { "Location": "/" } ) - return res.end( "Now let's check." ) - } - - unsigned = cookies.get( "unsigned" ) - signed = cookies.get( "signed", { signed: true } ) - tampered = cookies.get( "tampered", { signed: true } ) - overwrite = cookies.get( "overwrite", { signed: true } ) - - assert.equal( unsigned, "foo" ) - assert.equal( cookies.get( "unsigned.sig", { signed:false } ), undefined) - assert.equal( signed, "bar" ) - assert.equal( cookies.get( "signed.sig", { signed: false } ), keys.sign('signed=bar') ) - assert.notEqual( tampered, "baz" ) - assert.equal( tampered, undefined ) - assert.equal( overwrite, "new-value" ) - assert.equal( cookies.get( "overwrite.sig", { signed:false } ), keys.sign('overwrite=new-value') ) - - assert.equal(res.getHeader('Set-Cookie'), 'tampered.sig=; path=/; expires=Thu, 01 Jan 1970 00:00:00 GMT; httponly') - - res.writeHead( 200, { "Content-Type": "text/plain" } ) - res.end( - "unsigned expected: foo\n" + - "unsigned actual: " + unsigned + "\n\n" + - "signed expected: bar\n" + - "signed actual: " + signed + "\n\n" + - "tampered expected: undefined\n"+ - "tampered: " + tampered + "\n" - ) -}) - -server.listen( 8000 ) - -http.get( options, function( res ) { - var cookies = res.headers[ "set-cookie" ] - , body = "" - - console.log( "\ncookies set:", cookies ) - console.log( "\n============\n" ) - assert.equal(cookies.length, 7) - - options.path = res.headers[ "location" ] - options.headers = { "Cookie": cookies.join(";") } - - http.get( options, function( res ) { - res.on( "data", function( chunk ){ body += chunk } ) - res.on( "end", function(){ console.log( body ) }) - server.close() - }) -}) \ No newline at end of file diff --git a/node_modules/cookie-session/node_modules/cookies/test/restify.js b/node_modules/cookie-session/node_modules/cookies/test/restify.js deleted file mode 100644 index 6d5699e..0000000 --- a/node_modules/cookie-session/node_modules/cookies/test/restify.js +++ /dev/null @@ -1,69 +0,0 @@ -var assert = require('assert'), - restify = require('restify'), - keys = require('keygrip')(['a', 'b']), - http = require('http'), - Cookies = require('../') - -var server = restify.createServer() - -server.get('/set', function (req, res) { - setCookies(req, res) - res.json({ status : 'ok'}) -}) - -server.get('/get', function (req, res) { - assertCookies(req, res) - res.send(200) -}) - -server.listen(8000, function() { - http.get({ path: '/set', host: 'localhost', port: 8000 }, function(res) { - assert.equal(res.statusCode, 200) - var header = res.headers['set-cookie'] - assertSetCookieHeader(header) - http.get({ path: '/get', host: 'localhost', port: 8000, headers: { 'Cookie': header.join(';') } }, function(res) { - assert.equal(res.statusCode, 200) - server.close() - }) - }) -}) - -function setCookies(req, res) { - var cookies = new Cookies(req, res, keys) - cookies - .set('unsigned', 'foo', { signed:false, httpOnly: false }) - .set('signed', 'bar', { signed: true }) - .set('tampered', 'baz') - .set('tampered.sig', 'bogus') - .set('overwrite', 'old-value', { signed: true }) - .set('overwrite', 'new-value', { overwrite: true, signed: true }) -} - -function assertCookies(req, res) { - var cookies = new Cookies(req, res, keys) - var unsigned = cookies.get('unsigned'), - signed = cookies.get('signed', { signed: true }), - tampered = cookies.get('tampered', { signed: true }), - overwrite = cookies.get('overwrite', { signed: true }) - - assert.equal(unsigned, 'foo') - assert.equal(cookies.get('unsigned.sig', { signed:false }), undefined) - assert.equal(signed, 'bar') - assert.equal(cookies.get('signed.sig', { signed: false }), keys.sign('signed=bar')) - assert.notEqual(tampered, 'baz') - assert.equal(tampered, undefined) - assert.equal(overwrite, 'new-value') - assert.equal(cookies.get('overwrite.sig', { signed:false }), keys.sign('overwrite=new-value')) - assert.equal(res.getHeader('Set-Cookie'), 'tampered.sig=; path=/; expires=Thu, 01 Jan 1970 00:00:00 GMT; httponly') -} - -function assertSetCookieHeader(header) { - assert.equal(header.length, 7) - assert.equal(header[0], 'unsigned=foo; path=/') - assert.equal(header[1], 'signed=bar; path=/; httponly') - assert.ok(/^signed\.sig=.{27}; path=\/; httponly$/.test(header[2])) - assert.equal(header[3], 'tampered=baz; path=/; httponly') - assert.equal(header[4], 'tampered.sig=bogus; path=/; httponly') - assert.equal(header[5], 'overwrite=new-value; path=/; httponly') - assert.ok(/^overwrite\.sig=.{27}; path=\/; httponly$/.test(header[6])) -} \ No newline at end of file diff --git a/node_modules/cookie-session/node_modules/debug/History.md b/node_modules/cookie-session/node_modules/debug/History.md index bcbc3bd..76999e4 100644 --- a/node_modules/cookie-session/node_modules/debug/History.md +++ b/node_modules/cookie-session/node_modules/debug/History.md @@ -1,34 +1,54 @@ +2.1.2 / 2015-03-01 +================== + + * dist: recompile + * update "ms" to v0.7.0 + * package: update "browserify" to v9.0.3 + * component: fix "ms.js" repo location + * changed bower package name + * updated documentation about using debug in a browser + * fix: security error on safari (#167, #168, @yields) + +2.1.1 / 2014-12-29 +================== + + * browser: use `typeof` to check for `console` existence + * browser: check for `console.log` truthiness (fix IE 8/9) + * browser: add support for Chrome apps + * Readme: added Windows usage remarks + * Add `bower.json` to properly support bower install + 2.1.0 / 2014-10-15 ================== - * node: implement `DEBUG_FD` env variable support - * package: update "browserify" to v6.1.0 - * package: add "license" field to package.json (#135, @panuhorsmalahti) + * node: implement `DEBUG_FD` env variable support + * package: update "browserify" to v6.1.0 + * package: add "license" field to package.json (#135, @panuhorsmalahti) 2.0.0 / 2014-09-01 ================== - * package: update "browserify" to v5.11.0 - * node: use stderr rather than stdout for logging (#29, @stephenmathieson) + * package: update "browserify" to v5.11.0 + * node: use stderr rather than stdout for logging (#29, @stephenmathieson) 1.0.4 / 2014-07-15 ================== - * dist: recompile - * example: remove `console.info()` log usage - * example: add "Content-Type" UTF-8 header to browser example - * browser: place %c marker after the space character - * browser: reset the "content" color via `color: inherit` - * browser: add colors support for Firefox >= v31 - * debug: prefer an instance `log()` function over the global one (#119) - * Readme: update documentation about styled console logs for FF v31 (#116, @wryk) + * dist: recompile + * example: remove `console.info()` log usage + * example: add "Content-Type" UTF-8 header to browser example + * browser: place %c marker after the space character + * browser: reset the "content" color via `color: inherit` + * browser: add colors support for Firefox >= v31 + * debug: prefer an instance `log()` function over the global one (#119) + * Readme: update documentation about styled console logs for FF v31 (#116, @wryk) 1.0.3 / 2014-07-09 ================== - * Add support for multiple wildcards in namespaces (#122, @seegno) - * browser: fix lint + * Add support for multiple wildcards in namespaces (#122, @seegno) + * browser: fix lint 1.0.2 / 2014-06-10 ================== diff --git a/node_modules/cookie-session/node_modules/debug/Readme.md b/node_modules/cookie-session/node_modules/debug/Readme.md index e59b9ad..40e4b4a 100644 --- a/node_modules/cookie-session/node_modules/debug/Readme.md +++ b/node_modules/cookie-session/node_modules/debug/Readme.md @@ -51,6 +51,16 @@ setInterval(function(){ ![debug worker](http://f.cl.ly/items/1X413v1a3M0d3C2c1E0i/Screenshot.png) +#### Windows note + + On Windows the environment variable is set using the `set` command. + + ```cmd + set DEBUG=*,-not_this + ``` + +Then, run the program to be debugged as ususal. + ## Millisecond diff When actively developing an application it can be useful to see when the time spent between one `debug()` call and the next. Suppose for example you invoke `debug()` before requesting a resource, and after as well, the "+NNNms" will show you how much time was spent between calls. @@ -73,7 +83,19 @@ setInterval(function(){ ## Browser support - Debug works in the browser as well, currently persisted by `localStorage`. For example if you have `worker:a` and `worker:b` as shown below, and wish to debug both type `debug.enable('worker:*')` in the console and refresh the page, this will remain until you disable with `debug.disable()`. + 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: + +```js +window.myDebug = require("debug"); +``` + + ("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: + +```js +myDebug.enable("worker:*") +``` + + Refresh the page. Debug output will continue to be sent to the console until it is disabled by typing `myDebug.disable()` in the console. ```js a = debug('worker:a'); diff --git a/node_modules/cookie-session/node_modules/debug/bower.json b/node_modules/cookie-session/node_modules/debug/bower.json new file mode 100644 index 0000000..37d8333 --- /dev/null +++ b/node_modules/cookie-session/node_modules/debug/bower.json @@ -0,0 +1,28 @@ +{ + "name": "visionmedia-debug", + "main": "dist/debug.js", + "version": "2.1.2", + "homepage": "https://github.com/visionmedia/debug", + "authors": [ + "TJ Holowaychuk " + ], + "description": "visionmedia-debug", + "moduleType": [ + "amd", + "es6", + "globals", + "node" + ], + "keywords": [ + "visionmedia", + "debug" + ], + "license": "MIT", + "ignore": [ + "**/.*", + "node_modules", + "bower_components", + "test", + "tests" + ] +} diff --git a/node_modules/cookie-session/node_modules/debug/browser.js b/node_modules/cookie-session/node_modules/debug/browser.js index ce6369f..55f4cf9 100644 --- a/node_modules/cookie-session/node_modules/debug/browser.js +++ b/node_modules/cookie-session/node_modules/debug/browser.js @@ -12,6 +12,17 @@ exports.save = save; exports.load = load; exports.useColors = useColors; +/** + * Use chrome.storage.local if we are in an app + */ + +var storage; + +if (typeof chrome !== 'undefined' && typeof chrome.storage !== 'undefined') + storage = chrome.storage.local; +else + storage = localstorage(); + /** * Colors. */ @@ -101,10 +112,10 @@ function formatArgs() { */ function log() { - // This hackery is required for IE8, - // where the `console.log` function doesn't have 'apply' - return 'object' == typeof console - && 'function' == typeof console.log + // this hackery is required for IE8/9, where + // the `console.log` function doesn't have 'apply' + return 'object' === typeof console + && console.log && Function.prototype.apply.call(console.log, console, arguments); } @@ -118,9 +129,9 @@ function log() { function save(namespaces) { try { if (null == namespaces) { - localStorage.removeItem('debug'); + storage.removeItem('debug'); } else { - localStorage.debug = namespaces; + storage.debug = namespaces; } } catch(e) {} } @@ -135,7 +146,7 @@ function save(namespaces) { function load() { var r; try { - r = localStorage.debug; + r = storage.debug; } catch(e) {} return r; } @@ -145,3 +156,20 @@ function load() { */ exports.enable(load()); + +/** + * Localstorage attempts to return the localstorage. + * + * This is necessary because safari throws + * when a user disables cookies/localstorage + * and you attempt to access it. + * + * @return {LocalStorage} + * @api private + */ + +function localstorage(){ + try { + return window.localStorage; + } catch (e) {} +} diff --git a/node_modules/cookie-session/node_modules/debug/component.json b/node_modules/cookie-session/node_modules/debug/component.json index 7ee3d13..2d7b906 100644 --- a/node_modules/cookie-session/node_modules/debug/component.json +++ b/node_modules/cookie-session/node_modules/debug/component.json @@ -2,7 +2,7 @@ "name": "debug", "repo": "visionmedia/debug", "description": "small debugging utility", - "version": "2.1.0", + "version": "2.1.2", "keywords": [ "debug", "log", @@ -14,6 +14,6 @@ "debug.js" ], "dependencies": { - "guille/ms.js": "0.6.1" + "rauchg/ms.js": "0.7.0" } } diff --git a/node_modules/cookie-session/node_modules/debug/node_modules/ms/LICENSE b/node_modules/cookie-session/node_modules/debug/node_modules/ms/LICENSE new file mode 100644 index 0000000..6c07561 --- /dev/null +++ b/node_modules/cookie-session/node_modules/debug/node_modules/ms/LICENSE @@ -0,0 +1,20 @@ +(The MIT License) + +Copyright (c) 2014 Guillermo Rauch + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of +the Software, and to permit persons to whom the Software is furnished to do so, +subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS +FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR +COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/cookie-session/node_modules/debug/node_modules/ms/README.md b/node_modules/cookie-session/node_modules/debug/node_modules/ms/README.md index d4ab12a..0fd54fd 100644 --- a/node_modules/cookie-session/node_modules/debug/node_modules/ms/README.md +++ b/node_modules/cookie-session/node_modules/debug/node_modules/ms/README.md @@ -1,8 +1,10 @@ # ms.js: miliseconds conversion utility ```js +ms('2 days') // 172800000 ms('1d') // 86400000 ms('10h') // 36000000 +ms('2.5 hrs') // 9000000 ms('2h') // 7200000 ms('1m') // 60000 ms('5s') // 5000 @@ -18,10 +20,10 @@ ms(ms('10 hours')) // "10h" ```js ms(60000, { long: true }) // "1 minute" ms(2 * 60000, { long: true }) // "2 minutes" -ms(ms('10 hours', { long: true })) // "10 hours" +ms(ms('10 hours'), { long: true }) // "10 hours" ``` -- Node/Browser compatible. Published as `ms` in NPM. +- Node/Browser compatible. Published as [`ms`](https://www.npmjs.org/package/ms) in [NPM](nodejs.org/download). - If a number is supplied to `ms`, a string with a unit is returned. - If a string that contains the number is supplied, it returns it as a number (e.g: it returns `100` for `'100'`). @@ -30,4 +32,4 @@ equivalent ms is returned. ## License -MIT \ No newline at end of file +MIT diff --git a/node_modules/cookie-session/node_modules/debug/node_modules/ms/index.js b/node_modules/cookie-session/node_modules/debug/node_modules/ms/index.js index c5847f8..e79bfa1 100644 --- a/node_modules/cookie-session/node_modules/debug/node_modules/ms/index.js +++ b/node_modules/cookie-session/node_modules/debug/node_modules/ms/index.js @@ -38,13 +38,15 @@ module.exports = function(val, options){ */ function parse(str) { - var match = /^((?:\d+)?\.?\d+) *(ms|seconds?|s|minutes?|m|hours?|h|days?|d|years?|y)?$/i.exec(str); + var match = /^((?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(str); if (!match) return; var n = parseFloat(match[1]); var type = (match[2] || 'ms').toLowerCase(); switch (type) { case 'years': case 'year': + case 'yrs': + case 'yr': case 'y': return n * y; case 'days': @@ -53,16 +55,26 @@ function parse(str) { return n * d; case 'hours': case 'hour': + case 'hrs': + case 'hr': case 'h': return n * h; case 'minutes': case 'minute': + case 'mins': + case 'min': case 'm': return n * m; case 'seconds': case 'second': + case 'secs': + case 'sec': case 's': return n * s; + case 'milliseconds': + case 'millisecond': + case 'msecs': + case 'msec': case 'ms': return n; } diff --git a/node_modules/cookie-session/node_modules/debug/node_modules/ms/package.json b/node_modules/cookie-session/node_modules/debug/node_modules/ms/package.json index 8334411..f1e5ef8 100644 --- a/node_modules/cookie-session/node_modules/debug/node_modules/ms/package.json +++ b/node_modules/cookie-session/node_modules/debug/node_modules/ms/package.json @@ -1,6 +1,6 @@ { "name": "ms", - "version": "0.6.2", + "version": "0.7.0", "description": "Tiny ms conversion utility", "repository": { "type": "git", @@ -17,16 +17,16 @@ "ms/index.js": "index.js" } }, + "gitHead": "1e9cd9b05ef0dc26f765434d2bfee42394376e52", "bugs": { "url": "https://github.com/guille/ms.js/issues" }, - "_id": "ms@0.6.2", - "dist": { - "shasum": "d89c2124c6fdc1353d65a8b77bf1aac4b193708c", - "tarball": "http://registry.npmjs.org/ms/-/ms-0.6.2.tgz" - }, - "_from": "ms@0.6.2", - "_npmVersion": "1.2.30", + "homepage": "https://github.com/guille/ms.js", + "_id": "ms@0.7.0", + "scripts": {}, + "_shasum": "865be94c2e7397ad8a57da6a633a6e2f30798b83", + "_from": "ms@0.7.0", + "_npmVersion": "1.4.21", "_npmUser": { "name": "rauchg", "email": "rauchg@gmail.com" @@ -37,7 +37,10 @@ "email": "rauchg@gmail.com" } ], + "dist": { + "shasum": "865be94c2e7397ad8a57da6a633a6e2f30798b83", + "tarball": "http://registry.npmjs.org/ms/-/ms-0.7.0.tgz" + }, "directories": {}, - "_shasum": "d89c2124c6fdc1353d65a8b77bf1aac4b193708c", - "_resolved": "https://registry.npmjs.org/ms/-/ms-0.6.2.tgz" + "_resolved": "https://registry.npmjs.org/ms/-/ms-0.7.0.tgz" } diff --git a/node_modules/cookie-session/node_modules/debug/package.json b/node_modules/cookie-session/node_modules/debug/package.json index bb64e6d..47b265d 100644 --- a/node_modules/cookie-session/node_modules/debug/package.json +++ b/node_modules/cookie-session/node_modules/debug/package.json @@ -1,6 +1,6 @@ { "name": "debug", - "version": "2.1.0", + "version": "2.1.2", "repository": { "type": "git", "url": "git://github.com/visionmedia/debug.git" @@ -24,10 +24,10 @@ ], "license": "MIT", "dependencies": { - "ms": "0.6.2" + "ms": "0.7.0" }, "devDependencies": { - "browserify": "6.1.0", + "browserify": "9.0.3", "mocha": "*" }, "main": "./node.js", @@ -38,17 +38,16 @@ "debug/debug.js": "debug.js" } }, - "gitHead": "953162b4fa8849268d147f4bac91c737baee55bb", + "gitHead": "ef0b37817e88df724511e648c8c168618e892530", "bugs": { "url": "https://github.com/visionmedia/debug/issues" }, "homepage": "https://github.com/visionmedia/debug", - "_id": "debug@2.1.0", + "_id": "debug@2.1.2", "scripts": {}, - "_shasum": "33ab915659d8c2cc8a41443d94d6ebd37697ed21", - "_from": "debug@*", - "_npmVersion": "2.1.3", - "_nodeVersion": "0.10.32", + "_shasum": "d5853ec48011eafd9ec80a5c4733332c1e767a43", + "_from": "debug@~2.1.0", + "_npmVersion": "1.4.28", "_npmUser": { "name": "tootallnate", "email": "nathan@tootallnate.net" @@ -64,9 +63,9 @@ } ], "dist": { - "shasum": "33ab915659d8c2cc8a41443d94d6ebd37697ed21", - "tarball": "http://registry.npmjs.org/debug/-/debug-2.1.0.tgz" + "shasum": "d5853ec48011eafd9ec80a5c4733332c1e767a43", + "tarball": "http://registry.npmjs.org/debug/-/debug-2.1.2.tgz" }, "directories": {}, - "_resolved": "https://registry.npmjs.org/debug/-/debug-2.1.0.tgz" + "_resolved": "https://registry.npmjs.org/debug/-/debug-2.1.2.tgz" } diff --git a/node_modules/body-parser/node_modules/raw-body/.npmignore b/node_modules/cookie-session/node_modules/on-headers/.npmignore similarity index 100% rename from node_modules/body-parser/node_modules/raw-body/.npmignore rename to node_modules/cookie-session/node_modules/on-headers/.npmignore diff --git a/node_modules/cookie-session/node_modules/on-headers/History.md b/node_modules/cookie-session/node_modules/on-headers/History.md new file mode 100644 index 0000000..0e5dc11 --- /dev/null +++ b/node_modules/cookie-session/node_modules/on-headers/History.md @@ -0,0 +1,11 @@ +1.0.0 / 2014-08-10 +================== + + * Honor `res.statusCode` change in `listener` + * Move to `jshttp` orgainzation + * Prevent `arguments`-related de-opt + +0.0.0 / 2014-05-13 +================== + + * Initial implementation diff --git a/node_modules/cookie-session/node_modules/on-headers/LICENSE b/node_modules/cookie-session/node_modules/on-headers/LICENSE new file mode 100644 index 0000000..b7dce6c --- /dev/null +++ b/node_modules/cookie-session/node_modules/on-headers/LICENSE @@ -0,0 +1,22 @@ +(The MIT License) + +Copyright (c) 2014 Douglas Christopher Wilson + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +'Software'), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/cookie-session/node_modules/on-headers/README.md b/node_modules/cookie-session/node_modules/on-headers/README.md new file mode 100644 index 0000000..627ee93 --- /dev/null +++ b/node_modules/cookie-session/node_modules/on-headers/README.md @@ -0,0 +1,59 @@ +# on-headers + +[![NPM Version](https://img.shields.io/npm/v/on-headers.svg?style=flat)](https://www.npmjs.org/package/on-headers) +[![Node.js Version](https://img.shields.io/badge/node.js->=_0.8-blue.svg?style=flat)](http://nodejs.org/download/) +[![Build Status](https://img.shields.io/travis/jshttp/on-headers.svg?style=flat)](https://travis-ci.org/jshttp/on-headers) +[![Coverage Status](https://img.shields.io/coveralls/jshttp/on-headers.svg?style=flat)](https://coveralls.io/r/jshttp/on-headers) +[![Gittip](https://img.shields.io/gittip/dougwilson.svg?style=flat)](https://www.gittip.com/dougwilson/) + +Execute a listener when a response is about to write headers. + +## Install + +```sh +$ npm install on-headers +``` + +## API + +```js +var onHeaders = require('on-headers') +``` + +### onHeaders(res, listener) + +This will add the listener `listener` to fire when headers are emitted for `res`. +The listener is passed the `response` object as it's context (`this`). Headers are +considered to be emitted only once, right before they are sent to the client. + +When this is called multiple times on the same `res`, the `listener`s are fired +in the reverse order they were added. + +## Examples + +```js +var http = require('http') +var onHeaders = require('on-headers') + +http +.createServer(onRequest) +.listen(3000) + +function addPoweredBy() { + // add if not set by end of request + if (!this.getHeader('X-Powered-By')) { + this.addHeader('X-Powered-By', 'Node.js') + } +} + +function onRequest(req, res) { + onHeaders(res, addPoweredBy) + + res.setHeader('Content-Type', 'text/plain') + res.end('hello!') +} +``` + +## License + +[MIT](LICENSE) diff --git a/node_modules/cookie-session/node_modules/on-headers/index.js b/node_modules/cookie-session/node_modules/on-headers/index.js new file mode 100644 index 0000000..8579f8d --- /dev/null +++ b/node_modules/cookie-session/node_modules/on-headers/index.js @@ -0,0 +1,91 @@ +/*! + * on-headers + * Copyright(c) 2014 Douglas Christopher Wilson + * MIT Licensed + */ + +/** + * Reference to Array slice. + */ + +var slice = Array.prototype.slice + +/** + * Execute a listener when a response is about to write headers. + * + * @param {Object} res + * @return {Function} listener + * @api public + */ + +module.exports = function onHeaders(res, listener) { + if (!res) { + throw new TypeError('argument res is required') + } + + if (typeof listener !== 'function') { + throw new TypeError('argument listener must be a function') + } + + res.writeHead = createWriteHead(res.writeHead, listener) +} + +function createWriteHead(prevWriteHead, listener) { + var fired = false; + + // return function with core name and argument list + return function writeHead(statusCode) { + // set headers from arguments + var args = setWriteHeadHeaders.apply(this, arguments); + + // fire listener + if (!fired) { + fired = true + listener.call(this) + + // pass-along an updated status code + if (typeof args[0] === 'number' && this.statusCode !== args[0]) { + args[0] = this.statusCode + args.length = 1 + } + } + + prevWriteHead.apply(this, args); + } +} + +function setWriteHeadHeaders(statusCode) { + var length = arguments.length + var headerIndex = length > 1 && typeof arguments[1] === 'string' + ? 2 + : 1 + + var headers = length >= headerIndex + 1 + ? arguments[headerIndex] + : undefined + + this.statusCode = statusCode + + // the following block is from node.js core + if (Array.isArray(headers)) { + // handle array case + for (var i = 0, len = headers.length; i < len; ++i) { + this.setHeader(headers[i][0], headers[i][1]) + } + } else if (headers) { + // handle object case + var keys = Object.keys(headers) + for (var i = 0; i < keys.length; i++) { + var k = keys[i] + if (k) this.setHeader(k, headers[k]) + } + } + + // copy leading arguments + var args = new Array(Math.min(length, headerIndex)) + for (var i = 0; i < args.length; i++) { + args[i] = arguments[i] + } + + return args +} diff --git a/node_modules/cookie-session/node_modules/on-headers/package.json b/node_modules/cookie-session/node_modules/on-headers/package.json new file mode 100644 index 0000000..458bbb4 --- /dev/null +++ b/node_modules/cookie-session/node_modules/on-headers/package.json @@ -0,0 +1,59 @@ +{ + "name": "on-headers", + "description": "Execute a listener when a response is about to write headers", + "version": "1.0.0", + "author": { + "name": "Douglas Christopher Wilson", + "email": "doug@somethingdoug.com" + }, + "license": "MIT", + "keywords": [ + "event", + "headers", + "http", + "onheaders" + ], + "repository": { + "type": "git", + "url": "https://github.com/jshttp/on-headers" + }, + "dependencies": {}, + "devDependencies": { + "istanbul": "0.3.0", + "mocha": "~1.21.4", + "supertest": "~0.13.0" + }, + "engines": { + "node": ">= 0.8.0" + }, + "scripts": { + "test": "mocha --reporter spec --bail --check-leaks test/", + "test-cov": "istanbul cover node_modules/mocha/bin/_mocha -- --reporter dot --check-leaks test/", + "test-travis": "istanbul cover node_modules/mocha/bin/_mocha --report lcovonly -- --reporter spec --check-leaks test/" + }, + "gitHead": "434950a0748cd38bf9a04f3fd4f3ff89cf565fda", + "bugs": { + "url": "https://github.com/jshttp/on-headers/issues" + }, + "homepage": "https://github.com/jshttp/on-headers", + "_id": "on-headers@1.0.0", + "_shasum": "2c75b5da4375513d0161c6052e7fcbe4953fca5d", + "_from": "on-headers@~1.0.0", + "_npmVersion": "1.4.21", + "_npmUser": { + "name": "dougwilson", + "email": "doug@somethingdoug.com" + }, + "maintainers": [ + { + "name": "dougwilson", + "email": "doug@somethingdoug.com" + } + ], + "dist": { + "shasum": "2c75b5da4375513d0161c6052e7fcbe4953fca5d", + "tarball": "http://registry.npmjs.org/on-headers/-/on-headers-1.0.0.tgz" + }, + "directories": {}, + "_resolved": "https://registry.npmjs.org/on-headers/-/on-headers-1.0.0.tgz" +} diff --git a/node_modules/cookie-session/package.json b/node_modules/cookie-session/package.json index 014a968..5ac3486 100644 --- a/node_modules/cookie-session/package.json +++ b/node_modules/cookie-session/package.json @@ -3,43 +3,50 @@ "description": "cookie session middleware", "repository": { "type": "git", - "url": "git://github.com/expressjs/cookie-session" + "url": "https://github.com/expressjs/cookie-session" }, - "version": "1.0.2", + "version": "1.1.0", "keywords": [ "connect", "express", "middleware", "session" ], - "files": [ - "index.js" - ], "dependencies": { - "cookies": "~0.4.0", - "debug": "*" + "cookies": "0.5.0", + "debug": "~2.1.0", + "on-headers": "~1.0.0" }, "devDependencies": { - "connect": "*", - "mocha": "*", - "should": "*", - "supertest": "*" + "connect": "3", + "istanbul": "0.3.2", + "mocha": "~2.0.1", + "supertest": "~0.14.0" }, + "files": [ + "HISTORY.md", + "LICENSE", + "README.md", + "index.js" + ], "license": "MIT", "scripts": { - "test": "mocha --require should --reporter spec --bail" + "test": "mocha --check-leaks --reporter spec --bail test/", + "test-cov": "istanbul cover node_modules/mocha/bin/_mocha -- --check-leaks --reporter dot test/", + "test-travis": "istanbul cover node_modules/mocha/bin/_mocha --report lcovonly -- --check-leaks --reporter spec test/" }, + "gitHead": "d62ef2157fff92724c444a91950b1302a1c7bc14", "bugs": { "url": "https://github.com/expressjs/cookie-session/issues" }, "homepage": "https://github.com/expressjs/cookie-session", - "_id": "cookie-session@1.0.2", - "_shasum": "94899ac4a721bdebcfb2f62adaaa89ffdbbd8ef8", - "_from": "cookie-session@^1.0.2", - "_npmVersion": "1.4.9", + "_id": "cookie-session@1.1.0", + "_shasum": "3bd42bfdfac360d80dd8b0842c6aa4a83e2e2470", + "_from": "cookie-session@1.1.0", + "_npmVersion": "1.4.21", "_npmUser": { - "name": "fishrock123", - "email": "fishrock123@rocketmail.com" + "name": "dougwilson", + "email": "doug@somethingdoug.com" }, "maintainers": [ { @@ -68,10 +75,9 @@ } ], "dist": { - "shasum": "94899ac4a721bdebcfb2f62adaaa89ffdbbd8ef8", - "tarball": "http://registry.npmjs.org/cookie-session/-/cookie-session-1.0.2.tgz" + "shasum": "3bd42bfdfac360d80dd8b0842c6aa4a83e2e2470", + "tarball": "http://registry.npmjs.org/cookie-session/-/cookie-session-1.1.0.tgz" }, "directories": {}, - "_resolved": "https://registry.npmjs.org/cookie-session/-/cookie-session-1.0.2.tgz", - "readme": "ERROR: No README data found!" + "_resolved": "https://registry.npmjs.org/cookie-session/-/cookie-session-1.1.0.tgz" } diff --git a/node_modules/csurf/HISTORY.md b/node_modules/csurf/HISTORY.md index e294396..4819cc3 100644 --- a/node_modules/csurf/HISTORY.md +++ b/node_modules/csurf/HISTORY.md @@ -1,56 +1,104 @@ +1.7.0 / 2015-02-15 +================== + + * Accept `CSRF-Token` and `XSRF-Token` request headers + * Default `cookie.path` to `'/'`, if using cookies + * deps: cookie-signature@1.0.6 + * deps: csrf@~2.0.6 + - deps: base64-url@1.2.1 + - deps: uid-safe@~1.1.0 + * deps: http-errors@~1.3.1 + - Construct errors using defined constructors from `createError` + - Fix error names that are not identifiers + - Set a meaningful `name` property on constructed errors + +1.6.6 / 2015-01-31 +================== + + * deps: csrf@~2.0.5 + - deps: base64-url@1.2.0 + - deps: uid-safe@~1.0.3 + +1.6.5 / 2015-01-08 +================== + + * deps: csrf@~2.0.4 + - deps: uid-safe@~1.0.2 + +1.6.4 / 2014-12-30 +================== + + * deps: csrf@~2.0.3 + - Slight speed improvement for `verify` + - deps: base64-url@1.1.0 + - deps: rndm@~1.1.0 + * deps: http-errors@~1.2.8 + - Fix stack trace from exported function + +1.6.3 / 2014-11-09 +================== + + * deps: csrf@~2.0.2 + - deps: scmp@1.0.0 + * deps: http-errors@~1.2.7 + - Remove duplicate line + 1.6.2 / 2014-10-14 ================== - * bump http-errors - * fix cookie name when using `cookie: true` + * Fix cookie name when using `cookie: true` + * deps: http-errors@~1.2.6 + - Fix `expose` to be `true` for `ClientError` constructor + - Use `inherits` instead of `util` + - deps: statuses@1 1.6.1 / 2014-09-05 ================== - * bump cookie-signature + * deps: cookie-signature@1.0.5 1.6.0 / 2014-09-03 ================== - * set `code` property on CSRF token errors + * Set `code` property on CSRF token errors 1.5.0 / 2014-08-24 ================== - * add `ignoreMethods` option + * Add `ignoreMethods` option 1.4.1 / 2014-08-22 ================== - * csrf-tokens -> csrf + * Use `csrf-tokens` instead of `csrf` 1.4.0 / 2014-07-30 ================== - * Support changing `req.session` after `csurf` middleware - - Calling `res.csrfToken()` after `req.session.destroy()` will now work + * Support changing `req.session` after `csurf` middleware + - Calling `res.csrfToken()` after `req.session.destroy()` will now work 1.3.0 / 2014-07-03 ================== - * add support for environments without `res.cookie` (connect@3) + * Add support for environments without `res.cookie` (connect@3) 1.2.2 / 2014-06-18 ================== - * bump csrf-tokens + * deps: csrf-tokens@~2.0.0 1.2.1 / 2014-06-09 ================== - * refactor to use csrf-tokens + * Refactor to use `csrf-tokens` module 1.2.0 / 2014-05-13 ================== - * add support for double-submit cookie + * Add support for double-submit cookie 1.1.0 / 2014-04-06 ================== - * add constant-time string compare + * Add constant-time string compare diff --git a/node_modules/csurf/LICENSE b/node_modules/csurf/LICENSE index f23dca8..386b7b6 100644 --- a/node_modules/csurf/LICENSE +++ b/node_modules/csurf/LICENSE @@ -1,6 +1,7 @@ (The MIT License) Copyright (c) 2014 Jonathan Ong +Copyright (c) 2014-2015 Douglas Christopher Wilson Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the diff --git a/node_modules/csurf/README.md b/node_modules/csurf/README.md index 1f5d161..075c36f 100644 --- a/node_modules/csurf/README.md +++ b/node_modules/csurf/README.md @@ -4,14 +4,18 @@ [![NPM Downloads][downloads-image]][downloads-url] [![Build status][travis-image]][travis-url] [![Test coverage][coveralls-image]][coveralls-url] +[![Gratipay][gratipay-image]][gratipay-url] Node.js [CSRF](https://en.wikipedia.org/wiki/Cross-site_request_forgery) protection middleware. -Requires either a session middleware or [cookie-parser](https://github.com/expressjs/cookie-parser) to be initialized first. -- [session](https://github.com/expressjs/session) -- [cookie-session](https://github.com/expressjs/cookie-session) +Requires either a session middleware or [cookie-parser](https://www.npmjs.com/package/cookie-parser) to be initialized first. +- [express-session](https://www.npmjs.com/package/express-session) +- [cookie-session](https://www.npmjs.com/package/cookie-session) -### Install +If you have questions on how this module is implemented, please read +[Understanding CSRF](https://github.com/pillarjs/understanding-csrf). + +## Installation ```sh $ npm install csurf @@ -20,57 +24,91 @@ $ npm install csurf ## API ```js -var csrf = require('csurf') +var csurf = require('csurf') ``` -### csrf(options) +### csurf([options]) -This middleware adds a `req.csrfToken()` function to make a token which should be added to requests which mutate state, within a hidden form field, query-string etc. This token is validated against the visitor's session or csrf cookie. +Create a middleware for CSRF token creation and validation. This middleware +adds a `req.csrfToken()` function to make a token which should be added to +requests which mutate state, within a hidden form field, query-string etc. +This token is validated against the visitor's session or csrf cookie. #### Options -- `value` a function accepting the request, returning the token. - - The default function checks four possible token locations: - - `_csrf` parameter in `req.body` generated by the `body-parser` middleware. - - `_csrf` parameter in `req.query` generated by `query()`. - - `x-csrf-token` and `x-xsrf-token` header fields. -- `cookie` set to a truthy value to enable cookie-based instead of session-based csrf secret storage. - - If `cookie` is an object, these options can be configured, otherwise defaults are used: - - `key` the name of the cookie to use (defaults to `_csrf`) to store the csrf secret - - any other [res.cookie](http://expressjs.com/4x/api.html#res.cookie) options can be set -- `ignoreMethods` An array of the methods CSRF token checking will disabled. - (default: `['GET', 'HEAD', 'OPTIONS']`) +The `csurf` function takes an optional `options` object that may contain +any of the following keys: + +##### cookie + +Determines if the token secret for the user should be stored in a cookie +(when set to `true` or an object, requires a cookie parsing module) or in +`req.session` (when set to `false`, provided by another module). Defaults +to `false`. + +When set to an object, cookie storage of the secret is enabled and the +object contains options for this functionality (when set to `true`, the +defaults for the options are used). The options may contain any of the +following keys: + + - `key` - the name of the cookie to use to store the token secret + (defaults to `'_csrf'`). + - `path` - the path of the cookie (defaults to `'/'`). + - any other [res.cookie](http://expressjs.com/4x/api.html#res.cookie) + option can be set. -### req.csrfToken() +##### ignoreMethods -Lazy-loads the token associated with the request. +An array of the methods for which CSRF token checking will disabled. +Defaults to `['GET', 'HEAD', 'OPTIONS']`. + +##### value + +Provide a function that the middleware will invoke to read the token from +the request for validation. The function is called as `value(req)` and is +expected to return the token as a string. + +The default value is a function that reads the token from the following +locations, in order: + + - `req.body._csrf` - typically generated by the `body-parser` module. + - `req.query._csrf` - a built-in from Express.js to read from the URL + query string. + - `req.headers['csrf-token']` - the `CSRF-Token` HTTP request header. + - `req.headers['xsrf-token']` - the `XSRF-Token` HTTP request header. + - `req.headers['x-csrf-token']` - the `X-CSRF-Token` HTTP request header. + - `req.headers['x-xsrf-token']` - the `X-XSRF-Token` HTTP request header. ## Example ### Simple express example -The following is an example of some server-side code that protects all -non-GET/HEAD/OPTIONS routes with a CSRF token. +The following is an example of some server-side code that generates a form +that requires a CSRF token to post back. ```js +var cookieParser = require('cookie-parser') +var csrf = require('csurf') +var bodyParser = require('body-parser') var express = require('express') -var csrf = require('csurf') +// setup route middlewares +var csrfProtection = csrf({ cookie: true }) +var parseForm = bodyparser.urlencoded({ extended: false }) + +// create express app var app = express() -app.use(csrf()) -// error handler -app.use(function (err, req, res, next) { - if (err.code !== 'EBADCSRFTOKEN') return next(err) +// parse cookies +app.use(cookieParser()) - // handle CSRF token errors here - res.status(403) - res.send('session has expired or form tampered with') +app.get('/form', csrfProtection, function(req, res) { + // pass the csrfToken to the view + res.render('send', { csrfToken: req.csrfToken() }) }) -// pass the csrfToken to the view -app.get('/form', function(req, res) { - res.render('send', { csrfToken: req.csrfToken() }) +app.post('/process', parseForm, csrfProtection, function(req, res) { + res.send('data is being processed') }) ``` @@ -89,12 +127,20 @@ input field named `_csrf`: ### Custom error handling +When the CSRF token validation fails, an error is thrown that has +`err.code === 'EBADCSRFTOKEN'`. This can be used to display custom +error messages. + ```js +var bodyParser = require('body-parser') +var cookieParser = require('cookie-parser') +var csrf = require('csurf') var express = require('express') -var csrf = require('csurf') var app = express() -app.use(csrf()) +app.use(bodyParser.urlencoded({ extended: false })) +app.use(cookieParser()) +app.use(csrf({ cookie: true })) // error handler app.use(function (err, req, res, next) { @@ -102,7 +148,7 @@ app.use(function (err, req, res, next) { // handle CSRF token errors here res.status(403) - res.send('session has expired or form tampered with') + res.send('form tampered with') }) ``` @@ -110,11 +156,13 @@ app.use(function (err, req, res, next) { [MIT](LICENSE) -[npm-image]: https://img.shields.io/npm/v/csurf.svg?style=flat +[npm-image]: https://img.shields.io/npm/v/csurf.svg [npm-url]: https://npmjs.org/package/csurf -[travis-image]: https://img.shields.io/travis/expressjs/csurf.svg?style=flat +[travis-image]: https://img.shields.io/travis/expressjs/csurf/master.svg [travis-url]: https://travis-ci.org/expressjs/csurf -[coveralls-image]: https://img.shields.io/coveralls/expressjs/csurf.svg?style=flat +[coveralls-image]: https://img.shields.io/coveralls/expressjs/csurf/master.svg [coveralls-url]: https://coveralls.io/r/expressjs/csurf?branch=master -[downloads-image]: https://img.shields.io/npm/dm/csurf.svg?style=flat +[downloads-image]: https://img.shields.io/npm/dm/csurf.svg [downloads-url]: https://npmjs.org/package/csurf +[gratipay-image]: https://img.shields.io/gratipay/dougwilson.svg +[gratipay-url]: https://gratipay.com/dougwilson/ diff --git a/node_modules/csurf/index.js b/node_modules/csurf/index.js index cc1eced..68480a5 100644 --- a/node_modules/csurf/index.js +++ b/node_modules/csurf/index.js @@ -2,7 +2,7 @@ * csurf * Copyright(c) 2011 Sencha Inc. * Copyright(c) 2014 Jonathan Ong - * Copyright(c) 2014 Douglas Christopher Wilson + * Copyright(c) 2014-2015 Douglas Christopher Wilson * MIT Licensed */ @@ -32,9 +32,7 @@ module.exports = function csurf(options) { options = options || {}; // get cookie options - var cookie = options.cookie !== true - ? options.cookie || undefined - : {} + var cookie = getCookieOptions(options.cookie) // get value getter var value = options.value || defaultValue @@ -42,11 +40,6 @@ module.exports = function csurf(options) { // token repo var tokens = csrfTokens(options); - // default cookie key - if (cookie && !cookie.key) { - cookie.key = '_csrf' - } - // ignored methods var ignoreMethods = options.ignoreMethods === undefined ? ['GET', 'HEAD', 'OPTIONS'] @@ -116,10 +109,43 @@ module.exports = function csurf(options) { function defaultValue(req) { return (req.body && req.body._csrf) || (req.query && req.query._csrf) + || (req.headers['csrf-token']) + || (req.headers['xsrf-token']) || (req.headers['x-csrf-token']) || (req.headers['x-xsrf-token']); } +/** + * Get options for cookie. + * + * @param {boolean|object} [options] + * @returns {object} + * @api private + */ + +function getCookieOptions(options) { + if (options !== true && typeof options !== 'object') { + return undefined + } + + var opts = { + key: '_csrf', + path: '/' + } + + if (options && typeof options === 'object') { + for (var prop in options) { + var val = options[prop] + + if (val !== undefined) { + opts[prop] = val + } + } + } + + return opts +} + /** * Get a lookup of ignored methods. * diff --git a/node_modules/csurf/node_modules/cookie-signature/History.md b/node_modules/csurf/node_modules/cookie-signature/History.md index 2bbc4b3..78513cc 100644 --- a/node_modules/csurf/node_modules/cookie-signature/History.md +++ b/node_modules/csurf/node_modules/cookie-signature/History.md @@ -1,9 +1,20 @@ +1.0.6 / 2015-02-03 +================== + +* use `npm test` instead of `make test` to run tests +* clearer assertion messages when checking input + + +1.0.5 / 2014-09-05 +================== + +* add license to package.json + 1.0.4 / 2014-06-25 ================== * corrected avoidance of timing attacks (thanks @tenbits!) - 1.0.3 / 2014-01-28 ================== diff --git a/node_modules/csurf/node_modules/cookie-signature/Makefile b/node_modules/csurf/node_modules/cookie-signature/Makefile deleted file mode 100644 index 4e9c8d3..0000000 --- a/node_modules/csurf/node_modules/cookie-signature/Makefile +++ /dev/null @@ -1,7 +0,0 @@ - -test: - @./node_modules/.bin/mocha \ - --require should \ - --reporter spec - -.PHONY: test \ No newline at end of file diff --git a/node_modules/csurf/node_modules/cookie-signature/index.js b/node_modules/csurf/node_modules/cookie-signature/index.js index b63bf84..b8c9463 100644 --- a/node_modules/csurf/node_modules/cookie-signature/index.js +++ b/node_modules/csurf/node_modules/cookie-signature/index.js @@ -14,8 +14,8 @@ var crypto = require('crypto'); */ exports.sign = function(val, secret){ - if ('string' != typeof val) throw new TypeError('cookie required'); - if ('string' != typeof secret) throw new TypeError('secret required'); + if ('string' != typeof val) throw new TypeError("Cookie value must be provided as a string."); + if ('string' != typeof secret) throw new TypeError("Secret string must be provided."); return val + '.' + crypto .createHmac('sha256', secret) .update(val) @@ -34,8 +34,8 @@ exports.sign = function(val, secret){ */ exports.unsign = function(val, secret){ - if ('string' != typeof val) throw new TypeError('cookie required'); - if ('string' != typeof secret) throw new TypeError('secret required'); + if ('string' != typeof val) throw new TypeError("Signed cookie string must be provided."); + if ('string' != typeof secret) throw new TypeError("Secret string must be provided."); var str = val.slice(0, val.lastIndexOf('.')) , mac = exports.sign(str, secret); diff --git a/node_modules/csurf/node_modules/cookie-signature/package.json b/node_modules/csurf/node_modules/cookie-signature/package.json index ac74d61..313f3e7 100644 --- a/node_modules/csurf/node_modules/cookie-signature/package.json +++ b/node_modules/csurf/node_modules/cookie-signature/package.json @@ -1,6 +1,6 @@ { "name": "cookie-signature", - "version": "1.0.5", + "version": "1.0.6", "description": "Sign and unsign cookies", "keywords": [ "cookie", @@ -21,17 +21,20 @@ "mocha": "*", "should": "*" }, + "scripts": { + "test": "mocha --require should --reporter spec" + }, "main": "index", - "gitHead": "73ed69b511b3ef47555d71b4ed1deea9e5ed6e1f", + "gitHead": "391b56cf44d88c493491b7e3fc53208cfb976d2a", "bugs": { "url": "https://github.com/visionmedia/node-cookie-signature/issues" }, "homepage": "https://github.com/visionmedia/node-cookie-signature", - "_id": "cookie-signature@1.0.5", - "scripts": {}, - "_shasum": "a122e3f1503eca0f5355795b0711bb2368d450f9", - "_from": "cookie-signature@1.0.5", - "_npmVersion": "1.4.20", + "_id": "cookie-signature@1.0.6", + "_shasum": "e303a882b342cc3ee8ca513a79999734dab3ae2c", + "_from": "cookie-signature@1.0.6", + "_npmVersion": "2.3.0", + "_nodeVersion": "0.10.36", "_npmUser": { "name": "natevw", "email": "natevw@yahoo.com" @@ -47,9 +50,9 @@ } ], "dist": { - "shasum": "a122e3f1503eca0f5355795b0711bb2368d450f9", - "tarball": "http://registry.npmjs.org/cookie-signature/-/cookie-signature-1.0.5.tgz" + "shasum": "e303a882b342cc3ee8ca513a79999734dab3ae2c", + "tarball": "http://registry.npmjs.org/cookie-signature/-/cookie-signature-1.0.6.tgz" }, "directories": {}, - "_resolved": "https://registry.npmjs.org/cookie-signature/-/cookie-signature-1.0.5.tgz" + "_resolved": "https://registry.npmjs.org/cookie-signature/-/cookie-signature-1.0.6.tgz" } diff --git a/node_modules/csurf/node_modules/csrf/HISTORY.md b/node_modules/csurf/node_modules/csrf/HISTORY.md new file mode 100644 index 0000000..570d2ba --- /dev/null +++ b/node_modules/csurf/node_modules/csrf/HISTORY.md @@ -0,0 +1,50 @@ +2.0.6 / 2015-02-13 +================== + + * deps: base64-url@1.2.1 + * deps: uid-safe@~1.1.0 + - Use `crypto.randomBytes`, if available + - deps: base64-url@1.2.1 + +2.0.5 / 2015-01-31 +================== + + * deps: base64-url@1.2.0 + * deps: uid-safe@~1.0.3 + - Fix error branch that would throw + - deps: base64-url@1.2.0 + +2.0.4 / 2015-01-08 +================== + + * deps: uid-safe@~1.0.2 + - Remove dependency on `mz` + +2.0.3 / 2014-12-30 +================== + + * Slight speed improvement for `verify` + * deps: base64-url@1.1.0 + * deps: rndm@~1.1.0 + +2.0.2 / 2014-11-09 +================== + + * deps: scmp@1.0.0 + +2.0.1 / 2014-08-22 +================== + + * Rename module to `csrf` + +2.0.0 / 2014-06-18 +================== + + * Use `uid-safe` module + * Use `base64-url` module + * Remove sync `.secret()` -- use `.secretSync()` instead + +1.0.4 / 2014-06-11 +================== + + * Make sure CSRF tokens are URL safe diff --git a/node_modules/csurf/node_modules/csrf/LICENSE b/node_modules/csurf/node_modules/csrf/LICENSE new file mode 100644 index 0000000..a7ae8ee --- /dev/null +++ b/node_modules/csurf/node_modules/csrf/LICENSE @@ -0,0 +1,22 @@ + +The MIT License (MIT) + +Copyright (c) 2014 Jonathan Ong me@jongleberry.com + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/node_modules/csurf/node_modules/csrf/README.md b/node_modules/csurf/node_modules/csrf/README.md index e5bbd38..4213cb3 100644 --- a/node_modules/csurf/node_modules/csrf/README.md +++ b/node_modules/csurf/node_modules/csrf/README.md @@ -1,30 +1,29 @@ # CSRF -[![NPM version][npm-image]][npm-url] -[![Build status][travis-image]][travis-url] -[![Test coverage][coveralls-image]][coveralls-url] -[![Dependency Status][david-image]][david-url] -[![License][license-image]][license-url] -[![Downloads][downloads-image]][downloads-url] +[![NPM Version][npm-image]][npm-url] +[![NPM Downloads][downloads-image]][downloads-url] +[![Node.js Version][node-image]][node-url] +[![Build Status][travis-image]][travis-url] +[![Test Coverage][coveralls-image]][coveralls-url] Logic behind CSRF token creation and verification. -Read [Understanding-CSRF](http://www.jongleberry.com/understanding-csrf.html) for more information on CSRF. +Read [Understanding-CSRF](https://github.com/pillarjs/understanding-csrf) for more information on CSRF. Use this module to create custom CSRF middleware and what not. ### Install ```bash -$ npm install csrf-tokens +$ npm install csrf ``` ## API ```js -var tokens = require('csrf-tokens')(options) +var csrf = require('csrf')(options) -var secret = tokens.secretSync() -var token = tokens.create(secret) -var valid = tokens.verify(secret, token) +var secret = csrf.secretSync() +var token = csrf.create(secret) +var valid = csrf.verify(secret, token) ``` ### Options @@ -33,49 +32,47 @@ var valid = tokens.verify(secret, token) - `saltLength: 8` - the string length of the salt - `tokensize: (secret, salt) => token` - a custom token creation function -#### tokens.secret([cb]) +#### csrf.secret([cb]) Asynchronously create a new `secret` of length `secretLength`. If `cb` is not defined, a promise is returned. You don't have to use this. ```js -tokens.secret().then(function (secret) { +csrf.secret().then(function (secret) { }) -tokens.secret(function (err, secret) { +csrf.secret(function (err, secret) { }) ``` -#### var secret = tokens.secretSync() +#### var secret = csrf.secretSync() -Synchronous version of `tokens.secret()` +Synchronous version of `csrf.secret()` -#### var token = tokens.token(secret) +#### var token = csrf.create(secret) Create a CSRF token based on a `secret`. This is the token you pass to clients. -#### var valid = tokens.verify(secret, token) +#### var valid = csrf.verify(secret, token) Check whether a CSRF token is valid based on a `secret`. If it's not valid, you should probably throw a `403` error. -## [License (MIT)](LICENSE) +## License -[npm-image]: https://img.shields.io/npm/v/csrf.svg?style=flat-square +[MIT](LICENSE) + +[npm-image]: https://img.shields.io/npm/v/csrf.svg?style=flat [npm-url]: https://npmjs.org/package/csrf -[github-tag]: http://img.shields.io/github/tag/pillarjs/csrf.svg?style=flat-square -[github-url]: https://github.com/pillarjs/csrf/tags -[travis-image]: https://img.shields.io/travis/pillarjs/csrf.svg?style=flat-square +[node-image]: https://img.shields.io/node/v/csrf.svg?style=flat +[node-url]: http://nodejs.org/download/ +[travis-image]: https://img.shields.io/travis/pillarjs/csrf.svg?style=flat [travis-url]: https://travis-ci.org/pillarjs/csrf -[coveralls-image]: https://img.shields.io/coveralls/pillarjs/csrf.svg?style=flat-square +[coveralls-image]: https://img.shields.io/coveralls/pillarjs/csrf.svg?style=flat [coveralls-url]: https://coveralls.io/r/pillarjs/csrf?branch=master -[david-image]: http://img.shields.io/david/pillarjs/csrf.svg?style=flat-square -[david-url]: https://david-dm.org/pillarjs/csrf -[license-image]: http://img.shields.io/npm/l/csrf.svg?style=flat-square -[license-url]: LICENSE -[downloads-image]: http://img.shields.io/npm/dm/csrf.svg?style=flat-square +[downloads-image]: https://img.shields.io/npm/dm/csrf.svg?style=flat [downloads-url]: https://npmjs.org/package/csrf diff --git a/node_modules/csurf/node_modules/csrf/index.js b/node_modules/csurf/node_modules/csrf/index.js index 26c6524..4a4d41d 100644 --- a/node_modules/csurf/node_modules/csrf/index.js +++ b/node_modules/csurf/node_modules/csrf/index.js @@ -39,10 +39,23 @@ function csrfTokens(options) { // verify whether a token is valid verify: function verify(secret, token) { - if (!secret || typeof secret !== 'string') return false - if (!token || typeof token !== 'string') return false - var expected = tokenize(secret, token.split('-')[0]) - if (!expected) return false + if (!secret || typeof secret !== 'string') { + return false + } + + if (!token || typeof token !== 'string') { + return false + } + + var index = token.indexOf('-') + + if (index === -1) { + return false + } + + var salt = token.substr(0, index) + var expected = tokenize(secret, salt) + return scmp(token, expected) }, } diff --git a/node_modules/csurf/node_modules/csrf/node_modules/base64-url/.npmignore b/node_modules/csurf/node_modules/csrf/node_modules/base64-url/.npmignore deleted file mode 100644 index b0e8ee7..0000000 --- a/node_modules/csurf/node_modules/csrf/node_modules/base64-url/.npmignore +++ /dev/null @@ -1,12 +0,0 @@ -.*.swp -._* -.DS_Store -.git -.hg -.lock-wscript -.svn -.wafpickle-* -CVS -npm-debug.log -*.sublime-project -*.sublime-workspace \ No newline at end of file diff --git a/node_modules/csurf/node_modules/csrf/node_modules/base64-url/.travis.yml b/node_modules/csurf/node_modules/csrf/node_modules/base64-url/.travis.yml deleted file mode 100644 index 9c52355..0000000 --- a/node_modules/csurf/node_modules/csrf/node_modules/base64-url/.travis.yml +++ /dev/null @@ -1,12 +0,0 @@ - language: node_js - node_js: - - "0.11" - - "0.10" - - "0.8" - branches: - only: - - master - notifications: - email: - - joaquim.serafim@gmail.com - script: npm test diff --git a/node_modules/csurf/node_modules/csrf/node_modules/base64-url/LICENSE b/node_modules/csurf/node_modules/csrf/node_modules/base64-url/LICENSE index da1b624..9549143 100644 --- a/node_modules/csurf/node_modules/csrf/node_modules/base64-url/LICENSE +++ b/node_modules/csurf/node_modules/csrf/node_modules/base64-url/LICENSE @@ -1,6 +1,6 @@ The ISC License -Copyright (c) Joaquim José F. Serafim +Copyright (c) 2014, Joaquim José F. Serafim Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above @@ -12,4 +12,4 @@ 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. \ No newline at end of file +IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/node_modules/csurf/node_modules/csrf/node_modules/base64-url/README.md b/node_modules/csurf/node_modules/csrf/node_modules/base64-url/README.md index aa34ec8..e86cc2e 100644 --- a/node_modules/csurf/node_modules/csrf/node_modules/base64-url/README.md +++ b/node_modules/csurf/node_modules/csrf/node_modules/base64-url/README.md @@ -7,21 +7,47 @@ Base64 encode, decode, escape and unescape for URL applications. [![Build Status](https://travis-ci.org/joaquimserafim/base64-url.png?branch=master)](https://travis-ci.org/joaquimserafim/base64-url) - -**V1** - - -####API +## API - > base64url.encode('Node.js is awesome.'); - Tm9kZS5qcyBpcyBhd2Vzb21lLg - - > base64url.decode('Tm9kZS5qcyBpcyBhd2Vzb21lLg'); - Node.js is awesome. - - > base64url.escape(This+is/goingto+escape==); - This-is_goingto-escape + > base64url.encode('Node.js is awesome.'); + Tm9kZS5qcyBpcyBhd2Vzb21lLg + + > base64url.decode('Tm9kZS5qcyBpcyBhd2Vzb21lLg'); + Node.js is awesome. + + > base64url.escape('This+is/goingto+escape=='); + This-is_goingto-escape > base64url.unescape('This-is_goingto-escape'); This+is/goingto+escape== - \ No newline at end of file + + +## Development + +**this projet has been set up with a precommit that forces you to follow a code style, no jshint issues and 100% of code coverage before commit** + + +to run test +``` js +npm test +``` + +to run jshint +``` js +npm run jshint +``` + +to run code style +``` js +npm run code-style +``` + +to check code coverage +``` js +npm run check-coverage +``` + +to open the code coverage report +``` js +npm run open-coverage +``` diff --git a/node_modules/csurf/node_modules/csrf/node_modules/base64-url/index.js b/node_modules/csurf/node_modules/csrf/node_modules/base64-url/index.js index c5547ee..34968ae 100644 --- a/node_modules/csurf/node_modules/csrf/node_modules/base64-url/index.js +++ b/node_modules/csurf/node_modules/csrf/node_modules/base64-url/index.js @@ -1,11 +1,18 @@ -var base64url = exports; +'use strict'; + +var base64url = module.exports; base64url.unescape = function unescape (str) { - return (str + Array(5 - str.length % 4).join('=')).replace(/\-/g,'+').replace(/_/g, '/'); + return (str + Array(5 - str.length % 4) + .join('=')) + .replace(/\-/g, '+') + .replace(/_/g, '/'); }; base64url.escape = function escape (str) { - return str.replace(/\+/g, '-').replace(/\//g, '_').replace(/=/g, ''); + return str.replace(/\+/g, '-') + .replace(/\//g, '_') + .replace(/=/g, ''); }; base64url.encode = function encode (str) { diff --git a/node_modules/csurf/node_modules/csrf/node_modules/base64-url/package.json b/node_modules/csurf/node_modules/csrf/node_modules/base64-url/package.json index 281f0e5..cd7ba19 100644 --- a/node_modules/csurf/node_modules/csrf/node_modules/base64-url/package.json +++ b/node_modules/csurf/node_modules/csrf/node_modules/base64-url/package.json @@ -1,13 +1,19 @@ { "name": "base64-url", - "version": "1.0.0", + "version": "1.2.1", "description": "Base64 encode, decode, escape and unescape for URL applications", "main": "index.js", - "directories": { - "test": "test" - }, + "files": [ + "LICENSE", + "README.md", + "index.js" + ], "scripts": { - "test": "node test" + "test": "istanbul cover tape test.js", + "jshint": "jshint -c .jshintrc *.js", + "code-style": "jscs -p google *.js", + "check-coverage": "istanbul check-coverage --statements 100 --functions 100 --lines 100 --branches 100", + "coverage": "open coverage/lcov-report/index.html" }, "repository": { "type": "git", @@ -26,12 +32,24 @@ }, "homepage": "https://github.com/joaquimserafim/base64-url", "devDependencies": { - "tape": "^2.12.3" + "istanbul": "^0.3.5", + "jscs": "^1.9.0", + "jshint": "^2.5.11", + "pre-commit": "0.0.9", + "tape": "^3.0.3", + "which": "^1.0.8" }, - "_id": "base64-url@1.0.0", - "_shasum": "ab694376f2801af6c9260899ffef02f86b40ee2c", - "_from": "base64-url@1.0.0", - "_npmVersion": "1.4.9", + "pre-commit": [ + "jshint", + "code-style", + "test", + "check-coverage" + ], + "gitHead": "a548396819f17b1fb1529791ab8a2c1934d03f3e", + "_id": "base64-url@1.2.1", + "_shasum": "199fd661702a0e7b7dcae6e0698bb089c52f6d78", + "_from": "base64-url@1.2.1", + "_npmVersion": "1.4.28", "_npmUser": { "name": "quim", "email": "joaquim.serafim@gmail.com" @@ -43,8 +61,9 @@ } ], "dist": { - "shasum": "ab694376f2801af6c9260899ffef02f86b40ee2c", - "tarball": "http://registry.npmjs.org/base64-url/-/base64-url-1.0.0.tgz" + "shasum": "199fd661702a0e7b7dcae6e0698bb089c52f6d78", + "tarball": "http://registry.npmjs.org/base64-url/-/base64-url-1.2.1.tgz" }, - "_resolved": "https://registry.npmjs.org/base64-url/-/base64-url-1.0.0.tgz" + "directories": {}, + "_resolved": "https://registry.npmjs.org/base64-url/-/base64-url-1.2.1.tgz" } diff --git a/node_modules/csurf/node_modules/csrf/node_modules/base64-url/test/index.js b/node_modules/csurf/node_modules/csrf/node_modules/base64-url/test/index.js deleted file mode 100644 index 1c3c4ed..0000000 --- a/node_modules/csurf/node_modules/csrf/node_modules/base64-url/test/index.js +++ /dev/null @@ -1,24 +0,0 @@ -var test = require('tape'); -var base64url = require('../'); - - -test('base64url', function (t) { - t.plan(4); - - var text = 'Node.js is awesome.'; - - var encode = base64url.encode(text); - t.ok(encode, 'encode: ' + encode); - - var decode = base64url.decode(encode); - t.deepEqual(decode, text, 'decode: ' + decode); - - var text_escape = 'This+is/goingto+escape=='; - console.log(text_escape); - - var escape = base64url.escape(text_escape); - t.equal(escape.match(/\+|\//g), null, 'escape (omit + and /): ' + escape); - - var unescape = base64url.unescape(escape); - t.equal(unescape.match(/\-|_/g), null, 'unescape (back to first form): ' + unescape); -}); diff --git a/node_modules/csurf/node_modules/csrf/node_modules/rndm/README.md b/node_modules/csurf/node_modules/csrf/node_modules/rndm/README.md index 7a00d2d..504b1fd 100644 --- a/node_modules/csurf/node_modules/csrf/node_modules/rndm/README.md +++ b/node_modules/csurf/node_modules/csrf/node_modules/rndm/README.md @@ -9,7 +9,19 @@ Useful for creating fast, not cryptographically secure salts. ## API ```js -import rndm from 'rndm@1' - +// base62 by default +var rndm = require('rndm') var salt = rndm(16) ``` + +### var salt = rndm(length) + +### var salt = rndm.base62(length) + +### var salt = rndm.base36(length) + +### var salt = rndm.base10(length) + +### var random = rndm.create(characters) + +Create a new random generator with custom characters. diff --git a/node_modules/csurf/node_modules/csrf/node_modules/rndm/index.js b/node_modules/csurf/node_modules/csrf/node_modules/rndm/index.js index d52b43a..00fa19d 100644 --- a/node_modules/csurf/node_modules/csrf/node_modules/rndm/index.js +++ b/node_modules/csurf/node_modules/csrf/node_modules/rndm/index.js @@ -1,10 +1,24 @@ -var chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789' -var length = chars.length - -module.exports = function rndm(len) { - var salt = '' - for (var i = 0; i < len; i++) - salt += chars[Math.floor(length * Math.random())] - return salt +var assert = require('assert') + +var base62 = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789' +var base36 = 'abcdefghijklmnopqrstuvwxyz0123456789' +var base10 = '0123456789' + +exports = module.exports = create(base62) +exports.base62 = exports +exports.base36 = create(base36) +exports.base10 = create(base10) + +exports.create = create + +function create(chars) { + assert(typeof chars === 'string') + var length = Buffer.byteLength(chars) + return function rndm(len) { + assert(typeof len === 'number' && len >= 0) + var salt = '' + for (var i = 0; i < len; i++) salt += chars[Math.floor(length * Math.random())] + return salt + } } diff --git a/node_modules/csurf/node_modules/csrf/node_modules/rndm/package.json b/node_modules/csurf/node_modules/csrf/node_modules/rndm/package.json index b42e8d5..2070a36 100644 --- a/node_modules/csurf/node_modules/csrf/node_modules/rndm/package.json +++ b/node_modules/csurf/node_modules/csrf/node_modules/rndm/package.json @@ -1,25 +1,46 @@ { "name": "rndm", "description": "random string generator", - "version": "1.0.0", + "version": "1.1.0", "author": { "name": "Jonathan Ong", "email": "me@jongleberry.com", "url": "http://jongleberry.com" }, "license": "MIT", + "devDependencies": { + "mocha": "2", + "istanbul": "0" + }, "repository": { "type": "git", - "url": "git://github.com/jonathanong/rndm" + "url": "https://github.com/crypto-utils/rndm" + }, + "scripts": { + "test": "mocha", + "test-cov": "istanbul cover node_modules/mocha/bin/_mocha -- --reporter dot", + "test-travis": "istanbul cover node_modules/mocha/bin/_mocha --report lcovonly -- --reporter dot" }, + "keywords": [ + "random", + "number", + "generator", + "uid", + "id" + ], + "files": [ + "index.js" + ], + "gitHead": "8f4ae42f705a08a2add41fa5bdaee9bcd48d9d49", "bugs": { - "url": "https://github.com/jonathanong/rndm/issues" + "url": "https://github.com/crypto-utils/rndm/issues" }, - "homepage": "https://github.com/jonathanong/rndm", - "_id": "rndm@1.0.0", - "_shasum": "dcb6eb485b9b416d15e097f39c31458e4cfda2da", - "_from": "rndm@~1.0.0", - "_npmVersion": "1.4.9", + "homepage": "https://github.com/crypto-utils/rndm", + "_id": "rndm@1.1.0", + "_shasum": "01d1a8f1fb9b471181925b627b9049bf33074574", + "_from": "rndm@~1.1.0", + "_npmVersion": "2.1.12", + "_nodeVersion": "0.11.14", "_npmUser": { "name": "jongleberry", "email": "jonathanrichardong@gmail.com" @@ -28,13 +49,20 @@ { "name": "jongleberry", "email": "jonathanrichardong@gmail.com" + }, + { + "name": "dougwilson", + "email": "doug@somethingdoug.com" + }, + { + "name": "fishrock123", + "email": "fishrock123@rocketmail.com" } ], "dist": { - "shasum": "dcb6eb485b9b416d15e097f39c31458e4cfda2da", - "tarball": "http://registry.npmjs.org/rndm/-/rndm-1.0.0.tgz" + "shasum": "01d1a8f1fb9b471181925b627b9049bf33074574", + "tarball": "http://registry.npmjs.org/rndm/-/rndm-1.1.0.tgz" }, "directories": {}, - "_resolved": "https://registry.npmjs.org/rndm/-/rndm-1.0.0.tgz", - "readme": "ERROR: No README data found!" + "_resolved": "https://registry.npmjs.org/rndm/-/rndm-1.1.0.tgz" } diff --git a/node_modules/csurf/node_modules/csrf/node_modules/scmp/.travis.yml b/node_modules/csurf/node_modules/csrf/node_modules/scmp/.travis.yml index 0175d82..853e369 100644 --- a/node_modules/csurf/node_modules/csrf/node_modules/scmp/.travis.yml +++ b/node_modules/csurf/node_modules/csrf/node_modules/scmp/.travis.yml @@ -3,3 +3,4 @@ node_js: - "0.6" - "0.8" - "0.10" + - "0.11" diff --git a/node_modules/csurf/node_modules/csrf/node_modules/scmp/LICENSE b/node_modules/csurf/node_modules/csrf/node_modules/scmp/LICENSE new file mode 100644 index 0000000..1917835 --- /dev/null +++ b/node_modules/csurf/node_modules/csrf/node_modules/scmp/LICENSE @@ -0,0 +1,24 @@ +Copyright (c) 2014, Sean Lavine +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 scmp 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 AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/node_modules/csurf/node_modules/csrf/node_modules/scmp/README.md b/node_modules/csurf/node_modules/csrf/node_modules/scmp/README.md index 8b38b15..4cb18ce 100644 --- a/node_modules/csurf/node_modules/csrf/node_modules/scmp/README.md +++ b/node_modules/csurf/node_modules/csrf/node_modules/scmp/README.md @@ -1,6 +1,4 @@ -# scmp - -[![Build Status](https://travis-ci.org/freewil/scmp.png)](https://travis-ci.org/freewil/scmp) +# scmp [![Build Status](https://travis-ci.org/freewil/scmp.svg?branch=master)](https://travis-ci.org/freewil/scmp) Safe, constant-time comparison of strings. diff --git a/node_modules/csurf/node_modules/csrf/node_modules/scmp/index.js b/node_modules/csurf/node_modules/csrf/node_modules/scmp/index.js index d4f7579..3eb15aa 100644 --- a/node_modules/csurf/node_modules/csrf/node_modules/scmp/index.js +++ b/node_modules/csurf/node_modules/csrf/node_modules/scmp/index.js @@ -9,11 +9,12 @@ module.exports = function scmp(a, b) { a = String(a); b = String(b); - if (a.length !== b.length) { + var len = a.length; + if (len !== b.length) { return false; } var result = 0; - for (var i = 0; i < a.length; ++i) { + for (var i = 0; i < len; ++i) { result |= a.charCodeAt(i) ^ b.charCodeAt(i); } return result === 0; diff --git a/node_modules/csurf/node_modules/csrf/node_modules/scmp/package.json b/node_modules/csurf/node_modules/csrf/node_modules/scmp/package.json index 594d4b0..1e21f38 100644 --- a/node_modules/csurf/node_modules/csrf/node_modules/scmp/package.json +++ b/node_modules/csurf/node_modules/csrf/node_modules/scmp/package.json @@ -1,6 +1,6 @@ { "name": "scmp", - "version": "0.0.3", + "version": "1.0.0", "description": "safe, constant-time string-comparison", "main": "index.js", "scripts": { @@ -27,17 +27,15 @@ "mocha": "~1.13.0", "matcha": "~0.4.0" }, + "gitHead": "c8c37d3daed05ea20a761694680b13cb998c0557", "bugs": { "url": "https://github.com/freewil/scmp/issues" }, "homepage": "https://github.com/freewil/scmp", - "_id": "scmp@0.0.3", - "dist": { - "shasum": "3648df2d7294641e7f78673ffc29681d9bad9073", - "tarball": "http://registry.npmjs.org/scmp/-/scmp-0.0.3.tgz" - }, - "_from": "scmp@0.0.3", - "_npmVersion": "1.3.24", + "_id": "scmp@1.0.0", + "_shasum": "a0b272c3fc7292f77115646f00618b0262514e04", + "_from": "scmp@1.0.0", + "_npmVersion": "1.4.27", "_npmUser": { "name": "freewil", "email": "sean@eternalrise.com" @@ -48,7 +46,10 @@ "email": "sean@eternalrise.com" } ], + "dist": { + "shasum": "a0b272c3fc7292f77115646f00618b0262514e04", + "tarball": "http://registry.npmjs.org/scmp/-/scmp-1.0.0.tgz" + }, "directories": {}, - "_shasum": "3648df2d7294641e7f78673ffc29681d9bad9073", - "_resolved": "https://registry.npmjs.org/scmp/-/scmp-0.0.3.tgz" + "_resolved": "https://registry.npmjs.org/scmp/-/scmp-1.0.0.tgz" } diff --git a/node_modules/csurf/node_modules/csrf/node_modules/uid-safe/HISTORY.md b/node_modules/csurf/node_modules/csrf/node_modules/uid-safe/HISTORY.md new file mode 100644 index 0000000..ace88e0 --- /dev/null +++ b/node_modules/csurf/node_modules/csrf/node_modules/uid-safe/HISTORY.md @@ -0,0 +1,26 @@ +1.1.0 / 2015-02-01 +================== + + * Use `crypto.randomBytes`, if available + * deps: base64-url@1.2.1 + +1.0.3 / 2015-01-31 +================== + + * Fix error branch that would throw + * deps: base64-url@1.2.0 + +1.0.2 / 2015-01-08 +================== + + * Remove dependency on `mz` + +1.0.1 / 2014-06-18 +================== + + * Remove direct `bluebird` dependency + +1.0.0 / 2014-06-18 +================== + + * Initial release diff --git a/node_modules/csurf/node_modules/csrf/node_modules/uid-safe/README.md b/node_modules/csurf/node_modules/csrf/node_modules/uid-safe/README.md index 2178c6c..007ef8a 100644 --- a/node_modules/csurf/node_modules/csrf/node_modules/uid-safe/README.md +++ b/node_modules/csurf/node_modules/csrf/node_modules/uid-safe/README.md @@ -1,36 +1,55 @@ +# uid-safe -# UID Safe +[![NPM Version][npm-image]][npm-url] +[![NPM Downloads][downloads-image]][downloads-url] +[![Node.js Version][node-version-image]][node-version-url] +[![Build Status][travis-image]][travis-url] +[![Test Coverage][coveralls-image]][coveralls-url] + +URL and cookie safe UIDs Create cryptographically secure UIDs safe for both cookie and URL usage. -This is in contrast to modules such as [rand-token](https://github.com/sehrope/node-rand-token) -and [uid2](https://github.com/coreh/uid2) whose UIDs are actually skewed +This is in contrast to modules such as [rand-token](https://www.npmjs.com/package/rand-token) +and [uid2](https://www.npmjs.com/package/uid2) whose UIDs are actually skewed due to the use of `%` and unnecessarily truncate the UID. Use this if you could still use UIDs with `-` and `_` in them. +## Installation + +```sh +$ npm install uid-safe +``` + ## API ```js var uid = require('uid-safe') ``` -### uid(byteLength, [cb]) - -Asynchronously create a UID with a specific byte length. -Because `base64` encoding is used underneath, this is not the string length! -For example, to create a UID of length 24, you want a byte length of 18! +### uid(byteLength, callback) -If `cb` is not defined, a promise is returned. -However, to use promises, you must either install [bluebird](https://github.com/petkaantonov/bluebird) -or use a version of node.js that has native promises, -otherwise your process will crash and die. +Asynchronously create a UID with a specific byte length. Because `base64` +encoding is used underneath, this is not the string length. For example, +to create a UID of length 24, you want a byte length of 18. ```js -uid(18).then(function (string) { +uid(18, function (err, string) { + if (err) throw err // do something with the string }) +``` -uid(18, function (err, string) { - if (err) throw err +### uid(byteLength) + +Asynchronously create a UID with a specific byte length and return a +`Promise`. + +**To use promises, you must either install [bluebird](https://www.npmjs.com/package/bluebird) +or use a version of Node.js that has native promises, otherwise an +error will be thrown.** + +```js +uid(18).then(function (string) { // do something with the string }) ``` @@ -42,3 +61,18 @@ A synchronous version of above. ```js var string = uid.sync(18) ``` + +## License + +[MIT](LICENSE) + +[npm-image]: https://img.shields.io/npm/v/uid-safe.svg?style=flat +[npm-url]: https://npmjs.org/package/uid-safe +[node-version-image]: https://img.shields.io/node/v/uid-safe.svg?style=flat +[node-version-url]: http://nodejs.org/download/ +[travis-image]: https://img.shields.io/travis/crypto-utils/uid-safe.svg?style=flat +[travis-url]: https://travis-ci.org/crypto-utils/uid-safe +[coveralls-image]: https://img.shields.io/coveralls/crypto-utils/uid-safe.svg?style=flat +[coveralls-url]: https://coveralls.io/r/crypto-utils/uid-safe?branch=master +[downloads-image]: https://img.shields.io/npm/dm/uid-safe.svg?style=flat +[downloads-url]: https://npmjs.org/package/uid-safe diff --git a/node_modules/csurf/node_modules/csrf/node_modules/uid-safe/index.js b/node_modules/csurf/node_modules/csrf/node_modules/uid-safe/index.js index 9e26461..36ebff2 100644 --- a/node_modules/csurf/node_modules/csrf/node_modules/uid-safe/index.js +++ b/node_modules/csurf/node_modules/csrf/node_modules/uid-safe/index.js @@ -1,27 +1,110 @@ +/*! + * uid-safe + * Copyright(c) 2014 Jonathan Ong + * MIT Licensed + */ -var pseudoRandomBytes = require('crypto').pseudoRandomBytes + +/** + * Module dependencies. + * @private + */ + +var Promise +var crypto = require('crypto') var escape = require('base64-url').escape -var pseudoRandomBytesProm +/** + * Module exports. + */ module.exports = uid +module.exports.sync = uidSync + +/** + * Create a unique ID. + * + * @param {number} length + * @param {function} [callback] + * @return {Promise} + * @public + */ + +function uid(length, callback) { + if (callback) { + return generateUid(length, callback) + } + + if (!Promise) { + Promise = require('native-or-bluebird') + } -function uid(length, cb) { - if (cb) { - return pseudoRandomBytes(length, function (err, buf) { - if (err) return cb(err) - cb(null, escapeBuffer(buf)) + return new Promise(function (resolve, reject) { + generateUid(length, function (err, str) { + if (err) return reject(err) + resolve(str) }) + }) +} + +/** + * Create a unique ID sync. + * + * @param {number} length + * @return {string} + * @public + */ + +function uidSync(length) { + try { + return toString(crypto.randomBytes(length)) + } catch (e) { + return toString(crypto.pseudoRandomBytes(length)) } +} + +/** + * Generate a unique ID string. + * + * @param {number} length + * @param {function} callback + * @private + */ - pseudoRandomBytesProm || (pseudoRandomBytesProm = require('mz/crypto').pseudoRandomBytes) - return pseudoRandomBytesProm(length).then(escapeBuffer) +function generateUid(length, callback) { + randomBytes(length, function (err, buf) { + if (err) return callback(err) + callback(null, toString(buf)) + }) } -uid.sync = function uid_sync(length) { - return escapeBuffer(pseudoRandomBytes(length)) +/** + * Get some random bytes. + * + * @param {number} length + * @param {function} callback + * @return {Buffer} + * @private + */ + +function randomBytes(length, callback) { + crypto.randomBytes(length, function (err, buf) { + if (!err) return callback(null, buf) + crypto.pseudoRandomBytes(length, function (err, buf) { + if (err) return callback(err) + callback(null, buf) + }) + }) } -function escapeBuffer(buf) { +/** + * Change a Buffer into a string. + * + * @param {Buffer} buf + * @return {string} + * @private + */ + +function toString(buf) { return escape(buf.toString('base64')) } diff --git a/node_modules/csurf/node_modules/csrf/node_modules/uid-safe/node_modules/mz/.npmignore b/node_modules/csurf/node_modules/csrf/node_modules/uid-safe/node_modules/mz/.npmignore deleted file mode 100644 index efab07f..0000000 --- a/node_modules/csurf/node_modules/csrf/node_modules/uid-safe/node_modules/mz/.npmignore +++ /dev/null @@ -1,2 +0,0 @@ -test -.travis.yml diff --git a/node_modules/csurf/node_modules/csrf/node_modules/uid-safe/node_modules/mz/HISTORY.md b/node_modules/csurf/node_modules/csrf/node_modules/uid-safe/node_modules/mz/HISTORY.md deleted file mode 100644 index 57d20a0..0000000 --- a/node_modules/csurf/node_modules/csrf/node_modules/uid-safe/node_modules/mz/HISTORY.md +++ /dev/null @@ -1,6 +0,0 @@ - -1.0.0 / 2014-06-18 -================== - - * use `bluebird` by default if found - * support node 0.8 diff --git a/node_modules/csurf/node_modules/csrf/node_modules/uid-safe/node_modules/mz/README.md b/node_modules/csurf/node_modules/csrf/node_modules/uid-safe/node_modules/mz/README.md deleted file mode 100644 index 6c931c3..0000000 --- a/node_modules/csurf/node_modules/csrf/node_modules/uid-safe/node_modules/mz/README.md +++ /dev/null @@ -1,114 +0,0 @@ - -# MZ - Modernize node.js - -[![NPM version][npm-image]][npm-url] -[![Build status][travis-image]][travis-url] -[![Test coverage][coveralls-image]][coveralls-url] -[![Dependency Status][david-image]][david-url] -[![License][license-image]][license-url] -[![Downloads][downloads-image]][downloads-url] -[![Gittip][gittip-image]][gittip-url] - -Modernize node.js to current ECMAScript specifications! -node.js will not update their API to ES6+ [for a while](https://github.com/joyent/node/issues/7549). -This library is a wrapper for various aspects of node.js' API. - -## Installation and Usage - -Set `mz` as a dependency and install it. - -```bash -npm i mz -``` - -Then prefix the relevant `require()`s with `mz/`: - -```js -var fs = require('mz/fs') - -fs.exists(__filename).then(function (exists) { - if (exists) // do something -}) -``` - -Personally, I use this with generator-based control flow libraries such as [co](https://github.com/visionmedia/co) so I don't need to use implementation-specific wrappers like [co-fs](https://github.com/visionmedia/co-fs). - -```js -var co = require('co') -var fs = require('mz/fs') - -co(function* () { - if (yield fs.exists(__filename)) // do something -})() -``` - -## Promisification - -Many node methods are converted into promises. -Any properties that are deprecated or aren't asynchronous will simply be proxied. -The modules wrapped are: - -- `child_process` -- `crypto` -- `dns` -- `fs` -- `zlib` - -```js -var exec = require('mz/child_process').exec - -exec('node --version').then(function (stdout) { - console.log(stdout) -}) -``` - -## Promise Engine - -If you've installed [bluebird][bluebird], -[bluebird][bluebird] will be used. -`mz` does not install [bluebird][bluebird] for you. - -Otherwise, if you're using a node that has native v8 Promises (v0.11.13+), -then that will be used. - -Otherwise, this library will crash the process and exit, -so you might as well install [bluebird][bluebird] as a dependency! - -## FAQ - -### Can I use this in production? - -If you do, you should probably install [bluebird][bluebird] as -native v8 promises are still pretty raw. - -### Will this make my app faster? - -Nope, probably slower actually. - -### Can I add more features? - -Sure. -Open an issue. - -Currently, the plans are to eventually support: - -- ECMAScript7 Streams - -[bluebird]: https://github.com/petkaantonov/bluebird - -[npm-image]: https://img.shields.io/npm/v/mz.svg?style=flat-square -[npm-url]: https://npmjs.org/package/mz -[github-tag]: http://img.shields.io/github/tag/normalize/mz.svg?style=flat-square -[github-url]: https://github.com/normalize/mz/tags -[travis-image]: https://img.shields.io/travis/normalize/mz.svg?style=flat-square -[travis-url]: https://travis-ci.org/normalize/mz -[coveralls-image]: https://img.shields.io/coveralls/normalize/mz.svg?style=flat-square -[coveralls-url]: https://coveralls.io/r/normalize/mz?branch=master -[david-image]: http://img.shields.io/david/normalize/mz.svg?style=flat-square -[david-url]: https://david-dm.org/normalize/mz -[license-image]: http://img.shields.io/npm/l/mz.svg?style=flat-square -[license-url]: LICENSE.md -[downloads-image]: http://img.shields.io/npm/dm/mz.svg?style=flat-square -[downloads-url]: https://npmjs.org/package/mz -[gittip-image]: https://img.shields.io/gittip/jonathanong.svg?style=flat-square -[gittip-url]: https://www.gittip.com/jonathanong/ diff --git a/node_modules/csurf/node_modules/csrf/node_modules/uid-safe/node_modules/mz/_promisify.js b/node_modules/csurf/node_modules/csrf/node_modules/uid-safe/node_modules/mz/_promisify.js deleted file mode 100644 index 5329a16..0000000 --- a/node_modules/csurf/node_modules/csrf/node_modules/uid-safe/node_modules/mz/_promisify.js +++ /dev/null @@ -1,34 +0,0 @@ - -var Promise = require('native-or-bluebird') - -module.exports = function mz_promisify(name, fn) { - return eval('(function ' + name + '() {\n' - + 'var len = arguments.length\n' - + 'var args = new Array(len + 1)\n' - + 'for (var i = 0; i < len; ++i) args[i] = arguments[i]\n' - + 'var lastIndex = i\n' - + 'return new Promise(function (resolve, reject) {\n' - + 'args[lastIndex] = makeCallback(resolve, reject)\n' - + 'fn.apply(null, args)\n' - + '})\n' - + '})') -} - -function makeCallback(resolve, reject) { - return function(err, value) { - if (err) { - reject(err) - } else { - var len = arguments.length - if (len > 2) { - var values = new Array(len - 1) - for (var i = 1; i < len; ++i) { - values[i - 1] = arguments[i] - } - resolve(values) - } else { - resolve(value) - } - } - } -} diff --git a/node_modules/csurf/node_modules/csrf/node_modules/uid-safe/node_modules/mz/_promisify_all.js b/node_modules/csurf/node_modules/csrf/node_modules/uid-safe/node_modules/mz/_promisify_all.js deleted file mode 100644 index 1edb209..0000000 --- a/node_modules/csurf/node_modules/csrf/node_modules/uid-safe/node_modules/mz/_promisify_all.js +++ /dev/null @@ -1,24 +0,0 @@ - -var promisify = require('./_promisify.js') - -module.exports = function (source, exports, methods) { - methods.forEach(function (name) { - if (deprecated(source, name)) return - if (typeof source[name] === 'function') - exports[name] = promisify(name, source[name]) - }) - - // proxy the rest - Object.keys(source).forEach(function (name) { - if (deprecated(source, name)) return - if (exports[name]) return - exports[name] = source[name] - }) -} - -function deprecated(source, name) { - var desc = Object.getOwnPropertyDescriptor(source, name) - if (!desc || !desc.get) return false - if (desc.get.name === 'deprecated') return true - return false -} diff --git a/node_modules/csurf/node_modules/csrf/node_modules/uid-safe/node_modules/mz/child_process.js b/node_modules/csurf/node_modules/csrf/node_modules/uid-safe/node_modules/mz/child_process.js deleted file mode 100644 index a4b5162..0000000 --- a/node_modules/csurf/node_modules/csrf/node_modules/uid-safe/node_modules/mz/child_process.js +++ /dev/null @@ -1,8 +0,0 @@ - -require('./_promisify_all')( - require('child_process'), - exports, [ - 'exec', - 'execFile', - ] -) diff --git a/node_modules/csurf/node_modules/csrf/node_modules/uid-safe/node_modules/mz/crypto.js b/node_modules/csurf/node_modules/csrf/node_modules/uid-safe/node_modules/mz/crypto.js deleted file mode 100644 index 58a0392..0000000 --- a/node_modules/csurf/node_modules/csrf/node_modules/uid-safe/node_modules/mz/crypto.js +++ /dev/null @@ -1,9 +0,0 @@ - -require('./_promisify_all')( - require('crypto'), - exports, [ - 'pbkdf2', - 'randomBytes', - 'pseudoRandomBytes', - ] -) diff --git a/node_modules/csurf/node_modules/csrf/node_modules/uid-safe/node_modules/mz/dns.js b/node_modules/csurf/node_modules/csrf/node_modules/uid-safe/node_modules/mz/dns.js deleted file mode 100644 index ed45826..0000000 --- a/node_modules/csurf/node_modules/csrf/node_modules/uid-safe/node_modules/mz/dns.js +++ /dev/null @@ -1,16 +0,0 @@ - -require('./_promisify_all')( - require('dns'), - exports, [ - 'lookup', - 'resolve', - 'resolve4', - 'resolve6', - 'resolveMx', - 'resolveTxt', - 'resolveSrv', - 'resolveNs', - 'resolveCname', - 'reverse', - ] -) diff --git a/node_modules/csurf/node_modules/csrf/node_modules/uid-safe/node_modules/mz/fs.js b/node_modules/csurf/node_modules/csrf/node_modules/uid-safe/node_modules/mz/fs.js deleted file mode 100644 index 5ea92c7..0000000 --- a/node_modules/csurf/node_modules/csrf/node_modules/uid-safe/node_modules/mz/fs.js +++ /dev/null @@ -1,42 +0,0 @@ - -var fs = require('fs') - -require('./_promisify_all.js')(fs, exports, [ - 'rename', - 'ftruncate', - 'chown', - 'fchown', - 'lchown', - 'chmod', - 'fchmod', - 'stat', - 'lstat', - 'fstat', - 'link', - 'symlink', - 'readlink', - 'realpath', - 'unlink', - 'rmdir', - 'mkdir', - 'readdir', - 'close', - 'open', - 'utimes', - 'futimes', - 'fsync', - 'write', - 'read', - 'readFile', - 'writeFile', - 'appendFile', -]) - -var promisify = require('./_promisify.js') - -// don't know enough about promises to do this haha -exports.exists = promisify('exists', function exists(filename, done) { - fs.stat(filename, function (err) { - done(null, !err) - }) -}) diff --git a/node_modules/csurf/node_modules/csrf/node_modules/uid-safe/node_modules/mz/node_modules/native-or-bluebird/index.js b/node_modules/csurf/node_modules/csrf/node_modules/uid-safe/node_modules/mz/node_modules/native-or-bluebird/index.js deleted file mode 100644 index 4e385ec..0000000 --- a/node_modules/csurf/node_modules/csrf/node_modules/uid-safe/node_modules/mz/node_modules/native-or-bluebird/index.js +++ /dev/null @@ -1,9 +0,0 @@ - -module.exports = require('./promise') - -/* istanbul ignore next */ -if (!module.exports) { - console.error('Neither `bluebird` nor the native `Promise` functions were found.') - console.error('Please install `bluebird` yourself.') - process.exit(1) -} diff --git a/node_modules/csurf/node_modules/csrf/node_modules/uid-safe/node_modules/mz/package.json b/node_modules/csurf/node_modules/csrf/node_modules/uid-safe/node_modules/mz/package.json deleted file mode 100644 index a04f03d..0000000 --- a/node_modules/csurf/node_modules/csrf/node_modules/uid-safe/node_modules/mz/package.json +++ /dev/null @@ -1,58 +0,0 @@ -{ - "name": "mz", - "description": "modernize node.js to current ECMAScript standards", - "version": "1.0.2", - "author": { - "name": "Jonathan Ong", - "email": "me@jongleberry.com", - "url": "http://jongleberry.com" - }, - "license": "MIT", - "repository": { - "type": "git", - "url": "https://github.com/normalize/mz" - }, - "dependencies": { - "native-or-bluebird": "1" - }, - "devDependencies": { - "istanbul": "0", - "bluebird": "2", - "mocha": "1" - }, - "scripts": { - "test": "mocha --reporter spec", - "test-cov": "istanbul cover node_modules/mocha/bin/_mocha -- --reporter dot", - "test-travis": "istanbul cover node_modules/mocha/bin/_mocha --report lcovonly -- --reporter dot" - }, - "gitHead": "33b8c8483bd1813979da192c75cf318d4fafef8e", - "bugs": { - "url": "https://github.com/normalize/mz/issues" - }, - "homepage": "https://github.com/normalize/mz", - "_id": "mz@1.0.2", - "_shasum": "1c861e902ed75527399ca0d95152b9726aea73ac", - "_from": "mz@1", - "_npmVersion": "2.1.2", - "_nodeVersion": "0.11.14", - "_npmUser": { - "name": "jongleberry", - "email": "jonathanrichardong@gmail.com" - }, - "maintainers": [ - { - "name": "jongleberry", - "email": "jonathanrichardong@gmail.com" - }, - { - "name": "swatinem", - "email": "arpad.borsos@googlemail.com" - } - ], - "dist": { - "shasum": "1c861e902ed75527399ca0d95152b9726aea73ac", - "tarball": "http://registry.npmjs.org/mz/-/mz-1.0.2.tgz" - }, - "directories": {}, - "_resolved": "https://registry.npmjs.org/mz/-/mz-1.0.2.tgz" -} diff --git a/node_modules/csurf/node_modules/csrf/node_modules/uid-safe/node_modules/mz/zlib.js b/node_modules/csurf/node_modules/csrf/node_modules/uid-safe/node_modules/mz/zlib.js deleted file mode 100644 index 5cf3222..0000000 --- a/node_modules/csurf/node_modules/csrf/node_modules/uid-safe/node_modules/mz/zlib.js +++ /dev/null @@ -1,13 +0,0 @@ - -require('./_promisify_all')( - require('zlib'), - exports, [ - 'deflate', - 'deflateRaw', - 'gzip', - 'gunzip', - 'inflate', - 'inflateRaw', - 'unzip', - ] -) diff --git a/node_modules/csurf/node_modules/csrf/node_modules/uid-safe/node_modules/native-or-bluebird/LICENSE b/node_modules/csurf/node_modules/csrf/node_modules/uid-safe/node_modules/native-or-bluebird/LICENSE new file mode 100644 index 0000000..a7ae8ee --- /dev/null +++ b/node_modules/csurf/node_modules/csrf/node_modules/uid-safe/node_modules/native-or-bluebird/LICENSE @@ -0,0 +1,22 @@ + +The MIT License (MIT) + +Copyright (c) 2014 Jonathan Ong me@jongleberry.com + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/node_modules/csurf/node_modules/csrf/node_modules/uid-safe/node_modules/mz/node_modules/native-or-bluebird/README.md b/node_modules/csurf/node_modules/csrf/node_modules/uid-safe/node_modules/native-or-bluebird/README.md similarity index 100% rename from node_modules/csurf/node_modules/csrf/node_modules/uid-safe/node_modules/mz/node_modules/native-or-bluebird/README.md rename to node_modules/csurf/node_modules/csrf/node_modules/uid-safe/node_modules/native-or-bluebird/README.md diff --git a/node_modules/csurf/node_modules/csrf/node_modules/uid-safe/node_modules/native-or-bluebird/index.js b/node_modules/csurf/node_modules/csrf/node_modules/uid-safe/node_modules/native-or-bluebird/index.js new file mode 100644 index 0000000..e57587d --- /dev/null +++ b/node_modules/csurf/node_modules/csrf/node_modules/uid-safe/node_modules/native-or-bluebird/index.js @@ -0,0 +1,10 @@ + +module.exports = require('./promise') + +/* istanbul ignore next */ +if (!module.exports) { + console.error('The file "%s" requires `Promise`,', module.parent.filename) + console.error('but neither `bluebird` nor the native `Promise` implementation were found.') + console.error('Please install `bluebird` yourself.') + process.exit(1) +} diff --git a/node_modules/csurf/node_modules/csrf/node_modules/uid-safe/node_modules/mz/node_modules/native-or-bluebird/package.json b/node_modules/csurf/node_modules/csrf/node_modules/uid-safe/node_modules/native-or-bluebird/package.json similarity index 78% rename from node_modules/csurf/node_modules/csrf/node_modules/uid-safe/node_modules/mz/node_modules/native-or-bluebird/package.json rename to node_modules/csurf/node_modules/csrf/node_modules/uid-safe/node_modules/native-or-bluebird/package.json index 7807a1a..ce514a0 100644 --- a/node_modules/csurf/node_modules/csrf/node_modules/uid-safe/node_modules/mz/node_modules/native-or-bluebird/package.json +++ b/node_modules/csurf/node_modules/csrf/node_modules/uid-safe/node_modules/native-or-bluebird/package.json @@ -1,7 +1,7 @@ { "name": "native-or-bluebird", "description": "use either the native Promise or Bluebird", - "version": "1.1.1", + "version": "1.1.2", "author": { "name": "Jonathan Ong", "email": "me@jongleberry.com", @@ -32,15 +32,16 @@ "promise.js", "LICENSE" ], - "gitHead": "fc9ac96f8915371fa1ba3ad5efc84909e5c8f2de", + "gitHead": "652f5744d08bf2121a2cc3cc1a560d4d7d96b591", "bugs": { "url": "https://github.com/normalize/native-or-bluebird/issues" }, "homepage": "https://github.com/normalize/native-or-bluebird", - "_id": "native-or-bluebird@1.1.1", - "_shasum": "9131a6d6532afdfb5635f9703734cc6652c905ee", - "_from": "native-or-bluebird@1", - "_npmVersion": "1.4.21", + "_id": "native-or-bluebird@1.1.2", + "_shasum": "3921e110232d1eb790f3dac61bb370531c7d356e", + "_from": "native-or-bluebird@~1.1.2", + "_npmVersion": "2.1.5", + "_nodeVersion": "0.11.14", "_npmUser": { "name": "jongleberry", "email": "jonathanrichardong@gmail.com" @@ -56,9 +57,9 @@ } ], "dist": { - "shasum": "9131a6d6532afdfb5635f9703734cc6652c905ee", - "tarball": "http://registry.npmjs.org/native-or-bluebird/-/native-or-bluebird-1.1.1.tgz" + "shasum": "3921e110232d1eb790f3dac61bb370531c7d356e", + "tarball": "http://registry.npmjs.org/native-or-bluebird/-/native-or-bluebird-1.1.2.tgz" }, "directories": {}, - "_resolved": "https://registry.npmjs.org/native-or-bluebird/-/native-or-bluebird-1.1.1.tgz" + "_resolved": "https://registry.npmjs.org/native-or-bluebird/-/native-or-bluebird-1.1.2.tgz" } diff --git a/node_modules/csurf/node_modules/csrf/node_modules/uid-safe/node_modules/mz/node_modules/native-or-bluebird/promise.js b/node_modules/csurf/node_modules/csrf/node_modules/uid-safe/node_modules/native-or-bluebird/promise.js similarity index 100% rename from node_modules/csurf/node_modules/csrf/node_modules/uid-safe/node_modules/mz/node_modules/native-or-bluebird/promise.js rename to node_modules/csurf/node_modules/csrf/node_modules/uid-safe/node_modules/native-or-bluebird/promise.js diff --git a/node_modules/csurf/node_modules/csrf/node_modules/uid-safe/package.json b/node_modules/csurf/node_modules/csrf/node_modules/uid-safe/package.json index 1657a18..0f71131 100644 --- a/node_modules/csurf/node_modules/csrf/node_modules/uid-safe/package.json +++ b/node_modules/csurf/node_modules/csrf/node_modules/uid-safe/package.json @@ -1,39 +1,65 @@ { "name": "uid-safe", "description": "URL and cookie safe UIDs", - "version": "1.0.1", + "version": "1.1.0", "author": { "name": "Jonathan Ong", "email": "me@jongleberry.com", "url": "http://jongleberry.com" }, + "contributors": [ + { + "name": "Douglas Christopher Wilson", + "email": "doug@somethingdoug.com" + } + ], "license": "MIT", "repository": { "type": "git", - "url": "git://github.com/crypto-utils/uid-safe" + "url": "https://github.com/crypto-utils/uid-safe" }, "dependencies": { - "mz": "1", - "base64-url": "1" + "base64-url": "1.2.1", + "native-or-bluebird": "~1.1.2" }, "devDependencies": { "bluebird": "2", - "mocha": "1" + "istanbul": "0.3.5", + "mocha": "~2.1.0", + "proxyquire": "~1.2.0" + }, + "files": [ + "LICENSE", + "HISTORY.md", + "README.md", + "index.js" + ], + "engines": { + "node": ">= 0.8" }, "scripts": { - "test": "mocha --reporter spec --bail" + "test": "mocha --trace-deprecation --reporter spec --bail --check-leaks test/", + "test-cov": "istanbul cover node_modules/mocha/bin/_mocha -- --trace-deprecation --reporter dot --check-leaks test/", + "test-travis": "istanbul cover node_modules/mocha/bin/_mocha --report lcovonly -- --trace-deprecation --reporter spec --check-leaks test/" }, + "keywords": [ + "random", + "generator", + "uid", + "safe" + ], + "gitHead": "f41bf54dbc69a10e6194958d21266a328ad4f30d", "bugs": { "url": "https://github.com/crypto-utils/uid-safe/issues" }, "homepage": "https://github.com/crypto-utils/uid-safe", - "_id": "uid-safe@1.0.1", - "_shasum": "5bd148460a2e84f54f193fd20352c8c3d7de6ac8", - "_from": "uid-safe@~1.0.1", - "_npmVersion": "1.4.9", + "_id": "uid-safe@1.1.0", + "_shasum": "58d6c5dabf8dfbd8d52834839806c03fd6143232", + "_from": "uid-safe@~1.1.0", + "_npmVersion": "1.4.28", "_npmUser": { - "name": "jongleberry", - "email": "jonathanrichardong@gmail.com" + "name": "dougwilson", + "email": "doug@somethingdoug.com" }, "maintainers": [ { @@ -50,10 +76,9 @@ } ], "dist": { - "shasum": "5bd148460a2e84f54f193fd20352c8c3d7de6ac8", - "tarball": "http://registry.npmjs.org/uid-safe/-/uid-safe-1.0.1.tgz" + "shasum": "58d6c5dabf8dfbd8d52834839806c03fd6143232", + "tarball": "http://registry.npmjs.org/uid-safe/-/uid-safe-1.1.0.tgz" }, "directories": {}, - "_resolved": "https://registry.npmjs.org/uid-safe/-/uid-safe-1.0.1.tgz", - "readme": "ERROR: No README data found!" + "_resolved": "https://registry.npmjs.org/uid-safe/-/uid-safe-1.1.0.tgz" } diff --git a/node_modules/csurf/node_modules/csrf/node_modules/uid-safe/test.js b/node_modules/csurf/node_modules/csrf/node_modules/uid-safe/test.js deleted file mode 100644 index 3665fb9..0000000 --- a/node_modules/csurf/node_modules/csrf/node_modules/uid-safe/test.js +++ /dev/null @@ -1,46 +0,0 @@ - -var assert = require('assert') - -var uid = require('./') - -describe('uid-url', function () { - describe('uid()', function () { - it('should return a uid of the correct length', function () { - return uid(18).then(function (val) { - assert.equal(24, Buffer.byteLength(val)) - }) - }) - - it('should not contain +, /, or =', function () { - return uid(100000).then(function (val) { - assert(!~val.indexOf('+')) - assert(!~val.indexOf('/')) - assert(!~val.indexOf('=')) - }) - }) - - it('should support callbacks', function (done) { - uid(1000000, function (err, val) { - if (err) return done(err) - assert(!~val.indexOf('+')) - assert(!~val.indexOf('/')) - assert(!~val.indexOf('=')) - done() - }) - }) - }) - - describe('uid.sync()', function () { - it('should return a uid of the correct length', function () { - var val = uid.sync(18) - assert.equal(24, Buffer.byteLength(val)) - }) - - it('should not contain +, /, or =', function () { - var val = uid.sync(100000) - assert(!~val.indexOf('+')) - assert(!~val.indexOf('/')) - assert(!~val.indexOf('=')) - }) - }) -}) diff --git a/node_modules/csurf/node_modules/csrf/package.json b/node_modules/csurf/node_modules/csrf/package.json index 11ea802..3e1f82b 100644 --- a/node_modules/csurf/node_modules/csrf/package.json +++ b/node_modules/csurf/node_modules/csrf/package.json @@ -1,27 +1,42 @@ { "name": "csrf", "description": "primary logic behind csrf tokens", - "version": "2.0.1", + "version": "2.0.6", "author": { "name": "Jonathan Ong", "email": "me@jongleberry.com", "url": "http://jongleberry.com" }, + "contributors": [ + { + "name": "Douglas Christopher Wilson", + "email": "doug@somethingdoug.com" + } + ], "license": "MIT", "repository": { "type": "git", "url": "https://github.com/pillarjs/csrf" }, "dependencies": { - "rndm": "~1.0.0", - "scmp": "0.0.3", - "uid-safe": "~1.0.1", - "base64-url": "1.0.0" + "base64-url": "1.2.1", + "rndm": "~1.1.0", + "scmp": "1.0.0", + "uid-safe": "~1.1.0" }, "devDependencies": { - "istanbul": "0", - "bluebird": "2", - "mocha": "1" + "bluebird": "~2.9.4", + "istanbul": "0.3.5", + "mocha": "~2.1.0" + }, + "files": [ + "LICENSE", + "HISTORY.md", + "README.md", + "index.js" + ], + "engines": { + "node": ">= 0.8" }, "scripts": { "test": "mocha --reporter spec", @@ -32,21 +47,18 @@ "csrf", "tokens" ], - "files": [ - "index.js" - ], - "gitHead": "d23024ade7607942a2236ec0ae5903396f610db0", + "gitHead": "b2f30cefab349bad642f9f8fa0e65f3a157d545b", "bugs": { "url": "https://github.com/pillarjs/csrf/issues" }, "homepage": "https://github.com/pillarjs/csrf", - "_id": "csrf@2.0.1", - "_shasum": "d673a2efb4db7d0e6805dadd838c57e30ae0ee73", - "_from": "csrf@~2.0.1", - "_npmVersion": "1.4.21", + "_id": "csrf@2.0.6", + "_shasum": "a90a9d88fc7411423cb0c5c13e901a8cc588132e", + "_from": "csrf@~2.0.6", + "_npmVersion": "1.4.28", "_npmUser": { - "name": "jongleberry", - "email": "jonathanrichardong@gmail.com" + "name": "dougwilson", + "email": "doug@somethingdoug.com" }, "maintainers": [ { @@ -56,12 +68,16 @@ { "name": "jongleberry", "email": "jonathanrichardong@gmail.com" + }, + { + "name": "dougwilson", + "email": "doug@somethingdoug.com" } ], "dist": { - "shasum": "d673a2efb4db7d0e6805dadd838c57e30ae0ee73", - "tarball": "http://registry.npmjs.org/csrf/-/csrf-2.0.1.tgz" + "shasum": "a90a9d88fc7411423cb0c5c13e901a8cc588132e", + "tarball": "http://registry.npmjs.org/csrf/-/csrf-2.0.6.tgz" }, "directories": {}, - "_resolved": "https://registry.npmjs.org/csrf/-/csrf-2.0.1.tgz" + "_resolved": "https://registry.npmjs.org/csrf/-/csrf-2.0.6.tgz" } diff --git a/node_modules/csurf/node_modules/http-errors/HISTORY.md b/node_modules/csurf/node_modules/http-errors/HISTORY.md new file mode 100644 index 0000000..4c7087d --- /dev/null +++ b/node_modules/csurf/node_modules/http-errors/HISTORY.md @@ -0,0 +1,76 @@ +2015-02-02 / 1.3.1 +================== + + * Fix regression where status can be overwritten in `createError` `props` + +2015-02-01 / 1.3.0 +================== + + * Construct errors using defined constructors from `createError` + * Fix error names that are not identifiers + - `createError["I'mateapot"]` is now `createError.ImATeapot` + * Set a meaningful `name` property on constructed errors + +2014-12-09 / 1.2.8 +================== + + * Fix stack trace from exported function + * Remove `arguments.callee` usage + +2014-10-14 / 1.2.7 +================== + + * Remove duplicate line + +2014-10-02 / 1.2.6 +================== + + * Fix `expose` to be `true` for `ClientError` constructor + +2014-09-28 / 1.2.5 +================== + + * deps: statuses@1 + +2014-09-21 / 1.2.4 +================== + + * Fix dependency version to work with old `npm`s + +2014-09-21 / 1.2.3 +================== + + * deps: statuses@~1.1.0 + +2014-09-21 / 1.2.2 +================== + + * Fix publish error + +2014-09-21 / 1.2.1 +================== + + * Support Node.js 0.6 + * Use `inherits` instead of `util` + +2014-09-09 / 1.2.0 +================== + + * Fix the way inheriting functions + * Support `expose` being provided in properties argument + +2014-09-08 / 1.1.0 +================== + + * Default status to 500 + * Support provided `error` to extend + +2014-09-08 / 1.0.1 +================== + + * Fix accepting string message + +2014-09-08 / 1.0.0 +================== + + * Initial release diff --git a/node_modules/csurf/node_modules/http-errors/index.js b/node_modules/csurf/node_modules/http-errors/index.js index a7fb739..d84b114 100644 --- a/node_modules/csurf/node_modules/http-errors/index.js +++ b/node_modules/csurf/node_modules/http-errors/index.js @@ -2,7 +2,13 @@ var statuses = require('statuses'); var inherits = require('inherits'); -exports = module.exports = function () { +function toIdentifier(str) { + return str.split(' ').map(function (token) { + return token.slice(0, 1).toUpperCase() + token.slice(1) + }).join('').replace(/[^ _0-9a-z]/gi, '') +} + +exports = module.exports = function httpError() { // so much arity going on ~_~ var err; var msg; @@ -28,11 +34,33 @@ exports = module.exports = function () { } } - if (typeof status !== 'number' || !statuses[status]) status = 500; - err = err || new Error(msg || statuses[status]); - err.expose = status < 500; - for (var key in props) err[key] = props[key]; - err.status = err.statusCode = status; + if (typeof status !== 'number' || !statuses[status]) { + status = 500 + } + + // constructor + var HttpError = exports[status] + + if (!err) { + // create error + err = HttpError + ? new HttpError(msg) + : new Error(msg || statuses[status]) + Error.captureStackTrace(err, httpError) + } + + if (!HttpError || !(err instanceof HttpError)) { + // add properties to generic error + err.expose = status < 500 + err.status = err.statusCode = status + } + + for (var key in props) { + if (key !== 'status' && key !== 'statusCode') { + err[key] = props[key] + } + } + return err; }; @@ -42,11 +70,20 @@ var codes = statuses.codes.filter(function (num) { }); codes.forEach(function (code) { + var name = toIdentifier(statuses[code]) + var className = name.match(/Error$/) ? name : name + 'Error' + if (code >= 500) { var ServerError = function ServerError(msg) { var self = new Error(msg != null ? msg : statuses[code]) - Error.captureStackTrace(self, arguments.callee) + Error.captureStackTrace(self, ServerError) self.__proto__ = ServerError.prototype + Object.defineProperty(self, 'name', { + enumerable: false, + configurable: true, + value: className, + writable: true + }) return self } inherits(ServerError, Error); @@ -54,14 +91,20 @@ codes.forEach(function (code) { ServerError.prototype.statusCode = code; ServerError.prototype.expose = false; exports[code] = - exports[statuses[code].replace(/\s+/g, '')] = ServerError; + exports[name] = ServerError return; } var ClientError = function ClientError(msg) { var self = new Error(msg != null ? msg : statuses[code]) - Error.captureStackTrace(self, arguments.callee) + Error.captureStackTrace(self, ClientError) self.__proto__ = ClientError.prototype + Object.defineProperty(self, 'name', { + enumerable: false, + configurable: true, + value: className, + writable: true + }) return self } inherits(ClientError, Error); @@ -69,6 +112,9 @@ codes.forEach(function (code) { ClientError.prototype.statusCode = code; ClientError.prototype.expose = true; exports[code] = - exports[statuses[code].replace(/\s+/g, '')] = ClientError; + exports[name] = ClientError return; }); + +// backwards-compatibility +exports["I'mateapot"] = exports.ImATeapot diff --git a/node_modules/csurf/node_modules/http-errors/node_modules/inherits/package.json b/node_modules/csurf/node_modules/http-errors/node_modules/inherits/package.json index 3d69f4f..837558d 100644 --- a/node_modules/csurf/node_modules/http-errors/node_modules/inherits/package.json +++ b/node_modules/csurf/node_modules/http-errors/node_modules/inherits/package.json @@ -32,7 +32,7 @@ "shasum": "b17d08d326b4423e568eff719f91b0b1cbdf69f1", "tarball": "http://registry.npmjs.org/inherits/-/inherits-2.0.1.tgz" }, - "_from": "inherits@~2.0.1", + "_from": "inherits@~2.0.0", "_npmVersion": "1.3.8", "_npmUser": { "name": "isaacs", diff --git a/node_modules/csurf/node_modules/http-errors/node_modules/statuses/README.md b/node_modules/csurf/node_modules/http-errors/node_modules/statuses/README.md index cc12794..f6ae24c 100644 --- a/node_modules/csurf/node_modules/http-errors/node_modules/statuses/README.md +++ b/node_modules/csurf/node_modules/http-errors/node_modules/statuses/README.md @@ -19,8 +19,8 @@ var status = require('statuses'); If `Integer` or `String` is a valid HTTP code or status message, then the appropriate `code` will be returned. Otherwise, an error will be thrown. ```js -status(403) // => 403 -status('403') // => 403 +status(403) // => 'Forbidden' +status('403') // => 'Forbidden' status('forbidden') // => 403 status('Forbidden') // => 403 status(306) // throws, as it's not supported by node.js diff --git a/node_modules/csurf/node_modules/http-errors/node_modules/statuses/codes.json b/node_modules/csurf/node_modules/http-errors/node_modules/statuses/codes.json index b34a6d7..4c45a88 100644 --- a/node_modules/csurf/node_modules/http-errors/node_modules/statuses/codes.json +++ b/node_modules/csurf/node_modules/http-errors/node_modules/statuses/codes.json @@ -48,7 +48,7 @@ "428": "Precondition Required", "429": "Too Many Requests", "431": "Request Header Fields Too Large", - "451": "Unable For Legal Reasons", + "451": "Unavailable For Legal Reasons", "500": "Internal Server Error", "501": "Not Implemented", "502": "Bad Gateway", diff --git a/node_modules/csurf/node_modules/http-errors/node_modules/statuses/package.json b/node_modules/csurf/node_modules/http-errors/node_modules/statuses/package.json index 4e3006f..84b7c7e 100644 --- a/node_modules/csurf/node_modules/http-errors/node_modules/statuses/package.json +++ b/node_modules/csurf/node_modules/http-errors/node_modules/statuses/package.json @@ -1,7 +1,7 @@ { "name": "statuses", "description": "HTTP status utility", - "version": "1.2.0", + "version": "1.2.1", "author": { "name": "Jonathan Ong", "email": "me@jongleberry.com", @@ -26,8 +26,7 @@ "csv-parse": "0.0.6", "istanbul": "0", "mocha": "1", - "request": "^2.44.0", - "stream-to-array": "^2.0.2" + "stream-to-array": "2" }, "scripts": { "build": "node scripts/build.js", @@ -36,19 +35,18 @@ "test-cov": "istanbul cover node_modules/mocha/bin/_mocha -- --reporter dot --check-leaks", "test-travis": "istanbul cover node_modules/mocha/bin/_mocha --report lcovonly -- --reporter spec --check-leaks" }, - "gitHead": "64dc7753f28f0302e4140602e36f0e270ddbb1bd", + "gitHead": "49e6ac7ae4c63ee8186f56cb52112a7eeda28ed7", "bugs": { "url": "https://github.com/jshttp/statuses/issues" }, "homepage": "https://github.com/jshttp/statuses", - "_id": "statuses@1.2.0", - "_shasum": "4445790d65bec29184f50d54810f67e290c1679e", + "_id": "statuses@1.2.1", + "_shasum": "dded45cc18256d51ed40aec142489d5c61026d28", "_from": "statuses@1", - "_npmVersion": "2.0.2", - "_nodeVersion": "0.11.14", + "_npmVersion": "1.4.28", "_npmUser": { - "name": "jongleberry", - "email": "jonathanrichardong@gmail.com" + "name": "dougwilson", + "email": "doug@somethingdoug.com" }, "maintainers": [ { @@ -77,9 +75,9 @@ } ], "dist": { - "shasum": "4445790d65bec29184f50d54810f67e290c1679e", - "tarball": "http://registry.npmjs.org/statuses/-/statuses-1.2.0.tgz" + "shasum": "dded45cc18256d51ed40aec142489d5c61026d28", + "tarball": "http://registry.npmjs.org/statuses/-/statuses-1.2.1.tgz" }, "directories": {}, - "_resolved": "https://registry.npmjs.org/statuses/-/statuses-1.2.0.tgz" + "_resolved": "https://registry.npmjs.org/statuses/-/statuses-1.2.1.tgz" } diff --git a/node_modules/csurf/node_modules/http-errors/package.json b/node_modules/csurf/node_modules/http-errors/package.json index 339a5bc..58a40c0 100644 --- a/node_modules/csurf/node_modules/http-errors/package.json +++ b/node_modules/csurf/node_modules/http-errors/package.json @@ -1,12 +1,22 @@ { "name": "http-errors", "description": "Create HTTP error objects", - "version": "1.2.7", + "version": "1.3.1", "author": { "name": "Jonathan Ong", "email": "me@jongleberry.com", "url": "http://jongleberry.com" }, + "contributors": [ + { + "name": "Alan Plum", + "email": "me@pluma.io" + }, + { + "name": "Douglas Christopher Wilson", + "email": "doug@somethingdoug.com" + } + ], "license": "MIT", "repository": { "type": "git", @@ -34,21 +44,22 @@ ], "files": [ "index.js", - "LICENSE" + "HISTORY.md", + "LICENSE", + "README.md" ], - "gitHead": "42172e6b334c873d54ced516ba12db5a461e3878", + "gitHead": "89a8502b40d5dd42da2908f265275e2eeb8d0699", "bugs": { "url": "https://github.com/jshttp/http-errors/issues" }, "homepage": "https://github.com/jshttp/http-errors", - "_id": "http-errors@1.2.7", - "_shasum": "b881fa12c59b0079fd4ced456bf8dbc9610d3b78", - "_from": "http-errors@~1.2.6", - "_npmVersion": "2.1.2", - "_nodeVersion": "0.11.14", + "_id": "http-errors@1.3.1", + "_shasum": "197e22cdebd4198585e8694ef6786197b91ed942", + "_from": "http-errors@~1.3.1", + "_npmVersion": "1.4.28", "_npmUser": { - "name": "jongleberry", - "email": "jonathanrichardong@gmail.com" + "name": "dougwilson", + "email": "doug@somethingdoug.com" }, "maintainers": [ { @@ -58,12 +69,16 @@ { "name": "jongleberry", "email": "jonathanrichardong@gmail.com" + }, + { + "name": "dougwilson", + "email": "doug@somethingdoug.com" } ], "dist": { - "shasum": "b881fa12c59b0079fd4ced456bf8dbc9610d3b78", - "tarball": "http://registry.npmjs.org/http-errors/-/http-errors-1.2.7.tgz" + "shasum": "197e22cdebd4198585e8694ef6786197b91ed942", + "tarball": "http://registry.npmjs.org/http-errors/-/http-errors-1.3.1.tgz" }, "directories": {}, - "_resolved": "https://registry.npmjs.org/http-errors/-/http-errors-1.2.7.tgz" + "_resolved": "https://registry.npmjs.org/http-errors/-/http-errors-1.3.1.tgz" } diff --git a/node_modules/csurf/package.json b/node_modules/csurf/package.json index f77a919..c38de02 100644 --- a/node_modules/csurf/package.json +++ b/node_modules/csurf/package.json @@ -1,7 +1,7 @@ { "name": "csurf", "description": "CSRF token middleware", - "version": "1.6.2", + "version": "1.7.0", "author": { "name": "Jonathan Ong", "email": "me@jongleberry.com", @@ -20,19 +20,18 @@ }, "dependencies": { "cookie": "0.1.2", - "cookie-signature": "1.0.5", - "csrf": "~2.0.1", - "http-errors": "~1.2.6" + "cookie-signature": "1.0.6", + "csrf": "~2.0.6", + "http-errors": "~1.3.1" }, "devDependencies": { - "body-parser": "~1.8.0", + "body-parser": "~1.12.0", "connect": "3", - "cookie-parser": "~1.3.3", - "cookie-session": "~1.0.2", - "istanbul": "0.3.2", - "mocha": "~1.21.3", - "should": "~4.0.4", - "supertest": "~0.14.0" + "cookie-parser": "~1.3.4", + "cookie-session": "~1.1.0", + "istanbul": "0.3.5", + "mocha": "~2.1.0", + "supertest": "~0.15.0" }, "engines": { "node": ">= 0.8.0" @@ -53,15 +52,15 @@ "middleware", "express" ], - "gitHead": "eb9be9d7914de6842b8292e4e50c97599d9f9180", + "gitHead": "9f86080d778d43a04f50c1e19716023cc8aab19f", "bugs": { "url": "https://github.com/expressjs/csurf/issues" }, "homepage": "https://github.com/expressjs/csurf", - "_id": "csurf@1.6.2", - "_shasum": "e732b7478b4bef654337fd8bb363d0422a71d9f1", - "_from": "csurf@^1.3.0", - "_npmVersion": "1.4.21", + "_id": "csurf@1.7.0", + "_shasum": "f24dc53753fccbdce0505f2abc5b57167b65ff18", + "_from": "csurf@1.7.0", + "_npmVersion": "1.4.28", "_npmUser": { "name": "dougwilson", "email": "doug@somethingdoug.com" @@ -93,9 +92,9 @@ } ], "dist": { - "shasum": "e732b7478b4bef654337fd8bb363d0422a71d9f1", - "tarball": "http://registry.npmjs.org/csurf/-/csurf-1.6.2.tgz" + "shasum": "f24dc53753fccbdce0505f2abc5b57167b65ff18", + "tarball": "http://registry.npmjs.org/csurf/-/csurf-1.7.0.tgz" }, "directories": {}, - "_resolved": "https://registry.npmjs.org/csurf/-/csurf-1.6.2.tgz" + "_resolved": "https://registry.npmjs.org/csurf/-/csurf-1.7.0.tgz" } diff --git a/node_modules/ejs/package.json b/node_modules/ejs/package.json index ede2656..0c0198b 100644 --- a/node_modules/ejs/package.json +++ b/node_modules/ejs/package.json @@ -32,7 +32,7 @@ "shasum": "c9c60a48a46ee452fb32a71c317b95e5aa1fcb3d", "tarball": "http://registry.npmjs.org/ejs/-/ejs-1.0.0.tgz" }, - "_from": "ejs@^1.0.0", + "_from": "ejs@1.0.0", "_npmVersion": "1.3.21", "_npmUser": { "name": "tjholowaychuk", diff --git a/node_modules/express/node_modules/cookie/package.json b/node_modules/express/node_modules/cookie/package.json index 80aecf4..7dbb395 100644 --- a/node_modules/express/node_modules/cookie/package.json +++ b/node_modules/express/node_modules/cookie/package.json @@ -49,5 +49,6 @@ ], "directories": {}, "_shasum": "72fec3d24e48a3432073d90c12642005061004b1", - "_resolved": "https://registry.npmjs.org/cookie/-/cookie-0.1.2.tgz" + "_resolved": "https://registry.npmjs.org/cookie/-/cookie-0.1.2.tgz", + "readme": "ERROR: No README data found!" } diff --git a/node_modules/express/node_modules/debug/node_modules/ms/package.json b/node_modules/express/node_modules/debug/node_modules/ms/package.json index 0839b59..789a423 100644 --- a/node_modules/express/node_modules/debug/node_modules/ms/package.json +++ b/node_modules/express/node_modules/debug/node_modules/ms/package.json @@ -17,29 +17,14 @@ "ms/index.js": "index.js" } }, + "readme": "# ms.js: miliseconds conversion utility\n\n```js\nms('1d') // 86400000\nms('10h') // 36000000\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` in NPM.\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", + "readmeFilename": "README.md", "bugs": { "url": "https://github.com/guille/ms.js/issues" }, + "homepage": "https://github.com/guille/ms.js", "_id": "ms@0.6.2", - "dist": { - "shasum": "d89c2124c6fdc1353d65a8b77bf1aac4b193708c", - "tarball": "http://registry.npmjs.org/ms/-/ms-0.6.2.tgz" - }, - "_from": "ms@0.6.2", - "_npmVersion": "1.2.30", - "_npmUser": { - "name": "rauchg", - "email": "rauchg@gmail.com" - }, - "maintainers": [ - { - "name": "rauchg", - "email": "rauchg@gmail.com" - } - ], - "directories": {}, "_shasum": "d89c2124c6fdc1353d65a8b77bf1aac4b193708c", - "_resolved": "https://registry.npmjs.org/ms/-/ms-0.6.2.tgz", - "readme": "ERROR: No README data found!", - "homepage": "https://github.com/guille/ms.js" + "_from": "ms@0.6.2", + "_resolved": "https://registry.npmjs.org/ms/-/ms-0.6.2.tgz" } diff --git a/node_modules/express/node_modules/escape-html/package.json b/node_modules/express/node_modules/escape-html/package.json index ee240f0..7f0b109 100644 --- a/node_modules/express/node_modules/escape-html/package.json +++ b/node_modules/express/node_modules/escape-html/package.json @@ -18,8 +18,6 @@ "type": "git", "url": "https://github.com/component/escape-html.git" }, - "readme": "\n# escape-html\n\n Escape HTML entities\n\n## Example\n\n```js\nvar escape = require('escape-html');\nescape(str);\n```\n\n## License\n\n MIT", - "readmeFilename": "Readme.md", "bugs": { "url": "https://github.com/component/escape-html/issues" }, diff --git a/node_modules/express/node_modules/qs/package.json b/node_modules/express/node_modules/qs/package.json index 6e5849f..3568353 100644 --- a/node_modules/express/node_modules/qs/package.json +++ b/node_modules/express/node_modules/qs/package.json @@ -49,5 +49,7 @@ ], "directories": {}, "_shasum": "6e015098ff51968b8a3c819001d5f2c89bc4b107", - "_resolved": "https://registry.npmjs.org/qs/-/qs-0.6.6.tgz" + "_resolved": "https://registry.npmjs.org/qs/-/qs-0.6.6.tgz", + "readme": "ERROR: No README data found!", + "homepage": "https://github.com/visionmedia/node-querystring" } diff --git a/node_modules/express/node_modules/send/node_modules/mime/package.json b/node_modules/express/node_modules/send/node_modules/mime/package.json index 9782ade..43eb6f5 100644 --- a/node_modules/express/node_modules/send/node_modules/mime/package.json +++ b/node_modules/express/node_modules/send/node_modules/mime/package.json @@ -25,8 +25,6 @@ "type": "git" }, "version": "1.2.11", - "readme": "# mime\n\nComprehensive MIME type mapping API. Includes all 600+ types and 800+ extensions defined by the Apache project, plus additional types submitted by the node.js community.\n\n## Install\n\nInstall with [npm](http://github.com/isaacs/npm):\n\n npm install mime\n\n## API - Queries\n\n### mime.lookup(path)\nGet the mime type associated with a file, if no mime type is found `application/octet-stream` is returned. Performs a case-insensitive lookup using the extension in `path` (the substring after the last '/' or '.'). E.g.\n\n var mime = require('mime');\n\n mime.lookup('/path/to/file.txt'); // => 'text/plain'\n mime.lookup('file.txt'); // => 'text/plain'\n mime.lookup('.TXT'); // => 'text/plain'\n mime.lookup('htm'); // => 'text/html'\n\n### mime.default_type\nSets the mime type returned when `mime.lookup` fails to find the extension searched for. (Default is `application/octet-stream`.)\n\n### mime.extension(type)\nGet the default extension for `type`\n\n mime.extension('text/html'); // => 'html'\n mime.extension('application/octet-stream'); // => 'bin'\n\n### mime.charsets.lookup()\n\nMap mime-type to charset\n\n mime.charsets.lookup('text/plain'); // => 'UTF-8'\n\n(The logic for charset lookups is pretty rudimentary. Feel free to suggest improvements.)\n\n## API - Defining Custom Types\n\nThe following APIs allow you to add your own type mappings within your project. If you feel a type should be included as part of node-mime, see [requesting new types](https://github.com/broofa/node-mime/wiki/Requesting-New-Types).\n\n### mime.define()\n\nAdd custom mime/extension mappings\n\n mime.define({\n 'text/x-some-format': ['x-sf', 'x-sft', 'x-sfml'],\n 'application/x-my-type': ['x-mt', 'x-mtt'],\n // etc ...\n });\n\n mime.lookup('x-sft'); // => 'text/x-some-format'\n\nThe first entry in the extensions array is returned by `mime.extension()`. E.g.\n\n mime.extension('text/x-some-format'); // => 'x-sf'\n\n### mime.load(filepath)\n\nLoad mappings from an Apache \".types\" format file\n\n mime.load('./my_project.types');\n\nThe .types file format is simple - See the `types` dir for examples.\n", - "readmeFilename": "README.md", "bugs": { "url": "https://github.com/broofa/node-mime/issues" }, @@ -35,7 +33,7 @@ "shasum": "58203eed86e3a5ef17aed2b7d9ebd47f0a60dd10", "tarball": "http://registry.npmjs.org/mime/-/mime-1.2.11.tgz" }, - "_from": "mime@1.2.11", + "_from": "mime@~1.2.11", "_npmVersion": "1.3.6", "_npmUser": { "name": "broofa", diff --git a/node_modules/express/node_modules/type-is/package.json b/node_modules/express/node_modules/type-is/package.json index 7aa605f..96d9eb6 100644 --- a/node_modules/express/node_modules/type-is/package.json +++ b/node_modules/express/node_modules/type-is/package.json @@ -74,5 +74,6 @@ "tarball": "http://registry.npmjs.org/type-is/-/type-is-1.2.1.tgz" }, "directories": {}, - "_resolved": "https://registry.npmjs.org/type-is/-/type-is-1.2.1.tgz" + "_resolved": "https://registry.npmjs.org/type-is/-/type-is-1.2.1.tgz", + "readme": "ERROR: No README data found!" } diff --git a/node_modules/express/node_modules/utils-merge/package.json b/node_modules/express/node_modules/utils-merge/package.json index c168717..7c115b0 100644 --- a/node_modules/express/node_modules/utils-merge/package.json +++ b/node_modules/express/node_modules/utils-merge/package.json @@ -35,8 +35,6 @@ "engines": { "node": ">= 0.4.0" }, - "readme": "# utils-merge\n\nMerges the properties from a source object into a destination object.\n\n## Install\n\n $ npm install utils-merge\n\n## Usage\n\n```javascript\nvar a = { foo: 'bar' }\n , b = { bar: 'baz' };\n\nmerge(a, b);\n// => { foo: 'bar', bar: 'baz' }\n```\n\n## Tests\n\n $ npm install\n $ npm test\n\n[![Build Status](https://secure.travis-ci.org/jaredhanson/utils-merge.png)](http://travis-ci.org/jaredhanson/utils-merge)\n\n## Credits\n\n - [Jared Hanson](http://github.com/jaredhanson)\n\n## License\n\n[The MIT License](http://opensource.org/licenses/MIT)\n\nCopyright (c) 2013 Jared Hanson <[http://jaredhanson.net/](http://jaredhanson.net/)>\n", - "readmeFilename": "README.md", "_id": "utils-merge@1.0.0", "dist": { "shasum": "0294fb922bb9375153541c4f7096231f287c8af8", diff --git a/node_modules/express/package.json b/node_modules/express/package.json index 5bbb385..a44bdab 100644 --- a/node_modules/express/package.json +++ b/node_modules/express/package.json @@ -105,7 +105,7 @@ "shasum": "5f2f302f277187abd721c3a36e44d86c5e3f03eb", "tarball": "http://registry.npmjs.org/express/-/express-4.4.5.tgz" }, - "_from": "express@~4.4.1", + "_from": "express@4.4.5", "_npmVersion": "1.4.3", "_npmUser": { "name": "dougwilson", diff --git a/node_modules/grunt-contrib-sass/node_modules/chalk/node_modules/escape-string-regexp/license b/node_modules/grunt-contrib-sass/node_modules/chalk/node_modules/escape-string-regexp/license new file mode 100644 index 0000000..654d0bf --- /dev/null +++ b/node_modules/grunt-contrib-sass/node_modules/chalk/node_modules/escape-string-regexp/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/node_modules/grunt-contrib-sass/node_modules/chalk/node_modules/escape-string-regexp/package.json b/node_modules/grunt-contrib-sass/node_modules/chalk/node_modules/escape-string-regexp/package.json index 489455f..8e61f11 100644 --- a/node_modules/grunt-contrib-sass/node_modules/chalk/node_modules/escape-string-regexp/package.json +++ b/node_modules/grunt-contrib-sass/node_modules/chalk/node_modules/escape-string-regexp/package.json @@ -1,6 +1,6 @@ { "name": "escape-string-regexp", - "version": "1.0.2", + "version": "1.0.3", "description": "Escape RegExp special characters", "license": "MIT", "repository": { @@ -12,6 +12,16 @@ "email": "sindresorhus@gmail.com", "url": "http://sindresorhus.com" }, + "maintainers": [ + { + "name": "sindresorhus", + "email": "sindresorhus@gmail.com" + }, + { + "name": "jbnicolai", + "email": "jappelman@xebia.com" + } + ], "engines": { "node": ">=0.8.0" }, @@ -36,33 +46,25 @@ "devDependencies": { "mocha": "*" }, - "gitHead": "0587ee0ee03ea3fcbfa3c15cf67b47f214e20987", + "gitHead": "1e446e6b4449b5f1f8868cd31bf8fd25ee37fb4b", "bugs": { "url": "https://github.com/sindresorhus/escape-string-regexp/issues" }, "homepage": "https://github.com/sindresorhus/escape-string-regexp", - "_id": "escape-string-regexp@1.0.2", - "_shasum": "4dbc2fe674e71949caf3fb2695ce7f2dc1d9a8d1", + "_id": "escape-string-regexp@1.0.3", + "_shasum": "9e2d8b25bc2555c3336723750e03f099c2735bb5", "_from": "escape-string-regexp@^1.0.0", - "_npmVersion": "1.4.23", + "_npmVersion": "2.1.16", + "_nodeVersion": "0.10.35", "_npmUser": { "name": "jbnicolai", "email": "jappelman@xebia.com" }, - "maintainers": [ - { - "name": "sindresorhus", - "email": "sindresorhus@gmail.com" - }, - { - "name": "jbnicolai", - "email": "jappelman@xebia.com" - } - ], "dist": { - "shasum": "4dbc2fe674e71949caf3fb2695ce7f2dc1d9a8d1", - "tarball": "http://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.2.tgz" + "shasum": "9e2d8b25bc2555c3336723750e03f099c2735bb5", + "tarball": "http://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.3.tgz" }, "directories": {}, - "_resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.2.tgz" + "_resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.3.tgz", + "readme": "ERROR: No README data found!" } diff --git a/node_modules/grunt-contrib-sass/node_modules/chalk/node_modules/has-ansi/node_modules/ansi-regex/package.json b/node_modules/grunt-contrib-sass/node_modules/chalk/node_modules/has-ansi/node_modules/ansi-regex/package.json index 111dbbb..716ae00 100644 --- a/node_modules/grunt-contrib-sass/node_modules/chalk/node_modules/has-ansi/node_modules/ansi-regex/package.json +++ b/node_modules/grunt-contrib-sass/node_modules/chalk/node_modules/has-ansi/node_modules/ansi-regex/package.json @@ -57,7 +57,7 @@ "homepage": "https://github.com/sindresorhus/ansi-regex", "_id": "ansi-regex@0.2.1", "_shasum": "0d8e946967a3d8143f93e24e298525fc1b2235f9", - "_from": "ansi-regex@^0.2.0", + "_from": "ansi-regex@^0.2.1", "_npmVersion": "1.4.9", "_npmUser": { "name": "sindresorhus", diff --git a/node_modules/grunt-contrib-sass/node_modules/chalk/node_modules/strip-ansi/node_modules/ansi-regex/package.json b/node_modules/grunt-contrib-sass/node_modules/chalk/node_modules/strip-ansi/node_modules/ansi-regex/package.json index 111dbbb..716ae00 100644 --- a/node_modules/grunt-contrib-sass/node_modules/chalk/node_modules/strip-ansi/node_modules/ansi-regex/package.json +++ b/node_modules/grunt-contrib-sass/node_modules/chalk/node_modules/strip-ansi/node_modules/ansi-regex/package.json @@ -57,7 +57,7 @@ "homepage": "https://github.com/sindresorhus/ansi-regex", "_id": "ansi-regex@0.2.1", "_shasum": "0d8e946967a3d8143f93e24e298525fc1b2235f9", - "_from": "ansi-regex@^0.2.0", + "_from": "ansi-regex@^0.2.1", "_npmVersion": "1.4.9", "_npmUser": { "name": "sindresorhus", diff --git a/node_modules/grunt-contrib-sass/node_modules/which/LICENSE b/node_modules/grunt-contrib-sass/node_modules/which/LICENSE index 05a4010..19129e3 100644 --- a/node_modules/grunt-contrib-sass/node_modules/which/LICENSE +++ b/node_modules/grunt-contrib-sass/node_modules/which/LICENSE @@ -1,23 +1,15 @@ -Copyright 2009, 2010, 2011 Isaac Z. Schlueter. -All rights reserved. +The ISC License -Permission is hereby granted, free of charge, to any person -obtaining a copy of this software and associated documentation -files (the "Software"), to deal in the Software without -restriction, including without limitation the rights to use, -copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the -Software is furnished to do so, subject to the following -conditions: +Copyright (c) Isaac Z. Schlueter and Contributors -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. +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", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES -OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT -HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, -WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -OTHER DEALINGS IN THE SOFTWARE. +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR +IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/node_modules/grunt-contrib-sass/node_modules/which/package.json b/node_modules/grunt-contrib-sass/node_modules/which/package.json index 3d6a83b..472e6aa 100644 --- a/node_modules/grunt-contrib-sass/node_modules/which/package.json +++ b/node_modules/grunt-contrib-sass/node_modules/which/package.json @@ -6,7 +6,7 @@ }, "name": "which", "description": "Like which(1) unix command. Find the first instance of an executable in the PATH.", - "version": "1.0.5", + "version": "1.0.9", "repository": { "type": "git", "url": "git://github.com/isaacs/node-which.git" @@ -15,39 +15,33 @@ "bin": { "which": "./bin/which" }, - "engines": { - "node": "*" + "license": "ISC", + "gitHead": "df3d52a0ecd5f366d550e0f14d67ca4d5e621bad", + "bugs": { + "url": "https://github.com/isaacs/node-which/issues" }, - "dependencies": {}, - "devDependencies": {}, + "homepage": "https://github.com/isaacs/node-which", + "_id": "which@1.0.9", + "scripts": {}, + "_shasum": "460c1da0f810103d0321a9b633af9e575e64486f", + "_from": "which@^1.0.5", + "_npmVersion": "2.6.0", + "_nodeVersion": "1.1.0", "_npmUser": { "name": "isaacs", "email": "i@izs.me" }, - "_id": "which@1.0.5", - "optionalDependencies": {}, - "_engineSupported": true, - "_npmVersion": "1.1.2", - "_nodeVersion": "v0.7.6-pre", - "_defaultsLoaded": true, - "dist": { - "shasum": "5630d6819dda692f1464462e7956cb42c0842739", - "tarball": "http://registry.npmjs.org/which/-/which-1.0.5.tgz" - }, - "readme": "The \"which\" util from npm's guts.\n\nFinds the first instance of a specified executable in the PATH\nenvironment variable. Does not cache the results, so `hash -r` is not\nneeded when the PATH changes.\n", "maintainers": [ { "name": "isaacs", "email": "i@izs.me" } ], - "directories": {}, - "_shasum": "5630d6819dda692f1464462e7956cb42c0842739", - "_from": "which@^1.0.5", - "_resolved": "https://registry.npmjs.org/which/-/which-1.0.5.tgz", - "bugs": { - "url": "https://github.com/isaacs/node-which/issues" + "dist": { + "shasum": "460c1da0f810103d0321a9b633af9e575e64486f", + "tarball": "http://registry.npmjs.org/which/-/which-1.0.9.tgz" }, - "homepage": "https://github.com/isaacs/node-which", - "scripts": {} + "directories": {}, + "_resolved": "https://registry.npmjs.org/which/-/which-1.0.9.tgz", + "readme": "ERROR: No README data found!" } diff --git a/node_modules/grunt-contrib-sass/node_modules/which/which.js b/node_modules/grunt-contrib-sass/node_modules/which/which.js index db7e8f7..2a45417 100644 --- a/node_modules/grunt-contrib-sass/node_modules/which/which.js +++ b/node_modules/grunt-contrib-sass/node_modules/which/which.js @@ -5,12 +5,7 @@ var path = require("path") , fs , COLON = process.platform === "win32" ? ";" : ":" , isExe - -try { - fs = require("graceful-fs") -} catch (ex) { - fs = require("fs") -} + , fs = require("fs") if (process.platform == "win32") { // On windows, there is no good way to check that a file is executable @@ -21,7 +16,9 @@ if (process.platform == "win32") { //console.error("isExe?", (mod & 0111).toString(8)) var ret = (mod & 0001) || (mod & 0010) && process.getgid && gid === process.getgid() + || (mod & 0010) && process.getuid && 0 === process.getuid() || (mod & 0100) && process.getuid && uid === process.getuid() + || (mod & 0100) && process.getuid && 0 === process.getuid() //console.error("isExe?", ret) return ret } diff --git a/node_modules/grunt-contrib-sass/package.json b/node_modules/grunt-contrib-sass/package.json index 41a641d..58fe3ca 100644 --- a/node_modules/grunt-contrib-sass/package.json +++ b/node_modules/grunt-contrib-sass/package.json @@ -61,7 +61,7 @@ }, "_id": "grunt-contrib-sass@0.7.4", "_shasum": "1de0f7c3bc40f15254e135777b5f094c921e9564", - "_from": "grunt-contrib-sass@^0.7.3", + "_from": "grunt-contrib-sass@0.7.4", "_npmVersion": "1.4.14", "_npmUser": { "name": "sindresorhus", diff --git a/node_modules/grunt-contrib-watch/node_modules/async/package.json b/node_modules/grunt-contrib-watch/node_modules/async/package.json index a67a0dc..0e0dc48 100644 --- a/node_modules/grunt-contrib-watch/node_modules/async/package.json +++ b/node_modules/grunt-contrib-watch/node_modules/async/package.json @@ -40,7 +40,7 @@ "shasum": "b6bbe0b0674b9d719708ca38de8c237cb526c3d1", "tarball": "http://registry.npmjs.org/async/-/async-0.2.10.tgz" }, - "_from": "async@~0.2.9", + "_from": "async@0.2.10", "_npmVersion": "1.3.2", "_npmUser": { "name": "caolan", diff --git a/node_modules/grunt-contrib-watch/node_modules/gaze/node_modules/globule/package.json b/node_modules/grunt-contrib-watch/node_modules/gaze/node_modules/globule/package.json index 5464980..4e5a53f 100644 --- a/node_modules/grunt-contrib-watch/node_modules/gaze/node_modules/globule/package.json +++ b/node_modules/grunt-contrib-watch/node_modules/gaze/node_modules/globule/package.json @@ -69,6 +69,6 @@ ], "directories": {}, "_shasum": "d9c8edde1da79d125a151b79533b978676346ae5", - "_from": "globule@~0.1.0", + "_from": "globule@0.1.0", "_resolved": "https://registry.npmjs.org/globule/-/globule-0.1.0.tgz" } diff --git a/node_modules/grunt-contrib-watch/node_modules/lodash/package.json b/node_modules/grunt-contrib-watch/node_modules/lodash/package.json index 86d83d8..6322ff4 100644 --- a/node_modules/grunt-contrib-watch/node_modules/lodash/package.json +++ b/node_modules/grunt-contrib-watch/node_modules/lodash/package.json @@ -100,7 +100,7 @@ "shasum": "5b7723034dda4d262e5a46fb2c58d7cc22f71420", "tarball": "http://registry.npmjs.org/lodash/-/lodash-2.4.1.tgz" }, - "_from": "lodash@~2.4.1", + "_from": "lodash@2.4.1", "_npmVersion": "1.3.14", "_npmUser": { "name": "jdalton", diff --git a/node_modules/grunt-contrib-watch/node_modules/tiny-lr-fork/node_modules/debug/package.json b/node_modules/grunt-contrib-watch/node_modules/tiny-lr-fork/node_modules/debug/package.json index 854a22e..882a300 100644 --- a/node_modules/grunt-contrib-watch/node_modules/tiny-lr-fork/node_modules/debug/package.json +++ b/node_modules/grunt-contrib-watch/node_modules/tiny-lr-fork/node_modules/debug/package.json @@ -44,7 +44,7 @@ "shasum": "06e1ea8082c2cb14e39806e22e2f6f757f92af39", "tarball": "http://registry.npmjs.org/debug/-/debug-0.7.4.tgz" }, - "_from": "debug@~0.7.0", + "_from": "debug@0.7.4", "_npmVersion": "1.3.13", "_npmUser": { "name": "tjholowaychuk", diff --git a/node_modules/grunt-contrib-watch/node_modules/tiny-lr-fork/node_modules/faye-websocket/package.json b/node_modules/grunt-contrib-watch/node_modules/tiny-lr-fork/node_modules/faye-websocket/package.json index e1559c2..1cc547a 100644 --- a/node_modules/grunt-contrib-watch/node_modules/tiny-lr-fork/node_modules/faye-websocket/package.json +++ b/node_modules/grunt-contrib-watch/node_modules/tiny-lr-fork/node_modules/faye-websocket/package.json @@ -45,7 +45,7 @@ "shasum": "c14c5b3bf14d7417ffbfd990c0a7495cd9f337bc", "tarball": "http://registry.npmjs.org/faye-websocket/-/faye-websocket-0.4.4.tgz" }, - "_from": "faye-websocket@~0.4.3", + "_from": "faye-websocket@0.4.4", "_npmVersion": "1.2.10", "_npmUser": { "name": "jcoglan", diff --git a/node_modules/grunt-contrib-watch/node_modules/tiny-lr-fork/node_modules/noptify/node_modules/nopt/package.json b/node_modules/grunt-contrib-watch/node_modules/tiny-lr-fork/node_modules/noptify/node_modules/nopt/package.json index e1a3807..a916ad7 100644 --- a/node_modules/grunt-contrib-watch/node_modules/tiny-lr-fork/node_modules/noptify/node_modules/nopt/package.json +++ b/node_modules/grunt-contrib-watch/node_modules/tiny-lr-fork/node_modules/noptify/node_modules/nopt/package.json @@ -38,7 +38,7 @@ ], "directories": {}, "_shasum": "ca7416f20a5e3f9c3b86180f96295fa3d0b52e0d", - "_from": "nopt@~2.0.0", + "_from": "nopt@2.0.0", "_resolved": "https://registry.npmjs.org/nopt/-/nopt-2.0.0.tgz", "bugs": { "url": "https://github.com/isaacs/nopt/issues" diff --git a/node_modules/grunt-contrib-watch/node_modules/tiny-lr-fork/node_modules/qs/package.json b/node_modules/grunt-contrib-watch/node_modules/tiny-lr-fork/node_modules/qs/package.json index 4a6e6c4..39da78b 100644 --- a/node_modules/grunt-contrib-watch/node_modules/tiny-lr-fork/node_modules/qs/package.json +++ b/node_modules/grunt-contrib-watch/node_modules/tiny-lr-fork/node_modules/qs/package.json @@ -34,7 +34,7 @@ "shasum": "31b1ad058567651c526921506b9a8793911a0384", "tarball": "http://registry.npmjs.org/qs/-/qs-0.5.6.tgz" }, - "_from": "qs@~0.5.2", + "_from": "qs@0.5.6", "_npmVersion": "1.2.14", "_npmUser": { "name": "tjholowaychuk", diff --git a/node_modules/grunt/node_modules/async/package.json b/node_modules/grunt/node_modules/async/package.json index 8f2d6e6..0ebbfd8 100644 --- a/node_modules/grunt/node_modules/async/package.json +++ b/node_modules/grunt/node_modules/async/package.json @@ -50,7 +50,7 @@ ], "directories": {}, "_shasum": "0fc1aaa088a0e3ef0ebe2d8831bab0dcf8845061", - "_from": "async@~0.1.22", + "_from": "async@0.1.22", "_resolved": "https://registry.npmjs.org/async/-/async-0.1.22.tgz", "readme": "ERROR: No README data found!", "homepage": "https://github.com/caolan/async" diff --git a/node_modules/grunt/node_modules/coffee-script/package.json b/node_modules/grunt/node_modules/coffee-script/package.json index 1fac7ca..8ae4efc 100644 --- a/node_modules/grunt/node_modules/coffee-script/package.json +++ b/node_modules/grunt/node_modules/coffee-script/package.json @@ -62,7 +62,7 @@ } ], "_shasum": "150d6b4cb522894369efed6a2101c20bc7f4a4f4", - "_from": "coffee-script@~1.3.3", + "_from": "coffee-script@1.3.3", "_resolved": "https://registry.npmjs.org/coffee-script/-/coffee-script-1.3.3.tgz", "readme": "ERROR: No README data found!" } diff --git a/node_modules/grunt/node_modules/colors/package.json b/node_modules/grunt/node_modules/colors/package.json index 9cd24a0..bbad484 100644 --- a/node_modules/grunt/node_modules/colors/package.json +++ b/node_modules/grunt/node_modules/colors/package.json @@ -27,7 +27,7 @@ "shasum": "2423fe6678ac0c5dae8852e5d0e5be08c997abcc", "tarball": "http://registry.npmjs.org/colors/-/colors-0.6.2.tgz" }, - "_from": "colors@~0.6.2", + "_from": "colors@0.6.2", "_npmVersion": "1.2.30", "_npmUser": { "name": "marak", diff --git a/node_modules/grunt/node_modules/dateformat/package.json b/node_modules/grunt/node_modules/dateformat/package.json index dbe9490..47cf725 100644 --- a/node_modules/grunt/node_modules/dateformat/package.json +++ b/node_modules/grunt/node_modules/dateformat/package.json @@ -37,5 +37,6 @@ "directories": {}, "_shasum": "b0220c02de98617433b72851cf47de3df2cdbee9", "_from": "dateformat@1.0.2-1.2.3", - "_resolved": "https://registry.npmjs.org/dateformat/-/dateformat-1.0.2-1.2.3.tgz" + "_resolved": "https://registry.npmjs.org/dateformat/-/dateformat-1.0.2-1.2.3.tgz", + "readme": "ERROR: No README data found!" } diff --git a/node_modules/grunt/node_modules/findup-sync/package.json b/node_modules/grunt/node_modules/findup-sync/package.json index 0f20813..7d7cce0 100644 --- a/node_modules/grunt/node_modules/findup-sync/package.json +++ b/node_modules/grunt/node_modules/findup-sync/package.json @@ -46,7 +46,7 @@ "shasum": "7f3e7a97b82392c653bf06589bd85190e93c3683", "tarball": "http://registry.npmjs.org/findup-sync/-/findup-sync-0.1.3.tgz" }, - "_from": "findup-sync@~0.1.2", + "_from": "findup-sync@0.1.3", "_npmVersion": "1.4.4", "_npmUser": { "name": "cowboy", diff --git a/node_modules/grunt/node_modules/glob/package.json b/node_modules/grunt/node_modules/glob/package.json index ea6ea06..c37f48f 100644 --- a/node_modules/grunt/node_modules/glob/package.json +++ b/node_modules/grunt/node_modules/glob/package.json @@ -34,7 +34,7 @@ "shasum": "d29e0a055dea5138f4d07ed40e8982e83c2066cd", "tarball": "http://registry.npmjs.org/glob/-/glob-3.1.21.tgz" }, - "_from": "glob@~3.1.21", + "_from": "glob@3.1.21", "_npmVersion": "1.2.12", "_npmUser": { "name": "isaacs", diff --git a/node_modules/grunt/node_modules/grunt-legacy-log/node_modules/colors/MIT-LICENSE.txt b/node_modules/grunt/node_modules/grunt-legacy-log/node_modules/colors/MIT-LICENSE.txt new file mode 100644 index 0000000..7dca107 --- /dev/null +++ b/node_modules/grunt/node_modules/grunt-legacy-log/node_modules/colors/MIT-LICENSE.txt @@ -0,0 +1,22 @@ +Copyright (c) 2010 + +Marak Squires +Alexis Sellier (cloudhead) + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. \ No newline at end of file diff --git a/node_modules/grunt/node_modules/grunt-legacy-log/node_modules/colors/ReadMe.md b/node_modules/grunt/node_modules/grunt-legacy-log/node_modules/colors/ReadMe.md new file mode 100644 index 0000000..0eda52d --- /dev/null +++ b/node_modules/grunt/node_modules/grunt-legacy-log/node_modules/colors/ReadMe.md @@ -0,0 +1,77 @@ +# colors.js - get color and style in your node.js console ( and browser ) like what + + + + +## Installation + + npm install colors + +## colors and styles! + +- bold +- italic +- underline +- inverse +- yellow +- cyan +- white +- magenta +- green +- red +- grey +- blue +- rainbow +- zebra +- random + +## Usage + +``` js +var colors = require('./colors'); + +console.log('hello'.green); // outputs green text +console.log('i like cake and pies'.underline.red) // outputs red underlined text +console.log('inverse the color'.inverse); // inverses the color +console.log('OMG Rainbows!'.rainbow); // rainbow (ignores spaces) +``` + +# Creating Custom themes + +```js + +var colors = require('colors'); + +colors.setTheme({ + silly: 'rainbow', + input: 'grey', + verbose: 'cyan', + prompt: 'grey', + info: 'green', + data: 'grey', + help: 'cyan', + warn: 'yellow', + debug: 'blue', + error: 'red' +}); + +// outputs red text +console.log("this is an error".error); + +// outputs yellow text +console.log("this is a warning".warn); +``` + + +### Contributors + +Marak (Marak Squires) +Alexis Sellier (cloudhead) +mmalecki (Maciej Małecki) +nicoreed (Nico Reed) +morganrallen (Morgan Allen) +JustinCampbell (Justin Campbell) +ded (Dustin Diaz) + + +#### , Marak Squires , Justin Campbell, Dustin Diaz (@ded) diff --git a/node_modules/grunt/node_modules/grunt-legacy-log/node_modules/colors/colors.js b/node_modules/grunt/node_modules/grunt-legacy-log/node_modules/colors/colors.js new file mode 100644 index 0000000..7a537d8 --- /dev/null +++ b/node_modules/grunt/node_modules/grunt-legacy-log/node_modules/colors/colors.js @@ -0,0 +1,342 @@ +/* +colors.js + +Copyright (c) 2010 + +Marak Squires +Alexis Sellier (cloudhead) + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. + +*/ + +var isHeadless = false; + +if (typeof module !== 'undefined') { + isHeadless = true; +} + +if (!isHeadless) { + var exports = {}; + var module = {}; + var colors = exports; + exports.mode = "browser"; +} else { + exports.mode = "console"; +} + +// +// Prototypes the string object to have additional method calls that add terminal colors +// +var addProperty = function (color, func) { + exports[color] = function (str) { + return func.apply(str); + }; + String.prototype.__defineGetter__(color, func); +}; + +function stylize(str, style) { + + var styles; + + if (exports.mode === 'console') { + styles = { + //styles + 'bold' : ['\x1B[1m', '\x1B[22m'], + 'italic' : ['\x1B[3m', '\x1B[23m'], + 'underline' : ['\x1B[4m', '\x1B[24m'], + 'inverse' : ['\x1B[7m', '\x1B[27m'], + 'strikethrough' : ['\x1B[9m', '\x1B[29m'], + //text colors + //grayscale + 'white' : ['\x1B[37m', '\x1B[39m'], + 'grey' : ['\x1B[90m', '\x1B[39m'], + 'black' : ['\x1B[30m', '\x1B[39m'], + //colors + 'blue' : ['\x1B[34m', '\x1B[39m'], + 'cyan' : ['\x1B[36m', '\x1B[39m'], + 'green' : ['\x1B[32m', '\x1B[39m'], + 'magenta' : ['\x1B[35m', '\x1B[39m'], + 'red' : ['\x1B[31m', '\x1B[39m'], + 'yellow' : ['\x1B[33m', '\x1B[39m'], + //background colors + //grayscale + 'whiteBG' : ['\x1B[47m', '\x1B[49m'], + 'greyBG' : ['\x1B[49;5;8m', '\x1B[49m'], + 'blackBG' : ['\x1B[40m', '\x1B[49m'], + //colors + 'blueBG' : ['\x1B[44m', '\x1B[49m'], + 'cyanBG' : ['\x1B[46m', '\x1B[49m'], + 'greenBG' : ['\x1B[42m', '\x1B[49m'], + 'magentaBG' : ['\x1B[45m', '\x1B[49m'], + 'redBG' : ['\x1B[41m', '\x1B[49m'], + 'yellowBG' : ['\x1B[43m', '\x1B[49m'] + }; + } else if (exports.mode === 'browser') { + styles = { + //styles + 'bold' : ['', ''], + 'italic' : ['', ''], + 'underline' : ['', ''], + 'inverse' : ['', ''], + 'strikethrough' : ['', ''], + //text colors + //grayscale + 'white' : ['', ''], + 'grey' : ['', ''], + 'black' : ['', ''], + //colors + 'blue' : ['', ''], + 'cyan' : ['', ''], + 'green' : ['', ''], + 'magenta' : ['', ''], + 'red' : ['', ''], + 'yellow' : ['', ''], + //background colors + //grayscale + 'whiteBG' : ['', ''], + 'greyBG' : ['', ''], + 'blackBG' : ['', ''], + //colors + 'blueBG' : ['', ''], + 'cyanBG' : ['', ''], + 'greenBG' : ['', ''], + 'magentaBG' : ['', ''], + 'redBG' : ['', ''], + 'yellowBG' : ['', ''] + }; + } else if (exports.mode === 'none') { + return str + ''; + } else { + console.log('unsupported mode, try "browser", "console" or "none"'); + } + return styles[style][0] + str + styles[style][1]; +} + +function applyTheme(theme) { + + // + // Remark: This is a list of methods that exist + // on String that you should not overwrite. + // + var stringPrototypeBlacklist = [ + '__defineGetter__', '__defineSetter__', '__lookupGetter__', '__lookupSetter__', 'charAt', 'constructor', + 'hasOwnProperty', 'isPrototypeOf', 'propertyIsEnumerable', 'toLocaleString', 'toString', 'valueOf', 'charCodeAt', + 'indexOf', 'lastIndexof', 'length', 'localeCompare', 'match', 'replace', 'search', 'slice', 'split', 'substring', + 'toLocaleLowerCase', 'toLocaleUpperCase', 'toLowerCase', 'toUpperCase', 'trim', 'trimLeft', 'trimRight' + ]; + + Object.keys(theme).forEach(function (prop) { + if (stringPrototypeBlacklist.indexOf(prop) !== -1) { + console.log('warn: '.red + ('String.prototype' + prop).magenta + ' is probably something you don\'t want to override. Ignoring style name'); + } + else { + if (typeof(theme[prop]) === 'string') { + addProperty(prop, function () { + return exports[theme[prop]](this); + }); + } + else { + addProperty(prop, function () { + var ret = this; + for (var t = 0; t < theme[prop].length; t++) { + ret = exports[theme[prop][t]](ret); + } + return ret; + }); + } + } + }); +} + + +// +// Iterate through all default styles and colors +// +var x = ['bold', 'underline', 'strikethrough', 'italic', 'inverse', 'grey', 'black', 'yellow', 'red', 'green', 'blue', 'white', 'cyan', 'magenta', 'greyBG', 'blackBG', 'yellowBG', 'redBG', 'greenBG', 'blueBG', 'whiteBG', 'cyanBG', 'magentaBG']; +x.forEach(function (style) { + + // __defineGetter__ at the least works in more browsers + // http://robertnyman.com/javascript/javascript-getters-setters.html + // Object.defineProperty only works in Chrome + addProperty(style, function () { + return stylize(this, style); + }); +}); + +function sequencer(map) { + return function () { + if (!isHeadless) { + return this.replace(/( )/, '$1'); + } + var exploded = this.split(""), i = 0; + exploded = exploded.map(map); + return exploded.join(""); + }; +} + +var rainbowMap = (function () { + var rainbowColors = ['red', 'yellow', 'green', 'blue', 'magenta']; //RoY G BiV + return function (letter, i, exploded) { + if (letter === " ") { + return letter; + } else { + return stylize(letter, rainbowColors[i++ % rainbowColors.length]); + } + }; +})(); + +exports.themes = {}; + +exports.addSequencer = function (name, map) { + addProperty(name, sequencer(map)); +}; + +exports.addSequencer('rainbow', rainbowMap); +exports.addSequencer('zebra', function (letter, i, exploded) { + return i % 2 === 0 ? letter : letter.inverse; +}); + +exports.setTheme = function (theme) { + if (typeof theme === 'string') { + try { + exports.themes[theme] = require(theme); + applyTheme(exports.themes[theme]); + return exports.themes[theme]; + } catch (err) { + console.log(err); + return err; + } + } else { + applyTheme(theme); + } +}; + + +addProperty('stripColors', function () { + return ("" + this).replace(/\x1B\[\d+m/g, ''); +}); + +// please no +function zalgo(text, options) { + var soul = { + "up" : [ + '̍', '̎', '̄', '̅', + '̿', '̑', '̆', '̐', + '͒', '͗', '͑', '̇', + '̈', '̊', '͂', '̓', + '̈', '͊', '͋', '͌', + '̃', '̂', '̌', '͐', + '̀', '́', '̋', '̏', + '̒', '̓', '̔', '̽', + '̉', 'ͣ', 'ͤ', 'ͥ', + 'ͦ', 'ͧ', 'ͨ', 'ͩ', + 'ͪ', 'ͫ', 'ͬ', 'ͭ', + 'ͮ', 'ͯ', '̾', '͛', + '͆', '̚' + ], + "down" : [ + '̖', '̗', '̘', '̙', + '̜', '̝', '̞', '̟', + '̠', '̤', '̥', '̦', + '̩', '̪', '̫', '̬', + '̭', '̮', '̯', '̰', + '̱', '̲', '̳', '̹', + '̺', '̻', '̼', 'ͅ', + '͇', '͈', '͉', '͍', + '͎', '͓', '͔', '͕', + '͖', '͙', '͚', '̣' + ], + "mid" : [ + '̕', '̛', '̀', '́', + '͘', '̡', '̢', '̧', + '̨', '̴', '̵', '̶', + '͜', '͝', '͞', + '͟', '͠', '͢', '̸', + '̷', '͡', ' ҉' + ] + }, + all = [].concat(soul.up, soul.down, soul.mid), + zalgo = {}; + + function randomNumber(range) { + var r = Math.floor(Math.random() * range); + return r; + } + + function is_char(character) { + var bool = false; + all.filter(function (i) { + bool = (i === character); + }); + return bool; + } + + function heComes(text, options) { + var result = '', counts, l; + options = options || {}; + options["up"] = options["up"] || true; + options["mid"] = options["mid"] || true; + options["down"] = options["down"] || true; + options["size"] = options["size"] || "maxi"; + text = text.split(''); + for (l in text) { + if (is_char(l)) { + continue; + } + result = result + text[l]; + counts = {"up" : 0, "down" : 0, "mid" : 0}; + switch (options.size) { + case 'mini': + counts.up = randomNumber(8); + counts.min = randomNumber(2); + counts.down = randomNumber(8); + break; + case 'maxi': + counts.up = randomNumber(16) + 3; + counts.min = randomNumber(4) + 1; + counts.down = randomNumber(64) + 3; + break; + default: + counts.up = randomNumber(8) + 1; + counts.mid = randomNumber(6) / 2; + counts.down = randomNumber(8) + 1; + break; + } + + var arr = ["up", "mid", "down"]; + for (var d in arr) { + var index = arr[d]; + for (var i = 0 ; i <= counts[index]; i++) { + if (options[index]) { + result = result + soul[index][randomNumber(soul[index].length)]; + } + } + } + } + return result; + } + return heComes(text); +} + + +// don't summon zalgo +addProperty('zalgo', function () { + return zalgo(this); +}); diff --git a/node_modules/grunt/node_modules/grunt-legacy-log/node_modules/colors/example.html b/node_modules/grunt/node_modules/grunt-legacy-log/node_modules/colors/example.html new file mode 100644 index 0000000..7a2ae60 --- /dev/null +++ b/node_modules/grunt/node_modules/grunt-legacy-log/node_modules/colors/example.html @@ -0,0 +1,76 @@ + + + + + Colors Example + + + + + + \ No newline at end of file diff --git a/node_modules/grunt/node_modules/grunt-legacy-log/node_modules/colors/example.js b/node_modules/grunt/node_modules/grunt-legacy-log/node_modules/colors/example.js new file mode 100644 index 0000000..b1e03a4 --- /dev/null +++ b/node_modules/grunt/node_modules/grunt-legacy-log/node_modules/colors/example.js @@ -0,0 +1,77 @@ +var colors = require('./colors'); + +//colors.mode = "browser"; + +var test = colors.red("hopefully colorless output"); +console.log('Rainbows are fun!'.rainbow); +console.log('So '.italic + 'are'.underline + ' styles! '.bold + 'inverse'.inverse); // styles not widely supported +console.log('Chains are also cool.'.bold.italic.underline.red); // styles not widely supported +//console.log('zalgo time!'.zalgo); +console.log(test.stripColors); +console.log("a".grey + " b".black); +console.log("Zebras are so fun!".zebra); +console.log('background color attack!'.black.whiteBG) + +// +// Remark: .strikethrough may not work with Mac OS Terminal App +// +console.log("This is " + "not".strikethrough + " fun."); +console.log(colors.rainbow('Rainbows are fun!')); +console.log(colors.italic('So ') + colors.underline('are') + colors.bold(' styles! ') + colors.inverse('inverse')); // styles not widely supported +console.log(colors.bold(colors.italic(colors.underline(colors.red('Chains are also cool.'))))); // styles not widely supported +//console.log(colors.zalgo('zalgo time!')); +console.log(colors.stripColors(test)); +console.log(colors.grey("a") + colors.black(" b")); + +colors.addSequencer("america", function(letter, i, exploded) { + if(letter === " ") return letter; + switch(i%3) { + case 0: return letter.red; + case 1: return letter.white; + case 2: return letter.blue; + } +}); + +colors.addSequencer("random", (function() { + var available = ['bold', 'underline', 'italic', 'inverse', 'grey', 'yellow', 'red', 'green', 'blue', 'white', 'cyan', 'magenta']; + + return function(letter, i, exploded) { + return letter === " " ? letter : letter[available[Math.round(Math.random() * (available.length - 1))]]; + }; +})()); + +console.log("AMERICA! F--K YEAH!".america); +console.log("So apparently I've been to Mars, with all the little green men. But you know, I don't recall.".random); + +// +// Custom themes +// + +// Load theme with JSON literal +colors.setTheme({ + silly: 'rainbow', + input: 'grey', + verbose: 'cyan', + prompt: 'grey', + info: 'green', + data: 'grey', + help: 'cyan', + warn: 'yellow', + debug: 'blue', + error: 'red' +}); + +// outputs red text +console.log("this is an error".error); + +// outputs yellow text +console.log("this is a warning".warn); + +// outputs grey text +console.log("this is an input".input); + +// Load a theme from file +colors.setTheme('./themes/winston-dark.js'); + +console.log("this is an input".input); + diff --git a/node_modules/grunt/node_modules/grunt-legacy-log/node_modules/colors/package.json b/node_modules/grunt/node_modules/grunt-legacy-log/node_modules/colors/package.json new file mode 100644 index 0000000..bbad484 --- /dev/null +++ b/node_modules/grunt/node_modules/grunt-legacy-log/node_modules/colors/package.json @@ -0,0 +1,46 @@ +{ + "name": "colors", + "description": "get colors in your node.js console like what", + "version": "0.6.2", + "author": { + "name": "Marak Squires" + }, + "homepage": "https://github.com/Marak/colors.js", + "bugs": { + "url": "https://github.com/Marak/colors.js/issues" + }, + "keywords": [ + "ansi", + "terminal", + "colors" + ], + "repository": { + "type": "git", + "url": "http://github.com/Marak/colors.js.git" + }, + "engines": { + "node": ">=0.1.90" + }, + "main": "colors", + "_id": "colors@0.6.2", + "dist": { + "shasum": "2423fe6678ac0c5dae8852e5d0e5be08c997abcc", + "tarball": "http://registry.npmjs.org/colors/-/colors-0.6.2.tgz" + }, + "_from": "colors@0.6.2", + "_npmVersion": "1.2.30", + "_npmUser": { + "name": "marak", + "email": "marak.squires@gmail.com" + }, + "maintainers": [ + { + "name": "marak", + "email": "marak.squires@gmail.com" + } + ], + "directories": {}, + "_shasum": "2423fe6678ac0c5dae8852e5d0e5be08c997abcc", + "_resolved": "https://registry.npmjs.org/colors/-/colors-0.6.2.tgz", + "readme": "ERROR: No README data found!" +} diff --git a/node_modules/grunt/node_modules/grunt-legacy-log/node_modules/colors/test.js b/node_modules/grunt/node_modules/grunt-legacy-log/node_modules/colors/test.js new file mode 100644 index 0000000..c32417d --- /dev/null +++ b/node_modules/grunt/node_modules/grunt-legacy-log/node_modules/colors/test.js @@ -0,0 +1,70 @@ +var assert = require('assert'), + colors = require('./colors'); + +var s = 'string'; + +function a(s, code) { + return '\x1B[' + code.toString() + 'm' + s + '\x1B[39m'; +} + +function aE(s, color, code) { + assert.equal(s[color], a(s, code)); + assert.equal(colors[color](s), a(s, code)); + assert.equal(s[color], colors[color](s)); + assert.equal(s[color].stripColors, s); + assert.equal(s[color].stripColors, colors.stripColors(s)); +} + +function h(s, color) { + return '' + s + ''; +} + +var stylesColors = ['white', 'black', 'blue', 'cyan', 'green', 'magenta', 'red', 'yellow']; +var stylesAll = stylesColors.concat(['bold', 'italic', 'underline', 'inverse', 'rainbow']); + +colors.mode = 'console'; +assert.equal(s.bold, '\x1B[1m' + s + '\x1B[22m'); +assert.equal(s.italic, '\x1B[3m' + s + '\x1B[23m'); +assert.equal(s.underline, '\x1B[4m' + s + '\x1B[24m'); +assert.equal(s.strikethrough, '\x1B[9m' + s + '\x1B[29m'); +assert.equal(s.inverse, '\x1B[7m' + s + '\x1B[27m'); +assert.ok(s.rainbow); +aE(s, 'white', 37); +aE(s, 'grey', 90); +aE(s, 'black', 30); +aE(s, 'blue', 34); +aE(s, 'cyan', 36); +aE(s, 'green', 32); +aE(s, 'magenta', 35); +aE(s, 'red', 31); +aE(s, 'yellow', 33); +assert.equal(s, 'string'); + +colors.setTheme({error:'red'}); + +assert.equal(typeof("astring".red),'string'); +assert.equal(typeof("astring".error),'string'); + +colors.mode = 'browser'; +assert.equal(s.bold, '' + s + ''); +assert.equal(s.italic, '' + s + ''); +assert.equal(s.underline, '' + s + ''); +assert.equal(s.strikethrough, '' + s + ''); +assert.equal(s.inverse, '' + s + ''); +assert.ok(s.rainbow); +stylesColors.forEach(function (color) { + assert.equal(s[color], h(s, color)); + assert.equal(colors[color](s), h(s, color)); +}); + +assert.equal(typeof("astring".red),'string'); +assert.equal(typeof("astring".error),'string'); + +colors.mode = 'none'; +stylesAll.forEach(function (style) { + assert.equal(s[style], s); + assert.equal(colors[style](s), s); +}); + +assert.equal(typeof("astring".red),'string'); +assert.equal(typeof("astring".error),'string'); diff --git a/node_modules/grunt/node_modules/grunt-legacy-log/node_modules/colors/themes/winston-dark.js b/node_modules/grunt/node_modules/grunt-legacy-log/node_modules/colors/themes/winston-dark.js new file mode 100644 index 0000000..49a905b --- /dev/null +++ b/node_modules/grunt/node_modules/grunt-legacy-log/node_modules/colors/themes/winston-dark.js @@ -0,0 +1,12 @@ +module['exports'] = { + silly: 'rainbow', + input: 'black', + verbose: 'cyan', + prompt: 'grey', + info: 'green', + data: 'grey', + help: 'cyan', + warn: 'yellow', + debug: 'blue', + error: 'red' +}; \ No newline at end of file diff --git a/node_modules/grunt/node_modules/grunt-legacy-log/node_modules/colors/themes/winston-light.js b/node_modules/grunt/node_modules/grunt-legacy-log/node_modules/colors/themes/winston-light.js new file mode 100644 index 0000000..571972c --- /dev/null +++ b/node_modules/grunt/node_modules/grunt-legacy-log/node_modules/colors/themes/winston-light.js @@ -0,0 +1,12 @@ +module['exports'] = { + silly: 'rainbow', + input: 'grey', + verbose: 'cyan', + prompt: 'grey', + info: 'green', + data: 'grey', + help: 'cyan', + warn: 'yellow', + debug: 'blue', + error: 'red' +}; \ No newline at end of file diff --git a/node_modules/grunt/node_modules/grunt-legacy-log/node_modules/lodash/package.json b/node_modules/grunt/node_modules/grunt-legacy-log/node_modules/lodash/package.json index 86d83d8..6322ff4 100644 --- a/node_modules/grunt/node_modules/grunt-legacy-log/node_modules/lodash/package.json +++ b/node_modules/grunt/node_modules/grunt-legacy-log/node_modules/lodash/package.json @@ -100,7 +100,7 @@ "shasum": "5b7723034dda4d262e5a46fb2c58d7cc22f71420", "tarball": "http://registry.npmjs.org/lodash/-/lodash-2.4.1.tgz" }, - "_from": "lodash@~2.4.1", + "_from": "lodash@2.4.1", "_npmVersion": "1.3.14", "_npmUser": { "name": "jdalton", diff --git a/node_modules/grunt/node_modules/grunt-legacy-log/node_modules/underscore.string/package.json b/node_modules/grunt/node_modules/grunt-legacy-log/node_modules/underscore.string/package.json index 1d0ca13..d57a1a3 100644 --- a/node_modules/grunt/node_modules/grunt-legacy-log/node_modules/underscore.string/package.json +++ b/node_modules/grunt/node_modules/grunt-legacy-log/node_modules/underscore.string/package.json @@ -71,7 +71,7 @@ "shasum": "71c08bf6b428b1133f37e78fa3a21c82f7329b0d", "tarball": "http://registry.npmjs.org/underscore.string/-/underscore.string-2.3.3.tgz" }, - "_from": "underscore.string@~2.3.3", + "_from": "underscore.string@2.3.3", "_npmVersion": "1.2.32", "_npmUser": { "name": "epeli", diff --git a/node_modules/grunt/node_modules/grunt-legacy-util/node_modules/.bin/which b/node_modules/grunt/node_modules/grunt-legacy-util/node_modules/.bin/which new file mode 120000 index 0000000..f62471c --- /dev/null +++ b/node_modules/grunt/node_modules/grunt-legacy-util/node_modules/.bin/which @@ -0,0 +1 @@ +../which/bin/which \ No newline at end of file diff --git a/node_modules/grunt/node_modules/grunt-legacy-util/node_modules/async/.gitmodules b/node_modules/grunt/node_modules/grunt-legacy-util/node_modules/async/.gitmodules new file mode 100644 index 0000000..a9aae98 --- /dev/null +++ b/node_modules/grunt/node_modules/grunt-legacy-util/node_modules/async/.gitmodules @@ -0,0 +1,9 @@ +[submodule "deps/nodeunit"] + path = deps/nodeunit + url = git://github.com/caolan/nodeunit.git +[submodule "deps/UglifyJS"] + path = deps/UglifyJS + url = https://github.com/mishoo/UglifyJS.git +[submodule "deps/nodelint"] + path = deps/nodelint + url = https://github.com/tav/nodelint.git diff --git a/node_modules/grunt/node_modules/grunt-legacy-util/node_modules/async/.npmignore b/node_modules/grunt/node_modules/grunt-legacy-util/node_modules/async/.npmignore new file mode 100644 index 0000000..9bdfc97 --- /dev/null +++ b/node_modules/grunt/node_modules/grunt-legacy-util/node_modules/async/.npmignore @@ -0,0 +1,4 @@ +deps +dist +test +nodelint.cfg \ No newline at end of file diff --git a/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/mime/LICENSE b/node_modules/grunt/node_modules/grunt-legacy-util/node_modules/async/LICENSE similarity index 95% rename from node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/mime/LICENSE rename to node_modules/grunt/node_modules/grunt-legacy-util/node_modules/async/LICENSE index 451fc45..b7f9d50 100644 --- a/node_modules/bower/node_modules/bower-registry-client/node_modules/request/node_modules/mime/LICENSE +++ b/node_modules/grunt/node_modules/grunt-legacy-util/node_modules/async/LICENSE @@ -1,4 +1,4 @@ -Copyright (c) 2010 Benjamin Thomas, Robert Kieffer +Copyright (c) 2010 Caolan McMahon Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/node_modules/grunt/node_modules/grunt-legacy-util/node_modules/async/Makefile b/node_modules/grunt/node_modules/grunt-legacy-util/node_modules/async/Makefile new file mode 100644 index 0000000..bad647c --- /dev/null +++ b/node_modules/grunt/node_modules/grunt-legacy-util/node_modules/async/Makefile @@ -0,0 +1,25 @@ +PACKAGE = asyncjs +NODEJS = $(if $(shell test -f /usr/bin/nodejs && echo "true"),nodejs,node) +CWD := $(shell pwd) +NODEUNIT = $(CWD)/node_modules/nodeunit/bin/nodeunit +UGLIFY = $(CWD)/node_modules/uglify-js/bin/uglifyjs +NODELINT = $(CWD)/node_modules/nodelint/nodelint + +BUILDDIR = dist + +all: clean test build + +build: $(wildcard lib/*.js) + mkdir -p $(BUILDDIR) + $(UGLIFY) lib/async.js > $(BUILDDIR)/async.min.js + +test: + $(NODEUNIT) test + +clean: + rm -rf $(BUILDDIR) + +lint: + $(NODELINT) --config nodelint.cfg lib/async.js + +.PHONY: test build all diff --git a/node_modules/grunt/node_modules/grunt-legacy-util/node_modules/async/README.md b/node_modules/grunt/node_modules/grunt-legacy-util/node_modules/async/README.md new file mode 100644 index 0000000..1bbbc47 --- /dev/null +++ b/node_modules/grunt/node_modules/grunt-legacy-util/node_modules/async/README.md @@ -0,0 +1,1021 @@ +# Async.js + +Async is a utility module which provides straight-forward, powerful functions +for working with asynchronous JavaScript. Although originally designed for +use with [node.js](http://nodejs.org), it can also be used directly in the +browser. + +Async provides around 20 functions that include the usual 'functional' +suspects (map, reduce, filter, forEach…) as well as some common patterns +for asynchronous control flow (parallel, series, waterfall…). All these +functions assume you follow the node.js convention of providing a single +callback as the last argument of your async function. + + +## Quick Examples + + async.map(['file1','file2','file3'], fs.stat, function(err, results){ + // results is now an array of stats for each file + }); + + async.filter(['file1','file2','file3'], path.exists, function(results){ + // results now equals an array of the existing files + }); + + async.parallel([ + function(){ ... }, + function(){ ... } + ], callback); + + async.series([ + function(){ ... }, + function(){ ... } + ]); + +There are many more functions available so take a look at the docs below for a +full list. This module aims to be comprehensive, so if you feel anything is +missing please create a GitHub issue for it. + + +## Download + +Releases are available for download from +[GitHub](http://github.com/caolan/async/downloads). +Alternatively, you can install using Node Package Manager (npm): + + npm install async + + +__Development:__ [async.js](https://github.com/caolan/async/raw/master/lib/async.js) - 17.5kb Uncompressed + +__Production:__ [async.min.js](https://github.com/caolan/async/raw/master/dist/async.min.js) - 1.7kb Packed and Gzipped + + +## In the Browser + +So far its been tested in IE6, IE7, IE8, FF3.6 and Chrome 5. Usage: + + + + + +## Documentation + +### Collections + +* [forEach](#forEach) +* [map](#map) +* [filter](#filter) +* [reject](#reject) +* [reduce](#reduce) +* [detect](#detect) +* [sortBy](#sortBy) +* [some](#some) +* [every](#every) +* [concat](#concat) + +### Control Flow + +* [series](#series) +* [parallel](#parallel) +* [whilst](#whilst) +* [until](#until) +* [waterfall](#waterfall) +* [queue](#queue) +* [auto](#auto) +* [iterator](#iterator) +* [apply](#apply) +* [nextTick](#nextTick) + +### Utils + +* [memoize](#memoize) +* [unmemoize](#unmemoize) +* [log](#log) +* [dir](#dir) +* [noConflict](#noConflict) + + +## Collections + + +### forEach(arr, iterator, callback) + +Applies an iterator function to each item in an array, in parallel. +The iterator is called with an item from the list and a callback for when it +has finished. If the iterator passes an error to this callback, the main +callback for the forEach function is immediately called with the error. + +Note, that since this function applies the iterator to each item in parallel +there is no guarantee that the iterator functions will complete in order. + +__Arguments__ + +* arr - An array to iterate over. +* iterator(item, callback) - A function to apply to each item in the array. + The iterator is passed a callback which must be called once it has completed. +* callback(err) - A callback which is called after all the iterator functions + have finished, or an error has occurred. + +__Example__ + + // assuming openFiles is an array of file names and saveFile is a function + // to save the modified contents of that file: + + async.forEach(openFiles, saveFile, function(err){ + // if any of the saves produced an error, err would equal that error + }); + +--------------------------------------- + + +### forEachSeries(arr, iterator, callback) + +The same as forEach only the iterator is applied to each item in the array in +series. The next iterator is only called once the current one has completed +processing. This means the iterator functions will complete in order. + + +--------------------------------------- + + +### forEachLimit(arr, limit, iterator, callback) + +The same as forEach only the iterator is applied to batches of items in the +array, in series. The next batch of iterators is only called once the current +one has completed processing. + +__Arguments__ + +* arr - An array to iterate over. +* limit - How many items should be in each batch. +* iterator(item, callback) - A function to apply to each item in the array. + The iterator is passed a callback which must be called once it has completed. +* callback(err) - A callback which is called after all the iterator functions + have finished, or an error has occurred. + +__Example__ + + // Assume documents is an array of JSON objects and requestApi is a + // function that interacts with a rate-limited REST api. + + async.forEachLimit(documents, 20, requestApi, function(err){ + // if any of the saves produced an error, err would equal that error + }); +--------------------------------------- + + +### map(arr, iterator, callback) + +Produces a new array of values by mapping each value in the given array through +the iterator function. The iterator is called with an item from the array and a +callback for when it has finished processing. The callback takes 2 arguments, +an error and the transformed item from the array. If the iterator passes an +error to this callback, the main callback for the map function is immediately +called with the error. + +Note, that since this function applies the iterator to each item in parallel +there is no guarantee that the iterator functions will complete in order, however +the results array will be in the same order as the original array. + +__Arguments__ + +* arr - An array to iterate over. +* iterator(item, callback) - A function to apply to each item in the array. + The iterator is passed a callback which must be called once it has completed + with an error (which can be null) and a transformed item. +* callback(err, results) - A callback which is called after all the iterator + functions have finished, or an error has occurred. Results is an array of the + transformed items from the original array. + +__Example__ + + async.map(['file1','file2','file3'], fs.stat, function(err, results){ + // results is now an array of stats for each file + }); + +--------------------------------------- + + +### mapSeries(arr, iterator, callback) + +The same as map only the iterator is applied to each item in the array in +series. The next iterator is only called once the current one has completed +processing. The results array will be in the same order as the original. + + +--------------------------------------- + + +### filter(arr, iterator, callback) + +__Alias:__ select + +Returns a new array of all the values which pass an async truth test. +_The callback for each iterator call only accepts a single argument of true or +false, it does not accept an error argument first!_ This is in-line with the +way node libraries work with truth tests like path.exists. This operation is +performed in parallel, but the results array will be in the same order as the +original. + +__Arguments__ + +* arr - An array to iterate over. +* iterator(item, callback) - A truth test to apply to each item in the array. + The iterator is passed a callback which must be called once it has completed. +* callback(results) - A callback which is called after all the iterator + functions have finished. + +__Example__ + + async.filter(['file1','file2','file3'], path.exists, function(results){ + // results now equals an array of the existing files + }); + +--------------------------------------- + + +### filterSeries(arr, iterator, callback) + +__alias:__ selectSeries + +The same as filter only the iterator is applied to each item in the array in +series. The next iterator is only called once the current one has completed +processing. The results array will be in the same order as the original. + +--------------------------------------- + + +### reject(arr, iterator, callback) + +The opposite of filter. Removes values that pass an async truth test. + +--------------------------------------- + + +### rejectSeries(arr, iterator, callback) + +The same as filter, only the iterator is applied to each item in the array +in series. + + +--------------------------------------- + + +### reduce(arr, memo, iterator, callback) + +__aliases:__ inject, foldl + +Reduces a list of values into a single value using an async iterator to return +each successive step. Memo is the initial state of the reduction. This +function only operates in series. For performance reasons, it may make sense to +split a call to this function into a parallel map, then use the normal +Array.prototype.reduce on the results. This function is for situations where +each step in the reduction needs to be async, if you can get the data before +reducing it then its probably a good idea to do so. + +__Arguments__ + +* arr - An array to iterate over. +* memo - The initial state of the reduction. +* iterator(memo, item, callback) - A function applied to each item in the + array to produce the next step in the reduction. The iterator is passed a + callback which accepts an optional error as its first argument, and the state + of the reduction as the second. If an error is passed to the callback, the + reduction is stopped and the main callback is immediately called with the + error. +* callback(err, result) - A callback which is called after all the iterator + functions have finished. Result is the reduced value. + +__Example__ + + async.reduce([1,2,3], 0, function(memo, item, callback){ + // pointless async: + process.nextTick(function(){ + callback(null, memo + item) + }); + }, function(err, result){ + // result is now equal to the last value of memo, which is 6 + }); + +--------------------------------------- + + +### reduceRight(arr, memo, iterator, callback) + +__Alias:__ foldr + +Same as reduce, only operates on the items in the array in reverse order. + + +--------------------------------------- + + +### detect(arr, iterator, callback) + +Returns the first value in a list that passes an async truth test. The +iterator is applied in parallel, meaning the first iterator to return true will +fire the detect callback with that result. That means the result might not be +the first item in the original array (in terms of order) that passes the test. + +If order within the original array is important then look at detectSeries. + +__Arguments__ + +* arr - An array to iterate over. +* iterator(item, callback) - A truth test to apply to each item in the array. + The iterator is passed a callback which must be called once it has completed. +* callback(result) - A callback which is called as soon as any iterator returns + true, or after all the iterator functions have finished. Result will be + the first item in the array that passes the truth test (iterator) or the + value undefined if none passed. + +__Example__ + + async.detect(['file1','file2','file3'], path.exists, function(result){ + // result now equals the first file in the list that exists + }); + +--------------------------------------- + + +### detectSeries(arr, iterator, callback) + +The same as detect, only the iterator is applied to each item in the array +in series. This means the result is always the first in the original array (in +terms of array order) that passes the truth test. + + +--------------------------------------- + + +### sortBy(arr, iterator, callback) + +Sorts a list by the results of running each value through an async iterator. + +__Arguments__ + +* arr - An array to iterate over. +* iterator(item, callback) - A function to apply to each item in the array. + The iterator is passed a callback which must be called once it has completed + with an error (which can be null) and a value to use as the sort criteria. +* callback(err, results) - A callback which is called after all the iterator + functions have finished, or an error has occurred. Results is the items from + the original array sorted by the values returned by the iterator calls. + +__Example__ + + async.sortBy(['file1','file2','file3'], function(file, callback){ + fs.stat(file, function(err, stats){ + callback(err, stats.mtime); + }); + }, function(err, results){ + // results is now the original array of files sorted by + // modified date + }); + + +--------------------------------------- + + +### some(arr, iterator, callback) + +__Alias:__ any + +Returns true if at least one element in the array satisfies an async test. +_The callback for each iterator call only accepts a single argument of true or +false, it does not accept an error argument first!_ This is in-line with the +way node libraries work with truth tests like path.exists. Once any iterator +call returns true, the main callback is immediately called. + +__Arguments__ + +* arr - An array to iterate over. +* iterator(item, callback) - A truth test to apply to each item in the array. + The iterator is passed a callback which must be called once it has completed. +* callback(result) - A callback which is called as soon as any iterator returns + true, or after all the iterator functions have finished. Result will be + either true or false depending on the values of the async tests. + +__Example__ + + async.some(['file1','file2','file3'], path.exists, function(result){ + // if result is true then at least one of the files exists + }); + +--------------------------------------- + + +### every(arr, iterator, callback) + +__Alias:__ all + +Returns true if every element in the array satisfies an async test. +_The callback for each iterator call only accepts a single argument of true or +false, it does not accept an error argument first!_ This is in-line with the +way node libraries work with truth tests like path.exists. + +__Arguments__ + +* arr - An array to iterate over. +* iterator(item, callback) - A truth test to apply to each item in the array. + The iterator is passed a callback which must be called once it has completed. +* callback(result) - A callback which is called after all the iterator + functions have finished. Result will be either true or false depending on + the values of the async tests. + +__Example__ + + async.every(['file1','file2','file3'], path.exists, function(result){ + // if result is true then every file exists + }); + +--------------------------------------- + + +### concat(arr, iterator, callback) + +Applies an iterator to each item in a list, concatenating the results. Returns the +concatenated list. The iterators are called in parallel, and the results are +concatenated as they return. There is no guarantee that the results array will +be returned in the original order of the arguments passed to the iterator function. + +__Arguments__ + +* arr - An array to iterate over +* iterator(item, callback) - A function to apply to each item in the array. + The iterator is passed a callback which must be called once it has completed + with an error (which can be null) and an array of results. +* callback(err, results) - A callback which is called after all the iterator + functions have finished, or an error has occurred. Results is an array containing + the concatenated results of the iterator function. + +__Example__ + + async.concat(['dir1','dir2','dir3'], fs.readdir, function(err, files){ + // files is now a list of filenames that exist in the 3 directories + }); + +--------------------------------------- + + +### concatSeries(arr, iterator, callback) + +Same as async.concat, but executes in series instead of parallel. + + +## Control Flow + + +### series(tasks, [callback]) + +Run an array of functions in series, each one running once the previous +function has completed. If any functions in the series pass an error to its +callback, no more functions are run and the callback for the series is +immediately called with the value of the error. Once the tasks have completed, +the results are passed to the final callback as an array. + +It is also possible to use an object instead of an array. Each property will be +run as a function and the results will be passed to the final callback as an object +instead of an array. This can be a more readable way of handling results from +async.series. + + +__Arguments__ + +* tasks - An array or object containing functions to run, each function is passed + a callback it must call on completion. +* callback(err, results) - An optional callback to run once all the functions + have completed. This function gets an array of all the arguments passed to + the callbacks used in the array. + +__Example__ + + async.series([ + function(callback){ + // do some stuff ... + callback(null, 'one'); + }, + function(callback){ + // do some more stuff ... + callback(null, 'two'); + }, + ], + // optional callback + function(err, results){ + // results is now equal to ['one', 'two'] + }); + + + // an example using an object instead of an array + async.series({ + one: function(callback){ + setTimeout(function(){ + callback(null, 1); + }, 200); + }, + two: function(callback){ + setTimeout(function(){ + callback(null, 2); + }, 100); + }, + }, + function(err, results) { + // results is now equal to: {one: 1, two: 2} + }); + + +--------------------------------------- + + +### parallel(tasks, [callback]) + +Run an array of functions in parallel, without waiting until the previous +function has completed. If any of the functions pass an error to its +callback, the main callback is immediately called with the value of the error. +Once the tasks have completed, the results are passed to the final callback as an +array. + +It is also possible to use an object instead of an array. Each property will be +run as a function and the results will be passed to the final callback as an object +instead of an array. This can be a more readable way of handling results from +async.parallel. + + +__Arguments__ + +* tasks - An array or object containing functions to run, each function is passed a + callback it must call on completion. +* callback(err, results) - An optional callback to run once all the functions + have completed. This function gets an array of all the arguments passed to + the callbacks used in the array. + +__Example__ + + async.parallel([ + function(callback){ + setTimeout(function(){ + callback(null, 'one'); + }, 200); + }, + function(callback){ + setTimeout(function(){ + callback(null, 'two'); + }, 100); + }, + ], + // optional callback + function(err, results){ + // the results array will equal ['one','two'] even though + // the second function had a shorter timeout. + }); + + + // an example using an object instead of an array + async.parallel({ + one: function(callback){ + setTimeout(function(){ + callback(null, 1); + }, 200); + }, + two: function(callback){ + setTimeout(function(){ + callback(null, 2); + }, 100); + }, + }, + function(err, results) { + // results is now equals to: {one: 1, two: 2} + }); + + +--------------------------------------- + + +### whilst(test, fn, callback) + +Repeatedly call fn, while test returns true. Calls the callback when stopped, +or an error occurs. + +__Arguments__ + +* test() - synchronous truth test to perform before each execution of fn. +* fn(callback) - A function to call each time the test passes. The function is + passed a callback which must be called once it has completed with an optional + error as the first argument. +* callback(err) - A callback which is called after the test fails and repeated + execution of fn has stopped. + +__Example__ + + var count = 0; + + async.whilst( + function () { return count < 5; }, + function (callback) { + count++; + setTimeout(callback, 1000); + }, + function (err) { + // 5 seconds have passed + } + ); + + +--------------------------------------- + + +### until(test, fn, callback) + +Repeatedly call fn, until test returns true. Calls the callback when stopped, +or an error occurs. + +The inverse of async.whilst. + + +--------------------------------------- + + +### waterfall(tasks, [callback]) + +Runs an array of functions in series, each passing their results to the next in +the array. However, if any of the functions pass an error to the callback, the +next function is not executed and the main callback is immediately called with +the error. + +__Arguments__ + +* tasks - An array of functions to run, each function is passed a callback it + must call on completion. +* callback(err, [results]) - An optional callback to run once all the functions + have completed. This will be passed the results of the last task's callback. + + + +__Example__ + + async.waterfall([ + function(callback){ + callback(null, 'one', 'two'); + }, + function(arg1, arg2, callback){ + callback(null, 'three'); + }, + function(arg1, callback){ + // arg1 now equals 'three' + callback(null, 'done'); + } + ], function (err, result) { + // result now equals 'done' + }); + + +--------------------------------------- + + +### queue(worker, concurrency) + +Creates a queue object with the specified concurrency. Tasks added to the +queue will be processed in parallel (up to the concurrency limit). If all +workers are in progress, the task is queued until one is available. Once +a worker has completed a task, the task's callback is called. + +__Arguments__ + +* worker(task, callback) - An asynchronous function for processing a queued + task. +* concurrency - An integer for determining how many worker functions should be + run in parallel. + +__Queue objects__ + +The queue object returned by this function has the following properties and +methods: + +* length() - a function returning the number of items waiting to be processed. +* concurrency - an integer for determining how many worker functions should be + run in parallel. This property can be changed after a queue is created to + alter the concurrency on-the-fly. +* push(task, [callback]) - add a new task to the queue, the callback is called + once the worker has finished processing the task. + instead of a single task, an array of tasks can be submitted. the respective callback is used for every task in the list. +* saturated - a callback that is called when the queue length hits the concurrency and further tasks will be queued +* empty - a callback that is called when the last item from the queue is given to a worker +* drain - a callback that is called when the last item from the queue has returned from the worker + +__Example__ + + // create a queue object with concurrency 2 + + var q = async.queue(function (task, callback) { + console.log('hello ' + task.name); + callback(); + }, 2); + + + // assign a callback + q.drain = function() { + console.log('all items have been processed'); + } + + // add some items to the queue + + q.push({name: 'foo'}, function (err) { + console.log('finished processing foo'); + }); + q.push({name: 'bar'}, function (err) { + console.log('finished processing bar'); + }); + + // add some items to the queue (batch-wise) + + q.push([{name: 'baz'},{name: 'bay'},{name: 'bax'}], function (err) { + console.log('finished processing bar'); + }); + + +--------------------------------------- + + +### auto(tasks, [callback]) + +Determines the best order for running functions based on their requirements. +Each function can optionally depend on other functions being completed first, +and each function is run as soon as its requirements are satisfied. If any of +the functions pass an error to their callback, that function will not complete +(so any other functions depending on it will not run) and the main callback +will be called immediately with the error. Functions also receive an object +containing the results of functions which have completed so far. + +__Arguments__ + +* tasks - An object literal containing named functions or an array of + requirements, with the function itself the last item in the array. The key + used for each function or array is used when specifying requirements. The + syntax is easier to understand by looking at the example. +* callback(err, results) - An optional callback which is called when all the + tasks have been completed. The callback will receive an error as an argument + if any tasks pass an error to their callback. If all tasks complete + successfully, it will receive an object containing their results. + +__Example__ + + async.auto({ + get_data: function(callback){ + // async code to get some data + }, + make_folder: function(callback){ + // async code to create a directory to store a file in + // this is run at the same time as getting the data + }, + write_file: ['get_data', 'make_folder', function(callback){ + // once there is some data and the directory exists, + // write the data to a file in the directory + callback(null, filename); + }], + email_link: ['write_file', function(callback, results){ + // once the file is written let's email a link to it... + // results.write_file contains the filename returned by write_file. + }] + }); + +This is a fairly trivial example, but to do this using the basic parallel and +series functions would look like this: + + async.parallel([ + function(callback){ + // async code to get some data + }, + function(callback){ + // async code to create a directory to store a file in + // this is run at the same time as getting the data + } + ], + function(results){ + async.series([ + function(callback){ + // once there is some data and the directory exists, + // write the data to a file in the directory + }, + email_link: function(callback){ + // once the file is written let's email a link to it... + } + ]); + }); + +For a complicated series of async tasks using the auto function makes adding +new tasks much easier and makes the code more readable. + + +--------------------------------------- + + +### iterator(tasks) + +Creates an iterator function which calls the next function in the array, +returning a continuation to call the next one after that. Its also possible to +'peek' the next iterator by doing iterator.next(). + +This function is used internally by the async module but can be useful when +you want to manually control the flow of functions in series. + +__Arguments__ + +* tasks - An array of functions to run, each function is passed a callback it + must call on completion. + +__Example__ + + var iterator = async.iterator([ + function(){ sys.p('one'); }, + function(){ sys.p('two'); }, + function(){ sys.p('three'); } + ]); + + node> var iterator2 = iterator(); + 'one' + node> var iterator3 = iterator2(); + 'two' + node> iterator3(); + 'three' + node> var nextfn = iterator2.next(); + node> nextfn(); + 'three' + + +--------------------------------------- + + +### apply(function, arguments..) + +Creates a continuation function with some arguments already applied, a useful +shorthand when combined with other control flow functions. Any arguments +passed to the returned function are added to the arguments originally passed +to apply. + +__Arguments__ + +* function - The function you want to eventually apply all arguments to. +* arguments... - Any number of arguments to automatically apply when the + continuation is called. + +__Example__ + + // using apply + + async.parallel([ + async.apply(fs.writeFile, 'testfile1', 'test1'), + async.apply(fs.writeFile, 'testfile2', 'test2'), + ]); + + + // the same process without using apply + + async.parallel([ + function(callback){ + fs.writeFile('testfile1', 'test1', callback); + }, + function(callback){ + fs.writeFile('testfile2', 'test2', callback); + }, + ]); + +It's possible to pass any number of additional arguments when calling the +continuation: + + node> var fn = async.apply(sys.puts, 'one'); + node> fn('two', 'three'); + one + two + three + +--------------------------------------- + + +### nextTick(callback) + +Calls the callback on a later loop around the event loop. In node.js this just +calls process.nextTick, in the browser it falls back to setTimeout(callback, 0), +which means other higher priority events may precede the execution of the callback. + +This is used internally for browser-compatibility purposes. + +__Arguments__ + +* callback - The function to call on a later loop around the event loop. + +__Example__ + + var call_order = []; + async.nextTick(function(){ + call_order.push('two'); + // call_order now equals ['one','two] + }); + call_order.push('one') + + +## Utils + + +### memoize(fn, [hasher]) + +Caches the results of an async function. When creating a hash to store function +results against, the callback is omitted from the hash and an optional hash +function can be used. + +__Arguments__ + +* fn - the function you to proxy and cache results from. +* hasher - an optional function for generating a custom hash for storing + results, it has all the arguments applied to it apart from the callback, and + must be synchronous. + +__Example__ + + var slow_fn = function (name, callback) { + // do something + callback(null, result); + }; + var fn = async.memoize(slow_fn); + + // fn can now be used as if it were slow_fn + fn('some name', function () { + // callback + }); + + +### unmemoize(fn) + +Undoes a memoized function, reverting it to the original, unmemoized +form. Comes handy in tests. + +__Arguments__ + +* fn - the memoized function + + +### log(function, arguments) + +Logs the result of an async function to the console. Only works in node.js or +in browsers that support console.log and console.error (such as FF and Chrome). +If multiple arguments are returned from the async function, console.log is +called on each argument in order. + +__Arguments__ + +* function - The function you want to eventually apply all arguments to. +* arguments... - Any number of arguments to apply to the function. + +__Example__ + + var hello = function(name, callback){ + setTimeout(function(){ + callback(null, 'hello ' + name); + }, 1000); + }; + + node> async.log(hello, 'world'); + 'hello world' + + +--------------------------------------- + + +### dir(function, arguments) + +Logs the result of an async function to the console using console.dir to +display the properties of the resulting object. Only works in node.js or +in browsers that support console.dir and console.error (such as FF and Chrome). +If multiple arguments are returned from the async function, console.dir is +called on each argument in order. + +__Arguments__ + +* function - The function you want to eventually apply all arguments to. +* arguments... - Any number of arguments to apply to the function. + +__Example__ + + var hello = function(name, callback){ + setTimeout(function(){ + callback(null, {hello: name}); + }, 1000); + }; + + node> async.dir(hello, 'world'); + {hello: 'world'} + + +--------------------------------------- + + +### noConflict() + +Changes the value of async back to its original value, returning a reference to the +async object. diff --git a/node_modules/grunt/node_modules/grunt-legacy-util/node_modules/async/index.js b/node_modules/grunt/node_modules/grunt-legacy-util/node_modules/async/index.js new file mode 100644 index 0000000..8e23845 --- /dev/null +++ b/node_modules/grunt/node_modules/grunt-legacy-util/node_modules/async/index.js @@ -0,0 +1,3 @@ +// This file is just added for convenience so this repository can be +// directly checked out into a project's deps folder +module.exports = require('./lib/async'); diff --git a/node_modules/grunt/node_modules/grunt-legacy-util/node_modules/async/lib/async.js b/node_modules/grunt/node_modules/grunt-legacy-util/node_modules/async/lib/async.js new file mode 100644 index 0000000..7cc4f5e --- /dev/null +++ b/node_modules/grunt/node_modules/grunt-legacy-util/node_modules/async/lib/async.js @@ -0,0 +1,692 @@ +/*global setTimeout: false, console: false */ +(function () { + + var async = {}; + + // global on the server, window in the browser + var root = this, + previous_async = root.async; + + if (typeof module !== 'undefined' && module.exports) { + module.exports = async; + } + else { + root.async = async; + } + + async.noConflict = function () { + root.async = previous_async; + return async; + }; + + //// cross-browser compatiblity functions //// + + var _forEach = function (arr, iterator) { + if (arr.forEach) { + return arr.forEach(iterator); + } + for (var i = 0; i < arr.length; i += 1) { + iterator(arr[i], i, arr); + } + }; + + var _map = function (arr, iterator) { + if (arr.map) { + return arr.map(iterator); + } + var results = []; + _forEach(arr, function (x, i, a) { + results.push(iterator(x, i, a)); + }); + return results; + }; + + var _reduce = function (arr, iterator, memo) { + if (arr.reduce) { + return arr.reduce(iterator, memo); + } + _forEach(arr, function (x, i, a) { + memo = iterator(memo, x, i, a); + }); + return memo; + }; + + var _keys = function (obj) { + if (Object.keys) { + return Object.keys(obj); + } + var keys = []; + for (var k in obj) { + if (obj.hasOwnProperty(k)) { + keys.push(k); + } + } + return keys; + }; + + //// exported async module functions //// + + //// nextTick implementation with browser-compatible fallback //// + if (typeof process === 'undefined' || !(process.nextTick)) { + async.nextTick = function (fn) { + setTimeout(fn, 0); + }; + } + else { + async.nextTick = process.nextTick; + } + + async.forEach = function (arr, iterator, callback) { + callback = callback || function () {}; + if (!arr.length) { + return callback(); + } + var completed = 0; + _forEach(arr, function (x) { + iterator(x, function (err) { + if (err) { + callback(err); + callback = function () {}; + } + else { + completed += 1; + if (completed === arr.length) { + callback(null); + } + } + }); + }); + }; + + async.forEachSeries = function (arr, iterator, callback) { + callback = callback || function () {}; + if (!arr.length) { + return callback(); + } + var completed = 0; + var iterate = function () { + iterator(arr[completed], function (err) { + if (err) { + callback(err); + callback = function () {}; + } + else { + completed += 1; + if (completed === arr.length) { + callback(null); + } + else { + iterate(); + } + } + }); + }; + iterate(); + }; + + async.forEachLimit = function (arr, limit, iterator, callback) { + callback = callback || function () {}; + if (!arr.length || limit <= 0) { + return callback(); + } + var completed = 0; + var started = 0; + var running = 0; + + (function replenish () { + if (completed === arr.length) { + return callback(); + } + + while (running < limit && started < arr.length) { + started += 1; + running += 1; + iterator(arr[started - 1], function (err) { + if (err) { + callback(err); + callback = function () {}; + } + else { + completed += 1; + running -= 1; + if (completed === arr.length) { + callback(); + } + else { + replenish(); + } + } + }); + } + })(); + }; + + + var doParallel = function (fn) { + return function () { + var args = Array.prototype.slice.call(arguments); + return fn.apply(null, [async.forEach].concat(args)); + }; + }; + var doSeries = function (fn) { + return function () { + var args = Array.prototype.slice.call(arguments); + return fn.apply(null, [async.forEachSeries].concat(args)); + }; + }; + + + var _asyncMap = function (eachfn, arr, iterator, callback) { + var results = []; + arr = _map(arr, function (x, i) { + return {index: i, value: x}; + }); + eachfn(arr, function (x, callback) { + iterator(x.value, function (err, v) { + results[x.index] = v; + callback(err); + }); + }, function (err) { + callback(err, results); + }); + }; + async.map = doParallel(_asyncMap); + async.mapSeries = doSeries(_asyncMap); + + + // reduce only has a series version, as doing reduce in parallel won't + // work in many situations. + async.reduce = function (arr, memo, iterator, callback) { + async.forEachSeries(arr, function (x, callback) { + iterator(memo, x, function (err, v) { + memo = v; + callback(err); + }); + }, function (err) { + callback(err, memo); + }); + }; + // inject alias + async.inject = async.reduce; + // foldl alias + async.foldl = async.reduce; + + async.reduceRight = function (arr, memo, iterator, callback) { + var reversed = _map(arr, function (x) { + return x; + }).reverse(); + async.reduce(reversed, memo, iterator, callback); + }; + // foldr alias + async.foldr = async.reduceRight; + + var _filter = function (eachfn, arr, iterator, callback) { + var results = []; + arr = _map(arr, function (x, i) { + return {index: i, value: x}; + }); + eachfn(arr, function (x, callback) { + iterator(x.value, function (v) { + if (v) { + results.push(x); + } + callback(); + }); + }, function (err) { + callback(_map(results.sort(function (a, b) { + return a.index - b.index; + }), function (x) { + return x.value; + })); + }); + }; + async.filter = doParallel(_filter); + async.filterSeries = doSeries(_filter); + // select alias + async.select = async.filter; + async.selectSeries = async.filterSeries; + + var _reject = function (eachfn, arr, iterator, callback) { + var results = []; + arr = _map(arr, function (x, i) { + return {index: i, value: x}; + }); + eachfn(arr, function (x, callback) { + iterator(x.value, function (v) { + if (!v) { + results.push(x); + } + callback(); + }); + }, function (err) { + callback(_map(results.sort(function (a, b) { + return a.index - b.index; + }), function (x) { + return x.value; + })); + }); + }; + async.reject = doParallel(_reject); + async.rejectSeries = doSeries(_reject); + + var _detect = function (eachfn, arr, iterator, main_callback) { + eachfn(arr, function (x, callback) { + iterator(x, function (result) { + if (result) { + main_callback(x); + main_callback = function () {}; + } + else { + callback(); + } + }); + }, function (err) { + main_callback(); + }); + }; + async.detect = doParallel(_detect); + async.detectSeries = doSeries(_detect); + + async.some = function (arr, iterator, main_callback) { + async.forEach(arr, function (x, callback) { + iterator(x, function (v) { + if (v) { + main_callback(true); + main_callback = function () {}; + } + callback(); + }); + }, function (err) { + main_callback(false); + }); + }; + // any alias + async.any = async.some; + + async.every = function (arr, iterator, main_callback) { + async.forEach(arr, function (x, callback) { + iterator(x, function (v) { + if (!v) { + main_callback(false); + main_callback = function () {}; + } + callback(); + }); + }, function (err) { + main_callback(true); + }); + }; + // all alias + async.all = async.every; + + async.sortBy = function (arr, iterator, callback) { + async.map(arr, function (x, callback) { + iterator(x, function (err, criteria) { + if (err) { + callback(err); + } + else { + callback(null, {value: x, criteria: criteria}); + } + }); + }, function (err, results) { + if (err) { + return callback(err); + } + else { + var fn = function (left, right) { + var a = left.criteria, b = right.criteria; + return a < b ? -1 : a > b ? 1 : 0; + }; + callback(null, _map(results.sort(fn), function (x) { + return x.value; + })); + } + }); + }; + + async.auto = function (tasks, callback) { + callback = callback || function () {}; + var keys = _keys(tasks); + if (!keys.length) { + return callback(null); + } + + var results = {}; + + var listeners = []; + var addListener = function (fn) { + listeners.unshift(fn); + }; + var removeListener = function (fn) { + for (var i = 0; i < listeners.length; i += 1) { + if (listeners[i] === fn) { + listeners.splice(i, 1); + return; + } + } + }; + var taskComplete = function () { + _forEach(listeners.slice(0), function (fn) { + fn(); + }); + }; + + addListener(function () { + if (_keys(results).length === keys.length) { + callback(null, results); + callback = function () {}; + } + }); + + _forEach(keys, function (k) { + var task = (tasks[k] instanceof Function) ? [tasks[k]]: tasks[k]; + var taskCallback = function (err) { + if (err) { + callback(err); + // stop subsequent errors hitting callback multiple times + callback = function () {}; + } + else { + var args = Array.prototype.slice.call(arguments, 1); + if (args.length <= 1) { + args = args[0]; + } + results[k] = args; + taskComplete(); + } + }; + var requires = task.slice(0, Math.abs(task.length - 1)) || []; + var ready = function () { + return _reduce(requires, function (a, x) { + return (a && results.hasOwnProperty(x)); + }, true) && !results.hasOwnProperty(k); + }; + if (ready()) { + task[task.length - 1](taskCallback, results); + } + else { + var listener = function () { + if (ready()) { + removeListener(listener); + task[task.length - 1](taskCallback, results); + } + }; + addListener(listener); + } + }); + }; + + async.waterfall = function (tasks, callback) { + callback = callback || function () {}; + if (!tasks.length) { + return callback(); + } + var wrapIterator = function (iterator) { + return function (err) { + if (err) { + callback(err); + callback = function () {}; + } + else { + var args = Array.prototype.slice.call(arguments, 1); + var next = iterator.next(); + if (next) { + args.push(wrapIterator(next)); + } + else { + args.push(callback); + } + async.nextTick(function () { + iterator.apply(null, args); + }); + } + }; + }; + wrapIterator(async.iterator(tasks))(); + }; + + async.parallel = function (tasks, callback) { + callback = callback || function () {}; + if (tasks.constructor === Array) { + async.map(tasks, function (fn, callback) { + if (fn) { + fn(function (err) { + var args = Array.prototype.slice.call(arguments, 1); + if (args.length <= 1) { + args = args[0]; + } + callback.call(null, err, args); + }); + } + }, callback); + } + else { + var results = {}; + async.forEach(_keys(tasks), function (k, callback) { + tasks[k](function (err) { + var args = Array.prototype.slice.call(arguments, 1); + if (args.length <= 1) { + args = args[0]; + } + results[k] = args; + callback(err); + }); + }, function (err) { + callback(err, results); + }); + } + }; + + async.series = function (tasks, callback) { + callback = callback || function () {}; + if (tasks.constructor === Array) { + async.mapSeries(tasks, function (fn, callback) { + if (fn) { + fn(function (err) { + var args = Array.prototype.slice.call(arguments, 1); + if (args.length <= 1) { + args = args[0]; + } + callback.call(null, err, args); + }); + } + }, callback); + } + else { + var results = {}; + async.forEachSeries(_keys(tasks), function (k, callback) { + tasks[k](function (err) { + var args = Array.prototype.slice.call(arguments, 1); + if (args.length <= 1) { + args = args[0]; + } + results[k] = args; + callback(err); + }); + }, function (err) { + callback(err, results); + }); + } + }; + + async.iterator = function (tasks) { + var makeCallback = function (index) { + var fn = function () { + if (tasks.length) { + tasks[index].apply(null, arguments); + } + return fn.next(); + }; + fn.next = function () { + return (index < tasks.length - 1) ? makeCallback(index + 1): null; + }; + return fn; + }; + return makeCallback(0); + }; + + async.apply = function (fn) { + var args = Array.prototype.slice.call(arguments, 1); + return function () { + return fn.apply( + null, args.concat(Array.prototype.slice.call(arguments)) + ); + }; + }; + + var _concat = function (eachfn, arr, fn, callback) { + var r = []; + eachfn(arr, function (x, cb) { + fn(x, function (err, y) { + r = r.concat(y || []); + cb(err); + }); + }, function (err) { + callback(err, r); + }); + }; + async.concat = doParallel(_concat); + async.concatSeries = doSeries(_concat); + + async.whilst = function (test, iterator, callback) { + if (test()) { + iterator(function (err) { + if (err) { + return callback(err); + } + async.whilst(test, iterator, callback); + }); + } + else { + callback(); + } + }; + + async.until = function (test, iterator, callback) { + if (!test()) { + iterator(function (err) { + if (err) { + return callback(err); + } + async.until(test, iterator, callback); + }); + } + else { + callback(); + } + }; + + async.queue = function (worker, concurrency) { + var workers = 0; + var q = { + tasks: [], + concurrency: concurrency, + saturated: null, + empty: null, + drain: null, + push: function (data, callback) { + if(data.constructor !== Array) { + data = [data]; + } + _forEach(data, function(task) { + q.tasks.push({ + data: task, + callback: typeof callback === 'function' ? callback : null + }); + if (q.saturated && q.tasks.length == concurrency) { + q.saturated(); + } + async.nextTick(q.process); + }); + }, + process: function () { + if (workers < q.concurrency && q.tasks.length) { + var task = q.tasks.shift(); + if(q.empty && q.tasks.length == 0) q.empty(); + workers += 1; + worker(task.data, function () { + workers -= 1; + if (task.callback) { + task.callback.apply(task, arguments); + } + if(q.drain && q.tasks.length + workers == 0) q.drain(); + q.process(); + }); + } + }, + length: function () { + return q.tasks.length; + }, + running: function () { + return workers; + } + }; + return q; + }; + + var _console_fn = function (name) { + return function (fn) { + var args = Array.prototype.slice.call(arguments, 1); + fn.apply(null, args.concat([function (err) { + var args = Array.prototype.slice.call(arguments, 1); + if (typeof console !== 'undefined') { + if (err) { + if (console.error) { + console.error(err); + } + } + else if (console[name]) { + _forEach(args, function (x) { + console[name](x); + }); + } + } + }])); + }; + }; + async.log = _console_fn('log'); + async.dir = _console_fn('dir'); + /*async.info = _console_fn('info'); + async.warn = _console_fn('warn'); + async.error = _console_fn('error');*/ + + async.memoize = function (fn, hasher) { + var memo = {}; + var queues = {}; + hasher = hasher || function (x) { + return x; + }; + var memoized = function () { + var args = Array.prototype.slice.call(arguments); + var callback = args.pop(); + var key = hasher.apply(null, args); + if (key in memo) { + callback.apply(null, memo[key]); + } + else if (key in queues) { + queues[key].push(callback); + } + else { + queues[key] = [callback]; + fn.apply(null, args.concat([function () { + memo[key] = arguments; + var q = queues[key]; + delete queues[key]; + for (var i = 0, l = q.length; i < l; i++) { + q[i].apply(null, arguments); + } + }])); + } + }; + memoized.unmemoized = fn; + return memoized; + }; + + async.unmemoize = function (fn) { + return function () { + return (fn.unmemoized || fn).apply(null, arguments); + }; + }; + +}()); diff --git a/node_modules/grunt/node_modules/grunt-legacy-util/node_modules/async/package.json b/node_modules/grunt/node_modules/grunt-legacy-util/node_modules/async/package.json new file mode 100644 index 0000000..0ebbfd8 --- /dev/null +++ b/node_modules/grunt/node_modules/grunt-legacy-util/node_modules/async/package.json @@ -0,0 +1,57 @@ +{ + "name": "async", + "description": "Higher-order functions and common patterns for asynchronous code", + "main": "./index", + "author": { + "name": "Caolan McMahon" + }, + "version": "0.1.22", + "repository": { + "type": "git", + "url": "git://github.com/caolan/async.git" + }, + "bugs": { + "url": "http://github.com/caolan/async/issues" + }, + "licenses": [ + { + "type": "MIT", + "url": "http://github.com/caolan/async/raw/master/LICENSE" + } + ], + "devDependencies": { + "nodeunit": ">0.0.0", + "uglify-js": "1.2.x", + "nodelint": ">0.0.0" + }, + "_npmUser": { + "name": "caolan", + "email": "caolan@caolanmcmahon.com" + }, + "_id": "async@0.1.22", + "dependencies": {}, + "optionalDependencies": {}, + "engines": { + "node": "*" + }, + "_engineSupported": true, + "_npmVersion": "1.1.21", + "_nodeVersion": "v0.6.18", + "_defaultsLoaded": true, + "dist": { + "shasum": "0fc1aaa088a0e3ef0ebe2d8831bab0dcf8845061", + "tarball": "http://registry.npmjs.org/async/-/async-0.1.22.tgz" + }, + "maintainers": [ + { + "name": "caolan", + "email": "caolan@caolanmcmahon.com" + } + ], + "directories": {}, + "_shasum": "0fc1aaa088a0e3ef0ebe2d8831bab0dcf8845061", + "_from": "async@0.1.22", + "_resolved": "https://registry.npmjs.org/async/-/async-0.1.22.tgz", + "readme": "ERROR: No README data found!", + "homepage": "https://github.com/caolan/async" +} diff --git a/node_modules/grunt/node_modules/grunt-legacy-util/node_modules/lodash/README.md b/node_modules/grunt/node_modules/grunt-legacy-util/node_modules/lodash/README.md new file mode 100644 index 0000000..55dae80 --- /dev/null +++ b/node_modules/grunt/node_modules/grunt-legacy-util/node_modules/lodash/README.md @@ -0,0 +1,140 @@ +# Lo-Dash v0.9.2 + +A utility library delivering consistency, [customization](http://lodash.com/custom-builds), [performance](http://lodash.com/benchmarks), & [extras](http://lodash.com/#features). + +## Download + + * [Development build](https://raw.github.com/lodash/lodash/0.9.2/lodash.js) + * [Production build](https://raw.github.com/lodash/lodash/0.9.2/lodash.min.js) + * [Underscore build](https://raw.github.com/lodash/lodash/0.9.2/lodash.underscore.min.js) tailored for projects already using Underscore + * CDN copies of ≤ v0.9.2’s [Production](http://cdnjs.cloudflare.com/ajax/libs/lodash.js/0.9.2/lodash.min.js), [Underscore](http://cdnjs.cloudflare.com/ajax/libs/lodash.js/0.9.2/lodash.underscore.min.js), and [Development](http://cdnjs.cloudflare.com/ajax/libs/lodash.js/0.9.2/lodash.js) builds are available on [cdnjs](http://cdnjs.com/) thanks to [CloudFlare](http://www.cloudflare.com/) + * For optimal file size, [create a custom build](http://lodash.com/custom-builds) with only the features you need + +## Dive in + +We’ve got [API docs](http://lodash.com/docs), [benchmarks](http://lodash.com/benchmarks), and [unit tests](http://lodash.com/tests). + +Create your own benchmarks at [jsPerf](http://jsperf.com), or [search](http://jsperf.com/search?q=lodash) for existing ones. + +For a list of upcoming features, check out our [roadmap](https://github.com/lodash/lodash/wiki/Roadmap). + +## Screencasts + +For more information check out these screencasts over Lo-Dash: + + * [Introducing Lo-Dash](https://vimeo.com/44154599) + * [Lo-Dash optimizations and custom builds](https://vimeo.com/44154601) + * [Lo-Dash’s origin and why it’s a better utility belt](https://vimeo.com/44154600) + * [Unit testing in Lo-Dash](https://vimeo.com/45865290) + * [Lo-Dash’s approach to native method use](https://vimeo.com/48576012) + +## Features + + * AMD loader support ([RequireJS](http://requirejs.org/), [curl.js](https://github.com/cujojs/curl), etc.) + * [_.clone](http://lodash.com/docs#clone) supports *“deep”* cloning + * [_.contains](http://lodash.com/docs#contains) accepts a `fromIndex` argument + * [_.forEach](http://lodash.com/docs#forEach) is chainable and supports exiting iteration early + * [_.forIn](http://lodash.com/docs#forIn) for iterating over an object’s own and inherited properties + * [_.forOwn](http://lodash.com/docs#forOwn) for iterating over an object’s own properties + * [_.isPlainObject](http://lodash.com/docs#isPlainObject) checks if values are created by the `Object` constructor + * [_.lateBind](http://lodash.com/docs#lateBind) for late binding + * [_.merge](http://lodash.com/docs#merge) for a *“deep”* [_.extend](http://lodash.com/docs#extend) + * [_.partial](http://lodash.com/docs#partial) for partial application without `this` binding + * [_.pick](http://lodash.com/docs#pick) and [_.omit](http://lodash.com/docs#omit) accepts `callback` and `thisArg` arguments + * [_.template](http://lodash.com/docs#template) supports [ES6 delimiters](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-7.8.6) and utilizes [sourceURLs](http://www.html5rocks.com/en/tutorials/developertools/sourcemaps/#toc-sourceurl) for easier debugging + * [_.contains](http://lodash.com/docs#contains), [_.size](http://lodash.com/docs#size), [_.toArray](http://lodash.com/docs#toArray), + [and more…](http://lodash.com/docs "_.countBy, _.every, _.filter, _.find, _.forEach, _.groupBy, _.invoke, _.map, _.max, _.min, _.pluck, _.reduce, _.reduceRight, _.reject, _.shuffle, _.some, _.sortBy, _.where") accept strings + +## Support + +Lo-Dash has been tested in at least Chrome 5~23, Firefox 1~16, IE 6-10, Opera 9.25-12, Safari 3-6, Node.js 0.4.8-0.8.14, Narwhal 0.3.2, RingoJS 0.8, and Rhino 1.7RC5. + +## Installation and usage + +In browsers: + +```html + +``` + +Using [npm](http://npmjs.org/): + +```bash +npm install lodash + +npm install -g lodash +npm link lodash +``` + +In [Node.js](http://nodejs.org/) and [RingoJS v0.8.0+](http://ringojs.org/): + +```js +var _ = require('lodash'); +``` + +**Note:** If Lo-Dash is installed globally, [run `npm link lodash`](http://blog.nodejs.org/2011/03/23/npm-1-0-global-vs-local-installation/) in your project’s root directory before requiring it. + +In [RingoJS v0.7.0-](http://ringojs.org/): + +```js +var _ = require('lodash')._; +``` + +In [Rhino](http://www.mozilla.org/rhino/): + +```js +load('lodash.js'); +``` + +In an AMD loader like [RequireJS](http://requirejs.org/): + +```js +require({ + 'paths': { + 'underscore': 'path/to/lodash' + } +}, +['underscore'], function(_) { + console.log(_.VERSION); +}); +``` + +## Resolved Underscore.js issues + + * Allow iteration of objects with a `length` property [[#799](https://github.com/documentcloud/underscore/pull/799), [test](https://github.com/lodash/lodash/blob/0.9.2/test/test.js#L545-551)] + * Fix cross-browser object iteration bugs [[#60](https://github.com/documentcloud/underscore/issues/60), [#376](https://github.com/documentcloud/underscore/issues/376), [test](https://github.com/lodash/lodash/blob/0.9.2/test/test.js#L558-582)] + * Methods should work on pages with incorrectly shimmed native methods [[#7](https://github.com/documentcloud/underscore/issues/7), [#742](https://github.com/documentcloud/underscore/issues/742), [test](https://github.com/lodash/lodash/blob/0.9.2/test/test.js#L140-146)] + * `_.isEmpty` should support jQuery/MooTools DOM query collections [[#690](https://github.com/documentcloud/underscore/pull/690), [test](https://github.com/lodash/lodash/blob/0.9.2/test/test.js#L747-752)] + * `_.isObject` should avoid V8 bug [#2291](http://code.google.com/p/8/issues/detail?id=2291) [[#605](https://github.com/documentcloud/underscore/issues/605), [test](https://github.com/lodash/lodash/blob/0.9.2/test/test.js#L828-840)] + * `_.keys` should work with `arguments` objects cross-browser [[#396](https://github.com/documentcloud/underscore/issues/396), [test](https://github.com/lodash/lodash/blob/0.9.2/test/test.js#L921-923)] + * `_.range` should coerce arguments to numbers [[#634](https://github.com/documentcloud/underscore/issues/634), [#683](https://github.com/documentcloud/underscore/issues/683), [test](https://github.com/lodash/lodash/blob/0.9.2/test/test.js#L1337-1340)] + +## Release Notes + +### v0.9.2 + + * Added `fromIndex` argument to `_.contains` + * Added `moduleId` build option + * Added Closure Compiler *“simple”* optimizations to the build process + * Added support for strings in `_.max` and `_.min` + * Added support for ES6 template delimiters to `_.template` + * Ensured re-minification of Lo-Dash by third parties avoids Closure Compiler bugs + * Optimized `_.every`, `_.find`, `_.some`, and `_.uniq` + +The full changelog is available [here](https://github.com/lodash/lodash/wiki/Changelog). + +## BestieJS + +Lo-Dash is part of the [BestieJS](https://github.com/bestiejs) *“Best in Class”* module collection. This means we promote solid browser/environment support, ES5 precedents, unit testing, and plenty of documentation. + +## Author + +| [![twitter/jdalton](http://gravatar.com/avatar/299a3d891ff1920b69c364d061007043?s=70)](http://twitter.com/jdalton "Follow @jdalton on Twitter") | +|---| +| [John-David Dalton](http://allyoucanleet.com/) | + +## Contributors + +| [![twitter/blainebublitz](http://gravatar.com/avatar/ac1c67fd906c9fecd823ce302283b4c1?s=70)](http://twitter.com/blainebublitz "Follow @BlaineBublitz on Twitter") | [![twitter/kitcambridge](http://gravatar.com/avatar/6662a1d02f351b5ef2f8b4d815804661?s=70)](https://twitter.com/kitcambridge "Follow @kitcambridge on Twitter") | [![twitter/mathias](http://gravatar.com/avatar/24e08a9ea84deb17ae121074d0f17125?s=70)](http://twitter.com/mathias "Follow @mathias on Twitter") | +|---|---|---| +| [Blaine Bublitz](http://iceddev.com/) | [Kit Cambridge](http://kitcambridge.github.io/) | [Mathias Bynens](http://mathiasbynens.be/) | diff --git a/node_modules/grunt/node_modules/grunt-legacy-util/node_modules/lodash/lodash.js b/node_modules/grunt/node_modules/grunt-legacy-util/node_modules/lodash/lodash.js new file mode 100644 index 0000000..9eae931 --- /dev/null +++ b/node_modules/grunt/node_modules/grunt-legacy-util/node_modules/lodash/lodash.js @@ -0,0 +1,4258 @@ +/*! + * Lo-Dash v0.9.2 + * (c) 2012 John-David Dalton + * Based on Underscore.js 1.4.2 + * (c) 2009-2012 Jeremy Ashkenas, DocumentCloud Inc. + * Available under MIT license + */ +;(function(window, undefined) { + + /** Detect free variable `exports` */ + var freeExports = typeof exports == 'object' && exports; + + /** Detect free variable `global` and use it as `window` */ + var freeGlobal = typeof global == 'object' && global; + if (freeGlobal.global === freeGlobal) { + window = freeGlobal; + } + + /** Used for array and object method references */ + var arrayRef = [], + // avoid a Closure Compiler bug by creatively creating an object + objectRef = new function(){}; + + /** Used to generate unique IDs */ + var idCounter = 0; + + /** Used internally to indicate various things */ + var indicatorObject = objectRef; + + /** Used by `cachedContains` as the default size when optimizations are enabled for large arrays */ + var largeArraySize = 30; + + /** Used to restore the original `_` reference in `noConflict` */ + var oldDash = window._; + + /** Used to detect template delimiter values that require a with-statement */ + var reComplexDelimiter = /[-?+=!~*%&^<>|{(\/]|\[\D|\b(?:delete|in|instanceof|new|typeof|void)\b/; + + /** Used to match HTML entities */ + var reEscapedHtml = /&(?:amp|lt|gt|quot|#x27);/g; + + /** Used to match empty string literals in compiled template source */ + var reEmptyStringLeading = /\b__p \+= '';/g, + reEmptyStringMiddle = /\b(__p \+=) '' \+/g, + reEmptyStringTrailing = /(__e\(.*?\)|\b__t\)) \+\n'';/g; + + /** Used to match regexp flags from their coerced string values */ + var reFlags = /\w*$/; + + /** Used to insert the data object variable into compiled template source */ + var reInsertVariable = /(?:__e|__t = )\(\s*(?![\d\s"']|this\.)/g; + + /** Used to detect if a method is native */ + var reNative = RegExp('^' + + (objectRef.valueOf + '') + .replace(/[.*+?^=!:${}()|[\]\/\\]/g, '\\$&') + .replace(/valueOf|for [^\]]+/g, '.+?') + '$' + ); + + /** + * Used to match ES6 template delimiters + * http://people.mozilla.org/~jorendorff/es6-draft.html#sec-7.8.6 + */ + var reEsTemplate = /\$\{((?:(?=\\?)\\?[\s\S])*?)}/g; + + /** Used to match "interpolate" template delimiters */ + var reInterpolate = /<%=([\s\S]+?)%>/g; + + /** Used to ensure capturing order of template delimiters */ + var reNoMatch = /($^)/; + + /** Used to match HTML characters */ + var reUnescapedHtml = /[&<>"']/g; + + /** Used to match unescaped characters in compiled string literals */ + var reUnescapedString = /['\n\r\t\u2028\u2029\\]/g; + + /** Used to fix the JScript [[DontEnum]] bug */ + var shadowed = [ + 'constructor', 'hasOwnProperty', 'isPrototypeOf', 'propertyIsEnumerable', + 'toLocaleString', 'toString', 'valueOf' + ]; + + /** Used to make template sourceURLs easier to identify */ + var templateCounter = 0; + + /** Native method shortcuts */ + var ceil = Math.ceil, + concat = arrayRef.concat, + floor = Math.floor, + getPrototypeOf = reNative.test(getPrototypeOf = Object.getPrototypeOf) && getPrototypeOf, + hasOwnProperty = objectRef.hasOwnProperty, + push = arrayRef.push, + propertyIsEnumerable = objectRef.propertyIsEnumerable, + slice = arrayRef.slice, + toString = objectRef.toString; + + /* Native method shortcuts for methods with the same name as other `lodash` methods */ + var nativeBind = reNative.test(nativeBind = slice.bind) && nativeBind, + nativeIsArray = reNative.test(nativeIsArray = Array.isArray) && nativeIsArray, + nativeIsFinite = window.isFinite, + nativeIsNaN = window.isNaN, + nativeKeys = reNative.test(nativeKeys = Object.keys) && nativeKeys, + nativeMax = Math.max, + nativeMin = Math.min, + nativeRandom = Math.random; + + /** `Object#toString` result shortcuts */ + var argsClass = '[object Arguments]', + arrayClass = '[object Array]', + boolClass = '[object Boolean]', + dateClass = '[object Date]', + funcClass = '[object Function]', + numberClass = '[object Number]', + objectClass = '[object Object]', + regexpClass = '[object RegExp]', + stringClass = '[object String]'; + + /** + * Detect the JScript [[DontEnum]] bug: + * + * In IE < 9 an objects own properties, shadowing non-enumerable ones, are + * made non-enumerable as well. + */ + var hasDontEnumBug; + + /** Detect if own properties are iterated after inherited properties (IE < 9) */ + var iteratesOwnLast; + + /** + * Detect if `Array#shift` and `Array#splice` augment array-like objects + * incorrectly: + * + * Firefox < 10, IE compatibility mode, and IE < 9 have buggy Array `shift()` + * and `splice()` functions that fail to remove the last element, `value[0]`, + * of array-like objects even though the `length` property is set to `0`. + * The `shift()` method is buggy in IE 8 compatibility mode, while `splice()` + * is buggy regardless of mode in IE < 9 and buggy in compatibility mode in IE 9. + */ + var hasObjectSpliceBug = (hasObjectSpliceBug = { '0': 1, 'length': 1 }, + arrayRef.splice.call(hasObjectSpliceBug, 0, 1), hasObjectSpliceBug[0]); + + /** Detect if an `arguments` object's indexes are non-enumerable (IE < 9) */ + var noArgsEnum = true; + + (function() { + var props = []; + function ctor() { this.x = 1; } + ctor.prototype = { 'valueOf': 1, 'y': 1 }; + for (var prop in new ctor) { props.push(prop); } + for (prop in arguments) { noArgsEnum = !prop; } + + hasDontEnumBug = !/valueOf/.test(props); + iteratesOwnLast = props[0] != 'x'; + }(1)); + + /** Detect if an `arguments` object's [[Class]] is unresolvable (Firefox < 4, IE < 9) */ + var noArgsClass = !isArguments(arguments); + + /** Detect if `Array#slice` cannot be used to convert strings to arrays (Opera < 10.52) */ + var noArraySliceOnStrings = slice.call('x')[0] != 'x'; + + /** + * Detect lack of support for accessing string characters by index: + * + * IE < 8 can't access characters by index and IE 8 can only access + * characters by index on string literals. + */ + var noCharByIndex = ('x'[0] + Object('x')[0]) != 'xx'; + + /** + * Detect if a node's [[Class]] is unresolvable (IE < 9) + * and that the JS engine won't error when attempting to coerce an object to + * a string without a `toString` property value of `typeof` "function". + */ + try { + var noNodeClass = ({ 'toString': 0 } + '', toString.call(window.document || 0) == objectClass); + } catch(e) { } + + /* Detect if `Function#bind` exists and is inferred to be fast (all but V8) */ + var isBindFast = nativeBind && /\n|Opera/.test(nativeBind + toString.call(window.opera)); + + /* Detect if `Object.keys` exists and is inferred to be fast (IE, Opera, V8) */ + var isKeysFast = nativeKeys && /^.+$|true/.test(nativeKeys + !!window.attachEvent); + + /** + * Detect if sourceURL syntax is usable without erroring: + * + * The JS engine in Adobe products, like InDesign, will throw a syntax error + * when it encounters a single line comment beginning with the `@` symbol. + * + * The JS engine in Narwhal will generate the function `function anonymous(){//}` + * and throw a syntax error. + * + * Avoid comments beginning `@` symbols in IE because they are part of its + * non-standard conditional compilation support. + * http://msdn.microsoft.com/en-us/library/121hztk3(v=vs.94).aspx + */ + try { + var useSourceURL = (Function('//@')(), !window.attachEvent); + } catch(e) { } + + /** Used to identify object classifications that `_.clone` supports */ + var cloneableClasses = {}; + cloneableClasses[argsClass] = cloneableClasses[funcClass] = false; + cloneableClasses[arrayClass] = cloneableClasses[boolClass] = cloneableClasses[dateClass] = + cloneableClasses[numberClass] = cloneableClasses[objectClass] = cloneableClasses[regexpClass] = + cloneableClasses[stringClass] = true; + + /** Used to determine if values are of the language type Object */ + var objectTypes = { + 'boolean': false, + 'function': true, + 'object': true, + 'number': false, + 'string': false, + 'undefined': false + }; + + /** Used to escape characters for inclusion in compiled string literals */ + var stringEscapes = { + '\\': '\\', + "'": "'", + '\n': 'n', + '\r': 'r', + '\t': 't', + '\u2028': 'u2028', + '\u2029': 'u2029' + }; + + /*--------------------------------------------------------------------------*/ + + /** + * The `lodash` function. + * + * @name _ + * @constructor + * @category Chaining + * @param {Mixed} value The value to wrap in a `lodash` instance. + * @returns {Object} Returns a `lodash` instance. + */ + function lodash(value) { + // exit early if already wrapped + if (value && value.__wrapped__) { + return value; + } + // allow invoking `lodash` without the `new` operator + if (!(this instanceof lodash)) { + return new lodash(value); + } + this.__wrapped__ = value; + } + + /** + * By default, the template delimiters used by Lo-Dash are similar to those in + * embedded Ruby (ERB). Change the following template settings to use alternative + * delimiters. + * + * @static + * @memberOf _ + * @type Object + */ + lodash.templateSettings = { + + /** + * Used to detect `data` property values to be HTML-escaped. + * + * @static + * @memberOf _.templateSettings + * @type RegExp + */ + 'escape': /<%-([\s\S]+?)%>/g, + + /** + * Used to detect code to be evaluated. + * + * @static + * @memberOf _.templateSettings + * @type RegExp + */ + 'evaluate': /<%([\s\S]+?)%>/g, + + /** + * Used to detect `data` property values to inject. + * + * @static + * @memberOf _.templateSettings + * @type RegExp + */ + 'interpolate': reInterpolate, + + /** + * Used to reference the data object in the template text. + * + * @static + * @memberOf _.templateSettings + * @type String + */ + 'variable': '' + }; + + /*--------------------------------------------------------------------------*/ + + /** + * The template used to create iterator functions. + * + * @private + * @param {Obect} data The data object used to populate the text. + * @returns {String} Returns the interpolated text. + */ + var iteratorTemplate = template( + // conditional strict mode + '<% if (obj.useStrict) { %>\'use strict\';\n<% } %>' + + + // the `iteratee` may be reassigned by the `top` snippet + 'var index, value, iteratee = <%= firstArg %>, ' + + // assign the `result` variable an initial value + 'result = <%= firstArg %>;\n' + + // exit early if the first argument is falsey + 'if (!<%= firstArg %>) return result;\n' + + // add code before the iteration branches + '<%= top %>;\n' + + + // array-like iteration: + '<% if (arrayLoop) { %>' + + 'var length = iteratee.length; index = -1;\n' + + 'if (typeof length == \'number\') {' + + + // add support for accessing string characters by index if needed + ' <% if (noCharByIndex) { %>\n' + + ' if (isString(iteratee)) {\n' + + ' iteratee = iteratee.split(\'\')\n' + + ' }' + + ' <% } %>\n' + + + // iterate over the array-like value + ' while (++index < length) {\n' + + ' value = iteratee[index];\n' + + ' <%= arrayLoop %>\n' + + ' }\n' + + '}\n' + + 'else {' + + + // object iteration: + // add support for iterating over `arguments` objects if needed + ' <% } else if (noArgsEnum) { %>\n' + + ' var length = iteratee.length; index = -1;\n' + + ' if (length && isArguments(iteratee)) {\n' + + ' while (++index < length) {\n' + + ' value = iteratee[index += \'\'];\n' + + ' <%= objectLoop %>\n' + + ' }\n' + + ' } else {' + + ' <% } %>' + + + // Firefox < 3.6, Opera > 9.50 - Opera < 11.60, and Safari < 5.1 + // (if the prototype or a property on the prototype has been set) + // incorrectly sets a function's `prototype` property [[Enumerable]] + // value to `true`. Because of this Lo-Dash standardizes on skipping + // the the `prototype` property of functions regardless of its + // [[Enumerable]] value. + ' <% if (!hasDontEnumBug) { %>\n' + + ' var skipProto = typeof iteratee == \'function\' && \n' + + ' propertyIsEnumerable.call(iteratee, \'prototype\');\n' + + ' <% } %>' + + + // iterate own properties using `Object.keys` if it's fast + ' <% if (isKeysFast && useHas) { %>\n' + + ' var ownIndex = -1,\n' + + ' ownProps = objectTypes[typeof iteratee] ? nativeKeys(iteratee) : [],\n' + + ' length = ownProps.length;\n\n' + + ' while (++ownIndex < length) {\n' + + ' index = ownProps[ownIndex];\n' + + ' <% if (!hasDontEnumBug) { %>if (!(skipProto && index == \'prototype\')) {\n <% } %>' + + ' value = iteratee[index];\n' + + ' <%= objectLoop %>\n' + + ' <% if (!hasDontEnumBug) { %>}\n<% } %>' + + ' }' + + + // else using a for-in loop + ' <% } else { %>\n' + + ' for (index in iteratee) {<%' + + ' if (!hasDontEnumBug || useHas) { %>\n if (<%' + + ' if (!hasDontEnumBug) { %>!(skipProto && index == \'prototype\')<% }' + + ' if (!hasDontEnumBug && useHas) { %> && <% }' + + ' if (useHas) { %>hasOwnProperty.call(iteratee, index)<% }' + + ' %>) {' + + ' <% } %>\n' + + ' value = iteratee[index];\n' + + ' <%= objectLoop %>;' + + ' <% if (!hasDontEnumBug || useHas) { %>\n }<% } %>\n' + + ' }' + + ' <% } %>' + + + // Because IE < 9 can't set the `[[Enumerable]]` attribute of an + // existing property and the `constructor` property of a prototype + // defaults to non-enumerable, Lo-Dash skips the `constructor` + // property when it infers it's iterating over a `prototype` object. + ' <% if (hasDontEnumBug) { %>\n\n' + + ' var ctor = iteratee.constructor;\n' + + ' <% for (var k = 0; k < 7; k++) { %>\n' + + ' index = \'<%= shadowed[k] %>\';\n' + + ' if (<%' + + ' if (shadowed[k] == \'constructor\') {' + + ' %>!(ctor && ctor.prototype === iteratee) && <%' + + ' } %>hasOwnProperty.call(iteratee, index)) {\n' + + ' value = iteratee[index];\n' + + ' <%= objectLoop %>\n' + + ' }' + + ' <% } %>' + + ' <% } %>' + + ' <% if (arrayLoop || noArgsEnum) { %>\n}<% } %>\n' + + + // add code to the bottom of the iteration function + '<%= bottom %>;\n' + + // finally, return the `result` + 'return result' + ); + + /** + * Reusable iterator options shared by `forEach`, `forIn`, and `forOwn`. + */ + var forEachIteratorOptions = { + 'args': 'collection, callback, thisArg', + 'top': 'callback = createCallback(callback, thisArg)', + 'arrayLoop': 'if (callback(value, index, collection) === false) return result', + 'objectLoop': 'if (callback(value, index, collection) === false) return result' + }; + + /** Reusable iterator options for `defaults`, and `extend` */ + var extendIteratorOptions = { + 'useHas': false, + 'args': 'object', + 'top': + 'for (var argsIndex = 1, argsLength = arguments.length; argsIndex < argsLength; argsIndex++) {\n' + + ' if (iteratee = arguments[argsIndex]) {', + 'objectLoop': 'result[index] = value', + 'bottom': ' }\n}' + }; + + /** Reusable iterator options for `forIn` and `forOwn` */ + var forOwnIteratorOptions = { + 'arrayLoop': null + }; + + /*--------------------------------------------------------------------------*/ + + /** + * Creates a function optimized to search large arrays for a given `value`, + * starting at `fromIndex`, using strict equality for comparisons, i.e. `===`. + * + * @private + * @param {Array} array The array to search. + * @param {Mixed} value The value to search for. + * @param {Number} [fromIndex=0] The index to search from. + * @param {Number} [largeSize=30] The length at which an array is considered large. + * @returns {Boolean} Returns `true` if `value` is found, else `false`. + */ + function cachedContains(array, fromIndex, largeSize) { + fromIndex || (fromIndex = 0); + + var length = array.length, + isLarge = (length - fromIndex) >= (largeSize || largeArraySize); + + if (isLarge) { + var cache = {}, + index = fromIndex - 1; + + while (++index < length) { + // manually coerce `value` to a string because `hasOwnProperty`, in some + // older versions of Firefox, coerces objects incorrectly + var key = array[index] + ''; + (hasOwnProperty.call(cache, key) ? cache[key] : (cache[key] = [])).push(array[index]); + } + } + return function(value) { + if (isLarge) { + var key = value + ''; + return hasOwnProperty.call(cache, key) && indexOf(cache[key], value) > -1; + } + return indexOf(array, value, fromIndex) > -1; + } + } + + /** + * Used by `_.max` and `_.min` as the default `callback` when a given + * `collection` is a string value. + * + * @private + * @param {String} value The character to inspect. + * @returns {Number} Returns the code unit of given character. + */ + function charAtCallback(value) { + return value.charCodeAt(0); + } + + /** + * Used by `sortBy` to compare transformed `collection` values, stable sorting + * them in ascending order. + * + * @private + * @param {Object} a The object to compare to `b`. + * @param {Object} b The object to compare to `a`. + * @returns {Number} Returns the sort order indicator of `1` or `-1`. + */ + function compareAscending(a, b) { + var ai = a.index, + bi = b.index; + + a = a.criteria; + b = b.criteria; + + // ensure a stable sort in V8 and other engines + // http://code.google.com/p/v8/issues/detail?id=90 + if (a !== b) { + if (a > b || a === undefined) { + return 1; + } + if (a < b || b === undefined) { + return -1; + } + } + return ai < bi ? -1 : 1; + } + + /** + * Creates a function that, when called, invokes `func` with the `this` + * binding of `thisArg` and prepends any `partailArgs` to the arguments passed + * to the bound function. + * + * @private + * @param {Function|String} func The function to bind or the method name. + * @param {Mixed} [thisArg] The `this` binding of `func`. + * @param {Array} partialArgs An array of arguments to be partially applied. + * @returns {Function} Returns the new bound function. + */ + function createBound(func, thisArg, partialArgs) { + var isFunc = isFunction(func), + isPartial = !partialArgs, + methodName = func; + + // juggle arguments + if (isPartial) { + partialArgs = thisArg; + } + + function bound() { + // `Function#bind` spec + // http://es5.github.com/#x15.3.4.5 + var args = arguments, + thisBinding = isPartial ? this : thisArg; + + if (!isFunc) { + func = thisArg[methodName]; + } + if (partialArgs.length) { + args = args.length + ? partialArgs.concat(slice.call(args)) + : partialArgs; + } + if (this instanceof bound) { + // get `func` instance if `bound` is invoked in a `new` expression + noop.prototype = func.prototype; + thisBinding = new noop; + + // mimic the constructor's `return` behavior + // http://es5.github.com/#x13.2.2 + var result = func.apply(thisBinding, args); + return isObject(result) + ? result + : thisBinding + } + return func.apply(thisBinding, args); + } + return bound; + } + + /** + * Produces an iteration callback bound to an optional `thisArg`. If `func` is + * a property name, the callback will return the property value for a given element. + * + * @private + * @param {Function|String} [func=identity|property] The function called per + * iteration or property name to query. + * @param {Mixed} [thisArg] The `this` binding of `callback`. + * @returns {Function} Returns a callback function. + */ + function createCallback(func, thisArg) { + if (!func) { + return identity; + } + if (typeof func != 'function') { + return function(object) { + return object[func]; + }; + } + if (thisArg !== undefined) { + return function(value, index, object) { + return func.call(thisArg, value, index, object); + }; + } + return func; + } + + /** + * Creates compiled iteration functions. + * + * @private + * @param {Object} [options1, options2, ...] The compile options object(s). + * useHas - A boolean to specify using `hasOwnProperty` checks in the object loop. + * args - A string of comma separated arguments the iteration function will accept. + * top - A string of code to execute before the iteration branches. + * arrayLoop - A string of code to execute in the array loop. + * objectLoop - A string of code to execute in the object loop. + * bottom - A string of code to execute after the iteration branches. + * + * @returns {Function} Returns the compiled function. + */ + function createIterator() { + var data = { + 'arrayLoop': '', + 'bottom': '', + 'hasDontEnumBug': hasDontEnumBug, + 'isKeysFast': isKeysFast, + 'objectLoop': '', + 'noArgsEnum': noArgsEnum, + 'noCharByIndex': noCharByIndex, + 'shadowed': shadowed, + 'top': '', + 'useHas': true + }; + + // merge options into a template data object + for (var object, index = 0; object = arguments[index]; index++) { + for (var key in object) { + data[key] = object[key]; + } + } + var args = data.args; + data.firstArg = /^[^,]+/.exec(args)[0]; + + // create the function factory + var factory = Function( + 'createCallback, hasOwnProperty, isArguments, isString, objectTypes, ' + + 'nativeKeys, propertyIsEnumerable', + 'return function(' + args + ') {\n' + iteratorTemplate(data) + '\n}' + ); + // return the compiled function + return factory( + createCallback, hasOwnProperty, isArguments, isString, objectTypes, + nativeKeys, propertyIsEnumerable + ); + } + + /** + * Used by `template` to escape characters for inclusion in compiled + * string literals. + * + * @private + * @param {String} match The matched character to escape. + * @returns {String} Returns the escaped character. + */ + function escapeStringChar(match) { + return '\\' + stringEscapes[match]; + } + + /** + * Used by `escape` to convert characters to HTML entities. + * + * @private + * @param {String} match The matched character to escape. + * @returns {String} Returns the escaped character. + */ + function escapeHtmlChar(match) { + return htmlEscapes[match]; + } + + /** + * A no-operation function. + * + * @private + */ + function noop() { + // no operation performed + } + + /** + * Used by `unescape` to convert HTML entities to characters. + * + * @private + * @param {String} match The matched character to unescape. + * @returns {String} Returns the unescaped character. + */ + function unescapeHtmlChar(match) { + return htmlUnescapes[match]; + } + + /*--------------------------------------------------------------------------*/ + + /** + * Checks if `value` is an `arguments` object. + * + * @static + * @memberOf _ + * @category Objects + * @param {Mixed} value The value to check. + * @returns {Boolean} Returns `true` if the `value` is an `arguments` object, else `false`. + * @example + * + * (function() { return _.isArguments(arguments); })(1, 2, 3); + * // => true + * + * _.isArguments([1, 2, 3]); + * // => false + */ + function isArguments(value) { + return toString.call(value) == argsClass; + } + // fallback for browsers that can't detect `arguments` objects by [[Class]] + if (noArgsClass) { + isArguments = function(value) { + return value ? hasOwnProperty.call(value, 'callee') : false; + }; + } + + /** + * Iterates over `object`'s own and inherited enumerable properties, executing + * the `callback` for each property. The `callback` is bound to `thisArg` and + * invoked with three arguments; (value, key, object). Callbacks may exit iteration + * early by explicitly returning `false`. + * + * @static + * @memberOf _ + * @category Objects + * @param {Object} object The object to iterate over. + * @param {Function} callback The function called per iteration. + * @param {Mixed} [thisArg] The `this` binding of `callback`. + * @returns {Object} Returns `object`. + * @example + * + * function Dog(name) { + * this.name = name; + * } + * + * Dog.prototype.bark = function() { + * alert('Woof, woof!'); + * }; + * + * _.forIn(new Dog('Dagny'), function(value, key) { + * alert(key); + * }); + * // => alerts 'name' and 'bark' (order is not guaranteed) + */ + var forIn = createIterator(forEachIteratorOptions, forOwnIteratorOptions, { + 'useHas': false + }); + + /** + * Iterates over `object`'s own enumerable properties, executing the `callback` + * for each property. The `callback` is bound to `thisArg` and invoked with three + * arguments; (value, key, object). Callbacks may exit iteration early by explicitly + * returning `false`. + * + * @static + * @memberOf _ + * @category Objects + * @param {Object} object The object to iterate over. + * @param {Function} callback The function called per iteration. + * @param {Mixed} [thisArg] The `this` binding of `callback`. + * @returns {Object} Returns `object`. + * @example + * + * _.forOwn({ '0': 'zero', '1': 'one', 'length': 2 }, function(num, key) { + * alert(key); + * }); + * // => alerts '0', '1', and 'length' (order is not guaranteed) + */ + var forOwn = createIterator(forEachIteratorOptions, forOwnIteratorOptions); + + /** + * A fallback implementation of `isPlainObject` that checks if a given `value` + * is an object created by the `Object` constructor, assuming objects created + * by the `Object` constructor have no inherited enumerable properties and that + * there are no `Object.prototype` extensions. + * + * @private + * @param {Mixed} value The value to check. + * @returns {Boolean} Returns `true` if `value` is a plain object, else `false`. + */ + function shimIsPlainObject(value) { + // avoid non-objects and false positives for `arguments` objects + var result = false; + if (!(value && typeof value == 'object') || isArguments(value)) { + return result; + } + // IE < 9 presents DOM nodes as `Object` objects except they have `toString` + // methods that are `typeof` "string" and still can coerce nodes to strings. + // Also check that the constructor is `Object` (i.e. `Object instanceof Object`) + var ctor = value.constructor; + if ((!noNodeClass || !(typeof value.toString != 'function' && typeof (value + '') == 'string')) && + (!isFunction(ctor) || ctor instanceof ctor)) { + // IE < 9 iterates inherited properties before own properties. If the first + // iterated property is an object's own property then there are no inherited + // enumerable properties. + if (iteratesOwnLast) { + forIn(value, function(value, key, object) { + result = !hasOwnProperty.call(object, key); + return false; + }); + return result === false; + } + // In most environments an object's own properties are iterated before + // its inherited properties. If the last iterated property is an object's + // own property then there are no inherited enumerable properties. + forIn(value, function(value, key) { + result = key; + }); + return result === false || hasOwnProperty.call(value, result); + } + return result; + } + + /** + * A fallback implementation of `Object.keys` that produces an array of the + * given object's own enumerable property names. + * + * @private + * @param {Object} object The object to inspect. + * @returns {Array} Returns a new array of property names. + */ + function shimKeys(object) { + var result = []; + forOwn(object, function(value, key) { + result.push(key); + }); + return result; + } + + /** + * Used to convert characters to HTML entities: + * + * Though the `>` character is escaped for symmetry, characters like `>` and `/` + * don't require escaping in HTML and have no special meaning unless they're part + * of a tag or an unquoted attribute value. + * http://mathiasbynens.be/notes/ambiguous-ampersands (under "semi-related fun fact") + */ + var htmlEscapes = { + '&': '&', + '<': '<', + '>': '>', + '"': '"', + "'": ''' + }; + + /** Used to convert HTML entities to characters */ + var htmlUnescapes = invert(htmlEscapes); + + /*--------------------------------------------------------------------------*/ + + /** + * Creates a clone of `value`. If `deep` is `true`, all nested objects will + * also be cloned otherwise they will be assigned by reference. Functions, DOM + * nodes, `arguments` objects, and objects created by constructors other than + * `Object` are **not** cloned. + * + * @static + * @memberOf _ + * @category Objects + * @param {Mixed} value The value to clone. + * @param {Boolean} deep A flag to indicate a deep clone. + * @param- {Object} [guard] Internally used to allow this method to work with + * others like `_.map` without using their callback `index` argument for `deep`. + * @param- {Array} [stackA=[]] Internally used to track traversed source objects. + * @param- {Array} [stackB=[]] Internally used to associate clones with their + * source counterparts. + * @returns {Mixed} Returns the cloned `value`. + * @example + * + * var stooges = [ + * { 'name': 'moe', 'age': 40 }, + * { 'name': 'larry', 'age': 50 }, + * { 'name': 'curly', 'age': 60 } + * ]; + * + * _.clone({ 'name': 'moe' }); + * // => { 'name': 'moe' } + * + * var shallow = _.clone(stooges); + * shallow[0] === stooges[0]; + * // => true + * + * var deep = _.clone(stooges, true); + * shallow[0] === stooges[0]; + * // => false + */ + function clone(value, deep, guard, stackA, stackB) { + if (value == null) { + return value; + } + if (guard) { + deep = false; + } + // inspect [[Class]] + var isObj = isObject(value); + if (isObj) { + // don't clone `arguments` objects, functions, or non-object Objects + var className = toString.call(value); + if (!cloneableClasses[className] || (noArgsClass && isArguments(value))) { + return value; + } + var isArr = className == arrayClass; + isObj = isArr || (className == objectClass ? isPlainObject(value) : isObj); + } + // shallow clone + if (!isObj || !deep) { + // don't clone functions + return isObj + ? (isArr ? slice.call(value) : extend({}, value)) + : value; + } + + var ctor = value.constructor; + switch (className) { + case boolClass: + case dateClass: + return new ctor(+value); + + case numberClass: + case stringClass: + return new ctor(value); + + case regexpClass: + return ctor(value.source, reFlags.exec(value)); + } + // check for circular references and return corresponding clone + stackA || (stackA = []); + stackB || (stackB = []); + + var length = stackA.length; + while (length--) { + if (stackA[length] == value) { + return stackB[length]; + } + } + // init cloned object + var result = isArr ? ctor(value.length) : {}; + + // add the source value to the stack of traversed objects + // and associate it with its clone + stackA.push(value); + stackB.push(result); + + // recursively populate clone (susceptible to call stack limits) + (isArr ? forEach : forOwn)(value, function(objValue, key) { + result[key] = clone(objValue, deep, null, stackA, stackB); + }); + + return result; + } + + /** + * Assigns enumerable properties of the default object(s) to the `destination` + * object for all `destination` properties that resolve to `null`/`undefined`. + * Once a property is set, additional defaults of the same property will be + * ignored. + * + * @static + * @memberOf _ + * @category Objects + * @param {Object} object The destination object. + * @param {Object} [default1, default2, ...] The default objects. + * @returns {Object} Returns the destination object. + * @example + * + * var iceCream = { 'flavor': 'chocolate' }; + * _.defaults(iceCream, { 'flavor': 'vanilla', 'sprinkles': 'rainbow' }); + * // => { 'flavor': 'chocolate', 'sprinkles': 'rainbow' } + */ + var defaults = createIterator(extendIteratorOptions, { + 'objectLoop': 'if (result[index] == null) ' + extendIteratorOptions.objectLoop + }); + + /** + * Assigns enumerable properties of the source object(s) to the `destination` + * object. Subsequent sources will overwrite propery assignments of previous + * sources. + * + * @static + * @memberOf _ + * @category Objects + * @param {Object} object The destination object. + * @param {Object} [source1, source2, ...] The source objects. + * @returns {Object} Returns the destination object. + * @example + * + * _.extend({ 'name': 'moe' }, { 'age': 40 }); + * // => { 'name': 'moe', 'age': 40 } + */ + var extend = createIterator(extendIteratorOptions); + + /** + * Creates a sorted array of all enumerable properties, own and inherited, + * of `object` that have function values. + * + * @static + * @memberOf _ + * @alias methods + * @category Objects + * @param {Object} object The object to inspect. + * @returns {Array} Returns a new array of property names that have function values. + * @example + * + * _.functions(_); + * // => ['all', 'any', 'bind', 'bindAll', 'clone', 'compact', 'compose', ...] + */ + function functions(object) { + var result = []; + forIn(object, function(value, key) { + if (isFunction(value)) { + result.push(key); + } + }); + return result.sort(); + } + + /** + * Checks if the specified object `property` exists and is a direct property, + * instead of an inherited property. + * + * @static + * @memberOf _ + * @category Objects + * @param {Object} object The object to check. + * @param {String} property The property to check for. + * @returns {Boolean} Returns `true` if key is a direct property, else `false`. + * @example + * + * _.has({ 'a': 1, 'b': 2, 'c': 3 }, 'b'); + * // => true + */ + function has(object, property) { + return object ? hasOwnProperty.call(object, property) : false; + } + + /** + * Creates an object composed of the inverted keys and values of the given `object`. + * + * @static + * @memberOf _ + * @category Objects + * @param {Object} object The object to invert. + * @returns {Object} Returns the created inverted object. + * @example + * + * _.invert({ 'first': 'Moe', 'second': 'Larry', 'third': 'Curly' }); + * // => { 'Moe': 'first', 'Larry': 'second', 'Curly': 'third' } (order is not guaranteed) + */ + function invert(object) { + var result = {}; + forOwn(object, function(value, key) { + result[value] = key; + }); + return result; + } + + /** + * Checks if `value` is an array. + * + * @static + * @memberOf _ + * @category Objects + * @param {Mixed} value The value to check. + * @returns {Boolean} Returns `true` if the `value` is an array, else `false`. + * @example + * + * (function() { return _.isArray(arguments); })(); + * // => false + * + * _.isArray([1, 2, 3]); + * // => true + */ + var isArray = nativeIsArray || function(value) { + return toString.call(value) == arrayClass; + }; + + /** + * Checks if `value` is a boolean (`true` or `false`) value. + * + * @static + * @memberOf _ + * @category Objects + * @param {Mixed} value The value to check. + * @returns {Boolean} Returns `true` if the `value` is a boolean value, else `false`. + * @example + * + * _.isBoolean(null); + * // => false + */ + function isBoolean(value) { + return value === true || value === false || toString.call(value) == boolClass; + } + + /** + * Checks if `value` is a date. + * + * @static + * @memberOf _ + * @category Objects + * @param {Mixed} value The value to check. + * @returns {Boolean} Returns `true` if the `value` is a date, else `false`. + * @example + * + * _.isDate(new Date); + * // => true + */ + function isDate(value) { + return toString.call(value) == dateClass; + } + + /** + * Checks if `value` is a DOM element. + * + * @static + * @memberOf _ + * @category Objects + * @param {Mixed} value The value to check. + * @returns {Boolean} Returns `true` if the `value` is a DOM element, else `false`. + * @example + * + * _.isElement(document.body); + * // => true + */ + function isElement(value) { + return value ? value.nodeType === 1 : false; + } + + /** + * Checks if `value` is empty. Arrays, strings, or `arguments` objects with a + * length of `0` and objects with no own enumerable properties are considered + * "empty". + * + * @static + * @memberOf _ + * @category Objects + * @param {Array|Object|String} value The value to inspect. + * @returns {Boolean} Returns `true` if the `value` is empty, else `false`. + * @example + * + * _.isEmpty([1, 2, 3]); + * // => false + * + * _.isEmpty({}); + * // => true + * + * _.isEmpty(''); + * // => true + */ + function isEmpty(value) { + var result = true; + if (!value) { + return result; + } + var className = toString.call(value), + length = value.length; + + if ((className == arrayClass || className == stringClass || + className == argsClass || (noArgsClass && isArguments(value))) || + (className == objectClass && typeof length == 'number' && isFunction(value.splice))) { + return !length; + } + forOwn(value, function() { + return (result = false); + }); + return result; + } + + /** + * Performs a deep comparison between two values to determine if they are + * equivalent to each other. + * + * @static + * @memberOf _ + * @category Objects + * @param {Mixed} a The value to compare. + * @param {Mixed} b The other value to compare. + * @param- {Object} [stackA=[]] Internally used track traversed `a` objects. + * @param- {Object} [stackB=[]] Internally used track traversed `b` objects. + * @returns {Boolean} Returns `true` if the values are equvalent, else `false`. + * @example + * + * var moe = { 'name': 'moe', 'luckyNumbers': [13, 27, 34] }; + * var clone = { 'name': 'moe', 'luckyNumbers': [13, 27, 34] }; + * + * moe == clone; + * // => false + * + * _.isEqual(moe, clone); + * // => true + */ + function isEqual(a, b, stackA, stackB) { + // exit early for identical values + if (a === b) { + // treat `+0` vs. `-0` as not equal + return a !== 0 || (1 / a == 1 / b); + } + // a strict comparison is necessary because `null == undefined` + if (a == null || b == null) { + return a === b; + } + // compare [[Class]] names + var className = toString.call(a); + if (className != toString.call(b)) { + return false; + } + switch (className) { + case boolClass: + case dateClass: + // coerce dates and booleans to numbers, dates to milliseconds and booleans + // to `1` or `0`, treating invalid dates coerced to `NaN` as not equal + return +a == +b; + + case numberClass: + // treat `NaN` vs. `NaN` as equal + return a != +a + ? b != +b + // but treat `+0` vs. `-0` as not equal + : (a == 0 ? (1 / a == 1 / b) : a == +b); + + case regexpClass: + case stringClass: + // coerce regexes to strings (http://es5.github.com/#x15.10.6.4) + // treat string primitives and their corresponding object instances as equal + return a == b + ''; + } + // exit early, in older browsers, if `a` is array-like but not `b` + var isArr = className == arrayClass || className == argsClass; + if (noArgsClass && !isArr && (isArr = isArguments(a)) && !isArguments(b)) { + return false; + } + if (!isArr) { + // unwrap any `lodash` wrapped values + if (a.__wrapped__ || b.__wrapped__) { + return isEqual(a.__wrapped__ || a, b.__wrapped__ || b); + } + // exit for functions and DOM nodes + if (className != objectClass || (noNodeClass && ( + (typeof a.toString != 'function' && typeof (a + '') == 'string') || + (typeof b.toString != 'function' && typeof (b + '') == 'string')))) { + return false; + } + var ctorA = a.constructor, + ctorB = b.constructor; + + // non `Object` object instances with different constructors are not equal + if (ctorA != ctorB && !( + isFunction(ctorA) && ctorA instanceof ctorA && + isFunction(ctorB) && ctorB instanceof ctorB + )) { + return false; + } + } + // assume cyclic structures are equal + // the algorithm for detecting cyclic structures is adapted from ES 5.1 + // section 15.12.3, abstract operation `JO` (http://es5.github.com/#x15.12.3) + stackA || (stackA = []); + stackB || (stackB = []); + + var length = stackA.length; + while (length--) { + if (stackA[length] == a) { + return stackB[length] == b; + } + } + + var index = -1, + result = true, + size = 0; + + // add `a` and `b` to the stack of traversed objects + stackA.push(a); + stackB.push(b); + + // recursively compare objects and arrays (susceptible to call stack limits) + if (isArr) { + // compare lengths to determine if a deep comparison is necessary + size = a.length; + result = size == b.length; + + if (result) { + // deep compare the contents, ignoring non-numeric properties + while (size--) { + if (!(result = isEqual(a[size], b[size], stackA, stackB))) { + break; + } + } + } + return result; + } + // deep compare objects + for (var key in a) { + if (hasOwnProperty.call(a, key)) { + // count the number of properties. + size++; + // deep compare each property value. + if (!(hasOwnProperty.call(b, key) && isEqual(a[key], b[key], stackA, stackB))) { + return false; + } + } + } + // ensure both objects have the same number of properties + for (key in b) { + // The JS engine in Adobe products, like InDesign, has a bug that causes + // `!size--` to throw an error so it must be wrapped in parentheses. + // https://github.com/documentcloud/underscore/issues/355 + if (hasOwnProperty.call(b, key) && !(size--)) { + // `size` will be `-1` if `b` has more properties than `a` + return false; + } + } + // handle JScript [[DontEnum]] bug + if (hasDontEnumBug) { + while (++index < 7) { + key = shadowed[index]; + if (hasOwnProperty.call(a, key) && + !(hasOwnProperty.call(b, key) && isEqual(a[key], b[key], stackA, stackB))) { + return false; + } + } + } + return true; + } + + /** + * Checks if `value` is, or can be coerced to, a finite number. + * + * Note: This is not the same as native `isFinite`, which will return true for + * booleans and empty strings. See http://es5.github.com/#x15.1.2.5. + * + * @deprecated + * @static + * @memberOf _ + * @category Objects + * @param {Mixed} value The value to check. + * @returns {Boolean} Returns `true` if the `value` is a finite number, else `false`. + * @example + * + * _.isFinite(-101); + * // => true + * + * _.isFinite('10'); + * // => true + * + * _.isFinite(true); + * // => false + * + * _.isFinite(''); + * // => false + * + * _.isFinite(Infinity); + * // => false + */ + function isFinite(value) { + return nativeIsFinite(value) && !nativeIsNaN(parseFloat(value)); + } + + /** + * Checks if `value` is a function. + * + * @static + * @memberOf _ + * @category Objects + * @param {Mixed} value The value to check. + * @returns {Boolean} Returns `true` if the `value` is a function, else `false`. + * @example + * + * _.isFunction(_); + * // => true + */ + function isFunction(value) { + return typeof value == 'function'; + } + // fallback for older versions of Chrome and Safari + if (isFunction(/x/)) { + isFunction = function(value) { + return toString.call(value) == funcClass; + }; + } + + /** + * Checks if `value` is the language type of Object. + * (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) + * + * @static + * @memberOf _ + * @category Objects + * @param {Mixed} value The value to check. + * @returns {Boolean} Returns `true` if the `value` is an object, else `false`. + * @example + * + * _.isObject({}); + * // => true + * + * _.isObject([1, 2, 3]); + * // => true + * + * _.isObject(1); + * // => false + */ + function isObject(value) { + // check if the value is the ECMAScript language type of Object + // http://es5.github.com/#x8 + // and avoid a V8 bug + // http://code.google.com/p/v8/issues/detail?id=2291 + return value ? objectTypes[typeof value] : false; + } + + /** + * Checks if `value` is `NaN`. + * + * Note: This is not the same as native `isNaN`, which will return true for + * `undefined` and other values. See http://es5.github.com/#x15.1.2.4. + * + * @deprecated + * @static + * @memberOf _ + * @category Objects + * @param {Mixed} value The value to check. + * @returns {Boolean} Returns `true` if the `value` is `NaN`, else `false`. + * @example + * + * _.isNaN(NaN); + * // => true + * + * _.isNaN(new Number(NaN)); + * // => true + * + * isNaN(undefined); + * // => true + * + * _.isNaN(undefined); + * // => false + */ + function isNaN(value) { + // `NaN` as a primitive is the only value that is not equal to itself + // (perform the [[Class]] check first to avoid errors with some host objects in IE) + return toString.call(value) == numberClass && value != +value + } + + /** + * Checks if `value` is `null`. + * + * @deprecated + * @static + * @memberOf _ + * @category Objects + * @param {Mixed} value The value to check. + * @returns {Boolean} Returns `true` if the `value` is `null`, else `false`. + * @example + * + * _.isNull(null); + * // => true + * + * _.isNull(undefined); + * // => false + */ + function isNull(value) { + return value === null; + } + + /** + * Checks if `value` is a number. + * + * @static + * @memberOf _ + * @category Objects + * @param {Mixed} value The value to check. + * @returns {Boolean} Returns `true` if the `value` is a number, else `false`. + * @example + * + * _.isNumber(8.4 * 5); + * // => true + */ + function isNumber(value) { + return toString.call(value) == numberClass; + } + + /** + * Checks if a given `value` is an object created by the `Object` constructor. + * + * @static + * @memberOf _ + * @category Objects + * @param {Mixed} value The value to check. + * @returns {Boolean} Returns `true` if `value` is a plain object, else `false`. + * @example + * + * function Stooge(name, age) { + * this.name = name; + * this.age = age; + * } + * + * _.isPlainObject(new Stooge('moe', 40)); + * // => false + * + * _.isPlainObject([1, 2, 3]); + * // => false + * + * _.isPlainObject({ 'name': 'moe', 'age': 40 }); + * // => true + */ + var isPlainObject = !getPrototypeOf ? shimIsPlainObject : function(value) { + if (!(value && typeof value == 'object')) { + return false; + } + var valueOf = value.valueOf, + objProto = typeof valueOf == 'function' && (objProto = getPrototypeOf(valueOf)) && getPrototypeOf(objProto); + + return objProto + ? value == objProto || (getPrototypeOf(value) == objProto && !isArguments(value)) + : shimIsPlainObject(value); + }; + + /** + * Checks if `value` is a regular expression. + * + * @static + * @memberOf _ + * @category Objects + * @param {Mixed} value The value to check. + * @returns {Boolean} Returns `true` if the `value` is a regular expression, else `false`. + * @example + * + * _.isRegExp(/moe/); + * // => true + */ + function isRegExp(value) { + return toString.call(value) == regexpClass; + } + + /** + * Checks if `value` is a string. + * + * @static + * @memberOf _ + * @category Objects + * @param {Mixed} value The value to check. + * @returns {Boolean} Returns `true` if the `value` is a string, else `false`. + * @example + * + * _.isString('moe'); + * // => true + */ + function isString(value) { + return toString.call(value) == stringClass; + } + + /** + * Checks if `value` is `undefined`. + * + * @deprecated + * @static + * @memberOf _ + * @category Objects + * @param {Mixed} value The value to check. + * @returns {Boolean} Returns `true` if the `value` is `undefined`, else `false`. + * @example + * + * _.isUndefined(void 0); + * // => true + */ + function isUndefined(value) { + return value === undefined; + } + + /** + * Creates an array composed of the own enumerable property names of `object`. + * + * @static + * @memberOf _ + * @category Objects + * @param {Object} object The object to inspect. + * @returns {Array} Returns a new array of property names. + * @example + * + * _.keys({ 'one': 1, 'two': 2, 'three': 3 }); + * // => ['one', 'two', 'three'] (order is not guaranteed) + */ + var keys = !nativeKeys ? shimKeys : function(object) { + // avoid iterating over the `prototype` property + return typeof object == 'function' && propertyIsEnumerable.call(object, 'prototype') + ? shimKeys(object) + : (isObject(object) ? nativeKeys(object) : []); + }; + + /** + * Merges enumerable properties of the source object(s) into the `destination` + * object. Subsequent sources will overwrite propery assignments of previous + * sources. + * + * @static + * @memberOf _ + * @category Objects + * @param {Object} object The destination object. + * @param {Object} [source1, source2, ...] The source objects. + * @param- {Object} [indicator] Internally used to indicate that the `stack` + * argument is an array of traversed objects instead of another source object. + * @param- {Array} [stackA=[]] Internally used to track traversed source objects. + * @param- {Array} [stackB=[]] Internally used to associate values with their + * source counterparts. + * @returns {Object} Returns the destination object. + * @example + * + * var stooges = [ + * { 'name': 'moe' }, + * { 'name': 'larry' } + * ]; + * + * var ages = [ + * { 'age': 40 }, + * { 'age': 50 } + * ]; + * + * _.merge(stooges, ages); + * // => [{ 'name': 'moe', 'age': 40 }, { 'name': 'larry', 'age': 50 }] + */ + function merge(object, source, indicator) { + var args = arguments, + index = 0, + length = 2, + stackA = args[3], + stackB = args[4]; + + if (indicator !== objectRef) { + stackA = []; + stackB = []; + length = args.length; + } + while (++index < length) { + forOwn(args[index], function(source, key) { + var found, isArr, value; + if (source && ((isArr = isArray(source)) || isPlainObject(source))) { + // avoid merging previously merged cyclic sources + var stackLength = stackA.length; + while (stackLength--) { + found = stackA[stackLength] == source; + if (found) { + break; + } + } + if (found) { + object[key] = stackB[stackLength]; + } + else { + // add `source` and associated `value` to the stack of traversed objects + stackA.push(source); + stackB.push(value = (value = object[key], isArr) + ? (isArray(value) ? value : []) + : (isPlainObject(value) ? value : {}) + ); + // recursively merge objects and arrays (susceptible to call stack limits) + object[key] = merge(value, source, objectRef, stackA, stackB); + } + } else if (source != null) { + object[key] = source; + } + }); + } + return object; + } + + /** + * Creates a shallow clone of `object` excluding the specified properties. + * Property names may be specified as individual arguments or as arrays of + * property names. If `callback` is passed, it will be executed for each property + * in the `object`, omitting the properties `callback` returns truthy for. The + * `callback` is bound to `thisArg` and invoked with three arguments; (value, key, object). + * + * @static + * @memberOf _ + * @category Objects + * @param {Object} object The source object. + * @param {Function|String} callback|[prop1, prop2, ...] The properties to omit + * or the function called per iteration. + * @param {Mixed} [thisArg] The `this` binding of `callback`. + * @returns {Object} Returns an object without the omitted properties. + * @example + * + * _.omit({ 'name': 'moe', 'age': 40, 'userid': 'moe1' }, 'userid'); + * // => { 'name': 'moe', 'age': 40 } + * + * _.omit({ 'name': 'moe', '_hint': 'knucklehead', '_seed': '96c4eb' }, function(value, key) { + * return key.charAt(0) == '_'; + * }); + * // => { 'name': 'moe' } + */ + function omit(object, callback, thisArg) { + var isFunc = typeof callback == 'function', + result = {}; + + if (isFunc) { + callback = createCallback(callback, thisArg); + } else { + var props = concat.apply(arrayRef, arguments); + } + forIn(object, function(value, key, object) { + if (isFunc + ? !callback(value, key, object) + : indexOf(props, key, 1) < 0 + ) { + result[key] = value; + } + }); + return result; + } + + /** + * Creates a two dimensional array of the given object's key-value pairs, + * i.e. `[[key1, value1], [key2, value2]]`. + * + * @static + * @memberOf _ + * @category Objects + * @param {Object} object The object to inspect. + * @returns {Array} Returns new array of key-value pairs. + * @example + * + * _.pairs({ 'moe': 30, 'larry': 40, 'curly': 50 }); + * // => [['moe', 30], ['larry', 40], ['curly', 50]] (order is not guaranteed) + */ + function pairs(object) { + var result = []; + forOwn(object, function(value, key) { + result.push([key, value]); + }); + return result; + } + + /** + * Creates a shallow clone of `object` composed of the specified properties. + * Property names may be specified as individual arguments or as arrays of + * property names. If `callback` is passed, it will be executed for each property + * in the `object`, picking the properties `callback` returns truthy for. The + * `callback` is bound to `thisArg` and invoked with three arguments; (value, key, object). + * + * @static + * @memberOf _ + * @category Objects + * @param {Object} object The source object. + * @param {Function|String} callback|[prop1, prop2, ...] The properties to pick + * or the function called per iteration. + * @param {Mixed} [thisArg] The `this` binding of `callback`. + * @returns {Object} Returns an object composed of the picked properties. + * @example + * + * _.pick({ 'name': 'moe', 'age': 40, 'userid': 'moe1' }, 'name', 'age'); + * // => { 'name': 'moe', 'age': 40 } + * + * _.pick({ 'name': 'moe', '_hint': 'knucklehead', '_seed': '96c4eb' }, function(value, key) { + * return key.charAt(0) != '_'; + * }); + * // => { 'name': 'moe' } + */ + function pick(object, callback, thisArg) { + var result = {}; + if (typeof callback != 'function') { + var index = 0, + props = concat.apply(arrayRef, arguments), + length = props.length; + + while (++index < length) { + var key = props[index]; + if (key in object) { + result[key] = object[key]; + } + } + } else { + callback = createCallback(callback, thisArg); + forIn(object, function(value, key, object) { + if (callback(value, key, object)) { + result[key] = value; + } + }); + } + return result; + } + + /** + * Creates an array composed of the own enumerable property values of `object`. + * + * @static + * @memberOf _ + * @category Objects + * @param {Object} object The object to inspect. + * @returns {Array} Returns a new array of property values. + * @example + * + * _.values({ 'one': 1, 'two': 2, 'three': 3 }); + * // => [1, 2, 3] + */ + function values(object) { + var result = []; + forOwn(object, function(value) { + result.push(value); + }); + return result; + } + + /*--------------------------------------------------------------------------*/ + + /** + * Checks if a given `target` element is present in a `collection` using strict + * equality for comparisons, i.e. `===`. If `fromIndex` is negative, it is used + * as the offset from the end of the collection. + * + * @static + * @memberOf _ + * @alias include + * @category Collections + * @param {Array|Object|String} collection The collection to iterate over. + * @param {Mixed} target The value to check for. + * @param {Number} [fromIndex=0] The index to search from. + * @returns {Boolean} Returns `true` if the `target` element is found, else `false`. + * @example + * + * _.contains([1, 2, 3], 1); + * // => true + * + * _.contains([1, 2, 3], 1, 2); + * // => false + * + * _.contains({ 'name': 'moe', 'age': 40 }, 'moe'); + * // => true + * + * _.contains('curly', 'ur'); + * // => true + */ + function contains(collection, target, fromIndex) { + var index = -1, + length = collection ? collection.length : 0; + + fromIndex = (fromIndex < 0 ? nativeMax(0, length + fromIndex) : fromIndex) || 0; + if (typeof length == 'number') { + return (isString(collection) + ? collection.indexOf(target, fromIndex) + : indexOf(collection, target, fromIndex) + ) > -1; + } + return some(collection, function(value) { + return ++index >= fromIndex && value === target; + }); + } + + /** + * Creates an object composed of keys returned from running each element of + * `collection` through a `callback`. The corresponding value of each key is + * the number of times the key was returned by `callback`. The `callback` is + * bound to `thisArg` and invoked with three arguments; (value, index|key, collection). + * The `callback` argument may also be the name of a property to count by (e.g. 'length'). + * + * @static + * @memberOf _ + * @category Collections + * @param {Array|Object|String} collection The collection to iterate over. + * @param {Function|String} callback|property The function called per iteration + * or property name to count by. + * @param {Mixed} [thisArg] The `this` binding of `callback`. + * @returns {Object} Returns the composed aggregate object. + * @example + * + * _.countBy([4.3, 6.1, 6.4], function(num) { return Math.floor(num); }); + * // => { '4': 1, '6': 2 } + * + * _.countBy([4.3, 6.1, 6.4], function(num) { return this.floor(num); }, Math); + * // => { '4': 1, '6': 2 } + * + * _.countBy(['one', 'two', 'three'], 'length'); + * // => { '3': 2, '5': 1 } + */ + function countBy(collection, callback, thisArg) { + var result = {}; + callback = createCallback(callback, thisArg); + forEach(collection, function(value, key, collection) { + key = callback(value, key, collection); + (hasOwnProperty.call(result, key) ? result[key]++ : result[key] = 1); + }); + return result; + } + + /** + * Checks if the `callback` returns a truthy value for **all** elements of a + * `collection`. The `callback` is bound to `thisArg` and invoked with three + * arguments; (value, index|key, collection). + * + * @static + * @memberOf _ + * @alias all + * @category Collections + * @param {Array|Object|String} collection The collection to iterate over. + * @param {Function} [callback=identity] The function called per iteration. + * @param {Mixed} [thisArg] The `this` binding of `callback`. + * @returns {Boolean} Returns `true` if all elements pass the callback check, + * else `false`. + * @example + * + * _.every([true, 1, null, 'yes'], Boolean); + * // => false + */ + function every(collection, callback, thisArg) { + var result = true; + callback = createCallback(callback, thisArg); + + if (isArray(collection)) { + var index = -1, + length = collection.length; + + while (++index < length) { + if (!(result = !!callback(collection[index], index, collection))) { + break; + } + } + } else { + forEach(collection, function(value, index, collection) { + return (result = !!callback(value, index, collection)); + }); + } + return result; + } + + /** + * Examines each element in a `collection`, returning an array of all elements + * the `callback` returns truthy for. The `callback` is bound to `thisArg` and + * invoked with three arguments; (value, index|key, collection). + * + * @static + * @memberOf _ + * @alias select + * @category Collections + * @param {Array|Object|String} collection The collection to iterate over. + * @param {Function} [callback=identity] The function called per iteration. + * @param {Mixed} [thisArg] The `this` binding of `callback`. + * @returns {Array} Returns a new array of elements that passed the callback check. + * @example + * + * var evens = _.filter([1, 2, 3, 4, 5, 6], function(num) { return num % 2 == 0; }); + * // => [2, 4, 6] + */ + function filter(collection, callback, thisArg) { + var result = []; + callback = createCallback(callback, thisArg); + forEach(collection, function(value, index, collection) { + if (callback(value, index, collection)) { + result.push(value); + } + }); + return result; + } + + /** + * Examines each element in a `collection`, returning the first one the `callback` + * returns truthy for. The function returns as soon as it finds an acceptable + * element, and does not iterate over the entire `collection`. The `callback` is + * bound to `thisArg` and invoked with three arguments; (value, index|key, collection). + * + * @static + * @memberOf _ + * @alias detect + * @category Collections + * @param {Array|Object|String} collection The collection to iterate over. + * @param {Function} callback The function called per iteration. + * @param {Mixed} [thisArg] The `this` binding of `callback`. + * @returns {Mixed} Returns the element that passed the callback check, + * else `undefined`. + * @example + * + * var even = _.find([1, 2, 3, 4, 5, 6], function(num) { return num % 2 == 0; }); + * // => 2 + */ + function find(collection, callback, thisArg) { + var result; + callback = createCallback(callback, thisArg); + forEach(collection, function(value, index, collection) { + if (callback(value, index, collection)) { + result = value; + return false; + } + }); + return result; + } + + /** + * Iterates over a `collection`, executing the `callback` for each element in + * the `collection`. The `callback` is bound to `thisArg` and invoked with three + * arguments; (value, index|key, collection). Callbacks may exit iteration early + * by explicitly returning `false`. + * + * @static + * @memberOf _ + * @alias each + * @category Collections + * @param {Array|Object|String} collection The collection to iterate over. + * @param {Function} callback The function called per iteration. + * @param {Mixed} [thisArg] The `this` binding of `callback`. + * @returns {Array|Object|String} Returns `collection`. + * @example + * + * _([1, 2, 3]).forEach(alert).join(','); + * // => alerts each number and returns '1,2,3' + * + * _.forEach({ 'one': 1, 'two': 2, 'three': 3 }, alert); + * // => alerts each number (order is not guaranteed) + */ + var forEach = createIterator(forEachIteratorOptions); + + /** + * Creates an object composed of keys returned from running each element of + * `collection` through a `callback`. The corresponding value of each key is an + * array of elements passed to `callback` that returned the key. The `callback` + * is bound to `thisArg` and invoked with three arguments; (value, index|key, collection). + * The `callback` argument may also be the name of a property to group by (e.g. 'length'). + * + * @static + * @memberOf _ + * @category Collections + * @param {Array|Object|String} collection The collection to iterate over. + * @param {Function|String} callback|property The function called per iteration + * or property name to group by. + * @param {Mixed} [thisArg] The `this` binding of `callback`. + * @returns {Object} Returns the composed aggregate object. + * @example + * + * _.groupBy([4.2, 6.1, 6.4], function(num) { return Math.floor(num); }); + * // => { '4': [4.2], '6': [6.1, 6.4] } + * + * _.groupBy([4.2, 6.1, 6.4], function(num) { return this.floor(num); }, Math); + * // => { '4': [4.2], '6': [6.1, 6.4] } + * + * _.groupBy(['one', 'two', 'three'], 'length'); + * // => { '3': ['one', 'two'], '5': ['three'] } + */ + function groupBy(collection, callback, thisArg) { + var result = {}; + callback = createCallback(callback, thisArg); + forEach(collection, function(value, key, collection) { + key = callback(value, key, collection); + (hasOwnProperty.call(result, key) ? result[key] : result[key] = []).push(value); + }); + return result; + } + + /** + * Invokes the method named by `methodName` on each element in the `collection`, + * returning an array of the results of each invoked method. Additional arguments + * will be passed to each invoked method. If `methodName` is a function it will + * be invoked for, and `this` bound to, each element in the `collection`. + * + * @static + * @memberOf _ + * @category Collections + * @param {Array|Object|String} collection The collection to iterate over. + * @param {Function|String} methodName The name of the method to invoke or + * the function invoked per iteration. + * @param {Mixed} [arg1, arg2, ...] Arguments to invoke the method with. + * @returns {Array} Returns a new array of the results of each invoked method. + * @example + * + * _.invoke([[5, 1, 7], [3, 2, 1]], 'sort'); + * // => [[1, 5, 7], [1, 2, 3]] + * + * _.invoke([123, 456], String.prototype.split, ''); + * // => [['1', '2', '3'], ['4', '5', '6']] + */ + function invoke(collection, methodName) { + var args = slice.call(arguments, 2), + isFunc = typeof methodName == 'function', + result = []; + + forEach(collection, function(value) { + result.push((isFunc ? methodName : value[methodName]).apply(value, args)); + }); + return result; + } + + /** + * Creates an array of values by running each element in the `collection` + * through a `callback`. The `callback` is bound to `thisArg` and invoked with + * three arguments; (value, index|key, collection). + * + * @static + * @memberOf _ + * @alias collect + * @category Collections + * @param {Array|Object|String} collection The collection to iterate over. + * @param {Function} [callback=identity] The function called per iteration. + * @param {Mixed} [thisArg] The `this` binding of `callback`. + * @returns {Array} Returns a new array of the results of each `callback` execution. + * @example + * + * _.map([1, 2, 3], function(num) { return num * 3; }); + * // => [3, 6, 9] + * + * _.map({ 'one': 1, 'two': 2, 'three': 3 }, function(num) { return num * 3; }); + * // => [3, 6, 9] (order is not guaranteed) + */ + function map(collection, callback, thisArg) { + var index = -1, + length = collection ? collection.length : 0, + result = Array(typeof length == 'number' ? length : 0); + + callback = createCallback(callback, thisArg); + if (isArray(collection)) { + while (++index < length) { + result[index] = callback(collection[index], index, collection); + } + } else { + forEach(collection, function(value, key, collection) { + result[++index] = callback(value, key, collection); + }); + } + return result; + } + + /** + * Retrieves the maximum value of an `array`. If `callback` is passed, + * it will be executed for each value in the `array` to generate the + * criterion by which the value is ranked. The `callback` is bound to + * `thisArg` and invoked with three arguments; (value, index, collection). + * + * @static + * @memberOf _ + * @category Collections + * @param {Array|Object|String} collection The collection to iterate over. + * @param {Function} [callback] The function called per iteration. + * @param {Mixed} [thisArg] The `this` binding of `callback`. + * @returns {Mixed} Returns the maximum value. + * @example + * + * var stooges = [ + * { 'name': 'moe', 'age': 40 }, + * { 'name': 'larry', 'age': 50 }, + * { 'name': 'curly', 'age': 60 } + * ]; + * + * _.max(stooges, function(stooge) { return stooge.age; }); + * // => { 'name': 'curly', 'age': 60 }; + */ + function max(collection, callback, thisArg) { + var computed = -Infinity, + index = -1, + length = collection ? collection.length : 0, + result = computed; + + if (callback || !isArray(collection)) { + callback = !callback && isString(collection) + ? charAtCallback + : createCallback(callback, thisArg); + + forEach(collection, function(value, index, collection) { + var current = callback(value, index, collection); + if (current > computed) { + computed = current; + result = value; + } + }); + } else { + while (++index < length) { + if (collection[index] > result) { + result = collection[index]; + } + } + } + return result; + } + + /** + * Retrieves the minimum value of an `array`. If `callback` is passed, + * it will be executed for each value in the `array` to generate the + * criterion by which the value is ranked. The `callback` is bound to `thisArg` + * and invoked with three arguments; (value, index, collection). + * + * @static + * @memberOf _ + * @category Collections + * @param {Array|Object|String} collection The collection to iterate over. + * @param {Function} [callback] The function called per iteration. + * @param {Mixed} [thisArg] The `this` binding of `callback`. + * @returns {Mixed} Returns the minimum value. + * @example + * + * _.min([10, 5, 100, 2, 1000]); + * // => 2 + */ + function min(collection, callback, thisArg) { + var computed = Infinity, + index = -1, + length = collection ? collection.length : 0, + result = computed; + + if (callback || !isArray(collection)) { + callback = !callback && isString(collection) + ? charAtCallback + : createCallback(callback, thisArg); + + forEach(collection, function(value, index, collection) { + var current = callback(value, index, collection); + if (current < computed) { + computed = current; + result = value; + } + }); + } else { + while (++index < length) { + if (collection[index] < result) { + result = collection[index]; + } + } + } + return result; + } + + /** + * Retrieves the value of a specified property from all elements in + * the `collection`. + * + * @static + * @memberOf _ + * @category Collections + * @param {Array|Object|String} collection The collection to iterate over. + * @param {String} property The property to pluck. + * @returns {Array} Returns a new array of property values. + * @example + * + * var stooges = [ + * { 'name': 'moe', 'age': 40 }, + * { 'name': 'larry', 'age': 50 }, + * { 'name': 'curly', 'age': 60 } + * ]; + * + * _.pluck(stooges, 'name'); + * // => ['moe', 'larry', 'curly'] + */ + function pluck(collection, property) { + var result = []; + forEach(collection, function(value) { + result.push(value[property]); + }); + return result; + } + + /** + * Boils down a `collection` to a single value. The initial state of the + * reduction is `accumulator` and each successive step of it should be returned + * by the `callback`. The `callback` is bound to `thisArg` and invoked with 4 + * arguments; for arrays they are (accumulator, value, index|key, collection). + * + * @static + * @memberOf _ + * @alias foldl, inject + * @category Collections + * @param {Array|Object|String} collection The collection to iterate over. + * @param {Function} callback The function called per iteration. + * @param {Mixed} [accumulator] Initial value of the accumulator. + * @param {Mixed} [thisArg] The `this` binding of `callback`. + * @returns {Mixed} Returns the accumulated value. + * @example + * + * var sum = _.reduce([1, 2, 3], function(memo, num) { return memo + num; }); + * // => 6 + */ + function reduce(collection, callback, accumulator, thisArg) { + var noaccum = arguments.length < 3; + callback = createCallback(callback, thisArg); + forEach(collection, function(value, index, collection) { + accumulator = noaccum + ? (noaccum = false, value) + : callback(accumulator, value, index, collection) + }); + return accumulator; + } + + /** + * The right-associative version of `_.reduce`. + * + * @static + * @memberOf _ + * @alias foldr + * @category Collections + * @param {Array|Object|String} collection The collection to iterate over. + * @param {Function} callback The function called per iteration. + * @param {Mixed} [accumulator] Initial value of the accumulator. + * @param {Mixed} [thisArg] The `this` binding of `callback`. + * @returns {Mixed} Returns the accumulated value. + * @example + * + * var list = [[0, 1], [2, 3], [4, 5]]; + * var flat = _.reduceRight(list, function(a, b) { return a.concat(b); }, []); + * // => [4, 5, 2, 3, 0, 1] + */ + function reduceRight(collection, callback, accumulator, thisArg) { + var iteratee = collection, + length = collection ? collection.length : 0, + noaccum = arguments.length < 3; + + if (typeof length != 'number') { + var props = keys(collection); + length = props.length; + } else if (noCharByIndex && isString(collection)) { + iteratee = collection.split(''); + } + forEach(collection, function(value, index, collection) { + index = props ? props[--length] : --length; + accumulator = noaccum + ? (noaccum = false, iteratee[index]) + : callback.call(thisArg, accumulator, iteratee[index], index, collection); + }); + return accumulator; + } + + /** + * The opposite of `_.filter`, this method returns the values of a + * `collection` that `callback` does **not** return truthy for. + * + * @static + * @memberOf _ + * @category Collections + * @param {Array|Object|String} collection The collection to iterate over. + * @param {Function} [callback=identity] The function called per iteration. + * @param {Mixed} [thisArg] The `this` binding of `callback`. + * @returns {Array} Returns a new array of elements that did **not** pass the + * callback check. + * @example + * + * var odds = _.reject([1, 2, 3, 4, 5, 6], function(num) { return num % 2 == 0; }); + * // => [1, 3, 5] + */ + function reject(collection, callback, thisArg) { + callback = createCallback(callback, thisArg); + return filter(collection, function(value, index, collection) { + return !callback(value, index, collection); + }); + } + + /** + * Creates an array of shuffled `array` values, using a version of the + * Fisher-Yates shuffle. See http://en.wikipedia.org/wiki/Fisher-Yates_shuffle. + * + * @static + * @memberOf _ + * @category Collections + * @param {Array|Object|String} collection The collection to shuffle. + * @returns {Array} Returns a new shuffled collection. + * @example + * + * _.shuffle([1, 2, 3, 4, 5, 6]); + * // => [4, 1, 6, 3, 5, 2] + */ + function shuffle(collection) { + var index = -1, + result = Array(collection ? collection.length : 0); + + forEach(collection, function(value) { + var rand = floor(nativeRandom() * (++index + 1)); + result[index] = result[rand]; + result[rand] = value; + }); + return result; + } + + /** + * Gets the size of the `collection` by returning `collection.length` for arrays + * and array-like objects or the number of own enumerable properties for objects. + * + * @static + * @memberOf _ + * @category Collections + * @param {Array|Object|String} collection The collection to inspect. + * @returns {Number} Returns `collection.length` or number of own enumerable properties. + * @example + * + * _.size([1, 2]); + * // => 2 + * + * _.size({ 'one': 1, 'two': 2, 'three': 3 }); + * // => 3 + * + * _.size('curly'); + * // => 5 + */ + function size(collection) { + var length = collection ? collection.length : 0; + return typeof length == 'number' ? length : keys(collection).length; + } + + /** + * Checks if the `callback` returns a truthy value for **any** element of a + * `collection`. The function returns as soon as it finds passing value, and + * does not iterate over the entire `collection`. The `callback` is bound to + * `thisArg` and invoked with three arguments; (value, index|key, collection). + * + * @static + * @memberOf _ + * @alias any + * @category Collections + * @param {Array|Object|String} collection The collection to iterate over. + * @param {Function} [callback=identity] The function called per iteration. + * @param {Mixed} [thisArg] The `this` binding of `callback`. + * @returns {Boolean} Returns `true` if any element passes the callback check, + * else `false`. + * @example + * + * _.some([null, 0, 'yes', false]); + * // => true + */ + function some(collection, callback, thisArg) { + var result; + callback = createCallback(callback, thisArg); + + if (isArray(collection)) { + var index = -1, + length = collection.length; + + while (++index < length) { + if (result = callback(collection[index], index, collection)) { + break; + } + } + } else { + forEach(collection, function(value, index, collection) { + return !(result = callback(value, index, collection)); + }); + } + return !!result; + } + + /** + * Creates an array, stable sorted in ascending order by the results of + * running each element of `collection` through a `callback`. The `callback` + * is bound to `thisArg` and invoked with three arguments; (value, index|key, collection). + * The `callback` argument may also be the name of a property to sort by (e.g. 'length'). + * + * @static + * @memberOf _ + * @category Collections + * @param {Array|Object|String} collection The collection to iterate over. + * @param {Function|String} callback|property The function called per iteration + * or property name to sort by. + * @param {Mixed} [thisArg] The `this` binding of `callback`. + * @returns {Array} Returns a new array of sorted elements. + * @example + * + * _.sortBy([1, 2, 3], function(num) { return Math.sin(num); }); + * // => [3, 1, 2] + * + * _.sortBy([1, 2, 3], function(num) { return this.sin(num); }, Math); + * // => [3, 1, 2] + * + * _.sortBy(['larry', 'brendan', 'moe'], 'length'); + * // => ['moe', 'larry', 'brendan'] + */ + function sortBy(collection, callback, thisArg) { + var result = []; + callback = createCallback(callback, thisArg); + forEach(collection, function(value, index, collection) { + result.push({ + 'criteria': callback(value, index, collection), + 'index': index, + 'value': value + }); + }); + + var length = result.length; + result.sort(compareAscending); + while (length--) { + result[length] = result[length].value; + } + return result; + } + + /** + * Converts the `collection`, to an array. + * + * @static + * @memberOf _ + * @category Collections + * @param {Array|Object|String} collection The collection to convert. + * @returns {Array} Returns the new converted array. + * @example + * + * (function() { return _.toArray(arguments).slice(1); })(1, 2, 3, 4); + * // => [2, 3, 4] + */ + function toArray(collection) { + if (collection && typeof collection.length == 'number') { + return (noArraySliceOnStrings ? isString(collection) : typeof collection == 'string') + ? collection.split('') + : slice.call(collection); + } + return values(collection); + } + + /** + * Examines each element in a `collection`, returning an array of all elements + * that contain the given `properties`. + * + * @static + * @memberOf _ + * @category Collections + * @param {Array|Object|String} collection The collection to iterate over. + * @param {Object} properties The object of property values to filter by. + * @returns {Array} Returns a new array of elements that contain the given `properties`. + * @example + * + * var stooges = [ + * { 'name': 'moe', 'age': 40 }, + * { 'name': 'larry', 'age': 50 }, + * { 'name': 'curly', 'age': 60 } + * ]; + * + * _.where(stooges, { 'age': 40 }); + * // => [{ 'name': 'moe', 'age': 40 }] + */ + function where(collection, properties) { + var props = []; + forIn(properties, function(value, prop) { + props.push(prop); + }); + return filter(collection, function(object) { + var length = props.length; + while (length--) { + var result = object[props[length]] === properties[props[length]]; + if (!result) { + break; + } + } + return !!result; + }); + } + + /*--------------------------------------------------------------------------*/ + + /** + * Creates an array with all falsey values of `array` removed. The values + * `false`, `null`, `0`, `""`, `undefined` and `NaN` are all falsey. + * + * @static + * @memberOf _ + * @category Arrays + * @param {Array} array The array to compact. + * @returns {Array} Returns a new filtered array. + * @example + * + * _.compact([0, 1, false, 2, '', 3]); + * // => [1, 2, 3] + */ + function compact(array) { + var index = -1, + length = array ? array.length : 0, + result = []; + + while (++index < length) { + var value = array[index]; + if (value) { + result.push(value); + } + } + return result; + } + + /** + * Creates an array of `array` elements not present in the other arrays + * using strict equality for comparisons, i.e. `===`. + * + * @static + * @memberOf _ + * @category Arrays + * @param {Array} array The array to process. + * @param {Array} [array1, array2, ...] Arrays to check. + * @returns {Array} Returns a new array of `array` elements not present in the + * other arrays. + * @example + * + * _.difference([1, 2, 3, 4, 5], [5, 2, 10]); + * // => [1, 3, 4] + */ + function difference(array) { + var index = -1, + length = array ? array.length : 0, + flattened = concat.apply(arrayRef, arguments), + contains = cachedContains(flattened, length), + result = []; + + while (++index < length) { + var value = array[index]; + if (!contains(value)) { + result.push(value); + } + } + return result; + } + + /** + * Gets the first element of the `array`. Pass `n` to return the first `n` + * elements of the `array`. + * + * @static + * @memberOf _ + * @alias head, take + * @category Arrays + * @param {Array} array The array to query. + * @param {Number} [n] The number of elements to return. + * @param- {Object} [guard] Internally used to allow this method to work with + * others like `_.map` without using their callback `index` argument for `n`. + * @returns {Mixed} Returns the first element or an array of the first `n` + * elements of `array`. + * @example + * + * _.first([5, 4, 3, 2, 1]); + * // => 5 + */ + function first(array, n, guard) { + if (array) { + return (n == null || guard) ? array[0] : slice.call(array, 0, n); + } + } + + /** + * Flattens a nested array (the nesting can be to any depth). If `shallow` is + * truthy, `array` will only be flattened a single level. + * + * @static + * @memberOf _ + * @category Arrays + * @param {Array} array The array to compact. + * @param {Boolean} shallow A flag to indicate only flattening a single level. + * @returns {Array} Returns a new flattened array. + * @example + * + * _.flatten([1, [2], [3, [[4]]]]); + * // => [1, 2, 3, 4]; + * + * _.flatten([1, [2], [3, [[4]]]], true); + * // => [1, 2, 3, [[4]]]; + */ + function flatten(array, shallow) { + var index = -1, + length = array ? array.length : 0, + result = []; + + while (++index < length) { + var value = array[index]; + + // recursively flatten arrays (susceptible to call stack limits) + if (isArray(value)) { + push.apply(result, shallow ? value : flatten(value)); + } else { + result.push(value); + } + } + return result; + } + + /** + * Gets the index at which the first occurrence of `value` is found using + * strict equality for comparisons, i.e. `===`. If the `array` is already + * sorted, passing `true` for `fromIndex` will run a faster binary search. + * + * @static + * @memberOf _ + * @category Arrays + * @param {Array} array The array to search. + * @param {Mixed} value The value to search for. + * @param {Boolean|Number} [fromIndex=0] The index to search from or `true` to + * perform a binary search on a sorted `array`. + * @returns {Number} Returns the index of the matched value or `-1`. + * @example + * + * _.indexOf([1, 2, 3, 1, 2, 3], 2); + * // => 1 + * + * _.indexOf([1, 2, 3, 1, 2, 3], 2, 3); + * // => 4 + * + * _.indexOf([1, 1, 2, 2, 3, 3], 2, true); + * // => 2 + */ + function indexOf(array, value, fromIndex) { + var index = -1, + length = array ? array.length : 0; + + if (typeof fromIndex == 'number') { + index = (fromIndex < 0 ? nativeMax(0, length + fromIndex) : fromIndex || 0) - 1; + } else if (fromIndex) { + index = sortedIndex(array, value); + return array[index] === value ? index : -1; + } + while (++index < length) { + if (array[index] === value) { + return index; + } + } + return -1; + } + + /** + * Gets all but the last element of `array`. Pass `n` to exclude the last `n` + * elements from the result. + * + * @static + * @memberOf _ + * @category Arrays + * @param {Array} array The array to query. + * @param {Number} [n=1] The number of elements to exclude. + * @param- {Object} [guard] Internally used to allow this method to work with + * others like `_.map` without using their callback `index` argument for `n`. + * @returns {Array} Returns all but the last element or `n` elements of `array`. + * @example + * + * _.initial([3, 2, 1]); + * // => [3, 2] + */ + function initial(array, n, guard) { + return array + ? slice.call(array, 0, -((n == null || guard) ? 1 : n)) + : []; + } + + /** + * Computes the intersection of all the passed-in arrays using strict equality + * for comparisons, i.e. `===`. + * + * @static + * @memberOf _ + * @category Arrays + * @param {Array} [array1, array2, ...] Arrays to process. + * @returns {Array} Returns a new array of unique elements, in order, that are + * present in **all** of the arrays. + * @example + * + * _.intersection([1, 2, 3], [101, 2, 1, 10], [2, 1]); + * // => [1, 2] + */ + function intersection(array) { + var args = arguments, + argsLength = args.length, + cache = {}, + result = []; + + forEach(array, function(value) { + if (indexOf(result, value) < 0) { + var length = argsLength; + while (--length) { + if (!(cache[length] || (cache[length] = cachedContains(args[length])))(value)) { + return; + } + } + result.push(value); + } + }); + return result; + } + + /** + * Gets the last element of the `array`. Pass `n` to return the last `n` + * elements of the `array`. + * + * @static + * @memberOf _ + * @category Arrays + * @param {Array} array The array to query. + * @param {Number} [n] The number of elements to return. + * @param- {Object} [guard] Internally used to allow this method to work with + * others like `_.map` without using their callback `index` argument for `n`. + * @returns {Mixed} Returns the last element or an array of the last `n` + * elements of `array`. + * @example + * + * _.last([3, 2, 1]); + * // => 1 + */ + function last(array, n, guard) { + if (array) { + var length = array.length; + return (n == null || guard) ? array[length - 1] : slice.call(array, -n || length); + } + } + + /** + * Gets the index at which the last occurrence of `value` is found using strict + * equality for comparisons, i.e. `===`. If `fromIndex` is negative, it is used + * as the offset from the end of the collection. + * + * @static + * @memberOf _ + * @category Arrays + * @param {Array} array The array to search. + * @param {Mixed} value The value to search for. + * @param {Number} [fromIndex=array.length-1] The index to search from. + * @returns {Number} Returns the index of the matched value or `-1`. + * @example + * + * _.lastIndexOf([1, 2, 3, 1, 2, 3], 2); + * // => 4 + * + * _.lastIndexOf([1, 2, 3, 1, 2, 3], 2, 3); + * // => 1 + */ + function lastIndexOf(array, value, fromIndex) { + var index = array ? array.length : 0; + if (typeof fromIndex == 'number') { + index = (fromIndex < 0 ? nativeMax(0, index + fromIndex) : nativeMin(fromIndex, index - 1)) + 1; + } + while (index--) { + if (array[index] === value) { + return index; + } + } + return -1; + } + + /** + * Creates an object composed from arrays of `keys` and `values`. Pass either + * a single two dimensional array, i.e. `[[key1, value1], [key2, value2]]`, or + * two arrays, one of `keys` and one of corresponding `values`. + * + * @static + * @memberOf _ + * @category Arrays + * @param {Array} keys The array of keys. + * @param {Array} [values=[]] The array of values. + * @returns {Object} Returns an object composed of the given keys and + * corresponding values. + * @example + * + * _.object(['moe', 'larry', 'curly'], [30, 40, 50]); + * // => { 'moe': 30, 'larry': 40, 'curly': 50 } + */ + function object(keys, values) { + var index = -1, + length = keys ? keys.length : 0, + result = {}; + + while (++index < length) { + var key = keys[index]; + if (values) { + result[key] = values[index]; + } else { + result[key[0]] = key[1]; + } + } + return result; + } + + /** + * Creates an array of numbers (positive and/or negative) progressing from + * `start` up to but not including `stop`. This method is a port of Python's + * `range()` function. See http://docs.python.org/library/functions.html#range. + * + * @static + * @memberOf _ + * @category Arrays + * @param {Number} [start=0] The start of the range. + * @param {Number} end The end of the range. + * @param {Number} [step=1] The value to increment or descrement by. + * @returns {Array} Returns a new range array. + * @example + * + * _.range(10); + * // => [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] + * + * _.range(1, 11); + * // => [1, 2, 3, 4, 5, 6, 7, 8, 9, 10] + * + * _.range(0, 30, 5); + * // => [0, 5, 10, 15, 20, 25] + * + * _.range(0, -10, -1); + * // => [0, -1, -2, -3, -4, -5, -6, -7, -8, -9] + * + * _.range(0); + * // => [] + */ + function range(start, end, step) { + start = +start || 0; + step = +step || 1; + + if (end == null) { + end = start; + start = 0; + } + // use `Array(length)` so V8 will avoid the slower "dictionary" mode + // http://www.youtube.com/watch?v=XAqIpGU8ZZk#t=16m27s + var index = -1, + length = nativeMax(0, ceil((end - start) / step)), + result = Array(length); + + while (++index < length) { + result[index] = start; + start += step; + } + return result; + } + + /** + * The opposite of `_.initial`, this method gets all but the first value of + * `array`. Pass `n` to exclude the first `n` values from the result. + * + * @static + * @memberOf _ + * @alias drop, tail + * @category Arrays + * @param {Array} array The array to query. + * @param {Number} [n=1] The number of elements to exclude. + * @param- {Object} [guard] Internally used to allow this method to work with + * others like `_.map` without using their callback `index` argument for `n`. + * @returns {Array} Returns all but the first value or `n` values of `array`. + * @example + * + * _.rest([3, 2, 1]); + * // => [2, 1] + */ + function rest(array, n, guard) { + return array + ? slice.call(array, (n == null || guard) ? 1 : n) + : []; + } + + /** + * Uses a binary search to determine the smallest index at which the `value` + * should be inserted into `array` in order to maintain the sort order of the + * sorted `array`. If `callback` is passed, it will be executed for `value` and + * each element in `array` to compute their sort ranking. The `callback` is + * bound to `thisArg` and invoked with one argument; (value). The `callback` + * argument may also be the name of a property to order by. + * + * @static + * @memberOf _ + * @category Arrays + * @param {Array} array The array to iterate over. + * @param {Mixed} value The value to evaluate. + * @param {Function|String} [callback=identity|property] The function called + * per iteration or property name to order by. + * @param {Mixed} [thisArg] The `this` binding of `callback`. + * @returns {Number} Returns the index at which the value should be inserted + * into `array`. + * @example + * + * _.sortedIndex([20, 30, 50], 40); + * // => 2 + * + * _.sortedIndex([{ 'x': 20 }, { 'x': 30 }, { 'x': 50 }], { 'x': 40 }, 'x'); + * // => 2 + * + * var dict = { + * 'wordToNumber': { 'twenty': 20, 'thirty': 30, 'fourty': 40, 'fifty': 50 } + * }; + * + * _.sortedIndex(['twenty', 'thirty', 'fifty'], 'fourty', function(word) { + * return dict.wordToNumber[word]; + * }); + * // => 2 + * + * _.sortedIndex(['twenty', 'thirty', 'fifty'], 'fourty', function(word) { + * return this.wordToNumber[word]; + * }, dict); + * // => 2 + */ + function sortedIndex(array, value, callback, thisArg) { + var low = 0, + high = array ? array.length : low; + + // explicitly reference `identity` for better engine inlining + callback = callback ? createCallback(callback, thisArg) : identity; + value = callback(value); + while (low < high) { + var mid = (low + high) >>> 1; + callback(array[mid]) < value + ? low = mid + 1 + : high = mid; + } + return low; + } + + /** + * Computes the union of the passed-in arrays using strict equality for + * comparisons, i.e. `===`. + * + * @static + * @memberOf _ + * @category Arrays + * @param {Array} [array1, array2, ...] Arrays to process. + * @returns {Array} Returns a new array of unique values, in order, that are + * present in one or more of the arrays. + * @example + * + * _.union([1, 2, 3], [101, 2, 1, 10], [2, 1]); + * // => [1, 2, 3, 101, 10] + */ + function union() { + return uniq(concat.apply(arrayRef, arguments)); + } + + /** + * Creates a duplicate-value-free version of the `array` using strict equality + * for comparisons, i.e. `===`. If the `array` is already sorted, passing `true` + * for `isSorted` will run a faster algorithm. If `callback` is passed, each + * element of `array` is passed through a callback` before uniqueness is computed. + * The `callback` is bound to `thisArg` and invoked with three arguments; (value, index, array). + * + * @static + * @memberOf _ + * @alias unique + * @category Arrays + * @param {Array} array The array to process. + * @param {Boolean} [isSorted=false] A flag to indicate that the `array` is already sorted. + * @param {Function} [callback=identity] The function called per iteration. + * @param {Mixed} [thisArg] The `this` binding of `callback`. + * @returns {Array} Returns a duplicate-value-free array. + * @example + * + * _.uniq([1, 2, 1, 3, 1]); + * // => [1, 2, 3] + * + * _.uniq([1, 1, 2, 2, 3], true); + * // => [1, 2, 3] + * + * _.uniq([1, 2, 1.5, 3, 2.5], function(num) { return Math.floor(num); }); + * // => [1, 2, 3] + * + * _.uniq([1, 2, 1.5, 3, 2.5], function(num) { return this.floor(num); }, Math); + * // => [1, 2, 3] + */ + function uniq(array, isSorted, callback, thisArg) { + var index = -1, + length = array ? array.length : 0, + result = [], + seen = result; + + // juggle arguments + if (typeof isSorted == 'function') { + thisArg = callback; + callback = isSorted; + isSorted = false; + } + // init value cache for large arrays + var isLarge = !isSorted && length > 74; + if (isLarge) { + var cache = {}; + } + if (callback) { + seen = []; + callback = createCallback(callback, thisArg); + } + while (++index < length) { + var value = array[index], + computed = callback ? callback(value, index, array) : value; + + if (isLarge) { + // manually coerce `computed` to a string because `hasOwnProperty`, in + // some older versions of Firefox, coerces objects incorrectly + seen = hasOwnProperty.call(cache, computed + '') ? cache[computed] : (cache[computed] = []); + } + if (isSorted + ? !index || seen[seen.length - 1] !== computed + : indexOf(seen, computed) < 0 + ) { + if (callback || isLarge) { + seen.push(computed); + } + result.push(value); + } + } + return result; + } + + /** + * Creates an array with all occurrences of the passed values removed using + * strict equality for comparisons, i.e. `===`. + * + * @static + * @memberOf _ + * @category Arrays + * @param {Array} array The array to filter. + * @param {Mixed} [value1, value2, ...] Values to remove. + * @returns {Array} Returns a new filtered array. + * @example + * + * _.without([1, 2, 1, 0, 3, 1, 4], 0, 1); + * // => [2, 3, 4] + */ + function without(array) { + var index = -1, + length = array ? array.length : 0, + contains = cachedContains(arguments, 1, 20), + result = []; + + while (++index < length) { + var value = array[index]; + if (!contains(value)) { + result.push(value); + } + } + return result; + } + + /** + * Groups the elements of each array at their corresponding indexes. Useful for + * separate data sources that are coordinated through matching array indexes. + * For a matrix of nested arrays, `_.zip.apply(...)` can transpose the matrix + * in a similar fashion. + * + * @static + * @memberOf _ + * @category Arrays + * @param {Array} [array1, array2, ...] Arrays to process. + * @returns {Array} Returns a new array of grouped elements. + * @example + * + * _.zip(['moe', 'larry', 'curly'], [30, 40, 50], [true, false, false]); + * // => [['moe', 30, true], ['larry', 40, false], ['curly', 50, false]] + */ + function zip(array) { + var index = -1, + length = array ? max(pluck(arguments, 'length')) : 0, + result = Array(length); + + while (++index < length) { + result[index] = pluck(arguments, index); + } + return result; + } + + /*--------------------------------------------------------------------------*/ + + /** + * Creates a function that is restricted to executing `func` only after it is + * called `n` times. The `func` is executed with the `this` binding of the + * created function. + * + * @static + * @memberOf _ + * @category Functions + * @param {Number} n The number of times the function must be called before + * it is executed. + * @param {Function} func The function to restrict. + * @returns {Function} Returns the new restricted function. + * @example + * + * var renderNotes = _.after(notes.length, render); + * _.forEach(notes, function(note) { + * note.asyncSave({ 'success': renderNotes }); + * }); + * // `renderNotes` is run once, after all notes have saved + */ + function after(n, func) { + if (n < 1) { + return func(); + } + return function() { + if (--n < 1) { + return func.apply(this, arguments); + } + }; + } + + /** + * Creates a function that, when called, invokes `func` with the `this` + * binding of `thisArg` and prepends any additional `bind` arguments to those + * passed to the bound function. + * + * @static + * @memberOf _ + * @category Functions + * @param {Function} func The function to bind. + * @param {Mixed} [thisArg] The `this` binding of `func`. + * @param {Mixed} [arg1, arg2, ...] Arguments to be partially applied. + * @returns {Function} Returns the new bound function. + * @example + * + * var func = function(greeting) { + * return greeting + ' ' + this.name; + * }; + * + * func = _.bind(func, { 'name': 'moe' }, 'hi'); + * func(); + * // => 'hi moe' + */ + function bind(func, thisArg) { + // use `Function#bind` if it exists and is fast + // (in V8 `Function#bind` is slower except when partially applied) + return isBindFast || (nativeBind && arguments.length > 2) + ? nativeBind.call.apply(nativeBind, arguments) + : createBound(func, thisArg, slice.call(arguments, 2)); + } + + /** + * Binds methods on `object` to `object`, overwriting the existing method. + * If no method names are provided, all the function properties of `object` + * will be bound. + * + * @static + * @memberOf _ + * @category Functions + * @param {Object} object The object to bind and assign the bound methods to. + * @param {String} [methodName1, methodName2, ...] Method names on the object to bind. + * @returns {Object} Returns `object`. + * @example + * + * var buttonView = { + * 'label': 'lodash', + * 'onClick': function() { alert('clicked: ' + this.label); } + * }; + * + * _.bindAll(buttonView); + * jQuery('#lodash_button').on('click', buttonView.onClick); + * // => When the button is clicked, `this.label` will have the correct value + */ + function bindAll(object) { + var funcs = arguments, + index = funcs.length > 1 ? 0 : (funcs = functions(object), -1), + length = funcs.length; + + while (++index < length) { + var key = funcs[index]; + object[key] = bind(object[key], object); + } + return object; + } + + /** + * Creates a function that is the composition of the passed functions, + * where each function consumes the return value of the function that follows. + * In math terms, composing the functions `f()`, `g()`, and `h()` produces `f(g(h()))`. + * Each function is executed with the `this` binding of the composed function. + * + * @static + * @memberOf _ + * @category Functions + * @param {Function} [func1, func2, ...] Functions to compose. + * @returns {Function} Returns the new composed function. + * @example + * + * var greet = function(name) { return 'hi: ' + name; }; + * var exclaim = function(statement) { return statement + '!'; }; + * var welcome = _.compose(exclaim, greet); + * welcome('moe'); + * // => 'hi: moe!' + */ + function compose() { + var funcs = arguments; + return function() { + var args = arguments, + length = funcs.length; + + while (length--) { + args = [funcs[length].apply(this, args)]; + } + return args[0]; + }; + } + + /** + * Creates a function that will delay the execution of `func` until after + * `wait` milliseconds have elapsed since the last time it was invoked. Pass + * `true` for `immediate` to cause debounce to invoke `func` on the leading, + * instead of the trailing, edge of the `wait` timeout. Subsequent calls to + * the debounced function will return the result of the last `func` call. + * + * @static + * @memberOf _ + * @category Functions + * @param {Function} func The function to debounce. + * @param {Number} wait The number of milliseconds to delay. + * @param {Boolean} immediate A flag to indicate execution is on the leading + * edge of the timeout. + * @returns {Function} Returns the new debounced function. + * @example + * + * var lazyLayout = _.debounce(calculateLayout, 300); + * jQuery(window).on('resize', lazyLayout); + */ + function debounce(func, wait, immediate) { + var args, + result, + thisArg, + timeoutId; + + function delayed() { + timeoutId = null; + if (!immediate) { + result = func.apply(thisArg, args); + } + } + return function() { + var isImmediate = immediate && !timeoutId; + args = arguments; + thisArg = this; + + clearTimeout(timeoutId); + timeoutId = setTimeout(delayed, wait); + + if (isImmediate) { + result = func.apply(thisArg, args); + } + return result; + }; + } + + /** + * Executes the `func` function after `wait` milliseconds. Additional arguments + * will be passed to `func` when it is invoked. + * + * @static + * @memberOf _ + * @category Functions + * @param {Function} func The function to delay. + * @param {Number} wait The number of milliseconds to delay execution. + * @param {Mixed} [arg1, arg2, ...] Arguments to invoke the function with. + * @returns {Number} Returns the `setTimeout` timeout id. + * @example + * + * var log = _.bind(console.log, console); + * _.delay(log, 1000, 'logged later'); + * // => 'logged later' (Appears after one second.) + */ + function delay(func, wait) { + var args = slice.call(arguments, 2); + return setTimeout(function() { func.apply(undefined, args); }, wait); + } + + /** + * Defers executing the `func` function until the current call stack has cleared. + * Additional arguments will be passed to `func` when it is invoked. + * + * @static + * @memberOf _ + * @category Functions + * @param {Function} func The function to defer. + * @param {Mixed} [arg1, arg2, ...] Arguments to invoke the function with. + * @returns {Number} Returns the `setTimeout` timeout id. + * @example + * + * _.defer(function() { alert('deferred'); }); + * // returns from the function before `alert` is called + */ + function defer(func) { + var args = slice.call(arguments, 1); + return setTimeout(function() { func.apply(undefined, args); }, 1); + } + + /** + * Creates a function that, when called, invokes `object[methodName]` and + * prepends any additional `lateBind` arguments to those passed to the bound + * function. This method differs from `_.bind` by allowing bound functions to + * reference methods that will be redefined or don't yet exist. + * + * @static + * @memberOf _ + * @category Functions + * @param {Object} object The object the method belongs to. + * @param {String} methodName The method name. + * @param {Mixed} [arg1, arg2, ...] Arguments to be partially applied. + * @returns {Function} Returns the new bound function. + * @example + * + * var object = { + * 'name': 'moe', + * 'greet': function(greeting) { + * return greeting + ' ' + this.name; + * } + * }; + * + * var func = _.lateBind(object, 'greet', 'hi'); + * func(); + * // => 'hi moe' + * + * object.greet = function(greeting) { + * return greeting + ', ' + this.name + '!'; + * }; + * + * func(); + * // => 'hi, moe!' + */ + function lateBind(object, methodName) { + return createBound(methodName, object, slice.call(arguments, 2)); + } + + /** + * Creates a function that memoizes the result of `func`. If `resolver` is + * passed, it will be used to determine the cache key for storing the result + * based on the arguments passed to the memoized function. By default, the first + * argument passed to the memoized function is used as the cache key. The `func` + * is executed with the `this` binding of the memoized function. + * + * @static + * @memberOf _ + * @category Functions + * @param {Function} func The function to have its output memoized. + * @param {Function} [resolver] A function used to resolve the cache key. + * @returns {Function} Returns the new memoizing function. + * @example + * + * var fibonacci = _.memoize(function(n) { + * return n < 2 ? n : fibonacci(n - 1) + fibonacci(n - 2); + * }); + */ + function memoize(func, resolver) { + var cache = {}; + return function() { + var key = resolver ? resolver.apply(this, arguments) : arguments[0]; + return hasOwnProperty.call(cache, key) + ? cache[key] + : (cache[key] = func.apply(this, arguments)); + }; + } + + /** + * Creates a function that is restricted to execute `func` once. Repeat calls to + * the function will return the value of the first call. The `func` is executed + * with the `this` binding of the created function. + * + * @static + * @memberOf _ + * @category Functions + * @param {Function} func The function to restrict. + * @returns {Function} Returns the new restricted function. + * @example + * + * var initialize = _.once(createApplication); + * initialize(); + * initialize(); + * // Application is only created once. + */ + function once(func) { + var result, + ran = false; + + return function() { + if (ran) { + return result; + } + ran = true; + result = func.apply(this, arguments); + + // clear the `func` variable so the function may be garbage collected + func = null; + return result; + }; + } + + /** + * Creates a function that, when called, invokes `func` with any additional + * `partial` arguments prepended to those passed to the new function. This + * method is similar to `bind`, except it does **not** alter the `this` binding. + * + * @static + * @memberOf _ + * @category Functions + * @param {Function} func The function to partially apply arguments to. + * @param {Mixed} [arg1, arg2, ...] Arguments to be partially applied. + * @returns {Function} Returns the new partially applied function. + * @example + * + * var greet = function(greeting, name) { return greeting + ': ' + name; }; + * var hi = _.partial(greet, 'hi'); + * hi('moe'); + * // => 'hi: moe' + */ + function partial(func) { + return createBound(func, slice.call(arguments, 1)); + } + + /** + * Creates a function that, when executed, will only call the `func` + * function at most once per every `wait` milliseconds. If the throttled + * function is invoked more than once during the `wait` timeout, `func` will + * also be called on the trailing edge of the timeout. Subsequent calls to the + * throttled function will return the result of the last `func` call. + * + * @static + * @memberOf _ + * @category Functions + * @param {Function} func The function to throttle. + * @param {Number} wait The number of milliseconds to throttle executions to. + * @returns {Function} Returns the new throttled function. + * @example + * + * var throttled = _.throttle(updatePosition, 100); + * jQuery(window).on('scroll', throttled); + */ + function throttle(func, wait) { + var args, + result, + thisArg, + timeoutId, + lastCalled = 0; + + function trailingCall() { + lastCalled = new Date; + timeoutId = null; + result = func.apply(thisArg, args); + } + return function() { + var now = new Date, + remaining = wait - (now - lastCalled); + + args = arguments; + thisArg = this; + + if (remaining <= 0) { + clearTimeout(timeoutId); + lastCalled = now; + result = func.apply(thisArg, args); + } + else if (!timeoutId) { + timeoutId = setTimeout(trailingCall, remaining); + } + return result; + }; + } + + /** + * Creates a function that passes `value` to the `wrapper` function as its + * first argument. Additional arguments passed to the function are appended + * to those passed to the `wrapper` function. The `wrapper` is executed with + * the `this` binding of the created function. + * + * @static + * @memberOf _ + * @category Functions + * @param {Mixed} value The value to wrap. + * @param {Function} wrapper The wrapper function. + * @returns {Function} Returns the new function. + * @example + * + * var hello = function(name) { return 'hello ' + name; }; + * hello = _.wrap(hello, function(func) { + * return 'before, ' + func('moe') + ', after'; + * }); + * hello(); + * // => 'before, hello moe, after' + */ + function wrap(value, wrapper) { + return function() { + var args = [value]; + push.apply(args, arguments); + return wrapper.apply(this, args); + }; + } + + /*--------------------------------------------------------------------------*/ + + /** + * Converts the characters `&`, `<`, `>`, `"`, and `'` in `string` to their + * corresponding HTML entities. + * + * @static + * @memberOf _ + * @category Utilities + * @param {String} string The string to escape. + * @returns {String} Returns the escaped string. + * @example + * + * _.escape('Moe, Larry & Curly'); + * // => "Moe, Larry & Curly" + */ + function escape(string) { + return string == null ? '' : (string + '').replace(reUnescapedHtml, escapeHtmlChar); + } + + /** + * This function returns the first argument passed to it. + * + * Note: It is used throughout Lo-Dash as a default callback. + * + * @static + * @memberOf _ + * @category Utilities + * @param {Mixed} value Any value. + * @returns {Mixed} Returns `value`. + * @example + * + * var moe = { 'name': 'moe' }; + * moe === _.identity(moe); + * // => true + */ + function identity(value) { + return value; + } + + /** + * Adds functions properties of `object` to the `lodash` function and chainable + * wrapper. + * + * @static + * @memberOf _ + * @category Utilities + * @param {Object} object The object of function properties to add to `lodash`. + * @example + * + * _.mixin({ + * 'capitalize': function(string) { + * return string.charAt(0).toUpperCase() + string.slice(1).toLowerCase(); + * } + * }); + * + * _.capitalize('larry'); + * // => 'Larry' + * + * _('curly').capitalize(); + * // => 'Curly' + */ + function mixin(object) { + forEach(functions(object), function(methodName) { + var func = lodash[methodName] = object[methodName]; + + lodash.prototype[methodName] = function() { + var args = [this.__wrapped__]; + push.apply(args, arguments); + + var result = func.apply(lodash, args); + if (this.__chain__) { + result = new lodash(result); + result.__chain__ = true; + } + return result; + }; + }); + } + + /** + * Reverts the '_' variable to its previous value and returns a reference to + * the `lodash` function. + * + * @static + * @memberOf _ + * @category Utilities + * @returns {Function} Returns the `lodash` function. + * @example + * + * var lodash = _.noConflict(); + */ + function noConflict() { + window._ = oldDash; + return this; + } + + /** + * Produces a random number between `min` and `max` (inclusive). If only one + * argument is passed, a number between `0` and the given number will be returned. + * + * @static + * @memberOf _ + * @category Utilities + * @param {Number} [min=0] The minimum possible value. + * @param {Number} [max=1] The maximum possible value. + * @returns {Number} Returns a random number. + * @example + * + * _.random(0, 5); + * // => a number between 1 and 5 + * + * _.random(5); + * // => also a number between 1 and 5 + */ + function random(min, max) { + if (min == null && max == null) { + max = 1; + } + min = +min || 0; + if (max == null) { + max = min; + min = 0; + } + return min + floor(nativeRandom() * ((+max || 0) - min + 1)); + } + + /** + * Resolves the value of `property` on `object`. If `property` is a function + * it will be invoked and its result returned, else the property value is + * returned. If `object` is falsey, then `null` is returned. + * + * @deprecated + * @static + * @memberOf _ + * @category Utilities + * @param {Object} object The object to inspect. + * @param {String} property The property to get the value of. + * @returns {Mixed} Returns the resolved value. + * @example + * + * var object = { + * 'cheese': 'crumpets', + * 'stuff': function() { + * return 'nonsense'; + * } + * }; + * + * _.result(object, 'cheese'); + * // => 'crumpets' + * + * _.result(object, 'stuff'); + * // => 'nonsense' + */ + function result(object, property) { + // based on Backbone's private `getValue` function + // https://github.com/documentcloud/backbone/blob/0.9.2/backbone.js#L1419-1424 + var value = object ? object[property] : null; + return isFunction(value) ? object[property]() : value; + } + + /** + * A micro-templating method that handles arbitrary delimiters, preserves + * whitespace, and correctly escapes quotes within interpolated code. + * + * Note: In the development build `_.template` utilizes sourceURLs for easier + * debugging. See http://www.html5rocks.com/en/tutorials/developertools/sourcemaps/#toc-sourceurl + * + * Note: Lo-Dash may be used in Chrome extensions by either creating a `lodash csp` + * build and avoiding `_.template` use, or loading Lo-Dash in a sandboxed page. + * See http://developer.chrome.com/trunk/extensions/sandboxingEval.html + * + * @static + * @memberOf _ + * @category Utilities + * @param {String} text The template text. + * @param {Obect} data The data object used to populate the text. + * @param {Object} options The options object. + * escape - The "escape" delimiter regexp. + * evaluate - The "evaluate" delimiter regexp. + * interpolate - The "interpolate" delimiter regexp. + * sourceURL - The sourceURL of the template's compiled source. + * variable - The data object variable name. + * + * @returns {Function|String} Returns a compiled function when no `data` object + * is given, else it returns the interpolated text. + * @example + * + * // using a compiled template + * var compiled = _.template('hello <%= name %>'); + * compiled({ 'name': 'moe' }); + * // => 'hello moe' + * + * var list = '<% _.forEach(people, function(name) { %>
  1. <%= name %>
  2. <% }); %>'; + * _.template(list, { 'people': ['moe', 'larry', 'curly'] }); + * // => '
  3. moe
  4. larry
  5. curly
  6. ' + * + * // using the "escape" delimiter to escape HTML in data property values + * _.template('<%- value %>', { 'value': '" ); iDoc.close(); - test("isElement", function() { + test("objects: isElement", function() { ok(!_.isElement('div'), 'strings are not dom elements'); ok(_.isElement($('html')[0]), 'the html tag is a DOM element'); ok(_.isElement(iElement), 'even from another frame'); }); - test("isArguments", function() { + test("objects: isArguments", function() { var args = (function(){ return arguments; })(1, 2, 3); ok(!_.isArguments('string'), 'a string is not an arguments object'); ok(!_.isArguments(_.isArguments), 'a function is not an arguments object'); @@ -407,7 +409,7 @@ $(document).ready(function() { ok(_.isArguments(iArguments), 'even from another frame'); }); - test("isObject", function() { + test("objects: isObject", function() { ok(_.isObject(arguments), 'the arguments object is object'); ok(_.isObject([1, 2, 3]), 'and arrays'); ok(_.isObject($('html')[0]), 'and DOM element'); @@ -422,19 +424,19 @@ $(document).ready(function() { ok(_.isObject(new String('string')), 'but new String()'); }); - test("isArray", function() { + test("objects: isArray", function() { ok(!_.isArray(arguments), 'the arguments object is not an array'); ok(_.isArray([1, 2, 3]), 'but arrays are'); ok(_.isArray(iArray), 'even from another frame'); }); - test("isString", function() { + test("objects: isString", function() { ok(!_.isString(document.body), 'the document body is not a string'); ok(_.isString([1, 2, 3].join(', ')), 'but strings are'); ok(_.isString(iString), 'even from another frame'); }); - test("isNumber", function() { + test("objects: isNumber", function() { ok(!_.isNumber('string'), 'a string is not a number'); ok(!_.isNumber(arguments), 'the arguments object is not a number'); ok(!_.isNumber(undefined), 'undefined is not a number'); @@ -445,7 +447,7 @@ $(document).ready(function() { ok(!_.isNumber('1'), 'numeric strings are not numbers'); }); - test("isBoolean", function() { + test("objects: isBoolean", function() { ok(!_.isBoolean(2), 'a number is not a boolean'); ok(!_.isBoolean("string"), 'a string is not a boolean'); ok(!_.isBoolean("false"), 'the string "false" is not a boolean'); @@ -459,57 +461,42 @@ $(document).ready(function() { ok(_.isBoolean(iBoolean), 'even from another frame'); }); - test("isFunction", function() { + test("objects: isFunction", function() { ok(!_.isFunction([1, 2, 3]), 'arrays are not functions'); ok(!_.isFunction('moe'), 'strings are not functions'); ok(_.isFunction(_.isFunction), 'but functions are'); ok(_.isFunction(iFunction), 'even from another frame'); }); - test("isDate", function() { + test("objects: isDate", function() { ok(!_.isDate(100), 'numbers are not dates'); ok(!_.isDate({}), 'objects are not dates'); ok(_.isDate(new Date()), 'but dates are'); ok(_.isDate(iDate), 'even from another frame'); }); - test("isRegExp", function() { + test("objects: isRegExp", function() { ok(!_.isRegExp(_.identity), 'functions are not RegExps'); ok(_.isRegExp(/identity/), 'but RegExps are'); ok(_.isRegExp(iRegExp), 'even from another frame'); }); - test("isFinite", function() { - ok(!_.isFinite(undefined), 'undefined is not Finite'); - ok(!_.isFinite(null), 'null is not Finite'); - ok(!_.isFinite(NaN), 'NaN is not Finite'); - ok(!_.isFinite(Infinity), 'Infinity is not Finite'); - ok(!_.isFinite(-Infinity), '-Infinity is not Finite'); - ok(!_.isFinite('12'), 'Strings are not numbers'); - var obj = new Number(5); - ok(_.isFinite(obj), 'Number instances can be finite'); - ok(_.isFinite(0), '0 is Finite'); - ok(_.isFinite(123), 'Ints are Finite'); - ok(_.isFinite(-12.44), 'Floats are Finite'); - }); - - test("isNaN", function() { + test("objects: isNaN", function() { ok(!_.isNaN(undefined), 'undefined is not NaN'); ok(!_.isNaN(null), 'null is not NaN'); ok(!_.isNaN(0), '0 is not NaN'); ok(_.isNaN(NaN), 'but NaN is'); ok(_.isNaN(iNaN), 'even from another frame'); - ok(_.isNaN(new Number(NaN)), 'wrapped NaN is still NaN'); }); - test("isNull", function() { + test("objects: isNull", function() { ok(!_.isNull(undefined), 'undefined is not null'); ok(!_.isNull(NaN), 'NaN is not null'); ok(_.isNull(null), 'but null is'); ok(_.isNull(iNull), 'even from another frame'); }); - test("isUndefined", function() { + test("objects: isUndefined", function() { ok(!_.isUndefined(1), 'numbers are defined'); ok(!_.isUndefined(null), 'null is defined'); ok(!_.isUndefined(false), 'false is defined'); @@ -520,7 +507,7 @@ $(document).ready(function() { }); if (window.ActiveXObject) { - test("IE host objects", function() { + test("objects: IE host objects", function() { var xml = new ActiveXObject("Msxml2.DOMDocument.3.0"); ok(!_.isNumber(xml)); ok(!_.isBoolean(xml)); @@ -531,12 +518,12 @@ $(document).ready(function() { }); } - test("tap", function() { + test("objects: tap", function() { var intercepted = null; var interceptor = function(obj) { intercepted = obj; }; var returned = _.tap(1, interceptor); - equal(intercepted, 1, "passes tapped object to interceptor"); - equal(returned, 1, "returns tapped object"); + equals(intercepted, 1, "passes tapped object to interceptor"); + equals(returned, 1, "returns tapped object"); returned = _([1,2,3]).chain(). map(function(n){ return n * 2; }). diff --git a/node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/test/test_underscore/speed.js b/node_modules/grunt/node_modules/grunt-legacy-util/node_modules/underscore.string/test/test_underscore/speed.js similarity index 86% rename from node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/test/test_underscore/speed.js rename to node_modules/grunt/node_modules/grunt-legacy-util/node_modules/underscore.string/test/test_underscore/speed.js index 05e3f2a..86663a2 100644 --- a/node_modules/bower/node_modules/insight/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/test/test_underscore/speed.js +++ b/node_modules/grunt/node_modules/grunt-legacy-util/node_modules/underscore.string/test/test_underscore/speed.js @@ -4,7 +4,6 @@ for (var i=0; i<1000; i++) numbers.push(i); var objects = _.map(numbers, function(n){ return {num : n}; }); var randomized = _.sortBy(numbers, function(){ return Math.random(); }); - var deep = _.map(_.range(100), function() { return _.range(1000); }); JSLitmus.test('_.each()', function() { var timesTwo = []; @@ -60,16 +59,12 @@ return _.values(objects); }); - JSLitmus.test('_.intersection()', function() { - return _.intersection(numbers, randomized); + JSLitmus.test('_.intersect()', function() { + return _.intersect(numbers, randomized); }); JSLitmus.test('_.range()', function() { return _.range(1000); }); - JSLitmus.test('_.flatten()', function() { - return _.flatten(deep); - }); - -})(); +})(); \ No newline at end of file diff --git a/node_modules/grunt/node_modules/grunt-legacy-util/node_modules/underscore.string/test/test_underscore/temp.js b/node_modules/grunt/node_modules/grunt-legacy-util/node_modules/underscore.string/test/test_underscore/temp.js new file mode 100644 index 0000000..68c39dc --- /dev/null +++ b/node_modules/grunt/node_modules/grunt-legacy-util/node_modules/underscore.string/test/test_underscore/temp.js @@ -0,0 +1,27 @@ +(function() { + + var func = function(){}; + var date = new Date(); + var str = "a string"; + var numbers = []; + for (var i=0; i<1000; i++) numbers.push(i); + var objects = _.map(numbers, function(n){ return {num : n}; }); + var randomized = _.sortBy(numbers, function(){ return Math.random(); }); + + JSLitmus.test('_.isNumber', function() { + return _.isNumber(1000) + }); + + JSLitmus.test('_.newIsNumber', function() { + return _.newIsNumber(1000) + }); + + JSLitmus.test('_.isNumber(NaN)', function() { + return _.isNumber(NaN) + }); + + JSLitmus.test('_.newIsNumber(NaN)', function() { + return _.newIsNumber(NaN) + }); + +})(); \ No newline at end of file diff --git a/node_modules/grunt/node_modules/grunt-legacy-util/node_modules/underscore.string/test/test_underscore/temp_tests.html b/node_modules/grunt/node_modules/grunt-legacy-util/node_modules/underscore.string/test/test_underscore/temp_tests.html new file mode 100644 index 0000000..bd34f9d --- /dev/null +++ b/node_modules/grunt/node_modules/grunt-legacy-util/node_modules/underscore.string/test/test_underscore/temp_tests.html @@ -0,0 +1,19 @@ + + + + Underscore Temporary Tests + + + + + + + +

    Underscore Temporary Tests

    +

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

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

    Underscore Test Suite

    +

    +

    +
      +
      +

      Underscore Speed Suite

      +

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

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

      +
      + + +
      + + diff --git a/node_modules/grunt/node_modules/grunt-legacy-util/node_modules/underscore.string/test/test_underscore/utility.js b/node_modules/grunt/node_modules/grunt-legacy-util/node_modules/underscore.string/test/test_underscore/utility.js new file mode 100644 index 0000000..7bc5cb4 --- /dev/null +++ b/node_modules/grunt/node_modules/grunt-legacy-util/node_modules/underscore.string/test/test_underscore/utility.js @@ -0,0 +1,155 @@ +$(document).ready(function() { + + module("Utility"); + + test("utility: noConflict", function() { + var underscore = _.noConflict(); + ok(underscore.isUndefined(_), "The '_' variable has been returned to its previous state."); + var intersection = underscore.intersect([-1, 0, 1, 2], [1, 2, 3, 4]); + equals(intersection.join(', '), '1, 2', 'but the intersection function still works'); + window._ = underscore; + }); + + test("utility: identity", function() { + var moe = {name : 'moe'}; + equals(_.identity(moe), moe, 'moe is the same as his identity'); + }); + + test("utility: uniqueId", function() { + var ids = [], i = 0; + while(i++ < 100) ids.push(_.uniqueId()); + equals(_.uniq(ids).length, ids.length, 'can generate a globally-unique stream of ids'); + }); + + test("utility: times", function() { + var vals = []; + _.times(3, function (i) { vals.push(i); }); + ok(_.isEqual(vals, [0,1,2]), "is 0 indexed"); + // + vals = []; + _(3).times(function (i) { vals.push(i); }); + ok(_.isEqual(vals, [0,1,2]), "works as a wrapper"); + }); + + test("utility: mixin", function() { + _.mixin({ + myReverse: function(string) { + return string.split('').reverse().join(''); + } + }); + equals(_.myReverse('panacea'), 'aecanap', 'mixed in a function to _'); + equals(_('champ').myReverse(), 'pmahc', 'mixed in a function to the OOP wrapper'); + }); + + test("utility: _.escape", function() { + equals(_.escape("Curly & Moe"), "Curly & Moe"); + equals(_.escape("Curly & Moe"), "Curly &amp; Moe"); + }); + + test("utility: template", function() { + var basicTemplate = _.template("<%= thing %> is gettin' on my noives!"); + var result = basicTemplate({thing : 'This'}); + equals(result, "This is gettin' on my noives!", 'can do basic attribute interpolation'); + + var sansSemicolonTemplate = _.template("A <% this %> B"); + equals(sansSemicolonTemplate(), "A B"); + + var backslashTemplate = _.template("<%= thing %> is \\ridanculous"); + equals(backslashTemplate({thing: 'This'}), "This is \\ridanculous"); + + var escapeTemplate = _.template('<%= a ? "checked=\\"checked\\"" : "" %>'); + equals(escapeTemplate({a: true}), 'checked="checked"', 'can handle slash escapes in interpolations.'); + + var fancyTemplate = _.template("
        <% \ + for (key in people) { \ + %>
      • <%= people[key] %>
      • <% } %>
      "); + result = fancyTemplate({people : {moe : "Moe", larry : "Larry", curly : "Curly"}}); + equals(result, "
      • Moe
      • Larry
      • Curly
      ", 'can run arbitrary javascript in templates'); + + var escapedCharsInJavascriptTemplate = _.template("
        <% _.each(numbers.split('\\n'), function(item) { %>
      • <%= item %>
      • <% }) %>
      "); + result = escapedCharsInJavascriptTemplate({numbers: "one\ntwo\nthree\nfour"}); + equals(result, "
      • one
      • two
      • three
      • four
      ", 'Can use escaped characters (e.g. \\n) in Javascript'); + + var namespaceCollisionTemplate = _.template("<%= pageCount %> <%= thumbnails[pageCount] %> <% _.each(thumbnails, function(p) { %>
      \">
      <% }); %>"); + result = namespaceCollisionTemplate({ + pageCount: 3, + thumbnails: { + 1: "p1-thumbnail.gif", + 2: "p2-thumbnail.gif", + 3: "p3-thumbnail.gif" + } + }); + equals(result, "3 p3-thumbnail.gif
      "); + + var noInterpolateTemplate = _.template("

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

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

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

      "); + + var quoteTemplate = _.template("It's its, not it's"); + equals(quoteTemplate({}), "It's its, not it's"); + + var quoteInStatementAndBody = _.template("<%\ + if(foo == 'bar'){ \ + %>Statement quotes and 'quotes'.<% } %>"); + equals(quoteInStatementAndBody({foo: "bar"}), "Statement quotes and 'quotes'."); + + var withNewlinesAndTabs = _.template('This\n\t\tis: <%= x %>.\n\tok.\nend.'); + equals(withNewlinesAndTabs({x: 'that'}), 'This\n\t\tis: that.\n\tok.\nend.'); + + var template = _.template("<%- value %>"); + var result = template({value: " - - - - - - - - -

      Underscore.string Test Suite

      -

      -

      -
        -
        -

        Underscore.string Speed Suite

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

        Underscore.string Test Suite

        -

        -

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

          Underscore Speed Suite

          -

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

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

          -
          - - - diff --git a/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/test/test_underscore/speed.js b/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/test/test_underscore/speed.js deleted file mode 100644 index 05e3f2a..0000000 --- a/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/test/test_underscore/speed.js +++ /dev/null @@ -1,75 +0,0 @@ -(function() { - - var numbers = []; - for (var i=0; i<1000; i++) numbers.push(i); - var objects = _.map(numbers, function(n){ return {num : n}; }); - var randomized = _.sortBy(numbers, function(){ return Math.random(); }); - var deep = _.map(_.range(100), function() { return _.range(1000); }); - - JSLitmus.test('_.each()', function() { - var timesTwo = []; - _.each(numbers, function(num){ timesTwo.push(num * 2); }); - return timesTwo; - }); - - JSLitmus.test('_(list).each()', function() { - var timesTwo = []; - _(numbers).each(function(num){ timesTwo.push(num * 2); }); - return timesTwo; - }); - - JSLitmus.test('jQuery.each()', function() { - var timesTwo = []; - jQuery.each(numbers, function(){ timesTwo.push(this * 2); }); - return timesTwo; - }); - - JSLitmus.test('_.map()', function() { - return _.map(objects, function(obj){ return obj.num; }); - }); - - JSLitmus.test('jQuery.map()', function() { - return jQuery.map(objects, function(obj){ return obj.num; }); - }); - - JSLitmus.test('_.pluck()', function() { - return _.pluck(objects, 'num'); - }); - - JSLitmus.test('_.uniq()', function() { - return _.uniq(randomized); - }); - - JSLitmus.test('_.uniq() (sorted)', function() { - return _.uniq(numbers, true); - }); - - JSLitmus.test('_.sortBy()', function() { - return _.sortBy(numbers, function(num){ return -num; }); - }); - - JSLitmus.test('_.isEqual()', function() { - return _.isEqual(numbers, randomized); - }); - - JSLitmus.test('_.keys()', function() { - return _.keys(objects); - }); - - JSLitmus.test('_.values()', function() { - return _.values(objects); - }); - - JSLitmus.test('_.intersection()', function() { - return _.intersection(numbers, randomized); - }); - - JSLitmus.test('_.range()', function() { - return _.range(1000); - }); - - JSLitmus.test('_.flatten()', function() { - return _.flatten(deep); - }); - -})(); diff --git a/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/test/test_underscore/utility.js b/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/test/test_underscore/utility.js deleted file mode 100644 index c9be20a..0000000 --- a/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/test/test_underscore/utility.js +++ /dev/null @@ -1,249 +0,0 @@ -$(document).ready(function() { - - var templateSettings; - - module("Utility", { - - setup: function() { - templateSettings = _.clone(_.templateSettings); - }, - - teardown: function() { - _.templateSettings = templateSettings; - } - - }); - - test("#750 - Return _ instance.", 2, function() { - var instance = _([]); - ok(_(instance) === instance); - ok(new _(instance) === instance); - }); - - test("identity", function() { - var moe = {name : 'moe'}; - equal(_.identity(moe), moe, 'moe is the same as his identity'); - }); - - test("uniqueId", function() { - var ids = [], i = 0; - while(i++ < 100) ids.push(_.uniqueId()); - equal(_.uniq(ids).length, ids.length, 'can generate a globally-unique stream of ids'); - }); - - test("times", function() { - var vals = []; - _.times(3, function (i) { vals.push(i); }); - ok(_.isEqual(vals, [0,1,2]), "is 0 indexed"); - // - vals = []; - _(3).times(function (i) { vals.push(i); }); - ok(_.isEqual(vals, [0,1,2]), "works as a wrapper"); - }); - - test("mixin", function() { - _.mixin({ - myReverse: function(string) { - return string.split('').reverse().join(''); - } - }); - equal(_.myReverse('panacea'), 'aecanap', 'mixed in a function to _'); - equal(_('champ').myReverse(), 'pmahc', 'mixed in a function to the OOP wrapper'); - }); - - test("_.escape", function() { - equal(_.escape("Curly & Moe"), "Curly & Moe"); - equal(_.escape("Curly & Moe"), "Curly &amp; Moe"); - equal(_.escape(null), ''); - }); - - test("_.unescape", function() { - var string = "Curly & Moe"; - equal(_.unescape("Curly & Moe"), string); - equal(_.unescape("Curly &amp; Moe"), "Curly & Moe"); - equal(_.unescape(null), ''); - equal(_.unescape(_.escape(string)), string); - }); - - test("template", function() { - var basicTemplate = _.template("<%= thing %> is gettin' on my noives!"); - var result = basicTemplate({thing : 'This'}); - equal(result, "This is gettin' on my noives!", 'can do basic attribute interpolation'); - - var sansSemicolonTemplate = _.template("A <% this %> B"); - equal(sansSemicolonTemplate(), "A B"); - - var backslashTemplate = _.template("<%= thing %> is \\ridanculous"); - equal(backslashTemplate({thing: 'This'}), "This is \\ridanculous"); - - var escapeTemplate = _.template('<%= a ? "checked=\\"checked\\"" : "" %>'); - equal(escapeTemplate({a: true}), 'checked="checked"', 'can handle slash escapes in interpolations.'); - - var fancyTemplate = _.template("
            <% \ - for (key in people) { \ - %>
          • <%= people[key] %>
          • <% } %>
          "); - result = fancyTemplate({people : {moe : "Moe", larry : "Larry", curly : "Curly"}}); - equal(result, "
          • Moe
          • Larry
          • Curly
          ", 'can run arbitrary javascript in templates'); - - var escapedCharsInJavascriptTemplate = _.template("
            <% _.each(numbers.split('\\n'), function(item) { %>
          • <%= item %>
          • <% }) %>
          "); - result = escapedCharsInJavascriptTemplate({numbers: "one\ntwo\nthree\nfour"}); - equal(result, "
          • one
          • two
          • three
          • four
          ", 'Can use escaped characters (e.g. \\n) in Javascript'); - - var namespaceCollisionTemplate = _.template("<%= pageCount %> <%= thumbnails[pageCount] %> <% _.each(thumbnails, function(p) { %>
          \">
          <% }); %>"); - result = namespaceCollisionTemplate({ - pageCount: 3, - thumbnails: { - 1: "p1-thumbnail.gif", - 2: "p2-thumbnail.gif", - 3: "p3-thumbnail.gif" - } - }); - equal(result, "3 p3-thumbnail.gif
          "); - - var noInterpolateTemplate = _.template("

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

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

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

          "); - - var quoteTemplate = _.template("It's its, not it's"); - equal(quoteTemplate({}), "It's its, not it's"); - - var quoteInStatementAndBody = _.template("<%\ - if(foo == 'bar'){ \ - %>Statement quotes and 'quotes'.<% } %>"); - equal(quoteInStatementAndBody({foo: "bar"}), "Statement quotes and 'quotes'."); - - var withNewlinesAndTabs = _.template('This\n\t\tis: <%= x %>.\n\tok.\nend.'); - equal(withNewlinesAndTabs({x: 'that'}), 'This\n\t\tis: that.\n\tok.\nend.'); - - var template = _.template("<%- value %>"); - var result = template({value: " - - - diff --git a/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/node_modules/underscore/index.js b/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/node_modules/underscore/index.js deleted file mode 100644 index 2cf0ca5..0000000 --- a/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/node_modules/underscore/index.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('./underscore'); diff --git a/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/node_modules/underscore/package.json b/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/node_modules/underscore/package.json index c58f39c..5065978 100644 --- a/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/node_modules/underscore/package.json +++ b/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/node_modules/underscore/package.json @@ -15,22 +15,40 @@ }, "repository": { "type": "git", - "url": "git://github.com/documentcloud/underscore.git" + "url": "git://github.com/jashkenas/underscore.git" }, "main": "underscore.js", - "version": "1.4.4", + "version": "1.7.0", "devDependencies": { - "phantomjs": "0.2.2" + "docco": "0.6.x", + "phantomjs": "1.9.7-1", + "uglify-js": "2.4.x", + "eslint": "0.6.x" }, "scripts": { - "test": "phantomjs test/vendor/runner.js test/index.html?noglobals=true" + "test": "phantomjs test/vendor/runner.js test/index.html?noglobals=true && eslint underscore.js test/*.js test/vendor/runner.js", + "build": "uglifyjs underscore.js -c \"evaluate=false\" --comments \"/ .*/\" -m --source-map underscore-min.map -o underscore-min.js", + "doc": "docco underscore.js" }, - "_id": "underscore@1.4.4", - "dist": { - "shasum": "61a6a32010622afa07963bf325203cf12239d604", - "tarball": "http://registry.npmjs.org/underscore/-/underscore-1.4.4.tgz" + "licenses": [ + { + "type": "MIT", + "url": "https://raw.github.com/jashkenas/underscore/master/LICENSE" + } + ], + "files": [ + "underscore.js", + "underscore-min.js", + "LICENSE" + ], + "gitHead": "da996e665deb0b69b257e80e3e257c04fde4191c", + "bugs": { + "url": "https://github.com/jashkenas/underscore/issues" }, - "_npmVersion": "1.1.63", + "_id": "underscore@1.7.0", + "_shasum": "6bbaf0877500d36be34ecaa584e0db9fef035209", + "_from": "underscore@~1.7.0", + "_npmVersion": "1.4.24", "_npmUser": { "name": "jashkenas", "email": "jashkenas@gmail.com" @@ -41,12 +59,10 @@ "email": "jashkenas@gmail.com" } ], - "directories": {}, - "_shasum": "61a6a32010622afa07963bf325203cf12239d604", - "_from": "underscore@~1.4.3", - "_resolved": "https://registry.npmjs.org/underscore/-/underscore-1.4.4.tgz", - "bugs": { - "url": "https://github.com/documentcloud/underscore/issues" + "dist": { + "shasum": "6bbaf0877500d36be34ecaa584e0db9fef035209", + "tarball": "http://registry.npmjs.org/underscore/-/underscore-1.7.0.tgz" }, - "readme": "ERROR: No README data found!" + "directories": {}, + "_resolved": "https://registry.npmjs.org/underscore/-/underscore-1.7.0.tgz" } diff --git a/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/node_modules/underscore/underscore-min.js b/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/node_modules/underscore/underscore-min.js index c1d9d3a..11f1d96 100644 --- a/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/node_modules/underscore/underscore-min.js +++ b/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/node_modules/underscore/underscore-min.js @@ -1 +1,6 @@ -(function(){var n=this,t=n._,r={},e=Array.prototype,u=Object.prototype,i=Function.prototype,a=e.push,o=e.slice,c=e.concat,l=u.toString,f=u.hasOwnProperty,s=e.forEach,p=e.map,h=e.reduce,v=e.reduceRight,d=e.filter,g=e.every,m=e.some,y=e.indexOf,b=e.lastIndexOf,x=Array.isArray,_=Object.keys,j=i.bind,w=function(n){return n instanceof w?n:this instanceof w?(this._wrapped=n,void 0):new w(n)};"undefined"!=typeof exports?("undefined"!=typeof module&&module.exports&&(exports=module.exports=w),exports._=w):n._=w,w.VERSION="1.4.4";var A=w.each=w.forEach=function(n,t,e){if(null!=n)if(s&&n.forEach===s)n.forEach(t,e);else if(n.length===+n.length){for(var u=0,i=n.length;i>u;u++)if(t.call(e,n[u],u,n)===r)return}else for(var a in n)if(w.has(n,a)&&t.call(e,n[a],a,n)===r)return};w.map=w.collect=function(n,t,r){var e=[];return null==n?e:p&&n.map===p?n.map(t,r):(A(n,function(n,u,i){e[e.length]=t.call(r,n,u,i)}),e)};var O="Reduce of empty array with no initial value";w.reduce=w.foldl=w.inject=function(n,t,r,e){var u=arguments.length>2;if(null==n&&(n=[]),h&&n.reduce===h)return e&&(t=w.bind(t,e)),u?n.reduce(t,r):n.reduce(t);if(A(n,function(n,i,a){u?r=t.call(e,r,n,i,a):(r=n,u=!0)}),!u)throw new TypeError(O);return r},w.reduceRight=w.foldr=function(n,t,r,e){var u=arguments.length>2;if(null==n&&(n=[]),v&&n.reduceRight===v)return e&&(t=w.bind(t,e)),u?n.reduceRight(t,r):n.reduceRight(t);var i=n.length;if(i!==+i){var a=w.keys(n);i=a.length}if(A(n,function(o,c,l){c=a?a[--i]:--i,u?r=t.call(e,r,n[c],c,l):(r=n[c],u=!0)}),!u)throw new TypeError(O);return r},w.find=w.detect=function(n,t,r){var e;return E(n,function(n,u,i){return t.call(r,n,u,i)?(e=n,!0):void 0}),e},w.filter=w.select=function(n,t,r){var e=[];return null==n?e:d&&n.filter===d?n.filter(t,r):(A(n,function(n,u,i){t.call(r,n,u,i)&&(e[e.length]=n)}),e)},w.reject=function(n,t,r){return w.filter(n,function(n,e,u){return!t.call(r,n,e,u)},r)},w.every=w.all=function(n,t,e){t||(t=w.identity);var u=!0;return null==n?u:g&&n.every===g?n.every(t,e):(A(n,function(n,i,a){return(u=u&&t.call(e,n,i,a))?void 0:r}),!!u)};var E=w.some=w.any=function(n,t,e){t||(t=w.identity);var u=!1;return null==n?u:m&&n.some===m?n.some(t,e):(A(n,function(n,i,a){return u||(u=t.call(e,n,i,a))?r:void 0}),!!u)};w.contains=w.include=function(n,t){return null==n?!1:y&&n.indexOf===y?n.indexOf(t)!=-1:E(n,function(n){return n===t})},w.invoke=function(n,t){var r=o.call(arguments,2),e=w.isFunction(t);return w.map(n,function(n){return(e?t:n[t]).apply(n,r)})},w.pluck=function(n,t){return w.map(n,function(n){return n[t]})},w.where=function(n,t,r){return w.isEmpty(t)?r?null:[]:w[r?"find":"filter"](n,function(n){for(var r in t)if(t[r]!==n[r])return!1;return!0})},w.findWhere=function(n,t){return w.where(n,t,!0)},w.max=function(n,t,r){if(!t&&w.isArray(n)&&n[0]===+n[0]&&65535>n.length)return Math.max.apply(Math,n);if(!t&&w.isEmpty(n))return-1/0;var e={computed:-1/0,value:-1/0};return A(n,function(n,u,i){var a=t?t.call(r,n,u,i):n;a>=e.computed&&(e={value:n,computed:a})}),e.value},w.min=function(n,t,r){if(!t&&w.isArray(n)&&n[0]===+n[0]&&65535>n.length)return Math.min.apply(Math,n);if(!t&&w.isEmpty(n))return 1/0;var e={computed:1/0,value:1/0};return A(n,function(n,u,i){var a=t?t.call(r,n,u,i):n;e.computed>a&&(e={value:n,computed:a})}),e.value},w.shuffle=function(n){var t,r=0,e=[];return A(n,function(n){t=w.random(r++),e[r-1]=e[t],e[t]=n}),e};var k=function(n){return w.isFunction(n)?n:function(t){return t[n]}};w.sortBy=function(n,t,r){var e=k(t);return w.pluck(w.map(n,function(n,t,u){return{value:n,index:t,criteria:e.call(r,n,t,u)}}).sort(function(n,t){var r=n.criteria,e=t.criteria;if(r!==e){if(r>e||r===void 0)return 1;if(e>r||e===void 0)return-1}return n.indexi;){var o=i+a>>>1;u>r.call(e,n[o])?i=o+1:a=o}return i},w.toArray=function(n){return n?w.isArray(n)?o.call(n):n.length===+n.length?w.map(n,w.identity):w.values(n):[]},w.size=function(n){return null==n?0:n.length===+n.length?n.length:w.keys(n).length},w.first=w.head=w.take=function(n,t,r){return null==n?void 0:null==t||r?n[0]:o.call(n,0,t)},w.initial=function(n,t,r){return o.call(n,0,n.length-(null==t||r?1:t))},w.last=function(n,t,r){return null==n?void 0:null==t||r?n[n.length-1]:o.call(n,Math.max(n.length-t,0))},w.rest=w.tail=w.drop=function(n,t,r){return o.call(n,null==t||r?1:t)},w.compact=function(n){return w.filter(n,w.identity)};var R=function(n,t,r){return A(n,function(n){w.isArray(n)?t?a.apply(r,n):R(n,t,r):r.push(n)}),r};w.flatten=function(n,t){return R(n,t,[])},w.without=function(n){return w.difference(n,o.call(arguments,1))},w.uniq=w.unique=function(n,t,r,e){w.isFunction(t)&&(e=r,r=t,t=!1);var u=r?w.map(n,r,e):n,i=[],a=[];return A(u,function(r,e){(t?e&&a[a.length-1]===r:w.contains(a,r))||(a.push(r),i.push(n[e]))}),i},w.union=function(){return w.uniq(c.apply(e,arguments))},w.intersection=function(n){var t=o.call(arguments,1);return w.filter(w.uniq(n),function(n){return w.every(t,function(t){return w.indexOf(t,n)>=0})})},w.difference=function(n){var t=c.apply(e,o.call(arguments,1));return w.filter(n,function(n){return!w.contains(t,n)})},w.zip=function(){for(var n=o.call(arguments),t=w.max(w.pluck(n,"length")),r=Array(t),e=0;t>e;e++)r[e]=w.pluck(n,""+e);return r},w.object=function(n,t){if(null==n)return{};for(var r={},e=0,u=n.length;u>e;e++)t?r[n[e]]=t[e]:r[n[e][0]]=n[e][1];return r},w.indexOf=function(n,t,r){if(null==n)return-1;var e=0,u=n.length;if(r){if("number"!=typeof r)return e=w.sortedIndex(n,t),n[e]===t?e:-1;e=0>r?Math.max(0,u+r):r}if(y&&n.indexOf===y)return n.indexOf(t,r);for(;u>e;e++)if(n[e]===t)return e;return-1},w.lastIndexOf=function(n,t,r){if(null==n)return-1;var e=null!=r;if(b&&n.lastIndexOf===b)return e?n.lastIndexOf(t,r):n.lastIndexOf(t);for(var u=e?r:n.length;u--;)if(n[u]===t)return u;return-1},w.range=function(n,t,r){1>=arguments.length&&(t=n||0,n=0),r=arguments[2]||1;for(var e=Math.max(Math.ceil((t-n)/r),0),u=0,i=Array(e);e>u;)i[u++]=n,n+=r;return i},w.bind=function(n,t){if(n.bind===j&&j)return j.apply(n,o.call(arguments,1));var r=o.call(arguments,2);return function(){return n.apply(t,r.concat(o.call(arguments)))}},w.partial=function(n){var t=o.call(arguments,1);return function(){return n.apply(this,t.concat(o.call(arguments)))}},w.bindAll=function(n){var t=o.call(arguments,1);return 0===t.length&&(t=w.functions(n)),A(t,function(t){n[t]=w.bind(n[t],n)}),n},w.memoize=function(n,t){var r={};return t||(t=w.identity),function(){var e=t.apply(this,arguments);return w.has(r,e)?r[e]:r[e]=n.apply(this,arguments)}},w.delay=function(n,t){var r=o.call(arguments,2);return setTimeout(function(){return n.apply(null,r)},t)},w.defer=function(n){return w.delay.apply(w,[n,1].concat(o.call(arguments,1)))},w.throttle=function(n,t){var r,e,u,i,a=0,o=function(){a=new Date,u=null,i=n.apply(r,e)};return function(){var c=new Date,l=t-(c-a);return r=this,e=arguments,0>=l?(clearTimeout(u),u=null,a=c,i=n.apply(r,e)):u||(u=setTimeout(o,l)),i}},w.debounce=function(n,t,r){var e,u;return function(){var i=this,a=arguments,o=function(){e=null,r||(u=n.apply(i,a))},c=r&&!e;return clearTimeout(e),e=setTimeout(o,t),c&&(u=n.apply(i,a)),u}},w.once=function(n){var t,r=!1;return function(){return r?t:(r=!0,t=n.apply(this,arguments),n=null,t)}},w.wrap=function(n,t){return function(){var r=[n];return a.apply(r,arguments),t.apply(this,r)}},w.compose=function(){var n=arguments;return function(){for(var t=arguments,r=n.length-1;r>=0;r--)t=[n[r].apply(this,t)];return t[0]}},w.after=function(n,t){return 0>=n?t():function(){return 1>--n?t.apply(this,arguments):void 0}},w.keys=_||function(n){if(n!==Object(n))throw new TypeError("Invalid object");var t=[];for(var r in n)w.has(n,r)&&(t[t.length]=r);return t},w.values=function(n){var t=[];for(var r in n)w.has(n,r)&&t.push(n[r]);return t},w.pairs=function(n){var t=[];for(var r in n)w.has(n,r)&&t.push([r,n[r]]);return t},w.invert=function(n){var t={};for(var r in n)w.has(n,r)&&(t[n[r]]=r);return t},w.functions=w.methods=function(n){var t=[];for(var r in n)w.isFunction(n[r])&&t.push(r);return t.sort()},w.extend=function(n){return A(o.call(arguments,1),function(t){if(t)for(var r in t)n[r]=t[r]}),n},w.pick=function(n){var t={},r=c.apply(e,o.call(arguments,1));return A(r,function(r){r in n&&(t[r]=n[r])}),t},w.omit=function(n){var t={},r=c.apply(e,o.call(arguments,1));for(var u in n)w.contains(r,u)||(t[u]=n[u]);return t},w.defaults=function(n){return A(o.call(arguments,1),function(t){if(t)for(var r in t)null==n[r]&&(n[r]=t[r])}),n},w.clone=function(n){return w.isObject(n)?w.isArray(n)?n.slice():w.extend({},n):n},w.tap=function(n,t){return t(n),n};var I=function(n,t,r,e){if(n===t)return 0!==n||1/n==1/t;if(null==n||null==t)return n===t;n instanceof w&&(n=n._wrapped),t instanceof w&&(t=t._wrapped);var u=l.call(n);if(u!=l.call(t))return!1;switch(u){case"[object String]":return n==t+"";case"[object Number]":return n!=+n?t!=+t:0==n?1/n==1/t:n==+t;case"[object Date]":case"[object Boolean]":return+n==+t;case"[object RegExp]":return n.source==t.source&&n.global==t.global&&n.multiline==t.multiline&&n.ignoreCase==t.ignoreCase}if("object"!=typeof n||"object"!=typeof t)return!1;for(var i=r.length;i--;)if(r[i]==n)return e[i]==t;r.push(n),e.push(t);var a=0,o=!0;if("[object Array]"==u){if(a=n.length,o=a==t.length)for(;a--&&(o=I(n[a],t[a],r,e)););}else{var c=n.constructor,f=t.constructor;if(c!==f&&!(w.isFunction(c)&&c instanceof c&&w.isFunction(f)&&f instanceof f))return!1;for(var s in n)if(w.has(n,s)&&(a++,!(o=w.has(t,s)&&I(n[s],t[s],r,e))))break;if(o){for(s in t)if(w.has(t,s)&&!a--)break;o=!a}}return r.pop(),e.pop(),o};w.isEqual=function(n,t){return I(n,t,[],[])},w.isEmpty=function(n){if(null==n)return!0;if(w.isArray(n)||w.isString(n))return 0===n.length;for(var t in n)if(w.has(n,t))return!1;return!0},w.isElement=function(n){return!(!n||1!==n.nodeType)},w.isArray=x||function(n){return"[object Array]"==l.call(n)},w.isObject=function(n){return n===Object(n)},A(["Arguments","Function","String","Number","Date","RegExp"],function(n){w["is"+n]=function(t){return l.call(t)=="[object "+n+"]"}}),w.isArguments(arguments)||(w.isArguments=function(n){return!(!n||!w.has(n,"callee"))}),"function"!=typeof/./&&(w.isFunction=function(n){return"function"==typeof n}),w.isFinite=function(n){return isFinite(n)&&!isNaN(parseFloat(n))},w.isNaN=function(n){return w.isNumber(n)&&n!=+n},w.isBoolean=function(n){return n===!0||n===!1||"[object Boolean]"==l.call(n)},w.isNull=function(n){return null===n},w.isUndefined=function(n){return n===void 0},w.has=function(n,t){return f.call(n,t)},w.noConflict=function(){return n._=t,this},w.identity=function(n){return n},w.times=function(n,t,r){for(var e=Array(n),u=0;n>u;u++)e[u]=t.call(r,u);return e},w.random=function(n,t){return null==t&&(t=n,n=0),n+Math.floor(Math.random()*(t-n+1))};var M={escape:{"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"}};M.unescape=w.invert(M.escape);var S={escape:RegExp("["+w.keys(M.escape).join("")+"]","g"),unescape:RegExp("("+w.keys(M.unescape).join("|")+")","g")};w.each(["escape","unescape"],function(n){w[n]=function(t){return null==t?"":(""+t).replace(S[n],function(t){return M[n][t]})}}),w.result=function(n,t){if(null==n)return null;var r=n[t];return w.isFunction(r)?r.call(n):r},w.mixin=function(n){A(w.functions(n),function(t){var r=w[t]=n[t];w.prototype[t]=function(){var n=[this._wrapped];return a.apply(n,arguments),D.call(this,r.apply(w,n))}})};var N=0;w.uniqueId=function(n){var t=++N+"";return n?n+t:t},w.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g};var T=/(.)^/,q={"'":"'","\\":"\\","\r":"r","\n":"n"," ":"t","\u2028":"u2028","\u2029":"u2029"},B=/\\|'|\r|\n|\t|\u2028|\u2029/g;w.template=function(n,t,r){var e;r=w.defaults({},r,w.templateSettings);var u=RegExp([(r.escape||T).source,(r.interpolate||T).source,(r.evaluate||T).source].join("|")+"|$","g"),i=0,a="__p+='";n.replace(u,function(t,r,e,u,o){return a+=n.slice(i,o).replace(B,function(n){return"\\"+q[n]}),r&&(a+="'+\n((__t=("+r+"))==null?'':_.escape(__t))+\n'"),e&&(a+="'+\n((__t=("+e+"))==null?'':__t)+\n'"),u&&(a+="';\n"+u+"\n__p+='"),i=o+t.length,t}),a+="';\n",r.variable||(a="with(obj||{}){\n"+a+"}\n"),a="var __t,__p='',__j=Array.prototype.join,"+"print=function(){__p+=__j.call(arguments,'');};\n"+a+"return __p;\n";try{e=Function(r.variable||"obj","_",a)}catch(o){throw o.source=a,o}if(t)return e(t,w);var c=function(n){return e.call(this,n,w)};return c.source="function("+(r.variable||"obj")+"){\n"+a+"}",c},w.chain=function(n){return w(n).chain()};var D=function(n){return this._chain?w(n).chain():n};w.mixin(w),A(["pop","push","reverse","shift","sort","splice","unshift"],function(n){var t=e[n];w.prototype[n]=function(){var r=this._wrapped;return t.apply(r,arguments),"shift"!=n&&"splice"!=n||0!==r.length||delete r[0],D.call(this,r)}}),A(["concat","join","slice"],function(n){var t=e[n];w.prototype[n]=function(){return D.call(this,t.apply(this._wrapped,arguments))}}),w.extend(w.prototype,{chain:function(){return this._chain=!0,this},value:function(){return this._wrapped}})}).call(this); \ No newline at end of file +// Underscore.js 1.7.0 +// http://underscorejs.org +// (c) 2009-2014 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors +// Underscore may be freely distributed under the MIT license. +(function(){var n=this,t=n._,r=Array.prototype,e=Object.prototype,u=Function.prototype,i=r.push,a=r.slice,o=r.concat,l=e.toString,c=e.hasOwnProperty,f=Array.isArray,s=Object.keys,p=u.bind,h=function(n){return n instanceof h?n:this instanceof h?void(this._wrapped=n):new h(n)};"undefined"!=typeof exports?("undefined"!=typeof module&&module.exports&&(exports=module.exports=h),exports._=h):n._=h,h.VERSION="1.7.0";var g=function(n,t,r){if(t===void 0)return n;switch(null==r?3:r){case 1:return function(r){return n.call(t,r)};case 2:return function(r,e){return n.call(t,r,e)};case 3:return function(r,e,u){return n.call(t,r,e,u)};case 4:return function(r,e,u,i){return n.call(t,r,e,u,i)}}return function(){return n.apply(t,arguments)}};h.iteratee=function(n,t,r){return null==n?h.identity:h.isFunction(n)?g(n,t,r):h.isObject(n)?h.matches(n):h.property(n)},h.each=h.forEach=function(n,t,r){if(null==n)return n;t=g(t,r);var e,u=n.length;if(u===+u)for(e=0;u>e;e++)t(n[e],e,n);else{var i=h.keys(n);for(e=0,u=i.length;u>e;e++)t(n[i[e]],i[e],n)}return n},h.map=h.collect=function(n,t,r){if(null==n)return[];t=h.iteratee(t,r);for(var e,u=n.length!==+n.length&&h.keys(n),i=(u||n).length,a=Array(i),o=0;i>o;o++)e=u?u[o]:o,a[o]=t(n[e],e,n);return a};var v="Reduce of empty array with no initial value";h.reduce=h.foldl=h.inject=function(n,t,r,e){null==n&&(n=[]),t=g(t,e,4);var u,i=n.length!==+n.length&&h.keys(n),a=(i||n).length,o=0;if(arguments.length<3){if(!a)throw new TypeError(v);r=n[i?i[o++]:o++]}for(;a>o;o++)u=i?i[o]:o,r=t(r,n[u],u,n);return r},h.reduceRight=h.foldr=function(n,t,r,e){null==n&&(n=[]),t=g(t,e,4);var u,i=n.length!==+n.length&&h.keys(n),a=(i||n).length;if(arguments.length<3){if(!a)throw new TypeError(v);r=n[i?i[--a]:--a]}for(;a--;)u=i?i[a]:a,r=t(r,n[u],u,n);return r},h.find=h.detect=function(n,t,r){var e;return t=h.iteratee(t,r),h.some(n,function(n,r,u){return t(n,r,u)?(e=n,!0):void 0}),e},h.filter=h.select=function(n,t,r){var e=[];return null==n?e:(t=h.iteratee(t,r),h.each(n,function(n,r,u){t(n,r,u)&&e.push(n)}),e)},h.reject=function(n,t,r){return h.filter(n,h.negate(h.iteratee(t)),r)},h.every=h.all=function(n,t,r){if(null==n)return!0;t=h.iteratee(t,r);var e,u,i=n.length!==+n.length&&h.keys(n),a=(i||n).length;for(e=0;a>e;e++)if(u=i?i[e]:e,!t(n[u],u,n))return!1;return!0},h.some=h.any=function(n,t,r){if(null==n)return!1;t=h.iteratee(t,r);var e,u,i=n.length!==+n.length&&h.keys(n),a=(i||n).length;for(e=0;a>e;e++)if(u=i?i[e]:e,t(n[u],u,n))return!0;return!1},h.contains=h.include=function(n,t){return null==n?!1:(n.length!==+n.length&&(n=h.values(n)),h.indexOf(n,t)>=0)},h.invoke=function(n,t){var r=a.call(arguments,2),e=h.isFunction(t);return h.map(n,function(n){return(e?t:n[t]).apply(n,r)})},h.pluck=function(n,t){return h.map(n,h.property(t))},h.where=function(n,t){return h.filter(n,h.matches(t))},h.findWhere=function(n,t){return h.find(n,h.matches(t))},h.max=function(n,t,r){var e,u,i=-1/0,a=-1/0;if(null==t&&null!=n){n=n.length===+n.length?n:h.values(n);for(var o=0,l=n.length;l>o;o++)e=n[o],e>i&&(i=e)}else t=h.iteratee(t,r),h.each(n,function(n,r,e){u=t(n,r,e),(u>a||u===-1/0&&i===-1/0)&&(i=n,a=u)});return i},h.min=function(n,t,r){var e,u,i=1/0,a=1/0;if(null==t&&null!=n){n=n.length===+n.length?n:h.values(n);for(var o=0,l=n.length;l>o;o++)e=n[o],i>e&&(i=e)}else t=h.iteratee(t,r),h.each(n,function(n,r,e){u=t(n,r,e),(a>u||1/0===u&&1/0===i)&&(i=n,a=u)});return i},h.shuffle=function(n){for(var t,r=n&&n.length===+n.length?n:h.values(n),e=r.length,u=Array(e),i=0;e>i;i++)t=h.random(0,i),t!==i&&(u[i]=u[t]),u[t]=r[i];return u},h.sample=function(n,t,r){return null==t||r?(n.length!==+n.length&&(n=h.values(n)),n[h.random(n.length-1)]):h.shuffle(n).slice(0,Math.max(0,t))},h.sortBy=function(n,t,r){return t=h.iteratee(t,r),h.pluck(h.map(n,function(n,r,e){return{value:n,index:r,criteria:t(n,r,e)}}).sort(function(n,t){var r=n.criteria,e=t.criteria;if(r!==e){if(r>e||r===void 0)return 1;if(e>r||e===void 0)return-1}return n.index-t.index}),"value")};var m=function(n){return function(t,r,e){var u={};return r=h.iteratee(r,e),h.each(t,function(e,i){var a=r(e,i,t);n(u,e,a)}),u}};h.groupBy=m(function(n,t,r){h.has(n,r)?n[r].push(t):n[r]=[t]}),h.indexBy=m(function(n,t,r){n[r]=t}),h.countBy=m(function(n,t,r){h.has(n,r)?n[r]++:n[r]=1}),h.sortedIndex=function(n,t,r,e){r=h.iteratee(r,e,1);for(var u=r(t),i=0,a=n.length;a>i;){var o=i+a>>>1;r(n[o])t?[]:a.call(n,0,t)},h.initial=function(n,t,r){return a.call(n,0,Math.max(0,n.length-(null==t||r?1:t)))},h.last=function(n,t,r){return null==n?void 0:null==t||r?n[n.length-1]:a.call(n,Math.max(n.length-t,0))},h.rest=h.tail=h.drop=function(n,t,r){return a.call(n,null==t||r?1:t)},h.compact=function(n){return h.filter(n,h.identity)};var y=function(n,t,r,e){if(t&&h.every(n,h.isArray))return o.apply(e,n);for(var u=0,a=n.length;a>u;u++){var l=n[u];h.isArray(l)||h.isArguments(l)?t?i.apply(e,l):y(l,t,r,e):r||e.push(l)}return e};h.flatten=function(n,t){return y(n,t,!1,[])},h.without=function(n){return h.difference(n,a.call(arguments,1))},h.uniq=h.unique=function(n,t,r,e){if(null==n)return[];h.isBoolean(t)||(e=r,r=t,t=!1),null!=r&&(r=h.iteratee(r,e));for(var u=[],i=[],a=0,o=n.length;o>a;a++){var l=n[a];if(t)a&&i===l||u.push(l),i=l;else if(r){var c=r(l,a,n);h.indexOf(i,c)<0&&(i.push(c),u.push(l))}else h.indexOf(u,l)<0&&u.push(l)}return u},h.union=function(){return h.uniq(y(arguments,!0,!0,[]))},h.intersection=function(n){if(null==n)return[];for(var t=[],r=arguments.length,e=0,u=n.length;u>e;e++){var i=n[e];if(!h.contains(t,i)){for(var a=1;r>a&&h.contains(arguments[a],i);a++);a===r&&t.push(i)}}return t},h.difference=function(n){var t=y(a.call(arguments,1),!0,!0,[]);return h.filter(n,function(n){return!h.contains(t,n)})},h.zip=function(n){if(null==n)return[];for(var t=h.max(arguments,"length").length,r=Array(t),e=0;t>e;e++)r[e]=h.pluck(arguments,e);return r},h.object=function(n,t){if(null==n)return{};for(var r={},e=0,u=n.length;u>e;e++)t?r[n[e]]=t[e]:r[n[e][0]]=n[e][1];return r},h.indexOf=function(n,t,r){if(null==n)return-1;var e=0,u=n.length;if(r){if("number"!=typeof r)return e=h.sortedIndex(n,t),n[e]===t?e:-1;e=0>r?Math.max(0,u+r):r}for(;u>e;e++)if(n[e]===t)return e;return-1},h.lastIndexOf=function(n,t,r){if(null==n)return-1;var e=n.length;for("number"==typeof r&&(e=0>r?e+r+1:Math.min(e,r+1));--e>=0;)if(n[e]===t)return e;return-1},h.range=function(n,t,r){arguments.length<=1&&(t=n||0,n=0),r=r||1;for(var e=Math.max(Math.ceil((t-n)/r),0),u=Array(e),i=0;e>i;i++,n+=r)u[i]=n;return u};var d=function(){};h.bind=function(n,t){var r,e;if(p&&n.bind===p)return p.apply(n,a.call(arguments,1));if(!h.isFunction(n))throw new TypeError("Bind must be called on a function");return r=a.call(arguments,2),e=function(){if(!(this instanceof e))return n.apply(t,r.concat(a.call(arguments)));d.prototype=n.prototype;var u=new d;d.prototype=null;var i=n.apply(u,r.concat(a.call(arguments)));return h.isObject(i)?i:u}},h.partial=function(n){var t=a.call(arguments,1);return function(){for(var r=0,e=t.slice(),u=0,i=e.length;i>u;u++)e[u]===h&&(e[u]=arguments[r++]);for(;r=e)throw new Error("bindAll must be passed function names");for(t=1;e>t;t++)r=arguments[t],n[r]=h.bind(n[r],n);return n},h.memoize=function(n,t){var r=function(e){var u=r.cache,i=t?t.apply(this,arguments):e;return h.has(u,i)||(u[i]=n.apply(this,arguments)),u[i]};return r.cache={},r},h.delay=function(n,t){var r=a.call(arguments,2);return setTimeout(function(){return n.apply(null,r)},t)},h.defer=function(n){return h.delay.apply(h,[n,1].concat(a.call(arguments,1)))},h.throttle=function(n,t,r){var e,u,i,a=null,o=0;r||(r={});var l=function(){o=r.leading===!1?0:h.now(),a=null,i=n.apply(e,u),a||(e=u=null)};return function(){var c=h.now();o||r.leading!==!1||(o=c);var f=t-(c-o);return e=this,u=arguments,0>=f||f>t?(clearTimeout(a),a=null,o=c,i=n.apply(e,u),a||(e=u=null)):a||r.trailing===!1||(a=setTimeout(l,f)),i}},h.debounce=function(n,t,r){var e,u,i,a,o,l=function(){var c=h.now()-a;t>c&&c>0?e=setTimeout(l,t-c):(e=null,r||(o=n.apply(i,u),e||(i=u=null)))};return function(){i=this,u=arguments,a=h.now();var c=r&&!e;return e||(e=setTimeout(l,t)),c&&(o=n.apply(i,u),i=u=null),o}},h.wrap=function(n,t){return h.partial(t,n)},h.negate=function(n){return function(){return!n.apply(this,arguments)}},h.compose=function(){var n=arguments,t=n.length-1;return function(){for(var r=t,e=n[t].apply(this,arguments);r--;)e=n[r].call(this,e);return e}},h.after=function(n,t){return function(){return--n<1?t.apply(this,arguments):void 0}},h.before=function(n,t){var r;return function(){return--n>0?r=t.apply(this,arguments):t=null,r}},h.once=h.partial(h.before,2),h.keys=function(n){if(!h.isObject(n))return[];if(s)return s(n);var t=[];for(var r in n)h.has(n,r)&&t.push(r);return t},h.values=function(n){for(var t=h.keys(n),r=t.length,e=Array(r),u=0;r>u;u++)e[u]=n[t[u]];return e},h.pairs=function(n){for(var t=h.keys(n),r=t.length,e=Array(r),u=0;r>u;u++)e[u]=[t[u],n[t[u]]];return e},h.invert=function(n){for(var t={},r=h.keys(n),e=0,u=r.length;u>e;e++)t[n[r[e]]]=r[e];return t},h.functions=h.methods=function(n){var t=[];for(var r in n)h.isFunction(n[r])&&t.push(r);return t.sort()},h.extend=function(n){if(!h.isObject(n))return n;for(var t,r,e=1,u=arguments.length;u>e;e++){t=arguments[e];for(r in t)c.call(t,r)&&(n[r]=t[r])}return n},h.pick=function(n,t,r){var e,u={};if(null==n)return u;if(h.isFunction(t)){t=g(t,r);for(e in n){var i=n[e];t(i,e,n)&&(u[e]=i)}}else{var l=o.apply([],a.call(arguments,1));n=new Object(n);for(var c=0,f=l.length;f>c;c++)e=l[c],e in n&&(u[e]=n[e])}return u},h.omit=function(n,t,r){if(h.isFunction(t))t=h.negate(t);else{var e=h.map(o.apply([],a.call(arguments,1)),String);t=function(n,t){return!h.contains(e,t)}}return h.pick(n,t,r)},h.defaults=function(n){if(!h.isObject(n))return n;for(var t=1,r=arguments.length;r>t;t++){var e=arguments[t];for(var u in e)n[u]===void 0&&(n[u]=e[u])}return n},h.clone=function(n){return h.isObject(n)?h.isArray(n)?n.slice():h.extend({},n):n},h.tap=function(n,t){return t(n),n};var b=function(n,t,r,e){if(n===t)return 0!==n||1/n===1/t;if(null==n||null==t)return n===t;n instanceof h&&(n=n._wrapped),t instanceof h&&(t=t._wrapped);var u=l.call(n);if(u!==l.call(t))return!1;switch(u){case"[object RegExp]":case"[object String]":return""+n==""+t;case"[object Number]":return+n!==+n?+t!==+t:0===+n?1/+n===1/t:+n===+t;case"[object Date]":case"[object Boolean]":return+n===+t}if("object"!=typeof n||"object"!=typeof t)return!1;for(var i=r.length;i--;)if(r[i]===n)return e[i]===t;var a=n.constructor,o=t.constructor;if(a!==o&&"constructor"in n&&"constructor"in t&&!(h.isFunction(a)&&a instanceof a&&h.isFunction(o)&&o instanceof o))return!1;r.push(n),e.push(t);var c,f;if("[object Array]"===u){if(c=n.length,f=c===t.length)for(;c--&&(f=b(n[c],t[c],r,e)););}else{var s,p=h.keys(n);if(c=p.length,f=h.keys(t).length===c)for(;c--&&(s=p[c],f=h.has(t,s)&&b(n[s],t[s],r,e)););}return r.pop(),e.pop(),f};h.isEqual=function(n,t){return b(n,t,[],[])},h.isEmpty=function(n){if(null==n)return!0;if(h.isArray(n)||h.isString(n)||h.isArguments(n))return 0===n.length;for(var t in n)if(h.has(n,t))return!1;return!0},h.isElement=function(n){return!(!n||1!==n.nodeType)},h.isArray=f||function(n){return"[object Array]"===l.call(n)},h.isObject=function(n){var t=typeof n;return"function"===t||"object"===t&&!!n},h.each(["Arguments","Function","String","Number","Date","RegExp"],function(n){h["is"+n]=function(t){return l.call(t)==="[object "+n+"]"}}),h.isArguments(arguments)||(h.isArguments=function(n){return h.has(n,"callee")}),"function"!=typeof/./&&(h.isFunction=function(n){return"function"==typeof n||!1}),h.isFinite=function(n){return isFinite(n)&&!isNaN(parseFloat(n))},h.isNaN=function(n){return h.isNumber(n)&&n!==+n},h.isBoolean=function(n){return n===!0||n===!1||"[object Boolean]"===l.call(n)},h.isNull=function(n){return null===n},h.isUndefined=function(n){return n===void 0},h.has=function(n,t){return null!=n&&c.call(n,t)},h.noConflict=function(){return n._=t,this},h.identity=function(n){return n},h.constant=function(n){return function(){return n}},h.noop=function(){},h.property=function(n){return function(t){return t[n]}},h.matches=function(n){var t=h.pairs(n),r=t.length;return function(n){if(null==n)return!r;n=new Object(n);for(var e=0;r>e;e++){var u=t[e],i=u[0];if(u[1]!==n[i]||!(i in n))return!1}return!0}},h.times=function(n,t,r){var e=Array(Math.max(0,n));t=g(t,r,1);for(var u=0;n>u;u++)e[u]=t(u);return e},h.random=function(n,t){return null==t&&(t=n,n=0),n+Math.floor(Math.random()*(t-n+1))},h.now=Date.now||function(){return(new Date).getTime()};var _={"&":"&","<":"<",">":">",'"':""","'":"'","`":"`"},w=h.invert(_),j=function(n){var t=function(t){return n[t]},r="(?:"+h.keys(n).join("|")+")",e=RegExp(r),u=RegExp(r,"g");return function(n){return n=null==n?"":""+n,e.test(n)?n.replace(u,t):n}};h.escape=j(_),h.unescape=j(w),h.result=function(n,t){if(null==n)return void 0;var r=n[t];return h.isFunction(r)?n[t]():r};var x=0;h.uniqueId=function(n){var t=++x+"";return n?n+t:t},h.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g};var A=/(.)^/,k={"'":"'","\\":"\\","\r":"r","\n":"n","\u2028":"u2028","\u2029":"u2029"},O=/\\|'|\r|\n|\u2028|\u2029/g,F=function(n){return"\\"+k[n]};h.template=function(n,t,r){!t&&r&&(t=r),t=h.defaults({},t,h.templateSettings);var e=RegExp([(t.escape||A).source,(t.interpolate||A).source,(t.evaluate||A).source].join("|")+"|$","g"),u=0,i="__p+='";n.replace(e,function(t,r,e,a,o){return i+=n.slice(u,o).replace(O,F),u=o+t.length,r?i+="'+\n((__t=("+r+"))==null?'':_.escape(__t))+\n'":e?i+="'+\n((__t=("+e+"))==null?'':__t)+\n'":a&&(i+="';\n"+a+"\n__p+='"),t}),i+="';\n",t.variable||(i="with(obj||{}){\n"+i+"}\n"),i="var __t,__p='',__j=Array.prototype.join,"+"print=function(){__p+=__j.call(arguments,'');};\n"+i+"return __p;\n";try{var a=new Function(t.variable||"obj","_",i)}catch(o){throw o.source=i,o}var l=function(n){return a.call(this,n,h)},c=t.variable||"obj";return l.source="function("+c+"){\n"+i+"}",l},h.chain=function(n){var t=h(n);return t._chain=!0,t};var E=function(n){return this._chain?h(n).chain():n};h.mixin=function(n){h.each(h.functions(n),function(t){var r=h[t]=n[t];h.prototype[t]=function(){var n=[this._wrapped];return i.apply(n,arguments),E.call(this,r.apply(h,n))}})},h.mixin(h),h.each(["pop","push","reverse","shift","sort","splice","unshift"],function(n){var t=r[n];h.prototype[n]=function(){var r=this._wrapped;return t.apply(r,arguments),"shift"!==n&&"splice"!==n||0!==r.length||delete r[0],E.call(this,r)}}),h.each(["concat","join","slice"],function(n){var t=r[n];h.prototype[n]=function(){return E.call(this,t.apply(this._wrapped,arguments))}}),h.prototype.value=function(){return this._wrapped},"function"==typeof define&&define.amd&&define("underscore",[],function(){return h})}).call(this); +//# sourceMappingURL=underscore-min.map \ No newline at end of file diff --git a/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/node_modules/underscore/underscore.js b/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/node_modules/underscore/underscore.js index a12f0d9..b4f49a0 100644 --- a/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/node_modules/underscore/underscore.js +++ b/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/node_modules/underscore/underscore.js @@ -1,6 +1,6 @@ -// Underscore.js 1.4.4 +// Underscore.js 1.7.0 // http://underscorejs.org -// (c) 2009-2013 Jeremy Ashkenas, DocumentCloud Inc. +// (c) 2009-2014 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors // Underscore may be freely distributed under the MIT license. (function() { @@ -8,37 +8,26 @@ // Baseline setup // -------------- - // Establish the root object, `window` in the browser, or `global` on the server. + // Establish the root object, `window` in the browser, or `exports` on the server. var root = this; // Save the previous value of the `_` variable. var previousUnderscore = root._; - // Establish the object that gets returned to break out of a loop iteration. - var breaker = {}; - // Save bytes in the minified (but not gzipped) version: var ArrayProto = Array.prototype, ObjProto = Object.prototype, FuncProto = Function.prototype; // Create quick reference variables for speed access to core prototypes. - var push = ArrayProto.push, - slice = ArrayProto.slice, - concat = ArrayProto.concat, - toString = ObjProto.toString, - hasOwnProperty = ObjProto.hasOwnProperty; + var + push = ArrayProto.push, + slice = ArrayProto.slice, + concat = ArrayProto.concat, + toString = ObjProto.toString, + hasOwnProperty = ObjProto.hasOwnProperty; // All **ECMAScript 5** native function implementations that we hope to use // are declared here. var - nativeForEach = ArrayProto.forEach, - nativeMap = ArrayProto.map, - nativeReduce = ArrayProto.reduce, - nativeReduceRight = ArrayProto.reduceRight, - nativeFilter = ArrayProto.filter, - nativeEvery = ArrayProto.every, - nativeSome = ArrayProto.some, - nativeIndexOf = ArrayProto.indexOf, - nativeLastIndexOf = ArrayProto.lastIndexOf, nativeIsArray = Array.isArray, nativeKeys = Object.keys, nativeBind = FuncProto.bind; @@ -52,8 +41,7 @@ // Export the Underscore object for **Node.js**, with // backwards-compatibility for the old `require()` API. If we're in - // the browser, add `_` as a global object via a string identifier, - // for Closure Compiler "advanced" mode. + // the browser, add `_` as a global object. if (typeof exports !== 'undefined') { if (typeof module !== 'undefined' && module.exports) { exports = module.exports = _; @@ -64,98 +52,125 @@ } // Current version. - _.VERSION = '1.4.4'; + _.VERSION = '1.7.0'; + + // Internal function that returns an efficient (for current engines) version + // of the passed-in callback, to be repeatedly applied in other Underscore + // functions. + var createCallback = function(func, context, argCount) { + if (context === void 0) return func; + switch (argCount == null ? 3 : argCount) { + case 1: return function(value) { + return func.call(context, value); + }; + case 2: return function(value, other) { + return func.call(context, value, other); + }; + case 3: return function(value, index, collection) { + return func.call(context, value, index, collection); + }; + case 4: return function(accumulator, value, index, collection) { + return func.call(context, accumulator, value, index, collection); + }; + } + return function() { + return func.apply(context, arguments); + }; + }; + + // A mostly-internal function to generate callbacks that can be applied + // to each element in a collection, returning the desired result — either + // identity, an arbitrary callback, a property matcher, or a property accessor. + _.iteratee = function(value, context, argCount) { + if (value == null) return _.identity; + if (_.isFunction(value)) return createCallback(value, context, argCount); + if (_.isObject(value)) return _.matches(value); + return _.property(value); + }; // Collection Functions // -------------------- // The cornerstone, an `each` implementation, aka `forEach`. - // Handles objects with the built-in `forEach`, arrays, and raw objects. - // Delegates to **ECMAScript 5**'s native `forEach` if available. - var each = _.each = _.forEach = function(obj, iterator, context) { - if (obj == null) return; - if (nativeForEach && obj.forEach === nativeForEach) { - obj.forEach(iterator, context); - } else if (obj.length === +obj.length) { - for (var i = 0, l = obj.length; i < l; i++) { - if (iterator.call(context, obj[i], i, obj) === breaker) return; + // Handles raw objects in addition to array-likes. Treats all + // sparse array-likes as if they were dense. + _.each = _.forEach = function(obj, iteratee, context) { + if (obj == null) return obj; + iteratee = createCallback(iteratee, context); + var i, length = obj.length; + if (length === +length) { + for (i = 0; i < length; i++) { + iteratee(obj[i], i, obj); } } else { - for (var key in obj) { - if (_.has(obj, key)) { - if (iterator.call(context, obj[key], key, obj) === breaker) return; - } + var keys = _.keys(obj); + for (i = 0, length = keys.length; i < length; i++) { + iteratee(obj[keys[i]], keys[i], obj); } } + return obj; }; - // Return the results of applying the iterator to each element. - // Delegates to **ECMAScript 5**'s native `map` if available. - _.map = _.collect = function(obj, iterator, context) { - var results = []; - if (obj == null) return results; - if (nativeMap && obj.map === nativeMap) return obj.map(iterator, context); - each(obj, function(value, index, list) { - results[results.length] = iterator.call(context, value, index, list); - }); + // Return the results of applying the iteratee to each element. + _.map = _.collect = function(obj, iteratee, context) { + if (obj == null) return []; + iteratee = _.iteratee(iteratee, context); + var keys = obj.length !== +obj.length && _.keys(obj), + length = (keys || obj).length, + results = Array(length), + currentKey; + for (var index = 0; index < length; index++) { + currentKey = keys ? keys[index] : index; + results[index] = iteratee(obj[currentKey], currentKey, obj); + } return results; }; var reduceError = 'Reduce of empty array with no initial value'; // **Reduce** builds up a single result from a list of values, aka `inject`, - // or `foldl`. Delegates to **ECMAScript 5**'s native `reduce` if available. - _.reduce = _.foldl = _.inject = function(obj, iterator, memo, context) { - var initial = arguments.length > 2; + // or `foldl`. + _.reduce = _.foldl = _.inject = function(obj, iteratee, memo, context) { if (obj == null) obj = []; - if (nativeReduce && obj.reduce === nativeReduce) { - if (context) iterator = _.bind(iterator, context); - return initial ? obj.reduce(iterator, memo) : obj.reduce(iterator); + iteratee = createCallback(iteratee, context, 4); + var keys = obj.length !== +obj.length && _.keys(obj), + length = (keys || obj).length, + index = 0, currentKey; + if (arguments.length < 3) { + if (!length) throw new TypeError(reduceError); + memo = obj[keys ? keys[index++] : index++]; + } + for (; index < length; index++) { + currentKey = keys ? keys[index] : index; + memo = iteratee(memo, obj[currentKey], currentKey, obj); } - each(obj, function(value, index, list) { - if (!initial) { - memo = value; - initial = true; - } else { - memo = iterator.call(context, memo, value, index, list); - } - }); - if (!initial) throw new TypeError(reduceError); return memo; }; // The right-associative version of reduce, also known as `foldr`. - // Delegates to **ECMAScript 5**'s native `reduceRight` if available. - _.reduceRight = _.foldr = function(obj, iterator, memo, context) { - var initial = arguments.length > 2; + _.reduceRight = _.foldr = function(obj, iteratee, memo, context) { if (obj == null) obj = []; - if (nativeReduceRight && obj.reduceRight === nativeReduceRight) { - if (context) iterator = _.bind(iterator, context); - return initial ? obj.reduceRight(iterator, memo) : obj.reduceRight(iterator); + iteratee = createCallback(iteratee, context, 4); + var keys = obj.length !== + obj.length && _.keys(obj), + index = (keys || obj).length, + currentKey; + if (arguments.length < 3) { + if (!index) throw new TypeError(reduceError); + memo = obj[keys ? keys[--index] : --index]; } - var length = obj.length; - if (length !== +length) { - var keys = _.keys(obj); - length = keys.length; + while (index--) { + currentKey = keys ? keys[index] : index; + memo = iteratee(memo, obj[currentKey], currentKey, obj); } - each(obj, function(value, index, list) { - index = keys ? keys[--length] : --length; - if (!initial) { - memo = obj[index]; - initial = true; - } else { - memo = iterator.call(context, memo, obj[index], index, list); - } - }); - if (!initial) throw new TypeError(reduceError); return memo; }; // Return the first value which passes a truth test. Aliased as `detect`. - _.find = _.detect = function(obj, iterator, context) { + _.find = _.detect = function(obj, predicate, context) { var result; - any(obj, function(value, index, list) { - if (iterator.call(context, value, index, list)) { + predicate = _.iteratee(predicate, context); + _.some(obj, function(value, index, list) { + if (predicate(value, index, list)) { result = value; return true; } @@ -164,61 +179,58 @@ }; // Return all the elements that pass a truth test. - // Delegates to **ECMAScript 5**'s native `filter` if available. // Aliased as `select`. - _.filter = _.select = function(obj, iterator, context) { + _.filter = _.select = function(obj, predicate, context) { var results = []; if (obj == null) return results; - if (nativeFilter && obj.filter === nativeFilter) return obj.filter(iterator, context); - each(obj, function(value, index, list) { - if (iterator.call(context, value, index, list)) results[results.length] = value; + predicate = _.iteratee(predicate, context); + _.each(obj, function(value, index, list) { + if (predicate(value, index, list)) results.push(value); }); return results; }; // Return all the elements for which a truth test fails. - _.reject = function(obj, iterator, context) { - return _.filter(obj, function(value, index, list) { - return !iterator.call(context, value, index, list); - }, context); + _.reject = function(obj, predicate, context) { + return _.filter(obj, _.negate(_.iteratee(predicate)), context); }; // Determine whether all of the elements match a truth test. - // Delegates to **ECMAScript 5**'s native `every` if available. // Aliased as `all`. - _.every = _.all = function(obj, iterator, context) { - iterator || (iterator = _.identity); - var result = true; - if (obj == null) return result; - if (nativeEvery && obj.every === nativeEvery) return obj.every(iterator, context); - each(obj, function(value, index, list) { - if (!(result = result && iterator.call(context, value, index, list))) return breaker; - }); - return !!result; + _.every = _.all = function(obj, predicate, context) { + if (obj == null) return true; + predicate = _.iteratee(predicate, context); + var keys = obj.length !== +obj.length && _.keys(obj), + length = (keys || obj).length, + index, currentKey; + for (index = 0; index < length; index++) { + currentKey = keys ? keys[index] : index; + if (!predicate(obj[currentKey], currentKey, obj)) return false; + } + return true; }; // Determine if at least one element in the object matches a truth test. - // Delegates to **ECMAScript 5**'s native `some` if available. // Aliased as `any`. - var any = _.some = _.any = function(obj, iterator, context) { - iterator || (iterator = _.identity); - var result = false; - if (obj == null) return result; - if (nativeSome && obj.some === nativeSome) return obj.some(iterator, context); - each(obj, function(value, index, list) { - if (result || (result = iterator.call(context, value, index, list))) return breaker; - }); - return !!result; + _.some = _.any = function(obj, predicate, context) { + if (obj == null) return false; + predicate = _.iteratee(predicate, context); + var keys = obj.length !== +obj.length && _.keys(obj), + length = (keys || obj).length, + index, currentKey; + for (index = 0; index < length; index++) { + currentKey = keys ? keys[index] : index; + if (predicate(obj[currentKey], currentKey, obj)) return true; + } + return false; }; // Determine if the array or object contains a given value (using `===`). // Aliased as `include`. _.contains = _.include = function(obj, target) { if (obj == null) return false; - if (nativeIndexOf && obj.indexOf === nativeIndexOf) return obj.indexOf(target) != -1; - return any(obj, function(value) { - return value === target; - }); + if (obj.length !== +obj.length) obj = _.values(obj); + return _.indexOf(obj, target) >= 0; }; // Invoke a method (with arguments) on every item in a collection. @@ -232,83 +244,104 @@ // Convenience version of a common use case of `map`: fetching a property. _.pluck = function(obj, key) { - return _.map(obj, function(value){ return value[key]; }); + return _.map(obj, _.property(key)); }; // Convenience version of a common use case of `filter`: selecting only objects // containing specific `key:value` pairs. - _.where = function(obj, attrs, first) { - if (_.isEmpty(attrs)) return first ? null : []; - return _[first ? 'find' : 'filter'](obj, function(value) { - for (var key in attrs) { - if (attrs[key] !== value[key]) return false; - } - return true; - }); + _.where = function(obj, attrs) { + return _.filter(obj, _.matches(attrs)); }; // Convenience version of a common use case of `find`: getting the first object // containing specific `key:value` pairs. _.findWhere = function(obj, attrs) { - return _.where(obj, attrs, true); - }; - - // Return the maximum element or (element-based computation). - // Can't optimize arrays of integers longer than 65,535 elements. - // See: https://bugs.webkit.org/show_bug.cgi?id=80797 - _.max = function(obj, iterator, context) { - if (!iterator && _.isArray(obj) && obj[0] === +obj[0] && obj.length < 65535) { - return Math.max.apply(Math, obj); + return _.find(obj, _.matches(attrs)); + }; + + // Return the maximum element (or element-based computation). + _.max = function(obj, iteratee, context) { + var result = -Infinity, lastComputed = -Infinity, + value, computed; + if (iteratee == null && obj != null) { + obj = obj.length === +obj.length ? obj : _.values(obj); + for (var i = 0, length = obj.length; i < length; i++) { + value = obj[i]; + if (value > result) { + result = value; + } + } + } else { + iteratee = _.iteratee(iteratee, context); + _.each(obj, function(value, index, list) { + computed = iteratee(value, index, list); + if (computed > lastComputed || computed === -Infinity && result === -Infinity) { + result = value; + lastComputed = computed; + } + }); } - if (!iterator && _.isEmpty(obj)) return -Infinity; - var result = {computed : -Infinity, value: -Infinity}; - each(obj, function(value, index, list) { - var computed = iterator ? iterator.call(context, value, index, list) : value; - computed >= result.computed && (result = {value : value, computed : computed}); - }); - return result.value; + return result; }; // Return the minimum element (or element-based computation). - _.min = function(obj, iterator, context) { - if (!iterator && _.isArray(obj) && obj[0] === +obj[0] && obj.length < 65535) { - return Math.min.apply(Math, obj); + _.min = function(obj, iteratee, context) { + var result = Infinity, lastComputed = Infinity, + value, computed; + if (iteratee == null && obj != null) { + obj = obj.length === +obj.length ? obj : _.values(obj); + for (var i = 0, length = obj.length; i < length; i++) { + value = obj[i]; + if (value < result) { + result = value; + } + } + } else { + iteratee = _.iteratee(iteratee, context); + _.each(obj, function(value, index, list) { + computed = iteratee(value, index, list); + if (computed < lastComputed || computed === Infinity && result === Infinity) { + result = value; + lastComputed = computed; + } + }); } - if (!iterator && _.isEmpty(obj)) return Infinity; - var result = {computed : Infinity, value: Infinity}; - each(obj, function(value, index, list) { - var computed = iterator ? iterator.call(context, value, index, list) : value; - computed < result.computed && (result = {value : value, computed : computed}); - }); - return result.value; + return result; }; - // Shuffle an array. + // Shuffle a collection, using the modern version of the + // [Fisher-Yates shuffle](http://en.wikipedia.org/wiki/Fisher–Yates_shuffle). _.shuffle = function(obj) { - var rand; - var index = 0; - var shuffled = []; - each(obj, function(value) { - rand = _.random(index++); - shuffled[index - 1] = shuffled[rand]; - shuffled[rand] = value; - }); + var set = obj && obj.length === +obj.length ? obj : _.values(obj); + var length = set.length; + var shuffled = Array(length); + for (var index = 0, rand; index < length; index++) { + rand = _.random(0, index); + if (rand !== index) shuffled[index] = shuffled[rand]; + shuffled[rand] = set[index]; + } return shuffled; }; - // An internal function to generate lookup iterators. - var lookupIterator = function(value) { - return _.isFunction(value) ? value : function(obj){ return obj[value]; }; + // Sample **n** random values from a collection. + // If **n** is not specified, returns a single random element. + // The internal `guard` argument allows it to work with `map`. + _.sample = function(obj, n, guard) { + if (n == null || guard) { + if (obj.length !== +obj.length) obj = _.values(obj); + return obj[_.random(obj.length - 1)]; + } + return _.shuffle(obj).slice(0, Math.max(0, n)); }; - // Sort the object's values by a criterion produced by an iterator. - _.sortBy = function(obj, value, context) { - var iterator = lookupIterator(value); + // Sort the object's values by a criterion produced by an iteratee. + _.sortBy = function(obj, iteratee, context) { + iteratee = _.iteratee(iteratee, context); return _.pluck(_.map(obj, function(value, index, list) { return { - value : value, - index : index, - criteria : iterator.call(context, value, index, list) + value: value, + index: index, + criteria: iteratee(value, index, list) }; }).sort(function(left, right) { var a = left.criteria; @@ -317,53 +350,56 @@ if (a > b || a === void 0) return 1; if (a < b || b === void 0) return -1; } - return left.index < right.index ? -1 : 1; + return left.index - right.index; }), 'value'); }; // An internal function used for aggregate "group by" operations. - var group = function(obj, value, context, behavior) { - var result = {}; - var iterator = lookupIterator(value || _.identity); - each(obj, function(value, index) { - var key = iterator.call(context, value, index, obj); - behavior(result, key, value); - }); - return result; + var group = function(behavior) { + return function(obj, iteratee, context) { + var result = {}; + iteratee = _.iteratee(iteratee, context); + _.each(obj, function(value, index) { + var key = iteratee(value, index, obj); + behavior(result, value, key); + }); + return result; + }; }; // Groups the object's values by a criterion. Pass either a string attribute // to group by, or a function that returns the criterion. - _.groupBy = function(obj, value, context) { - return group(obj, value, context, function(result, key, value) { - (_.has(result, key) ? result[key] : (result[key] = [])).push(value); - }); - }; + _.groupBy = group(function(result, value, key) { + if (_.has(result, key)) result[key].push(value); else result[key] = [value]; + }); + + // Indexes the object's values by a criterion, similar to `groupBy`, but for + // when you know that your index values will be unique. + _.indexBy = group(function(result, value, key) { + result[key] = value; + }); // Counts instances of an object that group by a certain criterion. Pass // either a string attribute to count by, or a function that returns the // criterion. - _.countBy = function(obj, value, context) { - return group(obj, value, context, function(result, key) { - if (!_.has(result, key)) result[key] = 0; - result[key]++; - }); - }; + _.countBy = group(function(result, value, key) { + if (_.has(result, key)) result[key]++; else result[key] = 1; + }); // Use a comparator function to figure out the smallest index at which // an object should be inserted so as to maintain order. Uses binary search. - _.sortedIndex = function(array, obj, iterator, context) { - iterator = iterator == null ? _.identity : lookupIterator(iterator); - var value = iterator.call(context, obj); + _.sortedIndex = function(array, obj, iteratee, context) { + iteratee = _.iteratee(iteratee, context, 1); + var value = iteratee(obj); var low = 0, high = array.length; while (low < high) { - var mid = (low + high) >>> 1; - iterator.call(context, array[mid]) < value ? low = mid + 1 : high = mid; + var mid = low + high >>> 1; + if (iteratee(array[mid]) < value) low = mid + 1; else high = mid; } return low; }; - // Safely convert anything iterable into a real, live array. + // Safely create a real, live array from anything iterable. _.toArray = function(obj) { if (!obj) return []; if (_.isArray(obj)) return slice.call(obj); @@ -374,7 +410,18 @@ // Return the number of elements in an object. _.size = function(obj) { if (obj == null) return 0; - return (obj.length === +obj.length) ? obj.length : _.keys(obj).length; + return obj.length === +obj.length ? obj.length : _.keys(obj).length; + }; + + // Split a collection into two arrays: one whose elements all satisfy the given + // predicate, and one whose elements all do not satisfy the predicate. + _.partition = function(obj, predicate, context) { + predicate = _.iteratee(predicate, context); + var pass = [], fail = []; + _.each(obj, function(value, key, obj) { + (predicate(value, key, obj) ? pass : fail).push(value); + }); + return [pass, fail]; }; // Array Functions @@ -385,7 +432,9 @@ // allows it to work with `_.map`. _.first = _.head = _.take = function(array, n, guard) { if (array == null) return void 0; - return (n != null) && !guard ? slice.call(array, 0, n) : array[0]; + if (n == null || guard) return array[0]; + if (n < 0) return []; + return slice.call(array, 0, n); }; // Returns everything but the last entry of the array. Especially useful on @@ -393,18 +442,15 @@ // the array, excluding the last N. The **guard** check allows it to work with // `_.map`. _.initial = function(array, n, guard) { - return slice.call(array, 0, array.length - ((n == null) || guard ? 1 : n)); + return slice.call(array, 0, Math.max(0, array.length - (n == null || guard ? 1 : n))); }; // Get the last element of an array. Passing **n** will return the last N // values in the array. The **guard** check allows it to work with `_.map`. _.last = function(array, n, guard) { if (array == null) return void 0; - if ((n != null) && !guard) { - return slice.call(array, Math.max(array.length - n, 0)); - } else { - return array[array.length - 1]; - } + if (n == null || guard) return array[array.length - 1]; + return slice.call(array, Math.max(array.length - n, 0)); }; // Returns everything but the first entry of the array. Aliased as `tail` and `drop`. @@ -412,7 +458,7 @@ // the rest N values in the array. The **guard** // check allows it to work with `_.map`. _.rest = _.tail = _.drop = function(array, n, guard) { - return slice.call(array, (n == null) || guard ? 1 : n); + return slice.call(array, n == null || guard ? 1 : n); }; // Trim out all falsy values from an array. @@ -421,20 +467,26 @@ }; // Internal implementation of a recursive `flatten` function. - var flatten = function(input, shallow, output) { - each(input, function(value) { - if (_.isArray(value)) { - shallow ? push.apply(output, value) : flatten(value, shallow, output); + var flatten = function(input, shallow, strict, output) { + if (shallow && _.every(input, _.isArray)) { + return concat.apply(output, input); + } + for (var i = 0, length = input.length; i < length; i++) { + var value = input[i]; + if (!_.isArray(value) && !_.isArguments(value)) { + if (!strict) output.push(value); + } else if (shallow) { + push.apply(output, value); } else { - output.push(value); + flatten(value, shallow, strict, output); } - }); + } return output; }; - // Return a completely flattened version of an array. + // Flatten out an array, either recursively (by default), or just one level. _.flatten = function(array, shallow) { - return flatten(array, shallow, []); + return flatten(array, shallow, false, []); }; // Return a version of the array that does not contain the specified value(s). @@ -445,56 +497,74 @@ // Produce a duplicate-free version of the array. If the array has already // been sorted, you have the option of using a faster algorithm. // Aliased as `unique`. - _.uniq = _.unique = function(array, isSorted, iterator, context) { - if (_.isFunction(isSorted)) { - context = iterator; - iterator = isSorted; + _.uniq = _.unique = function(array, isSorted, iteratee, context) { + if (array == null) return []; + if (!_.isBoolean(isSorted)) { + context = iteratee; + iteratee = isSorted; isSorted = false; } - var initial = iterator ? _.map(array, iterator, context) : array; - var results = []; + if (iteratee != null) iteratee = _.iteratee(iteratee, context); + var result = []; var seen = []; - each(initial, function(value, index) { - if (isSorted ? (!index || seen[seen.length - 1] !== value) : !_.contains(seen, value)) { - seen.push(value); - results.push(array[index]); + for (var i = 0, length = array.length; i < length; i++) { + var value = array[i]; + if (isSorted) { + if (!i || seen !== value) result.push(value); + seen = value; + } else if (iteratee) { + var computed = iteratee(value, i, array); + if (_.indexOf(seen, computed) < 0) { + seen.push(computed); + result.push(value); + } + } else if (_.indexOf(result, value) < 0) { + result.push(value); } - }); - return results; + } + return result; }; // Produce an array that contains the union: each distinct element from all of // the passed-in arrays. _.union = function() { - return _.uniq(concat.apply(ArrayProto, arguments)); + return _.uniq(flatten(arguments, true, true, [])); }; // Produce an array that contains every item shared between all the // passed-in arrays. _.intersection = function(array) { - var rest = slice.call(arguments, 1); - return _.filter(_.uniq(array), function(item) { - return _.every(rest, function(other) { - return _.indexOf(other, item) >= 0; - }); - }); + if (array == null) return []; + var result = []; + var argsLength = arguments.length; + for (var i = 0, length = array.length; i < length; i++) { + var item = array[i]; + if (_.contains(result, item)) continue; + for (var j = 1; j < argsLength; j++) { + if (!_.contains(arguments[j], item)) break; + } + if (j === argsLength) result.push(item); + } + return result; }; // Take the difference between one array and a number of other arrays. // Only the elements present in just the first array will remain. _.difference = function(array) { - var rest = concat.apply(ArrayProto, slice.call(arguments, 1)); - return _.filter(array, function(value){ return !_.contains(rest, value); }); + var rest = flatten(slice.call(arguments, 1), true, true, []); + return _.filter(array, function(value){ + return !_.contains(rest, value); + }); }; // Zip together multiple lists into a single array -- elements that share // an index go together. - _.zip = function() { - var args = slice.call(arguments); - var length = _.max(_.pluck(args, 'length')); - var results = new Array(length); + _.zip = function(array) { + if (array == null) return []; + var length = _.max(arguments, 'length').length; + var results = Array(length); for (var i = 0; i < length; i++) { - results[i] = _.pluck(args, "" + i); + results[i] = _.pluck(arguments, i); } return results; }; @@ -505,7 +575,7 @@ _.object = function(list, values) { if (list == null) return {}; var result = {}; - for (var i = 0, l = list.length; i < l; i++) { + for (var i = 0, length = list.length; i < length; i++) { if (values) { result[list[i]] = values[i]; } else { @@ -515,37 +585,32 @@ return result; }; - // If the browser doesn't supply us with indexOf (I'm looking at you, **MSIE**), - // we need this function. Return the position of the first occurrence of an - // item in an array, or -1 if the item is not included in the array. - // Delegates to **ECMAScript 5**'s native `indexOf` if available. + // Return the position of the first occurrence of an item in an array, + // or -1 if the item is not included in the array. // If the array is large and already in sort order, pass `true` // for **isSorted** to use binary search. _.indexOf = function(array, item, isSorted) { if (array == null) return -1; - var i = 0, l = array.length; + var i = 0, length = array.length; if (isSorted) { if (typeof isSorted == 'number') { - i = (isSorted < 0 ? Math.max(0, l + isSorted) : isSorted); + i = isSorted < 0 ? Math.max(0, length + isSorted) : isSorted; } else { i = _.sortedIndex(array, item); return array[i] === item ? i : -1; } } - if (nativeIndexOf && array.indexOf === nativeIndexOf) return array.indexOf(item, isSorted); - for (; i < l; i++) if (array[i] === item) return i; + for (; i < length; i++) if (array[i] === item) return i; return -1; }; - // Delegates to **ECMAScript 5**'s native `lastIndexOf` if available. _.lastIndexOf = function(array, item, from) { if (array == null) return -1; - var hasIndex = from != null; - if (nativeLastIndexOf && array.lastIndexOf === nativeLastIndexOf) { - return hasIndex ? array.lastIndexOf(item, from) : array.lastIndexOf(item); + var idx = array.length; + if (typeof from == 'number') { + idx = from < 0 ? idx + from + 1 : Math.min(idx, from + 1); } - var i = (hasIndex ? from : array.length); - while (i--) if (array[i] === item) return i; + while (--idx >= 0) if (array[idx] === item) return idx; return -1; }; @@ -557,15 +622,13 @@ stop = start || 0; start = 0; } - step = arguments[2] || 1; + step = step || 1; - var len = Math.max(Math.ceil((stop - start) / step), 0); - var idx = 0; - var range = new Array(len); + var length = Math.max(Math.ceil((stop - start) / step), 0); + var range = Array(length); - while(idx < len) { - range[idx++] = start; - start += step; + for (var idx = 0; idx < length; idx++, start += step) { + range[idx] = start; } return range; @@ -574,50 +637,77 @@ // Function (ahem) Functions // ------------------ + // Reusable constructor function for prototype setting. + var Ctor = function(){}; + // Create a function bound to a given object (assigning `this`, and arguments, // optionally). Delegates to **ECMAScript 5**'s native `Function.bind` if // available. _.bind = function(func, context) { - if (func.bind === nativeBind && nativeBind) return nativeBind.apply(func, slice.call(arguments, 1)); - var args = slice.call(arguments, 2); - return function() { - return func.apply(context, args.concat(slice.call(arguments))); + var args, bound; + if (nativeBind && func.bind === nativeBind) return nativeBind.apply(func, slice.call(arguments, 1)); + if (!_.isFunction(func)) throw new TypeError('Bind must be called on a function'); + args = slice.call(arguments, 2); + bound = function() { + if (!(this instanceof bound)) return func.apply(context, args.concat(slice.call(arguments))); + Ctor.prototype = func.prototype; + var self = new Ctor; + Ctor.prototype = null; + var result = func.apply(self, args.concat(slice.call(arguments))); + if (_.isObject(result)) return result; + return self; }; + return bound; }; // Partially apply a function by creating a version that has had some of its - // arguments pre-filled, without changing its dynamic `this` context. + // arguments pre-filled, without changing its dynamic `this` context. _ acts + // as a placeholder, allowing any combination of arguments to be pre-filled. _.partial = function(func) { - var args = slice.call(arguments, 1); + var boundArgs = slice.call(arguments, 1); return function() { - return func.apply(this, args.concat(slice.call(arguments))); + var position = 0; + var args = boundArgs.slice(); + for (var i = 0, length = args.length; i < length; i++) { + if (args[i] === _) args[i] = arguments[position++]; + } + while (position < arguments.length) args.push(arguments[position++]); + return func.apply(this, args); }; }; - // Bind all of an object's methods to that object. Useful for ensuring that - // all callbacks defined on an object belong to it. + // Bind a number of an object's methods to that object. Remaining arguments + // are the method names to be bound. Useful for ensuring that all callbacks + // defined on an object belong to it. _.bindAll = function(obj) { - var funcs = slice.call(arguments, 1); - if (funcs.length === 0) funcs = _.functions(obj); - each(funcs, function(f) { obj[f] = _.bind(obj[f], obj); }); + var i, length = arguments.length, key; + if (length <= 1) throw new Error('bindAll must be passed function names'); + for (i = 1; i < length; i++) { + key = arguments[i]; + obj[key] = _.bind(obj[key], obj); + } return obj; }; // Memoize an expensive function by storing its results. _.memoize = function(func, hasher) { - var memo = {}; - hasher || (hasher = _.identity); - return function() { - var key = hasher.apply(this, arguments); - return _.has(memo, key) ? memo[key] : (memo[key] = func.apply(this, arguments)); + var memoize = function(key) { + var cache = memoize.cache; + var address = hasher ? hasher.apply(this, arguments) : key; + if (!_.has(cache, address)) cache[address] = func.apply(this, arguments); + return cache[address]; }; + memoize.cache = {}; + return memoize; }; // Delays a function for the given number of milliseconds, and then calls // it with the arguments supplied. _.delay = function(func, wait) { var args = slice.call(arguments, 2); - return setTimeout(function(){ return func.apply(null, args); }, wait); + return setTimeout(function(){ + return func.apply(null, args); + }, wait); }; // Defers a function, scheduling it to run after the current call stack has @@ -627,26 +717,34 @@ }; // Returns a function, that, when invoked, will only be triggered at most once - // during a given window of time. - _.throttle = function(func, wait) { - var context, args, timeout, result; + // during a given window of time. Normally, the throttled function will run + // as much as it can, without ever going more than once per `wait` duration; + // but if you'd like to disable the execution on the leading edge, pass + // `{leading: false}`. To disable execution on the trailing edge, ditto. + _.throttle = function(func, wait, options) { + var context, args, result; + var timeout = null; var previous = 0; + if (!options) options = {}; var later = function() { - previous = new Date; + previous = options.leading === false ? 0 : _.now(); timeout = null; result = func.apply(context, args); + if (!timeout) context = args = null; }; return function() { - var now = new Date; + var now = _.now(); + if (!previous && options.leading === false) previous = now; var remaining = wait - (now - previous); context = this; args = arguments; - if (remaining <= 0) { + if (remaining <= 0 || remaining > wait) { clearTimeout(timeout); timeout = null; previous = now; result = func.apply(context, args); - } else if (!timeout) { + if (!timeout) context = args = null; + } else if (!timeout && options.trailing !== false) { timeout = setTimeout(later, remaining); } return result; @@ -658,31 +756,34 @@ // N milliseconds. If `immediate` is passed, trigger the function on the // leading edge, instead of the trailing. _.debounce = function(func, wait, immediate) { - var timeout, result; - return function() { - var context = this, args = arguments; - var later = function() { + var timeout, args, context, timestamp, result; + + var later = function() { + var last = _.now() - timestamp; + + if (last < wait && last > 0) { + timeout = setTimeout(later, wait - last); + } else { timeout = null; - if (!immediate) result = func.apply(context, args); - }; - var callNow = immediate && !timeout; - clearTimeout(timeout); - timeout = setTimeout(later, wait); - if (callNow) result = func.apply(context, args); - return result; + if (!immediate) { + result = func.apply(context, args); + if (!timeout) context = args = null; + } + } }; - }; - // Returns a function that will be executed at most one time, no matter how - // often you call it. Useful for lazy initialization. - _.once = function(func) { - var ran = false, memo; return function() { - if (ran) return memo; - ran = true; - memo = func.apply(this, arguments); - func = null; - return memo; + context = this; + args = arguments; + timestamp = _.now(); + var callNow = immediate && !timeout; + if (!timeout) timeout = setTimeout(later, wait); + if (callNow) { + result = func.apply(context, args); + context = args = null; + } + + return result; }; }; @@ -690,29 +791,31 @@ // allowing you to adjust arguments, run code before and after, and // conditionally execute the original function. _.wrap = function(func, wrapper) { + return _.partial(wrapper, func); + }; + + // Returns a negated version of the passed-in predicate. + _.negate = function(predicate) { return function() { - var args = [func]; - push.apply(args, arguments); - return wrapper.apply(this, args); + return !predicate.apply(this, arguments); }; }; // Returns a function that is the composition of a list of functions, each // consuming the return value of the function that follows. _.compose = function() { - var funcs = arguments; + var args = arguments; + var start = args.length - 1; return function() { - var args = arguments; - for (var i = funcs.length - 1; i >= 0; i--) { - args = [funcs[i].apply(this, args)]; - } - return args[0]; + var i = start; + var result = args[start].apply(this, arguments); + while (i--) result = args[i].call(this, result); + return result; }; }; // Returns a function that will only be executed after being called N times. _.after = function(times, func) { - if (times <= 0) return func(); return function() { if (--times < 1) { return func.apply(this, arguments); @@ -720,36 +823,65 @@ }; }; + // Returns a function that will only be executed before being called N times. + _.before = function(times, func) { + var memo; + return function() { + if (--times > 0) { + memo = func.apply(this, arguments); + } else { + func = null; + } + return memo; + }; + }; + + // Returns a function that will be executed at most one time, no matter how + // often you call it. Useful for lazy initialization. + _.once = _.partial(_.before, 2); + // Object Functions // ---------------- // Retrieve the names of an object's properties. // Delegates to **ECMAScript 5**'s native `Object.keys` - _.keys = nativeKeys || function(obj) { - if (obj !== Object(obj)) throw new TypeError('Invalid object'); + _.keys = function(obj) { + if (!_.isObject(obj)) return []; + if (nativeKeys) return nativeKeys(obj); var keys = []; - for (var key in obj) if (_.has(obj, key)) keys[keys.length] = key; + for (var key in obj) if (_.has(obj, key)) keys.push(key); return keys; }; // Retrieve the values of an object's properties. _.values = function(obj) { - var values = []; - for (var key in obj) if (_.has(obj, key)) values.push(obj[key]); + var keys = _.keys(obj); + var length = keys.length; + var values = Array(length); + for (var i = 0; i < length; i++) { + values[i] = obj[keys[i]]; + } return values; }; // Convert an object into a list of `[key, value]` pairs. _.pairs = function(obj) { - var pairs = []; - for (var key in obj) if (_.has(obj, key)) pairs.push([key, obj[key]]); + var keys = _.keys(obj); + var length = keys.length; + var pairs = Array(length); + for (var i = 0; i < length; i++) { + pairs[i] = [keys[i], obj[keys[i]]]; + } return pairs; }; // Invert the keys and values of an object. The values must be serializable. _.invert = function(obj) { var result = {}; - for (var key in obj) if (_.has(obj, key)) result[obj[key]] = key; + var keys = _.keys(obj); + for (var i = 0, length = keys.length; i < length; i++) { + result[obj[keys[i]]] = keys[i]; + } return result; }; @@ -765,45 +897,62 @@ // Extend a given object with all the properties in passed-in object(s). _.extend = function(obj) { - each(slice.call(arguments, 1), function(source) { - if (source) { - for (var prop in source) { - obj[prop] = source[prop]; + if (!_.isObject(obj)) return obj; + var source, prop; + for (var i = 1, length = arguments.length; i < length; i++) { + source = arguments[i]; + for (prop in source) { + if (hasOwnProperty.call(source, prop)) { + obj[prop] = source[prop]; } } - }); + } return obj; }; // Return a copy of the object only containing the whitelisted properties. - _.pick = function(obj) { - var copy = {}; - var keys = concat.apply(ArrayProto, slice.call(arguments, 1)); - each(keys, function(key) { - if (key in obj) copy[key] = obj[key]; - }); - return copy; + _.pick = function(obj, iteratee, context) { + var result = {}, key; + if (obj == null) return result; + if (_.isFunction(iteratee)) { + iteratee = createCallback(iteratee, context); + for (key in obj) { + var value = obj[key]; + if (iteratee(value, key, obj)) result[key] = value; + } + } else { + var keys = concat.apply([], slice.call(arguments, 1)); + obj = new Object(obj); + for (var i = 0, length = keys.length; i < length; i++) { + key = keys[i]; + if (key in obj) result[key] = obj[key]; + } + } + return result; }; // Return a copy of the object without the blacklisted properties. - _.omit = function(obj) { - var copy = {}; - var keys = concat.apply(ArrayProto, slice.call(arguments, 1)); - for (var key in obj) { - if (!_.contains(keys, key)) copy[key] = obj[key]; + _.omit = function(obj, iteratee, context) { + if (_.isFunction(iteratee)) { + iteratee = _.negate(iteratee); + } else { + var keys = _.map(concat.apply([], slice.call(arguments, 1)), String); + iteratee = function(value, key) { + return !_.contains(keys, key); + }; } - return copy; + return _.pick(obj, iteratee, context); }; // Fill in a given object with default properties. _.defaults = function(obj) { - each(slice.call(arguments, 1), function(source) { - if (source) { - for (var prop in source) { - if (obj[prop] == null) obj[prop] = source[prop]; - } + if (!_.isObject(obj)) return obj; + for (var i = 1, length = arguments.length; i < length; i++) { + var source = arguments[i]; + for (var prop in source) { + if (obj[prop] === void 0) obj[prop] = source[prop]; } - }); + } return obj; }; @@ -824,8 +973,8 @@ // Internal recursive comparison function for `isEqual`. var eq = function(a, b, aStack, bStack) { // Identical objects are equal. `0 === -0`, but they aren't identical. - // See the Harmony `egal` proposal: http://wiki.ecmascript.org/doku.php?id=harmony:egal. - if (a === b) return a !== 0 || 1 / a == 1 / b; + // See the [Harmony `egal` proposal](http://wiki.ecmascript.org/doku.php?id=harmony:egal). + if (a === b) return a !== 0 || 1 / a === 1 / b; // A strict comparison is necessary because `null == undefined`. if (a == null || b == null) return a === b; // Unwrap any wrapped objects. @@ -833,29 +982,27 @@ if (b instanceof _) b = b._wrapped; // Compare `[[Class]]` names. var className = toString.call(a); - if (className != toString.call(b)) return false; + if (className !== toString.call(b)) return false; switch (className) { - // Strings, numbers, dates, and booleans are compared by value. + // Strings, numbers, regular expressions, dates, and booleans are compared by value. + case '[object RegExp]': + // RegExps are coerced to strings for comparison (Note: '' + /a/i === '/a/i') case '[object String]': // Primitives and their corresponding object wrappers are equivalent; thus, `"5"` is // equivalent to `new String("5")`. - return a == String(b); + return '' + a === '' + b; case '[object Number]': - // `NaN`s are equivalent, but non-reflexive. An `egal` comparison is performed for - // other numeric values. - return a != +a ? b != +b : (a == 0 ? 1 / a == 1 / b : a == +b); + // `NaN`s are equivalent, but non-reflexive. + // Object(NaN) is equivalent to NaN + if (+a !== +a) return +b !== +b; + // An `egal` comparison is performed for other numeric values. + return +a === 0 ? 1 / +a === 1 / b : +a === +b; case '[object Date]': case '[object Boolean]': // Coerce dates and booleans to numeric primitive values. Dates are compared by their // millisecond representations. Note that invalid dates with millisecond representations // of `NaN` are not equivalent. - return +a == +b; - // RegExps are compared by their source patterns and flags. - case '[object RegExp]': - return a.source == b.source && - a.global == b.global && - a.multiline == b.multiline && - a.ignoreCase == b.ignoreCase; + return +a === +b; } if (typeof a != 'object' || typeof b != 'object') return false; // Assume equality for cyclic structures. The algorithm for detecting cyclic @@ -864,17 +1011,29 @@ while (length--) { // Linear search. Performance is inversely proportional to the number of // unique nested structures. - if (aStack[length] == a) return bStack[length] == b; + if (aStack[length] === a) return bStack[length] === b; + } + // Objects with different constructors are not equivalent, but `Object`s + // from different frames are. + var aCtor = a.constructor, bCtor = b.constructor; + if ( + aCtor !== bCtor && + // Handle Object.create(x) cases + 'constructor' in a && 'constructor' in b && + !(_.isFunction(aCtor) && aCtor instanceof aCtor && + _.isFunction(bCtor) && bCtor instanceof bCtor) + ) { + return false; } // Add the first object to the stack of traversed objects. aStack.push(a); bStack.push(b); - var size = 0, result = true; + var size, result; // Recursively compare objects and arrays. - if (className == '[object Array]') { + if (className === '[object Array]') { // Compare array lengths to determine if a deep comparison is necessary. size = a.length; - result = size == b.length; + result = size === b.length; if (result) { // Deep compare the contents, ignoring non-numeric properties. while (size--) { @@ -882,28 +1041,17 @@ } } } else { - // Objects with different constructors are not equivalent, but `Object`s - // from different frames are. - var aCtor = a.constructor, bCtor = b.constructor; - if (aCtor !== bCtor && !(_.isFunction(aCtor) && (aCtor instanceof aCtor) && - _.isFunction(bCtor) && (bCtor instanceof bCtor))) { - return false; - } // Deep compare objects. - for (var key in a) { - if (_.has(a, key)) { - // Count the expected number of properties. - size++; - // Deep compare each member. - if (!(result = _.has(b, key) && eq(a[key], b[key], aStack, bStack))) break; - } - } - // Ensure that both objects contain the same number of properties. + var keys = _.keys(a), key; + size = keys.length; + // Ensure that both objects contain the same number of properties before comparing deep equality. + result = _.keys(b).length === size; if (result) { - for (key in b) { - if (_.has(b, key) && !(size--)) break; + while (size--) { + // Deep compare each member + key = keys[size]; + if (!(result = _.has(b, key) && eq(a[key], b[key], aStack, bStack))) break; } - result = !size; } } // Remove the first object from the stack of traversed objects. @@ -921,7 +1069,7 @@ // An "empty" object has no enumerable own-properties. _.isEmpty = function(obj) { if (obj == null) return true; - if (_.isArray(obj) || _.isString(obj)) return obj.length === 0; + if (_.isArray(obj) || _.isString(obj) || _.isArguments(obj)) return obj.length === 0; for (var key in obj) if (_.has(obj, key)) return false; return true; }; @@ -934,18 +1082,19 @@ // Is a given value an array? // Delegates to ECMA5's native Array.isArray _.isArray = nativeIsArray || function(obj) { - return toString.call(obj) == '[object Array]'; + return toString.call(obj) === '[object Array]'; }; // Is a given variable an object? _.isObject = function(obj) { - return obj === Object(obj); + var type = typeof obj; + return type === 'function' || type === 'object' && !!obj; }; // Add some isType methods: isArguments, isFunction, isString, isNumber, isDate, isRegExp. - each(['Arguments', 'Function', 'String', 'Number', 'Date', 'RegExp'], function(name) { + _.each(['Arguments', 'Function', 'String', 'Number', 'Date', 'RegExp'], function(name) { _['is' + name] = function(obj) { - return toString.call(obj) == '[object ' + name + ']'; + return toString.call(obj) === '[object ' + name + ']'; }; }); @@ -953,14 +1102,14 @@ // there isn't any inspectable "Arguments" type. if (!_.isArguments(arguments)) { _.isArguments = function(obj) { - return !!(obj && _.has(obj, 'callee')); + return _.has(obj, 'callee'); }; } - // Optimize `isFunction` if appropriate. - if (typeof (/./) !== 'function') { + // Optimize `isFunction` if appropriate. Work around an IE 11 bug. + if (typeof /./ !== 'function') { _.isFunction = function(obj) { - return typeof obj === 'function'; + return typeof obj == 'function' || false; }; } @@ -971,12 +1120,12 @@ // Is the given value `NaN`? (NaN is the only number which does not equal itself). _.isNaN = function(obj) { - return _.isNumber(obj) && obj != +obj; + return _.isNumber(obj) && obj !== +obj; }; // Is a given value a boolean? _.isBoolean = function(obj) { - return obj === true || obj === false || toString.call(obj) == '[object Boolean]'; + return obj === true || obj === false || toString.call(obj) === '[object Boolean]'; }; // Is a given value equal to null? @@ -992,7 +1141,7 @@ // Shortcut function for checking if an object has a given property directly // on itself (in other words, not on a prototype). _.has = function(obj, key) { - return hasOwnProperty.call(obj, key); + return obj != null && hasOwnProperty.call(obj, key); }; // Utility Functions @@ -1005,15 +1154,44 @@ return this; }; - // Keep the identity function around for default iterators. + // Keep the identity function around for default iteratees. _.identity = function(value) { return value; }; + _.constant = function(value) { + return function() { + return value; + }; + }; + + _.noop = function(){}; + + _.property = function(key) { + return function(obj) { + return obj[key]; + }; + }; + + // Returns a predicate for checking whether an object has a given set of `key:value` pairs. + _.matches = function(attrs) { + var pairs = _.pairs(attrs), length = pairs.length; + return function(obj) { + if (obj == null) return !length; + obj = new Object(obj); + for (var i = 0; i < length; i++) { + var pair = pairs[i], key = pair[0]; + if (pair[1] !== obj[key] || !(key in obj)) return false; + } + return true; + }; + }; + // Run a function **n** times. - _.times = function(n, iterator, context) { - var accum = Array(n); - for (var i = 0; i < n; i++) accum[i] = iterator.call(context, i); + _.times = function(n, iteratee, context) { + var accum = Array(Math.max(0, n)); + iteratee = createCallback(iteratee, context, 1); + for (var i = 0; i < n; i++) accum[i] = iteratee(i); return accum; }; @@ -1026,53 +1204,45 @@ return min + Math.floor(Math.random() * (max - min + 1)); }; - // List of HTML entities for escaping. - var entityMap = { - escape: { - '&': '&', - '<': '<', - '>': '>', - '"': '"', - "'": ''', - '/': '/' - } + // A (possibly faster) way to get the current timestamp as an integer. + _.now = Date.now || function() { + return new Date().getTime(); }; - entityMap.unescape = _.invert(entityMap.escape); - // Regexes containing the keys and values listed immediately above. - var entityRegexes = { - escape: new RegExp('[' + _.keys(entityMap.escape).join('') + ']', 'g'), - unescape: new RegExp('(' + _.keys(entityMap.unescape).join('|') + ')', 'g') + // List of HTML entities for escaping. + var escapeMap = { + '&': '&', + '<': '<', + '>': '>', + '"': '"', + "'": ''', + '`': '`' }; + var unescapeMap = _.invert(escapeMap); // Functions for escaping and unescaping strings to/from HTML interpolation. - _.each(['escape', 'unescape'], function(method) { - _[method] = function(string) { - if (string == null) return ''; - return ('' + string).replace(entityRegexes[method], function(match) { - return entityMap[method][match]; - }); + var createEscaper = function(map) { + var escaper = function(match) { + return map[match]; }; - }); + // Regexes for identifying a key that needs to be escaped + var source = '(?:' + _.keys(map).join('|') + ')'; + var testRegexp = RegExp(source); + var replaceRegexp = RegExp(source, 'g'); + return function(string) { + string = string == null ? '' : '' + string; + return testRegexp.test(string) ? string.replace(replaceRegexp, escaper) : string; + }; + }; + _.escape = createEscaper(escapeMap); + _.unescape = createEscaper(unescapeMap); - // If the value of the named property is a function then invoke it; - // otherwise, return it. + // If the value of the named `property` is a function then invoke it with the + // `object` as context; otherwise, return it. _.result = function(object, property) { - if (object == null) return null; + if (object == null) return void 0; var value = object[property]; - return _.isFunction(value) ? value.call(object) : value; - }; - - // Add your own custom functions to the Underscore object. - _.mixin = function(obj) { - each(_.functions(obj), function(name){ - var func = _[name] = obj[name]; - _.prototype[name] = function() { - var args = [this._wrapped]; - push.apply(args, arguments); - return result.call(this, func.apply(_, args)); - }; - }); + return _.isFunction(value) ? object[property]() : value; }; // Generate a unique integer id (unique within the entire client session). @@ -1103,22 +1273,26 @@ '\\': '\\', '\r': 'r', '\n': 'n', - '\t': 't', '\u2028': 'u2028', '\u2029': 'u2029' }; - var escaper = /\\|'|\r|\n|\t|\u2028|\u2029/g; + var escaper = /\\|'|\r|\n|\u2028|\u2029/g; + + var escapeChar = function(match) { + return '\\' + escapes[match]; + }; // JavaScript micro-templating, similar to John Resig's implementation. // Underscore templating handles arbitrary delimiters, preserves whitespace, // and correctly escapes quotes within interpolated code. - _.template = function(text, data, settings) { - var render; + // NB: `oldSettings` only exists for backwards compatibility. + _.template = function(text, settings, oldSettings) { + if (!settings && oldSettings) settings = oldSettings; settings = _.defaults({}, settings, _.templateSettings); // Combine delimiters into one regular expression via alternation. - var matcher = new RegExp([ + var matcher = RegExp([ (settings.escape || noMatch).source, (settings.interpolate || noMatch).source, (settings.evaluate || noMatch).source @@ -1128,19 +1302,18 @@ var index = 0; var source = "__p+='"; text.replace(matcher, function(match, escape, interpolate, evaluate, offset) { - source += text.slice(index, offset) - .replace(escaper, function(match) { return '\\' + escapes[match]; }); + source += text.slice(index, offset).replace(escaper, escapeChar); + index = offset + match.length; if (escape) { source += "'+\n((__t=(" + escape + "))==null?'':_.escape(__t))+\n'"; - } - if (interpolate) { + } else if (interpolate) { source += "'+\n((__t=(" + interpolate + "))==null?'':__t)+\n'"; - } - if (evaluate) { + } else if (evaluate) { source += "';\n" + evaluate + "\n__p+='"; } - index = offset + match.length; + + // Adobe VMs need the match returned to produce the correct offest. return match; }); source += "';\n"; @@ -1150,29 +1323,31 @@ source = "var __t,__p='',__j=Array.prototype.join," + "print=function(){__p+=__j.call(arguments,'');};\n" + - source + "return __p;\n"; + source + 'return __p;\n'; try { - render = new Function(settings.variable || 'obj', '_', source); + var render = new Function(settings.variable || 'obj', '_', source); } catch (e) { e.source = source; throw e; } - if (data) return render(data, _); var template = function(data) { return render.call(this, data, _); }; - // Provide the compiled function source as a convenience for precompilation. - template.source = 'function(' + (settings.variable || 'obj') + '){\n' + source + '}'; + // Provide the compiled source as a convenience for precompilation. + var argument = settings.variable || 'obj'; + template.source = 'function(' + argument + '){\n' + source + '}'; return template; }; - // Add a "chain" function, which will delegate to the wrapper. + // Add a "chain" function. Start chaining a wrapped Underscore object. _.chain = function(obj) { - return _(obj).chain(); + var instance = _(obj); + instance._chain = true; + return instance; }; // OOP @@ -1186,41 +1361,55 @@ return this._chain ? _(obj).chain() : obj; }; + // Add your own custom functions to the Underscore object. + _.mixin = function(obj) { + _.each(_.functions(obj), function(name) { + var func = _[name] = obj[name]; + _.prototype[name] = function() { + var args = [this._wrapped]; + push.apply(args, arguments); + return result.call(this, func.apply(_, args)); + }; + }); + }; + // Add all of the Underscore functions to the wrapper object. _.mixin(_); // Add all mutator Array functions to the wrapper. - each(['pop', 'push', 'reverse', 'shift', 'sort', 'splice', 'unshift'], function(name) { + _.each(['pop', 'push', 'reverse', 'shift', 'sort', 'splice', 'unshift'], function(name) { var method = ArrayProto[name]; _.prototype[name] = function() { var obj = this._wrapped; method.apply(obj, arguments); - if ((name == 'shift' || name == 'splice') && obj.length === 0) delete obj[0]; + if ((name === 'shift' || name === 'splice') && obj.length === 0) delete obj[0]; return result.call(this, obj); }; }); // Add all accessor Array functions to the wrapper. - each(['concat', 'join', 'slice'], function(name) { + _.each(['concat', 'join', 'slice'], function(name) { var method = ArrayProto[name]; _.prototype[name] = function() { return result.call(this, method.apply(this._wrapped, arguments)); }; }); - _.extend(_.prototype, { - - // Start chaining a wrapped Underscore object. - chain: function() { - this._chain = true; - return this; - }, - - // Extracts the result from a wrapped and chained object. - value: function() { - return this._wrapped; - } - - }); - -}).call(this); + // Extracts the result from a wrapped and chained object. + _.prototype.value = function() { + return this._wrapped; + }; + + // AMD registration happens at the end for compatibility with AMD loaders + // that may not enforce next-turn semantics on modules. Even though general + // practice for AMD registration is to be anonymous, underscore registers + // as a named module because, like jQuery, it is a base library that is + // popular enough to be bundled in a third party lib, but not be part of + // an AMD load request. Those cases could generate an error when an + // anonymous define() is called outside of a loader request. + if (typeof define === 'function' && define.amd) { + define('underscore', [], function() { + return _; + }); + } +}.call(this)); diff --git a/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/package.json b/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/package.json index 19c13e2..4b31d43 100644 --- a/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/package.json +++ b/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/package.json @@ -1,7 +1,7 @@ { "name": "argparse", "description": "Very powerful CLI arguments parser. Native port of argparse - python's options parsing library", - "version": "0.1.15", + "version": "0.1.16", "keywords": [ "cli", "parser", @@ -21,10 +21,7 @@ "bugs": { "url": "https://github.com/nodeca/argparse/issues" }, - "license": { - "type": "MIT", - "url": "https://github.com/nodeca/argparse/blob/master/LICENSE" - }, + "license": "MIT", "repository": { "type": "git", "url": "git://github.com/nodeca/argparse.git" @@ -34,25 +31,17 @@ "test": "make test" }, "dependencies": { - "underscore": "~1.4.3", - "underscore.string": "~2.3.1" + "underscore": "~1.7.0", + "underscore.string": "~2.4.0" }, "devDependencies": { "mocha": "*" }, - "engines": { - "node": ">= 0.6.0" - }, - "readme": "argparse\n========\n\n[![Build Status](https://secure.travis-ci.org/nodeca/argparse.png?branch=master)](http://travis-ci.org/nodeca/argparse)\n\nCLI arguments parser for node.js. Javascript port of python's\n[argparse](http://docs.python.org/dev/library/argparse.html) module\n(original version 3.2). That's a full port, except some very rare options,\nrecorded in issue tracker.\n\n**NB.** Method names changed to camelCase. See [generated docs](http://nodeca.github.com/argparse/).\n\n\nExample\n=======\n\ntest.js file:\n\n```javascript\n#!/usr/bin/env node\n'use strict';\n\nvar ArgumentParser = require('../lib/argparse').ArgumentParser;\nvar parser = new ArgumentParser({\n version: '0.0.1',\n addHelp:true,\n description: 'Argparse example'\n});\nparser.addArgument(\n [ '-f', '--foo' ],\n {\n help: 'foo bar'\n }\n);\nparser.addArgument(\n [ '-b', '--bar' ],\n {\n help: 'bar foo'\n }\n);\nvar args = parser.parseArgs();\nconsole.dir(args);\n```\n\nDisplay help:\n\n```\n$ ./test.js -h\nusage: example.js [-h] [-v] [-f FOO] [-b BAR]\n\nArgparse example\n\nOptional arguments:\n -h, --help Show this help message and exit.\n -v, --version Show program's version number and exit.\n -f FOO, --foo FOO foo bar\n -b BAR, --bar BAR bar foo\n```\n\nParse arguments:\n\n```\n$ ./test.js -f=3 --bar=4\n{ foo: '3', bar: '4' }\n```\n\nMore [examples](https://github.com/nodeca/argparse/tree/master/examples).\n\n\nArgumentParser objects\n======================\n\n```\nnew ArgumentParser({paramters hash});\n```\n\nCreates a new ArgumentParser object.\n\n**Supported params:**\n\n- ```description``` - Text to display before the argument help.\n- ```epilog``` - Text to display after the argument help.\n- ```addHelp``` - Add a -h/–help option to the parser. (default: True)\n- ```argumentDefault``` - Set the global default value for arguments. (default: None)\n- ```parents``` - A list of ArgumentParser objects whose arguments should also be included.\n- ```prefixChars``` - The set of characters that prefix optional arguments. (default: ‘-‘)\n- ```formatterClass``` - A class for customizing the help output.\n- ```prog``` - The name of the program (default: sys.argv[0])\n- ```usage``` - The string describing the program usage (default: generated)\n- ```conflictHandler``` - Usually unnecessary, defines strategy for resolving conflicting optionals.\n\n**Not supportied yet**\n\n- ```fromfilePrefixChars``` - The set of characters that prefix files from which additional arguments should be read.\n\n\nDetails in [original ArgumentParser guide](http://docs.python.org/dev/library/argparse.html#argumentparser-objects)\n\n\naddArgument() method\n====================\n\n```\nArgumentParser.addArgument([names or flags], {options})\n```\n\nDefines how a single command-line argument should be parsed.\n\n- ```name or flags``` - Either a name or a list of option strings, e.g. foo or -f, --foo.\n\nOptions:\n\n- ```action``` - The basic type of action to be taken when this argument is encountered at the command line.\n- ```nargs```- The number of command-line arguments that should be consumed.\n- ```constant``` - A constant value required by some action and nargs selections.\n- ```defaultValue``` - The value produced if the argument is absent from the command line.\n- ```type``` - The type to which the command-line argument should be converted.\n- ```choices``` - A container of the allowable values for the argument.\n- ```required``` - Whether or not the command-line option may be omitted (optionals only).\n- ```help``` - A brief description of what the argument does.\n- ```metavar``` - A name for the argument in usage messages.\n- ```dest``` - The name of the attribute to be added to the object returned by parseArgs().\n\nDetails in [original add_argument guide](http://docs.python.org/dev/library/argparse.html#the-add-argument-method)\n\n\nAction (some details)\n================\n\nArgumentParser objects associate command-line arguments with actions.\nThese actions can do just about anything with the command-line arguments associated\nwith them, though most actions simply add an attribute to the object returned by\nparseArgs(). The action keyword argument specifies how the command-line arguments\nshould be handled. The supported actions are:\n\n- ```store``` - Just stores the argument’s value. This is the default action.\n- ```storeConst``` - Stores value, specified by the const keyword argument.\n (Note that the const keyword argument defaults to the rather unhelpful None.)\n The 'storeConst' action is most commonly used with optional arguments, that\n specify some sort of flag.\n- ```storeTrue``` and ```storeFalse``` - Stores values True and False\n respectively. These are special cases of 'storeConst'.\n- ```append``` - Stores a list, and appends each argument value to the list.\n This is useful to allow an option to be specified multiple times.\n- ```appendConst``` - Stores a list, and appends value, specified by the\n const keyword argument to the list. (Note, that the const keyword argument defaults\n is None.) The 'appendConst' action is typically used when multiple arguments need\n to store constants to the same list.\n- ```count``` - Counts the number of times a keyword argument occurs. For example,\n used for increasing verbosity levels.\n- ```help``` - Prints a complete help message for all the options in the current\n parser and then exits. By default a help action is automatically added to the parser.\n See ArgumentParser for details of how the output is created.\n- ```version``` - Prints version information and exit. Expects a `version=`\n keyword argument in the addArgument() call.\n\nDetails in [original action guide](http://docs.python.org/dev/library/argparse.html#action)\n\n\nSub-commands\n============\n\nArgumentParser.addSubparsers()\n\nMany programs split their functionality into a number of sub-commands, for\nexample, the svn program can invoke sub-commands like `svn checkout`, `svn update`,\nand `svn commit`. Splitting up functionality this way can be a particularly good\nidea when a program performs several different functions which require different\nkinds of command-line arguments. `ArgumentParser` supports creation of such\nsub-commands with `addSubparsers()` method. The `addSubparsers()` method is\nnormally called with no arguments and returns an special action object.\nThis object has a single method `addParser()`, which takes a command name and\nany `ArgumentParser` constructor arguments, and returns an `ArgumentParser` object\nthat can be modified as usual.\n\nExample:\n\nsub_commands.js\n```javascript\n#!/usr/bin/env node\n'use strict';\n\nvar ArgumentParser = require('../lib/argparse').ArgumentParser;\nvar parser = new ArgumentParser({\n version: '0.0.1',\n addHelp:true,\n description: 'Argparse examples: sub-commands',\n});\n\nvar subparsers = parser.addSubparsers({\n title:'subcommands',\n dest:\"subcommand_name\"\n});\n\nvar bar = subparsers.addParser('c1', {addHelp:true});\nbar.addArgument(\n [ '-f', '--foo' ],\n {\n action: 'store',\n help: 'foo3 bar3'\n }\n);\nvar bar = subparsers.addParser(\n 'c2',\n {aliases:['co'], addHelp:true}\n);\nbar.addArgument(\n [ '-b', '--bar' ],\n {\n action: 'store',\n type: 'int',\n help: 'foo3 bar3'\n }\n);\n\nvar args = parser.parseArgs();\nconsole.dir(args);\n\n```\n\nDetails in [original sub-commands guide](http://docs.python.org/dev/library/argparse.html#sub-commands)\n\n\nContributors\n============\n\n- [Eugene Shkuropat](https://github.com/shkuropat)\n- [Paul Jacobson](https://github.com/hpaulj)\n\n[others](https://github.com/nodeca/argparse/graphs/contributors)\n\nLicense\n=======\n\nCopyright (c) 2012 [Vitaly Puzrin](https://github.com/puzrin).\nReleased under the MIT license. See\n[LICENSE](https://github.com/nodeca/argparse/blob/master/LICENSE) for details.\n\n\n", - "readmeFilename": "README.md", - "_id": "argparse@0.1.15", - "dist": { - "shasum": "28a1f72c43113e763220e5708414301c8840f0a1", - "tarball": "http://registry.npmjs.org/argparse/-/argparse-0.1.15.tgz" - }, + "gitHead": "9c32eb1405d5d4b5686087d95bac010774979659", + "_id": "argparse@0.1.16", + "_shasum": "cfd01e0fbba3d6caed049fbd758d40f65196f57c", "_from": "argparse@~ 0.1.11", - "_resolved": "https://registry.npmjs.org/argparse/-/argparse-0.1.15.tgz", - "_npmVersion": "1.2.18", + "_npmVersion": "1.4.28", "_npmUser": { "name": "vitaly", "email": "vitaly@rcdesign.ru" @@ -63,6 +52,10 @@ "email": "vitaly@rcdesign.ru" } ], + "dist": { + "shasum": "cfd01e0fbba3d6caed049fbd758d40f65196f57c", + "tarball": "http://registry.npmjs.org/argparse/-/argparse-0.1.16.tgz" + }, "directories": {}, - "_shasum": "28a1f72c43113e763220e5708414301c8840f0a1" + "_resolved": "https://registry.npmjs.org/argparse/-/argparse-0.1.16.tgz" } diff --git a/node_modules/grunt/node_modules/js-yaml/package.json b/node_modules/grunt/node_modules/js-yaml/package.json index 112abb2..f02287b 100644 --- a/node_modules/grunt/node_modules/js-yaml/package.json +++ b/node_modules/grunt/node_modules/js-yaml/package.json @@ -58,7 +58,7 @@ "shasum": "a25ae6509999e97df278c6719da11bd0687743a8", "tarball": "http://registry.npmjs.org/js-yaml/-/js-yaml-2.0.5.tgz" }, - "_from": "js-yaml@~2.0.5", + "_from": "js-yaml@2.0.5", "_resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-2.0.5.tgz", "_npmVersion": "1.2.14", "_npmUser": { diff --git a/node_modules/grunt/node_modules/lodash/package.json b/node_modules/grunt/node_modules/lodash/package.json index a690c43..c0f5bed 100644 --- a/node_modules/grunt/node_modules/lodash/package.json +++ b/node_modules/grunt/node_modules/lodash/package.json @@ -60,7 +60,7 @@ "shasum": "8f3499c5245d346d682e5b0d3b40767e09f1a92c", "tarball": "http://registry.npmjs.org/lodash/-/lodash-0.9.2.tgz" }, - "_from": "lodash@~0.9.2", + "_from": "lodash@0.9.2", "_npmVersion": "1.2.24", "_npmUser": { "name": "jdalton", diff --git a/node_modules/grunt/node_modules/minimatch/package.json b/node_modules/grunt/node_modules/minimatch/package.json index 624e4d0..4226de4 100644 --- a/node_modules/grunt/node_modules/minimatch/package.json +++ b/node_modules/grunt/node_modules/minimatch/package.json @@ -38,7 +38,7 @@ "shasum": "c74e780574f63c6f9a090e90efbe6ef53a6a756a", "tarball": "http://registry.npmjs.org/minimatch/-/minimatch-0.2.14.tgz" }, - "_from": "minimatch@~0.2.12", + "_from": "minimatch@0.2.14", "_npmVersion": "1.3.17", "_npmUser": { "name": "isaacs", diff --git a/node_modules/grunt/node_modules/nopt/package.json b/node_modules/grunt/node_modules/nopt/package.json index 17a1faa..3ecc560 100644 --- a/node_modules/grunt/node_modules/nopt/package.json +++ b/node_modules/grunt/node_modules/nopt/package.json @@ -50,7 +50,7 @@ ], "directories": {}, "_shasum": "6ddd21bd2a31417b92727dd585f8a6f37608ebee", - "_from": "nopt@~1.0.10", + "_from": "nopt@1.0.10", "_resolved": "https://registry.npmjs.org/nopt/-/nopt-1.0.10.tgz", "bugs": { "url": "https://github.com/isaacs/nopt/issues" diff --git a/node_modules/grunt/node_modules/rimraf/package.json b/node_modules/grunt/node_modules/rimraf/package.json index 4f629ca..e42bff9 100644 --- a/node_modules/grunt/node_modules/rimraf/package.json +++ b/node_modules/grunt/node_modules/rimraf/package.json @@ -51,7 +51,7 @@ "homepage": "https://github.com/isaacs/rimraf", "_id": "rimraf@2.2.8", "_shasum": "e439be2aaee327321952730f99a8929e4fc50582", - "_from": "rimraf@~2.2.8", + "_from": "rimraf@2.2.8", "_npmVersion": "1.4.10", "_npmUser": { "name": "isaacs", diff --git a/node_modules/grunt/node_modules/underscore.string/package.json b/node_modules/grunt/node_modules/underscore.string/package.json index a692a1d..92ec6ba 100644 --- a/node_modules/grunt/node_modules/underscore.string/package.json +++ b/node_modules/grunt/node_modules/underscore.string/package.json @@ -70,7 +70,7 @@ "shasum": "d7c0fa2af5d5a1a67f4253daee98132e733f0f19", "tarball": "http://registry.npmjs.org/underscore.string/-/underscore.string-2.2.1.tgz" }, - "_from": "underscore.string@~2.2.1", + "_from": "underscore.string@2.2.1", "_npmVersion": "1.2.32", "_npmUser": { "name": "epeli", diff --git a/node_modules/grunt/node_modules/which/LICENSE b/node_modules/grunt/node_modules/which/LICENSE index 05a4010..19129e3 100644 --- a/node_modules/grunt/node_modules/which/LICENSE +++ b/node_modules/grunt/node_modules/which/LICENSE @@ -1,23 +1,15 @@ -Copyright 2009, 2010, 2011 Isaac Z. Schlueter. -All rights reserved. +The ISC License -Permission is hereby granted, free of charge, to any person -obtaining a copy of this software and associated documentation -files (the "Software"), to deal in the Software without -restriction, including without limitation the rights to use, -copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the -Software is furnished to do so, subject to the following -conditions: +Copyright (c) Isaac Z. Schlueter and Contributors -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. +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", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES -OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT -HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, -WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -OTHER DEALINGS IN THE SOFTWARE. +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR +IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/node_modules/grunt/node_modules/which/package.json b/node_modules/grunt/node_modules/which/package.json index 4e0981a..40b3178 100644 --- a/node_modules/grunt/node_modules/which/package.json +++ b/node_modules/grunt/node_modules/which/package.json @@ -6,7 +6,7 @@ }, "name": "which", "description": "Like which(1) unix command. Find the first instance of an executable in the PATH.", - "version": "1.0.5", + "version": "1.0.9", "repository": { "type": "git", "url": "git://github.com/isaacs/node-which.git" @@ -15,39 +15,32 @@ "bin": { "which": "./bin/which" }, - "engines": { - "node": "*" + "license": "ISC", + "gitHead": "df3d52a0ecd5f366d550e0f14d67ca4d5e621bad", + "bugs": { + "url": "https://github.com/isaacs/node-which/issues" }, - "dependencies": {}, - "devDependencies": {}, + "homepage": "https://github.com/isaacs/node-which", + "_id": "which@1.0.9", + "scripts": {}, + "_shasum": "460c1da0f810103d0321a9b633af9e575e64486f", + "_from": "which@1.0.9", + "_npmVersion": "2.6.0", + "_nodeVersion": "1.1.0", "_npmUser": { "name": "isaacs", "email": "i@izs.me" }, - "_id": "which@1.0.5", - "optionalDependencies": {}, - "_engineSupported": true, - "_npmVersion": "1.1.2", - "_nodeVersion": "v0.7.6-pre", - "_defaultsLoaded": true, - "dist": { - "shasum": "5630d6819dda692f1464462e7956cb42c0842739", - "tarball": "http://registry.npmjs.org/which/-/which-1.0.5.tgz" - }, - "readme": "The \"which\" util from npm's guts.\n\nFinds the first instance of a specified executable in the PATH\nenvironment variable. Does not cache the results, so `hash -r` is not\nneeded when the PATH changes.\n", "maintainers": [ { "name": "isaacs", "email": "i@izs.me" } ], - "directories": {}, - "_shasum": "5630d6819dda692f1464462e7956cb42c0842739", - "_from": "which@~1.0.5", - "_resolved": "https://registry.npmjs.org/which/-/which-1.0.5.tgz", - "bugs": { - "url": "https://github.com/isaacs/node-which/issues" + "dist": { + "shasum": "460c1da0f810103d0321a9b633af9e575e64486f", + "tarball": "http://registry.npmjs.org/which/-/which-1.0.9.tgz" }, - "homepage": "https://github.com/isaacs/node-which", - "scripts": {} + "directories": {}, + "_resolved": "https://registry.npmjs.org/which/-/which-1.0.9.tgz" } diff --git a/node_modules/grunt/node_modules/which/which.js b/node_modules/grunt/node_modules/which/which.js index db7e8f7..2a45417 100644 --- a/node_modules/grunt/node_modules/which/which.js +++ b/node_modules/grunt/node_modules/which/which.js @@ -5,12 +5,7 @@ var path = require("path") , fs , COLON = process.platform === "win32" ? ";" : ":" , isExe - -try { - fs = require("graceful-fs") -} catch (ex) { - fs = require("fs") -} + , fs = require("fs") if (process.platform == "win32") { // On windows, there is no good way to check that a file is executable @@ -21,7 +16,9 @@ if (process.platform == "win32") { //console.error("isExe?", (mod & 0111).toString(8)) var ret = (mod & 0001) || (mod & 0010) && process.getgid && gid === process.getgid() + || (mod & 0010) && process.getuid && 0 === process.getuid() || (mod & 0100) && process.getuid && uid === process.getuid() + || (mod & 0100) && process.getuid && 0 === process.getuid() //console.error("isExe?", ret) return ret } diff --git a/node_modules/node-inspector/node_modules/express/node_modules/accepts/node_modules/mime/package.json b/node_modules/node-inspector/node_modules/express/node_modules/accepts/node_modules/mime/package.json index e031ac7..7c8571d 100644 --- a/node_modules/node-inspector/node_modules/express/node_modules/accepts/node_modules/mime/package.json +++ b/node_modules/node-inspector/node_modules/express/node_modules/accepts/node_modules/mime/package.json @@ -25,8 +25,6 @@ "type": "git" }, "version": "1.2.11", - "readme": "# mime\n\nComprehensive MIME type mapping API. Includes all 600+ types and 800+ extensions defined by the Apache project, plus additional types submitted by the node.js community.\n\n## Install\n\nInstall with [npm](http://github.com/isaacs/npm):\n\n npm install mime\n\n## API - Queries\n\n### mime.lookup(path)\nGet the mime type associated with a file, if no mime type is found `application/octet-stream` is returned. Performs a case-insensitive lookup using the extension in `path` (the substring after the last '/' or '.'). E.g.\n\n var mime = require('mime');\n\n mime.lookup('/path/to/file.txt'); // => 'text/plain'\n mime.lookup('file.txt'); // => 'text/plain'\n mime.lookup('.TXT'); // => 'text/plain'\n mime.lookup('htm'); // => 'text/html'\n\n### mime.default_type\nSets the mime type returned when `mime.lookup` fails to find the extension searched for. (Default is `application/octet-stream`.)\n\n### mime.extension(type)\nGet the default extension for `type`\n\n mime.extension('text/html'); // => 'html'\n mime.extension('application/octet-stream'); // => 'bin'\n\n### mime.charsets.lookup()\n\nMap mime-type to charset\n\n mime.charsets.lookup('text/plain'); // => 'UTF-8'\n\n(The logic for charset lookups is pretty rudimentary. Feel free to suggest improvements.)\n\n## API - Defining Custom Types\n\nThe following APIs allow you to add your own type mappings within your project. If you feel a type should be included as part of node-mime, see [requesting new types](https://github.com/broofa/node-mime/wiki/Requesting-New-Types).\n\n### mime.define()\n\nAdd custom mime/extension mappings\n\n mime.define({\n 'text/x-some-format': ['x-sf', 'x-sft', 'x-sfml'],\n 'application/x-my-type': ['x-mt', 'x-mtt'],\n // etc ...\n });\n\n mime.lookup('x-sft'); // => 'text/x-some-format'\n\nThe first entry in the extensions array is returned by `mime.extension()`. E.g.\n\n mime.extension('text/x-some-format'); // => 'x-sf'\n\n### mime.load(filepath)\n\nLoad mappings from an Apache \".types\" format file\n\n mime.load('./my_project.types');\n\nThe .types file format is simple - See the `types` dir for examples.\n", - "readmeFilename": "README.md", "bugs": { "url": "https://github.com/broofa/node-mime/issues" }, @@ -54,6 +52,6 @@ "directories": {}, "_shasum": "58203eed86e3a5ef17aed2b7d9ebd47f0a60dd10", "_resolved": "https://registry.npmjs.org/mime/-/mime-1.2.11.tgz", - "homepage": "https://github.com/broofa/node-mime", - "scripts": {} + "readme": "ERROR: No README data found!", + "homepage": "https://github.com/broofa/node-mime" } diff --git a/node_modules/node-inspector/node_modules/express/node_modules/escape-html/package.json b/node_modules/node-inspector/node_modules/express/node_modules/escape-html/package.json index ee240f0..fefdb4e 100644 --- a/node_modules/node-inspector/node_modules/express/node_modules/escape-html/package.json +++ b/node_modules/node-inspector/node_modules/express/node_modules/escape-html/package.json @@ -18,8 +18,6 @@ "type": "git", "url": "https://github.com/component/escape-html.git" }, - "readme": "\n# escape-html\n\n Escape HTML entities\n\n## Example\n\n```js\nvar escape = require('escape-html');\nescape(str);\n```\n\n## License\n\n MIT", - "readmeFilename": "Readme.md", "bugs": { "url": "https://github.com/component/escape-html/issues" }, @@ -43,5 +41,6 @@ ], "directories": {}, "_shasum": "181a286ead397a39a92857cfb1d43052e356bff0", - "_resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.1.tgz" + "_resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.1.tgz", + "readme": "ERROR: No README data found!" } diff --git a/node_modules/node-inspector/node_modules/express/node_modules/send/node_modules/mime/package.json b/node_modules/node-inspector/node_modules/express/node_modules/send/node_modules/mime/package.json index e031ac7..7c8571d 100644 --- a/node_modules/node-inspector/node_modules/express/node_modules/send/node_modules/mime/package.json +++ b/node_modules/node-inspector/node_modules/express/node_modules/send/node_modules/mime/package.json @@ -25,8 +25,6 @@ "type": "git" }, "version": "1.2.11", - "readme": "# mime\n\nComprehensive MIME type mapping API. Includes all 600+ types and 800+ extensions defined by the Apache project, plus additional types submitted by the node.js community.\n\n## Install\n\nInstall with [npm](http://github.com/isaacs/npm):\n\n npm install mime\n\n## API - Queries\n\n### mime.lookup(path)\nGet the mime type associated with a file, if no mime type is found `application/octet-stream` is returned. Performs a case-insensitive lookup using the extension in `path` (the substring after the last '/' or '.'). E.g.\n\n var mime = require('mime');\n\n mime.lookup('/path/to/file.txt'); // => 'text/plain'\n mime.lookup('file.txt'); // => 'text/plain'\n mime.lookup('.TXT'); // => 'text/plain'\n mime.lookup('htm'); // => 'text/html'\n\n### mime.default_type\nSets the mime type returned when `mime.lookup` fails to find the extension searched for. (Default is `application/octet-stream`.)\n\n### mime.extension(type)\nGet the default extension for `type`\n\n mime.extension('text/html'); // => 'html'\n mime.extension('application/octet-stream'); // => 'bin'\n\n### mime.charsets.lookup()\n\nMap mime-type to charset\n\n mime.charsets.lookup('text/plain'); // => 'UTF-8'\n\n(The logic for charset lookups is pretty rudimentary. Feel free to suggest improvements.)\n\n## API - Defining Custom Types\n\nThe following APIs allow you to add your own type mappings within your project. If you feel a type should be included as part of node-mime, see [requesting new types](https://github.com/broofa/node-mime/wiki/Requesting-New-Types).\n\n### mime.define()\n\nAdd custom mime/extension mappings\n\n mime.define({\n 'text/x-some-format': ['x-sf', 'x-sft', 'x-sfml'],\n 'application/x-my-type': ['x-mt', 'x-mtt'],\n // etc ...\n });\n\n mime.lookup('x-sft'); // => 'text/x-some-format'\n\nThe first entry in the extensions array is returned by `mime.extension()`. E.g.\n\n mime.extension('text/x-some-format'); // => 'x-sf'\n\n### mime.load(filepath)\n\nLoad mappings from an Apache \".types\" format file\n\n mime.load('./my_project.types');\n\nThe .types file format is simple - See the `types` dir for examples.\n", - "readmeFilename": "README.md", "bugs": { "url": "https://github.com/broofa/node-mime/issues" }, @@ -54,6 +52,6 @@ "directories": {}, "_shasum": "58203eed86e3a5ef17aed2b7d9ebd47f0a60dd10", "_resolved": "https://registry.npmjs.org/mime/-/mime-1.2.11.tgz", - "homepage": "https://github.com/broofa/node-mime", - "scripts": {} + "readme": "ERROR: No README data found!", + "homepage": "https://github.com/broofa/node-mime" } diff --git a/node_modules/node-inspector/node_modules/express/node_modules/serve-static/node_modules/send/node_modules/mime/package.json b/node_modules/node-inspector/node_modules/express/node_modules/serve-static/node_modules/send/node_modules/mime/package.json index e031ac7..7c8571d 100644 --- a/node_modules/node-inspector/node_modules/express/node_modules/serve-static/node_modules/send/node_modules/mime/package.json +++ b/node_modules/node-inspector/node_modules/express/node_modules/serve-static/node_modules/send/node_modules/mime/package.json @@ -25,8 +25,6 @@ "type": "git" }, "version": "1.2.11", - "readme": "# mime\n\nComprehensive MIME type mapping API. Includes all 600+ types and 800+ extensions defined by the Apache project, plus additional types submitted by the node.js community.\n\n## Install\n\nInstall with [npm](http://github.com/isaacs/npm):\n\n npm install mime\n\n## API - Queries\n\n### mime.lookup(path)\nGet the mime type associated with a file, if no mime type is found `application/octet-stream` is returned. Performs a case-insensitive lookup using the extension in `path` (the substring after the last '/' or '.'). E.g.\n\n var mime = require('mime');\n\n mime.lookup('/path/to/file.txt'); // => 'text/plain'\n mime.lookup('file.txt'); // => 'text/plain'\n mime.lookup('.TXT'); // => 'text/plain'\n mime.lookup('htm'); // => 'text/html'\n\n### mime.default_type\nSets the mime type returned when `mime.lookup` fails to find the extension searched for. (Default is `application/octet-stream`.)\n\n### mime.extension(type)\nGet the default extension for `type`\n\n mime.extension('text/html'); // => 'html'\n mime.extension('application/octet-stream'); // => 'bin'\n\n### mime.charsets.lookup()\n\nMap mime-type to charset\n\n mime.charsets.lookup('text/plain'); // => 'UTF-8'\n\n(The logic for charset lookups is pretty rudimentary. Feel free to suggest improvements.)\n\n## API - Defining Custom Types\n\nThe following APIs allow you to add your own type mappings within your project. If you feel a type should be included as part of node-mime, see [requesting new types](https://github.com/broofa/node-mime/wiki/Requesting-New-Types).\n\n### mime.define()\n\nAdd custom mime/extension mappings\n\n mime.define({\n 'text/x-some-format': ['x-sf', 'x-sft', 'x-sfml'],\n 'application/x-my-type': ['x-mt', 'x-mtt'],\n // etc ...\n });\n\n mime.lookup('x-sft'); // => 'text/x-some-format'\n\nThe first entry in the extensions array is returned by `mime.extension()`. E.g.\n\n mime.extension('text/x-some-format'); // => 'x-sf'\n\n### mime.load(filepath)\n\nLoad mappings from an Apache \".types\" format file\n\n mime.load('./my_project.types');\n\nThe .types file format is simple - See the `types` dir for examples.\n", - "readmeFilename": "README.md", "bugs": { "url": "https://github.com/broofa/node-mime/issues" }, @@ -54,6 +52,6 @@ "directories": {}, "_shasum": "58203eed86e3a5ef17aed2b7d9ebd47f0a60dd10", "_resolved": "https://registry.npmjs.org/mime/-/mime-1.2.11.tgz", - "homepage": "https://github.com/broofa/node-mime", - "scripts": {} + "readme": "ERROR: No README data found!", + "homepage": "https://github.com/broofa/node-mime" } diff --git a/node_modules/node-inspector/node_modules/express/node_modules/type-is/node_modules/mime/package.json b/node_modules/node-inspector/node_modules/express/node_modules/type-is/node_modules/mime/package.json index 40312ce..e0e29fc 100644 --- a/node_modules/node-inspector/node_modules/express/node_modules/type-is/node_modules/mime/package.json +++ b/node_modules/node-inspector/node_modules/express/node_modules/type-is/node_modules/mime/package.json @@ -25,8 +25,6 @@ "type": "git" }, "version": "1.2.11", - "readme": "# mime\n\nComprehensive MIME type mapping API. Includes all 600+ types and 800+ extensions defined by the Apache project, plus additional types submitted by the node.js community.\n\n## Install\n\nInstall with [npm](http://github.com/isaacs/npm):\n\n npm install mime\n\n## API - Queries\n\n### mime.lookup(path)\nGet the mime type associated with a file, if no mime type is found `application/octet-stream` is returned. Performs a case-insensitive lookup using the extension in `path` (the substring after the last '/' or '.'). E.g.\n\n var mime = require('mime');\n\n mime.lookup('/path/to/file.txt'); // => 'text/plain'\n mime.lookup('file.txt'); // => 'text/plain'\n mime.lookup('.TXT'); // => 'text/plain'\n mime.lookup('htm'); // => 'text/html'\n\n### mime.default_type\nSets the mime type returned when `mime.lookup` fails to find the extension searched for. (Default is `application/octet-stream`.)\n\n### mime.extension(type)\nGet the default extension for `type`\n\n mime.extension('text/html'); // => 'html'\n mime.extension('application/octet-stream'); // => 'bin'\n\n### mime.charsets.lookup()\n\nMap mime-type to charset\n\n mime.charsets.lookup('text/plain'); // => 'UTF-8'\n\n(The logic for charset lookups is pretty rudimentary. Feel free to suggest improvements.)\n\n## API - Defining Custom Types\n\nThe following APIs allow you to add your own type mappings within your project. If you feel a type should be included as part of node-mime, see [requesting new types](https://github.com/broofa/node-mime/wiki/Requesting-New-Types).\n\n### mime.define()\n\nAdd custom mime/extension mappings\n\n mime.define({\n 'text/x-some-format': ['x-sf', 'x-sft', 'x-sfml'],\n 'application/x-my-type': ['x-mt', 'x-mtt'],\n // etc ...\n });\n\n mime.lookup('x-sft'); // => 'text/x-some-format'\n\nThe first entry in the extensions array is returned by `mime.extension()`. E.g.\n\n mime.extension('text/x-some-format'); // => 'x-sf'\n\n### mime.load(filepath)\n\nLoad mappings from an Apache \".types\" format file\n\n mime.load('./my_project.types');\n\nThe .types file format is simple - See the `types` dir for examples.\n", - "readmeFilename": "README.md", "bugs": { "url": "https://github.com/broofa/node-mime/issues" }, @@ -54,6 +52,6 @@ "directories": {}, "_shasum": "58203eed86e3a5ef17aed2b7d9ebd47f0a60dd10", "_resolved": "https://registry.npmjs.org/mime/-/mime-1.2.11.tgz", - "homepage": "https://github.com/broofa/node-mime", - "scripts": {} + "readme": "ERROR: No README data found!", + "homepage": "https://github.com/broofa/node-mime" } diff --git a/node_modules/node-inspector/node_modules/express/node_modules/utils-merge/package.json b/node_modules/node-inspector/node_modules/express/node_modules/utils-merge/package.json index e655383..305d5e1 100644 --- a/node_modules/node-inspector/node_modules/express/node_modules/utils-merge/package.json +++ b/node_modules/node-inspector/node_modules/express/node_modules/utils-merge/package.json @@ -35,8 +35,6 @@ "engines": { "node": ">= 0.4.0" }, - "readme": "# utils-merge\n\nMerges the properties from a source object into a destination object.\n\n## Install\n\n $ npm install utils-merge\n\n## Usage\n\n```javascript\nvar a = { foo: 'bar' }\n , b = { bar: 'baz' };\n\nmerge(a, b);\n// => { foo: 'bar', bar: 'baz' }\n```\n\n## Tests\n\n $ npm install\n $ npm test\n\n[![Build Status](https://secure.travis-ci.org/jaredhanson/utils-merge.png)](http://travis-ci.org/jaredhanson/utils-merge)\n\n## Credits\n\n - [Jared Hanson](http://github.com/jaredhanson)\n\n## License\n\n[The MIT License](http://opensource.org/licenses/MIT)\n\nCopyright (c) 2013 Jared Hanson <[http://jaredhanson.net/](http://jaredhanson.net/)>\n", - "readmeFilename": "README.md", "_id": "utils-merge@1.0.0", "dist": { "shasum": "0294fb922bb9375153541c4f7096231f287c8af8", @@ -57,5 +55,6 @@ "directories": {}, "_shasum": "0294fb922bb9375153541c4f7096231f287c8af8", "_resolved": "https://registry.npmjs.org/utils-merge/-/utils-merge-1.0.0.tgz", + "readme": "ERROR: No README data found!", "homepage": "https://github.com/jaredhanson/utils-merge" } diff --git a/node_modules/node-inspector/node_modules/strong-data-uri/node_modules/truncate/README.md b/node_modules/node-inspector/node_modules/strong-data-uri/node_modules/truncate/README.md index 24b9703..9540b56 100644 --- a/node_modules/node-inspector/node_modules/strong-data-uri/node_modules/truncate/README.md +++ b/node_modules/node-inspector/node_modules/strong-data-uri/node_modules/truncate/README.md @@ -27,8 +27,12 @@ String.truncate("1234 http://google.com hey :)", 2) === "12..." ``` ## Release History -v1.0.0 - Initial commit (5 apr. 2012) +v1.0.3 - Add repository homepage (22 Oct. 2014) +v1.0.0 - Initial commit (5 Apr. 2012) + +## Donate +[Donate Bitcoins](https://coinbase.com/checkouts/fc3041b9d8116e0b98e7d243c4727a30) ## License -Copyright (c) 2013 Francois-Guillaume Ribreau +Copyright (c) 2014 Francois-Guillaume Ribreau Licensed under the MIT license. diff --git a/node_modules/node-inspector/node_modules/strong-data-uri/node_modules/truncate/package.json b/node_modules/node-inspector/node_modules/strong-data-uri/node_modules/truncate/package.json index 9016bb8..8c9b294 100644 --- a/node_modules/node-inspector/node_modules/strong-data-uri/node_modules/truncate/package.json +++ b/node_modules/node-inspector/node_modules/strong-data-uri/node_modules/truncate/package.json @@ -7,10 +7,11 @@ "name": "truncate", "main": "truncate.js", "description": "Truncate text and keep urls safe", - "version": "1.0.2", + "version": "1.0.4", + "homepage": "https://github.com/FGRibreau/node-truncate", "repository": { "type": "git", - "url": "git@github.com:FGRibreau/node-text-truncate.git" + "url": "git@github.com:FGRibreau/node-truncate.git" }, "scripts": { "test": "mocha --reporter spec" @@ -18,18 +19,20 @@ "engines": { "node": "*" }, + "license": "MIT", "dependencies": {}, "devDependencies": { "mocha": "*", "yuidocjs": "*" }, - "readme": "Truncate [![Build Status](https://drone.io/github.com/FGRibreau/node-truncate/status.png)](https://drone.io/github.com/FGRibreau/node-truncate/latest)\n==================\n\nTruncate text and keeps urls safe.\n\n## NPM\nInstall the module with: `npm install truncate`\n\n## Usage\n\n```javascript\n// Browser\nString.truncate(\"1234 http://google.com hey :)\", 2) === \"12...\"\n```\n\n```javascript\n// NodeJS\n> truncate = require('truncate');\n> truncate(\"1234 http://google.com hey :)\", 4);\n\"1234...\"\n> truncate(\"1234 http://google.com hey :)\", 4, {ellipsis:null}); // or ellipsis:''\n\"1234\"\n> truncate(\"1234 http://google.com hey :)\", 6);\n\"1234 http://google.com...\"\n> truncate(\"1234 http://google.com hey :)\", 100);\n\"1234 http://google.com hey :)\"\n```\n\n## Release History\nv1.0.0 - Initial commit (5 apr. 2012)\n\n## License\nCopyright (c) 2013 Francois-Guillaume Ribreau\nLicensed under the MIT license.\n", - "_id": "truncate@1.0.2", - "dist": { - "shasum": "3221c41f6e747f83e8613f5466c8bfb596226a66", - "tarball": "http://registry.npmjs.org/truncate/-/truncate-1.0.2.tgz" + "gitHead": "2c273a5fa4a978800f22a3bfcddc94820d029cda", + "bugs": { + "url": "https://github.com/FGRibreau/node-truncate/issues" }, - "_npmVersion": "1.1.59", + "_id": "truncate@1.0.4", + "_shasum": "2bcfbbff4a97b9089b693c1ae37c5105ec8775aa", + "_from": "truncate@~1.0.2", + "_npmVersion": "1.4.14", "_npmUser": { "name": "fgribreau", "email": "npm@fgribreau.com" @@ -40,12 +43,10 @@ "email": "npm@fgribreau.com" } ], - "directories": {}, - "_shasum": "3221c41f6e747f83e8613f5466c8bfb596226a66", - "_from": "truncate@~1.0.2", - "_resolved": "https://registry.npmjs.org/truncate/-/truncate-1.0.2.tgz", - "bugs": { - "url": "https://github.com/FGRibreau/node-text-truncate/issues" + "dist": { + "shasum": "2bcfbbff4a97b9089b693c1ae37c5105ec8775aa", + "tarball": "http://registry.npmjs.org/truncate/-/truncate-1.0.4.tgz" }, - "homepage": "https://github.com/FGRibreau/node-text-truncate" + "directories": {}, + "_resolved": "https://registry.npmjs.org/truncate/-/truncate-1.0.4.tgz" } diff --git a/node_modules/node-inspector/node_modules/which/LICENSE b/node_modules/node-inspector/node_modules/which/LICENSE index 05a4010..19129e3 100644 --- a/node_modules/node-inspector/node_modules/which/LICENSE +++ b/node_modules/node-inspector/node_modules/which/LICENSE @@ -1,23 +1,15 @@ -Copyright 2009, 2010, 2011 Isaac Z. Schlueter. -All rights reserved. +The ISC License -Permission is hereby granted, free of charge, to any person -obtaining a copy of this software and associated documentation -files (the "Software"), to deal in the Software without -restriction, including without limitation the rights to use, -copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the -Software is furnished to do so, subject to the following -conditions: +Copyright (c) Isaac Z. Schlueter and Contributors -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. +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", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES -OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT -HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, -WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -OTHER DEALINGS IN THE SOFTWARE. +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR +IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/node_modules/node-inspector/node_modules/which/package.json b/node_modules/node-inspector/node_modules/which/package.json index 4e0981a..9163f6b 100644 --- a/node_modules/node-inspector/node_modules/which/package.json +++ b/node_modules/node-inspector/node_modules/which/package.json @@ -6,7 +6,7 @@ }, "name": "which", "description": "Like which(1) unix command. Find the first instance of an executable in the PATH.", - "version": "1.0.5", + "version": "1.0.9", "repository": { "type": "git", "url": "git://github.com/isaacs/node-which.git" @@ -15,39 +15,33 @@ "bin": { "which": "./bin/which" }, - "engines": { - "node": "*" + "license": "ISC", + "gitHead": "df3d52a0ecd5f366d550e0f14d67ca4d5e621bad", + "bugs": { + "url": "https://github.com/isaacs/node-which/issues" }, - "dependencies": {}, - "devDependencies": {}, + "homepage": "https://github.com/isaacs/node-which", + "_id": "which@1.0.9", + "scripts": {}, + "_shasum": "460c1da0f810103d0321a9b633af9e575e64486f", + "_from": "which@~1.0.5", + "_npmVersion": "2.6.0", + "_nodeVersion": "1.1.0", "_npmUser": { "name": "isaacs", "email": "i@izs.me" }, - "_id": "which@1.0.5", - "optionalDependencies": {}, - "_engineSupported": true, - "_npmVersion": "1.1.2", - "_nodeVersion": "v0.7.6-pre", - "_defaultsLoaded": true, - "dist": { - "shasum": "5630d6819dda692f1464462e7956cb42c0842739", - "tarball": "http://registry.npmjs.org/which/-/which-1.0.5.tgz" - }, - "readme": "The \"which\" util from npm's guts.\n\nFinds the first instance of a specified executable in the PATH\nenvironment variable. Does not cache the results, so `hash -r` is not\nneeded when the PATH changes.\n", "maintainers": [ { "name": "isaacs", "email": "i@izs.me" } ], - "directories": {}, - "_shasum": "5630d6819dda692f1464462e7956cb42c0842739", - "_from": "which@~1.0.5", - "_resolved": "https://registry.npmjs.org/which/-/which-1.0.5.tgz", - "bugs": { - "url": "https://github.com/isaacs/node-which/issues" + "dist": { + "shasum": "460c1da0f810103d0321a9b633af9e575e64486f", + "tarball": "http://registry.npmjs.org/which/-/which-1.0.9.tgz" }, - "homepage": "https://github.com/isaacs/node-which", - "scripts": {} + "directories": {}, + "_resolved": "https://registry.npmjs.org/which/-/which-1.0.9.tgz", + "readme": "ERROR: No README data found!" } diff --git a/node_modules/node-inspector/node_modules/which/which.js b/node_modules/node-inspector/node_modules/which/which.js index db7e8f7..2a45417 100644 --- a/node_modules/node-inspector/node_modules/which/which.js +++ b/node_modules/node-inspector/node_modules/which/which.js @@ -5,12 +5,7 @@ var path = require("path") , fs , COLON = process.platform === "win32" ? ";" : ":" , isExe - -try { - fs = require("graceful-fs") -} catch (ex) { - fs = require("fs") -} + , fs = require("fs") if (process.platform == "win32") { // On windows, there is no good way to check that a file is executable @@ -21,7 +16,9 @@ if (process.platform == "win32") { //console.error("isExe?", (mod & 0111).toString(8)) var ret = (mod & 0001) || (mod & 0010) && process.getgid && gid === process.getgid() + || (mod & 0010) && process.getuid && 0 === process.getuid() || (mod & 0100) && process.getuid && uid === process.getuid() + || (mod & 0100) && process.getuid && 0 === process.getuid() //console.error("isExe?", ret) return ret } diff --git a/node_modules/node-inspector/node_modules/ws/build/Makefile b/node_modules/node-inspector/node_modules/ws/build/Makefile index 85dfaaa..f83a62a 100644 --- a/node_modules/node-inspector/node_modules/ws/build/Makefile +++ b/node_modules/node-inspector/node_modules/ws/build/Makefile @@ -339,8 +339,8 @@ ifeq ($(strip $(foreach prefix,$(NO_LOAD),\ endif quiet_cmd_regen_makefile = ACTION Regenerating $@ -cmd_regen_makefile = cd $(srcdir); /usr/local/lib/node_modules/npm/node_modules/node-gyp/gyp/gyp_main.py -fmake --ignore-environment "--toplevel-dir=." -I/Users/alyssanicoll/Development/CodeSchool/StayingSharpWithAngularJS/note-wrangler/node_modules/node-inspector/node_modules/ws/build/config.gypi -I/usr/local/lib/node_modules/npm/node_modules/node-gyp/addon.gypi -I/Users/alyssanicoll/.node-gyp/0.10.28/common.gypi "--depth=." "-Goutput_dir=." "--generator-output=build" "-Dlibrary=shared_library" "-Dvisibility=default" "-Dnode_root_dir=/Users/alyssanicoll/.node-gyp/0.10.28" "-Dmodule_root_dir=/Users/alyssanicoll/Development/CodeSchool/StayingSharpWithAngularJS/note-wrangler/node_modules/node-inspector/node_modules/ws" binding.gyp -Makefile: $(srcdir)/../../../../../../../../.node-gyp/0.10.28/common.gypi $(srcdir)/build/config.gypi $(srcdir)/binding.gyp $(srcdir)/../../../../../../../../../../usr/local/lib/node_modules/npm/node_modules/node-gyp/addon.gypi +cmd_regen_makefile = cd $(srcdir); /usr/local/lib/node_modules/npm/node_modules/node-gyp/gyp/gyp_main.py -fmake --ignore-environment "--toplevel-dir=." -I/Users/alyssanicoll/Development/CodeSchool/Angular/angularOnFire/NoteWrangler/node_modules/node-inspector/node_modules/ws/build/config.gypi -I/usr/local/lib/node_modules/npm/node_modules/node-gyp/addon.gypi -I/Users/alyssanicoll/.node-gyp/0.10.28/common.gypi "--depth=." "-Goutput_dir=." "--generator-output=build" "-Dlibrary=shared_library" "-Dvisibility=default" "-Dnode_root_dir=/Users/alyssanicoll/.node-gyp/0.10.28" "-Dmodule_root_dir=/Users/alyssanicoll/Development/CodeSchool/Angular/angularOnFire/NoteWrangler/node_modules/node-inspector/node_modules/ws" binding.gyp +Makefile: $(srcdir)/../../../../../../../../../../../usr/local/lib/node_modules/npm/node_modules/node-gyp/addon.gypi $(srcdir)/build/config.gypi $(srcdir)/binding.gyp $(srcdir)/../../../../../../../../../.node-gyp/0.10.28/common.gypi $(call do_cmd,regen_makefile) # "all" is a concatenation of the "all" targets from all the included diff --git a/node_modules/node-inspector/node_modules/ws/build/Release/bufferutil.node b/node_modules/node-inspector/node_modules/ws/build/Release/bufferutil.node index 0894e6acec4dcf05ec647571b9f032ea7a2f36ee..b7ab2fcfce562c16a94d70d75d2d6373c1a4cc42 100755 GIT binary patch delta 1266 zcmajf&1(}u6aery$)=iZr3OnCD%FJuMXNDiv_|Yw@rzKxmAEC>Lrse{i1FiohT(^l&1sC%e`7{HfC z+zT*=i$;s5LFAi#vF7$$G<8zWbGu8&Q(gh$^RJ`~3F_Nu7_F58*iYv{mpgGPYzIzo z^a)>e56fZOn&Ie(voL`7Ju34i>-Da2Slnd<2#y+x});jYU_|Abw z6#%nJ73`>23A)*Pc>XLq#~x?Dk*}WGL-s6tj@`($oSJCJ1UhpQ(yEXSNxy7jm zqfQ`8IaIr<`G&f|`Dc+=U_P+pg=lCWJbm$8-*Bi;9lHnjof%Grx-N{Qdhk=?@_*(N L`NGazHRb#Z0Nt=E delta 1273 zcma*n&1(};5CHIb$wp0DX_pq;Q%s-~p{*fbw#MR8C?Z9WnnEkuVnF)=F>OL>P!9N%jfp8sB{28GYxQg0NfsEq|-hc?KB)T0Q&Kn z7Ig}-ieI%}hwiC#yCU5Ki!^iAnwMdjJ|>+4qSud%m>EH1KZOfTrT~WNyu;>EECmfc z$=L^d)m^Lw4gYh_X03$*d?a6$WvuAK;gF$^)AG!U)+lB$7&XKVOh*I$dm4bx*8ZvD4SW&Z zoBu#rFD>UZZ{-(zj@|46Xc7geZ}lj=S!mn>C+@Kb-K& z1hnpu4Ttu~0w>vnJU`DavXTAL{OajgWv{bevHRGYZ2A220LOPyLr(#g{IWoTU1eXg z3~+{h(=Q?FB{@Us3#Caf^HV{ey~gidSql`@=h1 z!gPquz6Qo8o}tV~QuY+-voN zf|V#xO?g~XyeMyw|15OLaz#J*NciH}#KoD^RD3#-nH!zSP7kD}=97ucP&|;D&7SMY R;oI2d|G6kuSvgc}_zNc+v{wKC diff --git a/node_modules/node-inspector/node_modules/ws/build/Release/obj.target/bufferutil/src/bufferutil.o b/node_modules/node-inspector/node_modules/ws/build/Release/obj.target/bufferutil/src/bufferutil.o index 0f911e319f211012186318f9c44d5054bb2271e5..809c4cce3588d891e5ed3b51c677da73a60c4e7f 100644 GIT binary patch delta 24384 zcmbt+cYIXE`u?2Vv&m+YO6Fk)l|xdcc0K4Lm9q z?0yyNRk2`05p36nUKA-}6gw6W8y5UM&y;Pb_mAIxK4;Io&s%2Zop;KaQ(oR;uiauV zZ_dg7Rmk6h6m`yCF{ag8y5iPW>)I82Z?@Xp71qt3pM7q3&nV09F7x!Wdb;a9LyDT- zQS!?@>U{rpb?)Srd+Uqd*rKT3Y3h9VP9ZELKX(^;>q99YD)dT1_$~R&ZL&(-cf6HF z*M6j+PUYB~ZtzqJ z%l8w=bdnoAm43_Tfx9wDzTm0MwtU$juZ4v7MNeg+KW z?LrI@myQvl(9_9316b?f$QC(RzJ;Ln_6F4=v$zmKEP!V|vhbu)$J5!etiY)Q*nsIP z-4&^YJ#Gj59$AAd%cEGqp3o8*?*r}G49=)1M`ZpEu+V)!wa{rlR)_{1o?|UfwihBO znb5W~`hjsCnTssT8|+svM39vig5?(zXA03fy(Noj7Cn2=kwWwx0tcZG)*pZT(JyB- zkZp}Xh5+&XQVs>wGyM*@$LsrYvJg%l>HmX&yuLl4zk~@l+F=&k9zSp$wr>z&p~wa9WMwXB&Ks!Dqs@2(3IyIAVtn z3KLkYn8M3YkoZ)CD}|4N`=>yDrpcK6VDwL<7m#~0TuEyeqbz}Ak(DJv5imxeW2B$L zW?@!UxhO+x#wajef{)Xe5R`2ey1)pZ!F-7`3lX}(;Qufb{z2w6Y)jBZY6$EB7Q%xt;8=*#CHM9ng*Yy|1*(MGz~os zNBX}K@sYsJB7S)yelf7eiC>Y3ZveKJ`0_;jH(;Hn17AVhiPg9}!0BXMnW%6)FqgQS zh_3?nD)Fll@h!kojs|{pA|3+PLj0OI+<~iG0Xk%?jAH=56xh?muT8{X0k)s`b%}V& z3?b@qq+g$i4+6G?_zj8p`M{<kLmO#AHof*b^FVLtxy z(k=MZDyTrZNXEVD#ojP*du(wLhC#pmKuI~shnfI+EDSQ^KNvoY5%#u3 zMy^Ojw6}m0dJEnN90QT>b>GfS&lKXaac}{hCq!v}d)TyJ@nw<0u`>Kfp%6dguwQlG z%53MBWoC4(Ez;1NK2zdb`#~@G>*2;ycnW0hz+rDQYQFnHZgJ}}i+#n#OpQjWD^e%8 zCnL2Csr%f^k$MoRo$mceeS%b>`x;UmO32-vSsdt%)K1{`5AL4Kyp&duzm~Y2v%32# zONAKZ&dkbdcr`4<9vpUhN~cQYBw0Wawj)AR;IKm}kCZ2Hx&fW#{yVGKw*aZ<+&8j{ z8&1dUb|VhEI%Q|O1nGx>zC})#WIJs{-SX@_r=UTICu%|UOyRu9rqZQo1ZNr!yFO7n zNI4Oi57u2|H>5_C*?nnC;dgwG62@+*YLaAyw7fId#nw2h?Pj$rb8@g69EQWbCAol$ zfZk2ct%<=P!fyf%i~#4h6ozYDjy-@bB|9K$yPeS(~O67um|BD@iBiu+i*4!*pR zLX37lXcuvgL5hn7`)T8y@Df1nGXOo4qQ{}&YIsSMb7--jL%Vu)H;7zK?JS_{i7K)1 z697NLVLz`MQj4p;5&i|NLom|W8&KU@tW_d^ICx9Qf922AMQI&MYuR(WS!2;;a)3Jo z2qsX~BnKK*c+3tgRdCrAM-A0+4lV$D)`T{w3 zBy(N|`YAbgCv(09n&JiLfn-h)XjgL9Byd=P!vRkxYi$AxoRffFM$R+IoK--da+l`k zIjENf z`?UlPD=-)Exn#ZWHA8_`dJX8O$<+NfKQAc82E-B^U zYfZR@5TZB-5@rbq>`#_}+hu0)D?o|R0@h_mBYYEAfNfGf<8m-!D?nu=v=*RR0m}SY z7bPD07#y_(q}>=JS{G3|8X}hcqc`gXR8Nk7ML;+z+COVATY&;4c^g2;gEQb@U(oX0G(&e0YX+PfOFEX}7ct6H`?Q-4w)HIy?CUod> zQT!=Hj7Psko(C_gAD6b;J8_F@2?Z%GLepR%(WOsIg^csSh`Cf*3Ec@$xs=*;oRSW` z2!`@#A|qN!3Y#Y_zb_EEyg96j$2~kc3`)HdRLJFz66v$1ups|mmJbJt5Ao&v@@0IdF zD|j3;k30vh9Cuo2!N?8)=-M8;`a3{YwHKtQ&Lb$oU2vMrsMfi6>a)Gwa)-kPDUgcP|jd1sbi+sIhDl<~#Yenir_s~dD-z7-hjKh8>8Z7MM zdI5bWIBn#%MY(jL2!92z+FceY_Voxt#JwewJ9RNq)i`Vsy?(r(#SK0zRn~yDnQUJo zTZBIb>c@a%`+a8MkeBZAvMF2$j^E8LEAsV4>L#~qS&8piq|)6{W%*7g^isLlJkl3k zY>Lt^5K5N)Q=lvx2{|U^rn3*gjb&AUS{Q1@28xUXIh#<&bOv|_N{YxlAWMmMi$^a2 zA|tgY(V!8&6Yz8Hp0fO-UPkIesx_yZ%Q$7QoTah{K+UVQ6f!V|1Z(K3^1T!s6oWkkO;J zUIwYnK()_+@vWRz>_KYA6ey3JF{QTJ@erl+G5N?@Vl9?S$@w&K*@E>VWJb7$R}>Cc zQ$lB{qxM-gp(qDW30QsN%L(7Wwueb+3C;Wsy?>!*Xt3mJLn4$&ScrRMwsc-E9oFbM7RPBS&U1*xXJEu4Lm3GLkeiB(7Pq=8vrlKxDj;Z$ zk)pJ7A3+sVKs*UMmVL1=i!s9Z4&M%>&ONy*uP=G_rP4EFWUiw0W~}k06Z%9BcEV*+ zD7+9dBi!ezj1P{MI?4z0Aabw|&XJ1oK9ER|(jv4CwMg{Ac~U;(4=`drP)0)K$W8fR zo_l1+%s$Pal@Dl*K2X}ZA4iN2Hp7l(pB?9ebwKLen>*$;k!LTHJ~%_>DvGCKhBGTZ zhS0(Fxl&5DpXBcCnD1=CB%E0Mm6DzD8yKE8GE^}`ZruU ziE0a^RUN>;r@9?kqBN~oM`2~z!BKdp^lo@NL^%++=Xc7Jow1x+`s&DRCI_Uj9td8a z73K4iLl#W&^M|1zqUK&$UdO$m)xOeFoc;FR)RI&r{sV^nYbv^rx10=nUn*N}GfNT# z6H{2YGw@MvSxsKUWTfOJ;E$i?8#uG=-|TA+`+^K0^*Ao-_M$nEb6 zxhSaEI05;Hnw>E6I=T1xI_6<`x9xSl>KyP%S@H9inJxIg)uSsXb&xaW3mH{u7>F0o4mr9?(COvSpCQVaD3sJaxbvtg8UXbKoU z_ruPG^=d494Q4HSQ%V-&SB`}ffym3Fw^M#STvt=;lV znXdAie%_UWZjkq+*NFL^eQ8-ppDbCnPT+ zD1`Mi`1S_yya8zd{pevpW?t&p3^s4?7*K=o!&@ouS_+?R0*{&^t+=)A?OP ze?a=|l3k$XVE(Bb%uBvA^k<;`-V#1;!Am&%bI{q|5>EwoXPZEOL4K|`oCjcsdvtA{ zQ;XDK9QJ>sqx^K%P7e-az&era&8en;NVW)X!89%>fp?;lfadH0=W&kS?1XipW)Wlb*$L{>#||ET1ak~>s7;C37HYD zQ)iZTTymI@n?=7LbVvCTsTjYslSq)#BJ>s7Gcg30OZkjk7>=$+T8-J!_9b(gfKDSPB{j*~T%eb^3lGb4R-u-1rtzn0Pw1J3)weSk z+p4T0@*)s9(*%hsF;Th=rV8z5Psxo)FdKWM2O;1sxeqk2eC<)7(E*+}bSvm=Z#flh z*Vm(cn%FNZA znY#p(%5_F}ZDs@}z+^LD^oNoNcXA-4?dW+jNO6(-BmSkG;-IvnmR7GJ_k+Ef8RaQbz0aae5I=!mILmz|TbI<3S7T@?0UhquWp#5jP%#60%JNGXokPzIG*is{^~*` zM0F+pt?I7$_f$9F-&;Kd|F)=k3Oc7SInQ4@e5meH=O1=(mm1#!3nE+s8Qr6r9Ei~& z6c@Q&dzdbjD($E)^*ihz+`@yTvG^92NRZMZbmoxcE;UTbXWR-#ti1<~mT2e&psK;C z&IVWFp-;h34W7t|6}5B`L@c{LGkgWEU2qSwPhQCbNWG53Zq1}EkIW>p4M@n%Zp`p&kc{`~5Jq?uKjdJUwj zSGEJ_PvqQeI1y_w_O@x_&X@`P%u+2_AEt7n;jT<`eXjj<1XyRfGy3K`*CF)=4*O|i z()e;O(7|xLy&=xBe6&ZD9vHwFY__tZF?c@wZ4X9MSbL> zc>xT$OOJ;!r$pr=djR)rhWte_D{7~_2d+UxZCJO4pyF2wECmKULgECNb97Mv*= z;9pLef0dq&lXOcZnqSU#ac(IE6J7IgR6)Ci4^6|Qj;Tdp7`GrFisQC>6^#D^-xIY8$!1nB9k+%?h4RjB+g1p26Z>*0BQ)+3eV03{RI3r-cp?c1bN zrOhB6Aj0*4=em0iFRE2zaSeJxw%sYSB%eJc1xMFRx!|e*-AEhVK>NMrHEu({_Rb%} zfY>X2)xD9hs)ys>Q++J{z13%uRecTqebuY+pHlri{!^>p#lOFLH~!N^>B(cXhog5( z;yipTS_>XNqc!SbJ}XZT%YD1Z1Fh%`aV}Q!k@q0q)BU<%iPL^`f`>JKD9|_$>s6qFvq>yrdvhTCv+dbc;QWjTPI9R3`X9 z7@i*ZZoCj>_ByNNB_tNGzke+snJw7_T3#rAV|g4djJF%$TL|FF@H5cz%5Wd(LT@=O z+0V(iI2Cp*QGS5P^KnR7`UD}m~88-nN(>q=RqbEW#HV#%8Ot;hYJ> zLglm-lHP#KDd-T6ya|OI_uu{Vo!v;u+ilw|bvMu4Zu3rr$Nb1_2espFw?#_9X~1Fc zj@cFAen1uz{azQ&Y~Z5rM01U)9#W|98`gHi0*7(g*nDEY`Xz&)Fhxf(wu z8b5y4OiBoDtu+H^TyX2WZvvVW+?)zfs_o$D;O=S$RL#mqrIMmsaU#RPsd5(#$oE}> z)Li$H0Y&<@(mS*12(<{|=JdgfkbyuGALN!uP;O<1nxUU~wRD7(&zK8FY!RZ2gsuRn z)*$&!6od1Wc<5np)FOm-V~kvGpv#d?6mT=OfX^`Ijdy1Z9PVG70-Z?SYK^|iFij~t;G8!;uC?LO?-R;ei%!E?5scq6Qak^<8e}N##oQEpxzbZTzgo! z)x4Ru@;zC*X!WEMRP~Bg^_qLFWMxaZ&sKjP`odRRl*%9aY?buB&RsYx&$$9wM(-^3 zc??>MnxR?u6jJs^d5fvxHPm|J|CVc9ifajJVhs9)B^q`^Z$I_SovDNDS2?*TmlQk{ z1LxleQm*kn{7V}XWd?n3N3*UTh`c2D9qMU`o?jJ)92tns%F^)bDdT<>_n=<3codg~}!*th)YB z1n`*0NRGP~LQY6)W3`nNjJ57DYqN|s*E=G&BOjr$dh-dIO~88<&I4J`F|+vuj5DYc zxczh8rV+(XETetQNQeRd9E^C@)yy{4?b|j;h=DBpZ!A1(IOuH_{)=pm;(V=S&{oo4 zO1eQ-s3A};#L;X9bF1*6_Ua*rb}8uot)P@^oZ61<@xaNosLlUN=O($-)ZpG6j*GgN}V{jFe$mOKEH6>y0x${bp%D|6o&*_=@Z zr>9R~zwDLkmXFGHctaz(~Tzuai#I)T!)R7BcEkxjC9Z<^OVT^%DAE^PZV2^pz%b*aD~;cgN^5hrRtA86Z8Y24GU$j(EV&425P09M2(e ziPsE)6FFf-N5GL<=@@;sj*N|2_dzFd1eC+vJT2;+XLKgTblyzTvDBz}3(93pjvF=e zY#`Fyo!ZK?#@bOaYu_bV^C*>QS zP@kqnI~bK|aTPenM*d2!TJu|s-1IoPTUk*#X5XjTPa3g#B_sZB%-#si_%Zu4S`s~j z1B7^cD^kqgw7F^Per)SD%d~ZWwKy2sUrsm!IN?l3FFJxf!5Yd{nCQQU=^9aLB&T%hMOgipm&3@OdAK%TnY!3Q_c``{2W+G(cks@Qgw;HiaOwQjrmAm*iYT4&dLY<2vsPW9CZxQ27<=VLxH z;_qlRE4TiBEM1dfPv=oD{t0Yflim8kpX1nX-!-8;@RPRt$9rz(#DcPHU6Vug*)yy@ z3;G7GbO%i=a}1TMh3xCIMSU%<+$)o{N4FLo5reCZ{GHjT-EWK^n=&Yq=^&V%1Ow|tWVSu zfP&xst)OE`$-Zfw5n?Q>j4?S;iAEoaDe0f&;-Uk(n`e-k8Y5s;!D~uh^2N|I8w{|E z3ZmzHNSUQ@%Lh6(CN{AXdKPijI@Q5n9T#PuMcjy!G3QyVVs7-({G2s%r1z zlC@Wu$&ck8MBjm^U=cz}Wg;s%_<0l_SNp8Z;OkUcZj}zrqc>E0oMy=eeU9u?WCVzY z_I-qybsYLpv@Fuq%BWmrPE&0oB`-hje+!QDBF85n_*7yMg=D-B#^z+kNc!KxW#89P zj$BBJzNdoWLDyDQRcoK|O&Ijcc#$ZJ`nhc60$wSOBc}&AJ)JhC?3-$5DV&zd+N2CO*w3DV?X%^zaqa!1@vK?{H5XzeUmlSo_;9{Ck)E(gPe zSX-OP<-gF2x${8>t=KXHlX^=n{$$WC*0N{mv!}L2kT)6eZLnpAS65H3U!cj$4cuKu zhJpX7Vf)r>G4`f`xHX}HYuX$kf1bnY2g3Xf8oyhgJw0044GesThVA9Ba~R}}+(Smb zr@&9v{%+L%OAV)dNEl9=_$IDSW3~S@741JD1%~#uNdfV*K6|?T3`yA-GVCmLnMri& z^Dt|iY0O&_JHmu&Iwd_p480toqs9e2f^7T$F*8Q4d!f;agVpM4CzDMsnf&OZSFs&ckON# zHgc7U46wlY0Oq_4_}tqlbiF2aZtp@qYq%0*-N$RTPrt~QcI`(H#;?Dg z?Vpmr=C;{CTGktDt~+*vr{BIUO3tHKA(lX-CH~ABYjsS-BqzHc&Mi(eOQ8Yo@_EH+ zyR?|(1$Jxd$gS@BlZpZ*Tb1p}Tiwwo7NwcRM{jAThhe%W!H!vwjH6Y@_+f>XvBY?j zTor{zo8-Mw=%CsdLzhQI#+YPGYn(~0(NeX4;uq5-A4M%qFv;%Q+!gbR(xOXw>6nOK zdUtYfI-z~QtmtppCLLo)r5P}*`IDrfz^Phw={C3jf}*r@H0ipnCl&`*YU)wR3~bco ze--(zCO?&y+MA1x(tL1o>pS^M9YWj&zD;7&=JeZ;bz zvaDw5c$Qw{A#zP}(@uBQ+@ex5nV9JcZDNwgd_WuR&HQSnPe_>LGPij_ajjXLn572< zO!B{G3KHYYod27&8u$zHN5%a_>p>V@wRCEmYO6W=j2ukzA$%(ijba8?Gb%&EB*ll6 za8F-YW%Y7zS~$6+|NP@lJ#pruZZp-nb^hSFi{^A2b@C~5j$Bi)=!Ut)W)v|a#AMyc zmTlz_);U#2wdporY1*&Dx zCFi5PQI=~o+l0|ZO`AaKti=aQ@#18$H?{b71QRk_s!0=mN!p7wd%r#>v0u}TW*R-N ziD~>S-FRl^U90J~HktS0{||P7yCB84X2{ML0&eyf7q7YHiwtib??ie89yA#xL?-Ss z@weYy|5c=XGg6qXL^UD&_`NyOZII;8=UQJ!>bM#p`XFX?{`eIr($*wNs#QFa4{NPa z?wGHu9ezrVQvG3*Ki)_ry%ehf{`m3&OLf^G;3Fj@_#Tdw(K@^UAxNz96L|^@x~KOyFYzhlq2t{0popm{@!!TziH?2rhR-#_(3+(XJSFfA8(T} zmvfNoRP8S=JBe}S$Tcm0yk$$hIodD0$3~iZ{PAOa)HxeA?$@=(cdFbq-xO8xjw^X9 zA(N{0`34g8m+IPYaQA*w(35xbh?>&z8-AplwM8zfXz6`e;cAS(TDNXbw?Q-KC`r>! zyr!b&E4qBYHY?40;mNQr16PccS%ZZpe=FUGzAeEgCtt_^h3*&lKZ~Wx+$v0G0 z!Sa<@aa+@m8JAl8-@C>h+j?e$tlEwK#Msu7V9h zyt3Ac{DKXkoxBULF+OKTOm4^m#E(xv6RJZHXk&bHiV&})jr);1A^FCEQsn1^2=VDH zZJv*H6S_NA)=d(@h?T?2=VJ%+7@5ia)|LYGL7-u2!wcxT0?w*iV(l;pnbu2`3dnOUs{T;8z2+0p2K#use)U3EoDcU>>;%M$HpXuT5UMPTLL=Aw zc;MWy)A2*V_;H<^iBYSIrup?1(%m)vfTnwE`Y}zf)bx*+n%=7ERKKz}K+^*h z?TBF-7_J4*)$}+`U#aQKH2sUFcW65GBUOP7O*cNYkYlFEi5-Is-J& zQ34pcG(Aew6E%ILrjOV33{5Z5^!b`TSJRhi+U%`frRfq~fmNg(w4eFHc^N8_6<8|F z7UDupn@zzzmg1Xzr9zLQ%?`~Z%{QB6W6_If&+K_rYTE3qpX^1~p@7*oIav#sEs)1G zZFW57qD?9PWgAL{U#q6u+9WA@Yx${~K35mW>;rCQfrCrMbJ|0`RD>*nJsLQV1~V}4 MJf2o&J)8dj0AgH@!TO~NG!DcpM#0tpGy2_f_j(jkB%Who+pN>jkHdcd`ytS)fu zvI@fAuB)<^Rm6e?S5z#B^nevnioGoOd*3OyMR%X)f1c;uJM(^JX1@8RoS8Z2nVt65 zo%YJ!jY@tM@|vHb{!3Pk9%-#ywQi(!|Ed#rTgTm1*4>`86t{zCgjL`!^YpU1x-WSK z753es_*Z(={}X%Ee;2pZTT}SnP8~~E|9$rhVIlaFyTDr$^dD5{YC^a!{oL(g6}vmU zWrb@GDX69T6FG;4@FKj`ZDiLJZr9YQn%Wyw8{v9)8mR3)R&afq`dSUro{dntD7#p#|S+wtV*MCUQP( z%7o?n526{2zTzoMvwW#AS0wy84S)_wece-5Vu_RxINJmB zzL2_Jh(Ti2XdwzbEz@QK8`%@dA_dF07_k#w5bG0w`z32AId|J2pWGCy(*}2m5$^-y{AdESPbxr>vznWfV011}I~J zFK`zAkZ{I*p0ak{U{gd>Iw5-cb3IsnR-mi|c?i}4Z$$+|sWpaQY4Fhop9b9`xaKV3 zh=V=|jAOQ90&hV;;*$)n1P%iaOa%WllQ8Ll=#R)~O6okAlG>IdFaC3olqG`AK^TpO zk#P~Lg-Nx@MIJ_G)`74MHqKZ~P}W)Sdc%AP(PGgaxOb8e9dKt{orw1Yc0TcI67eO#?j?S0BK`!h{lu3i;$HyEoeZ01T$e}) zPZr{I+!@y=;$wg30XTz%)rkTZ z0K1L2n~1Liww?G*iTGY(f5LrpBHjepAmX>g;SNka7T{GR+!{v!z6#h&#BWQ)-v)My z`0a^!##A&Z+!=Qy;zNL4M*Pl1{5oKhpC(~VBH?9V-x2?NBJQ0gL>2CgyAtuXz{V55 zI{{Ch=yuO6@=XWjdUs-G3+Lyvg*ay>`n36Q)7;${B#r|KFc6T=Sz0M@<^6;opPk>N z5gfK4A3u3H7Fw~@q#446((hF(_Lc#+#}tLp4W`+T7MCOXcn?4x3!RKNeKH!6y%CA| z=l5k@i>4BJ28e>J0NF+G<`F`yAoIJrvHBN5z!I6yf$%g5A4Ww)a6iEP1V5rQ35q*- z3Isp;2zz%TAy=fr+xvnN{1Dd2o(`7pblc9&$P!|89ZW#up{p%!3Z3>FzHAcMSBC#p zAjC=B_M7gzS&iM2tjspmg&KOtXL7u*7vuuJ_B5KpQ^E59ZhN;8^F4v+UblT#kuOrj z&?tmDA~fHfhtM?$J?`F!(31##>^_3fmk5R2Z3tBslX@hp$ln8@kAd6YyT`NgQpO@G znz~il9egcALJV=IW#`py4-4@zMWlEdwCZj?!j$Wr0j2;!2J}^4@qgAtmjjp>27IGp3}5eh|TT5Q=P(bkyWL0 z(HoTMxb2!m=>Yje2xDkMp&mcq}2_9f}vQ#jZp@`y-ES0Orf6_bSBD_LF+ zis9j4xC*!3Hzl$DWKSPBf@_Jx`~ttNtDP(Kz}7=YAoj>9Dt*@!EMh@He^qr*SIGdMVy-v z+D4v*NhVcg+5-~DRQtljB-P*+t^lbQ$$w5Hi|`x|x&*6Vgeu zMEDKB8SYb!oBN7}3o*_;&^Y4ELWq+Edy}zF_%cAHnSh>8(fv^1eppGAvTLzlM7?@- zGl<+l>1?1c5mjvA%>X~gZNIE5QnRbJ5&jLNcIfHsEhz2`mMW1x3be~ef8+PWMW{1! zYuPis*<(;;vV&`fetS4>`#i5{4KKr6P~s^-7rFJhdCs2^a>=tendc6mPmpq1GUZvI z?~}4DnX(t?Po!LvO!0bzD8_BCNT75_X379}CuwB@36udq|3u2o$&}eZuXG>F%X3yB zbRT){PUd+6=)XzXkW6_G=n+yLNTz%TG{XzZqsf#Y(2k^ROrWp;{Q%D(>6ru)C<}qE zCgu5L$~vGgx=Zu(oVOABoII~5^Bf22rw_j2ovWLnuD=U0=KYl;;=jEg>F!%o?gRQF zDQ|jB$F3>8a$ro{_O=8H3osY(wIsdeHC=%gdKc&sQr`A1(4B;)T!VD)c1JbIbJk-P z{Tyz4yZ75L{nqkpo+tC*D7ftpy<0*FlzO12Nckwa&>8u7>cegC^6o(EiqqB!=onIV z<3T7!VFCUG_|GKm@p7b&6Iu>*11WpG#}g_40J_61DJb$?*hGl6Zm)tO=MjY7!EJx6 zv*k5KsRw$Jluwc==>^CzZu`?@N@t*Fkn&kFWfsuCkn(u~g`LrjfFE}23-TR4M_IP; zlrms@JnRsjlI>T7rlN||?0}WMLpS!)DpqhMfu<`Q$RTgHJAc&{7IYvN`x9PFFPCVn>Yikm;9M72(cNU zQWAU~pqc^7^jQ|g9y|<+ngUX9j1Vo02#o`aW&hyKeig-&{a+Xedqw*vZDq^>@ZF3KC7aNeW~x2O(xsr6u?f zKxI-&({PGA_$CO-qKSlPRvi(V2p)K#9W&`0C<7nMZNF`1e&12A2!8?8hdG;_lT670 z%2~NxVAIIVgO(W#bOtHi5@iCXz~>$>Zsc1A>OF2s(@Os%2)#w#0d7XqLZ=92Rs(0r zPM}|tGThci4}WW*5e5oGARxk5r0LP3E;%oEg7Q3W`^;p@TR=0?L3z|3LQ6CM4hs@k zK%He>(2*<#J{;YT zYxgwZKM(v~$se!+vzU0~RY>K#lS560SNb7qd+drI0a+Dkh>D6Lf+E}je^VHI(q3$e zAgfJg{ufZv>?L+K6QpN1zu0{#ROnj?e6xEX6!L9B=v&tcho+O)ULo^+nJkG2H_8yA zFK+ue`=*APmfqPn{u=`~Q zZNP2sh&l_KxSl{i1j?tR)<>x{p$MM15GVmRr=-x=2ch+Do04MRD+uMdBTDj} z)@Y@2vU!FtI@uJVqi`k5{?T8Ohk)#pax>TlV8)UvK!fONMFxtDL3B2u@(en7b8?Ev zJRnySZ5xkX4@7!uHPL`!ehBcZ?(vfRv))4JGm7=jFpqIcVJUNE_k);MODUv(3<*@y zRHZ+VaX<_f;opGdyHiVxoDww1j%=!fw0f^ve~U~2IG2RM6qF04iXuWUnBJQ`QF8D7 zrYvoEC3tl2t*1e1F;J~Dpnof+7JGmiF}e64M@%WLRy;)LLJU4~lz0ZyrQ~#aaN2_T zB6vo-J)0E_RYO8sDWld|wj(PIhlDm#Fn*auA^~!X;5`_^R=De$;@J!Z$V& z#o{qg?RilOCu1V~Aw}GgWre<<5PHnLpsdiTfMPi|FZ7woTtr!C94N9CU+B}>(vMlp zi@k_G?yr=rk;{Qd&tDwx`2&%NWl!BrZ8EW`K0T*&{CjB&5pK-9agH#}r)Sau zvWRd62r?VfeV>sPj;@~esNOzXX5)y|5gAS$XoU96_-w2~A0j=$A8zOgnKM;kr-Ny< zyRvzKqg-L66jH9x7c323VZ0QKcLj+A$Ss1ep-K}c2NNZK=2sxZJVPl7W+OG_8GYS~ z7Fk`}BCZ^Q+UO}tI`^L_f^vu#pvSV8`?BdH^zZQfKsvkgTI6*n&Hk&j%xIaa2yMU| zUmBrnq@fXRkWAsl;2G_{*uvQ0Y$>B`Fb6CRZE%GYjJJVA0^}CK11LqJ4gMneGi@l2 z*+3}?mIG8anB$&Np4D{#;>rfpMjI&U+)pCL2D^}eWnUg=gDpThyLXr8^&rh&CT(zu zOjQ(3!w6?)d~~6PR`0`xe9hn=S)@6IeV2|olH~>jOlzdP-H$& z#F06p7Qxligm@jdebTJRMmtQE^>i*TD+TcsrcVhGY&r{mf!jW$r;V~7mI=u+DmGDG zRtO$@rLV$5KvbmQ*Q&_IucxAbBoWFg(q33r($EX zVzOT{>yF^P8BsbPIb_BZJ%0!?A}Sw(<}F+sy5ARShW|ACL~3y+0{;fV{xucN$6HE* z{cS31?gQo|03wF4a9iMYZb@Zc?G%LMBj69IW@UGm%JXHQ+(!8yQ_XX`ru-e~CU3~Cakvp-uYCPc?)Ad4qk)>H;EA=cL##kuPW~Y=i ztJEL(4jIN1lp}MZ`UgS{+f!O^W=Hl9?v+)Ihy8*gBsQsl05RsOJtYLdXlqD6FeJ^_HbKpQJ8 z_SfBC5h{hnuXo$FY3lq?f+ELz*^t}=ZSse827h8JYA4B= zXMqrN7bO$C44`rs>ZXwtckp%){BEDN%3XeM6p|X$AS6P!qj<94VZ9|!sJl`%mjA$` z`yJz7vX*lngp6#fmA$~Z9R6tkmKwSO{{{ATC$;KH2u=XS-b>4fsx2nIk8!8!Z4=+m z_!U)qO#A@jmluD5xa`b7lbw0-k0$;(;%VMu9=G5loc#sjIo{&bW>_kP1KEd3&-I3j z033Ax)Gp7dMrbH*`~7GyKZT{!ox^yL7Lfcws%amREW&#+jLSh_M|2R-l$EphJ5D)_%gvzO8!RWTkb?13JBb9yErKUdpNTHGQu1dOLUGImm6Bjj zfXW4DxcMEjW=us~O^K+DE~%vD{6}@^FCziV{xa63x4IZcmoAcyD!0OaMf73T!&hcs z$bYWPLiia{+-o~Te8&-L?>^L_c}ZssezS1fC(ut@{w3tp>k9J#U+*64kaxjqgq|YP zFDYduDqmXVYe0{ZB2vw2o2Ga$GMrhHL(xjzo zOX!h?#kVu*+bXXj@+J^D(gcVqHW4}iRRwl$Pw_nnFd2KehqIaD#}Vg~uRQ{BG=SGl zd?eyI-ckzMuCG(m$X5sjncV3(d8A6cjOG#H2+*N!?@oEn6omdto}nHpr3n>}D0%_C zn(?F!kZb5k&q!_Yo+Oa~xka!F@`;}GyyVZU13`OIOQff?1TO)qT#4e$h++?}0m1M7 zr&B>lIZz4Wmi=0KwEGU8 zCIzo=w5Kdmy1aCe3yX_Xxj9?fuh zT4g_khoNrl)@hYzB0Qbp>a@y*2w%)_&$P;G5x#+8XP^?^z{v2l$~7R&Kqc8z)5_1} zzg?GB5kf#zv}D~?bi}Wxq9=a66~pjri^}I9a|wfU(n6yK>n3#-CUwb8YHVL<5aAN= z=oZz(0UHfMc9GkrlW9_!Qjcmp5fD^`ClX>=4J`qSW!Gedxr~oJ$gX+C8xeXBw>>h8x;!$G$N?Zt z+?;OtzH&U>jCNaf3p)e)qk?eTi?VtsQ-Y|Uk3pZSqNCJV!Lqyk?VlURqWg2(D21T8%DM>O#2T=HF0s<^ zI01@s!3gK2a+My3F(*d(Bi{q&wAsEkrbVrkcfvD>h&%wbf_{2^j4mP{0_{%JjYGr! zenMRCj_Q$D+XJCzNx$7P#ym~sZ!RduNLiCaiQEoKm3vo@eCHj6=7Qb6-}1t>kc3}J z$DA`I6Lgn6*M~00pEOGus$VwEIJ1O6MAPhtB5Jen&@@zPpW+ z_ei5kodFs^gu4Tt>mKh}*iQAuZQuzxcFU~dVg%$9MVl;?+*@3McsJ^3i+Gy1w2fQa ztEpoT1!CXotLQNVWv>{8Ur)t(`1Mve__ZtU#ILX75&Wi9ypG@0iaq#Et2mC|bP>8} zw6<_`ww6I*ai)&>#UI%R{;uxVy^5XEQ3)2-^x;6` zEUZ&m3N*>W=c)9c042%gH02N|NfuX>NG8fv<-|-b6VWE`16q<3Dyi7^56xmvW@W{e zB9#gr2*V`e$FV|`*qg25Z3xU~d;eM3=DWO{0edTWcV%O z1>RC>vR{;bu?TuBQR*EBI6`u}ZI7jP^UQWz+IYR)wwKaz+ij6%p!CFT zABpJ|;r>7_CivC)B|r%?Qn1AycDPl?9& zpKZ=WS=c40{!>fM1RCeu3JtFZn&jLARj%qm(azn*bf}tCj6x-Ox1vNwfl}qp@0age ziO^hkMZZG5t+e}W8bVD%xH#Q#64D=N;xQhH1mse7Z~){JpO#LS{F!q>h)qJ2lHg4M z)f^;W_CGM5Vh=tIikgH_FRiKwxm-Y(J)LO6#ndJ|!!_-HrWQ zhsLC#$EwQfjla~iCOoguWGp(&);!2M#68*n&sL^;>40#HYZ`$eoRR{^dJDm{NZyM? z?34l^!=XGqoY!mP^8-%zIUXhg%q&-=iyf*;S*|n>p9kL4}nYeKRNX<}vCe6RUtOCLJ`m6PUwM%4$(o zf?vy{UlTbALJMfHS|{SIfQ=>ID-oXv>`LNe6Y!4Ag>>F#42Vv{&&8j5GsgO7UzEF9 zoof#Xk2G(l-T9F$U9@=82&#BRs(8ISuVG<}xz1Me7qo@rJC%snh!%Ib%Uv)e&$$Un zMt7FFJ_o6Vy&>8DMTG2E9qwqw$}hU@hmE3}V5)h1M|M#=1(e8i&Ap%YZclCYGjh5i z$$kEi-0eZ=km(GPKHcqtfDkZ`!^&zT&oXq2G}kP16wBPQxU48k6j^dxu689zcOWsj zl@~3-ym*sw*Gfpn&Hshb!RDUg+zpk7O#UxYCX>aJ>O(vqT8xOqjuk3 zDa6dE2HBto#y95LUy$e7%!}DWc4S(Y#2ZdlhUB~X=VaO!*fU=vLt680Ejm()bnRk+8EY)kSMYgO7alK}q z4MeJYP;1#@w4D{x_DzyDj}m!PvZBF!Vq_-9WV%3ee6GDp<}1zW+lz#8S(9QS6O%-2 zQNyl2pjlfQk;!odxWY#Iim#QX4>WvJ;`r9Fpt8??Op`YowmHSa{#&2@3MAwE?9Zu5 zR0sOuMX+56F@00#X1MFcx~|9gp@zFYYH~2Rj~sCNaln~^R&+XBf;E`4Fwy6Gh6j=K zB}jdKWprR)xK#kg?<_bp_2tmiIfKFeGMLL??f`PhIy}bw;PUQvSJbtz3f;%+8mE`< zR$x!}t-A95vBtUq$tc53(;S!Se`{cz;a(@3G~6~#-tE?mZR@O_i8f(Q#>l4j7q)?f z`OCAI1-5o;Zn)v~4{0oQPD z&0LH}hJBY7vvO-5!PGSw_Ee2{?RQ}NmYk6XejmqL&&T6R{l99x-d%3i_$DQ}x+LxN zzh_8IHslRl;SLyI;+R;0X0q?d5jE}bM$AF?UqKg!8PC7PROfEpSjAhm$i6u+d4 z!I#z=;A0Ai>bc-DQ{jOJv~P^>!A9s=$XV+o2S4pODf2AkLY(wD&xOk8Mvd8y6jtiF zuH%rhACx z>s*SW+8=Yu+PRFuPvjaz_x>ngAzVr&A`3b2bz~l^r7X?ByHr>%l@89MHB@~pv1En5 zO7cb014M1pu0otU3+*VH7insxRL(LdtGbb#?yUdKSm#BGo5A>8VituY90K8kWWsRT zKLw9{Uq>l&A}P8r0>Oi(t%|DVK4ZC#+ky{?GOJ(6N^Zg@#X3@IL8*?4DC)S;aDhj4 z)laQAF2E;JIq*5sbxt9%F+U*-PixNS^uK4;n6oh7e^EzYHSoE8w?psv{W>nR;(o=b z++@%*XRAp~CdNGn*)fpueCFtcQ9H6rTy4$)UzfNVy#aCAC71*bX|ZS*V)U5ocvKf+ z;P2g|XXVT3(lF_s<2s=X=W8X8=znYcH7KyOjm+&sYGR_-{>Wvc6U$wSFV8qBlXSo1*`%+@?Tf-zFKYx|%zG zmo1(JrahBMUx1`d^LLO3d0FG>KTfI~qUl2oU+%C6$Y|lGj@p(%n?&NA@QkmZ z^JWmH)+_Cw=znYc`;d#7^Dzgt*mo)h^}g-!Bb{!E=3T1)J?;7m(k8&a4R*DmwXdPo zuhY@h2JRp|!@xIa*j|?-#@y8(^K1>=QSS(Oc{kLs489SrqxuEigS3Gcjv!yGUlZLQoC0)46jcpj z>>eakkAxJfR4FF>3}7L8%*^|}`q)29Bt{EhdV{exw_xAFFKws?B|xKr_^e5C#@0Z&W3%pB|C7>fx`b`Q=jN;gxX zLGH>qMd_bwHc9gz)3J%W+?OsW^hb6n-II5@qs}i(HCLm#+u;TC^X6h{}F{6l*TAp9c3A9f-$K&6MR~8;WhIHnoN~^7S%M)1Uv6`SIsH( z$4%uCO)t}P@6+77&THy7Q~JAiOUsz37B$oP1xnK;TJ);jZlC#u=~wFLt?tP4i~M)$ z*uNyvzg0(fs_1SV{ZeXbYMyci(_L|)U?zCdZFE6Vdh{t)#>@liwK5iczGTdAVvp}( zY17q{BpRAzHP47rX>0S?*UdbyiAgH?*l#~g8nKr}^gpbl <+(0h9?(+ZjA@?7(L zF2>-c(vPm zeo;F!J27()Fqq&@GX{w|Gw9>HY0&EbgXk|ZP5)sn2WGU@kQtO_*Q+{13MTlZR2Mp` zDW+QnhY8vTnV@^|f)-YL_pSvKO6o3}cFF9yv+B;Bws8I#voAWg&)ivy&Y!k$NL|~x z^Ddg%ddbG%!aHXdnZCsI6O(mQyLuNpvZ@U2+NSLs*YQm4+vWPd(;l)H4b)`Qwqk6O z{5Q>Q-1;N!fdZ8b>8`rYjq422)wvLrj=bEV$;Owq>bUWyHky5iWG_l)dtb93P>Efo zqs9l5q?c&&N&TNh-mYuT)O=h$vm|CZV8-7~y52simjyL5iT^LMJ3qy@vETkzxdVnZ zVYks?#~qcDvvK9&Om7}{CNU=wKaLP03%gFdPPvbN6)9!CV)POfgmCfubBx!6lb7E; z@l~WfX9q+d!zj;-Uxi}aI#Wi~tRBH9v{aqj=j#fGpOzyRH@|stW0CQtm>uvsh^#VK zHw*wiTtb5HhLD5!Qn|GKb|++zdA zeR*E{+(t(mJKV&N&&f8O(@QZyrg8;Rouuu>X(%zyBss_BwLVqpnW^oWE{%Bzf?!c0ED|k}1Jl{x?`O>A|>K;7Wq?)^XL{0AaO+Uta zYmJ;_QPVzX;p~i8wOe|;?Erqci=3vO_>9H)8#;g7OQz&Quw+>0f!l-R*@%fJuQl$v zW5xIc<@5Mm;qJokGUh6eN5d)G4`oY(J$Vgfs*U)pNDao*O5JJ48#^1pN7UGg&y9?i zYx{?o_pQJ8$63J_oW(vmzPO3A;+^k)uM&{Z9yTs+=Dt`rng3-Z(eAs(mF8RJGj zp(%Z%P_Lkb9KmA&x|DqVlx*^iRh6+HN)#ktXi^Zr-#{+;$pi(-m+Jt1SQyQP>8jTQ z)*0gq;uPe|(;8~#Xv6aCt;TpToNPRstRWuGC&V>r4e@;nLh=<1fViG6Q4nAI(OipE zDTRDxS8?(9JO$;kbKyuyo`4`W8}`w*;2~H-JkhC@&DMs^f?+k+)Gmrkp0ZK;<(ESs z$o+XOSQJuRDP>U~<13_8?{K$Pv+*TjVtnOTL-K`g<^mct#AC$dS_O;g>XomZ0pdG9 znu{-AlB-*@C>LM1Bs2(+=K6^p4>9h(>mu>%5`_503C+gW4hhNk9|7XxNpC_tK(D#( z)7=9fTy@5HBAHw#VtJKs5Ch^n#SldLIKHAiisxC-6Y(m8CsC5Gc9 zo>vCM!`50qKTkrglvus--3UT_O+a(;%ff{E<8BO)_UGHq#N^j~fZ^iFAwqnWQQocWKEFvoh+pH)gFh20D~Up5Hhy;M%CJ*)5HPO0Fpy@U*J`ih_v(0O9e-5EyX*Kpuj5m7{8AmiO2@C!@f&p9 zthL^x;}KneHHrczf_nd#RWQU7734Aif)#f3Op)q7HrPcbhCIi2Cazt z%o0eMj+>SCd0sRfGMH7Ad78njh&-+1W&wn+Mv(t#J#vO?q>g`5FQcN1=AWwLSLzIz kb-@pq;lNU{U0cYP3YR4yK2{3;LWP-dqNjh3STAJ!A3$1(Hvj+t diff --git a/node_modules/node-inspector/node_modules/ws/build/Release/obj.target/validation/src/validation.o b/node_modules/node-inspector/node_modules/ws/build/Release/obj.target/validation/src/validation.o index 0da2d20514e18935236622c333bc58ecda02b72d..bedac0e13e938d4288739c8b826e571fd14a0c73 100644 GIT binary patch delta 24736 zcmbV!2Ygh;+Wwr~bCONj5S9c|*xeK$B(wlh61pLPgwR6=0V@bdFSdny1-w?|h$wci zpY7@u#l}?;73)<|uZUv9h6SVu3Kryho+;bV@BV-P{r%3Kndf=uotby)nVEAA9=8u3 zw>NI}SeLrbc?LFa@tu&rt(Llf>E?U;H2!k0@;&aT`(2x6czHU62BiIT~n} zzC%F`jZz|OA<%0mKNiY7AmWr|xga)@JR77pk<5G?#4qkc>G_dMrU}tKxD|%QCH{i-xnTSsVb`9}WiTDO!uM%IKi0=SqO$L5hBAx-P+hiL3 zZ;3=d5VIKI@R+U)RPE{2%SAu#Fm-|yzNu+u{41mi!7j-qq*H(y*@cHTRvkUYOg9~l@ zF#a67X|u+_@|xl=H^UMl#cEapcfL~36bNq!xIMBUAHAW^{%2t^ybq&^*&YiWi#Kf? z8j`&Uk)_WaB*fX4XfBZ_fhfrGQ(Oerp#7|(@Y}j)NMD2imdJb@#3Ll$iv|&a4*-5Z z@O_3Rp`-&pgK*sAjq-XoLiZ5(85!?19dbu>Th7VI65=tmV%718VAJLZZ@=m^BEh~e z^k|+C$J|lbEu6}Hx-QBNI}_o$%e_6j#kmi{wG)^9iSuZ&iu#UP+?BpiL4l@sC(*z5 zM=nF{L7#`q{@Pjl2ccJhdVus^$DP+CCu1YrpV0rk^p}4HcU~dM1=kw65=2(J0qE~!|2&@ z*@2XV%!^P5pl6WDPx+&i%>}iUbT}m)NkDz6 zc5e&hR_!KVg{xDtOf#UHE5US0;T(X~K`Ixa9$+TB-vj7{7q|B*84TCz9bSJs$u0a3Tt87}YD!#QeZ7Pzch5)i ztKeFJ%bte>HObUfa}AJ}-3N0DocG|$c3;mas4D3#L^Uq^qU6|41v-w*UrdP^n@#~5 zal^T}&J?uJYu&2c!ci~7bqtq%ZL*%c(}Wm^%U+u@9s+UcJqzdtGHz0-g|`6BcJIk8 zs%l&(#9&S%wcCKE zxI>$^aB}N0dbvxQhR02ZixUF-X=94eVnEF^0X>tVJ0SnPY~aQ0PVB8H7Oyr}cpXDG z0{R?LB^KHY@N;*6(*oxgxZ1e>W(7_ix~|1;+h&E4j)=^%&+;}J8PI)F8+5CKaM|a1 zP4jx59iIq|2RfI`ykuqx(5uNTPG;5teUQwB$;@Lw-z*@tBAMC=^su|TS#IQaxSDz( zb49XD2xvDlYm%A1Kqrt{m&}|A^kOm_l9^RN?<8|u0@D+@eh~1Br0zLp;5x*Dh9+$l-S*AD8DP*2ZW@ZDuip(>~%*{ZbBJ+GQ^D5BK$-JDvFavu5 zJFHW$dgq{!S$%bZ&cV2~8khZ=_kGpfyT^7=V?#A38#l4Uvq z9Z6VmfRO9`L;BkJm&13K5)$8sM}2R-+xd zV<>LPn$ieXveLh+p-`v|5ZPO`v2@MyQ(ELiP{f=R6;q3y&oC0>Y)A$6zYY~b6f}l_ znamNgJ(1+u+=nu<_{p3^l!n0RsM(2=x!qDe^J);W$(&LWcoLwR%rP=%MM(#~1mQ5T zyWBgQH;FLuA~+nNW&h-D^dj;jCv5pZ*k#(sv^A~tw`FvpZa}3ie)iG^Q0-^;2`!DJ zmIL1Cv`>_*fqE<08cjr+m=AqaA2l%^VA5ae4;c~q8U4Aov2K5AaL?I}Kr)#Hdmv(L zcmQ#pJRyEU>WVj^MEsN%fyoG;Xu|5JWq{1Tf{EEsX$jm7P}z{dX+tF)cnO5#ejm&` zPnmBF{HR}c%zWFBZ$3-g>6i+tut%svgubA`0omEf42RrGGI=%)%J_7c8lY3$xuJ6B zBDijGZ-wh#xL$Ez50%%w1J^gW?0Q=pF0|i3Lk;8)Bcmd;%%{8mQOR*!59Ud?Z#dU^ z1+El#LO7H+FOBw|VEbCY5nZKe(crEL=Qks1pKfy%Wx6zC%PWE0>TV6^kCxnd;Jk|S zpTpS0TOrUG+U;4%lxWo=9k}hW%YJ~6Rpy0Pl;si>p?0{9ciR=^cl;49pS{Fx)E!+D zYf_5^6uHFKYYr*sT+%O;$!UEBn9c5zqM)+{uKn(fMZr9Vx37?iR#GCAnIS|k_f07O z3@)F2W1R9yK>RB zo~#sOq9bejtI-mY&x))qc*Zd7>rr+&;`J+b7}!~yC~c3j3|pb;#h`8@y(3Dq-RY_F z-C%aFEy?M%4~{ZF#P&w3!h_74e=+_==oC=9spUvi%OjFl0HVwtQBvS+g6my(Zb@$B zOSpV^*0X(%X}fW`$pa(V%qSbnO}Ho6TN!q=!}=ntynirr%i%|ap9PnJ24;_m<7FDd ztpRfy7_rBaQ>GQcZ&Q&C`)GPmHXPE(IT@_}Xi-Hi0iBA=E-+BI9^NwvwaQ?dYe7j7 zo(W_*(GKzGN+7oq?Gleh?gq4#aCHp!vptK@D}X;E)i=Y;sZ|WcOr~9f0A3xZLi)!L ze>p8)e29XzF<69t0U{gHfQ-%%X&=?0LWBy@$l9}^4b+i()xt%1G{6~dWs9ce|1y0t zAL0}GWZ2-}(gvX`ATz{0zeS!LCW;wEk8uJCkYk*bRLcz_I0vJL?B}1vWGGo@uUgtQ z)EhFoo7Yn&Kcz*^bj3s z{SCxFaM|ZaiC-o0wh1veN-%`(jSrh(^P((+MKoQ41jsRXzT;EAC(rzH<5mb*|MiNu@UPa3Rgxp)p4(H)hLo>Qa;VmQ)d4T znWYjCGVbZl9so#{j+;8|GiBU+Nr>R{77D?aWk(HY5Fl8)(baxFPaWpMHk2T2`FDH^EY|wC?2&OPKlw%Gir3Y+os@ zHbNpIcpE1A(m>T%-AOjkRZ=K44>H<5`YFOsX_50K{*`@Bmui%KX4di<`lR*4OQbRw z==Ro4BfF5ZL<9X*(wQef#0;du1d5?u8E7V@kRc@<=nFy_D3OSzEch-ITK2_p2HKKi z3>0zLK&bD08GA8>?G@5M%OoNSCSf2p^FS^UoSd<>QZjxXC=pdt13NLWB<6H|E#k+* z=x<f`QNaKW7 z(c5$II3jyg#mnuHG(I#ao(~#vw0!yqJT?t`M7ZqZW+gV-FRP@daS2%|NM!U@OP_^8 zEW~Ah{*-(iLOP>zGLK45vW_3U_HvoNt%&{a!c>RPImdJ(j5;*V*6&34@{~-OD6%QEyA^P(wo;Uu(%D=<-kI?U{*lYYhD*lA=|3rUkMI?Bp zj_@b}yP~7G0OOVraz@(f${%Jzo=Mk{J+uftGLtnkJF!5@woB-PQO#J-S|(? zpBkz7!T=&$DmZHV7X4`znP=$)dg%XARFoLNCUC!1QE32dM_bl%tD?UFQV9ITsu*E_ zR01oliYW%@l19X-SZIKB`n{o*@IQ;o&dk=2W&Z88sA-|M0D9cd+T}zt&&DGJE;~0{ zKkaFe0RST;@{@>b0KQBjoJ70_F#jA7Ewc4=QLE|<@O%>GNyJ~yVKpPuIhsKAoUk2W zio2$LPWPO1@%)C%?!`RG>4l!2o(}W|GBr`P>PhilfFHOYwa<@y23M0A5E&iSuco$T z04327C5{iIWzICjm?$A1z(cniVr-O9w*1%-OuzHgYE;86Ra{A4w+jd=T!M z4h5s$U}Ji~X_bq4nr&}!%02=h%D%+ERdxvfp0X1Z5y5|9@*qdnPg|YbNi`b)c@er2 zGDF^4i0Hw z#Fphn!Nl%rw2p8evpJ$X*@F8~Z4$RJCE};F2;AK*dAL3-#G+-XM$T#{!?G)P6;6|fcF7h_UCaS)%M+^fIlbojS9r2G9BL$ zz^8NubuccJoH2y^0iH|h_c%(f&xQXA_+e6ZS~Qg+^a2nZAHhmhnpt&H>E}2uifItr zj{x3$6MG1dw+rAb!a&`(8y9E#Uj!_|VGybARh>IHWnFnP=DE%tx;IBLt;A&)>i~!` z&O9P`2vJ$~)2Y$DnefM$#U688pHk$!0PdJue@fvvO4%=9(DtSmOS_ALM*x|LU@KrJ z*Q_>DGQMp}#7}7v=!o#E+^whNL>l0VRV5WFuo$4KN))HjDy6!>bs$ttN+fc)x%6if zKNYc@_=(_k#kwbAVS7pogjL+qK?XP!TItm?n$QFY4RL38(NCo1eE|Ozt=~S88eE2Z zp8Zy8#YPCpdBR6Dji}gS{2$XFsd&}+KcWAUiua8FQ~ED1`~rSCH`*iTMuk5Z|JU&Q zyoEfb)Wc3etlt30_7-|duw_yM|F`hxctg4Ht3D@{Vod)OmHtXF1Kd7c3nC-nnuW`L zH`TNqEwi(go<8k}PLecp5R9BYy_d{nAn%p5!_HJwXLXpqK;<;;{pd7}j1L{)cu+&# z-Cc97W$sU1TSZ=gdN~%bM3SGfHXsnftc8r8uE=TfBzZ6f2=cMm&z;cDy7>)xWeW2q3+aoLB^ zwOi>+D5+NzX98YH>W7q4v_I>xh;)4z#QV7$=$O1#~i* zl++}>Gk{)2CN*_LWkQTMBiGH{5mhJ}q4Ask>n;R4x$-~53%%LD+y_X6T zSO`#66{=?ZN;EU*H$Acwo}jbpXU4H{OOjf}2AAmKZO>^MDBV z!d@+lu0$Eiqd%L{Ooy(M@;aE`D&4KUawE)@{j{tEiVPJ4k!AIa&Xm_LXELJTn>Mj( z{@x!J(QcX5SP@~nl8B$uBG3Wh6U*wWDj6Vi8kksNDJ_9D099czIBoWolny)%!f~(a zZE9c;e#_nwSIf6x+9&g{GwnglWDr*6p_rofE}7jAr7}?>7+S73{DwlX9bfqYFxe;u z+wUt+Lv3n7cT-<^2<~olhkfOp;T{s9rq`9>F(kypAYu}x_kS| zSHpc7-2+tM+vu+MmER0}3d+Nt>T5NMcYBntEDsJ*R*HYCtUdlcWmWk1mJP(eEy|xl zn1yh*vuFB(b%S*KdjvDJ%?L(#eL$~~o}QD`NgJ1G@0P?(!*Trjs+#znv}Lxhh4F0KW2S&R~)Dj<`HUXf*n z7SEtFSS;b$faR8z8y6saDbVGq2ykN@8rlGK8`a#LWhP51%S9gnJxb;_!-Or=;H~bV zeod=6)0O*H_hgv`FKwyQz+8aKemoY9Isy>75%8OCzf*G~hu|83vanx>6OxZ8BKUg^ zD_&o#QMBS+O2ZF;Evk%P057Tt0{VUa4Bxm4y8r90mj)OsABJp^ve!u zi8UK1CZS$EQ-U7Gv5t4oWacAYtb4=eYy%BT_G1i?r~<@t+NW7!XckC z+GoiLSPA?+kPN#6{624SxqG62^T>(8K8AR@Fig4 z%0i_?Rm4r8lFC8_l1u)qoW-<_J(*P)SOl?;!hr{+Lmns>!GZ=MitH^`;epXY+*}Xw z@8#BP;W7B-Q{;a5F;Mi>b)o%Ba%sfEr5_w<7X<42g)M z&VVKme#6oek!S}D;@v25HxvsM(+3d5=~2ey{|DjlQOL_J^j*nR zsL2@ap1ao$Y!Yb$=L{dB`-oDiOy%1s;aV`$aM^of;YH{iAU6>`qElfaWnx9>E>L?( zf0M1xkws6C>BPy6ozN`{g!lqi1cG|>ik6ZVlob+7C*yT>R_h4DDvs+zW)G!hLsyNB zR%gC_g!HOOP52EEaeasq4|~Q%YqNXjpxnp^_~UA?mbwgRT0~AX^jZrRg~G~F;i`=cs}+o}tj-j_JrZ}lM7$Z) zC!}+|Cb5zhp?yHp*4E`l8qX181TMSO+gE9jtH}PNFo0-vfQ)T<%a*}mm950Tx6CD2 zb{qbEWe?&%yX-Oi7nNRT@y`g$!U^Fe_ zURT#RG9SLRxa?lhWPZh5h|tYIpCeNfJ>sjG?LbeE8Jx`IA(B40>|x2wFrc%@G(?X` zQd#^V^Vwk444PY(C(oc?1Dd!PE)l=n;0&yqmpp^sF6A>H0>K${ z8+DFBX$kBAs;1Bk&JtDPfny*X_st=B0XZ)b&A5lqjO&-Vqupae>U;|@;yK~mGu^uS zcD{P_fhiTaJ>2E>IaaN^uKuF_sg03%U$f6JO6T!}Ota{pd^2DL=+sb33i`cQ;Pi!a zpCV$X$?pq^rn;(YDb}E-c;8hCbLEw<p-nd>|RW}90$GL-$F#o+tPjvE49cDkpH z3|k+&Ge(B9KP5HjSLEV9pt^tV-Y~LL=l$sbTXV7Oa+F!O?KlWI^O7GM6*mJ&)6Q<$1j@$+&j7;7hOKew09-b$0X((acl;eEZRw$wn!A z^uTHGbHZmWDlNjl<)cX zaB2x;=EGuEkFq7$Ot-hml~O6V@6QE|T+Kh*;~|PVu16%6=(iUU6k}2$kNhgGc(QM!ATzJ9>f}ync?Uvbec09Z)Iy8-Sr*x;E4!kpOeiKC=Vl8T`xpyMM}V;WIQ_jl4Q z`aKHv_c6)I`5&nOb&lsoe}~G!kd#TepPG7{?cO-HZ{%#~%V=Oz z>mIX_s3}KIqeo<7)(|zHz=YBFAlU*i1!QQ^Zwi=Gr|T$Mt0+i6DW}wuKJz3R?MLx7 z_d|({=t>3^HM9MAg-V+1+r}(&(XS3^S_KV%kS>*wZL(*Pa-09VT>qz$;K&`Qqn3QdOI<0_6j!T6&9#Y%9JLS8IA@^x`pg@f!{ciAh`5?9M!t{aTf?Qr+E~;) z0yP@>S5#>%n>i{9Naz9`ae zHrDoUv|HkKgZ~0&&MdT&5r8h_Vwp1!UN#*6MR?$`oQ1}Fv8OcCa+bjR8-*{y?U4eJ~E$4oC(OM(Ie<|MZx12}dub}iwPic3{*$i(r zy{kN>eJ$r%c==TW|7uU^Aj|m*UVh5Jf0?IrxaI7FSH^UOr*xd<9EA5ivR8Ua&$S$Z ztjRoFXDbVBHy3f-Z19+IbBP+k236(Y zk?md`<_&enq06OJ?N7#qb#@g$nP9}9)xiKiibu?3*i&)Z8-D=X*Js!5`D0wBxWVJD zpVB<-Gp+nv_vtBlMZaiYQ=Kc%;Hsw3VPL;|WJ*!Q_5r-*0g*q1q&AbUxE=O*`J#nGOe;o$@U{^ z97|WRepKCK7Bc3kl|xehFsPo)o0ONl7{t^V6LV2KE=6xO6{r37lWbRiFOzk)a|~p}0&9Z%=-;#ncby>>6&l zRyeYTxmWgIV#xxOBj7?k0uII;^oo(d`HCi83dnCOrns4 zvq*>!lZkqyx*Wt2L%5x%2jXVc6NaL97z6>8<4)3y&3-%$3o~RUf$51hAJ0x4fkN(m zP<12+_1zjX9b%K%6lC4tNHOjNA|0p&>h#@n&bVoj2{5JhHyHffTFjY5*E!n1M&Ii@ zjm21%1bSv}Pl%1Vluh3Vt}t4M^^GgOxe((6l3Q~|Gj7~#5N)Krxdxsf zMy`#_Xs}Js(HW)~o3tVaRbT|P)Ss1ceTBA^O zwCQ&ds5Qnk>a8*DphK0N5^oSAuZC{b{N)po=syXyuz_-M9e@A#0nUtqsv%7H5D|IN z(JDzbW{heMVBKQmKl5HM7c#IQ5TUqYpbJ}+@lOnUY zfXPuEG1z4Q2SAb!)J$M8+hoO8@cHw!n9JMMGdrki%mzRY8NxoOJW z01jx<#`xv!bN4UGZ*HbvYc*_%2IH)8A6i(DZe~gCzIPih%TLo&E+NUbJ9MaiX4)Z6 zSK4F$j;3nd9*YXn%si!py3;~YZpEU4bTfD9C1dJf@_u1d_h{o>6@`Wy=Q{WMMFr6? zOQQlKjB{NS8fBcfFigQQ<5HAprHxU4{AZpX6luW{QWd&yH?uUMc*wk zJZ22#nyIP9``wKT^V2TT-oLrMmo#s;LHq9h^YHg+>c0ICe%y4aQmPW-lvfZh8aLmmoglyp96y)MYKLuI{R3;|u%E zIcL$VY4bZwQ}V2mo=v8}l({MF*ixIM z4g8x9W!B~D_LHs{rAx?^^cL;krSC`d-E%-{Gh!=F5|i{)Z4YBpV?>yZNj0O0>7j?{ z9(Lg&Nt?mu|BH6Frlf7!^uz2F_bqSArlOzsIcM=>g&3^FxUs4>^NWA*ALPOITmi`n;K*29S$fBY0CW#%KJ z{PF8{^w(h^3>QW1K%j5J|2GvqmuAWK_~Bu7nD<=ztj z)4sTF$N;A7d8(g&(?9T;kN#dr6o2pN1Z~yrm#>nNH|>$1A-q7x&&fT5c7V}VXv4Kw|AB2SDc%EEYQUX8zHmwZ z?h@%0p(o}!*0Xkmr-zBlGssezke{&u#1%Y`f;!DsQm6EdLOgiEfILy5rR1S$KzDVF zLRpyOQHncfXng$fkPRW8Eb>H@ex3s-#;K@Qrq02^c3qK_deO7S#L z3*7PJnJhw|_K51|HyjA@=(|oBm(vM7h62|y*0CxR<55a2#uq9Gaj{cFd?}dFqs38( zi}HlFLYYo$bwEMfVActHq)0)1uw<%r@mMVbrXt3sx*hOHEV0ui28R%QQ;-lp(SZCc2BrAT2(4?2E~H2g)JJU$d2|(GJj|-acpjJ` zf9(>L%5JBiXJZiGBBvBLM0G%UvKi3%kkXL+#uFg!Ir7$L?N8?_kU zCt%2Z9itFGZ9zzWR6*(IrUD^uO6W@PTU!NfikXK83@LRZYNuAu*VzfJjTA>~Y+GIX zZvd`KWT4LFftWJBkf9Lq2ps`OyhL{62<;t}9jn`9Q28er1We_-P&X z1hl_==Mi_l1*ygOrD=-s1JpW79#$p9^;Io3QQLw?*);TtE)nhn>3}?=&VX&YMxiTF zQ3<`kcT#mo`6@gxfq_^?s`a2zxA9^Ch4?=0^wp<1AV;mY9qLcqcEcrb7 z%z!-7ETxctp0gq5Mf$bLrgl;g-wn~qcmRh|Jj0@;YSR=n8W4H_{`dwor52+<(j7f_ zc?h-W9M#3I9}pT?g7Vk;`Jo76TyfSAzgI#?e#93belI{Tq20)umg1=$Lfq_YK^Y93 zx)N|3Pp6effGEXtHX7o~5fRwz3No( zT{1#^DNRHC^c|s3V!bXujz)-|Fe}tzJP}TedjLA)6QB53z2Wj()RZutEFHS}J#o$eT5XJ(@S`2kp`D$eWdc-OAr7x=#3#7BCBZ4`~JF S+5c9Z!1JEy*U5S)^M3(?nQEB; delta 24745 zcmbV!2Ygh;+Wwr~bCS&_3t>qkVRsXP2?-qx5;`V;5CS9+iU?9v1f@!~t-XK+I3kK( z`)Bu}V!IYZvEjvf#mW`bYXcEbL@dbnJX5xz-~Ipo`}>_eGtcwRJ2UUpGc)JxJ8bVe zY(KooV_oUK;2F}QVwaG=O_sWU>$dXtZ?S8)@;%|G`~4ecdVh7IAHi3P%d%Excuzl| zI4@;AWp@2YA=-IgboRk(rwQTR>?swN^En`-Wlw3g<>bP910=k! zcuET_XApEq_Ek@5u_e+%kn9S~`+WMHLPUkHQHTOhJKuI-BasruU^#o>i}Zo-co~HU zLQH^X4x;d6FpQ_tvMm2)!;o~5*^)qK%ae_;7Ssw&WJN%XAvwshJPHg{L6OLs0JPVD z5uirIDA8;g(Ca8a4$3?r5|lN&0mS1ZPXp;qCbOOaal~EkZxy|Gst`Rhk8jSP%uV)! zaYCGqm@<(F>&THK{ac&|#Md9l5FpNx5(GfjGw*`MyiWd!Lgdo>Kd_kB3BkJyHqE@- zQ`*j(b}kf^1InE5RPlz)WZvT`?cxpA!kcz1Oqx0LnHrX;6(}u68iMD5Xip7wR2#?d zH+X}=uZD6Fd`mgAC*vOjOPd7ziex++Sf5EW z`jyGVU=Z^eV0kirHn97MUz3bK4(va~uT94H0SiwCzA_oF0M?9M`7x70X|4#Z2|%OAHcpPenT>T z5Lnq1;5R1Y-GQA#d|fiW0N9 zwCzLqbL_nQ7QhPf@Ryryp>|pMZQyRD)H4ObTMFE6EDWPJ^x1zeDueeCG%?#_p=0r8 zOhQAlHy|?qyc2{t%@VC8@)QsSSpkZR;2N}_6%>9)_YD3;2w;h76O` zZ?(u}xI5^1xa_Z;)qfKDGEk3@-tD;aTjpdw4)+)I?~(qBU2unr;NR~UD3KX({3nB$cPBP9TwszTy|zElMzAB zj>`_FC1qZOj|F- zor~o6gX=O}_IxC$WtOg*Yk+KZAId3oK7lLO-I`NaUEWWK{K1fn}O!K z_v98==hb1#h0DGzRqqm@e6tM$0- zGrXpGy~vIa<1WxeWag(b=K^)fEKX(C0ezIrIjPLkK>t-p>cUiNJJ3V!&ive{*CRv` zE_+3)OexSlWLBm!gMgk)W=$$H6X-=`)}=BlfZjvq)+DA6a{Vaa*Gb)#M1gr1=x#Fi zr7{PAX1Wg-mfTfB2n$gIA)K+nRsbrmlAb?=9|E7Z(AKsUJ;w91Y4&xSQ|*;~D)yVNpsfL>1K z4X^HKjox>F?k4l5cYaY)jF%yrTXETMc{hiWm^(4?eFm5Pw)e+yoM8qY&qYnaWxt;q zXeZD=$b6WTYlO+n!^4_8sxUWtEL@Ga?2o+xj-K)CpA7U|GM{+ayCyJK0KJRMcJIDq zWwlsq3J^p86x0Bp9k7~j z(;Y)eC2LA^SjqD5s-aN03lP~`wYPN53Q$_)L{Y??6qQhm-HKr(#@Ubx9M}pKLKNmf zz)a={*`8?XZ0-{oS>j|)B1%K>6x8hG$=psUpXGvxPv(@8;Bx@gWR8(BD@r=}EeJmo z`>}gR>y}X_UWA$eTJ}M2^OunyIbjO}VV7wi($=*6@5t!FeSk_^{NkkzpgO?r6Iybl zmc8ECv`@5I1NBy@BbtabF(3MPj@BL;{o+!D$GeY{Fj8$^cncfQj2sX$d|6P}z{dX+tF){3i&%yC+m| zhBDto_))*?xcRmq-+Y#~{g?`>um`9^guemm0J5`FnQWk(QQHMJ4a)d*m=l0bcjtvG zoD1Q)!@UKrhv0g{-5Rc_`v9&zxa@jc8!r5#fkqf85J5&o_g2frM_ldTz0*=@!P1_UQm62BYB<+)JuA)qnMm%N}kUQN?kyc|QcLq4G z;sP@md*o#ZpG+-D`g;LZQl|rA^EJx+Ja{c!)}eS7a-n%V#k1;kIQ~5#xiWBrq2O&7wK&=n(aBxrtv%feO4r%0^OjduisNzaMLvY!J28uMoJCjgZCfi(F zN{Yx_AeR#DoQN(5awpNML^S#UpqB~vio*d;p+)!&z+aIXkZI=BDuxm!)2=}PuZ~k8 zwQ(d+L5r6hq~M@9EW$^C$c8jHvpYmO#dN3;;bJth?rdm7bfjLja1ogRaE{xhZC=Im zrcY*Eu2Y)?VzP}xZ;Ydy&gACouy4h%!d-FkOP zXKeuy@6}b9;2wagSEp{4xRMSwL$rSPf@4%}MQ9O6H~UPdd0$N6n49qY7CP;79Fum= znnd^-5D(+B=f(*282i2nF)v0igzk+GnPBr{EQ3WgU5*6EF?fMvCUg;H#3nGZTRF?o znb40)OtZa6Hk1k}8aWS$d{kPT*hB^+X3L)J#7C^3P`EO(DUN%6S@UR1lk%yKo-zlv z$-I_>ka16Qz5)OP>bR-XK1Ig8n}mqeQwN*wsflr~LT4mvi67J7)LL??%HXu&5Yp8| z&z}Pn7demNUsaQlQje-8$0OL$vw^Wv8EVPA^1SFPDBk2+GEvf5-+_qN5)~%c9LiNK zp=#C=B^~SxLd~C&iFm?7&qJYQU*R-om6jFf-j-M@meyVFu!N~^h>X32!uD0tY7G(* zp}R2Amj>#E)tyuWT`h&eiy@=!qn{!IlomPv!N0Q4DN>EH whCXWj@O-HZ2D+_X zUUUa?mTaJlC7oqMQQSZ(Ot1`~GSDnaAwx7-(~jF;LWD z1EIdTGWHS*+ZRd$Et7~SoQi?i%mcYZaCF92OUcA}phQ$n4Q|K4lAP1EgAhL!MlEQL zXH{tlmI72+Wn@em#33C#o)ZEG@qe65$OTarLdHd9U|&LzoOe3u9#bWx9A1&Z39X{v z%E9A^>`@gjw?{Jg(4creXe7{_d5hrFQ-#=z%RX#YVq^WXN_qyDkd=aDMsKy$E)-%J zF8lLmP*>X0;-f3=-O^s+ zoe}7|&-FX%fZXJQ^tz6%Qb)&8+PAI-xeW z`|SPcMOkpX4#NH|9qq|mLc;zrokjT`lNJC8`-eLNA5HG3bUk74f25K=8K``EJeY1) zX*F{Wm>U@8=XA3=pqak`eU{9j6h?T1gcr7v3*~L(e5Flve-ly?dSV{_?cL2QFP$#L zguxKo%STaBxz70a(VtcMi1F{Izo7C}L zp9$ENJ&gYl{hrG4#{UcbX_ZTj|2O(Y@OdyM}u{RNfJ82=yiJC*Ml{}KAr zqm|znKx9h=zZ<_re@11CQ+0|x^#3F(%MD-?xZkR*GJr$i0;_VU0n!LuWL1teKstd- zt;*>JsLCMXR4y}spMGz6Is7l-va_=FV_D#>L8xirZ2;5V&pPHrTbzbR2wZkSA<-&@xDMb}5|I?*6M*3vAlhc@>7rKE6W~G;6)D8!Gg!^YbdM!aJtw>eFwYSokCLjXT@w|8n4{R*yvnGhKh)32ts9RNzA zDMlO~Ld(oF#Ml@iAHc)^V~BAvLfP_jLyV6Rw~wN#{pM7_eD(j_Mvfu{K2qCy1+0#t(w#Zfx` zfK(Tp0zwTg$wbbT<$8nRcxsTZzQ66o0qxa zFv_CIOwNbxj75XTB8a`!*L+*0w&;;!R)_Z8!qIJzI*iMH&$qLq()=o85Rr@uA*SH6 zKk+d>iOOAHy%;(d+|A^7__}vX3K@m>5nT4?2_ezsL-gNpoj*Ai+#10^Ux0Q*# z6p*h9a5KU{-FI4)WCdOZEFx_|WVu&&@9cEw!ILpBbno1=1jV!*mtCR*zyt~A5ut;K z%CetLkL}GwKF2Kfu-op~V&^q*hu!*Pi^fyR-i$%p>o1XZ7lls(G84fvU`N-i_EIvj zZAv6SX%Xy!@GIO+$L2&&gezW^RH)!N0993@IE~gtsteu-Le->XB8Qtxe>L$_5zC36 z2;Eqsdm*kR`q}uuhTrEc;xVP( zb{b;+20*sAD7_6fFi@lHZ{g4Jh6~|WeNH;XnEuHs{Z(M<-2OcZqhsNkkIQ~9-LxGo zv%O4DpSHy&Nt*cyjGR8bpUPw-?^U$J2kEBH>M(g^ZrC>SPCG`N`S58Xh>qH&t*tLLFTNS4drnRglOS zD?o7(+<#1J@3v9~$ZA!VSS6K~U_XGWN-{KUt)zofK=|Fg#}y2g=?c9FwU)grJ~p&p z3j527l7WJ^!dJojAdBR?*m!U{Rf_OaWZe3m5oaGFEt!l486axh`=Vs&l3>|8^FuxJs;u{1b>AodQJFASOaPpr^nd;3>KT4#s2G zd-#k{^a%W1nX*T~k9P2?@sET*+gq~3eYLu{`a7UOMl}?t_Eb_XR91`tts^tcLp3yu zW+nr@$}R4dSNS{|zo|TTA=uHC=P9WSPv}#6{l{kJ#zS_a^XQ|^mDIpACmSPvM=8t;}@Y!K(aCY zitWidN+%nio7PEO2@lr58q zcmhND5V7pe8L>G<@k14&x5`$x44tj;>zE(N=2(?s9wXn8c8lx-BRIt!1CwJLE@`~Y z?0{2t?!WtVc4lHu(#>trw{!1}=+Hu)5n#0rfcO)}+ei;^)5-rW&Wp%mAdY)Z-(!kb zp$s?TvNvRy4qYeZ9k#Zv?xw!EQRd2iR#pNpQ9*gkFW%XsX43Kpin0R3+Ex|PaRbeqWZT6*<4!!`w?_S-{)WA0I zTlThuTD}?6KADFPG9JQA24PhmN+@c7EVKKGR3_Ru3@z6iESTPQd=-1aJeRiZI-L=#Ka*y2ITNrKikSQ3KC#l$PDmS1}&$X>?clDi*-Kl@c|ZJn%ZKCN78TDR%rZDT+OvG2 zQ77p3_b6s+sqJqJNVLCV+#1}s`)i98X2~$BvGG~&=*Bik223nTi3H@6VK9m?$t5{V z%4gjTB3_V6N$_=msvr-$GX^w^?uK7AHfm$Rs?a$nVRos8y(J{<xcG)%O2Xy zv?q^@DzX9SyJSW-qY91g0FvJy=)^dxR=>h!fLSTr0|SbpgKAMsxa>vE&Vb#Zp?EgD za!+Y#3|bE89!f_l|bc|)r|>g_*S4>sOIKoX0oKRT>Kf(-^tu+m`ECG@XPN0fqA{E;F9}R z_cSvLUfNP4z(jG`PsF29M*zaN0RERd@c7*5LAdHr7WU=@A^C_RLSAIoXAiKN$12{H zH2h%L((fcA2&+M-jp!IhAC&HIu3gv{$mh67E>d>a-03NTOOvTuxKSu?Ky-RoXh zn>+I$TnU+%I(6pzAcu2s+4ows22$@=!DB1rBGd^)w%x8-Q4t*SIipiEIRPt&zc-R$ zcZT2RE$QSQscjv#>wws6o$|iJps;)t{ypVq;NM#w#lKyC6aJm@hwz_P{wn^{%Rj-t zuY4c=Gel^2gEo3>-!sAJOCW<@@28P5qw{SP8lBQ2QaS3>B&#d=$e2+{wNIjQeJwBz zWhNpwfKMn39qJ{Z31y+<{u$_b?vX*c(F&wA#rEf_^i2ShQV|ssxfo1BS*Vn#iue?$ zl(JBPckvBYHrm!bHl%itv4)_L2T3Tc0C~ogmYR zlN&qXJI)f~8(dKc>d`A!N?K4>NGzR9(A8P3BM7S`p*qhVLCc0$kBe1jzI}xBs!2`c zT@VRLQxllQxa?Irm$TRbc`Is>j1l=;|WrrKKZ%|JJj*_q0`0dy~!uTq&mfQHWm^IZxPX%F-y zGJ9!+z{Bj2M4OV~2w;WM=F)V(dBPXKhPUFfv%S4wb*A{8M%?uh@kUTzkk0j*#7bI( z_XBOVx-K`GH%ExExa?Bz0Hr~$A_snk0YupWGPdO{KOYXOd^!HT*`uWm%z6c zm)$p(%rBV>5xyPhD`aY7M|?H&9#N>Xhov$hptWR1rZQuI&L`6pJ0eMKQAD&9@ZU&H zOrk8D11(;_2CHV!+_F4+2K_qFk z;2y}oK=u6Ey`iyN_aFTL+i|gMIm+y~A1Kp4f3gtk>HUS?%E^fH5WMo&>jU?2V`20+ zGRv9nKAt6TUUf!aOixyg5`5`ZtVanHSf|C_5Y5U0z_%Z*S!|TDM-PsGpA$Z7QE4&$ zEsuVqaUt+KDSKWL-j_-d+VWRS5Dw~1zeVm%qq{`Sd%u@|rxIw5?JW~GE1tMBRpJKp z^f9Tk`Mz59@<}KI9i+$vojt%0iLCp)tzm&~9x5ET6^VNmQOC|T9A6HZ1+bXayTcM} zrrR&cl~O6V|E~p&T+QD*VGor$u16%67`Ph|lwndKkN7xyqr$oO7$x5ifWgM@V+-z5#AEL34eX)o`phoghK zK(4wGY5GWq+@tT-1%polY@L8WLr#MWXR6Y^S6YYad-X@NP%l$a>%svO5NB3~!-JF8 zAp8leL0OrOu0lhdQ8?(Qb@bDB(8H!c%$||W6DW@$SY2O4Yvj7SpEmXAxe>KFvz~jl z??FHeUpoSCV!>fudK?=@<~a7|Ka;9|ydGyqwet1u@UdMQucB?u>64?%Ku%W%`b*GN z|982XlUm9mcynx5IcQ65gINxvwj&*w>rh=o4Kws@HfKx?!|2{6-D2QlV7=o~lk-1P z0qPvjjmX3HQn2Fx6fDw`e?a9(NXn$#PffkgaBmzpAbJM$Wj3*?^^Ds{)Knm+u_H2Z zYlxapVZzvZkZb{%0y4B1I2p{4X*!B_Dhkq1$tks@XC6hP{V2ZXekhRZ4-*4-DcyY=32WFw;KXWowLqF zD`^0U~*EXz3;-rp&FE*^g@=St%}&r=$-oNM9rHiA80 zek|c`6E=!>{ViubylAaa5x59%_*>4C@K;j$VozyL%h?ETFM2QWln$_*m*C~M4g!~Y zN>8wyUGQE@?`59SQI@kGUK!Jsp3?D_^Ao)HkzMX7J>7B~WKHH_g{O3$e4QOmiORnK1a?LUUy%fc#QSC zyL;lG=v-EZG4ia682AcGdDA>yc(N8K?B6L^Zxr&c29qO$sGSaM2>a@U##Q@A2TYS= z;Bm5Eea^1wS$RwcZH=3q9p|G4n$u@T*Fa9RL_Ya}ls@UNq}^XnDwadhW3pur{HDDS zA1;7ub5u~O{s&3jj@5`txvaDPt6a@D-Lz#kO8qt5_K_+#tN4Ol(ar}zkpy3hgVRzl zn(q>WDf9IYW8A#rJ7g5U`FqsejGK!%ZZ>($xVc1)U?)`P;F0a`I?TV+9fvNLR(CoY z7uIRji!c{4;xFr9fFHvnW-9Ed9Qwwe!1ndobzl8CE>qm(ao0|6o$<9+zSn(razU}s zxoNHMo?+E_&|%<~?t#h0QRB0ZPwk-s||D(gK6VdCko zDeLSZWAXMI=O}V)^sG8za2DjOd@o)uSA%1w><@bp80Ow`a^YVLr|kFtdN>`0UCCcr zkIa!zSr6V|Jy6|oD@zSg6pSqVzXYR7vi7)+sG3ZxR3+PwsBtV^#RgJ!@A=4>XOJ9{ zY9pZf#N;I}8t>(jn^e$I*2(^JAZ6xe+v9UIPHQ|1IIWo$b+A;(IfQ2cS4ri3&2yHX zIgS4SF_h_Wz4YC)c>F7XM``bP11}YgWxY-O@5=aVXQ7+f#Z)F+N)E`XWkx?|etPo3 z!2W_0m!311!1*7!>QlP_87f8LH+V+)bJ>|EHmNN+&ZFOdquQM0R2W3b}Tl>PQaiyES$i#7<&UkadG2 z#rPwLv|bA|=(}ge_^HtovGkz*6Aga)Ak3LWkA>QQy}s9X8;8@BDWGT8TS>7om$K;_ z!OM--kpmKnZyv<>faKOpZxJ=3OSNdMUoc@!3OuS`Fz^Z^FZ%_&$NNL95v-Edn|Lhp z;n7kx`fiQA8kvsU=S{W)X`l=(5zu$f`0=kpG*^3z41A(!Tpf!^HMdEVQA8J_h`usy zLJM1Ce>Jhm61@SD)i+JVVw4s3h^VZN$Trw3<-YsO>&zlZfn4R85@3{{A@-rkUngkn z#|Rv^=MyN}K`UYSK~wN24I9v+dHU|@GKk+17(WGrRo;G`{~|+nt)|r@+S|^+-Q<{H z;8G3Sw`Ys->+A4Nv(qP+z6JH3mMmj%~rf{Q%4OZM?QMz83-*!8#M5irJL8 ze;>KOM8js$#2WklNr}1t4!N%nK+n}$aJA9X`3MAMVaR4_jYiSYrhB7MYm8~sTVp#y zhblWI-Xt2Yfo|3O2^eb5pczI++octs-Y^B}4#g_eEf> zc3kx79bXQTUA$WR=^0-Y5>u?~P6#!{9X=!5YUxgz(W#r66q&^ZOpZoDqjw&k?=Qf} zUBzzSJD(p1+5&IyrVY={IOO=v!p#$o`+_%b!?xL1c&uF;CeI7n{^qnXe&O%j?-#Xd zZKhv0XxI`>#yQkozp&76W=Y-mxGk2o%Ft6TA;}J(=ukt1sdr+s0B3})GHm4?`hDE9kjQ%zFT5c+!)F=PgCc9?>@Y+ zRmLUSd#&4VN$ZZcY2Sl?9e%y0*30CD%&aC)_g|J6W1O@0GKP@p0Zku^LN?Cd_cBkX znnA&I`H(P9)6M@$M$AxaMpA?_&e^8F7o*K^cD*})X<Nt+?Xbk~i#yFGiq zq|M0l|3l}yo6<5iJoLltv<=0-eCM3XuNGp|6643IYRymo(f`eG<>v-7{g-1x#2@z* z@jNG*H3@MHF8(-Wqzp0sxZXqmaazY8?))PWtHE7$BtOdSy+nOHqD%i9T2^+v@Grp> zkv}eWlYa@LA%9#br+)=TbpE(0Kz|e~4E*suHu~4<{P6o`^xuqe3ctaEy*mLD0mcgH ze?=?Yi-C(7{0{V?uZAOFKaXKJy-tt2Nxpy0 z3s$7X7On4Nt#8em{Z^4xxAu11YFWaaVJ6U9PX%h1IMLs0?Lf;a>dH6h2+!7r<3bz# z#_0S`CH+Hm!L?j_HG)OC6GGTT%@-i)U!&D<&c#gmF#X|-jz4}AlQIjCQU3UuJNoM| zBJ#)0T!#5OY~D;8f-`%{?9_(funhk&VeI@7ND7qW;*Z~`q~BBo?taj}Ml0av4*jMK z7OkD{u_9f$qeZw$$9p8DKJ!y{iTw7pFLFqnlsO<2^?+2npWWzN*9 zIa8wlNmJH3DpS_{Iw*N#aqfwy>f{~`ux4TlvSn;DVeM2e(o~5wB*w>iDgDprV&JQV z)ORA%7(pfBZ=SY_ss8->Aj6oV;q0CMPjsHREl9s^4(ibiek4cDSmh=Z0MowsEmQ_D zWzXaN^qc;H4}bLcMWXooKqqLEZohn|l)Pz=JOIN?BsLlzEwV&sRe`94r)Vhj0F?e) z*WXDxcmDY1CH*_wNUtb; za=v3dZ%28In7BNQER_lQJsUt=%JV4bxYYptwan-_>^sl?=7JG_IBkLjO)U{uCqJ#BHv&qjYu zXh-juetyh>5YNEtgmGP+(Bmj@9pflgWnw&2sm1ta1tIxGul%}#($C!mN^y5WR|1~NCbS`L9-cHLbR%k~R?qj^39XKn#A+-*Q%&p!T)ISf zMw`&yxUxLmC34GBD?1;_rqsj^F-U&t01&^*pr!cHS4!~({1UZ}lBZS)aiLX9P0_aCnKlh^Cx=qp5Yhp8Se;P&9x;fY0wJ`SFQ@8| z@|}2KT$R=k&(2fqgSh$mEpS42;?hzxVNgQN;ue!H(*ybijY~_(Z*>9USH(2MgDE(* zgH8E(hrv_!gd*|8^5l+`LVu@2ewC>pei=$b{CEeY_*D)KHR$Aj5l_AsX`~d-HcKhw zp9gM;k<%vQD>8)ml89EulQ@KUm__`gLb NaQ>46yIJeA{ue$SX#fBK diff --git a/node_modules/node-inspector/node_modules/ws/build/Release/validation.node b/node_modules/node-inspector/node_modules/ws/build/Release/validation.node index 8fa3a2df125eccdf7ecb481e5caf1d0f0fccb7b2..595c94c3bd7c12149dc7d86f78a24da099b5e23c 100755 GIT binary patch delta 1339 zcmajfO=uHA6ae5in?%zjTBB&A!D_TvsbWZzVAG=OB3J~qr3gYrv}jE#8YL(SR`Y`( zieO+a#e%4KvX_Ps5uwn6ry_b0trrFHpa(6Hf`3tbv-7sy%*BP7-S55Gc{8&lw~DNG zn~nE6wOSMJbGETv{EG8%v~+c@^<#fxh{iK6|_UX?-5n|Z3VRx-j2%sCETWmhU zOA(!Acr~K?FHsJb%dz9!XxBs26unE)s(4!tF#E0ie!K1;!bOUCudk4)H@u2bH?CJi zXDHgiji}Df@jUhwK85`>XEB|<=SED|emi&}wv(;qQy7YJ7T4K+Zp6bz(h0B$Tkje< zdBJi}dIY^*KAQcQ;t5`gugkv1XfrM*MMp799wuupfTb9-s;sq4RifxdeBV0Cy{2V3IsQ1gpPVP(X_EO-a*~ z;)jYqDE_55fPWnJ4V;;G(yRv$<^$4?6@OLiUQ$2d2GcpLA+I*Yk#Z#QgawUs^1|tX hOn5-vd(wM`GK1j*XU`8F;tgGw|C8@5zw6rU`v=QqwP*kU delta 1356 zcmajfO=uHA6ae5i$*$TYwI-qlh1zOSFxrwd@h`T^T2b(n8lm_Hji^aMqsB;7B8f#1 zNuYtb1uQ7!A}W?p5Iv*?#fx|4C1)U<|Lm8 zYAny^gPM1ga^MqlpL0E=b==P~MYis&pw z_jA2hV>kFM>>GR<`x(x{8vDxiu;x$|J{s<4oB1?``Z$YdY>4ZT9{sWcumxLey;!_# zd4uo+bcYz4{iNjAd?K>3@Cl>sxWyDbiUo3>>`?($V$7q2*Z6U4%-fSl}3WikvZwCw}7<`DUNPa8%<3F4A!Rc-;5R^P3`HAFj zk`?@;uy1&i$4^Yi%yD-E diff --git a/node_modules/passport-local/lib/index.js b/node_modules/passport-local/lib/index.js new file mode 100644 index 0000000..a6fdfa7 --- /dev/null +++ b/node_modules/passport-local/lib/index.js @@ -0,0 +1,15 @@ +/** + * Module dependencies. + */ +var Strategy = require('./strategy'); + + +/** + * Expose `Strategy` directly from package. + */ +exports = module.exports = Strategy; + +/** + * Export constructors. + */ +exports.Strategy = Strategy; diff --git a/node_modules/passport-local/lib/strategy.js b/node_modules/passport-local/lib/strategy.js new file mode 100644 index 0000000..e54e92a --- /dev/null +++ b/node_modules/passport-local/lib/strategy.js @@ -0,0 +1,101 @@ +/** + * Module dependencies. + */ +var passport = require('passport-strategy') + , util = require('util') + , lookup = require('./utils').lookup; + + +/** + * `Strategy` constructor. + * + * The local authentication strategy authenticates requests based on the + * credentials submitted through an HTML-based login form. + * + * Applications must supply a `verify` callback which accepts `username` and + * `password` credentials, and then calls the `done` callback supplying a + * `user`, which should be set to `false` if the credentials are not valid. + * If an exception occured, `err` should be set. + * + * Optionally, `options` can be used to change the fields in which the + * credentials are found. + * + * Options: + * - `usernameField` field name where the username is found, defaults to _username_ + * - `passwordField` field name where the password is found, defaults to _password_ + * - `passReqToCallback` when `true`, `req` is the first argument to the verify callback (default: `false`) + * + * Examples: + * + * passport.use(new LocalStrategy( + * function(username, password, done) { + * User.findOne({ username: username, password: password }, function (err, user) { + * done(err, user); + * }); + * } + * )); + * + * @param {Object} options + * @param {Function} verify + * @api public + */ +function Strategy(options, verify) { + if (typeof options == 'function') { + verify = options; + options = {}; + } + if (!verify) { throw new TypeError('LocalStrategy requires a verify callback'); } + + this._usernameField = options.usernameField || 'username'; + this._passwordField = options.passwordField || 'password'; + + passport.Strategy.call(this); + this.name = 'local'; + this._verify = verify; + this._passReqToCallback = options.passReqToCallback; +} + +/** + * Inherit from `passport.Strategy`. + */ +util.inherits(Strategy, passport.Strategy); + +/** + * Authenticate request based on the contents of a form submission. + * + * @param {Object} req + * @api protected + */ +Strategy.prototype.authenticate = function(req, options) { + options = options || {}; + var username = lookup(req.body, this._usernameField) || lookup(req.query, this._usernameField); + var password = lookup(req.body, this._passwordField) || lookup(req.query, this._passwordField); + + if (!username || !password) { + return this.fail({ message: options.badRequestMessage || 'Missing credentials' }, 400); + } + + var self = this; + + function verified(err, user, info) { + if (err) { return self.error(err); } + if (!user) { return self.fail(info); } + self.success(user, info); + } + + try { + if (self._passReqToCallback) { + this._verify(req, username, password, verified); + } else { + this._verify(username, password, verified); + } + } catch (ex) { + return self.error(ex); + } +}; + + +/** + * Expose `Strategy`. + */ +module.exports = Strategy; diff --git a/node_modules/passport-local/lib/utils.js b/node_modules/passport-local/lib/utils.js new file mode 100644 index 0000000..38f10a4 --- /dev/null +++ b/node_modules/passport-local/lib/utils.js @@ -0,0 +1,11 @@ +exports.lookup = function(obj, field) { + if (!obj) { return null; } + var chain = field.split(']').join('').split('['); + for (var i = 0, len = chain.length; i < len; i++) { + var prop = obj[chain[i]]; + if (typeof(prop) === 'undefined') { return null; } + if (typeof(prop) !== 'object') { return prop; } + obj = prop; + } + return null; +}; diff --git a/node_modules/passport-local/node_modules/passport-strategy/.jshintrc b/node_modules/passport-local/node_modules/passport-strategy/.jshintrc new file mode 100644 index 0000000..a07354b --- /dev/null +++ b/node_modules/passport-local/node_modules/passport-strategy/.jshintrc @@ -0,0 +1,20 @@ +{ + "node": true, + + "bitwise": true, + "camelcase": true, + "curly": true, + "forin": true, + "immed": true, + "latedef": true, + "newcap": true, + "noarg": true, + "noempty": true, + "nonew": true, + "quotmark": "single", + "undef": true, + "unused": true, + "trailing": true, + + "laxcomma": true +} diff --git a/node_modules/passport-local/node_modules/passport-strategy/.travis.yml b/node_modules/passport-local/node_modules/passport-strategy/.travis.yml new file mode 100644 index 0000000..45f8624 --- /dev/null +++ b/node_modules/passport-local/node_modules/passport-strategy/.travis.yml @@ -0,0 +1,15 @@ +language: "node_js" +node_js: + - "0.4" + - "0.6" + - "0.8" + - "0.10" + +before_install: + - "npm install istanbul -g" + - "npm install coveralls -g" + +script: "make ci-travis" + +after_success: + - "make submit-coverage-to-coveralls" diff --git a/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/readline2/LICENSE-MIT b/node_modules/passport-local/node_modules/passport-strategy/LICENSE similarity index 94% rename from node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/readline2/LICENSE-MIT rename to node_modules/passport-local/node_modules/passport-strategy/LICENSE index 67df21c..ec885b5 100644 --- a/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/readline2/LICENSE-MIT +++ b/node_modules/passport-local/node_modules/passport-strategy/LICENSE @@ -1,6 +1,6 @@ -The MIT License (MIT) +(The MIT License) -Copyright (c) 2014 Simon Boudrias +Copyright (c) 2011-2013 Jared Hanson Permission 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/node_modules/passport-local/node_modules/passport-strategy/README.md b/node_modules/passport-local/node_modules/passport-strategy/README.md new file mode 100644 index 0000000..71de07f --- /dev/null +++ b/node_modules/passport-local/node_modules/passport-strategy/README.md @@ -0,0 +1,61 @@ +# passport-strategy + +[![Build](https://travis-ci.org/jaredhanson/passport-strategy.png)](http://travis-ci.org/jaredhanson/passport-strategy) +[![Coverage](https://coveralls.io/repos/jaredhanson/passport-strategy/badge.png)](https://coveralls.io/r/jaredhanson/passport-strategy) +[![Dependencies](https://david-dm.org/jaredhanson/passport-strategy.png)](http://david-dm.org/jaredhanson/passport-strategy) + + +An abstract class implementing [Passport](http://passportjs.org/)'s strategy +API. + +## Install + + $ npm install passport-strategy + +## Usage + +This module exports an abstract `Strategy` class that is intended to be +subclassed when implementing concrete authentication strategies. Once +implemented, such strategies can be used by applications that utilize Passport +middleware for authentication. + +#### Subclass Strategy + +Create a new `CustomStrategy` constructor which inherits from `Strategy`: + +```javascript +var util = require('util') + , Strategy = require('passport-strategy'); + +function CustomStrategy(...) { + Strategy.call(this); +} + +util.inherits(CustomStrategy, Strategy); +``` + +#### Implement Authentication + +Implement `autheticate()`, performing the necessary operations required by the +authentication scheme or protocol being implemented. + +```javascript +CustomStrategy.prototype.authenticate = function(req, options) { + // TODO: authenticate request +} +``` + +## Tests + + $ npm install + $ npm test + +## Credits + + - [Jared Hanson](http://github.com/jaredhanson) + +## License + +[The MIT License](http://opensource.org/licenses/MIT) + +Copyright (c) 2011-2013 Jared Hanson <[http://jaredhanson.net/](http://jaredhanson.net/)> diff --git a/node_modules/passport-local/node_modules/passport-strategy/lib/index.js b/node_modules/passport-local/node_modules/passport-strategy/lib/index.js new file mode 100644 index 0000000..a6fdfa7 --- /dev/null +++ b/node_modules/passport-local/node_modules/passport-strategy/lib/index.js @@ -0,0 +1,15 @@ +/** + * Module dependencies. + */ +var Strategy = require('./strategy'); + + +/** + * Expose `Strategy` directly from package. + */ +exports = module.exports = Strategy; + +/** + * Export constructors. + */ +exports.Strategy = Strategy; diff --git a/node_modules/passport-local/node_modules/passport-strategy/lib/strategy.js b/node_modules/passport-local/node_modules/passport-strategy/lib/strategy.js new file mode 100644 index 0000000..5a7eb28 --- /dev/null +++ b/node_modules/passport-local/node_modules/passport-strategy/lib/strategy.js @@ -0,0 +1,28 @@ +/** + * Creates an instance of `Strategy`. + * + * @constructor + * @api public + */ +function Strategy() { +} + +/** + * Authenticate request. + * + * This function must be overridden by subclasses. In abstract form, it always + * throws an exception. + * + * @param {Object} req The request to authenticate. + * @param {Object} [options] Strategy-specific options. + * @api public + */ +Strategy.prototype.authenticate = function(req, options) { + throw new Error('Strategy#authenticate must be overridden by subclass'); +}; + + +/** + * Expose `Strategy`. + */ +module.exports = Strategy; diff --git a/node_modules/passport-local/node_modules/passport-strategy/package.json b/node_modules/passport-local/node_modules/passport-strategy/package.json new file mode 100644 index 0000000..fa34bbc --- /dev/null +++ b/node_modules/passport-local/node_modules/passport-strategy/package.json @@ -0,0 +1,72 @@ +{ + "name": "passport-strategy", + "version": "1.0.0", + "description": "An abstract class implementing Passport's strategy API.", + "keywords": [ + "passport", + "strategy" + ], + "repository": { + "type": "git", + "url": "git://github.com/jaredhanson/passport-strategy.git" + }, + "bugs": { + "url": "http://github.com/jaredhanson/passport-strategy/issues" + }, + "author": { + "name": "Jared Hanson", + "email": "jaredhanson@gmail.com", + "url": "http://www.jaredhanson.net/" + }, + "licenses": [ + { + "type": "MIT", + "url": "http://www.opensource.org/licenses/MIT" + } + ], + "main": "./lib", + "dependencies": {}, + "devDependencies": { + "mocha": "1.x.x", + "chai": "1.x.x" + }, + "engines": { + "node": ">= 0.4.0" + }, + "scripts": { + "test": "mocha --reporter spec --require test/bootstrap/node test/*.test.js" + }, + "testling": { + "browsers": [ + "chrome/latest" + ], + "harness": "mocha", + "files": [ + "test/bootstrap/testling.js", + "test/*.test.js" + ] + }, + "readme": "# passport-strategy\n\n[![Build](https://travis-ci.org/jaredhanson/passport-strategy.png)](http://travis-ci.org/jaredhanson/passport-strategy)\n[![Coverage](https://coveralls.io/repos/jaredhanson/passport-strategy/badge.png)](https://coveralls.io/r/jaredhanson/passport-strategy)\n[![Dependencies](https://david-dm.org/jaredhanson/passport-strategy.png)](http://david-dm.org/jaredhanson/passport-strategy)\n\n\nAn abstract class implementing [Passport](http://passportjs.org/)'s strategy\nAPI.\n\n## Install\n\n $ npm install passport-strategy\n\n## Usage\n\nThis module exports an abstract `Strategy` class that is intended to be\nsubclassed when implementing concrete authentication strategies. Once\nimplemented, such strategies can be used by applications that utilize Passport\nmiddleware for authentication.\n\n#### Subclass Strategy\n\nCreate a new `CustomStrategy` constructor which inherits from `Strategy`:\n\n```javascript\nvar util = require('util')\n , Strategy = require('passport-strategy');\n\nfunction CustomStrategy(...) {\n Strategy.call(this);\n}\n\nutil.inherits(CustomStrategy, Strategy);\n```\n\n#### Implement Authentication\n\nImplement `autheticate()`, performing the necessary operations required by the\nauthentication scheme or protocol being implemented.\n\n```javascript\nCustomStrategy.prototype.authenticate = function(req, options) {\n // TODO: authenticate request\n}\n```\n\n## Tests\n\n $ npm install\n $ npm test\n\n## Credits\n\n - [Jared Hanson](http://github.com/jaredhanson)\n\n## License\n\n[The MIT License](http://opensource.org/licenses/MIT)\n\nCopyright (c) 2011-2013 Jared Hanson <[http://jaredhanson.net/](http://jaredhanson.net/)>\n", + "readmeFilename": "README.md", + "_id": "passport-strategy@1.0.0", + "dist": { + "shasum": "b5539aa8fc225a3d1ad179476ddf236b440f52e4", + "tarball": "http://registry.npmjs.org/passport-strategy/-/passport-strategy-1.0.0.tgz" + }, + "_from": "passport-strategy@1.x.x", + "_npmVersion": "1.2.25", + "_npmUser": { + "name": "jaredhanson", + "email": "jaredhanson@gmail.com" + }, + "maintainers": [ + { + "name": "jaredhanson", + "email": "jaredhanson@gmail.com" + } + ], + "directories": {}, + "_shasum": "b5539aa8fc225a3d1ad179476ddf236b440f52e4", + "_resolved": "https://registry.npmjs.org/passport-strategy/-/passport-strategy-1.0.0.tgz", + "homepage": "https://github.com/jaredhanson/passport-strategy" +} diff --git a/node_modules/passport-local/package.json b/node_modules/passport-local/package.json new file mode 100644 index 0000000..dd6f1f5 --- /dev/null +++ b/node_modules/passport-local/package.json @@ -0,0 +1,67 @@ +{ + "name": "passport-local", + "version": "1.0.0", + "description": "Local username and password authentication strategy for Passport.", + "keywords": [ + "passport", + "local", + "auth", + "authn", + "authentication", + "username", + "password" + ], + "author": { + "name": "Jared Hanson", + "email": "jaredhanson@gmail.com", + "url": "http://www.jaredhanson.net/" + }, + "repository": { + "type": "git", + "url": "git://github.com/jaredhanson/passport-local.git" + }, + "bugs": { + "url": "http://github.com/jaredhanson/passport-local/issues" + }, + "licenses": [ + { + "type": "MIT", + "url": "http://www.opensource.org/licenses/MIT" + } + ], + "main": "./lib", + "dependencies": { + "passport-strategy": "1.x.x" + }, + "devDependencies": { + "mocha": "1.x.x", + "chai": "1.x.x", + "chai-passport-strategy": "0.1.x" + }, + "engines": { + "node": ">= 0.4.0" + }, + "scripts": { + "test": "node_modules/.bin/mocha --reporter spec --require test/bootstrap/node test/*.test.js" + }, + "_id": "passport-local@1.0.0", + "dist": { + "shasum": "1fe63268c92e75606626437e3b906662c15ba6ee", + "tarball": "http://registry.npmjs.org/passport-local/-/passport-local-1.0.0.tgz" + }, + "_from": "passport-local@", + "_npmVersion": "1.2.25", + "_npmUser": { + "name": "jaredhanson", + "email": "jaredhanson@gmail.com" + }, + "maintainers": [ + { + "name": "jaredhanson", + "email": "jaredhanson@gmail.com" + } + ], + "directories": {}, + "_shasum": "1fe63268c92e75606626437e3b906662c15ba6ee", + "_resolved": "https://registry.npmjs.org/passport-local/-/passport-local-1.0.0.tgz" +} diff --git a/node_modules/sequelize/node_modules/.bin/uuid b/node_modules/sequelize/node_modules/.bin/uuid new file mode 120000 index 0000000..80eb14a --- /dev/null +++ b/node_modules/sequelize/node_modules/.bin/uuid @@ -0,0 +1 @@ +../node-uuid/bin/uuid \ No newline at end of file diff --git a/node_modules/sequelize/node_modules/node-uuid/LICENSE.md b/node_modules/sequelize/node_modules/node-uuid/LICENSE.md index f039427..652609b 100644 --- a/node_modules/sequelize/node_modules/node-uuid/LICENSE.md +++ b/node_modules/sequelize/node_modules/node-uuid/LICENSE.md @@ -1,2 +1,21 @@ -Copyright (c) 2010-2012 Robert Kieffer -MIT License - http://opensource.org/licenses/mit-license.php +The MIT License (MIT) + +Copyright (c) 2010-2012 Robert Kieffer + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/node_modules/sequelize/node_modules/node-uuid/README.md b/node_modules/sequelize/node_modules/node-uuid/README.md index e436a89..b7d04c9 100644 --- a/node_modules/sequelize/node_modules/node-uuid/README.md +++ b/node_modules/sequelize/node_modules/node-uuid/README.md @@ -10,6 +10,7 @@ Features: * Cryptographically strong random # generation on supporting platforms * 1.1K minified and gzip'ed (Want something smaller? Check this [crazy shit](https://gist.github.com/982883) out! ) * [Annotated source code](http://broofa.github.com/node-uuid/docs/uuid.html) +* Comes with a Command Line Interface for generating uuids on the command line ## Getting Started @@ -160,13 +161,48 @@ uuid() has become uuid.v4(), and the `format` argument is now implicit in the `b The class of container created when generating binary uuid data if no buffer argument is specified. This is expected to go away, with no replacement API. +## Command Line Interface + +To use the executable, it's probably best to install this library globally. + +`npm install -g node-uuid` + +Usage: + +``` +USAGE: uuid [version] [options] + + +options: + +--help Display this message and exit +``` + +`version` must be an RFC4122 version that is supported by this library, which is currently version 1 and version 4 (denoted by "v1" and "v4", respectively). `version` defaults to version 4 when not supplied. + +### Examples + +``` +> uuid +3a91f950-dec8-4688-ba14-5b7bbfc7a563 +``` + +``` +> uuid v1 +9d0b43e0-7696-11e3-964b-250efa37a98e +``` + +``` +> uuid v4 +6790ac7c-24ac-4f98-8464-42f6d98a53ae +``` + ## Testing In node.js ``` -> cd test -> node test.js +npm test ``` In Browser diff --git a/node_modules/sequelize/node_modules/node-uuid/bin/uuid b/node_modules/sequelize/node_modules/node-uuid/bin/uuid new file mode 100755 index 0000000..f732e99 --- /dev/null +++ b/node_modules/sequelize/node_modules/node-uuid/bin/uuid @@ -0,0 +1,26 @@ +#!/usr/bin/env node + +var path = require('path'); +var uuid = require(path.join(__dirname, '..')); + +var arg = process.argv[2]; + +if ('--help' === arg) { + console.log('\n USAGE: uuid [version] [options]\n\n'); + console.log(' options:\n'); + console.log(' --help Display this message and exit\n'); + process.exit(0); +} + +if (null == arg) { + console.log(uuid()); + process.exit(0); +} + +if ('v1' !== arg && 'v4' !== arg) { + console.error('Version must be RFC4122 version 1 or version 4, denoted as "v1" or "v4"'); + process.exit(1); +} + +console.log(uuid[arg]()); +process.exit(0); diff --git a/node_modules/sequelize/node_modules/node-uuid/bower.json b/node_modules/sequelize/node_modules/node-uuid/bower.json new file mode 100644 index 0000000..1656dc8 --- /dev/null +++ b/node_modules/sequelize/node_modules/node-uuid/bower.json @@ -0,0 +1,23 @@ +{ + "name": "node-uuid", + "version": "1.4.3", + "homepage": "https://github.com/broofa/node-uuid", + "authors": [ + "Robert Kieffer " + ], + "description": "Rigorous implementation of RFC4122 (v1 and v4) UUIDs.", + "main": "uuid.js", + "keywords": [ + "uuid", + "gid", + "rfc4122" + ], + "license": "MIT", + "ignore": [ + "**/.*", + "node_modules", + "bower_components", + "test", + "tests" + ] +} diff --git a/node_modules/sequelize/node_modules/node-uuid/component.json b/node_modules/sequelize/node_modules/node-uuid/component.json index ace2134..149f84b 100644 --- a/node_modules/sequelize/node_modules/node-uuid/component.json +++ b/node_modules/sequelize/node_modules/node-uuid/component.json @@ -2,7 +2,7 @@ "name": "node-uuid", "repo": "broofa/node-uuid", "description": "Rigorous implementation of RFC4122 (v1 and v4) UUIDs.", - "version": "1.4.0", + "version": "1.4.3", "author": "Robert Kieffer ", "contributors": [ {"name": "Christoph Tavan ", "github": "https://github.com/ctavan"} @@ -15,4 +15,4 @@ "uuid.js" ], "license": "MIT" -} \ No newline at end of file +} diff --git a/node_modules/sequelize/node_modules/node-uuid/package.json b/node_modules/sequelize/node_modules/node-uuid/package.json index 3426d08..e0ba842 100644 --- a/node_modules/sequelize/node_modules/node-uuid/package.json +++ b/node_modules/sequelize/node_modules/node-uuid/package.json @@ -17,25 +17,34 @@ "email": "dev@tavan.de" } ], + "bin": { + "uuid": "./bin/uuid" + }, + "scripts": { + "test": "node test/test.js" + }, "lib": ".", "main": "./uuid.js", "repository": { "type": "git", "url": "https://github.com/broofa/node-uuid.git" }, - "version": "1.4.1", - "readme": "# node-uuid\n\nSimple, fast generation of [RFC4122](http://www.ietf.org/rfc/rfc4122.txt) UUIDS.\n\nFeatures:\n\n* Generate RFC4122 version 1 or version 4 UUIDs\n* Runs in node.js and all browsers.\n* Registered as a [ComponentJS](https://github.com/component/component) [component](https://github.com/component/component/wiki/Components) ('broofa/node-uuid').\n* Cryptographically strong random # generation on supporting platforms\n* 1.1K minified and gzip'ed (Want something smaller? Check this [crazy shit](https://gist.github.com/982883) out! )\n* [Annotated source code](http://broofa.github.com/node-uuid/docs/uuid.html)\n\n## Getting Started\n\nInstall it in your browser:\n\n```html\n\n```\n\nOr in node.js:\n\n```\nnpm install node-uuid\n```\n\n```javascript\nvar uuid = require('node-uuid');\n```\n\nThen create some ids ...\n\n```javascript\n// Generate a v1 (time-based) id\nuuid.v1(); // -> '6c84fb90-12c4-11e1-840d-7b25c5ee775a'\n\n// Generate a v4 (random) id\nuuid.v4(); // -> '110ec58a-a0f2-4ac4-8393-c866d813b8d1'\n```\n\n## API\n\n### uuid.v1([`options` [, `buffer` [, `offset`]]])\n\nGenerate and return a RFC4122 v1 (timestamp-based) UUID.\n\n* `options` - (Object) Optional uuid state to apply. Properties may include:\n\n * `node` - (Array) Node id as Array of 6 bytes (per 4.1.6). Default: Randomly generated ID. See note 1.\n * `clockseq` - (Number between 0 - 0x3fff) RFC clock sequence. Default: An internally maintained clockseq is used.\n * `msecs` - (Number | Date) Time in milliseconds since unix Epoch. Default: The current time is used.\n * `nsecs` - (Number between 0-9999) additional time, in 100-nanosecond units. Ignored if `msecs` is unspecified. Default: internal uuid counter is used, as per 4.2.1.2.\n\n* `buffer` - (Array | Buffer) Array or buffer where UUID bytes are to be written.\n* `offset` - (Number) Starting index in `buffer` at which to begin writing.\n\nReturns `buffer`, if specified, otherwise the string form of the UUID\n\nNotes:\n\n1. The randomly generated node id is only guaranteed to stay constant for the lifetime of the current JS runtime. (Future versions of this module may use persistent storage mechanisms to extend this guarantee.)\n\nExample: Generate string UUID with fully-specified options\n\n```javascript\nuuid.v1({\n node: [0x01, 0x23, 0x45, 0x67, 0x89, 0xab],\n clockseq: 0x1234,\n msecs: new Date('2011-11-01').getTime(),\n nsecs: 5678\n}); // -> \"710b962e-041c-11e1-9234-0123456789ab\"\n```\n\nExample: In-place generation of two binary IDs\n\n```javascript\n// Generate two ids in an array\nvar arr = new Array(32); // -> []\nuuid.v1(null, arr, 0); // -> [02 a2 ce 90 14 32 11 e1 85 58 0b 48 8e 4f c1 15]\nuuid.v1(null, arr, 16); // -> [02 a2 ce 90 14 32 11 e1 85 58 0b 48 8e 4f c1 15 02 a3 1c b0 14 32 11 e1 85 58 0b 48 8e 4f c1 15]\n\n// Optionally use uuid.unparse() to get stringify the ids\nuuid.unparse(buffer); // -> '02a2ce90-1432-11e1-8558-0b488e4fc115'\nuuid.unparse(buffer, 16) // -> '02a31cb0-1432-11e1-8558-0b488e4fc115'\n```\n\n### uuid.v4([`options` [, `buffer` [, `offset`]]])\n\nGenerate and return a RFC4122 v4 UUID.\n\n* `options` - (Object) Optional uuid state to apply. Properties may include:\n\n * `random` - (Number[16]) Array of 16 numbers (0-255) to use in place of randomly generated values\n * `rng` - (Function) Random # generator to use. Set to one of the built-in generators - `uuid.mathRNG` (all platforms), `uuid.nodeRNG` (node.js only), `uuid.whatwgRNG` (WebKit only) - or a custom function that returns an array[16] of byte values.\n\n* `buffer` - (Array | Buffer) Array or buffer where UUID bytes are to be written.\n* `offset` - (Number) Starting index in `buffer` at which to begin writing.\n\nReturns `buffer`, if specified, otherwise the string form of the UUID\n\nExample: Generate string UUID with fully-specified options\n\n```javascript\nuuid.v4({\n random: [\n 0x10, 0x91, 0x56, 0xbe, 0xc4, 0xfb, 0xc1, 0xea,\n 0x71, 0xb4, 0xef, 0xe1, 0x67, 0x1c, 0x58, 0x36\n ]\n});\n// -> \"109156be-c4fb-41ea-b1b4-efe1671c5836\"\n```\n\nExample: Generate two IDs in a single buffer\n\n```javascript\nvar buffer = new Array(32); // (or 'new Buffer' in node.js)\nuuid.v4(null, buffer, 0);\nuuid.v4(null, buffer, 16);\n```\n\n### uuid.parse(id[, buffer[, offset]])\n### uuid.unparse(buffer[, offset])\n\nParse and unparse UUIDs\n\n * `id` - (String) UUID(-like) string\n * `buffer` - (Array | Buffer) Array or buffer where UUID bytes are to be written. Default: A new Array or Buffer is used\n * `offset` - (Number) Starting index in `buffer` at which to begin writing. Default: 0\n\nExample parsing and unparsing a UUID string\n\n```javascript\nvar bytes = uuid.parse('797ff043-11eb-11e1-80d6-510998755d10'); // -> \nvar string = uuid.unparse(bytes); // -> '797ff043-11eb-11e1-80d6-510998755d10'\n```\n\n### uuid.noConflict()\n\n(Browsers only) Set `uuid` property back to it's previous value.\n\nReturns the node-uuid object.\n\nExample:\n\n```javascript\nvar myUuid = uuid.noConflict();\nmyUuid.v1(); // -> '6c84fb90-12c4-11e1-840d-7b25c5ee775a'\n```\n\n## Deprecated APIs\n\nSupport for the following v1.2 APIs is available in v1.3, but is deprecated and will be removed in the next major version.\n\n### uuid([format [, buffer [, offset]]])\n\nuuid() has become uuid.v4(), and the `format` argument is now implicit in the `buffer` argument. (i.e. if you specify a buffer, the format is assumed to be binary).\n\n### uuid.BufferClass\n\nThe class of container created when generating binary uuid data if no buffer argument is specified. This is expected to go away, with no replacement API.\n\n## Testing\n\nIn node.js\n\n```\n> cd test\n> node test.js\n```\n\nIn Browser\n\n```\nopen test/test.html\n```\n\n### Benchmarking\n\nRequires node.js\n\n```\nnpm install uuid uuid-js\nnode benchmark/benchmark.js\n```\n\nFor a more complete discussion of node-uuid performance, please see the `benchmark/README.md` file, and the [benchmark wiki](https://github.com/broofa/node-uuid/wiki/Benchmark)\n\nFor browser performance [checkout the JSPerf tests](http://jsperf.com/node-uuid-performance).\n\n## Release notes\n\n### 1.4.0\n\n* Improved module context detection\n* Removed public RNG functions\n\n### 1.3.2\n\n* Improve tests and handling of v1() options (Issue #24)\n* Expose RNG option to allow for perf testing with different generators\n\n### 1.3.0\n\n* Support for version 1 ids, thanks to [@ctavan](https://github.com/ctavan)!\n* Support for node.js crypto API\n* De-emphasizing performance in favor of a) cryptographic quality PRNGs where available and b) more manageable code\n", - "readmeFilename": "README.md", + "version": "1.4.3", + "licenses": [ + { + "type": "MIT", + "url": "https://raw.github.com/broofa/node-uuid/master/LICENSE.md" + } + ], + "gitHead": "886463c660a095dfebfa69603921a8d156fdb12c", "bugs": { "url": "https://github.com/broofa/node-uuid/issues" }, - "_id": "node-uuid@1.4.1", - "dist": { - "shasum": "39aef510e5889a3dca9c895b506c73aae1bac048", - "tarball": "http://registry.npmjs.org/node-uuid/-/node-uuid-1.4.1.tgz" - }, + "homepage": "https://github.com/broofa/node-uuid", + "_id": "node-uuid@1.4.3", + "_shasum": "319bb7a56e7cb63f00b5c0cd7851cd4b4ddf1df9", "_from": "node-uuid@~1.4.1", - "_npmVersion": "1.3.6", + "_npmVersion": "1.4.28", "_npmUser": { "name": "broofa", "email": "robert@broofa.com" @@ -46,9 +55,11 @@ "email": "robert@broofa.com" } ], + "dist": { + "shasum": "319bb7a56e7cb63f00b5c0cd7851cd4b4ddf1df9", + "tarball": "http://registry.npmjs.org/node-uuid/-/node-uuid-1.4.3.tgz" + }, "directories": {}, - "_shasum": "39aef510e5889a3dca9c895b506c73aae1bac048", - "_resolved": "https://registry.npmjs.org/node-uuid/-/node-uuid-1.4.1.tgz", - "homepage": "https://github.com/broofa/node-uuid", - "scripts": {} + "_resolved": "https://registry.npmjs.org/node-uuid/-/node-uuid-1.4.3.tgz", + "readme": "ERROR: No README data found!" } diff --git a/node_modules/sequelize/node_modules/node-uuid/uuid.js b/node_modules/sequelize/node_modules/node-uuid/uuid.js index 2fac6dc..0a61769 100644 --- a/node_modules/sequelize/node_modules/node-uuid/uuid.js +++ b/node_modules/sequelize/node_modules/node-uuid/uuid.js @@ -14,9 +14,9 @@ // Node.js crypto-based RNG - http://nodejs.org/docs/v0.6.2/api/crypto.html // // Moderately fast, high quality - if (typeof(require) == 'function') { + if (typeof(_global.require) == 'function') { try { - var _rb = require('crypto').randomBytes; + var _rb = _global.require('crypto').randomBytes; _rng = _rb && function() {return _rb(16);}; } catch(e) {} } @@ -49,7 +49,7 @@ } // Buffer class to use - var BufferClass = typeof(Buffer) == 'function' ? Buffer : Array; + var BufferClass = typeof(_global.Buffer) == 'function' ? _global.Buffer : Array; // Maps for number <-> hex string conversion var _byteToHex = []; @@ -224,12 +224,14 @@ uuid.unparse = unparse; uuid.BufferClass = BufferClass; - if (typeof define === 'function' && define.amd) { - // Publish as AMD module - define(function() {return uuid;}); - } else if (typeof(module) != 'undefined' && module.exports) { + if (typeof(module) != 'undefined' && module.exports) { // Publish as node.js module module.exports = uuid; + } else if (typeof define === 'function' && define.amd) { + // Publish as AMD module + define(function() {return uuid;}); + + } else { // Publish as global (in browsers) var _previousRoot = _global.uuid; diff --git a/node_modules/sequelize/package.json b/node_modules/sequelize/package.json index 56f1322..e351140 100644 --- a/node_modules/sequelize/package.json +++ b/node_modules/sequelize/package.json @@ -80,7 +80,7 @@ "main": "index", "scripts": { "test": "make all", - "docs": "node_modules/.bin/yuidoc . -o docs" + "docs": "yuidoc . -o docs" }, "bin": { "sequelize": "bin/sequelize" @@ -121,5 +121,6 @@ ], "directories": {}, "_shasum": "14a26bea465f5f9702e87389ac4c9ff85b9f6a7c", - "_resolved": "https://registry.npmjs.org/sequelize/-/sequelize-1.7.9.tgz" + "_resolved": "https://registry.npmjs.org/sequelize/-/sequelize-1.7.9.tgz", + "readme": "ERROR: No README data found!" } diff --git a/node_modules/sqlite3/package.json b/node_modules/sqlite3/package.json index bf2ad54..f71ff61 100644 --- a/node_modules/sqlite3/package.json +++ b/node_modules/sqlite3/package.json @@ -136,5 +136,6 @@ ], "directories": {}, "_shasum": "37e4cee1f2512d54b68ce50603029dd13152aa64", - "_resolved": "https://registry.npmjs.org/sqlite3/-/sqlite3-2.2.3.tgz" + "_resolved": "https://registry.npmjs.org/sqlite3/-/sqlite3-2.2.3.tgz", + "readme": "ERROR: No README data found!" } diff --git a/node_modules/underscore/package.json b/node_modules/underscore/package.json index b51ebc4..e9b4a8a 100644 --- a/node_modules/underscore/package.json +++ b/node_modules/underscore/package.json @@ -62,5 +62,6 @@ ], "directories": {}, "_shasum": "8b38b10cacdef63337b8b24e4ff86d45aea529a8", - "_resolved": "https://registry.npmjs.org/underscore/-/underscore-1.6.0.tgz" + "_resolved": "https://registry.npmjs.org/underscore/-/underscore-1.6.0.tgz", + "readme": "ERROR: No README data found!" } From d2564e47466b2c57967f5419fa60ba55ffc9f488 Mon Sep 17 00:00:00 2001 From: Alyssa Nicoll Date: Thu, 19 Mar 2015 13:09:32 -0400 Subject: [PATCH 3/3] final commit after codetv --- app/js/app.js | 2 +- app/js/controllers/notes-index-controller.js | 1 + app/js/resources/note.js | 23 +++++++++++++++++++- app/server/views/index.html | 5 +++++ 4 files changed, 29 insertions(+), 2 deletions(-) diff --git a/app/js/app.js b/app/js/app.js index bbe72ba..45508f0 100644 --- a/app/js/app.js +++ b/app/js/app.js @@ -1,5 +1,5 @@ // Declare app level module which depends on ngRoute -angular.module('NoteWrangler', ['ngRoute', 'ngResource', 'Gravatar']) +angular.module('NoteWrangler', ['ngRoute', 'ngResource', 'Gravatar', 'firebase']) .config(function($gravatarProvider){ $gravatarProvider.setSize(100); }); diff --git a/app/js/controllers/notes-index-controller.js b/app/js/controllers/notes-index-controller.js index e5a3c57..bb646d8 100644 --- a/app/js/controllers/notes-index-controller.js +++ b/app/js/controllers/notes-index-controller.js @@ -9,6 +9,7 @@ angular.module('NoteWrangler') $scope.notes = Note.query(); // With Firebase + // $scope.notes = Note(); Session.sessionData().success(function(sessionUser) { diff --git a/app/js/resources/note.js b/app/js/resources/note.js index 4b3c3ca..d57cc36 100644 --- a/app/js/resources/note.js +++ b/app/js/resources/note.js @@ -3,9 +3,30 @@ This is a way of handling ajax requests using NgResource, it performs a similar to the Note Service. */ +// angular.module('NoteWrangler') +// .factory('Note', function NoteFactory($resource) { +// return $resource('/notes/:id', {}, { +// update: { +// method: "PUT" +// } +// }); +// }); + +// Firebase way +// angular.module('NoteWrangler') +// .factory('Note', function NoteFactory($firebaseArray) { +// return function(){ +// // creating the snapshot of our data +// var ref = new Firebase('https://notewrangler.firebaseio.com/notes'); +// // return a synchronized array +// return $firebaseArray(ref); +// }; +// }); + +// Firebase - Normal restful call angular.module('NoteWrangler') .factory('Note', function NoteFactory($resource) { - return $resource('/notes/:id', {}, { + return $resource('https://notewrangler.firebaseio.com/notes/:id.json', {}, { update: { method: "PUT" } diff --git a/app/server/views/index.html b/app/server/views/index.html index 9173e20..0c795f4 100644 --- a/app/server/views/index.html +++ b/app/server/views/index.html @@ -55,6 +55,11 @@ + + + + +