diff --git a/lib/driver.js b/lib/driver.js index 7b77c2c..0cad5a5 100755 --- a/lib/driver.js +++ b/lib/driver.js @@ -72,7 +72,7 @@ var d = { } // Handle commas - if (str.contains(',')) + if (str.includes(',')) { var parts = str.split(',').map(helpers.stringTrim); str = parts.map(d.quoteIdentifiers).join(','); @@ -83,7 +83,7 @@ var d = { raw = hiers.join('.'); // Fix functions - if (raw.contains('(') && raw.contains(')')) + if (raw.includes('(') && raw.includes(')')) { var funcs = pattern.exec(raw); diff --git a/node_modules/dblite/package.json b/node_modules/dblite/package.json index fc82d7c..4bdb198 100644 --- a/node_modules/dblite/package.json +++ b/node_modules/dblite/package.json @@ -39,7 +39,7 @@ }, "_id": "dblite@0.6.1", "_shasum": "18e6d3811f4031ff0119e8a7b13ef1558215376a", - "_from": "dblite@^0.6.1", + "_from": "dblite@>=0.6.1 <0.7.0", "_npmVersion": "1.4.9", "_npmUser": { "name": "webreflection", diff --git a/node_modules/es6-shim/.flowconfig b/node_modules/es6-shim/.flowconfig new file mode 100644 index 0000000..5a47ff4 --- /dev/null +++ b/node_modules/es6-shim/.flowconfig @@ -0,0 +1,8 @@ +[ignore] +.min.js +Gruntfile.js +.map + +[include] +es6-shim.js +es6-sham.js diff --git a/node_modules/es6-shim/.jscs.json b/node_modules/es6-shim/.jscs.json index 8bca4f1..496777b 100644 --- a/node_modules/es6-shim/.jscs.json +++ b/node_modules/es6-shim/.jscs.json @@ -13,6 +13,8 @@ "requireSpacesInFunctionDeclaration": { "beforeOpeningCurlyBrace": true }, "disallowSpacesInFunctionDeclaration": { "beforeOpeningRoundBrace": true }, + "requireSpaceBetweenArguments": true, + "disallowSpacesInsideParentheses": true, "disallowSpacesInsideArrayBrackets": true, diff --git a/node_modules/es6-shim/.jshintrc b/node_modules/es6-shim/.jshintrc new file mode 100644 index 0000000..20688b7 --- /dev/null +++ b/node_modules/es6-shim/.jshintrc @@ -0,0 +1,3 @@ +{ + "es3": true +} diff --git a/node_modules/es6-shim/CHANGELOG.md b/node_modules/es6-shim/CHANGELOG.md index 23f0881..dc20110 100644 --- a/node_modules/es6-shim/CHANGELOG.md +++ b/node_modules/es6-shim/CHANGELOG.md @@ -1,5 +1,48 @@ # es6-shim x.x.x (not yet released) +# es6-shim 0.23.0 (26 Jan 2015) +* Use Symbol.species when available, else fall back to "@@species" (renamed from "@@create") +* Fix `npm run test-native` +* Correct broken Math implementations: `log1p`, `exmp1`, `tanh`, `acosh`, `cosh`, `sinh`, `round` (#314) +* Update `jscs`, `grunt-saucelabs`, `jshint` + +# es6-shim 0.22.2 (4 Jan 2015) +* Faster travis-ci builds +* Better ES3 support: quoting/avoiding reserved words +* Update `mocha`, `jscs`, `jshint`, `grunt-saucelabs`, `uglify-js` + +# es6-shim 0.22.1 (13 Dec 2014) +* Make RegExp#flags generic, per spec (#310) + +# es6-shim 0.22.0 (12 Dec 2014) +* Add RegExp#flags +* Make `new RegExp` work with both a regex and a flags string +* Remove non-spec `Object.{getPropertyNames,getPropertyDescriptor}` + +# es6-shim 0.21.1 (4 Dec 2014) +* Promise/Promise.prototype methods, and String#{startsWith,endsWith} are now not enumerable +* Array#{keys, values, entries} should all be @@unscopeable in browsers that support that +* Ensure that tampering with Function#{call,apply} won’t break internal methods +* Add Math.clz32, RegExp tests +* Update es6-sham UMD +* Update `chai`, `es5-shim`, `grunt-saucelabs`, `jscs` + +# es6-shim 0.21.0 (21 Nov 2014) +* String#contains → String#includes per 2014-11-19 TC39 meeting +* Use an invalid identifier as the es6-shim iterator key, so it doesn’t show up in the console as easily. + +# es6-shim 0.20.4 (20 Nov 2014) +* Performance improvements: avoid slicing arguments, avoid `Function#call` when possible +* Name `String.{fromCodePoint,raw}` for debugging +* Fix `String.raw` to match spec +* Ensure Chrome’s excess Promise methods are purged +* Ensure `Set#keys === Set#values`, per spec + +# es6-shim 0.20.3 (19 Nov 2014) +* Fix Set#add and Map#set to always return "this" (#302) +* Clarify TypeError messages thrown by Map/Set +* Fix Chrome 38 bug with Array#values + # es6-shim 0.20.2 (28 Oct 2014) * Fix AMD (#299) @@ -20,7 +63,7 @@ # es6-shim 0.19.0 (9 Oct 2014) * Detect and override noncompliant Map in Firefox 32 (#294) -* Fix Map and Set for engines that don't preserve numeric key order (#292, #290) +* Fix Map and Set for engines that don’t preserve numeric key order (#292, #290) * Detect and override noncompliant Safari 7.1 Promises (#289) * Fix Array#keys and Array#entries in Safari 7.1 * General style and whitespace cleanup @@ -57,9 +100,9 @@ # es6-shim 0.14.0 (20 Jul 2014) * Properly recognize Symbol.iterator when it is present (#277) -* Fix Math.clz's improper handling of values that coerce to NaN (#269) +* Fix Math.clz’s improper handling of values that coerce to NaN (#269) * Fix incorrect handling of negative end index on Array#fill (#270) -* Removed Object.getOwnPropertyKeys, which shouldn't be anywhere (#267) +* Removed Object.getOwnPropertyKeys, which shouldn’t be anywhere (#267) * Fixed arity of Map and Set constructors, per 2014.04.27 draft spec (rev 24) * Added a full additional suite of ES6 promise tests (thanks to @smikes!) (#265) * Make Number.isInteger a bit more efficient (#266) @@ -92,7 +135,7 @@ # es6-shim 0.10.1 (13 Mar 2014) * Update bower.json, component.json, and .npmignore (#229, #230, #233) * Minor updates to `Promise` implementation and test suite. -* Workaround lack of 'strict mode' in IE9. (#232) +* Workaround lack of "strict mode" in IE9. (#232) # es6-shim 0.10.0 (1 March 2014) * Implement `Promise`, per spec. (#209, #215, #224, #225) diff --git a/node_modules/es6-shim/README.md b/node_modules/es6-shim/README.md index a6948b7..f11b72d 100644 --- a/node_modules/es6-shim/README.md +++ b/node_modules/es6-shim/README.md @@ -36,7 +36,11 @@ details. * `repeat()` ([a standalone shim is also available](http://mths.be/repeat)) * `startsWith()` ([a standalone shim is also available](http://mths.be/startswith)) * `endsWith()` ([a standalone shim is also available](http://mths.be/endswith)) - * `contains()` ([a standalone shim is also available](http://mths.be/contains)) + * `includes()` ([a standalone shim is also available](http://mths.be/includes)) +* `RegExp`: + * `new RegExp`, when given a RegExp as the pattern, will no longer throw when given a "flags" string argument. (requires ES5) +* `RegExp.prototype`: + * `flags` (requires ES5) ([a standalone shim is also available](https://github.com/es-shims/RegExp.prototype.flags)) * `Number`: * `MAX_SAFE_INTEGER` * `MIN_SAFE_INTEGER` @@ -59,10 +63,7 @@ details. * `entries()` * `values()` * `Object`: - * `getPropertyDescriptor()` (ES5) - * `getPropertyNames()` (ES5) - * `getPropertyKeys()` (ES5) - * `keys()` (ES5, but no longer throws on non-object non-null/undefined values in ES6) + * `keys()` (in ES5, but no longer throws on non-object non-null/undefined values in ES6) * `is()` ([a standalone shim is also available](https://github.com/ljharb/object-is)) * `assign()` ([a standalone shim is also available](https://github.com/ljharb/object.assign)) * `setPrototypeOf()` (IE >= 11) @@ -126,7 +127,7 @@ WeakMap has a very unusual use-case so you probably won't need it at all ```javascript 'abc'.startsWith('a') // true 'abc'.endsWith('a') // false -'john alice'.contains('john') // true +'john alice'.includes('john') // true '123'.repeat(2) // '123123' Object.is(NaN, NaN) // Fixes ===. 0 isnt -0, NaN is NaN diff --git a/node_modules/es6-shim/bower.json b/node_modules/es6-shim/bower.json index 8d36fda..426d261 100644 --- a/node_modules/es6-shim/bower.json +++ b/node_modules/es6-shim/bower.json @@ -1,6 +1,6 @@ { "name": "es6-shim", - "version": "0.20.2", + "version": "0.23.0", "repo": "paulmillr/es6-shim", "description": "ECMAScript 6 (Harmony) compatibility shims for legacy JavaScript engines", "keywords": [ diff --git a/node_modules/es6-shim/component.json b/node_modules/es6-shim/component.json index 53d2473..fee8fd9 100644 --- a/node_modules/es6-shim/component.json +++ b/node_modules/es6-shim/component.json @@ -1,6 +1,6 @@ { "name": "es6-shim", - "version": "0.20.2", + "version": "0.23.0", "repo": "paulmillr/es6-shim", "description": "ECMAScript 6 (Harmony) compatibility shims for legacy JavaScript engines", "keywords": [ diff --git a/node_modules/es6-shim/es6-sham.js b/node_modules/es6-shim/es6-sham.js index b18015f..fe67bfd 100644 --- a/node_modules/es6-shim/es6-sham.js +++ b/node_modules/es6-shim/es6-sham.js @@ -2,112 +2,118 @@ * https://github.com/paulmillr/es6-shim * @license es6-shim Copyright 2013-2014 by Paul Miller (http://paulmillr.com) * and contributors, MIT License - * es6-sham: v0.20.2 - * see https://github.com/paulmillr/es6-shim/blob/master/LICENSE + * es6-sham: v0.23.0 + * see https://github.com/paulmillr/es6-shim/blob/0.22.2/LICENSE * Details and documentation: * https://github.com/paulmillr/es6-shim/ */ -(function (undefined) { +// UMD (Universal Module Definition) +// see https://github.com/umdjs/umd/blob/master/returnExports.js +(function (root, factory) { + /*global define, exports, module */ + if (typeof define === 'function' && define.amd) { + // AMD. Register as an anonymous module. + define(factory); + } else if (typeof exports === 'object') { + // Node. Does not work with strict CommonJS, but + // only CommonJS-like enviroments that support module.exports, + // like Node. + module.exports = factory(); + } else { + // Browser globals (root is window) + root.returnExports = factory(); + } +}(this, function (undefined) { 'use strict'; /*jshint evil: true */ var getGlobal = new Function('return this;'); /*jshint evil: false */ - var main = function () { - var globals = getGlobal(); - var Object = globals.Object; + var globals = getGlobal(); + var Object = globals.Object; - // NOTE: This versions needs object ownership - // beacuse every promoted object needs to be reassigned - // otherwise uncompatible browsers cannot work as expected - // - // NOTE: This might need es5-shim or polyfills upfront - // because it's based on ES5 API. - // (probably just an IE <= 8 problem) - // - // NOTE: nodejs is fine in version 0.8, 0.10, and future versions. - (function () { - if (Object.setPrototypeOf) { return; } + // NOTE: This versions needs object ownership + // beacuse every promoted object needs to be reassigned + // otherwise uncompatible browsers cannot work as expected + // + // NOTE: This might need es5-shim or polyfills upfront + // because it's based on ES5 API. + // (probably just an IE <= 8 problem) + // + // NOTE: nodejs is fine in version 0.8, 0.10, and future versions. + (function () { + if (Object.setPrototypeOf) { return; } - /*jshint proto: true */ - // @author Andrea Giammarchi - @WebReflection - // define into target descriptors from source - var copyDescriptors = function (target, source) { - getOwnPropertyNames(source).forEach(function (key) { - defineProperty( - target, - key, - getOwnPropertyDescriptor(source, key) - ); - }); - return target; + /*jshint proto: true */ + // @author Andrea Giammarchi - @WebReflection + // define into target descriptors from source + var copyDescriptors = function (target, source) { + getOwnPropertyNames(source).forEach(function (key) { + defineProperty( + target, + key, + getOwnPropertyDescriptor(source, key) + ); + }); + return target; + }; + // used as fallback when no promotion is possible + var createAndCopy = function (origin, proto) { + return copyDescriptors(create(proto), origin); + }; + var create = Object.create; + var defineProperty = Object.defineProperty; + var getPrototypeOf = Object.getPrototypeOf; + var getOwnPropertyNames = Object.getOwnPropertyNames; + var getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor; + var proto = Object.prototype; + var set, setPrototypeOf; + try { + // this might fail for various reasons + // ignore if Chrome cought it at runtime + set = getOwnPropertyDescriptor(proto, '__proto__').set; + set.call({}, null); + // setter not poisoned, it can promote + // Firefox, Chrome + setPrototypeOf = function (origin, proto) { + set.call(origin, proto); + return origin; }; - // used as fallback when no promotion is possible - var createAndCopy = function (origin, proto) { - return copyDescriptors(create(proto), origin); - }; - var create = Object.create; - var defineProperty = Object.defineProperty; - var getPrototypeOf = Object.getPrototypeOf; - var getOwnPropertyNames = Object.getOwnPropertyNames; - var getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor; - var proto = Object.prototype; - var set, setPrototypeOf; - - try { - // this might fail for various reasons - // ignore if Chrome cought it at runtime - set = getOwnPropertyDescriptor(proto, '__proto__').set; - set.call({}, null); - // setter not poisoned, it can promote - // Firefox, Chrome - setPrototypeOf = function (origin, proto) { - set.call(origin, proto); - return origin; - }; - } catch (e) { - // do one or more feature detections - set = {__proto__: null}; - // if proto does not work, needs to fallback - // some Opera, Rhino, ducktape + } catch (e) { + // do one or more feature detections + set = {__proto__: null}; + // if proto does not work, needs to fallback + // some Opera, Rhino, ducktape + if (set instanceof Object) { + setPrototypeOf = createAndCopy; + } else { + // verify if null objects are buggy + set.__proto__ = proto; + // if null objects are buggy + // nodejs 0.8 to 0.10 if (set instanceof Object) { - setPrototypeOf = createAndCopy; + setPrototypeOf = function (origin, proto) { + // use such bug to promote + origin.__proto__ = proto; + return origin; + }; } else { - // verify if null objects are buggy - set.__proto__ = proto; - // if null objects are buggy - // nodejs 0.8 to 0.10 - if (set instanceof Object) { - setPrototypeOf = function (origin, proto) { - // use such bug to promote - origin.__proto__ = proto; - return origin; - }; - } else { - // try to use proto or fallback - // Safari, old Firefox, many others - setPrototypeOf = function (origin, proto) { - // if proto is not null - return getPrototypeOf(origin) ? - // use __proto__ to promote - ((origin.__proto__ = proto), origin) : - // otherwise unable to promote: fallback - createAndCopy(origin, proto); - }; - } + // try to use proto or fallback + // Safari, old Firefox, many others + setPrototypeOf = function (origin, proto) { + // if proto is not null + return getPrototypeOf(origin) ? + // use __proto__ to promote + ((origin.__proto__ = proto), origin) : + // otherwise unable to promote: fallback + createAndCopy(origin, proto); + }; } } - Object.setPrototypeOf = setPrototypeOf; - }()); - - }; - - if (typeof define === 'function' && define.amd) { - define(main); // RequireJS - } else { - main(); // CommonJS and - -``` - -## Documentation - -### Collections - -* [`each`](#each) -* [`eachSeries`](#eachSeries) -* [`eachLimit`](#eachLimit) -* [`map`](#map) -* [`mapSeries`](#mapSeries) -* [`mapLimit`](#mapLimit) -* [`filter`](#filter) -* [`filterSeries`](#filterSeries) -* [`reject`](#reject) -* [`rejectSeries`](#rejectSeries) -* [`reduce`](#reduce) -* [`reduceRight`](#reduceRight) -* [`detect`](#detect) -* [`detectSeries`](#detectSeries) -* [`sortBy`](#sortBy) -* [`some`](#some) -* [`every`](#every) -* [`concat`](#concat) -* [`concatSeries`](#concatSeries) - -### Control Flow - -* [`series`](#seriestasks-callback) -* [`parallel`](#parallel) -* [`parallelLimit`](#parallellimittasks-limit-callback) -* [`whilst`](#whilst) -* [`doWhilst`](#doWhilst) -* [`until`](#until) -* [`doUntil`](#doUntil) -* [`forever`](#forever) -* [`waterfall`](#waterfall) -* [`compose`](#compose) -* [`seq`](#seq) -* [`applyEach`](#applyEach) -* [`applyEachSeries`](#applyEachSeries) -* [`queue`](#queue) -* [`priorityQueue`](#priorityQueue) -* [`cargo`](#cargo) -* [`auto`](#auto) -* [`retry`](#retry) -* [`iterator`](#iterator) -* [`apply`](#apply) -* [`nextTick`](#nextTick) -* [`times`](#times) -* [`timesSeries`](#timesSeries) - -### Utils - -* [`memoize`](#memoize) -* [`unmemoize`](#unmemoize) -* [`log`](#log) -* [`dir`](#dir) -* [`noConflict`](#noConflict) - - -## Collections - - - -### each(arr, iterator, callback) - -Applies the function `iterator` to each item in `arr`, in parallel. -The `iterator` is called with an item from the list, and a callback for when it -has finished. If the `iterator` passes an error to its `callback`, the main -`callback` (for the `each` function) is immediately called with the error. - -Note, that since this function applies `iterator` to each item in parallel, -there is no guarantee that the iterator functions will complete in order. - -__Arguments__ - -* `arr` - An array to iterate over. -* `iterator(item, callback)` - A function to apply to each item in `arr`. - The iterator is passed a `callback(err)` which must be called once it has - completed. If no error has occured, the `callback` should be run without - arguments or with an explicit `null` argument. -* `callback(err)` - A callback which is called when all `iterator` functions - have finished, or an error occurs. - -__Examples__ - - -```js -// assuming openFiles is an array of file names and saveFile is a function -// to save the modified contents of that file: - -async.each(openFiles, saveFile, function(err){ - // if any of the saves produced an error, err would equal that error -}); -``` - -```js -// assuming openFiles is an array of file names - -async.each(openFiles, function( file, callback) { - - // Perform operation on file here. - console.log('Processing file ' + file); - - if( file.length > 32 ) { - console.log('This file name is too long'); - callback('File name too long'); - } else { - // Do work to process file here - console.log('File processed'); - callback(); - } -}, function(err){ - // if any of the file processing produced an error, err would equal that error - if( err ) { - // One of the iterations produced an error. - // All processing will now stop. - console.log('A file failed to process'); - } else { - console.log('All files have been processed successfully'); - } -}); -``` - ---------------------------------------- - - - -### eachSeries(arr, iterator, callback) - -The same as [`each`](#each), only `iterator` is applied to each item in `arr` in -series. The next `iterator` is only called once the current one has completed. -This means the `iterator` functions will complete in order. - - ---------------------------------------- - - - -### eachLimit(arr, limit, iterator, callback) - -The same as [`each`](#each), only no more than `limit` `iterator`s will be simultaneously -running at any time. - -Note that the items in `arr` are not processed in batches, so there is no guarantee that -the first `limit` `iterator` functions will complete before any others are started. - -__Arguments__ - -* `arr` - An array to iterate over. -* `limit` - The maximum number of `iterator`s to run at any time. -* `iterator(item, callback)` - A function to apply to each item in `arr`. - The iterator is passed a `callback(err)` which must be called once it has - completed. If no error has occured, the callback should be run without - arguments or with an explicit `null` argument. -* `callback(err)` - A callback which is called when all `iterator` functions - have finished, or an error occurs. - -__Example__ - -```js -// Assume documents is an array of JSON objects and requestApi is a -// function that interacts with a rate-limited REST api. - -async.eachLimit(documents, 20, requestApi, function(err){ - // if any of the saves produced an error, err would equal that error -}); -``` - ---------------------------------------- - - -### map(arr, iterator, callback) - -Produces a new array of values by mapping each value in `arr` through -the `iterator` function. The `iterator` is called with an item from `arr` and a -callback for when it has finished processing. Each of these callback takes 2 arguments: -an `error`, and the transformed item from `arr`. If `iterator` passes an error to 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 `arr`. - -__Arguments__ - -* `arr` - An array to iterate over. -* `iterator(item, callback)` - A function to apply to each item in `arr`. - The iterator is passed a `callback(err, transformed)` which must be called once - it has completed with an error (which can be `null`) and a transformed item. -* `callback(err, results)` - A callback which is called when all `iterator` - functions have finished, or an error occurs. Results is an array of the - transformed items from the `arr`. - -__Example__ - -```js -async.map(['file1','file2','file3'], fs.stat, function(err, results){ - // results is now an array of stats for each file -}); -``` - ---------------------------------------- - - -### mapSeries(arr, iterator, callback) - -The same as [`map`](#map), only the `iterator` is applied to each item in `arr` in -series. The next `iterator` is only called once the current one has completed. -The results array will be in the same order as the original. - - ---------------------------------------- - - -### mapLimit(arr, limit, iterator, callback) - -The same as [`map`](#map), only no more than `limit` `iterator`s will be simultaneously -running at any time. - -Note that the items are not processed in batches, so there is no guarantee that -the first `limit` `iterator` functions will complete before any others are started. - -__Arguments__ - -* `arr` - An array to iterate over. -* `limit` - The maximum number of `iterator`s to run at any time. -* `iterator(item, callback)` - A function to apply to each item in `arr`. - The iterator is passed a `callback(err, transformed)` which must be called once - it has completed with an error (which can be `null`) and a transformed item. -* `callback(err, results)` - A callback which is called when all `iterator` - calls have finished, or an error occurs. The result is an array of the - transformed items from the original `arr`. - -__Example__ - -```js -async.mapLimit(['file1','file2','file3'], 1, fs.stat, function(err, results){ - // results is now an array of stats for each file -}); -``` - ---------------------------------------- - - - -### filter(arr, iterator, callback) - -__Alias:__ `select` - -Returns a new array of all the values in `arr` which pass an async truth test. -_The callback for each `iterator` call only accepts a single argument of `true` or -`false`; it does not accept an error argument first!_ This is in-line with the -way node libraries work with truth tests like `fs.exists`. This operation is -performed in parallel, but the results array will be in the same order as the -original. - -__Arguments__ - -* `arr` - An array to iterate over. -* `iterator(item, callback)` - A truth test to apply to each item in `arr`. - The `iterator` is passed a `callback(truthValue)`, which must be called with a - boolean argument once it has completed. -* `callback(results)` - A callback which is called after all the `iterator` - functions have finished. - -__Example__ - -```js -async.filter(['file1','file2','file3'], fs.exists, function(results){ - // results now equals an array of the existing files -}); -``` - ---------------------------------------- - - - -### filterSeries(arr, iterator, callback) - -__Alias:__ `selectSeries` - -The same as [`filter`](#filter) only the `iterator` is applied to each item in `arr` in -series. The next `iterator` is only called once the current one has completed. -The results array will be in the same order as the original. - ---------------------------------------- - - -### reject(arr, iterator, callback) - -The opposite of [`filter`](#filter). Removes values that pass an `async` truth test. - ---------------------------------------- - - -### rejectSeries(arr, iterator, callback) - -The same as [`reject`](#reject), only the `iterator` is applied to each item in `arr` -in series. - - ---------------------------------------- - - -### reduce(arr, memo, iterator, callback) - -__Aliases:__ `inject`, `foldl` - -Reduces `arr` into a single value using an async `iterator` to return -each successive step. `memo` is the initial state of the reduction. -This function only operates in series. - -For performance reasons, it may make sense to split a call to this function into -a parallel map, and then use the normal `Array.prototype.reduce` on the results. -This function is for situations where each step in the reduction needs to be async; -if you can get the data before reducing it, then it's probably a good idea to do so. - -__Arguments__ - -* `arr` - An array to iterate over. -* `memo` - The initial state of the reduction. -* `iterator(memo, item, callback)` - A function applied to each item in the - array to produce the next step in the reduction. The `iterator` is passed a - `callback(err, reduction)` which accepts an optional error as its first - argument, and the state of the reduction as the second. If an error is - passed to the callback, the reduction is stopped and the main `callback` is - immediately called with the error. -* `callback(err, result)` - A callback which is called after all the `iterator` - functions have finished. Result is the reduced value. - -__Example__ - -```js -async.reduce([1,2,3], 0, function(memo, item, callback){ - // pointless async: - process.nextTick(function(){ - callback(null, memo + item) - }); -}, function(err, result){ - // result is now equal to the last value of memo, which is 6 -}); -``` - ---------------------------------------- - - -### reduceRight(arr, memo, iterator, callback) - -__Alias:__ `foldr` - -Same as [`reduce`](#reduce), only operates on `arr` in reverse order. - - ---------------------------------------- - - -### detect(arr, iterator, callback) - -Returns the first value in `arr` that passes an async truth test. The -`iterator` is applied in parallel, meaning the first iterator to return `true` will -fire the detect `callback` with that result. That means the result might not be -the first item in the original `arr` (in terms of order) that passes the test. - -If order within the original `arr` is important, then look at [`detectSeries`](#detectSeries). - -__Arguments__ - -* `arr` - An array to iterate over. -* `iterator(item, callback)` - A truth test to apply to each item in `arr`. - The iterator is passed a `callback(truthValue)` which must be called with a - boolean argument once it has completed. -* `callback(result)` - A callback which is called as soon as any iterator returns - `true`, or after all the `iterator` functions have finished. Result will be - the first item in the array that passes the truth test (iterator) or the - value `undefined` if none passed. - -__Example__ - -```js -async.detect(['file1','file2','file3'], fs.exists, function(result){ - // result now equals the first file in the list that exists -}); -``` - ---------------------------------------- - - -### detectSeries(arr, iterator, callback) - -The same as [`detect`](#detect), only the `iterator` is applied to each item in `arr` -in series. This means the result is always the first in the original `arr` (in -terms of array order) that passes the truth test. - - ---------------------------------------- - - -### sortBy(arr, iterator, callback) - -Sorts a list by the results of running each `arr` value through an async `iterator`. - -__Arguments__ - -* `arr` - An array to iterate over. -* `iterator(item, callback)` - A function to apply to each item in `arr`. - The iterator is passed a `callback(err, sortValue)` which must be called once it - has completed with an error (which can be `null`) and a value to use as the sort - criteria. -* `callback(err, results)` - A callback which is called after all the `iterator` - functions have finished, or an error occurs. Results is the items from - the original `arr` sorted by the values returned by the `iterator` calls. - -__Example__ - -```js -async.sortBy(['file1','file2','file3'], function(file, callback){ - fs.stat(file, function(err, stats){ - callback(err, stats.mtime); - }); -}, function(err, results){ - // results is now the original array of files sorted by - // modified date -}); -``` - -__Sort Order__ - -By modifying the callback parameter the sorting order can be influenced: - -```js -//ascending order -async.sortBy([1,9,3,5], function(x, callback){ - callback(err, x); -}, function(err,result){ - //result callback -} ); - -//descending order -async.sortBy([1,9,3,5], function(x, callback){ - callback(err, x*-1); //<- x*-1 instead of x, turns the order around -}, function(err,result){ - //result callback -} ); -``` - ---------------------------------------- - - -### some(arr, iterator, callback) - -__Alias:__ `any` - -Returns `true` if at least one element in the `arr` satisfies an async test. -_The callback for each iterator call only accepts a single argument of `true` or -`false`; it does not accept an error argument first!_ This is in-line with the -way node libraries work with truth tests like `fs.exists`. Once any iterator -call returns `true`, the main `callback` is immediately called. - -__Arguments__ - -* `arr` - An array to iterate over. -* `iterator(item, callback)` - A truth test to apply to each item in the array - in parallel. The iterator is passed a callback(truthValue) which must be - called with a boolean argument once it has completed. -* `callback(result)` - A callback which is called as soon as any iterator returns - `true`, or after all the iterator functions have finished. Result will be - either `true` or `false` depending on the values of the async tests. - -__Example__ - -```js -async.some(['file1','file2','file3'], fs.exists, function(result){ - // if result is true then at least one of the files exists -}); -``` - ---------------------------------------- - - -### every(arr, iterator, callback) - -__Alias:__ `all` - -Returns `true` if every element in `arr` satisfies an async test. -_The callback for each `iterator` call only accepts a single argument of `true` or -`false`; it does not accept an error argument first!_ This is in-line with the -way node libraries work with truth tests like `fs.exists`. - -__Arguments__ - -* `arr` - An array to iterate over. -* `iterator(item, callback)` - A truth test to apply to each item in the array - in parallel. The iterator is passed a callback(truthValue) which must be - called with a boolean argument once it has completed. -* `callback(result)` - A callback which is called after all the `iterator` - functions have finished. Result will be either `true` or `false` depending on - the values of the async tests. - -__Example__ - -```js -async.every(['file1','file2','file3'], fs.exists, function(result){ - // if result is true then every file exists -}); -``` - ---------------------------------------- - - -### concat(arr, iterator, callback) - -Applies `iterator` to each item in `arr`, concatenating the results. Returns the -concatenated list. The `iterator`s are called in parallel, and the results are -concatenated as they return. There is no guarantee that the results array will -be returned in the original order of `arr` passed to the `iterator` function. - -__Arguments__ - -* `arr` - An array to iterate over. -* `iterator(item, callback)` - A function to apply to each item in `arr`. - The iterator is passed a `callback(err, results)` which must be called once it - has completed with an error (which can be `null`) and an array of results. -* `callback(err, results)` - A callback which is called after all the `iterator` - functions have finished, or an error occurs. Results is an array containing - the concatenated results of the `iterator` function. - -__Example__ - -```js -async.concat(['dir1','dir2','dir3'], fs.readdir, function(err, files){ - // files is now a list of filenames that exist in the 3 directories -}); -``` - ---------------------------------------- - - -### concatSeries(arr, iterator, callback) - -Same as [`concat`](#concat), but executes in series instead of parallel. - - -## Control Flow - - -### series(tasks, [callback]) - -Run the functions in the `tasks` array in series, each one running once the previous -function has completed. If any functions in the series pass an error to its -callback, no more functions are run, and `callback` is immediately called with the value of the error. -Otherwise, `callback` receives an array of results when `tasks` have completed. - -It is also possible to use an object instead of an array. Each property will be -run as a function, and the results will be passed to the final `callback` as an object -instead of an array. This can be a more readable way of handling results from -[`series`](#series). - -**Note** that while many implementations preserve the order of object properties, the -[ECMAScript Language Specifcation](http://www.ecma-international.org/ecma-262/5.1/#sec-8.6) -explicitly states that - -> The mechanics and order of enumerating the properties is not specified. - -So if you rely on the order in which your series of functions are executed, and want -this to work on all platforms, consider using an array. - -__Arguments__ - -* `tasks` - An array or object containing functions to run, each function is passed - a `callback(err, result)` it must call on completion with an error `err` (which can - be `null`) and an optional `result` value. -* `callback(err, results)` - An optional callback to run once all the functions - have completed. This function gets a results array (or object) containing all - the result arguments passed to the `task` callbacks. - -__Example__ - -```js -async.series([ - function(callback){ - // do some stuff ... - callback(null, 'one'); - }, - function(callback){ - // do some more stuff ... - callback(null, 'two'); - } -], -// optional callback -function(err, results){ - // results is now equal to ['one', 'two'] -}); - - -// an example using an object instead of an array -async.series({ - one: function(callback){ - setTimeout(function(){ - callback(null, 1); - }, 200); - }, - two: function(callback){ - setTimeout(function(){ - callback(null, 2); - }, 100); - } -}, -function(err, results) { - // results is now equal to: {one: 1, two: 2} -}); -``` - ---------------------------------------- - - -### parallel(tasks, [callback]) - -Run the `tasks` array of functions in parallel, without waiting until the previous -function has completed. If any of the functions pass an error to its -callback, the main `callback` is immediately called with the value of the error. -Once the `tasks` have completed, the results are passed to the final `callback` as an -array. - -It is also possible to use an object instead of an array. Each property will be -run as a function and the results will be passed to the final `callback` as an object -instead of an array. This can be a more readable way of handling results from -[`parallel`](#parallel). - - -__Arguments__ - -* `tasks` - An array or object containing functions to run. Each function is passed - a `callback(err, result)` which it must call on completion with an error `err` - (which can be `null`) and an optional `result` value. -* `callback(err, results)` - An optional callback to run once all the functions - have completed. This function gets a results array (or object) containing all - the result arguments passed to the task callbacks. - -__Example__ - -```js -async.parallel([ - function(callback){ - setTimeout(function(){ - callback(null, 'one'); - }, 200); - }, - function(callback){ - setTimeout(function(){ - callback(null, 'two'); - }, 100); - } -], -// optional callback -function(err, results){ - // the results array will equal ['one','two'] even though - // the second function had a shorter timeout. -}); - - -// an example using an object instead of an array -async.parallel({ - one: function(callback){ - setTimeout(function(){ - callback(null, 1); - }, 200); - }, - two: function(callback){ - setTimeout(function(){ - callback(null, 2); - }, 100); - } -}, -function(err, results) { - // results is now equals to: {one: 1, two: 2} -}); -``` - ---------------------------------------- - - -### parallelLimit(tasks, limit, [callback]) - -The same as [`parallel`](#parallel), only `tasks` are executed in parallel -with a maximum of `limit` tasks executing at any time. - -Note that the `tasks` are not executed in batches, so there is no guarantee that -the first `limit` tasks will complete before any others are started. - -__Arguments__ - -* `tasks` - An array or object containing functions to run, each function is passed - a `callback(err, result)` it must call on completion with an error `err` (which can - be `null`) and an optional `result` value. -* `limit` - The maximum number of `tasks` to run at any time. -* `callback(err, results)` - An optional callback to run once all the functions - have completed. This function gets a results array (or object) containing all - the result arguments passed to the `task` callbacks. - ---------------------------------------- - - -### whilst(test, fn, callback) - -Repeatedly call `fn`, while `test` returns `true`. Calls `callback` when stopped, -or an error occurs. - -__Arguments__ - -* `test()` - synchronous truth test to perform before each execution of `fn`. -* `fn(callback)` - A function which is called each time `test` passes. The function is - passed a `callback(err)`, which must be called once it has completed with an - optional `err` argument. -* `callback(err)` - A callback which is called after the test fails and repeated - execution of `fn` has stopped. - -__Example__ - -```js -var count = 0; - -async.whilst( - function () { return count < 5; }, - function (callback) { - count++; - setTimeout(callback, 1000); - }, - function (err) { - // 5 seconds have passed - } -); -``` - ---------------------------------------- - - -### doWhilst(fn, test, callback) - -The post-check version of [`whilst`](#whilst). To reflect the difference in -the order of operations, the arguments `test` and `fn` are switched. - -`doWhilst` is to `whilst` as `do while` is to `while` in plain JavaScript. - ---------------------------------------- - - -### until(test, fn, callback) - -Repeatedly call `fn` until `test` returns `true`. Calls `callback` when stopped, -or an error occurs. - -The inverse of [`whilst`](#whilst). - ---------------------------------------- - - -### doUntil(fn, test, callback) - -Like [`doWhilst`](#doWhilst), except the `test` is inverted. Note the argument ordering differs from `until`. - ---------------------------------------- - - -### forever(fn, errback) - -Calls the asynchronous function `fn` with a callback parameter that allows it to -call itself again, in series, indefinitely. - -If an error is passed to the callback then `errback` is called with the -error, and execution stops, otherwise it will never be called. - -```js -async.forever( - function(next) { - // next is suitable for passing to things that need a callback(err [, whatever]); - // it will result in this function being called again. - }, - function(err) { - // if next is called with a value in its first parameter, it will appear - // in here as 'err', and execution will stop. - } -); -``` - ---------------------------------------- - - -### waterfall(tasks, [callback]) - -Runs the `tasks` array of functions in series, each passing their results to the next in -the array. However, if any of the `tasks` pass an error to their own callback, the -next function is not executed, and the main `callback` is immediately called with -the error. - -__Arguments__ - -* `tasks` - An array of functions to run, each function is passed a - `callback(err, result1, result2, ...)` it must call on completion. The first - argument is an error (which can be `null`) and any further arguments will be - passed as arguments in order to the next task. -* `callback(err, [results])` - An optional callback to run once all the functions - have completed. This will be passed the results of the last task's callback. - - - -__Example__ - -```js -async.waterfall([ - function(callback){ - callback(null, 'one', 'two'); - }, - function(arg1, arg2, callback){ - // arg1 now equals 'one' and arg2 now equals 'two' - callback(null, 'three'); - }, - function(arg1, callback){ - // arg1 now equals 'three' - callback(null, 'done'); - } -], function (err, result) { - // result now equals 'done' -}); -``` - ---------------------------------------- - -### compose(fn1, fn2...) - -Creates a function which is a composition of the passed asynchronous -functions. Each function consumes the return value of the function that -follows. Composing functions `f()`, `g()`, and `h()` would produce the result of -`f(g(h()))`, only this version uses callbacks to obtain the return values. - -Each function is executed with the `this` binding of the composed function. - -__Arguments__ - -* `functions...` - the asynchronous functions to compose - - -__Example__ - -```js -function add1(n, callback) { - setTimeout(function () { - callback(null, n + 1); - }, 10); -} - -function mul3(n, callback) { - setTimeout(function () { - callback(null, n * 3); - }, 10); -} - -var add1mul3 = async.compose(mul3, add1); - -add1mul3(4, function (err, result) { - // result now equals 15 -}); -``` - ---------------------------------------- - -### seq(fn1, fn2...) - -Version of the compose function that is more natural to read. -Each following function consumes the return value of the latter function. - -Each function is executed with the `this` binding of the composed function. - -__Arguments__ - -* functions... - the asynchronous functions to compose - - -__Example__ - -```js -// Requires lodash (or underscore), express3 and dresende's orm2. -// Part of an app, that fetches cats of the logged user. -// This example uses `seq` function to avoid overnesting and error -// handling clutter. -app.get('/cats', function(request, response) { - function handleError(err, data, callback) { - if (err) { - console.error(err); - response.json({ status: 'error', message: err.message }); - } - else { - callback(data); - } - } - var User = request.models.User; - async.seq( - _.bind(User.get, User), // 'User.get' has signature (id, callback(err, data)) - handleError, - function(user, fn) { - user.getCats(fn); // 'getCats' has signature (callback(err, data)) - }, - handleError, - function(cats) { - response.json({ status: 'ok', message: 'Cats found', data: cats }); - } - )(req.session.user_id); - } -}); -``` - ---------------------------------------- - -### applyEach(fns, args..., callback) - -Applies the provided arguments to each function in the array, calling -`callback` after all functions have completed. If you only provide the first -argument, then it will return a function which lets you pass in the -arguments as if it were a single function call. - -__Arguments__ - -* `fns` - the asynchronous functions to all call with the same arguments -* `args...` - any number of separate arguments to pass to the function -* `callback` - the final argument should be the callback, called when all - functions have completed processing - - -__Example__ - -```js -async.applyEach([enableSearch, updateSchema], 'bucket', callback); - -// partial application example: -async.each( - buckets, - async.applyEach([enableSearch, updateSchema]), - callback -); -``` - ---------------------------------------- - - -### applyEachSeries(arr, iterator, callback) - -The same as [`applyEach`](#applyEach) only the functions are applied in series. - ---------------------------------------- - - -### queue(worker, concurrency) - -Creates a `queue` object with the specified `concurrency`. Tasks added to the -`queue` are processed in parallel (up to the `concurrency` limit). If all -`worker`s are in progress, the task is queued until one becomes available. -Once a `worker` completes a `task`, that `task`'s callback is called. - -__Arguments__ - -* `worker(task, callback)` - An asynchronous function for processing a queued - task, which must call its `callback(err)` argument when finished, with an - optional `error` as an argument. -* `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. -* `started` - a function returning whether or not any items have been pushed and processed by the queue -* `running()` - a function returning the number of items currently being processed. -* `idle()` - a function returning false if there are items waiting or being processed, or true if not. -* `concurrency` - an integer for determining how many `worker` functions should be - run in parallel. This property can be changed after a `queue` is created to - alter the concurrency on-the-fly. -* `push(task, [callback])` - add a new task to the `queue`. Calls `callback` once - the `worker` has finished processing the task. Instead of a single task, a `tasks` array - can be submitted. The respective callback is used for every task in the list. -* `unshift(task, [callback])` - add a new task to the front of the `queue`. -* `saturated` - a callback that is called when the `queue` length hits the `concurrency` limit, - and further tasks will be queued. -* `empty` - a callback that is called when the last item from the `queue` is given to a `worker`. -* `drain` - a callback that is called when the last item from the `queue` has returned from the `worker`. -* `paused` - a boolean for determining whether the queue is in a paused state -* `pause()` - a function that pauses the processing of tasks until `resume()` is called. -* `resume()` - a function that resumes the processing of queued tasks when the queue is paused. -* `kill()` - a function that empties remaining tasks from the queue forcing it to go idle. - -__Example__ - -```js -// create a queue object with concurrency 2 - -var q = async.queue(function (task, callback) { - console.log('hello ' + task.name); - callback(); -}, 2); - - -// assign a callback -q.drain = function() { - console.log('all items have been processed'); -} - -// add some items to the queue - -q.push({name: 'foo'}, function (err) { - console.log('finished processing foo'); -}); -q.push({name: 'bar'}, function (err) { - console.log('finished processing bar'); -}); - -// add some items to the queue (batch-wise) - -q.push([{name: 'baz'},{name: 'bay'},{name: 'bax'}], function (err) { - console.log('finished processing bar'); -}); - -// add some items to the front of the queue - -q.unshift({name: 'bar'}, function (err) { - console.log('finished processing bar'); -}); -``` - - ---------------------------------------- - - -### priorityQueue(worker, concurrency) - -The same as [`queue`](#queue) only tasks are assigned a priority and completed in ascending priority order. There are two differences between `queue` and `priorityQueue` objects: - -* `push(task, priority, [callback])` - `priority` should be a number. If an array of - `tasks` is given, all tasks will be assigned the same priority. -* The `unshift` method was removed. - ---------------------------------------- - - -### cargo(worker, [payload]) - -Creates a `cargo` object with the specified payload. Tasks added to the -cargo will be processed altogether (up to the `payload` limit). If the -`worker` is in progress, the task is queued until it becomes available. Once -the `worker` has completed some tasks, each callback of those tasks is called. -Check out [this animation](https://camo.githubusercontent.com/6bbd36f4cf5b35a0f11a96dcd2e97711ffc2fb37/68747470733a2f2f662e636c6f75642e6769746875622e636f6d2f6173736574732f313637363837312f36383130382f62626330636662302d356632392d313165322d393734662d3333393763363464633835382e676966) for how `cargo` and `queue` work. - -While [queue](#queue) passes only one task to one of a group of workers -at a time, cargo passes an array of tasks to a single worker, repeating -when the worker is finished. - -__Arguments__ - -* `worker(tasks, callback)` - An asynchronous function for processing an array of - queued tasks, which must call its `callback(err)` argument when finished, with - an optional `err` argument. -* `payload` - An optional `integer` for determining how many tasks should be - processed per round; if omitted, the default is unlimited. - -__Cargo objects__ - -The `cargo` object returned by this function has the following properties and -methods: - -* `length()` - A function returning the number of items waiting to be processed. -* `payload` - An `integer` for determining how many tasks should be - process per round. This property can be changed after a `cargo` is created to - alter the payload on-the-fly. -* `push(task, [callback])` - Adds `task` to the `queue`. The callback is called - once the `worker` has finished processing the task. Instead of a single task, an array of `tasks` - can be submitted. The respective callback is used for every task in the list. -* `saturated` - A callback that is called when the `queue.length()` hits the concurrency and further tasks will be queued. -* `empty` - A callback that is called when the last item from the `queue` is given to a `worker`. -* `drain` - A callback that is called when the last item from the `queue` has returned from the `worker`. - -__Example__ - -```js -// create a cargo object with payload 2 - -var cargo = async.cargo(function (tasks, callback) { - for(var i=0; i -### auto(tasks, [callback]) - -Determines the best order for running the functions in `tasks`, based on their -requirements. Each function can optionally depend on other functions being completed -first, and each function is run as soon as its requirements are satisfied. - -If any of the functions pass an error to their callback, it will not -complete (so any other functions depending on it will not run), and the main -`callback` is immediately called with the error. Functions also receive an -object containing the results of functions which have completed so far. - -Note, all functions are called with a `results` object as a second argument, -so it is unsafe to pass functions in the `tasks` object which cannot handle the -extra argument. - -For example, this snippet of code: - -```js -async.auto({ - readData: async.apply(fs.readFile, 'data.txt', 'utf-8') -}, callback); -``` - -will have the effect of calling `readFile` with the results object as the last -argument, which will fail: - -```js -fs.readFile('data.txt', 'utf-8', cb, {}); -``` - -Instead, wrap the call to `readFile` in a function which does not forward the -`results` object: - -```js -async.auto({ - readData: function(cb, results){ - fs.readFile('data.txt', 'utf-8', cb); - } -}, callback); -``` - -__Arguments__ - -* `tasks` - An object. Each of its properties is either a function or an array of - requirements, with the function itself the last item in the array. The object's key - of a property serves as the name of the task defined by that property, - i.e. can be used when specifying requirements for other tasks. - The function receives two arguments: (1) a `callback(err, result)` which must be - called when finished, passing an `error` (which can be `null`) and the result of - the function's execution, and (2) a `results` object, containing the results of - the previously executed functions. -* `callback(err, results)` - An optional callback which is called when all the - tasks have been completed. It receives the `err` argument if any `tasks` - pass an error to their callback. Results are always returned; however, if - an error occurs, no further `tasks` will be performed, and the results - object will only contain partial results. - - -__Example__ - -```js -async.auto({ - get_data: function(callback){ - console.log('in get_data'); - // async code to get some data - callback(null, 'data', 'converted to array'); - }, - make_folder: function(callback){ - console.log('in make_folder'); - // async code to create a directory to store a file in - // this is run at the same time as getting the data - callback(null, 'folder'); - }, - write_file: ['get_data', 'make_folder', function(callback, results){ - console.log('in write_file', JSON.stringify(results)); - // once there is some data and the directory exists, - // write the data to a file in the directory - callback(null, 'filename'); - }], - email_link: ['write_file', function(callback, results){ - console.log('in email_link', JSON.stringify(results)); - // once the file is written let's email a link to it... - // results.write_file contains the filename returned by write_file. - callback(null, {'file':results.write_file, 'email':'user@example.com'}); - }] -}, function(err, results) { - console.log('err = ', err); - console.log('results = ', results); -}); -``` - -This is a fairly trivial example, but to do this using the basic parallel and -series functions would look like this: - -```js -async.parallel([ - function(callback){ - console.log('in get_data'); - // async code to get some data - callback(null, 'data', 'converted to array'); - }, - function(callback){ - console.log('in make_folder'); - // async code to create a directory to store a file in - // this is run at the same time as getting the data - callback(null, 'folder'); - } -], -function(err, results){ - async.series([ - function(callback){ - console.log('in write_file', JSON.stringify(results)); - // once there is some data and the directory exists, - // write the data to a file in the directory - results.push('filename'); - callback(null); - }, - function(callback){ - console.log('in email_link', JSON.stringify(results)); - // once the file is written let's email a link to it... - callback(null, {'file':results.pop(), 'email':'user@example.com'}); - } - ]); -}); -``` - -For a complicated series of `async` tasks, using the [`auto`](#auto) function makes adding -new tasks much easier (and the code more readable). - - ---------------------------------------- - - -### retry([times = 5], task, [callback]) - -Attempts to get a successful response from `task` no more than `times` times before -returning an error. If the task is successful, the `callback` will be passed the result -of the successfull task. If all attemps fail, the callback will be passed the error and -result (if any) of the final attempt. - -__Arguments__ - -* `times` - An integer indicating how many times to attempt the `task` before giving up. Defaults to 5. -* `task(callback, results)` - A function which receives two arguments: (1) a `callback(err, result)` - which must be called when finished, passing `err` (which can be `null`) and the `result` of - the function's execution, and (2) a `results` object, containing the results of - the previously executed functions (if nested inside another control flow). -* `callback(err, results)` - An optional callback which is called when the - task has succeeded, or after the final failed attempt. It receives the `err` and `result` arguments of the last attempt at completing the `task`. - -The [`retry`](#retry) function can be used as a stand-alone control flow by passing a -callback, as shown below: - -```js -async.retry(3, apiMethod, function(err, result) { - // do something with the result -}); -``` - -It can also be embeded within other control flow functions to retry individual methods -that are not as reliable, like this: - -```js -async.auto({ - users: api.getUsers.bind(api), - payments: async.retry(3, api.getPayments.bind(api)) -}, function(err, results) { - // do something with the results -}); -``` - - ---------------------------------------- - - -### iterator(tasks) - -Creates an iterator function which calls the next function in the `tasks` array, -returning a continuation to call the next one after that. It's also possible to -“peek” at the next iterator with `iterator.next()`. - -This function is used internally by the `async` module, but can be useful when -you want to manually control the flow of functions in series. - -__Arguments__ - -* `tasks` - An array of functions to run. - -__Example__ - -```js -var iterator = async.iterator([ - function(){ sys.p('one'); }, - function(){ sys.p('two'); }, - function(){ sys.p('three'); } -]); - -node> var iterator2 = iterator(); -'one' -node> var iterator3 = iterator2(); -'two' -node> iterator3(); -'three' -node> var nextfn = iterator2.next(); -node> nextfn(); -'three' -``` - ---------------------------------------- - - -### apply(function, arguments..) - -Creates a continuation function with some arguments already applied. - -Useful as a shorthand when combined with other control flow functions. Any arguments -passed to the returned function are added to the arguments originally passed -to apply. - -__Arguments__ - -* `function` - The function you want to eventually apply all arguments to. -* `arguments...` - Any number of arguments to automatically apply when the - continuation is called. - -__Example__ - -```js -// using apply - -async.parallel([ - async.apply(fs.writeFile, 'testfile1', 'test1'), - async.apply(fs.writeFile, 'testfile2', 'test2'), -]); - - -// the same process without using apply - -async.parallel([ - function(callback){ - fs.writeFile('testfile1', 'test1', callback); - }, - function(callback){ - fs.writeFile('testfile2', 'test2', callback); - } -]); -``` - -It's possible to pass any number of additional arguments when calling the -continuation: - -```js -node> var fn = async.apply(sys.puts, 'one'); -node> fn('two', 'three'); -one -two -three -``` - ---------------------------------------- - - -### nextTick(callback) - -Calls `callback` on a later loop around the event loop. In Node.js this just -calls `process.nextTick`; in the browser it falls back to `setImmediate(callback)` -if available, otherwise `setTimeout(callback, 0)`, which means other higher priority -events may precede the execution of `callback`. - -This is used internally for browser-compatibility purposes. - -__Arguments__ - -* `callback` - The function to call on a later loop around the event loop. - -__Example__ - -```js -var call_order = []; -async.nextTick(function(){ - call_order.push('two'); - // call_order now equals ['one','two'] -}); -call_order.push('one') -``` - - -### times(n, callback) - -Calls the `callback` function `n` times, and accumulates results in the same manner -you would use with [`map`](#map). - -__Arguments__ - -* `n` - The number of times to run the function. -* `callback` - The function to call `n` times. - -__Example__ - -```js -// Pretend this is some complicated async factory -var createUser = function(id, callback) { - callback(null, { - id: 'user' + id - }) -} -// generate 5 users -async.times(5, function(n, next){ - createUser(n, function(err, user) { - next(err, user) - }) -}, function(err, users) { - // we should now have 5 users -}); -``` - - -### timesSeries(n, callback) - -The same as [`times`](#times), only the iterator is applied to each item in `arr` in -series. The next `iterator` is only called once the current one has completed. -The results array will be in the same order as the original. - - -## Utils - - -### memoize(fn, [hasher]) - -Caches the results of an `async` function. When creating a hash to store function -results against, the callback is omitted from the hash and an optional hash -function can be used. - -The cache of results is exposed as the `memo` property of the function returned -by `memoize`. - -__Arguments__ - -* `fn` - The function to proxy and cache results from. -* `hasher` - Tn optional function for generating a custom hash for storing - results. It has all the arguments applied to it apart from the callback, and - must be synchronous. - -__Example__ - -```js -var slow_fn = function (name, callback) { - // do something - callback(null, result); -}; -var fn = async.memoize(slow_fn); - -// fn can now be used as if it were slow_fn -fn('some name', function () { - // callback -}); -``` - - -### unmemoize(fn) - -Undoes a [`memoize`](#memoize)d function, reverting it to the original, unmemoized -form. Handy for testing. - -__Arguments__ - -* `fn` - the memoized function - - -### log(function, arguments) - -Logs the result of an `async` function to the `console`. Only works in Node.js or -in browsers that support `console.log` and `console.error` (such as FF and Chrome). -If multiple arguments are returned from the async function, `console.log` is -called on each argument in order. - -__Arguments__ - -* `function` - The function you want to eventually apply all arguments to. -* `arguments...` - Any number of arguments to apply to the function. - -__Example__ - -```js -var hello = function(name, callback){ - setTimeout(function(){ - callback(null, 'hello ' + name); - }, 1000); -}; -``` -```js -node> async.log(hello, 'world'); -'hello world' -``` - ---------------------------------------- - - -### dir(function, arguments) - -Logs the result of an `async` function to the `console` using `console.dir` to -display the properties of the resulting object. Only works in Node.js or -in browsers that support `console.dir` and `console.error` (such as FF and Chrome). -If multiple arguments are returned from the async function, `console.dir` is -called on each argument in order. - -__Arguments__ - -* `function` - The function you want to eventually apply all arguments to. -* `arguments...` - Any number of arguments to apply to the function. - -__Example__ - -```js -var hello = function(name, callback){ - setTimeout(function(){ - callback(null, {hello: name}); - }, 1000); -}; -``` -```js -node> async.dir(hello, 'world'); -{hello: 'world'} -``` - ---------------------------------------- - - -### noConflict() - -Changes the value of `async` back to its original value, returning a reference to the -`async` object. diff --git a/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/async/component.json b/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/async/component.json deleted file mode 100644 index bbb0115..0000000 --- a/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/async/component.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "name": "async", - "repo": "caolan/async", - "description": "Higher-order functions and common patterns for asynchronous code", - "version": "0.1.23", - "keywords": [], - "dependencies": {}, - "development": {}, - "main": "lib/async.js", - "scripts": [ "lib/async.js" ] -} diff --git a/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/async/lib/async.js b/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/async/lib/async.js deleted file mode 100755 index 01e8afc..0000000 --- a/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/async/lib/async.js +++ /dev/null @@ -1,1123 +0,0 @@ -/*! - * async - * https://github.com/caolan/async - * - * Copyright 2010-2014 Caolan McMahon - * Released under the MIT license - */ -/*jshint onevar: false, indent:4 */ -/*global setImmediate: false, setTimeout: false, console: false */ -(function () { - - var async = {}; - - // global on the server, window in the browser - var root, previous_async; - - root = this; - if (root != null) { - previous_async = root.async; - } - - async.noConflict = function () { - root.async = previous_async; - return async; - }; - - function only_once(fn) { - var called = false; - return function() { - if (called) throw new Error("Callback was already called."); - called = true; - fn.apply(root, arguments); - } - } - - //// cross-browser compatiblity functions //// - - var _toString = Object.prototype.toString; - - var _isArray = Array.isArray || function (obj) { - return _toString.call(obj) === '[object Array]'; - }; - - var _each = function (arr, iterator) { - if (arr.forEach) { - return arr.forEach(iterator); - } - for (var i = 0; i < arr.length; i += 1) { - iterator(arr[i], i, arr); - } - }; - - var _map = function (arr, iterator) { - if (arr.map) { - return arr.map(iterator); - } - var results = []; - _each(arr, function (x, i, a) { - results.push(iterator(x, i, a)); - }); - return results; - }; - - var _reduce = function (arr, iterator, memo) { - if (arr.reduce) { - return arr.reduce(iterator, memo); - } - _each(arr, function (x, i, a) { - memo = iterator(memo, x, i, a); - }); - return memo; - }; - - var _keys = function (obj) { - if (Object.keys) { - return Object.keys(obj); - } - var keys = []; - for (var k in obj) { - if (obj.hasOwnProperty(k)) { - keys.push(k); - } - } - return keys; - }; - - //// exported async module functions //// - - //// nextTick implementation with browser-compatible fallback //// - if (typeof process === 'undefined' || !(process.nextTick)) { - if (typeof setImmediate === 'function') { - async.nextTick = function (fn) { - // not a direct alias for IE10 compatibility - setImmediate(fn); - }; - async.setImmediate = async.nextTick; - } - else { - async.nextTick = function (fn) { - setTimeout(fn, 0); - }; - async.setImmediate = async.nextTick; - } - } - else { - async.nextTick = process.nextTick; - if (typeof setImmediate !== 'undefined') { - async.setImmediate = function (fn) { - // not a direct alias for IE10 compatibility - setImmediate(fn); - }; - } - else { - async.setImmediate = async.nextTick; - } - } - - async.each = function (arr, iterator, callback) { - callback = callback || function () {}; - if (!arr.length) { - return callback(); - } - var completed = 0; - _each(arr, function (x) { - iterator(x, only_once(done) ); - }); - function done(err) { - if (err) { - callback(err); - callback = function () {}; - } - else { - completed += 1; - if (completed >= arr.length) { - callback(); - } - } - } - }; - async.forEach = async.each; - - async.eachSeries = function (arr, iterator, callback) { - callback = callback || function () {}; - if (!arr.length) { - return callback(); - } - var completed = 0; - var iterate = function () { - iterator(arr[completed], function (err) { - if (err) { - callback(err); - callback = function () {}; - } - else { - completed += 1; - if (completed >= arr.length) { - callback(); - } - else { - iterate(); - } - } - }); - }; - iterate(); - }; - async.forEachSeries = async.eachSeries; - - async.eachLimit = function (arr, limit, iterator, callback) { - var fn = _eachLimit(limit); - fn.apply(null, [arr, iterator, callback]); - }; - async.forEachLimit = async.eachLimit; - - var _eachLimit = function (limit) { - - return function (arr, iterator, callback) { - callback = callback || function () {}; - if (!arr.length || limit <= 0) { - return callback(); - } - var completed = 0; - var started = 0; - var running = 0; - - (function replenish () { - if (completed >= arr.length) { - return callback(); - } - - while (running < limit && started < arr.length) { - started += 1; - running += 1; - iterator(arr[started - 1], function (err) { - if (err) { - callback(err); - callback = function () {}; - } - else { - completed += 1; - running -= 1; - if (completed >= arr.length) { - callback(); - } - else { - replenish(); - } - } - }); - } - })(); - }; - }; - - - var doParallel = function (fn) { - return function () { - var args = Array.prototype.slice.call(arguments); - return fn.apply(null, [async.each].concat(args)); - }; - }; - var doParallelLimit = function(limit, fn) { - return function () { - var args = Array.prototype.slice.call(arguments); - return fn.apply(null, [_eachLimit(limit)].concat(args)); - }; - }; - var doSeries = function (fn) { - return function () { - var args = Array.prototype.slice.call(arguments); - return fn.apply(null, [async.eachSeries].concat(args)); - }; - }; - - - var _asyncMap = function (eachfn, arr, iterator, callback) { - arr = _map(arr, function (x, i) { - return {index: i, value: x}; - }); - if (!callback) { - eachfn(arr, function (x, callback) { - iterator(x.value, function (err) { - callback(err); - }); - }); - } else { - var results = []; - eachfn(arr, function (x, callback) { - iterator(x.value, function (err, v) { - results[x.index] = v; - callback(err); - }); - }, function (err) { - callback(err, results); - }); - } - }; - async.map = doParallel(_asyncMap); - async.mapSeries = doSeries(_asyncMap); - async.mapLimit = function (arr, limit, iterator, callback) { - return _mapLimit(limit)(arr, iterator, callback); - }; - - var _mapLimit = function(limit) { - return doParallelLimit(limit, _asyncMap); - }; - - // reduce only has a series version, as doing reduce in parallel won't - // work in many situations. - async.reduce = function (arr, memo, iterator, callback) { - async.eachSeries(arr, function (x, callback) { - iterator(memo, x, function (err, v) { - memo = v; - callback(err); - }); - }, function (err) { - callback(err, memo); - }); - }; - // inject alias - async.inject = async.reduce; - // foldl alias - async.foldl = async.reduce; - - async.reduceRight = function (arr, memo, iterator, callback) { - var reversed = _map(arr, function (x) { - return x; - }).reverse(); - async.reduce(reversed, memo, iterator, callback); - }; - // foldr alias - async.foldr = async.reduceRight; - - var _filter = function (eachfn, arr, iterator, callback) { - var results = []; - arr = _map(arr, function (x, i) { - return {index: i, value: x}; - }); - eachfn(arr, function (x, callback) { - iterator(x.value, function (v) { - if (v) { - results.push(x); - } - callback(); - }); - }, function (err) { - callback(_map(results.sort(function (a, b) { - return a.index - b.index; - }), function (x) { - return x.value; - })); - }); - }; - async.filter = doParallel(_filter); - async.filterSeries = doSeries(_filter); - // select alias - async.select = async.filter; - async.selectSeries = async.filterSeries; - - var _reject = function (eachfn, arr, iterator, callback) { - var results = []; - arr = _map(arr, function (x, i) { - return {index: i, value: x}; - }); - eachfn(arr, function (x, callback) { - iterator(x.value, function (v) { - if (!v) { - results.push(x); - } - callback(); - }); - }, function (err) { - callback(_map(results.sort(function (a, b) { - return a.index - b.index; - }), function (x) { - return x.value; - })); - }); - }; - async.reject = doParallel(_reject); - async.rejectSeries = doSeries(_reject); - - var _detect = function (eachfn, arr, iterator, main_callback) { - eachfn(arr, function (x, callback) { - iterator(x, function (result) { - if (result) { - main_callback(x); - main_callback = function () {}; - } - else { - callback(); - } - }); - }, function (err) { - main_callback(); - }); - }; - async.detect = doParallel(_detect); - async.detectSeries = doSeries(_detect); - - async.some = function (arr, iterator, main_callback) { - async.each(arr, function (x, callback) { - iterator(x, function (v) { - if (v) { - main_callback(true); - main_callback = function () {}; - } - callback(); - }); - }, function (err) { - main_callback(false); - }); - }; - // any alias - async.any = async.some; - - async.every = function (arr, iterator, main_callback) { - async.each(arr, function (x, callback) { - iterator(x, function (v) { - if (!v) { - main_callback(false); - main_callback = function () {}; - } - callback(); - }); - }, function (err) { - main_callback(true); - }); - }; - // all alias - async.all = async.every; - - async.sortBy = function (arr, iterator, callback) { - async.map(arr, function (x, callback) { - iterator(x, function (err, criteria) { - if (err) { - callback(err); - } - else { - callback(null, {value: x, criteria: criteria}); - } - }); - }, function (err, results) { - if (err) { - return callback(err); - } - else { - var fn = function (left, right) { - var a = left.criteria, b = right.criteria; - return a < b ? -1 : a > b ? 1 : 0; - }; - callback(null, _map(results.sort(fn), function (x) { - return x.value; - })); - } - }); - }; - - async.auto = function (tasks, callback) { - callback = callback || function () {}; - var keys = _keys(tasks); - var remainingTasks = keys.length - if (!remainingTasks) { - return callback(); - } - - 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 () { - remainingTasks-- - _each(listeners.slice(0), function (fn) { - fn(); - }); - }; - - addListener(function () { - if (!remainingTasks) { - var theCallback = callback; - // prevent final callback from calling itself if it errors - callback = function () {}; - - theCallback(null, results); - } - }); - - _each(keys, function (k) { - var task = _isArray(tasks[k]) ? tasks[k]: [tasks[k]]; - var taskCallback = function (err) { - var args = Array.prototype.slice.call(arguments, 1); - if (args.length <= 1) { - args = args[0]; - } - if (err) { - var safeResults = {}; - _each(_keys(results), function(rkey) { - safeResults[rkey] = results[rkey]; - }); - safeResults[k] = args; - callback(err, safeResults); - // stop subsequent errors hitting callback multiple times - callback = function () {}; - } - else { - results[k] = args; - async.setImmediate(taskComplete); - } - }; - var requires = task.slice(0, Math.abs(task.length - 1)) || []; - var ready = function () { - return _reduce(requires, function (a, x) { - return (a && results.hasOwnProperty(x)); - }, true) && !results.hasOwnProperty(k); - }; - if (ready()) { - task[task.length - 1](taskCallback, results); - } - else { - var listener = function () { - if (ready()) { - removeListener(listener); - task[task.length - 1](taskCallback, results); - } - }; - addListener(listener); - } - }); - }; - - async.retry = function(times, task, callback) { - var DEFAULT_TIMES = 5; - var attempts = []; - // Use defaults if times not passed - if (typeof times === 'function') { - callback = task; - task = times; - times = DEFAULT_TIMES; - } - // Make sure times is a number - times = parseInt(times, 10) || DEFAULT_TIMES; - var wrappedTask = function(wrappedCallback, wrappedResults) { - var retryAttempt = function(task, finalAttempt) { - return function(seriesCallback) { - task(function(err, result){ - seriesCallback(!err || finalAttempt, {err: err, result: result}); - }, wrappedResults); - }; - }; - while (times) { - attempts.push(retryAttempt(task, !(times-=1))); - } - async.series(attempts, function(done, data){ - data = data[data.length - 1]; - (wrappedCallback || callback)(data.err, data.result); - }); - } - // If a callback is passed, run this as a controll flow - return callback ? wrappedTask() : wrappedTask - }; - - async.waterfall = function (tasks, callback) { - callback = callback || function () {}; - if (!_isArray(tasks)) { - var err = new Error('First argument to waterfall must be an array of functions'); - return callback(err); - } - if (!tasks.length) { - return callback(); - } - var wrapIterator = function (iterator) { - return function (err) { - if (err) { - callback.apply(null, arguments); - callback = function () {}; - } - else { - var args = Array.prototype.slice.call(arguments, 1); - var next = iterator.next(); - if (next) { - args.push(wrapIterator(next)); - } - else { - args.push(callback); - } - async.setImmediate(function () { - iterator.apply(null, args); - }); - } - }; - }; - wrapIterator(async.iterator(tasks))(); - }; - - var _parallel = function(eachfn, tasks, callback) { - callback = callback || function () {}; - if (_isArray(tasks)) { - eachfn.map(tasks, function (fn, callback) { - if (fn) { - fn(function (err) { - var args = Array.prototype.slice.call(arguments, 1); - if (args.length <= 1) { - args = args[0]; - } - callback.call(null, err, args); - }); - } - }, callback); - } - else { - var results = {}; - eachfn.each(_keys(tasks), function (k, callback) { - tasks[k](function (err) { - var args = Array.prototype.slice.call(arguments, 1); - if (args.length <= 1) { - args = args[0]; - } - results[k] = args; - callback(err); - }); - }, function (err) { - callback(err, results); - }); - } - }; - - async.parallel = function (tasks, callback) { - _parallel({ map: async.map, each: async.each }, tasks, callback); - }; - - async.parallelLimit = function(tasks, limit, callback) { - _parallel({ map: _mapLimit(limit), each: _eachLimit(limit) }, tasks, callback); - }; - - async.series = function (tasks, callback) { - callback = callback || function () {}; - if (_isArray(tasks)) { - async.mapSeries(tasks, function (fn, callback) { - if (fn) { - fn(function (err) { - var args = Array.prototype.slice.call(arguments, 1); - if (args.length <= 1) { - args = args[0]; - } - callback.call(null, err, args); - }); - } - }, callback); - } - else { - var results = {}; - async.eachSeries(_keys(tasks), function (k, callback) { - tasks[k](function (err) { - var args = Array.prototype.slice.call(arguments, 1); - if (args.length <= 1) { - args = args[0]; - } - results[k] = args; - callback(err); - }); - }, function (err) { - callback(err, results); - }); - } - }; - - async.iterator = function (tasks) { - var makeCallback = function (index) { - var fn = function () { - if (tasks.length) { - tasks[index].apply(null, arguments); - } - return fn.next(); - }; - fn.next = function () { - return (index < tasks.length - 1) ? makeCallback(index + 1): null; - }; - return fn; - }; - return makeCallback(0); - }; - - async.apply = function (fn) { - var args = Array.prototype.slice.call(arguments, 1); - return function () { - return fn.apply( - null, args.concat(Array.prototype.slice.call(arguments)) - ); - }; - }; - - var _concat = function (eachfn, arr, fn, callback) { - var r = []; - eachfn(arr, function (x, cb) { - fn(x, function (err, y) { - r = r.concat(y || []); - cb(err); - }); - }, function (err) { - callback(err, r); - }); - }; - async.concat = doParallel(_concat); - async.concatSeries = doSeries(_concat); - - async.whilst = function (test, iterator, callback) { - if (test()) { - iterator(function (err) { - if (err) { - return callback(err); - } - async.whilst(test, iterator, callback); - }); - } - else { - callback(); - } - }; - - async.doWhilst = function (iterator, test, callback) { - iterator(function (err) { - if (err) { - return callback(err); - } - var args = Array.prototype.slice.call(arguments, 1); - if (test.apply(null, args)) { - async.doWhilst(iterator, test, callback); - } - else { - callback(); - } - }); - }; - - async.until = function (test, iterator, callback) { - if (!test()) { - iterator(function (err) { - if (err) { - return callback(err); - } - async.until(test, iterator, callback); - }); - } - else { - callback(); - } - }; - - async.doUntil = function (iterator, test, callback) { - iterator(function (err) { - if (err) { - return callback(err); - } - var args = Array.prototype.slice.call(arguments, 1); - if (!test.apply(null, args)) { - async.doUntil(iterator, test, callback); - } - else { - callback(); - } - }); - }; - - async.queue = function (worker, concurrency) { - if (concurrency === undefined) { - concurrency = 1; - } - function _insert(q, data, pos, callback) { - if (!q.started){ - q.started = true; - } - if (!_isArray(data)) { - data = [data]; - } - if(data.length == 0) { - // call drain immediately if there are no tasks - return async.setImmediate(function() { - if (q.drain) { - q.drain(); - } - }); - } - _each(data, function(task) { - var item = { - data: task, - callback: typeof callback === 'function' ? callback : null - }; - - if (pos) { - q.tasks.unshift(item); - } else { - q.tasks.push(item); - } - - if (q.saturated && q.tasks.length === q.concurrency) { - q.saturated(); - } - async.setImmediate(q.process); - }); - } - - var workers = 0; - var q = { - tasks: [], - concurrency: concurrency, - saturated: null, - empty: null, - drain: null, - started: false, - paused: false, - push: function (data, callback) { - _insert(q, data, false, callback); - }, - kill: function () { - q.drain = null; - q.tasks = []; - }, - unshift: function (data, callback) { - _insert(q, data, true, callback); - }, - process: function () { - if (!q.paused && workers < q.concurrency && q.tasks.length) { - var task = q.tasks.shift(); - if (q.empty && q.tasks.length === 0) { - q.empty(); - } - workers += 1; - var next = function () { - workers -= 1; - if (task.callback) { - task.callback.apply(task, arguments); - } - if (q.drain && q.tasks.length + workers === 0) { - q.drain(); - } - q.process(); - }; - var cb = only_once(next); - worker(task.data, cb); - } - }, - length: function () { - return q.tasks.length; - }, - running: function () { - return workers; - }, - idle: function() { - return q.tasks.length + workers === 0; - }, - pause: function () { - if (q.paused === true) { return; } - q.paused = true; - q.process(); - }, - resume: function () { - if (q.paused === false) { return; } - q.paused = false; - q.process(); - } - }; - return q; - }; - - async.priorityQueue = function (worker, concurrency) { - - function _compareTasks(a, b){ - return a.priority - b.priority; - }; - - function _binarySearch(sequence, item, compare) { - var beg = -1, - end = sequence.length - 1; - while (beg < end) { - var mid = beg + ((end - beg + 1) >>> 1); - if (compare(item, sequence[mid]) >= 0) { - beg = mid; - } else { - end = mid - 1; - } - } - return beg; - } - - function _insert(q, data, priority, callback) { - if (!q.started){ - q.started = true; - } - if (!_isArray(data)) { - data = [data]; - } - if(data.length == 0) { - // call drain immediately if there are no tasks - return async.setImmediate(function() { - if (q.drain) { - q.drain(); - } - }); - } - _each(data, function(task) { - var item = { - data: task, - priority: priority, - callback: typeof callback === 'function' ? callback : null - }; - - q.tasks.splice(_binarySearch(q.tasks, item, _compareTasks) + 1, 0, item); - - if (q.saturated && q.tasks.length === q.concurrency) { - q.saturated(); - } - async.setImmediate(q.process); - }); - } - - // Start with a normal queue - var q = async.queue(worker, concurrency); - - // Override push to accept second parameter representing priority - q.push = function (data, priority, callback) { - _insert(q, data, priority, callback); - }; - - // Remove unshift function - delete q.unshift; - - return q; - }; - - async.cargo = function (worker, payload) { - var working = false, - tasks = []; - - var cargo = { - tasks: tasks, - payload: payload, - saturated: null, - empty: null, - drain: null, - drained: true, - push: function (data, callback) { - if (!_isArray(data)) { - data = [data]; - } - _each(data, function(task) { - tasks.push({ - data: task, - callback: typeof callback === 'function' ? callback : null - }); - cargo.drained = false; - if (cargo.saturated && tasks.length === payload) { - cargo.saturated(); - } - }); - async.setImmediate(cargo.process); - }, - process: function process() { - if (working) return; - if (tasks.length === 0) { - if(cargo.drain && !cargo.drained) cargo.drain(); - cargo.drained = true; - return; - } - - var ts = typeof payload === 'number' - ? tasks.splice(0, payload) - : tasks.splice(0, tasks.length); - - var ds = _map(ts, function (task) { - return task.data; - }); - - if(cargo.empty) cargo.empty(); - working = true; - worker(ds, function () { - working = false; - - var args = arguments; - _each(ts, function (data) { - if (data.callback) { - data.callback.apply(null, args); - } - }); - - process(); - }); - }, - length: function () { - return tasks.length; - }, - running: function () { - return working; - } - }; - return cargo; - }; - - var _console_fn = function (name) { - return function (fn) { - var args = Array.prototype.slice.call(arguments, 1); - fn.apply(null, args.concat([function (err) { - var args = Array.prototype.slice.call(arguments, 1); - if (typeof console !== 'undefined') { - if (err) { - if (console.error) { - console.error(err); - } - } - else if (console[name]) { - _each(args, function (x) { - console[name](x); - }); - } - } - }])); - }; - }; - async.log = _console_fn('log'); - async.dir = _console_fn('dir'); - /*async.info = _console_fn('info'); - async.warn = _console_fn('warn'); - async.error = _console_fn('error');*/ - - async.memoize = function (fn, hasher) { - var memo = {}; - var queues = {}; - hasher = hasher || function (x) { - return x; - }; - var memoized = function () { - var args = Array.prototype.slice.call(arguments); - var callback = args.pop(); - var key = hasher.apply(null, args); - if (key in memo) { - async.nextTick(function () { - callback.apply(null, memo[key]); - }); - } - else if (key in queues) { - queues[key].push(callback); - } - else { - queues[key] = [callback]; - fn.apply(null, args.concat([function () { - memo[key] = arguments; - var q = queues[key]; - delete queues[key]; - for (var i = 0, l = q.length; i < l; i++) { - q[i].apply(null, arguments); - } - }])); - } - }; - memoized.memo = memo; - memoized.unmemoized = fn; - return memoized; - }; - - async.unmemoize = function (fn) { - return function () { - return (fn.unmemoized || fn).apply(null, arguments); - }; - }; - - async.times = function (count, iterator, callback) { - var counter = []; - for (var i = 0; i < count; i++) { - counter.push(i); - } - return async.map(counter, iterator, callback); - }; - - async.timesSeries = function (count, iterator, callback) { - var counter = []; - for (var i = 0; i < count; i++) { - counter.push(i); - } - return async.mapSeries(counter, iterator, callback); - }; - - async.seq = function (/* functions... */) { - var fns = arguments; - return function () { - var that = this; - var args = Array.prototype.slice.call(arguments); - var callback = args.pop(); - async.reduce(fns, args, function (newargs, fn, cb) { - fn.apply(that, newargs.concat([function () { - var err = arguments[0]; - var nextargs = Array.prototype.slice.call(arguments, 1); - cb(err, nextargs); - }])) - }, - function (err, results) { - callback.apply(that, [err].concat(results)); - }); - }; - }; - - async.compose = function (/* functions... */) { - return async.seq.apply(null, Array.prototype.reverse.call(arguments)); - }; - - var _applyEach = function (eachfn, fns /*args...*/) { - var go = function () { - var that = this; - var args = Array.prototype.slice.call(arguments); - var callback = args.pop(); - return eachfn(fns, function (fn, cb) { - fn.apply(that, args.concat([cb])); - }, - callback); - }; - if (arguments.length > 2) { - var args = Array.prototype.slice.call(arguments, 2); - return go.apply(this, args); - } - else { - return go; - } - }; - async.applyEach = doParallel(_applyEach); - async.applyEachSeries = doSeries(_applyEach); - - async.forever = function (fn, callback) { - function next(err) { - if (err) { - if (callback) { - return callback(err); - } - throw err; - } - fn(next); - } - next(); - }; - - // Node.js - if (typeof module !== 'undefined' && module.exports) { - module.exports = async; - } - // AMD / RequireJS - else if (typeof define !== 'undefined' && define.amd) { - define([], function () { - return async; - }); - } - // included directly via \n\n```\n\n## Documentation\n\n### Collections\n\n* [`each`](#each)\n* [`eachSeries`](#eachSeries)\n* [`eachLimit`](#eachLimit)\n* [`map`](#map)\n* [`mapSeries`](#mapSeries)\n* [`mapLimit`](#mapLimit)\n* [`filter`](#filter)\n* [`filterSeries`](#filterSeries)\n* [`reject`](#reject)\n* [`rejectSeries`](#rejectSeries)\n* [`reduce`](#reduce)\n* [`reduceRight`](#reduceRight)\n* [`detect`](#detect)\n* [`detectSeries`](#detectSeries)\n* [`sortBy`](#sortBy)\n* [`some`](#some)\n* [`every`](#every)\n* [`concat`](#concat)\n* [`concatSeries`](#concatSeries)\n\n### Control Flow\n\n* [`series`](#seriestasks-callback)\n* [`parallel`](#parallel)\n* [`parallelLimit`](#parallellimittasks-limit-callback)\n* [`whilst`](#whilst)\n* [`doWhilst`](#doWhilst)\n* [`until`](#until)\n* [`doUntil`](#doUntil)\n* [`forever`](#forever)\n* [`waterfall`](#waterfall)\n* [`compose`](#compose)\n* [`seq`](#seq)\n* [`applyEach`](#applyEach)\n* [`applyEachSeries`](#applyEachSeries)\n* [`queue`](#queue)\n* [`priorityQueue`](#priorityQueue)\n* [`cargo`](#cargo)\n* [`auto`](#auto)\n* [`retry`](#retry)\n* [`iterator`](#iterator)\n* [`apply`](#apply)\n* [`nextTick`](#nextTick)\n* [`times`](#times)\n* [`timesSeries`](#timesSeries)\n\n### Utils\n\n* [`memoize`](#memoize)\n* [`unmemoize`](#unmemoize)\n* [`log`](#log)\n* [`dir`](#dir)\n* [`noConflict`](#noConflict)\n\n\n## Collections\n\n\n\n### each(arr, iterator, callback)\n\nApplies the function `iterator` to each item in `arr`, in parallel.\nThe `iterator` is called with an item from the list, and a callback for when it\nhas finished. If the `iterator` passes an error to its `callback`, the main\n`callback` (for the `each` function) is immediately called with the error.\n\nNote, that since this function applies `iterator` to each item in parallel,\nthere is no guarantee that the iterator functions will complete in order.\n\n__Arguments__\n\n* `arr` - An array to iterate over.\n* `iterator(item, callback)` - A function to apply to each item in `arr`.\n The iterator is passed a `callback(err)` which must be called once it has \n completed. If no error has occured, the `callback` should be run without \n arguments or with an explicit `null` argument.\n* `callback(err)` - A callback which is called when all `iterator` functions\n have finished, or an error occurs.\n\n__Examples__\n\n\n```js\n// assuming openFiles is an array of file names and saveFile is a function\n// to save the modified contents of that file:\n\nasync.each(openFiles, saveFile, function(err){\n // if any of the saves produced an error, err would equal that error\n});\n```\n\n```js\n// assuming openFiles is an array of file names \n\nasync.each(openFiles, function( file, callback) {\n \n // Perform operation on file here.\n console.log('Processing file ' + file);\n \n if( file.length > 32 ) {\n console.log('This file name is too long');\n callback('File name too long');\n } else {\n // Do work to process file here\n console.log('File processed');\n callback();\n }\n}, function(err){\n // if any of the file processing produced an error, err would equal that error\n if( err ) {\n // One of the iterations produced an error.\n // All processing will now stop.\n console.log('A file failed to process');\n } else {\n console.log('All files have been processed successfully');\n }\n});\n```\n\n---------------------------------------\n\n\n\n### eachSeries(arr, iterator, callback)\n\nThe same as [`each`](#each), only `iterator` is applied to each item in `arr` in\nseries. The next `iterator` is only called once the current one has completed. \nThis means the `iterator` functions will complete in order.\n\n\n---------------------------------------\n\n\n\n### eachLimit(arr, limit, iterator, callback)\n\nThe same as [`each`](#each), only no more than `limit` `iterator`s will be simultaneously \nrunning at any time.\n\nNote that the items in `arr` are not processed in batches, so there is no guarantee that \nthe first `limit` `iterator` functions will complete before any others are started.\n\n__Arguments__\n\n* `arr` - An array to iterate over.\n* `limit` - The maximum number of `iterator`s to run at any time.\n* `iterator(item, callback)` - A function to apply to each item in `arr`.\n The iterator is passed a `callback(err)` which must be called once it has \n completed. If no error has occured, the callback should be run without \n arguments or with an explicit `null` argument.\n* `callback(err)` - A callback which is called when all `iterator` functions\n have finished, or an error occurs.\n\n__Example__\n\n```js\n// Assume documents is an array of JSON objects and requestApi is a\n// function that interacts with a rate-limited REST api.\n\nasync.eachLimit(documents, 20, requestApi, function(err){\n // if any of the saves produced an error, err would equal that error\n});\n```\n\n---------------------------------------\n\n\n### map(arr, iterator, callback)\n\nProduces a new array of values by mapping each value in `arr` through\nthe `iterator` function. The `iterator` is called with an item from `arr` and a\ncallback for when it has finished processing. Each of these callback takes 2 arguments: \nan `error`, and the transformed item from `arr`. If `iterator` passes an error to this \ncallback, the main `callback` (for the `map` function) is immediately called with the error.\n\nNote, that since this function applies the `iterator` to each item in parallel,\nthere is no guarantee that the `iterator` functions will complete in order. \nHowever, the results array will be in the same order as the original `arr`.\n\n__Arguments__\n\n* `arr` - An array to iterate over.\n* `iterator(item, callback)` - A function to apply to each item in `arr`.\n The iterator is passed a `callback(err, transformed)` which must be called once \n it has completed with an error (which can be `null`) and a transformed item.\n* `callback(err, results)` - A callback which is called when all `iterator`\n functions have finished, or an error occurs. Results is an array of the\n transformed items from the `arr`.\n\n__Example__\n\n```js\nasync.map(['file1','file2','file3'], fs.stat, function(err, results){\n // results is now an array of stats for each file\n});\n```\n\n---------------------------------------\n\n\n### mapSeries(arr, iterator, callback)\n\nThe same as [`map`](#map), only the `iterator` is applied to each item in `arr` in\nseries. The next `iterator` is only called once the current one has completed. \nThe results array will be in the same order as the original.\n\n\n---------------------------------------\n\n\n### mapLimit(arr, limit, iterator, callback)\n\nThe same as [`map`](#map), only no more than `limit` `iterator`s will be simultaneously \nrunning at any time.\n\nNote that the items are not processed in batches, so there is no guarantee that \nthe first `limit` `iterator` functions will complete before any others are started.\n\n__Arguments__\n\n* `arr` - An array to iterate over.\n* `limit` - The maximum number of `iterator`s to run at any time.\n* `iterator(item, callback)` - A function to apply to each item in `arr`.\n The iterator is passed a `callback(err, transformed)` which must be called once \n it has completed with an error (which can be `null`) and a transformed item.\n* `callback(err, results)` - A callback which is called when all `iterator`\n calls have finished, or an error occurs. The result is an array of the\n transformed items from the original `arr`.\n\n__Example__\n\n```js\nasync.mapLimit(['file1','file2','file3'], 1, fs.stat, function(err, results){\n // results is now an array of stats for each file\n});\n```\n\n---------------------------------------\n\n\n\n### filter(arr, iterator, callback)\n\n__Alias:__ `select`\n\nReturns a new array of all the values in `arr` which pass an async truth test.\n_The callback for each `iterator` call only accepts a single argument of `true` or\n`false`; it does not accept an error argument first!_ This is in-line with the\nway node libraries work with truth tests like `fs.exists`. This operation is\nperformed in parallel, but the results array will be in the same order as the\noriginal.\n\n__Arguments__\n\n* `arr` - An array to iterate over.\n* `iterator(item, callback)` - A truth test to apply to each item in `arr`.\n The `iterator` is passed a `callback(truthValue)`, which must be called with a \n boolean argument once it has completed.\n* `callback(results)` - A callback which is called after all the `iterator`\n functions have finished.\n\n__Example__\n\n```js\nasync.filter(['file1','file2','file3'], fs.exists, function(results){\n // results now equals an array of the existing files\n});\n```\n\n---------------------------------------\n\n\n\n### filterSeries(arr, iterator, callback)\n\n__Alias:__ `selectSeries`\n\nThe same as [`filter`](#filter) only the `iterator` is applied to each item in `arr` in\nseries. The next `iterator` is only called once the current one has completed. \nThe results array will be in the same order as the original.\n\n---------------------------------------\n\n\n### reject(arr, iterator, callback)\n\nThe opposite of [`filter`](#filter). Removes values that pass an `async` truth test.\n\n---------------------------------------\n\n\n### rejectSeries(arr, iterator, callback)\n\nThe same as [`reject`](#reject), only the `iterator` is applied to each item in `arr`\nin series.\n\n\n---------------------------------------\n\n\n### reduce(arr, memo, iterator, callback)\n\n__Aliases:__ `inject`, `foldl`\n\nReduces `arr` into a single value using an async `iterator` to return\neach successive step. `memo` is the initial state of the reduction. \nThis function only operates in series. \n\nFor performance reasons, it may make sense to split a call to this function into \na parallel map, and then use the normal `Array.prototype.reduce` on the results. \nThis function is for situations where each step in the reduction needs to be async; \nif you can get the data before reducing it, then it's probably a good idea to do so.\n\n__Arguments__\n\n* `arr` - An array to iterate over.\n* `memo` - The initial state of the reduction.\n* `iterator(memo, item, callback)` - A function applied to each item in the\n array to produce the next step in the reduction. The `iterator` is passed a\n `callback(err, reduction)` which accepts an optional error as its first \n argument, and the state of the reduction as the second. If an error is \n passed to the callback, the reduction is stopped and the main `callback` is \n immediately called with the error.\n* `callback(err, result)` - A callback which is called after all the `iterator`\n functions have finished. Result is the reduced value.\n\n__Example__\n\n```js\nasync.reduce([1,2,3], 0, function(memo, item, callback){\n // pointless async:\n process.nextTick(function(){\n callback(null, memo + item)\n });\n}, function(err, result){\n // result is now equal to the last value of memo, which is 6\n});\n```\n\n---------------------------------------\n\n\n### reduceRight(arr, memo, iterator, callback)\n\n__Alias:__ `foldr`\n\nSame as [`reduce`](#reduce), only operates on `arr` in reverse order.\n\n\n---------------------------------------\n\n\n### detect(arr, iterator, callback)\n\nReturns the first value in `arr` that passes an async truth test. The\n`iterator` is applied in parallel, meaning the first iterator to return `true` will\nfire the detect `callback` with that result. That means the result might not be\nthe first item in the original `arr` (in terms of order) that passes the test.\n\nIf order within the original `arr` is important, then look at [`detectSeries`](#detectSeries).\n\n__Arguments__\n\n* `arr` - An array to iterate over.\n* `iterator(item, callback)` - A truth test to apply to each item in `arr`.\n The iterator is passed a `callback(truthValue)` which must be called with a \n boolean argument once it has completed.\n* `callback(result)` - A callback which is called as soon as any iterator returns\n `true`, or after all the `iterator` functions have finished. Result will be\n the first item in the array that passes the truth test (iterator) or the\n value `undefined` if none passed.\n\n__Example__\n\n```js\nasync.detect(['file1','file2','file3'], fs.exists, function(result){\n // result now equals the first file in the list that exists\n});\n```\n\n---------------------------------------\n\n\n### detectSeries(arr, iterator, callback)\n\nThe same as [`detect`](#detect), only the `iterator` is applied to each item in `arr`\nin series. This means the result is always the first in the original `arr` (in\nterms of array order) that passes the truth test.\n\n\n---------------------------------------\n\n\n### sortBy(arr, iterator, callback)\n\nSorts a list by the results of running each `arr` value through an async `iterator`.\n\n__Arguments__\n\n* `arr` - An array to iterate over.\n* `iterator(item, callback)` - A function to apply to each item in `arr`.\n The iterator is passed a `callback(err, sortValue)` which must be called once it\n has completed with an error (which can be `null`) and a value to use as the sort\n criteria.\n* `callback(err, results)` - A callback which is called after all the `iterator`\n functions have finished, or an error occurs. Results is the items from\n the original `arr` sorted by the values returned by the `iterator` calls.\n\n__Example__\n\n```js\nasync.sortBy(['file1','file2','file3'], function(file, callback){\n fs.stat(file, function(err, stats){\n callback(err, stats.mtime);\n });\n}, function(err, results){\n // results is now the original array of files sorted by\n // modified date\n});\n```\n\n__Sort Order__\n\nBy modifying the callback parameter the sorting order can be influenced:\n\n```js\n//ascending order\nasync.sortBy([1,9,3,5], function(x, callback){\n callback(err, x);\n}, function(err,result){\n //result callback\n} );\n\n//descending order\nasync.sortBy([1,9,3,5], function(x, callback){\n callback(err, x*-1); //<- x*-1 instead of x, turns the order around\n}, function(err,result){\n //result callback\n} );\n```\n\n---------------------------------------\n\n\n### some(arr, iterator, callback)\n\n__Alias:__ `any`\n\nReturns `true` if at least one element in the `arr` satisfies an async test.\n_The callback for each iterator call only accepts a single argument of `true` or\n`false`; it does not accept an error argument first!_ This is in-line with the\nway node libraries work with truth tests like `fs.exists`. Once any iterator\ncall returns `true`, the main `callback` is immediately called.\n\n__Arguments__\n\n* `arr` - An array to iterate over.\n* `iterator(item, callback)` - A truth test to apply to each item in the array\n in parallel. The iterator is passed a callback(truthValue) which must be \n called with a boolean argument once it has completed.\n* `callback(result)` - A callback which is called as soon as any iterator returns\n `true`, or after all the iterator functions have finished. Result will be\n either `true` or `false` depending on the values of the async tests.\n\n__Example__\n\n```js\nasync.some(['file1','file2','file3'], fs.exists, function(result){\n // if result is true then at least one of the files exists\n});\n```\n\n---------------------------------------\n\n\n### every(arr, iterator, callback)\n\n__Alias:__ `all`\n\nReturns `true` if every element in `arr` satisfies an async test.\n_The callback for each `iterator` call only accepts a single argument of `true` or\n`false`; it does not accept an error argument first!_ This is in-line with the\nway node libraries work with truth tests like `fs.exists`.\n\n__Arguments__\n\n* `arr` - An array to iterate over.\n* `iterator(item, callback)` - A truth test to apply to each item in the array\n in parallel. The iterator is passed a callback(truthValue) which must be \n called with a boolean argument once it has completed.\n* `callback(result)` - A callback which is called after all the `iterator`\n functions have finished. Result will be either `true` or `false` depending on\n the values of the async tests.\n\n__Example__\n\n```js\nasync.every(['file1','file2','file3'], fs.exists, function(result){\n // if result is true then every file exists\n});\n```\n\n---------------------------------------\n\n\n### concat(arr, iterator, callback)\n\nApplies `iterator` to each item in `arr`, concatenating the results. Returns the\nconcatenated list. The `iterator`s are called in parallel, and the results are\nconcatenated as they return. There is no guarantee that the results array will\nbe returned in the original order of `arr` passed to the `iterator` function.\n\n__Arguments__\n\n* `arr` - An array to iterate over.\n* `iterator(item, callback)` - A function to apply to each item in `arr`.\n The iterator is passed a `callback(err, results)` which must be called once it \n has completed with an error (which can be `null`) and an array of results.\n* `callback(err, results)` - A callback which is called after all the `iterator`\n functions have finished, or an error occurs. Results is an array containing\n the concatenated results of the `iterator` function.\n\n__Example__\n\n```js\nasync.concat(['dir1','dir2','dir3'], fs.readdir, function(err, files){\n // files is now a list of filenames that exist in the 3 directories\n});\n```\n\n---------------------------------------\n\n\n### concatSeries(arr, iterator, callback)\n\nSame as [`concat`](#concat), but executes in series instead of parallel.\n\n\n## Control Flow\n\n\n### series(tasks, [callback])\n\nRun the functions in the `tasks` array in series, each one running once the previous\nfunction has completed. If any functions in the series pass an error to its\ncallback, no more functions are run, and `callback` is immediately called with the value of the error. \nOtherwise, `callback` receives an array of results when `tasks` have completed.\n\nIt is also possible to use an object instead of an array. Each property will be\nrun as a function, and the results will be passed to the final `callback` as an object\ninstead of an array. This can be a more readable way of handling results from\n[`series`](#series).\n\n**Note** that while many implementations preserve the order of object properties, the\n[ECMAScript Language Specifcation](http://www.ecma-international.org/ecma-262/5.1/#sec-8.6) \nexplicitly states that\n\n> The mechanics and order of enumerating the properties is not specified.\n\nSo if you rely on the order in which your series of functions are executed, and want\nthis to work on all platforms, consider using an array. \n\n__Arguments__\n\n* `tasks` - An array or object containing functions to run, each function is passed\n a `callback(err, result)` it must call on completion with an error `err` (which can\n be `null`) and an optional `result` value.\n* `callback(err, results)` - An optional callback to run once all the functions\n have completed. This function gets a results array (or object) containing all \n the result arguments passed to the `task` callbacks.\n\n__Example__\n\n```js\nasync.series([\n function(callback){\n // do some stuff ...\n callback(null, 'one');\n },\n function(callback){\n // do some more stuff ...\n callback(null, 'two');\n }\n],\n// optional callback\nfunction(err, results){\n // results is now equal to ['one', 'two']\n});\n\n\n// an example using an object instead of an array\nasync.series({\n one: function(callback){\n setTimeout(function(){\n callback(null, 1);\n }, 200);\n },\n two: function(callback){\n setTimeout(function(){\n callback(null, 2);\n }, 100);\n }\n},\nfunction(err, results) {\n // results is now equal to: {one: 1, two: 2}\n});\n```\n\n---------------------------------------\n\n\n### parallel(tasks, [callback])\n\nRun the `tasks` array of functions in parallel, without waiting until the previous\nfunction has completed. If any of the functions pass an error to its\ncallback, the main `callback` is immediately called with the value of the error.\nOnce the `tasks` have completed, the results are passed to the final `callback` as an\narray.\n\nIt is also possible to use an object instead of an array. Each property will be\nrun as a function and the results will be passed to the final `callback` as an object\ninstead of an array. This can be a more readable way of handling results from\n[`parallel`](#parallel).\n\n\n__Arguments__\n\n* `tasks` - An array or object containing functions to run. Each function is passed \n a `callback(err, result)` which it must call on completion with an error `err` \n (which can be `null`) and an optional `result` value.\n* `callback(err, results)` - An optional callback to run once all the functions\n have completed. This function gets a results array (or object) containing all \n the result arguments passed to the task callbacks.\n\n__Example__\n\n```js\nasync.parallel([\n function(callback){\n setTimeout(function(){\n callback(null, 'one');\n }, 200);\n },\n function(callback){\n setTimeout(function(){\n callback(null, 'two');\n }, 100);\n }\n],\n// optional callback\nfunction(err, results){\n // the results array will equal ['one','two'] even though\n // the second function had a shorter timeout.\n});\n\n\n// an example using an object instead of an array\nasync.parallel({\n one: function(callback){\n setTimeout(function(){\n callback(null, 1);\n }, 200);\n },\n two: function(callback){\n setTimeout(function(){\n callback(null, 2);\n }, 100);\n }\n},\nfunction(err, results) {\n // results is now equals to: {one: 1, two: 2}\n});\n```\n\n---------------------------------------\n\n\n### parallelLimit(tasks, limit, [callback])\n\nThe same as [`parallel`](#parallel), only `tasks` are executed in parallel \nwith a maximum of `limit` tasks executing at any time.\n\nNote that the `tasks` are not executed in batches, so there is no guarantee that \nthe first `limit` tasks will complete before any others are started.\n\n__Arguments__\n\n* `tasks` - An array or object containing functions to run, each function is passed \n a `callback(err, result)` it must call on completion with an error `err` (which can\n be `null`) and an optional `result` value.\n* `limit` - The maximum number of `tasks` to run at any time.\n* `callback(err, results)` - An optional callback to run once all the functions\n have completed. This function gets a results array (or object) containing all \n the result arguments passed to the `task` callbacks.\n\n---------------------------------------\n\n\n### whilst(test, fn, callback)\n\nRepeatedly call `fn`, while `test` returns `true`. Calls `callback` when stopped,\nor an error occurs.\n\n__Arguments__\n\n* `test()` - synchronous truth test to perform before each execution of `fn`.\n* `fn(callback)` - A function which is called each time `test` passes. The function is\n passed a `callback(err)`, which must be called once it has completed with an \n optional `err` argument.\n* `callback(err)` - A callback which is called after the test fails and repeated\n execution of `fn` has stopped.\n\n__Example__\n\n```js\nvar count = 0;\n\nasync.whilst(\n function () { return count < 5; },\n function (callback) {\n count++;\n setTimeout(callback, 1000);\n },\n function (err) {\n // 5 seconds have passed\n }\n);\n```\n\n---------------------------------------\n\n\n### doWhilst(fn, test, callback)\n\nThe post-check version of [`whilst`](#whilst). To reflect the difference in \nthe order of operations, the arguments `test` and `fn` are switched. \n\n`doWhilst` is to `whilst` as `do while` is to `while` in plain JavaScript.\n\n---------------------------------------\n\n\n### until(test, fn, callback)\n\nRepeatedly call `fn` until `test` returns `true`. Calls `callback` when stopped,\nor an error occurs.\n\nThe inverse of [`whilst`](#whilst).\n\n---------------------------------------\n\n\n### doUntil(fn, test, callback)\n\nLike [`doWhilst`](#doWhilst), except the `test` is inverted. Note the argument ordering differs from `until`.\n\n---------------------------------------\n\n\n### forever(fn, errback)\n\nCalls the asynchronous function `fn` with a callback parameter that allows it to\ncall itself again, in series, indefinitely.\n\nIf an error is passed to the callback then `errback` is called with the\nerror, and execution stops, otherwise it will never be called.\n\n```js\nasync.forever(\n function(next) {\n // next is suitable for passing to things that need a callback(err [, whatever]);\n // it will result in this function being called again.\n },\n function(err) {\n // if next is called with a value in its first parameter, it will appear\n // in here as 'err', and execution will stop.\n }\n);\n```\n\n---------------------------------------\n\n\n### waterfall(tasks, [callback])\n\nRuns the `tasks` array of functions in series, each passing their results to the next in\nthe array. However, if any of the `tasks` pass an error to their own callback, the\nnext function is not executed, and the main `callback` is immediately called with\nthe error.\n\n__Arguments__\n\n* `tasks` - An array of functions to run, each function is passed a \n `callback(err, result1, result2, ...)` it must call on completion. The first\n argument is an error (which can be `null`) and any further arguments will be \n passed as arguments in order to the next task.\n* `callback(err, [results])` - An optional callback to run once all the functions\n have completed. This will be passed the results of the last task's callback.\n\n\n\n__Example__\n\n```js\nasync.waterfall([\n function(callback){\n callback(null, 'one', 'two');\n },\n function(arg1, arg2, callback){\n // arg1 now equals 'one' and arg2 now equals 'two'\n callback(null, 'three');\n },\n function(arg1, callback){\n // arg1 now equals 'three'\n callback(null, 'done');\n }\n], function (err, result) {\n // result now equals 'done' \n});\n```\n\n---------------------------------------\n\n### compose(fn1, fn2...)\n\nCreates a function which is a composition of the passed asynchronous\nfunctions. Each function consumes the return value of the function that\nfollows. Composing functions `f()`, `g()`, and `h()` would produce the result of\n`f(g(h()))`, only this version uses callbacks to obtain the return values.\n\nEach function is executed with the `this` binding of the composed function.\n\n__Arguments__\n\n* `functions...` - the asynchronous functions to compose\n\n\n__Example__\n\n```js\nfunction add1(n, callback) {\n setTimeout(function () {\n callback(null, n + 1);\n }, 10);\n}\n\nfunction mul3(n, callback) {\n setTimeout(function () {\n callback(null, n * 3);\n }, 10);\n}\n\nvar add1mul3 = async.compose(mul3, add1);\n\nadd1mul3(4, function (err, result) {\n // result now equals 15\n});\n```\n\n---------------------------------------\n\n### seq(fn1, fn2...)\n\nVersion of the compose function that is more natural to read.\nEach following function consumes the return value of the latter function. \n\nEach function is executed with the `this` binding of the composed function.\n\n__Arguments__\n\n* functions... - the asynchronous functions to compose\n\n\n__Example__\n\n```js\n// Requires lodash (or underscore), express3 and dresende's orm2.\n// Part of an app, that fetches cats of the logged user.\n// This example uses `seq` function to avoid overnesting and error \n// handling clutter.\napp.get('/cats', function(request, response) {\n function handleError(err, data, callback) {\n if (err) {\n console.error(err);\n response.json({ status: 'error', message: err.message });\n }\n else {\n callback(data);\n }\n }\n var User = request.models.User;\n async.seq(\n _.bind(User.get, User), // 'User.get' has signature (id, callback(err, data))\n handleError,\n function(user, fn) {\n user.getCats(fn); // 'getCats' has signature (callback(err, data))\n },\n handleError,\n function(cats) {\n response.json({ status: 'ok', message: 'Cats found', data: cats });\n }\n )(req.session.user_id);\n }\n});\n```\n\n---------------------------------------\n\n### applyEach(fns, args..., callback)\n\nApplies the provided arguments to each function in the array, calling \n`callback` after all functions have completed. If you only provide the first\nargument, then it will return a function which lets you pass in the\narguments as if it were a single function call.\n\n__Arguments__\n\n* `fns` - the asynchronous functions to all call with the same arguments\n* `args...` - any number of separate arguments to pass to the function\n* `callback` - the final argument should be the callback, called when all\n functions have completed processing\n\n\n__Example__\n\n```js\nasync.applyEach([enableSearch, updateSchema], 'bucket', callback);\n\n// partial application example:\nasync.each(\n buckets,\n async.applyEach([enableSearch, updateSchema]),\n callback\n);\n```\n\n---------------------------------------\n\n\n### applyEachSeries(arr, iterator, callback)\n\nThe same as [`applyEach`](#applyEach) only the functions are applied in series.\n\n---------------------------------------\n\n\n### queue(worker, concurrency)\n\nCreates a `queue` object with the specified `concurrency`. Tasks added to the\n`queue` are processed in parallel (up to the `concurrency` limit). If all\n`worker`s are in progress, the task is queued until one becomes available. \nOnce a `worker` completes a `task`, that `task`'s callback is called.\n\n__Arguments__\n\n* `worker(task, callback)` - An asynchronous function for processing a queued\n task, which must call its `callback(err)` argument when finished, with an \n optional `error` as an argument.\n* `concurrency` - An `integer` for determining how many `worker` functions should be\n run in parallel.\n\n__Queue objects__\n\nThe `queue` object returned by this function has the following properties and\nmethods:\n\n* `length()` - a function returning the number of items waiting to be processed.\n* `started` - a function returning whether or not any items have been pushed and processed by the queue\n* `running()` - a function returning the number of items currently being processed.\n* `idle()` - a function returning false if there are items waiting or being processed, or true if not.\n* `concurrency` - an integer for determining how many `worker` functions should be\n run in parallel. This property can be changed after a `queue` is created to\n alter the concurrency on-the-fly.\n* `push(task, [callback])` - add a new task to the `queue`. Calls `callback` once \n the `worker` has finished processing the task. Instead of a single task, a `tasks` array\n can be submitted. The respective callback is used for every task in the list.\n* `unshift(task, [callback])` - add a new task to the front of the `queue`.\n* `saturated` - a callback that is called when the `queue` length hits the `concurrency` limit, \n and further tasks will be queued.\n* `empty` - a callback that is called when the last item from the `queue` is given to a `worker`.\n* `drain` - a callback that is called when the last item from the `queue` has returned from the `worker`.\n* `paused` - a boolean for determining whether the queue is in a paused state\n* `pause()` - a function that pauses the processing of tasks until `resume()` is called.\n* `resume()` - a function that resumes the processing of queued tasks when the queue is paused.\n* `kill()` - a function that empties remaining tasks from the queue forcing it to go idle.\n\n__Example__\n\n```js\n// create a queue object with concurrency 2\n\nvar q = async.queue(function (task, callback) {\n console.log('hello ' + task.name);\n callback();\n}, 2);\n\n\n// assign a callback\nq.drain = function() {\n console.log('all items have been processed');\n}\n\n// add some items to the queue\n\nq.push({name: 'foo'}, function (err) {\n console.log('finished processing foo');\n});\nq.push({name: 'bar'}, function (err) {\n console.log('finished processing bar');\n});\n\n// add some items to the queue (batch-wise)\n\nq.push([{name: 'baz'},{name: 'bay'},{name: 'bax'}], function (err) {\n console.log('finished processing bar');\n});\n\n// add some items to the front of the queue\n\nq.unshift({name: 'bar'}, function (err) {\n console.log('finished processing bar');\n});\n```\n\n\n---------------------------------------\n\n\n### priorityQueue(worker, concurrency)\n\nThe same as [`queue`](#queue) only tasks are assigned a priority and completed in ascending priority order. There are two differences between `queue` and `priorityQueue` objects:\n\n* `push(task, priority, [callback])` - `priority` should be a number. If an array of\n `tasks` is given, all tasks will be assigned the same priority.\n* The `unshift` method was removed.\n\n---------------------------------------\n\n\n### cargo(worker, [payload])\n\nCreates a `cargo` object with the specified payload. Tasks added to the\ncargo will be processed altogether (up to the `payload` limit). If the\n`worker` is in progress, the task is queued until it becomes available. Once\nthe `worker` has completed some tasks, each callback of those tasks is called.\nCheck out [this animation](https://camo.githubusercontent.com/6bbd36f4cf5b35a0f11a96dcd2e97711ffc2fb37/68747470733a2f2f662e636c6f75642e6769746875622e636f6d2f6173736574732f313637363837312f36383130382f62626330636662302d356632392d313165322d393734662d3333393763363464633835382e676966) for how `cargo` and `queue` work.\n\nWhile [queue](#queue) passes only one task to one of a group of workers\nat a time, cargo passes an array of tasks to a single worker, repeating\nwhen the worker is finished.\n\n__Arguments__\n\n* `worker(tasks, callback)` - An asynchronous function for processing an array of\n queued tasks, which must call its `callback(err)` argument when finished, with \n an optional `err` argument.\n* `payload` - An optional `integer` for determining how many tasks should be\n processed per round; if omitted, the default is unlimited.\n\n__Cargo objects__\n\nThe `cargo` object returned by this function has the following properties and\nmethods:\n\n* `length()` - A function returning the number of items waiting to be processed.\n* `payload` - An `integer` for determining how many tasks should be\n process per round. This property can be changed after a `cargo` is created to\n alter the payload on-the-fly.\n* `push(task, [callback])` - Adds `task` to the `queue`. The callback is called\n once the `worker` has finished processing the task. Instead of a single task, an array of `tasks` \n can be submitted. The respective callback is used for every task in the list.\n* `saturated` - A callback that is called when the `queue.length()` hits the concurrency and further tasks will be queued.\n* `empty` - A callback that is called when the last item from the `queue` is given to a `worker`.\n* `drain` - A callback that is called when the last item from the `queue` has returned from the `worker`.\n\n__Example__\n\n```js\n// create a cargo object with payload 2\n\nvar cargo = async.cargo(function (tasks, callback) {\n for(var i=0; i\n### auto(tasks, [callback])\n\nDetermines the best order for running the functions in `tasks`, based on their \nrequirements. Each function can optionally depend on other functions being completed \nfirst, and each function is run as soon as its requirements are satisfied. \n\nIf any of the functions pass an error to their callback, it will not \ncomplete (so any other functions depending on it will not run), and the main \n`callback` is immediately called with the error. Functions also receive an \nobject containing the results of functions which have completed so far.\n\nNote, all functions are called with a `results` object as a second argument, \nso it is unsafe to pass functions in the `tasks` object which cannot handle the\nextra argument. \n\nFor example, this snippet of code:\n\n```js\nasync.auto({\n readData: async.apply(fs.readFile, 'data.txt', 'utf-8')\n}, callback);\n```\n\nwill have the effect of calling `readFile` with the results object as the last\nargument, which will fail:\n\n```js\nfs.readFile('data.txt', 'utf-8', cb, {});\n```\n\nInstead, wrap the call to `readFile` in a function which does not forward the \n`results` object:\n\n```js\nasync.auto({\n readData: function(cb, results){\n fs.readFile('data.txt', 'utf-8', cb);\n }\n}, callback);\n```\n\n__Arguments__\n\n* `tasks` - An object. Each of its properties is either a function or an array of\n requirements, with the function itself the last item in the array. The object's key\n of a property serves as the name of the task defined by that property,\n i.e. can be used when specifying requirements for other tasks.\n The function receives two arguments: (1) a `callback(err, result)` which must be \n called when finished, passing an `error` (which can be `null`) and the result of \n the function's execution, and (2) a `results` object, containing the results of\n the previously executed functions.\n* `callback(err, results)` - An optional callback which is called when all the\n tasks have been completed. It receives the `err` argument if any `tasks` \n pass an error to their callback. Results are always returned; however, if \n an error occurs, no further `tasks` will be performed, and the results\n object will only contain partial results.\n\n\n__Example__\n\n```js\nasync.auto({\n get_data: function(callback){\n console.log('in get_data');\n // async code to get some data\n callback(null, 'data', 'converted to array');\n },\n make_folder: function(callback){\n console.log('in make_folder');\n // async code to create a directory to store a file in\n // this is run at the same time as getting the data\n callback(null, 'folder');\n },\n write_file: ['get_data', 'make_folder', function(callback, results){\n console.log('in write_file', JSON.stringify(results));\n // once there is some data and the directory exists,\n // write the data to a file in the directory\n callback(null, 'filename');\n }],\n email_link: ['write_file', function(callback, results){\n console.log('in email_link', JSON.stringify(results));\n // once the file is written let's email a link to it...\n // results.write_file contains the filename returned by write_file.\n callback(null, {'file':results.write_file, 'email':'user@example.com'});\n }]\n}, function(err, results) {\n console.log('err = ', err);\n console.log('results = ', results);\n});\n```\n\nThis is a fairly trivial example, but to do this using the basic parallel and\nseries functions would look like this:\n\n```js\nasync.parallel([\n function(callback){\n console.log('in get_data');\n // async code to get some data\n callback(null, 'data', 'converted to array');\n },\n function(callback){\n console.log('in make_folder');\n // async code to create a directory to store a file in\n // this is run at the same time as getting the data\n callback(null, 'folder');\n }\n],\nfunction(err, results){\n async.series([\n function(callback){\n console.log('in write_file', JSON.stringify(results));\n // once there is some data and the directory exists,\n // write the data to a file in the directory\n results.push('filename');\n callback(null);\n },\n function(callback){\n console.log('in email_link', JSON.stringify(results));\n // once the file is written let's email a link to it...\n callback(null, {'file':results.pop(), 'email':'user@example.com'});\n }\n ]);\n});\n```\n\nFor a complicated series of `async` tasks, using the [`auto`](#auto) function makes adding\nnew tasks much easier (and the code more readable).\n\n\n---------------------------------------\n\n\n### retry([times = 5], task, [callback])\n\nAttempts to get a successful response from `task` no more than `times` times before\nreturning an error. If the task is successful, the `callback` will be passed the result\nof the successfull task. If all attemps fail, the callback will be passed the error and\nresult (if any) of the final attempt.\n\n__Arguments__\n\n* `times` - An integer indicating how many times to attempt the `task` before giving up. Defaults to 5.\n* `task(callback, results)` - A function which receives two arguments: (1) a `callback(err, result)`\n which must be called when finished, passing `err` (which can be `null`) and the `result` of \n the function's execution, and (2) a `results` object, containing the results of\n the previously executed functions (if nested inside another control flow).\n* `callback(err, results)` - An optional callback which is called when the\n task has succeeded, or after the final failed attempt. It receives the `err` and `result` arguments of the last attempt at completing the `task`.\n\nThe [`retry`](#retry) function can be used as a stand-alone control flow by passing a\ncallback, as shown below:\n\n```js\nasync.retry(3, apiMethod, function(err, result) {\n // do something with the result\n});\n```\n\nIt can also be embeded within other control flow functions to retry individual methods\nthat are not as reliable, like this:\n\n```js\nasync.auto({\n users: api.getUsers.bind(api),\n payments: async.retry(3, api.getPayments.bind(api))\n}, function(err, results) {\n // do something with the results\n});\n```\n\n\n---------------------------------------\n\n\n### iterator(tasks)\n\nCreates an iterator function which calls the next function in the `tasks` array,\nreturning a continuation to call the next one after that. It's also possible to\n“peek” at the next iterator with `iterator.next()`.\n\nThis function is used internally by the `async` module, but can be useful when\nyou want to manually control the flow of functions in series.\n\n__Arguments__\n\n* `tasks` - An array of functions to run.\n\n__Example__\n\n```js\nvar iterator = async.iterator([\n function(){ sys.p('one'); },\n function(){ sys.p('two'); },\n function(){ sys.p('three'); }\n]);\n\nnode> var iterator2 = iterator();\n'one'\nnode> var iterator3 = iterator2();\n'two'\nnode> iterator3();\n'three'\nnode> var nextfn = iterator2.next();\nnode> nextfn();\n'three'\n```\n\n---------------------------------------\n\n\n### apply(function, arguments..)\n\nCreates a continuation function with some arguments already applied. \n\nUseful as a shorthand when combined with other control flow functions. Any arguments\npassed to the returned function are added to the arguments originally passed\nto apply.\n\n__Arguments__\n\n* `function` - The function you want to eventually apply all arguments to.\n* `arguments...` - Any number of arguments to automatically apply when the\n continuation is called.\n\n__Example__\n\n```js\n// using apply\n\nasync.parallel([\n async.apply(fs.writeFile, 'testfile1', 'test1'),\n async.apply(fs.writeFile, 'testfile2', 'test2'),\n]);\n\n\n// the same process without using apply\n\nasync.parallel([\n function(callback){\n fs.writeFile('testfile1', 'test1', callback);\n },\n function(callback){\n fs.writeFile('testfile2', 'test2', callback);\n }\n]);\n```\n\nIt's possible to pass any number of additional arguments when calling the\ncontinuation:\n\n```js\nnode> var fn = async.apply(sys.puts, 'one');\nnode> fn('two', 'three');\none\ntwo\nthree\n```\n\n---------------------------------------\n\n\n### nextTick(callback)\n\nCalls `callback` on a later loop around the event loop. In Node.js this just\ncalls `process.nextTick`; in the browser it falls back to `setImmediate(callback)`\nif available, otherwise `setTimeout(callback, 0)`, which means other higher priority\nevents may precede the execution of `callback`.\n\nThis is used internally for browser-compatibility purposes.\n\n__Arguments__\n\n* `callback` - The function to call on a later loop around the event loop.\n\n__Example__\n\n```js\nvar call_order = [];\nasync.nextTick(function(){\n call_order.push('two');\n // call_order now equals ['one','two']\n});\ncall_order.push('one')\n```\n\n\n### times(n, callback)\n\nCalls the `callback` function `n` times, and accumulates results in the same manner\nyou would use with [`map`](#map).\n\n__Arguments__\n\n* `n` - The number of times to run the function.\n* `callback` - The function to call `n` times.\n\n__Example__\n\n```js\n// Pretend this is some complicated async factory\nvar createUser = function(id, callback) {\n callback(null, {\n id: 'user' + id\n })\n}\n// generate 5 users\nasync.times(5, function(n, next){\n createUser(n, function(err, user) {\n next(err, user)\n })\n}, function(err, users) {\n // we should now have 5 users\n});\n```\n\n\n### timesSeries(n, callback)\n\nThe same as [`times`](#times), only the iterator is applied to each item in `arr` in\nseries. The next `iterator` is only called once the current one has completed. \nThe results array will be in the same order as the original.\n\n\n## Utils\n\n\n### memoize(fn, [hasher])\n\nCaches the results of an `async` function. When creating a hash to store function\nresults against, the callback is omitted from the hash and an optional hash\nfunction can be used.\n\nThe cache of results is exposed as the `memo` property of the function returned\nby `memoize`.\n\n__Arguments__\n\n* `fn` - The function to proxy and cache results from.\n* `hasher` - Tn optional function for generating a custom hash for storing\n results. It has all the arguments applied to it apart from the callback, and\n must be synchronous.\n\n__Example__\n\n```js\nvar slow_fn = function (name, callback) {\n // do something\n callback(null, result);\n};\nvar fn = async.memoize(slow_fn);\n\n// fn can now be used as if it were slow_fn\nfn('some name', function () {\n // callback\n});\n```\n\n\n### unmemoize(fn)\n\nUndoes a [`memoize`](#memoize)d function, reverting it to the original, unmemoized\nform. Handy for testing.\n\n__Arguments__\n\n* `fn` - the memoized function\n\n\n### log(function, arguments)\n\nLogs the result of an `async` function to the `console`. Only works in Node.js or\nin browsers that support `console.log` and `console.error` (such as FF and Chrome).\nIf multiple arguments are returned from the async function, `console.log` is\ncalled on each argument in order.\n\n__Arguments__\n\n* `function` - The function you want to eventually apply all arguments to.\n* `arguments...` - Any number of arguments to apply to the function.\n\n__Example__\n\n```js\nvar hello = function(name, callback){\n setTimeout(function(){\n callback(null, 'hello ' + name);\n }, 1000);\n};\n```\n```js\nnode> async.log(hello, 'world');\n'hello world'\n```\n\n---------------------------------------\n\n\n### dir(function, arguments)\n\nLogs the result of an `async` function to the `console` using `console.dir` to\ndisplay the properties of the resulting object. Only works in Node.js or\nin browsers that support `console.dir` and `console.error` (such as FF and Chrome).\nIf multiple arguments are returned from the async function, `console.dir` is\ncalled on each argument in order.\n\n__Arguments__\n\n* `function` - The function you want to eventually apply all arguments to.\n* `arguments...` - Any number of arguments to apply to the function.\n\n__Example__\n\n```js\nvar hello = function(name, callback){\n setTimeout(function(){\n callback(null, {hello: name});\n }, 1000);\n};\n```\n```js\nnode> async.dir(hello, 'world');\n{hello: 'world'}\n```\n\n---------------------------------------\n\n\n### noConflict()\n\nChanges the value of `async` back to its original value, returning a reference to the\n`async` object.\n", - "readmeFilename": "README.md", - "homepage": "https://github.com/caolan/async", - "_id": "async@0.9.0", - "_shasum": "ac3613b1da9bed1b47510bb4651b8931e47146c7", - "_from": "async@0.9.x", - "_resolved": "https://registry.npmjs.org/async/-/async-0.9.0.tgz" -} diff --git a/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/escodegen/node_modules/esprima/package.json b/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/escodegen/node_modules/esprima/package.json index 58b2cba..3124497 100644 --- a/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/escodegen/node_modules/esprima/package.json +++ b/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/escodegen/node_modules/esprima/package.json @@ -82,5 +82,5 @@ "readme": "**Esprima** ([esprima.org](http://esprima.org), BSD license) is a high performance,\nstandard-compliant [ECMAScript](http://www.ecma-international.org/publications/standards/Ecma-262.htm)\nparser written in ECMAScript (also popularly known as\n[JavaScript](http://en.wikipedia.org/wiki/JavaScript>JavaScript)).\nEsprima is created and maintained by [Ariya Hidayat](http://twitter.com/ariyahidayat),\nwith the help of [many contributors](https://github.com/ariya/esprima/contributors).\n\n### Features\n\n- Full support for ECMAScript 5.1 ([ECMA-262](http://www.ecma-international.org/publications/standards/Ecma-262.htm))\n- Sensible [syntax tree format](http://esprima.org/doc/index.html#ast) compatible with Mozilla\n[Parser AST](https://developer.mozilla.org/en/SpiderMonkey/Parser_API)\n- Optional tracking of syntax node location (index-based and line-column)\n- Heavily tested (> 600 [unit tests](http://esprima.org/test/) with solid statement and branch coverage)\n- Experimental support for ES6/Harmony (module, class, destructuring, ...)\n\nEsprima serves as a **building block** for some JavaScript\nlanguage tools, from [code instrumentation](http://esprima.org/demo/functiontrace.html)\nto [editor autocompletion](http://esprima.org/demo/autocomplete.html).\n\nEsprima runs on many popular web browsers, as well as other ECMAScript platforms such as\n[Rhino](http://www.mozilla.org/rhino) and [Node.js](https://npmjs.org/package/esprima).\n\nFor more information, check the web site [esprima.org](http://esprima.org).\n", "readmeFilename": "README.md", "_id": "esprima@1.1.1", - "_from": "esprima@~1.1.1" + "_from": "esprima@>=1.1.1 <1.2.0" } diff --git a/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/escodegen/node_modules/estraverse/package.json b/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/escodegen/node_modules/estraverse/package.json index f211ee0..5585153 100644 --- a/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/escodegen/node_modules/estraverse/package.json +++ b/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/escodegen/node_modules/estraverse/package.json @@ -46,7 +46,7 @@ "shasum": "867a3e8e58a9f84618afb6c2ddbcd916b7cbaf71", "tarball": "http://registry.npmjs.org/estraverse/-/estraverse-1.5.1.tgz" }, - "_from": "estraverse@~1.5.0", + "_from": "estraverse@>=1.5.0 <1.6.0", "_npmVersion": "1.4.3", "_npmUser": { "name": "constellation", diff --git a/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/escodegen/node_modules/esutils/package.json b/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/escodegen/node_modules/esutils/package.json index 9dcd98b..47f1b46 100644 --- a/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/escodegen/node_modules/esutils/package.json +++ b/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/escodegen/node_modules/esutils/package.json @@ -45,5 +45,5 @@ "url": "https://github.com/Constellation/esutils/issues" }, "_id": "esutils@1.0.0", - "_from": "esutils@~1.0.0" + "_from": "esutils@>=1.0.0 <1.1.0" } diff --git a/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/escodegen/node_modules/source-map/CHANGELOG.md b/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/escodegen/node_modules/source-map/CHANGELOG.md index 518bed4..2e7ca5d 100644 --- a/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/escodegen/node_modules/source-map/CHANGELOG.md +++ b/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/escodegen/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/grunt-istanbul/node_modules/istanbul/node_modules/escodegen/node_modules/source-map/README.md b/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/escodegen/node_modules/source-map/README.md index 1a1c7d8..59767aa 100644 --- a/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/escodegen/node_modules/source-map/README.md +++ b/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/escodegen/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/grunt-istanbul/node_modules/istanbul/node_modules/escodegen/node_modules/source-map/lib/source-map/base64-vlq.js b/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/escodegen/node_modules/source-map/lib/source-map/base64-vlq.js index b4ff136..e22dcae 100644 --- a/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/escodegen/node_modules/source-map/lib/source-map/base64-vlq.js +++ b/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/escodegen/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/grunt-istanbul/node_modules/istanbul/node_modules/escodegen/node_modules/source-map/lib/source-map/binary-search.js b/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/escodegen/node_modules/source-map/lib/source-map/binary-search.js index ff347c6..e085f81 100644 --- a/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/escodegen/node_modules/source-map/lib/source-map/binary-search.js +++ b/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/escodegen/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/grunt-istanbul/node_modules/istanbul/node_modules/escodegen/node_modules/source-map/lib/source-map/mapping-list.js b/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/escodegen/node_modules/source-map/lib/source-map/mapping-list.js new file mode 100644 index 0000000..2a4eb61 --- /dev/null +++ b/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/escodegen/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/grunt-istanbul/node_modules/istanbul/node_modules/escodegen/node_modules/source-map/lib/source-map/source-map-consumer.js b/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/escodegen/node_modules/source-map/lib/source-map/source-map-consumer.js index ea643bf..cfaa299 100644 --- a/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/escodegen/node_modules/source-map/lib/source-map/source-map-consumer.js +++ b/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/escodegen/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,25 +441,82 @@ 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; SourceMapConsumer.ORIGINAL_ORDER = 2; diff --git a/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/escodegen/node_modules/source-map/lib/source-map/source-map-generator.js b/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/escodegen/node_modules/source-map/lib/source-map/source-map-generator.js index 5387fa1..1ab7a47 100644 --- a/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/escodegen/node_modules/source-map/lib/source-map/source-map-generator.js +++ b/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/escodegen/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/grunt-istanbul/node_modules/istanbul/node_modules/escodegen/node_modules/source-map/lib/source-map/source-node.js b/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/escodegen/node_modules/source-map/lib/source-map/source-node.js index baa5f40..9ee90bd 100644 --- a/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/escodegen/node_modules/source-map/lib/source-map/source-node.js +++ b/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/escodegen/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/grunt-istanbul/node_modules/istanbul/node_modules/escodegen/node_modules/source-map/package.json b/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/escodegen/node_modules/source-map/package.json index e5acb7c..0a1e4a0 100644 --- a/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/escodegen/node_modules/source-map/package.json +++ b/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/escodegen/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,9 +155,9 @@ "bugs": { "url": "https://github.com/mozilla/source-map/issues" }, - "_id": "source-map@0.1.40", - "_shasum": "7e0ee49ec0452aa9ac2b93ad5ae54ef33e82b37f", - "_from": "source-map@~0.1.33", + "_id": "source-map@0.1.43", + "_shasum": "c24bc146ca517c1471f5dacbe2571b2b7f9e3346", + "_from": "source-map@>=0.1.33 <0.2.0", "_npmVersion": "1.4.9", "_npmUser": { "name": "nickfitzgerald", @@ -162,9 +178,9 @@ } ], "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", "readme": "ERROR: No README data found!" } diff --git a/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/escodegen/node_modules/source-map/test/source-map/test-binary-search.js b/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/escodegen/node_modules/source-map/test/source-map/test-binary-search.js index ee30683..f1c9e0f 100644 --- a/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/escodegen/node_modules/source-map/test/source-map/test-binary-search.js +++ b/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/escodegen/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/grunt-istanbul/node_modules/istanbul/node_modules/escodegen/node_modules/source-map/test/source-map/test-source-map-consumer.js b/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/escodegen/node_modules/source-map/test/source-map/test-source-map-consumer.js index a4c6659..c714943 100644 --- a/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/escodegen/node_modules/source-map/test/source-map/test-source-map-consumer.js +++ b/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/escodegen/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/grunt-istanbul/node_modules/istanbul/node_modules/escodegen/node_modules/source-map/test/source-map/test-source-map-generator.js b/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/escodegen/node_modules/source-map/test/source-map/test-source-map-generator.js index a0d9d00..d748bb1 100644 --- a/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/escodegen/node_modules/source-map/test/source-map/test-source-map-generator.js +++ b/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/escodegen/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/grunt-istanbul/node_modules/istanbul/node_modules/escodegen/node_modules/source-map/test/source-map/util.js b/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/escodegen/node_modules/source-map/test/source-map/util.js index fa213ce..56bbe2c 100644 --- a/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/escodegen/node_modules/source-map/test/source-map/util.js +++ b/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/escodegen/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/grunt-istanbul/node_modules/istanbul/node_modules/escodegen/package.json b/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/escodegen/package.json index cff8b7d..d1e782f 100644 --- a/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/escodegen/package.json +++ b/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/escodegen/package.json @@ -65,7 +65,7 @@ "shasum": "f024016f5a88e046fd12005055e939802e6c5f23", "tarball": "http://registry.npmjs.org/escodegen/-/escodegen-1.3.3.tgz" }, - "_from": "escodegen@1.3.x", + "_from": "escodegen@>=1.3.0 <1.4.0", "_npmVersion": "1.4.3", "_npmUser": { "name": "constellation", diff --git a/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/esprima/esprima.js b/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/esprima/esprima.js index 593021f..c83f93d 100644 --- a/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/esprima/esprima.js +++ b/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/esprima/esprima.js @@ -1260,7 +1260,7 @@ parseStatement: true, parseSourceElement: true */ } return collectRegex(); } - if (prevToken.type === 'Keyword') { + if (prevToken.type === 'Keyword' && prevToken.value !== 'this') { return collectRegex(); } return scanPunctuator(); @@ -3724,7 +3724,7 @@ parseStatement: true, parseSourceElement: true */ } // Sync with *.json manifests. - exports.version = '1.2.2'; + exports.version = '1.2.3'; exports.tokenize = tokenize; diff --git a/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/esprima/package.json b/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/esprima/package.json index 5f87b07..f6dc693 100644 --- a/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/esprima/package.json +++ b/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/esprima/package.json @@ -7,7 +7,7 @@ "esparse": "./bin/esparse.js", "esvalidate": "./bin/esvalidate.js" }, - "version": "1.2.2", + "version": "1.2.3", "files": [ "bin", "test/run.js", @@ -67,7 +67,7 @@ "lint": "npm run-script check-version && npm run-script eslint && npm run-script jscs && npm run-script jslint", "check-version": "node tools/check-version.js", "eslint": "node node_modules/eslint/bin/eslint.js esprima.js", - "jscs": "node node_modules/.bin/jscs esprima.js", + "jscs": "node node_modules/jscs/bin/jscs esprima.js", "jslint": "node node_modules/jslint/bin/jslint.js esprima.js", "coverage": "npm run-script analyze-coverage && npm run-script check-coverage", "analyze-coverage": "node node_modules/istanbul/lib/cli.js cover test/runner.js", @@ -78,19 +78,19 @@ "benchmark": "node test/benchmarks.js", "benchmark-quick": "node test/benchmarks.js quick" }, - "_id": "esprima@1.2.2", + "_id": "esprima@1.2.3", "dist": { - "shasum": "76a0fd66fcfe154fd292667dc264019750b1657b", - "tarball": "http://registry.npmjs.org/esprima/-/esprima-1.2.2.tgz" + "shasum": "173c9c28d0ec7753afb977b6b21b3017367aac1b", + "tarball": "http://registry.npmjs.org/esprima/-/esprima-1.2.3.tgz" }, - "_from": "esprima@1.2.x", + "_from": "esprima@>=1.2.0 <1.3.0", "_npmVersion": "1.4.3", "_npmUser": { "name": "ariya", "email": "ariya.hidayat@gmail.com" }, "directories": {}, - "_shasum": "76a0fd66fcfe154fd292667dc264019750b1657b", - "_resolved": "https://registry.npmjs.org/esprima/-/esprima-1.2.2.tgz", + "_shasum": "173c9c28d0ec7753afb977b6b21b3017367aac1b", + "_resolved": "https://registry.npmjs.org/esprima/-/esprima-1.2.3.tgz", "readme": "ERROR: No README data found!" } diff --git a/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/esprima/test/test.js b/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/esprima/test/test.js index 2e5831c..f8c8636 100644 --- a/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/esprima/test/test.js +++ b/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/esprima/test/test.js @@ -21840,8 +21840,82 @@ var testFixture = { lineNumber: 1, 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': { diff --git a/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/fileset/node_modules/glob/node_modules/inherits/package.json b/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/fileset/node_modules/glob/node_modules/inherits/package.json index 5bf0db5..ca12ef3 100644 --- a/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/fileset/node_modules/glob/node_modules/inherits/package.json +++ b/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/fileset/node_modules/glob/node_modules/inherits/package.json @@ -29,5 +29,5 @@ }, "homepage": "https://github.com/isaacs/inherits", "_id": "inherits@2.0.1", - "_from": "inherits@2" + "_from": "inherits@>=2.0.0 <3.0.0" } diff --git a/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/fileset/node_modules/glob/node_modules/minimatch/node_modules/lru-cache/package.json b/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/fileset/node_modules/glob/node_modules/minimatch/node_modules/lru-cache/package.json index 4472725..0acc7b8 100644 --- a/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/fileset/node_modules/glob/node_modules/minimatch/node_modules/lru-cache/package.json +++ b/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/fileset/node_modules/glob/node_modules/minimatch/node_modules/lru-cache/package.json @@ -29,5 +29,5 @@ }, "homepage": "https://github.com/isaacs/node-lru-cache", "_id": "lru-cache@2.5.0", - "_from": "lru-cache@2" + "_from": "lru-cache@>=2.0.0 <3.0.0" } diff --git a/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/fileset/node_modules/glob/node_modules/minimatch/node_modules/sigmund/package.json b/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/fileset/node_modules/glob/node_modules/minimatch/node_modules/sigmund/package.json index cb7e2bd..94b6453 100644 --- a/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/fileset/node_modules/glob/node_modules/minimatch/node_modules/sigmund/package.json +++ b/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/fileset/node_modules/glob/node_modules/minimatch/node_modules/sigmund/package.json @@ -38,5 +38,5 @@ }, "homepage": "https://github.com/isaacs/sigmund", "_id": "sigmund@1.0.0", - "_from": "sigmund@~1.0.0" + "_from": "sigmund@>=1.0.0 <1.1.0" } diff --git a/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/fileset/node_modules/glob/node_modules/minimatch/package.json b/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/fileset/node_modules/glob/node_modules/minimatch/package.json index 0fe147d..b0691e5 100644 --- a/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/fileset/node_modules/glob/node_modules/minimatch/package.json +++ b/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/fileset/node_modules/glob/node_modules/minimatch/package.json @@ -35,7 +35,7 @@ "homepage": "https://github.com/isaacs/minimatch", "_id": "minimatch@0.3.0", "_shasum": "275d8edaac4f1bb3326472089e7949c8394699dd", - "_from": "minimatch@0.3", + "_from": "minimatch@>=0.3.0 <0.4.0", "_npmVersion": "1.4.10", "_npmUser": { "name": "isaacs", diff --git a/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/fileset/node_modules/glob/package.json b/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/fileset/node_modules/glob/package.json index 915a365..f3a86b9 100644 --- a/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/fileset/node_modules/glob/package.json +++ b/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/fileset/node_modules/glob/package.json @@ -36,7 +36,7 @@ "homepage": "https://github.com/isaacs/node-glob", "_id": "glob@3.2.11", "_shasum": "4a973f635b9190f715d10987d5c00fd2815ebe3d", - "_from": "glob@3.x", + "_from": "glob@>=3.0.0 <4.0.0", "_npmVersion": "1.4.10", "_npmUser": { "name": "isaacs", diff --git a/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/fileset/node_modules/minimatch/node_modules/lru-cache/package.json b/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/fileset/node_modules/minimatch/node_modules/lru-cache/package.json index 4472725..0acc7b8 100644 --- a/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/fileset/node_modules/minimatch/node_modules/lru-cache/package.json +++ b/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/fileset/node_modules/minimatch/node_modules/lru-cache/package.json @@ -29,5 +29,5 @@ }, "homepage": "https://github.com/isaacs/node-lru-cache", "_id": "lru-cache@2.5.0", - "_from": "lru-cache@2" + "_from": "lru-cache@>=2.0.0 <3.0.0" } diff --git a/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/fileset/node_modules/minimatch/node_modules/sigmund/package.json b/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/fileset/node_modules/minimatch/node_modules/sigmund/package.json index cb7e2bd..94b6453 100644 --- a/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/fileset/node_modules/minimatch/node_modules/sigmund/package.json +++ b/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/fileset/node_modules/minimatch/node_modules/sigmund/package.json @@ -38,5 +38,5 @@ }, "homepage": "https://github.com/isaacs/sigmund", "_id": "sigmund@1.0.0", - "_from": "sigmund@~1.0.0" + "_from": "sigmund@>=1.0.0 <1.1.0" } diff --git a/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/fileset/node_modules/minimatch/package.json b/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/fileset/node_modules/minimatch/package.json index 97198a8..7220613 100644 --- a/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/fileset/node_modules/minimatch/package.json +++ b/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/fileset/node_modules/minimatch/package.json @@ -36,7 +36,7 @@ "homepage": "https://github.com/isaacs/minimatch", "_id": "minimatch@0.4.0", "_shasum": "bd2c7d060d2c8c8fd7cde7f1f2ed2d5b270fdb1b", - "_from": "minimatch@0.x", + "_from": "minimatch@>=0.0.0 <1.0.0", "_npmVersion": "1.5.0-alpha-1", "_npmUser": { "name": "isaacs", diff --git a/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/fileset/package.json b/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/fileset/package.json index fa9b988..fbdcccc 100644 --- a/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/fileset/package.json +++ b/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/fileset/package.json @@ -30,5 +30,5 @@ "url": "https://github.com/mklabs/node-fileset/issues" }, "_id": "fileset@0.1.5", - "_from": "fileset@0.1.x" + "_from": "fileset@>=0.1.0 <0.2.0" } diff --git a/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/handlebars/node_modules/optimist/package.json b/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/handlebars/node_modules/optimist/package.json index a37f7d9..ad1a6c8 100644 --- a/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/handlebars/node_modules/optimist/package.json +++ b/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/handlebars/node_modules/optimist/package.json @@ -42,5 +42,5 @@ }, "homepage": "https://github.com/substack/node-optimist", "_id": "optimist@0.3.7", - "_from": "optimist@~0.3" + "_from": "optimist@>=0.3.0 <0.4.0" } diff --git a/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/handlebars/node_modules/uglify-js/node_modules/async/package.json b/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/handlebars/node_modules/uglify-js/node_modules/async/package.json index 1af8811..e4e34ad 100644 --- a/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/handlebars/node_modules/uglify-js/node_modules/async/package.json +++ b/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/handlebars/node_modules/uglify-js/node_modules/async/package.json @@ -39,5 +39,5 @@ "readmeFilename": "README.md", "homepage": "https://github.com/caolan/async", "_id": "async@0.2.10", - "_from": "async@~0.2.6" + "_from": "async@>=0.2.6 <0.3.0" } diff --git a/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/handlebars/node_modules/uglify-js/node_modules/source-map/CHANGELOG.md b/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/handlebars/node_modules/uglify-js/node_modules/source-map/CHANGELOG.md index 518bed4..2e7ca5d 100644 --- a/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/handlebars/node_modules/uglify-js/node_modules/source-map/CHANGELOG.md +++ b/node_modules/grunt-istanbul/node_modules/istanbul/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/grunt-istanbul/node_modules/istanbul/node_modules/handlebars/node_modules/uglify-js/node_modules/source-map/README.md b/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/handlebars/node_modules/uglify-js/node_modules/source-map/README.md index 1a1c7d8..59767aa 100644 --- a/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/handlebars/node_modules/uglify-js/node_modules/source-map/README.md +++ b/node_modules/grunt-istanbul/node_modules/istanbul/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/grunt-istanbul/node_modules/istanbul/node_modules/handlebars/node_modules/uglify-js/node_modules/source-map/lib/source-map/base64-vlq.js b/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/handlebars/node_modules/uglify-js/node_modules/source-map/lib/source-map/base64-vlq.js index b4ff136..e22dcae 100644 --- a/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/handlebars/node_modules/uglify-js/node_modules/source-map/lib/source-map/base64-vlq.js +++ b/node_modules/grunt-istanbul/node_modules/istanbul/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/grunt-istanbul/node_modules/istanbul/node_modules/handlebars/node_modules/uglify-js/node_modules/source-map/lib/source-map/binary-search.js b/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/handlebars/node_modules/uglify-js/node_modules/source-map/lib/source-map/binary-search.js index ff347c6..e085f81 100644 --- a/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/handlebars/node_modules/uglify-js/node_modules/source-map/lib/source-map/binary-search.js +++ b/node_modules/grunt-istanbul/node_modules/istanbul/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/grunt-istanbul/node_modules/istanbul/node_modules/handlebars/node_modules/uglify-js/node_modules/source-map/lib/source-map/mapping-list.js b/node_modules/grunt-istanbul/node_modules/istanbul/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/grunt-istanbul/node_modules/istanbul/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/grunt-istanbul/node_modules/istanbul/node_modules/handlebars/node_modules/uglify-js/node_modules/source-map/lib/source-map/source-map-consumer.js b/node_modules/grunt-istanbul/node_modules/istanbul/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/grunt-istanbul/node_modules/istanbul/node_modules/handlebars/node_modules/uglify-js/node_modules/source-map/lib/source-map/source-map-consumer.js +++ b/node_modules/grunt-istanbul/node_modules/istanbul/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,25 +441,82 @@ 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; SourceMapConsumer.ORIGINAL_ORDER = 2; diff --git a/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/handlebars/node_modules/uglify-js/node_modules/source-map/lib/source-map/source-map-generator.js b/node_modules/grunt-istanbul/node_modules/istanbul/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/grunt-istanbul/node_modules/istanbul/node_modules/handlebars/node_modules/uglify-js/node_modules/source-map/lib/source-map/source-map-generator.js +++ b/node_modules/grunt-istanbul/node_modules/istanbul/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/grunt-istanbul/node_modules/istanbul/node_modules/handlebars/node_modules/uglify-js/node_modules/source-map/lib/source-map/source-node.js b/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/handlebars/node_modules/uglify-js/node_modules/source-map/lib/source-map/source-node.js index baa5f40..9ee90bd 100644 --- a/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/handlebars/node_modules/uglify-js/node_modules/source-map/lib/source-map/source-node.js +++ b/node_modules/grunt-istanbul/node_modules/istanbul/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/grunt-istanbul/node_modules/istanbul/node_modules/handlebars/node_modules/uglify-js/node_modules/source-map/package.json b/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/handlebars/node_modules/uglify-js/node_modules/source-map/package.json index 070587a..73cdef7 100644 --- a/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/handlebars/node_modules/uglify-js/node_modules/source-map/package.json +++ b/node_modules/grunt-istanbul/node_modules/istanbul/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,9 +155,9 @@ "bugs": { "url": "https://github.com/mozilla/source-map/issues" }, - "_id": "source-map@0.1.40", - "_shasum": "7e0ee49ec0452aa9ac2b93ad5ae54ef33e82b37f", - "_from": "source-map@~0.1.7", + "_id": "source-map@0.1.43", + "_shasum": "c24bc146ca517c1471f5dacbe2571b2b7f9e3346", + "_from": "source-map@>=0.1.7 <0.2.0", "_npmVersion": "1.4.9", "_npmUser": { "name": "nickfitzgerald", @@ -162,9 +178,9 @@ } ], "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", "readme": "ERROR: No README data found!" } diff --git a/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/handlebars/node_modules/uglify-js/node_modules/source-map/test/source-map/test-binary-search.js b/node_modules/grunt-istanbul/node_modules/istanbul/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/grunt-istanbul/node_modules/istanbul/node_modules/handlebars/node_modules/uglify-js/node_modules/source-map/test/source-map/test-binary-search.js +++ b/node_modules/grunt-istanbul/node_modules/istanbul/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/grunt-istanbul/node_modules/istanbul/node_modules/handlebars/node_modules/uglify-js/node_modules/source-map/test/source-map/test-source-map-consumer.js b/node_modules/grunt-istanbul/node_modules/istanbul/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/grunt-istanbul/node_modules/istanbul/node_modules/handlebars/node_modules/uglify-js/node_modules/source-map/test/source-map/test-source-map-consumer.js +++ b/node_modules/grunt-istanbul/node_modules/istanbul/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/grunt-istanbul/node_modules/istanbul/node_modules/handlebars/node_modules/uglify-js/node_modules/source-map/test/source-map/test-source-map-generator.js b/node_modules/grunt-istanbul/node_modules/istanbul/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/grunt-istanbul/node_modules/istanbul/node_modules/handlebars/node_modules/uglify-js/node_modules/source-map/test/source-map/test-source-map-generator.js +++ b/node_modules/grunt-istanbul/node_modules/istanbul/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/grunt-istanbul/node_modules/istanbul/node_modules/handlebars/node_modules/uglify-js/node_modules/source-map/test/source-map/util.js b/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/handlebars/node_modules/uglify-js/node_modules/source-map/test/source-map/util.js index fa213ce..56bbe2c 100644 --- a/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/handlebars/node_modules/uglify-js/node_modules/source-map/test/source-map/util.js +++ b/node_modules/grunt-istanbul/node_modules/istanbul/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/grunt-istanbul/node_modules/istanbul/node_modules/handlebars/node_modules/uglify-js/package.json b/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/handlebars/node_modules/uglify-js/package.json index 4037228..066a10b 100644 --- a/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/handlebars/node_modules/uglify-js/package.json +++ b/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/handlebars/node_modules/uglify-js/package.json @@ -35,5 +35,5 @@ "url": "https://github.com/mishoo/UglifyJS2/issues" }, "_id": "uglify-js@2.3.6", - "_from": "uglify-js@~2.3" + "_from": "uglify-js@>=2.3.0 <2.4.0" } diff --git a/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/handlebars/package.json b/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/handlebars/package.json index 6e6a260..28c9b00 100644 --- a/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/handlebars/package.json +++ b/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/handlebars/package.json @@ -68,7 +68,7 @@ "shasum": "9e9b130a93e389491322d975cf3ec1818c37ce34", "tarball": "http://registry.npmjs.org/handlebars/-/handlebars-1.3.0.tgz" }, - "_from": "handlebars@1.3.x", + "_from": "handlebars@>=1.3.0 <1.4.0", "_npmVersion": "1.3.11", "_npmUser": { "name": "kpdecker", diff --git a/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/js-yaml/HISTORY.md b/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/js-yaml/HISTORY.md index e57a4b8..0733e89 100644 --- a/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/js-yaml/HISTORY.md +++ b/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/js-yaml/HISTORY.md @@ -1,3 +1,17 @@ +3.2.5 / 2014-12-28 +------------------ + +- Fixed resolving of all built-in types on empty nodes. +- Fixed invalid warning on empty lines within quoted scalars and flow collections. +- Fixed bug: Tag on an empty node didn't resolve in some cases. + + +3.2.4 / 2014-12-19 +------------------ + +- Fixed resolving of !!null tag on an empty node. + + 3.2.3 / 2014-11-08 ------------------ diff --git a/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/js-yaml/dist/js-yaml.js b/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/js-yaml/dist/js-yaml.js index f518f13..451b05d 100644 --- a/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/js-yaml/dist/js-yaml.js +++ b/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/js-yaml/dist/js-yaml.js @@ -1,4 +1,4 @@ -/* js-yaml 3.2.3 https://github.com/nodeca/js-yaml */!function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var f;"undefined"!=typeof window?f=window:"undefined"!=typeof global?f=global:"undefined"!=typeof self&&(f=self),f.jsyaml=e()}}(function(){var define,module,exports;return (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;oparent, 0: this=parent, -1: this parentIndent) { - isIndented = true; - - } else { - return false; + if (state.lineIndent > parentIndent) { + indentStatus = 1; + } else if (state.lineIndent === parentIndent) { + indentStatus = 0; + } else if (state.lineIndent < parentIndent) { + indentStatus = -1; } } } - if (isIndented) { + if (1 === indentStatus) { while (readTagProperty(state) || readAnchorProperty(state)) { if (skipSeparationSpace(state, true, -1)) { atNewLine = true; + allowBlockCollections = allowBlockStyles; if (state.lineIndent > parentIndent) { - isIndented = true; - allowBlockCollections = allowBlockStyles; - + indentStatus = 1; } else if (state.lineIndent === parentIndent) { - isIndented = false; - allowBlockCollections = allowBlockStyles; - - } else { - return true; + indentStatus = 0; + } else if (state.lineIndent < parentIndent) { + indentStatus = -1; } } else { allowBlockCollections = false; @@ -1991,7 +1986,7 @@ function composeNode(state, parentIndent, nodeContext, allowToSeek, allowCompact allowBlockCollections = atNewLine || allowCompact; } - if (isIndented || CONTEXT_BLOCK_OUT === nodeContext) { + if (1 === indentStatus || CONTEXT_BLOCK_OUT === nodeContext) { if (CONTEXT_FLOW_IN === nodeContext || CONTEXT_FLOW_OUT === nodeContext) { flowIndent = parentIndent; } else { @@ -2000,7 +1995,7 @@ function composeNode(state, parentIndent, nodeContext, allowToSeek, allowCompact blockIndent = state.position - state.lineStart; - if (isIndented) { + if (1 === indentStatus) { if (allowBlockCollections && (readBlockSequence(state, blockIndent) || readBlockMapping(state, blockIndent, flowIndent)) || @@ -2031,7 +2026,9 @@ function composeNode(state, parentIndent, nodeContext, allowToSeek, allowCompact state.anchorMap[state.anchor] = state.result; } } - } else { + } else if (0 === indentStatus) { + // Special case: block sequences are allowed to have same indentation level as the parent. + // http://www.yaml.org/spec/1.2/spec.html#id2799784 hasContent = allowBlockCollections && readBlockSequence(state, blockIndent); } } @@ -2646,6 +2643,10 @@ var BASE64_MAP = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789 function resolveYamlBinary(data) { + if (null === data) { + return false; + } + var code, idx, bitlen = 0, len = 0, max = data.length, map = BASE64_MAP; // Convert one by one. @@ -2768,6 +2769,10 @@ module.exports = new Type('tag:yaml.org,2002:binary', { var Type = require('../type'); function resolveYamlBoolean(data) { + if (null === data) { + return false; + } + var max = data.length; return (max === 4 && (data === 'true' || data === 'True' || data === 'TRUE')) || @@ -2811,6 +2816,10 @@ var YAML_FLOAT_PATTERN = new RegExp( '|\\.(?:nan|NaN|NAN))$'); function resolveYamlFloat(data) { + if (null === data) { + return false; + } + var value, sign, base, digits; if (!YAML_FLOAT_PATTERN.test(data)) { @@ -2926,6 +2935,10 @@ function isDecCode(c) { } function resolveYamlInteger(data) { + if (null === data) { + return false; + } + var max = data.length, index = 0, hasDigits = false, @@ -3108,6 +3121,10 @@ try { var Type = require('../../type'); function resolveJavascriptFunction(data) { + if (null === data) { + return false; + } + try { var source = '(' + data + ')', ast = esprima.parse(source, { range: true }), @@ -3175,6 +3192,14 @@ module.exports = new Type('tag:yaml.org,2002:js/function', { var Type = require('../../type'); function resolveJavascriptRegExp(data) { + if (null === data) { + return false; + } + + if (0 === data.length) { + return false; + } + var regexp = data, tail = /\/([gim]*)$/.exec(data), modifiers = ''; @@ -3282,7 +3307,8 @@ module.exports = new Type('tag:yaml.org,2002:js/undefined', { var Type = require('../type'); module.exports = new Type('tag:yaml.org,2002:map', { - kind: 'mapping' + kind: 'mapping', + construct: function (data) { return null !== data ? data : {}; } }); },{"../type":13}],22:[function(require,module,exports){ @@ -3291,12 +3317,12 @@ module.exports = new Type('tag:yaml.org,2002:map', { var Type = require('../type'); function resolveYamlMerge(data) { - return '<<' === data; + return '<<' === data || null === data; } module.exports = new Type('tag:yaml.org,2002:merge', { kind: 'scalar', - resolve: resolveYamlMerge, + resolve: resolveYamlMerge }); },{"../type":13}],23:[function(require,module,exports){ @@ -3305,6 +3331,10 @@ module.exports = new Type('tag:yaml.org,2002:merge', { var Type = require('../type'); function resolveYamlNull(data) { + if (null === data) { + return true; + } + var max = data.length; return (max === 1 && data === '~') || @@ -3342,6 +3372,10 @@ var _hasOwnProperty = Object.prototype.hasOwnProperty; var _toString = Object.prototype.toString; function resolveYamlOmap(data) { + if (null === data) { + return true; + } + var objectKeys = [], index, length, pair, pairKey, pairHasKey, object = data; @@ -3377,9 +3411,14 @@ function resolveYamlOmap(data) { return true; } +function constructYamlOmap(data) { + return null !== data ? data : []; +} + module.exports = new Type('tag:yaml.org,2002:omap', { kind: 'sequence', - resolve: resolveYamlOmap + resolve: resolveYamlOmap, + construct: constructYamlOmap }); },{"../type":13}],25:[function(require,module,exports){ @@ -3390,6 +3429,10 @@ var Type = require('../type'); var _toString = Object.prototype.toString; function resolveYamlPairs(data) { + if (null === data) { + return true; + } + var index, length, pair, keys, result, object = data; @@ -3415,6 +3458,10 @@ function resolveYamlPairs(data) { } function constructYamlPairs(data) { + if (null === data) { + return []; + } + var index, length, pair, keys, result, object = data; @@ -3443,7 +3490,8 @@ module.exports = new Type('tag:yaml.org,2002:pairs', { var Type = require('../type'); module.exports = new Type('tag:yaml.org,2002:seq', { - kind: 'sequence' + kind: 'sequence', + construct: function (data) { return null !== data ? data : []; } }); },{"../type":13}],27:[function(require,module,exports){ @@ -3454,6 +3502,10 @@ var Type = require('../type'); var _hasOwnProperty = Object.prototype.hasOwnProperty; function resolveYamlSet(data) { + if (null === data) { + return true; + } + var key, object = data; for (key in object) { @@ -3467,9 +3519,14 @@ function resolveYamlSet(data) { return true; } +function constructYamlSet(data) { + return null !== data ? data : {}; +} + module.exports = new Type('tag:yaml.org,2002:set', { kind: 'mapping', - resolve: resolveYamlSet + resolve: resolveYamlSet, + construct: constructYamlSet }); },{"../type":13}],28:[function(require,module,exports){ @@ -3478,7 +3535,8 @@ module.exports = new Type('tag:yaml.org,2002:set', { var Type = require('../type'); module.exports = new Type('tag:yaml.org,2002:str', { - kind: 'scalar' + kind: 'scalar', + construct: function (data) { return null !== data ? data : ''; } }); },{"../type":13}],29:[function(require,module,exports){ @@ -3499,6 +3557,10 @@ var YAML_TIMESTAMP_REGEXP = new RegExp( '(?::([0-9][0-9]))?))?)?$'); // [11] tz_minute function resolveYamlTimestamp(data) { + if (null === data) { + return false; + } + var match, year, month, day, hour, minute, second, fraction = 0, delta = null, tz_hour, tz_minute, date; diff --git a/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/js-yaml/dist/js-yaml.min.js b/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/js-yaml/dist/js-yaml.min.js index 42ee1e1..531e3eb 100644 --- a/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/js-yaml/dist/js-yaml.min.js +++ b/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/js-yaml/dist/js-yaml.min.js @@ -1,3 +1,3 @@ -/* js-yaml 3.2.3 https://github.com/nodeca/js-yaml */ -!function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var t;"undefined"!=typeof window?t=window:"undefined"!=typeof global?t=global:"undefined"!=typeof self&&(t=self),t.jsyaml=e()}}(function(){return function e(t,n,i){function r(a,s){if(!n[a]){if(!t[a]){var c="function"==typeof require&&require;if(!s&&c)return c(a,!0);if(o)return o(a,!0);var u=new Error("Cannot find module '"+a+"'");throw u.code="MODULE_NOT_FOUND",u}var p=n[a]={exports:{}};t[a][0].call(p.exports,function(e){var n=t[a][1][e];return r(n?n:e)},p,p.exports,e,t,n,i)}return n[a].exports}for(var o="function"==typeof require&&require,a=0;an;n+=1)r=o[n],e[r]=t[r];return e}function a(e,t){var n,i="";for(n=0;t>n;n+=1)i+=e;return i}function s(e){return 0===e&&Number.NEGATIVE_INFINITY===1/e}t.exports.isNothing=n,t.exports.isObject=i,t.exports.toArray=r,t.exports.repeat=a,t.exports.isNegativeZero=s,t.exports.extend=o},{}],3:[function(e,t){"use strict";function n(e,t){var n,i,r,o,a,s,c;if(null===t)return{};for(n={},i=Object.keys(t),r=0,o=i.length;o>r;r+=1)a=i[r],s=String(t[a]),"!!"===a.slice(0,2)&&(a="tag:yaml.org,2002:"+a.slice(2)),c=e.compiledTypeMap[a],c&&C.call(c.styleAliases,s)&&(s=c.styleAliases[s]),n[a]=s;return n}function i(e){var t,n,i;if(t=e.toString(16).toUpperCase(),255>=e)n="x",i=2;else if(65535>=e)n="u",i=4;else{if(!(4294967295>=e))throw new v("code point within a string may not be greater than 0xFFFFFFFF");n="U",i=8}return"\\"+n+x.repeat("0",i-t.length)+t}function r(e){this.schema=e.schema||A,this.indent=Math.max(1,e.indent||2),this.skipInvalid=e.skipInvalid||!1,this.flowLevel=x.isNothing(e.flowLevel)?-1:e.flowLevel,this.styleMap=n(this.schema,e.styles||null),this.implicitTypes=this.schema.compiledImplicit,this.explicitTypes=this.schema.compiledExplicit,this.tag=null,this.result="",this.duplicates=[],this.usedDuplicates=null}function o(e,t){return"\n"+x.repeat(" ",e.indent*t)}function a(e,t){var n,i,r;for(n=0,i=e.implicitTypes.length;i>n;n+=1)if(r=e.implicitTypes[n],r.resolve(t))return!0;return!1}function s(e,t){var n,r,o,s,c,u;for(e.dump="",n=!1,r=0,u=t.charCodeAt(0)||0,-1!==Z.indexOf(t)?n=!0:0===t.length?n=!0:S===u||S===t.charCodeAt(t.length-1)?n=!0:(D===u||q===u)&&(n=!0),o=0,s=t.length;s>o;o+=1)c=t.charCodeAt(o),n||(k===c||j===c||I===c||L===c||R===c||H===c||B===c||V===c||F===c||_===c||M===c||O===c||G===c||Y===c||T===c||E===c||N===c||P===c||U===c||$===c)&&(n=!0),(W[c]||!(c>=32&&126>=c||133===c||c>=160&&55295>=c||c>=57344&&65533>=c||c>=65536&&1114111>=c))&&(e.dump+=t.slice(r,o),e.dump+=W[c]||i(c),r=o+1,n=!0);o>r&&(e.dump+=t.slice(r,o)),!n&&a(e,e.dump)&&(n=!0),n&&(e.dump='"'+e.dump+'"')}function c(e,t,n){var i,r,o="",a=e.tag;for(i=0,r=n.length;r>i;i+=1)d(e,t,n[i],!1,!1)&&(0!==i&&(o+=", "),o+=e.dump);e.tag=a,e.dump="["+o+"]"}function u(e,t,n,i){var r,a,s="",c=e.tag;for(r=0,a=n.length;a>r;r+=1)d(e,t+1,n[r],!0,!0)&&(i&&0===r||(s+=o(e,t)),s+="- "+e.dump);e.tag=c,e.dump=s||"[]"}function p(e,t,n){var i,r,o,a,s,c="",u=e.tag,p=Object.keys(n);for(i=0,r=p.length;r>i;i+=1)s="",0!==i&&(s+=", "),o=p[i],a=n[o],d(e,t,o,!1,!1)&&(e.dump.length>1024&&(s+="? "),s+=e.dump+": ",d(e,t,a,!1,!1)&&(s+=e.dump,c+=s));e.tag=u,e.dump="{"+c+"}"}function l(e,t,n,i){var r,a,s,c,u,p,l="",f=e.tag,h=Object.keys(n);for(r=0,a=h.length;a>r;r+=1)p="",i&&0===r||(p+=o(e,t)),s=h[r],c=n[s],d(e,t+1,s,!0,!0)&&(u=null!==e.tag&&"?"!==e.tag||e.dump&&e.dump.length>1024,u&&(p+=e.dump&&j===e.dump.charCodeAt(0)?"?":"? "),p+=e.dump,u&&(p+=o(e,t)),d(e,t+1,c,!0,u)&&(p+=e.dump&&j===e.dump.charCodeAt(0)?":":": ",p+=e.dump,l+=p));e.tag=f,e.dump=l||"{}"}function f(e,t,n){var i,r,o,a,s,c;for(r=n?e.explicitTypes:e.implicitTypes,o=0,a=r.length;a>o;o+=1)if(s=r[o],(s.instanceOf||s.predicate)&&(!s.instanceOf||"object"==typeof t&&t instanceof s.instanceOf)&&(!s.predicate||s.predicate(t))){if(e.tag=n?s.tag:"?",s.represent){if(c=e.styleMap[s.tag]||s.defaultStyle,"[object Function]"===w.call(s.represent))i=s.represent(t,c);else{if(!C.call(s.represent,c))throw new v("!<"+s.tag+'> tag resolver accepts not "'+c+'" style');i=s.represent[c](t,c)}e.dump=i}return!0}return!1}function d(e,t,n,i,r){e.tag=null,e.dump=n,f(e,n,!1)||f(e,n,!0);var o=w.call(e.dump);i&&(i=0>e.flowLevel||e.flowLevel>t),(null!==e.tag&&"?"!==e.tag||2!==e.indent&&t>0)&&(r=!1);var a,d,h="[object Object]"===o||"[object Array]"===o;if(h&&(a=e.duplicates.indexOf(n),d=-1!==a),d&&e.usedDuplicates[a])e.dump="*ref_"+a;else{if(h&&d&&!e.usedDuplicates[a]&&(e.usedDuplicates[a]=!0),"[object Object]"===o)i&&0!==Object.keys(e.dump).length?(l(e,t,e.dump,r),d&&(e.dump="&ref_"+a+(0===t?"\n":"")+e.dump)):(p(e,t,e.dump),d&&(e.dump="&ref_"+a+" "+e.dump));else if("[object Array]"===o)i&&0!==e.dump.length?(u(e,t,e.dump,r),d&&(e.dump="&ref_"+a+(0===t?"\n":"")+e.dump)):(c(e,t,e.dump),d&&(e.dump="&ref_"+a+" "+e.dump));else{if("[object String]"!==o){if(e.skipInvalid)return!1;throw new v("unacceptable kind of an object to dump "+o)}"?"!==e.tag&&s(e,e.dump)}null!==e.tag&&"?"!==e.tag&&(e.dump="!<"+e.tag+"> "+e.dump)}return!0}function h(e,t){var n,i,r=[],o=[];for(m(e,r,o),n=0,i=o.length;i>n;n+=1)t.duplicates.push(r[o[n]]);t.usedDuplicates=new Array(i)}function m(e,t,n){{var i,r,o;w.call(e)}if(null!==e&&"object"==typeof e)if(r=t.indexOf(e),-1!==r)-1===n.indexOf(r)&&n.push(r);else if(t.push(e),Array.isArray(e))for(r=0,o=e.length;o>r;r+=1)m(e[r],t,n);else for(i=Object.keys(e),r=0,o=i.length;o>r;r+=1)m(e[i[r]],t,n)}function g(e,t){t=t||{};var n=new r(t);return h(e,n),d(n,0,e,!0,!0)?n.dump+"\n":""}function y(e,t){return g(e,x.extend({schema:b},t))}var x=e("./common"),v=e("./exception"),A=e("./schema/default_full"),b=e("./schema/default_safe"),w=Object.prototype.toString,C=Object.prototype.hasOwnProperty,k=9,j=10,I=13,S=32,O=33,E=34,F=35,N=37,_=38,T=39,M=42,L=44,D=45,U=58,Y=62,q=63,P=64,R=91,H=93,$=96,B=123,G=124,V=125,W={};W[0]="\\0",W[7]="\\a",W[8]="\\b",W[9]="\\t",W[10]="\\n",W[11]="\\v",W[12]="\\f",W[13]="\\r",W[27]="\\e",W[34]='\\"',W[92]="\\\\",W[133]="\\N",W[160]="\\_",W[8232]="\\L",W[8233]="\\P";var Z=["y","Y","yes","Yes","YES","on","On","ON","n","N","no","No","NO","off","Off","OFF"];t.exports.dump=g,t.exports.safeDump=y},{"./common":2,"./exception":4,"./schema/default_full":9,"./schema/default_safe":10}],4:[function(e,t){"use strict";function n(e,t){this.name="YAMLException",this.reason=e,this.mark=t,this.message=this.toString(!1)}n.prototype.toString=function(e){var t;return t="JS-YAML: "+(this.reason||"(unknown reason)"),!e&&this.mark&&(t+=" "+this.mark.toString()),t},t.exports=n},{}],5:[function(e,t){"use strict";function n(e){return 10===e||13===e}function i(e){return 9===e||32===e}function r(e){return 9===e||32===e||10===e||13===e}function o(e){return 44===e||91===e||93===e||123===e||125===e}function a(e){var t;return e>=48&&57>=e?e-48:(t=32|e,t>=97&&102>=t?t-97+10:-1)}function s(e){return 120===e?2:117===e?4:85===e?8:0}function c(e){return e>=48&&57>=e?e-48:-1}function u(e){return 48===e?"\x00":97===e?"":98===e?"\b":116===e?" ":9===e?" ":110===e?"\n":118===e?" ":102===e?"\f":114===e?"\r":101===e?"":32===e?" ":34===e?'"':47===e?"/":92===e?"\\":78===e?"…":95===e?" ":76===e?"\u2028":80===e?"\u2029":""}function p(e,t){this.input=e,this.filename=t.filename||null,this.schema=t.schema||H,this.onWarning=t.onWarning||null,this.legacy=t.legacy||!1,this.implicitTypes=this.schema.compiledImplicit,this.typeMap=this.schema.compiledTypeMap,this.length=e.length,this.position=0,this.line=0,this.lineStart=0,this.lineIndent=0,this.documents=[]}function l(e,t){return new q(t,new P(e.filename,e.input,e.position,e.line,e.position-e.lineStart))}function f(e,t){throw l(e,t)}function d(e,t){var n=l(e,t);if(!e.onWarning)throw n;e.onWarning.call(null,n)}function h(e,t,n,i){var r,o,a,s;if(n>t){if(s=e.input.slice(t,n),i)for(r=0,o=s.length;o>r;r+=1)a=s.charCodeAt(r),9===a||a>=32&&1114111>=a||f(e,"expected valid JSON character");e.result+=s}}function m(e,t,n){var i,r,o,a;for(Y.isObject(n)||f(e,"cannot merge mappings; the provided source object is unacceptable"),i=Object.keys(n),o=0,a=i.length;a>o;o+=1)r=i[o],$.call(t,r)||(t[r]=n[r])}function g(e,t,n,i,r){var o,a;if(i=String(i),null===t&&(t={}),"tag:yaml.org,2002:merge"===n)if(Array.isArray(r))for(o=0,a=r.length;a>o;o+=1)m(e,t,r[o]);else m(e,t,r);else t[i]=r;return t}function y(e){var t;t=e.input.charCodeAt(e.position),10===t?e.position++:13===t?(e.position++,10===e.input.charCodeAt(e.position)&&e.position++):f(e,"a line break is expected"),e.line+=1,e.lineStart=e.position}function x(e,t,r){for(var o=0,a=e.input.charCodeAt(e.position);0!==a;){for(;i(a);)a=e.input.charCodeAt(++e.position);if(t&&35===a)do a=e.input.charCodeAt(++e.position);while(10!==a&&13!==a&&0!==a);if(!n(a))break;for(y(e),a=e.input.charCodeAt(e.position),o++,e.lineIndent=0;32===a;)e.lineIndent++,a=e.input.charCodeAt(++e.position);e.lineIndent1&&(e.result+=Y.repeat("\n",t-1))}function b(e,t,a){var s,c,u,p,l,f,d,m,g,y=e.kind,b=e.result;if(g=e.input.charCodeAt(e.position),r(g)||o(g)||35===g||38===g||42===g||33===g||124===g||62===g||39===g||34===g||37===g||64===g||96===g)return!1;if((63===g||45===g)&&(c=e.input.charCodeAt(e.position+1),r(c)||a&&o(c)))return!1;for(e.kind="scalar",e.result="",u=p=e.position,l=!1;0!==g;){if(58===g){if(c=e.input.charCodeAt(e.position+1),r(c)||a&&o(c))break}else if(35===g){if(s=e.input.charCodeAt(e.position-1),r(s))break}else{if(e.position===e.lineStart&&v(e)||a&&o(g))break;if(n(g)){if(f=e.line,d=e.lineStart,m=e.lineIndent,x(e,!1,-1),e.lineIndent>=t){l=!0,g=e.input.charCodeAt(e.position);continue}e.position=p,e.line=f,e.lineStart=d,e.lineIndent=m;break}}l&&(h(e,u,p,!1),A(e,e.line-f),u=p=e.position,l=!1),i(g)||(p=e.position+1),g=e.input.charCodeAt(++e.position)}return h(e,u,p,!1),e.result?!0:(e.kind=y,e.result=b,!1)}function w(e,t){var i,r,o;if(i=e.input.charCodeAt(e.position),39!==i)return!1;for(e.kind="scalar",e.result="",e.position++,r=o=e.position;0!==(i=e.input.charCodeAt(e.position));)if(39===i){if(h(e,r,e.position,!0),i=e.input.charCodeAt(++e.position),39!==i)return!0;r=o=e.position,e.position++}else n(i)?(h(e,r,o,!0),A(e,x(e,!1,t)),r=o=e.position):e.position===e.lineStart&&v(e)?f(e,"unexpected end of the document within a single quoted scalar"):(e.position++,o=e.position);f(e,"unexpected end of the stream within a single quoted scalar")}function C(e,t){var i,r,o,c,u,p;if(p=e.input.charCodeAt(e.position),34!==p)return!1;for(e.kind="scalar",e.result="",e.position++,i=r=e.position;0!==(p=e.input.charCodeAt(e.position));){if(34===p)return h(e,i,e.position,!0),e.position++,!0;if(92===p){if(h(e,i,e.position,!0),p=e.input.charCodeAt(++e.position),n(p))x(e,!1,t);else if(256>p&&nt[p])e.result+=it[p],e.position++;else if((u=s(p))>0){for(o=u,c=0;o>0;o--)p=e.input.charCodeAt(++e.position),(u=a(p))>=0?c=(c<<4)+u:f(e,"expected hexadecimal character");e.result+=String.fromCharCode(c),e.position++}else f(e,"unknown escape sequence");i=r=e.position}else n(p)?(h(e,i,r,!0),A(e,x(e,!1,t)),i=r=e.position):e.position===e.lineStart&&v(e)?f(e,"unexpected end of the document within a double quoted scalar"):(e.position++,r=e.position)}f(e,"unexpected end of the stream within a double quoted scalar")}function k(e,t){var n,i,o,a,s,c,u,p,l,d,h,m=!0,y=e.tag,v=e.anchor;if(h=e.input.charCodeAt(e.position),91===h)a=93,u=!1,i=[];else{if(123!==h)return!1;a=125,u=!0,i={}}for(null!==e.anchor&&(e.anchorMap[e.anchor]=i),h=e.input.charCodeAt(++e.position);0!==h;){if(x(e,!0,t),h=e.input.charCodeAt(e.position),h===a)return e.position++,e.tag=y,e.anchor=v,e.kind=u?"mapping":"sequence",e.result=i,!0;m||f(e,"missed comma between flow collection entries"),l=p=d=null,s=c=!1,63===h&&(o=e.input.charCodeAt(e.position+1),r(o)&&(s=c=!0,e.position++,x(e,!0,t))),n=e.line,N(e,t,B,!1,!0),l=e.tag,p=e.result,x(e,!0,t),h=e.input.charCodeAt(e.position),!c&&e.line!==n||58!==h||(s=!0,h=e.input.charCodeAt(++e.position),x(e,!0,t),N(e,t,B,!1,!0),d=e.result),u?g(e,i,l,p,d):i.push(s?g(e,null,l,p,d):p),x(e,!0,t),h=e.input.charCodeAt(e.position),44===h?(m=!0,h=e.input.charCodeAt(++e.position)):m=!1}f(e,"unexpected end of the stream within a flow collection")}function j(e,t){var r,o,a,s,u=Z,p=!1,l=t,d=0,m=!1;if(s=e.input.charCodeAt(e.position),124===s)o=!1;else{if(62!==s)return!1;o=!0}for(e.kind="scalar",e.result="";0!==s;)if(s=e.input.charCodeAt(++e.position),43===s||45===s)Z===u?u=43===s?z:J:f(e,"repeat of a chomping mode identifier");else{if(!((a=c(s))>=0))break;0===a?f(e,"bad explicit indentation width of a block scalar; it cannot be less than one"):p?f(e,"repeat of an indentation width identifier"):(l=t+a-1,p=!0)}if(i(s)){do s=e.input.charCodeAt(++e.position);while(i(s));if(35===s)do s=e.input.charCodeAt(++e.position);while(!n(s)&&0!==s)}for(;0!==s;){for(y(e),e.lineIndent=0,s=e.input.charCodeAt(e.position);(!p||e.lineIndentl&&(l=e.lineIndent),n(s))d++;else{if(e.lineIndentt)&&0!==o)f(e,"bad indentation of a sequence entry");else if(e.lineIndentt)&&(N(e,t,W,!0,a)&&(y?h=e.result:m=e.result),y||(g(e,l,d,h,m),d=h=m=null),x(e,!0,-1),c=e.input.charCodeAt(e.position)),e.lineIndent>t&&0!==c)f(e,"bad indentation of a mapping entry");else if(e.lineIndentt))return!1;g=!0}if(g)for(;O(e)||E(e);)if(x(e,!0,-1))if(m=!0,e.lineIndent>t)g=!0,s=o;else{if(e.lineIndent!==t)return!0;g=!1,s=o}else s=!1;if(s&&(s=m||r),(g||W===n)&&(l=B===n||G===n?t:t+1,h=e.position-e.lineStart,g?s&&(I(e,h)||S(e,h,l))||k(e,l)?y=!0:(a&&j(e,l)||w(e,l)||C(e,l)?y=!0:F(e)?(y=!0,(null!==e.tag||null!==e.anchor)&&f(e,"alias node should not have any properties")):b(e,l,B===n)&&(y=!0,null===e.tag&&(e.tag="?")),null!==e.anchor&&(e.anchorMap[e.anchor]=e.result)):y=s&&I(e,h)),null!==e.tag&&"!"!==e.tag)if("?"===e.tag){for(c=0,u=e.implicitTypes.length;u>c;c+=1)if(p=e.implicitTypes[c],p.resolve(e.result)){e.result=p.construct(e.result),e.tag=p.tag,null!==e.anchor&&(e.anchorMap[e.anchor]=e.result);break}}else $.call(e.typeMap,e.tag)?(p=e.typeMap[e.tag],null!==e.result&&p.kind!==e.kind&&f(e,"unacceptable node kind for !<"+e.tag+'> tag; it should be "'+p.kind+'", not "'+e.kind+'"'),p.resolve(e.result)?(e.result=p.construct(e.result),null!==e.anchor&&(e.anchorMap[e.anchor]=e.result)):f(e,"cannot resolve a node with !<"+e.tag+"> explicit tag")):d(e,"unknown tag !<"+e.tag+">");return null!==e.tag||null!==e.anchor||y}function _(e){var t,o,a,s,c=e.position,u=!1;for(e.version=null,e.checkLineBreaks=e.legacy,e.tagMap={},e.anchorMap={};0!==(s=e.input.charCodeAt(e.position))&&(x(e,!0,-1),s=e.input.charCodeAt(e.position),!(e.lineIndent>0||37!==s));){for(u=!0,s=e.input.charCodeAt(++e.position),t=e.position;0!==s&&!r(s);)s=e.input.charCodeAt(++e.position);for(o=e.input.slice(t,e.position),a=[],o.length<1&&f(e,"directive name must not be less than one character in length");0!==s;){for(;i(s);)s=e.input.charCodeAt(++e.position);if(35===s){do s=e.input.charCodeAt(++e.position);while(0!==s&&!n(s));break}if(n(s))break;for(t=e.position;0!==s&&!r(s);)s=e.input.charCodeAt(++e.position);a.push(e.input.slice(t,e.position))}0!==s&&y(e),$.call(ot,o)?ot[o](e,o,a):d(e,'unknown document directive "'+o+'"')}return x(e,!0,-1),0===e.lineIndent&&45===e.input.charCodeAt(e.position)&&45===e.input.charCodeAt(e.position+1)&&45===e.input.charCodeAt(e.position+2)?(e.position+=3,x(e,!0,-1)):u&&f(e,"directives end mark is expected"),N(e,e.lineIndent-1,W,!1,!0),x(e,!0,-1),e.checkLineBreaks&&Q.test(e.input.slice(c,e.position))&&d(e,"non-ASCII line breaks are interpreted as content"),e.documents.push(e.result),e.position===e.lineStart&&v(e)?void(46===e.input.charCodeAt(e.position)&&(e.position+=3,x(e,!0,-1))):void(e.positioni;i+=1)t(o[i])}function L(e,t){var n=T(e,t);if(0===n.length)return void 0;if(1===n.length)return n[0];throw new q("expected a single document in the stream, but found more")}function D(e,t,n){M(e,t,Y.extend({schema:R},n))}function U(e,t){return L(e,Y.extend({schema:R},t))}for(var Y=e("./common"),q=e("./exception"),P=e("./mark"),R=e("./schema/default_safe"),H=e("./schema/default_full"),$=Object.prototype.hasOwnProperty,B=1,G=2,V=3,W=4,Z=1,J=2,z=3,K=/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uD800-\uDFFF\uFFFE\uFFFF]/,Q=/[\x85\u2028\u2029]/,X=/[,\[\]\{\}]/,et=/^(?:!|!!|![a-z\-]+!)$/i,tt=/^(?:!|[^,\[\]\{\}])(?:%[0-9a-f]{2}|[0-9a-z\-#;\/\?:@&=\+\$,_\.!~\*'\(\)\[\]])*$/i,nt=new Array(256),it=new Array(256),rt=0;256>rt;rt++)nt[rt]=u(rt)?1:0,it[rt]=u(rt);var ot={YAML:function(e,t,n){var i,r,o;null!==e.version&&f(e,"duplication of %YAML directive"),1!==n.length&&f(e,"YAML directive accepts exactly one argument"),i=/^([0-9]+)\.([0-9]+)$/.exec(n[0]),null===i&&f(e,"ill-formed argument of the YAML directive"),r=parseInt(i[1],10),o=parseInt(i[2],10),1!==r&&f(e,"unacceptable YAML version of the document"),e.version=n[0],e.checkLineBreaks=2>o,1!==o&&2!==o&&d(e,"unsupported YAML version of the document")},TAG:function(e,t,n){var i,r;2!==n.length&&f(e,"TAG directive accepts exactly two arguments"),i=n[0],r=n[1],et.test(i)||f(e,"ill-formed tag handle (first argument) of the TAG directive"),$.call(e.tagMap,i)&&f(e,'there is a previously declared suffix for "'+i+'" tag handle'),tt.test(r)||f(e,"ill-formed tag prefix (second argument) of the TAG directive"),e.tagMap[i]=r}};t.exports.loadAll=M,t.exports.load=L,t.exports.safeLoadAll=D,t.exports.safeLoad=U},{"./common":2,"./exception":4,"./mark":6,"./schema/default_full":9,"./schema/default_safe":10}],6:[function(e,t){"use strict";function n(e,t,n,i,r){this.name=e,this.buffer=t,this.position=n,this.line=i,this.column=r}var i=e("./common");n.prototype.getSnippet=function(e,t){var n,r,o,a,s;if(!this.buffer)return null;for(e=e||4,t=t||75,n="",r=this.position;r>0&&-1==="\x00\r\n…\u2028\u2029".indexOf(this.buffer.charAt(r-1));)if(r-=1,this.position-r>t/2-1){n=" ... ",r+=5;break}for(o="",a=this.position;at/2-1){o=" ... ",a-=5;break}return s=this.buffer.slice(r,a),i.repeat(" ",e)+n+s+o+"\n"+i.repeat(" ",e+this.position-r+n.length)+"^"},n.prototype.toString=function(e){var t,n="";return this.name&&(n+='in "'+this.name+'" '),n+="at line "+(this.line+1)+", column "+(this.column+1),e||(t=this.getSnippet(),t&&(n+=":\n"+t)),n},t.exports=n},{"./common":2}],7:[function(e,t){"use strict";function n(e,t,i){var r=[];return e.include.forEach(function(e){i=n(e,t,i)}),e[t].forEach(function(e){i.forEach(function(t,n){t.tag===e.tag&&r.push(n)}),i.push(e)}),i.filter(function(e,t){return-1===r.indexOf(t)})}function i(){function e(e){i[e.tag]=e}var t,n,i={};for(t=0,n=arguments.length;n>t;t+=1)arguments[t].forEach(e);return i}function r(e){this.include=e.include||[],this.implicit=e.implicit||[],this.explicit=e.explicit||[],this.implicit.forEach(function(e){if(e.loadKind&&"scalar"!==e.loadKind)throw new a("There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.")}),this.compiledImplicit=n(this,"implicit",[]),this.compiledExplicit=n(this,"explicit",[]),this.compiledTypeMap=i(this.compiledImplicit,this.compiledExplicit)}var o=e("./common"),a=e("./exception"),s=e("./type");r.DEFAULT=null,r.create=function(){var e,t;switch(arguments.length){case 1:e=r.DEFAULT,t=arguments[0];break;case 2:e=arguments[0],t=arguments[1];break;default:throw new a("Wrong number of arguments for Schema.create function")}if(e=o.toArray(e),t=o.toArray(t),!e.every(function(e){return e instanceof r}))throw new a("Specified list of super schemas (or a single Schema object) contains a non-Schema object.");if(!t.every(function(e){return e instanceof s}))throw new a("Specified list of YAML types (or a single Type object) contains a non-Type object.");return new r({include:e,explicit:t})},t.exports=r},{"./common":2,"./exception":4,"./type":13}],8:[function(e,t){"use strict";var n=e("../schema");t.exports=new n({include:[e("./json")]})},{"../schema":7,"./json":12}],9:[function(e,t){"use strict";var n=e("../schema");t.exports=n.DEFAULT=new n({include:[e("./default_safe")],explicit:[e("../type/js/undefined"),e("../type/js/regexp"),e("../type/js/function")]})},{"../schema":7,"../type/js/function":18,"../type/js/regexp":19,"../type/js/undefined":20,"./default_safe":10}],10:[function(e,t){"use strict";var n=e("../schema");t.exports=new n({include:[e("./core")],implicit:[e("../type/timestamp"),e("../type/merge")],explicit:[e("../type/binary"),e("../type/omap"),e("../type/pairs"),e("../type/set")]})},{"../schema":7,"../type/binary":14,"../type/merge":22,"../type/omap":24,"../type/pairs":25,"../type/set":27,"../type/timestamp":29,"./core":8}],11:[function(e,t){"use strict";var n=e("../schema");t.exports=new n({explicit:[e("../type/str"),e("../type/seq"),e("../type/map")]})},{"../schema":7,"../type/map":21,"../type/seq":26,"../type/str":28}],12:[function(e,t){"use strict";var n=e("../schema");t.exports=new n({include:[e("./failsafe")],implicit:[e("../type/null"),e("../type/bool"),e("../type/int"),e("../type/float")]})},{"../schema":7,"../type/bool":15,"../type/float":16,"../type/int":17,"../type/null":23,"./failsafe":11}],13:[function(e,t){"use strict";function n(e){var t={};return null!==e&&Object.keys(e).forEach(function(n){e[n].forEach(function(e){t[String(e)]=n})}),t}function i(e,t){if(t=t||{},Object.keys(t).forEach(function(t){if(-1===o.indexOf(t))throw new r('Unknown option "'+t+'" is met in definition of "'+e+'" YAML type.')}),this.tag=e,this.kind=t.kind||null,this.resolve=t.resolve||function(){return!0},this.construct=t.construct||function(e){return e},this.instanceOf=t.instanceOf||null,this.predicate=t.predicate||null,this.represent=t.represent||null,this.defaultStyle=t.defaultStyle||null,this.styleAliases=n(t.styleAliases||null),-1===a.indexOf(this.kind))throw new r('Unknown kind "'+this.kind+'" is specified for "'+e+'" YAML type.')}var r=e("./exception"),o=["kind","resolve","construct","instanceOf","predicate","represent","defaultStyle","styleAliases"],a=["scalar","sequence","mapping"];t.exports=i},{"./exception":4}],14:[function(e,t){"use strict";function n(e){var t,n,i=0,r=e.length,o=c;for(n=0;r>n;n++)if(t=o.indexOf(e.charAt(n)),!(t>64)){if(0>t)return!1;i+=6}return i%8===0}function i(e){var t,n,i=e.replace(/[\r\n=]/g,""),r=i.length,o=c,s=0,u=[];for(t=0;r>t;t++)t%4===0&&t&&(u.push(s>>16&255),u.push(s>>8&255),u.push(255&s)),s=s<<6|o.indexOf(i.charAt(t));return n=r%4*6,0===n?(u.push(s>>16&255),u.push(s>>8&255),u.push(255&s)):18===n?(u.push(s>>10&255),u.push(s>>2&255)):12===n&&u.push(s>>4&255),a?new a(u):u}function r(e){var t,n,i="",r=0,o=e.length,a=c;for(t=0;o>t;t++)t%3===0&&t&&(i+=a[r>>18&63],i+=a[r>>12&63],i+=a[r>>6&63],i+=a[63&r]),r=(r<<8)+e[t];return n=o%3,0===n?(i+=a[r>>18&63],i+=a[r>>12&63],i+=a[r>>6&63],i+=a[63&r]):2===n?(i+=a[r>>10&63],i+=a[r>>4&63],i+=a[r<<2&63],i+=a[64]):1===n&&(i+=a[r>>2&63],i+=a[r<<4&63],i+=a[64],i+=a[64]),i}function o(e){return a&&a.isBuffer(e)}var a=e("buffer").Buffer,s=e("../type"),c="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=\n\r";t.exports=new s("tag:yaml.org,2002:binary",{kind:"scalar",resolve:n,construct:i,predicate:o,represent:r})},{"../type":13,buffer:30}],15:[function(e,t){"use strict";function n(e){var t=e.length;return 4===t&&("true"===e||"True"===e||"TRUE"===e)||5===t&&("false"===e||"False"===e||"FALSE"===e)}function i(e){return"true"===e||"True"===e||"TRUE"===e}function r(e){return"[object Boolean]"===Object.prototype.toString.call(e)}var o=e("../type");t.exports=new o("tag:yaml.org,2002:bool",{kind:"scalar",resolve:n,construct:i,predicate:r,represent:{lowercase:function(e){return e?"true":"false"},uppercase:function(e){return e?"TRUE":"FALSE"},camelcase:function(e){return e?"True":"False"}},defaultStyle:"lowercase"})},{"../type":13}],16:[function(e,t){"use strict";function n(e){return c.test(e)?!0:!1}function i(e){var t,n,i,r;return t=e.replace(/_/g,"").toLowerCase(),n="-"===t[0]?-1:1,r=[],0<="+-".indexOf(t[0])&&(t=t.slice(1)),".inf"===t?1===n?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY:".nan"===t?0/0:0<=t.indexOf(":")?(t.split(":").forEach(function(e){r.unshift(parseFloat(e,10))}),t=0,i=1,r.forEach(function(e){t+=e*i,i*=60}),n*t):n*parseFloat(t,10)}function r(e,t){if(isNaN(e))switch(t){case"lowercase":return".nan";case"uppercase":return".NAN";case"camelcase":return".NaN"}else if(Number.POSITIVE_INFINITY===e)switch(t){case"lowercase":return".inf";case"uppercase":return".INF";case"camelcase":return".Inf"}else{if(Number.NEGATIVE_INFINITY!==e)return a.isNegativeZero(e)?"-0.0":e.toString(10);switch(t){case"lowercase":return"-.inf";case"uppercase":return"-.INF";case"camelcase":return"-.Inf"}}}function o(e){return"[object Number]"===Object.prototype.toString.call(e)&&(0!==e%1||a.isNegativeZero(e))}var a=e("../common"),s=e("../type"),c=new RegExp("^(?:[-+]?(?:[0-9][0-9_]*)\\.[0-9_]*(?:[eE][-+][0-9]+)?|\\.[0-9_]+(?:[eE][-+][0-9]+)?|[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\\.[0-9_]*|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");t.exports=new s("tag:yaml.org,2002:float",{kind:"scalar",resolve:n,construct:i,predicate:o,represent:r,defaultStyle:"lowercase"})},{"../common":2,"../type":13}],17:[function(e,t){"use strict";function n(e){return e>=48&&57>=e||e>=65&&70>=e||e>=97&&102>=e}function i(e){return e>=48&&55>=e}function r(e){return e>=48&&57>=e}function o(e){var t,o=e.length,a=0,s=!1;if(!o)return!1;if(t=e[a],("-"===t||"+"===t)&&(t=e[++a]),"0"===t){if(a+1===o)return!0;if(t=e[++a],"b"===t){for(a++;o>a;a++)if(t=e[a],"_"!==t){if("0"!==t&&"1"!==t)return!1;s=!0}return s}if("x"===t){for(a++;o>a;a++)if(t=e[a],"_"!==t){if(!n(e.charCodeAt(a)))return!1;s=!0}return s}for(;o>a;a++)if(t=e[a],"_"!==t){if(!i(e.charCodeAt(a)))return!1;s=!0}return s}for(;o>a;a++)if(t=e[a],"_"!==t){if(":"===t)break;if(!r(e.charCodeAt(a)))return!1; -s=!0}return s?":"!==t?!0:/^(:[0-5]?[0-9])+$/.test(e.slice(a)):!1}function a(e){var t,n,i=e,r=1,o=[];return-1!==i.indexOf("_")&&(i=i.replace(/_/g,"")),t=i[0],("-"===t||"+"===t)&&("-"===t&&(r=-1),i=i.slice(1),t=i[0]),"0"===i?0:"0"===t?"b"===i[1]?r*parseInt(i.slice(2),2):"x"===i[1]?r*parseInt(i,16):r*parseInt(i,8):-1!==i.indexOf(":")?(i.split(":").forEach(function(e){o.unshift(parseInt(e,10))}),i=0,n=1,o.forEach(function(e){i+=e*n,n*=60}),r*i):r*parseInt(i,10)}function s(e){return"[object Number]"===Object.prototype.toString.call(e)&&0===e%1&&!c.isNegativeZero(e)}var c=e("../common"),u=e("../type");t.exports=new u("tag:yaml.org,2002:int",{kind:"scalar",resolve:o,construct:a,predicate:s,represent:{binary:function(e){return"0b"+e.toString(2)},octal:function(e){return"0"+e.toString(8)},decimal:function(e){return e.toString(10)},hexadecimal:function(e){return"0x"+e.toString(16).toUpperCase()}},defaultStyle:"decimal",styleAliases:{binary:[2,"bin"],octal:[8,"oct"],decimal:[10,"dec"],hexadecimal:[16,"hex"]}})},{"../common":2,"../type":13}],18:[function(e,t){"use strict";function n(e){try{var t="("+e+")",n=a.parse(t,{range:!0});return"Program"!==n.type||1!==n.body.length||"ExpressionStatement"!==n.body[0].type||"FunctionExpression"!==n.body[0].expression.type?!1:!0}catch(i){return!1}}function i(e){var t,n="("+e+")",i=a.parse(n,{range:!0}),r=[];if("Program"!==i.type||1!==i.body.length||"ExpressionStatement"!==i.body[0].type||"FunctionExpression"!==i.body[0].expression.type)throw new Error("Failed to resolve function");return i.body[0].expression.params.forEach(function(e){r.push(e.name)}),t=i.body[0].expression.body.range,new Function(r,n.slice(t[0]+1,t[1]-1))}function r(e){return e.toString()}function o(e){return"[object Function]"===Object.prototype.toString.call(e)}var a;try{a=e("esprima")}catch(s){"undefined"!=typeof window&&(a=window.esprima)}var c=e("../../type");t.exports=new c("tag:yaml.org,2002:js/function",{kind:"scalar",resolve:n,construct:i,predicate:o,represent:r})},{"../../type":13,esprima:"esprima"}],19:[function(e,t){"use strict";function n(e){var t=e,n=/\/([gim]*)$/.exec(e),i="";if("/"===t[0]){if(n&&(i=n[1]),i.length>3)return!1;if("/"!==t[t.length-i.length-1])return!1;t=t.slice(1,t.length-i.length-1)}try{{new RegExp(t,i)}return!0}catch(r){return!1}}function i(e){var t=e,n=/\/([gim]*)$/.exec(e),i="";return"/"===t[0]&&(n&&(i=n[1]),t=t.slice(1,t.length-i.length-1)),new RegExp(t,i)}function r(e){var t="/"+e.source+"/";return e.global&&(t+="g"),e.multiline&&(t+="m"),e.ignoreCase&&(t+="i"),t}function o(e){return"[object RegExp]"===Object.prototype.toString.call(e)}var a=e("../../type");t.exports=new a("tag:yaml.org,2002:js/regexp",{kind:"scalar",resolve:n,construct:i,predicate:o,represent:r})},{"../../type":13}],20:[function(e,t){"use strict";function n(){return!0}function i(){return void 0}function r(){return""}function o(e){return"undefined"==typeof e}var a=e("../../type");t.exports=new a("tag:yaml.org,2002:js/undefined",{kind:"scalar",resolve:n,construct:i,predicate:o,represent:r})},{"../../type":13}],21:[function(e,t){"use strict";var n=e("../type");t.exports=new n("tag:yaml.org,2002:map",{kind:"mapping"})},{"../type":13}],22:[function(e,t){"use strict";function n(e){return"<<"===e}var i=e("../type");t.exports=new i("tag:yaml.org,2002:merge",{kind:"scalar",resolve:n})},{"../type":13}],23:[function(e,t){"use strict";function n(e){var t=e.length;return 1===t&&"~"===e||4===t&&("null"===e||"Null"===e||"NULL"===e)}function i(){return null}function r(e){return null===e}var o=e("../type");t.exports=new o("tag:yaml.org,2002:null",{kind:"scalar",resolve:n,construct:i,predicate:r,represent:{canonical:function(){return"~"},lowercase:function(){return"null"},uppercase:function(){return"NULL"},camelcase:function(){return"Null"}},defaultStyle:"lowercase"})},{"../type":13}],24:[function(e,t){"use strict";function n(e){var t,n,i,a,s,c=[],u=e;for(t=0,n=u.length;n>t;t+=1){if(i=u[t],s=!1,"[object Object]"!==o.call(i))return!1;for(a in i)if(r.call(i,a)){if(s)return!1;s=!0}if(!s)return!1;if(-1!==c.indexOf(a))return!1;c.push(a)}return!0}var i=e("../type"),r=Object.prototype.hasOwnProperty,o=Object.prototype.toString;t.exports=new i("tag:yaml.org,2002:omap",{kind:"sequence",resolve:n})},{"../type":13}],25:[function(e,t){"use strict";function n(e){var t,n,i,r,a,s=e;for(a=new Array(s.length),t=0,n=s.length;n>t;t+=1){if(i=s[t],"[object Object]"!==o.call(i))return!1;if(r=Object.keys(i),1!==r.length)return!1;a[t]=[r[0],i[r[0]]]}return!0}function i(e){var t,n,i,r,o,a=e;for(o=new Array(a.length),t=0,n=a.length;n>t;t+=1)i=a[t],r=Object.keys(i),o[t]=[r[0],i[r[0]]];return o}var r=e("../type"),o=Object.prototype.toString;t.exports=new r("tag:yaml.org,2002:pairs",{kind:"sequence",resolve:n,construct:i})},{"../type":13}],26:[function(e,t){"use strict";var n=e("../type");t.exports=new n("tag:yaml.org,2002:seq",{kind:"sequence"})},{"../type":13}],27:[function(e,t){"use strict";function n(e){var t,n=e;for(t in n)if(r.call(n,t)&&null!==n[t])return!1;return!0}var i=e("../type"),r=Object.prototype.hasOwnProperty;t.exports=new i("tag:yaml.org,2002:set",{kind:"mapping",resolve:n})},{"../type":13}],28:[function(e,t){"use strict";var n=e("../type");t.exports=new n("tag:yaml.org,2002:str",{kind:"scalar"})},{"../type":13}],29:[function(e,t){"use strict";function n(e){var t;return t=a.exec(e),null===t?!1:!0}function i(e){var t,n,i,r,o,s,c,u,p,l,f=0,d=null;if(t=a.exec(e),null===t)throw new Error("Date resolve error");if(n=+t[1],i=+t[2]-1,r=+t[3],!t[4])return new Date(Date.UTC(n,i,r));if(o=+t[4],s=+t[5],c=+t[6],t[7]){for(f=t[7].slice(0,3);f.length<3;)f+="0";f=+f}return t[9]&&(u=+t[10],p=+(t[11]||0),d=6e4*(60*u+p),"-"===t[9]&&(d=-d)),l=new Date(Date.UTC(n,i,r,o,s,c,f)),d&&l.setTime(l.getTime()-d),l}function r(e){return e.toISOString()}var o=e("../type"),a=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9]?)-([0-9][0-9]?)(?:(?:[Tt]|[ \\t]+)([0-9][0-9]?):([0-9][0-9]):([0-9][0-9])(?:\\.([0-9]*))?(?:[ \\t]*(Z|([-+])([0-9][0-9]?)(?::([0-9][0-9]))?))?)?$");t.exports=new o("tag:yaml.org,2002:timestamp",{kind:"scalar",resolve:n,construct:i,instanceOf:Date,represent:r})},{"../type":13}],30:[function(){},{}],"/":[function(e,t){"use strict";var n=e("./lib/js-yaml.js");t.exports=n},{"./lib/js-yaml.js":1}]},{},[])("/")}); \ No newline at end of file +/* js-yaml 3.2.5 https://github.com/nodeca/js-yaml */ +!function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var t;"undefined"!=typeof window?t=window:"undefined"!=typeof global?t=global:"undefined"!=typeof self&&(t=self),t.jsyaml=e()}}(function(){return function e(t,n,i){function r(a,s){if(!n[a]){if(!t[a]){var u="function"==typeof require&&require;if(!s&&u)return u(a,!0);if(o)return o(a,!0);var c=new Error("Cannot find module '"+a+"'");throw c.code="MODULE_NOT_FOUND",c}var l=n[a]={exports:{}};t[a][0].call(l.exports,function(e){var n=t[a][1][e];return r(n?n:e)},l,l.exports,e,t,n,i)}return n[a].exports}for(var o="function"==typeof require&&require,a=0;an;n+=1)r=o[n],e[r]=t[r];return e}function a(e,t){var n,i="";for(n=0;t>n;n+=1)i+=e;return i}function s(e){return 0===e&&Number.NEGATIVE_INFINITY===1/e}t.exports.isNothing=n,t.exports.isObject=i,t.exports.toArray=r,t.exports.repeat=a,t.exports.isNegativeZero=s,t.exports.extend=o},{}],3:[function(e,t){"use strict";function n(e,t){var n,i,r,o,a,s,u;if(null===t)return{};for(n={},i=Object.keys(t),r=0,o=i.length;o>r;r+=1)a=i[r],s=String(t[a]),"!!"===a.slice(0,2)&&(a="tag:yaml.org,2002:"+a.slice(2)),u=e.compiledTypeMap[a],u&&C.call(u.styleAliases,s)&&(s=u.styleAliases[s]),n[a]=s;return n}function i(e){var t,n,i;if(t=e.toString(16).toUpperCase(),255>=e)n="x",i=2;else if(65535>=e)n="u",i=4;else{if(!(4294967295>=e))throw new v("code point within a string may not be greater than 0xFFFFFFFF");n="U",i=8}return"\\"+n+x.repeat("0",i-t.length)+t}function r(e){this.schema=e.schema||A,this.indent=Math.max(1,e.indent||2),this.skipInvalid=e.skipInvalid||!1,this.flowLevel=x.isNothing(e.flowLevel)?-1:e.flowLevel,this.styleMap=n(this.schema,e.styles||null),this.implicitTypes=this.schema.compiledImplicit,this.explicitTypes=this.schema.compiledExplicit,this.tag=null,this.result="",this.duplicates=[],this.usedDuplicates=null}function o(e,t){return"\n"+x.repeat(" ",e.indent*t)}function a(e,t){var n,i,r;for(n=0,i=e.implicitTypes.length;i>n;n+=1)if(r=e.implicitTypes[n],r.resolve(t))return!0;return!1}function s(e,t){var n,r,o,s,u,c;for(e.dump="",n=!1,r=0,c=t.charCodeAt(0)||0,-1!==Z.indexOf(t)?n=!0:0===t.length?n=!0:S===c||S===t.charCodeAt(t.length-1)?n=!0:(D===c||q===c)&&(n=!0),o=0,s=t.length;s>o;o+=1)u=t.charCodeAt(o),n||(k===u||j===u||I===u||L===u||R===u||H===u||B===u||V===u||F===u||_===u||M===u||O===u||G===u||Y===u||T===u||E===u||N===u||P===u||U===u||$===u)&&(n=!0),(W[u]||!(u>=32&&126>=u||133===u||u>=160&&55295>=u||u>=57344&&65533>=u||u>=65536&&1114111>=u))&&(e.dump+=t.slice(r,o),e.dump+=W[u]||i(u),r=o+1,n=!0);o>r&&(e.dump+=t.slice(r,o)),!n&&a(e,e.dump)&&(n=!0),n&&(e.dump='"'+e.dump+'"')}function u(e,t,n){var i,r,o="",a=e.tag;for(i=0,r=n.length;r>i;i+=1)d(e,t,n[i],!1,!1)&&(0!==i&&(o+=", "),o+=e.dump);e.tag=a,e.dump="["+o+"]"}function c(e,t,n,i){var r,a,s="",u=e.tag;for(r=0,a=n.length;a>r;r+=1)d(e,t+1,n[r],!0,!0)&&(i&&0===r||(s+=o(e,t)),s+="- "+e.dump);e.tag=u,e.dump=s||"[]"}function l(e,t,n){var i,r,o,a,s,u="",c=e.tag,l=Object.keys(n);for(i=0,r=l.length;r>i;i+=1)s="",0!==i&&(s+=", "),o=l[i],a=n[o],d(e,t,o,!1,!1)&&(e.dump.length>1024&&(s+="? "),s+=e.dump+": ",d(e,t,a,!1,!1)&&(s+=e.dump,u+=s));e.tag=c,e.dump="{"+u+"}"}function p(e,t,n,i){var r,a,s,u,c,l,p="",f=e.tag,h=Object.keys(n);for(r=0,a=h.length;a>r;r+=1)l="",i&&0===r||(l+=o(e,t)),s=h[r],u=n[s],d(e,t+1,s,!0,!0)&&(c=null!==e.tag&&"?"!==e.tag||e.dump&&e.dump.length>1024,c&&(l+=e.dump&&j===e.dump.charCodeAt(0)?"?":"? "),l+=e.dump,c&&(l+=o(e,t)),d(e,t+1,u,!0,c)&&(l+=e.dump&&j===e.dump.charCodeAt(0)?":":": ",l+=e.dump,p+=l));e.tag=f,e.dump=p||"{}"}function f(e,t,n){var i,r,o,a,s,u;for(r=n?e.explicitTypes:e.implicitTypes,o=0,a=r.length;a>o;o+=1)if(s=r[o],(s.instanceOf||s.predicate)&&(!s.instanceOf||"object"==typeof t&&t instanceof s.instanceOf)&&(!s.predicate||s.predicate(t))){if(e.tag=n?s.tag:"?",s.represent){if(u=e.styleMap[s.tag]||s.defaultStyle,"[object Function]"===w.call(s.represent))i=s.represent(t,u);else{if(!C.call(s.represent,u))throw new v("!<"+s.tag+'> tag resolver accepts not "'+u+'" style');i=s.represent[u](t,u)}e.dump=i}return!0}return!1}function d(e,t,n,i,r){e.tag=null,e.dump=n,f(e,n,!1)||f(e,n,!0);var o=w.call(e.dump);i&&(i=0>e.flowLevel||e.flowLevel>t),(null!==e.tag&&"?"!==e.tag||2!==e.indent&&t>0)&&(r=!1);var a,d,h="[object Object]"===o||"[object Array]"===o;if(h&&(a=e.duplicates.indexOf(n),d=-1!==a),d&&e.usedDuplicates[a])e.dump="*ref_"+a;else{if(h&&d&&!e.usedDuplicates[a]&&(e.usedDuplicates[a]=!0),"[object Object]"===o)i&&0!==Object.keys(e.dump).length?(p(e,t,e.dump,r),d&&(e.dump="&ref_"+a+(0===t?"\n":"")+e.dump)):(l(e,t,e.dump),d&&(e.dump="&ref_"+a+" "+e.dump));else if("[object Array]"===o)i&&0!==e.dump.length?(c(e,t,e.dump,r),d&&(e.dump="&ref_"+a+(0===t?"\n":"")+e.dump)):(u(e,t,e.dump),d&&(e.dump="&ref_"+a+" "+e.dump));else{if("[object String]"!==o){if(e.skipInvalid)return!1;throw new v("unacceptable kind of an object to dump "+o)}"?"!==e.tag&&s(e,e.dump)}null!==e.tag&&"?"!==e.tag&&(e.dump="!<"+e.tag+"> "+e.dump)}return!0}function h(e,t){var n,i,r=[],o=[];for(m(e,r,o),n=0,i=o.length;i>n;n+=1)t.duplicates.push(r[o[n]]);t.usedDuplicates=new Array(i)}function m(e,t,n){{var i,r,o;w.call(e)}if(null!==e&&"object"==typeof e)if(r=t.indexOf(e),-1!==r)-1===n.indexOf(r)&&n.push(r);else if(t.push(e),Array.isArray(e))for(r=0,o=e.length;o>r;r+=1)m(e[r],t,n);else for(i=Object.keys(e),r=0,o=i.length;o>r;r+=1)m(e[i[r]],t,n)}function g(e,t){t=t||{};var n=new r(t);return h(e,n),d(n,0,e,!0,!0)?n.dump+"\n":""}function y(e,t){return g(e,x.extend({schema:b},t))}var x=e("./common"),v=e("./exception"),A=e("./schema/default_full"),b=e("./schema/default_safe"),w=Object.prototype.toString,C=Object.prototype.hasOwnProperty,k=9,j=10,I=13,S=32,O=33,E=34,F=35,N=37,_=38,T=39,M=42,L=44,D=45,U=58,Y=62,q=63,P=64,R=91,H=93,$=96,B=123,G=124,V=125,W={};W[0]="\\0",W[7]="\\a",W[8]="\\b",W[9]="\\t",W[10]="\\n",W[11]="\\v",W[12]="\\f",W[13]="\\r",W[27]="\\e",W[34]='\\"',W[92]="\\\\",W[133]="\\N",W[160]="\\_",W[8232]="\\L",W[8233]="\\P";var Z=["y","Y","yes","Yes","YES","on","On","ON","n","N","no","No","NO","off","Off","OFF"];t.exports.dump=g,t.exports.safeDump=y},{"./common":2,"./exception":4,"./schema/default_full":9,"./schema/default_safe":10}],4:[function(e,t){"use strict";function n(e,t){this.name="YAMLException",this.reason=e,this.mark=t,this.message=this.toString(!1)}n.prototype.toString=function(e){var t;return t="JS-YAML: "+(this.reason||"(unknown reason)"),!e&&this.mark&&(t+=" "+this.mark.toString()),t},t.exports=n},{}],5:[function(e,t){"use strict";function n(e){return 10===e||13===e}function i(e){return 9===e||32===e}function r(e){return 9===e||32===e||10===e||13===e}function o(e){return 44===e||91===e||93===e||123===e||125===e}function a(e){var t;return e>=48&&57>=e?e-48:(t=32|e,t>=97&&102>=t?t-97+10:-1)}function s(e){return 120===e?2:117===e?4:85===e?8:0}function u(e){return e>=48&&57>=e?e-48:-1}function c(e){return 48===e?"\x00":97===e?"":98===e?"\b":116===e?" ":9===e?" ":110===e?"\n":118===e?" ":102===e?"\f":114===e?"\r":101===e?"":32===e?" ":34===e?'"':47===e?"/":92===e?"\\":78===e?"…":95===e?" ":76===e?"\u2028":80===e?"\u2029":""}function l(e,t){this.input=e,this.filename=t.filename||null,this.schema=t.schema||H,this.onWarning=t.onWarning||null,this.legacy=t.legacy||!1,this.implicitTypes=this.schema.compiledImplicit,this.typeMap=this.schema.compiledTypeMap,this.length=e.length,this.position=0,this.line=0,this.lineStart=0,this.lineIndent=0,this.documents=[]}function p(e,t){return new q(t,new P(e.filename,e.input,e.position,e.line,e.position-e.lineStart))}function f(e,t){throw p(e,t)}function d(e,t){var n=p(e,t);if(!e.onWarning)throw n;e.onWarning.call(null,n)}function h(e,t,n,i){var r,o,a,s;if(n>t){if(s=e.input.slice(t,n),i)for(r=0,o=s.length;o>r;r+=1)a=s.charCodeAt(r),9===a||a>=32&&1114111>=a||f(e,"expected valid JSON character");e.result+=s}}function m(e,t,n){var i,r,o,a;for(Y.isObject(n)||f(e,"cannot merge mappings; the provided source object is unacceptable"),i=Object.keys(n),o=0,a=i.length;a>o;o+=1)r=i[o],$.call(t,r)||(t[r]=n[r])}function g(e,t,n,i,r){var o,a;if(i=String(i),null===t&&(t={}),"tag:yaml.org,2002:merge"===n)if(Array.isArray(r))for(o=0,a=r.length;a>o;o+=1)m(e,t,r[o]);else m(e,t,r);else t[i]=r;return t}function y(e){var t;t=e.input.charCodeAt(e.position),10===t?e.position++:13===t?(e.position++,10===e.input.charCodeAt(e.position)&&e.position++):f(e,"a line break is expected"),e.line+=1,e.lineStart=e.position}function x(e,t,r){for(var o=0,a=e.input.charCodeAt(e.position);0!==a;){for(;i(a);)a=e.input.charCodeAt(++e.position);if(t&&35===a)do a=e.input.charCodeAt(++e.position);while(10!==a&&13!==a&&0!==a);if(!n(a))break;for(y(e),a=e.input.charCodeAt(e.position),o++,e.lineIndent=0;32===a;)e.lineIndent++,a=e.input.charCodeAt(++e.position)}return-1!==r&&0!==o&&e.lineIndent1&&(e.result+=Y.repeat("\n",t-1))}function b(e,t,a){var s,u,c,l,p,f,d,m,g,y=e.kind,b=e.result;if(g=e.input.charCodeAt(e.position),r(g)||o(g)||35===g||38===g||42===g||33===g||124===g||62===g||39===g||34===g||37===g||64===g||96===g)return!1;if((63===g||45===g)&&(u=e.input.charCodeAt(e.position+1),r(u)||a&&o(u)))return!1;for(e.kind="scalar",e.result="",c=l=e.position,p=!1;0!==g;){if(58===g){if(u=e.input.charCodeAt(e.position+1),r(u)||a&&o(u))break}else if(35===g){if(s=e.input.charCodeAt(e.position-1),r(s))break}else{if(e.position===e.lineStart&&v(e)||a&&o(g))break;if(n(g)){if(f=e.line,d=e.lineStart,m=e.lineIndent,x(e,!1,-1),e.lineIndent>=t){p=!0,g=e.input.charCodeAt(e.position);continue}e.position=l,e.line=f,e.lineStart=d,e.lineIndent=m;break}}p&&(h(e,c,l,!1),A(e,e.line-f),c=l=e.position,p=!1),i(g)||(l=e.position+1),g=e.input.charCodeAt(++e.position)}return h(e,c,l,!1),e.result?!0:(e.kind=y,e.result=b,!1)}function w(e,t){var i,r,o;if(i=e.input.charCodeAt(e.position),39!==i)return!1;for(e.kind="scalar",e.result="",e.position++,r=o=e.position;0!==(i=e.input.charCodeAt(e.position));)if(39===i){if(h(e,r,e.position,!0),i=e.input.charCodeAt(++e.position),39!==i)return!0;r=o=e.position,e.position++}else n(i)?(h(e,r,o,!0),A(e,x(e,!1,t)),r=o=e.position):e.position===e.lineStart&&v(e)?f(e,"unexpected end of the document within a single quoted scalar"):(e.position++,o=e.position);f(e,"unexpected end of the stream within a single quoted scalar")}function C(e,t){var i,r,o,u,c,l;if(l=e.input.charCodeAt(e.position),34!==l)return!1;for(e.kind="scalar",e.result="",e.position++,i=r=e.position;0!==(l=e.input.charCodeAt(e.position));){if(34===l)return h(e,i,e.position,!0),e.position++,!0;if(92===l){if(h(e,i,e.position,!0),l=e.input.charCodeAt(++e.position),n(l))x(e,!1,t);else if(256>l&&nt[l])e.result+=it[l],e.position++;else if((c=s(l))>0){for(o=c,u=0;o>0;o--)l=e.input.charCodeAt(++e.position),(c=a(l))>=0?u=(u<<4)+c:f(e,"expected hexadecimal character");e.result+=String.fromCharCode(u),e.position++}else f(e,"unknown escape sequence");i=r=e.position}else n(l)?(h(e,i,r,!0),A(e,x(e,!1,t)),i=r=e.position):e.position===e.lineStart&&v(e)?f(e,"unexpected end of the document within a double quoted scalar"):(e.position++,r=e.position)}f(e,"unexpected end of the stream within a double quoted scalar")}function k(e,t){var n,i,o,a,s,u,c,l,p,d,h,m=!0,y=e.tag,v=e.anchor;if(h=e.input.charCodeAt(e.position),91===h)a=93,c=!1,i=[];else{if(123!==h)return!1;a=125,c=!0,i={}}for(null!==e.anchor&&(e.anchorMap[e.anchor]=i),h=e.input.charCodeAt(++e.position);0!==h;){if(x(e,!0,t),h=e.input.charCodeAt(e.position),h===a)return e.position++,e.tag=y,e.anchor=v,e.kind=c?"mapping":"sequence",e.result=i,!0;m||f(e,"missed comma between flow collection entries"),p=l=d=null,s=u=!1,63===h&&(o=e.input.charCodeAt(e.position+1),r(o)&&(s=u=!0,e.position++,x(e,!0,t))),n=e.line,N(e,t,B,!1,!0),p=e.tag,l=e.result,x(e,!0,t),h=e.input.charCodeAt(e.position),!u&&e.line!==n||58!==h||(s=!0,h=e.input.charCodeAt(++e.position),x(e,!0,t),N(e,t,B,!1,!0),d=e.result),c?g(e,i,p,l,d):i.push(s?g(e,null,p,l,d):l),x(e,!0,t),h=e.input.charCodeAt(e.position),44===h?(m=!0,h=e.input.charCodeAt(++e.position)):m=!1}f(e,"unexpected end of the stream within a flow collection")}function j(e,t){var r,o,a,s,c=Z,l=!1,p=t,d=0,m=!1;if(s=e.input.charCodeAt(e.position),124===s)o=!1;else{if(62!==s)return!1;o=!0}for(e.kind="scalar",e.result="";0!==s;)if(s=e.input.charCodeAt(++e.position),43===s||45===s)Z===c?c=43===s?z:J:f(e,"repeat of a chomping mode identifier");else{if(!((a=u(s))>=0))break;0===a?f(e,"bad explicit indentation width of a block scalar; it cannot be less than one"):l?f(e,"repeat of an indentation width identifier"):(p=t+a-1,l=!0)}if(i(s)){do s=e.input.charCodeAt(++e.position);while(i(s));if(35===s)do s=e.input.charCodeAt(++e.position);while(!n(s)&&0!==s)}for(;0!==s;){for(y(e),e.lineIndent=0,s=e.input.charCodeAt(e.position);(!l||e.lineIndentp&&(p=e.lineIndent),n(s))d++;else{if(e.lineIndentt)&&0!==o)f(e,"bad indentation of a sequence entry");else if(e.lineIndentt)&&(N(e,t,W,!0,a)&&(y?h=e.result:m=e.result),y||(g(e,p,d,h,m),d=h=m=null),x(e,!0,-1),u=e.input.charCodeAt(e.position)),e.lineIndent>t&&0!==u)f(e,"bad indentation of a mapping entry");else if(e.lineIndentt?m=1:e.lineIndent===t?m=0:e.lineIndentt?m=1:e.lineIndent===t?m=0:e.lineIndentu;u+=1)if(l=e.implicitTypes[u],l.resolve(e.result)){e.result=l.construct(e.result),e.tag=l.tag,null!==e.anchor&&(e.anchorMap[e.anchor]=e.result);break}}else $.call(e.typeMap,e.tag)?(l=e.typeMap[e.tag],null!==e.result&&l.kind!==e.kind&&f(e,"unacceptable node kind for !<"+e.tag+'> tag; it should be "'+l.kind+'", not "'+e.kind+'"'),l.resolve(e.result)?(e.result=l.construct(e.result),null!==e.anchor&&(e.anchorMap[e.anchor]=e.result)):f(e,"cannot resolve a node with !<"+e.tag+"> explicit tag")):d(e,"unknown tag !<"+e.tag+">");return null!==e.tag||null!==e.anchor||y}function _(e){var t,o,a,s,u=e.position,c=!1;for(e.version=null,e.checkLineBreaks=e.legacy,e.tagMap={},e.anchorMap={};0!==(s=e.input.charCodeAt(e.position))&&(x(e,!0,-1),s=e.input.charCodeAt(e.position),!(e.lineIndent>0||37!==s));){for(c=!0,s=e.input.charCodeAt(++e.position),t=e.position;0!==s&&!r(s);)s=e.input.charCodeAt(++e.position);for(o=e.input.slice(t,e.position),a=[],o.length<1&&f(e,"directive name must not be less than one character in length");0!==s;){for(;i(s);)s=e.input.charCodeAt(++e.position);if(35===s){do s=e.input.charCodeAt(++e.position);while(0!==s&&!n(s));break}if(n(s))break;for(t=e.position;0!==s&&!r(s);)s=e.input.charCodeAt(++e.position);a.push(e.input.slice(t,e.position))}0!==s&&y(e),$.call(ot,o)?ot[o](e,o,a):d(e,'unknown document directive "'+o+'"')}return x(e,!0,-1),0===e.lineIndent&&45===e.input.charCodeAt(e.position)&&45===e.input.charCodeAt(e.position+1)&&45===e.input.charCodeAt(e.position+2)?(e.position+=3,x(e,!0,-1)):c&&f(e,"directives end mark is expected"),N(e,e.lineIndent-1,W,!1,!0),x(e,!0,-1),e.checkLineBreaks&&Q.test(e.input.slice(u,e.position))&&d(e,"non-ASCII line breaks are interpreted as content"),e.documents.push(e.result),e.position===e.lineStart&&v(e)?void(46===e.input.charCodeAt(e.position)&&(e.position+=3,x(e,!0,-1))):void(e.positioni;i+=1)t(o[i])}function L(e,t){var n=T(e,t);if(0===n.length)return void 0;if(1===n.length)return n[0];throw new q("expected a single document in the stream, but found more")}function D(e,t,n){M(e,t,Y.extend({schema:R},n))}function U(e,t){return L(e,Y.extend({schema:R},t))}for(var Y=e("./common"),q=e("./exception"),P=e("./mark"),R=e("./schema/default_safe"),H=e("./schema/default_full"),$=Object.prototype.hasOwnProperty,B=1,G=2,V=3,W=4,Z=1,J=2,z=3,K=/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uD800-\uDFFF\uFFFE\uFFFF]/,Q=/[\x85\u2028\u2029]/,X=/[,\[\]\{\}]/,et=/^(?:!|!!|![a-z\-]+!)$/i,tt=/^(?:!|[^,\[\]\{\}])(?:%[0-9a-f]{2}|[0-9a-z\-#;\/\?:@&=\+\$,_\.!~\*'\(\)\[\]])*$/i,nt=new Array(256),it=new Array(256),rt=0;256>rt;rt++)nt[rt]=c(rt)?1:0,it[rt]=c(rt);var ot={YAML:function(e,t,n){var i,r,o;null!==e.version&&f(e,"duplication of %YAML directive"),1!==n.length&&f(e,"YAML directive accepts exactly one argument"),i=/^([0-9]+)\.([0-9]+)$/.exec(n[0]),null===i&&f(e,"ill-formed argument of the YAML directive"),r=parseInt(i[1],10),o=parseInt(i[2],10),1!==r&&f(e,"unacceptable YAML version of the document"),e.version=n[0],e.checkLineBreaks=2>o,1!==o&&2!==o&&d(e,"unsupported YAML version of the document")},TAG:function(e,t,n){var i,r;2!==n.length&&f(e,"TAG directive accepts exactly two arguments"),i=n[0],r=n[1],et.test(i)||f(e,"ill-formed tag handle (first argument) of the TAG directive"),$.call(e.tagMap,i)&&f(e,'there is a previously declared suffix for "'+i+'" tag handle'),tt.test(r)||f(e,"ill-formed tag prefix (second argument) of the TAG directive"),e.tagMap[i]=r}};t.exports.loadAll=M,t.exports.load=L,t.exports.safeLoadAll=D,t.exports.safeLoad=U},{"./common":2,"./exception":4,"./mark":6,"./schema/default_full":9,"./schema/default_safe":10}],6:[function(e,t){"use strict";function n(e,t,n,i,r){this.name=e,this.buffer=t,this.position=n,this.line=i,this.column=r}var i=e("./common");n.prototype.getSnippet=function(e,t){var n,r,o,a,s;if(!this.buffer)return null;for(e=e||4,t=t||75,n="",r=this.position;r>0&&-1==="\x00\r\n…\u2028\u2029".indexOf(this.buffer.charAt(r-1));)if(r-=1,this.position-r>t/2-1){n=" ... ",r+=5;break}for(o="",a=this.position;at/2-1){o=" ... ",a-=5;break}return s=this.buffer.slice(r,a),i.repeat(" ",e)+n+s+o+"\n"+i.repeat(" ",e+this.position-r+n.length)+"^"},n.prototype.toString=function(e){var t,n="";return this.name&&(n+='in "'+this.name+'" '),n+="at line "+(this.line+1)+", column "+(this.column+1),e||(t=this.getSnippet(),t&&(n+=":\n"+t)),n},t.exports=n},{"./common":2}],7:[function(e,t){"use strict";function n(e,t,i){var r=[];return e.include.forEach(function(e){i=n(e,t,i)}),e[t].forEach(function(e){i.forEach(function(t,n){t.tag===e.tag&&r.push(n)}),i.push(e)}),i.filter(function(e,t){return-1===r.indexOf(t)})}function i(){function e(e){i[e.tag]=e}var t,n,i={};for(t=0,n=arguments.length;n>t;t+=1)arguments[t].forEach(e);return i}function r(e){this.include=e.include||[],this.implicit=e.implicit||[],this.explicit=e.explicit||[],this.implicit.forEach(function(e){if(e.loadKind&&"scalar"!==e.loadKind)throw new a("There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.")}),this.compiledImplicit=n(this,"implicit",[]),this.compiledExplicit=n(this,"explicit",[]),this.compiledTypeMap=i(this.compiledImplicit,this.compiledExplicit)}var o=e("./common"),a=e("./exception"),s=e("./type");r.DEFAULT=null,r.create=function(){var e,t;switch(arguments.length){case 1:e=r.DEFAULT,t=arguments[0];break;case 2:e=arguments[0],t=arguments[1];break;default:throw new a("Wrong number of arguments for Schema.create function")}if(e=o.toArray(e),t=o.toArray(t),!e.every(function(e){return e instanceof r}))throw new a("Specified list of super schemas (or a single Schema object) contains a non-Schema object.");if(!t.every(function(e){return e instanceof s}))throw new a("Specified list of YAML types (or a single Type object) contains a non-Type object.");return new r({include:e,explicit:t})},t.exports=r},{"./common":2,"./exception":4,"./type":13}],8:[function(e,t){"use strict";var n=e("../schema");t.exports=new n({include:[e("./json")]})},{"../schema":7,"./json":12}],9:[function(e,t){"use strict";var n=e("../schema");t.exports=n.DEFAULT=new n({include:[e("./default_safe")],explicit:[e("../type/js/undefined"),e("../type/js/regexp"),e("../type/js/function")]})},{"../schema":7,"../type/js/function":18,"../type/js/regexp":19,"../type/js/undefined":20,"./default_safe":10}],10:[function(e,t){"use strict";var n=e("../schema");t.exports=new n({include:[e("./core")],implicit:[e("../type/timestamp"),e("../type/merge")],explicit:[e("../type/binary"),e("../type/omap"),e("../type/pairs"),e("../type/set")]})},{"../schema":7,"../type/binary":14,"../type/merge":22,"../type/omap":24,"../type/pairs":25,"../type/set":27,"../type/timestamp":29,"./core":8}],11:[function(e,t){"use strict";var n=e("../schema");t.exports=new n({explicit:[e("../type/str"),e("../type/seq"),e("../type/map")]})},{"../schema":7,"../type/map":21,"../type/seq":26,"../type/str":28}],12:[function(e,t){"use strict";var n=e("../schema");t.exports=new n({include:[e("./failsafe")],implicit:[e("../type/null"),e("../type/bool"),e("../type/int"),e("../type/float")]})},{"../schema":7,"../type/bool":15,"../type/float":16,"../type/int":17,"../type/null":23,"./failsafe":11}],13:[function(e,t){"use strict";function n(e){var t={};return null!==e&&Object.keys(e).forEach(function(n){e[n].forEach(function(e){t[String(e)]=n})}),t}function i(e,t){if(t=t||{},Object.keys(t).forEach(function(t){if(-1===o.indexOf(t))throw new r('Unknown option "'+t+'" is met in definition of "'+e+'" YAML type.')}),this.tag=e,this.kind=t.kind||null,this.resolve=t.resolve||function(){return!0},this.construct=t.construct||function(e){return e},this.instanceOf=t.instanceOf||null,this.predicate=t.predicate||null,this.represent=t.represent||null,this.defaultStyle=t.defaultStyle||null,this.styleAliases=n(t.styleAliases||null),-1===a.indexOf(this.kind))throw new r('Unknown kind "'+this.kind+'" is specified for "'+e+'" YAML type.')}var r=e("./exception"),o=["kind","resolve","construct","instanceOf","predicate","represent","defaultStyle","styleAliases"],a=["scalar","sequence","mapping"];t.exports=i},{"./exception":4}],14:[function(e,t){"use strict";function n(e){if(null===e)return!1;var t,n,i=0,r=e.length,o=u;for(n=0;r>n;n++)if(t=o.indexOf(e.charAt(n)),!(t>64)){if(0>t)return!1;i+=6}return i%8===0}function i(e){var t,n,i=e.replace(/[\r\n=]/g,""),r=i.length,o=u,s=0,c=[];for(t=0;r>t;t++)t%4===0&&t&&(c.push(s>>16&255),c.push(s>>8&255),c.push(255&s)),s=s<<6|o.indexOf(i.charAt(t));return n=r%4*6,0===n?(c.push(s>>16&255),c.push(s>>8&255),c.push(255&s)):18===n?(c.push(s>>10&255),c.push(s>>2&255)):12===n&&c.push(s>>4&255),a?new a(c):c}function r(e){var t,n,i="",r=0,o=e.length,a=u;for(t=0;o>t;t++)t%3===0&&t&&(i+=a[r>>18&63],i+=a[r>>12&63],i+=a[r>>6&63],i+=a[63&r]),r=(r<<8)+e[t];return n=o%3,0===n?(i+=a[r>>18&63],i+=a[r>>12&63],i+=a[r>>6&63],i+=a[63&r]):2===n?(i+=a[r>>10&63],i+=a[r>>4&63],i+=a[r<<2&63],i+=a[64]):1===n&&(i+=a[r>>2&63],i+=a[r<<4&63],i+=a[64],i+=a[64]),i}function o(e){return a&&a.isBuffer(e)}var a=e("buffer").Buffer,s=e("../type"),u="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=\n\r";t.exports=new s("tag:yaml.org,2002:binary",{kind:"scalar",resolve:n,construct:i,predicate:o,represent:r})},{"../type":13,buffer:30}],15:[function(e,t){"use strict";function n(e){if(null===e)return!1;var t=e.length;return 4===t&&("true"===e||"True"===e||"TRUE"===e)||5===t&&("false"===e||"False"===e||"FALSE"===e)}function i(e){return"true"===e||"True"===e||"TRUE"===e}function r(e){return"[object Boolean]"===Object.prototype.toString.call(e)}var o=e("../type");t.exports=new o("tag:yaml.org,2002:bool",{kind:"scalar",resolve:n,construct:i,predicate:r,represent:{lowercase:function(e){return e?"true":"false"},uppercase:function(e){return e?"TRUE":"FALSE"},camelcase:function(e){return e?"True":"False"}},defaultStyle:"lowercase"})},{"../type":13}],16:[function(e,t){"use strict";function n(e){if(null===e)return!1;return u.test(e)?!0:!1}function i(e){var t,n,i,r;return t=e.replace(/_/g,"").toLowerCase(),n="-"===t[0]?-1:1,r=[],0<="+-".indexOf(t[0])&&(t=t.slice(1)),".inf"===t?1===n?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY:".nan"===t?0/0:0<=t.indexOf(":")?(t.split(":").forEach(function(e){r.unshift(parseFloat(e,10))}),t=0,i=1,r.forEach(function(e){t+=e*i,i*=60}),n*t):n*parseFloat(t,10)}function r(e,t){if(isNaN(e))switch(t){case"lowercase":return".nan";case"uppercase":return".NAN";case"camelcase":return".NaN"}else if(Number.POSITIVE_INFINITY===e)switch(t){case"lowercase":return".inf";case"uppercase":return".INF";case"camelcase":return".Inf"}else{if(Number.NEGATIVE_INFINITY!==e)return a.isNegativeZero(e)?"-0.0":e.toString(10);switch(t){case"lowercase":return"-.inf";case"uppercase":return"-.INF";case"camelcase":return"-.Inf"}}}function o(e){return"[object Number]"===Object.prototype.toString.call(e)&&(0!==e%1||a.isNegativeZero(e))}var a=e("../common"),s=e("../type"),u=new RegExp("^(?:[-+]?(?:[0-9][0-9_]*)\\.[0-9_]*(?:[eE][-+][0-9]+)?|\\.[0-9_]+(?:[eE][-+][0-9]+)?|[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\\.[0-9_]*|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");t.exports=new s("tag:yaml.org,2002:float",{kind:"scalar",resolve:n,construct:i,predicate:o,represent:r,defaultStyle:"lowercase"})},{"../common":2,"../type":13}],17:[function(e,t){"use strict";function n(e){return e>=48&&57>=e||e>=65&&70>=e||e>=97&&102>=e}function i(e){return e>=48&&55>=e}function r(e){return e>=48&&57>=e}function o(e){if(null===e)return!1;var t,o=e.length,a=0,s=!1;if(!o)return!1;if(t=e[a],("-"===t||"+"===t)&&(t=e[++a]),"0"===t){if(a+1===o)return!0;if(t=e[++a],"b"===t){for(a++;o>a;a++)if(t=e[a],"_"!==t){if("0"!==t&&"1"!==t)return!1;s=!0}return s}if("x"===t){for(a++;o>a;a++)if(t=e[a],"_"!==t){if(!n(e.charCodeAt(a)))return!1;s=!0}return s}for(;o>a;a++)if(t=e[a],"_"!==t){if(!i(e.charCodeAt(a)))return!1; +s=!0}return s}for(;o>a;a++)if(t=e[a],"_"!==t){if(":"===t)break;if(!r(e.charCodeAt(a)))return!1;s=!0}return s?":"!==t?!0:/^(:[0-5]?[0-9])+$/.test(e.slice(a)):!1}function a(e){var t,n,i=e,r=1,o=[];return-1!==i.indexOf("_")&&(i=i.replace(/_/g,"")),t=i[0],("-"===t||"+"===t)&&("-"===t&&(r=-1),i=i.slice(1),t=i[0]),"0"===i?0:"0"===t?"b"===i[1]?r*parseInt(i.slice(2),2):"x"===i[1]?r*parseInt(i,16):r*parseInt(i,8):-1!==i.indexOf(":")?(i.split(":").forEach(function(e){o.unshift(parseInt(e,10))}),i=0,n=1,o.forEach(function(e){i+=e*n,n*=60}),r*i):r*parseInt(i,10)}function s(e){return"[object Number]"===Object.prototype.toString.call(e)&&0===e%1&&!u.isNegativeZero(e)}var u=e("../common"),c=e("../type");t.exports=new c("tag:yaml.org,2002:int",{kind:"scalar",resolve:o,construct:a,predicate:s,represent:{binary:function(e){return"0b"+e.toString(2)},octal:function(e){return"0"+e.toString(8)},decimal:function(e){return e.toString(10)},hexadecimal:function(e){return"0x"+e.toString(16).toUpperCase()}},defaultStyle:"decimal",styleAliases:{binary:[2,"bin"],octal:[8,"oct"],decimal:[10,"dec"],hexadecimal:[16,"hex"]}})},{"../common":2,"../type":13}],18:[function(e,t){"use strict";function n(e){if(null===e)return!1;try{var t="("+e+")",n=a.parse(t,{range:!0});return"Program"!==n.type||1!==n.body.length||"ExpressionStatement"!==n.body[0].type||"FunctionExpression"!==n.body[0].expression.type?!1:!0}catch(i){return!1}}function i(e){var t,n="("+e+")",i=a.parse(n,{range:!0}),r=[];if("Program"!==i.type||1!==i.body.length||"ExpressionStatement"!==i.body[0].type||"FunctionExpression"!==i.body[0].expression.type)throw new Error("Failed to resolve function");return i.body[0].expression.params.forEach(function(e){r.push(e.name)}),t=i.body[0].expression.body.range,new Function(r,n.slice(t[0]+1,t[1]-1))}function r(e){return e.toString()}function o(e){return"[object Function]"===Object.prototype.toString.call(e)}var a;try{a=e("esprima")}catch(s){"undefined"!=typeof window&&(a=window.esprima)}var u=e("../../type");t.exports=new u("tag:yaml.org,2002:js/function",{kind:"scalar",resolve:n,construct:i,predicate:o,represent:r})},{"../../type":13,esprima:"esprima"}],19:[function(e,t){"use strict";function n(e){if(null===e)return!1;if(0===e.length)return!1;var t=e,n=/\/([gim]*)$/.exec(e),i="";if("/"===t[0]){if(n&&(i=n[1]),i.length>3)return!1;if("/"!==t[t.length-i.length-1])return!1;t=t.slice(1,t.length-i.length-1)}try{{new RegExp(t,i)}return!0}catch(r){return!1}}function i(e){var t=e,n=/\/([gim]*)$/.exec(e),i="";return"/"===t[0]&&(n&&(i=n[1]),t=t.slice(1,t.length-i.length-1)),new RegExp(t,i)}function r(e){var t="/"+e.source+"/";return e.global&&(t+="g"),e.multiline&&(t+="m"),e.ignoreCase&&(t+="i"),t}function o(e){return"[object RegExp]"===Object.prototype.toString.call(e)}var a=e("../../type");t.exports=new a("tag:yaml.org,2002:js/regexp",{kind:"scalar",resolve:n,construct:i,predicate:o,represent:r})},{"../../type":13}],20:[function(e,t){"use strict";function n(){return!0}function i(){return void 0}function r(){return""}function o(e){return"undefined"==typeof e}var a=e("../../type");t.exports=new a("tag:yaml.org,2002:js/undefined",{kind:"scalar",resolve:n,construct:i,predicate:o,represent:r})},{"../../type":13}],21:[function(e,t){"use strict";var n=e("../type");t.exports=new n("tag:yaml.org,2002:map",{kind:"mapping",construct:function(e){return null!==e?e:{}}})},{"../type":13}],22:[function(e,t){"use strict";function n(e){return"<<"===e||null===e}var i=e("../type");t.exports=new i("tag:yaml.org,2002:merge",{kind:"scalar",resolve:n})},{"../type":13}],23:[function(e,t){"use strict";function n(e){if(null===e)return!0;var t=e.length;return 1===t&&"~"===e||4===t&&("null"===e||"Null"===e||"NULL"===e)}function i(){return null}function r(e){return null===e}var o=e("../type");t.exports=new o("tag:yaml.org,2002:null",{kind:"scalar",resolve:n,construct:i,predicate:r,represent:{canonical:function(){return"~"},lowercase:function(){return"null"},uppercase:function(){return"NULL"},camelcase:function(){return"Null"}},defaultStyle:"lowercase"})},{"../type":13}],24:[function(e,t){"use strict";function n(e){if(null===e)return!0;var t,n,i,r,s,u=[],c=e;for(t=0,n=c.length;n>t;t+=1){if(i=c[t],s=!1,"[object Object]"!==a.call(i))return!1;for(r in i)if(o.call(i,r)){if(s)return!1;s=!0}if(!s)return!1;if(-1!==u.indexOf(r))return!1;u.push(r)}return!0}function i(e){return null!==e?e:[]}var r=e("../type"),o=Object.prototype.hasOwnProperty,a=Object.prototype.toString;t.exports=new r("tag:yaml.org,2002:omap",{kind:"sequence",resolve:n,construct:i})},{"../type":13}],25:[function(e,t){"use strict";function n(e){if(null===e)return!0;var t,n,i,r,a,s=e;for(a=new Array(s.length),t=0,n=s.length;n>t;t+=1){if(i=s[t],"[object Object]"!==o.call(i))return!1;if(r=Object.keys(i),1!==r.length)return!1;a[t]=[r[0],i[r[0]]]}return!0}function i(e){if(null===e)return[];var t,n,i,r,o,a=e;for(o=new Array(a.length),t=0,n=a.length;n>t;t+=1)i=a[t],r=Object.keys(i),o[t]=[r[0],i[r[0]]];return o}var r=e("../type"),o=Object.prototype.toString;t.exports=new r("tag:yaml.org,2002:pairs",{kind:"sequence",resolve:n,construct:i})},{"../type":13}],26:[function(e,t){"use strict";var n=e("../type");t.exports=new n("tag:yaml.org,2002:seq",{kind:"sequence",construct:function(e){return null!==e?e:[]}})},{"../type":13}],27:[function(e,t){"use strict";function n(e){if(null===e)return!0;var t,n=e;for(t in n)if(o.call(n,t)&&null!==n[t])return!1;return!0}function i(e){return null!==e?e:{}}var r=e("../type"),o=Object.prototype.hasOwnProperty;t.exports=new r("tag:yaml.org,2002:set",{kind:"mapping",resolve:n,construct:i})},{"../type":13}],28:[function(e,t){"use strict";var n=e("../type");t.exports=new n("tag:yaml.org,2002:str",{kind:"scalar",construct:function(e){return null!==e?e:""}})},{"../type":13}],29:[function(e,t){"use strict";function n(e){if(null===e)return!1;var t;return t=a.exec(e),null===t?!1:!0}function i(e){var t,n,i,r,o,s,u,c,l,p,f=0,d=null;if(t=a.exec(e),null===t)throw new Error("Date resolve error");if(n=+t[1],i=+t[2]-1,r=+t[3],!t[4])return new Date(Date.UTC(n,i,r));if(o=+t[4],s=+t[5],u=+t[6],t[7]){for(f=t[7].slice(0,3);f.length<3;)f+="0";f=+f}return t[9]&&(c=+t[10],l=+(t[11]||0),d=6e4*(60*c+l),"-"===t[9]&&(d=-d)),p=new Date(Date.UTC(n,i,r,o,s,u,f)),d&&p.setTime(p.getTime()-d),p}function r(e){return e.toISOString()}var o=e("../type"),a=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9]?)-([0-9][0-9]?)(?:(?:[Tt]|[ \\t]+)([0-9][0-9]?):([0-9][0-9]):([0-9][0-9])(?:\\.([0-9]*))?(?:[ \\t]*(Z|([-+])([0-9][0-9]?)(?::([0-9][0-9]))?))?)?$");t.exports=new o("tag:yaml.org,2002:timestamp",{kind:"scalar",resolve:n,construct:i,instanceOf:Date,represent:r})},{"../type":13}],30:[function(){},{}],"/":[function(e,t){"use strict";var n=e("./lib/js-yaml.js");t.exports=n},{"./lib/js-yaml.js":1}]},{},[])("/")}); \ No newline at end of file diff --git a/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/js-yaml/lib/js-yaml/loader.js b/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/js-yaml/lib/js-yaml/loader.js index 81aa89b..7e924a8 100644 --- a/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/js-yaml/lib/js-yaml/loader.js +++ b/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/js-yaml/lib/js-yaml/loader.js @@ -337,15 +337,15 @@ function skipSeparationSpace(state, allowComments, checkIndent) { state.lineIndent++; ch = state.input.charCodeAt(++state.position); } - - if (state.lineIndent < checkIndent) { - throwWarning(state, 'deficient indentation'); - } } else { break; } } + if (-1 !== checkIndent && 0 !== lineBreaks && state.lineIndent < checkIndent) { + throwWarning(state, 'deficient indentation'); + } + return lineBreaks; } @@ -1241,8 +1241,8 @@ function composeNode(state, parentIndent, nodeContext, allowToSeek, allowCompact var allowBlockStyles, allowBlockScalars, allowBlockCollections, + indentStatus = 1, // 1: this>parent, 0: this=parent, -1: this parentIndent) { - isIndented = true; - - } else { - return false; + if (state.lineIndent > parentIndent) { + indentStatus = 1; + } else if (state.lineIndent === parentIndent) { + indentStatus = 0; + } else if (state.lineIndent < parentIndent) { + indentStatus = -1; } } } - if (isIndented) { + if (1 === indentStatus) { while (readTagProperty(state) || readAnchorProperty(state)) { if (skipSeparationSpace(state, true, -1)) { atNewLine = true; + allowBlockCollections = allowBlockStyles; if (state.lineIndent > parentIndent) { - isIndented = true; - allowBlockCollections = allowBlockStyles; - + indentStatus = 1; } else if (state.lineIndent === parentIndent) { - isIndented = false; - allowBlockCollections = allowBlockStyles; - - } else { - return true; + indentStatus = 0; + } else if (state.lineIndent < parentIndent) { + indentStatus = -1; } } else { allowBlockCollections = false; @@ -1302,7 +1297,7 @@ function composeNode(state, parentIndent, nodeContext, allowToSeek, allowCompact allowBlockCollections = atNewLine || allowCompact; } - if (isIndented || CONTEXT_BLOCK_OUT === nodeContext) { + if (1 === indentStatus || CONTEXT_BLOCK_OUT === nodeContext) { if (CONTEXT_FLOW_IN === nodeContext || CONTEXT_FLOW_OUT === nodeContext) { flowIndent = parentIndent; } else { @@ -1311,7 +1306,7 @@ function composeNode(state, parentIndent, nodeContext, allowToSeek, allowCompact blockIndent = state.position - state.lineStart; - if (isIndented) { + if (1 === indentStatus) { if (allowBlockCollections && (readBlockSequence(state, blockIndent) || readBlockMapping(state, blockIndent, flowIndent)) || @@ -1342,7 +1337,9 @@ function composeNode(state, parentIndent, nodeContext, allowToSeek, allowCompact state.anchorMap[state.anchor] = state.result; } } - } else { + } else if (0 === indentStatus) { + // Special case: block sequences are allowed to have same indentation level as the parent. + // http://www.yaml.org/spec/1.2/spec.html#id2799784 hasContent = allowBlockCollections && readBlockSequence(state, blockIndent); } } diff --git a/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/js-yaml/lib/js-yaml/type/binary.js b/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/js-yaml/lib/js-yaml/type/binary.js index e52599c..1fdf47d 100644 --- a/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/js-yaml/lib/js-yaml/type/binary.js +++ b/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/js-yaml/lib/js-yaml/type/binary.js @@ -12,6 +12,10 @@ var BASE64_MAP = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789 function resolveYamlBinary(data) { + if (null === data) { + return false; + } + var code, idx, bitlen = 0, len = 0, max = data.length, map = BASE64_MAP; // Convert one by one. diff --git a/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/js-yaml/lib/js-yaml/type/bool.js b/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/js-yaml/lib/js-yaml/type/bool.js index 364626f..5c2a304 100644 --- a/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/js-yaml/lib/js-yaml/type/bool.js +++ b/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/js-yaml/lib/js-yaml/type/bool.js @@ -3,6 +3,10 @@ var Type = require('../type'); function resolveYamlBoolean(data) { + if (null === data) { + return false; + } + var max = data.length; return (max === 4 && (data === 'true' || data === 'True' || data === 'TRUE')) || diff --git a/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/js-yaml/lib/js-yaml/type/float.js b/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/js-yaml/lib/js-yaml/type/float.js index efb1331..9e3eff4 100644 --- a/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/js-yaml/lib/js-yaml/type/float.js +++ b/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/js-yaml/lib/js-yaml/type/float.js @@ -11,6 +11,10 @@ var YAML_FLOAT_PATTERN = new RegExp( '|\\.(?:nan|NaN|NAN))$'); function resolveYamlFloat(data) { + if (null === data) { + return false; + } + var value, sign, base, digits; if (!YAML_FLOAT_PATTERN.test(data)) { diff --git a/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/js-yaml/lib/js-yaml/type/int.js b/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/js-yaml/lib/js-yaml/type/int.js index 4dfdd6d..efada88 100644 --- a/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/js-yaml/lib/js-yaml/type/int.js +++ b/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/js-yaml/lib/js-yaml/type/int.js @@ -18,6 +18,10 @@ function isDecCode(c) { } function resolveYamlInteger(data) { + if (null === data) { + return false; + } + var max = data.length, index = 0, hasDigits = false, diff --git a/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/js-yaml/lib/js-yaml/type/js/function.js b/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/js-yaml/lib/js-yaml/type/js/function.js index 39b9dd2..05eface 100644 --- a/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/js-yaml/lib/js-yaml/type/js/function.js +++ b/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/js-yaml/lib/js-yaml/type/js/function.js @@ -19,6 +19,10 @@ try { var Type = require('../../type'); function resolveJavascriptFunction(data) { + if (null === data) { + return false; + } + try { var source = '(' + data + ')', ast = esprima.parse(source, { range: true }), diff --git a/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/js-yaml/lib/js-yaml/type/js/regexp.js b/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/js-yaml/lib/js-yaml/type/js/regexp.js index fd36173..07ef521 100644 --- a/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/js-yaml/lib/js-yaml/type/js/regexp.js +++ b/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/js-yaml/lib/js-yaml/type/js/regexp.js @@ -3,6 +3,14 @@ var Type = require('../../type'); function resolveJavascriptRegExp(data) { + if (null === data) { + return false; + } + + if (0 === data.length) { + return false; + } + var regexp = data, tail = /\/([gim]*)$/.exec(data), modifiers = ''; diff --git a/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/js-yaml/lib/js-yaml/type/map.js b/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/js-yaml/lib/js-yaml/type/map.js index e0c8fdc..dab9838 100644 --- a/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/js-yaml/lib/js-yaml/type/map.js +++ b/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/js-yaml/lib/js-yaml/type/map.js @@ -3,5 +3,6 @@ var Type = require('../type'); module.exports = new Type('tag:yaml.org,2002:map', { - kind: 'mapping' + kind: 'mapping', + construct: function (data) { return null !== data ? data : {}; } }); diff --git a/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/js-yaml/lib/js-yaml/type/merge.js b/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/js-yaml/lib/js-yaml/type/merge.js index e6fb8a2..29fa382 100644 --- a/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/js-yaml/lib/js-yaml/type/merge.js +++ b/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/js-yaml/lib/js-yaml/type/merge.js @@ -3,10 +3,10 @@ var Type = require('../type'); function resolveYamlMerge(data) { - return '<<' === data; + return '<<' === data || null === data; } module.exports = new Type('tag:yaml.org,2002:merge', { kind: 'scalar', - resolve: resolveYamlMerge, + resolve: resolveYamlMerge }); diff --git a/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/js-yaml/lib/js-yaml/type/null.js b/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/js-yaml/lib/js-yaml/type/null.js index d0c0a63..3474055 100644 --- a/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/js-yaml/lib/js-yaml/type/null.js +++ b/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/js-yaml/lib/js-yaml/type/null.js @@ -3,6 +3,10 @@ var Type = require('../type'); function resolveYamlNull(data) { + if (null === data) { + return true; + } + var max = data.length; return (max === 1 && data === '~') || diff --git a/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/js-yaml/lib/js-yaml/type/omap.js b/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/js-yaml/lib/js-yaml/type/omap.js index 9a7f9d8..f956459 100644 --- a/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/js-yaml/lib/js-yaml/type/omap.js +++ b/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/js-yaml/lib/js-yaml/type/omap.js @@ -6,6 +6,10 @@ var _hasOwnProperty = Object.prototype.hasOwnProperty; var _toString = Object.prototype.toString; function resolveYamlOmap(data) { + if (null === data) { + return true; + } + var objectKeys = [], index, length, pair, pairKey, pairHasKey, object = data; @@ -41,7 +45,12 @@ function resolveYamlOmap(data) { return true; } +function constructYamlOmap(data) { + return null !== data ? data : []; +} + module.exports = new Type('tag:yaml.org,2002:omap', { kind: 'sequence', - resolve: resolveYamlOmap + resolve: resolveYamlOmap, + construct: constructYamlOmap }); diff --git a/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/js-yaml/lib/js-yaml/type/pairs.js b/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/js-yaml/lib/js-yaml/type/pairs.js index a019ea9..02a0af6 100644 --- a/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/js-yaml/lib/js-yaml/type/pairs.js +++ b/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/js-yaml/lib/js-yaml/type/pairs.js @@ -5,6 +5,10 @@ var Type = require('../type'); var _toString = Object.prototype.toString; function resolveYamlPairs(data) { + if (null === data) { + return true; + } + var index, length, pair, keys, result, object = data; @@ -30,6 +34,10 @@ function resolveYamlPairs(data) { } function constructYamlPairs(data) { + if (null === data) { + return []; + } + var index, length, pair, keys, result, object = data; diff --git a/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/js-yaml/lib/js-yaml/type/seq.js b/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/js-yaml/lib/js-yaml/type/seq.js index ec706c0..5b860a2 100644 --- a/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/js-yaml/lib/js-yaml/type/seq.js +++ b/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/js-yaml/lib/js-yaml/type/seq.js @@ -3,5 +3,6 @@ var Type = require('../type'); module.exports = new Type('tag:yaml.org,2002:seq', { - kind: 'sequence' + kind: 'sequence', + construct: function (data) { return null !== data ? data : []; } }); diff --git a/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/js-yaml/lib/js-yaml/type/set.js b/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/js-yaml/lib/js-yaml/type/set.js index f4ec165..64d29e9 100644 --- a/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/js-yaml/lib/js-yaml/type/set.js +++ b/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/js-yaml/lib/js-yaml/type/set.js @@ -5,6 +5,10 @@ var Type = require('../type'); var _hasOwnProperty = Object.prototype.hasOwnProperty; function resolveYamlSet(data) { + if (null === data) { + return true; + } + var key, object = data; for (key in object) { @@ -18,7 +22,12 @@ function resolveYamlSet(data) { return true; } +function constructYamlSet(data) { + return null !== data ? data : {}; +} + module.exports = new Type('tag:yaml.org,2002:set', { kind: 'mapping', - resolve: resolveYamlSet + resolve: resolveYamlSet, + construct: constructYamlSet }); diff --git a/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/js-yaml/lib/js-yaml/type/str.js b/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/js-yaml/lib/js-yaml/type/str.js index 88189bb..8b5284f 100644 --- a/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/js-yaml/lib/js-yaml/type/str.js +++ b/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/js-yaml/lib/js-yaml/type/str.js @@ -3,5 +3,6 @@ var Type = require('../type'); module.exports = new Type('tag:yaml.org,2002:str', { - kind: 'scalar' + kind: 'scalar', + construct: function (data) { return null !== data ? data : ''; } }); diff --git a/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/js-yaml/lib/js-yaml/type/timestamp.js b/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/js-yaml/lib/js-yaml/type/timestamp.js index ef7f6bb..dc8cf15 100644 --- a/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/js-yaml/lib/js-yaml/type/timestamp.js +++ b/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/js-yaml/lib/js-yaml/type/timestamp.js @@ -15,6 +15,10 @@ var YAML_TIMESTAMP_REGEXP = new RegExp( '(?::([0-9][0-9]))?))?)?$'); // [11] tz_minute function resolveYamlTimestamp(data) { + if (null === data) { + return false; + } + var match, year, month, day, hour, minute, second, fraction = 0, delta = null, tz_hour, tz_minute, date; diff --git a/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/js-yaml/node_modules/argparse/HISTORY.md b/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/js-yaml/node_modules/argparse/HISTORY.md index 102f82b..bb97617 100644 --- a/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/js-yaml/node_modules/argparse/HISTORY.md +++ b/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/js-yaml/node_modules/argparse/HISTORY.md @@ -1,3 +1,9 @@ +0.1.16 / 2013-12-01 +------------------- + +* Maintenance release. Updated dependencies and docs. + + 0.1.15 / 2013-05-13 ------------------- diff --git a/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/js-yaml/node_modules/argparse/README.md b/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/js-yaml/node_modules/argparse/README.md index f20e0c1..b7e8473 100644 --- a/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/js-yaml/node_modules/argparse/README.md +++ b/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/js-yaml/node_modules/argparse/README.md @@ -80,12 +80,12 @@ Creates a new ArgumentParser object. - ```description``` - Text to display before the argument help. - ```epilog``` - Text to display after the argument help. -- ```addHelp``` - Add a -h/–help option to the parser. (default: True) -- ```argumentDefault``` - Set the global default value for arguments. (default: None) +- ```addHelp``` - Add a -h/–help option to the parser. (default: true) +- ```argumentDefault``` - Set the global default value for arguments. (default: null) - ```parents``` - A list of ArgumentParser objects whose arguments should also be included. - ```prefixChars``` - The set of characters that prefix optional arguments. (default: ‘-‘) - ```formatterClass``` - A class for customizing the help output. -- ```prog``` - The name of the program (default: sys.argv[0]) +- ```prog``` - The name of the program (default: `path.basename(process.argv[1])`) - ```usage``` - The string describing the program usage (default: generated) - ```conflictHandler``` - Usually unnecessary, defines strategy for resolving conflicting optionals. diff --git a/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/js-yaml/node_modules/argparse/lib/argument_parser.js b/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/js-yaml/node_modules/argparse/lib/argument_parser.js index 97cf098..103c337 100644 --- a/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/js-yaml/node_modules/argparse/lib/argument_parser.js +++ b/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/js-yaml/node_modules/argparse/lib/argument_parser.js @@ -33,7 +33,7 @@ var Namespace = require('./namespace'); * Create a new ArgumentParser object. * * ##### Options: - * - `prog` The name of the program (default: sys.argv[0]) + * - `prog` The name of the program (default: Path.basename(process.argv[1])) * - `usage` A usage message (default: auto-generated from arguments) * - `description` A description of what the program does * - `epilog` Text following the argument descriptions @@ -311,13 +311,15 @@ ArgumentParser.prototype._parseKnownArgs = function (argStrings, namespace) { // of two different mutually exclusive groups. function actionHash(action) { - // some sort of hashable key for this action - // action itself cannot be a key in actionConflicts - // I think getName() (join of optionStrings) is unique enough - return action.getName(); - } + // some sort of hashable key for this action + // action itself cannot be a key in actionConflicts + // I think getName() (join of optionStrings) is unique enough + return action.getName(); + } + var conflicts, key; var actionConflicts = {}; + this._mutuallyExclusiveGroups.forEach(function (mutexGroup) { mutexGroup._groupActions.forEach(function (mutexAction, i, groupActions) { key = actionHash(mutexAction); @@ -513,11 +515,10 @@ ArgumentParser.prototype._parseKnownArgs = function (argStrings, namespace) { var position; var maxOptionStringIndex = -1; - if (!!optionStringIndices) { - for (position in optionStringIndices) { - maxOptionStringIndex = Math.max(maxOptionStringIndex, parseInt(position, 10)); - } - } + + Object.keys(optionStringIndices).forEach(function (position) { + maxOptionStringIndex = Math.max(maxOptionStringIndex, parseInt(position, 10)); + }); var positionalsEndIndex, nextOptionStringIndex; @@ -525,6 +526,8 @@ ArgumentParser.prototype._parseKnownArgs = function (argStrings, namespace) { // consume any Positionals preceding the next option nextOptionStringIndex = null; for (position in optionStringIndices) { + if (!optionStringIndices.hasOwnProperty(position)) { continue; } + position = parseInt(position, 10); if (position >= startIndex) { if (nextOptionStringIndex !== null) { @@ -688,10 +691,10 @@ ArgumentParser.prototype._matchArgumentsPartial = function (actions, regexpArgSt return string.length; }; - for (i = actions.length; i > 0; i -= 1) { + for (i = actions.length; i > 0; i--) { pattern = ''; actionSlice = actions.slice(0, i); - for (j in actionSlice) { + for (j = 0; j < actionSlice.length; j++) { pattern += self._getNargsPattern(actionSlice[j]); } diff --git a/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/js-yaml/node_modules/argparse/lib/help/formatter.js b/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/js-yaml/node_modules/argparse/lib/help/formatter.js index 541d918..89319b9 100644 --- a/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/js-yaml/node_modules/argparse/lib/help/formatter.js +++ b/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/js-yaml/node_modules/argparse/lib/help/formatter.js @@ -722,20 +722,15 @@ HelpFormatter.prototype._formatArgs = function (action, metavarDefault) { }; HelpFormatter.prototype._expandHelp = function (action) { - var actionProperty; - var actionValue; + var params = { prog: this._prog }; - var params = {prog: this._prog}; + Object.keys(action).forEach(function (actionProperty) { + var actionValue = action[actionProperty]; - for (actionProperty in action) { - if (action.hasOwnProperty(actionProperty)) { - actionValue = action[actionProperty]; - - if (actionValue !== $$.SUPPRESS) { - params[actionProperty] = actionValue; - } + if (actionValue !== $$.SUPPRESS) { + params[actionProperty] = actionValue; } - } + }); if (!!params.choices) { if (_.isString(params.choices)) { diff --git a/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/.npmignore b/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/.npmignore new file mode 100644 index 0000000..0fc18a4 --- /dev/null +++ b/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/.npmignore @@ -0,0 +1,2 @@ +test +dist diff --git a/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/.travis.yml b/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/.travis.yml index ab27b29..b4ae6a7 100644 --- a/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/.travis.yml +++ b/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/.travis.yml @@ -1,8 +1,8 @@ -language: ruby -rvm: - - 1.9.3 +language: node_js +node_js: + - "0.11" before_script: - "export DISPLAY=:99.0" - "sh -e /etc/init.d/xvfb start" - - sleep 2 \ No newline at end of file + - sleep 2 diff --git a/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/Gemfile b/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/Gemfile deleted file mode 100644 index aed29c3..0000000 --- a/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/Gemfile +++ /dev/null @@ -1,4 +0,0 @@ -source "https://rubygems.org" - -gem 'uglifier' -gem 'rake' diff --git a/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/Gemfile.lock b/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/Gemfile.lock deleted file mode 100644 index 2c52be4..0000000 --- a/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/Gemfile.lock +++ /dev/null @@ -1,17 +0,0 @@ -GEM - remote: https://rubygems.org/ - specs: - execjs (1.4.0) - multi_json (~> 1.0) - multi_json (1.3.6) - rake (0.9.2.2) - uglifier (1.3.0) - execjs (>= 0.3.0) - multi_json (~> 1.0, >= 1.0.2) - -PLATFORMS - ruby - -DEPENDENCIES - rake - uglifier diff --git a/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/README.markdown b/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/README.markdown index 1a39ad9..4e58be4 100644 --- a/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/README.markdown +++ b/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/README.markdown @@ -9,11 +9,11 @@ for example from [Dive Into JavaScript][d]. [d]: http://www.diveintojavascript.com/core-javascript-reference/the-string-object -As name states this an extension for [Underscore.js][u], but it can be used +As name states this an extension for [Underscore.js][u] (and [Lo-Dash](http://lodash.com/)), but it can be used independently from **_s**-global variable. But with Underscore.js you can use Object-Oriented style and chaining: -[u]: http://documentcloud.github.com/underscore/ +[u]: http://underscorejs.org/ ```javascript _(" epeli ").chain().trim().capitalize().value() @@ -291,16 +291,19 @@ _('my name is epeli').titleize() **camelize** _.camelize(string) -Converts underscored or dasherized string to a camelized one +Converts underscored or dasherized string to a camelized one. Begins with +a lower case letter unless it starts with an underscore or string ```javascript +_('moz-transform').camelize() +=> 'mozTransform' _('-moz-transform').camelize() => 'MozTransform' ``` **classify** _.classify(string) -Converts string to camelized class name +Converts string to camelized class name. First letter is always upper case ```javascript _('some_class_name').classify() @@ -415,7 +418,7 @@ C like string formatting. Credits goes to [Alexandru Marasteanu][o]. For more detailed documentation, see the [original page][o]. -[o]: http://www.diveintojavascript.com/projects/sprintf-for-javascript +[o]: http://www.diveintojavascript.com/projects/javascript-sprintf ```javascript _.sprintf("%.1f", 1.17) @@ -680,12 +683,20 @@ _ = _.string ## Changelog ## +### 2.4.0 ### + +* Move from rake to gulp +* Add support form classify camelcase strings +* Fix bower.json +* [Full changelog](https://github.com/epeli/underscore.string/compare/v2.3.3...2.4.0) + ### 2.3.3 ### * Add `toBoolean` * Add `unquote` * Add quote char option to `quote` * Support dash-separated words in `titleize` +* [Full changelog](https://github.com/epeli/underscore.string/compare/v2.3.2...2.3.3) ### 2.3.2 ### diff --git a/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/Rakefile b/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/Rakefile deleted file mode 100644 index 2cd9eed..0000000 --- a/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/Rakefile +++ /dev/null @@ -1,23 +0,0 @@ -# encoding: utf-8 -task default: :test - -desc 'Use UglifyJS to compress Underscore.string' -task :build do - require 'uglifier' - source = File.read('lib/underscore.string.js', :encoding => 'utf-8') - compressed = Uglifier.compile(source, copyright: false) - File.open('dist/underscore.string.min.js', 'w'){ |f| f.write compressed } - compression_rate = compressed.length.to_f/source.length - puts "compressed dist/underscore.string.min.js: #{compressed.length}/#{source.length} #{(compression_rate * 100).round}%" -end - -desc 'Run tests' -task :test do - puts "Running underscore.string test suite." - result1 = system %{phantomjs ./test/run-qunit.js "test/test.html"} - - puts "Running Underscore test suite." - result2 = system %{phantomjs ./test/run-qunit.js "test/test_underscore/index.html"} - - exit(result1 && result2 ? 0 : 1) -end diff --git a/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/bower.json b/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/bower.json new file mode 100644 index 0000000..6aef0bd --- /dev/null +++ b/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/bower.json @@ -0,0 +1,33 @@ +{ + "name": "underscore.string", + "version": "2.4.0", + "description": "String manipulation extensions for Underscore.js javascript library.", + "homepage": "http://epeli.github.com/underscore.string/", + "contributors": [ + "Esa-Matti Suuronen (http://esa-matti.suuronen.org/)", + "Edward Tsech ", + "Pavel Pravosud ()", + "Sasha Koss (http://koss.nocorp.me/)", + "Vladimir Dronnikov ", + "Pete Kruckenberg ()", + "Paul Chavard ()", + "Ed Finkler ()" + ], + "keywords": [ + "underscore", + "string" + ], + "main": "./lib/underscore.string.js", + "repository": { + "type": "git", + "url": "https://github.com/epeli/underscore.string.git" + }, + "bugs": { + "url": "https://github.com/epeli/underscore.string/issues" + }, + "licenses": [ + { + "type": "MIT" + } + ] +} diff --git a/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/component.json b/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/component.json index ae91b65..96e23d3 100644 --- a/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/component.json +++ b/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/component.json @@ -2,7 +2,7 @@ "name": "underscore.string", "repo": "epeli/underscore.string", "description": "String manipulation extensions for Underscore.js javascript library", - "version": "2.3.3", + "version": "2.4.0", "keywords": ["underscore", "string"], "dependencies": {}, "development": {}, diff --git a/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/dist/underscore.string.min.js b/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/dist/underscore.string.min.js deleted file mode 100644 index 4f6b2b9..0000000 --- a/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/dist/underscore.string.min.js +++ /dev/null @@ -1 +0,0 @@ -!function(e,n){"use strict";function r(e,n){var r,t,u=e.toLowerCase();for(n=[].concat(n),r=0;n.length>r;r+=1)if(t=n[r]){if(t.test&&t.test(e))return!0;if(t.toLowerCase()===u)return!0}}var t=n.prototype.trim,u=n.prototype.trimRight,i=n.prototype.trimLeft,l=function(e){return 1*e||0},o=function(e,n){if(1>n)return"";for(var r="";n>0;)1&n&&(r+=e),n>>=1,e+=e;return r},a=[].slice,c=function(e){return null==e?"\\s":e.source?e.source:"["+g.escapeRegExp(e)+"]"},s={lt:"<",gt:">",quot:'"',amp:"&",apos:"'"},f={};for(var p in s)f[s[p]]=p;f["'"]="#39";var h=function(){function e(e){return Object.prototype.toString.call(e).slice(8,-1).toLowerCase()}var r=o,t=function(){return t.cache.hasOwnProperty(arguments[0])||(t.cache[arguments[0]]=t.parse(arguments[0])),t.format.call(null,t.cache[arguments[0]],arguments)};return t.format=function(t,u){var i,l,o,a,c,s,f,p=1,g=t.length,d="",m=[];for(l=0;g>l;l++)if(d=e(t[l]),"string"===d)m.push(t[l]);else if("array"===d){if(a=t[l],a[2])for(i=u[p],o=0;a[2].length>o;o++){if(!i.hasOwnProperty(a[2][o]))throw new Error(h('[_.sprintf] property "%s" does not exist',a[2][o]));i=i[a[2][o]]}else i=a[1]?u[a[1]]:u[p++];if(/[^s]/.test(a[8])&&"number"!=e(i))throw new Error(h("[_.sprintf] expecting number but found %s",e(i)));switch(a[8]){case"b":i=i.toString(2);break;case"c":i=n.fromCharCode(i);break;case"d":i=parseInt(i,10);break;case"e":i=a[7]?i.toExponential(a[7]):i.toExponential();break;case"f":i=a[7]?parseFloat(i).toFixed(a[7]):parseFloat(i);break;case"o":i=i.toString(8);break;case"s":i=(i=n(i))&&a[7]?i.substring(0,a[7]):i;break;case"u":i=Math.abs(i);break;case"x":i=i.toString(16);break;case"X":i=i.toString(16).toUpperCase()}i=/[def]/.test(a[8])&&a[3]&&i>=0?"+"+i:i,s=a[4]?"0"==a[4]?"0":a[4].charAt(1):" ",f=a[6]-n(i).length,c=a[6]?r(s,f):"",m.push(a[5]?i+c:c+i)}return m.join("")},t.cache={},t.parse=function(e){for(var n=e,r=[],t=[],u=0;n;){if(null!==(r=/^[^\x25]+/.exec(n)))t.push(r[0]);else if(null!==(r=/^\x25{2}/.exec(n)))t.push("%");else{if(null===(r=/^\x25(?:([1-9]\d*)\$|\(([^\)]+)\))?(\+)?(0|'[^$])?(-)?(\d+)?(?:\.(\d+))?([b-fosuxX])/.exec(n)))throw new Error("[_.sprintf] huh?");if(r[2]){u|=1;var i=[],l=r[2],o=[];if(null===(o=/^([a-z_][a-z_\d]*)/i.exec(l)))throw new Error("[_.sprintf] huh?");for(i.push(o[1]);""!==(l=l.substring(o[0].length));)if(null!==(o=/^\.([a-z_][a-z_\d]*)/i.exec(l)))i.push(o[1]);else{if(null===(o=/^\[(\d+)\]/.exec(l)))throw new Error("[_.sprintf] huh?");i.push(o[1])}r[2]=i}else u|=2;if(3===u)throw new Error("[_.sprintf] mixing positional and named placeholders is not (yet) supported");t.push(r)}n=n.substring(r[0].length)}return t},t}(),g={VERSION:"2.3.0",isBlank:function(e){return null==e&&(e=""),/^\s*$/.test(e)},stripTags:function(e){return null==e?"":n(e).replace(/<\/?[^>]+>/g,"")},capitalize:function(e){return e=null==e?"":n(e),e.charAt(0).toUpperCase()+e.slice(1)},chop:function(e,r){return null==e?[]:(e=n(e),r=~~r,r>0?e.match(new RegExp(".{1,"+r+"}","g")):[e])},clean:function(e){return g.strip(e).replace(/\s+/g," ")},count:function(e,r){if(null==e||null==r)return 0;e=n(e),r=n(r);for(var t=0,u=0,i=r.length;;){if(u=e.indexOf(r,u),-1===u)break;t++,u+=i}return t},chars:function(e){return null==e?[]:n(e).split("")},swapCase:function(e){return null==e?"":n(e).replace(/\S/g,function(e){return e===e.toUpperCase()?e.toLowerCase():e.toUpperCase()})},escapeHTML:function(e){return null==e?"":n(e).replace(/[&<>"']/g,function(e){return"&"+f[e]+";"})},unescapeHTML:function(e){return null==e?"":n(e).replace(/\&([^;]+);/g,function(e,r){var t;return r in s?s[r]:(t=r.match(/^#x([\da-fA-F]+)$/))?n.fromCharCode(parseInt(t[1],16)):(t=r.match(/^#(\d+)$/))?n.fromCharCode(~~t[1]):e})},escapeRegExp:function(e){return null==e?"":n(e).replace(/([.*+?^=!:${}()|[\]\/\\])/g,"\\$1")},splice:function(e,n,r,t){var u=g.chars(e);return u.splice(~~n,~~r,t),u.join("")},insert:function(e,n,r){return g.splice(e,n,0,r)},include:function(e,r){return""===r?!0:null==e?!1:-1!==n(e).indexOf(r)},join:function(){var e=a.call(arguments),n=e.shift();return null==n&&(n=""),e.join(n)},lines:function(e){return null==e?[]:n(e).split("\n")},reverse:function(e){return g.chars(e).reverse().join("")},startsWith:function(e,r){return""===r?!0:null==e||null==r?!1:(e=n(e),r=n(r),e.length>=r.length&&e.slice(0,r.length)===r)},endsWith:function(e,r){return""===r?!0:null==e||null==r?!1:(e=n(e),r=n(r),e.length>=r.length&&e.slice(e.length-r.length)===r)},succ:function(e){return null==e?"":(e=n(e),e.slice(0,-1)+n.fromCharCode(e.charCodeAt(e.length-1)+1))},titleize:function(e){return null==e?"":(e=n(e).toLowerCase(),e.replace(/(?:^|\s|-)\S/g,function(e){return e.toUpperCase()}))},camelize:function(e){return g.trim(e).replace(/[-_\s]+(.)?/g,function(e,n){return n?n.toUpperCase():""})},underscored:function(e){return g.trim(e).replace(/([a-z\d])([A-Z]+)/g,"$1_$2").replace(/[-\s]+/g,"_").toLowerCase()},dasherize:function(e){return g.trim(e).replace(/([A-Z])/g,"-$1").replace(/[-_\s]+/g,"-").toLowerCase()},classify:function(e){return g.titleize(n(e).replace(/[\W_]/g," ")).replace(/\s/g,"")},humanize:function(e){return g.capitalize(g.underscored(e).replace(/_id$/,"").replace(/_/g," "))},trim:function(e,r){return null==e?"":!r&&t?t.call(e):(r=c(r),n(e).replace(new RegExp("^"+r+"+|"+r+"+$","g"),""))},ltrim:function(e,r){return null==e?"":!r&&i?i.call(e):(r=c(r),n(e).replace(new RegExp("^"+r+"+"),""))},rtrim:function(e,r){return null==e?"":!r&&u?u.call(e):(r=c(r),n(e).replace(new RegExp(r+"+$"),""))},truncate:function(e,r,t){return null==e?"":(e=n(e),t=t||"...",r=~~r,e.length>r?e.slice(0,r)+t:e)},prune:function(e,r,t){if(null==e)return"";if(e=n(e),r=~~r,t=null!=t?n(t):"...",r>=e.length)return e;var u=function(e){return e.toUpperCase()!==e.toLowerCase()?"A":" "},i=e.slice(0,r+1).replace(/.(?=\W*\w*$)/g,u);return i=i.slice(i.length-2).match(/\w\w/)?i.replace(/\s*\S+$/,""):g.rtrim(i.slice(0,i.length-1)),(i+t).length>e.length?e:e.slice(0,i.length)+t},words:function(e,n){return g.isBlank(e)?[]:g.trim(e,n).split(n||/\s+/)},pad:function(e,r,t,u){e=null==e?"":n(e),r=~~r;var i=0;switch(t?t.length>1&&(t=t.charAt(0)):t=" ",u){case"right":return i=r-e.length,e+o(t,i);case"both":return i=r-e.length,o(t,Math.ceil(i/2))+e+o(t,Math.floor(i/2));default:return i=r-e.length,o(t,i)+e}},lpad:function(e,n,r){return g.pad(e,n,r)},rpad:function(e,n,r){return g.pad(e,n,r,"right")},lrpad:function(e,n,r){return g.pad(e,n,r,"both")},sprintf:h,vsprintf:function(e,n){return n.unshift(e),h.apply(null,n)},toNumber:function(e,n){return e?(e=g.trim(e),e.match(/^-?\d+(?:\.\d+)?$/)?l(l(e).toFixed(~~n)):0/0):0},numberFormat:function(e,n,r,t){if(isNaN(e)||null==e)return"";e=e.toFixed(~~n),t="string"==typeof t?t:",";var u=e.split("."),i=u[0],l=u[1]?(r||".")+u[1]:"";return i.replace(/(\d)(?=(?:\d{3})+$)/g,"$1"+t)+l},strRight:function(e,r){if(null==e)return"";e=n(e),r=null!=r?n(r):r;var t=r?e.indexOf(r):-1;return~t?e.slice(t+r.length,e.length):e},strRightBack:function(e,r){if(null==e)return"";e=n(e),r=null!=r?n(r):r;var t=r?e.lastIndexOf(r):-1;return~t?e.slice(t+r.length,e.length):e},strLeft:function(e,r){if(null==e)return"";e=n(e),r=null!=r?n(r):r;var t=r?e.indexOf(r):-1;return~t?e.slice(0,t):e},strLeftBack:function(e,n){if(null==e)return"";e+="",n=null!=n?""+n:n;var r=e.lastIndexOf(n);return~r?e.slice(0,r):e},toSentence:function(e,n,r,t){n=n||", ",r=r||" and ";var u=e.slice(),i=u.pop();return e.length>2&&t&&(r=g.rtrim(n)+r),u.length?u.join(n)+r+i:i},toSentenceSerial:function(){var e=a.call(arguments);return e[3]=!0,g.toSentence.apply(g,e)},slugify:function(e){if(null==e)return"";var r="ąàáäâãåæăćęèéëêìíïîłńòóöôõøśșțùúüûñçżź",t="aaaaaaaaaceeeeeiiiilnoooooosstuuuunczz",u=new RegExp(c(r),"g");return e=n(e).toLowerCase().replace(u,function(e){var n=r.indexOf(e);return t.charAt(n)||"-"}),g.dasherize(e.replace(/[^\w\s-]/g,""))},surround:function(e,n){return[n,e,n].join("")},quote:function(e,n){return g.surround(e,n||'"')},unquote:function(e,n){return n=n||'"',e[0]===n&&e[e.length-1]===n?e.slice(1,e.length-1):e},exports:function(){var e={};for(var n in this)this.hasOwnProperty(n)&&!n.match(/^(?:include|contains|reverse)$/)&&(e[n]=this[n]);return e},repeat:function(e,r,t){if(null==e)return"";if(r=~~r,null==t)return o(n(e),r);for(var u=[];r>0;u[--r]=e);return u.join(t)},naturalCmp:function(e,r){if(e==r)return 0;if(!e)return-1;if(!r)return 1;for(var t=/(\.\d+)|(\d+)|(\D+)/g,u=n(e).toLowerCase().match(t),i=n(r).toLowerCase().match(t),l=Math.min(u.length,i.length),o=0;l>o;o++){var a=u[o],c=i[o];if(a!==c){var s=parseInt(a,10);if(!isNaN(s)){var f=parseInt(c,10);if(!isNaN(f)&&s-f)return s-f}return c>a?-1:1}}return u.length===i.length?u.length-i.length:r>e?-1:1},levenshtein:function(e,r){if(null==e&&null==r)return 0;if(null==e)return n(r).length;if(null==r)return n(e).length;e=n(e),r=n(r);for(var t,u,i=[],l=0;r.length>=l;l++)for(var o=0;e.length>=o;o++)u=l&&o?e.charAt(o-1)===r.charAt(l-1)?t:Math.min(i[o],i[o-1],t)+1:l+o,t=i[o],i[o]=u;return i.pop()},toBoolean:function(e,n,t){return"number"==typeof e&&(e=""+e),"string"!=typeof e?!!e:(e=g.trim(e),r(e,n||["true","1"])?!0:r(e,t||["false","0"])?!1:void 0)}};g.strip=g.trim,g.lstrip=g.ltrim,g.rstrip=g.rtrim,g.center=g.lrpad,g.rjust=g.lpad,g.ljust=g.rpad,g.contains=g.include,g.q=g.quote,g.toBool=g.toBoolean,"undefined"!=typeof exports&&("undefined"!=typeof module&&module.exports&&(module.exports=g),exports._s=g),"function"==typeof define&&define.amd&&define("underscore.string",[],function(){return g}),e._=e._||{},e._.string=e._.str=g}(this,String); \ No newline at end of file diff --git a/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/foo.js b/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/foo.js new file mode 100644 index 0000000..cdc1d08 --- /dev/null +++ b/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/foo.js @@ -0,0 +1,10 @@ + + function boolMatch(s, matchers) { + var i, matcher, down = s.toLowerCase(); + matchers = [].concat(matchers); + for (i = 0; i < matchers.length; i += 1) { + matcher = matchers[i]; + if (matcher.test && matcher.test(s)) return true; + if (matcher && matcher.toLowerCase() === down) return true; + } + } diff --git a/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/gulpfile.js b/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/gulpfile.js new file mode 100644 index 0000000..6eaead8 --- /dev/null +++ b/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/gulpfile.js @@ -0,0 +1,26 @@ +var gulp = require('gulp'), + qunit = require("gulp-qunit"), + uglify = require('gulp-uglify'), + clean = require('gulp-clean'), + rename = require('gulp-rename'), + SRC = 'lib/underscore.string.js', + DEST = 'dist', + MIN_FILE = 'underscore.string.min.js', + TEST_SUITES = ['test/test.html', 'test/test_underscore/index.html']; + +gulp.task('test', function() { + return gulp.src(TEST_SUITES) + .pipe(qunit()); +}); + +gulp.task('clean', function() { + return gulp.src(DEST) + .pipe(clean()); +}); + +gulp.task('build', ['test', 'clean'], function() { + return gulp.src(SRC) + .pipe(uglify()) + .pipe(rename(MIN_FILE)) + .pipe(gulp.dest(DEST)); +}); diff --git a/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/lib/underscore.string.js b/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/lib/underscore.string.js index 8761117..c9c8d47 100644 --- a/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/lib/underscore.string.js +++ b/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/lib/underscore.string.js @@ -3,7 +3,7 @@ // Underscore.string is freely distributable under the terms of the MIT license. // Documentation: https://github.com/epeli/underscore.string // Some code is borrowed from MooTools and Alexandru Marasteanu. -// Version '2.3.2' +// Version '2.4.0' !function(root, String){ 'use strict'; @@ -189,7 +189,7 @@ var _s = { - VERSION: '2.3.0', + VERSION: '2.4.0', isBlank: function(str){ if (str == null) str = ''; @@ -349,7 +349,7 @@ }, classify: function(str){ - return _s.titleize(String(str).replace(/[\W_]/g, ' ')).replace(/\s/g, ''); + return _s.capitalize(_s.camelize(String(str).replace(/[\W_]/g, ' ')).replace(/\s/g, '')); }, humanize: function(str){ @@ -360,7 +360,7 @@ if (str == null) return ''; if (!characters && nativeTrim) return nativeTrim.call(str); characters = defaultToWhiteSpace(characters); - return String(str).replace(new RegExp('\^' + characters + '+|' + characters + '+$', 'g'), ''); + return String(str).replace(new RegExp('^' + characters + '+|' + characters + '+$', 'g'), ''); }, ltrim: function(str, characters){ diff --git a/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/package.json b/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/package.json index 9556365..fb7151e 100644 --- a/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/package.json +++ b/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/package.json @@ -1,6 +1,6 @@ { "name": "underscore.string", - "version": "2.3.3", + "version": "2.4.0", "description": "String manipulation extensions for Underscore.js javascript library.", "homepage": "http://epeli.github.com/underscore.string/", "contributors": [ @@ -47,7 +47,7 @@ "underscore", "string" ], - "main": "./lib/underscore.string", + "main": "./lib/underscore.string.js", "directories": { "lib": "./lib" }, @@ -66,9 +66,42 @@ "type": "MIT" } ], - "readme": "# Underscore.string [![Build Status](https://secure.travis-ci.org/epeli/underscore.string.png?branch=master)](http://travis-ci.org/epeli/underscore.string) #\n\n\n\nJavascript lacks complete string manipulation operations.\nThis an attempt to fill that gap. List of build-in methods can be found\nfor example from [Dive Into JavaScript][d].\n\n[d]: http://www.diveintojavascript.com/core-javascript-reference/the-string-object\n\n\nAs name states this an extension for [Underscore.js][u], but it can be used\nindependently from **_s**-global variable. But with Underscore.js you can\nuse Object-Oriented style and chaining:\n\n[u]: http://documentcloud.github.com/underscore/\n\n```javascript\n_(\" epeli \").chain().trim().capitalize().value()\n=> \"Epeli\"\n```\n\n## Download ##\n\n * [Development version](https://raw.github.com/epeli/underscore.string/master/lib/underscore.string.js) *Uncompressed with Comments 18kb*\n * [Production version](https://github.com/epeli/underscore.string/raw/master/dist/underscore.string.min.js) *Minified 7kb*\n\n\n## Node.js installation ##\n\n**npm package**\n\n npm install underscore.string\n\n**Standalone usage**:\n\n```javascript\nvar _s = require('underscore.string');\n```\n\n**Integrate with Underscore.js**:\n\n```javascript\nvar _ = require('underscore');\n\n// Import Underscore.string to separate object, because there are conflict functions (include, reverse, contains)\n_.str = require('underscore.string');\n\n// Mix in non-conflict functions to Underscore namespace if you want\n_.mixin(_.str.exports());\n\n// All functions, include conflict, will be available through _.str object\n_.str.include('Underscore.string', 'string'); // => true\n```\n\n**Or Integrate with Underscore.js without module loading**\n\nRun the following expression after Underscore.js and Underscore.string are loaded\n```javascript\n// _.str becomes a global variable if no module loading is detected\n// Mix in non-conflict functions to Underscore namespace\n_.mixin(_.str.exports());\n```\n\n## String Functions ##\n\nFor availability of functions in this way you need to mix in Underscore.string functions:\n\n```javascript\n_.mixin(_.string.exports());\n```\n\notherwise functions from examples will be available through _.string or _.str objects:\n\n```javascript\n_.str.capitalize('epeli')\n=> \"Epeli\"\n```\n\n**numberFormat** _.numberFormat(number, [ decimals=0, decimalSeparator='.', orderSeparator=','])\n\nFormats the numbers.\n\n```javascript\n_.numberFormat(1000, 2)\n=> \"1,000.00\"\n\n_.numberFormat(123456789.123, 5, '.', ',')\n=> \"123,456,789.12300\"\n```\n\n\n**levenshtein** _.levenshtein(string1, string2)\n\nCalculates [Levenshtein distance][ld] between two strings.\n[ld]: http://en.wikipedia.org/wiki/Levenshtein_distance\n\n```javascript\n_.levenshtein('kitten', 'kittah')\n=> 2\n```\n\n**capitalize** _.capitalize(string)\n\nConverts first letter of the string to uppercase.\n\n```javascript\n_.capitalize(\"foo Bar\")\n=> \"Foo Bar\"\n```\n\n**chop** _.chop(string, step)\n\n```javascript\n_.chop('whitespace', 3)\n=> ['whi','tes','pac','e']\n```\n\n**clean** _.clean(str)\n\nCompress some whitespaces to one.\n\n```javascript\n_.clean(\" foo bar \")\n=> 'foo bar'\n```\n\n**chars** _.chars(str)\n\n```javascript\n_.chars('Hello')\n=> ['H','e','l','l','o']\n```\n\n**swapCase** _.swapCase(str)\n\nReturns a copy of the string in which all the case-based characters have had their case swapped.\n\n```javascript\n_.swapCase('hELLO')\n=> 'Hello'\n```\n\n**include** available only through _.str object, because Underscore has function with the same name.\n\n```javascript\n_.str.include(\"foobar\", \"ob\")\n=> true\n```\n\n(removed) **includes** _.includes(string, substring)\n\nTests if string contains a substring.\n\n```javascript\n_.includes(\"foobar\", \"ob\")\n=> true\n```\n\n**includes** function was removed\n\nBut you can create it in this way, for compatibility with previous versions:\n\n```javascript\n_.includes = _.str.include\n```\n\n**count** _.count(string, substring)\n\n```javascript\n_('Hello world').count('l')\n=> 3\n```\n\n**escapeHTML** _.escapeHTML(string)\n\nConverts HTML special characters to their entity equivalents.\n\n```javascript\n_('
Blah blah blah
').escapeHTML();\n=> '<div>Blah blah blah</div>'\n```\n\n**unescapeHTML** _.unescapeHTML(string)\n\nConverts entity characters to HTML equivalents.\n\n```javascript\n_('<div>Blah blah blah</div>').unescapeHTML();\n=> '
Blah blah blah
'\n```\n\n**insert** _.insert(string, index, substing)\n\n```javascript\n_('Hello ').insert(6, 'world')\n=> 'Hello world'\n```\n\n**isBlank** _.isBlank(string)\n\n```javascript\n_('').isBlank(); // => true\n_('\\n').isBlank(); // => true\n_(' ').isBlank(); // => true\n_('a').isBlank(); // => false\n```\n\n**join** _.join(separator, *strings)\n\nJoins strings together with given separator\n\n```javascript\n_.join(\" \", \"foo\", \"bar\")\n=> \"foo bar\"\n```\n\n**lines** _.lines(str)\n\n```javascript\n_.lines(\"Hello\\nWorld\")\n=> [\"Hello\", \"World\"]\n```\n\n**reverse** available only through _.str object, because Underscore has function with the same name.\n\nReturn reversed string:\n\n```javascript\n_.str.reverse(\"foobar\")\n=> 'raboof'\n```\n\n**splice** _.splice(string, index, howmany, substring)\n\nLike a array splice.\n\n```javascript\n_('https://edtsech@bitbucket.org/edtsech/underscore.strings').splice(30, 7, 'epeli')\n=> 'https://edtsech@bitbucket.org/epeli/underscore.strings'\n```\n\n**startsWith** _.startsWith(string, starts)\n\nThis method checks whether string starts with starts.\n\n```javascript\n_(\"image.gif\").startsWith(\"image\")\n=> true\n```\n\n**endsWith** _.endsWith(string, ends)\n\nThis method checks whether string ends with ends.\n\n```javascript\n_(\"image.gif\").endsWith(\"gif\")\n=> true\n```\n\n**succ** _.succ(str)\n\nReturns the successor to str.\n\n```javascript\n_('a').succ()\n=> 'b'\n\n_('A').succ()\n=> 'B'\n```\n\n**supplant**\n\nSupplant function was removed, use Underscore.js [template function][p].\n\n[p]: http://documentcloud.github.com/underscore/#template\n\n**strip** alias for *trim*\n\n**lstrip** alias for *ltrim*\n\n**rstrip** alias for *rtrim*\n\n**titleize** _.titleize(string)\n\n```javascript\n_('my name is epeli').titleize()\n=> 'My Name Is Epeli'\n```\n\n**camelize** _.camelize(string)\n\nConverts underscored or dasherized string to a camelized one\n\n```javascript\n_('-moz-transform').camelize()\n=> 'MozTransform'\n```\n\n**classify** _.classify(string)\n\nConverts string to camelized class name\n\n```javascript\n_('some_class_name').classify()\n=> 'SomeClassName'\n```\n\n**underscored** _.underscored(string)\n\nConverts a camelized or dasherized string into an underscored one\n\n```javascript\n_('MozTransform').underscored()\n=> 'moz_transform'\n```\n\n**dasherize** _.dasherize(string)\n\nConverts a underscored or camelized string into an dasherized one\n\n```javascript\n_('MozTransform').dasherize()\n=> '-moz-transform'\n```\n\n**humanize** _.humanize(string)\n\nConverts an underscored, camelized, or dasherized string into a humanized one.\nAlso removes beginning and ending whitespace, and removes the postfix '_id'.\n\n```javascript\n_(' capitalize dash-CamelCase_underscore trim ').humanize()\n=> 'Capitalize dash camel case underscore trim'\n```\n\n**trim** _.trim(string, [characters])\n\ntrims defined characters from begining and ending of the string.\nDefaults to whitespace characters.\n\n```javascript\n_.trim(\" foobar \")\n=> \"foobar\"\n\n_.trim(\"_-foobar-_\", \"_-\")\n=> \"foobar\"\n```\n\n\n**ltrim** _.ltrim(string, [characters])\n\nLeft trim. Similar to trim, but only for left side.\n\n\n**rtrim** _.rtrim(string, [characters])\n\nRight trim. Similar to trim, but only for right side.\n\n**truncate** _.truncate(string, length, truncateString)\n\n```javascript\n_('Hello world').truncate(5)\n=> 'Hello...'\n\n_('Hello').truncate(10)\n=> 'Hello'\n```\n\n**prune** _.prune(string, length, pruneString)\n\nElegant version of truncate.\nMakes sure the pruned string does not exceed the original length.\nAvoid half-chopped words when truncating.\n\n```javascript\n_('Hello, world').prune(5)\n=> 'Hello...'\n\n_('Hello, world').prune(8)\n=> 'Hello...'\n\n_('Hello, world').prune(5, ' (read a lot more)')\n=> 'Hello, world' (as adding \"(read a lot more)\" would be longer than the original string)\n\n_('Hello, cruel world').prune(15)\n=> 'Hello, cruel...'\n\n_('Hello').prune(10)\n=> 'Hello'\n```\n\n**words** _.words(str, delimiter=/\\s+/)\n\nSplit string by delimiter (String or RegExp), /\\s+/ by default.\n\n```javascript\n_.words(\" I love you \")\n=> [\"I\",\"love\",\"you\"]\n\n_.words(\"I_love_you\", \"_\")\n=> [\"I\",\"love\",\"you\"]\n\n_.words(\"I-love-you\", /-/)\n=> [\"I\",\"love\",\"you\"]\n\n_.words(\" \")\n=> []\n```\n\n**sprintf** _.sprintf(string format, *arguments)\n\nC like string formatting.\nCredits goes to [Alexandru Marasteanu][o].\nFor more detailed documentation, see the [original page][o].\n\n[o]: http://www.diveintojavascript.com/projects/sprintf-for-javascript\n\n```javascript\n_.sprintf(\"%.1f\", 1.17)\n\"1.2\"\n```\n\n**pad** _.pad(str, length, [padStr, type])\n\npads the `str` with characters until the total string length is equal to the passed `length` parameter. By default, pads on the **left** with the space char (`\" \"`). `padStr` is truncated to a single character if necessary.\n\n```javascript\n_.pad(\"1\", 8)\n-> \" 1\";\n\n_.pad(\"1\", 8, '0')\n-> \"00000001\";\n\n_.pad(\"1\", 8, '0', 'right')\n-> \"10000000\";\n\n_.pad(\"1\", 8, '0', 'both')\n-> \"00001000\";\n\n_.pad(\"1\", 8, 'bleepblorp', 'both')\n-> \"bbbb1bbb\";\n```\n\n**lpad** _.lpad(str, length, [padStr])\n\nleft-pad a string. Alias for `pad(str, length, padStr, 'left')`\n\n```javascript\n_.lpad(\"1\", 8, '0')\n-> \"00000001\";\n```\n\n**rpad** _.rpad(str, length, [padStr])\n\nright-pad a string. Alias for `pad(str, length, padStr, 'right')`\n\n```javascript\n_.rpad(\"1\", 8, '0')\n-> \"10000000\";\n```\n\n**lrpad** _.lrpad(str, length, [padStr])\n\nleft/right-pad a string. Alias for `pad(str, length, padStr, 'both')`\n\n```javascript\n_.lrpad(\"1\", 8, '0')\n-> \"00001000\";\n```\n\n**center** alias for **lrpad**\n\n**ljust** alias for *rpad*\n\n**rjust** alias for *lpad*\n\n**toNumber** _.toNumber(string, [decimals])\n\nParse string to number. Returns NaN if string can't be parsed to number.\n\n```javascript\n_('2.556').toNumber()\n=> 3\n\n_('2.556').toNumber(1)\n=> 2.6\n```\n\n**strRight** _.strRight(string, pattern)\n\nSearches a string from left to right for a pattern and returns a substring consisting of the characters in the string that are to the right of the pattern or all string if no match found.\n\n```javascript\n_('This_is_a_test_string').strRight('_')\n=> \"is_a_test_string\";\n```\n\n**strRightBack** _.strRightBack(string, pattern)\n\nSearches a string from right to left for a pattern and returns a substring consisting of the characters in the string that are to the right of the pattern or all string if no match found.\n\n```javascript\n_('This_is_a_test_string').strRightBack('_')\n=> \"string\";\n```\n\n**strLeft** _.strLeft(string, pattern)\n\nSearches a string from left to right for a pattern and returns a substring consisting of the characters in the string that are to the left of the pattern or all string if no match found.\n\n```javascript\n_('This_is_a_test_string').strLeft('_')\n=> \"This\";\n```\n\n**strLeftBack** _.strLeftBack(string, pattern)\n\nSearches a string from right to left for a pattern and returns a substring consisting of the characters in the string that are to the left of the pattern or all string if no match found.\n\n```javascript\n_('This_is_a_test_string').strLeftBack('_')\n=> \"This_is_a_test\";\n```\n\n**stripTags**\n\nRemoves all html tags from string.\n\n```javascript\n_('a
link').stripTags()\n=> 'a link'\n\n_('a link').stripTags()\n=> 'a linkalert(\"hello world!\")'\n```\n\n**toSentence** _.toSentence(array, [delimiter, lastDelimiter])\n\nJoin an array into a human readable sentence.\n\n```javascript\n_.toSentence(['jQuery', 'Mootools', 'Prototype'])\n=> 'jQuery, Mootools and Prototype';\n\n_.toSentence(['jQuery', 'Mootools', 'Prototype'], ', ', ' unt ')\n=> 'jQuery, Mootools unt Prototype';\n```\n\n**toSentenceSerial** _.toSentenceSerial(array, [delimiter, lastDelimiter])\n\nThe same as `toSentence`, but adjusts delimeters to use [Serial comma](http://en.wikipedia.org/wiki/Serial_comma).\n\n```javascript\n_.toSentenceSerial(['jQuery', 'Mootools'])\n=> 'jQuery and Mootools';\n\n_.toSentenceSerial(['jQuery', 'Mootools', 'Prototype'])\n=> 'jQuery, Mootools, and Prototype'\n\n_.toSentenceSerial(['jQuery', 'Mootools', 'Prototype'], ', ', ' unt ');\n=> 'jQuery, Mootools, unt Prototype';\n```\n\n**repeat** _.repeat(string, count, [separator])\n\nRepeats a string count times.\n\n```javascript\n_.repeat(\"foo\", 3)\n=> 'foofoofoo';\n\n_.repeat(\"foo\", 3, \"bar\")\n=> 'foobarfoobarfoo'\n```\n\n**surround** _.surround(string, wrap)\n\nSurround a string with another string.\n\n```javascript\n_.surround(\"foo\", \"ab\")\n=> 'abfooab';\n```\n\n**quote** _.quote(string, quoteChar) or _.q(string, quoteChar)\n\nQuotes a string. `quoteChar` defaults to `\"`.\n\n```javascript\n_.quote('foo', quoteChar)\n=> '\"foo\"';\n```\n**unquote** _.unquote(string, quoteChar)\n\nUnquotes a string. `quoteChar` defaults to `\"`.\n\n```javascript\n_.unquote('\"foo\"')\n=> 'foo';\n_.unquote(\"'foo'\", \"'\")\n=> 'foo';\n```\n\n\n**slugify** _.slugify(string)\n\nTransform text into a URL slug. Replaces whitespaces, accentuated, and special characters with a dash.\n\n```javascript\n_.slugify(\"Un éléphant à l'orée du bois\")\n=> 'un-elephant-a-loree-du-bois';\n```\n\n***Caution: this function is charset dependent***\n\n**naturalCmp** array.sort(_.naturalCmp)\n\nNaturally sort strings like humans would do.\n\n```javascript\n['foo20', 'foo5'].sort(_.naturalCmp)\n=> [ 'foo5', 'foo20' ]\n```\n\n**toBoolean** _.toBoolean(string) or _.toBool(string)\n\nTurn strings that can be commonly considered as booleas to real booleans. Such as \"true\", \"false\", \"1\" and \"0\". This function is case insensitive.\n\n```javascript\n_.toBoolean(\"true\")\n=> true\n_.toBoolean(\"FALSE\")\n=> false\n_.toBoolean(\"random\")\n=> undefined\n```\n\nIt can be customized by giving arrays of truth and falsy value matcher as parameters. Matchers can be also RegExp objects.\n\n```javascript\n_.toBoolean(\"truthy\", [\"truthy\"], [\"falsy\"])\n=> true\n_.toBoolean(\"true only at start\", [/^true/])\n=> true\n```\n\n## Roadmap ##\n\nAny suggestions or bug reports are welcome. Just email me or more preferably open an issue.\n\n#### Problems\n\nWe lose two things for `include` and `reverse` methods from `_.string`:\n\n* Calls like `_('foobar').include('bar')` aren't available;\n* Chaining isn't available too.\n\nBut if you need this functionality you can create aliases for conflict functions which will be convenient for you:\n\n```javascript\n_.mixin({\n includeString: _.str.include,\n reverseString: _.str.reverse\n})\n\n// Now wrapper calls and chaining are available.\n_('foobar').chain().reverseString().includeString('rab').value()\n```\n\n#### Standalone Usage\n\nIf you are using Underscore.string without Underscore. You also have `_.string` namespace for it and `_.str` alias\nBut of course you can just reassign `_` variable with `_.string`\n\n```javascript\n_ = _.string\n```\n\n## Changelog ##\n\n### 2.3.3 ###\n\n* Add `toBoolean`\n* Add `unquote`\n* Add quote char option to `quote`\n* Support dash-separated words in `titleize`\n\n### 2.3.2 ###\n\n* Add `naturalCmp`\n* Bug fix to `camelize`\n* Add ă, ș, ț and ś to `slugify`\n* Doc updates\n* Add support for [component](http://component.io/)\n* [Full changelog](https://github.com/epeli/underscore.string/compare/v2.3.1...v2.3.2)\n\n### 2.3.1 ###\n\n* Bug fixes to `escapeHTML`, `classify`, `substr`\n* Faster `count`\n* Documentation fixes\n* [Full changelog](https://github.com/epeli/underscore.string/compare/v2.3.0...v2.3.1)\n\n### 2.3.0 ###\n\n* Added `numberformat` method\n* Added `levenshtein` method (Levenshtein distance calculation)\n* Added `swapCase` method\n* Changed default behavior of `words` method\n* Added `toSentenceSerial` method\n* Added `surround` and `quote` methods\n\n### 2.2.1 ###\n\n* Same as 2.2.0 (2.2.0rc on npm) to fix some npm drama\n\n### 2.2.0 ###\n\n* Capitalize method behavior changed\n* Various perfomance tweaks\n\n### 2.1.1###\n\n* Fixed words method bug\n* Added classify method\n\n### 2.1.0 ###\n\n* AMD support\n* Added toSentence method\n* Added slugify method\n* Lots of speed optimizations\n\n### 2.0.0 ###\n\n* Added prune, humanize functions\n* Added _.string (_.str) namespace for Underscore.string library\n* Removed includes function\n\nFor upgrading to this version you need to mix in Underscore.string library to Underscore object:\n\n```javascript\n_.mixin(_.string.exports());\n```\n\nand all non-conflict Underscore.string functions will be available through Underscore object.\nAlso function `includes` has been removed, you should replace this function by `_.str.include`\nor create alias `_.includes = _.str.include` and all your code will work fine.\n\n### 1.1.6 ###\n\n* Fixed reverse and truncate\n* Added isBlank, stripTags, inlude(alias for includes)\n* Added uglifier compression\n\n### 1.1.5 ###\n\n* Added strRight, strRightBack, strLeft, strLeftBack\n\n### 1.1.4 ###\n\n* Added pad, lpad, rpad, lrpad methods and aliases center, ljust, rjust\n* Integration with Underscore 1.1.6\n\n### 1.1.3 ###\n\n* Added methods: underscored, camelize, dasherize\n* Support newer version of npm\n\n### 1.1.2 ###\n\n* Created functions: lines, chars, words functions\n\n### 1.0.2 ###\n\n* Created integration test suite with underscore.js 1.1.4 (now it's absolutely compatible)\n* Removed 'reverse' function, because this function override underscore.js 'reverse'\n\n## Contribute ##\n\n* Fork & pull request. Don't forget about tests.\n* If you planning add some feature please create issue before.\n\nOtherwise changes will be rejected.\n\n## Contributors list ##\n[Can be found here](https://github.com/epeli/underscore.string/graphs/contributors).\n\n\n## Licence ##\n\nThe MIT License\n\nCopyright (c) 2011 Esa-Matti Suuronen esa-matti@suuronen.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n", - "readmeFilename": "README.markdown", - "_id": "underscore.string@2.3.3", - "_from": "underscore.string@~2.3.1", - "scripts": {} + "scripts": { + "test": "gulp test" + }, + "devDependencies": { + "gulp": "~3.8.10", + "gulp-uglify": "~1.0.1", + "gulp-qunit": "~1.0.0", + "gulp-clean": "~0.3.1", + "gulp-rename": "~1.2.0" + }, + "_id": "underscore.string@2.4.0", + "dist": { + "shasum": "8cdd8fbac4e2d2ea1e7e2e8097c42f442280f85b", + "tarball": "http://registry.npmjs.org/underscore.string/-/underscore.string-2.4.0.tgz" + }, + "_from": "underscore.string@>=2.4.0 <2.5.0", + "_npmVersion": "1.3.24", + "_npmUser": { + "name": "epeli", + "email": "esa-matti@suuronen.org" + }, + "maintainers": [ + { + "name": "edtsech", + "email": "edtsech@gmail.com" + }, + { + "name": "rwz", + "email": "rwz@duckroll.ru" + }, + { + "name": "epeli", + "email": "esa-matti@suuronen.org" + } + ], + "_shasum": "8cdd8fbac4e2d2ea1e7e2e8097c42f442280f85b", + "_resolved": "https://registry.npmjs.org/underscore.string/-/underscore.string-2.4.0.tgz", + "readme": "ERROR: No README data found!" } diff --git a/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/test/run-qunit.js b/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/test/run-qunit.js deleted file mode 100644 index 44a2167..0000000 --- a/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/test/run-qunit.js +++ /dev/null @@ -1,45 +0,0 @@ -function waitFor(test, complete, timeout) { - var result, start = new Date().getTime() - setInterval(function interval() { - if ((new Date().getTime() - start < timeout) && !result) { - result = test() - } else { - if (!result) { - phantom.exit(1) - } else { - complete() - clearInterval(interval) - } - } - }, 100) -} - - -var fs = require('fs'), page = require('webpage').create(); -var url = 'file://localhost' + fs.workingDirectory + '/' + phantom.args[0]; - -page.onConsoleMessage = function(msg) { - console.log(msg) -} - -page.open(url, function(status) { - waitFor(function() { - return page.evaluate(function(){ - var el = document.getElementById('qunit-testresult') - return el && el.innerText.match('completed') - }) - }, function() { - var failures = page.evaluate(function() { - var el = document.getElementById('qunit-testresult'), - fails = document.getElementsByClassName('fail') - - for (var i = 0; i < fails.length; i++) - console.log(fails[i].innerText) - - console.log(el.innerText) - - return parseInt(el.getElementsByClassName('failed')[0].innerHTML) - }) - phantom.exit(failures > 0 ? 1 : 0) - }, 10000) -}) \ No newline at end of file diff --git a/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/test/speed.js b/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/test/speed.js deleted file mode 100644 index 9ceeea7..0000000 --- a/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/test/speed.js +++ /dev/null @@ -1,148 +0,0 @@ -(function() { - - JSLitmus.test('levenshtein', function() { - return [ - _.levenshtein('pineapple', 'potato'), - _.levenshtein('seven', 'eight'), - _.levenshtein('the very same string', 'the very same string'), - _.levenshtein('very very very long string', 'something completely different') - ]; - }); - - - JSLitmus.test('trimNoNative', function() { - return _.trim(" foobar ", " "); - }); - - JSLitmus.test('trim', function() { - return _.trim(" foobar "); - }); - - JSLitmus.test('trim object-oriented', function() { - return _(" foobar ").trim(); - }); - - JSLitmus.test('trim jQuery', function() { - return jQuery.trim(" foobar "); - }); - - JSLitmus.test('ltrimp', function() { - return _.ltrim(" foobar ", " "); - }); - - JSLitmus.test('rtrimp', function() { - return _.rtrim(" foobar ", " "); - }); - - JSLitmus.test('startsWith', function() { - return _.startsWith("foobar", "foo"); - }); - - JSLitmus.test('endsWith', function() { - return _.endsWith("foobar", "xx"); - }); - - JSLitmus.test('chop', function(){ - return _('whitespace').chop(2); - }); - - JSLitmus.test('count', function(){ - return _('Hello worls').count('l'); - }); - - JSLitmus.test('insert', function() { - return _('Hello ').insert(6, 'world'); - }); - - JSLitmus.test('splice', function() { - return _('https://edtsech@bitbucket.org/edtsech/underscore.strings').splice(30, 7, 'epeli'); - }); - - JSLitmus.test('succ', function(){ - var let = 'a', alphabet = []; - - for (var i=0; i < 26; i++) { - alphabet.push(let); - let = _(let).succ(); - } - - return alphabet; - }); - - JSLitmus.test('titleize', function(){ - return _('the titleize string method').titleize(); - }); - - JSLitmus.test('truncate', function(){ - return _('Hello world').truncate(5); - }); - - JSLitmus.test('prune', function(){ - return _('Hello world').prune(5); - }); - - JSLitmus.test('isBlank', function(){ - return _('').isBlank(); - }); - - JSLitmus.test('escapeHTML', function(){ - _('
Blah blah blah
').escapeHTML(); - }); - - JSLitmus.test('unescapeHTML', function(){ - _('<div>Blah blah blah</div>').unescapeHTML(); - }); - - JSLitmus.test('reverse', function(){ - _('Hello World').reverse(); - }); - - JSLitmus.test('pad default', function(){ - _('foo').pad(12); - }); - - JSLitmus.test('pad hash left', function(){ - _('foo').pad(12, '#'); - }); - - JSLitmus.test('pad hash right', function(){ - _('foo').pad(12, '#', 'right'); - }); - - JSLitmus.test('pad hash both', function(){ - _('foo').pad(12, '#', 'both'); - }); - - JSLitmus.test('pad hash both longPad', function(){ - _('foo').pad(12, 'f00f00f00', 'both'); - }); - - JSLitmus.test('toNumber', function(){ - _('10.232323').toNumber(2); - }); - - JSLitmus.test('strRight', function(){ - _('aaa_bbb_ccc').strRight('_'); - }); - - JSLitmus.test('strRightBack', function(){ - _('aaa_bbb_ccc').strRightBack('_'); - }); - - JSLitmus.test('strLeft', function(){ - _('aaa_bbb_ccc').strLeft('_'); - }); - - JSLitmus.test('strLeftBack', function(){ - _('aaa_bbb_ccc').strLeftBack('_'); - }); - - JSLitmus.test('join', function(){ - _('separator').join(1, 2, 3, 4, 5, 6, 7, 8, 'foo', 'bar', 'lol', 'wut'); - }); - - JSLitmus.test('slugify', function(){ - _("Un éléphant à l'orée du bois").slugify(); - }); - -})(); diff --git a/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/test/strings.js b/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/test/strings.js deleted file mode 100644 index 77364f2..0000000 --- a/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/test/strings.js +++ /dev/null @@ -1,685 +0,0 @@ -$(document).ready(function() { - - // Include Underscore.string methods to Underscore namespace - _.mixin(_.str.exports()); - - module('String extensions'); - - test('Strings: naturalSort', function() { - var arr = ['foo2', 'foo1', 'foo10', 'foo30', 'foo100', 'foo10bar'], - sorted = ['foo1', 'foo2', 'foo10', 'foo10bar', 'foo30', 'foo100']; - deepEqual(arr.sort(_.naturalCmp), sorted); - }); - - test('Strings: trim', function() { - equal(_.trim(123), '123', 'Non string'); - equal(_(' foo').trim(), 'foo'); - equal(_('foo ').trim(), 'foo'); - equal(_(' foo ').trim(), 'foo'); - equal(_(' foo ').trim(), 'foo'); - equal(_(' foo ').trim(' '), 'foo', 'Manually set whitespace'); - equal(_('\t foo \t ').trim(/\s/), 'foo', 'Manually set RegExp /\\s+/'); - - equal(_('ffoo').trim('f'), 'oo'); - equal(_('ooff').trim('f'), 'oo'); - equal(_('ffooff').trim('f'), 'oo'); - - - equal(_('_-foobar-_').trim('_-'), 'foobar'); - - equal(_('http://foo/').trim('/'), 'http://foo'); - equal(_('c:\\').trim('\\'), 'c:'); - - equal(_(123).trim(), '123'); - equal(_(123).trim(3), '12'); - equal(_('').trim(), '', 'Trim empty string should return empty string'); - equal(_(null).trim(), '', 'Trim null should return empty string'); - equal(_(undefined).trim(), '', 'Trim undefined should return empty string'); - }); - - test('String: levenshtein', function() { - equal(_.levenshtein('Godfather', 'Godfather'), 0); - equal(_.levenshtein('Godfather', 'Godfathe'), 1); - equal(_.levenshtein('Godfather', 'odfather'), 1); - equal(_.levenshtein('Godfather', 'Gdfthr'), 3); - equal(_.levenshtein('seven', 'eight'), 5); - equal(_.levenshtein('123', 123), 0); - equal(_.levenshtein(321, '321'), 0); - equal(_.levenshtein('lol', null), 3); - equal(_.levenshtein('lol'), 3); - equal(_.levenshtein(null, 'lol'), 3); - equal(_.levenshtein(undefined, 'lol'), 3); - equal(_.levenshtein(), 0); - }); - - test('Strings: ltrim', function() { - equal(_(' foo').ltrim(), 'foo'); - equal(_(' foo').ltrim(), 'foo'); - equal(_('foo ').ltrim(), 'foo '); - equal(_(' foo ').ltrim(), 'foo '); - equal(_('').ltrim(), '', 'ltrim empty string should return empty string'); - equal(_(null).ltrim(), '', 'ltrim null should return empty string'); - equal(_(undefined).ltrim(), '', 'ltrim undefined should return empty string'); - - equal(_('ffoo').ltrim('f'), 'oo'); - equal(_('ooff').ltrim('f'), 'ooff'); - equal(_('ffooff').ltrim('f'), 'ooff'); - - equal(_('_-foobar-_').ltrim('_-'), 'foobar-_'); - - equal(_(123).ltrim(1), '23'); - }); - - test('Strings: rtrim', function() { - equal(_('http://foo/').rtrim('/'), 'http://foo', 'clean trailing slash'); - equal(_(' foo').rtrim(), ' foo'); - equal(_('foo ').rtrim(), 'foo'); - equal(_('foo ').rtrim(), 'foo'); - equal(_('foo bar ').rtrim(), 'foo bar'); - equal(_(' foo ').rtrim(), ' foo'); - - equal(_('ffoo').rtrim('f'), 'ffoo'); - equal(_('ooff').rtrim('f'), 'oo'); - equal(_('ffooff').rtrim('f'), 'ffoo'); - - equal(_('_-foobar-_').rtrim('_-'), '_-foobar'); - - equal(_(123).rtrim(3), '12'); - equal(_('').rtrim(), '', 'rtrim empty string should return empty string'); - equal(_(null).rtrim(), '', 'rtrim null should return empty string'); - }); - - test('Strings: capitalize', function() { - equal(_('fabio').capitalize(), 'Fabio', 'First letter is upper case'); - equal(_.capitalize('fabio'), 'Fabio', 'First letter is upper case'); - equal(_.capitalize('FOO'), 'FOO', 'Other letters unchanged'); - equal(_(123).capitalize(), '123', 'Non string'); - equal(_.capitalize(''), '', 'Capitalizing empty string returns empty string'); - equal(_.capitalize(null), '', 'Capitalizing null returns empty string'); - equal(_.capitalize(undefined), '', 'Capitalizing undefined returns empty string'); - }); - - test('Strings: join', function() { - equal(_.join('', 'foo', 'bar'), 'foobar', 'basic join'); - equal(_.join('', 1, 'foo', 2), '1foo2', 'join numbers and strings'); - equal(_.join(' ','foo', 'bar'), 'foo bar', 'join with spaces'); - equal(_.join('1', '2', '2'), '212', 'join number strings'); - equal(_.join(1, 2, 2), '212', 'join numbers'); - equal(_.join('','foo', null), 'foo', 'join null with string returns string'); - equal(_.join(null,'foo', 'bar'), 'foobar', 'join strings with null returns string'); - equal(_(' ').join('foo', 'bar'), 'foo bar', 'join object oriented'); - }); - - test('Strings: reverse', function() { - equal(_.str.reverse('foo'), 'oof' ); - equal(_.str.reverse('foobar'), 'raboof' ); - equal(_.str.reverse('foo bar'), 'rab oof' ); - equal(_.str.reverse('saippuakauppias'), 'saippuakauppias' ); - equal(_.str.reverse(123), '321', 'Non string'); - equal(_.str.reverse(123.45), '54.321', 'Non string'); - equal(_.str.reverse(''), '', 'reversing empty string returns empty string' ); - equal(_.str.reverse(null), '', 'reversing null returns empty string' ); - equal(_.str.reverse(undefined), '', 'reversing undefined returns empty string' ); - }); - - test('Strings: clean', function() { - equal(_(' foo bar ').clean(), 'foo bar'); - equal(_(123).clean(), '123'); - equal(_('').clean(), '', 'claning empty string returns empty string'); - equal(_(null).clean(), '', 'claning null returns empty string'); - equal(_(undefined).clean(), '', 'claning undefined returns empty string'); - }); - - test('Strings: sprintf', function() { - // Should be very tested function already. Thanks to - // http://www.diveintojavascript.com/projects/sprintf-for-javascript - equal(_.sprintf('Hello %s', 'me'), 'Hello me', 'basic'); - equal(_('Hello %s').sprintf('me'), 'Hello me', 'object'); - equal(_('hello %s').chain().sprintf('me').capitalize().value(), 'Hello me', 'Chaining works'); - equal(_.sprintf('%.1f', 1.22222), '1.2', 'round'); - equal(_.sprintf('%.1f', 1.17), '1.2', 'round 2'); - equal(_.sprintf('%(id)d - %(name)s', {id: 824, name: 'Hello World'}), '824 - Hello World', 'Named replacements work'); - equal(_.sprintf('%(args[0].id)d - %(args[1].name)s', {args: [{id: 824}, {name: 'Hello World'}]}), '824 - Hello World', 'Named replacements with arrays work'); - }); - - - test('Strings: vsprintf', function() { - equal(_.vsprintf('Hello %s', ['me']), 'Hello me', 'basic'); - equal(_('Hello %s').vsprintf(['me']), 'Hello me', 'object'); - equal(_('hello %s').chain().vsprintf(['me']).capitalize().value(), 'Hello me', 'Chaining works'); - equal(_.vsprintf('%.1f', [1.22222]), '1.2', 'round'); - equal(_.vsprintf('%.1f', [1.17]), '1.2', 'round 2'); - equal(_.vsprintf('%(id)d - %(name)s', [{id: 824, name: 'Hello World'}]), '824 - Hello World', 'Named replacement works'); - equal(_.vsprintf('%(args[0].id)d - %(args[1].name)s', [{args: [{id: 824}, {name: 'Hello World'}]}]), '824 - Hello World', 'Named replacement with arrays works'); - }); - - test('Strings: startsWith', function() { - ok(_('foobar').startsWith('foo'), 'foobar starts with foo'); - ok(!_('oobar').startsWith('foo'), 'oobar does not start with foo'); - ok(_(12345).startsWith(123), '12345 starts with 123'); - ok(!_(2345).startsWith(123), '2345 does not start with 123'); - ok(_('').startsWith(''), 'empty string starts with empty string'); - ok(_(null).startsWith(''), 'null starts with empty string'); - ok(!_(null).startsWith('foo'), 'null starts with foo'); - }); - - test('Strings: endsWith', function() { - ok(_('foobar').endsWith('bar'), 'foobar ends with bar'); - ok(_.endsWith('foobar', 'bar'), 'foobar ends with bar'); - ok(_.endsWith('00018-0000062.Plone.sdh264.1a7264e6912a91aa4a81b64dc5517df7b8875994.mp4', 'mp4'), 'endsWith .mp4'); - ok(!_('fooba').endsWith('bar'), 'fooba does not end with bar'); - ok(_.endsWith(12345, 45), '12345 ends with 45'); - ok(!_.endsWith(12345, 6), '12345 does not end with 6'); - ok(_('').endsWith(''), 'empty string ends with empty string'); - ok(_(null).endsWith(''), 'null ends with empty string'); - ok(!_(null).endsWith('foo'), 'null ends with foo'); - }); - - test('Strings: include', function() { - ok(_.str.include('foobar', 'bar'), 'foobar includes bar'); - ok(!_.str.include('foobar', 'buzz'), 'foobar does not includes buzz'); - ok(_.str.include(12345, 34), '12345 includes 34'); - ok(!_.str.contains(12345, 6), '12345 does not includes 6'); - ok(!_.str.include('', 34), 'empty string includes 34'); - ok(!_.str.include(null, 34), 'null includes 34'); - ok(_.str.include(null, ''), 'null includes empty string'); - }); - - test('String: chop', function(){ - ok(_('whitespace').chop(2).length === 5, 'output [wh, it, es, pa, ce]'); - ok(_('whitespace').chop(3).length === 4, 'output [whi, tes, pac, e]'); - ok(_('whitespace').chop()[0].length === 10, 'output [whitespace]'); - ok(_(12345).chop(1).length === 5, 'output [1, 2, 3, 4, 5]'); - }); - - test('String: clean', function(){ - equal(_.clean(' foo bar '), 'foo bar'); - equal(_.clean(''), ''); - equal(_.clean(null), ''); - equal(_.clean(1), '1'); - }); - - test('String: count', function(){ - equal(_('Hello world').count('l'), 3); - equal(_('Hello world').count('Hello'), 1); - equal(_('Hello world').count('foo'), 0); - equal(_('x.xx....x.x').count('x'), 5); - equal(_('').count('x'), 0); - equal(_(null).count('x'), 0); - equal(_(undefined).count('x'), 0); - equal(_(12345).count(1), 1); - equal(_(11345).count(1), 2); - }); - - test('String: insert', function(){ - equal(_('Hello ').insert(6, 'Jessy'), 'Hello Jessy'); - equal(_('Hello ').insert(100, 'Jessy'), 'Hello Jessy'); - equal(_('').insert(100, 'Jessy'), 'Jessy'); - equal(_(null).insert(100, 'Jessy'), 'Jessy'); - equal(_(undefined).insert(100, 'Jessy'), 'Jessy'); - equal(_(12345).insert(6, 'Jessy'), '12345Jessy'); - }); - - test('String: splice', function(){ - equal(_('https://edtsech@bitbucket.org/edtsech/underscore.strings').splice(30, 7, 'epeli'), - 'https://edtsech@bitbucket.org/epeli/underscore.strings'); - equal(_.splice(12345, 1, 2, 321), '132145', 'Non strings'); - }); - - test('String: succ', function(){ - equal(_('a').succ(), 'b'); - equal(_('A').succ(), 'B'); - equal(_('+').succ(), ','); - equal(_(1).succ(), '2'); - }); - - test('String: titleize', function(){ - equal(_('the titleize string method').titleize(), 'The Titleize String Method'); - equal(_('the titleize string method').titleize(), 'The Titleize String Method'); - equal(_('').titleize(), '', 'Titleize empty string returns empty string'); - equal(_(null).titleize(), '', 'Titleize null returns empty string'); - equal(_(undefined).titleize(), '', 'Titleize undefined returns empty string'); - equal(_('let\'s have some fun').titleize(), 'Let\'s Have Some Fun'); - equal(_('a-dash-separated-string').titleize(), 'A-Dash-Separated-String'); - equal(_('A-DASH-SEPARATED-STRING').titleize(), 'A-Dash-Separated-String'); - equal(_(123).titleize(), '123'); - }); - - test('String: camelize', function(){ - equal(_('the_camelize_string_method').camelize(), 'theCamelizeStringMethod'); - equal(_('-the-camelize-string-method').camelize(), 'TheCamelizeStringMethod'); - equal(_('the camelize string method').camelize(), 'theCamelizeStringMethod'); - equal(_(' the camelize string method').camelize(), 'theCamelizeStringMethod'); - equal(_('the camelize string method').camelize(), 'theCamelizeStringMethod'); - equal(_('').camelize(), '', 'Camelize empty string returns empty string'); - equal(_(null).camelize(), '', 'Camelize null returns empty string'); - equal(_(undefined).camelize(), '', 'Camelize undefined returns empty string'); - equal(_(123).camelize(), '123'); - }); - - test('String: underscored', function(){ - equal(_('the-underscored-string-method').underscored(), 'the_underscored_string_method'); - equal(_('theUnderscoredStringMethod').underscored(), 'the_underscored_string_method'); - equal(_('TheUnderscoredStringMethod').underscored(), 'the_underscored_string_method'); - equal(_(' the underscored string method').underscored(), 'the_underscored_string_method'); - equal(_('').underscored(), ''); - equal(_(null).underscored(), ''); - equal(_(undefined).underscored(), ''); - equal(_(123).underscored(), '123'); - }); - - test('String: dasherize', function(){ - equal(_('the_dasherize_string_method').dasherize(), 'the-dasherize-string-method'); - equal(_('TheDasherizeStringMethod').dasherize(), '-the-dasherize-string-method'); - equal(_('thisIsATest').dasherize(), 'this-is-a-test'); - equal(_('this Is A Test').dasherize(), 'this-is-a-test'); - equal(_('thisIsATest123').dasherize(), 'this-is-a-test123'); - equal(_('123thisIsATest').dasherize(), '123this-is-a-test'); - equal(_('the dasherize string method').dasherize(), 'the-dasherize-string-method'); - equal(_('the dasherize string method ').dasherize(), 'the-dasherize-string-method'); - equal(_('téléphone').dasherize(), 'téléphone'); - equal(_('foo$bar').dasherize(), 'foo$bar'); - equal(_('').dasherize(), ''); - equal(_(null).dasherize(), ''); - equal(_(undefined).dasherize(), ''); - equal(_(123).dasherize(), '123'); - }); - - test('String: camelize', function(){ - equal(_.camelize('-moz-transform'), 'MozTransform'); - equal(_.camelize('webkit-transform'), 'webkitTransform'); - equal(_.camelize('under_scored'), 'underScored'); - equal(_.camelize(' with spaces'), 'withSpaces'); - equal(_('').camelize(), ''); - equal(_(null).camelize(), ''); - equal(_(undefined).camelize(), ''); - equal(_("_som eWeird---name-").camelize(), 'SomEWeirdName'); - }); - - test('String: join', function(){ - equal(_.join(1, 2, 3, 4), '21314'); - equal(_.join('|', 'foo', 'bar', 'baz'), 'foo|bar|baz'); - equal(_.join('',2,3,null), '23'); - equal(_.join(null,2,3), '23'); - }); - - test('String: classify', function(){ - equal(_.classify(1), '1'); - equal(_('some_class_name').classify(), 'SomeClassName'); - equal(_('my wonderfull class_name').classify(), 'MyWonderfullClassName'); - equal(_('my wonderfull.class.name').classify(), 'MyWonderfullClassName'); - }); - - test('String: humanize', function(){ - equal(_('the_humanize_string_method').humanize(), 'The humanize string method'); - equal(_('ThehumanizeStringMethod').humanize(), 'Thehumanize string method'); - equal(_('the humanize string method').humanize(), 'The humanize string method'); - equal(_('the humanize_id string method_id').humanize(), 'The humanize id string method'); - equal(_('the humanize string method ').humanize(), 'The humanize string method'); - equal(_(' capitalize dash-CamelCase_underscore trim ').humanize(), 'Capitalize dash camel case underscore trim'); - equal(_(123).humanize(), '123'); - equal(_('').humanize(), ''); - equal(_(null).humanize(), ''); - equal(_(undefined).humanize(), ''); - }); - - test('String: truncate', function(){ - equal(_('Hello world').truncate(6, 'read more'), 'Hello read more'); - equal(_('Hello world').truncate(5), 'Hello...'); - equal(_('Hello').truncate(10), 'Hello'); - equal(_('').truncate(10), ''); - equal(_(null).truncate(10), ''); - equal(_(undefined).truncate(10), ''); - equal(_(1234567890).truncate(5), '12345...'); - }); - - test('String: prune', function(){ - equal(_('Hello, cruel world').prune(6, ' read more'), 'Hello read more'); - equal(_('Hello, world').prune(5, 'read a lot more'), 'Hello, world'); - equal(_('Hello, world').prune(5), 'Hello...'); - equal(_('Hello, world').prune(8), 'Hello...'); - equal(_('Hello, cruel world').prune(15), 'Hello, cruel...'); - equal(_('Hello world').prune(22), 'Hello world'); - equal(_('Привет, жестокий мир').prune(6, ' read more'), 'Привет read more'); - equal(_('Привет, мир').prune(6, 'read a lot more'), 'Привет, мир'); - equal(_('Привет, мир').prune(6), 'Привет...'); - equal(_('Привет, мир').prune(8), 'Привет...'); - equal(_('Привет, жестокий мир').prune(16), 'Привет, жестокий...'); - equal(_('Привет, мир').prune(22), 'Привет, мир'); - equal(_('alksjd!!!!!!....').prune(100, ''), 'alksjd!!!!!!....'); - equal(_(123).prune(10), '123'); - equal(_(123).prune(1, 321), '321'); - equal(_('').prune(5), ''); - equal(_(null).prune(5), ''); - equal(_(undefined).prune(5), ''); - }); - - test('String: isBlank', function(){ - ok(_('').isBlank()); - ok(_(' ').isBlank()); - ok(_('\n').isBlank()); - ok(!_('a').isBlank()); - ok(!_('0').isBlank()); - ok(!_(0).isBlank()); - ok(_('').isBlank()); - ok(_(null).isBlank()); - ok(_(undefined).isBlank()); - }); - - test('String: escapeRegExp', function(){ - equal(_.escapeRegExp(/hello(?=\sworld)/.source), 'hello\\(\\?\\=\\\\sworld\\)', 'with lookahead'); - equal(_.escapeRegExp(/hello(?!\shell)/.source), 'hello\\(\\?\\!\\\\shell\\)', 'with negative lookahead'); - }); - - test('String: escapeHTML', function(){ - equal(_('
Blah & "blah" & \'blah\'
').escapeHTML(), - '<div>Blah & "blah" & 'blah'</div>'); - equal(_('<').escapeHTML(), '&lt;'); - equal(_(5).escapeHTML(), '5'); - equal(_('').escapeHTML(), ''); - equal(_(null).escapeHTML(), ''); - equal(_(undefined).escapeHTML(), ''); - }); - - test('String: unescapeHTML', function(){ - equal(_('<div>Blah & "blah" & 'blah'</div>').unescapeHTML(), - '
Blah & "blah" & \'blah\'
'); - equal(_('&lt;').unescapeHTML(), '<'); - equal(_(''').unescapeHTML(), '\''); - equal(_(''').unescapeHTML(), '\''); - equal(_(''').unescapeHTML(), '\''); - equal(_('J').unescapeHTML(), 'J'); - equal(_('J').unescapeHTML(), 'J'); - equal(_('J').unescapeHTML(), 'J'); - equal(_('&_#39;').unescapeHTML(), '&_#39;'); - equal(_(''_;').unescapeHTML(), ''_;'); - equal(_('&#38;').unescapeHTML(), '&'); - equal(_('&amp;').unescapeHTML(), '&'); - equal(_('').unescapeHTML(), ''); - equal(_(null).unescapeHTML(), ''); - equal(_(undefined).unescapeHTML(), ''); - equal(_(5).unescapeHTML(), '5'); - // equal(_(undefined).unescapeHTML(), ''); - }); - - test('String: words', function() { - deepEqual(_('I love you!').words(), ['I', 'love', 'you!']); - deepEqual(_(' I love you! ').words(), ['I', 'love', 'you!']); - deepEqual(_('I_love_you!').words('_'), ['I', 'love', 'you!']); - deepEqual(_('I-love-you!').words(/-/), ['I', 'love', 'you!']); - deepEqual(_(123).words(), ['123'], '123 number has one word "123".'); - deepEqual(_(0).words(), ['0'], 'Zero number has one word "0".'); - deepEqual(_('').words(), [], 'Empty strings has no words.'); - deepEqual(_(' ').words(), [], 'Blank strings has no words.'); - deepEqual(_(null).words(), [], 'null has no words.'); - deepEqual(_(undefined).words(), [], 'undefined has no words.'); - }); - - test('String: chars', function() { - equal(_('Hello').chars().length, 5); - equal(_(123).chars().length, 3); - equal(_('').chars().length, 0); - equal(_(null).chars().length, 0); - equal(_(undefined).chars().length, 0); - }); - - test('String: swapCase', function(){ - equal(_('AaBbCcDdEe').swapCase(), 'aAbBcCdDeE'); - equal(_('Hello World').swapCase(), 'hELLO wORLD'); - equal(_('').swapCase(), ''); - equal(_(null).swapCase(), ''); - equal(_(undefined).swapCase(), ''); - }); - - test('String: lines', function() { - equal(_('Hello\nWorld').lines().length, 2); - equal(_('Hello World').lines().length, 1); - equal(_(123).lines().length, 1); - equal(_('').lines().length, 1); - equal(_(null).lines().length, 0); - equal(_(undefined).lines().length, 0); - }); - - test('String: pad', function() { - equal(_('1').pad(8), ' 1'); - equal(_(1).pad(8), ' 1'); - equal(_('1').pad(8, '0'), '00000001'); - equal(_('1').pad(8, '0', 'left'), '00000001'); - equal(_('1').pad(8, '0', 'right'), '10000000'); - equal(_('1').pad(8, '0', 'both'), '00001000'); - equal(_('foo').pad(8, '0', 'both'), '000foo00'); - equal(_('foo').pad(7, '0', 'both'), '00foo00'); - equal(_('foo').pad(7, '!@$%dofjrofj', 'both'), '!!foo!!'); - equal(_('').pad(2), ' '); - equal(_(null).pad(2), ' '); - equal(_(undefined).pad(2), ' '); - }); - - test('String: lpad', function() { - equal(_('1').lpad(8), ' 1'); - equal(_(1).lpad(8), ' 1'); - equal(_('1').lpad(8, '0'), '00000001'); - equal(_('1').lpad(8, '0', 'left'), '00000001'); - equal(_('').lpad(2), ' '); - equal(_(null).lpad(2), ' '); - equal(_(undefined).lpad(2), ' '); - }); - - test('String: rpad', function() { - equal(_('1').rpad(8), '1 '); - equal(_(1).lpad(8), ' 1'); - equal(_('1').rpad(8, '0'), '10000000'); - equal(_('foo').rpad(8, '0'), 'foo00000'); - equal(_('foo').rpad(7, '0'), 'foo0000'); - equal(_('').rpad(2), ' '); - equal(_(null).rpad(2), ' '); - equal(_(undefined).rpad(2), ' '); - }); - - test('String: lrpad', function() { - equal(_('1').lrpad(8), ' 1 '); - equal(_(1).lrpad(8), ' 1 '); - equal(_('1').lrpad(8, '0'), '00001000'); - equal(_('foo').lrpad(8, '0'), '000foo00'); - equal(_('foo').lrpad(7, '0'), '00foo00'); - equal(_('foo').lrpad(7, '!@$%dofjrofj'), '!!foo!!'); - equal(_('').lrpad(2), ' '); - equal(_(null).lrpad(2), ' '); - equal(_(undefined).lrpad(2), ' '); - }); - - test('String: toNumber', function() { - deepEqual(_('not a number').toNumber(), NaN); - equal(_(0).toNumber(), 0); - equal(_('0').toNumber(), 0); - equal(_('0.0').toNumber(), 0); - equal(_('0.1').toNumber(), 0); - equal(_('0.1').toNumber(1), 0.1); - equal(_(' 0.1 ').toNumber(1), 0.1); - equal(_('0000').toNumber(), 0); - equal(_('2.345').toNumber(), 2); - equal(_('2.345').toNumber(NaN), 2); - equal(_('2.345').toNumber(2), 2.35); - equal(_('2.344').toNumber(2), 2.34); - equal(_('2').toNumber(2), 2.00); - equal(_(2).toNumber(2), 2.00); - equal(_(-2).toNumber(), -2); - equal(_('-2').toNumber(), -2); - equal(_('').toNumber(), 0); - equal(_(null).toNumber(), 0); - equal(_(undefined).toNumber(), 0); - }); - - test('String: numberFormat', function() { - equal(_.numberFormat(9000), '9,000'); - equal(_.numberFormat(9000, 0), '9,000'); - equal(_.numberFormat(9000, 0, '', ''), '9000'); - equal(_.numberFormat(90000, 2), '90,000.00'); - equal(_.numberFormat(1000.754), '1,001'); - equal(_.numberFormat(1000.754, 2), '1,000.75'); - equal(_.numberFormat(1000.754, 0, ',', '.'), '1.001'); - equal(_.numberFormat(1000.754, 2, ',', '.'), '1.000,75'); - equal(_.numberFormat(1000000.754, 2, ',', '.'), '1.000.000,75'); - equal(_.numberFormat(1000000000), '1,000,000,000'); - equal(_.numberFormat(100000000), '100,000,000'); - equal(_.numberFormat('not number'), ''); - equal(_.numberFormat(), ''); - equal(_.numberFormat(null, '.', ','), ''); - equal(_.numberFormat(undefined, '.', ','), ''); - equal(_.numberFormat(new Number(5000)), '5,000'); - }); - - test('String: strRight', function() { - equal(_('This_is_a_test_string').strRight('_'), 'is_a_test_string'); - equal(_('This_is_a_test_string').strRight('string'), ''); - equal(_('This_is_a_test_string').strRight(), 'This_is_a_test_string'); - equal(_('This_is_a_test_string').strRight(''), 'This_is_a_test_string'); - equal(_('This_is_a_test_string').strRight('-'), 'This_is_a_test_string'); - equal(_('This_is_a_test_string').strRight(''), 'This_is_a_test_string'); - equal(_('').strRight('foo'), ''); - equal(_(null).strRight('foo'), ''); - equal(_(undefined).strRight('foo'), ''); - equal(_(12345).strRight(2), '345'); - }); - - test('String: strRightBack', function() { - equal(_('This_is_a_test_string').strRightBack('_'), 'string'); - equal(_('This_is_a_test_string').strRightBack('string'), ''); - equal(_('This_is_a_test_string').strRightBack(), 'This_is_a_test_string'); - equal(_('This_is_a_test_string').strRightBack(''), 'This_is_a_test_string'); - equal(_('This_is_a_test_string').strRightBack('-'), 'This_is_a_test_string'); - equal(_('').strRightBack('foo'), ''); - equal(_(null).strRightBack('foo'), ''); - equal(_(undefined).strRightBack('foo'), ''); - equal(_(12345).strRightBack(2), '345'); - }); - - test('String: strLeft', function() { - equal(_('This_is_a_test_string').strLeft('_'), 'This'); - equal(_('This_is_a_test_string').strLeft('This'), ''); - equal(_('This_is_a_test_string').strLeft(), 'This_is_a_test_string'); - equal(_('This_is_a_test_string').strLeft(''), 'This_is_a_test_string'); - equal(_('This_is_a_test_string').strLeft('-'), 'This_is_a_test_string'); - equal(_('').strLeft('foo'), ''); - equal(_(null).strLeft('foo'), ''); - equal(_(undefined).strLeft('foo'), ''); - equal(_(123454321).strLeft(3), '12'); - }); - - test('String: strLeftBack', function() { - equal(_('This_is_a_test_string').strLeftBack('_'), 'This_is_a_test'); - equal(_('This_is_a_test_string').strLeftBack('This'), ''); - equal(_('This_is_a_test_string').strLeftBack(), 'This_is_a_test_string'); - equal(_('This_is_a_test_string').strLeftBack(''), 'This_is_a_test_string'); - equal(_('This_is_a_test_string').strLeftBack('-'), 'This_is_a_test_string'); - equal(_('').strLeftBack('foo'), ''); - equal(_(null).strLeftBack('foo'), ''); - equal(_(undefined).strLeftBack('foo'), ''); - equal(_(123454321).strLeftBack(3), '123454'); - }); - - test('Strings: stripTags', function() { - equal(_('a link').stripTags(), 'a link'); - equal(_('a link - - - - - - - - -

Underscore.string Test Suite

-

-

-
    -
    -

    Underscore.string Speed Suite

    - -
    - - diff --git a/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/test/test_standalone.html b/node_modules/grunt-istanbul/node_modules/istanbul/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-istanbul/node_modules/istanbul/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-istanbul/node_modules/istanbul/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/test/test_underscore/arrays.js b/node_modules/grunt-istanbul/node_modules/istanbul/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-istanbul/node_modules/istanbul/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-istanbul/node_modules/istanbul/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/test/test_underscore/chaining.js b/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/test/test_underscore/chaining.js deleted file mode 100644 index 16cf7bf..0000000 --- a/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/test/test_underscore/chaining.js +++ /dev/null @@ -1,59 +0,0 @@ -$(document).ready(function() { - - module("Chaining"); - - test("map/flatten/reduce", function() { - var lyrics = [ - "I'm a lumberjack and I'm okay", - "I sleep all night and I work all day", - "He's a lumberjack and he's okay", - "He sleeps all night and he works all day" - ]; - var counts = _(lyrics).chain() - .map(function(line) { return line.split(''); }) - .flatten() - .reduce(function(hash, l) { - hash[l] = hash[l] || 0; - hash[l]++; - return hash; - }, {}).value(); - ok(counts['a'] == 16 && counts['e'] == 10, 'counted all the letters in the song'); - }); - - test("select/reject/sortBy", function() { - var numbers = [1,2,3,4,5,6,7,8,9,10]; - numbers = _(numbers).chain().select(function(n) { - return n % 2 == 0; - }).reject(function(n) { - return n % 4 == 0; - }).sortBy(function(n) { - return -n; - }).value(); - equal(numbers.join(', '), "10, 6, 2", "filtered and reversed the numbers"); - }); - - test("select/reject/sortBy in functional style", function() { - var numbers = [1,2,3,4,5,6,7,8,9,10]; - numbers = _.chain(numbers).select(function(n) { - return n % 2 == 0; - }).reject(function(n) { - return n % 4 == 0; - }).sortBy(function(n) { - return -n; - }).value(); - equal(numbers.join(', '), "10, 6, 2", "filtered and reversed the numbers"); - }); - - test("reverse/concat/unshift/pop/map", function() { - var numbers = [1,2,3,4,5]; - numbers = _(numbers).chain() - .reverse() - .concat([5, 5, 5]) - .unshift(17) - .pop() - .map(function(n){ return n * 2; }) - .value(); - equal(numbers.join(', '), "34, 10, 8, 6, 4, 2, 10, 10", 'can chain together array functions.'); - }); - -}); diff --git a/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/test/test_underscore/collections.js b/node_modules/grunt-istanbul/node_modules/istanbul/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-istanbul/node_modules/istanbul/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-istanbul/node_modules/istanbul/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/test/test_underscore/functions.js b/node_modules/grunt-istanbul/node_modules/istanbul/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-istanbul/node_modules/istanbul/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-istanbul/node_modules/istanbul/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/test/test_underscore/index.html b/node_modules/grunt-istanbul/node_modules/istanbul/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-istanbul/node_modules/istanbul/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-istanbul/node_modules/istanbul/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/test/test_underscore/objects.js b/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/test/test_underscore/objects.js deleted file mode 100644 index 22949c3..0000000 --- a/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/test/test_underscore/objects.js +++ /dev/null @@ -1,548 +0,0 @@ -$(document).ready(function() { - - module("Objects"); - - test("keys", function() { - equal(_.keys({one : 1, two : 2}).join(', '), 'one, two', 'can extract the keys from an object'); - // the test above is not safe because it relies on for-in enumeration order - var a = []; a[1] = 0; - equal(_.keys(a).join(', '), '1', 'is not fooled by sparse arrays; see issue #95'); - raises(function() { _.keys(null); }, TypeError, 'throws an error for `null` values'); - raises(function() { _.keys(void 0); }, TypeError, 'throws an error for `undefined` values'); - raises(function() { _.keys(1); }, TypeError, 'throws an error for number primitives'); - raises(function() { _.keys('a'); }, TypeError, 'throws an error for string primitives'); - raises(function() { _.keys(true); }, TypeError, 'throws an error for boolean primitives'); - }); - - test("values", function() { - equal(_.values({one: 1, two: 2}).join(', '), '1, 2', 'can extract the values from an object'); - equal(_.values({one: 1, two: 2, length: 3}).join(', '), '1, 2, 3', '... even when one of them is "length"'); - }); - - test("pairs", function() { - deepEqual(_.pairs({one: 1, two: 2}), [['one', 1], ['two', 2]], 'can convert an object into pairs'); - deepEqual(_.pairs({one: 1, two: 2, length: 3}), [['one', 1], ['two', 2], ['length', 3]], '... even when one of them is "length"'); - }); - - test("invert", function() { - var obj = {first: 'Moe', second: 'Larry', third: 'Curly'}; - equal(_.keys(_.invert(obj)).join(' '), 'Moe Larry Curly', 'can invert an object'); - ok(_.isEqual(_.invert(_.invert(obj)), obj), 'two inverts gets you back where you started'); - - var obj = {length: 3}; - ok(_.invert(obj)['3'] == 'length', 'can invert an object with "length"') - }); - - test("functions", function() { - var obj = {a : 'dash', b : _.map, c : (/yo/), d : _.reduce}; - ok(_.isEqual(['b', 'd'], _.functions(obj)), 'can grab the function names of any passed-in object'); - - var Animal = function(){}; - Animal.prototype.run = function(){}; - equal(_.functions(new Animal).join(''), 'run', 'also looks up functions on the prototype'); - }); - - test("extend", function() { - var result; - equal(_.extend({}, {a:'b'}).a, 'b', 'can extend an object with the attributes of another'); - equal(_.extend({a:'x'}, {a:'b'}).a, 'b', 'properties in source override destination'); - equal(_.extend({x:'x'}, {a:'b'}).x, 'x', 'properties not in source dont get overriden'); - result = _.extend({x:'x'}, {a:'a'}, {b:'b'}); - ok(_.isEqual(result, {x:'x', a:'a', b:'b'}), 'can extend from multiple source objects'); - result = _.extend({x:'x'}, {a:'a', x:2}, {a:'b'}); - ok(_.isEqual(result, {x:2, a:'b'}), 'extending from multiple source objects last property trumps'); - result = _.extend({}, {a: void 0, b: null}); - equal(_.keys(result).join(''), 'ab', 'extend does not copy undefined values'); - }); - - test("pick", function() { - var result; - result = _.pick({a:1, b:2, c:3}, 'a', 'c'); - ok(_.isEqual(result, {a:1, c:3}), 'can restrict properties to those named'); - result = _.pick({a:1, b:2, c:3}, ['b', 'c']); - ok(_.isEqual(result, {b:2, c:3}), 'can restrict properties to those named in an array'); - result = _.pick({a:1, b:2, c:3}, ['a'], 'b'); - ok(_.isEqual(result, {a:1, b:2}), 'can restrict properties to those named in mixed args'); - - var Obj = function(){}; - Obj.prototype = {a: 1, b: 2, c: 3}; - ok(_.isEqual(_.pick(new Obj, 'a', 'c'), {a:1, c: 3}), 'include prototype props'); - }); - - test("omit", function() { - var result; - result = _.omit({a:1, b:2, c:3}, 'b'); - ok(_.isEqual(result, {a:1, c:3}), 'can omit a single named property'); - result = _.omit({a:1, b:2, c:3}, 'a', 'c'); - ok(_.isEqual(result, {b:2}), 'can omit several named properties'); - result = _.omit({a:1, b:2, c:3}, ['b', 'c']); - ok(_.isEqual(result, {a:1}), 'can omit properties named in an array'); - - var Obj = function(){}; - Obj.prototype = {a: 1, b: 2, c: 3}; - ok(_.isEqual(_.omit(new Obj, 'b'), {a:1, c: 3}), 'include prototype props'); - }); - - test("defaults", function() { - var result; - var options = {zero: 0, one: 1, empty: "", nan: NaN, string: "string"}; - - _.defaults(options, {zero: 1, one: 10, twenty: 20}); - equal(options.zero, 0, 'value exists'); - equal(options.one, 1, 'value exists'); - equal(options.twenty, 20, 'default applied'); - - _.defaults(options, {empty: "full"}, {nan: "nan"}, {word: "word"}, {word: "dog"}); - equal(options.empty, "", 'value exists'); - ok(_.isNaN(options.nan), "NaN isn't overridden"); - equal(options.word, "word", 'new value is added, first one wins'); - }); - - test("clone", function() { - var moe = {name : 'moe', lucky : [13, 27, 34]}; - var clone = _.clone(moe); - equal(clone.name, 'moe', 'the clone as the attributes of the original'); - - clone.name = 'curly'; - ok(clone.name == 'curly' && moe.name == 'moe', 'clones can change shallow attributes without affecting the original'); - - clone.lucky.push(101); - equal(_.last(moe.lucky), 101, 'changes to deep attributes are shared with the original'); - - equal(_.clone(undefined), void 0, 'non objects should not be changed by clone'); - equal(_.clone(1), 1, 'non objects should not be changed by clone'); - equal(_.clone(null), null, 'non objects should not be changed by clone'); - }); - - test("isEqual", function() { - function First() { - this.value = 1; - } - First.prototype.value = 1; - function Second() { - this.value = 1; - } - Second.prototype.value = 2; - - // Basic equality and identity comparisons. - ok(_.isEqual(null, null), "`null` is equal to `null`"); - ok(_.isEqual(), "`undefined` is equal to `undefined`"); - - ok(!_.isEqual(0, -0), "`0` is not equal to `-0`"); - ok(!_.isEqual(-0, 0), "Commutative equality is implemented for `0` and `-0`"); - ok(!_.isEqual(null, undefined), "`null` is not equal to `undefined`"); - ok(!_.isEqual(undefined, null), "Commutative equality is implemented for `null` and `undefined`"); - - // String object and primitive comparisons. - ok(_.isEqual("Curly", "Curly"), "Identical string primitives are equal"); - ok(_.isEqual(new String("Curly"), new String("Curly")), "String objects with identical primitive values are equal"); - ok(_.isEqual(new String("Curly"), "Curly"), "String primitives and their corresponding object wrappers are equal"); - ok(_.isEqual("Curly", new String("Curly")), "Commutative equality is implemented for string objects and primitives"); - - ok(!_.isEqual("Curly", "Larry"), "String primitives with different values are not equal"); - ok(!_.isEqual(new String("Curly"), new String("Larry")), "String objects with different primitive values are not equal"); - ok(!_.isEqual(new String("Curly"), {toString: function(){ return "Curly"; }}), "String objects and objects with a custom `toString` method are not equal"); - - // Number object and primitive comparisons. - ok(_.isEqual(75, 75), "Identical number primitives are equal"); - ok(_.isEqual(new Number(75), new Number(75)), "Number objects with identical primitive values are equal"); - ok(_.isEqual(75, new Number(75)), "Number primitives and their corresponding object wrappers are equal"); - ok(_.isEqual(new Number(75), 75), "Commutative equality is implemented for number objects and primitives"); - ok(!_.isEqual(new Number(0), -0), "`new Number(0)` and `-0` are not equal"); - ok(!_.isEqual(0, new Number(-0)), "Commutative equality is implemented for `new Number(0)` and `-0`"); - - ok(!_.isEqual(new Number(75), new Number(63)), "Number objects with different primitive values are not equal"); - ok(!_.isEqual(new Number(63), {valueOf: function(){ return 63; }}), "Number objects and objects with a `valueOf` method are not equal"); - - // Comparisons involving `NaN`. - ok(_.isEqual(NaN, NaN), "`NaN` is equal to `NaN`"); - ok(!_.isEqual(61, NaN), "A number primitive is not equal to `NaN`"); - ok(!_.isEqual(new Number(79), NaN), "A number object is not equal to `NaN`"); - ok(!_.isEqual(Infinity, NaN), "`Infinity` is not equal to `NaN`"); - - // Boolean object and primitive comparisons. - ok(_.isEqual(true, true), "Identical boolean primitives are equal"); - ok(_.isEqual(new Boolean, new Boolean), "Boolean objects with identical primitive values are equal"); - ok(_.isEqual(true, new Boolean(true)), "Boolean primitives and their corresponding object wrappers are equal"); - ok(_.isEqual(new Boolean(true), true), "Commutative equality is implemented for booleans"); - ok(!_.isEqual(new Boolean(true), new Boolean), "Boolean objects with different primitive values are not equal"); - - // Common type coercions. - ok(!_.isEqual(true, new Boolean(false)), "Boolean objects are not equal to the boolean primitive `true`"); - ok(!_.isEqual("75", 75), "String and number primitives with like values are not equal"); - ok(!_.isEqual(new Number(63), new String(63)), "String and number objects with like values are not equal"); - ok(!_.isEqual(75, "75"), "Commutative equality is implemented for like string and number values"); - ok(!_.isEqual(0, ""), "Number and string primitives with like values are not equal"); - ok(!_.isEqual(1, true), "Number and boolean primitives with like values are not equal"); - ok(!_.isEqual(new Boolean(false), new Number(0)), "Boolean and number objects with like values are not equal"); - ok(!_.isEqual(false, new String("")), "Boolean primitives and string objects with like values are not equal"); - ok(!_.isEqual(12564504e5, new Date(2009, 9, 25)), "Dates and their corresponding numeric primitive values are not equal"); - - // Dates. - ok(_.isEqual(new Date(2009, 9, 25), new Date(2009, 9, 25)), "Date objects referencing identical times are equal"); - ok(!_.isEqual(new Date(2009, 9, 25), new Date(2009, 11, 13)), "Date objects referencing different times are not equal"); - ok(!_.isEqual(new Date(2009, 11, 13), { - getTime: function(){ - return 12606876e5; - } - }), "Date objects and objects with a `getTime` method are not equal"); - ok(!_.isEqual(new Date("Curly"), new Date("Curly")), "Invalid dates are not equal"); - - // Functions. - ok(!_.isEqual(First, Second), "Different functions with identical bodies and source code representations are not equal"); - - // RegExps. - ok(_.isEqual(/(?:)/gim, /(?:)/gim), "RegExps with equivalent patterns and flags are equal"); - ok(!_.isEqual(/(?:)/g, /(?:)/gi), "RegExps with equivalent patterns and different flags are not equal"); - ok(!_.isEqual(/Moe/gim, /Curly/gim), "RegExps with different patterns and equivalent flags are not equal"); - ok(!_.isEqual(/(?:)/gi, /(?:)/g), "Commutative equality is implemented for RegExps"); - ok(!_.isEqual(/Curly/g, {source: "Larry", global: true, ignoreCase: false, multiline: false}), "RegExps and RegExp-like objects are not equal"); - - // Empty arrays, array-like objects, and object literals. - ok(_.isEqual({}, {}), "Empty object literals are equal"); - ok(_.isEqual([], []), "Empty array literals are equal"); - ok(_.isEqual([{}], [{}]), "Empty nested arrays and objects are equal"); - ok(!_.isEqual({length: 0}, []), "Array-like objects and arrays are not equal."); - ok(!_.isEqual([], {length: 0}), "Commutative equality is implemented for array-like objects"); - - ok(!_.isEqual({}, []), "Object literals and array literals are not equal"); - ok(!_.isEqual([], {}), "Commutative equality is implemented for objects and arrays"); - - // Arrays with primitive and object values. - ok(_.isEqual([1, "Larry", true], [1, "Larry", true]), "Arrays containing identical primitives are equal"); - ok(_.isEqual([(/Moe/g), new Date(2009, 9, 25)], [(/Moe/g), new Date(2009, 9, 25)]), "Arrays containing equivalent elements are equal"); - - // Multi-dimensional arrays. - var a = [new Number(47), false, "Larry", /Moe/, new Date(2009, 11, 13), ['running', 'biking', new String('programming')], {a: 47}]; - var b = [new Number(47), false, "Larry", /Moe/, new Date(2009, 11, 13), ['running', 'biking', new String('programming')], {a: 47}]; - ok(_.isEqual(a, b), "Arrays containing nested arrays and objects are recursively compared"); - - // Overwrite the methods defined in ES 5.1 section 15.4.4. - a.forEach = a.map = a.filter = a.every = a.indexOf = a.lastIndexOf = a.some = a.reduce = a.reduceRight = null; - b.join = b.pop = b.reverse = b.shift = b.slice = b.splice = b.concat = b.sort = b.unshift = null; - - // Array elements and properties. - ok(_.isEqual(a, b), "Arrays containing equivalent elements and different non-numeric properties are equal"); - a.push("White Rocks"); - ok(!_.isEqual(a, b), "Arrays of different lengths are not equal"); - a.push("East Boulder"); - b.push("Gunbarrel Ranch", "Teller Farm"); - ok(!_.isEqual(a, b), "Arrays of identical lengths containing different elements are not equal"); - - // Sparse arrays. - ok(_.isEqual(Array(3), Array(3)), "Sparse arrays of identical lengths are equal"); - ok(!_.isEqual(Array(3), Array(6)), "Sparse arrays of different lengths are not equal when both are empty"); - - // Simple objects. - ok(_.isEqual({a: "Curly", b: 1, c: true}, {a: "Curly", b: 1, c: true}), "Objects containing identical primitives are equal"); - ok(_.isEqual({a: /Curly/g, b: new Date(2009, 11, 13)}, {a: /Curly/g, b: new Date(2009, 11, 13)}), "Objects containing equivalent members are equal"); - ok(!_.isEqual({a: 63, b: 75}, {a: 61, b: 55}), "Objects of identical sizes with different values are not equal"); - ok(!_.isEqual({a: 63, b: 75}, {a: 61, c: 55}), "Objects of identical sizes with different property names are not equal"); - ok(!_.isEqual({a: 1, b: 2}, {a: 1}), "Objects of different sizes are not equal"); - ok(!_.isEqual({a: 1}, {a: 1, b: 2}), "Commutative equality is implemented for objects"); - ok(!_.isEqual({x: 1, y: undefined}, {x: 1, z: 2}), "Objects with identical keys and different values are not equivalent"); - - // `A` contains nested objects and arrays. - a = { - name: new String("Moe Howard"), - age: new Number(77), - stooge: true, - hobbies: ["acting"], - film: { - name: "Sing a Song of Six Pants", - release: new Date(1947, 9, 30), - stars: [new String("Larry Fine"), "Shemp Howard"], - minutes: new Number(16), - seconds: 54 - } - }; - - // `B` contains equivalent nested objects and arrays. - b = { - name: new String("Moe Howard"), - age: new Number(77), - stooge: true, - hobbies: ["acting"], - film: { - name: "Sing a Song of Six Pants", - release: new Date(1947, 9, 30), - stars: [new String("Larry Fine"), "Shemp Howard"], - minutes: new Number(16), - seconds: 54 - } - }; - ok(_.isEqual(a, b), "Objects with nested equivalent members are recursively compared"); - - // Instances. - ok(_.isEqual(new First, new First), "Object instances are equal"); - ok(!_.isEqual(new First, new Second), "Objects with different constructors and identical own properties are not equal"); - ok(!_.isEqual({value: 1}, new First), "Object instances and objects sharing equivalent properties are not equal"); - ok(!_.isEqual({value: 2}, new Second), "The prototype chain of objects should not be examined"); - - // Circular Arrays. - (a = []).push(a); - (b = []).push(b); - ok(_.isEqual(a, b), "Arrays containing circular references are equal"); - a.push(new String("Larry")); - b.push(new String("Larry")); - ok(_.isEqual(a, b), "Arrays containing circular references and equivalent properties are equal"); - a.push("Shemp"); - b.push("Curly"); - ok(!_.isEqual(a, b), "Arrays containing circular references and different properties are not equal"); - - // More circular arrays #767. - a = ["everything is checked but", "this", "is not"]; - a[1] = a; - b = ["everything is checked but", ["this", "array"], "is not"]; - ok(!_.isEqual(a, b), "Comparison of circular references with non-circular references are not equal"); - - // Circular Objects. - a = {abc: null}; - b = {abc: null}; - a.abc = a; - b.abc = b; - ok(_.isEqual(a, b), "Objects containing circular references are equal"); - a.def = 75; - b.def = 75; - ok(_.isEqual(a, b), "Objects containing circular references and equivalent properties are equal"); - a.def = new Number(75); - b.def = new Number(63); - ok(!_.isEqual(a, b), "Objects containing circular references and different properties are not equal"); - - // More circular objects #767. - a = {everything: "is checked", but: "this", is: "not"}; - a.but = a; - b = {everything: "is checked", but: {that:"object"}, is: "not"}; - ok(!_.isEqual(a, b), "Comparison of circular references with non-circular object references are not equal"); - - // Cyclic Structures. - a = [{abc: null}]; - b = [{abc: null}]; - (a[0].abc = a).push(a); - (b[0].abc = b).push(b); - ok(_.isEqual(a, b), "Cyclic structures are equal"); - a[0].def = "Larry"; - b[0].def = "Larry"; - ok(_.isEqual(a, b), "Cyclic structures containing equivalent properties are equal"); - a[0].def = new String("Larry"); - b[0].def = new String("Curly"); - ok(!_.isEqual(a, b), "Cyclic structures containing different properties are not equal"); - - // Complex Circular References. - a = {foo: {b: {foo: {c: {foo: null}}}}}; - b = {foo: {b: {foo: {c: {foo: null}}}}}; - a.foo.b.foo.c.foo = a; - b.foo.b.foo.c.foo = b; - ok(_.isEqual(a, b), "Cyclic structures with nested and identically-named properties are equal"); - - // Chaining. - ok(!_.isEqual(_({x: 1, y: undefined}).chain(), _({x: 1, z: 2}).chain()), 'Chained objects containing different values are not equal'); - equal(_({x: 1, y: 2}).chain().isEqual(_({x: 1, y: 2}).chain()).value(), true, '`isEqual` can be chained'); - - // Custom `isEqual` methods. - var isEqualObj = {isEqual: function (o) { return o.isEqual == this.isEqual; }, unique: {}}; - var isEqualObjClone = {isEqual: isEqualObj.isEqual, unique: {}}; - - ok(_.isEqual(isEqualObj, isEqualObjClone), 'Both objects implement identical `isEqual` methods'); - ok(_.isEqual(isEqualObjClone, isEqualObj), 'Commutative equality is implemented for objects with custom `isEqual` methods'); - ok(!_.isEqual(isEqualObj, {}), 'Objects that do not implement equivalent `isEqual` methods are not equal'); - ok(!_.isEqual({}, isEqualObj), 'Commutative equality is implemented for objects with different `isEqual` methods'); - - // Objects from another frame. - ok(_.isEqual({}, iObject)); - }); - - test("isEmpty", function() { - ok(!_([1]).isEmpty(), '[1] is not empty'); - ok(_.isEmpty([]), '[] is empty'); - ok(!_.isEmpty({one : 1}), '{one : 1} is not empty'); - ok(_.isEmpty({}), '{} is empty'); - ok(_.isEmpty(new RegExp('')), 'objects with prototype properties are empty'); - ok(_.isEmpty(null), 'null is empty'); - ok(_.isEmpty(), 'undefined is empty'); - ok(_.isEmpty(''), 'the empty string is empty'); - ok(!_.isEmpty('moe'), 'but other strings are not'); - - var obj = {one : 1}; - delete obj.one; - ok(_.isEmpty(obj), 'deleting all the keys from an object empties it'); - }); - - // Setup remote variables for iFrame tests. - var iframe = document.createElement('iframe'); - jQuery(iframe).appendTo(document.body); - var iDoc = iframe.contentDocument || iframe.contentWindow.document; - iDoc.write( - "" - ); - iDoc.close(); - - test("isElement", function() { - ok(!_.isElement('div'), 'strings are not dom elements'); - ok(_.isElement($('html')[0]), 'the html tag is a DOM element'); - ok(_.isElement(iElement), 'even from another frame'); - }); - - test("isArguments", function() { - var args = (function(){ return arguments; })(1, 2, 3); - ok(!_.isArguments('string'), 'a string is not an arguments object'); - ok(!_.isArguments(_.isArguments), 'a function is not an arguments object'); - ok(_.isArguments(args), 'but the arguments object is an arguments object'); - ok(!_.isArguments(_.toArray(args)), 'but not when it\'s converted into an array'); - ok(!_.isArguments([1,2,3]), 'and not vanilla arrays.'); - ok(_.isArguments(iArguments), 'even from another frame'); - }); - - test("isObject", function() { - ok(_.isObject(arguments), 'the arguments object is object'); - ok(_.isObject([1, 2, 3]), 'and arrays'); - ok(_.isObject($('html')[0]), 'and DOM element'); - ok(_.isObject(iElement), 'even from another frame'); - ok(_.isObject(function () {}), 'and functions'); - ok(_.isObject(iFunction), 'even from another frame'); - ok(!_.isObject(null), 'but not null'); - ok(!_.isObject(undefined), 'and not undefined'); - ok(!_.isObject('string'), 'and not string'); - ok(!_.isObject(12), 'and not number'); - ok(!_.isObject(true), 'and not boolean'); - ok(_.isObject(new String('string')), 'but new String()'); - }); - - test("isArray", function() { - ok(!_.isArray(arguments), 'the arguments object is not an array'); - ok(_.isArray([1, 2, 3]), 'but arrays are'); - ok(_.isArray(iArray), 'even from another frame'); - }); - - test("isString", function() { - ok(!_.isString(document.body), 'the document body is not a string'); - ok(_.isString([1, 2, 3].join(', ')), 'but strings are'); - ok(_.isString(iString), 'even from another frame'); - }); - - test("isNumber", function() { - ok(!_.isNumber('string'), 'a string is not a number'); - ok(!_.isNumber(arguments), 'the arguments object is not a number'); - ok(!_.isNumber(undefined), 'undefined is not a number'); - ok(_.isNumber(3 * 4 - 7 / 10), 'but numbers are'); - ok(_.isNumber(NaN), 'NaN *is* a number'); - ok(_.isNumber(Infinity), 'Infinity is a number'); - ok(_.isNumber(iNumber), 'even from another frame'); - ok(!_.isNumber('1'), 'numeric strings are not numbers'); - }); - - test("isBoolean", function() { - ok(!_.isBoolean(2), 'a number is not a boolean'); - ok(!_.isBoolean("string"), 'a string is not a boolean'); - ok(!_.isBoolean("false"), 'the string "false" is not a boolean'); - ok(!_.isBoolean("true"), 'the string "true" is not a boolean'); - ok(!_.isBoolean(arguments), 'the arguments object is not a boolean'); - ok(!_.isBoolean(undefined), 'undefined is not a boolean'); - ok(!_.isBoolean(NaN), 'NaN is not a boolean'); - ok(!_.isBoolean(null), 'null is not a boolean'); - ok(_.isBoolean(true), 'but true is'); - ok(_.isBoolean(false), 'and so is false'); - ok(_.isBoolean(iBoolean), 'even from another frame'); - }); - - test("isFunction", function() { - ok(!_.isFunction([1, 2, 3]), 'arrays are not functions'); - ok(!_.isFunction('moe'), 'strings are not functions'); - ok(_.isFunction(_.isFunction), 'but functions are'); - ok(_.isFunction(iFunction), 'even from another frame'); - }); - - test("isDate", function() { - ok(!_.isDate(100), 'numbers are not dates'); - ok(!_.isDate({}), 'objects are not dates'); - ok(_.isDate(new Date()), 'but dates are'); - ok(_.isDate(iDate), 'even from another frame'); - }); - - test("isRegExp", function() { - ok(!_.isRegExp(_.identity), 'functions are not RegExps'); - ok(_.isRegExp(/identity/), 'but RegExps are'); - ok(_.isRegExp(iRegExp), 'even from another frame'); - }); - - test("isFinite", function() { - ok(!_.isFinite(undefined), 'undefined is not Finite'); - ok(!_.isFinite(null), 'null is not Finite'); - ok(!_.isFinite(NaN), 'NaN is not Finite'); - ok(!_.isFinite(Infinity), 'Infinity is not Finite'); - ok(!_.isFinite(-Infinity), '-Infinity is not Finite'); - ok(!_.isFinite('12'), 'Strings are not numbers'); - var obj = new Number(5); - ok(_.isFinite(obj), 'Number instances can be finite'); - ok(_.isFinite(0), '0 is Finite'); - ok(_.isFinite(123), 'Ints are Finite'); - ok(_.isFinite(-12.44), 'Floats are Finite'); - }); - - test("isNaN", function() { - ok(!_.isNaN(undefined), 'undefined is not NaN'); - ok(!_.isNaN(null), 'null is not NaN'); - ok(!_.isNaN(0), '0 is not NaN'); - ok(_.isNaN(NaN), 'but NaN is'); - ok(_.isNaN(iNaN), 'even from another frame'); - ok(_.isNaN(new Number(NaN)), 'wrapped NaN is still NaN'); - }); - - test("isNull", function() { - ok(!_.isNull(undefined), 'undefined is not null'); - ok(!_.isNull(NaN), 'NaN is not null'); - ok(_.isNull(null), 'but null is'); - ok(_.isNull(iNull), 'even from another frame'); - }); - - test("isUndefined", function() { - ok(!_.isUndefined(1), 'numbers are defined'); - ok(!_.isUndefined(null), 'null is defined'); - ok(!_.isUndefined(false), 'false is defined'); - ok(!_.isUndefined(NaN), 'NaN is defined'); - ok(_.isUndefined(), 'nothing is undefined'); - ok(_.isUndefined(undefined), 'undefined is undefined'); - ok(_.isUndefined(iUndefined), 'even from another frame'); - }); - - if (window.ActiveXObject) { - test("IE host objects", function() { - var xml = new ActiveXObject("Msxml2.DOMDocument.3.0"); - ok(!_.isNumber(xml)); - ok(!_.isBoolean(xml)); - ok(!_.isNaN(xml)); - ok(!_.isFunction(xml)); - ok(!_.isNull(xml)); - ok(!_.isUndefined(xml)); - }); - } - - test("tap", function() { - var intercepted = null; - var interceptor = function(obj) { intercepted = obj; }; - var returned = _.tap(1, interceptor); - equal(intercepted, 1, "passes tapped object to interceptor"); - equal(returned, 1, "returns tapped object"); - - returned = _([1,2,3]).chain(). - map(function(n){ return n * 2; }). - max(). - tap(interceptor). - value(); - ok(returned == 6 && intercepted == 6, 'can use tapped objects in a chain'); - }); -}); diff --git a/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/test/test_underscore/speed.js b/node_modules/grunt-istanbul/node_modules/istanbul/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-istanbul/node_modules/istanbul/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-istanbul/node_modules/istanbul/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/test/test_underscore/utility.js b/node_modules/grunt-istanbul/node_modules/istanbul/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-istanbul/node_modules/istanbul/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(""); - result = fancyTemplate({people : {moe : "Moe", larry : "Larry", curly : "Curly"}}); - equal(result, "", 'can run arbitrary javascript in templates'); - - var escapedCharsInJavascriptTemplate = _.template(""); - result = escapedCharsInJavascriptTemplate({numbers: "one\ntwo\nthree\nfour"}); - equal(result, "", '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-istanbul/node_modules/istanbul/node_modules/js-yaml/node_modules/argparse/node_modules/underscore/index.js b/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/js-yaml/node_modules/argparse/node_modules/underscore/index.js deleted file mode 100644 index 2cf0ca5..0000000 --- a/node_modules/grunt-istanbul/node_modules/istanbul/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-istanbul/node_modules/istanbul/node_modules/js-yaml/node_modules/argparse/node_modules/underscore/package.json b/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/js-yaml/node_modules/argparse/node_modules/underscore/package.json index 014ab26..11c7175 100644 --- a/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/js-yaml/node_modules/argparse/node_modules/underscore/package.json +++ b/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/js-yaml/node_modules/argparse/node_modules/underscore/package.json @@ -15,21 +15,55 @@ }, "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" }, - "readme": " __\n /\\ \\ __\n __ __ ___ \\_\\ \\ __ _ __ ____ ___ ___ _ __ __ /\\_\\ ____\n /\\ \\/\\ \\ /' _ `\\ /'_ \\ /'__`\\/\\ __\\/ ,__\\ / ___\\ / __`\\/\\ __\\/'__`\\ \\/\\ \\ /',__\\\n \\ \\ \\_\\ \\/\\ \\/\\ \\/\\ \\ \\ \\/\\ __/\\ \\ \\//\\__, `\\/\\ \\__//\\ \\ \\ \\ \\ \\//\\ __/ __ \\ \\ \\/\\__, `\\\n \\ \\____/\\ \\_\\ \\_\\ \\___,_\\ \\____\\\\ \\_\\\\/\\____/\\ \\____\\ \\____/\\ \\_\\\\ \\____\\/\\_\\ _\\ \\ \\/\\____/\n \\/___/ \\/_/\\/_/\\/__,_ /\\/____/ \\/_/ \\/___/ \\/____/\\/___/ \\/_/ \\/____/\\/_//\\ \\_\\ \\/___/\n \\ \\____/\n \\/___/\n\nUnderscore.js is a utility-belt library for JavaScript that provides\nsupport for the usual functional suspects (each, map, reduce, filter...)\nwithout extending any core JavaScript objects.\n\nFor Docs, License, Tests, and pre-packed downloads, see:\nhttp://underscorejs.org\n\nMany thanks to our contributors:\nhttps://github.com/documentcloud/underscore/contributors\n", - "readmeFilename": "README.md", + "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/documentcloud/underscore/issues" + "url": "https://github.com/jashkenas/underscore/issues" }, - "_id": "underscore@1.4.4", - "_from": "underscore@~1.4.3" + "_id": "underscore@1.7.0", + "_shasum": "6bbaf0877500d36be34ecaa584e0db9fef035209", + "_from": "underscore@>=1.7.0 <1.8.0", + "_npmVersion": "1.4.24", + "_npmUser": { + "name": "jashkenas", + "email": "jashkenas@gmail.com" + }, + "maintainers": [ + { + "name": "jashkenas", + "email": "jashkenas@gmail.com" + } + ], + "dist": { + "shasum": "6bbaf0877500d36be34ecaa584e0db9fef035209", + "tarball": "http://registry.npmjs.org/underscore/-/underscore-1.7.0.tgz" + }, + "directories": {}, + "_resolved": "https://registry.npmjs.org/underscore/-/underscore-1.7.0.tgz", + "readme": "ERROR: No README data found!" } diff --git a/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/js-yaml/node_modules/argparse/node_modules/underscore/underscore-min.js b/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/js-yaml/node_modules/argparse/node_modules/underscore/underscore-min.js index c1d9d3a..11f1d96 100644 --- a/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/js-yaml/node_modules/argparse/node_modules/underscore/underscore-min.js +++ b/node_modules/grunt-istanbul/node_modules/istanbul/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-istanbul/node_modules/istanbul/node_modules/js-yaml/node_modules/argparse/node_modules/underscore/underscore.js b/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/js-yaml/node_modules/argparse/node_modules/underscore/underscore.js index a12f0d9..b4f49a0 100644 --- a/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/js-yaml/node_modules/argparse/node_modules/underscore/underscore.js +++ b/node_modules/grunt-istanbul/node_modules/istanbul/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 _.find(obj, _.matches(attrs)); }; - // 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 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() { - 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; - }; - }; + 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); + 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,29 +1041,18 @@ } } } 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. + 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) { + while (size--) { + // Deep compare each member + key = keys[size]; 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(); @@ -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; }; - }); - - // 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; }; + _.escape = createEscaper(escapeMap); + _.unescape = createEscaper(unescapeMap); - // 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)); - }; - }); + // 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 void 0; + var value = object[property]; + 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, { + // Extracts the result from a wrapped and chained object. + _.prototype.value = function() { + return this._wrapped; + }; - // 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); + // 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-istanbul/node_modules/istanbul/node_modules/js-yaml/node_modules/argparse/package.json b/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/js-yaml/node_modules/argparse/package.json index 09382f8..b64aac3 100644 --- a/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/js-yaml/node_modules/argparse/package.json +++ b/node_modules/grunt-istanbul/node_modules/istanbul/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,17 +31,32 @@ "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" + "gitHead": "9c32eb1405d5d4b5686087d95bac010774979659", + "_id": "argparse@0.1.16", + "_shasum": "cfd01e0fbba3d6caed049fbd758d40f65196f57c", + "_from": "argparse@>=0.1.11 <0.2.0", + "_npmVersion": "1.4.28", + "_npmUser": { + "name": "vitaly", + "email": "vitaly@rcdesign.ru" }, - "readme": "argparse\n========\n\n[![Build Status](https://secure.travis-ci.org/nodeca/argparse.png?branch=master)](http://travis-ci.org/nodeca/argparse)\n\nCLI arguments parser for node.js. Javascript port of python's\n[argparse](http://docs.python.org/dev/library/argparse.html) module\n(original version 3.2). That's a full port, except some very rare options,\nrecorded in issue tracker.\n\n**NB.** Method names changed to camelCase. See [generated docs](http://nodeca.github.com/argparse/).\n\n\nExample\n=======\n\ntest.js file:\n\n```javascript\n#!/usr/bin/env node\n'use strict';\n\nvar ArgumentParser = require('../lib/argparse').ArgumentParser;\nvar parser = new ArgumentParser({\n version: '0.0.1',\n addHelp:true,\n description: 'Argparse example'\n});\nparser.addArgument(\n [ '-f', '--foo' ],\n {\n help: 'foo bar'\n }\n);\nparser.addArgument(\n [ '-b', '--bar' ],\n {\n help: 'bar foo'\n }\n);\nvar args = parser.parseArgs();\nconsole.dir(args);\n```\n\nDisplay help:\n\n```\n$ ./test.js -h\nusage: example.js [-h] [-v] [-f FOO] [-b BAR]\n\nArgparse example\n\nOptional arguments:\n -h, --help Show this help message and exit.\n -v, --version Show program's version number and exit.\n -f FOO, --foo FOO foo bar\n -b BAR, --bar BAR bar foo\n```\n\nParse arguments:\n\n```\n$ ./test.js -f=3 --bar=4\n{ foo: '3', bar: '4' }\n```\n\nMore [examples](https://github.com/nodeca/argparse/tree/master/examples).\n\n\nArgumentParser objects\n======================\n\n```\nnew ArgumentParser({paramters hash});\n```\n\nCreates a new ArgumentParser object.\n\n**Supported params:**\n\n- ```description``` - Text to display before the argument help.\n- ```epilog``` - Text to display after the argument help.\n- ```addHelp``` - Add a -h/–help option to the parser. (default: True)\n- ```argumentDefault``` - Set the global default value for arguments. (default: None)\n- ```parents``` - A list of ArgumentParser objects whose arguments should also be included.\n- ```prefixChars``` - The set of characters that prefix optional arguments. (default: ‘-‘)\n- ```formatterClass``` - A class for customizing the help output.\n- ```prog``` - The name of the program (default: sys.argv[0])\n- ```usage``` - The string describing the program usage (default: generated)\n- ```conflictHandler``` - Usually unnecessary, defines strategy for resolving conflicting optionals.\n\n**Not supportied yet**\n\n- ```fromfilePrefixChars``` - The set of characters that prefix files from which additional arguments should be read.\n\n\nDetails in [original ArgumentParser guide](http://docs.python.org/dev/library/argparse.html#argumentparser-objects)\n\n\naddArgument() method\n====================\n\n```\nArgumentParser.addArgument([names or flags], {options})\n```\n\nDefines how a single command-line argument should be parsed.\n\n- ```name or flags``` - Either a name or a list of option strings, e.g. foo or -f, --foo.\n\nOptions:\n\n- ```action``` - The basic type of action to be taken when this argument is encountered at the command line.\n- ```nargs```- The number of command-line arguments that should be consumed.\n- ```constant``` - A constant value required by some action and nargs selections.\n- ```defaultValue``` - The value produced if the argument is absent from the command line.\n- ```type``` - The type to which the command-line argument should be converted.\n- ```choices``` - A container of the allowable values for the argument.\n- ```required``` - Whether or not the command-line option may be omitted (optionals only).\n- ```help``` - A brief description of what the argument does.\n- ```metavar``` - A name for the argument in usage messages.\n- ```dest``` - The name of the attribute to be added to the object returned by parseArgs().\n\nDetails in [original add_argument guide](http://docs.python.org/dev/library/argparse.html#the-add-argument-method)\n\n\nAction (some details)\n================\n\nArgumentParser objects associate command-line arguments with actions.\nThese actions can do just about anything with the command-line arguments associated\nwith them, though most actions simply add an attribute to the object returned by\nparseArgs(). The action keyword argument specifies how the command-line arguments\nshould be handled. The supported actions are:\n\n- ```store``` - Just stores the argument’s value. This is the default action.\n- ```storeConst``` - Stores value, specified by the const keyword argument.\n (Note that the const keyword argument defaults to the rather unhelpful None.)\n The 'storeConst' action is most commonly used with optional arguments, that\n specify some sort of flag.\n- ```storeTrue``` and ```storeFalse``` - Stores values True and False\n respectively. These are special cases of 'storeConst'.\n- ```append``` - Stores a list, and appends each argument value to the list.\n This is useful to allow an option to be specified multiple times.\n- ```appendConst``` - Stores a list, and appends value, specified by the\n const keyword argument to the list. (Note, that the const keyword argument defaults\n is None.) The 'appendConst' action is typically used when multiple arguments need\n to store constants to the same list.\n- ```count``` - Counts the number of times a keyword argument occurs. For example,\n used for increasing verbosity levels.\n- ```help``` - Prints a complete help message for all the options in the current\n parser and then exits. By default a help action is automatically added to the parser.\n See ArgumentParser for details of how the output is created.\n- ```version``` - Prints version information and exit. Expects a `version=`\n keyword argument in the addArgument() call.\n\nDetails in [original action guide](http://docs.python.org/dev/library/argparse.html#action)\n\n\nSub-commands\n============\n\nArgumentParser.addSubparsers()\n\nMany programs split their functionality into a number of sub-commands, for\nexample, the svn program can invoke sub-commands like `svn checkout`, `svn update`,\nand `svn commit`. Splitting up functionality this way can be a particularly good\nidea when a program performs several different functions which require different\nkinds of command-line arguments. `ArgumentParser` supports creation of such\nsub-commands with `addSubparsers()` method. The `addSubparsers()` method is\nnormally called with no arguments and returns an special action object.\nThis object has a single method `addParser()`, which takes a command name and\nany `ArgumentParser` constructor arguments, and returns an `ArgumentParser` object\nthat can be modified as usual.\n\nExample:\n\nsub_commands.js\n```javascript\n#!/usr/bin/env node\n'use strict';\n\nvar ArgumentParser = require('../lib/argparse').ArgumentParser;\nvar parser = new ArgumentParser({\n version: '0.0.1',\n addHelp:true,\n description: 'Argparse examples: sub-commands',\n});\n\nvar subparsers = parser.addSubparsers({\n title:'subcommands',\n dest:\"subcommand_name\"\n});\n\nvar bar = subparsers.addParser('c1', {addHelp:true});\nbar.addArgument(\n [ '-f', '--foo' ],\n {\n action: 'store',\n help: 'foo3 bar3'\n }\n);\nvar bar = subparsers.addParser(\n 'c2',\n {aliases:['co'], addHelp:true}\n);\nbar.addArgument(\n [ '-b', '--bar' ],\n {\n action: 'store',\n type: 'int',\n help: 'foo3 bar3'\n }\n);\n\nvar args = parser.parseArgs();\nconsole.dir(args);\n\n```\n\nDetails in [original sub-commands guide](http://docs.python.org/dev/library/argparse.html#sub-commands)\n\n\nContributors\n============\n\n- [Eugene Shkuropat](https://github.com/shkuropat)\n- [Paul Jacobson](https://github.com/hpaulj)\n\n[others](https://github.com/nodeca/argparse/graphs/contributors)\n\nLicense\n=======\n\nCopyright (c) 2012 [Vitaly Puzrin](https://github.com/puzrin).\nReleased under the MIT license. See\n[LICENSE](https://github.com/nodeca/argparse/blob/master/LICENSE) for details.\n\n\n", - "readmeFilename": "README.md", - "_id": "argparse@0.1.15", - "_from": "argparse@~ 0.1.11" + "maintainers": [ + { + "name": "vitaly", + "email": "vitaly@rcdesign.ru" + } + ], + "dist": { + "shasum": "cfd01e0fbba3d6caed049fbd758d40f65196f57c", + "tarball": "http://registry.npmjs.org/argparse/-/argparse-0.1.16.tgz" + }, + "directories": {}, + "_resolved": "https://registry.npmjs.org/argparse/-/argparse-0.1.16.tgz", + "readme": "ERROR: No README data found!" } diff --git a/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/js-yaml/node_modules/esprima/package.json b/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/js-yaml/node_modules/esprima/package.json index 9a2294a..b1c65c5 100644 --- a/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/js-yaml/node_modules/esprima/package.json +++ b/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/js-yaml/node_modules/esprima/package.json @@ -55,5 +55,5 @@ "url": "https://github.com/ariya/esprima/issues" }, "_id": "esprima@1.0.4", - "_from": "esprima@~ 1.0.2" + "_from": "esprima@>=1.0.2 <1.1.0" } diff --git a/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/js-yaml/package.json b/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/js-yaml/package.json index 1c32464..c698c72 100644 --- a/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/js-yaml/package.json +++ b/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/js-yaml/package.json @@ -1,6 +1,6 @@ { "name": "js-yaml", - "version": "3.2.3", + "version": "3.2.5", "description": "YAML 1.2 parser and serializer", "keywords": [ "yaml", @@ -57,11 +57,11 @@ "browser": { "buffer": false }, - "gitHead": "a6cd5657603496c7128d3b9fa621ce9274283194", - "_id": "js-yaml@3.2.3", + "gitHead": "8a73181030e075b208c8f4065a4888a786365ae2", + "_id": "js-yaml@3.2.5", "scripts": {}, - "_shasum": "a3af632d13df5bfa95f3b8f3c4b61efe212cd750", - "_from": "js-yaml@3.x", + "_shasum": "c29ee9a9e503e7ab83f071ccacdd0dac25ff9e22", + "_from": "js-yaml@>=3.0.0 <4.0.0", "_npmVersion": "1.4.28", "_npmUser": { "name": "vitaly", @@ -74,9 +74,10 @@ } ], "dist": { - "shasum": "a3af632d13df5bfa95f3b8f3c4b61efe212cd750", - "tarball": "http://registry.npmjs.org/js-yaml/-/js-yaml-3.2.3.tgz" + "shasum": "c29ee9a9e503e7ab83f071ccacdd0dac25ff9e22", + "tarball": "http://registry.npmjs.org/js-yaml/-/js-yaml-3.2.5.tgz" }, "directories": {}, - "_resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.2.3.tgz" + "_resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.2.5.tgz", + "readme": "ERROR: No README data found!" } diff --git a/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/mkdirp/package.json b/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/mkdirp/package.json index b7fe466..54d87e7 100644 --- a/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/mkdirp/package.json +++ b/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/mkdirp/package.json @@ -39,7 +39,7 @@ "shasum": "1d73076a6df986cd9344e15e71fcc05a4c9abf12", "tarball": "http://registry.npmjs.org/mkdirp/-/mkdirp-0.5.0.tgz" }, - "_from": "mkdirp@0.5.x", + "_from": "mkdirp@>=0.5.0 <0.6.0", "_npmVersion": "1.4.3", "_npmUser": { "name": "substack", diff --git a/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/nopt/package.json b/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/nopt/package.json index 4cda2c4..4b1f700 100644 --- a/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/nopt/package.json +++ b/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/nopt/package.json @@ -35,7 +35,7 @@ "homepage": "https://github.com/isaacs/nopt", "_id": "nopt@3.0.1", "_shasum": "bce5c42446a3291f47622a370abbf158fbbacbfd", - "_from": "nopt@3.x", + "_from": "nopt@>=3.0.0 <4.0.0", "_npmVersion": "1.4.18", "_npmUser": { "name": "isaacs", diff --git a/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/resolve/package.json b/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/resolve/package.json index cb1a7e4..3d79a60 100644 --- a/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/resolve/package.json +++ b/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/resolve/package.json @@ -32,7 +32,7 @@ "homepage": "https://github.com/substack/node-resolve", "_id": "resolve@0.7.4", "_shasum": "395a9ef9e873fbfe12bd14408bd91bb936003d69", - "_from": "resolve@0.7.x", + "_from": "resolve@>=0.7.0 <0.8.0", "_npmVersion": "1.4.21", "_npmUser": { "name": "substack", diff --git a/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/which/LICENSE b/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/which/LICENSE index 05a4010..19129e3 100644 --- a/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/which/LICENSE +++ b/node_modules/grunt-istanbul/node_modules/istanbul/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-istanbul/node_modules/istanbul/node_modules/which/package.json b/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/which/package.json index 0fd9657..56acacd 100644 --- a/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/which/package.json +++ b/node_modules/grunt-istanbul/node_modules/istanbul/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.8", "repository": { "type": "git", "url": "git://github.com/isaacs/node-which.git" @@ -15,17 +15,33 @@ "bin": { "which": "./bin/which" }, - "engines": { - "node": "*" - }, - "dependencies": {}, - "devDependencies": {}, - "readme": "The \"which\" util from npm's guts.\n\nFinds the first instance of a specified executable in the PATH\nenvironment variable. Does not cache the results, so `hash -r` is not\nneeded when the PATH changes.\n", - "readmeFilename": "README.md", + "license": "ISC", + "gitHead": "681a9ebbc447cb428232ddf6c0983006d89e7755", "bugs": { "url": "https://github.com/isaacs/node-which/issues" }, "homepage": "https://github.com/isaacs/node-which", - "_id": "which@1.0.5", - "_from": "which@1.0.x" + "_id": "which@1.0.8", + "scripts": {}, + "_shasum": "c2ff319534ac4a1fa45df2221b56c36279903ded", + "_from": "which@>=1.0.0 <1.1.0", + "_npmVersion": "2.1.11", + "_nodeVersion": "0.10.16", + "_npmUser": { + "name": "isaacs", + "email": "i@izs.me" + }, + "maintainers": [ + { + "name": "isaacs", + "email": "i@izs.me" + } + ], + "dist": { + "shasum": "c2ff319534ac4a1fa45df2221b56c36279903ded", + "tarball": "http://registry.npmjs.org/which/-/which-1.0.8.tgz" + }, + "directories": {}, + "_resolved": "https://registry.npmjs.org/which/-/which-1.0.8.tgz", + "readme": "ERROR: No README data found!" } diff --git a/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/which/which.js b/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/which/which.js index db7e8f7..f19dd33 100644 --- a/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/which/which.js +++ b/node_modules/grunt-istanbul/node_modules/istanbul/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 diff --git a/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/wordwrap/package.json b/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/wordwrap/package.json index a034188..1f88554 100644 --- a/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/wordwrap/package.json +++ b/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/wordwrap/package.json @@ -41,5 +41,5 @@ }, "homepage": "https://github.com/substack/node-wordwrap", "_id": "wordwrap@0.0.2", - "_from": "wordwrap@0.0.x" + "_from": "wordwrap@>=0.0.0 <0.1.0" } diff --git a/node_modules/grunt-istanbul/node_modules/istanbul/package.json b/node_modules/grunt-istanbul/node_modules/istanbul/package.json index 4fc131c..aeb4b6b 100644 --- a/node_modules/grunt-istanbul/node_modules/istanbul/package.json +++ b/node_modules/grunt-istanbul/node_modules/istanbul/package.json @@ -211,7 +211,7 @@ "homepage": "https://github.com/gotwarlost/istanbul", "_id": "istanbul@0.2.16", "_shasum": "870545a0d4f4b4ce161039e9e805a98c2c700bd9", - "_from": "istanbul@0.2.16", + "_from": "istanbul@>=0.2.3 <0.3.0", "_npmVersion": "1.4.16", "_npmUser": { "name": "gotwarlost", diff --git a/node_modules/grunt-istanbul/node_modules/nue/package.json b/node_modules/grunt-istanbul/node_modules/nue/package.json index b676983..e57cb92 100644 --- a/node_modules/grunt-istanbul/node_modules/nue/package.json +++ b/node_modules/grunt-istanbul/node_modules/nue/package.json @@ -38,6 +38,10 @@ ], "directories": {}, "_shasum": "f55c3624e2d53257ed67bee545d9e0c1bd915ff8", + "_resolved": "https://registry.npmjs.org/nue/-/nue-0.7.0dev.tgz", "_from": "nue@0.7.0-dev", - "_resolved": "https://registry.npmjs.org/nue/-/nue-0.7.0dev.tgz" + "bugs": { + "url": "https://github.com/nakamura-to/nue/issues" + }, + "homepage": "https://github.com/nakamura-to/nue" } diff --git a/node_modules/grunt-istanbul/package.json b/node_modules/grunt-istanbul/package.json index 80490aa..3a91e51 100644 --- a/node_modules/grunt-istanbul/package.json +++ b/node_modules/grunt-istanbul/package.json @@ -1,7 +1,7 @@ { "name": "grunt-istanbul", "description": "JavaScript codecoverage tool for Grunt", - "version": "0.3.0", + "version": "0.4.0", "homepage": "https://github.com/taichi/grunt-istanbul", "author": { "name": "taichi", @@ -20,6 +20,10 @@ { "name": "rowanbeentje", "email": "rowan@beent.je" + }, + { + "name": "Martin Geisler", + "email": "martin@geisler.net" } ], "repository": { @@ -46,6 +50,7 @@ "test": "grunt test" }, "dependencies": { + "chalk": "~0.5.1", "istanbul": "~0.2.3", "nue": "0.7.0-dev" }, @@ -69,8 +74,8 @@ "JS coverage", "istanbul" ], - "_id": "grunt-istanbul@0.3.0", - "_shasum": "663166d06dd7f598e42cc702e8a6cc116ebc810d", + "_id": "grunt-istanbul@0.4.0", + "_shasum": "33d1ae29919b434c8e8337598e6e9a24c1d70a30", "_from": "grunt-istanbul@*", "_npmVersion": "1.4.9", "_npmUser": { @@ -84,9 +89,10 @@ } ], "dist": { - "shasum": "663166d06dd7f598e42cc702e8a6cc116ebc810d", - "tarball": "http://registry.npmjs.org/grunt-istanbul/-/grunt-istanbul-0.3.0.tgz" + "shasum": "33d1ae29919b434c8e8337598e6e9a24c1d70a30", + "tarball": "http://registry.npmjs.org/grunt-istanbul/-/grunt-istanbul-0.4.0.tgz" }, "directories": {}, - "_resolved": "https://registry.npmjs.org/grunt-istanbul/-/grunt-istanbul-0.3.0.tgz" + "_resolved": "https://registry.npmjs.org/grunt-istanbul/-/grunt-istanbul-0.4.0.tgz", + "readme": "ERROR: No README data found!" } diff --git a/node_modules/grunt-istanbul/tasks/helpers.js b/node_modules/grunt-istanbul/tasks/helpers.js index 525d42a..775dd61 100644 --- a/node_modules/grunt-istanbul/tasks/helpers.js +++ b/node_modules/grunt-istanbul/tasks/helpers.js @@ -1,6 +1,8 @@ exports.init = function(grunt) { 'use strict'; + var chalk = require('chalk'); + var fs = require('fs'); var path = require('path'); @@ -12,8 +14,6 @@ exports.init = function(grunt) { function flowEnd(err, done) { if (err) { grunt.fail.fatal(err); - } else { - grunt.log.ok(); } done(); } @@ -61,34 +61,29 @@ exports.init = function(grunt) { return path.join(options.basePath, options.flatten === true ? path.basename(file) : file); }; - var instFlow = flow(function readFile(f) { - fs.readFile(f.name, 'utf8', this.async({ - name : f.name, - code : as(1) - })); - }, function instrument(f) { - grunt.verbose.writeln('instrument from ' + f.name); + var tally = { instrumented : 0, skipped : 0 }; + + var instFlow = flow( + function instrumentFile(f) { + var code = grunt.file.read(f.name); var instrumenter = new istanbul.Instrumenter(options); - instrumenter.instrument(f.code, f.name, this.async({ + instrumenter.instrument(code, f.name, this.async({ name : f.name, code : as(1) })); }, function write(result) { var out = outFile(result.name); - grunt.verbose.writeln('instrument to ' + out); - grunt.file.mkdir(path.dirname(out)); - fs.writeFile(out, result.code, 'utf8', this.async(as(1))); + grunt.file.write(out, result.code); + tally.instrumented++; + this.next(); }, function end() { flowEnd(this.err, this.next.bind(this)); }); - var dateCheckFlow = flow(function checkDestExists(f) { - grunt.verbose.writeln('checking destination exists ' + f.name); - fs.exists(outFile(f.name), this.async({ name : f.name, exists : as(0) })); - }, + var dateCheckFlow = flow( function readStat(f) { - if (f.exists) { - grunt.verbose.writeln('reading stat for ' + f.name); + if (grunt.file.exists(f.name)) { + grunt.log.debug('reading stat for ' + f.name); fs.stat(f.name, this.async({ name : f.name, stat : as(1) })); fs.stat(outFile(f.name), this.async({ name : f.name, stat : as(1) })); } else { @@ -97,12 +92,13 @@ exports.init = function(grunt) { } }, function decision(i, o) { var reinstrument = i.stat.mtime.getTime() > o.stat.mtime.getTime(); - grunt.verbose.writeln('make a decision about instrumenting ' + i.name + ': ' + reinstrument); + grunt.log.debug('make a decision about instrumenting ' + i.name + ': ' + reinstrument); this.end({ name: i.name, instrument: reinstrument }); }, function end(f) { if (f.instrument) { this.exec(instFlow, { name : f.name }, this.async()); } else { + tally.skipped++; flowEnd(this.err, this.next.bind(this)); } }); @@ -111,27 +107,31 @@ exports.init = function(grunt) { this.asyncEach(filelist, function(file, group) { this.exec((options.lazy ? dateCheckFlow : instFlow), { name : file }, group.async(as(1))); }); + }, function outputSummary() { + grunt.log.write('Instrumented ' + chalk.cyan(tally.instrumented) + ' ' + + grunt.util.pluralize(tally.instrumented, 'file/files')); + if (options.lazy) { + grunt.log.write(' (skipped ' + chalk.cyan(tally.skipped) + ' ' + + grunt.util.pluralize(tally.skipped, 'file/files') + ')'); + } + grunt.log.writeln(); + this.next(); }, done)(files); }, storeCoverage : function(coverage, options, done) { flow(function write_json(cov) { var json = path.resolve(options.dir, options.json); - grunt.file.mkdir(path.dirname(json)); - fs.writeFile(json, JSON.stringify(cov), 'utf8', this.async(as(1))); + grunt.file.write(json, JSON.stringify(cov)); + this.next(); }, function() { flowEnd(this.err, done); })(coverage); }, makeReport : function(files, options, done) { flow(function(filelist) { - this.asyncEach(filelist, function(file, group) { - grunt.verbose.writeln('read from ' + file); - fs.readFile(file, 'utf8', group.async(as(1))); - }); - }, function report(list) { var collector = new istanbul.Collector(); - list.forEach(function(json) { - collector.add(JSON.parse(json)); + filelist.forEach(function(file) { + collector.add(grunt.file.readJSON(file)); }); makeReporters(options).forEach(function(repoDef) { var reporter = istanbul.Report.create(repoDef.type, repoDef.options); diff --git a/node_modules/grunt-istanbul/tasks/istanbul.js b/node_modules/grunt-istanbul/tasks/istanbul.js index b2e1db4..7783950 100644 --- a/node_modules/grunt-istanbul/tasks/istanbul.js +++ b/node_modules/grunt-istanbul/tasks/istanbul.js @@ -1,65 +1,62 @@ -/* - * grunt-istanbul - * https://github.com/taichi/grunt-istanbul - * - * Copyright (c) 2012 taichi - * Licensed under the MIT license. - */ -module.exports = function(grunt) { - 'use strict'; - - var helper = require('./helpers').init(grunt); - grunt - .registerTask('instrument', 'instruments a file or a directory tree', - function(target) { - var key = 'instrument.files'; - this.requiresConfig(key); - var files = grunt.config(key); - var options = this.options({ - basePath : 'build/instrument/', - flatten : false - }); - grunt.verbose.writeflags(options, 'Options'); - helper.instrument(grunt.file.expand(files), options, this - .async()); - }); - - grunt.registerTask('reloadTasks', 'override instrumented tasks', function( - target) { - var key = 'reloadTasks.rootPath'; - this.requiresConfig(key); - var path = grunt.config(key); - grunt.verbose.writeln('Tasks from ' + path); - grunt.loadTasks(path); - grunt.log.ok(); - }); - - grunt.registerTask('storeCoverage', 'store coverage from global', function( - target) { - var options = this.options({ - dir : 'build/reports/', - json : 'coverage.json', - coverageVar : '__coverage__' - }); - grunt.verbose.writeflags(options, 'Options'); - if (global[options.coverageVar]) { - helper.storeCoverage(global[options.coverageVar], options, this.async()); - } else { - grunt.fail.fatal('No coverage information was collected'); - } - }); - - grunt.registerTask('makeReport', 'make coverage report', function(target) { - var key = 'makeReport.src'; - this.requiresConfig(key); - var files = grunt.config(key); - var options = this.options({ - reporters : {}, - type : 'lcov', - dir : 'build/reports/', - print : 'none' - }); - grunt.verbose.writeflags(options, 'Options'); - helper.makeReport(grunt.file.expand(files), options, this.async()); - }); -}; +/* + * grunt-istanbul + * https://github.com/taichi/grunt-istanbul + * + * Copyright (c) 2012 taichi + * Licensed under the MIT license. + */ +module.exports = function(grunt) { + 'use strict'; + + var helper = require('./helpers').init(grunt); + grunt + .registerTask('instrument', 'instruments a file or a directory tree', + function(target) { + var key = 'instrument.files'; + this.requiresConfig(key); + var files = grunt.config(key); + var options = this.options({ + basePath : 'build/instrument/', + flatten : false + }); + helper.instrument(grunt.file.expand(files), options, this + .async()); + }); + + grunt.registerTask('reloadTasks', 'override instrumented tasks', function( + target) { + var key = 'reloadTasks.rootPath'; + this.requiresConfig(key); + var path = grunt.config(key); + grunt.verbose.writeln('Tasks from ' + path); + grunt.loadTasks(path); + grunt.log.ok(); + }); + + grunt.registerTask('storeCoverage', 'store coverage from global', function( + target) { + var options = this.options({ + dir : 'build/reports/', + json : 'coverage.json', + coverageVar : '__coverage__' + }); + if (global[options.coverageVar]) { + helper.storeCoverage(global[options.coverageVar], options, this.async()); + } else { + grunt.fail.fatal('No coverage information was collected'); + } + }); + + grunt.registerTask('makeReport', 'make coverage report', function(target) { + var key = 'makeReport.src'; + this.requiresConfig(key); + var files = grunt.config(key); + var options = this.options({ + reporters : {}, + type : 'lcov', + dir : 'build/reports/', + print : 'none' + }); + helper.makeReport(grunt.file.expand(files), options, this.async()); + }); +}; diff --git a/node_modules/jsdoc/.editorconfig b/node_modules/jsdoc/.editorconfig new file mode 100644 index 0000000..c035c9f --- /dev/null +++ b/node_modules/jsdoc/.editorconfig @@ -0,0 +1,12 @@ +[*] +charset = utf-8 +insert_final_newline = true +trim_trailing_whitespace = true + +[package.json] +indent_style = space +indent_size = 2 + +[{**/*.js,**/*.css,**/*.json}] +indent_style = space +indent_size = 4 diff --git a/node_modules/jsdoc/changes.md b/node_modules/jsdoc/CHANGES.md similarity index 65% rename from node_modules/jsdoc/changes.md rename to node_modules/jsdoc/CHANGES.md index fc832d8..cbd92a4 100644 --- a/node_modules/jsdoc/changes.md +++ b/node_modules/jsdoc/CHANGES.md @@ -2,6 +2,94 @@ This file describes notable changes in each version of JSDoc 3. To download a specific version of JSDoc 3, see [GitHub's tags page](https://github.com/jsdoc3/jsdoc/tags). +## 3.3.0 (January 2015) + +**Note**: This draft changelog is current through January 21, 2015, and is subject to change before JSDoc 3.3.0 is released. + +### Major changes ++ You can now run JSDoc on Node.js. (#93) ++ You can now use the `@interface` and `@implements` tags to document interfaces and their implementations. (#720, #828) ++ Closure Compiler's `@inheritDoc` and `@override` tags are now supported. (#53) ++ If the JSDoc comment for a symbol includes the `@mixes` tag, all of the mixins now appear in the symbol's documentation. (#378) ++ JSDoc can now log information to the console as it runs (for example, the name of each file that JSDoc parses). To log this information, run JSDoc with the `--verbose` flag. (#416) ++ You can now use any file as the package or README file for your documentation. Use the `-P/--package/` and `-R/--readme` flags to specify the package and README file. (#708) ++ The default template's typography and color scheme have been significantly improved. (#550, #780, #843) + +### Enhancements ++ You can now use the `--pedantic` flag to treat all errors as fatal errors, and to treat warnings as errors. This flag replaces the `--lenient` flag, which had roughly the opposite meaning and is no longer available. (#416) ++ You can now use the `-a/--access` flag to control whether private, protected, and public symbols appear in the documentation. (#860, #861) ++ You can now use the `--debug` flag to log detailed debugging information to the console. This information can help you diagnose bugs in JSDoc itself. (#416) ++ JSDoc's configuration file can now contain JavaScript comments. (#660) ++ You can now include source files from a directory, but exclude one of its subdirectories, by adding the subdirectory to the `source.exclude` option in the configuration file. (#484) ++ The `source.exclude` option now works correctly when JSDoc is run with the `-r/--recurse` flag. (#616) ++ When JSDoc is run with the `-r/--recurse` flag, it now scans for tutorials recursively. (#712) ++ JSDoc's `-X/--explain` option now runs much more quickly. (#633) ++ If all of the text for an `@example` tag is indented, JSDoc now removes the extra indentation. (#540) ++ The default value for a parameter or property can now include brackets (for example, `@param {Array.} [foo=['bar']]`). (#640) ++ You can now provide a default value for parameters and properties that are not optional (for example, `@property {string} foo='bar'`). (#791) ++ If the `@type` tag includes a description (for example, `@type {string} some text`), JSDoc now parses the type expression correctly and discards the description. (#615) ++ You can now add JSDoc comments to function parameters. (#473) ++ For Closure Compiler projects, you can now enable a Closure Compiler-specific tag dictionary that more closely matches Closure Compiler's semantics. To enable Closure Compiler semantics, set the configuration file's `tags.dictionaries` option to `['closure']`. This option can contain the values `jsdoc`, `closure`, or both. If multiple dictionaries are enabled, and a tag is defined in more than one dictionary, JSDoc uses the definition from the first dictionary that contains the tag. (#729, #730, #731, #732) ++ If one symbol overrides another, JSDoc now adds an `overrides` property to the doclet that is overriding another. The `overrides` property contains the longname of the overridden symbol. (#792) ++ When a JSDoc tag contains a type expression, the doclet's `type` object now includes a hidden `parsedType` property. The `parsedType` property contains a syntax tree that represents the type expression. The syntax tree is generated by [Catharsis](https://github.com/hegemonic/catharsis), and its format may change in the future. (#576) ++ JSDoc now allows output filenames to contain non-ASCII characters. In addition, links to output files are now URL-encoded when necessary. (#677) ++ JSDoc now ensures that output filenames do not have a leading underscore. (#758) ++ JSDoc now tries to ensure that `id` attributes in output files are unique within that file. (#539) ++ JSDoc now has an up-to-date JSON Schema file for parse results. The schema file is available in `lib/jsdoc/schema.js`. (#327) ++ JSDoc now extracts more information from package files. (#710) ++ JSDoc now displays usage information if you run JSDoc without any input files, or with an unrecognized command-line option. (#609, #840) + +### Bug fixes ++ When the `allowUnknownTags` option is set to `false`, JSDoc no longer logs warnings about the presence of `@also` and `@scope` tags. (#574) ++ Fixed several errors when parsing type expressions. (#619, #644, #652, #705, #767) ++ Properties added to the `module.exports` object can now be documented. (#500) ++ When a symbol's name starts with the same characters as its parent namespace (such as `Vector` in `V.Vector`), JSDoc now assigns the correct longname to the symbol. (#608) ++ If a child class inherits from multiple parent classes, and the parent classes have instance members with the same name, the child class no longer displays the documentation from both parent classes. (#613) ++ If a source file contains an object literal, and one of the property names is a whitespace character or a character that must be escaped in a regular expression, JSDoc now parses the file successfully. (#549, #775) ++ Virtual comments now work correctly for overloaded functions. (#727) ++ When a virtual comment appears within a module, JSDoc now assigns the correct values to the virtual comment doclet's `memberof`, `longname`, and `scope` properties. (#631) ++ JSDoc now sets the `scope` property to `global` for all global doclets. (#684) ++ Module doclets no longer have a `scope` property. (#782) ++ In Markdown tutorials, JSDoc no longer unescapes HTML entities. (#743) ++ If a longname includes a variation (for example, `Foo#bar(variation)`), the link text is now preserved when generating HTML links. (#857) ++ When a single JSDoc comment includes `@class`, `@classdesc`, and `@constructor` tags, JSDoc no longer ignores the value of the `@classdesc` tag. (#806) ++ For tags where the name and type are both optional (`@constant`, `@external`, `@member`, `@module`, `@namespace`, and `@param`), JSDoc now parses the tag correctly when it includes a type but not a name. (#351, #535) ++ The `@default` tag now works correctly when used with an array literal. (#604) ++ The `@enum` tag now works correctly when the enumeration is part of a chain of assignments (for example, `var FOO = exports.FOO = {/* enumerated values */}`). (#702) ++ The `@exports` and `@module` tags now work correctly when their value includes a `module:` namespace (for example, `@exports module:foo`). (#786) ++ The `@memberof` tag now works correctly when it refers to a module that is defined in a separate file. (#880) ++ The `@variation` tag now works correctly when its value is enclosed in parentheses (for example, `@variation (foo)`). (#850) + +### Plugins ++ Tag definitions can now have a `mustNotHaveDescription` property. When this property is set to `true`, JSDoc will warn the user if the tag text includes a description (such as `The description` in `@param {string} foo - The description`). (#615) ++ Tag definitions can now call the method `dictionary.normalize`, which is a synonym for `dictionary.normalise`. (#884) ++ The Markdown plugin no longer prevents inline `{@link}` tags from working. (#518) ++ The Markdown plugin now converts `@author` and `@throws` tag values to HTML by default. (#736, #878) ++ JSDoc now includes a `summarize` plugin that automatically generates summaries based on the description. (#485) ++ JSDoc now includes an `underscore` plugin that finds symbols whose names begin with an underscore and automatically tags them as `@private`. (#471) ++ Plugins can now replace the `doclet` property of `newDoclet` events. (#584) + +### Template improvements ++ You can now override the default template's main layout file, `layout.tmpl`, by setting the `templates.default.layoutFile` option in JSDoc's configuration file. The property can contain a relative or absolute path to the replacement for `layout.tmpl`. Relative paths are resolved against the path to the configuration file; the current working directory; and the JSDoc directory, in that order. (#480) ++ When the `templates.default.outputSourceFiles` option is set to `false`, the documentation no longer shows the path to each source file. (#571) ++ You can now use the property `templates.default.staticFiles.include` to list files that will be copied to the output directory. For backwards compatibility, the property `templates.default.staticFiles.paths` is also supported but is deprecated. (#785) ++ The `templates.default.staticFiles` options now work correctly on Windows. (#785) ++ Output files no longer show the default value for members of an enumeration. (#689) ++ In certain types of AMD modules, the module-overview section is no longer duplicated. (#853) ++ If a constructor is assigned to `module.exports`, the value of the `@classdesc` tag now appears in the documentation. (#740) ++ If a constructor is assigned to `module.exports`, and the constructor inherits from another class, the parent class is now listed in the documentation. (#594) ++ Text within an `@example` tag, including HTML tags, is now properly escaped. (#511) ++ If a member has a `@fires` tag, the tag information now appears in the documentation. (#568) ++ If a symbol has members that use the `@mixin` tag, the mixins are now listed in the documentation. (#379, #602) ++ When multiple `@param` tags are used to document properties of array values (for example, `@param {Object[]} foo` and `@param {string} foo[].bar`), the properties are now grouped into the appropriate row of the parameters table. (#870) ++ If a member has a `@requires` tag, the tag information now appears in the documentation. (#563) ++ Type expressions are now presented more clearly. (#618) ++ Pretty-printed source files now include line numbers. (#532) ++ When you run JSDoc with a single input file, the full path to the file no longer appears in the documentation. (#553) ++ When an overloaded function is assigned to `module.exports`, the documentation now displays all of the signatures for the overloaded function. (#727) ++ Resolved several issues that caused the default template to generate invalid HTML. (#843) + + ## 3.2.2 (November 2013) ### Bug fixes @@ -12,6 +100,7 @@ This file describes notable changes in each version of JSDoc 3. To download a sp + If a function accepts a parameter named `prototype`, the parameter is no longer renamed during parsing. (#505) + If the list of input files includes relative paths, the paths are now resolved relative to the user's working directory. (a3d33842) + ## 3.2.1 (October 2013) ### Enhancements @@ -43,6 +132,7 @@ This file describes notable changes in each version of JSDoc 3. To download a sp + If a `@default` tag is added to a symbol whose default value is an object, the value is now displayed in the output file. (#419) + Output files now identify symbols as "abstract" rather than "virtual." (#432) + ## 3.2.0 (May 2013) ### Major changes @@ -101,6 +191,7 @@ This file describes notable changes in each version of JSDoc 3. To download a sp + The "Classes" header is no longer repeated in the navigation bar. (#361) + When the only documented symbols in global scope are type definitions, you can now click the "Global" header to view their documentation. (#261) + ## 3.1.1 (February 2013) + Resolved a crash when no input files contain JSDoc comments. (#329) @@ -114,6 +205,7 @@ This file describes notable changes in each version of JSDoc 3. To download a sp + `getSignatureTypes` + `linkto` + ## 3.1.0 (January 2013) ### Major changes @@ -218,6 +310,7 @@ This file describes notable changes in each version of JSDoc 3. To download a sp + Members are now contained in arrays rather than objects, allowing overloaded members to be documented. (#153) + A clearer error message is now provided when the output destination is not specified correctly. (#174) + ## 3.0.1 (June 2012) ### Enhancements @@ -235,6 +328,7 @@ This file describes notable changes in each version of JSDoc 3. To download a sp + The default template now sorts classes by name correctly when the classes come from several modules. (4ce17195) + The Haruki template now correctly supports `@example`, `@members`, and `@returns` tags. (6580e176, 59655252, 31c8554d) + ## 3.0.0 (May 2012) Initial release. diff --git a/node_modules/jsdoc/LICENSE.md b/node_modules/jsdoc/LICENSE.md index 051763a..ace2936 100644 --- a/node_modules/jsdoc/LICENSE.md +++ b/node_modules/jsdoc/LICENSE.md @@ -4,7 +4,7 @@ JSDoc 3 is free software, licensed under the Apache License, Version 2.0 (the "License"). Commercial and non-commercial use are permitted in compliance with the License. -Copyright (c) 2011-2014 Michael Mathews and the +Copyright (c) 2011-2015 Michael Mathews and the [contributors to JSDoc](https://github.com/jsdoc3/jsdoc/graphs/contributors). All rights reserved. @@ -77,11 +77,21 @@ Copyright (c) 2010 Caolan McMahon. The source code for Async.js is available at: https://github.com/caolan/async +## buffer-browserify ## + +buffer-browserify is distributed under the MIT license, which is reproduced +above. + +Copyright (c) Romain Beauxis. + +The source code for buffer-browserify is available at: +https://github.com/toots/buffer-browserify + ## Catharsis ## Catharsis is distributed under the MIT license, which is reproduced above. -Copyright (c) 2012-2013 Jeff Williams. +Copyright (c) 2012-2014 Jeff Williams. The source code for Catharsis is available at: https://github.com/hegemonic/catharsis @@ -96,6 +106,16 @@ Copyright (c) 2013 Dominic Tarr. The source code for crypto-browserify is available at: https://github.com/dominictarr/crypto-browserify +## escape-string-regexp ## + +escape-string-regexp is distributed under the MIT License, which is reproduced +above. + +Copyright (c) Sindre Sorhus . + +The source code for escape-string-regexp is available at: +https://github.com/sindresorhus/escape-string-regexp + ## Esprima ## Esprima is distributed under the BSD 2-clause license: @@ -125,6 +145,19 @@ Copyright (c) 2011-2013 Ariya Hidayat and other Esprima contributors. The source code for Esprima is available at: https://github.com/ariya/esprima +## events ## + +Portions of the events source code are incorporated into the following files: + ++ `rhino/events.js` + +events is distributed under the MIT license, which is reproduced above. + +Copyright Joyent, Inc. and other Node contributors. All rights reserved. + +The source code for events is available at: +https://github.com/Gozala/events + ## github-flavored-markdown ## github-flavored-markdown is distributed under the BSD 3-clause license: @@ -200,38 +233,6 @@ Copyright (c) 2012 Michael Kourlas. The source code for js2xmlparser is available at: https://github.com/michaelkourlas/node-js2xmlparser -## JSHint ## - -JSHint is distributed under the MIT license, which is reproduced above. - -Portions of JSHint are derived from JSLint, which is distributed under a -modified MIT license: - -> Copyright (c) 2002 Douglas Crockford (www.JSLint.com) -> -> Permission is hereby granted, free of charge, to any person obtaining a copy -> of this software and associated documentation files (the "Software"), to deal -> in the Software without restriction, including without limitation the rights -> to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -> copies of the Software, and to permit persons to whom the Software is -> furnished to do so, subject to the following conditions: -> -> The above copyright notice and this permission notice shall be included in all -> copies or substantial portions of the Software. -> -> The Software shall be used for Good, not Evil. -> -> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -> IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -> FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -> AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -> LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -> OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -> SOFTWARE. - -The source code for JSHint is available at: -https://github.com/jshint/jshint - ## Node.js ## Portions of the Node.js source code are incorporated into the following files: @@ -262,17 +263,15 @@ above. The source code for node-browser-builtins is available at: https://github.com/alexgorbatchev/node-browser-builtins -## node-browserify ## +## Open Sans ## -Portions of the node-browserify source code are incorporated into the following -files: +Open Sans is distributed under the Apache License 2.0, which is +included with this package. -- `rhino/events.js` +Copyright (c) 2010-2011, Google Inc. -node-browserify is distributed under the MIT license, which is reproduced above. - -The source code for node-browserify is available at: -https://github.com/substack/node-browserify +This typeface, including the complete set of variations, are available at: +http://www.google.com/fonts/specimen/Open+Sans ## Requizzle ## @@ -381,6 +380,15 @@ Reporters & Editors. The source code for Underscore.js is available at: https://github.com/jashkenas/underscore +## url ## + +url is distributed under the MIT license, which is reproduced above. + +Copyright Joyent, Inc. and other Node contributors. + +The source code for url is available at: +https://github.com/defunctzombie/node-url + ## wrench-js ## wrench-js is distributed under the MIT license, which is reproduced above. diff --git a/node_modules/jsdoc/README.md b/node_modules/jsdoc/README.md index bae6441..6428c17 100644 --- a/node_modules/jsdoc/README.md +++ b/node_modules/jsdoc/README.md @@ -29,11 +29,6 @@ To install the latest development version: npm install git+https://github.com/jsdoc3/jsdoc.git -**Note**: If you install JSDoc globally, do not use `sudo npm install`. This may -prevent you from running JSDoc as a normal user. If you cannot install global -packages without `sudo`, please -[fix your npm directory permissions](http://howtonode.org/introduction-to-npm). - #### Running JSDoc with Node.js If you installed JSDoc locally, the JSDoc command-line tool is available in @@ -117,8 +112,7 @@ For More Information + Documentation is available at [Use JSDoc](http://usejsdoc.org). + Contribute to the docs at [jsdoc3/jsdoc3.github.com](https://github.com/jsdoc3/jsdoc3.github.com). -+ ~~Post questions to the [JSDoc Users mailing list](http://groups.google.com/group/jsdoc-users).~~ -(temporarily unavailable) ++ Ask for help on the [JSDoc Users mailing list](http://groups.google.com/group/jsdoc-users). + Post questions tagged `jsdoc` to [Stack Overflow](http://stackoverflow.com/questions/tagged/jsdoc). diff --git a/node_modules/jsdoc/cli.js b/node_modules/jsdoc/cli.js index 1a5cefc..dbbad18 100644 --- a/node_modules/jsdoc/cli.js +++ b/node_modules/jsdoc/cli.js @@ -71,7 +71,10 @@ cli.loadConfig = function() { env.opts = args.parse(env.args); } catch (e) { - cli.exit(1, e.message + '\n' + FATAL_ERROR_MESSAGE); + console.error(e.message + '\n'); + cli.printHelp(function() { + cli.exit(1); + }); } confPath = env.opts.configure || path.join(env.dirname, 'conf.json'); @@ -241,40 +244,68 @@ cli.main = function(cb) { cb(0); }; -function getRandomId() { - var MIN = 100000; - var MAX = 999999; +function readPackageJson(filepath) { + var fs = require('jsdoc/fs'); - return Math.floor(Math.random() * (MAX - MIN + 1) + MIN); + try { + return stripJsonComments( fs.readFileSync(filepath, 'utf8') ); + } + catch (e) { + logger.error('Unable to read the package file "%s"', filepath); + return null; + } +} + +function buildSourceList() { + var fs = require('jsdoc/fs'); + var Readme = require('jsdoc/readme'); + + var packageJson; + var readmeHtml; + var sourceFile; + var sourceFiles = env.opts._ ? env.opts._.slice(0) : []; + + if (env.conf.source && env.conf.source.include) { + sourceFiles = sourceFiles.concat(env.conf.source.include); + } + + // load the user-specified package/README files, if any + if (env.opts.package) { + packageJson = readPackageJson(env.opts.package); + } + if (env.opts.readme) { + readmeHtml = new Readme(env.opts.readme).html; + } + + // source files named `package.json` or `README.md` get special treatment, unless the user + // explicitly specified a package and/or README file + for (var i = 0, l = sourceFiles.length; i < l; i++) { + sourceFile = sourceFiles[i]; + + if ( !env.opts.package && /\bpackage\.json$/i.test(sourceFile) ) { + packageJson = readPackageJson(sourceFile); + sourceFiles.splice(i--, 1); + } + + if ( !env.opts.readme && /(\bREADME|\.md)$/i.test(sourceFile) ) { + readmeHtml = new Readme(sourceFile).html; + sourceFiles.splice(i--, 1); + } + } + + props.packageJson = packageJson; + env.opts.readme = readmeHtml; + + return sourceFiles; } // TODO: docs cli.scanFiles = function() { var Filter = require('jsdoc/src/filter').Filter; - var fs = require('jsdoc/fs'); - var Readme = require('jsdoc/readme'); var filter; - var opt; - if (env.conf.source && env.conf.source.include) { - env.opts._ = (env.opts._ || []).concat(env.conf.source.include); - } - - // source files named `package.json` or `README.md` get special treatment - for (var i = 0, l = env.opts._.length; i < l; i++) { - opt = env.opts._[i]; - - if ( /\bpackage\.json$/i.test(opt) ) { - props.packageJson = fs.readFileSync(opt, 'utf8'); - env.opts._.splice(i--, 1); - } - - if ( /(\bREADME|\.md)$/i.test(opt) ) { - env.opts.readme = new Readme(opt).html; - env.opts._.splice(i--, 1); - } - } + env.opts._ = buildSourceList(); // are there any files to scan and parse? if (env.conf.source && env.opts._.length) { @@ -290,7 +321,6 @@ cli.scanFiles = function() { function resolvePluginPaths(paths) { var path = require('jsdoc/path'); - var isNode = require('jsdoc/util/runtime').isNode(); var pluginPaths = []; paths.forEach(function(plugin) { @@ -342,10 +372,13 @@ cli.parseFiles = function() { packageDocs.files = env.sourceFiles || []; docs.push(packageDocs); - logger.debug('Adding inherited symbols...'); + logger.debug('Indexing doclets...'); borrow.indexAll(docs); - augment.addInherited(docs); + logger.debug('Adding inherited symbols, mixins, and interface implementations...'); + augment.augmentAll(docs); + logger.debug('Adding borrowed doclets...'); borrow.resolveBorrows(docs); + logger.debug('Post-processing complete.'); app.jsdoc.parser.fireProcessingComplete(docs); @@ -389,7 +422,6 @@ cli.generateDocs = function() { var template; env.opts.template = (function() { - var isNode = require('jsdoc/util/runtime').isNode(); var publish = env.opts.template || 'templates/default'; var templatePath = path.getResourcePath(publish); @@ -433,5 +465,4 @@ cli.exit = function(exitCode, message) { }; return cli; - })(); diff --git a/node_modules/jsdoc/jsdoc.js b/node_modules/jsdoc/jsdoc.js index 5ea476d..6f63faa 100755 --- a/node_modules/jsdoc/jsdoc.js +++ b/node_modules/jsdoc/jsdoc.js @@ -136,10 +136,10 @@ global.app = { global.dump = function() { 'use strict'; - var doop = require('./lib/jsdoc/util/doop').doop; var _dump = require('./lib/jsdoc/util/dumper').dump; + for (var i = 0, l = arguments.length; i < l; i++) { - console.log( _dump(doop(arguments[i])) ); + console.log( _dump(arguments[i]) ); } }; diff --git a/node_modules/jsdoc/lib/jsdoc/augment.js b/node_modules/jsdoc/lib/jsdoc/augment.js index 7a3778f..6075634 100644 --- a/node_modules/jsdoc/lib/jsdoc/augment.js +++ b/node_modules/jsdoc/lib/jsdoc/augment.js @@ -1,19 +1,33 @@ 'use strict'; +/** + * Provides methods for augmenting the parse results based on their content. + * @module jsdoc/augment + */ + +var doop = require('jsdoc/util/doop'); +var name = require('jsdoc/name'); + var hasOwnProp = Object.prototype.hasOwnProperty; -function mapDependencies(index) { - var doclets, doc, len, dependencies = {}; +function mapDependencies(index, propertyName) { + var dependencies = {}; + var doc; + var doclets; + var kinds = ['class', 'external', 'mixin']; + var len = 0; - Object.keys(index).forEach(function(name) { - doclets = index[name]; - for (var i = 0, ii = doclets.length; i < ii; ++i) { + Object.keys(index).forEach(function(indexName) { + doclets = index[indexName]; + for (var i = 0, ii = doclets.length; i < ii; i++) { doc = doclets[i]; - if (doc.kind === 'class' || doc.kind === 'external') { - dependencies[name] = {}; - len = doc.augments && doc.augments.length || 0; - for (var j = 0; j < len; ++j) { - dependencies[name][doc.augments[j]] = true; + if (kinds.indexOf(doc.kind) !== -1) { + dependencies[indexName] = {}; + if (hasOwnProp.call(doc, propertyName)) { + len = doc[propertyName].length; + for (var j = 0; j < len; j++) { + dependencies[indexName][doc[propertyName][j]] = true; + } } } } @@ -59,20 +73,95 @@ function sort(dependencies) { return sorter.sort(); } -function getMembers(longname, docs) { - var candidate, members = []; - for (var i = 0, ii = docs.length; i < ii; ++i) { +function getMembers(longname, docs, scopes) { + var candidate; + var members = []; + + for (var i = 0, l = docs.length; i < l; i++) { candidate = docs[i]; - if (candidate.memberof === longname && candidate.scope === 'instance') { + + if (candidate.memberof === longname && + (!scopes || !scopes.length || scopes.indexOf(candidate.scope) !== -1)) { members.push(candidate); } } + return members; } -function getAdditions(doclets, docs, longnames) { - var doop = require('jsdoc/util/doop'); +function addDocletProperty(doclets, propName, value) { + for (var i = 0, l = doclets.length; i < l; i++) { + doclets[i][propName] = value; + } +} +function reparentDoclet(parent, child) { + var parts = name.shorten(child.longname); + + parts.memberof = parent.longname; + child.memberof = parent.longname; + child.longname = name.combine(parts); +} + +function parentIsClass(parent) { + return parent.kind === 'class'; +} + +function staticToInstance(doclet) { + var parts = name.shorten(doclet.longname); + + parts.scope = name.SCOPE.PUNC.INSTANCE; + doclet.longname = name.combine(parts); + doclet.scope = name.SCOPE.NAMES.INSTANCE; +} + +/** + * Update the list of doclets to be added to another symbol. + * + * We add only one doclet per longname. For example: If `ClassA` inherits from two classes that both + * use the same method name, `ClassA` gets docs for one method rather than two. + * + * Also, the last symbol wins for any given longname. For example: If you write `@extends Class1 + * @extends Class2`, and both classes have an instance method called `myMethod`, you get the docs + * from `Class2#myMethod`. + * + * @private + * @param {Array.} additions - An array of doclets that will be added to + * another symbol. + * @param {Object.} indexes - A dictionary of indexes into the `additions` array. + * Each key is a longname, and each value is the index of the longname's doclet. + * @return {void} + */ +function updateAddedDoclets(doclet, additions, indexes) { + if (typeof indexes[doclet.longname] !== 'undefined') { + // replace the existing doclet + additions[indexes[doclet.longname]] = doclet; + } + else { + // add the doclet to the array, and track its index + additions.push(doclet); + indexes[doclet.longname] = additions.length - 1; + } +} + +function explicitlyInherits(doclets) { + var doclet; + var inherits = false; + + for (var i = 0, l = doclets.length; i < l; i++) { + doclet = doclets[i]; + if (typeof doclet.inheritdoc !== 'undefined' || typeof doclet.override !== 'undefined') { + inherits = true; + break; + } + } + + return inherits; +} + +// TODO: try to reduce overlap with similar methods +function getInheritedAdditions(doclets, docs, documented) { + var additionIndexes; var additions = []; var doc; var parents; @@ -86,59 +175,331 @@ function getAdditions(doclets, docs, longnames) { for (var i = 0, ii = doclets.length; i < ii; i++) { doc = doclets[i]; parents = doc.augments; + if (parents && doc.kind === 'class') { + // reset the lookup table of added doclet indexes by longname + additionIndexes = {}; + for (var j = 0, jj = parents.length; j < jj; j++) { - members = getMembers(parents[j], docs); + members = getMembers(parents[j], docs, ['instance']); + for (var k = 0, kk = members.length; k < kk; k++) { member = doop(members[k]); - if(!member.inherited) - { + if (!member.inherited) { member.inherits = member.longname; } member.inherited = true; + // TODO: this will fail on longnames like: MyClass#"quoted#Longname" + // and nested instance members like: MyClass#MyOtherClass#myMethod; + // switch to updateLongname()! member.memberof = doc.longname; parts = member.longname.split('#'); parts[0] = doc.longname; member.longname = parts.join('#'); - // if the child doesn't override the parent member, add the parent member - if (longnames.indexOf(member.longname) === -1) { - additions.push(member); + // Indicate what the descendant is overriding. (We only care about the closest + // ancestor. For classes A > B > C, if B#a overrides A#a, and C#a inherits B#a, + // we don't want the doclet for C#a to say that it overrides A#a.) + if (docs.index.longname[member.longname]) { + member.overrides = members[k].longname; + } + else { + delete member.overrides; + } + + // Add the ancestor's docs unless the descendant overrides the ancestor AND + // documents the override. + if ( !hasOwnProp.call(documented, member.longname) ) { + updateAddedDoclets(member, additions, additionIndexes); + } + // If the descendant used an @inheritdoc or @override tag, add the ancestor's + // docs, and ignore the existing doclets. + else if ( explicitlyInherits(documented[member.longname]) ) { + // Ignore any existing doclets. (This is safe because we only get here if + // `member.longname` is an own property of `documented`.) + addDocletProperty(documented[member.longname], 'ignore', true); + + updateAddedDoclets(member, additions, additionIndexes); + + // Remove property that's no longer accurate. + if (member.virtual) { + delete member.virtual; + } + // Remove properties that we no longer need. + if (member.inheritdoc) { + delete member.inheritdoc; + } + if (member.override) { + delete member.override; + } + } + // If the descendant overrides the ancestor and documents the override, + // update the doclets to indicate what the descendant is overriding. + else { + addDocletProperty(documented[member.longname], 'overrides', + members[k].longname); } } } } } + return additions; } -exports.addInherited = function(docs) { - var dependencies = mapDependencies(docs.index); - var sorted = sort(dependencies); - var longnames = []; +function updateMixes(mixedDoclet, mixedLongname) { + var idx; + var mixedName; + var names; - // only build the list of longnames if we'll actually need it - if (sorted.length) { - longnames = docs.map(function(doc) { - // keep the ancestor's docs for a symbol if a local override is not documented - if (doc.longname && !doc.undocumented) { - return doc.longname; - } + // take the fast path if there's no array of mixed-in longnames + if (!mixedDoclet.mixes) { + mixedDoclet.mixes = [mixedLongname]; + } + else { + // find the short name of the longname we're mixing in + mixedName = name.shorten(mixedLongname).name; + // find the short name of each previously mixed-in symbol + names = mixedDoclet.mixes.map(function(m) { + return name.shorten(mixedDoclet.longname).name; }); + + // if we're mixing `myMethod` into `MixinC` from `MixinB`, and `MixinB` had the method mixed + // in from `MixinA`, don't show `MixinA.myMethod` in the `mixes` list + idx = names.indexOf(mixedName); + if (idx !== -1) { + mixedDoclet.mixes.splice(idx, 1); + } + + mixedDoclet.mixes.push(mixedLongname); + } +} + +// TODO: try to reduce overlap with similar methods +function getMixedInAdditions(mixinDoclets, allDoclets, commentedDoclets) { + var additionIndexes; + var additions = []; + var doclet; + var idx; + var mixedDoclet; + var mixedDoclets; + var mixes; + + // mixinDoclets will be undefined if the mixed-in symbol isn't documented + mixinDoclets = mixinDoclets || []; + + for (var i = 0, ii = mixinDoclets.length; i < ii; i++) { + doclet = mixinDoclets[i]; + mixes = doclet.mixes; + + if (mixes) { + // reset the lookup table of added doclet indexes by longname + additionIndexes = {}; + + for (var j = 0, jj = mixes.length; j < jj; j++) { + mixedDoclets = getMembers(mixes[j], allDoclets, ['static']); + + for (var k = 0, kk = mixedDoclets.length; k < kk; k++) { + mixedDoclet = doop(mixedDoclets[k]); + + updateMixes(mixedDoclet, mixedDoclet.longname); + mixedDoclet.mixed = true; + + reparentDoclet(doclet, mixedDoclet); + + // if we're mixing into a class, treat the mixed-in symbol as an instance member + if (parentIsClass(doclet)) { + staticToInstance(mixedDoclet); + } + + updateAddedDoclets(mixedDoclet, additions, additionIndexes); + } + } + } } - sorted.forEach(function(name) { - var doclets = docs.index[name]; - var additions = getAdditions(doclets, docs, longnames); - additions.forEach(function(doc) { - var name = doc.longname; - if ( !hasOwnProp.call(docs.index, name) ) { - docs.index[name] = []; + return additions; +} + +function updateImplements(implDoclets, implementedLongname) { + if ( !Array.isArray(implDoclets) ) { + implDoclets = [implDoclets]; + } + + implDoclets.forEach(function(implDoclet) { + if ( !hasOwnProp.call(implDoclet, 'implements') ) { + implDoclet.implements = []; + } + + implDoclet.implements.push(implementedLongname); + }); +} + +// TODO: try to reduce overlap with similar methods +function getImplementedAdditions(implDoclets, allDoclets, commentedDoclets) { + var additionIndexes; + var additions = []; + var doclet; + var idx; + var implementations; + var implExists; + var implementationDoclet; + var interfaceDoclets; + + // interfaceDoclets will be undefined if the implemented symbol isn't documented + implDoclets = implDoclets || []; + + for (var i = 0, ii = implDoclets.length; i < ii; i++) { + doclet = implDoclets[i]; + implementations = doclet.implements; + + if (implementations) { + // reset the lookup table of added doclet indexes by longname + additionIndexes = {}; + + for (var j = 0, jj = implementations.length; j < jj; j++) { + interfaceDoclets = getMembers(implementations[j], allDoclets, ['instance']); + + for (var k = 0, kk = interfaceDoclets.length; k < kk; k++) { + implementationDoclet = doop(interfaceDoclets[k]); + + reparentDoclet(doclet, implementationDoclet); + updateImplements(implementationDoclet, interfaceDoclets[k].longname); + + // If there's no implementation, move along. + implExists = hasOwnProp.call(allDoclets.index.longname, + implementationDoclet.longname); + if (!implExists) { + continue; + } + + // Add the interface's docs unless the implementation is already documented. + if ( !hasOwnProp.call(commentedDoclets, implementationDoclet.longname) ) { + updateAddedDoclets(implementationDoclet, additions, additionIndexes); + } + // If the implementation used an @inheritdoc or @override tag, add the + // interface's docs, and ignore the existing doclets. + else if ( explicitlyInherits(commentedDoclets[implementationDoclet.longname]) ) { + // Ignore any existing doclets. (This is safe because we only get here if + // `implementationDoclet.longname` is an own property of + // `commentedDoclets`.) + addDocletProperty(commentedDoclets[implementationDoclet.longname], 'ignore', + true); + + updateAddedDoclets(implementationDoclet, additions, additionIndexes); + + // Remove property that's no longer accurate. + if (implementationDoclet.virtual) { + delete implementationDoclet.virtual; + } + // Remove properties that we no longer need. + if (implementationDoclet.inheritdoc) { + delete implementationDoclet.inheritdoc; + } + if (implementationDoclet.override) { + delete implementationDoclet.override; + } + } + // If there's an implementation, and it's documented, update the doclets to + // indicate what the implementation is implementing. + else { + updateImplements(commentedDoclets[implementationDoclet.longname], + interfaceDoclets[k].longname); + } + } } - docs.index[name].push(doc); - docs.push(doc); + } + } + + return additions; +} + +function augment(doclets, propertyName, docletFinder) { + var index = doclets.index.longname; + var dependencies = sort( mapDependencies(index, propertyName) ); + + dependencies.forEach(function(depName) { + var additions = docletFinder.call(null, index[depName], doclets, doclets.index.documented); + + additions.forEach(function(addition) { + var longname = addition.longname; + + if ( !hasOwnProp.call(index, longname) ) { + index[longname] = []; + } + index[longname].push(addition); + doclets.push(addition); }); }); +} + +/** + * Add doclets to reflect class inheritance. + * + * For example, if `ClassA` has the instance method `myMethod`, and `ClassB` inherits from `ClassA`, + * calling this method creates a new doclet for `ClassB#myMethod`. + * + * @param {!Array.} doclets - The doclets generated by JSDoc. + * @param {!Object} doclets.index - The doclet index added by {@link module:jsdoc/borrow.indexAll}. + * @return {void} + */ +exports.addInherited = function(doclets) { + augment(doclets, 'augments', getInheritedAdditions); +}; + +/** + * Add doclets to reflect mixins. When a symbol is mixed into a class, the class' version of the + * mixed-in symbol is treated as an instance member. + * + * For example: + * + * + If `MixinA` has the static method `myMethod`, and `MixinB` mixes `MixinA`, calling this method + * creates a new doclet for the static method `MixinB.myMethod`. + * + If `MixinA` has the static method `myMethod`, and `ClassA` mixes `MixinA`, calling this method + * creates a new doclet for the instance method `ClassA#myMethod`. + * + * @param {!Array.} doclets - The doclets generated by JSDoc. + * @param {!Object} doclets.index - The doclet index added by {@link module:jsdoc/borrow.indexAll}. + * @return {void} + */ +exports.addMixedIn = function(doclets) { + augment(doclets, 'mixes', getMixedInAdditions); +}; + +// TODO: move as much of this as possible to jsdoc/borrow.indexAll +/** + * Update doclets to reflect implementations of interfaces. + * + * For example, if `InterfaceA` has the instance method `myMethod`, and `ClassA` implements + * `InterfaceA`, calling this method does the following: + * + * + Updates `InterfaceA` to indicate that it is implemented by `ClassA` + * + Updates `InterfaceA#myMethod` to indicate that it is implemented by `ClassA#myMethod` + * + Updates `ClassA#myMethod` to indicate that it implements `InterfaceA#myMethod` + * + * @param {!Array.} docs - The doclets generated by JSDoc. + * @param {!Object} doclets.index - The doclet index added by {@link module:jsdoc/borrow.indexAll}. + * @return {void} + */ +exports.addImplemented = function(doclets) { + augment(doclets, 'implements', getImplementedAdditions); +}; + +/** + * Add and update doclets to reflect all of the following: + * + * + Inherited classes + * + Mixins + * + Interface implementations + * + * Calling this method is equivalent to calling all other methods exported by this module. + * + * @return {void} + */ +exports.augmentAll = function(doclets) { + exports.addInherited(doclets); + exports.addMixedIn(doclets); + exports.addImplemented(doclets); }; diff --git a/node_modules/jsdoc/lib/jsdoc/borrow.js b/node_modules/jsdoc/lib/jsdoc/borrow.js index 6f93ea9..5c49882 100644 --- a/node_modules/jsdoc/lib/jsdoc/borrow.js +++ b/node_modules/jsdoc/lib/jsdoc/borrow.js @@ -8,21 +8,79 @@ var doop = require('jsdoc/util/doop'); var logger = require('jsdoc/util/logger'); +var SCOPE = require('jsdoc/name').SCOPE; var hasOwnProp = Object.prototype.hasOwnProperty; -exports.indexAll = function(docs) { - var lookupTable = {}; +// TODO: add the index at parse time, so we don't have to iterate over all the doclets again +exports.indexAll = function(doclets) { + var borrowed = []; + var doclet; + var documented = {}; + var longname = {}; - docs.forEach(function(doc) { - if ( !hasOwnProp.call(lookupTable, doc.longname) ) { - lookupTable[doc.longname] = []; + for (var i = 0, l = doclets.length; i < l; i++) { + doclet = doclets[i]; + + // track all doclets by longname + if ( !hasOwnProp.call(longname, doclet.longname) ) { + longname[doclet.longname] = []; } - lookupTable[doc.longname].push(doc); - }); - docs.index = lookupTable; + longname[doclet.longname].push(doclet); + + // track longnames of documented symbols + if (!doclet.undocumented) { + if ( !hasOwnProp.call(documented, doclet.longname) ) { + documented[doclet.longname] = []; + } + documented[doclet.longname].push(doclet); + } + + // track doclets with a `borrowed` property + if ( hasOwnProp.call(doclet, 'borrowed') ) { + borrowed.push(doclet); + } + } + + doclets.index = { + borrowed: borrowed, + documented: documented, + longname: longname + }; }; +function cloneBorrowedDoclets(doclet, doclets) { + doclet.borrowed.forEach(function(borrowed) { + var borrowedDoclets = doclets.index.longname[borrowed.from]; + var borrowedAs = borrowed.as || borrowed.from; + var clonedDoclets; + var parts; + var scopePunc; + + if (borrowedDoclets) { + borrowedAs = borrowedAs.replace(/^prototype\./, SCOPE.PUNC.INSTANCE); + clonedDoclets = doop(borrowedDoclets).forEach(function(clone) { + // TODO: this will fail on longnames like '"Foo#bar".baz' + parts = borrowedAs.split(SCOPE.PUNC.INSTANCE); + + if (parts.length === 2) { + clone.scope = SCOPE.NAMES.INSTANCE; + scopePunc = SCOPE.PUNC.INSTANCE; + } + else { + clone.scope = SCOPE.NAMES.STATIC; + scopePunc = SCOPE.PUNC.STATIC; + } + + clone.name = parts.pop(); + clone.memberof = doclet.longname; + clone.longname = clone.memberof + scopePunc + clone.name; + doclets.push(clone); + }); + } + }); +} + // requires docs to have been indexed: docs.index must be defined here /** Take a copy of the docs for borrowed symbols and attach them to the @@ -30,41 +88,20 @@ exports.indexAll = function(docs) { moving docs from the "borrowed" array and into the general docs, then deleting the "borrowed" array. */ -exports.resolveBorrows = function(docs) { - /*eslint max-nested-callbacks:[2, 3] */ - if (!docs.index) { +exports.resolveBorrows = function(doclets) { + var doclet; + + if (!doclets.index) { logger.error('Unable to resolve borrowed symbols, because the docs have not been indexed.'); return; } - docs.forEach(function(doc) { - if (doc.borrowed) { - doc.borrowed.forEach(function(b, i) { - var lent = docs.index[b.from], // lent is an array - asName = b.as || b.from; + for (var i = 0, l = doclets.index.borrowed.length; i < l; i++) { + doclet = doclets.index.borrowed[i]; - if (lent) { - var cloned = doop(lent); + cloneBorrowedDoclets(doclet, doclets); + delete doclet.borrowed; + } - cloned.forEach(function(clone) { - asName = asName.replace(/^prototype\./, '#'); - var parts = asName.split('#'); - - if (parts.length === 2) { clone.scope = 'instance'; } - else { clone.scope = 'static'; } - - asName = parts.pop(); - clone.name = asName; - clone.memberof = doc.longname; - clone.longname = clone.memberof + (clone.scope === 'instance' ? '#' : '.') + - clone.name; - docs.push(clone); - }); - - } - }); - - delete doc.borrowed; - } - }); + doclets.index.borrowed = []; }; diff --git a/node_modules/jsdoc/lib/jsdoc/config.js b/node_modules/jsdoc/lib/jsdoc/config.js index 6e95bfd..ee09b68 100644 --- a/node_modules/jsdoc/lib/jsdoc/config.js +++ b/node_modules/jsdoc/lib/jsdoc/config.js @@ -26,7 +26,8 @@ function mergeRecurse(target, source) { // required config values, override these defaults in your config.json if necessary var defaults = { tags: { - allowUnknownTags: true + allowUnknownTags: true, + dictionaries: ['jsdoc', 'closure'] }, templates: { monospaceLinks: false, diff --git a/node_modules/jsdoc/lib/jsdoc/doclet.js b/node_modules/jsdoc/lib/jsdoc/doclet.js index deb2d2e..4e7ecef 100644 --- a/node_modules/jsdoc/lib/jsdoc/doclet.js +++ b/node_modules/jsdoc/lib/jsdoc/doclet.js @@ -19,9 +19,6 @@ var jsdoc = { tag: { Tag: require('jsdoc/tag').Tag, dictionary: require('jsdoc/tag/dictionary') - }, - util: { - doop: require('jsdoc/util/doop') } }; var path = require('jsdoc/path'); @@ -80,29 +77,33 @@ function unwrap(docletSrc) { return docletSrc; } -function split(docletSrc) { - var tagSrcs = []; +/** + * Convert the raw source of the doclet comment into an array of pseudo-Tag objects. + * @private + */ +function toTags(docletSrc) { + var parsedTag; + var tagData = []; + var tagText; + var tagTitle; // split out the basic tags, keep surrounding whitespace // like: @tagTitle tagBody docletSrc - .replace(/^(\s*)@(\S)/gm, '$1\\@$2') // replace splitter ats with an arbitrary sequence - .split('\\@') // then split on that arbitrary sequence + // replace splitter ats with an arbitrary sequence + .replace(/^(\s*)@(\S)/gm, '$1\\@$2') + // then split on that arbitrary sequence + .split('\\@') .forEach(function($) { - var parsedTag; - var tagText; - var tagTitle; - if ($) { - parsedTag = $.match(/^(\S+)(:?\s+(\S[\s\S]*))?/); + parsedTag = $.match(/^(\S+)(?:\s+(\S[\s\S]*))?/); if (parsedTag) { - // we don't need parsedTag[0] tagTitle = parsedTag[1]; tagText = parsedTag[2]; if (tagTitle) { - tagSrcs.push({ + tagData.push({ title: tagTitle, text: tagText }); @@ -111,31 +112,30 @@ function split(docletSrc) { } }); - return tagSrcs; -} - -/** - * Convert the raw source of the doclet comment into an array of Tag objects. - * @private - */ -function toTags(docletSrc) { - var tags = []; - var tagSrcs = split(docletSrc); - - for (var i = 0, l = tagSrcs.length; i < l; i++) { - tags.push({ title: tagSrcs[i].title, text: tagSrcs[i].text }); - } - - return tags; + return tagData; } function fixDescription(docletSrc) { - if (!/^\s*@/.test(docletSrc)) { + if (!/^\s*@/.test(docletSrc) && docletSrc.replace(/\s/g, '').length) { docletSrc = '@description ' + docletSrc; } return docletSrc; } +/** + * Replace the existing tag dictionary with a new tag dictionary. + * + * Used for testing only. + * + * @private + * @param {module:jsdoc/tag/dictionary.Dictionary} dict - The new tag dictionary. + */ +exports._replaceDictionary = function _replaceDictionary(dict) { + jsdoc.tag.dictionary = dict; + require('jsdoc/tag')._replaceDictionary(dict); + require('jsdoc/util/templateHelper')._replaceDictionary(dict); +}; + /** * @class * @classdesc Represents a single JSDoc comment. @@ -217,7 +217,7 @@ Doclet.prototype.addTag = function(title, text) { }; function removeGlobal(longname) { - var globalRegexp = new RegExp('^' + jsdoc.name.GLOBAL_LONGNAME + '\\.?'); + var globalRegexp = new RegExp('^' + jsdoc.name.LONGNAMES.GLOBAL + '\\.?'); return longname.replace(globalRegexp, ''); } @@ -233,7 +233,7 @@ Doclet.prototype.setMemberof = function(sid) { * @type string */ this.memberof = removeGlobal(sid) - .replace(/\.prototype/g, jsdoc.name.INSTANCE); + .replace(/\.prototype/g, jsdoc.name.SCOPE.PUNC.INSTANCE); }; /** @@ -270,22 +270,22 @@ function getFilepath(doclet) { /** * Set the doclet's `scope` property. Must correspond to a scope name that is defined in - * {@link module:jsdoc/name.SCOPE_NAMES}. + * {@link module:jsdoc/name.SCOPE.NAMES}. * - * @param {module:jsdoc/name.SCOPE_NAMES} scope - The scope for the doclet relative to the symbol's + * @param {module:jsdoc/name.SCOPE.NAMES} scope - The scope for the doclet relative to the symbol's * parent. * @throws {Error} If the scope name is not recognized. */ Doclet.prototype.setScope = function(scope) { var errorMessage; var filepath; - var scopeNames = Object.keys(jsdoc.name.SCOPE_NAMES); + var scopeNames = _.values(jsdoc.name.SCOPE.NAMES); if (scopeNames.indexOf(scope) === -1) { filepath = getFilepath(this); - errorMessage = util.format('The scope name "%s" is not recognized. Use one of the names ' + - 'defined in module:jsdoc/name.SCOPE_NAMES.', scope); + errorMessage = util.format('The scope name "%s" is not recognized. Use one of the ' + + 'following values: %j', scope, scopeNames); if (filepath) { errorMessage += util.format(' (Source file: %s)', filepath); } diff --git a/node_modules/jsdoc/lib/jsdoc/name.js b/node_modules/jsdoc/lib/jsdoc/name.js index aee46a8..7aa0c1c 100644 --- a/node_modules/jsdoc/lib/jsdoc/name.js +++ b/node_modules/jsdoc/lib/jsdoc/name.js @@ -1,59 +1,91 @@ /** A collection of functions relating to JSDoc symbol name manipulation. @module jsdoc/name - @requires jsdoc/tag/dictionary @author Michael Mathews @license Apache License 2.0 - See file 'LICENSE.md' in this project. */ 'use strict'; var _ = require('underscore'); +var escape = require('escape-string-regexp'); -// Longname used for doclets whose actual longname cannot be identified. -var ANONYMOUS_LONGNAME = exports.ANONYMOUS_LONGNAME = ''; -// Longname used for doclets in global scope. -var GLOBAL_LONGNAME = exports.GLOBAL_LONGNAME = ''; -var INNER = exports.INNER = '~'; -var INSTANCE = exports.INSTANCE = '#'; -var MODULE_PREFIX = exports.MODULE_PREFIX = 'module:'; -// Scope identifiers. -var SCOPE_NAMES = exports.SCOPE_NAMES = { - global: 'global', - inner: 'inner', - instance: 'instance', - 'static': 'static' +var hasOwnProp = Object.prototype.hasOwnProperty; + +/** + * Longnames that have a special meaning in JSDoc. + * + * @enum {string} + * @static + * @memberof module:jsdoc/name + */ +var LONGNAMES = exports.LONGNAMES = { + /** Longname used for doclets that do not have a longname, such as anonymous functions. */ + ANONYMOUS: '', + /** Longname that represents global scope. */ + GLOBAL: '' }; -var STATIC = exports.STATIC = '.'; + +// Module namespace prefix. +var MODULE_NAMESPACE = 'module:'; + +/** + * Names and punctuation marks that identify doclet scopes. + * + * @enum {string} + * @static + * @memberof module:jsdoc/name + */ +var SCOPE = exports.SCOPE = { + NAMES: { + GLOBAL: 'global', + INNER: 'inner', + INSTANCE: 'instance', + STATIC: 'static' + }, + PUNC: { + INNER: '~', + INSTANCE: '#', + STATIC: '.' + } +}; + +// For backwards compatibility, this enum must use lower-case keys var scopeToPunc = exports.scopeToPunc = { - 'inner': INNER, - 'instance': INSTANCE, - 'static': STATIC + 'inner': SCOPE.PUNC.INNER, + 'instance': SCOPE.PUNC.INSTANCE, + 'static': SCOPE.PUNC.STATIC }; var puncToScope = exports.puncToScope = _.invert(scopeToPunc); -var DEFAULT_SCOPE = SCOPE_NAMES.static; -var REGEXP_SCOPE_PUNC = '([' + INNER + INSTANCE + STATIC + '])'; +var DEFAULT_SCOPE = SCOPE.NAMES.STATIC; +var SCOPE_PUNC = _.values(SCOPE.PUNC); +var SCOPE_PUNC_STRING = '[' + SCOPE_PUNC.join() + ']'; +var REGEXP_LEADING_SCOPE = new RegExp('^(' + SCOPE_PUNC_STRING + ')'); +var REGEXP_TRAILING_SCOPE = new RegExp('(' + SCOPE_PUNC_STRING + ')$'); + +var DESCRIPTION = '(?:(?:[ \\t]*\\-\\s*|\\s+)(\\S[\\s\\S]*))?$'; +var REGEXP_DESCRIPTION = new RegExp(DESCRIPTION); +var REGEXP_NAME_DESCRIPTION = new RegExp('^(\\[[^\\]]+\\]|\\S+)' + DESCRIPTION); function nameIsLongname(name, memberof) { - var regexp = new RegExp('^' + memberof + REGEXP_SCOPE_PUNC); + var regexp = new RegExp('^' + escape(memberof) + SCOPE_PUNC_STRING); return regexp.test(name); } function prototypeToPunc(name) { - return name.replace(/(?:^|\.)prototype\.?/g, INSTANCE); + return name.replace(/(?:^|\.)prototype\.?/g, SCOPE.PUNC.INSTANCE); } +// TODO: deprecate exports.resolve in favor of a better name /** Resolves the longname, memberof, variation and name values of the given doclet. @param {module:jsdoc/doclet.Doclet} doclet */ exports.resolve = function(doclet) { var about = {}; - var leadingScope = new RegExp('^' + REGEXP_SCOPE_PUNC); var memberof = doclet.memberof || ''; var name = doclet.name ? String(doclet.name) : ''; - var trailingScope = new RegExp(REGEXP_SCOPE_PUNC + '$'); var parentDoc; @@ -67,7 +99,7 @@ exports.resolve = function(doclet) { // member of a var in an outer scope? if (name && !memberof && doclet.meta.code && doclet.meta.code.funcscope) { - name = doclet.longname = doclet.meta.code.funcscope + INNER + name; + name = doclet.longname = doclet.meta.code.funcscope + SCOPE.PUNC.INNER + name; } if (memberof || doclet.forceMemberof) { // @memberof tag given @@ -79,7 +111,7 @@ exports.resolve = function(doclet) { } // the name and memberof are identical and refer to a module, // like @name module:foo, @memberof module:foo (probably a member like 'var exports') - else if (name && name === memberof && name.indexOf(MODULE_PREFIX) === 0) { + else if (name && name === memberof && name.indexOf(MODULE_NAMESPACE) === 0) { about = exports.shorten(name, (doclet.forceMemberof ? memberof : undefined)); } // the name and memberof are identical, like @name foo, @memberof foo @@ -89,7 +121,7 @@ exports.resolve = function(doclet) { about = exports.shorten(name, (doclet.forceMemberof ? memberof : undefined)); } // like @memberof foo# or @memberof foo~ - else if (name && trailingScope.test(memberof) ) { + else if (name && REGEXP_TRAILING_SCOPE.test(memberof) ) { about = exports.shorten(memberof + name, (doclet.forceMemberof ? memberof : undefined)); } else if (name && doclet.scope) { @@ -113,30 +145,28 @@ exports.resolve = function(doclet) { doclet.setLongname(about.longname); } - if (doclet.scope === 'global') { // via @global tag? + if (doclet.scope === SCOPE.NAMES.GLOBAL) { // via @global tag? doclet.setLongname(doclet.name); delete doclet.memberof; } else if (about.scope) { - if (about.memberof === GLOBAL_LONGNAME) { // via @memberof ? - doclet.scope = 'global'; + if (about.memberof === LONGNAMES.GLOBAL) { // via @memberof ? + doclet.scope = SCOPE.NAMES.GLOBAL; } else { doclet.scope = puncToScope[about.scope]; } } - else { - if (doclet.name && doclet.memberof && !doclet.longname) { - if ( leadingScope.test(doclet.name) ) { - doclet.scope = puncToScope[RegExp.$1]; - doclet.name = doclet.name.substr(1); - } - else { - doclet.scope = DEFAULT_SCOPE; - } - - doclet.setLongname(doclet.memberof + scopeToPunc[doclet.scope] + doclet.name); + else if (doclet.name && doclet.memberof && !doclet.longname) { + if ( REGEXP_LEADING_SCOPE.test(doclet.name) ) { + doclet.scope = puncToScope[RegExp.$1]; + doclet.name = doclet.name.substr(1); } + else { + doclet.scope = DEFAULT_SCOPE; + } + + doclet.setLongname(doclet.memberof + scopeToPunc[doclet.scope] + doclet.name); } if (about.variation) { @@ -149,12 +179,6 @@ exports.resolve = function(doclet) { } }; -// TODO: make this a private method, or remove it if possible -RegExp.escape = RegExp.escape || function(str) { - var specials = new RegExp('[.*+?|()\\[\\]{}\\\\]', 'g'); // .*+?|()[]{}\ - return str.replace(specials, '\\$&'); -}; - /** @method module:jsdoc/name.applyNamespace @param {string} longname The full longname of the symbol. @@ -167,24 +191,61 @@ exports.applyNamespace = function(longname, ns) { longname = nameParts.longname; if ( !/^[a-zA-Z]+?:.+$/i.test(name) ) { - longname = longname.replace( new RegExp(RegExp.escape(name) + '$'), ns + ':' + name ); + longname = longname.replace( new RegExp(escape(name) + '$'), ns + ':' + name ); } return longname; }; -/** - Given a longname like "a.b#c(2)", slice it up into ["a.b", "#", 'c', '2'], - representing the memberof, the scope, the name, and variation. - @param {string} longname - @param {string} forcedMemberof - @returns {object} Representing the properties of the given name. - */ -exports.shorten = function(longname, forcedMemberof) { - // quoted strings in a longname are atomic, convert to tokens - var atoms = [], token; +// TODO: docs +exports.stripNamespace = function(longname) { + return longname.replace(/^[a-zA-Z]+:/, ''); +}; - // handle quoted names like foo["bar"] or foo['bar'] +/** + * Check whether a parent longname is an ancestor of a child longname. + * + * @param {string} parent - The parent longname. + * @param {string} child - The child longname. + * @return {boolean} `true` if the parent is an ancestor of the child; otherwise, `false`. + */ +exports.hasAncestor = function(parent, child) { + var hasAncestor = false; + var memberof = child; + + if (!parent || !child) { + return hasAncestor; + } + + // fast path for obvious non-ancestors + if (child.indexOf(parent) !== 0) { + return hasAncestor; + } + + do { + memberof = exports.shorten(memberof).memberof; + + if (memberof === parent) { + hasAncestor = true; + } + } while (!hasAncestor && memberof); + + return hasAncestor; +}; + +// TODO: docs +function atomize(longname, sliceChars, forcedMemberof) { + var i; + var memberof = ''; + var name = ''; + var parts; + var partsRegExp; + var scopePunc = ''; + var token; + var tokens = []; + var variation; + + // quoted strings in a longname are atomic, so we convert them to tokens longname = longname.replace(/(\[?["'].+?["']\]?)/g, function($) { var dot = ''; if ( /^\[/.test($) ) { @@ -192,34 +253,31 @@ exports.shorten = function(longname, forcedMemberof) { $ = $.replace( /^\[/g, '' ).replace( /\]$/g, '' ); } - token = '@{' + atoms.length + '}@'; - atoms.push($); + token = '@{' + tokens.length + '}@'; + tokens.push($); return dot + token; // foo["bar"] => foo.@{1}@ }); - var name = '', - scope = '', // ., ~, or # - memberof = '', - parts, - variation; - longname = prototypeToPunc(longname); - if (typeof forcedMemberof !== 'undefined') { + if (forcedMemberof !== undefined) { + partsRegExp = new RegExp('^(.*?)([' + sliceChars.join() + ']?)$'); name = longname.substr(forcedMemberof.length); - parts = forcedMemberof.match(/^(.*?)([#.~]?)$/); + parts = forcedMemberof.match(partsRegExp); - if (parts[1]) { memberof = parts[1] || forcedMemberof; } - if (parts[2]) { scope = parts[2]; } + if (parts[1]) { + memberof = parts[1] || forcedMemberof; + } + if (parts[2]) { + scopePunc = parts[2]; + } } - else { - parts = longname ? - (longname.match( /^(:?(.+)([#.~]))?(.+?)$/ ) || []).reverse() : - ['']; - - name = parts[0] || ''; // ensure name is always initialised to avoid error being thrown when calling replace on undefined [gh-24] - scope = parts[1] || ''; // ., ~, or # + else if (longname) { + parts = (longname.match(new RegExp('^(:?(.+)([' + sliceChars.join() + ']))?(.+?)$')) || []) + .reverse(); + name = parts[0] || ''; + scopePunc = parts[1] || ''; memberof = parts[2] || ''; } @@ -229,19 +287,168 @@ exports.shorten = function(longname, forcedMemberof) { variation = RegExp.$2; } - //// restore quoted strings back again - var i = atoms.length; + // restore quoted strings + i = tokens.length; while (i--) { - longname = longname.replace('@{' + i + '}@', atoms[i]); - memberof = memberof.replace('@{' + i + '}@', atoms[i]); - scope = scope.replace('@{' + i + '}@', atoms[i]); - name = name.replace('@{' + i + '}@', atoms[i]); + longname = longname.replace('@{' + i + '}@', tokens[i]); + memberof = memberof.replace('@{' + i + '}@', tokens[i]); + scopePunc = scopePunc.replace('@{' + i + '}@', tokens[i]); + name = name.replace('@{' + i + '}@', tokens[i]); } - //// - return {longname: longname, memberof: memberof, scope: scope, name: name, variation: variation}; + return { + longname: longname, + memberof: memberof, + scope: scopePunc, + name: name, + variation: variation + }; +} + +// TODO: deprecate exports.shorten in favor of a better name +/** + Given a longname like "a.b#c(2)", slice it up into an object + containing the memberof, the scope, the name, and variation. + @param {string} longname + @param {string} forcedMemberof + @returns {object} Representing the properties of the given name. + */ +exports.shorten = function(longname, forcedMemberof) { + return atomize(longname, SCOPE_PUNC, forcedMemberof); }; +// TODO: docs +exports.combine = function(parts) { + return '' + + (parts.memberof || '') + + (parts.scope || '') + + (parts.name || '') + + (parts.variation || ''); +}; + +// TODO: docs +exports.stripVariation = function(name) { + var parts = exports.shorten(name); + + parts.variation = ''; + + return exports.combine(parts); +}; + +function splitLongname(longname, options) { + var chunks = []; + var currentNameInfo; + var nameInfo = {}; + var previousName = longname; + var splitters = SCOPE_PUNC.concat('/'); + + options = _.defaults(options || {}, { + includeVariation: true + }); + + do { + if (!options.includeVariation) { + previousName = exports.stripVariation(previousName); + } + currentNameInfo = nameInfo[previousName] = atomize(previousName, splitters); + previousName = currentNameInfo.memberof; + chunks.push(currentNameInfo.scope + currentNameInfo.name); + } while (previousName); + + return { + chunks: chunks.reverse(), + nameInfo: nameInfo + }; +} + +// TODO: docs +exports.longnamesToTree = function longnamesToTree(longnames, doclets) { + var splitOptions = { includeVariation: false }; + var tree = {}; + + longnames.forEach(function(longname) { + var currentLongname = ''; + var currentParent = tree; + var nameInfo; + var processed; + + // don't try to add empty longnames to the tree + if (!longname) { + return; + } + + processed = splitLongname(longname, splitOptions); + nameInfo = processed.nameInfo; + + processed.chunks.forEach(function(chunk) { + currentLongname += chunk; + + if (currentParent !== tree) { + currentParent.children = currentParent.children || {}; + currentParent = currentParent.children; + } + + if (!hasOwnProp.call(currentParent, chunk)) { + currentParent[chunk] = nameInfo[currentLongname]; + } + + if (currentParent[chunk]) { + currentParent[chunk].doclet = doclets ? doclets[currentLongname] : null; + currentParent = currentParent[chunk]; + } + }); + }); + + return tree; +}; + +/** + Split a string that starts with a name and ends with a description into its parts. + Allows the defaultvalue (if present) to contain brackets. If the name is found to have + mismatched brackets, null is returned. + @param {string} nameDesc + @returns {object} Hash with "name" and "description" properties. + */ +function splitNameMatchingBrackets(nameDesc) { + var buffer = []; + var c; + var stack = 0; + var stringEnd = null; + + for (var i = 0; i < nameDesc.length; ++i) { + c = nameDesc[i]; + buffer.push(c); + + if (stringEnd) { + if (c === '\\' && i + 1 < nameDesc.length) { + buffer.push(nameDesc[++i]); + } else if (c === stringEnd) { + stringEnd = null; + } + } else if (c === '"' || c === "'") { + stringEnd = c; + } else if (c === '[') { + ++stack; + } else if (c === ']') { + if (--stack === 0) { + break; + } + } + } + + if (stack || stringEnd) { + return null; + } + + nameDesc.substr(i).match(REGEXP_DESCRIPTION); + return { + name: buffer.join(''), + description: RegExp.$1 + }; +} + + +// TODO: deprecate exports.splitName in favor of a better name /** Split a string that starts with a name and ends with a description into its parts. @param {string} nameDesc @@ -251,9 +458,19 @@ exports.splitName = function(nameDesc) { // like: name, [name], name text, [name] text, name - text, or [name] - text // the hyphen must be on the same line as the name; this prevents us from treating a Markdown // dash as a separator - nameDesc.match(/^(\[[^\]]+\]|\S+)((?:[ \t]*\-\s*|\s+)(\S[\s\S]*))?$/); + + // optional values get special treatment + var result = null; + if (nameDesc[0] === '[') { + result = splitNameMatchingBrackets(nameDesc); + if (result !== null) { + return result; + } + } + + nameDesc.match(REGEXP_NAME_DESCRIPTION); return { name: RegExp.$1, - description: RegExp.$3 + description: RegExp.$2 }; }; diff --git a/node_modules/jsdoc/lib/jsdoc/opts/argparser.js b/node_modules/jsdoc/lib/jsdoc/opts/argparser.js index c33db9d..e4fa0d0 100644 --- a/node_modules/jsdoc/lib/jsdoc/opts/argparser.js +++ b/node_modules/jsdoc/lib/jsdoc/opts/argparser.js @@ -7,6 +7,7 @@ 'use strict'; var _ = require('underscore'); +var util = require('util'); var hasOwnProp = Object.prototype.hasOwnProperty; @@ -14,6 +15,7 @@ var hasOwnProp = Object.prototype.hasOwnProperty; * Create an instance of the parser. * @classdesc A parser to interpret the key-value pairs entered on the command line. * @constructor + * @alias module:jsdoc/opts/argparser */ var ArgParser = function() { this._options = []; @@ -236,7 +238,6 @@ ArgParser.prototype.parse = function(args, defaults) { // like -t if (arg.charAt(0) === '-') { - // like --template if (arg.charAt(1) === '-') { name = longName = arg.slice(2); @@ -248,7 +249,7 @@ ArgParser.prototype.parse = function(args, defaults) { } if (option === null) { - throw new Error( 'Unknown command line option found: ' + name ); + throw new Error( util.format('Unknown command-line option "%s".', name) ); } if (option.hasValue) { @@ -256,7 +257,7 @@ ArgParser.prototype.parse = function(args, defaults) { i++; if (value === null || value.charAt(0) === '-') { - throw new Error( 'Command line option requires a value: ' + name ); + throw new Error( util.format('The command-line option "%s" requires a value.', name) ); } } else { diff --git a/node_modules/jsdoc/lib/jsdoc/opts/args.js b/node_modules/jsdoc/lib/jsdoc/opts/args.js index bddd565..1448bba 100644 --- a/node_modules/jsdoc/lib/jsdoc/opts/args.js +++ b/node_modules/jsdoc/lib/jsdoc/opts/args.js @@ -73,25 +73,26 @@ function parseQuery(str) { return result; } -argParser.addOption('t', 'template', true, 'The path to the template to use. Default: path/to/jsdoc/templates/default'); +argParser.addOption('a', 'access', true, 'Only display symbols with the given access: "public", "protected", "private" or "undefined", or "all" for all access levels. Default: all except "private"', true); argParser.addOption('c', 'configure', true, 'The path to the configuration file. Default: path/to/jsdoc/conf.json'); -argParser.addOption('e', 'encoding', true, 'Assume this encoding when reading all source files. Default: utf8'); -argParser.addOption('T', 'test', false, 'Run all tests and quit.'); argParser.addOption('d', 'destination', true, 'The path to the output folder. Use "console" to dump data to the console. Default: ./out/'); -argParser.addOption('p', 'private', false, 'Display symbols marked with the @private tag. Default: false'); -argParser.addOption('r', 'recurse', false, 'Recurse into subdirectories when scanning for source code files.'); +argParser.addOption('', 'debug', false, 'Log information for debugging JSDoc. On Rhino, launches the debugger when passed as the first option.'); +argParser.addOption('e', 'encoding', true, 'Assume this encoding when reading all source files. Default: utf8'); argParser.addOption('h', 'help', false, 'Print this message and quit.'); -argParser.addOption('X', 'explain', false, 'Dump all found doclet internals to console and quit.'); +argParser.addOption('', 'match', true, 'When running tests, only use specs whose names contain .', true); +argParser.addOption('', 'nocolor', false, 'When running tests, do not use color in console output.'); +argParser.addOption('p', 'private', false, 'Display symbols marked with the @private tag. Equivalent to "--access all". Default: false'); +argParser.addOption('P', 'package', true, 'The path to the project\'s package file. Default: path/to/sourcefiles/package.json'); +argParser.addOption('', 'pedantic', false, 'Treat errors as fatal errors, and treat warnings as errors. Default: false'); argParser.addOption('q', 'query', true, 'A query string to parse and store in env.opts.query. Example: foo=bar&baz=true', false, parseQuery); +argParser.addOption('r', 'recurse', false, 'Recurse into subdirectories when scanning for source files and tutorials.'); +argParser.addOption('R', 'readme', true, 'The path to the project\'s README file. Default: path/to/sourcefiles/README.md'); +argParser.addOption('t', 'template', true, 'The path to the template to use. Default: path/to/jsdoc/templates/default'); +argParser.addOption('T', 'test', false, 'Run all tests and quit.'); argParser.addOption('u', 'tutorials', true, 'Directory in which JSDoc should search for tutorials.'); argParser.addOption('v', 'version', false, 'Display the version number and quit.'); -argParser.addOption('', 'debug', false, 'Log information for debugging JSDoc. On Rhino, launches the debugger when passed as the first option.'); argParser.addOption('', 'verbose', false, 'Log detailed information to the console as JSDoc runs.'); -argParser.addOption('', 'pedantic', false, 'Treat errors as fatal errors, and treat warnings as errors. Default: false'); - -// Options specific to tests -argParser.addOption(null, 'match', true, 'Only run tests containing .', true); -argParser.addOption(null, 'nocolor', false, 'Do not use color in console output from tests.'); +argParser.addOption('X', 'explain', false, 'Dump all found doclet internals to console and quit.'); // Options that are no longer supported and should be ignored argParser.addIgnoredOption('l', 'lenient'); // removed in JSDoc 3.3.0 @@ -122,6 +123,7 @@ exports.help = function() { /** * Get a named option. + * @variation name * @param {string} name The name of the option. * @return {string} The value associated with the given name. *//** diff --git a/node_modules/jsdoc/lib/jsdoc/package.js b/node_modules/jsdoc/lib/jsdoc/package.js index 135c9ab..1a60a3b 100644 --- a/node_modules/jsdoc/lib/jsdoc/package.js +++ b/node_modules/jsdoc/lib/jsdoc/package.js @@ -1,70 +1,254 @@ -/** - @overview - @author Michael Mathews - @license Apache License 2.0 - See file 'LICENSE.md' in this project. - */ 'use strict'; +var logger = require('jsdoc/util/logger'); + /** - @module jsdoc/package - @see http://wiki.commonjs.org/wiki/Packages/1.0 + * Provides access to information about a JavaScript package. + * + * @module jsdoc/package + * @see https://www.npmjs.org/doc/files/package.json.html + */ + +// Collect all of the license information from a `package.json` file. +function getLicenses(packageInfo) { + var licenses = packageInfo.licenses ? packageInfo.licenses.slice(0) : []; + + if (packageInfo.license) { + licenses.push({ type: packageInfo.license }); + } + + return licenses; +} + +/** + * Information about where to report bugs in the package. + * + * @typedef {Object} module:jsdoc/package.Package~BugInfo + * @property {string} email - The email address for reporting bugs. + * @property {string} url - The URL for reporting bugs. */ /** - @class - @classdesc Represents a JavaScript package. - @param {string} json - The contents of package.json. + * Information about a package's software license. + * + * @typedef {Object} module:jsdoc/package.Package~LicenseInfo + * @property {string} type - An identifier for the type of license. + * @property {string} url - The URL for the complete text of the license. + */ + +/** + * Information about a package author or contributor. + * + * @typedef {Object} module:jsdoc/package.Package~PersonInfo + * @property {string} name - The person's full name. + * @property {string} email - The person's email address. + * @property {string} url - The URL of the person's website. + */ + +/** + * Information about a package's version-control repository. + * + * @typedef {Object} module:jsdoc/package.Package~RepositoryInfo + * @property {string} type - The type of version-control system that the repository uses (for + * example, `git` or `svn`). + * @property {string} url - The URL for the repository. + */ + +/** + * Information about a JavaScript package. JSDoc can extract package information from + * `package.json` files that follow the + * [npm specification](https://www.npmjs.org/doc/files/package.json.html). + * + * **Note**: JSDoc does not validate or normalize the contents of `package.json` files. If your + * `package.json` file does not follow the npm specification, some properties of the `Package` + * object may not use the format documented here. + * + * @class + * @param {string} json - The contents of the `package.json` file. */ exports.Package = function(json) { - json = json || '{}'; + var packageInfo; - /** The source files associated with this package. - @type {Array} + /** + * The string identifier that is shared by all `Package` objects. + * + * @readonly + * @default + * @type {string} + */ + this.kind = 'package'; + + try { + packageInfo = JSON.parse(json || '{}'); + } + catch (e) { + logger.error('Unable to parse the package file: %s', e.message); + packageInfo = {}; + } + + if (packageInfo.name) { + /** + * The package name. + * + * @type {string} + */ + this.name = packageInfo.name; + } + + /** + * The unique longname for this `Package` object. + * + * @type {string} + */ + this.longname = this.kind + ':' + this.name; + + if (packageInfo.author) { + /** + * The author of this package. Contains either a + * {@link module:jsdoc/package.Package~PersonInfo PersonInfo} object or a string with + * information about the author. + * + * @type {(module:jsdoc/package.Package~PersonInfo|string)} + * @since 3.3.0 + */ + this.author = packageInfo.author; + } + + if (packageInfo.bugs) { + /** + * Information about where to report bugs in the project. May contain a URL, as a string, or + * an object with more detailed information. + * + * @type {(string|module:jsdoc/package.Package~BugInfo)} + * @since 3.3.0 + */ + this.bugs = packageInfo.bugs; + } + + if (packageInfo.contributors) { + /** + * The contributors to this package. + * + * @type {Array.<(module:jsdoc/package.Package~PersonInfo|string)>} + * @since 3.3.0 + */ + this.contributors = packageInfo.contributors; + } + + if (packageInfo.dependencies) { + /** + * The dependencies for this package. + * + * @type {Object} + * @since 3.3.0 + */ + this.dependencies = packageInfo.dependencies; + } + + if (packageInfo.description) { + /** + * A brief description of the package. + * + * @type {string} + */ + this.description = packageInfo.description; + } + + if (packageInfo.devDependencies) { + /** + * The development dependencies for this package. + * + * @type {Object} + * @since 3.3.0 + */ + this.devDependencies = packageInfo.devDependencies; + } + + if (packageInfo.engines) { + /** + * The JavaScript engines that this package supports. Each key is a string that identifies the + * engine (for example, `node`). Each value is a + * [semver](https://www.npmjs.org/doc/misc/semver.html)-compliant version number for the engine. + * + * @type {Object} + * @since 3.3.0 + */ + this.engines = packageInfo.engines; + } + + /** + * The source files associated with the package. + * + * New `Package` objects always contain an empty array, regardless of whether the `package.json` + * file includes a `files` property. + * + * After JSDoc parses your input files, it sets this property to a list of paths to your input + * files. + * + * @type {Array.} */ this.files = []; - /** The kind of this package. - @readonly - @default - @type {string} - */ - this.kind = 'package'; + if (packageInfo.homepage) { + /** + * The URL for the package's homepage. + * + * @type {string} + * @since 3.3.0 + */ + this.homepage = packageInfo.homepage; + } - json = JSON.parse(json); + if (packageInfo.keywords) { + /** + * Keywords to help users find the package. + * + * @type {Array.} + * @since 3.3.0 + */ + this.keywords = packageInfo.keywords; + } - /** The name of this package. - This value is found in the package.json file passed in as a command line option. - @type {string} - */ - this.name = json.name; + if (packageInfo.license || packageInfo.licenses) { + /** + * The licenses used by this package. Combines information from the `package.json` file's + * `license` property and the deprecated `licenses` property. + * + * @type {Array.} + */ + this.licenses = getLicenses(packageInfo); + } - /** The longname of this package. - @type {string} - */ - this.longname = this.kind + ':' + this.name; + if (packageInfo.main) { + /** + * The module ID that provides the primary entry point to the package. For example, if your + * package is a CommonJS module, and the value of this property is `foo`, users should be able + * to load your module with `require('foo')`. + * + * @type {string} + * @since 3.3.0 + */ + this.main = packageInfo.main; + } - /** The description of this package. - @type {string} - */ - this.description = json.description; + if (packageInfo.repository) { + /** + * The version-control repository for the package. + * + * @type {module:jsdoc/package.Package~RepositoryInfo} + * @since 3.3.0 + */ + this.repository = packageInfo.repository; + } - /** - The hash summary of the source file. - @type {string} - @since 3.2.0 - */ - this.version = json.version; - - /** - * The licenses of this package. - * @type {Array} - * @example - * "licenses": [ - * { - * "type": "GPLv2", - * "url": "http://www.example.com/licenses/gpl.html" - * } - * ] - */ - this.licenses = json.licenses; + if (packageInfo.version) { + /** + * The [semver](https://www.npmjs.org/doc/misc/semver.html)-compliant version number of the + * package. + * + * @type {string} + * @since 3.2.0 + */ + this.version = packageInfo.version; + } }; diff --git a/node_modules/jsdoc/lib/jsdoc/plugins.js b/node_modules/jsdoc/lib/jsdoc/plugins.js index a34fccc..92fb494 100644 --- a/node_modules/jsdoc/lib/jsdoc/plugins.js +++ b/node_modules/jsdoc/lib/jsdoc/plugins.js @@ -24,17 +24,17 @@ exports.installPlugins = function(plugins, parser) { plugin = require(plugins[i]); // allow user-defined plugins to... - //...register event handlers + // ...register event handlers if (plugin.handlers) { addHandlers(plugin.handlers, parser); } - //...define tags + // ...define tags if (plugin.defineTags) { plugin.defineTags(dictionary); } - //...add a Rhino node visitor (deprecated in JSDoc 3.3) + // ...add a Rhino node visitor (deprecated in JSDoc 3.3) if (plugin.nodeVisitor) { if ( !parser.addNodeVisitor ) { logger.error('Unable to add the Rhino node visitor from %s, because JSDoc ' + @@ -45,7 +45,7 @@ exports.installPlugins = function(plugins, parser) { } } - //...add a Mozilla Parser API node visitor + // ...add a Mozilla Parser API node visitor if (plugin.astNodeVisitor) { parser.addAstNodeVisitor(plugin.astNodeVisitor); } diff --git a/node_modules/jsdoc/lib/jsdoc/schema.js b/node_modules/jsdoc/lib/jsdoc/schema.js index 0444c6f..d7dc2b6 100644 --- a/node_modules/jsdoc/lib/jsdoc/schema.js +++ b/node_modules/jsdoc/lib/jsdoc/schema.js @@ -110,6 +110,11 @@ var TYPE_PROPERTY_SCHEMA = exports.TYPE_PROPERTY_SCHEMA = { items: { type: STRING } + }, + // type parser output + parsedType: { + type: OBJECT, + additionalProperties: true } } }; @@ -217,7 +222,8 @@ var DOCLET_SCHEMA = exports.DOCLET_SCHEMA = { // TODO: define this as an enumeration elsewhere enum: [ 'private', - 'protected' + 'protected', + 'public' ] }, alias: { @@ -329,14 +335,24 @@ var DOCLET_SCHEMA = exports.DOCLET_SCHEMA = { type: BOOLEAN, optional: true }, - implements: { + implementations: { type: ARRAY, optional: true, - uniqueItems: true, items: { type: STRING } }, + implements: { + type: ARRAY, + optional: true, + items: { + type: STRING + } + }, + inheritdoc: { + type: STRING, + optional: true + }, inherited: { type: BOOLEAN, optional: true @@ -363,6 +379,7 @@ var DOCLET_SCHEMA = exports.DOCLET_SCHEMA = { 'external', 'file', 'function', + 'interface', 'member', 'mixin', 'module', @@ -395,6 +412,11 @@ var DOCLET_SCHEMA = exports.DOCLET_SCHEMA = { }, // information about this doc meta: META_SCHEMA, + // was this doclet mixed in? + mixed: { + type: BOOLEAN, + optional: true + }, mixes: { type: ARRAY, optional: true, @@ -415,6 +437,15 @@ var DOCLET_SCHEMA = exports.DOCLET_SCHEMA = { optional: { type: BOOLEAN_OPTIONAL }, + // does this member explicitly override the parent? + override: { + type: BOOLEAN, + optional: true + }, + overrides: { + type: STRING, + optional: true + }, // are there function parameters associated with this doc? params: { type: ARRAY, @@ -559,18 +590,95 @@ var DOCLET_SCHEMA = exports.DOCLET_SCHEMA = { } }; +var CONTACT_INFO_SCHEMA = exports.CONTACT_INFO_SCHEMA = { + type: OBJECT, + additionalProperties: false, + properties: { + email: { + type: STRING, + optional: true + }, + name: { + type: STRING, + optional: true + }, + url: { + type: STRING, + optional: true, + format: 'uri' + } + } +}; + +var BUGS_SCHEMA = exports.BUGS_SCHEMA = { + type: OBJECT, + additionalProperties: false, + properties: { + email: { + type: STRING, + optional: true + }, + url: { + type: STRING, + optional: true, + format: 'uri' + } + } +}; + var PACKAGE_SCHEMA = exports.PACKAGE_SCHEMA = { type: OBJECT, additionalProperties: false, properties: { + author: { + anyOf: [STRING, CONTACT_INFO_SCHEMA], + optional: true + }, + bugs: { + anyOf: [STRING, BUGS_SCHEMA], + optional: true + }, + contributors: { + type: ARRAY, + optional: true, + minItems: 0, + items: { + anyOf: [STRING, CONTACT_INFO_SCHEMA] + } + }, + dependencies: { + type: OBJECT, + optional: true + }, description: { type: STRING, optional: true }, + devDependencies: { + type: OBJECT, + optional: true + }, + engines: { + type: OBJECT, + optional: true + }, files: { type: ARRAY, uniqueItems: true, - minItems: 1, + minItems: 0, + items: { + type: STRING + } + }, + homepage: { + type: STRING, + optional: true, + format: 'uri' + }, + keywords: { + type: ARRAY, + optional: true, + minItems: 0, items: { type: STRING } @@ -604,10 +712,30 @@ var PACKAGE_SCHEMA = exports.PACKAGE_SCHEMA = { optional: true, pattern: PACKAGE_REGEXP }, + main: { + type: STRING, + optional: true + }, name: { type: STRING, optional: true }, + repository: { + type: OBJECT, + optional: true, + additionalProperties: false, + properties: { + type: { + type: STRING, + optional: true + }, + // we don't use `format: 'uri'` here because repo URLs are atypical + url: { + type: STRING, + optional: true + } + } + }, version: { type: STRING, optional: true @@ -617,7 +745,6 @@ var PACKAGE_SCHEMA = exports.PACKAGE_SCHEMA = { var DOCLETS_SCHEMA = exports.DOCLETS_SCHEMA = { type: ARRAY, - uniqueItems: true, items: { anyOf: [DOCLET_SCHEMA, PACKAGE_SCHEMA] } diff --git a/node_modules/jsdoc/lib/jsdoc/src/astbuilder.js b/node_modules/jsdoc/lib/jsdoc/src/astbuilder.js index e31eba3..ed478e4 100644 --- a/node_modules/jsdoc/lib/jsdoc/src/astbuilder.js +++ b/node_modules/jsdoc/lib/jsdoc/src/astbuilder.js @@ -1,6 +1,16 @@ 'use strict'; -var Syntax = require('jsdoc/src/syntax').Syntax; +var esprima = require('esprima'); +var jsdoc = { + src: { + syntax: require('jsdoc/src/syntax'), + Walker: require('jsdoc/src/walker').Walker + }, + util: { + logger: require('jsdoc/util/logger') + } +}; +var Syntax = jsdoc.src.syntax.Syntax; // TODO: should set e.stopPropagation == true for consistency with Rhino, right? var VISITOR_CONTINUE = true; @@ -110,16 +120,13 @@ function scrubComments(comments) { var AstBuilder = exports.AstBuilder = function() {}; function parse(source, filename, esprimaOpts) { - var esprima = require('esprima'); - var logger = require('jsdoc/util/logger'); - var ast; try { ast = esprima.parse(source, esprimaOpts); } catch (e) { - logger.error('Unable to parse %s: %s', filename, e.message); + jsdoc.util.logger.error('Unable to parse %s: %s', filename, e.message); } return ast; @@ -178,17 +185,16 @@ function CommentAttacher(comments, tokens) { this._tokens = tokens || []; this._tokenIndex = 0; - this._previousNodeEnd = 0; + this._previousNode = null; this._astRoot = null; - this._strayComments = []; - this._resetPendingComment() + this._resetPendingComments() ._resetCandidates(); } // TODO: docs -CommentAttacher.prototype._resetPendingComment = function() { - this._pendingComment = null; +CommentAttacher.prototype._resetPendingComments = function() { + this._pendingComments = []; this._pendingCommentRange = null; return this; @@ -214,7 +220,7 @@ CommentAttacher.prototype._nextToken = function() { // TODO: docs // find the index of the atom whose end position is closest to (but not after) the specified // position -CommentAttacher.prototype._nextIndexBefore = function(startIndex, atoms, position) { +CommentAttacher.prototype._nextIndexBefore = function(atoms, startIndex, position) { var atom; var newIndex = startIndex; @@ -237,7 +243,7 @@ CommentAttacher.prototype._nextIndexBefore = function(startIndex, atoms, positio CommentAttacher.prototype._advanceTokenIndex = function(node) { var position = node.range[0]; - this._tokenIndex = this._nextIndexBefore(this._tokenIndex, this._tokens, position); + this._tokenIndex = this._nextIndexBefore(this._tokens, this._tokenIndex, position); return this; }; @@ -245,33 +251,54 @@ CommentAttacher.prototype._advanceTokenIndex = function(node) { // TODO: docs CommentAttacher.prototype._fastForwardComments = function(node) { var position = node.range[0]; - var commentIndex = this._nextIndexBefore(0, this._comments, position); + var commentIndex = this._nextIndexBefore(this._comments, 0, position); - // all comments before the node (except the last one) are considered stray comments + // all comments before the node (except the last one) are pended if (commentIndex > 0) { - this._strayComments = this._strayComments.concat( this._comments.splice(0, + this._pendingComments = this._pendingComments.concat( this._comments.splice(0, commentIndex) ); } }; +CommentAttacher.prototype._attachPendingCommentsAsLeading = function(target) { + target.leadingComments = (target.leadingComments || []).concat(this._pendingComments); +}; + +CommentAttacher.prototype._attachPendingCommentsAsTrailing = function(target) { + target.trailingComments = (target.trailingComments || []).concat(this._pendingComments); +}; + // TODO: docs -CommentAttacher.prototype._attachPendingComment = function() { +CommentAttacher.prototype._attachPendingComments = function(currentNode) { var target; - if (!this._pendingComment) { + if (!this._pendingComments.length) { return this; } + // if there are one or more candidate nodes, attach the pending comments before the last + // candidate node if (this._candidates.length > 0) { target = this._candidates[this._candidates.length - 1]; - target.leadingComments = target.leadingComments || []; - target.leadingComments.push(this._pendingComment); + this._attachPendingCommentsAsLeading(target); } + // if we don't have a previous node, attach pending comments before the AST root; this should + // mean that we haven't encountered any other nodes yet, or that the source file contains + // JSDoc comments but not code + else if (!this._previousNode) { + target = this._astRoot; + this._attachPendingCommentsAsLeading(target); + } + // otherwise, the comments must come after the current node (or the last node of the AST, if + // we've run out of nodes) else { - this._strayComments.push(this._pendingComment); + this._attachPendingCommentsAsTrailing(currentNode || this._previousNode); } - this._resetPendingComment() + // update the previous node + this._previousNode = currentNode; + + this._resetPendingComments() ._resetCandidates(); return this; @@ -322,8 +349,8 @@ CommentAttacher.prototype.visit = function(node) { // now we can check whether the current node is in the right position to accept the next comment isEligible = this._isEligible(node); - // attach the pending comment, if there is one - this._attachPendingComment(); + // attach the pending comments, if any + this._attachPendingComments(node); // okay, now that we've done all that bookkeeping, we can check whether the current node accepts // leading comments and add it to the candidate list if needed @@ -334,8 +361,8 @@ CommentAttacher.prototype.visit = function(node) { } this._candidates.push(node); - // we have a candidate node, so pend the current comment if necessary - this._pendingComment = this._pendingComment || this._comments.splice(0, 1)[0]; + // we have a candidate node, so pend the current comment + this._pendingComments.push(this._comments.splice(0, 1)[0]); } return VISITOR_CONTINUE; @@ -343,44 +370,50 @@ CommentAttacher.prototype.visit = function(node) { // TODO: docs CommentAttacher.prototype.finish = function() { - // any remaining comments are stray comments - this._strayComments = this._strayComments.concat(this._comments); + var length = this._comments.length; - // deal with the pending comment, if there is one - this._attachPendingComment(); - - // attach stray comments to the AST root - if (this._strayComments.length) { - this._astRoot.trailingComments = this._strayComments.slice(0); + // any leftover comments are pended + if (length) { + this._pendingComments = this._pendingComments.concat( this._comments.splice(0, length) ); } + + // attach the pending comments, if any + this._attachPendingComments(); }; // TODO: docs // TODO: refactor to make this extensible /** + * @private * @param {string} filename - The full path to the source file. * @param {Object} ast - An abstract syntax tree that conforms to the Mozilla Parser API. */ AstBuilder.prototype._postProcess = function(filename, ast) { - var astnode = require('jsdoc/src/astnode'); - var Walker = require('jsdoc/src/walker').Walker; - var attachComments = !!ast.comments && !!ast.comments.length; - var commentAttacher = new CommentAttacher( scrubComments(ast.comments.slice(0)), ast.tokens ); - var visitor = { + var commentAttacher; + var scrubbed; + var visitor; + var walker; + + if (!attachComments) { + return; + } + + scrubbed = scrubComments(ast.comments.slice(0)); + commentAttacher = new CommentAttacher(scrubbed.slice(0), ast.tokens); + visitor = { visit: function(node) { - if (attachComments) { - attachComments = commentAttacher.visit(node); - } + return commentAttacher.visit(node); } }; + walker = new jsdoc.src.Walker(); - var walker = new Walker(); - walker.recurse(filename, ast, visitor); + walker.recurse(ast, visitor, filename); commentAttacher.finish(); - // remove the comment/token arrays; we no longer need then - ast.comments = []; + // replace the comments with the filtered comments + ast.comments = scrubbed; + // we no longer need the tokens ast.tokens = []; }; diff --git a/node_modules/jsdoc/lib/jsdoc/src/astnode.js b/node_modules/jsdoc/lib/jsdoc/src/astnode.js index 4127f19..a89e652 100644 --- a/node_modules/jsdoc/lib/jsdoc/src/astnode.js +++ b/node_modules/jsdoc/lib/jsdoc/src/astnode.js @@ -1,20 +1,17 @@ // TODO: docs +/** @module jsdoc/src/astnode */ 'use strict'; -var doop = require('jsdoc/util/doop'); var Syntax = require('jsdoc/src/syntax').Syntax; var util = require('util'); // Counter for generating unique node IDs. var uid = 100000000; -// TODO: docs -// TODO: currently unused -var GLOBAL_NODE_ID = exports.GLOBAL_NODE_ID = require('jsdoc/name').GLOBAL_LONGNAME; - /** * Check whether an AST node represents a function. * + * @alias module:jsdoc/src/astnode.isFunction * @param {Object} node - The AST node to check. * @return {boolean} Set to `true` if the node is a function or `false` in all other cases. */ @@ -25,6 +22,7 @@ var isFunction = exports.isFunction = function(node) { /** * Check whether an AST node creates a new scope. * + * @alias module:jsdoc/src/astnode.isScope * @param {Object} node - The AST node to check. * @return {Boolean} Set to `true` if the node creates a new scope, or `false` in all other cases. */ @@ -66,30 +64,6 @@ var addNodeProperties = exports.addNodeProperties = function(node) { }; } - if (!node.knownVariables) { - newProperties.knownVariables = { - value: node.enclosingScope ? doop(node.enclosingScope.knownVariables) : {} - }; - } - - if (!node.ownedVariables) { - newProperties.ownedVariables = { - value: {} - }; - } - - if (!node.knownAliases) { - newProperties.knownAliases = { - value: node.enclosingScope ? doop(node.enclosingScope.knownAliases) : {} - }; - } - - if (!node.ownedAliases) { - newProperties.ownedAliases = { - value: {} - }; - } - if (debugEnabled && !node.parentId) { newProperties.parentId = { enumerable: true, @@ -113,21 +87,6 @@ var addNodeProperties = exports.addNodeProperties = function(node) { return node; }; -// TODO: docs -// TODO: currently unused -exports.makeGlobalNode = function() { - var node = { - name: GLOBAL_NODE_ID, - type: GLOBAL_NODE_ID - }; - - Object.defineProperty(node, 'nodeId', { - value: GLOBAL_NODE_ID - }); - - return addNodeProperties(node); -}; - // TODO: docs var nodeToString = exports.nodeToString = function(node) { var tempObject; @@ -138,8 +97,13 @@ var nodeToString = exports.nodeToString = function(node) { case Syntax.ArrayExpression: tempObject = []; node.elements.forEach(function(el, i) { + // handle sparse arrays. use `null` to represent missing values, consistent with + // JSON.stringify([,]). + if (!el) { + tempObject[i] = null; + } // preserve literal values so that the JSON form shows the correct type - if (el.type === Syntax.Literal) { + else if (el.type === Syntax.Literal) { tempObject[i] = el.value; } else { @@ -253,6 +217,7 @@ var isAssignment = exports.isAssignment = function(node) { // TODO: docs /** * Retrieve information about the node, including its name and type. + * @alias module:jsdoc/src/astnode.getInfo */ var getInfo = exports.getInfo = function(node) { var info = {}; @@ -336,56 +301,3 @@ var getInfo = exports.getInfo = function(node) { return info; }; - -// TODO: may want to use separate methods for known and owned variables/functions/aliases - -// TODO: docs -function _addVariable(node, name, value) { - node.knownVariables[name] = node.ownedVariables[name] = value; -} - -// TODO: docs -var addVariable = exports.addVariable = function(node, declarator) { - var name = declarator.id.name; - var value = (declarator.init || null); - _addVariable(node, name, value); - - return node; -}; - -// TODO: docs -var addAllVariables = exports.addAllVariables = function(node, declaration) { - for (var i = 0, l = declaration.declarations.length; i < l; i++) { - addVariable(node, declaration.declarations[i]); - } - - return node; -}; - -// TODO: docs -var addFunction = exports.addFunction = function(node, declaration) { - // TODO: should we store these separately, since they're hoisted above variable declarations? - // right now we appear to give functions and variables equal precedence, which is wrong - - // don't add anonymous functions - if (declaration.id) { - _addVariable(node, declaration.id.name, null); - } - - return node; -}; - -// TODO: docs -var addAlias = exports.addAlias = function(node, variableName, aliasName) { - [node.knownAliases, node.ownedAliases].forEach(function(target) { - if ( !Array.isArray(target[aliasName]) ) { - target[aliasName] = []; - } - - if (target[aliasName].indexOf(variableName) === -1) { - target[aliasName].push(variableName); - } - }); - - return node; -}; diff --git a/node_modules/jsdoc/lib/jsdoc/src/handlers.js b/node_modules/jsdoc/lib/jsdoc/src/handlers.js index f25368e..6773e9b 100644 --- a/node_modules/jsdoc/lib/jsdoc/src/handlers.js +++ b/node_modules/jsdoc/lib/jsdoc/src/handlers.js @@ -3,6 +3,7 @@ */ 'use strict'; +var escape = require('escape-string-regexp'); var jsdoc = { doclet: require('jsdoc/doclet'), name: require('jsdoc/name'), @@ -13,22 +14,68 @@ var jsdoc = { var util = require('util'); var currentModule = null; +var SCOPE_NAMES = jsdoc.name.SCOPE.NAMES; +var SCOPE_PUNC = jsdoc.name.SCOPE.PUNC; +var unresolvedName = /^((?:module.)?exports|this)(\.|$)/; -var moduleRegExp = /^((?:module.)?exports|this)(\.|$)/; +function CurrentModule(doclet) { + this.doclet = doclet; + this.longname = doclet.longname; + this.originalName = doclet.meta.code.name || ''; +} -function getNewDoclet(comment, e) { - var Doclet = jsdoc.doclet.Doclet; +function filterByLongname(doclet) { + // you can't document prototypes + if ( /#$/.test(doclet.longname) ) { + return true; + } + + return false; +} + +function createDoclet(comment, e) { var doclet; var err; try { - doclet = new Doclet(comment, e); + doclet = new jsdoc.doclet.Doclet(comment, e); } catch (error) { err = new Error( util.format('cannot create a doclet for the comment "%s": %s', comment.replace(/[\r\n]/g, ''), error.message) ); jsdoc.util.logger.error(err); - doclet = new Doclet('', e); + doclet = new jsdoc.doclet.Doclet('', e); + } + + return doclet; +} + +/** + * Create a doclet for a `symbolFound` event. The doclet represents an actual symbol that is defined + * in the code. + * + * Here's why this function is useful. A JSDoc comment can define a symbol name by including: + * + * + A `@name` tag + * + Another tag that accepts a name, such as `@function` + * + * When the JSDoc comment defines a symbol name, we treat it as a "virtual comment" for a symbol + * that isn't actually present in the code. And if a virtual comment is attached to a symbol, it's + * possible that the comment and symbol have nothing to do with one another. + * + * To handle this case, this function checks the new doclet to see if we've already added a name + * property by parsing the JSDoc comment. If so, this method creates a replacement doclet that + * ignores the attached JSDoc comment and only looks at the code. + * + * @private + */ +function createSymbolDoclet(comment, e) { + var doclet = createDoclet(comment, e); + + if (doclet.name) { + // try again, without the comment + e.comment = '@undocumented'; + doclet = createDoclet(e.comment, e); } return doclet; @@ -36,192 +83,239 @@ function getNewDoclet(comment, e) { function setCurrentModule(doclet) { if (doclet.kind === 'module') { - currentModule = doclet.longname; + currentModule = new CurrentModule(doclet); } } -function setDefaultScopeMemberOf(doclet) { - // add @inner and @memberof tags unless the current module exports only this symbol - if (currentModule && currentModule !== doclet.name) { - // add @inner unless the current module exports only this symbol +function setModuleScopeMemberOf(doclet) { + // handle module symbols that are _not_ assigned to module.exports + if (currentModule && currentModule.longname !== doclet.name) { + // if we don't already know the scope, it must be an inner member if (!doclet.scope) { doclet.addTag('inner'); } - if (!doclet.memberof && doclet.scope !== 'global') { - doclet.addTag('memberof', currentModule); + // if the doclet isn't a memberof anything yet, and it's not a global, it must be a memberof + // the current module + if (!doclet.memberof && doclet.scope !== SCOPE_NAMES.GLOBAL) { + doclet.addTag('memberof', currentModule.longname); } } } +function setDefaultScope(doclet) { + // module doclets don't get a default scope + if (!doclet.scope && doclet.kind !== 'module') { + doclet.setScope(SCOPE_NAMES.GLOBAL); + } +} + +function addDoclet(parser, newDoclet) { + var e; + if (newDoclet) { + setCurrentModule(newDoclet); + e = { doclet: newDoclet }; + parser.emit('newDoclet', e); + + if ( !e.defaultPrevented && !filterByLongname(e.doclet) ) { + parser.addResult(e.doclet); + } + } +} + +function processAlias(parser, doclet, astNode) { + var memberofName; + + if (doclet.alias === '{@thisClass}') { + memberofName = parser.resolveThis(astNode); + + // "class" refers to the owner of the prototype, not the prototype itself + if ( /^(.+?)(\.prototype|#)$/.test(memberofName) ) { + memberofName = RegExp.$1; + } + doclet.alias = memberofName; + } + + doclet.addTag('name', doclet.alias); + doclet.postProcess(); +} + +// TODO: separate code that resolves `this` from code that resolves the module object +function findSymbolMemberof(parser, doclet, astNode, nameStartsWith, trailingPunc) { + var memberof = ''; + var nameAndPunc = nameStartsWith + (trailingPunc || ''); + var scopePunc = ''; + + // remove stuff that indicates module membership (but don't touch the name `module.exports`, + // which identifies the module object itself) + if (doclet.name !== 'module.exports') { + doclet.name = doclet.name.replace(nameAndPunc, ''); + } + + // like `bar` in: + // exports.bar = 1; + // module.exports.bar = 1; + // module.exports = MyModuleObject; MyModuleObject.bar = 1; + if (nameStartsWith !== 'this' && currentModule && doclet.name !== 'module.exports') { + memberof = currentModule.longname; + scopePunc = SCOPE_PUNC.STATIC; + } + // like: module.exports = 1; + else if (doclet.name === 'module.exports' && currentModule) { + doclet.addTag('name', currentModule.longname); + doclet.postProcess(); + } + else { + memberof = parser.resolveThis(astNode); + + // like the following at the top level of a module: + // this.foo = 1; + if (nameStartsWith === 'this' && currentModule && !memberof) { + memberof = currentModule.longname; + scopePunc = SCOPE_PUNC.STATIC; + } + else { + scopePunc = SCOPE_PUNC.INSTANCE; + } + } + + return { + memberof: memberof, + scopePunc: scopePunc + }; +} + +function addSymbolMemberof(parser, doclet, astNode) { + var basename; + var memberof; + var memberofInfo; + var moduleOriginalName = ''; + var resolveTargetRegExp; + var scopePunc; + var unresolved; + + if (!astNode) { + return; + } + + // check to see if the doclet name is an unresolved reference to the module object, or to `this` + // TODO: handle cases where the module object is shadowed in the current scope + if (currentModule) { + moduleOriginalName = '|' + currentModule.originalName; + } + resolveTargetRegExp = new RegExp('^((?:module.)?exports|this' + moduleOriginalName + + ')(\\.|$)'); + unresolved = resolveTargetRegExp.exec(doclet.name); + + if (unresolved) { + memberofInfo = findSymbolMemberof(parser, doclet, astNode, unresolved[1], unresolved[2]); + memberof = memberofInfo.memberof; + scopePunc = memberofInfo.scopePunc; + + if (memberof) { + doclet.name = doclet.name ? + memberof + scopePunc + doclet.name : + memberof; + } + } + else { + memberofInfo = parser.astnodeToMemberof(astNode); + if ( Array.isArray(memberofInfo) ) { + basename = memberofInfo[1]; + memberof = memberofInfo[0]; + } + else { + memberof = memberofInfo; + } + } + + // if we found a memberof name, apply it to the doclet + if (memberof) { + doclet.addTag('memberof', memberof); + if (basename) { + doclet.name = (doclet.name || '') + .replace(new RegExp('^' + escape(basename) + '.'), ''); + } + } + // otherwise, add the defaults for a module (if we're currently in a module) + else { + setModuleScopeMemberOf(doclet); + } +} + +function newSymbolDoclet(parser, docletSrc, e) { + var memberofName = null; + var newDoclet = createSymbolDoclet(docletSrc, e); + + // if there's an alias, use that as the symbol name + if (newDoclet.alias) { + processAlias(parser, newDoclet, e.astnode); + } + // otherwise, get the symbol name from the code + else if (e.code && e.code.name) { + newDoclet.addTag('name', e.code.name); + if (!newDoclet.memberof) { + addSymbolMemberof(parser, newDoclet, e.astnode); + } + + newDoclet.postProcess(); + } + else { + return false; + } + + // set the scope to global unless any of the following are true: + // a) the doclet is a memberof something + // b) the doclet represents a module + // c) we're in a module that exports only this symbol + if ( !newDoclet.memberof && newDoclet.kind !== 'module' && + (!currentModule || currentModule.longname !== newDoclet.name) ) { + newDoclet.scope = SCOPE_NAMES.GLOBAL; + } + + addDoclet(parser, newDoclet); + e.doclet = newDoclet; +} + /** * Attach these event handlers to a particular instance of a parser. * @param parser */ exports.attachTo = function(parser) { - function filter(doclet) { - // you can't document prototypes - if ( /#$/.test(doclet.longname) ) { - return true; - } - - return false; - } - - function addDoclet(newDoclet) { - var e; - if (newDoclet) { - setCurrentModule(newDoclet); - e = { doclet: newDoclet }; - parser.emit('newDoclet', e); - - if ( !e.defaultPrevented && !filter(e.doclet) ) { - parser.addResult(e.doclet); - } - } - } - - // TODO: for clarity, decompose into smaller functions - function newSymbolDoclet(docletSrc, e) { - var memberofName = null, - newDoclet = getNewDoclet(docletSrc, e); - - // A JSDoc comment can define a symbol name by including: - // - // + A `@name` tag - // + Another tag that accepts a name, such as `@function` - // - // When the JSDoc comment defines a symbol name, we treat it as a "virtual comment" for a - // symbol that isn't actually present in the code. And if a virtual comment is attached to - // a symbol, it's quite possible that the comment and symbol have nothing to do with one - // another. - // - // As a result, if we create a doclet for a `symbolFound` event, and we've already added a - // name attribute by parsing the JSDoc comment, we need to create a new doclet that ignores - // the attached JSDoc comment and only looks at the code. - if (newDoclet.name) { - // try again, without the comment - e.comment = '@undocumented'; - newDoclet = getNewDoclet(e.comment, e); - } - - if (newDoclet.alias) { - if (newDoclet.alias === '{@thisClass}') { - memberofName = parser.resolveThis(e.astnode); - - // "class" refers to the owner of the prototype, not the prototype itself - if ( /^(.+?)(\.prototype|#)$/.test(memberofName) ) { - memberofName = RegExp.$1; - } - newDoclet.alias = memberofName; - } - newDoclet.addTag('name', newDoclet.alias); - newDoclet.postProcess(); - } - else if (e.code && e.code.name) { // we need to get the symbol name from code - newDoclet.addTag('name', e.code.name); - if (!newDoclet.memberof && e.astnode) { - var basename = null, - scope = ''; - if ( moduleRegExp.test(newDoclet.name) ) { - var nameStartsWith = RegExp.$1; - - // remove stuff that indicates module membership (but don't touch the name - // `module.exports`, which identifies the module object itself) - if (newDoclet.name !== 'module.exports') { - newDoclet.name = newDoclet.name.replace(moduleRegExp, ''); - } - - // like /** @module foo */ exports.bar = 1; - // or /** @module foo */ module.exports.bar = 1; - // but not /** @module foo */ module.exports = 1; - if ( (nameStartsWith === 'exports' || nameStartsWith === 'module.exports') && - newDoclet.name !== 'module.exports' && currentModule ) { - memberofName = currentModule; - scope = 'static'; - } - else if (newDoclet.name === 'module.exports' && currentModule) { - newDoclet.addTag('name', currentModule); - newDoclet.postProcess(); - } - else { - // like /** @module foo */ exports = {bar: 1}; - // or /** blah */ this.foo = 1; - memberofName = parser.resolveThis(e.astnode); - scope = nameStartsWith === 'exports' ? 'static' : 'instance'; - - // like /** @module foo */ this.bar = 1; - if (nameStartsWith === 'this' && currentModule && !memberofName) { - memberofName = currentModule; - scope = 'static'; - } - } - - if (memberofName) { - if (newDoclet.name) { - newDoclet.name = memberofName + (scope === 'instance' ? '#' : '.') + - newDoclet.name; - } - else { newDoclet.name = memberofName; } - } - } - else { - memberofName = parser.astnodeToMemberof(e.astnode); - if( Array.isArray(memberofName) ) { - basename = memberofName[1]; - memberofName = memberofName[0]; - } - } - - if (memberofName) { - newDoclet.addTag('memberof', memberofName); - if (basename) { - newDoclet.name = (newDoclet.name || '') - .replace(new RegExp('^' + RegExp.escape(basename) + '.'), ''); - } - } - else { - setDefaultScopeMemberOf(newDoclet); - } - } - - newDoclet.postProcess(); - } - else { - return false; - } - - // set the scope to global unless a) the doclet is a memberof something or b) the current - // module exports only this symbol - if (!newDoclet.memberof && currentModule !== newDoclet.name) { - newDoclet.scope = 'global'; - } - - addDoclet.call(parser, newDoclet); - e.doclet = newDoclet; - } - - // handles JSDoc comments that include a @name tag -- the code is ignored in such a case + // Handle JSDoc "virtual comments" that include one of the following: + // + A `@name` tag + // + Another tag that accepts a name, such as `@function` parser.on('jsdocCommentFound', function(e) { - var newDoclet = getNewDoclet(e.comment, e); + var comments = e.comment.split(/@also\b/g); + var newDoclet; - if (!newDoclet.name) { - return false; // only interested in virtual comments (with a @name) here + for (var i = 0, l = comments.length; i < l; i++) { + newDoclet = createDoclet(comments[i], e); + + // we're only interested in virtual comments here + if (!newDoclet.name) { + continue; + } + + // add the default scope/memberof for a module (if we're in a module) + setModuleScopeMemberOf(newDoclet); + newDoclet.postProcess(); + + // if we _still_ don't have a scope, use the default + setDefaultScope(newDoclet); + + addDoclet(parser, newDoclet); + + e.doclet = newDoclet; } - - setDefaultScopeMemberOf(newDoclet); - newDoclet.postProcess(); - addDoclet.call(parser, newDoclet); - - e.doclet = newDoclet; }); - // handles named symbols in the code, may or may not have a JSDoc comment attached + // Handle named symbols in the code. May or may not have a JSDoc comment attached. parser.on('symbolFound', function(e) { - var subDoclets = e.comment.split(/@also\b/g); + var comments = e.comment.split(/@also\b/g); - for (var i = 0, l = subDoclets.length; i < l; i++) { - newSymbolDoclet.call(parser, subDoclets[i], e); + for (var i = 0, l = comments.length; i < l; i++) { + newSymbolDoclet(parser, comments[i], e); } }); diff --git a/node_modules/jsdoc/lib/jsdoc/src/parser.js b/node_modules/jsdoc/lib/jsdoc/src/parser.js index 121bf0f..048a68a 100644 --- a/node_modules/jsdoc/lib/jsdoc/src/parser.js +++ b/node_modules/jsdoc/lib/jsdoc/src/parser.js @@ -1,57 +1,45 @@ -/*global env, Packages */ -/*eslint no-script-url:0 */ /** * @module jsdoc/src/parser */ 'use strict'; +var events = require('events'); +var fs = require('jsdoc/fs'); var jsdoc = { doclet: require('jsdoc/doclet'), name: require('jsdoc/name'), src: { astnode: require('jsdoc/src/astnode'), syntax: require('jsdoc/src/syntax') + }, + util: { + doop: require('jsdoc/util/doop'), + runtime: require('jsdoc/util/runtime') } }; var logger = require('jsdoc/util/logger'); +var path = require('jsdoc/path'); var util = require('util'); var hasOwnProp = Object.prototype.hasOwnProperty; var Syntax = jsdoc.src.syntax.Syntax; -// Prefix for JavaScript strings that were provided in lieu of a filename. -var SCHEMA = 'javascript:'; // TODO: docs var PARSERS = exports.PARSERS = { esprima: 'jsdoc/src/parser', rhino: 'rhino/jsdoc/src/parser' }; - -// TODO: docs -// TODO: not currently used -function makeGlobalDoclet(globalScope) { - var doclet = new jsdoc.doclet.Doclet('/** Auto-generated doclet for global scope */', {}); - - if (globalScope) { - // TODO: handle global aliases - Object.keys(globalScope.ownedVariables).forEach(function(variable) { - doclet.meta.vars = doclet.meta.vars || {}; - doclet.meta.vars[variable] = null; - }); - } - - return doclet; -} +/*eslint-disable no-script-url */ +// Prefix for JavaScript strings that were provided in lieu of a filename. +var SCHEMA = 'javascript:'; +/*eslint-enable no-script-url */ // TODO: docs exports.createParser = function(type) { - var path = require('jsdoc/path'); - var runtime = require('jsdoc/util/runtime'); - var modulePath; if (!type) { - type = runtime.isRhino() ? 'rhino' : 'esprima'; + type = jsdoc.util.runtime.isRhino() ? 'rhino' : 'esprima'; } if (PARSERS[type]) { @@ -72,6 +60,7 @@ exports.createParser = function(type) { // TODO: docs /** * @class + * @alias module:jsdoc/src/parser.Parser * @mixes module:events.EventEmitter * * @example Create a new parser. @@ -102,14 +91,14 @@ var Parser = exports.Parser = function(builderInstance, visitorInstance, walkerI } }); }; -util.inherits(Parser, require('events').EventEmitter); +util.inherits(Parser, events.EventEmitter); // TODO: docs Parser.prototype.clear = function() { this._resultBuffer = []; this.refs = {}; - this.refs[jsdoc.src.astnode.GLOBAL_NODE_ID] = {}; - this.refs[jsdoc.src.astnode.GLOBAL_NODE_ID].meta = {}; + this.refs[jsdoc.name.LONGNAMES.GLOBAL] = {}; + this.refs[jsdoc.name.LONGNAMES.GLOBAL].meta = {}; }; // TODO: update docs @@ -131,7 +120,7 @@ Parser.prototype.clear = function() { * var docs = jsdocParser.parse(myFiles); */ Parser.prototype.parse = function(sourceFiles, encoding) { - encoding = encoding || env.conf.encoding || 'utf8'; + encoding = encoding || global.env.conf.encoding || 'utf8'; var filename = ''; var sourceCode = ''; @@ -157,7 +146,7 @@ Parser.prototype.parse = function(sourceFiles, encoding) { else { filename = sourceFiles[i]; try { - sourceCode = require('jsdoc/fs').readFileSync(filename, encoding); + sourceCode = fs.readFileSync(filename, encoding); } catch(e) { logger.error('Unable to read and parse the source file %s: %s', filename, e); @@ -244,15 +233,19 @@ Parser.prototype._parseSourceCode = function(sourceCode, sourceName) { ast = this._astBuilder.build(sourceCode, sourceName); if (ast) { - this._walker.recurse(sourceName, ast, this._visitor); + this._walkAst(ast, this._visitor, sourceName); } - } this.emit('fileComplete', e); logger.info('complete.'); }; +/** @private */ +Parser.prototype._walkAst = function(ast, visitor, sourceName) { + this._walker.recurse(ast, visitor, sourceName); +}; + // TODO: docs Parser.prototype.addDocletRef = function(e) { var node; @@ -268,7 +261,7 @@ Parser.prototype.addDocletRef = function(e) { (node.type === Syntax.FunctionDeclaration || node.type === Syntax.FunctionExpression) && !this.refs[node.nodeId] ) { this.refs[node.nodeId] = { - longname: jsdoc.name.ANONYMOUS_LONGNAME, + longname: jsdoc.name.LONGNAMES.ANONYMOUS, meta: { code: e.code } @@ -322,10 +315,10 @@ Parser.prototype.astnodeToMemberof = function(node) { doclet = this._getDoclet(node.enclosingScope.nodeId); if (!doclet) { - result = jsdoc.name.ANONYMOUS_LONGNAME + jsdoc.name.INNER; + result = jsdoc.name.LONGNAMES.ANONYMOUS + jsdoc.name.SCOPE.PUNC.INNER; } else { - result = (doclet.longname || doclet.name) + jsdoc.name.INNER; + result = (doclet.longname || doclet.name) + jsdoc.name.SCOPE.PUNC.INNER; } } else { @@ -347,7 +340,7 @@ Parser.prototype.astnodeToMemberof = function(node) { } // do we know that it's a global? - doclet = this.refs[jsdoc.src.astnode.GLOBAL_NODE_ID]; + doclet = this.refs[jsdoc.name.LONGNAMES.GLOBAL]; if ( doclet && definedInScope(doclet, basename) ) { result = [doclet.meta.vars[basename], basename]; } @@ -378,16 +371,15 @@ Parser.prototype.resolveThis = function(node) { var result; // In general, if there's an enclosing scope, we use the enclosing scope to resolve `this`. - // For object properties, we use the node's parent (the object) instead. This is a consequence - // of the source-rewriting hackery that we use to support the `@lends` tag. + // For object properties, we use the node's parent (the object) instead. if (node.type !== Syntax.Property && node.enclosingScope) { doclet = this._getDoclet(node.enclosingScope.nodeId); if (!doclet) { - result = jsdoc.name.ANONYMOUS_LONGNAME; // TODO handle global this? + result = jsdoc.name.LONGNAMES.ANONYMOUS; // TODO handle global this? } - else if (doclet['this']) { - result = doclet['this']; + else if (doclet.this) { + result = doclet.this; } // like: Foo.constructor = function(n) { /** blah */ this.name = n; } else if (doclet.kind === 'function' && doclet.memberof) { @@ -424,21 +416,48 @@ Parser.prototype.resolveThis = function(node) { return result; }; -// TODO: docs /** - * Given 'var foo = { x: 1 }', find foo from x. + * Given an AST node representing an object property, find the doclets for the parent object or + * objects. + * + * If the object is part of a simple assignment (for example, `var foo = { x: 1 }`), this method + * returns a single doclet (in this case, the doclet for `foo`). + * + * If the object is part of a chained assignment (for example, `var foo = exports.FOO = { x: 1 }`, + * this method returns multiple doclets (in this case, the doclets for `foo` and `exports.FOO`). + * + * @param {Object} node - An AST node representing an object property. + * @return {Array.} An array of doclets for the parent object or objects, or + * an empty array if no doclets are found. */ -Parser.prototype.resolvePropertyParent = function(node) { +Parser.prototype.resolvePropertyParents = function(node) { + var currentAncestor = node.parent; + var nextAncestor = currentAncestor ? currentAncestor.parent : null; var doclet; + var doclets = []; - if (node.parent) { - doclet = this._getDoclet(node.parent.nodeId); + while (currentAncestor) { + doclet = this._getDoclet(currentAncestor.nodeId); + if (doclet) { + doclets.push(doclet); + } + + // if the next ancestor is an assignment expression (for example, `exports.FOO` in + // `var foo = exports.FOO = { x: 1 }`, keep walking upwards + if (nextAncestor && nextAncestor.type === Syntax.AssignmentExpression) { + nextAncestor = nextAncestor.parent; + currentAncestor = currentAncestor.parent; + } + // otherwise, we're done + else { + currentAncestor = null; + } } - return doclet; + return doclets; }; -// TODO docs +// TODO: docs /** * Resolve what function a var is limited to. * @param {astnode} node @@ -447,10 +466,14 @@ Parser.prototype.resolvePropertyParent = function(node) { Parser.prototype.resolveVar = function(node, basename) { var doclet; var result; - var scope = node.enclosingScope; - if (!scope) { + // HACK: return an empty string for function declarations so they don't end up in anonymous + // scope (see #685 and #693) + if (node.type === Syntax.FunctionDeclaration) { + result = ''; + } + else if (!scope) { result = ''; // global } else { @@ -468,24 +491,25 @@ Parser.prototype.resolveVar = function(node, basename) { // TODO: docs Parser.prototype.resolveEnum = function(e) { - var doclet = this.resolvePropertyParent(e.code.node.parent); + var doclets = this.resolvePropertyParents(e.code.node.parent); - if (doclet && doclet.isEnum) { - if (!doclet.properties) { - doclet.properties = []; + doclets.forEach(function(doclet) { + if (doclet && doclet.isEnum) { + doclet.properties = doclet.properties || []; + + // members of an enum inherit the enum's type + if (doclet.type && !e.doclet.type) { + // clone the type to prevent circular refs + e.doclet.type = jsdoc.util.doop(doclet.type); + } + + delete e.doclet.undocumented; + e.doclet.defaultvalue = e.doclet.meta.code.value; + + // add the doclet to the parent's properties + doclet.properties.push(e.doclet); } - - // members of an enum inherit the enum's type - if (doclet.type && !e.doclet.type) { - e.doclet.type = doclet.type; - } - - delete e.doclet.undocumented; - e.doclet.defaultvalue = e.doclet.meta.code.value; - - // add a copy of the doclet to the parent's properties - doclet.properties.push( require('jsdoc/util/doop').doop(e.doclet) ); - } + }); }; // TODO: document other events @@ -493,8 +517,8 @@ Parser.prototype.resolveEnum = function(e) { * Fired once for each JSDoc comment in the current source code. * @event jsdocCommentFound * @memberof module:jsdoc/src/parser.Parser - * @param {event} e - * @param {string} e.comment The text content of the JSDoc comment - * @param {number} e.lineno The line number associated with the found comment. - * @param {string} e.filename The file name associated with the found comment. + * @type {Object} + * @property {string} comment The text content of the JSDoc comment + * @property {number} lineno The line number associated with the found comment. + * @property {string} filename The file name associated with the found comment. */ diff --git a/node_modules/jsdoc/lib/jsdoc/src/visitor.js b/node_modules/jsdoc/lib/jsdoc/src/visitor.js index 7e97fa1..2572132 100644 --- a/node_modules/jsdoc/lib/jsdoc/src/visitor.js +++ b/node_modules/jsdoc/lib/jsdoc/src/visitor.js @@ -7,6 +7,7 @@ var jsdoc = { doclet: require('jsdoc/doclet'), + name: require('jsdoc/name'), src: { astnode: require('jsdoc/src/astnode'), syntax: require('jsdoc/src/syntax') @@ -36,7 +37,7 @@ function getLeadingComment(node) { function makeVarsFinisher(scopeDoclet) { return function(e) { // no need to evaluate all things related to scopeDoclet again, just use it - if (scopeDoclet && e.doclet && e.doclet.alias) { + if ( scopeDoclet && e.doclet && (e.doclet.alias || e.doclet.memberof) ) { scopeDoclet.meta.vars[e.code.name] = e.doclet.longname; } }; @@ -69,6 +70,12 @@ function makeInlineParamsFinisher(parser) { return; } + // we only want to use the doclet if it's param-specific (but not, for example, if it's + // a param tagged with `@exports` in an AMD module) + if (e.doclet.kind !== 'param') { + return; + } + parentDoclet.params = parentDoclet.params || []; documentedParams = parentDoclet.params; knownParams = parentDoclet.meta.code.paramnames; @@ -76,9 +83,8 @@ function makeInlineParamsFinisher(parser) { while (true) { param = documentedParams[i]; - // is the param already documented? if so, we're done + // is the param already documented? if so, we don't need to use the doclet if (param && param.name === e.doclet.name) { - // the doclet is no longer needed e.doclet.undocumented = true; break; } @@ -176,13 +182,6 @@ Visitor.prototype.visit = function(node, filename) { this._visitors[i].call(this, node, this._parser, filename); } - // we also need to visit standalone comments, which are not attached to a node - if (node.type === Syntax.Program && node.comments && node.comments.length) { - for (i = 0, l = node.comments.length; i < l; i++) { - this.visitNodeComments.call(this, node.comments[i], this._parser, filename); - } - } - return true; }; @@ -200,8 +199,8 @@ function isValidJsdoc(commentSrc) { // TODO: docs function hasJsdocComments(node) { - return (node && node.leadingComments && node.leadingComments.length > 0) || - (node && node.trailingComments && node.trailingComments.length > 0); + return (node && node.leadingComments && node.leadingComments.length) || + (node && node.trailingComments && node.trailingComments.length); } // TODO: docs @@ -227,13 +226,10 @@ Visitor.prototype.visitNodeComments = function(node, parser, filename) { return true; } - comments = []; - if (node.type === BLOCK_COMMENT) { - comments.push(node); - } + comments = (node.type === BLOCK_COMMENT) ? [node] : []; if (node.leadingComments && node.leadingComments.length) { - comments = node.leadingComments.slice(0); + comments = comments.concat( node.leadingComments.slice(0) ); } if (node.trailingComments && node.trailingComments.length) { @@ -263,12 +259,6 @@ Visitor.prototype.visitNode = function(node, parser, filename) { var e = this.makeSymbolFoundEvent(node, parser, filename); - if (!node.nodeId) { - Object.defineProperty(node, 'nodeId', { - value: parser.getUniqueId() - }); - } - if (this._nodeVisitors && this._nodeVisitors.length) { for (i = 0, l = this._nodeVisitors.length; i < l; i++) { this._nodeVisitors[i].visitNode(node, e, parser, filename); @@ -294,10 +284,9 @@ Visitor.prototype.visitNode = function(node, parser, filename) { // TODO: docs // TODO: note that it's essential to call this function before you try to resolve names! -// TODO: may be able to get rid of this using knownAliases function trackVars(parser, node, e) { var enclosingScopeId = node.enclosingScope ? node.enclosingScope.nodeId : - jsdoc.src.astnode.GLOBAL_NODE_ID; + jsdoc.name.LONGNAMES.GLOBAL; var doclet = parser.refs[enclosingScopeId]; if (doclet) { @@ -351,20 +340,23 @@ Visitor.prototype.makeSymbolFoundEvent = function(node, parser, filename) { break; // like "bar" in: function foo(/** @type {string} */ bar) {} + // or "module" in: define("MyModule", function(/** @exports MyModule */ module) {} // This is an extremely common type of node; we only care about function parameters with - // inline type annotations. No need to fire events unless they're already commented. + // inline comments. No need to fire an event unless the node is already commented. case Syntax.Identifier: parent = node.parent; if ( node.leadingComments && parent && jsdoc.src.astnode.isFunction(parent) ) { extras.finishers = [makeInlineParamsFinisher(parser)]; e = new SymbolFound(node, filename, extras); + + trackVars(parser, node, e); } break; // like "obj.prop" in: /** @typedef {string} */ obj.prop; // Closure Compiler uses this pattern extensively for enums. - // No need to fire events for them unless they're already commented. + // No need to fire an event unless the node is already commented. case Syntax.MemberExpression: if (node.leadingComments) { e = new SymbolFound(node, filename, extras); diff --git a/node_modules/jsdoc/lib/jsdoc/src/walker.js b/node_modules/jsdoc/lib/jsdoc/src/walker.js index ce724c2..0e20499 100644 --- a/node_modules/jsdoc/lib/jsdoc/src/walker.js +++ b/node_modules/jsdoc/lib/jsdoc/src/walker.js @@ -478,41 +478,40 @@ var Walker = exports.Walker = function(walkerFuncs) { // TODO: docs Walker.prototype._recurse = function(filename, ast) { - // TODO: track variables/aliases during the walk + var self = this; var state = { filename: filename, nodes: [], scopes: [] }; - var walkers = this._walkers; - function cb(node, parent, state) { + function cb(node, parent, cbState) { var currentScope; var isScope = astnode.isScope(node); - // for efficiency, if the node has a knownVariables property, assume that we've already + // for efficiency, if the node has a `parent` property, assume that we've already // added the required properties - if (!node.knownVariables) { + if (typeof node.parent !== 'undefined') { astnode.addNodeProperties(node); } node.parent = parent || null; - currentScope = getCurrentScope(state.scopes); + currentScope = getCurrentScope(cbState.scopes); if (currentScope) { node.enclosingScope = currentScope; } if (isScope) { - state.scopes.push(node); + cbState.scopes.push(node); } - state.nodes.push(node); + cbState.nodes.push(node); - walkers[node.type](node, parent, state, cb); + self._walkers[node.type](node, parent, cbState, cb); if (isScope) { - state.scopes.pop(); + cbState.scopes.pop(); } } @@ -522,14 +521,17 @@ Walker.prototype._recurse = function(filename, ast) { }; // TODO: docs -// TODO: allow visitor.visit to prevent traversal of child nodes // TODO: skip the AST root node to be consistent with Rhino? -Walker.prototype.recurse = function(filename, ast, visitor) { +Walker.prototype.recurse = function(ast, visitor, filename) { + var shouldContinue; var state = this._recurse(filename, ast); if (visitor) { for (var i = 0, l = state.nodes.length; i < l; i++) { - visitor.visit.call(visitor, state.nodes[i], filename); + shouldContinue = visitor.visit.call(visitor, state.nodes[i], filename); + if (!shouldContinue) { + break; + } } } diff --git a/node_modules/jsdoc/lib/jsdoc/tag.js b/node_modules/jsdoc/lib/jsdoc/tag.js index 142592a..963c955 100644 --- a/node_modules/jsdoc/lib/jsdoc/tag.js +++ b/node_modules/jsdoc/lib/jsdoc/tag.js @@ -25,15 +25,25 @@ var jsdoc = { } }; var path = require('jsdoc/path'); +var util = require('util'); -function trim(text, opts) { +// Check whether the text is the same as a symbol name with leading or trailing whitespace. If so, +// the whitespace must be preserved, and the text cannot be trimmed. +function mustPreserveWhitespace(text, meta) { + return meta && meta.code && meta.code.name === text && text.match(/(?:^\s+)|(?:\s+$)/); +} + +function trim(text, opts, meta) { var indentMatcher; var match; opts = opts || {}; text = text || ''; - if (opts.keepsWhitespace) { + if ( mustPreserveWhitespace(text, meta) ) { + text = util.format('"%s"', text); + } + else if (opts.keepsWhitespace) { text = text.replace(/^[\n\r\f]+|[\n\r\f]+$/g, ''); if (opts.removesIndent) { match = text.match(/^([ \t]+)/); @@ -50,7 +60,32 @@ function trim(text, opts) { return text; } -function processTagText(tag, tagDef) { +function addHiddenProperty(obj, propName, propValue) { + Object.defineProperty(obj, propName, { + value: propValue, + writable: true, + enumerable: !!global.env.opts.debug, + configurable: true + }); +} + +function parseType(tag, tagDef, meta) { + try { + return jsdoc.tag.type.parse(tag.text, tagDef.canHaveName, tagDef.canHaveType); + } + catch (e) { + jsdoc.util.logger.error( + 'Unable to parse a tag\'s type expression%s with tag title "%s" and text "%s": %s', + meta.filename ? ( ' for source file ' + path.join(meta.path, meta.filename) ) : '', + tag.originalTitle, + tag.text, + e.message + ); + return {}; + } +} + +function processTagText(tag, tagDef, meta) { var tagType; if (tagDef.onTagText) { @@ -61,7 +96,7 @@ function processTagText(tag, tagDef) { /** The value property represents the result of parsing the tag text. */ tag.value = {}; - tagType = jsdoc.tag.type.parse(tag.text, tagDef.canHaveName, tagDef.canHaveType); + tagType = parseType(tag, tagDef, meta); // It is possible for a tag to *not* have a type but still have // optional or defaultvalue, e.g. '@param [foo]'. @@ -71,11 +106,14 @@ function processTagText(tag, tagDef) { tag.value.type = { names: tagType.type }; + addHiddenProperty(tag.value.type, 'parsedType', tagType.parsedType); } - tag.value.optional = tagType.optional; - tag.value.nullable = tagType.nullable; - tag.value.variable = tagType.variable; - tag.value.defaultvalue = tagType.defaultvalue; + + ['optional', 'nullable', 'variable', 'defaultvalue'].forEach(function(prop) { + if (typeof tagType[prop] !== 'undefined') { + tag.value[prop] = tagType[prop]; + } + }); } if (tagType.text && tagType.text.length) { @@ -92,6 +130,19 @@ function processTagText(tag, tagDef) { } } +/** + * Replace the existing tag dictionary with a new tag dictionary. + * + * Used for testing only. Do not call this method directly. Instead, call + * {@link module:jsdoc/doclet._replaceDictionary}, which also updates this module's tag dictionary. + * + * @private + * @param {module:jsdoc/tag/dictionary.Dictionary} dict - The new tag dictionary. + */ +exports._replaceDictionary = function _replaceDictionary(dict) { + jsdoc.tag.dictionary = dict; +}; + /** Constructs a new tag object. Calls the tag validator. @class @@ -108,7 +159,7 @@ var Tag = exports.Tag = function(tagTitle, tagBody, meta) { this.originalTitle = trim(tagTitle); - /** The title part of the tag: @title text */ + /** The title of the tag (for example, `title` in `@title text`). */ this.title = jsdoc.tag.dictionary.normalise(this.originalTitle); tagDef = jsdoc.tag.dictionary.lookUp(this.title); @@ -117,23 +168,28 @@ var Tag = exports.Tag = function(tagTitle, tagBody, meta) { removesIndent: tagDef.removesIndent }; - /** The text part of the tag: @title text */ - this.text = trim(tagBody, trimOpts); + /** + * The text following the tag (for example, `text` in `@title text`). + * + * Whitespace is trimmed from the tag text as follows: + * + * + If the tag's `keepsWhitespace` option is falsy, all leading and trailing whitespace are + * removed. + * + If the tag's `keepsWhitespace` option is set to `true`, leading and trailing whitespace are + * not trimmed, unless the `removesIndent` option is also enabled. + * + If the tag's `removesIndent` option is set to `true`, any indentation that is shared by + * every line in the string is removed. This option is ignored unless `keepsWhitespace` is set + * to `true`. + * + * **Note**: If the tag text is the name of a symbol, and the symbol's name includes leading or + * trailing whitespace (for example, the property names in `{ ' ': true, ' foo ': false }`), + * the tag text is not trimmed. Instead, the tag text is wrapped in double quotes to prevent the + * whitespace from being trimmed. + */ + this.text = trim(tagBody, trimOpts, meta); if (this.text) { - try { - processTagText(this, tagDef); - } - catch (e) { - // probably a type-parsing error - jsdoc.util.logger.error( - 'Unable to create a Tag object%s with title "%s" and body "%s": %s', - meta.filename ? ( ' for source file ' + path.join(meta.path, meta.filename) ) : '', - tagTitle, - tagBody, - e.message - ); - } + processTagText(this, tagDef, meta); } jsdoc.tag.validator.validate(this, tagDef, meta); diff --git a/node_modules/jsdoc/lib/jsdoc/tag/dictionary.js b/node_modules/jsdoc/lib/jsdoc/tag/dictionary.js index 0a745b4..f613c49 100644 --- a/node_modules/jsdoc/lib/jsdoc/tag/dictionary.js +++ b/node_modules/jsdoc/lib/jsdoc/tag/dictionary.js @@ -1,23 +1,22 @@ -/** - @overview - @author Michael Mathews - @license Apache License 2.0 - See file 'LICENSE.md' in this project. - */ +/** @module jsdoc/tag/dictionary */ 'use strict'; +var definitions = require('jsdoc/tag/dictionary/definitions'); + var hasOwnProp = Object.prototype.hasOwnProperty; -var _tags = {}; -var _tagSynonyms = {}; -var _namespaces = []; var dictionary; /** @private */ -function TagDefinition(title, etc) { +function TagDefinition(dict, title, etc) { var self = this; etc = etc || {}; - this.title = dictionary.normalise(title); + this.title = dict.normalise(title); + + Object.defineProperty(this, '_dictionary', { + value: dict + }); Object.keys(etc).forEach(function(p) { self[p] = etc[p]; @@ -26,60 +25,98 @@ function TagDefinition(title, etc) { /** @private */ TagDefinition.prototype.synonym = function(synonymName) { - _tagSynonyms[synonymName.toLowerCase()] = this.title; + this._dictionary.defineSynonym(this.title, synonymName); return this; // chainable }; -/** @exports jsdoc/tag/dictionary */ -dictionary = { - /** @function */ - defineTag: function(title, opts) { - var def = new TagDefinition(title, opts); - // all the other dictionary functions use normalised names; we should too. - _tags[def.title] = def; +/** + * @class + * @alias module:jsdoc/tag/dictionary.Dictionary + */ +function Dictionary() { + this._tags = {}; + this._tagSynonyms = {}; + // The longnames for `Package` objects include a `package` namespace. There's no `package` tag, + // though, so we declare the namespace here. + this._namespaces = ['package']; +} - if (opts && opts.isNamespace) { - _namespaces.push(def.title); - } +/** @function */ +Dictionary.prototype._defineNamespace = function defineNamespace(title) { + title = this.normalise(title || ''); - return _tags[def.title]; - }, - - /** @function */ - lookUp: function(title) { - title = dictionary.normalise(title); - - if ( hasOwnProp.call(_tags, title) ) { - return _tags[title]; - } - - return false; - }, - - /** @function */ - isNamespace: function(kind) { - if (kind) { - kind = dictionary.normalise(kind); - if ( _namespaces.indexOf(kind) !== -1) { - return true; - } - } - - return false; - }, - - /** @function */ - normalise: function(title) { - var canonicalName = title.toLowerCase(); - - if ( hasOwnProp.call(_tagSynonyms, canonicalName) ) { - return _tagSynonyms[canonicalName]; - } - - return canonicalName; + if (title && this._namespaces.indexOf(title) === -1) { + this._namespaces.push(title); } + + return this; }; -require('jsdoc/tag/dictionary/definitions').defineTags(dictionary); +/** @function */ +Dictionary.prototype.defineTag = function defineTag(title, opts) { + var tagDef = new TagDefinition(this, title, opts); + this._tags[tagDef.title] = tagDef; + if (opts && opts.isNamespace) { + this._defineNamespace(tagDef.title); + } + + return this._tags[tagDef.title]; +}; + +/** @function */ +Dictionary.prototype.defineSynonym = function defineSynonym(title, synonym) { + this._tagSynonyms[synonym.toLowerCase()] = this.normalise(title); +}; + +/** @function */ +Dictionary.prototype.getNamespaces = function getNamespaces() { + return this._namespaces.slice(0); +}; + +/** @function */ +Dictionary.prototype.lookUp = function lookUp(title) { + title = this.normalise(title); + + if ( hasOwnProp.call(this._tags, title) ) { + return this._tags[title]; + } + + return false; +}; + +/** @function */ +Dictionary.prototype.isNamespace = function isNamespace(kind) { + if (kind) { + kind = this.normalise(kind); + if (this._namespaces.indexOf(kind) !== -1) { + return true; + } + } + + return false; +}; + +/** @function */ +Dictionary.prototype.normalise = function normalise(title) { + var canonicalName = title.toLowerCase(); + + if ( hasOwnProp.call(this._tagSynonyms, canonicalName) ) { + return this._tagSynonyms[canonicalName]; + } + + return canonicalName; +}; + +/** @function */ +Dictionary.prototype.normalize = Dictionary.prototype.normalise; + +// initialize the default dictionary +dictionary = new Dictionary(); +definitions.defineTags(dictionary); + +// make the constructor available for unit-testing purposes +dictionary.Dictionary = Dictionary; + +/** @type {module:jsdoc/tag/dictionary.Dictionary} */ module.exports = dictionary; diff --git a/node_modules/jsdoc/lib/jsdoc/tag/dictionary/definitions.js b/node_modules/jsdoc/lib/jsdoc/tag/dictionary/definitions.js index 66a3813..313d363 100644 --- a/node_modules/jsdoc/lib/jsdoc/tag/dictionary/definitions.js +++ b/node_modules/jsdoc/lib/jsdoc/tag/dictionary/definitions.js @@ -1,4 +1,3 @@ -/*global app, env */ /** Define tags that are known in JSDoc. @module jsdoc/tag/dictionary/definitions @@ -8,7 +7,7 @@ */ 'use strict'; -var hasOwnProp = Object.prototype.hasOwnProperty; +var _ = require('underscore'); var jsdoc = { name: require('jsdoc/name'), src: { @@ -18,21 +17,35 @@ var jsdoc = { type: require('jsdoc/tag/type') }, util: { + doop: require('jsdoc/util/doop'), logger: require('jsdoc/util/logger') } }; var path = require('jsdoc/path'); var Syntax = require('jsdoc/src/syntax').Syntax; -var GLOBAL_LONGNAME = jsdoc.name.GLOBAL_LONGNAME; -var MODULE_PREFIX = jsdoc.name.MODULE_PREFIX; +var hasOwnProp = Object.prototype.hasOwnProperty; + +var DEFINITIONS = { + closure: 'closureTags', + jsdoc: 'jsdocTags' +}; +var MODULE_NAMESPACE = 'module:'; + +// Clone a tag definition, excluding synonyms. +function cloneTagDef(tagDef, extras) { + var newTagDef = jsdoc.util.doop(tagDef); + delete newTagDef.synonyms; + + return (extras ? _.extend(newTagDef, extras) : newTagDef); +} function getSourcePaths() { - var sourcePaths = env.sourceFiles.slice(0) || []; + var sourcePaths = global.env.sourceFiles.slice(0) || []; - if (env.opts._) { - env.opts._.forEach(function(sourcePath) { - var resolved = path.resolve(env.pwd, sourcePath); + if (global.env.opts._) { + global.env.opts._.forEach(function(sourcePath) { + var resolved = path.resolve(global.env.pwd, sourcePath); if (sourcePaths.indexOf(resolved) === -1) { sourcePaths.push(resolved); } @@ -48,7 +61,8 @@ function filepathMinusPrefix(filepath) { var result = ''; if (filepath) { - // always use forward slashes + filepath = path.normalize(filepath); + // always use forward slashes in the result result = (filepath + path.sep).replace(commonPrefix, '') .replace(/\\/g, '/'); } @@ -76,7 +90,7 @@ function setDocletScopeToTitle(doclet, tag) { function setDocletNameToValue(doclet, tag) { if (tag.value && tag.value.description) { // as in a long tag - doclet.addTag( 'name', tag.value.description); + doclet.addTag('name', tag.value.description); } else if (tag.text) { // or a short tag doclet.addTag('name', tag.text); @@ -91,7 +105,7 @@ function setDocletNameToValueName(doclet, tag) { function setDocletDescriptionToValue(doclet, tag) { if (tag.value) { - doclet.addTag( 'description', tag.value ); + doclet.addTag('description', tag.value); } } @@ -124,15 +138,14 @@ function setDocletMemberof(doclet, tag) { function applyNamespace(docletOrNs, tag) { if (typeof docletOrNs === 'string') { // ns - tag.value = app.jsdoc.name.applyNamespace(tag.value, docletOrNs); + tag.value = jsdoc.name.applyNamespace(tag.value, docletOrNs); } else { // doclet if (!docletOrNs.name) { return; // error? } - //doclet.displayname = doclet.name; - docletOrNs.longname = app.jsdoc.name.applyNamespace(docletOrNs.name, tag.title); + docletOrNs.longname = jsdoc.name.applyNamespace(docletOrNs.name, tag.title); } } @@ -147,6 +160,11 @@ function setDocletNameToFilename(doclet, tag) { doclet.name = name; } +function parseTypeText(text) { + var tagType = jsdoc.tag.type.parse(text, false, true); + return tagType.typeExpression || text; +} + function parseBorrows(doclet, tag) { var m = /^(\S+)(?:\s+as\s+(\S+))?$/.exec(tag.text); if (m) { @@ -161,51 +179,48 @@ function parseBorrows(doclet, tag) { } } +function stripModuleNamespace(name) { + return name.replace(/^module\:/, ''); +} + function firstWordOf(string) { var m = /^(\S+)/.exec(string); if (m) { return m[1]; } else { return ''; } } -/** Populate the given dictionary with all known JSDoc tag definitions. - @param {module:jsdoc/tag/dictionary} dictionary -*/ -exports.defineTags = function(dictionary) { - dictionary.defineTag('abstract', { +// Core JSDoc tags that are shared with other tag dictionaries. +var baseTags = exports.baseTags = { + abstract: { mustNotHaveValue: true, onTagged: function(doclet, tag) { - // since "abstract" is reserved word in JavaScript let's use "virtual" in code + // we call this `virtual` because `abstract` is a reserved word doclet.virtual = true; - } - }) - .synonym('virtual'); - - dictionary.defineTag('access', { + }, + synonyms: ['virtual'] + }, + access: { mustHaveValue: true, onTagged: function(doclet, tag) { - // only valid values are private and protected, public is default - if ( /^(private|protected)$/i.test(tag.value) ) { + // only valid values are private, protected and public + if ( /^(private|protected|public)$/i.test(tag.value) ) { doclet.access = tag.value.toLowerCase(); } else { delete doclet.access; } } - }); - - dictionary.defineTag('alias', { + }, + alias: { mustHaveValue: true, onTagged: function(doclet, tag) { doclet.alias = tag.value; } - }); - + }, // Special separator tag indicating that multiple doclets should be generated for the same // comment. Used internally (and by some JSDoc users, although it's not officially supported). - // // In the following example, the parser will replace `//**` with an `@also` tag: - // // /** // * Foo. // *//** @@ -213,84 +228,77 @@ exports.defineTags = function(dictionary) { // * @param {string} bar // */ // function foo(bar) {} - dictionary.defineTag('also', { + also: { onTagged: function(doclet, tag) { // let the parser handle it; we define the tag here to avoid "not a known tag" errors } - }); - - // this symbol inherits from the specified symbol - dictionary.defineTag('augments', { + }, + augments: { mustHaveValue: true, // Allow augments value to be specified as a normal type, e.g. {Type} - onTagText: function(text) { - - var tagType = jsdoc.tag.type.parse(text, false, true); - return tagType.typeExpression || text; - }, + onTagText: parseTypeText, onTagged: function(doclet, tag) { doclet.augment( firstWordOf(tag.value) ); - } - }) - .synonym('extends'); - - dictionary.defineTag('author', { + }, + synonyms: ['extends'] + }, + author: { mustHaveValue: true, onTagged: function(doclet, tag) { - if (!doclet.author) { doclet.author = []; } + doclet.author = doclet.author || []; doclet.author.push(tag.value); } - }); - + }, // this symbol has a member that should use the same docs as another symbol - dictionary.defineTag('borrows', { + borrows: { mustHaveValue: true, onTagged: function(doclet, tag) { var borrows = parseBorrows(doclet, tag); doclet.borrow(borrows.target, borrows.source); } - }); - - dictionary.defineTag('class', { + }, + class: { onTagged: function(doclet, tag) { doclet.addTag('kind', 'class'); - // handle special case where both @class and @constructor tags exist in same doclet - if (tag.originalTitle === 'class') { - var looksLikeDesc = (tag.value || '').match(/\S+\s+\S+/); // multiple words after @class? - if ( looksLikeDesc || /@construct(s|or)\b/i.test(doclet.comment) ) { - doclet.classdesc = tag.value; // treat the @class tag as a @classdesc tag instead - return; - } + // We treat the @class tag as a @classdesc tag if all of the following are true: + // - Both @class and @constructor tags are present + // - There's no @classdesc tag + // - There are multiple words after @class + if (tag.value && + tag.originalTitle === 'class' && + /@construct(?:s|or)\b/i.test(doclet.comment) && + !/@classdesc\b/i.test(doclet.comment) && + tag.value.match(/\S+\s+\S+/)) { + doclet.addTag('classdesc', tag.value); } - - setDocletNameToValue(doclet, tag); - } - }) - .synonym('constructor'); - - dictionary.defineTag('classdesc', { + else { + setDocletNameToValue(doclet, tag); + } + }, + synonyms: ['constructor'] + }, + classdesc: { onTagged: function(doclet, tag) { doclet.classdesc = tag.value; } - }); - - dictionary.defineTag('constant', { + }, + constant: { canHaveType: true, canHaveName: true, onTagged: function(doclet, tag) { setDocletKindToTitle(doclet, tag); setDocletNameToValueName(doclet, tag); setDocletTypeToValueType(doclet, tag); - } - }) - .synonym('const'); - - dictionary.defineTag('constructs', { + }, + synonyms: ['const'] + }, + constructs: { onTagged: function(doclet, tag) { var ownerClassName; if (!tag.value) { - ownerClassName = '{@thisClass}'; // this can be resolved later in the handlers + // this can be resolved later in the handlers + ownerClassName = '{@thisClass}'; } else { ownerClassName = firstWordOf(tag.value); @@ -298,16 +306,14 @@ exports.defineTags = function(dictionary) { doclet.addTag('alias', ownerClassName); doclet.addTag('kind', 'class'); } - }); - - dictionary.defineTag('copyright', { + }, + copyright: { mustHaveValue: true, onTagged: function(doclet, tag) { doclet.copyright = tag.value; } - }); - - dictionary.defineTag('default', { + }, + default: { onTagged: function(doclet, tag) { var type; var value; @@ -321,7 +327,7 @@ exports.defineTags = function(dictionary) { type = doclet.meta.code.type; value = doclet.meta.code.value; - switch(type) { + switch (type) { case Syntax.ArrayExpression: doclet.defaultvalue = nodeToString(doclet.meta.code.node); doclet.defaultvaluetype = 'array'; @@ -341,60 +347,54 @@ exports.defineTags = function(dictionary) { break; } } - } - }) - .synonym('defaultvalue'); - - dictionary.defineTag('deprecated', { + }, + synonyms: ['defaultvalue'] + }, + deprecated: { // value is optional onTagged: function(doclet, tag) { doclet.deprecated = tag.value || true; } - }); - - dictionary.defineTag('description', { - mustHaveValue: true - }) - .synonym('desc'); - - dictionary.defineTag('enum', { + }, + description: { + mustHaveValue: true, + synonyms: ['desc'] + }, + enum: { canHaveType: true, onTagged: function(doclet, tag) { doclet.kind = 'member'; doclet.isEnum = true; setDocletTypeToValueType(doclet, tag); } - }); - - dictionary.defineTag('event', { + }, + event: { isNamespace: true, onTagged: function(doclet, tag) { setDocletKindToTitle(doclet, tag); setDocletNameToValue(doclet, tag); } - }); - - dictionary.defineTag('example', { + }, + example: { keepsWhitespace: true, removesIndent: true, mustHaveValue: true, onTagged: function(doclet, tag) { - if (!doclet.examples) { doclet.examples = []; } + doclet.examples = doclet.examples || []; doclet.examples.push(tag.value); } - }); - - dictionary.defineTag('exports', { + }, + exports: { mustHaveValue: true, onTagged: function(doclet, tag) { var modName = firstWordOf(tag.value); - doclet.addTag('alias', modName); + // in case the user wrote something like `/** @exports module:foo */`: + doclet.addTag( 'alias', stripModuleNamespace(modName) ); doclet.addTag('kind', 'module'); } - }); - - dictionary.defineTag('external', { + }, + external: { canHaveType: true, isNamespace: true, onTagged: function(doclet, tag) { @@ -406,139 +406,144 @@ exports.defineTags = function(dictionary) { else { setDocletNameToValue(doclet, tag); } - } - }) - .synonym('host'); - - dictionary.defineTag('file', { + }, + synonyms: ['host'] + }, + file: { onTagged: function(doclet, tag) { setNameToFile(doclet, tag); setDocletKindToTitle(doclet, tag); setDocletDescriptionToValue(doclet, tag); doclet.preserveName = true; - } - }) - .synonym('fileoverview') - .synonym('overview'); - - dictionary.defineTag('fires', { + }, + synonyms: ['fileoverview', 'overview'] + }, + fires: { mustHaveValue: true, onTagged: function(doclet, tag) { - if (!doclet.fires) { doclet.fires = []; } + doclet.fires = doclet.fires || []; applyNamespace('event', tag); doclet.fires.push(tag.value); - } - }) - .synonym('emits'); - - dictionary.defineTag('function', { + }, + synonyms: ['emits'] + }, + function: { onTagged: function(doclet, tag) { setDocletKindToTitle(doclet, tag); setDocletNameToValue(doclet, tag); - } - }) - .synonym('func') - .synonym('method'); - - dictionary.defineTag('global', { + }, + synonyms: ['func', 'method'] + }, + global: { mustNotHaveValue: true, onTagged: function(doclet, tag) { - doclet.scope = 'global'; + doclet.scope = jsdoc.name.SCOPE.NAMES.GLOBAL; delete doclet.memberof; } - }); - - dictionary.defineTag('ignore', { + }, + ignore: { mustNotHaveValue: true, onTagged: function(doclet, tag) { doclet.ignore = true; } - }); - - dictionary.defineTag('inner', { + }, + implements: { + mustHaveValue: true, + onTagText: parseTypeText, onTagged: function(doclet, tag) { - setDocletScopeToTitle(doclet, tag); - } - }); - - dictionary.defineTag('instance', { + doclet.implements = doclet.implements || []; + doclet.implements.push(tag.value); + } + }, + inheritdoc: { + mustNotHaveValue: true, + onTagged: function(doclet, tag) { + // use an empty string so JSDoc can support `@inheritdoc Foo#bar` in the future + doclet.inheritdoc = ''; + } + }, + inner: { onTagged: function(doclet, tag) { setDocletScopeToTitle(doclet, tag); } - }); - - dictionary.defineTag('kind', { - mustHaveValue: true - }); - - dictionary.defineTag('lends', { + }, + instance: { onTagged: function(doclet, tag) { - doclet.alias = tag.value || GLOBAL_LONGNAME; + setDocletScopeToTitle(doclet, tag); + } + }, + interface: { + canHaveName: true, + onTagged: function(doclet, tag) { + doclet.addTag('kind', 'interface'); + if (tag.value) { + setDocletNameToValueName(doclet, tag); + } + } + }, + kind: { + mustHaveValue: true + }, + lends: { + onTagged: function(doclet, tag) { + doclet.alias = tag.value || jsdoc.name.LONGNAMES.GLOBAL; doclet.addTag('undocumented'); } - }); - - dictionary.defineTag('license', { + }, + license: { mustHaveValue: true, onTagged: function(doclet, tag) { doclet.license = tag.value; } - }); - - dictionary.defineTag('listens', { + }, + listens: { mustHaveValue: true, onTagged: function (doclet, tag) { - if (!doclet.listens) { doclet.listens = []; } + doclet.listens = doclet.listens || []; applyNamespace('event', tag); doclet.listens.push(tag.value); - // TODO: verify that parameters match the event parameters? } - }); - - dictionary.defineTag('member', { + }, + member: { canHaveType: true, canHaveName: true, onTagged: function(doclet, tag) { setDocletKindToTitle(doclet, tag); setDocletNameToValueName(doclet, tag); setDocletTypeToValueType(doclet, tag); - } - }) - .synonym('var'); - - dictionary.defineTag('memberof', { + }, + synonyms: ['var'] + }, + memberof: { mustHaveValue: true, onTagged: function(doclet, tag) { if (tag.originalTitle === 'memberof!') { doclet.forceMemberof = true; - if (tag.value === GLOBAL_LONGNAME) { + if (tag.value === jsdoc.name.LONGNAMES.GLOBAL) { doclet.addTag('global'); delete doclet.memberof; } } setDocletMemberof(doclet, tag); - } - }) - .synonym('memberof!'); - + }, + synonyms: ['memberof!'] + }, // this symbol mixes in all of the specified object's members - dictionary.defineTag('mixes', { + mixes: { mustHaveValue: true, onTagged: function(doclet, tag) { var source = firstWordOf(tag.value); doclet.mix(source); } - }); - - dictionary.defineTag('mixin', { + }, + mixin: { onTagged: function(doclet, tag) { setDocletKindToTitle(doclet, tag); setDocletNameToValue(doclet, tag); } - }); - - dictionary.defineTag('module', { + }, + module: { canHaveType: true, isNamespace: true, onTagged: function(doclet, tag) { @@ -547,76 +552,67 @@ exports.defineTags = function(dictionary) { if (!doclet.name) { setDocletNameToFilename(doclet, tag); } + // in case the user wrote something like `/** @module module:foo */`: + doclet.name = stripModuleNamespace(doclet.name); + setDocletTypeToValueType(doclet, tag); - } - }); - - dictionary.defineTag('name', { + } + }, + name: { mustHaveValue: true - }); - - dictionary.defineTag('namespace', { + }, + namespace: { canHaveType: true, onTagged: function(doclet, tag) { setDocletKindToTitle(doclet, tag); setDocletNameToValue(doclet, tag); setDocletTypeToValueType(doclet, tag); } - }); - - dictionary.defineTag('param', { - //mustHaveValue: true, // param name can be found in the source code if not provided + }, + param: { canHaveType: true, canHaveName: true, onTagged: function(doclet, tag) { - if (!doclet.params) { doclet.params = []; } + doclet.params = doclet.params || []; doclet.params.push(tag.value || {}); - } - }) - .synonym('argument') - .synonym('arg'); - - dictionary.defineTag('private', { + }, + synonyms: ['arg', 'argument'] + }, + private: { mustNotHaveValue: true, onTagged: function(doclet, tag) { doclet.access = 'private'; } - }); - - dictionary.defineTag('property', { + }, + property: { mustHaveValue: true, canHaveType: true, canHaveName: true, onTagged: function(doclet, tag) { - if (!doclet.properties) { doclet.properties = []; } + doclet.properties = doclet.properties || []; doclet.properties.push(tag.value); - } - }) - .synonym('prop'); - - dictionary.defineTag('protected', { + }, + synonyms: ['prop'] + }, + protected: { mustNotHaveValue: true, onTagged: function(doclet, tag) { doclet.access = 'protected'; } - }); - - dictionary.defineTag('public', { + }, + public: { mustNotHaveValue: true, onTagged: function(doclet, tag) { - delete doclet.access; // public is default + doclet.access = 'public'; } - }); - - // use this instead of old deprecated @final tag - dictionary.defineTag('readonly', { + }, + readonly: { mustNotHaveValue: true, onTagged: function(doclet, tag) { doclet.readonly = true; } - }); - - dictionary.defineTag('requires', { + }, + requires: { mustHaveValue: true, onTagged: function(doclet, tag) { var requiresName; @@ -628,89 +624,78 @@ exports.defineTags = function(dictionary) { // otherwise, assume it's a module else { requiresName = firstWordOf(tag.value); - if (requiresName.indexOf(MODULE_PREFIX) !== 0) { - requiresName = MODULE_PREFIX + requiresName; + if (requiresName.indexOf(MODULE_NAMESPACE) !== 0) { + requiresName = MODULE_NAMESPACE + requiresName; } } - if (!doclet.requires) { doclet.requires = []; } + doclet.requires = doclet.requires || []; doclet.requires.push(requiresName); } - }); - - dictionary.defineTag('returns', { + }, + returns: { mustHaveValue: true, canHaveType: true, onTagged: function(doclet, tag) { - if (!doclet.returns) { doclet.returns = []; } + doclet.returns = doclet.returns || []; doclet.returns.push(tag.value); - } - }) - .synonym('return'); - - dictionary.defineTag('see', { + }, + synonyms: ['return'] + }, + see: { mustHaveValue: true, onTagged: function(doclet, tag) { - if (!doclet.see) { doclet.see = []; } + doclet.see = doclet.see || []; doclet.see.push(tag.value); } - }); - - dictionary.defineTag('since', { + }, + since: { mustHaveValue: true, onTagged: function(doclet, tag) { doclet.since = tag.value; } - }); - - dictionary.defineTag('static', { + }, + static: { onTagged: function(doclet, tag) { setDocletScopeToTitle(doclet, tag); } - }); - - dictionary.defineTag('summary', { + }, + summary: { mustHaveValue: true, onTagged: function(doclet, tag) { doclet.summary = tag.value; } - }); - - dictionary.defineTag('this', { + }, + 'this': { mustHaveValue: true, onTagged: function(doclet, tag) { - doclet['this'] = firstWordOf(tag.value); + doclet.this = firstWordOf(tag.value); } - }); - - dictionary.defineTag('todo', { + }, + todo: { mustHaveValue: true, onTagged: function(doclet, tag) { - if (!doclet.todo) { doclet.todo = []; } + doclet.todo = doclet.todo || []; doclet.todo.push(tag.value); } - }); - - dictionary.defineTag('throws', { + }, + throws: { mustHaveValue: true, canHaveType: true, onTagged: function(doclet, tag) { - if (!doclet.exceptions) { doclet.exceptions = []; } + doclet.exceptions = doclet.exceptions || []; doclet.exceptions.push(tag.value); - setDocletTypeToValueType(doclet, tag); - } - }) - .synonym('exception'); - - dictionary.defineTag('tutorial', { + }, + synonyms: ['exception'] + }, + tutorial: { mustHaveValue: true, onTagged: function(doclet, tag) { - if (!doclet.tutorials) { doclet.tutorials = []; } + doclet.tutorials = doclet.tutorials || []; doclet.tutorials.push(tag.value); } - }); - - dictionary.defineTag('type', { + }, + type: { mustHaveValue: true, mustNotHaveDescription: true, canHaveType: true, @@ -746,9 +731,8 @@ exports.defineTags = function(dictionary) { } } } - }); - - dictionary.defineTag('typedef', { + }, + typedef: { canHaveType: true, canHaveName: true, onTagged: function(doclet, tag) { @@ -769,29 +753,147 @@ exports.defineTags = function(dictionary) { setDocletTypeToValueType(doclet, tag); } } - } - }) - .synonym('callback'); - - dictionary.defineTag('undocumented', { + }, + synonyms: ['callback'] + }, + undocumented: { mustNotHaveValue: true, onTagged: function(doclet, tag) { doclet.undocumented = true; doclet.comment = ''; } - }); - - dictionary.defineTag('variation', { + }, + variation: { mustHaveValue: true, onTagged: function(doclet, tag) { - doclet.variation = tag.value; - } - }); + var value = tag.value; - dictionary.defineTag('version', { + if ( /^\((.+)\)$/.test(value) ) { + value = RegExp.$1; + } + + doclet.variation = value; + } + }, + version: { mustHaveValue: true, onTagged: function(doclet, tag) { doclet.version = tag.value; } - }); + } +}; + +// Tag dictionary for JSDoc. +var jsdocTags = exports.jsdocTags = baseTags; + +// Tag dictionary for Google Closure Compiler. +var closureTags = exports.closureTags = { + const: cloneTagDef(baseTags.constant), + constructor: cloneTagDef(baseTags.class), + deprecated: cloneTagDef(baseTags.deprecated), + enum: cloneTagDef(baseTags.enum), + extends: cloneTagDef(baseTags.augments), + final: cloneTagDef(baseTags.readonly), + implements: cloneTagDef(baseTags.implements), + inheritdoc: cloneTagDef(baseTags.inheritdoc), + interface: cloneTagDef(baseTags.interface, { + canHaveName: false, + mustNotHaveValue: true + }), + lends: cloneTagDef(baseTags.lends), + license: cloneTagDef(baseTags.license), + // Closure Compiler only + override: { + mustNotHaveValue: true, + onTagged: function(doclet, tag) { + doclet.override = true; + } + }, + param: cloneTagDef(baseTags.param), + private: { + canHaveType: true, + onTagged: function(doclet, tag) { + doclet.access = 'private'; + + if (tag.value && tag.value.type) { + setDocletTypeToValueType(doclet, tag); + } + } + }, + protected: { + canHaveType: true, + onTagged: function(doclet, tag) { + doclet.access = 'protected'; + + if (tag.value && tag.value.type) { + setDocletTypeToValueType(doclet, tag); + } + } + }, + return: cloneTagDef(baseTags.returns), + 'this': cloneTagDef(baseTags.this), + throws: cloneTagDef(baseTags.throws), + type: cloneTagDef(baseTags.type, { + mustNotHaveDescription: false + }), + typedef: cloneTagDef(baseTags.typedef) +}; + +function addTagDefinitions(dictionary, tagDefs) { + Object.keys(tagDefs).forEach(function(tagName) { + var tagDef; + + tagDef = tagDefs[tagName]; + dictionary.defineTag(tagName, tagDef); + + if (tagDef.synonyms) { + tagDef.synonyms.forEach(function(synonym) { + dictionary.defineSynonym(tagName, synonym); + }); + } + }); +} + +/** + * Populate the given dictionary with the appropriate JSDoc tag definitions. + * + * If the `tagDefinitions` parameter is omitted, JSDoc uses its configuration settings to decide + * which tags to add to the dictionary. + * + * If the `tagDefinitions` parameter is included, JSDoc adds only the tag definitions from the + * `tagDefinitions` object. The configuration settings are ignored. + * + * @param {module:jsdoc/tag/dictionary} dictionary + * @param {Object} [tagDefinitions] - A dictionary whose values define the rules for a JSDoc tag. + */ +exports.defineTags = function(dictionary, tagDefinitions) { + var dictionaries; + + if (!tagDefinitions) { + dictionaries = global.env.conf.tags.dictionaries; + + if (!dictionaries) { + jsdoc.util.logger.error('The configuration setting "tags.dictionaries" is undefined. ' + + 'Unable to load tag definitions.'); + return; + } + else { + dictionaries = dictionaries.slice(0).reverse(); + } + + dictionaries.forEach(function(dictName) { + var tagDefs = exports[DEFINITIONS[dictName]]; + + if (!tagDefs) { + jsdoc.util.logger.error('The configuration setting "tags.dictionaries" contains ' + + 'the unknown dictionary name %s. Ignoring the dictionary.', dictName); + return; + } + + addTagDefinitions(dictionary, tagDefs); + }); + } + else { + addTagDefinitions(dictionary, tagDefinitions); + } }; diff --git a/node_modules/jsdoc/lib/jsdoc/tag/type.js b/node_modules/jsdoc/lib/jsdoc/tag/type.js index b0ca81f..8597b2e 100644 --- a/node_modules/jsdoc/lib/jsdoc/tag/type.js +++ b/node_modules/jsdoc/lib/jsdoc/tag/type.js @@ -153,9 +153,13 @@ function getTagInfo(tagValue, canHaveName, canHaveType) { */ function parseName(tagInfo) { // like '[foo]' or '[ foo ]' or '[foo=bar]' or '[ foo=bar ]' or '[ foo = bar ]' - if ( /^\[\s*(.+?)\s*\]$/.test(tagInfo.name) ) { - tagInfo.name = RegExp.$1; - tagInfo.optional = true; + // or 'foo=bar' or 'foo = bar' + if ( /^(\[)?\s*(.+?)\s*(\])?$/.test(tagInfo.name) ) { + tagInfo.name = RegExp.$2; + // were the "optional" brackets present? + if (RegExp.$1 && RegExp.$3) { + tagInfo.optional = true; + } // like 'foo=bar' or 'foo = bar' if ( /^(.+?)\s*=\s*(.+)$/.test(tagInfo.name) ) { @@ -176,7 +180,7 @@ function getTypeStrings(parsedType, isOutermostType) { var TYPES = catharsis.Types; - switch(parsedType.type) { + switch (parsedType.type) { case TYPES.AllLiteral: types.push('*'); break; @@ -196,7 +200,7 @@ function getTypeStrings(parsedType, isOutermostType) { // if this is the outermost type, we strip the modifiers; otherwise, we keep them if (isOutermostType) { applications = parsedType.applications.map(function(application) { - return getTypeStrings(application); + return catharsis.stringify(application); }).join(', '); typeString = util.format( '%s.<%s>', getTypeStrings(parsedType.expression), applications ); @@ -254,6 +258,7 @@ function parseTypeExpression(tagInfo) { } tagInfo.type = tagInfo.type.concat( getTypeStrings(parsedType, true) ); + tagInfo.parsedType = parsedType; // Catharsis and JSDoc use the same names for 'optional' and 'nullable'... ['optional', 'nullable'].forEach(function(key) { diff --git a/node_modules/jsdoc/lib/jsdoc/tag/validator.js b/node_modules/jsdoc/lib/jsdoc/tag/validator.js index 3d9103c..6a7f95b 100644 --- a/node_modules/jsdoc/lib/jsdoc/tag/validator.js +++ b/node_modules/jsdoc/lib/jsdoc/tag/validator.js @@ -25,6 +25,17 @@ function buildMessage(tagName, meta, desc) { * Validate the given tag. */ exports.validate = function(tag, tagDef, meta) { + // handle cases where the tag definition does not exist + if (!tagDef) { + // log an error if unknown tags are not allowed + if (!env.conf.tags.allowUnknownTags) { + logger.error( buildMessage(tag.title, meta, 'is not a known tag') ); + } + + // stop validation, since there's nothing to validate against + return; + } + // check for errors that make the tag useless if (!tagDef && !env.conf.tags.allowUnknownTags) { logger.error( buildMessage(tag.title, meta, 'is not a known tag') ); diff --git a/node_modules/jsdoc/lib/jsdoc/template.js b/node_modules/jsdoc/lib/jsdoc/template.js index b5317c9..dc56b6d 100644 --- a/node_modules/jsdoc/lib/jsdoc/template.js +++ b/node_modules/jsdoc/lib/jsdoc/template.js @@ -17,19 +17,18 @@ var _ = require('underscore'), /** @class @classdesc Underscore template helper. - @param {string} path - Templates directory. + @param {string} filepath - Templates directory. */ -exports.Template = function(path) { - this.path = path; +exports.Template = function(filepath) { + this.path = filepath; this.layout = null; this.cache = {}; // override default template tag settings this.settings = { - evaluate : /<\?js([\s\S]+?)\?>/g, + evaluate: /<\?js([\s\S]+?)\?>/g, interpolate: /<\?js=([\s\S]+?)\?>/g, - escape : /<\?js~([\s\S]+?)\?>/g + escape: /<\?js~([\s\S]+?)\?>/g }; - }; /** Loads template from given file. diff --git a/node_modules/jsdoc/lib/jsdoc/tutorial.js b/node_modules/jsdoc/lib/jsdoc/tutorial.js index a20b9c7..931a257 100644 --- a/node_modules/jsdoc/lib/jsdoc/tutorial.js +++ b/node_modules/jsdoc/lib/jsdoc/tutorial.js @@ -6,6 +6,9 @@ 'use strict'; var markdown = require('jsdoc/util/markdown'); +var util = require('util'); + +var hasOwnProp = Object.prototype.hasOwnProperty; /** Removes child tutorial from the parent. Does *not* unset child.parent though. @param {Tutorial} parent - parent tutorial. @@ -40,7 +43,7 @@ function addChild(parent, child) { @param {number} type - Source formating. */ exports.Tutorial = function(name, content, type) { - this.title = this.name = name; + this.title = this.name = this.longname = name; this.content = content; this.type = type; @@ -90,10 +93,7 @@ exports.Tutorial.prototype.parse = function() { // markdown case exports.TYPES.MARKDOWN: var mdParse = markdown.getParser(); - return mdParse(this.content) - .replace(/&/g, '&') // because markdown escapes these - .replace(/</g, '<') - .replace(/>/g, '>'); + return mdParse(this.content); // uhm... should we react somehow? // if not then this case can be merged with TYPES.HTML @@ -102,6 +102,35 @@ exports.Tutorial.prototype.parse = function() { } }; +/** + * @class + * @classdesc Represents the root tutorial. + * @extends {module:jsdoc/tutorial.Tutorial} + */ +exports.RootTutorial = function() { + exports.RootTutorial.super_.call(this, '', ''); + + this._tutorials = {}; +}; +util.inherits(exports.RootTutorial, exports.Tutorial); + +/** + * Retrieve a tutorial by name. + * @param {string} name - Tutorial name. + * @return {module:jsdoc/tutorial.Tutorial} Tutorial instance. + */ +exports.RootTutorial.prototype.getByName = function(name) { + return hasOwnProp.call(this._tutorials, name) && this._tutorials[name]; +}; + +/** + * Add a child tutorial to the root. + * @param {module:jsdoc/tutorial.Tutorial} child - Child tutorial. + */ +exports.RootTutorial.prototype._addTutorial = function(child) { + this._tutorials[child.name] = child; +}; + /** Tutorial source types. @enum {number} */ diff --git a/node_modules/jsdoc/lib/jsdoc/tutorial/resolver.js b/node_modules/jsdoc/lib/jsdoc/tutorial/resolver.js index 7c446e2..610405e 100644 --- a/node_modules/jsdoc/lib/jsdoc/tutorial/resolver.js +++ b/node_modules/jsdoc/lib/jsdoc/tutorial/resolver.js @@ -1,4 +1,3 @@ -/*global env: true */ /** @overview @author Rafał Wrzeszcz @@ -17,9 +16,9 @@ var tutorial = require('jsdoc/tutorial'); var hasOwnProp = Object.prototype.hasOwnProperty; +// TODO: make this an instance member of `RootTutorial`? var conf = {}; var finder = /^(.*)\.(x(?:ht)?ml|html?|md|markdown|json)$/i; -var tutorials = {}; /** checks if `conf` is the metadata for a single tutorial. * A tutorial's metadata has a property 'title' and/or a property 'children'. @@ -31,6 +30,12 @@ function isTutorialJSON(json) { return (hasOwnProp.call(json, 'title') || hasOwnProp.call(json, 'children')); } +/** + * Root tutorial. + * @type {module:jsdoc/tutorial.Root} + */ +exports.root = new tutorial.RootTutorial(); + /** Helper function that adds tutorial configuration to the `conf` variable. * This helps when multiple tutorial configurations are specified in one object, * or when a tutorial's children are specified as tutorial configurations as @@ -49,13 +54,16 @@ function isTutorialJSON(json) { * OR an object giving the configuration for the child tutorials. */ function addTutorialConf(name, meta) { - var names, i; + var i; + var l; + var names; + if (isTutorialJSON(meta)) { // if the children are themselves tutorial defintions as opposed to an // array of strings, add each child. if (hasOwnProp.call(meta, 'children') && !Array.isArray(meta.children)) { names = Object.keys(meta.children); - for (i = 0; i < names.length; ++i) { + for (i = 0, l = names.length; i < l; ++i) { addTutorialConf(names[i], meta.children[names[i]]); } // replace with an array of names. @@ -68,51 +76,40 @@ function addTutorialConf(name, meta) { conf[name] = meta; } } else { - // it's an object of tutorials, the keys are th etutorial names. + // keys are tutorial names, values are `Tutorial` instances names = Object.keys(meta); - for (i = 0; i < names.length; ++i) { + for (i = 0, l = names.length; i < l; ++i) { addTutorialConf(names[i], meta[names[i]]); } } } -/** Adds new tutorial. - @param {tutorial.Tutorial} current - New tutorial. +/** + * Add a tutorial. + * @param {module:jsdoc/tutorial.Tutorial} current - Tutorial to add. */ exports.addTutorial = function(current) { - if (hasOwnProp.call(tutorials, current.name)) { + if (exports.root.getByName(current.name)) { logger.warn('The tutorial %s is defined more than once. Only the first definition will be used.', current.name); } else { - tutorials[current.name] = current; - - // default temporary parent + // by default, the root tutorial is the parent current.setParent(exports.root); + + exports.root._addTutorial(current); } }; -/** Root tutorial. - @type tutorial.Tutorial +/** + * Load tutorials from the given path. + * @param {string} filepath - Tutorials directory. */ -exports.root = new tutorial.Tutorial('', ''); - -/** Additional instance method for root node. - @param {string} name - Tutorial name. - @return {tutorial.Tutorial} Tutorial instance. - */ -exports.root.getByName = function(name) { - return hasOwnProp.call(tutorials, name) && tutorials[name]; -}; - -/** Load tutorials from given path. - @param {string} _path - Tutorials directory. - */ -exports.load = function(_path) { - var match, - type, - name, - content, - current, - files = fs.ls(_path); +exports.load = function(filepath) { + var content; + var current; + var files = fs.ls(filepath, global.env.opts.recurse ? 10 : undefined); + var name; + var match; + var type; // tutorials handling files.forEach(function(file) { @@ -121,7 +118,7 @@ exports.load = function(_path) { // any filetype that can apply to tutorials if (match) { name = path.basename(match[1]); - content = fs.readFileSync(file, env.opts.encoding); + content = fs.readFileSync(file, global.env.opts.encoding); switch (match[2].toLowerCase()) { // HTML type @@ -160,34 +157,36 @@ exports.load = function(_path) { /** Resolves hierarchical structure. */ exports.resolve = function() { - var item, - current; - for (var name in conf) { - if ( hasOwnProp.call(conf, name) ) { - // TODO: should we complain about this? - if (!hasOwnProp.call(tutorials, name)) { - continue; - } + var item; + var current; - item = conf[name]; - current = tutorials[name]; + Object.keys(conf).forEach(function(name) { + current = exports.root.getByName(name); - // set title - if (item.title) { - current.title = item.title; - } - - // add children - if (item.children) { - item.children.forEach(function(child) { - if (!hasOwnProp.call(tutorials, child)) { - logger.error('Missing child tutorial: %s', child); - } - else { - tutorials[child].setParent(current); - } - }); - } + // TODO: should we complain about this? + if (!current) { + return; } - } + + item = conf[name]; + + // set title + if (item.title) { + current.title = item.title; + } + + // add children + if (item.children) { + item.children.forEach(function(child) { + var childTutorial = exports.root.getByName(child); + + if (!childTutorial) { + logger.error('Missing child tutorial: %s', child); + } + else { + childTutorial.setParent(current); + } + }); + } + }); }; diff --git a/node_modules/jsdoc/lib/jsdoc/util/doop.js b/node_modules/jsdoc/lib/jsdoc/util/doop.js index a9e1468..52b68e7 100644 --- a/node_modules/jsdoc/lib/jsdoc/util/doop.js +++ b/node_modules/jsdoc/lib/jsdoc/util/doop.js @@ -1,28 +1,68 @@ +/*global Set */ + /** - Deep clone a simple object. + Deep clone a simple object. Ignores non-enumerable properties. @private */ 'use strict'; -function doop(o) { +var setDefined = typeof Set !== 'undefined'; + +function addItem(set, item) { + if (setDefined) { + set.add(item); + } + else if (set.indexOf(item) === -1) { + set.push(item); + } +} + +function hasItem(set, item) { + if (setDefined) { + return set.has(item); + } + else { + return set.indexOf(item) !== -1; + } +} + +// TODO: can we remove the circular-ref checking? pretty sure it's not needed anymore... +// if we need this here for some reason I'm forgetting, we should share code with jsdoc/util/dumper +function doop(o, seen) { var clone; + var descriptor; var props; var i; var l; + if (!seen) { + seen = setDefined ? new Set() : []; + } + if (o instanceof Object && o.constructor !== Function) { - if ( Array.isArray(o) ) { - clone = []; - for (i = 0, l = o.length; i < l; i++) { - clone[i] = (o[i] instanceof Object) ? doop(o[i]) : o[i]; - } + if ( hasItem(seen, o) ) { + clone = ''; } else { - clone = Object.create( Object.getPrototypeOf(o) ); - props = Object.getOwnPropertyNames(o); - for (i = 0, l = props.length; i < l; i++) { - Object.defineProperty(clone, props[i], - Object.getOwnPropertyDescriptor(o, props[i])); + addItem(seen, o); + + if ( Array.isArray(o) ) { + clone = []; + for (i = 0, l = o.length; i < l; i++) { + clone[i] = (o[i] instanceof Object) ? doop(o[i], seen) : o[i]; + } + } + else { + clone = Object.create( Object.getPrototypeOf(o) ); + props = Object.keys(o); + for (i = 0, l = props.length; i < l; i++) { + descriptor = Object.getOwnPropertyDescriptor(o, props[i]); + if (descriptor.value) { + descriptor.value = doop(descriptor.value, seen); + } + + Object.defineProperty(clone, props[i], descriptor); + } } } @@ -32,7 +72,12 @@ function doop(o) { return o; } -// for backwards compatibility -doop.doop = doop; +// Wrapper to avoid exposing the 'seen' parameter outside of this module. +function doopWrapper(o) { + return doop(o); +} -module.exports = doop; +// for backwards compatibility +doopWrapper.doop = doopWrapper; + +module.exports = doopWrapper; diff --git a/node_modules/jsdoc/lib/jsdoc/util/dumper.js b/node_modules/jsdoc/lib/jsdoc/util/dumper.js index 3d9c667..f4efa38 100644 --- a/node_modules/jsdoc/lib/jsdoc/util/dumper.js +++ b/node_modules/jsdoc/lib/jsdoc/util/dumper.js @@ -8,42 +8,42 @@ 'use strict'; var util = require('util'); -var setDefined = typeof Set !== 'undefined'; + +var OBJECT_WALKER_KEY = 'hasBeenSeenByWalkerDumper'; +var SET_DEFINED = (typeof Set !== 'undefined'); function ObjectWalker() { - if (setDefined) { - this.seenItems = new Set(); - } else { - this.seenItems = []; - } + this.seenItems = SET_DEFINED ? new Set() : []; } ObjectWalker.prototype.seen = function(object) { var result; - if (setDefined) { - result = this.seenItems.has(object); - } else { - result = object.hasBeenSeenByWalkerDumper; + + if (SET_DEFINED) { + result = this.seenItems.has(object); + } + else { + result = object[OBJECT_WALKER_KEY]; } return result; }; ObjectWalker.prototype.markAsSeen = function(object) { - if (setDefined) { + if (SET_DEFINED) { this.seenItems.add(object); - } else { - object.hasBeenSeenByWalkerDumper = true; + } + else { + object[OBJECT_WALKER_KEY] = true; this.seenItems.push(object); } }; -ObjectWalker.prototype.cleanSeenFlag = function() { - if (setDefined) { - this.seenItems = new Set(); - } else { - this.seenItems.forEach(function(object) { - delete object.hasBeenSeenByWalkerDumper; - }); +ObjectWalker.prototype.removeSeenFlag = function(obj) { + if (SET_DEFINED) { + this.seenItems.delete(obj); + } + else { + delete obj[OBJECT_WALKER_KEY]; } }; @@ -85,10 +85,13 @@ ObjectWalker.prototype.walk = function(o) { else if ( Array.isArray(o) ) { result = this.checkCircularRefs(o, function(arr) { var newArray = []; + arr.forEach(function(item) { newArray.push( self.walk(item) ); }); + self.removeSeenFlag(arr); + return newArray; }); } @@ -107,11 +110,14 @@ ObjectWalker.prototype.walk = function(o) { else if ( this.isObject(o) && o !== null ) { result = this.checkCircularRefs(o, function(obj) { var newObj = {}; + Object.keys(obj).forEach(function(key) { - if (!setDefined && key === 'hasBeenSeenByWalkerDumper') { return; } + if (!SET_DEFINED && key === OBJECT_WALKER_KEY) { return; } newObj[key] = self.walk(obj[key]); }); + self.removeSeenFlag(obj); + return newObj; }); } @@ -128,8 +134,6 @@ ObjectWalker.prototype.walk = function(o) { */ exports.dump = function(object) { var walker = new ObjectWalker(); - var result = JSON.stringify(walker.walk(object), null, 4); - walker.cleanSeenFlag(); - return result; + return JSON.stringify(walker.walk(object), null, 4); }; diff --git a/node_modules/jsdoc/lib/jsdoc/util/logger.js b/node_modules/jsdoc/lib/jsdoc/util/logger.js index b8134d6..8d2976a 100644 --- a/node_modules/jsdoc/lib/jsdoc/util/logger.js +++ b/node_modules/jsdoc/lib/jsdoc/util/logger.js @@ -47,21 +47,36 @@ var logger = module.exports = new Logger(); * Logging levels for the JSDoc logger. The default logging level is * {@link module:jsdoc/util/logger.LEVELS.ERROR}. * + * @alias module:jsdoc/util/logger.LEVELS * @enum * @type {number} */ var LEVELS = logger.LEVELS = { - /** Do not log any messages. */ + /** + * Do not log any messages. + * + * @alias module:jsdoc/util/logger.LEVELS.SILENT + */ SILENT: 0, - /** Log fatal errors that prevent JSDoc from running. */ + /** + * Log fatal errors that prevent JSDoc from running. + * + * @alias module:jsdoc/util/logger.LEVELS.FATAL + */ FATAL: 10, - /** Log all errors, including errors from which JSDoc can recover. */ + /** + * Log all errors, including errors from which JSDoc can recover. + * + * @alias module:jsdoc/util/logger.LEVELS.ERROR + */ ERROR: 20, /** * Log the following messages: * * + Warnings * + Errors + * + * @alias module:jsdoc/util/logger.LEVELS.WARN */ WARN: 30, /** @@ -70,6 +85,8 @@ var LEVELS = logger.LEVELS = { * + Informational messages * + Warnings * + Errors + * + * @alias module:jsdoc/util/logger.LEVELS.INFO */ INFO: 40, /** @@ -79,9 +96,15 @@ var LEVELS = logger.LEVELS = { * + Informational messages * + Warnings * + Errors + * + * @alias module:jsdoc/util/logger.LEVELS.DEBUG */ DEBUG: 50, - /** Log all messages. */ + /** + * Log all messages. + * + * @alias module:jsdoc/util/logger.LEVELS.VERBOSE + */ VERBOSE: 1000 }; @@ -139,6 +162,7 @@ function printToStdout() { /** * Log a message at log level {@link module:jsdoc/util/logger.LEVELS.DEBUG}. * + * @alias module:jsdoc/util/logger.debug * @param {string} message - The message to log. * @param {...*=} values - The values that will replace the message's placeholders. */ @@ -147,6 +171,7 @@ logger.debug = wrapLogFunction('debug', console.info); * Print a string at log level {@link module:jsdoc/util/logger.LEVELS.DEBUG}. The string is not * terminated by a newline. * + * @alias module:jsdoc/util/logger.printDebug * @param {string} message - The message to log. * @param {...*=} values - The values that will replace the message's placeholders. */ @@ -154,8 +179,7 @@ logger.printDebug = wrapLogFunction('debug', printToStdout); /** * Log a message at log level {@link module:jsdoc/util/logger.LEVELS.ERROR}. * - * @name module:jsdoc/util/logger.error - * @function + * @alias module:jsdoc/util/logger.error * @param {string} message - The message to log. * @param {...*=} values - The values that will replace the message's placeholders. */ @@ -163,8 +187,7 @@ logger.error = wrapLogFunction('error', console.error); /** * Log a message at log level {@link module:jsdoc/util/logger.LEVELS.FATAL}. * - * @name module:jsdoc/util/logger.error - * @function + * @alias module:jsdoc/util/logger.fatal * @param {string} message - The message to log. * @param {...*=} values - The values that will replace the message's placeholders. */ @@ -172,8 +195,7 @@ logger.fatal = wrapLogFunction('fatal', console.error); /** * Log a message at log level {@link module:jsdoc/util/logger.LEVELS.INFO}. * - * @name module:jsdoc/util/logger.info - * @function + * @alias module:jsdoc/util/logger.info * @param {string} message - The message to log. * @param {...*=} values - The values that will replace the message's placeholders. */ @@ -182,6 +204,7 @@ logger.info = wrapLogFunction('info', console.info); * Print a string at log level {@link module:jsdoc/util/logger.LEVELS.INFO}. The string is not * terminated by a newline. * + * @alias module:jsdoc/util/logger.printInfo * @param {string} message - The message to log. * @param {...*=} values - The values that will replace the message's placeholders. */ @@ -189,8 +212,7 @@ logger.printInfo = wrapLogFunction('info', printToStdout); /** * Log a message at log level {@link module:jsdoc/util/logger.LEVELS.VERBOSE}. * - * @name module:jsdoc/util/logger.verbose - * @function + * @alias module:jsdoc/util/logger.verbose * @param {string} message - The message to log. * @param {...*=} values - The values that will replace the message's placeholders. */ @@ -199,6 +221,7 @@ logger.verbose = wrapLogFunction('verbose', console.info); * Print a string at log level {@link module:jsdoc/util/logger.LEVELS.VERBOSE}. The string is not * terminated by a newline. * + * @alias module:jsdoc/util/logger.printVerbose * @param {string} message - The message to log. * @param {...*=} values - The values that will replace the message's placeholders. */ @@ -206,8 +229,7 @@ logger.printVerbose = wrapLogFunction('verbose', printToStdout); /** * Log a message at log level {@link module:jsdoc/util/logger.LEVELS.WARN}. * - * @name module:jsdoc/util/logger.warn - * @function + * @alias module:jsdoc/util/logger.warn * @param {string} message - The message to log. * @param {...*=} values - The values that will replace the message's placeholders. */ @@ -216,6 +238,7 @@ logger.warn = wrapLogFunction('warn', console.warn); /** * Set the log level. * + * @alias module:jsdoc/util/logger.setLevel * @param {module:jsdoc/util/logger.LEVELS} level - The log level to use. */ logger.setLevel = function setLevel(level) { @@ -225,6 +248,7 @@ logger.setLevel = function setLevel(level) { /** * Get the current log level. * + * @alias module:jsdoc/util/logger.getLevel * @return {module:jsdoc/util/logger.LEVELS} The current log level. */ logger.getLevel = function getLevel() { diff --git a/node_modules/jsdoc/lib/jsdoc/util/runtime.js b/node_modules/jsdoc/lib/jsdoc/util/runtime.js index d435eae..1a50a32 100644 --- a/node_modules/jsdoc/lib/jsdoc/util/runtime.js +++ b/node_modules/jsdoc/lib/jsdoc/util/runtime.js @@ -81,7 +81,7 @@ function initializeNode(args) { } exports.initialize = function(args) { - switch(runtime) { + switch (runtime) { case RHINO: initializeRhino(args); break; diff --git a/node_modules/jsdoc/lib/jsdoc/util/templateHelper.js b/node_modules/jsdoc/lib/jsdoc/util/templateHelper.js index 709cd2f..793331b 100644 --- a/node_modules/jsdoc/lib/jsdoc/util/templateHelper.js +++ b/node_modules/jsdoc/lib/jsdoc/util/templateHelper.js @@ -4,15 +4,20 @@ */ 'use strict'; +var catharsis = require('catharsis'); var dictionary = require('jsdoc/tag/dictionary'); +var name = require('jsdoc/name'); var util = require('util'); var hasOwnProp = Object.prototype.hasOwnProperty; +var MODULE_NAMESPACE = 'module:'; + var files = {}; +var ids = {}; // each container gets its own html file -var containers = ['class', 'module', 'external', 'namespace', 'mixin']; +var containers = ['class', 'module', 'external', 'namespace', 'mixin', 'interface']; var tutorials; @@ -23,9 +28,36 @@ exports.setTutorials = function(root) { tutorials = root; }; -exports.globalName = 'global'; +exports.globalName = name.SCOPE.NAMES.GLOBAL; exports.fileExtension = '.html'; -exports.scopeToPunc = require('jsdoc/name').scopeToPunc; +exports.scopeToPunc = name.scopeToPunc; + +var linkMap = { + // two-way lookup + longnameToUrl: {}, + urlToLongname: {}, + + // one-way lookup (IDs are only unique per file) + longnameToId: {} +}; + +// two-way lookup +var tutorialLinkMap = { + nameToUrl: {}, + urlToName: {} +}; + +var longnameToUrl = exports.longnameToUrl = linkMap.longnameToUrl; +var longnameToId = exports.longnameToId = linkMap.longnameToId; + +var registerLink = exports.registerLink = function(longname, fileUrl) { + linkMap.longnameToUrl[longname] = fileUrl; + linkMap.urlToLongname[fileUrl] = longname; +}; + +var registerId = exports.registerId = function(longname, fragment) { + linkMap.longnameToId[longname] = fragment; +}; function getNamespace(kind) { if (dictionary.isNamespace(kind)) { @@ -34,13 +66,33 @@ function getNamespace(kind) { return ''; } -function makeFilenameUnique(filename, str) { +function formatNameForLink(doclet, options) { + var newName = getNamespace(doclet.kind) + (doclet.name || '') + (doclet.variation || ''); + var scopePunc = exports.scopeToPunc[doclet.scope] || ''; + + // Only prepend the scope punctuation if it's not the same character that marks the start of a + // fragment ID. Using `#` in HTML5 fragment IDs is legal, but URLs like `foo.html##bar` are + // just confusing. + if (scopePunc !== '#') { + newName = scopePunc + newName; + } + + return newName; +} + +function makeUniqueFilename(filename, str) { var key = filename.toLowerCase(); var nonUnique = true; + // don't allow filenames to begin with an underscore + if (!filename.length || filename[0] === '_') { + filename = '-' + filename; + key = filename.toLowerCase(); + } + // append enough underscores to make the filename unique while (nonUnique) { - if ( files[key] && hasOwnProp.call(files, key) ) { + if ( hasOwnProp.call(files, key) ) { filename += '_'; key = filename.toLowerCase(); } else { @@ -52,25 +104,6 @@ function makeFilenameUnique(filename, str) { return filename; } -function cleanseFilename(str) { - str = str || ''; - - // allow for namespace prefix - // TODO: use prefixes in jsdoc/doclet - return str.replace(/^(event|module|external|package):/, '$1-') - // use - instead of ~ to denote 'inner' - .replace(/~/g, '-') - // use _ instead of # to denote 'instance' - .replace(/\#/g, '_') - // remove the variation, if any - .replace(/\([\s\S]*\)$/, ''); -} - -var htmlsafe = exports.htmlsafe = function(str) { - return str.replace(/&/g, '&') - .replace(/]/g, '_') + // use - instead of ~ to denote 'inner' + .replace(/~/g, '-') + // use _ instead of # to denote 'instance' + .replace(/\#/g, '_') + // use _ instead of / (for example, in module names) + .replace(/\//g, '_') + // remove the variation, if any + .replace(/\([\s\S]*\)$/, '') + // make sure we don't create hidden files, or files whose names start with a dash + .replace(/^[\.\-]/, ''); - // if the basename includes characters that we can't use in a filepath, remove everything up to - // and including the last bad character - var regexp = /[^$a-z0-9._\-](?=[$a-z0-9._\-]*$)/i; - var result = regexp.exec(basename); - if (result && result.index) { - basename = basename.substr(result.index + 1); - } - - // make sure we don't create hidden files on POSIX systems - basename = basename.replace(/^\./, ''); - // and in case we've now stripped the entire basename (uncommon, but possible): + // in case we've now stripped the entire basename (uncommon, but possible): basename = basename.length ? basename : '_'; - return makeFilenameUnique(basename, str) + exports.fileExtension; + return makeUniqueFilename(basename, str) + exports.fileExtension; }; -// two-way lookup -var linkMap = { - longnameToUrl: {}, - urlToLongname: {} -}; +/** + * Get a longname's filename if one has been registered; otherwise, generate a unique filename, then + * register the filename. + * @private + */ +function getFilename(longname) { + var fileUrl; -var tutorialLinkMap = { - nameToUrl: {}, - urlToName: {} -}; + if ( hasOwnProp.call(longnameToUrl, longname) ) { + fileUrl = longnameToUrl[longname]; + } + else { + fileUrl = getUniqueFilename(longname); + registerLink(longname, fileUrl); + } -var longnameToUrl = exports.longnameToUrl = linkMap.longnameToUrl; + return fileUrl; +} + +/** + * Check whether a symbol is the only symbol exported by a module (as in + * `module.exports = function() {};`). + * + * @private + * @param {module:jsdoc/doclet.Doclet} doclet - The doclet for the symbol. + * @return {boolean} `true` if the symbol is the only symbol exported by a module; otherwise, + * `false`. + */ +function isModuleExports(doclet) { + return doclet.longname && doclet.longname === doclet.name && + doclet.longname.indexOf(MODULE_NAMESPACE) === 0 && doclet.kind !== 'module'; +} + +function makeUniqueId(filename, id) { + var key; + var nonUnique = true; + + key = id.toLowerCase(); + + // HTML5 IDs cannot contain whitespace characters + id = id.replace(/\s/g, ''); + + // append enough underscores to make the identifier unique + while (nonUnique) { + if ( hasOwnProp.call(ids, filename) && hasOwnProp.call(ids[filename], key) ) { + id += '_'; + key = id.toLowerCase(); + } + else { + nonUnique = false; + } + } + + ids[filename] = ids[filename] || {}; + ids[filename][key] = id; + + return id; +} + +/** + * Get a doclet's ID if one has been registered; otherwise, generate a unique ID, then register + * the ID. + * @private + */ +function getId(longname, id) { + if ( hasOwnProp.call(longnameToId, longname) ) { + id = longnameToId[longname]; + } + else if (!id) { + // no ID required + return ''; + } + else { + id = makeUniqueId(longname, id); + registerId(longname, id); + } + + return id; +} + +/** + * Convert a doclet to an identifier that is unique for a specified filename. + * + * Identifiers are not considered unique if they are capitalized differently but are otherwise + * identical. + * + * @method + * @param {string} filename - The file in which the identifier will be used. + * @param {string} doclet - The doclet to convert. + * @return {string} A unique identifier based on the file and doclet. + */ +var getUniqueId = exports.getUniqueId = makeUniqueId; + +var htmlsafe = exports.htmlsafe = function(str) { + return str.replace(/&/g, '&') + .replace(/ 0; + return /^{.+}$/.test(expr) || /^.+\|.+$/.test(expr) || /^.+<.+>$/.test(expr); +} + +function fragmentHash(fragmentId) { + if (!fragmentId) { + return ''; + } + + return '#' + fragmentId; } /** @@ -171,13 +300,12 @@ function isComplexTypeExpression(expr) { * @return {string} The HTML link, or the link text if the link is not available. */ function buildLink(longname, linkText, options) { - var catharsis = require('catharsis'); - var classString = options.cssClass ? util.format(' class="%s"', options.cssClass) : ''; - var fragmentString = options.fragmentId ? '#' + options.fragmentId : ''; + var fileUrl; + var fragmentString = fragmentHash(options.fragmentId); var stripped; var text; - var url; + var parsedType; // handle cases like: @@ -185,7 +313,7 @@ function buildLink(longname, linkText, options) { // @see http://example.org stripped = longname ? longname.replace(/^<|>$/g, '') : ''; if ( hasUrlPrefix(stripped) ) { - url = stripped; + fileUrl = stripped; text = linkText || stripped; } // handle complex type expressions that may require multiple links @@ -195,17 +323,18 @@ function buildLink(longname, linkText, options) { return stringifyType(parsedType, options.cssClass, options.linkMap); } else { - url = hasOwnProp.call(options.linkMap, longname) ? options.linkMap[longname] : ''; + fileUrl = hasOwnProp.call(options.linkMap, longname) ? options.linkMap[longname] : ''; text = linkText || longname; } text = options.monospace ? '' + text + '' : text; - if (!url) { + if (!fileUrl) { return text; } else { - return util.format('%s', url, fragmentString, classString, text); + return util.format('%s', encodeURI(fileUrl + fragmentString), + classString, text); } } @@ -287,19 +416,20 @@ function splitLinkText(text) { } var tutorialToUrl = exports.tutorialToUrl = function(tutorial) { + var fileUrl; var node = tutorials.getByName(tutorial); + // no such tutorial if (!node) { require('jsdoc/util/logger').error( new Error('No such tutorial: ' + tutorial) ); return null; } - var url; // define the URL if necessary if (!hasOwnProp.call(tutorialLinkMap.nameToUrl, node.name)) { - url = 'tutorial-' + getUniqueFilename(node.name); - tutorialLinkMap.nameToUrl[node.name] = url; - tutorialLinkMap.urlToName[url] = node.name; + fileUrl = 'tutorial-' + getUniqueFilename(node.name); + tutorialLinkMap.nameToUrl[node.name] = fileUrl; + tutorialLinkMap.urlToName[fileUrl] = node.name; } return tutorialLinkMap.nameToUrl[node.name]; @@ -439,22 +569,6 @@ var find = exports.find = function(data, spec) { return data(spec).get(); }; -/** - * Check whether a symbol is the only symbol exported by a module (as in - * `module.exports = function() {};`). - * - * @private - * @param {module:jsdoc/doclet.Doclet} doclet - The doclet for the symbol. - * @return {boolean} `true` if the symbol is the only symbol exported by a module; otherwise, - * `false`. - */ -function isModuleExports(doclet) { - var MODULE_PREFIX = require('jsdoc/name').MODULE_PREFIX; - - return doclet.longname && doclet.longname === doclet.name && - doclet.longname.indexOf(MODULE_PREFIX) === 0 && doclet.kind !== 'module'; -} - /** * Retrieve all of the following types of members from a set of doclets: * @@ -480,10 +594,20 @@ exports.getMembers = function(data) { }), mixins: find( data, {kind: 'mixin'} ), modules: find( data, {kind: 'module'} ), - namespaces: find( data, {kind: 'namespace'} ) + namespaces: find( data, {kind: 'namespace'} ), + interfaces: find( data, {kind: 'interface'} ) }; - // functions that are also modules (as in "module.exports = function() {};") are not globals + // strip quotes from externals, since we allow quoted names that would normally indicate a + // namespace hierarchy (as in `@external "jquery.fn"`) + // TODO: we should probably be doing this for other types of symbols, here or elsewhere; see + // jsdoc3/jsdoc#396 + members.externals = members.externals.map(function(doclet) { + doclet.name = doclet.name.replace(/(^"|"$)/g, ''); + return doclet; + }); + + // functions that are also modules (as in `module.exports = function() {};`) are not globals members.globals = members.globals.filter(function(doclet) { return !isModuleExports(doclet); }); @@ -500,6 +624,10 @@ exports.getMembers = function(data) { exports.getAttribs = function(d) { var attribs = []; + if (!d) { + return attribs; + } + if (d.virtual) { attribs.push('abstract'); } @@ -508,7 +636,7 @@ exports.getAttribs = function(d) { attribs.push(d.access); } - if (d.scope && d.scope !== 'instance' && d.scope !== 'global') { + if (d.scope && d.scope !== 'instance' && d.scope !== name.SCOPE.NAMES.GLOBAL) { if (d.kind === 'function' || d.kind === 'member' || d.kind === 'constant') { attribs.push(d.scope); } @@ -615,6 +743,29 @@ exports.getSignatureReturns = function(d, cssClass) { return returnTypes; }; +/** + * Retrieve an ordered list of doclets for a symbol's ancestors. + * + * @param {TAFFY} data - The TaffyDB database to search. + * @param {Object} doclet - The doclet whose ancestors will be retrieved. + * @return {Array.} A array of ancestor doclets, sorted from most to + * least distant. + */ +exports.getAncestors = function(data, doclet) { + var ancestors = []; + var doc = doclet; + + while (doc) { + doc = find(data, {longname: doc.memberof})[0]; + + if (doc) { + ancestors.unshift(doc); + } + } + + return ancestors; +}; + /** * Retrieve links to a member's ancestors. * @@ -624,21 +775,20 @@ exports.getSignatureReturns = function(d, cssClass) { * @return {Array.} HTML links to a member's ancestors. */ exports.getAncestorLinks = function(data, doclet, cssClass) { - var ancestors = [], - doc = doclet.memberof; + var ancestors = exports.getAncestors(data, doclet); + var links = []; - while (doc) { - doc = find( data, {longname: doc}, false ); - if (doc) { doc = doc[0]; } - if (!doc) { break; } - ancestors.unshift( linkto(doc.longname, (exports.scopeToPunc[doc.scope] || '') + doc.name, - cssClass) ); - doc = doc.memberof; + ancestors.forEach(function(ancestor) { + var linkText = (exports.scopeToPunc[ancestor.scope] || '') + ancestor.name; + var link = linkto(ancestor.longname, linkText, cssClass); + links.push(link); + }); + + if (links.length) { + links[links.length - 1] += (exports.scopeToPunc[doclet.scope] || ''); } - if (ancestors.length) { - ancestors[ancestors.length - 1] += (exports.scopeToPunc[doclet.scope] || ''); - } - return ancestors; + + return links; }; /** @@ -684,51 +834,52 @@ exports.addEventListeners = function(data) { * + Members tagged `@ignore`. * + Members of anonymous classes. * + Members tagged `@private`, unless the `private` option is enabled. + * + Members tagged with anything other than specified by the `access` options. * @param {TAFFY} data The TaffyDB database to prune. * @return {TAFFY} The pruned database. */ exports.prune = function(data) { data({undocumented: true}).remove(); data({ignore: true}).remove(); - if (!env.opts.private) { data({access: 'private'}).remove(); } data({memberof: ''}).remove(); + if (!env.opts.access || (env.opts.access && env.opts.access.indexOf('all') === -1)) { + if (env.opts.access && env.opts.access.indexOf('public') === -1) { + data({access: 'public'}).remove(); + } + if (env.opts.access && env.opts.access.indexOf('protected') === -1) { + data({access: 'protected'}).remove(); + } + if (!env.opts.private && (!env.opts.access || (env.opts.access && env.opts.access.indexOf('private') === -1))) { + data({access: 'private'}).remove(); + } + if (env.opts.access && env.opts.access.indexOf('undefined') === -1) { + data({access: {isUndefined: true}}).remove(); + } + } + return data; }; -var registerLink = exports.registerLink = function(longname, url) { - linkMap.longnameToUrl[longname] = url; - linkMap.urlToLongname[url] = longname; -}; - /** - * Get a longname's filename if one has been registered; otherwise, generate a unique filename, then - * register the filename. - * @private + * Create a URL that points to the generated documentation for the doclet. + * + * If a doclet corresponds to an output file (for example, if the doclet represents a class), the + * URL will consist of a filename. + * + * If a doclet corresponds to a smaller portion of an output file (for example, if the doclet + * represents a method), the URL will consist of a filename and a fragment ID. + * + * @param {module:jsdoc/doclet.Doclet} doclet - The doclet that will be used to create the URL. + * @return {string} The URL to the generated documentation for the doclet. */ -function getFilename(longname) { - var url; - - if ( longnameToUrl[longname] && hasOwnProp.call(longnameToUrl, longname) ) { - url = longnameToUrl[longname]; - } else { - url = getUniqueFilename(longname); - registerLink(longname, url); - } - - return url; -} - -/** Turn a doclet into a URL. */ exports.createLink = function(doclet) { - var filename; - var fragment; - var match; var fakeContainer; - - var url = ''; - var INSTANCE = exports.scopeToPunc.instance; + var filename; + var fileUrl; + var fragment = ''; var longname = doclet.longname; + var match; // handle doclets in which doclet.longname implies that the doclet gets its own HTML file, but // doclet.kind says otherwise. this happens due to mistagged JSDoc (for example, a module that @@ -748,20 +899,37 @@ exports.createLink = function(doclet) { // mistagged version of a doclet that gets its own HTML file else if ( containers.indexOf(doclet.kind) === -1 && fakeContainer ) { filename = getFilename(doclet.memberof || longname); - if (doclet.name === doclet.longname) { - fragment = ''; - } - else { - fragment = doclet.name || ''; + if (doclet.name !== doclet.longname) { + fragment = formatNameForLink(doclet); + fragment = getId(longname, fragment); } } // the doclet is within another HTML file else { filename = getFilename(doclet.memberof || exports.globalName); - fragment = getNamespace(doclet.kind) + (doclet.name || ''); + if ( (doclet.name !== doclet.longname) || (doclet.scope === name.SCOPE.NAMES.GLOBAL) ) { + fragment = formatNameForLink(doclet); + fragment = getId(longname, fragment); + } } - url = fragment ? (filename + INSTANCE + fragment) : filename; + fileUrl = encodeURI( filename + fragmentHash(fragment) ); - return url; + return fileUrl; +}; + +// TODO: docs +exports.longnamesToTree = name.longnamesToTree; + +/** + * Replace the existing tag dictionary with a new tag dictionary. + * + * Used for testing only. Do not call this method directly. Instead, call + * {@link module:jsdoc/doclet._replaceDictionary}, which also updates this module's tag dictionary. + * + * @private + * @param {module:jsdoc/tag/dictionary.Dictionary} dict - The new tag dictionary. + */ +exports._replaceDictionary = function _replaceDictionary(dict) { + dictionary = dict; }; diff --git a/node_modules/jsdoc/node/fs.js b/node_modules/jsdoc/node/fs.js index c9b5932..bf652f2 100644 --- a/node_modules/jsdoc/node/fs.js +++ b/node_modules/jsdoc/node/fs.js @@ -8,6 +8,8 @@ var wrench = require('wrench'); var toDir = exports.toDir = function(_path) { var isDirectory; + _path = path.normalize(_path); + try { isDirectory = fs.statSync(_path).isDirectory(); } @@ -15,7 +17,7 @@ var toDir = exports.toDir = function(_path) { isDirectory = false; } - if (isDirectory){ + if (isDirectory) { return _path; } else { return path.dirname(_path); diff --git a/node_modules/jsdoc/node_modules/async/.gitmodules b/node_modules/jsdoc/node_modules/async/.gitmodules deleted file mode 100644 index a9aae98..0000000 --- a/node_modules/jsdoc/node_modules/async/.gitmodules +++ /dev/null @@ -1,9 +0,0 @@ -[submodule "deps/nodeunit"] - path = deps/nodeunit - url = git://github.com/caolan/nodeunit.git -[submodule "deps/UglifyJS"] - path = deps/UglifyJS - url = https://github.com/mishoo/UglifyJS.git -[submodule "deps/nodelint"] - path = deps/nodelint - url = https://github.com/tav/nodelint.git diff --git a/node_modules/jsdoc/node_modules/async/.npmignore b/node_modules/jsdoc/node_modules/async/.npmignore deleted file mode 100644 index 9bdfc97..0000000 --- a/node_modules/jsdoc/node_modules/async/.npmignore +++ /dev/null @@ -1,4 +0,0 @@ -deps -dist -test -nodelint.cfg \ No newline at end of file diff --git a/node_modules/jsdoc/node_modules/async/Makefile b/node_modules/jsdoc/node_modules/async/Makefile deleted file mode 100644 index bad647c..0000000 --- a/node_modules/jsdoc/node_modules/async/Makefile +++ /dev/null @@ -1,25 +0,0 @@ -PACKAGE = asyncjs -NODEJS = $(if $(shell test -f /usr/bin/nodejs && echo "true"),nodejs,node) -CWD := $(shell pwd) -NODEUNIT = $(CWD)/node_modules/nodeunit/bin/nodeunit -UGLIFY = $(CWD)/node_modules/uglify-js/bin/uglifyjs -NODELINT = $(CWD)/node_modules/nodelint/nodelint - -BUILDDIR = dist - -all: clean test build - -build: $(wildcard lib/*.js) - mkdir -p $(BUILDDIR) - $(UGLIFY) lib/async.js > $(BUILDDIR)/async.min.js - -test: - $(NODEUNIT) test - -clean: - rm -rf $(BUILDDIR) - -lint: - $(NODELINT) --config nodelint.cfg lib/async.js - -.PHONY: test build all diff --git a/node_modules/jsdoc/node_modules/async/README.md b/node_modules/jsdoc/node_modules/async/README.md deleted file mode 100644 index 1bbbc47..0000000 --- a/node_modules/jsdoc/node_modules/async/README.md +++ /dev/null @@ -1,1021 +0,0 @@ -# Async.js - -Async is a utility module which provides straight-forward, powerful functions -for working with asynchronous JavaScript. Although originally designed for -use with [node.js](http://nodejs.org), it can also be used directly in the -browser. - -Async provides around 20 functions that include the usual 'functional' -suspects (map, reduce, filter, forEach…) as well as some common patterns -for asynchronous control flow (parallel, series, waterfall…). All these -functions assume you follow the node.js convention of providing a single -callback as the last argument of your async function. - - -## Quick Examples - - async.map(['file1','file2','file3'], fs.stat, function(err, results){ - // results is now an array of stats for each file - }); - - async.filter(['file1','file2','file3'], path.exists, function(results){ - // results now equals an array of the existing files - }); - - async.parallel([ - function(){ ... }, - function(){ ... } - ], callback); - - async.series([ - function(){ ... }, - function(){ ... } - ]); - -There are many more functions available so take a look at the docs below for a -full list. This module aims to be comprehensive, so if you feel anything is -missing please create a GitHub issue for it. - - -## Download - -Releases are available for download from -[GitHub](http://github.com/caolan/async/downloads). -Alternatively, you can install using Node Package Manager (npm): - - npm install async - - -__Development:__ [async.js](https://github.com/caolan/async/raw/master/lib/async.js) - 17.5kb Uncompressed - -__Production:__ [async.min.js](https://github.com/caolan/async/raw/master/dist/async.min.js) - 1.7kb Packed and Gzipped - - -## In the Browser - -So far its been tested in IE6, IE7, IE8, FF3.6 and Chrome 5. Usage: - - - - - -## Documentation - -### Collections - -* [forEach](#forEach) -* [map](#map) -* [filter](#filter) -* [reject](#reject) -* [reduce](#reduce) -* [detect](#detect) -* [sortBy](#sortBy) -* [some](#some) -* [every](#every) -* [concat](#concat) - -### Control Flow - -* [series](#series) -* [parallel](#parallel) -* [whilst](#whilst) -* [until](#until) -* [waterfall](#waterfall) -* [queue](#queue) -* [auto](#auto) -* [iterator](#iterator) -* [apply](#apply) -* [nextTick](#nextTick) - -### Utils - -* [memoize](#memoize) -* [unmemoize](#unmemoize) -* [log](#log) -* [dir](#dir) -* [noConflict](#noConflict) - - -## Collections - - -### forEach(arr, iterator, callback) - -Applies an iterator function to each item in an array, in parallel. -The iterator is called with an item from the list and a callback for when it -has finished. If the iterator passes an error to this callback, the main -callback for the forEach function is immediately called with the error. - -Note, that since this function applies the iterator to each item in parallel -there is no guarantee that the iterator functions will complete in order. - -__Arguments__ - -* arr - An array to iterate over. -* iterator(item, callback) - A function to apply to each item in the array. - The iterator is passed a callback which must be called once it has completed. -* callback(err) - A callback which is called after all the iterator functions - have finished, or an error has occurred. - -__Example__ - - // assuming openFiles is an array of file names and saveFile is a function - // to save the modified contents of that file: - - async.forEach(openFiles, saveFile, function(err){ - // if any of the saves produced an error, err would equal that error - }); - ---------------------------------------- - - -### forEachSeries(arr, iterator, callback) - -The same as forEach only the iterator is applied to each item in the array in -series. The next iterator is only called once the current one has completed -processing. This means the iterator functions will complete in order. - - ---------------------------------------- - - -### forEachLimit(arr, limit, iterator, callback) - -The same as forEach only the iterator is applied to batches of items in the -array, in series. The next batch of iterators is only called once the current -one has completed processing. - -__Arguments__ - -* arr - An array to iterate over. -* limit - How many items should be in each batch. -* iterator(item, callback) - A function to apply to each item in the array. - The iterator is passed a callback which must be called once it has completed. -* callback(err) - A callback which is called after all the iterator functions - have finished, or an error has occurred. - -__Example__ - - // Assume documents is an array of JSON objects and requestApi is a - // function that interacts with a rate-limited REST api. - - async.forEachLimit(documents, 20, requestApi, function(err){ - // if any of the saves produced an error, err would equal that error - }); ---------------------------------------- - - -### map(arr, iterator, callback) - -Produces a new array of values by mapping each value in the given array through -the iterator function. The iterator is called with an item from the array and a -callback for when it has finished processing. The callback takes 2 arguments, -an error and the transformed item from the array. If the iterator passes an -error to this callback, the main callback for the map function is immediately -called with the error. - -Note, that since this function applies the iterator to each item in parallel -there is no guarantee that the iterator functions will complete in order, however -the results array will be in the same order as the original array. - -__Arguments__ - -* arr - An array to iterate over. -* iterator(item, callback) - A function to apply to each item in the array. - The iterator is passed a callback which must be called once it has completed - with an error (which can be null) and a transformed item. -* callback(err, results) - A callback which is called after all the iterator - functions have finished, or an error has occurred. Results is an array of the - transformed items from the original array. - -__Example__ - - async.map(['file1','file2','file3'], fs.stat, function(err, results){ - // results is now an array of stats for each file - }); - ---------------------------------------- - - -### mapSeries(arr, iterator, callback) - -The same as map only the iterator is applied to each item in the array in -series. The next iterator is only called once the current one has completed -processing. The results array will be in the same order as the original. - - ---------------------------------------- - - -### filter(arr, iterator, callback) - -__Alias:__ select - -Returns a new array of all the values which pass an async truth test. -_The callback for each iterator call only accepts a single argument of true or -false, it does not accept an error argument first!_ This is in-line with the -way node libraries work with truth tests like path.exists. This operation is -performed in parallel, but the results array will be in the same order as the -original. - -__Arguments__ - -* arr - An array to iterate over. -* iterator(item, callback) - A truth test to apply to each item in the array. - The iterator is passed a callback which must be called once it has completed. -* callback(results) - A callback which is called after all the iterator - functions have finished. - -__Example__ - - async.filter(['file1','file2','file3'], path.exists, function(results){ - // results now equals an array of the existing files - }); - ---------------------------------------- - - -### filterSeries(arr, iterator, callback) - -__alias:__ selectSeries - -The same as filter only the iterator is applied to each item in the array in -series. The next iterator is only called once the current one has completed -processing. The results array will be in the same order as the original. - ---------------------------------------- - - -### reject(arr, iterator, callback) - -The opposite of filter. Removes values that pass an async truth test. - ---------------------------------------- - - -### rejectSeries(arr, iterator, callback) - -The same as filter, only the iterator is applied to each item in the array -in series. - - ---------------------------------------- - - -### reduce(arr, memo, iterator, callback) - -__aliases:__ inject, foldl - -Reduces a list of values into a single value using an async iterator to return -each successive step. Memo is the initial state of the reduction. This -function only operates in series. For performance reasons, it may make sense to -split a call to this function into a parallel map, then use the normal -Array.prototype.reduce on the results. This function is for situations where -each step in the reduction needs to be async, if you can get the data before -reducing it then its probably a good idea to do so. - -__Arguments__ - -* arr - An array to iterate over. -* memo - The initial state of the reduction. -* iterator(memo, item, callback) - A function applied to each item in the - array to produce the next step in the reduction. The iterator is passed a - callback which accepts an optional error as its first argument, and the state - of the reduction as the second. If an error is passed to the callback, the - reduction is stopped and the main callback is immediately called with the - error. -* callback(err, result) - A callback which is called after all the iterator - functions have finished. Result is the reduced value. - -__Example__ - - async.reduce([1,2,3], 0, function(memo, item, callback){ - // pointless async: - process.nextTick(function(){ - callback(null, memo + item) - }); - }, function(err, result){ - // result is now equal to the last value of memo, which is 6 - }); - ---------------------------------------- - - -### reduceRight(arr, memo, iterator, callback) - -__Alias:__ foldr - -Same as reduce, only operates on the items in the array in reverse order. - - ---------------------------------------- - - -### detect(arr, iterator, callback) - -Returns the first value in a list that passes an async truth test. The -iterator is applied in parallel, meaning the first iterator to return true will -fire the detect callback with that result. That means the result might not be -the first item in the original array (in terms of order) that passes the test. - -If order within the original array is important then look at detectSeries. - -__Arguments__ - -* arr - An array to iterate over. -* iterator(item, callback) - A truth test to apply to each item in the array. - The iterator is passed a callback which must be called once it has completed. -* callback(result) - A callback which is called as soon as any iterator returns - true, or after all the iterator functions have finished. Result will be - the first item in the array that passes the truth test (iterator) or the - value undefined if none passed. - -__Example__ - - async.detect(['file1','file2','file3'], path.exists, function(result){ - // result now equals the first file in the list that exists - }); - ---------------------------------------- - - -### detectSeries(arr, iterator, callback) - -The same as detect, only the iterator is applied to each item in the array -in series. This means the result is always the first in the original array (in -terms of array order) that passes the truth test. - - ---------------------------------------- - - -### sortBy(arr, iterator, callback) - -Sorts a list by the results of running each value through an async iterator. - -__Arguments__ - -* arr - An array to iterate over. -* iterator(item, callback) - A function to apply to each item in the array. - The iterator is passed a callback which must be called once it has completed - with an error (which can be null) and a value to use as the sort criteria. -* callback(err, results) - A callback which is called after all the iterator - functions have finished, or an error has occurred. Results is the items from - the original array sorted by the values returned by the iterator calls. - -__Example__ - - async.sortBy(['file1','file2','file3'], function(file, callback){ - fs.stat(file, function(err, stats){ - callback(err, stats.mtime); - }); - }, function(err, results){ - // results is now the original array of files sorted by - // modified date - }); - - ---------------------------------------- - - -### some(arr, iterator, callback) - -__Alias:__ any - -Returns true if at least one element in the array satisfies an async test. -_The callback for each iterator call only accepts a single argument of true or -false, it does not accept an error argument first!_ This is in-line with the -way node libraries work with truth tests like path.exists. Once any iterator -call returns true, the main callback is immediately called. - -__Arguments__ - -* arr - An array to iterate over. -* iterator(item, callback) - A truth test to apply to each item in the array. - The iterator is passed a callback which must be called once it has completed. -* callback(result) - A callback which is called as soon as any iterator returns - true, or after all the iterator functions have finished. Result will be - either true or false depending on the values of the async tests. - -__Example__ - - async.some(['file1','file2','file3'], path.exists, function(result){ - // if result is true then at least one of the files exists - }); - ---------------------------------------- - - -### every(arr, iterator, callback) - -__Alias:__ all - -Returns true if every element in the array satisfies an async test. -_The callback for each iterator call only accepts a single argument of true or -false, it does not accept an error argument first!_ This is in-line with the -way node libraries work with truth tests like path.exists. - -__Arguments__ - -* arr - An array to iterate over. -* iterator(item, callback) - A truth test to apply to each item in the array. - The iterator is passed a callback which must be called once it has completed. -* callback(result) - A callback which is called after all the iterator - functions have finished. Result will be either true or false depending on - the values of the async tests. - -__Example__ - - async.every(['file1','file2','file3'], path.exists, function(result){ - // if result is true then every file exists - }); - ---------------------------------------- - - -### concat(arr, iterator, callback) - -Applies an iterator to each item in a list, concatenating the results. Returns the -concatenated list. The iterators are called in parallel, and the results are -concatenated as they return. There is no guarantee that the results array will -be returned in the original order of the arguments passed to the iterator function. - -__Arguments__ - -* arr - An array to iterate over -* iterator(item, callback) - A function to apply to each item in the array. - The iterator is passed a callback which must be called once it has completed - with an error (which can be null) and an array of results. -* callback(err, results) - A callback which is called after all the iterator - functions have finished, or an error has occurred. Results is an array containing - the concatenated results of the iterator function. - -__Example__ - - async.concat(['dir1','dir2','dir3'], fs.readdir, function(err, files){ - // files is now a list of filenames that exist in the 3 directories - }); - ---------------------------------------- - - -### concatSeries(arr, iterator, callback) - -Same as async.concat, but executes in series instead of parallel. - - -## Control Flow - - -### series(tasks, [callback]) - -Run an array of functions in series, each one running once the previous -function has completed. If any functions in the series pass an error to its -callback, no more functions are run and the callback for the series is -immediately called with the value of the error. Once the tasks have completed, -the results are passed to the final callback as an array. - -It is also possible to use an object instead of an array. Each property will be -run as a function and the results will be passed to the final callback as an object -instead of an array. This can be a more readable way of handling results from -async.series. - - -__Arguments__ - -* tasks - An array or object containing functions to run, each function is passed - a callback it must call on completion. -* callback(err, results) - An optional callback to run once all the functions - have completed. This function gets an array of all the arguments passed to - the callbacks used in the array. - -__Example__ - - async.series([ - function(callback){ - // do some stuff ... - callback(null, 'one'); - }, - function(callback){ - // do some more stuff ... - callback(null, 'two'); - }, - ], - // optional callback - function(err, results){ - // results is now equal to ['one', 'two'] - }); - - - // an example using an object instead of an array - async.series({ - one: function(callback){ - setTimeout(function(){ - callback(null, 1); - }, 200); - }, - two: function(callback){ - setTimeout(function(){ - callback(null, 2); - }, 100); - }, - }, - function(err, results) { - // results is now equal to: {one: 1, two: 2} - }); - - ---------------------------------------- - - -### parallel(tasks, [callback]) - -Run an array of functions in parallel, without waiting until the previous -function has completed. If any of the functions pass an error to its -callback, the main callback is immediately called with the value of the error. -Once the tasks have completed, the results are passed to the final callback as an -array. - -It is also possible to use an object instead of an array. Each property will be -run as a function and the results will be passed to the final callback as an object -instead of an array. This can be a more readable way of handling results from -async.parallel. - - -__Arguments__ - -* tasks - An array or object containing functions to run, each function is passed a - callback it must call on completion. -* callback(err, results) - An optional callback to run once all the functions - have completed. This function gets an array of all the arguments passed to - the callbacks used in the array. - -__Example__ - - async.parallel([ - function(callback){ - setTimeout(function(){ - callback(null, 'one'); - }, 200); - }, - function(callback){ - setTimeout(function(){ - callback(null, 'two'); - }, 100); - }, - ], - // optional callback - function(err, results){ - // the results array will equal ['one','two'] even though - // the second function had a shorter timeout. - }); - - - // an example using an object instead of an array - async.parallel({ - one: function(callback){ - setTimeout(function(){ - callback(null, 1); - }, 200); - }, - two: function(callback){ - setTimeout(function(){ - callback(null, 2); - }, 100); - }, - }, - function(err, results) { - // results is now equals to: {one: 1, two: 2} - }); - - ---------------------------------------- - - -### whilst(test, fn, callback) - -Repeatedly call fn, while test returns true. Calls the callback when stopped, -or an error occurs. - -__Arguments__ - -* test() - synchronous truth test to perform before each execution of fn. -* fn(callback) - A function to call each time the test passes. The function is - passed a callback which must be called once it has completed with an optional - error as the first argument. -* callback(err) - A callback which is called after the test fails and repeated - execution of fn has stopped. - -__Example__ - - var count = 0; - - async.whilst( - function () { return count < 5; }, - function (callback) { - count++; - setTimeout(callback, 1000); - }, - function (err) { - // 5 seconds have passed - } - ); - - ---------------------------------------- - - -### until(test, fn, callback) - -Repeatedly call fn, until test returns true. Calls the callback when stopped, -or an error occurs. - -The inverse of async.whilst. - - ---------------------------------------- - - -### waterfall(tasks, [callback]) - -Runs an array of functions in series, each passing their results to the next in -the array. However, if any of the functions pass an error to the callback, the -next function is not executed and the main callback is immediately called with -the error. - -__Arguments__ - -* tasks - An array of functions to run, each function is passed a callback it - must call on completion. -* callback(err, [results]) - An optional callback to run once all the functions - have completed. This will be passed the results of the last task's callback. - - - -__Example__ - - async.waterfall([ - function(callback){ - callback(null, 'one', 'two'); - }, - function(arg1, arg2, callback){ - callback(null, 'three'); - }, - function(arg1, callback){ - // arg1 now equals 'three' - callback(null, 'done'); - } - ], function (err, result) { - // result now equals 'done' - }); - - ---------------------------------------- - - -### queue(worker, concurrency) - -Creates a queue object with the specified concurrency. Tasks added to the -queue will be processed in parallel (up to the concurrency limit). If all -workers are in progress, the task is queued until one is available. Once -a worker has completed a task, the task's callback is called. - -__Arguments__ - -* worker(task, callback) - An asynchronous function for processing a queued - task. -* concurrency - An integer for determining how many worker functions should be - run in parallel. - -__Queue objects__ - -The queue object returned by this function has the following properties and -methods: - -* length() - a function returning the number of items waiting to be processed. -* concurrency - an integer for determining how many worker functions should be - run in parallel. This property can be changed after a queue is created to - alter the concurrency on-the-fly. -* push(task, [callback]) - add a new task to the queue, the callback is called - once the worker has finished processing the task. - instead of a single task, an array of tasks can be submitted. the respective callback is used for every task in the list. -* saturated - a callback that is called when the queue length hits the concurrency and further tasks will be queued -* empty - a callback that is called when the last item from the queue is given to a worker -* drain - a callback that is called when the last item from the queue has returned from the worker - -__Example__ - - // create a queue object with concurrency 2 - - var q = async.queue(function (task, callback) { - console.log('hello ' + task.name); - callback(); - }, 2); - - - // assign a callback - q.drain = function() { - console.log('all items have been processed'); - } - - // add some items to the queue - - q.push({name: 'foo'}, function (err) { - console.log('finished processing foo'); - }); - q.push({name: 'bar'}, function (err) { - console.log('finished processing bar'); - }); - - // add some items to the queue (batch-wise) - - q.push([{name: 'baz'},{name: 'bay'},{name: 'bax'}], function (err) { - console.log('finished processing bar'); - }); - - ---------------------------------------- - - -### auto(tasks, [callback]) - -Determines the best order for running functions based on their requirements. -Each function can optionally depend on other functions being completed first, -and each function is run as soon as its requirements are satisfied. If any of -the functions pass an error to their callback, that function will not complete -(so any other functions depending on it will not run) and the main callback -will be called immediately with the error. Functions also receive an object -containing the results of functions which have completed so far. - -__Arguments__ - -* tasks - An object literal containing named functions or an array of - requirements, with the function itself the last item in the array. The key - used for each function or array is used when specifying requirements. The - syntax is easier to understand by looking at the example. -* callback(err, results) - An optional callback which is called when all the - tasks have been completed. The callback will receive an error as an argument - if any tasks pass an error to their callback. If all tasks complete - successfully, it will receive an object containing their results. - -__Example__ - - async.auto({ - get_data: function(callback){ - // async code to get some data - }, - make_folder: function(callback){ - // async code to create a directory to store a file in - // this is run at the same time as getting the data - }, - write_file: ['get_data', 'make_folder', function(callback){ - // once there is some data and the directory exists, - // write the data to a file in the directory - callback(null, filename); - }], - email_link: ['write_file', function(callback, results){ - // once the file is written let's email a link to it... - // results.write_file contains the filename returned by write_file. - }] - }); - -This is a fairly trivial example, but to do this using the basic parallel and -series functions would look like this: - - async.parallel([ - function(callback){ - // async code to get some data - }, - function(callback){ - // async code to create a directory to store a file in - // this is run at the same time as getting the data - } - ], - function(results){ - async.series([ - function(callback){ - // once there is some data and the directory exists, - // write the data to a file in the directory - }, - email_link: function(callback){ - // once the file is written let's email a link to it... - } - ]); - }); - -For a complicated series of async tasks using the auto function makes adding -new tasks much easier and makes the code more readable. - - ---------------------------------------- - - -### iterator(tasks) - -Creates an iterator function which calls the next function in the array, -returning a continuation to call the next one after that. Its also possible to -'peek' the next iterator by doing iterator.next(). - -This function is used internally by the async module but can be useful when -you want to manually control the flow of functions in series. - -__Arguments__ - -* tasks - An array of functions to run, each function is passed a callback it - must call on completion. - -__Example__ - - var iterator = async.iterator([ - function(){ sys.p('one'); }, - function(){ sys.p('two'); }, - function(){ sys.p('three'); } - ]); - - node> var iterator2 = iterator(); - 'one' - node> var iterator3 = iterator2(); - 'two' - node> iterator3(); - 'three' - node> var nextfn = iterator2.next(); - node> nextfn(); - 'three' - - ---------------------------------------- - - -### apply(function, arguments..) - -Creates a continuation function with some arguments already applied, a useful -shorthand when combined with other control flow functions. Any arguments -passed to the returned function are added to the arguments originally passed -to apply. - -__Arguments__ - -* function - The function you want to eventually apply all arguments to. -* arguments... - Any number of arguments to automatically apply when the - continuation is called. - -__Example__ - - // using apply - - async.parallel([ - async.apply(fs.writeFile, 'testfile1', 'test1'), - async.apply(fs.writeFile, 'testfile2', 'test2'), - ]); - - - // the same process without using apply - - async.parallel([ - function(callback){ - fs.writeFile('testfile1', 'test1', callback); - }, - function(callback){ - fs.writeFile('testfile2', 'test2', callback); - }, - ]); - -It's possible to pass any number of additional arguments when calling the -continuation: - - node> var fn = async.apply(sys.puts, 'one'); - node> fn('two', 'three'); - one - two - three - ---------------------------------------- - - -### nextTick(callback) - -Calls the callback on a later loop around the event loop. In node.js this just -calls process.nextTick, in the browser it falls back to setTimeout(callback, 0), -which means other higher priority events may precede the execution of the callback. - -This is used internally for browser-compatibility purposes. - -__Arguments__ - -* callback - The function to call on a later loop around the event loop. - -__Example__ - - var call_order = []; - async.nextTick(function(){ - call_order.push('two'); - // call_order now equals ['one','two] - }); - call_order.push('one') - - -## Utils - - -### memoize(fn, [hasher]) - -Caches the results of an async function. When creating a hash to store function -results against, the callback is omitted from the hash and an optional hash -function can be used. - -__Arguments__ - -* fn - the function you to proxy and cache results from. -* hasher - an optional function for generating a custom hash for storing - results, it has all the arguments applied to it apart from the callback, and - must be synchronous. - -__Example__ - - var slow_fn = function (name, callback) { - // do something - callback(null, result); - }; - var fn = async.memoize(slow_fn); - - // fn can now be used as if it were slow_fn - fn('some name', function () { - // callback - }); - - -### unmemoize(fn) - -Undoes a memoized function, reverting it to the original, unmemoized -form. Comes handy in tests. - -__Arguments__ - -* fn - the memoized function - - -### log(function, arguments) - -Logs the result of an async function to the console. Only works in node.js or -in browsers that support console.log and console.error (such as FF and Chrome). -If multiple arguments are returned from the async function, console.log is -called on each argument in order. - -__Arguments__ - -* function - The function you want to eventually apply all arguments to. -* arguments... - Any number of arguments to apply to the function. - -__Example__ - - var hello = function(name, callback){ - setTimeout(function(){ - callback(null, 'hello ' + name); - }, 1000); - }; - - node> async.log(hello, 'world'); - 'hello world' - - ---------------------------------------- - - -### dir(function, arguments) - -Logs the result of an async function to the console using console.dir to -display the properties of the resulting object. Only works in node.js or -in browsers that support console.dir and console.error (such as FF and Chrome). -If multiple arguments are returned from the async function, console.dir is -called on each argument in order. - -__Arguments__ - -* function - The function you want to eventually apply all arguments to. -* arguments... - Any number of arguments to apply to the function. - -__Example__ - - var hello = function(name, callback){ - setTimeout(function(){ - callback(null, {hello: name}); - }, 1000); - }; - - node> async.dir(hello, 'world'); - {hello: 'world'} - - ---------------------------------------- - - -### noConflict() - -Changes the value of async back to its original value, returning a reference to the -async object. diff --git a/node_modules/jsdoc/node_modules/async/index.js b/node_modules/jsdoc/node_modules/async/index.js deleted file mode 100644 index 8e23845..0000000 --- a/node_modules/jsdoc/node_modules/async/index.js +++ /dev/null @@ -1,3 +0,0 @@ -// This file is just added for convenience so this repository can be -// directly checked out into a project's deps folder -module.exports = require('./lib/async'); diff --git a/node_modules/jsdoc/node_modules/async/lib/async.js b/node_modules/jsdoc/node_modules/async/lib/async.js deleted file mode 100644 index 7cc4f5e..0000000 --- a/node_modules/jsdoc/node_modules/async/lib/async.js +++ /dev/null @@ -1,692 +0,0 @@ -/*global setTimeout: false, console: false */ -(function () { - - var async = {}; - - // global on the server, window in the browser - var root = this, - previous_async = root.async; - - if (typeof module !== 'undefined' && module.exports) { - module.exports = async; - } - else { - root.async = async; - } - - async.noConflict = function () { - root.async = previous_async; - return async; - }; - - //// cross-browser compatiblity functions //// - - var _forEach = function (arr, iterator) { - if (arr.forEach) { - return arr.forEach(iterator); - } - for (var i = 0; i < arr.length; i += 1) { - iterator(arr[i], i, arr); - } - }; - - var _map = function (arr, iterator) { - if (arr.map) { - return arr.map(iterator); - } - var results = []; - _forEach(arr, function (x, i, a) { - results.push(iterator(x, i, a)); - }); - return results; - }; - - var _reduce = function (arr, iterator, memo) { - if (arr.reduce) { - return arr.reduce(iterator, memo); - } - _forEach(arr, function (x, i, a) { - memo = iterator(memo, x, i, a); - }); - return memo; - }; - - var _keys = function (obj) { - if (Object.keys) { - return Object.keys(obj); - } - var keys = []; - for (var k in obj) { - if (obj.hasOwnProperty(k)) { - keys.push(k); - } - } - return keys; - }; - - //// exported async module functions //// - - //// nextTick implementation with browser-compatible fallback //// - if (typeof process === 'undefined' || !(process.nextTick)) { - async.nextTick = function (fn) { - setTimeout(fn, 0); - }; - } - else { - async.nextTick = process.nextTick; - } - - async.forEach = function (arr, iterator, callback) { - callback = callback || function () {}; - if (!arr.length) { - return callback(); - } - var completed = 0; - _forEach(arr, function (x) { - iterator(x, function (err) { - if (err) { - callback(err); - callback = function () {}; - } - else { - completed += 1; - if (completed === arr.length) { - callback(null); - } - } - }); - }); - }; - - async.forEachSeries = function (arr, iterator, callback) { - callback = callback || function () {}; - if (!arr.length) { - return callback(); - } - var completed = 0; - var iterate = function () { - iterator(arr[completed], function (err) { - if (err) { - callback(err); - callback = function () {}; - } - else { - completed += 1; - if (completed === arr.length) { - callback(null); - } - else { - iterate(); - } - } - }); - }; - iterate(); - }; - - async.forEachLimit = function (arr, limit, iterator, callback) { - callback = callback || function () {}; - if (!arr.length || limit <= 0) { - return callback(); - } - var completed = 0; - var started = 0; - var running = 0; - - (function replenish () { - if (completed === arr.length) { - return callback(); - } - - while (running < limit && started < arr.length) { - started += 1; - running += 1; - iterator(arr[started - 1], function (err) { - if (err) { - callback(err); - callback = function () {}; - } - else { - completed += 1; - running -= 1; - if (completed === arr.length) { - callback(); - } - else { - replenish(); - } - } - }); - } - })(); - }; - - - var doParallel = function (fn) { - return function () { - var args = Array.prototype.slice.call(arguments); - return fn.apply(null, [async.forEach].concat(args)); - }; - }; - var doSeries = function (fn) { - return function () { - var args = Array.prototype.slice.call(arguments); - return fn.apply(null, [async.forEachSeries].concat(args)); - }; - }; - - - var _asyncMap = function (eachfn, arr, iterator, callback) { - var results = []; - arr = _map(arr, function (x, i) { - return {index: i, value: x}; - }); - eachfn(arr, function (x, callback) { - iterator(x.value, function (err, v) { - results[x.index] = v; - callback(err); - }); - }, function (err) { - callback(err, results); - }); - }; - async.map = doParallel(_asyncMap); - async.mapSeries = doSeries(_asyncMap); - - - // reduce only has a series version, as doing reduce in parallel won't - // work in many situations. - async.reduce = function (arr, memo, iterator, callback) { - async.forEachSeries(arr, function (x, callback) { - iterator(memo, x, function (err, v) { - memo = v; - callback(err); - }); - }, function (err) { - callback(err, memo); - }); - }; - // inject alias - async.inject = async.reduce; - // foldl alias - async.foldl = async.reduce; - - async.reduceRight = function (arr, memo, iterator, callback) { - var reversed = _map(arr, function (x) { - return x; - }).reverse(); - async.reduce(reversed, memo, iterator, callback); - }; - // foldr alias - async.foldr = async.reduceRight; - - var _filter = function (eachfn, arr, iterator, callback) { - var results = []; - arr = _map(arr, function (x, i) { - return {index: i, value: x}; - }); - eachfn(arr, function (x, callback) { - iterator(x.value, function (v) { - if (v) { - results.push(x); - } - callback(); - }); - }, function (err) { - callback(_map(results.sort(function (a, b) { - return a.index - b.index; - }), function (x) { - return x.value; - })); - }); - }; - async.filter = doParallel(_filter); - async.filterSeries = doSeries(_filter); - // select alias - async.select = async.filter; - async.selectSeries = async.filterSeries; - - var _reject = function (eachfn, arr, iterator, callback) { - var results = []; - arr = _map(arr, function (x, i) { - return {index: i, value: x}; - }); - eachfn(arr, function (x, callback) { - iterator(x.value, function (v) { - if (!v) { - results.push(x); - } - callback(); - }); - }, function (err) { - callback(_map(results.sort(function (a, b) { - return a.index - b.index; - }), function (x) { - return x.value; - })); - }); - }; - async.reject = doParallel(_reject); - async.rejectSeries = doSeries(_reject); - - var _detect = function (eachfn, arr, iterator, main_callback) { - eachfn(arr, function (x, callback) { - iterator(x, function (result) { - if (result) { - main_callback(x); - main_callback = function () {}; - } - else { - callback(); - } - }); - }, function (err) { - main_callback(); - }); - }; - async.detect = doParallel(_detect); - async.detectSeries = doSeries(_detect); - - async.some = function (arr, iterator, main_callback) { - async.forEach(arr, function (x, callback) { - iterator(x, function (v) { - if (v) { - main_callback(true); - main_callback = function () {}; - } - callback(); - }); - }, function (err) { - main_callback(false); - }); - }; - // any alias - async.any = async.some; - - async.every = function (arr, iterator, main_callback) { - async.forEach(arr, function (x, callback) { - iterator(x, function (v) { - if (!v) { - main_callback(false); - main_callback = function () {}; - } - callback(); - }); - }, function (err) { - main_callback(true); - }); - }; - // all alias - async.all = async.every; - - async.sortBy = function (arr, iterator, callback) { - async.map(arr, function (x, callback) { - iterator(x, function (err, criteria) { - if (err) { - callback(err); - } - else { - callback(null, {value: x, criteria: criteria}); - } - }); - }, function (err, results) { - if (err) { - return callback(err); - } - else { - var fn = function (left, right) { - var a = left.criteria, b = right.criteria; - return a < b ? -1 : a > b ? 1 : 0; - }; - callback(null, _map(results.sort(fn), function (x) { - return x.value; - })); - } - }); - }; - - async.auto = function (tasks, callback) { - callback = callback || function () {}; - var keys = _keys(tasks); - if (!keys.length) { - return callback(null); - } - - var results = {}; - - var listeners = []; - var addListener = function (fn) { - listeners.unshift(fn); - }; - var removeListener = function (fn) { - for (var i = 0; i < listeners.length; i += 1) { - if (listeners[i] === fn) { - listeners.splice(i, 1); - return; - } - } - }; - var taskComplete = function () { - _forEach(listeners.slice(0), function (fn) { - fn(); - }); - }; - - addListener(function () { - if (_keys(results).length === keys.length) { - callback(null, results); - callback = function () {}; - } - }); - - _forEach(keys, function (k) { - var task = (tasks[k] instanceof Function) ? [tasks[k]]: tasks[k]; - var taskCallback = function (err) { - if (err) { - callback(err); - // stop subsequent errors hitting callback multiple times - callback = function () {}; - } - else { - var args = Array.prototype.slice.call(arguments, 1); - if (args.length <= 1) { - args = args[0]; - } - results[k] = args; - taskComplete(); - } - }; - var requires = task.slice(0, Math.abs(task.length - 1)) || []; - var ready = function () { - return _reduce(requires, function (a, x) { - return (a && results.hasOwnProperty(x)); - }, true) && !results.hasOwnProperty(k); - }; - if (ready()) { - task[task.length - 1](taskCallback, results); - } - else { - var listener = function () { - if (ready()) { - removeListener(listener); - task[task.length - 1](taskCallback, results); - } - }; - addListener(listener); - } - }); - }; - - async.waterfall = function (tasks, callback) { - callback = callback || function () {}; - if (!tasks.length) { - return callback(); - } - var wrapIterator = function (iterator) { - return function (err) { - if (err) { - callback(err); - callback = function () {}; - } - else { - var args = Array.prototype.slice.call(arguments, 1); - var next = iterator.next(); - if (next) { - args.push(wrapIterator(next)); - } - else { - args.push(callback); - } - async.nextTick(function () { - iterator.apply(null, args); - }); - } - }; - }; - wrapIterator(async.iterator(tasks))(); - }; - - async.parallel = function (tasks, callback) { - callback = callback || function () {}; - if (tasks.constructor === Array) { - async.map(tasks, function (fn, callback) { - if (fn) { - fn(function (err) { - var args = Array.prototype.slice.call(arguments, 1); - if (args.length <= 1) { - args = args[0]; - } - callback.call(null, err, args); - }); - } - }, callback); - } - else { - var results = {}; - async.forEach(_keys(tasks), function (k, callback) { - tasks[k](function (err) { - var args = Array.prototype.slice.call(arguments, 1); - if (args.length <= 1) { - args = args[0]; - } - results[k] = args; - callback(err); - }); - }, function (err) { - callback(err, results); - }); - } - }; - - async.series = function (tasks, callback) { - callback = callback || function () {}; - if (tasks.constructor === Array) { - async.mapSeries(tasks, function (fn, callback) { - if (fn) { - fn(function (err) { - var args = Array.prototype.slice.call(arguments, 1); - if (args.length <= 1) { - args = args[0]; - } - callback.call(null, err, args); - }); - } - }, callback); - } - else { - var results = {}; - async.forEachSeries(_keys(tasks), function (k, callback) { - tasks[k](function (err) { - var args = Array.prototype.slice.call(arguments, 1); - if (args.length <= 1) { - args = args[0]; - } - results[k] = args; - callback(err); - }); - }, function (err) { - callback(err, results); - }); - } - }; - - async.iterator = function (tasks) { - var makeCallback = function (index) { - var fn = function () { - if (tasks.length) { - tasks[index].apply(null, arguments); - } - return fn.next(); - }; - fn.next = function () { - return (index < tasks.length - 1) ? makeCallback(index + 1): null; - }; - return fn; - }; - return makeCallback(0); - }; - - async.apply = function (fn) { - var args = Array.prototype.slice.call(arguments, 1); - return function () { - return fn.apply( - null, args.concat(Array.prototype.slice.call(arguments)) - ); - }; - }; - - var _concat = function (eachfn, arr, fn, callback) { - var r = []; - eachfn(arr, function (x, cb) { - fn(x, function (err, y) { - r = r.concat(y || []); - cb(err); - }); - }, function (err) { - callback(err, r); - }); - }; - async.concat = doParallel(_concat); - async.concatSeries = doSeries(_concat); - - async.whilst = function (test, iterator, callback) { - if (test()) { - iterator(function (err) { - if (err) { - return callback(err); - } - async.whilst(test, iterator, callback); - }); - } - else { - callback(); - } - }; - - async.until = function (test, iterator, callback) { - if (!test()) { - iterator(function (err) { - if (err) { - return callback(err); - } - async.until(test, iterator, callback); - }); - } - else { - callback(); - } - }; - - async.queue = function (worker, concurrency) { - var workers = 0; - var q = { - tasks: [], - concurrency: concurrency, - saturated: null, - empty: null, - drain: null, - push: function (data, callback) { - if(data.constructor !== Array) { - data = [data]; - } - _forEach(data, function(task) { - q.tasks.push({ - data: task, - callback: typeof callback === 'function' ? callback : null - }); - if (q.saturated && q.tasks.length == concurrency) { - q.saturated(); - } - async.nextTick(q.process); - }); - }, - process: function () { - if (workers < q.concurrency && q.tasks.length) { - var task = q.tasks.shift(); - if(q.empty && q.tasks.length == 0) q.empty(); - workers += 1; - worker(task.data, function () { - workers -= 1; - if (task.callback) { - task.callback.apply(task, arguments); - } - if(q.drain && q.tasks.length + workers == 0) q.drain(); - q.process(); - }); - } - }, - length: function () { - return q.tasks.length; - }, - running: function () { - return workers; - } - }; - return q; - }; - - var _console_fn = function (name) { - return function (fn) { - var args = Array.prototype.slice.call(arguments, 1); - fn.apply(null, args.concat([function (err) { - var args = Array.prototype.slice.call(arguments, 1); - if (typeof console !== 'undefined') { - if (err) { - if (console.error) { - console.error(err); - } - } - else if (console[name]) { - _forEach(args, function (x) { - console[name](x); - }); - } - } - }])); - }; - }; - async.log = _console_fn('log'); - async.dir = _console_fn('dir'); - /*async.info = _console_fn('info'); - async.warn = _console_fn('warn'); - async.error = _console_fn('error');*/ - - async.memoize = function (fn, hasher) { - var memo = {}; - var queues = {}; - hasher = hasher || function (x) { - return x; - }; - var memoized = function () { - var args = Array.prototype.slice.call(arguments); - var callback = args.pop(); - var key = hasher.apply(null, args); - if (key in memo) { - callback.apply(null, memo[key]); - } - else if (key in queues) { - queues[key].push(callback); - } - else { - queues[key] = [callback]; - fn.apply(null, args.concat([function () { - memo[key] = arguments; - var q = queues[key]; - delete queues[key]; - for (var i = 0, l = q.length; i < l; i++) { - q[i].apply(null, arguments); - } - }])); - } - }; - memoized.unmemoized = fn; - return memoized; - }; - - async.unmemoize = function (fn) { - return function () { - return (fn.unmemoized || fn).apply(null, arguments); - }; - }; - -}()); diff --git a/node_modules/jsdoc/node_modules/async/package.json b/node_modules/jsdoc/node_modules/async/package.json deleted file mode 100644 index 3fa84cf..0000000 --- a/node_modules/jsdoc/node_modules/async/package.json +++ /dev/null @@ -1,33 +0,0 @@ -{ - "name": "async", - "description": "Higher-order functions and common patterns for asynchronous code", - "main": "./index", - "author": { - "name": "Caolan McMahon" - }, - "version": "0.1.22", - "repository": { - "type": "git", - "url": "http://github.com/caolan/async.git" - }, - "bugs": { - "url": "http://github.com/caolan/async/issues" - }, - "licenses": [ - { - "type": "MIT", - "url": "http://github.com/caolan/async/raw/master/LICENSE" - } - ], - "devDependencies": { - "nodeunit": ">0.0.0", - "uglify-js": "1.2.x", - "nodelint": ">0.0.0" - }, - "readme": "# Async.js\n\nAsync is a utility module which provides straight-forward, powerful functions\nfor working with asynchronous JavaScript. Although originally designed for\nuse with [node.js](http://nodejs.org), it can also be used directly in the\nbrowser.\n\nAsync provides around 20 functions that include the usual 'functional'\nsuspects (map, reduce, filter, forEach…) as well as some common patterns\nfor asynchronous control flow (parallel, series, waterfall…). All these\nfunctions assume you follow the node.js convention of providing a single\ncallback as the last argument of your async function.\n\n\n## Quick Examples\n\n async.map(['file1','file2','file3'], fs.stat, function(err, results){\n // results is now an array of stats for each file\n });\n\n async.filter(['file1','file2','file3'], path.exists, function(results){\n // results now equals an array of the existing files\n });\n\n async.parallel([\n function(){ ... },\n function(){ ... }\n ], callback);\n\n async.series([\n function(){ ... },\n function(){ ... }\n ]);\n\nThere are many more functions available so take a look at the docs below for a\nfull list. This module aims to be comprehensive, so if you feel anything is\nmissing please create a GitHub issue for it.\n\n\n## Download\n\nReleases are available for download from\n[GitHub](http://github.com/caolan/async/downloads).\nAlternatively, you can install using Node Package Manager (npm):\n\n npm install async\n\n\n__Development:__ [async.js](https://github.com/caolan/async/raw/master/lib/async.js) - 17.5kb Uncompressed\n\n__Production:__ [async.min.js](https://github.com/caolan/async/raw/master/dist/async.min.js) - 1.7kb Packed and Gzipped\n\n\n## In the Browser\n\nSo far its been tested in IE6, IE7, IE8, FF3.6 and Chrome 5. Usage:\n\n \n \n\n\n## Documentation\n\n### Collections\n\n* [forEach](#forEach)\n* [map](#map)\n* [filter](#filter)\n* [reject](#reject)\n* [reduce](#reduce)\n* [detect](#detect)\n* [sortBy](#sortBy)\n* [some](#some)\n* [every](#every)\n* [concat](#concat)\n\n### Control Flow\n\n* [series](#series)\n* [parallel](#parallel)\n* [whilst](#whilst)\n* [until](#until)\n* [waterfall](#waterfall)\n* [queue](#queue)\n* [auto](#auto)\n* [iterator](#iterator)\n* [apply](#apply)\n* [nextTick](#nextTick)\n\n### Utils\n\n* [memoize](#memoize)\n* [unmemoize](#unmemoize)\n* [log](#log)\n* [dir](#dir)\n* [noConflict](#noConflict)\n\n\n## Collections\n\n\n### forEach(arr, iterator, callback)\n\nApplies an iterator function to each item in an array, in parallel.\nThe iterator is called with an item from the list and a callback for when it\nhas finished. If the iterator passes an error to this callback, the main\ncallback for the forEach function is immediately called with the error.\n\nNote, that since this function applies the iterator to each item in parallel\nthere is no guarantee that the iterator functions will complete in order.\n\n__Arguments__\n\n* arr - An array to iterate over.\n* iterator(item, callback) - A function to apply to each item in the array.\n The iterator is passed a callback which must be called once it has completed.\n* callback(err) - A callback which is called after all the iterator functions\n have finished, or an error has occurred.\n\n__Example__\n\n // assuming openFiles is an array of file names and saveFile is a function\n // to save the modified contents of that file:\n\n async.forEach(openFiles, saveFile, function(err){\n // if any of the saves produced an error, err would equal that error\n });\n\n---------------------------------------\n\n\n### forEachSeries(arr, iterator, callback)\n\nThe same as forEach only the iterator is applied to each item in the array in\nseries. The next iterator is only called once the current one has completed\nprocessing. This means the iterator functions will complete in order.\n\n\n---------------------------------------\n\n\n### forEachLimit(arr, limit, iterator, callback)\n\nThe same as forEach only the iterator is applied to batches of items in the\narray, in series. The next batch of iterators is only called once the current\none has completed processing.\n\n__Arguments__\n\n* arr - An array to iterate over.\n* limit - How many items should be in each batch.\n* iterator(item, callback) - A function to apply to each item in the array.\n The iterator is passed a callback which must be called once it has completed.\n* callback(err) - A callback which is called after all the iterator functions\n have finished, or an error has occurred.\n\n__Example__\n\n // Assume documents is an array of JSON objects and requestApi is a\n // function that interacts with a rate-limited REST api.\n\n async.forEachLimit(documents, 20, requestApi, function(err){\n // if any of the saves produced an error, err would equal that error\n });\n---------------------------------------\n\n\n### map(arr, iterator, callback)\n\nProduces a new array of values by mapping each value in the given array through\nthe iterator function. The iterator is called with an item from the array and a\ncallback for when it has finished processing. The callback takes 2 arguments, \nan error and the transformed item from the array. If the iterator passes an\nerror to this callback, the main callback for the map function is immediately\ncalled with the error.\n\nNote, that since this function applies the iterator to each item in parallel\nthere is no guarantee that the iterator functions will complete in order, however\nthe results array will be in the same order as the original array.\n\n__Arguments__\n\n* arr - An array to iterate over.\n* iterator(item, callback) - A function to apply to each item in the array.\n The iterator is passed a callback which must be called once it has completed\n with an error (which can be null) and a transformed item.\n* callback(err, results) - A callback which is called after all the iterator\n functions have finished, or an error has occurred. Results is an array of the\n transformed items from the original array.\n\n__Example__\n\n async.map(['file1','file2','file3'], fs.stat, function(err, results){\n // results is now an array of stats for each file\n });\n\n---------------------------------------\n\n\n### mapSeries(arr, iterator, callback)\n\nThe same as map only the iterator is applied to each item in the array in\nseries. The next iterator is only called once the current one has completed\nprocessing. The results array will be in the same order as the original.\n\n\n---------------------------------------\n\n\n### filter(arr, iterator, callback)\n\n__Alias:__ select\n\nReturns a new array of all the values which pass an async truth test.\n_The callback for each iterator call only accepts a single argument of true or\nfalse, it does not accept an error argument first!_ This is in-line with the\nway node libraries work with truth tests like path.exists. This operation is\nperformed in parallel, but the results array will be in the same order as the\noriginal.\n\n__Arguments__\n\n* arr - An array to iterate over.\n* iterator(item, callback) - A truth test to apply to each item in the array.\n The iterator is passed a callback which must be called once it has completed.\n* callback(results) - A callback which is called after all the iterator\n functions have finished.\n\n__Example__\n\n async.filter(['file1','file2','file3'], path.exists, function(results){\n // results now equals an array of the existing files\n });\n\n---------------------------------------\n\n\n### filterSeries(arr, iterator, callback)\n\n__alias:__ selectSeries\n\nThe same as filter only the iterator is applied to each item in the array in\nseries. The next iterator is only called once the current one has completed\nprocessing. The results array will be in the same order as the original.\n\n---------------------------------------\n\n\n### reject(arr, iterator, callback)\n\nThe opposite of filter. Removes values that pass an async truth test.\n\n---------------------------------------\n\n\n### rejectSeries(arr, iterator, callback)\n\nThe same as filter, only the iterator is applied to each item in the array\nin series.\n\n\n---------------------------------------\n\n\n### reduce(arr, memo, iterator, callback)\n\n__aliases:__ inject, foldl\n\nReduces a list of values into a single value using an async iterator to return\neach successive step. Memo is the initial state of the reduction. This\nfunction only operates in series. For performance reasons, it may make sense to\nsplit a call to this function into a parallel map, then use the normal\nArray.prototype.reduce on the results. This function is for situations where\neach step in the reduction needs to be async, if you can get the data before\nreducing it then its probably a good idea to do so.\n\n__Arguments__\n\n* arr - An array to iterate over.\n* memo - The initial state of the reduction.\n* iterator(memo, item, callback) - A function applied to each item in the\n array to produce the next step in the reduction. The iterator is passed a\n callback which accepts an optional error as its first argument, and the state\n of the reduction as the second. If an error is passed to the callback, the\n reduction is stopped and the main callback is immediately called with the\n error.\n* callback(err, result) - A callback which is called after all the iterator\n functions have finished. Result is the reduced value.\n\n__Example__\n\n async.reduce([1,2,3], 0, function(memo, item, callback){\n // pointless async:\n process.nextTick(function(){\n callback(null, memo + item)\n });\n }, function(err, result){\n // result is now equal to the last value of memo, which is 6\n });\n\n---------------------------------------\n\n\n### reduceRight(arr, memo, iterator, callback)\n\n__Alias:__ foldr\n\nSame as reduce, only operates on the items in the array in reverse order.\n\n\n---------------------------------------\n\n\n### detect(arr, iterator, callback)\n\nReturns the first value in a list that passes an async truth test. The\niterator is applied in parallel, meaning the first iterator to return true will\nfire the detect callback with that result. That means the result might not be\nthe first item in the original array (in terms of order) that passes the test.\n\nIf order within the original array is important then look at detectSeries.\n\n__Arguments__\n\n* arr - An array to iterate over.\n* iterator(item, callback) - A truth test to apply to each item in the array.\n The iterator is passed a callback which must be called once it has completed.\n* callback(result) - A callback which is called as soon as any iterator returns\n true, or after all the iterator functions have finished. Result will be\n the first item in the array that passes the truth test (iterator) or the\n value undefined if none passed.\n\n__Example__\n\n async.detect(['file1','file2','file3'], path.exists, function(result){\n // result now equals the first file in the list that exists\n });\n\n---------------------------------------\n\n\n### detectSeries(arr, iterator, callback)\n\nThe same as detect, only the iterator is applied to each item in the array\nin series. This means the result is always the first in the original array (in\nterms of array order) that passes the truth test.\n\n\n---------------------------------------\n\n\n### sortBy(arr, iterator, callback)\n\nSorts a list by the results of running each value through an async iterator.\n\n__Arguments__\n\n* arr - An array to iterate over.\n* iterator(item, callback) - A function to apply to each item in the array.\n The iterator is passed a callback which must be called once it has completed\n with an error (which can be null) and a value to use as the sort criteria.\n* callback(err, results) - A callback which is called after all the iterator\n functions have finished, or an error has occurred. Results is the items from\n the original array sorted by the values returned by the iterator calls.\n\n__Example__\n\n async.sortBy(['file1','file2','file3'], function(file, callback){\n fs.stat(file, function(err, stats){\n callback(err, stats.mtime);\n });\n }, function(err, results){\n // results is now the original array of files sorted by\n // modified date\n });\n\n\n---------------------------------------\n\n\n### some(arr, iterator, callback)\n\n__Alias:__ any\n\nReturns true if at least one element in the array satisfies an async test.\n_The callback for each iterator call only accepts a single argument of true or\nfalse, it does not accept an error argument first!_ This is in-line with the\nway node libraries work with truth tests like path.exists. Once any iterator\ncall returns true, the main callback is immediately called.\n\n__Arguments__\n\n* arr - An array to iterate over.\n* iterator(item, callback) - A truth test to apply to each item in the array.\n The iterator is passed a callback which must be called once it has completed.\n* callback(result) - A callback which is called as soon as any iterator returns\n true, or after all the iterator functions have finished. Result will be\n either true or false depending on the values of the async tests.\n\n__Example__\n\n async.some(['file1','file2','file3'], path.exists, function(result){\n // if result is true then at least one of the files exists\n });\n\n---------------------------------------\n\n\n### every(arr, iterator, callback)\n\n__Alias:__ all\n\nReturns true if every element in the array satisfies an async test.\n_The callback for each iterator call only accepts a single argument of true or\nfalse, it does not accept an error argument first!_ This is in-line with the\nway node libraries work with truth tests like path.exists.\n\n__Arguments__\n\n* arr - An array to iterate over.\n* iterator(item, callback) - A truth test to apply to each item in the array.\n The iterator is passed a callback which must be called once it has completed.\n* callback(result) - A callback which is called after all the iterator\n functions have finished. Result will be either true or false depending on\n the values of the async tests.\n\n__Example__\n\n async.every(['file1','file2','file3'], path.exists, function(result){\n // if result is true then every file exists\n });\n\n---------------------------------------\n\n\n### concat(arr, iterator, callback)\n\nApplies an iterator to each item in a list, concatenating the results. Returns the\nconcatenated list. The iterators are called in parallel, and the results are\nconcatenated as they return. There is no guarantee that the results array will\nbe returned in the original order of the arguments passed to the iterator function.\n\n__Arguments__\n\n* arr - An array to iterate over\n* iterator(item, callback) - A function to apply to each item in the array.\n The iterator is passed a callback which must be called once it has completed\n with an error (which can be null) and an array of results.\n* callback(err, results) - A callback which is called after all the iterator\n functions have finished, or an error has occurred. Results is an array containing\n the concatenated results of the iterator function.\n\n__Example__\n\n async.concat(['dir1','dir2','dir3'], fs.readdir, function(err, files){\n // files is now a list of filenames that exist in the 3 directories\n });\n\n---------------------------------------\n\n\n### concatSeries(arr, iterator, callback)\n\nSame as async.concat, but executes in series instead of parallel.\n\n\n## Control Flow\n\n\n### series(tasks, [callback])\n\nRun an array of functions in series, each one running once the previous\nfunction has completed. If any functions in the series pass an error to its\ncallback, no more functions are run and the callback for the series is\nimmediately called with the value of the error. Once the tasks have completed,\nthe results are passed to the final callback as an array.\n\nIt is also possible to use an object instead of an array. Each property will be\nrun as a function and the results will be passed to the final callback as an object\ninstead of an array. This can be a more readable way of handling results from\nasync.series.\n\n\n__Arguments__\n\n* tasks - An array or object containing functions to run, each function is passed\n a callback it must call on completion.\n* callback(err, results) - An optional callback to run once all the functions\n have completed. This function gets an array of all the arguments passed to\n the callbacks used in the array.\n\n__Example__\n\n async.series([\n function(callback){\n // do some stuff ...\n callback(null, 'one');\n },\n function(callback){\n // do some more stuff ...\n callback(null, 'two');\n },\n ],\n // optional callback\n function(err, results){\n // results is now equal to ['one', 'two']\n });\n\n\n // an example using an object instead of an array\n async.series({\n one: function(callback){\n setTimeout(function(){\n callback(null, 1);\n }, 200);\n },\n two: function(callback){\n setTimeout(function(){\n callback(null, 2);\n }, 100);\n },\n },\n function(err, results) {\n // results is now equal to: {one: 1, two: 2}\n });\n\n\n---------------------------------------\n\n\n### parallel(tasks, [callback])\n\nRun an array of functions in parallel, without waiting until the previous\nfunction has completed. If any of the functions pass an error to its\ncallback, the main callback is immediately called with the value of the error.\nOnce the tasks have completed, the results are passed to the final callback as an\narray.\n\nIt is also possible to use an object instead of an array. Each property will be\nrun as a function and the results will be passed to the final callback as an object\ninstead of an array. This can be a more readable way of handling results from\nasync.parallel.\n\n\n__Arguments__\n\n* tasks - An array or object containing functions to run, each function is passed a\n callback it must call on completion.\n* callback(err, results) - An optional callback to run once all the functions\n have completed. This function gets an array of all the arguments passed to\n the callbacks used in the array.\n\n__Example__\n\n async.parallel([\n function(callback){\n setTimeout(function(){\n callback(null, 'one');\n }, 200);\n },\n function(callback){\n setTimeout(function(){\n callback(null, 'two');\n }, 100);\n },\n ],\n // optional callback\n function(err, results){\n // the results array will equal ['one','two'] even though\n // the second function had a shorter timeout.\n });\n\n\n // an example using an object instead of an array\n async.parallel({\n one: function(callback){\n setTimeout(function(){\n callback(null, 1);\n }, 200);\n },\n two: function(callback){\n setTimeout(function(){\n callback(null, 2);\n }, 100);\n },\n },\n function(err, results) {\n // results is now equals to: {one: 1, two: 2}\n });\n\n\n---------------------------------------\n\n\n### whilst(test, fn, callback)\n\nRepeatedly call fn, while test returns true. Calls the callback when stopped,\nor an error occurs.\n\n__Arguments__\n\n* test() - synchronous truth test to perform before each execution of fn.\n* fn(callback) - A function to call each time the test passes. The function is\n passed a callback which must be called once it has completed with an optional\n error as the first argument.\n* callback(err) - A callback which is called after the test fails and repeated\n execution of fn has stopped.\n\n__Example__\n\n var count = 0;\n\n async.whilst(\n function () { return count < 5; },\n function (callback) {\n count++;\n setTimeout(callback, 1000);\n },\n function (err) {\n // 5 seconds have passed\n }\n );\n\n\n---------------------------------------\n\n\n### until(test, fn, callback)\n\nRepeatedly call fn, until test returns true. Calls the callback when stopped,\nor an error occurs.\n\nThe inverse of async.whilst.\n\n\n---------------------------------------\n\n\n### waterfall(tasks, [callback])\n\nRuns an array of functions in series, each passing their results to the next in\nthe array. However, if any of the functions pass an error to the callback, the\nnext function is not executed and the main callback is immediately called with\nthe error.\n\n__Arguments__\n\n* tasks - An array of functions to run, each function is passed a callback it\n must call on completion.\n* callback(err, [results]) - An optional callback to run once all the functions\n have completed. This will be passed the results of the last task's callback.\n\n\n\n__Example__\n\n async.waterfall([\n function(callback){\n callback(null, 'one', 'two');\n },\n function(arg1, arg2, callback){\n callback(null, 'three');\n },\n function(arg1, callback){\n // arg1 now equals 'three'\n callback(null, 'done');\n }\n ], function (err, result) {\n // result now equals 'done' \n });\n\n\n---------------------------------------\n\n\n### queue(worker, concurrency)\n\nCreates a queue object with the specified concurrency. Tasks added to the\nqueue will be processed in parallel (up to the concurrency limit). If all\nworkers are in progress, the task is queued until one is available. Once\na worker has completed a task, the task's callback is called.\n\n__Arguments__\n\n* worker(task, callback) - An asynchronous function for processing a queued\n task.\n* concurrency - An integer for determining how many worker functions should be\n run in parallel.\n\n__Queue objects__\n\nThe queue object returned by this function has the following properties and\nmethods:\n\n* length() - a function returning the number of items waiting to be processed.\n* concurrency - an integer for determining how many worker functions should be\n run in parallel. This property can be changed after a queue is created to\n alter the concurrency on-the-fly.\n* push(task, [callback]) - add a new task to the queue, the callback is called\n once the worker has finished processing the task.\n instead of a single task, an array of tasks can be submitted. the respective callback is used for every task in the list.\n* saturated - a callback that is called when the queue length hits the concurrency and further tasks will be queued\n* empty - a callback that is called when the last item from the queue is given to a worker\n* drain - a callback that is called when the last item from the queue has returned from the worker\n\n__Example__\n\n // create a queue object with concurrency 2\n\n var q = async.queue(function (task, callback) {\n console.log('hello ' + task.name);\n callback();\n }, 2);\n\n\n // assign a callback\n q.drain = function() {\n console.log('all items have been processed');\n }\n\n // add some items to the queue\n\n q.push({name: 'foo'}, function (err) {\n console.log('finished processing foo');\n });\n q.push({name: 'bar'}, function (err) {\n console.log('finished processing bar');\n });\n\n // add some items to the queue (batch-wise)\n\n q.push([{name: 'baz'},{name: 'bay'},{name: 'bax'}], function (err) {\n console.log('finished processing bar');\n });\n\n\n---------------------------------------\n\n\n### auto(tasks, [callback])\n\nDetermines the best order for running functions based on their requirements.\nEach function can optionally depend on other functions being completed first,\nand each function is run as soon as its requirements are satisfied. If any of\nthe functions pass an error to their callback, that function will not complete\n(so any other functions depending on it will not run) and the main callback\nwill be called immediately with the error. Functions also receive an object\ncontaining the results of functions which have completed so far.\n\n__Arguments__\n\n* tasks - An object literal containing named functions or an array of\n requirements, with the function itself the last item in the array. The key\n used for each function or array is used when specifying requirements. The\n syntax is easier to understand by looking at the example.\n* callback(err, results) - An optional callback which is called when all the\n tasks have been completed. The callback will receive an error as an argument\n if any tasks pass an error to their callback. If all tasks complete\n successfully, it will receive an object containing their results.\n\n__Example__\n\n async.auto({\n get_data: function(callback){\n // async code to get some data\n },\n make_folder: function(callback){\n // async code to create a directory to store a file in\n // this is run at the same time as getting the data\n },\n write_file: ['get_data', 'make_folder', function(callback){\n // once there is some data and the directory exists,\n // write the data to a file in the directory\n callback(null, filename);\n }],\n email_link: ['write_file', function(callback, results){\n // once the file is written let's email a link to it...\n // results.write_file contains the filename returned by write_file.\n }]\n });\n\nThis is a fairly trivial example, but to do this using the basic parallel and\nseries functions would look like this:\n\n async.parallel([\n function(callback){\n // async code to get some data\n },\n function(callback){\n // async code to create a directory to store a file in\n // this is run at the same time as getting the data\n }\n ],\n function(results){\n async.series([\n function(callback){\n // once there is some data and the directory exists,\n // write the data to a file in the directory\n },\n email_link: function(callback){\n // once the file is written let's email a link to it...\n }\n ]);\n });\n\nFor a complicated series of async tasks using the auto function makes adding\nnew tasks much easier and makes the code more readable.\n\n\n---------------------------------------\n\n\n### iterator(tasks)\n\nCreates an iterator function which calls the next function in the array,\nreturning a continuation to call the next one after that. Its also possible to\n'peek' the next iterator by doing iterator.next().\n\nThis function is used internally by the async module but can be useful when\nyou want to manually control the flow of functions in series.\n\n__Arguments__\n\n* tasks - An array of functions to run, each function is passed a callback it\n must call on completion.\n\n__Example__\n\n var iterator = async.iterator([\n function(){ sys.p('one'); },\n function(){ sys.p('two'); },\n function(){ sys.p('three'); }\n ]);\n\n node> var iterator2 = iterator();\n 'one'\n node> var iterator3 = iterator2();\n 'two'\n node> iterator3();\n 'three'\n node> var nextfn = iterator2.next();\n node> nextfn();\n 'three'\n\n\n---------------------------------------\n\n\n### apply(function, arguments..)\n\nCreates a continuation function with some arguments already applied, a useful\nshorthand when combined with other control flow functions. Any arguments\npassed to the returned function are added to the arguments originally passed\nto apply.\n\n__Arguments__\n\n* function - The function you want to eventually apply all arguments to.\n* arguments... - Any number of arguments to automatically apply when the\n continuation is called.\n\n__Example__\n\n // using apply\n\n async.parallel([\n async.apply(fs.writeFile, 'testfile1', 'test1'),\n async.apply(fs.writeFile, 'testfile2', 'test2'),\n ]);\n\n\n // the same process without using apply\n\n async.parallel([\n function(callback){\n fs.writeFile('testfile1', 'test1', callback);\n },\n function(callback){\n fs.writeFile('testfile2', 'test2', callback);\n },\n ]);\n\nIt's possible to pass any number of additional arguments when calling the\ncontinuation:\n\n node> var fn = async.apply(sys.puts, 'one');\n node> fn('two', 'three');\n one\n two\n three\n\n---------------------------------------\n\n\n### nextTick(callback)\n\nCalls the callback on a later loop around the event loop. In node.js this just\ncalls process.nextTick, in the browser it falls back to setTimeout(callback, 0),\nwhich means other higher priority events may precede the execution of the callback.\n\nThis is used internally for browser-compatibility purposes.\n\n__Arguments__\n\n* callback - The function to call on a later loop around the event loop.\n\n__Example__\n\n var call_order = [];\n async.nextTick(function(){\n call_order.push('two');\n // call_order now equals ['one','two]\n });\n call_order.push('one')\n\n\n## Utils\n\n\n### memoize(fn, [hasher])\n\nCaches the results of an async function. When creating a hash to store function\nresults against, the callback is omitted from the hash and an optional hash\nfunction can be used.\n\n__Arguments__\n\n* fn - the function you to proxy and cache results from.\n* hasher - an optional function for generating a custom hash for storing\n results, it has all the arguments applied to it apart from the callback, and\n must be synchronous.\n\n__Example__\n\n var slow_fn = function (name, callback) {\n // do something\n callback(null, result);\n };\n var fn = async.memoize(slow_fn);\n\n // fn can now be used as if it were slow_fn\n fn('some name', function () {\n // callback\n });\n\n\n### unmemoize(fn)\n\nUndoes a memoized function, reverting it to the original, unmemoized\nform. Comes handy in tests.\n\n__Arguments__\n\n* fn - the memoized function\n\n\n### log(function, arguments)\n\nLogs the result of an async function to the console. Only works in node.js or\nin browsers that support console.log and console.error (such as FF and Chrome).\nIf multiple arguments are returned from the async function, console.log is\ncalled on each argument in order.\n\n__Arguments__\n\n* function - The function you want to eventually apply all arguments to.\n* arguments... - Any number of arguments to apply to the function.\n\n__Example__\n\n var hello = function(name, callback){\n setTimeout(function(){\n callback(null, 'hello ' + name);\n }, 1000);\n };\n\n node> async.log(hello, 'world');\n 'hello world'\n\n\n---------------------------------------\n\n\n### dir(function, arguments)\n\nLogs the result of an async function to the console using console.dir to\ndisplay the properties of the resulting object. Only works in node.js or\nin browsers that support console.dir and console.error (such as FF and Chrome).\nIf multiple arguments are returned from the async function, console.dir is\ncalled on each argument in order.\n\n__Arguments__\n\n* function - The function you want to eventually apply all arguments to.\n* arguments... - Any number of arguments to apply to the function.\n\n__Example__\n\n var hello = function(name, callback){\n setTimeout(function(){\n callback(null, {hello: name});\n }, 1000);\n };\n\n node> async.dir(hello, 'world');\n {hello: 'world'}\n\n\n---------------------------------------\n\n\n### noConflict()\n\nChanges the value of async back to its original value, returning a reference to the\nasync object.\n", - "readmeFilename": "README.md", - "homepage": "https://github.com/caolan/async", - "_id": "async@0.1.22", - "_from": "async@~0.1.22", - "scripts": {} -} diff --git a/node_modules/jsdoc/node_modules/catharsis/README.md b/node_modules/jsdoc/node_modules/catharsis/README.md index ecd4945..a2bb3d8 100644 --- a/node_modules/jsdoc/node_modules/catharsis/README.md +++ b/node_modules/jsdoc/node_modules/catharsis/README.md @@ -226,6 +226,11 @@ pull request, please contact me in advance so I can help things go smoothly. ## Changelog ## ++ 0.8.6 (December 2014): Improved the description of the unknown type. ++ 0.8.5 (December 2014): Added support for postfix nullable/non-nullable operators combined with the +optional operator (for example, `foo?=`). ++ 0.8.4 (December 2014): JSDoc-style nested arrays (for example, `number[][]`) are now parsed +correctly when JSDoc-style type expressions are enabled. + 0.8.3 (October 2014): + Type applications are no longer required to include a period (`.`) as a separator, regardless of whether JSDoc-style type expressions are enabled. diff --git a/node_modules/jsdoc/node_modules/catharsis/lib/parser.js b/node_modules/jsdoc/node_modules/catharsis/lib/parser.js index dab624b..3c11c9d 100644 --- a/node_modules/jsdoc/node_modules/catharsis/lib/parser.js +++ b/node_modules/jsdoc/node_modules/catharsis/lib/parser.js @@ -1,4 +1,6004 @@ -module.exports=function(){function peg$subclass(child,parent){function ctor(){this.constructor=child}ctor.prototype=parent.prototype;child.prototype=new ctor}function SyntaxError(expected,found,offset,line,column){function buildMessage(expected,found){function stringEscape(s){function hex(ch){return ch.charCodeAt(0).toString(16).toUpperCase()}return s.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\x08/g,"\\b").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\f/g,"\\f").replace(/\r/g,"\\r").replace(/[\x00-\x07\x0B\x0E\x0F]/g,function(ch){return"\\x0"+hex(ch)}).replace(/[\x10-\x1F\x80-\xFF]/g,function(ch){return"\\x"+hex(ch)}).replace(/[\u0180-\u0FFF]/g,function(ch){return"\\u0"+hex(ch)}).replace(/[\u1080-\uFFFF]/g,function(ch){return"\\u"+hex(ch)})}var expectedDesc,foundDesc;switch(expected.length){case 0:expectedDesc="end of input";break;case 1:expectedDesc=expected[0];break;default:expectedDesc=expected.slice(0,-1).join(", ")+" or "+expected[expected.length-1]}foundDesc=found?'"'+stringEscape(found)+'"':"end of input";return"Expected "+expectedDesc+" but "+foundDesc+" found."}this.expected=expected;this.found=found;this.offset=offset;this.line=line;this.column=column;this.name="SyntaxError";this.message=buildMessage(expected,found)}peg$subclass(SyntaxError,Error);function parse(input){var options=arguments.length>1?arguments[1]:{},peg$startRuleFunctions={TypeExpression:peg$parseTypeExpression},peg$startRuleFunction=peg$parseTypeExpression,peg$c0=null,peg$c1="",peg$c2=function(r,unk){var result=unk;if(r.repeatable){result=repeatable(result)}return result},peg$c3="?",peg$c4='"?"',peg$c5="!",peg$c6='"!"',peg$c7=function(r,prefix,expr){var result=expr;if(r.repeatable){result=repeatable(result)}return nullable(result,prefix)},peg$c8=function(expr,postfix){return nullable(expr,postfix)},peg$c9=function(prefix,expr){return nullable(expr,prefix)},peg$c10=function(expr){return repeatable(expr)},peg$c11=function(lit,opt){var result=lit;if(opt.optional){result.optional=true}return result},peg$c12=function(lit){return repeatable(lit)},peg$c13="*",peg$c14='"*"',peg$c15=function(){return{type:Types.AllLiteral}},peg$c16=function(){return{type:Types.NullLiteral}},peg$c17=function(){return{type:Types.UndefinedLiteral}},peg$c18="...",peg$c19='"..."',peg$c20=function(){return{repeatable:true}},peg$c21="=",peg$c22='"="',peg$c23=function(){return{optional:true}},peg$c24="[]",peg$c25='"[]"',peg$c26=function(name){var result;if(!options.jsdoc){return null}result={type:Types.TypeApplication,expression:{type:Types.NameExpression,name:"Array"},applications:[name]};result.applications[0].type=Types.NameExpression;return result},peg$c27=function(exp,appl,opt){var result={};var nameExp={type:Types.NameExpression,name:exp.name};if(appl.length){result.type=Types.TypeApplication;result.expression=nameExp;result.applications=appl}else{result=nameExp}if(opt.optional){result.optional=true}return result},peg$c28=function(name){if(!options.jsdoc){return null}return name},peg$c29=function(t){return repeatable(t)},peg$c30=function(exp,opt){var result={type:Types.NameExpression,name:exp.name,reservedWord:true};if(opt.optional){result.optional=true}return result},peg$c31=".",peg$c32='"."',peg$c33="<",peg$c34='"<"',peg$c35=">",peg$c36='">"',peg$c37=function(sep,l){return l},peg$c38=[],peg$c39=",",peg$c40='","',peg$c41=function(expr,list){var result=[expr];for(var i=0,l=list.length;ipos){peg$cachedPos=0;peg$cachedPosDetails={line:1,column:1,seenCR:false}}peg$cachedPos=pos;advance(peg$cachedPosDetails,peg$cachedPos)}return peg$cachedPosDetails}function peg$fail(expected){if(peg$currPospeg$maxFailPos){peg$maxFailPos=peg$currPos;peg$maxFailExpected=[]}peg$maxFailExpected.push(expected)}function peg$cleanupExpected(expected){var i=0;expected.sort();while(ipeg$currPos){s0=input.charAt(peg$currPos);peg$currPos++}else{s0=null;if(peg$silentFails===0){peg$fail(peg$c281)}}return s0}function peg$parseHexEscapeSequence(){var s0,s1,s2,s3,s4,s5;s0=peg$currPos;if(input.charCodeAt(peg$currPos)===120){s1=peg$c279;peg$currPos++}else{s1=null;if(peg$silentFails===0){peg$fail(peg$c280)}}if(s1!==null){s2=peg$currPos;s3=peg$currPos;s4=peg$parseHexDigit();if(s4!==null){s5=peg$parseHexDigit();if(s5!==null){s4=[s4,s5];s3=s4}else{peg$currPos=s3;s3=peg$c0}}else{peg$currPos=s3;s3=peg$c0}if(s3!==null){s3=input.substring(s2,peg$currPos)}s2=s3;if(s2!==null){peg$reportedPos=s0;s1=peg$c227(s2);if(s1===null){peg$currPos=s0;s0=s1}else{s0=s1}}else{peg$currPos=s0;s0=peg$c0}}else{peg$currPos=s0;s0=peg$c0}return s0}function peg$parseLineContinuation(){var s0,s1,s2;s0=peg$currPos;if(input.charCodeAt(peg$currPos)===92){s1=peg$c223;peg$currPos++}else{s1=null;if(peg$silentFails===0){peg$fail(peg$c224)}}if(s1!==null){s2=peg$parseLineTerminatorSequence();if(s2!==null){peg$reportedPos=s0;s1=peg$c265(s2);if(s1===null){peg$currPos=s0;s0=s1}else{s0=s1}}else{peg$currPos=s0;s0=peg$c0}}else{peg$currPos=s0;s0=peg$c0}return s0}function peg$parse_(){var s0,s1; -peg$silentFails++;s0=[];s1=peg$parseWhitespace();while(s1!==null){s0.push(s1);s1=peg$parseWhitespace()}peg$silentFails--;if(s0===null){s1=null;if(peg$silentFails===0){peg$fail(peg$c282)}}return s0}function peg$parse__(){var s0,s1;peg$silentFails++;s0=peg$c1;peg$silentFails--;if(s0===null){s1=null;if(peg$silentFails===0){peg$fail(peg$c283)}}return s0}function peg$parseWhitespace(){var s0;if(peg$c284.test(input.charAt(peg$currPos))){s0=input.charAt(peg$currPos);peg$currPos++}else{s0=null;if(peg$silentFails===0){peg$fail(peg$c285)}}if(s0===null){s0=peg$parseUnicodeZs()}return s0}var Types=require("./types");function repeatable(obj){obj.repeatable=true;return obj}function nullable(obj,modifier){if(modifier){obj.nullable=modifier==="?"?true:false}return obj}peg$result=peg$startRuleFunction();if(peg$result!==null&&peg$currPos===input.length){return peg$result}else{peg$cleanupExpected(peg$maxFailExpected);peg$reportedPos=Math.max(peg$currPos,peg$maxFailPos);throw new SyntaxError(peg$maxFailExpected,peg$reportedPos 1 ? arguments[1] : {}, + + peg$startRuleFunctions = { TypeExpression: peg$parseTypeExpression }, + peg$startRuleFunction = peg$parseTypeExpression, + + peg$c0 = null, + peg$c1 = "", + peg$c2 = function(r, unk) { + var result = unk; + + if (r.repeatable) { + result = repeatable(result); + } + + return result; + }, + peg$c3 = "?", + peg$c4 = "\"?\"", + peg$c5 = "!", + peg$c6 = "\"!\"", + peg$c7 = function(r, prefix, expr) { + var result = expr; + + if (r.repeatable) { + result = repeatable(result); + } + + return nullable(result, prefix); + }, + peg$c8 = function(expr, optionalPre, postfix, optionalPost) { + var result = expr; + + // we only allow one optional operator + if (optionalPre.optional && optionalPost.optional) { + return null; + } + + // "non-nullable, yet optional" makes no sense, but we allow it + result = nullable(result, postfix); + + if (optionalPre.optional || optionalPost.optional) { + result = optional(result); + } + + return result; + }, + peg$c9 = function(expr, postfix) { + return nullable(expr, postfix); + }, + peg$c10 = function(prefix, expr) { + return nullable(expr, prefix); + }, + peg$c11 = function(expr) { + return repeatable(expr); + }, + peg$c12 = function(lit, opt) { + var result = lit; + + if (opt.optional) { + result.optional = true; + } + + return result; + }, + peg$c13 = function(lit) { + return repeatable(lit); + }, + peg$c14 = "*", + peg$c15 = "\"*\"", + peg$c16 = function() { + return { + type: Types.AllLiteral + }; + }, + peg$c17 = function() { + return { + type: Types.NullLiteral + }; + }, + peg$c18 = function() { + return { + type: Types.UndefinedLiteral + }; + }, + peg$c19 = "...", + peg$c20 = "\"...\"", + peg$c21 = function() { + return { + repeatable: true + }; + }, + peg$c22 = "=", + peg$c23 = "\"=\"", + peg$c24 = function() { + return { + optional: true + }; + }, + peg$c25 = [], + peg$c26 = "[]", + peg$c27 = "\"[]\"", + peg$c28 = function(name, brackets) { + var result; + + function nest(obj) { + return { + type: Types.TypeApplication, + expression: { + type: Types.NameExpression, + name: 'Array' + }, + applications: [obj] + }; + } + + // we only allow this if JSDoc parsing is enabled + if (!options.jsdoc) { + return null; + } + + result = nest(name); + result.applications[0].type = Types.NameExpression; + + for (var i = 0, l = brackets.length - 1; i < l; i++) { + result = nest(result); + } + + return result; + }, + peg$c29 = function(exp, appl, opt) { + var result = {}; + + var nameExp = { + type: Types.NameExpression, + name: exp.name + }; + + if (appl.length) { + result.type = Types.TypeApplication; + result.expression = nameExp; + result.applications = appl; + } else { + result = nameExp; + } + + if (opt.optional) { + result.optional = true; + } + + return result; + }, + peg$c30 = function(name) { + // we only allow this if JSDoc parsing is enabled + if (!options.jsdoc) { + return null; + } + + return name; + }, + peg$c31 = function(t) { + return repeatable(t); + }, + peg$c32 = function(exp, opt) { + var result = { + type: Types.NameExpression, + name: exp.name, + reservedWord: true + }; + + if (opt.optional) { + result.optional = true; + } + + return result; + }, + peg$c33 = ".", + peg$c34 = "\".\"", + peg$c35 = "<", + peg$c36 = "\"<\"", + peg$c37 = ">", + peg$c38 = "\">\"", + peg$c39 = function(sep, l) { + return l; + }, + peg$c40 = ",", + peg$c41 = "\",\"", + peg$c42 = function(expr, list) { + var result = [expr]; + for (var i = 0, l = list.length; i < l; i++) { + result.push(list[i][3]); + } + return result; + }, + peg$c43 = function() { + var result; + + // we only allow this if JSDoc parsing is enabled + if (!options.jsdoc) { + return null; + } + + result = { + type: Types.TypeApplication, + expression: { + type: Types.NameExpression, + name: 'Array' + }, + applications: [ + { + type: Types.FunctionType, + params: [] + } + ] + }; + + return result; + }, + peg$c44 = function(sig, opt) { + // signature is required unless JSDoc parsing is enabled + if (!sig && !options.jsdoc) { + return null; + } else if (typeof sig !== 'object') { + sig = { + params: [] + }; + } + + var result = { + type: Types.FunctionType + }; + + Object.keys(sig).forEach(function(key) { + result[key] = sig[key]; + }); + + if (opt.optional) { + result.optional = true; + } + + return result; + }, + peg$c45 = "(", + peg$c46 = "\"(\"", + peg$c47 = ")", + peg$c48 = "\")\"", + peg$c49 = ":", + peg$c50 = "\":\"", + peg$c51 = function(sig, returns) { + var result = {}; + + result.params = sig.params || []; + if (sig['new']) { + result['new'] = sig['new']; + } + if (sig['this']) { + result['this'] = sig['this'] + } + + if (returns && returns[3]) { + result.result = returns[3]; + } + + return result; + }, + peg$c52 = function(funcNew, funcThis, params) { + var result = { + params: params !== '' ? params[3] : [], + 'new': funcNew + }; + if (funcThis !== '') { + result['this'] = funcThis[3]; + } + + return result; + }, + peg$c53 = function(funcThis, funcNew, params) { + var result = { + params: params !== '' ? params[3] : [], + 'this': funcThis + }; + if (funcNew !== '') { + result['new'] = funcNew[3]; + } + + return result; + }, + peg$c54 = function(params) { + return { + params: params + }; + }, + peg$c55 = "new", + peg$c56 = "\"new\"", + peg$c57 = function(expr) { return expr; }, + peg$c58 = "this", + peg$c59 = "\"this\"", + peg$c60 = function(rp) { + return [rp]; + }, + peg$c61 = function(nrp, rp) { + var result = []; + if (nrp !== '') { + result = nrp; + } + if (rp[3]) { + result.push(rp[3]); + } + return result; + }, + peg$c62 = function(p, list) { + var result = [p]; + for (var i = 0, l = list.length; i < l; i++) { + result.push(list[i][3]); + } + return result; + }, + peg$c63 = function(op, list) { + var result = [op]; + for (var i = 0, l = list.length; i < l; i++) { + result.push(list[i][3]); + } + return result; + }, + peg$c64 = function(paramType) { return paramType; }, + peg$c65 = function(t) { + t.optional = true; + return t; + }, + peg$c66 = "[", + peg$c67 = "\"[\"", + peg$c68 = "]", + peg$c69 = "\"]\"", + peg$c70 = function(t) { + if (!options.jsdoc) { + return null; + } + + return repeatable(t); + }, + peg$c71 = function() { + return repeatable({}); + }, + peg$c72 = function(t, opt) { + var result = { + type: Types.TypeUnion, + elements: t + }; + + if (opt.optional) { + result.optional = true; + } + + return result; + }, + peg$c73 = function(tu) { + return repeatable(tu); + }, + peg$c74 = function(expr, list) { + var result = [expr]; + for (var i = 0, l = list.length; i < l; i++) { + result.push(list[i][1]); + } + return result; + }, + peg$c75 = function(expr, list) { + var result = [expr]; + + for (var i = 0, l = list.length; i < l; i++) { + result.push(list[i][1]); + } + + return result; + }, + peg$c76 = function(list) { + return { + type: Types.TypeUnion, + elements: list + }; + }, + peg$c77 = "|", + peg$c78 = "\"|\"", + peg$c79 = function() { + return ''; + }, + peg$c80 = "{", + peg$c81 = "\"{\"", + peg$c82 = "}", + peg$c83 = "\"}\"", + peg$c84 = function(list, opt) { + var result = { + type: Types.RecordType, + fields: list !== '' ? list : [] + }; + + if (opt.optional) { + result.optional = true; + } + + return result; + }, + peg$c85 = function(type, list) { + var result = [type]; + for (var i = 0, l = list.length; i < l; i++) { + result.push(list[i][3]); + } + return result; + }, + peg$c86 = function(key, expr) { + return { + type: Types.FieldType, + key: key, + value: expr[3] !== '' ? expr[3] : undefined + }; + }, + peg$c87 = function(t) { + if (!options.jsdoc) { + return null; + } + + return t; + }, + peg$c88 = function(lit) { + if (!options.jsdoc) { + return null; + } + + return { + name: '"' + lit.join('') + '"' + }; + }, + peg$c89 = function(lit) { + if (!options.jsdoc) { + return null; + } + + return { + name: "'" + lit.join('') + "'" + }; + }, + peg$c90 = function(id, props) { + return { + name: id + props + }; + }, + peg$c91 = function(rw) { + return { + name: rw + }; + }, + peg$c92 = function(lit) { + return '"' + lit + '"'; + }, + peg$c93 = function(lit) { + return "'" + lit + "'"; + }, + peg$c94 = "#", + peg$c95 = "\"#\"", + peg$c96 = "~", + peg$c97 = "\"~\"", + peg$c98 = "/", + peg$c99 = "\"/\"", + peg$c100 = function(sep, prop) { + // we only allow '.' unless JSDoc parsing is enabled + if (sep !== '.' && !options.jsdoc) { + return null; + } + + return sep + prop; + }, + peg$c101 = function(name) { return name; }, + peg$c102 = "$", + peg$c103 = "\"$\"", + peg$c104 = "_", + peg$c105 = "\"_\"", + peg$c106 = "-", + peg$c107 = "\"-\"", + peg$c108 = "\u200C", + peg$c109 = "\"\\u200C\"", + peg$c110 = "\u200D", + peg$c111 = "\"\\u200D\"", + peg$c112 = function(parts) { + if (!options.jsdoc) { + return null; + } + + parts = parts === '' ? [] : parts; + + return '(' + parts.join(', ') + ')'; + + }, + peg$c113 = function(params) { + if (!options.jsdoc) { + return null; + } + + params = params === '' ? [] : params; + + return '(' + params.join(', ') + ')'; + }, + peg$c114 = "break", + peg$c115 = "\"break\"", + peg$c116 = "case", + peg$c117 = "\"case\"", + peg$c118 = "catch", + peg$c119 = "\"catch\"", + peg$c120 = "continue", + peg$c121 = "\"continue\"", + peg$c122 = "debugger", + peg$c123 = "\"debugger\"", + peg$c124 = "default", + peg$c125 = "\"default\"", + peg$c126 = "delete", + peg$c127 = "\"delete\"", + peg$c128 = "do", + peg$c129 = "\"do\"", + peg$c130 = "else", + peg$c131 = "\"else\"", + peg$c132 = "finally", + peg$c133 = "\"finally\"", + peg$c134 = "for", + peg$c135 = "\"for\"", + peg$c136 = "if", + peg$c137 = "\"if\"", + peg$c138 = "in", + peg$c139 = "\"in\"", + peg$c140 = "instanceof", + peg$c141 = "\"instanceof\"", + peg$c142 = "return", + peg$c143 = "\"return\"", + peg$c144 = "switch", + peg$c145 = "\"switch\"", + peg$c146 = "throw", + peg$c147 = "\"throw\"", + peg$c148 = "try", + peg$c149 = "\"try\"", + peg$c150 = "typeof", + peg$c151 = "\"typeof\"", + peg$c152 = "var", + peg$c153 = "\"var\"", + peg$c154 = "void", + peg$c155 = "\"void\"", + peg$c156 = "while", + peg$c157 = "\"while\"", + peg$c158 = "with", + peg$c159 = "\"with\"", + peg$c160 = function(kw) { + return kw; + }, + peg$c161 = "class", + peg$c162 = "\"class\"", + peg$c163 = "const", + peg$c164 = "\"const\"", + peg$c165 = "enum", + peg$c166 = "\"enum\"", + peg$c167 = "export", + peg$c168 = "\"export\"", + peg$c169 = "extends", + peg$c170 = "\"extends\"", + peg$c171 = "import", + peg$c172 = "\"import\"", + peg$c173 = "super", + peg$c174 = "\"super\"", + peg$c175 = "implements", + peg$c176 = "\"implements\"", + peg$c177 = "interface", + peg$c178 = "\"interface\"", + peg$c179 = "let", + peg$c180 = "\"let\"", + peg$c181 = "package", + peg$c182 = "\"package\"", + peg$c183 = "private", + peg$c184 = "\"private\"", + peg$c185 = "protected", + peg$c186 = "\"protected\"", + peg$c187 = "public", + peg$c188 = "\"public\"", + peg$c189 = "static", + peg$c190 = "\"static\"", + peg$c191 = "yield", + peg$c192 = "\"yield\"", + peg$c193 = function(frw) { + return frw; + }, + peg$c194 = "\"", + peg$c195 = "\"\\\"\"", + peg$c196 = function(str) { + return str; + }, + peg$c197 = "'", + peg$c198 = "\"'\"", + peg$c199 = function(lit, digits, exp) { + return parseFloat(lit + '.' + digits + exp); + }, + peg$c200 = function(digits, exp) { + return parseFloat('.' + digits + exp); + }, + peg$c201 = function(lit, exp) { + return parseFloat(lit + exp); + }, + peg$c202 = "0", + peg$c203 = "\"0\"", + peg$c204 = /^[eE]/, + peg$c205 = "[eE]", + peg$c206 = /^[+\-]/, + peg$c207 = "[+\\-]", + peg$c208 = /^[xX]/, + peg$c209 = "[xX]", + peg$c210 = function(hex) { + return parseInt('0x' + hex, 16); + }, + peg$c211 = "null", + peg$c212 = "\"null\"", + peg$c213 = "undefined", + peg$c214 = "\"undefined\"", + peg$c215 = function() { + return { + type: Types.UnknownLiteral + }; + }, + peg$c216 = "true", + peg$c217 = "\"true\"", + peg$c218 = "false", + peg$c219 = "\"false\"", + peg$c220 = "Function", + peg$c221 = "\"Function\"", + peg$c222 = "function", + peg$c223 = "\"function\"", + peg$c224 = "\\", + peg$c225 = "\"\\\\\"", + peg$c226 = "u", + peg$c227 = "\"u\"", + peg$c228 = function(hex) { + return String.fromCharCode(parseInt('0x' + hex), 16); + }, + peg$c229 = /^[0-9]/, + peg$c230 = "[0-9]", + peg$c231 = /^[1-9]/, + peg$c232 = "[1-9]", + peg$c233 = /^[0-9a-fA-F]/, + peg$c234 = "[0-9a-fA-F]", + peg$c235 = "Unicode combining mark", + peg$c236 = /^[\u0903\u093E\u093F\u0940\u0949\u094A\u094B\u094C\u0982\u0983\u09BE\u09BF\u09C0\u09C7\u09C8\u09CB\u09CC\u09D7\u0A03\u0A3E\u0A3F\u0A40\u0A83\u0ABE\u0ABF\u0AC0\u0AC9\u0ACB\u0ACC\u0B02\u0B03\u0B3E\u0B40\u0B47\u0B48\u0B4B\u0B4C\u0B57\u0BBE\u0BBF\u0BC1\u0BC2\u0BC6\u0BC7\u0BC8\u0BCA\u0BCB\u0BCC\u0BD7\u0C01\u0C02\u0C03\u0C41\u0C42\u0C43\u0C44\u0C82\u0C83\u0CBE\u0CC0\u0CC1\u0CC2\u0CC3\u0CC4\u0CC7\u0CC8\u0CCA\u0CCB\u0CD5\u0CD6\u0D02\u0D03\u0D3E\u0D3F\u0D40\u0D46\u0D47\u0D48\u0D4A\u0D4B\u0D4C\u0D57\u0D82\u0D83\u0DCF\u0DD0\u0DD1\u0DD8\u0DD9\u0DDA\u0DDB\u0DDC\u0DDD\u0DDE\u0DDF\u0DF2\u0DF3\u0F3E\u0F3F\u0F7F\u102B\u102C\u1031\u1038\u103B\u103C\u1056\u1057\u1062\u1063\u1064\u1067\u1068\u1069\u106A\u106B\u106C\u106D\u1083\u1084\u1087\u1088\u1089\u108A\u108B\u108C\u108F\u17B6\u17BE\u17BF\u17C0\u17C1\u17C2\u17C3\u17C4\u17C5\u17C7\u17C8\u1923\u1924\u1925\u1926\u1929\u192A\u192B\u1930\u1931\u1933\u1934\u1935\u1936\u1937\u1938\u19B0\u19B1\u19B2\u19B3\u19B4\u19B5\u19B6\u19B7\u19B8\u19B9\u19BA\u19BB\u19BC\u19BD\u19BE\u19BF\u19C0\u19C8\u19C9\u1A19\u1A1A\u1A1B\u1B04\u1B35\u1B3B\u1B3D\u1B3E\u1B3F\u1B40\u1B41\u1B43\u1B44\u1B82\u1BA1\u1BA6\u1BA7\u1BAA\u1C24\u1C25\u1C26\u1C27\u1C28\u1C29\u1C2A\u1C2B\u1C34\u1C35\uA823\uA824\uA827\uA880\uA881\uA8B4\uA8B5\uA8B6\uA8B7\uA8B8\uA8B9\uA8BA\uA8BB\uA8BC\uA8BD\uA8BE\uA8BF\uA8C0\uA8C1\uA8C2\uA8C3\uA952\uA953\uAA2F\uAA30\uAA33\uAA34\uAA4D]/, + peg$c237 = "[\\u0903\\u093E\\u093F\\u0940\\u0949\\u094A\\u094B\\u094C\\u0982\\u0983\\u09BE\\u09BF\\u09C0\\u09C7\\u09C8\\u09CB\\u09CC\\u09D7\\u0A03\\u0A3E\\u0A3F\\u0A40\\u0A83\\u0ABE\\u0ABF\\u0AC0\\u0AC9\\u0ACB\\u0ACC\\u0B02\\u0B03\\u0B3E\\u0B40\\u0B47\\u0B48\\u0B4B\\u0B4C\\u0B57\\u0BBE\\u0BBF\\u0BC1\\u0BC2\\u0BC6\\u0BC7\\u0BC8\\u0BCA\\u0BCB\\u0BCC\\u0BD7\\u0C01\\u0C02\\u0C03\\u0C41\\u0C42\\u0C43\\u0C44\\u0C82\\u0C83\\u0CBE\\u0CC0\\u0CC1\\u0CC2\\u0CC3\\u0CC4\\u0CC7\\u0CC8\\u0CCA\\u0CCB\\u0CD5\\u0CD6\\u0D02\\u0D03\\u0D3E\\u0D3F\\u0D40\\u0D46\\u0D47\\u0D48\\u0D4A\\u0D4B\\u0D4C\\u0D57\\u0D82\\u0D83\\u0DCF\\u0DD0\\u0DD1\\u0DD8\\u0DD9\\u0DDA\\u0DDB\\u0DDC\\u0DDD\\u0DDE\\u0DDF\\u0DF2\\u0DF3\\u0F3E\\u0F3F\\u0F7F\\u102B\\u102C\\u1031\\u1038\\u103B\\u103C\\u1056\\u1057\\u1062\\u1063\\u1064\\u1067\\u1068\\u1069\\u106A\\u106B\\u106C\\u106D\\u1083\\u1084\\u1087\\u1088\\u1089\\u108A\\u108B\\u108C\\u108F\\u17B6\\u17BE\\u17BF\\u17C0\\u17C1\\u17C2\\u17C3\\u17C4\\u17C5\\u17C7\\u17C8\\u1923\\u1924\\u1925\\u1926\\u1929\\u192A\\u192B\\u1930\\u1931\\u1933\\u1934\\u1935\\u1936\\u1937\\u1938\\u19B0\\u19B1\\u19B2\\u19B3\\u19B4\\u19B5\\u19B6\\u19B7\\u19B8\\u19B9\\u19BA\\u19BB\\u19BC\\u19BD\\u19BE\\u19BF\\u19C0\\u19C8\\u19C9\\u1A19\\u1A1A\\u1A1B\\u1B04\\u1B35\\u1B3B\\u1B3D\\u1B3E\\u1B3F\\u1B40\\u1B41\\u1B43\\u1B44\\u1B82\\u1BA1\\u1BA6\\u1BA7\\u1BAA\\u1C24\\u1C25\\u1C26\\u1C27\\u1C28\\u1C29\\u1C2A\\u1C2B\\u1C34\\u1C35\\uA823\\uA824\\uA827\\uA880\\uA881\\uA8B4\\uA8B5\\uA8B6\\uA8B7\\uA8B8\\uA8B9\\uA8BA\\uA8BB\\uA8BC\\uA8BD\\uA8BE\\uA8BF\\uA8C0\\uA8C1\\uA8C2\\uA8C3\\uA952\\uA953\\uAA2F\\uAA30\\uAA33\\uAA34\\uAA4D]", + peg$c238 = "Unicode decimal number", + peg$c239 = /^[0123456789\u0660\u0661\u0662\u0663\u0664\u0665\u0666\u0667\u0668\u0669\u06F0\u06F1\u06F2\u06F3\u06F4\u06F5\u06F6\u06F7\u06F8\u06F9\u07C0\u07C1\u07C2\u07C3\u07C4\u07C5\u07C6\u07C7\u07C8\u07C9\u0966\u0967\u0968\u0969\u096A\u096B\u096C\u096D\u096E\u096F\u09E6\u09E7\u09E8\u09E9\u09EA\u09EB\u09EC\u09ED\u09EE\u09EF\u0A66\u0A67\u0A68\u0A69\u0A6A\u0A6B\u0A6C\u0A6D\u0A6E\u0A6F\u0AE6\u0AE7\u0AE8\u0AE9\u0AEA\u0AEB\u0AEC\u0AED\u0AEE\u0AEF\u0B66\u0B67\u0B68\u0B69\u0B6A\u0B6B\u0B6C\u0B6D\u0B6E\u0B6F\u0BE6\u0BE7\u0BE8\u0BE9\u0BEA\u0BEB\u0BEC\u0BED\u0BEE\u0BEF\u0C66\u0C67\u0C68\u0C69\u0C6A\u0C6B\u0C6C\u0C6D\u0C6E\u0C6F\u0CE6\u0CE7\u0CE8\u0CE9\u0CEA\u0CEB\u0CEC\u0CED\u0CEE\u0CEF\u0D66\u0D67\u0D68\u0D69\u0D6A\u0D6B\u0D6C\u0D6D\u0D6E\u0D6F\u0E50\u0E51\u0E52\u0E53\u0E54\u0E55\u0E56\u0E57\u0E58\u0E59\u0ED0\u0ED1\u0ED2\u0ED3\u0ED4\u0ED5\u0ED6\u0ED7\u0ED8\u0ED9\u0F20\u0F21\u0F22\u0F23\u0F24\u0F25\u0F26\u0F27\u0F28\u0F29\u1040\u1041\u1042\u1043\u1044\u1045\u1046\u1047\u1048\u1049\u1090\u1091\u1092\u1093\u1094\u1095\u1096\u1097\u1098\u1099\u17E0\u17E1\u17E2\u17E3\u17E4\u17E5\u17E6\u17E7\u17E8\u17E9\u1810\u1811\u1812\u1813\u1814\u1815\u1816\u1817\u1818\u1819\u1946\u1947\u1948\u1949\u194A\u194B\u194C\u194D\u194E\u194F\u19D0\u19D1\u19D2\u19D3\u19D4\u19D5\u19D6\u19D7\u19D8\u19D9\u1B50\u1B51\u1B52\u1B53\u1B54\u1B55\u1B56\u1B57\u1B58\u1B59\u1BB0\u1BB1\u1BB2\u1BB3\u1BB4\u1BB5\u1BB6\u1BB7\u1BB8\u1BB9\u1C40\u1C41\u1C42\u1C43\u1C44\u1C45\u1C46\u1C47\u1C48\u1C49\u1C50\u1C51\u1C52\u1C53\u1C54\u1C55\u1C56\u1C57\u1C58\u1C59\uA620\uA621\uA622\uA623\uA624\uA625\uA626\uA627\uA628\uA629\uA8D0\uA8D1\uA8D2\uA8D3\uA8D4\uA8D5\uA8D6\uA8D7\uA8D8\uA8D9\uA900\uA901\uA902\uA903\uA904\uA905\uA906\uA907\uA908\uA909\uAA50\uAA51\uAA52\uAA53\uAA54\uAA55\uAA56\uAA57\uAA58\uAA59\uFF10\uFF11\uFF12\uFF13\uFF14\uFF15\uFF16\uFF17\uFF18\uFF19]/, + peg$c240 = "[0123456789\\u0660\\u0661\\u0662\\u0663\\u0664\\u0665\\u0666\\u0667\\u0668\\u0669\\u06F0\\u06F1\\u06F2\\u06F3\\u06F4\\u06F5\\u06F6\\u06F7\\u06F8\\u06F9\\u07C0\\u07C1\\u07C2\\u07C3\\u07C4\\u07C5\\u07C6\\u07C7\\u07C8\\u07C9\\u0966\\u0967\\u0968\\u0969\\u096A\\u096B\\u096C\\u096D\\u096E\\u096F\\u09E6\\u09E7\\u09E8\\u09E9\\u09EA\\u09EB\\u09EC\\u09ED\\u09EE\\u09EF\\u0A66\\u0A67\\u0A68\\u0A69\\u0A6A\\u0A6B\\u0A6C\\u0A6D\\u0A6E\\u0A6F\\u0AE6\\u0AE7\\u0AE8\\u0AE9\\u0AEA\\u0AEB\\u0AEC\\u0AED\\u0AEE\\u0AEF\\u0B66\\u0B67\\u0B68\\u0B69\\u0B6A\\u0B6B\\u0B6C\\u0B6D\\u0B6E\\u0B6F\\u0BE6\\u0BE7\\u0BE8\\u0BE9\\u0BEA\\u0BEB\\u0BEC\\u0BED\\u0BEE\\u0BEF\\u0C66\\u0C67\\u0C68\\u0C69\\u0C6A\\u0C6B\\u0C6C\\u0C6D\\u0C6E\\u0C6F\\u0CE6\\u0CE7\\u0CE8\\u0CE9\\u0CEA\\u0CEB\\u0CEC\\u0CED\\u0CEE\\u0CEF\\u0D66\\u0D67\\u0D68\\u0D69\\u0D6A\\u0D6B\\u0D6C\\u0D6D\\u0D6E\\u0D6F\\u0E50\\u0E51\\u0E52\\u0E53\\u0E54\\u0E55\\u0E56\\u0E57\\u0E58\\u0E59\\u0ED0\\u0ED1\\u0ED2\\u0ED3\\u0ED4\\u0ED5\\u0ED6\\u0ED7\\u0ED8\\u0ED9\\u0F20\\u0F21\\u0F22\\u0F23\\u0F24\\u0F25\\u0F26\\u0F27\\u0F28\\u0F29\\u1040\\u1041\\u1042\\u1043\\u1044\\u1045\\u1046\\u1047\\u1048\\u1049\\u1090\\u1091\\u1092\\u1093\\u1094\\u1095\\u1096\\u1097\\u1098\\u1099\\u17E0\\u17E1\\u17E2\\u17E3\\u17E4\\u17E5\\u17E6\\u17E7\\u17E8\\u17E9\\u1810\\u1811\\u1812\\u1813\\u1814\\u1815\\u1816\\u1817\\u1818\\u1819\\u1946\\u1947\\u1948\\u1949\\u194A\\u194B\\u194C\\u194D\\u194E\\u194F\\u19D0\\u19D1\\u19D2\\u19D3\\u19D4\\u19D5\\u19D6\\u19D7\\u19D8\\u19D9\\u1B50\\u1B51\\u1B52\\u1B53\\u1B54\\u1B55\\u1B56\\u1B57\\u1B58\\u1B59\\u1BB0\\u1BB1\\u1BB2\\u1BB3\\u1BB4\\u1BB5\\u1BB6\\u1BB7\\u1BB8\\u1BB9\\u1C40\\u1C41\\u1C42\\u1C43\\u1C44\\u1C45\\u1C46\\u1C47\\u1C48\\u1C49\\u1C50\\u1C51\\u1C52\\u1C53\\u1C54\\u1C55\\u1C56\\u1C57\\u1C58\\u1C59\\uA620\\uA621\\uA622\\uA623\\uA624\\uA625\\uA626\\uA627\\uA628\\uA629\\uA8D0\\uA8D1\\uA8D2\\uA8D3\\uA8D4\\uA8D5\\uA8D6\\uA8D7\\uA8D8\\uA8D9\\uA900\\uA901\\uA902\\uA903\\uA904\\uA905\\uA906\\uA907\\uA908\\uA909\\uAA50\\uAA51\\uAA52\\uAA53\\uAA54\\uAA55\\uAA56\\uAA57\\uAA58\\uAA59\\uFF10\\uFF11\\uFF12\\uFF13\\uFF14\\uFF15\\uFF16\\uFF17\\uFF18\\uFF19]", + peg$c241 = "Unicode punctuation connector", + peg$c242 = /^[_\u203F\u2040\u2054\uFE33\uFE34\uFE4D\uFE4E\uFE4F\uFF3F]/, + peg$c243 = "[_\\u203F\\u2040\\u2054\\uFE33\\uFE34\\uFE4D\\uFE4E\\uFE4F\\uFF3F]", + peg$c244 = "Unicode uppercase letter", + peg$c245 = /^[ABCDEFGHIJKLMNOPQRSTUVWXYZ\xC0\xC1\xC2\xC3\xC4\xC5\xC6\xC7\xC8\xC9\xCA\xCB\xCC\xCD\xCE\xCF\xD0\xD1\xD2\xD3\xD4\xD5\xD6\xD8\xD9\xDA\xDB\xDC\xDD\xDE\u0100\u0102\u0104\u0106\u0108\u010A\u010C\u010E\u0110\u0112\u0114\u0116\u0118\u011A\u011C\u011E\u0120\u0122\u0124\u0126\u0128\u012A\u012C\u012E\u0130\u0132\u0134\u0136\u0139\u013B\u013D\u013F\u0141\u0143\u0145\u0147\u014A\u014C\u014E\u0150\u0152\u0154\u0156\u0158\u015A\u015C\u015E\u0160\u0162\u0164\u0166\u0168\u016A\u016C\u016E\u0170\u0172\u0174\u0176\u0178\u0179\u017B\u017D\u0181\u0182\u0184\u0186\u0187\u0189\u018A\u018B\u018E\u018F\u0190\u0191\u0193\u0194\u0196\u0197\u0198\u019C\u019D\u019F\u01A0\u01A2\u01A4\u01A6\u01A7\u01A9\u01AC\u01AE\u01AF\u01B1\u01B2\u01B3\u01B5\u01B7\u01B8\u01BC\u01C4\u01C7\u01CA\u01CD\u01CF\u01D1\u01D3\u01D5\u01D7\u01D9\u01DB\u01DE\u01E0\u01E2\u01E4\u01E6\u01E8\u01EA\u01EC\u01EE\u01F1\u01F4\u01F6\u01F7\u01F8\u01FA\u01FC\u01FE\u0200\u0202\u0204\u0206\u0208\u020A\u020C\u020E\u0210\u0212\u0214\u0216\u0218\u021A\u021C\u021E\u0220\u0222\u0224\u0226\u0228\u022A\u022C\u022E\u0230\u0232\u023A\u023B\u023D\u023E\u0241\u0243\u0244\u0245\u0246\u0248\u024A\u024C\u024E\u0370\u0372\u0376\u0386\u0388\u0389\u038A\u038C\u038E\u038F\u0391\u0392\u0393\u0394\u0395\u0396\u0397\u0398\u0399\u039A\u039B\u039C\u039D\u039E\u039F\u03A0\u03A1\u03A3\u03A4\u03A5\u03A6\u03A7\u03A8\u03A9\u03AA\u03AB\u03CF\u03D2\u03D3\u03D4\u03D8\u03DA\u03DC\u03DE\u03E0\u03E2\u03E4\u03E6\u03E8\u03EA\u03EC\u03EE\u03F4\u03F7\u03F9\u03FA\u03FD\u03FE\u03FF\u0400\u0401\u0402\u0403\u0404\u0405\u0406\u0407\u0408\u0409\u040A\u040B\u040C\u040D\u040E\u040F\u0410\u0411\u0412\u0413\u0414\u0415\u0416\u0417\u0418\u0419\u041A\u041B\u041C\u041D\u041E\u041F\u0420\u0421\u0422\u0423\u0424\u0425\u0426\u0427\u0428\u0429\u042A\u042B\u042C\u042D\u042E\u042F\u0460\u0462\u0464\u0466\u0468\u046A\u046C\u046E\u0470\u0472\u0474\u0476\u0478\u047A\u047C\u047E\u0480\u048A\u048C\u048E\u0490\u0492\u0494\u0496\u0498\u049A\u049C\u049E\u04A0\u04A2\u04A4\u04A6\u04A8\u04AA\u04AC\u04AE\u04B0\u04B2\u04B4\u04B6\u04B8\u04BA\u04BC\u04BE\u04C0\u04C1\u04C3\u04C5\u04C7\u04C9\u04CB\u04CD\u04D0\u04D2\u04D4\u04D6\u04D8\u04DA\u04DC\u04DE\u04E0\u04E2\u04E4\u04E6\u04E8\u04EA\u04EC\u04EE\u04F0\u04F2\u04F4\u04F6\u04F8\u04FA\u04FC\u04FE\u0500\u0502\u0504\u0506\u0508\u050A\u050C\u050E\u0510\u0512\u0514\u0516\u0518\u051A\u051C\u051E\u0520\u0522\u0531\u0532\u0533\u0534\u0535\u0536\u0537\u0538\u0539\u053A\u053B\u053C\u053D\u053E\u053F\u0540\u0541\u0542\u0543\u0544\u0545\u0546\u0547\u0548\u0549\u054A\u054B\u054C\u054D\u054E\u054F\u0550\u0551\u0552\u0553\u0554\u0555\u0556\u10A0\u10A1\u10A2\u10A3\u10A4\u10A5\u10A6\u10A7\u10A8\u10A9\u10AA\u10AB\u10AC\u10AD\u10AE\u10AF\u10B0\u10B1\u10B2\u10B3\u10B4\u10B5\u10B6\u10B7\u10B8\u10B9\u10BA\u10BB\u10BC\u10BD\u10BE\u10BF\u10C0\u10C1\u10C2\u10C3\u10C4\u10C5\u1E00\u1E02\u1E04\u1E06\u1E08\u1E0A\u1E0C\u1E0E\u1E10\u1E12\u1E14\u1E16\u1E18\u1E1A\u1E1C\u1E1E\u1E20\u1E22\u1E24\u1E26\u1E28\u1E2A\u1E2C\u1E2E\u1E30\u1E32\u1E34\u1E36\u1E38\u1E3A\u1E3C\u1E3E\u1E40\u1E42\u1E44\u1E46\u1E48\u1E4A\u1E4C\u1E4E\u1E50\u1E52\u1E54\u1E56\u1E58\u1E5A\u1E5C\u1E5E\u1E60\u1E62\u1E64\u1E66\u1E68\u1E6A\u1E6C\u1E6E\u1E70\u1E72\u1E74\u1E76\u1E78\u1E7A\u1E7C\u1E7E\u1E80\u1E82\u1E84\u1E86\u1E88\u1E8A\u1E8C\u1E8E\u1E90\u1E92\u1E94\u1E9E\u1EA0\u1EA2\u1EA4\u1EA6\u1EA8\u1EAA\u1EAC\u1EAE\u1EB0\u1EB2\u1EB4\u1EB6\u1EB8\u1EBA\u1EBC\u1EBE\u1EC0\u1EC2\u1EC4\u1EC6\u1EC8\u1ECA\u1ECC\u1ECE\u1ED0\u1ED2\u1ED4\u1ED6\u1ED8\u1EDA\u1EDC\u1EDE\u1EE0\u1EE2\u1EE4\u1EE6\u1EE8\u1EEA\u1EEC\u1EEE\u1EF0\u1EF2\u1EF4\u1EF6\u1EF8\u1EFA\u1EFC\u1EFE\u1F08\u1F09\u1F0A\u1F0B\u1F0C\u1F0D\u1F0E\u1F0F\u1F18\u1F19\u1F1A\u1F1B\u1F1C\u1F1D\u1F28\u1F29\u1F2A\u1F2B\u1F2C\u1F2D\u1F2E\u1F2F\u1F38\u1F39\u1F3A\u1F3B\u1F3C\u1F3D\u1F3E\u1F3F\u1F48\u1F49\u1F4A\u1F4B\u1F4C\u1F4D\u1F59\u1F5B\u1F5D\u1F5F\u1F68\u1F69\u1F6A\u1F6B\u1F6C\u1F6D\u1F6E\u1F6F\u1FB8\u1FB9\u1FBA\u1FBB\u1FC8\u1FC9\u1FCA\u1FCB\u1FD8\u1FD9\u1FDA\u1FDB\u1FE8\u1FE9\u1FEA\u1FEB\u1FEC\u1FF8\u1FF9\u1FFA\u1FFB\u2102\u2107\u210B\u210C\u210D\u2110\u2111\u2112\u2115\u2119\u211A\u211B\u211C\u211D\u2124\u2126\u2128\u212A\u212B\u212C\u212D\u2130\u2131\u2132\u2133\u213E\u213F\u2145\u2183\u2C00\u2C01\u2C02\u2C03\u2C04\u2C05\u2C06\u2C07\u2C08\u2C09\u2C0A\u2C0B\u2C0C\u2C0D\u2C0E\u2C0F\u2C10\u2C11\u2C12\u2C13\u2C14\u2C15\u2C16\u2C17\u2C18\u2C19\u2C1A\u2C1B\u2C1C\u2C1D\u2C1E\u2C1F\u2C20\u2C21\u2C22\u2C23\u2C24\u2C25\u2C26\u2C27\u2C28\u2C29\u2C2A\u2C2B\u2C2C\u2C2D\u2C2E\u2C60\u2C62\u2C63\u2C64\u2C67\u2C69\u2C6B\u2C6D\u2C6E\u2C6F\u2C72\u2C75\u2C80\u2C82\u2C84\u2C86\u2C88\u2C8A\u2C8C\u2C8E\u2C90\u2C92\u2C94\u2C96\u2C98\u2C9A\u2C9C\u2C9E\u2CA0\u2CA2\u2CA4\u2CA6\u2CA8\u2CAA\u2CAC\u2CAE\u2CB0\u2CB2\u2CB4\u2CB6\u2CB8\u2CBA\u2CBC\u2CBE\u2CC0\u2CC2\u2CC4\u2CC6\u2CC8\u2CCA\u2CCC\u2CCE\u2CD0\u2CD2\u2CD4\u2CD6\u2CD8\u2CDA\u2CDC\u2CDE\u2CE0\u2CE2\uA640\uA642\uA644\uA646\uA648\uA64A\uA64C\uA64E\uA650\uA652\uA654\uA656\uA658\uA65A\uA65C\uA65E\uA662\uA664\uA666\uA668\uA66A\uA66C\uA680\uA682\uA684\uA686\uA688\uA68A\uA68C\uA68E\uA690\uA692\uA694\uA696\uA722\uA724\uA726\uA728\uA72A\uA72C\uA72E\uA732\uA734\uA736\uA738\uA73A\uA73C\uA73E\uA740\uA742\uA744\uA746\uA748\uA74A\uA74C\uA74E\uA750\uA752\uA754\uA756\uA758\uA75A\uA75C\uA75E\uA760\uA762\uA764\uA766\uA768\uA76A\uA76C\uA76E\uA779\uA77B\uA77D\uA77E\uA780\uA782\uA784\uA786\uA78B\uFF21\uFF22\uFF23\uFF24\uFF25\uFF26\uFF27\uFF28\uFF29\uFF2A\uFF2B\uFF2C\uFF2D\uFF2E\uFF2F\uFF30\uFF31\uFF32\uFF33\uFF34\uFF35\uFF36\uFF37\uFF38\uFF39\uFF3A]/, + peg$c246 = "[ABCDEFGHIJKLMNOPQRSTUVWXYZ\\xC0\\xC1\\xC2\\xC3\\xC4\\xC5\\xC6\\xC7\\xC8\\xC9\\xCA\\xCB\\xCC\\xCD\\xCE\\xCF\\xD0\\xD1\\xD2\\xD3\\xD4\\xD5\\xD6\\xD8\\xD9\\xDA\\xDB\\xDC\\xDD\\xDE\\u0100\\u0102\\u0104\\u0106\\u0108\\u010A\\u010C\\u010E\\u0110\\u0112\\u0114\\u0116\\u0118\\u011A\\u011C\\u011E\\u0120\\u0122\\u0124\\u0126\\u0128\\u012A\\u012C\\u012E\\u0130\\u0132\\u0134\\u0136\\u0139\\u013B\\u013D\\u013F\\u0141\\u0143\\u0145\\u0147\\u014A\\u014C\\u014E\\u0150\\u0152\\u0154\\u0156\\u0158\\u015A\\u015C\\u015E\\u0160\\u0162\\u0164\\u0166\\u0168\\u016A\\u016C\\u016E\\u0170\\u0172\\u0174\\u0176\\u0178\\u0179\\u017B\\u017D\\u0181\\u0182\\u0184\\u0186\\u0187\\u0189\\u018A\\u018B\\u018E\\u018F\\u0190\\u0191\\u0193\\u0194\\u0196\\u0197\\u0198\\u019C\\u019D\\u019F\\u01A0\\u01A2\\u01A4\\u01A6\\u01A7\\u01A9\\u01AC\\u01AE\\u01AF\\u01B1\\u01B2\\u01B3\\u01B5\\u01B7\\u01B8\\u01BC\\u01C4\\u01C7\\u01CA\\u01CD\\u01CF\\u01D1\\u01D3\\u01D5\\u01D7\\u01D9\\u01DB\\u01DE\\u01E0\\u01E2\\u01E4\\u01E6\\u01E8\\u01EA\\u01EC\\u01EE\\u01F1\\u01F4\\u01F6\\u01F7\\u01F8\\u01FA\\u01FC\\u01FE\\u0200\\u0202\\u0204\\u0206\\u0208\\u020A\\u020C\\u020E\\u0210\\u0212\\u0214\\u0216\\u0218\\u021A\\u021C\\u021E\\u0220\\u0222\\u0224\\u0226\\u0228\\u022A\\u022C\\u022E\\u0230\\u0232\\u023A\\u023B\\u023D\\u023E\\u0241\\u0243\\u0244\\u0245\\u0246\\u0248\\u024A\\u024C\\u024E\\u0370\\u0372\\u0376\\u0386\\u0388\\u0389\\u038A\\u038C\\u038E\\u038F\\u0391\\u0392\\u0393\\u0394\\u0395\\u0396\\u0397\\u0398\\u0399\\u039A\\u039B\\u039C\\u039D\\u039E\\u039F\\u03A0\\u03A1\\u03A3\\u03A4\\u03A5\\u03A6\\u03A7\\u03A8\\u03A9\\u03AA\\u03AB\\u03CF\\u03D2\\u03D3\\u03D4\\u03D8\\u03DA\\u03DC\\u03DE\\u03E0\\u03E2\\u03E4\\u03E6\\u03E8\\u03EA\\u03EC\\u03EE\\u03F4\\u03F7\\u03F9\\u03FA\\u03FD\\u03FE\\u03FF\\u0400\\u0401\\u0402\\u0403\\u0404\\u0405\\u0406\\u0407\\u0408\\u0409\\u040A\\u040B\\u040C\\u040D\\u040E\\u040F\\u0410\\u0411\\u0412\\u0413\\u0414\\u0415\\u0416\\u0417\\u0418\\u0419\\u041A\\u041B\\u041C\\u041D\\u041E\\u041F\\u0420\\u0421\\u0422\\u0423\\u0424\\u0425\\u0426\\u0427\\u0428\\u0429\\u042A\\u042B\\u042C\\u042D\\u042E\\u042F\\u0460\\u0462\\u0464\\u0466\\u0468\\u046A\\u046C\\u046E\\u0470\\u0472\\u0474\\u0476\\u0478\\u047A\\u047C\\u047E\\u0480\\u048A\\u048C\\u048E\\u0490\\u0492\\u0494\\u0496\\u0498\\u049A\\u049C\\u049E\\u04A0\\u04A2\\u04A4\\u04A6\\u04A8\\u04AA\\u04AC\\u04AE\\u04B0\\u04B2\\u04B4\\u04B6\\u04B8\\u04BA\\u04BC\\u04BE\\u04C0\\u04C1\\u04C3\\u04C5\\u04C7\\u04C9\\u04CB\\u04CD\\u04D0\\u04D2\\u04D4\\u04D6\\u04D8\\u04DA\\u04DC\\u04DE\\u04E0\\u04E2\\u04E4\\u04E6\\u04E8\\u04EA\\u04EC\\u04EE\\u04F0\\u04F2\\u04F4\\u04F6\\u04F8\\u04FA\\u04FC\\u04FE\\u0500\\u0502\\u0504\\u0506\\u0508\\u050A\\u050C\\u050E\\u0510\\u0512\\u0514\\u0516\\u0518\\u051A\\u051C\\u051E\\u0520\\u0522\\u0531\\u0532\\u0533\\u0534\\u0535\\u0536\\u0537\\u0538\\u0539\\u053A\\u053B\\u053C\\u053D\\u053E\\u053F\\u0540\\u0541\\u0542\\u0543\\u0544\\u0545\\u0546\\u0547\\u0548\\u0549\\u054A\\u054B\\u054C\\u054D\\u054E\\u054F\\u0550\\u0551\\u0552\\u0553\\u0554\\u0555\\u0556\\u10A0\\u10A1\\u10A2\\u10A3\\u10A4\\u10A5\\u10A6\\u10A7\\u10A8\\u10A9\\u10AA\\u10AB\\u10AC\\u10AD\\u10AE\\u10AF\\u10B0\\u10B1\\u10B2\\u10B3\\u10B4\\u10B5\\u10B6\\u10B7\\u10B8\\u10B9\\u10BA\\u10BB\\u10BC\\u10BD\\u10BE\\u10BF\\u10C0\\u10C1\\u10C2\\u10C3\\u10C4\\u10C5\\u1E00\\u1E02\\u1E04\\u1E06\\u1E08\\u1E0A\\u1E0C\\u1E0E\\u1E10\\u1E12\\u1E14\\u1E16\\u1E18\\u1E1A\\u1E1C\\u1E1E\\u1E20\\u1E22\\u1E24\\u1E26\\u1E28\\u1E2A\\u1E2C\\u1E2E\\u1E30\\u1E32\\u1E34\\u1E36\\u1E38\\u1E3A\\u1E3C\\u1E3E\\u1E40\\u1E42\\u1E44\\u1E46\\u1E48\\u1E4A\\u1E4C\\u1E4E\\u1E50\\u1E52\\u1E54\\u1E56\\u1E58\\u1E5A\\u1E5C\\u1E5E\\u1E60\\u1E62\\u1E64\\u1E66\\u1E68\\u1E6A\\u1E6C\\u1E6E\\u1E70\\u1E72\\u1E74\\u1E76\\u1E78\\u1E7A\\u1E7C\\u1E7E\\u1E80\\u1E82\\u1E84\\u1E86\\u1E88\\u1E8A\\u1E8C\\u1E8E\\u1E90\\u1E92\\u1E94\\u1E9E\\u1EA0\\u1EA2\\u1EA4\\u1EA6\\u1EA8\\u1EAA\\u1EAC\\u1EAE\\u1EB0\\u1EB2\\u1EB4\\u1EB6\\u1EB8\\u1EBA\\u1EBC\\u1EBE\\u1EC0\\u1EC2\\u1EC4\\u1EC6\\u1EC8\\u1ECA\\u1ECC\\u1ECE\\u1ED0\\u1ED2\\u1ED4\\u1ED6\\u1ED8\\u1EDA\\u1EDC\\u1EDE\\u1EE0\\u1EE2\\u1EE4\\u1EE6\\u1EE8\\u1EEA\\u1EEC\\u1EEE\\u1EF0\\u1EF2\\u1EF4\\u1EF6\\u1EF8\\u1EFA\\u1EFC\\u1EFE\\u1F08\\u1F09\\u1F0A\\u1F0B\\u1F0C\\u1F0D\\u1F0E\\u1F0F\\u1F18\\u1F19\\u1F1A\\u1F1B\\u1F1C\\u1F1D\\u1F28\\u1F29\\u1F2A\\u1F2B\\u1F2C\\u1F2D\\u1F2E\\u1F2F\\u1F38\\u1F39\\u1F3A\\u1F3B\\u1F3C\\u1F3D\\u1F3E\\u1F3F\\u1F48\\u1F49\\u1F4A\\u1F4B\\u1F4C\\u1F4D\\u1F59\\u1F5B\\u1F5D\\u1F5F\\u1F68\\u1F69\\u1F6A\\u1F6B\\u1F6C\\u1F6D\\u1F6E\\u1F6F\\u1FB8\\u1FB9\\u1FBA\\u1FBB\\u1FC8\\u1FC9\\u1FCA\\u1FCB\\u1FD8\\u1FD9\\u1FDA\\u1FDB\\u1FE8\\u1FE9\\u1FEA\\u1FEB\\u1FEC\\u1FF8\\u1FF9\\u1FFA\\u1FFB\\u2102\\u2107\\u210B\\u210C\\u210D\\u2110\\u2111\\u2112\\u2115\\u2119\\u211A\\u211B\\u211C\\u211D\\u2124\\u2126\\u2128\\u212A\\u212B\\u212C\\u212D\\u2130\\u2131\\u2132\\u2133\\u213E\\u213F\\u2145\\u2183\\u2C00\\u2C01\\u2C02\\u2C03\\u2C04\\u2C05\\u2C06\\u2C07\\u2C08\\u2C09\\u2C0A\\u2C0B\\u2C0C\\u2C0D\\u2C0E\\u2C0F\\u2C10\\u2C11\\u2C12\\u2C13\\u2C14\\u2C15\\u2C16\\u2C17\\u2C18\\u2C19\\u2C1A\\u2C1B\\u2C1C\\u2C1D\\u2C1E\\u2C1F\\u2C20\\u2C21\\u2C22\\u2C23\\u2C24\\u2C25\\u2C26\\u2C27\\u2C28\\u2C29\\u2C2A\\u2C2B\\u2C2C\\u2C2D\\u2C2E\\u2C60\\u2C62\\u2C63\\u2C64\\u2C67\\u2C69\\u2C6B\\u2C6D\\u2C6E\\u2C6F\\u2C72\\u2C75\\u2C80\\u2C82\\u2C84\\u2C86\\u2C88\\u2C8A\\u2C8C\\u2C8E\\u2C90\\u2C92\\u2C94\\u2C96\\u2C98\\u2C9A\\u2C9C\\u2C9E\\u2CA0\\u2CA2\\u2CA4\\u2CA6\\u2CA8\\u2CAA\\u2CAC\\u2CAE\\u2CB0\\u2CB2\\u2CB4\\u2CB6\\u2CB8\\u2CBA\\u2CBC\\u2CBE\\u2CC0\\u2CC2\\u2CC4\\u2CC6\\u2CC8\\u2CCA\\u2CCC\\u2CCE\\u2CD0\\u2CD2\\u2CD4\\u2CD6\\u2CD8\\u2CDA\\u2CDC\\u2CDE\\u2CE0\\u2CE2\\uA640\\uA642\\uA644\\uA646\\uA648\\uA64A\\uA64C\\uA64E\\uA650\\uA652\\uA654\\uA656\\uA658\\uA65A\\uA65C\\uA65E\\uA662\\uA664\\uA666\\uA668\\uA66A\\uA66C\\uA680\\uA682\\uA684\\uA686\\uA688\\uA68A\\uA68C\\uA68E\\uA690\\uA692\\uA694\\uA696\\uA722\\uA724\\uA726\\uA728\\uA72A\\uA72C\\uA72E\\uA732\\uA734\\uA736\\uA738\\uA73A\\uA73C\\uA73E\\uA740\\uA742\\uA744\\uA746\\uA748\\uA74A\\uA74C\\uA74E\\uA750\\uA752\\uA754\\uA756\\uA758\\uA75A\\uA75C\\uA75E\\uA760\\uA762\\uA764\\uA766\\uA768\\uA76A\\uA76C\\uA76E\\uA779\\uA77B\\uA77D\\uA77E\\uA780\\uA782\\uA784\\uA786\\uA78B\\uFF21\\uFF22\\uFF23\\uFF24\\uFF25\\uFF26\\uFF27\\uFF28\\uFF29\\uFF2A\\uFF2B\\uFF2C\\uFF2D\\uFF2E\\uFF2F\\uFF30\\uFF31\\uFF32\\uFF33\\uFF34\\uFF35\\uFF36\\uFF37\\uFF38\\uFF39\\uFF3A]", + peg$c247 = "Unicode lowercase letter", + peg$c248 = /^[abcdefghijklmnopqrstuvwxyz\xAA\xB5\xBA\xDF\xE0\xE1\xE2\xE3\xE4\xE5\xE6\xE7\xE8\xE9\xEA\xEB\xEC\xED\xEE\xEF\xF0\xF1\xF2\xF3\xF4\xF5\xF6\xF8\xF9\xFA\xFB\xFC\xFD\xFE\xFF\u0101\u0103\u0105\u0107\u0109\u010B\u010D\u010F\u0111\u0113\u0115\u0117\u0119\u011B\u011D\u011F\u0121\u0123\u0125\u0127\u0129\u012B\u012D\u012F\u0131\u0133\u0135\u0137\u0138\u013A\u013C\u013E\u0140\u0142\u0144\u0146\u0148\u0149\u014B\u014D\u014F\u0151\u0153\u0155\u0157\u0159\u015B\u015D\u015F\u0161\u0163\u0165\u0167\u0169\u016B\u016D\u016F\u0171\u0173\u0175\u0177\u017A\u017C\u017E\u017F\u0180\u0183\u0185\u0188\u018C\u018D\u0192\u0195\u0199\u019A\u019B\u019E\u01A1\u01A3\u01A5\u01A8\u01AA\u01AB\u01AD\u01B0\u01B4\u01B6\u01B9\u01BA\u01BD\u01BE\u01BF\u01C6\u01C9\u01CC\u01CE\u01D0\u01D2\u01D4\u01D6\u01D8\u01DA\u01DC\u01DD\u01DF\u01E1\u01E3\u01E5\u01E7\u01E9\u01EB\u01ED\u01EF\u01F0\u01F3\u01F5\u01F9\u01FB\u01FD\u01FF\u0201\u0203\u0205\u0207\u0209\u020B\u020D\u020F\u0211\u0213\u0215\u0217\u0219\u021B\u021D\u021F\u0221\u0223\u0225\u0227\u0229\u022B\u022D\u022F\u0231\u0233\u0234\u0235\u0236\u0237\u0238\u0239\u023C\u023F\u0240\u0242\u0247\u0249\u024B\u024D\u024F\u0250\u0251\u0252\u0253\u0254\u0255\u0256\u0257\u0258\u0259\u025A\u025B\u025C\u025D\u025E\u025F\u0260\u0261\u0262\u0263\u0264\u0265\u0266\u0267\u0268\u0269\u026A\u026B\u026C\u026D\u026E\u026F\u0270\u0271\u0272\u0273\u0274\u0275\u0276\u0277\u0278\u0279\u027A\u027B\u027C\u027D\u027E\u027F\u0280\u0281\u0282\u0283\u0284\u0285\u0286\u0287\u0288\u0289\u028A\u028B\u028C\u028D\u028E\u028F\u0290\u0291\u0292\u0293\u0295\u0296\u0297\u0298\u0299\u029A\u029B\u029C\u029D\u029E\u029F\u02A0\u02A1\u02A2\u02A3\u02A4\u02A5\u02A6\u02A7\u02A8\u02A9\u02AA\u02AB\u02AC\u02AD\u02AE\u02AF\u0371\u0373\u0377\u037B\u037C\u037D\u0390\u03AC\u03AD\u03AE\u03AF\u03B0\u03B1\u03B2\u03B3\u03B4\u03B5\u03B6\u03B7\u03B8\u03B9\u03BA\u03BB\u03BC\u03BD\u03BE\u03BF\u03C0\u03C1\u03C2\u03C3\u03C4\u03C5\u03C6\u03C7\u03C8\u03C9\u03CA\u03CB\u03CC\u03CD\u03CE\u03D0\u03D1\u03D5\u03D6\u03D7\u03D9\u03DB\u03DD\u03DF\u03E1\u03E3\u03E5\u03E7\u03E9\u03EB\u03ED\u03EF\u03F0\u03F1\u03F2\u03F3\u03F5\u03F8\u03FB\u03FC\u0430\u0431\u0432\u0433\u0434\u0435\u0436\u0437\u0438\u0439\u043A\u043B\u043C\u043D\u043E\u043F\u0440\u0441\u0442\u0443\u0444\u0445\u0446\u0447\u0448\u0449\u044A\u044B\u044C\u044D\u044E\u044F\u0450\u0451\u0452\u0453\u0454\u0455\u0456\u0457\u0458\u0459\u045A\u045B\u045C\u045D\u045E\u045F\u0461\u0463\u0465\u0467\u0469\u046B\u046D\u046F\u0471\u0473\u0475\u0477\u0479\u047B\u047D\u047F\u0481\u048B\u048D\u048F\u0491\u0493\u0495\u0497\u0499\u049B\u049D\u049F\u04A1\u04A3\u04A5\u04A7\u04A9\u04AB\u04AD\u04AF\u04B1\u04B3\u04B5\u04B7\u04B9\u04BB\u04BD\u04BF\u04C2\u04C4\u04C6\u04C8\u04CA\u04CC\u04CE\u04CF\u04D1\u04D3\u04D5\u04D7\u04D9\u04DB\u04DD\u04DF\u04E1\u04E3\u04E5\u04E7\u04E9\u04EB\u04ED\u04EF\u04F1\u04F3\u04F5\u04F7\u04F9\u04FB\u04FD\u04FF\u0501\u0503\u0505\u0507\u0509\u050B\u050D\u050F\u0511\u0513\u0515\u0517\u0519\u051B\u051D\u051F\u0521\u0523\u0561\u0562\u0563\u0564\u0565\u0566\u0567\u0568\u0569\u056A\u056B\u056C\u056D\u056E\u056F\u0570\u0571\u0572\u0573\u0574\u0575\u0576\u0577\u0578\u0579\u057A\u057B\u057C\u057D\u057E\u057F\u0580\u0581\u0582\u0583\u0584\u0585\u0586\u0587\u1D00\u1D01\u1D02\u1D03\u1D04\u1D05\u1D06\u1D07\u1D08\u1D09\u1D0A\u1D0B\u1D0C\u1D0D\u1D0E\u1D0F\u1D10\u1D11\u1D12\u1D13\u1D14\u1D15\u1D16\u1D17\u1D18\u1D19\u1D1A\u1D1B\u1D1C\u1D1D\u1D1E\u1D1F\u1D20\u1D21\u1D22\u1D23\u1D24\u1D25\u1D26\u1D27\u1D28\u1D29\u1D2A\u1D2B\u1D62\u1D63\u1D64\u1D65\u1D66\u1D67\u1D68\u1D69\u1D6A\u1D6B\u1D6C\u1D6D\u1D6E\u1D6F\u1D70\u1D71\u1D72\u1D73\u1D74\u1D75\u1D76\u1D77\u1D79\u1D7A\u1D7B\u1D7C\u1D7D\u1D7E\u1D7F\u1D80\u1D81\u1D82\u1D83\u1D84\u1D85\u1D86\u1D87\u1D88\u1D89\u1D8A\u1D8B\u1D8C\u1D8D\u1D8E\u1D8F\u1D90\u1D91\u1D92\u1D93\u1D94\u1D95\u1D96\u1D97\u1D98\u1D99\u1D9A\u1E01\u1E03\u1E05\u1E07\u1E09\u1E0B\u1E0D\u1E0F\u1E11\u1E13\u1E15\u1E17\u1E19\u1E1B\u1E1D\u1E1F\u1E21\u1E23\u1E25\u1E27\u1E29\u1E2B\u1E2D\u1E2F\u1E31\u1E33\u1E35\u1E37\u1E39\u1E3B\u1E3D\u1E3F\u1E41\u1E43\u1E45\u1E47\u1E49\u1E4B\u1E4D\u1E4F\u1E51\u1E53\u1E55\u1E57\u1E59\u1E5B\u1E5D\u1E5F\u1E61\u1E63\u1E65\u1E67\u1E69\u1E6B\u1E6D\u1E6F\u1E71\u1E73\u1E75\u1E77\u1E79\u1E7B\u1E7D\u1E7F\u1E81\u1E83\u1E85\u1E87\u1E89\u1E8B\u1E8D\u1E8F\u1E91\u1E93\u1E95\u1E96\u1E97\u1E98\u1E99\u1E9A\u1E9B\u1E9C\u1E9D\u1E9F\u1EA1\u1EA3\u1EA5\u1EA7\u1EA9\u1EAB\u1EAD\u1EAF\u1EB1\u1EB3\u1EB5\u1EB7\u1EB9\u1EBB\u1EBD\u1EBF\u1EC1\u1EC3\u1EC5\u1EC7\u1EC9\u1ECB\u1ECD\u1ECF\u1ED1\u1ED3\u1ED5\u1ED7\u1ED9\u1EDB\u1EDD\u1EDF\u1EE1\u1EE3\u1EE5\u1EE7\u1EE9\u1EEB\u1EED\u1EEF\u1EF1\u1EF3\u1EF5\u1EF7\u1EF9\u1EFB\u1EFD\u1EFF\u1F00\u1F01\u1F02\u1F03\u1F04\u1F05\u1F06\u1F07\u1F10\u1F11\u1F12\u1F13\u1F14\u1F15\u1F20\u1F21\u1F22\u1F23\u1F24\u1F25\u1F26\u1F27\u1F30\u1F31\u1F32\u1F33\u1F34\u1F35\u1F36\u1F37\u1F40\u1F41\u1F42\u1F43\u1F44\u1F45\u1F50\u1F51\u1F52\u1F53\u1F54\u1F55\u1F56\u1F57\u1F60\u1F61\u1F62\u1F63\u1F64\u1F65\u1F66\u1F67\u1F70\u1F71\u1F72\u1F73\u1F74\u1F75\u1F76\u1F77\u1F78\u1F79\u1F7A\u1F7B\u1F7C\u1F7D\u1F80\u1F81\u1F82\u1F83\u1F84\u1F85\u1F86\u1F87\u1F90\u1F91\u1F92\u1F93\u1F94\u1F95\u1F96\u1F97\u1FA0\u1FA1\u1FA2\u1FA3\u1FA4\u1FA5\u1FA6\u1FA7\u1FB0\u1FB1\u1FB2\u1FB3\u1FB4\u1FB6\u1FB7\u1FBE\u1FC2\u1FC3\u1FC4\u1FC6\u1FC7\u1FD0\u1FD1\u1FD2\u1FD3\u1FD6\u1FD7\u1FE0\u1FE1\u1FE2\u1FE3\u1FE4\u1FE5\u1FE6\u1FE7\u1FF2\u1FF3\u1FF4\u1FF6\u1FF7\u2071\u207F\u210A\u210E\u210F\u2113\u212F\u2134\u2139\u213C\u213D\u2146\u2147\u2148\u2149\u214E\u2184\u2C30\u2C31\u2C32\u2C33\u2C34\u2C35\u2C36\u2C37\u2C38\u2C39\u2C3A\u2C3B\u2C3C\u2C3D\u2C3E\u2C3F\u2C40\u2C41\u2C42\u2C43\u2C44\u2C45\u2C46\u2C47\u2C48\u2C49\u2C4A\u2C4B\u2C4C\u2C4D\u2C4E\u2C4F\u2C50\u2C51\u2C52\u2C53\u2C54\u2C55\u2C56\u2C57\u2C58\u2C59\u2C5A\u2C5B\u2C5C\u2C5D\u2C5E\u2C61\u2C65\u2C66\u2C68\u2C6A\u2C6C\u2C71\u2C73\u2C74\u2C76\u2C77\u2C78\u2C79\u2C7A\u2C7B\u2C7C\u2C81\u2C83\u2C85\u2C87\u2C89\u2C8B\u2C8D\u2C8F\u2C91\u2C93\u2C95\u2C97\u2C99\u2C9B\u2C9D\u2C9F\u2CA1\u2CA3\u2CA5\u2CA7\u2CA9\u2CAB\u2CAD\u2CAF\u2CB1\u2CB3\u2CB5\u2CB7\u2CB9\u2CBB\u2CBD\u2CBF\u2CC1\u2CC3\u2CC5\u2CC7\u2CC9\u2CCB\u2CCD\u2CCF\u2CD1\u2CD3\u2CD5\u2CD7\u2CD9\u2CDB\u2CDD\u2CDF\u2CE1\u2CE3\u2CE4\u2D00\u2D01\u2D02\u2D03\u2D04\u2D05\u2D06\u2D07\u2D08\u2D09\u2D0A\u2D0B\u2D0C\u2D0D\u2D0E\u2D0F\u2D10\u2D11\u2D12\u2D13\u2D14\u2D15\u2D16\u2D17\u2D18\u2D19\u2D1A\u2D1B\u2D1C\u2D1D\u2D1E\u2D1F\u2D20\u2D21\u2D22\u2D23\u2D24\u2D25\uA641\uA643\uA645\uA647\uA649\uA64B\uA64D\uA64F\uA651\uA653\uA655\uA657\uA659\uA65B\uA65D\uA65F\uA663\uA665\uA667\uA669\uA66B\uA66D\uA681\uA683\uA685\uA687\uA689\uA68B\uA68D\uA68F\uA691\uA693\uA695\uA697\uA723\uA725\uA727\uA729\uA72B\uA72D\uA72F\uA730\uA731\uA733\uA735\uA737\uA739\uA73B\uA73D\uA73F\uA741\uA743\uA745\uA747\uA749\uA74B\uA74D\uA74F\uA751\uA753\uA755\uA757\uA759\uA75B\uA75D\uA75F\uA761\uA763\uA765\uA767\uA769\uA76B\uA76D\uA76F\uA771\uA772\uA773\uA774\uA775\uA776\uA777\uA778\uA77A\uA77C\uA77F\uA781\uA783\uA785\uA787\uA78C\uFB00\uFB01\uFB02\uFB03\uFB04\uFB05\uFB06\uFB13\uFB14\uFB15\uFB16\uFB17\uFF41\uFF42\uFF43\uFF44\uFF45\uFF46\uFF47\uFF48\uFF49\uFF4A\uFF4B\uFF4C\uFF4D\uFF4E\uFF4F\uFF50\uFF51\uFF52\uFF53\uFF54\uFF55\uFF56\uFF57\uFF58\uFF59\uFF5A]/, + peg$c249 = "[abcdefghijklmnopqrstuvwxyz\\xAA\\xB5\\xBA\\xDF\\xE0\\xE1\\xE2\\xE3\\xE4\\xE5\\xE6\\xE7\\xE8\\xE9\\xEA\\xEB\\xEC\\xED\\xEE\\xEF\\xF0\\xF1\\xF2\\xF3\\xF4\\xF5\\xF6\\xF8\\xF9\\xFA\\xFB\\xFC\\xFD\\xFE\\xFF\\u0101\\u0103\\u0105\\u0107\\u0109\\u010B\\u010D\\u010F\\u0111\\u0113\\u0115\\u0117\\u0119\\u011B\\u011D\\u011F\\u0121\\u0123\\u0125\\u0127\\u0129\\u012B\\u012D\\u012F\\u0131\\u0133\\u0135\\u0137\\u0138\\u013A\\u013C\\u013E\\u0140\\u0142\\u0144\\u0146\\u0148\\u0149\\u014B\\u014D\\u014F\\u0151\\u0153\\u0155\\u0157\\u0159\\u015B\\u015D\\u015F\\u0161\\u0163\\u0165\\u0167\\u0169\\u016B\\u016D\\u016F\\u0171\\u0173\\u0175\\u0177\\u017A\\u017C\\u017E\\u017F\\u0180\\u0183\\u0185\\u0188\\u018C\\u018D\\u0192\\u0195\\u0199\\u019A\\u019B\\u019E\\u01A1\\u01A3\\u01A5\\u01A8\\u01AA\\u01AB\\u01AD\\u01B0\\u01B4\\u01B6\\u01B9\\u01BA\\u01BD\\u01BE\\u01BF\\u01C6\\u01C9\\u01CC\\u01CE\\u01D0\\u01D2\\u01D4\\u01D6\\u01D8\\u01DA\\u01DC\\u01DD\\u01DF\\u01E1\\u01E3\\u01E5\\u01E7\\u01E9\\u01EB\\u01ED\\u01EF\\u01F0\\u01F3\\u01F5\\u01F9\\u01FB\\u01FD\\u01FF\\u0201\\u0203\\u0205\\u0207\\u0209\\u020B\\u020D\\u020F\\u0211\\u0213\\u0215\\u0217\\u0219\\u021B\\u021D\\u021F\\u0221\\u0223\\u0225\\u0227\\u0229\\u022B\\u022D\\u022F\\u0231\\u0233\\u0234\\u0235\\u0236\\u0237\\u0238\\u0239\\u023C\\u023F\\u0240\\u0242\\u0247\\u0249\\u024B\\u024D\\u024F\\u0250\\u0251\\u0252\\u0253\\u0254\\u0255\\u0256\\u0257\\u0258\\u0259\\u025A\\u025B\\u025C\\u025D\\u025E\\u025F\\u0260\\u0261\\u0262\\u0263\\u0264\\u0265\\u0266\\u0267\\u0268\\u0269\\u026A\\u026B\\u026C\\u026D\\u026E\\u026F\\u0270\\u0271\\u0272\\u0273\\u0274\\u0275\\u0276\\u0277\\u0278\\u0279\\u027A\\u027B\\u027C\\u027D\\u027E\\u027F\\u0280\\u0281\\u0282\\u0283\\u0284\\u0285\\u0286\\u0287\\u0288\\u0289\\u028A\\u028B\\u028C\\u028D\\u028E\\u028F\\u0290\\u0291\\u0292\\u0293\\u0295\\u0296\\u0297\\u0298\\u0299\\u029A\\u029B\\u029C\\u029D\\u029E\\u029F\\u02A0\\u02A1\\u02A2\\u02A3\\u02A4\\u02A5\\u02A6\\u02A7\\u02A8\\u02A9\\u02AA\\u02AB\\u02AC\\u02AD\\u02AE\\u02AF\\u0371\\u0373\\u0377\\u037B\\u037C\\u037D\\u0390\\u03AC\\u03AD\\u03AE\\u03AF\\u03B0\\u03B1\\u03B2\\u03B3\\u03B4\\u03B5\\u03B6\\u03B7\\u03B8\\u03B9\\u03BA\\u03BB\\u03BC\\u03BD\\u03BE\\u03BF\\u03C0\\u03C1\\u03C2\\u03C3\\u03C4\\u03C5\\u03C6\\u03C7\\u03C8\\u03C9\\u03CA\\u03CB\\u03CC\\u03CD\\u03CE\\u03D0\\u03D1\\u03D5\\u03D6\\u03D7\\u03D9\\u03DB\\u03DD\\u03DF\\u03E1\\u03E3\\u03E5\\u03E7\\u03E9\\u03EB\\u03ED\\u03EF\\u03F0\\u03F1\\u03F2\\u03F3\\u03F5\\u03F8\\u03FB\\u03FC\\u0430\\u0431\\u0432\\u0433\\u0434\\u0435\\u0436\\u0437\\u0438\\u0439\\u043A\\u043B\\u043C\\u043D\\u043E\\u043F\\u0440\\u0441\\u0442\\u0443\\u0444\\u0445\\u0446\\u0447\\u0448\\u0449\\u044A\\u044B\\u044C\\u044D\\u044E\\u044F\\u0450\\u0451\\u0452\\u0453\\u0454\\u0455\\u0456\\u0457\\u0458\\u0459\\u045A\\u045B\\u045C\\u045D\\u045E\\u045F\\u0461\\u0463\\u0465\\u0467\\u0469\\u046B\\u046D\\u046F\\u0471\\u0473\\u0475\\u0477\\u0479\\u047B\\u047D\\u047F\\u0481\\u048B\\u048D\\u048F\\u0491\\u0493\\u0495\\u0497\\u0499\\u049B\\u049D\\u049F\\u04A1\\u04A3\\u04A5\\u04A7\\u04A9\\u04AB\\u04AD\\u04AF\\u04B1\\u04B3\\u04B5\\u04B7\\u04B9\\u04BB\\u04BD\\u04BF\\u04C2\\u04C4\\u04C6\\u04C8\\u04CA\\u04CC\\u04CE\\u04CF\\u04D1\\u04D3\\u04D5\\u04D7\\u04D9\\u04DB\\u04DD\\u04DF\\u04E1\\u04E3\\u04E5\\u04E7\\u04E9\\u04EB\\u04ED\\u04EF\\u04F1\\u04F3\\u04F5\\u04F7\\u04F9\\u04FB\\u04FD\\u04FF\\u0501\\u0503\\u0505\\u0507\\u0509\\u050B\\u050D\\u050F\\u0511\\u0513\\u0515\\u0517\\u0519\\u051B\\u051D\\u051F\\u0521\\u0523\\u0561\\u0562\\u0563\\u0564\\u0565\\u0566\\u0567\\u0568\\u0569\\u056A\\u056B\\u056C\\u056D\\u056E\\u056F\\u0570\\u0571\\u0572\\u0573\\u0574\\u0575\\u0576\\u0577\\u0578\\u0579\\u057A\\u057B\\u057C\\u057D\\u057E\\u057F\\u0580\\u0581\\u0582\\u0583\\u0584\\u0585\\u0586\\u0587\\u1D00\\u1D01\\u1D02\\u1D03\\u1D04\\u1D05\\u1D06\\u1D07\\u1D08\\u1D09\\u1D0A\\u1D0B\\u1D0C\\u1D0D\\u1D0E\\u1D0F\\u1D10\\u1D11\\u1D12\\u1D13\\u1D14\\u1D15\\u1D16\\u1D17\\u1D18\\u1D19\\u1D1A\\u1D1B\\u1D1C\\u1D1D\\u1D1E\\u1D1F\\u1D20\\u1D21\\u1D22\\u1D23\\u1D24\\u1D25\\u1D26\\u1D27\\u1D28\\u1D29\\u1D2A\\u1D2B\\u1D62\\u1D63\\u1D64\\u1D65\\u1D66\\u1D67\\u1D68\\u1D69\\u1D6A\\u1D6B\\u1D6C\\u1D6D\\u1D6E\\u1D6F\\u1D70\\u1D71\\u1D72\\u1D73\\u1D74\\u1D75\\u1D76\\u1D77\\u1D79\\u1D7A\\u1D7B\\u1D7C\\u1D7D\\u1D7E\\u1D7F\\u1D80\\u1D81\\u1D82\\u1D83\\u1D84\\u1D85\\u1D86\\u1D87\\u1D88\\u1D89\\u1D8A\\u1D8B\\u1D8C\\u1D8D\\u1D8E\\u1D8F\\u1D90\\u1D91\\u1D92\\u1D93\\u1D94\\u1D95\\u1D96\\u1D97\\u1D98\\u1D99\\u1D9A\\u1E01\\u1E03\\u1E05\\u1E07\\u1E09\\u1E0B\\u1E0D\\u1E0F\\u1E11\\u1E13\\u1E15\\u1E17\\u1E19\\u1E1B\\u1E1D\\u1E1F\\u1E21\\u1E23\\u1E25\\u1E27\\u1E29\\u1E2B\\u1E2D\\u1E2F\\u1E31\\u1E33\\u1E35\\u1E37\\u1E39\\u1E3B\\u1E3D\\u1E3F\\u1E41\\u1E43\\u1E45\\u1E47\\u1E49\\u1E4B\\u1E4D\\u1E4F\\u1E51\\u1E53\\u1E55\\u1E57\\u1E59\\u1E5B\\u1E5D\\u1E5F\\u1E61\\u1E63\\u1E65\\u1E67\\u1E69\\u1E6B\\u1E6D\\u1E6F\\u1E71\\u1E73\\u1E75\\u1E77\\u1E79\\u1E7B\\u1E7D\\u1E7F\\u1E81\\u1E83\\u1E85\\u1E87\\u1E89\\u1E8B\\u1E8D\\u1E8F\\u1E91\\u1E93\\u1E95\\u1E96\\u1E97\\u1E98\\u1E99\\u1E9A\\u1E9B\\u1E9C\\u1E9D\\u1E9F\\u1EA1\\u1EA3\\u1EA5\\u1EA7\\u1EA9\\u1EAB\\u1EAD\\u1EAF\\u1EB1\\u1EB3\\u1EB5\\u1EB7\\u1EB9\\u1EBB\\u1EBD\\u1EBF\\u1EC1\\u1EC3\\u1EC5\\u1EC7\\u1EC9\\u1ECB\\u1ECD\\u1ECF\\u1ED1\\u1ED3\\u1ED5\\u1ED7\\u1ED9\\u1EDB\\u1EDD\\u1EDF\\u1EE1\\u1EE3\\u1EE5\\u1EE7\\u1EE9\\u1EEB\\u1EED\\u1EEF\\u1EF1\\u1EF3\\u1EF5\\u1EF7\\u1EF9\\u1EFB\\u1EFD\\u1EFF\\u1F00\\u1F01\\u1F02\\u1F03\\u1F04\\u1F05\\u1F06\\u1F07\\u1F10\\u1F11\\u1F12\\u1F13\\u1F14\\u1F15\\u1F20\\u1F21\\u1F22\\u1F23\\u1F24\\u1F25\\u1F26\\u1F27\\u1F30\\u1F31\\u1F32\\u1F33\\u1F34\\u1F35\\u1F36\\u1F37\\u1F40\\u1F41\\u1F42\\u1F43\\u1F44\\u1F45\\u1F50\\u1F51\\u1F52\\u1F53\\u1F54\\u1F55\\u1F56\\u1F57\\u1F60\\u1F61\\u1F62\\u1F63\\u1F64\\u1F65\\u1F66\\u1F67\\u1F70\\u1F71\\u1F72\\u1F73\\u1F74\\u1F75\\u1F76\\u1F77\\u1F78\\u1F79\\u1F7A\\u1F7B\\u1F7C\\u1F7D\\u1F80\\u1F81\\u1F82\\u1F83\\u1F84\\u1F85\\u1F86\\u1F87\\u1F90\\u1F91\\u1F92\\u1F93\\u1F94\\u1F95\\u1F96\\u1F97\\u1FA0\\u1FA1\\u1FA2\\u1FA3\\u1FA4\\u1FA5\\u1FA6\\u1FA7\\u1FB0\\u1FB1\\u1FB2\\u1FB3\\u1FB4\\u1FB6\\u1FB7\\u1FBE\\u1FC2\\u1FC3\\u1FC4\\u1FC6\\u1FC7\\u1FD0\\u1FD1\\u1FD2\\u1FD3\\u1FD6\\u1FD7\\u1FE0\\u1FE1\\u1FE2\\u1FE3\\u1FE4\\u1FE5\\u1FE6\\u1FE7\\u1FF2\\u1FF3\\u1FF4\\u1FF6\\u1FF7\\u2071\\u207F\\u210A\\u210E\\u210F\\u2113\\u212F\\u2134\\u2139\\u213C\\u213D\\u2146\\u2147\\u2148\\u2149\\u214E\\u2184\\u2C30\\u2C31\\u2C32\\u2C33\\u2C34\\u2C35\\u2C36\\u2C37\\u2C38\\u2C39\\u2C3A\\u2C3B\\u2C3C\\u2C3D\\u2C3E\\u2C3F\\u2C40\\u2C41\\u2C42\\u2C43\\u2C44\\u2C45\\u2C46\\u2C47\\u2C48\\u2C49\\u2C4A\\u2C4B\\u2C4C\\u2C4D\\u2C4E\\u2C4F\\u2C50\\u2C51\\u2C52\\u2C53\\u2C54\\u2C55\\u2C56\\u2C57\\u2C58\\u2C59\\u2C5A\\u2C5B\\u2C5C\\u2C5D\\u2C5E\\u2C61\\u2C65\\u2C66\\u2C68\\u2C6A\\u2C6C\\u2C71\\u2C73\\u2C74\\u2C76\\u2C77\\u2C78\\u2C79\\u2C7A\\u2C7B\\u2C7C\\u2C81\\u2C83\\u2C85\\u2C87\\u2C89\\u2C8B\\u2C8D\\u2C8F\\u2C91\\u2C93\\u2C95\\u2C97\\u2C99\\u2C9B\\u2C9D\\u2C9F\\u2CA1\\u2CA3\\u2CA5\\u2CA7\\u2CA9\\u2CAB\\u2CAD\\u2CAF\\u2CB1\\u2CB3\\u2CB5\\u2CB7\\u2CB9\\u2CBB\\u2CBD\\u2CBF\\u2CC1\\u2CC3\\u2CC5\\u2CC7\\u2CC9\\u2CCB\\u2CCD\\u2CCF\\u2CD1\\u2CD3\\u2CD5\\u2CD7\\u2CD9\\u2CDB\\u2CDD\\u2CDF\\u2CE1\\u2CE3\\u2CE4\\u2D00\\u2D01\\u2D02\\u2D03\\u2D04\\u2D05\\u2D06\\u2D07\\u2D08\\u2D09\\u2D0A\\u2D0B\\u2D0C\\u2D0D\\u2D0E\\u2D0F\\u2D10\\u2D11\\u2D12\\u2D13\\u2D14\\u2D15\\u2D16\\u2D17\\u2D18\\u2D19\\u2D1A\\u2D1B\\u2D1C\\u2D1D\\u2D1E\\u2D1F\\u2D20\\u2D21\\u2D22\\u2D23\\u2D24\\u2D25\\uA641\\uA643\\uA645\\uA647\\uA649\\uA64B\\uA64D\\uA64F\\uA651\\uA653\\uA655\\uA657\\uA659\\uA65B\\uA65D\\uA65F\\uA663\\uA665\\uA667\\uA669\\uA66B\\uA66D\\uA681\\uA683\\uA685\\uA687\\uA689\\uA68B\\uA68D\\uA68F\\uA691\\uA693\\uA695\\uA697\\uA723\\uA725\\uA727\\uA729\\uA72B\\uA72D\\uA72F\\uA730\\uA731\\uA733\\uA735\\uA737\\uA739\\uA73B\\uA73D\\uA73F\\uA741\\uA743\\uA745\\uA747\\uA749\\uA74B\\uA74D\\uA74F\\uA751\\uA753\\uA755\\uA757\\uA759\\uA75B\\uA75D\\uA75F\\uA761\\uA763\\uA765\\uA767\\uA769\\uA76B\\uA76D\\uA76F\\uA771\\uA772\\uA773\\uA774\\uA775\\uA776\\uA777\\uA778\\uA77A\\uA77C\\uA77F\\uA781\\uA783\\uA785\\uA787\\uA78C\\uFB00\\uFB01\\uFB02\\uFB03\\uFB04\\uFB05\\uFB06\\uFB13\\uFB14\\uFB15\\uFB16\\uFB17\\uFF41\\uFF42\\uFF43\\uFF44\\uFF45\\uFF46\\uFF47\\uFF48\\uFF49\\uFF4A\\uFF4B\\uFF4C\\uFF4D\\uFF4E\\uFF4F\\uFF50\\uFF51\\uFF52\\uFF53\\uFF54\\uFF55\\uFF56\\uFF57\\uFF58\\uFF59\\uFF5A]", + peg$c250 = "Unicode titlecase letter", + peg$c251 = /^[\u01C5\u01C8\u01CB\u01F2\u1F88\u1F89\u1F8A\u1F8B\u1F8C\u1F8D\u1F8E\u1F8F\u1F98\u1F99\u1F9A\u1F9B\u1F9C\u1F9D\u1F9E\u1F9F\u1FA8\u1FA9\u1FAA\u1FAB\u1FAC\u1FAD\u1FAE\u1FAF\u1FBC\u1FCC]/, + peg$c252 = "[\\u01C5\\u01C8\\u01CB\\u01F2\\u1F88\\u1F89\\u1F8A\\u1F8B\\u1F8C\\u1F8D\\u1F8E\\u1F8F\\u1F98\\u1F99\\u1F9A\\u1F9B\\u1F9C\\u1F9D\\u1F9E\\u1F9F\\u1FA8\\u1FA9\\u1FAA\\u1FAB\\u1FAC\\u1FAD\\u1FAE\\u1FAF\\u1FBC\\u1FCC]", + peg$c253 = "Unicode modifier letter", + peg$c254 = /^[\u02B0\u02B1\u02B2\u02B3\u02B4\u02B5\u02B6\u02B7\u02B8\u02B9\u02BA\u02BB\u02BC\u02BD\u02BE\u02BF\u02C0\u02C1\u02C6\u02C7\u02C8\u02C9\u02CA\u02CB\u02CC\u02CD\u02CE\u02CF\u02D0\u02D1\u02E0\u02E1\u02E2\u02E3\u02E4\u02EC\u02EE\u0374\u037A\u0559\u0640\u06E5\u06E6\u07F4\u07F5\u07FA\u0971\u0E46\u0EC6\u10FC\u17D7\u1843\u1C78\u1C79\u1C7A\u1C7B\u1C7C\u1C7D\u1D2C\u1D2D\u1D2E\u1D2F\u1D30\u1D31\u1D32\u1D33\u1D34\u1D35\u1D36\u1D37\u1D38\u1D39\u1D3A\u1D3B\u1D3C\u1D3D\u1D3E\u1D3F\u1D40\u1D41\u1D42\u1D43\u1D44\u1D45\u1D46\u1D47\u1D48\u1D49\u1D4A\u1D4B\u1D4C\u1D4D\u1D4E\u1D4F\u1D50\u1D51\u1D52\u1D53\u1D54\u1D55\u1D56\u1D57\u1D58\u1D59\u1D5A\u1D5B\u1D5C\u1D5D\u1D5E\u1D5F\u1D60\u1D61\u1D78\u1D9B\u1D9C\u1D9D\u1D9E\u1D9F\u1DA0\u1DA1\u1DA2\u1DA3\u1DA4\u1DA5\u1DA6\u1DA7\u1DA8\u1DA9\u1DAA\u1DAB\u1DAC\u1DAD\u1DAE\u1DAF\u1DB0\u1DB1\u1DB2\u1DB3\u1DB4\u1DB5\u1DB6\u1DB7\u1DB8\u1DB9\u1DBA\u1DBB\u1DBC\u1DBD\u1DBE\u1DBF\u2090\u2091\u2092\u2093\u2094\u2C7D\u2D6F\u2E2F\u3005\u3031\u3032\u3033\u3034\u3035\u303B\u309D\u309E\u30FC\u30FD\u30FE\uA015\uA60C\uA67F\uA717\uA718\uA719\uA71A\uA71B\uA71C\uA71D\uA71E\uA71F\uA770\uA788\uFF70\uFF9E\uFF9F]/, + peg$c255 = "[\\u02B0\\u02B1\\u02B2\\u02B3\\u02B4\\u02B5\\u02B6\\u02B7\\u02B8\\u02B9\\u02BA\\u02BB\\u02BC\\u02BD\\u02BE\\u02BF\\u02C0\\u02C1\\u02C6\\u02C7\\u02C8\\u02C9\\u02CA\\u02CB\\u02CC\\u02CD\\u02CE\\u02CF\\u02D0\\u02D1\\u02E0\\u02E1\\u02E2\\u02E3\\u02E4\\u02EC\\u02EE\\u0374\\u037A\\u0559\\u0640\\u06E5\\u06E6\\u07F4\\u07F5\\u07FA\\u0971\\u0E46\\u0EC6\\u10FC\\u17D7\\u1843\\u1C78\\u1C79\\u1C7A\\u1C7B\\u1C7C\\u1C7D\\u1D2C\\u1D2D\\u1D2E\\u1D2F\\u1D30\\u1D31\\u1D32\\u1D33\\u1D34\\u1D35\\u1D36\\u1D37\\u1D38\\u1D39\\u1D3A\\u1D3B\\u1D3C\\u1D3D\\u1D3E\\u1D3F\\u1D40\\u1D41\\u1D42\\u1D43\\u1D44\\u1D45\\u1D46\\u1D47\\u1D48\\u1D49\\u1D4A\\u1D4B\\u1D4C\\u1D4D\\u1D4E\\u1D4F\\u1D50\\u1D51\\u1D52\\u1D53\\u1D54\\u1D55\\u1D56\\u1D57\\u1D58\\u1D59\\u1D5A\\u1D5B\\u1D5C\\u1D5D\\u1D5E\\u1D5F\\u1D60\\u1D61\\u1D78\\u1D9B\\u1D9C\\u1D9D\\u1D9E\\u1D9F\\u1DA0\\u1DA1\\u1DA2\\u1DA3\\u1DA4\\u1DA5\\u1DA6\\u1DA7\\u1DA8\\u1DA9\\u1DAA\\u1DAB\\u1DAC\\u1DAD\\u1DAE\\u1DAF\\u1DB0\\u1DB1\\u1DB2\\u1DB3\\u1DB4\\u1DB5\\u1DB6\\u1DB7\\u1DB8\\u1DB9\\u1DBA\\u1DBB\\u1DBC\\u1DBD\\u1DBE\\u1DBF\\u2090\\u2091\\u2092\\u2093\\u2094\\u2C7D\\u2D6F\\u2E2F\\u3005\\u3031\\u3032\\u3033\\u3034\\u3035\\u303B\\u309D\\u309E\\u30FC\\u30FD\\u30FE\\uA015\\uA60C\\uA67F\\uA717\\uA718\\uA719\\uA71A\\uA71B\\uA71C\\uA71D\\uA71E\\uA71F\\uA770\\uA788\\uFF70\\uFF9E\\uFF9F]", + peg$c256 = "Unicode other letter", + peg$c257 = /^[\u01BB\u01C0\u01C1\u01C2\u01C3\u0294\u05D0\u05D1\u05D2\u05D3\u05D4\u05D5\u05D6\u05D7\u05D8\u05D9\u05DA\u05DB\u05DC\u05DD\u05DE\u05DF\u05E0\u05E1\u05E2\u05E3\u05E4\u05E5\u05E6\u05E7\u05E8\u05E9\u05EA\u05F0\u05F1\u05F2\u0621\u0622\u0623\u0624\u0625\u0626\u0627\u0628\u0629\u062A\u062B\u062C\u062D\u062E\u062F\u0630\u0631\u0632\u0633\u0634\u0635\u0636\u0637\u0638\u0639\u063A\u063B\u063C\u063D\u063E\u063F\u0641\u0642\u0643\u0644\u0645\u0646\u0647\u0648\u0649\u064A\u066E\u066F\u0671\u0672\u0673\u0674\u0675\u0676\u0677\u0678\u0679\u067A\u067B\u067C\u067D\u067E\u067F\u0680\u0681\u0682\u0683\u0684\u0685\u0686\u0687\u0688\u0689\u068A\u068B\u068C\u068D\u068E\u068F\u0690\u0691\u0692\u0693\u0694\u0695\u0696\u0697\u0698\u0699\u069A\u069B\u069C\u069D\u069E\u069F\u06A0\u06A1\u06A2\u06A3\u06A4\u06A5\u06A6\u06A7\u06A8\u06A9\u06AA\u06AB\u06AC\u06AD\u06AE\u06AF\u06B0\u06B1\u06B2\u06B3\u06B4\u06B5\u06B6\u06B7\u06B8\u06B9\u06BA\u06BB\u06BC\u06BD\u06BE\u06BF\u06C0\u06C1\u06C2\u06C3\u06C4\u06C5\u06C6\u06C7\u06C8\u06C9\u06CA\u06CB\u06CC\u06CD\u06CE\u06CF\u06D0\u06D1\u06D2\u06D3\u06D5\u06EE\u06EF\u06FA\u06FB\u06FC\u06FF\u0710\u0712\u0713\u0714\u0715\u0716\u0717\u0718\u0719\u071A\u071B\u071C\u071D\u071E\u071F\u0720\u0721\u0722\u0723\u0724\u0725\u0726\u0727\u0728\u0729\u072A\u072B\u072C\u072D\u072E\u072F\u074D\u074E\u074F\u0750\u0751\u0752\u0753\u0754\u0755\u0756\u0757\u0758\u0759\u075A\u075B\u075C\u075D\u075E\u075F\u0760\u0761\u0762\u0763\u0764\u0765\u0766\u0767\u0768\u0769\u076A\u076B\u076C\u076D\u076E\u076F\u0770\u0771\u0772\u0773\u0774\u0775\u0776\u0777\u0778\u0779\u077A\u077B\u077C\u077D\u077E\u077F\u0780\u0781\u0782\u0783\u0784\u0785\u0786\u0787\u0788\u0789\u078A\u078B\u078C\u078D\u078E\u078F\u0790\u0791\u0792\u0793\u0794\u0795\u0796\u0797\u0798\u0799\u079A\u079B\u079C\u079D\u079E\u079F\u07A0\u07A1\u07A2\u07A3\u07A4\u07A5\u07B1\u07CA\u07CB\u07CC\u07CD\u07CE\u07CF\u07D0\u07D1\u07D2\u07D3\u07D4\u07D5\u07D6\u07D7\u07D8\u07D9\u07DA\u07DB\u07DC\u07DD\u07DE\u07DF\u07E0\u07E1\u07E2\u07E3\u07E4\u07E5\u07E6\u07E7\u07E8\u07E9\u07EA\u0904\u0905\u0906\u0907\u0908\u0909\u090A\u090B\u090C\u090D\u090E\u090F\u0910\u0911\u0912\u0913\u0914\u0915\u0916\u0917\u0918\u0919\u091A\u091B\u091C\u091D\u091E\u091F\u0920\u0921\u0922\u0923\u0924\u0925\u0926\u0927\u0928\u0929\u092A\u092B\u092C\u092D\u092E\u092F\u0930\u0931\u0932\u0933\u0934\u0935\u0936\u0937\u0938\u0939\u093D\u0950\u0958\u0959\u095A\u095B\u095C\u095D\u095E\u095F\u0960\u0961\u0972\u097B\u097C\u097D\u097E\u097F\u0985\u0986\u0987\u0988\u0989\u098A\u098B\u098C\u098F\u0990\u0993\u0994\u0995\u0996\u0997\u0998\u0999\u099A\u099B\u099C\u099D\u099E\u099F\u09A0\u09A1\u09A2\u09A3\u09A4\u09A5\u09A6\u09A7\u09A8\u09AA\u09AB\u09AC\u09AD\u09AE\u09AF\u09B0\u09B2\u09B6\u09B7\u09B8\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF\u09E0\u09E1\u09F0\u09F1\u0A05\u0A06\u0A07\u0A08\u0A09\u0A0A\u0A0F\u0A10\u0A13\u0A14\u0A15\u0A16\u0A17\u0A18\u0A19\u0A1A\u0A1B\u0A1C\u0A1D\u0A1E\u0A1F\u0A20\u0A21\u0A22\u0A23\u0A24\u0A25\u0A26\u0A27\u0A28\u0A2A\u0A2B\u0A2C\u0A2D\u0A2E\u0A2F\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59\u0A5A\u0A5B\u0A5C\u0A5E\u0A72\u0A73\u0A74\u0A85\u0A86\u0A87\u0A88\u0A89\u0A8A\u0A8B\u0A8C\u0A8D\u0A8F\u0A90\u0A91\u0A93\u0A94\u0A95\u0A96\u0A97\u0A98\u0A99\u0A9A\u0A9B\u0A9C\u0A9D\u0A9E\u0A9F\u0AA0\u0AA1\u0AA2\u0AA3\u0AA4\u0AA5\u0AA6\u0AA7\u0AA8\u0AAA\u0AAB\u0AAC\u0AAD\u0AAE\u0AAF\u0AB0\u0AB2\u0AB3\u0AB5\u0AB6\u0AB7\u0AB8\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0B05\u0B06\u0B07\u0B08\u0B09\u0B0A\u0B0B\u0B0C\u0B0F\u0B10\u0B13\u0B14\u0B15\u0B16\u0B17\u0B18\u0B19\u0B1A\u0B1B\u0B1C\u0B1D\u0B1E\u0B1F\u0B20\u0B21\u0B22\u0B23\u0B24\u0B25\u0B26\u0B27\u0B28\u0B2A\u0B2B\u0B2C\u0B2D\u0B2E\u0B2F\u0B30\u0B32\u0B33\u0B35\u0B36\u0B37\u0B38\u0B39\u0B3D\u0B5C\u0B5D\u0B5F\u0B60\u0B61\u0B71\u0B83\u0B85\u0B86\u0B87\u0B88\u0B89\u0B8A\u0B8E\u0B8F\u0B90\u0B92\u0B93\u0B94\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8\u0BA9\u0BAA\u0BAE\u0BAF\u0BB0\u0BB1\u0BB2\u0BB3\u0BB4\u0BB5\u0BB6\u0BB7\u0BB8\u0BB9\u0BD0\u0C05\u0C06\u0C07\u0C08\u0C09\u0C0A\u0C0B\u0C0C\u0C0E\u0C0F\u0C10\u0C12\u0C13\u0C14\u0C15\u0C16\u0C17\u0C18\u0C19\u0C1A\u0C1B\u0C1C\u0C1D\u0C1E\u0C1F\u0C20\u0C21\u0C22\u0C23\u0C24\u0C25\u0C26\u0C27\u0C28\u0C2A\u0C2B\u0C2C\u0C2D\u0C2E\u0C2F\u0C30\u0C31\u0C32\u0C33\u0C35\u0C36\u0C37\u0C38\u0C39\u0C3D\u0C58\u0C59\u0C60\u0C61\u0C85\u0C86\u0C87\u0C88\u0C89\u0C8A\u0C8B\u0C8C\u0C8E\u0C8F\u0C90\u0C92\u0C93\u0C94\u0C95\u0C96\u0C97\u0C98\u0C99\u0C9A\u0C9B\u0C9C\u0C9D\u0C9E\u0C9F\u0CA0\u0CA1\u0CA2\u0CA3\u0CA4\u0CA5\u0CA6\u0CA7\u0CA8\u0CAA\u0CAB\u0CAC\u0CAD\u0CAE\u0CAF\u0CB0\u0CB1\u0CB2\u0CB3\u0CB5\u0CB6\u0CB7\u0CB8\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0D05\u0D06\u0D07\u0D08\u0D09\u0D0A\u0D0B\u0D0C\u0D0E\u0D0F\u0D10\u0D12\u0D13\u0D14\u0D15\u0D16\u0D17\u0D18\u0D19\u0D1A\u0D1B\u0D1C\u0D1D\u0D1E\u0D1F\u0D20\u0D21\u0D22\u0D23\u0D24\u0D25\u0D26\u0D27\u0D28\u0D2A\u0D2B\u0D2C\u0D2D\u0D2E\u0D2F\u0D30\u0D31\u0D32\u0D33\u0D34\u0D35\u0D36\u0D37\u0D38\u0D39\u0D3D\u0D60\u0D61\u0D7A\u0D7B\u0D7C\u0D7D\u0D7E\u0D7F\u0D85\u0D86\u0D87\u0D88\u0D89\u0D8A\u0D8B\u0D8C\u0D8D\u0D8E\u0D8F\u0D90\u0D91\u0D92\u0D93\u0D94\u0D95\u0D96\u0D9A\u0D9B\u0D9C\u0D9D\u0D9E\u0D9F\u0DA0\u0DA1\u0DA2\u0DA3\u0DA4\u0DA5\u0DA6\u0DA7\u0DA8\u0DA9\u0DAA\u0DAB\u0DAC\u0DAD\u0DAE\u0DAF\u0DB0\u0DB1\u0DB3\u0DB4\u0DB5\u0DB6\u0DB7\u0DB8\u0DB9\u0DBA\u0DBB\u0DBD\u0DC0\u0DC1\u0DC2\u0DC3\u0DC4\u0DC5\u0DC6\u0E01\u0E02\u0E03\u0E04\u0E05\u0E06\u0E07\u0E08\u0E09\u0E0A\u0E0B\u0E0C\u0E0D\u0E0E\u0E0F\u0E10\u0E11\u0E12\u0E13\u0E14\u0E15\u0E16\u0E17\u0E18\u0E19\u0E1A\u0E1B\u0E1C\u0E1D\u0E1E\u0E1F\u0E20\u0E21\u0E22\u0E23\u0E24\u0E25\u0E26\u0E27\u0E28\u0E29\u0E2A\u0E2B\u0E2C\u0E2D\u0E2E\u0E2F\u0E30\u0E32\u0E33\u0E40\u0E41\u0E42\u0E43\u0E44\u0E45\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94\u0E95\u0E96\u0E97\u0E99\u0E9A\u0E9B\u0E9C\u0E9D\u0E9E\u0E9F\u0EA1\u0EA2\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD\u0EAE\u0EAF\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0\u0EC1\u0EC2\u0EC3\u0EC4\u0EDC\u0EDD\u0F00\u0F40\u0F41\u0F42\u0F43\u0F44\u0F45\u0F46\u0F47\u0F49\u0F4A\u0F4B\u0F4C\u0F4D\u0F4E\u0F4F\u0F50\u0F51\u0F52\u0F53\u0F54\u0F55\u0F56\u0F57\u0F58\u0F59\u0F5A\u0F5B\u0F5C\u0F5D\u0F5E\u0F5F\u0F60\u0F61\u0F62\u0F63\u0F64\u0F65\u0F66\u0F67\u0F68\u0F69\u0F6A\u0F6B\u0F6C\u0F88\u0F89\u0F8A\u0F8B\u1000\u1001\u1002\u1003\u1004\u1005\u1006\u1007\u1008\u1009\u100A\u100B\u100C\u100D\u100E\u100F\u1010\u1011\u1012\u1013\u1014\u1015\u1016\u1017\u1018\u1019\u101A\u101B\u101C\u101D\u101E\u101F\u1020\u1021\u1022\u1023\u1024\u1025\u1026\u1027\u1028\u1029\u102A\u103F\u1050\u1051\u1052\u1053\u1054\u1055\u105A\u105B\u105C\u105D\u1061\u1065\u1066\u106E\u106F\u1070\u1075\u1076\u1077\u1078\u1079\u107A\u107B\u107C\u107D\u107E\u107F\u1080\u1081\u108E\u10D0\u10D1\u10D2\u10D3\u10D4\u10D5\u10D6\u10D7\u10D8\u10D9\u10DA\u10DB\u10DC\u10DD\u10DE\u10DF\u10E0\u10E1\u10E2\u10E3\u10E4\u10E5\u10E6\u10E7\u10E8\u10E9\u10EA\u10EB\u10EC\u10ED\u10EE\u10EF\u10F0\u10F1\u10F2\u10F3\u10F4\u10F5\u10F6\u10F7\u10F8\u10F9\u10FA\u1100\u1101\u1102\u1103\u1104\u1105\u1106\u1107\u1108\u1109\u110A\u110B\u110C\u110D\u110E\u110F\u1110\u1111\u1112\u1113\u1114\u1115\u1116\u1117\u1118\u1119\u111A\u111B\u111C\u111D\u111E\u111F\u1120\u1121\u1122\u1123\u1124\u1125\u1126\u1127\u1128\u1129\u112A\u112B\u112C\u112D\u112E\u112F\u1130\u1131\u1132\u1133\u1134\u1135\u1136\u1137\u1138\u1139\u113A\u113B\u113C\u113D\u113E\u113F\u1140\u1141\u1142\u1143\u1144\u1145\u1146\u1147\u1148\u1149\u114A\u114B\u114C\u114D\u114E\u114F\u1150\u1151\u1152\u1153\u1154\u1155\u1156\u1157\u1158\u1159\u115F\u1160\u1161\u1162\u1163\u1164\u1165\u1166\u1167\u1168\u1169\u116A\u116B\u116C\u116D\u116E\u116F\u1170\u1171\u1172\u1173\u1174\u1175\u1176\u1177\u1178\u1179\u117A\u117B\u117C\u117D\u117E\u117F\u1180\u1181\u1182\u1183\u1184\u1185\u1186\u1187\u1188\u1189\u118A\u118B\u118C\u118D\u118E\u118F\u1190\u1191\u1192\u1193\u1194\u1195\u1196\u1197\u1198\u1199\u119A\u119B\u119C\u119D\u119E\u119F\u11A0\u11A1\u11A2\u11A8\u11A9\u11AA\u11AB\u11AC\u11AD\u11AE\u11AF\u11B0\u11B1\u11B2\u11B3\u11B4\u11B5\u11B6\u11B7\u11B8\u11B9\u11BA\u11BB\u11BC\u11BD\u11BE\u11BF\u11C0\u11C1\u11C2\u11C3\u11C4\u11C5\u11C6\u11C7\u11C8\u11C9\u11CA\u11CB\u11CC\u11CD\u11CE\u11CF\u11D0\u11D1\u11D2\u11D3\u11D4\u11D5\u11D6\u11D7\u11D8\u11D9\u11DA\u11DB\u11DC\u11DD\u11DE\u11DF\u11E0\u11E1\u11E2\u11E3\u11E4\u11E5\u11E6\u11E7\u11E8\u11E9\u11EA\u11EB\u11EC\u11ED\u11EE\u11EF\u11F0\u11F1\u11F2\u11F3\u11F4\u11F5\u11F6\u11F7\u11F8\u11F9\u1200\u1201\u1202\u1203\u1204\u1205\u1206\u1207\u1208\u1209\u120A\u120B\u120C\u120D\u120E\u120F\u1210\u1211\u1212\u1213\u1214\u1215\u1216\u1217\u1218\u1219\u121A\u121B\u121C\u121D\u121E\u121F\u1220\u1221\u1222\u1223\u1224\u1225\u1226\u1227\u1228\u1229\u122A\u122B\u122C\u122D\u122E\u122F\u1230\u1231\u1232\u1233\u1234\u1235\u1236\u1237\u1238\u1239\u123A\u123B\u123C\u123D\u123E\u123F\u1240\u1241\u1242\u1243\u1244\u1245\u1246\u1247\u1248\u124A\u124B\u124C\u124D\u1250\u1251\u1252\u1253\u1254\u1255\u1256\u1258\u125A\u125B\u125C\u125D\u1260\u1261\u1262\u1263\u1264\u1265\u1266\u1267\u1268\u1269\u126A\u126B\u126C\u126D\u126E\u126F\u1270\u1271\u1272\u1273\u1274\u1275\u1276\u1277\u1278\u1279\u127A\u127B\u127C\u127D\u127E\u127F\u1280\u1281\u1282\u1283\u1284\u1285\u1286\u1287\u1288\u128A\u128B\u128C\u128D\u1290\u1291\u1292\u1293\u1294\u1295\u1296\u1297\u1298\u1299\u129A\u129B\u129C\u129D\u129E\u129F\u12A0\u12A1\u12A2\u12A3\u12A4\u12A5\u12A6\u12A7\u12A8\u12A9\u12AA\u12AB\u12AC\u12AD\u12AE\u12AF\u12B0\u12B2\u12B3\u12B4\u12B5\u12B8\u12B9\u12BA\u12BB\u12BC\u12BD\u12BE\u12C0\u12C2\u12C3\u12C4\u12C5\u12C8\u12C9\u12CA\u12CB\u12CC\u12CD\u12CE\u12CF\u12D0\u12D1\u12D2\u12D3\u12D4\u12D5\u12D6\u12D8\u12D9\u12DA\u12DB\u12DC\u12DD\u12DE\u12DF\u12E0\u12E1\u12E2\u12E3\u12E4\u12E5\u12E6\u12E7\u12E8\u12E9\u12EA\u12EB\u12EC\u12ED\u12EE\u12EF\u12F0\u12F1\u12F2\u12F3\u12F4\u12F5\u12F6\u12F7\u12F8\u12F9\u12FA\u12FB\u12FC\u12FD\u12FE\u12FF\u1300\u1301\u1302\u1303\u1304\u1305\u1306\u1307\u1308\u1309\u130A\u130B\u130C\u130D\u130E\u130F\u1310\u1312\u1313\u1314\u1315\u1318\u1319\u131A\u131B\u131C\u131D\u131E\u131F\u1320\u1321\u1322\u1323\u1324\u1325\u1326\u1327\u1328\u1329\u132A\u132B\u132C\u132D\u132E\u132F\u1330\u1331\u1332\u1333\u1334\u1335\u1336\u1337\u1338\u1339\u133A\u133B\u133C\u133D\u133E\u133F\u1340\u1341\u1342\u1343\u1344\u1345\u1346\u1347\u1348\u1349\u134A\u134B\u134C\u134D\u134E\u134F\u1350\u1351\u1352\u1353\u1354\u1355\u1356\u1357\u1358\u1359\u135A\u1380\u1381\u1382\u1383\u1384\u1385\u1386\u1387\u1388\u1389\u138A\u138B\u138C\u138D\u138E\u138F\u13A0\u13A1\u13A2\u13A3\u13A4\u13A5\u13A6\u13A7\u13A8\u13A9\u13AA\u13AB\u13AC\u13AD\u13AE\u13AF\u13B0\u13B1\u13B2\u13B3\u13B4\u13B5\u13B6\u13B7\u13B8\u13B9\u13BA\u13BB\u13BC\u13BD\u13BE\u13BF\u13C0\u13C1\u13C2\u13C3\u13C4\u13C5\u13C6\u13C7\u13C8\u13C9\u13CA\u13CB\u13CC\u13CD\u13CE\u13CF\u13D0\u13D1\u13D2\u13D3\u13D4\u13D5\u13D6\u13D7\u13D8\u13D9\u13DA\u13DB\u13DC\u13DD\u13DE\u13DF\u13E0\u13E1\u13E2\u13E3\u13E4\u13E5\u13E6\u13E7\u13E8\u13E9\u13EA\u13EB\u13EC\u13ED\u13EE\u13EF\u13F0\u13F1\u13F2\u13F3\u13F4\u1401\u1402\u1403\u1404\u1405\u1406\u1407\u1408\u1409\u140A\u140B\u140C\u140D\u140E\u140F\u1410\u1411\u1412\u1413\u1414\u1415\u1416\u1417\u1418\u1419\u141A\u141B\u141C\u141D\u141E\u141F\u1420\u1421\u1422\u1423\u1424\u1425\u1426\u1427\u1428\u1429\u142A\u142B\u142C\u142D\u142E\u142F\u1430\u1431\u1432\u1433\u1434\u1435\u1436\u1437\u1438\u1439\u143A\u143B\u143C\u143D\u143E\u143F\u1440\u1441\u1442\u1443\u1444\u1445\u1446\u1447\u1448\u1449\u144A\u144B\u144C\u144D\u144E\u144F\u1450\u1451\u1452\u1453\u1454\u1455\u1456\u1457\u1458\u1459\u145A\u145B\u145C\u145D\u145E\u145F\u1460\u1461\u1462\u1463\u1464\u1465\u1466\u1467\u1468\u1469\u146A\u146B\u146C\u146D\u146E\u146F\u1470\u1471\u1472\u1473\u1474\u1475\u1476\u1477\u1478\u1479\u147A\u147B\u147C\u147D\u147E\u147F\u1480\u1481\u1482\u1483\u1484\u1485\u1486\u1487\u1488\u1489\u148A\u148B\u148C\u148D\u148E\u148F\u1490\u1491\u1492\u1493\u1494\u1495\u1496\u1497\u1498\u1499\u149A\u149B\u149C\u149D\u149E\u149F\u14A0\u14A1\u14A2\u14A3\u14A4\u14A5\u14A6\u14A7\u14A8\u14A9\u14AA\u14AB\u14AC\u14AD\u14AE\u14AF\u14B0\u14B1\u14B2\u14B3\u14B4\u14B5\u14B6\u14B7\u14B8\u14B9\u14BA\u14BB\u14BC\u14BD\u14BE\u14BF\u14C0\u14C1\u14C2\u14C3\u14C4\u14C5\u14C6\u14C7\u14C8\u14C9\u14CA\u14CB\u14CC\u14CD\u14CE\u14CF\u14D0\u14D1\u14D2\u14D3\u14D4\u14D5\u14D6\u14D7\u14D8\u14D9\u14DA\u14DB\u14DC\u14DD\u14DE\u14DF\u14E0\u14E1\u14E2\u14E3\u14E4\u14E5\u14E6\u14E7\u14E8\u14E9\u14EA\u14EB\u14EC\u14ED\u14EE\u14EF\u14F0\u14F1\u14F2\u14F3\u14F4\u14F5\u14F6\u14F7\u14F8\u14F9\u14FA\u14FB\u14FC\u14FD\u14FE\u14FF\u1500\u1501\u1502\u1503\u1504\u1505\u1506\u1507\u1508\u1509\u150A\u150B\u150C\u150D\u150E\u150F\u1510\u1511\u1512\u1513\u1514\u1515\u1516\u1517\u1518\u1519\u151A\u151B\u151C\u151D\u151E\u151F\u1520\u1521\u1522\u1523\u1524\u1525\u1526\u1527\u1528\u1529\u152A\u152B\u152C\u152D\u152E\u152F\u1530\u1531\u1532\u1533\u1534\u1535\u1536\u1537\u1538\u1539\u153A\u153B\u153C\u153D\u153E\u153F\u1540\u1541\u1542\u1543\u1544\u1545\u1546\u1547\u1548\u1549\u154A\u154B\u154C\u154D\u154E\u154F\u1550\u1551\u1552\u1553\u1554\u1555\u1556\u1557\u1558\u1559\u155A\u155B\u155C\u155D\u155E\u155F\u1560\u1561\u1562\u1563\u1564\u1565\u1566\u1567\u1568\u1569\u156A\u156B\u156C\u156D\u156E\u156F\u1570\u1571\u1572\u1573\u1574\u1575\u1576\u1577\u1578\u1579\u157A\u157B\u157C\u157D\u157E\u157F\u1580\u1581\u1582\u1583\u1584\u1585\u1586\u1587\u1588\u1589\u158A\u158B\u158C\u158D\u158E\u158F\u1590\u1591\u1592\u1593\u1594\u1595\u1596\u1597\u1598\u1599\u159A\u159B\u159C\u159D\u159E\u159F\u15A0\u15A1\u15A2\u15A3\u15A4\u15A5\u15A6\u15A7\u15A8\u15A9\u15AA\u15AB\u15AC\u15AD\u15AE\u15AF\u15B0\u15B1\u15B2\u15B3\u15B4\u15B5\u15B6\u15B7\u15B8\u15B9\u15BA\u15BB\u15BC\u15BD\u15BE\u15BF\u15C0\u15C1\u15C2\u15C3\u15C4\u15C5\u15C6\u15C7\u15C8\u15C9\u15CA\u15CB\u15CC\u15CD\u15CE\u15CF\u15D0\u15D1\u15D2\u15D3\u15D4\u15D5\u15D6\u15D7\u15D8\u15D9\u15DA\u15DB\u15DC\u15DD\u15DE\u15DF\u15E0\u15E1\u15E2\u15E3\u15E4\u15E5\u15E6\u15E7\u15E8\u15E9\u15EA\u15EB\u15EC\u15ED\u15EE\u15EF\u15F0\u15F1\u15F2\u15F3\u15F4\u15F5\u15F6\u15F7\u15F8\u15F9\u15FA\u15FB\u15FC\u15FD\u15FE\u15FF\u1600\u1601\u1602\u1603\u1604\u1605\u1606\u1607\u1608\u1609\u160A\u160B\u160C\u160D\u160E\u160F\u1610\u1611\u1612\u1613\u1614\u1615\u1616\u1617\u1618\u1619\u161A\u161B\u161C\u161D\u161E\u161F\u1620\u1621\u1622\u1623\u1624\u1625\u1626\u1627\u1628\u1629\u162A\u162B\u162C\u162D\u162E\u162F\u1630\u1631\u1632\u1633\u1634\u1635\u1636\u1637\u1638\u1639\u163A\u163B\u163C\u163D\u163E\u163F\u1640\u1641\u1642\u1643\u1644\u1645\u1646\u1647\u1648\u1649\u164A\u164B\u164C\u164D\u164E\u164F\u1650\u1651\u1652\u1653\u1654\u1655\u1656\u1657\u1658\u1659\u165A\u165B\u165C\u165D\u165E\u165F\u1660\u1661\u1662\u1663\u1664\u1665\u1666\u1667\u1668\u1669\u166A\u166B\u166C\u166F\u1670\u1671\u1672\u1673\u1674\u1675\u1676\u1681\u1682\u1683\u1684\u1685\u1686\u1687\u1688\u1689\u168A\u168B\u168C\u168D\u168E\u168F\u1690\u1691\u1692\u1693\u1694\u1695\u1696\u1697\u1698\u1699\u169A\u16A0\u16A1\u16A2\u16A3\u16A4\u16A5\u16A6\u16A7\u16A8\u16A9\u16AA\u16AB\u16AC\u16AD\u16AE\u16AF\u16B0\u16B1\u16B2\u16B3\u16B4\u16B5\u16B6\u16B7\u16B8\u16B9\u16BA\u16BB\u16BC\u16BD\u16BE\u16BF\u16C0\u16C1\u16C2\u16C3\u16C4\u16C5\u16C6\u16C7\u16C8\u16C9\u16CA\u16CB\u16CC\u16CD\u16CE\u16CF\u16D0\u16D1\u16D2\u16D3\u16D4\u16D5\u16D6\u16D7\u16D8\u16D9\u16DA\u16DB\u16DC\u16DD\u16DE\u16DF\u16E0\u16E1\u16E2\u16E3\u16E4\u16E5\u16E6\u16E7\u16E8\u16E9\u16EA\u1700\u1701\u1702\u1703\u1704\u1705\u1706\u1707\u1708\u1709\u170A\u170B\u170C\u170E\u170F\u1710\u1711\u1720\u1721\u1722\u1723\u1724\u1725\u1726\u1727\u1728\u1729\u172A\u172B\u172C\u172D\u172E\u172F\u1730\u1731\u1740\u1741\u1742\u1743\u1744\u1745\u1746\u1747\u1748\u1749\u174A\u174B\u174C\u174D\u174E\u174F\u1750\u1751\u1760\u1761\u1762\u1763\u1764\u1765\u1766\u1767\u1768\u1769\u176A\u176B\u176C\u176E\u176F\u1770\u1780\u1781\u1782\u1783\u1784\u1785\u1786\u1787\u1788\u1789\u178A\u178B\u178C\u178D\u178E\u178F\u1790\u1791\u1792\u1793\u1794\u1795\u1796\u1797\u1798\u1799\u179A\u179B\u179C\u179D\u179E\u179F\u17A0\u17A1\u17A2\u17A3\u17A4\u17A5\u17A6\u17A7\u17A8\u17A9\u17AA\u17AB\u17AC\u17AD\u17AE\u17AF\u17B0\u17B1\u17B2\u17B3\u17DC\u1820\u1821\u1822\u1823\u1824\u1825\u1826\u1827\u1828\u1829\u182A\u182B\u182C\u182D\u182E\u182F\u1830\u1831\u1832\u1833\u1834\u1835\u1836\u1837\u1838\u1839\u183A\u183B\u183C\u183D\u183E\u183F\u1840\u1841\u1842\u1844\u1845\u1846\u1847\u1848\u1849\u184A\u184B\u184C\u184D\u184E\u184F\u1850\u1851\u1852\u1853\u1854\u1855\u1856\u1857\u1858\u1859\u185A\u185B\u185C\u185D\u185E\u185F\u1860\u1861\u1862\u1863\u1864\u1865\u1866\u1867\u1868\u1869\u186A\u186B\u186C\u186D\u186E\u186F\u1870\u1871\u1872\u1873\u1874\u1875\u1876\u1877\u1880\u1881\u1882\u1883\u1884\u1885\u1886\u1887\u1888\u1889\u188A\u188B\u188C\u188D\u188E\u188F\u1890\u1891\u1892\u1893\u1894\u1895\u1896\u1897\u1898\u1899\u189A\u189B\u189C\u189D\u189E\u189F\u18A0\u18A1\u18A2\u18A3\u18A4\u18A5\u18A6\u18A7\u18A8\u18AA\u1900\u1901\u1902\u1903\u1904\u1905\u1906\u1907\u1908\u1909\u190A\u190B\u190C\u190D\u190E\u190F\u1910\u1911\u1912\u1913\u1914\u1915\u1916\u1917\u1918\u1919\u191A\u191B\u191C\u1950\u1951\u1952\u1953\u1954\u1955\u1956\u1957\u1958\u1959\u195A\u195B\u195C\u195D\u195E\u195F\u1960\u1961\u1962\u1963\u1964\u1965\u1966\u1967\u1968\u1969\u196A\u196B\u196C\u196D\u1970\u1971\u1972\u1973\u1974\u1980\u1981\u1982\u1983\u1984\u1985\u1986\u1987\u1988\u1989\u198A\u198B\u198C\u198D\u198E\u198F\u1990\u1991\u1992\u1993\u1994\u1995\u1996\u1997\u1998\u1999\u199A\u199B\u199C\u199D\u199E\u199F\u19A0\u19A1\u19A2\u19A3\u19A4\u19A5\u19A6\u19A7\u19A8\u19A9\u19C1\u19C2\u19C3\u19C4\u19C5\u19C6\u19C7\u1A00\u1A01\u1A02\u1A03\u1A04\u1A05\u1A06\u1A07\u1A08\u1A09\u1A0A\u1A0B\u1A0C\u1A0D\u1A0E\u1A0F\u1A10\u1A11\u1A12\u1A13\u1A14\u1A15\u1A16\u1B05\u1B06\u1B07\u1B08\u1B09\u1B0A\u1B0B\u1B0C\u1B0D\u1B0E\u1B0F\u1B10\u1B11\u1B12\u1B13\u1B14\u1B15\u1B16\u1B17\u1B18\u1B19\u1B1A\u1B1B\u1B1C\u1B1D\u1B1E\u1B1F\u1B20\u1B21\u1B22\u1B23\u1B24\u1B25\u1B26\u1B27\u1B28\u1B29\u1B2A\u1B2B\u1B2C\u1B2D\u1B2E\u1B2F\u1B30\u1B31\u1B32\u1B33\u1B45\u1B46\u1B47\u1B48\u1B49\u1B4A\u1B4B\u1B83\u1B84\u1B85\u1B86\u1B87\u1B88\u1B89\u1B8A\u1B8B\u1B8C\u1B8D\u1B8E\u1B8F\u1B90\u1B91\u1B92\u1B93\u1B94\u1B95\u1B96\u1B97\u1B98\u1B99\u1B9A\u1B9B\u1B9C\u1B9D\u1B9E\u1B9F\u1BA0\u1BAE\u1BAF\u1C00\u1C01\u1C02\u1C03\u1C04\u1C05\u1C06\u1C07\u1C08\u1C09\u1C0A\u1C0B\u1C0C\u1C0D\u1C0E\u1C0F\u1C10\u1C11\u1C12\u1C13\u1C14\u1C15\u1C16\u1C17\u1C18\u1C19\u1C1A\u1C1B\u1C1C\u1C1D\u1C1E\u1C1F\u1C20\u1C21\u1C22\u1C23\u1C4D\u1C4E\u1C4F\u1C5A\u1C5B\u1C5C\u1C5D\u1C5E\u1C5F\u1C60\u1C61\u1C62\u1C63\u1C64\u1C65\u1C66\u1C67\u1C68\u1C69\u1C6A\u1C6B\u1C6C\u1C6D\u1C6E\u1C6F\u1C70\u1C71\u1C72\u1C73\u1C74\u1C75\u1C76\u1C77\u2135\u2136\u2137\u2138\u2D30\u2D31\u2D32\u2D33\u2D34\u2D35\u2D36\u2D37\u2D38\u2D39\u2D3A\u2D3B\u2D3C\u2D3D\u2D3E\u2D3F\u2D40\u2D41\u2D42\u2D43\u2D44\u2D45\u2D46\u2D47\u2D48\u2D49\u2D4A\u2D4B\u2D4C\u2D4D\u2D4E\u2D4F\u2D50\u2D51\u2D52\u2D53\u2D54\u2D55\u2D56\u2D57\u2D58\u2D59\u2D5A\u2D5B\u2D5C\u2D5D\u2D5E\u2D5F\u2D60\u2D61\u2D62\u2D63\u2D64\u2D65\u2D80\u2D81\u2D82\u2D83\u2D84\u2D85\u2D86\u2D87\u2D88\u2D89\u2D8A\u2D8B\u2D8C\u2D8D\u2D8E\u2D8F\u2D90\u2D91\u2D92\u2D93\u2D94\u2D95\u2D96\u2DA0\u2DA1\u2DA2\u2DA3\u2DA4\u2DA5\u2DA6\u2DA8\u2DA9\u2DAA\u2DAB\u2DAC\u2DAD\u2DAE\u2DB0\u2DB1\u2DB2\u2DB3\u2DB4\u2DB5\u2DB6\u2DB8\u2DB9\u2DBA\u2DBB\u2DBC\u2DBD\u2DBE\u2DC0\u2DC1\u2DC2\u2DC3\u2DC4\u2DC5\u2DC6\u2DC8\u2DC9\u2DCA\u2DCB\u2DCC\u2DCD\u2DCE\u2DD0\u2DD1\u2DD2\u2DD3\u2DD4\u2DD5\u2DD6\u2DD8\u2DD9\u2DDA\u2DDB\u2DDC\u2DDD\u2DDE\u3006\u303C\u3041\u3042\u3043\u3044\u3045\u3046\u3047\u3048\u3049\u304A\u304B\u304C\u304D\u304E\u304F\u3050\u3051\u3052\u3053\u3054\u3055\u3056\u3057\u3058\u3059\u305A\u305B\u305C\u305D\u305E\u305F\u3060\u3061\u3062\u3063\u3064\u3065\u3066\u3067\u3068\u3069\u306A\u306B\u306C\u306D\u306E\u306F\u3070\u3071\u3072\u3073\u3074\u3075\u3076\u3077\u3078\u3079\u307A\u307B\u307C\u307D\u307E\u307F\u3080\u3081\u3082\u3083\u3084\u3085\u3086\u3087\u3088\u3089\u308A\u308B\u308C\u308D\u308E\u308F\u3090\u3091\u3092\u3093\u3094\u3095\u3096\u309F\u30A1\u30A2\u30A3\u30A4\u30A5\u30A6\u30A7\u30A8\u30A9\u30AA\u30AB\u30AC\u30AD\u30AE\u30AF\u30B0\u30B1\u30B2\u30B3\u30B4\u30B5\u30B6\u30B7\u30B8\u30B9\u30BA\u30BB\u30BC\u30BD\u30BE\u30BF\u30C0\u30C1\u30C2\u30C3\u30C4\u30C5\u30C6\u30C7\u30C8\u30C9\u30CA\u30CB\u30CC\u30CD\u30CE\u30CF\u30D0\u30D1\u30D2\u30D3\u30D4\u30D5\u30D6\u30D7\u30D8\u30D9\u30DA\u30DB\u30DC\u30DD\u30DE\u30DF\u30E0\u30E1\u30E2\u30E3\u30E4\u30E5\u30E6\u30E7\u30E8\u30E9\u30EA\u30EB\u30EC\u30ED\u30EE\u30EF\u30F0\u30F1\u30F2\u30F3\u30F4\u30F5\u30F6\u30F7\u30F8\u30F9\u30FA\u30FF\u3105\u3106\u3107\u3108\u3109\u310A\u310B\u310C\u310D\u310E\u310F\u3110\u3111\u3112\u3113\u3114\u3115\u3116\u3117\u3118\u3119\u311A\u311B\u311C\u311D\u311E\u311F\u3120\u3121\u3122\u3123\u3124\u3125\u3126\u3127\u3128\u3129\u312A\u312B\u312C\u312D\u3131\u3132\u3133\u3134\u3135\u3136\u3137\u3138\u3139\u313A\u313B\u313C\u313D\u313E\u313F\u3140\u3141\u3142\u3143\u3144\u3145\u3146\u3147\u3148\u3149\u314A\u314B\u314C\u314D\u314E\u314F\u3150\u3151\u3152\u3153\u3154\u3155\u3156\u3157\u3158\u3159\u315A\u315B\u315C\u315D\u315E\u315F\u3160\u3161\u3162\u3163\u3164\u3165\u3166\u3167\u3168\u3169\u316A\u316B\u316C\u316D\u316E\u316F\u3170\u3171\u3172\u3173\u3174\u3175\u3176\u3177\u3178\u3179\u317A\u317B\u317C\u317D\u317E\u317F\u3180\u3181\u3182\u3183\u3184\u3185\u3186\u3187\u3188\u3189\u318A\u318B\u318C\u318D\u318E\u31A0\u31A1\u31A2\u31A3\u31A4\u31A5\u31A6\u31A7\u31A8\u31A9\u31AA\u31AB\u31AC\u31AD\u31AE\u31AF\u31B0\u31B1\u31B2\u31B3\u31B4\u31B5\u31B6\u31B7\u31F0\u31F1\u31F2\u31F3\u31F4\u31F5\u31F6\u31F7\u31F8\u31F9\u31FA\u31FB\u31FC\u31FD\u31FE\u31FF\u3400\u4DB5\u4E00\u9FC3\uA000\uA001\uA002\uA003\uA004\uA005\uA006\uA007\uA008\uA009\uA00A\uA00B\uA00C\uA00D\uA00E\uA00F\uA010\uA011\uA012\uA013\uA014\uA016\uA017\uA018\uA019\uA01A\uA01B\uA01C\uA01D\uA01E\uA01F\uA020\uA021\uA022\uA023\uA024\uA025\uA026\uA027\uA028\uA029\uA02A\uA02B\uA02C\uA02D\uA02E\uA02F\uA030\uA031\uA032\uA033\uA034\uA035\uA036\uA037\uA038\uA039\uA03A\uA03B\uA03C\uA03D\uA03E\uA03F\uA040\uA041\uA042\uA043\uA044\uA045\uA046\uA047\uA048\uA049\uA04A\uA04B\uA04C\uA04D\uA04E\uA04F\uA050\uA051\uA052\uA053\uA054\uA055\uA056\uA057\uA058\uA059\uA05A\uA05B\uA05C\uA05D\uA05E\uA05F\uA060\uA061\uA062\uA063\uA064\uA065\uA066\uA067\uA068\uA069\uA06A\uA06B\uA06C\uA06D\uA06E\uA06F\uA070\uA071\uA072\uA073\uA074\uA075\uA076\uA077\uA078\uA079\uA07A\uA07B\uA07C\uA07D\uA07E\uA07F\uA080\uA081\uA082\uA083\uA084\uA085\uA086\uA087\uA088\uA089\uA08A\uA08B\uA08C\uA08D\uA08E\uA08F\uA090\uA091\uA092\uA093\uA094\uA095\uA096\uA097\uA098\uA099\uA09A\uA09B\uA09C\uA09D\uA09E\uA09F\uA0A0\uA0A1\uA0A2\uA0A3\uA0A4\uA0A5\uA0A6\uA0A7\uA0A8\uA0A9\uA0AA\uA0AB\uA0AC\uA0AD\uA0AE\uA0AF\uA0B0\uA0B1\uA0B2\uA0B3\uA0B4\uA0B5\uA0B6\uA0B7\uA0B8\uA0B9\uA0BA\uA0BB\uA0BC\uA0BD\uA0BE\uA0BF\uA0C0\uA0C1\uA0C2\uA0C3\uA0C4\uA0C5\uA0C6\uA0C7\uA0C8\uA0C9\uA0CA\uA0CB\uA0CC\uA0CD\uA0CE\uA0CF\uA0D0\uA0D1\uA0D2\uA0D3\uA0D4\uA0D5\uA0D6\uA0D7\uA0D8\uA0D9\uA0DA\uA0DB\uA0DC\uA0DD\uA0DE\uA0DF\uA0E0\uA0E1\uA0E2\uA0E3\uA0E4\uA0E5\uA0E6\uA0E7\uA0E8\uA0E9\uA0EA\uA0EB\uA0EC\uA0ED\uA0EE\uA0EF\uA0F0\uA0F1\uA0F2\uA0F3\uA0F4\uA0F5\uA0F6\uA0F7\uA0F8\uA0F9\uA0FA\uA0FB\uA0FC\uA0FD\uA0FE\uA0FF\uA100\uA101\uA102\uA103\uA104\uA105\uA106\uA107\uA108\uA109\uA10A\uA10B\uA10C\uA10D\uA10E\uA10F\uA110\uA111\uA112\uA113\uA114\uA115\uA116\uA117\uA118\uA119\uA11A\uA11B\uA11C\uA11D\uA11E\uA11F\uA120\uA121\uA122\uA123\uA124\uA125\uA126\uA127\uA128\uA129\uA12A\uA12B\uA12C\uA12D\uA12E\uA12F\uA130\uA131\uA132\uA133\uA134\uA135\uA136\uA137\uA138\uA139\uA13A\uA13B\uA13C\uA13D\uA13E\uA13F\uA140\uA141\uA142\uA143\uA144\uA145\uA146\uA147\uA148\uA149\uA14A\uA14B\uA14C\uA14D\uA14E\uA14F\uA150\uA151\uA152\uA153\uA154\uA155\uA156\uA157\uA158\uA159\uA15A\uA15B\uA15C\uA15D\uA15E\uA15F\uA160\uA161\uA162\uA163\uA164\uA165\uA166\uA167\uA168\uA169\uA16A\uA16B\uA16C\uA16D\uA16E\uA16F\uA170\uA171\uA172\uA173\uA174\uA175\uA176\uA177\uA178\uA179\uA17A\uA17B\uA17C\uA17D\uA17E\uA17F\uA180\uA181\uA182\uA183\uA184\uA185\uA186\uA187\uA188\uA189\uA18A\uA18B\uA18C\uA18D\uA18E\uA18F\uA190\uA191\uA192\uA193\uA194\uA195\uA196\uA197\uA198\uA199\uA19A\uA19B\uA19C\uA19D\uA19E\uA19F\uA1A0\uA1A1\uA1A2\uA1A3\uA1A4\uA1A5\uA1A6\uA1A7\uA1A8\uA1A9\uA1AA\uA1AB\uA1AC\uA1AD\uA1AE\uA1AF]/, + peg$c258 = "[\\u01BB\\u01C0\\u01C1\\u01C2\\u01C3\\u0294\\u05D0\\u05D1\\u05D2\\u05D3\\u05D4\\u05D5\\u05D6\\u05D7\\u05D8\\u05D9\\u05DA\\u05DB\\u05DC\\u05DD\\u05DE\\u05DF\\u05E0\\u05E1\\u05E2\\u05E3\\u05E4\\u05E5\\u05E6\\u05E7\\u05E8\\u05E9\\u05EA\\u05F0\\u05F1\\u05F2\\u0621\\u0622\\u0623\\u0624\\u0625\\u0626\\u0627\\u0628\\u0629\\u062A\\u062B\\u062C\\u062D\\u062E\\u062F\\u0630\\u0631\\u0632\\u0633\\u0634\\u0635\\u0636\\u0637\\u0638\\u0639\\u063A\\u063B\\u063C\\u063D\\u063E\\u063F\\u0641\\u0642\\u0643\\u0644\\u0645\\u0646\\u0647\\u0648\\u0649\\u064A\\u066E\\u066F\\u0671\\u0672\\u0673\\u0674\\u0675\\u0676\\u0677\\u0678\\u0679\\u067A\\u067B\\u067C\\u067D\\u067E\\u067F\\u0680\\u0681\\u0682\\u0683\\u0684\\u0685\\u0686\\u0687\\u0688\\u0689\\u068A\\u068B\\u068C\\u068D\\u068E\\u068F\\u0690\\u0691\\u0692\\u0693\\u0694\\u0695\\u0696\\u0697\\u0698\\u0699\\u069A\\u069B\\u069C\\u069D\\u069E\\u069F\\u06A0\\u06A1\\u06A2\\u06A3\\u06A4\\u06A5\\u06A6\\u06A7\\u06A8\\u06A9\\u06AA\\u06AB\\u06AC\\u06AD\\u06AE\\u06AF\\u06B0\\u06B1\\u06B2\\u06B3\\u06B4\\u06B5\\u06B6\\u06B7\\u06B8\\u06B9\\u06BA\\u06BB\\u06BC\\u06BD\\u06BE\\u06BF\\u06C0\\u06C1\\u06C2\\u06C3\\u06C4\\u06C5\\u06C6\\u06C7\\u06C8\\u06C9\\u06CA\\u06CB\\u06CC\\u06CD\\u06CE\\u06CF\\u06D0\\u06D1\\u06D2\\u06D3\\u06D5\\u06EE\\u06EF\\u06FA\\u06FB\\u06FC\\u06FF\\u0710\\u0712\\u0713\\u0714\\u0715\\u0716\\u0717\\u0718\\u0719\\u071A\\u071B\\u071C\\u071D\\u071E\\u071F\\u0720\\u0721\\u0722\\u0723\\u0724\\u0725\\u0726\\u0727\\u0728\\u0729\\u072A\\u072B\\u072C\\u072D\\u072E\\u072F\\u074D\\u074E\\u074F\\u0750\\u0751\\u0752\\u0753\\u0754\\u0755\\u0756\\u0757\\u0758\\u0759\\u075A\\u075B\\u075C\\u075D\\u075E\\u075F\\u0760\\u0761\\u0762\\u0763\\u0764\\u0765\\u0766\\u0767\\u0768\\u0769\\u076A\\u076B\\u076C\\u076D\\u076E\\u076F\\u0770\\u0771\\u0772\\u0773\\u0774\\u0775\\u0776\\u0777\\u0778\\u0779\\u077A\\u077B\\u077C\\u077D\\u077E\\u077F\\u0780\\u0781\\u0782\\u0783\\u0784\\u0785\\u0786\\u0787\\u0788\\u0789\\u078A\\u078B\\u078C\\u078D\\u078E\\u078F\\u0790\\u0791\\u0792\\u0793\\u0794\\u0795\\u0796\\u0797\\u0798\\u0799\\u079A\\u079B\\u079C\\u079D\\u079E\\u079F\\u07A0\\u07A1\\u07A2\\u07A3\\u07A4\\u07A5\\u07B1\\u07CA\\u07CB\\u07CC\\u07CD\\u07CE\\u07CF\\u07D0\\u07D1\\u07D2\\u07D3\\u07D4\\u07D5\\u07D6\\u07D7\\u07D8\\u07D9\\u07DA\\u07DB\\u07DC\\u07DD\\u07DE\\u07DF\\u07E0\\u07E1\\u07E2\\u07E3\\u07E4\\u07E5\\u07E6\\u07E7\\u07E8\\u07E9\\u07EA\\u0904\\u0905\\u0906\\u0907\\u0908\\u0909\\u090A\\u090B\\u090C\\u090D\\u090E\\u090F\\u0910\\u0911\\u0912\\u0913\\u0914\\u0915\\u0916\\u0917\\u0918\\u0919\\u091A\\u091B\\u091C\\u091D\\u091E\\u091F\\u0920\\u0921\\u0922\\u0923\\u0924\\u0925\\u0926\\u0927\\u0928\\u0929\\u092A\\u092B\\u092C\\u092D\\u092E\\u092F\\u0930\\u0931\\u0932\\u0933\\u0934\\u0935\\u0936\\u0937\\u0938\\u0939\\u093D\\u0950\\u0958\\u0959\\u095A\\u095B\\u095C\\u095D\\u095E\\u095F\\u0960\\u0961\\u0972\\u097B\\u097C\\u097D\\u097E\\u097F\\u0985\\u0986\\u0987\\u0988\\u0989\\u098A\\u098B\\u098C\\u098F\\u0990\\u0993\\u0994\\u0995\\u0996\\u0997\\u0998\\u0999\\u099A\\u099B\\u099C\\u099D\\u099E\\u099F\\u09A0\\u09A1\\u09A2\\u09A3\\u09A4\\u09A5\\u09A6\\u09A7\\u09A8\\u09AA\\u09AB\\u09AC\\u09AD\\u09AE\\u09AF\\u09B0\\u09B2\\u09B6\\u09B7\\u09B8\\u09B9\\u09BD\\u09CE\\u09DC\\u09DD\\u09DF\\u09E0\\u09E1\\u09F0\\u09F1\\u0A05\\u0A06\\u0A07\\u0A08\\u0A09\\u0A0A\\u0A0F\\u0A10\\u0A13\\u0A14\\u0A15\\u0A16\\u0A17\\u0A18\\u0A19\\u0A1A\\u0A1B\\u0A1C\\u0A1D\\u0A1E\\u0A1F\\u0A20\\u0A21\\u0A22\\u0A23\\u0A24\\u0A25\\u0A26\\u0A27\\u0A28\\u0A2A\\u0A2B\\u0A2C\\u0A2D\\u0A2E\\u0A2F\\u0A30\\u0A32\\u0A33\\u0A35\\u0A36\\u0A38\\u0A39\\u0A59\\u0A5A\\u0A5B\\u0A5C\\u0A5E\\u0A72\\u0A73\\u0A74\\u0A85\\u0A86\\u0A87\\u0A88\\u0A89\\u0A8A\\u0A8B\\u0A8C\\u0A8D\\u0A8F\\u0A90\\u0A91\\u0A93\\u0A94\\u0A95\\u0A96\\u0A97\\u0A98\\u0A99\\u0A9A\\u0A9B\\u0A9C\\u0A9D\\u0A9E\\u0A9F\\u0AA0\\u0AA1\\u0AA2\\u0AA3\\u0AA4\\u0AA5\\u0AA6\\u0AA7\\u0AA8\\u0AAA\\u0AAB\\u0AAC\\u0AAD\\u0AAE\\u0AAF\\u0AB0\\u0AB2\\u0AB3\\u0AB5\\u0AB6\\u0AB7\\u0AB8\\u0AB9\\u0ABD\\u0AD0\\u0AE0\\u0AE1\\u0B05\\u0B06\\u0B07\\u0B08\\u0B09\\u0B0A\\u0B0B\\u0B0C\\u0B0F\\u0B10\\u0B13\\u0B14\\u0B15\\u0B16\\u0B17\\u0B18\\u0B19\\u0B1A\\u0B1B\\u0B1C\\u0B1D\\u0B1E\\u0B1F\\u0B20\\u0B21\\u0B22\\u0B23\\u0B24\\u0B25\\u0B26\\u0B27\\u0B28\\u0B2A\\u0B2B\\u0B2C\\u0B2D\\u0B2E\\u0B2F\\u0B30\\u0B32\\u0B33\\u0B35\\u0B36\\u0B37\\u0B38\\u0B39\\u0B3D\\u0B5C\\u0B5D\\u0B5F\\u0B60\\u0B61\\u0B71\\u0B83\\u0B85\\u0B86\\u0B87\\u0B88\\u0B89\\u0B8A\\u0B8E\\u0B8F\\u0B90\\u0B92\\u0B93\\u0B94\\u0B95\\u0B99\\u0B9A\\u0B9C\\u0B9E\\u0B9F\\u0BA3\\u0BA4\\u0BA8\\u0BA9\\u0BAA\\u0BAE\\u0BAF\\u0BB0\\u0BB1\\u0BB2\\u0BB3\\u0BB4\\u0BB5\\u0BB6\\u0BB7\\u0BB8\\u0BB9\\u0BD0\\u0C05\\u0C06\\u0C07\\u0C08\\u0C09\\u0C0A\\u0C0B\\u0C0C\\u0C0E\\u0C0F\\u0C10\\u0C12\\u0C13\\u0C14\\u0C15\\u0C16\\u0C17\\u0C18\\u0C19\\u0C1A\\u0C1B\\u0C1C\\u0C1D\\u0C1E\\u0C1F\\u0C20\\u0C21\\u0C22\\u0C23\\u0C24\\u0C25\\u0C26\\u0C27\\u0C28\\u0C2A\\u0C2B\\u0C2C\\u0C2D\\u0C2E\\u0C2F\\u0C30\\u0C31\\u0C32\\u0C33\\u0C35\\u0C36\\u0C37\\u0C38\\u0C39\\u0C3D\\u0C58\\u0C59\\u0C60\\u0C61\\u0C85\\u0C86\\u0C87\\u0C88\\u0C89\\u0C8A\\u0C8B\\u0C8C\\u0C8E\\u0C8F\\u0C90\\u0C92\\u0C93\\u0C94\\u0C95\\u0C96\\u0C97\\u0C98\\u0C99\\u0C9A\\u0C9B\\u0C9C\\u0C9D\\u0C9E\\u0C9F\\u0CA0\\u0CA1\\u0CA2\\u0CA3\\u0CA4\\u0CA5\\u0CA6\\u0CA7\\u0CA8\\u0CAA\\u0CAB\\u0CAC\\u0CAD\\u0CAE\\u0CAF\\u0CB0\\u0CB1\\u0CB2\\u0CB3\\u0CB5\\u0CB6\\u0CB7\\u0CB8\\u0CB9\\u0CBD\\u0CDE\\u0CE0\\u0CE1\\u0D05\\u0D06\\u0D07\\u0D08\\u0D09\\u0D0A\\u0D0B\\u0D0C\\u0D0E\\u0D0F\\u0D10\\u0D12\\u0D13\\u0D14\\u0D15\\u0D16\\u0D17\\u0D18\\u0D19\\u0D1A\\u0D1B\\u0D1C\\u0D1D\\u0D1E\\u0D1F\\u0D20\\u0D21\\u0D22\\u0D23\\u0D24\\u0D25\\u0D26\\u0D27\\u0D28\\u0D2A\\u0D2B\\u0D2C\\u0D2D\\u0D2E\\u0D2F\\u0D30\\u0D31\\u0D32\\u0D33\\u0D34\\u0D35\\u0D36\\u0D37\\u0D38\\u0D39\\u0D3D\\u0D60\\u0D61\\u0D7A\\u0D7B\\u0D7C\\u0D7D\\u0D7E\\u0D7F\\u0D85\\u0D86\\u0D87\\u0D88\\u0D89\\u0D8A\\u0D8B\\u0D8C\\u0D8D\\u0D8E\\u0D8F\\u0D90\\u0D91\\u0D92\\u0D93\\u0D94\\u0D95\\u0D96\\u0D9A\\u0D9B\\u0D9C\\u0D9D\\u0D9E\\u0D9F\\u0DA0\\u0DA1\\u0DA2\\u0DA3\\u0DA4\\u0DA5\\u0DA6\\u0DA7\\u0DA8\\u0DA9\\u0DAA\\u0DAB\\u0DAC\\u0DAD\\u0DAE\\u0DAF\\u0DB0\\u0DB1\\u0DB3\\u0DB4\\u0DB5\\u0DB6\\u0DB7\\u0DB8\\u0DB9\\u0DBA\\u0DBB\\u0DBD\\u0DC0\\u0DC1\\u0DC2\\u0DC3\\u0DC4\\u0DC5\\u0DC6\\u0E01\\u0E02\\u0E03\\u0E04\\u0E05\\u0E06\\u0E07\\u0E08\\u0E09\\u0E0A\\u0E0B\\u0E0C\\u0E0D\\u0E0E\\u0E0F\\u0E10\\u0E11\\u0E12\\u0E13\\u0E14\\u0E15\\u0E16\\u0E17\\u0E18\\u0E19\\u0E1A\\u0E1B\\u0E1C\\u0E1D\\u0E1E\\u0E1F\\u0E20\\u0E21\\u0E22\\u0E23\\u0E24\\u0E25\\u0E26\\u0E27\\u0E28\\u0E29\\u0E2A\\u0E2B\\u0E2C\\u0E2D\\u0E2E\\u0E2F\\u0E30\\u0E32\\u0E33\\u0E40\\u0E41\\u0E42\\u0E43\\u0E44\\u0E45\\u0E81\\u0E82\\u0E84\\u0E87\\u0E88\\u0E8A\\u0E8D\\u0E94\\u0E95\\u0E96\\u0E97\\u0E99\\u0E9A\\u0E9B\\u0E9C\\u0E9D\\u0E9E\\u0E9F\\u0EA1\\u0EA2\\u0EA3\\u0EA5\\u0EA7\\u0EAA\\u0EAB\\u0EAD\\u0EAE\\u0EAF\\u0EB0\\u0EB2\\u0EB3\\u0EBD\\u0EC0\\u0EC1\\u0EC2\\u0EC3\\u0EC4\\u0EDC\\u0EDD\\u0F00\\u0F40\\u0F41\\u0F42\\u0F43\\u0F44\\u0F45\\u0F46\\u0F47\\u0F49\\u0F4A\\u0F4B\\u0F4C\\u0F4D\\u0F4E\\u0F4F\\u0F50\\u0F51\\u0F52\\u0F53\\u0F54\\u0F55\\u0F56\\u0F57\\u0F58\\u0F59\\u0F5A\\u0F5B\\u0F5C\\u0F5D\\u0F5E\\u0F5F\\u0F60\\u0F61\\u0F62\\u0F63\\u0F64\\u0F65\\u0F66\\u0F67\\u0F68\\u0F69\\u0F6A\\u0F6B\\u0F6C\\u0F88\\u0F89\\u0F8A\\u0F8B\\u1000\\u1001\\u1002\\u1003\\u1004\\u1005\\u1006\\u1007\\u1008\\u1009\\u100A\\u100B\\u100C\\u100D\\u100E\\u100F\\u1010\\u1011\\u1012\\u1013\\u1014\\u1015\\u1016\\u1017\\u1018\\u1019\\u101A\\u101B\\u101C\\u101D\\u101E\\u101F\\u1020\\u1021\\u1022\\u1023\\u1024\\u1025\\u1026\\u1027\\u1028\\u1029\\u102A\\u103F\\u1050\\u1051\\u1052\\u1053\\u1054\\u1055\\u105A\\u105B\\u105C\\u105D\\u1061\\u1065\\u1066\\u106E\\u106F\\u1070\\u1075\\u1076\\u1077\\u1078\\u1079\\u107A\\u107B\\u107C\\u107D\\u107E\\u107F\\u1080\\u1081\\u108E\\u10D0\\u10D1\\u10D2\\u10D3\\u10D4\\u10D5\\u10D6\\u10D7\\u10D8\\u10D9\\u10DA\\u10DB\\u10DC\\u10DD\\u10DE\\u10DF\\u10E0\\u10E1\\u10E2\\u10E3\\u10E4\\u10E5\\u10E6\\u10E7\\u10E8\\u10E9\\u10EA\\u10EB\\u10EC\\u10ED\\u10EE\\u10EF\\u10F0\\u10F1\\u10F2\\u10F3\\u10F4\\u10F5\\u10F6\\u10F7\\u10F8\\u10F9\\u10FA\\u1100\\u1101\\u1102\\u1103\\u1104\\u1105\\u1106\\u1107\\u1108\\u1109\\u110A\\u110B\\u110C\\u110D\\u110E\\u110F\\u1110\\u1111\\u1112\\u1113\\u1114\\u1115\\u1116\\u1117\\u1118\\u1119\\u111A\\u111B\\u111C\\u111D\\u111E\\u111F\\u1120\\u1121\\u1122\\u1123\\u1124\\u1125\\u1126\\u1127\\u1128\\u1129\\u112A\\u112B\\u112C\\u112D\\u112E\\u112F\\u1130\\u1131\\u1132\\u1133\\u1134\\u1135\\u1136\\u1137\\u1138\\u1139\\u113A\\u113B\\u113C\\u113D\\u113E\\u113F\\u1140\\u1141\\u1142\\u1143\\u1144\\u1145\\u1146\\u1147\\u1148\\u1149\\u114A\\u114B\\u114C\\u114D\\u114E\\u114F\\u1150\\u1151\\u1152\\u1153\\u1154\\u1155\\u1156\\u1157\\u1158\\u1159\\u115F\\u1160\\u1161\\u1162\\u1163\\u1164\\u1165\\u1166\\u1167\\u1168\\u1169\\u116A\\u116B\\u116C\\u116D\\u116E\\u116F\\u1170\\u1171\\u1172\\u1173\\u1174\\u1175\\u1176\\u1177\\u1178\\u1179\\u117A\\u117B\\u117C\\u117D\\u117E\\u117F\\u1180\\u1181\\u1182\\u1183\\u1184\\u1185\\u1186\\u1187\\u1188\\u1189\\u118A\\u118B\\u118C\\u118D\\u118E\\u118F\\u1190\\u1191\\u1192\\u1193\\u1194\\u1195\\u1196\\u1197\\u1198\\u1199\\u119A\\u119B\\u119C\\u119D\\u119E\\u119F\\u11A0\\u11A1\\u11A2\\u11A8\\u11A9\\u11AA\\u11AB\\u11AC\\u11AD\\u11AE\\u11AF\\u11B0\\u11B1\\u11B2\\u11B3\\u11B4\\u11B5\\u11B6\\u11B7\\u11B8\\u11B9\\u11BA\\u11BB\\u11BC\\u11BD\\u11BE\\u11BF\\u11C0\\u11C1\\u11C2\\u11C3\\u11C4\\u11C5\\u11C6\\u11C7\\u11C8\\u11C9\\u11CA\\u11CB\\u11CC\\u11CD\\u11CE\\u11CF\\u11D0\\u11D1\\u11D2\\u11D3\\u11D4\\u11D5\\u11D6\\u11D7\\u11D8\\u11D9\\u11DA\\u11DB\\u11DC\\u11DD\\u11DE\\u11DF\\u11E0\\u11E1\\u11E2\\u11E3\\u11E4\\u11E5\\u11E6\\u11E7\\u11E8\\u11E9\\u11EA\\u11EB\\u11EC\\u11ED\\u11EE\\u11EF\\u11F0\\u11F1\\u11F2\\u11F3\\u11F4\\u11F5\\u11F6\\u11F7\\u11F8\\u11F9\\u1200\\u1201\\u1202\\u1203\\u1204\\u1205\\u1206\\u1207\\u1208\\u1209\\u120A\\u120B\\u120C\\u120D\\u120E\\u120F\\u1210\\u1211\\u1212\\u1213\\u1214\\u1215\\u1216\\u1217\\u1218\\u1219\\u121A\\u121B\\u121C\\u121D\\u121E\\u121F\\u1220\\u1221\\u1222\\u1223\\u1224\\u1225\\u1226\\u1227\\u1228\\u1229\\u122A\\u122B\\u122C\\u122D\\u122E\\u122F\\u1230\\u1231\\u1232\\u1233\\u1234\\u1235\\u1236\\u1237\\u1238\\u1239\\u123A\\u123B\\u123C\\u123D\\u123E\\u123F\\u1240\\u1241\\u1242\\u1243\\u1244\\u1245\\u1246\\u1247\\u1248\\u124A\\u124B\\u124C\\u124D\\u1250\\u1251\\u1252\\u1253\\u1254\\u1255\\u1256\\u1258\\u125A\\u125B\\u125C\\u125D\\u1260\\u1261\\u1262\\u1263\\u1264\\u1265\\u1266\\u1267\\u1268\\u1269\\u126A\\u126B\\u126C\\u126D\\u126E\\u126F\\u1270\\u1271\\u1272\\u1273\\u1274\\u1275\\u1276\\u1277\\u1278\\u1279\\u127A\\u127B\\u127C\\u127D\\u127E\\u127F\\u1280\\u1281\\u1282\\u1283\\u1284\\u1285\\u1286\\u1287\\u1288\\u128A\\u128B\\u128C\\u128D\\u1290\\u1291\\u1292\\u1293\\u1294\\u1295\\u1296\\u1297\\u1298\\u1299\\u129A\\u129B\\u129C\\u129D\\u129E\\u129F\\u12A0\\u12A1\\u12A2\\u12A3\\u12A4\\u12A5\\u12A6\\u12A7\\u12A8\\u12A9\\u12AA\\u12AB\\u12AC\\u12AD\\u12AE\\u12AF\\u12B0\\u12B2\\u12B3\\u12B4\\u12B5\\u12B8\\u12B9\\u12BA\\u12BB\\u12BC\\u12BD\\u12BE\\u12C0\\u12C2\\u12C3\\u12C4\\u12C5\\u12C8\\u12C9\\u12CA\\u12CB\\u12CC\\u12CD\\u12CE\\u12CF\\u12D0\\u12D1\\u12D2\\u12D3\\u12D4\\u12D5\\u12D6\\u12D8\\u12D9\\u12DA\\u12DB\\u12DC\\u12DD\\u12DE\\u12DF\\u12E0\\u12E1\\u12E2\\u12E3\\u12E4\\u12E5\\u12E6\\u12E7\\u12E8\\u12E9\\u12EA\\u12EB\\u12EC\\u12ED\\u12EE\\u12EF\\u12F0\\u12F1\\u12F2\\u12F3\\u12F4\\u12F5\\u12F6\\u12F7\\u12F8\\u12F9\\u12FA\\u12FB\\u12FC\\u12FD\\u12FE\\u12FF\\u1300\\u1301\\u1302\\u1303\\u1304\\u1305\\u1306\\u1307\\u1308\\u1309\\u130A\\u130B\\u130C\\u130D\\u130E\\u130F\\u1310\\u1312\\u1313\\u1314\\u1315\\u1318\\u1319\\u131A\\u131B\\u131C\\u131D\\u131E\\u131F\\u1320\\u1321\\u1322\\u1323\\u1324\\u1325\\u1326\\u1327\\u1328\\u1329\\u132A\\u132B\\u132C\\u132D\\u132E\\u132F\\u1330\\u1331\\u1332\\u1333\\u1334\\u1335\\u1336\\u1337\\u1338\\u1339\\u133A\\u133B\\u133C\\u133D\\u133E\\u133F\\u1340\\u1341\\u1342\\u1343\\u1344\\u1345\\u1346\\u1347\\u1348\\u1349\\u134A\\u134B\\u134C\\u134D\\u134E\\u134F\\u1350\\u1351\\u1352\\u1353\\u1354\\u1355\\u1356\\u1357\\u1358\\u1359\\u135A\\u1380\\u1381\\u1382\\u1383\\u1384\\u1385\\u1386\\u1387\\u1388\\u1389\\u138A\\u138B\\u138C\\u138D\\u138E\\u138F\\u13A0\\u13A1\\u13A2\\u13A3\\u13A4\\u13A5\\u13A6\\u13A7\\u13A8\\u13A9\\u13AA\\u13AB\\u13AC\\u13AD\\u13AE\\u13AF\\u13B0\\u13B1\\u13B2\\u13B3\\u13B4\\u13B5\\u13B6\\u13B7\\u13B8\\u13B9\\u13BA\\u13BB\\u13BC\\u13BD\\u13BE\\u13BF\\u13C0\\u13C1\\u13C2\\u13C3\\u13C4\\u13C5\\u13C6\\u13C7\\u13C8\\u13C9\\u13CA\\u13CB\\u13CC\\u13CD\\u13CE\\u13CF\\u13D0\\u13D1\\u13D2\\u13D3\\u13D4\\u13D5\\u13D6\\u13D7\\u13D8\\u13D9\\u13DA\\u13DB\\u13DC\\u13DD\\u13DE\\u13DF\\u13E0\\u13E1\\u13E2\\u13E3\\u13E4\\u13E5\\u13E6\\u13E7\\u13E8\\u13E9\\u13EA\\u13EB\\u13EC\\u13ED\\u13EE\\u13EF\\u13F0\\u13F1\\u13F2\\u13F3\\u13F4\\u1401\\u1402\\u1403\\u1404\\u1405\\u1406\\u1407\\u1408\\u1409\\u140A\\u140B\\u140C\\u140D\\u140E\\u140F\\u1410\\u1411\\u1412\\u1413\\u1414\\u1415\\u1416\\u1417\\u1418\\u1419\\u141A\\u141B\\u141C\\u141D\\u141E\\u141F\\u1420\\u1421\\u1422\\u1423\\u1424\\u1425\\u1426\\u1427\\u1428\\u1429\\u142A\\u142B\\u142C\\u142D\\u142E\\u142F\\u1430\\u1431\\u1432\\u1433\\u1434\\u1435\\u1436\\u1437\\u1438\\u1439\\u143A\\u143B\\u143C\\u143D\\u143E\\u143F\\u1440\\u1441\\u1442\\u1443\\u1444\\u1445\\u1446\\u1447\\u1448\\u1449\\u144A\\u144B\\u144C\\u144D\\u144E\\u144F\\u1450\\u1451\\u1452\\u1453\\u1454\\u1455\\u1456\\u1457\\u1458\\u1459\\u145A\\u145B\\u145C\\u145D\\u145E\\u145F\\u1460\\u1461\\u1462\\u1463\\u1464\\u1465\\u1466\\u1467\\u1468\\u1469\\u146A\\u146B\\u146C\\u146D\\u146E\\u146F\\u1470\\u1471\\u1472\\u1473\\u1474\\u1475\\u1476\\u1477\\u1478\\u1479\\u147A\\u147B\\u147C\\u147D\\u147E\\u147F\\u1480\\u1481\\u1482\\u1483\\u1484\\u1485\\u1486\\u1487\\u1488\\u1489\\u148A\\u148B\\u148C\\u148D\\u148E\\u148F\\u1490\\u1491\\u1492\\u1493\\u1494\\u1495\\u1496\\u1497\\u1498\\u1499\\u149A\\u149B\\u149C\\u149D\\u149E\\u149F\\u14A0\\u14A1\\u14A2\\u14A3\\u14A4\\u14A5\\u14A6\\u14A7\\u14A8\\u14A9\\u14AA\\u14AB\\u14AC\\u14AD\\u14AE\\u14AF\\u14B0\\u14B1\\u14B2\\u14B3\\u14B4\\u14B5\\u14B6\\u14B7\\u14B8\\u14B9\\u14BA\\u14BB\\u14BC\\u14BD\\u14BE\\u14BF\\u14C0\\u14C1\\u14C2\\u14C3\\u14C4\\u14C5\\u14C6\\u14C7\\u14C8\\u14C9\\u14CA\\u14CB\\u14CC\\u14CD\\u14CE\\u14CF\\u14D0\\u14D1\\u14D2\\u14D3\\u14D4\\u14D5\\u14D6\\u14D7\\u14D8\\u14D9\\u14DA\\u14DB\\u14DC\\u14DD\\u14DE\\u14DF\\u14E0\\u14E1\\u14E2\\u14E3\\u14E4\\u14E5\\u14E6\\u14E7\\u14E8\\u14E9\\u14EA\\u14EB\\u14EC\\u14ED\\u14EE\\u14EF\\u14F0\\u14F1\\u14F2\\u14F3\\u14F4\\u14F5\\u14F6\\u14F7\\u14F8\\u14F9\\u14FA\\u14FB\\u14FC\\u14FD\\u14FE\\u14FF\\u1500\\u1501\\u1502\\u1503\\u1504\\u1505\\u1506\\u1507\\u1508\\u1509\\u150A\\u150B\\u150C\\u150D\\u150E\\u150F\\u1510\\u1511\\u1512\\u1513\\u1514\\u1515\\u1516\\u1517\\u1518\\u1519\\u151A\\u151B\\u151C\\u151D\\u151E\\u151F\\u1520\\u1521\\u1522\\u1523\\u1524\\u1525\\u1526\\u1527\\u1528\\u1529\\u152A\\u152B\\u152C\\u152D\\u152E\\u152F\\u1530\\u1531\\u1532\\u1533\\u1534\\u1535\\u1536\\u1537\\u1538\\u1539\\u153A\\u153B\\u153C\\u153D\\u153E\\u153F\\u1540\\u1541\\u1542\\u1543\\u1544\\u1545\\u1546\\u1547\\u1548\\u1549\\u154A\\u154B\\u154C\\u154D\\u154E\\u154F\\u1550\\u1551\\u1552\\u1553\\u1554\\u1555\\u1556\\u1557\\u1558\\u1559\\u155A\\u155B\\u155C\\u155D\\u155E\\u155F\\u1560\\u1561\\u1562\\u1563\\u1564\\u1565\\u1566\\u1567\\u1568\\u1569\\u156A\\u156B\\u156C\\u156D\\u156E\\u156F\\u1570\\u1571\\u1572\\u1573\\u1574\\u1575\\u1576\\u1577\\u1578\\u1579\\u157A\\u157B\\u157C\\u157D\\u157E\\u157F\\u1580\\u1581\\u1582\\u1583\\u1584\\u1585\\u1586\\u1587\\u1588\\u1589\\u158A\\u158B\\u158C\\u158D\\u158E\\u158F\\u1590\\u1591\\u1592\\u1593\\u1594\\u1595\\u1596\\u1597\\u1598\\u1599\\u159A\\u159B\\u159C\\u159D\\u159E\\u159F\\u15A0\\u15A1\\u15A2\\u15A3\\u15A4\\u15A5\\u15A6\\u15A7\\u15A8\\u15A9\\u15AA\\u15AB\\u15AC\\u15AD\\u15AE\\u15AF\\u15B0\\u15B1\\u15B2\\u15B3\\u15B4\\u15B5\\u15B6\\u15B7\\u15B8\\u15B9\\u15BA\\u15BB\\u15BC\\u15BD\\u15BE\\u15BF\\u15C0\\u15C1\\u15C2\\u15C3\\u15C4\\u15C5\\u15C6\\u15C7\\u15C8\\u15C9\\u15CA\\u15CB\\u15CC\\u15CD\\u15CE\\u15CF\\u15D0\\u15D1\\u15D2\\u15D3\\u15D4\\u15D5\\u15D6\\u15D7\\u15D8\\u15D9\\u15DA\\u15DB\\u15DC\\u15DD\\u15DE\\u15DF\\u15E0\\u15E1\\u15E2\\u15E3\\u15E4\\u15E5\\u15E6\\u15E7\\u15E8\\u15E9\\u15EA\\u15EB\\u15EC\\u15ED\\u15EE\\u15EF\\u15F0\\u15F1\\u15F2\\u15F3\\u15F4\\u15F5\\u15F6\\u15F7\\u15F8\\u15F9\\u15FA\\u15FB\\u15FC\\u15FD\\u15FE\\u15FF\\u1600\\u1601\\u1602\\u1603\\u1604\\u1605\\u1606\\u1607\\u1608\\u1609\\u160A\\u160B\\u160C\\u160D\\u160E\\u160F\\u1610\\u1611\\u1612\\u1613\\u1614\\u1615\\u1616\\u1617\\u1618\\u1619\\u161A\\u161B\\u161C\\u161D\\u161E\\u161F\\u1620\\u1621\\u1622\\u1623\\u1624\\u1625\\u1626\\u1627\\u1628\\u1629\\u162A\\u162B\\u162C\\u162D\\u162E\\u162F\\u1630\\u1631\\u1632\\u1633\\u1634\\u1635\\u1636\\u1637\\u1638\\u1639\\u163A\\u163B\\u163C\\u163D\\u163E\\u163F\\u1640\\u1641\\u1642\\u1643\\u1644\\u1645\\u1646\\u1647\\u1648\\u1649\\u164A\\u164B\\u164C\\u164D\\u164E\\u164F\\u1650\\u1651\\u1652\\u1653\\u1654\\u1655\\u1656\\u1657\\u1658\\u1659\\u165A\\u165B\\u165C\\u165D\\u165E\\u165F\\u1660\\u1661\\u1662\\u1663\\u1664\\u1665\\u1666\\u1667\\u1668\\u1669\\u166A\\u166B\\u166C\\u166F\\u1670\\u1671\\u1672\\u1673\\u1674\\u1675\\u1676\\u1681\\u1682\\u1683\\u1684\\u1685\\u1686\\u1687\\u1688\\u1689\\u168A\\u168B\\u168C\\u168D\\u168E\\u168F\\u1690\\u1691\\u1692\\u1693\\u1694\\u1695\\u1696\\u1697\\u1698\\u1699\\u169A\\u16A0\\u16A1\\u16A2\\u16A3\\u16A4\\u16A5\\u16A6\\u16A7\\u16A8\\u16A9\\u16AA\\u16AB\\u16AC\\u16AD\\u16AE\\u16AF\\u16B0\\u16B1\\u16B2\\u16B3\\u16B4\\u16B5\\u16B6\\u16B7\\u16B8\\u16B9\\u16BA\\u16BB\\u16BC\\u16BD\\u16BE\\u16BF\\u16C0\\u16C1\\u16C2\\u16C3\\u16C4\\u16C5\\u16C6\\u16C7\\u16C8\\u16C9\\u16CA\\u16CB\\u16CC\\u16CD\\u16CE\\u16CF\\u16D0\\u16D1\\u16D2\\u16D3\\u16D4\\u16D5\\u16D6\\u16D7\\u16D8\\u16D9\\u16DA\\u16DB\\u16DC\\u16DD\\u16DE\\u16DF\\u16E0\\u16E1\\u16E2\\u16E3\\u16E4\\u16E5\\u16E6\\u16E7\\u16E8\\u16E9\\u16EA\\u1700\\u1701\\u1702\\u1703\\u1704\\u1705\\u1706\\u1707\\u1708\\u1709\\u170A\\u170B\\u170C\\u170E\\u170F\\u1710\\u1711\\u1720\\u1721\\u1722\\u1723\\u1724\\u1725\\u1726\\u1727\\u1728\\u1729\\u172A\\u172B\\u172C\\u172D\\u172E\\u172F\\u1730\\u1731\\u1740\\u1741\\u1742\\u1743\\u1744\\u1745\\u1746\\u1747\\u1748\\u1749\\u174A\\u174B\\u174C\\u174D\\u174E\\u174F\\u1750\\u1751\\u1760\\u1761\\u1762\\u1763\\u1764\\u1765\\u1766\\u1767\\u1768\\u1769\\u176A\\u176B\\u176C\\u176E\\u176F\\u1770\\u1780\\u1781\\u1782\\u1783\\u1784\\u1785\\u1786\\u1787\\u1788\\u1789\\u178A\\u178B\\u178C\\u178D\\u178E\\u178F\\u1790\\u1791\\u1792\\u1793\\u1794\\u1795\\u1796\\u1797\\u1798\\u1799\\u179A\\u179B\\u179C\\u179D\\u179E\\u179F\\u17A0\\u17A1\\u17A2\\u17A3\\u17A4\\u17A5\\u17A6\\u17A7\\u17A8\\u17A9\\u17AA\\u17AB\\u17AC\\u17AD\\u17AE\\u17AF\\u17B0\\u17B1\\u17B2\\u17B3\\u17DC\\u1820\\u1821\\u1822\\u1823\\u1824\\u1825\\u1826\\u1827\\u1828\\u1829\\u182A\\u182B\\u182C\\u182D\\u182E\\u182F\\u1830\\u1831\\u1832\\u1833\\u1834\\u1835\\u1836\\u1837\\u1838\\u1839\\u183A\\u183B\\u183C\\u183D\\u183E\\u183F\\u1840\\u1841\\u1842\\u1844\\u1845\\u1846\\u1847\\u1848\\u1849\\u184A\\u184B\\u184C\\u184D\\u184E\\u184F\\u1850\\u1851\\u1852\\u1853\\u1854\\u1855\\u1856\\u1857\\u1858\\u1859\\u185A\\u185B\\u185C\\u185D\\u185E\\u185F\\u1860\\u1861\\u1862\\u1863\\u1864\\u1865\\u1866\\u1867\\u1868\\u1869\\u186A\\u186B\\u186C\\u186D\\u186E\\u186F\\u1870\\u1871\\u1872\\u1873\\u1874\\u1875\\u1876\\u1877\\u1880\\u1881\\u1882\\u1883\\u1884\\u1885\\u1886\\u1887\\u1888\\u1889\\u188A\\u188B\\u188C\\u188D\\u188E\\u188F\\u1890\\u1891\\u1892\\u1893\\u1894\\u1895\\u1896\\u1897\\u1898\\u1899\\u189A\\u189B\\u189C\\u189D\\u189E\\u189F\\u18A0\\u18A1\\u18A2\\u18A3\\u18A4\\u18A5\\u18A6\\u18A7\\u18A8\\u18AA\\u1900\\u1901\\u1902\\u1903\\u1904\\u1905\\u1906\\u1907\\u1908\\u1909\\u190A\\u190B\\u190C\\u190D\\u190E\\u190F\\u1910\\u1911\\u1912\\u1913\\u1914\\u1915\\u1916\\u1917\\u1918\\u1919\\u191A\\u191B\\u191C\\u1950\\u1951\\u1952\\u1953\\u1954\\u1955\\u1956\\u1957\\u1958\\u1959\\u195A\\u195B\\u195C\\u195D\\u195E\\u195F\\u1960\\u1961\\u1962\\u1963\\u1964\\u1965\\u1966\\u1967\\u1968\\u1969\\u196A\\u196B\\u196C\\u196D\\u1970\\u1971\\u1972\\u1973\\u1974\\u1980\\u1981\\u1982\\u1983\\u1984\\u1985\\u1986\\u1987\\u1988\\u1989\\u198A\\u198B\\u198C\\u198D\\u198E\\u198F\\u1990\\u1991\\u1992\\u1993\\u1994\\u1995\\u1996\\u1997\\u1998\\u1999\\u199A\\u199B\\u199C\\u199D\\u199E\\u199F\\u19A0\\u19A1\\u19A2\\u19A3\\u19A4\\u19A5\\u19A6\\u19A7\\u19A8\\u19A9\\u19C1\\u19C2\\u19C3\\u19C4\\u19C5\\u19C6\\u19C7\\u1A00\\u1A01\\u1A02\\u1A03\\u1A04\\u1A05\\u1A06\\u1A07\\u1A08\\u1A09\\u1A0A\\u1A0B\\u1A0C\\u1A0D\\u1A0E\\u1A0F\\u1A10\\u1A11\\u1A12\\u1A13\\u1A14\\u1A15\\u1A16\\u1B05\\u1B06\\u1B07\\u1B08\\u1B09\\u1B0A\\u1B0B\\u1B0C\\u1B0D\\u1B0E\\u1B0F\\u1B10\\u1B11\\u1B12\\u1B13\\u1B14\\u1B15\\u1B16\\u1B17\\u1B18\\u1B19\\u1B1A\\u1B1B\\u1B1C\\u1B1D\\u1B1E\\u1B1F\\u1B20\\u1B21\\u1B22\\u1B23\\u1B24\\u1B25\\u1B26\\u1B27\\u1B28\\u1B29\\u1B2A\\u1B2B\\u1B2C\\u1B2D\\u1B2E\\u1B2F\\u1B30\\u1B31\\u1B32\\u1B33\\u1B45\\u1B46\\u1B47\\u1B48\\u1B49\\u1B4A\\u1B4B\\u1B83\\u1B84\\u1B85\\u1B86\\u1B87\\u1B88\\u1B89\\u1B8A\\u1B8B\\u1B8C\\u1B8D\\u1B8E\\u1B8F\\u1B90\\u1B91\\u1B92\\u1B93\\u1B94\\u1B95\\u1B96\\u1B97\\u1B98\\u1B99\\u1B9A\\u1B9B\\u1B9C\\u1B9D\\u1B9E\\u1B9F\\u1BA0\\u1BAE\\u1BAF\\u1C00\\u1C01\\u1C02\\u1C03\\u1C04\\u1C05\\u1C06\\u1C07\\u1C08\\u1C09\\u1C0A\\u1C0B\\u1C0C\\u1C0D\\u1C0E\\u1C0F\\u1C10\\u1C11\\u1C12\\u1C13\\u1C14\\u1C15\\u1C16\\u1C17\\u1C18\\u1C19\\u1C1A\\u1C1B\\u1C1C\\u1C1D\\u1C1E\\u1C1F\\u1C20\\u1C21\\u1C22\\u1C23\\u1C4D\\u1C4E\\u1C4F\\u1C5A\\u1C5B\\u1C5C\\u1C5D\\u1C5E\\u1C5F\\u1C60\\u1C61\\u1C62\\u1C63\\u1C64\\u1C65\\u1C66\\u1C67\\u1C68\\u1C69\\u1C6A\\u1C6B\\u1C6C\\u1C6D\\u1C6E\\u1C6F\\u1C70\\u1C71\\u1C72\\u1C73\\u1C74\\u1C75\\u1C76\\u1C77\\u2135\\u2136\\u2137\\u2138\\u2D30\\u2D31\\u2D32\\u2D33\\u2D34\\u2D35\\u2D36\\u2D37\\u2D38\\u2D39\\u2D3A\\u2D3B\\u2D3C\\u2D3D\\u2D3E\\u2D3F\\u2D40\\u2D41\\u2D42\\u2D43\\u2D44\\u2D45\\u2D46\\u2D47\\u2D48\\u2D49\\u2D4A\\u2D4B\\u2D4C\\u2D4D\\u2D4E\\u2D4F\\u2D50\\u2D51\\u2D52\\u2D53\\u2D54\\u2D55\\u2D56\\u2D57\\u2D58\\u2D59\\u2D5A\\u2D5B\\u2D5C\\u2D5D\\u2D5E\\u2D5F\\u2D60\\u2D61\\u2D62\\u2D63\\u2D64\\u2D65\\u2D80\\u2D81\\u2D82\\u2D83\\u2D84\\u2D85\\u2D86\\u2D87\\u2D88\\u2D89\\u2D8A\\u2D8B\\u2D8C\\u2D8D\\u2D8E\\u2D8F\\u2D90\\u2D91\\u2D92\\u2D93\\u2D94\\u2D95\\u2D96\\u2DA0\\u2DA1\\u2DA2\\u2DA3\\u2DA4\\u2DA5\\u2DA6\\u2DA8\\u2DA9\\u2DAA\\u2DAB\\u2DAC\\u2DAD\\u2DAE\\u2DB0\\u2DB1\\u2DB2\\u2DB3\\u2DB4\\u2DB5\\u2DB6\\u2DB8\\u2DB9\\u2DBA\\u2DBB\\u2DBC\\u2DBD\\u2DBE\\u2DC0\\u2DC1\\u2DC2\\u2DC3\\u2DC4\\u2DC5\\u2DC6\\u2DC8\\u2DC9\\u2DCA\\u2DCB\\u2DCC\\u2DCD\\u2DCE\\u2DD0\\u2DD1\\u2DD2\\u2DD3\\u2DD4\\u2DD5\\u2DD6\\u2DD8\\u2DD9\\u2DDA\\u2DDB\\u2DDC\\u2DDD\\u2DDE\\u3006\\u303C\\u3041\\u3042\\u3043\\u3044\\u3045\\u3046\\u3047\\u3048\\u3049\\u304A\\u304B\\u304C\\u304D\\u304E\\u304F\\u3050\\u3051\\u3052\\u3053\\u3054\\u3055\\u3056\\u3057\\u3058\\u3059\\u305A\\u305B\\u305C\\u305D\\u305E\\u305F\\u3060\\u3061\\u3062\\u3063\\u3064\\u3065\\u3066\\u3067\\u3068\\u3069\\u306A\\u306B\\u306C\\u306D\\u306E\\u306F\\u3070\\u3071\\u3072\\u3073\\u3074\\u3075\\u3076\\u3077\\u3078\\u3079\\u307A\\u307B\\u307C\\u307D\\u307E\\u307F\\u3080\\u3081\\u3082\\u3083\\u3084\\u3085\\u3086\\u3087\\u3088\\u3089\\u308A\\u308B\\u308C\\u308D\\u308E\\u308F\\u3090\\u3091\\u3092\\u3093\\u3094\\u3095\\u3096\\u309F\\u30A1\\u30A2\\u30A3\\u30A4\\u30A5\\u30A6\\u30A7\\u30A8\\u30A9\\u30AA\\u30AB\\u30AC\\u30AD\\u30AE\\u30AF\\u30B0\\u30B1\\u30B2\\u30B3\\u30B4\\u30B5\\u30B6\\u30B7\\u30B8\\u30B9\\u30BA\\u30BB\\u30BC\\u30BD\\u30BE\\u30BF\\u30C0\\u30C1\\u30C2\\u30C3\\u30C4\\u30C5\\u30C6\\u30C7\\u30C8\\u30C9\\u30CA\\u30CB\\u30CC\\u30CD\\u30CE\\u30CF\\u30D0\\u30D1\\u30D2\\u30D3\\u30D4\\u30D5\\u30D6\\u30D7\\u30D8\\u30D9\\u30DA\\u30DB\\u30DC\\u30DD\\u30DE\\u30DF\\u30E0\\u30E1\\u30E2\\u30E3\\u30E4\\u30E5\\u30E6\\u30E7\\u30E8\\u30E9\\u30EA\\u30EB\\u30EC\\u30ED\\u30EE\\u30EF\\u30F0\\u30F1\\u30F2\\u30F3\\u30F4\\u30F5\\u30F6\\u30F7\\u30F8\\u30F9\\u30FA\\u30FF\\u3105\\u3106\\u3107\\u3108\\u3109\\u310A\\u310B\\u310C\\u310D\\u310E\\u310F\\u3110\\u3111\\u3112\\u3113\\u3114\\u3115\\u3116\\u3117\\u3118\\u3119\\u311A\\u311B\\u311C\\u311D\\u311E\\u311F\\u3120\\u3121\\u3122\\u3123\\u3124\\u3125\\u3126\\u3127\\u3128\\u3129\\u312A\\u312B\\u312C\\u312D\\u3131\\u3132\\u3133\\u3134\\u3135\\u3136\\u3137\\u3138\\u3139\\u313A\\u313B\\u313C\\u313D\\u313E\\u313F\\u3140\\u3141\\u3142\\u3143\\u3144\\u3145\\u3146\\u3147\\u3148\\u3149\\u314A\\u314B\\u314C\\u314D\\u314E\\u314F\\u3150\\u3151\\u3152\\u3153\\u3154\\u3155\\u3156\\u3157\\u3158\\u3159\\u315A\\u315B\\u315C\\u315D\\u315E\\u315F\\u3160\\u3161\\u3162\\u3163\\u3164\\u3165\\u3166\\u3167\\u3168\\u3169\\u316A\\u316B\\u316C\\u316D\\u316E\\u316F\\u3170\\u3171\\u3172\\u3173\\u3174\\u3175\\u3176\\u3177\\u3178\\u3179\\u317A\\u317B\\u317C\\u317D\\u317E\\u317F\\u3180\\u3181\\u3182\\u3183\\u3184\\u3185\\u3186\\u3187\\u3188\\u3189\\u318A\\u318B\\u318C\\u318D\\u318E\\u31A0\\u31A1\\u31A2\\u31A3\\u31A4\\u31A5\\u31A6\\u31A7\\u31A8\\u31A9\\u31AA\\u31AB\\u31AC\\u31AD\\u31AE\\u31AF\\u31B0\\u31B1\\u31B2\\u31B3\\u31B4\\u31B5\\u31B6\\u31B7\\u31F0\\u31F1\\u31F2\\u31F3\\u31F4\\u31F5\\u31F6\\u31F7\\u31F8\\u31F9\\u31FA\\u31FB\\u31FC\\u31FD\\u31FE\\u31FF\\u3400\\u4DB5\\u4E00\\u9FC3\\uA000\\uA001\\uA002\\uA003\\uA004\\uA005\\uA006\\uA007\\uA008\\uA009\\uA00A\\uA00B\\uA00C\\uA00D\\uA00E\\uA00F\\uA010\\uA011\\uA012\\uA013\\uA014\\uA016\\uA017\\uA018\\uA019\\uA01A\\uA01B\\uA01C\\uA01D\\uA01E\\uA01F\\uA020\\uA021\\uA022\\uA023\\uA024\\uA025\\uA026\\uA027\\uA028\\uA029\\uA02A\\uA02B\\uA02C\\uA02D\\uA02E\\uA02F\\uA030\\uA031\\uA032\\uA033\\uA034\\uA035\\uA036\\uA037\\uA038\\uA039\\uA03A\\uA03B\\uA03C\\uA03D\\uA03E\\uA03F\\uA040\\uA041\\uA042\\uA043\\uA044\\uA045\\uA046\\uA047\\uA048\\uA049\\uA04A\\uA04B\\uA04C\\uA04D\\uA04E\\uA04F\\uA050\\uA051\\uA052\\uA053\\uA054\\uA055\\uA056\\uA057\\uA058\\uA059\\uA05A\\uA05B\\uA05C\\uA05D\\uA05E\\uA05F\\uA060\\uA061\\uA062\\uA063\\uA064\\uA065\\uA066\\uA067\\uA068\\uA069\\uA06A\\uA06B\\uA06C\\uA06D\\uA06E\\uA06F\\uA070\\uA071\\uA072\\uA073\\uA074\\uA075\\uA076\\uA077\\uA078\\uA079\\uA07A\\uA07B\\uA07C\\uA07D\\uA07E\\uA07F\\uA080\\uA081\\uA082\\uA083\\uA084\\uA085\\uA086\\uA087\\uA088\\uA089\\uA08A\\uA08B\\uA08C\\uA08D\\uA08E\\uA08F\\uA090\\uA091\\uA092\\uA093\\uA094\\uA095\\uA096\\uA097\\uA098\\uA099\\uA09A\\uA09B\\uA09C\\uA09D\\uA09E\\uA09F\\uA0A0\\uA0A1\\uA0A2\\uA0A3\\uA0A4\\uA0A5\\uA0A6\\uA0A7\\uA0A8\\uA0A9\\uA0AA\\uA0AB\\uA0AC\\uA0AD\\uA0AE\\uA0AF\\uA0B0\\uA0B1\\uA0B2\\uA0B3\\uA0B4\\uA0B5\\uA0B6\\uA0B7\\uA0B8\\uA0B9\\uA0BA\\uA0BB\\uA0BC\\uA0BD\\uA0BE\\uA0BF\\uA0C0\\uA0C1\\uA0C2\\uA0C3\\uA0C4\\uA0C5\\uA0C6\\uA0C7\\uA0C8\\uA0C9\\uA0CA\\uA0CB\\uA0CC\\uA0CD\\uA0CE\\uA0CF\\uA0D0\\uA0D1\\uA0D2\\uA0D3\\uA0D4\\uA0D5\\uA0D6\\uA0D7\\uA0D8\\uA0D9\\uA0DA\\uA0DB\\uA0DC\\uA0DD\\uA0DE\\uA0DF\\uA0E0\\uA0E1\\uA0E2\\uA0E3\\uA0E4\\uA0E5\\uA0E6\\uA0E7\\uA0E8\\uA0E9\\uA0EA\\uA0EB\\uA0EC\\uA0ED\\uA0EE\\uA0EF\\uA0F0\\uA0F1\\uA0F2\\uA0F3\\uA0F4\\uA0F5\\uA0F6\\uA0F7\\uA0F8\\uA0F9\\uA0FA\\uA0FB\\uA0FC\\uA0FD\\uA0FE\\uA0FF\\uA100\\uA101\\uA102\\uA103\\uA104\\uA105\\uA106\\uA107\\uA108\\uA109\\uA10A\\uA10B\\uA10C\\uA10D\\uA10E\\uA10F\\uA110\\uA111\\uA112\\uA113\\uA114\\uA115\\uA116\\uA117\\uA118\\uA119\\uA11A\\uA11B\\uA11C\\uA11D\\uA11E\\uA11F\\uA120\\uA121\\uA122\\uA123\\uA124\\uA125\\uA126\\uA127\\uA128\\uA129\\uA12A\\uA12B\\uA12C\\uA12D\\uA12E\\uA12F\\uA130\\uA131\\uA132\\uA133\\uA134\\uA135\\uA136\\uA137\\uA138\\uA139\\uA13A\\uA13B\\uA13C\\uA13D\\uA13E\\uA13F\\uA140\\uA141\\uA142\\uA143\\uA144\\uA145\\uA146\\uA147\\uA148\\uA149\\uA14A\\uA14B\\uA14C\\uA14D\\uA14E\\uA14F\\uA150\\uA151\\uA152\\uA153\\uA154\\uA155\\uA156\\uA157\\uA158\\uA159\\uA15A\\uA15B\\uA15C\\uA15D\\uA15E\\uA15F\\uA160\\uA161\\uA162\\uA163\\uA164\\uA165\\uA166\\uA167\\uA168\\uA169\\uA16A\\uA16B\\uA16C\\uA16D\\uA16E\\uA16F\\uA170\\uA171\\uA172\\uA173\\uA174\\uA175\\uA176\\uA177\\uA178\\uA179\\uA17A\\uA17B\\uA17C\\uA17D\\uA17E\\uA17F\\uA180\\uA181\\uA182\\uA183\\uA184\\uA185\\uA186\\uA187\\uA188\\uA189\\uA18A\\uA18B\\uA18C\\uA18D\\uA18E\\uA18F\\uA190\\uA191\\uA192\\uA193\\uA194\\uA195\\uA196\\uA197\\uA198\\uA199\\uA19A\\uA19B\\uA19C\\uA19D\\uA19E\\uA19F\\uA1A0\\uA1A1\\uA1A2\\uA1A3\\uA1A4\\uA1A5\\uA1A6\\uA1A7\\uA1A8\\uA1A9\\uA1AA\\uA1AB\\uA1AC\\uA1AD\\uA1AE\\uA1AF]", + peg$c259 = "Unicode letter number", + peg$c260 = /^[\u16EE\u16EF\u16F0\u2160\u2161\u2162\u2163\u2164\u2165\u2166\u2167\u2168\u2169\u216A\u216B\u216C\u216D\u216E\u216F\u2170\u2171\u2172\u2173\u2174\u2175\u2176\u2177\u2178\u2179\u217A\u217B\u217C\u217D\u217E\u217F\u2180\u2181\u2182\u2185\u2186\u2187\u2188\u3007\u3021\u3022\u3023\u3024\u3025\u3026\u3027\u3028\u3029\u3038\u3039\u303A]/, + peg$c261 = "[\\u16EE\\u16EF\\u16F0\\u2160\\u2161\\u2162\\u2163\\u2164\\u2165\\u2166\\u2167\\u2168\\u2169\\u216A\\u216B\\u216C\\u216D\\u216E\\u216F\\u2170\\u2171\\u2172\\u2173\\u2174\\u2175\\u2176\\u2177\\u2178\\u2179\\u217A\\u217B\\u217C\\u217D\\u217E\\u217F\\u2180\\u2181\\u2182\\u2185\\u2186\\u2187\\u2188\\u3007\\u3021\\u3022\\u3023\\u3024\\u3025\\u3026\\u3027\\u3028\\u3029\\u3038\\u3039\\u303A]", + peg$c262 = "Unicode separator, space", + peg$c263 = /^[ \xA0\u1680\u180E\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000]/, + peg$c264 = "[ \\xA0\\u1680\\u180E\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200A\\u202F\\u205F\\u3000]", + peg$c265 = function(c) { + return c; + }, + peg$c266 = function(seq) { + return seq; + }, + peg$c267 = "\n", + peg$c268 = "\"\\n\"", + peg$c269 = "\r", + peg$c270 = "\"\\r\"", + peg$c271 = "\u2028", + peg$c272 = "\"\\u2028\"", + peg$c273 = "\u2029", + peg$c274 = "\"\\u2029\"", + peg$c275 = "\r\n", + peg$c276 = "\"\\r\\n\"", + peg$c277 = function() { + return '0'; + }, + peg$c278 = /^['"\\bfnrtv]/, + peg$c279 = "['\"\\\\bfnrtv]", + peg$c280 = "x", + peg$c281 = "\"x\"", + peg$c282 = "any character", + peg$c283 = "whitespace", + peg$c284 = "empty", + peg$c285 = /^[\t\x0B\f \xA0\uFEFF]/, + peg$c286 = "[\\t\\x0B\\f \\xA0\\uFEFF]", + + peg$currPos = 0, + peg$reportedPos = 0, + peg$cachedPos = 0, + peg$cachedPosDetails = { line: 1, column: 1, seenCR: false }, + peg$maxFailPos = 0, + peg$maxFailExpected = [], + peg$silentFails = 0, + + peg$result; + + if ("startRule" in options) { + if (!(options.startRule in peg$startRuleFunctions)) { + throw new Error("Can't start parsing from rule \"" + options.startRule + "\"."); + } + + peg$startRuleFunction = peg$startRuleFunctions[options.startRule]; + } + + function text() { + return input.substring(peg$reportedPos, peg$currPos); + } + + function offset() { + return peg$reportedPos; + } + + function line() { + return peg$computePosDetails(peg$reportedPos).line; + } + + function column() { + return peg$computePosDetails(peg$reportedPos).column; + } + + function peg$computePosDetails(pos) { + function advance(details, pos) { + var p, ch; + + for (p = 0; p < pos; p++) { + ch = input.charAt(p); + if (ch === "\n") { + if (!details.seenCR) { details.line++; } + details.column = 1; + details.seenCR = false; + } else if (ch === "\r" || ch === "\u2028" || ch === "\u2029") { + details.line++; + details.column = 1; + details.seenCR = true; + } else { + details.column++; + details.seenCR = false; + } + } + } + + if (peg$cachedPos !== pos) { + if (peg$cachedPos > pos) { + peg$cachedPos = 0; + peg$cachedPosDetails = { line: 1, column: 1, seenCR: false }; + } + peg$cachedPos = pos; + advance(peg$cachedPosDetails, peg$cachedPos); + } + + return peg$cachedPosDetails; + } + + function peg$fail(expected) { + if (peg$currPos < peg$maxFailPos) { return; } + + if (peg$currPos > peg$maxFailPos) { + peg$maxFailPos = peg$currPos; + peg$maxFailExpected = []; + } + + peg$maxFailExpected.push(expected); + } + + function peg$cleanupExpected(expected) { + var i = 0; + + expected.sort(); + + while (i < expected.length) { + if (expected[i - 1] === expected[i]) { + expected.splice(i, 1); + } else { + i++; + } + } + } + + function peg$parseTypeExpression() { + var s0, s1, s2, s3, s4; + + s0 = peg$parseTypeUnionLegacySyntax(); + if (s0 === null) { + s0 = peg$currPos; + s1 = peg$parseRepeatable(); + if (s1 === null) { + s1 = peg$c1; + } + if (s1 !== null) { + s2 = peg$parseUnknownLiteral(); + if (s2 !== null) { + s3 = peg$currPos; + peg$silentFails++; + s4 = peg$parseBasicTypeExpression(); + peg$silentFails--; + if (s4 === null) { + s3 = peg$c1; + } else { + peg$currPos = s3; + s3 = peg$c0; + } + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c2(s1,s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + if (s0 === null) { + s0 = peg$currPos; + s1 = peg$parseRepeatable(); + if (s1 === null) { + s1 = peg$c1; + } + if (s1 !== null) { + if (input.charCodeAt(peg$currPos) === 63) { + s2 = peg$c3; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c4); } + } + if (s2 === null) { + if (input.charCodeAt(peg$currPos) === 33) { + s2 = peg$c5; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c6); } + } + } + if (s2 !== null) { + s3 = peg$parseBasicTypeExpressionNonRepeatable(); + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c7(s1,s2,s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + if (s0 === null) { + s0 = peg$currPos; + s1 = peg$parseBasicTypeExpression(); + if (s1 !== null) { + s2 = peg$parseOptional(); + if (s2 === null) { + s2 = peg$c1; + } + if (s2 !== null) { + if (input.charCodeAt(peg$currPos) === 63) { + s3 = peg$c3; + peg$currPos++; + } else { + s3 = null; + if (peg$silentFails === 0) { peg$fail(peg$c4); } + } + if (s3 === null) { + if (input.charCodeAt(peg$currPos) === 33) { + s3 = peg$c5; + peg$currPos++; + } else { + s3 = null; + if (peg$silentFails === 0) { peg$fail(peg$c6); } + } + } + if (s3 !== null) { + s4 = peg$parseOptional(); + if (s4 === null) { + s4 = peg$c1; + } + if (s4 !== null) { + peg$reportedPos = s0; + s1 = peg$c8(s1,s2,s3,s4); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + if (s0 === null) { + s0 = peg$currPos; + s1 = peg$parseBasicTypeExpression(); + if (s1 !== null) { + if (input.charCodeAt(peg$currPos) === 63) { + s2 = peg$c3; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c4); } + } + if (s2 === null) { + if (input.charCodeAt(peg$currPos) === 33) { + s2 = peg$c5; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c6); } + } + } + if (s2 === null) { + s2 = peg$c1; + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c9(s1,s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } + } + } + } + + return s0; + } + + function peg$parseBasicTypeExpression() { + var s0; + + s0 = peg$parseTypeUnion(); + if (s0 === null) { + s0 = peg$parseRestrictedTypeExpression(); + } + + return s0; + } + + function peg$parseRestrictedTypeExpression() { + var s0; + + s0 = peg$parseFunctionType(); + if (s0 === null) { + s0 = peg$parseRecordType(); + if (s0 === null) { + s0 = peg$parseLiteralType(); + if (s0 === null) { + s0 = peg$parseNameExpressionType(); + } + } + } + + return s0; + } + + function peg$parseBasicTypeExpressionNonRepeatable() { + var s0; + + s0 = peg$parseTypeUnionNonRepeatable(); + if (s0 === null) { + s0 = peg$parseRestrictedTypeExpressionNonRepeatable(); + } + + return s0; + } + + function peg$parseRestrictedTypeExpressionNonRepeatable() { + var s0; + + s0 = peg$parseFunctionTypeNonRepeatable(); + if (s0 === null) { + s0 = peg$parseRecordTypeNonRepeatable(); + if (s0 === null) { + s0 = peg$parseLiteralTypeNonRepeatable(); + if (s0 === null) { + s0 = peg$parseNameExpressionTypeNonRepeatable(); + } + } + } + + return s0; + } + + function peg$parseModifiedRestrictedTypeExpression() { + var s0; + + s0 = peg$parseModifiedRestrictedTypeExpressionRepeatable(); + if (s0 === null) { + s0 = peg$parseModifiedRestrictedTypeExpressionNonRepeatable(); + } + + return s0; + } + + function peg$parseModifiedRestrictedTypeExpressionNonRepeatable() { + var s0, s1, s2; + + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 63) { + s1 = peg$c3; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c4); } + } + if (s1 === null) { + if (input.charCodeAt(peg$currPos) === 33) { + s1 = peg$c5; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c6); } + } + } + if (s1 === null) { + s1 = peg$c1; + } + if (s1 !== null) { + s2 = peg$parseRestrictedTypeExpressionNonRepeatable(); + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c10(s1,s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + if (s0 === null) { + s0 = peg$currPos; + s1 = peg$parseRestrictedTypeExpressionNonRepeatable(); + if (s1 !== null) { + if (input.charCodeAt(peg$currPos) === 63) { + s2 = peg$c3; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c4); } + } + if (s2 === null) { + if (input.charCodeAt(peg$currPos) === 33) { + s2 = peg$c5; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c6); } + } + } + if (s2 === null) { + s2 = peg$c1; + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c9(s1,s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } + + return s0; + } + + function peg$parseModifiedRestrictedTypeExpressionRepeatable() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = peg$parseRepeatable(); + if (s1 !== null) { + s2 = peg$parseModifiedRestrictedTypeExpressionNonRepeatable(); + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c11(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseLiteralType() { + var s0; + + s0 = peg$parseLiteralTypeRepeatable(); + if (s0 === null) { + s0 = peg$parseLiteralTypeNonRepeatable(); + } + + return s0; + } + + function peg$parseLiteralTypeNonRepeatable() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = peg$parseLiteral(); + if (s1 !== null) { + s2 = peg$parseOptional(); + if (s2 === null) { + s2 = peg$c1; + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c12(s1,s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseLiteralTypeRepeatable() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = peg$parseRepeatable(); + if (s1 !== null) { + s2 = peg$parseLiteralTypeNonRepeatable(); + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c13(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseLiteral() { + var s0, s1; + + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 42) { + s1 = peg$c14; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c15); } + } + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c16(); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + if (s0 === null) { + s0 = peg$parseUnknownLiteral(); + if (s0 === null) { + s0 = peg$currPos; + s1 = peg$parseNullLiteral(); + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c17(); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + if (s0 === null) { + s0 = peg$currPos; + s1 = peg$parseUndefinedLiteral(); + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c18(); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } + } + } + + return s0; + } + + function peg$parseRepeatable() { + var s0, s1; + + s0 = peg$currPos; + if (input.substr(peg$currPos, 3) === peg$c19) { + s1 = peg$c19; + peg$currPos += 3; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c20); } + } + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c21(); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parseOptional() { + var s0, s1; + + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 61) { + s1 = peg$c22; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c23); } + } + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c24(); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parseNameExpressionType() { + var s0; + + s0 = peg$parseNameExpressionTypeRepeatable(); + if (s0 === null) { + s0 = peg$parseNameExpressionTypeNonRepeatable(); + } + + return s0; + } + + function peg$parseNameExpressionTypeNonRepeatable() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + s1 = peg$parseNameExpression(); + if (s1 === null) { + s1 = peg$parseReservedWordNameExpressionTypeNonRepeatable(); + } + if (s1 !== null) { + s2 = []; + if (input.substr(peg$currPos, 2) === peg$c26) { + s3 = peg$c26; + peg$currPos += 2; + } else { + s3 = null; + if (peg$silentFails === 0) { peg$fail(peg$c27); } + } + if (s3 !== null) { + while (s3 !== null) { + s2.push(s3); + if (input.substr(peg$currPos, 2) === peg$c26) { + s3 = peg$c26; + peg$currPos += 2; + } else { + s3 = null; + if (peg$silentFails === 0) { peg$fail(peg$c27); } + } + } + } else { + s2 = peg$c0; + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c28(s1,s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + if (s0 === null) { + s0 = peg$currPos; + s1 = peg$parseNameExpression(); + if (s1 !== null) { + s2 = peg$parseTypeApplication(); + if (s2 === null) { + s2 = peg$c1; + } + if (s2 !== null) { + s3 = peg$parseOptional(); + if (s3 === null) { + s3 = peg$c1; + } + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c29(s1,s2,s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + if (s0 === null) { + s0 = peg$currPos; + s1 = peg$parseReservedWordNameExpressionTypeNonRepeatable(); + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c30(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } + } + + return s0; + } + + function peg$parseNameExpressionTypeRepeatable() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = peg$parseRepeatable(); + if (s1 !== null) { + s2 = peg$parseNameExpressionTypeNonRepeatable(); + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c31(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseReservedWordNameExpressionType() { + var s0; + + s0 = peg$parseReservedWordNameExpressionTypeRepeatable(); + if (s0 === null) { + s0 = peg$parseReservedWordNameExpressionTypeNonRepeatable(); + } + + return s0; + } + + function peg$parseReservedWordNameExpressionTypeNonRepeatable() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = peg$parseReservedWordNameExpression(); + if (s1 !== null) { + s2 = peg$parseOptional(); + if (s2 === null) { + s2 = peg$c1; + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c32(s1,s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseReservedWordNameExpressionTypeRepeatable() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = peg$parseRepeatable(); + if (s1 !== null) { + s2 = peg$parseReservedWordNameExpressionTypeNonRepeatable(); + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c31(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseTypeApplication() { + var s0, s1, s2, s3, s4, s5, s6; + + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 46) { + s1 = peg$c33; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c34); } + } + if (s1 === null) { + s1 = peg$c1; + } + if (s1 !== null) { + if (input.charCodeAt(peg$currPos) === 60) { + s2 = peg$c35; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c36); } + } + if (s2 !== null) { + s3 = peg$parse_(); + if (s3 !== null) { + s4 = peg$parseTypeExpressionList(); + if (s4 !== null) { + s5 = peg$parse_(); + if (s5 !== null) { + if (input.charCodeAt(peg$currPos) === 62) { + s6 = peg$c37; + peg$currPos++; + } else { + s6 = null; + if (peg$silentFails === 0) { peg$fail(peg$c38); } + } + if (s6 !== null) { + peg$reportedPos = s0; + s1 = peg$c39(s1,s4); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseTypeExpressionList() { + var s0, s1, s2, s3, s4, s5, s6, s7; + + s0 = peg$currPos; + s1 = peg$parseTypeExpression(); + if (s1 !== null) { + s2 = []; + s3 = peg$currPos; + s4 = peg$parse_(); + if (s4 !== null) { + if (input.charCodeAt(peg$currPos) === 44) { + s5 = peg$c40; + peg$currPos++; + } else { + s5 = null; + if (peg$silentFails === 0) { peg$fail(peg$c41); } + } + if (s5 !== null) { + s6 = peg$parse_(); + if (s6 !== null) { + s7 = peg$parseTypeExpression(); + if (s7 !== null) { + s4 = [s4, s5, s6, s7]; + s3 = s4; + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + while (s3 !== null) { + s2.push(s3); + s3 = peg$currPos; + s4 = peg$parse_(); + if (s4 !== null) { + if (input.charCodeAt(peg$currPos) === 44) { + s5 = peg$c40; + peg$currPos++; + } else { + s5 = null; + if (peg$silentFails === 0) { peg$fail(peg$c41); } + } + if (s5 !== null) { + s6 = peg$parse_(); + if (s6 !== null) { + s7 = peg$parseTypeExpression(); + if (s7 !== null) { + s4 = [s4, s5, s6, s7]; + s3 = s4; + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c42(s1,s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseFunctionType() { + var s0; + + s0 = peg$parseFunctionTypeRepeatable(); + if (s0 === null) { + s0 = peg$parseFunctionTypeNonRepeatable(); + } + + return s0; + } + + function peg$parseFunctionTypeNonRepeatable() { + var s0, s1, s2, s3, s4, s5; + + s0 = peg$currPos; + s1 = peg$parseFunctionLiteral(); + if (s1 !== null) { + if (input.substr(peg$currPos, 2) === peg$c26) { + s2 = peg$c26; + peg$currPos += 2; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c27); } + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c43(); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + if (s0 === null) { + s0 = peg$currPos; + s1 = peg$parseFunctionLiteral(); + if (s1 !== null) { + s2 = peg$currPos; + peg$silentFails++; + s3 = peg$parseNameExpression(); + peg$silentFails--; + if (s3 === null) { + s2 = peg$c1; + } else { + peg$currPos = s2; + s2 = peg$c0; + } + if (s2 !== null) { + s3 = peg$parse_(); + if (s3 !== null) { + s4 = peg$parseFunctionSignatureType(); + if (s4 === null) { + s4 = peg$c1; + } + if (s4 !== null) { + s5 = peg$parseOptional(); + if (s5 === null) { + s5 = peg$c1; + } + if (s5 !== null) { + peg$reportedPos = s0; + s1 = peg$c44(s4,s5); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } + + return s0; + } + + function peg$parseFunctionTypeRepeatable() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = peg$parseRepeatable(); + if (s1 !== null) { + s2 = peg$parseFunctionTypeNonRepeatable(); + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c31(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseFunctionSignatureType() { + var s0, s1, s2, s3, s4, s5, s6, s7, s8, s9, s10; + + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 40) { + s1 = peg$c45; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c46); } + } + if (s1 !== null) { + s2 = peg$parse_(); + if (s2 !== null) { + s3 = peg$parseFunctionSignature(); + if (s3 === null) { + s3 = peg$c1; + } + if (s3 !== null) { + s4 = peg$parse_(); + if (s4 !== null) { + if (input.charCodeAt(peg$currPos) === 41) { + s5 = peg$c47; + peg$currPos++; + } else { + s5 = null; + if (peg$silentFails === 0) { peg$fail(peg$c48); } + } + if (s5 !== null) { + s6 = peg$currPos; + s7 = peg$parse_(); + if (s7 !== null) { + if (input.charCodeAt(peg$currPos) === 58) { + s8 = peg$c49; + peg$currPos++; + } else { + s8 = null; + if (peg$silentFails === 0) { peg$fail(peg$c50); } + } + if (s8 !== null) { + s9 = peg$parse_(); + if (s9 !== null) { + s10 = peg$parseTypeExpression(); + if (s10 !== null) { + s7 = [s7, s8, s9, s10]; + s6 = s7; + } else { + peg$currPos = s6; + s6 = peg$c0; + } + } else { + peg$currPos = s6; + s6 = peg$c0; + } + } else { + peg$currPos = s6; + s6 = peg$c0; + } + } else { + peg$currPos = s6; + s6 = peg$c0; + } + if (s6 === null) { + s6 = peg$c1; + } + if (s6 !== null) { + peg$reportedPos = s0; + s1 = peg$c51(s3,s6); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseFunctionSignature() { + var s0, s1, s2, s3, s4, s5, s6, s7; + + s0 = peg$currPos; + s1 = peg$parseFunctionSignatureNew(); + if (s1 !== null) { + s2 = peg$currPos; + s3 = peg$parse_(); + if (s3 !== null) { + if (input.charCodeAt(peg$currPos) === 44) { + s4 = peg$c40; + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c41); } + } + if (s4 !== null) { + s5 = peg$parse_(); + if (s5 !== null) { + s6 = peg$parseFunctionSignatureThis(); + if (s6 !== null) { + s3 = [s3, s4, s5, s6]; + s2 = s3; + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + if (s2 === null) { + s2 = peg$c1; + } + if (s2 !== null) { + s3 = peg$currPos; + s4 = peg$parse_(); + if (s4 !== null) { + if (input.charCodeAt(peg$currPos) === 44) { + s5 = peg$c40; + peg$currPos++; + } else { + s5 = null; + if (peg$silentFails === 0) { peg$fail(peg$c41); } + } + if (s5 !== null) { + s6 = peg$parse_(); + if (s6 !== null) { + s7 = peg$parseParametersType(); + if (s7 !== null) { + s4 = [s4, s5, s6, s7]; + s3 = s4; + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + if (s3 === null) { + s3 = peg$c1; + } + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c52(s1,s2,s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + if (s0 === null) { + s0 = peg$currPos; + s1 = peg$parseFunctionSignatureThis(); + if (s1 !== null) { + s2 = peg$currPos; + s3 = peg$parse_(); + if (s3 !== null) { + if (input.charCodeAt(peg$currPos) === 44) { + s4 = peg$c40; + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c41); } + } + if (s4 !== null) { + s5 = peg$parse_(); + if (s5 !== null) { + s6 = peg$parseFunctionSignatureNew(); + if (s6 !== null) { + s3 = [s3, s4, s5, s6]; + s2 = s3; + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + if (s2 === null) { + s2 = peg$c1; + } + if (s2 !== null) { + s3 = peg$currPos; + s4 = peg$parse_(); + if (s4 !== null) { + if (input.charCodeAt(peg$currPos) === 44) { + s5 = peg$c40; + peg$currPos++; + } else { + s5 = null; + if (peg$silentFails === 0) { peg$fail(peg$c41); } + } + if (s5 !== null) { + s6 = peg$parse_(); + if (s6 !== null) { + s7 = peg$parseParametersType(); + if (s7 !== null) { + s4 = [s4, s5, s6, s7]; + s3 = s4; + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + if (s3 === null) { + s3 = peg$c1; + } + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c53(s1,s2,s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + if (s0 === null) { + s0 = peg$currPos; + s1 = peg$parseParametersType(); + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c54(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } + } + + return s0; + } + + function peg$parseFunctionSignatureNew() { + var s0, s1, s2, s3, s4, s5; + + s0 = peg$currPos; + if (input.substr(peg$currPos, 3) === peg$c55) { + s1 = peg$c55; + peg$currPos += 3; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c56); } + } + if (s1 !== null) { + s2 = peg$parse_(); + if (s2 !== null) { + if (input.charCodeAt(peg$currPos) === 58) { + s3 = peg$c49; + peg$currPos++; + } else { + s3 = null; + if (peg$silentFails === 0) { peg$fail(peg$c50); } + } + if (s3 !== null) { + s4 = peg$parse_(); + if (s4 !== null) { + s5 = peg$parseTypeExpression(); + if (s5 !== null) { + peg$reportedPos = s0; + s1 = peg$c57(s5); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseFunctionSignatureThis() { + var s0, s1, s2, s3, s4, s5; + + s0 = peg$currPos; + if (input.substr(peg$currPos, 4) === peg$c58) { + s1 = peg$c58; + peg$currPos += 4; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c59); } + } + if (s1 !== null) { + s2 = peg$parse_(); + if (s2 !== null) { + if (input.charCodeAt(peg$currPos) === 58) { + s3 = peg$c49; + peg$currPos++; + } else { + s3 = null; + if (peg$silentFails === 0) { peg$fail(peg$c50); } + } + if (s3 !== null) { + s4 = peg$parse_(); + if (s4 !== null) { + s5 = peg$parseTypeExpression(); + if (s5 !== null) { + peg$reportedPos = s0; + s1 = peg$c57(s5); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseParametersType() { + var s0, s1, s2, s3, s4, s5, s6; + + s0 = peg$currPos; + s1 = peg$parseRestParameterType(); + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c60(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + if (s0 === null) { + s0 = peg$currPos; + s1 = peg$parseNonRestParametersType(); + if (s1 !== null) { + s2 = peg$currPos; + s3 = peg$parse_(); + if (s3 !== null) { + if (input.charCodeAt(peg$currPos) === 44) { + s4 = peg$c40; + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c41); } + } + if (s4 !== null) { + s5 = peg$parse_(); + if (s5 !== null) { + s6 = peg$parseRestParameterType(); + if (s6 !== null) { + s3 = [s3, s4, s5, s6]; + s2 = s3; + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + if (s2 === null) { + s2 = peg$c1; + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c61(s1,s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } + + return s0; + } + + function peg$parseNonRestParametersType() { + var s0, s1, s2, s3, s4, s5, s6, s7; + + s0 = peg$currPos; + s1 = peg$parseParameterType(); + if (s1 !== null) { + s2 = []; + s3 = peg$currPos; + s4 = peg$parse_(); + if (s4 !== null) { + if (input.charCodeAt(peg$currPos) === 44) { + s5 = peg$c40; + peg$currPos++; + } else { + s5 = null; + if (peg$silentFails === 0) { peg$fail(peg$c41); } + } + if (s5 !== null) { + s6 = peg$parse_(); + if (s6 !== null) { + s7 = peg$parseParameterType(); + if (s7 !== null) { + s4 = [s4, s5, s6, s7]; + s3 = s4; + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + while (s3 !== null) { + s2.push(s3); + s3 = peg$currPos; + s4 = peg$parse_(); + if (s4 !== null) { + if (input.charCodeAt(peg$currPos) === 44) { + s5 = peg$c40; + peg$currPos++; + } else { + s5 = null; + if (peg$silentFails === 0) { peg$fail(peg$c41); } + } + if (s5 !== null) { + s6 = peg$parse_(); + if (s6 !== null) { + s7 = peg$parseParameterType(); + if (s7 !== null) { + s4 = [s4, s5, s6, s7]; + s3 = s4; + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c62(s1,s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + if (s0 === null) { + s0 = peg$parseOptionalParametersType(); + } + + return s0; + } + + function peg$parseOptionalParametersType() { + var s0, s1, s2, s3, s4, s5, s6, s7; + + s0 = peg$currPos; + s1 = peg$parseOptionalParameterType(); + if (s1 !== null) { + s2 = []; + s3 = peg$currPos; + s4 = peg$parse_(); + if (s4 !== null) { + if (input.charCodeAt(peg$currPos) === 44) { + s5 = peg$c40; + peg$currPos++; + } else { + s5 = null; + if (peg$silentFails === 0) { peg$fail(peg$c41); } + } + if (s5 !== null) { + s6 = peg$parse_(); + if (s6 !== null) { + s7 = peg$parseOptionalParameterType(); + if (s7 !== null) { + s4 = [s4, s5, s6, s7]; + s3 = s4; + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + while (s3 !== null) { + s2.push(s3); + s3 = peg$currPos; + s4 = peg$parse_(); + if (s4 !== null) { + if (input.charCodeAt(peg$currPos) === 44) { + s5 = peg$c40; + peg$currPos++; + } else { + s5 = null; + if (peg$silentFails === 0) { peg$fail(peg$c41); } + } + if (s5 !== null) { + s6 = peg$parse_(); + if (s6 !== null) { + s7 = peg$parseOptionalParameterType(); + if (s7 !== null) { + s4 = [s4, s5, s6, s7]; + s3 = s4; + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c63(s1,s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseParameterType() { + var s0, s1; + + s0 = peg$currPos; + s1 = peg$parseTypeExpression(); + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c64(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parseOptionalParameterType() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = peg$parseParameterType(); + if (s1 !== null) { + s2 = peg$parseOptional(); + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c65(s1); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseRestParameterType() { + var s0, s1, s2, s3, s4, s5, s6; + + s0 = peg$currPos; + s1 = peg$parseRepeatable(); + if (s1 !== null) { + if (input.charCodeAt(peg$currPos) === 91) { + s2 = peg$c66; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c67); } + } + if (s2 !== null) { + s3 = peg$parse_(); + if (s3 !== null) { + s4 = peg$parseParameterType(); + if (s4 !== null) { + s5 = peg$parse_(); + if (s5 !== null) { + if (input.charCodeAt(peg$currPos) === 93) { + s6 = peg$c68; + peg$currPos++; + } else { + s6 = null; + if (peg$silentFails === 0) { peg$fail(peg$c69); } + } + if (s6 !== null) { + peg$reportedPos = s0; + s1 = peg$c31(s4); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + if (s0 === null) { + s0 = peg$currPos; + s1 = peg$parseRepeatable(); + if (s1 !== null) { + s2 = peg$parseParameterType(); + if (s2 === null) { + s2 = peg$c1; + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c70(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + if (s0 === null) { + s0 = peg$currPos; + s1 = peg$parseRepeatable(); + if (s1 !== null) { + s2 = peg$currPos; + peg$silentFails++; + if (input.charCodeAt(peg$currPos) === 91) { + s3 = peg$c66; + peg$currPos++; + } else { + s3 = null; + if (peg$silentFails === 0) { peg$fail(peg$c67); } + } + peg$silentFails--; + if (s3 === null) { + s2 = peg$c1; + } else { + peg$currPos = s2; + s2 = peg$c0; + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c71(); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } + } + + return s0; + } + + function peg$parseTypeUnion() { + var s0; + + s0 = peg$parseTypeUnionRepeatable(); + if (s0 === null) { + s0 = peg$parseTypeUnionNonRepeatable(); + } + + return s0; + } + + function peg$parseTypeUnionNonRepeatable() { + var s0, s1, s2, s3, s4, s5, s6, s7; + + s0 = peg$currPos; + s1 = peg$parse_(); + if (s1 !== null) { + if (input.charCodeAt(peg$currPos) === 40) { + s2 = peg$c45; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c46); } + } + if (s2 !== null) { + s3 = peg$parse_(); + if (s3 !== null) { + s4 = peg$parseTypeUnionList(); + if (s4 === null) { + s4 = peg$c1; + } + if (s4 !== null) { + s5 = peg$parse_(); + if (s5 !== null) { + if (input.charCodeAt(peg$currPos) === 41) { + s6 = peg$c47; + peg$currPos++; + } else { + s6 = null; + if (peg$silentFails === 0) { peg$fail(peg$c48); } + } + if (s6 !== null) { + s7 = peg$parseOptional(); + if (s7 === null) { + s7 = peg$c1; + } + if (s7 !== null) { + peg$reportedPos = s0; + s1 = peg$c72(s4,s7); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseTypeUnionRepeatable() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = peg$parseRepeatable(); + if (s1 !== null) { + s2 = peg$parseTypeUnionNonRepeatable(); + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c73(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseTypeUnionList() { + var s0, s1, s2, s3, s4, s5; + + s0 = peg$currPos; + s1 = peg$parseTypeExpression(); + if (s1 !== null) { + s2 = []; + s3 = peg$currPos; + s4 = peg$parseTypeUnionSeparator(); + if (s4 !== null) { + s5 = peg$parseTypeExpression(); + if (s5 !== null) { + s4 = [s4, s5]; + s3 = s4; + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + while (s3 !== null) { + s2.push(s3); + s3 = peg$currPos; + s4 = peg$parseTypeUnionSeparator(); + if (s4 !== null) { + s5 = peg$parseTypeExpression(); + if (s5 !== null) { + s4 = [s4, s5]; + s3 = s4; + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c74(s1,s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseRestrictedTypeUnionList() { + var s0, s1, s2, s3, s4, s5; + + s0 = peg$currPos; + s1 = peg$parseModifiedRestrictedTypeExpression(); + if (s1 !== null) { + s2 = []; + s3 = peg$currPos; + s4 = peg$parseTypeUnionSeparator(); + if (s4 !== null) { + s5 = peg$parseModifiedRestrictedTypeExpression(); + if (s5 !== null) { + s4 = [s4, s5]; + s3 = s4; + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + if (s3 !== null) { + while (s3 !== null) { + s2.push(s3); + s3 = peg$currPos; + s4 = peg$parseTypeUnionSeparator(); + if (s4 !== null) { + s5 = peg$parseModifiedRestrictedTypeExpression(); + if (s5 !== null) { + s4 = [s4, s5]; + s3 = s4; + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } + } else { + s2 = peg$c0; + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c75(s1,s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseTypeUnionLegacySyntax() { + var s0, s1, s2, s3, s4, s5, s6, s7; + + s0 = peg$currPos; + s1 = peg$parse_(); + if (s1 !== null) { + s2 = peg$currPos; + peg$silentFails++; + if (input.charCodeAt(peg$currPos) === 40) { + s3 = peg$c45; + peg$currPos++; + } else { + s3 = null; + if (peg$silentFails === 0) { peg$fail(peg$c46); } + } + peg$silentFails--; + if (s3 === null) { + s2 = peg$c1; + } else { + peg$currPos = s2; + s2 = peg$c0; + } + if (s2 !== null) { + s3 = peg$parse_(); + if (s3 !== null) { + s4 = peg$parseRestrictedTypeUnionList(); + if (s4 !== null) { + s5 = peg$parse_(); + if (s5 !== null) { + s6 = peg$currPos; + peg$silentFails++; + if (input.charCodeAt(peg$currPos) === 41) { + s7 = peg$c47; + peg$currPos++; + } else { + s7 = null; + if (peg$silentFails === 0) { peg$fail(peg$c48); } + } + peg$silentFails--; + if (s7 === null) { + s6 = peg$c1; + } else { + peg$currPos = s6; + s6 = peg$c0; + } + if (s6 !== null) { + peg$reportedPos = s0; + s1 = peg$c76(s4); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseTypeUnionSeparator() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + s1 = peg$parse_(); + if (s1 !== null) { + if (input.charCodeAt(peg$currPos) === 124) { + s2 = peg$c77; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c78); } + } + if (s2 !== null) { + s3 = peg$parse_(); + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c79(); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseRecordType() { + var s0; + + s0 = peg$parseRecordTypeRepeatable(); + if (s0 === null) { + s0 = peg$parseRecordTypeNonRepeatable(); + } + + return s0; + } + + function peg$parseRecordTypeNonRepeatable() { + var s0, s1, s2, s3, s4, s5, s6, s7; + + s0 = peg$currPos; + s1 = peg$parse_(); + if (s1 !== null) { + if (input.charCodeAt(peg$currPos) === 123) { + s2 = peg$c80; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c81); } + } + if (s2 !== null) { + s3 = peg$parse_(); + if (s3 !== null) { + s4 = peg$parseFieldTypeList(); + if (s4 === null) { + s4 = peg$c1; + } + if (s4 !== null) { + s5 = peg$parse_(); + if (s5 !== null) { + if (input.charCodeAt(peg$currPos) === 125) { + s6 = peg$c82; + peg$currPos++; + } else { + s6 = null; + if (peg$silentFails === 0) { peg$fail(peg$c83); } + } + if (s6 !== null) { + s7 = peg$parseOptional(); + if (s7 === null) { + s7 = peg$c1; + } + if (s7 !== null) { + peg$reportedPos = s0; + s1 = peg$c84(s4,s7); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseRecordTypeRepeatable() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = peg$parseRepeatable(); + if (s1 !== null) { + s2 = peg$parseRecordTypeNonRepeatable(); + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c31(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseFieldTypeList() { + var s0, s1, s2, s3, s4, s5, s6, s7; + + s0 = peg$currPos; + s1 = peg$parseFieldType(); + if (s1 !== null) { + s2 = []; + s3 = peg$currPos; + s4 = peg$parse_(); + if (s4 !== null) { + if (input.charCodeAt(peg$currPos) === 44) { + s5 = peg$c40; + peg$currPos++; + } else { + s5 = null; + if (peg$silentFails === 0) { peg$fail(peg$c41); } + } + if (s5 !== null) { + s6 = peg$parse_(); + if (s6 !== null) { + s7 = peg$parseFieldType(); + if (s7 !== null) { + s4 = [s4, s5, s6, s7]; + s3 = s4; + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + while (s3 !== null) { + s2.push(s3); + s3 = peg$currPos; + s4 = peg$parse_(); + if (s4 !== null) { + if (input.charCodeAt(peg$currPos) === 44) { + s5 = peg$c40; + peg$currPos++; + } else { + s5 = null; + if (peg$silentFails === 0) { peg$fail(peg$c41); } + } + if (s5 !== null) { + s6 = peg$parse_(); + if (s6 !== null) { + s7 = peg$parseFieldType(); + if (s7 !== null) { + s4 = [s4, s5, s6, s7]; + s3 = s4; + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c85(s1,s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseFieldType() { + var s0, s1, s2, s3, s4, s5, s6; + + s0 = peg$currPos; + s1 = peg$parseFieldName(); + if (s1 !== null) { + s2 = peg$currPos; + s3 = peg$parse_(); + if (s3 !== null) { + if (input.charCodeAt(peg$currPos) === 58) { + s4 = peg$c49; + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c50); } + } + if (s4 !== null) { + s5 = peg$parse_(); + if (s5 !== null) { + s6 = peg$parseTypeExpression(); + if (s6 !== null) { + s3 = [s3, s4, s5, s6]; + s2 = s3; + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + if (s2 === null) { + s2 = peg$c1; + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c86(s1,s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseFieldName() { + var s0, s1; + + s0 = peg$parseNameExpressionTypeNonRepeatable(); + if (s0 === null) { + s0 = peg$parseReservedWordNameExpressionTypeNonRepeatable(); + if (s0 === null) { + s0 = peg$currPos; + s1 = peg$parseTypeExpression(); + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c87(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } + } + + return s0; + } + + function peg$parseNameExpression() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = peg$parseDoubleStringLiteral(); + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c88(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + if (s0 === null) { + s0 = peg$currPos; + s1 = peg$parseSingleStringLiteral(); + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c89(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + if (s0 === null) { + s0 = peg$currPos; + s1 = peg$parseIdentifier(); + if (s1 !== null) { + s2 = peg$parsePropertyChain(); + if (s2 === null) { + s2 = peg$c1; + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c90(s1,s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } + } + + return s0; + } + + function peg$parseReservedWordNameExpression() { + var s0, s1; + + s0 = peg$currPos; + s1 = peg$parseReservedWord(); + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c91(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parsePropertyIdentifier() { + var s0, s1; + + s0 = peg$parseIdentifier(); + if (s0 === null) { + s0 = peg$currPos; + s1 = peg$parseDoubleStringLiteral(); + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c92(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + if (s0 === null) { + s0 = peg$currPos; + s1 = peg$parseSingleStringLiteral(); + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c93(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + if (s0 === null) { + s0 = peg$parseNumericLiteral(); + if (s0 === null) { + s0 = peg$parseKeyword(); + if (s0 === null) { + s0 = peg$parseFutureReservedWord(); + } + } + } + } + } + + return s0; + } + + function peg$parsePropertyChain() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = []; + s2 = peg$parsePropertyChainItem(); + if (s2 !== null) { + while (s2 !== null) { + s1.push(s2); + s2 = peg$parsePropertyChainItem(); + } + } else { + s1 = peg$c0; + } + if (s1 !== null) { + s1 = input.substring(s0, peg$currPos); + } + s0 = s1; + + return s0; + } + + function peg$parsePropertyChainItem() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 46) { + s1 = peg$c33; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c34); } + } + if (s1 === null) { + if (input.charCodeAt(peg$currPos) === 35) { + s1 = peg$c94; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c95); } + } + if (s1 === null) { + if (input.charCodeAt(peg$currPos) === 126) { + s1 = peg$c96; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c97); } + } + if (s1 === null) { + if (input.charCodeAt(peg$currPos) === 58) { + s1 = peg$c49; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c50); } + } + if (s1 === null) { + if (input.charCodeAt(peg$currPos) === 47) { + s1 = peg$c98; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c99); } + } + } + } + } + } + if (s1 !== null) { + s2 = peg$currPos; + peg$silentFails++; + if (input.charCodeAt(peg$currPos) === 60) { + s3 = peg$c35; + peg$currPos++; + } else { + s3 = null; + if (peg$silentFails === 0) { peg$fail(peg$c36); } + } + peg$silentFails--; + if (s3 === null) { + s2 = peg$c1; + } else { + peg$currPos = s2; + s2 = peg$c0; + } + if (s2 !== null) { + s3 = peg$parsePropertyIdentifier(); + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c100(s1,s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseNamespaceExpression() { + var s0; + + s0 = peg$parseNameExpression(); + if (s0 === null) { + s0 = peg$parseStringLiteral(); + } + + return s0; + } + + function peg$parseIdentifier() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = peg$currPos; + peg$silentFails++; + s2 = peg$parseReservedWord(); + peg$silentFails--; + if (s2 === null) { + s1 = peg$c1; + } else { + peg$currPos = s1; + s1 = peg$c0; + } + if (s1 !== null) { + s2 = peg$parseIdentifierName(); + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c101(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseIdentifierName() { + var s0, s1, s2, s3, s4; + + s0 = peg$currPos; + s1 = peg$currPos; + s2 = peg$parseIdentifierStart(); + if (s2 !== null) { + s3 = []; + s4 = peg$parseIdentifierPart(); + while (s4 !== null) { + s3.push(s4); + s4 = peg$parseIdentifierPart(); + } + if (s3 !== null) { + s4 = peg$parseIdentifierEnd(); + if (s4 === null) { + s4 = peg$c1; + } + if (s4 !== null) { + s2 = [s2, s3, s4]; + s1 = s2; + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } else { + peg$currPos = s1; + s1 = peg$c0; + } + if (s1 !== null) { + s1 = input.substring(s0, peg$currPos); + } + s0 = s1; + + return s0; + } + + function peg$parseIdentifierStart() { + var s0; + + s0 = peg$parseUnicodeLetter(); + if (s0 === null) { + if (input.charCodeAt(peg$currPos) === 36) { + s0 = peg$c102; + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c103); } + } + if (s0 === null) { + if (input.charCodeAt(peg$currPos) === 95) { + s0 = peg$c104; + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c105); } + } + if (s0 === null) { + s0 = peg$parseUnicodeEscapeSequenceLiteral(); + } + } + } + + return s0; + } + + function peg$parseIdentifierPart() { + var s0; + + s0 = peg$parseIdentifierStart(); + if (s0 === null) { + if (input.charCodeAt(peg$currPos) === 45) { + s0 = peg$c106; + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c107); } + } + if (s0 === null) { + s0 = peg$parseUnicodeMc(); + if (s0 === null) { + s0 = peg$parseUnicodeNd(); + if (s0 === null) { + s0 = peg$parseUnicodePc(); + if (s0 === null) { + if (input.charCodeAt(peg$currPos) === 8204) { + s0 = peg$c108; + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c109); } + } + if (s0 === null) { + if (input.charCodeAt(peg$currPos) === 8205) { + s0 = peg$c110; + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c111); } + } + } + } + } + } + } + } + + return s0; + } + + function peg$parseIdentifierEnd() { + var s0, s1, s2, s3, s4, s5; + + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 40) { + s1 = peg$c45; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c46); } + } + if (s1 !== null) { + s2 = peg$parse_(); + if (s2 !== null) { + s3 = []; + s4 = peg$parseIdentifierPart(); + while (s4 !== null) { + s3.push(s4); + s4 = peg$parseIdentifierPart(); + } + if (s3 !== null) { + s4 = peg$parse_(); + if (s4 !== null) { + if (input.charCodeAt(peg$currPos) === 41) { + s5 = peg$c47; + peg$currPos++; + } else { + s5 = null; + if (peg$silentFails === 0) { peg$fail(peg$c48); } + } + if (s5 !== null) { + peg$reportedPos = s0; + s1 = peg$c112(s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + if (s0 === null) { + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 40) { + s1 = peg$c45; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c46); } + } + if (s1 !== null) { + s2 = peg$parse_(); + if (s2 !== null) { + s3 = peg$parseParametersType(); + if (s3 === null) { + s3 = peg$c1; + } + if (s3 !== null) { + s4 = peg$parse_(); + if (s4 !== null) { + if (input.charCodeAt(peg$currPos) === 41) { + s5 = peg$c47; + peg$currPos++; + } else { + s5 = null; + if (peg$silentFails === 0) { peg$fail(peg$c48); } + } + if (s5 !== null) { + peg$reportedPos = s0; + s1 = peg$c113(s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + if (s0 === null) { + s0 = peg$parseIdentifierPart(); + } + } + + return s0; + } + + function peg$parseReservedWord() { + var s0; + + s0 = peg$parseKeyword(); + if (s0 === null) { + s0 = peg$parseFutureReservedWord(); + if (s0 === null) { + s0 = peg$parseNullLiteral(); + if (s0 === null) { + s0 = peg$parseBooleanLiteral(); + } + } + } + + return s0; + } + + function peg$parseKeyword() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + s1 = peg$currPos; + if (input.substr(peg$currPos, 5) === peg$c114) { + s2 = peg$c114; + peg$currPos += 5; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c115); } + } + if (s2 === null) { + if (input.substr(peg$currPos, 4) === peg$c116) { + s2 = peg$c116; + peg$currPos += 4; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c117); } + } + if (s2 === null) { + if (input.substr(peg$currPos, 5) === peg$c118) { + s2 = peg$c118; + peg$currPos += 5; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c119); } + } + if (s2 === null) { + if (input.substr(peg$currPos, 8) === peg$c120) { + s2 = peg$c120; + peg$currPos += 8; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c121); } + } + if (s2 === null) { + if (input.substr(peg$currPos, 8) === peg$c122) { + s2 = peg$c122; + peg$currPos += 8; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c123); } + } + if (s2 === null) { + if (input.substr(peg$currPos, 7) === peg$c124) { + s2 = peg$c124; + peg$currPos += 7; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c125); } + } + if (s2 === null) { + if (input.substr(peg$currPos, 6) === peg$c126) { + s2 = peg$c126; + peg$currPos += 6; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c127); } + } + if (s2 === null) { + if (input.substr(peg$currPos, 2) === peg$c128) { + s2 = peg$c128; + peg$currPos += 2; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c129); } + } + if (s2 === null) { + if (input.substr(peg$currPos, 4) === peg$c130) { + s2 = peg$c130; + peg$currPos += 4; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c131); } + } + if (s2 === null) { + if (input.substr(peg$currPos, 7) === peg$c132) { + s2 = peg$c132; + peg$currPos += 7; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c133); } + } + if (s2 === null) { + if (input.substr(peg$currPos, 3) === peg$c134) { + s2 = peg$c134; + peg$currPos += 3; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c135); } + } + if (s2 === null) { + s2 = peg$parseFunctionLiteralLc(); + if (s2 === null) { + if (input.substr(peg$currPos, 2) === peg$c136) { + s2 = peg$c136; + peg$currPos += 2; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c137); } + } + if (s2 === null) { + if (input.substr(peg$currPos, 2) === peg$c138) { + s2 = peg$c138; + peg$currPos += 2; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c139); } + } + if (s2 === null) { + if (input.substr(peg$currPos, 10) === peg$c140) { + s2 = peg$c140; + peg$currPos += 10; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c141); } + } + if (s2 === null) { + if (input.substr(peg$currPos, 3) === peg$c55) { + s2 = peg$c55; + peg$currPos += 3; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c56); } + } + if (s2 === null) { + if (input.substr(peg$currPos, 6) === peg$c142) { + s2 = peg$c142; + peg$currPos += 6; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c143); } + } + if (s2 === null) { + if (input.substr(peg$currPos, 6) === peg$c144) { + s2 = peg$c144; + peg$currPos += 6; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c145); } + } + if (s2 === null) { + if (input.substr(peg$currPos, 4) === peg$c58) { + s2 = peg$c58; + peg$currPos += 4; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c59); } + } + if (s2 === null) { + if (input.substr(peg$currPos, 5) === peg$c146) { + s2 = peg$c146; + peg$currPos += 5; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c147); } + } + if (s2 === null) { + if (input.substr(peg$currPos, 3) === peg$c148) { + s2 = peg$c148; + peg$currPos += 3; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c149); } + } + if (s2 === null) { + if (input.substr(peg$currPos, 6) === peg$c150) { + s2 = peg$c150; + peg$currPos += 6; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c151); } + } + if (s2 === null) { + if (input.substr(peg$currPos, 3) === peg$c152) { + s2 = peg$c152; + peg$currPos += 3; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c153); } + } + if (s2 === null) { + if (input.substr(peg$currPos, 4) === peg$c154) { + s2 = peg$c154; + peg$currPos += 4; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c155); } + } + if (s2 === null) { + if (input.substr(peg$currPos, 5) === peg$c156) { + s2 = peg$c156; + peg$currPos += 5; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c157); } + } + if (s2 === null) { + if (input.substr(peg$currPos, 4) === peg$c158) { + s2 = peg$c158; + peg$currPos += 4; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c159); } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + if (s2 !== null) { + s2 = input.substring(s1, peg$currPos); + } + s1 = s2; + if (s1 !== null) { + s2 = peg$currPos; + peg$silentFails++; + s3 = peg$parseIdentifierPart(); + peg$silentFails--; + if (s3 === null) { + s2 = peg$c1; + } else { + peg$currPos = s2; + s2 = peg$c0; + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c160(s1); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseFutureReservedWord() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + s1 = peg$currPos; + if (input.substr(peg$currPos, 5) === peg$c161) { + s2 = peg$c161; + peg$currPos += 5; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c162); } + } + if (s2 === null) { + if (input.substr(peg$currPos, 5) === peg$c163) { + s2 = peg$c163; + peg$currPos += 5; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c164); } + } + if (s2 === null) { + if (input.substr(peg$currPos, 4) === peg$c165) { + s2 = peg$c165; + peg$currPos += 4; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c166); } + } + if (s2 === null) { + if (input.substr(peg$currPos, 6) === peg$c167) { + s2 = peg$c167; + peg$currPos += 6; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c168); } + } + if (s2 === null) { + if (input.substr(peg$currPos, 7) === peg$c169) { + s2 = peg$c169; + peg$currPos += 7; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c170); } + } + if (s2 === null) { + if (input.substr(peg$currPos, 6) === peg$c171) { + s2 = peg$c171; + peg$currPos += 6; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c172); } + } + if (s2 === null) { + if (input.substr(peg$currPos, 5) === peg$c173) { + s2 = peg$c173; + peg$currPos += 5; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c174); } + } + if (s2 === null) { + if (input.substr(peg$currPos, 10) === peg$c175) { + s2 = peg$c175; + peg$currPos += 10; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c176); } + } + if (s2 === null) { + if (input.substr(peg$currPos, 9) === peg$c177) { + s2 = peg$c177; + peg$currPos += 9; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c178); } + } + if (s2 === null) { + if (input.substr(peg$currPos, 3) === peg$c179) { + s2 = peg$c179; + peg$currPos += 3; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c180); } + } + if (s2 === null) { + if (input.substr(peg$currPos, 7) === peg$c181) { + s2 = peg$c181; + peg$currPos += 7; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c182); } + } + if (s2 === null) { + if (input.substr(peg$currPos, 7) === peg$c183) { + s2 = peg$c183; + peg$currPos += 7; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c184); } + } + if (s2 === null) { + if (input.substr(peg$currPos, 9) === peg$c185) { + s2 = peg$c185; + peg$currPos += 9; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c186); } + } + if (s2 === null) { + if (input.substr(peg$currPos, 6) === peg$c187) { + s2 = peg$c187; + peg$currPos += 6; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c188); } + } + if (s2 === null) { + if (input.substr(peg$currPos, 6) === peg$c189) { + s2 = peg$c189; + peg$currPos += 6; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c190); } + } + if (s2 === null) { + if (input.substr(peg$currPos, 5) === peg$c191) { + s2 = peg$c191; + peg$currPos += 5; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c192); } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + if (s2 !== null) { + s2 = input.substring(s1, peg$currPos); + } + s1 = s2; + if (s1 !== null) { + s2 = peg$currPos; + peg$silentFails++; + s3 = peg$parseIdentifierPart(); + peg$silentFails--; + if (s3 === null) { + s2 = peg$c1; + } else { + peg$currPos = s2; + s2 = peg$c0; + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c193(s1); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseStringLiteral() { + var s0; + + s0 = peg$parseDoubleStringLiteral(); + if (s0 === null) { + s0 = peg$parseSingleStringLiteral(); + } + + return s0; + } + + function peg$parseDoubleStringLiteral() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 34) { + s1 = peg$c194; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c195); } + } + if (s1 !== null) { + s2 = []; + s3 = peg$parseDoubleStringCharacter(); + while (s3 !== null) { + s2.push(s3); + s3 = peg$parseDoubleStringCharacter(); + } + if (s2 !== null) { + if (input.charCodeAt(peg$currPos) === 34) { + s3 = peg$c194; + peg$currPos++; + } else { + s3 = null; + if (peg$silentFails === 0) { peg$fail(peg$c195); } + } + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c196(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseSingleStringLiteral() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 39) { + s1 = peg$c197; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c198); } + } + if (s1 !== null) { + s2 = []; + s3 = peg$parseSingleStringCharacter(); + while (s3 !== null) { + s2.push(s3); + s3 = peg$parseSingleStringCharacter(); + } + if (s2 !== null) { + if (input.charCodeAt(peg$currPos) === 39) { + s3 = peg$c197; + peg$currPos++; + } else { + s3 = null; + if (peg$silentFails === 0) { peg$fail(peg$c198); } + } + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c196(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseNumericLiteral() { + var s0; + + s0 = peg$parseDecimalLiteral(); + if (s0 === null) { + s0 = peg$parseHexIntegerLiteral(); + } + + return s0; + } + + function peg$parseDecimalLiteral() { + var s0, s1, s2, s3, s4; + + s0 = peg$currPos; + s1 = peg$parseDecimalIntegerLiteral(); + if (s1 !== null) { + if (input.charCodeAt(peg$currPos) === 46) { + s2 = peg$c33; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c34); } + } + if (s2 !== null) { + s3 = peg$parseDecimalDigits(); + if (s3 === null) { + s3 = peg$c1; + } + if (s3 !== null) { + s4 = peg$parseExponentPart(); + if (s4 === null) { + s4 = peg$c1; + } + if (s4 !== null) { + peg$reportedPos = s0; + s1 = peg$c199(s1,s3,s4); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + if (s0 === null) { + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 46) { + s1 = peg$c33; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c34); } + } + if (s1 !== null) { + s2 = peg$parseDecimalDigits(); + if (s2 !== null) { + s3 = peg$parseExponentPart(); + if (s3 === null) { + s3 = peg$c1; + } + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c200(s2,s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + if (s0 === null) { + s0 = peg$currPos; + s1 = peg$parseDecimalIntegerLiteral(); + if (s1 !== null) { + s2 = peg$parseExponentPart(); + if (s2 === null) { + s2 = peg$c1; + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c201(s1,s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } + } + + return s0; + } + + function peg$parseDecimalIntegerLiteral() { + var s0, s1, s2, s3; + + if (input.charCodeAt(peg$currPos) === 48) { + s0 = peg$c202; + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c203); } + } + if (s0 === null) { + s0 = peg$currPos; + s1 = peg$currPos; + s2 = peg$parseNonZeroDigit(); + if (s2 !== null) { + s3 = peg$parseDecimalDigits(); + if (s3 === null) { + s3 = peg$c1; + } + if (s3 !== null) { + s2 = [s2, s3]; + s1 = s2; + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } else { + peg$currPos = s1; + s1 = peg$c0; + } + if (s1 !== null) { + s1 = input.substring(s0, peg$currPos); + } + s0 = s1; + } + + return s0; + } + + function peg$parseDecimalDigits() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = []; + s2 = peg$parseDecimalDigit(); + if (s2 !== null) { + while (s2 !== null) { + s1.push(s2); + s2 = peg$parseDecimalDigit(); + } + } else { + s1 = peg$c0; + } + if (s1 !== null) { + s1 = input.substring(s0, peg$currPos); + } + s0 = s1; + + return s0; + } + + function peg$parseExponentPart() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + s1 = peg$currPos; + s2 = peg$parseExponentIndicator(); + if (s2 !== null) { + s3 = peg$parseSignedInteger(); + if (s3 !== null) { + s2 = [s2, s3]; + s1 = s2; + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } else { + peg$currPos = s1; + s1 = peg$c0; + } + if (s1 !== null) { + s1 = input.substring(s0, peg$currPos); + } + s0 = s1; + + return s0; + } + + function peg$parseExponentIndicator() { + var s0; + + if (peg$c204.test(input.charAt(peg$currPos))) { + s0 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c205); } + } + + return s0; + } + + function peg$parseSignedInteger() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + s1 = peg$currPos; + if (peg$c206.test(input.charAt(peg$currPos))) { + s2 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c207); } + } + if (s2 === null) { + s2 = peg$c1; + } + if (s2 !== null) { + s3 = peg$parseDecimalDigits(); + if (s3 !== null) { + s2 = [s2, s3]; + s1 = s2; + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } else { + peg$currPos = s1; + s1 = peg$c0; + } + if (s1 !== null) { + s1 = input.substring(s0, peg$currPos); + } + s0 = s1; + + return s0; + } + + function peg$parseHexIntegerLiteral() { + var s0, s1, s2, s3, s4, s5; + + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 48) { + s1 = peg$c202; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c203); } + } + if (s1 !== null) { + if (peg$c208.test(input.charAt(peg$currPos))) { + s2 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c209); } + } + if (s2 !== null) { + s3 = peg$currPos; + s4 = []; + s5 = peg$parseHexDigit(); + if (s5 !== null) { + while (s5 !== null) { + s4.push(s5); + s5 = peg$parseHexDigit(); + } + } else { + s4 = peg$c0; + } + if (s4 !== null) { + s4 = input.substring(s3, peg$currPos); + } + s3 = s4; + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c210(s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseNullLiteral() { + var s0; + + if (input.substr(peg$currPos, 4) === peg$c211) { + s0 = peg$c211; + peg$currPos += 4; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c212); } + } + + return s0; + } + + function peg$parseUndefinedLiteral() { + var s0; + + if (input.substr(peg$currPos, 9) === peg$c213) { + s0 = peg$c213; + peg$currPos += 9; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c214); } + } + + return s0; + } + + function peg$parseUnknownLiteral() { + var s0, s1; + + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 63) { + s1 = peg$c3; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c4); } + } + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c215(); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parseBooleanLiteral() { + var s0; + + if (input.substr(peg$currPos, 4) === peg$c216) { + s0 = peg$c216; + peg$currPos += 4; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c217); } + } + if (s0 === null) { + if (input.substr(peg$currPos, 5) === peg$c218) { + s0 = peg$c218; + peg$currPos += 5; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c219); } + } + } + + return s0; + } + + function peg$parseFunctionLiteral() { + var s0; + + s0 = peg$parseFunctionLiteralUc(); + if (s0 === null) { + s0 = peg$parseFunctionLiteralLc(); + } + + return s0; + } + + function peg$parseFunctionLiteralUc() { + var s0; + + if (input.substr(peg$currPos, 8) === peg$c220) { + s0 = peg$c220; + peg$currPos += 8; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c221); } + } + + return s0; + } + + function peg$parseFunctionLiteralLc() { + var s0; + + if (input.substr(peg$currPos, 8) === peg$c222) { + s0 = peg$c222; + peg$currPos += 8; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c223); } + } + + return s0; + } + + function peg$parseUnicodeLetter() { + var s0; + + s0 = peg$parseUnicodeLu(); + if (s0 === null) { + s0 = peg$parseUnicodeLl(); + if (s0 === null) { + s0 = peg$parseUnicodeLt(); + if (s0 === null) { + s0 = peg$parseUnicodeLm(); + if (s0 === null) { + s0 = peg$parseUnicodeLo(); + if (s0 === null) { + s0 = peg$parseUnicodeLn(); + } + } + } + } + } + + return s0; + } + + function peg$parseUnicodeEscapeSequenceLiteral() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + s1 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 92) { + s2 = peg$c224; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c225); } + } + if (s2 !== null) { + s3 = peg$parseUnicodeEscapeSequence(); + if (s3 !== null) { + s2 = [s2, s3]; + s1 = s2; + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } else { + peg$currPos = s1; + s1 = peg$c0; + } + if (s1 !== null) { + s1 = input.substring(s0, peg$currPos); + } + s0 = s1; + + return s0; + } + + function peg$parseUnicodeEscapeSequence() { + var s0, s1, s2, s3, s4, s5, s6, s7; + + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 117) { + s1 = peg$c226; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c227); } + } + if (s1 !== null) { + s2 = peg$currPos; + s3 = peg$currPos; + s4 = peg$parseHexDigit(); + if (s4 !== null) { + s5 = peg$parseHexDigit(); + if (s5 !== null) { + s6 = peg$parseHexDigit(); + if (s6 !== null) { + s7 = peg$parseHexDigit(); + if (s7 !== null) { + s4 = [s4, s5, s6, s7]; + s3 = s4; + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + if (s3 !== null) { + s3 = input.substring(s2, peg$currPos); + } + s2 = s3; + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c228(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseDecimalDigit() { + var s0; + + if (peg$c229.test(input.charAt(peg$currPos))) { + s0 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c230); } + } + + return s0; + } + + function peg$parseNonZeroDigit() { + var s0; + + if (peg$c231.test(input.charAt(peg$currPos))) { + s0 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c232); } + } + + return s0; + } + + function peg$parseHexDigit() { + var s0; + + if (peg$c233.test(input.charAt(peg$currPos))) { + s0 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c234); } + } + + return s0; + } + + function peg$parseUnicodeMc() { + var s0, s1; + + peg$silentFails++; + if (peg$c236.test(input.charAt(peg$currPos))) { + s0 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c237); } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c235); } + } + + return s0; + } + + function peg$parseUnicodeNd() { + var s0, s1; + + peg$silentFails++; + if (peg$c239.test(input.charAt(peg$currPos))) { + s0 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c240); } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c238); } + } + + return s0; + } + + function peg$parseUnicodePc() { + var s0, s1; + + peg$silentFails++; + if (peg$c242.test(input.charAt(peg$currPos))) { + s0 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c243); } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c241); } + } + + return s0; + } + + function peg$parseUnicodeLu() { + var s0, s1; + + peg$silentFails++; + if (peg$c245.test(input.charAt(peg$currPos))) { + s0 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c246); } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c244); } + } + + return s0; + } + + function peg$parseUnicodeLl() { + var s0, s1; + + peg$silentFails++; + if (peg$c248.test(input.charAt(peg$currPos))) { + s0 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c249); } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c247); } + } + + return s0; + } + + function peg$parseUnicodeLt() { + var s0, s1; + + peg$silentFails++; + if (peg$c251.test(input.charAt(peg$currPos))) { + s0 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c252); } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c250); } + } + + return s0; + } + + function peg$parseUnicodeLm() { + var s0, s1; + + peg$silentFails++; + if (peg$c254.test(input.charAt(peg$currPos))) { + s0 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c255); } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c253); } + } + + return s0; + } + + function peg$parseUnicodeLo() { + var s0, s1; + + peg$silentFails++; + if (peg$c257.test(input.charAt(peg$currPos))) { + s0 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c258); } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c256); } + } + + return s0; + } + + function peg$parseUnicodeLn() { + var s0, s1; + + peg$silentFails++; + if (peg$c260.test(input.charAt(peg$currPos))) { + s0 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c261); } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c259); } + } + + return s0; + } + + function peg$parseUnicodeZs() { + var s0, s1; + + peg$silentFails++; + if (peg$c263.test(input.charAt(peg$currPos))) { + s0 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c264); } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c262); } + } + + return s0; + } + + function peg$parseDoubleStringCharacter() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = peg$currPos; + peg$silentFails++; + if (input.charCodeAt(peg$currPos) === 34) { + s2 = peg$c194; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c195); } + } + if (s2 === null) { + if (input.charCodeAt(peg$currPos) === 92) { + s2 = peg$c224; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c225); } + } + if (s2 === null) { + s2 = peg$parseLineTerminator(); + } + } + peg$silentFails--; + if (s2 === null) { + s1 = peg$c1; + } else { + peg$currPos = s1; + s1 = peg$c0; + } + if (s1 !== null) { + s2 = peg$parseSourceCharacter(); + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c265(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + if (s0 === null) { + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 92) { + s1 = peg$c224; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c225); } + } + if (s1 !== null) { + s2 = peg$parseEscapeSequence(); + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c266(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + if (s0 === null) { + s0 = peg$parseLineContinuation(); + } + } + + return s0; + } + + function peg$parseSingleStringCharacter() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = peg$currPos; + peg$silentFails++; + if (input.charCodeAt(peg$currPos) === 39) { + s2 = peg$c197; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c198); } + } + if (s2 === null) { + if (input.charCodeAt(peg$currPos) === 92) { + s2 = peg$c224; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c225); } + } + if (s2 === null) { + s2 = peg$parseLineTerminator(); + } + } + peg$silentFails--; + if (s2 === null) { + s1 = peg$c1; + } else { + peg$currPos = s1; + s1 = peg$c0; + } + if (s1 !== null) { + s2 = peg$parseSourceCharacter(); + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c265(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + if (s0 === null) { + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 92) { + s1 = peg$c224; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c225); } + } + if (s1 !== null) { + s2 = peg$parseEscapeSequence(); + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c266(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + if (s0 === null) { + s0 = peg$parseLineContinuation(); + } + } + + return s0; + } + + function peg$parseLineTerminatorSequence() { + var s0, s1, s2, s3; + + if (input.charCodeAt(peg$currPos) === 10) { + s0 = peg$c267; + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c268); } + } + if (s0 === null) { + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 13) { + s1 = peg$c269; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c270); } + } + if (s1 !== null) { + s2 = peg$currPos; + peg$silentFails++; + if (input.charCodeAt(peg$currPos) === 10) { + s3 = peg$c267; + peg$currPos++; + } else { + s3 = null; + if (peg$silentFails === 0) { peg$fail(peg$c268); } + } + peg$silentFails--; + if (s3 === null) { + s2 = peg$c1; + } else { + peg$currPos = s2; + s2 = peg$c0; + } + if (s2 !== null) { + s1 = [s1, s2]; + s0 = s1; + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + if (s0 === null) { + if (input.charCodeAt(peg$currPos) === 8232) { + s0 = peg$c271; + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c272); } + } + if (s0 === null) { + if (input.charCodeAt(peg$currPos) === 8233) { + s0 = peg$c273; + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c274); } + } + if (s0 === null) { + if (input.substr(peg$currPos, 2) === peg$c275) { + s0 = peg$c275; + peg$currPos += 2; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c276); } + } + } + } + } + } + + return s0; + } + + function peg$parseLineTerminator() { + var s0; + + if (input.charCodeAt(peg$currPos) === 10) { + s0 = peg$c267; + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c268); } + } + if (s0 === null) { + if (input.charCodeAt(peg$currPos) === 13) { + s0 = peg$c269; + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c270); } + } + if (s0 === null) { + if (input.charCodeAt(peg$currPos) === 8232) { + s0 = peg$c271; + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c272); } + } + if (s0 === null) { + if (input.charCodeAt(peg$currPos) === 8233) { + s0 = peg$c273; + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c274); } + } + } + } + } + + return s0; + } + + function peg$parseEscapeSequence() { + var s0, s1, s2, s3; + + s0 = peg$parseCharacterEscapeSequence(); + if (s0 === null) { + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 48) { + s1 = peg$c202; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c203); } + } + if (s1 !== null) { + s2 = peg$currPos; + peg$silentFails++; + s3 = peg$parseDecimalDigit(); + peg$silentFails--; + if (s3 === null) { + s2 = peg$c1; + } else { + peg$currPos = s2; + s2 = peg$c0; + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c277(); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + if (s0 === null) { + s0 = peg$parseHexEscapeSequence(); + if (s0 === null) { + s0 = peg$parseUnicodeEscapeSequence(); + } + } + } + + return s0; + } + + function peg$parseCharacterEscapeSequence() { + var s0; + + s0 = peg$parseSingleEscapeCharacter(); + if (s0 === null) { + s0 = peg$parseNonEscapeCharacter(); + } + + return s0; + } + + function peg$parseSingleEscapeCharacter() { + var s0; + + if (peg$c278.test(input.charAt(peg$currPos))) { + s0 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c279); } + } + + return s0; + } + + function peg$parseNonEscapeCharacter() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = peg$currPos; + peg$silentFails++; + s2 = peg$parseEscapeCharacter(); + if (s2 === null) { + s2 = peg$parseLineTerminator(); + } + peg$silentFails--; + if (s2 === null) { + s1 = peg$c1; + } else { + peg$currPos = s1; + s1 = peg$c0; + } + if (s1 !== null) { + s2 = peg$parseSourceCharacter(); + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c265(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseEscapeCharacter() { + var s0; + + s0 = peg$parseSingleEscapeCharacter(); + if (s0 === null) { + s0 = peg$parseDecimalDigit(); + if (s0 === null) { + if (input.charCodeAt(peg$currPos) === 120) { + s0 = peg$c280; + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c281); } + } + if (s0 === null) { + if (input.charCodeAt(peg$currPos) === 117) { + s0 = peg$c226; + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c227); } + } + } + } + } + + return s0; + } + + function peg$parseSourceCharacter() { + var s0; + + if (input.length > peg$currPos) { + s0 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c282); } + } + + return s0; + } + + function peg$parseHexEscapeSequence() { + var s0, s1, s2, s3, s4, s5; + + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 120) { + s1 = peg$c280; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c281); } + } + if (s1 !== null) { + s2 = peg$currPos; + s3 = peg$currPos; + s4 = peg$parseHexDigit(); + if (s4 !== null) { + s5 = peg$parseHexDigit(); + if (s5 !== null) { + s4 = [s4, s5]; + s3 = s4; + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + if (s3 !== null) { + s3 = input.substring(s2, peg$currPos); + } + s2 = s3; + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c228(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseLineContinuation() { + var s0, s1, s2; + + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 92) { + s1 = peg$c224; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c225); } + } + if (s1 !== null) { + s2 = peg$parseLineTerminatorSequence(); + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c266(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parse_() { + var s0, s1; + + peg$silentFails++; + s0 = []; + s1 = peg$parseWhitespace(); + while (s1 !== null) { + s0.push(s1); + s1 = peg$parseWhitespace(); + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c283); } + } + + return s0; + } + + function peg$parse__() { + var s0, s1; + + peg$silentFails++; + s0 = peg$c1; + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c284); } + } + + return s0; + } + + function peg$parseWhitespace() { + var s0; + + if (peg$c285.test(input.charAt(peg$currPos))) { + s0 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c286); } + } + if (s0 === null) { + s0 = peg$parseUnicodeZs(); + } + + return s0; + } + + + var Types = require('./types'); + + function optional(obj) { + obj.optional = true; + return obj; + } + + function repeatable(obj) { + obj.repeatable = true; + return obj; + } + + function nullable(obj, modifier) { + if (modifier) { + obj.nullable = (modifier === '?' ? true : false); + } + + return obj; + } + + + peg$result = peg$startRuleFunction(); + + if (peg$result !== null && peg$currPos === input.length) { + return peg$result; + } else { + peg$cleanupExpected(peg$maxFailExpected); + peg$reportedPos = Math.max(peg$currPos, peg$maxFailPos); + + throw new SyntaxError( + peg$maxFailExpected, + peg$reportedPos < input.length ? input.charAt(peg$reportedPos) : null, + peg$reportedPos, + peg$computePosDetails(peg$reportedPos).line, + peg$computePosDetails(peg$reportedPos).column + ); + } + } + + return { + SyntaxError: SyntaxError, + parse : parse + }; +})(); diff --git a/node_modules/jsdoc/node_modules/catharsis/node_modules/underscore-contrib/node_modules/underscore/LICENSE b/node_modules/jsdoc/node_modules/catharsis/node_modules/underscore-contrib/node_modules/underscore/LICENSE new file mode 100644 index 0000000..0d6b873 --- /dev/null +++ b/node_modules/jsdoc/node_modules/catharsis/node_modules/underscore-contrib/node_modules/underscore/LICENSE @@ -0,0 +1,23 @@ +Copyright (c) 2009-2014 Jeremy Ashkenas, DocumentCloud and Investigative +Reporters & Editors + +Permission is hereby granted, free of charge, to any person +obtaining a copy of this software and associated documentation +files (the "Software"), to deal in the Software without +restriction, including without limitation the rights to use, +copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the +Software is furnished to do so, subject to the following +conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES +OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT +HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/jsdoc/node_modules/catharsis/node_modules/underscore-contrib/node_modules/underscore/README.md b/node_modules/jsdoc/node_modules/catharsis/node_modules/underscore-contrib/node_modules/underscore/README.md new file mode 100644 index 0000000..c2ba259 --- /dev/null +++ b/node_modules/jsdoc/node_modules/catharsis/node_modules/underscore-contrib/node_modules/underscore/README.md @@ -0,0 +1,22 @@ + __ + /\ \ __ + __ __ ___ \_\ \ __ _ __ ____ ___ ___ _ __ __ /\_\ ____ + /\ \/\ \ /' _ `\ /'_ \ /'__`\/\ __\/ ,__\ / ___\ / __`\/\ __\/'__`\ \/\ \ /',__\ + \ \ \_\ \/\ \/\ \/\ \ \ \/\ __/\ \ \//\__, `\/\ \__//\ \ \ \ \ \//\ __/ __ \ \ \/\__, `\ + \ \____/\ \_\ \_\ \___,_\ \____\\ \_\\/\____/\ \____\ \____/\ \_\\ \____\/\_\ _\ \ \/\____/ + \/___/ \/_/\/_/\/__,_ /\/____/ \/_/ \/___/ \/____/\/___/ \/_/ \/____/\/_//\ \_\ \/___/ + \ \____/ + \/___/ + +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 + +Underscore is an open-sourced component of DocumentCloud: +https://github.com/documentcloud + +Many thanks to our contributors: +https://github.com/jashkenas/underscore/contributors diff --git a/node_modules/jsdoc/node_modules/catharsis/node_modules/underscore-contrib/node_modules/underscore/package.json b/node_modules/jsdoc/node_modules/catharsis/node_modules/underscore-contrib/node_modules/underscore/package.json new file mode 100644 index 0000000..7b38533 --- /dev/null +++ b/node_modules/jsdoc/node_modules/catharsis/node_modules/underscore-contrib/node_modules/underscore/package.json @@ -0,0 +1,50 @@ +{ + "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/jashkenas/underscore.git" + }, + "main": "underscore.js", + "version": "1.6.0", + "devDependencies": { + "docco": "0.6.x", + "phantomjs": "1.9.0-1", + "uglify-js": "2.4.x" + }, + "scripts": { + "test": "phantomjs test/vendor/runner.js test/index.html?noglobals=true", + "build": "uglifyjs underscore.js -c \"evaluate=false\" --comments \"/ .*/\" -m --source-map underscore-min.map -o underscore-min.js", + "doc": "docco underscore.js" + }, + "licenses": [ + { + "type": "MIT", + "url": "https://raw.github.com/jashkenas/underscore/master/LICENSE" + } + ], + "files": [ + "underscore.js", + "underscore-min.js", + "LICENSE" + ], + "readme": " __\n /\\ \\ __\n __ __ ___ \\_\\ \\ __ _ __ ____ ___ ___ _ __ __ /\\_\\ ____\n /\\ \\/\\ \\ /' _ `\\ /'_ \\ /'__`\\/\\ __\\/ ,__\\ / ___\\ / __`\\/\\ __\\/'__`\\ \\/\\ \\ /',__\\\n \\ \\ \\_\\ \\/\\ \\/\\ \\/\\ \\ \\ \\/\\ __/\\ \\ \\//\\__, `\\/\\ \\__//\\ \\ \\ \\ \\ \\//\\ __/ __ \\ \\ \\/\\__, `\\\n \\ \\____/\\ \\_\\ \\_\\ \\___,_\\ \\____\\\\ \\_\\\\/\\____/\\ \\____\\ \\____/\\ \\_\\\\ \\____\\/\\_\\ _\\ \\ \\/\\____/\n \\/___/ \\/_/\\/_/\\/__,_ /\\/____/ \\/_/ \\/___/ \\/____/\\/___/ \\/_/ \\/____/\\/_//\\ \\_\\ \\/___/\n \\ \\____/\n \\/___/\n\nUnderscore.js is a utility-belt library for JavaScript that provides\nsupport for the usual functional suspects (each, map, reduce, filter...)\nwithout extending any core JavaScript objects.\n\nFor Docs, License, Tests, and pre-packed downloads, see:\nhttp://underscorejs.org\n\nUnderscore is an open-sourced component of DocumentCloud:\nhttps://github.com/documentcloud\n\nMany thanks to our contributors:\nhttps://github.com/jashkenas/underscore/contributors\n", + "readmeFilename": "README.md", + "bugs": { + "url": "https://github.com/jashkenas/underscore/issues" + }, + "_id": "underscore@1.6.0", + "_from": "underscore@1.6.0" +} diff --git a/node_modules/jsdoc/node_modules/catharsis/node_modules/underscore-contrib/node_modules/underscore/underscore-min.js b/node_modules/jsdoc/node_modules/catharsis/node_modules/underscore-contrib/node_modules/underscore/underscore-min.js new file mode 100644 index 0000000..3434d6c --- /dev/null +++ b/node_modules/jsdoc/node_modules/catharsis/node_modules/underscore-contrib/node_modules/underscore/underscore-min.js @@ -0,0 +1,6 @@ +// Underscore.js 1.6.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={},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,g=e.filter,d=e.every,m=e.some,y=e.indexOf,b=e.lastIndexOf,x=Array.isArray,w=Object.keys,_=i.bind,j=function(n){return n instanceof j?n:this instanceof j?void(this._wrapped=n):new j(n)};"undefined"!=typeof exports?("undefined"!=typeof module&&module.exports&&(exports=module.exports=j),exports._=j):n._=j,j.VERSION="1.6.0";var A=j.each=j.forEach=function(n,t,e){if(null==n)return 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=j.keys(n),u=0,i=a.length;i>u;u++)if(t.call(e,n[a[u]],a[u],n)===r)return;return n};j.map=j.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.push(t.call(r,n,u,i))}),e)};var O="Reduce of empty array with no initial value";j.reduce=j.foldl=j.inject=function(n,t,r,e){var u=arguments.length>2;if(null==n&&(n=[]),h&&n.reduce===h)return e&&(t=j.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},j.reduceRight=j.foldr=function(n,t,r,e){var u=arguments.length>2;if(null==n&&(n=[]),v&&n.reduceRight===v)return e&&(t=j.bind(t,e)),u?n.reduceRight(t,r):n.reduceRight(t);var i=n.length;if(i!==+i){var a=j.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},j.find=j.detect=function(n,t,r){var e;return k(n,function(n,u,i){return t.call(r,n,u,i)?(e=n,!0):void 0}),e},j.filter=j.select=function(n,t,r){var e=[];return null==n?e:g&&n.filter===g?n.filter(t,r):(A(n,function(n,u,i){t.call(r,n,u,i)&&e.push(n)}),e)},j.reject=function(n,t,r){return j.filter(n,function(n,e,u){return!t.call(r,n,e,u)},r)},j.every=j.all=function(n,t,e){t||(t=j.identity);var u=!0;return null==n?u:d&&n.every===d?n.every(t,e):(A(n,function(n,i,a){return(u=u&&t.call(e,n,i,a))?void 0:r}),!!u)};var k=j.some=j.any=function(n,t,e){t||(t=j.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)};j.contains=j.include=function(n,t){return null==n?!1:y&&n.indexOf===y?n.indexOf(t)!=-1:k(n,function(n){return n===t})},j.invoke=function(n,t){var r=o.call(arguments,2),e=j.isFunction(t);return j.map(n,function(n){return(e?t:n[t]).apply(n,r)})},j.pluck=function(n,t){return j.map(n,j.property(t))},j.where=function(n,t){return j.filter(n,j.matches(t))},j.findWhere=function(n,t){return j.find(n,j.matches(t))},j.max=function(n,t,r){if(!t&&j.isArray(n)&&n[0]===+n[0]&&n.length<65535)return Math.max.apply(Math,n);var e=-1/0,u=-1/0;return A(n,function(n,i,a){var o=t?t.call(r,n,i,a):n;o>u&&(e=n,u=o)}),e},j.min=function(n,t,r){if(!t&&j.isArray(n)&&n[0]===+n[0]&&n.length<65535)return Math.min.apply(Math,n);var e=1/0,u=1/0;return A(n,function(n,i,a){var o=t?t.call(r,n,i,a):n;u>o&&(e=n,u=o)}),e},j.shuffle=function(n){var t,r=0,e=[];return A(n,function(n){t=j.random(r++),e[r-1]=e[t],e[t]=n}),e},j.sample=function(n,t,r){return null==t||r?(n.length!==+n.length&&(n=j.values(n)),n[j.random(n.length-1)]):j.shuffle(n).slice(0,Math.max(0,t))};var E=function(n){return null==n?j.identity:j.isFunction(n)?n:j.property(n)};j.sortBy=function(n,t,r){return t=E(t),j.pluck(j.map(n,function(n,e,u){return{value:n,index:e,criteria:t.call(r,n,e,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.index-t.index}),"value")};var F=function(n){return function(t,r,e){var u={};return r=E(r),A(t,function(i,a){var o=r.call(e,i,a,t);n(u,o,i)}),u}};j.groupBy=F(function(n,t,r){j.has(n,t)?n[t].push(r):n[t]=[r]}),j.indexBy=F(function(n,t,r){n[t]=r}),j.countBy=F(function(n,t){j.has(n,t)?n[t]++:n[t]=1}),j.sortedIndex=function(n,t,r,e){r=E(r);for(var u=r.call(e,t),i=0,a=n.length;a>i;){var o=i+a>>>1;r.call(e,n[o])t?[]:o.call(n,0,t)},j.initial=function(n,t,r){return o.call(n,0,n.length-(null==t||r?1:t))},j.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))},j.rest=j.tail=j.drop=function(n,t,r){return o.call(n,null==t||r?1:t)},j.compact=function(n){return j.filter(n,j.identity)};var M=function(n,t,r){return t&&j.every(n,j.isArray)?c.apply(r,n):(A(n,function(n){j.isArray(n)||j.isArguments(n)?t?a.apply(r,n):M(n,t,r):r.push(n)}),r)};j.flatten=function(n,t){return M(n,t,[])},j.without=function(n){return j.difference(n,o.call(arguments,1))},j.partition=function(n,t){var r=[],e=[];return A(n,function(n){(t(n)?r:e).push(n)}),[r,e]},j.uniq=j.unique=function(n,t,r,e){j.isFunction(t)&&(e=r,r=t,t=!1);var u=r?j.map(n,r,e):n,i=[],a=[];return A(u,function(r,e){(t?e&&a[a.length-1]===r:j.contains(a,r))||(a.push(r),i.push(n[e]))}),i},j.union=function(){return j.uniq(j.flatten(arguments,!0))},j.intersection=function(n){var t=o.call(arguments,1);return j.filter(j.uniq(n),function(n){return j.every(t,function(t){return j.contains(t,n)})})},j.difference=function(n){var t=c.apply(e,o.call(arguments,1));return j.filter(n,function(n){return!j.contains(t,n)})},j.zip=function(){for(var n=j.max(j.pluck(arguments,"length").concat(0)),t=new Array(n),r=0;n>r;r++)t[r]=j.pluck(arguments,""+r);return t},j.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},j.indexOf=function(n,t,r){if(null==n)return-1;var e=0,u=n.length;if(r){if("number"!=typeof r)return e=j.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},j.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},j.range=function(n,t,r){arguments.length<=1&&(t=n||0,n=0),r=arguments[2]||1;for(var e=Math.max(Math.ceil((t-n)/r),0),u=0,i=new Array(e);e>u;)i[u++]=n,n+=r;return i};var R=function(){};j.bind=function(n,t){var r,e;if(_&&n.bind===_)return _.apply(n,o.call(arguments,1));if(!j.isFunction(n))throw new TypeError;return r=o.call(arguments,2),e=function(){if(!(this instanceof e))return n.apply(t,r.concat(o.call(arguments)));R.prototype=n.prototype;var u=new R;R.prototype=null;var i=n.apply(u,r.concat(o.call(arguments)));return Object(i)===i?i:u}},j.partial=function(n){var t=o.call(arguments,1);return function(){for(var r=0,e=t.slice(),u=0,i=e.length;i>u;u++)e[u]===j&&(e[u]=arguments[r++]);for(;r=f?(clearTimeout(a),a=null,o=l,i=n.apply(e,u),e=u=null):a||r.trailing===!1||(a=setTimeout(c,f)),i}},j.debounce=function(n,t,r){var e,u,i,a,o,c=function(){var l=j.now()-a;t>l?e=setTimeout(c,t-l):(e=null,r||(o=n.apply(i,u),i=u=null))};return function(){i=this,u=arguments,a=j.now();var l=r&&!e;return e||(e=setTimeout(c,t)),l&&(o=n.apply(i,u),i=u=null),o}},j.once=function(n){var t,r=!1;return function(){return r?t:(r=!0,t=n.apply(this,arguments),n=null,t)}},j.wrap=function(n,t){return j.partial(t,n)},j.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]}},j.after=function(n,t){return function(){return--n<1?t.apply(this,arguments):void 0}},j.keys=function(n){if(!j.isObject(n))return[];if(w)return w(n);var t=[];for(var r in n)j.has(n,r)&&t.push(r);return t},j.values=function(n){for(var t=j.keys(n),r=t.length,e=new Array(r),u=0;r>u;u++)e[u]=n[t[u]];return e},j.pairs=function(n){for(var t=j.keys(n),r=t.length,e=new Array(r),u=0;r>u;u++)e[u]=[t[u],n[t[u]]];return e},j.invert=function(n){for(var t={},r=j.keys(n),e=0,u=r.length;u>e;e++)t[n[r[e]]]=r[e];return t},j.functions=j.methods=function(n){var t=[];for(var r in n)j.isFunction(n[r])&&t.push(r);return t.sort()},j.extend=function(n){return A(o.call(arguments,1),function(t){if(t)for(var r in t)n[r]=t[r]}),n},j.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},j.omit=function(n){var t={},r=c.apply(e,o.call(arguments,1));for(var u in n)j.contains(r,u)||(t[u]=n[u]);return t},j.defaults=function(n){return A(o.call(arguments,1),function(t){if(t)for(var r in t)n[r]===void 0&&(n[r]=t[r])}),n},j.clone=function(n){return j.isObject(n)?j.isArray(n)?n.slice():j.extend({},n):n},j.tap=function(n,t){return t(n),n};var S=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 j&&(n=n._wrapped),t instanceof j&&(t=t._wrapped);var u=l.call(n);if(u!=l.call(t))return!1;switch(u){case"[object String]":return n==String(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;var a=n.constructor,o=t.constructor;if(a!==o&&!(j.isFunction(a)&&a instanceof a&&j.isFunction(o)&&o instanceof o)&&"constructor"in n&&"constructor"in t)return!1;r.push(n),e.push(t);var c=0,f=!0;if("[object Array]"==u){if(c=n.length,f=c==t.length)for(;c--&&(f=S(n[c],t[c],r,e)););}else{for(var s in n)if(j.has(n,s)&&(c++,!(f=j.has(t,s)&&S(n[s],t[s],r,e))))break;if(f){for(s in t)if(j.has(t,s)&&!c--)break;f=!c}}return r.pop(),e.pop(),f};j.isEqual=function(n,t){return S(n,t,[],[])},j.isEmpty=function(n){if(null==n)return!0;if(j.isArray(n)||j.isString(n))return 0===n.length;for(var t in n)if(j.has(n,t))return!1;return!0},j.isElement=function(n){return!(!n||1!==n.nodeType)},j.isArray=x||function(n){return"[object Array]"==l.call(n)},j.isObject=function(n){return n===Object(n)},A(["Arguments","Function","String","Number","Date","RegExp"],function(n){j["is"+n]=function(t){return l.call(t)=="[object "+n+"]"}}),j.isArguments(arguments)||(j.isArguments=function(n){return!(!n||!j.has(n,"callee"))}),"function"!=typeof/./&&(j.isFunction=function(n){return"function"==typeof n}),j.isFinite=function(n){return isFinite(n)&&!isNaN(parseFloat(n))},j.isNaN=function(n){return j.isNumber(n)&&n!=+n},j.isBoolean=function(n){return n===!0||n===!1||"[object Boolean]"==l.call(n)},j.isNull=function(n){return null===n},j.isUndefined=function(n){return n===void 0},j.has=function(n,t){return f.call(n,t)},j.noConflict=function(){return n._=t,this},j.identity=function(n){return n},j.constant=function(n){return function(){return n}},j.property=function(n){return function(t){return t[n]}},j.matches=function(n){return function(t){if(t===n)return!0;for(var r in n)if(n[r]!==t[r])return!1;return!0}},j.times=function(n,t,r){for(var e=Array(Math.max(0,n)),u=0;n>u;u++)e[u]=t.call(r,u);return e},j.random=function(n,t){return null==t&&(t=n,n=0),n+Math.floor(Math.random()*(t-n+1))},j.now=Date.now||function(){return(new Date).getTime()};var T={escape:{"&":"&","<":"<",">":">",'"':""","'":"'"}};T.unescape=j.invert(T.escape);var I={escape:new RegExp("["+j.keys(T.escape).join("")+"]","g"),unescape:new RegExp("("+j.keys(T.unescape).join("|")+")","g")};j.each(["escape","unescape"],function(n){j[n]=function(t){return null==t?"":(""+t).replace(I[n],function(t){return T[n][t]})}}),j.result=function(n,t){if(null==n)return void 0;var r=n[t];return j.isFunction(r)?r.call(n):r},j.mixin=function(n){A(j.functions(n),function(t){var r=j[t]=n[t];j.prototype[t]=function(){var n=[this._wrapped];return a.apply(n,arguments),z.call(this,r.apply(j,n))}})};var N=0;j.uniqueId=function(n){var t=++N+"";return n?n+t:t},j.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g};var q=/(.)^/,B={"'":"'","\\":"\\","\r":"r","\n":"n"," ":"t","\u2028":"u2028","\u2029":"u2029"},D=/\\|'|\r|\n|\t|\u2028|\u2029/g;j.template=function(n,t,r){var e;r=j.defaults({},r,j.templateSettings);var u=new RegExp([(r.escape||q).source,(r.interpolate||q).source,(r.evaluate||q).source].join("|")+"|$","g"),i=0,a="__p+='";n.replace(u,function(t,r,e,u,o){return a+=n.slice(i,o).replace(D,function(n){return"\\"+B[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=new Function(r.variable||"obj","_",a)}catch(o){throw o.source=a,o}if(t)return e(t,j);var c=function(n){return e.call(this,n,j)};return c.source="function("+(r.variable||"obj")+"){\n"+a+"}",c},j.chain=function(n){return j(n).chain()};var z=function(n){return this._chain?j(n).chain():n};j.mixin(j),A(["pop","push","reverse","shift","sort","splice","unshift"],function(n){var t=e[n];j.prototype[n]=function(){var r=this._wrapped;return t.apply(r,arguments),"shift"!=n&&"splice"!=n||0!==r.length||delete r[0],z.call(this,r)}}),A(["concat","join","slice"],function(n){var t=e[n];j.prototype[n]=function(){return z.call(this,t.apply(this._wrapped,arguments))}}),j.extend(j.prototype,{chain:function(){return this._chain=!0,this},value:function(){return this._wrapped}}),"function"==typeof define&&define.amd&&define("underscore",[],function(){return j})}).call(this); +//# sourceMappingURL=underscore-min.map \ No newline at end of file diff --git a/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/test/underscore.js b/node_modules/jsdoc/node_modules/catharsis/node_modules/underscore-contrib/node_modules/underscore/underscore.js similarity index 72% rename from node_modules/grunt-istanbul/node_modules/istanbul/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/test/underscore.js rename to node_modules/jsdoc/node_modules/catharsis/node_modules/underscore-contrib/node_modules/underscore/underscore.js index 65b59c0..9a4cabe 100644 --- a/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/test/underscore.js +++ b/node_modules/jsdoc/node_modules/catharsis/node_modules/underscore-contrib/node_modules/underscore/underscore.js @@ -1,6 +1,6 @@ -// Underscore.js 1.4.2 +// Underscore.js 1.6.0 // http://underscorejs.org -// (c) 2009-2012 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,7 +8,7 @@ // 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. @@ -21,12 +21,12 @@ 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; + 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. @@ -61,11 +61,11 @@ } exports._ = _; } else { - root['_'] = _; + root._ = _; } // Current version. - _.VERSION = '1.4.2'; + _.VERSION = '1.6.0'; // Collection Functions // -------------------- @@ -74,20 +74,20 @@ // 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 (obj == null) return obj; 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++) { + for (var i = 0, length = obj.length; i < length; 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; - } + var keys = _.keys(obj); + for (var i = 0, length = keys.length; i < length; i++) { + if (iterator.call(context, obj[keys[i]], keys[i], obj) === breaker) return; } } + return obj; }; // Return the results of applying the iterator to each element. @@ -97,11 +97,13 @@ 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); + results.push(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) { @@ -119,7 +121,7 @@ memo = iterator.call(context, memo, value, index, list); } }); - if (!initial) throw new TypeError('Reduce of empty array with no initial value'); + if (!initial) throw new TypeError(reduceError); return memo; }; @@ -130,7 +132,7 @@ 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); + return initial ? obj.reduceRight(iterator, memo) : obj.reduceRight(iterator); } var length = obj.length; if (length !== +length) { @@ -146,15 +148,15 @@ memo = iterator.call(context, memo, obj[index], index, list); } }); - if (!initial) throw new TypeError('Reduce of empty array with no initial value'); + 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)) { + if (predicate.call(context, value, index, list)) { result = value; return true; } @@ -165,33 +167,33 @@ // 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); + if (nativeFilter && obj.filter === nativeFilter) return obj.filter(predicate, context); each(obj, function(value, index, list) { - if (iterator.call(context, value, index, list)) results[results.length] = value; + if (predicate.call(context, value, index, list)) results.push(value); }); return results; }; // Return all the elements for which a truth test fails. - _.reject = function(obj, iterator, context) { + _.reject = function(obj, predicate, context) { return _.filter(obj, function(value, index, list) { - return !iterator.call(context, value, index, list); + return !predicate.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); + _.every = _.all = function(obj, predicate, context) { + predicate || (predicate = _.identity); var result = true; if (obj == null) return result; - if (nativeEvery && obj.every === nativeEvery) return obj.every(iterator, context); + if (nativeEvery && obj.every === nativeEvery) return obj.every(predicate, context); each(obj, function(value, index, list) { - if (!(result = result && iterator.call(context, value, index, list))) return breaker; + if (!(result = result && predicate.call(context, value, index, list))) return breaker; }); return !!result; }; @@ -199,13 +201,13 @@ // 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 any = _.some = _.any = function(obj, predicate, context) { + predicate || (predicate = _.identity); var result = false; if (obj == null) return result; - if (nativeSome && obj.some === nativeSome) return obj.some(iterator, context); + if (nativeSome && obj.some === nativeSome) return obj.some(predicate, context); each(obj, function(value, index, list) { - if (result || (result = iterator.call(context, value, index, list))) return breaker; + if (result || (result = predicate.call(context, value, index, list))) return breaker; }); return !!result; }; @@ -213,54 +215,55 @@ // 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 (obj == null) return false; if (nativeIndexOf && obj.indexOf === nativeIndexOf) return obj.indexOf(target) != -1; - found = any(obj, function(value) { + return 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); + var isFunc = _.isFunction(method); return _.map(obj, function(value) { - return (_.isFunction(method) ? method : value[method]).apply(value, args); + 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]; }); + return _.map(obj, _.property(key)); }; // Convenience version of a common use case of `filter`: selecting only objects - // with specific `key:value` pairs. + // containing 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 _.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 _.find(obj, _.matches(attrs)); }; // 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 + // See [WebKit Bug 80797](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}; + var result = -Infinity, lastComputed = -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}); + if (computed > lastComputed) { + result = value; + lastComputed = computed; + } }); - return result.value; + return result; }; // Return the minimum element (or element-based computation). @@ -268,16 +271,19 @@ 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}; + var result = Infinity, lastComputed = 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}); + if (computed < lastComputed) { + result = value; + lastComputed = computed; + } }); - return result.value; + return result; }; - // Shuffle an array. + // Shuffle an array, 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; @@ -290,19 +296,32 @@ return shuffled; }; + // 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)); + }; + // An internal function to generate lookup iterators. var lookupIterator = function(value) { - return _.isFunction(value) ? value : function(obj){ return obj[value]; }; + if (value == null) return _.identity; + if (_.isFunction(value)) return value; + return _.property(value); }; // Sort the object's values by a criterion produced by an iterator. - _.sortBy = function(obj, value, context) { - var iterator = lookupIterator(value); + _.sortBy = function(obj, iterator, context) { + iterator = lookupIterator(iterator); 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: iterator.call(context, value, index, list) }; }).sort(function(left, right) { var a = left.criteria; @@ -311,43 +330,46 @@ 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); - 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, iterator, context) { + var result = {}; + iterator = lookupIterator(iterator); + 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); - }); - }; + _.groupBy = group(function(result, key, value) { + _.has(result, key) ? result[key].push(value) : 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, key, value) { + 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, value) { - if (!_.has(result, key)) result[key] = 0; - result[key]++; - }); - }; + _.countBy = group(function(result, key) { + _.has(result, key) ? result[key]++ : 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); + iterator = lookupIterator(iterator); var value = iterator.call(context, obj); var low = 0, high = array.length; while (low < high) { @@ -357,10 +379,11 @@ 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 (obj.length === +obj.length) return slice.call(obj); + if (_.isArray(obj)) return slice.call(obj); + if (obj.length === +obj.length) return _.map(obj, _.identity); return _.values(obj); }; @@ -378,7 +401,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,11 +418,8 @@ // 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`. @@ -410,13 +432,16 @@ // Trim out all falsy values from an array. _.compact = function(array) { - return _.filter(array, function(value){ return !!value; }); + return _.filter(array, _.identity); }; // Internal implementation of a recursive `flatten` function. var flatten = function(input, shallow, output) { + if (shallow && _.every(input, _.isArray)) { + return concat.apply(output, input); + } each(input, function(value) { - if (_.isArray(value)) { + if (_.isArray(value) || _.isArguments(value)) { shallow ? push.apply(output, value) : flatten(value, shallow, output); } else { output.push(value); @@ -425,7 +450,7 @@ 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, []); }; @@ -435,10 +460,25 @@ return _.difference(array, slice.call(arguments, 1)); }; + // Split an array into two arrays: one whose elements all satisfy the given + // predicate, and one whose elements all do not satisfy the predicate. + _.partition = function(array, predicate) { + var pass = [], fail = []; + each(array, function(elem) { + (predicate(elem) ? pass : fail).push(elem); + }); + return [pass, fail]; + }; + // 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 = []; @@ -454,7 +494,7 @@ // 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)); }; // Produce an array that contains every item shared between all the @@ -463,7 +503,7 @@ var rest = slice.call(arguments, 1); return _.filter(_.uniq(array), function(item) { return _.every(rest, function(other) { - return _.indexOf(other, item) >= 0; + return _.contains(other, item); }); }); }; @@ -478,11 +518,10 @@ // 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 length = _.max(_.pluck(arguments, 'length').concat(0)); var results = new Array(length); for (var i = 0; i < length; i++) { - results[i] = _.pluck(args, "" + i); + results[i] = _.pluck(arguments, '' + i); } return results; }; @@ -493,7 +532,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 { @@ -511,17 +550,17 @@ // 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; }; @@ -547,11 +586,11 @@ } step = arguments[2] || 1; - var len = Math.max(Math.ceil((stop - start) / step), 0); + var length = Math.max(Math.ceil((stop - start) / step), 0); var idx = 0; - var range = new Array(len); + var range = new Array(length); - while(idx < len) { + while(idx < length) { range[idx++] = start; start += step; } @@ -566,29 +605,46 @@ 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)); + // optionally). Delegates to **ECMAScript 5**'s native `Function.bind` if + // available. + _.bind = function(func, context) { + var args, bound; + if (nativeBind && func.bind === 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; + ctor.prototype = null; 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. + // Partially apply a function by creating a version that has had some of its + // 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 boundArgs = slice.call(arguments, 1); + return function() { + 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 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); + if (funcs.length === 0) throw new Error('bindAll must be passed function names'); each(funcs, function(f) { obj[f] = _.bind(obj[f], obj); }); return obj; }; @@ -617,25 +673,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; + options || (options = {}); var later = function() { - previous = new Date; + previous = options.leading === false ? 0 : _.now(); timeout = null; result = func.apply(context, args); + 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) { clearTimeout(timeout); + timeout = null; previous = now; result = func.apply(context, args); - } else if (!timeout) { + context = args = null; + } else if (!timeout && options.trailing !== false) { timeout = setTimeout(later, remaining); } return result; @@ -647,17 +712,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) { + timeout = setTimeout(later, wait - last); + } else { timeout = null; - if (!immediate) result = func.apply(context, args); - }; + if (!immediate) { + result = func.apply(context, args); + context = args = null; + } + } + }; + + return function() { + context = this; + args = arguments; + timestamp = _.now(); var callNow = immediate && !timeout; - clearTimeout(timeout); - timeout = setTimeout(later, wait); - if (callNow) result = func.apply(context, args); + if (!timeout) { + timeout = setTimeout(later, wait); + } + if (callNow) { + result = func.apply(context, args); + context = args = null; + } + return result; }; }; @@ -679,11 +761,7 @@ // 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); - }; + return _.partial(wrapper, func); }; // Returns a function that is the composition of a list of functions, each @@ -701,7 +779,6 @@ // 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); @@ -714,31 +791,43 @@ // 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 = new 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 = new 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; }; @@ -755,8 +844,10 @@ // 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]; + if (source) { + for (var prop in source) { + obj[prop] = source[prop]; + } } }); return obj; @@ -785,8 +876,10 @@ // 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]; + if (source) { + for (var prop in source) { + if (obj[prop] === void 0) obj[prop] = source[prop]; + } } }); return obj; @@ -809,7 +902,7 @@ // 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. + // 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; @@ -851,6 +944,14 @@ // unique nested structures. 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 && !(_.isFunction(aCtor) && (aCtor instanceof aCtor) && + _.isFunction(bCtor) && (bCtor instanceof bCtor)) + && ('constructor' in a && 'constructor' in b)) { + return false; + } // Add the first object to the stack of traversed objects. aStack.push(a); bStack.push(b); @@ -867,13 +968,6 @@ } } } 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)) { @@ -951,7 +1045,7 @@ // Is a given object a finite number? _.isFinite = function(obj) { - return _.isNumber(obj) && isFinite(obj); + return isFinite(obj) && !isNaN(parseFloat(obj)); }; // Is the given value `NaN`? (NaN is the only number which does not equal itself). @@ -995,9 +1089,35 @@ return value; }; + _.constant = function(value) { + return function () { + return value; + }; + }; + + _.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) { + return function(obj) { + if (obj === attrs) return true; //avoid comparing an object to itself. + for (var key in attrs) { + if (attrs[key] !== obj[key]) + return false; + } + return true; + } + }; + // Run a function **n** times. _.times = function(n, iterator, context) { - for (var i = 0; i < n; i++) iterator.call(context, i); + var accum = Array(Math.max(0, 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). @@ -1006,9 +1126,12 @@ max = min; min = 0; } - return min + (0 | Math.random() * (max - min + 1)); + return min + Math.floor(Math.random() * (max - min + 1)); }; + // A (possibly faster) way to get the current timestamp as an integer. + _.now = Date.now || function() { return new Date().getTime(); }; + // List of HTML entities for escaping. var entityMap = { escape: { @@ -1016,8 +1139,7 @@ '<': '<', '>': '>', '"': '"', - "'": ''', - '/': '/' + "'": ''' } }; entityMap.unescape = _.invert(entityMap.escape); @@ -1038,17 +1160,17 @@ }; }); - // 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){ + each(_.functions(obj), function(name) { var func = _[name] = obj[name]; _.prototype[name] = function() { var args = [this._wrapped]; @@ -1062,7 +1184,7 @@ // Useful for temporary DOM ids. var idCounter = 0; _.uniqueId = function(prefix) { - var id = idCounter++; + var id = ++idCounter + ''; return prefix ? prefix + id : id; }; @@ -1097,6 +1219,7 @@ // 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. @@ -1112,11 +1235,18 @@ 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+='" : ''; + + 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"; @@ -1128,7 +1258,7 @@ source + "return __p;\n"; try { - var render = new Function(settings.variable || 'obj', '_', source); + render = new Function(settings.variable || 'obj', '_', source); } catch (e) { e.source = source; throw e; @@ -1198,4 +1328,16 @@ }); + // 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/jsdoc/node_modules/catharsis/node_modules/underscore-contrib/package.json b/node_modules/jsdoc/node_modules/catharsis/node_modules/underscore-contrib/package.json index 41c958f..bcb3485 100644 --- a/node_modules/jsdoc/node_modules/catharsis/node_modules/underscore-contrib/package.json +++ b/node_modules/jsdoc/node_modules/catharsis/node_modules/underscore-contrib/package.json @@ -39,7 +39,7 @@ "shasum": "665b66c24783f8fa2b18c9f8cbb0e2c7d48c26c7", "tarball": "http://registry.npmjs.org/underscore-contrib/-/underscore-contrib-0.3.0.tgz" }, - "_from": "underscore-contrib@~0.3.0", + "_from": "underscore-contrib@>=0.3.0 <0.4.0", "_npmVersion": "1.3.21", "_npmUser": { "name": "joshuacc", diff --git a/node_modules/jsdoc/node_modules/catharsis/package.json b/node_modules/jsdoc/node_modules/catharsis/package.json index 807990d..bc07687 100644 --- a/node_modules/jsdoc/node_modules/catharsis/package.json +++ b/node_modules/jsdoc/node_modules/catharsis/package.json @@ -1,5 +1,5 @@ { - "version": "0.8.3", + "version": "0.8.6", "name": "catharsis", "description": "A JavaScript parser for Google Closure Compiler and JSDoc type expressions.", "author": { @@ -18,18 +18,16 @@ "underscore-contrib": "~0.3.0" }, "devDependencies": { - "mocha": "~1.21.3", + "mocha": "~2.0.1", "pegjs": "https://github.com/dmajda/pegjs/tarball/76cc5d55b47ff3d5bbe1d435c6f843e2688cb729", "should": "~4.0.4", - "tv4": "https://github.com/geraintluff/tv4/tarball/eb7561072d44943306e5fd88b55b4a4c98cb6c75", - "uglify-js": "~2.4.15" + "tv4": "https://github.com/geraintluff/tv4/tarball/eb7561072d44943306e5fd88b55b4a4c98cb6c75" }, "engines": { "node": ">= 0.8" }, "scripts": { - "build": "pegjs ./lib/parser.pegjs", - "prepublish": "pegjs ./lib/parser.pegjs; ./node_modules/.bin/uglifyjs ./lib/parser.js -o ./lib/parser.js", + "prepublish": "pegjs ./lib/parser.pegjs", "test": "mocha" }, "licenses": [ @@ -38,11 +36,11 @@ "url": "http://github.com/hegemonic/catharsis/raw/master/LICENSE" } ], - "gitHead": "8795105b00acf02d0af464ad3432f47b53744934", + "gitHead": "44b6dc62df82a60ccd11eefe6b68cd9a6c8cbf4f", "homepage": "https://github.com/hegemonic/catharsis", - "_id": "catharsis@0.8.3", - "_shasum": "573ad3d285dcfc373221712bd382edda61b3a5d5", - "_from": "catharsis@~0.8.2", + "_id": "catharsis@0.8.6", + "_shasum": "5ca786ca4efe5ff4eb063c1db7ff84b7b309a55e", + "_from": "catharsis@>=0.8.6 <0.9.0", "_npmVersion": "1.4.28", "_npmUser": { "name": "hegemonic", @@ -55,10 +53,10 @@ } ], "dist": { - "shasum": "573ad3d285dcfc373221712bd382edda61b3a5d5", - "tarball": "http://registry.npmjs.org/catharsis/-/catharsis-0.8.3.tgz" + "shasum": "5ca786ca4efe5ff4eb063c1db7ff84b7b309a55e", + "tarball": "http://registry.npmjs.org/catharsis/-/catharsis-0.8.6.tgz" }, "directories": {}, - "_resolved": "https://registry.npmjs.org/catharsis/-/catharsis-0.8.3.tgz", + "_resolved": "https://registry.npmjs.org/catharsis/-/catharsis-0.8.6.tgz", "readme": "ERROR: No README data found!" } diff --git a/node_modules/jsdoc/node_modules/catharsis/res/en.json b/node_modules/jsdoc/node_modules/catharsis/res/en.json index 9afb501..77c160b 100644 --- a/node_modules/jsdoc/node_modules/catharsis/res/en.json +++ b/node_modules/jsdoc/node_modules/catharsis/res/en.json @@ -87,5 +87,5 @@ "many": "or <%= element %>) <%= suffix %>" } }, - "unknown": "unknown type" + "unknown": "unknown" } diff --git a/node_modules/jsdoc/node_modules/escape-string-regexp/index.js b/node_modules/jsdoc/node_modules/escape-string-regexp/index.js new file mode 100644 index 0000000..ac6572c --- /dev/null +++ b/node_modules/jsdoc/node_modules/escape-string-regexp/index.js @@ -0,0 +1,11 @@ +'use strict'; + +var matchOperatorsRe = /[|\\{}()[\]^$+*?.]/g; + +module.exports = function (str) { + if (typeof str !== 'string') { + throw new TypeError('Expected a string'); + } + + return str.replace(matchOperatorsRe, '\\$&'); +}; diff --git a/node_modules/jsdoc/node_modules/escape-string-regexp/package.json b/node_modules/jsdoc/node_modules/escape-string-regexp/package.json new file mode 100644 index 0000000..ce28d77 --- /dev/null +++ b/node_modules/jsdoc/node_modules/escape-string-regexp/package.json @@ -0,0 +1,69 @@ +{ + "name": "escape-string-regexp", + "version": "1.0.2", + "description": "Escape RegExp special characters", + "license": "MIT", + "repository": { + "type": "git", + "url": "https://github.com/sindresorhus/escape-string-regexp" + }, + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "http://sindresorhus.com" + }, + "engines": { + "node": ">=0.8.0" + }, + "scripts": { + "test": "mocha" + }, + "files": [ + "index.js" + ], + "keywords": [ + "regex", + "regexp", + "re", + "regular", + "expression", + "escape", + "string", + "str", + "special", + "characters" + ], + "devDependencies": { + "mocha": "*" + }, + "gitHead": "0587ee0ee03ea3fcbfa3c15cf67b47f214e20987", + "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", + "_from": "escape-string-regexp@>=1.0.2 <1.1.0", + "_npmVersion": "1.4.23", + "_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" + }, + "directories": {}, + "_resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.2.tgz", + "readme": "ERROR: No README data found!" +} diff --git a/node_modules/jsdoc/node_modules/escape-string-regexp/readme.md b/node_modules/jsdoc/node_modules/escape-string-regexp/readme.md new file mode 100644 index 0000000..808a963 --- /dev/null +++ b/node_modules/jsdoc/node_modules/escape-string-regexp/readme.md @@ -0,0 +1,27 @@ +# escape-string-regexp [![Build Status](https://travis-ci.org/sindresorhus/escape-string-regexp.svg?branch=master)](https://travis-ci.org/sindresorhus/escape-string-regexp) + +> Escape RegExp special characters + + +## Install + +```sh +$ npm install --save escape-string-regexp +``` + + +## Usage + +```js +var escapeStringRegexp = require('escape-string-regexp'); + +var escapedString = escapeStringRegexp('how much $ for a unicorn?'); +//=> how much \$ for a unicorn\? + +new RegExp(escapedString); +``` + + +## License + +MIT © [Sindre Sorhus](http://sindresorhus.com) diff --git a/node_modules/jsdoc/node_modules/esprima/package.json b/node_modules/jsdoc/node_modules/esprima/package.json index c4c1b81..b0ecc18 100644 --- a/node_modules/jsdoc/node_modules/esprima/package.json +++ b/node_modules/jsdoc/node_modules/esprima/package.json @@ -55,7 +55,7 @@ "url": "https://github.com/ariya/esprima/issues" }, "_id": "esprima@1.1.0-dev-harmony", - "_shasum": "a03eaca83ec1125aa3d4acddd2636b4dd707db67", - "_from": "https://github.com/ariya/esprima/tarball/49a2eccb243f29bd653b11e9419241a9d726af7c", - "_resolved": "https://github.com/ariya/esprima/tarball/49a2eccb243f29bd653b11e9419241a9d726af7c" + "_shasum": "5a458471e55360128b8e538e9e76944534dc4bb3", + "_resolved": "https://github.com/ariya/esprima/tarball/49a2eccb243f29bd653b11e9419241a9d726af7c", + "_from": "https://github.com/ariya/esprima/tarball/49a2eccb243f29bd653b11e9419241a9d726af7c" } diff --git a/node_modules/jsdoc/node_modules/js2xmlparser/.gitattributes b/node_modules/jsdoc/node_modules/js2xmlparser/.gitattributes deleted file mode 100644 index 412eeda..0000000 --- a/node_modules/jsdoc/node_modules/js2xmlparser/.gitattributes +++ /dev/null @@ -1,22 +0,0 @@ -# Auto detect text files and perform LF normalization -* text=auto - -# Custom for Visual Studio -*.cs diff=csharp -*.sln merge=union -*.csproj merge=union -*.vbproj merge=union -*.fsproj merge=union -*.dbproj merge=union - -# Standard to msysgit -*.doc diff=astextplain -*.DOC diff=astextplain -*.docx diff=astextplain -*.DOCX diff=astextplain -*.dot diff=astextplain -*.DOT diff=astextplain -*.pdf diff=astextplain -*.PDF diff=astextplain -*.rtf diff=astextplain -*.RTF diff=astextplain diff --git a/node_modules/jsdoc/node_modules/js2xmlparser/.npmignore b/node_modules/jsdoc/node_modules/js2xmlparser/.npmignore index 64e78fe..d7803d3 100644 --- a/node_modules/jsdoc/node_modules/js2xmlparser/.npmignore +++ b/node_modules/jsdoc/node_modules/js2xmlparser/.npmignore @@ -1,166 +1,169 @@ -.idea/ -node_modules - -################# -## Eclipse -################# - -*.pydevproject -.project -.metadata -bin/ -tmp/ -*.tmp -*.bak -*.swp -*~.nib -local.properties -.classpath -.settings/ -.loadpath - -# External tool builders -.externalToolBuilders/ - -# Locally stored "Eclipse launch configurations" -*.launch - -# CDT-specific -.cproject - -# PDT-specific -.buildpath - - -################# -## Visual Studio -################# - -## Ignore Visual Studio temporary files, build results, and -## files generated by popular Visual Studio add-ons. - -# User-specific files -*.suo -*.user -*.sln.docstates - -# Build results -[Dd]ebug/ -[Rr]elease/ -*_i.c -*_p.c -*.ilk -*.meta -*.obj -*.pch -*.pdb -*.pgc -*.pgd -*.rsp -*.sbr -*.tlb -*.tli -*.tlh -*.tmp -*.vspscc -.builds -*.dotCover - -## TODO: If you have NuGet Package Restore enabled, uncomment this -#packages/ - -# Visual C++ cache files -ipch/ -*.aps -*.ncb -*.opensdf -*.sdf - -# Visual Studio profiler -*.psess -*.vsp - -# ReSharper is a .NET coding add-in -_ReSharper* - -# Installshield output folder -[Ee]xpress - -# DocProject is a documentation generator add-in -DocProject/buildhelp/ -DocProject/Help/*.HxT -DocProject/Help/*.HxC -DocProject/Help/*.hhc -DocProject/Help/*.hhk -DocProject/Help/*.hhp -DocProject/Help/Html2 -DocProject/Help/html - -# Click-Once directory -publish - -# Others -[Bb]in -[Oo]bj -sql -TestResults -*.Cache -ClientBin -stylecop.* -~$* -*.dbmdl -Generated_Code #added for RIA/Silverlight projects - -# Backup & report files from converting an old project file to a newer -# Visual Studio version. Backup files are not needed, because we have git ;-) -_UpgradeReport_Files/ -Backup*/ -UpgradeLog*.XML - - - -############ -## Windows -############ - -# Windows image file caches -Thumbs.db - -# Folder config file -Desktop.ini - - -############# -## Python -############# - -*.py[co] - -# Packages -*.egg -*.egg-info -dist -build -eggs -parts -bin -var -sdist -develop-eggs -.installed.cfg - -# Installer logs -pip-log.txt - -# Unit test / coverage reports -.coverage -.tox - -#Translations -*.mo - -#Mr Developer -.mr.developer.cfg - -# Mac crap -.DS_Store +.idea/ +node_modules + +# already tracked, but should be added to generated .npmignore +.gitattributes + +################# +## Eclipse +################# + +*.pydevproject +.project +.metadata +bin/ +tmp/ +*.tmp +*.bak +*.swp +*~.nib +local.properties +.classpath +.settings/ +.loadpath + +# External tool builders +.externalToolBuilders/ + +# Locally stored "Eclipse launch configurations" +*.launch + +# CDT-specific +.cproject + +# PDT-specific +.buildpath + + +################# +## Visual Studio +################# + +## Ignore Visual Studio temporary files, build results, and +## files generated by popular Visual Studio add-ons. + +# User-specific files +*.suo +*.user +*.sln.docstates + +# Build results +[Dd]ebug/ +[Rr]elease/ +*_i.c +*_p.c +*.ilk +*.meta +*.obj +*.pch +*.pdb +*.pgc +*.pgd +*.rsp +*.sbr +*.tlb +*.tli +*.tlh +*.tmp +*.vspscc +.builds +*.dotCover + +## TODO: If you have NuGet Package Restore enabled, uncomment this +#packages/ + +# Visual C++ cache files +ipch/ +*.aps +*.ncb +*.opensdf +*.sdf + +# Visual Studio profiler +*.psess +*.vsp + +# ReSharper is a .NET coding add-in +_ReSharper* + +# Installshield output folder +[Ee]xpress + +# DocProject is a documentation generator add-in +DocProject/buildhelp/ +DocProject/Help/*.HxT +DocProject/Help/*.HxC +DocProject/Help/*.hhc +DocProject/Help/*.hhk +DocProject/Help/*.hhp +DocProject/Help/Html2 +DocProject/Help/html + +# Click-Once directory +publish + +# Others +[Bb]in +[Oo]bj +sql +TestResults +*.Cache +ClientBin +stylecop.* +~$* +*.dbmdl +Generated_Code #added for RIA/Silverlight projects + +# Backup & report files from converting an old project file to a newer +# Visual Studio version. Backup files are not needed, because we have git ;-) +_UpgradeReport_Files/ +Backup*/ +UpgradeLog*.XML + + + +############ +## Windows +############ + +# Windows image file caches +Thumbs.db + +# Folder config file +Desktop.ini + + +############# +## Python +############# + +*.py[co] + +# Packages +*.egg +*.egg-info +dist +build +eggs +parts +bin +var +sdist +develop-eggs +.installed.cfg + +# Installer logs +pip-log.txt + +# Unit test / coverage reports +.coverage +.tox + +#Translations +*.mo + +#Mr Developer +.mr.developer.cfg + +# Mac crap +.DS_Store diff --git a/node_modules/jsdoc/node_modules/js2xmlparser/CHANGES.md b/node_modules/jsdoc/node_modules/js2xmlparser/CHANGES.md index 0d94d68..01e9e62 100644 --- a/node_modules/jsdoc/node_modules/js2xmlparser/CHANGES.md +++ b/node_modules/jsdoc/node_modules/js2xmlparser/CHANGES.md @@ -1,35 +1,46 @@ -## 0.1.5 ## - -* Bug fixes -* Minor changes to examples - -## 0.1.4 ## - -* Removed callFunctions option (functionality already provided by convertMap option) -* Removed wrapArray option (functionality already provided by existing array functionality) -* Escape numbers when at tbe beginning of an element name -* Edits to documentation -* Added tests -* Added copyright headers to individual JS files - -## 0.1.3 ## - -* Fixed crash when undefined objects are converted to strings -* Added callFunctions option -* Added wrapArray option -* Added useCDATA option -* Added convertMap option -* Added copyright year and "and other contributors" to license - -## 0.1.2 ## - -* Fixed crash when null objects are converted to strings - -## 0.1.1 ## - -* Fixed accidental truncation of XML when pretty-printing is disabled -* Removed copyright year from license - -## 0.1.0 ## - -* Initial release +## 0.1.7 ## + +* Added .gitattributes to .gitignore file +* Minor tweaks to examples + +## 0.1.6 ## + +* Addition of alias string option +* Minor changes to examples +* Minor fixes to tests + +## 0.1.5 ## + +* Bug fixes +* Minor changes to examples + +## 0.1.4 ## + +* Removed callFunctions option (functionality already provided by convertMap option) +* Removed wrapArray option (functionality already provided by existing array functionality) +* Escape numbers when at tbe beginning of an element name +* Edits to documentation +* Added tests +* Added copyright headers to individual JS files + +## 0.1.3 ## + +* Fixed crash when undefined objects are converted to strings +* Added callFunctions option +* Added wrapArray option +* Added useCDATA option +* Added convertMap option +* Added copyright year and "and other contributors" to license + +## 0.1.2 ## + +* Fixed crash when null objects are converted to strings + +## 0.1.1 ## + +* Fixed accidental truncation of XML when pretty-printing is disabled +* Removed copyright year from license + +## 0.1.0 ## + +* Initial release diff --git a/node_modules/jsdoc/node_modules/js2xmlparser/LICENSE.md b/node_modules/jsdoc/node_modules/js2xmlparser/LICENSE.md index 1b76d2f..3194743 100644 --- a/node_modules/jsdoc/node_modules/js2xmlparser/LICENSE.md +++ b/node_modules/jsdoc/node_modules/js2xmlparser/LICENSE.md @@ -1,16 +1,16 @@ -js2xmlparser is licensed under the MIT license: - -> Copyright © 2012 Michael Kourlas and other contributors -> -> Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated -> documentation files (the "Software"), to deal in the Software without restriction, including without limitation the -> rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit -> persons to whom the Software is furnished to do so, subject to the following conditions: -> -> The above copyright notice and this permission notice shall be included in all copies or substantial portions of the -> Software. -> -> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE -> WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR -> COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +js2xmlparser is licensed under the MIT license: + +> Copyright © 2012 Michael Kourlas and other contributors +> +> Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated +> documentation files (the "Software"), to deal in the Software without restriction, including without limitation the +> rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit +> persons to whom the Software is furnished to do so, subject to the following conditions: +> +> The above copyright notice and this permission notice shall be included in all copies or substantial portions of the +> Software. +> +> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE +> WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR +> COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR > OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \ No newline at end of file diff --git a/node_modules/jsdoc/node_modules/js2xmlparser/README.md b/node_modules/jsdoc/node_modules/js2xmlparser/README.md index 01f89dd..156b000 100644 --- a/node_modules/jsdoc/node_modules/js2xmlparser/README.md +++ b/node_modules/jsdoc/node_modules/js2xmlparser/README.md @@ -1,196 +1,243 @@ -# js2xmlparser # - -## Overview ## - -js2xmlparser is a Node.js module that parses JavaScript objects into XML. - -## Features ## - -Since XML is a data-interchange format, js2xmlparser is designed primarily for JSON-type objects, arrays and primitive -data types, like many of the other JavaScript to XML parsers currently available for Node.js. - -However, js2xmlparser is capable of parsing any object, including native JavaScript objects such as Date and RegExp, by -taking advantage of each object's toString function. Functions are a special case where the return value of the function -itself is used instead of the toString function, if available. - -js2xmlparser also supports a number of constructs unique to XML: - -* attributes (through a unique attribute property in objects) -* mixed content (through a unique value property in objects) -* multiple elements with the same name (through arrays) - -js2xmlparser can also pretty-print the XML it outputs with the option of customizing the indent string. - -## Installation ## - -The easiest way to install js2xmlparser is to use npm: `npm install js2xmlparser`. - -Alternatively, you may download the source from GitHub and copy it to a folder named "js2xmlparser" within your -"node_modules" directory. - -## Usage ## - -The js2xmlparser module contains one function which takes the following arguments: - -* `root` - the XML root element's name (string, mandatory) -* `data` - the data to be converted to XML; while the data object can contain arrays, it cannot itself be an array - (object or JSON string, mandatory) -* `options` - module options (object, optional) - * `declaration` - XML declaration options (object, optional) - * `include` - specifies whether an XML declaration should be included (boolean, optional, default: true) - * `encoding` - value of XML encoding attribute in declaration; a value of null represents no encoding attribute - (string, optional, default: "UTF-8") - * `attributeString` - the name of the property representing an element's attributes; note that any property with a - name equal to the attribute string is ignored except in the context of XML attributes (string, optional, default: - "@") - * `valueString` - the name of the property representing an element's value; note that any property with a name equal - to the value string is ignored except in the context of supplying a value for a tag containing attributes (string, - optional, default: "#") - * `prettyPrinting` - pretty-printing options (object, optional) - * `enabled` - specifies whether pretty-printing is enabled (boolean, optional, default: true) - * `indentString` - indent string (string, optional, default: "\t") - * `convertMap` - maps object types (as given by the `Object.prototype.toString.call` method) to functions to convert - those objects to a particular string representation; `*` can be used as a wildcard for all types of objects - (object, optional, default: {}) - * `useCDATA` - specifies whether strings should be enclosed in CDATA tags; otherwise, illegal XML characters will - be escaped (boolean, optional, default: false) - -## Examples ## - -The following example illustrates the basic usage of js2xmlparser: - - var js2xmlparser = require("js2xmlparser"); - - var data = { - "firstName": "John", - "lastName": "Smith" - }; - - console.log(js2xmlparser("person", data)); - - > - > - > John - > Smith - > - -Here's a more complex example that builds on the first: - - var js2xmlparser = require("js2xmlparser"); - - var data = { - "@": { - "type": "individual" - }, - "firstName": "John", - "lastName": "Smith", - "dateOfBirth": new Date(1964, 7, 26), - "address": { - "@": { - "type": "home" - }, - "streetAddress": "3212 22nd St", - "city": "Chicago", - "state": "Illinois", - "zip": 10000 - }, - "phone": [ - { - "@": { - "type": "home" - }, - "#": "123-555-4567" - }, - { - "@": { - "type": "cell" - }, - "#": "456-555-7890" - } - ], - "email": function() {return "john@smith.com";}, - "notes": "John's profile is not complete." - }; - - console.log(js2xmlparser("person", data)); - - > - > - > John - > Smith - > Wed Aug 26 1964 00:00:00 GMT-0400 (Eastern Daylight Time) - >
      - > 3212 22nd St - > Chicago - > Illinois - > 10000 - >
      - > 123-555-4567 - > 456-555-7890 - > john@smith.com - > John's profile is not complete. - >
      - -Here's an example that uses the convert map feature: - - var js2xmlparser = require("js2xmlparser"); - - var data = { - "email": function() {return "john@smith.com";}, - "dateOfBirth": new Date(1964, 7, 26) - } - - var options = { - convertMap: { - "[object Date]": function(date) { - return date.toISOString(); - }, - "[object Function]": function(func) { - return func.toString(); - } - } - }; - - console.log(js2xmlparser("person", data, options)); - - > - > - > function () {return "john@smith.com";} - > 1964-08-26T04:00:00.000Z - > - -Here's an example that wraps strings in CDATA tags instead of escaping invalid characters. - - var js2xmlparser = require("js2xmlparser"); - - var data = { - "notes": { - "@": { - "type": "status" - }, - "#": "John's profile is not complete." - } - }; - - var options = { - useCDATA: true - }; - - console.log(js2xmlparser("person", data, options)); - - > - > - > - > - -## Tests ## - -js2xmlparser comes with a set of tests that evaluate and verify the package's core functionality. To run the tests: - -* Install the test dependencies with `npm install`. -* Run the tests with `mocha`. - -## License ## - -js2xmlparser is licensed under the [MIT license](http://opensource.org/licenses/MIT). Please see the LICENSE.md file -for more information. +# js2xmlparser # + +## Overview ## + +js2xmlparser is a Node.js module that parses JavaScript objects into XML. + +## Features ## + +Since XML is a data-interchange format, js2xmlparser is designed primarily for JSON-type objects, arrays and primitive +data types, like many of the other JavaScript to XML parsers currently available for Node.js. + +However, js2xmlparser is capable of parsing any object, including native JavaScript objects such as Date and RegExp, by +taking advantage of each object's toString function. Functions are a special case where the return value of the function +itself is used instead of the toString function, if available. + +js2xmlparser also supports a number of constructs unique to XML: + +* attributes (through a unique attribute property in objects) +* mixed content (through a unique value property in objects) +* multiple elements with the same name (through arrays) + +js2xmlparser can also pretty-print the XML it outputs with the option of customizing the indent string. + +## Installation ## + +The easiest way to install js2xmlparser is to use npm: `npm install js2xmlparser`. + +Alternatively, you may download the source from GitHub and copy it to a folder named "js2xmlparser" within your +"node_modules" directory. + +## Usage ## + +The js2xmlparser module contains one function which takes the following arguments: + +* `root` - the XML root element's name (string, mandatory) +* `data` - the data to be converted to XML; while the data object can contain arrays, it cannot itself be an array + (object or JSON string, mandatory) +* `options` - module options (object, optional) + * `declaration` - XML declaration options (object, optional) + * `include` - specifies whether an XML declaration should be included (boolean, optional, default: true) + * `encoding` - value of XML encoding attribute in declaration; a value of null represents no encoding attribute + (string, optional, default: "UTF-8") + * `attributeString` - the name of the property representing an element's attributes; note that any property with a + name equal to the attribute string is ignored except in the context of XML attributes (string, optional, default: + "@") + * `valueString` - the name of the property representing an element's value; note that any property with a name equal + to the value string is ignored except in the context of supplying a value for a tag containing attributes (string, + optional, default: "#") + * `aliasString` - the name of the property representing an element's alias; the name of the containing element will + be replaced with the alias (string, optional, default: "=") + * `prettyPrinting` - pretty-printing options (object, optional) + * `enabled` - specifies whether pretty-printing is enabled (boolean, optional, default: true) + * `indentString` - indent string (string, optional, default: "\t") + * `convertMap` - maps object types (as given by the `Object.prototype.toString.call` method) to functions to convert + those objects to a particular string representation; `*` can be used as a wildcard for all types of objects + (object, optional, default: {}) + * `useCDATA` - specifies whether strings should be enclosed in CDATA tags; otherwise, illegal XML characters will + be escaped (boolean, optional, default: false) + +## Examples ## + +The following example illustrates the basic usage of js2xmlparser: + + var js2xmlparser = require("js2xmlparser"); + + var data = { + "firstName": "John", + "lastName": "Smith" + }; + + console.log(js2xmlparser("person", data)); + + > + > + > John + > Smith + > + +This is a more complex example that builds on the first: + + var js2xmlparser = require("js2xmlparser"); + + var data = { + "@": { + "type": "individual" + }, + "firstName": "John", + "lastName": "Smith", + "dateOfBirth": new Date(1964, 7, 26), + "address": { + "@": { + "type": "home" + }, + "streetAddress": "3212 22nd St", + "city": "Chicago", + "state": "Illinois", + "zip": 10000 + }, + "phone": [ + { + "@": { + "type": "home" + }, + "#": "123-555-4567" + }, + { + "@": { + "type": "work" + }, + "#": "123-555-4567", + "=": "telephone" + }, + { + "@": { + "type": "cell" + }, + "#": "456-555-7890" + } + ], + "email": function() {return "john@smith.com";}, + "notes": "John's profile is not complete." + }; + + console.log(js2xmlparser("person", data)); + + > + > + > John + > Smith + > Wed Aug 26 1964 00:00:00 GMT-0400 (Eastern Daylight Time) + >
      + > 3212 22nd St + > Chicago + > Illinois + > 10000 + >
      + > 123-555-4567 + > 123-555-4567 + > 456-555-7890 + > john@smith.com + > John's profile is not complete. + >
      + +This example uses the alias string feature: + + var js2xmlparser = require("js2xmlparser"); + + var data = { + "phone": [ + { + "@": { + "type": "home" + }, + "#": "123-555-4567" + }, + { + "@": { + "type": "work" + }, + "#": "123-555-4567", + "=": "telephone" + }, + { + "@": { + "type": "cell" + }, + "#": "456-555-7890" + } + ] + }; + + console.log(js2xmlparser("person", data)); + + > + > + > 123-555-4567 + > 123-555-4567 + > 456-555-7890 + > + +The following an example that uses the convert map feature: + + var js2xmlparser = require("js2xmlparser"); + + var data = { + "email": function() {return "john@smith.com";}, + "dateOfBirth": new Date(1964, 7, 26) + } + + var options = { + convertMap: { + "[object Date]": function(date) { + return date.toISOString(); + }, + "[object Function]": function(func) { + return func.toString(); + } + } + }; + + console.log(js2xmlparser("person", data, options)); + + > + > + > function () {return "john@smith.com";} + > 1964-08-26T04:00:00.000Z + > + +Here's an example that wraps strings in CDATA tags instead of escaping invalid characters: + + var js2xmlparser = require("js2xmlparser"); + + var data = { + "notes": { + "@": { + "type": "status" + }, + "#": "John's profile is not complete." + } + }; + + var options = { + useCDATA: true + }; + + console.log(js2xmlparser("person", data, options)); + + > + > + > + > + +## Tests ## + +js2xmlparser comes with a set of tests that evaluate and verify the package's core functionality. To run the tests: + +* Install the test dependencies with `npm install`. +* Run the tests with `mocha`. + +## License ## + +js2xmlparser is licensed under the [MIT license](http://opensource.org/licenses/MIT). Please see the LICENSE.md file +for more information. diff --git a/node_modules/jsdoc/node_modules/js2xmlparser/example/example.js b/node_modules/jsdoc/node_modules/js2xmlparser/example/example.js index dfd9ba4..890352e 100644 --- a/node_modules/jsdoc/node_modules/js2xmlparser/example/example.js +++ b/node_modules/jsdoc/node_modules/js2xmlparser/example/example.js @@ -1,116 +1,154 @@ -/* jshint node:true */ - -/** - * js2xmlparser - * Copyright © 2012 Michael Kourlas and other contributors - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated - * documentation files (the "Software"), to deal in the Software without restriction, including without limitation the - * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to - * permit persons to whom the Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all copies or substantial portions of the - * Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE - * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS - * OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR - * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -(function() { - "use strict"; - - var js2xmlparser = require("../lib/js2xmlparser.js"); - - console.log("EXAMPLE 1"); - console.log("========="); - - var example1 = { - "firstName": "John", - "lastName": "Smith" - }; - - console.log(js2xmlparser("person", example1)); - console.log(); - - console.log("EXAMPLE 2"); - console.log("========="); - - var example2 = { - "@": { - "type": "individual" - }, - "firstName": "John", - "lastName": "Smith", - "dateOfBirth": new Date(1964, 7, 26), - "address": { - "@": { - "type": "home" - }, - "streetAddress": "3212 22nd St", - "city": "Chicago", - "state": "Illinois", - "zip": 10000 - }, - "phone": [ - { - "@": { - "type": "home" - }, - "#": "123-555-4567" - }, - { - "@": { - "type": "cell" - }, - "#": "456-555-7890" - } - ], - "email": function() {return "john@smith.com";}, - "notes": "John's profile is not complete." - }; - - console.log(js2xmlparser("person", example2)); - console.log(); - - console.log("EXAMPLE 3"); - console.log("========="); - - var example3 = { - "email": function() {return "john@smith.com";}, - "dateOfBirth": new Date(1964, 7, 26) - }; - - var example3Options = { - convertMap: { - "[object Date]": function(date) { - return date.toISOString(); - }, - "[object Function]": function(func) { - return func.toString(); - } - } - }; - - console.log(js2xmlparser("person", example3, example3Options)); - console.log(); - - console.log("EXAMPLE 4"); - console.log("========="); - - var example4 = { - "notes": { - "@": { - "type": "status" - }, - "#":"John's profile is not complete." - } - }; - - var example4Options = { - useCDATA: true - }; - - console.log(js2xmlparser("person", example4, example4Options)); -})(); +/* jshint node:true */ + +/** + * js2xmlparser + * Copyright © 2012 Michael Kourlas and other contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated + * documentation files (the "Software"), to deal in the Software without restriction, including without limitation the + * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to + * permit persons to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or substantial portions of the + * Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE + * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS + * OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ + +(function () { + "use strict"; + + var js2xmlparser = require("../lib/js2xmlparser.js"); + + console.log("EXAMPLE 1"); + console.log("========="); + + var example1 = { + "firstName": "John", + "lastName": "Smith" + }; + + console.log(js2xmlparser("person", example1)); + console.log(); + + console.log("EXAMPLE 2"); + console.log("========="); + + var example2 = { + "@": { + "type": "individual" + }, + "firstName": "John", + "lastName": "Smith", + "dateOfBirth": new Date(1964, 7, 26), + "address": { + "@": { + "type": "home" + }, + "streetAddress": "3212 22nd St", + "city": "Chicago", + "state": "Illinois", + "zip": 10000 + }, + "phone": [ + { + "@": { + "type": "home" + }, + "#": "123-555-4567" + }, + { + "@": { + "type": "work" + }, + "#": "123-555-4567" + }, + { + "@": { + "type": "cell" + }, + "#": "456-555-7890" + } + ], + "email": function () {return "john@smith.com";}, + "comment": "John's profile is not complete." + }; + + console.log(js2xmlparser("person", example2)); + console.log(); + + console.log("EXAMPLE 3"); + console.log("========="); + + var example3 = { + "phone": [ + { + "@": { + "type": "home" + }, + "#": "123-555-4567" + }, + { + "@": { + "type": "work" + }, + "#": "123-555-4567", + "=": "telephone" + }, + { + "@": { + "type": "cell" + }, + "#": "456-555-7890" + } + ] + }; + + console.log(js2xmlparser("person", example3)); + console.log(); + + console.log("EXAMPLE 4"); + console.log("========="); + + var example4 = { + "email": function () { + return "john@smith.com"; + }, + "dateOfBirth": new Date(1964, 7, 26) + }; + + var example4Options = { + convertMap: { + "[object Date]": function (date) { + return date.toISOString(); + }, + "[object Function]": function (func) { + return func.toString(); + } + } + }; + + console.log(js2xmlparser("person", example4, example4Options)); + console.log(); + + console.log("EXAMPLE 5"); + console.log("========="); + + var example5 = { + "comment": { + "@": { + "type": "status" + }, + "#": "John's profile is not complete." + } + }; + + var example5Options = { + useCDATA: true + }; + + console.log(js2xmlparser("person", example5, example5Options)); +})(); diff --git a/node_modules/jsdoc/node_modules/js2xmlparser/lib/js2xmlparser.js b/node_modules/jsdoc/node_modules/js2xmlparser/lib/js2xmlparser.js index f96c97b..e00748a 100644 --- a/node_modules/jsdoc/node_modules/js2xmlparser/lib/js2xmlparser.js +++ b/node_modules/jsdoc/node_modules/js2xmlparser/lib/js2xmlparser.js @@ -1,328 +1,353 @@ -/* jshint node:true */ - -/** - * js2xmlparser - * Copyright © 2012 Michael Kourlas and other contributors - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated - * documentation files (the "Software"), to deal in the Software without restriction, including without limitation the - * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to - * permit persons to whom the Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all copies or substantial portions of the - * Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE - * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS - * OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR - * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -(function() { - "use strict"; - - var xmlDeclaration = true; - var xmlVersion = "1.0"; - var xmlEncoding = "UTF-8"; - var attributeString = "@"; - var valueString = "#"; - var prettyPrinting = true; - var indentString = "\t"; - var convertMap = {}; - var useCDATA = false; - - module.exports = function (root, data, options) { - return toXML(init(root, data, options)); - }; - - // Initialization - var init = function(root, data, options) { - // Set option defaults - setOptionDefaults(); - - // Error checking for root element - if (typeof root !== "string") { - throw new Error("root element must be a string"); - } - else if (root === "") { - throw new Error("root element cannot be empty"); - } - - // Error checking and variable initialization for options - if (typeof options === "object" && options !== null) { - if ("declaration" in options) { - if ("include" in options.declaration) { - if (typeof options.declaration.include === "boolean") { - xmlDeclaration = options.declaration.include; - } - else { - throw new Error("declaration.include option must be a boolean"); - } - } - - if ("encoding" in options.declaration) { - if (typeof options.declaration.encoding === "string" || options.declaration.encoding === null) { - xmlEncoding = options.declaration.encoding; - } - else { - throw new Error("declaration.encoding option must be a string or null"); - } - } - } - if ("attributeString" in options) { - if (typeof options.attributeString === "string") { - attributeString = options.attributeString; - } - else { - throw new Error("attributeString option must be a string"); - } - } - if ("valueString" in options) { - if (typeof options.valueString === "string") { - valueString = options.valueString; - } - else { - throw new Error("valueString option must be a string"); - } - } - if ("prettyPrinting" in options) { - if ("enabled" in options.prettyPrinting) { - if (typeof options.prettyPrinting.enabled === "boolean") { - prettyPrinting = options.prettyPrinting.enabled; - } - else { - throw new Error("prettyPrinting.enabled option must be a boolean"); - } - } - - if ("indentString" in options.prettyPrinting) { - if (typeof options.prettyPrinting.indentString === "string") { - indentString = options.prettyPrinting.indentString; - } - else { - throw new Error("prettyPrinting.indentString option must be a string"); - } - } - } - if ("convertMap" in options) { - if (Object.prototype.toString.call(options.convertMap) === "[object Object]") { - convertMap = options.convertMap; - } - else { - throw new Error("convertMap option must be an object"); - } - } - if ("useCDATA" in options) { - if (typeof options.useCDATA === "boolean") { - useCDATA = options.useCDATA; - } - else { - throw new Error("useCDATA option must be a boolean"); - } - } - } - - // Error checking and variable initialization for data - if (typeof data !== "string" && typeof data !== "object" && typeof data !== "number" && - typeof data !== "boolean" && data !== null) { - throw new Error("data must be an object (excluding arrays) or a JSON string"); - } - - if (data === null) { - throw new Error("data must be an object (excluding arrays) or a JSON string"); - } - - if (Object.prototype.toString.call(data) === "[object Array]") { - throw new Error("data must be an object (excluding arrays) or a JSON string"); - } - - if (typeof data === "string") { - data = JSON.parse(data); - } - - var tempData = {}; - tempData[root] = data; // Add root element to object - - return tempData; - }; - - // Convert object to XML - var toXML = function(object) { - // Initialize arguments, if necessary - var xml = arguments[1] || ""; - var level = arguments[2] || 0; - - var i = null; - var tempObject = {}; - - for (var property in object) { - if (object.hasOwnProperty(property)) { - // Element name cannot start with a number - var elementName = property; - if (/^\d/.test(property)) { - elementName = "_" + property; - } - - // Arrays - if (Object.prototype.toString.call(object[property]) === "[object Array]") { - // Create separate XML elements for each array element - for (i = 0; i < object[property].length; i++) { - tempObject = {}; - tempObject[property] = object[property][i]; - - xml = toXML(tempObject, xml, level); - } - } - // JSON-type objects with properties - else if (Object.prototype.toString.call(object[property]) === "[object Object]") { - xml += addIndent("<" + elementName, level); - - // Add attributes - var lengthExcludingAttributes = Object.keys(object[property]).length; - if (Object.prototype.toString.call(object[property][attributeString]) === "[object Object]") { - lengthExcludingAttributes -= 1; - for (var attribute in object[property][attributeString]) { - if (object[property][attributeString].hasOwnProperty(attribute)) { - xml += " " + attribute + "=\"" + - toString(object[property][attributeString][attribute], true) + "\""; - } - } - } - else if (typeof object[property][attributeString] !== "undefined") { - // Fix for the case where an object contains a single property with the attribute string as its - // name, but this property contains no attributes; in that case, lengthExcludingAttributes - // should be set to zero to ensure that the object is considered an empty object for the - // purposes of the following if statement. - lengthExcludingAttributes -= 1; - } - - if (lengthExcludingAttributes === 0) { // Empty object - xml += addBreak("/>"); - } - else if (lengthExcludingAttributes === 1 && valueString in object[property]) { // Value string only - xml += addBreak(">" + toString(object[property][valueString], false) + ""); - } - else { // Object with properties - xml += addBreak(">"); - - // Create separate object for each property and pass to this function - for (var subProperty in object[property]) { - if (object[property].hasOwnProperty(subProperty) && subProperty !== attributeString && subProperty !== valueString) { - tempObject = {}; - tempObject[subProperty] = object[property][subProperty]; - - xml = toXML(tempObject, xml, level + 1); - } - } - - xml += addBreak(addIndent("", level)); - } - } - // Everything else - else { - xml += addBreak(addIndent("<" + elementName + ">" + toString(object[property], false) + "", level)); - } - } - } - - // Finalize XML at end of process - if (level === 0) { - // Strip trailing whitespace - xml = xml.replace(/\s+$/g, ""); - - // Add XML declaration - if (xmlDeclaration) { - if (xmlEncoding === null) { - xml = addBreak("") + xml; - } - else { - xml = addBreak("") + xml; - } - } - } - - return xml; - }; - - // Add indenting to data for pretty printing - var addIndent = function(data, level) { - if (prettyPrinting) { - - var indent = ""; - for (var i = 0; i < level; i++) { - indent += indentString; - } - data = indent + data; - } - - return data; - }; - - // Add line break to data for pretty printing - var addBreak = function(data) { - return prettyPrinting ? data + "\n" : data; - }; - - // Convert anything into a valid XML string representation - var toString = function(data, isAttribute) { - // Recursive function used to handle nested functions - var functionHelper = function(data) { - if (Object.prototype.toString.call(data) === "[object Function]") { - return functionHelper(data()); - } - else { - return data; - } - }; - - // Convert map - if (Object.prototype.toString.call(data) in convertMap) { - data = convertMap[Object.prototype.toString.call(data)](data); - } - else if ("*" in convertMap) { - data = convertMap["*"](data); - } - // Functions - else if (Object.prototype.toString.call(data) === "[object Function]") { - data = functionHelper(data()); - } - // Empty objects - else if (Object.prototype.toString.call(data) === "[object Object]" && Object.keys(data).length === 0) { - data = ""; - } - - // Cast data to string - if (typeof data !== "string") { - data = (data === null || typeof data === "undefined") ? "" : data.toString(); - } - - // Output as CDATA instead of escaping if option set (and only if not an attribute value) - if (useCDATA && !isAttribute) { - data = "/gm, "]]]]>") + "]]>"; - } - else { - // Escape illegal XML characters - data = data.replace(/&/gm, "&") - .replace(//gm, ">") - .replace(/"/gm, """) - .replace(/'/gm, "'"); - } - - return data; - }; - - // Revert options back to their default settings - var setOptionDefaults = function() { - useCDATA = false; - convertMap = {}; - xmlDeclaration = true; - xmlVersion = "1.0"; - xmlEncoding = "UTF-8"; - attributeString = "@"; - valueString = "#"; - prettyPrinting = true; - indentString = "\t"; - }; -})(); +/* jshint node:true */ + +/** + * js2xmlparser + * Copyright © 2012 Michael Kourlas and other contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated + * documentation files (the "Software"), to deal in the Software without restriction, including without limitation the + * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to + * permit persons to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or substantial portions of the + * Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE + * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS + * OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ + +(function () { + "use strict"; + + var xmlDeclaration = true; + var xmlVersion = "1.0"; + var xmlEncoding = "UTF-8"; + var attributeString = "@"; + var aliasString = "="; + var valueString = "#"; + var prettyPrinting = true; + var indentString = "\t"; + var convertMap = {}; + var useCDATA = false; + + module.exports = function (root, data, options) { + return toXML(init(root, data, options)); + }; + + // Initialization + var init = function (root, data, options) { + // Set option defaults + setOptionDefaults(); + + // Error checking for root element + if (typeof root !== "string") { + throw new Error("root element must be a string"); + } + else if (root === "") { + throw new Error("root element cannot be empty"); + } + + // Error checking and variable initialization for options + if (typeof options === "object" && options !== null) { + if ("declaration" in options) { + if ("include" in options.declaration) { + if (typeof options.declaration.include === "boolean") { + xmlDeclaration = options.declaration.include; + } + else { + throw new Error("declaration.include option must be a boolean"); + } + } + + if ("encoding" in options.declaration) { + if (typeof options.declaration.encoding === "string" || options.declaration.encoding === null) { + xmlEncoding = options.declaration.encoding; + } + else { + throw new Error("declaration.encoding option must be a string or null"); + } + } + } + if ("attributeString" in options) { + if (typeof options.attributeString === "string") { + attributeString = options.attributeString; + } + else { + throw new Error("attributeString option must be a string"); + } + } + if ("valueString" in options) { + if (typeof options.valueString === "string") { + valueString = options.valueString; + } + else { + throw new Error("valueString option must be a string"); + } + } + if ("aliasString" in options) { + if (typeof options.aliasString === "string") { + aliasString = options.aliasString; + } + else { + throw new Error("aliasString option must be a string"); + } + } + if ("prettyPrinting" in options) { + if ("enabled" in options.prettyPrinting) { + if (typeof options.prettyPrinting.enabled === "boolean") { + prettyPrinting = options.prettyPrinting.enabled; + } + else { + throw new Error("prettyPrinting.enabled option must be a boolean"); + } + } + + if ("indentString" in options.prettyPrinting) { + if (typeof options.prettyPrinting.indentString === "string") { + indentString = options.prettyPrinting.indentString; + } + else { + throw new Error("prettyPrinting.indentString option must be a string"); + } + } + } + if ("convertMap" in options) { + if (Object.prototype.toString.call(options.convertMap) === "[object Object]") { + convertMap = options.convertMap; + } + else { + throw new Error("convertMap option must be an object"); + } + } + if ("useCDATA" in options) { + if (typeof options.useCDATA === "boolean") { + useCDATA = options.useCDATA; + } + else { + throw new Error("useCDATA option must be a boolean"); + } + } + } + + // Error checking and variable initialization for data + if (typeof data !== "string" && typeof data !== "object" && typeof data !== "number" && + typeof data !== "boolean" && data !== null) { + throw new Error("data must be an object (excluding arrays) or a JSON string"); + } + + if (data === null) { + throw new Error("data must be an object (excluding arrays) or a JSON string"); + } + + if (Object.prototype.toString.call(data) === "[object Array]") { + throw new Error("data must be an object (excluding arrays) or a JSON string"); + } + + if (typeof data === "string") { + data = JSON.parse(data); + } + + var tempData = {}; + tempData[root] = data; // Add root element to object + + return tempData; + }; + + // Convert object to XML + var toXML = function (object) { + // Initialize arguments, if necessary + var xml = arguments[1] || ""; + var level = arguments[2] || 0; + + var i = null; + var tempObject = {}; + + for (var property in object) { + if (object.hasOwnProperty(property)) { + // Element name cannot start with a number + var elementName = property; + if (/^\d/.test(property)) { + elementName = "_" + property; + } + + // Skip alias string property + if (elementName === aliasString) { + continue; + } + + // When alias string property is present, use as alias for element name + if (Object.prototype.toString.call(object[property]) === "[object Object]" && + aliasString in object[property]) { + elementName = object[property][aliasString]; + } + + // Arrays + if (Object.prototype.toString.call(object[property]) === "[object Array]") { + // Create separate XML elements for each array element + for (i = 0; i < object[property].length; i++) { + tempObject = {}; + tempObject[property] = object[property][i]; + + xml = toXML(tempObject, xml, level); + } + } + // JSON-type objects with properties + else if (Object.prototype.toString.call(object[property]) === "[object Object]") { + xml += addIndent("<" + elementName, level); + + // Add attributes + var lengthExcludingAttributes = Object.keys(object[property]).length; + if (Object.prototype.toString.call(object[property][attributeString]) === "[object Object]") { + lengthExcludingAttributes -= 1; + for (var attribute in object[property][attributeString]) { + if (object[property][attributeString].hasOwnProperty(attribute)) { + xml += " " + attribute + "=\"" + + toString(object[property][attributeString][attribute], true) + "\""; + } + } + } + else if (typeof object[property][attributeString] !== "undefined") { + // Fix for the case where an object contains a single property with the attribute string as its + // name, but this property contains no attributes; in that case, lengthExcludingAttributes + // should be set to zero to ensure that the object is considered an empty object for the + // purposes of the following if statement. + lengthExcludingAttributes -= 1; + } + + if (lengthExcludingAttributes === 0) { // Empty object + xml += addBreak("/>"); + } + else if ((lengthExcludingAttributes === 1 || + (lengthExcludingAttributes === 2 && aliasString in object[property])) && + valueString in object[property]) { // Value string only + xml += addBreak(">" + toString(object[property][valueString], false) + ""); + } + else { // Object with properties + xml += addBreak(">"); + + // Create separate object for each property and pass to this function + for (var subProperty in object[property]) { + if (object[property].hasOwnProperty(subProperty) && subProperty !== attributeString && + subProperty !== valueString) { + tempObject = {}; + tempObject[subProperty] = object[property][subProperty]; + + xml = toXML(tempObject, xml, level + 1); + } + } + + xml += addBreak(addIndent("", level)); + } + } + // Everything else + else { + xml += addBreak(addIndent("<" + elementName + ">" + toString(object[property], false) + "", level)); + } + } + } + + // Finalize XML at end of process + if (level === 0) { + // Strip trailing whitespace + xml = xml.replace(/\s+$/g, ""); + + // Add XML declaration + if (xmlDeclaration) { + if (xmlEncoding === null) { + xml = addBreak("") + xml; + } + else { + xml = addBreak("") + xml; + } + } + } + + return xml; + }; + + // Add indenting to data for pretty printing + var addIndent = function (data, level) { + if (prettyPrinting) { + + var indent = ""; + for (var i = 0; i < level; i++) { + indent += indentString; + } + data = indent + data; + } + + return data; + }; + + // Add line break to data for pretty printing + var addBreak = function (data) { + return prettyPrinting ? data + "\n" : data; + }; + + // Convert anything into a valid XML string representation + var toString = function (data, isAttribute) { + // Recursive function used to handle nested functions + var functionHelper = function (data) { + if (Object.prototype.toString.call(data) === "[object Function]") { + return functionHelper(data()); + } + else { + return data; + } + }; + + // Convert map + if (Object.prototype.toString.call(data) in convertMap) { + data = convertMap[Object.prototype.toString.call(data)](data); + } + else if ("*" in convertMap) { + data = convertMap["*"](data); + } + // Functions + else if (Object.prototype.toString.call(data) === "[object Function]") { + data = functionHelper(data()); + } + // Empty objects + else if (Object.prototype.toString.call(data) === "[object Object]" && Object.keys(data).length === 0) { + data = ""; + } + + // Cast data to string + if (typeof data !== "string") { + data = (data === null || typeof data === "undefined") ? "" : data.toString(); + } + + // Output as CDATA instead of escaping if option set (and only if not an attribute value) + if (useCDATA && !isAttribute) { + data = "/gm, "]]]]>") + "]]>"; + } + else { + // Escape illegal XML characters + data = data.replace(/&/gm, "&") + .replace(//gm, ">") + .replace(/"/gm, """) + .replace(/'/gm, "'"); + } + + return data; + }; + + // Revert options back to their default settings + var setOptionDefaults = function () { + useCDATA = false; + convertMap = {}; + xmlDeclaration = true; + xmlVersion = "1.0"; + xmlEncoding = "UTF-8"; + attributeString = "@"; + aliasString = "="; + valueString = "#"; + prettyPrinting = true; + indentString = "\t"; + }; +})(); diff --git a/node_modules/jsdoc/node_modules/js2xmlparser/package.json b/node_modules/jsdoc/node_modules/js2xmlparser/package.json index da979c6..2aea7a7 100644 --- a/node_modules/jsdoc/node_modules/js2xmlparser/package.json +++ b/node_modules/jsdoc/node_modules/js2xmlparser/package.json @@ -13,7 +13,7 @@ "xml" ], "homepage": "http://www.kourlas.net", - "version": "0.1.5", + "version": "0.1.7", "author": { "name": "Michael Kourlas", "email": "michael@kourlas.net" @@ -28,13 +28,15 @@ "should": "*" }, "license": "MIT", + "gitHead": "787d4a0f624f805a24fe334ad79d6cf127b0c146", "bugs": { "url": "https://github.com/michaelkourlas/node-js2xmlparser/issues" }, - "_id": "js2xmlparser@0.1.5", - "_shasum": "b42b3ac5a74bb282ff06cc93dfa67fb98a22959d", - "_from": "js2xmlparser@~0.1.0", - "_npmVersion": "1.4.9", + "_id": "js2xmlparser@0.1.7", + "scripts": {}, + "_shasum": "c8a4bf9ba00577c4b2ce0bd6e714ee8341a586ae", + "_from": "js2xmlparser@>=0.1.7 <0.2.0", + "_npmVersion": "1.4.28", "_npmUser": { "name": "michaelkourlas", "email": "michael@kourlas.net" @@ -46,10 +48,10 @@ } ], "dist": { - "shasum": "b42b3ac5a74bb282ff06cc93dfa67fb98a22959d", - "tarball": "http://registry.npmjs.org/js2xmlparser/-/js2xmlparser-0.1.5.tgz" + "shasum": "c8a4bf9ba00577c4b2ce0bd6e714ee8341a586ae", + "tarball": "http://registry.npmjs.org/js2xmlparser/-/js2xmlparser-0.1.7.tgz" }, "directories": {}, - "_resolved": "https://registry.npmjs.org/js2xmlparser/-/js2xmlparser-0.1.5.tgz", + "_resolved": "https://registry.npmjs.org/js2xmlparser/-/js2xmlparser-0.1.7.tgz", "readme": "ERROR: No README data found!" } diff --git a/node_modules/jsdoc/node_modules/js2xmlparser/test/test.js b/node_modules/jsdoc/node_modules/js2xmlparser/test/test.js index 2a67e62..4b3c675 100644 --- a/node_modules/jsdoc/node_modules/js2xmlparser/test/test.js +++ b/node_modules/jsdoc/node_modules/js2xmlparser/test/test.js @@ -1,1259 +1,1408 @@ -/* jshint node:true */ - -/* globals describe, it */ - -/** - * js2xmlparser - * Copyright © 2012 Michael Kourlas and other contributors - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated - * documentation files (the "Software"), to deal in the Software without restriction, including without limitation the - * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to - * permit persons to whom the Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all copies or substantial portions of the - * Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE - * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS - * OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR - * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -(function () { - "use strict"; - - var js2xmlparser = require("../lib/js2xmlparser"); - var should = require("should"); - var util = require("util"); - - var defaultRoot = "base"; - var defaultData = { - hello: "world" - }; - var defaultOptions = { - declaration: { - include: false - }, - prettyPrinting: { - enabled: false - } - }; - - describe("js2xmlparser", function () { - describe("root", function () { - it("should raise an error when root is undefined", function () { - var res; - try { - res = js2xmlparser(undefined, defaultData, defaultOptions); - } catch (e) { - e.should.match(/root element must be a string/); - } - should.not.exist(res); - }); - - it("should raise an error when root is null", function () { - var res; - try { - res = js2xmlparser(null, defaultData, defaultOptions); - } catch (e) { - e.should.match(/root element must be a string/); - } - should.not.exist(res); - }); - - it("should raise an error when root is an object", function () { - var res; - try { - res = js2xmlparser({}, defaultData, defaultOptions); - } catch (e) { - e.should.match(/root element must be a string/); - } - should.not.exist(res); - }); - - it("should raise an error when root is an array", function () { - var res; - try { - res = js2xmlparser([], defaultData, defaultOptions); - } catch (e) { - e.should.match(/root element must be a string/); - } - should.not.exist(res); - }); - - it("should raise an error when root is a boolean", function () { - var res; - try { - res = js2xmlparser(true, defaultData, defaultOptions); - } catch (e) { - e.should.match(/root element must be a string/); - } - should.not.exist(res); - }); - - it("should raise an error when root is a number", function () { - var res; - try { - res = js2xmlparser(2, defaultData, defaultOptions); - } catch (e) { - e.should.match(/root element must be a string/); - } - should.not.exist(res); - }); - - it("should raise an error when root is an empty string", function () { - var res; - try { - res = js2xmlparser("", defaultData, defaultOptions); - } catch (e) { - e.should.match(/root element cannot be empty/); - } - should.not.exist(res); - }); - - it("should create XML with 'base' as the root element when root is 'base'", function () { - var res = js2xmlparser(defaultRoot, defaultData, defaultOptions); - res.should.startWith(""); - }); - }); - - describe("options", function () { - describe("declaration", function () { - describe("include", function () { - it("should raise an error when options.declaration is defined and options.declaration.include is undefined", function () { - var res; - try { - res = js2xmlparser(defaultRoot, defaultData, { - declaration: { - include: undefined - } - }); - } catch (e) { - e.should.match(/declaration.include option must be a boolean/); - } - should.not.exist(res); - }); - - it("should raise an error when options.declaration is defined and options.declaration.include is null", function () { - var res; - try { - res = js2xmlparser(defaultRoot, defaultData, { - declaration: { - include: null - } - }); - } catch (e) { - e.should.match(/declaration.include option must be a boolean/); - } - should.not.exist(res); - }); - - it("should raise an error when options.declaration is defined and options.declaration.include is an object", function () { - var res; - try { - res = js2xmlparser(defaultRoot, defaultData, { - declaration: { - include: {} - } - }); - } catch (e) { - e.should.match(/declaration.include option must be a boolean/); - } - should.not.exist(res); - }); - - it("should raise an error when options.declaration is defined and options.declaration.include is an array", function () { - var res; - try { - res = js2xmlparser(defaultRoot, defaultData, { - declaration: { - include: [] - } - }); - } catch (e) { - e.should.match(/declaration.include option must be a boolean/); - } - should.not.exist(res); - }); - - it("should raise an error when options.declaration is defined and options.declaration.include is a number", function () { - var res; - try { - res = js2xmlparser(defaultRoot, defaultData, { - declaration: { - include: 2 - } - }); - } catch (e) { - e.should.match(/declaration.include option must be a boolean/); - } - should.not.exist(res); - }); - - it("should raise an error when options.declaration is defined and options.declaration.include is a string", function () { - var res; - try { - res = js2xmlparser(defaultRoot, defaultData, { - declaration: { - include: "string" - } - }); - } catch (e) { - e.should.match(/declaration.include option must be a boolean/); - } - should.not.exist(res); - }); - - it("should create XML with declaration when options.declaration.include is not specified", function () { - var res = js2xmlparser(defaultRoot, defaultData, {}); - res.should.startWith(""); - }); - - it("should create XML with declaration when options.declaration.include is true", function () { - var res = js2xmlparser(defaultRoot, defaultData, { - declaration: { - include: true - } - }); - res.should.startWith(""); - }); - - it("should create XML without declaration when options.declaration.include is false", function () { - var res = js2xmlparser(defaultRoot, defaultData, { - declaration: { - include: false - } - }); - res.should.startWith(""); - }); - }); - - describe("encoding", function () { - it("should raise an error when options.declaration is defined and options.declaration.encoding is undefined", function () { - var res; - try { - res = js2xmlparser(defaultRoot, defaultData, { - declaration: { - encoding: undefined - } - }); - } catch (e) { - e.should.match(/declaration.encoding option must be a string or null/); - } - should.not.exist(res); - }); - - it("should raise an error when options.declaration is defined and options.declaration.encoding is an object", function () { - var res; - try { - res = js2xmlparser(defaultRoot, defaultData, { - declaration: { - encoding: {} - } - }); - } catch (e) { - e.should.match(/declaration.encoding option must be a string or null/); - } - should.not.exist(res); - }); - - it("should raise an error when options.declaration is defined and options.declaration.encoding is an array", function () { - var res; - try { - res = js2xmlparser(defaultRoot, defaultData, { - declaration: { - encoding: [] - } - }); - } catch (e) { - e.should.match(/declaration.encoding option must be a string or null/); - } - should.not.exist(res); - }); - - it("should raise an error when options.declaration is defined and options.declaration.encoding is a number", function () { - var res; - try { - res = js2xmlparser(defaultRoot, defaultData, { - declaration: { - encoding: 2 - } - }); - } catch (e) { - e.should.match(/declaration.encoding option must be a string or null/); - } - should.not.exist(res); - }); - - it("should raise an error when options.declaration is defined and options.declaration.encoding is a boolean", function () { - var res; - try { - res = js2xmlparser(defaultRoot, defaultData, { - declaration: { - encoding: true - } - }); - } catch (e) { - e.should.match(/declaration.encoding option must be a string or null/); - } - should.not.exist(res); - }); - - it("should create XML declaration with encoding 'UTF-8' when options.declaration.encoding is not specified", function () { - var res = js2xmlparser(defaultRoot, defaultData, {}); - res.should.startWith(""); - }); - - it("should create XML declaration with encoding 'UTF-16' when options.declaration.encoding is 'UTF-16'", function () { - var res = js2xmlparser(defaultRoot, defaultData, { - declaration: { - encoding: "UTF-16" - } - }); - res.should.startWith(""); - }); - - it("should create XML declaration without encoding attribute when options.declaration.encoding is null", function () { - var res = js2xmlparser(defaultRoot, defaultData, { - declaration: { - encoding: null - } - }); - res.should.startWith(""); - }); - }); - }); - - describe("attributeString", function () { - it("should raise an error when options is defined and options.attributeString is undefined", function () { - var res; - try { - res = js2xmlparser(defaultRoot, defaultData, { - attributeString: undefined - }); - } catch (e) { - e.should.match(/attributeString option must be a string/); - } - should.not.exist(res); - }); - - it("should raise an error when options is defined and options.attributeString is an object", function () { - var res; - try { - res = js2xmlparser(defaultRoot, defaultData, { - attributeString: {} - }); - } catch (e) { - e.should.match(/attributeString option must be a string/); - } - should.not.exist(res); - }); - - it("should raise an error when options is defined and options.attributeString is an array", function () { - var res; - try { - res = js2xmlparser(defaultRoot, defaultData, { - attributeString: [] - }); - } catch (e) { - e.should.match(/attributeString option must be a string/); - } - should.not.exist(res); - }); - - it("should raise an error when options is defined and options.attributeString is a number", function () { - var res; - try { - res = js2xmlparser(defaultRoot, defaultData, { - attributeString: 2 - }); - } catch (e) { - e.should.match(/attributeString option must be a string/); - } - should.not.exist(res); - }); - - it("should raise an error when options is defined and options.attributeString is a boolean", function () { - var res; - try { - res = js2xmlparser(defaultRoot, defaultData, { - attributeString: true - }); - } catch (e) { - e.should.match(/attributeString option must be a string/); - } - should.not.exist(res); - }); - - it("should create XML with attribute string '@' when options.attributeString is not specified", function () { - var res = js2xmlparser(defaultRoot, { - a: { - "@": { - b: "c" - } - } - }, defaultOptions); - res.should.equal("
      "); - }); - - it("should create XML with attribute string '__attr' when options.attributeString is '__attr'", function () { - var res = js2xmlparser(defaultRoot, { - a: { - "__attr": { - b: "c" - } - } - }, { - declaration: { - include: false - }, - prettyPrinting: { - enabled: false - }, - attributeString: "__attr" - }); - res.should.equal(""); - }); - }); - - describe("valueString", function () { - it("should raise an error when options is defined and options.valueString is undefined", function () { - var res; - try { - res = js2xmlparser(defaultRoot, defaultData, { - valueString: undefined - }); - } catch (e) { - e.should.match(/valueString option must be a string/); - } - should.not.exist(res); - }); - - it("should raise an error when options is defined and options.valueString is an object", function () { - var res; - try { - res = js2xmlparser(defaultRoot, defaultData, { - valueString: {} - }); - } catch (e) { - e.should.match(/valueString option must be a string/); - } - should.not.exist(res); - }); - - it("should raise an error when options is defined and options.valueString is an array", function () { - var res; - try { - res = js2xmlparser(defaultRoot, defaultData, { - valueString: [] - }); - } catch (e) { - e.should.match(/valueString option must be a string/); - } - should.not.exist(res); - }); - - it("should raise an error when options is defined and options.valueString is a number", function () { - var res; - try { - res = js2xmlparser(defaultRoot, defaultData, { - valueString: 2 - }); - } catch (e) { - e.should.match(/valueString option must be a string/); - } - should.not.exist(res); - }); - - it("should raise an error when options is defined and options.valueString is a boolean", function () { - var res; - try { - res = js2xmlparser(defaultRoot, defaultData, { - valueString: true - }); - } catch (e) { - e.should.match(/valueString option must be a string/); - } - should.not.exist(res); - }); - - it("should create XML with value string '@' when options.valueString is not specified", function () { - var res = js2xmlparser(defaultRoot, { - a: { - "@": { - b: "c" - }, - "#": "d" - } - }, defaultOptions); - res.should.equal("d"); - }); - - it("should create XML with value string '__val' when options.valueString is '__val'", function () { - var res = js2xmlparser(defaultRoot, { - a: { - "@": { - b: "c" - }, - "__val": "d" - } - }, { - declaration: { - include: false - }, - prettyPrinting: { - enabled: false - }, - valueString: "__val" - }); - res.should.equal("d"); - }); - }); - - describe("prettyPrinting", function () { - describe("enabled", function () { - it("should raise an error when options.prettyPrinting is defined and options.prettyPrinting.enabled is undefined", function () { - var res; - try { - res = js2xmlparser(defaultRoot, defaultData, { - prettyPrinting: { - enabled: undefined - } - }); - } catch (e) { - e.should.match(/prettyPrinting.enabled option must be a boolean/); - } - should.not.exist(res); - }); - - it("should raise an error when options.prettyPrinting is defined and options.prettyPrinting.enabled is null", function () { - var res; - try { - res = js2xmlparser(defaultRoot, defaultData, { - prettyPrinting: { - enabled: null - } - }); - } catch (e) { - e.should.match(/prettyPrinting.enabled option must be a boolean/); - } - should.not.exist(res); - }); - - it("should raise an error when options.prettyPrinting is defined and options.prettyPrinting.enabled is an object", function () { - var res; - try { - res = js2xmlparser(defaultRoot, defaultData, { - prettyPrinting: { - enabled: {} - } - }); - } catch (e) { - e.should.match(/prettyPrinting.enabled option must be a boolean/); - } - should.not.exist(res); - }); - - it("should raise an error when options.prettyPrinting is defined and options.prettyPrinting.enabled is an array", function () { - var res; - try { - res = js2xmlparser(defaultRoot, defaultData, { - prettyPrinting: { - enabled: [] - } - }); - } catch (e) { - e.should.match(/prettyPrinting.enabled option must be a boolean/); - } - should.not.exist(res); - }); - - it("should raise an error when options.prettyPrinting is defined and options.prettyPrinting.enabled is a number", function () { - var res; - try { - res = js2xmlparser(defaultRoot, defaultData, { - prettyPrinting: { - enabled: 2 - } - }); - } catch (e) { - e.should.match(/prettyPrinting.enabled option must be a boolean/); - } - should.not.exist(res); - }); - - it("should raise an error when options.prettyPrinting is defined and options.prettyPrinting.enabled is a string", function () { - var res; - try { - res = js2xmlparser(defaultRoot, defaultData, { - prettyPrinting: { - enabled: "string" - } - }); - } catch (e) { - e.should.match(/prettyPrinting.enabled option must be a boolean/); - } - should.not.exist(res); - }); - - it("should create XML with pretty printing when options.prettyPrinting.enabled is not specified", function () { - var res = js2xmlparser(defaultRoot, defaultData, { - declaration: { - include: false - } - }); - res.should.equal("\n\tworld\n"); - }); - - it("should create XML with pretty printing when options.prettyPrinting.enabled is true", function () { - var res = js2xmlparser(defaultRoot, defaultData, { - prettyPrinting: { - enabled: true - }, - declaration: { - include: false - } - }); - res.should.equal("\n\tworld\n"); - }); - - it("should create XML without pretty printing when options.prettyPrinting.enabled is false", function () { - var res = js2xmlparser(defaultRoot, defaultData, { - prettyPrinting: { - enabled: false - }, - declaration: { - include: false - } - }); - res.should.equal("world"); - }); - }); - - describe("indentString", function () { - it("should raise an error when options.prettyPrinting is defined and options.prettyPrinting.indentString is undefined", function () { - var res; - try { - res = js2xmlparser(defaultRoot, defaultData, { - prettyPrinting: { - indentString: undefined - } - }); - } catch (e) { - e.should.match(/prettyPrinting.indentString option must be a string/); - } - should.not.exist(res); - }); - - it("should raise an error when options.prettyPrinting is defined and options.prettyPrinting.indentString is an object", function () { - var res; - try { - res = js2xmlparser(defaultRoot, defaultData, { - prettyPrinting: { - indentString: {} - } - }); - } catch (e) { - e.should.match(/prettyPrinting.indentString option must be a string/); - } - should.not.exist(res); - }); - - it("should raise an error when options.prettyPrinting is defined and options.prettyPrinting.indentString is an array", function () { - var res; - try { - res = js2xmlparser(defaultRoot, defaultData, { - prettyPrinting: { - indentString: [] - } - }); - } catch (e) { - e.should.match(/prettyPrinting.indentString option must be a string/); - } - should.not.exist(res); - }); - - it("should raise an error when options.prettyPrinting is defined and options.prettyPrinting.indentString is a number", function () { - var res; - try { - res = js2xmlparser(defaultRoot, defaultData, { - prettyPrinting: { - indentString: 2 - } - }); - } catch (e) { - e.should.match(/prettyPrinting.indentString option must be a string/); - } - should.not.exist(res); - }); - - it("should raise an error when options.prettyPrinting is defined and options.prettyPrinting.indentString is a boolean", function () { - var res; - try { - res = js2xmlparser(defaultRoot, defaultData, { - prettyPrinting: { - indentString: true - } - }); - } catch (e) { - e.should.match(/prettyPrinting.indentString option must be a string/); - } - should.not.exist(res); - }); - - it("should pretty print with indent string '\t' when options.prettyPrinting.indentString is not specified", function () { - var res = js2xmlparser(defaultRoot, defaultData, { - declaration: { - include: false - } - }); - res.should.equal("\n\tworld\n"); - }); - - it("should pretty print with indent string ' ' when options.valueString is ' '", function () { - var res = js2xmlparser(defaultRoot, defaultData, { - declaration: { - include: false - }, - prettyPrinting: { - indentString: ' ' - } - }); - res.should.equal("\n world\n"); - }); - }); - }); - - describe("convertMap", function () { - it("should raise an error when options is defined and options.convertMap is undefined", function () { - var res; - try { - res = js2xmlparser(defaultRoot, defaultData, { - declaration: { - include: false - }, - prettyPrinting: { - enabled: false - }, - convertMap: undefined - }); - } catch (e) { - e.should.match(/convertMap option must be an object/); - } - should.not.exist(res); - }); - - it("should raise an error when options is defined and options.convertMap is null", function () { - var res; - try { - res = js2xmlparser(defaultRoot, defaultData, { - declaration: { - include: false - }, - prettyPrinting: { - enabled: false - }, - convertMap: null - }); - } catch (e) { - e.should.match(/convertMap option must be an object/); - } - should.not.exist(res); - }); - - it("should raise an error when options is defined and options.convertMap is an array", function () { - var res; - try { - res = js2xmlparser(defaultRoot, defaultData, { - declaration: { - include: false - }, - prettyPrinting: { - enabled: false - }, - convertMap: [] - }); - } catch (e) { - e.should.match(/convertMap option must be an object/); - } - should.not.exist(res); - }); - - it("should raise an error when options is defined and options.convertMap is a boolean", function () { - var res; - try { - res = js2xmlparser(defaultRoot, defaultData, { - declaration: { - include: false - }, - prettyPrinting: { - enabled: false - }, - convertMap: true - }); - } catch (e) { - e.should.match(/convertMap option must be an object/); - } - should.not.exist(res); - }); - - it("should raise an error when options is defined and options.convertMap is a number", function () { - var res; - try { - res = js2xmlparser(defaultRoot, defaultData, { - declaration: { - include: false - }, - prettyPrinting: { - enabled: false - }, - convertMap: 2 - }); - } catch (e) { - e.should.match(/convertMap option must be an object/); - } - should.not.exist(res); - }); - - it("should raise an error when options is defined and options.convertMap is a string", function () { - var res; - try { - res = js2xmlparser(defaultRoot, defaultData, { - declaration: { - include: false - }, - prettyPrinting: { - enabled: false - }, - convertMap: "test" - }); - } catch (e) { - e.should.match(/convertMap option must be an object/); - } - should.not.exist(res); - }); - - it("should correctly parse XML using convert maps", function () { - var res = js2xmlparser(defaultRoot, { - "a": "b", - "c": 1 - }, { - declaration: { - include: false - }, - prettyPrinting: { - enabled: false - }, - convertMap: { - "[object Number]": function (num) { - return num + 1; - }, - "[object String]": function (str) { - return str + "a"; - } - } - }); - res.should.equal("ba2"); - }); - }); - - describe("useCDATA", function () { - it("should raise an error when options is defined and options.useCDATA is undefined", function () { - var res; - try { - res = js2xmlparser(defaultRoot, defaultData, { - useCDATA: undefined - }); - } catch (e) { - e.should.match(/useCDATA option must be a boolean/); - } - should.not.exist(res); - }); - - it("should raise an error when options is defined and options.useCDATA is null", function () { - var res; - try { - res = js2xmlparser(defaultRoot, defaultData, { - useCDATA: null - }); - } catch (e) { - e.should.match(/useCDATA option must be a boolean/); - } - should.not.exist(res); - }); - - it("should raise an error when options is defined and options.useCDATA is an object", function () { - var res; - try { - res = js2xmlparser(defaultRoot, defaultData, { - useCDATA: {} - }); - } catch (e) { - e.should.match(/useCDATA option must be a boolean/); - } - should.not.exist(res); - }); - - it("should raise an error when options is defined and options.useCDATA is an array", function () { - var res; - try { - res = js2xmlparser(defaultRoot, defaultData, { - useCDATA: [] - }); - } catch (e) { - e.should.match(/useCDATA option must be a boolean/); - } - should.not.exist(res); - }); - - it("should raise an error when options is defined and options.useCDATA is a number", function () { - var res; - try { - res = js2xmlparser(defaultRoot, defaultData, { - useCDATA: 2 - }); - } catch (e) { - e.should.match(/useCDATA option must be a boolean/); - } - should.not.exist(res); - }); - - it("should raise an error when options is defined and options.useCDATA is a string", function () { - var res; - try { - res = js2xmlparser(defaultRoot, defaultData, { - useCDATA: "string" - }); - } catch (e) { - e.should.match(/useCDATA option must be a boolean/); - } - should.not.exist(res); - }); - - it("should create XML without CDATA strings when options.CDATA is not specified", function () { - var res = js2xmlparser(defaultRoot, { - "a": "b'c" - }, defaultOptions); - res.should.equal("b'c"); - }); - - it("should create XML without CDATA strings when options.CDATA is false", function () { - var res = js2xmlparser(defaultRoot, { - "a": "b'c" - }, { - useCDATA: false, - declaration: { - include: false - }, - prettyPrinting: { - enabled: false - } - }); - res.should.equal("b'c"); - }); - - it("should create XML without CDATA strings when options.CDATA is true", function () { - var res = js2xmlparser(defaultRoot, { - "a": "b'c" - }, { - useCDATA: true, - declaration: { - include: false - }, - prettyPrinting: { - enabled: false - } - }); - res.should.equal(""); - }); - }); - }); - - describe("data", function () { - it("should raise an error when data is undefined", function () { - var res; - try { - res = js2xmlparser(defaultRoot, undefined, defaultOptions); - } catch (e) { - e.should.match(/data must be an object (excluding arrays) or a JSON string/); - } - should.not.exist(res); - }); - - it("should raise an error when data is null", function () { - var res; - try { - res = js2xmlparser(defaultRoot, null, defaultOptions); - } catch (e) { - e.should.match(/data must be an object (excluding arrays) or a JSON string/); - } - should.not.exist(res); - }); - - it("should raise an error when data is an array", function () { - var res; - try { - res = js2xmlparser(defaultRoot, [], defaultOptions); - } catch (e) { - e.should.match(/data must be an object (excluding arrays) or a JSON string/); - } - should.not.exist(res); - }); - - it("should raise an error when data is a non-JSON string", function () { - var res; - try { - res = js2xmlparser(defaultRoot, "test", defaultOptions); - } catch (e) { - e.should.match(/data must be an object (excluding arrays) or a JSON string/); - } - should.not.exist(res); - }); - - it("should correctly parse a number", function () { - var res = js2xmlparser(defaultRoot, 2, defaultOptions); - res.should.equal("2"); - }); - - it("should correctly parse a boolean", function () { - var res = js2xmlparser(defaultRoot, true, defaultOptions); - res.should.equal("true"); - }); - - it("should correctly parse a JSON string", function () { - var res = js2xmlparser(defaultRoot, "{\"hello\":\"world\"}", defaultOptions); - res.should.equal("world"); - }); - - it("should correctly parse an empty object", function () { - var res = js2xmlparser(defaultRoot, {}, defaultOptions); - res.should.equal(""); - }); - - it("should correctly parse a simple object", function () { - var res = js2xmlparser(defaultRoot, { - a: "b", - c: "d" - }, defaultOptions); - res.should.equal("bd"); - }); - - it("should correctly parse attributes", function () { - var res = js2xmlparser(defaultRoot, { - "@": { - a: "b", - "@": "c" - }, - d: { - "@": { - e: "f" - } - }, - g: { - "@": { - h: "i" - }, - j: "k", - l: { - "@": "m" - } - } - }, defaultOptions); - res.should.equal("k"); - }); - - it("should correctly parse value strings", function () { - var res = js2xmlparser(defaultRoot, { - "#": "1", - a: { - "#": "b" - }, - c: { - "#": "d", - e: { - f: "g" - }, - "h": { - "#": { - "i": "j", - "#": "k" - } - } - }, - l: { - "@": { - m: "n" - }, - "#": "o" - } - }, { - declaration: { - include: false - }, - prettyPrinting: { - enabled: false - } - }); - res.should.equal("bg[object Object]o"); - }); - - it("should correctly parse arrays", function () { - var res = js2xmlparser(defaultRoot, { - a: ["b", "c", "d"], - e: ["f", "g", ["h", "i"], "j"], - k: { - l: ["m", "n", "o"] - } - }, defaultOptions); - res.should.equal("bcdfghijm" + - "no"); - }); - - it("should correctly parse example 1", function () { - var res = js2xmlparser("person", { - "firstName": "John", - "lastName": "Smith" - }, defaultOptions); - res.should.equal("JohnSmith"); - }); - - it("should correctly parse example 2", function () { - var res = js2xmlparser("person", { - "@": { - "type": "individual" - }, - "firstName": "John", - "lastName": "Smith", - "dateOfBirth": new Date(1964, 7, 26), - "address": { - "@": { - "type": "home" - }, - "streetAddress": "3212 22nd St", - "city": "Chicago", - "state": "Illinois", - "zip": 10000 - }, - "phone": [ - { - "@": { - "type": "home" - }, - "#": "123-555-4567" - }, - { - "@": { - "type": "cell" - }, - "#": "456-555-7890" - } - ], - "email": function () { - return "john@smith.com"; - }, - "notes": "John's profile is not complete." - }, defaultOptions); - res.should.equal("JohnSmith" + - ""+new Date(1964, 7, 26)+"
      3212 22nd StChicagoIllinois" + - "10000
      123-555-4567" + - "456-555-7890john@smith.comJohn's profile is not complete." + - "
      "); - }); - - it("should correctly parse example 2 with pretty printing", function () { - var res = js2xmlparser("person", { - "@": { - "type": "individual" - }, - "firstName": "John", - "lastName": "Smith", - "dateOfBirth": new Date(1964, 7, 26), - "address": { - "@": { - "type": "home" - }, - "streetAddress": "3212 22nd St", - "city": "Chicago", - "state": "Illinois", - "zip": 10000 - }, - "phone": [ - { - "@": { - "type": "home" - }, - "#": "123-555-4567" - }, - { - "@": { - "type": "cell" - }, - "#": "456-555-7890" - } - ], - "email": function () { - return "john@smith.com"; - }, - "notes": "John's profile is not complete." - }, { - declaration: { - include: false - } - }); - res.should.equal("\n\tJohn\n\tSmith" + - "\n\t"+ new Date(1964, 7, 26) + - "\n\t
      \n\t\t3212 22nd St" + - "\n\t\tChicago\n\t\tIllinois\n\t\t10000\n\t
      " + - "\n\t123-555-4567\n\t456-555-7890\n\t" + - "john@smith.com\n\tJohn's profile is not complete.\n
      "); - }); - - it("should correctly parse example 3", function () { - var res = js2xmlparser("person", { - "email": function() {return "john@smith.com";}, - "dateOfBirth": new Date(1964, 7, 26) - }, { - declaration: { - include: false - }, - prettyPrinting: { - enabled: false - }, - convertMap: { - "[object Date]": function (date) { - return date.toISOString(); - }, - "[object Function]": function(func) { - return func.toString(); - } - } - }); - res.should.equal("function () {return "john@smith.com";}" + - "1964-08-26T04:00:00.000Z"); - }); - - it("should correctly parse example 4", function () { - var res = js2xmlparser("person", { - "notes": { - "@": { - "type": "status" - }, - "#":"John's profile is not complete." - } - }, { - declaration: { - include: false - }, - prettyPrinting: { - enabled: false - }, - useCDATA: true - }); - res.should.equal("" + - ""); - }); - }); - }); -})(); +/* jshint node:true */ + +/* globals describe, it */ + +/** + * js2xmlparser + * Copyright © 2012 Michael Kourlas and other contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated + * documentation files (the "Software"), to deal in the Software without restriction, including without limitation the + * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to + * permit persons to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or substantial portions of the + * Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE + * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS + * OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ + +(function () { + "use strict"; + + var js2xmlparser = require("../lib/js2xmlparser"); + var should = require("should"); + var util = require("util"); + + var defaultRoot = "base"; + var defaultData = { + hello: "world" + }; + var defaultOptions = { + declaration: { + include: false + }, + prettyPrinting: { + enabled: false + } + }; + + describe("js2xmlparser", function () { + describe("root", function () { + it("should raise an error when root is undefined", function () { + var res; + try { + res = js2xmlparser(undefined, defaultData, defaultOptions); + } catch (e) { + e.should.match(/root element must be a string/); + } + should.not.exist(res); + }); + + it("should raise an error when root is null", function () { + var res; + try { + res = js2xmlparser(null, defaultData, defaultOptions); + } catch (e) { + e.should.match(/root element must be a string/); + } + should.not.exist(res); + }); + + it("should raise an error when root is an object", function () { + var res; + try { + res = js2xmlparser({}, defaultData, defaultOptions); + } catch (e) { + e.should.match(/root element must be a string/); + } + should.not.exist(res); + }); + + it("should raise an error when root is an array", function () { + var res; + try { + res = js2xmlparser([], defaultData, defaultOptions); + } catch (e) { + e.should.match(/root element must be a string/); + } + should.not.exist(res); + }); + + it("should raise an error when root is a boolean", function () { + var res; + try { + res = js2xmlparser(true, defaultData, defaultOptions); + } catch (e) { + e.should.match(/root element must be a string/); + } + should.not.exist(res); + }); + + it("should raise an error when root is a number", function () { + var res; + try { + res = js2xmlparser(2, defaultData, defaultOptions); + } catch (e) { + e.should.match(/root element must be a string/); + } + should.not.exist(res); + }); + + it("should raise an error when root is an empty string", function () { + var res; + try { + res = js2xmlparser("", defaultData, defaultOptions); + } catch (e) { + e.should.match(/root element cannot be empty/); + } + should.not.exist(res); + }); + + it("should create XML with 'base' as the root element when root is 'base'", function () { + var res = js2xmlparser(defaultRoot, defaultData, defaultOptions); + res.should.startWith(""); + }); + }); + + describe("options", function () { + describe("declaration", function () { + describe("include", function () { + it("should raise an error when options.declaration is defined and options.declaration.include is undefined", function () { + var res; + try { + res = js2xmlparser(defaultRoot, defaultData, { + declaration: { + include: undefined + } + }); + } catch (e) { + e.should.match(/declaration.include option must be a boolean/); + } + should.not.exist(res); + }); + + it("should raise an error when options.declaration is defined and options.declaration.include is null", function () { + var res; + try { + res = js2xmlparser(defaultRoot, defaultData, { + declaration: { + include: null + } + }); + } catch (e) { + e.should.match(/declaration.include option must be a boolean/); + } + should.not.exist(res); + }); + + it("should raise an error when options.declaration is defined and options.declaration.include is an object", function () { + var res; + try { + res = js2xmlparser(defaultRoot, defaultData, { + declaration: { + include: {} + } + }); + } catch (e) { + e.should.match(/declaration.include option must be a boolean/); + } + should.not.exist(res); + }); + + it("should raise an error when options.declaration is defined and options.declaration.include is an array", function () { + var res; + try { + res = js2xmlparser(defaultRoot, defaultData, { + declaration: { + include: [] + } + }); + } catch (e) { + e.should.match(/declaration.include option must be a boolean/); + } + should.not.exist(res); + }); + + it("should raise an error when options.declaration is defined and options.declaration.include is a number", function () { + var res; + try { + res = js2xmlparser(defaultRoot, defaultData, { + declaration: { + include: 2 + } + }); + } catch (e) { + e.should.match(/declaration.include option must be a boolean/); + } + should.not.exist(res); + }); + + it("should raise an error when options.declaration is defined and options.declaration.include is a string", function () { + var res; + try { + res = js2xmlparser(defaultRoot, defaultData, { + declaration: { + include: "string" + } + }); + } catch (e) { + e.should.match(/declaration.include option must be a boolean/); + } + should.not.exist(res); + }); + + it("should create XML with declaration when options.declaration.include is not specified", function () { + var res = js2xmlparser(defaultRoot, defaultData, {}); + res.should.startWith(""); + }); + + it("should create XML with declaration when options.declaration.include is true", function () { + var res = js2xmlparser(defaultRoot, defaultData, { + declaration: { + include: true + } + }); + res.should.startWith(""); + }); + + it("should create XML without declaration when options.declaration.include is false", function () { + var res = js2xmlparser(defaultRoot, defaultData, { + declaration: { + include: false + } + }); + res.should.startWith(""); + }); + }); + + describe("encoding", function () { + it("should raise an error when options.declaration is defined and options.declaration.encoding is undefined", function () { + var res; + try { + res = js2xmlparser(defaultRoot, defaultData, { + declaration: { + encoding: undefined + } + }); + } catch (e) { + e.should.match(/declaration.encoding option must be a string or null/); + } + should.not.exist(res); + }); + + it("should raise an error when options.declaration is defined and options.declaration.encoding is an object", function () { + var res; + try { + res = js2xmlparser(defaultRoot, defaultData, { + declaration: { + encoding: {} + } + }); + } catch (e) { + e.should.match(/declaration.encoding option must be a string or null/); + } + should.not.exist(res); + }); + + it("should raise an error when options.declaration is defined and options.declaration.encoding is an array", function () { + var res; + try { + res = js2xmlparser(defaultRoot, defaultData, { + declaration: { + encoding: [] + } + }); + } catch (e) { + e.should.match(/declaration.encoding option must be a string or null/); + } + should.not.exist(res); + }); + + it("should raise an error when options.declaration is defined and options.declaration.encoding is a number", function () { + var res; + try { + res = js2xmlparser(defaultRoot, defaultData, { + declaration: { + encoding: 2 + } + }); + } catch (e) { + e.should.match(/declaration.encoding option must be a string or null/); + } + should.not.exist(res); + }); + + it("should raise an error when options.declaration is defined and options.declaration.encoding is a boolean", function () { + var res; + try { + res = js2xmlparser(defaultRoot, defaultData, { + declaration: { + encoding: true + } + }); + } catch (e) { + e.should.match(/declaration.encoding option must be a string or null/); + } + should.not.exist(res); + }); + + it("should create XML declaration with encoding 'UTF-8' when options.declaration.encoding is not specified", function () { + var res = js2xmlparser(defaultRoot, defaultData, {}); + res.should.startWith(""); + }); + + it("should create XML declaration with encoding 'UTF-16' when options.declaration.encoding is 'UTF-16'", function () { + var res = js2xmlparser(defaultRoot, defaultData, { + declaration: { + encoding: "UTF-16" + } + }); + res.should.startWith(""); + }); + + it("should create XML declaration without encoding attribute when options.declaration.encoding is null", function () { + var res = js2xmlparser(defaultRoot, defaultData, { + declaration: { + encoding: null + } + }); + res.should.startWith(""); + }); + }); + }); + + describe("attributeString", function () { + it("should raise an error when options is defined and options.attributeString is undefined", function () { + var res; + try { + res = js2xmlparser(defaultRoot, defaultData, { + attributeString: undefined + }); + } catch (e) { + e.should.match(/attributeString option must be a string/); + } + should.not.exist(res); + }); + + it("should raise an error when options is defined and options.attributeString is an object", function () { + var res; + try { + res = js2xmlparser(defaultRoot, defaultData, { + attributeString: {} + }); + } catch (e) { + e.should.match(/attributeString option must be a string/); + } + should.not.exist(res); + }); + + it("should raise an error when options is defined and options.attributeString is an array", function () { + var res; + try { + res = js2xmlparser(defaultRoot, defaultData, { + attributeString: [] + }); + } catch (e) { + e.should.match(/attributeString option must be a string/); + } + should.not.exist(res); + }); + + it("should raise an error when options is defined and options.attributeString is a number", function () { + var res; + try { + res = js2xmlparser(defaultRoot, defaultData, { + attributeString: 2 + }); + } catch (e) { + e.should.match(/attributeString option must be a string/); + } + should.not.exist(res); + }); + + it("should raise an error when options is defined and options.attributeString is a boolean", function () { + var res; + try { + res = js2xmlparser(defaultRoot, defaultData, { + attributeString: true + }); + } catch (e) { + e.should.match(/attributeString option must be a string/); + } + should.not.exist(res); + }); + + it("should create XML with attribute string '@' when options.attributeString is not specified", function () { + var res = js2xmlparser(defaultRoot, { + a: { + "@": { + b: "c" + } + } + }, defaultOptions); + res.should.equal(""); + }); + + it("should create XML with attribute string '__attr' when options.attributeString is '__attr'", function () { + var res = js2xmlparser(defaultRoot, { + a: { + "__attr": { + b: "c" + } + } + }, { + declaration: { + include: false + }, + prettyPrinting: { + enabled: false + }, + attributeString: "__attr" + }); + res.should.equal(""); + }); + }); + + describe("valueString", function () { + it("should raise an error when options is defined and options.valueString is undefined", function () { + var res; + try { + res = js2xmlparser(defaultRoot, defaultData, { + valueString: undefined + }); + } catch (e) { + e.should.match(/valueString option must be a string/); + } + should.not.exist(res); + }); + + it("should raise an error when options is defined and options.valueString is an object", function () { + var res; + try { + res = js2xmlparser(defaultRoot, defaultData, { + valueString: {} + }); + } catch (e) { + e.should.match(/valueString option must be a string/); + } + should.not.exist(res); + }); + + it("should raise an error when options is defined and options.valueString is an array", function () { + var res; + try { + res = js2xmlparser(defaultRoot, defaultData, { + valueString: [] + }); + } catch (e) { + e.should.match(/valueString option must be a string/); + } + should.not.exist(res); + }); + + it("should raise an error when options is defined and options.valueString is a number", function () { + var res; + try { + res = js2xmlparser(defaultRoot, defaultData, { + valueString: 2 + }); + } catch (e) { + e.should.match(/valueString option must be a string/); + } + should.not.exist(res); + }); + + it("should raise an error when options is defined and options.valueString is a boolean", function () { + var res; + try { + res = js2xmlparser(defaultRoot, defaultData, { + valueString: true + }); + } catch (e) { + e.should.match(/valueString option must be a string/); + } + should.not.exist(res); + }); + + it("should create XML with value string '@' when options.valueString is not specified", function () { + var res = js2xmlparser(defaultRoot, { + a: { + "@": { + b: "c" + }, + "#": "d" + } + }, defaultOptions); + res.should.equal("d"); + }); + + it("should create XML with value string '__val' when options.valueString is '__val'", function () { + var res = js2xmlparser(defaultRoot, { + a: { + "@": { + b: "c" + }, + "__val": "d" + } + }, { + declaration: { + include: false + }, + prettyPrinting: { + enabled: false + }, + valueString: "__val" + }); + res.should.equal("d"); + }); + }); + + describe("prettyPrinting", function () { + describe("enabled", function () { + it("should raise an error when options.prettyPrinting is defined and options.prettyPrinting.enabled is undefined", function () { + var res; + try { + res = js2xmlparser(defaultRoot, defaultData, { + prettyPrinting: { + enabled: undefined + } + }); + } catch (e) { + e.should.match(/prettyPrinting.enabled option must be a boolean/); + } + should.not.exist(res); + }); + + it("should raise an error when options.prettyPrinting is defined and options.prettyPrinting.enabled is null", function () { + var res; + try { + res = js2xmlparser(defaultRoot, defaultData, { + prettyPrinting: { + enabled: null + } + }); + } catch (e) { + e.should.match(/prettyPrinting.enabled option must be a boolean/); + } + should.not.exist(res); + }); + + it("should raise an error when options.prettyPrinting is defined and options.prettyPrinting.enabled is an object", function () { + var res; + try { + res = js2xmlparser(defaultRoot, defaultData, { + prettyPrinting: { + enabled: {} + } + }); + } catch (e) { + e.should.match(/prettyPrinting.enabled option must be a boolean/); + } + should.not.exist(res); + }); + + it("should raise an error when options.prettyPrinting is defined and options.prettyPrinting.enabled is an array", function () { + var res; + try { + res = js2xmlparser(defaultRoot, defaultData, { + prettyPrinting: { + enabled: [] + } + }); + } catch (e) { + e.should.match(/prettyPrinting.enabled option must be a boolean/); + } + should.not.exist(res); + }); + + it("should raise an error when options.prettyPrinting is defined and options.prettyPrinting.enabled is a number", function () { + var res; + try { + res = js2xmlparser(defaultRoot, defaultData, { + prettyPrinting: { + enabled: 2 + } + }); + } catch (e) { + e.should.match(/prettyPrinting.enabled option must be a boolean/); + } + should.not.exist(res); + }); + + it("should raise an error when options.prettyPrinting is defined and options.prettyPrinting.enabled is a string", function () { + var res; + try { + res = js2xmlparser(defaultRoot, defaultData, { + prettyPrinting: { + enabled: "string" + } + }); + } catch (e) { + e.should.match(/prettyPrinting.enabled option must be a boolean/); + } + should.not.exist(res); + }); + + it("should create XML with pretty printing when options.prettyPrinting.enabled is not specified", function () { + var res = js2xmlparser(defaultRoot, defaultData, { + declaration: { + include: false + } + }); + res.should.equal("\n\tworld\n"); + }); + + it("should create XML with pretty printing when options.prettyPrinting.enabled is true", function () { + var res = js2xmlparser(defaultRoot, defaultData, { + prettyPrinting: { + enabled: true + }, + declaration: { + include: false + } + }); + res.should.equal("\n\tworld\n"); + }); + + it("should create XML without pretty printing when options.prettyPrinting.enabled is false", function () { + var res = js2xmlparser(defaultRoot, defaultData, { + prettyPrinting: { + enabled: false + }, + declaration: { + include: false + } + }); + res.should.equal("world"); + }); + }); + + describe("indentString", function () { + it("should raise an error when options.prettyPrinting is defined and options.prettyPrinting.indentString is undefined", function () { + var res; + try { + res = js2xmlparser(defaultRoot, defaultData, { + prettyPrinting: { + indentString: undefined + } + }); + } catch (e) { + e.should.match(/prettyPrinting.indentString option must be a string/); + } + should.not.exist(res); + }); + + it("should raise an error when options.prettyPrinting is defined and options.prettyPrinting.indentString is an object", function () { + var res; + try { + res = js2xmlparser(defaultRoot, defaultData, { + prettyPrinting: { + indentString: {} + } + }); + } catch (e) { + e.should.match(/prettyPrinting.indentString option must be a string/); + } + should.not.exist(res); + }); + + it("should raise an error when options.prettyPrinting is defined and options.prettyPrinting.indentString is an array", function () { + var res; + try { + res = js2xmlparser(defaultRoot, defaultData, { + prettyPrinting: { + indentString: [] + } + }); + } catch (e) { + e.should.match(/prettyPrinting.indentString option must be a string/); + } + should.not.exist(res); + }); + + it("should raise an error when options.prettyPrinting is defined and options.prettyPrinting.indentString is a number", function () { + var res; + try { + res = js2xmlparser(defaultRoot, defaultData, { + prettyPrinting: { + indentString: 2 + } + }); + } catch (e) { + e.should.match(/prettyPrinting.indentString option must be a string/); + } + should.not.exist(res); + }); + + it("should raise an error when options.prettyPrinting is defined and options.prettyPrinting.indentString is a boolean", function () { + var res; + try { + res = js2xmlparser(defaultRoot, defaultData, { + prettyPrinting: { + indentString: true + } + }); + } catch (e) { + e.should.match(/prettyPrinting.indentString option must be a string/); + } + should.not.exist(res); + }); + + it("should pretty print with indent string '\t' when options.prettyPrinting.indentString is not specified", function () { + var res = js2xmlparser(defaultRoot, defaultData, { + declaration: { + include: false + } + }); + res.should.equal("\n\tworld\n"); + }); + + it("should pretty print with indent string ' ' when options.valueString is ' '", function () { + var res = js2xmlparser(defaultRoot, defaultData, { + declaration: { + include: false + }, + prettyPrinting: { + indentString: ' ' + } + }); + res.should.equal("\n world\n"); + }); + }); + }); + + describe("convertMap", function () { + it("should raise an error when options is defined and options.convertMap is undefined", function () { + var res; + try { + res = js2xmlparser(defaultRoot, defaultData, { + declaration: { + include: false + }, + prettyPrinting: { + enabled: false + }, + convertMap: undefined + }); + } catch (e) { + e.should.match(/convertMap option must be an object/); + } + should.not.exist(res); + }); + + it("should raise an error when options is defined and options.convertMap is null", function () { + var res; + try { + res = js2xmlparser(defaultRoot, defaultData, { + declaration: { + include: false + }, + prettyPrinting: { + enabled: false + }, + convertMap: null + }); + } catch (e) { + e.should.match(/convertMap option must be an object/); + } + should.not.exist(res); + }); + + it("should raise an error when options is defined and options.convertMap is an array", function () { + var res; + try { + res = js2xmlparser(defaultRoot, defaultData, { + declaration: { + include: false + }, + prettyPrinting: { + enabled: false + }, + convertMap: [] + }); + } catch (e) { + e.should.match(/convertMap option must be an object/); + } + should.not.exist(res); + }); + + it("should raise an error when options is defined and options.convertMap is a boolean", function () { + var res; + try { + res = js2xmlparser(defaultRoot, defaultData, { + declaration: { + include: false + }, + prettyPrinting: { + enabled: false + }, + convertMap: true + }); + } catch (e) { + e.should.match(/convertMap option must be an object/); + } + should.not.exist(res); + }); + + it("should raise an error when options is defined and options.convertMap is a number", function () { + var res; + try { + res = js2xmlparser(defaultRoot, defaultData, { + declaration: { + include: false + }, + prettyPrinting: { + enabled: false + }, + convertMap: 2 + }); + } catch (e) { + e.should.match(/convertMap option must be an object/); + } + should.not.exist(res); + }); + + it("should raise an error when options is defined and options.convertMap is a string", function () { + var res; + try { + res = js2xmlparser(defaultRoot, defaultData, { + declaration: { + include: false + }, + prettyPrinting: { + enabled: false + }, + convertMap: "test" + }); + } catch (e) { + e.should.match(/convertMap option must be an object/); + } + should.not.exist(res); + }); + + it("should correctly parse XML using convert maps", function () { + var res = js2xmlparser(defaultRoot, { + "a": "b", + "c": 1 + }, { + declaration: { + include: false + }, + prettyPrinting: { + enabled: false + }, + convertMap: { + "[object Number]": function (num) { + return num + 1; + }, + "[object String]": function (str) { + return str + "a"; + } + } + }); + res.should.equal("ba2"); + }); + }); + + describe("useCDATA", function () { + it("should raise an error when options is defined and options.useCDATA is undefined", function () { + var res; + try { + res = js2xmlparser(defaultRoot, defaultData, { + useCDATA: undefined + }); + } catch (e) { + e.should.match(/useCDATA option must be a boolean/); + } + should.not.exist(res); + }); + + it("should raise an error when options is defined and options.useCDATA is null", function () { + var res; + try { + res = js2xmlparser(defaultRoot, defaultData, { + useCDATA: null + }); + } catch (e) { + e.should.match(/useCDATA option must be a boolean/); + } + should.not.exist(res); + }); + + it("should raise an error when options is defined and options.useCDATA is an object", function () { + var res; + try { + res = js2xmlparser(defaultRoot, defaultData, { + useCDATA: {} + }); + } catch (e) { + e.should.match(/useCDATA option must be a boolean/); + } + should.not.exist(res); + }); + + it("should raise an error when options is defined and options.useCDATA is an array", function () { + var res; + try { + res = js2xmlparser(defaultRoot, defaultData, { + useCDATA: [] + }); + } catch (e) { + e.should.match(/useCDATA option must be a boolean/); + } + should.not.exist(res); + }); + + it("should raise an error when options is defined and options.useCDATA is a number", function () { + var res; + try { + res = js2xmlparser(defaultRoot, defaultData, { + useCDATA: 2 + }); + } catch (e) { + e.should.match(/useCDATA option must be a boolean/); + } + should.not.exist(res); + }); + + it("should raise an error when options is defined and options.useCDATA is a string", function () { + var res; + try { + res = js2xmlparser(defaultRoot, defaultData, { + useCDATA: "string" + }); + } catch (e) { + e.should.match(/useCDATA option must be a boolean/); + } + should.not.exist(res); + }); + + it("should create XML without CDATA strings when options.CDATA is not specified", function () { + var res = js2xmlparser(defaultRoot, { + "a": "b'c" + }, defaultOptions); + res.should.equal("b'c"); + }); + + it("should create XML without CDATA strings when options.CDATA is false", function () { + var res = js2xmlparser(defaultRoot, { + "a": "b'c" + }, { + useCDATA: false, + declaration: { + include: false + }, + prettyPrinting: { + enabled: false + } + }); + res.should.equal("b'c"); + }); + + it("should create XML without CDATA strings when options.CDATA is true", function () { + var res = js2xmlparser(defaultRoot, { + "a": "b'c" + }, { + useCDATA: true, + declaration: { + include: false + }, + prettyPrinting: { + enabled: false + } + }); + res.should.equal(""); + }); + }); + + describe("aliasString", function () { + + it("should raise an error when options is defined and options.aliasString is undefined", function () { + var res; + try { + res = js2xmlparser(defaultRoot, defaultData, { + aliasString: undefined + }); + } catch (e) { + e.should.match(/aliasString option must be a string/); + } + should.not.exist(res); + }); + + it("should raise an error when options is defined and options.aliasString is an object", function () { + var res; + try { + res = js2xmlparser(defaultRoot, defaultData, { + aliasString: {} + }); + } catch (e) { + e.should.match(/aliasString option must be a string/); + } + should.not.exist(res); + }); + + it("should raise an error when options is defined and options.aliasString is an array", function () { + var res; + try { + res = js2xmlparser(defaultRoot, defaultData, { + aliasString: [] + }); + } catch (e) { + e.should.match(/aliasString option must be a string/); + } + should.not.exist(res); + }); + + it("should raise an error when options is defined and options.aliasString is a number", function () { + var res; + try { + res = js2xmlparser(defaultRoot, defaultData, { + aliasString: 2 + }); + } catch (e) { + e.should.match(/aliasString option must be a string/); + } + should.not.exist(res); + }); + + it("should raise an error when options is defined and options.aliasString is a boolean", function () { + var res; + try { + res = js2xmlparser(defaultRoot, defaultData, { + aliasString: true + }); + } catch (e) { + e.should.match(/aliasString option must be a string/); + } + should.not.exist(res); + }); + + it("should create XML with alias string '=' when options.aliasString is not specified", function () { + var res = js2xmlparser(defaultRoot, { + a: { + "=": "b" + } + }, defaultOptions); + res.should.equal(""); + }); + + it("should create XML with alias string '__alias' when options.aliasString is '__alias'", function () { + var res = js2xmlparser(defaultRoot, { + a: { + "__alias": "b" + } + }, { + declaration: { + include: false + }, + prettyPrinting: { + enabled: false + }, + aliasString: "__alias" + }); + res.should.equal(""); + }); + + it("should create XML with options.aliasString and data is an array", function () { + var res = js2xmlparser(defaultRoot, { + a: [{ + "=": "b" + }, { + "=": "c" + }] + }, defaultOptions); + res.should.equal(""); + }); + + }); + }); + + describe("data", function () { + it("should raise an error when data is undefined", function () { + var res; + try { + res = js2xmlparser(defaultRoot, undefined, defaultOptions); + } catch (e) { + e.should.match(/data must be an object (excluding arrays) or a JSON string/); + } + should.not.exist(res); + }); + + it("should raise an error when data is null", function () { + var res; + try { + res = js2xmlparser(defaultRoot, null, defaultOptions); + } catch (e) { + e.should.match(/data must be an object (excluding arrays) or a JSON string/); + } + should.not.exist(res); + }); + + it("should raise an error when data is an array", function () { + var res; + try { + res = js2xmlparser(defaultRoot, [], defaultOptions); + } catch (e) { + e.should.match(/data must be an object (excluding arrays) or a JSON string/); + } + should.not.exist(res); + }); + + it("should raise an error when data is a non-JSON string", function () { + var res; + try { + res = js2xmlparser(defaultRoot, "test", defaultOptions); + } catch (e) { + e.should.match(/data must be an object (excluding arrays) or a JSON string/); + } + should.not.exist(res); + }); + + it("should correctly parse a number", function () { + var res = js2xmlparser(defaultRoot, 2, defaultOptions); + res.should.equal("2"); + }); + + it("should correctly parse a boolean", function () { + var res = js2xmlparser(defaultRoot, true, defaultOptions); + res.should.equal("true"); + }); + + it("should correctly parse a JSON string", function () { + var res = js2xmlparser(defaultRoot, "{\"hello\":\"world\"}", defaultOptions); + res.should.equal("world"); + }); + + it("should correctly parse an empty object", function () { + var res = js2xmlparser(defaultRoot, {}, defaultOptions); + res.should.equal(""); + }); + + it("should correctly parse a simple object", function () { + var res = js2xmlparser(defaultRoot, { + a: "b", + c: "d" + }, defaultOptions); + res.should.equal("bd"); + }); + + it("should correctly parse attributes", function () { + var res = js2xmlparser(defaultRoot, { + "@": { + a: "b", + "@": "c" + }, + d: { + "@": { + e: "f" + } + }, + g: { + "@": { + h: "i" + }, + j: "k", + l: { + "@": "m" + } + } + }, defaultOptions); + res.should.equal("k"); + }); + + it("should correctly parse value strings", function () { + var res = js2xmlparser(defaultRoot, { + "#": "1", + a: { + "#": "b" + }, + c: { + "#": "d", + e: { + f: "g" + }, + "h": { + "#": { + "i": "j", + "#": "k" + } + } + }, + l: { + "@": { + m: "n" + }, + "#": "o" + } + }, { + declaration: { + include: false + }, + prettyPrinting: { + enabled: false + } + }); + res.should.equal("bg[object Object]o"); + }); + + it("should correctly parse arrays", function () { + var res = js2xmlparser(defaultRoot, { + a: ["b", "c", "d"], + e: ["f", "g", ["h", "i"], "j"], + k: { + l: ["m", "n", "o"] + } + }, defaultOptions); + res.should.equal("bcdfghijm" + + "no"); + }); + + it("should correctly parse example 1", function () { + var res = js2xmlparser("person", { + "firstName": "John", + "lastName": "Smith" + }, defaultOptions); + res.should.equal("JohnSmith"); + }); + + it("should correctly parse example 2", function () { + var res = js2xmlparser("person", { + "@": { + "type": "individual" + }, + "firstName": "John", + "lastName": "Smith", + "dateOfBirth": new Date(1964, 7, 26), + "address": { + "@": { + "type": "home" + }, + "streetAddress": "3212 22nd St", + "city": "Chicago", + "state": "Illinois", + "zip": 10000 + }, + "phone": [ + { + "@": { + "type": "home" + }, + "#": "123-555-4567" + }, + { + "@": { + "type": "work" + }, + "#": "123-555-4567" + }, + { + "@": { + "type": "cell" + }, + "#": "456-555-7890" + } + ], + "email": function () { + return "john@smith.com"; + }, + "notes": "John's profile is not complete." + }, defaultOptions); + res.should.equal("JohnSmith" + + "" + new Date(1964, 7, 26) + "
      3212 22nd StChicagoIllinois" + + "10000
      123-555-4567123-555-4567456-555-7890" + + "john@smith.comJohn's profile is not complete.
      "); + }); + + it("should correctly parse example 2 with pretty printing", function () { + var res = js2xmlparser("person", { + "@": { + "type": "individual" + }, + "firstName": "John", + "lastName": "Smith", + "dateOfBirth": new Date(1964, 7, 26), + "address": { + "@": { + "type": "home" + }, + "streetAddress": "3212 22nd St", + "city": "Chicago", + "state": "Illinois", + "zip": 10000 + }, + "phone": [ + { + "@": { + "type": "home" + }, + "#": "123-555-4567" + }, + { + "@": { + "type": "work" + }, + "#": "123-555-4567" + }, + { + "@": { + "type": "cell" + }, + "#": "456-555-7890" + } + ], + "email": function () { + return "john@smith.com"; + }, + "notes": "John's profile is not complete." + }, { + declaration: { + include: false + } + }); + res.should.equal("\n\tJohn\n\tSmith" + + "\n\t" + new Date(1964, 7, 26) + + "\n\t
      \n\t\t3212 22nd St" + + "\n\t\tChicago\n\t\tIllinois\n\t\t10000\n\t
      " + + "\n\t123-555-4567\n\t123-555-4567" + + "\n\t456-555-7890\n\tjohn@smith.com\n\t" + + "John's profile is not complete.\n
      "); + }); + + it("should correctly parse example 3", function () { + var res = js2xmlparser("person", { + "phone": [ + { + "@": { + "type": "home" + }, + "#": "123-555-4567" + }, + { + "@": { + "type": "work" + }, + "#": "123-555-4567", + "=": "telephone" + }, + { + "@": { + "type": "cell" + }, + "#": "456-555-7890" + } + ] + }, { + declaration: { + include: false + }, + prettyPrinting: { + enabled: false + } + }); + res.should.equal("123-555-4567" + + "123-555-4567456-555-7890"); + }); + + it("should correctly parse example 4", function () { + var res = js2xmlparser("person", { + "email": function () {return "john@smith.com";}, + "dateOfBirth": new Date(Date.UTC(1964, 7, 26)) + }, { + declaration: { + include: false + }, + prettyPrinting: { + enabled: false + }, + convertMap: { + "[object Date]": function (date) { + return date.toISOString(); + }, + "[object Function]": function (func) { + return func.toString(); + } + } + }); + res.should.equal("function () {return "john@smith.com";}" + + "1964-08-26T00:00:00.000Z"); + }); + + it("should correctly parse example 5", function () { + var res = js2xmlparser("person", { + "notes": { + "@": { + "type": "status" + }, + "#": "John's profile is not complete." + } + }, { + declaration: { + include: false + }, + prettyPrinting: { + enabled: false + }, + useCDATA: true + }); + res.should.equal("" + + ""); + }); + }); + }); +})(); diff --git a/node_modules/jsdoc/node_modules/marked/Makefile b/node_modules/jsdoc/node_modules/marked/Makefile index 20ac2d4..d9349f0 100644 --- a/node_modules/jsdoc/node_modules/marked/Makefile +++ b/node_modules/jsdoc/node_modules/marked/Makefile @@ -1,6 +1,6 @@ all: @cp lib/marked.js marked.js - @uglifyjs -o marked.min.js marked.js + @uglifyjs --comments '/\*[^\0]+?Copyright[^\0]+?\*/' -o marked.min.js lib/marked.js clean: @rm marked.js diff --git a/node_modules/jsdoc/node_modules/marked/README.md b/node_modules/jsdoc/node_modules/marked/README.md index 441c1eb..b9817cd 100644 --- a/node_modules/jsdoc/node_modules/marked/README.md +++ b/node_modules/jsdoc/node_modules/marked/README.md @@ -39,6 +39,26 @@ marked.setOptions({ console.log(marked('I am using __markdown__.')); ``` +### Browser + +```html + + + + + Marked in the browser + + + +
      + + + +``` + ## marked(markdownString [,options] [,callback]) ### markdownString diff --git a/node_modules/jsdoc/node_modules/marked/bower.json b/node_modules/jsdoc/node_modules/marked/bower.json new file mode 100644 index 0000000..3eab311 --- /dev/null +++ b/node_modules/jsdoc/node_modules/marked/bower.json @@ -0,0 +1,24 @@ +{ + "name": "marked", + "version": "0.3.2", + "homepage": "https://github.com/chjj/marked", + "authors": [ + "Christopher Jeffrey " + ], + "description": "A markdown parser built for speed", + "keywords": [ + "markdown", + "markup", + "html" + ], + "main": "lib/marked.js", + "license": "MIT", + "ignore": [ + "**/.*", + "node_modules", + "bower_components", + "app/bower_components", + "test", + "tests" + ] +} diff --git a/node_modules/jsdoc/node_modules/marked/lib/marked.js b/node_modules/jsdoc/node_modules/marked/lib/marked.js index e2f08c9..0b7180f 100644 --- a/node_modules/jsdoc/node_modules/marked/lib/marked.js +++ b/node_modules/jsdoc/node_modules/marked/lib/marked.js @@ -20,7 +20,7 @@ var block = { lheading: /^([^\n]+)\n *(=|-){2,} *(?:\n+|$)/, blockquote: /^( *>[^\n]+(\n(?!def)[^\n]+)*\n*)+/, list: /^( *)(bull) [\s\S]+?(?:hr|def|\n{2,}(?! )(?!\1bull )\n*|\s*$)/, - html: /^ *(?:comment|closed|closing) *(?:\n{2,}|\s*$)/, + html: /^ *(?:comment *(?:\n|\s*$)|closed *(?:\n{2,}|\s*$)|closing *(?:\n{2,}|\s*$))/, def: /^ *\[([^\]]+)\]: *]+)>?(?: +["(]([^\n]+)[")])? *(?:\n+|$)/, table: noop, paragraph: /^((?:[^\n]+\n?(?!hr|heading|lheading|blockquote|tag|def))+)\n*/, @@ -868,7 +868,7 @@ Renderer.prototype.link = function(href, title, text) { } catch (e) { return ''; } - if (prot.indexOf('javascript:') === 0) { + if (prot.indexOf('javascript:') === 0 || prot.indexOf('vbscript:') === 0) { return ''; } } @@ -1154,8 +1154,13 @@ function marked(src, opt, callback) { pending = tokens.length; - var done = function() { - var out, err; + var done = function(err) { + if (err) { + opt.highlight = highlight; + return callback(err); + } + + var out; try { out = Parser.parse(tokens, opt); @@ -1184,6 +1189,7 @@ function marked(src, opt, callback) { return --pending || done(); } return highlight(token.text, token.lang, function(err, code) { + if (err) return done(err); if (code == null || code === token.text) { return --pending || done(); } @@ -1253,7 +1259,7 @@ marked.inlineLexer = InlineLexer.output; marked.parse = marked; -if (typeof exports === 'object') { +if (typeof module !== 'undefined' && typeof exports === 'object') { module.exports = marked; } else if (typeof define === 'function' && define.amd) { define(function() { return marked; }); diff --git a/node_modules/jsdoc/node_modules/marked/marked.min.js b/node_modules/jsdoc/node_modules/marked/marked.min.js new file mode 100644 index 0000000..a5164c4 --- /dev/null +++ b/node_modules/jsdoc/node_modules/marked/marked.min.js @@ -0,0 +1,6 @@ +/** + * marked - a markdown parser + * Copyright (c) 2011-2014, Christopher Jeffrey. (MIT Licensed) + * https://github.com/chjj/marked + */ +(function(){var block={newline:/^\n+/,code:/^( {4}[^\n]+\n*)+/,fences:noop,hr:/^( *[-*_]){3,} *(?:\n+|$)/,heading:/^ *(#{1,6}) *([^\n]+?) *#* *(?:\n+|$)/,nptable:noop,lheading:/^([^\n]+)\n *(=|-){2,} *(?:\n+|$)/,blockquote:/^( *>[^\n]+(\n(?!def)[^\n]+)*\n*)+/,list:/^( *)(bull) [\s\S]+?(?:hr|def|\n{2,}(?! )(?!\1bull )\n*|\s*$)/,html:/^ *(?:comment|closed|closing) *(?:\n{2,}|\s*$)/,def:/^ *\[([^\]]+)\]: *]+)>?(?: +["(]([^\n]+)[")])? *(?:\n+|$)/,table:noop,paragraph:/^((?:[^\n]+\n?(?!hr|heading|lheading|blockquote|tag|def))+)\n*/,text:/^[^\n]+/};block.bullet=/(?:[*+-]|\d+\.)/;block.item=/^( *)(bull) [^\n]*(?:\n(?!\1bull )[^\n]*)*/;block.item=replace(block.item,"gm")(/bull/g,block.bullet)();block.list=replace(block.list)(/bull/g,block.bullet)("hr","\\n+(?=\\1?(?:[-*_] *){3,}(?:\\n+|$))")("def","\\n+(?="+block.def.source+")")();block.blockquote=replace(block.blockquote)("def",block.def)();block._tag="(?!(?:"+"a|em|strong|small|s|cite|q|dfn|abbr|data|time|code"+"|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo"+"|span|br|wbr|ins|del|img)\\b)\\w+(?!:/|[^\\w\\s@]*@)\\b";block.html=replace(block.html)("comment",//)("closed",/<(tag)[\s\S]+?<\/\1>/)("closing",/])*?>/)(/tag/g,block._tag)();block.paragraph=replace(block.paragraph)("hr",block.hr)("heading",block.heading)("lheading",block.lheading)("blockquote",block.blockquote)("tag","<"+block._tag)("def",block.def)();block.normal=merge({},block);block.gfm=merge({},block.normal,{fences:/^ *(`{3,}|~{3,}) *(\S+)? *\n([\s\S]+?)\s*\1 *(?:\n+|$)/,paragraph:/^/});block.gfm.paragraph=replace(block.paragraph)("(?!","(?!"+block.gfm.fences.source.replace("\\1","\\2")+"|"+block.list.source.replace("\\1","\\3")+"|")();block.tables=merge({},block.gfm,{nptable:/^ *(\S.*\|.*)\n *([-:]+ *\|[-| :]*)\n((?:.*\|.*(?:\n|$))*)\n*/,table:/^ *\|(.+)\n *\|( *[-:]+[-| :]*)\n((?: *\|.*(?:\n|$))*)\n*/});function Lexer(options){this.tokens=[];this.tokens.links={};this.options=options||marked.defaults;this.rules=block.normal;if(this.options.gfm){if(this.options.tables){this.rules=block.tables}else{this.rules=block.gfm}}}Lexer.rules=block;Lexer.lex=function(src,options){var lexer=new Lexer(options);return lexer.lex(src)};Lexer.prototype.lex=function(src){src=src.replace(/\r\n|\r/g,"\n").replace(/\t/g," ").replace(/\u00a0/g," ").replace(/\u2424/g,"\n");return this.token(src,true)};Lexer.prototype.token=function(src,top,bq){var src=src.replace(/^ +$/gm,""),next,loose,cap,bull,b,item,space,i,l;while(src){if(cap=this.rules.newline.exec(src)){src=src.substring(cap[0].length);if(cap[0].length>1){this.tokens.push({type:"space"})}}if(cap=this.rules.code.exec(src)){src=src.substring(cap[0].length);cap=cap[0].replace(/^ {4}/gm,"");this.tokens.push({type:"code",text:!this.options.pedantic?cap.replace(/\n+$/,""):cap});continue}if(cap=this.rules.fences.exec(src)){src=src.substring(cap[0].length);this.tokens.push({type:"code",lang:cap[2],text:cap[3]});continue}if(cap=this.rules.heading.exec(src)){src=src.substring(cap[0].length);this.tokens.push({type:"heading",depth:cap[1].length,text:cap[2]});continue}if(top&&(cap=this.rules.nptable.exec(src))){src=src.substring(cap[0].length);item={type:"table",header:cap[1].replace(/^ *| *\| *$/g,"").split(/ *\| */),align:cap[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:cap[3].replace(/\n$/,"").split("\n")};for(i=0;i ?/gm,"");this.token(cap,top,true);this.tokens.push({type:"blockquote_end"});continue}if(cap=this.rules.list.exec(src)){src=src.substring(cap[0].length);bull=cap[2];this.tokens.push({type:"list_start",ordered:bull.length>1});cap=cap[0].match(this.rules.item);next=false;l=cap.length;i=0;for(;i1&&b.length>1)){src=cap.slice(i+1).join("\n")+src;i=l-1}}loose=next||/\n\n(?!\s*$)/.test(item);if(i!==l-1){next=item.charAt(item.length-1)==="\n";if(!loose)loose=next}this.tokens.push({type:loose?"loose_item_start":"list_item_start"});this.token(item,false,bq);this.tokens.push({type:"list_item_end"})}this.tokens.push({type:"list_end"});continue}if(cap=this.rules.html.exec(src)){src=src.substring(cap[0].length);this.tokens.push({type:this.options.sanitize?"paragraph":"html",pre:cap[1]==="pre"||cap[1]==="script"||cap[1]==="style",text:cap[0]});continue}if(!bq&&top&&(cap=this.rules.def.exec(src))){src=src.substring(cap[0].length);this.tokens.links[cap[1].toLowerCase()]={href:cap[2],title:cap[3]};continue}if(top&&(cap=this.rules.table.exec(src))){src=src.substring(cap[0].length);item={type:"table",header:cap[1].replace(/^ *| *\| *$/g,"").split(/ *\| */),align:cap[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:cap[3].replace(/(?: *\| *)?\n$/,"").split("\n")};for(i=0;i])/,autolink:/^<([^ >]+(@|:\/)[^ >]+)>/,url:noop,tag:/^|^<\/?\w+(?:"[^"]*"|'[^']*'|[^'">])*?>/,link:/^!?\[(inside)\]\(href\)/,reflink:/^!?\[(inside)\]\s*\[([^\]]*)\]/,nolink:/^!?\[((?:\[[^\]]*\]|[^\[\]])*)\]/,strong:/^__([\s\S]+?)__(?!_)|^\*\*([\s\S]+?)\*\*(?!\*)/,em:/^\b_((?:__|[\s\S])+?)_\b|^\*((?:\*\*|[\s\S])+?)\*(?!\*)/,code:/^(`+)\s*([\s\S]*?[^`])\s*\1(?!`)/,br:/^ {2,}\n(?!\s*$)/,del:noop,text:/^[\s\S]+?(?=[\\?(?:\s+['"]([\s\S]*?)['"])?\s*/;inline.link=replace(inline.link)("inside",inline._inside)("href",inline._href)();inline.reflink=replace(inline.reflink)("inside",inline._inside)();inline.normal=merge({},inline);inline.pedantic=merge({},inline.normal,{strong:/^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,em:/^_(?=\S)([\s\S]*?\S)_(?!_)|^\*(?=\S)([\s\S]*?\S)\*(?!\*)/});inline.gfm=merge({},inline.normal,{escape:replace(inline.escape)("])","~|])")(),url:/^(https?:\/\/[^\s<]+[^<.,:;"')\]\s])/,del:/^~~(?=\S)([\s\S]*?\S)~~/,text:replace(inline.text)("]|","~]|")("|","|https?://|")()});inline.breaks=merge({},inline.gfm,{br:replace(inline.br)("{2,}","*")(),text:replace(inline.gfm.text)("{2,}","*")()});function InlineLexer(links,options){this.options=options||marked.defaults;this.links=links;this.rules=inline.normal;this.renderer=this.options.renderer||new Renderer;this.renderer.options=this.options;if(!this.links){throw new Error("Tokens array requires a `links` property.")}if(this.options.gfm){if(this.options.breaks){this.rules=inline.breaks}else{this.rules=inline.gfm}}else if(this.options.pedantic){this.rules=inline.pedantic}}InlineLexer.rules=inline;InlineLexer.output=function(src,links,options){var inline=new InlineLexer(links,options);return inline.output(src)};InlineLexer.prototype.output=function(src){var out="",link,text,href,cap;while(src){if(cap=this.rules.escape.exec(src)){src=src.substring(cap[0].length);out+=cap[1];continue}if(cap=this.rules.autolink.exec(src)){src=src.substring(cap[0].length);if(cap[2]==="@"){text=cap[1].charAt(6)===":"?this.mangle(cap[1].substring(7)):this.mangle(cap[1]);href=this.mangle("mailto:")+text}else{text=escape(cap[1]);href=text}out+=this.renderer.link(href,null,text);continue}if(!this.inLink&&(cap=this.rules.url.exec(src))){src=src.substring(cap[0].length);text=escape(cap[1]);href=text;out+=this.renderer.link(href,null,text);continue}if(cap=this.rules.tag.exec(src)){if(!this.inLink&&/^/i.test(cap[0])){this.inLink=false}src=src.substring(cap[0].length);out+=this.options.sanitize?escape(cap[0]):cap[0];continue}if(cap=this.rules.link.exec(src)){src=src.substring(cap[0].length);this.inLink=true;out+=this.outputLink(cap,{href:cap[2],title:cap[3]});this.inLink=false;continue}if((cap=this.rules.reflink.exec(src))||(cap=this.rules.nolink.exec(src))){src=src.substring(cap[0].length);link=(cap[2]||cap[1]).replace(/\s+/g," ");link=this.links[link.toLowerCase()];if(!link||!link.href){out+=cap[0].charAt(0);src=cap[0].substring(1)+src;continue}this.inLink=true;out+=this.outputLink(cap,link);this.inLink=false;continue}if(cap=this.rules.strong.exec(src)){src=src.substring(cap[0].length);out+=this.renderer.strong(this.output(cap[2]||cap[1]));continue}if(cap=this.rules.em.exec(src)){src=src.substring(cap[0].length);out+=this.renderer.em(this.output(cap[2]||cap[1]));continue}if(cap=this.rules.code.exec(src)){src=src.substring(cap[0].length);out+=this.renderer.codespan(escape(cap[2],true));continue}if(cap=this.rules.br.exec(src)){src=src.substring(cap[0].length);out+=this.renderer.br();continue}if(cap=this.rules.del.exec(src)){src=src.substring(cap[0].length);out+=this.renderer.del(this.output(cap[1]));continue}if(cap=this.rules.text.exec(src)){src=src.substring(cap[0].length);out+=escape(this.smartypants(cap[0]));continue}if(src){throw new Error("Infinite loop on byte: "+src.charCodeAt(0))}}return out};InlineLexer.prototype.outputLink=function(cap,link){var href=escape(link.href),title=link.title?escape(link.title):null;return cap[0].charAt(0)!=="!"?this.renderer.link(href,title,this.output(cap[1])):this.renderer.image(href,title,escape(cap[1]))};InlineLexer.prototype.smartypants=function(text){if(!this.options.smartypants)return text;return text.replace(/--/g,"—").replace(/(^|[-\u2014/(\[{"\s])'/g,"$1‘").replace(/'/g,"’").replace(/(^|[-\u2014/(\[{\u2018\s])"/g,"$1“").replace(/"/g,"”").replace(/\.{3}/g,"…")};InlineLexer.prototype.mangle=function(text){var out="",l=text.length,i=0,ch;for(;i.5){ch="x"+ch.toString(16)}out+="&#"+ch+";"}return out};function Renderer(options){this.options=options||{}}Renderer.prototype.code=function(code,lang,escaped){if(this.options.highlight){var out=this.options.highlight(code,lang);if(out!=null&&out!==code){escaped=true;code=out}}if(!lang){return"
      "+(escaped?code:escape(code,true))+"\n
      "}return'
      '+(escaped?code:escape(code,true))+"\n
      \n"};Renderer.prototype.blockquote=function(quote){return"
      \n"+quote+"
      \n"};Renderer.prototype.html=function(html){return html};Renderer.prototype.heading=function(text,level,raw){return"'+text+"\n"};Renderer.prototype.hr=function(){return this.options.xhtml?"
      \n":"
      \n"};Renderer.prototype.list=function(body,ordered){var type=ordered?"ol":"ul";return"<"+type+">\n"+body+"\n"};Renderer.prototype.listitem=function(text){return"
    1. "+text+"
    2. \n"};Renderer.prototype.paragraph=function(text){return"

      "+text+"

      \n"};Renderer.prototype.table=function(header,body){return"\n"+"\n"+header+"\n"+"\n"+body+"\n"+"
      \n"};Renderer.prototype.tablerow=function(content){return"\n"+content+"\n"};Renderer.prototype.tablecell=function(content,flags){var type=flags.header?"th":"td";var tag=flags.align?"<"+type+' style="text-align:'+flags.align+'">':"<"+type+">";return tag+content+"\n"};Renderer.prototype.strong=function(text){return""+text+""};Renderer.prototype.em=function(text){return""+text+""};Renderer.prototype.codespan=function(text){return""+text+""};Renderer.prototype.br=function(){return this.options.xhtml?"
      ":"
      "};Renderer.prototype.del=function(text){return""+text+""};Renderer.prototype.link=function(href,title,text){if(this.options.sanitize){try{var prot=decodeURIComponent(unescape(href)).replace(/[^\w:]/g,"").toLowerCase()}catch(e){return""}if(prot.indexOf("javascript:")===0){return""}}var out='
      ";return out};Renderer.prototype.image=function(href,title,text){var out=''+text+'":">";return out};function Parser(options){this.tokens=[];this.token=null;this.options=options||marked.defaults;this.options.renderer=this.options.renderer||new Renderer;this.renderer=this.options.renderer;this.renderer.options=this.options}Parser.parse=function(src,options,renderer){var parser=new Parser(options,renderer);return parser.parse(src)};Parser.prototype.parse=function(src){this.inline=new InlineLexer(src.links,this.options,this.renderer);this.tokens=src.reverse();var out="";while(this.next()){out+=this.tok()}return out};Parser.prototype.next=function(){return this.token=this.tokens.pop()};Parser.prototype.peek=function(){return this.tokens[this.tokens.length-1]||0};Parser.prototype.parseText=function(){var body=this.token.text;while(this.peek().type==="text"){body+="\n"+this.next().text}return this.inline.output(body)};Parser.prototype.tok=function(){switch(this.token.type){case"space":{return""}case"hr":{return this.renderer.hr()}case"heading":{return this.renderer.heading(this.inline.output(this.token.text),this.token.depth,this.token.text)}case"code":{return this.renderer.code(this.token.text,this.token.lang,this.token.escaped)}case"table":{var header="",body="",i,row,cell,flags,j;cell="";for(i=0;i/g,">").replace(/"/g,""").replace(/'/g,"'")}function unescape(html){return html.replace(/&([#\w]+);/g,function(_,n){n=n.toLowerCase();if(n==="colon")return":";if(n.charAt(0)==="#"){return n.charAt(1)==="x"?String.fromCharCode(parseInt(n.substring(2),16)):String.fromCharCode(+n.substring(1))}return""})}function replace(regex,opt){regex=regex.source;opt=opt||"";return function self(name,val){if(!name)return new RegExp(regex,opt);val=val.source||val;val=val.replace(/(^|[^\[])\^/g,"$1");regex=regex.replace(name,val);return self}}function noop(){}noop.exec=noop;function merge(obj){var i=1,target,key;for(;iAn error occured:

      "+escape(e.message+"",true)+"
      "}throw e}}marked.options=marked.setOptions=function(opt){merge(marked.defaults,opt);return marked};marked.defaults={gfm:true,tables:true,breaks:false,pedantic:false,sanitize:false,smartLists:false,silent:false,highlight:null,langPrefix:"lang-",smartypants:false,headerPrefix:"",renderer:new Renderer,xhtml:false};marked.Parser=Parser;marked.parser=Parser.parse;marked.Renderer=Renderer;marked.Lexer=Lexer;marked.lexer=Lexer.lex;marked.InlineLexer=InlineLexer;marked.inlineLexer=InlineLexer.output;marked.parse=marked;if(typeof module!=="undefined"&&typeof exports==="object"){module.exports=marked}else if(typeof define==="function"&&define.amd){define(function(){return marked})}else{this.marked=marked}}).call(function(){return this||(typeof window!=="undefined"?window:global)}()); \ No newline at end of file diff --git a/node_modules/jsdoc/node_modules/marked/package.json b/node_modules/jsdoc/node_modules/marked/package.json index e1b1c58..2c8e237 100644 --- a/node_modules/jsdoc/node_modules/marked/package.json +++ b/node_modules/jsdoc/node_modules/marked/package.json @@ -4,7 +4,7 @@ "author": { "name": "Christopher Jeffrey" }, - "version": "0.3.2", + "version": "0.3.3", "main": "./lib/marked.js", "bin": { "marked": "./bin/marked" @@ -41,13 +41,12 @@ "test": "node test", "bench": "node test --bench" }, - "_id": "marked@0.3.2", - "dist": { - "shasum": "015db158864438f24a64bdd61a0428b418706d09", - "tarball": "http://registry.npmjs.org/marked/-/marked-0.3.2.tgz" - }, - "_from": "marked@~0.3.1", - "_npmVersion": "1.4.3", + "gitHead": "2b5802f258c5e23e48366f2377fbb4c807f47658", + "_id": "marked@0.3.3", + "_shasum": "08bad9cac13736f6cceddc202344f1b0bf255390", + "_from": "marked@>=0.3.2 <0.4.0", + "_npmVersion": "2.3.0", + "_nodeVersion": "0.10.35", "_npmUser": { "name": "chjj", "email": "chjjeffrey@gmail.com" @@ -58,8 +57,11 @@ "email": "chjjeffrey@gmail.com" } ], + "dist": { + "shasum": "08bad9cac13736f6cceddc202344f1b0bf255390", + "tarball": "http://registry.npmjs.org/marked/-/marked-0.3.3.tgz" + }, "directories": {}, - "_shasum": "015db158864438f24a64bdd61a0428b418706d09", - "_resolved": "https://registry.npmjs.org/marked/-/marked-0.3.2.tgz", + "_resolved": "https://registry.npmjs.org/marked/-/marked-0.3.3.tgz", "readme": "ERROR: No README data found!" } diff --git a/node_modules/jsdoc/node_modules/requizzle/README.md b/node_modules/jsdoc/node_modules/requizzle/README.md index 64795a3..dd75746 100644 --- a/node_modules/jsdoc/node_modules/requizzle/README.md +++ b/node_modules/jsdoc/node_modules/requizzle/README.md @@ -161,6 +161,8 @@ Fair enough. ## Changelog ## ++ 0.2.1 (December 2014): The `requirePaths` option no longer inserts an extra line break into the +source file. + 0.2.0 (June 2014): The `requirePaths` option can now contain `before` and `after` properties. Paths in the `before` property will be searched first; paths in the `after` property will be searched last. @@ -168,6 +170,7 @@ searched last. paths first rather than last. + 0.1.0 (June 2014): Initial release. + ## Acknowledgements ## Requizzle is very loosely adapted from Johannes Ewald's [rewire](https://github.com/jhnns/rewire) diff --git a/node_modules/jsdoc/node_modules/requizzle/lib/wrappers/requirepaths.js b/node_modules/jsdoc/node_modules/requizzle/lib/wrappers/requirepaths.js index 1f5de10..eb0ebf0 100644 --- a/node_modules/jsdoc/node_modules/requizzle/lib/wrappers/requirepaths.js +++ b/node_modules/jsdoc/node_modules/requizzle/lib/wrappers/requirepaths.js @@ -41,7 +41,7 @@ function requirePaths(parentModule, opts) { exports.before = function before(targetPath, parentModule, opts) { var resolvedPaths = requirePaths(parentModule, opts); return 'module.paths = ' + JSON.stringify(resolvedPaths.before) + '.concat(module.paths)' + - '.concat(' + JSON.stringify(resolvedPaths.after) + ');\n'; + '.concat(' + JSON.stringify(resolvedPaths.after) + '); '; }; exports.after = function after(targetPath, parentModule, opts) { diff --git a/node_modules/jsdoc/node_modules/requizzle/node_modules/underscore/LICENSE b/node_modules/jsdoc/node_modules/requizzle/node_modules/underscore/LICENSE new file mode 100644 index 0000000..0d6b873 --- /dev/null +++ b/node_modules/jsdoc/node_modules/requizzle/node_modules/underscore/LICENSE @@ -0,0 +1,23 @@ +Copyright (c) 2009-2014 Jeremy Ashkenas, DocumentCloud and Investigative +Reporters & Editors + +Permission is hereby granted, free of charge, to any person +obtaining a copy of this software and associated documentation +files (the "Software"), to deal in the Software without +restriction, including without limitation the rights to use, +copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the +Software is furnished to do so, subject to the following +conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES +OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT +HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/jsdoc/node_modules/requizzle/node_modules/underscore/README.md b/node_modules/jsdoc/node_modules/requizzle/node_modules/underscore/README.md new file mode 100644 index 0000000..c2ba259 --- /dev/null +++ b/node_modules/jsdoc/node_modules/requizzle/node_modules/underscore/README.md @@ -0,0 +1,22 @@ + __ + /\ \ __ + __ __ ___ \_\ \ __ _ __ ____ ___ ___ _ __ __ /\_\ ____ + /\ \/\ \ /' _ `\ /'_ \ /'__`\/\ __\/ ,__\ / ___\ / __`\/\ __\/'__`\ \/\ \ /',__\ + \ \ \_\ \/\ \/\ \/\ \ \ \/\ __/\ \ \//\__, `\/\ \__//\ \ \ \ \ \//\ __/ __ \ \ \/\__, `\ + \ \____/\ \_\ \_\ \___,_\ \____\\ \_\\/\____/\ \____\ \____/\ \_\\ \____\/\_\ _\ \ \/\____/ + \/___/ \/_/\/_/\/__,_ /\/____/ \/_/ \/___/ \/____/\/___/ \/_/ \/____/\/_//\ \_\ \/___/ + \ \____/ + \/___/ + +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 + +Underscore is an open-sourced component of DocumentCloud: +https://github.com/documentcloud + +Many thanks to our contributors: +https://github.com/jashkenas/underscore/contributors diff --git a/node_modules/jsdoc/node_modules/requizzle/node_modules/underscore/package.json b/node_modules/jsdoc/node_modules/requizzle/node_modules/underscore/package.json new file mode 100644 index 0000000..70d4f93 --- /dev/null +++ b/node_modules/jsdoc/node_modules/requizzle/node_modules/underscore/package.json @@ -0,0 +1,50 @@ +{ + "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/jashkenas/underscore.git" + }, + "main": "underscore.js", + "version": "1.6.0", + "devDependencies": { + "docco": "0.6.x", + "phantomjs": "1.9.0-1", + "uglify-js": "2.4.x" + }, + "scripts": { + "test": "phantomjs test/vendor/runner.js test/index.html?noglobals=true", + "build": "uglifyjs underscore.js -c \"evaluate=false\" --comments \"/ .*/\" -m --source-map underscore-min.map -o underscore-min.js", + "doc": "docco underscore.js" + }, + "licenses": [ + { + "type": "MIT", + "url": "https://raw.github.com/jashkenas/underscore/master/LICENSE" + } + ], + "files": [ + "underscore.js", + "underscore-min.js", + "LICENSE" + ], + "readme": " __\n /\\ \\ __\n __ __ ___ \\_\\ \\ __ _ __ ____ ___ ___ _ __ __ /\\_\\ ____\n /\\ \\/\\ \\ /' _ `\\ /'_ \\ /'__`\\/\\ __\\/ ,__\\ / ___\\ / __`\\/\\ __\\/'__`\\ \\/\\ \\ /',__\\\n \\ \\ \\_\\ \\/\\ \\/\\ \\/\\ \\ \\ \\/\\ __/\\ \\ \\//\\__, `\\/\\ \\__//\\ \\ \\ \\ \\ \\//\\ __/ __ \\ \\ \\/\\__, `\\\n \\ \\____/\\ \\_\\ \\_\\ \\___,_\\ \\____\\\\ \\_\\\\/\\____/\\ \\____\\ \\____/\\ \\_\\\\ \\____\\/\\_\\ _\\ \\ \\/\\____/\n \\/___/ \\/_/\\/_/\\/__,_ /\\/____/ \\/_/ \\/___/ \\/____/\\/___/ \\/_/ \\/____/\\/_//\\ \\_\\ \\/___/\n \\ \\____/\n \\/___/\n\nUnderscore.js is a utility-belt library for JavaScript that provides\nsupport for the usual functional suspects (each, map, reduce, filter...)\nwithout extending any core JavaScript objects.\n\nFor Docs, License, Tests, and pre-packed downloads, see:\nhttp://underscorejs.org\n\nUnderscore is an open-sourced component of DocumentCloud:\nhttps://github.com/documentcloud\n\nMany thanks to our contributors:\nhttps://github.com/jashkenas/underscore/contributors\n", + "readmeFilename": "README.md", + "bugs": { + "url": "https://github.com/jashkenas/underscore/issues" + }, + "_id": "underscore@1.6.0", + "_from": "underscore@>=1.6.0 <1.7.0" +} diff --git a/node_modules/jsdoc/node_modules/requizzle/node_modules/underscore/underscore-min.js b/node_modules/jsdoc/node_modules/requizzle/node_modules/underscore/underscore-min.js new file mode 100644 index 0000000..3434d6c --- /dev/null +++ b/node_modules/jsdoc/node_modules/requizzle/node_modules/underscore/underscore-min.js @@ -0,0 +1,6 @@ +// Underscore.js 1.6.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={},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,g=e.filter,d=e.every,m=e.some,y=e.indexOf,b=e.lastIndexOf,x=Array.isArray,w=Object.keys,_=i.bind,j=function(n){return n instanceof j?n:this instanceof j?void(this._wrapped=n):new j(n)};"undefined"!=typeof exports?("undefined"!=typeof module&&module.exports&&(exports=module.exports=j),exports._=j):n._=j,j.VERSION="1.6.0";var A=j.each=j.forEach=function(n,t,e){if(null==n)return 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=j.keys(n),u=0,i=a.length;i>u;u++)if(t.call(e,n[a[u]],a[u],n)===r)return;return n};j.map=j.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.push(t.call(r,n,u,i))}),e)};var O="Reduce of empty array with no initial value";j.reduce=j.foldl=j.inject=function(n,t,r,e){var u=arguments.length>2;if(null==n&&(n=[]),h&&n.reduce===h)return e&&(t=j.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},j.reduceRight=j.foldr=function(n,t,r,e){var u=arguments.length>2;if(null==n&&(n=[]),v&&n.reduceRight===v)return e&&(t=j.bind(t,e)),u?n.reduceRight(t,r):n.reduceRight(t);var i=n.length;if(i!==+i){var a=j.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},j.find=j.detect=function(n,t,r){var e;return k(n,function(n,u,i){return t.call(r,n,u,i)?(e=n,!0):void 0}),e},j.filter=j.select=function(n,t,r){var e=[];return null==n?e:g&&n.filter===g?n.filter(t,r):(A(n,function(n,u,i){t.call(r,n,u,i)&&e.push(n)}),e)},j.reject=function(n,t,r){return j.filter(n,function(n,e,u){return!t.call(r,n,e,u)},r)},j.every=j.all=function(n,t,e){t||(t=j.identity);var u=!0;return null==n?u:d&&n.every===d?n.every(t,e):(A(n,function(n,i,a){return(u=u&&t.call(e,n,i,a))?void 0:r}),!!u)};var k=j.some=j.any=function(n,t,e){t||(t=j.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)};j.contains=j.include=function(n,t){return null==n?!1:y&&n.indexOf===y?n.indexOf(t)!=-1:k(n,function(n){return n===t})},j.invoke=function(n,t){var r=o.call(arguments,2),e=j.isFunction(t);return j.map(n,function(n){return(e?t:n[t]).apply(n,r)})},j.pluck=function(n,t){return j.map(n,j.property(t))},j.where=function(n,t){return j.filter(n,j.matches(t))},j.findWhere=function(n,t){return j.find(n,j.matches(t))},j.max=function(n,t,r){if(!t&&j.isArray(n)&&n[0]===+n[0]&&n.length<65535)return Math.max.apply(Math,n);var e=-1/0,u=-1/0;return A(n,function(n,i,a){var o=t?t.call(r,n,i,a):n;o>u&&(e=n,u=o)}),e},j.min=function(n,t,r){if(!t&&j.isArray(n)&&n[0]===+n[0]&&n.length<65535)return Math.min.apply(Math,n);var e=1/0,u=1/0;return A(n,function(n,i,a){var o=t?t.call(r,n,i,a):n;u>o&&(e=n,u=o)}),e},j.shuffle=function(n){var t,r=0,e=[];return A(n,function(n){t=j.random(r++),e[r-1]=e[t],e[t]=n}),e},j.sample=function(n,t,r){return null==t||r?(n.length!==+n.length&&(n=j.values(n)),n[j.random(n.length-1)]):j.shuffle(n).slice(0,Math.max(0,t))};var E=function(n){return null==n?j.identity:j.isFunction(n)?n:j.property(n)};j.sortBy=function(n,t,r){return t=E(t),j.pluck(j.map(n,function(n,e,u){return{value:n,index:e,criteria:t.call(r,n,e,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.index-t.index}),"value")};var F=function(n){return function(t,r,e){var u={};return r=E(r),A(t,function(i,a){var o=r.call(e,i,a,t);n(u,o,i)}),u}};j.groupBy=F(function(n,t,r){j.has(n,t)?n[t].push(r):n[t]=[r]}),j.indexBy=F(function(n,t,r){n[t]=r}),j.countBy=F(function(n,t){j.has(n,t)?n[t]++:n[t]=1}),j.sortedIndex=function(n,t,r,e){r=E(r);for(var u=r.call(e,t),i=0,a=n.length;a>i;){var o=i+a>>>1;r.call(e,n[o])t?[]:o.call(n,0,t)},j.initial=function(n,t,r){return o.call(n,0,n.length-(null==t||r?1:t))},j.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))},j.rest=j.tail=j.drop=function(n,t,r){return o.call(n,null==t||r?1:t)},j.compact=function(n){return j.filter(n,j.identity)};var M=function(n,t,r){return t&&j.every(n,j.isArray)?c.apply(r,n):(A(n,function(n){j.isArray(n)||j.isArguments(n)?t?a.apply(r,n):M(n,t,r):r.push(n)}),r)};j.flatten=function(n,t){return M(n,t,[])},j.without=function(n){return j.difference(n,o.call(arguments,1))},j.partition=function(n,t){var r=[],e=[];return A(n,function(n){(t(n)?r:e).push(n)}),[r,e]},j.uniq=j.unique=function(n,t,r,e){j.isFunction(t)&&(e=r,r=t,t=!1);var u=r?j.map(n,r,e):n,i=[],a=[];return A(u,function(r,e){(t?e&&a[a.length-1]===r:j.contains(a,r))||(a.push(r),i.push(n[e]))}),i},j.union=function(){return j.uniq(j.flatten(arguments,!0))},j.intersection=function(n){var t=o.call(arguments,1);return j.filter(j.uniq(n),function(n){return j.every(t,function(t){return j.contains(t,n)})})},j.difference=function(n){var t=c.apply(e,o.call(arguments,1));return j.filter(n,function(n){return!j.contains(t,n)})},j.zip=function(){for(var n=j.max(j.pluck(arguments,"length").concat(0)),t=new Array(n),r=0;n>r;r++)t[r]=j.pluck(arguments,""+r);return t},j.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},j.indexOf=function(n,t,r){if(null==n)return-1;var e=0,u=n.length;if(r){if("number"!=typeof r)return e=j.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},j.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},j.range=function(n,t,r){arguments.length<=1&&(t=n||0,n=0),r=arguments[2]||1;for(var e=Math.max(Math.ceil((t-n)/r),0),u=0,i=new Array(e);e>u;)i[u++]=n,n+=r;return i};var R=function(){};j.bind=function(n,t){var r,e;if(_&&n.bind===_)return _.apply(n,o.call(arguments,1));if(!j.isFunction(n))throw new TypeError;return r=o.call(arguments,2),e=function(){if(!(this instanceof e))return n.apply(t,r.concat(o.call(arguments)));R.prototype=n.prototype;var u=new R;R.prototype=null;var i=n.apply(u,r.concat(o.call(arguments)));return Object(i)===i?i:u}},j.partial=function(n){var t=o.call(arguments,1);return function(){for(var r=0,e=t.slice(),u=0,i=e.length;i>u;u++)e[u]===j&&(e[u]=arguments[r++]);for(;r=f?(clearTimeout(a),a=null,o=l,i=n.apply(e,u),e=u=null):a||r.trailing===!1||(a=setTimeout(c,f)),i}},j.debounce=function(n,t,r){var e,u,i,a,o,c=function(){var l=j.now()-a;t>l?e=setTimeout(c,t-l):(e=null,r||(o=n.apply(i,u),i=u=null))};return function(){i=this,u=arguments,a=j.now();var l=r&&!e;return e||(e=setTimeout(c,t)),l&&(o=n.apply(i,u),i=u=null),o}},j.once=function(n){var t,r=!1;return function(){return r?t:(r=!0,t=n.apply(this,arguments),n=null,t)}},j.wrap=function(n,t){return j.partial(t,n)},j.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]}},j.after=function(n,t){return function(){return--n<1?t.apply(this,arguments):void 0}},j.keys=function(n){if(!j.isObject(n))return[];if(w)return w(n);var t=[];for(var r in n)j.has(n,r)&&t.push(r);return t},j.values=function(n){for(var t=j.keys(n),r=t.length,e=new Array(r),u=0;r>u;u++)e[u]=n[t[u]];return e},j.pairs=function(n){for(var t=j.keys(n),r=t.length,e=new Array(r),u=0;r>u;u++)e[u]=[t[u],n[t[u]]];return e},j.invert=function(n){for(var t={},r=j.keys(n),e=0,u=r.length;u>e;e++)t[n[r[e]]]=r[e];return t},j.functions=j.methods=function(n){var t=[];for(var r in n)j.isFunction(n[r])&&t.push(r);return t.sort()},j.extend=function(n){return A(o.call(arguments,1),function(t){if(t)for(var r in t)n[r]=t[r]}),n},j.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},j.omit=function(n){var t={},r=c.apply(e,o.call(arguments,1));for(var u in n)j.contains(r,u)||(t[u]=n[u]);return t},j.defaults=function(n){return A(o.call(arguments,1),function(t){if(t)for(var r in t)n[r]===void 0&&(n[r]=t[r])}),n},j.clone=function(n){return j.isObject(n)?j.isArray(n)?n.slice():j.extend({},n):n},j.tap=function(n,t){return t(n),n};var S=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 j&&(n=n._wrapped),t instanceof j&&(t=t._wrapped);var u=l.call(n);if(u!=l.call(t))return!1;switch(u){case"[object String]":return n==String(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;var a=n.constructor,o=t.constructor;if(a!==o&&!(j.isFunction(a)&&a instanceof a&&j.isFunction(o)&&o instanceof o)&&"constructor"in n&&"constructor"in t)return!1;r.push(n),e.push(t);var c=0,f=!0;if("[object Array]"==u){if(c=n.length,f=c==t.length)for(;c--&&(f=S(n[c],t[c],r,e)););}else{for(var s in n)if(j.has(n,s)&&(c++,!(f=j.has(t,s)&&S(n[s],t[s],r,e))))break;if(f){for(s in t)if(j.has(t,s)&&!c--)break;f=!c}}return r.pop(),e.pop(),f};j.isEqual=function(n,t){return S(n,t,[],[])},j.isEmpty=function(n){if(null==n)return!0;if(j.isArray(n)||j.isString(n))return 0===n.length;for(var t in n)if(j.has(n,t))return!1;return!0},j.isElement=function(n){return!(!n||1!==n.nodeType)},j.isArray=x||function(n){return"[object Array]"==l.call(n)},j.isObject=function(n){return n===Object(n)},A(["Arguments","Function","String","Number","Date","RegExp"],function(n){j["is"+n]=function(t){return l.call(t)=="[object "+n+"]"}}),j.isArguments(arguments)||(j.isArguments=function(n){return!(!n||!j.has(n,"callee"))}),"function"!=typeof/./&&(j.isFunction=function(n){return"function"==typeof n}),j.isFinite=function(n){return isFinite(n)&&!isNaN(parseFloat(n))},j.isNaN=function(n){return j.isNumber(n)&&n!=+n},j.isBoolean=function(n){return n===!0||n===!1||"[object Boolean]"==l.call(n)},j.isNull=function(n){return null===n},j.isUndefined=function(n){return n===void 0},j.has=function(n,t){return f.call(n,t)},j.noConflict=function(){return n._=t,this},j.identity=function(n){return n},j.constant=function(n){return function(){return n}},j.property=function(n){return function(t){return t[n]}},j.matches=function(n){return function(t){if(t===n)return!0;for(var r in n)if(n[r]!==t[r])return!1;return!0}},j.times=function(n,t,r){for(var e=Array(Math.max(0,n)),u=0;n>u;u++)e[u]=t.call(r,u);return e},j.random=function(n,t){return null==t&&(t=n,n=0),n+Math.floor(Math.random()*(t-n+1))},j.now=Date.now||function(){return(new Date).getTime()};var T={escape:{"&":"&","<":"<",">":">",'"':""","'":"'"}};T.unescape=j.invert(T.escape);var I={escape:new RegExp("["+j.keys(T.escape).join("")+"]","g"),unescape:new RegExp("("+j.keys(T.unescape).join("|")+")","g")};j.each(["escape","unescape"],function(n){j[n]=function(t){return null==t?"":(""+t).replace(I[n],function(t){return T[n][t]})}}),j.result=function(n,t){if(null==n)return void 0;var r=n[t];return j.isFunction(r)?r.call(n):r},j.mixin=function(n){A(j.functions(n),function(t){var r=j[t]=n[t];j.prototype[t]=function(){var n=[this._wrapped];return a.apply(n,arguments),z.call(this,r.apply(j,n))}})};var N=0;j.uniqueId=function(n){var t=++N+"";return n?n+t:t},j.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g};var q=/(.)^/,B={"'":"'","\\":"\\","\r":"r","\n":"n"," ":"t","\u2028":"u2028","\u2029":"u2029"},D=/\\|'|\r|\n|\t|\u2028|\u2029/g;j.template=function(n,t,r){var e;r=j.defaults({},r,j.templateSettings);var u=new RegExp([(r.escape||q).source,(r.interpolate||q).source,(r.evaluate||q).source].join("|")+"|$","g"),i=0,a="__p+='";n.replace(u,function(t,r,e,u,o){return a+=n.slice(i,o).replace(D,function(n){return"\\"+B[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=new Function(r.variable||"obj","_",a)}catch(o){throw o.source=a,o}if(t)return e(t,j);var c=function(n){return e.call(this,n,j)};return c.source="function("+(r.variable||"obj")+"){\n"+a+"}",c},j.chain=function(n){return j(n).chain()};var z=function(n){return this._chain?j(n).chain():n};j.mixin(j),A(["pop","push","reverse","shift","sort","splice","unshift"],function(n){var t=e[n];j.prototype[n]=function(){var r=this._wrapped;return t.apply(r,arguments),"shift"!=n&&"splice"!=n||0!==r.length||delete r[0],z.call(this,r)}}),A(["concat","join","slice"],function(n){var t=e[n];j.prototype[n]=function(){return z.call(this,t.apply(this._wrapped,arguments))}}),j.extend(j.prototype,{chain:function(){return this._chain=!0,this},value:function(){return this._wrapped}}),"function"==typeof define&&define.amd&&define("underscore",[],function(){return j})}).call(this); +//# sourceMappingURL=underscore-min.map \ No newline at end of file diff --git a/node_modules/jsdoc/node_modules/requizzle/node_modules/underscore/underscore.js b/node_modules/jsdoc/node_modules/requizzle/node_modules/underscore/underscore.js new file mode 100644 index 0000000..9a4cabe --- /dev/null +++ b/node_modules/jsdoc/node_modules/requizzle/node_modules/underscore/underscore.js @@ -0,0 +1,1343 @@ +// Underscore.js 1.6.0 +// http://underscorejs.org +// (c) 2009-2014 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors +// Underscore may be freely distributed under the MIT license. + +(function() { + + // Baseline setup + // -------------- + + // 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; + + // 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.6.0'; + + // 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 obj; + if (nativeForEach && obj.forEach === nativeForEach) { + obj.forEach(iterator, context); + } else if (obj.length === +obj.length) { + for (var i = 0, length = obj.length; i < length; i++) { + if (iterator.call(context, obj[i], i, obj) === breaker) return; + } + } else { + var keys = _.keys(obj); + for (var i = 0, length = keys.length; i < length; i++) { + if (iterator.call(context, obj[keys[i]], keys[i], obj) === breaker) return; + } + } + 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.push(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, predicate, context) { + var result; + any(obj, function(value, index, list) { + if (predicate.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, predicate, context) { + var results = []; + if (obj == null) return results; + if (nativeFilter && obj.filter === nativeFilter) return obj.filter(predicate, context); + each(obj, function(value, index, list) { + if (predicate.call(context, value, index, list)) results.push(value); + }); + return results; + }; + + // Return all the elements for which a truth test fails. + _.reject = function(obj, predicate, context) { + return _.filter(obj, function(value, index, list) { + return !predicate.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, predicate, context) { + predicate || (predicate = _.identity); + var result = true; + if (obj == null) return result; + if (nativeEvery && obj.every === nativeEvery) return obj.every(predicate, context); + each(obj, function(value, index, list) { + if (!(result = result && predicate.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, predicate, context) { + predicate || (predicate = _.identity); + var result = false; + if (obj == null) return result; + if (nativeSome && obj.some === nativeSome) return obj.some(predicate, context); + each(obj, function(value, index, list) { + if (result || (result = predicate.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, _.property(key)); + }; + + // Convenience version of a common use case of `filter`: selecting only objects + // containing specific `key:value` pairs. + _.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 _.find(obj, _.matches(attrs)); + }; + + // Return the maximum element or (element-based computation). + // Can't optimize arrays of integers longer than 65,535 elements. + // See [WebKit Bug 80797](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); + } + var result = -Infinity, lastComputed = -Infinity; + each(obj, function(value, index, list) { + var computed = iterator ? iterator.call(context, value, index, list) : value; + if (computed > lastComputed) { + result = value; + lastComputed = computed; + } + }); + 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); + } + var result = Infinity, lastComputed = Infinity; + each(obj, function(value, index, list) { + var computed = iterator ? iterator.call(context, value, index, list) : value; + if (computed < lastComputed) { + result = value; + lastComputed = computed; + } + }); + return result; + }; + + // Shuffle an array, 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; + }); + return shuffled; + }; + + // 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)); + }; + + // An internal function to generate lookup iterators. + var lookupIterator = function(value) { + if (value == null) return _.identity; + if (_.isFunction(value)) return value; + return _.property(value); + }; + + // Sort the object's values by a criterion produced by an iterator. + _.sortBy = function(obj, iterator, context) { + iterator = lookupIterator(iterator); + 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; + }), 'value'); + }; + + // An internal function used for aggregate "group by" operations. + var group = function(behavior) { + return function(obj, iterator, context) { + var result = {}; + iterator = lookupIterator(iterator); + 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 = group(function(result, key, value) { + _.has(result, key) ? result[key].push(value) : 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, key, value) { + 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 = group(function(result, key) { + _.has(result, key) ? result[key]++ : 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 = 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 create a real, live array from anything iterable. + _.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; + 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 + // 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 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`. + // 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) { + if (shallow && _.every(input, _.isArray)) { + return concat.apply(output, input); + } + each(input, function(value) { + if (_.isArray(value) || _.isArguments(value)) { + shallow ? push.apply(output, value) : flatten(value, shallow, output); + } else { + output.push(value); + } + }); + return output; + }; + + // Flatten out an array, either recursively (by default), or just one level. + _.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)); + }; + + // Split an array into two arrays: one whose elements all satisfy the given + // predicate, and one whose elements all do not satisfy the predicate. + _.partition = function(array, predicate) { + var pass = [], fail = []; + each(array, function(elem) { + (predicate(elem) ? pass : fail).push(elem); + }); + return [pass, fail]; + }; + + // 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(_.flatten(arguments, 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 _.contains(other, item); + }); + }); + }; + + // 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 length = _.max(_.pluck(arguments, 'length').concat(0)); + var results = new Array(length); + for (var i = 0; i < length; i++) { + results[i] = _.pluck(arguments, '' + 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, length = list.length; i < length; 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, length = array.length; + if (isSorted) { + if (typeof isSorted == 'number') { + 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 < 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 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 length = Math.max(Math.ceil((stop - start) / step), 0); + var idx = 0; + var range = new Array(length); + + while(idx < length) { + 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). Delegates to **ECMAScript 5**'s native `Function.bind` if + // available. + _.bind = function(func, context) { + var args, bound; + if (nativeBind && func.bind === 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; + ctor.prototype = null; + var result = func.apply(self, args.concat(slice.call(arguments))); + if (Object(result) === result) return result; + return self; + }; + }; + + // Partially apply a function by creating a version that has had some of its + // 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 boundArgs = slice.call(arguments, 1); + return function() { + 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 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) throw new Error('bindAll must be passed function names'); + 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. 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; + options || (options = {}); + var later = function() { + previous = options.leading === false ? 0 : _.now(); + timeout = null; + result = func.apply(context, args); + context = args = null; + }; + return function() { + var now = _.now(); + if (!previous && options.leading === false) previous = now; + var remaining = wait - (now - previous); + context = this; + args = arguments; + if (remaining <= 0) { + clearTimeout(timeout); + timeout = null; + previous = now; + result = func.apply(context, args); + context = args = null; + } else if (!timeout && options.trailing !== false) { + 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, args, context, timestamp, result; + + var later = function() { + var last = _.now() - timestamp; + if (last < wait) { + timeout = setTimeout(later, wait - last); + } else { + timeout = null; + if (!immediate) { + result = func.apply(context, args); + context = args = null; + } + } + }; + + return function() { + 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; + }; + }; + + // 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 _.partial(wrapper, func); + }; + + // 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) { + 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 = function(obj) { + if (!_.isObject(obj)) return []; + if (nativeKeys) return nativeKeys(obj); + var keys = []; + 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 keys = _.keys(obj); + var length = keys.length; + var values = new 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 keys = _.keys(obj); + var length = keys.length; + var pairs = new 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 = {}; + var keys = _.keys(obj); + for (var i = 0, length = keys.length; i < length; i++) { + result[obj[keys[i]]] = keys[i]; + } + 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] === void 0) 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; + } + // 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)) + && ('constructor' in a && 'constructor' in b)) { + return false; + } + // 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 { + // 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; + }; + + _.constant = function(value) { + return function () { + return value; + }; + }; + + _.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) { + return function(obj) { + if (obj === attrs) return true; //avoid comparing an object to itself. + for (var key in attrs) { + if (attrs[key] !== obj[key]) + return false; + } + return true; + } + }; + + // Run a function **n** times. + _.times = function(n, iterator, context) { + var accum = Array(Math.max(0, 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)); + }; + + // A (possibly faster) way to get the current timestamp as an integer. + _.now = Date.now || function() { return new Date().getTime(); }; + + // 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 with the + // `object` as context; otherwise, return it. + _.result = function(object, property) { + 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)); + }; + }); + }; + + // 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; + } + + }); + + // 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/jsdoc/node_modules/requizzle/package.json b/node_modules/jsdoc/node_modules/requizzle/package.json index 23abcfd..96c4105 100644 --- a/node_modules/jsdoc/node_modules/requizzle/package.json +++ b/node_modules/jsdoc/node_modules/requizzle/package.json @@ -1,6 +1,6 @@ { "name": "requizzle", - "version": "0.2.0", + "version": "0.2.1", "description": "Swizzle a little something into your require() calls.", "main": "index.js", "scripts": { @@ -38,11 +38,12 @@ "dependencies": { "underscore": "~1.6.0" }, - "gitHead": "696c5ca079822fba78522f56b223404600481434", - "_id": "requizzle@0.2.0", - "_shasum": "ea93c7b441ce168052391860b55a7b508c391cbd", - "_from": "requizzle@~0.2.0", - "_npmVersion": "1.4.13", + "gitHead": "be5b922edf3e08e487bf374d6add13f8da581abf", + "_id": "requizzle@0.2.1", + "_shasum": "6943c3530c4d9a7e46f1cddd51c158fc670cdbde", + "_from": "requizzle@>=0.2.0 <0.3.0", + "_npmVersion": "2.1.9", + "_nodeVersion": "0.10.33", "_npmUser": { "name": "hegemonic", "email": "jeffrey.l.williams@gmail.com" @@ -54,10 +55,10 @@ } ], "dist": { - "shasum": "ea93c7b441ce168052391860b55a7b508c391cbd", - "tarball": "http://registry.npmjs.org/requizzle/-/requizzle-0.2.0.tgz" + "shasum": "6943c3530c4d9a7e46f1cddd51c158fc670cdbde", + "tarball": "http://registry.npmjs.org/requizzle/-/requizzle-0.2.1.tgz" }, "directories": {}, - "_resolved": "https://registry.npmjs.org/requizzle/-/requizzle-0.2.0.tgz", + "_resolved": "https://registry.npmjs.org/requizzle/-/requizzle-0.2.1.tgz", "readme": "ERROR: No README data found!" } diff --git a/node_modules/jsdoc/node_modules/strip-json-comments/package.json b/node_modules/jsdoc/node_modules/strip-json-comments/package.json index 400cae0..ccceb2c 100644 --- a/node_modules/jsdoc/node_modules/strip-json-comments/package.json +++ b/node_modules/jsdoc/node_modules/strip-json-comments/package.json @@ -1,6 +1,6 @@ { "name": "strip-json-comments", - "version": "0.1.3", + "version": "1.0.2", "description": "Strip comments from JSON. Lets you use comments in your JSON files!", "keywords": [ "json", @@ -37,7 +37,7 @@ }, "repository": { "type": "git", - "url": "git://github.com/sindresorhus/strip-json-comments" + "url": "https://github.com/sindresorhus/strip-json-comments" }, "scripts": { "test": "mocha" @@ -48,15 +48,16 @@ "engines": { "node": ">=0.8.0" }, - "gitHead": "cbd5aede7ccbe5d5a9065b1d47070fd99ad579af", + "gitHead": "142dd671c71f90fb7fdba440184b1bb64543acb3", "bugs": { "url": "https://github.com/sindresorhus/strip-json-comments/issues" }, "homepage": "https://github.com/sindresorhus/strip-json-comments", - "_id": "strip-json-comments@0.1.3", - "_shasum": "164c64e370a8a3cc00c9e01b539e569823f0ee54", - "_from": "strip-json-comments@~0.1.3", - "_npmVersion": "1.4.13", + "_id": "strip-json-comments@1.0.2", + "_shasum": "5a48ab96023dbac1b7b8d0ffabf6f63f1677be9f", + "_from": "strip-json-comments@>=1.0.2 <1.1.0", + "_npmVersion": "2.1.2", + "_nodeVersion": "0.10.32", "_npmUser": { "name": "sindresorhus", "email": "sindresorhus@gmail.com" @@ -68,10 +69,10 @@ } ], "dist": { - "shasum": "164c64e370a8a3cc00c9e01b539e569823f0ee54", - "tarball": "http://registry.npmjs.org/strip-json-comments/-/strip-json-comments-0.1.3.tgz" + "shasum": "5a48ab96023dbac1b7b8d0ffabf6f63f1677be9f", + "tarball": "http://registry.npmjs.org/strip-json-comments/-/strip-json-comments-1.0.2.tgz" }, "directories": {}, - "_resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-0.1.3.tgz", + "_resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-1.0.2.tgz", "readme": "ERROR: No README data found!" } diff --git a/node_modules/jsdoc/node_modules/strip-json-comments/readme.md b/node_modules/jsdoc/node_modules/strip-json-comments/readme.md index ad6a178..3365232 100644 --- a/node_modules/jsdoc/node_modules/strip-json-comments/readme.md +++ b/node_modules/jsdoc/node_modules/strip-json-comments/readme.md @@ -11,7 +11,7 @@ This is now possible: } ``` -It will remove single-line comments `//` and mult-line comments `/**/`. +It will remove single-line comments `//` and multi-line comments `/**/`. Also available as a [gulp](https://github.com/sindresorhus/gulp-strip-json-comments)/[grunt](https://github.com/sindresorhus/grunt-strip-json-comments)/[broccoli](https://github.com/sindresorhus/broccoli-strip-json-comments) plugin and a [require hook](https://github.com/uTest/autostrip-json-comments). @@ -63,9 +63,9 @@ $ npm install --global strip-json-comments ```sh $ strip-json-comments --help -strip-json-comments > +strip-json-comments input-file > output-file # or -cat | strip-json-comments > +strip-json-comments < input-file > output-file ``` diff --git a/node_modules/jsdoc/node_modules/strip-json-comments/strip-json-comments.js b/node_modules/jsdoc/node_modules/strip-json-comments/strip-json-comments.js index 2e7fdef..a47976f 100644 --- a/node_modules/jsdoc/node_modules/strip-json-comments/strip-json-comments.js +++ b/node_modules/jsdoc/node_modules/strip-json-comments/strip-json-comments.js @@ -34,6 +34,9 @@ } else if (insideComment === 'single' && currentChar + nextChar === '\r\n') { insideComment = false; i++; + ret += currentChar; + ret += nextChar; + continue; } else if (insideComment === 'single' && currentChar === '\n') { insideComment = false; } else if (!insideComment && currentChar + nextChar === '/*') { diff --git a/node_modules/jsdoc/node_modules/taffydb/package.json b/node_modules/jsdoc/node_modules/taffydb/package.json index 1165f20..91e3c1f 100644 --- a/node_modules/jsdoc/node_modules/taffydb/package.json +++ b/node_modules/jsdoc/node_modules/taffydb/package.json @@ -16,6 +16,6 @@ "homepage": "https://github.com/hegemonic/taffydb", "_id": "taffydb@2.6.2", "_shasum": "3c549d2f5712d7d1d109ad6bb1a4084f1b7add4e", - "_from": "https://github.com/hegemonic/taffydb/tarball/master", - "_resolved": "https://github.com/hegemonic/taffydb/tarball/master" + "_resolved": "https://github.com/hegemonic/taffydb/tarball/7d100bcee0e997ee4977e273cdce60bd8933050e", + "_from": "https://github.com/hegemonic/taffydb/tarball/7d100bcee0e997ee4977e273cdce60bd8933050e" } diff --git a/node_modules/jsdoc/node_modules/underscore/package.json b/node_modules/jsdoc/node_modules/underscore/package.json index a121112..11c7175 100644 --- a/node_modules/jsdoc/node_modules/underscore/package.json +++ b/node_modules/jsdoc/node_modules/underscore/package.json @@ -18,14 +18,15 @@ "url": "git://github.com/jashkenas/underscore.git" }, "main": "underscore.js", - "version": "1.6.0", + "version": "1.7.0", "devDependencies": { "docco": "0.6.x", - "phantomjs": "1.9.0-1", - "uglify-js": "2.4.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" }, @@ -40,11 +41,29 @@ "underscore-min.js", "LICENSE" ], - "readme": " __\n /\\ \\ __\n __ __ ___ \\_\\ \\ __ _ __ ____ ___ ___ _ __ __ /\\_\\ ____\n /\\ \\/\\ \\ /' _ `\\ /'_ \\ /'__`\\/\\ __\\/ ,__\\ / ___\\ / __`\\/\\ __\\/'__`\\ \\/\\ \\ /',__\\\n \\ \\ \\_\\ \\/\\ \\/\\ \\/\\ \\ \\ \\/\\ __/\\ \\ \\//\\__, `\\/\\ \\__//\\ \\ \\ \\ \\ \\//\\ __/ __ \\ \\ \\/\\__, `\\\n \\ \\____/\\ \\_\\ \\_\\ \\___,_\\ \\____\\\\ \\_\\\\/\\____/\\ \\____\\ \\____/\\ \\_\\\\ \\____\\/\\_\\ _\\ \\ \\/\\____/\n \\/___/ \\/_/\\/_/\\/__,_ /\\/____/ \\/_/ \\/___/ \\/____/\\/___/ \\/_/ \\/____/\\/_//\\ \\_\\ \\/___/\n \\ \\____/\n \\/___/\n\nUnderscore.js is a utility-belt library for JavaScript that provides\nsupport for the usual functional suspects (each, map, reduce, filter...)\nwithout extending any core JavaScript objects.\n\nFor Docs, License, Tests, and pre-packed downloads, see:\nhttp://underscorejs.org\n\nUnderscore is an open-sourced component of DocumentCloud:\nhttps://github.com/documentcloud\n\nMany thanks to our contributors:\nhttps://github.com/jashkenas/underscore/contributors\n", - "readmeFilename": "README.md", + "gitHead": "da996e665deb0b69b257e80e3e257c04fde4191c", "bugs": { "url": "https://github.com/jashkenas/underscore/issues" }, - "_id": "underscore@1.6.0", - "_from": "underscore@~1.6.0" + "_id": "underscore@1.7.0", + "_shasum": "6bbaf0877500d36be34ecaa584e0db9fef035209", + "_from": "underscore@>=1.7.0 <1.8.0", + "_npmVersion": "1.4.24", + "_npmUser": { + "name": "jashkenas", + "email": "jashkenas@gmail.com" + }, + "maintainers": [ + { + "name": "jashkenas", + "email": "jashkenas@gmail.com" + } + ], + "dist": { + "shasum": "6bbaf0877500d36be34ecaa584e0db9fef035209", + "tarball": "http://registry.npmjs.org/underscore/-/underscore-1.7.0.tgz" + }, + "directories": {}, + "_resolved": "https://registry.npmjs.org/underscore/-/underscore-1.7.0.tgz", + "readme": "ERROR: No README data found!" } diff --git a/node_modules/jsdoc/node_modules/underscore/underscore-min.js b/node_modules/jsdoc/node_modules/underscore/underscore-min.js index 3434d6c..11f1d96 100644 --- a/node_modules/jsdoc/node_modules/underscore/underscore-min.js +++ b/node_modules/jsdoc/node_modules/underscore/underscore-min.js @@ -1,6 +1,6 @@ -// Underscore.js 1.6.0 +// 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={},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,g=e.filter,d=e.every,m=e.some,y=e.indexOf,b=e.lastIndexOf,x=Array.isArray,w=Object.keys,_=i.bind,j=function(n){return n instanceof j?n:this instanceof j?void(this._wrapped=n):new j(n)};"undefined"!=typeof exports?("undefined"!=typeof module&&module.exports&&(exports=module.exports=j),exports._=j):n._=j,j.VERSION="1.6.0";var A=j.each=j.forEach=function(n,t,e){if(null==n)return 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=j.keys(n),u=0,i=a.length;i>u;u++)if(t.call(e,n[a[u]],a[u],n)===r)return;return n};j.map=j.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.push(t.call(r,n,u,i))}),e)};var O="Reduce of empty array with no initial value";j.reduce=j.foldl=j.inject=function(n,t,r,e){var u=arguments.length>2;if(null==n&&(n=[]),h&&n.reduce===h)return e&&(t=j.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},j.reduceRight=j.foldr=function(n,t,r,e){var u=arguments.length>2;if(null==n&&(n=[]),v&&n.reduceRight===v)return e&&(t=j.bind(t,e)),u?n.reduceRight(t,r):n.reduceRight(t);var i=n.length;if(i!==+i){var a=j.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},j.find=j.detect=function(n,t,r){var e;return k(n,function(n,u,i){return t.call(r,n,u,i)?(e=n,!0):void 0}),e},j.filter=j.select=function(n,t,r){var e=[];return null==n?e:g&&n.filter===g?n.filter(t,r):(A(n,function(n,u,i){t.call(r,n,u,i)&&e.push(n)}),e)},j.reject=function(n,t,r){return j.filter(n,function(n,e,u){return!t.call(r,n,e,u)},r)},j.every=j.all=function(n,t,e){t||(t=j.identity);var u=!0;return null==n?u:d&&n.every===d?n.every(t,e):(A(n,function(n,i,a){return(u=u&&t.call(e,n,i,a))?void 0:r}),!!u)};var k=j.some=j.any=function(n,t,e){t||(t=j.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)};j.contains=j.include=function(n,t){return null==n?!1:y&&n.indexOf===y?n.indexOf(t)!=-1:k(n,function(n){return n===t})},j.invoke=function(n,t){var r=o.call(arguments,2),e=j.isFunction(t);return j.map(n,function(n){return(e?t:n[t]).apply(n,r)})},j.pluck=function(n,t){return j.map(n,j.property(t))},j.where=function(n,t){return j.filter(n,j.matches(t))},j.findWhere=function(n,t){return j.find(n,j.matches(t))},j.max=function(n,t,r){if(!t&&j.isArray(n)&&n[0]===+n[0]&&n.length<65535)return Math.max.apply(Math,n);var e=-1/0,u=-1/0;return A(n,function(n,i,a){var o=t?t.call(r,n,i,a):n;o>u&&(e=n,u=o)}),e},j.min=function(n,t,r){if(!t&&j.isArray(n)&&n[0]===+n[0]&&n.length<65535)return Math.min.apply(Math,n);var e=1/0,u=1/0;return A(n,function(n,i,a){var o=t?t.call(r,n,i,a):n;u>o&&(e=n,u=o)}),e},j.shuffle=function(n){var t,r=0,e=[];return A(n,function(n){t=j.random(r++),e[r-1]=e[t],e[t]=n}),e},j.sample=function(n,t,r){return null==t||r?(n.length!==+n.length&&(n=j.values(n)),n[j.random(n.length-1)]):j.shuffle(n).slice(0,Math.max(0,t))};var E=function(n){return null==n?j.identity:j.isFunction(n)?n:j.property(n)};j.sortBy=function(n,t,r){return t=E(t),j.pluck(j.map(n,function(n,e,u){return{value:n,index:e,criteria:t.call(r,n,e,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.index-t.index}),"value")};var F=function(n){return function(t,r,e){var u={};return r=E(r),A(t,function(i,a){var o=r.call(e,i,a,t);n(u,o,i)}),u}};j.groupBy=F(function(n,t,r){j.has(n,t)?n[t].push(r):n[t]=[r]}),j.indexBy=F(function(n,t,r){n[t]=r}),j.countBy=F(function(n,t){j.has(n,t)?n[t]++:n[t]=1}),j.sortedIndex=function(n,t,r,e){r=E(r);for(var u=r.call(e,t),i=0,a=n.length;a>i;){var o=i+a>>>1;r.call(e,n[o])t?[]:o.call(n,0,t)},j.initial=function(n,t,r){return o.call(n,0,n.length-(null==t||r?1:t))},j.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))},j.rest=j.tail=j.drop=function(n,t,r){return o.call(n,null==t||r?1:t)},j.compact=function(n){return j.filter(n,j.identity)};var M=function(n,t,r){return t&&j.every(n,j.isArray)?c.apply(r,n):(A(n,function(n){j.isArray(n)||j.isArguments(n)?t?a.apply(r,n):M(n,t,r):r.push(n)}),r)};j.flatten=function(n,t){return M(n,t,[])},j.without=function(n){return j.difference(n,o.call(arguments,1))},j.partition=function(n,t){var r=[],e=[];return A(n,function(n){(t(n)?r:e).push(n)}),[r,e]},j.uniq=j.unique=function(n,t,r,e){j.isFunction(t)&&(e=r,r=t,t=!1);var u=r?j.map(n,r,e):n,i=[],a=[];return A(u,function(r,e){(t?e&&a[a.length-1]===r:j.contains(a,r))||(a.push(r),i.push(n[e]))}),i},j.union=function(){return j.uniq(j.flatten(arguments,!0))},j.intersection=function(n){var t=o.call(arguments,1);return j.filter(j.uniq(n),function(n){return j.every(t,function(t){return j.contains(t,n)})})},j.difference=function(n){var t=c.apply(e,o.call(arguments,1));return j.filter(n,function(n){return!j.contains(t,n)})},j.zip=function(){for(var n=j.max(j.pluck(arguments,"length").concat(0)),t=new Array(n),r=0;n>r;r++)t[r]=j.pluck(arguments,""+r);return t},j.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},j.indexOf=function(n,t,r){if(null==n)return-1;var e=0,u=n.length;if(r){if("number"!=typeof r)return e=j.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},j.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},j.range=function(n,t,r){arguments.length<=1&&(t=n||0,n=0),r=arguments[2]||1;for(var e=Math.max(Math.ceil((t-n)/r),0),u=0,i=new Array(e);e>u;)i[u++]=n,n+=r;return i};var R=function(){};j.bind=function(n,t){var r,e;if(_&&n.bind===_)return _.apply(n,o.call(arguments,1));if(!j.isFunction(n))throw new TypeError;return r=o.call(arguments,2),e=function(){if(!(this instanceof e))return n.apply(t,r.concat(o.call(arguments)));R.prototype=n.prototype;var u=new R;R.prototype=null;var i=n.apply(u,r.concat(o.call(arguments)));return Object(i)===i?i:u}},j.partial=function(n){var t=o.call(arguments,1);return function(){for(var r=0,e=t.slice(),u=0,i=e.length;i>u;u++)e[u]===j&&(e[u]=arguments[r++]);for(;r=f?(clearTimeout(a),a=null,o=l,i=n.apply(e,u),e=u=null):a||r.trailing===!1||(a=setTimeout(c,f)),i}},j.debounce=function(n,t,r){var e,u,i,a,o,c=function(){var l=j.now()-a;t>l?e=setTimeout(c,t-l):(e=null,r||(o=n.apply(i,u),i=u=null))};return function(){i=this,u=arguments,a=j.now();var l=r&&!e;return e||(e=setTimeout(c,t)),l&&(o=n.apply(i,u),i=u=null),o}},j.once=function(n){var t,r=!1;return function(){return r?t:(r=!0,t=n.apply(this,arguments),n=null,t)}},j.wrap=function(n,t){return j.partial(t,n)},j.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]}},j.after=function(n,t){return function(){return--n<1?t.apply(this,arguments):void 0}},j.keys=function(n){if(!j.isObject(n))return[];if(w)return w(n);var t=[];for(var r in n)j.has(n,r)&&t.push(r);return t},j.values=function(n){for(var t=j.keys(n),r=t.length,e=new Array(r),u=0;r>u;u++)e[u]=n[t[u]];return e},j.pairs=function(n){for(var t=j.keys(n),r=t.length,e=new Array(r),u=0;r>u;u++)e[u]=[t[u],n[t[u]]];return e},j.invert=function(n){for(var t={},r=j.keys(n),e=0,u=r.length;u>e;e++)t[n[r[e]]]=r[e];return t},j.functions=j.methods=function(n){var t=[];for(var r in n)j.isFunction(n[r])&&t.push(r);return t.sort()},j.extend=function(n){return A(o.call(arguments,1),function(t){if(t)for(var r in t)n[r]=t[r]}),n},j.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},j.omit=function(n){var t={},r=c.apply(e,o.call(arguments,1));for(var u in n)j.contains(r,u)||(t[u]=n[u]);return t},j.defaults=function(n){return A(o.call(arguments,1),function(t){if(t)for(var r in t)n[r]===void 0&&(n[r]=t[r])}),n},j.clone=function(n){return j.isObject(n)?j.isArray(n)?n.slice():j.extend({},n):n},j.tap=function(n,t){return t(n),n};var S=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 j&&(n=n._wrapped),t instanceof j&&(t=t._wrapped);var u=l.call(n);if(u!=l.call(t))return!1;switch(u){case"[object String]":return n==String(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;var a=n.constructor,o=t.constructor;if(a!==o&&!(j.isFunction(a)&&a instanceof a&&j.isFunction(o)&&o instanceof o)&&"constructor"in n&&"constructor"in t)return!1;r.push(n),e.push(t);var c=0,f=!0;if("[object Array]"==u){if(c=n.length,f=c==t.length)for(;c--&&(f=S(n[c],t[c],r,e)););}else{for(var s in n)if(j.has(n,s)&&(c++,!(f=j.has(t,s)&&S(n[s],t[s],r,e))))break;if(f){for(s in t)if(j.has(t,s)&&!c--)break;f=!c}}return r.pop(),e.pop(),f};j.isEqual=function(n,t){return S(n,t,[],[])},j.isEmpty=function(n){if(null==n)return!0;if(j.isArray(n)||j.isString(n))return 0===n.length;for(var t in n)if(j.has(n,t))return!1;return!0},j.isElement=function(n){return!(!n||1!==n.nodeType)},j.isArray=x||function(n){return"[object Array]"==l.call(n)},j.isObject=function(n){return n===Object(n)},A(["Arguments","Function","String","Number","Date","RegExp"],function(n){j["is"+n]=function(t){return l.call(t)=="[object "+n+"]"}}),j.isArguments(arguments)||(j.isArguments=function(n){return!(!n||!j.has(n,"callee"))}),"function"!=typeof/./&&(j.isFunction=function(n){return"function"==typeof n}),j.isFinite=function(n){return isFinite(n)&&!isNaN(parseFloat(n))},j.isNaN=function(n){return j.isNumber(n)&&n!=+n},j.isBoolean=function(n){return n===!0||n===!1||"[object Boolean]"==l.call(n)},j.isNull=function(n){return null===n},j.isUndefined=function(n){return n===void 0},j.has=function(n,t){return f.call(n,t)},j.noConflict=function(){return n._=t,this},j.identity=function(n){return n},j.constant=function(n){return function(){return n}},j.property=function(n){return function(t){return t[n]}},j.matches=function(n){return function(t){if(t===n)return!0;for(var r in n)if(n[r]!==t[r])return!1;return!0}},j.times=function(n,t,r){for(var e=Array(Math.max(0,n)),u=0;n>u;u++)e[u]=t.call(r,u);return e},j.random=function(n,t){return null==t&&(t=n,n=0),n+Math.floor(Math.random()*(t-n+1))},j.now=Date.now||function(){return(new Date).getTime()};var T={escape:{"&":"&","<":"<",">":">",'"':""","'":"'"}};T.unescape=j.invert(T.escape);var I={escape:new RegExp("["+j.keys(T.escape).join("")+"]","g"),unescape:new RegExp("("+j.keys(T.unescape).join("|")+")","g")};j.each(["escape","unescape"],function(n){j[n]=function(t){return null==t?"":(""+t).replace(I[n],function(t){return T[n][t]})}}),j.result=function(n,t){if(null==n)return void 0;var r=n[t];return j.isFunction(r)?r.call(n):r},j.mixin=function(n){A(j.functions(n),function(t){var r=j[t]=n[t];j.prototype[t]=function(){var n=[this._wrapped];return a.apply(n,arguments),z.call(this,r.apply(j,n))}})};var N=0;j.uniqueId=function(n){var t=++N+"";return n?n+t:t},j.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g};var q=/(.)^/,B={"'":"'","\\":"\\","\r":"r","\n":"n"," ":"t","\u2028":"u2028","\u2029":"u2029"},D=/\\|'|\r|\n|\t|\u2028|\u2029/g;j.template=function(n,t,r){var e;r=j.defaults({},r,j.templateSettings);var u=new RegExp([(r.escape||q).source,(r.interpolate||q).source,(r.evaluate||q).source].join("|")+"|$","g"),i=0,a="__p+='";n.replace(u,function(t,r,e,u,o){return a+=n.slice(i,o).replace(D,function(n){return"\\"+B[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=new Function(r.variable||"obj","_",a)}catch(o){throw o.source=a,o}if(t)return e(t,j);var c=function(n){return e.call(this,n,j)};return c.source="function("+(r.variable||"obj")+"){\n"+a+"}",c},j.chain=function(n){return j(n).chain()};var z=function(n){return this._chain?j(n).chain():n};j.mixin(j),A(["pop","push","reverse","shift","sort","splice","unshift"],function(n){var t=e[n];j.prototype[n]=function(){var r=this._wrapped;return t.apply(r,arguments),"shift"!=n&&"splice"!=n||0!==r.length||delete r[0],z.call(this,r)}}),A(["concat","join","slice"],function(n){var t=e[n];j.prototype[n]=function(){return z.call(this,t.apply(this._wrapped,arguments))}}),j.extend(j.prototype,{chain:function(){return this._chain=!0,this},value:function(){return this._wrapped}}),"function"==typeof define&&define.amd&&define("underscore",[],function(){return j})}).call(this); +(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/jsdoc/node_modules/underscore/underscore.js b/node_modules/jsdoc/node_modules/underscore/underscore.js index 9a4cabe..b4f49a0 100644 --- a/node_modules/jsdoc/node_modules/underscore/underscore.js +++ b/node_modules/jsdoc/node_modules/underscore/underscore.js @@ -1,4 +1,4 @@ -// Underscore.js 1.6.0 +// 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. @@ -14,9 +14,6 @@ // 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; @@ -31,15 +28,6 @@ // 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; @@ -53,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 = _; @@ -65,98 +52,125 @@ } // Current version. - _.VERSION = '1.6.0'; + _.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) { + // 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; - if (nativeForEach && obj.forEach === nativeForEach) { - obj.forEach(iterator, context); - } else if (obj.length === +obj.length) { - for (var i = 0, length = obj.length; i < length; i++) { - if (iterator.call(context, obj[i], i, obj) === breaker) return; + iteratee = createCallback(iteratee, context); + var i, length = obj.length; + if (length === +length) { + for (i = 0; i < length; i++) { + iteratee(obj[i], i, obj); } } else { var keys = _.keys(obj); - for (var i = 0, length = keys.length; i < length; i++) { - if (iterator.call(context, obj[keys[i]], keys[i], obj) === breaker) return; + 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.push(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, predicate, context) { var result; - any(obj, function(value, index, list) { - if (predicate.call(context, value, index, list)) { + predicate = _.iteratee(predicate, context); + _.some(obj, function(value, index, list) { + if (predicate(value, index, list)) { result = value; return true; } @@ -165,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, predicate, context) { var results = []; if (obj == null) return results; - if (nativeFilter && obj.filter === nativeFilter) return obj.filter(predicate, context); - each(obj, function(value, index, list) { - if (predicate.call(context, value, index, list)) results.push(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, predicate, context) { - return _.filter(obj, function(value, index, list) { - return !predicate.call(context, value, index, list); - }, 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, predicate, context) { - predicate || (predicate = _.identity); - var result = true; - if (obj == null) return result; - if (nativeEvery && obj.every === nativeEvery) return obj.every(predicate, context); - each(obj, function(value, index, list) { - if (!(result = result && predicate.call(context, value, index, list))) return breaker; - }); - return !!result; + 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, predicate, context) { - predicate || (predicate = _.identity); - var result = false; - if (obj == null) return result; - if (nativeSome && obj.some === nativeSome) return obj.some(predicate, context); - each(obj, function(value, index, list) { - if (result || (result = predicate.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. @@ -248,51 +259,67 @@ return _.find(obj, _.matches(attrs)); }; - // Return the maximum element or (element-based computation). - // Can't optimize arrays of integers longer than 65,535 elements. - // See [WebKit Bug 80797](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); - } - var result = -Infinity, lastComputed = -Infinity; - each(obj, function(value, index, list) { - var computed = iterator ? iterator.call(context, value, index, list) : value; - if (computed > lastComputed) { - result = value; - lastComputed = computed; + // 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; + } + }); + } 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); - } - var result = Infinity, lastComputed = Infinity; - each(obj, function(value, index, list) { - var computed = iterator ? iterator.call(context, value, index, list) : value; - if (computed < lastComputed) { - result = value; - lastComputed = computed; + _.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; + } + }); + } return result; }; - // Shuffle an array, using the modern version of the + // 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; }; @@ -307,21 +334,14 @@ return _.shuffle(obj).slice(0, Math.max(0, n)); }; - // An internal function to generate lookup iterators. - var lookupIterator = function(value) { - if (value == null) return _.identity; - if (_.isFunction(value)) return value; - return _.property(value); - }; - - // Sort the object's values by a criterion produced by an iterator. - _.sortBy = function(obj, iterator, context) { - iterator = lookupIterator(iterator); + // 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) + criteria: iteratee(value, index, list) }; }).sort(function(left, right) { var a = left.criteria; @@ -336,12 +356,12 @@ // An internal function used for aggregate "group by" operations. var group = function(behavior) { - return function(obj, iterator, context) { + return function(obj, iteratee, context) { var result = {}; - iterator = lookupIterator(iterator); - each(obj, function(value, index) { - var key = iterator.call(context, value, index, obj); - behavior(result, key, value); + iteratee = _.iteratee(iteratee, context); + _.each(obj, function(value, index) { + var key = iteratee(value, index, obj); + behavior(result, value, key); }); return result; }; @@ -349,32 +369,32 @@ // Groups the object's values by a criterion. Pass either a string attribute // to group by, or a function that returns the criterion. - _.groupBy = group(function(result, key, value) { - _.has(result, key) ? result[key].push(value) : result[key] = [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, key, value) { + _.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 = group(function(result, key) { - _.has(result, key) ? result[key]++ : result[key] = 1; + _.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 = 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; }; @@ -390,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 @@ -401,7 +432,7 @@ // allows it to work with `_.map`. _.first = _.head = _.take = function(array, n, guard) { if (array == null) return void 0; - if ((n == null) || guard) return array[0]; + if (n == null || guard) return array[0]; if (n < 0) return []; return slice.call(array, 0, n); }; @@ -411,14 +442,14 @@ // 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 array[array.length - 1]; + if (n == null || guard) return array[array.length - 1]; return slice.call(array, Math.max(array.length - n, 0)); }; @@ -427,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. @@ -436,23 +467,26 @@ }; // Internal implementation of a recursive `flatten` function. - var flatten = function(input, shallow, output) { + var flatten = function(input, shallow, strict, output) { if (shallow && _.every(input, _.isArray)) { return concat.apply(output, input); } - each(input, function(value) { - if (_.isArray(value) || _.isArguments(value)) { - shallow ? push.apply(output, value) : flatten(value, shallow, output); + 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; }; // 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). @@ -460,68 +494,77 @@ return _.difference(array, slice.call(arguments, 1)); }; - // Split an array into two arrays: one whose elements all satisfy the given - // predicate, and one whose elements all do not satisfy the predicate. - _.partition = function(array, predicate) { - var pass = [], fail = []; - each(array, function(elem) { - (predicate(elem) ? pass : fail).push(elem); - }); - return [pass, fail]; - }; - // 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(_.flatten(arguments, true)); + 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 _.contains(other, item); - }); - }); + 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 length = _.max(_.pluck(arguments, 'length').concat(0)); - 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(arguments, '' + i); + results[i] = _.pluck(arguments, i); } return results; }; @@ -542,10 +585,8 @@ 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) { @@ -553,26 +594,23 @@ var i = 0, length = array.length; if (isSorted) { if (typeof isSorted == 'number') { - i = (isSorted < 0 ? Math.max(0, length + 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 < 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; }; @@ -584,15 +622,13 @@ stop = start || 0; start = 0; } - step = arguments[2] || 1; + step = step || 1; var length = Math.max(Math.ceil((stop - start) / step), 0); - var idx = 0; - var range = new Array(length); + var range = Array(length); - while(idx < length) { - range[idx++] = start; - start += step; + for (var idx = 0; idx < length; idx++, start += step) { + range[idx] = start; } return range; @@ -602,7 +638,7 @@ // ------------------ // Reusable constructor function for prototype setting. - var ctor = function(){}; + 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 @@ -610,17 +646,18 @@ _.bind = function(func, context) { var args, bound; if (nativeBind && func.bind === nativeBind) return nativeBind.apply(func, slice.call(arguments, 1)); - if (!_.isFunction(func)) throw new TypeError; + if (!_.isFunction(func)) throw new TypeError('Bind must be called on a function'); args = slice.call(arguments, 2); - return bound = function() { + 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; + Ctor.prototype = func.prototype; + var self = new Ctor; + Ctor.prototype = null; var result = func.apply(self, args.concat(slice.call(arguments))); - if (Object(result) === result) return result; + if (_.isObject(result)) return result; return self; }; + return bound; }; // Partially apply a function by creating a version that has had some of its @@ -643,27 +680,34 @@ // 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) throw new Error('bindAll must be passed function names'); - 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 @@ -681,12 +725,12 @@ var context, args, result; var timeout = null; var previous = 0; - options || (options = {}); + if (!options) options = {}; var later = function() { previous = options.leading === false ? 0 : _.now(); timeout = null; result = func.apply(context, args); - context = args = null; + if (!timeout) context = args = null; }; return function() { var now = _.now(); @@ -694,12 +738,12 @@ 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); - context = args = null; + if (!timeout) context = args = null; } else if (!timeout && options.trailing !== false) { timeout = setTimeout(later, remaining); } @@ -716,13 +760,14 @@ var later = function() { var last = _.now() - timestamp; - if (last < wait) { + + if (last < wait && last > 0) { timeout = setTimeout(later, wait - last); } else { timeout = null; if (!immediate) { result = func.apply(context, args); - context = args = null; + if (!timeout) context = args = null; } } }; @@ -732,9 +777,7 @@ args = arguments; timestamp = _.now(); var callNow = immediate && !timeout; - if (!timeout) { - timeout = setTimeout(later, wait); - } + if (!timeout) timeout = setTimeout(later, wait); if (callNow) { result = func.apply(context, args); context = args = null; @@ -744,19 +787,6 @@ }; }; - // 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. @@ -764,16 +794,23 @@ return _.partial(wrapper, func); }; + // Returns a negated version of the passed-in predicate. + _.negate = function(predicate) { + return function() { + 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; }; }; @@ -786,6 +823,23 @@ }; }; + // 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 // ---------------- @@ -803,7 +857,7 @@ _.values = function(obj) { var keys = _.keys(obj); var length = keys.length; - var values = new Array(length); + var values = Array(length); for (var i = 0; i < length; i++) { values[i] = obj[keys[i]]; } @@ -814,7 +868,7 @@ _.pairs = function(obj) { var keys = _.keys(obj); var length = keys.length; - var pairs = new Array(length); + var pairs = Array(length); for (var i = 0; i < length; i++) { pairs[i] = [keys[i], obj[keys[i]]]; } @@ -843,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] === void 0) 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; }; @@ -903,7 +974,7 @@ 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; + 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. @@ -911,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 @@ -942,25 +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 && !(_.isFunction(aCtor) && (aCtor instanceof aCtor) && - _.isFunction(bCtor) && (bCtor instanceof bCtor)) - && ('constructor' in a && 'constructor' in b)) { + 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--) { @@ -969,21 +1042,17 @@ } } else { // Deep compare objects. - for (var key in a) { - if (_.has(a, key)) { - // Count the expected number of properties. - size++; - // Deep compare each member. + 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) { + while (size--) { + // Deep compare each member + key = keys[size]; 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(); @@ -1000,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; }; @@ -1013,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 + ']'; }; }); @@ -1032,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; }; } @@ -1050,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? @@ -1071,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 @@ -1084,17 +1154,19 @@ 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 function() { return value; }; }; + _.noop = function(){}; + _.property = function(key) { return function(obj) { return obj[key]; @@ -1103,20 +1175,23 @@ // 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 === attrs) return true; //avoid comparing an object to itself. - for (var key in attrs) { - if (attrs[key] !== obj[key]) - return false; + 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) { + _.times = function(n, iteratee, context) { var accum = Array(Math.max(0, n)); - for (var i = 0; i < n; i++) accum[i] = iterator.call(context, i); + iteratee = createCallback(iteratee, context, 1); + for (var i = 0; i < n; i++) accum[i] = iteratee(i); return accum; }; @@ -1130,54 +1205,44 @@ }; // A (possibly faster) way to get the current timestamp as an integer. - _.now = Date.now || function() { return new Date().getTime(); }; - - // List of HTML entities for escaping. - var entityMap = { - escape: { - '&': '&', - '<': '<', - '>': '>', - '"': '"', - "'": ''' - } + _.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 with the // `object` as context; otherwise, return it. _.result = function(object, property) { 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). @@ -1208,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 @@ -1233,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"; @@ -1255,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 @@ -1291,42 +1361,44 @@ 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; - } - - }); + // 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 @@ -1340,4 +1412,4 @@ return _; }); } -}).call(this); +}.call(this)); diff --git a/node_modules/jsdoc/node_modules/wrench/.npmignore b/node_modules/jsdoc/node_modules/wrench/.npmignore index 93f1361..05ade97 100644 --- a/node_modules/jsdoc/node_modules/wrench/.npmignore +++ b/node_modules/jsdoc/node_modules/wrench/.npmignore @@ -1,2 +1,3 @@ node_modules npm-debug.log +.idea diff --git a/node_modules/jsdoc/node_modules/wrench/lib/wrench.js b/node_modules/jsdoc/node_modules/wrench/lib/wrench.js index 00f4166..01f5e95 100644 --- a/node_modules/jsdoc/node_modules/wrench/lib/wrench.js +++ b/node_modules/jsdoc/node_modules/wrench/lib/wrench.js @@ -12,8 +12,8 @@ */ var fs = require("fs"), - _path = require("path"); - + _path = require("path"), + isWindows = !!process.platform.match(/^win/); /* wrench.readdirSyncRecursive("directory_path"); * @@ -28,7 +28,7 @@ exports.readdirSyncRecursive = function(baseDir) { curFiles, nextDirs, isDir = function(fname){ - return fs.statSync( _path.join(baseDir, fname) ).isDirectory(); + return fs.existsSync(_path.join(baseDir, fname)) ? fs.statSync( _path.join(baseDir, fname) ).isDirectory() : false; }, prependBaseDir = function(fname){ return _path.join(baseDir, fname); @@ -71,15 +71,16 @@ exports.readdirRecursive = function(baseDir, fn) { var waitCount = 0; function readdirRecursive(curDir) { - var files = [], - curFiles, - nextDirs, - prependcurDir = function(fname){ - return _path.join(curDir, fname); - }; + var prependcurDir = function(fname){ + return _path.join(curDir, fname); + }; waitCount++; fs.readdir(curDir, function(e, curFiles) { + if (e) { + fn(e); + return; + } waitCount--; curFiles = curFiles.map(prependcurDir); @@ -120,7 +121,9 @@ exports.readdirRecursive = function(baseDir, fn) { -/* wrench.rmdirSyncRecursive("directory_path", forceDelete, failSilent); + + +/* wrench.rmdirSyncRecursive("directory_path", failSilent); * * Recursively dives through directories and obliterates everything about it. This is a * Sync-function, which blocks things until it's done. No idea why anybody would want an @@ -132,44 +135,110 @@ exports.rmdirSyncRecursive = function(path, failSilent) { try { files = fs.readdirSync(path); } catch (err) { + if(failSilent) return; throw new Error(err.message); } /* Loop through and delete everything in the sub-tree after checking it */ for(var i = 0; i < files.length; i++) { - var currFile = fs.lstatSync(path + "/" + files[i]); + var file = _path.join(path, files[i]); + var currFile = fs.lstatSync(file); - if(currFile.isDirectory()) // Recursive function back to the beginning - exports.rmdirSyncRecursive(path + "/" + files[i]); + if(currFile.isDirectory()) { + // Recursive function back to the beginning + exports.rmdirSyncRecursive(file); + } else if(currFile.isSymbolicLink()) { + // Unlink symlinks + if (isWindows) { + fs.chmodSync(file, 666) // Windows needs this unless joyent/node#3006 is resolved.. + } - else if(currFile.isSymbolicLink()) // Unlink symlinks - fs.unlinkSync(path + "/" + files[i]); + fs.unlinkSync(file); + } else { + // Assume it's a file - perhaps a try/catch belongs here? + if (isWindows) { + fs.chmodSync(file, 666) // Windows needs this unless joyent/node#3006 is resolved.. + } - else // Assume it's a file - perhaps a try/catch belongs here? - fs.unlinkSync(path + "/" + files[i]); + fs.unlinkSync(file); + } } /* Now that we know everything in the sub-tree has been deleted, we can delete the main - directory. Huzzah for the shopkeep. */ + directory. Huzzah for the shopkeep. */ return fs.rmdirSync(path); }; + + +function isFileIncluded(opts, dir, filename) { + + function isMatch(filter) { + if (typeof filter === 'function') { + return filter(filename, dir) === true; + } + else { + // Maintain backwards compatibility and use just the filename + return filename.match(filter); + } + } + + if (opts.include || opts.exclude) { + if (opts.exclude) { + if (isMatch(opts.exclude)) { + return false; + } + } + + if (opts.include) { + if (isMatch(opts.include)) { + return true; + } + else { + return false; + } + } + + return true; + } + else if (opts.filter) { + var filter = opts.filter; + + if (!opts.whitelist) { + // if !opts.whitelist is false every file or directory + // which does match opts.filter will be ignored + return isMatch(filter) ? false : true; + } else { + // if opts.whitelist is true every file or directory + // which doesn't match opts.filter will be ignored + return !isMatch(filter) ? false : true; + } + } + + return true; +} + /* wrench.copyDirSyncRecursive("directory_to_copy", "new_directory_location", opts); * * Recursively dives through a directory and moves all its files to a new location. This is a * Synchronous function, which blocks things until it's done. If you need/want to do this in - * an Asynchronous manner, look at wrench.copyDirRecursively() below. + * an Asynchronous manner, look at wrench.copyDirRecursively() below. Specify forceDelete to force directory overwrite. * * Note: Directories should be passed to this function without a trailing slash. */ exports.copyDirSyncRecursive = function(sourceDir, newDirLocation, opts) { + opts = opts || {}; - if (!opts || !opts.preserve) { - try { - if(fs.statSync(newDirLocation).isDirectory()) exports.rmdirSyncRecursive(newDirLocation); - } catch(e) { } - } + try { + if(fs.statSync(newDirLocation).isDirectory()) { + if(opts.forceDelete) { + exports.rmdirSyncRecursive(newDirLocation); + } else { + return new Error('You are trying to delete a directory that already exists. Specify forceDelete in the opts argument to override this. Bailing~'); + } + } + } catch(e) { } /* Create the directory where all our junk is moving to; read the mode of the source directory and mirror it */ var checkDir = fs.statSync(sourceDir); @@ -181,20 +250,58 @@ exports.copyDirSyncRecursive = function(sourceDir, newDirLocation, opts) { } var files = fs.readdirSync(sourceDir); + var hasFilter = opts.filter || opts.include || opts.exclude; + var preserveFiles = opts.preserveFiles === true; + var preserveTimestamps = opts.preserveTimestamps === true; for(var i = 0; i < files.length; i++) { - var currFile = fs.lstatSync(sourceDir + "/" + files[i]); + // ignores all files or directories which match the RegExp in opts.filter + if(typeof opts !== 'undefined') { + if (hasFilter) { + if (!isFileIncluded(opts, sourceDir, files[i])) { + continue; + } + } + + if (opts.excludeHiddenUnix && /^\./.test(files[i])) continue; + } + + var currFile = fs.lstatSync(_path.join(sourceDir, files[i])); + + var fCopyFile = function(srcFile, destFile) { + if(typeof opts !== 'undefined' && opts.preserveFiles && fs.existsSync(destFile)) return; + + var contents = fs.readFileSync(srcFile); + fs.writeFileSync(destFile, contents); + var stat = fs.lstatSync(srcFile); + fs.chmodSync(destFile, stat.mode); + if (preserveTimestamps) { + fs.utimesSync(destFile, stat.atime, stat.mtime) + } + }; if(currFile.isDirectory()) { /* recursion this thing right on back. */ - exports.copyDirSyncRecursive(sourceDir + "/" + files[i], newDirLocation + "/" + files[i], opts); + exports.copyDirSyncRecursive(_path.join(sourceDir, files[i]), _path.join(newDirLocation, files[i]), opts); } else if(currFile.isSymbolicLink()) { - var symlinkFull = fs.readlinkSync(sourceDir + "/" + files[i]); - fs.symlinkSync(symlinkFull, newDirLocation + "/" + files[i]); + var symlinkFull = fs.readlinkSync(_path.join(sourceDir, files[i])); + symlinkFull = _path.resolve(fs.realpathSync(sourceDir), symlinkFull); + + if (typeof opts !== 'undefined' && !opts.inflateSymlinks) { + fs.symlinkSync(symlinkFull, _path.join(newDirLocation, files[i])); + continue; + } + + var tmpCurrFile = fs.lstatSync(symlinkFull); + if (tmpCurrFile.isDirectory()) { + exports.copyDirSyncRecursive(symlinkFull, _path.join(newDirLocation, files[i]), opts); + } else { + /* At this point, we've hit a file actually worth copying... so copy it on over. */ + fCopyFile(symlinkFull, _path.join(newDirLocation, files[i])); + } } else { /* At this point, we've hit a file actually worth copying... so copy it on over. */ - var contents = fs.readFileSync(sourceDir + "/" + files[i]); - fs.writeFileSync(newDirLocation + "/" + files[i], contents); + fCopyFile(_path.join(sourceDir, files[i]), _path.join(newDirLocation, files[i])); } } }; @@ -210,14 +317,14 @@ exports.chmodSyncRecursive = function(sourceDir, filemode) { var files = fs.readdirSync(sourceDir); for(var i = 0; i < files.length; i++) { - var currFile = fs.lstatSync(sourceDir + "/" + files[i]); + var currFile = fs.lstatSync(_path.join(sourceDir, files[i])); if(currFile.isDirectory()) { /* ...and recursion this thing right on back. */ - exports.chmodSyncRecursive(sourceDir + "/" + files[i], filemode); + exports.chmodSyncRecursive(_path.join(sourceDir, files[i]), filemode); } else { /* At this point, we've hit a file actually worth copying... so copy it on over. */ - fs.chmod(sourceDir + "/" + files[i], filemode); + fs.chmod(_path.join(sourceDir, files[i]), filemode); } } @@ -237,14 +344,14 @@ exports.chownSyncRecursive = function(sourceDir, uid, gid) { var files = fs.readdirSync(sourceDir); for(var i = 0; i < files.length; i++) { - var currFile = fs.lstatSync(sourceDir + "/" + files[i]); + var currFile = fs.lstatSync(_path.join(sourceDir, files[i])); if(currFile.isDirectory()) { /* ...and recursion this thing right on back. */ - exports.chownSyncRecursive(sourceDir + "/" + files[i], uid, gid); + exports.chownSyncRecursive(_path.join(sourceDir, files[i]), uid, gid); } else { /* At this point, we've hit a file actually worth chowning... so own it. */ - fs.chownSync(sourceDir + "/" + files[i], uid, gid); + fs.chownSync(_path.join(sourceDir, files[i]), uid, gid); } } @@ -258,9 +365,17 @@ exports.chownSyncRecursive = function(sourceDir, uid, gid) { * * Recursively dives through directories and obliterates everything about it. */ -exports.rmdirRecursive = function rmdirRecursive(dir, clbk){ - fs.readdir(dir, function(err, files){ - if (err) return clbk(err); +exports.rmdirRecursive = function rmdirRecursive(dir, failSilent, clbk){ + if(clbk === null || typeof clbk == 'undefined') + clbk = function(err) {}; + + fs.readdir(dir, function(err, files) { + if(err && typeof failSilent === 'boolean' && !failSilent) + return clbk(err); + + if(typeof failSilent === 'function') + clbk = failSilent; + (function rmFile(err){ if (err) return clbk(err); @@ -269,7 +384,7 @@ exports.rmdirRecursive = function rmdirRecursive(dir, clbk){ return fs.rmdir(dir, clbk); var file = dir+'/'+filename; - fs.stat(file, function(err, stat){ + fs.lstat(file, function(err, stat){ if (err) return clbk(err); if (stat.isDirectory()) rmdirRecursive(file, rmFile); @@ -280,18 +395,30 @@ exports.rmdirRecursive = function rmdirRecursive(dir, clbk){ }); }; -/* wrench.copyDirRecursive("directory_to_copy", "new_location", callback); +/* wrench.copyDirRecursive("directory_to_copy", "new_location", {forceDelete: bool}, callback); * * Recursively dives through a directory and moves all its files to a new - * location. + * location. Specify forceDelete to force directory overwrite. * * Note: Directories should be passed to this function without a trailing slash. */ -exports.copyDirRecursive = function copyDirRecursive(srcDir, newDir, clbk) { - fs.stat(newDir, function(err, newDirStat){ - if (!err) return exports.rmdirRecursive(newDir, function(err){ - copyDirRecursive(srcDir, newDir, clbk); - }); +exports.copyDirRecursive = function copyDirRecursive(srcDir, newDir, opts, clbk) { + var originalArguments = Array.prototype.slice.apply(arguments); + srcDir = _path.normalize(srcDir); + newDir = _path.normalize(newDir); + + fs.stat(newDir, function(err, newDirStat) { + if(!err) { + if(typeof opts !== 'undefined' && typeof opts !== 'function' && opts.forceDelete) + return exports.rmdirRecursive(newDir, function(err) { + copyDirRecursive.apply(this, originalArguments); + }); + else + return clbk(new Error('You are trying to delete a directory that already exists. Specify forceDelete in an options object to override this.')); + } + + if(typeof opts === 'function') + clbk = opts; fs.stat(srcDir, function(err, srcDirStat){ if (err) return clbk(err); @@ -304,20 +431,23 @@ exports.copyDirRecursive = function copyDirRecursive(srcDir, newDir, clbk) { var filename = files.shift(); if (filename === null || typeof filename == 'undefined') - return clbk(); + return clbk(null); var file = srcDir+'/'+filename, newFile = newDir+'/'+filename; fs.stat(file, function(err, fileStat){ + if (err) return clbk(err); if (fileStat.isDirectory()) - copyDirRecursive(file, newFile, copyFiles); + copyDirRecursive(file, newFile, copyFiles, clbk); else if (fileStat.isSymbolicLink()) fs.readlink(file, function(err, link){ + if (err) return clbk(err); fs.symlink(link, newFile, copyFiles); }); else fs.readFile(file, function(err, data){ + if (err) return clbk(err); fs.writeFile(newFile, data, copyFiles); }); }); @@ -330,15 +460,13 @@ exports.copyDirRecursive = function copyDirRecursive(srcDir, newDir, clbk) { var mkdirSyncRecursive = function(path, mode) { var self = this; + path = _path.normalize(path) try { fs.mkdirSync(path, mode); } catch(err) { if(err.code == "ENOENT") { - var slashIdx = path.lastIndexOf("/"); - if(slashIdx < 0) { - slashIdx = path.lastIndexOf("\\"); - } + var slashIdx = path.lastIndexOf(_path.sep); if(slashIdx > 0) { var parentPath = path.substring(0, slashIdx); @@ -364,6 +492,10 @@ exports.LineReader = function(filename, bufferSize) { }; exports.LineReader.prototype = { + close: function() { + return fs.closeSync(this.fd); + }, + getBufferAndSetCurrentPosition: function(position) { var res = fs.readSync(this.fd, this.bufferSize, position, "ascii"); @@ -383,13 +515,13 @@ exports.LineReader.prototype = { if(this.currentPosition === -1) return false; } - if(this.buffer.indexOf("\n") > -1) return true; + if(this.buffer.indexOf("\n") > -1 || this.buffer.length !== 0) return true; return false; }, getNextLine: function() { var lineEnd = this.buffer.indexOf("\n"), - result = this.buffer.substring(0, lineEnd); + result = this.buffer.substring(0, lineEnd != -1 ? lineEnd : this.buffer.length); this.buffer = this.buffer.substring(result.length + 1, this.buffer.length); return result; diff --git a/node_modules/jsdoc/node_modules/wrench/lib/x.js b/node_modules/jsdoc/node_modules/wrench/lib/x.js deleted file mode 100644 index 3ddffd6..0000000 --- a/node_modules/jsdoc/node_modules/wrench/lib/x.js +++ /dev/null @@ -1 +0,0 @@ -require('./wrench').mkdirsSyncRecursive('x/lol/b', 777); diff --git a/node_modules/jsdoc/node_modules/wrench/package.json b/node_modules/jsdoc/node_modules/wrench/package.json index c3ad49b..02745c3 100644 --- a/node_modules/jsdoc/node_modules/wrench/package.json +++ b/node_modules/jsdoc/node_modules/wrench/package.json @@ -1,14 +1,14 @@ { "name": "wrench", "description": "Recursive filesystem (and other) operations that Node *should* have.", - "version": "1.3.9", + "version": "1.5.8", "author": { "name": "Ryan McGrath", "email": "ryan@venodesigns.net" }, "repository": { "type": "git", - "url": "git://github.com/ryanmcgrath/wrench-js.git" + "url": "https://ryanmcgrath@github.com/ryanmcgrath/wrench-js.git" }, "bugs": { "url": "http://github.com/ryanmcgrath/wrench-js/issues" @@ -33,29 +33,25 @@ "url": "http://github.com/ryanmcgrath/wrench-js/raw/master/LICENSE" } ], + "homepage": "https://github.com/ryanmcgrath/wrench-js", + "_id": "wrench@1.5.8", + "dist": { + "shasum": "7a31c97f7869246d76c5cf2f5c977a1c4c8e5ab5", + "tarball": "http://registry.npmjs.org/wrench/-/wrench-1.5.8.tgz" + }, + "_from": "wrench@>=1.5.8 <1.6.0", + "_npmVersion": "1.3.21", "_npmUser": { "name": "ryanmcgrath", "email": "ryan@venodesigns.net" }, - "_id": "wrench@1.3.9", - "optionalDependencies": {}, - "_engineSupported": true, - "_npmVersion": "1.1.12", - "_nodeVersion": "v0.6.14", - "_defaultsLoaded": true, - "dist": { - "shasum": "6f13ec35145317eb292ca5f6531391b244111411", - "tarball": "http://registry.npmjs.org/wrench/-/wrench-1.3.9.tgz" - }, "maintainers": [ { "name": "ryanmcgrath", "email": "ryan@venodesigns.net" } ], - "_shasum": "6f13ec35145317eb292ca5f6531391b244111411", - "_from": "wrench@~1.3.9", - "_resolved": "https://registry.npmjs.org/wrench/-/wrench-1.3.9.tgz", - "readme": "ERROR: No README data found!", - "homepage": "https://github.com/ryanmcgrath/wrench-js" + "_shasum": "7a31c97f7869246d76c5cf2f5c977a1c4c8e5ab5", + "_resolved": "https://registry.npmjs.org/wrench/-/wrench-1.5.8.tgz", + "readme": "ERROR: No README data found!" } diff --git a/node_modules/jsdoc/node_modules/wrench/readme.md b/node_modules/jsdoc/node_modules/wrench/readme.md index 393e3da..2d646d0 100644 --- a/node_modules/jsdoc/node_modules/wrench/readme.md +++ b/node_modules/jsdoc/node_modules/wrench/readme.md @@ -8,6 +8,29 @@ That said, here's my attempt at a re-usable solution, at least until something more formalized gets integrated into Node.js (*hint hint*). wrench.js is fairly simple to use - check out the documentation/examples below: +Possibly Breaking Change in v1.5.0 +----------------------------------------------------------------------------- +In previous versions of Wrench, we went against the OS-default behavior of not +deleting a directory unless the operation is forced. In 1.5.0, this has been +changed to be the behavior people expect there to be - if you try to copy over +a directory that already exists, you'll get an Error returned or thrown stating +that you need to force it. + +Something like this will do the trick: + +``` javascript +wrench.copyDirSyncRecursive('directory_to_copy', 'location_where_copy_should_end_up', { + forceDelete: true +}); +``` + +If you desire the older behavior of Wrench... hit up your package.json. If you +happen to find bugs in the 1.5.0 release please feel free to file them on the +GitHub issues tracker for this project, or send me a pull request and I'll get to +it as fast as I can. Thanks! + +**If this breaks enough projects I will consider rolling it back. Please hit me up if this seems to be the case.** + Installation ----------------------------------------------------------------------------- @@ -38,13 +61,31 @@ wrench.chmodSyncRecursive('my_directory_name', 0755); wrench.chownSyncRecursive("directory", uid, gid); // Deep-copy an existing directory -wrench.copyDirSyncRecursive('directory_to_copy', 'location_where_copy_should_end_up'); +wrench.copyDirSyncRecursive('directory_to_copy', 'location_where_copy_should_end_up', { + forceDelete: bool, // Whether to overwrite existing directory or not + excludeHiddenUnix: bool, // Whether to copy hidden Unix files or not (preceding .) + preserveFiles: bool, // If we're overwriting something and the file already exists, keep the existing + preserveTimestamps: bool, // Preserve the mtime and atime when copying files + inflateSymlinks: bool, // Whether to follow symlinks or not when copying files + filter: regexpOrFunction, // A filter to match files against; if matches, do nothing (exclude). + whitelist: bool, // if true every file or directory which doesn't match filter will be ignored + include: regexpOrFunction, // An include filter (either a regexp or a function) + exclude: regexpOrFunction // An exclude filter (either a regexp or a function) +}); + +// Note: If a RegExp is provided then then it will be matched against the filename. If a function is +// provided then the signature should be the following: +// function(filename, dir) { return result; } // Read lines in from a file until you hit the end var f = new wrench.LineReader('x.txt'); while(f.hasNextLine()) { - util.puts(x.getNextLine()); + util.puts(f.getNextLine()); } + +// Note: You will need to close that above line reader at some point, otherwise +// you will run into a "too many open files" error. f.close() or fs.closeSync(f.fd) are +// your friends, as only you know when it is safe to close. ``` ### Asynchronous operations @@ -55,6 +96,8 @@ wrench.readdirRecursive('my_directory_name', function(error, curFiles) { // curFiles is what you want }); +// If you're feeling somewhat masochistic +wrench.copyDirRecursive(srcDir, newDir, {forceDelete: bool /* See sync version */}, callbackfn); ``` Questions, comments? Hit me up. (ryan [at] venodesigns.net | http://twitter.com/ryanmcgrath) diff --git a/node_modules/jsdoc/node_modules/wrench/tests/copydirsync_unix.js b/node_modules/jsdoc/node_modules/wrench/tests/copydirsync_unix.js new file mode 100644 index 0000000..c48bb62 --- /dev/null +++ b/node_modules/jsdoc/node_modules/wrench/tests/copydirsync_unix.js @@ -0,0 +1,242 @@ +var testCase = require('nodeunit').testCase; +var fs = require('fs'); +var wrench = require('../lib/wrench'); +var path = require('path'); + +function checkResultHidden(test, files) { + var check = [ + '.hidden', + '.hidden.txt', + 'bar.txt', + 'foo', + path.join('.hidden', 'dolor.md'), + path.join('foo', 'bar'), + path.join('foo', 'dolor.md'), + path.join('foo', 'lorem.txt'), + path.join('foo', 'bar', 'ipsum.js') + ]; + + test.deepEqual(files, check); +} + +function checkResultShown(test, files) { + var check = [ + 'bar.txt', + 'foo', + path.join('foo', 'bar'), + path.join('foo', 'dolor.md'), + path.join('foo', 'lorem.txt'), + path.join('foo', 'bar', 'ipsum.js') + ]; + + test.deepEqual(files, check); +} + +function checkResultInflate(test, files) { + var check = [ + '.hidden', + 'bar.txt', + 'test', + path.join('.hidden', 'dolor.md') + ]; + + test.deepEqual(files, check); + + test.deepEqual(fs.lstatSync(path.join(__dirname, 'testdir/.hidden')).isSymbolicLink(), false); + test.deepEqual(fs.lstatSync(path.join(__dirname, 'testdir/bar.txt')).isSymbolicLink(), false); +} + +function checkResultInflateAbsolute(test, files) { + var check = [ + '.hidden', + 'absolute-bar.txt', + 'bar.txt', + 'test', + path.join('.hidden', 'dolor.md') + ]; + + test.deepEqual(files, check); + + test.deepEqual(fs.lstatSync(path.join(__dirname, 'testdir/.hidden')).isSymbolicLink(), false); + test.deepEqual(fs.lstatSync(path.join(__dirname, 'testdir/bar.txt')).isSymbolicLink(), false); +} + +function checkResultDontInflate(test, files) { + var check = [ + '.hidden', + 'bar.txt', + 'test', + path.join('.hidden', 'dolor.md') + ]; + + test.deepEqual(files, check); + + test.deepEqual(fs.lstatSync(path.join(__dirname, 'testdir/.hidden')).isSymbolicLink(), true); + test.deepEqual(fs.lstatSync(path.join(__dirname, 'testdir/bar.txt')).isSymbolicLink(), true); +} + +function checkResultPreserveFiles(test, files) { + checkResultHidden(test, files); + var contents = fs.readFileSync(path.join(__dirname, path.join('testdir2', '.hidden.txt')), "utf8"); + test.deepEqual(contents, 'hidden file'); + contents = fs.readFileSync(path.join(__dirname, path.join('testdir2', 'bar.txt')), "utf8"); + test.deepEqual(contents, 'shown file'); +} + +function checkResultOverwriteFiles(test, files) { + checkResultHidden(test, files); + var contents = fs.readFileSync(path.join(__dirname, path.join('testdir2', '.hidden.txt')), "utf8"); + test.deepEqual(contents, 'just some text for .hidden.txt'); + contents = fs.readFileSync(path.join(__dirname, path.join('testdir2', 'bar.txt')), "utf8"); + test.deepEqual(contents, 'just some text for bar.txt'); +} + +module.exports = testCase({ + test_copyDirSyncRecursiveWithoutOptions: function(test) { + var dir = path.join(__dirname, 'shown'); + var testdir = path.join(__dirname, 'testdir'); + + wrench.copyDirSyncRecursive(dir, testdir); + + wrench.rmdirSyncRecursive(testdir); + test.done(); + }, + test_copyDirSyncRecursiveHidden: function(test) { + var dir = path.join(__dirname, 'shown'); + var testdir = path.join(__dirname, 'testdir'); + + test.ok(fs.existsSync(dir), 'Folders should exist'); + + wrench.copyDirSyncRecursive(dir, testdir, { excludeHiddenUnix: false }); + + var files = wrench.readdirSyncRecursive(testdir); + + checkResultHidden(test, files); + + wrench.rmdirSyncRecursive(testdir); + + test.done(); + }, + test_copyDirSyncRecursiveShown: function(test) { + var dir = path.join(__dirname, 'shown'); + var testdir = path.join(__dirname, 'testdir'); + + test.ok(fs.existsSync(dir), 'Folders should exist'); + + wrench.copyDirSyncRecursive(dir, testdir, { excludeHiddenUnix: true }); + + var files = wrench.readdirSyncRecursive(testdir); + + checkResultShown(test, files); + + wrench.rmdirSyncRecursive(testdir); + + test.done(); + }, + test_copyDirSyncRecursiveInflate: function(test) { + var dir = path.join(__dirname, 'withsymlinks'); + var testdir = path.join(__dirname, 'testdir'); + + test.ok(fs.existsSync(dir), 'Folders should exist'); + + wrench.copyDirSyncRecursive(dir, testdir, { excludeHiddenUnix: false, inflateSymlinks: true }); + + var files = wrench.readdirSyncRecursive(testdir); + + checkResultInflate(test, files); + + wrench.rmdirSyncRecursive(testdir); + + test.done(); + }, + test_copyDirSyncRecursiveInflateAbsoluteSymlinks: function(test) { + var dir = path.join(__dirname, 'withsymlinks'); + var testdir = path.join(__dirname, 'testdir'); + + fs.symlinkSync( + path.resolve(__dirname, 'shown/bar.txt'), + path.join(dir, 'absolute-bar.txt') + ); + + wrench.mkdirSyncRecursive(testdir, 0777); + wrench.copyDirSyncRecursive(dir, testdir, { forceDelete: true, excludeHiddenUnix: false, inflateSymlinks: true }); + + var files = wrench.readdirSyncRecursive(testdir); + + checkResultInflateAbsolute(test, files); + + wrench.rmdirSyncRecursive(testdir); + fs.unlinkSync(path.join(dir, 'absolute-bar.txt')); + + test.done(); + }, + test_copyDirSyncRecursiveDontInflate: function(test) { + var dir = path.join(__dirname, 'withsymlinks'); + var testdir = path.join(__dirname, 'testdir'); + + test.ok(fs.existsSync(dir), 'Folders should exist'); + + wrench.copyDirSyncRecursive(dir, testdir, { excludeHiddenUnix: false, inflateSymlinks: false }); + + var files = wrench.readdirSyncRecursive(testdir); + + checkResultDontInflate(test, files); + + wrench.rmdirSyncRecursive(testdir); + + test.done(); + }, + test_copyDirSyncRecursivePreserveFiles: function(test) { + var dir = path.join(__dirname, 'shown'), + testdir1 = path.join(__dirname, 'testdir1'), + testdir2 = path.join(__dirname, 'testdir2'); + + test.ok(fs.existsSync(dir), 'Folders should exist'); + + // wrench.mkdirSyncRecursive(testdir1, 0777); + wrench.copyDirSyncRecursive(dir, testdir1, { excludeHiddenUnix: false }); + wrench.copyDirSyncRecursive(dir, testdir2, { excludeHiddenUnix: false }); + + fs.writeFileSync(path.join(testdir1, ".hidden.txt"), 'just some text for .hidden.txt'); + fs.writeFileSync(path.join(testdir1, "bar.txt"), 'just some text for bar.txt'); + + wrench.copyDirSyncRecursive(testdir1, testdir2, { excludeHiddenUnix: false, preserveFiles: true }); + + var files = wrench.readdirSyncRecursive(testdir2); + + checkResultPreserveFiles(test, files); + + wrench.rmdirSyncRecursive(testdir1); + wrench.rmdirSyncRecursive(testdir2); + + test.done(); + }, + test_copyDirSyncRecursiveOverwriteFiles: function(test) { + var dir = path.join(__dirname, 'shown'), + testdir1 = path.join(__dirname, 'testdir1'), + testdir2 = path.join(__dirname, 'testdir2'); + + test.ok(fs.existsSync(dir), 'Folders should exist'); + + // wrench.mkdirSyncRecursive(testdir1, 0777); + wrench.copyDirSyncRecursive(dir, testdir1, { excludeHiddenUnix: false }); + wrench.copyDirSyncRecursive(dir, testdir2, { excludeHiddenUnix: false }); + + fs.writeFileSync(path.join(testdir1, ".hidden.txt"), 'just some text for .hidden.txt'); + fs.writeFileSync(path.join(testdir1, "bar.txt"), 'just some text for bar.txt'); + + wrench.copyDirSyncRecursive(testdir1, testdir2, { forceDelete: true, excludeHiddenUnix: false, preserveFiles: false }); + + var files = wrench.readdirSyncRecursive(testdir2); + + checkResultOverwriteFiles(test, files); + + wrench.rmdirSyncRecursive(testdir1); + wrench.rmdirSyncRecursive(testdir2); + + test.done(); + } + +}); + +// vim: et ts=4 sw=4 diff --git a/node_modules/jsdoc/node_modules/wrench/tests/mkdir.js b/node_modules/jsdoc/node_modules/wrench/tests/mkdir.js index e728516..933887b 100644 --- a/node_modules/jsdoc/node_modules/wrench/tests/mkdir.js +++ b/node_modules/jsdoc/node_modules/wrench/tests/mkdir.js @@ -7,11 +7,11 @@ module.exports = testCase({ test_mkdirSyncRecursive: function(test) { var dir = __dirname + '/_tmp/foo/bar'; - test.equals(path.existsSync(dir), false, 'Dir shouldn\'t exist - clean it up manually?'); + test.equals(fs.existsSync(dir), false, 'Dir shouldn\'t exist - clean it up manually?'); wrench.mkdirSyncRecursive(dir, 0777); - test.equals(path.existsSync(dir), true, 'Dir should exist now'); + test.equals(fs.existsSync(dir), true, 'Dir should exist now'); // clean up while (dir != __dirname) { diff --git a/node_modules/jsdoc/node_modules/wrench/tests/readdir.js b/node_modules/jsdoc/node_modules/wrench/tests/readdir.js index c314229..5e8abf0 100644 --- a/node_modules/jsdoc/node_modules/wrench/tests/readdir.js +++ b/node_modules/jsdoc/node_modules/wrench/tests/readdir.js @@ -23,7 +23,7 @@ module.exports = testCase({ test_readdirSyncRecursive: function(test) { var dir = path.join(__dirname, 'readdir'); - test.ok(path.existsSync(dir), 'Folders should exist'); + test.ok(fs.existsSync(dir), 'Folders should exist'); var files = wrench.readdirSyncRecursive(dir); @@ -33,7 +33,7 @@ module.exports = testCase({ test_readdirRecursive: function(test) { var dir = path.join(__dirname, 'readdir'); - test.ok(path.existsSync(dir), 'Folders should exist'); + test.ok(fs.existsSync(dir), 'Folders should exist'); var allFiles = []; @@ -46,6 +46,15 @@ module.exports = testCase({ checkResult(test, allFiles); } }); + }, + + test_readdirRecursiveWithNonExistentDirectory: function(test) { + wrench.readdirRecursive('', function (e, files) { + test.ok(e); + test.equal(e.code, 'ENOENT'); + test.equal(files, null); + test.done(); + }); } }); diff --git a/node_modules/jsdoc/node_modules/wrench/tests/rmdirSyncRecursive.js b/node_modules/jsdoc/node_modules/wrench/tests/rmdirSyncRecursive.js new file mode 100644 index 0000000..3415e84 --- /dev/null +++ b/node_modules/jsdoc/node_modules/wrench/tests/rmdirSyncRecursive.js @@ -0,0 +1,74 @@ +var testCase = require('nodeunit').testCase; +var fs = require('fs'); +var wrench = require('../lib/wrench'); +var path = require('path'); + +module.exports = testCase({ + test_rmdirSyncRecursive: function(test) { + var dir = __dirname + '/_tmp2/foo/bar'; + + wrench.mkdirSyncRecursive(dir, '777'); + + var f1Path = path.join(dir, 'test1.txt'); + var f2Path = path.join(path.dirname(dir), 'test2.txt'); + var f3Path = path.join(path.dirname(path.dirname(dir)), 'test3.txt'); + + fs.writeFileSync(f1Path, 'foo bar baz'); + fs.writeFileSync(f2Path, 'foo bar baz'); + fs.writeFileSync(f3Path, 'foo bar baz'); + + fs.chmodSync(f1Path, '444'); + fs.chmodSync(f2Path, '444'); + fs.chmodSync(f3Path, '444'); + + test.equals(fs.existsSync(dir), true, 'Dir should exist - mkdirSyncRecursive not working?'); + test.equals(fs.existsSync(f1Path), true, 'File should exist'); + test.equals(fs.existsSync(f2Path), true, 'File should exist'); + test.equals(fs.existsSync(f3Path), true, 'File should exist'); + + wrench.rmdirSyncRecursive(dir); + + test.equals(fs.existsSync(dir), false, 'Dir should not exist now...'); + test.equals(fs.existsSync(f1Path), false, 'File should not exist'); + test.equals(fs.existsSync(f2Path), true, 'File should exist'); + test.equals(fs.existsSync(f3Path), true, 'File should exist'); + + wrench.rmdirSyncRecursive(path.dirname(path.dirname(dir))); + + test.done(); + }, + + test_rmdirSyncRecursiveFromRoot: function(test) { + var dir = __dirname + '/_tmp3/foo/bar'; + + wrench.mkdirSyncRecursive(dir, '777'); + + var f1Path = path.join(dir, 'test1.txt'); + var f2Path = path.join(path.dirname(dir), 'test2.txt'); + var f3Path = path.join(path.dirname(path.dirname(dir)), 'test3.txt'); + + fs.writeFileSync(f1Path, 'foo bar baz'); + fs.writeFileSync(f2Path, 'foo bar baz'); + fs.writeFileSync(f3Path, 'foo bar baz'); + + fs.chmodSync(f1Path, '444'); + fs.chmodSync(f2Path, '444'); + fs.chmodSync(f3Path, '444'); + + test.equals(fs.existsSync(dir), true, 'Dir should exist - mkdirSyncRecursive not working?'); + test.equals(fs.existsSync(f1Path), true, 'File should exist'); + test.equals(fs.existsSync(f2Path), true, 'File should exist'); + test.equals(fs.existsSync(f3Path), true, 'File should exist'); + + wrench.rmdirSyncRecursive(path.dirname(path.dirname(dir))); + + test.equals(fs.existsSync(dir), false, 'Dir should not exist now...'); + test.equals(fs.existsSync(f1Path), false, 'File should not exist'); + test.equals(fs.existsSync(f2Path), false, 'File should not exist'); + test.equals(fs.existsSync(f3Path), false, 'File should not exist'); + + test.done(); + } +}); + +// vim: et ts=4 sw=4 diff --git a/node_modules/jsdoc/node_modules/wrench/tests/runner.js b/node_modules/jsdoc/node_modules/wrench/tests/runner.js index a5cc8f7..e321a15 100644 --- a/node_modules/jsdoc/node_modules/wrench/tests/runner.js +++ b/node_modules/jsdoc/node_modules/wrench/tests/runner.js @@ -3,5 +3,7 @@ module.exports = { group_mkdir: require('./mkdir'), - group_readdir: require('./readdir') + group_readdir: require('./readdir'), + group_copydir: require('./copydirsync_unix'), + group_rmdir: require('./rmdirSyncRecursive') }; diff --git a/node_modules/jsdoc/node_modules/wrench/tests/shown/.hidden.txt b/node_modules/jsdoc/node_modules/wrench/tests/shown/.hidden.txt new file mode 100644 index 0000000..b96b725 --- /dev/null +++ b/node_modules/jsdoc/node_modules/wrench/tests/shown/.hidden.txt @@ -0,0 +1 @@ +hidden file \ No newline at end of file diff --git a/node_modules/jsdoc/node_modules/wrench/tests/shown/.hidden/dolor.md b/node_modules/jsdoc/node_modules/wrench/tests/shown/.hidden/dolor.md new file mode 100644 index 0000000..e69de29 diff --git a/node_modules/jsdoc/node_modules/wrench/tests/shown/bar.txt b/node_modules/jsdoc/node_modules/wrench/tests/shown/bar.txt new file mode 100644 index 0000000..3d36c5c --- /dev/null +++ b/node_modules/jsdoc/node_modules/wrench/tests/shown/bar.txt @@ -0,0 +1 @@ +shown file \ No newline at end of file diff --git a/node_modules/jsdoc/node_modules/wrench/tests/shown/foo/bar/ipsum.js b/node_modules/jsdoc/node_modules/wrench/tests/shown/foo/bar/ipsum.js new file mode 100644 index 0000000..e69de29 diff --git a/node_modules/jsdoc/node_modules/wrench/tests/shown/foo/dolor.md b/node_modules/jsdoc/node_modules/wrench/tests/shown/foo/dolor.md new file mode 100644 index 0000000..e69de29 diff --git a/node_modules/jsdoc/node_modules/wrench/tests/shown/foo/lorem.txt b/node_modules/jsdoc/node_modules/wrench/tests/shown/foo/lorem.txt new file mode 100644 index 0000000..e69de29 diff --git a/node_modules/jsdoc/node_modules/wrench/tests/withsymlinks/test b/node_modules/jsdoc/node_modules/wrench/tests/withsymlinks/test new file mode 100644 index 0000000..dba6882 --- /dev/null +++ b/node_modules/jsdoc/node_modules/wrench/tests/withsymlinks/test @@ -0,0 +1 @@ +aaa bbb ccc ddd \ No newline at end of file diff --git a/node_modules/jsdoc/package.json b/node_modules/jsdoc/package.json index 8f4c100..2a042b6 100644 --- a/node_modules/jsdoc/package.json +++ b/node_modules/jsdoc/package.json @@ -1,37 +1,34 @@ { "name": "jsdoc", - "version": "3.3.0-alpha9", - "revision": "1403969163513", + "version": "3.3.0-beta1", + "revision": "1421862103679", "description": "An API documentation generator for JavaScript.", "keywords": [ "documentation", "javascript" ], - "licenses": [ - { - "type": "Apache 2.0", - "url": "http://www.apache.org/licenses/LICENSE-2.0" - } - ], + "license": "Apache-2.0", "repository": { "type": "git", "url": "https://github.com/jsdoc3/jsdoc" }, "dependencies": { - "async": "~0.1.22", - "catharsis": "~0.8.2", + "async": "~0.9.0", + "catharsis": "~0.8.6", + "escape-string-regexp": "~1.0.2", "esprima": "https://github.com/ariya/esprima/tarball/49a2eccb243f29bd653b11e9419241a9d726af7c", - "js2xmlparser": "~0.1.0", - "marked": "~0.3.1", + "js2xmlparser": "~0.1.7", + "marked": "~0.3.2", "requizzle": "~0.2.0", - "strip-json-comments": "~0.1.3", - "taffydb": "https://github.com/hegemonic/taffydb/tarball/master", - "underscore": "~1.6.0", - "wrench": "~1.3.9" + "strip-json-comments": "~1.0.2", + "taffydb": "https://github.com/hegemonic/taffydb/tarball/7d100bcee0e997ee4977e273cdce60bd8933050e", + "underscore": "~1.7.0", + "wrench": "~1.5.8" }, "devDependencies": { - "gulp": "~3.6.2", - "gulp-eslint": "~0.1.6", + "eslint": "~0.11.0", + "gulp": "~3.8.5", + "gulp-eslint": "~0.1.7", "gulp-json-editor": "~2.0.2", "istanbul": "~0.2.1", "tv4": "https://github.com/hegemonic/tv4/tarball/own-properties" @@ -67,21 +64,20 @@ "email": "jeffrey.l.williams@gmail.com" } ], - "gitHead": "f5da3b7c9603bdcc80bff7c187d592f3d9fcf450", "homepage": "https://github.com/jsdoc3/jsdoc", - "_id": "jsdoc@3.3.0-alpha9", - "_shasum": "8527b69bfcf5eaf2a6ae82ac01686151bba31660", - "_from": "jsdoc@3.3.0-alpha9", - "_npmVersion": "1.4.16", + "_id": "jsdoc@3.3.0-beta1", + "_shasum": "3a5e90ec832e5d5ae2c6b54701e1ea3f122153e9", + "_from": "jsdoc@*", + "_npmVersion": "1.4.9", "_npmUser": { "name": "hegemonic", "email": "jeffrey.l.williams@gmail.com" }, "dist": { - "shasum": "8527b69bfcf5eaf2a6ae82ac01686151bba31660", - "tarball": "http://registry.npmjs.org/jsdoc/-/jsdoc-3.3.0-alpha9.tgz" + "shasum": "3a5e90ec832e5d5ae2c6b54701e1ea3f122153e9", + "tarball": "http://registry.npmjs.org/jsdoc/-/jsdoc-3.3.0-beta1.tgz" }, "directories": {}, - "_resolved": "https://registry.npmjs.org/jsdoc/-/jsdoc-3.3.0-alpha9.tgz", + "_resolved": "https://registry.npmjs.org/jsdoc/-/jsdoc-3.3.0-beta1.tgz", "readme": "ERROR: No README data found!" } diff --git a/node_modules/jsdoc/package.json.orig b/node_modules/jsdoc/package.json.orig index bd8fc9d..14ad192 100644 --- a/node_modules/jsdoc/package.json.orig +++ b/node_modules/jsdoc/package.json.orig @@ -1,30 +1,26 @@ { "name": "jsdoc", <<<<<<< HEAD - "version": "3.3.0-alpha8", - "revision": "1402517102726", + "version": "3.3.0-alpha13", + "revision": "1419376892674", ======= "version": "3.3.0-dev", - "revision": "1403969163513", ->>>>>>> origin/master + "revision": "1421032593200", +>>>>>>> master "description": "An API documentation generator for JavaScript.", "keywords": [ "documentation", "javascript" ], - "licenses": [ - { - "type": "Apache 2.0", - "url": "http://www.apache.org/licenses/LICENSE-2.0" - } - ], + "license": "Apache-2.0", "repository": { "type": "git", "url": "https://github.com/jsdoc3/jsdoc" }, "dependencies": { "async": "~0.1.22", - "catharsis": "~0.8.2", + "catharsis": "~0.8.6", + "escape-string-regexp": "~1.0.0", "esprima": "https://github.com/ariya/esprima/tarball/49a2eccb243f29bd653b11e9419241a9d726af7c", "js2xmlparser": "~0.1.0", "marked": "~0.3.1", @@ -35,8 +31,9 @@ "wrench": "~1.3.9" }, "devDependencies": { - "gulp": "~3.6.2", - "gulp-eslint": "~0.1.6", + "eslint": "~0.11.0", + "gulp": "~3.8.5", + "gulp-eslint": "~0.1.7", "gulp-json-editor": "~2.0.2", "istanbul": "~0.2.1", "tv4": "https://github.com/hegemonic/tv4/tarball/own-properties" diff --git a/node_modules/jsdoc/plugins/commentConvert.js b/node_modules/jsdoc/plugins/commentConvert.js index cac6d87..64347e0 100644 --- a/node_modules/jsdoc/plugins/commentConvert.js +++ b/node_modules/jsdoc/plugins/commentConvert.js @@ -5,6 +5,8 @@ */ 'use strict'; +/*eslint spaced-line-comment: 0 */ + exports.handlers = { /// /// Convert ///-style comments into jsdoc comments. @@ -18,4 +20,4 @@ exports.handlers = { return replacement; }); } -}; \ No newline at end of file +}; diff --git a/node_modules/jsdoc/plugins/escapeHtml.js b/node_modules/jsdoc/plugins/escapeHtml.js index d587405..a900bfa 100644 --- a/node_modules/jsdoc/plugins/escapeHtml.js +++ b/node_modules/jsdoc/plugins/escapeHtml.js @@ -13,8 +13,8 @@ exports.handlers = { newDoclet: function(e) { if (e.doclet.description) { e.doclet.description = e.doclet.description - .replace(/&/g,'&') - .replace(/'); } } diff --git a/node_modules/jsdoc/plugins/markdown.js b/node_modules/jsdoc/plugins/markdown.js index 7c7df69..7c50b72 100644 --- a/node_modules/jsdoc/plugins/markdown.js +++ b/node_modules/jsdoc/plugins/markdown.js @@ -1,4 +1,3 @@ -/*global env: true */ /** * @overview Translate doclet descriptions from MarkDown into HTML. * @module plugins/markdown @@ -7,22 +6,28 @@ */ 'use strict'; -var conf = env.conf.markdown; -var defaultTags = [ 'classdesc', 'description', 'params', 'properties', 'returns', 'see']; +var config = global.env.conf.markdown || {}; +var defaultTags = [ + 'author', + 'classdesc', + 'description', + 'exceptions', + 'params', + 'properties', + 'returns', + 'see' +]; var hasOwnProp = Object.prototype.hasOwnProperty; var parse = require('jsdoc/util/markdown').getParser(); var tags = []; var excludeTags = []; function shouldProcessString(tagName, text) { - var shouldProcess = false; + var shouldProcess = true; - if (tagName !== 'see') { - shouldProcess = true; - } - // we only want to process `@see` tags that contain Markdown links - else if (tagName === 'see' && text.indexOf('[') !== -1) { - shouldProcess = true; + // we only want to process `@author` and `@see` tags that contain Markdown links + if ( (tagName === 'author' || tagName === 'see') && text.indexOf('[') === -1 ) { + shouldProcess = false; } return shouldProcess; @@ -58,12 +63,12 @@ function process(doclet) { } // set up the list of "tags" (properties) to process -if (conf && conf.tags) { - tags = conf.tags.slice(); +if (config.tags) { + tags = config.tags.slice(); } // set up the list of default tags to exclude from processing -if (conf && conf.excludeTags) { - excludeTags = conf.excludeTags.slice(); +if (config.excludeTags) { + excludeTags = config.excludeTags.slice(); } defaultTags.forEach(function(tag) { if (excludeTags.indexOf(tag) === -1 && tags.indexOf(tag) === -1) { diff --git a/node_modules/jsdoc/plugins/partial.js b/node_modules/jsdoc/plugins/partial.js index 2718adc..feaa100 100644 --- a/node_modules/jsdoc/plugins/partial.js +++ b/node_modules/jsdoc/plugins/partial.js @@ -1,4 +1,3 @@ -/*global env: true */ /** @overview Adds support for reusable partial jsdoc files. @module plugins/partial @@ -10,21 +9,21 @@ var fs = require('jsdoc/fs'); var path = require('path'); exports.handlers = { - /// - /// Include a partial jsdoc - /// @param e - /// @param e.filename - /// @param e.source - /// - /// @example - /// @partial "partial_doc.jsdoc" - /// + /** + * Include a partial jsdoc + * + * @param e + * @param e.filename + * @param e.source + * @example + * @partial "partial_doc.jsdoc" + */ beforeParse: function(e) { e.source = e.source.replace(/(@partial \".*\")+/g, function($) { - var pathArg = $.match(/\".*\"/)[0].replace(/"/g,''); - var fullPath = path.join(e.filename , '..', pathArg); + var pathArg = $.match(/\".*\"/)[0].replace(/"/g, ''); + var fullPath = path.join(e.filename, '..', pathArg); - var partialData = fs.readFileSync(fullPath, env.opts.encoding); + var partialData = fs.readFileSync(fullPath, global.env.opts.encoding); return partialData; }); diff --git a/node_modules/jsdoc/plugins/railsTemplate.js b/node_modules/jsdoc/plugins/railsTemplate.js index 6a408f6..270381c 100644 --- a/node_modules/jsdoc/plugins/railsTemplate.js +++ b/node_modules/jsdoc/plugins/railsTemplate.js @@ -17,4 +17,4 @@ exports.handlers = { e.source = e.source.replace(/<%.*%>/g, ''); } } -}; \ No newline at end of file +}; diff --git a/node_modules/jsdoc/plugins/shout.js b/node_modules/jsdoc/plugins/shout.js index 34ed07c..05c5d9f 100644 --- a/node_modules/jsdoc/plugins/shout.js +++ b/node_modules/jsdoc/plugins/shout.js @@ -14,4 +14,4 @@ exports.handlers = { e.doclet.description = e.doclet.description.toUpperCase(); } } -}; \ No newline at end of file +}; diff --git a/node_modules/jsdoc/plugins/sourcetag.js b/node_modules/jsdoc/plugins/sourcetag.js index 2385426..c773283 100644 --- a/node_modules/jsdoc/plugins/sourcetag.js +++ b/node_modules/jsdoc/plugins/sourcetag.js @@ -23,7 +23,6 @@ exports.handlers = { tag, value; - //console.log(e.doclet); // any user-defined tags in this doclet? if (typeof tags !== 'undefined') { // only interested in the @source tags diff --git a/node_modules/jsdoc/plugins/summarize.js b/node_modules/jsdoc/plugins/summarize.js new file mode 100644 index 0000000..da72f73 --- /dev/null +++ b/node_modules/jsdoc/plugins/summarize.js @@ -0,0 +1,61 @@ +/** + * @overview This plugin creates a summary tag, if missing, from the first sentence in the + * description. + * @module plugins/summarize + * @author Mads Bondo Dydensborg + */ +'use strict'; + +exports.handlers = { + /** + * Autogenerate summaries, if missing, from the description, if present. + */ + newDoclet: function(e) { + var endTag; + var tags; + var stack; + + // If the summary is missing, grab the first sentence from the description + // and use that. + if (e.doclet && !e.doclet.summary && e.doclet.description) { + // The summary may end with `.$`, `. `, or `.<` (a period followed by an HTML tag). + e.doclet.summary = e.doclet.description.split(/\.$|\.\s|\.]+>/g) || []; + stack = []; + + tags.forEach(function(tag) { + var idx = tag.indexOf('/'); + + if (idx === -1) { + // start tag -- push onto the stack + stack.push(tag); + } else if (idx === 1) { + // end tag -- pop off of the stack + stack.pop(); + } + + // otherwise, it's a self-closing tag; don't modify the stack + }); + + // stack should now contain only the start tags that lack end tags, + // with the most deeply nested start tag at the top + while (stack.length > 0) { + // pop the unmatched tag off the stack + endTag = stack.pop(); + // get just the tag name + endTag = endTag.substring(1, endTag.search(/[ >]/)); + // append the end tag + e.doclet.summary += ''; + } + + // and, finally, if the summary starts and ends with a

      tag, remove it; let the + // template decide whether to wrap the summary in a

      tag + e.doclet.summary = e.doclet.summary.replace(/^

      (.*)<\/p>$/i, '$1'); + } + } +}; diff --git a/node_modules/jsdoc/plugins/test/fixtures/markdown.js b/node_modules/jsdoc/plugins/test/fixtures/markdown.js new file mode 100644 index 0000000..babd67f --- /dev/null +++ b/node_modules/jsdoc/plugins/test/fixtures/markdown.js @@ -0,0 +1,25 @@ +'use strict'; + +/** + * @see [Nowhere](http://nowhere.com) + */ +function foo() {} + +/** + * @see AnObject#myProperty + */ +function bar() {} + +/** + * @author [Mr. Macintosh](http://www.folklore.org/StoryView.py?story=Mister_Macintosh.txt) + * @classdesc My class. + * @description My class. + * @exception {Error} Some error. + * @param {string} myParam - My parameter. + * @property {string} value - Value of myParam. + * @return {MyClass} Class instance. + * @see [Example Inc.](http://example.com) + */ +function MyClass(myParam) { + this.value = myParam; +} diff --git a/node_modules/jsdoc/plugins/test/fixtures/seetag-markdown.js b/node_modules/jsdoc/plugins/test/fixtures/seetag-markdown.js deleted file mode 100644 index 6aba419..0000000 --- a/node_modules/jsdoc/plugins/test/fixtures/seetag-markdown.js +++ /dev/null @@ -1,11 +0,0 @@ -/** -* @see [Nowhere](http://nowhere.com) -*/ -function foo() { -} - -/** -* @see AnObject#myProperty -*/ -function bar() { -} diff --git a/node_modules/jsdoc/plugins/test/fixtures/underscore.js b/node_modules/jsdoc/plugins/test/fixtures/underscore.js new file mode 100644 index 0000000..a953c17 --- /dev/null +++ b/node_modules/jsdoc/plugins/test/fixtures/underscore.js @@ -0,0 +1,22 @@ +'use strict'; + +/** This doclet will be shown by default, just like normal. */ +function normal() {} + +/** This doclet will be hidden by default because it begins with an underscore. */ +function _hidden() {} + +/** + * Klass class + * @class + */ +function Klass() { + /** This is a private property of the class, and should not. */ + this._privateProp = null; + + /** + * This is a property explicitly marked as private. + * @private + */ + this.privateProp = null; +} diff --git a/node_modules/jsdoc/plugins/test/specs/markdown.js b/node_modules/jsdoc/plugins/test/specs/markdown.js index c9d89cc..e2f4477 100644 --- a/node_modules/jsdoc/plugins/test/specs/markdown.js +++ b/node_modules/jsdoc/plugins/test/specs/markdown.js @@ -1,29 +1,49 @@ -/*global describe: true, env: true, expect: true, it: true, jasmine: true */ +'use strict'; var path = require('jsdoc/path'); -describe("markdown plugin", function() { - //TODO -}); - -describe("markdown see tag support", function() { +describe('markdown plugin', function() { var pluginPath = 'plugins/markdown'; - var pluginPathResolved = path.join(env.dirname, pluginPath); + var pluginPathResolved = path.join(global.env.dirname, pluginPath); var plugin = require(pluginPathResolved); - var docSet = jasmine.getDocSetFromFile('plugins/test/fixtures/seetag-markdown.js'); - var foo = docSet.getByLongname('foo')[0]; - var bar = docSet.getByLongname('bar')[0]; + var docSet = jasmine.getDocSetFromFile('plugins/test/fixtures/markdown.js'); - it ('should parse @see tags containing links', function() { - plugin.handlers.newDoclet({doclet:foo}); - expect(typeof foo).toEqual('object'); - expect(foo.see[0]).toEqual('

      Nowhere

      '); + // TODO: more tests; refactor the plugin so multiple settings can be tested + + it('should process the correct tags by default', function() { + var myClass = docSet.getByLongname('MyClass')[0]; + + plugin.handlers.newDoclet({ doclet: myClass }); + [ + myClass.author[0], + myClass.classdesc, + myClass.description, + myClass.exceptions[0].description, + myClass.params[0].description, + myClass.properties[0].description, + myClass.returns[0].description, + myClass.see + ].forEach(function(value) { + // if we processed the value, it should be wrapped in a

      tag + expect( /^

      (?:.+)<\/p>$/.test(value) ).toBe(true); + }); }); - it ('should not parse @see tags that do not contain links', function() { - plugin.handlers.newDoclet({doclet:bar}); - expect(typeof bar).toEqual('object'); - expect(bar.see[0]).toEqual('AnObject#myProperty'); + describe('@see tag support', function() { + var foo = docSet.getByLongname('foo')[0]; + var bar = docSet.getByLongname('bar')[0]; + + it('should parse @see tags containing links', function() { + plugin.handlers.newDoclet({ doclet: foo }); + expect(typeof foo).toEqual('object'); + expect(foo.see[0]).toEqual('

      Nowhere

      '); + }); + + it('should not parse @see tags that do not contain links', function() { + plugin.handlers.newDoclet({ doclet: bar }); + expect(typeof bar).toEqual('object'); + expect(bar.see[0]).toEqual('AnObject#myProperty'); + }); }); }); diff --git a/node_modules/jsdoc/plugins/test/specs/sourcetag.js b/node_modules/jsdoc/plugins/test/specs/sourcetag.js index ab154bf..5c6568b 100644 --- a/node_modules/jsdoc/plugins/test/specs/sourcetag.js +++ b/node_modules/jsdoc/plugins/test/specs/sourcetag.js @@ -1,21 +1,23 @@ -/*global describe: true, env: true, expect: true, it: true, jasmine: true */ -describe("sourcetag plugin", function() { +/*global describe, expect, it, jasmine */ +'use strict'; + +describe('sourcetag plugin', function() { var parser = jasmine.createParser(); var path = require('jsdoc/path'); var docSet; var pluginPath = 'plugins/sourcetag'; - var pluginPathResolved = path.join(env.dirname, pluginPath); + var pluginPathResolved = path.join(global.env.dirname, pluginPath); var plugin = require(pluginPathResolved); require('jsdoc/plugins').installPlugins([pluginPathResolved], parser); docSet = jasmine.getDocSetFromFile(pluginPath + '.js', parser); it("should set the lineno and filename of the doclet's meta property", function() { - var doclet = docSet.getByLongname("module:plugins/sourcetag.handlers.newDoclet"); + var doclet = docSet.getByLongname('module:plugins/sourcetag.handlers.newDoclet'); expect(doclet[0].meta).toBeDefined(); - expect(doclet[0].meta.filename).toEqual("sourcetag.js"); + expect(doclet[0].meta.filename).toEqual('sourcetag.js'); expect(doclet[0].meta.lineno).toEqual(13); }); }); diff --git a/node_modules/jsdoc/plugins/test/specs/summarize.js b/node_modules/jsdoc/plugins/test/specs/summarize.js new file mode 100644 index 0000000..9fb5ab8 --- /dev/null +++ b/node_modules/jsdoc/plugins/test/specs/summarize.js @@ -0,0 +1,112 @@ +/*global describe, expect, it */ +'use strict'; + +var summarize = require('../../summarize'); + +describe('summarize', function() { + it('should export handlers', function() { + expect(summarize.handlers).toBeDefined(); + expect(typeof summarize.handlers).toBe('object'); + }); + + it('should export a newDoclet handler', function() { + expect(summarize.handlers.newDoclet).toBeDefined(); + expect(typeof summarize.handlers.newDoclet).toBe('function'); + }); + + describe('newDoclet handler', function() { + var handler = summarize.handlers.newDoclet; + + it('should not blow up if the doclet is missing', function() { + function noDoclet() { + return handler({}); + } + + expect(noDoclet).not.toThrow(); + }); + + it('should not change the summary if it is already defined', function() { + var doclet = { + summary: 'This is a summary.', + description: 'Descriptions are good.' + }; + handler({ doclet: doclet }); + + expect(doclet.summary).not.toBe(doclet.description); + }); + + it('should not do anything if the description is missing', function() { + var doclet = {}; + handler({ doclet: doclet }); + + expect(doclet.summary).not.toBeDefined(); + }); + + it('should use the first sentence as the summary', function() { + var doclet = { + description: 'This sentence is the summary. This sentence is not.' + }; + handler({ doclet: doclet }); + + expect(doclet.summary).toBe('This sentence is the summary.'); + }); + + it('should not add an extra period if there is only one sentence in the description', + function() { + var doclet = { + description: 'This description has only one sentence.' + }; + handler({ doclet: doclet }); + + expect(doclet.summary).toBe('This description has only one sentence.'); + }); + + it('should use the entire description, plus a period, as the summary if the description ' + + 'does not contain a period', function() { + var doclet = { + description: 'This is a description' + }; + handler({ doclet: doclet }); + + expect(doclet.summary).toBe('This is a description.'); + }); + + it('should use the entire description as the summary if the description contains only ' + + 'one sentence', function() { + var doclet = { + description: 'This is a description.' + }; + handler({ doclet: doclet }); + + expect(doclet.description).toBe('This is a description.'); + }); + + it('should work when an HTML tag immediately follows the first sentence', function() { + var doclet = { + description: 'This sentence is the summary.This sentence is small.' + }; + handler({ doclet: doclet }); + + expect(doclet.summary).toBe('This sentence is the summary.'); + }); + + it('should generate valid HTML if a tag is opened, but not closed, in the summary', + function() { + var doclet = { + description: 'This description has a tag. The tag straddles sentences.' + }; + handler({ doclet: doclet }); + + expect(doclet.summary).toBe('This description has a tag.'); + }); + + it('should not include a

      tag in the summary', function() { + var doclet = { + description: '

      This description contains HTML.

      And plenty of it!

      ' + }; + handler({ doclet: doclet }); + + expect(doclet.summary).toBe('This description contains HTML.'); + }); + }); +}); diff --git a/node_modules/jsdoc/plugins/test/specs/underscore.js b/node_modules/jsdoc/plugins/test/specs/underscore.js new file mode 100644 index 0000000..cba70ae --- /dev/null +++ b/node_modules/jsdoc/plugins/test/specs/underscore.js @@ -0,0 +1,35 @@ +'use strict'; + +describe('underscore plugin', function () { + var parser = jasmine.createParser(); + var path = require('jsdoc/path'); + + var docSet; + + var pluginPath = 'plugins/underscore'; + var fixturePath = 'plugins/test/fixtures/underscore'; + var pluginPathResolved = path.join(env.dirname, pluginPath); + var plugin = require(pluginPathResolved); + + require('jsdoc/plugins').installPlugins([pluginPathResolved], parser); + docSet = jasmine.getDocSetFromFile(fixturePath + '.js', parser); + + it('should not mark normal, public properties as private', function() { + // Base line tests + var normal = docSet.getByLongname('normal'); + expect(normal[0].access).toBeUndefined(); + + var realPrivate = docSet.getByLongname('Klass#privateProp'); + expect(realPrivate[0].access).toEqual('private'); + }); + + it('should hide doclet for symbols beginning with an underscore under normal circumstances', function () { + var hidden = docSet.getByLongname('_hidden'); + expect(hidden[0].access).toEqual('private'); + }); + + it('picks up "this"', function() { + var privateUnderscore = docSet.getByLongname('Klass#_privateProp'); + expect(privateUnderscore[0].access).toEqual('private'); + }); +}); diff --git a/node_modules/jsdoc/plugins/underscore.js b/node_modules/jsdoc/plugins/underscore.js new file mode 100644 index 0000000..e5cf112 --- /dev/null +++ b/node_modules/jsdoc/plugins/underscore.js @@ -0,0 +1,21 @@ +'use strict'; + +/** + * Removes all symbols that begin with an underscore from the doc output. If + * you're using underscores to denote private variables in modules, this + * automatically hides them. + * + * @module plugins/underscore + * @author Daniel Ellis + */ + +exports.handlers = { + newDoclet: function(e) { + var doclet = e.doclet; + + // Ignore comment blocks for all symbols that begin with underscore + if (doclet.name.charAt(0) === '_' || doclet.name.substr(0, 6) === 'this._') { + doclet.access = 'private'; + } + } +}; diff --git a/node_modules/jsdoc/templates/default/README.md b/node_modules/jsdoc/templates/default/README.md index a7bd96b..bc74d34 100644 --- a/node_modules/jsdoc/templates/default/README.md +++ b/node_modules/jsdoc/templates/default/README.md @@ -1 +1,12 @@ The default template for JSDoc 3 uses: [the Taffy Database library](http://taffydb.com/) and the [Underscore Template library](http://documentcloud.github.com/underscore/#template). + + +## Generating Typeface Fonts + +The default template uses the [OpenSans](https://www.google.com/fonts/specimen/Open+Sans) typeface. The font files can be regenerated as follows: + +1. Open the [OpenSans page at Font Squirrel](). +2. Click on the 'Webfont Kit' tab. +3. Either leave the subset drop-down as 'Western Latin (Default)', or, if we decide we need more glyphs, than change it to 'No Subsetting'. +4. Click the 'DOWNLOAD @FONT-FACE KIT' button. +5. For each typeface variant we plan to use, copy the 'eot', 'svg' and 'woff' files into the 'templates/default/static/fonts' directory. diff --git a/node_modules/jsdoc/templates/default/publish.js b/node_modules/jsdoc/templates/default/publish.js index c7ac385..b85fbb5 100644 --- a/node_modules/jsdoc/templates/default/publish.js +++ b/node_modules/jsdoc/templates/default/publish.js @@ -1,6 +1,7 @@ /*global env: true */ 'use strict'; +var doop = require('jsdoc/util/doop'); var fs = require('jsdoc/fs'); var helper = require('jsdoc/util/templateHelper'); var logger = require('jsdoc/util/logger'); @@ -18,7 +19,7 @@ var hasOwnProp = Object.prototype.hasOwnProperty; var data; var view; -var outdir = env.opts.destination; +var outdir = path.normalize(env.opts.destination); function find(spec) { return helper.find(data, spec); @@ -104,7 +105,7 @@ function addParamAttributes(params) { function buildItemTypeStrings(item) { var types = []; - if (item.type && item.type.names) { + if (item && item.type && item.type.names) { item.type.names.forEach(function(name) { types.push( linkto(name, htmlsafe(name)) ); }); @@ -262,17 +263,63 @@ function attachModuleSymbols(doclets, modules) { // build a lookup table doclets.forEach(function(symbol) { - symbols[symbol.longname] = symbol; + symbols[symbol.longname] = symbols[symbol.longname] || []; + symbols[symbol.longname].push(symbol); }); return modules.map(function(module) { if (symbols[module.longname]) { - module.module = symbols[module.longname]; - module.module.name = module.module.name.replace('module:', '(require("') + '"))'; + module.modules = symbols[module.longname] + // Only show symbols that have a description. Make an exception for classes, because + // we want to show the constructor-signature heading no matter what. + .filter(function(symbol) { + return symbol.description || symbol.kind === 'class'; + }) + .map(function(symbol) { + symbol = doop(symbol); + + if (symbol.kind === 'class' || symbol.kind === 'function') { + symbol.name = symbol.name.replace('module:', '(require("') + '"))'; + } + + return symbol; + }); } }); } +function buildMemberNav(items, itemHeading, itemsSeen, linktoFn) { + var nav = ''; + + if (items.length) { + var itemsNav = ''; + + items.forEach(function(item) { + if ( !hasOwnProp.call(item, 'longname') ) { + itemsNav += '
    3. ' + linktoFn('', item.name) + '
    4. '; + } + else if ( !hasOwnProp.call(itemsSeen, item.longname) ) { + itemsNav += '
    5. ' + linktoFn(item.longname, item.name.replace(/^module:/, '')) + '
    6. '; + itemsSeen[item.longname] = true; + } + }); + + if (itemsNav !== '') { + nav += '

      ' + itemHeading + '

        ' + itemsNav + '
      '; + } + } + + return nav; +} + +function linktoTutorial(longName, name) { + return tutoriallink(name); +} + +function linktoExternal(longName, name) { + return linkto(longName, name.replace(/(^"|"$)/g, '')); +} + /** * Create the navigation sidebar. * @param {object} members The members that will be used to create the sidebar. @@ -284,100 +331,26 @@ function attachModuleSymbols(doclets, modules) { * @param {array} members.namespaces * @param {array} members.tutorials * @param {array} members.events + * @param {array} members.interfaces * @return {string} The HTML for the navigation sidebar. */ function buildNav(members) { - var nav = '

      Index

      ', - seen = {}, - hasClassList = false, - classNav = '', - globalNav = ''; + var nav = '

      Home

      '; + var seen = {}; + var seenTutorials = {}; - if (members.modules.length) { - nav += '

      Modules

        '; - members.modules.forEach(function(m) { - if ( !hasOwnProp.call(seen, m.longname) ) { - nav += '
      • ' + linkto(m.longname, m.name) + '
      • '; - } - seen[m.longname] = true; - }); - - nav += '
      '; - } - - if (members.externals.length) { - nav += '

      Externals

        '; - members.externals.forEach(function(e) { - if ( !hasOwnProp.call(seen, e.longname) ) { - nav += '
      • ' + linkto( e.longname, e.name.replace(/(^"|"$)/g, '') ) + '
      • '; - } - seen[e.longname] = true; - }); - - nav += '
      '; - } - - if (members.classes.length) { - members.classes.forEach(function(c) { - if ( !hasOwnProp.call(seen, c.longname) ) { - classNav += '
    7. ' + linkto(c.longname, c.name) + '
    8. '; - } - seen[c.longname] = true; - }); - - if (classNav !== '') { - nav += '

      Classes

        '; - nav += classNav; - nav += '
      '; - } - } - - if (members.events.length) { - nav += '

      Events

        '; - members.events.forEach(function(e) { - if ( !hasOwnProp.call(seen, e.longname) ) { - nav += '
      • ' + linkto(e.longname, e.name) + '
      • '; - } - seen[e.longname] = true; - }); - - nav += '
      '; - } - - if (members.namespaces.length) { - nav += '

      Namespaces

        '; - members.namespaces.forEach(function(n) { - if ( !hasOwnProp.call(seen, n.longname) ) { - nav += '
      • ' + linkto(n.longname, n.name) + '
      • '; - } - seen[n.longname] = true; - }); - - nav += '
      '; - } - - if (members.mixins.length) { - nav += '

      Mixins

        '; - members.mixins.forEach(function(m) { - if ( !hasOwnProp.call(seen, m.longname) ) { - nav += '
      • ' + linkto(m.longname, m.name) + '
      • '; - } - seen[m.longname] = true; - }); - - nav += '
      '; - } - - if (members.tutorials.length) { - nav += '

      Tutorials

        '; - members.tutorials.forEach(function(t) { - nav += '
      • ' + tutoriallink(t.name) + '
      • '; - }); - - nav += '
      '; - } + nav += buildMemberNav(members.modules, 'Modules', {}, linkto); + nav += buildMemberNav(members.externals, 'Externals', seen, linktoExternal); + nav += buildMemberNav(members.classes, 'Classes', seen, linkto); + nav += buildMemberNav(members.events, 'Events', seen, linkto); + nav += buildMemberNav(members.namespaces, 'Namespaces', seen, linkto); + nav += buildMemberNav(members.mixins, 'Mixins', seen, linkto); + nav += buildMemberNav(members.tutorials, 'Tutorials', seenTutorials, linktoTutorial); + nav += buildMemberNav(members.interfaces, 'Interfaces', seen, linkto); if (members.globals.length) { + var globalNav = ''; + members.globals.forEach(function(g) { if ( g.kind !== 'typedef' && !hasOwnProp.call(seen, g.longname) ) { globalNav += '
    9. ' + linkto(g.longname, g.name) + '
    10. '; @@ -406,10 +379,10 @@ exports.publish = function(taffyData, opts, tutorials) { data = taffyData; var conf = env.conf.templates || {}; - conf['default'] = conf['default'] || {}; + conf.default = conf.default || {}; - var templatePath = opts.template; - view = new template.Template(templatePath + '/tmpl'); + var templatePath = path.normalize(opts.template); + view = new template.Template( path.join(templatePath, 'tmpl') ); // claim some special filenames in advance, so the All-Powerful Overseer of Filename Uniqueness // doesn't try to hand them out later @@ -420,9 +393,9 @@ exports.publish = function(taffyData, opts, tutorials) { helper.registerLink('global', globalUrl); // set up templating - view.layout = conf['default'].layoutFile ? - path.getResourcePath(path.dirname(conf['default'].layoutFile), - path.basename(conf['default'].layoutFile) ) : + view.layout = conf.default.layoutFile ? + path.getResourcePath(path.dirname(conf.default.layoutFile), + path.basename(conf.default.layoutFile) ) : 'layout.tmpl'; // set up tutorials for helper @@ -443,7 +416,7 @@ exports.publish = function(taffyData, opts, tutorials) { if (example.match(/^\s*([\s\S]+?)<\/caption>(\s*[\n\r])([\s\S]+)$/i)) { caption = RegExp.$1; - code = RegExp.$3; + code = RegExp.$3; } return { @@ -475,7 +448,7 @@ exports.publish = function(taffyData, opts, tutorials) { // update outdir if necessary, then create outdir var packageInfo = ( find({kind: 'package'}) || [] ) [0]; if (packageInfo && packageInfo.name) { - outdir = path.join(outdir, packageInfo.name, packageInfo.version); + outdir = path.join( outdir, packageInfo.name, (packageInfo.version || '') ); } fs.mkPath(outdir); @@ -493,9 +466,13 @@ exports.publish = function(taffyData, opts, tutorials) { var staticFilePaths; var staticFileFilter; var staticFileScanner; - if (conf['default'].staticFiles) { - staticFilePaths = conf['default'].staticFiles.paths || []; - staticFileFilter = new (require('jsdoc/src/filter')).Filter(conf['default'].staticFiles); + if (conf.default.staticFiles) { + // The canonical property name is `include`. We accept `paths` for backwards compatibility + // with a bug in JSDoc 3.2.x. + staticFilePaths = conf.default.staticFiles.include || + conf.default.staticFiles.paths || + []; + staticFileFilter = new (require('jsdoc/src/filter')).Filter(conf.default.staticFiles); staticFileScanner = new (require('jsdoc/src/scanner')).Scanner(); staticFilePaths.forEach(function(filePath) { @@ -565,7 +542,7 @@ exports.publish = function(taffyData, opts, tutorials) { members.tutorials = tutorials.children; // output pretty-printed source files by default - var outputSourceFiles = conf['default'] && conf['default'].outputSourceFiles !== false ? true : + var outputSourceFiles = conf.default && conf.default.outputSourceFiles !== false ? true : false; // add template helpers @@ -578,8 +555,7 @@ exports.publish = function(taffyData, opts, tutorials) { // once for all view.nav = buildNav(members); - attachModuleSymbols( find({ kind: ['class', 'function'], longname: {left: 'module:'} }), - members.modules ); + attachModuleSymbols( find({ longname: {left: 'module:'} }), members.modules ); // generate the pretty-printed source files first so other pages can link to them if (outputSourceFiles) { @@ -592,7 +568,7 @@ exports.publish = function(taffyData, opts, tutorials) { var files = find({kind: 'file'}), packages = find({kind: 'package'}); - generate('Index', + generate('Home', packages.concat( [{kind: 'mainpage', readme: opts.readme, longname: (opts.mainpagetitle) ? opts.mainpagetitle : 'Main Page'}] ).concat(files), @@ -604,18 +580,19 @@ exports.publish = function(taffyData, opts, tutorials) { var namespaces = taffy(members.namespaces); var mixins = taffy(members.mixins); var externals = taffy(members.externals); + var interfaces = taffy(members.interfaces); Object.keys(helper.longnameToUrl).forEach(function(longname) { - var myClasses = helper.find(classes, {longname: longname}); - if (myClasses.length) { - generate('Class: ' + myClasses[0].name, myClasses, helper.longnameToUrl[longname]); - } - var myModules = helper.find(modules, {longname: longname}); if (myModules.length) { generate('Module: ' + myModules[0].name, myModules, helper.longnameToUrl[longname]); } + var myClasses = helper.find(classes, {longname: longname}); + if (myClasses.length) { + generate('Class: ' + myClasses[0].name, myClasses, helper.longnameToUrl[longname]); + } + var myNamespaces = helper.find(namespaces, {longname: longname}); if (myNamespaces.length) { generate('Namespace: ' + myNamespaces[0].name, myNamespaces, helper.longnameToUrl[longname]); @@ -630,6 +607,11 @@ exports.publish = function(taffyData, opts, tutorials) { if (myExternals.length) { generate('External: ' + myExternals[0].name, myExternals, helper.longnameToUrl[longname]); } + + var myInterfaces = helper.find(interfaces, {longname: longname}); + if (myInterfaces.length) { + generate('Interface: ' + myInterfaces[0].name, myInterfaces, helper.longnameToUrl[longname]); + } }); // TODO: move the tutorial functions to templateHelper.js diff --git a/node_modules/jsdoc/templates/default/static/fonts/OpenSans-Bold-webfont.eot b/node_modules/jsdoc/templates/default/static/fonts/OpenSans-Bold-webfont.eot new file mode 100644 index 0000000..5d20d91 Binary files /dev/null and b/node_modules/jsdoc/templates/default/static/fonts/OpenSans-Bold-webfont.eot differ diff --git a/node_modules/jsdoc/templates/default/static/fonts/OpenSans-Bold-webfont.svg b/node_modules/jsdoc/templates/default/static/fonts/OpenSans-Bold-webfont.svg new file mode 100644 index 0000000..3ed7be4 --- /dev/null +++ b/node_modules/jsdoc/templates/default/static/fonts/OpenSans-Bold-webfont.svg @@ -0,0 +1,1830 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/node_modules/jsdoc/templates/default/static/fonts/OpenSans-Bold-webfont.woff b/node_modules/jsdoc/templates/default/static/fonts/OpenSans-Bold-webfont.woff new file mode 100644 index 0000000..1205787 Binary files /dev/null and b/node_modules/jsdoc/templates/default/static/fonts/OpenSans-Bold-webfont.woff differ diff --git a/node_modules/jsdoc/templates/default/static/fonts/OpenSans-BoldItalic-webfont.eot b/node_modules/jsdoc/templates/default/static/fonts/OpenSans-BoldItalic-webfont.eot new file mode 100644 index 0000000..1f639a1 Binary files /dev/null and b/node_modules/jsdoc/templates/default/static/fonts/OpenSans-BoldItalic-webfont.eot differ diff --git a/node_modules/jsdoc/templates/default/static/fonts/OpenSans-BoldItalic-webfont.svg b/node_modules/jsdoc/templates/default/static/fonts/OpenSans-BoldItalic-webfont.svg new file mode 100644 index 0000000..6a2607b --- /dev/null +++ b/node_modules/jsdoc/templates/default/static/fonts/OpenSans-BoldItalic-webfont.svg @@ -0,0 +1,1830 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/node_modules/jsdoc/templates/default/static/fonts/OpenSans-BoldItalic-webfont.woff b/node_modules/jsdoc/templates/default/static/fonts/OpenSans-BoldItalic-webfont.woff new file mode 100644 index 0000000..ed760c0 Binary files /dev/null and b/node_modules/jsdoc/templates/default/static/fonts/OpenSans-BoldItalic-webfont.woff differ diff --git a/node_modules/jsdoc/templates/default/static/fonts/OpenSans-Italic-webfont.eot b/node_modules/jsdoc/templates/default/static/fonts/OpenSans-Italic-webfont.eot new file mode 100644 index 0000000..0c8a0ae Binary files /dev/null and b/node_modules/jsdoc/templates/default/static/fonts/OpenSans-Italic-webfont.eot differ diff --git a/node_modules/jsdoc/templates/default/static/fonts/OpenSans-Italic-webfont.svg b/node_modules/jsdoc/templates/default/static/fonts/OpenSans-Italic-webfont.svg new file mode 100644 index 0000000..e1075dc --- /dev/null +++ b/node_modules/jsdoc/templates/default/static/fonts/OpenSans-Italic-webfont.svg @@ -0,0 +1,1830 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/node_modules/jsdoc/templates/default/static/fonts/OpenSans-Italic-webfont.woff b/node_modules/jsdoc/templates/default/static/fonts/OpenSans-Italic-webfont.woff new file mode 100644 index 0000000..ff652e6 Binary files /dev/null and b/node_modules/jsdoc/templates/default/static/fonts/OpenSans-Italic-webfont.woff differ diff --git a/node_modules/jsdoc/templates/default/static/fonts/OpenSans-Light-webfont.eot b/node_modules/jsdoc/templates/default/static/fonts/OpenSans-Light-webfont.eot new file mode 100644 index 0000000..1486840 Binary files /dev/null and b/node_modules/jsdoc/templates/default/static/fonts/OpenSans-Light-webfont.eot differ diff --git a/node_modules/jsdoc/templates/default/static/fonts/OpenSans-Light-webfont.svg b/node_modules/jsdoc/templates/default/static/fonts/OpenSans-Light-webfont.svg new file mode 100644 index 0000000..11a472c --- /dev/null +++ b/node_modules/jsdoc/templates/default/static/fonts/OpenSans-Light-webfont.svg @@ -0,0 +1,1831 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/node_modules/jsdoc/templates/default/static/fonts/OpenSans-Light-webfont.woff b/node_modules/jsdoc/templates/default/static/fonts/OpenSans-Light-webfont.woff new file mode 100644 index 0000000..e786074 Binary files /dev/null and b/node_modules/jsdoc/templates/default/static/fonts/OpenSans-Light-webfont.woff differ diff --git a/node_modules/jsdoc/templates/default/static/fonts/OpenSans-LightItalic-webfont.eot b/node_modules/jsdoc/templates/default/static/fonts/OpenSans-LightItalic-webfont.eot new file mode 100644 index 0000000..8f44592 Binary files /dev/null and b/node_modules/jsdoc/templates/default/static/fonts/OpenSans-LightItalic-webfont.eot differ diff --git a/node_modules/jsdoc/templates/default/static/fonts/OpenSans-LightItalic-webfont.svg b/node_modules/jsdoc/templates/default/static/fonts/OpenSans-LightItalic-webfont.svg new file mode 100644 index 0000000..431d7e3 --- /dev/null +++ b/node_modules/jsdoc/templates/default/static/fonts/OpenSans-LightItalic-webfont.svg @@ -0,0 +1,1835 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/node_modules/jsdoc/templates/default/static/fonts/OpenSans-LightItalic-webfont.woff b/node_modules/jsdoc/templates/default/static/fonts/OpenSans-LightItalic-webfont.woff new file mode 100644 index 0000000..43e8b9e Binary files /dev/null and b/node_modules/jsdoc/templates/default/static/fonts/OpenSans-LightItalic-webfont.woff differ diff --git a/node_modules/jsdoc/templates/default/static/fonts/OpenSans-Regular-webfont.eot b/node_modules/jsdoc/templates/default/static/fonts/OpenSans-Regular-webfont.eot new file mode 100644 index 0000000..6bbc3cf Binary files /dev/null and b/node_modules/jsdoc/templates/default/static/fonts/OpenSans-Regular-webfont.eot differ diff --git a/node_modules/jsdoc/templates/default/static/fonts/OpenSans-Regular-webfont.svg b/node_modules/jsdoc/templates/default/static/fonts/OpenSans-Regular-webfont.svg new file mode 100644 index 0000000..25a3952 --- /dev/null +++ b/node_modules/jsdoc/templates/default/static/fonts/OpenSans-Regular-webfont.svg @@ -0,0 +1,1831 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/node_modules/jsdoc/templates/default/static/fonts/OpenSans-Regular-webfont.woff b/node_modules/jsdoc/templates/default/static/fonts/OpenSans-Regular-webfont.woff new file mode 100644 index 0000000..e231183 Binary files /dev/null and b/node_modules/jsdoc/templates/default/static/fonts/OpenSans-Regular-webfont.woff differ diff --git a/node_modules/jsdoc/templates/default/static/styles/jsdoc-default.css b/node_modules/jsdoc/templates/default/static/styles/jsdoc-default.css index 124ef6c..0067cb1 100644 --- a/node_modules/jsdoc/templates/default/static/styles/jsdoc-default.css +++ b/node_modules/jsdoc/templates/default/static/styles/jsdoc-default.css @@ -1,57 +1,90 @@ +@font-face { + font-family: 'Open Sans'; + font-weight: normal; + font-style: normal; + src: url('../fonts/OpenSans-Regular-webfont.eot'); + src: + local('Open Sans'), + local('OpenSans'), + url('../fonts/OpenSans-Regular-webfont.eot?#iefix') format('embedded-opentype'), + url('../fonts/OpenSans-Regular-webfont.woff') format('woff'), + url('../fonts/OpenSans-Regular-webfont.svg#open_sansregular') format('svg'); +} + +@font-face { + font-family: 'Open Sans Light'; + font-weight: normal; + font-style: normal; + src: url('../fonts/OpenSans-Light-webfont.eot'); + src: + local('Open Sans Light'), + local('OpenSans Light'), + url('../fonts/OpenSans-Light-webfont.eot?#iefix') format('embedded-opentype'), + url('../fonts/OpenSans-Light-webfont.woff') format('woff'), + url('../fonts/OpenSans-Light-webfont.svg#open_sanslight') format('svg'); +} + html { overflow: auto; background-color: #fff; + font-size: 14px; } body { - font: 14px "DejaVu Sans Condensed", "Liberation Sans", "Nimbus Sans L", Tahoma, Geneva, "Helvetica Neue", Helvetica, Arial, sans-serif; - line-height: 130%; - color: #000; - background-color: #fff; + font-family: 'Open Sans', sans-serif; + line-height: 1.5; + color: #4d4e53; + background-color: white; } -a { - color: #444; +a, a:visited, a:active { + color: #0095dd; + text-decoration: none; } -a:visited { - color: #444; -} - -a:active { - color: #444; +a:hover { + text-decoration: underline; } header { display: block; - padding: 6px 4px; + padding: 0px 4px; +} + +tt, code, kbd, samp { + font-family: Consolas, Monaco, 'Andale Mono', monospace; } .class-description { - font-style: italic; - font-family: Palatino, 'Palatino Linotype', serif; font-size: 130%; line-height: 140%; margin-bottom: 1em; margin-top: 1em; } +.class-description:empty { + margin: 0; +} + #main { float: left; - width: 100%; + width: 70%; +} + +article dl { + margin-bottom: 40px; } section { display: block; - background-color: #fff; padding: 12px 24px; border-bottom: 1px solid #ccc; - margin-right: 240px; + margin-right: 30px; } .variation { @@ -68,26 +101,27 @@ section nav { display: block; - float: left; - margin-left: -230px; + float: right; margin-top: 28px; - width: 220px; + width: 30%; + box-sizing: border-box; border-left: 1px solid #ccc; - padding-left: 9px; + padding-left: 16px; } nav ul { font-family: 'Lucida Grande', 'Lucida Sans Unicode', arial, sans-serif; font-size: 100%; line-height: 17px; - padding:0; - margin:0; - list-style-type:none; + padding: 0; + margin: 0; + list-style-type: none; } -nav h2 a, nav h2 a:visited { - color: #A35A00; - text-decoration: none; +nav ul a, nav ul a:visited, nav ul a:active { + font-family: Consolas, Monaco, 'Andale Mono', monospace; + line-height: 18px; + color: #4D4E53; } nav h3 { @@ -98,18 +132,6 @@ nav li { margin-top: 6px; } -nav a { - color: #5C5954; -} - -nav a:visited { - color: #5C5954; -} - -nav a:active { - color: #5C5954; -} - footer { display: block; padding: 6px; @@ -118,39 +140,33 @@ footer { font-size: 90%; } +h1, h2, h3, h4 { + font-weight: 200; + margin: 0; +} + h1 { - font-size: 200%; - font-weight: bold; - letter-spacing: -0.01em; - margin: 6px 0 9px 0; + font-family: 'Open Sans Light', sans-serif; + font-size: 48px; + letter-spacing: -2px; + margin: 12px 24px 20px; } -h2 +h2, h3 { - font-size: 170%; - font-weight: bold; - letter-spacing: -0.01em; - margin: 6px 0 3px 0; -} - -h3 -{ - font-size: 150%; - font-weight: bold; - letter-spacing: -0.01em; - margin-top: 16px; - margin: 6px 0 3px 0; + font-size: 30px; + font-weight: 700; + letter-spacing: -1px; + margin-bottom: 12px; } h4 { - font-size: 130%; - font-weight: bold; - letter-spacing: -0.01em; - margin-top: 16px; - margin: 18px 0 3px 0; - color: #A35A00; + font-size: 18px; + letter-spacing: -0.33px; + margin-bottom: 12px; + color: #4d4e53; } h5, .container-overview .subsection-title @@ -158,7 +174,7 @@ h5, .container-overview .subsection-title font-size: 120%; font-weight: bold; letter-spacing: -0.01em; - margin: 8px 0 3px -16px; + margin: 8px 0 3px 0; } h6 @@ -176,6 +192,11 @@ h6 text-decoration: none; } +.clear +{ + clear: both; +} + .important { font-weight: bold; @@ -191,12 +212,12 @@ h6 } .name, .signature { - font-family: Consolas, "Lucida Console", Monaco, monospace; + font-family: Consolas, Monaco, 'Andale Mono', monospace; } .details { margin-top: 14px; border-left: 2px solid #DDD; } -.details dt { width:100px; float:left; padding-left: 10px; padding-top: 6px; } -.details dd { margin-left: 50px; } +.details dt { width: 120px; float: left; padding-left: 10px; padding-top: 6px; } +.details dd { margin-left: 70px; } .details ul { margin: 0; } .details ul { list-style-type: none; } .details li { margin-left: 30px; padding-top: 6px; } @@ -205,14 +226,12 @@ h6 .description { margin-bottom: 1em; - margin-left: -16px; margin-top: 1em; } .code-caption { font-style: italic; - font-family: Palatino, 'Palatino Linotype', serif; font-size: 107%; margin: 0; } @@ -230,14 +249,13 @@ h6 .prettyprint code { - font-family: Consolas, 'Lucida Console', Monaco, monospace; font-size: 100%; line-height: 18px; display: block; padding: 4px 12px; margin: 0; background-color: #fff; - color: #000; + color: #4D4E53; } .prettyprint code span.line @@ -286,8 +304,8 @@ h6 } .params .name, .props .name, .name code { - color: #A35A00; - font-family: Consolas, 'Lucida Console', Monaco, monospace; + color: #4D4E53; + font-family: Consolas, Monaco, 'Andale Mono', monospace; font-size: 100%; } diff --git a/node_modules/jsdoc/templates/default/static/styles/prettify-tomorrow.css b/node_modules/jsdoc/templates/default/static/styles/prettify-tomorrow.css index aa2908c..b6f92a7 100644 --- a/node_modules/jsdoc/templates/default/static/styles/prettify-tomorrow.css +++ b/node_modules/jsdoc/templates/default/static/styles/prettify-tomorrow.css @@ -98,7 +98,7 @@ /* pre.prettyprint { background: white; - font-family: Menlo, Monaco, Consolas, monospace; + font-family: Consolas, Monaco, 'Andale Mono', monospace; font-size: 12px; line-height: 1.5; border: 1px solid #ccc; diff --git a/node_modules/jsdoc/templates/default/tmpl/augments.tmpl b/node_modules/jsdoc/templates/default/tmpl/augments.tmpl new file mode 100644 index 0000000..446d28a --- /dev/null +++ b/node_modules/jsdoc/templates/default/tmpl/augments.tmpl @@ -0,0 +1,10 @@ + + + +
        +
      • +
      + diff --git a/node_modules/jsdoc/templates/default/tmpl/container.tmpl b/node_modules/jsdoc/templates/default/tmpl/container.tmpl index 173b043..c52d297 100644 --- a/node_modules/jsdoc/templates/default/tmpl/container.tmpl +++ b/node_modules/jsdoc/templates/default/tmpl/container.tmpl @@ -1,8 +1,16 @@ + @@ -12,25 +20,37 @@
      -

      - - - - - -

      - -
      + +

      + + + + + +

      + +
      + + + + +
      + +
      - - - + + +
      + - + + + + @@ -49,17 +69,7 @@

      Extends

      -
        -
      • -
      - - - -

      Mixes In

      - -
        -
      • -
      + @@ -72,7 +82,7 @@

      Classes

      @@ -84,7 +94,7 @@

      Mixins

      @@ -96,45 +106,52 @@

      Namespaces

      -
      +

      Members

      -
      + -
      +

      Methods

      -
      + -
      +

      Type Definitions

      -
      @@ -145,18 +162,18 @@
      + }); ?>

      Events

      -
      + -
      +
      diff --git a/node_modules/jsdoc/templates/default/tmpl/details.tmpl b/node_modules/jsdoc/templates/default/tmpl/details.tmpl index 1ee86d2..d1ff696 100644 --- a/node_modules/jsdoc/templates/default/tmpl/details.tmpl +++ b/node_modules/jsdoc/templates/default/tmpl/details.tmpl @@ -9,17 +9,18 @@ if (data.defaultvalue && (data.defaultvaluetype === 'object' || data.defaultvalu defaultObjectClass = ' class="object-value"'; } ?> + + +
      Properties:
      + + + + +
      - - -
      Properties:
      - -
      - -
      Version:
      @@ -28,20 +29,55 @@ if (data.defaultvalue && (data.defaultvaluetype === 'object' || data.defaultvalu
      Since:
      -
      +
      - +
      Inherited From:
      • -
      + + + + +
      Overrides:
      +
      • + +
      + + + +
      Implementations:
      +
        + +
      • + +
      + + + +
      Implements:
      +
        + +
      • + +
      + + + +
      Mixes In:
      + +
        + +
      • + +
      Deprecated:
      • Yes
        diff --git a/node_modules/jsdoc/templates/default/tmpl/exceptions.tmpl b/node_modules/jsdoc/templates/default/tmpl/exceptions.tmpl index 78c4e25..9cef6c7 100644 --- a/node_modules/jsdoc/templates/default/tmpl/exceptions.tmpl +++ b/node_modules/jsdoc/templates/default/tmpl/exceptions.tmpl @@ -8,6 +8,7 @@ +
        @@ -18,6 +19,7 @@
        +
        diff --git a/node_modules/jsdoc/templates/default/tmpl/layout.tmpl b/node_modules/jsdoc/templates/default/tmpl/layout.tmpl index 92cd6ee..389831f 100644 --- a/node_modules/jsdoc/templates/default/tmpl/layout.tmpl +++ b/node_modules/jsdoc/templates/default/tmpl/layout.tmpl @@ -26,7 +26,7 @@ -
        +